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
package/dist/analyzer/parse.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { parse as parseAgent } from '@agentscript/parser-javascript';
|
|
2
|
-
export function parseAgentSource(source) {
|
|
3
|
-
return parseAgent(source).rootNode;
|
|
4
|
-
}
|
|
5
|
-
export function locOf(n) {
|
|
6
|
-
return {
|
|
7
|
-
endCol: n.endCol,
|
|
8
|
-
endRow: n.endRow,
|
|
9
|
-
startCol: n.startCol,
|
|
10
|
-
startRow: n.startRow,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export function walk(node, visit) {
|
|
14
|
-
visit(node);
|
|
15
|
-
for (const c of node.namedChildren)
|
|
16
|
-
walk(c, visit);
|
|
17
|
-
}
|
|
18
|
-
export function* descendants(node) {
|
|
19
|
-
yield node;
|
|
20
|
-
for (const c of node.namedChildren)
|
|
21
|
-
yield* descendants(c);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The block header for a `key` node. AgentScript keys can be plain (`config`)
|
|
25
|
-
* or named (`topic case_creation`, `start_agent customer_verification`).
|
|
26
|
-
* We return the first whitespace-delimited token as the key kind, and the
|
|
27
|
-
* remainder (if any) as the instance label.
|
|
28
|
-
*/
|
|
29
|
-
export function keyHeader(n) {
|
|
30
|
-
if (n.type !== 'key')
|
|
31
|
-
return null;
|
|
32
|
-
const head = n.text.split('\n', 1)[0];
|
|
33
|
-
const colon = head.indexOf(':');
|
|
34
|
-
const lhs = (colon === -1 ? head : head.slice(0, colon)).trim();
|
|
35
|
-
const parts = lhs.split(/\s+/);
|
|
36
|
-
return { kind: parts[0], label: parts.length > 1 ? parts.slice(1).join(' ') : undefined };
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The CST shapes a key/value pair as `mapping_element { key, ':', value }`.
|
|
40
|
-
* Given the mapping_element node, return its key kind + label.
|
|
41
|
-
*/
|
|
42
|
-
export function mappingKeyHeader(m) {
|
|
43
|
-
if (m.type !== 'mapping_element')
|
|
44
|
-
return null;
|
|
45
|
-
const keyNode = m.childForFieldName('key');
|
|
46
|
-
if (!keyNode) {
|
|
47
|
-
// Fall back: first namedChild of type 'key'.
|
|
48
|
-
for (const c of m.namedChildren) {
|
|
49
|
-
if (c.type === 'key')
|
|
50
|
-
return keyHeader(c);
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return keyHeader(keyNode);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* The value-bearing child of a mapping_element. Could be `mapping` (sub-block),
|
|
58
|
-
* `expression_with_to` (scalar/expression), `colinear_value`, `procedure`,
|
|
59
|
-
* `variable_declaration`, etc.
|
|
60
|
-
*
|
|
61
|
-
* A mapping_element can interleave leading `comment` nodes between the `:`/`->`
|
|
62
|
-
* markers and the actual value-bearing child. Skip them so we don't return a
|
|
63
|
-
* comment as the "value."
|
|
64
|
-
*/
|
|
65
|
-
const NON_VALUE_NAMED_TYPES = new Set(['comment', 'key']);
|
|
66
|
-
export function mappingValue(m) {
|
|
67
|
-
if (m.type !== 'mapping_element')
|
|
68
|
-
return undefined;
|
|
69
|
-
for (const c of m.namedChildren) {
|
|
70
|
-
if (!NON_VALUE_NAMED_TYPES.has(c.type))
|
|
71
|
-
return c;
|
|
72
|
-
}
|
|
73
|
-
return undefined;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Within a scope whose body is a `mapping` (the typical case for topic/
|
|
77
|
-
* start_agent/subagent blocks), find the mapping_element whose key matches
|
|
78
|
-
* `kind`, and return its value subtree.
|
|
79
|
-
*/
|
|
80
|
-
export function findMappingEntry(parentBody, kind) {
|
|
81
|
-
for (const c of parentBody.namedChildren) {
|
|
82
|
-
if (c.type !== 'mapping_element')
|
|
83
|
-
continue;
|
|
84
|
-
const h = mappingKeyHeader(c);
|
|
85
|
-
if (h && h.kind === kind)
|
|
86
|
-
return mappingValue(c);
|
|
87
|
-
}
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Walk a scope-key node (topic / start_agent / subagent at top level) and
|
|
92
|
-
* return its body — the `mapping` that holds before_reasoning, after_reasoning,
|
|
93
|
-
* reasoning, actions, etc. The scope-key itself lives inside a mapping_element
|
|
94
|
-
* at the source-file level; the body is the sibling value.
|
|
95
|
-
*/
|
|
96
|
-
export function bodyOf(scopeKey) {
|
|
97
|
-
const { parent } = scopeKey;
|
|
98
|
-
if (!parent)
|
|
99
|
-
return undefined;
|
|
100
|
-
return mappingValue(parent);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Read the `developer_name:` value from the `config:` block of a parsed
|
|
104
|
-
* .agent file. This is the canonical API name of the agent (matches what
|
|
105
|
-
* `sf agent generate authoring-bundle --api-name X` produces). Returns
|
|
106
|
-
* undefined when the field is absent or empty.
|
|
107
|
-
*/
|
|
108
|
-
export function extractDeveloperName(root) {
|
|
109
|
-
const topMapping = root.namedChildren.find(c => c.type === 'mapping') ?? root;
|
|
110
|
-
for (const c of topMapping.namedChildren) {
|
|
111
|
-
if (c.type !== 'mapping_element')
|
|
112
|
-
continue;
|
|
113
|
-
const keyNode = c.childForFieldName('key') ?? c.namedChildren.find(n => n.type === 'key');
|
|
114
|
-
if (!keyNode)
|
|
115
|
-
continue;
|
|
116
|
-
const h = keyHeader(keyNode);
|
|
117
|
-
if (!h || h.kind !== 'config')
|
|
118
|
-
continue;
|
|
119
|
-
const body = mappingValue(c);
|
|
120
|
-
if (!body)
|
|
121
|
-
return undefined;
|
|
122
|
-
const devNameVal = findMappingEntry(body, 'developer_name');
|
|
123
|
-
if (!devNameVal)
|
|
124
|
-
return undefined;
|
|
125
|
-
return extractStringLiteral(devNameVal);
|
|
126
|
-
}
|
|
127
|
-
return undefined;
|
|
128
|
-
}
|
|
129
|
-
/** Convenience: extract a leaf string literal text (without surrounding quotes). */
|
|
130
|
-
export function extractStringLiteral(n) {
|
|
131
|
-
for (const d of descendants(n)) {
|
|
132
|
-
if (d.type === 'string') {
|
|
133
|
-
const t = d.text;
|
|
134
|
-
if (t.startsWith('"') && t.endsWith('"'))
|
|
135
|
-
return t.slice(1, -1);
|
|
136
|
-
if (t.startsWith("'") && t.endsWith("'"))
|
|
137
|
-
return t.slice(1, -1);
|
|
138
|
-
return t;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
//# sourceMappingURL=parse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/analyzer/parse.ts"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MAAM,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QAC5B,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU;YAAE,OAAO,SAAS,CAAC;QAClC,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,oBAAoB,CAAC,CAAa;IAChD,KAAK,MAAM,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACxB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACjB,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAChE,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface SfdxProject {
|
|
2
|
-
/** Absolute paths of every `packageDirectories[].path`, in declaration order. */
|
|
3
|
-
packageDirectories: string[];
|
|
4
|
-
/** Absolute path of the project root (the directory containing sfdx-project.json). */
|
|
5
|
-
root: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Walk up from `startDir` until we find a directory containing
|
|
9
|
-
* `sfdx-project.json`, then return its root + resolved package directories.
|
|
10
|
-
* Returns undefined when no project is found.
|
|
11
|
-
*/
|
|
12
|
-
export declare function discoverSfdxProject(startDir: string): Promise<SfdxProject | undefined>;
|
package/dist/analyzer/project.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { readFile, stat } from 'node:fs/promises';
|
|
2
|
-
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
3
|
-
/**
|
|
4
|
-
* Walk up from `startDir` until we find a directory containing
|
|
5
|
-
* `sfdx-project.json`, then return its root + resolved package directories.
|
|
6
|
-
* Returns undefined when no project is found.
|
|
7
|
-
*/
|
|
8
|
-
export async function discoverSfdxProject(startDir) {
|
|
9
|
-
let dir = resolve(startDir);
|
|
10
|
-
while (true) {
|
|
11
|
-
const candidate = join(dir, 'sfdx-project.json');
|
|
12
|
-
const s = await stat(candidate).catch(() => { });
|
|
13
|
-
if (s?.isFile()) {
|
|
14
|
-
return readProject(dir, candidate);
|
|
15
|
-
}
|
|
16
|
-
const parent = dirname(dir);
|
|
17
|
-
if (parent === dir)
|
|
18
|
-
return undefined;
|
|
19
|
-
dir = parent;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
async function readProject(root, jsonPath) {
|
|
23
|
-
const raw = await readFile(jsonPath, 'utf8');
|
|
24
|
-
let parsed;
|
|
25
|
-
try {
|
|
26
|
-
parsed = JSON.parse(raw);
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
throw new Error(`failed to parse ${jsonPath}: ${error.message}`);
|
|
30
|
-
}
|
|
31
|
-
const pkgs = extractPackageDirectories(parsed, root);
|
|
32
|
-
return { packageDirectories: pkgs, root };
|
|
33
|
-
}
|
|
34
|
-
function extractPackageDirectories(parsed, root) {
|
|
35
|
-
if (!parsed || typeof parsed !== 'object')
|
|
36
|
-
return [];
|
|
37
|
-
const obj = parsed;
|
|
38
|
-
if (!Array.isArray(obj.packageDirectories))
|
|
39
|
-
return [];
|
|
40
|
-
const out = [];
|
|
41
|
-
for (const entry of obj.packageDirectories) {
|
|
42
|
-
if (!entry || typeof entry !== 'object')
|
|
43
|
-
continue;
|
|
44
|
-
const pathField = entry.path;
|
|
45
|
-
if (typeof pathField !== 'string' || pathField.length === 0)
|
|
46
|
-
continue;
|
|
47
|
-
out.push(isAbsolute(pathField) ? pathField : resolve(root, pathField));
|
|
48
|
-
}
|
|
49
|
-
return out;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=project.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/analyzer/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAS/D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAAgB;IAEhB,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;QACjD,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;YAChB,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QACrC,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,SAAS,CAAC;QACrC,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,IAAY,EAAE,QAAgB;IACvD,MAAM,GAAG,GAAG,MAAM,QAAQ,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
|
-
export interface SourceLocation {
|
|
2
|
-
endCol: number;
|
|
3
|
-
endRow: number;
|
|
4
|
-
startCol: number;
|
|
5
|
-
startRow: number;
|
|
6
|
-
}
|
|
7
|
-
export interface ProcedureCC {
|
|
8
|
-
complexity: number;
|
|
9
|
-
contributors: CCContributor[];
|
|
10
|
-
kind: 'after_reasoning' | 'available_when' | 'before_reasoning' | 'other' | 'reasoning_instructions';
|
|
11
|
-
location: SourceLocation;
|
|
12
|
-
scope: string;
|
|
13
|
-
}
|
|
14
|
-
export interface CCContributor {
|
|
15
|
-
kind: 'elif_clause' | 'if_statement' | 'short_circuit_and' | 'short_circuit_or' | 'ternary_expression';
|
|
16
|
-
location: SourceLocation;
|
|
17
|
-
}
|
|
18
|
-
export type ActionTargetKind = 'apex' | 'flow' | 'prompt' | 'unknown' | 'utils';
|
|
19
|
-
export interface ActionDeclaration {
|
|
20
|
-
location: SourceLocation;
|
|
21
|
-
name: string;
|
|
22
|
-
scope: string;
|
|
23
|
-
target?: string;
|
|
24
|
-
targetKind: ActionTargetKind;
|
|
25
|
-
}
|
|
26
|
-
export type ActionReferenceContext = 'after_reasoning_run' | 'before_reasoning_run' | 'reasoning_actions' | 'reasoning_instructions_run' | 'transition' | 'unknown';
|
|
27
|
-
export interface ActionReference {
|
|
28
|
-
context: ActionReferenceContext;
|
|
29
|
-
location: SourceLocation;
|
|
30
|
-
name: string;
|
|
31
|
-
scope: string;
|
|
32
|
-
}
|
|
33
|
-
export interface FileReport {
|
|
34
|
-
declarations: ActionDeclaration[];
|
|
35
|
-
fileComplexity: number;
|
|
36
|
-
parseErrors: ParseDiagnostic[];
|
|
37
|
-
path: string;
|
|
38
|
-
procedures: ProcedureCC[];
|
|
39
|
-
references: ActionReference[];
|
|
40
|
-
}
|
|
41
|
-
export interface ParseDiagnostic {
|
|
42
|
-
location: SourceLocation;
|
|
43
|
-
message: string;
|
|
44
|
-
}
|
|
45
|
-
export interface AnalysisReport {
|
|
46
|
-
apexClasses: ApexClassReport[];
|
|
47
|
-
byTargetKind: Record<ActionTargetKind, number>;
|
|
48
|
-
files: FileReport[];
|
|
49
|
-
totalApexComplexity: number;
|
|
50
|
-
totalComplexity: number;
|
|
51
|
-
totalDeclarations: number;
|
|
52
|
-
totalReferences: number;
|
|
53
|
-
unresolvedApexTargets: string[];
|
|
54
|
-
}
|
|
55
|
-
export type ApexCCContributorKind = 'catch_clause' | 'do_while_statement' | 'for_statement' | 'if_statement' | 'short_circuit_and' | 'short_circuit_or' | 'ternary' | 'when_arm' | 'while_statement';
|
|
56
|
-
export interface ApexCCContributor {
|
|
57
|
-
kind: ApexCCContributorKind;
|
|
58
|
-
location: SourceLocation;
|
|
59
|
-
}
|
|
60
|
-
export interface ApexMethodCC {
|
|
61
|
-
complexity: number;
|
|
62
|
-
contributors: ApexCCContributor[];
|
|
63
|
-
kind: 'constructor' | 'method';
|
|
64
|
-
location: SourceLocation;
|
|
65
|
-
name: string;
|
|
66
|
-
signature: string;
|
|
67
|
-
}
|
|
68
|
-
export interface ApexClassReport {
|
|
69
|
-
classComplexity: number;
|
|
70
|
-
className: string;
|
|
71
|
-
methods: ApexMethodCC[];
|
|
72
|
-
parseErrors: ParseDiagnostic[];
|
|
73
|
-
path: string;
|
|
74
|
-
/** Bundles or actions whose target resolves here. */
|
|
75
|
-
referencedBy: string[];
|
|
76
|
-
}
|
package/dist/analyzer/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/analyzer/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import type { AnalysisReport } from '../../analyzer/types.js';
|
|
3
|
-
export default class AgentpmdAnalyze extends SfCommand<AnalysisReport> {
|
|
4
|
-
static readonly description = "Walks .agent source files under --source-dir and emits per-procedure\ncyclomatic complexity totals (before_reasoning, after_reasoning, and\nreasoning.instructions blocks), plus an inventory of declared and used\n@actions.X targets. For every apex:// target, resolves the .cls file\nand computes per-method Apex CC.\n\nDefault output is human-readable text. --json emits the SF CLI envelope\nwith the full structured report. --format <markdown|sarif|csv> emits the\nnamed format on stdout for piping into PR comments, GitHub Code Scanning,\nor spreadsheet pivots.";
|
|
5
|
-
static readonly examples: string[];
|
|
6
|
-
static readonly flags: {
|
|
7
|
-
'apex-source': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
'api-name': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
ascii: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
'fail-on': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
-
'sarif-error': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
'sarif-warning': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
-
'source-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
-
width: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
-
};
|
|
18
|
-
static readonly summary = "Compute McCabe cyclomatic complexity and action-reference inventory for AgentScript bundles and their Apex backing logic.";
|
|
19
|
-
run(): Promise<AnalysisReport>;
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
export default class AgentpmdInstallSkill extends SfCommand<{
|
|
3
|
-
installed: string;
|
|
4
|
-
}> {
|
|
5
|
-
static readonly description = "Recursively copies the bundled skill tree (SKILL.md plus its references/\npages) to ~/.claude/skills/agentforcepmd/ so Claude Code can use it as a\nskill. Restart Claude Code (or reload skills) afterward to activate it.";
|
|
6
|
-
static readonly examples: string[];
|
|
7
|
-
static readonly summary = "Install the agentforcepmd Claude Code skill to ~/.claude/skills/.";
|
|
8
|
-
run(): Promise<{
|
|
9
|
-
installed: string;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
package/dist/index.d.ts
DELETED
package/dist/renderers/csv.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AnalysisReport } from '../analyzer/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Single CSV with all per-procedure and per-method rows so a spreadsheet
|
|
4
|
-
* can pivot on `type` and `file`. RFC 4180-quoted; first row is the header.
|
|
5
|
-
*/
|
|
6
|
-
export declare function renderCsv(report: AnalysisReport): string;
|
package/dist/renderers/csv.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single CSV with all per-procedure and per-method rows so a spreadsheet
|
|
3
|
-
* can pivot on `type` and `file`. RFC 4180-quoted; first row is the header.
|
|
4
|
-
*/
|
|
5
|
-
export function renderCsv(report) {
|
|
6
|
-
const lines = [];
|
|
7
|
-
lines.push([
|
|
8
|
-
'type',
|
|
9
|
-
'file',
|
|
10
|
-
'scope_or_class',
|
|
11
|
-
'name',
|
|
12
|
-
'complexity',
|
|
13
|
-
'start_row',
|
|
14
|
-
'start_col',
|
|
15
|
-
'contributors',
|
|
16
|
-
]
|
|
17
|
-
.map((c) => csvCell(c))
|
|
18
|
-
.join(','));
|
|
19
|
-
for (const f of report.files) {
|
|
20
|
-
for (const p of f.procedures) {
|
|
21
|
-
lines.push([
|
|
22
|
-
'agent_procedure',
|
|
23
|
-
f.path,
|
|
24
|
-
p.scope,
|
|
25
|
-
p.kind,
|
|
26
|
-
String(p.complexity),
|
|
27
|
-
String(p.location.startRow),
|
|
28
|
-
String(p.location.startCol),
|
|
29
|
-
breakdownProc(p.contributors),
|
|
30
|
-
]
|
|
31
|
-
.map((c) => csvCell(c))
|
|
32
|
-
.join(','));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
for (const cls of report.apexClasses) {
|
|
36
|
-
for (const m of cls.methods) {
|
|
37
|
-
lines.push([
|
|
38
|
-
'apex_method',
|
|
39
|
-
cls.path,
|
|
40
|
-
cls.className,
|
|
41
|
-
m.signature,
|
|
42
|
-
String(m.complexity),
|
|
43
|
-
String(m.location.startRow),
|
|
44
|
-
String(m.location.startCol),
|
|
45
|
-
breakdownApex(m.contributors),
|
|
46
|
-
]
|
|
47
|
-
.map((c) => csvCell(c))
|
|
48
|
-
.join(','));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return lines.join('\n');
|
|
52
|
-
}
|
|
53
|
-
function csvCell(v) {
|
|
54
|
-
// Always quote — keeps the output uniform and lets cells contain
|
|
55
|
-
// commas, quotes, and newlines without per-cell branching.
|
|
56
|
-
return `"${v.replaceAll('"', '""')}"`;
|
|
57
|
-
}
|
|
58
|
-
function breakdownProc(contributors) {
|
|
59
|
-
if (contributors.length === 0)
|
|
60
|
-
return 'base';
|
|
61
|
-
const counts = {};
|
|
62
|
-
for (const c of contributors)
|
|
63
|
-
counts[c.kind] = (counts[c.kind] ?? 0) + 1;
|
|
64
|
-
return Object.entries(counts)
|
|
65
|
-
.map(([k, n]) => `${k}=${n}`)
|
|
66
|
-
.join(';');
|
|
67
|
-
}
|
|
68
|
-
function breakdownApex(contributors) {
|
|
69
|
-
if (contributors.length === 0)
|
|
70
|
-
return 'base';
|
|
71
|
-
const counts = {};
|
|
72
|
-
for (const c of contributors)
|
|
73
|
-
counts[c.kind] = (counts[c.kind] ?? 0) + 1;
|
|
74
|
-
return Object.entries(counts)
|
|
75
|
-
.map(([k, n]) => `${k}=${n}`)
|
|
76
|
-
.join(';');
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=csv.js.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CAAC;IAC1C,KAAK,MAAM,CAAC,IAAI,YAAY;QAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SAC1B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;SAC5B,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AnalysisReport } from '../analyzer/types.js';
|
|
2
|
-
import type { RenderFormat, RenderOptions } from './options.js';
|
|
3
|
-
export declare function render(format: RenderFormat, report: AnalysisReport, options?: RenderOptions): string;
|
|
4
|
-
export { renderCsv } from './csv.js';
|
|
5
|
-
export { renderMarkdown } from './markdown.js';
|
|
6
|
-
export type { RenderFormat, RenderOptions } from './options.js';
|
|
7
|
-
export { renderSarif } from './sarif.js';
|
|
8
|
-
export { renderText } from './text.js';
|
package/dist/renderers/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { renderCsv } from './csv.js';
|
|
2
|
-
import { renderMarkdown } from './markdown.js';
|
|
3
|
-
import { renderSarif } from './sarif.js';
|
|
4
|
-
import { renderText } from './text.js';
|
|
5
|
-
export function render(format, report, options) {
|
|
6
|
-
switch (format) {
|
|
7
|
-
case 'csv': {
|
|
8
|
-
return renderCsv(report);
|
|
9
|
-
}
|
|
10
|
-
case 'markdown': {
|
|
11
|
-
return renderMarkdown(report);
|
|
12
|
-
}
|
|
13
|
-
case 'sarif': {
|
|
14
|
-
return renderSarif(report, options);
|
|
15
|
-
}
|
|
16
|
-
case 'text': {
|
|
17
|
-
return renderText(report, options);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export { renderCsv } from './csv.js';
|
|
22
|
-
export { renderMarkdown } from './markdown.js';
|
|
23
|
-
export { renderSarif } from './sarif.js';
|
|
24
|
-
export { renderText } from './text.js';
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/renderers/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,UAAU,MAAM,CACpB,MAAoB,EACpB,MAAsB,EACtB,OAAuB;IAEvB,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC;QAED,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QAED,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,OAAO,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC;QAED,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AnalysisReport } from '../analyzer/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Renders a GFM Markdown report with a Mermaid bar chart at the top
|
|
4
|
-
* (agent CC vs Apex CC per bundle) followed by per-bundle and per-class
|
|
5
|
-
* drilldown tables. Designed to be portable into PR descriptions, gists,
|
|
6
|
-
* Slack snippets, and whitepaper appendices.
|
|
7
|
-
*
|
|
8
|
-
* Palette is whitepaper § 1: Reasoning hot (#a82820), Conversation amber
|
|
9
|
-
* (#c4942a), Deterministic green (#6b8c52), Scaffolding cool gray (#9aa5ad).
|
|
10
|
-
*/
|
|
11
|
-
export declare function renderMarkdown(report: AnalysisReport): string;
|
|
12
|
-
export { type ApexClassReport } from '../analyzer/types.js';
|