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

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 (755) hide show
  1. package/README.md +3 -3
  2. package/dist/bin/supervise-cli.d.ts +45 -0
  3. package/dist/bin/supervise-cli.d.ts.map +1 -0
  4. package/dist/bin/supervise-cli.js +83 -0
  5. package/dist/bin/supervise-cli.js.map +1 -0
  6. package/dist/bin/vat +95 -43
  7. package/dist/bin/vat.d.ts +15 -4
  8. package/dist/bin/vat.d.ts.map +1 -1
  9. package/dist/bin/vat.js +95 -43
  10. package/dist/bin/vat.js.map +1 -1
  11. package/dist/bin.js +21 -29
  12. package/dist/bin.js.map +1 -1
  13. package/dist/command-tree.d.ts +45 -0
  14. package/dist/command-tree.d.ts.map +1 -0
  15. package/dist/command-tree.js +60 -0
  16. package/dist/command-tree.js.map +1 -0
  17. package/dist/commands/agent/build-schema.d.ts +100 -0
  18. package/dist/commands/agent/build-schema.d.ts.map +1 -0
  19. package/dist/commands/agent/build-schema.js +32 -0
  20. package/dist/commands/agent/build-schema.js.map +1 -0
  21. package/dist/commands/agent/build.d.ts +1 -0
  22. package/dist/commands/agent/build.d.ts.map +1 -1
  23. package/dist/commands/agent/build.js +63 -33
  24. package/dist/commands/agent/build.js.map +1 -1
  25. package/dist/commands/agent/import-schema.d.ts +75 -0
  26. package/dist/commands/agent/import-schema.d.ts.map +1 -0
  27. package/dist/commands/agent/import-schema.js +25 -0
  28. package/dist/commands/agent/import-schema.js.map +1 -0
  29. package/dist/commands/agent/import.d.ts.map +1 -1
  30. package/dist/commands/agent/import.js +33 -27
  31. package/dist/commands/agent/import.js.map +1 -1
  32. package/dist/commands/agent/index.d.ts.map +1 -1
  33. package/dist/commands/agent/index.js +132 -37
  34. package/dist/commands/agent/index.js.map +1 -1
  35. package/dist/commands/agent/install-path.d.ts.map +1 -1
  36. package/dist/commands/agent/install-path.js +2 -1
  37. package/dist/commands/agent/install-path.js.map +1 -1
  38. package/dist/commands/agent/install-schema.d.ts +89 -0
  39. package/dist/commands/agent/install-schema.d.ts.map +1 -0
  40. package/dist/commands/agent/install-schema.js +29 -0
  41. package/dist/commands/agent/install-schema.js.map +1 -0
  42. package/dist/commands/agent/install.d.ts +7 -1
  43. package/dist/commands/agent/install.d.ts.map +1 -1
  44. package/dist/commands/agent/install.js +78 -108
  45. package/dist/commands/agent/install.js.map +1 -1
  46. package/dist/commands/agent/installed-schema.d.ts +140 -0
  47. package/dist/commands/agent/installed-schema.d.ts.map +1 -0
  48. package/dist/commands/agent/installed-schema.js +36 -0
  49. package/dist/commands/agent/installed-schema.js.map +1 -0
  50. package/dist/commands/agent/installed.d.ts +1 -1
  51. package/dist/commands/agent/installed.d.ts.map +1 -1
  52. package/dist/commands/agent/installed.js +104 -75
  53. package/dist/commands/agent/installed.js.map +1 -1
  54. package/dist/commands/agent/list-schema.d.ts +128 -0
  55. package/dist/commands/agent/list-schema.d.ts.map +1 -0
  56. package/dist/commands/agent/list-schema.js +34 -0
  57. package/dist/commands/agent/list-schema.js.map +1 -0
  58. package/dist/commands/agent/list.d.ts +4 -3
  59. package/dist/commands/agent/list.d.ts.map +1 -1
  60. package/dist/commands/agent/list.js +50 -37
  61. package/dist/commands/agent/list.js.map +1 -1
  62. package/dist/commands/agent/run.d.ts +3 -0
  63. package/dist/commands/agent/run.d.ts.map +1 -1
  64. package/dist/commands/agent/run.js +8 -3
  65. package/dist/commands/agent/run.js.map +1 -1
  66. package/dist/commands/agent/uninstall-schema.d.ts +89 -0
  67. package/dist/commands/agent/uninstall-schema.d.ts.map +1 -0
  68. package/dist/commands/agent/uninstall-schema.js +29 -0
  69. package/dist/commands/agent/uninstall-schema.js.map +1 -0
  70. package/dist/commands/agent/uninstall.d.ts +5 -1
  71. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  72. package/dist/commands/agent/uninstall.js +50 -38
  73. package/dist/commands/agent/uninstall.js.map +1 -1
  74. package/dist/commands/agent/validate-schema.d.ts +129 -0
  75. package/dist/commands/agent/validate-schema.d.ts.map +1 -0
  76. package/dist/commands/agent/validate-schema.js +35 -0
  77. package/dist/commands/agent/validate-schema.js.map +1 -0
  78. package/dist/commands/agent/validate.d.ts +6 -0
  79. package/dist/commands/agent/validate.d.ts.map +1 -1
  80. package/dist/commands/agent/validate.js +64 -36
  81. package/dist/commands/agent/validate.js.map +1 -1
  82. package/dist/commands/ard/emit-schema.d.ts +108 -0
  83. package/dist/commands/ard/emit-schema.d.ts.map +1 -0
  84. package/dist/commands/ard/emit-schema.js +37 -0
  85. package/dist/commands/ard/emit-schema.js.map +1 -0
  86. package/dist/commands/ard/emit.d.ts +21 -65
  87. package/dist/commands/ard/emit.d.ts.map +1 -1
  88. package/dist/commands/ard/emit.js +68 -74
  89. package/dist/commands/ard/emit.js.map +1 -1
  90. package/dist/commands/ard/index.d.ts.map +1 -1
  91. package/dist/commands/ard/index.js +14 -11
  92. package/dist/commands/ard/index.js.map +1 -1
  93. package/dist/commands/audit/compat-lane-findings.d.ts +65 -0
  94. package/dist/commands/audit/compat-lane-findings.d.ts.map +1 -0
  95. package/dist/commands/audit/compat-lane-findings.js +72 -0
  96. package/dist/commands/audit/compat-lane-findings.js.map +1 -0
  97. package/dist/commands/audit/distributed-tree.d.ts +2 -2
  98. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  99. package/dist/commands/audit/distributed-tree.js +23 -12
  100. package/dist/commands/audit/distributed-tree.js.map +1 -1
  101. package/dist/commands/audit/git-url-clone.d.ts +15 -7
  102. package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
  103. package/dist/commands/audit/git-url-clone.js +85 -42
  104. package/dist/commands/audit/git-url-clone.js.map +1 -1
  105. package/dist/commands/audit/hierarchical-output.d.ts +28 -4
  106. package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
  107. package/dist/commands/audit/hierarchical-output.js +44 -27
  108. package/dist/commands/audit/hierarchical-output.js.map +1 -1
  109. package/dist/commands/audit/scan-population.d.ts.map +1 -1
  110. package/dist/commands/audit/scan-population.js +2 -1
  111. package/dist/commands/audit/scan-population.js.map +1 -1
  112. package/dist/commands/audit-schema.d.ts +1247 -0
  113. package/dist/commands/audit-schema.d.ts.map +1 -0
  114. package/dist/commands/audit-schema.js +139 -0
  115. package/dist/commands/audit-schema.js.map +1 -0
  116. package/dist/commands/audit-settings-schema.d.ts +417 -0
  117. package/dist/commands/audit-settings-schema.d.ts.map +1 -0
  118. package/dist/commands/audit-settings-schema.js +77 -0
  119. package/dist/commands/audit-settings-schema.js.map +1 -0
  120. package/dist/commands/audit-settings.d.ts +28 -9
  121. package/dist/commands/audit-settings.d.ts.map +1 -1
  122. package/dist/commands/audit-settings.js +215 -151
  123. package/dist/commands/audit-settings.js.map +1 -1
  124. package/dist/commands/audit.d.ts +72 -33
  125. package/dist/commands/audit.d.ts.map +1 -1
  126. package/dist/commands/audit.js +405 -411
  127. package/dist/commands/audit.js.map +1 -1
  128. package/dist/commands/build.d.ts +61 -4
  129. package/dist/commands/build.d.ts.map +1 -1
  130. package/dist/commands/build.js +176 -190
  131. package/dist/commands/build.js.map +1 -1
  132. package/dist/commands/cache/clear-schema.d.ts +111 -0
  133. package/dist/commands/cache/clear-schema.d.ts.map +1 -0
  134. package/dist/commands/cache/clear-schema.js +37 -0
  135. package/dist/commands/cache/clear-schema.js.map +1 -0
  136. package/dist/commands/cache/clear.d.ts +28 -26
  137. package/dist/commands/cache/clear.d.ts.map +1 -1
  138. package/dist/commands/cache/clear.js +108 -103
  139. package/dist/commands/cache/clear.js.map +1 -1
  140. package/dist/commands/cache/index.d.ts.map +1 -1
  141. package/dist/commands/cache/index.js +13 -7
  142. package/dist/commands/cache/index.js.map +1 -1
  143. package/dist/commands/claude/claude-config.d.ts +23 -6
  144. package/dist/commands/claude/claude-config.d.ts.map +1 -1
  145. package/dist/commands/claude/claude-config.js +29 -15
  146. package/dist/commands/claude/claude-config.js.map +1 -1
  147. package/dist/commands/claude/context.d.ts +55 -2
  148. package/dist/commands/claude/context.d.ts.map +1 -1
  149. package/dist/commands/claude/context.js +74 -50
  150. package/dist/commands/claude/context.js.map +1 -1
  151. package/dist/commands/claude/marketplace/changelog-utils.js +2 -2
  152. package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
  153. package/dist/commands/claude/marketplace/git-publish.d.ts +14 -1
  154. package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
  155. package/dist/commands/claude/marketplace/git-publish.js +135 -68
  156. package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
  157. package/dist/commands/claude/marketplace/license-utils.d.ts +3 -5
  158. package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
  159. package/dist/commands/claude/marketplace/license-utils.js +16 -7
  160. package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
  161. package/dist/commands/claude/marketplace/publish-schema.d.ts +137 -0
  162. package/dist/commands/claude/marketplace/publish-schema.d.ts.map +1 -0
  163. package/dist/commands/claude/marketplace/publish-schema.js +32 -0
  164. package/dist/commands/claude/marketplace/publish-schema.js.map +1 -0
  165. package/dist/commands/claude/marketplace/publish-tree.d.ts +6 -0
  166. package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
  167. package/dist/commands/claude/marketplace/publish-tree.js +75 -17
  168. package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
  169. package/dist/commands/claude/marketplace/publish.d.ts +27 -0
  170. package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
  171. package/dist/commands/claude/marketplace/publish.js +84 -50
  172. package/dist/commands/claude/marketplace/publish.js.map +1 -1
  173. package/dist/commands/claude/marketplace/validate-schema.d.ts +362 -0
  174. package/dist/commands/claude/marketplace/validate-schema.d.ts.map +1 -0
  175. package/dist/commands/claude/marketplace/validate-schema.js +67 -0
  176. package/dist/commands/claude/marketplace/validate-schema.js.map +1 -0
  177. package/dist/commands/claude/marketplace/validate.d.ts +40 -53
  178. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  179. package/dist/commands/claude/marketplace/validate.js +358 -214
  180. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  181. package/dist/commands/claude/org/api-keys.d.ts +3 -0
  182. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  183. package/dist/commands/claude/org/api-keys.js +4 -5
  184. package/dist/commands/claude/org/api-keys.js.map +1 -1
  185. package/dist/commands/claude/org/code-analytics.js +1 -1
  186. package/dist/commands/claude/org/code-analytics.js.map +1 -1
  187. package/dist/commands/claude/org/cost.d.ts.map +1 -1
  188. package/dist/commands/claude/org/cost.js +11 -33
  189. package/dist/commands/claude/org/cost.js.map +1 -1
  190. package/dist/commands/claude/org/helpers.d.ts +40 -27
  191. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  192. package/dist/commands/claude/org/helpers.js +61 -66
  193. package/dist/commands/claude/org/helpers.js.map +1 -1
  194. package/dist/commands/claude/org/index.d.ts.map +1 -1
  195. package/dist/commands/claude/org/index.js +10 -4
  196. package/dist/commands/claude/org/index.js.map +1 -1
  197. package/dist/commands/claude/org/info.d.ts.map +1 -1
  198. package/dist/commands/claude/org/info.js +2 -3
  199. package/dist/commands/claude/org/info.js.map +1 -1
  200. package/dist/commands/claude/org/invites.d.ts +3 -0
  201. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  202. package/dist/commands/claude/org/invites.js +5 -7
  203. package/dist/commands/claude/org/invites.js.map +1 -1
  204. package/dist/commands/claude/org/skills.d.ts +76 -21
  205. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  206. package/dist/commands/claude/org/skills.js +273 -246
  207. package/dist/commands/claude/org/skills.js.map +1 -1
  208. package/dist/commands/claude/org/stubs-schema.d.ts +56 -0
  209. package/dist/commands/claude/org/stubs-schema.d.ts.map +1 -0
  210. package/dist/commands/claude/org/stubs-schema.js +23 -0
  211. package/dist/commands/claude/org/stubs-schema.js.map +1 -0
  212. package/dist/commands/claude/org/stubs.d.ts +8 -3
  213. package/dist/commands/claude/org/stubs.d.ts.map +1 -1
  214. package/dist/commands/claude/org/stubs.js +9 -9
  215. package/dist/commands/claude/org/stubs.js.map +1 -1
  216. package/dist/commands/claude/org/usage.d.ts.map +1 -1
  217. package/dist/commands/claude/org/usage.js +1 -2
  218. package/dist/commands/claude/org/usage.js.map +1 -1
  219. package/dist/commands/claude/org/users.d.ts +3 -0
  220. package/dist/commands/claude/org/users.d.ts.map +1 -1
  221. package/dist/commands/claude/org/users.js +6 -8
  222. package/dist/commands/claude/org/users.js.map +1 -1
  223. package/dist/commands/claude/org/workspaces.d.ts +3 -0
  224. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  225. package/dist/commands/claude/org/workspaces.js +10 -15
  226. package/dist/commands/claude/org/workspaces.js.map +1 -1
  227. package/dist/commands/claude/plugin/build-schema.d.ts +642 -0
  228. package/dist/commands/claude/plugin/build-schema.d.ts.map +1 -0
  229. package/dist/commands/claude/plugin/build-schema.js +51 -0
  230. package/dist/commands/claude/plugin/build-schema.js.map +1 -0
  231. package/dist/commands/claude/plugin/build.d.ts +220 -45
  232. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  233. package/dist/commands/claude/plugin/build.js +466 -249
  234. package/dist/commands/claude/plugin/build.js.map +1 -1
  235. package/dist/commands/claude/plugin/helpers.d.ts +186 -24
  236. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  237. package/dist/commands/claude/plugin/helpers.js +110 -68
  238. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  239. package/dist/commands/claude/plugin/install-schema.d.ts +144 -0
  240. package/dist/commands/claude/plugin/install-schema.d.ts.map +1 -0
  241. package/dist/commands/claude/plugin/install-schema.js +36 -0
  242. package/dist/commands/claude/plugin/install-schema.js.map +1 -0
  243. package/dist/commands/claude/plugin/install.d.ts +191 -11
  244. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  245. package/dist/commands/claude/plugin/install.js +688 -628
  246. package/dist/commands/claude/plugin/install.js.map +1 -1
  247. package/dist/commands/claude/plugin/kept-findings.d.ts +19 -0
  248. package/dist/commands/claude/plugin/kept-findings.d.ts.map +1 -0
  249. package/dist/commands/claude/plugin/kept-findings.js +24 -0
  250. package/dist/commands/claude/plugin/kept-findings.js.map +1 -0
  251. package/dist/commands/claude/plugin/list-schema.d.ts +223 -0
  252. package/dist/commands/claude/plugin/list-schema.d.ts.map +1 -0
  253. package/dist/commands/claude/plugin/list-schema.js +34 -0
  254. package/dist/commands/claude/plugin/list-schema.js.map +1 -0
  255. package/dist/commands/claude/plugin/list.d.ts +18 -0
  256. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  257. package/dist/commands/claude/plugin/list.js +53 -45
  258. package/dist/commands/claude/plugin/list.js.map +1 -1
  259. package/dist/commands/claude/plugin/npm-pack.d.ts +15 -0
  260. package/dist/commands/claude/plugin/npm-pack.d.ts.map +1 -0
  261. package/dist/commands/claude/plugin/npm-pack.js +39 -0
  262. package/dist/commands/claude/plugin/npm-pack.js.map +1 -0
  263. package/dist/commands/claude/plugin/plugin-changelog.d.ts +5 -1
  264. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  265. package/dist/commands/claude/plugin/plugin-changelog.js +9 -5
  266. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  267. package/dist/commands/claude/plugin/plugin-files.d.ts +21 -2
  268. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  269. package/dist/commands/claude/plugin/plugin-files.js +65 -32
  270. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  271. package/dist/commands/claude/plugin/plugin-validators.d.ts +13 -0
  272. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  273. package/dist/commands/claude/plugin/plugin-validators.js +64 -16
  274. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  275. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  276. package/dist/commands/claude/plugin/tree-copy.js +63 -37
  277. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  278. package/dist/commands/claude/plugin/uninstall-schema.d.ts +112 -0
  279. package/dist/commands/claude/plugin/uninstall-schema.d.ts.map +1 -0
  280. package/dist/commands/claude/plugin/uninstall-schema.js +28 -0
  281. package/dist/commands/claude/plugin/uninstall-schema.js.map +1 -0
  282. package/dist/commands/claude/plugin/uninstall.d.ts +57 -0
  283. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  284. package/dist/commands/claude/plugin/uninstall.js +176 -64
  285. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  286. package/dist/commands/consistency-check.d.ts.map +1 -1
  287. package/dist/commands/consistency-check.js +8 -6
  288. package/dist/commands/consistency-check.js.map +1 -1
  289. package/dist/commands/corpus/index.d.ts.map +1 -1
  290. package/dist/commands/corpus/index.js +26 -10
  291. package/dist/commands/corpus/index.js.map +1 -1
  292. package/dist/commands/corpus/report.d.ts +34 -16
  293. package/dist/commands/corpus/report.d.ts.map +1 -1
  294. package/dist/commands/corpus/report.js +36 -18
  295. package/dist/commands/corpus/report.js.map +1 -1
  296. package/dist/commands/corpus/runner.d.ts +25 -20
  297. package/dist/commands/corpus/runner.d.ts.map +1 -1
  298. package/dist/commands/corpus/runner.js +123 -67
  299. package/dist/commands/corpus/runner.js.map +1 -1
  300. package/dist/commands/corpus/scan-schema.d.ts +127 -0
  301. package/dist/commands/corpus/scan-schema.d.ts.map +1 -0
  302. package/dist/commands/corpus/scan-schema.js +31 -0
  303. package/dist/commands/corpus/scan-schema.js.map +1 -0
  304. package/dist/commands/corpus/scan.d.ts +31 -0
  305. package/dist/commands/corpus/scan.d.ts.map +1 -1
  306. package/dist/commands/corpus/scan.js +124 -50
  307. package/dist/commands/corpus/scan.js.map +1 -1
  308. package/dist/commands/corpus/seed.d.ts +11 -8
  309. package/dist/commands/corpus/seed.d.ts.map +1 -1
  310. package/dist/commands/corpus/seed.js +29 -11
  311. package/dist/commands/corpus/seed.js.map +1 -1
  312. package/dist/commands/doctor-render.d.ts +52 -0
  313. package/dist/commands/doctor-render.d.ts.map +1 -0
  314. package/dist/commands/doctor-render.js +110 -0
  315. package/dist/commands/doctor-render.js.map +1 -0
  316. package/dist/commands/doctor-schema.d.ts +191 -0
  317. package/dist/commands/doctor-schema.d.ts.map +1 -0
  318. package/dist/commands/doctor-schema.js +44 -0
  319. package/dist/commands/doctor-schema.js.map +1 -0
  320. package/dist/commands/doctor.d.ts +7 -62
  321. package/dist/commands/doctor.d.ts.map +1 -1
  322. package/dist/commands/doctor.js +126 -165
  323. package/dist/commands/doctor.js.map +1 -1
  324. package/dist/commands/inventory-schema.d.ts +7297 -0
  325. package/dist/commands/inventory-schema.d.ts.map +1 -0
  326. package/dist/commands/inventory-schema.js +28 -0
  327. package/dist/commands/inventory-schema.js.map +1 -0
  328. package/dist/commands/inventory.d.ts +1 -1
  329. package/dist/commands/inventory.d.ts.map +1 -1
  330. package/dist/commands/inventory.js +89 -41
  331. package/dist/commands/inventory.js.map +1 -1
  332. package/dist/commands/mcp/index.d.ts.map +1 -1
  333. package/dist/commands/mcp/index.js +15 -0
  334. package/dist/commands/mcp/index.js.map +1 -1
  335. package/dist/commands/mcp/list-collections-schema.d.ts +101 -0
  336. package/dist/commands/mcp/list-collections-schema.d.ts.map +1 -0
  337. package/dist/commands/mcp/list-collections-schema.js +22 -0
  338. package/dist/commands/mcp/list-collections-schema.js.map +1 -0
  339. package/dist/commands/mcp/list-collections.d.ts +1 -1
  340. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  341. package/dist/commands/mcp/list-collections.js +19 -17
  342. package/dist/commands/mcp/list-collections.js.map +1 -1
  343. package/dist/commands/mcp/serve.d.ts +5 -0
  344. package/dist/commands/mcp/serve.d.ts.map +1 -1
  345. package/dist/commands/mcp/serve.js +29 -15
  346. package/dist/commands/mcp/serve.js.map +1 -1
  347. package/dist/commands/okf/index.d.ts.map +1 -1
  348. package/dist/commands/okf/index.js +6 -5
  349. package/dist/commands/okf/index.js.map +1 -1
  350. package/dist/commands/okf/validate-schema.d.ts +171 -0
  351. package/dist/commands/okf/validate-schema.d.ts.map +1 -0
  352. package/dist/commands/okf/validate-schema.js +44 -0
  353. package/dist/commands/okf/validate-schema.js.map +1 -0
  354. package/dist/commands/okf/validate.d.ts +16 -149
  355. package/dist/commands/okf/validate.d.ts.map +1 -1
  356. package/dist/commands/okf/validate.js +64 -62
  357. package/dist/commands/okf/validate.js.map +1 -1
  358. package/dist/commands/orchestrator-schema.d.ts +419 -0
  359. package/dist/commands/orchestrator-schema.d.ts.map +1 -0
  360. package/dist/commands/orchestrator-schema.js +91 -0
  361. package/dist/commands/orchestrator-schema.js.map +1 -0
  362. package/dist/commands/phase-utils.d.ts +188 -220
  363. package/dist/commands/phase-utils.d.ts.map +1 -1
  364. package/dist/commands/phase-utils.js +210 -258
  365. package/dist/commands/phase-utils.js.map +1 -1
  366. package/dist/commands/positional-args.d.ts +13 -11
  367. package/dist/commands/positional-args.d.ts.map +1 -1
  368. package/dist/commands/positional-args.js +16 -15
  369. package/dist/commands/positional-args.js.map +1 -1
  370. package/dist/commands/rag/admin-schema.d.ts +152 -0
  371. package/dist/commands/rag/admin-schema.d.ts.map +1 -0
  372. package/dist/commands/rag/admin-schema.js +31 -0
  373. package/dist/commands/rag/admin-schema.js.map +1 -0
  374. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  375. package/dist/commands/rag/clear-command.js +30 -15
  376. package/dist/commands/rag/clear-command.js.map +1 -1
  377. package/dist/commands/rag/command-helpers.d.ts +31 -7
  378. package/dist/commands/rag/command-helpers.d.ts.map +1 -1
  379. package/dist/commands/rag/command-helpers.js +41 -21
  380. package/dist/commands/rag/command-helpers.js.map +1 -1
  381. package/dist/commands/rag/index-command.d.ts +37 -48
  382. package/dist/commands/rag/index-command.d.ts.map +1 -1
  383. package/dist/commands/rag/index-command.js +80 -65
  384. package/dist/commands/rag/index-command.js.map +1 -1
  385. package/dist/commands/rag/index-schema.d.ts +107 -0
  386. package/dist/commands/rag/index-schema.d.ts.map +1 -0
  387. package/dist/commands/rag/index-schema.js +34 -0
  388. package/dist/commands/rag/index-schema.js.map +1 -0
  389. package/dist/commands/rag/index.d.ts.map +1 -1
  390. package/dist/commands/rag/index.js +88 -41
  391. package/dist/commands/rag/index.js.map +1 -1
  392. package/dist/commands/rag/query-command.d.ts +18 -4
  393. package/dist/commands/rag/query-command.d.ts.map +1 -1
  394. package/dist/commands/rag/query-command.js +42 -27
  395. package/dist/commands/rag/query-command.js.map +1 -1
  396. package/dist/commands/rag/query-schema.d.ts +363 -0
  397. package/dist/commands/rag/query-schema.d.ts.map +1 -0
  398. package/dist/commands/rag/query-schema.js +59 -0
  399. package/dist/commands/rag/query-schema.js.map +1 -0
  400. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  401. package/dist/commands/rag/stats-command.js +19 -18
  402. package/dist/commands/rag/stats-command.js.map +1 -1
  403. package/dist/commands/resources/check-progress.d.ts +64 -11
  404. package/dist/commands/resources/check-progress.d.ts.map +1 -1
  405. package/dist/commands/resources/check-progress.js +77 -4
  406. package/dist/commands/resources/check-progress.js.map +1 -1
  407. package/dist/commands/resources/check-schema.d.ts +335 -0
  408. package/dist/commands/resources/check-schema.d.ts.map +1 -0
  409. package/dist/commands/resources/check-schema.js +104 -0
  410. package/dist/commands/resources/check-schema.js.map +1 -0
  411. package/dist/commands/resources/check-supervisor.d.ts +315 -71
  412. package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
  413. package/dist/commands/resources/check-supervisor.js +493 -107
  414. package/dist/commands/resources/check-supervisor.js.map +1 -1
  415. package/dist/commands/resources/check.d.ts +56 -249
  416. package/dist/commands/resources/check.d.ts.map +1 -1
  417. package/dist/commands/resources/check.js +416 -276
  418. package/dist/commands/resources/check.js.map +1 -1
  419. package/dist/commands/resources/index.d.ts.map +1 -1
  420. package/dist/commands/resources/index.js +165 -91
  421. package/dist/commands/resources/index.js.map +1 -1
  422. package/dist/commands/resources/query-schema.d.ts +188 -0
  423. package/dist/commands/resources/query-schema.d.ts.map +1 -0
  424. package/dist/commands/resources/query-schema.js +48 -0
  425. package/dist/commands/resources/query-schema.js.map +1 -0
  426. package/dist/commands/resources/query.d.ts +17 -12
  427. package/dist/commands/resources/query.d.ts.map +1 -1
  428. package/dist/commands/resources/query.js +60 -48
  429. package/dist/commands/resources/query.js.map +1 -1
  430. package/dist/commands/resources/scan-schema.d.ts +195 -0
  431. package/dist/commands/resources/scan-schema.d.ts.map +1 -0
  432. package/dist/commands/resources/scan-schema.js +53 -0
  433. package/dist/commands/resources/scan-schema.js.map +1 -0
  434. package/dist/commands/resources/scan.d.ts +26 -3
  435. package/dist/commands/resources/scan.d.ts.map +1 -1
  436. package/dist/commands/resources/scan.js +51 -53
  437. package/dist/commands/resources/scan.js.map +1 -1
  438. package/dist/commands/resources/validate-schema.d.ts +326 -0
  439. package/dist/commands/resources/validate-schema.d.ts.map +1 -0
  440. package/dist/commands/resources/validate-schema.js +60 -0
  441. package/dist/commands/resources/validate-schema.js.map +1 -0
  442. package/dist/commands/resources/validate.d.ts +45 -169
  443. package/dist/commands/resources/validate.d.ts.map +1 -1
  444. package/dist/commands/resources/validate.js +221 -485
  445. package/dist/commands/resources/validate.js.map +1 -1
  446. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  447. package/dist/commands/skill/review-checklist.js +0 -1
  448. package/dist/commands/skill/review-checklist.js.map +1 -1
  449. package/dist/commands/skill/review-schema.d.ts +278 -0
  450. package/dist/commands/skill/review-schema.d.ts.map +1 -0
  451. package/dist/commands/skill/review-schema.js +46 -0
  452. package/dist/commands/skill/review-schema.js.map +1 -0
  453. package/dist/commands/skill/review.d.ts +8 -234
  454. package/dist/commands/skill/review.d.ts.map +1 -1
  455. package/dist/commands/skill/review.js +54 -78
  456. package/dist/commands/skill/review.js.map +1 -1
  457. package/dist/commands/skill/test/auth-flags.d.ts +3 -0
  458. package/dist/commands/skill/test/auth-flags.d.ts.map +1 -1
  459. package/dist/commands/skill/test/auth-flags.js +6 -2
  460. package/dist/commands/skill/test/auth-flags.js.map +1 -1
  461. package/dist/commands/skill/test/configure-schema.d.ts +67 -0
  462. package/dist/commands/skill/test/configure-schema.d.ts.map +1 -0
  463. package/dist/commands/skill/test/configure-schema.js +27 -0
  464. package/dist/commands/skill/test/configure-schema.js.map +1 -0
  465. package/dist/commands/skill/test/configure.d.ts +12 -5
  466. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  467. package/dist/commands/skill/test/configure.js +101 -31
  468. package/dist/commands/skill/test/configure.js.map +1 -1
  469. package/dist/commands/skill/test/run-schema.d.ts +107 -0
  470. package/dist/commands/skill/test/run-schema.d.ts.map +1 -0
  471. package/dist/commands/skill/test/run-schema.js +36 -0
  472. package/dist/commands/skill/test/run-schema.js.map +1 -0
  473. package/dist/commands/skill/test/run.d.ts +3 -2
  474. package/dist/commands/skill/test/run.d.ts.map +1 -1
  475. package/dist/commands/skill/test/run.js +316 -155
  476. package/dist/commands/skill/test/run.js.map +1 -1
  477. package/dist/commands/skills/build-schema.d.ts +199 -0
  478. package/dist/commands/skills/build-schema.d.ts.map +1 -0
  479. package/dist/commands/skills/build-schema.js +55 -0
  480. package/dist/commands/skills/build-schema.js.map +1 -0
  481. package/dist/commands/skills/build.d.ts +95 -298
  482. package/dist/commands/skills/build.d.ts.map +1 -1
  483. package/dist/commands/skills/build.js +415 -818
  484. package/dist/commands/skills/build.js.map +1 -1
  485. package/dist/commands/skills/command-helpers.d.ts +5 -11
  486. package/dist/commands/skills/command-helpers.d.ts.map +1 -1
  487. package/dist/commands/skills/command-helpers.js +7 -17
  488. package/dist/commands/skills/command-helpers.js.map +1 -1
  489. package/dist/commands/skills/index.js +12 -6
  490. package/dist/commands/skills/index.js.map +1 -1
  491. package/dist/commands/skills/install-schema.d.ts +153 -0
  492. package/dist/commands/skills/install-schema.d.ts.map +1 -0
  493. package/dist/commands/skills/install-schema.js +44 -0
  494. package/dist/commands/skills/install-schema.js.map +1 -0
  495. package/dist/commands/skills/install.d.ts +76 -8
  496. package/dist/commands/skills/install.d.ts.map +1 -1
  497. package/dist/commands/skills/install.js +230 -194
  498. package/dist/commands/skills/install.js.map +1 -1
  499. package/dist/commands/skills/list-schema.d.ts +145 -0
  500. package/dist/commands/skills/list-schema.d.ts.map +1 -0
  501. package/dist/commands/skills/list-schema.js +37 -0
  502. package/dist/commands/skills/list-schema.js.map +1 -0
  503. package/dist/commands/skills/list.d.ts +39 -8
  504. package/dist/commands/skills/list.d.ts.map +1 -1
  505. package/dist/commands/skills/list.js +110 -122
  506. package/dist/commands/skills/list.js.map +1 -1
  507. package/dist/commands/skills/package-schema.d.ts +98 -0
  508. package/dist/commands/skills/package-schema.d.ts.map +1 -0
  509. package/dist/commands/skills/package-schema.js +32 -0
  510. package/dist/commands/skills/package-schema.js.map +1 -0
  511. package/dist/commands/skills/package.d.ts +85 -14
  512. package/dist/commands/skills/package.d.ts.map +1 -1
  513. package/dist/commands/skills/package.js +288 -207
  514. package/dist/commands/skills/package.js.map +1 -1
  515. package/dist/commands/skills/scope-guard.d.ts +27 -20
  516. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  517. package/dist/commands/skills/scope-guard.js +43 -32
  518. package/dist/commands/skills/scope-guard.js.map +1 -1
  519. package/dist/commands/skills/skill-discovery.d.ts +1 -1
  520. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  521. package/dist/commands/skills/skill-discovery.js +40 -19
  522. package/dist/commands/skills/skill-discovery.js.map +1 -1
  523. package/dist/commands/skills/source-resolvers.d.ts +58 -8
  524. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  525. package/dist/commands/skills/source-resolvers.js +113 -38
  526. package/dist/commands/skills/source-resolvers.js.map +1 -1
  527. package/dist/commands/skills/validate-command.d.ts.map +1 -1
  528. package/dist/commands/skills/validate-command.js +31 -51
  529. package/dist/commands/skills/validate-command.js.map +1 -1
  530. package/dist/commands/skills/validate-schema.d.ts +199 -0
  531. package/dist/commands/skills/validate-schema.d.ts.map +1 -0
  532. package/dist/commands/skills/validate-schema.js +44 -0
  533. package/dist/commands/skills/validate-schema.js.map +1 -0
  534. package/dist/commands/skills/validate.d.ts +100 -136
  535. package/dist/commands/skills/validate.d.ts.map +1 -1
  536. package/dist/commands/skills/validate.js +257 -343
  537. package/dist/commands/skills/validate.js.map +1 -1
  538. package/dist/commands/validate.d.ts +17 -5
  539. package/dist/commands/validate.d.ts.map +1 -1
  540. package/dist/commands/validate.js +139 -94
  541. package/dist/commands/validate.js.map +1 -1
  542. package/dist/commands/verify.d.ts +121 -110
  543. package/dist/commands/verify.d.ts.map +1 -1
  544. package/dist/commands/verify.js +230 -294
  545. package/dist/commands/verify.js.map +1 -1
  546. package/dist/index.d.ts +1 -1
  547. package/dist/index.d.ts.map +1 -1
  548. package/dist/index.js +1 -1
  549. package/dist/index.js.map +1 -1
  550. package/dist/report-schemas.d.ts +12398 -35
  551. package/dist/report-schemas.d.ts.map +1 -1
  552. package/dist/report-schemas.js +624 -66
  553. package/dist/report-schemas.js.map +1 -1
  554. package/dist/skill-resolution/packaging-config.js +2 -2
  555. package/dist/skill-resolution/packaging-config.js.map +1 -1
  556. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  557. package/dist/skill-resolution/resolve-skill-reference.js +20 -13
  558. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  559. package/dist/utils/agent-discovery.d.ts +34 -1
  560. package/dist/utils/agent-discovery.d.ts.map +1 -1
  561. package/dist/utils/agent-discovery.js +80 -38
  562. package/dist/utils/agent-discovery.js.map +1 -1
  563. package/dist/utils/claude-context-lens.d.ts +13 -6
  564. package/dist/utils/claude-context-lens.d.ts.map +1 -1
  565. package/dist/utils/claude-context-lens.js +11 -12
  566. package/dist/utils/claude-context-lens.js.map +1 -1
  567. package/dist/utils/command-error-codes.d.ts +12 -0
  568. package/dist/utils/command-error-codes.d.ts.map +1 -0
  569. package/dist/utils/command-error-codes.js +12 -0
  570. package/dist/utils/command-error-codes.js.map +1 -0
  571. package/dist/utils/command-refusal.d.ts +58 -0
  572. package/dist/utils/command-refusal.d.ts.map +1 -0
  573. package/dist/utils/command-refusal.js +170 -0
  574. package/dist/utils/command-refusal.js.map +1 -0
  575. package/dist/utils/commander-ending.d.ts +40 -0
  576. package/dist/utils/commander-ending.d.ts.map +1 -0
  577. package/dist/utils/commander-ending.js +42 -0
  578. package/dist/utils/commander-ending.js.map +1 -0
  579. package/dist/utils/config-loader.d.ts +13 -8
  580. package/dist/utils/config-loader.d.ts.map +1 -1
  581. package/dist/utils/config-loader.js +84 -45
  582. package/dist/utils/config-loader.js.map +1 -1
  583. package/dist/utils/corpus-target.d.ts +1 -1
  584. package/dist/utils/corpus-target.d.ts.map +1 -1
  585. package/dist/utils/corpus-target.js +6 -4
  586. package/dist/utils/corpus-target.js.map +1 -1
  587. package/dist/utils/debug-diagnostics.d.ts +18 -0
  588. package/dist/utils/debug-diagnostics.d.ts.map +1 -0
  589. package/dist/utils/debug-diagnostics.js +23 -0
  590. package/dist/utils/debug-diagnostics.js.map +1 -0
  591. package/dist/utils/document-writer.d.ts +191 -0
  592. package/dist/utils/document-writer.d.ts.map +1 -0
  593. package/dist/utils/document-writer.js +319 -0
  594. package/dist/utils/document-writer.js.map +1 -0
  595. package/dist/utils/help-loader.d.ts +2 -2
  596. package/dist/utils/help-loader.js +2 -2
  597. package/dist/utils/install-plan.d.ts +99 -0
  598. package/dist/utils/install-plan.d.ts.map +1 -0
  599. package/dist/utils/install-plan.js +146 -0
  600. package/dist/utils/install-plan.js.map +1 -0
  601. package/dist/utils/issue-anchor.d.ts +1 -1
  602. package/dist/utils/issue-anchor.d.ts.map +1 -1
  603. package/dist/utils/issue-anchor.js.map +1 -1
  604. package/dist/utils/issue-rendering.d.ts +8 -3
  605. package/dist/utils/issue-rendering.d.ts.map +1 -1
  606. package/dist/utils/issue-rendering.js +4 -0
  607. package/dist/utils/issue-rendering.js.map +1 -1
  608. package/dist/utils/lens-population.d.ts +20 -0
  609. package/dist/utils/lens-population.d.ts.map +1 -0
  610. package/dist/utils/lens-population.js +15 -0
  611. package/dist/utils/lens-population.js.map +1 -0
  612. package/dist/utils/marketplace-io.d.ts +63 -0
  613. package/dist/utils/marketplace-io.d.ts.map +1 -0
  614. package/dist/utils/marketplace-io.js +63 -0
  615. package/dist/utils/marketplace-io.js.map +1 -0
  616. package/dist/utils/operator-notices.d.ts +97 -0
  617. package/dist/utils/operator-notices.d.ts.map +1 -0
  618. package/dist/utils/operator-notices.js +115 -0
  619. package/dist/utils/operator-notices.js.map +1 -0
  620. package/dist/utils/optional-backend.d.ts +18 -15
  621. package/dist/utils/optional-backend.d.ts.map +1 -1
  622. package/dist/utils/optional-backend.js +22 -33
  623. package/dist/utils/optional-backend.js.map +1 -1
  624. package/dist/utils/output.d.ts +5 -43
  625. package/dist/utils/output.d.ts.map +1 -1
  626. package/dist/utils/output.js +8 -63
  627. package/dist/utils/output.js.map +1 -1
  628. package/dist/utils/package-json.d.ts +3 -4
  629. package/dist/utils/package-json.d.ts.map +1 -1
  630. package/dist/utils/package-json.js +8 -8
  631. package/dist/utils/package-json.js.map +1 -1
  632. package/dist/utils/population-wiring.d.ts +31 -38
  633. package/dist/utils/population-wiring.d.ts.map +1 -1
  634. package/dist/utils/population-wiring.js +38 -32
  635. package/dist/utils/population-wiring.js.map +1 -1
  636. package/dist/utils/project-root-policy.d.ts +74 -1
  637. package/dist/utils/project-root-policy.d.ts.map +1 -1
  638. package/dist/utils/project-root-policy.js +146 -8
  639. package/dist/utils/project-root-policy.js.map +1 -1
  640. package/dist/utils/projection-lenses.d.ts +25 -7
  641. package/dist/utils/projection-lenses.d.ts.map +1 -1
  642. package/dist/utils/projection-lenses.js +20 -6
  643. package/dist/utils/projection-lenses.js.map +1 -1
  644. package/dist/utils/projection-query.d.ts +17 -10
  645. package/dist/utils/projection-query.d.ts.map +1 -1
  646. package/dist/utils/projection-query.js +47 -28
  647. package/dist/utils/projection-query.js.map +1 -1
  648. package/dist/utils/projection-store.d.ts +2 -2
  649. package/dist/utils/projection-store.d.ts.map +1 -1
  650. package/dist/utils/projection-store.js +74 -45
  651. package/dist/utils/projection-store.js.map +1 -1
  652. package/dist/utils/rag-database.d.ts +61 -0
  653. package/dist/utils/rag-database.d.ts.map +1 -0
  654. package/dist/utils/rag-database.js +178 -0
  655. package/dist/utils/rag-database.js.map +1 -0
  656. package/dist/utils/relation-limits.d.ts +7 -2
  657. package/dist/utils/relation-limits.d.ts.map +1 -1
  658. package/dist/utils/relation-limits.js +6 -1
  659. package/dist/utils/relation-limits.js.map +1 -1
  660. package/dist/utils/relativize-paths.d.ts +23 -0
  661. package/dist/utils/relativize-paths.d.ts.map +1 -1
  662. package/dist/utils/relativize-paths.js +32 -1
  663. package/dist/utils/relativize-paths.js.map +1 -1
  664. package/dist/utils/resource-loader.d.ts +76 -32
  665. package/dist/utils/resource-loader.d.ts.map +1 -1
  666. package/dist/utils/resource-loader.js +132 -66
  667. package/dist/utils/resource-loader.js.map +1 -1
  668. package/dist/utils/run-integrity.d.ts +64 -31
  669. package/dist/utils/run-integrity.d.ts.map +1 -1
  670. package/dist/utils/run-integrity.js +76 -35
  671. package/dist/utils/run-integrity.js.map +1 -1
  672. package/dist/utils/scope-locations.d.ts +7 -5
  673. package/dist/utils/scope-locations.d.ts.map +1 -1
  674. package/dist/utils/scope-locations.js +37 -12
  675. package/dist/utils/scope-locations.js.map +1 -1
  676. package/dist/utils/staging-dir.d.ts +7 -0
  677. package/dist/utils/staging-dir.d.ts.map +1 -0
  678. package/dist/utils/staging-dir.js +12 -0
  679. package/dist/utils/staging-dir.js.map +1 -0
  680. package/dist/utils/url-redact.d.ts +9 -0
  681. package/dist/utils/url-redact.d.ts.map +1 -1
  682. package/dist/utils/url-redact.js +13 -0
  683. package/dist/utils/url-redact.js.map +1 -1
  684. package/dist/utils/user-context-scanner.d.ts +3 -2
  685. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  686. package/dist/utils/user-context-scanner.js +24 -4
  687. package/dist/utils/user-context-scanner.js.map +1 -1
  688. package/dist/utils/validate-help-files.d.ts.map +1 -1
  689. package/dist/utils/validate-help-files.js +8 -14
  690. package/dist/utils/validate-help-files.js.map +1 -1
  691. package/dist/utils/vat-bin-path.d.ts.map +1 -1
  692. package/dist/utils/vat-bin-path.js +3 -3
  693. package/dist/utils/vat-bin-path.js.map +1 -1
  694. package/dist/utils/verdict-helpers.d.ts.map +1 -1
  695. package/dist/utils/verdict-helpers.js +5 -5
  696. package/dist/utils/verdict-helpers.js.map +1 -1
  697. package/docs/agent.md +347 -2
  698. package/docs/audit.md +312 -89
  699. package/docs/doctor.md +65 -19
  700. package/docs/index.md +571 -20
  701. package/docs/mcp.md +64 -12
  702. package/docs/rag.md +176 -48
  703. package/docs/resources.md +257 -71
  704. package/docs/skill-test.md +148 -19
  705. package/docs/skills.md +459 -174
  706. package/package.json +16 -19
  707. package/schemas/agent-build.json +268 -0
  708. package/schemas/agent-import.json +252 -0
  709. package/schemas/agent-install.json +260 -0
  710. package/schemas/agent-installed.json +287 -0
  711. package/schemas/agent-list.json +279 -0
  712. package/schemas/agent-uninstall.json +260 -0
  713. package/schemas/agent-validate.json +279 -0
  714. package/schemas/ard-emit.json +224 -106
  715. package/schemas/audit-settings.json +472 -0
  716. package/schemas/audit.json +635 -0
  717. package/schemas/cache-clear.json +273 -0
  718. package/schemas/claude-marketplace-publish.json +286 -0
  719. package/schemas/claude-marketplace-validate.json +352 -0
  720. package/schemas/claude-org-not-implemented.json +239 -0
  721. package/schemas/claude-plugin-build.json +446 -0
  722. package/schemas/claude-plugin-install.json +291 -0
  723. package/schemas/claude-plugin-list.json +326 -0
  724. package/schemas/claude-plugin-uninstall.json +272 -0
  725. package/schemas/corpus-audit.json +635 -0
  726. package/schemas/corpus-scan.json +293 -0
  727. package/schemas/doctor.json +299 -0
  728. package/schemas/inventory.json +982 -0
  729. package/schemas/mcp-list-collections.json +268 -0
  730. package/schemas/okf-validate.json +224 -106
  731. package/schemas/orchestrator.json +299 -0
  732. package/schemas/rag-clear.json +253 -0
  733. package/schemas/rag-index.json +273 -0
  734. package/schemas/rag-query.json +365 -0
  735. package/schemas/rag-stats.json +269 -0
  736. package/schemas/resources-check.json +242 -108
  737. package/schemas/resources-query.json +333 -0
  738. package/schemas/resources-scan.json +321 -0
  739. package/schemas/resources-validate.json +332 -0
  740. package/schemas/skill-review.json +224 -106
  741. package/schemas/skill-test-configure.json +256 -0
  742. package/schemas/skill-test-run.json +296 -0
  743. package/schemas/skills-build.json +325 -0
  744. package/schemas/skills-install.json +287 -0
  745. package/schemas/skills-list.json +283 -0
  746. package/schemas/skills-package.json +270 -0
  747. package/schemas/skills-validate.json +285 -0
  748. package/dist/commands/skills/shared.d.ts +0 -29
  749. package/dist/commands/skills/shared.d.ts.map +0 -1
  750. package/dist/commands/skills/shared.js +0 -33
  751. package/dist/commands/skills/shared.js.map +0 -1
  752. package/dist/utils/command-error.d.ts +0 -194
  753. package/dist/utils/command-error.d.ts.map +0 -1
  754. package/dist/utils/command-error.js +0 -237
  755. package/dist/utils/command-error.js.map +0 -1
