@vibe-agent-toolkit/cli 0.2.0-rc.10 → 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 +94 -40
  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 +94 -40
  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 +31 -63
  87. package/dist/commands/ard/emit.d.ts.map +1 -1
  88. package/dist/commands/ard/emit.js +124 -68
  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 +17 -10
  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 +415 -397
  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 +87 -2
  148. package/dist/commands/claude/context.d.ts.map +1 -1
  149. package/dist/commands/claude/context.js +116 -57
  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 +13 -10
  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 -145
  355. package/dist/commands/okf/validate.d.ts.map +1 -1
  356. package/dist/commands/okf/validate.js +63 -52
  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 +79 -13
  404. package/dist/commands/resources/check-progress.d.ts.map +1 -1
  405. package/dist/commands/resources/check-progress.js +112 -11
  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 +329 -71
  412. package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
  413. package/dist/commands/resources/check-supervisor.js +507 -107
  414. package/dist/commands/resources/check-supervisor.js.map +1 -1
  415. package/dist/commands/resources/check.d.ts +88 -254
  416. package/dist/commands/resources/check.d.ts.map +1 -1
  417. package/dist/commands/resources/check.js +537 -310
  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 +189 -103
  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 +18 -13
  427. package/dist/commands/resources/query.d.ts.map +1 -1
  428. package/dist/commands/resources/query.js +61 -49
  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 -77
  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 -28
  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 +44 -5
  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 +18 -11
  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 +78 -32
  665. package/dist/utils/resource-loader.d.ts.map +1 -1
  666. package/dist/utils/resource-loader.js +134 -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 +17 -20
  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 +228 -107
  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 +280 -118
  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 -189
  753. package/dist/utils/command-error.d.ts.map +0 -1
  754. package/dist/utils/command-error.js +0 -230
  755. package/dist/utils/command-error.js.map +0 -1
