@vibe-agent-toolkit/cli 0.1.41-rc.6 → 0.1.41-rc.7
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/README.md +4 -3
- package/dist/bin/vat +1 -1
- package/dist/bin/vat.js +1 -1
- package/dist/bin/vat.js.map +1 -1
- package/dist/commands/audit/hierarchical-output.d.ts +6 -2
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
- package/dist/commands/audit/hierarchical-output.js +93 -50
- package/dist/commands/audit/hierarchical-output.js.map +1 -1
- package/dist/commands/audit-settings.d.ts +35 -0
- package/dist/commands/audit-settings.d.ts.map +1 -1
- package/dist/commands/audit-settings.js +121 -51
- package/dist/commands/audit-settings.js.map +1 -1
- package/dist/commands/audit.d.ts +63 -1
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +329 -187
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +47 -18
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.d.ts +39 -2
- package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.js +114 -68
- package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/publish.js +5 -4
- package/dist/commands/claude/marketplace/publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +13 -19
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +11 -3
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +70 -20
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/plugin/build.d.ts +93 -0
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +83 -39
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/marketplace-json.d.ts +36 -0
- package/dist/commands/claude/plugin/marketplace-json.d.ts.map +1 -0
- package/dist/commands/claude/plugin/marketplace-json.js +34 -0
- package/dist/commands/claude/plugin/marketplace-json.js.map +1 -0
- package/dist/commands/claude/plugin/plugin-json-merge.d.ts +30 -1
- package/dist/commands/claude/plugin/plugin-json-merge.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-json-merge.js +92 -14
- package/dist/commands/claude/plugin/plugin-json-merge.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +0 -1
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +15 -26
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/doctor.d.ts +57 -8
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +142 -67
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/phase-utils.d.ts +62 -2
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +74 -2
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +13 -6
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +38 -24
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +33 -20
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skills/build.d.ts +51 -0
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +91 -54
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/package.d.ts +2 -0
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +61 -42
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +9 -1
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/validate.d.ts +38 -0
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +125 -70
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +11 -5
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +69 -26
- package/dist/commands/verify.js.map +1 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +0 -2
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/issue-anchor.d.ts +26 -0
- package/dist/utils/issue-anchor.d.ts.map +1 -0
- package/dist/utils/issue-anchor.js +39 -0
- package/dist/utils/issue-anchor.js.map +1 -0
- package/dist/utils/issue-rendering.d.ts +61 -0
- package/dist/utils/issue-rendering.d.ts.map +1 -0
- package/dist/utils/issue-rendering.js +135 -0
- package/dist/utils/issue-rendering.js.map +1 -0
- package/dist/utils/output.d.ts +26 -4
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +27 -6
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/project-root-policy.d.ts +2 -2
- package/dist/utils/project-root-policy.js +2 -2
- package/dist/utils/validate-help-files.d.ts +3 -2
- package/dist/utils/validate-help-files.d.ts.map +1 -1
- package/dist/utils/validate-help-files.js +48 -5
- package/dist/utils/validate-help-files.js.map +1 -1
- package/dist/utils/verdict-helpers.d.ts +10 -2
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +13 -3
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/docs/audit.md +40 -14
- package/docs/doctor.md +46 -10
- package/docs/index.md +1 -1
- package/docs/resources.md +24 -8
- package/docs/skills.md +2 -2
- package/package.json +12 -12
|
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.
|
|
3
|
+
*
|
|
4
|
+
* `location` / `line` / `field` are independent fields on the issue (see the
|
|
5
|
+
* anchor contract on `ValidationIssue` in `@vibe-agent-toolkit/agent-schema`).
|
|
6
|
+
* Splitting them apart in the producers only pays off if the renderers put
|
|
7
|
+
* them back together — a `line` that no output surface prints is a `line` that,
|
|
8
|
+
* from the user's side, was deleted. This is the one place that join happens,
|
|
9
|
+
* so every command spells an anchor the same way.
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
12
|
+
/**
|
|
13
|
+
* Render an issue's anchor as a single human/tool-readable string.
|
|
14
|
+
*
|
|
15
|
+
* - `docs/guide.md` — file only
|
|
16
|
+
* - `docs/guide.md:24` — file + line, the `file:line` convention every editor
|
|
17
|
+
* and `grep -n` consumer already knows how to jump to
|
|
18
|
+
* - `SKILL.md (frontmatter.description)` — file + document-internal field
|
|
19
|
+
* - `(frontmatter.description)` — field with no known file (should not happen
|
|
20
|
+
* for skills-lane issues, but the renderer must not silently drop it)
|
|
21
|
+
*
|
|
22
|
+
* Returns `undefined` when the issue carries no anchor at all, so callers can
|
|
23
|
+
* skip the line entirely rather than print an empty label.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatIssueAnchor(issue: ValidationIssue): string | undefined;
|
|
26
|
+
//# sourceMappingURL=issue-anchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-anchor.d.ts","sourceRoot":"","sources":["../../src/utils/issue-anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAe5E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering for the four `ValidationIssue` anchors.
|
|
3
|
+
*
|
|
4
|
+
* `location` / `line` / `field` are independent fields on the issue (see the
|
|
5
|
+
* anchor contract on `ValidationIssue` in `@vibe-agent-toolkit/agent-schema`).
|
|
6
|
+
* Splitting them apart in the producers only pays off if the renderers put
|
|
7
|
+
* them back together — a `line` that no output surface prints is a `line` that,
|
|
8
|
+
* from the user's side, was deleted. This is the one place that join happens,
|
|
9
|
+
* so every command spells an anchor the same way.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Render an issue's anchor as a single human/tool-readable string.
|
|
13
|
+
*
|
|
14
|
+
* - `docs/guide.md` — file only
|
|
15
|
+
* - `docs/guide.md:24` — file + line, the `file:line` convention every editor
|
|
16
|
+
* and `grep -n` consumer already knows how to jump to
|
|
17
|
+
* - `SKILL.md (frontmatter.description)` — file + document-internal field
|
|
18
|
+
* - `(frontmatter.description)` — field with no known file (should not happen
|
|
19
|
+
* for skills-lane issues, but the renderer must not silently drop it)
|
|
20
|
+
*
|
|
21
|
+
* Returns `undefined` when the issue carries no anchor at all, so callers can
|
|
22
|
+
* skip the line entirely rather than print an empty label.
|
|
23
|
+
*/
|
|
24
|
+
export function formatIssueAnchor(issue) {
|
|
25
|
+
const hasLocation = issue.location !== undefined && issue.location !== '';
|
|
26
|
+
const hasField = issue.field !== undefined && issue.field !== '';
|
|
27
|
+
if (!hasLocation && !hasField) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
let anchor = hasLocation ? issue.location : '';
|
|
31
|
+
if (issue.line !== undefined) {
|
|
32
|
+
anchor = `${anchor}:${String(issue.line)}`;
|
|
33
|
+
}
|
|
34
|
+
if (hasField) {
|
|
35
|
+
anchor = anchor === '' ? `(${issue.field})` : `${anchor} (${issue.field})`;
|
|
36
|
+
}
|
|
37
|
+
return anchor;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=issue-anchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-anchor.js","sourceRoot":"","sources":["../../src/utils/issue-anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAsB;IACtD,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,EAAE,CAAC;IAC1E,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;IACjE,IAAI,CAAC,WAAW,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAE,KAAK,CAAC,QAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAC7C,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,GAAG,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAe,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,KAAK,CAAC,KAAe,GAAG,CAAC;IACjG,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering for SETS of `ValidationIssue`s — the severity label, the set's
|
|
3
|
+
* heading, and the per-issue block.
|
|
4
|
+
*
|
|
5
|
+
* `issue-anchor.ts` answers "where is this issue?"; this module answers "what
|
|
6
|
+
* severity is it, and what is in this set?". Both exist because the answer has
|
|
7
|
+
* to be spelled identically by every command: two renderers that each invent
|
|
8
|
+
* their own severity prefix is exactly how `info` findings came to be printed
|
|
9
|
+
* as `[WARNING]` in `vat skills build` AND `vat claude plugin build`, and how a
|
|
10
|
+
* mixed set came to be labelled "post-build error(s)" wholesale.
|
|
11
|
+
*
|
|
12
|
+
* The failure mode these helpers exist to prevent is directional: every
|
|
13
|
+
* hand-rolled severity collapse in this codebase mapped the case it could not
|
|
14
|
+
* represent onto the REASSURING one (info ⇒ "warning", warnings ⇒ "all
|
|
15
|
+
* passed"). That is why none of it was ever reported — it produces silence, not
|
|
16
|
+
* a false alarm.
|
|
17
|
+
*/
|
|
18
|
+
import { type SeverityCounts, type ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
19
|
+
import type { PackageSkillResult } from '@vibe-agent-toolkit/agent-skills';
|
|
20
|
+
/** Render an issue's own severity as itself. */
|
|
21
|
+
export declare function severityLabel(severity: ValidationIssue['severity']): string;
|
|
22
|
+
/**
|
|
23
|
+
* The severity distribution in prose: `1 error, 2 warnings, 3 info`.
|
|
24
|
+
*
|
|
25
|
+
* Zero buckets are omitted so the phrase names only what is present. An
|
|
26
|
+
* all-zero set returns `no findings` rather than an empty string, because an
|
|
27
|
+
* empty string silently disappears into whatever sentence embeds it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatSeverityBreakdown(counts: SeverityCounts): string;
|
|
30
|
+
/**
|
|
31
|
+
* Heading for a set of issues: `3 post-build issues (1 error, 2 info)`.
|
|
32
|
+
*
|
|
33
|
+
* The breakdown is not decoration — it is the only part of the heading that
|
|
34
|
+
* cannot be wrong about a mixed set. `noun` qualifies the set ("post-build"),
|
|
35
|
+
* and is omitted entirely when empty.
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatIssueSetHeading(issues: readonly ValidationIssue[], noun?: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Render one issue as its own lines, each prefixed with `indent`.
|
|
40
|
+
*
|
|
41
|
+
* Returns an array rather than writing, so a caller can pick its own stream and
|
|
42
|
+
* a unit test can assert over every line without capturing output.
|
|
43
|
+
*/
|
|
44
|
+
export declare function formatIssueLines(issue: ValidationIssue, indent?: string): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Every post-build finding a `PackageSkillResult` carries, from BOTH channels.
|
|
47
|
+
*
|
|
48
|
+
* `hasErrors` is the OR of two independent sets — the packager's own framework
|
|
49
|
+
* run (`postBuildIssues`: link exclusions, unreferenced files, broken packaged
|
|
50
|
+
* links) and the full validation of the built tree (`postBuildValidation`). A
|
|
51
|
+
* renderer that walks only `postBuildIssues` therefore prints NOTHING for a
|
|
52
|
+
* build that failed purely on `postBuildValidation`: the user is told the build
|
|
53
|
+
* failed and shown no reason. Reading both is the whole point of this helper.
|
|
54
|
+
*
|
|
55
|
+
* `postBuildValidation.allErrors` is the full emitted set including `info`
|
|
56
|
+
* (see its doc comment — the name lies), so info findings survive here.
|
|
57
|
+
*/
|
|
58
|
+
export declare function collectPostBuildIssues(result: PackageSkillResult): ValidationIssue[];
|
|
59
|
+
/** Sum severity counts across lanes (per-skill → per-plugin → per-run). */
|
|
60
|
+
export declare function sumSeverityCounts(counts: readonly SeverityCounts[]): SeverityCounts;
|
|
61
|
+
//# sourceMappingURL=issue-rendering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-rendering.d.ts","sourceRoot":"","sources":["../../src/utils/issue-rendering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAiB3E,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,MAAM,CAE3E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAYtE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,CAKR;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,SAAK,GAAG,MAAM,EAAE,CAY9E;AAcD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,eAAe,EAAE,CAapF;AAED,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,cAAc,CASnF"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering for SETS of `ValidationIssue`s — the severity label, the set's
|
|
3
|
+
* heading, and the per-issue block.
|
|
4
|
+
*
|
|
5
|
+
* `issue-anchor.ts` answers "where is this issue?"; this module answers "what
|
|
6
|
+
* severity is it, and what is in this set?". Both exist because the answer has
|
|
7
|
+
* to be spelled identically by every command: two renderers that each invent
|
|
8
|
+
* their own severity prefix is exactly how `info` findings came to be printed
|
|
9
|
+
* as `[WARNING]` in `vat skills build` AND `vat claude plugin build`, and how a
|
|
10
|
+
* mixed set came to be labelled "post-build error(s)" wholesale.
|
|
11
|
+
*
|
|
12
|
+
* The failure mode these helpers exist to prevent is directional: every
|
|
13
|
+
* hand-rolled severity collapse in this codebase mapped the case it could not
|
|
14
|
+
* represent onto the REASSURING one (info ⇒ "warning", warnings ⇒ "all
|
|
15
|
+
* passed"). That is why none of it was ever reported — it produces silence, not
|
|
16
|
+
* a false alarm.
|
|
17
|
+
*/
|
|
18
|
+
import { countBySeverity, } from '@vibe-agent-toolkit/agent-schema';
|
|
19
|
+
import { formatIssueAnchor } from './issue-anchor.js';
|
|
20
|
+
/**
|
|
21
|
+
* Uppercase label for a resolved severity.
|
|
22
|
+
*
|
|
23
|
+
* A total map, not an `=== 'error' ? … : …` ternary: the ternary is what
|
|
24
|
+
* rendered every non-error severity — `info` included — as `WARNING`.
|
|
25
|
+
*/
|
|
26
|
+
const SEVERITY_LABELS = {
|
|
27
|
+
error: 'ERROR',
|
|
28
|
+
warning: 'WARNING',
|
|
29
|
+
info: 'INFO',
|
|
30
|
+
ignore: 'IGNORED',
|
|
31
|
+
};
|
|
32
|
+
/** Render an issue's own severity as itself. */
|
|
33
|
+
export function severityLabel(severity) {
|
|
34
|
+
return SEVERITY_LABELS[severity];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The severity distribution in prose: `1 error, 2 warnings, 3 info`.
|
|
38
|
+
*
|
|
39
|
+
* Zero buckets are omitted so the phrase names only what is present. An
|
|
40
|
+
* all-zero set returns `no findings` rather than an empty string, because an
|
|
41
|
+
* empty string silently disappears into whatever sentence embeds it.
|
|
42
|
+
*/
|
|
43
|
+
export function formatSeverityBreakdown(counts) {
|
|
44
|
+
const parts = [];
|
|
45
|
+
if (counts.errors > 0) {
|
|
46
|
+
parts.push(`${counts.errors} error${counts.errors === 1 ? '' : 's'}`);
|
|
47
|
+
}
|
|
48
|
+
if (counts.warnings > 0) {
|
|
49
|
+
parts.push(`${counts.warnings} warning${counts.warnings === 1 ? '' : 's'}`);
|
|
50
|
+
}
|
|
51
|
+
if (counts.info > 0) {
|
|
52
|
+
parts.push(`${counts.info} info`);
|
|
53
|
+
}
|
|
54
|
+
return parts.length === 0 ? 'no findings' : parts.join(', ');
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Heading for a set of issues: `3 post-build issues (1 error, 2 info)`.
|
|
58
|
+
*
|
|
59
|
+
* The breakdown is not decoration — it is the only part of the heading that
|
|
60
|
+
* cannot be wrong about a mixed set. `noun` qualifies the set ("post-build"),
|
|
61
|
+
* and is omitted entirely when empty.
|
|
62
|
+
*/
|
|
63
|
+
export function formatIssueSetHeading(issues, noun) {
|
|
64
|
+
const qualifier = noun === undefined || noun === '' ? '' : `${noun} `;
|
|
65
|
+
const total = issues.length;
|
|
66
|
+
const breakdown = formatSeverityBreakdown(countBySeverity(issues));
|
|
67
|
+
return `${total} ${qualifier}issue${total === 1 ? '' : 's'} (${breakdown})`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Render one issue as its own lines, each prefixed with `indent`.
|
|
71
|
+
*
|
|
72
|
+
* Returns an array rather than writing, so a caller can pick its own stream and
|
|
73
|
+
* a unit test can assert over every line without capturing output.
|
|
74
|
+
*/
|
|
75
|
+
export function formatIssueLines(issue, indent = '') {
|
|
76
|
+
const lines = [
|
|
77
|
+
`${indent}[${severityLabel(issue.severity)}] [${String(issue.code)}] ${String(issue.message)}`,
|
|
78
|
+
];
|
|
79
|
+
const anchor = formatIssueAnchor(issue);
|
|
80
|
+
if (anchor !== undefined) {
|
|
81
|
+
lines.push(`${indent} Location: ${anchor}`);
|
|
82
|
+
}
|
|
83
|
+
if (issue.fix) {
|
|
84
|
+
lines.push(`${indent} Fix: ${String(issue.fix)}`);
|
|
85
|
+
}
|
|
86
|
+
return lines;
|
|
87
|
+
}
|
|
88
|
+
/** Identity of an issue for de-duplication across the two post-build channels. */
|
|
89
|
+
function issueIdentity(issue) {
|
|
90
|
+
return [
|
|
91
|
+
issue.code,
|
|
92
|
+
issue.severity,
|
|
93
|
+
issue.location ?? '',
|
|
94
|
+
issue.line === undefined ? '' : String(issue.line),
|
|
95
|
+
issue.field ?? '',
|
|
96
|
+
issue.message,
|
|
97
|
+
].join('\0');
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Every post-build finding a `PackageSkillResult` carries, from BOTH channels.
|
|
101
|
+
*
|
|
102
|
+
* `hasErrors` is the OR of two independent sets — the packager's own framework
|
|
103
|
+
* run (`postBuildIssues`: link exclusions, unreferenced files, broken packaged
|
|
104
|
+
* links) and the full validation of the built tree (`postBuildValidation`). A
|
|
105
|
+
* renderer that walks only `postBuildIssues` therefore prints NOTHING for a
|
|
106
|
+
* build that failed purely on `postBuildValidation`: the user is told the build
|
|
107
|
+
* failed and shown no reason. Reading both is the whole point of this helper.
|
|
108
|
+
*
|
|
109
|
+
* `postBuildValidation.allErrors` is the full emitted set including `info`
|
|
110
|
+
* (see its doc comment — the name lies), so info findings survive here.
|
|
111
|
+
*/
|
|
112
|
+
export function collectPostBuildIssues(result) {
|
|
113
|
+
const seen = new Set();
|
|
114
|
+
const merged = [];
|
|
115
|
+
for (const issue of [
|
|
116
|
+
...(result.postBuildIssues ?? []),
|
|
117
|
+
...(result.postBuildValidation?.allErrors ?? []),
|
|
118
|
+
]) {
|
|
119
|
+
const identity = issueIdentity(issue);
|
|
120
|
+
if (seen.has(identity))
|
|
121
|
+
continue;
|
|
122
|
+
seen.add(identity);
|
|
123
|
+
merged.push(issue);
|
|
124
|
+
}
|
|
125
|
+
return merged;
|
|
126
|
+
}
|
|
127
|
+
/** Sum severity counts across lanes (per-skill → per-plugin → per-run). */
|
|
128
|
+
export function sumSeverityCounts(counts) {
|
|
129
|
+
return counts.reduce((acc, c) => ({
|
|
130
|
+
errors: acc.errors + c.errors,
|
|
131
|
+
warnings: acc.warnings + c.warnings,
|
|
132
|
+
info: acc.info + c.info,
|
|
133
|
+
}), { errors: 0, warnings: 0, info: 0 });
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=issue-rendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-rendering.js","sourceRoot":"","sources":["../../src/utils/issue-rendering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,eAAe,GAGhB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,eAAe,GAAgD;IACnE,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,SAAS;CAClB,CAAC;AAEF,gDAAgD;AAChD,MAAM,UAAU,aAAa,CAAC,QAAqC;IACjE,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG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GAAG,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QACjC,GAAG,CAAC,MAAM,CAAC,mBAAmB,EAAE,SAAS,IAAI,EAAE,CAAC;KACjD,EAAE,CAAC;QACF,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,SAAS;QACjC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,iBAAiB,CAAC,MAAiC;IACjE,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACX,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM;QAC7B,QAAQ,EAAE,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ;QACnC,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI;KACxB,CAAC,EACF,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CACpC,CAAC;AACJ,CAAC"}
|
package/dist/utils/output.d.ts
CHANGED
|
@@ -3,7 +3,22 @@
|
|
|
3
3
|
* YAML output on stdout, logs on stderr
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* Write YAML
|
|
6
|
+
* Write a single YAML document to stdout, opened with `---`.
|
|
7
|
+
*
|
|
8
|
+
* There is deliberately NO trailing marker. `---` OPENS a document in YAML; the
|
|
9
|
+
* end-of-document marker is `...`. Emitting `---` at the end therefore opened a
|
|
10
|
+
* second, empty document, so every command's stdout was a two-document stream and
|
|
11
|
+
* a plain `YAML.parse()` threw `Source contains multiple documents` — on output
|
|
12
|
+
* this CLI documents as "YAML summary → stdout (for programmatic parsing)".
|
|
13
|
+
*
|
|
14
|
+
* The repo's own test helper had already been written around it: `executeCli…`
|
|
15
|
+
* calls `parseAllDocuments(...)` and takes `docs[0]`, with a comment saying "to
|
|
16
|
+
* handle document markers". That workaround is what kept the defect invisible —
|
|
17
|
+
* every consumer that did the obvious thing instead got an exception.
|
|
18
|
+
*
|
|
19
|
+
* Dropping the trailer also makes this agree with the seven hand-rolled emit
|
|
20
|
+
* sites elsewhere in the CLI, none of which ever wrote one.
|
|
21
|
+
*
|
|
7
22
|
* @param data - Data to serialize as YAML
|
|
8
23
|
*/
|
|
9
24
|
export declare function writeYamlOutput(data: unknown): void;
|
|
@@ -13,8 +28,15 @@ export declare function writeYamlOutput(data: unknown): void;
|
|
|
13
28
|
*/
|
|
14
29
|
export declare function flushStdout(): Promise<void>;
|
|
15
30
|
/**
|
|
16
|
-
* Write test-format
|
|
17
|
-
*
|
|
31
|
+
* Write a test-format finding to stderr.
|
|
32
|
+
*
|
|
33
|
+
* Format: `file:line:column: severity: message` — the GCC/ESLint-compact
|
|
34
|
+
* convention, which every editor and CI log scraper already parses.
|
|
35
|
+
*
|
|
36
|
+
* The severity is not decoration. Only `error` findings fail the run, so a
|
|
37
|
+
* reader who cannot see the severity cannot tell which lines of a long report
|
|
38
|
+
* they have to act on. Omitting it made an info-severity note byte-identical in
|
|
39
|
+
* shape to a build-breaking error.
|
|
18
40
|
*/
|
|
19
|
-
export declare function writeTestFormatError(file: string, line: number, column: number, message: string): void;
|
|
41
|
+
export declare function writeTestFormatError(file: string, line: number, column: number, severity: string, message: string): void;
|
|
20
42
|
//# sourceMappingURL=output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAOnD;AAED;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAQjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,IAAI,CAEN"}
|
package/dist/utils/output.js
CHANGED
|
@@ -4,7 +4,22 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as yaml from 'yaml';
|
|
6
6
|
/**
|
|
7
|
-
* Write YAML
|
|
7
|
+
* Write a single YAML document to stdout, opened with `---`.
|
|
8
|
+
*
|
|
9
|
+
* There is deliberately NO trailing marker. `---` OPENS a document in YAML; the
|
|
10
|
+
* end-of-document marker is `...`. Emitting `---` at the end therefore opened a
|
|
11
|
+
* second, empty document, so every command's stdout was a two-document stream and
|
|
12
|
+
* a plain `YAML.parse()` threw `Source contains multiple documents` — on output
|
|
13
|
+
* this CLI documents as "YAML summary → stdout (for programmatic parsing)".
|
|
14
|
+
*
|
|
15
|
+
* The repo's own test helper had already been written around it: `executeCli…`
|
|
16
|
+
* calls `parseAllDocuments(...)` and takes `docs[0]`, with a comment saying "to
|
|
17
|
+
* handle document markers". That workaround is what kept the defect invisible —
|
|
18
|
+
* every consumer that did the obvious thing instead got an exception.
|
|
19
|
+
*
|
|
20
|
+
* Dropping the trailer also makes this agree with the seven hand-rolled emit
|
|
21
|
+
* sites elsewhere in the CLI, none of which ever wrote one.
|
|
22
|
+
*
|
|
8
23
|
* @param data - Data to serialize as YAML
|
|
9
24
|
*/
|
|
10
25
|
export function writeYamlOutput(data) {
|
|
@@ -14,7 +29,6 @@ export function writeYamlOutput(data) {
|
|
|
14
29
|
lineWidth: 120,
|
|
15
30
|
aliasDuplicateObjects: false,
|
|
16
31
|
}));
|
|
17
|
-
process.stdout.write('---\n');
|
|
18
32
|
}
|
|
19
33
|
/**
|
|
20
34
|
* Flush stdout before writing to stderr
|
|
@@ -31,10 +45,17 @@ export async function flushStdout() {
|
|
|
31
45
|
});
|
|
32
46
|
}
|
|
33
47
|
/**
|
|
34
|
-
* Write test-format
|
|
35
|
-
*
|
|
48
|
+
* Write a test-format finding to stderr.
|
|
49
|
+
*
|
|
50
|
+
* Format: `file:line:column: severity: message` — the GCC/ESLint-compact
|
|
51
|
+
* convention, which every editor and CI log scraper already parses.
|
|
52
|
+
*
|
|
53
|
+
* The severity is not decoration. Only `error` findings fail the run, so a
|
|
54
|
+
* reader who cannot see the severity cannot tell which lines of a long report
|
|
55
|
+
* they have to act on. Omitting it made an info-severity note byte-identical in
|
|
56
|
+
* shape to a build-breaking error.
|
|
36
57
|
*/
|
|
37
|
-
export function writeTestFormatError(file, line, column, message) {
|
|
38
|
-
process.stderr.write(`${file}:${line}:${column}: ${message}\n`);
|
|
58
|
+
export function writeTestFormatError(file, line, column, severity, message) {
|
|
59
|
+
process.stderr.write(`${file}:${line}:${column}: ${severity}: ${message}\n`);
|
|
39
60
|
}
|
|
40
61
|
//# sourceMappingURL=output.js.map
|
package/dist/utils/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;QACxC,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,GAAG;QACd,qBAAqB,EAAE,KAAK;KAC7B,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QACnC,IAAI,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,IAAY,EACZ,MAAc,EACd,QAAgB,EAChB,OAAe;IAEf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI-boundary policy helpers for projectRoot resolution.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Root discovery belongs at the CLI boundary, not inside libraries. Each command
|
|
5
|
+
* picks exactly one of these to fulfill its declared policy:
|
|
6
6
|
*
|
|
7
7
|
* - `required` → {@link requireProjectRoot} — fails fast with a clear message.
|
|
8
8
|
* - `loud-cwd` → {@link projectRootOrLoudCwd} — falls back to cwd with a stderr warning.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI-boundary policy helpers for projectRoot resolution.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Root discovery belongs at the CLI boundary, not inside libraries. Each command
|
|
5
|
+
* picks exactly one of these to fulfill its declared policy:
|
|
6
6
|
*
|
|
7
7
|
* - `required` → {@link requireProjectRoot} — fails fast with a clear message.
|
|
8
8
|
* - `loud-cwd` → {@link projectRootOrLoudCwd} — falls back to cwd with a stderr warning.
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* rather than runtime errors when users request verbose help.
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
|
-
* Validate
|
|
9
|
+
* Validate the help-docs directory in BOTH directions.
|
|
10
10
|
*
|
|
11
|
-
* @throws {Error} If
|
|
11
|
+
* @throws {Error} If a required help file is missing, or a shipped doc is
|
|
12
|
+
* classified as neither command-served nor prose-only.
|
|
12
13
|
*/
|
|
13
14
|
export declare function validateHelpFiles(): void;
|
|
14
15
|
//# sourceMappingURL=validate-help-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-help-files.d.ts","sourceRoot":"","sources":["../../src/utils/validate-help-files.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"validate-help-files.d.ts","sourceRoot":"","sources":["../../src/utils/validate-help-files.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0CH;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAkDxC"}
|
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
* This provides "fail fast" behavior - missing help files cause build failure
|
|
6
6
|
* rather than runtime errors when users request verbose help.
|
|
7
7
|
*/
|
|
8
|
-
import { existsSync } from 'node:fs';
|
|
8
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
9
9
|
import { dirname } from 'node:path';
|
|
10
10
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
11
11
|
import { safePath } from '@vibe-agent-toolkit/utils';
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Files `loadVerboseHelp()` is actually asked for by a command.
|
|
14
|
+
*
|
|
15
|
+
* This list must stay in step with the `loadVerboseHelp(...)` call sites —
|
|
16
|
+
* each entry is a document some `--help --verbose` path will read at runtime,
|
|
17
|
+
* and a missing one degrades to an in-band "Help Documentation Not Found" page
|
|
18
|
+
* that still exits 0.
|
|
15
19
|
*/
|
|
16
20
|
const REQUIRED_HELP_FILES = [
|
|
17
21
|
'index.md', // Root-level verbose help (vat --help --verbose)
|
|
@@ -20,9 +24,28 @@ const REQUIRED_HELP_FILES = [
|
|
|
20
24
|
'agent.md', // Agent command verbose help (vat agent --help --verbose)
|
|
21
25
|
];
|
|
22
26
|
/**
|
|
23
|
-
*
|
|
27
|
+
* Shipped docs that NO command serves — reference pages, reached only by a
|
|
28
|
+
* prose link from `docs/index.md`, this repo's CLAUDE.md, or the README.
|
|
29
|
+
*
|
|
30
|
+
* Recorded explicitly because the forward check alone cannot see them: they are
|
|
31
|
+
* published in the npm package (`files: ["docs"]`) and read like verbose help,
|
|
32
|
+
* so an author can reasonably expect `vat audit --help --verbose` to print
|
|
33
|
+
* `audit.md` when in fact nothing does. Every file in `docs/` must be in this
|
|
34
|
+
* set or in {@link REQUIRED_HELP_FILES}, so adding a page forces the author to
|
|
35
|
+
* say which it is.
|
|
36
|
+
*/
|
|
37
|
+
const PROSE_ONLY_HELP_FILES = new Set([
|
|
38
|
+
'audit.md',
|
|
39
|
+
'doctor.md',
|
|
40
|
+
'mcp.md',
|
|
41
|
+
'skills.md',
|
|
42
|
+
'skill-test.md',
|
|
43
|
+
]);
|
|
44
|
+
/**
|
|
45
|
+
* Validate the help-docs directory in BOTH directions.
|
|
24
46
|
*
|
|
25
|
-
* @throws {Error} If
|
|
47
|
+
* @throws {Error} If a required help file is missing, or a shipped doc is
|
|
48
|
+
* classified as neither command-served nor prose-only.
|
|
26
49
|
*/
|
|
27
50
|
export function validateHelpFiles() {
|
|
28
51
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
@@ -42,6 +65,26 @@ export function validateHelpFiles() {
|
|
|
42
65
|
`These files must exist for verbose help (--help --verbose) to work.\n` +
|
|
43
66
|
`Create them before building the CLI package.`);
|
|
44
67
|
}
|
|
68
|
+
// Reverse direction: a doc nobody serves and nobody classified.
|
|
69
|
+
const required = new Set(REQUIRED_HELP_FILES);
|
|
70
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- docsDir is derived from this module's own location
|
|
71
|
+
const present = readdirSync(docsDir).filter(f => f.endsWith('.md'));
|
|
72
|
+
const unclassified = present.filter(f => !required.has(f) && !PROSE_ONLY_HELP_FILES.has(f));
|
|
73
|
+
if (unclassified.length > 0) {
|
|
74
|
+
const fileList = unclassified.map(f => ` - docs/${f}`).join('\n');
|
|
75
|
+
throw new Error(`Unclassified help documentation files:\n${fileList}\n\n` +
|
|
76
|
+
`Every file in packages/cli/docs/ ships in the npm package and must be\n` +
|
|
77
|
+
`either served by a command (add it to REQUIRED_HELP_FILES and call\n` +
|
|
78
|
+
`loadVerboseHelp('<name>') from that command's help path) or recorded as\n` +
|
|
79
|
+
`reference-only (add it to PROSE_ONLY_HELP_FILES). Without this, a page can\n` +
|
|
80
|
+
`be written, published, and never reachable from any --help --verbose.`);
|
|
81
|
+
}
|
|
82
|
+
const stalelyClassified = [...PROSE_ONLY_HELP_FILES].filter(f => !present.includes(f));
|
|
83
|
+
if (stalelyClassified.length > 0) {
|
|
84
|
+
throw new Error(`PROSE_ONLY_HELP_FILES lists files that no longer exist:\n` +
|
|
85
|
+
stalelyClassified.map(f => ` - docs/${f}`).join('\n') +
|
|
86
|
+
`\n\nRemove the stale entries.`);
|
|
87
|
+
}
|
|
45
88
|
}
|
|
46
89
|
/**
|
|
47
90
|
* Run validation if this file is executed directly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-help-files.js","sourceRoot":"","sources":["../../src/utils/validate-help-files.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|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,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,2DAA2D;YAC3D,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACtD,+BAA+B,CAChC,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/E,IAAI,CAAC;QACH,iBAAiB,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChD,OAAO,CAAC,KAAK,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -27,8 +27,16 @@ export declare function verdictToIssue(verdict: Verdict, location: string): Vali
|
|
|
27
27
|
* config-level targets only. Plugin-level and marketplace-level targets
|
|
28
28
|
* are surfaced by the analyzer (`vat audit --compat`) which has its own
|
|
29
29
|
* walk over plugin / marketplace manifests.
|
|
30
|
+
*
|
|
31
|
+
* Takes the skill's path plus the anchor root and re-bases internally rather
|
|
32
|
+
* than accepting a pre-rendered `location`. That is deliberate: when this took
|
|
33
|
+
* a caller-supplied location string, each of the four call sites got its own
|
|
34
|
+
* chance to answer "relative to what?" and three answered "absolute" — one
|
|
35
|
+
* `vat skill review --yaml` document ended up carrying two coordinate systems,
|
|
36
|
+
* and `vat skills validate` leaked a full home-directory path. Owning the
|
|
37
|
+
* re-base here makes that unrepresentable at every call site at once.
|
|
30
38
|
*/
|
|
31
|
-
export declare function computeConfigVerdicts(observations: readonly Observation[], configTargets: ReadonlyArray<Target> | undefined,
|
|
39
|
+
export declare function computeConfigVerdicts(observations: readonly Observation[], configTargets: ReadonlyArray<Target> | undefined, skillSourcePath: string, locationRoot: string): ValidationIssue[];
|
|
32
40
|
/**
|
|
33
41
|
* Mutate a PackagingValidationResult in place to include compat verdicts
|
|
34
42
|
* derived from the result's observations and the configured targets.
|
|
@@ -37,5 +45,5 @@ export declare function computeConfigVerdicts(observations: readonly Observation
|
|
|
37
45
|
* based on resolved severity (warning → activeWarnings; info stays only
|
|
38
46
|
* in allErrors). Verdicts are not allow-filterable.
|
|
39
47
|
*/
|
|
40
|
-
export declare function applyConfigVerdicts(result: PackagingValidationResult, configTargets: ReadonlyArray<Target> | undefined, skillSourcePath: string): void;
|
|
48
|
+
export declare function applyConfigVerdicts(result: PackagingValidationResult, configTargets: ReadonlyArray<Target> | undefined, skillSourcePath: string, locationRoot: string): void;
|
|
41
49
|
//# sourceMappingURL=verdict-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/verdict-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,OAAO,EACb,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"verdict-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/verdict-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,OAAO,EACb,MAAM,wCAAwC,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,CAUlF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,SAAS,WAAW,EAAE,EACpC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,EAChD,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,GACnB,eAAe,EAAE,CAkBnB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,yBAAyB,EACjC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,EAChD,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,GACnB,IAAI,CAqBN"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { CODE_REGISTRY } from '@vibe-agent-toolkit/agent-schema';
|
|
16
16
|
import { computeVerdicts, resolveEffectiveTargets, } from '@vibe-agent-toolkit/claude-marketplace';
|
|
17
|
+
import { issueLocation } from '@vibe-agent-toolkit/utils';
|
|
17
18
|
/**
|
|
18
19
|
* Convert a verdict into a ValidationIssue using CODE_REGISTRY for severity,
|
|
19
20
|
* fix and reference. Pure function — no I/O.
|
|
@@ -36,8 +37,16 @@ export function verdictToIssue(verdict, location) {
|
|
|
36
37
|
* config-level targets only. Plugin-level and marketplace-level targets
|
|
37
38
|
* are surfaced by the analyzer (`vat audit --compat`) which has its own
|
|
38
39
|
* walk over plugin / marketplace manifests.
|
|
40
|
+
*
|
|
41
|
+
* Takes the skill's path plus the anchor root and re-bases internally rather
|
|
42
|
+
* than accepting a pre-rendered `location`. That is deliberate: when this took
|
|
43
|
+
* a caller-supplied location string, each of the four call sites got its own
|
|
44
|
+
* chance to answer "relative to what?" and three answered "absolute" — one
|
|
45
|
+
* `vat skill review --yaml` document ended up carrying two coordinate systems,
|
|
46
|
+
* and `vat skills validate` leaked a full home-directory path. Owning the
|
|
47
|
+
* re-base here makes that unrepresentable at every call site at once.
|
|
39
48
|
*/
|
|
40
|
-
export function computeConfigVerdicts(observations, configTargets,
|
|
49
|
+
export function computeConfigVerdicts(observations, configTargets, skillSourcePath, locationRoot) {
|
|
41
50
|
if (observations.length === 0) {
|
|
42
51
|
return [];
|
|
43
52
|
}
|
|
@@ -50,6 +59,7 @@ export function computeConfigVerdicts(observations, configTargets, location) {
|
|
|
50
59
|
observations: [...observations],
|
|
51
60
|
targets: effectiveTargets,
|
|
52
61
|
});
|
|
62
|
+
const location = issueLocation(skillSourcePath, locationRoot);
|
|
53
63
|
return verdicts.map(v => verdictToIssue(v, location));
|
|
54
64
|
}
|
|
55
65
|
/**
|
|
@@ -60,8 +70,8 @@ export function computeConfigVerdicts(observations, configTargets, location) {
|
|
|
60
70
|
* based on resolved severity (warning → activeWarnings; info stays only
|
|
61
71
|
* in allErrors). Verdicts are not allow-filterable.
|
|
62
72
|
*/
|
|
63
|
-
export function applyConfigVerdicts(result, configTargets, skillSourcePath) {
|
|
64
|
-
const verdictIssues = computeConfigVerdicts(result.observations, configTargets, skillSourcePath);
|
|
73
|
+
export function applyConfigVerdicts(result, configTargets, skillSourcePath, locationRoot) {
|
|
74
|
+
const verdictIssues = computeConfigVerdicts(result.observations, configTargets, skillSourcePath, locationRoot);
|
|
65
75
|
if (verdictIssues.length === 0) {
|
|
66
76
|
return;
|
|
67
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict-helpers.js","sourceRoot":"","sources":["../../src/utils/verdict-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAwB,MAAM,kCAAkC,CAAC;AAKvF,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