@vibe-agent-toolkit/cli 0.2.0-rc.1 → 0.2.0-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/README.md +4 -5
  2. package/dist/bin/vat +97 -28
  3. package/dist/bin/vat.js +97 -28
  4. package/dist/bin/vat.js.map +1 -1
  5. package/dist/bin.js +115 -76
  6. package/dist/bin.js.map +1 -1
  7. package/dist/command-loaders.d.ts +44 -0
  8. package/dist/command-loaders.d.ts.map +1 -0
  9. package/dist/command-loaders.js +60 -0
  10. package/dist/command-loaders.js.map +1 -0
  11. package/dist/commands/agent/build.d.ts.map +1 -1
  12. package/dist/commands/agent/build.js +2 -1
  13. package/dist/commands/agent/build.js.map +1 -1
  14. package/dist/commands/agent/import.d.ts.map +1 -1
  15. package/dist/commands/agent/import.js +3 -2
  16. package/dist/commands/agent/import.js.map +1 -1
  17. package/dist/commands/agent/index.js +1 -1
  18. package/dist/commands/agent/install-path.d.ts +36 -0
  19. package/dist/commands/agent/install-path.d.ts.map +1 -0
  20. package/dist/commands/agent/install-path.js +44 -0
  21. package/dist/commands/agent/install-path.js.map +1 -0
  22. package/dist/commands/agent/install.d.ts.map +1 -1
  23. package/dist/commands/agent/install.js +66 -13
  24. package/dist/commands/agent/install.js.map +1 -1
  25. package/dist/commands/agent/installed.d.ts.map +1 -1
  26. package/dist/commands/agent/installed.js +22 -12
  27. package/dist/commands/agent/installed.js.map +1 -1
  28. package/dist/commands/agent/list.d.ts.map +1 -1
  29. package/dist/commands/agent/list.js +2 -1
  30. package/dist/commands/agent/list.js.map +1 -1
  31. package/dist/commands/agent/run.d.ts.map +1 -1
  32. package/dist/commands/agent/run.js +2 -1
  33. package/dist/commands/agent/run.js.map +1 -1
  34. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  35. package/dist/commands/agent/uninstall.js +13 -6
  36. package/dist/commands/agent/uninstall.js.map +1 -1
  37. package/dist/commands/agent/validate.d.ts.map +1 -1
  38. package/dist/commands/agent/validate.js +3 -2
  39. package/dist/commands/agent/validate.js.map +1 -1
  40. package/dist/commands/ard/emit.d.ts +165 -0
  41. package/dist/commands/ard/emit.d.ts.map +1 -0
  42. package/dist/commands/ard/emit.js +338 -0
  43. package/dist/commands/ard/emit.js.map +1 -0
  44. package/dist/commands/ard/index.d.ts +12 -0
  45. package/dist/commands/ard/index.d.ts.map +1 -0
  46. package/dist/commands/ard/index.js +84 -0
  47. package/dist/commands/ard/index.js.map +1 -0
  48. package/dist/commands/ard/surfaces.d.ts +56 -0
  49. package/dist/commands/ard/surfaces.d.ts.map +1 -0
  50. package/dist/commands/ard/surfaces.js +150 -0
  51. package/dist/commands/ard/surfaces.js.map +1 -0
  52. package/dist/commands/audit/distributed-tree.d.ts +2 -2
  53. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  54. package/dist/commands/audit/distributed-tree.js +11 -7
  55. package/dist/commands/audit/distributed-tree.js.map +1 -1
  56. package/dist/commands/audit/git-url-clone.d.ts +1 -1
  57. package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
  58. package/dist/commands/audit/git-url-clone.js.map +1 -1
  59. package/dist/commands/audit/hierarchical-output.d.ts +1 -1
  60. package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
  61. package/dist/commands/audit/hierarchical-output.js +1 -1
  62. package/dist/commands/audit/hierarchical-output.js.map +1 -1
  63. package/dist/commands/audit/provenance.d.ts.map +1 -1
  64. package/dist/commands/audit/provenance.js +4 -3
  65. package/dist/commands/audit/provenance.js.map +1 -1
  66. package/dist/commands/audit/scan-population.d.ts +158 -0
  67. package/dist/commands/audit/scan-population.d.ts.map +1 -0
  68. package/dist/commands/audit/scan-population.js +292 -0
  69. package/dist/commands/audit/scan-population.js.map +1 -0
  70. package/dist/commands/audit-settings.d.ts.map +1 -1
  71. package/dist/commands/audit-settings.js +6 -5
  72. package/dist/commands/audit-settings.js.map +1 -1
  73. package/dist/commands/audit.d.ts +98 -8
  74. package/dist/commands/audit.d.ts.map +1 -1
  75. package/dist/commands/audit.js +1150 -394
  76. package/dist/commands/audit.js.map +1 -1
  77. package/dist/commands/build.d.ts +1 -1
  78. package/dist/commands/build.d.ts.map +1 -1
  79. package/dist/commands/build.js +40 -36
  80. package/dist/commands/build.js.map +1 -1
  81. package/dist/commands/cache/cache-control.d.ts +82 -0
  82. package/dist/commands/cache/cache-control.d.ts.map +1 -0
  83. package/dist/commands/cache/cache-control.js +86 -0
  84. package/dist/commands/cache/cache-control.js.map +1 -0
  85. package/dist/commands/cache/clear.d.ts +34 -6
  86. package/dist/commands/cache/clear.d.ts.map +1 -1
  87. package/dist/commands/cache/clear.js +101 -15
  88. package/dist/commands/cache/clear.js.map +1 -1
  89. package/dist/commands/cache/index.d.ts +13 -63
  90. package/dist/commands/cache/index.d.ts.map +1 -1
  91. package/dist/commands/cache/index.js +47 -79
  92. package/dist/commands/cache/index.js.map +1 -1
  93. package/dist/commands/claude/claude-config.d.ts.map +1 -1
  94. package/dist/commands/claude/claude-config.js +6 -0
  95. package/dist/commands/claude/claude-config.js.map +1 -1
  96. package/dist/commands/claude/context.d.ts +372 -0
  97. package/dist/commands/claude/context.d.ts.map +1 -0
  98. package/dist/commands/claude/context.js +1115 -0
  99. package/dist/commands/claude/context.js.map +1 -0
  100. package/dist/commands/claude/index.d.ts +14 -0
  101. package/dist/commands/claude/index.d.ts.map +1 -1
  102. package/dist/commands/claude/index.js +22 -2
  103. package/dist/commands/claude/index.js.map +1 -1
  104. package/dist/commands/claude/marketplace/changelog-utils.d.ts +1 -1
  105. package/dist/commands/claude/marketplace/changelog-utils.d.ts.map +1 -1
  106. package/dist/commands/claude/marketplace/changelog-utils.js +1 -2
  107. package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
  108. package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
  109. package/dist/commands/claude/marketplace/git-publish.js +40 -31
  110. package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
  111. package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
  112. package/dist/commands/claude/marketplace/license-utils.js +0 -1
  113. package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
  114. package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
  115. package/dist/commands/claude/marketplace/publish-tree.js +0 -6
  116. package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
  117. package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
  118. package/dist/commands/claude/marketplace/publish.js +2 -1
  119. package/dist/commands/claude/marketplace/publish.js.map +1 -1
  120. package/dist/commands/claude/marketplace/validate.d.ts +73 -22
  121. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  122. package/dist/commands/claude/marketplace/validate.js +407 -72
  123. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  124. package/dist/commands/claude/org/api-keys.d.ts +0 -3
  125. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  126. package/dist/commands/claude/org/api-keys.js +2 -1
  127. package/dist/commands/claude/org/api-keys.js.map +1 -1
  128. package/dist/commands/claude/org/helpers.d.ts +54 -1
  129. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  130. package/dist/commands/claude/org/helpers.js +42 -7
  131. package/dist/commands/claude/org/helpers.js.map +1 -1
  132. package/dist/commands/claude/org/index.d.ts.map +1 -1
  133. package/dist/commands/claude/org/index.js +24 -16
  134. package/dist/commands/claude/org/index.js.map +1 -1
  135. package/dist/commands/claude/org/invites.d.ts +0 -3
  136. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  137. package/dist/commands/claude/org/invites.js +3 -2
  138. package/dist/commands/claude/org/invites.js.map +1 -1
  139. package/dist/commands/claude/org/skills.d.ts +527 -0
  140. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  141. package/dist/commands/claude/org/skills.js +1414 -108
  142. package/dist/commands/claude/org/skills.js.map +1 -1
  143. package/dist/commands/claude/org/users.d.ts +0 -3
  144. package/dist/commands/claude/org/users.d.ts.map +1 -1
  145. package/dist/commands/claude/org/users.js +6 -3
  146. package/dist/commands/claude/org/users.js.map +1 -1
  147. package/dist/commands/claude/org/workspaces.d.ts +0 -3
  148. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  149. package/dist/commands/claude/org/workspaces.js +11 -7
  150. package/dist/commands/claude/org/workspaces.js.map +1 -1
  151. package/dist/commands/claude/plugin/build.d.ts +41 -3
  152. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  153. package/dist/commands/claude/plugin/build.js +147 -80
  154. package/dist/commands/claude/plugin/build.js.map +1 -1
  155. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  156. package/dist/commands/claude/plugin/helpers.js +2 -7
  157. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  158. package/dist/commands/claude/plugin/install.d.ts +12 -0
  159. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  160. package/dist/commands/claude/plugin/install.js +93 -62
  161. package/dist/commands/claude/plugin/install.js.map +1 -1
  162. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  163. package/dist/commands/claude/plugin/list.js +3 -2
  164. package/dist/commands/claude/plugin/list.js.map +1 -1
  165. package/dist/commands/claude/plugin/marketplace-json.d.ts +24 -9
  166. package/dist/commands/claude/plugin/marketplace-json.d.ts.map +1 -1
  167. package/dist/commands/claude/plugin/marketplace-json.js +10 -9
  168. package/dist/commands/claude/plugin/marketplace-json.js.map +1 -1
  169. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  170. package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
  171. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  172. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  173. package/dist/commands/claude/plugin/plugin-files.js +3 -6
  174. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  175. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  176. package/dist/commands/claude/plugin/plugin-validators.js +3 -6
  177. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  178. package/dist/commands/claude/plugin/tree-copy.d.ts +73 -0
  179. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  180. package/dist/commands/claude/plugin/tree-copy.js +221 -14
  181. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  182. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  183. package/dist/commands/claude/plugin/uninstall.js +4 -4
  184. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  185. package/dist/commands/consistency-check.d.ts +17 -15
  186. package/dist/commands/consistency-check.d.ts.map +1 -1
  187. package/dist/commands/consistency-check.js +152 -106
  188. package/dist/commands/consistency-check.js.map +1 -1
  189. package/dist/commands/corpus/index.d.ts.map +1 -1
  190. package/dist/commands/corpus/index.js +3 -0
  191. package/dist/commands/corpus/index.js.map +1 -1
  192. package/dist/commands/corpus/report.d.ts +1 -2
  193. package/dist/commands/corpus/report.d.ts.map +1 -1
  194. package/dist/commands/corpus/report.js +1 -3
  195. package/dist/commands/corpus/report.js.map +1 -1
  196. package/dist/commands/corpus/runner.d.ts +58 -1
  197. package/dist/commands/corpus/runner.d.ts.map +1 -1
  198. package/dist/commands/corpus/runner.js +95 -41
  199. package/dist/commands/corpus/runner.js.map +1 -1
  200. package/dist/commands/corpus/scan.d.ts.map +1 -1
  201. package/dist/commands/corpus/scan.js +20 -12
  202. package/dist/commands/corpus/scan.js.map +1 -1
  203. package/dist/commands/corpus/seed.d.ts +4 -4
  204. package/dist/commands/corpus/seed.d.ts.map +1 -1
  205. package/dist/commands/corpus/seed.js +1 -3
  206. package/dist/commands/corpus/seed.js.map +1 -1
  207. package/dist/commands/doctor.d.ts +50 -0
  208. package/dist/commands/doctor.d.ts.map +1 -1
  209. package/dist/commands/doctor.js +245 -52
  210. package/dist/commands/doctor.js.map +1 -1
  211. package/dist/commands/inventory.d.ts +13 -1
  212. package/dist/commands/inventory.d.ts.map +1 -1
  213. package/dist/commands/inventory.js +121 -17
  214. package/dist/commands/inventory.js.map +1 -1
  215. package/dist/commands/mcp/collections.d.ts +1 -1
  216. package/dist/commands/mcp/collections.d.ts.map +1 -1
  217. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  218. package/dist/commands/mcp/list-collections.js +2 -1
  219. package/dist/commands/mcp/list-collections.js.map +1 -1
  220. package/dist/commands/mcp/serve.d.ts.map +1 -1
  221. package/dist/commands/mcp/serve.js +3 -2
  222. package/dist/commands/mcp/serve.js.map +1 -1
  223. package/dist/commands/okf/index.d.ts +11 -0
  224. package/dist/commands/okf/index.d.ts.map +1 -0
  225. package/dist/commands/okf/index.js +116 -0
  226. package/dist/commands/okf/index.js.map +1 -0
  227. package/dist/commands/okf/validate.d.ts +195 -0
  228. package/dist/commands/okf/validate.d.ts.map +1 -0
  229. package/dist/commands/okf/validate.js +199 -0
  230. package/dist/commands/okf/validate.js.map +1 -0
  231. package/dist/commands/phase-utils.d.ts +182 -114
  232. package/dist/commands/phase-utils.d.ts.map +1 -1
  233. package/dist/commands/phase-utils.js +154 -163
  234. package/dist/commands/phase-utils.js.map +1 -1
  235. package/dist/commands/positional-args.d.ts.map +1 -1
  236. package/dist/commands/positional-args.js +3 -2
  237. package/dist/commands/positional-args.js.map +1 -1
  238. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  239. package/dist/commands/rag/clear-command.js +2 -1
  240. package/dist/commands/rag/clear-command.js.map +1 -1
  241. package/dist/commands/rag/index-command.d.ts +64 -0
  242. package/dist/commands/rag/index-command.d.ts.map +1 -1
  243. package/dist/commands/rag/index-command.js +72 -6
  244. package/dist/commands/rag/index-command.js.map +1 -1
  245. package/dist/commands/rag/index.d.ts.map +1 -1
  246. package/dist/commands/rag/index.js +23 -10
  247. package/dist/commands/rag/index.js.map +1 -1
  248. package/dist/commands/rag/query-command.d.ts.map +1 -1
  249. package/dist/commands/rag/query-command.js +2 -1
  250. package/dist/commands/rag/query-command.js.map +1 -1
  251. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  252. package/dist/commands/rag/stats-command.js +2 -1
  253. package/dist/commands/rag/stats-command.js.map +1 -1
  254. package/dist/commands/resources/builtin-help.d.ts +27 -0
  255. package/dist/commands/resources/builtin-help.d.ts.map +1 -0
  256. package/dist/commands/resources/builtin-help.js +46 -0
  257. package/dist/commands/resources/builtin-help.js.map +1 -0
  258. package/dist/commands/resources/check-progress.d.ts +167 -0
  259. package/dist/commands/resources/check-progress.d.ts.map +1 -0
  260. package/dist/commands/resources/check-progress.js +250 -0
  261. package/dist/commands/resources/check-progress.js.map +1 -0
  262. package/dist/commands/resources/check-supervisor.d.ts +479 -0
  263. package/dist/commands/resources/check-supervisor.d.ts.map +1 -0
  264. package/dist/commands/resources/check-supervisor.js +587 -0
  265. package/dist/commands/resources/check-supervisor.js.map +1 -0
  266. package/dist/commands/resources/check.d.ts +620 -0
  267. package/dist/commands/resources/check.d.ts.map +1 -0
  268. package/dist/commands/resources/check.js +1452 -0
  269. package/dist/commands/resources/check.js.map +1 -0
  270. package/dist/commands/resources/index.d.ts.map +1 -1
  271. package/dist/commands/resources/index.js +430 -4
  272. package/dist/commands/resources/index.js.map +1 -1
  273. package/dist/commands/resources/query.d.ts +106 -0
  274. package/dist/commands/resources/query.d.ts.map +1 -0
  275. package/dist/commands/resources/query.js +177 -0
  276. package/dist/commands/resources/query.js.map +1 -0
  277. package/dist/commands/resources/scan.d.ts +24 -0
  278. package/dist/commands/resources/scan.d.ts.map +1 -1
  279. package/dist/commands/resources/scan.js +17 -8
  280. package/dist/commands/resources/scan.js.map +1 -1
  281. package/dist/commands/resources/validate.d.ts +42 -2
  282. package/dist/commands/resources/validate.d.ts.map +1 -1
  283. package/dist/commands/resources/validate.js +208 -55
  284. package/dist/commands/resources/validate.js.map +1 -1
  285. package/dist/commands/skill/review-checklist.d.ts +3 -2
  286. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  287. package/dist/commands/skill/review-checklist.js +40 -2
  288. package/dist/commands/skill/review-checklist.js.map +1 -1
  289. package/dist/commands/skill/review.d.ts +247 -0
  290. package/dist/commands/skill/review.d.ts.map +1 -1
  291. package/dist/commands/skill/review.js +100 -62
  292. package/dist/commands/skill/review.js.map +1 -1
  293. package/dist/commands/skill/test/configure.d.ts +56 -0
  294. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  295. package/dist/commands/skill/test/configure.js +75 -16
  296. package/dist/commands/skill/test/configure.js.map +1 -1
  297. package/dist/commands/skill/test/run.d.ts +63 -10
  298. package/dist/commands/skill/test/run.d.ts.map +1 -1
  299. package/dist/commands/skill/test/run.js +258 -77
  300. package/dist/commands/skill/test/run.js.map +1 -1
  301. package/dist/commands/skills/build.d.ts +94 -4
  302. package/dist/commands/skills/build.d.ts.map +1 -1
  303. package/dist/commands/skills/build.js +325 -97
  304. package/dist/commands/skills/build.js.map +1 -1
  305. package/dist/commands/skills/install.d.ts +2 -1
  306. package/dist/commands/skills/install.d.ts.map +1 -1
  307. package/dist/commands/skills/install.js +20 -31
  308. package/dist/commands/skills/install.js.map +1 -1
  309. package/dist/commands/skills/list.d.ts +2 -1
  310. package/dist/commands/skills/list.d.ts.map +1 -1
  311. package/dist/commands/skills/list.js +44 -26
  312. package/dist/commands/skills/list.js.map +1 -1
  313. package/dist/commands/skills/package.d.ts +1 -1
  314. package/dist/commands/skills/package.d.ts.map +1 -1
  315. package/dist/commands/skills/package.js +6 -8
  316. package/dist/commands/skills/package.js.map +1 -1
  317. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  318. package/dist/commands/skills/scope-guard.js +8 -6
  319. package/dist/commands/skills/scope-guard.js.map +1 -1
  320. package/dist/commands/skills/shared.d.ts.map +1 -1
  321. package/dist/commands/skills/shared.js +2 -4
  322. package/dist/commands/skills/shared.js.map +1 -1
  323. package/dist/commands/skills/skill-discovery.d.ts +47 -6
  324. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  325. package/dist/commands/skills/skill-discovery.js +61 -11
  326. package/dist/commands/skills/skill-discovery.js.map +1 -1
  327. package/dist/commands/skills/source-resolvers.d.ts +15 -0
  328. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  329. package/dist/commands/skills/source-resolvers.js +25 -4
  330. package/dist/commands/skills/source-resolvers.js.map +1 -1
  331. package/dist/commands/skills/validate-command.d.ts.map +1 -1
  332. package/dist/commands/skills/validate-command.js +11 -3
  333. package/dist/commands/skills/validate-command.js.map +1 -1
  334. package/dist/commands/skills/validate.d.ts +140 -4
  335. package/dist/commands/skills/validate.d.ts.map +1 -1
  336. package/dist/commands/skills/validate.js +224 -67
  337. package/dist/commands/skills/validate.js.map +1 -1
  338. package/dist/commands/validate.d.ts +1 -1
  339. package/dist/commands/validate.d.ts.map +1 -1
  340. package/dist/commands/validate.js +63 -27
  341. package/dist/commands/validate.js.map +1 -1
  342. package/dist/commands/verify.d.ts +119 -15
  343. package/dist/commands/verify.d.ts.map +1 -1
  344. package/dist/commands/verify.js +357 -142
  345. package/dist/commands/verify.js.map +1 -1
  346. package/dist/index.d.ts +0 -1
  347. package/dist/index.d.ts.map +1 -1
  348. package/dist/index.js +5 -1
  349. package/dist/index.js.map +1 -1
  350. package/dist/report-schemas.d.ts +45 -0
  351. package/dist/report-schemas.d.ts.map +1 -0
  352. package/dist/report-schemas.js +100 -0
  353. package/dist/report-schemas.js.map +1 -0
  354. package/dist/skill-resolution/classify.js +2 -2
  355. package/dist/skill-resolution/classify.js.map +1 -1
  356. package/dist/skill-resolution/packaging-config.d.ts +49 -5
  357. package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
  358. package/dist/skill-resolution/packaging-config.js +59 -19
  359. package/dist/skill-resolution/packaging-config.js.map +1 -1
  360. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  361. package/dist/skill-resolution/resolve-skill-reference.js +55 -57
  362. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  363. package/dist/utils/agent-discovery.d.ts.map +1 -1
  364. package/dist/utils/agent-discovery.js +22 -11
  365. package/dist/utils/agent-discovery.js.map +1 -1
  366. package/dist/utils/agent-runner.d.ts.map +1 -1
  367. package/dist/utils/agent-runner.js +7 -4
  368. package/dist/utils/agent-runner.js.map +1 -1
  369. package/dist/utils/claude-context-lens.d.ts +34 -0
  370. package/dist/utils/claude-context-lens.d.ts.map +1 -0
  371. package/dist/utils/claude-context-lens.js +39 -0
  372. package/dist/utils/claude-context-lens.js.map +1 -0
  373. package/dist/utils/command-error.d.ts +143 -20
  374. package/dist/utils/command-error.d.ts.map +1 -1
  375. package/dist/utils/command-error.js +179 -36
  376. package/dist/utils/command-error.js.map +1 -1
  377. package/dist/utils/config-loader.d.ts +2 -1
  378. package/dist/utils/config-loader.d.ts.map +1 -1
  379. package/dist/utils/config-loader.js +40 -14
  380. package/dist/utils/config-loader.js.map +1 -1
  381. package/dist/utils/corpus-target.d.ts +26 -0
  382. package/dist/utils/corpus-target.d.ts.map +1 -0
  383. package/dist/utils/corpus-target.js +72 -0
  384. package/dist/utils/corpus-target.js.map +1 -0
  385. package/dist/utils/edge-lens-evaluation.d.ts +83 -0
  386. package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
  387. package/dist/utils/edge-lens-evaluation.js +110 -0
  388. package/dist/utils/edge-lens-evaluation.js.map +1 -0
  389. package/dist/utils/help-loader.d.ts.map +1 -1
  390. package/dist/utils/help-loader.js +0 -1
  391. package/dist/utils/help-loader.js.map +1 -1
  392. package/dist/utils/issue-anchor.d.ts +2 -2
  393. package/dist/utils/issue-anchor.d.ts.map +1 -1
  394. package/dist/utils/issue-anchor.js +1 -1
  395. package/dist/utils/issue-rendering.d.ts +3 -3
  396. package/dist/utils/issue-rendering.d.ts.map +1 -1
  397. package/dist/utils/issue-rendering.js +3 -3
  398. package/dist/utils/issue-rendering.js.map +1 -1
  399. package/dist/utils/issue-severity.d.ts +12 -5
  400. package/dist/utils/issue-severity.d.ts.map +1 -1
  401. package/dist/utils/issue-severity.js +1 -1
  402. package/dist/utils/issue-severity.js.map +1 -1
  403. package/dist/utils/optional-backend.d.ts +78 -0
  404. package/dist/utils/optional-backend.d.ts.map +1 -0
  405. package/dist/utils/optional-backend.js +117 -0
  406. package/dist/utils/optional-backend.js.map +1 -0
  407. package/dist/utils/output.d.ts +26 -0
  408. package/dist/utils/output.d.ts.map +1 -1
  409. package/dist/utils/output.js +35 -0
  410. package/dist/utils/output.js.map +1 -1
  411. package/dist/utils/package-json.d.ts +24 -0
  412. package/dist/utils/package-json.d.ts.map +1 -0
  413. package/dist/utils/package-json.js +49 -0
  414. package/dist/utils/package-json.js.map +1 -0
  415. package/dist/utils/population-wiring.d.ts +100 -0
  416. package/dist/utils/population-wiring.d.ts.map +1 -0
  417. package/dist/utils/population-wiring.js +98 -0
  418. package/dist/utils/population-wiring.js.map +1 -0
  419. package/dist/utils/project-root-policy.d.ts +20 -0
  420. package/dist/utils/project-root-policy.d.ts.map +1 -1
  421. package/dist/utils/project-root-policy.js +30 -0
  422. package/dist/utils/project-root-policy.js.map +1 -1
  423. package/dist/utils/projection-lenses.d.ts +98 -0
  424. package/dist/utils/projection-lenses.d.ts.map +1 -0
  425. package/dist/utils/projection-lenses.js +203 -0
  426. package/dist/utils/projection-lenses.js.map +1 -0
  427. package/dist/utils/projection-query.d.ts +324 -0
  428. package/dist/utils/projection-query.d.ts.map +1 -0
  429. package/dist/utils/projection-query.js +357 -0
  430. package/dist/utils/projection-query.js.map +1 -0
  431. package/dist/utils/projection-store.d.ts +335 -0
  432. package/dist/utils/projection-store.d.ts.map +1 -0
  433. package/dist/utils/projection-store.js +522 -0
  434. package/dist/utils/projection-store.js.map +1 -0
  435. package/dist/utils/relation-limits.d.ts +50 -0
  436. package/dist/utils/relation-limits.d.ts.map +1 -0
  437. package/dist/utils/relation-limits.js +50 -0
  438. package/dist/utils/relation-limits.js.map +1 -0
  439. package/dist/utils/repeatable-option.d.ts +37 -0
  440. package/dist/utils/repeatable-option.d.ts.map +1 -0
  441. package/dist/utils/repeatable-option.js +39 -0
  442. package/dist/utils/repeatable-option.js.map +1 -0
  443. package/dist/utils/resource-loader.d.ts +134 -2
  444. package/dist/utils/resource-loader.d.ts.map +1 -1
  445. package/dist/utils/resource-loader.js +290 -27
  446. package/dist/utils/resource-loader.js.map +1 -1
  447. package/dist/utils/root-argv.d.ts +53 -0
  448. package/dist/utils/root-argv.d.ts.map +1 -0
  449. package/dist/utils/root-argv.js +215 -0
  450. package/dist/utils/root-argv.js.map +1 -0
  451. package/dist/utils/run-integrity.d.ts +95 -0
  452. package/dist/utils/run-integrity.d.ts.map +1 -0
  453. package/dist/utils/run-integrity.js +102 -0
  454. package/dist/utils/run-integrity.js.map +1 -0
  455. package/dist/utils/skill-discovery.d.ts.map +1 -1
  456. package/dist/utils/skill-discovery.js +2 -1
  457. package/dist/utils/skill-discovery.js.map +1 -1
  458. package/dist/utils/skill-packaging-config.d.ts +63 -1
  459. package/dist/utils/skill-packaging-config.d.ts.map +1 -1
  460. package/dist/utils/skill-packaging-config.js +56 -1
  461. package/dist/utils/skill-packaging-config.js.map +1 -1
  462. package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
  463. package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
  464. package/dist/utils/sqlite-experimental-warning.js +144 -0
  465. package/dist/utils/sqlite-experimental-warning.js.map +1 -0
  466. package/dist/utils/url-redact.d.ts.map +1 -1
  467. package/dist/utils/url-redact.js +4 -6
  468. package/dist/utils/url-redact.js.map +1 -1
  469. package/dist/utils/user-context-scanner.d.ts +8 -0
  470. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  471. package/dist/utils/user-context-scanner.js +4 -2
  472. package/dist/utils/user-context-scanner.js.map +1 -1
  473. package/dist/utils/validate-help-files.d.ts.map +1 -1
  474. package/dist/utils/validate-help-files.js +12 -6
  475. package/dist/utils/validate-help-files.js.map +1 -1
  476. package/dist/utils/vat-bin-path.d.ts +36 -0
  477. package/dist/utils/vat-bin-path.d.ts.map +1 -0
  478. package/dist/utils/vat-bin-path.js +48 -0
  479. package/dist/utils/vat-bin-path.js.map +1 -0
  480. package/dist/utils/verdict-helpers.d.ts +1 -1
  481. package/dist/utils/verdict-helpers.d.ts.map +1 -1
  482. package/dist/utils/verdict-helpers.js +1 -1
  483. package/dist/utils/verdict-helpers.js.map +1 -1
  484. package/dist/version.d.ts.map +1 -1
  485. package/dist/version.js +1 -3
  486. package/dist/version.js.map +1 -1
  487. package/docs/agent.md +2 -2
  488. package/docs/audit.md +143 -39
  489. package/docs/doctor.md +7 -6
  490. package/docs/index.md +19 -11
  491. package/docs/mcp.md +2 -2
  492. package/docs/rag.md +3 -2
  493. package/docs/resources.md +13 -3
  494. package/docs/skill-test.md +10 -9
  495. package/docs/skills.md +53 -69
  496. package/package.json +36 -27
  497. package/schemas/ard-emit.json +152 -0
  498. package/schemas/okf-validate.json +170 -0
  499. package/schemas/resources-check.json +257 -0
  500. package/schemas/skill-review.json +230 -0
  501. package/dist/commands/resources/command-helpers.d.ts +0 -5
  502. package/dist/commands/resources/command-helpers.d.ts.map +0 -1
  503. package/dist/commands/resources/command-helpers.js +0 -6
  504. package/dist/commands/resources/command-helpers.js.map +0 -1