@@ -0,0 +1,319 @@
1
+ /**
2
+ * The ONE writer of a `vat` command's stdout document.
3
+ *
4
+ * Every shape a command publishes is registered in `report-schemas.ts`, and
5
+ * this module is how it leaves: the document is looked up by verb, passed
6
+ * through the run-integrity refusal the registry's denominator declares,
7
+ * validated against its own published schema, rendered as yaml, json or text,
8
+ * and — for the `end…` functions — the process ends on the code the WRITTEN
9
+ * document derives. `local/no-stdout-outside-writer` keeps every other route
10
+ * to stdout out of `commands/`.
11
+ *
12
+ * 🔑 **Validated before a byte leaves.** A document the published schema
13
+ * rejects is a defect in VAT, and it throws here — the last resort ends it on
14
+ * `ERROR` — rather than shipping a shape an adopter's parser was promised
15
+ * would never appear.
16
+ */
17
+ import { writeFileSync } from 'node:fs';
18
+ import { buildErrorReport, CODE_REGISTRY, errorDiagnostics, exitCodeForReport, } from '@vibe-agent-toolkit/schema';
19
+ import { isFsFaultError, suppressedFaultsOf, TREE_CLEANUP_INCOMPLETE_CODE } from '@vibe-agent-toolkit/utils';
20
+ import { parse as parseYaml } from 'yaml';
21
+ import { artifactShapeFor, exitCodeForExternal, reportShapeFor, } from '../report-schemas.js';
22
+ import { errorMessageOf, refusalCodeOf, withFsFaultRemedy } from './command-refusal.js';
23
+ import { debugDiagnosticsEnabled } from './debug-diagnostics.js';
24
+ import { renderYamlDocument, writeStdoutSync } from './output.js';
25
+ import { withRunIntegrity } from './run-integrity.js';
26
+ /** One finding as a compiler-style line: `location:line:column: severity: message [code]`. */
27
+ function findingLine(finding) {
28
+ const anchor = [finding.location, finding.line, finding.column].filter((part) => part !== undefined).join(':');
29
+ const line = `${finding.severity}: ${finding.message} [${finding.code}]`;
30
+ return anchor === '' ? line : `${anchor}: ${line}`;
31
+ }
32
+ /**
33
+ * The generic `--format text` rendering: one line per finding, then the status
34
+ * line with the counts and the denominator.
35
+ */
36
+ function renderReportText(report, unit) {
37
+ const { errors, warnings, info } = report.summary;
38
+ const lines = report.findings.map(findingLine);
39
+ if (report.status === 'error')
40
+ lines.push(`error: ${report.error.message} [${report.error.code}]`);
41
+ lines.push(`status: ${report.status} — ${errors} errors, ${warnings} warnings, ${info} info (examined ${report.examined} ${unit})`);
42
+ return `${lines.join('\n')}\n`;
43
+ }
44
+ /**
45
+ * Write `document` in a structured format — `text` has no structure, so it is YAML.
46
+ *
47
+ * YAML opens with `---` and has NO trailing marker: `---` opens a document, so a
48
+ * trailer made every stdout a two-document stream a plain `YAML.parse()` refused.
49
+ *
50
+ * The ordinary stream write, not {@link writeStdoutSync}: a document follows
51
+ * progress written through `console.log`, and a synchronous fd-1 write would
52
+ * jump ahead of anything still buffered there. `makeStdioBlocking()` at startup
53
+ * makes both channels synchronous, so nothing is lost at `process.exit`.
54
+ */
55
+ function writeStructured(document, format) {
56
+ process.stdout.write(format === 'json' ? `${JSON.stringify(document, null, 2)}\n` : `---\n${renderYamlDocument(document)}`);
57
+ }
58
+ /**
59
+ * The document a report verb publishes, without writing it: the run-integrity
60
+ * refusal its registered denominator declares, then its published schema.
61
+ *
62
+ * For a lane that needs the published document before writing it — a command
63
+ * that warns on stderr with the refusal the writer adds. {@link writeDocument}
64
+ * goes through it too. (A phase of `vat build` / `validate` / `verify` hands
65
+ * back its report BEFORE this pass: the orchestrator judges zero examined on
66
+ * the whole run.)
67
+ *
68
+ * @param verb - The registered verb
69
+ * @param report - The document as the verb built it
70
+ * @returns The document as published
71
+ * @throws When the verb is unregistered or its schema rejects the document (a defect)
72
+ */
73
+ export function publishedReport(verb, report) {
74
+ const entry = reportShapeFor(verb);
75
+ const published = withRunIntegrity(report, entry.examined);
76
+ entry.schema.parse(published);
77
+ return published;
78
+ }
79
+ /**
80
+ * Publish a report verb's document.
81
+ *
82
+ * @param verb - The registered verb, as typed after `vat`
83
+ * @param report - The document as the verb built it
84
+ * @param format - How to render it
85
+ * @returns The document actually written — after the run-integrity refusal
86
+ * @throws When the verb is unregistered or its schema rejects the document (a defect)
87
+ */
88
+ export function writeDocument(verb, report, format) {
89
+ const entry = reportShapeFor(verb);
90
+ const written = publishedReport(verb, report);
91
+ if (format === 'text') {
92
+ const text = entry.renderText === undefined
93
+ ? renderReportText(written, entry.examined.unit)
94
+ : entry.renderText(written);
95
+ if (text !== '')
96
+ process.stdout.write(text);
97
+ }
98
+ else {
99
+ writeStructured(written, format);
100
+ }
101
+ return written;
102
+ }
103
+ /**
104
+ * Publish a report verb's document and end on the code it derives.
105
+ *
106
+ * @param verb - The registered verb
107
+ * @param report - The document as the verb built it
108
+ * @param format - How to render it
109
+ */
110
+ export function endWithReport(verb, report, format) {
111
+ process.exit(exitCodeForReport(writeDocument(verb, report, format)));
112
+ }
113
+ /** The explicit "nothing finished" — spelled out at the call site, never defaulted. */
114
+ export const NOTHING_FINISHED = Object.freeze({ examined: 0, findings: [], data: null });
115
+ /**
116
+ * Publish the envelope's error branch — the run could not do its job — with
117
+ * whatever finished, and end on `ERROR`.
118
+ *
119
+ * The message also goes to stderr, where a human reads it; `INTERNAL_ERROR`
120
+ * adds the stack, since that one is VAT's defect to report, and under
121
+ * `--debug` every refusal does — the flag exists to name the throw site.
122
+ *
123
+ * @param verb - The registered verb
124
+ * @param code - Which refusal: `USAGE_INVALID` for the invocation's mistake,
125
+ * `INPUT_UNREADABLE` for an input that cannot be read, `INTERNAL_ERROR` only
126
+ * for a failure VAT did not anticipate
127
+ * @param error - The thrown value, or the message
128
+ * @param format - How to render the document
129
+ * @param gate - The gate the run was judged by
130
+ * @param finished - The work that finished, or {@link NOTHING_FINISHED}
131
+ */
132
+ export function endWithRefusal(verb, code, error, format, gate, finished) {
133
+ process.exit(exitCodeForReport(writeDocument(verb, refusalReport(code, error, gate, finished), format)));
134
+ }
135
+ /**
136
+ * A refusal's human half: its message on stderr — the code's own description
137
+ * when the thrown value carries none — plus the stack for a VAT defect, or for
138
+ * any refusal under `--debug`, which exists to name the throw site.
139
+ *
140
+ * @returns The message the published document carries
141
+ */
142
+ function announceRefusal(code, error) {
143
+ const raw = errorMessageOf(error);
144
+ const message = raw === '' ? CODE_REGISTRY[code].description : withFsFaultRemedy(raw, error);
145
+ process.stderr.write(`${message}\n`);
146
+ if (code === 'INTERNAL_ERROR' || debugDiagnosticsEnabled())
147
+ process.stderr.write(`${errorDiagnostics(error)}\n`);
148
+ return message;
149
+ }
150
+ /**
151
+ * The envelope's error branch for a refusal, with its human half already on
152
+ * stderr — what {@link endWithRefusal} writes, for the lane that hands the
153
+ * report on instead (a phase an orchestrator folds, or an orchestrator's own
154
+ * refusal).
155
+ *
156
+ * @param code - Which refusal (see {@link endWithRefusal})
157
+ * @param error - The thrown value, or the message
158
+ * @param gate - The gate the run was judged by
159
+ * @param finished - The work that finished, or {@link NOTHING_FINISHED}
160
+ * @returns The error report, not yet published
161
+ */
162
+ export function refusalReport(code, error, gate, finished) {
163
+ const message = announceRefusal(code, error);
164
+ return buildErrorReport({
165
+ error: { code, message },
166
+ gate,
167
+ examined: finished.examined,
168
+ findings: [...finished.findings, ...leftoverFindingsOf(error)],
169
+ data: finished.data,
170
+ });
171
+ }
172
+ /**
173
+ * What the failure path could not clean up — a temporary directory, a staged tree —
174
+ * recorded beside the thrown error (`suppressedFaultsOf`), as warnings naming each.
175
+ * Recorded beside, never on its cause chain: a leftover is never the run's refusal.
176
+ */
177
+ export function leftoverFindingsOf(error) {
178
+ return suppressedFaultsOf(error).map((fault) => {
179
+ process.stderr.write(`warning: ${errorMessageOf(fault)}\n`);
180
+ return leftoverIssueOf(fault);
181
+ });
182
+ }
183
+ /**
184
+ * The {@link leftoverIssue} a failure to remove something stands for: its message, and — for a
185
+ * classified fault — the path it names (the entry left).
186
+ *
187
+ * @param fault - What the removal threw: a parked entry an uninstall or a clear could not delete
188
+ * (`applyTreePlanOrLeftover`'s `leftover`), or a suppressed fault beside a refusal
189
+ */
190
+ export function leftoverIssueOf(fault) {
191
+ return leftoverIssue(errorMessageOf(fault), isFsFaultError(fault) ? fault.path : undefined);
192
+ }
193
+ /**
194
+ * Something a run made and could not remove — a temporary directory, a staged or parked tree —
195
+ * as the ONE warning every lane names it with ({@link TREE_CLEANUP_INCOMPLETE_CODE}), whether the
196
+ * run then refused or finished.
197
+ *
198
+ * @param message - What was left, and why it stayed
199
+ * @param path - The entry left, when known: its `link`
200
+ */
201
+ export function leftoverIssue(message, path) {
202
+ return {
203
+ code: TREE_CLEANUP_INCOMPLETE_CODE,
204
+ severity: 'warning',
205
+ message,
206
+ // `link`, never `location`: a report's location is project-relative, and this is an absolute path (a temp dir, a staged tree).
207
+ ...(path === undefined ? {} : { link: path }),
208
+ fix: 'Remove what the message names yourself, making it writable first if the OS refused; nothing VAT made uses it.',
209
+ };
210
+ }
211
+ /**
212
+ * Read a report verb's document another `vat` process already wrote — a
213
+ * supervised child — checking it IS that verb's document: parsed in the format
214
+ * it was asked for and validated against the published schema.
215
+ *
216
+ * @param verb - The registered verb whose document `text` claims to be
217
+ * @param text - The document as the child wrote it
218
+ * @param format - The format the child was asked for
219
+ * @returns The text with the report it parses to, for {@link endWithForwardedDocument}
220
+ * @throws When `text` does not parse, or its schema rejects it — a truncated
221
+ * write among them, which the caller decides how to report
222
+ */
223
+ export function readForwardedDocument(verb, text, format) {
224
+ const parsed = format === 'json' ? JSON.parse(text) : parseYaml(text);
225
+ reportShapeFor(verb).schema.parse(parsed);
226
+ return { text, report: parsed };
227
+ }
228
+ /**
229
+ * Publish a forwarded document byte for byte and end on the code the document
230
+ * derives — never on the code the process that wrote it happened to exit with.
231
+ *
232
+ * @param document - What {@link readForwardedDocument} accepted
233
+ */
234
+ export function endWithForwardedDocument(document) {
235
+ writeStdoutSync(document.text);
236
+ process.exit(exitCodeForReport(document.report));
237
+ }
238
+ /**
239
+ * Publish an externally owned payload verbatim and end on the code its
240
+ * registered adapter maps `outcome` to.
241
+ *
242
+ * @param verb - A verb of an `external` entry
243
+ * @param payload - The payload as its owner shaped it
244
+ * @param format - How to render it (`text` renders YAML)
245
+ * @param outcome - What the external write did
246
+ */
247
+ export function writeExternalDocument(verb, payload, format, outcome) {
248
+ writeStructured(payload, format);
249
+ process.exit(exitCodeForExternal(verb, outcome));
250
+ }
251
+ /**
252
+ * End an external verb whose run threw: publish `{ error: { code, message } }`
253
+ * — the one failure payload every external verb shares, since the payload it
254
+ * would have passed through never arrived — and end on the code its adapter
255
+ * maps `failed` to. The code is the thrown value's own ({@link refusalCodeOf}):
256
+ * a missing key or a bad argument is `USAGE_INVALID`, a refused or unanswered
257
+ * API call `EXTERNAL_API_FAILED`, anything uncoded `INTERNAL_ERROR`.
258
+ *
259
+ * @param verb - A verb of an `external` entry
260
+ * @param error - What the run threw
261
+ * @param format - How to render the payload
262
+ */
263
+ export function endWithExternalRefusal(verb, error, format) {
264
+ const code = refusalCodeOf(error);
265
+ const message = announceRefusal(code, error);
266
+ writeExternalDocument(verb, { error: { code, message } }, format, { kind: 'failed', cause: message });
267
+ }
268
+ /**
269
+ * The one serializer for a `legacy` entry's document: unvalidated, and typed
270
+ * to the legacy verbs so no report verb can take this path.
271
+ *
272
+ * @param _verb - A verb of a `legacy` entry
273
+ * @param document - The legacy document
274
+ * @param format - How to render it
275
+ * @param text - The verb's own `--format text` rendering, written as-is; with
276
+ * none (a refusal has no human rendering of its own) `text` renders YAML.
277
+ * Required, so a caller says which it means
278
+ */
279
+ export function writeLegacyDocument(_verb, document, format, text) {
280
+ // The verb's TYPE is the guarantee — only a legacy verb compiles here.
281
+ if (format === 'text' && text !== undefined) {
282
+ // Synchronously, as `claude context` always wrote it: its text can run long and the verb exits straight after.
283
+ writeStdoutSync(text);
284
+ return;
285
+ }
286
+ writeStructured(document, format);
287
+ }
288
+ /** Validate a payload against its artifact entry's schema, when it declares one. */
289
+ function validatedArtifact(name, channel, payload) {
290
+ artifactShapeFor(name, channel).schema?.parse(payload);
291
+ }
292
+ /**
293
+ * Publish a stdout artifact — a config to paste, a file's text — and nothing else.
294
+ *
295
+ * @param name - The registered stdout artifact
296
+ * @param payload - The artifact; a string for `raw`
297
+ * @param format - `yaml` / `json`, or `raw` to write a string as-is
298
+ */
299
+ export function writeArtifact(name, payload, format) {
300
+ validatedArtifact(name, 'stdout', payload);
301
+ if (format === 'raw') {
302
+ process.stdout.write(String(payload));
303
+ return;
304
+ }
305
+ writeStructured(payload, format);
306
+ }
307
+ /**
308
+ * Write a registered file artifact: YAML for a `.yaml`/`.yml` path, JSON otherwise.
309
+ *
310
+ * @param name - The registered file artifact
311
+ * @param path - Where to write it
312
+ * @param payload - The artifact
313
+ */
314
+ export function writeArtifactFile(name, path, payload) {
315
+ validatedArtifact(name, 'file', payload);
316
+ const text = /\.ya?ml$/.test(path) ? renderYamlDocument(payload) : `${JSON.stringify(payload, null, 2)}\n`;
317
+ writeFileSync(path, text, 'utf-8');
318
+ }
319
+ //# sourceMappingURL=document-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-writer.js","sourceRoot":"","sources":["../../src/utils/document-writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EACL,gBAAgB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tC,OAAO;IACT,CAAC;IACD,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,IAAY,EAAE,OAAgB;IAC5E,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IAC3G,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
@@ -24,8 +24,8 @@ export declare function loadVerboseHelp(section?: string): string;
24
24
  * handed to the pipe, so `process.exit` has nothing left to lose.
