sf-agentpmd 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +7 -5
- package/dist/commands/agentpmd/analyze.js +4141 -109
- package/dist/commands/agentpmd/analyze.js.map +7 -1
- package/dist/commands/agentpmd/install-skill.js +42 -31
- package/dist/commands/agentpmd/install-skill.js.map +7 -1
- package/dist/index.js +4155 -3
- package/dist/index.js.map +7 -1
- package/oclif.manifest.json +2 -2
- package/package.json +7 -8
- package/dist/analyzer/action-references.d.ts +0 -21
- package/dist/analyzer/action-references.js +0 -130
- package/dist/analyzer/action-references.js.map +0 -1
- package/dist/analyzer/analyze.d.ts +0 -43
- package/dist/analyzer/analyze.js +0 -222
- package/dist/analyzer/analyze.js.map +0 -1
- package/dist/analyzer/apex-analyze.d.ts +0 -14
- package/dist/analyzer/apex-analyze.js +0 -60
- package/dist/analyzer/apex-analyze.js.map +0 -1
- package/dist/analyzer/apex-complexity.d.ts +0 -27
- package/dist/analyzer/apex-complexity.js +0 -133
- package/dist/analyzer/apex-complexity.js.map +0 -1
- package/dist/analyzer/apex-parse.d.ts +0 -39
- package/dist/analyzer/apex-parse.js +0 -32
- package/dist/analyzer/apex-parse.js.map +0 -1
- package/dist/analyzer/apex-resolve.d.ts +0 -32
- package/dist/analyzer/apex-resolve.js +0 -59
- package/dist/analyzer/apex-resolve.js.map +0 -1
- package/dist/analyzer/complexity.d.ts +0 -30
- package/dist/analyzer/complexity.js +0 -126
- package/dist/analyzer/complexity.js.map +0 -1
- package/dist/analyzer/parse.d.ts +0 -51
- package/dist/analyzer/parse.js +0 -143
- package/dist/analyzer/parse.js.map +0 -1
- package/dist/analyzer/project.d.ts +0 -12
- package/dist/analyzer/project.js +0 -51
- package/dist/analyzer/project.js.map +0 -1
- package/dist/analyzer/types.d.ts +0 -76
- package/dist/analyzer/types.js +0 -2
- package/dist/analyzer/types.js.map +0 -1
- package/dist/commands/agentpmd/analyze.d.ts +0 -20
- package/dist/commands/agentpmd/install-skill.d.ts +0 -11
- package/dist/index.d.ts +0 -3
- package/dist/renderers/csv.d.ts +0 -6
- package/dist/renderers/csv.js +0 -78
- package/dist/renderers/csv.js.map +0 -1
- package/dist/renderers/index.d.ts +0 -8
- package/dist/renderers/index.js +0 -25
- package/dist/renderers/index.js.map +0 -1
- package/dist/renderers/markdown.d.ts +0 -12
- package/dist/renderers/markdown.js +0 -233
- package/dist/renderers/markdown.js.map +0 -1
- package/dist/renderers/options.d.ts +0 -20
- package/dist/renderers/options.js +0 -2
- package/dist/renderers/options.js.map +0 -1
- package/dist/renderers/sarif.d.ts +0 -3
- package/dist/renderers/sarif.js +0 -131
- package/dist/renderers/sarif.js.map +0 -1
- package/dist/renderers/text.d.ts +0 -3
- package/dist/renderers/text.js +0 -243
- package/dist/renderers/text.js.map +0 -1
- package/vendor/agentscript-parser-javascript/dist/cst-node.d.ts +0 -83
- package/vendor/agentscript-parser-javascript/dist/cst-node.js +0 -238
- package/vendor/agentscript-parser-javascript/dist/errors.d.ts +0 -34
- package/vendor/agentscript-parser-javascript/dist/errors.js +0 -74
- package/vendor/agentscript-parser-javascript/dist/expressions.d.ts +0 -36
- package/vendor/agentscript-parser-javascript/dist/expressions.js +0 -682
- package/vendor/agentscript-parser-javascript/dist/highlighter.d.ts +0 -24
- package/vendor/agentscript-parser-javascript/dist/highlighter.js +0 -260
- package/vendor/agentscript-parser-javascript/dist/index.d.ts +0 -29
- package/vendor/agentscript-parser-javascript/dist/index.js +0 -35
- package/vendor/agentscript-parser-javascript/dist/lexer.d.ts +0 -60
- package/vendor/agentscript-parser-javascript/dist/lexer.js +0 -630
- package/vendor/agentscript-parser-javascript/dist/parse-mapping.d.ts +0 -46
- package/vendor/agentscript-parser-javascript/dist/parse-mapping.js +0 -549
- package/vendor/agentscript-parser-javascript/dist/parse-sequence.d.ts +0 -10
- package/vendor/agentscript-parser-javascript/dist/parse-sequence.js +0 -118
- package/vendor/agentscript-parser-javascript/dist/parse-statements.d.ts +0 -15
- package/vendor/agentscript-parser-javascript/dist/parse-statements.js +0 -519
- package/vendor/agentscript-parser-javascript/dist/parse-templates.d.ts +0 -15
- package/vendor/agentscript-parser-javascript/dist/parse-templates.js +0 -323
- package/vendor/agentscript-parser-javascript/dist/parser.d.ts +0 -65
- package/vendor/agentscript-parser-javascript/dist/parser.js +0 -163
- package/vendor/agentscript-parser-javascript/dist/recovery.d.ts +0 -51
- package/vendor/agentscript-parser-javascript/dist/recovery.js +0 -199
- package/vendor/agentscript-parser-javascript/dist/token.d.ts +0 -58
- package/vendor/agentscript-parser-javascript/dist/token.js +0 -62
- package/vendor/agentscript-parser-javascript/package.json +0 -19
- package/vendor/agentscript-types/dist/comment.d.ts +0 -11
- package/vendor/agentscript-types/dist/comment.js +0 -10
- package/vendor/agentscript-types/dist/cst.d.ts +0 -7
- package/vendor/agentscript-types/dist/cst.js +0 -8
- package/vendor/agentscript-types/dist/diagnostic.d.ts +0 -34
- package/vendor/agentscript-types/dist/diagnostic.js +0 -23
- package/vendor/agentscript-types/dist/index.d.ts +0 -9
- package/vendor/agentscript-types/dist/index.js +0 -10
- package/vendor/agentscript-types/dist/position.d.ts +0 -11
- package/vendor/agentscript-types/dist/position.js +0 -16
- package/vendor/agentscript-types/dist/syntax-node.d.ts +0 -39
- package/vendor/agentscript-types/dist/syntax-node.js +0 -8
- package/vendor/agentscript-types/package.json +0 -15
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Recovery and utility functions extracted from parser.ts.
|
|
9
|
-
*
|
|
10
|
-
* All functions take a ParserContext as their first argument,
|
|
11
|
-
* following the free-function pattern established by expressions.ts.
|
|
12
|
-
*/
|
|
13
|
-
import { TokenKind } from './token.js';
|
|
14
|
-
import { CSTNode } from './cst-node.js';
|
|
15
|
-
import { makeErrorNode, tokenToAutoLeaf } from './errors.js';
|
|
16
|
-
// --- Error recovery ---
|
|
17
|
-
/** Create an empty ERROR node at the current position. */
|
|
18
|
-
export function makeEmptyError(ctx) {
|
|
19
|
-
const offset = ctx.peekOffset();
|
|
20
|
-
const pos = ctx.peek().start;
|
|
21
|
-
return new CSTNode('ERROR', ctx.source, offset, offset, pos, pos, true, true);
|
|
22
|
-
}
|
|
23
|
-
/** Insert a missing target: `target: (expression (atom (ERROR)))` */
|
|
24
|
-
export function addMissingTarget(ctx, node) {
|
|
25
|
-
const errAtom = makeEmptyError(ctx);
|
|
26
|
-
const atom = new CSTNode('atom', ctx.source, errAtom.startOffset, errAtom.endOffset, errAtom.startPosition, errAtom.endPosition);
|
|
27
|
-
atom.appendChild(errAtom);
|
|
28
|
-
const expr = new CSTNode('expression', ctx.source, atom.startOffset, atom.endOffset, atom.startPosition, atom.endPosition);
|
|
29
|
-
expr.appendChild(atom);
|
|
30
|
-
node.appendChild(expr, 'target');
|
|
31
|
-
}
|
|
32
|
-
/** Create a MISSING node — an expected token/node that wasn't found in source. */
|
|
33
|
-
export function makeMissing(ctx, type) {
|
|
34
|
-
const offset = ctx.peekOffset();
|
|
35
|
-
const pos = ctx.peek().start;
|
|
36
|
-
return new CSTNode(type, ctx.source, offset, offset, pos, pos, true, false, true);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Parse a standalone else/elif/for (without a preceding if, or unsupported).
|
|
40
|
-
* Wraps the entire block in an ERROR node, preserving parsed statements inside.
|
|
41
|
-
*
|
|
42
|
-
* @param parseProcedure - callback to parse procedure bodies, avoiding circular
|
|
43
|
-
* dependency with parse-statements.ts
|
|
44
|
-
*/
|
|
45
|
-
export function parseOrphanBlock(ctx, parseProcedure) {
|
|
46
|
-
const startOffset = ctx.peekOffset();
|
|
47
|
-
const startPos = ctx.peek().start;
|
|
48
|
-
const children = [];
|
|
49
|
-
// Consume keyword and any tokens up to colon/newline.
|
|
50
|
-
// Capture consumed tokens as children of the ERROR for dialect recovery.
|
|
51
|
-
const keywordTok = ctx.consume();
|
|
52
|
-
const kwOffset = ctx.currentOffset();
|
|
53
|
-
children.push(new CSTNode(keywordTok.text, ctx.source, kwOffset, kwOffset + keywordTok.text.length, keywordTok.start, keywordTok.end, false));
|
|
54
|
-
while (!ctx.isAtSyncPoint() &&
|
|
55
|
-
!isAtEnd(ctx) &&
|
|
56
|
-
ctx.peekKind() !== TokenKind.COLON) {
|
|
57
|
-
ctx.consume(); // consume but don't add as named children — they're noise
|
|
58
|
-
}
|
|
59
|
-
// Consume colon if present
|
|
60
|
-
if (ctx.peekKind() === TokenKind.COLON)
|
|
61
|
-
ctx.consume();
|
|
62
|
-
// Consume the body block
|
|
63
|
-
if (ctx.peekKind() === TokenKind.INDENT) {
|
|
64
|
-
ctx.consume();
|
|
65
|
-
const proc = parseProcedure(ctx);
|
|
66
|
-
if (proc) {
|
|
67
|
-
for (const child of proc.namedChildren) {
|
|
68
|
-
children.push(child);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
// Consume trailing comments left by parseProcedure's isTrailingCommentOnly guard
|
|
72
|
-
while (ctx.peekKind() === TokenKind.COMMENT ||
|
|
73
|
-
ctx.peekKind() === TokenKind.NEWLINE) {
|
|
74
|
-
if (ctx.peekKind() === TokenKind.COMMENT) {
|
|
75
|
-
children.push(ctx.consumeNamed('comment'));
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
ctx.consume();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (ctx.peekKind() === TokenKind.DEDENT)
|
|
82
|
-
ctx.consume();
|
|
83
|
-
}
|
|
84
|
-
if (ctx.peekKind() === TokenKind.NEWLINE)
|
|
85
|
-
ctx.consume();
|
|
86
|
-
const endOffset = children.length > 0
|
|
87
|
-
? children[children.length - 1].endOffset
|
|
88
|
-
: ctx.peekOffset();
|
|
89
|
-
const endPos = children.length > 0
|
|
90
|
-
? children[children.length - 1].endPosition
|
|
91
|
-
: ctx.peek().start;
|
|
92
|
-
return makeErrorNode(ctx.source, children, startOffset, endOffset, startPos, endPos);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Consume any leftover tokens in an indented block (before DEDENT) as ERROR
|
|
96
|
-
* nodes. Prevents cascading failures when parseBlockValue() only partially
|
|
97
|
-
* consumes the block content (e.g., unquoted multi-word text).
|
|
98
|
-
*/
|
|
99
|
-
export function recoverToBlockEnd(ctx, parent) {
|
|
100
|
-
while (!isAtEnd(ctx) && ctx.peekKind() !== TokenKind.DEDENT) {
|
|
101
|
-
if (ctx.peekKind() === TokenKind.NEWLINE) {
|
|
102
|
-
ctx.consume();
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
// Skip over nested indented blocks within the error zone
|
|
106
|
-
if (ctx.peekKind() === TokenKind.INDENT) {
|
|
107
|
-
ctx.consume();
|
|
108
|
-
recoverToBlockEnd(ctx, parent);
|
|
109
|
-
if (ctx.peekKind() === TokenKind.DEDENT)
|
|
110
|
-
ctx.consume();
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
const err = synchronize(ctx);
|
|
114
|
-
if (err) {
|
|
115
|
-
parent.appendChild(err);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Synchronize: skip tokens until a stopping condition is met.
|
|
124
|
-
* Returns an ERROR node wrapping the skipped content, or null if
|
|
125
|
-
* nothing was consumed.
|
|
126
|
-
*
|
|
127
|
-
* @param extraStop - optional predicate for additional stop conditions
|
|
128
|
-
* beyond the default sync points (NEWLINE/DEDENT/EOF)
|
|
129
|
-
*/
|
|
130
|
-
export function synchronizeUntil(ctx, extraStop) {
|
|
131
|
-
if (ctx.isAtSyncPoint() || isAtEnd(ctx))
|
|
132
|
-
return null;
|
|
133
|
-
if (extraStop && extraStop(ctx.peekKind(), ctx.peek().start.row))
|
|
134
|
-
return null;
|
|
135
|
-
const startOffset = ctx.peekOffset();
|
|
136
|
-
const startPos = ctx.peek().start;
|
|
137
|
-
const children = [];
|
|
138
|
-
while (!ctx.isAtSyncPoint() &&
|
|
139
|
-
!isAtEnd(ctx) &&
|
|
140
|
-
!(extraStop && extraStop(ctx.peekKind(), ctx.peek().start.row))) {
|
|
141
|
-
const tok = ctx.consume();
|
|
142
|
-
children.push(tokenToAutoLeaf(tok, ctx.source, ctx.currentOffset()));
|
|
143
|
-
}
|
|
144
|
-
if (children.length === 0)
|
|
145
|
-
return null;
|
|
146
|
-
const last = children[children.length - 1];
|
|
147
|
-
return makeErrorNode(ctx.source, children, startOffset, last.endOffset, startPos, last.endPosition);
|
|
148
|
-
}
|
|
149
|
-
/** Skip tokens on the given row until a sync point, INDENT, or COLON. */
|
|
150
|
-
export function synchronizeRowUntilColon(ctx, row) {
|
|
151
|
-
return synchronizeUntil(ctx, (kind, r) => kind === TokenKind.INDENT || kind === TokenKind.COLON || r !== row);
|
|
152
|
-
}
|
|
153
|
-
/** Skip tokens on the given row until a sync point or INDENT. */
|
|
154
|
-
export function synchronizeRow(ctx, row) {
|
|
155
|
-
return synchronizeUntil(ctx, (kind, r) => kind === TokenKind.INDENT || r !== row);
|
|
156
|
-
}
|
|
157
|
-
/** Skip tokens until the next sync point (NEWLINE/DEDENT/EOF). */
|
|
158
|
-
export function synchronize(ctx) {
|
|
159
|
-
return synchronizeUntil(ctx);
|
|
160
|
-
}
|
|
161
|
-
// --- Utility ---
|
|
162
|
-
export function skipNewlines(ctx) {
|
|
163
|
-
while (ctx.peekKind() === TokenKind.NEWLINE) {
|
|
164
|
-
ctx.consume();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/** Consume comment and newline tokens and attach to parent node. */
|
|
168
|
-
export function consumeCommentsAndSkipNewlines(ctx, parent) {
|
|
169
|
-
while (true) {
|
|
170
|
-
if (ctx.peekKind() === TokenKind.COMMENT) {
|
|
171
|
-
parent.appendChild(ctx.consumeNamed('comment'));
|
|
172
|
-
}
|
|
173
|
-
else if (ctx.peekKind() === TokenKind.NEWLINE) {
|
|
174
|
-
ctx.consume();
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
export function isAtEnd(ctx) {
|
|
182
|
-
return ctx.peekKind() === TokenKind.EOF;
|
|
183
|
-
}
|
|
184
|
-
/** Check if from current position, there are only comments, newlines, and then EOF/DEDENT. */
|
|
185
|
-
export function isTrailingCommentOnly(ctx) {
|
|
186
|
-
let i = 0;
|
|
187
|
-
while (i < 50) {
|
|
188
|
-
const tok = ctx.peekAt(i);
|
|
189
|
-
if (tok.kind === TokenKind.EOF || tok.kind === TokenKind.DEDENT)
|
|
190
|
-
return true;
|
|
191
|
-
if (tok.kind === TokenKind.COMMENT || tok.kind === TokenKind.NEWLINE) {
|
|
192
|
-
i++;
|
|
193
|
-
continue;
|
|
194
|
-
}
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
return false; // Exceeded lookahead limit
|
|
198
|
-
}
|
|
199
|
-
//# sourceMappingURL=recovery.js.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/** Token kinds produced by the lexer. */
|
|
2
|
-
export declare enum TokenKind {
|
|
3
|
-
NEWLINE = "NEWLINE",
|
|
4
|
-
INDENT = "INDENT",
|
|
5
|
-
DEDENT = "DEDENT",
|
|
6
|
-
EOF = "EOF",
|
|
7
|
-
ID = "ID",
|
|
8
|
-
NUMBER = "NUMBER",
|
|
9
|
-
STRING = "STRING",
|
|
10
|
-
STRING_CONTENT = "STRING_CONTENT",
|
|
11
|
-
ESCAPE_SEQUENCE = "ESCAPE_SEQUENCE",
|
|
12
|
-
DATETIME = "DATETIME",
|
|
13
|
-
TEMPLATE_CONTENT = "TEMPLATE_CONTENT",
|
|
14
|
-
PLUS = "PLUS",
|
|
15
|
-
MINUS = "MINUS",
|
|
16
|
-
STAR = "STAR",
|
|
17
|
-
SLASH = "SLASH",
|
|
18
|
-
DOT = "DOT",
|
|
19
|
-
COMMA = "COMMA",
|
|
20
|
-
COLON = "COLON",
|
|
21
|
-
EQ = "EQ",
|
|
22
|
-
EQEQ = "EQEQ",
|
|
23
|
-
NEQ = "NEQ",
|
|
24
|
-
LT = "LT",
|
|
25
|
-
GT = "GT",
|
|
26
|
-
LTE = "LTE",
|
|
27
|
-
GTE = "GTE",
|
|
28
|
-
ARROW = "ARROW",
|
|
29
|
-
ELLIPSIS = "ELLIPSIS",
|
|
30
|
-
PERCENT = "PERCENT",
|
|
31
|
-
PIPE = "PIPE",
|
|
32
|
-
AT = "AT",
|
|
33
|
-
LPAREN = "LPAREN",
|
|
34
|
-
RPAREN = "RPAREN",
|
|
35
|
-
LBRACKET = "LBRACKET",
|
|
36
|
-
RBRACKET = "RBRACKET",
|
|
37
|
-
LBRACE = "LBRACE",
|
|
38
|
-
RBRACE = "RBRACE",
|
|
39
|
-
TEMPLATE_EXPR_START = "TEMPLATE_EXPR_START",// {!
|
|
40
|
-
DASH_SPACE = "DASH_SPACE",// "- " at start of line
|
|
41
|
-
DQUOTE = "DQUOTE",
|
|
42
|
-
COMMENT = "COMMENT",
|
|
43
|
-
ERROR_TOKEN = "ERROR_TOKEN"
|
|
44
|
-
}
|
|
45
|
-
export interface Position {
|
|
46
|
-
row: number;
|
|
47
|
-
column: number;
|
|
48
|
-
}
|
|
49
|
-
export interface Token<K extends TokenKind = TokenKind> {
|
|
50
|
-
readonly kind: K;
|
|
51
|
-
text: string;
|
|
52
|
-
start: Position;
|
|
53
|
-
end: Position;
|
|
54
|
-
/** Byte offset into the source string where this token starts. */
|
|
55
|
-
startOffset: number;
|
|
56
|
-
}
|
|
57
|
-
export declare function isTokenKind<K extends TokenKind>(token: Token, kind: K): token is Token<K>;
|
|
58
|
-
//# sourceMappingURL=token.d.ts.map
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
/** Token kinds produced by the lexer. */
|
|
8
|
-
export var TokenKind;
|
|
9
|
-
(function (TokenKind) {
|
|
10
|
-
// Synthetic indentation tokens
|
|
11
|
-
TokenKind["NEWLINE"] = "NEWLINE";
|
|
12
|
-
TokenKind["INDENT"] = "INDENT";
|
|
13
|
-
TokenKind["DEDENT"] = "DEDENT";
|
|
14
|
-
TokenKind["EOF"] = "EOF";
|
|
15
|
-
// Identifiers & literals
|
|
16
|
-
TokenKind["ID"] = "ID";
|
|
17
|
-
TokenKind["NUMBER"] = "NUMBER";
|
|
18
|
-
TokenKind["STRING"] = "STRING";
|
|
19
|
-
TokenKind["STRING_CONTENT"] = "STRING_CONTENT";
|
|
20
|
-
TokenKind["ESCAPE_SEQUENCE"] = "ESCAPE_SEQUENCE";
|
|
21
|
-
TokenKind["DATETIME"] = "DATETIME";
|
|
22
|
-
TokenKind["TEMPLATE_CONTENT"] = "TEMPLATE_CONTENT";
|
|
23
|
-
// Operators
|
|
24
|
-
TokenKind["PLUS"] = "PLUS";
|
|
25
|
-
TokenKind["MINUS"] = "MINUS";
|
|
26
|
-
TokenKind["STAR"] = "STAR";
|
|
27
|
-
TokenKind["SLASH"] = "SLASH";
|
|
28
|
-
TokenKind["DOT"] = "DOT";
|
|
29
|
-
TokenKind["COMMA"] = "COMMA";
|
|
30
|
-
TokenKind["COLON"] = "COLON";
|
|
31
|
-
TokenKind["EQ"] = "EQ";
|
|
32
|
-
TokenKind["EQEQ"] = "EQEQ";
|
|
33
|
-
TokenKind["NEQ"] = "NEQ";
|
|
34
|
-
TokenKind["LT"] = "LT";
|
|
35
|
-
TokenKind["GT"] = "GT";
|
|
36
|
-
TokenKind["LTE"] = "LTE";
|
|
37
|
-
TokenKind["GTE"] = "GTE";
|
|
38
|
-
TokenKind["ARROW"] = "ARROW";
|
|
39
|
-
TokenKind["ELLIPSIS"] = "ELLIPSIS";
|
|
40
|
-
TokenKind["PERCENT"] = "PERCENT";
|
|
41
|
-
TokenKind["PIPE"] = "PIPE";
|
|
42
|
-
TokenKind["AT"] = "AT";
|
|
43
|
-
// Delimiters
|
|
44
|
-
TokenKind["LPAREN"] = "LPAREN";
|
|
45
|
-
TokenKind["RPAREN"] = "RPAREN";
|
|
46
|
-
TokenKind["LBRACKET"] = "LBRACKET";
|
|
47
|
-
TokenKind["RBRACKET"] = "RBRACKET";
|
|
48
|
-
TokenKind["LBRACE"] = "LBRACE";
|
|
49
|
-
TokenKind["RBRACE"] = "RBRACE";
|
|
50
|
-
TokenKind["TEMPLATE_EXPR_START"] = "TEMPLATE_EXPR_START";
|
|
51
|
-
// Sequence
|
|
52
|
-
TokenKind["DASH_SPACE"] = "DASH_SPACE";
|
|
53
|
-
// Quote characters (for CST fidelity)
|
|
54
|
-
TokenKind["DQUOTE"] = "DQUOTE";
|
|
55
|
-
// Special
|
|
56
|
-
TokenKind["COMMENT"] = "COMMENT";
|
|
57
|
-
TokenKind["ERROR_TOKEN"] = "ERROR_TOKEN";
|
|
58
|
-
})(TokenKind || (TokenKind = {}));
|
|
59
|
-
export function isTokenKind(token, kind) {
|
|
60
|
-
return token.kind === kind;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=token.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@agentscript/parser-javascript",
|
|
3
|
-
"version": "2.4.0",
|
|
4
|
-
"license": "Apache-2.0",
|
|
5
|
-
"description": "Vendored from salesforce/agentscript packages/parser-javascript — hand-written TypeScript parser.",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@agentscript/types": "file:../agentscript-types",
|
|
17
|
-
"tiny-invariant": "^1.3.3"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Range } from './position.js';
|
|
2
|
-
/** Where a comment is placed relative to its owning AST node. */
|
|
3
|
-
export type CommentAttachment = 'leading' | 'inline' | 'trailing';
|
|
4
|
-
/** A parsed source comment. Range is only present for parsed comments. */
|
|
5
|
-
export interface Comment {
|
|
6
|
-
value: string;
|
|
7
|
-
attachment: CommentAttachment;
|
|
8
|
-
range?: Range;
|
|
9
|
-
}
|
|
10
|
-
export declare function comment(value: string, attachment?: CommentAttachment): Comment;
|
|
11
|
-
//# sourceMappingURL=comment.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
export function comment(value, attachment = 'leading') {
|
|
8
|
-
return { value, attachment };
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=comment.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=cst.js.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Range } from './position.js';
|
|
2
|
-
/**
|
|
3
|
-
* LSP DiagnosticSeverity values. MUST NOT be changed -- LSP clients depend on these exact values.
|
|
4
|
-
* @see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticSeverity
|
|
5
|
-
*/
|
|
6
|
-
export declare enum DiagnosticSeverity {
|
|
7
|
-
Error = 1,
|
|
8
|
-
Warning = 2,
|
|
9
|
-
Information = 3,
|
|
10
|
-
Hint = 4
|
|
11
|
-
}
|
|
12
|
-
export declare enum DiagnosticTag {
|
|
13
|
-
Unnecessary = 1,
|
|
14
|
-
Deprecated = 2
|
|
15
|
-
}
|
|
16
|
-
export interface Diagnostic {
|
|
17
|
-
range: Range;
|
|
18
|
-
message: string;
|
|
19
|
-
severity: DiagnosticSeverity;
|
|
20
|
-
/** kebab-case, e.g., "syntax-error", "undefined-reference" */
|
|
21
|
-
code?: string;
|
|
22
|
-
/** "agentscript" (parser), "agentscript-schema", or "agentscript-lint" */
|
|
23
|
-
source?: string;
|
|
24
|
-
/** LSP DiagnosticTag values (Unnecessary=1, Deprecated=2) */
|
|
25
|
-
tags?: DiagnosticTag[];
|
|
26
|
-
/** Additional structured data for tooling (LSP-compatible) */
|
|
27
|
-
data?: {
|
|
28
|
-
context?: string;
|
|
29
|
-
expected?: string[];
|
|
30
|
-
found?: string;
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=diagnostic.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* LSP DiagnosticSeverity values. MUST NOT be changed -- LSP clients depend on these exact values.
|
|
9
|
-
* @see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticSeverity
|
|
10
|
-
*/
|
|
11
|
-
export var DiagnosticSeverity;
|
|
12
|
-
(function (DiagnosticSeverity) {
|
|
13
|
-
DiagnosticSeverity[DiagnosticSeverity["Error"] = 1] = "Error";
|
|
14
|
-
DiagnosticSeverity[DiagnosticSeverity["Warning"] = 2] = "Warning";
|
|
15
|
-
DiagnosticSeverity[DiagnosticSeverity["Information"] = 3] = "Information";
|
|
16
|
-
DiagnosticSeverity[DiagnosticSeverity["Hint"] = 4] = "Hint";
|
|
17
|
-
})(DiagnosticSeverity || (DiagnosticSeverity = {}));
|
|
18
|
-
export var DiagnosticTag;
|
|
19
|
-
(function (DiagnosticTag) {
|
|
20
|
-
DiagnosticTag[DiagnosticTag["Unnecessary"] = 1] = "Unnecessary";
|
|
21
|
-
DiagnosticTag[DiagnosticTag["Deprecated"] = 2] = "Deprecated";
|
|
22
|
-
})(DiagnosticTag || (DiagnosticTag = {}));
|
|
23
|
-
//# sourceMappingURL=diagnostic.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type { SyntaxNode } from './syntax-node.js';
|
|
2
|
-
export type { Position, Range } from './position.js';
|
|
3
|
-
export { toRange } from './position.js';
|
|
4
|
-
export type { CstMeta } from './cst.js';
|
|
5
|
-
export type { CommentAttachment, Comment } from './comment.js';
|
|
6
|
-
export { comment } from './comment.js';
|
|
7
|
-
export { DiagnosticSeverity, DiagnosticTag } from './diagnostic.js';
|
|
8
|
-
export type { Diagnostic } from './diagnostic.js';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
export { toRange } from './position.js';
|
|
8
|
-
export { comment } from './comment.js';
|
|
9
|
-
export { DiagnosticSeverity, DiagnosticTag } from './diagnostic.js';
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SyntaxNode } from './syntax-node.js';
|
|
2
|
-
export interface Position {
|
|
3
|
-
line: number;
|
|
4
|
-
character: number;
|
|
5
|
-
}
|
|
6
|
-
export interface Range {
|
|
7
|
-
start: Position;
|
|
8
|
-
end: Position;
|
|
9
|
-
}
|
|
10
|
-
export declare function toRange(node: SyntaxNode): Range;
|
|
11
|
-
//# sourceMappingURL=position.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
export function toRange(node) {
|
|
8
|
-
return {
|
|
9
|
-
start: {
|
|
10
|
-
line: node.startRow,
|
|
11
|
-
character: node.startCol,
|
|
12
|
-
},
|
|
13
|
-
end: { line: node.endRow, character: node.endCol },
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=position.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export interface SyntaxNode {
|
|
2
|
-
type: string;
|
|
3
|
-
text: string;
|
|
4
|
-
startPosition: {
|
|
5
|
-
row: number;
|
|
6
|
-
column: number;
|
|
7
|
-
};
|
|
8
|
-
endPosition: {
|
|
9
|
-
row: number;
|
|
10
|
-
column: number;
|
|
11
|
-
};
|
|
12
|
-
startRow: number;
|
|
13
|
-
startCol: number;
|
|
14
|
-
endRow: number;
|
|
15
|
-
endCol: number;
|
|
16
|
-
namedChildren: SyntaxNode[];
|
|
17
|
-
children: SyntaxNode[];
|
|
18
|
-
childForFieldName(name: string): SyntaxNode | null;
|
|
19
|
-
childrenForFieldName(name: string): SyntaxNode[];
|
|
20
|
-
parent: SyntaxNode | null;
|
|
21
|
-
previousSibling: SyntaxNode | null;
|
|
22
|
-
/** Byte offset of the start of this node in the source text. */
|
|
23
|
-
startOffset?: number;
|
|
24
|
-
/** Byte offset of the end of this node in the source text. */
|
|
25
|
-
endOffset?: number;
|
|
26
|
-
/** Return the field name for the child at the given index, or null. */
|
|
27
|
-
fieldNameForChild?(index: number): string | null;
|
|
28
|
-
/** True if this node is an ERROR node (parse failure). */
|
|
29
|
-
isError?: boolean;
|
|
30
|
-
/** True if this node was inserted by the parser (expected but not found). */
|
|
31
|
-
isMissing?: boolean;
|
|
32
|
-
/** True if this is a "named" node (not anonymous punctuation/keyword). */
|
|
33
|
-
isNamed?: boolean;
|
|
34
|
-
/** True if this node or any descendant has an error. */
|
|
35
|
-
hasError?: boolean;
|
|
36
|
-
/** Return an s-expression string representation of this node (for debugging). */
|
|
37
|
-
toSExp?(): string;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=syntax-node.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=syntax-node.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@agentscript/types",
|
|
3
|
-
"version": "0.2.1",
|
|
4
|
-
"license": "Apache-2.0",
|
|
5
|
-
"description": "Vendored from salesforce/agentscript packages/types — shared foundational types.",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|