@@ -1,12 +1,54 @@
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/agent-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
+ /**
8
+ * What one phase produced: the document it publishes, and the exit code it
9
+ * claims for itself.
10
+ *
11
+ * This pair is the whole of what an orchestrator needs from a phase: an exit
12
+ * code, and the document the phase publishes. Naming it as a value is what lets
13
+ * a phase run in the orchestrator's own process — stderr streams directly either
14
+ * way, so nothing else has to cross.
15
+ *
16
+ * `document` is the object the phase PRINTS, not the internal summary it is
17
+ * built from. The distinction is load-bearing: `vat skills build` renders its
18
+ * summary in two pieces and publishes `skillsWithErrors` as a COUNT while the
19
+ * summary object holds an ARRAY under that name.
20
+ *
21
+ * ⚠️ This field is `unknown`, so nothing typechecks it. Handing back the summary
22
+ * object instead of the printed document changes the emitted contract silently.
23
+ */
24
+ export interface PhaseOutcome {
25
+ document: unknown;
26
+ exitCode: ExitCodeValue;
27
+ /**
28
+ * The phase failed UNEXPECTEDLY, so `document` is the shared error envelope
29
+ * (`{status, error, duration}`) rather than the command's own report.
30
+ *
31
+ * The orchestrated lane does not need this — it folds any document under
32
+ * `phases[].report` the same way. The command-line lane does: each command
33
+ * renders its own report with its own renderer (streamed YAML, `--format
34
+ * json`, a hand-built header), and none of those renderers understand an
35
+ * envelope. Handing one to them silently changes both the channel and the
36
+ * shape of the failure document every `vat … | jq` consumer depends on.
37
+ */
38
+ failed?: boolean;
39
+ }
40
+ /**
41
+ * One orchestrated phase: a name, and the work to run for it.
42
+ *
43
+ * `run` is a bound closure rather than an argv array because the phase executes
44
+ * in this process. An argv array would mean re-entering Commander to
45
+ * parse arguments this process has already parsed — a second, weaker copy of the
46
+ * orchestrator's own options, and the exact seam through which `vat validate`'s
47
+ * `--verbose` could be forwarded to one phase and dropped by another.
48
+ */
7
49
  export interface Phase {
8
50
  name: string;
9
- args: string[];
51
+ run: () => Promise<PhaseOutcome>;
10
52
  }
