@vibe-agent-toolkit/cli 0.2.0-rc.1 → 0.2.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/dist/bin/vat +97 -28
- package/dist/bin/vat.js +97 -28
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +115 -76
- package/dist/bin.js.map +1 -1
- package/dist/command-loaders.d.ts +44 -0
- package/dist/command-loaders.d.ts.map +1 -0
- package/dist/command-loaders.js +60 -0
- package/dist/command-loaders.js.map +1 -0
- package/dist/commands/agent/build.d.ts.map +1 -1
- package/dist/commands/agent/build.js +2 -1
- package/dist/commands/agent/build.js.map +1 -1
- package/dist/commands/agent/import.d.ts.map +1 -1
- package/dist/commands/agent/import.js +3 -2
- package/dist/commands/agent/import.js.map +1 -1
- package/dist/commands/agent/index.js +1 -1
- package/dist/commands/agent/install-path.d.ts +36 -0
- package/dist/commands/agent/install-path.d.ts.map +1 -0
- package/dist/commands/agent/install-path.js +44 -0
- package/dist/commands/agent/install-path.js.map +1 -0
- package/dist/commands/agent/install.d.ts.map +1 -1
- package/dist/commands/agent/install.js +66 -13
- package/dist/commands/agent/install.js.map +1 -1
- package/dist/commands/agent/installed.d.ts.map +1 -1
- package/dist/commands/agent/installed.js +22 -12
- package/dist/commands/agent/installed.js.map +1 -1
- package/dist/commands/agent/list.d.ts.map +1 -1
- package/dist/commands/agent/list.js +2 -1
- package/dist/commands/agent/list.js.map +1 -1
- package/dist/commands/agent/run.d.ts.map +1 -1
- package/dist/commands/agent/run.js +2 -1
- package/dist/commands/agent/run.js.map +1 -1
- package/dist/commands/agent/uninstall.d.ts.map +1 -1
- package/dist/commands/agent/uninstall.js +13 -6
- package/dist/commands/agent/uninstall.js.map +1 -1
- package/dist/commands/agent/validate.d.ts.map +1 -1
- package/dist/commands/agent/validate.js +3 -2
- package/dist/commands/agent/validate.js.map +1 -1
- package/dist/commands/ard/emit.d.ts +165 -0
- package/dist/commands/ard/emit.d.ts.map +1 -0
- package/dist/commands/ard/emit.js +338 -0
- package/dist/commands/ard/emit.js.map +1 -0
- package/dist/commands/ard/index.d.ts +12 -0
- package/dist/commands/ard/index.d.ts.map +1 -0
- package/dist/commands/ard/index.js +84 -0
- package/dist/commands/ard/index.js.map +1 -0
- package/dist/commands/ard/surfaces.d.ts +56 -0
- package/dist/commands/ard/surfaces.d.ts.map +1 -0
- package/dist/commands/ard/surfaces.js +150 -0
- package/dist/commands/ard/surfaces.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 +11 -7
- package/dist/commands/audit/distributed-tree.js.map +1 -1
- package/dist/commands/audit/git-url-clone.d.ts +1 -1
- package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
- package/dist/commands/audit/git-url-clone.js.map +1 -1
- package/dist/commands/audit/hierarchical-output.d.ts +1 -1
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
- package/dist/commands/audit/hierarchical-output.js +1 -1
- package/dist/commands/audit/hierarchical-output.js.map +1 -1
- package/dist/commands/audit/provenance.d.ts.map +1 -1
- package/dist/commands/audit/provenance.js +4 -3
- package/dist/commands/audit/provenance.js.map +1 -1
- package/dist/commands/audit/scan-population.d.ts +158 -0
- package/dist/commands/audit/scan-population.d.ts.map +1 -0
- package/dist/commands/audit/scan-population.js +292 -0
- package/dist/commands/audit/scan-population.js.map +1 -0
- package/dist/commands/audit-settings.d.ts.map +1 -1
- package/dist/commands/audit-settings.js +6 -5
- package/dist/commands/audit-settings.js.map +1 -1
- package/dist/commands/audit.d.ts +98 -8
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +1150 -394
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +40 -36
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cache/cache-control.d.ts +82 -0
- package/dist/commands/cache/cache-control.d.ts.map +1 -0
- package/dist/commands/cache/cache-control.js +86 -0
- package/dist/commands/cache/cache-control.js.map +1 -0
- package/dist/commands/cache/clear.d.ts +34 -6
- package/dist/commands/cache/clear.d.ts.map +1 -1
- package/dist/commands/cache/clear.js +101 -15
- package/dist/commands/cache/clear.js.map +1 -1
- package/dist/commands/cache/index.d.ts +13 -63
- package/dist/commands/cache/index.d.ts.map +1 -1
- package/dist/commands/cache/index.js +47 -79
- package/dist/commands/cache/index.js.map +1 -1
- package/dist/commands/claude/claude-config.d.ts.map +1 -1
- package/dist/commands/claude/claude-config.js +6 -0
- package/dist/commands/claude/claude-config.js.map +1 -1
- package/dist/commands/claude/context.d.ts +372 -0
- package/dist/commands/claude/context.d.ts.map +1 -0
- package/dist/commands/claude/context.js +1115 -0
- package/dist/commands/claude/context.js.map +1 -0
- package/dist/commands/claude/index.d.ts +14 -0
- package/dist/commands/claude/index.d.ts.map +1 -1
- package/dist/commands/claude/index.js +22 -2
- package/dist/commands/claude/index.js.map +1 -1
- package/dist/commands/claude/marketplace/changelog-utils.d.ts +1 -1
- package/dist/commands/claude/marketplace/changelog-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/changelog-utils.js +1 -2
- package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.js +40 -31
- package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.js +0 -1
- package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish-tree.js +0 -6
- package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
- package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish.js +2 -1
- package/dist/commands/claude/marketplace/publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate.d.ts +73 -22
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +407 -72
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/api-keys.d.ts +0 -3
- package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
- package/dist/commands/claude/org/api-keys.js +2 -1
- package/dist/commands/claude/org/api-keys.js.map +1 -1
- package/dist/commands/claude/org/helpers.d.ts +54 -1
- package/dist/commands/claude/org/helpers.d.ts.map +1 -1
- package/dist/commands/claude/org/helpers.js +42 -7
- 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 +24 -16
- package/dist/commands/claude/org/index.js.map +1 -1
- package/dist/commands/claude/org/invites.d.ts +0 -3
- package/dist/commands/claude/org/invites.d.ts.map +1 -1
- package/dist/commands/claude/org/invites.js +3 -2
- package/dist/commands/claude/org/invites.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +527 -0
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +1414 -108
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/org/users.d.ts +0 -3
- package/dist/commands/claude/org/users.d.ts.map +1 -1
- package/dist/commands/claude/org/users.js +6 -3
- package/dist/commands/claude/org/users.js.map +1 -1
- package/dist/commands/claude/org/workspaces.d.ts +0 -3
- package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
- package/dist/commands/claude/org/workspaces.js +11 -7
- package/dist/commands/claude/org/workspaces.js.map +1 -1
- package/dist/commands/claude/plugin/build.d.ts +41 -3
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +147 -80
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
- package/dist/commands/claude/plugin/helpers.js +2 -7
- package/dist/commands/claude/plugin/helpers.js.map +1 -1
- package/dist/commands/claude/plugin/install.d.ts +12 -0
- package/dist/commands/claude/plugin/install.d.ts.map +1 -1
- package/dist/commands/claude/plugin/install.js +93 -62
- package/dist/commands/claude/plugin/install.js.map +1 -1
- package/dist/commands/claude/plugin/list.d.ts.map +1 -1
- package/dist/commands/claude/plugin/list.js +3 -2
- package/dist/commands/claude/plugin/list.js.map +1 -1
- package/dist/commands/claude/plugin/marketplace-json.d.ts +24 -9
- package/dist/commands/claude/plugin/marketplace-json.d.ts.map +1 -1
- package/dist/commands/claude/plugin/marketplace-json.js +10 -9
- package/dist/commands/claude/plugin/marketplace-json.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
- package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.js +3 -6
- package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.js +3 -6
- package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts +73 -0
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +221 -14
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
- package/dist/commands/claude/plugin/uninstall.js +4 -4
- package/dist/commands/claude/plugin/uninstall.js.map +1 -1
- package/dist/commands/consistency-check.d.ts +17 -15
- package/dist/commands/consistency-check.d.ts.map +1 -1
- package/dist/commands/consistency-check.js +152 -106
- 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 +3 -0
- package/dist/commands/corpus/index.js.map +1 -1
- package/dist/commands/corpus/report.d.ts +1 -2
- package/dist/commands/corpus/report.d.ts.map +1 -1
- package/dist/commands/corpus/report.js +1 -3
- package/dist/commands/corpus/report.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts +58 -1
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +95 -41
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/corpus/scan.d.ts.map +1 -1
- package/dist/commands/corpus/scan.js +20 -12
- package/dist/commands/corpus/scan.js.map +1 -1
- package/dist/commands/corpus/seed.d.ts +4 -4
- package/dist/commands/corpus/seed.d.ts.map +1 -1
- package/dist/commands/corpus/seed.js +1 -3
- package/dist/commands/corpus/seed.js.map +1 -1
- package/dist/commands/doctor.d.ts +50 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +245 -52
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/inventory.d.ts +13 -1
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +121 -17
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/mcp/collections.d.ts +1 -1
- package/dist/commands/mcp/collections.d.ts.map +1 -1
- package/dist/commands/mcp/list-collections.d.ts.map +1 -1
- package/dist/commands/mcp/list-collections.js +2 -1
- package/dist/commands/mcp/list-collections.js.map +1 -1
- package/dist/commands/mcp/serve.d.ts.map +1 -1
- package/dist/commands/mcp/serve.js +3 -2
- package/dist/commands/mcp/serve.js.map +1 -1
- package/dist/commands/okf/index.d.ts +11 -0
- package/dist/commands/okf/index.d.ts.map +1 -0
- package/dist/commands/okf/index.js +116 -0
- package/dist/commands/okf/index.js.map +1 -0
- package/dist/commands/okf/validate.d.ts +195 -0
- package/dist/commands/okf/validate.d.ts.map +1 -0
- package/dist/commands/okf/validate.js +199 -0
- package/dist/commands/okf/validate.js.map +1 -0
- package/dist/commands/phase-utils.d.ts +182 -114
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +154 -163
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/positional-args.d.ts.map +1 -1
- package/dist/commands/positional-args.js +3 -2
- package/dist/commands/positional-args.js.map +1 -1
- package/dist/commands/rag/clear-command.d.ts.map +1 -1
- package/dist/commands/rag/clear-command.js +2 -1
- package/dist/commands/rag/clear-command.js.map +1 -1
- package/dist/commands/rag/index-command.d.ts +64 -0
- package/dist/commands/rag/index-command.d.ts.map +1 -1
- package/dist/commands/rag/index-command.js +72 -6
- package/dist/commands/rag/index-command.js.map +1 -1
- package/dist/commands/rag/index.d.ts.map +1 -1
- package/dist/commands/rag/index.js +23 -10
- package/dist/commands/rag/index.js.map +1 -1
- package/dist/commands/rag/query-command.d.ts.map +1 -1
- package/dist/commands/rag/query-command.js +2 -1
- package/dist/commands/rag/query-command.js.map +1 -1
- package/dist/commands/rag/stats-command.d.ts.map +1 -1
- package/dist/commands/rag/stats-command.js +2 -1
- package/dist/commands/rag/stats-command.js.map +1 -1
- package/dist/commands/resources/builtin-help.d.ts +27 -0
- package/dist/commands/resources/builtin-help.d.ts.map +1 -0
- package/dist/commands/resources/builtin-help.js +46 -0
- package/dist/commands/resources/builtin-help.js.map +1 -0
- package/dist/commands/resources/check-progress.d.ts +167 -0
- package/dist/commands/resources/check-progress.d.ts.map +1 -0
- package/dist/commands/resources/check-progress.js +250 -0
- package/dist/commands/resources/check-progress.js.map +1 -0
- package/dist/commands/resources/check-supervisor.d.ts +479 -0
- package/dist/commands/resources/check-supervisor.d.ts.map +1 -0
- package/dist/commands/resources/check-supervisor.js +587 -0
- package/dist/commands/resources/check-supervisor.js.map +1 -0
- package/dist/commands/resources/check.d.ts +620 -0
- package/dist/commands/resources/check.d.ts.map +1 -0
- package/dist/commands/resources/check.js +1452 -0
- package/dist/commands/resources/check.js.map +1 -0
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +430 -4
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/query.d.ts +106 -0
- package/dist/commands/resources/query.d.ts.map +1 -0
- package/dist/commands/resources/query.js +177 -0
- package/dist/commands/resources/query.js.map +1 -0
- package/dist/commands/resources/scan.d.ts +24 -0
- package/dist/commands/resources/scan.d.ts.map +1 -1
- package/dist/commands/resources/scan.js +17 -8
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/commands/resources/validate.d.ts +42 -2
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +208 -55
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review-checklist.d.ts +3 -2
- package/dist/commands/skill/review-checklist.d.ts.map +1 -1
- package/dist/commands/skill/review-checklist.js +40 -2
- package/dist/commands/skill/review-checklist.js.map +1 -1
- package/dist/commands/skill/review.d.ts +247 -0
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +100 -62
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skill/test/configure.d.ts +56 -0
- package/dist/commands/skill/test/configure.d.ts.map +1 -1
- package/dist/commands/skill/test/configure.js +75 -16
- package/dist/commands/skill/test/configure.js.map +1 -1
- package/dist/commands/skill/test/run.d.ts +63 -10
- package/dist/commands/skill/test/run.d.ts.map +1 -1
- package/dist/commands/skill/test/run.js +258 -77
- package/dist/commands/skill/test/run.js.map +1 -1
- package/dist/commands/skills/build.d.ts +94 -4
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +325 -97
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/install.d.ts +2 -1
- package/dist/commands/skills/install.d.ts.map +1 -1
- package/dist/commands/skills/install.js +20 -31
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/skills/list.d.ts +2 -1
- package/dist/commands/skills/list.d.ts.map +1 -1
- package/dist/commands/skills/list.js +44 -26
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/package.d.ts +1 -1
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +6 -8
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/scope-guard.d.ts.map +1 -1
- package/dist/commands/skills/scope-guard.js +8 -6
- package/dist/commands/skills/scope-guard.js.map +1 -1
- package/dist/commands/skills/shared.d.ts.map +1 -1
- package/dist/commands/skills/shared.js +2 -4
- package/dist/commands/skills/shared.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts +47 -6
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +61 -11
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/source-resolvers.d.ts +15 -0
- package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
- package/dist/commands/skills/source-resolvers.js +25 -4
- 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 +11 -3
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate.d.ts +140 -4
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +224 -67
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/validate.d.ts +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +63 -27
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +119 -15
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +357 -142
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/report-schemas.d.ts +45 -0
- package/dist/report-schemas.d.ts.map +1 -0
- package/dist/report-schemas.js +100 -0
- package/dist/report-schemas.js.map +1 -0
- package/dist/skill-resolution/classify.js +2 -2
- package/dist/skill-resolution/classify.js.map +1 -1
- package/dist/skill-resolution/packaging-config.d.ts +49 -5
- package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
- package/dist/skill-resolution/packaging-config.js +59 -19
- 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 +55 -57
- package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
- package/dist/utils/agent-discovery.d.ts.map +1 -1
- package/dist/utils/agent-discovery.js +22 -11
- package/dist/utils/agent-discovery.js.map +1 -1
- package/dist/utils/agent-runner.d.ts.map +1 -1
- package/dist/utils/agent-runner.js +7 -4
- package/dist/utils/agent-runner.js.map +1 -1
- package/dist/utils/claude-context-lens.d.ts +34 -0
- package/dist/utils/claude-context-lens.d.ts.map +1 -0
- package/dist/utils/claude-context-lens.js +39 -0
- package/dist/utils/claude-context-lens.js.map +1 -0
- package/dist/utils/command-error.d.ts +143 -20
- package/dist/utils/command-error.d.ts.map +1 -1
- package/dist/utils/command-error.js +179 -36
- package/dist/utils/command-error.js.map +1 -1
- package/dist/utils/config-loader.d.ts +2 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +40 -14
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/corpus-target.d.ts +26 -0
- package/dist/utils/corpus-target.d.ts.map +1 -0
- package/dist/utils/corpus-target.js +72 -0
- package/dist/utils/corpus-target.js.map +1 -0
- package/dist/utils/edge-lens-evaluation.d.ts +83 -0
- package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
- package/dist/utils/edge-lens-evaluation.js +110 -0
- package/dist/utils/edge-lens-evaluation.js.map +1 -0
- package/dist/utils/help-loader.d.ts.map +1 -1
- package/dist/utils/help-loader.js +0 -1
- package/dist/utils/help-loader.js.map +1 -1
- package/dist/utils/issue-anchor.d.ts +2 -2
- package/dist/utils/issue-anchor.d.ts.map +1 -1
- package/dist/utils/issue-anchor.js +1 -1
- package/dist/utils/issue-rendering.d.ts +3 -3
- package/dist/utils/issue-rendering.d.ts.map +1 -1
- package/dist/utils/issue-rendering.js +3 -3
- package/dist/utils/issue-rendering.js.map +1 -1
- package/dist/utils/issue-severity.d.ts +12 -5
- package/dist/utils/issue-severity.d.ts.map +1 -1
- package/dist/utils/issue-severity.js +1 -1
- package/dist/utils/issue-severity.js.map +1 -1
- package/dist/utils/optional-backend.d.ts +78 -0
- package/dist/utils/optional-backend.d.ts.map +1 -0
- package/dist/utils/optional-backend.js +117 -0
- package/dist/utils/optional-backend.js.map +1 -0
- package/dist/utils/output.d.ts +26 -0
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +35 -0
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/package-json.d.ts +24 -0
- package/dist/utils/package-json.d.ts.map +1 -0
- package/dist/utils/package-json.js +49 -0
- package/dist/utils/package-json.js.map +1 -0
- package/dist/utils/population-wiring.d.ts +100 -0
- package/dist/utils/population-wiring.d.ts.map +1 -0
- package/dist/utils/population-wiring.js +98 -0
- package/dist/utils/population-wiring.js.map +1 -0
- package/dist/utils/project-root-policy.d.ts +20 -0
- package/dist/utils/project-root-policy.d.ts.map +1 -1
- package/dist/utils/project-root-policy.js +30 -0
- package/dist/utils/project-root-policy.js.map +1 -1
- package/dist/utils/projection-lenses.d.ts +98 -0
- package/dist/utils/projection-lenses.d.ts.map +1 -0
- package/dist/utils/projection-lenses.js +203 -0
- package/dist/utils/projection-lenses.js.map +1 -0
- package/dist/utils/projection-query.d.ts +324 -0
- package/dist/utils/projection-query.d.ts.map +1 -0
- package/dist/utils/projection-query.js +357 -0
- package/dist/utils/projection-query.js.map +1 -0
- package/dist/utils/projection-store.d.ts +335 -0
- package/dist/utils/projection-store.d.ts.map +1 -0
- package/dist/utils/projection-store.js +522 -0
- package/dist/utils/projection-store.js.map +1 -0
- package/dist/utils/relation-limits.d.ts +50 -0
- package/dist/utils/relation-limits.d.ts.map +1 -0
- package/dist/utils/relation-limits.js +50 -0
- package/dist/utils/relation-limits.js.map +1 -0
- package/dist/utils/repeatable-option.d.ts +37 -0
- package/dist/utils/repeatable-option.d.ts.map +1 -0
- package/dist/utils/repeatable-option.js +39 -0
- package/dist/utils/repeatable-option.js.map +1 -0
- package/dist/utils/resource-loader.d.ts +134 -2
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +290 -27
- package/dist/utils/resource-loader.js.map +1 -1
- package/dist/utils/root-argv.d.ts +53 -0
- package/dist/utils/root-argv.d.ts.map +1 -0
- package/dist/utils/root-argv.js +215 -0
- package/dist/utils/root-argv.js.map +1 -0
- package/dist/utils/run-integrity.d.ts +95 -0
- package/dist/utils/run-integrity.d.ts.map +1 -0
- package/dist/utils/run-integrity.js +102 -0
- package/dist/utils/run-integrity.js.map +1 -0
- package/dist/utils/skill-discovery.d.ts.map +1 -1
- package/dist/utils/skill-discovery.js +2 -1
- package/dist/utils/skill-discovery.js.map +1 -1
- package/dist/utils/skill-packaging-config.d.ts +63 -1
- package/dist/utils/skill-packaging-config.d.ts.map +1 -1
- package/dist/utils/skill-packaging-config.js +56 -1
- package/dist/utils/skill-packaging-config.js.map +1 -1
- package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
- package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
- package/dist/utils/sqlite-experimental-warning.js +144 -0
- package/dist/utils/sqlite-experimental-warning.js.map +1 -0
- package/dist/utils/url-redact.d.ts.map +1 -1
- package/dist/utils/url-redact.js +4 -6
- package/dist/utils/url-redact.js.map +1 -1
- package/dist/utils/user-context-scanner.d.ts +8 -0
- package/dist/utils/user-context-scanner.d.ts.map +1 -1
- package/dist/utils/user-context-scanner.js +4 -2
- 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 +12 -6
- package/dist/utils/validate-help-files.js.map +1 -1
- package/dist/utils/vat-bin-path.d.ts +36 -0
- package/dist/utils/vat-bin-path.d.ts.map +1 -0
- package/dist/utils/vat-bin-path.js +48 -0
- package/dist/utils/vat-bin-path.js.map +1 -0
- package/dist/utils/verdict-helpers.d.ts +1 -1
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +1 -1
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -3
- package/dist/version.js.map +1 -1
- package/docs/agent.md +2 -2
- package/docs/audit.md +143 -39
- package/docs/doctor.md +7 -6
- package/docs/index.md +19 -11
- package/docs/mcp.md +2 -2
- package/docs/rag.md +3 -2
- package/docs/resources.md +13 -3
- package/docs/skill-test.md +10 -9
- package/docs/skills.md +53 -69
- package/package.json +36 -27
- package/schemas/ard-emit.json +152 -0
- package/schemas/okf-validate.json +170 -0
- package/schemas/resources-check.json +257 -0
- package/schemas/skill-review.json +230 -0
- package/dist/commands/resources/command-helpers.d.ts +0 -5
- package/dist/commands/resources/command-helpers.d.ts.map +0 -1
- package/dist/commands/resources/command-helpers.js +0 -6
- package/dist/commands/resources/command-helpers.js.map +0 -1
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vat ard emit` — write the project's `/.well-known/ard.json`.
|
|
3
|
+
*
|
|
4
|
+
* **Emit, never depend.** This command produces a document and stops. Nothing
|
|
5
|
+
* in VAT reads one back, and no VAT behaviour is derived from one — ARD is
|
|
6
|
+
* v0.91, status Proposal, and wiring internals to a moving shape is the cost
|
|
7
|
+
* this rule avoids.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import { ArdDerivationError, buildArdEntries, buildArdManifest, findShadowedArdOverrideKeys, writeArdManifest, } from '@vibe-agent-toolkit/resources';
|
|
11
|
+
import { buildReport, exitCodeForReport, reportSchema } from '@vibe-agent-toolkit/schema';
|
|
12
|
+
import { safePath, VatError } from '@vibe-agent-toolkit/utils';
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { handleReportCommandError, handleReportExpectedFailure } from '../../utils/command-error.js';
|
|
15
|
+
import { loadConfig } from '../../utils/config-loader.js';
|
|
16
|
+
import { createLogger } from '../../utils/logger.js';
|
|
17
|
+
import { writeJsonOutput } from '../../utils/output.js';
|
|
18
|
+
import { readPackageJsonOrAbsent } from '../../utils/package-json.js';
|
|
19
|
+
import { discoverSkillsFromConfig } from '../skills/skill-discovery.js';
|
|
20
|
+
import { collectArdSurfaces } from './surfaces.js';
|
|
21
|
+
/** Default destination, relative to the project root — the path ARD publishes at. */
|
|
22
|
+
export const DEFAULT_ARD_OUTPUT = '.well-known/ard.json';
|
|
23
|
+
/** The config filename every VAT project declares its surfaces in. */
|
|
24
|
+
const CONFIG_FILENAME = 'vibe-agent-toolkit.config.yaml';
|
|
25
|
+
/** No manifest could be built, and this says which absence caused it. */
|
|
26
|
+
export class ArdConfigMissingError extends VatError {
|
|
27
|
+
projectRoot;
|
|
28
|
+
absence;
|
|
29
|
+
constructor(projectRoot, absence) {
|
|
30
|
+
super('ARD_CONFIG_MISSING', ABSENCE_MESSAGES[absence](projectRoot));
|
|
31
|
+
this.projectRoot = projectRoot;
|
|
32
|
+
this.absence = absence;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const ABSENCE_MESSAGES = {
|
|
36
|
+
'no-project-root': (projectRoot) => `Project root ${projectRoot} does not exist. Pass --project-root a directory that does, or ` +
|
|
37
|
+
'run `vat ard emit` from inside the project.',
|
|
38
|
+
'no-config-file': (projectRoot) => `No ${CONFIG_FILENAME} found in ${projectRoot}. ` +
|
|
39
|
+
'ARD entries are derived from the surfaces that file declares, so there is nothing to emit.',
|
|
40
|
+
'no-ard-block': (projectRoot) => `No \`ard:\` configuration found for ${projectRoot}. ` +
|
|
41
|
+
`Add an \`ard:\` block with a \`publisher\` domain to ${CONFIG_FILENAME}.`,
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The project's own package version, when it has one.
|
|
45
|
+
*
|
|
46
|
+
* The npm package version is the only version this project recognises, and an
|
|
47
|
+
* adopter's is the only one VAT can honestly stamp on an entry. Absent, the
|
|
48
|
+
* field is simply omitted. A `package.json` that is there and is not JSON is
|
|
49
|
+
* refused by name instead: it used to be read as "no version" too, and a
|
|
50
|
+
* manifest emitted with no `version` from a tree npm itself cannot read is a
|
|
51
|
+
* manifest that hid the one fact worth reporting.
|
|
52
|
+
*/
|
|
53
|
+
function readProjectVersion(projectRoot) {
|
|
54
|
+
const parsed = readPackageJsonOrAbsent(safePath.join(projectRoot, 'package.json'));
|
|
55
|
+
const version = parsed?.['version'];
|
|
56
|
+
// `""` is ABSENT, not a version. A `package.json` carrying it emitted
|
|
57
|
+
// `"version": ""` on every entry at exit 0 — a field asserting a version
|
|
58
|
+
// that does not exist. The entry schema now refuses it too, so leaving this
|
|
59
|
+
// would turn a blank field into a hard emission failure instead.
|
|
60
|
+
if (typeof version !== 'string' || version === '')
|
|
61
|
+
return undefined;
|
|
62
|
+
return version;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Build and write the manifest.
|
|
66
|
+
*
|
|
67
|
+
* @throws {ArdConfigMissingError} when no config, or no `ard:` block, is found.
|
|
68
|
+
* @throws {ArdDerivationError} when a surface cannot be turned into a
|
|
69
|
+
* conformant entry — a missing `ard.baseUrl`, an unusable URN segment, or a
|
|
70
|
+
* trust identity that does not align with the publisher.
|
|
71
|
+
*/
|
|
72
|
+
export async function runArdEmit(options) {
|
|
73
|
+
const projectRoot = options.projectRoot ?? process.cwd();
|
|
74
|
+
if (!existsSync(projectRoot)) {
|
|
75
|
+
throw new ArdConfigMissingError(projectRoot, 'no-project-root');
|
|
76
|
+
}
|
|
77
|
+
const config = loadConfig(projectRoot);
|
|
78
|
+
if (config === undefined) {
|
|
79
|
+
throw new ArdConfigMissingError(projectRoot, 'no-config-file');
|
|
80
|
+
}
|
|
81
|
+
const ard = config.ard;
|
|
82
|
+
if (ard === undefined) {
|
|
83
|
+
throw new ArdConfigMissingError(projectRoot, 'no-ard-block');
|
|
84
|
+
}
|
|
85
|
+
const { surfaces, skipped } = collectArdSurfaces(config, {
|
|
86
|
+
version: readProjectVersion(projectRoot),
|
|
87
|
+
// The SAME discovery `vat verify` runs, so the two commands cannot disagree
|
|
88
|
+
// about which skills this project has. Omitted entirely when the project
|
|
89
|
+
// declares no `skills` block: there is nothing to cross-check, and passing
|
|
90
|
+
// `[]` would claim discovery ran and found nothing.
|
|
91
|
+
...(config.skills === undefined
|
|
92
|
+
? {}
|
|
93
|
+
: {
|
|
94
|
+
// `'refuse'`: a manifest cross-checked against a partial skill list
|
|
95
|
+
// would advertise or omit entries on a population it never saw. The
|
|
96
|
+
// throw is an invocation failure → exit 2 (see the catch in
|
|
97
|
+
// `ardEmitCommand`).
|
|
98
|
+
discoveredSkills: (await discoverSkillsFromConfig(config.skills, projectRoot, 'refuse')).map((skill) => skill.name),
|
|
99
|
+
}),
|
|
100
|
+
});
|
|
101
|
+
const manifest = buildArdManifest(buildArdEntries(surfaces, ard));
|
|
102
|
+
const outputPath = safePath.resolve(projectRoot, options.output ?? DEFAULT_ARD_OUTPUT);
|
|
103
|
+
await writeArdManifest(manifest, outputPath);
|
|
104
|
+
return {
|
|
105
|
+
outputPath,
|
|
106
|
+
entryCount: manifest.entries.length,
|
|
107
|
+
skipped,
|
|
108
|
+
shadowed: findShadowedArdOverrideKeys(surfaces, ard),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The codes this run's findings carry. Not registry codes: nothing here is a
|
|
113
|
+
* validation an adopter tunes through `validation.severity` — a skipped
|
|
114
|
+
* surface is a fact about what the manifest could not advertise, and its
|
|
115
|
+
* severity is the run's to decide.
|
|
116
|
+
*/
|
|
117
|
+
export const ARD_EMIT_CODES = {
|
|
118
|
+
/** A configured surface that became no entry, and why — the thing `--strict` gates. */
|
|
119
|
+
SURFACE_SKIPPED: 'ARD_SURFACE_SKIPPED',
|
|
120
|
+
/**
|
|
121
|
+
* A bare `ard.entries` key a qualified key for the same surface outranked.
|
|
122
|
+
* Not a failure — the precedence is deterministic and documented — but the
|
|
123
|
+
* losing block is dead config, and an author cannot see that from the file.
|
|
124
|
+
*/
|
|
125
|
+
OVERRIDE_KEY_SHADOWED: 'ARD_OVERRIDE_KEY_SHADOWED',
|
|
126
|
+
/**
|
|
127
|
+
* The project was read and declares no `ard:` block, so no manifest was
|
|
128
|
+
* built. A finding at `error` — exit 1 — because the PROJECT is the subject,
|
|
129
|
+
* not the invocation: it is fixed by editing config.
|
|
130
|
+
*/
|
|
131
|
+
NOT_CONFIGURED: 'ARD_NOT_CONFIGURED',
|
|
132
|
+
/** A declared surface could not be derived into a conformant entry, so no manifest was written. */
|
|
133
|
+
DERIVATION_FAILED: 'ARD_DERIVATION_FAILED',
|
|
134
|
+
/** `--strict` refused a manifest that leaves a declared surface (or everything) unadvertised. */
|
|
135
|
+
STRICT_REFUSED: 'ARD_STRICT_REFUSED',
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* What the run reports beyond its findings.
|
|
139
|
+
*
|
|
140
|
+
* 🪤 `entryCount: 0` is the empty manifest. A run that wrote `{"entries":[]}`
|
|
141
|
+
* and one that wrote a full catalogue both used to end at exit 0 with a
|
|
142
|
+
* cheerful line on stdout, and nothing a machine could read told them apart —
|
|
143
|
+
* so a CI step that emits and publishes was green over a discovery document
|
|
144
|
+
* advertising nothing. The envelope's `examined` is every configured surface
|
|
145
|
+
* the run considered, so "nothing declared" (`examined: 0`) and "everything
|
|
146
|
+
* declared was skipped" (`examined: N`, `entryCount: 0`) read differently too.
|
|
147
|
+
*/
|
|
148
|
+
export const ArdEmitDataSchema = z.object({
|
|
149
|
+
/** Where the manifest was written — `null` when the project produced none. */
|
|
150
|
+
outputPath: z.string().nullable(),
|
|
151
|
+
entryCount: z.number().int().nonnegative(),
|
|
152
|
+
/**
|
|
153
|
+
* Counts BESIDE the findings. The count is what a CI step gates on without
|
|
154
|
+
* a JSON path into an array; the finding is what the human it pages then
|
|
155
|
+
* acts on. Publishing only one of them answers "how many" or "which", never
|
|
156
|
+
* both.
|
|
157
|
+
*/
|
|
158
|
+
skippedCount: z.number().int().nonnegative(),
|
|
159
|
+
shadowedCount: z.number().int().nonnegative(),
|
|
160
|
+
}).strict();
|
|
161
|
+
/** The document `--format json` publishes. */
|
|
162
|
+
export const ARD_EMIT_REPORT_SCHEMA = reportSchema(ArdEmitDataSchema);
|
|
163
|
+
/** The finding one skipped surface becomes. Its text is the stderr line, so the two channels agree. */
|
|
164
|
+
function skippedFinding(item) {
|
|
165
|
+
return {
|
|
166
|
+
code: ARD_EMIT_CODES.SURFACE_SKIPPED,
|
|
167
|
+
severity: 'warning',
|
|
168
|
+
message: `skipped ${item.kind} "${item.name}": ${item.reason}`,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/** The finding one shadowed override key becomes, pointing at the dead config block. */
|
|
172
|
+
function shadowedFinding(item) {
|
|
173
|
+
return {
|
|
174
|
+
code: ARD_EMIT_CODES.OVERRIDE_KEY_SHADOWED,
|
|
175
|
+
severity: 'info',
|
|
176
|
+
message: `ignored \`ard.entries.${item.shadowedKey}\`: the ${item.kind} "${item.name}" is also named ` +
|
|
177
|
+
`by \`ard.entries."${item.winningKey}"\`, and the kind-qualified key wins. Nothing in the ` +
|
|
178
|
+
'bare block was read — fold it into the qualified one or delete it.',
|
|
179
|
+
field: `ard.entries.${item.shadowedKey}`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/** Pure: the report a result becomes, so the status rule is unit-testable. */
|
|
183
|
+
export function buildArdEmitReport(result) {
|
|
184
|
+
return buildReport({
|
|
185
|
+
// Every configured surface the run considered: the ones that became
|
|
186
|
+
// entries and the ones it had to skip.
|
|
187
|
+
examined: result.entryCount + result.skipped.length,
|
|
188
|
+
findings: [...result.skipped.map(skippedFinding), ...result.shadowed.map(shadowedFinding)],
|
|
189
|
+
data: {
|
|
190
|
+
outputPath: result.outputPath,
|
|
191
|
+
entryCount: result.entryCount,
|
|
192
|
+
skippedCount: result.skipped.length,
|
|
193
|
+
shadowedCount: result.shadowed.length,
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Why `--strict` fails this run, or `undefined` when it does not.
|
|
199
|
+
*
|
|
200
|
+
* ⚠️ A shadowed override key is deliberately NOT a strict failure: the
|
|
201
|
+
* precedence is deterministic and documented, the entry is still emitted, and
|
|
202
|
+
* nothing about the published manifest is wrong. What `--strict` gates is the
|
|
203
|
+
* manifest's CONTENT — a surface an author declared and a consumer will never
|
|
204
|
+
* see, and the empty document that is the limit case of that.
|
|
205
|
+
*/
|
|
206
|
+
function strictFailure(report) {
|
|
207
|
+
const { skippedCount, entryCount } = report.data;
|
|
208
|
+
if (skippedCount > 0) {
|
|
209
|
+
const surfaces = skippedCount === 1 ? '1 configured surface was' : `${skippedCount} configured surfaces were`;
|
|
210
|
+
// Not "see above": in `--format json` the reasons are IN the report, not on
|
|
211
|
+
// stderr, so a message naming a position would be wrong on one of the two
|
|
212
|
+
// channels.
|
|
213
|
+
return `--strict: ${surfaces} not advertised — each is named, with its reason, in this run's \`findings\`.`;
|
|
214
|
+
}
|
|
215
|
+
if (entryCount === 0) {
|
|
216
|
+
return '--strict: the manifest advertises nothing. Nothing this project declares became an ARD entry.';
|
|
217
|
+
}
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* The report for a project VAT read and could build no manifest for.
|
|
222
|
+
*
|
|
223
|
+
* 🚨 These endings used to publish the envelope's ERROR branch (`status:
|
|
224
|
+
* error`) and exit 1 — a document saying "could not do its job" beside a code
|
|
225
|
+
* saying "the project failed its gate". They are findings about the project,
|
|
226
|
+
* so they are published as findings and the code is derived from them.
|
|
227
|
+
*
|
|
228
|
+
* @param code - Which refusal
|
|
229
|
+
* @param message - What the operator must change
|
|
230
|
+
* @returns The report, at `error` severity, with nothing written
|
|
231
|
+
*/
|
|
232
|
+
function buildArdRefusalReport(code, message) {
|
|
233
|
+
return buildReport({
|
|
234
|
+
examined: 0,
|
|
235
|
+
findings: [{ code, severity: 'error', message }],
|
|
236
|
+
data: { outputPath: null, entryCount: 0, skippedCount: 0, shadowedCount: 0 },
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The report `--strict` publishes: the same one, with the refusal as a finding.
|
|
241
|
+
*
|
|
242
|
+
* It used to be a stderr line beside a document that still said `status: ok`,
|
|
243
|
+
* and an exit 1 the document did not explain.
|
|
244
|
+
*
|
|
245
|
+
* @param report - What the run built
|
|
246
|
+
* @returns The report, with a `STRICT_REFUSED` error when `--strict` refuses it
|
|
247
|
+
*/
|
|
248
|
+
function withStrictVerdict(report) {
|
|
249
|
+
const failure = strictFailure(report);
|
|
250
|
+
if (failure === undefined)
|
|
251
|
+
return report;
|
|
252
|
+
return {
|
|
253
|
+
...buildReport({
|
|
254
|
+
examined: report.examined,
|
|
255
|
+
findings: [...report.findings, { code: ARD_EMIT_CODES.STRICT_REFUSED, severity: 'error', message: failure }],
|
|
256
|
+
data: report.data,
|
|
257
|
+
}),
|
|
258
|
+
...(report.durationMs === undefined ? {} : { durationMs: report.durationMs }),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
/** The human rendering: findings on stderr, the one summary line on stdout. */
|
|
262
|
+
function writeArdEmitText(report) {
|
|
263
|
+
for (const finding of report.findings) {
|
|
264
|
+
process.stderr.write(`${finding.message}\n`);
|
|
265
|
+
}
|
|
266
|
+
const { entryCount, outputPath } = report.data;
|
|
267
|
+
if (outputPath !== null) {
|
|
268
|
+
process.stdout.write(`Wrote ${entryCount} ARD entr${entryCount === 1 ? 'y' : 'ies'} to ${outputPath}\n`);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Publish a report in the operator's format and end on the code it DERIVES.
|
|
273
|
+
*
|
|
274
|
+
* @param report - The document
|
|
275
|
+
* @param format - `json`, or anything else for the human rendering
|
|
276
|
+
*/
|
|
277
|
+
function publishArdReport(report, format) {
|
|
278
|
+
if (format === 'json') {
|
|
279
|
+
// The report carries every skipped and shadowed surface in full, so the
|
|
280
|
+
// stderr lines would be the same facts twice on two channels.
|
|
281
|
+
writeJsonOutput(report);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
writeArdEmitText(report);
|
|
285
|
+
}
|
|
286
|
+
process.exit(exitCodeForReport(report));
|
|
287
|
+
}
|
|
288
|
+
/** Action handler for `vat ard emit`. */
|
|
289
|
+
export async function ardEmitCommand(options) {
|
|
290
|
+
const logger = createLogger(options.debug === true ? { debug: true } : {});
|
|
291
|
+
const startTime = Date.now();
|
|
292
|
+
try {
|
|
293
|
+
const built = { ...buildArdEmitReport(await runArdEmit(options)), durationMs: Date.now() - startTime };
|
|
294
|
+
publishArdReport(options.strict === true ? withStrictVerdict(built) : built, options.format);
|
|
295
|
+
}
|
|
296
|
+
catch (error) {
|
|
297
|
+
// 🔑 THE RULE, in one sentence: **exit 1 means VAT read this project and
|
|
298
|
+
// produced no manifest by its own rules — it declares no `ard:` block, or a
|
|
299
|
+
// surface could not be derived into a conformant entry; exit 2 means VAT
|
|
300
|
+
// never got that far — no project root, no config file, a config it cannot
|
|
301
|
+
// parse, or an unexpected internal failure.**
|
|
302
|
+
//
|
|
303
|
+
// ⚠️ Not "1 is reserved for a check that ran and failed": `ard emit` is not
|
|
304
|
+
// a check, and "no `ard:` block" is not a failed one. The distinction that
|
|
305
|
+
// matters to a caller is whether the PROJECT is the subject (1) or the
|
|
306
|
+
// INVOCATION is (2) — the first is fixed by editing config, the second by
|
|
307
|
+
// fixing the command line or the file itself. A CI job that tolerates
|
|
308
|
+
// repositories which have not opted into ARD keys on exactly that split.
|
|
309
|
+
//
|
|
310
|
+
// Exit 2 is also what `vat okf validate` documents for the same conditions,
|
|
311
|
+
// and what an invalid config already did here through `handleReportCommandError`.
|
|
312
|
+
// The old split had a missing config file exiting 1 and an invalid one
|
|
313
|
+
// exiting 2 while the help called 2 "Unexpected internal failure" — so a CI
|
|
314
|
+
// job reading 2 as a crash was paged for a typo.
|
|
315
|
+
//
|
|
316
|
+
// ⚠️ Both endings publish their document through `handleReportExpectedFailure`,
|
|
317
|
+
// in the format the operator asked for. Written inline they published
|
|
318
|
+
// NOTHING — a `--format json` run of the commonest case of all, a
|
|
319
|
+
// repository that never opted into ARD, wrote zero bytes to stdout and left
|
|
320
|
+
// a CI wrapper parsing stderr for a fact the report is supposed to carry.
|
|
321
|
+
//
|
|
322
|
+
// 🪤 `return` the call, though its type is `never`: under test `process.exit`
|
|
323
|
+
// is a spy that RETURNS, so a bare call falls through to the handler below
|
|
324
|
+
// and the run records a second exit — the same reason the inline endings
|
|
325
|
+
// this replaced each carried a `return`.
|
|
326
|
+
if (error instanceof ArdConfigMissingError && error.absence === 'no-ard-block') {
|
|
327
|
+
return publishArdReport({ ...buildArdRefusalReport(ARD_EMIT_CODES.NOT_CONFIGURED, error.message), durationMs: Date.now() - startTime }, options.format);
|
|
328
|
+
}
|
|
329
|
+
if (error instanceof ArdDerivationError) {
|
|
330
|
+
return publishArdReport({ ...buildArdRefusalReport(ARD_EMIT_CODES.DERIVATION_FAILED, error.message), durationMs: Date.now() - startTime }, options.format);
|
|
331
|
+
}
|
|
332
|
+
if (error instanceof ArdConfigMissingError) {
|
|
333
|
+
return handleReportExpectedFailure(error.message, startTime, options.format);
|
|
334
|
+
}
|
|
335
|
+
handleReportCommandError(error, logger, startTime, 'ARD emit', options.format);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=emit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../../src/commands/ard/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,gBAAgB,G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,IAAI,KAAK,YAAY,qBAAqB,IAAI,KAAK,CAAC,OAAO,KAAK,cAAc,EAAE,CAAC;YAC/E,OAAO,gBAAgB,CACrB,EAAE,GAAG,qBAAqB,CAAC,cAAc,CAAC,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,EAC9G,OAAO,CAAC,MAAM,CACf,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;YACxC,OAAO,gBAAgB,CACrB,EAAE,GAAG,qBAAqB,CAAC,cAAc,CAAC,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,EACjH,OAAO,CAAC,MAAM,CACf,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,YAAY,qBAAqB,EAAE,CAAC;YAC3C,OAAO,2BAA2B,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/E,CAAC;QACD,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACjF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vat ard` — Agentic Resource Discovery emission.
|
|
3
|
+
*
|
|
4
|
+
* Not registered in `command-loaders.ts` by this module: the loader table is
|
|
5
|
+
* owned elsewhere, and this file only builds the command.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
export { ardEmitCommand, buildArdEmitReport, runArdEmit, ArdConfigMissingError, DEFAULT_ARD_OUTPUT, type ArdEmitReport, } from './emit.js';
|
|
9
|
+
export { collectArdSurfaces, type ArdSurfaceCollection, type SkippedArdSurface } from './surfaces.js';
|
|
10
|
+
/** Build the `vat ard` command group. */
|
|
11
|
+
export declare function createArdCommand(): Command;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/ard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,aAAa,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtG,yCAAyC;AACzC,wBAAgB,gBAAgB,IAAI,OAAO,CAoF1C"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vat ard` — Agentic Resource Discovery emission.
|
|
3
|
+
*
|
|
4
|
+
* Not registered in `command-loaders.ts` by this module: the loader table is
|
|
5
|
+
* owned elsewhere, and this file only builds the command.
|
|
6
|
+
*/
|
|
7
|
+
import { Command, Option } from 'commander';
|
|
8
|
+
import { ardEmitCommand, DEFAULT_ARD_OUTPUT } from './emit.js';
|
|
9
|
+
export { ardEmitCommand, buildArdEmitReport, runArdEmit, ArdConfigMissingError, DEFAULT_ARD_OUTPUT, } from './emit.js';
|
|
10
|
+
export { collectArdSurfaces } from './surfaces.js';
|
|
11
|
+
/** Build the `vat ard` command group. */
|
|
12
|
+
export function createArdCommand() {
|
|
13
|
+
const ard = new Command('ard');
|
|
14
|
+
ard.description('Emit an Agentic Resource Discovery (ARD) manifest for this project').addHelpText('after', `
|
|
15
|
+
Description:
|
|
16
|
+
ARD has no registry and no upload: a publisher hosts a JSON-LD document at
|
|
17
|
+
https://{domain}/.well-known/ard.json and registries crawl it. VAT builds that
|
|
18
|
+
document out of the surfaces this project already declares.
|
|
19
|
+
|
|
20
|
+
⚠️ ARD is v0.91, status Proposal. VAT emits against it and reads nothing back.
|
|
21
|
+
`);
|
|
22
|
+
ard
|
|
23
|
+
.command('emit')
|
|
24
|
+
.description('Build the ARD manifest and write it to disk')
|
|
25
|
+
.option('-o, --output <path>', `Output path (default: ${DEFAULT_ARD_OUTPUT})`)
|
|
26
|
+
.option('--project-root <dir>', 'Project root to read the config from (default: cwd)')
|
|
27
|
+
.addOption(
|
|
28
|
+
// Rejected by Commander rather than falling through to `text`, as the
|
|
29
|
+
// sibling `vat okf validate` does: `--format Json` in a pipeline must
|
|
30
|
+
// fail HERE, where the mistake is, not downstream in `jq`.
|
|
31
|
+
new Option('--format <format>', 'Output format: text (default) or json')
|
|
32
|
+
.choices(['text', 'json'])
|
|
33
|
+
.default('text'))
|
|
34
|
+
.option('--strict', 'Exit 1 when the manifest advertises nothing, or a configured surface was skipped')
|
|
35
|
+
.option('--debug', 'Verbose logging to stderr')
|
|
36
|
+
.action(ardEmitCommand)
|
|
37
|
+
.addHelpText('after', `
|
|
38
|
+
Derivation:
|
|
39
|
+
Every published skill in \`skills.config\` becomes an entry, typed
|
|
40
|
+
application/ai-skill+md — a media type VAT COINS, since the specification
|
|
41
|
+
names none for a skill (it occurs once, in an example).
|
|
42
|
+
|
|
43
|
+
A marketplace, an OKF bundle and an MCP server are emitted ONLY when the
|
|
44
|
+
author supplies \`ard.entries."<kind>:<name>".type\`; the specification names
|
|
45
|
+
no media type for any of them, and VAT does not guess. Skipped surfaces are
|
|
46
|
+
reported on stderr — including a \`skills.config\` key that discovery does not
|
|
47
|
+
find, which is never advertised.
|
|
48
|
+
|
|
49
|
+
\`ard.entries\` is keyed by "<kind>:<name>" — skills, marketplaces and OKF
|
|
50
|
+
bundles are independent key spaces, so a bare name that matches two of them
|
|
51
|
+
is REFUSED rather than applied to both.
|
|
52
|
+
|
|
53
|
+
\`representativeQueries\` is authored, never generated. Its absence is a
|
|
54
|
+
conformance WARNING upstream, not an error — an honest gap beats a
|
|
55
|
+
fabricated query that makes a resource discoverable for the wrong task.
|
|
56
|
+
|
|
57
|
+
Requirements:
|
|
58
|
+
ard.publisher Required — anchors every entry URN.
|
|
59
|
+
ard.baseUrl Required in practice — VAT has no inline artifact document for
|
|
60
|
+
these surfaces, so without it no entry has a \`url\` or a
|
|
61
|
+
\`data\` and emission fails.
|
|
62
|
+
|
|
63
|
+
Exit Codes:
|
|
64
|
+
0 - Manifest written — INCLUDING one that advertises nothing. An empty
|
|
65
|
+
\`entries\` list is a legal ARD document, and skipped surfaces are reported
|
|
66
|
+
on stderr at this exit code. Gate on \`--format json\` (the report
|
|
67
|
+
envelope: \`examined\`, \`findings\`, \`summary\`, \`data.entryCount\`,
|
|
68
|
+
\`data.skippedCount\`; schema: packages/cli/schemas/ard-emit.json), or
|
|
69
|
+
make both conditions fail with \`--strict\`
|
|
70
|
+
1 - No \`ard:\` block, or a surface that could not be derived — each an
|
|
71
|
+
error-severity finding about the PROJECT (ARD_NOT_CONFIGURED,
|
|
72
|
+
ARD_DERIVATION_FAILED), with \`data.outputPath\` null as nothing was
|
|
73
|
+
written. Under \`--strict\`, also an empty manifest or a skipped surface
|
|
74
|
+
(ARD_STRICT_REFUSED). The code is derived from the report, never chosen
|
|
75
|
+
beside it
|
|
76
|
+
2 - System error (no project root, no config file, invalid config, unexpected
|
|
77
|
+
internal failure)
|
|
78
|
+
|
|
79
|
+
Example:
|
|
80
|
+
$ vat ard emit --format json --strict
|
|
81
|
+
`);
|
|
82
|
+
return ard;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/ard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,kBAAkB,EAAqD,MAAM,eAAe,CAAC;AAEtG,yCAAyC;AACzC,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAE/B,GAAG,CAAC,WAAW,CAAC,oEAAoE,CAAC,CAAC,WAAW,CAC/F,OAAO,EACP;;;;;;;CAOH,CACE,CAAC;IAEF,GAAG;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,qBAAqB,EAAE,yBAAyB,kBAAkB,GAAG,CAAC;SAC7E,MAAM,CAAC,sBAAsB,EAAE,qDAAqD,CAAC;SACrF,SAAS;IACR,sEAAsE;IACtE,sEAAsE;IACtE,2DAA2D;IAC3D,IAAI,MAAM,CAAC,mBAAmB,EAAE,uCAAuC,CAAC;SACrE,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACzB,OAAO,CAAC,MAAM,CAAC,CACnB;SACA,MAAM,CACL,UAAU,EACV,kFAAkF,CACnF;SACA,MAAM,CAAC,SAAS,EAAE,2BAA2B,CAAC;SAC9C,MAAM,CAAC,cAAc,CAAC;SACtB,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CL,CACI,CAAC;IAEJ,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the project config for the surfaces an ARD manifest can advertise.
|
|
3
|
+
*
|
|
4
|
+
* Everything here is pure — config in, surfaces out — so the derivation rules
|
|
5
|
+
* are unit-testable without touching a filesystem or a manifest.
|
|
6
|
+
*
|
|
7
|
+
* ## Two collectors, because two rules
|
|
8
|
+
*
|
|
9
|
+
* A **skill** derives its media type from the surface kind alone, so every
|
|
10
|
+
* published skill becomes an entry with no author action. A **marketplace**, an
|
|
11
|
+
* **OKF bundle** and an MCP server derive nothing: the ARD specification names
|
|
12
|
+
* no media type for any of them (see `deriveArdMediaType`), so they are emitted
|
|
13
|
+
* only when the author supplies `ard.entries.<name>.type`, and are otherwise
|
|
14
|
+
* *reported as skipped* — never silently dropped, and never guessed at.
|
|
15
|
+
*/
|
|
16
|
+
import { type ArdSurface, type ArdSurfaceKind, type ProjectConfig } from '@vibe-agent-toolkit/resources';
|
|
17
|
+
/** A surface VAT declined to emit, and the reason a reader can act on. */
|
|
18
|
+
export interface SkippedArdSurface {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly kind: ArdSurfaceKind;
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ArdSurfaceCollection {
|
|
24
|
+
readonly surfaces: readonly ArdSurface[];
|
|
25
|
+
readonly skipped: readonly SkippedArdSurface[];
|
|
26
|
+
}
|
|
27
|
+
/** Facts that apply to every surface in a run, derived once by the caller. */
|
|
28
|
+
export interface ArdSurfaceDefaults {
|
|
29
|
+
/** The project's own package version, when it has one. */
|
|
30
|
+
readonly version?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Names of the skills `skills.include` discovery actually found.
|
|
33
|
+
*
|
|
34
|
+
* 🚨 Without this, every `skills.config` key was advertised on the author's
|
|
35
|
+
* word alone: a project with NO `skills/` directory and two config keys
|
|
36
|
+
* emitted two entries carrying real URLs at exit 0, with nothing on stderr —
|
|
37
|
+
* a published discovery document that is entirely 404s. The `skipped` channel
|
|
38
|
+
* exists so a surface is never silently DROPPED; the mirror case, silently
|
|
39
|
+
* INVENTING one, had no guard at all.
|
|
40
|
+
*
|
|
41
|
+
* Supplied by the caller rather than crawled here so this module stays pure,
|
|
42
|
+
* and `undefined` rather than `[]` when discovery did not run — an empty
|
|
43
|
+
* array is the answer "nothing exists", which must not be spelled the same
|
|
44
|
+
* way as "nobody asked".
|
|
45
|
+
*/
|
|
46
|
+
readonly discoveredSkills?: readonly string[] | undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Every surface the project config declares, split into what VAT will emit and
|
|
50
|
+
* what it declined to.
|
|
51
|
+
*
|
|
52
|
+
* @throws never — a config with no `ard` block yields an empty collection; the
|
|
53
|
+
* caller decides whether that is a failure (`runArdEmit` does).
|
|
54
|
+
*/
|
|
55
|
+
export declare function collectArdSurfaces(config: ProjectConfig, defaults: ArdSurfaceDefaults): ArdSurfaceCollection;
|
|
56
|
+
//# sourceMappingURL=surfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../../../src/commands/ard/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AAEvC,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD;AAED,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3D;AA+ID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,CAwBtB"}
|