25
25
  *
26
26
  * The loop itself now lives in `output.ts` as `writeStdoutSync`, because the very
27
- * same defect was later found in `writeYamlOutput` — every command's YAML summary
28
- * was being truncated at one pipe buffer. Two copies of this reasoning is exactly
27
+ * same defect was later found in the command-document writer — every command's
28
+ * YAML summary was being truncated at one pipe buffer. Two copies of this reasoning is exactly
29
29
  * how the second lane went unfixed for so long, so there is one.
30
30
  */
31
31
  export declare function writeHelpSync(content: string): void;
@@ -52,8 +52,8 @@ Please report this issue at: https://github.com/jdutton/vibe-agent-toolkit/issue
52
52
  * handed to the pipe, so `process.exit` has nothing left to lose.
53
53
  *
54
54
  * The loop itself now lives in `output.ts` as `writeStdoutSync`, because the very
55
- * same defect was later found in `writeYamlOutput` — every command's YAML summary
56
- * was being truncated at one pipe buffer. Two copies of this reasoning is exactly
55
+ * same defect was later found in the command-document writer — every command's
56
+ * YAML summary was being truncated at one pipe buffer. Two copies of this reasoning is exactly
57
57
  * how the second lane went unfixed for so long, so there is one.
58
58
  */
59
59
  export function writeHelpSync(content) {
@@ -0,0 +1,99 @@
1
+ /**
2
+ * What the flat-skill install verbs — `vat claude plugin install` (its skill lanes), `vat agent install` and
3
+ * `vat skills install` — share about planning an install onto the tree-change primitive: the
4
+ * one change a skill copy is, the one link policy of a tree an install copies from, the one
5
+ * refusal an occupied destination is, and the one way an archive's `$TMPDIR` staging is disposed of.
6
+ */
7
+ import { type SkillZipEntry } from '@vibe-agent-toolkit/agent-skills';
8
+ import type { ValidationIssue } from '@vibe-agent-toolkit/schema';
9
+ import { type FsSide, type LinkPolicy, type Ownership, type TreeChange } from '@vibe-agent-toolkit/utils';
10
+ /** The ownership of a skill destination: `--force` takes whatever is there; otherwise it must be free. */
11
+ export declare function skillOwnership(force: boolean): Ownership;
12
+ /**
13
+ * The link policy of a tree an install copies from, by the side it is on.
14
+ *
15
+ * - `environment` — VAT's own staging, holding what the archive module extracted: files and
16
+ * directories, never a link. So a link found there is `refuse`d — never followed, never
17
+ * copied — and an archive lane cannot install what its archive did not hold.
18
+ * - anything else — a directory the operator named. Its links are kept as links (`preserve`),
19
+ * each already held inside the tree it is copied with ({@link installUnit}).
20
+ */
21
+ export declare function installLinks(side: FsSide): LinkPolicy;
22
+ /** Where an install reads from: the directory the operator named (or VAT's staging), and the side it is on. */
23
+ interface InstallSourceTree {
24
+ readonly root: string;
25
+ readonly side: FsSide;
26
+ }
27
+ /**
28
+ * One tree an install is about to copy — a skill, a marketplace, a plugin — as the directory to
29
+ * copy it from, refused when copying it would install something its source does not hold.
30
+ *
31
+ * A staged tree (`environment`) is returned as it is: it holds no link ({@link installLinks}).
32
+ * A tree in the operator's own directory is judged twice, because a copy keeps its links as
33
+ * links, verbatim:
34
+ *
35
+ * - `dir` itself may be a link (a skill directory linked into `dist/skills/`), but only to
36
+ * somewhere inside the directory the operator named;
37
+ * - no link inside it may lead outside it — `keys -> ../../../secret` stays inside the package
38
+ * it was written in and points at the installing user's own files once it is installed.
39
+ *
40
+ * @param tree - The directory the operator named, and its side
41
+ * @param dir - The tree to copy: `tree.root` or a directory found under it
42
+ * @param what - What the tree is, for the refusal: `the skill directory`
43
+ * @returns The directory to copy from: `dir`, or for an operator's tree its real path, so the copy's root is never a link
44
+ * @throws VatError `COPY_LINK_ESCAPES_SOURCE` (`INPUT_UNREADABLE`) naming the link; FsFaultError on
45
+ * the tree's side when the OS refuses to examine it
46
+ */
47
+ export declare function installUnit(tree: InstallSourceTree, dir: string, what: string): string;
48
+ /**
49
+ * One skill copied whole into place, every read of `source` classified on `side` — the
50
+ * operator's tree (`source`) or VAT's own staging an archive was extracted into (`environment`)
51
+ * — and its links held to that side's policy ({@link installLinks}).
52
+ */
53
+ export declare function skillCopyChange(skill: {
54
+ readonly name: string;
55
+ readonly source: string;
56
+ readonly dest: string;
57
+ }, side: FsSide, force: boolean): TreeChange;
58
+ /**
59
+ * Where the skill is inside a skill ZIP, by the ONE layout rule every verb that takes one shares
60
+ * (`skillZipLayout`: `SKILL.md` at the top level, or directly inside the archive's single
61
+ * top-level folder) — or the refusal of an archive that is neither. The archive is the input, so
62
+ * the refusal is `INPUT_UNREADABLE`, decided from the entry list before anything is installed or sent.
63
+ *
64
+ * @param zipPath - The archive the operator named, for the message
65
+ * @param entries - Every entry of the archive, as `extractArchive` / `openArchive` list them
66
+ * @returns The folder the skill is in, relative to the archive's top level: `''`, or the one top-level folder
67
+ * @throws CommandRefusalError `INPUT_UNREADABLE`
68
+ */
69
+ export declare function requireSkillZipLayout(zipPath: string, entries: readonly SkillZipEntry[]): string;
70
+ /**
71
+ * Extract a skill ZIP into `into`, a fresh staging directory, and answer where the skill is in it.
72
+ * The ONE extraction of a skill ZIP, for every verb that takes one: held to the archive policy and
73
+ * limits, to the one layout rule ({@link requireSkillZipLayout}), and written WITHOUT what the
74
+ * host that made the archive added beside the skill (`hostAddedToSkillZip`: a top-level
75
+ * `__MACOSX/`, a `.DS_Store`) — the layout rule does not count those, so nothing installs or
76
+ * sends them.
77
+ *
78
+ * @param zipPath - The archive the operator named
79
+ * @param into - VAT's staging directory to extract into
80
+ * @returns The skill's directory: `into`, or the archive's one top-level folder under it
81
+ * @throws ArchiveRefusedError or CommandRefusalError (`INPUT_UNREADABLE`) for an archive VAT does not
82
+ * take, with nothing written; FsFaultError as `extractArchive` raises it
83
+ */
84
+ export declare function extractSkillZip(zipPath: string, into: string): Promise<string>;
85
+ /** A destination taken without `--force`, as the invocation's refusal saying how to proceed; anything else as itself. */
86
+ export declare function occupiedRefusal(error: unknown): unknown;
87
+ /**
88
+ * Run `work` in a fresh staging directory under `$TMPDIR` (`withTempDir`), disposed of after. A
89
+ * directory that will not go once `work` finished is not a refusal of the install it outlived:
90
+ * it is handed to `onLeftover` as the warning naming it. A failure of `work` is rethrown, the
91
+ * staging's own leftover recorded beside it (`suppressedFaultsOf`).
92
+ *
93
+ * @param prefix - The `mkdtemp` prefix, so a leaked directory names its owner
94
+ * @param work - Given the staging directory
95
+ * @param onLeftover - Given the warning for a staging directory that outlived a finished `work`
96
+ */
97
+ export declare function inStaging(prefix: string, work: (dir: string) => Promise<void>, onLeftover: (issue: ValidationIssue) => void): Promise<void>;
98
+ export {};
99
+ //# sourceMappingURL=install-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-plan.d.ts","sourceRoot":"","sources":["../../src/utils/install-plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAkB,MAAM,kCAAkC,CAAC;AAC3G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAEL,KAAK,MAAM,EAGX,KAAK,UAAU,EAEf,KAAK,SAAS,EAKd,KAAK,UAAU,EAKhB,MAAM,2BAA2B,CAAC;AAMnC,0GAA0G;AAC1G,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAExD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAErD;AAED,+GAA+G;AAC/G,UAAU,iBAAiB;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAoBtF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAQ1J;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAIhG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGpF;AAED,yHAAyH;AACzH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGvD;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAOjJ"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * What the flat-skill install verbs — `vat claude plugin install` (its skill lanes), `vat agent install` and
3
+ * `vat skills install` — share about planning an install onto the tree-change primitive: the
4
+ * one change a skill copy is, the one link policy of a tree an install copies from, the one
5
+ * refusal an occupied destination is, and the one way an archive's `$TMPDIR` staging is disposed of.
6
+ */
7
+ import { hostAddedToSkillZip, skillZipLayout } from '@vibe-agent-toolkit/agent-skills';
8
+ import { CopyLinkEscapesSourceError, HOST_PATH_FLAVOR, isVatError, normalizePath, refuseEscapingLinks, safePath, toForwardSlash, TREE_DEST_OCCUPIED_CODE, treeChain, treeContainment, withFsFaultSync, withTempDir, } from '@vibe-agent-toolkit/utils';
9
+ import { ARCHIVE_LIMITS, extractArchive } from '@vibe-agent-toolkit/utils/archive';
10
+ import { CommandRefusalError, errorMessageOf } from './command-refusal.js';
11
+ import { leftoverIssue } from './document-writer.js';
12
+ /** The ownership of a skill destination: `--force` takes whatever is there; otherwise it must be free. */
13
+ export function skillOwnership(force) {
14
+ return force ? { kind: 'force' } : { kind: 'must-be-free' };
15
+ }
16
+ /**
17
+ * The link policy of a tree an install copies from, by the side it is on.
18
+ *
19
+ * - `environment` — VAT's own staging, holding what the archive module extracted: files and
20
+ * directories, never a link. So a link found there is `refuse`d — never followed, never
21
+ * copied — and an archive lane cannot install what its archive did not hold.
22
+ * - anything else — a directory the operator named. Its links are kept as links (`preserve`),
23
+ * each already held inside the tree it is copied with ({@link installUnit}).
24
+ */
25
+ export function installLinks(side) {
26
+ return side === 'environment' ? 'refuse' : 'preserve';
27
+ }
28
+ /**
29
+ * One tree an install is about to copy — a skill, a marketplace, a plugin — as the directory to
30
+ * copy it from, refused when copying it would install something its source does not hold.
31
+ *
32
+ * A staged tree (`environment`) is returned as it is: it holds no link ({@link installLinks}).
33
+ * A tree in the operator's own directory is judged twice, because a copy keeps its links as
34
+ * links, verbatim:
35
+ *
36
+ * - `dir` itself may be a link (a skill directory linked into `dist/skills/`), but only to
37
+ * somewhere inside the directory the operator named;
38
+ * - no link inside it may lead outside it — `keys -> ../../../secret` stays inside the package
39
+ * it was written in and points at the installing user's own files once it is installed.
40
+ *
41
+ * @param tree - The directory the operator named, and its side
42
+ * @param dir - The tree to copy: `tree.root` or a directory found under it
43
+ * @param what - What the tree is, for the refusal: `the skill directory`
44
+ * @returns The directory to copy from: `dir`, or for an operator's tree its real path, so the copy's root is never a link
45
+ * @throws VatError `COPY_LINK_ESCAPES_SOURCE` (`INPUT_UNREADABLE`) naming the link; FsFaultError on
46
+ * the tree's side when the OS refuses to examine it
47
+ */
48
+ export function installUnit(tree, dir, what) {
49
+ if (tree.side === 'environment')
50
+ return dir;
51
+ return withFsFaultSync({ side: tree.side, origin: 'content', action: `examine the links of ${what} ${dir}`, path: dir }, () => {
52
+ // `dir` may itself be a link, or below one: its chain is read by text first (the one resolver),
53
+ // so the kernel never resolves a link to a network path, or one leaving the tree, to answer this.
54
+ if (treeChain(tree.root, dir, HOST_PATH_FLAVOR).kind === 'refused')
55
+ throw new CopyLinkEscapesSourceError(dir, tree.root);
56
+ // An absent `dir` is not this check's to name: resolving it below raises the OS's own answer.
57
+ if (treeContainment(tree.root, dir) === 'outside')
58
+ throw new CopyLinkEscapesSourceError(dir, tree.root);
59
+ const real = toForwardSlash(normalizePath(dir, tree.root));
60
+ refuseEscapingLinks({
61
+ root: real,
62
+ placement: 'relocated',
63
+ side: tree.side,
64
+ flavor: HOST_PATH_FLAVOR,
65
+ tree: `${what} ${dir}`,
66
+ within: 'it',
67
+ consequence: 'An install keeps a link as a link, so once installed this one would point at files its source does not hold',
68
+ });
69
+ return real;
70
+ });
71
+ }
72
+ /**
73
+ * One skill copied whole into place, every read of `source` classified on `side` — the
74
+ * operator's tree (`source`) or VAT's own staging an archive was extracted into (`environment`)
75
+ * — and its links held to that side's policy ({@link installLinks}).
76
+ */
77
+ export function skillCopyChange(skill, side, force) {
78
+ return {
79
+ op: 'replace',
80
+ dest: skill.dest,
81
+ ownership: skillOwnership(force),
82
+ fill: { from: 'copy', source: skill.source, side, links: installLinks(side) },
83
+ label: `skill ${skill.name}`,
84
+ };
85
+ }
86
+ /**
87
+ * Where the skill is inside a skill ZIP, by the ONE layout rule every verb that takes one shares
88
+ * (`skillZipLayout`: `SKILL.md` at the top level, or directly inside the archive's single
89
+ * top-level folder) — or the refusal of an archive that is neither. The archive is the input, so
90
+ * the refusal is `INPUT_UNREADABLE`, decided from the entry list before anything is installed or sent.
91
+ *
92
+ * @param zipPath - The archive the operator named, for the message
93
+ * @param entries - Every entry of the archive, as `extractArchive` / `openArchive` list them
94
+ * @returns The folder the skill is in, relative to the archive's top level: `''`, or the one top-level folder
95
+ * @throws CommandRefusalError `INPUT_UNREADABLE`
96
+ */
97
+ export function requireSkillZipLayout(zipPath, entries) {
98
+ const layout = skillZipLayout(entries);
99
+ if ('refused' in layout)
100
+ throw new CommandRefusalError('INPUT_UNREADABLE', `${zipPath} is not a skill ZIP, nothing was changed: ${layout.refused}.`);
101
+ return layout.root;
102
+ }
103
+ /**
104
+ * Extract a skill ZIP into `into`, a fresh staging directory, and answer where the skill is in it.
105
+ * The ONE extraction of a skill ZIP, for every verb that takes one: held to the archive policy and
106
+ * limits, to the one layout rule ({@link requireSkillZipLayout}), and written WITHOUT what the
107
+ * host that made the archive added beside the skill (`hostAddedToSkillZip`: a top-level
108
+ * `__MACOSX/`, a `.DS_Store`) — the layout rule does not count those, so nothing installs or
109
+ * sends them.
110
+ *
111
+ * @param zipPath - The archive the operator named
112
+ * @param into - VAT's staging directory to extract into
113
+ * @returns The skill's directory: `into`, or the archive's one top-level folder under it
114
+ * @throws ArchiveRefusedError or CommandRefusalError (`INPUT_UNREADABLE`) for an archive VAT does not
115
+ * take, with nothing written; FsFaultError as `extractArchive` raises it
116
+ */
117
+ export async function extractSkillZip(zipPath, into) {
118
+ const entries = await extractArchive({ file: zipPath, side: 'source' }, into, { format: 'zip', limits: ARCHIVE_LIMITS, omit: (entry) => hostAddedToSkillZip(entry.name) });
119
+ return safePath.join(into, requireSkillZipLayout(zipPath, entries));
120
+ }
121
+ /** A destination taken without `--force`, as the invocation's refusal saying how to proceed; anything else as itself. */
122
+ export function occupiedRefusal(error) {
123
+ if (!isVatError(error, TREE_DEST_OCCUPIED_CODE))
124
+ return error;
125
+ return new CommandRefusalError('USAGE_INVALID', `Something already exists where the install goes: ${error.message}. Use --force to overwrite.`, { cause: error });
126
+ }
127
+ /**
128
+ * Run `work` in a fresh staging directory under `$TMPDIR` (`withTempDir`), disposed of after. A
129
+ * directory that will not go once `work` finished is not a refusal of the install it outlived:
130
+ * it is handed to `onLeftover` as the warning naming it. A failure of `work` is rethrown, the
131
+ * staging's own leftover recorded beside it (`suppressedFaultsOf`).
132
+ *
133
+ * @param prefix - The `mkdtemp` prefix, so a leaked directory names its owner
134
+ * @param work - Given the staging directory
135
+ * @param onLeftover - Given the warning for a staging directory that outlived a finished `work`
136
+ */
137
+ export async function inStaging(prefix, work, onLeftover) {
138
+ const { value: stagedIn, leftover } = await withTempDir(prefix, async (dir) => {
139
+ await work(dir);
140
+ return dir;
141
+ });
142
+ if (leftover === undefined)
143
+ return;
144
+ onLeftover(leftoverIssue(`The install is complete, but its staging directory ${stagedIn} could not be removed: ${errorMessageOf(leftover)}`, stagedIn));
145
+ }
146
+ //# sourceMappingURL=install-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-plan.js","sourceRoot":"","sources":["../../src/utils/install-plan.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAsB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAE3G,OAAO,EACL,0BAA0B,EAE1B,gBAAgB,EAChB,UAAU,EAEV,aAAa,EAEb,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,uBAAuB,EAEvB,SAAS,EACT,eAAe,EACf,eAAe,EACf,WAAW,GACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,0GAA0G;AAC1G,MAAM,UAAU,cAAc,CAAC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AAC;IAC3K,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,uBAAuB,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9D,OAAO,IAAI,mBAAmB,CAAC,eAAe,EAAE,oDAAoD,KAAK,CAAC,OAAO,6BAA6B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACpK,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,MAAc,EAAE,IAAoC,EAAE,UAA4C;IAChI,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC5E,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;IACH,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO;IACnC,UAAU,CAAC,aAAa,CAAC,sDAAsD,QAAQ,0BAA0B,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC1J,CAAC"}
@@ -22,5 +22,5 @@ import type { ValidationIssue } from '@vibe-agent-toolkit/schema';
22
22
  * Returns `undefined` when the issue carries no anchor at all, so callers can
23
23
  * skip the line entirely rather than print an empty label.
24
24
  */
25
- export declare function formatIssueAnchor(issue: ValidationIssue): string | undefined;
25
+ export declare function formatIssueAnchor(issue: Pick<ValidationIssue, 'location' | 'line' | 'field'>): string | undefined;
26
26
  //# sourceMappingURL=issue-anchor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"issue-anchor.d.ts","sourceRoot":"","sources":["../../src/utils/issue-anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAe5E"}
1
+ {"version":3,"file":"issue-anchor.d.ts","sourceRoot":"","sources":["../../src/utils/issue-anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,MAAM,GAAG,SAAS,CAejH"}
@@ -1 +1 @@
1
- {"version":3,"file":"issue-anchor.js","sourceRoot":"","sources":["../../src/utils/issue-anchor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAsB;IACtD,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,EAAE,CAAC;IAC1E,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;IACjE,IAAI,CAAC,WAAW,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,GAAG,WAAW,CAAC,CAAC,CAAE,KAAK,CAAC,QAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAC7C,CAAC;IACD,IAAI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