11
53
  /**
12
54
  * Declare `--only` on a command that has RETIRED it, solely so the command can
@@ -44,16 +86,18 @@ export declare function rejectRetiredOnly(only: string | undefined, command: str
44
86
  * Outcome of one orchestrated phase.
45
87
  *
46
88
  * `system-error` is a value of its own because **a phase that could not RUN is
47
- * not a phase that found problems.** Collapsing it into `error` (which is what
48
- * `result.status === 0 ? 'passed' : 'failed'` did) made the documented exit
49
- * code 2 unreachable from every orchestrator, so a CI script could not tell an
50
- * invalid config or a killed child from a broken link.
51
- *
52
- * `warning` reaches a subprocess phase through the child's own reported
53
- * `status`, NOT through its exit code — `vat skills validate` exits 0 while
54
- * reporting `status: warning`, so an exit-code-only mapping answered `success`
55
- * on the very tree where the child said otherwise. In-process phases (e.g.
56
- * verify's consistency check) emit it directly.
89
+ * not a phase that found problems.**
90
+ *
91
+ * ⚠️ Any two-valued mapping — `status === 0 ? 'passed' : 'failed'` and its
92
+ * relatives — collapses it into `error` and makes the documented exit code 2
93
+ * unreachable from every orchestrator, leaving a CI script unable to tell an
94
+ * invalid config from a broken link.
95
+ *
96
+ * `warning` reaches a phase through its own reported `status`, NOT through its
97
+ * exit code — `vat skills validate` exits 0 while reporting `status: warning`,
98
+ * so an exit-code-only mapping answered `success` on the very tree where the
99
+ * phase said otherwise. Phases that hold their own findings (e.g. verify's
100
+ * consistency check) emit it directly.
57
101
  */
