@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,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy loading for **optional heavy backends** — the seam that keeps a
|
|
3
|
+
* multi-hundred-megabyte dependency out of every other command's cost.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this exists rather than four `await import()` calls
|
|
6
|
+
*
|
|
7
|
+
* `@vibe-agent-toolkit/rag-lancedb` pulls a platform-native LanceDB binary
|
|
8
|
+
* (97.8 MB unpacked on `darwin-arm64`, and larger still on `win32-x64`, where
|
|
9
|
+
* it measured 119.6 MiB) plus `onnxruntime-web` (137.5 MB) and `gpt-tokenizer`
|
|
10
|
+
* (42.2 MB). Summed over the RAG lane's third-party closure against this
|
|
11
|
+
* release's pins, on `darwin-arm64`: **~287 MB unpacked**, and a static import
|
|
12
|
+
* chain from `bin.ts` meant
|
|
13
|
+
* `import('@lancedb/lancedb')` — **1,350 ms cold** — ran before `vat --version`
|
|
14
|
+
* could print a string. It is a named seam rather than a one-off fix because
|
|
15
|
+
* "optional backend" is a shape VAT keeps growing — a projection store is
|
|
16
|
+
* loaded through it too — not because any one dependency is special.
|
|
17
|
+
*
|
|
18
|
+
* ## What it does NOT do
|
|
19
|
+
*
|
|
20
|
+
* It does not fall back, retry, or degrade. An absent backend is a legible
|
|
21
|
+
* error naming the package to install, and nothing more — the point is that
|
|
22
|
+
* the failure is readable, not that it is survivable.
|
|
23
|
+
*/
|
|
24
|
+
// Deliberately NOT `commands/rag/command-helpers.js`, which is where the rest
|
|
25
|
+
// of the rag lane's shared helpers live: that module statically imports
|
|
26
|
+
// `@vibe-agent-toolkit/rag-lancedb`, so reaching for its `handleCommandError`
|
|
27
|
+
// here would load the very backend this file exists to defer.
|
|
28
|
+
import { ExitCode } from '@vibe-agent-toolkit/schema';
|
|
29
|
+
import { writeYamlOutput } from './output.js';
|
|
30
|
+
/**
|
|
31
|
+
* Node's code for "the module is genuinely not installed".
|
|
32
|
+
*
|
|
33
|
+
* Matched on `code`, never on the message: the message embeds the specifier and
|
|
34
|
+
* the importing file and is not a stable contract, while the code is. A miss
|
|
35
|
+
* here would be reported as a missing backend when the real cause was a syntax
|
|
36
|
+
* error *inside* the backend, which is the worst possible diagnosis.
|
|
37
|
+
*/
|
|
38
|
+
const MODULE_NOT_FOUND = 'ERR_MODULE_NOT_FOUND';
|
|
39
|
+
/**
|
|
40
|
+
* Whether a thrown value is Node's "module not installed" error.
|
|
41
|
+
*
|
|
42
|
+
* Exported because every optional backend asks it, and a second copy would be
|
|
43
|
+
* free to drift onto the message.
|
|
44
|
+
*
|
|
45
|
+
* @param error - The thrown value
|
|
46
|
+
* @returns True when the module could not be resolved at all
|
|
47
|
+
*/
|
|
48
|
+
export function isModuleMissing(error) {
|
|
49
|
+
return (typeof error === 'object'
|
|
50
|
+
&& error !== null
|
|
51
|
+
&& 'code' in error
|
|
52
|
+
&& error.code === MODULE_NOT_FOUND);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Report an uninstalled backend and exit, in the shape every other command
|
|
56
|
+
* failure takes.
|
|
57
|
+
*
|
|
58
|
+
* Exit code **2** — a system error, not a validation failure. An absent
|
|
59
|
+
* optional package is a fact about the installation rather than about the
|
|
60
|
+
* user's corpus, and a caller scripting `vat` must be able to tell those apart
|
|
61
|
+
* from the exit code alone.
|
|
62
|
+
*
|
|
63
|
+
* Exported for the backends that are not selected by a Commander action —
|
|
64
|
+
* {@link lazyAction} is the shape most take, but a store chosen by an
|
|
65
|
+
* environment variable is loaded from inside a command rather than in place of
|
|
66
|
+
* one, and it must fail the same way.
|
|
67
|
+
*
|
|
68
|
+
* @param backend - What to name and how to install it
|
|
69
|
+
* @returns Never; the process exits
|
|
70
|
+
*/
|
|
71
|
+
export function reportMissingBackend(backend) {
|
|
72
|
+
const install = `npm install ${backend.packageName}`;
|
|
73
|
+
process.stderr.write(`${backend.feature} is an optional feature and its backend is not installed.\n`
|
|
74
|
+
+ `\nInstall it with: ${install}\n`
|
|
75
|
+
+ '\nIt ships separately because it carries a platform-native binary that every\n'
|
|
76
|
+
+ 'other vat command would otherwise download and load.\n');
|
|
77
|
+
writeYamlOutput({
|
|
78
|
+
status: 'error',
|
|
79
|
+
error: `${backend.feature} backend not installed: ${backend.packageName}`,
|
|
80
|
+
fix: install,
|
|
81
|
+
});
|
|
82
|
+
process.exit(ExitCode.ERROR);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Bind a Commander action that loads its implementation on first invocation.
|
|
86
|
+
*
|
|
87
|
+
* The returned function has the same shape Commander expects, so a command
|
|
88
|
+
* declaration keeps every option, description and help block it had — only the
|
|
89
|
+
* *implementation* moves behind the `await`. Help text is static data and must
|
|
90
|
+
* stay eagerly available, which is exactly why the split is at the action
|
|
91
|
+
* rather than at the command.
|
|
92
|
+
*
|
|
93
|
+
* @param backend - What to name in the error when the import fails to resolve
|
|
94
|
+
* @param load - Imports the module and returns the handler out of it
|
|
95
|
+
* @returns A Commander action that loads, then delegates
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* .action(lazyAction(RAG_BACKEND, async () => (await import('./index-command.js')).indexCommand))
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export function lazyAction(backend, load) {
|
|
103
|
+
return async (...args) => {
|
|
104
|
+
let handler;
|
|
105
|
+
try {
|
|
106
|
+
handler = await load();
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
if (!isModuleMissing(error)) {
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
reportMissingBackend(backend);
|
|
113
|
+
}
|
|
114
|
+
await handler(...args);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=optional-backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-backend.js","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAC9E,8DAA8D;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;WACtB,KAAK,KAAK,IAAI;WACd,MAAM,IAAI,KAAK;WACd,KAA4B,CAAC,IAAI,KAAK,gBAAgB,CAC3D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,MAAM,OAAO,GAAG,eAAe,OAAO,CAAC,WAAW,EAAE,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,OAAO,CAAC,OAAO,6DAA6D;UAC7E,uBAAuB,OAAO,IAAI;UAClC,gFAAgF;UAChF,wDAAwD,CAC3D,CAAC;IACF,eAAe,CAAC;QACd,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,GAAG,OAAO,CAAC,OAAO,2BAA2B,OAAO,CAAC,WAAW,EAAE;QACzE,GAAG,EAAE,OAAO;KACb,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAUD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,UAAU,CACxB,OAAwB,EACxB,IAA+C;IAE/C,OAAO,KAAK,EAAE,GAAG,IAAU,EAAiB,EAAE;QAC5C,IAAI,OAA0C,CAAC;QAC/C,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,MAAM,KAAK,CAAC;YACd,CAAC;YACD,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/utils/output.d.ts
CHANGED
|
@@ -76,6 +76,32 @@ export declare function writeAllSync(write: SyncWriter, buffer: Buffer, options?
|
|
|
76
76
|
* @param data - Data to serialize as YAML
|
|
77
77
|
*/
|
|
78
78
|
export declare function writeYamlOutput(data: unknown): void;
|
|
79
|
+
/**
|
|
80
|
+
* Write a single JSON document to stdout.
|
|
81
|
+
*
|
|
82
|
+
* The sibling of {@link writeYamlOutput}, for the same payloads, and it exists
|
|
83
|
+
* because a consumer that has to parse YAML needs a YAML parser: JSON is the
|
|
84
|
+
* format every language reads without one. `vat resources validate` already
|
|
85
|
+
* offers `--format json` for exactly this reason; a scan document that could
|
|
86
|
+
* only be had as YAML made the population it reports the harder of the two to
|
|
87
|
+
* consume programmatically, which is backwards.
|
|
88
|
+
*
|
|
89
|
+
* Written the same way as its YAML sibling, and the comment there applies
|
|
90
|
+
* verbatim: the ordinary stream write keeps this summary behind any
|
|
91
|
+
* human-readable progress already buffered on the same channel.
|
|
92
|
+
*
|
|
93
|
+
* @param data - Data to serialize as JSON
|
|
94
|
+
*/
|
|
95
|
+
export declare function writeJsonOutput(data: unknown): void;
|
|
96
|
+
/**
|
|
97
|
+
* Write one structured document in the format a `--format` option selected:
|
|
98
|
+
* `json` → {@link writeJsonOutput}; anything else (including an absent option)
|
|
99
|
+
* → {@link writeYamlOutput}, the CLI's default document format.
|
|
100
|
+
*
|
|
101
|
+
* @param data - The document
|
|
102
|
+
* @param format - The selected format (`json`, or anything else for YAML)
|
|
103
|
+
*/
|
|
104
|
+
export declare function writeStructuredOutput(data: unknown, format: string | undefined): void;
|
|
79
105
|
/**
|
|
80
106
|
* Write a test-format finding to stderr.
|
|
81
107
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAKrD;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAoCpF,MAAM,WAAW,mBAAmB;IAClC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU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AAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAMrF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,IAAI,CAEN"}
|
package/dist/utils/output.js
CHANGED
|
@@ -138,6 +138,41 @@ export function writeYamlOutput(data) {
|
|
|
138
138
|
aliasDuplicateObjects: false,
|
|
139
139
|
})}`);
|
|
140
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Write a single JSON document to stdout.
|
|
143
|
+
*
|
|
144
|
+
* The sibling of {@link writeYamlOutput}, for the same payloads, and it exists
|
|
145
|
+
* because a consumer that has to parse YAML needs a YAML parser: JSON is the
|
|
146
|
+
* format every language reads without one. `vat resources validate` already
|
|
147
|
+
* offers `--format json` for exactly this reason; a scan document that could
|
|
148
|
+
* only be had as YAML made the population it reports the harder of the two to
|
|
149
|
+
* consume programmatically, which is backwards.
|
|
150
|
+
*
|
|
151
|
+
* Written the same way as its YAML sibling, and the comment there applies
|
|
152
|
+
* verbatim: the ordinary stream write keeps this summary behind any
|
|
153
|
+
* human-readable progress already buffered on the same channel.
|
|
154
|
+
*
|
|
155
|
+
* @param data - Data to serialize as JSON
|
|
156
|
+
*/
|
|
157
|
+
export function writeJsonOutput(data) {
|
|
158
|
+
process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Write one structured document in the format a `--format` option selected:
|
|
162
|
+
* `json` → {@link writeJsonOutput}; anything else (including an absent option)
|
|
163
|
+
* → {@link writeYamlOutput}, the CLI's default document format.
|
|
164
|
+
*
|
|
165
|
+
* @param data - The document
|
|
166
|
+
* @param format - The selected format (`json`, or anything else for YAML)
|
|
167
|
+
*/
|
|
168
|
+
export function writeStructuredOutput(data, format) {
|
|
169
|
+
if (format === 'json') {
|
|
170
|
+
writeJsonOutput(data);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
writeYamlOutput(data);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
141
176
|
/**
|
|
142
177
|
* Write a test-format finding to stderr.
|
|
143
178
|
*
|
package/dist/utils/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,YAAY,CACV,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAChE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAC7B,CAAC;AACJ,CAAC;AAUD;;;;;;;;;GASG;AACH,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAE9C,uEAAuE;AACvE,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,SAAS,SAAS,CAAC,EAAU;IAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,SAAS,yBAAyB,CAAC,kBAA0B;IAC3D,IAAI,kBAAkB,GAAG,mBAAmB;QAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAiB,EACjB,MAAc,EACd,UAA+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;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,4EAA4E;IAC5E,wEAAwE;IACxE,4EAA4E;IAC5E,8EAA8E;IAC9E,2DAA2D;IAC3D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;QAChD,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,GAAG;QACd,qBAAqB,EAAE,KAAK;KAC7B,CAAC,EAAE,CAAC,CAAC;AACR,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAa,EAAE,MAA0B;IAC7E,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,IAAY,EACZ,MAAc,EACd,QAAgB,EAChB,OAAe;IAEf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One reading of a project's `package.json` for the lanes that want an
|
|
3
|
+
* OPTIONAL field out of it — a `version` to stamp, a `vat.skills` list, a
|
|
4
|
+
* `files` allowlist.
|
|
5
|
+
*
|
|
6
|
+
* Every one of those lanes used to spell the read as `existsSync` →
|
|
7
|
+
* `readFileSync` → `JSON.parse` inside one `try { … } catch { return <absent> }`,
|
|
8
|
+
* which made "there is no package.json" indistinguishable from "there is one
|
|
9
|
+
* and it is not JSON" and from "there is one and the OS refused it". The first
|
|
10
|
+
* is the sentinel's meaning; the other two were reported as it — a build
|
|
11
|
+
* stamped no version, a consistency check verified nothing, and neither said
|
|
12
|
+
* why. npm itself refuses a manifest it cannot parse, so a tree with one is
|
|
13
|
+
* already broken; the reader's job is to say so, not to proceed around it.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The parsed manifest, or `undefined` when there is none at `pkgPath`.
|
|
17
|
+
*
|
|
18
|
+
* @throws {Error} naming the file when it exists but is not a JSON object;
|
|
19
|
+
* the parse error is the `cause`.
|
|
20
|
+
* @throws whatever the filesystem threw for anything that is not an absence
|
|
21
|
+
* (a refusal stays a refusal).
|
|
22
|
+
*/
|
|
23
|
+
export declare function readPackageJsonOrAbsent(pkgPath: string): Record<string, unknown> | undefined;
|
|
24
|
+
//# sourceMappingURL=package-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../src/utils/package-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAoB5F"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One reading of a project's `package.json` for the lanes that want an
|
|
3
|
+
* OPTIONAL field out of it — a `version` to stamp, a `vat.skills` list, a
|
|
4
|
+
* `files` allowlist.
|
|
5
|
+
*
|
|
6
|
+
* Every one of those lanes used to spell the read as `existsSync` →
|
|
7
|
+
* `readFileSync` → `JSON.parse` inside one `try { … } catch { return <absent> }`,
|
|
8
|
+
* which made "there is no package.json" indistinguishable from "there is one
|
|
9
|
+
* and it is not JSON" and from "there is one and the OS refused it". The first
|
|
10
|
+
* is the sentinel's meaning; the other two were reported as it — a build
|
|
11
|
+
* stamped no version, a consistency check verified nothing, and neither said
|
|
12
|
+
* why. npm itself refuses a manifest it cannot parse, so a tree with one is
|
|
13
|
+
* already broken; the reader's job is to say so, not to proceed around it.
|
|
14
|
+
*/
|
|
15
|
+
import { readFileSync } from 'node:fs';
|
|
16
|
+
import { isPathAbsentError } from '@vibe-agent-toolkit/utils';
|
|
17
|
+
/**
|
|
18
|
+
* The parsed manifest, or `undefined` when there is none at `pkgPath`.
|
|
19
|
+
*
|
|
20
|
+
* @throws {Error} naming the file when it exists but is not a JSON object;
|
|
21
|
+
* the parse error is the `cause`.
|
|
22
|
+
* @throws whatever the filesystem threw for anything that is not an absence
|
|
23
|
+
* (a refusal stays a refusal).
|
|
24
|
+
*/
|
|
25
|
+
export function readPackageJsonOrAbsent(pkgPath) {
|
|
26
|
+
let raw;
|
|
27
|
+
try {
|
|
28
|
+
raw = readFileSync(pkgPath, 'utf-8');
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (isPathAbsentError(error))
|
|
32
|
+
return undefined;
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
let parsed;
|
|
36
|
+
try {
|
|
37
|
+
parsed = JSON.parse(raw);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (!(error instanceof SyntaxError))
|
|
41
|
+
throw error;
|
|
42
|
+
throw new Error(`${pkgPath} is not valid JSON: ${error.message}`, { cause: error });
|
|
43
|
+
}
|
|
44
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
45
|
+
throw new Error(`${pkgPath} is not a JSON object, so it is not a package manifest`);
|
|
46
|
+
}
|
|
47
|
+
return parsed;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=package-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-json.js","sourceRoot":"","sources":["../../src/utils/package-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,iBAAiB,CAAC,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/C,MAAM,KAAK,CAAC;IACd,CAAC;IAED,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC;YAAE,MAAM,KAAK,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,uBAAuB,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACtF,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,wDAAwD,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,MAAiC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three arguments every CLI lane hands a projection population builder the
|
|
3
|
+
* same way: the blob-stage observer, the ignore oracle, and the run's store.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this is CLI code and not `resources` code
|
|
6
|
+
*
|
|
7
|
+
* Nothing here decides anything about a projection. The observer's whole body is
|
|
8
|
+
* `describeBlobRefusals` — owned by `@vibe-agent-toolkit/resources` — routed to a
|
|
9
|
+
* {@link Logger}, which is a CLI type no other package has; the two spreads exist
|
|
10
|
+
* only because `exactOptionalPropertyTypes` makes "absent" and "present and
|
|
11
|
+
* undefined" different arguments. That is command plumbing, in the same family as
|
|
12
|
+
* `projection-store.ts` next door, so it stays inside the package the CLI-stays-
|
|
13
|
+
* dumb rule allows it in.
|
|
14
|
+
*
|
|
15
|
+
* ## The observer is the reason this is shared rather than retyped
|
|
16
|
+
*
|
|
17
|
+
* `buildInventoryPopulation` and `buildClaudeContextPopulation` both REQUIRE
|
|
18
|
+
* `onBlobPopulation` — a caller with nothing to do with the counts must name
|
|
19
|
+
* `DISCARD_BLOB_POPULATION` rather than leave it off — because a tree whose every
|
|
20
|
+
* document was declined as binary otherwise populates as empty and reports
|
|
21
|
+
* success. Two hand-written copies of the reporting half is two places for that
|
|
22
|
+
* report to quietly become a no-op.
|
|
23
|
+
*/
|
|
24
|
+
import { type BlobPopulationReport, type CollectionConfig, type PopulationCache } from '@vibe-agent-toolkit/resources';
|
|
25
|
+
import type { GitTracker } from '@vibe-agent-toolkit/utils/git';
|
|
26
|
+
import type { Logger } from './logger.js';
|
|
27
|
+
/**
|
|
28
|
+
* The population arguments {@link populationWiring} supplies.
|
|
29
|
+
*
|
|
30
|
+
* Spread into a builder's options object, so the three optional inputs are
|
|
31
|
+
* optional in the `exactOptionalPropertyTypes` sense — omitted entirely when
|
|
32
|
+
* they are absent, never present-and-undefined.
|
|
33
|
+
*/
|
|
34
|
+
export interface PopulationWiring {
|
|
35
|
+
onBlobPopulation: (report: BlobPopulationReport) => void;
|
|
36
|
+
gitTracker?: GitTracker | undefined;
|
|
37
|
+
cache?: PopulationCache | undefined;
|
|
38
|
+
collections?: Readonly<Record<string, CollectionConfig>> | undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Wire one population's blob-stage observer, ignore oracle and store.
|
|
42
|
+
*
|
|
43
|
+
* `describeBlobRefusals` returns undefined on a run that refused nothing, so a
|
|
44
|
+
* clean population stays exactly as quiet as it was — which is the only thing
|
|
45
|
+
* that keeps the line worth reading when it does appear.
|
|
46
|
+
*
|
|
47
|
+
* ⚠️ The refusals go to `logger.warn`, i.e. **stderr**. Both callers write a
|
|
48
|
+
* parseable document to stdout, and a diagnostic in the middle of it breaks every
|
|
49
|
+
* consumer.
|
|
50
|
+
*
|
|
51
|
+
* @param logger - Where blob-stage refusals are reported
|
|
52
|
+
* @param gitTracker - The ignore oracle, or undefined when there is none. Not
|
|
53
|
+
* cosmetic: `resource_realizations.gitignored` is filled only when a tracker
|
|
54
|
+
* was supplied, so its absence decides whether a consumer can TELL which
|
|
55
|
+
* members were ignored
|
|
56
|
+
* @param cache - The run's projection store, or undefined to re-derive
|
|
57
|
+
* @param root - The project root, from which the run's declared `mimeType`
|
|
58
|
+
* routing is READ rather than passed. See {@link collectionsOption}
|
|
59
|
+
* @returns The options to spread into the population builder's argument
|
|
60
|
+
*/
|
|
61
|
+
export declare function populationWiring(logger: Logger, gitTracker: GitTracker | undefined, cache: PopulationCache | undefined, root: string): PopulationWiring;
|
|
62
|
+
/**
|
|
63
|
+
* The project's collection declarations at `root`, or undefined for a project
|
|
64
|
+
* that declares none.
|
|
65
|
+
*
|
|
66
|
+
* ## Why this is READ here and not passed in
|
|
67
|
+
*
|
|
68
|
+
* A declared `mimeType` changes which parser runs, which changes the content
|
|
69
|
+
* key, which is folded into the projection store's key through the routing's
|
|
70
|
+
* fingerprint. So two lanes of ONE command that disagree about whether to supply
|
|
71
|
+
* the declarations do not merely disagree about parsing — they **evict each
|
|
72
|
+
* other's stored extents over an unchanged tree, run after run.**
|
|
73
|
+
*
|
|
74
|
+
* Taking a `root` and reading the config here rather than accepting a
|
|
75
|
+
* `collections` argument is what makes that disagreement unrepresentable: there
|
|
76
|
+
* is one answer per root and every lane that goes through this helper gets it.
|
|
77
|
+
* An optional argument would have been a thing three call sites could each
|
|
78
|
+
* forget, and forgetting is silent — a cache that never hits looks exactly like
|
|
79
|
+
* a cache that is merely cold.
|
|
80
|
+
*
|
|
81
|
+
* `loadConfigCached` is keyed on the root, so the repeat calls across a
|
|
82
|
+
* command's lanes cost one parse between them. A broken config throws here, as
|
|
83
|
+
* it does everywhere else — a population silently typed by the built-in tables
|
|
84
|
+
* because the config would not parse is the conflation
|
|
85
|
+
* {@link loadConfigCached} exists to refuse.
|
|
86
|
+
*
|
|
87
|
+
* Returned as a SPREADABLE rather than a value: `exactOptionalPropertyTypes`
|
|
88
|
+
* makes an absent key and one holding `undefined` different arguments, and the
|
|
89
|
+
* population builders declare `collections` optional. Every caller spreads this,
|
|
90
|
+
* so no call site writes its own `!== undefined &&` and none can get the two
|
|
91
|
+
* states the wrong way round.
|
|
92
|
+
*
|
|
93
|
+
* @param root - The project root whose config declares the collections
|
|
94
|
+
* @returns `{ collections }`, or `{}` when there is no config or no
|
|
95
|
+
* `resources.collections` in it
|
|
96
|
+
*/
|
|
97
|
+
export declare function collectionsOption(root: string): {
|
|
98
|
+
collections?: Readonly<Record<string, CollectionConfig>>;
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=population-wiring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"population-wiring.d.ts","sourceRoot":"","sources":["../../src/utils/population-wiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACzD,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,KAAK,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,GAAG,SAAS,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,KAAK,EAAE,eAAe,GAAG,SAAS,EAClC,IAAI,EAAE,MAAM,GACX,gBAAgB,CAUlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GACX;IAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAA;CAAE,CAG9D"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The three arguments every CLI lane hands a projection population builder the
|
|
3
|
+
* same way: the blob-stage observer, the ignore oracle, and the run's store.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this is CLI code and not `resources` code
|
|
6
|
+
*
|
|
7
|
+
* Nothing here decides anything about a projection. The observer's whole body is
|
|
8
|
+
* `describeBlobRefusals` — owned by `@vibe-agent-toolkit/resources` — routed to a
|
|
9
|
+
* {@link Logger}, which is a CLI type no other package has; the two spreads exist
|
|
10
|
+
* only because `exactOptionalPropertyTypes` makes "absent" and "present and
|
|
11
|
+
* undefined" different arguments. That is command plumbing, in the same family as
|
|
12
|
+
* `projection-store.ts` next door, so it stays inside the package the CLI-stays-
|
|
13
|
+
* dumb rule allows it in.
|
|
14
|
+
*
|
|
15
|
+
* ## The observer is the reason this is shared rather than retyped
|
|
16
|
+
*
|
|
17
|
+
* `buildInventoryPopulation` and `buildClaudeContextPopulation` both REQUIRE
|
|
18
|
+
* `onBlobPopulation` — a caller with nothing to do with the counts must name
|
|
19
|
+
* `DISCARD_BLOB_POPULATION` rather than leave it off — because a tree whose every
|
|
20
|
+
* document was declined as binary otherwise populates as empty and reports
|
|
21
|
+
* success. Two hand-written copies of the reporting half is two places for that
|
|
22
|
+
* report to quietly become a no-op.
|
|
23
|
+
*/
|
|
24
|
+
import { describeBlobRefusals, } from '@vibe-agent-toolkit/resources';
|
|
25
|
+
import { loadConfigCached } from './config-loader.js';
|
|
26
|
+
/**
|
|
27
|
+
* Wire one population's blob-stage observer, ignore oracle and store.
|
|
28
|
+
*
|
|
29
|
+
* `describeBlobRefusals` returns undefined on a run that refused nothing, so a
|
|
30
|
+
* clean population stays exactly as quiet as it was — which is the only thing
|
|
31
|
+
* that keeps the line worth reading when it does appear.
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ The refusals go to `logger.warn`, i.e. **stderr**. Both callers write a
|
|
34
|
+
* parseable document to stdout, and a diagnostic in the middle of it breaks every
|
|
35
|
+
* consumer.
|
|
36
|
+
*
|
|
37
|
+
* @param logger - Where blob-stage refusals are reported
|
|
38
|
+
* @param gitTracker - The ignore oracle, or undefined when there is none. Not
|
|
39
|
+
* cosmetic: `resource_realizations.gitignored` is filled only when a tracker
|
|
40
|
+
* was supplied, so its absence decides whether a consumer can TELL which
|
|
41
|
+
* members were ignored
|
|
42
|
+
* @param cache - The run's projection store, or undefined to re-derive
|
|
43
|
+
* @param root - The project root, from which the run's declared `mimeType`
|
|
44
|
+
* routing is READ rather than passed. See {@link collectionsOption}
|
|
45
|
+
* @returns The options to spread into the population builder's argument
|
|
46
|
+
*/
|
|
47
|
+
export function populationWiring(logger, gitTracker, cache, root) {
|
|
48
|
+
return {
|
|
49
|
+
onBlobPopulation: (report) => {
|
|
50
|
+
const refusals = describeBlobRefusals(report);
|
|
51
|
+
if (refusals !== undefined)
|
|
52
|
+
logger.warn(refusals);
|
|
53
|
+
},
|
|
54
|
+
...(gitTracker !== undefined && { gitTracker }),
|
|
55
|
+
...(cache !== undefined && { cache }),
|
|
56
|
+
...collectionsOption(root),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The project's collection declarations at `root`, or undefined for a project
|
|
61
|
+
* that declares none.
|
|
62
|
+
*
|
|
63
|
+
* ## Why this is READ here and not passed in
|
|
64
|
+
*
|
|
65
|
+
* A declared `mimeType` changes which parser runs, which changes the content
|
|
66
|
+
* key, which is folded into the projection store's key through the routing's
|
|
67
|
+
* fingerprint. So two lanes of ONE command that disagree about whether to supply
|
|
68
|
+
* the declarations do not merely disagree about parsing — they **evict each
|
|
69
|
+
* other's stored extents over an unchanged tree, run after run.**
|
|
70
|
+
*
|
|
71
|
+
* Taking a `root` and reading the config here rather than accepting a
|
|
72
|
+
* `collections` argument is what makes that disagreement unrepresentable: there
|
|
73
|
+
* is one answer per root and every lane that goes through this helper gets it.
|
|
74
|
+
* An optional argument would have been a thing three call sites could each
|
|
75
|
+
* forget, and forgetting is silent — a cache that never hits looks exactly like
|
|
76
|
+
* a cache that is merely cold.
|
|
77
|
+
*
|
|
78
|
+
* `loadConfigCached` is keyed on the root, so the repeat calls across a
|
|
79
|
+
* command's lanes cost one parse between them. A broken config throws here, as
|
|
80
|
+
* it does everywhere else — a population silently typed by the built-in tables
|
|
81
|
+
* because the config would not parse is the conflation
|
|
82
|
+
* {@link loadConfigCached} exists to refuse.
|
|
83
|
+
*
|
|
84
|
+
* Returned as a SPREADABLE rather than a value: `exactOptionalPropertyTypes`
|
|
85
|
+
* makes an absent key and one holding `undefined` different arguments, and the
|
|
86
|
+
* population builders declare `collections` optional. Every caller spreads this,
|
|
87
|
+
* so no call site writes its own `!== undefined &&` and none can get the two
|
|
88
|
+
* states the wrong way round.
|
|
89
|
+
*
|
|
90
|
+
* @param root - The project root whose config declares the collections
|
|
91
|
+
* @returns `{ collections }`, or `{}` when there is no config or no
|
|
92
|
+
* `resources.collections` in it
|
|
93
|
+
*/
|
|
94
|
+
export function collectionsOption(root) {
|
|
95
|
+
const collections = loadConfigCached(root)?.resources?.collections;
|
|
96
|
+
return collections === undefined ? {} : { collections };
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=population-wiring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"population-wiring.js","sourceRoot":"","sources":["../../src/utils/population-wiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,oBAAoB,GAIrB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAiBtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,UAAkC,EAClC,KAAkC,EAClC,IAAY;IAEZ,OAAO;QACL,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE;YAC3B,MAAM,QAAQ,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;YAC9C,IAAI,QAAQ,KAAK,SAAS;gBAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,CAAC;QACD,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,CAAC;QAC/C,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;QACrC,GAAG,iBAAiB,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAY;IAEZ,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC;IACnE,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -30,4 +30,24 @@ export declare function projectRootOrLoudCwd(startDir: string, logger: Logger):
|
|
|
30
30
|
* `tolerate null` policy — return `string | null`; caller handles either case.
|
|
31
31
|
*/
|
|
32
32
|
export declare function projectRootOrNull(startDir: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Fail loudly on a `[path]` argument that names no directory.
|
|
35
|
+
*
|
|
36
|
+
* Every `resources` verb takes an optional `[path]`, and two things can be
|
|
37
|
+
* meant by it: a SCOPE (`scan`, `validate` — crawl this subtree) or a LOCATOR
|
|
38
|
+
* (`query`, `check` — find the project from here; the projection is always the
|
|
39
|
+
* whole tree). Both start by resolving the argument, and both must refuse one
|
|
40
|
+
* that resolves to nothing — the scoping verbs would otherwise degrade into a
|
|
41
|
+
* glob matching nothing (`filesScanned: 0`, green), and the locating verbs
|
|
42
|
+
* walked UP from the missing path to whatever project the cwd is in and
|
|
43
|
+
* answered about THAT tree at exit 0, byte-identical to a correct run.
|
|
44
|
+
*
|
|
45
|
+
* One function so the two families refuse with one message; a reader who saw
|
|
46
|
+
* `validate` say "Path does not exist" should get the same words from `query`.
|
|
47
|
+
*
|
|
48
|
+
* @param pathArg - The argument as typed, relative to cwd or absolute
|
|
49
|
+
* @returns The resolved absolute path
|
|
50
|
+
* @throws When it does not exist or is not a directory
|
|
51
|
+
*/
|
|
52
|
+
export declare function assertDirectoryArgument(pathArg: string): string;
|
|
33
53
|
//# sourceMappingURL=project-root-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root-policy.d.ts","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"project-root-policy.d.ts","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAShF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAS/D"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* `.action(...)` callbacks). Inner library functions should take the resolved
|
|
13
13
|
* root as a parameter — never call `findProjectRoot` themselves.
|
|
14
14
|
*/
|
|
15
|
+
import { existsSync, statSync } from 'node:fs';
|
|
15
16
|
import { findProjectRoot, safePath } from '@vibe-agent-toolkit/utils';
|
|
16
17
|
/**
|
|
17
18
|
* `required` policy — refuse to run if no projectRoot can be discovered.
|
|
@@ -46,4 +47,33 @@ export function projectRootOrLoudCwd(startDir, logger) {
|
|
|
46
47
|
export function projectRootOrNull(startDir) {
|
|
47
48
|
return findProjectRoot(startDir);
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Fail loudly on a `[path]` argument that names no directory.
|
|
52
|
+
*
|
|
53
|
+
* Every `resources` verb takes an optional `[path]`, and two things can be
|
|
54
|
+
* meant by it: a SCOPE (`scan`, `validate` — crawl this subtree) or a LOCATOR
|
|
55
|
+
* (`query`, `check` — find the project from here; the projection is always the
|
|
56
|
+
* whole tree). Both start by resolving the argument, and both must refuse one
|
|
57
|
+
* that resolves to nothing — the scoping verbs would otherwise degrade into a
|
|
58
|
+
* glob matching nothing (`filesScanned: 0`, green), and the locating verbs
|
|
59
|
+
* walked UP from the missing path to whatever project the cwd is in and
|
|
60
|
+
* answered about THAT tree at exit 0, byte-identical to a correct run.
|
|
61
|
+
*
|
|
62
|
+
* One function so the two families refuse with one message; a reader who saw
|
|
63
|
+
* `validate` say "Path does not exist" should get the same words from `query`.
|
|
64
|
+
*
|
|
65
|
+
* @param pathArg - The argument as typed, relative to cwd or absolute
|
|
66
|
+
* @returns The resolved absolute path
|
|
67
|
+
* @throws When it does not exist or is not a directory
|
|
68
|
+
*/
|
|
69
|
+
export function assertDirectoryArgument(pathArg) {
|
|
70
|
+
const resolved = safePath.resolve(pathArg);
|
|
71
|
+
if (!existsSync(resolved)) {
|
|
72
|
+
throw new Error(`Path does not exist: ${resolved}`);
|
|
73
|
+
}
|
|
74
|
+
if (!statSync(resolved).isDirectory()) {
|
|
75
|
+
throw new Error(`Path is not a directory: ${resolved}`);
|
|
76
|
+
}
|
|
77
|
+
return resolved;
|
|
78
|
+
}
|
|
49
79
|
//# sourceMappingURL=project-root-policy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root-policy.js","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAItE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,WAAmB;IACtE,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,GAAG,WAAW,gEAAgE;YAC5E,kDAAkD,CACrD,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB,EAAE,MAAc;IACnE,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,Q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