@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,GAEnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAe,cAAc,EAAE,uBAAuB,EAAE,UAAU,EAAE,aAAa,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC9N,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEpF,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEzD;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,UAAU,CAAC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC;AACrG,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAClC,WAAW,CAAS;IAC7B,YAAY,WAAmB,EAAE,KAAe;QAC9C,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF;AAED;;;;;;;;;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;IACf,CAAC;AACH,CAAC"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* @param pathArg - The path argument, or undefined for the current directory
|
|
19
19
|
* @param commandName - The command saying so, for the refusal's wording
|
|
20
20
|
* @returns The root-relative, forward-slashed target. `''` is the corpus root
|
|
21
|
-
* @throws
|
|
21
|
+
* @throws {CommandRefusalError} `USAGE_INVALID` when the argument resolves outside `root` — answering for it would
|
|
22
22
|
* mean querying a corpus this projection never enumerated, and a confident
|
|
23
23
|
* "nothing here" would be indistinguishable from a typo inside the tree
|
|
24
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus-target.d.ts","sourceRoot":"","sources":["../../src/utils/corpus-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"corpus-target.d.ts","sourceRoot":"","sources":["../../src/utils/corpus-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAyCH;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,WAAW,EAAE,MAAM,GAClB,MAAM,CAeR"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { dirname } from 'node:path';
|
|
15
15
|
import { canonicalPath, relativeEscapesRoot, safePath, toForwardSlash } from '@vibe-agent-toolkit/utils';
|
|
16
|
+
import { CommandRefusalError } from './command-refusal.js';
|
|
16
17
|
/**
|
|
17
18
|
* The argument's root-relative spelling, or `undefined` when no ancestor of it
|
|
18
19
|
* IS the root.
|
|
@@ -35,14 +36,15 @@ import { canonicalPath, relativeEscapesRoot, safePath, toForwardSlash } from '@v
|
|
|
35
36
|
* @param target - The absolute, resolved argument
|
|
36
37
|
*/
|
|
37
38
|
function relativeThroughRoot(root, target) {
|
|
38
|
-
|
|
39
|
+
// The root and every ancestor of the typed argument are the operator's own: each is its own `within`.
|
|
40
|
+
const canonicalRoot = canonicalPath(root, root);
|
|
39
41
|
const ancestors = [];
|
|
40
42
|
for (let current = toForwardSlash(target);; current = toForwardSlash(dirname(current))) {
|
|
41
43
|
ancestors.unshift(current);
|
|
42
44
|
if (toForwardSlash(dirname(current)) === current)
|
|
43
45
|
break;
|
|
44
46
|
}
|
|
45
|
-
const anchor = ancestors.find((ancestor) => canonicalPath(ancestor) === canonicalRoot);
|
|
47
|
+
const anchor = ancestors.find((ancestor) => canonicalPath(ancestor, ancestor) === canonicalRoot);
|
|
46
48
|
return anchor === undefined ? undefined : safePath.relative(anchor, target);
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
@@ -52,7 +54,7 @@ function relativeThroughRoot(root, target) {
|
|
|
52
54
|
* @param pathArg - The path argument, or undefined for the current directory
|
|
53
55
|
* @param commandName - The command saying so, for the refusal's wording
|
|
54
56
|
* @returns The root-relative, forward-slashed target. `''` is the corpus root
|
|
55
|
-
* @throws
|
|
57
|
+
* @throws {CommandRefusalError} `USAGE_INVALID` when the argument resolves outside `root` — answering for it would
|
|
56
58
|
* mean querying a corpus this projection never enumerated, and a confident
|
|
57
59
|
* "nothing here" would be indistinguishable from a typo inside the tree
|
|
58
60
|
*/
|
|
@@ -63,7 +65,7 @@ export function targetPathWithin(root, pathArg, commandName) {
|
|
|
63
65
|
// a spelling that escapes lexically is asked the filesystem's opinion.
|
|
64
66
|
const relative = relativeEscapesRoot(lexical) ? relativeThroughRoot(root, target) : lexical;
|
|
65
67
|
if (relative === undefined || relativeEscapesRoot(relative)) {
|
|
66
|
-
throw new
|
|
68
|
+
throw new CommandRefusalError('USAGE_INVALID', `${pathArg ?? process.cwd()} resolves outside the corpus root ${root}.`
|
|
67
69
|
+ ` ${commandName} answers only for paths inside the root it discovered —`
|
|
68
70
|
+ ' run it from within the project you mean to ask about.');
|
|
69
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus-target.js","sourceRoot":"","sources":["../../src/utils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AC;IACjG,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAY,EACZ,OAA2B,EAC3B,WAAmB;IAEnB,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChD,6EAA6E;IAC7E,uEAAuE;IACvE,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC5F,IAAI,QAAQ,KAAK,SAAS,IAAI,mBAAmB,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,mBAAmB,CAC3B,eAAe,EACf,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,qCAAqC,IAAI,GAAG;cACrE,IAAI,WAAW,yDAAyD;cACxE,wDAAwD,CAC3D,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether this run asked for `--debug` — read by the refusal path, which has
|
|
3
|
+
* no logger of its own.
|
|
4
|
+
*
|
|
5
|
+
* `--debug` exists to name the THROW SITE. A refusal is a user's mistake, so
|
|
6
|
+
* without the flag it publishes its message alone; with it, every refusal
|
|
7
|
+
* writes its diagnostics (the stack) to stderr, and `INTERNAL_ERROR` always
|
|
8
|
+
* does. `bin.ts` sets this once, at dispatch, from the parsed option.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Record whether this run asked for `--debug`.
|
|
12
|
+
*
|
|
13
|
+
* @param on - The parsed `--debug` value
|
|
14
|
+
*/
|
|
15
|
+
export declare function setDebugDiagnostics(on: boolean): void;
|
|
16
|
+
/** Whether every refusal should write its diagnostics to stderr. */
|
|
17
|
+
export declare function debugDiagnosticsEnabled(): boolean;
|
|
18
|
+
//# sourceMappingURL=debug-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-diagnostics.d.ts","sourceRoot":"","sources":["../../src/utils/debug-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAErD;AAED,oEAAoE;AACpE,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether this run asked for `--debug` — read by the refusal path, which has
|
|
3
|
+
* no logger of its own.
|
|
4
|
+
*
|
|
5
|
+
* `--debug` exists to name the THROW SITE. A refusal is a user's mistake, so
|
|
6
|
+
* without the flag it publishes its message alone; with it, every refusal
|
|
7
|
+
* writes its diagnostics (the stack) to stderr, and `INTERNAL_ERROR` always
|
|
8
|
+
* does. `bin.ts` sets this once, at dispatch, from the parsed option.
|
|
9
|
+
*/
|
|
10
|
+
let enabled = false;
|
|
11
|
+
/**
|
|
12
|
+
* Record whether this run asked for `--debug`.
|
|
13
|
+
*
|
|
14
|
+
* @param on - The parsed `--debug` value
|
|
15
|
+
*/
|
|
16
|
+
export function setDebugDiagnostics(on) {
|
|
17
|
+
enabled = on;
|
|
18
|
+
}
|
|
19
|
+
/** Whether every refusal should write its diagnostics to stderr. */
|
|
20
|
+
export function debugDiagnosticsEnabled() {
|
|
21
|
+
return enabled;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=debug-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-diagnostics.js","sourceRoot":"","sources":["../../src/utils/debug-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,IAAI,OAAO,GAAG,KAAK,CAAC;AAEpB;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAW;IAC7C,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,uBAAuB;IACrC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE writer of a `vat` command's stdout document.
|
|
3
|
+
*
|
|
4
|
+
* Every shape a command publishes is registered in `report-schemas.ts`, and
|
|
5
|
+
* this module is how it leaves: the document is looked up by verb, passed
|
|
6
|
+
* through the run-integrity refusal the registry's denominator declares,
|
|
7
|
+
* validated against its own published schema, rendered as yaml, json or text,
|
|
8
|
+
* and — for the `end…` functions — the process ends on the code the WRITTEN
|
|
9
|
+
* document derives. `local/no-stdout-outside-writer` keeps every other route
|
|
10
|
+
* to stdout out of `commands/`.
|
|
11
|
+
*
|
|
12
|
+
* 🔑 **Validated before a byte leaves.** A document the published schema
|
|
13
|
+
* rejects is a defect in VAT, and it throws here — the last resort ends it on
|
|
14
|
+
* `ERROR` — rather than shipping a shape an adopter's parser was promised
|
|
15
|
+
* would never appear.
|
|
16
|
+
*/
|
|
17
|
+
import { type Finding, type Gate, type RefusalCode, type Report, type ValidationIssue } from '@vibe-agent-toolkit/schema';
|
|
18
|
+
import { type DocumentFormat, type ExternalOutcome, type ExternalVerb, type LegacyVerb, type ReportVerb } from '../report-schemas.js';
|
|
19
|
+
/**
|
|
20
|
+
* The document a report verb publishes, without writing it: the run-integrity
|
|
21
|
+
* refusal its registered denominator declares, then its published schema.
|
|
22
|
+
*
|
|
23
|
+
* For a lane that needs the published document before writing it — a command
|
|
24
|
+
* that warns on stderr with the refusal the writer adds. {@link writeDocument}
|
|
25
|
+
* goes through it too. (A phase of `vat build` / `validate` / `verify` hands
|
|
26
|
+
* back its report BEFORE this pass: the orchestrator judges zero examined on
|
|
27
|
+
* the whole run.)
|
|
28
|
+
*
|
|
29
|
+
* @param verb - The registered verb
|
|
30
|
+
* @param report - The document as the verb built it
|
|
31
|
+
* @returns The document as published
|
|
32
|
+
* @throws When the verb is unregistered or its schema rejects the document (a defect)
|
|
33
|
+
*/
|
|
34
|
+
export declare function publishedReport<T>(verb: ReportVerb, report: Report<T>): Report<T>;
|
|
35
|
+
/**
|
|
36
|
+
* Publish a report verb's document.
|
|
37
|
+
*
|
|
38
|
+
* @param verb - The registered verb, as typed after `vat`
|
|
39
|
+
* @param report - The document as the verb built it
|
|
40
|
+
* @param format - How to render it
|
|
41
|
+
* @returns The document actually written — after the run-integrity refusal
|
|
42
|
+
* @throws When the verb is unregistered or its schema rejects the document (a defect)
|
|
43
|
+
*/
|
|
44
|
+
export declare function writeDocument<T>(verb: ReportVerb, report: Report<T>, format: DocumentFormat): Report<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Publish a report verb's document and end on the code it derives.
|
|
47
|
+
*
|
|
48
|
+
* @param verb - The registered verb
|
|
49
|
+
* @param report - The document as the verb built it
|
|
50
|
+
* @param format - How to render it
|
|
51
|
+
*/
|
|
52
|
+
export declare function endWithReport<T>(verb: ReportVerb, report: Report<T>, format: DocumentFormat): never;
|
|
53
|
+
/** What finished before a refusal: the work a partial run already did. */
|
|
54
|
+
export interface FinishedWork {
|
|
55
|
+
readonly examined: number;
|
|
56
|
+
readonly findings: readonly Finding[];
|
|
57
|
+
readonly data: unknown;
|
|
58
|
+
}
|
|
59
|
+
/** The explicit "nothing finished" — spelled out at the call site, never defaulted. */
|
|
60
|
+
export declare const NOTHING_FINISHED: FinishedWork;
|
|
61
|
+
/**
|
|
62
|
+
* Publish the envelope's error branch — the run could not do its job — with
|
|
63
|
+
* whatever finished, and end on `ERROR`.
|
|
64
|
+
*
|
|
65
|
+
* The message also goes to stderr, where a human reads it; `INTERNAL_ERROR`
|
|
66
|
+
* adds the stack, since that one is VAT's defect to report, and under
|
|
67
|
+
* `--debug` every refusal does — the flag exists to name the throw site.
|
|
68
|
+
*
|
|
69
|
+
* @param verb - The registered verb
|
|
70
|
+
* @param code - Which refusal: `USAGE_INVALID` for the invocation's mistake,
|
|
71
|
+
* `INPUT_UNREADABLE` for an input that cannot be read, `INTERNAL_ERROR` only
|
|
72
|
+
* for a failure VAT did not anticipate
|
|
73
|
+
* @param error - The thrown value, or the message
|
|
74
|
+
* @param format - How to render the document
|
|
75
|
+
* @param gate - The gate the run was judged by
|
|
76
|
+
* @param finished - The work that finished, or {@link NOTHING_FINISHED}
|
|
77
|
+
*/
|
|
78
|
+
export declare function endWithRefusal(verb: ReportVerb, code: RefusalCode, error: unknown, format: DocumentFormat, gate: Gate, finished: FinishedWork): never;
|
|
79
|
+
/**
|
|
80
|
+
* The envelope's error branch for a refusal, with its human half already on
|
|
81
|
+
* stderr — what {@link endWithRefusal} writes, for the lane that hands the
|
|
82
|
+
* report on instead (a phase an orchestrator folds, or an orchestrator's own
|
|
83
|
+
* refusal).
|
|
84
|
+
*
|
|
85
|
+
* @param code - Which refusal (see {@link endWithRefusal})
|
|
86
|
+
* @param error - The thrown value, or the message
|
|
87
|
+
* @param gate - The gate the run was judged by
|
|
88
|
+
* @param finished - The work that finished, or {@link NOTHING_FINISHED}
|
|
89
|
+
* @returns The error report, not yet published
|
|
90
|
+
*/
|
|
91
|
+
export declare function refusalReport(code: RefusalCode, error: unknown, gate: Gate, finished: FinishedWork): Report<unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* What the failure path could not clean up — a temporary directory, a staged tree —
|
|
94
|
+
* recorded beside the thrown error (`suppressedFaultsOf`), as warnings naming each.
|
|
95
|
+
* Recorded beside, never on its cause chain: a leftover is never the run's refusal.
|
|
96
|
+
*/
|
|
97
|
+
export declare function leftoverFindingsOf(error: unknown): Array<ValidationIssue & Finding>;
|
|
98
|
+
/**
|
|
99
|
+
* The {@link leftoverIssue} a failure to remove something stands for: its message, and — for a
|
|
100
|
+
* classified fault — the path it names (the entry left).
|
|
101
|
+
*
|
|
102
|
+
* @param fault - What the removal threw: a parked entry an uninstall or a clear could not delete
|
|
103
|
+
* (`applyTreePlanOrLeftover`'s `leftover`), or a suppressed fault beside a refusal
|
|
104
|
+
*/
|
|
105
|
+
export declare function leftoverIssueOf(fault: unknown): ValidationIssue & Finding;
|
|
106
|
+
/**
|
|
107
|
+
* Something a run made and could not remove — a temporary directory, a staged or parked tree —
|
|
108
|
+
* as the ONE warning every lane names it with ({@link TREE_CLEANUP_INCOMPLETE_CODE}), whether the
|
|
109
|
+
* run then refused or finished.
|
|
110
|
+
*
|
|
111
|
+
* @param message - What was left, and why it stayed
|
|
112
|
+
* @param path - The entry left, when known: its `link`
|
|
113
|
+
*/
|
|
114
|
+
export declare function leftoverIssue(message: string, path: string | undefined): ValidationIssue & Finding;
|
|
115
|
+
/** A document another `vat` process wrote, checked to be its verb's, with the report it parses to. */
|
|
116
|
+
export interface ForwardedDocument {
|
|
117
|
+
readonly text: string;
|
|
118
|
+
readonly report: Report<unknown>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Read a report verb's document another `vat` process already wrote — a
|
|
122
|
+
* supervised child — checking it IS that verb's document: parsed in the format
|
|
123
|
+
* it was asked for and validated against the published schema.
|
|
124
|
+
*
|
|
125
|
+
* @param verb - The registered verb whose document `text` claims to be
|
|
126
|
+
* @param text - The document as the child wrote it
|
|
127
|
+
* @param format - The format the child was asked for
|
|
128
|
+
* @returns The text with the report it parses to, for {@link endWithForwardedDocument}
|
|
129
|
+
* @throws When `text` does not parse, or its schema rejects it — a truncated
|
|
130
|
+
* write among them, which the caller decides how to report
|
|
131
|
+
*/
|
|
132
|
+
export declare function readForwardedDocument(verb: ReportVerb, text: string, format: Exclude<DocumentFormat, 'text'>): ForwardedDocument;
|
|
133
|
+
/**
|
|
134
|
+
* Publish a forwarded document byte for byte and end on the code the document
|
|
135
|
+
* derives — never on the code the process that wrote it happened to exit with.
|
|
136
|
+
*
|
|
137
|
+
* @param document - What {@link readForwardedDocument} accepted
|
|
138
|
+
*/
|
|
139
|
+
export declare function endWithForwardedDocument(document: ForwardedDocument): never;
|
|
140
|
+
/**
|
|
141
|
+
* Publish an externally owned payload verbatim and end on the code its
|
|
142
|
+
* registered adapter maps `outcome` to.
|
|
143
|
+
*
|
|
144
|
+
* @param verb - A verb of an `external` entry
|
|
145
|
+
* @param payload - The payload as its owner shaped it
|
|
146
|
+
* @param format - How to render it (`text` renders YAML)
|
|
147
|
+
* @param outcome - What the external write did
|
|
148
|
+
*/
|
|
149
|
+
export declare function writeExternalDocument(verb: ExternalVerb, payload: unknown, format: DocumentFormat, outcome: ExternalOutcome): never;
|
|
150
|
+
/**
|
|
151
|
+
* End an external verb whose run threw: publish `{ error: { code, message } }`
|
|
152
|
+
* — the one failure payload every external verb shares, since the payload it
|
|
153
|
+
* would have passed through never arrived — and end on the code its adapter
|
|
154
|
+
* maps `failed` to. The code is the thrown value's own ({@link refusalCodeOf}):
|
|
155
|
+
* a missing key or a bad argument is `USAGE_INVALID`, a refused or unanswered
|
|
156
|
+
* API call `EXTERNAL_API_FAILED`, anything uncoded `INTERNAL_ERROR`.
|
|
157
|
+
*
|
|
158
|
+
* @param verb - A verb of an `external` entry
|
|
159
|
+
* @param error - What the run threw
|
|
160
|
+
* @param format - How to render the payload
|
|
161
|
+
*/
|
|
162
|
+
export declare function endWithExternalRefusal(verb: ExternalVerb, error: unknown, format: DocumentFormat): never;
|
|
163
|
+
/**
|
|
164
|
+
* The one serializer for a `legacy` entry's document: unvalidated, and typed
|
|
165
|
+
* to the legacy verbs so no report verb can take this path.
|
|
166
|
+
*
|
|
167
|
+
* @param _verb - A verb of a `legacy` entry
|
|
168
|
+
* @param document - The legacy document
|
|
169
|
+
* @param format - How to render it
|
|
170
|
+
* @param text - The verb's own `--format text` rendering, written as-is; with
|
|
171
|
+
* none (a refusal has no human rendering of its own) `text` renders YAML.
|
|
172
|
+
* Required, so a caller says which it means
|
|
173
|
+
*/
|
|
174
|
+
export declare function writeLegacyDocument(_verb: LegacyVerb, document: unknown, format: DocumentFormat, text: string | undefined): void;
|
|
175
|
+
/**
|
|
176
|
+
* Publish a stdout artifact — a config to paste, a file's text — and nothing else.
|
|
177
|
+
*
|
|
178
|
+
* @param name - The registered stdout artifact
|
|
179
|
+
* @param payload - The artifact; a string for `raw`
|
|
180
|
+
* @param format - `yaml` / `json`, or `raw` to write a string as-is
|
|
181
|
+
*/
|
|
182
|
+
export declare function writeArtifact(name: string, payload: unknown, format: Exclude<DocumentFormat, 'text'> | 'raw'): void;
|
|
183
|
+
/**
|
|
184
|
+
* Write a registered file artifact: YAML for a `.yaml`/`.yml` path, JSON otherwise.
|
|
185
|
+
*
|
|
186
|
+
* @param name - The registered file artifact
|
|
187
|
+
* @param path - Where to write it
|
|
188
|
+
* @param payload - The artifact
|
|
189
|
+
*/
|
|
190
|
+
export declare function writeArtifactFile(name: string, path: string, payload: unknown): void;
|
|
191
|
+
//# sourceMappingURL=document-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-writer.d.ts","sourceRoot":"","sources":["../../src/utils/document-writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAyC9B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAA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,EAAE,OAAO,GAAG,IAAI,CAIpF"}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE writer of a `vat` command's stdout document.
|
|
3
|
+
*
|
|
4
|
+
* Every shape a command publishes is registered in `report-schemas.ts`, and
|
|
5
|
+
* this module is how it leaves: the document is looked up by verb, passed
|
|
6
|
+
* through the run-integrity refusal the registry's denominator declares,
|
|
7
|
+
* validated against its own published schema, rendered as yaml, json or text,
|
|
8
|
+
* and — for the `end…` functions — the process ends on the code the WRITTEN
|
|
9
|
+
* document derives. `local/no-stdout-outside-writer` keeps every other route
|
|
10
|
+
* to stdout out of `commands/`.
|
|
11
|
+
*
|
|
12
|
+
* 🔑 **Validated before a byte leaves.** A document the published schema
|
|
13
|
+
* rejects is a defect in VAT, and it throws here — the last resort ends it on
|
|
14
|
+
* `ERROR` — rather than shipping a shape an adopter's parser was promised
|
|
15
|
+
* would never appear.
|
|
16
|
+
*/
|
|
17
|
+
import { writeFileSync } from 'node:fs';
|
|
18
|
+
import { buildErrorReport, CODE_REGISTRY, errorDiagnostics, exitCodeForReport, } from '@vibe-agent-toolkit/schema';
|
|
19
|
+
import { isFsFaultError, suppressedFaultsOf, TREE_CLEANUP_INCOMPLETE_CODE } from '@vibe-agent-toolkit/utils';
|
|
20
|
+
import { parse as parseYaml } from 'yaml';
|
|
21
|
+
import { artifactShapeFor, exitCodeForExternal, reportShapeFor, } from '../report-schemas.js';
|
|
22
|
+
import { errorMessageOf, refusalCodeOf, withFsFaultRemedy } from './command-refusal.js';
|
|
23
|
+
import { debugDiagnosticsEnabled } from './debug-diagnostics.js';
|
|
24
|
+
import { renderYamlDocument, writeStdoutSync } from './output.js';
|
|
25
|
+
import { withRunIntegrity } from './run-integrity.js';
|
|
26
|
+
/** One finding as a compiler-style line: `location:line:column: severity: message [code]`. */
|
|
27
|
+
function findingLine(finding) {
|
|
28
|
+
const anchor = [finding.location, finding.line, finding.column].filter((part) => part !== undefined).join(':');
|
|
29
|
+
const line = `${finding.severity}: ${finding.message} [${finding.code}]`;
|
|
30
|
+
return anchor === '' ? line : `${anchor}: ${line}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The generic `--format text` rendering: one line per finding, then the status
|
|
34
|
+
* line with the counts and the denominator.
|
|
35
|
+
*/
|
|
36
|
+
function renderReportText(report, unit) {
|
|
37
|
+
const { errors, warnings, info } = report.summary;
|
|
38
|
+
const lines = report.findings.map(findingLine);
|
|
39
|
+
if (report.status === 'error')
|
|
40
|
+
lines.push(`error: ${report.error.message} [${report.error.code}]`);
|
|
41
|
+
lines.push(`status: ${report.status} — ${errors} errors, ${warnings} warnings, ${info} info (examined ${report.examined} ${unit})`);
|
|
42
|
+
return `${lines.join('\n')}\n`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Write `document` in a structured format — `text` has no structure, so it is YAML.
|
|
46
|
+
*
|
|
47
|
+
* YAML opens with `---` and has NO trailing marker: `---` opens a document, so a
|
|
48
|
+
* trailer made every stdout a two-document stream a plain `YAML.parse()` refused.
|
|
49
|
+
*
|
|
50
|
+
* The ordinary stream write, not {@link writeStdoutSync}: a document follows
|
|
51
|
+
* progress written through `console.log`, and a synchronous fd-1 write would
|
|
52
|
+
* jump ahead of anything still buffered there. `makeStdioBlocking()` at startup
|
|
53
|
+
* makes both channels synchronous, so nothing is lost at `process.exit`.
|
|
54
|
+
*/
|
|
55
|
+
function writeStructured(document, format) {
|
|
56
|
+
process.stdout.write(format === 'json' ? `${JSON.stringify(document, null, 2)}\n` : `---\n${renderYamlDocument(document)}`);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The document a report verb publishes, without writing it: the run-integrity
|
|
60
|
+
* refusal its registered denominator declares, then its published schema.
|
|
61
|
+
*
|
|
62
|
+
* For a lane that needs the published document before writing it — a command
|
|
63
|
+
* that warns on stderr with the refusal the writer adds. {@link writeDocument}
|
|
64
|
+
* goes through it too. (A phase of `vat build` / `validate` / `verify` hands
|
|
65
|
+
* back its report BEFORE this pass: the orchestrator judges zero examined on
|
|
66
|
+
* the whole run.)
|
|
67
|
+
*
|
|
68
|
+
* @param verb - The registered verb
|
|
69
|
+
* @param report - The document as the verb built it
|
|
70
|
+
* @returns The document as published
|
|
71
|
+
* @throws When the verb is unregistered or its schema rejects the document (a defect)
|
|
72
|
+
*/
|
|
73
|
+
export function publishedReport(verb, report) {
|
|
74
|
+
const entry = reportShapeFor(verb);
|
|
75
|
+
const published = withRunIntegrity(report, entry.examined);
|
|
76
|
+
entry.schema.parse(published);
|
|
77
|
+
return published;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Publish a report verb's document.
|
|
81
|
+
*
|
|
82
|
+
* @param verb - The registered verb, as typed after `vat`
|
|
83
|
+
* @param report - The document as the verb built it
|
|
84
|
+
* @param format - How to render it
|
|
85
|
+
* @returns The document actually written — after the run-integrity refusal
|
|
86
|
+
* @throws When the verb is unregistered or its schema rejects the document (a defect)
|
|
87
|
+
*/
|
|
88
|
+
export function writeDocument(verb, report, format) {
|
|
89
|
+
const entry = reportShapeFor(verb);
|
|
90
|
+
const written = publishedReport(verb, report);
|
|
91
|
+
if (format === 'text') {
|
|
92
|
+
const text = entry.renderText === undefined
|
|
93
|
+
? renderReportText(written, entry.examined.unit)
|
|
94
|
+
: entry.renderText(written);
|
|
95
|
+
if (text !== '')
|
|
96
|
+
process.stdout.write(text);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
writeStructured(written, format);
|
|
100
|
+
}
|
|
101
|
+
return written;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Publish a report verb's document and end on the code it derives.
|
|
105
|
+
*
|
|
106
|
+
* @param verb - The registered verb
|
|
107
|
+
* @param report - The document as the verb built it
|
|
108
|
+
* @param format - How to render it
|
|
109
|
+
*/
|
|
110
|
+
export function endWithReport(verb, report, format) {
|
|
111
|
+
process.exit(exitCodeForReport(writeDocument(verb, report, format)));
|
|
112
|
+
}
|
|
113
|
+
/** The explicit "nothing finished" — spelled out at the call site, never defaulted. */
|
|
114
|
+
export const NOTHING_FINISHED = Object.freeze({ examined: 0, findings: [], data: null });
|
|
115
|
+
/**
|
|
116
|
+
* Publish the envelope's error branch — the run could not do its job — with
|
|
117
|
+
* whatever finished, and end on `ERROR`.
|
|
118
|
+
*
|
|
119
|
+
* The message also goes to stderr, where a human reads it; `INTERNAL_ERROR`
|
|
120
|
+
* adds the stack, since that one is VAT's defect to report, and under
|
|
121
|
+
* `--debug` every refusal does — the flag exists to name the throw site.
|
|
122
|
+
*
|
|
123
|
+
* @param verb - The registered verb
|
|
124
|
+
* @param code - Which refusal: `USAGE_INVALID` for the invocation's mistake,
|
|
125
|
+
* `INPUT_UNREADABLE` for an input that cannot be read, `INTERNAL_ERROR` only
|
|
126
|
+
* for a failure VAT did not anticipate
|
|
127
|
+
* @param error - The thrown value, or the message
|
|
128
|
+
* @param format - How to render the document
|
|
129
|
+
* @param gate - The gate the run was judged by
|
|
130
|
+
* @param finished - The work that finished, or {@link NOTHING_FINISHED}
|
|
131
|
+
*/
|
|
132
|
+
export function endWithRefusal(verb, code, error, format, gate, finished) {
|
|
133
|
+
process.exit(exitCodeForReport(writeDocument(verb, refusalReport(code, error, gate, finished), format)));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A refusal's human half: its message on stderr — the code's own description
|
|
137
|
+
* when the thrown value carries none — plus the stack for a VAT defect, or for
|
|
138
|
+
* any refusal under `--debug`, which exists to name the throw site.
|
|
139
|
+
*
|
|
140
|
+
* @returns The message the published document carries
|
|
141
|
+
*/
|
|
142
|
+
function announceRefusal(code, error) {
|
|
143
|
+
const raw = errorMessageOf(error);
|
|
144
|
+
const message = raw === '' ? CODE_REGISTRY[code].description : withFsFaultRemedy(raw, error);
|
|
145
|
+
process.stderr.write(`${message}\n`);
|
|
146
|
+
if (code === 'INTERNAL_ERROR' || debugDiagnosticsEnabled())
|
|
147
|
+
process.stderr.write(`${errorDiagnostics(error)}\n`);
|
|
148
|
+
return message;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The envelope's error branch for a refusal, with its human half already on
|
|
152
|
+
* stderr — what {@link endWithRefusal} writes, for the lane that hands the
|
|
153
|
+
* report on instead (a phase an orchestrator folds, or an orchestrator's own
|
|
154
|
+
* refusal).
|
|
155
|
+
*
|
|
156
|
+
* @param code - Which refusal (see {@link endWithRefusal})
|
|
157
|
+
* @param error - The thrown value, or the message
|
|
158
|
+
* @param gate - The gate the run was judged by
|
|
159
|
+
* @param finished - The work that finished, or {@link NOTHING_FINISHED}
|
|
160
|
+
* @returns The error report, not yet published
|
|
161
|
+
*/
|
|
162
|
+
export function refusalReport(code, error, gate, finished) {
|
|
163
|
+
const message = announceRefusal(code, error);
|
|
164
|
+
return buildErrorReport({
|
|
165
|
+
error: { code, message },
|
|
166
|
+
gate,
|
|
167
|
+
examined: finished.examined,
|
|
168
|
+
findings: [...finished.findings, ...leftoverFindingsOf(error)],
|
|
169
|
+
data: finished.data,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* What the failure path could not clean up — a temporary directory, a staged tree —
|
|
174
|
+
* recorded beside the thrown error (`suppressedFaultsOf`), as warnings naming each.
|
|
175
|
+
* Recorded beside, never on its cause chain: a leftover is never the run's refusal.
|
|
176
|
+
*/
|
|
177
|
+
export function leftoverFindingsOf(error) {
|
|
178
|
+
return suppressedFaultsOf(error).map((fault) => {
|
|
179
|
+
process.stderr.write(`warning: ${errorMessageOf(fault)}\n`);
|
|
180
|
+
return leftoverIssueOf(fault);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The {@link leftoverIssue} a failure to remove something stands for: its message, and — for a
|
|
185
|
+
* classified fault — the path it names (the entry left).
|
|
186
|
+
*
|
|
187
|
+
* @param fault - What the removal threw: a parked entry an uninstall or a clear could not delete
|
|
188
|
+
* (`applyTreePlanOrLeftover`'s `leftover`), or a suppressed fault beside a refusal
|
|
189
|
+
*/
|
|
190
|
+
export function leftoverIssueOf(fault) {
|
|
191
|
+
return leftoverIssue(errorMessageOf(fault), isFsFaultError(fault) ? fault.path : undefined);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Something a run made and could not remove — a temporary directory, a staged or parked tree —
|
|
195
|
+
* as the ONE warning every lane names it with ({@link TREE_CLEANUP_INCOMPLETE_CODE}), whether the
|
|
196
|
+
* run then refused or finished.
|
|
197
|
+
*
|
|
198
|
+
* @param message - What was left, and why it stayed
|
|
199
|
+
* @param path - The entry left, when known: its `link`
|
|
200
|
+
*/
|
|
201
|
+
export function leftoverIssue(message, path) {
|
|
202
|
+
return {
|
|
203
|
+
code: TREE_CLEANUP_INCOMPLETE_CODE,
|
|
204
|
+
severity: 'warning',
|
|
205
|
+
message,
|
|
206
|
+
// `link`, never `location`: a report's location is project-relative, and this is an absolute path (a temp dir, a staged tree).
|
|
207
|
+
...(path === undefined ? {} : { link: path }),
|
|
208
|
+
fix: 'Remove what the message names yourself, making it writable first if the OS refused; nothing VAT made uses it.',
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Read a report verb's document another `vat` process already wrote — a
|
|
213
|
+
* supervised child — checking it IS that verb's document: parsed in the format
|
|
214
|
+
* it was asked for and validated against the published schema.
|
|
215
|
+
*
|
|
216
|
+
* @param verb - The registered verb whose document `text` claims to be
|
|
217
|
+
* @param text - The document as the child wrote it
|
|
218
|
+
* @param format - The format the child was asked for
|
|
219
|
+
* @returns The text with the report it parses to, for {@link endWithForwardedDocument}
|
|
220
|
+
* @throws When `text` does not parse, or its schema rejects it — a truncated
|
|
221
|
+
* write among them, which the caller decides how to report
|
|
222
|
+
*/
|
|
223
|
+
export function readForwardedDocument(verb, text, format) {
|
|
224
|
+
const parsed = format === 'json' ? JSON.parse(text) : parseYaml(text);
|
|
225
|
+
reportShapeFor(verb).schema.parse(parsed);
|
|
226
|
+
return { text, report: parsed };
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Publish a forwarded document byte for byte and end on the code the document
|
|
230
|
+
* derives — never on the code the process that wrote it happened to exit with.
|
|
231
|
+
*
|
|
232
|
+
* @param document - What {@link readForwardedDocument} accepted
|
|
233
|
+
*/
|
|
234
|
+
export function endWithForwardedDocument(document) {
|
|
235
|
+
writeStdoutSync(document.text);
|
|
236
|
+
process.exit(exitCodeForReport(document.report));
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Publish an externally owned payload verbatim and end on the code its
|
|
240
|
+
* registered adapter maps `outcome` to.
|
|
241
|
+
*
|
|
242
|
+
* @param verb - A verb of an `external` entry
|
|
243
|
+
* @param payload - The payload as its owner shaped it
|
|
244
|
+
* @param format - How to render it (`text` renders YAML)
|
|
245
|
+
* @param outcome - What the external write did
|
|
246
|
+
*/
|
|
247
|
+
export function writeExternalDocument(verb, payload, format, outcome) {
|
|
248
|
+
writeStructured(payload, format);
|
|
249
|
+
process.exit(exitCodeForExternal(verb, outcome));
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* End an external verb whose run threw: publish `{ error: { code, message } }`
|
|
253
|
+
* — the one failure payload every external verb shares, since the payload it
|
|
254
|
+
* would have passed through never arrived — and end on the code its adapter
|
|
255
|
+
* maps `failed` to. The code is the thrown value's own ({@link refusalCodeOf}):
|
|
256
|
+
* a missing key or a bad argument is `USAGE_INVALID`, a refused or unanswered
|
|
257
|
+
* API call `EXTERNAL_API_FAILED`, anything uncoded `INTERNAL_ERROR`.
|
|
258
|
+
*
|
|
259
|
+
* @param verb - A verb of an `external` entry
|
|
260
|
+
* @param error - What the run threw
|
|
261
|
+
* @param format - How to render the payload
|
|
262
|
+
*/
|
|
263
|
+
export function endWithExternalRefusal(verb, error, format) {
|
|
264
|
+
const code = refusalCodeOf(error);
|
|
265
|
+
const message = announceRefusal(code, error);
|
|
266
|
+
writeExternalDocument(verb, { error: { code, message } }, format, { kind: 'failed', cause: message });
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* The one serializer for a `legacy` entry's document: unvalidated, and typed
|
|
270
|
+
* to the legacy verbs so no report verb can take this path.
|
|
271
|
+
*
|
|
272
|
+
* @param _verb - A verb of a `legacy` entry
|
|
273
|
+
* @param document - The legacy document
|
|
274
|
+
* @param format - How to render it
|
|
275
|
+
* @param text - The verb's own `--format text` rendering, written as-is; with
|
|
276
|
+
* none (a refusal has no human rendering of its own) `text` renders YAML.
|
|
277
|
+
* Required, so a caller says which it means
|
|
278
|
+
*/
|
|
279
|
+
export function writeLegacyDocument(_verb, document, format, text) {
|
|
280
|
+
// The verb's TYPE is the guarantee — only a legacy verb compiles here.
|
|
281
|
+
if (format === 'text' && text !== undefined) {
|
|
282
|
+
// Synchronously, as `claude context` always wrote it: its text can run long and the verb exits straight after.
|
|
283
|
+
writeStdoutSync(text);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
writeStructured(document, format);
|
|
287
|
+
}
|
|
288
|
+
/** Validate a payload against its artifact entry's schema, when it declares one. */
|
|
289
|
+
function validatedArtifact(name, channel, payload) {
|
|
290
|
+
artifactShapeFor(name, channel).schema?.parse(payload);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Publish a stdout artifact — a config to paste, a file's text — and nothing else.
|
|
294
|
+
*
|
|
295
|
+
* @param name - The registered stdout artifact
|
|
296
|
+
* @param payload - The artifact; a string for `raw`
|
|
297
|
+
* @param format - `yaml` / `json`, or `raw` to write a string as-is
|
|
298
|
+
*/
|
|
299
|
+
export function writeArtifact(name, payload, format) {
|
|
300
|
+
validatedArtifact(name, 'stdout', payload);
|
|
301
|
+
if (format === 'raw') {
|
|
302
|
+
process.stdout.write(String(payload));
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
writeStructured(payload, format);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Write a registered file artifact: YAML for a `.yaml`/`.yml` path, JSON otherwise.
|
|
309
|
+
*
|
|
310
|
+
* @param name - The registered file artifact
|
|
311
|
+
* @param path - Where to write it
|
|
312
|
+
* @param payload - The artifact
|
|
313
|
+
*/
|
|
314
|
+
export function writeArtifactFile(name, path, payload) {
|
|
315
|
+
validatedArtifact(name, 'file', payload);
|
|
316
|
+
const text = /\.ya?ml$/.test(path) ? renderYamlDocument(payload) : `${JSON.stringify(payload, null, 2)}\n`;
|
|
317
|
+
writeFileSync(path, text, 'utf-8');
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=document-writer.js.map
|