58
102
  export type PhaseStatus = 'success' | 'warning' | 'error' | 'system-error';
59
103
  /** The phase outcome for "we did not learn what this phase would have said". */
@@ -61,58 +105,44 @@ export declare const SYSTEM_ERROR: PhaseStatus;
61
105
  export interface PhaseResult {
62
106
  name: string;
63
107
  status: PhaseStatus;
64
- /** Child exit code, when the child ran and exited on its own. */
65
- exitCode?: number;
66
- /** POSIX signal that killed the child, when one did (then `exitCode` is absent). */
67
- signal?: string;
68
- /** Why the phase could not run at all (the spawn itself failed). */
108
+ /** The exit code the phase claimed for itself. */
109
+ exitCode?: ExitCodeValue;
110
+ /** Why the phase could not run at all (it threw past its own error handling). */
69
111
  error?: string;
70
112
  /**
71
- * Per-severity distribution for in-process phases that hold their own
72
- * findings. Absent for subprocess phases: the child owns its own findings,
73
- * and inventing counts here would be a second, weaker answer — the child's
74
- * are carried verbatim in {@link PhaseResult.report} instead.
113
+ * Per-severity distribution for phases that hold their own findings and
114
+ * publish no document of their own. Absent for phases that DO publish one:
115
+ * those own their findings, and inventing counts here would be a second,
116
+ * weaker answer — theirs are carried verbatim in {@link PhaseResult.report}.
75
117
  */
76
118
  issueCounts?: SeverityCounts;
77
119
  /**
78
- * The child's own YAML document, parsed and folded in.
120
+ * The phase's own document, folded in under its name.
121
+ *
122
+ * Nested under the phase's own entry so the orchestrator's stdout stays ONE
123
+ * parseable document.
79
124
  *
80
- * The child used to write this straight onto the parent's stdout (`stdio:
81
- * 'inherit'`), which concatenated N documents with no `---` between them: two
82
- * phases produced one map carrying `status:` and `durationSecs:` twice, and
83
- * `YAML.parse()` threw "Map keys must be unique". Nesting each child's
84
- * document under its own phase makes the parent's stdout one parseable
85
- * document again and loses nothing.
125
+ * ⚠️ Phase documents written onto a shared stdout concatenate with no `---`
126
+ * between them: two phases each carrying `status:` and `durationSecs:` become
127
+ * a single map with duplicate keys, and `YAML.parse()` throws "Map keys must
128
+ * be unique".
86
129
  */
87
130
  report?: unknown;
88
131
  }
