@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.
Files changed (504) hide show
  1. package/README.md +4 -5
  2. package/dist/bin/vat +97 -28
  3. package/dist/bin/vat.js +97 -28
  4. package/dist/bin/vat.js.map +1 -1
  5. package/dist/bin.js +115 -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 +165 -0
  41. package/dist/commands/ard/emit.d.ts.map +1 -0
  42. package/dist/commands/ard/emit.js +338 -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 +84 -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 +2 -2
  53. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  54. package/dist/commands/audit/distributed-tree.js +11 -7
  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 +1150 -394
  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 +34 -6
  86. package/dist/commands/cache/clear.d.ts.map +1 -1
  87. package/dist/commands/cache/clear.js +101 -15
  88. package/dist/commands/cache/clear.js.map +1 -1
  89. package/dist/commands/cache/index.d.ts +13 -63
  90. package/dist/commands/cache/index.d.ts.map +1 -1
  91. package/dist/commands/cache/index.js +47 -79
  92. package/dist/commands/cache/index.js.map +1 -1
  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 +372 -0
  97. package/dist/commands/claude/context.d.ts.map +1 -0
  98. package/dist/commands/claude/context.js +1115 -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 +121 -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 +116 -0
  226. package/dist/commands/okf/index.js.map +1 -0
  227. package/dist/commands/okf/validate.d.ts +195 -0
  228. package/dist/commands/okf/validate.d.ts.map +1 -0
  229. package/dist/commands/okf/validate.js +199 -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 +167 -0
  259. package/dist/commands/resources/check-progress.d.ts.map +1 -0
  260. package/dist/commands/resources/check-progress.js +250 -0
  261. package/dist/commands/resources/check-progress.js.map +1 -0
  262. package/dist/commands/resources/check-supervisor.d.ts +479 -0
  263. package/dist/commands/resources/check-supervisor.d.ts.map +1 -0
  264. package/dist/commands/resources/check-supervisor.js +587 -0
  265. package/dist/commands/resources/check-supervisor.js.map +1 -0
  266. package/dist/commands/resources/check.d.ts +620 -0
  267. package/dist/commands/resources/check.d.ts.map +1 -0
  268. package/dist/commands/resources/check.js +1452 -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 +430 -4
  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 +42 -2
  282. package/dist/commands/resources/validate.d.ts.map +1 -1
  283. package/dist/commands/resources/validate.js +208 -55
  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 +100 -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 +1 -1
  314. package/dist/commands/skills/package.d.ts.map +1 -1
  315. package/dist/commands/skills/package.js +6 -8
  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 +8 -6
  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 +61 -11
  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 +143 -20
  374. package/dist/utils/command-error.d.ts.map +1 -1
  375. package/dist/utils/command-error.js +179 -36
  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 +72 -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 +134 -2
  444. package/dist/utils/resource-loader.d.ts.map +1 -1
  445. package/dist/utils/resource-loader.js +290 -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 +143 -39
  489. package/docs/doctor.md +7 -6
  490. package/docs/index.md +19 -11
  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 +36 -27
  497. package/schemas/ard-emit.json +152 -0
  498. package/schemas/okf-validate.json +170 -0
  499. package/schemas/resources-check.json +257 -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 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/commands/resources/query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AASH,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,iCAAiC,CAAC;AAGzC,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,yDAAyD;AACzD,UAAU,YAAa,SAAQ,oBAAoB;IACjD,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,2BAA4B,SAAQ,YAAY;IAC/D,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,2BAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2B1G;AAsCD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * `vat resources query` — ask the resource projection a read-only SQL question.