@@ -0,0 +1,97 @@
1
+ /**
2
+ * The ONE route for a notice addressed to the operator — a config-loader warning, a projection-store
3
+ * notice — and the ONE predicate that says whether this process is a supervised checks child.
4
+ *
5
+ * ## 🔑 Each notice prints once per run, from the process that owes it
6
+ *
7
+ * `vat resources check` runs its checks in a supervised CHILD (`--supervised-by`), and `vat validate`
8
+ * runs that same child as its `checks` phase. The child reads the same config and keys the same
9
+ * store as the process that spawned it, and its stderr is inherited — so a notice both printed was
10
+ * printed twice for one run.
11
+ *
12
+ * Who owes what:
13
+ *
14
+ * - **A config warning** — the invoking process. It loads the config itself in both invocations
15
+ * (`vat validate` to choose its phases, a standalone `vat resources check` to say whether the
16
+ * project declares checks of its own), so a supervised child never prints one.
17
+ * - **The store notice** — whichever process keys the store first. `vat validate` opens its store
18
+ * scope before any phase runs, so a child started as its phase stays quiet; a standalone
19
+ * `vat resources check` opens no store at all — keying one is a git snapshot, unbounded work a
20
+ * supervisor must not do before its watchdog exists — so the child it started prints it.
21
+ *
22
+ * The audience is decided ONCE, at the command's entry, from its explicit argv
23
+ * ({@link isSupervisedChild}), and entered as a scope ({@link withNoticeAudience}) the command's
24
+ * whole run sits inside. Nothing sets it as a side effect, and it ends with the scope — so a unit
25
+ * test, or a second command in one process, starts from "print everything".
26
+ *
27
+ * ## 🔑 "Once" belongs to the same scope
28
+ *
29
+ * A notice that would repeat — one config governing many skills, one unkeyable root asked about by
30
+ * every nested population scope — carries a `once` key, and the ledger that remembers it lives in
31
+ * the SAME scope as the audience: {@link withNoticeAudience} starts a fresh one, and so does the
32
+ * outermost population scope ({@link withNoticeLedger}) — starting from what was printed before it,
33
+ * so a config loaded both before and inside it warns once — so a second command in one process
34
+ * says it again. There is one ledger mechanism, not one per notice kind. Outside every scope (a config
35
+ * loaded before any population, a unit test) the ledger is the process's own, reset with the config
36
+ * cache ({@link resetUnscopedNoticeLedger}).
37
+ *
38
+ * ⚠️ Only NOTICES go through here: news that does not change what the run decides. A refusal's
39
+ * message, and anything that explains the document the child publishes, is the child's to print.
40
+ */
41
+ /** What a notice is about — which decides which process owes it. */
42
+ export type NoticeKind = 'config' | 'store';
43
+ /** Which notices this process prints. Outside any scope, every one. */
44
+ export type NoticeAudience = Readonly<Record<NoticeKind, boolean>>;
45
+ /** Every notice — the audience of any process that is not a supervised child. */
46
+ export declare const EVERY_NOTICE: NoticeAudience;
47
+ /**
48
+ * Is this process the child a supervisor spawned to run the checks?
49
+ *
50
+ * 🔑 The ONE predicate, read from the explicit argv: `--supervised-by` is what a supervisor hands
51
+ * its child and nothing else passes (the child refuses it unless its parent is the supervisor the
52
+ * value names). Every decision that turns on "am I the child" asks this — which process runs the
53
+ * checks, which prints the "no checks of its own" warning, which notices it owes.
54
+ *
55
+ * @param argv - The command's parsed options
56
+ * @param argv.supervisedBy - The hidden `--supervised-by` value, or undefined
57
+ * @returns True in the supervised child
58
+ */
59
+ export declare function isSupervisedChild<T extends {
60
+ readonly supervisedBy: string | undefined;
61
+ }>(argv: T): argv is T & {
62
+ readonly supervisedBy: string;
63
+ };
64
+ /**
65
+ * Run `work` with `audience` deciding which notices this process prints, and a fresh `once` ledger.
66
+ *
67
+ * @param audience - Which notices to print
68
+ * @param work - The command's run
69
+ * @returns Whatever `work` returned
70
+ */
71
+ export declare function withNoticeAudience<T>(audience: NoticeAudience, work: () => T): T;
72
+ /**
73
+ * Run `work` inside a notice scope: the enclosing one when there is one, else a fresh scope that
74
+ * prints every notice — so `once` means once per command run, never once per process.
75
+ *
76
+ * 🚨 The fresh scope STARTS from what was already printed outside every scope, and copies it: a
77
+ * command loads its config before it opens its population scope (`vat validate`, to choose its
78
+ * phases) and again inside it, so a scope starting empty printed that config warning twice for one
79
+ * run. A copy, not the set itself, so what the scope prints stays its own and the next run says it
80
+ * again.
81
+ *
82
+ * @param work - The run
83
+ * @returns Whatever `work` returned
84
+ */
85
+ export declare function withNoticeLedger<T>(work: () => T): T;
86
+ /** Forget the `once` notices printed outside every scope — with the config cache they describe. */
87
+ export declare function resetUnscopedNoticeLedger(): void;
88
+ /**
89
+ * Write one notice to the operator's stderr — unless the enclosing scope says another process owes
90
+ * it, or it carries a `once` key this scope has already printed.
91
+ *
92
+ * @param kind - What the notice is about
93
+ * @param message - The notice, without a trailing newline
94
+ * @param once - When set, print this notice at most once per scope for this key
95
+ */
96
+ export declare function noticeToOperator(kind: NoticeKind, message: string, once?: string): void;
97
+ //# sourceMappingURL=operator-notices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operator-notices.d.ts","sourceRoot":"","sources":["../../src/utils/operator-notices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAIH,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5C,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAEnE,iFAAiF;AACjF,eAAO,MAAM,YAAY,EAAE,cAA8C,CAAC;AAa1E;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EACvF,IAAI,EAAE,CAAC,GACN,IAAI,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAEhF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAIpD;AAED,mGAAmG;AACnG,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAUvF"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * The ONE route for a notice addressed to the operator — a config-loader warning, a projection-store
3
+ * notice — and the ONE predicate that says whether this process is a supervised checks child.
4
+ *
5
+ * ## 🔑 Each notice prints once per run, from the process that owes it
6
+ *
7
+ * `vat resources check` runs its checks in a supervised CHILD (`--supervised-by`), and `vat validate`
8
+ * runs that same child as its `checks` phase. The child reads the same config and keys the same
9
+ * store as the process that spawned it, and its stderr is inherited — so a notice both printed was
10
+ * printed twice for one run.
11
+ *
12
+ * Who owes what:
13
+ *
14
+ * - **A config warning** — the invoking process. It loads the config itself in both invocations
15
+ * (`vat validate` to choose its phases, a standalone `vat resources check` to say whether the
16
+ * project declares checks of its own), so a supervised child never prints one.
17
+ * - **The store notice** — whichever process keys the store first. `vat validate` opens its store
18
+ * scope before any phase runs, so a child started as its phase stays quiet; a standalone
19
+ * `vat resources check` opens no store at all — keying one is a git snapshot, unbounded work a
20
+ * supervisor must not do before its watchdog exists — so the child it started prints it.
21
+ *
22
+ * The audience is decided ONCE, at the command's entry, from its explicit argv
23
+ * ({@link isSupervisedChild}), and entered as a scope ({@link withNoticeAudience}) the command's
24
+ * whole run sits inside. Nothing sets it as a side effect, and it ends with the scope — so a unit
25
+ * test, or a second command in one process, starts from "print everything".
26
+ *
27
+ * ## 🔑 "Once" belongs to the same scope
28
+ *
29
+ * A notice that would repeat — one config governing many skills, one unkeyable root asked about by
30
+ * every nested population scope — carries a `once` key, and the ledger that remembers it lives in
31
+ * the SAME scope as the audience: {@link withNoticeAudience} starts a fresh one, and so does the
32
+ * outermost population scope ({@link withNoticeLedger}) — starting from what was printed before it,
33
+ * so a config loaded both before and inside it warns once — so a second command in one process
34
+ * says it again. There is one ledger mechanism, not one per notice kind. Outside every scope (a config
35
+ * loaded before any population, a unit test) the ledger is the process's own, reset with the config
36
+ * cache ({@link resetUnscopedNoticeLedger}).
37
+ *
38
+ * ⚠️ Only NOTICES go through here: news that does not change what the run decides. A refusal's
39
+ * message, and anything that explains the document the child publishes, is the child's to print.
40
+ */
41
+ import { AsyncLocalStorage } from 'node:async_hooks';
42
+ /** Every notice — the audience of any process that is not a supervised child. */
43
+ export const EVERY_NOTICE = { config: true, store: true };
44
+ const noticeScope = new AsyncLocalStorage();
45
+ /** The `once` ledger outside every scope. */
46
+ const unscopedPrinted = new Set();
47
+ /**
48
+ * Is this process the child a supervisor spawned to run the checks?
49
+ *
50
+ * 🔑 The ONE predicate, read from the explicit argv: `--supervised-by` is what a supervisor hands
51
+ * its child and nothing else passes (the child refuses it unless its parent is the supervisor the
52
+ * value names). Every decision that turns on "am I the child" asks this — which process runs the
53
+ * checks, which prints the "no checks of its own" warning, which notices it owes.
54
+ *
55
+ * @param argv - The command's parsed options
56
+ * @param argv.supervisedBy - The hidden `--supervised-by` value, or undefined
57
+ * @returns True in the supervised child
58
+ */
59
+ export function isSupervisedChild(argv) {
60
+ return argv.supervisedBy !== undefined;
61
+ }
62
+ /**
63
+ * Run `work` with `audience` deciding which notices this process prints, and a fresh `once` ledger.
64
+ *
65
+ * @param audience - Which notices to print
66
+ * @param work - The command's run
67
+ * @returns Whatever `work` returned
68
+ */
69
+ export function withNoticeAudience(audience, work) {
70
+ return noticeScope.run({ audience, printed: new Set() }, work);
71
+ }
72
+ /**
73
+ * Run `work` inside a notice scope: the enclosing one when there is one, else a fresh scope that
74
+ * prints every notice — so `once` means once per command run, never once per process.
75
+ *
76
+ * 🚨 The fresh scope STARTS from what was already printed outside every scope, and copies it: a
77
+ * command loads its config before it opens its population scope (`vat validate`, to choose its
78
+ * phases) and again inside it, so a scope starting empty printed that config warning twice for one
79
+ * run. A copy, not the set itself, so what the scope prints stays its own and the next run says it
80
+ * again.
81
+ *
82
+ * @param work - The run
83
+ * @returns Whatever `work` returned
84
+ */
85
+ export function withNoticeLedger(work) {
86
+ return noticeScope.getStore() === undefined
87
+ ? noticeScope.run({ audience: EVERY_NOTICE, printed: new Set(unscopedPrinted) }, work)
88
+ : work();
89
+ }
90
+ /** Forget the `once` notices printed outside every scope — with the config cache they describe. */
91
+ export function resetUnscopedNoticeLedger() {
92
+ unscopedPrinted.clear();
93
+ }
94
+ /**
95
+ * Write one notice to the operator's stderr — unless the enclosing scope says another process owes
96
+ * it, or it carries a `once` key this scope has already printed.
97
+ *
98
+ * @param kind - What the notice is about
99
+ * @param message - The notice, without a trailing newline
100
+ * @param once - When set, print this notice at most once per scope for this key
101
+ */
102
+ export function noticeToOperator(kind, message, once) {
103
+ const scope = noticeScope.getStore();
104
+ if (!(scope?.audience ?? EVERY_NOTICE)[kind])
105
+ return;
106
+ if (once !== undefined) {
107
+ const printed = scope?.printed ?? unscopedPrinted;
108
+ const key = `${kind}:${once}`;
109
+ if (printed.has(key))
110
+ return;
111
+ printed.add(key);
112
+ }
113
+ process.stderr.write(`${message}\n`);
114
+ }
115
+ //# sourceMappingURL=operator-notices.js.map
@@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,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IACrC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,IAAI,YAAY,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO;IACrD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,eAAe,CAAC;QAClD,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO;QAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;AACvC,CAAC"}
@@ -21,6 +21,8 @@
21
21
  * error naming the package to install, and nothing more — the point is that
