@vibe-agent-toolkit/cli 0.2.0-rc.6 → 0.2.0-rc.8

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 (422) hide show
  1. package/README.md +4 -5
  2. package/dist/bin/vat +34 -19
  3. package/dist/bin/vat.js +34 -19
  4. package/dist/bin/vat.js.map +1 -1
  5. package/dist/bin.js +44 -158
  6. package/dist/bin.js.map +1 -1
  7. package/dist/command-loaders.d.ts +2 -2
  8. package/dist/command-loaders.d.ts.map +1 -1
  9. package/dist/command-loaders.js +4 -2
  10. package/dist/command-loaders.js.map +1 -1
  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/install-path.d.ts +36 -0
  18. package/dist/commands/agent/install-path.d.ts.map +1 -0
  19. package/dist/commands/agent/install-path.js +44 -0
  20. package/dist/commands/agent/install-path.js.map +1 -0
  21. package/dist/commands/agent/install.d.ts.map +1 -1
  22. package/dist/commands/agent/install.js +22 -10
  23. package/dist/commands/agent/install.js.map +1 -1
  24. package/dist/commands/agent/installed.d.ts.map +1 -1
  25. package/dist/commands/agent/installed.js +22 -12
  26. package/dist/commands/agent/installed.js.map +1 -1
  27. package/dist/commands/agent/list.d.ts.map +1 -1
  28. package/dist/commands/agent/list.js +2 -1
  29. package/dist/commands/agent/list.js.map +1 -1
  30. package/dist/commands/agent/run.d.ts.map +1 -1
  31. package/dist/commands/agent/run.js +2 -1
  32. package/dist/commands/agent/run.js.map +1 -1
  33. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  34. package/dist/commands/agent/uninstall.js +13 -6
  35. package/dist/commands/agent/uninstall.js.map +1 -1
  36. package/dist/commands/agent/validate.d.ts.map +1 -1
  37. package/dist/commands/agent/validate.js +3 -2
  38. package/dist/commands/agent/validate.js.map +1 -1
  39. package/dist/commands/ard/emit.d.ts +153 -0
  40. package/dist/commands/ard/emit.d.ts.map +1 -0
  41. package/dist/commands/ard/emit.js +276 -0
  42. package/dist/commands/ard/emit.js.map +1 -0
  43. package/dist/commands/ard/index.d.ts +12 -0
  44. package/dist/commands/ard/index.d.ts.map +1 -0
  45. package/dist/commands/ard/index.js +80 -0
  46. package/dist/commands/ard/index.js.map +1 -0
  47. package/dist/commands/ard/surfaces.d.ts +56 -0
  48. package/dist/commands/ard/surfaces.d.ts.map +1 -0
  49. package/dist/commands/ard/surfaces.js +150 -0
  50. package/dist/commands/ard/surfaces.js.map +1 -0
  51. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  52. package/dist/commands/audit/distributed-tree.js +9 -6
  53. package/dist/commands/audit/distributed-tree.js.map +1 -1
  54. package/dist/commands/audit/scan-population.d.ts +158 -0
  55. package/dist/commands/audit/scan-population.d.ts.map +1 -0
  56. package/dist/commands/audit/scan-population.js +292 -0
  57. package/dist/commands/audit/scan-population.js.map +1 -0
  58. package/dist/commands/audit-settings.d.ts.map +1 -1
  59. package/dist/commands/audit-settings.js +6 -5
  60. package/dist/commands/audit-settings.js.map +1 -1
  61. package/dist/commands/audit.d.ts +78 -9
  62. package/dist/commands/audit.d.ts.map +1 -1
  63. package/dist/commands/audit.js +853 -473
  64. package/dist/commands/audit.js.map +1 -1
  65. package/dist/commands/build.d.ts.map +1 -1
  66. package/dist/commands/build.js +24 -24
  67. package/dist/commands/build.js.map +1 -1
  68. package/dist/commands/cache/clear.d.ts.map +1 -1
  69. package/dist/commands/cache/clear.js +17 -10
  70. package/dist/commands/cache/clear.js.map +1 -1
  71. package/dist/commands/claude/budget.d.ts +136 -24
  72. package/dist/commands/claude/budget.d.ts.map +1 -1
  73. package/dist/commands/claude/budget.js +152 -57
  74. package/dist/commands/claude/budget.js.map +1 -1
  75. package/dist/commands/claude/context.d.ts.map +1 -1
  76. package/dist/commands/claude/context.js +4 -3
  77. package/dist/commands/claude/context.js.map +1 -1
  78. package/dist/commands/claude/marketplace/changelog-utils.d.ts +1 -1
  79. package/dist/commands/claude/marketplace/changelog-utils.d.ts.map +1 -1
  80. package/dist/commands/claude/marketplace/changelog-utils.js +1 -2
  81. package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
  82. package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
  83. package/dist/commands/claude/marketplace/git-publish.js +3 -2
  84. package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
  85. package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
  86. package/dist/commands/claude/marketplace/license-utils.js +0 -1
  87. package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
  88. package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
  89. package/dist/commands/claude/marketplace/publish-tree.js +0 -6
  90. package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
  91. package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
  92. package/dist/commands/claude/marketplace/publish.js +2 -1
  93. package/dist/commands/claude/marketplace/publish.js.map +1 -1
  94. package/dist/commands/claude/marketplace/validate.d.ts +55 -22
  95. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  96. package/dist/commands/claude/marketplace/validate.js +392 -77
  97. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  98. package/dist/commands/claude/org/api-keys.d.ts +0 -3
  99. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  100. package/dist/commands/claude/org/api-keys.js +2 -1
  101. package/dist/commands/claude/org/api-keys.js.map +1 -1
  102. package/dist/commands/claude/org/helpers.d.ts +17 -22
  103. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  104. package/dist/commands/claude/org/helpers.js +6 -22
  105. package/dist/commands/claude/org/helpers.js.map +1 -1
  106. package/dist/commands/claude/org/invites.d.ts +0 -3
  107. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  108. package/dist/commands/claude/org/invites.js +3 -2
  109. package/dist/commands/claude/org/invites.js.map +1 -1
  110. package/dist/commands/claude/org/skills.d.ts +103 -4
  111. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  112. package/dist/commands/claude/org/skills.js +331 -123
  113. package/dist/commands/claude/org/skills.js.map +1 -1
  114. package/dist/commands/claude/org/users.d.ts +0 -3
  115. package/dist/commands/claude/org/users.d.ts.map +1 -1
  116. package/dist/commands/claude/org/users.js +3 -2
  117. package/dist/commands/claude/org/users.js.map +1 -1
  118. package/dist/commands/claude/org/workspaces.d.ts +0 -3
  119. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  120. package/dist/commands/claude/org/workspaces.js +6 -5
  121. package/dist/commands/claude/org/workspaces.js.map +1 -1
  122. package/dist/commands/claude/plugin/build.d.ts +8 -0
  123. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  124. package/dist/commands/claude/plugin/build.js +28 -33
  125. package/dist/commands/claude/plugin/build.js.map +1 -1
  126. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  127. package/dist/commands/claude/plugin/helpers.js +0 -6
  128. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  129. package/dist/commands/claude/plugin/install.d.ts +12 -0
  130. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  131. package/dist/commands/claude/plugin/install.js +71 -60
  132. package/dist/commands/claude/plugin/install.js.map +1 -1
  133. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  134. package/dist/commands/claude/plugin/list.js +3 -2
  135. package/dist/commands/claude/plugin/list.js.map +1 -1
  136. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  137. package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
  138. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  139. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  140. package/dist/commands/claude/plugin/plugin-files.js +0 -3
  141. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  142. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  143. package/dist/commands/claude/plugin/plugin-validators.js +3 -6
  144. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  145. package/dist/commands/claude/plugin/tree-copy.d.ts +73 -0
  146. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  147. package/dist/commands/claude/plugin/tree-copy.js +221 -15
  148. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  149. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  150. package/dist/commands/claude/plugin/uninstall.js +4 -4
  151. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  152. package/dist/commands/consistency-check.d.ts +9 -13
  153. package/dist/commands/consistency-check.d.ts.map +1 -1
  154. package/dist/commands/consistency-check.js +91 -81
  155. package/dist/commands/consistency-check.js.map +1 -1
  156. package/dist/commands/corpus/index.d.ts.map +1 -1
  157. package/dist/commands/corpus/index.js +3 -0
  158. package/dist/commands/corpus/index.js.map +1 -1
  159. package/dist/commands/corpus/report.d.ts +0 -1
  160. package/dist/commands/corpus/report.d.ts.map +1 -1
  161. package/dist/commands/corpus/report.js +1 -3
  162. package/dist/commands/corpus/report.js.map +1 -1
  163. package/dist/commands/corpus/runner.d.ts +58 -1
  164. package/dist/commands/corpus/runner.d.ts.map +1 -1
  165. package/dist/commands/corpus/runner.js +92 -21
  166. package/dist/commands/corpus/runner.js.map +1 -1
  167. package/dist/commands/corpus/scan.d.ts.map +1 -1
  168. package/dist/commands/corpus/scan.js +2 -4
  169. package/dist/commands/corpus/scan.js.map +1 -1
  170. package/dist/commands/corpus/seed.d.ts +4 -4
  171. package/dist/commands/corpus/seed.d.ts.map +1 -1
  172. package/dist/commands/corpus/seed.js +1 -3
  173. package/dist/commands/corpus/seed.js.map +1 -1
  174. package/dist/commands/doctor.d.ts +14 -0
  175. package/dist/commands/doctor.d.ts.map +1 -1
  176. package/dist/commands/doctor.js +147 -51
  177. package/dist/commands/doctor.js.map +1 -1
  178. package/dist/commands/inventory.d.ts.map +1 -1
  179. package/dist/commands/inventory.js +6 -7
  180. package/dist/commands/inventory.js.map +1 -1
  181. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  182. package/dist/commands/mcp/list-collections.js +2 -1
  183. package/dist/commands/mcp/list-collections.js.map +1 -1
  184. package/dist/commands/mcp/serve.d.ts.map +1 -1
  185. package/dist/commands/mcp/serve.js +3 -2
  186. package/dist/commands/mcp/serve.js.map +1 -1
  187. package/dist/commands/okf/index.d.ts +11 -0
  188. package/dist/commands/okf/index.d.ts.map +1 -0
  189. package/dist/commands/okf/index.js +114 -0
  190. package/dist/commands/okf/index.js.map +1 -0
  191. package/dist/commands/okf/validate.d.ts +191 -0
  192. package/dist/commands/okf/validate.d.ts.map +1 -0
  193. package/dist/commands/okf/validate.js +190 -0
  194. package/dist/commands/okf/validate.js.map +1 -0
  195. package/dist/commands/phase-utils.d.ts +30 -13
  196. package/dist/commands/phase-utils.d.ts.map +1 -1
  197. package/dist/commands/phase-utils.js +56 -19
  198. package/dist/commands/phase-utils.js.map +1 -1
  199. package/dist/commands/positional-args.d.ts.map +1 -1
  200. package/dist/commands/positional-args.js +2 -1
  201. package/dist/commands/positional-args.js.map +1 -1
  202. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  203. package/dist/commands/rag/clear-command.js +2 -1
  204. package/dist/commands/rag/clear-command.js.map +1 -1
  205. package/dist/commands/rag/index-command.d.ts +27 -2
  206. package/dist/commands/rag/index-command.d.ts.map +1 -1
  207. package/dist/commands/rag/index-command.js +48 -8
  208. package/dist/commands/rag/index-command.js.map +1 -1
  209. package/dist/commands/rag/index.d.ts.map +1 -1
  210. package/dist/commands/rag/index.js +2 -0
  211. package/dist/commands/rag/index.js.map +1 -1
  212. package/dist/commands/rag/query-command.d.ts.map +1 -1
  213. package/dist/commands/rag/query-command.js +2 -1
  214. package/dist/commands/rag/query-command.js.map +1 -1
  215. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  216. package/dist/commands/rag/stats-command.js +2 -1
  217. package/dist/commands/rag/stats-command.js.map +1 -1
  218. package/dist/commands/resources/check-progress.d.ts +3 -0
  219. package/dist/commands/resources/check-progress.d.ts.map +1 -1
  220. package/dist/commands/resources/check-progress.js +11 -2
  221. package/dist/commands/resources/check-progress.js.map +1 -1
  222. package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
  223. package/dist/commands/resources/check-supervisor.js +14 -7
  224. package/dist/commands/resources/check-supervisor.js.map +1 -1
  225. package/dist/commands/resources/check.d.ts +168 -8
  226. package/dist/commands/resources/check.d.ts.map +1 -1
  227. package/dist/commands/resources/check.js +222 -118
  228. package/dist/commands/resources/check.js.map +1 -1
  229. package/dist/commands/resources/index.d.ts.map +1 -1
  230. package/dist/commands/resources/index.js +64 -29
  231. package/dist/commands/resources/index.js.map +1 -1
  232. package/dist/commands/resources/query.d.ts +18 -1
  233. package/dist/commands/resources/query.d.ts.map +1 -1
  234. package/dist/commands/resources/query.js +33 -12
  235. package/dist/commands/resources/query.js.map +1 -1
  236. package/dist/commands/resources/scan.d.ts.map +1 -1
  237. package/dist/commands/resources/scan.js +4 -8
  238. package/dist/commands/resources/scan.js.map +1 -1
  239. package/dist/commands/resources/validate.d.ts +30 -1
  240. package/dist/commands/resources/validate.d.ts.map +1 -1
  241. package/dist/commands/resources/validate.js +116 -14
  242. package/dist/commands/resources/validate.js.map +1 -1
  243. package/dist/commands/skill/review-checklist.d.ts +3 -2
  244. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  245. package/dist/commands/skill/review-checklist.js +4 -2
  246. package/dist/commands/skill/review-checklist.js.map +1 -1
  247. package/dist/commands/skill/review.d.ts +247 -0
  248. package/dist/commands/skill/review.d.ts.map +1 -1
  249. package/dist/commands/skill/review.js +98 -61
  250. package/dist/commands/skill/review.js.map +1 -1
  251. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  252. package/dist/commands/skill/test/configure.js +0 -1
  253. package/dist/commands/skill/test/configure.js.map +1 -1
  254. package/dist/commands/skill/test/run.d.ts +12 -6
  255. package/dist/commands/skill/test/run.d.ts.map +1 -1
  256. package/dist/commands/skill/test/run.js +137 -67
  257. package/dist/commands/skill/test/run.js.map +1 -1
  258. package/dist/commands/skills/build.d.ts +69 -2
  259. package/dist/commands/skills/build.d.ts.map +1 -1
  260. package/dist/commands/skills/build.js +128 -42
  261. package/dist/commands/skills/build.js.map +1 -1
  262. package/dist/commands/skills/install.d.ts +2 -1
  263. package/dist/commands/skills/install.d.ts.map +1 -1
  264. package/dist/commands/skills/install.js +20 -30
  265. package/dist/commands/skills/install.js.map +1 -1
  266. package/dist/commands/skills/list.d.ts +2 -1
  267. package/dist/commands/skills/list.d.ts.map +1 -1
  268. package/dist/commands/skills/list.js +44 -26
  269. package/dist/commands/skills/list.js.map +1 -1
  270. package/dist/commands/skills/package.d.ts +1 -1
  271. package/dist/commands/skills/package.d.ts.map +1 -1
  272. package/dist/commands/skills/package.js +6 -8
  273. package/dist/commands/skills/package.js.map +1 -1
  274. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  275. package/dist/commands/skills/scope-guard.js +2 -4
  276. package/dist/commands/skills/scope-guard.js.map +1 -1
  277. package/dist/commands/skills/shared.d.ts.map +1 -1
  278. package/dist/commands/skills/shared.js +2 -4
  279. package/dist/commands/skills/shared.js.map +1 -1
  280. package/dist/commands/skills/skill-discovery.d.ts +40 -1
  281. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  282. package/dist/commands/skills/skill-discovery.js +32 -4
  283. package/dist/commands/skills/skill-discovery.js.map +1 -1
  284. package/dist/commands/skills/source-resolvers.d.ts +15 -0
  285. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  286. package/dist/commands/skills/source-resolvers.js +25 -4
  287. package/dist/commands/skills/source-resolvers.js.map +1 -1
  288. package/dist/commands/skills/validate-command.d.ts.map +1 -1
  289. package/dist/commands/skills/validate-command.js +11 -3
  290. package/dist/commands/skills/validate-command.js.map +1 -1
  291. package/dist/commands/skills/validate.d.ts +66 -7
  292. package/dist/commands/skills/validate.d.ts.map +1 -1
  293. package/dist/commands/skills/validate.js +133 -29
  294. package/dist/commands/skills/validate.js.map +1 -1
  295. package/dist/commands/validate.d.ts +1 -1
  296. package/dist/commands/validate.js +8 -6
  297. package/dist/commands/validate.js.map +1 -1
  298. package/dist/commands/verify.d.ts +102 -5
  299. package/dist/commands/verify.d.ts.map +1 -1
  300. package/dist/commands/verify.js +246 -69
  301. package/dist/commands/verify.js.map +1 -1
  302. package/dist/index.d.ts +0 -1
  303. package/dist/index.d.ts.map +1 -1
  304. package/dist/index.js +5 -1
  305. package/dist/index.js.map +1 -1
  306. package/dist/report-schemas.d.ts +45 -0
  307. package/dist/report-schemas.d.ts.map +1 -0
  308. package/dist/report-schemas.js +102 -0
  309. package/dist/report-schemas.js.map +1 -0
  310. package/dist/skill-resolution/packaging-config.d.ts +49 -5
  311. package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
  312. package/dist/skill-resolution/packaging-config.js +59 -19
  313. package/dist/skill-resolution/packaging-config.js.map +1 -1
  314. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  315. package/dist/skill-resolution/resolve-skill-reference.js +8 -6
  316. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  317. package/dist/utils/agent-discovery.d.ts.map +1 -1
  318. package/dist/utils/agent-discovery.js +22 -11
  319. package/dist/utils/agent-discovery.js.map +1 -1
  320. package/dist/utils/agent-runner.d.ts.map +1 -1
  321. package/dist/utils/agent-runner.js +0 -1
  322. package/dist/utils/agent-runner.js.map +1 -1
  323. package/dist/utils/command-error.d.ts +87 -55
  324. package/dist/utils/command-error.d.ts.map +1 -1
  325. package/dist/utils/command-error.js +113 -64
  326. package/dist/utils/command-error.js.map +1 -1
  327. package/dist/utils/config-loader.d.ts +2 -1
  328. package/dist/utils/config-loader.d.ts.map +1 -1
  329. package/dist/utils/config-loader.js +3 -6
  330. package/dist/utils/config-loader.js.map +1 -1
  331. package/dist/utils/context-budget-issues.d.ts +1 -1
  332. package/dist/utils/context-budget-issues.js +1 -1
  333. package/dist/utils/corpus-target.d.ts +5 -27
  334. package/dist/utils/corpus-target.d.ts.map +1 -1
  335. package/dist/utils/corpus-target.js +7 -33
  336. package/dist/utils/corpus-target.js.map +1 -1
  337. package/dist/utils/edge-lens-evaluation.d.ts +83 -0
  338. package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
  339. package/dist/utils/edge-lens-evaluation.js +110 -0
  340. package/dist/utils/edge-lens-evaluation.js.map +1 -0
  341. package/dist/utils/help-loader.d.ts.map +1 -1
  342. package/dist/utils/help-loader.js +0 -1
  343. package/dist/utils/help-loader.js.map +1 -1
  344. package/dist/utils/issue-rendering.d.ts +2 -2
  345. package/dist/utils/issue-rendering.js +2 -2
  346. package/dist/utils/optional-backend.d.ts +5 -4
  347. package/dist/utils/optional-backend.d.ts.map +1 -1
  348. package/dist/utils/optional-backend.js +7 -5
  349. package/dist/utils/optional-backend.js.map +1 -1
  350. package/dist/utils/output.d.ts +9 -0
  351. package/dist/utils/output.d.ts.map +1 -1
  352. package/dist/utils/output.js +16 -0
  353. package/dist/utils/output.js.map +1 -1
  354. package/dist/utils/package-json.d.ts +24 -0
  355. package/dist/utils/package-json.d.ts.map +1 -0
  356. package/dist/utils/package-json.js +49 -0
  357. package/dist/utils/package-json.js.map +1 -0
  358. package/dist/utils/project-root-policy.d.ts +20 -0
  359. package/dist/utils/project-root-policy.d.ts.map +1 -1
  360. package/dist/utils/project-root-policy.js +30 -0
  361. package/dist/utils/project-root-policy.js.map +1 -1
  362. package/dist/utils/projection-query.d.ts +41 -4
  363. package/dist/utils/projection-query.d.ts.map +1 -1
  364. package/dist/utils/projection-query.js +44 -10
  365. package/dist/utils/projection-query.js.map +1 -1
  366. package/dist/utils/projection-store.d.ts +41 -15
  367. package/dist/utils/projection-store.d.ts.map +1 -1
  368. package/dist/utils/projection-store.js +65 -18
  369. package/dist/utils/projection-store.js.map +1 -1
  370. package/dist/utils/repeatable-option.d.ts +37 -0
  371. package/dist/utils/repeatable-option.d.ts.map +1 -0
  372. package/dist/utils/repeatable-option.js +39 -0
  373. package/dist/utils/repeatable-option.js.map +1 -0
  374. package/dist/utils/resource-loader.d.ts +4 -3
  375. package/dist/utils/resource-loader.d.ts.map +1 -1
  376. package/dist/utils/resource-loader.js +63 -32
  377. package/dist/utils/resource-loader.js.map +1 -1
  378. package/dist/utils/root-argv.d.ts +53 -0
  379. package/dist/utils/root-argv.d.ts.map +1 -0
  380. package/dist/utils/root-argv.js +215 -0
  381. package/dist/utils/root-argv.js.map +1 -0
  382. package/dist/utils/run-integrity.d.ts +95 -0
  383. package/dist/utils/run-integrity.d.ts.map +1 -0
  384. package/dist/utils/run-integrity.js +102 -0
  385. package/dist/utils/run-integrity.js.map +1 -0
  386. package/dist/utils/skill-packaging-config.d.ts +27 -0
  387. package/dist/utils/skill-packaging-config.d.ts.map +1 -1
  388. package/dist/utils/skill-packaging-config.js +30 -0
  389. package/dist/utils/skill-packaging-config.js.map +1 -1
  390. package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
  391. package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
  392. package/dist/utils/sqlite-experimental-warning.js +144 -0
  393. package/dist/utils/sqlite-experimental-warning.js.map +1 -0
  394. package/dist/utils/url-redact.d.ts.map +1 -1
  395. package/dist/utils/url-redact.js +4 -6
  396. package/dist/utils/url-redact.js.map +1 -1
  397. package/dist/utils/user-context-scanner.d.ts +8 -0
  398. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  399. package/dist/utils/user-context-scanner.js +4 -2
  400. package/dist/utils/user-context-scanner.js.map +1 -1
  401. package/dist/utils/validate-help-files.d.ts.map +1 -1
  402. package/dist/utils/validate-help-files.js +12 -6
  403. package/dist/utils/validate-help-files.js.map +1 -1
  404. package/dist/utils/vat-bin-path.d.ts.map +1 -1
  405. package/dist/utils/vat-bin-path.js +0 -1
  406. package/dist/utils/vat-bin-path.js.map +1 -1
  407. package/dist/version.d.ts.map +1 -1
  408. package/dist/version.js +1 -3
  409. package/dist/version.js.map +1 -1
  410. package/docs/audit.md +141 -37
  411. package/docs/doctor.md +7 -6
  412. package/docs/index.md +19 -11
  413. package/docs/rag.md +3 -2
  414. package/docs/resources.md +5 -2
  415. package/docs/skill-test.md +10 -9
  416. package/docs/skills.md +53 -69
  417. package/package.json +24 -29
  418. package/schemas/ard-emit.json +149 -0
  419. package/schemas/claude-budget.json +197 -0
  420. package/schemas/okf-validate.json +170 -0
  421. package/schemas/resources-check.json +186 -0
  422. package/schemas/skill-review.json +230 -0
