@vibe-agent-toolkit/cli 0.1.42 β†’ 0.2.0-rc.10

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.
Files changed (504) hide show
  1. package/README.md +4 -5
  2. package/dist/bin/vat +95 -28
  3. package/dist/bin/vat.js +95 -28
  4. package/dist/bin/vat.js.map +1 -1
  5. package/dist/bin.js +137 -76
  6. package/dist/bin.js.map +1 -1
  7. package/dist/command-loaders.d.ts +44 -0
  8. package/dist/command-loaders.d.ts.map +1 -0
  9. package/dist/command-loaders.js +60 -0
  10. package/dist/command-loaders.js.map +1 -0
  11. package/dist/commands/agent/build.d.ts.map +1 -1
  12. package/dist/commands/agent/build.js +2 -1
  13. package/dist/commands/agent/build.js.map +1 -1
  14. package/dist/commands/agent/import.d.ts.map +1 -1
  15. package/dist/commands/agent/import.js +3 -2
  16. package/dist/commands/agent/import.js.map +1 -1
  17. package/dist/commands/agent/index.js +1 -1
  18. package/dist/commands/agent/install-path.d.ts +36 -0
  19. package/dist/commands/agent/install-path.d.ts.map +1 -0
  20. package/dist/commands/agent/install-path.js +44 -0
  21. package/dist/commands/agent/install-path.js.map +1 -0
  22. package/dist/commands/agent/install.d.ts.map +1 -1
  23. package/dist/commands/agent/install.js +66 -13
  24. package/dist/commands/agent/install.js.map +1 -1
  25. package/dist/commands/agent/installed.d.ts.map +1 -1
  26. package/dist/commands/agent/installed.js +22 -12
  27. package/dist/commands/agent/installed.js.map +1 -1
  28. package/dist/commands/agent/list.d.ts.map +1 -1
  29. package/dist/commands/agent/list.js +2 -1
  30. package/dist/commands/agent/list.js.map +1 -1
  31. package/dist/commands/agent/run.d.ts.map +1 -1
  32. package/dist/commands/agent/run.js +2 -1
  33. package/dist/commands/agent/run.js.map +1 -1
  34. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  35. package/dist/commands/agent/uninstall.js +13 -6
  36. package/dist/commands/agent/uninstall.js.map +1 -1
  37. package/dist/commands/agent/validate.d.ts.map +1 -1
  38. package/dist/commands/agent/validate.js +3 -2
  39. package/dist/commands/agent/validate.js.map +1 -1
  40. package/dist/commands/ard/emit.d.ts +153 -0
  41. package/dist/commands/ard/emit.d.ts.map +1 -0
  42. package/dist/commands/ard/emit.js +276 -0
  43. package/dist/commands/ard/emit.js.map +1 -0
  44. package/dist/commands/ard/index.d.ts +12 -0
  45. package/dist/commands/ard/index.d.ts.map +1 -0
  46. package/dist/commands/ard/index.js +80 -0
  47. package/dist/commands/ard/index.js.map +1 -0
  48. package/dist/commands/ard/surfaces.d.ts +56 -0
  49. package/dist/commands/ard/surfaces.d.ts.map +1 -0
  50. package/dist/commands/ard/surfaces.js +150 -0
  51. package/dist/commands/ard/surfaces.js.map +1 -0
  52. package/dist/commands/audit/distributed-tree.d.ts +60 -2
  53. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  54. package/dist/commands/audit/distributed-tree.js +73 -1
  55. package/dist/commands/audit/distributed-tree.js.map +1 -1
  56. package/dist/commands/audit/git-url-clone.d.ts +1 -1
  57. package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
  58. package/dist/commands/audit/git-url-clone.js.map +1 -1
  59. package/dist/commands/audit/hierarchical-output.d.ts +1 -1
  60. package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
  61. package/dist/commands/audit/hierarchical-output.js +1 -1
  62. package/dist/commands/audit/hierarchical-output.js.map +1 -1
  63. package/dist/commands/audit/provenance.d.ts.map +1 -1
  64. package/dist/commands/audit/provenance.js +4 -3
  65. package/dist/commands/audit/provenance.js.map +1 -1
  66. package/dist/commands/audit/scan-population.d.ts +158 -0
  67. package/dist/commands/audit/scan-population.d.ts.map +1 -0
  68. package/dist/commands/audit/scan-population.js +292 -0
  69. package/dist/commands/audit/scan-population.js.map +1 -0
  70. package/dist/commands/audit-settings.d.ts.map +1 -1
  71. package/dist/commands/audit-settings.js +6 -5
  72. package/dist/commands/audit-settings.js.map +1 -1
  73. package/dist/commands/audit.d.ts +98 -8
  74. package/dist/commands/audit.d.ts.map +1 -1
  75. package/dist/commands/audit.js +1133 -395
  76. package/dist/commands/audit.js.map +1 -1
  77. package/dist/commands/build.d.ts +1 -1
  78. package/dist/commands/build.d.ts.map +1 -1
  79. package/dist/commands/build.js +40 -36
  80. package/dist/commands/build.js.map +1 -1
  81. package/dist/commands/cache/cache-control.d.ts +82 -0
  82. package/dist/commands/cache/cache-control.d.ts.map +1 -0
  83. package/dist/commands/cache/cache-control.js +86 -0
  84. package/dist/commands/cache/cache-control.js.map +1 -0
  85. package/dist/commands/cache/clear.d.ts +105 -0
  86. package/dist/commands/cache/clear.d.ts.map +1 -0
  87. package/dist/commands/cache/clear.js +248 -0
  88. package/dist/commands/cache/clear.js.map +1 -0
  89. package/dist/commands/cache/index.d.ts +18 -0
  90. package/dist/commands/cache/index.d.ts.map +1 -0
  91. package/dist/commands/cache/index.js +94 -0
  92. package/dist/commands/cache/index.js.map +1 -0
  93. package/dist/commands/claude/claude-config.d.ts.map +1 -1
  94. package/dist/commands/claude/claude-config.js +6 -0
  95. package/dist/commands/claude/claude-config.js.map +1 -1
  96. package/dist/commands/claude/context.d.ts +340 -0
  97. package/dist/commands/claude/context.d.ts.map +1 -0
  98. package/dist/commands/claude/context.js +1080 -0
  99. package/dist/commands/claude/context.js.map +1 -0
  100. package/dist/commands/claude/index.d.ts +14 -0
  101. package/dist/commands/claude/index.d.ts.map +1 -1
  102. package/dist/commands/claude/index.js +22 -2
  103. package/dist/commands/claude/index.js.map +1 -1
  104. package/dist/commands/claude/marketplace/changelog-utils.d.ts +1 -1
  105. package/dist/commands/claude/marketplace/changelog-utils.d.ts.map +1 -1
  106. package/dist/commands/claude/marketplace/changelog-utils.js +1 -2
  107. package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
  108. package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
  109. package/dist/commands/claude/marketplace/git-publish.js +40 -31
  110. package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
  111. package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
  112. package/dist/commands/claude/marketplace/license-utils.js +0 -1
  113. package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
  114. package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
  115. package/dist/commands/claude/marketplace/publish-tree.js +0 -6
  116. package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
  117. package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
  118. package/dist/commands/claude/marketplace/publish.js +2 -1
  119. package/dist/commands/claude/marketplace/publish.js.map +1 -1
  120. package/dist/commands/claude/marketplace/validate.d.ts +73 -22
  121. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  122. package/dist/commands/claude/marketplace/validate.js +407 -72
  123. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  124. package/dist/commands/claude/org/api-keys.d.ts +0 -3
  125. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  126. package/dist/commands/claude/org/api-keys.js +2 -1
  127. package/dist/commands/claude/org/api-keys.js.map +1 -1
  128. package/dist/commands/claude/org/helpers.d.ts +54 -1
  129. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  130. package/dist/commands/claude/org/helpers.js +42 -7
  131. package/dist/commands/claude/org/helpers.js.map +1 -1
  132. package/dist/commands/claude/org/index.d.ts.map +1 -1
  133. package/dist/commands/claude/org/index.js +24 -16
  134. package/dist/commands/claude/org/index.js.map +1 -1
  135. package/dist/commands/claude/org/invites.d.ts +0 -3
  136. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  137. package/dist/commands/claude/org/invites.js +3 -2
  138. package/dist/commands/claude/org/invites.js.map +1 -1
  139. package/dist/commands/claude/org/skills.d.ts +527 -0
  140. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  141. package/dist/commands/claude/org/skills.js +1414 -108
  142. package/dist/commands/claude/org/skills.js.map +1 -1
  143. package/dist/commands/claude/org/users.d.ts +0 -3
  144. package/dist/commands/claude/org/users.d.ts.map +1 -1
  145. package/dist/commands/claude/org/users.js +6 -3
  146. package/dist/commands/claude/org/users.js.map +1 -1
  147. package/dist/commands/claude/org/workspaces.d.ts +0 -3
  148. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  149. package/dist/commands/claude/org/workspaces.js +11 -7
  150. package/dist/commands/claude/org/workspaces.js.map +1 -1
  151. package/dist/commands/claude/plugin/build.d.ts +41 -3
  152. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  153. package/dist/commands/claude/plugin/build.js +147 -80
  154. package/dist/commands/claude/plugin/build.js.map +1 -1
  155. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  156. package/dist/commands/claude/plugin/helpers.js +2 -7
  157. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  158. package/dist/commands/claude/plugin/install.d.ts +12 -0
  159. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  160. package/dist/commands/claude/plugin/install.js +93 -62
  161. package/dist/commands/claude/plugin/install.js.map +1 -1
  162. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  163. package/dist/commands/claude/plugin/list.js +3 -2
  164. package/dist/commands/claude/plugin/list.js.map +1 -1
  165. package/dist/commands/claude/plugin/marketplace-json.d.ts +24 -9
  166. package/dist/commands/claude/plugin/marketplace-json.d.ts.map +1 -1
  167. package/dist/commands/claude/plugin/marketplace-json.js +10 -9
  168. package/dist/commands/claude/plugin/marketplace-json.js.map +1 -1
  169. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  170. package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
  171. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  172. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  173. package/dist/commands/claude/plugin/plugin-files.js +3 -6
  174. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  175. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  176. package/dist/commands/claude/plugin/plugin-validators.js +3 -6
  177. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  178. package/dist/commands/claude/plugin/tree-copy.d.ts +73 -0
  179. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  180. package/dist/commands/claude/plugin/tree-copy.js +221 -14
  181. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  182. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  183. package/dist/commands/claude/plugin/uninstall.js +4 -4
  184. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  185. package/dist/commands/consistency-check.d.ts +17 -15
  186. package/dist/commands/consistency-check.d.ts.map +1 -1
  187. package/dist/commands/consistency-check.js +152 -106
  188. package/dist/commands/consistency-check.js.map +1 -1
  189. package/dist/commands/corpus/index.d.ts.map +1 -1
  190. package/dist/commands/corpus/index.js +3 -0
  191. package/dist/commands/corpus/index.js.map +1 -1
  192. package/dist/commands/corpus/report.d.ts +1 -2
  193. package/dist/commands/corpus/report.d.ts.map +1 -1
  194. package/dist/commands/corpus/report.js +1 -3
  195. package/dist/commands/corpus/report.js.map +1 -1
  196. package/dist/commands/corpus/runner.d.ts +58 -1
  197. package/dist/commands/corpus/runner.d.ts.map +1 -1
  198. package/dist/commands/corpus/runner.js +95 -41
  199. package/dist/commands/corpus/runner.js.map +1 -1
  200. package/dist/commands/corpus/scan.d.ts.map +1 -1
  201. package/dist/commands/corpus/scan.js +20 -12
  202. package/dist/commands/corpus/scan.js.map +1 -1
  203. package/dist/commands/corpus/seed.d.ts +4 -4
  204. package/dist/commands/corpus/seed.d.ts.map +1 -1
  205. package/dist/commands/corpus/seed.js +1 -3
  206. package/dist/commands/corpus/seed.js.map +1 -1
  207. package/dist/commands/doctor.d.ts +50 -0
  208. package/dist/commands/doctor.d.ts.map +1 -1
  209. package/dist/commands/doctor.js +245 -52
  210. package/dist/commands/doctor.js.map +1 -1
  211. package/dist/commands/inventory.d.ts +13 -1
  212. package/dist/commands/inventory.d.ts.map +1 -1
  213. package/dist/commands/inventory.js +128 -17
  214. package/dist/commands/inventory.js.map +1 -1
  215. package/dist/commands/mcp/collections.d.ts +1 -1
  216. package/dist/commands/mcp/collections.d.ts.map +1 -1
  217. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  218. package/dist/commands/mcp/list-collections.js +2 -1
  219. package/dist/commands/mcp/list-collections.js.map +1 -1
  220. package/dist/commands/mcp/serve.d.ts.map +1 -1
  221. package/dist/commands/mcp/serve.js +3 -2
  222. package/dist/commands/mcp/serve.js.map +1 -1
  223. package/dist/commands/okf/index.d.ts +11 -0
  224. package/dist/commands/okf/index.d.ts.map +1 -0
  225. package/dist/commands/okf/index.js +114 -0
  226. package/dist/commands/okf/index.js.map +1 -0
  227. package/dist/commands/okf/validate.d.ts +191 -0
  228. package/dist/commands/okf/validate.d.ts.map +1 -0
  229. package/dist/commands/okf/validate.js +190 -0
  230. package/dist/commands/okf/validate.js.map +1 -0
  231. package/dist/commands/phase-utils.d.ts +182 -114
  232. package/dist/commands/phase-utils.d.ts.map +1 -1
  233. package/dist/commands/phase-utils.js +154 -163
  234. package/dist/commands/phase-utils.js.map +1 -1
  235. package/dist/commands/positional-args.d.ts.map +1 -1
  236. package/dist/commands/positional-args.js +3 -2
  237. package/dist/commands/positional-args.js.map +1 -1
  238. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  239. package/dist/commands/rag/clear-command.js +2 -1
  240. package/dist/commands/rag/clear-command.js.map +1 -1
  241. package/dist/commands/rag/index-command.d.ts +64 -0
  242. package/dist/commands/rag/index-command.d.ts.map +1 -1
  243. package/dist/commands/rag/index-command.js +72 -6
  244. package/dist/commands/rag/index-command.js.map +1 -1
  245. package/dist/commands/rag/index.d.ts.map +1 -1
  246. package/dist/commands/rag/index.js +23 -10
  247. package/dist/commands/rag/index.js.map +1 -1
  248. package/dist/commands/rag/query-command.d.ts.map +1 -1
  249. package/dist/commands/rag/query-command.js +2 -1
  250. package/dist/commands/rag/query-command.js.map +1 -1
  251. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  252. package/dist/commands/rag/stats-command.js +2 -1
  253. package/dist/commands/rag/stats-command.js.map +1 -1
  254. package/dist/commands/resources/builtin-help.d.ts +27 -0
  255. package/dist/commands/resources/builtin-help.d.ts.map +1 -0
  256. package/dist/commands/resources/builtin-help.js +46 -0
  257. package/dist/commands/resources/builtin-help.js.map +1 -0
  258. package/dist/commands/resources/check-progress.d.ts +154 -0
  259. package/dist/commands/resources/check-progress.d.ts.map +1 -0
  260. package/dist/commands/resources/check-progress.js +222 -0
  261. package/dist/commands/resources/check-progress.js.map +1 -0
  262. package/dist/commands/resources/check-supervisor.d.ts +465 -0
  263. package/dist/commands/resources/check-supervisor.d.ts.map +1 -0
  264. package/dist/commands/resources/check-supervisor.js +573 -0
  265. package/dist/commands/resources/check-supervisor.js.map +1 -0
  266. package/dist/commands/resources/check.d.ts +593 -0
  267. package/dist/commands/resources/check.d.ts.map +1 -0
  268. package/dist/commands/resources/check.js +1365 -0
  269. package/dist/commands/resources/check.js.map +1 -0
  270. package/dist/commands/resources/index.d.ts.map +1 -1
  271. package/dist/commands/resources/index.js +425 -6
  272. package/dist/commands/resources/index.js.map +1 -1
  273. package/dist/commands/resources/query.d.ts +106 -0
  274. package/dist/commands/resources/query.d.ts.map +1 -0
  275. package/dist/commands/resources/query.js +177 -0
  276. package/dist/commands/resources/query.js.map +1 -0
  277. package/dist/commands/resources/scan.d.ts +24 -0
  278. package/dist/commands/resources/scan.d.ts.map +1 -1
  279. package/dist/commands/resources/scan.js +17 -8
  280. package/dist/commands/resources/scan.js.map +1 -1
  281. package/dist/commands/resources/validate.d.ts +57 -4
  282. package/dist/commands/resources/validate.d.ts.map +1 -1
  283. package/dist/commands/resources/validate.js +224 -56
  284. package/dist/commands/resources/validate.js.map +1 -1
  285. package/dist/commands/skill/review-checklist.d.ts +3 -2
  286. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  287. package/dist/commands/skill/review-checklist.js +40 -2
  288. package/dist/commands/skill/review-checklist.js.map +1 -1
  289. package/dist/commands/skill/review.d.ts +247 -0
  290. package/dist/commands/skill/review.d.ts.map +1 -1
  291. package/dist/commands/skill/review.js +99 -62
  292. package/dist/commands/skill/review.js.map +1 -1
  293. package/dist/commands/skill/test/configure.d.ts +56 -0
  294. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  295. package/dist/commands/skill/test/configure.js +75 -16
  296. package/dist/commands/skill/test/configure.js.map +1 -1
  297. package/dist/commands/skill/test/run.d.ts +63 -10
  298. package/dist/commands/skill/test/run.d.ts.map +1 -1
  299. package/dist/commands/skill/test/run.js +258 -77
  300. package/dist/commands/skill/test/run.js.map +1 -1
  301. package/dist/commands/skills/build.d.ts +94 -4
  302. package/dist/commands/skills/build.d.ts.map +1 -1
  303. package/dist/commands/skills/build.js +325 -97
  304. package/dist/commands/skills/build.js.map +1 -1
  305. package/dist/commands/skills/install.d.ts +2 -1
  306. package/dist/commands/skills/install.d.ts.map +1 -1
  307. package/dist/commands/skills/install.js +20 -31
  308. package/dist/commands/skills/install.js.map +1 -1
  309. package/dist/commands/skills/list.d.ts +2 -1
  310. package/dist/commands/skills/list.d.ts.map +1 -1
  311. package/dist/commands/skills/list.js +44 -26
  312. package/dist/commands/skills/list.js.map +1 -1
  313. package/dist/commands/skills/package.d.ts +24 -3
  314. package/dist/commands/skills/package.d.ts.map +1 -1
  315. package/dist/commands/skills/package.js +42 -17
  316. package/dist/commands/skills/package.js.map +1 -1
  317. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  318. package/dist/commands/skills/scope-guard.js +3 -5
  319. package/dist/commands/skills/scope-guard.js.map +1 -1
  320. package/dist/commands/skills/shared.d.ts.map +1 -1
  321. package/dist/commands/skills/shared.js +2 -4
  322. package/dist/commands/skills/shared.js.map +1 -1
  323. package/dist/commands/skills/skill-discovery.d.ts +47 -6
  324. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  325. package/dist/commands/skills/skill-discovery.js +66 -16
  326. package/dist/commands/skills/skill-discovery.js.map +1 -1
  327. package/dist/commands/skills/source-resolvers.d.ts +15 -0
  328. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  329. package/dist/commands/skills/source-resolvers.js +25 -4
  330. package/dist/commands/skills/source-resolvers.js.map +1 -1
  331. package/dist/commands/skills/validate-command.d.ts.map +1 -1
  332. package/dist/commands/skills/validate-command.js +11 -3
  333. package/dist/commands/skills/validate-command.js.map +1 -1
  334. package/dist/commands/skills/validate.d.ts +140 -4
  335. package/dist/commands/skills/validate.d.ts.map +1 -1
  336. package/dist/commands/skills/validate.js +224 -67
  337. package/dist/commands/skills/validate.js.map +1 -1
  338. package/dist/commands/validate.d.ts +1 -1
  339. package/dist/commands/validate.d.ts.map +1 -1
  340. package/dist/commands/validate.js +63 -27
  341. package/dist/commands/validate.js.map +1 -1
  342. package/dist/commands/verify.d.ts +119 -15
  343. package/dist/commands/verify.d.ts.map +1 -1
  344. package/dist/commands/verify.js +357 -142
  345. package/dist/commands/verify.js.map +1 -1
  346. package/dist/index.d.ts +0 -1
  347. package/dist/index.d.ts.map +1 -1
  348. package/dist/index.js +5 -1
  349. package/dist/index.js.map +1 -1
  350. package/dist/report-schemas.d.ts +45 -0
  351. package/dist/report-schemas.d.ts.map +1 -0
  352. package/dist/report-schemas.js +100 -0
  353. package/dist/report-schemas.js.map +1 -0
  354. package/dist/skill-resolution/classify.js +2 -2
  355. package/dist/skill-resolution/classify.js.map +1 -1
  356. package/dist/skill-resolution/packaging-config.d.ts +49 -5
  357. package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
  358. package/dist/skill-resolution/packaging-config.js +59 -19
  359. package/dist/skill-resolution/packaging-config.js.map +1 -1
  360. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  361. package/dist/skill-resolution/resolve-skill-reference.js +55 -57
  362. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  363. package/dist/utils/agent-discovery.d.ts.map +1 -1
  364. package/dist/utils/agent-discovery.js +22 -11
  365. package/dist/utils/agent-discovery.js.map +1 -1
  366. package/dist/utils/agent-runner.d.ts.map +1 -1
  367. package/dist/utils/agent-runner.js +7 -4
  368. package/dist/utils/agent-runner.js.map +1 -1
  369. package/dist/utils/claude-context-lens.d.ts +34 -0
  370. package/dist/utils/claude-context-lens.d.ts.map +1 -0
  371. package/dist/utils/claude-context-lens.js +39 -0
  372. package/dist/utils/claude-context-lens.js.map +1 -0
  373. package/dist/utils/command-error.d.ts +144 -7
  374. package/dist/utils/command-error.d.ts.map +1 -1
  375. package/dist/utils/command-error.js +179 -16
  376. package/dist/utils/command-error.js.map +1 -1
  377. package/dist/utils/config-loader.d.ts +2 -1
  378. package/dist/utils/config-loader.d.ts.map +1 -1
  379. package/dist/utils/config-loader.js +40 -14
  380. package/dist/utils/config-loader.js.map +1 -1
  381. package/dist/utils/corpus-target.d.ts +26 -0
  382. package/dist/utils/corpus-target.d.ts.map +1 -0
  383. package/dist/utils/corpus-target.js +35 -0
  384. package/dist/utils/corpus-target.js.map +1 -0
  385. package/dist/utils/edge-lens-evaluation.d.ts +83 -0
  386. package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
  387. package/dist/utils/edge-lens-evaluation.js +110 -0
  388. package/dist/utils/edge-lens-evaluation.js.map +1 -0
  389. package/dist/utils/help-loader.d.ts.map +1 -1
  390. package/dist/utils/help-loader.js +0 -1
  391. package/dist/utils/help-loader.js.map +1 -1
  392. package/dist/utils/issue-anchor.d.ts +2 -2
  393. package/dist/utils/issue-anchor.d.ts.map +1 -1
  394. package/dist/utils/issue-anchor.js +1 -1
  395. package/dist/utils/issue-rendering.d.ts +3 -3
  396. package/dist/utils/issue-rendering.d.ts.map +1 -1
  397. package/dist/utils/issue-rendering.js +3 -3
  398. package/dist/utils/issue-rendering.js.map +1 -1
  399. package/dist/utils/issue-severity.d.ts +12 -5
  400. package/dist/utils/issue-severity.d.ts.map +1 -1
  401. package/dist/utils/issue-severity.js +1 -1
  402. package/dist/utils/issue-severity.js.map +1 -1
  403. package/dist/utils/optional-backend.d.ts +78 -0
  404. package/dist/utils/optional-backend.d.ts.map +1 -0
  405. package/dist/utils/optional-backend.js +117 -0
  406. package/dist/utils/optional-backend.js.map +1 -0
  407. package/dist/utils/output.d.ts +26 -0
  408. package/dist/utils/output.d.ts.map +1 -1
  409. package/dist/utils/output.js +35 -0
  410. package/dist/utils/output.js.map +1 -1
  411. package/dist/utils/package-json.d.ts +24 -0
  412. package/dist/utils/package-json.d.ts.map +1 -0
  413. package/dist/utils/package-json.js +49 -0
  414. package/dist/utils/package-json.js.map +1 -0
  415. package/dist/utils/population-wiring.d.ts +100 -0
  416. package/dist/utils/population-wiring.d.ts.map +1 -0
  417. package/dist/utils/population-wiring.js +98 -0
  418. package/dist/utils/population-wiring.js.map +1 -0
  419. package/dist/utils/project-root-policy.d.ts +20 -0
  420. package/dist/utils/project-root-policy.d.ts.map +1 -1
  421. package/dist/utils/project-root-policy.js +30 -0
  422. package/dist/utils/project-root-policy.js.map +1 -1
  423. package/dist/utils/projection-lenses.d.ts +98 -0
  424. package/dist/utils/projection-lenses.d.ts.map +1 -0
  425. package/dist/utils/projection-lenses.js +203 -0
  426. package/dist/utils/projection-lenses.js.map +1 -0
  427. package/dist/utils/projection-query.d.ts +324 -0
  428. package/dist/utils/projection-query.d.ts.map +1 -0
  429. package/dist/utils/projection-query.js +357 -0
  430. package/dist/utils/projection-query.js.map +1 -0
  431. package/dist/utils/projection-store.d.ts +335 -0
  432. package/dist/utils/projection-store.d.ts.map +1 -0
  433. package/dist/utils/projection-store.js +522 -0
  434. package/dist/utils/projection-store.js.map +1 -0
  435. package/dist/utils/relation-limits.d.ts +50 -0
  436. package/dist/utils/relation-limits.d.ts.map +1 -0
  437. package/dist/utils/relation-limits.js +50 -0
  438. package/dist/utils/relation-limits.js.map +1 -0
  439. package/dist/utils/repeatable-option.d.ts +37 -0
  440. package/dist/utils/repeatable-option.d.ts.map +1 -0
  441. package/dist/utils/repeatable-option.js +39 -0
  442. package/dist/utils/repeatable-option.js.map +1 -0
  443. package/dist/utils/resource-loader.d.ts +132 -2
  444. package/dist/utils/resource-loader.d.ts.map +1 -1
  445. package/dist/utils/resource-loader.js +288 -27
  446. package/dist/utils/resource-loader.js.map +1 -1
  447. package/dist/utils/root-argv.d.ts +53 -0
  448. package/dist/utils/root-argv.d.ts.map +1 -0
  449. package/dist/utils/root-argv.js +215 -0
  450. package/dist/utils/root-argv.js.map +1 -0
  451. package/dist/utils/run-integrity.d.ts +95 -0
  452. package/dist/utils/run-integrity.d.ts.map +1 -0
  453. package/dist/utils/run-integrity.js +102 -0
  454. package/dist/utils/run-integrity.js.map +1 -0
  455. package/dist/utils/skill-discovery.d.ts.map +1 -1
  456. package/dist/utils/skill-discovery.js +2 -1
  457. package/dist/utils/skill-discovery.js.map +1 -1
  458. package/dist/utils/skill-packaging-config.d.ts +63 -1
  459. package/dist/utils/skill-packaging-config.d.ts.map +1 -1
  460. package/dist/utils/skill-packaging-config.js +56 -1
  461. package/dist/utils/skill-packaging-config.js.map +1 -1
  462. package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
  463. package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
  464. package/dist/utils/sqlite-experimental-warning.js +144 -0
  465. package/dist/utils/sqlite-experimental-warning.js.map +1 -0
  466. package/dist/utils/url-redact.d.ts.map +1 -1
  467. package/dist/utils/url-redact.js +4 -6
  468. package/dist/utils/url-redact.js.map +1 -1
  469. package/dist/utils/user-context-scanner.d.ts +8 -0
  470. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  471. package/dist/utils/user-context-scanner.js +4 -2
  472. package/dist/utils/user-context-scanner.js.map +1 -1
  473. package/dist/utils/validate-help-files.d.ts.map +1 -1
  474. package/dist/utils/validate-help-files.js +12 -6
  475. package/dist/utils/validate-help-files.js.map +1 -1
  476. package/dist/utils/vat-bin-path.d.ts +36 -0
  477. package/dist/utils/vat-bin-path.d.ts.map +1 -0
  478. package/dist/utils/vat-bin-path.js +48 -0
  479. package/dist/utils/vat-bin-path.js.map +1 -0
  480. package/dist/utils/verdict-helpers.d.ts +1 -1
  481. package/dist/utils/verdict-helpers.d.ts.map +1 -1
  482. package/dist/utils/verdict-helpers.js +1 -1
  483. package/dist/utils/verdict-helpers.js.map +1 -1
  484. package/dist/version.d.ts.map +1 -1
  485. package/dist/version.js +1 -3
  486. package/dist/version.js.map +1 -1
  487. package/docs/agent.md +2 -2
  488. package/docs/audit.md +141 -37
  489. package/docs/doctor.md +7 -6
  490. package/docs/index.md +40 -12
  491. package/docs/mcp.md +2 -2
  492. package/docs/rag.md +3 -2
  493. package/docs/resources.md +13 -3
  494. package/docs/skill-test.md +10 -9
  495. package/docs/skills.md +53 -69
  496. package/package.json +38 -27
  497. package/schemas/ard-emit.json +149 -0
  498. package/schemas/okf-validate.json +170 -0
  499. package/schemas/resources-check.json +229 -0
  500. package/schemas/skill-review.json +230 -0
  501. package/dist/commands/resources/command-helpers.d.ts +0 -5
  502. package/dist/commands/resources/command-helpers.d.ts.map +0 -1
  503. package/dist/commands/resources/command-helpers.js +0 -6
  504. 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,104 @@ 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`
102
+ * `EXTENT_SYMLINK_NOT_REALIZED` row, and a dangling in-root target is named
103
+ * there as unrealized β€” but that row is not a `LINK_BROKEN_FILE` finding.
104
+ * {@link RESOURCES_CRAWL_WALK} is the one-value escape hatch meanwhile.
105
+ *
106
+ * Read from the environment at each call rather than memoized at module load:
107
+ * `vitest.setup.js` deletes every `VAT_*` variable before any test module loads,
108
+ * so a module-level binding would make the switch unobservable to every test
109
+ * that sets it.
110
+ *
111
+ * @returns `true` when the projection lane is selected
112
+ */
113
+ export declare function resourcesProjectionCrawlSelected(): boolean;
114
+ /**
115
+ * Run one command's work with the projection-backed population source it
116
+ * selected, and the store that answers it open for the whole call.
117
+ *
118
+ * The lane-selection seam for every command that builds its OWN registry rather
119
+ * than going through {@link loadResourcesWithConfig} β€” `vat skills build` and
120
+ * `vat claude plugin build` (via `createProjectRegistry`) and
121
+ * `vat skills validate` (via its shared-context registry). Those three are what
122
+ * put `vat build` on the projection lane at all: before this, that verb reached
123
+ * a projection store on NO phase.
124
+ *
125
+ * Same selector, same store, same ignore oracle as the resource loader β€”
126
+ * deliberately, and not merely for tidiness. A second way to decide the lane is
127
+ * a second thing to keep in step, and a packaging lane that answered the
128
+ * selector differently from the validation lane would make a whole-run A/B
129
+ * uninterpretable: half the phases on one population, half on the other, and
130
+ * nothing in the output saying so.
131
+ *
132
+ * ⚠️ The tracker is **not optional dressing**. With no `GitTracker` every
133
+ * realization row reads `gitignored: false`, so the population would admit the
134
+ * ignored half of a git tree β€” generated markdown, caches, vendored corpora β€”
135
+ * and the packaging run would start bundling and validating files the project
136
+ * told git to forget. One is built here when the caller has none, rooted at the
137
+ * same root the population is enumerated from.
138
+ *
139
+ * @param options - Where the corpus is, and what to reuse
140
+ * @param options.root - The absolute corpus root, which is also the basis every
141
+ * enumerated path is returned against
142
+ * @param options.gitTracker - An already-initialized tracker to reuse. Omit to
143
+ * have one built, which costs a `git ls-files` spawn β€” and only when the lane
144
+ * is actually selected
145
+ * @param options.observeExtentSource - Called with the enumerator that ran, once
146
+ * per enumerated root. πŸͺ€ NOT a cache-hit marker: on a hit no enumerator runs
147
+ * and this still reports the one this process selected
148
+ * @param work - Given the source, or `undefined` when the walk stays selected
149
+ * @returns Whatever `work` returned
150
+ */
151
+ export declare function withResourcePopulationSource<T>(options: {
152
+ root: string;
153
+ gitTracker?: GitTracker | undefined;
154
+ observeExtentSource?: ((kind: CrawlSourceKind) => void) | undefined;
155
+ }, work: (populationSource: ResourcePopulationSource | undefined) => Promise<T>): Promise<T>;
26
156
  /**
27
157
  * Load resources from a path with config support
28
158
  *
@@ -1 +1 @@
1
- {"version":3,"file":"resource-loader.d.ts","sourceRoot":"","sources":["../../src/utils/resource-loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAEL,gBAAgB,EAEhB,KAAK,aAAa,EAEnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAA4B,MAAM,2BAA2B,CAAC;AAGjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,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;CACpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAK1F;AAkED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC,CAuD7B"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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 { existsSync, statSync } from 'node:fs';
5
- import { DEFAULT_RESOURCE_INCLUDE, ResourceRegistry, } from '@vibe-agent-toolkit/resources';
6
- import { GitTracker, safePath, toForwardSlash } from '@vibe-agent-toolkit/utils';
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,209 @@ 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 === '..' || normalizedRelDir.startsWith('../')) {
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
- assertCrawlableDirectory(resolved);
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
- * Fail loudly on a path argument that cannot be crawled.
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
- * The crawler used to perform this check itself, because it received the path
63
- * argument as its `baseDir`. Now that `baseDir` is the project root, a bad path
64
- * argument would otherwise degrade into a glob that matches nothing β€” a green
65
- * run reporting `filesScanned: 0`.
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
- function assertCrawlableDirectory(resolved) {
68
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI path argument, resolved above
69
- if (!existsSync(resolved)) {
70
- throw new Error(`Path does not exist: ${resolved}`);
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`
144
+ * `EXTENT_SYMLINK_NOT_REALIZED` row, and a dangling in-root target is named
145
+ * there as unrealized β€” but that row is not a `LINK_BROKEN_FILE` finding.
146
+ * {@link RESOURCES_CRAWL_WALK} is the one-value escape hatch meanwhile.
147
+ *
148
+ * Read from the environment at each call rather than memoized at module load:
149
+ * `vitest.setup.js` deletes every `VAT_*` variable before any test module loads,
150
+ * so a module-level binding would make the switch unobservable to every test
151
+ * that sets it.
152
+ *
153
+ * @returns `true` when the projection lane is selected
154
+ */
155
+ export function resourcesProjectionCrawlSelected() {
156
+ return process.env[RESOURCES_CRAWL_ENV] !== RESOURCES_CRAWL_WALK;
157
+ }
158
+ /**
159
+ * The projection-backed enumeration for this run, or `undefined` to keep the
160
+ * incumbent `crawlDirectory` walk.
161
+ *
162
+ * Gated on the selector alone β€” and NOT additionally on a discoverable project
163
+ * root, which is where this differs from `vat inventory`'s
164
+ * `populationProviderFor`. That gate exists there because inventory membership
165
+ * is resolved per skill against a root the extractor derives itself, so a
166
+ * population rooted anywhere else answers a different question.
167
+ *
168
+ * The root the caller resolved is carried ON the source rather than merely used
169
+ * to build it, which is what lets `ResourceRegistry.populationFrom` decline a
170
+ * crawl of some OTHER tree instead of answering it with this tree's ignore
171
+ * oracle. This function used to argue that no second root existed to disagree
172
+ * with; it does β€” `crawlOptionsForPath` re-bases `baseDir` onto a path argument
173
+ * that lies outside the project root, and the packaging validator's
174
+ * `findProjectRoot(...) ?? dirname(skillPath)` can land on a build output
175
+ * directory. Both are now declined rather than served.
176
+ *
177
+ * The tracker is threaded through because its absence is not cosmetic: with no
178
+ * tracker every realization row reads `gitignored: false`, and the population
179
+ * would admit the ignored half of a git tree rather than decline it. See
180
+ * `buildResourcePopulation`.
181
+ *
182
+ * @param root - The root this source may answer for, and no other
183
+ * @param gitTracker - The run's ignore oracle
184
+ * @param observeExtentSource - Called with the enumerator that actually ran,
185
+ * once per enumerated root. The value cannot be recovered afterwards by
186
+ * re-reading the environment β€” see {@link ResourceLoadResult.extentSource}.
187
+ * πŸͺ€ On a cache hit NO enumerator runs and this still reports the one this
188
+ * process selected, because the source is chosen before the store is asked
189
+ * @param cache - The run's projection store, or `undefined` to enumerate every
190
+ * time. A SEPARATE selector from {@link RESOURCES_CRAWL_ENV}: which lane
191
+ * enumerates and whether its answer is cached are independent choices, and a
192
+ * cache folded into the lane switch could never be measured against it
193
+ * @returns A population source, or `undefined` to use the walk
194
+ */
195
+ function populationSourceFor(root, gitTracker, observeExtentSource, cache) {
196
+ if (!resourcesProjectionCrawlSelected()) {
197
+ return undefined;
71
198
  }
72
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI path argument, existence checked above
73
- if (!statSync(resolved).isDirectory()) {
74
- throw new Error(`Path is not a directory: ${resolved}`);
199
+ return {
200
+ root: safePath.resolve(root),
201
+ enumerate: async (enumeratedRoot) => {
202
+ const population = await buildResourcePopulation({
203
+ root: enumeratedRoot,
204
+ gitTracker,
205
+ ...(cache !== undefined && { cache }),
206
+ // `enumeratedRoot` and this source's own `root` are the SAME directory,
207
+ // always: `populationFrom` compares them and declines outright when they
208
+ // differ, so `enumerate` is never called for another tree. Reading the
209
+ // declarations off the root being enumerated is therefore not a guard
210
+ // against a second root β€” it is how the declaration and the enumeration
211
+ // are kept demonstrably on one tree at the point of use, with no second
212
+ // variable to fall out of step with the one that was checked.
213
+ ...collectionsOption(enumeratedRoot),
214
+ });
215
+ observeExtentSource(population.extentSource);
216
+ return { paths: population.paths, conditions: population.conditions };
217
+ },
218
+ };
219
+ }
220
+ /**
221
+ * Run one command's work with the projection-backed population source it
222
+ * selected, and the store that answers it open for the whole call.
223
+ *
224
+ * The lane-selection seam for every command that builds its OWN registry rather
225
+ * than going through {@link loadResourcesWithConfig} β€” `vat skills build` and
226
+ * `vat claude plugin build` (via `createProjectRegistry`) and
227
+ * `vat skills validate` (via its shared-context registry). Those three are what
228
+ * put `vat build` on the projection lane at all: before this, that verb reached
229
+ * a projection store on NO phase.
230
+ *
231
+ * Same selector, same store, same ignore oracle as the resource loader β€”
232
+ * deliberately, and not merely for tidiness. A second way to decide the lane is
233
+ * a second thing to keep in step, and a packaging lane that answered the
234
+ * selector differently from the validation lane would make a whole-run A/B
235
+ * uninterpretable: half the phases on one population, half on the other, and
236
+ * nothing in the output saying so.
237
+ *
238
+ * ⚠️ The tracker is **not optional dressing**. With no `GitTracker` every
239
+ * realization row reads `gitignored: false`, so the population would admit the
240
+ * ignored half of a git tree β€” generated markdown, caches, vendored corpora β€”
241
+ * and the packaging run would start bundling and validating files the project
242
+ * told git to forget. One is built here when the caller has none, rooted at the
243
+ * same root the population is enumerated from.
244
+ *
245
+ * @param options - Where the corpus is, and what to reuse
246
+ * @param options.root - The absolute corpus root, which is also the basis every
247
+ * enumerated path is returned against
248
+ * @param options.gitTracker - An already-initialized tracker to reuse. Omit to
249
+ * have one built, which costs a `git ls-files` spawn β€” and only when the lane
250
+ * is actually selected
251
+ * @param options.observeExtentSource - Called with the enumerator that ran, once
252
+ * per enumerated root. πŸͺ€ NOT a cache-hit marker: on a hit no enumerator runs
253
+ * and this still reports the one this process selected
254
+ * @param work - Given the source, or `undefined` when the walk stays selected
255
+ * @returns Whatever `work` returned
256
+ */
257
+ export async function withResourcePopulationSource(options, work) {
258
+ // Checked before anything is built or opened: an unselected lane must cost
259
+ // nothing, or every command pays a tracker and a store to decline them.
260
+ if (!resourcesProjectionCrawlSelected()) {
261
+ return work(undefined);
75
262
  }
263
+ const gitTracker = options.gitTracker ?? new GitTracker(options.root);
264
+ return withPopulationCache({ root: options.root }, async (cache) => {
265
+ // Initialized inside the bracket for the reason `loadResourcesWithConfig`
266
+ // gives at its own call: the store has already taken the snapshot that
267
+ // answers this tracker's question, so asking git again is a spawn spent
268
+ // rebuilding a set the process is holding.
269
+ if (options.gitTracker === undefined) {
270
+ await gitTracker.initialize();
271
+ }
272
+ return work(populationSourceFor(options.root, gitTracker, options.observeExtentSource ?? (() => undefined), cache));
273
+ });
76
274
  }
77
275
  /**
78
276
  * Load resources from a path with config support
@@ -107,21 +305,29 @@ export async function loadResourcesWithConfig(pathArg, projectRoot, logger) {
107
305
  const config = loadConfig(projectRoot);
108
306
  if (config) {
109
307
  logger.debug(`Loaded config from ${projectRoot}`);
308
+ assertLinkAuthProvidersCompile(config);
110
309
  }
111
- // Create and initialize GitTracker anchored at the resolved projectRoot.
310
+ // Built here, but deliberately NOT initialized here β€” see the call inside the
311
+ // population-cache bracket below. The registry only reads the tracker during
312
+ // `crawl`, which happens inside that bracket, so nothing observes it empty.
112
313
  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
314
  // Create registry and crawl
117
- // Build options conditionally to satisfy exactOptionalPropertyTypes
315
+ // Build options conditionally to satisfy exactOptionalPropertyTypes.
316
+ //
317
+ // 🚨 The config is handed over WHENEVER one was loaded β€” never gated on one of
318
+ // its keys. This used to read `if (config?.resources?.collections)`, written
319
+ // when collections were the only thing the registry read from it. The registry
320
+ // has since grown a second consumer, `resources.linkAuth`, and the gate made
321
+ // it silently inert for every adopter who declared `linkAuth` without
322
+ // `collections`: no rewrite, no token, no `LINK_AUTH_*` code β€” the anonymous
323
+ // lane ran and the run reported success. Every read inside the registry is
324
+ // already `this.config?.resources?.<key>`-guarded, so an undeclared key costs
325
+ // nothing; a key-gate here can only ever hide the next consumer the same way.
118
326
  const registryOptions = {
119
327
  baseDir: projectRoot,
120
328
  gitTracker,
329
+ ...(config === undefined ? {} : { config }),
121
330
  };
122
- if (config?.resources?.collections) {
123
- registryOptions.config = config;
124
- }
125
331
  const registry = new ResourceRegistry(registryOptions);
126
332
  let crawlOptions;
127
333
  if (pathArg) {
@@ -136,19 +342,74 @@ export async function loadResourcesWithConfig(pathArg, projectRoot, logger) {
136
342
  logger.debug(`No path argument, using: ${projectRoot}`);
137
343
  crawlOptions = {
138
344
  baseDir: projectRoot,
345
+ unreadable: RESOURCES_UNREADABLE,
139
346
  // Apply include patterns from config (if specified)
140
347
  ...(config?.resources?.include ? { include: config.resources.include } : {}),
141
348
  // Apply exclude patterns from config (if specified)
142
349
  ...(config?.resources?.exclude ? { exclude: config.resources.exclude } : {}),
143
350
  };
144
351
  }
145
- await registry.crawl(crawlOptions);
352
+ // Which lane enumerates. Applied to the options both branches above produced,
353
+ // so the path-argument case and the whole-root case cannot end up on different
354
+ // crawlers β€” the bug shape this file already carries one fix for.
355
+ let extentSource = null;
356
+ // The store brackets the crawl and is closed however the crawl ends. Nothing
357
+ // outside this bracket can reach it: the population source is called from
358
+ // inside `registry.crawl` and nowhere else.
359
+ const lane = await withPopulationCache({ root: projectRoot }, async (cache) => {
360
+ // The git enumerator takes a `gitTreeSnapshot` during the crawl below no matter
361
+ // what. Taking it HERE instead is the same snapshot moved a few lines earlier β€”
362
+ // the open bracket memoizes it, so the enumerator's own call becomes a lookup β€”
363
+ // and it puts the answer in hand before the tracker asks its question.
364
+ //
365
+ // ⚠️ Gated, because ungated this is a LOSS: a snapshot is `git add --all` plus
366
+ // two more spawns, and on the filesystem enumerator or the incumbent walk
367
+ // nothing would ever consume it. Guarded by `gitExtentSelected` rather than a
368
+ // second copy of the condition, so the two cannot drift.
369
+ //
370
+ // ⚠️⚠️ BOTH HALVES, and the second one is not redundant. `gitExtentSelected`
371
+ // answers "which ENUMERATOR would the projection lane use", which stopped
372
+ // implying "the projection lane is running" the moment git became the extent
373
+ // default: under `VAT_RESOURCES_CRAWL=walk` it still answers true inside any
374
+ // repository, so the walk paid for a snapshot nothing consumed β€” measured at
375
+ // 7 git spawns on the escape hatch against 2 before the flip. The lane check
376
+ // is the half that went missing when the default moved.
377
+ if (resourcesProjectionCrawlSelected() && gitExtentSelected(projectRoot)) {
378
+ gitTreeSnapshot({ cwd: projectRoot });
379
+ }
380
+ // Now inside the bracket, and after the snapshot above. The set a snapshot
381
+ // describes β€” `tracked βˆͺ (untracked ∧ Β¬ignored)` β€” is exactly the set this
382
+ // would otherwise spawn `git ls-files --cached --others --exclude-standard` to
383
+ // rebuild, so on the git lane it reads the answer instead of re-asking. Where
384
+ // no snapshot was taken the peek misses and it spawns exactly as before.
385
+ await gitTracker.initialize();
386
+ logger.debug(`GitTracker initialized with ${gitTracker.getStats().cacheSize} tracked files`);
387
+ const populationSource = populationSourceFor(projectRoot, gitTracker, (kind) => {
388
+ extentSource = kind;
389
+ }, cache);
390
+ const selected = populationSource ? 'projection' : 'walk';
391
+ if (populationSource) {
392
+ logger.debug(`Enumerating via the projection lane (${RESOURCES_CRAWL_ENV}=${RESOURCES_CRAWL_PROJECTION})`);
393
+ crawlOptions = { ...crawlOptions, populationSource };
394
+ }
395
+ else {
396
+ // Said for the same reason the projection branch says it, and the symmetry
397
+ // is the point: a marker that only one lane emits makes the other lane
398
+ // identifiable by ABSENCE, which is indistinguishable from a build too old
399
+ // to have either lane.
400
+ logger.debug(`Enumerating via the incumbent walk (${RESOURCES_CRAWL_ENV} unset)`);
401
+ }
402
+ await registry.crawl(crawlOptions);
403
+ return selected;
404
+ });
146
405
  return {
147
406
  scanPath: pathArg ?? projectRoot,
148
407
  projectRoot,
149
408
  config,
150
409
  registry,
151
410
  gitTracker,
411
+ lane,
412
+ extentSource,
152
413
  };
153
414
  }
154
415
  //# sourceMappingURL=resource-loader.js.map