22
22
  * the failure is readable, not that it is survivable.
23
23
  */
24
+ import type { ReportVerb } from '../report-schemas.js';
25
+ import { CommandRefusalError } from './command-refusal.js';
24
26
  /**
25
27
  * Whether a thrown value is Node's "module not installed" error.
26
28
  *
@@ -32,23 +34,19 @@
32
34
  */
33
35
  export declare function isModuleMissing(error: unknown): boolean;
34
36
  /**
35
- * Report an uninstalled backend and exit, in the shape every other command
36
- * failure takes.
37
+ * The refusal for an uninstalled backend: `BACKEND_UNAVAILABLE`, exit **2** — a
38
+ * fact about the installation, not about the user's corpus, and a caller
39
+ * scripting `vat` must be able to tell those apart from the exit code alone.
37
40
  *
38
- * Exit code **2** — a system error, not a validation failure. An absent
39
- * optional package is a fact about the installation rather than about the
40
- * user's corpus, and a caller scripting `vat` must be able to tell those apart
41
- * from the exit code alone.
42
- *
43
- * Exported for the backends that are not selected by a Commander action —
44
- * {@link lazyAction} is the shape most take, but a store chosen by an
45
- * environment variable is loaded from inside a command rather than in place of
46
- * one, and it must fail the same way.
41
+ * Returned, not thrown and not written, so the verb that needed the backend
42
+ * publishes it in its own shape: {@link lazyAction} ends through the writer, and
43
+ * a store chosen from inside a command (the projection store) throws it into
44
+ * that command's catch.
47
45
  *
48
46
  * @param backend - What to name and how to install it
49
- * @returns Never; the process exits
47
+ * @returns The coded refusal; its message names the package and the install command
50
48
  */