@@ -0,0 +1,114 @@
1
+ /**
2
+ * `vat okf` command group — Open Knowledge Format bundles.
3
+ *
4
+ * One verb today. The group exists rather than a flat `vat okf-validate`
5
+ * because OKF is a format with more than one producer-side question in it (a
6
+ * bundle's index files are generated artifacts, §8), and a group is cheaper to
7
+ * extend than a top-level verb is to deprecate.
8
+ */
9
+ import { Command, Option } from 'commander';
10
+ import { okfValidateCommand } from './validate.js';
11
+ export function createOkfCommand() {
12
+ const okf = new Command('okf');
13
+ okf
14
+ .description('Validate the Open Knowledge Format (OKF) bundles this project publishes')
15
+ .helpCommand(false)
16
+ .addHelpText('after', `
17
+ Description:
18
+ An OKF bundle is a directory of markdown concept documents, one per file,
19
+ each carrying YAML frontmatter with a non-empty \`type\`. Bundles are declared
20
+ in vibe-agent-toolkit.config.yaml:
21
+
22
+ okf:
23
+ bundles:
24
+ knowledge:
25
+ root: ./knowledge # required
26
+ severity: error # optional; error is the default
27
+
28
+ The population is defined by the SPECIFICATION, not by a glob: every
29
+ non-reserved .md file anywhere beneath the root is a concept document, and
30
+ only index.md and log.md are reserved. There is deliberately no include or
31
+ exclude — a narrower population would let VAT report a clean bundle while a
32
+ file it never read broke conformance. If a subtree must not be part of a
33
+ bundle, it must not be under the bundle root.
34
+
35
+ Example:
36
+ $ vat okf validate # Every declared bundle
37
+ `);
38
+ okf
39
+ .command('validate')
40
+ .description('Check declared OKF bundles for conformance (§11)')
41
+ .argument('[bundle]', 'Validate only this declared bundle (default: all of them)')
42
+ .addOption(
43
+ // `.choices()`, not a bare `.option()`: an unrecognised value used to fall
44
+ // through to the YAML branch and exit 0, so `--format Json` in a pipeline
45
+ // failed downstream in `jq` instead of here, where the mistake is.
46
+ new Option('--format <format>', 'Output format: yaml (default) or json')
47
+ .choices(['yaml', 'json'])
48
+ .default('yaml'))
49
+ .option('--spec-version <version>', 'Cross-check a bundle-root index.md okf_version against this revision (e.g. 0.2). Omitted, a declaration is reported but not judged.')
50
+ .option('--debug', 'Verbose logging to stderr')
51
+ .action(async function (bundle) {
52
+ await okfValidateCommand(bundle, this.optsWithGlobals());
53
+ })
54
+ .addHelpText('after', `
55
+ Description:
56
+ Checks each declared bundle against the OKF v0.2 conformance items VAT
57
+ implements:
58
+
59
+ §11.1 every non-reserved .md carries a parseable YAML frontmatter block
60
+ §11.2 every one of those blocks carries a non-empty \`type\`
61
+ §6.1 every markdown LINK and IMAGE — the [text](target) form — resolves
62
+ inside the bundle. A leading "/" resolves against the BUNDLE ROOT,
63
+ not the filesystem root, and EVERY path component is judged against
64
+ the bytes on disk, so a link that opens only because the author's
65
+ filesystem folds letter case or Unicode normalization form is
66
+ reported: the bundle is unpacked somewhere that does not fold.
67
+ §2 every .md under the root is a file whose bytes are under the root. A
68
+ symlink out of the bundle, or one pointing at nothing, is reported —
69
+ tar stores a symlink as a symlink, so it arrives dangling.
70
+ §8/§12 an index.md carries no frontmatter, except a bundle-root index.md,
71
+ which may carry okf_version and nothing else
72
+
73
+ NOT covered by the §6.1 check: wikilinks. \`[[other-concept]]\` is invisible to
74
+ the markdown parser, so a bundle written in that style gets no cross-link
75
+ checking at all, and a clean report says nothing about those links.
76
+
77
+ §11.3's structural rules for the BODY of index.md and log.md are not
78
+ implemented, so a clean report means §11.1 and §11.2 in full and §11.3 only
79
+ in part.
80
+
81
+ Unknown \`type\` values and unknown frontmatter keys are legal and are never
82
+ reported: §4.1 has no central registry and forbids rejecting extra keys.
83
+
84
+ The okf_version a bundle-root index.md declares is a CROSS-CHECK, never an
85
+ input. It is reported as data.bundles[].declaredOkfVersion; pass
86
+ --spec-version to have a disagreement reported as a finding.
87
+
88
+ Output (the shared report envelope; schema: packages/cli/schemas/okf-validate.json):
89
+ status: ok | findings | error
90
+ examined: every document opened and judged, across every bundle. Zero with
91
+ a data.notice means nothing was checked: no okf.bundles declared,
92
+ or a declared root that holds no .md at all (a root one level too
93
+ deep reads exactly like this)
94
+ findings: {code, severity, message, location, line?, link?} — location is
95
+ the project-relative path of the document to open
96
+ summary: {errors, warnings, info}; exit 1 iff errors > 0
97
+ data.bundles[]: {bundle, root, conceptDocuments, reservedDocuments,
98
+ declaredOkfVersion?} — root as the config wrote it, never absolute
99
+
100
+ Exit Codes:
101
+ 0 - No error-severity findings
102
+ 1 - At least one error-severity finding. Anything unreadable — the bundle
103
+ root, one subdirectory, or one document — is reported as a finding naming
104
+ exactly what could not be read, so the rest of that bundle and every other
105
+ bundle in the run are still checked and still reported
106
+ 2 - System error (no config file, unknown bundle name)
107
+
108
+ Example:
109
+ $ vat okf validate knowledge --format json
110
+ $ vat okf validate --spec-version 0.2
111
+ `);
112
+ return okf;
113
+ }
114
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/okf/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAA2B,MAAM,eAAe,CAAC;AAE5E,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAE/B,GAAG;SACA,WAAW,CAAC,yEAAyE,CAAC;SACtF,WAAW,CAAC,KAAK,CAAC;SAClB,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;CAqBL,CACI,CAAC;IAEJ,GAAG;SACA,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,QAAQ,CAAC,UAAU,EAAE,2DAA2D,CAAC;SACjF,SAAS;IACR,2EAA2E;IAC3E,0EAA0E;IAC1E,mEAAmE;IACnE,IAAI,MAAM,CAAC,mBAAmB,EAAE,uCAAuC,CAAC;SACrE,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACzB,OAAO,CAAC,MAAM,CAAC,CACnB;SACA,MAAM,CACL,0BAA0B,EAC1B,qIAAqI,CACtI;SACA,MAAM,CAAC,SAAS,EAAE,2BAA2B,CAAC;SAC9C,MAAM,CAAC,KAAK,WAA0B,MAA0B;QAC/D,MAAM,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAwB,CAAC,CAAC;IACjF,CAAC,CAAC;SACD,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDL,CACI,CAAC;IAEJ,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * `vat okf validate [bundle]` — conformance for the OKF bundles a project declares.
3
+ *
4
+ * Producer-side, and the exit code says so: OKF §11 tells CONSUMERS not to
5
+ * reject a bundle over broken cross-links or unknown keys, but VAT is tooling
6
+ * for the publisher — the one party who can fix them — so a finding at `error`
7
+ * severity fails the command. An adopter who wants a softer gate lowers
8
+ * `okf.bundles.<name>.severity`; the finding is still reported either way.
9
+ */
10
+ import { type OkfBundleReport } from '@vibe-agent-toolkit/resources';
11
+ import { type Report } from '@vibe-agent-toolkit/schema';
12
+ import { z } from 'zod';
13
+ export interface OkfValidateOptions {
14
+ format?: 'yaml' | 'json';
15
+ specVersion?: string;
16
+ debug?: boolean;
17
+ }
18
+ /** One checked bundle's `data` row: what was read, never the findings (those are the envelope's). */
19
+ export declare const OkfBundleSummarySchema: z.ZodObject<{
20
+ /** The `okf.bundles.<name>` key. */
21
+ bundle: z.ZodString;
22
+ /** The root as the config file wrote it — never the resolved absolute path. */
23
+ root: z.ZodString;
24
+ /** Every non-reserved `.md` beneath the root, bundle-relative and sorted. */
25
+ conceptDocuments: z.ZodArray<z.ZodString, "many">;
26
+ /** Every `index.md` / `log.md` beneath the root, bundle-relative and sorted. */
27
+ reservedDocuments: z.ZodArray<z.ZodString, "many">;
28
+ /** What the root `index.md` declares, when it declares a well-formed one. Reported, never obeyed. */
29
+ declaredOkfVersion: z.ZodOptional<z.ZodString>;
30
+ }, "strict", z.ZodTypeAny, {
31
+ root: string;
32
+ bundle: string;
33
+ conceptDocuments: string[];
34
+ reservedDocuments: string[];
35
+ declaredOkfVersion?: string | undefined;
36
+ }, {
37
+ root: string;
38
+ bundle: string;
39
+ conceptDocuments: string[];
40
+ reservedDocuments: string[];
41
+ declaredOkfVersion?: string | undefined;
42
+ }>;
43
+ export declare const OkfValidateDataSchema: z.ZodObject<{
44
+ bundles: z.ZodArray<z.ZodObject<{
45
+ /** The `okf.bundles.<name>` key. */
46
+ bundle: z.ZodString;
47
+ /** The root as the config file wrote it — never the resolved absolute path. */
48
+ root: z.ZodString;
49
+ /** Every non-reserved `.md` beneath the root, bundle-relative and sorted. */
50
+ conceptDocuments: z.ZodArray<z.ZodString, "many">;
51
+ /** Every `index.md` / `log.md` beneath the root, bundle-relative and sorted. */
52
+ reservedDocuments: z.ZodArray<z.ZodString, "many">;
53
+ /** What the root `index.md` declares, when it declares a well-formed one. Reported, never obeyed. */
54
+ declaredOkfVersion: z.ZodOptional<z.ZodString>;
55
+ }, "strict", z.ZodTypeAny, {
56
+ root: string;
57
+ bundle: string;
58
+ conceptDocuments: string[];
59
+ reservedDocuments: string[];
60
+ declaredOkfVersion?: string | undefined;
61
+ }, {
62
+ root: string;
63
+ bundle: string;
64
+ conceptDocuments: string[];
65
+ reservedDocuments: string[];
66
+ declaredOkfVersion?: string | undefined;
67
+ }>, "many">;
68
+ /**
69
+ * Present only when there was nothing to check, and says what to declare or
70
+ * which root to look at.
71
+ *
72
+ * 🪤 The command used to print `status: passed`, `bundles: []`, exit 0 when a
73
+ * project declared no `okf.bundles` at all — a report indistinguishable from
74
+ * a bundle read in full and found conformant, so a mistyped key
75
+ * (`okf.bundle:`, `okf.Bundles:`) read as a clean bill of health. The
76
+ * envelope's REQUIRED `examined` now says `0` in that case, and this sentence
77
+ * says why. The exit code stays 0: nothing failed, and failing a build for a
78
+ * feature the project never opted into would be worse.
79
+ */
80
+ notice: z.ZodOptional<z.ZodString>;
81
+ }, "strict", z.ZodTypeAny, {
82
+ bundles: {
83
+ root: string;
84
+ bundle: string;
85
+ conceptDocuments: string[];
86
+ reservedDocuments: string[];
87
+ declaredOkfVersion?: string | undefined;
88
+ }[];
89
+ notice?: string | undefined;
90
+ }, {
91
+ bundles: {
92
+ root: string;
93
+ bundle: string;
94
+ conceptDocuments: string[];
95
+ reservedDocuments: string[];
96
+ declaredOkfVersion?: string | undefined;
97
+ }[];
98
+ notice?: string | undefined;
99
+ }>;
100
+ export type OkfBundleSummary = z.infer<typeof OkfBundleSummarySchema>;
101
+ export type OkfValidateData = z.infer<typeof OkfValidateDataSchema>;
102
+ /** The document this command publishes. */
103
+ export declare const OKF_VALIDATE_REPORT_SCHEMA: import("@vibe-agent-toolkit/schema").ReportZodSchema<z.ZodObject<{
104
+ bundles: z.ZodArray<z.ZodObject<{
105
+ /** The `okf.bundles.<name>` key. */
106
+ bundle: z.ZodString;
107
+ /** The root as the config file wrote it — never the resolved absolute path. */
108
+ root: z.ZodString;
109
+ /** Every non-reserved `.md` beneath the root, bundle-relative and sorted. */
110
+ conceptDocuments: z.ZodArray<z.ZodString, "many">;
111
+ /** Every `index.md` / `log.md` beneath the root, bundle-relative and sorted. */
112
+ reservedDocuments: z.ZodArray<z.ZodString, "many">;
113
+ /** What the root `index.md` declares, when it declares a well-formed one. Reported, never obeyed. */
114
+ declaredOkfVersion: z.ZodOptional<z.ZodString>;
115
+ }, "strict", z.ZodTypeAny, {
116
+ root: string;
117
+ bundle: string;
118
+ conceptDocuments: string[];
119
+ reservedDocuments: string[];
120
+ declaredOkfVersion?: string | undefined;
121
+ }, {
122
+ root: string;
123
+ bundle: string;
124
+ conceptDocuments: string[];
125
+ reservedDocuments: string[];
126
+ declaredOkfVersion?: string | undefined;
127
+ }>, "many">;
128
+ /**
129
+ * Present only when there was nothing to check, and says what to declare or
130
+ * which root to look at.
131
+ *
132
+ * 🪤 The command used to print `status: passed`, `bundles: []`, exit 0 when a
133
+ * project declared no `okf.bundles` at all — a report indistinguishable from
134
+ * a bundle read in full and found conformant, so a mistyped key
135
+ * (`okf.bundle:`, `okf.Bundles:`) read as a clean bill of health. The
136
+ * envelope's REQUIRED `examined` now says `0` in that case, and this sentence
137
+ * says why. The exit code stays 0: nothing failed, and failing a build for a
138
+ * feature the project never opted into would be worse.
139
+ */
140
+ notice: z.ZodOptional<z.ZodString>;
141
+ }, "strict", z.ZodTypeAny, {
142
+ bundles: {
143
+ root: string;
144
+ bundle: string;
145
+ conceptDocuments: string[];
146
+ reservedDocuments: string[];
147
+ declaredOkfVersion?: string | undefined;
148
+ }[];
149
+ notice?: string | undefined;
150
+ }, {
151
+ bundles: {
152
+ root: string;
153
+ bundle: string;
154
+ conceptDocuments: string[];
155
+ reservedDocuments: string[];
156
+ declaredOkfVersion?: string | undefined;
157
+ }[];
158
+ notice?: string | undefined;
159
+ }>>;
160
+ export type OkfValidateReport = Report<OkfValidateData>;
161
+ /** One bundle's report beside the absolute root it was read from. */
162
+ export interface CheckedOkfBundle {
163
+ readonly report: OkfBundleReport;
164
+ /** The resolved absolute root, so a finding can name a project-relative file. */
165
+ readonly root: string;
166
+ }
167
+ /**
168
+ * Assemble the report for a set of checked bundles. Pure, so the status rule
169
+ * and the denominator are unit-testable.
170
+ *
171
+ * `examined` counts every document that was opened and judged — concept and
172
+ * reserved alike — across every bundle. A declared-but-empty bundle and an
173
+ * empty declaration both examine zero, and the notice tells them apart.
174
+ *
175
+ * @param checked - One report per bundle that was actually checked, with its root
176
+ * @param projectRoot - What every finding's `location` is relative to
177
+ * @returns The report
178
+ */
179
+ export declare function summarizeOkfBundles(checked: readonly CheckedOkfBundle[], projectRoot: string): OkfValidateReport;
180
+ /**
181
+ * Check every selected bundle and assemble the report.
182
+ *
183
+ * Separate from the action so the shape is testable without a process exit.
184
+ *
185
+ * @param bundleArg - A single declared bundle name, or undefined for all of them
186
+ * @param options - Output format and the optional revision to cross-check against
187
+ */
188
+ export declare function okfValidateReport(bundleArg: string | undefined, options: OkfValidateOptions): Promise<OkfValidateReport>;
189
+ /** Action handler for `vat okf validate [bundle]`. */
190
+ export declare function okfValidateCommand(bundleArg: string | undefined, options: OkfValidateOptions): Promise<void>;
191
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/okf/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAsE,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAE7H,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qGAAqG;AACrG,eAAO,MAAM,sBAAsB;IACjC,oCAAoC;;IAEpC,+EAA+E;;IAE/E,6EAA6E;;IAE7E,gFAAgF;;IAEhF,qGAAqG;;;;;;;;;;;;;;EAE5F,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;QAZhC,oCAAoC;;QAEpC,+EAA+E;;QAE/E,6EAA6E;;QAE7E,gFAAgF;;QAEhF,qGAAqG;;;;;;;;;;;;;;;IAMrG;;;;;;;;;;;OAWG;;;;;;;;;;;;;;;;;;;;EAEM,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,2CAA2C;AAC3C,eAAO,MAAM,0BAA0B;;QAjCrC,oCAAoC;;QAEpC,+EAA+E;;QAE/E,6EAA6E;;QAE7E,gFAAgF;;QAEhF,qGAAqG;;;;;;;;;;;;;;;IAMrG;;;;;;;;;;;OAWG;;;;;;;;;;;;;;;;;;;;GAQwE,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAExD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AA8ED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,WAAW,EAAE,MAAM,GAClB,iBAAiB,CAyBnB;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAmB5B;AAED,sDAAsD;AACtD,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * `vat okf validate [bundle]` — conformance for the OKF bundles a project declares.
3
+ *
4
+ * Producer-side, and the exit code says so: OKF §11 tells CONSUMERS not to
5
+ * reject a bundle over broken cross-links or unknown keys, but VAT is tooling
6
+ * for the publisher — the one party who can fix them — so a finding at `error`
7
+ * severity fails the command. An adopter who wants a softer gate lowers
8
+ * `okf.bundles.<name>.severity`; the finding is still reported either way.
9
+ */
10
+ import { dirname } from 'node:path';
11
+ import { okfBundleRuns, parseConfigFile, validateOkfBundle, } from '@vibe-agent-toolkit/resources';
12
+ import { buildReport, exitCodeForSeverityCounts, reportSchema } from '@vibe-agent-toolkit/schema';
13
+ import { findConfigFile, issueLocation, safePath } from '@vibe-agent-toolkit/utils';
14
+ import { z } from 'zod';
15
+ import { handleReportCommandError } from '../../utils/command-error.js';
16
+ import { createLogger } from '../../utils/logger.js';
17
+ import { writeStructuredOutput } from '../../utils/output.js';
18
+ /** One checked bundle's `data` row: what was read, never the findings (those are the envelope's). */
19
+ export const OkfBundleSummarySchema = z.object({
20
+ /** The `okf.bundles.<name>` key. */
21
+ bundle: z.string(),
22
+ /** The root as the config file wrote it — never the resolved absolute path. */
23
+ root: z.string(),
24
+ /** Every non-reserved `.md` beneath the root, bundle-relative and sorted. */
25
+ conceptDocuments: z.array(z.string()),
26
+ /** Every `index.md` / `log.md` beneath the root, bundle-relative and sorted. */
27
+ reservedDocuments: z.array(z.string()),
28
+ /** What the root `index.md` declares, when it declares a well-formed one. Reported, never obeyed. */
29
+ declaredOkfVersion: z.string().optional(),
30
+ }).strict();
31
+ export const OkfValidateDataSchema = z.object({
32
+ bundles: z.array(OkfBundleSummarySchema),
33
+ /**
34
+ * Present only when there was nothing to check, and says what to declare or
35
+ * which root to look at.
36
+ *
37
+ * 🪤 The command used to print `status: passed`, `bundles: []`, exit 0 when a
38
+ * project declared no `okf.bundles` at all — a report indistinguishable from
39
+ * a bundle read in full and found conformant, so a mistyped key
40
+ * (`okf.bundle:`, `okf.Bundles:`) read as a clean bill of health. The
41
+ * envelope's REQUIRED `examined` now says `0` in that case, and this sentence
42
+ * says why. The exit code stays 0: nothing failed, and failing a build for a
43
+ * feature the project never opted into would be worse.
44
+ */
45
+ notice: z.string().optional(),
46
+ }).strict();
47
+ /** The document this command publishes. */
48
+ export const OKF_VALIDATE_REPORT_SCHEMA = reportSchema(OkfValidateDataSchema);
49
+ /**
50
+ * The bundles whose root was read successfully and held not one markdown file.
51
+ *
52
+ * 🪤 The same green-without-running shape the `notice` exists for, one level
53
+ * down. A `root:` typo that lands on a real-but-wrong directory, or a root
54
+ * written one level too deep, produces zero findings and an `examined` that
55
+ * only THIS bundle's rows explain — so the run says so in words too.
56
+ *
57
+ * A bundle carrying findings is excluded even when its document lists are empty:
58
+ * that is the unreadable-root case, which already says the truthful thing in its
59
+ * own finding, and "contains no .md files" would be a second, wronger sentence
60
+ * about a directory that does not exist.
61
+ *
62
+ * @param bundles - Every bundle report in the run
63
+ * @returns The names of the vacuous ones, in report order
64
+ */
65
+ function vacuousBundles(bundles) {
66
+ return bundles
67
+ .filter((report) => report.findings.length === 0 &&
68
+ report.conceptDocuments.length === 0 &&
69
+ report.reservedDocuments.length === 0)
70
+ .map((report) => report.bundle);
71
+ }
72
+ /**
73
+ * The sentence a run with one or more vacuous bundles carries.
74
+ *
75
+ * @param vacuous - Names of the bundles whose root held no markdown at all
76
+ * @returns A notice naming each of them and the config key to check
77
+ */
78
+ function vacuousNotice(vacuous) {
79
+ const named = vacuous.map((bundle) => `'${bundle}'`).join(', ');
80
+ const subject = vacuous.length === 1 ? 'it' : 'them';
81
+ return `${named} contains no .md files, so nothing was checked in ${subject}. A root pointing one level too deep, or at a real-but-wrong directory, reads exactly like this — check \`okf.bundles.<name>.root\`.`;
82
+ }
83
+ /**
84
+ * The sentence a run carries when it examined less than a reader would assume.
85
+ *
86
+ * @param bundles - Every bundle report in the run
87
+ * @returns The notice, or nothing when every declared bundle held documents
88
+ */
89
+ function noticeFor(bundles) {
90
+ if (bundles.length === 0)
91
+ return NO_BUNDLES_NOTICE;
92
+ const vacuous = vacuousBundles(bundles);
93
+ return vacuous.length > 0 ? vacuousNotice(vacuous) : undefined;
94
+ }
95
+ const NO_BUNDLES_NOTICE = 'No OKF bundles are declared, so nothing was checked. Declare one under `okf.bundles.<name>.root` in vibe-agent-toolkit.config.yaml; every non-reserved .md beneath that root is then checked for frontmatter carrying a non-empty `type`.';
96
+ /**
97
+ * A bundle's finding as the envelope publishes it: the same code, severity and
98
+ * message, with `location` the project-relative path of the document — the
99
+ * file you would open — rather than a bundle-relative `document` a reader had
100
+ * to join with the bundle's root by hand.
101
+ *
102
+ * @param finding - The lane's finding
103
+ * @param root - The bundle's absolute root
104
+ * @param projectRoot - What `location` is relative to
105
+ * @returns The published finding
106
+ */
107
+ function toFinding(finding, root, projectRoot) {
108
+ return {
109
+ code: finding.code,
110
+ severity: finding.severity,
111
+ message: finding.message,
112
+ location: issueLocation(safePath.join(root, finding.document), projectRoot),
113
+ ...(finding.link === undefined ? {} : { link: finding.link }),
114
+ ...(finding.line === undefined ? {} : { line: finding.line }),
115
+ };
116
+ }
117
+ /**
118
+ * Assemble the report for a set of checked bundles. Pure, so the status rule
119
+ * and the denominator are unit-testable.
120
+ *
121
+ * `examined` counts every document that was opened and judged — concept and
122
+ * reserved alike — across every bundle. A declared-but-empty bundle and an
123
+ * empty declaration both examine zero, and the notice tells them apart.
124
+ *
125
+ * @param checked - One report per bundle that was actually checked, with its root
126
+ * @param projectRoot - What every finding's `location` is relative to
127
+ * @returns The report
128
+ */
129
+ export function summarizeOkfBundles(checked, projectRoot) {
130
+ const bundles = checked.map((entry) => entry.report);
131
+ const findings = checked.flatMap((entry) => entry.report.findings.map((finding) => toFinding(finding, entry.root, projectRoot)));
132
+ const examined = bundles.reduce((sum, report) => sum + report.conceptDocuments.length + report.reservedDocuments.length, 0);
133
+ const notice = noticeFor(bundles);
134
+ return buildReport({
135
+ examined,
136
+ findings,
137
+ data: {
138
+ bundles: bundles.map((report) => ({
139
+ bundle: report.bundle,
140
+ root: report.root,
141
+ conceptDocuments: report.conceptDocuments,
142
+ reservedDocuments: report.reservedDocuments,
143
+ ...(report.declaredOkfVersion === undefined ? {} : { declaredOkfVersion: report.declaredOkfVersion }),
144
+ })),
145
+ ...(notice === undefined ? {} : { notice }),
146
+ },
147
+ });
148
+ }
149
+ /**
150
+ * Check every selected bundle and assemble the report.
151
+ *
152
+ * Separate from the action so the shape is testable without a process exit.
153
+ *
154
+ * @param bundleArg - A single declared bundle name, or undefined for all of them
155
+ * @param options - Output format and the optional revision to cross-check against
156
+ */
157
+ export async function okfValidateReport(bundleArg, options) {
158
+ const configPath = findConfigFile(process.cwd());
159
+ if (!configPath) {
160
+ throw new Error('No vibe-agent-toolkit.config.yaml found. Run from a project directory.');
161
+ }
162
+ const config = await parseConfigFile(configPath);
163
+ const projectRoot = dirname(configPath);
164
+ const runs = okfBundleRuns(config.okf, projectRoot, {
165
+ ...(bundleArg !== undefined && { bundle: bundleArg }),
166
+ ...(options.specVersion !== undefined && { specVersion: options.specVersion }),
167
+ });
168
+ const checked = [];
169
+ for (const run of runs) {
170
+ checked.push({ report: await validateOkfBundle(run), root: run.root });
171
+ }
172
+ return summarizeOkfBundles(checked, projectRoot);
173
+ }
174
+ /** Action handler for `vat okf validate [bundle]`. */
175
+ export async function okfValidateCommand(bundleArg, options) {
176
+ const logger = createLogger(options.debug === true ? { debug: true } : {});
177
+ const startTime = Date.now();
178
+ try {
179
+ const report = { ...(await okfValidateReport(bundleArg, options)), durationMs: Date.now() - startTime };
180
+ writeStructuredOutput(report, options.format);
181
+ // Read from the counts the report PUBLISHES, not from the status word: an
182
+ // adopter who promotes or lowers a bundle's severity then gates on exactly
183
+ // the number a reader can see.
184
+ process.exit(exitCodeForSeverityCounts(report.summary));
185
+ }
186
+ catch (error) {
187
+ handleReportCommandError(error, logger, startTime, 'OKF validate', options.format);
188
+ }
189
+ }
190
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/okf/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,aAAa,EACb,eAAe,EACf,iBAAiB,GAGlB,MAA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M,iBAAiB,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,SAA6B,EAC7B,OAA2B;IAE3B,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,EAAE,GAAG,CAAC,MAAM,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC;QACxG,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC9C,0EAA0E;QAC1E,2EAA2E;QAC3E,+BAA+B;QAC/B,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACrF,CAAC;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shared utilities for top-level phase orchestration commands (vat build, vat verify, vat validate).
3
3
  */
