@vibe-agent-toolkit/cli 0.2.0-rc.10 → 0.2.0-rc.12
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 +3 -3
- package/dist/bin/supervise-cli.d.ts +45 -0
- package/dist/bin/supervise-cli.d.ts.map +1 -0
- package/dist/bin/supervise-cli.js +83 -0
- package/dist/bin/supervise-cli.js.map +1 -0
- package/dist/bin/vat +94 -40
- package/dist/bin/vat.d.ts +15 -4
- package/dist/bin/vat.d.ts.map +1 -1
- package/dist/bin/vat.js +94 -40
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +21 -29
- package/dist/bin.js.map +1 -1
- package/dist/command-tree.d.ts +45 -0
- package/dist/command-tree.d.ts.map +1 -0
- package/dist/command-tree.js +60 -0
- package/dist/command-tree.js.map +1 -0
- package/dist/commands/agent/build-schema.d.ts +100 -0
- package/dist/commands/agent/build-schema.d.ts.map +1 -0
- package/dist/commands/agent/build-schema.js +32 -0
- package/dist/commands/agent/build-schema.js.map +1 -0
- package/dist/commands/agent/build.d.ts +1 -0
- package/dist/commands/agent/build.d.ts.map +1 -1
- package/dist/commands/agent/build.js +63 -33
- package/dist/commands/agent/build.js.map +1 -1
- package/dist/commands/agent/import-schema.d.ts +75 -0
- package/dist/commands/agent/import-schema.d.ts.map +1 -0
- package/dist/commands/agent/import-schema.js +25 -0
- package/dist/commands/agent/import-schema.js.map +1 -0
- package/dist/commands/agent/import.d.ts.map +1 -1
- package/dist/commands/agent/import.js +33 -27
- package/dist/commands/agent/import.js.map +1 -1
- package/dist/commands/agent/index.d.ts.map +1 -1
- package/dist/commands/agent/index.js +132 -37
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/agent/install-path.d.ts.map +1 -1
- package/dist/commands/agent/install-path.js +2 -1
- package/dist/commands/agent/install-path.js.map +1 -1
- package/dist/commands/agent/install-schema.d.ts +89 -0
- package/dist/commands/agent/install-schema.d.ts.map +1 -0
- package/dist/commands/agent/install-schema.js +29 -0
- package/dist/commands/agent/install-schema.js.map +1 -0
- package/dist/commands/agent/install.d.ts +7 -1
- package/dist/commands/agent/install.d.ts.map +1 -1
- package/dist/commands/agent/install.js +78 -108
- package/dist/commands/agent/install.js.map +1 -1
- package/dist/commands/agent/installed-schema.d.ts +140 -0
- package/dist/commands/agent/installed-schema.d.ts.map +1 -0
- package/dist/commands/agent/installed-schema.js +36 -0
- package/dist/commands/agent/installed-schema.js.map +1 -0
- package/dist/commands/agent/installed.d.ts +1 -1
- package/dist/commands/agent/installed.d.ts.map +1 -1
- package/dist/commands/agent/installed.js +104 -75
- package/dist/commands/agent/installed.js.map +1 -1
- package/dist/commands/agent/list-schema.d.ts +128 -0
- package/dist/commands/agent/list-schema.d.ts.map +1 -0
- package/dist/commands/agent/list-schema.js +34 -0
- package/dist/commands/agent/list-schema.js.map +1 -0
- package/dist/commands/agent/list.d.ts +4 -3
- package/dist/commands/agent/list.d.ts.map +1 -1
- package/dist/commands/agent/list.js +50 -37
- package/dist/commands/agent/list.js.map +1 -1
- package/dist/commands/agent/run.d.ts +3 -0
- package/dist/commands/agent/run.d.ts.map +1 -1
- package/dist/commands/agent/run.js +8 -3
- package/dist/commands/agent/run.js.map +1 -1
- package/dist/commands/agent/uninstall-schema.d.ts +89 -0
- package/dist/commands/agent/uninstall-schema.d.ts.map +1 -0
- package/dist/commands/agent/uninstall-schema.js +29 -0
- package/dist/commands/agent/uninstall-schema.js.map +1 -0
- package/dist/commands/agent/uninstall.d.ts +5 -1
- package/dist/commands/agent/uninstall.d.ts.map +1 -1
- package/dist/commands/agent/uninstall.js +50 -38
- package/dist/commands/agent/uninstall.js.map +1 -1
- package/dist/commands/agent/validate-schema.d.ts +129 -0
- package/dist/commands/agent/validate-schema.d.ts.map +1 -0
- package/dist/commands/agent/validate-schema.js +35 -0
- package/dist/commands/agent/validate-schema.js.map +1 -0
- package/dist/commands/agent/validate.d.ts +6 -0
- package/dist/commands/agent/validate.d.ts.map +1 -1
- package/dist/commands/agent/validate.js +64 -36
- package/dist/commands/agent/validate.js.map +1 -1
- package/dist/commands/ard/emit-schema.d.ts +108 -0
- package/dist/commands/ard/emit-schema.d.ts.map +1 -0
- package/dist/commands/ard/emit-schema.js +37 -0
- package/dist/commands/ard/emit-schema.js.map +1 -0
- package/dist/commands/ard/emit.d.ts +31 -63
- package/dist/commands/ard/emit.d.ts.map +1 -1
- package/dist/commands/ard/emit.js +124 -68
- package/dist/commands/ard/emit.js.map +1 -1
- package/dist/commands/ard/index.d.ts.map +1 -1
- package/dist/commands/ard/index.js +17 -10
- package/dist/commands/ard/index.js.map +1 -1
- package/dist/commands/audit/compat-lane-findings.d.ts +65 -0
- package/dist/commands/audit/compat-lane-findings.d.ts.map +1 -0
- package/dist/commands/audit/compat-lane-findings.js +72 -0
- package/dist/commands/audit/compat-lane-findings.js.map +1 -0
- package/dist/commands/audit/distributed-tree.d.ts +2 -2
- package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
- package/dist/commands/audit/distributed-tree.js +23 -12
- package/dist/commands/audit/distributed-tree.js.map +1 -1
- package/dist/commands/audit/git-url-clone.d.ts +15 -7
- package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
- package/dist/commands/audit/git-url-clone.js +85 -42
- package/dist/commands/audit/git-url-clone.js.map +1 -1
- package/dist/commands/audit/hierarchical-output.d.ts +28 -4
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
- package/dist/commands/audit/hierarchical-output.js +44 -27
- package/dist/commands/audit/hierarchical-output.js.map +1 -1
- package/dist/commands/audit/scan-population.d.ts.map +1 -1
- package/dist/commands/audit/scan-population.js +2 -1
- package/dist/commands/audit/scan-population.js.map +1 -1
- package/dist/commands/audit-schema.d.ts +1247 -0
- package/dist/commands/audit-schema.d.ts.map +1 -0
- package/dist/commands/audit-schema.js +139 -0
- package/dist/commands/audit-schema.js.map +1 -0
- package/dist/commands/audit-settings-schema.d.ts +417 -0
- package/dist/commands/audit-settings-schema.d.ts.map +1 -0
- package/dist/commands/audit-settings-schema.js +77 -0
- package/dist/commands/audit-settings-schema.js.map +1 -0
- package/dist/commands/audit-settings.d.ts +28 -9
- package/dist/commands/audit-settings.d.ts.map +1 -1
- package/dist/commands/audit-settings.js +215 -151
- package/dist/commands/audit-settings.js.map +1 -1
- package/dist/commands/audit.d.ts +72 -33
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +415 -397
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +61 -4
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +176 -190
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cache/clear-schema.d.ts +111 -0
- package/dist/commands/cache/clear-schema.d.ts.map +1 -0
- package/dist/commands/cache/clear-schema.js +37 -0
- package/dist/commands/cache/clear-schema.js.map +1 -0
- package/dist/commands/cache/clear.d.ts +28 -26
- package/dist/commands/cache/clear.d.ts.map +1 -1
- package/dist/commands/cache/clear.js +108 -103
- package/dist/commands/cache/clear.js.map +1 -1
- package/dist/commands/cache/index.d.ts.map +1 -1
- package/dist/commands/cache/index.js +13 -7
- package/dist/commands/cache/index.js.map +1 -1
- package/dist/commands/claude/claude-config.d.ts +23 -6
- package/dist/commands/claude/claude-config.d.ts.map +1 -1
- package/dist/commands/claude/claude-config.js +29 -15
- package/dist/commands/claude/claude-config.js.map +1 -1
- package/dist/commands/claude/context.d.ts +87 -2
- package/dist/commands/claude/context.d.ts.map +1 -1
- package/dist/commands/claude/context.js +116 -57
- package/dist/commands/claude/context.js.map +1 -1
- package/dist/commands/claude/marketplace/changelog-utils.js +2 -2
- package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts +14 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.js +135 -68
- package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.d.ts +3 -5
- package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.js +16 -7
- package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/publish-schema.d.ts +137 -0
- package/dist/commands/claude/marketplace/publish-schema.d.ts.map +1 -0
- package/dist/commands/claude/marketplace/publish-schema.js +32 -0
- package/dist/commands/claude/marketplace/publish-schema.js.map +1 -0
- package/dist/commands/claude/marketplace/publish-tree.d.ts +6 -0
- package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish-tree.js +75 -17
- package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
- package/dist/commands/claude/marketplace/publish.d.ts +27 -0
- package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish.js +84 -50
- package/dist/commands/claude/marketplace/publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate-schema.d.ts +362 -0
- package/dist/commands/claude/marketplace/validate-schema.d.ts.map +1 -0
- package/dist/commands/claude/marketplace/validate-schema.js +67 -0
- package/dist/commands/claude/marketplace/validate-schema.js.map +1 -0
- package/dist/commands/claude/marketplace/validate.d.ts +40 -53
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +358 -214
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/api-keys.d.ts +3 -0
- package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
- package/dist/commands/claude/org/api-keys.js +4 -5
- package/dist/commands/claude/org/api-keys.js.map +1 -1
- package/dist/commands/claude/org/code-analytics.js +1 -1
- package/dist/commands/claude/org/code-analytics.js.map +1 -1
- package/dist/commands/claude/org/cost.d.ts.map +1 -1
- package/dist/commands/claude/org/cost.js +11 -33
- package/dist/commands/claude/org/cost.js.map +1 -1
- package/dist/commands/claude/org/helpers.d.ts +40 -27
- package/dist/commands/claude/org/helpers.d.ts.map +1 -1
- package/dist/commands/claude/org/helpers.js +61 -66
- package/dist/commands/claude/org/helpers.js.map +1 -1
- package/dist/commands/claude/org/index.d.ts.map +1 -1
- package/dist/commands/claude/org/index.js +10 -4
- package/dist/commands/claude/org/index.js.map +1 -1
- package/dist/commands/claude/org/info.d.ts.map +1 -1
- package/dist/commands/claude/org/info.js +2 -3
- package/dist/commands/claude/org/info.js.map +1 -1
- package/dist/commands/claude/org/invites.d.ts +3 -0
- package/dist/commands/claude/org/invites.d.ts.map +1 -1
- package/dist/commands/claude/org/invites.js +5 -7
- package/dist/commands/claude/org/invites.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +76 -21
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +273 -246
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/org/stubs-schema.d.ts +56 -0
- package/dist/commands/claude/org/stubs-schema.d.ts.map +1 -0
- package/dist/commands/claude/org/stubs-schema.js +23 -0
- package/dist/commands/claude/org/stubs-schema.js.map +1 -0
- package/dist/commands/claude/org/stubs.d.ts +8 -3
- package/dist/commands/claude/org/stubs.d.ts.map +1 -1
- package/dist/commands/claude/org/stubs.js +9 -9
- package/dist/commands/claude/org/stubs.js.map +1 -1
- package/dist/commands/claude/org/usage.d.ts.map +1 -1
- package/dist/commands/claude/org/usage.js +1 -2
- package/dist/commands/claude/org/usage.js.map +1 -1
- package/dist/commands/claude/org/users.d.ts +3 -0
- package/dist/commands/claude/org/users.d.ts.map +1 -1
- package/dist/commands/claude/org/users.js +6 -8
- package/dist/commands/claude/org/users.js.map +1 -1
- package/dist/commands/claude/org/workspaces.d.ts +3 -0
- package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
- package/dist/commands/claude/org/workspaces.js +10 -15
- package/dist/commands/claude/org/workspaces.js.map +1 -1
- package/dist/commands/claude/plugin/build-schema.d.ts +642 -0
- package/dist/commands/claude/plugin/build-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/build-schema.js +51 -0
- package/dist/commands/claude/plugin/build-schema.js.map +1 -0
- package/dist/commands/claude/plugin/build.d.ts +220 -45
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +466 -249
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/helpers.d.ts +186 -24
- package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
- package/dist/commands/claude/plugin/helpers.js +110 -68
- package/dist/commands/claude/plugin/helpers.js.map +1 -1
- package/dist/commands/claude/plugin/install-schema.d.ts +144 -0
- package/dist/commands/claude/plugin/install-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/install-schema.js +36 -0
- package/dist/commands/claude/plugin/install-schema.js.map +1 -0
- package/dist/commands/claude/plugin/install.d.ts +191 -11
- package/dist/commands/claude/plugin/install.d.ts.map +1 -1
- package/dist/commands/claude/plugin/install.js +688 -628
- package/dist/commands/claude/plugin/install.js.map +1 -1
- package/dist/commands/claude/plugin/kept-findings.d.ts +19 -0
- package/dist/commands/claude/plugin/kept-findings.d.ts.map +1 -0
- package/dist/commands/claude/plugin/kept-findings.js +24 -0
- package/dist/commands/claude/plugin/kept-findings.js.map +1 -0
- package/dist/commands/claude/plugin/list-schema.d.ts +223 -0
- package/dist/commands/claude/plugin/list-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/list-schema.js +34 -0
- package/dist/commands/claude/plugin/list-schema.js.map +1 -0
- package/dist/commands/claude/plugin/list.d.ts +18 -0
- package/dist/commands/claude/plugin/list.d.ts.map +1 -1
- package/dist/commands/claude/plugin/list.js +53 -45
- package/dist/commands/claude/plugin/list.js.map +1 -1
- package/dist/commands/claude/plugin/npm-pack.d.ts +15 -0
- package/dist/commands/claude/plugin/npm-pack.d.ts.map +1 -0
- package/dist/commands/claude/plugin/npm-pack.js +39 -0
- package/dist/commands/claude/plugin/npm-pack.js.map +1 -0
- package/dist/commands/claude/plugin/plugin-changelog.d.ts +5 -1
- package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-changelog.js +9 -5
- package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.d.ts +21 -2
- package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.js +65 -32
- package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.d.ts +13 -0
- package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.js +64 -16
- package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +63 -37
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/claude/plugin/uninstall-schema.d.ts +112 -0
- package/dist/commands/claude/plugin/uninstall-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/uninstall-schema.js +28 -0
- package/dist/commands/claude/plugin/uninstall-schema.js.map +1 -0
- package/dist/commands/claude/plugin/uninstall.d.ts +57 -0
- package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
- package/dist/commands/claude/plugin/uninstall.js +176 -64
- package/dist/commands/claude/plugin/uninstall.js.map +1 -1
- package/dist/commands/consistency-check.d.ts.map +1 -1
- package/dist/commands/consistency-check.js +8 -6
- package/dist/commands/consistency-check.js.map +1 -1
- package/dist/commands/corpus/index.d.ts.map +1 -1
- package/dist/commands/corpus/index.js +26 -10
- package/dist/commands/corpus/index.js.map +1 -1
- package/dist/commands/corpus/report.d.ts +34 -16
- package/dist/commands/corpus/report.d.ts.map +1 -1
- package/dist/commands/corpus/report.js +36 -18
- package/dist/commands/corpus/report.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts +25 -20
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +123 -67
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/corpus/scan-schema.d.ts +127 -0
- package/dist/commands/corpus/scan-schema.d.ts.map +1 -0
- package/dist/commands/corpus/scan-schema.js +31 -0
- package/dist/commands/corpus/scan-schema.js.map +1 -0
- package/dist/commands/corpus/scan.d.ts +31 -0
- package/dist/commands/corpus/scan.d.ts.map +1 -1
- package/dist/commands/corpus/scan.js +124 -50
- package/dist/commands/corpus/scan.js.map +1 -1
- package/dist/commands/corpus/seed.d.ts +11 -8
- package/dist/commands/corpus/seed.d.ts.map +1 -1
- package/dist/commands/corpus/seed.js +29 -11
- package/dist/commands/corpus/seed.js.map +1 -1
- package/dist/commands/doctor-render.d.ts +52 -0
- package/dist/commands/doctor-render.d.ts.map +1 -0
- package/dist/commands/doctor-render.js +110 -0
- package/dist/commands/doctor-render.js.map +1 -0
- package/dist/commands/doctor-schema.d.ts +191 -0
- package/dist/commands/doctor-schema.d.ts.map +1 -0
- package/dist/commands/doctor-schema.js +44 -0
- package/dist/commands/doctor-schema.js.map +1 -0
- package/dist/commands/doctor.d.ts +7 -62
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +126 -165
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/inventory-schema.d.ts +7297 -0
- package/dist/commands/inventory-schema.d.ts.map +1 -0
- package/dist/commands/inventory-schema.js +28 -0
- package/dist/commands/inventory-schema.js.map +1 -0
- package/dist/commands/inventory.d.ts +1 -1
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +89 -41
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/mcp/index.d.ts.map +1 -1
- package/dist/commands/mcp/index.js +15 -0
- package/dist/commands/mcp/index.js.map +1 -1
- package/dist/commands/mcp/list-collections-schema.d.ts +101 -0
- package/dist/commands/mcp/list-collections-schema.d.ts.map +1 -0
- package/dist/commands/mcp/list-collections-schema.js +22 -0
- package/dist/commands/mcp/list-collections-schema.js.map +1 -0
- package/dist/commands/mcp/list-collections.d.ts +1 -1
- package/dist/commands/mcp/list-collections.d.ts.map +1 -1
- package/dist/commands/mcp/list-collections.js +19 -17
- package/dist/commands/mcp/list-collections.js.map +1 -1
- package/dist/commands/mcp/serve.d.ts +5 -0
- package/dist/commands/mcp/serve.d.ts.map +1 -1
- package/dist/commands/mcp/serve.js +29 -15
- package/dist/commands/mcp/serve.js.map +1 -1
- package/dist/commands/okf/index.d.ts.map +1 -1
- package/dist/commands/okf/index.js +13 -10
- package/dist/commands/okf/index.js.map +1 -1
- package/dist/commands/okf/validate-schema.d.ts +171 -0
- package/dist/commands/okf/validate-schema.d.ts.map +1 -0
- package/dist/commands/okf/validate-schema.js +44 -0
- package/dist/commands/okf/validate-schema.js.map +1 -0
- package/dist/commands/okf/validate.d.ts +16 -145
- package/dist/commands/okf/validate.d.ts.map +1 -1
- package/dist/commands/okf/validate.js +63 -52
- package/dist/commands/okf/validate.js.map +1 -1
- package/dist/commands/orchestrator-schema.d.ts +419 -0
- package/dist/commands/orchestrator-schema.d.ts.map +1 -0
- package/dist/commands/orchestrator-schema.js +91 -0
- package/dist/commands/orchestrator-schema.js.map +1 -0
- package/dist/commands/phase-utils.d.ts +188 -220
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +210 -258
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/positional-args.d.ts +13 -11
- package/dist/commands/positional-args.d.ts.map +1 -1
- package/dist/commands/positional-args.js +16 -15
- package/dist/commands/positional-args.js.map +1 -1
- package/dist/commands/rag/admin-schema.d.ts +152 -0
- package/dist/commands/rag/admin-schema.d.ts.map +1 -0
- package/dist/commands/rag/admin-schema.js +31 -0
- package/dist/commands/rag/admin-schema.js.map +1 -0
- package/dist/commands/rag/clear-command.d.ts.map +1 -1
- package/dist/commands/rag/clear-command.js +30 -15
- package/dist/commands/rag/clear-command.js.map +1 -1
- package/dist/commands/rag/command-helpers.d.ts +31 -7
- package/dist/commands/rag/command-helpers.d.ts.map +1 -1
- package/dist/commands/rag/command-helpers.js +41 -21
- package/dist/commands/rag/command-helpers.js.map +1 -1
- package/dist/commands/rag/index-command.d.ts +37 -48
- package/dist/commands/rag/index-command.d.ts.map +1 -1
- package/dist/commands/rag/index-command.js +80 -65
- package/dist/commands/rag/index-command.js.map +1 -1
- package/dist/commands/rag/index-schema.d.ts +107 -0
- package/dist/commands/rag/index-schema.d.ts.map +1 -0
- package/dist/commands/rag/index-schema.js +34 -0
- package/dist/commands/rag/index-schema.js.map +1 -0
- package/dist/commands/rag/index.d.ts.map +1 -1
- package/dist/commands/rag/index.js +88 -41
- package/dist/commands/rag/index.js.map +1 -1
- package/dist/commands/rag/query-command.d.ts +18 -4
- package/dist/commands/rag/query-command.d.ts.map +1 -1
- package/dist/commands/rag/query-command.js +42 -27
- package/dist/commands/rag/query-command.js.map +1 -1
- package/dist/commands/rag/query-schema.d.ts +363 -0
- package/dist/commands/rag/query-schema.d.ts.map +1 -0
- package/dist/commands/rag/query-schema.js +59 -0
- package/dist/commands/rag/query-schema.js.map +1 -0
- package/dist/commands/rag/stats-command.d.ts.map +1 -1
- package/dist/commands/rag/stats-command.js +19 -18
- package/dist/commands/rag/stats-command.js.map +1 -1
- package/dist/commands/resources/check-progress.d.ts +79 -13
- package/dist/commands/resources/check-progress.d.ts.map +1 -1
- package/dist/commands/resources/check-progress.js +112 -11
- package/dist/commands/resources/check-progress.js.map +1 -1
- package/dist/commands/resources/check-schema.d.ts +335 -0
- package/dist/commands/resources/check-schema.d.ts.map +1 -0
- package/dist/commands/resources/check-schema.js +104 -0
- package/dist/commands/resources/check-schema.js.map +1 -0
- package/dist/commands/resources/check-supervisor.d.ts +329 -71
- package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
- package/dist/commands/resources/check-supervisor.js +507 -107
- package/dist/commands/resources/check-supervisor.js.map +1 -1
- package/dist/commands/resources/check.d.ts +88 -254
- package/dist/commands/resources/check.d.ts.map +1 -1
- package/dist/commands/resources/check.js +537 -310
- package/dist/commands/resources/check.js.map +1 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +189 -103
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/query-schema.d.ts +188 -0
- package/dist/commands/resources/query-schema.d.ts.map +1 -0
- package/dist/commands/resources/query-schema.js +48 -0
- package/dist/commands/resources/query-schema.js.map +1 -0
- package/dist/commands/resources/query.d.ts +18 -13
- package/dist/commands/resources/query.d.ts.map +1 -1
- package/dist/commands/resources/query.js +61 -49
- package/dist/commands/resources/query.js.map +1 -1
- package/dist/commands/resources/scan-schema.d.ts +195 -0
- package/dist/commands/resources/scan-schema.d.ts.map +1 -0
- package/dist/commands/resources/scan-schema.js +53 -0
- package/dist/commands/resources/scan-schema.js.map +1 -0
- package/dist/commands/resources/scan.d.ts +26 -3
- package/dist/commands/resources/scan.d.ts.map +1 -1
- package/dist/commands/resources/scan.js +51 -53
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/commands/resources/validate-schema.d.ts +326 -0
- package/dist/commands/resources/validate-schema.d.ts.map +1 -0
- package/dist/commands/resources/validate-schema.js +60 -0
- package/dist/commands/resources/validate-schema.js.map +1 -0
- package/dist/commands/resources/validate.d.ts +45 -169
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +221 -485
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review-checklist.d.ts.map +1 -1
- package/dist/commands/skill/review-checklist.js +0 -1
- package/dist/commands/skill/review-checklist.js.map +1 -1
- package/dist/commands/skill/review-schema.d.ts +278 -0
- package/dist/commands/skill/review-schema.d.ts.map +1 -0
- package/dist/commands/skill/review-schema.js +46 -0
- package/dist/commands/skill/review-schema.js.map +1 -0
- package/dist/commands/skill/review.d.ts +8 -234
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +54 -77
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skill/test/auth-flags.d.ts +3 -0
- package/dist/commands/skill/test/auth-flags.d.ts.map +1 -1
- package/dist/commands/skill/test/auth-flags.js +6 -2
- package/dist/commands/skill/test/auth-flags.js.map +1 -1
- package/dist/commands/skill/test/configure-schema.d.ts +67 -0
- package/dist/commands/skill/test/configure-schema.d.ts.map +1 -0
- package/dist/commands/skill/test/configure-schema.js +27 -0
- package/dist/commands/skill/test/configure-schema.js.map +1 -0
- package/dist/commands/skill/test/configure.d.ts +12 -5
- package/dist/commands/skill/test/configure.d.ts.map +1 -1
- package/dist/commands/skill/test/configure.js +101 -31
- package/dist/commands/skill/test/configure.js.map +1 -1
- package/dist/commands/skill/test/run-schema.d.ts +107 -0
- package/dist/commands/skill/test/run-schema.d.ts.map +1 -0
- package/dist/commands/skill/test/run-schema.js +36 -0
- package/dist/commands/skill/test/run-schema.js.map +1 -0
- package/dist/commands/skill/test/run.d.ts +3 -2
- package/dist/commands/skill/test/run.d.ts.map +1 -1
- package/dist/commands/skill/test/run.js +316 -155
- package/dist/commands/skill/test/run.js.map +1 -1
- package/dist/commands/skills/build-schema.d.ts +199 -0
- package/dist/commands/skills/build-schema.d.ts.map +1 -0
- package/dist/commands/skills/build-schema.js +55 -0
- package/dist/commands/skills/build-schema.js.map +1 -0
- package/dist/commands/skills/build.d.ts +95 -298
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +415 -818
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/command-helpers.d.ts +5 -11
- package/dist/commands/skills/command-helpers.d.ts.map +1 -1
- package/dist/commands/skills/command-helpers.js +7 -17
- package/dist/commands/skills/command-helpers.js.map +1 -1
- package/dist/commands/skills/index.js +12 -6
- package/dist/commands/skills/index.js.map +1 -1
- package/dist/commands/skills/install-schema.d.ts +153 -0
- package/dist/commands/skills/install-schema.d.ts.map +1 -0
- package/dist/commands/skills/install-schema.js +44 -0
- package/dist/commands/skills/install-schema.js.map +1 -0
- package/dist/commands/skills/install.d.ts +76 -8
- package/dist/commands/skills/install.d.ts.map +1 -1
- package/dist/commands/skills/install.js +230 -194
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/skills/list-schema.d.ts +145 -0
- package/dist/commands/skills/list-schema.d.ts.map +1 -0
- package/dist/commands/skills/list-schema.js +37 -0
- package/dist/commands/skills/list-schema.js.map +1 -0
- package/dist/commands/skills/list.d.ts +39 -8
- package/dist/commands/skills/list.d.ts.map +1 -1
- package/dist/commands/skills/list.js +110 -122
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/package-schema.d.ts +98 -0
- package/dist/commands/skills/package-schema.d.ts.map +1 -0
- package/dist/commands/skills/package-schema.js +32 -0
- package/dist/commands/skills/package-schema.js.map +1 -0
- package/dist/commands/skills/package.d.ts +85 -14
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +288 -207
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/scope-guard.d.ts +27 -20
- package/dist/commands/skills/scope-guard.d.ts.map +1 -1
- package/dist/commands/skills/scope-guard.js +43 -28
- package/dist/commands/skills/scope-guard.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts +1 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +40 -19
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/source-resolvers.d.ts +58 -8
- package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
- package/dist/commands/skills/source-resolvers.js +113 -38
- package/dist/commands/skills/source-resolvers.js.map +1 -1
- package/dist/commands/skills/validate-command.d.ts.map +1 -1
- package/dist/commands/skills/validate-command.js +31 -51
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate-schema.d.ts +199 -0
- package/dist/commands/skills/validate-schema.d.ts.map +1 -0
- package/dist/commands/skills/validate-schema.js +44 -0
- package/dist/commands/skills/validate-schema.js.map +1 -0
- package/dist/commands/skills/validate.d.ts +100 -136
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +257 -343
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/validate.d.ts +17 -5
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +139 -94
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +121 -110
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +230 -294
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/report-schemas.d.ts +12398 -35
- package/dist/report-schemas.d.ts.map +1 -1
- package/dist/report-schemas.js +624 -66
- package/dist/report-schemas.js.map +1 -1
- package/dist/skill-resolution/packaging-config.js +2 -2
- package/dist/skill-resolution/packaging-config.js.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.js +20 -13
- package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
- package/dist/utils/agent-discovery.d.ts +34 -1
- package/dist/utils/agent-discovery.d.ts.map +1 -1
- package/dist/utils/agent-discovery.js +80 -38
- package/dist/utils/agent-discovery.js.map +1 -1
- package/dist/utils/claude-context-lens.d.ts +13 -6
- package/dist/utils/claude-context-lens.d.ts.map +1 -1
- package/dist/utils/claude-context-lens.js +11 -12
- package/dist/utils/claude-context-lens.js.map +1 -1
- package/dist/utils/command-error-codes.d.ts +12 -0
- package/dist/utils/command-error-codes.d.ts.map +1 -0
- package/dist/utils/command-error-codes.js +12 -0
- package/dist/utils/command-error-codes.js.map +1 -0
- package/dist/utils/command-refusal.d.ts +58 -0
- package/dist/utils/command-refusal.d.ts.map +1 -0
- package/dist/utils/command-refusal.js +170 -0
- package/dist/utils/command-refusal.js.map +1 -0
- package/dist/utils/commander-ending.d.ts +40 -0
- package/dist/utils/commander-ending.d.ts.map +1 -0
- package/dist/utils/commander-ending.js +42 -0
- package/dist/utils/commander-ending.js.map +1 -0
- package/dist/utils/config-loader.d.ts +13 -8
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +84 -45
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/corpus-target.d.ts +1 -1
- package/dist/utils/corpus-target.d.ts.map +1 -1
- package/dist/utils/corpus-target.js +44 -5
- package/dist/utils/corpus-target.js.map +1 -1
- package/dist/utils/debug-diagnostics.d.ts +18 -0
- package/dist/utils/debug-diagnostics.d.ts.map +1 -0
- package/dist/utils/debug-diagnostics.js +23 -0
- package/dist/utils/debug-diagnostics.js.map +1 -0
- package/dist/utils/document-writer.d.ts +191 -0
- package/dist/utils/document-writer.d.ts.map +1 -0
- package/dist/utils/document-writer.js +319 -0
- package/dist/utils/document-writer.js.map +1 -0
- package/dist/utils/help-loader.d.ts +2 -2
- package/dist/utils/help-loader.js +2 -2
- package/dist/utils/install-plan.d.ts +99 -0
- package/dist/utils/install-plan.d.ts.map +1 -0
- package/dist/utils/install-plan.js +146 -0
- package/dist/utils/install-plan.js.map +1 -0
- package/dist/utils/issue-anchor.d.ts +1 -1
- package/dist/utils/issue-anchor.d.ts.map +1 -1
- package/dist/utils/issue-anchor.js.map +1 -1
- package/dist/utils/issue-rendering.d.ts +8 -3
- package/dist/utils/issue-rendering.d.ts.map +1 -1
- package/dist/utils/issue-rendering.js +4 -0
- package/dist/utils/issue-rendering.js.map +1 -1
- package/dist/utils/lens-population.d.ts +20 -0
- package/dist/utils/lens-population.d.ts.map +1 -0
- package/dist/utils/lens-population.js +15 -0
- package/dist/utils/lens-population.js.map +1 -0
- package/dist/utils/marketplace-io.d.ts +63 -0
- package/dist/utils/marketplace-io.d.ts.map +1 -0
- package/dist/utils/marketplace-io.js +63 -0
- package/dist/utils/marketplace-io.js.map +1 -0
- package/dist/utils/operator-notices.d.ts +97 -0
- package/dist/utils/operator-notices.d.ts.map +1 -0
- package/dist/utils/operator-notices.js +115 -0
- package/dist/utils/operator-notices.js.map +1 -0
- package/dist/utils/optional-backend.d.ts +18 -15
- package/dist/utils/optional-backend.d.ts.map +1 -1
- package/dist/utils/optional-backend.js +22 -33
- package/dist/utils/optional-backend.js.map +1 -1
- package/dist/utils/output.d.ts +5 -43
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +8 -63
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/package-json.d.ts +3 -4
- package/dist/utils/package-json.d.ts.map +1 -1
- package/dist/utils/package-json.js +8 -8
- package/dist/utils/package-json.js.map +1 -1
- package/dist/utils/population-wiring.d.ts +31 -38
- package/dist/utils/population-wiring.d.ts.map +1 -1
- package/dist/utils/population-wiring.js +38 -32
- package/dist/utils/population-wiring.js.map +1 -1
- package/dist/utils/project-root-policy.d.ts +74 -1
- package/dist/utils/project-root-policy.d.ts.map +1 -1
- package/dist/utils/project-root-policy.js +146 -8
- package/dist/utils/project-root-policy.js.map +1 -1
- package/dist/utils/projection-lenses.d.ts +25 -7
- package/dist/utils/projection-lenses.d.ts.map +1 -1
- package/dist/utils/projection-lenses.js +20 -6
- package/dist/utils/projection-lenses.js.map +1 -1
- package/dist/utils/projection-query.d.ts +18 -11
- package/dist/utils/projection-query.d.ts.map +1 -1
- package/dist/utils/projection-query.js +47 -28
- package/dist/utils/projection-query.js.map +1 -1
- package/dist/utils/projection-store.d.ts +2 -2
- package/dist/utils/projection-store.d.ts.map +1 -1
- package/dist/utils/projection-store.js +74 -45
- package/dist/utils/projection-store.js.map +1 -1
- package/dist/utils/rag-database.d.ts +61 -0
- package/dist/utils/rag-database.d.ts.map +1 -0
- package/dist/utils/rag-database.js +178 -0
- package/dist/utils/rag-database.js.map +1 -0
- package/dist/utils/relation-limits.d.ts +7 -2
- package/dist/utils/relation-limits.d.ts.map +1 -1
- package/dist/utils/relation-limits.js +6 -1
- package/dist/utils/relation-limits.js.map +1 -1
- package/dist/utils/relativize-paths.d.ts +23 -0
- package/dist/utils/relativize-paths.d.ts.map +1 -1
- package/dist/utils/relativize-paths.js +32 -1
- package/dist/utils/relativize-paths.js.map +1 -1
- package/dist/utils/resource-loader.d.ts +78 -32
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +134 -66
- package/dist/utils/resource-loader.js.map +1 -1
- package/dist/utils/run-integrity.d.ts +64 -31
- package/dist/utils/run-integrity.d.ts.map +1 -1
- package/dist/utils/run-integrity.js +76 -35
- package/dist/utils/run-integrity.js.map +1 -1
- package/dist/utils/scope-locations.d.ts +7 -5
- package/dist/utils/scope-locations.d.ts.map +1 -1
- package/dist/utils/scope-locations.js +37 -12
- package/dist/utils/scope-locations.js.map +1 -1
- package/dist/utils/staging-dir.d.ts +7 -0
- package/dist/utils/staging-dir.d.ts.map +1 -0
- package/dist/utils/staging-dir.js +12 -0
- package/dist/utils/staging-dir.js.map +1 -0
- package/dist/utils/url-redact.d.ts +9 -0
- package/dist/utils/url-redact.d.ts.map +1 -1
- package/dist/utils/url-redact.js +13 -0
- package/dist/utils/url-redact.js.map +1 -1
- package/dist/utils/user-context-scanner.d.ts +3 -2
- package/dist/utils/user-context-scanner.d.ts.map +1 -1
- package/dist/utils/user-context-scanner.js +24 -4
- package/dist/utils/user-context-scanner.js.map +1 -1
- package/dist/utils/validate-help-files.d.ts.map +1 -1
- package/dist/utils/validate-help-files.js +8 -14
- package/dist/utils/validate-help-files.js.map +1 -1
- package/dist/utils/vat-bin-path.d.ts.map +1 -1
- package/dist/utils/vat-bin-path.js +3 -3
- package/dist/utils/vat-bin-path.js.map +1 -1
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +5 -5
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/docs/agent.md +347 -2
- package/docs/audit.md +312 -89
- package/docs/doctor.md +65 -19
- package/docs/index.md +571 -20
- package/docs/mcp.md +64 -12
- package/docs/rag.md +176 -48
- package/docs/resources.md +257 -71
- package/docs/skill-test.md +148 -19
- package/docs/skills.md +459 -174
- package/package.json +17 -20
- package/schemas/agent-build.json +268 -0
- package/schemas/agent-import.json +252 -0
- package/schemas/agent-install.json +260 -0
- package/schemas/agent-installed.json +287 -0
- package/schemas/agent-list.json +279 -0
- package/schemas/agent-uninstall.json +260 -0
- package/schemas/agent-validate.json +279 -0
- package/schemas/ard-emit.json +228 -107
- package/schemas/audit-settings.json +472 -0
- package/schemas/audit.json +635 -0
- package/schemas/cache-clear.json +273 -0
- package/schemas/claude-marketplace-publish.json +286 -0
- package/schemas/claude-marketplace-validate.json +352 -0
- package/schemas/claude-org-not-implemented.json +239 -0
- package/schemas/claude-plugin-build.json +446 -0
- package/schemas/claude-plugin-install.json +291 -0
- package/schemas/claude-plugin-list.json +326 -0
- package/schemas/claude-plugin-uninstall.json +272 -0
- package/schemas/corpus-audit.json +635 -0
- package/schemas/corpus-scan.json +293 -0
- package/schemas/doctor.json +299 -0
- package/schemas/inventory.json +982 -0
- package/schemas/mcp-list-collections.json +268 -0
- package/schemas/okf-validate.json +224 -106
- package/schemas/orchestrator.json +299 -0
- package/schemas/rag-clear.json +253 -0
- package/schemas/rag-index.json +273 -0
- package/schemas/rag-query.json +365 -0
- package/schemas/rag-stats.json +269 -0
- package/schemas/resources-check.json +280 -118
- package/schemas/resources-query.json +333 -0
- package/schemas/resources-scan.json +321 -0
- package/schemas/resources-validate.json +332 -0
- package/schemas/skill-review.json +224 -106
- package/schemas/skill-test-configure.json +256 -0
- package/schemas/skill-test-run.json +296 -0
- package/schemas/skills-build.json +325 -0
- package/schemas/skills-install.json +287 -0
- package/schemas/skills-list.json +283 -0
- package/schemas/skills-package.json +270 -0
- package/schemas/skills-validate.json +285 -0
- package/dist/commands/skills/shared.d.ts +0 -29
- package/dist/commands/skills/shared.d.ts.map +0 -1
- package/dist/commands/skills/shared.js +0 -33
- package/dist/commands/skills/shared.js.map +0 -1
- package/dist/utils/command-error.d.ts +0 -189
- package/dist/utils/command-error.d.ts.map +0 -1
- package/dist/utils/command-error.js +0 -230
- package/dist/utils/command-error.js.map +0 -1
|
@@ -1,95 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resources validate command - strict validation with error reporting
|
|
3
|
+
*
|
|
4
|
+
* Publishes the `Report<T>` envelope (`validate-schema.ts`): every finding flat
|
|
5
|
+
* with its `location` relative to `data.root`, `examined` = resources validated.
|
|
6
|
+
* A run over zero resources is refused by the writer, from the registry's
|
|
7
|
+
* declared denominator — never by a check at this site.
|
|
3
8
|
*/
|
|
4
9
|
import { readFile } from 'node:fs/promises';
|
|
5
10
|
import * as path from 'node:path';
|
|
6
11
|
import { conventionalSuiteProbe, packagedFileEntries } from '@vibe-agent-toolkit/agent-skills';
|
|
7
|
-
import { DeferredArtifacts, } from '@vibe-agent-toolkit/resources';
|
|
8
|
-
import {
|
|
9
|
-
import { resolveAssetReference, safePath } from '@vibe-agent-toolkit/utils';
|
|
12
|
+
import { DeferredArtifacts, matchesCollection, } from '@vibe-agent-toolkit/resources';
|
|
13
|
+
import { buildReport, countBySeverity, resultStatus, toFindings, } from '@vibe-agent-toolkit/schema';
|
|
14
|
+
import { ASSET_REFERENCE_UNRESOLVED_CODE, isVatError, resolveAssetReference, safePath } from '@vibe-agent-toolkit/utils';
|
|
10
15
|
import * as yaml from 'yaml';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { summarizeFindings } from '../../utils/issue-rendering.js';
|
|
16
|
+
import { CommandRefusalError, refusalCodeOf } from '../../utils/command-refusal.js';
|
|
17
|
+
import { endWithReport, NOTHING_FINISHED, publishedReport, refusalReport } from '../../utils/document-writer.js';
|
|
14
18
|
import { createLogger } from '../../utils/logger.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { nothingCheckedFinding } from '../../utils/run-integrity.js';
|
|
19
|
+
import { classifyInputFault, projectRootOrLoudCwd } from '../../utils/project-root-policy.js';
|
|
20
|
+
import { assertDeclaredCollection, loadResourcesWithConfig, publishedPopulation, } from '../../utils/resource-loader.js';
|
|
21
|
+
import { warnRunIntegrity } from '../../utils/run-integrity.js';
|
|
19
22
|
import { collectDeclaredEvalSuites, mergeSkillPackagingConfig } from '../../utils/skill-packaging-config.js';
|
|
20
|
-
import { finishCommand } from '../phase-utils.js';
|
|
21
23
|
import { discoverSkillsFromConfig } from '../skills/skill-discovery.js';
|
|
24
|
+
/** The verb, as registered. */
|
|
25
|
+
const VERB = 'resources validate';
|
|
26
|
+
/** `vat resources validate` offers no `--strict`: warnings never fail it. */
|
|
27
|
+
const GATE = { strict: false };
|
|
28
|
+
/** The refusal for a `--frontmatter-schema` read the OS refused: a fault on the argument, absent said in its own words. */
|
|
29
|
+
function unreadableSchema(resolvedPath, error) {
|
|
30
|
+
return classifyInputFault(resolvedPath, error, { origin: 'argument', message: `--frontmatter-schema names no file: ${resolvedPath}` });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Read the `--frontmatter-schema` file the operator named.
|
|
34
|
+
*
|
|
35
|
+
* Each way it can fail is a refusal by code, decided HERE — the one site that
|
|
36
|
+
* knows the file is the operator's input: an unsupported extension, an
|
|
37
|
+
* absent file or a bare specifier that resolves to nothing → `USAGE_INVALID`
|
|
38
|
+
* (the flag names nothing usable), a read the OS
|
|
39
|
+
* refuses → `INPUT_UNREADABLE`, and content that is not a JSON/YAML object →
|
|
40
|
+
* `INPUT_UNREADABLE` (not the kind of thing the flag takes).
|
|
41
|
+
*/
|
|
22
42
|
async function loadSchema(schemaPath) {
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
let resolvedPath;
|
|
44
|
+
try {
|
|
45
|
+
resolvedPath = resolveAssetReference(schemaPath, process.cwd());
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (!isVatError(error, ASSET_REFERENCE_UNRESOLVED_CODE))
|
|
49
|
+
throw error;
|
|
50
|
+
throw new CommandRefusalError('USAGE_INVALID', `--frontmatter-schema names no file: ${error.message}`, { cause: error });
|
|
51
|
+
}
|
|
25
52
|
const ext = path.extname(resolvedPath).toLowerCase();
|
|
26
|
-
if (ext
|
|
27
|
-
|
|
53
|
+
if (ext !== '.json' && ext !== '.yaml' && ext !== '.yml') {
|
|
54
|
+
throw new CommandRefusalError('USAGE_INVALID', `Unsupported schema format: ${ext} (use .json or .yaml): ${schemaPath}`);
|
|
28
55
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return parsed;
|
|
33
|
-
}
|
|
34
|
-
throw new Error('YAML schema must be an object');
|
|
56
|
+
let content;
|
|
57
|
+
try {
|
|
58
|
+
content = await readFile(resolvedPath, 'utf-8');
|
|
35
59
|
}
|
|
36
|
-
|
|
37
|
-
throw
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw unreadableSchema(resolvedPath, error);
|
|
38
62
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*/
|
|
43
|
-
function writeStructuredOutput(data, format) {
|
|
44
|
-
if (format === 'json') {
|
|
45
|
-
console.log(JSON.stringify(data, null, 2));
|
|
63
|
+
let parsed;
|
|
64
|
+
try {
|
|
65
|
+
parsed = ext === '.json' ? JSON.parse(content) : yaml.parse(content);
|
|
46
66
|
}
|
|
47
|
-
|
|
48
|
-
|
|
67
|
+
catch (error) {
|
|
68
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
69
|
+
throw new CommandRefusalError('INPUT_UNREADABLE', `--frontmatter-schema ${resolvedPath} does not parse: ${detail}`, { cause: error });
|
|
49
70
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* Group issues by file path, preserving first-seen file order.
|
|
53
|
-
*
|
|
54
|
-
* ONE grouping serves both listing modes, so the two can never disagree about
|
|
55
|
-
* which files have findings — only about how much they say per file.
|
|
56
|
-
*/
|
|
57
|
-
function groupIssuesByFile(issues) {
|
|
58
|
-
const fileMap = new Map();
|
|
59
|
-
for (const issue of issues) {
|
|
60
|
-
const existing = fileMap.get(issue.file);
|
|
61
|
-
if (existing) {
|
|
62
|
-
existing.push(issue);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
fileMap.set(issue.file, [issue]);
|
|
66
|
-
}
|
|
71
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
72
|
+
throw new CommandRefusalError('INPUT_UNREADABLE', `--frontmatter-schema ${resolvedPath} must hold a schema object`);
|
|
67
73
|
}
|
|
68
|
-
return
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Project the grouping onto the rows the report publishes.
|
|
72
|
-
*
|
|
73
|
-
* A file only reaches this function if it emitted something, so "clean files are
|
|
74
|
-
* omitted" is a property of the input, not a filter applied here.
|
|
75
|
-
*/
|
|
76
|
-
function buildIssueRows(issues, verbose) {
|
|
77
|
-
return [...groupIssuesByFile(issues).entries()].map(([file, fileIssues]) => {
|
|
78
|
-
if (verbose) {
|
|
79
|
-
return {
|
|
80
|
-
file,
|
|
81
|
-
issues: fileIssues.map((issue) => ({
|
|
82
|
-
line: issue.line,
|
|
83
|
-
column: issue.column,
|
|
84
|
-
code: issue.code,
|
|
85
|
-
severity: issue.severity,
|
|
86
|
-
message: issue.message,
|
|
87
|
-
})),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const { codes, ...counts } = summarizeFindings(fileIssues);
|
|
91
|
-
return { file, ...counts, codes };
|
|
92
|
-
});
|
|
74
|
+
return parsed;
|
|
93
75
|
}
|
|
94
76
|
/**
|
|
95
77
|
* Log git tracker stats if available.
|
|
@@ -100,195 +82,65 @@ function logGitTrackerStats(gitTracker, logger) {
|
|
|
100
82
|
logger.debug(`Git tracker cache size: ${gitStats.cacheSize} files`);
|
|
101
83
|
}
|
|
102
84
|
}
|
|
103
|
-
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
85
|
+
/** The findings located at each root-relative path. */
|
|
86
|
+
function findingsByLocation(findings) {
|
|
87
|
+
const byLocation = new Map();
|
|
88
|
+
for (const finding of findings) {
|
|
89
|
+
if (finding.location === undefined)
|
|
90
|
+
continue;
|
|
91
|
+
const located = byLocation.get(finding.location) ?? [];
|
|
92
|
+
located.push(finding);
|
|
93
|
+
byLocation.set(finding.location, located);
|
|
110
94
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
95
|
+
return byLocation;
|
|
96
|
+
}
|
|
97
|
+
/** Each configured collection, with the findings located in its files counted. */
|
|
98
|
+
function collectionsData(collectionStats, resources, byLocation) {
|
|
99
|
+
const collections = {};
|
|
100
|
+
for (const [id, stat] of Object.entries(collectionStats?.collections ?? {})) {
|
|
101
|
+
const perFile = resources
|
|
102
|
+
.filter((resource) => resource.collections?.includes(id) ?? false)
|
|
103
|
+
.map((resource) => byLocation.get(resource.relativePath) ?? []);
|
|
104
|
+
collections[id] = {
|
|
105
|
+
...stat,
|
|
106
|
+
filesWithErrors: perFile.filter((findings) => findings.some((finding) => finding.severity === 'error')).length,
|
|
107
|
+
summary: countBySeverity(perFile.flat()),
|
|
119
108
|
};
|
|
120
109
|
}
|
|
121
|
-
return
|
|
110
|
+
return collections;
|
|
122
111
|
}
|
|
123
112
|
/**
|
|
124
|
-
* Build the
|
|
125
|
-
*
|
|
126
|
-
* Surfaces ALL severity-resolved issues (errors AND warnings/info) so users see
|
|
127
|
-
* them; only the `error*`-named counts are error-severity. Exported so the
|
|
128
|
-
* reported vocabulary is unit-testable without spawning the CLI.
|
|
113
|
+
* Build the report. Pure: no file system, no clock, no `process.exit`.
|
|
129
114
|
*
|
|
130
|
-
* `
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*/
|
|
136
|
-
export function buildIssuesOutputData(issueData, context, registry, verbose = false) {
|
|
137
|
-
const summary = buildIssueSummary(issueData, registry);
|
|
138
|
-
const collectionsWithErrors = buildCollectionsWithErrors(context.collectionStats, summary.collectionErrorStats);
|
|
139
|
-
// ONE answer to "issues → status", from the shared collapse in schema —
|
|
140
|
-
// the worst ACTIONABLE severity, so an info-only run is `success`. That is
|
|
141
|
-
// honest only because `issueCounts` rides beside it, naming what was found.
|
|
142
|
-
const issueCounts = countBySeverity(issueData);
|
|
143
|
-
return {
|
|
144
|
-
status: calculateValidationStatus(issueData),
|
|
145
|
-
filesScanned: context.stats.totalResources,
|
|
146
|
-
filesWithErrors: summary.filesWithErrors,
|
|
147
|
-
errorsFound: issueCounts.errors,
|
|
148
|
-
issueCounts,
|
|
149
|
-
issueSummary: summary.issueSummary,
|
|
150
|
-
durationSecs: formatDurationSecs(context.duration),
|
|
151
|
-
...context.validationMetadata,
|
|
152
|
-
...(Object.keys(collectionsWithErrors).length > 0 ? { collections: collectionsWithErrors } : {}),
|
|
153
|
-
issues: buildIssueRows(issueData, verbose),
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* The document for a run that emitted nothing.
|
|
115
|
+
* `status` and `summary` are derived by `buildReport` from the findings, so an
|
|
116
|
+
* info-only run is `findings` with `summary.info` naming what was found — one
|
|
117
|
+
* vocabulary with every other report verb. The run-integrity refusal for a run
|
|
118
|
+
* over zero resources is NOT decided here; the writer adds it from the
|
|
119
|
+
* registry's declared denominator.
|
|
158
120
|
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* issue set. Any run that emitted anything, at any severity, goes through
|
|
162
|
-
* {@link buildIssuesOutputData} instead.
|
|
121
|
+
* @param input - The run's results
|
|
122
|
+
* @returns The report, before the writer's run-integrity pass
|
|
163
123
|
*/
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
124
|
+
export function buildResourcesValidateReport(input) {
|
|
125
|
+
const findings = toFindings(input.issues);
|
|
126
|
+
const byLocation = findingsByLocation(findings);
|
|
127
|
+
const resources = input.resources.map((resource) => ({
|
|
128
|
+
...resource,
|
|
129
|
+
relativePath: safePath.relative(input.root, resource.filePath),
|
|
130
|
+
}));
|
|
131
|
+
const data = {
|
|
132
|
+
// Stated once, and the only absolute path in the document.
|
|
133
|
+
root: input.root,
|
|
134
|
+
collections: collectionsData(input.collectionStats, resources, byLocation),
|
|
135
|
+
population: input.population,
|
|
172
136
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
console.log(`Files scanned: ${context.stats.totalResources}`);
|
|
178
|
-
console.log(`Links checked: ${context.stats.totalLinks}`);
|
|
179
|
-
if (context.collectionStats) {
|
|
180
|
-
console.log(`Collections: ${context.collectionStats.totalCollections}`);
|
|
181
|
-
console.log(`Resources in collections: ${context.collectionStats.resourcesInCollections}`);
|
|
182
|
-
}
|
|
183
|
-
console.log(`Duration: ${context.duration}ms`);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Build error summary from validation issues.
|
|
187
|
-
*
|
|
188
|
-
* Calculates:
|
|
189
|
-
* - Error counts by type
|
|
190
|
-
* - Unique files with errors
|
|
191
|
-
* - Per-collection error statistics
|
|
192
|
-
*
|
|
193
|
-
* @param issues - Flattened validation issues (relative `file`, absolute `absPath`, `code`)
|
|
194
|
-
* @param registry - Resource registry for collection lookups (keyed by ABSOLUTE path)
|
|
195
|
-
* @returns Error summary statistics
|
|
196
|
-
*/
|
|
197
|
-
function buildIssueSummary(issues, registry) {
|
|
198
|
-
// 1. Count by code — ALL severities, so an info-only scan still reports WHICH
|
|
199
|
-
// codes fired rather than an empty object.
|
|
200
|
-
const issueSummary = {};
|
|
201
|
-
for (const issue of issues) {
|
|
202
|
-
issueSummary[issue.code] = (issueSummary[issue.code] ?? 0) + 1;
|
|
203
|
-
}
|
|
204
|
-
// 2. Every remaining count in this function is named `error*`, so every one of
|
|
205
|
-
// them is computed over ERROR-severity issues only. A file carrying nothing
|
|
206
|
-
// but info notes is not a file with errors.
|
|
207
|
-
// And a FILE: a finding that names none (the run-integrity refusal, a
|
|
208
|
-
// config-level error) is counted in `issueCounts`, never as a file — else
|
|
209
|
-
// `filesWithErrors: 1` would sit beside `filesScanned: 0`.
|
|
210
|
-
const errorIssues = issues.filter((i) => i.severity === 'error');
|
|
211
|
-
const filesWithErrorsSet = new Set(errorIssues.map(i => i.file).filter((file) => file !== ''));
|
|
212
|
-
// 3. Map files to collections and count errors per collection.
|
|
213
|
-
// registry.getResource keys on the ABSOLUTE path, so look up via absPath.
|
|
214
|
-
const collectionErrors = new Map();
|
|
215
|
-
for (const issue of errorIssues) {
|
|
216
|
-
const resource = registry.getResource(issue.absPath);
|
|
217
|
-
const collections = resource?.collections;
|
|
218
|
-
if (collections) {
|
|
219
|
-
for (const collectionId of collections) {
|
|
220
|
-
const stat = collectionErrors.get(collectionId) ?? {
|
|
221
|
-
filesWithErrors: new Set(),
|
|
222
|
-
errorCount: 0,
|
|
223
|
-
};
|
|
224
|
-
stat.filesWithErrors.add(issue.file);
|
|
225
|
-
stat.errorCount++;
|
|
226
|
-
collectionErrors.set(collectionId, stat);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
// Convert Sets to counts
|
|
231
|
-
const collectionStats = new Map();
|
|
232
|
-
for (const [id, stat] of collectionErrors.entries()) {
|
|
233
|
-
collectionStats.set(id, {
|
|
234
|
-
filesWithErrors: stat.filesWithErrors.size,
|
|
235
|
-
errorCount: stat.errorCount,
|
|
137
|
+
if (input.verbose) {
|
|
138
|
+
data.files = resources.map((resource) => {
|
|
139
|
+
const located = byLocation.get(resource.relativePath) ?? [];
|
|
140
|
+
return { path: resource.relativePath, status: resultStatus(located), summary: countBySeverity(located) };
|
|
236
141
|
});
|
|
237
142
|
}
|
|
238
|
-
return {
|
|
239
|
-
issueSummary,
|
|
240
|
-
filesWithErrors: filesWithErrorsSet.size,
|
|
241
|
-
collectionErrorStats: collectionStats,
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Restrict issues and stats to a single collection.
|
|
246
|
-
*
|
|
247
|
-
* Issue locations are RELATIVE to projectRoot, but `resource.filePath` is
|
|
248
|
-
* ABSOLUTE — convert the collection's resource paths to the same relative basis
|
|
249
|
-
* before comparing, so the filter actually matches.
|
|
250
|
-
*/
|
|
251
|
-
function filterByCollection(registry, validationResult, collection, projectRoot) {
|
|
252
|
-
const collectionResources = registry
|
|
253
|
-
.getAllResources()
|
|
254
|
-
.filter(r => r.collections?.includes(collection) ?? false);
|
|
255
|
-
const collectionPaths = new Set(collectionResources.map(r => safePath.relative(projectRoot, r.filePath)));
|
|
256
|
-
const filteredIssues = validationResult.issues.filter(issue => issue.location !== undefined && collectionPaths.has(issue.location));
|
|
257
|
-
const totalLinks = collectionResources.reduce((sum, r) => sum + r.links.length, 0);
|
|
258
|
-
return {
|
|
259
|
-
filteredIssues,
|
|
260
|
-
filteredStats: {
|
|
261
|
-
totalResources: collectionResources.length,
|
|
262
|
-
totalLinks,
|
|
263
|
-
linksByType: validationResult.linksByType, // Keep all link types
|
|
264
|
-
},
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Flatten severity-resolved issues for display.
|
|
269
|
-
*
|
|
270
|
-
* `file` is RELATIVE to projectRoot (matches `issue.location`, used for display);
|
|
271
|
-
* `absPath` is ABSOLUTE (for registry/collection lookups via getResource).
|
|
272
|
-
*
|
|
273
|
-
* `code` is re-narrowed on the way through: `ValidationResult` is Zod-inferred and
|
|
274
|
-
* its schema widens `code` to `string` on purpose, while the hand-written
|
|
275
|
-
* `ValidationIssue` interface — the contract every producer builds against — types
|
|
276
|
-
* it as `ValidationIssueCode`. Restoring that narrowing here is what lets the
|
|
277
|
-
* shared `calculateValidationStatus`/`countBySeverity` read this list directly.
|
|
278
|
-
*/
|
|
279
|
-
function flattenIssuesForDisplay(issues, projectRoot) {
|
|
280
|
-
return issues.map(issue => {
|
|
281
|
-
const file = issue.location ?? '';
|
|
282
|
-
return {
|
|
283
|
-
file,
|
|
284
|
-
absPath: file ? safePath.resolve(projectRoot, file) : '',
|
|
285
|
-
line: issue.line ?? 1,
|
|
286
|
-
column: 1,
|
|
287
|
-
code: issue.code,
|
|
288
|
-
severity: issue.severity,
|
|
289
|
-
message: issue.message,
|
|
290
|
-
};
|
|
291
|
-
});
|
|
143
|
+
return buildReport({ examined: resources.length, findings, data, gate: GATE, durationMs: input.durationMs });
|
|
292
144
|
}
|
|
293
145
|
/**
|
|
294
146
|
* Translate `--no-cache` into the `noCache` input `ResourceRegistry.validate()`
|
|
@@ -347,7 +199,7 @@ export async function computeDeferredArtifacts(config, projectRoot) {
|
|
|
347
199
|
return undefined;
|
|
348
200
|
}
|
|
349
201
|
// `'refuse'`: the `files:` dest check below is only as complete as this
|
|
350
|
-
// list. The throw lands in the command's catch →
|
|
202
|
+
// list. The throw lands in the command's catch → a refusal by its code, exit 2.
|
|
351
203
|
const discovered = await discoverSkillsFromConfig(config.skills, projectRoot, 'refuse');
|
|
352
204
|
const { defaults, config: perSkillConfig } = config.skills;
|
|
353
205
|
// Assembled ONCE for the whole run, then handed to every skill below. Rebuilding
|
|
@@ -379,134 +231,134 @@ export async function computeDeferredArtifacts(config, projectRoot) {
|
|
|
379
231
|
return DeferredArtifacts.from(skillFiles, projectRoot);
|
|
380
232
|
}
|
|
381
233
|
/**
|
|
382
|
-
* Validate resources and
|
|
383
|
-
*
|
|
234
|
+
* Validate resources and build the report, printing nothing.
|
|
235
|
+
*
|
|
236
|
+
* @throws Whatever refuses the run — a refusal by its code (`refusalCodeOf`)
|
|
237
|
+
*/
|
|
238
|
+
async function runValidation(pathArg, options, logger, startTime) {
|
|
239
|
+
// Resolve projectRoot at the CLI boundary (spec §5/§7 — loud-cwd policy).
|
|
240
|
+
const projectRoot = projectRootOrLoudCwd(pathArg ?? process.cwd(), logger);
|
|
241
|
+
// Load resources with config support (includes GitTracker initialization)
|
|
242
|
+
const { registry, config, gitTracker, population } = await loadResourcesWithConfig(pathArg, projectRoot, logger);
|
|
243
|
+
assertDeclaredCollection(config, options.collection);
|
|
244
|
+
// CLI flag: --no-check-frontmatter-links disables the check for every collection.
|
|
245
|
+
// Commander represents the negated form as options.checkFrontmatterLinks === false.
|
|
246
|
+
if (options.checkFrontmatterLinks === false) {
|
|
247
|
+
applyNoCheckFrontmatterLinksFlag(config);
|
|
248
|
+
}
|
|
249
|
+
let frontmatterSchemaObj;
|
|
250
|
+
if (options.frontmatterSchema) {
|
|
251
|
+
logger.debug(`Loading frontmatter schema from: ${options.frontmatterSchema}`);
|
|
252
|
+
frontmatterSchemaObj = await loadSchema(options.frontmatterSchema);
|
|
253
|
+
}
|
|
254
|
+
// Compute deferred build-artifact coverage from the SAME skill discovery +
|
|
255
|
+
// config-merge `vat skills validate` uses, so a `files:`-declared link that
|
|
256
|
+
// lane reports as LINK_DEFERRED_ARTIFACT (info) is never independently
|
|
257
|
+
// reported here as LINK_BROKEN_FILE (error) — the headline bug this closes.
|
|
258
|
+
const deferredArtifacts = await computeDeferredArtifacts(config, projectRoot);
|
|
259
|
+
const validationResult = await registry.validate({
|
|
260
|
+
...(frontmatterSchemaObj ? { frontmatterSchema: frontmatterSchemaObj } : {}),
|
|
261
|
+
validationMode: options.validationMode ?? 'strict',
|
|
262
|
+
checkExternalUrls: options.checkExternalUrls ?? false,
|
|
263
|
+
checkHtmlAnchors: options.checkHtmlAnchors ?? false,
|
|
264
|
+
noCache: resolveNoCache(options),
|
|
265
|
+
// Thread the project's resources.validation config in. The CLI does NOT
|
|
266
|
+
// resolve severity itself — ResourceRegistry.validate() runs the framework.
|
|
267
|
+
validationConfig: config?.resources?.validation ?? {},
|
|
268
|
+
...(deferredArtifacts !== undefined && { deferredArtifacts }),
|
|
269
|
+
});
|
|
270
|
+
logGitTrackerStats(gitTracker, logger);
|
|
271
|
+
// 🔑 `--collection` scopes the WHOLE report — findings, `examined`, and so
|
|
272
|
+
// the exit code — to that collection's resources. The exit code derives from
|
|
273
|
+
// the published document alone, so a report and its exit code never disagree.
|
|
274
|
+
const resources = registry.getAllResources()
|
|
275
|
+
.filter((resource) => options.collection === undefined || (resource.collections?.includes(options.collection) ?? false));
|
|
276
|
+
// `ValidationResult` is Zod-inferred and widens `code` to string; the issues
|
|
277
|
+
// themselves are the `ValidationIssue`s every producer built.
|
|
278
|
+
const issues = inCollectionScope(validationResult.issues, {
|
|
279
|
+
projectRoot,
|
|
280
|
+
all: registry.getAllResources(),
|
|
281
|
+
inScope: resources,
|
|
282
|
+
collection: options.collection === undefined ? undefined : config?.resources?.collections?.[options.collection],
|
|
283
|
+
});
|
|
284
|
+
return buildResourcesValidateReport({
|
|
285
|
+
root: projectRoot,
|
|
286
|
+
resources,
|
|
287
|
+
issues,
|
|
288
|
+
collectionStats: narrowCollectionStats(registry.getCollectionStats(), options.collection),
|
|
289
|
+
verbose: options.verbose === true,
|
|
290
|
+
durationMs: Date.now() - startTime,
|
|
291
|
+
population: publishedPopulation(population),
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* The findings `--collection` keeps: those about the named collection, and
|
|
296
|
+
* those about the run.
|
|
297
|
+
*
|
|
298
|
+
* - A finding with no location is about the run: kept.
|
|
299
|
+
* - One located at a RESOURCE is kept when that resource is in the collection.
|
|
300
|
+
* - One located at a path that never became a resource (a file the glob
|
|
301
|
+
* matched and could not read, a MIME conflict) is kept when the collection's
|
|
302
|
+
* OWN include/exclude patterns match that path — the same `matchesCollection`
|
|
303
|
+
* the registry assigns membership with.
|
|
384
304
|
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
305
|
+
* 🚨 Keeping only "findings at the collection's resources" published `ok`, exit
|
|
306
|
+
* 0, over an unreadable file in the collection; keeping every non-resource
|
|
307
|
+
* path failed `--collection X` on collection Y's unreadable file.
|
|
308
|
+
*
|
|
309
|
+
* @param issues - The library's issues over the whole run
|
|
310
|
+
* @param scope - The root, every resource, the collection's resources, and its config
|
|
311
|
+
* @returns The issues in scope — all of them when no collection is named
|
|
312
|
+
*/
|
|
313
|
+
function inCollectionScope(issues, scope) {
|
|
314
|
+
const { collection, projectRoot } = scope;
|
|
315
|
+
if (collection === undefined)
|
|
316
|
+
return [...issues];
|
|
317
|
+
const relative = (resource) => safePath.relative(projectRoot, resource.filePath);
|
|
318
|
+
const resourcePaths = new Set(scope.all.map(relative));
|
|
319
|
+
const inScope = new Set(scope.inScope.map(relative));
|
|
320
|
+
return issues.filter((issue) => {
|
|
321
|
+
if (issue.location === undefined)
|
|
322
|
+
return true;
|
|
323
|
+
if (resourcePaths.has(issue.location))
|
|
324
|
+
return inScope.has(issue.location);
|
|
325
|
+
return matchesCollection(safePath.resolve(projectRoot, issue.location), collection);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Validate resources and hand back the report, printing it nowhere.
|
|
330
|
+
*
|
|
331
|
+
* The phase entry point for `vat validate` and `vat verify`, and the command's
|
|
332
|
+
* own. The report is the one BEFORE the writer's run-integrity pass: inside an
|
|
333
|
+
* orchestrator, `runPhase` applies the same pass to this phase's report, by the
|
|
334
|
+
* declaration this verb gives its own writer. A
|
|
335
|
+
* refusal is the envelope's error branch, its message already on stderr, and a
|
|
336
|
+
* site-specific run-integrity finding is warned here, where both lanes see it.
|
|
389
337
|
*/
|
|
390
338
|
export async function runResourcesValidatePhase(pathArg, options) {
|
|
391
339
|
const logger = createLogger(options.debug ? { debug: true } : {});
|
|
392
340
|
const startTime = Date.now();
|
|
393
341
|
try {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const { registry, config, gitTracker } = await loadResourcesWithConfig(pathArg, projectRoot, logger);
|
|
398
|
-
// CLI flag: --no-check-frontmatter-links disables the check for every collection.
|
|
399
|
-
// Commander represents the negated form as options.checkFrontmatterLinks === false.
|
|
400
|
-
if (options.checkFrontmatterLinks === false) {
|
|
401
|
-
applyNoCheckFrontmatterLinksFlag(config);
|
|
402
|
-
}
|
|
403
|
-
// Load frontmatter schema if provided
|
|
404
|
-
let frontmatterSchemaObj;
|
|
405
|
-
if (options.frontmatterSchema) {
|
|
406
|
-
logger.debug(`Loading frontmatter schema from: ${options.frontmatterSchema}`);
|
|
407
|
-
frontmatterSchemaObj = await loadSchema(options.frontmatterSchema);
|
|
408
|
-
}
|
|
409
|
-
// Compute deferred build-artifact coverage from the SAME skill discovery +
|
|
410
|
-
// config-merge `vat skills validate` uses, so a `files:`-declared link that
|
|
411
|
-
// lane reports as LINK_DEFERRED_ARTIFACT (info) is never independently
|
|
412
|
-
// reported here as LINK_BROKEN_FILE (error) — the headline bug this closes.
|
|
413
|
-
const deferredArtifacts = await computeDeferredArtifacts(config, projectRoot);
|
|
414
|
-
// Validate all resources
|
|
415
|
-
const validationMode = options.validationMode ?? 'strict';
|
|
416
|
-
const validationResult = await registry.validate({
|
|
417
|
-
...(frontmatterSchemaObj ? { frontmatterSchema: frontmatterSchemaObj } : {}),
|
|
418
|
-
validationMode,
|
|
419
|
-
checkExternalUrls: options.checkExternalUrls ?? false,
|
|
420
|
-
checkHtmlAnchors: options.checkHtmlAnchors ?? false,
|
|
421
|
-
noCache: resolveNoCache(options),
|
|
422
|
-
// Thread the project's resources.validation config in. The CLI does NOT
|
|
423
|
-
// resolve severity itself — ResourceRegistry.validate() runs the framework.
|
|
424
|
-
validationConfig: config?.resources?.validation ?? {},
|
|
425
|
-
...(deferredArtifacts !== undefined && { deferredArtifacts }),
|
|
426
|
-
});
|
|
427
|
-
// Filter by collection if specified
|
|
428
|
-
const { filteredIssues, filteredStats } = options.collection
|
|
429
|
-
? filterByCollection(registry, validationResult, options.collection, projectRoot)
|
|
430
|
-
: { filteredIssues: validationResult.issues, filteredStats: registry.getStats() };
|
|
431
|
-
const duration = Date.now() - startTime;
|
|
432
|
-
// Build validation metadata
|
|
433
|
-
const validationMetadata = {
|
|
434
|
-
validationMode,
|
|
435
|
-
...(options.frontmatterSchema ? { frontmatterSchema: options.frontmatterSchema } : {}),
|
|
436
|
-
};
|
|
437
|
-
// Get collection stats (narrowed to the requested collection, if any).
|
|
438
|
-
const collectionStats = narrowCollectionStats(registry.getCollectionStats(), options.collection);
|
|
439
|
-
// The library already severity-resolved every issue (allow-filtered, ignored
|
|
440
|
-
// dropped) and decided pass/fail. The CLI is a dumb orchestrator: the failure
|
|
441
|
-
// decision is exactly the framework's severity-based `hasErrors`. Warning- and
|
|
442
|
-
// info-severity issues are surfaced below but DO NOT flip the exit code.
|
|
443
|
-
//
|
|
444
|
-
// The reported `status` is derived separately, from the issues actually
|
|
445
|
-
// REPORTED (post `--collection` filter) — see `buildIssuesOutputData`. Without
|
|
446
|
-
// a filter the two are the same question with the same answer: `hasErrors` and
|
|
447
|
-
// `calculateValidationStatus(...) === 'error'` are both "any error-severity
|
|
448
|
-
// issue". With `--collection`, `status` describes the collection asked about
|
|
449
|
-
// while the exit code still covers the whole project.
|
|
450
|
-
const { hasErrors } = validationResult;
|
|
451
|
-
// Flatten issues for display (relative `file` + absolute `absPath`).
|
|
452
|
-
const issueData = flattenIssuesForDisplay(filteredIssues, projectRoot);
|
|
453
|
-
const context = {
|
|
454
|
-
stats: filteredStats,
|
|
455
|
-
validationMetadata,
|
|
456
|
-
collectionStats,
|
|
457
|
-
duration,
|
|
458
|
-
...(options.collection === undefined ? {} : { collection: options.collection }),
|
|
459
|
-
};
|
|
460
|
-
const document = buildValidationDocument(issueData, context, registry, options.verbose === true);
|
|
461
|
-
if ((options.format ?? 'yaml') === 'text') {
|
|
462
|
-
// Prints every reported row, refusal included, so it needs no warning.
|
|
463
|
-
emitTextResult(issueData, context);
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
warnRunIntegrity(issueData, context, logger);
|
|
467
|
-
}
|
|
468
|
-
logGitTrackerStats(gitTracker, logger);
|
|
469
|
-
// Two verdicts, OR'd: the library's severity-based `hasErrors` over the
|
|
470
|
-
// whole project, and the document's own `status`, which is where the
|
|
471
|
-
// run-integrity refusal lands and which `hasErrors` cannot see — see
|
|
472
|
-
// {@link exitCodeForValidateRun}.
|
|
473
|
-
return { document, exitCode: exitCodeForValidateRun(hasErrors, document) };
|
|
342
|
+
const report = await runValidation(pathArg, options, logger, startTime);
|
|
343
|
+
warnRunIntegrity(report);
|
|
344
|
+
return { report };
|
|
474
345
|
}
|
|
475
346
|
catch (error) {
|
|
476
|
-
return {
|
|
477
|
-
document: reportCommandError(error, logger, startTime, 'Validation'),
|
|
478
|
-
exitCode: 2,
|
|
479
|
-
failed: true,
|
|
480
|
-
};
|
|
347
|
+
return { report: refusalReport(refusalCodeOf(error), error, GATE, NOTHING_FINISHED) };
|
|
481
348
|
}
|
|
482
349
|
}
|
|
483
|
-
/**
|
|
484
|
-
* The exit code for a run, from the two verdicts that can each fail it.
|
|
485
|
-
*
|
|
486
|
-
* `hasErrors` is the library's, computed over the WHOLE project before any
|
|
487
|
-
* `--collection` filter, so an error the filter hid from the document still
|
|
488
|
-
* fails the run. The document's `status` is computed over what was REPORTED —
|
|
489
|
-
* which is where the run-integrity refusal lands (see
|
|
490
|
-
* {@link buildValidationDocument}), and it has no counterpart in `hasErrors`
|
|
491
|
-
* because the library never sees the filter. Either alone lets one of those two
|
|
492
|
-
* failures through; the run fails on both.
|
|
493
|
-
*/
|
|
494
|
-
export function exitCodeForValidateRun(hasErrors, document) {
|
|
495
|
-
return hasErrors || document.status === 'error' ? 1 : 0;
|
|
496
|
-
}
|
|
497
350
|
export async function validateCommand(pathArg, options) {
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}
|
|
505
|
-
}, format);
|
|
351
|
+
const { report } = await runResourcesValidatePhase(pathArg, options);
|
|
352
|
+
const published = publishedReport(VERB, report);
|
|
353
|
+
// The writer's own zero-examined refusal, warned in the lane that publishes it.
|
|
354
|
+
if (published !== report)
|
|
355
|
+
warnRunIntegrity(published);
|
|
356
|
+
endWithReport('resources validate', published, options.format ?? 'yaml');
|
|
506
357
|
}
|
|
507
358
|
/**
|
|
508
|
-
* Narrow collection stats to
|
|
509
|
-
*
|
|
359
|
+
* Narrow collection stats to the one requested collection — or to none when it
|
|
360
|
+
* holds no resource (the registry's stats list only collections with members;
|
|
361
|
+
* an undeclared name was refused before this runs).
|
|
510
362
|
*/
|
|
511
363
|
function narrowCollectionStats(collectionStats, collection) {
|
|
512
364
|
if (!collection || !collectionStats) {
|
|
@@ -514,7 +366,7 @@ function narrowCollectionStats(collectionStats, collection) {
|
|
|
514
366
|
}
|
|
515
367
|
const collectionStat = collectionStats.collections[collection];
|
|
516
368
|
if (!collectionStat) {
|
|
517
|
-
return
|
|
369
|
+
return undefined;
|
|
518
370
|
}
|
|
519
371
|
return {
|
|
520
372
|
totalCollections: 1,
|
|
@@ -522,120 +374,4 @@ function narrowCollectionStats(collectionStats, collection) {
|
|
|
522
374
|
collections: { [collection]: collectionStat },
|
|
523
375
|
};
|
|
524
376
|
}
|
|
525
|
-
/**
|
|
526
|
-
* THE document this command publishes, for either outcome.
|
|
527
|
-
*
|
|
528
|
-
* Built as a value and rendered separately, because the same document now has
|
|
529
|
-
* two destinations: stdout for a command-line run, and `phases[].report` when
|
|
530
|
-
* `vat validate` or `vat verify` runs this as one of its phases in their own
|
|
531
|
-
* process. Deriving it twice — once to print, once to hand back — is how the two
|
|
532
|
-
* lanes come to disagree about what this command reported.
|
|
533
|
-
*/
|
|
534
|
-
export function buildValidationDocument(issueData, context, registry, verbose) {
|
|
535
|
-
const reported = withRunIntegrity(issueData, context);
|
|
536
|
-
return reported.length === 0
|
|
537
|
-
? buildSuccessOutputData(context)
|
|
538
|
-
: buildIssuesOutputData(reported, context, registry, verbose);
|
|
539
|
-
}
|
|
540
|
-
/** What did not run and what to do, for the two ways a scan comes back empty. */
|
|
541
|
-
function nothingScannedMessage(collection) {
|
|
542
|
-
const scope = collection === undefined ? '' : ` for --collection ${collection}`;
|
|
543
|
-
const cause = collection === undefined
|
|
544
|
-
? ' The path names no markdown, or `resources.include`/`resources.exclude` enumerate'
|
|
545
|
-
+ ' nothing — a broad exclude, a shallow or sparse checkout, or a root that resolved'
|
|
546
|
-
+ ' somewhere else.'
|
|
547
|
-
: ' The collection name is usually a typo or a collection that was renamed; if it is'
|
|
548
|
-
+ ' meant to be empty, drop the filter rather than leaving a step that can only pass.';
|
|
549
|
-
return `No resource was scanned${scope},`
|
|
550
|
-
+ ' so this document is not a verdict: a run over zero files produces the same report'
|
|
551
|
-
+ ' as a clean run, and this one cannot tell you which it was.'
|
|
552
|
-
+ cause
|
|
553
|
-
+ ' `vat resources scan` over the same path lists what an enumeration finds.';
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* The refusal for a run that scanned NO file, ahead of whatever it found.
|
|
557
|
-
*
|
|
558
|
-
* 🚨 **This shipped.** `vat resources validate --collection <typo>` reported
|
|
559
|
-
* `status: success`, `filesScanned: 0`, exit 0: the filter matched no resource,
|
|
560
|
-
* zero issues over zero files serialized as "every file is clean", and the exit
|
|
561
|
-
* code came from the library's `hasErrors`, which never sees the filter. A path
|
|
562
|
-
* naming a tree with no markdown reached the same document through
|
|
563
|
-
* {@link buildSuccessOutputData}. Nothing refused the zero denominator at either
|
|
564
|
-
* layer, and no test covered it.
|
|
565
|
-
*
|
|
566
|
-
* 🔑 Derived here — the one seam both the document builder and the `--format
|
|
567
|
-
* text` renderer read — and not in the handler, so no lane can build a clean
|
|
568
|
-
* document over `filesScanned: 0`. The registry's own `validate()` is left
|
|
569
|
-
* unchanged on purpose: it is a library, and a caller validating an
|
|
570
|
-
* intentionally empty registry is asking a legitimate question. The CLI is the
|
|
571
|
-
* gate, and a gate is what must not answer `success` for a run that checked
|
|
572
|
-
* nothing.
|
|
573
|
-
*
|
|
574
|
-
* Published as a row with no `file` — the claim is about the run, not a file —
|
|
575
|
-
* at line 1, the same coordinates every location-less library finding already
|
|
576
|
-
* takes through {@link flattenIssuesForDisplay}.
|
|
577
|
-
*/
|
|
578
|
-
function withRunIntegrity(issueData, context) {
|
|
579
|
-
return [
|
|
580
|
-
...runIntegrityRefusal(issueData, context).map((issue) => ({
|
|
581
|
-
file: '',
|
|
582
|
-
absPath: '',
|
|
583
|
-
line: 1,
|
|
584
|
-
column: 1,
|
|
585
|
-
code: issue.code,
|
|
586
|
-
severity: issue.severity,
|
|
587
|
-
message: issue.message,
|
|
588
|
-
})),
|
|
589
|
-
...issueData,
|
|
590
|
-
];
|
|
591
|
-
}
|
|
592
|
-
/** The refusal itself, before it is shaped into a row — the one derivation both channels read. */
|
|
593
|
-
function runIntegrityRefusal(issueData, context) {
|
|
594
|
-
return nothingCheckedFinding(context.stats.totalResources, issueData, () => nothingScannedMessage(context.collection));
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* The human half of {@link withRunIntegrity}: the same message, on stderr.
|
|
598
|
-
*
|
|
599
|
-
* 🚨 **The message never reached the operator.** The refusal is a row with
|
|
600
|
-
* `file: ''`, and the default listing projects a row to `{file, errors,
|
|
601
|
-
* codes}` — so the document read `RESOURCE_CHECK_BROKEN: 1` beside an empty
|
|
602
|
-
* file name and nothing said which collection matched nothing or what to do.
|
|
603
|
-
* The remedy text existed only under `--verbose`; through `vat validate` it was
|
|
604
|
-
* nested under `phases[].report` with stderr reading `▶ Surface: resources`.
|
|
605
|
-
* `vat resources check` and `vat claude budget` already warn on stderr beside
|
|
606
|
-
* their document refusal; this is the same statement for the same reason. It
|
|
607
|
-
* decides nothing — the document is what gates.
|
|
608
|
-
*/
|
|
609
|
-
function warnRunIntegrity(issueData, context, logger) {
|
|
610
|
-
for (const issue of runIntegrityRefusal(issueData, context)) {
|
|
611
|
-
logger.warn(`Warning: ${issue.message}`);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Render the `--format text` output, which publishes NO document.
|
|
616
|
-
*
|
|
617
|
-
* Kept inside the run rather than in the command wrapper because it renders the
|
|
618
|
-
* run's internal state — the flattened issue rows and the stats context — not
|
|
619
|
-
* the published document. It is the one output format with nothing for an
|
|
620
|
-
* orchestrator to fold, and no orchestrator asks for it.
|
|
621
|
-
*
|
|
622
|
-
* Unaffected by `verbose`: it is already one `file:line:col:` line per issue,
|
|
623
|
-
* which is what `--verbose` restores in the structured formats.
|
|
624
|
-
*/
|
|
625
|
-
function emitTextResult(issueData, context) {
|
|
626
|
-
// The same derivation the document goes through, so the human channel cannot
|
|
627
|
-
// print "All validations passed" over a run the document refused.
|
|
628
|
-
const reported = withRunIntegrity(issueData, context);
|
|
629
|
-
if (reported.length === 0) {
|
|
630
|
-
printTextSuccess(context);
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
// One `file:line:col: severity: message` line per issue, to stderr. The
|
|
634
|
-
// severity is what tells a reader which lines are fatal — the text renderer
|
|
635
|
-
// prints no verdict word of its own, so it cannot contradict the `status` the
|
|
636
|
-
// structured renderer reports.
|
|
637
|
-
for (const issue of reported) {
|
|
638
|
-
writeTestFormatError(issue.file, issue.line, issue.column, issue.severity, issue.message);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
377
|
//# sourceMappingURL=validate.js.map
|