51
- export declare function reportMissingBackend(backend: OptionalBackend): never;
49
+ export declare function missingBackendError(backend: OptionalBackend): CommandRefusalError;
52
50
  /** One optional backend, as a user is told to install it. */
53
51
  export interface OptionalBackend {
54
52
  /** Human name used in the error message, e.g. `RAG`. */
@@ -65,14 +63,19 @@ export interface OptionalBackend {
65
63
  * stay eagerly available, which is exactly why the split is at the action
66
64
  * rather than at the command.
67
65
  *
66
+ * An absent backend ends the run through the writer as `verb`'s
67
+ * `BACKEND_UNAVAILABLE` refusal — every leaf behind this seam is a report verb
68
+ * with no `--format` and no `--strict`, so the document is YAML and the gate fixed.
69
+ *
70
+ * @param verb - The report verb the action is, for the refusal document
68
71
  * @param backend - What to name in the error when the import fails to resolve
69
72
  * @param load - Imports the module and returns the handler out of it
70
73
  * @returns A Commander action that loads, then delegates
71
74
  *
72
75
  * @example
73
76
  * ```typescript
74
- * .action(lazyAction(RAG_BACKEND, async () => (await import('./index-command.js')).indexCommand))
77
+ * .action(lazyAction('rag index', RAG_BACKEND, async () => (await import('./index-command.js')).indexCommand))
75
78
  * ```
76
79
  */
77
- export declare function lazyAction<Args extends readonly unknown[]>(backend: OptionalBackend, load: () => Promise<(...args: Args) => unknown>): (...args: Args) => Promise<void>;
80
+ export declare function lazyAction<Args extends readonly unknown[]>(verb: ReportVerb, backend: OptionalBackend, load: () => Promise<(...args: Args) => unknown>): (...args: Args) => Promise<void>;
78
81
  //# sourceMappingURL=optional-backend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"optional-backend.d.ts","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAoBH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,K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IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAC9C,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAalC"}
@@ -21,12 +21,8 @@
21
21
  * error naming the package to install, and nothing more — the point is that
22
22
  * the failure is readable, not that it is survivable.
23
23
  */
24
- // Deliberately NOT `commands/rag/command-helpers.js`, which is where the rest
25
- // of the rag lane's shared helpers live: that module statically imports
26
- // `@vibe-agent-toolkit/rag-lancedb`, so reaching for its `handleCommandError`
27
- // here would load the very backend this file exists to defer.
28
- import { ExitCode } from '@vibe-agent-toolkit/schema';
29
- import { writeYamlOutput } from './output.js';
24
+ import { CommandRefusalError } from './command-refusal.js';
25
+ import { endWithRefusal, NOTHING_FINISHED } from './document-writer.js';
30
26
  /**
31
27
  * Node's code for "the module is genuinely not installed".
32
28
  *
@@ -52,34 +48,22 @@ export function isModuleMissing(error) {
52
48
  && error.code === MODULE_NOT_FOUND);
53
49
  }
54
50
  /**
55
- * Report an uninstalled backend and exit, in the shape every other command
56
- * failure takes.
51
+ * The refusal for an uninstalled backend: `BACKEND_UNAVAILABLE`, exit **2** — a
52
+ * fact about the installation, not about the user's corpus, and a caller
53
+ * scripting `vat` must be able to tell those apart from the exit code alone.
57
54
  *
58
- * Exit code **2** — a system error, not a validation failure. An absent
59
- * optional package is a fact about the installation rather than about the
60
- * user's corpus, and a caller scripting `vat` must be able to tell those apart
61
- * from the exit code alone.
62
- *
63
- * Exported for the backends that are not selected by a Commander action —
64
- * {@link lazyAction} is the shape most take, but a store chosen by an
65
- * environment variable is loaded from inside a command rather than in place of
66
- * one, and it must fail the same way.
55
+ * Returned, not thrown and not written, so the verb that needed the backend
56
+ * publishes it in its own shape: {@link lazyAction} ends through the writer, and
57
+ * a store chosen from inside a command (the projection store) throws it into
58
+ * that command's catch.
67
59
  *
68
60
  * @param backend - What to name and how to install it
69
- * @returns Never; the process exits
61
+ * @returns The coded refusal; its message names the package and the install command
70
62
  */
71
- export function reportMissingBackend(backend) {
72
- const install = `npm install ${backend.packageName}`;
73
- process.stderr.write(`${backend.feature} is an optional feature and its backend is not installed.\n`
74
- + `\nInstall it with: ${install}\n`
75
- + '\nIt ships separately because it carries a platform-native binary that every\n'
76
- + 'other vat command would otherwise download and load.\n');
77
- writeYamlOutput({
78
- status: 'error',
79
- error: `${backend.feature} backend not installed: ${backend.packageName}`,
80
- fix: install,
81
- });
82
- process.exit(ExitCode.ERROR);
63
+ export function missingBackendError(backend) {
64
+ return new CommandRefusalError('BACKEND_UNAVAILABLE', `${backend.feature} is an optional feature and its backend is not installed. `
65
+ + `Install it with: npm install ${backend.packageName} — it ships separately because it carries `
66
+ + 'a platform-native binary that every other vat command would otherwise download and load.');
83
67
  }
84
68
  /**
85
69
  * Bind a Commander action that loads its implementation on first invocation.
@@ -90,16 +74,21 @@ export function reportMissingBackend(backend) {
90
74
  * stay eagerly available, which is exactly why the split is at the action
91
75
  * rather than at the command.
92
76
  *
77
+ * An absent backend ends the run through the writer as `verb`'s
78
+ * `BACKEND_UNAVAILABLE` refusal — every leaf behind this seam is a report verb
79
+ * with no `--format` and no `--strict`, so the document is YAML and the gate fixed.
80
+ *
81
+ * @param verb - The report verb the action is, for the refusal document
93
82
  * @param backend - What to name in the error when the import fails to resolve
94
83
  * @param load - Imports the module and returns the handler out of it
95
84
  * @returns A Commander action that loads, then delegates
96
85
  *
97
86
  * @example
98
87
  * ```typescript
99
- * .action(lazyAction(RAG_BACKEND, async () => (await import('./index-command.js')).indexCommand))
88
+ * .action(lazyAction('rag index', RAG_BACKEND, async () => (await import('./index-command.js')).indexCommand))
100
89
  * ```
101
90
  */
102
- export function lazyAction(backend, load) {
91
+ export function lazyAction(verb, backend, load) {
103
92
  return async (...args) => {
104
93
  let handler;
105
94
  try {
@@ -109,7 +98,7 @@ export function lazyAction(backend, load) {
109
98
  if (!isModuleMissing(error)) {
110
99
  throw error;
111
100
  }
112
- reportMissingBackend(backend);
101
+ endWithRefusal(verb, 'BACKEND_UNAVAILABLE', missingBackendError(backend), 'yaml', { strict: false }, NOTHING_FINISHED);
113
102
  }
114
103
  await handler(...args);
115
104
  };
@@ -1 +1 @@
1
- {"version":3,"file":"optional-backend.js","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAC9E,8DAA8D;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;WACtB,KAAK,KAAK,IAAI;WACd,MAAM,IAAI,KAAK;WACd,KAA4B,CAAC,IAAI,KAAK,gBAAgB,CAC3D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,MAAM,OAAO,GAAG,eAAe,OAAO,CAAC,WAAW,EAAE,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,OAAO,CAAC,OAAO,6DAA6D;UAC7E,uBAAuB,OAAO,IAAI;UAClC,gFAAgF;UAChF,wDAAwD,CAC3D,CAAC;IACF,eAAe,CAAC;QACd,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,GAAG,OAAO,CAAC,OAAO,2BAA2B,OAAO,CAAC,WAAW,EAAE;QACzE,GAAG,EAAE,OAAO;KACb,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/B,C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;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,UAAU,CACxB,IAAgB,EAChB,OAAwB,EACxB,IAA+C;IAE/C,OAAO,KAAK,EAAE,GAAG,IAAU,EAAiB,EAAE;QAC5C,IAAI,OAA0C,CAAC;QAC/C,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,MAAM,KAAK,CAAC;YACd,CAAC;YACD,cAAc,CAAC,IAAI,EAAE,qBAAqB,EAAE,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,gBAAgB,CAAC,CAAC;QACzH,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC"}
@@ -57,51 +57,13 @@ export interface WriteAllSyncOptions {
57
57
  */
58
58
  export declare function writeAllSync(write: SyncWriter, buffer: Buffer, options?: WriteAllSyncOptions): void;
59
59
  /**
60
- * Write a single YAML document to stdout, opened with `---`.
60
+ * The one YAML rendering of a published document — on stdout and in a file
61
+ * artifact alike, so the same data never serializes two ways.
61
62
  *
62
- * There is deliberately NO trailing marker. `---` OPENS a document in YAML; the
63
- * end-of-document marker is `...`. Emitting `---` at the end therefore opened a
64
- * second, empty document, so every command's stdout was a two-document stream and
65
- * a plain `YAML.parse()` threw `Source contains multiple documents` — on output
66
- * this CLI documents as "YAML summary → stdout (for programmatic parsing)".
67
- *
68
- * The repo's own test helper had already been written around it: `executeCli…`
69
- * calls `parseAllDocuments(...)` and takes `docs[0]`, with a comment saying "to
70
- * handle document markers". That workaround is what kept the defect invisible —
71
- * every consumer that did the obvious thing instead got an exception.
72
- *
73
- * Dropping the trailer also makes this agree with the seven hand-rolled emit
74
- * sites elsewhere in the CLI, none of which ever wrote one.
75
- *
76
- * @param data - Data to serialize as YAML
77
- */
78
- export declare function writeYamlOutput(data: unknown): void;
79
- /**
80
- * Write a single JSON document to stdout.
81
- *
82
- * The sibling of {@link writeYamlOutput}, for the same payloads, and it exists
83
- * because a consumer that has to parse YAML needs a YAML parser: JSON is the
84
- * format every language reads without one. `vat resources validate` already
85
- * offers `--format json` for exactly this reason; a scan document that could
86
- * only be had as YAML made the population it reports the harder of the two to
87
- * consume programmatically, which is backwards.
88
- *
89
- * Written the same way as its YAML sibling, and the comment there applies
90
- * verbatim: the ordinary stream write keeps this summary behind any
91
- * human-readable progress already buffered on the same channel.
92
- *
93
- * @param data - Data to serialize as JSON
94
- */
95
- export declare function writeJsonOutput(data: unknown): void;
96
- /**
97
- * Write one structured document in the format a `--format` option selected:
98
- * `json` → {@link writeJsonOutput}; anything else (including an absent option)
99
- * → {@link writeYamlOutput}, the CLI's default document format.
100
- *
101
- * @param data - The document
102
- * @param format - The selected format (`json`, or anything else for YAML)
63
+ * @param data - Data to serialize
64
+ * @returns The YAML text, without a document marker
103
65
  */
104
- export declare function writeStructuredOutput(data: unknown, format: string | undefined): void;
66
+ export declare function renderYamlDocument(data: unknown): string;
105
67
  /**
106
68
  * Write a test-format finding to stderr.
107
69
  *
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAKrD;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAoCpF,MAAM,WAAW,mBAAmB;IAClC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,CAAC,kBAAkB,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E,UAAU,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAAwB,GAChC,IAAI,CA+BN;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAExD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,IAAI,CAEN"}
@@ -3,6 +3,7 @@
3
3
  * YAML output on stdout, logs on stderr
4
4
  */
5
5
  import { writeSync } from 'node:fs';
6
+ import { isWouldBlockError } from '@vibe-agent-toolkit/utils';
6
7
  import * as yaml from 'yaml';
7
8
  /**
8
9
  * Write `content` to stdout SYNCHRONOUSLY, in a loop until every byte is handed
@@ -97,7 +98,7 @@ export function writeAllSync(write, buffer, options = {}) {
97
98
  // A non-blocking pipe whose buffer is momentarily full raises EAGAIN; a
98
99
  // reader that is draining will free space, so retry. Anything else is a
99
100
  // genuine write failure.
100
- if (error.code !== 'EAGAIN')
101
+ if (!isWouldBlockError(error))
101
102
  throw error;
102
103
  consecutiveRetries++;
103
104
  if (consecutiveRetries > maxRetries) {
@@ -108,70 +109,14 @@ export function writeAllSync(write, buffer, options = {}) {
108
109
  }
109
110
  }
110
111
  /**
111
- * Write a single YAML document to stdout, opened with `---`.
112
+ * The one YAML rendering of a published document — on stdout and in a file
113
+ * artifact alike, so the same data never serializes two ways.
112
114
  *
113
- * There is deliberately NO trailing marker. `---` OPENS a document in YAML; the
114
- * end-of-document marker is `...`. Emitting `---` at the end therefore opened a
115
- * second, empty document, so every command's stdout was a two-document stream and
116
- * a plain `YAML.parse()` threw `Source contains multiple documents` — on output
117
- * this CLI documents as "YAML summary → stdout (for programmatic parsing)".
118
- *
119
- * The repo's own test helper had already been written around it: `executeCli…`
120
- * calls `parseAllDocuments(...)` and takes `docs[0]`, with a comment saying "to
121
- * handle document markers". That workaround is what kept the defect invisible —
122
- * every consumer that did the obvious thing instead got an exception.
123
- *
124
- * Dropping the trailer also makes this agree with the seven hand-rolled emit
125
- * sites elsewhere in the CLI, none of which ever wrote one.
126
- *
127
- * @param data - Data to serialize as YAML
115
+ * @param data - Data to serialize
116
+ * @returns The YAML text, without a document marker
128
117
  */
129
- export function writeYamlOutput(data) {
130
- // Deliberately the ordinary stream write, NOT writeStdoutSync: this summary
131
- // follows human-readable progress output written via console.log, and a
132
- // synchronous fd-1 write would jump ahead of anything still buffered there.
133
- // Completeness is guaranteed instead by makeStdioBlocking() at startup, which
134
- // makes BOTH channels synchronous and keeps them in order.
135
- process.stdout.write(`---\n${yaml.stringify(data, {
136
- indent: 2,
137
- lineWidth: 120,
138
- aliasDuplicateObjects: false,
139
- })}`);
140
- }
141
- /**
142
- * Write a single JSON document to stdout.
143
- *
144
- * The sibling of {@link writeYamlOutput}, for the same payloads, and it exists
145
- * because a consumer that has to parse YAML needs a YAML parser: JSON is the
146
- * format every language reads without one. `vat resources validate` already
147
- * offers `--format json` for exactly this reason; a scan document that could
148
- * only be had as YAML made the population it reports the harder of the two to
149
- * consume programmatically, which is backwards.
150
- *
151
- * Written the same way as its YAML sibling, and the comment there applies
152
- * verbatim: the ordinary stream write keeps this summary behind any
153
- * human-readable progress already buffered on the same channel.
154
- *
155
- * @param data - Data to serialize as JSON
156
- */
157
- export function writeJsonOutput(data) {
158
- process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
159
- }
160
- /**
161
- * Write one structured document in the format a `--format` option selected:
162
- * `json` → {@link writeJsonOutput}; anything else (including an absent option)
163
- * → {@link writeYamlOutput}, the CLI's default document format.
164
- *
165
- * @param data - The document
166
- * @param format - The selected format (`json`, or anything else for YAML)
167
- */
168
- export function writeStructuredOutput(data, format) {
169
- if (format === 'json') {
170
- writeJsonOutput(data);
171
- }
172
- else {
173
- writeYamlOutput(data);
174
- }
118
+ export function renderYamlDocument(data) {
119
+ return yaml.stringify(data, { indent: 2, lineWidth: 120, aliasDuplicateObjects: false });
175
120
  }
176
121
  /**
177
122
  * Write a test-format finding to stderr.
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,YAAY,CACV,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAChE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAC7B,CAAC;AACJ,CAAC;AAUD;;;;;;;;;GASG;AACH,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAE9C,uEAAuE;AACvE,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,SAAS,SAAS,CAAC,EAAU;IAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,SAAS,yBAAyB,CAAC,kBAA0B;IAC3D,IAAI,kBAAkB,GAAG,mBAAmB;QAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAiB,EACjB,MAAc,EACd,UAA+B,EAAE;IAEjC,MAAM,UAAU,GAAG,OAAO,CAAC,qBAAqB,IAAI,8BAA8B,CAAC;IACnF,MAAM,IAAI,GAAG,OAAO,CAAC,kBAAkB,IAAI,yBAAyB,CAAC;IAErE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AAC,iBAAiB,CAAC,KAAK,CAAC;gBAAE,MAAM,KAAK,CAAC;YAC3C,kBAAkB,EAAE,CAAC;YACrB,IAAI,kBAAkB,GAAG,UAAU,EAAE,CAAC;gBACpC,MAAM,IAAI,KAAK,CACb,kBAAkB,UAAU,sDAAsD,OAAO,OAAO,MAAM,CAAC,MAAM,8CAA8C,CAC5J,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3F,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,IAAY,EACZ,MAAc,EACd,QAAgB,EAChB,OAAe;IAEf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC;AAC/E,CAAC"}
@@ -15,10 +15,9 @@
15
15
  /**
16
16
  * The parsed manifest, or `undefined` when there is none at `pkgPath`.
17
17
  *
18
- * @throws {Error} naming the file when it exists but is not a JSON object;
19
- * the parse error is the `cause`.
20
- * @throws whatever the filesystem threw for anything that is not an absence
21
- * (a refusal stays a refusal).
18
+ * @throws {CommandRefusalError} `INPUT_UNREADABLE` naming the file when it
19
+ * exists but is not a JSON object (the parse error is the `cause`), or when
20
+ * the OS refused the read (a refusal stays a refusal, never an absence).
22
21
  */
23
22
  export declare function readPackageJsonOrAbsent(pkgPath: string): Record<string, unknown> | undefined;
24
23
  //# sourceMappingURL=package-json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../src/utils/package-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAoB5F"}
1
+ {"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../src/utils/package-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAoB5F"}
@@ -13,14 +13,14 @@
13
13
  * already broken; the reader's job is to say so, not to proceed around it.
14
14
  */
15
15
  import { readFileSync } from 'node:fs';
16
- import { isPathAbsentError } from '@vibe-agent-toolkit/utils';
16
+ import { classifyFsFault, isPathAbsentError } from '@vibe-agent-toolkit/utils';
17
+ import { CommandRefusalError } from './command-refusal.js';
17
18
  /**
18
19
  * The parsed manifest, or `undefined` when there is none at `pkgPath`.
19
20
  *
20
- * @throws {Error} naming the file when it exists but is not a JSON object;
21
- * the parse error is the `cause`.
22
- * @throws whatever the filesystem threw for anything that is not an absence
23
- * (a refusal stays a refusal).
21
+ * @throws {CommandRefusalError} `INPUT_UNREADABLE` naming the file when it
22
+ * exists but is not a JSON object (the parse error is the `cause`), or when
23
+ * the OS refused the read (a refusal stays a refusal, never an absence).
24
24
  */
25
25
  export function readPackageJsonOrAbsent(pkgPath) {
26
26
  let raw;
@@ -30,7 +30,7 @@ export function readPackageJsonOrAbsent(pkgPath) {
30
30
  catch (error) {
31
31
  if (isPathAbsentError(error))
32
32
  return undefined;
33
- throw error;
33
+ throw classifyFsFault(error, { side: 'source', origin: 'content', action: 'read package.json', path: pkgPath });
34
34
  }
35
35
  let parsed;
36
36
  try {
@@ -39,10 +39,10 @@ export function readPackageJsonOrAbsent(pkgPath) {
39
39
  catch (error) {
40
40
  if (!(error instanceof SyntaxError))
41
41
  throw error;
42
- throw new Error(`${pkgPath} is not valid JSON: ${error.message}`, { cause: error });
42
+ throw new CommandRefusalError('INPUT_UNREADABLE', `${pkgPath} is not valid JSON: ${error.message}`, { cause: error });
43
43
  }
44
44
  if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
45
- throw new Error(`${pkgPath} is not a JSON object, so it is not a package manifest`);
45
+ throw new CommandRefusalError('INPUT_UNREADABLE', `${pkgPath} is not a JSON object, so it is not a package manifest`);
46
46
  }
47
47
  return parsed;
48
48
  }