@vibe-agent-toolkit/cli 0.2.0-rc.7 → 0.2.0-rc.9

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 (395) hide show
  1. package/README.md +0 -1
  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 +5 -2
  6. package/dist/bin.js.map +1 -1
  7. package/dist/commands/agent/build.d.ts.map +1 -1
  8. package/dist/commands/agent/build.js +2 -1
  9. package/dist/commands/agent/build.js.map +1 -1
  10. package/dist/commands/agent/import.d.ts.map +1 -1
  11. package/dist/commands/agent/import.js +3 -2
  12. package/dist/commands/agent/import.js.map +1 -1
  13. package/dist/commands/agent/install-path.d.ts +36 -0
  14. package/dist/commands/agent/install-path.d.ts.map +1 -0
  15. package/dist/commands/agent/install-path.js +44 -0
  16. package/dist/commands/agent/install-path.js.map +1 -0
  17. package/dist/commands/agent/install.d.ts.map +1 -1
  18. package/dist/commands/agent/install.js +22 -10
  19. package/dist/commands/agent/install.js.map +1 -1
  20. package/dist/commands/agent/installed.d.ts.map +1 -1
  21. package/dist/commands/agent/installed.js +22 -12
  22. package/dist/commands/agent/installed.js.map +1 -1
  23. package/dist/commands/agent/list.d.ts.map +1 -1
  24. package/dist/commands/agent/list.js +2 -1
  25. package/dist/commands/agent/list.js.map +1 -1
  26. package/dist/commands/agent/run.d.ts.map +1 -1
  27. package/dist/commands/agent/run.js +2 -1
  28. package/dist/commands/agent/run.js.map +1 -1
  29. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  30. package/dist/commands/agent/uninstall.js +13 -6
  31. package/dist/commands/agent/uninstall.js.map +1 -1
  32. package/dist/commands/agent/validate.d.ts.map +1 -1
  33. package/dist/commands/agent/validate.js +3 -2
  34. package/dist/commands/agent/validate.js.map +1 -1
  35. package/dist/commands/ard/emit.d.ts +72 -23
  36. package/dist/commands/ard/emit.d.ts.map +1 -1
  37. package/dist/commands/ard/emit.js +109 -56
  38. package/dist/commands/ard/emit.js.map +1 -1
  39. package/dist/commands/ard/index.d.ts +1 -1
  40. package/dist/commands/ard/index.d.ts.map +1 -1
  41. package/dist/commands/ard/index.js +4 -3
  42. package/dist/commands/ard/index.js.map +1 -1
  43. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  44. package/dist/commands/audit/distributed-tree.js +9 -6
  45. package/dist/commands/audit/distributed-tree.js.map +1 -1
  46. package/dist/commands/audit/provenance.d.ts.map +1 -1
  47. package/dist/commands/audit/provenance.js +4 -3
  48. package/dist/commands/audit/provenance.js.map +1 -1
  49. package/dist/commands/audit/scan-population.d.ts +158 -0
  50. package/dist/commands/audit/scan-population.d.ts.map +1 -0
  51. package/dist/commands/audit/scan-population.js +292 -0
  52. package/dist/commands/audit/scan-population.js.map +1 -0
  53. package/dist/commands/audit-settings.d.ts.map +1 -1
  54. package/dist/commands/audit-settings.js +6 -5
  55. package/dist/commands/audit-settings.js.map +1 -1
  56. package/dist/commands/audit.d.ts +16 -14
  57. package/dist/commands/audit.d.ts.map +1 -1
  58. package/dist/commands/audit.js +304 -389
  59. package/dist/commands/audit.js.map +1 -1
  60. package/dist/commands/build.d.ts.map +1 -1
  61. package/dist/commands/build.js +25 -24
  62. package/dist/commands/build.js.map +1 -1
  63. package/dist/commands/cache/clear.d.ts +17 -3
  64. package/dist/commands/cache/clear.d.ts.map +1 -1
  65. package/dist/commands/cache/clear.js +34 -13
  66. package/dist/commands/cache/clear.js.map +1 -1
  67. package/dist/commands/cache/index.d.ts.map +1 -1
  68. package/dist/commands/cache/index.js +19 -10
  69. package/dist/commands/cache/index.js.map +1 -1
  70. package/dist/commands/claude/context.d.ts +2 -2
  71. package/dist/commands/claude/context.d.ts.map +1 -1
  72. package/dist/commands/claude/context.js +7 -6
  73. package/dist/commands/claude/context.js.map +1 -1
  74. package/dist/commands/claude/index.d.ts +12 -11
  75. package/dist/commands/claude/index.d.ts.map +1 -1
  76. package/dist/commands/claude/index.js +14 -16
  77. package/dist/commands/claude/index.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 +22 -12
  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.map +1 -1
  95. package/dist/commands/claude/marketplace/validate.js +26 -16
  96. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  97. package/dist/commands/claude/org/api-keys.d.ts +0 -3
  98. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  99. package/dist/commands/claude/org/api-keys.js +2 -1
  100. package/dist/commands/claude/org/api-keys.js.map +1 -1
  101. package/dist/commands/claude/org/helpers.d.ts +17 -22
  102. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  103. package/dist/commands/claude/org/helpers.js +6 -22
  104. package/dist/commands/claude/org/helpers.js.map +1 -1
  105. package/dist/commands/claude/org/invites.d.ts +0 -3
  106. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  107. package/dist/commands/claude/org/invites.js +3 -2
  108. package/dist/commands/claude/org/invites.js.map +1 -1
  109. package/dist/commands/claude/org/skills.d.ts +19 -1
  110. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  111. package/dist/commands/claude/org/skills.js +147 -111
  112. package/dist/commands/claude/org/skills.js.map +1 -1
  113. package/dist/commands/claude/org/users.d.ts +0 -3
  114. package/dist/commands/claude/org/users.d.ts.map +1 -1
  115. package/dist/commands/claude/org/users.js +3 -2
  116. package/dist/commands/claude/org/users.js.map +1 -1
  117. package/dist/commands/claude/org/workspaces.d.ts +0 -3
  118. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  119. package/dist/commands/claude/org/workspaces.js +6 -5
  120. package/dist/commands/claude/org/workspaces.js.map +1 -1
  121. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  122. package/dist/commands/claude/plugin/build.js +23 -52
  123. package/dist/commands/claude/plugin/build.js.map +1 -1
  124. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  125. package/dist/commands/claude/plugin/helpers.js +0 -6
  126. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  127. package/dist/commands/claude/plugin/install.d.ts +12 -0
  128. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  129. package/dist/commands/claude/plugin/install.js +71 -60
  130. package/dist/commands/claude/plugin/install.js.map +1 -1
  131. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  132. package/dist/commands/claude/plugin/list.js +3 -2
  133. package/dist/commands/claude/plugin/list.js.map +1 -1
  134. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  135. package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
  136. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  137. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  138. package/dist/commands/claude/plugin/plugin-files.js +3 -6
  139. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  140. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  141. package/dist/commands/claude/plugin/plugin-validators.js +3 -6
  142. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  143. package/dist/commands/claude/plugin/tree-copy.d.ts +2 -1
  144. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  145. package/dist/commands/claude/plugin/tree-copy.js +15 -14
  146. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  147. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  148. package/dist/commands/claude/plugin/uninstall.js +4 -4
  149. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  150. package/dist/commands/consistency-check.d.ts +17 -15
  151. package/dist/commands/consistency-check.d.ts.map +1 -1
  152. package/dist/commands/consistency-check.js +149 -104
  153. package/dist/commands/consistency-check.js.map +1 -1
  154. package/dist/commands/corpus/report.d.ts.map +1 -1
  155. package/dist/commands/corpus/report.js +1 -2
  156. package/dist/commands/corpus/report.js.map +1 -1
  157. package/dist/commands/corpus/runner.d.ts.map +1 -1
  158. package/dist/commands/corpus/runner.js +2 -6
  159. package/dist/commands/corpus/runner.js.map +1 -1
  160. package/dist/commands/corpus/scan.d.ts.map +1 -1
  161. package/dist/commands/corpus/scan.js +2 -3
  162. package/dist/commands/corpus/scan.js.map +1 -1
  163. package/dist/commands/corpus/seed.d.ts +4 -4
  164. package/dist/commands/corpus/seed.d.ts.map +1 -1
  165. package/dist/commands/corpus/seed.js +1 -3
  166. package/dist/commands/corpus/seed.js.map +1 -1
  167. package/dist/commands/doctor.d.ts.map +1 -1
  168. package/dist/commands/doctor.js +55 -37
  169. package/dist/commands/doctor.js.map +1 -1
  170. package/dist/commands/inventory.d.ts.map +1 -1
  171. package/dist/commands/inventory.js +6 -7
  172. package/dist/commands/inventory.js.map +1 -1
  173. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  174. package/dist/commands/mcp/list-collections.js +2 -1
  175. package/dist/commands/mcp/list-collections.js.map +1 -1
  176. package/dist/commands/mcp/serve.d.ts.map +1 -1
  177. package/dist/commands/mcp/serve.js +3 -2
  178. package/dist/commands/mcp/serve.js.map +1 -1
  179. package/dist/commands/okf/index.d.ts.map +1 -1
  180. package/dist/commands/okf/index.js +14 -2
  181. package/dist/commands/okf/index.js.map +1 -1
  182. package/dist/commands/okf/validate.d.ts +157 -48
  183. package/dist/commands/okf/validate.d.ts.map +1 -1
  184. package/dist/commands/okf/validate.js +109 -76
  185. package/dist/commands/okf/validate.js.map +1 -1
  186. package/dist/commands/phase-utils.d.ts +11 -10
  187. package/dist/commands/phase-utils.d.ts.map +1 -1
  188. package/dist/commands/phase-utils.js +30 -14
  189. package/dist/commands/phase-utils.js.map +1 -1
  190. package/dist/commands/positional-args.d.ts.map +1 -1
  191. package/dist/commands/positional-args.js +2 -1
  192. package/dist/commands/positional-args.js.map +1 -1
  193. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  194. package/dist/commands/rag/clear-command.js +2 -1
  195. package/dist/commands/rag/clear-command.js.map +1 -1
  196. package/dist/commands/rag/index-command.d.ts.map +1 -1
  197. package/dist/commands/rag/index-command.js +4 -1
  198. package/dist/commands/rag/index-command.js.map +1 -1
  199. package/dist/commands/rag/query-command.d.ts.map +1 -1
  200. package/dist/commands/rag/query-command.js +2 -1
  201. package/dist/commands/rag/query-command.js.map +1 -1
  202. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  203. package/dist/commands/rag/stats-command.js +2 -1
  204. package/dist/commands/rag/stats-command.js.map +1 -1
  205. package/dist/commands/resources/check-progress.d.ts +6 -0
  206. package/dist/commands/resources/check-progress.d.ts.map +1 -1
  207. package/dist/commands/resources/check-progress.js +15 -4
  208. package/dist/commands/resources/check-progress.js.map +1 -1
  209. package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
  210. package/dist/commands/resources/check-supervisor.js +14 -7
  211. package/dist/commands/resources/check-supervisor.js.map +1 -1
  212. package/dist/commands/resources/check.d.ts +315 -205
  213. package/dist/commands/resources/check.d.ts.map +1 -1
  214. package/dist/commands/resources/check.js +368 -327
  215. package/dist/commands/resources/check.js.map +1 -1
  216. package/dist/commands/resources/index.d.ts.map +1 -1
  217. package/dist/commands/resources/index.js +159 -39
  218. package/dist/commands/resources/index.js.map +1 -1
  219. package/dist/commands/resources/query.d.ts +2 -2
  220. package/dist/commands/resources/query.d.ts.map +1 -1
  221. package/dist/commands/resources/query.js +24 -18
  222. package/dist/commands/resources/query.js.map +1 -1
  223. package/dist/commands/resources/scan.d.ts.map +1 -1
  224. package/dist/commands/resources/scan.js +4 -8
  225. package/dist/commands/resources/scan.js.map +1 -1
  226. package/dist/commands/resources/validate.d.ts +1 -1
  227. package/dist/commands/resources/validate.d.ts.map +1 -1
  228. package/dist/commands/resources/validate.js +0 -1
  229. package/dist/commands/resources/validate.js.map +1 -1
  230. package/dist/commands/skill/review-checklist.d.ts +3 -2
  231. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  232. package/dist/commands/skill/review-checklist.js +4 -2
  233. package/dist/commands/skill/review-checklist.js.map +1 -1
  234. package/dist/commands/skill/review.d.ts +247 -0
  235. package/dist/commands/skill/review.d.ts.map +1 -1
  236. package/dist/commands/skill/review.js +90 -60
  237. package/dist/commands/skill/review.js.map +1 -1
  238. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  239. package/dist/commands/skill/test/configure.js +0 -1
  240. package/dist/commands/skill/test/configure.js.map +1 -1
  241. package/dist/commands/skill/test/run.d.ts +12 -6
  242. package/dist/commands/skill/test/run.d.ts.map +1 -1
  243. package/dist/commands/skill/test/run.js +120 -65
  244. package/dist/commands/skill/test/run.js.map +1 -1
  245. package/dist/commands/skills/build.d.ts +83 -3
  246. package/dist/commands/skills/build.d.ts.map +1 -1
  247. package/dist/commands/skills/build.js +162 -40
  248. package/dist/commands/skills/build.js.map +1 -1
  249. package/dist/commands/skills/install.d.ts +2 -1
  250. package/dist/commands/skills/install.d.ts.map +1 -1
  251. package/dist/commands/skills/install.js +20 -30
  252. package/dist/commands/skills/install.js.map +1 -1
  253. package/dist/commands/skills/list.d.ts.map +1 -1
  254. package/dist/commands/skills/list.js +14 -18
  255. package/dist/commands/skills/list.js.map +1 -1
  256. package/dist/commands/skills/package.d.ts +1 -1
  257. package/dist/commands/skills/package.d.ts.map +1 -1
  258. package/dist/commands/skills/package.js +6 -8
  259. package/dist/commands/skills/package.js.map +1 -1
  260. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  261. package/dist/commands/skills/scope-guard.js +2 -4
  262. package/dist/commands/skills/scope-guard.js.map +1 -1
  263. package/dist/commands/skills/shared.d.ts.map +1 -1
  264. package/dist/commands/skills/shared.js +2 -4
  265. package/dist/commands/skills/shared.js.map +1 -1
  266. package/dist/commands/skills/skill-discovery.d.ts +15 -13
  267. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  268. package/dist/commands/skills/skill-discovery.js +23 -5
  269. package/dist/commands/skills/skill-discovery.js.map +1 -1
  270. package/dist/commands/skills/source-resolvers.d.ts +15 -0
  271. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  272. package/dist/commands/skills/source-resolvers.js +25 -4
  273. package/dist/commands/skills/source-resolvers.js.map +1 -1
  274. package/dist/commands/validate.d.ts +1 -1
  275. package/dist/commands/validate.d.ts.map +1 -1
  276. package/dist/commands/validate.js +39 -14
  277. package/dist/commands/validate.js.map +1 -1
  278. package/dist/commands/verify.d.ts +17 -5
  279. package/dist/commands/verify.d.ts.map +1 -1
  280. package/dist/commands/verify.js +161 -104
  281. package/dist/commands/verify.js.map +1 -1
  282. package/dist/index.d.ts +0 -1
  283. package/dist/index.d.ts.map +1 -1
  284. package/dist/index.js +5 -1
  285. package/dist/index.js.map +1 -1
  286. package/dist/report-schemas.d.ts +45 -0
  287. package/dist/report-schemas.d.ts.map +1 -0
  288. package/dist/report-schemas.js +100 -0
  289. package/dist/report-schemas.js.map +1 -0
  290. package/dist/skill-resolution/classify.js +2 -2
  291. package/dist/skill-resolution/classify.js.map +1 -1
  292. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  293. package/dist/skill-resolution/resolve-skill-reference.js +50 -55
  294. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  295. package/dist/utils/agent-discovery.d.ts.map +1 -1
  296. package/dist/utils/agent-discovery.js +22 -11
  297. package/dist/utils/agent-discovery.js.map +1 -1
  298. package/dist/utils/agent-runner.d.ts.map +1 -1
  299. package/dist/utils/agent-runner.js +0 -1
  300. package/dist/utils/agent-runner.js.map +1 -1
  301. package/dist/utils/claude-context-lens.d.ts +34 -0
  302. package/dist/utils/claude-context-lens.d.ts.map +1 -0
  303. package/dist/utils/claude-context-lens.js +39 -0
  304. package/dist/utils/claude-context-lens.js.map +1 -0
  305. package/dist/utils/command-error.d.ts +63 -62
  306. package/dist/utils/command-error.d.ts.map +1 -1
  307. package/dist/utils/command-error.js +80 -76
  308. package/dist/utils/command-error.js.map +1 -1
  309. package/dist/utils/config-loader.d.ts +2 -1
  310. package/dist/utils/config-loader.d.ts.map +1 -1
  311. package/dist/utils/config-loader.js +3 -6
  312. package/dist/utils/config-loader.js.map +1 -1
  313. package/dist/utils/corpus-target.d.ts +5 -27
  314. package/dist/utils/corpus-target.d.ts.map +1 -1
  315. package/dist/utils/corpus-target.js +7 -33
  316. package/dist/utils/corpus-target.js.map +1 -1
  317. package/dist/utils/help-loader.d.ts.map +1 -1
  318. package/dist/utils/help-loader.js +0 -1
  319. package/dist/utils/help-loader.js.map +1 -1
  320. package/dist/utils/issue-rendering.d.ts +2 -2
  321. package/dist/utils/issue-rendering.js +2 -2
  322. package/dist/utils/optional-backend.d.ts.map +1 -1
  323. package/dist/utils/optional-backend.js +2 -1
  324. package/dist/utils/optional-backend.js.map +1 -1
  325. package/dist/utils/output.d.ts +9 -0
  326. package/dist/utils/output.d.ts.map +1 -1
  327. package/dist/utils/output.js +16 -0
  328. package/dist/utils/output.js.map +1 -1
  329. package/dist/utils/package-json.d.ts +24 -0
  330. package/dist/utils/package-json.d.ts.map +1 -0
  331. package/dist/utils/package-json.js +49 -0
  332. package/dist/utils/package-json.js.map +1 -0
  333. package/dist/utils/project-root-policy.d.ts.map +1 -1
  334. package/dist/utils/project-root-policy.js +0 -2
  335. package/dist/utils/project-root-policy.js.map +1 -1
  336. package/dist/utils/projection-lenses.d.ts +98 -0
  337. package/dist/utils/projection-lenses.d.ts.map +1 -0
  338. package/dist/utils/projection-lenses.js +203 -0
  339. package/dist/utils/projection-lenses.js.map +1 -0
  340. package/dist/utils/projection-query.d.ts +38 -14
  341. package/dist/utils/projection-query.d.ts.map +1 -1
  342. package/dist/utils/projection-query.js +78 -17
  343. package/dist/utils/projection-query.js.map +1 -1
  344. package/dist/utils/projection-store.d.ts +61 -42
  345. package/dist/utils/projection-store.d.ts.map +1 -1
  346. package/dist/utils/projection-store.js +155 -59
  347. package/dist/utils/projection-store.js.map +1 -1
  348. package/dist/utils/relation-limits.d.ts +50 -0
  349. package/dist/utils/relation-limits.d.ts.map +1 -0
  350. package/dist/utils/relation-limits.js +50 -0
  351. package/dist/utils/relation-limits.js.map +1 -0
  352. package/dist/utils/resource-loader.js +2 -2
  353. package/dist/utils/resource-loader.js.map +1 -1
  354. package/dist/utils/skill-discovery.d.ts.map +1 -1
  355. package/dist/utils/skill-discovery.js +2 -1
  356. package/dist/utils/skill-discovery.js.map +1 -1
  357. package/dist/utils/skill-packaging-config.d.ts +63 -1
  358. package/dist/utils/skill-packaging-config.d.ts.map +1 -1
  359. package/dist/utils/skill-packaging-config.js +56 -1
  360. package/dist/utils/skill-packaging-config.js.map +1 -1
  361. package/dist/utils/url-redact.d.ts.map +1 -1
  362. package/dist/utils/url-redact.js +4 -6
  363. package/dist/utils/url-redact.js.map +1 -1
  364. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  365. package/dist/utils/user-context-scanner.js +0 -2
  366. package/dist/utils/user-context-scanner.js.map +1 -1
  367. package/dist/utils/validate-help-files.d.ts.map +1 -1
  368. package/dist/utils/validate-help-files.js +3 -4
  369. package/dist/utils/validate-help-files.js.map +1 -1
  370. package/dist/utils/vat-bin-path.d.ts.map +1 -1
  371. package/dist/utils/vat-bin-path.js +0 -1
  372. package/dist/utils/vat-bin-path.js.map +1 -1
  373. package/dist/version.d.ts.map +1 -1
  374. package/dist/version.js +1 -3
  375. package/dist/version.js.map +1 -1
  376. package/docs/audit.md +44 -53
  377. package/docs/doctor.md +1 -0
  378. package/docs/index.md +18 -10
  379. package/docs/rag.md +0 -1
  380. package/docs/resources.md +0 -1
  381. package/docs/skill-test.md +10 -9
  382. package/docs/skills.md +6 -7
  383. package/package.json +23 -28
  384. package/schemas/ard-emit.json +149 -0
  385. package/schemas/okf-validate.json +170 -0
  386. package/schemas/resources-check.json +229 -0
  387. package/schemas/skill-review.json +230 -0
  388. package/dist/commands/claude/budget.d.ts +0 -170
  389. package/dist/commands/claude/budget.d.ts.map +0 -1
  390. package/dist/commands/claude/budget.js +0 -464
  391. package/dist/commands/claude/budget.js.map +0 -1
  392. package/dist/utils/context-budget-issues.d.ts +0 -108
  393. package/dist/utils/context-budget-issues.d.ts.map +0 -1
  394. package/dist/utils/context-budget-issues.js +0 -280
  395. package/dist/utils/context-budget-issues.js.map +0 -1
