@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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The collector every REPEATABLE option in this CLI uses, and the reason none
|
|
3
|
+
* of them is variadic.
|
|
4
|
+
*
|
|
5
|
+
* Commander offers two spellings for "this flag takes several values":
|
|
6
|
+
*
|
|
7
|
+
* - **Variadic** β `--param <values...>`, which consumes every following token
|
|
8
|
+
* up to the next option-shaped one.
|
|
9
|
+
* - **Repeatable** β `--param <value>` passed more than once, accumulated by a
|
|
10
|
+
* custom collector. This one.
|
|
11
|
+
*
|
|
12
|
+
* The variadic spelling is unusable on a command that also has a positional
|
|
13
|
+
* argument, and every command here has one. It ate the positional:
|
|
14
|
+
* `vat resources query 'SELECT ? AS x, ? AS y' --param a docs/` bound `docs/`
|
|
15
|
+
* as the SECOND SQL VALUE, left the `[path]` positional unread, and reported
|
|
16
|
+
* `status: success` at exit 0 with `y: 'docs/'` in its rows β a token the
|
|
17
|
+
* operator typed as a location, silently reinterpreted as data. On
|
|
18
|
+
* `vat skill test run <skill>` the same shape consumed the subject and the run
|
|
19
|
+
* died claiming the subject was missing.
|
|
20
|
+
*
|
|
21
|
+
* β οΈ What the swallowed token would have DONE is a separate question, and on
|
|
22
|
+
* `query` the answer is "located the project": `[path]` there is a root
|
|
23
|
+
* locator, not a scope β see `queryCommand` β so an earlier reading of this
|
|
24
|
+
* incident as "answered about the whole tree instead of `docs/`" claimed a
|
|
25
|
+
* scoping the verb never had. The defect this module fixes is the swallow.
|
|
26
|
+
*
|
|
27
|
+
* So: no variadic options. `test/commands/no-variadic-cli-options.test.ts`
|
|
28
|
+
* enforces that against the source, because the defect is a declaration shape
|
|
29
|
+
* rather than a bug in any one command.
|
|
30
|
+
*
|
|
31
|
+
* @param value - The value Commander parsed for this occurrence of the flag
|
|
32
|
+
* @param previous - What earlier occurrences accumulated, or `undefined` for the first
|
|
33
|
+
* @returns A NEW array β never a mutation of `previous`, which on a defaulted
|
|
34
|
+
* option is shared by every parse of the same `Option` instance
|
|
35
|
+
*/
|
|
36
|
+
export declare function collectRepeated(value: string, previous?: readonly string[]): string[];
|
|
37
|
+
//# sourceMappingURL=repeatable-option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeatable-option.d.ts","sourceRoot":"","sources":["../../src/utils/repeatable-option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAErF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The collector every REPEATABLE option in this CLI uses, and the reason none
|
|
3
|
+
* of them is variadic.
|
|
4
|
+
*
|
|
5
|
+
* Commander offers two spellings for "this flag takes several values":
|
|
6
|
+
*
|
|
7
|
+
* - **Variadic** β `--param <values...>`, which consumes every following token
|
|
8
|
+
* up to the next option-shaped one.
|
|
9
|
+
* - **Repeatable** β `--param <value>` passed more than once, accumulated by a
|
|
10
|
+
* custom collector. This one.
|
|
11
|
+
*
|
|
12
|
+
* The variadic spelling is unusable on a command that also has a positional
|
|
13
|
+
* argument, and every command here has one. It ate the positional:
|
|
14
|
+
* `vat resources query 'SELECT ? AS x, ? AS y' --param a docs/` bound `docs/`
|
|
15
|
+
* as the SECOND SQL VALUE, left the `[path]` positional unread, and reported
|
|
16
|
+
* `status: success` at exit 0 with `y: 'docs/'` in its rows β a token the
|
|
17
|
+
* operator typed as a location, silently reinterpreted as data. On
|
|
18
|
+
* `vat skill test run <skill>` the same shape consumed the subject and the run
|
|
19
|
+
* died claiming the subject was missing.
|
|
20
|
+
*
|
|
21
|
+
* β οΈ What the swallowed token would have DONE is a separate question, and on
|
|
22
|
+
* `query` the answer is "located the project": `[path]` there is a root
|
|
23
|
+
* locator, not a scope β see `queryCommand` β so an earlier reading of this
|
|
24
|
+
* incident as "answered about the whole tree instead of `docs/`" claimed a
|
|
25
|
+
* scoping the verb never had. The defect this module fixes is the swallow.
|
|
26
|
+
*
|
|
27
|
+
* So: no variadic options. `test/commands/no-variadic-cli-options.test.ts`
|
|
28
|
+
* enforces that against the source, because the defect is a declaration shape
|
|
29
|
+
* rather than a bug in any one command.
|
|
30
|
+
*
|
|
31
|
+
* @param value - The value Commander parsed for this occurrence of the flag
|
|
32
|
+
* @param previous - What earlier occurrences accumulated, or `undefined` for the first
|
|
33
|
+
* @returns A NEW array β never a mutation of `previous`, which on a defaulted
|
|
34
|
+
* option is shared by every parse of the same `Option` instance
|
|
35
|
+
*/
|
|
36
|
+
export function collectRepeated(value, previous) {
|
|
37
|
+
return [...(previous ?? []), value];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=repeatable-option.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeatable-option.js","sourceRoot":"","sources":["../../src/utils/repeatable-option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,QAA4B;IACzE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,15 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utilities for loading and crawling resources
|
|
3
3
|
*/
|
|
4
|
-
import { ResourceRegistry, type ProjectConfig } from '@vibe-agent-toolkit/resources';
|
|
5
|
-
import { GitTracker } from '@vibe-agent-toolkit/utils';
|
|
4
|
+
import { ResourceRegistry, type CrawlSourceKind, type ProjectConfig, type ResourcePopulationSource } from '@vibe-agent-toolkit/resources';
|
|
5
|
+
import { GitTracker } from '@vibe-agent-toolkit/utils/git';
|
|
6
6
|
import type { Logger } from './logger.js';
|
|
7
|
+
/**
|
|
8
|
+
* Which enumerator produced a load's population.
|
|
9
|
+
*
|
|
10
|
+
* `walk` is the incumbent `crawlDirectory` route; `projection` is the
|
|
11
|
+
* projection lane behind {@link RESOURCES_CRAWL_ENV}.
|
|
12
|
+
*/
|
|
13
|
+
export type ResourceCrawlLane = 'walk' | 'projection';
|
|
7
14
|
export interface ResourceLoadResult {
|
|
8
15
|
scanPath: string;
|
|
9
16
|
projectRoot: string;
|
|
10
17
|
config: ProjectConfig | undefined;
|
|
11
18
|
registry: ResourceRegistry;
|
|
12
19
|
gitTracker: GitTracker | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Which lane enumerated, as a fact about the run rather than about the
|
|
22
|
+
* environment that requested it.
|
|
23
|
+
*
|
|
24
|
+
* Reported so that a population can be held against another one: two scans of
|
|
25
|
+
* the same tree that disagree are only interpretable if each says which
|
|
26
|
+
* enumerator produced it. Reading the env var back instead would prove what
|
|
27
|
+
* was ASKED for, never what happened β a distinction that has already voided
|
|
28
|
+
* one whole A/B on this codebase, where both arms silently ran the incumbent.
|
|
29
|
+
*/
|
|
30
|
+
lane: ResourceCrawlLane;
|
|
31
|
+
/**
|
|
32
|
+
* Which enumerator the projection lane used, or `null` when the walk ran and
|
|
33
|
+
* there was no extent to source.
|
|
34
|
+
*
|
|
35
|
+
* Reported for the same reason {@link ResourceCrawlLane} is, one level down.
|
|
36
|
+
* `lane` distinguishes the walk from the projection; it does NOT distinguish
|
|
37
|
+
* the projection's two enumerators, and `VAT_EXTENT_SOURCE` is exactly the
|
|
38
|
+
* axis a flip decision turns on. Without this, both arms of that A/B report
|
|
39
|
+
* `projection` and two identical populations mean either "the enumerators
|
|
40
|
+
* agree" or "the switch was ignored" β indistinguishable, and the second is
|
|
41
|
+
* reachable, because `crawlSourceFor` falls back to the walk without saying
|
|
42
|
+
* so when the root is not in a repository.
|
|
43
|
+
*/
|
|
44
|
+
extentSource: CrawlSourceKind | null;
|
|
13
45
|
}
|
|
14
46
|
/**
|
|
15
47
|
* Scope resource include patterns to a subdirectory of the crawl base.
|
|
@@ -23,6 +55,106 @@ export interface ResourceLoadResult {
|
|
|
23
55
|
* `docs/**\/*.md` still matches `docs/a.md`.
|
|
24
56
|
*/
|
|
25
57
|
export declare function scopeIncludeToSubtree(include: readonly string[], relDir: string): string[];
|
|
58
|
+
/**
|
|
59
|
+
* The env var that selects the crawler behind every resources-crawling verb β
|
|
60
|
+
* `vat resources scan`/`validate`, `vat rag index`, the pipeline oracles, and
|
|
61
|
+
* (via {@link withResourcePopulationSource}) the packaging verbs
|
|
62
|
+
* `vat skills build`/`validate` and `vat claude plugin build`, which is what
|
|
63
|
+
* puts `vat build` on the lane at all.
|
|
64
|
+
*
|
|
65
|
+
* An environment switch rather than a config field, for the same reason
|
|
66
|
+
* `VAT_INVENTORY_CRAWL` is one: it selects which INSTRUMENT runs, not what
|
|
67
|
+
* the project means, and it has to be reachable from the lab, which spawns the
|
|
68
|
+
* binary and controls its environment. A config field would put the A and B arms
|
|
69
|
+
* inside the subject's own tree, where a measurement edits the thing it measures.
|
|
70
|
+
*/
|
|
71
|
+
export declare const RESOURCES_CRAWL_ENV = "VAT_RESOURCES_CRAWL";
|
|
72
|
+
/** {@link RESOURCES_CRAWL_ENV}'s value that selects the projection lane. */
|
|
73
|
+
export declare const RESOURCES_CRAWL_PROJECTION = "projection";
|
|
74
|
+
/**
|
|
75
|
+
* {@link RESOURCES_CRAWL_ENV}'s value that opts BACK to the incumbent walk.
|
|
76
|
+
*
|
|
77
|
+
* The projection lane is the default now, so this is the escape hatch rather
|
|
78
|
+
* than the selector. Any other value β including the historical `projection` β
|
|
79
|
+
* leaves the projection lane selected, so existing scripts and lab arms that
|
|
80
|
+
* name it explicitly keep working and keep MEANING the same thing.
|
|
81
|
+
*/
|
|
82
|
+
export declare const RESOURCES_CRAWL_WALK = "walk";
|
|
83
|
+
/**
|
|
84
|
+
* Whether this process should source the resources population from a projection.
|
|
85
|
+
*
|
|
86
|
+
* **Defaults to the projection lane.** Both lanes now enumerate
|
|
87
|
+
* `tracked βͺ (untracked β§ Β¬ignored)` β `ResourceRegistry.crawl` passes
|
|
88
|
+
* `includeUntracked: true` per `docs/architecture/resource-scanning-and-caching.md`
|
|
89
|
+
* Β§2.1 β so the population question they answer is the same one.
|
|
90
|
+
*
|
|
91
|
+
* β οΈβ οΈ **ONE DISAGREEMENT SURVIVES, AND IT DROPS FINDINGS: SYMLINKS.** The
|
|
92
|
+
* `filesystem` extent crawls with `followSymlinks: false` and records no link's
|
|
93
|
+
* own path, and `GitCrawlSource` drops one at a single seam to match it (git's
|
|
94
|
+
* mode `120000` for the paths the tree snapshot described, an `lstat` for the
|
|
95
|
+
* collapsed `ls-files --others` entries that carry no mode) β so BOTH projection
|
|
96
|
+
* extents omit a symlink, committed or not, that the incumbent walk includes. For an out-of-tree target those bytes have no other path into the
|
|
97
|
+
* population, which means **a broken symlink the walk reports as
|
|
98
|
+
* `LINK_BROKEN_FILE` is not reported on this lane.** That is a real loss, it is
|
|
99
|
+
* known, and it is the cost this default was accepted at; closing it is its own
|
|
100
|
+
* change (teaching an extent to admit `120000` entries as their own paths).
|
|
101
|
+
* The omission is no longer SILENT β each declined link is an `info` row under
|
|
102
|
+
* one of the three declined-link codes (`EXTENT_SYMLINK_NOT_REALIZED`,
|
|
103
|
+
* `EXTENT_SYMLINK_TARGET_OUTSIDE_ROOT`, `EXTENT_SYMLINK_TARGET_UNRESOLVED` β the
|
|
104
|
+
* last is a dangling in-root target) β but no such row is a `LINK_BROKEN_FILE`
|
|
105
|
+
* finding.
|
|
106
|
+
* {@link RESOURCES_CRAWL_WALK} is the one-value escape hatch meanwhile.
|
|
107
|
+
*
|
|
108
|
+
* Read from the environment at each call rather than memoized at module load:
|
|
109
|
+
* `vitest.setup.js` deletes every `VAT_*` variable before any test module loads,
|
|
110
|
+
* so a module-level binding would make the switch unobservable to every test
|
|
111
|
+
* that sets it.
|
|
112
|
+
*
|
|
113
|
+
* @returns `true` when the projection lane is selected
|
|
114
|
+
*/
|
|
115
|
+
export declare function resourcesProjectionCrawlSelected(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Run one command's work with the projection-backed population source it
|
|
118
|
+
* selected, and the store that answers it open for the whole call.
|
|
119
|
+
*
|
|
120
|
+
* The lane-selection seam for every command that builds its OWN registry rather
|
|
121
|
+
* than going through {@link loadResourcesWithConfig} β `vat skills build` and
|
|
122
|
+
* `vat claude plugin build` (via `createProjectRegistry`) and
|
|
123
|
+
* `vat skills validate` (via its shared-context registry). Those three are what
|
|
124
|
+
* put `vat build` on the projection lane at all: before this, that verb reached
|
|
125
|
+
* a projection store on NO phase.
|
|
126
|
+
*
|
|
127
|
+
* Same selector, same store, same ignore oracle as the resource loader β
|
|
128
|
+
* deliberately, and not merely for tidiness. A second way to decide the lane is
|
|
129
|
+
* a second thing to keep in step, and a packaging lane that answered the
|
|
130
|
+
* selector differently from the validation lane would make a whole-run A/B
|
|
131
|
+
* uninterpretable: half the phases on one population, half on the other, and
|
|
132
|
+
* nothing in the output saying so.
|
|
133
|
+
*
|
|
134
|
+
* β οΈ The tracker is **not optional dressing**. With no `GitTracker` every
|
|
135
|
+
* realization row reads `gitignored: false`, so the population would admit the
|
|
136
|
+
* ignored half of a git tree β generated markdown, caches, vendored corpora β
|
|
137
|
+
* and the packaging run would start bundling and validating files the project
|
|
138
|
+
* told git to forget. One is built here when the caller has none, rooted at the
|
|
139
|
+
* same root the population is enumerated from.
|
|
140
|
+
*
|
|
141
|
+
* @param options - Where the corpus is, and what to reuse
|
|
142
|
+
* @param options.root - The absolute corpus root, which is also the basis every
|
|
143
|
+
* enumerated path is returned against
|
|
144
|
+
* @param options.gitTracker - An already-initialized tracker to reuse. Omit to
|
|
145
|
+
* have one built, which costs a `git ls-files` spawn β and only when the lane
|
|
146
|
+
* is actually selected
|
|
147
|
+
* @param options.observeExtentSource - Called with the enumerator that ran, once
|
|
148
|
+
* per enumerated root. πͺ€ NOT a cache-hit marker: on a hit no enumerator runs
|
|
149
|
+
* and this still reports the one this process selected
|
|
150
|
+
* @param work - Given the source, or `undefined` when the walk stays selected
|
|
151
|
+
* @returns Whatever `work` returned
|
|
152
|
+
*/
|
|
153
|
+
export declare function withResourcePopulationSource<T>(options: {
|
|
154
|
+
root: string;
|
|
155
|
+
gitTracker?: GitTracker | undefined;
|
|
156
|
+
observeExtentSource?: ((kind: CrawlSourceKind) => void) | undefined;
|
|
157
|
+
}, work: (populationSource: ResourcePopulationSource | undefined) => Promise<T>): Promise<T>;
|
|
26
158
|
/**
|
|
27
159
|
* Load resources from a path with config support
|
|
28
160
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-loader.d.ts","sourceRoot":"","sources":["../../src/utils/resource-loader.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"resource-loader.d.ts","sourceRoot":"","sources":["../../src/utils/resource-loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAKL,gBAAgB,EAEhB,KAAK,eAAe,EAEpB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAE9B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAmB,MAAM,+BAA+B,CAAC;AAG5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAK1C;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,YAAY,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC;;;;;;;;;OASG;IACH,IAAI,EAAE,iBAAiB,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,YAAY,EAAE,eAAe,GAAG,IAAI,CAAC;CACtC;AA0BD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAK1F;AA8DD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,gCAAgC,IAAI,OAAO,CAE1D;AAsED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,4BAA4B,CAAC,CAAC,EAClD,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,mBAAmB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACrE,EACD,IAAI,EAAE,CAAC,gBAAgB,EAAE,wBAAwB,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,GAC3E,OAAO,CAAC,CAAC,CAAC,CAoBZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC,CAwH7B"}
|
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utilities for loading and crawling resources
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { GitTracker,
|
|
4
|
+
import { buildLinkAuthEngineConfig, buildResourcePopulation, DEFAULT_RESOURCE_INCLUDE, gitExtentSelected, ResourceRegistry, } from '@vibe-agent-toolkit/resources';
|
|
5
|
+
import { relativeEscapesRoot, safePath, toForwardSlash } from '@vibe-agent-toolkit/utils';
|
|
6
|
+
import { GitTracker, gitTreeSnapshot } from '@vibe-agent-toolkit/utils/git';
|
|
7
7
|
import { loadConfig } from './config-loader.js';
|
|
8
|
+
import { collectionsOption } from './population-wiring.js';
|
|
9
|
+
import { assertDirectoryArgument } from './project-root-policy.js';
|
|
10
|
+
import { withPopulationCache } from './projection-store.js';
|
|
11
|
+
/**
|
|
12
|
+
* Refuse a `resources.linkAuth` provider that cannot compile HERE, where the
|
|
13
|
+
* config is loaded, so every verb that loads it answers the same way.
|
|
14
|
+
*
|
|
15
|
+
* `buildLinkAuthEngineConfig` is the one place the per-provider compile check
|
|
16
|
+
* (`assertProviderCompiles`) lives, and the registry calls it only when it
|
|
17
|
+
* constructs the external-link validator β i.e. under `--check-external-urls`.
|
|
18
|
+
* Every other verb on this loader (`vat validate`, `vat resources validate`
|
|
19
|
+
* without the flag, `vat resources scan`, `vat rag index`) accepted an
|
|
20
|
+
* uncompilable `when` and exited 0, while the validation-code registry
|
|
21
|
+
* promised the refusal "at config load β¦ and every other command that loads
|
|
22
|
+
* `resources.linkAuth`". The registry was right about what the contract should
|
|
23
|
+
* be; this makes the code keep it. The built config is discarded β the
|
|
24
|
+
* registry builds its own when the lane runs β because the value wanted is
|
|
25
|
+
* the throw, and calling the same function is how the two stay one check.
|
|
26
|
+
*
|
|
27
|
+
* @throws {LinkAuthConfigError} naming `providers[<n>]`, the host and the field;
|
|
28
|
+
* every caller's catch turns a thrown error into exit 2.
|
|
29
|
+
*/
|
|
30
|
+
function assertLinkAuthProvidersCompile(config) {
|
|
31
|
+
const linkAuth = config.resources?.linkAuth;
|
|
32
|
+
if (linkAuth !== undefined)
|
|
33
|
+
buildLinkAuthEngineConfig(linkAuth);
|
|
34
|
+
}
|
|
8
35
|
/**
|
|
9
36
|
* Scope resource include patterns to a subdirectory of the crawl base.
|
|
10
37
|
*
|
|
@@ -41,38 +68,211 @@ function crawlOptionsForPath(pathArg, projectRoot, config, logger) {
|
|
|
41
68
|
// safePath.relative already normalizes, but toForwardSlash makes the
|
|
42
69
|
// separator assumption in the `../` test below explicit on Windows too.
|
|
43
70
|
const normalizedRelDir = toForwardSlash(safePath.relative(projectRoot, resolved));
|
|
44
|
-
if (normalizedRelDir
|
|
71
|
+
if (relativeEscapesRoot(normalizedRelDir)) {
|
|
45
72
|
// Outside the project root, so the config's root-relative globs describe a
|
|
46
73
|
// different tree and genuinely cannot apply. Say so rather than dropping
|
|
47
74
|
// them silently β silent dropping is the bug this function exists to fix.
|
|
48
75
|
logger.warn(`${resolved} is outside projectRoot ${projectRoot}; ` +
|
|
49
76
|
`resources include/exclude patterns from the config do not apply to it`);
|
|
50
|
-
return { baseDir: resolved };
|
|
77
|
+
return { baseDir: resolved, unreadable: RESOURCES_UNREADABLE };
|
|
51
78
|
}
|
|
52
|
-
|
|
79
|
+
// The crawler used to perform this check itself, because it received the path
|
|
80
|
+
// argument as its `baseDir`. Now that `baseDir` is the project root, a bad path
|
|
81
|
+
// argument would otherwise degrade into a glob that matches nothing β a green
|
|
82
|
+
// run reporting `filesScanned: 0`.
|
|
83
|
+
assertDirectoryArgument(resolved);
|
|
53
84
|
return {
|
|
54
85
|
baseDir: projectRoot,
|
|
86
|
+
unreadable: RESOURCES_UNREADABLE,
|
|
55
87
|
include: scopeIncludeToSubtree(DEFAULT_RESOURCE_INCLUDE, normalizedRelDir),
|
|
56
88
|
...(config?.resources?.exclude ? { exclude: config.resources.exclude } : {}),
|
|
57
89
|
};
|
|
58
90
|
}
|
|
59
91
|
/**
|
|
60
|
-
*
|
|
92
|
+
* The resources verbs' ruling for a directory the crawl cannot list: refuse
|
|
93
|
+
* the run by name, exit 2 β `vat resources validate`/`scan`/`check` and every
|
|
94
|
+
* verb that reaches this loader act on the registry as the whole population,
|
|
95
|
+
* and the projection lane behind `populationSource` refuses the same directory
|
|
96
|
+
* with the same sentence, so the two lanes cannot reach different exits.
|
|
97
|
+
* See `RegistryUnreadablePolicy` on the registry.
|
|
98
|
+
*/
|
|
99
|
+
const RESOURCES_UNREADABLE = 'refuse';
|
|
100
|
+
/**
|
|
101
|
+
* The env var that selects the crawler behind every resources-crawling verb β
|
|
102
|
+
* `vat resources scan`/`validate`, `vat rag index`, the pipeline oracles, and
|
|
103
|
+
* (via {@link withResourcePopulationSource}) the packaging verbs
|
|
104
|
+
* `vat skills build`/`validate` and `vat claude plugin build`, which is what
|
|
105
|
+
* puts `vat build` on the lane at all.
|
|
61
106
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
107
|
+
* An environment switch rather than a config field, for the same reason
|
|
108
|
+
* `VAT_INVENTORY_CRAWL` is one: it selects which INSTRUMENT runs, not what
|
|
109
|
+
* the project means, and it has to be reachable from the lab, which spawns the
|
|
110
|
+
* binary and controls its environment. A config field would put the A and B arms
|
|
111
|
+
* inside the subject's own tree, where a measurement edits the thing it measures.
|
|
66
112
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
113
|
+
export const RESOURCES_CRAWL_ENV = 'VAT_RESOURCES_CRAWL';
|
|
114
|
+
/** {@link RESOURCES_CRAWL_ENV}'s value that selects the projection lane. */
|
|
115
|
+
export const RESOURCES_CRAWL_PROJECTION = 'projection';
|
|
116
|
+
/**
|
|
117
|
+
* {@link RESOURCES_CRAWL_ENV}'s value that opts BACK to the incumbent walk.
|
|
118
|
+
*
|
|
119
|
+
* The projection lane is the default now, so this is the escape hatch rather
|
|
120
|
+
* than the selector. Any other value β including the historical `projection` β
|
|
121
|
+
* leaves the projection lane selected, so existing scripts and lab arms that
|
|
122
|
+
* name it explicitly keep working and keep MEANING the same thing.
|
|
123
|
+
*/
|
|
124
|
+
export const RESOURCES_CRAWL_WALK = 'walk';
|
|
125
|
+
/**
|
|
126
|
+
* Whether this process should source the resources population from a projection.
|
|
127
|
+
*
|
|
128
|
+
* **Defaults to the projection lane.** Both lanes now enumerate
|
|
129
|
+
* `tracked βͺ (untracked β§ Β¬ignored)` β `ResourceRegistry.crawl` passes
|
|
130
|
+
* `includeUntracked: true` per `docs/architecture/resource-scanning-and-caching.md`
|
|
131
|
+
* Β§2.1 β so the population question they answer is the same one.
|
|
132
|
+
*
|
|
133
|
+
* β οΈβ οΈ **ONE DISAGREEMENT SURVIVES, AND IT DROPS FINDINGS: SYMLINKS.** The
|
|
134
|
+
* `filesystem` extent crawls with `followSymlinks: false` and records no link's
|
|
135
|
+
* own path, and `GitCrawlSource` drops one at a single seam to match it (git's
|
|
136
|
+
* mode `120000` for the paths the tree snapshot described, an `lstat` for the
|
|
137
|
+
* collapsed `ls-files --others` entries that carry no mode) β so BOTH projection
|
|
138
|
+
* extents omit a symlink, committed or not, that the incumbent walk includes. For an out-of-tree target those bytes have no other path into the
|
|
139
|
+
* population, which means **a broken symlink the walk reports as
|
|
140
|
+
* `LINK_BROKEN_FILE` is not reported on this lane.** That is a real loss, it is
|
|
141
|
+
* known, and it is the cost this default was accepted at; closing it is its own
|
|
142
|
+
* change (teaching an extent to admit `120000` entries as their own paths).
|
|
143
|
+
* The omission is no longer SILENT β each declined link is an `info` row under
|
|
144
|
+
* one of the three declined-link codes (`EXTENT_SYMLINK_NOT_REALIZED`,
|
|
145
|
+
* `EXTENT_SYMLINK_TARGET_OUTSIDE_ROOT`, `EXTENT_SYMLINK_TARGET_UNRESOLVED` β the
|
|
146
|
+
* last is a dangling in-root target) β but no such row is a `LINK_BROKEN_FILE`
|
|
147
|
+
* finding.
|
|
148
|
+
* {@link RESOURCES_CRAWL_WALK} is the one-value escape hatch meanwhile.
|
|
149
|
+
*
|
|
150
|
+
* Read from the environment at each call rather than memoized at module load:
|
|
151
|
+
* `vitest.setup.js` deletes every `VAT_*` variable before any test module loads,
|
|
152
|
+
* so a module-level binding would make the switch unobservable to every test
|
|
153
|
+
* that sets it.
|
|
154
|
+
*
|
|
155
|
+
* @returns `true` when the projection lane is selected
|
|
156
|
+
*/
|
|
157
|
+
export function resourcesProjectionCrawlSelected() {
|
|
158
|
+
return process.env[RESOURCES_CRAWL_ENV] !== RESOURCES_CRAWL_WALK;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The projection-backed enumeration for this run, or `undefined` to keep the
|
|
162
|
+
* incumbent `crawlDirectory` walk.
|
|
163
|
+
*
|
|
164
|
+
* Gated on the selector alone β and NOT additionally on a discoverable project
|
|
165
|
+
* root, which is where this differs from `vat inventory`'s
|
|
166
|
+
* `populationProviderFor`. That gate exists there because inventory membership
|
|
167
|
+
* is resolved per skill against a root the extractor derives itself, so a
|
|
168
|
+
* population rooted anywhere else answers a different question.
|
|
169
|
+
*
|
|
170
|
+
* The root the caller resolved is carried ON the source rather than merely used
|
|
171
|
+
* to build it, which is what lets `ResourceRegistry.populationFrom` decline a
|
|
172
|
+
* crawl of some OTHER tree instead of answering it with this tree's ignore
|
|
173
|
+
* oracle. This function used to argue that no second root existed to disagree
|
|
174
|
+
* with; it does β `crawlOptionsForPath` re-bases `baseDir` onto a path argument
|
|
175
|
+
* that lies outside the project root, and the packaging validator's
|
|
176
|
+
* `findProjectRoot(...) ?? dirname(skillPath)` can land on a build output
|
|
177
|
+
* directory. Both are now declined rather than served.
|
|
178
|
+
*
|
|
179
|
+
* The tracker is threaded through because its absence is not cosmetic: with no
|
|
180
|
+
* tracker every realization row reads `gitignored: false`, and the population
|
|
181
|
+
* would admit the ignored half of a git tree rather than decline it. See
|
|
182
|
+
* `buildResourcePopulation`.
|
|
183
|
+
*
|
|
184
|
+
* @param root - The root this source may answer for, and no other
|
|
185
|
+
* @param gitTracker - The run's ignore oracle
|
|
186
|
+
* @param observeExtentSource - Called with the enumerator that actually ran,
|
|
187
|
+
* once per enumerated root. The value cannot be recovered afterwards by
|
|
188
|
+
* re-reading the environment β see {@link ResourceLoadResult.extentSource}.
|
|
189
|
+
* πͺ€ On a cache hit NO enumerator runs and this still reports the one this
|
|
190
|
+
* process selected, because the source is chosen before the store is asked
|
|
191
|
+
* @param cache - The run's projection store, or `undefined` to enumerate every
|
|
192
|
+
* time. A SEPARATE selector from {@link RESOURCES_CRAWL_ENV}: which lane
|
|
193
|
+
* enumerates and whether its answer is cached are independent choices, and a
|
|
194
|
+
* cache folded into the lane switch could never be measured against it
|
|
195
|
+
* @returns A population source, or `undefined` to use the walk
|
|
196
|
+
*/
|
|
197
|
+
function populationSourceFor(root, gitTracker, observeExtentSource, cache) {
|
|
198
|
+
if (!resourcesProjectionCrawlSelected()) {
|
|
199
|
+
return undefined;
|
|
71
200
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
201
|
+
return {
|
|
202
|
+
root: safePath.resolve(root),
|
|
203
|
+
enumerate: async (enumeratedRoot) => {
|
|
204
|
+
const population = await buildResourcePopulation({
|
|
205
|
+
root: enumeratedRoot,
|
|
206
|
+
gitTracker,
|
|
207
|
+
...(cache !== undefined && { cache }),
|
|
208
|
+
// `enumeratedRoot` and this source's own `root` are the SAME directory,
|
|
209
|
+
// always: `populationFrom` compares them and declines outright when they
|
|
210
|
+
// differ, so `enumerate` is never called for another tree. Reading the
|
|
211
|
+
// declarations off the root being enumerated is therefore not a guard
|
|
212
|
+
// against a second root β it is how the declaration and the enumeration
|
|
213
|
+
// are kept demonstrably on one tree at the point of use, with no second
|
|
214
|
+
// variable to fall out of step with the one that was checked.
|
|
215
|
+
...collectionsOption(enumeratedRoot),
|
|
216
|
+
});
|
|
217
|
+
observeExtentSource(population.extentSource);
|
|
218
|
+
return { paths: population.paths, conditions: population.conditions };
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Run one command's work with the projection-backed population source it
|
|
224
|
+
* selected, and the store that answers it open for the whole call.
|
|
225
|
+
*
|
|
226
|
+
* The lane-selection seam for every command that builds its OWN registry rather
|
|
227
|
+
* than going through {@link loadResourcesWithConfig} β `vat skills build` and
|
|
228
|
+
* `vat claude plugin build` (via `createProjectRegistry`) and
|
|
229
|
+
* `vat skills validate` (via its shared-context registry). Those three are what
|
|
230
|
+
* put `vat build` on the projection lane at all: before this, that verb reached
|
|
231
|
+
* a projection store on NO phase.
|
|
232
|
+
*
|
|
233
|
+
* Same selector, same store, same ignore oracle as the resource loader β
|
|
234
|
+
* deliberately, and not merely for tidiness. A second way to decide the lane is
|
|
235
|
+
* a second thing to keep in step, and a packaging lane that answered the
|
|
236
|
+
* selector differently from the validation lane would make a whole-run A/B
|
|
237
|
+
* uninterpretable: half the phases on one population, half on the other, and
|
|
238
|
+
* nothing in the output saying so.
|
|
239
|
+
*
|
|
240
|
+
* β οΈ The tracker is **not optional dressing**. With no `GitTracker` every
|
|
241
|
+
* realization row reads `gitignored: false`, so the population would admit the
|
|
242
|
+
* ignored half of a git tree β generated markdown, caches, vendored corpora β
|
|
243
|
+
* and the packaging run would start bundling and validating files the project
|
|
244
|
+
* told git to forget. One is built here when the caller has none, rooted at the
|
|
245
|
+
* same root the population is enumerated from.
|
|
246
|
+
*
|
|
247
|
+
* @param options - Where the corpus is, and what to reuse
|
|
248
|
+
* @param options.root - The absolute corpus root, which is also the basis every
|
|
249
|
+
* enumerated path is returned against
|
|
250
|
+
* @param options.gitTracker - An already-initialized tracker to reuse. Omit to
|
|
251
|
+
* have one built, which costs a `git ls-files` spawn β and only when the lane
|
|
252
|
+
* is actually selected
|
|
253
|
+
* @param options.observeExtentSource - Called with the enumerator that ran, once
|
|
254
|
+
* per enumerated root. πͺ€ NOT a cache-hit marker: on a hit no enumerator runs
|
|
255
|
+
* and this still reports the one this process selected
|
|
256
|
+
* @param work - Given the source, or `undefined` when the walk stays selected
|
|
257
|
+
* @returns Whatever `work` returned
|
|
258
|
+
*/
|
|
259
|
+
export async function withResourcePopulationSource(options, work) {
|
|
260
|
+
// Checked before anything is built or opened: an unselected lane must cost
|
|
261
|
+
// nothing, or every command pays a tracker and a store to decline them.
|
|
262
|
+
if (!resourcesProjectionCrawlSelected()) {
|
|
263
|
+
return work(undefined);
|
|
75
264
|
}
|
|
265
|
+
const gitTracker = options.gitTracker ?? new GitTracker(options.root);
|
|
266
|
+
return withPopulationCache({ root: options.root }, async (cache) => {
|
|
267
|
+
// Initialized inside the bracket for the reason `loadResourcesWithConfig`
|
|
268
|
+
// gives at its own call: the store has already taken the snapshot that
|
|
269
|
+
// answers this tracker's question, so asking git again is a spawn spent
|
|
270
|
+
// rebuilding a set the process is holding.
|
|
271
|
+
if (options.gitTracker === undefined) {
|
|
272
|
+
await gitTracker.initialize();
|
|
273
|
+
}
|
|
274
|
+
return work(populationSourceFor(options.root, gitTracker, options.observeExtentSource ?? (() => undefined), cache));
|
|
275
|
+
});
|
|
76
276
|
}
|
|
77
277
|
/**
|
|
78
278
|
* Load resources from a path with config support
|
|
@@ -107,21 +307,29 @@ export async function loadResourcesWithConfig(pathArg, projectRoot, logger) {
|
|
|
107
307
|
const config = loadConfig(projectRoot);
|
|
108
308
|
if (config) {
|
|
109
309
|
logger.debug(`Loaded config from ${projectRoot}`);
|
|
310
|
+
assertLinkAuthProvidersCompile(config);
|
|
110
311
|
}
|
|
111
|
-
//
|
|
312
|
+
// Built here, but deliberately NOT initialized here β see the call inside the
|
|
313
|
+
// population-cache bracket below. The registry only reads the tracker during
|
|
314
|
+
// `crawl`, which happens inside that bracket, so nothing observes it empty.
|
|
112
315
|
const gitTracker = new GitTracker(projectRoot);
|
|
113
|
-
await gitTracker.initialize();
|
|
114
|
-
const stats = gitTracker.getStats();
|
|
115
|
-
logger.debug(`GitTracker initialized with ${stats.cacheSize} tracked files`);
|
|
116
316
|
// Create registry and crawl
|
|
117
|
-
// Build options conditionally to satisfy exactOptionalPropertyTypes
|
|
317
|
+
// Build options conditionally to satisfy exactOptionalPropertyTypes.
|
|
318
|
+
//
|
|
319
|
+
// π¨ The config is handed over WHENEVER one was loaded β never gated on one of
|
|
320
|
+
// its keys. This used to read `if (config?.resources?.collections)`, written
|
|
321
|
+
// when collections were the only thing the registry read from it. The registry
|
|
322
|
+
// has since grown a second consumer, `resources.linkAuth`, and the gate made
|
|
323
|
+
// it silently inert for every adopter who declared `linkAuth` without
|
|
324
|
+
// `collections`: no rewrite, no token, no `LINK_AUTH_*` code β the anonymous
|
|
325
|
+
// lane ran and the run reported success. Every read inside the registry is
|
|
326
|
+
// already `this.config?.resources?.<key>`-guarded, so an undeclared key costs
|
|
327
|
+
// nothing; a key-gate here can only ever hide the next consumer the same way.
|
|
118
328
|
const registryOptions = {
|
|
119
329
|
baseDir: projectRoot,
|
|
120
330
|
gitTracker,
|
|
331
|
+
...(config === undefined ? {} : { config }),
|
|
121
332
|
};
|
|
122
|
-
if (config?.resources?.collections) {
|
|
123
|
-
registryOptions.config = config;
|
|
124
|
-
}
|
|
125
333
|
const registry = new ResourceRegistry(registryOptions);
|
|
126
334
|
let crawlOptions;
|
|
127
335
|
if (pathArg) {
|
|
@@ -136,19 +344,74 @@ export async function loadResourcesWithConfig(pathArg, projectRoot, logger) {
|
|
|
136
344
|
logger.debug(`No path argument, using: ${projectRoot}`);
|
|
137
345
|
crawlOptions = {
|
|
138
346
|
baseDir: projectRoot,
|
|
347
|
+
unreadable: RESOURCES_UNREADABLE,
|
|
139
348
|
// Apply include patterns from config (if specified)
|
|
140
349
|
...(config?.resources?.include ? { include: config.resources.include } : {}),
|
|
141
350
|
// Apply exclude patterns from config (if specified)
|
|
142
351
|
...(config?.resources?.exclude ? { exclude: config.resources.exclude } : {}),
|
|
143
352
|
};
|
|
144
353
|
}
|
|
145
|
-
|
|
354
|
+
// Which lane enumerates. Applied to the options both branches above produced,
|
|
355
|
+
// so the path-argument case and the whole-root case cannot end up on different
|
|
356
|
+
// crawlers β the bug shape this file already carries one fix for.
|
|
357
|
+
let extentSource = null;
|
|
358
|
+
// The store brackets the crawl and is closed however the crawl ends. Nothing
|
|
359
|
+
// outside this bracket can reach it: the population source is called from
|
|
360
|
+
// inside `registry.crawl` and nowhere else.
|
|
361
|
+
const lane = await withPopulationCache({ root: projectRoot }, async (cache) => {
|
|
362
|
+
// The git enumerator takes a `gitTreeSnapshot` during the crawl below no matter
|
|
363
|
+
// what. Taking it HERE instead is the same snapshot moved a few lines earlier β
|
|
364
|
+
// the open bracket memoizes it, so the enumerator's own call becomes a lookup β
|
|
365
|
+
// and it puts the answer in hand before the tracker asks its question.
|
|
366
|
+
//
|
|
367
|
+
// β οΈ Gated, because ungated this is a LOSS: a snapshot is `git add --all` plus
|
|
368
|
+
// two more spawns, and on the filesystem enumerator or the incumbent walk
|
|
369
|
+
// nothing would ever consume it. Guarded by `gitExtentSelected` rather than a
|
|
370
|
+
// second copy of the condition, so the two cannot drift.
|
|
371
|
+
//
|
|
372
|
+
// β οΈβ οΈ BOTH HALVES, and the second one is not redundant. `gitExtentSelected`
|
|
373
|
+
// answers "which ENUMERATOR would the projection lane use", which stopped
|
|
374
|
+
// implying "the projection lane is running" the moment git became the extent
|
|
375
|
+
// default: under `VAT_RESOURCES_CRAWL=walk` it still answers true inside any
|
|
376
|
+
// repository, so the walk paid for a snapshot nothing consumed β measured at
|
|
377
|
+
// 7 git spawns on the escape hatch against 2 before the flip. The lane check
|
|
378
|
+
// is the half that went missing when the default moved.
|
|
379
|
+
if (resourcesProjectionCrawlSelected() && gitExtentSelected(projectRoot)) {
|
|
380
|
+
gitTreeSnapshot({ cwd: projectRoot });
|
|
381
|
+
}
|
|
382
|
+
// Now inside the bracket, and after the snapshot above. The set a snapshot
|
|
383
|
+
// describes β `tracked βͺ (untracked β§ Β¬ignored)` β is exactly the set this
|
|
384
|
+
// would otherwise spawn `git ls-files --cached --others --exclude-standard` to
|
|
385
|
+
// rebuild, so on the git lane it reads the answer instead of re-asking. Where
|
|
386
|
+
// no snapshot was taken the peek misses and it spawns exactly as before.
|
|
387
|
+
await gitTracker.initialize();
|
|
388
|
+
logger.debug(`GitTracker initialized with ${gitTracker.getStats().cacheSize} tracked files`);
|
|
389
|
+
const populationSource = populationSourceFor(projectRoot, gitTracker, (kind) => {
|
|
390
|
+
extentSource = kind;
|
|
391
|
+
}, cache);
|
|
392
|
+
const selected = populationSource ? 'projection' : 'walk';
|
|
393
|
+
if (populationSource) {
|
|
394
|
+
logger.debug(`Enumerating via the projection lane (${RESOURCES_CRAWL_ENV}=${RESOURCES_CRAWL_PROJECTION})`);
|
|
395
|
+
crawlOptions = { ...crawlOptions, populationSource };
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
// Said for the same reason the projection branch says it, and the symmetry
|
|
399
|
+
// is the point: a marker that only one lane emits makes the other lane
|
|
400
|
+
// identifiable by ABSENCE, which is indistinguishable from a build too old
|
|
401
|
+
// to have either lane.
|
|
402
|
+
logger.debug(`Enumerating via the incumbent walk (${RESOURCES_CRAWL_ENV} unset)`);
|
|
403
|
+
}
|
|
404
|
+
await registry.crawl(crawlOptions);
|
|
405
|
+
return selected;
|
|
406
|
+
});
|
|
146
407
|
return {
|
|
147
408
|
scanPath: pathArg ?? projectRoot,
|
|
148
409
|
projectRoot,
|
|
149
410
|
config,
|
|
150
411
|
registry,
|
|
151
412
|
gitTracker,
|
|
413
|
+
lane,
|
|
414
|
+
extentSource,
|
|
152
415
|
};
|
|
153
416
|
}
|
|
154
417
|
//# sourceMappingURL=resource-loader.js.map
|