89
- /** The subset of a `spawnSync` return that decides a phase's outcome. */
90
- export interface PhaseSpawnOutcome {
91
- status: number | null;
92
- signal: NodeJS.Signals | null;
93
- error?: Error | undefined;
94
- /** The child's captured stdout, when it was piped rather than inherited. */
95
- stdout?: string | null | undefined;
96
- }
97
- /**
98
- * Resolve the absolute path to the vat binary.
99
- * This file lives in commands/, one level above bin/.
100
- */
101
- export declare function resolveBinPath(): string;
102
132
  export interface PhaseContext {
103
133
  logger: ReturnType<typeof createLogger>;
104
134
  startTime: number;
105
- binPath: string;
106
135
  }
107
136
  /**
108
137
  * Create the shared phase command context: logger, startTime, and bin path.
109
138
  *
110
- * It used to THROW when the phase list came out empty — and it was called
111
- * before the command's try block, so an unroutable `--only` reached the user as
112
- * a raw Node stack trace with zero bytes of stdout and an exit 1 that looked
113
- * like "validation errors". `--only` routing is decided by
114
- * {@link decidePhaseSelection} and reported by {@link applyPhaseSelection} now,
115
- * which emit the command's normal structured document.
139
+ * Total by design: it builds the context and decides nothing.
140
+ *
141
+ * ⚠️ This runs BEFORE the command's try block, so anything that throws here
142
+ * reaches the user as a raw Node stack trace with zero bytes of stdout and an
143
+ * exit 1 indistinguishable from "validation errors". Phase routing therefore
144
+ * belongs to {@link decidePhaseSelection} and {@link applyPhaseSelection}, which
145
+ * emit the command's normal structured document.
116
146
  */