@@ -8,67 +8,177 @@
8
8
  * `okf.bundles.<name>.severity`; the finding is still reported either way.
9
9
  */
10
10
  import { type OkfBundleReport } from '@vibe-agent-toolkit/resources';
11
- import type { SeverityCounts } from '@vibe-agent-toolkit/schema';
11
+ import { type Report } from '@vibe-agent-toolkit/schema';
12
+ import { z } from 'zod';
12
13
  export interface OkfValidateOptions {
13
14
  format?: 'yaml' | 'json';
14
15
  specVersion?: string;
15
16
  debug?: boolean;
16
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>;
17
102
  /** The document this command publishes. */
18
- interface OkfValidateReport {
19
- status: OkfValidateStatus;
20
- bundles: OkfBundleReport[];
21
- findingCount: number;
22
- issueCounts: SeverityCounts;
23
- /** Present only when there was nothing to check; says what to declare. */
24
- notice?: string;
25
- }
26
- /**
27
- * `no-bundles` is a third word on purpose, and it is not cosmetic.
28
- *
29
- * 🪤 This command used to print `status: passed`, `bundles: []`, exit 0 when a
30
- * project declared no `okf.bundles` at all — a report indistinguishable from a
31
- * bundle that was read in full and found conformant. A mistyped key
32
- * (`okf.bundle:`, `okf.Bundles:`) therefore reads as a clean bill of health,
33
- * which is the *green-without-running* shape this repo keeps rediscovering.
34
- *
35
- * `vat resources check` already answers the identical situation properly — "No
36
- * checks are declared. Add them under `resources.checks` …" — so this follows a
37
- * convention the repo holds rather than inventing one.
38
- *
39
- * The exit code stays 0: nothing failed, and failing a build for a feature the
40
- * project never opted into would be worse. It is the status *word* that must not
41
- * claim a pass, because that word is what a human and a CI log actually read.
42
- */
43
- export type OkfValidateStatus = 'passed' | 'failed' | 'no-bundles';
44
- /** The summary half of the report: pure, so the status rule is testable. */
45
- export interface OkfValidateSummary {
46
- status: OkfValidateStatus;
47
- findingCount: number;
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">;
48
128
  /**
49
- * The severity distribution, published BESIDE the status rather than folded
50
- * into it.
129
+ * Present only when there was nothing to check, and says what to declare or
130
+ * which root to look at.
51
131
  *
52
- * Load-bearing here specifically because OKF severity is adopter-configurable
53
- * per bundle (`okf.bundles.<name>.severity`). A project that lowers a bundle
54
- * to `warning` gets `status: passed` and exit 0 for a bundle carrying real
55
- * conformance findings — correct, and completely opaque from the status word
56
- * alone. The distribution is the only thing in the report that distinguishes
57
- * "nothing was found" from "everything found was downgraded".
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.
58
139
  */
59
- issueCounts: SeverityCounts;
60
- notice?: string;
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;
61
166
  }
62
167
  /**
63
- * Decide the status word and the counts for a set of bundle reports.
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.
64
174
  *
65
- * @param bundles - One report per bundle that was actually checked
66
- * @returns The status, the finding count and severity distribution, and a
67
- * notice when nothing was declared or a declared bundle held nothing
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
68
178
  */
69
- export declare function summarizeOkfBundles(bundles: readonly OkfBundleReport[]): OkfValidateSummary;
179
+ export declare function summarizeOkfBundles(checked: readonly CheckedOkfBundle[], projectRoot: string): OkfValidateReport;
70
180
  /**
71
- * Assemble the report for every selected bundle.
181
+ * Check every selected bundle and assemble the report.
72
182
  *
73
183
  * Separate from the action so the shape is testable without a process exit.
74
184
  *
@@ -78,5 +188,4 @@ export declare function summarizeOkfBundles(bundles: readonly OkfBundleReport[])
78
188
  export declare function okfValidateReport(bundleArg: string | undefined, options: OkfValidateOptions): Promise<OkfValidateReport>;
79
189
  /** Action handler for `vat okf validate [bundle]`. */
80
190
  export declare function okfValidateCommand(bundleArg: string | undefined, options: OkfValidateOptions): Promise<void>;
81
- export {};
82
191
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +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,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAOjE,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,2CAA2C;AAC3C,UAAU,iBAAiB;IACzB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,cAAc,CAAC;IAC5B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEnE,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;OAUG;IACH,WAAW,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,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B,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"}
@@ -9,48 +9,50 @@
9
9
  */
10
10
  import { dirname } from 'node:path';
11
11
  import { okfBundleRuns, parseConfigFile, validateOkfBundle, } from '@vibe-agent-toolkit/resources';
12
- import { findConfigFile } from '@vibe-agent-toolkit/utils';
13
- import { handleCommandError } from '../../utils/command-error.js';
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';
14
16
  import { createLogger } from '../../utils/logger.js';
15
- import { writeJsonOutput, writeYamlOutput } from '../../utils/output.js';
16
- /**
17
- * Count one bundle set's findings by severity.
18
- *
19
- * Not `countBySeverity` from `@vibe-agent-toolkit/schema`: that takes
20
- * `ValidationIssue[]`, whose `code` is the shared `IssueCode` registry union,
21
- * and an OKF finding's code is drawn from the specification's own vocabulary
22
- * rather than that registry. The counts field is still typed as the shared
23
- * `SeverityCounts`, so the SHAPE stays checked against the canonical one and a
24
- * bucket cannot be added, renamed or dropped here alone.
25
- *
26
- * @param findings - Every finding across every bundle that was checked
27
- * @returns The per-severity distribution
28
- */
29
- function countOkfFindings(findings) {
30
- let errors = 0;
31
- let warnings = 0;
32
- let info = 0;
33
- for (const finding of findings) {
34
- if (finding.severity === 'error') {
35
- errors += 1;
36
- }
37
- else if (finding.severity === 'warning') {
38
- warnings += 1;
39
- }
40
- else {
41
- info += 1;
42
- }
43
- }
44
- return { errors, warnings, info };
45
- }
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);
46
49
  /**
47
50
  * The bundles whose root was read successfully and held not one markdown file.
48
51
  *
49
- * 🪤 The same green-without-running shape the `no-bundles` notice exists for,
50
- * one level down. A `root:` typo that lands on a real-but-wrong directory, or a
51
- * root written one level too deep, produces `status: passed`, exit 0 and an
52
- * empty findings list — a report indistinguishable from a bundle that was read
53
- * in full and found conformant.
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.
54
56
  *
55
57
  * A bundle carrying findings is excluded even when its document lists are empty:
56
58
  * that is the unreadable-root case, which already says the truthful thing in its
@@ -79,38 +81,73 @@ function vacuousNotice(vacuous) {
79
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\`.`;
80
82
  }
81
83
  /**
82
- * Decide the status word and the counts for a set of bundle reports.
84
+ * The sentence a run carries when it examined less than a reader would assume.
83
85
  *
84
- * @param bundles - One report per bundle that was actually checked
85
- * @returns The status, the finding count and severity distribution, and a
86
- * notice when nothing was declared or a declared bundle held nothing
86
+ * @param bundles - Every bundle report in the run
87
+ * @returns The notice, or nothing when every declared bundle held documents
87
88
  */
