@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
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared utilities for top-level phase orchestration commands (vat build, vat verify, vat validate).
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { safePath } from '@vibe-agent-toolkit/utils';
|
|
4
|
+
import { ExitCode, isExitCode } from '@vibe-agent-toolkit/schema';
|
|
6
5
|
import { Option } from 'commander';
|
|
7
|
-
import * as YAML from 'yaml';
|
|
8
6
|
import { createLogger } from '../utils/logger.js';
|
|
9
|
-
import { writeYamlOutput } from '../utils/output.js';
|
|
7
|
+
import { writeJsonOutput, writeYamlOutput } from '../utils/output.js';
|
|
10
8
|
/**
|
|
11
9
|
* Declare `--only` on a command that has RETIRED it, solely so the command can
|
|
12
10
|
* explain itself instead of emitting Commander's bare `error: unknown option
|
|
@@ -51,65 +49,51 @@ export function rejectRetiredOnly(only, command, seconds) {
|
|
|
51
49
|
`\n` +
|
|
52
50
|
` Fix: drop the flag — '${command}' runs every configured surface.\n` +
|
|
53
51
|
` Still selective: 'vat build --only <phase>', where a phase is minutes, not seconds.\n`);
|
|
54
|
-
process.exit(
|
|
52
|
+
process.exit(ExitCode.ERROR);
|
|
55
53
|
}
|
|
56
54
|
/** The phase outcome for "we did not learn what this phase would have said". */
|
|
57
55
|
export const SYSTEM_ERROR = 'system-error';
|
|
58
|
-
/**
|
|
59
|
-
* Resolve the absolute path to the vat binary.
|
|
60
|
-
* This file lives in commands/, one level above bin/.
|
|
61
|
-
*/
|
|
62
|
-
export function resolveBinPath() {
|
|
63
|
-
// Use bin.js directly (not the vat.js wrapper) so phase subprocesses always
|
|
64
|
-
// run the same binary that is currently executing, regardless of cwd or
|
|
65
|
-
// context detection (which would pick up the adopter project's local install).
|
|
66
|
-
return safePath.resolve(safePath.join(import.meta.dirname, '../bin.js'));
|
|
67
|
-
}
|
|
68
56
|
/**
|
|
69
57
|
* Create the shared phase command context: logger, startTime, and bin path.
|
|
70
58
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
59
|
+
* Total by design: it builds the context and decides nothing.
|
|
60
|
+
*
|
|
61
|
+
* ⚠️ This runs BEFORE the command's try block, so anything that throws here
|
|
62
|
+
* reaches the user as a raw Node stack trace with zero bytes of stdout and an
|
|
63
|
+
* exit 1 indistinguishable from "validation errors". Phase routing therefore
|
|
64
|
+
* belongs to {@link decidePhaseSelection} and {@link applyPhaseSelection}, which
|
|
65
|
+
* emit the command's normal structured document.
|
|
77
66
|
*/
|
|
78
67
|
export function createPhaseContext(debugFlag) {
|
|
79
68
|
return {
|
|
80
69
|
logger: createLogger(debugFlag ? { debug: true } : {}),
|
|
81
70
|
startTime: Date.now(),
|
|
82
|
-
binPath: resolveBinPath(),
|
|
83
71
|
};
|
|
84
72
|
}
|
|
85
73
|
/**
|
|
86
74
|
* Decide what an orchestrator should do with its `--only` value and the phase
|
|
87
75
|
* list its config produced.
|
|
88
76
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* their own `--only` through here.)
|
|
77
|
+
* THE single decision site for all three orchestrators, so they cannot answer
|
|
78
|
+
* the same question differently. An orchestrator that builds its phase list
|
|
79
|
+
* without consulting the config exits 0 on `--only skills` in a project with no
|
|
80
|
+
* `skills:` block while another exits 1 — opposite verdicts on one question.
|
|
81
|
+
* `vat verify` has retired `--only` and always passes `only: undefined`;
|
|
82
|
+
* `vat validate` and `vat build` route their own `--only` through here.
|
|
96
83
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* confidently-wrong "no skills: block" instead of reporting the config error.
|
|
102
|
-
* `--only` is gone from verify, `emptyIsValid` went with it, and that ordering
|
|
103
|
-
* hazard cannot recur: nothing short-circuits ahead of the config-error arm.
|
|
84
|
+
* ⚠️ **Nothing may short-circuit ahead of the config-error arm.** A check
|
|
85
|
+
* evaluated before `unreadableConfig` answers a confident "not configured" for a
|
|
86
|
+
* tree whose config could not be parsed — which is the one answer this function
|
|
87
|
+
* must never give, because it is indistinguishable from a correct one.
|
|
104
88
|
*
|
|
105
89
|
* @param unreadableConfig - The config-load error, when the config exists but
|
|
106
90
|
* could not be parsed. A broken config is NOT "the phase is unconfigured":
|
|
107
91
|
* we do not know what it declares, so we must not answer with a confident
|
|
108
92
|
* "not configured". Only `vat verify` passes it, and only defensively — its
|
|
109
|
-
* phase builder pushes every
|
|
110
|
-
* (so the
|
|
111
|
-
* this arm unreachable by construction today. It is kept because the arm
|
|
112
|
-
* would otherwise catch an empty list is the "not configured" lie.
|
|
93
|
+
* phase builder pushes every configured phase when the config is unreadable
|
|
94
|
+
* (so the phase itself reports the real error), which makes the list non-empty
|
|
95
|
+
* and this arm unreachable by construction today. It is kept because the arm
|
|
96
|
+
* that would otherwise catch an empty list is the "not configured" lie.
|
|
113
97
|
*/
|
|
114
98
|
export function decidePhaseSelection(only, phases, vocab, options = {}) {
|
|
115
99
|
const lower = vocab.noun.toLowerCase();
|
|
@@ -139,9 +123,9 @@ export function decidePhaseSelection(only, phases, vocab, options = {}) {
|
|
|
139
123
|
* Act on a {@link PhaseSelection}: return the phases to run, or emit the
|
|
140
124
|
* command's normal structured document and exit.
|
|
141
125
|
*
|
|
142
|
-
* Both terminal arms go through `writeYamlOutput` deliberately
|
|
143
|
-
*
|
|
144
|
-
*
|
|
126
|
+
* Both terminal arms go through `writeYamlOutput` deliberately: the YAML
|
|
127
|
+
* document on stdout is the one output a scripted caller parses, so a routing
|
|
128
|
+
* failure has to publish one rather than throw past it.
|
|
145
129
|
*/
|
|
146
130
|
export function applyPhaseSelection(selection, logger, startTime) {
|
|
147
131
|
if (selection.kind === 'run') {
|
|
@@ -155,7 +139,10 @@ export function applyPhaseSelection(selection, logger, startTime) {
|
|
|
155
139
|
error: selection.message,
|
|
156
140
|
duration: `${Date.now() - startTime}ms`,
|
|
157
141
|
});
|
|
158
|
-
|
|
142
|
+
// A selection that cannot run — an unknown `--only` name, an unreadable
|
|
143
|
+
// config, nothing configured for what was asked — is the command failing
|
|
144
|
+
// to do its job, not a finding about the tree.
|
|
145
|
+
return process.exit(ExitCode.ERROR);
|
|
159
146
|
}
|
|
160
147
|
logger.warn(selection.warning);
|
|
161
148
|
writeYamlOutput({
|
|
@@ -164,7 +151,7 @@ export function applyPhaseSelection(selection, logger, startTime) {
|
|
|
164
151
|
note: selection.note,
|
|
165
152
|
duration: `${Date.now() - startTime}ms`,
|
|
166
153
|
});
|
|
167
|
-
return process.exit(
|
|
154
|
+
return process.exit(ExitCode.OK);
|
|
168
155
|
}
|
|
169
156
|
/** Rank used by {@link worseOf}: later wins. */
|
|
170
157
|
const PHASE_STATUS_ORDER = ['success', 'warning', 'error', 'system-error'];
|
|
@@ -172,54 +159,28 @@ const PHASE_STATUS_ORDER = ['success', 'warning', 'error', 'system-error'];
|
|
|
172
159
|
export function worseOf(a, b) {
|
|
173
160
|
return PHASE_STATUS_ORDER.indexOf(b) > PHASE_STATUS_ORDER.indexOf(a) ? b : a;
|
|
174
161
|
}
|
|
175
|
-
/** Every value a
|
|
162
|
+
/** Every value a phase may legitimately report as its own `status`. */
|
|
176
163
|
const REPORTABLE_STATUSES = new Set(PHASE_STATUS_ORDER);
|
|
177
164
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* Takes the LAST non-empty document in the stream: every orchestrated child
|
|
181
|
-
* writes its summary last, and a child that happens to emit more than one
|
|
182
|
-
* document must not make the summary unreadable.
|
|
165
|
+
* The status an exit code alone implies, before the phase's report is read.
|
|
183
166
|
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
167
|
+
* A code outside the `ExitCode` contract is a DEFECT in the phase, not a
|
|
168
|
+
* status to round: the old table folded "anything else" into `system-error`,
|
|
169
|
+
* which let a phase ending on a code no reader could interpret pass as a
|
|
170
|
+
* merely broken environment. It throws, and {@link runPhase}'s backstop files
|
|
171
|
+
* the phase as `system-error` with the defect named.
|
|
189
172
|
*/
|
|
190
|
-
function parseChildReport(name, stdout) {
|
|
191
|
-
if (stdout === undefined || stdout === null || stdout.trim() === '') {
|
|
192
|
-
return {};
|
|
193
|
-
}
|
|
194
|
-
let documents;
|
|
195
|
-
try {
|
|
196
|
-
documents = YAML.parseAllDocuments(stdout);
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
return { parseError: unparseableMessage(name, error) };
|
|
200
|
-
}
|
|
201
|
-
const last = documents.findLast((doc) => doc.contents !== null);
|
|
202
|
-
if (last === undefined) {
|
|
203
|
-
return {};
|
|
204
|
-
}
|
|
205
|
-
if (last.errors.length > 0) {
|
|
206
|
-
return { parseError: unparseableMessage(name, last.errors[0]) };
|
|
207
|
-
}
|
|
208
|
-
return { report: last.toJS() };
|
|
209
|
-
}
|
|
210
|
-
function unparseableMessage(name, cause) {
|
|
211
|
-
const detail = cause instanceof Error ? cause.message : String(cause);
|
|
212
|
-
return `Phase '${name}' wrote unparseable output on stdout: ${detail}`;
|
|
213
|
-
}
|
|
214
|
-
/** The status an exit code alone implies, before the child's report is read. */
|
|
215
173
|
function statusFromExitCode(status) {
|
|
216
|
-
if (status
|
|
174
|
+
if (!isExitCode(status)) {
|
|
175
|
+
throw new Error(`exit code ${status} is not in the ExitCode contract (0 ok, 1 findings, 2 error)`);
|
|
176
|
+
}
|
|
177
|
+
if (status === ExitCode.OK)
|
|
217
178
|
return 'success';
|
|
218
|
-
if (status ===
|
|
179
|
+
if (status === ExitCode.FINDINGS)
|
|
219
180
|
return 'error';
|
|
220
181
|
return SYSTEM_ERROR;
|
|
221
182
|
}
|
|
222
|
-
/** The status the
|
|
183
|
+
/** The status the phase claimed for itself, when it claimed a recognized one. */
|
|
223
184
|
function statusFromReport(report) {
|
|
224
185
|
if (typeof report !== 'object' || report === null)
|
|
225
186
|
return undefined;
|
|
@@ -229,49 +190,31 @@ function statusFromReport(report) {
|
|
|
229
190
|
: undefined;
|
|
230
191
|
}
|
|
231
192
|
/**
|
|
232
|
-
* Map a
|
|
193
|
+
* Map what a phase produced to its outcome. The pure core of {@link runPhase}.
|
|
233
194
|
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
195
|
+
* | exit code | phase status | why |
|
|
196
|
+
* |-----------------------|----------------|-----------------------------------------|
|
|
197
|
+
* | `OK` (0) | `success` | ran, found nothing actionable |
|
|
198
|
+
* | `FINDINGS` (1) | `error` | ran, found validation errors |
|
|
199
|
+
* | `ERROR` (2) | `system-error` | the phase itself reported a system error |
|
|
200
|
+
* | anything else | throws | a defect in the phase, filed by `runPhase` as `system-error` |
|
|
236
201
|
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* | stdout not parseable | `system-error` | the child's answer cannot be read |
|
|
243
|
-
* | exit 0 | `success` | ran, found nothing actionable |
|
|
244
|
-
* | exit 1 | `error` | ran, found validation errors |
|
|
245
|
-
* | exit 2 (or any other) | `system-error` | the child itself reported a system error |
|
|
202
|
+
* The exit code is then reconciled with the phase's OWN reported `status`,
|
|
203
|
+
* worst-wins. An exit code has three values and cannot express `warning`:
|
|
204
|
+
* `vat skills validate` exits 0 while reporting `status: warning`, so its exit
|
|
205
|
+
* code alone reads as `success` — including on the tree VAT's CI dogfoods on
|
|
206
|
+
* VAT itself.
|
|
246
207
|
*
|
|
247
|
-
* The
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
208
|
+
* The table has no row for a signal kill, a missing status code, or a document
|
|
209
|
+
* that fails to parse, and that is the design rather than an omission. A phase
|
|
210
|
+
* runs in this process: there is no serialization step in which to lose a
|
|
211
|
+
* document, and no signal that could take a phase without taking the
|
|
212
|
+
* orchestrator with it.
|
|
252
213
|
*/
|
|
253
|
-
export function
|
|
254
|
-
|
|
255
|
-
return { name, status: SYSTEM_ERROR, error: `Failed to spawn phase: ${outcome.error.message}` };
|
|
256
|
-
}
|
|
257
|
-
if (outcome.signal !== null) {
|
|
258
|
-
return {
|
|
259
|
-
name,
|
|
260
|
-
status: SYSTEM_ERROR,
|
|
261
|
-
signal: outcome.signal,
|
|
262
|
-
error: `Phase '${name}' was killed by signal ${outcome.signal}`,
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
if (outcome.status === null) {
|
|
266
|
-
return { name, status: SYSTEM_ERROR, error: `Phase '${name}' exited without a status code` };
|
|
267
|
-
}
|
|
268
|
-
const exitCode = outcome.status;
|
|
269
|
-
const { report, parseError } = parseChildReport(name, outcome.stdout);
|
|
270
|
-
if (parseError !== undefined) {
|
|
271
|
-
return { name, status: SYSTEM_ERROR, exitCode, error: parseError };
|
|
272
|
-
}
|
|
214
|
+
export function phaseResultFromOutcome(name, outcome) {
|
|
215
|
+
const { exitCode, document } = outcome;
|
|
273
216
|
const exitStatus = statusFromExitCode(exitCode);
|
|
274
|
-
const reported = statusFromReport(
|
|
217
|
+
const reported = statusFromReport(document);
|
|
275
218
|
const status = reported === undefined ? exitStatus : worseOf(exitStatus, reported);
|
|
276
219
|
return {
|
|
277
220
|
name,
|
|
@@ -280,37 +223,85 @@ export function phaseResultFromSpawn(name, outcome) {
|
|
|
280
223
|
...(exitStatus === SYSTEM_ERROR
|
|
281
224
|
? { error: `Phase '${name}' exited with system-error code ${exitCode}` }
|
|
282
225
|
: {}),
|
|
283
|
-
...(
|
|
226
|
+
...(document === undefined ? {} : { report: document }),
|
|
284
227
|
};
|
|
285
228
|
}
|
|
286
229
|
/**
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
230
|
+
* End a command-line run from a phase outcome: publish the document, then exit.
|
|
231
|
+
*
|
|
232
|
+
* THE single place the two lanes diverge, so they cannot diverge anywhere else.
|
|
233
|
+
* A phase hands back the same `{ document, exitCode }` either way; this decides
|
|
234
|
+
* what a *command* does with it, while an orchestrator folds it into
|
|
235
|
+
* `phases[].report` instead.
|
|
236
|
+
*
|
|
237
|
+
* Three cases, and the middle one is the one to get right:
|
|
238
|
+
* - an unexpected failure publishes the shared envelope in the format the
|
|
239
|
+
* operator asked for, matching `handleCommandError`;
|
|
240
|
+
* - a command's own report goes through the command's own `render`;
|
|
241
|
+
* - no document at all (an unconfigured run, a dry run) publishes nothing.
|
|
242
|
+
*
|
|
243
|
+
* 🔑 **`format` is REQUIRED, and that is the whole point of it being a
|
|
244
|
+
* parameter.** This arm hardcoded `writeYamlOutput`, and it is `vat resources
|
|
245
|
+
* validate`'s ONLY error exit — so `--format json` silently produced YAML on the
|
|
246
|
+
* one path a scripted consumer most needs to parse. The sibling
|
|
247
|
+
* `handleCommandError` has the same parameter as an OPTIONAL one carrying a
|
|
248
|
+
* docstring that says a caller with a `--format` option must pass it, and two
|
|
249
|
+
* commands added in the same change dropped it anyway: a docstring is not a
|
|
250
|
+
* mechanism. Here the type system asks, so a new caller cannot forget. A command
|
|
251
|
+
* that offers no `--format` passes `undefined` and says so at its call site.
|
|
252
|
+
*
|
|
253
|
+
* ⚠️ It governs the FAILURE envelope only. A command's own report still goes
|
|
254
|
+
* through `render`, which is what a `--format text` lane needs.
|
|
255
|
+
*
|
|
256
|
+
* @param outcome - What the phase produced
|
|
257
|
+
* @param render - How this command publishes its OWN report shape
|
|
258
|
+
* @param format - What the operator asked for: `json`, or anything else (and
|
|
259
|
+
* `undefined`) for YAML — the same two-branch switch `handleCommandError` and
|
|
260
|
+
* every success path use
|
|
291
261
|
*/
|
|
292
|
-
|
|
262
|
+
export function finishCommand(outcome, render, format) {
|
|
263
|
+
if (outcome.failed === true) {
|
|
264
|
+
if (format === 'json') {
|
|
265
|
+
writeJsonOutput(outcome.document);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
writeYamlOutput(outcome.document);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else if (outcome.document !== undefined) {
|
|
272
|
+
render(outcome.document);
|
|
273
|
+
}
|
|
274
|
+
return process.exit(outcome.exitCode);
|
|
275
|
+
}
|
|
293
276
|
/**
|
|
294
|
-
* Run a single phase
|
|
277
|
+
* Run a single phase in THIS process and fold its outcome into a result.
|
|
278
|
+
*
|
|
279
|
+
* In THIS process, because everything an orchestrator reads back from a phase is
|
|
280
|
+
* the {@link PhaseOutcome} pair. A process per phase buys neither half of it and
|
|
281
|
+
* charges, on every phase, a full Node startup and the whole module graph again
|
|
282
|
+
* (~730 ms of remark per isolate), a parse cache whose miss counters restart
|
|
283
|
+
* from zero, and a worker pool built and torn down before the next phase begins.
|
|
284
|
+
* Phases run sequentially, so none of that cost is ever overlapped with work.
|
|
285
|
+
*
|
|
286
|
+
* The `catch` is a BACKSTOP, not the error path. Every phase function reports
|
|
287
|
+
* its own failures through `reportCommandError` and returns them as a document.
|
|
295
288
|
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* stderr stays inherited — progress output is on stderr by design and must keep
|
|
300
|
-
* streaming live rather than arriving in one lump at the end.
|
|
289
|
+
* ⚠️ This arm exists for a throw that escaped that handling. Sharing the
|
|
290
|
+
* orchestrator's process is what makes it load-bearing: an escaped throw aborts
|
|
291
|
+
* the orchestrator itself and silently skips every later phase.
|
|
301
292
|
*/
|
|
302
|
-
export function runPhase(
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
293
|
+
export async function runPhase(phase) {
|
|
294
|
+
try {
|
|
295
|
+
return phaseResultFromOutcome(phase.name, await phase.run());
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
299
|
+
return {
|
|
300
|
+
name: phase.name,
|
|
301
|
+
status: SYSTEM_ERROR,
|
|
302
|
+
error: `Phase '${phase.name}' threw past its own error handling: ${detail}`,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
314
305
|
}
|
|
315
306
|
/**
|
|
316
307
|
* Worst-wins aggregate across phases. `system-error` outranks `error`: "we could
|
|
@@ -326,16 +317,16 @@ export function aggregatePhaseStatus(results) {
|
|
|
326
317
|
/**
|
|
327
318
|
* One phase's per-severity distribution, wherever that phase keeps it.
|
|
328
319
|
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
320
|
+
* A phase that holds its own findings publishes {@link PhaseResult.issueCounts}.
|
|
321
|
+
* A phase that publishes its own document deliberately does not — it owns its
|
|
322
|
+
* findings, and its document rides verbatim in {@link PhaseResult.report}.
|
|
323
|
+
*
|
|
324
|
+
* ⚠️ Both places must be read. Reading only `issueCounts` makes an
|
|
325
|
+
* orchestrator's header report `{0, 0, 0}` over phases that just reported 12
|
|
326
|
+
* warnings.
|
|
334
327
|
*
|
|
335
328
|
* Absent or malformed counts read as zero rather than throwing: a phase that
|
|
336
|
-
*
|
|
337
|
-
* answer as before this function existed — just no longer the answer for phases
|
|
338
|
-
* that DID publish one.
|
|
329
|
+
* publishes no distribution contributes nothing to the total.
|
|
339
330
|
*/
|
|
340
331
|
export function phaseIssueCounts(result) {
|
|
341
332
|
if (result.issueCounts)
|
|
@@ -354,10 +345,10 @@ export function phaseIssueCounts(result) {
|
|
|
354
345
|
* Sum every phase's distribution, so an orchestrator's header total reconciles
|
|
355
346
|
* against the phases printed beneath it.
|
|
356
347
|
*
|
|
357
|
-
* The companion to {@link aggregatePhaseStatus}: status
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* `
|
|
348
|
+
* The companion to {@link aggregatePhaseStatus}: status is worst-wins ACROSS
|
|
349
|
+
* phases, so a header whose `status` can see the phases while its `issueCounts`
|
|
350
|
+
* cannot publishes a contradiction in one document — `status: warning` beside
|
|
351
|
+
* `warnings: 0`.
|
|
361
352
|
*/
|
|
362
353
|
export function aggregatePhaseIssueCounts(results) {
|
|
363
354
|
const total = { errors: 0, warnings: 0, info: 0 };
|
|
@@ -371,14 +362,14 @@ export function aggregatePhaseIssueCounts(results) {
|
|
|
371
362
|
}
|
|
372
363
|
/**
|
|
373
364
|
* The process exit code for a set of phase outcomes, per the exit-code contract
|
|
374
|
-
* every orchestrator's help text documents:
|
|
375
|
-
*
|
|
376
|
-
* and counts instead.
|
|
365
|
+
* every orchestrator's help text documents: `OK` pass, `FINDINGS` validation
|
|
366
|
+
* failure, `ERROR` system error. Warnings do not fail a run — they are
|
|
367
|
+
* published in the status and counts instead.
|
|
377
368
|
*/
|
|
378
369
|
export function exitCodeForPhases(results) {
|
|
379
370
|
const worst = aggregatePhaseStatus(results);
|
|
380
371
|
if (worst === SYSTEM_ERROR)
|
|
381
|
-
return
|
|
382
|
-
return worst === 'error' ?
|
|
372
|
+
return ExitCode.ERROR;
|
|
373
|
+
return worst === 'error' ? ExitCode.FINDINGS : ExitCode.OK;
|
|
383
374
|
}
|
|
384
375
|
//# sourceMappingURL=phase-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase-utils.js","sourceRoot":"","sources":["../../src/commands/phase-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"phase-utils.js","sourceRoot":"","sources":["../../src/commands/phase-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAsB,UAAU,EAAuB,MAAM,4BAA4B,CAAC;AAC3G,OAAO,EAAgB,MAAM,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAkDtE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO,OAAO,CAAC,SAAS,CACtB,IAAI,MAAM,CAAC,gBAAgB,EAAE,qCAAqC,CAAC,CAAC,QAAQ,EAAE,CAC/E,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAwB,EAAE,OAAe,EAAE,OAAe;IAC1F,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO;IAE/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qCAAqC,OAAO,MAAM;QAChD,IAAI;QACJ,0BAA0B,OAAO,8CAA8C;QAC/E,8EAA8E;QAC9E,gFAAgF;QAChF,IAAI;QACJ,2BAA2B,OAAO,oCAAoC;QACtE,yFAAyF,CAC5F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAqBD,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAgB,cAAc,CAAC;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I,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAC1C,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAA+B;IACvE,MAAM,KAAK,GAAmB,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC5D,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC;QACvB,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;QAC3B,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC;IACrB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA+B;IAC/D,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,KAAK,KAAK,YAAY;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAC;IAClD,OAAO,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positional-args.d.ts","sourceRoot":"","sources":["../../src/commands/positional-args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"positional-args.d.ts","sourceRoot":"","sources":["../../src/commands/positional-args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,IAAI,CAmBN"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* `vat validate`), which operate on the whole project as the config describes
|
|
6
6
|
* it and have no path-shaped subject at all.
|
|
7
7
|
*/
|
|
8
|
+
import { ExitCode } from '@vibe-agent-toolkit/schema';
|
|
8
9
|
/**
|
|
9
10
|
* Fail the run when a caller passed a positional argument to a command that
|
|
10
11
|
* takes none, naming the argument and where to take it instead.
|
|
@@ -46,7 +47,7 @@ export function rejectPositionalArguments(operands, command, operatesOn) {
|
|
|
46
47
|
`\n` +
|
|
47
48
|
` Fix: run '${command}' with no arguments, and scope it in\n` +
|
|
48
49
|
` vibe-agent-toolkit.config.yaml.\n` +
|
|
49
|
-
` To inspect ONE skill or bundle by path, use: vat
|
|
50
|
-
process.exit(
|
|
50
|
+
` To inspect ONE skill or bundle by path, use: vat skill review <path>\n`);
|
|
51
|
+
process.exit(ExitCode.ERROR);
|
|
51
52
|
}
|
|
52
53
|
//# sourceMappingURL=positional-args.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positional-args.js","sourceRoot":"","sources":["../../src/commands/positional-args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAA2B,EAC3B,OAAe,EACf,UAAkB;IAElB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAElC,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,WAAW,OAAO,yCAAyC,MAAM,MAAM;QACrE,IAAI;QACJ,MAAM,OAAO,KAAK,UAAU,8CAA8C;QAC1E,2EAA2E;QAC3E,4EAA4E;QAC5E,4EAA4E;QAC5E,qBAAqB;QACrB,IAAI;QACJ,eAAe,OAAO,wCAAwC;QAC9D,qCAAqC;QACrC,
|
|
1
|
+
{"version":3,"file":"positional-args.js","sourceRoot":"","sources":["../../src/commands/positional-args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAA2B,EAC3B,OAAe,EACf,UAAkB;IAElB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAElC,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,WAAW,OAAO,yCAAyC,MAAM,MAAM;QACrE,IAAI;QACJ,MAAM,OAAO,KAAK,UAAU,8CAA8C;QAC1E,2EAA2E;QAC3E,4EAA4E;QAC5E,4EAA4E;QAC5E,qBAAqB;QACrB,IAAI;QACJ,eAAe,OAAO,wCAAwC;QAC9D,qCAAqC;QACrC,0EAA0E,CAC7E,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-command.d.ts","sourceRoot":"","sources":["../../../src/commands/rag/clear-command.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"clear-command.d.ts","sourceRoot":"","sources":["../../../src/commands/rag/clear-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,UAAU,YAAY;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBvE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* RAG clear command - remove all indexed data from database
|
|
3
3
|
*/
|
|
4
|
+
import { ExitCode } from '@vibe-agent-toolkit/schema';
|
|
4
5
|
import { writeYamlOutput } from '../../utils/output.js';
|
|
5
6
|
import { executeRagOperation, formatDuration } from './command-helpers.js';
|
|
6
7
|
export async function clearCommand(options) {
|
|
@@ -17,6 +18,6 @@ export async function clearCommand(options) {
|
|
|
17
18
|
message: 'Database cleared',
|
|
18
19
|
duration: formatDuration(duration),
|
|
19
20
|
});
|
|
20
|
-
process.exit(
|
|
21
|
+
process.exit(ExitCode.OK);
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=clear-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-command.js","sourceRoot":"","sources":["../../../src/commands/rag/clear-command.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"clear-command.js","sourceRoot":"","sources":["../../../src/commands/rag/clear-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAO3E,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAqB;IACtD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,MAAM,mBAAmB,CACvB,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kCAAkC;IACnE,KAAK,EAAE,WAAW,EAAE,EAAE;QACpB,kEAAkE;QAClE,MAAO,WAAgC,CAAC,KAAK,EAAE,CAAC;IAClD,CAAC,EACD,OAAO,CACR,CAAC;IAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IAExC,iBAAiB;IACjB,eAAe,CAAC;QACd,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,kBAAkB;QAC3B,QAAQ,EAAE,cAAc,CAAC,QAAQ,CAAC;KACnC,CAAC,CAAC;IAEH,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,10 +1,74 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* RAG index command - index markdown resources into vector database
|
|
3
3
|
*/
|
|
4
|
+
import type { IndexResult } from '@vibe-agent-toolkit/rag';
|
|
5
|
+
import type { UnreadableResource } from '@vibe-agent-toolkit/resources';
|
|
4
6
|
interface IndexOptions {
|
|
5
7
|
db?: string;
|
|
6
8
|
debug?: boolean;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* What an index run is allowed to report, and the exit code that agrees with it.
|
|
12
|
+
*
|
|
13
|
+
* `partial` is spelled the way `vat cache clear` spells it (see
|
|
14
|
+
* `../cache/clear.ts` — `status: 'success' | 'partial'`, exiting
|
|
15
|
+
* `partial ? 1 : 0`): a command that finished, published a complete report, and
|
|
16
|
+
* did not do all of what was asked. The vocabulary is deliberately the sibling's
|
|
17
|
+
* rather than a new one.
|
|
18
|
+
*
|
|
19
|
+
* Exit 1, not 2. This command family documents `1 - reported/expected failure`
|
|
20
|
+
* and `2 - system error` (`vat claude budget`, and the `Exit Codes:` block on
|
|
21
|
+
* every `vat rag` subcommand). A run that indexed most of a corpus and named the
|
|
22
|
+
* resources it dropped is a REPORTED outcome — the report on stdout is complete
|
|
23
|
+
* and parseable. 2 belongs to a command that could not run at all, which here is
|
|
24
|
+
* the `handleCommandError` path below.
|
|
25
|
+
*/
|
|
26
|
+
export interface IndexOutcome {
|
|
27
|
+
status: 'success' | 'partial';
|
|
28
|
+
exitCode: 0 | 1;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Derive the reported status and exit code from what indexing actually did.
|
|
32
|
+
*
|
|
33
|
+
* This existed as a hardcoded `status: 'success'` next to an unconditional
|
|
34
|
+
* `process.exit(0)`, so a run that failed a fifth of its corpus told the user —
|
|
35
|
+
* and any CI step parsing it — that everything was fine, while the dropped
|
|
36
|
+
* documents were simply unsearchable. A status field that cannot express failure
|
|
37
|
+
* is the defect; the particular failures it hid are incidental, and
|
|
38
|
+
* `indexResources` can fail a resource for any reason (unreadable file,
|
|
39
|
+
* embedding-provider error, provider unavailable).
|
|
40
|
+
*
|
|
41
|
+
* `errors` is optional on `IndexResult`'s schema, so a provider MAY omit it;
|
|
42
|
+
* `LanceDBRAGProvider` never does (it always carries `errors: []` when nothing
|
|
43
|
+
* failed). Both shapes are success here, because the schema allows both.
|
|
44
|
+
*
|
|
45
|
+
* @param indexResult - The result of the indexing run (only `errors` is read)
|
|
46
|
+
* @returns The status to publish and the exit code that agrees with it
|
|
47
|
+
*/
|
|
48
|
+
export declare function indexOutcome(indexResult: Pick<IndexResult, 'errors'>): IndexOutcome;
|
|
49
|
+
/** One entry of `IndexResult['errors']`. */
|
|
50
|
+
type IndexError = NonNullable<IndexResult['errors']>[number];
|
|
51
|
+
/**
|
|
52
|
+
* The resources the crawl enumerated but could not read, as index errors.
|
|
53
|
+
*
|
|
54
|
+
* Such a file never reaches `indexResources`: the crawl reads and parses every
|
|
55
|
+
* file itself, so an unreadable one is dropped before the provider sees it. It
|
|
56
|
+
* is therefore in none of the provider's counters and not in its `errors` —
|
|
57
|
+
* the registry keeps the reconciliation log (`getUnreadableResources()`), and
|
|
58
|
+
* this command did not read it, so a corpus with a document missing from the
|
|
59
|
+
* index was reported `status: success`, exit 0, on both crawl lanes. Folding
|
|
60
|
+
* the log into the same `errors` list the provider's failures land in is what
|
|
61
|
+
* lets one status and one exit code cover "did not index everything asked".
|
|
62
|
+
*
|
|
63
|
+
* The id is the path relative to the crawl root: the registry never assigned
|
|
64
|
+
* one (it could not read the file to), and the relative path is what an
|
|
65
|
+
* operator needs to find it.
|
|
66
|
+
*
|
|
67
|
+
* @param unreadable - The registry's read-failure log
|
|
68
|
+
* @param crawlRoot - The directory the crawl was rooted at
|
|
69
|
+
* @returns One error per unreadable file, in the order the crawl met them
|
|
70
|
+
*/
|
|
71
|
+
export declare function unreadableIndexErrors(unreadable: readonly UnreadableResource[], crawlRoot: string): IndexError[];
|
|
8
72
|
export declare function indexCommand(pathArg: string | undefined, options: IndexOptions): Promise<void>;
|
|
9
73
|
export {};
|
|
10
74
|
//# sourceMappingURL=index-command.d.ts.map
|