3
+ *
4
+ * ## Why a query verb at all, when `scan` already reports counts
5
+ *
6
+ * `vat resources scan` answers the questions its payload was written for, and
7
+ * nothing else. The projection holds a table per fact kind — realizations, references,
8
+ * sections, conditions, provenance, rule patterns — and every question nobody
9
+ * anticipated currently has no answer short of writing a new command. This verb
10
+ * is the general case: one statement, the rows it selects, no new field.
11
+ *
12
+ * ## 🔑 One tree, one answer — and that is now a property, not a promise
13
+ *
14
+ * The SQL always runs against a per-run in-memory database holding this tree's
15
+ * projection and nothing else. A selected projection store makes the POPULATION
16
+ * cheap and is never queried, because it is one database per VAT release shared
17
+ * by every root on the machine — querying it answered from other repositories,
18
+ * with a two-file corpus reporting 5,779 rows instead of 3.
19
+ * `utils/projection-query.ts`'s header carries the measurement and the reasoning.
20
+ *
21
+ * ## 🔑 The document says where its rows came from, and that is the cache tell
22
+ *
23
+ * `population` reports whether the projection was **derived** this run or read
24
+ * from the **store**. It has to be reported, because it cannot be inferred: a
25
+ * correct hit and a correct re-derivation produce byte-identical rows, so "did
26
+ * the cache work" is otherwise unfalsifiable — this repository's most repeated
27
+ * failure. The signal is real rather than declarative: a store hit
28
+ * short-circuits `populate()` before the builder exists, so no contributor runs
29
+ * and no timing record is filed. An empty record list IS the hit.
30
+ *
31
+ * `populationSecs` sits beside it and says what that origin was worth — the wall
32
+ * time of the setup both this verb and `vat resources check` pay before either
33
+ * runs a statement. Measured as that field on this repository with the parse
34
+ * cache warm: 1.16-1.18 s derived against 0.29-0.31 s served. Without it the
35
+ * tell is a label a reader has to trust; with it the saving is a number they can
36
+ * check, and a per-statement cost published elsewhere has something to be read
37
+ * against. `utils/projection-query.ts` states exactly which work the span covers
38
+ * and why its start line is load-bearing.
39
+ *
40
+ * ## What this verb does NOT do
41
+ *
42
+ * It does not decode. Rows come back exactly as SQLite holds them — a boolean as
43
+ * `0`/`1`, a date and a JSON column as text — because decoding needs a table
44
+ * spec and arbitrary SQL has none. `SqlQueryableStore.query`'s docstring is the
45
+ * authority on why.
46
+ */
47
+ import { ExitCode } from '@vibe-agent-toolkit/schema';
48
+ import { handleCommandError } from '../../utils/command-error.js';
49
+ import { formatDurationSecs } from '../../utils/duration.js';
50
+ import { createLogger } from '../../utils/logger.js';
51
+ import { writeStructuredOutput } from '../../utils/output.js';
52
+ import { assertDirectoryArgument, projectRootOrLoudCwd } from '../../utils/project-root-policy.js';
53
+ import { withQueriedProjection, } from '../../utils/projection-query.js';
54
+ import { relationBoundsFor } from '../../utils/relation-limits.js';
55
+ /**
56
+ * Build the query payload.
57
+ *
58
+ * Pure: no file system, no clock, no `process.exit` — the same contract
59
+ * `buildScanOutputData` follows, and for the same reason: it keeps the
60
+ * document's shape, field names included, under unit test rather than only
61
+ * under a CLI spawn.
62
+ *
63
+ * `rowCount` is stated beside `rows` rather than left for the consumer to
64
+ * count, because the two answer different questions once a caller pipes the
65
+ * document somewhere: a truncated read still carries the true total.
66
+ *
67
+ * @param input - The rows and the provenance of the run that produced them
68
+ * @returns The document to serialize
69
+ */
70
+ export function buildProjectionQueryOutputData(input) {
71
+ return {
72
+ status: 'success',
73
+ // Stated once, and the only absolute path in the document.
74
+ root: input.root,
75
+ // The cache tell — see the header.
76
+ population: input.population,
77
+ // Immediately after the origin, because the two are one statement: served
78
+ // or derived, and what that was worth. Separated they read as two unrelated
79
+ // numbers in a list.
80
+ populationSecs: formatDurationSecs(input.populationMs),
81
+ // Beside the population it is NOT part of. A store hit does not make a lens
82
+ // evaluation cheaper, so folding it into `populationSecs` would read as the
83
+ // store having got worse. See `ProjectionProvenance.lensMs`.
84
+ lensSecs: formatDurationSecs(input.lensMs),
85
+ // 🔑 What that number covers. A lens is evaluated only when THIS statement
86
+ // names one of its relations, so an empty list beside `lensSecs: 0` is the
87
+ // statement saying it asked for none — not a lens that silently stopped
88
+ // running. See `ProjectionProvenance.lensesEvaluated`.
89
+ lensesEvaluated: input.lensesEvaluated,
90
+ // The bounds of the rows below, stated ONCE and only when a bounded lens
91
+ // ran — `relation-limits.ts` carries why the SQL route owes them at all.
92
+ ...relationBoundsFor(input.lensesEvaluated),
93
+ rowCount: input.rows.length,
94
+ durationSecs: formatDurationSecs(input.durationMs),
95
+ rows: input.rows,
96
+ };
97
+ }
98
+ /**
99
+ * Populate the tree and run the caller's one statement against it.
100
+ *
101
+ * Thin by design: everything that is not "one statement, all its rows" —
102
+ * population, store selection, the ephemeral fallback, the cache tell and the
103
+ * legible-failure wrapper — is shared with `vat resources check` in
104
+ * {@link withQueriedProjection}, so the two verbs cannot drift into answering
105
+ * about different corpora.
106
+ *
107
+ * @param options - The run
108
+ * @param options.root - Absolute corpus root
109
+ * @param options.sql - The single read-only statement
110
+ * @param options.parameters - Bound in order, for every `?`
111
+ * @param options.logger - Where blob-stage refusals are reported
112
+ * @returns The rows and the provenance of the population behind them
113
+ */
114
+ async function runProjectionQuery(options) {
115
+ const { root, sql, parameters, logger } = options;
116
+ // The statement is compiled against the empty schema first, so a typo'd
117
+ // column — or a `?` with no `--param` behind it — costs milliseconds instead
118
+ // of a full population.
119
+ return withQueriedProjection(
120
+ // `statements` as well as `preflight`, and the two are not redundant: the
121
+ // preflight COMPILES this statement early, while `statements` decides which
122
+ // derived relations get evaluated at all. One statement, two questions asked
123
+ // of it.
124
+ { root, logger, preflight: [{ sql, parameters }], statements: [sql] }, (ask, provenance) => ({ rows: ask(sql, ...parameters), ...provenance }));
125
+ }
126
+ /**
127
+ * Run one read-only SQL statement against this tree's resource projection.
128
+ *
129
+ * ## 🔑 `[path]` LOCATES the project. It never narrows the corpus.
130
+ *
131
+ * `vat resources scan docs/` scopes its crawl to `docs/`; this verb cannot offer
132
+ * the same, and says so rather than pretending. The projection is the whole
133
+ * tracked tree by construction — one population per `(root, treeHash)`, and a
134
+ * subtree population would be filed in the shared store under the whole tree's
135
+ * key, which is the cross-tree class `utils/projection-query.ts` documents —
136
+ * and arbitrary SQL cannot be post-filtered by path (blobs carry none). So the
137
+ * argument is where root discovery STARTS, the answer is about the tree it
138
+ * finds, and `root` in the document names that tree. A `WHERE path LIKE …` is
139
+ * the only scope a statement has, exactly as `vat resources check` documents.
140
+ *
141
+ * 🚨 Which is why a locator that locates nothing has to be refused: `nope`
142
+ * walked up to the cwd's project and answered about the whole tree at exit 0,
143
+ * byte-identical to a correct run. `assertDirectoryArgument` is the same refusal
144
+ * `validate` gives, in the same words.
145
+ *
146
+ * @param sql - The statement
147
+ * @param pathArg - Where to look for the project, or omitted for the current directory
148
+ * @param options - Parsed command-line options
149
+ */
150
+ export async function queryCommand(sql, pathArg, options) {
151
+ const logger = createLogger({ debug: options.debug ?? false });
152
+ const startTime = Date.now();
153
+ try {
154
+ if (pathArg !== undefined)
155
+ assertDirectoryArgument(pathArg);
156
+ // Resolved at the CLI boundary, like every other command — the loud-cwd
157
+ // policy is where root discovery belongs.
158
+ const projectRoot = projectRootOrLoudCwd(pathArg ?? process.cwd(), logger);
159
+ const outcome = await runProjectionQuery({
160
+ root: projectRoot,
161
+ sql,
162
+ parameters: options.param ?? [],
163
+ logger,
164
+ });
165
+ const payload = buildProjectionQueryOutputData({
166
+ ...outcome,
167
+ root: projectRoot,
168
+ durationMs: Date.now() - startTime,
169
+ });
170
+ writeStructuredOutput(payload, options.format);
171
+ process.exit(ExitCode.OK);
172
+ }
173
+ catch (error) {
174
+ handleCommandError(error, logger, startTime, 'Query', options.format);
175
+ }
176
+ }
177
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/resources/query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAe,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EACL,qBAAqB,GAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAqBnE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,8BAA8B,CAAC,KAAkC;IAC/E,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,2DAA2D;QAC3D,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,mCAAmC;QACnC,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,0EAA0E;QAC1E,4EAA4E;QAC5E,qBAAqB;QACrB,cAAc,EAAE,kBAAkB,CAAC,KAAK,CAAC,YAAY,CAAC;QACtD,4EAA4E;QAC5E,4EAA4E;QAC5E,6DAA6D;QAC7D,QAAQ,EAAE,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1C,2EAA2E;QAC3E,2EAA2E;QAC3E,wEAAwE;QACxE,uDAAuD;QACvD,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,yEAAyE;QACzE,yEAAyE;QACzE,GAAG,iBAAiB,CAAC,KAAK,CAAC,eAAe,CAAC;QA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,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC;YACvC,IAAI,EAAE,WAAW;YACjB,GAAG;YACH,UAAU,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;YAC/B,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,8BAA8B,CAAC;YAC7C,GAAG,OAAO;YACV,IAAI,EAAE,WAAW;YACjB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;SACnC,CAAC,CAAC;QACH,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAE/C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,CAAC;AACH,CAAC"}
@@ -1,10 +1,14 @@
1
1
  /**
2
2
  * Resources scan command - discover markdown resources
3
3
  */