117
147
  export declare function createPhaseContext(debugFlag: boolean | undefined): PhaseContext;
118
148
  /**
@@ -156,30 +186,26 @@ export interface PhaseVocabulary {
156
186
  * Decide what an orchestrator should do with its `--only` value and the phase
157
187
  * list its config produced.
158
188
  *
159
- * Shared by all three orchestrators because they used to disagree: `vat verify`
160
- * built its phase list without consulting the config at all, so `vat verify
161
- * --only skills` in a project with no `skills:` block exited 0 while `vat
162
- * validate --only skills` on the same project exited 1 — opposite verdicts on
163
- * the same question. (`vat verify` has since retired `--only` entirely and now
164
- * always passes `only: undefined`; `vat validate` and `vat build` still route
165
- * their own `--only` through here.)
166
- *
167
- * There used to be a third option, `emptyIsValid`, which existed solely so
168
- * `vat verify --only consistency` could run with an empty SUBPROCESS list
169
- * (consistency runs in-process). It was checked BEFORE `unreadableConfig`, so
170
- * `vat verify --only consistency` against an unparseable config answered the
171
- * confidently-wrong "no skills: block" instead of reporting the config error.
172
- * `--only` is gone from verify, `emptyIsValid` went with it, and that ordering
173
- * hazard cannot recur: nothing short-circuits ahead of the config-error arm.
189
+ * THE single decision site for all three orchestrators, so they cannot answer
190
+ * the same question differently. An orchestrator that builds its phase list
191
+ * without consulting the config exits 0 on `--only skills` in a project with no
192
+ * `skills:` block while another exits 1 — opposite verdicts on one question.
193
+ * `vat verify` has retired `--only` and always passes `only: undefined`;
194
+ * `vat validate` and `vat build` route their own `--only` through here.
195
+ *
196
+ * ⚠️ **Nothing may short-circuit ahead of the config-error arm.** A check
197
+ * evaluated before `unreadableConfig` answers a confident "not configured" for a
198
+ * tree whose config could not be parsed — which is the one answer this function
199
+ * must never give, because it is indistinguishable from a correct one.
174
200
  *
175
201
  * @param unreadableConfig - The config-load error, when the config exists but
176
202
  * could not be parsed. A broken config is NOT "the phase is unconfigured":
177
203
  * we do not know what it declares, so we must not answer with a confident
178
204
  * "not configured". Only `vat verify` passes it, and only defensively — its
179
- * phase builder pushes every subprocess phase when the config is unreadable
180
- * (so the CHILD reports the real error), which makes the list non-empty and
181
- * this arm unreachable by construction today. It is kept because the arm that
182
- * would otherwise catch an empty list is the "not configured" lie.
205
+ * phase builder pushes every configured phase when the config is unreadable
206
+ * (so the phase itself reports the real error), which makes the list non-empty
207
+ * and this arm unreachable by construction today. It is kept because the arm
208
+ * that would otherwise catch an empty list is the "not configured" lie.
183
209
  */
