@vibe-agent-toolkit/cli 0.2.0-rc.11 → 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 +95 -43
- package/dist/bin/vat.d.ts +15 -4
- package/dist/bin/vat.d.ts.map +1 -1
- package/dist/bin/vat.js +95 -43
- 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 +21 -65
- package/dist/commands/ard/emit.d.ts.map +1 -1
- package/dist/commands/ard/emit.js +68 -74
- 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 +14 -11
- 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 +405 -411
- 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 +55 -2
- package/dist/commands/claude/context.d.ts.map +1 -1
- package/dist/commands/claude/context.js +74 -50
- 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 +6 -5
- 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 -149
- package/dist/commands/okf/validate.d.ts.map +1 -1
- package/dist/commands/okf/validate.js +64 -62
- 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 +64 -11
- package/dist/commands/resources/check-progress.d.ts.map +1 -1
- package/dist/commands/resources/check-progress.js +77 -4
- 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 +315 -71
- package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
- package/dist/commands/resources/check-supervisor.js +493 -107
- package/dist/commands/resources/check-supervisor.js.map +1 -1
- package/dist/commands/resources/check.d.ts +56 -249
- package/dist/commands/resources/check.d.ts.map +1 -1
- package/dist/commands/resources/check.js +416 -276
- 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 +165 -91
- 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 +17 -12
- package/dist/commands/resources/query.d.ts.map +1 -1
- package/dist/commands/resources/query.js +60 -48
- 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 -78
- 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 -32
- 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 +6 -4
- 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 +17 -10
- 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 +76 -32
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +132 -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 +16 -19
- 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 +224 -106
- 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 +242 -108
- 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 -194
- package/dist/utils/command-error.d.ts.map +0 -1
- package/dist/utils/command-error.js +0 -237
- package/dist/utils/command-error.js.map +0 -1
|
@@ -1,10 +1,81 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared
|
|
2
|
+
* Shared machinery for the phase orchestrators: `vat build`, `vat verify` and
|
|
3
|
+
* `vat validate`.
|
|
4
|
+
*
|
|
5
|
+
* 🔑 **Each phase hands back its report; the orchestrator publishes ONE.** A
|
|
6
|
+
* phase function returns `{ report }` — the `Report<T>` its own command would
|
|
7
|
+
* publish, BEFORE the writer's run-integrity pass — and the orchestrator folds
|
|
8
|
+
* every phase into {@link orchestratorReport}: findings flat on the envelope,
|
|
9
|
+
* `examined` the sum, each phase's status, count, summary and `data` under
|
|
10
|
+
* `data.phases`.
|
|
11
|
+
*
|
|
12
|
+
* 🔑 **A configured phase that examined nothing is a refusal of THAT phase**
|
|
13
|
+
* ({@link phaseVerdict}), by the declaration its verb's writer is given when the
|
|
14
|
+
* verb runs alone — so an orchestrated phase and its verb cannot disagree. Judged
|
|
15
|
+
* on the sum alone, a `skills.include` matching nothing beside a healthy
|
|
16
|
+
* `resources:` surface was `status: ok`, exit 0. What is NOT refused is a phase
|
|
17
|
+
* for which zero is an answer, and each one says why ({@link ZeroIsAnAnswer}): a
|
|
18
|
+
* phase that ran with no config block of its own (`vat build`'s `skills` phase in a
|
|
19
|
+
* project with no `skills:` block), a `skills` phase whose pool is empty in a project
|
|
20
|
+
* that ships plugin-local skills ({@link skillsPhaseExamined} — refusing that failed
|
|
21
|
+
* `claude plugin install --build`, which trusts `vat build`'s exit), or one that
|
|
22
|
+
* checks what another phase discovered. The writer still judges the sum, for the
|
|
23
|
+
* run in which no phase ran at all.
|
|
24
|
+
*
|
|
25
|
+
* Each phase's report is held to its OWN schema before the fold ({@link Phase}
|
|
26
|
+
* `schema`, parsed by {@link runPhase}): the orchestrator's schema carries a
|
|
27
|
+
* phase's `data` as `unknown`, so nothing downstream could catch a phase
|
|
28
|
+
* publishing data its verb does not describe.
|
|
29
|
+
*
|
|
30
|
+
* There is no second status vocabulary. A phase's status is its envelope's
|
|
31
|
+
* (`ok | findings | error`), the orchestrator's exit derives from its own
|
|
32
|
+
* published document, and a phase that did not finish makes the run `error` /
|
|
33
|
+
* `RUN_INCOMPLETE` with the finished phases still in `data.phases`.
|
|
3
34
|
*/
|
|
4
|
-
import {
|
|
35
|
+
import { indexPluginLocalSkills } from '@vibe-agent-toolkit/agent-skills';
|
|
36
|
+
import { buildErrorReport, buildReport, FindingSchema, reportSchema, } from '@vibe-agent-toolkit/schema';
|
|
5
37
|
import { Option } from 'commander';
|
|
38
|
+
import { z } from 'zod';
|
|
39
|
+
import { CommandRefusalError, refusalCodeOf } from '../utils/command-refusal.js';
|
|
40
|
+
import { NOTHING_FINISHED, refusalReport } from '../utils/document-writer.js';
|
|
6
41
|
import { createLogger } from '../utils/logger.js';
|
|
7
|
-
import {
|
|
42
|
+
import { warnRunIntegrity, withRunIntegrity } from '../utils/run-integrity.js';
|
|
43
|
+
/**
|
|
44
|
+
* The report schema of a phase that publishes no `data` of its own — verify's
|
|
45
|
+
* `files-config-dests` and `consistency`, build's `shipped-links`: no verb of
|
|
46
|
+
* their own registers one, and their `data` is `null`.
|
|
47
|
+
*/
|
|
48
|
+
export const DATALESS_PHASE_REPORT_SCHEMA = reportSchema(z.null(), FindingSchema);
|
|
49
|
+
/**
|
|
50
|
+
* Whether the project ships at least one plugin-local skill — by the ONE answer to that question
|
|
51
|
+
* (`indexPluginLocalSkills`: what the claude phase packages), never a path prefix.
|
|
52
|
+
*
|
|
53
|
+
* @param config - The project's config, or `undefined` when none loaded
|
|
54
|
+
* @param configDir - The directory the config was loaded from
|
|
55
|
+
*/
|
|
56
|
+
export function shipsPluginLocalSkills(config, configDir) {
|
|
57
|
+
return config !== undefined && indexPluginLocalSkills(config, configDir).locations.length > 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The declaration of a `skills` phase (`vat build`, `vat validate`, `vat verify`): zero pool
|
|
61
|
+
* skills is the verb's own refusal — unless the project ships a plugin-local skill.
|
|
62
|
+
*
|
|
63
|
+
* `skills.include` is required by the schema, and a plugin-local skill reads its packaging
|
|
64
|
+
* config from `skills.config` / `skills.defaults`, so a project whose skills are all plugin-local
|
|
65
|
+
* MUST carry a `skills:` block whose include legitimately matches nothing in the pool. Refusing
|
|
66
|
+
* that stopped `vat build` before the `claude` phase that builds those very skills. With no pool
|
|
67
|
+
* match AND no plugin-local skill, the run examined no skill at all, and it is the refusal.
|
|
68
|
+
*
|
|
69
|
+
* @param declared - What the phase's verb declares its `examined` counts
|
|
70
|
+
* @param pluginLocal - Asked only when the phase examined nothing: it lists the project's plugins
|
|
71
|
+
*/
|
|
72
|
+
export function skillsPhaseExamined(declared, pluginLocal) {
|
|
73
|
+
return (report) => (report.examined === 0 && pluginLocal()
|
|
74
|
+
? { zeroIsAnAnswer: 'skills.include matches no pool skill, and the project ships plugin-local skills — which read skills.config and skills.defaults, so the block is theirs' }
|
|
75
|
+
: declared);
|
|
76
|
+
}
|
|
77
|
+
/** No orchestrator offers `--strict`: warnings never fail a run. */
|
|
78
|
+
export const ORCHESTRATOR_GATE = Object.freeze({ strict: false });
|
|
8
79
|
/**
|
|
9
80
|
* Declare `--only` on a command that has RETIRED it, solely so the command can
|
|
10
81
|
* explain itself instead of emitting Commander's bare `error: unknown option
|
|
@@ -12,7 +83,7 @@ import { writeJsonOutput, writeYamlOutput } from '../utils/output.js';
|
|
|
12
83
|
*
|
|
13
84
|
* This is **not** a backward-compatibility shim — the pre-1.0 policy forbids
|
|
14
85
|
* those and this obeys it. The flag does not work: {@link rejectRetiredOnly}
|
|
15
|
-
*
|
|
86
|
+
* refuses the run before any phase is selected, so no caller can keep depending
|
|
16
87
|
* on the old behaviour. What it buys is a diagnosis. An unknown-option error
|
|
17
88
|
* names the flag and nothing else; the reader cannot tell a typo from a removal
|
|
18
89
|
* and has no way to learn what replaced it, so the next move is a bug report or
|
|
@@ -26,60 +97,46 @@ export function addRetiredOnlyOption(command) {
|
|
|
26
97
|
return command.addOption(new Option('--only <phase>', 'Retired — a run is now a whole run.').hideHelp());
|
|
27
98
|
}
|
|
28
99
|
/**
|
|
29
|
-
*
|
|
100
|
+
* Refuse the run when a caller passed the retired `--only`, naming what changed.
|
|
30
101
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* failing on a bad `--only` keeps failing rather than flipping to green.
|
|
102
|
+
* `USAGE_INVALID` (exit 2): the invocation is the mistake, and nothing was
|
|
103
|
+
* examined.
|
|
34
104
|
*
|
|
35
105
|
* @param only - The parsed `--only` value; `undefined` when it was not passed.
|
|
36
106
|
* @param command - Command name for the message, e.g. `vat validate`.
|
|
37
107
|
* @param seconds - The measured full-run duration that made the flag not worth
|
|
38
108
|
* its coverage risk. Cited so the removal reads as a decision with evidence
|
|
39
109
|
* rather than a preference.
|
|
110
|
+
* @throws CommandRefusalError `USAGE_INVALID` when `--only` was passed
|
|
40
111
|
*/
|
|
41
112
|
export function rejectRetiredOnly(only, command, seconds) {
|
|
42
113
|
if (only === undefined)
|
|
43
114
|
return;
|
|
44
|
-
|
|
115
|
+
throw new CommandRefusalError('USAGE_INVALID', `error: '--only' was removed from '${command}'.\n` +
|
|
45
116
|
`\n` +
|
|
46
|
-
` A full run
|
|
117
|
+
` A full run measured ~${seconds}s on a 90-skill project, so the flag saved\n` +
|
|
47
118
|
` little while letting a CI gate silently lose coverage: renaming a config\n` +
|
|
48
119
|
` key left '--only <that key>' selecting nothing, and the gate stayed green.\n` +
|
|
49
120
|
`\n` +
|
|
50
121
|
` Fix: drop the flag — '${command}' runs every configured surface.\n` +
|
|
51
|
-
` Still selective: 'vat build --only <phase>', where a phase is minutes, not seconds
|
|
52
|
-
process.exit(ExitCode.ERROR);
|
|
122
|
+
` Still selective: 'vat build --only <phase>', where a phase is minutes, not seconds.`);
|
|
53
123
|
}
|
|
54
|
-
/** The phase outcome for "we did not learn what this phase would have said". */
|
|
55
|
-
export const SYSTEM_ERROR = 'system-error';
|
|
56
124
|
/**
|
|
57
|
-
* Create the shared phase command context
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* ⚠️ This runs BEFORE the command's try block, so anything that throws here
|
|
62
|
-
* reaches the user as a raw Node stack trace with zero bytes of stdout and an
|
|
63
|
-
* exit 1 indistinguishable from "validation errors". Phase routing therefore
|
|
64
|
-
* belongs to {@link decidePhaseSelection} and {@link applyPhaseSelection}, which
|
|
65
|
-
* emit the command's normal structured document.
|
|
125
|
+
* Create the shared phase command context. Total by design: it builds the
|
|
126
|
+
* context and decides nothing, because it runs outside the orchestrator's
|
|
127
|
+
* refusal handling.
|
|
66
128
|
*/
|
|
67
129
|
export function createPhaseContext(debugFlag) {
|
|
68
|
-
return {
|
|
69
|
-
logger: createLogger(debugFlag ? { debug: true } : {}),
|
|
70
|
-
startTime: Date.now(),
|
|
71
|
-
};
|
|
130
|
+
return { logger: createLogger(debugFlag ? { debug: true } : {}) };
|
|
72
131
|
}
|
|
73
132
|
/**
|
|
74
133
|
* Decide what an orchestrator should do with its `--only` value and the phase
|
|
75
134
|
* list its config produced.
|
|
76
135
|
*
|
|
77
136
|
* THE single decision site for all three orchestrators, so they cannot answer
|
|
78
|
-
* the same question differently.
|
|
79
|
-
*
|
|
80
|
-
* `
|
|
81
|
-
* `vat verify` has retired `--only` and always passes `only: undefined`;
|
|
82
|
-
* `vat validate` and `vat build` route their own `--only` through here.
|
|
137
|
+
* the same question differently. `vat verify` and `vat validate` have retired
|
|
138
|
+
* `--only` and always pass `only: undefined`; `vat build` routes its own
|
|
139
|
+
* `--only` through here.
|
|
83
140
|
*
|
|
84
141
|
* ⚠️ **Nothing may short-circuit ahead of the config-error arm.** A check
|
|
85
142
|
* evaluated before `unreadableConfig` answers a confident "not configured" for a
|
|
@@ -87,19 +144,17 @@ export function createPhaseContext(debugFlag) {
|
|
|
87
144
|
* must never give, because it is indistinguishable from a correct one.
|
|
88
145
|
*
|
|
89
146
|
* @param unreadableConfig - The config-load error, when the config exists but
|
|
90
|
-
* could not be parsed.
|
|
91
|
-
* we do not know what it declares, so we must not answer with a confident
|
|
92
|
-
* "not configured". Only `vat verify` passes it, and only defensively — its
|
|
147
|
+
* could not be parsed. Only `vat verify` passes it, and only defensively — its
|
|
93
148
|
* phase builder pushes every configured phase when the config is unreadable
|
|
94
149
|
* (so the phase itself reports the real error), which makes the list non-empty
|
|
95
|
-
* and this arm unreachable by construction today.
|
|
96
|
-
* that would otherwise catch an empty list is the "not configured" lie.
|
|
150
|
+
* and this arm unreachable by construction today.
|
|
97
151
|
*/
|
|
98
152
|
export function decidePhaseSelection(only, phases, vocab, options = {}) {
|
|
99
153
|
const lower = vocab.noun.toLowerCase();
|
|
100
154
|
if (only !== undefined && !vocab.validNames.includes(only)) {
|
|
101
155
|
return {
|
|
102
156
|
kind: 'fail',
|
|
157
|
+
code: 'USAGE_INVALID',
|
|
103
158
|
message: `Unknown ${lower}: ${only}. Valid ${lower}s: ${vocab.validNames.join(', ')}`,
|
|
104
159
|
};
|
|
105
160
|
}
|
|
@@ -107,269 +162,166 @@ export function decidePhaseSelection(only, phases, vocab, options = {}) {
|
|
|
107
162
|
return { kind: 'run', phases };
|
|
108
163
|
}
|
|
109
164
|
if (options.unreadableConfig !== undefined) {
|
|
110
|
-
return { kind: 'fail', message: options.unreadableConfig };
|
|
165
|
+
return { kind: 'fail', code: 'CONFIG_INVALID', message: options.unreadableConfig };
|
|
111
166
|
}
|
|
112
167
|
if (only !== undefined) {
|
|
113
168
|
return {
|
|
114
169
|
kind: 'fail',
|
|
170
|
+
code: 'USAGE_INVALID',
|
|
115
171
|
message: `${vocab.noun} '${only}' is not configured in vibe-agent-toolkit.config.yaml — nothing to ${vocab.verb}.`,
|
|
116
172
|
};
|
|
117
173
|
}
|
|
118
174
|
return vocab.noop === undefined
|
|
119
|
-
? { kind: 'fail', message: `No ${lower} to ${vocab.verb}.` }
|
|
175
|
+
? { kind: 'fail', code: 'USAGE_INVALID', message: `No ${lower} to ${vocab.verb}.` }
|
|
120
176
|
: { kind: 'noop', ...vocab.noop };
|
|
121
177
|
}
|
|
122
178
|
/**
|
|
123
|
-
* Act on a {@link PhaseSelection}:
|
|
124
|
-
* command's normal structured document and exit.
|
|
179
|
+
* Act on a {@link PhaseSelection}: the phases to run, or the refusal.
|
|
125
180
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* failure has to publish one rather than throw past it.
|
|
181
|
+
* @throws CommandRefusalError for a `fail` selection, carrying its code —
|
|
182
|
+
* the orchestrator's catch publishes it
|
|
129
183
|
*/
|
|
130
|
-
export function applyPhaseSelection(selection, logger
|
|
131
|
-
if (selection.kind === 'run')
|
|
184
|
+
export function applyPhaseSelection(selection, logger) {
|
|
185
|
+
if (selection.kind === 'run')
|
|
132
186
|
return selection.phases;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
logger.error(selection.message);
|
|
136
|
-
writeYamlOutput({
|
|
137
|
-
status: 'error',
|
|
138
|
-
phases: [],
|
|
139
|
-
error: selection.message,
|
|
140
|
-
duration: `${Date.now() - startTime}ms`,
|
|
141
|
-
});
|
|
142
|
-
// A selection that cannot run — an unknown `--only` name, an unreadable
|
|
143
|
-
// config, nothing configured for what was asked — is the command failing
|
|
144
|
-
// to do its job, not a finding about the tree.
|
|
145
|
-
return process.exit(ExitCode.ERROR);
|
|
146
|
-
}
|
|
187
|
+
if (selection.kind === 'fail')
|
|
188
|
+
throw new CommandRefusalError(selection.code, selection.message);
|
|
147
189
|
logger.warn(selection.warning);
|
|
148
|
-
|
|
149
|
-
status: 'success',
|
|
150
|
-
phases: [],
|
|
151
|
-
note: selection.note,
|
|
152
|
-
duration: `${Date.now() - startTime}ms`,
|
|
153
|
-
});
|
|
154
|
-
return process.exit(ExitCode.OK);
|
|
190
|
+
return [];
|
|
155
191
|
}
|
|
156
|
-
/** Rank used by {@link worseOf}: later wins. */
|
|
157
|
-
const PHASE_STATUS_ORDER = ['success', 'warning', 'error', 'system-error'];
|
|
158
|
-
/** The worse of two phase statuses, per {@link PHASE_STATUS_ORDER}. */
|
|
159
|
-
export function worseOf(a, b) {
|
|
160
|
-
return PHASE_STATUS_ORDER.indexOf(b) > PHASE_STATUS_ORDER.indexOf(a) ? b : a;
|
|
161
|
-
}
|
|
162
|
-
/** Every value a phase may legitimately report as its own `status`. */
|
|
163
|
-
const REPORTABLE_STATUSES = new Set(PHASE_STATUS_ORDER);
|
|
164
192
|
/**
|
|
165
|
-
*
|
|
193
|
+
* Run a single phase in THIS process.
|
|
194
|
+
*
|
|
195
|
+
* In THIS process, because everything an orchestrator reads back from a phase is
|
|
196
|
+
* its report. A process per phase charges, on every phase, a full Node startup
|
|
197
|
+
* and the whole module graph again (~730 ms of remark per isolate), a parse
|
|
198
|
+
* cache whose miss counters restart from zero, and a worker pool built and torn
|
|
199
|
+
* down before the next phase begins.
|
|
200
|
+
*
|
|
201
|
+
* The report is held to the phase's own {@link Phase.schema} before it is
|
|
202
|
+
* folded — the check its verb's writer applies when that verb runs alone. A
|
|
203
|
+
* report the schema rejects is VAT's defect: the `ZodError` carries no code, so
|
|
204
|
+
* it becomes the phase's `INTERNAL_ERROR`, never a finished phase.
|
|
166
205
|
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
206
|
+
* Then it is judged as its verb's writer judges it ({@link phaseVerdict}): a
|
|
207
|
+
* configured phase that examined nothing is refused, and the refusal is said on
|
|
208
|
+
* stderr as well as in the document.
|
|
209
|
+
*
|
|
210
|
+
* The `catch` is a BACKSTOP, not the error path: every phase function returns
|
|
211
|
+
* its own refusal as a report. A throw that escaped that becomes the phase's
|
|
212
|
+
* refusal — classified by its code, `INTERNAL_ERROR` when it carries none —
|
|
213
|
+
* rather than aborting the orchestrator and silently skipping every later phase.
|
|
172
214
|
*/
|
|
173
|
-
function
|
|
174
|
-
|
|
175
|
-
|
|
215
|
+
export async function runPhase(phase) {
|
|
216
|
+
try {
|
|
217
|
+
const { report } = await phase.run();
|
|
218
|
+
phase.schema.parse(report);
|
|
219
|
+
const judged = phaseVerdict(phase, report);
|
|
220
|
+
// The refusal was added here, so no phase has said it: the document and stderr must agree.
|
|
221
|
+
if (judged !== report)
|
|
222
|
+
warnRunIntegrity(judged);
|
|
223
|
+
return { name: phase.name, report: judged };
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
return { name: phase.name, report: refusalReport(refusalCodeOf(error), error, ORCHESTRATOR_GATE, NOTHING_FINISHED) };
|
|
176
227
|
}
|
|
177
|
-
if (status === ExitCode.OK)
|
|
178
|
-
return 'success';
|
|
179
|
-
if (status === ExitCode.FINDINGS)
|
|
180
|
-
return 'error';
|
|
181
|
-
return SYSTEM_ERROR;
|
|
182
|
-
}
|
|
183
|
-
/** The status the phase claimed for itself, when it claimed a recognized one. */
|
|
184
|
-
function statusFromReport(report) {
|
|
185
|
-
if (typeof report !== 'object' || report === null)
|
|
186
|
-
return undefined;
|
|
187
|
-
const claimed = report.status;
|
|
188
|
-
return typeof claimed === 'string' && REPORTABLE_STATUSES.has(claimed)
|
|
189
|
-
? claimed
|
|
190
|
-
: undefined;
|
|
191
228
|
}
|
|
192
229
|
/**
|
|
193
|
-
*
|
|
230
|
+
* A phase's report as its own verb's writer would publish it: with the ONE
|
|
231
|
+
* `RESOURCE_CHECK_BROKEN` refusal added when it examined nothing — unless zero is
|
|
232
|
+
* an answer for this phase. `withRunIntegrity` is the same function every writer
|
|
233
|
+
* calls, so there is one contract for "a run that examined nothing", and an
|
|
234
|
+
* orchestrated phase gets the very finding its verb gives alone.
|
|
194
235
|
*
|
|
195
|
-
*
|
|
196
|
-
* |-----------------------|----------------|-----------------------------------------|
|
|
197
|
-
* | `OK` (0) | `success` | ran, found nothing actionable |
|
|
198
|
-
* | `FINDINGS` (1) | `error` | ran, found validation errors |
|
|
199
|
-
* | `ERROR` (2) | `system-error` | the phase itself reported a system error |
|
|
200
|
-
* | anything else | throws | a defect in the phase, filed by `runPhase` as `system-error` |
|
|
236
|
+
* Pure: no I/O, no stderr.
|
|
201
237
|
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
* `
|
|
205
|
-
* code alone reads as `success` — including on the tree VAT's CI dogfoods on
|
|
206
|
-
* VAT itself.
|
|
207
|
-
*
|
|
208
|
-
* The table has no row for a signal kill, a missing status code, or a document
|
|
209
|
-
* that fails to parse, and that is the design rather than an omission. A phase
|
|
210
|
-
* runs in this process: there is no serialization step in which to lose a
|
|
211
|
-
* document, and no signal that could take a phase without taking the
|
|
212
|
-
* orchestrator with it.
|
|
238
|
+
* @param phase - The phase's `examined` declaration
|
|
239
|
+
* @param report - What the phase returned
|
|
240
|
+
* @returns `report` itself when nothing is added, so a caller can tell by identity
|
|
213
241
|
*/
|
|
214
|
-
export function
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
242
|
+
export function phaseVerdict(phase, report) {
|
|
243
|
+
const declared = typeof phase.examined === 'function' ? phase.examined(report) : phase.examined;
|
|
244
|
+
return 'zeroIsAnAnswer' in declared ? report : withRunIntegrity(report, declared);
|
|
245
|
+
}
|
|
246
|
+
/** One phase as `data.phases` publishes it. */
|
|
247
|
+
function phaseEntry({ name, report }) {
|
|
219
248
|
return {
|
|
220
249
|
name,
|
|
221
|
-
status,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
250
|
+
status: report.status,
|
|
251
|
+
examined: report.examined,
|
|
252
|
+
summary: report.summary,
|
|
253
|
+
...(report.status === 'error' ? { error: report.error } : {}),
|
|
254
|
+
data: report.data,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/** What the phases amount to so far: the sum examined, every finding, every entry. */
|
|
258
|
+
function finishedPhases(results) {
|
|
259
|
+
return {
|
|
260
|
+
examined: results.reduce((sum, { report }) => sum + report.examined, 0),
|
|
261
|
+
findings: results.flatMap(({ report }) => report.findings),
|
|
262
|
+
data: { phases: results.map(phaseEntry) },
|
|
227
263
|
};
|
|
228
264
|
}
|
|
229
265
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* THE single place the two lanes diverge, so they cannot diverge anywhere else.
|
|
233
|
-
* A phase hands back the same `{ document, exitCode }` either way; this decides
|
|
234
|
-
* what a *command* does with it, while an orchestrator folds it into
|
|
235
|
-
* `phases[].report` instead.
|
|
236
|
-
*
|
|
237
|
-
* Three cases, and the middle one is the one to get right:
|
|
238
|
-
* - an unexpected failure publishes the shared envelope in the format the
|
|
239
|
-
* operator asked for, matching `handleCommandError`;
|
|
240
|
-
* - a command's own report goes through the command's own `render`;
|
|
241
|
-
* - no document at all (an unconfigured run, a dry run) publishes nothing.
|
|
266
|
+
* Fold the phases into the orchestrator's ONE report.
|
|
242
267
|
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
* docstring that says a caller with a `--format` option must pass it, and two
|
|
249
|
-
* commands added in the same change dropped it anyway: a docstring is not a
|
|
250
|
-
* mechanism. Here the type system asks, so a new caller cannot forget. A command
|
|
251
|
-
* that offers no `--format` passes `undefined` and says so at its call site.
|
|
268
|
+
* `findings` is every phase's findings with its `location` unchanged; `examined`
|
|
269
|
+
* is the sum of the phases' own; `data.phases` is one entry per phase. Any phase
|
|
270
|
+
* that did not finish makes the run `error` with `RUN_INCOMPLETE`, naming the
|
|
271
|
+
* phases that stopped, and the finished ones stay in `data.phases` — a failed
|
|
272
|
+
* phase never erases what the others found.
|
|
252
273
|
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
274
|
+
* Pure: each phase was judged as it ran ({@link runPhase}), and the writer judges
|
|
275
|
+
* the sum when it publishes — which refuses the run in which no phase ran.
|
|
255
276
|
*
|
|
256
|
-
* @param
|
|
257
|
-
* @param
|
|
258
|
-
* @param
|
|
259
|
-
*
|
|
260
|
-
*
|
|
277
|
+
* @param results - Every phase that ran, in execution order
|
|
278
|
+
* @param gate - The gate the run is judged by
|
|
279
|
+
* @param durationMs - Wall-clock milliseconds the run took; carried by a completed
|
|
280
|
+
* run only, as no refusal document carries `durationMs`
|
|
281
|
+
* @returns The report, before the writer's run-integrity pass
|
|
261
282
|
*/
|
|
262
|
-
export function
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
283
|
+
export function orchestratorReport(results, gate, durationMs) {
|
|
284
|
+
const finished = finishedPhases(results);
|
|
285
|
+
const failed = results.filter(({ report }) => report.status === 'error');
|
|
286
|
+
if (failed.length === 0)
|
|
287
|
+
return buildReport({ ...finished, gate, durationMs });
|
|
288
|
+
const named = failed.map(({ name, report }) => (report.status === 'error' ? `'${name}' (${report.error.code})` : name)).join(', ');
|
|
289
|
+
return buildErrorReport({
|
|
290
|
+
error: {
|
|
291
|
+
code: 'RUN_INCOMPLETE',
|
|
292
|
+
message: `The run did not finish: phase ${named} stopped before it did. The phases that finished are in data.phases.`,
|
|
293
|
+
},
|
|
294
|
+
gate,
|
|
295
|
+
...finished,
|
|
296
|
+
});
|
|
275
297
|
}
|
|
276
298
|
/**
|
|
277
|
-
* Run
|
|
299
|
+
* Run an orchestrator's body and fold it into its ONE report.
|
|
278
300
|
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
* Phases run sequentially, so none of that cost is ever overlapped with work.
|
|
301
|
+
* `body` pushes each phase that ran onto `results`. A throw from it — the
|
|
302
|
+
* refused `--only`, a positional argument, no project root, discovery that
|
|
303
|
+
* could not see the tree — is classified by its code and becomes the
|
|
304
|
+
* envelope's error branch carrying every phase that already finished. The
|
|
305
|
+
* command publishes the result with `endWithReport`.
|
|
285
306
|
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
* ⚠️ This arm exists for a throw that escaped that handling. Sharing the
|
|
290
|
-
* orchestrator's process is what makes it load-bearing: an escaped throw aborts
|
|
291
|
-
* the orchestrator itself and silently skips every later phase.
|
|
307
|
+
* @param body - The run; it records each phase's result as it finishes
|
|
308
|
+
* @returns The orchestrator's report, before the writer's run-integrity pass
|
|
292
309
|
*/
|
|
293
|
-
export async function
|
|
310
|
+
export async function orchestrate(body) {
|
|
311
|
+
const startTime = Date.now();
|
|
312
|
+
const results = [];
|
|
294
313
|
try {
|
|
295
|
-
|
|
314
|
+
await body(results);
|
|
296
315
|
}
|
|
297
316
|
catch (error) {
|
|
298
|
-
const
|
|
299
|
-
return
|
|
300
|
-
name: phase.name,
|
|
301
|
-
status: SYSTEM_ERROR,
|
|
302
|
-
error: `Phase '${phase.name}' threw past its own error handling: ${detail}`,
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Worst-wins aggregate across phases. `system-error` outranks `error`: "we could
|
|
308
|
-
* not determine the answer" must never be filed under "we determined it is bad".
|
|
309
|
-
*/
|
|
310
|
-
export function aggregatePhaseStatus(results) {
|
|
311
|
-
let worst = 'success';
|
|
312
|
-
for (const { status } of results) {
|
|
313
|
-
worst = worseOf(worst, status);
|
|
317
|
+
const finished = results.length === 0 ? NOTHING_FINISHED : finishedPhases(results);
|
|
318
|
+
return refusalReport(refusalCodeOf(error), error, ORCHESTRATOR_GATE, finished);
|
|
314
319
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
*
|
|
320
|
-
* A phase that holds its own findings publishes {@link PhaseResult.issueCounts}.
|
|
321
|
-
* A phase that publishes its own document deliberately does not — it owns its
|
|
322
|
-
* findings, and its document rides verbatim in {@link PhaseResult.report}.
|
|
323
|
-
*
|
|
324
|
-
* ⚠️ Both places must be read. Reading only `issueCounts` makes an
|
|
325
|
-
* orchestrator's header report `{0, 0, 0}` over phases that just reported 12
|
|
326
|
-
* warnings.
|
|
327
|
-
*
|
|
328
|
-
* Absent or malformed counts read as zero rather than throwing: a phase that
|
|
329
|
-
* publishes no distribution contributes nothing to the total.
|
|
330
|
-
*/
|
|
331
|
-
export function phaseIssueCounts(result) {
|
|
332
|
-
if (result.issueCounts)
|
|
333
|
-
return result.issueCounts;
|
|
334
|
-
const counts = result.report?.issueCounts;
|
|
335
|
-
if (typeof counts !== 'object' || counts === null)
|
|
336
|
-
return { errors: 0, warnings: 0, info: 0 };
|
|
337
|
-
const { errors, warnings, info } = counts;
|
|
338
|
-
return {
|
|
339
|
-
errors: typeof errors === 'number' ? errors : 0,
|
|
340
|
-
warnings: typeof warnings === 'number' ? warnings : 0,
|
|
341
|
-
info: typeof info === 'number' ? info : 0,
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Sum every phase's distribution, so an orchestrator's header total reconciles
|
|
346
|
-
* against the phases printed beneath it.
|
|
347
|
-
*
|
|
348
|
-
* The companion to {@link aggregatePhaseStatus}: status is worst-wins ACROSS
|
|
349
|
-
* phases, so a header whose `status` can see the phases while its `issueCounts`
|
|
350
|
-
* cannot publishes a contradiction in one document — `status: warning` beside
|
|
351
|
-
* `warnings: 0`.
|
|
352
|
-
*/
|
|
353
|
-
export function aggregatePhaseIssueCounts(results) {
|
|
354
|
-
const total = { errors: 0, warnings: 0, info: 0 };
|
|
355
|
-
for (const result of results) {
|
|
356
|
-
const { errors, warnings, info } = phaseIssueCounts(result);
|
|
357
|
-
total.errors += errors;
|
|
358
|
-
total.warnings += warnings;
|
|
359
|
-
total.info += info;
|
|
360
|
-
}
|
|
361
|
-
return total;
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* The process exit code for a set of phase outcomes, per the exit-code contract
|
|
365
|
-
* every orchestrator's help text documents: `OK` pass, `FINDINGS` validation
|
|
366
|
-
* failure, `ERROR` system error. Warnings do not fail a run — they are
|
|
367
|
-
* published in the status and counts instead.
|
|
368
|
-
*/
|
|
369
|
-
export function exitCodeForPhases(results) {
|
|
370
|
-
const worst = aggregatePhaseStatus(results);
|
|
371
|
-
if (worst === SYSTEM_ERROR)
|
|
372
|
-
return ExitCode.ERROR;
|
|
373
|
-
return worst === 'error' ? ExitCode.FINDINGS : ExitCode.OK;
|
|
320
|
+
const report = orchestratorReport(results, ORCHESTRATOR_GATE, Date.now() - startTime);
|
|
321
|
+
if (report.status === 'error')
|
|
322
|
+
process.stderr.write(`${report.error.message}\n`);
|
|
323
|
+
return report;
|
|
374
324
|
}
|
|
325
|
+
/** No orchestrator offers `--format`: the document is YAML. */
|
|
326
|
+
export const ORCHESTRATOR_FORMAT = 'yaml';
|
|
375
327
|
//# sourceMappingURL=phase-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase-utils.js","sourceRoot":"","sources":["../../src/commands/phase-utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"phase-utils.js","sourceRoot":"","sources":["../../src/commands/phase-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,YAAY,GAMb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAgB,MAAM,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,CAAC,EAAmB,MAAM,KAAK,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAqB,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAA4B,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA2BzG;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsB,YAAY,CAAC,CAAC,CAAC,IAA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