4
+ import type { CrawlSourceKind } from '@vibe-agent-toolkit/resources';
5
+ import { type ResourceCrawlLane } from '../../utils/resource-loader.js';
4
6
  interface ScanOptions {
5
7
  debug?: boolean;
6
8
  verbose?: boolean;
7
9
  collection?: string;
10
+ /** `yaml` (default) or `json`. Same document either way. */
11
+ format?: string;
8
12
  }
9
13
  /** A heading node, which may nest further headings beneath it. */
10
14
  type HeadingWithChildren = {
@@ -27,6 +31,26 @@ export interface ScanPayloadInput {
27
31
  resources: readonly ScanResource[];
28
32
  /** The stated root: the ONE base every reported `path` is relative to. */
29
33
  root: string;
34
+ /**
35
+ * Which enumerator produced these resources.
36
+ *
37
+ * Provenance, and it sits beside `root` because it qualifies the file list the
38
+ * same way: two scans of one tree that report different populations are only
39
+ * interpretable if each says which lane enumerated it. Derived from the load
40
+ * that ran, never re-read from the environment — the environment records what
41
+ * was asked for, which is not the same claim.
42
+ */
43
+ lane: ResourceCrawlLane;
44
+ /**
45
+ * Which enumerator the projection lane used, or `null` for the walk.
46
+ *
47
+ * `lane` alone cannot qualify a projection population: the lane has two
48
+ * enumerators and reports the same word for both, so an A/B varying only
49
+ * `VAT_EXTENT_SOURCE` produces two documents that agree on every field. This
50
+ * is the field that makes the arms distinguishable, which is what makes the
51
+ * comparison mean anything.
52
+ */
53
+ extentSource: CrawlSourceKind | null;
30
54
  durationMs: number;
31
55
  collections: Record<string, {
32
56
  resourceCount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../src/commands/resources/scan.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,kEAAkE;AAClE,KAAK,mBAAmB,GAAG;IAAE,QAAQ,CAAC,EAAE,mBAAmB,EAAE,GAAG,SAAS,CAAA;CAAE,CAAC;AAE5E;;;;;;GAMG;AACH,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;IACnC,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IACnE,OAAO,EAAE,OAAO,CAAC;CAClB;AAaD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqBpF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wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BpF;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAqDf"}
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * Resources scan command - discover markdown resources
3
3
  */
4
+ import { ExitCode } from '@vibe-agent-toolkit/schema';
5
+ import { handleCommandError } from '../../utils/command-error.js';
4
6
  import { formatDurationSecs } from '../../utils/duration.js';
5
7
  import { createLogger } from '../../utils/logger.js';
6
- import { writeYamlOutput } from '../../utils/output.js';
8
+ import { writeStructuredOutput } from '../../utils/output.js';
7
9
  import { projectRootOrLoudCwd } from '../../utils/project-root-policy.js';
8
10
  import { relativizePathEntries } from '../../utils/relativize-paths.js';
9
11
  import { loadResourcesWithConfig } from '../../utils/resource-loader.js';
10
- import { handleCommandError } from './command-helpers.js';
11
12
  /** Total headings in a tree, counting every nested level. */
12
13
  function countHeadings(headings) {
13
14
  let count = headings.length;
@@ -28,7 +29,7 @@ function countHeadings(headings) {
28
29
  * the machine it ran on and cannot be diffed across two checkouts.
29
30
  */
30
31
  export function buildScanOutputData(input) {
31
- const { resources, root, durationMs, collections, verbose } = input;
32
+ const { resources, root, lane, extentSource, durationMs, collections, verbose } = input;
32
33
  const files = resources.map((resource) => ({
33
34
  path: resource.filePath,
34
35
  links: resource.links.length,
@@ -39,6 +40,11 @@ export function buildScanOutputData(input) {
39
40
  status: 'success',
40
41
  // Stated once, and the only absolute path in the document.
41
42
  root,
43
+ lane,
44
+ // Always present, `null` included: a field that vanishes for the walk is
45
+ // indistinguishable from a build too old to report it, which is the same
46
+ // absence-vs-old-build ambiguity the two lane markers exist to avoid.
47
+ extentSource,
42
48
  filesScanned: resources.length,
43
49
  linksFound: resources.reduce((sum, r) => sum + r.links.length, 0),
44
50
  anchorsFound: files.reduce((sum, f) => sum + f.anchors, 0),
@@ -54,7 +60,7 @@ export async function scanCommand(pathArg, options) {
54
60
  // Resolve projectRoot at the CLI boundary (spec §5/§7 — loud-cwd policy).
55
61
  const projectRoot = projectRootOrLoudCwd(pathArg ?? process.cwd(), logger);
56
62
  // Load resources with config support
57
- const { registry } = await loadResourcesWithConfig(pathArg, projectRoot, logger);
63
+ const { registry, lane, extentSource } = await loadResourcesWithConfig(pathArg, projectRoot, logger);
58
64
  // Get all resources (filtered by collection if specified)
59
65
  let allResources = registry.getAllResources();
60
66
  if (options.collection) {
@@ -79,17 +85,20 @@ export async function scanCommand(pathArg, options) {
79
85
  ]))
80
86
  : undefined;
81
87
  }
82
- writeYamlOutput(buildScanOutputData({
88
+ const payload = buildScanOutputData({
83
89
  resources: allResources,
84
90
  root: projectRoot,
91
+ lane,
92
+ extentSource,
85
93
  durationMs: Date.now() - startTime,
86
94
  collections: collectionsOutput,
87
95
  verbose: options.verbose ?? false,
88
- }));
89
- process.exit(0);
96
+ });
97
+ writeStructuredOutput(payload, options.format);
98
+ process.exit(ExitCode.OK);
90
99
  }
91
100
  catch (error) {
92
- handleCommandError(error, logger, startTime, 'Scan');
101
+ handleCommandError(error, logger, startTime, 'Scan', options.format);
93
102
  }
94
103
  }
95
104
  //# sourceMappingURL=scan.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../src/commands/resources/scan.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE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AAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * Resources validate command - strict validation with error reporting
3
3
  */
4
- import { calculateValidationStatus, type IssueSeverity, type SeverityCounts, type ValidationIssueCode } from '@vibe-agent-toolkit/agent-schema';
5
4
  import { DeferredArtifacts, type CollectionStats, type ProjectConfig, type RegistryStats } from '@vibe-agent-toolkit/resources';
5
+ import { calculateValidationStatus, type IssueSeverity, type SeverityCounts, type ValidationIssueCode } from '@vibe-agent-toolkit/schema';
6
6
  import { type FindingCountSummary } from '../../utils/issue-rendering.js';
7
+ import { type PhaseOutcome } from '../phase-utils.js';
7
8
  /**
8
9
  * Collection statistics with error tracking.
9
10
  */
@@ -30,7 +31,7 @@ interface FileIssues {
30
31
  line: number;
31
32
  column: number;
32
33
  code: string;
33
- severity: string;
34
+ severity: IssueSeverity;
34
35
  message: string;
35
36
  }>;
36
37
  }
@@ -118,6 +119,13 @@ interface ValidationContext {
118
119
  validationMetadata: Pick<ValidationOutputData, 'validationMode' | 'frontmatterSchema'>;
119
120
  collectionStats: CollectionStats | undefined;
120
121
  duration: number;
122
+ /**
123
+ * The `--collection` filter, when one was passed. Carried so the
124
+ * run-integrity refusal can name the filter that matched nothing — the builder
125
+ * asks the denominator, not the config, but the MESSAGE should say what the
126
+ * operator most likely typed wrong.
127
+ */
128
+ collection?: string;
121
129
  }
122
130
  /** The only thing the output layer needs from the registry: collection lookup by ABSOLUTE path. */
123
131
  type RegistryLookup = {
@@ -183,6 +191,38 @@ export declare function resolveNoCache(options: Pick<ValidateOptions, 'cache'>):
183
191
  * majority of projects, which declare no `files:` at all.
184
192
  */
185
193
  export declare function computeDeferredArtifacts(config: ProjectConfig | undefined, projectRoot: string): Promise<DeferredArtifacts | undefined>;
194
+ /**
195
+ * Validate resources and hand back the document and exit code, printing the
196
+ * document nowhere.
197
+ *
198
+ * The phase entry point for `vat validate` and `vat verify`. Everything that was
199
+ * already streaming to stderr — progress, git-tracker stats, `--format text`
200
+ * findings — still streams from here, because stderr was inherited by the child
201
+ * process this replaces and so was free either way.
202
+ */
203
+ export declare function runResourcesValidatePhase(pathArg: string | undefined, options: ValidateOptions): Promise<PhaseOutcome>;
204
+ /**
205
+ * The exit code for a run, from the two verdicts that can each fail it.
206
+ *
207
+ * `hasErrors` is the library's, computed over the WHOLE project before any
208
+ * `--collection` filter, so an error the filter hid from the document still
209
+ * fails the run. The document's `status` is computed over what was REPORTED —
210
+ * which is where the run-integrity refusal lands (see
211
+ * {@link buildValidationDocument}), and it has no counterpart in `hasErrors`
212
+ * because the library never sees the filter. Either alone lets one of those two
213
+ * failures through; the run fails on both.
214
+ */
215
+ export declare function exitCodeForValidateRun(hasErrors: boolean, document: Pick<ValidationOutputData, 'status'>): 0 | 1;
186
216
  export declare function validateCommand(pathArg: string | undefined, options: ValidateOptions): Promise<void>;
217
+ /**
218
+ * THE document this command publishes, for either outcome.
219
+ *
220
+ * Built as a value and rendered separately, because the same document now has
221
+ * two destinations: stdout for a command-line run, and `phases[].report` when
222
+ * `vat validate` or `vat verify` runs this as one of its phases in their own
223
+ * process. Deriving it twice — once to print, once to hand back — is how the two
224
+ * lanes come to disagree about what this command reported.
225
+ */
226
+ export declare function buildValidationDocument(issueData: ErrorData[], context: ValidationContext, registry: RegistryLookup, verbose: boolean): ValidationOutputData;
187
227
  export {};
188
228
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/resources/validate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EACL,yBAAyB,EAEzB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACzB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EAEpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,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