184
210
  export declare function decidePhaseSelection(only: string | undefined, phases: Phase[], vocab: PhaseVocabulary, options?: {
185
211
  unreadableConfig?: string | undefined;
@@ -188,46 +214,88 @@ export declare function decidePhaseSelection(only: string | undefined, phases: P
188
214
  * Act on a {@link PhaseSelection}: return the phases to run, or emit the
189
215
  * command's normal structured document and exit.
190
216
  *
191
- * Both terminal arms go through `writeYamlOutput` deliberately. A `--only`
192
- * failure used to be an uncaught throw, so the one output a scripted caller
193
- * parses — the YAML document on stdout — was never written at all.
217
+ * Both terminal arms go through `writeYamlOutput` deliberately: the YAML
218
+ * document on stdout is the one output a scripted caller parses, so a routing
219
+ * failure has to publish one rather than throw past it.
194
220
  */
195
221
  export declare function applyPhaseSelection(selection: PhaseSelection, logger: ReturnType<typeof createLogger>, startTime: number): Phase[];
196
222
  /** The worse of two phase statuses, per {@link PHASE_STATUS_ORDER}. */
197
223
  export declare function worseOf(a: PhaseStatus, b: PhaseStatus): PhaseStatus;
198
224
  /**
199
- * Map a spawn outcome to a phase outcome. The pure core of {@link runPhase}.
200
- *
201
- * Every branch that is NOT "the child ran and told us what it found" is a
202
- * system error, because the orchestrator learned nothing about the artifact:
203
- *
204
- * | spawn outcome | phase status | why |
205
- * |--------------------------|----------------|--------------------------------------------|
206
- * | `error` set | `system-error` | the child never ran |
207
- * | killed by a signal | `system-error` | the child was cut off mid-answer |
208
- * | no exit code, no signal | `system-error` | there is no answer to read |
209
- * | stdout not parseable | `system-error` | the child's answer cannot be read |
210
- * | exit 0 | `success` | ran, found nothing actionable |
211
- * | exit 1 | `error` | ran, found validation errors |
212
- * | exit 2 (or any other) | `system-error` | the child itself reported a system error |
213
- *
214
- * The exit code is then reconciled with the child's OWN reported `status`,
215
- * worst-wins. An exit code has three values and cannot express `warning`, so
216
- * `vat skills validate` — which exits 0 while reporting `status: warning` —
217
- * was being recorded as `success` by every orchestrator, including the one
218
- * VAT's CI dogfoods on VAT itself.
225
+ * Map what a phase produced to its outcome. The pure core of {@link runPhase}.
226
+ *
227
+ * | exit code | phase status | why |
228
+ * |-----------------------|----------------|-----------------------------------------|
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` |
233
+ *
234
+ * The exit code is then reconciled with the phase's OWN reported `status`,
235
+ * worst-wins. An exit code has three values and cannot express `warning`:
236
+ * `vat skills validate` exits 0 while reporting `status: warning`, so its exit
237
+ * code alone reads as `success` — including on the tree VAT's CI dogfoods on
238
+ * VAT itself.
239
+ *
240
+ * The table has no row for a signal kill, a missing status code, or a document
241
+ * that fails to parse, and that is the design rather than an omission. A phase
242
+ * runs in this process: there is no serialization step in which to lose a
243
+ * document, and no signal that could take a phase without taking the
244
+ * orchestrator with it.
245
+ */
246
+ export declare function phaseResultFromOutcome(name: string, outcome: PhaseOutcome): PhaseResult;
247
+ /**
248
+ * End a command-line run from a phase outcome: publish the document, then exit.
249
+ *
250
+ * THE single place the two lanes diverge, so they cannot diverge anywhere else.
251
+ * A phase hands back the same `{ document, exitCode }` either way; this decides
252
+ * what a *command* does with it, while an orchestrator folds it into
253
+ * `phases[].report` instead.
254
+ *
255
+ * Three cases, and the middle one is the one to get right:
256
+ * - an unexpected failure publishes the shared envelope in the format the
257
+ * operator asked for, matching `handleCommandError`;
258
+ * - a command's own report goes through the command's own `render`;
259
+ * - no document at all (an unconfigured run, a dry run) publishes nothing.
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
+ *
274
+ * @param outcome - What the phase produced
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
219
279
  */
220
- export declare function phaseResultFromSpawn(name: string, outcome: PhaseSpawnOutcome): PhaseResult;
280
+ export declare function finishCommand(outcome: PhaseOutcome, render: (document: unknown) => void, format: string | undefined): never;
221
281
  /**
222
- * Run a single phase by spawning the vat binary with the phase args.
282
+ * Run a single phase in THIS process and fold its outcome into a result.
283
+ *
284
+ * In THIS process, because everything an orchestrator reads back from a phase is
285
+ * the {@link PhaseOutcome} pair. A process per phase buys neither half of it and
286
+ * charges, on every phase, a full Node startup and the whole module graph again
287
+ * (~730 ms of remark per isolate), a parse cache whose miss counters restart
288
+ * from zero, and a worker pool built and torn down before the next phase begins.
289
+ * Phases run sequentially, so none of that cost is ever overlapped with work.
223
290
  *
224
- * stdout is CAPTURED, not inherited: the child's YAML document belongs in this
225
- * phase's `report`, and letting it stream onto the parent's stdout is what made
226
- * `vat validate`'s output a run of documents with no `---` between them.
227
- * stderr stays inherited — progress output is on stderr by design and must keep
228
- * streaming live rather than arriving in one lump at the end.
291
+ * The `catch` is a BACKSTOP, not the error path. Every phase function reports
292
+ * its own failures through `reportCommandError` and returns them as a document.
293
+ *
294
+ * ⚠️ This arm exists for a throw that escaped that handling. Sharing the
295
+ * orchestrator's process is what makes it load-bearing: an escaped throw aborts
296
+ * the orchestrator itself and silently skips every later phase.
229
297
  */
230
- export declare function runPhase(binPath: string, phase: Phase): PhaseResult;
298
+ export declare function runPhase(phase: Phase): Promise<PhaseResult>;
231
299
  /**
232
300
  * Worst-wins aggregate across phases. `system-error` outranks `error`: "we could
233
301
  * not determine the answer" must never be filed under "we determined it is bad".
@@ -236,33 +304,33 @@ export declare function aggregatePhaseStatus(results: readonly PhaseResult[]): P
236
304
  /**
237
305
  * One phase's per-severity distribution, wherever that phase keeps it.
238
306
  *
239
- * An in-process phase holds its own findings and publishes {@link
240
- * PhaseResult.issueCounts}. A subprocess phase deliberately does not — the child
241
- * owns its findings, and its document rides verbatim in {@link
242
- * PhaseResult.report}. Reading only the former is why an orchestrator's header
243
- * could report `{0, 0, 0}` over children that had just reported 12 warnings.
307
+ * A phase that holds its own findings publishes {@link PhaseResult.issueCounts}.
308
+ * A phase that publishes its own document deliberately does not — it owns its
309
+ * findings, and its document rides verbatim in {@link PhaseResult.report}.
310
+ *
311
+ * ⚠️ Both places must be read. Reading only `issueCounts` makes an
312
+ * orchestrator's header report `{0, 0, 0}` over phases that just reported 12
313
+ * warnings.
244
314
  *
245
315
  * Absent or malformed counts read as zero rather than throwing: a phase that
246
- * published no distribution contributes nothing to the total, which is the same
247
- * answer as before this function existed — just no longer the answer for phases
248
- * that DID publish one.
316
+ * publishes no distribution contributes nothing to the total.
249
317
  */
250
318
  export declare function phaseIssueCounts(result: PhaseResult): SeverityCounts;
251
319
  /**
252
320
  * Sum every phase's distribution, so an orchestrator's header total reconciles
253
321
  * against the phases printed beneath it.
254
322
  *
255
- * The companion to {@link aggregatePhaseStatus}: status has always been
256
- * worst-wins ACROSS phases, and a header whose `status` can see the children
257
- * while its `issueCounts` cannot is the same contradiction in one document —
258
- * `status: warning` beside `warnings: 0`.
323
+ * The companion to {@link aggregatePhaseStatus}: status is worst-wins ACROSS
324
+ * phases, so a header whose `status` can see the phases while its `issueCounts`
325
+ * cannot publishes a contradiction in one document — `status: warning` beside
326
+ * `warnings: 0`.
259
327
  */
260
328
  export declare function aggregatePhaseIssueCounts(results: readonly PhaseResult[]): SeverityCounts;
261
329
  /**
262
330
  * The process exit code for a set of phase outcomes, per the exit-code contract
263
- * every orchestrator's help text documents: 0 pass, 1 validation failure,
264
- * 2 system error. Warnings do not fail a run — they are published in the status
265
- * 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.
266
334
  */
267
- export declare function exitCodeForPhases(results: readonly PhaseResult[]): 0 | 1 | 2;
335
+ export declare function exitCodeForPhases(results: readonly PhaseResult[]): ExitCodeValue;
268
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;AAIH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;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;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;AAE3E,gFAAgF;AAChF,eAAO,MAAM,YAAY,EAAE,WAA4B,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;I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