4
- import { type SeverityCounts } from '@vibe-agent-toolkit/schema';
4
+ import { type ExitCodeValue, type SeverityCounts } from '@vibe-agent-toolkit/schema';
5
5
  import { type Command } from 'commander';
6
6
  import { createLogger } from '../utils/logger.js';
7
7
  /**
@@ -23,7 +23,7 @@ import { createLogger } from '../utils/logger.js';
23
23
  */
24
24
  export interface PhaseOutcome {
25
25
  document: unknown;
26
- exitCode: number;
26
+ exitCode: ExitCodeValue;
27
27
  /**
28
28
  * The phase failed UNEXPECTEDLY, so `document` is the shared error envelope
29
29
  * (`{status, error, duration}`) rather than the command's own report.
@@ -106,7 +106,7 @@ export interface PhaseResult {
106
106
  name: string;
107
107
  status: PhaseStatus;
108
108
  /** The exit code the phase claimed for itself. */
109
- exitCode?: number;
109
+ exitCode?: ExitCodeValue;
110
110
  /** Why the phase could not run at all (it threw past its own error handling). */
111
111
  error?: string;
112
112
  /**
@@ -226,9 +226,10 @@ export declare function worseOf(a: PhaseStatus, b: PhaseStatus): PhaseStatus;
226
226
  *
227
227
  * | exit code | phase status | why |
228
228
  * |-----------------------|----------------|-----------------------------------------|
229
- * | 0 | `success` | ran, found nothing actionable |
230
- * | 1 | `error` | ran, found validation errors |
231
- * | 2 (or any other) | `system-error` | the phase itself reported a system error |
229
+ * | `OK` (0) | `success` | ran, found nothing actionable |
230
+ * | `FINDINGS` (1) | `error` | ran, found validation errors |
231
+ * | `ERROR` (2) | `system-error` | the phase itself reported a system error |
232
+ * | anything else | throws | a defect in the phase, filed by `runPhase` as `system-error` |
232
233
  *
233
234
  * The exit code is then reconciled with the phase's OWN reported `status`,
234
235
  * worst-wins. An exit code has three values and cannot express `warning`:
@@ -252,15 +253,31 @@ export declare function phaseResultFromOutcome(name: string, outcome: PhaseOutco
252
253
  * `phases[].report` instead.
253
254
  *
254
255
  * Three cases, and the middle one is the one to get right:
255
- * - an unexpected failure publishes the shared envelope through
256
- * `writeYamlOutput`, matching `handleCommandError`;
256
+ * - an unexpected failure publishes the shared envelope in the format the
257
+ * operator asked for, matching `handleCommandError`;
257
258
  * - a command's own report goes through the command's own `render`;
258
259
  * - no document at all (an unconfigured run, a dry run) publishes nothing.
259
260
  *
261
+ * 🔑 **`format` is REQUIRED, and that is the whole point of it being a
262
+ * parameter.** This arm hardcoded `writeYamlOutput`, and it is `vat resources
263
+ * validate`'s ONLY error exit — so `--format json` silently produced YAML on the
264
+ * one path a scripted consumer most needs to parse. The sibling
265
+ * `handleCommandError` has the same parameter as an OPTIONAL one carrying a
266
+ * docstring that says a caller with a `--format` option must pass it, and two
267
+ * commands added in the same change dropped it anyway: a docstring is not a
268
+ * mechanism. Here the type system asks, so a new caller cannot forget. A command
269
+ * that offers no `--format` passes `undefined` and says so at its call site.
270
+ *
271
+ * ⚠️ It governs the FAILURE envelope only. A command's own report still goes
272
+ * through `render`, which is what a `--format text` lane needs.
273
+ *
260
274
  * @param outcome - What the phase produced
261
275
  * @param render - How this command publishes its OWN report shape
276
+ * @param format - What the operator asked for: `json`, or anything else (and
277
+ * `undefined`) for YAML — the same two-branch switch `handleCommandError` and
278
+ * every success path use
262
279
  */
263
- export declare function finishCommand(outcome: PhaseOutcome, render: (document: unknown) => void): never;
280
+ export declare function finishCommand(outcome: PhaseOutcome, render: (document: unknown) => void, format: string | undefined): never;
264
281
  /**
265
282
  * Run a single phase in THIS process and fold its outcome into a result.
266
283
  *
@@ -311,9 +328,9 @@ export declare function phaseIssueCounts(result: PhaseResult): SeverityCounts;
311
328
  export declare function aggregatePhaseIssueCounts(results: readonly PhaseResult[]): SeverityCounts;
312
329
  /**
313
330
  * The process exit code for a set of phase outcomes, per the exit-code contract
314
- * every orchestrator's help text documents: 0 pass, 1 validation failure,
315
- * 2 system error. Warnings do not fail a run — they are published in the status
316
- * and counts instead.
331
+ * every orchestrator's help text documents: `OK` pass, `FINDINGS` validation
332
+ * failure, `ERROR` system error. Warnings do not fail a run — they are
333
+ * published in the status and counts instead.
317
334
  */
318
- export declare function exitCodeForPhases(results: readonly PhaseResult[]): 0 | 1 | 2;
335
+ export declare function exitCodeForPhases(results: readonly PhaseResult[]): ExitCodeValue;
319
336
  //# sourceMappingURL=phase-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phase-utils.d.ts","sourceRoot":"","sources":["../../src/commands/phase-ut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