@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
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which REFUSAL a thrown value is — the one place a command's catch learns
|
|
3
|
+
* whether the run failed on the invocation, the project, the environment, or
|
|
4
|
+
* a defect in VAT.
|
|
5
|
+
*
|
|
6
|
+
* 🔑 **Dispatch on a code, never on a message.** A user's mistake is thrown as
|
|
7
|
+
* a {@link CommandRefusalError} carrying its refusal code, or as a library
|
|
8
|
+
* `VatError` whose `code` is mapped below; an unreadable input is coded
|
|
9
|
+
* `INPUT_UNREADABLE` at the site that reads it. Everything else — an uncoded
|
|
10
|
+
* errno included — a `TypeError`, a resolver bug, an invariant a
|
|
11
|
+
* driver broke — is `INTERNAL_ERROR`, published with its stack. A blanket
|
|
12
|
+
* `catch` that relabels "anything thrown here" as the user's fault is exactly
|
|
13
|
+
* what this module exists to make unnecessary: it would publish VAT's own
|
|
14
|
+
* defects as usage mistakes.
|
|
15
|
+
*
|
|
16
|
+
* Kept apart from the document writer so a helper that only needs to REFUSE
|
|
17
|
+
* (`project-root-policy.ts`, `check-supervisor.ts`) does not load the
|
|
18
|
+
* published-shape registry to do it.
|
|
19
|
+
*/
|
|
20
|
+
import { type RefusalCode } from '@vibe-agent-toolkit/schema';
|
|
21
|
+
import { VatError } from '@vibe-agent-toolkit/utils';
|
|
22
|
+
/** A refusal a command raises on purpose, carrying WHICH refusal. */
|
|
23
|
+
export declare class CommandRefusalError extends VatError {
|
|
24
|
+
readonly refusal: RefusalCode;
|
|
25
|
+
constructor(refusal: RefusalCode, message: string, options?: ErrorOptions);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Which refusal a thrown value is.
|
|
29
|
+
*
|
|
30
|
+
* Read by brand and `code`, not by `instanceof`, for the reason `isVatError`
|
|
31
|
+
* gives: a `dist` copy of the class never matches a `src` instance.
|
|
32
|
+
*
|
|
33
|
+
* @param error - What the command's catch received
|
|
34
|
+
* @returns A {@link CommandRefusalError}'s own code; for a classified filesystem fault
|
|
35
|
+
* (`FsFaultError`, or a wrapper coded `FS_FAULT` that carries one), the schema table's row for its side, class and origin; a mapped
|
|
36
|
+
* library code; otherwise `INTERNAL_ERROR`. ⛔ No errno walk: an uncoded errno is not
|
|
37
|
+
* known to be about the user's INPUT — an output write, a temp directory, VAT's own
|
|
38
|
+
* shipped asset — so it is a defect report, with its stack, until the site that made
|
|
39
|
+
* the call classifies it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function refusalCodeOf(error: unknown): RefusalCode;
|
|
42
|
+
/**
|
|
43
|
+
* A refusal's published message: `message`, followed by the table row's remedy when
|
|
44
|
+
* `error` is a classified filesystem fault — whose own message says only what the OS
|
|
45
|
+
* refused, since the remedy is the table's to state. Never appended twice.
|
|
46
|
+
*
|
|
47
|
+
* @param message - The message the refusal already carries
|
|
48
|
+
* @param error - The thrown value it came from
|
|
49
|
+
*/
|
|
50
|
+
export declare function withFsFaultRemedy(message: string, error: unknown): string;
|
|
51
|
+
/**
|
|
52
|
+
* The human sentence a thrown value carries: an `Error`'s message, or the
|
|
53
|
+
* value itself spelled out.
|
|
54
|
+
*
|
|
55
|
+
* @param error - Anything a catch received
|
|
56
|
+
*/
|
|
57
|
+
export declare function errorMessageOf(error: unknown): string;
|
|
58
|
+
//# sourceMappingURL=command-refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-refusal.d.ts","sourceRoot":"","sources":["../../src/utils/command-refusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAqBH,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAiBL,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAQnC,qEAAqE;AACrE,qBAAa,mBAAoB,SAAQ,QAAQ;IAC/C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;gBAElB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAI1E;AAwED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAQzD;AAeD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAKzE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAErD"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which REFUSAL a thrown value is — the one place a command's catch learns
|
|
3
|
+
* whether the run failed on the invocation, the project, the environment, or
|
|
4
|
+
* a defect in VAT.
|
|
5
|
+
*
|
|
6
|
+
* 🔑 **Dispatch on a code, never on a message.** A user's mistake is thrown as
|
|
7
|
+
* a {@link CommandRefusalError} carrying its refusal code, or as a library
|
|
8
|
+
* `VatError` whose `code` is mapped below; an unreadable input is coded
|
|
9
|
+
* `INPUT_UNREADABLE` at the site that reads it. Everything else — an uncoded
|
|
10
|
+
* errno included — a `TypeError`, a resolver bug, an invariant a
|
|
11
|
+
* driver broke — is `INTERNAL_ERROR`, published with its stack. A blanket
|
|
12
|
+
* `catch` that relabels "anything thrown here" as the user's fault is exactly
|
|
13
|
+
* what this module exists to make unnecessary: it would publish VAT's own
|
|
14
|
+
* defects as usage mistakes.
|
|
15
|
+
*
|
|
16
|
+
* Kept apart from the document writer so a helper that only needs to REFUSE
|
|
17
|
+
* (`project-root-policy.ts`, `check-supervisor.ts`) does not load the
|
|
18
|
+
* published-shape registry to do it.
|
|
19
|
+
*/
|
|
20
|
+
import { AGENT_MANIFEST_INVALID_CODE, AGENT_MANIFEST_NOT_FOUND_CODE, AGENT_MANIFEST_UNREADABLE_CODE } from '@vibe-agent-toolkit/agent-config';
|
|
21
|
+
import { AGENT_PACKAGE_ROOT_MISSING_CODE, GIT_SUBPATH_INVALID_CODE, SKILL_TEST_REFUSAL_BY_ERROR_CODE, } from '@vibe-agent-toolkit/agent-skills';
|
|
22
|
+
import { API_REQUEST_CODE, API_TRANSPORT_CODE, CLAUDE_USER_STATE_UNREADABLE_CODE, ORG_API_KEY_MISSING_CODE, PLUGIN_KEY_INVALID_CODE, } from '@vibe-agent-toolkit/claude-marketplace';
|
|
23
|
+
import { CONFIG_LOAD_CODE, LINK_AUTH_CONFIG_CODE, OKF_UNKNOWN_BUNDLE_CODE, PROJECTION_STATEMENT_REFUSED_CODE, } from '@vibe-agent-toolkit/resources';
|
|
24
|
+
import { fsFaultRefusal } from '@vibe-agent-toolkit/schema';
|
|
25
|
+
import { ARCHIVE_ENTRY_UNREADABLE_CODE, ARCHIVE_REFUSED_CODE, ASSET_REFERENCE_UNREADABLE_CODE, COPY_LINK_ESCAPES_SOURCE_CODE, DIRECTORY_WALK_REVISITED_CODE, FS_FAULT_CODE, isFsFaultError, isVatError, RAG_DATABASE_UNREADABLE_CODE, RAG_INDEX_EMPTY_CODE, TREE_DEST_HOLDS_SOURCE_CODE, TREE_DEST_NOT_OWNED_CODE, TREE_DEST_OCCUPIED_CODE, TREE_ROLLBACK_INCOMPLETE_CODE, TREE_SOURCE_HOLDS_DEST_CODE, VatError, } from '@vibe-agent-toolkit/utils';
|
|
26
|
+
import { GIT_SNAPSHOT_UNREADABLE_CODE } from '@vibe-agent-toolkit/utils/git';
|
|
27
|
+
import { YAML_EDIT_INPUT_REFUSED_CODE } from '@vibe-agent-toolkit/utils/yaml';
|
|
28
|
+
import { AGENT_NAME_ESCAPES_SCOPE_CODE, PLUGIN_SYMLINK_REFUSED_CODE } from './command-error-codes.js';
|
|
29
|
+
const COMMAND_REFUSAL = 'COMMAND_REFUSAL';
|
|
30
|
+
/** A refusal a command raises on purpose, carrying WHICH refusal. */
|
|
31
|
+
export class CommandRefusalError extends VatError {
|
|
32
|
+
refusal;
|
|
33
|
+
constructor(refusal, message, options) {
|
|
34
|
+
super(COMMAND_REFUSAL, message, options);
|
|
35
|
+
this.refusal = refusal;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** Library errors whose `code` already says which refusal they are. */
|
|
39
|
+
const REFUSAL_BY_ERROR_CODE = {
|
|
40
|
+
// A config file that exists and does not parse or validate (resources' parser and the CLI loader).
|
|
41
|
+
[CONFIG_LOAD_CODE]: 'CONFIG_INVALID',
|
|
42
|
+
// A bundle argument the project does not declare under `okf.bundles`.
|
|
43
|
+
[OKF_UNKNOWN_BUNDLE_CODE]: 'USAGE_INVALID',
|
|
44
|
+
// An archive VAT will not read or extract (`ArchiveRefusedError`): not an archive, past a limit, or holding
|
|
45
|
+
// an entry the one entry policy refuses — a link, a device, a name outside the archive, two entries one name.
|
|
46
|
+
[ARCHIVE_REFUSED_CODE]: 'INPUT_UNREADABLE',
|
|
47
|
+
// One entry of an opened archive that does not inflate or hold what it declares (`ArchiveEntryReadError`).
|
|
48
|
+
[ARCHIVE_ENTRY_UNREADABLE_CODE]: 'INPUT_UNREADABLE',
|
|
49
|
+
// A symlink inside a tree being copied that points outside it (`CopyLinkEscapesSourceError`): the input's link.
|
|
50
|
+
[COPY_LINK_ESCAPES_SOURCE_CODE]: 'INPUT_UNREADABLE',
|
|
51
|
+
// An entry of a tree being copied that the OS would not list, stat or read (or a dangling link): the input's.
|
|
52
|
+
// A bare specifier whose package is installed but unreadable (a malformed package.json): the input, not "missing".
|
|
53
|
+
[ASSET_REFERENCE_UNREADABLE_CODE]: 'INPUT_UNREADABLE',
|
|
54
|
+
// A symlink that leads a following walk back into a directory it already entered: the input's loop.
|
|
55
|
+
[DIRECTORY_WALK_REVISITED_CODE]: 'INPUT_UNREADABLE',
|
|
56
|
+
// A git URL's `#ref:subpath` naming a path the clone does not hold, or one escaping it.
|
|
57
|
+
[GIT_SUBPATH_INVALID_CODE]: 'USAGE_INVALID',
|
|
58
|
+
// A `resources.linkAuth` provider that does not compile (`LinkAuthConfigError`): the config's mistake.
|
|
59
|
+
[LINK_AUTH_CONFIG_CODE]: 'CONFIG_INVALID',
|
|
60
|
+
// An agent path or name that names no manifest — the argument is the mistake.
|
|
61
|
+
[AGENT_MANIFEST_NOT_FOUND_CODE]: 'USAGE_INVALID',
|
|
62
|
+
// An agent manifest the OS refuses, or whose content is not YAML.
|
|
63
|
+
[AGENT_MANIFEST_UNREADABLE_CODE]: 'INPUT_UNREADABLE',
|
|
64
|
+
// An agent manifest `loadAgentManifest` read and the schema rejects: the adopter's config.
|
|
65
|
+
[AGENT_MANIFEST_INVALID_CODE]: 'CONFIG_INVALID',
|
|
66
|
+
// `vat agent install|uninstall` with a name that is not one entry under the scope root.
|
|
67
|
+
[AGENT_NAME_ESCAPES_SCOPE_CODE]: 'USAGE_INVALID',
|
|
68
|
+
// `vat agent build` with no --output and no package.json around the agent to put the default in.
|
|
69
|
+
[AGENT_PACKAGE_ROOT_MISSING_CODE]: 'USAGE_INVALID',
|
|
70
|
+
// A SQL statement the projection store refused — the statement the operator passed is wrong.
|
|
71
|
+
[PROJECTION_STATEMENT_REFUSED_CODE]: 'USAGE_INVALID',
|
|
72
|
+
// A Claude Code registry or settings file whose content VAT cannot use: not JSON, the wrong shape.
|
|
73
|
+
[CLAUDE_USER_STATE_UNREADABLE_CODE]: 'INPUT_UNREADABLE',
|
|
74
|
+
// A plugin key argument that is not `<plugin>@<marketplace>`.
|
|
75
|
+
[PLUGIN_KEY_INVALID_CODE]: 'USAGE_INVALID',
|
|
76
|
+
// A plugin source holding a symlink no bundle can ship (`PluginSymlinkRefusedError`): the input, not VAT.
|
|
77
|
+
[PLUGIN_SYMLINK_REFUSED_CODE]: 'INPUT_UNREADABLE',
|
|
78
|
+
// An adopter's YAML (their config) that the surgical editor cannot take the edit into: not YAML, or the wrong shape at the path.
|
|
79
|
+
[YAML_EDIT_INPUT_REFUSED_CODE]: 'CONFIG_INVALID',
|
|
80
|
+
// A git snapshot refused because a file in the repository is unreadable: the input, named, not VAT.
|
|
81
|
+
[GIT_SNAPSHOT_UNREADABLE_CODE]: 'INPUT_UNREADABLE',
|
|
82
|
+
// An org command run without the key its endpoint authenticates with: nothing was sent.
|
|
83
|
+
[ORG_API_KEY_MISSING_CODE]: 'USAGE_INVALID',
|
|
84
|
+
// The Anthropic API answered with a non-success status (`ApiRequestError`)…
|
|
85
|
+
[API_REQUEST_CODE]: 'EXTERNAL_API_FAILED',
|
|
86
|
+
// …or never answered at all (`ApiTransportError`).
|
|
87
|
+
[API_TRANSPORT_CODE]: 'EXTERNAL_API_FAILED',
|
|
88
|
+
// `vat rag query` over an index with no chunk table (rag-lancedb's query): nothing to search.
|
|
89
|
+
// The constant lives in utils so this map need not load the optional backend that throws it.
|
|
90
|
+
[RAG_INDEX_EMPTY_CODE]: 'INPUT_UNREADABLE',
|
|
91
|
+
// A RAG database LanceDB cannot open or read (a table's manifest or data files are damaged).
|
|
92
|
+
[RAG_DATABASE_UNREADABLE_CODE]: 'INPUT_UNREADABLE',
|
|
93
|
+
// The tree-change planner's preflight, before anything is written. Something in the way of a destination
|
|
94
|
+
// the user named — anything at a `must-be-free` one, or what a `vat-made` one's recogniser disowns (an
|
|
95
|
+
// explicit `-o` holding what VAT did not produce) — is the invocation's to fix: `--force`, or another path.
|
|
96
|
+
// Never inferred from an errno: an `EEXIST` at the moment of a write is the table's RUN_INCOMPLETE.
|
|
97
|
+
[TREE_DEST_OCCUPIED_CODE]: 'USAGE_INVALID',
|
|
98
|
+
[TREE_DEST_NOT_OWNED_CODE]: 'USAGE_INVALID',
|
|
99
|
+
// A copy whose source and destination hold one another: the paths the user passed are the mistake.
|
|
100
|
+
[TREE_SOURCE_HOLDS_DEST_CODE]: 'USAGE_INVALID',
|
|
101
|
+
[TREE_DEST_HOLDS_SOURCE_CODE]: 'USAGE_INVALID',
|
|
102
|
+
// A change failed and could not be fully undone: the user's previous tree is under a parked name, named.
|
|
103
|
+
[TREE_ROLLBACK_INCOMPLETE_CODE]: 'RUN_INCOMPLETE',
|
|
104
|
+
// `vat skill test run`: why the harness could not run, decided beside its error classes.
|
|
105
|
+
...SKILL_TEST_REFUSAL_BY_ERROR_CODE,
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Which refusal a thrown value is.
|
|
109
|
+
*
|
|
110
|
+
* Read by brand and `code`, not by `instanceof`, for the reason `isVatError`
|
|
111
|
+
* gives: a `dist` copy of the class never matches a `src` instance.
|
|
112
|
+
*
|
|
113
|
+
* @param error - What the command's catch received
|
|
114
|
+
* @returns A {@link CommandRefusalError}'s own code; for a classified filesystem fault
|
|
115
|
+
* (`FsFaultError`, or a wrapper coded `FS_FAULT` that carries one), the schema table's row for its side, class and origin; a mapped
|
|
116
|
+
* library code; otherwise `INTERNAL_ERROR`. ⛔ No errno walk: an uncoded errno is not
|
|
117
|
+
* known to be about the user's INPUT — an output write, a temp directory, VAT's own
|
|
118
|
+
* shipped asset — so it is a defect report, with its stack, until the site that made
|
|
119
|
+
* the call classifies it.
|
|
120
|
+
*/
|
|
121
|
+
export function refusalCodeOf(error) {
|
|
122
|
+
if (isVatError(error, COMMAND_REFUSAL))
|
|
123
|
+
return error.refusal;
|
|
124
|
+
const fault = classifiedFaultOf(error);
|
|
125
|
+
if (fault !== undefined)
|
|
126
|
+
return fsFaultRefusal(fault.side, fault.faultClass, fault.origin).refusal;
|
|
127
|
+
if (isVatError(error) && Object.hasOwn(REFUSAL_BY_ERROR_CODE, error.code)) {
|
|
128
|
+
return REFUSAL_BY_ERROR_CODE[error.code] ?? 'INTERNAL_ERROR';
|
|
129
|
+
}
|
|
130
|
+
return 'INTERNAL_ERROR';
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The classified fault `error` stands for: itself, or — for a wrapper that kept the
|
|
134
|
+
* fault's own `FS_FAULT` code (`ConfigLoadError`, which a caller may tolerate by
|
|
135
|
+
* type) — the fault it carries as its `cause`. A wrapper never re-codes a fault, so
|
|
136
|
+
* its refusal is the fault's.
|
|
137
|
+
*/
|
|
138
|
+
function classifiedFaultOf(error) {
|
|
139
|
+
if (isFsFaultError(error))
|
|
140
|
+
return error;
|
|
141
|
+
if (!isVatError(error, FS_FAULT_CODE))
|
|
142
|
+
return undefined;
|
|
143
|
+
const { cause } = error;
|
|
144
|
+
return isFsFaultError(cause) ? cause : undefined;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* A refusal's published message: `message`, followed by the table row's remedy when
|
|
148
|
+
* `error` is a classified filesystem fault — whose own message says only what the OS
|
|
149
|
+
* refused, since the remedy is the table's to state. Never appended twice.
|
|
150
|
+
*
|
|
151
|
+
* @param message - The message the refusal already carries
|
|
152
|
+
* @param error - The thrown value it came from
|
|
153
|
+
*/
|
|
154
|
+
export function withFsFaultRemedy(message, error) {
|
|
155
|
+
const fault = classifiedFaultOf(error);
|
|
156
|
+
if (fault === undefined)
|
|
157
|
+
return message;
|
|
158
|
+
const { remedy } = fsFaultRefusal(fault.side, fault.faultClass, fault.origin);
|
|
159
|
+
return message.includes(remedy) ? message : `${message}. ${remedy}`;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The human sentence a thrown value carries: an `Error`'s message, or the
|
|
163
|
+
* value itself spelled out.
|
|
164
|
+
*
|
|
165
|
+
* @param error - Anything a catch received
|
|
166
|
+
*/
|
|
167
|
+
export function errorMessageOf(error) {
|
|
168
|
+
return error instanceof Error ? error.message : String(error);
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=command-refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-refusal.js","sourceRoot":"","sources":["../../src/utils/command-refusal.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exit code a commander ending takes — the one ending of a `vat` run that
|
|
3
|
+
* happens before any verb's writer exists.
|
|
4
|
+
*/
|
|
5
|
+
import { type ExitCodeValue } from '@vibe-agent-toolkit/schema';
|
|
6
|
+
/**
|
|
7
|
+
* Map a commander termination to the exit code VAT's contract promises.
|
|
8
|
+
*
|
|
9
|
+
* A USAGE mistake — a flag this program does not declare, a verb it does not
|
|
10
|
+
* know, a missing or invalid argument — ends on `ExitCode.ERROR`, and the
|
|
11
|
+
* reason is not style. Commander's default for a usage mistake is
|
|
12
|
+
* `process.exit(1)`, so `vat resources check --json` (the option is
|
|
13
|
+
* `--format json`) exited **1** — which, read against the contract the command
|
|
14
|
+
* itself prints, asserts that at least one check was violated. Nothing had
|
|
15
|
+
* run. A CI wrapper spelled `if [ $? -ne 0 ]; then report_findings` therefore
|
|
16
|
+
* reported findings that were never computed. The same hole swallowed a
|
|
17
|
+
* mistyped verb (`vat resources chekc`) and every unknown option on every
|
|
18
|
+
* command.
|
|
19
|
+
*
|
|
20
|
+
* Commander reports BOTH successful and failing terminations through the same
|
|
21
|
+
* `CommanderError`: `--help` and `--version` carry `exitCode` 0, while an
|
|
22
|
+
* unknown option, an unknown command and `help({ error: true })` carry non-zero.
|
|
23
|
+
* Anything non-zero is a usage mistake by construction — commander raises these
|
|
24
|
+
* only while parsing, before any action runs — so it maps to `ERROR`.
|
|
25
|
+
*
|
|
26
|
+
* ⚠️ **Help and `--version` are NOT usage mistakes.** They terminate through
|
|
27
|
+
* the same `_exit` path with code 0 and must stay `OK`; only a non-zero
|
|
28
|
+
* commander ending is remapped.
|
|
29
|
+
*
|
|
30
|
+
* 🪤 Do NOT switch on `error.code` (`commander.unknownOption`, `commander.help`,
|
|
31
|
+
* …). The unknown-COMMAND path arrives as `commander.help` with exitCode 1,
|
|
32
|
+
* because the `command:*` handler renders help with `{ error: true }` — so the
|
|
33
|
+
* code string says "help" for a case that is emphatically not one. The exit
|
|
34
|
+
* code commander already computed is the honest discriminator; the string is not.
|
|
35
|
+
*
|
|
36
|
+
* @param commanderExitCode - The `exitCode` commander put on its CommanderError
|
|
37
|
+
* @returns `OK` for a successful ending, `ERROR` otherwise
|
|
38
|
+
*/
|
|
39
|
+
export declare function exitCodeForCommanderEnding(commanderExitCode: number): ExitCodeValue;
|
|
40
|
+
//# sourceMappingURL=commander-ending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander-ending.d.ts","sourceRoot":"","sources":["../../src/utils/commander-ending.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,0BAA0B,CAAC,iBAAiB,EAAE,MAAM,GAAG,aAAa,CAEnF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exit code a commander ending takes — the one ending of a `vat` run that
|
|
3
|
+
* happens before any verb's writer exists.
|
|
4
|
+
*/
|
|
5
|
+
import { ExitCode } from '@vibe-agent-toolkit/schema';
|
|
6
|
+
/**
|
|
7
|
+
* Map a commander termination to the exit code VAT's contract promises.
|
|
8
|
+
*
|
|
9
|
+
* A USAGE mistake — a flag this program does not declare, a verb it does not
|
|
10
|
+
* know, a missing or invalid argument — ends on `ExitCode.ERROR`, and the
|
|
11
|
+
* reason is not style. Commander's default for a usage mistake is
|
|
12
|
+
* `process.exit(1)`, so `vat resources check --json` (the option is
|
|
13
|
+
* `--format json`) exited **1** — which, read against the contract the command
|
|
14
|
+
* itself prints, asserts that at least one check was violated. Nothing had
|
|
15
|
+
* run. A CI wrapper spelled `if [ $? -ne 0 ]; then report_findings` therefore
|
|
16
|
+
* reported findings that were never computed. The same hole swallowed a
|
|
17
|
+
* mistyped verb (`vat resources chekc`) and every unknown option on every
|
|
18
|
+
* command.
|
|
19
|
+
*
|
|
20
|
+
* Commander reports BOTH successful and failing terminations through the same
|
|
21
|
+
* `CommanderError`: `--help` and `--version` carry `exitCode` 0, while an
|
|
22
|
+
* unknown option, an unknown command and `help({ error: true })` carry non-zero.
|
|
23
|
+
* Anything non-zero is a usage mistake by construction — commander raises these
|
|
24
|
+
* only while parsing, before any action runs — so it maps to `ERROR`.
|
|
25
|
+
*
|
|
26
|
+
* ⚠️ **Help and `--version` are NOT usage mistakes.** They terminate through
|
|
27
|
+
* the same `_exit` path with code 0 and must stay `OK`; only a non-zero
|
|
28
|
+
* commander ending is remapped.
|
|
29
|
+
*
|
|
30
|
+
* 🪤 Do NOT switch on `error.code` (`commander.unknownOption`, `commander.help`,
|
|
31
|
+
* …). The unknown-COMMAND path arrives as `commander.help` with exitCode 1,
|
|
32
|
+
* because the `command:*` handler renders help with `{ error: true }` — so the
|
|
33
|
+
* code string says "help" for a case that is emphatically not one. The exit
|
|
34
|
+
* code commander already computed is the honest discriminator; the string is not.
|
|
35
|
+
*
|
|
36
|
+
* @param commanderExitCode - The `exitCode` commander put on its CommanderError
|
|
37
|
+
* @returns `OK` for a successful ending, `ERROR` otherwise
|
|
38
|
+
*/
|
|
39
|
+
export function exitCodeForCommanderEnding(commanderExitCode) {
|
|
40
|
+
return commanderExitCode === 0 ? ExitCode.OK : ExitCode.ERROR;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=commander-ending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commander-ending.js","sourceRoot":"","sources":["../../src/utils/commander-ending.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAsB,MAAM,4BAA4B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,0BAA0B,CAAC,iBAAyB;IAClE,OAAO,iBAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;AAChE,CAAC"}
|
|
@@ -5,24 +5,29 @@
|
|
|
5
5
|
* - VAT_TEST_CONFIG: Override config file path for testing (absolute path)
|
|
6
6
|
*/
|
|
7
7
|
import { type ProjectConfig } from '@vibe-agent-toolkit/resources';
|
|
8
|
-
import { VatError } from '@vibe-agent-toolkit/utils';
|
|
8
|
+
import { type FsSide, VatError } from '@vibe-agent-toolkit/utils';
|
|
9
9
|
/**
|
|
10
|
-
* A `vibe-agent-toolkit.config.yaml` exists but
|
|
10
|
+
* A `vibe-agent-toolkit.config.yaml` exists but could not be read, parsed or validated.
|
|
11
11
|
*
|
|
12
12
|
* Distinct from "no config found" (which surfaces as `undefined`): a *broken*
|
|
13
13
|
* config is a hard error the user must fix, not something to silently treat as
|
|
14
14
|
* absent. Commands that resolve a skill through a config (`vat skill review`,
|
|
15
15
|
* `vat skill test`) should surface this; a bulk linter (`vat audit`) may catch
|
|
16
|
-
* it and fall back to config-free validation.
|
|
16
|
+
* it and fall back to config-free validation. It carries its cause's code —
|
|
17
|
+
* `CONFIG_LOAD`, or `FS_FAULT` with the classified fault as its `cause` — so the
|
|
18
|
+
* refusal it becomes is decided by what failed, not by where it was caught.
|
|
17
19
|
*/
|
|
18
20
|
export declare class ConfigLoadError extends VatError {
|
|
19
21
|
readonly projectRoot: string;
|
|
20
|
-
constructor(projectRoot: string, cause:
|
|
22
|
+
constructor(projectRoot: string, cause: VatError);
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Load and validate project configuration
|
|
24
26
|
*
|
|
25
27
|
* @param projectRoot - Project root directory
|
|
28
|
+
* @param projectSide - The calling verb's side for a path in the project it does not declare an input:
|
|
29
|
+
* `destination` for a verb that writes into the project (`build`), `source` for one that only reads it.
|
|
30
|
+
* A refusal on the way to the config, or of the listing that confirms it absent, lands there.
|
|
26
31
|
* @returns Validated configuration or undefined if not found
|
|
27
32
|
* @throws Error if config file exists but is invalid
|
|
28
33
|
*
|
|
@@ -33,14 +38,14 @@ export declare class ConfigLoadError extends VatError {
|
|
|
33
38
|
* @example
|
|
34
39
|
* ```typescript
|
|
35
40
|
* // Normal usage
|
|
36
|
-
* const config = loadConfig('/path/to/project');
|
|
41
|
+
* const config = loadConfig('/path/to/project', 'source');
|
|
37
42
|
*
|
|
38
43
|
* // Test usage with override
|
|
39
44
|
* process.env.VAT_TEST_CONFIG = '/path/to/test/fixtures/config.yaml';
|
|
40
|
-
* const config = loadConfig('/any/path'); // Uses override path
|
|
45
|
+
* const config = loadConfig('/any/path', 'source'); // Uses override path
|
|
41
46
|
* ```
|
|
42
47
|
*/
|
|
43
|
-
export declare function loadConfig(projectRoot: string): ProjectConfig | undefined;
|
|
48
|
+
export declare function loadConfig(projectRoot: string, projectSide: FsSide): ProjectConfig | undefined;
|
|
44
49
|
/**
|
|
45
50
|
* Get the directory containing a config file path.
|
|
46
51
|
*/
|
|
@@ -67,5 +72,5 @@ export declare function resetLoadedConfigCache(): void;
|
|
|
67
72
|
* Callers that intentionally tolerate a broken config (e.g. `vat audit`, a bulk
|
|
68
73
|
* linter that should still validate the skill itself) catch `ConfigLoadError`.
|
|
69
74
|
*/
|
|
70
|
-
export declare function loadConfigCached(projectRoot: string): ProjectConfig | undefined;
|
|
75
|
+
export declare function loadConfigCached(projectRoot: string, projectSide: FsSide): ProjectConfig | undefined;
|
|
71
76
|
//# sourceMappingURL=config-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAmB,KAAK,MAAM,EAA6I,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAiB9N;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBACjB,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ;CAIjD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAsD9F;AAuBD;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEvD;AAqBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAM7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAmBpG"}
|
|
@@ -4,40 +4,46 @@
|
|
|
4
4
|
* Environment Variables:
|
|
5
5
|
* - VAT_TEST_CONFIG: Override config file path for testing (absolute path)
|
|
6
6
|
*/
|
|
7
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
8
7
|
import { dirname } from 'node:path';
|
|
9
|
-
import { parseConfigAllowingUnknownKeys, ProjectConfigSchema } from '@vibe-agent-toolkit/resources';
|
|
10
|
-
import { safePath, VatError } from '@vibe-agent-toolkit/utils';
|
|
8
|
+
import { CONFIG_LOAD_CODE, parseConfigAllowingUnknownKeys, ProjectConfigSchema, readConfigTextSync, } from '@vibe-agent-toolkit/resources';
|
|
9
|
+
import { classifyFsFault, isFsFaultError, isUnresolvableLinkError, isVatError, refusedPathOf, requireConfirmedAbsent, requireFollowedStatSync, safePath, sideWithin, VatError } from '@vibe-agent-toolkit/utils';
|
|
11
10
|
import * as yaml from 'yaml';
|
|
11
|
+
import { errorMessageOf } from './command-refusal.js';
|
|
12
|
+
import { noticeToOperator, resetUnscopedNoticeLedger } from './operator-notices.js';
|
|
12
13
|
const CONFIG_FILENAME = 'vibe-agent-toolkit.config.yaml';
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Whether `error` is one of the two config failures {@link ConfigLoadError} stands
|
|
16
|
+
* for: `CONFIG_LOAD` (does not parse or validate), or the OS refusing the read — a
|
|
17
|
+
* classified `source` fault whose origin is the config.
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
+
function isConfigFailure(error) {
|
|
20
|
+
return isVatError(error, CONFIG_LOAD_CODE) || (isFsFaultError(error) && error.origin === 'config');
|
|
21
|
+
}
|
|
19
22
|
/**
|
|
20
|
-
* A `vibe-agent-toolkit.config.yaml` exists but
|
|
23
|
+
* A `vibe-agent-toolkit.config.yaml` exists but could not be read, parsed or validated.
|
|
21
24
|
*
|
|
22
25
|
* Distinct from "no config found" (which surfaces as `undefined`): a *broken*
|
|
23
26
|
* config is a hard error the user must fix, not something to silently treat as
|
|
24
27
|
* absent. Commands that resolve a skill through a config (`vat skill review`,
|
|
25
28
|
* `vat skill test`) should surface this; a bulk linter (`vat audit`) may catch
|
|
26
|
-
* it and fall back to config-free validation.
|
|
29
|
+
* it and fall back to config-free validation. It carries its cause's code —
|
|
30
|
+
* `CONFIG_LOAD`, or `FS_FAULT` with the classified fault as its `cause` — so the
|
|
31
|
+
* refusal it becomes is decided by what failed, not by where it was caught.
|
|
27
32
|
*/
|
|
28
33
|
export class ConfigLoadError extends VatError {
|
|
29
34
|
projectRoot;
|
|
30
35
|
constructor(projectRoot, cause) {
|
|
31
|
-
super(
|
|
36
|
+
super(cause.code, cause.message, { cause });
|
|
32
37
|
this.projectRoot = projectRoot;
|
|
33
|
-
if (cause instanceof Error)
|
|
34
|
-
this.cause = cause;
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
41
|
* Load and validate project configuration
|
|
39
42
|
*
|
|
40
43
|
* @param projectRoot - Project root directory
|
|
44
|
+
* @param projectSide - The calling verb's side for a path in the project it does not declare an input:
|
|
45
|
+
* `destination` for a verb that writes into the project (`build`), `source` for one that only reads it.
|
|
46
|
+
* A refusal on the way to the config, or of the listing that confirms it absent, lands there.
|
|
41
47
|
* @returns Validated configuration or undefined if not found
|
|
42
48
|
* @throws Error if config file exists but is invalid
|
|
43
49
|
*
|
|
@@ -48,21 +54,25 @@ export class ConfigLoadError extends VatError {
|
|
|
48
54
|
* @example
|
|
49
55
|
* ```typescript
|
|
50
56
|
* // Normal usage
|
|
51
|
-
* const config = loadConfig('/path/to/project');
|
|
57
|
+
* const config = loadConfig('/path/to/project', 'source');
|
|
52
58
|
*
|
|
53
59
|
* // Test usage with override
|
|
54
60
|
* process.env.VAT_TEST_CONFIG = '/path/to/test/fixtures/config.yaml';
|
|
55
|
-
* const config = loadConfig('/any/path'); // Uses override path
|
|
61
|
+
* const config = loadConfig('/any/path', 'source'); // Uses override path
|
|
56
62
|
* ```
|
|
57
63
|
*/
|
|
58
|
-
export function loadConfig(projectRoot) {
|
|
64
|
+
export function loadConfig(projectRoot, projectSide) {
|
|
59
65
|
// Override for testing: VAT_TEST_CONFIG provides explicit config path
|
|
60
|
-
const
|
|
61
|
-
|
|
66
|
+
const override = process.env['VAT_TEST_CONFIG'];
|
|
67
|
+
const configPath = override ?? safePath.join(projectRoot, CONFIG_FILENAME);
|
|
68
|
+
// The override is the operator's own path (its own `within`); the config sits beneath the project root.
|
|
69
|
+
// A probe the OS refuses is a fault, never "no config here".
|
|
70
|
+
const within = override ?? projectRoot;
|
|
71
|
+
if (!configPresent(configPath, within, projectSide)) {
|
|
62
72
|
return undefined;
|
|
63
73
|
}
|
|
64
74
|
try {
|
|
65
|
-
const content =
|
|
75
|
+
const content = readConfigTextSync(configPath);
|
|
66
76
|
const parsed = yaml.parse(content);
|
|
67
77
|
// Validate with canonical schema from resources package.
|
|
68
78
|
//
|
|
@@ -79,25 +89,51 @@ export function loadConfig(projectRoot) {
|
|
|
79
89
|
// was in. Warned once per config path, because `loadConfigCached` will
|
|
80
90
|
// otherwise re-warn for every skill under one project.
|
|
81
91
|
return parseConfigAllowingUnknownKeys(ProjectConfigSchema, parsed, (message) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
92
|
+
// Through the one notice route, once per config path per notice scope: one config
|
|
93
|
+
// governing many skills is one line, not one per skill, and a supervised child's
|
|
94
|
+
// invoking process loaded this same config and printed this same line already.
|
|
95
|
+
noticeToOperator('config', message, configPath);
|
|
86
96
|
}, { configPath });
|
|
87
97
|
}
|
|
88
98
|
catch (error) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
throw
|
|
97
|
-
}
|
|
99
|
+
// `cause` is load-bearing, not decoration: callers decide whether to
|
|
100
|
+
// degrade or abort by asking `fsFaultOf`, which reads the
|
|
101
|
+
// errno off the cause chain. `CONFIG_LOAD` (does not parse or validate)
|
|
102
|
+
// keeps its code; a read the OS refused is already a classified fault and
|
|
103
|
+
// propagates as itself, never re-coded; anything else — a VAT defect —
|
|
104
|
+
// stays uncoded and surfaces as one.
|
|
105
|
+
if (isFsFaultError(error))
|
|
106
|
+
throw error;
|
|
107
|
+
const message = `Failed to load config: ${errorMessageOf(error)}`;
|
|
108
|
+
if (isVatError(error, CONFIG_LOAD_CODE))
|
|
109
|
+
throw new VatError(CONFIG_LOAD_CODE, message, { cause: error });
|
|
110
|
+
if (error instanceof yaml.YAMLError)
|
|
111
|
+
throw new VatError(CONFIG_LOAD_CODE, message, { cause: error });
|
|
98
112
|
throw error;
|
|
99
113
|
}
|
|
100
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Whether the config resolves to something, its links read beneath `within` first. A probe the OS
|
|
117
|
+
* refuses (or a chain naming a network path) is the config's source fault, classified as its read
|
|
118
|
+
* is (origin `config`), never "no config here". "Absent" is believed only once the directory's
|
|
119
|
+
* listing agrees: a wrong "no config" silently runs the verb with none, which does less. The config
|
|
120
|
+
* is the input; every other path refused on the way to it, or listed to confirm it absent, is on the
|
|
121
|
+
* verb's own side for the project (`projectSide`).
|
|
122
|
+
*/
|
|
123
|
+
function configPresent(configPath, within, projectSide) {
|
|
124
|
+
const ctx = { origin: 'config', action: 'find the project config', path: configPath };
|
|
125
|
+
const sideOf = sideWithin(configPath, 'source', projectSide);
|
|
126
|
+
try {
|
|
127
|
+
requireFollowedStatSync(configPath, within);
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
if (!isUnresolvableLinkError(error))
|
|
132
|
+
throw classifyFsFault(error, { ...ctx, side: sideOf(refusedPathOf(error, configPath)) });
|
|
133
|
+
requireConfirmedAbsent(configPath, error, ctx, { follows: true, sideOf });
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
101
137
|
/**
|
|
102
138
|
* Get the directory containing a config file path.
|
|
103
139
|
*/
|
|
@@ -116,9 +152,9 @@ export function getConfigDir(configPath) {
|
|
|
116
152
|
*/
|
|
117
153
|
const loadedConfigCache = new Map();
|
|
118
154
|
/**
|
|
119
|
-
* Companion cache for {@link loadConfigCached}: a
|
|
120
|
-
*
|
|
121
|
-
*
|
|
155
|
+
* Companion cache for {@link loadConfigCached}: what a failed load threw, keyed
|
|
156
|
+
* by `projectRoot` and the verb's `projectSide` (a refusal's side is the verb's), so a broken config re-throws the same error on every skill
|
|
157
|
+
* in a scan without re-parsing.
|
|
122
158
|
*/
|
|
123
159
|
const loadErrorCache = new Map();
|
|
124
160
|
/**
|
|
@@ -130,9 +166,9 @@ const loadErrorCache = new Map();
|
|
|
130
166
|
export function resetLoadedConfigCache() {
|
|
131
167
|
loadedConfigCache.clear();
|
|
132
168
|
loadErrorCache.clear();
|
|
133
|
-
// The warn-once ledger is part of this cache's state: a test that
|
|
134
|
-
// caches and re-loads the same fixture expects to see the warning again.
|
|
135
|
-
|
|
169
|
+
// The warn-once ledger outside every notice scope is part of this cache's state: a test that
|
|
170
|
+
// resets the caches and re-loads the same fixture expects to see the warning again.
|
|
171
|
+
resetUnscopedNoticeLedger();
|
|
136
172
|
}
|
|
137
173
|
/**
|
|
138
174
|
* Cached variant of {@link loadConfig} keyed by `projectRoot`.
|
|
@@ -149,24 +185,27 @@ export function resetLoadedConfigCache() {
|
|
|
149
185
|
* Callers that intentionally tolerate a broken config (e.g. `vat audit`, a bulk
|
|
150
186
|
* linter that should still validate the skill itself) catch `ConfigLoadError`.
|
|
151
187
|
*/
|
|
152
|
-
export function loadConfigCached(projectRoot) {
|
|
153
|
-
const
|
|
188
|
+
export function loadConfigCached(projectRoot, projectSide) {
|
|
189
|
+
const errorKey = `${projectSide}\0${projectRoot}`;
|
|
190
|
+
const cachedError = loadErrorCache.get(errorKey);
|
|
154
191
|
if (cachedError !== undefined)
|
|
155
192
|
throw cachedError;
|
|
156
193
|
const cached = loadedConfigCache.get(projectRoot);
|
|
157
194
|
if (cached !== undefined)
|
|
158
195
|
return cached ?? undefined;
|
|
159
196
|
try {
|
|
160
|
-
const config = loadConfig(projectRoot);
|
|
197
|
+
const config = loadConfig(projectRoot, projectSide);
|
|
161
198
|
loadedConfigCache.set(projectRoot, config ?? null);
|
|
162
199
|
return config;
|
|
163
200
|
}
|
|
164
201
|
catch (err) {
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
202
|
+
// 🔑 Only a CODED config failure becomes a `ConfigLoadError` — the one a
|
|
203
|
+
// caller like `vat audit` may tolerate. Anything else (a `TypeError`, an
|
|
204
|
+
// invariant) is cached and rethrown UNCHANGED, so it surfaces as the defect
|
|
205
|
+
// it is instead of being relabelled a broken config by its throw site.
|
|
206
|
+
const thrown = isConfigFailure(err) ? new ConfigLoadError(projectRoot, err) : err;
|
|
207
|
+
loadErrorCache.set(errorKey, thrown);
|
|
208
|
+
throw thrown;
|
|
170
209
|
}
|
|
171
210
|
}
|
|
172
211
|
//# sourceMappingURL=config-loader.js.map
|