88
- export function summarizeOkfBundles(bundles) {
89
- const findings = bundles.flatMap((report) => report.findings);
90
- const findingCount = findings.length;
91
- const issueCounts = countOkfFindings(findings);
92
- if (bundles.length === 0) {
93
- return {
94
- status: 'no-bundles',
95
- findingCount,
96
- issueCounts,
97
- 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`.',
98
- };
99
- }
100
- // Status and exit code deliberately do NOT move: nothing failed, and failing a
101
- // build over an empty directory would be worse than the silence. It is the
102
- // report that must stop implying a bundle was read when it was not.
89
+ function noticeFor(bundles) {
90
+ if (bundles.length === 0)
91
+ return NO_BUNDLES_NOTICE;
103
92
  const vacuous = vacuousBundles(bundles);
104
- const status = issueCounts.errors > 0 ? 'failed' : 'passed';
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) {
105
108
  return {
106
- status,
107
- findingCount,
108
- issueCounts,
109
- ...(vacuous.length > 0 && { notice: vacuousNotice(vacuous) }),
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 }),
110
115
  };
111
116
  }
112
117
  /**
113
- * Assemble the report for every selected bundle.
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.
114
151
  *
115
152
  * Separate from the action so the shape is testable without a process exit.
116
153
  *
@@ -123,35 +160,31 @@ export async function okfValidateReport(bundleArg, options) {
123
160
  throw new Error('No vibe-agent-toolkit.config.yaml found. Run from a project directory.');
124
161
  }
125
162
  const config = await parseConfigFile(configPath);
126
- const runs = okfBundleRuns(config.okf, dirname(configPath), {
163
+ const projectRoot = dirname(configPath);
164
+ const runs = okfBundleRuns(config.okf, projectRoot, {
127
165
  ...(bundleArg !== undefined && { bundle: bundleArg }),
128
166
  ...(options.specVersion !== undefined && { specVersion: options.specVersion }),
129
167
  });
130
- const bundles = [];
168
+ const checked = [];
131
169
  for (const run of runs) {
132
- bundles.push(await validateOkfBundle(run));
170
+ checked.push({ report: await validateOkfBundle(run), root: run.root });
133
171
  }
134
- return { ...summarizeOkfBundles(bundles), bundles };
172
+ return summarizeOkfBundles(checked, projectRoot);
135
173
  }
136
174
  /** Action handler for `vat okf validate [bundle]`. */
137
175
  export async function okfValidateCommand(bundleArg, options) {
138
176
  const logger = createLogger(options.debug === true ? { debug: true } : {});
139
177
  const startTime = Date.now();
140
178
  try {
141
- const report = await okfValidateReport(bundleArg, options);
142
- if (options.format === 'json') {
143
- writeJsonOutput(report);
144
- }
145
- else {
146
- writeYamlOutput(report);
147
- }
179
+ const report = { ...(await okfValidateReport(bundleArg, options)), durationMs: Date.now() - startTime };
180
+ writeStructuredOutput(report, options.format);
148
181
  // Read from the counts the report PUBLISHES, not from the status word: an
149
182
  // adopter who promotes or lowers a bundle's severity then gates on exactly
150
183
  // the number a reader can see.
151
- process.exit(report.issueCounts.errors > 0 ? 1 : 0);
184
+ process.exit(exitCodeForSeverityCounts(report.summary));
152
185
  }
153
186
  catch (error) {
154
- handleCommandError(error, logger, startTime, 'OKF validate', options.format);
187
+ handleReportCommandError(error, logger, startTime, 'OKF validate', options.format);
155
188
  }
156
189
  }
157
190
  //# sourceMappingURL=validate.js.map
@@ -1 +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,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAwDzE;;;;;;;;;;;;GAYG;AACH,SAAS,gBAAgB,CAAC,QAA+B;IACvD,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,IAAI,GAAG,CAAC,CAAC;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(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`:
@@ -327,9 +328,9 @@ export declare function phaseIssueCounts(result: PhaseResult): SeverityCounts;
327
328
  export declare function aggregatePhaseIssueCounts(results: readonly PhaseResult[]): SeverityCounts;
328
329
  /**
329
330
  * The process exit code for a set of phase outcomes, per the exit-code contract
330
- * every orchestrator's help text documents: 0 pass, 1 validation failure,
331
- * 2 system error. Warnings do not fail a run — they are published in the status
332
- * 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.
333
334
  */
334
- export declare function exitCodeForPhases(results: readonly PhaseResult[]): 0 | 1 | 2;
335
+ export declare function exitCodeForPhases(results: readonly PhaseResult[]): ExitCodeValue;
335
336
  //# sourceMappingURL=phase-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phase-utils.d.ts","sourceRoot":"","sources":["../../src/commands/phase-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAI9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAclG;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,CA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