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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/README.md +4 -5
  2. package/dist/bin/vat +95 -28
  3. package/dist/bin/vat.js +95 -28
  4. package/dist/bin/vat.js.map +1 -1
  5. package/dist/bin.js +115 -76
  6. package/dist/bin.js.map +1 -1
  7. package/dist/command-loaders.d.ts +44 -0
  8. package/dist/command-loaders.d.ts.map +1 -0
  9. package/dist/command-loaders.js +60 -0
  10. package/dist/command-loaders.js.map +1 -0
  11. package/dist/commands/agent/build.d.ts.map +1 -1
  12. package/dist/commands/agent/build.js +2 -1
  13. package/dist/commands/agent/build.js.map +1 -1
  14. package/dist/commands/agent/import.d.ts.map +1 -1
  15. package/dist/commands/agent/import.js +3 -2
  16. package/dist/commands/agent/import.js.map +1 -1
  17. package/dist/commands/agent/index.js +1 -1
  18. package/dist/commands/agent/install-path.d.ts +36 -0
  19. package/dist/commands/agent/install-path.d.ts.map +1 -0
  20. package/dist/commands/agent/install-path.js +44 -0
  21. package/dist/commands/agent/install-path.js.map +1 -0
  22. package/dist/commands/agent/install.d.ts.map +1 -1
  23. package/dist/commands/agent/install.js +66 -13
  24. package/dist/commands/agent/install.js.map +1 -1
  25. package/dist/commands/agent/installed.d.ts.map +1 -1
  26. package/dist/commands/agent/installed.js +22 -12
  27. package/dist/commands/agent/installed.js.map +1 -1
  28. package/dist/commands/agent/list.d.ts.map +1 -1
  29. package/dist/commands/agent/list.js +2 -1
  30. package/dist/commands/agent/list.js.map +1 -1
  31. package/dist/commands/agent/run.d.ts.map +1 -1
  32. package/dist/commands/agent/run.js +2 -1
  33. package/dist/commands/agent/run.js.map +1 -1
  34. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  35. package/dist/commands/agent/uninstall.js +13 -6
  36. package/dist/commands/agent/uninstall.js.map +1 -1
  37. package/dist/commands/agent/validate.d.ts.map +1 -1
  38. package/dist/commands/agent/validate.js +3 -2
  39. package/dist/commands/agent/validate.js.map +1 -1
  40. package/dist/commands/ard/emit.d.ts +153 -0
  41. package/dist/commands/ard/emit.d.ts.map +1 -0
  42. package/dist/commands/ard/emit.js +276 -0
  43. package/dist/commands/ard/emit.js.map +1 -0
  44. package/dist/commands/ard/index.d.ts +12 -0
  45. package/dist/commands/ard/index.d.ts.map +1 -0
  46. package/dist/commands/ard/index.js +80 -0
  47. package/dist/commands/ard/index.js.map +1 -0
  48. package/dist/commands/ard/surfaces.d.ts +56 -0
  49. package/dist/commands/ard/surfaces.d.ts.map +1 -0
  50. package/dist/commands/ard/surfaces.js +150 -0
  51. package/dist/commands/ard/surfaces.js.map +1 -0
  52. package/dist/commands/audit/distributed-tree.d.ts +2 -2
  53. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  54. package/dist/commands/audit/distributed-tree.js +11 -7
  55. package/dist/commands/audit/distributed-tree.js.map +1 -1
  56. package/dist/commands/audit/git-url-clone.d.ts +1 -1
  57. package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
  58. package/dist/commands/audit/git-url-clone.js.map +1 -1
  59. package/dist/commands/audit/hierarchical-output.d.ts +1 -1
  60. package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
  61. package/dist/commands/audit/hierarchical-output.js +1 -1
  62. package/dist/commands/audit/hierarchical-output.js.map +1 -1
  63. package/dist/commands/audit/provenance.d.ts.map +1 -1
  64. package/dist/commands/audit/provenance.js +4 -3
  65. package/dist/commands/audit/provenance.js.map +1 -1
  66. package/dist/commands/audit/scan-population.d.ts +158 -0
  67. package/dist/commands/audit/scan-population.d.ts.map +1 -0
  68. package/dist/commands/audit/scan-population.js +292 -0
  69. package/dist/commands/audit/scan-population.js.map +1 -0
  70. package/dist/commands/audit-settings.d.ts.map +1 -1
  71. package/dist/commands/audit-settings.js +6 -5
  72. package/dist/commands/audit-settings.js.map +1 -1
  73. package/dist/commands/audit.d.ts +98 -8
  74. package/dist/commands/audit.d.ts.map +1 -1
  75. package/dist/commands/audit.js +1126 -394
  76. package/dist/commands/audit.js.map +1 -1
  77. package/dist/commands/build.d.ts +1 -1
  78. package/dist/commands/build.d.ts.map +1 -1
  79. package/dist/commands/build.js +40 -36
  80. package/dist/commands/build.js.map +1 -1
  81. package/dist/commands/cache/cache-control.d.ts +82 -0
  82. package/dist/commands/cache/cache-control.d.ts.map +1 -0
  83. package/dist/commands/cache/cache-control.js +86 -0
  84. package/dist/commands/cache/cache-control.js.map +1 -0
  85. package/dist/commands/cache/clear.d.ts +34 -6
  86. package/dist/commands/cache/clear.d.ts.map +1 -1
  87. package/dist/commands/cache/clear.js +101 -15
  88. package/dist/commands/cache/clear.js.map +1 -1
  89. package/dist/commands/cache/index.d.ts +13 -63
  90. package/dist/commands/cache/index.d.ts.map +1 -1
  91. package/dist/commands/cache/index.js +47 -79
  92. package/dist/commands/cache/index.js.map +1 -1
  93. package/dist/commands/claude/claude-config.d.ts.map +1 -1
  94. package/dist/commands/claude/claude-config.js +6 -0
  95. package/dist/commands/claude/claude-config.js.map +1 -1
  96. package/dist/commands/claude/context.d.ts +340 -0
  97. package/dist/commands/claude/context.d.ts.map +1 -0
  98. package/dist/commands/claude/context.js +1080 -0
  99. package/dist/commands/claude/context.js.map +1 -0
  100. package/dist/commands/claude/index.d.ts +14 -0
  101. package/dist/commands/claude/index.d.ts.map +1 -1
  102. package/dist/commands/claude/index.js +22 -2
  103. package/dist/commands/claude/index.js.map +1 -1
  104. package/dist/commands/claude/marketplace/changelog-utils.d.ts +1 -1
  105. package/dist/commands/claude/marketplace/changelog-utils.d.ts.map +1 -1
  106. package/dist/commands/claude/marketplace/changelog-utils.js +1 -2
  107. package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
  108. package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
  109. package/dist/commands/claude/marketplace/git-publish.js +40 -31
  110. package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
  111. package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
  112. package/dist/commands/claude/marketplace/license-utils.js +0 -1
  113. package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
  114. package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
  115. package/dist/commands/claude/marketplace/publish-tree.js +0 -6
  116. package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
  117. package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
  118. package/dist/commands/claude/marketplace/publish.js +2 -1
  119. package/dist/commands/claude/marketplace/publish.js.map +1 -1
  120. package/dist/commands/claude/marketplace/validate.d.ts +73 -22
  121. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  122. package/dist/commands/claude/marketplace/validate.js +407 -72
  123. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  124. package/dist/commands/claude/org/api-keys.d.ts +0 -3
  125. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  126. package/dist/commands/claude/org/api-keys.js +2 -1
  127. package/dist/commands/claude/org/api-keys.js.map +1 -1
  128. package/dist/commands/claude/org/helpers.d.ts +54 -1
  129. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  130. package/dist/commands/claude/org/helpers.js +42 -7
  131. package/dist/commands/claude/org/helpers.js.map +1 -1
  132. package/dist/commands/claude/org/index.d.ts.map +1 -1
  133. package/dist/commands/claude/org/index.js +24 -16
  134. package/dist/commands/claude/org/index.js.map +1 -1
  135. package/dist/commands/claude/org/invites.d.ts +0 -3
  136. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  137. package/dist/commands/claude/org/invites.js +3 -2
  138. package/dist/commands/claude/org/invites.js.map +1 -1
  139. package/dist/commands/claude/org/skills.d.ts +527 -0
  140. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  141. package/dist/commands/claude/org/skills.js +1414 -108
  142. package/dist/commands/claude/org/skills.js.map +1 -1
  143. package/dist/commands/claude/org/users.d.ts +0 -3
  144. package/dist/commands/claude/org/users.d.ts.map +1 -1
  145. package/dist/commands/claude/org/users.js +6 -3
  146. package/dist/commands/claude/org/users.js.map +1 -1
  147. package/dist/commands/claude/org/workspaces.d.ts +0 -3
  148. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  149. package/dist/commands/claude/org/workspaces.js +11 -7
  150. package/dist/commands/claude/org/workspaces.js.map +1 -1
  151. package/dist/commands/claude/plugin/build.d.ts +41 -3
  152. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  153. package/dist/commands/claude/plugin/build.js +147 -80
  154. package/dist/commands/claude/plugin/build.js.map +1 -1
  155. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  156. package/dist/commands/claude/plugin/helpers.js +2 -7
  157. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  158. package/dist/commands/claude/plugin/install.d.ts +12 -0
  159. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  160. package/dist/commands/claude/plugin/install.js +93 -62
  161. package/dist/commands/claude/plugin/install.js.map +1 -1
  162. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  163. package/dist/commands/claude/plugin/list.js +3 -2
  164. package/dist/commands/claude/plugin/list.js.map +1 -1
  165. package/dist/commands/claude/plugin/marketplace-json.d.ts +24 -9
  166. package/dist/commands/claude/plugin/marketplace-json.d.ts.map +1 -1
  167. package/dist/commands/claude/plugin/marketplace-json.js +10 -9
  168. package/dist/commands/claude/plugin/marketplace-json.js.map +1 -1
  169. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  170. package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
  171. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  172. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  173. package/dist/commands/claude/plugin/plugin-files.js +3 -6
  174. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  175. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  176. package/dist/commands/claude/plugin/plugin-validators.js +3 -6
  177. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  178. package/dist/commands/claude/plugin/tree-copy.d.ts +73 -0
  179. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  180. package/dist/commands/claude/plugin/tree-copy.js +221 -14
  181. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  182. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  183. package/dist/commands/claude/plugin/uninstall.js +4 -4
  184. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  185. package/dist/commands/consistency-check.d.ts +17 -15
  186. package/dist/commands/consistency-check.d.ts.map +1 -1
  187. package/dist/commands/consistency-check.js +152 -106
  188. package/dist/commands/consistency-check.js.map +1 -1
  189. package/dist/commands/corpus/index.d.ts.map +1 -1
  190. package/dist/commands/corpus/index.js +3 -0
  191. package/dist/commands/corpus/index.js.map +1 -1
  192. package/dist/commands/corpus/report.d.ts +1 -2
  193. package/dist/commands/corpus/report.d.ts.map +1 -1
  194. package/dist/commands/corpus/report.js +1 -3
  195. package/dist/commands/corpus/report.js.map +1 -1
  196. package/dist/commands/corpus/runner.d.ts +58 -1
  197. package/dist/commands/corpus/runner.d.ts.map +1 -1
  198. package/dist/commands/corpus/runner.js +95 -41
  199. package/dist/commands/corpus/runner.js.map +1 -1
  200. package/dist/commands/corpus/scan.d.ts.map +1 -1
  201. package/dist/commands/corpus/scan.js +20 -12
  202. package/dist/commands/corpus/scan.js.map +1 -1
  203. package/dist/commands/corpus/seed.d.ts +4 -4
  204. package/dist/commands/corpus/seed.d.ts.map +1 -1
  205. package/dist/commands/corpus/seed.js +1 -3
  206. package/dist/commands/corpus/seed.js.map +1 -1
  207. package/dist/commands/doctor.d.ts +50 -0
  208. package/dist/commands/doctor.d.ts.map +1 -1
  209. package/dist/commands/doctor.js +245 -52
  210. package/dist/commands/doctor.js.map +1 -1
  211. package/dist/commands/inventory.d.ts +13 -1
  212. package/dist/commands/inventory.d.ts.map +1 -1
  213. package/dist/commands/inventory.js +121 -17
  214. package/dist/commands/inventory.js.map +1 -1
  215. package/dist/commands/mcp/collections.d.ts +1 -1
  216. package/dist/commands/mcp/collections.d.ts.map +1 -1
  217. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  218. package/dist/commands/mcp/list-collections.js +2 -1
  219. package/dist/commands/mcp/list-collections.js.map +1 -1
  220. package/dist/commands/mcp/serve.d.ts.map +1 -1
  221. package/dist/commands/mcp/serve.js +3 -2
  222. package/dist/commands/mcp/serve.js.map +1 -1
  223. package/dist/commands/okf/index.d.ts +11 -0
  224. package/dist/commands/okf/index.d.ts.map +1 -0
  225. package/dist/commands/okf/index.js +114 -0
  226. package/dist/commands/okf/index.js.map +1 -0
  227. package/dist/commands/okf/validate.d.ts +191 -0
  228. package/dist/commands/okf/validate.d.ts.map +1 -0
  229. package/dist/commands/okf/validate.js +190 -0
  230. package/dist/commands/okf/validate.js.map +1 -0
  231. package/dist/commands/phase-utils.d.ts +182 -114
  232. package/dist/commands/phase-utils.d.ts.map +1 -1
  233. package/dist/commands/phase-utils.js +154 -163
  234. package/dist/commands/phase-utils.js.map +1 -1
  235. package/dist/commands/positional-args.d.ts.map +1 -1
  236. package/dist/commands/positional-args.js +3 -2
  237. package/dist/commands/positional-args.js.map +1 -1
  238. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  239. package/dist/commands/rag/clear-command.js +2 -1
  240. package/dist/commands/rag/clear-command.js.map +1 -1
  241. package/dist/commands/rag/index-command.d.ts +64 -0
  242. package/dist/commands/rag/index-command.d.ts.map +1 -1
  243. package/dist/commands/rag/index-command.js +72 -6
  244. package/dist/commands/rag/index-command.js.map +1 -1
  245. package/dist/commands/rag/index.d.ts.map +1 -1
  246. package/dist/commands/rag/index.js +23 -10
  247. package/dist/commands/rag/index.js.map +1 -1
  248. package/dist/commands/rag/query-command.d.ts.map +1 -1
  249. package/dist/commands/rag/query-command.js +2 -1
  250. package/dist/commands/rag/query-command.js.map +1 -1
  251. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  252. package/dist/commands/rag/stats-command.js +2 -1
  253. package/dist/commands/rag/stats-command.js.map +1 -1
  254. package/dist/commands/resources/builtin-help.d.ts +27 -0
  255. package/dist/commands/resources/builtin-help.d.ts.map +1 -0
  256. package/dist/commands/resources/builtin-help.js +46 -0
  257. package/dist/commands/resources/builtin-help.js.map +1 -0
  258. package/dist/commands/resources/check-progress.d.ts +154 -0
  259. package/dist/commands/resources/check-progress.d.ts.map +1 -0
  260. package/dist/commands/resources/check-progress.js +222 -0
  261. package/dist/commands/resources/check-progress.js.map +1 -0
  262. package/dist/commands/resources/check-supervisor.d.ts +465 -0
  263. package/dist/commands/resources/check-supervisor.d.ts.map +1 -0
  264. package/dist/commands/resources/check-supervisor.js +573 -0
  265. package/dist/commands/resources/check-supervisor.js.map +1 -0
  266. package/dist/commands/resources/check.d.ts +593 -0
  267. package/dist/commands/resources/check.d.ts.map +1 -0
  268. package/dist/commands/resources/check.js +1365 -0
  269. package/dist/commands/resources/check.js.map +1 -0
  270. package/dist/commands/resources/index.d.ts.map +1 -1
  271. package/dist/commands/resources/index.js +418 -4
  272. package/dist/commands/resources/index.js.map +1 -1
  273. package/dist/commands/resources/query.d.ts +106 -0
  274. package/dist/commands/resources/query.d.ts.map +1 -0
  275. package/dist/commands/resources/query.js +177 -0
  276. package/dist/commands/resources/query.js.map +1 -0
  277. package/dist/commands/resources/scan.d.ts +24 -0
  278. package/dist/commands/resources/scan.d.ts.map +1 -1
  279. package/dist/commands/resources/scan.js +17 -8
  280. package/dist/commands/resources/scan.js.map +1 -1
  281. package/dist/commands/resources/validate.d.ts +42 -2
  282. package/dist/commands/resources/validate.d.ts.map +1 -1
  283. package/dist/commands/resources/validate.js +208 -55
  284. package/dist/commands/resources/validate.js.map +1 -1
  285. package/dist/commands/skill/review-checklist.d.ts +3 -2
  286. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  287. package/dist/commands/skill/review-checklist.js +40 -2
  288. package/dist/commands/skill/review-checklist.js.map +1 -1
  289. package/dist/commands/skill/review.d.ts +247 -0
  290. package/dist/commands/skill/review.d.ts.map +1 -1
  291. package/dist/commands/skill/review.js +99 -62
  292. package/dist/commands/skill/review.js.map +1 -1
  293. package/dist/commands/skill/test/configure.d.ts +56 -0
  294. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  295. package/dist/commands/skill/test/configure.js +75 -16
  296. package/dist/commands/skill/test/configure.js.map +1 -1
  297. package/dist/commands/skill/test/run.d.ts +63 -10
  298. package/dist/commands/skill/test/run.d.ts.map +1 -1
  299. package/dist/commands/skill/test/run.js +258 -77
  300. package/dist/commands/skill/test/run.js.map +1 -1
  301. package/dist/commands/skills/build.d.ts +94 -4
  302. package/dist/commands/skills/build.d.ts.map +1 -1
  303. package/dist/commands/skills/build.js +325 -97
  304. package/dist/commands/skills/build.js.map +1 -1
  305. package/dist/commands/skills/install.d.ts +2 -1
  306. package/dist/commands/skills/install.d.ts.map +1 -1
  307. package/dist/commands/skills/install.js +20 -31
  308. package/dist/commands/skills/install.js.map +1 -1
  309. package/dist/commands/skills/list.d.ts +2 -1
  310. package/dist/commands/skills/list.d.ts.map +1 -1
  311. package/dist/commands/skills/list.js +44 -26
  312. package/dist/commands/skills/list.js.map +1 -1
  313. package/dist/commands/skills/package.d.ts +1 -1
  314. package/dist/commands/skills/package.d.ts.map +1 -1
  315. package/dist/commands/skills/package.js +6 -8
  316. package/dist/commands/skills/package.js.map +1 -1
  317. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  318. package/dist/commands/skills/scope-guard.js +3 -5
  319. package/dist/commands/skills/scope-guard.js.map +1 -1
  320. package/dist/commands/skills/shared.d.ts.map +1 -1
  321. package/dist/commands/skills/shared.js +2 -4
  322. package/dist/commands/skills/shared.js.map +1 -1
  323. package/dist/commands/skills/skill-discovery.d.ts +47 -6
  324. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  325. package/dist/commands/skills/skill-discovery.js +61 -11
  326. package/dist/commands/skills/skill-discovery.js.map +1 -1
  327. package/dist/commands/skills/source-resolvers.d.ts +15 -0
  328. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  329. package/dist/commands/skills/source-resolvers.js +25 -4
  330. package/dist/commands/skills/source-resolvers.js.map +1 -1
  331. package/dist/commands/skills/validate-command.d.ts.map +1 -1
  332. package/dist/commands/skills/validate-command.js +11 -3
  333. package/dist/commands/skills/validate-command.js.map +1 -1
  334. package/dist/commands/skills/validate.d.ts +140 -4
  335. package/dist/commands/skills/validate.d.ts.map +1 -1
  336. package/dist/commands/skills/validate.js +224 -67
  337. package/dist/commands/skills/validate.js.map +1 -1
  338. package/dist/commands/validate.d.ts +1 -1
  339. package/dist/commands/validate.d.ts.map +1 -1
  340. package/dist/commands/validate.js +63 -27
  341. package/dist/commands/validate.js.map +1 -1
  342. package/dist/commands/verify.d.ts +119 -15
  343. package/dist/commands/verify.d.ts.map +1 -1
  344. package/dist/commands/verify.js +357 -142
  345. package/dist/commands/verify.js.map +1 -1
  346. package/dist/index.d.ts +0 -1
  347. package/dist/index.d.ts.map +1 -1
  348. package/dist/index.js +5 -1
  349. package/dist/index.js.map +1 -1
  350. package/dist/report-schemas.d.ts +45 -0
  351. package/dist/report-schemas.d.ts.map +1 -0
  352. package/dist/report-schemas.js +100 -0
  353. package/dist/report-schemas.js.map +1 -0
  354. package/dist/skill-resolution/classify.js +2 -2
  355. package/dist/skill-resolution/classify.js.map +1 -1
  356. package/dist/skill-resolution/packaging-config.d.ts +49 -5
  357. package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
  358. package/dist/skill-resolution/packaging-config.js +59 -19
  359. package/dist/skill-resolution/packaging-config.js.map +1 -1
  360. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  361. package/dist/skill-resolution/resolve-skill-reference.js +55 -57
  362. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  363. package/dist/utils/agent-discovery.d.ts.map +1 -1
  364. package/dist/utils/agent-discovery.js +22 -11
  365. package/dist/utils/agent-discovery.js.map +1 -1
  366. package/dist/utils/agent-runner.d.ts.map +1 -1
  367. package/dist/utils/agent-runner.js +7 -4
  368. package/dist/utils/agent-runner.js.map +1 -1
  369. package/dist/utils/claude-context-lens.d.ts +34 -0
  370. package/dist/utils/claude-context-lens.d.ts.map +1 -0
  371. package/dist/utils/claude-context-lens.js +39 -0
  372. package/dist/utils/claude-context-lens.js.map +1 -0
  373. package/dist/utils/command-error.d.ts +138 -20
  374. package/dist/utils/command-error.d.ts.map +1 -1
  375. package/dist/utils/command-error.js +172 -36
  376. package/dist/utils/command-error.js.map +1 -1
  377. package/dist/utils/config-loader.d.ts +2 -1
  378. package/dist/utils/config-loader.d.ts.map +1 -1
  379. package/dist/utils/config-loader.js +40 -14
  380. package/dist/utils/config-loader.js.map +1 -1
  381. package/dist/utils/corpus-target.d.ts +26 -0
  382. package/dist/utils/corpus-target.d.ts.map +1 -0
  383. package/dist/utils/corpus-target.js +35 -0
  384. package/dist/utils/corpus-target.js.map +1 -0
  385. package/dist/utils/edge-lens-evaluation.d.ts +83 -0
  386. package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
  387. package/dist/utils/edge-lens-evaluation.js +110 -0
  388. package/dist/utils/edge-lens-evaluation.js.map +1 -0
  389. package/dist/utils/help-loader.d.ts.map +1 -1
  390. package/dist/utils/help-loader.js +0 -1
  391. package/dist/utils/help-loader.js.map +1 -1
  392. package/dist/utils/issue-anchor.d.ts +2 -2
  393. package/dist/utils/issue-anchor.d.ts.map +1 -1
  394. package/dist/utils/issue-anchor.js +1 -1
  395. package/dist/utils/issue-rendering.d.ts +3 -3
  396. package/dist/utils/issue-rendering.d.ts.map +1 -1
  397. package/dist/utils/issue-rendering.js +3 -3
  398. package/dist/utils/issue-rendering.js.map +1 -1
  399. package/dist/utils/issue-severity.d.ts +12 -5
  400. package/dist/utils/issue-severity.d.ts.map +1 -1
  401. package/dist/utils/issue-severity.js +1 -1
  402. package/dist/utils/issue-severity.js.map +1 -1
  403. package/dist/utils/optional-backend.d.ts +78 -0
  404. package/dist/utils/optional-backend.d.ts.map +1 -0
  405. package/dist/utils/optional-backend.js +117 -0
  406. package/dist/utils/optional-backend.js.map +1 -0
  407. package/dist/utils/output.d.ts +26 -0
  408. package/dist/utils/output.d.ts.map +1 -1
  409. package/dist/utils/output.js +35 -0
  410. package/dist/utils/output.js.map +1 -1
  411. package/dist/utils/package-json.d.ts +24 -0
  412. package/dist/utils/package-json.d.ts.map +1 -0
  413. package/dist/utils/package-json.js +49 -0
  414. package/dist/utils/package-json.js.map +1 -0
  415. package/dist/utils/population-wiring.d.ts +100 -0
  416. package/dist/utils/population-wiring.d.ts.map +1 -0
  417. package/dist/utils/population-wiring.js +98 -0
  418. package/dist/utils/population-wiring.js.map +1 -0
  419. package/dist/utils/project-root-policy.d.ts +20 -0
  420. package/dist/utils/project-root-policy.d.ts.map +1 -1
  421. package/dist/utils/project-root-policy.js +30 -0
  422. package/dist/utils/project-root-policy.js.map +1 -1
  423. package/dist/utils/projection-lenses.d.ts +98 -0
  424. package/dist/utils/projection-lenses.d.ts.map +1 -0
  425. package/dist/utils/projection-lenses.js +203 -0
  426. package/dist/utils/projection-lenses.js.map +1 -0
  427. package/dist/utils/projection-query.d.ts +324 -0
  428. package/dist/utils/projection-query.d.ts.map +1 -0
  429. package/dist/utils/projection-query.js +357 -0
  430. package/dist/utils/projection-query.js.map +1 -0
  431. package/dist/utils/projection-store.d.ts +335 -0
  432. package/dist/utils/projection-store.d.ts.map +1 -0
  433. package/dist/utils/projection-store.js +522 -0
  434. package/dist/utils/projection-store.js.map +1 -0
  435. package/dist/utils/relation-limits.d.ts +50 -0
  436. package/dist/utils/relation-limits.d.ts.map +1 -0
  437. package/dist/utils/relation-limits.js +50 -0
  438. package/dist/utils/relation-limits.js.map +1 -0
  439. package/dist/utils/repeatable-option.d.ts +37 -0
  440. package/dist/utils/repeatable-option.d.ts.map +1 -0
  441. package/dist/utils/repeatable-option.js +39 -0
  442. package/dist/utils/repeatable-option.js.map +1 -0
  443. package/dist/utils/resource-loader.d.ts +132 -2
  444. package/dist/utils/resource-loader.d.ts.map +1 -1
  445. package/dist/utils/resource-loader.js +288 -27
  446. package/dist/utils/resource-loader.js.map +1 -1
  447. package/dist/utils/root-argv.d.ts +53 -0
  448. package/dist/utils/root-argv.d.ts.map +1 -0
  449. package/dist/utils/root-argv.js +215 -0
  450. package/dist/utils/root-argv.js.map +1 -0
  451. package/dist/utils/run-integrity.d.ts +95 -0
  452. package/dist/utils/run-integrity.d.ts.map +1 -0
  453. package/dist/utils/run-integrity.js +102 -0
  454. package/dist/utils/run-integrity.js.map +1 -0
  455. package/dist/utils/skill-discovery.d.ts.map +1 -1
  456. package/dist/utils/skill-discovery.js +2 -1
  457. package/dist/utils/skill-discovery.js.map +1 -1
  458. package/dist/utils/skill-packaging-config.d.ts +63 -1
  459. package/dist/utils/skill-packaging-config.d.ts.map +1 -1
  460. package/dist/utils/skill-packaging-config.js +56 -1
  461. package/dist/utils/skill-packaging-config.js.map +1 -1
  462. package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
  463. package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
  464. package/dist/utils/sqlite-experimental-warning.js +144 -0
  465. package/dist/utils/sqlite-experimental-warning.js.map +1 -0
  466. package/dist/utils/url-redact.d.ts.map +1 -1
  467. package/dist/utils/url-redact.js +4 -6
  468. package/dist/utils/url-redact.js.map +1 -1
  469. package/dist/utils/user-context-scanner.d.ts +8 -0
  470. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  471. package/dist/utils/user-context-scanner.js +4 -2
  472. package/dist/utils/user-context-scanner.js.map +1 -1
  473. package/dist/utils/validate-help-files.d.ts.map +1 -1
  474. package/dist/utils/validate-help-files.js +12 -6
  475. package/dist/utils/validate-help-files.js.map +1 -1
  476. package/dist/utils/vat-bin-path.d.ts +36 -0
  477. package/dist/utils/vat-bin-path.d.ts.map +1 -0
  478. package/dist/utils/vat-bin-path.js +48 -0
  479. package/dist/utils/vat-bin-path.js.map +1 -0
  480. package/dist/utils/verdict-helpers.d.ts +1 -1
  481. package/dist/utils/verdict-helpers.d.ts.map +1 -1
  482. package/dist/utils/verdict-helpers.js +1 -1
  483. package/dist/utils/verdict-helpers.js.map +1 -1
  484. package/dist/version.d.ts.map +1 -1
  485. package/dist/version.js +1 -3
  486. package/dist/version.js.map +1 -1
  487. package/docs/agent.md +2 -2
  488. package/docs/audit.md +141 -37
  489. package/docs/doctor.md +7 -6
  490. package/docs/index.md +19 -11
  491. package/docs/mcp.md +2 -2
  492. package/docs/rag.md +3 -2
  493. package/docs/resources.md +13 -3
  494. package/docs/skill-test.md +10 -9
  495. package/docs/skills.md +53 -69
  496. package/package.json +35 -26
  497. package/schemas/ard-emit.json +149 -0
  498. package/schemas/okf-validate.json +170 -0
  499. package/schemas/resources-check.json +229 -0
  500. package/schemas/skill-review.json +230 -0
  501. package/dist/commands/resources/command-helpers.d.ts +0 -5
  502. package/dist/commands/resources/command-helpers.d.ts.map +0 -1
  503. package/dist/commands/resources/command-helpers.js +0 -6
  504. package/dist/commands/resources/command-helpers.js.map +0 -1
@@ -8,17 +8,19 @@
8
8
  */
9
9
  import { existsSync } from 'node:fs';
10
10
  import { mkdir, mkdtemp, rename, rm } from 'node:fs/promises';
11
- import { allowUnusedIssues, calculateValidationStatus, countBySeverity, createAllowUsageLedger, } from '@vibe-agent-toolkit/agent-schema';
12
- import { packageSkills, packagingConfigToPackageOptions, skillNameToFsPath, validateSkillForPackaging, } from '@vibe-agent-toolkit/agent-skills';
11
+ import { conventionalSuiteProbe, indexPluginLocalSkills, packageSkills, packagingConfigToPackageOptions, skillNameToFsPath, validateSkillForPackaging, } from '@vibe-agent-toolkit/agent-skills';
12
+ import { allowUnusedIssues, calculateValidationStatus, countBySeverity, createAllowUsageLedger, } from '@vibe-agent-toolkit/schema';
13
13
  import { safePath, toForwardSlash } from '@vibe-agent-toolkit/utils';
14
14
  import { Command } from 'commander';
15
15
  import * as yaml from 'yaml';
16
- import { handleCommandError } from '../../utils/command-error.js';
16
+ import { reportCommandError } from '../../utils/command-error.js';
17
17
  import { loadConfig } from '../../utils/config-loader.js';
18
18
  import { collectPostBuildIssues, countCollapsedFindings, formatCollapsedFindingsHint, formatIssueLines, formatIssueSetHeading, formatPackagedFileCount, formatRunIssueLines, issuesToRenderAtVerbosity, sumSeverityCounts, } from '../../utils/issue-rendering.js';
19
19
  import { requireProjectRoot } from '../../utils/project-root-policy.js';
20
- import { collectDeclaredEvalSuites, mergeSkillPackagingConfig } from '../../utils/skill-packaging-config.js';
20
+ import { withResourcePopulationSource } from '../../utils/resource-loader.js';
21
+ import { collectDeclaredEvalSuites, mergeSkillPackagingConfig, publishScope } from '../../utils/skill-packaging-config.js';
21
22
  import { applyConfigVerdicts } from '../../utils/verdict-helpers.js';
23
+ import { finishCommand } from '../phase-utils.js';
22
24
  import { filterSkillsByName, setupCommandContext, writeYamlHeader, } from './command-helpers.js';
23
25
  import { rejectUnscopablePath } from './scope-guard.js';
24
26
  import { discoverSkillsFromConfig } from './skill-discovery.js';
@@ -56,6 +58,16 @@ Description:
56
58
  (schema defaults -> config yaml defaults -> per-skill overrides),
57
59
  validates, and packages into dist/skills/<name>/.
58
60
 
61
+ publish: false (merged from skills.defaults and skills.config.<name>)
62
+ marks an IN-PLACE skill: validated at source by 'vat validate', never
63
+ bundled here, never expected by 'vat verify'. Such skills are set aside
64
+ with one info line and counted as skillsInPlace; --skill naming one is
65
+ an error (exit 1). A plugin-local skill (a git-tracked skill dir under a
66
+ plugin's skills/) ships with its plugin regardless of publish, so it is
67
+ never in place: under publish: false it is set aside on its own info line,
68
+ counted as skillsPluginOnly, and --skill naming it exits 1 pointing at the
69
+ claude phase that packages it.
70
+
59
71
  Config Structure (vibe-agent-toolkit.config.yaml):
60
72
  version: 1
61
73
  skills:
@@ -74,6 +86,8 @@ Config Structure (vibe-agent-toolkit.config.yaml):
74
86
  LINK_DROPPED_BY_DEPTH:
75
87
  - paths: ["docs/**"]
76
88
  reason: depth drop is intentional for large reference docs
89
+ used-in-place:
90
+ publish: false
77
91
 
78
92
  Validation:
79
93
  Both pre-build and post-build checks use the unified validation framework.
@@ -120,6 +134,14 @@ Output:
120
134
  emitted post-build validation errors. They are counted in
121
135
  skillsBuilt, not skillsFailed, so read ALL of these before
122
136
  concluding a run was clean: the exit code follows this one too.
137
+ skillsInPlace / skillsInPlaceNames:
138
+ NOT a failure — skills whose merged config says publish: false,
139
+ so this run set them aside unbuilt. Published so a build that
140
+ bundles fewer skills than it discovered says so by count.
141
+ skillsPluginOnly / skillsPluginOnlyNames:
142
+ NOT a failure — plugin-local publish: false skills, set aside
143
+ here too but shipped with their plugin by the claude phase, so
144
+ never counted in skillsInPlace. Both pairs are also in --dry-run.
123
145
  runIssueCounts: findings that belong to the run rather than to any one
124
146
  skill (ALLOW_UNUSED)
125
147
  issueCounts: the run total, which reconciles against the rows above:
@@ -289,7 +311,7 @@ function displayIgnoredErrors(validationResult, logger) {
289
311
  * publishes, rather than a flat "one error" stand-in.
290
312
  */
291
313
  async function validateSkillBeforeBuild(input) {
292
- const { skillName, sourcePath, packagingConfig, logger, locationRoot, allowLedger, projectSkills, verbose } = input;
314
+ const { skillName, sourcePath, packagingConfig, logger, locationRoot, allowLedger, projectSkills, suiteProbe, populationSource, verbose } = input;
293
315
  logger.debug(` Validating skill: ${skillName}`);
294
316
  // The run's ledger, not this call's: an allow entry scoped to a SOURCE
295
317
  // filename can only ever match here — packaging renames the file to
@@ -298,7 +320,20 @@ async function validateSkillBeforeBuild(input) {
298
320
  //
299
321
  // The run's declared eval suites likewise: this lane must model the same bundle
300
322
  // the packager below produces, and that bundle excludes EVERY skill's test input.
301
- const validationResult = await validateSkillForPackaging(sourcePath, packagingConfig, 'source', { allowLedger, projectSkills });
323
+ const validationResult = await validateSkillForPackaging(sourcePath, packagingConfig, 'source', {
324
+ allowLedger,
325
+ projectSkills,
326
+ // A build must not ship a shorter bundle: a directory the validator's own
327
+ // registry crawl cannot list refuses the run by name.
328
+ unreadable: 'refuse',
329
+ // Likewise the RUN's, and the same instance the packaging phase gets: this
330
+ // lane resolves test input for the subject AND every entry in
331
+ // `projectSkills`, so a per-call probe is S² over the loop.
332
+ suiteProbe,
333
+ // The RUN's source, so every skill in the loop shares one memo entry
334
+ // behind `crawlAndResolveRegistry` and the run pays one crawl, not N.
335
+ ...(populationSource !== undefined && { populationSource }),
336
+ });
302
337
  applyConfigVerdicts(validationResult, packagingConfig.targets, sourcePath, locationRoot);
303
338
  if (validationResult.status !== 'error') {
304
339
  if (validationResult.ignoredErrors.length > 0) {
@@ -320,7 +355,7 @@ async function validateSkillBeforeBuild(input) {
320
355
  /**
321
356
  * Output dry-run results
322
357
  */
323
- function outputDryRunYaml(skills, duration) {
358
+ function outputDryRunYaml(skills, setAside, duration) {
324
359
  writeYamlHeader({
325
360
  status: 'success',
326
361
  dryRun: true,
@@ -330,6 +365,10 @@ function outputDryRunYaml(skills, duration) {
330
365
  // misreading. This field makes the absence explicit instead.
331
366
  validated: false,
332
367
  skillsFound: skills.length,
368
+ // The same partition the real build publishes: what a preview would NOT
369
+ // bundle is as much a part of the preview as what it would.
370
+ skillsInPlace: setAside.inPlace.length,
371
+ skillsPluginOnly: setAside.pluginOnly.length,
333
372
  });
334
373
  process.stdout.write(`skills:\n`);
335
374
  for (const skill of skills) {
@@ -337,21 +376,24 @@ function outputDryRunYaml(skills, duration) {
337
376
  process.stdout.write(` source: ${skill.sourcePath}\n`);
338
377
  process.stdout.write(` output: dist/skills/${skillNameToFsPath(skill.name)}\n`);
339
378
  }
379
+ process.stdout.write(yaml.stringify({ skillsInPlaceNames: [...setAside.inPlace], skillsPluginOnlyNames: [...setAside.pluginOnly] }, { indent: 2, lineWidth: 0 }));
340
380
  process.stdout.write(`duration: ${duration}ms\n`);
341
381
  }
342
382
  /**
343
383
  * Perform dry-run preview
344
384
  */
345
- function performDryRun(skillsToBuild, duration, logger) {
385
+ function performDryRun(skillsToBuild, setAside, duration, logger) {
346
386
  logger.info(`Dry-run: Analyzing skill build...`);
347
387
  logger.info(` Skills to build: ${skillsToBuild.length}`);
388
+ logger.info(` In-place skills (publish: false, not bundled): ${setAside.inPlace.length}`);
389
+ logger.info(` Plugin-only skills (publish: false, ship with their plugin): ${setAside.pluginOnly.length}`);
348
390
  logger.info(`\nSkills:`);
349
391
  for (const skill of skillsToBuild) {
350
392
  logger.info(` ${skill.name}`);
351
393
  logger.info(` Source: ${skill.sourcePath}`);
352
394
  logger.info(` Output: dist/skills/${skillNameToFsPath(skill.name)}`);
353
395
  }
354
- outputDryRunYaml(skillsToBuild, duration);
396
+ outputDryRunYaml(skillsToBuild, setAside, duration);
355
397
  logger.info(`\nDry-run complete (no files created)`);
356
398
  logger.info(` Run without --dry-run to build the skills`);
357
399
  }
@@ -545,24 +587,38 @@ export function buildYamlSummary(run, duration) {
545
587
  };
546
588
  }
547
589
  /**
548
- * Output build results
590
+ * THE document this command publishes — the shape a consumer actually reads.
591
+ *
592
+ * NOT the same object as {@link buildYamlSummary}, and the difference is the
593
+ * whole reason this function exists. The summary carries `skillsWithErrors` as
594
+ * an ARRAY of names; the published document carries `skillsWithErrors` as a
595
+ * COUNT (in the header, beside the other tallies) and the names separately under
596
+ * `skillsWithErrorNames`. That projection used to live inside the renderer, so
597
+ * the only way to obtain the real document was to serialize it and parse it back
598
+ * — which is exactly what the parent process did, and exactly what stopped being
599
+ * true when phases stopped being child processes. Returning the summary instead
600
+ * would have flipped `skillsWithErrors` from a number to an array in `vat
601
+ * build`'s output, silently and with nothing to typecheck it against.
602
+ *
603
+ * `skillsInPlace` and `skillsPluginOnly` ride in the header beside `skillsBuilt`,
604
+ * with the names under `skillsInPlaceNames` / `skillsPluginOnlyNames`: a build that
605
+ * ships fewer skills than it discovered is the drop this command exists to prevent,
606
+ * so every skill a `publish: false` removed from `skillsBuilt` must be visible where
607
+ * a consumer reads the count — including a plugin-local one, which is not in place
608
+ * (it ships with its plugin) but is still not bundled here.
549
609
  */
550
- function outputBuildYaml(run, duration) {
610
+ export function buildBuildDocument(run, setAside, duration) {
551
611
  const summary = buildYamlSummary(run, duration);
552
612
  const { status, skillsBuilt, skillsFailed, skillsFailedValidation, issueCounts, runIssueCounts, skills, skillsStaged, failedSkills, validationFailedSkills, outputCommitted, duration: durationText, } = summary;
553
- // In the header, beside the other counts: these are the numbers the exit code
554
- // actually follows, so a reader who stops at the header is not misled by it.
555
- // `outputCommitted` rides up here too — a reader who sees exit 1 needs to know
556
- // whether their dist/skills still exists before they do anything else.
557
- writeYamlHeader({
613
+ return {
558
614
  status,
559
615
  skillsBuilt,
616
+ skillsInPlace: setAside.inPlace.length,
617
+ skillsPluginOnly: setAside.pluginOnly.length,
560
618
  skillsFailed,
561
619
  skillsFailedValidation,
562
620
  skillsWithErrors: summary.skillsWithErrors.length,
563
621
  outputCommitted,
564
- });
565
- process.stdout.write(yaml.stringify({
566
622
  issueCounts,
567
623
  runIssueCounts,
568
624
  // Published in the BODY, not the header: `writeYamlHeader` writes raw
@@ -580,8 +636,37 @@ function outputBuildYaml(run, duration) {
580
636
  failedSkills,
581
637
  validationFailedSkills,
582
638
  skillsWithErrorNames: summary.skillsWithErrors,
639
+ skillsInPlaceNames: [...setAside.inPlace],
640
+ skillsPluginOnlyNames: [...setAside.pluginOnly],
583
641
  runIssues: summary.runIssues,
584
- }, { indent: 2, lineWidth: 0, aliasDuplicateObjects: false }));
642
+ duration: durationText,
643
+ };
644
+ }
645
+ /**
646
+ * Render {@link buildBuildDocument}'s document to stdout.
647
+ *
648
+ * Streamed in two pieces — a raw scalar header, then the body — rather than as
649
+ * one `yaml.stringify`, so the header lands before a body that can run to
650
+ * megabytes on a large project. The key ORDER here is the document's order; the
651
+ * split is presentation only and adds nothing the document does not carry.
652
+ */
653
+ export function outputBuildYaml(document) {
654
+ const { status, skillsBuilt, skillsInPlace, skillsPluginOnly, skillsFailed, skillsFailedValidation, skillsWithErrors, outputCommitted, duration: durationText, ...body } = document;
655
+ // In the header, beside the other counts: these are the numbers the exit code
656
+ // actually follows, so a reader who stops at the header is not misled by it.
657
+ // `outputCommitted` rides up here too — a reader who sees exit 1 needs to know
658
+ // whether their dist/skills still exists before they do anything else.
659
+ writeYamlHeader({
660
+ status: status,
661
+ skillsBuilt: skillsBuilt,
662
+ skillsInPlace: skillsInPlace,
663
+ skillsPluginOnly: skillsPluginOnly,
664
+ skillsFailed: skillsFailed,
665
+ skillsFailedValidation: skillsFailedValidation,
666
+ skillsWithErrors: skillsWithErrors,
667
+ outputCommitted: outputCommitted,
668
+ });
669
+ process.stdout.write(yaml.stringify(body, { indent: 2, lineWidth: 0, aliasDuplicateObjects: false }));
585
670
  process.stdout.write(`duration: ${durationText}\n`);
586
671
  }
587
672
  /** How the human stream names the output tree. One spelling, one place. */
@@ -736,7 +821,6 @@ export function reanchorStagedResult(result, mapPath) {
736
821
  export async function beginStagedBuild(cwd, onlySkill) {
737
822
  const distDir = safePath.resolve(cwd, 'dist');
738
823
  const skillsDir = safePath.join(distDir, 'skills');
739
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
740
824
  await mkdir(distDir, { recursive: true });
741
825
  const root = toForwardSlash(await mkdtemp(safePath.join(distDir, '.vat-skills-')));
742
826
  // `--skill <name>` rebuilds ONE bundle, so the all-or-nothing guarantee is
@@ -749,9 +833,7 @@ export async function beginStagedBuild(cwd, onlySkill) {
749
833
  // without a dirname call.
750
834
  const promoteToParent = subPath === undefined ? distDir : skillsDir;
751
835
  const parked = `${root}.previous`;
752
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
753
836
  const hadPreviousOutput = existsSync(promoteTo);
754
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
755
837
  if (hadPreviousOutput)
756
838
  await rename(promoteTo, parked);
757
839
  // Flipped the instant this run's bundles reach `promoteTo`, so a later failure
@@ -774,11 +856,8 @@ export async function beginStagedBuild(cwd, onlySkill) {
774
856
  // staging root always exists, so a run that built nothing promotes an
775
857
  // empty dist/skills — an accurate statement of "this build produced no
776
858
  // bundles", where the old delete-up-front flow left the path absent.)
777
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
778
859
  if (existsSync(promoteFrom)) {
779
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
780
860
  await mkdir(promoteToParent, { recursive: true });
781
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
782
861
  await rename(promoteFrom, promoteTo);
783
862
  }
784
863
  promoted = true;
@@ -791,36 +870,30 @@ export async function beginStagedBuild(cwd, onlySkill) {
791
870
  await rm(root, { recursive: true, force: true });
792
871
  if (!hadPreviousOutput)
793
872
  return;
794
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
795
873
  await mkdir(promoteToParent, { recursive: true });
796
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
797
874
  await rename(parked, promoteTo);
798
875
  },
799
876
  recover: async () => {
800
877
  const residue = [];
801
878
  let restoredPrevious = false;
802
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
803
879
  const targetFree = !existsSync(promoteTo);
804
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
805
880
  if (hadPreviousOutput && existsSync(parked)) {
806
881
  if (targetFree) {
807
882
  try {
808
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
809
883
  await mkdir(promoteToParent, { recursive: true });
810
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- resolved from cwd
811
884
  await rename(parked, promoteTo);
812
885
  restoredPrevious = true;
813
886
  }
814
- catch {
887
+ catch (error) {
815
888
  // The repair is best-effort by construction: it runs because the
816
889
  // filesystem already refused something. A throw here must not replace
817
- // the original diagnosis, so the parked path is reported as residue
818
- // and the caller still names the real cause.
819
- residue.push(parked);
890
+ // the original diagnosis, so the parked path is reported as residue —
891
+ // with this refusal beside it — and the caller still names the real cause.
892
+ residue.push({ path: parked, reason: `restore failed: ${describeThrown(error)}` });
820
893
  }
821
894
  }
822
895
  else {
823
- residue.push(parked);
896
+ residue.push({ path: parked, reason: 'the promotion target is already occupied' });
824
897
  }
825
898
  }
826
899
  // This run's own staging root is always safe to drop: it holds output this
@@ -829,8 +902,8 @@ export async function beginStagedBuild(cwd, onlySkill) {
829
902
  try {
830
903
  await rm(root, { recursive: true, force: true });
831
904
  }
832
- catch {
833
- residue.push(root);
905
+ catch (error) {
906
+ residue.push({ path: root, reason: `removal failed: ${describeThrown(error)}` });
834
907
  }
835
908
  return { restoredPrevious, residue };
836
909
  },
@@ -883,7 +956,7 @@ export async function settleStaging(staging, runFailed, logger) {
883
956
  * whole remedy, and the path is unreconstructable without being told.
884
957
  */
885
958
  function describePromotionFailure(staging, error, recovery) {
886
- const cause = error instanceof Error ? error.message : String(error);
959
+ const cause = describeThrown(error);
887
960
  const lines = [`Build output promotion failed: ${cause}`];
888
961
  if (staging.promoted()) {
889
962
  lines.push(` ${staging.promoteLabel} DOES hold this run's output — the failure was in the cleanup that follows.`);
@@ -897,11 +970,94 @@ function describePromotionFailure(staging, error, recovery) {
897
970
  else {
898
971
  lines.push(` ${staging.promoteLabel} was never written, and there was no previous output to lose.`);
899
972
  }
900
- for (const path of recovery.residue) {
901
- lines.push(` Left on disk (this run could not remove it): ${path}`);
973
+ for (const { path, reason } of recovery.residue) {
974
+ lines.push(` Left on disk (this run could not remove it): ${path} — ${reason}`);
902
975
  }
903
976
  return lines.join('\n');
904
977
  }
978
+ /** The message of whatever was thrown, for a report line. */
979
+ function describeThrown(error) {
980
+ return error instanceof Error ? error.message : String(error);
981
+ }
982
+ /**
983
+ * Merge every skill's config and split the pool skills from the ones this run sets aside.
984
+ *
985
+ * `buildSpecs` is what this run bundles. Of the `publish: false` skills (see
986
+ * `publishScope`), `inPlace` is every one used from the repo — validated at
987
+ * source by `vat validate`, never bundled, never expected by `vat verify` — and
988
+ * `pluginOnly` every PLUGIN-LOCAL one (its source dir is a location in `pluginLocal`,
989
+ * from `indexPluginLocalSkills`): not bundled here either, but shipped with its
990
+ * plugin, so reporting it as in-place would be false. Every list keeps discovery
991
+ * order, so the human and machine reports list them as the globs found them.
992
+ */
993
+ export function partitionInPlaceSkills(skills, skillsConfig, pluginLocal) {
994
+ const lists = { pool: [], 'in-place': [], 'plugin-only': [] };
995
+ for (const skill of skills) {
996
+ const packagingConfig = mergeSkillPackagingConfig(skillsConfig.defaults, skillsConfig.config?.[skill.name]);
997
+ lists[publishScope(skill, packagingConfig, pluginLocal)].push({ skill, packagingConfig });
998
+ }
999
+ return { buildSpecs: lists.pool, inPlace: lists['in-place'], pluginOnly: lists['plugin-only'] };
1000
+ }
1001
+ /** How many set-aside names one info line spells out before "… and N more". */
1002
+ const SET_ASIDE_NAMES_SHOWN = 10;
1003
+ /**
1004
+ * ONE info line for one population this run set aside, naming the count and (up
1005
+ * to {@link SET_ASIDE_NAMES_SHOWN} of) the names. Nothing when there are none: a
1006
+ * "0 in-place" line on every build is noise that trains readers to skip the line
1007
+ * that matters.
1008
+ */
1009
+ function logSetAsideSkills(setAside, label, logger) {
1010
+ if (setAside.length === 0)
1011
+ return;
1012
+ const names = setAside.map((spec) => spec.skill.name);
1013
+ const shown = names.slice(0, SET_ASIDE_NAMES_SHOWN).join(', ');
1014
+ const more = names.length > SET_ASIDE_NAMES_SHOWN ? ` … and ${names.length - SET_ASIDE_NAMES_SHOWN} more` : '';
1015
+ logger.info(`Skipping ${setAside.length} ${label}: ${shown}${more}`);
1016
+ }
1017
+ /** The info line for the in-place skills — see {@link logSetAsideSkills}. */
1018
+ export function logInPlaceSkills(inPlace, logger) {
1019
+ logSetAsideSkills(inPlace, 'in-place skill(s) (publish: false — validated at source, never bundled)', logger);
1020
+ }
1021
+ /**
1022
+ * The info line for the plugin-local `publish: false` skills — deliberately NOT the
1023
+ * in-place line: they are left out of `dist/skills` but ship with their plugin.
1024
+ */
1025
+ function logPluginOnlySkills(pluginOnly, logger) {
1026
+ logSetAsideSkills(pluginOnly, 'plugin-local skill(s) from dist/skills (publish: false — each ships with its plugin via the claude phase)', logger);
1027
+ }
1028
+ /**
1029
+ * `--skill x` on an in-place skill is a contradiction, not a silent skip: exit 1
1030
+ * naming the key that makes it one. (The one-skill filter leaves only that skill.)
1031
+ */
1032
+ export function inPlaceSkillRefusal(skill, inPlace) {
1033
+ if (skill === undefined || inPlace.length === 0)
1034
+ return undefined;
1035
+ return new Error(`Skill "${skill}" is an in-place skill (skills.config.${skill}.publish is false, `
1036
+ + 'directly or via skills.defaults.publish): vat build never bundles it, so there is no bundle to build. '
1037
+ + 'Set publish: true to distribute it through dist/skills, or drop --skill.');
1038
+ }
1039
+ /**
1040
+ * `--skill x` on a plugin-local `publish: false` skill: exit 1 like the in-place
1041
+ * refusal, but saying what is true of it — it is not a pool skill, and it ships
1042
+ * with its plugin, packaged by the claude phase.
1043
+ */
1044
+ function pluginOnlySkillRefusal(skill, pluginOnly) {
1045
+ if (skill === undefined || pluginOnly.length === 0)
1046
+ return undefined;
1047
+ return new Error(`Skill "${skill}" is a plugin-local skill (under a plugin's skills/ directory) with publish: false `
1048
+ + `(skills.config.${skill}.publish, directly or via skills.defaults.publish): it ships with its plugin, `
1049
+ + 'packaged by the claude phase, and is never bundled into dist/skills, so this command has nothing to build for it. '
1050
+ + "Run 'vat build --only claude' to package its plugin, set publish: true to also distribute it through dist/skills, "
1051
+ + 'or drop --skill.');
1052
+ }
1053
+ /** The human success line, naming each set-aside population only when it is non-empty. */
1054
+ export function formatBuiltSuccessLine(built, setAside) {
1055
+ const tails = [
1056
+ ...(setAside.inPlace === 0 ? [] : [`${setAside.inPlace} in-place skill(s) not bundled`]),
1057
+ ...(setAside.pluginOnly === 0 ? [] : [`${setAside.pluginOnly} plugin-only skill(s) shipped with their plugin`]),
1058
+ ];
1059
+ return `\nBuilt ${built} skill(s) successfully` + (tails.length === 0 ? '' : ` (${tails.join(', ')})`);
1060
+ }
905
1061
  /**
906
1062
  * Validate, package, and drain — the whole span of ONE `vat build` invocation.
907
1063
  *
@@ -933,42 +1089,82 @@ export async function runSkillBuild(input) {
933
1089
  // detail no reader should have to decode.
934
1090
  const buildable = [];
935
1091
  const validationFailures = [];
936
- for (const spec of specs) {
937
- const { skill, packagingConfig } = spec;
938
- logger.info(`\nBuilding skill: ${skill.name}`);
939
- logger.info(` Source: ${skill.sourcePath}`);
940
- logger.info(` Output: ${finalOutputPath(cwd, skill.name)}`);
941
- const failure = await validateSkillBeforeBuild({
942
- skillName: skill.name,
943
- sourcePath: skill.sourcePath,
944
- packagingConfig,
945
- logger,
946
- locationRoot: cwd,
947
- allowLedger,
948
- projectSkills,
949
- verbose,
950
- });
951
- if (failure) {
952
- validationFailures.push(failure);
953
- continue;
954
- }
955
- buildable.push(spec);
956
- }
957
- // Build the skills that qualified, with a shared registry.
1092
+ // ONE bracket over the WHOLE run — both validation lanes and the packaging —
1093
+ // rather than over `packageSkills` alone.
1094
+ //
1095
+ // Two properties depend on it, and neither is cosmetic. First, every
1096
+ // enumeration of the SOURCE tree this run performs is then on the lane the
1097
+ // process selected: the pre-build check builds a private registry through
1098
+ // `crawlAndResolveRegistry`, and outside the bracket it had no source to reach,
1099
+ // so a projection-lane build still did one full walk. (Each skill's POST-build
1100
+ // check is deliberately NOT on the lane — `runPostBuildValidation` passes no
1101
+ // source, because it validates the built output rather than the source tree.
1102
+ // See its docstring in `skill-packager.ts`.) Second, the memo behind that crawl
1103
+ // is keyed on the source's IDENTITY, so one closure for the run means one crawl
1104
+ // for the run; a bracket per phase would hand out two closures and buy a second
1105
+ // crawl to save the first.
958
1106
  //
959
- // `projectSkills` is the run's declared eval suites — the whole project's, not
960
- // `specs`'. `--skill x` narrows what gets BUILT; it never narrows what counts as
961
- // test input, because an excluded skill's suite is still an answer key that must
962
- // not ship inside x's bundle.
963
- const buildSpecs = buildable.map(({ skill, packagingConfig }) => ({
964
- skillPath: skill.sourcePath,
965
- options: packagingConfigToPackageOptions(packagingConfig, {
1107
+ // `populationSource` is `undefined` when the walk stays selected, and every
1108
+ // consumer below treats that as "keep the incumbent" — the default path is
1109
+ // structurally unchanged.
1110
+ // Run-scoped for the same reason `projectSkills` is, and it is the more expensive
1111
+ // half: resolving a skill's test-input dirs probes the filesystem for a conventional
1112
+ // eval suite under the subject AND under every entry of `projectSkills`, so a probe
1113
+ // rebuilt per skill costs O(S) per skill and O(S²) per run. Measured on a 103-skill
1114
+ // adopter, in the sibling `vat resources validate` lane that shares this helper:
1115
+ // 10,815 `existsSync` calls over 103 distinct paths, half of that command's entire
1116
+ // filesystem traffic. This lane has the same shape.
1117
+ //
1118
+ // NOT module-scoped: the answer is a filesystem snapshot, so a cache outliving the
1119
+ // run would keep answering for a tree that has since changed.
1120
+ const suiteProbe = conventionalSuiteProbe();
1121
+ const outcomes = await withResourcePopulationSource({ root: cwd }, async (populationSource) => {
1122
+ for (const spec of specs) {
1123
+ const { skill, packagingConfig } = spec;
1124
+ logger.info(`\nBuilding skill: ${skill.name}`);
1125
+ logger.info(` Source: ${skill.sourcePath}`);
1126
+ logger.info(` Output: ${finalOutputPath(cwd, skill.name)}`);
1127
+ const failure = await validateSkillBeforeBuild({
1128
+ skillName: skill.name,
1129
+ sourcePath: skill.sourcePath,
1130
+ packagingConfig,
1131
+ logger,
1132
+ locationRoot: cwd,
1133
+ allowLedger,
1134
+ projectSkills,
1135
+ suiteProbe,
1136
+ populationSource,
1137
+ verbose,
1138
+ });
1139
+ if (failure) {
1140
+ validationFailures.push(failure);
1141
+ continue;
1142
+ }
1143
+ buildable.push(spec);
1144
+ }
1145
+ // Build the skills that qualified, with a shared registry.
1146
+ //
1147
+ // `projectSkills` is the run's declared eval suites — the whole project's, not
1148
+ // `specs`'. `--skill x` narrows what gets BUILT; it never narrows what counts as
1149
+ // test input, because an excluded skill's suite is still an answer key that must
1150
+ // not ship inside x's bundle.
1151
+ const buildSpecs = buildable.map(({ skill, packagingConfig }) => ({
966
1152
  skillPath: skill.sourcePath,
967
- // Into staging, not dist/skills: see `beginStagedBuild`.
968
- outputPath: safePath.join(staging.root, skillNameToFsPath(skill.name)),
969
- }, projectSkills),
970
- }));
971
- const outcomes = await packageSkills(buildSpecs, cwd, allowLedger);
1153
+ options: packagingConfigToPackageOptions(packagingConfig, {
1154
+ skillPath: skill.sourcePath,
1155
+ // Into staging, not dist/skills: see `beginStagedBuild`.
1156
+ outputPath: safePath.join(staging.root, skillNameToFsPath(skill.name)),
1157
+ }, projectSkills, suiteProbe),
1158
+ }));
1159
+ // `packageSkills` builds THE registry for the run, so this is the only seam
1160
+ // that can put `vat skills build` — and therefore `vat build`'s packaging
1161
+ // phase — on the lane. The registry's markdown-only `include` is re-applied
1162
+ // to whatever the source offers, so what gets packaged is unchanged; only how
1163
+ // the file list was obtained differs.
1164
+ return packageSkills(buildSpecs, cwd, allowLedger, {
1165
+ ...(populationSource !== undefined && { populationSource }),
1166
+ });
1167
+ });
972
1168
  const results = [];
973
1169
  const skillsWithErrors = [];
974
1170
  const failures = [];
@@ -1077,7 +1273,15 @@ function logRunFailures(run, logger) {
1077
1273
  logger.error(`\nBuild failed: run-level validation errors (project config, not any one skill)`);
1078
1274
  }
1079
1275
  }
1080
- async function buildCommand(pathArg, options) {
1276
+ /**
1277
+ * Build every configured skill and hand back the document and exit code,
1278
+ * printing the document nowhere.
1279
+ *
1280
+ * The phase entry point for `vat build`, whose `skills` phase is this command.
1281
+ * The three early returns publish no document — an unconfigured run and a dry
1282
+ * run both print their own thing and stop, exactly as the child process did.
1283
+ */
1284
+ export async function runSkillsBuildPhase(pathArg, options) {
1081
1285
  const { logger, cwd, startTime } = setupCommandContext(pathArg, options.debug);
1082
1286
  try {
1083
1287
  // Spec §7: `vat skills build` requires a projectRoot — fails fast at the
@@ -1089,18 +1293,36 @@ async function buildCommand(pathArg, options) {
1089
1293
  const config = loadConfig(cwd);
1090
1294
  if (!config?.skills) {
1091
1295
  logger.info('No skills configuration found — nothing to build');
1092
- process.exit(0);
1296
+ return { document: undefined, exitCode: 0 };
1093
1297
  }
1094
1298
  const skillsConfig = config.skills;
1095
1299
  // Discover SKILL.md files from config globs (relative to cwd where config lives)
1096
1300
  logger.info(`Discovering skills from config...`);
1097
- const discoveredSkills = await discoverSkillsFromConfig(skillsConfig, cwd);
1301
+ // `'refuse'`: a build that silently ships fewer skills is the drop this
1302
+ // command exists to prevent. The throw lands in the catch below →
1303
+ // `reportCommandError`, exit 2.
1304
+ const discoveredSkills = await discoverSkillsFromConfig(skillsConfig, cwd, 'refuse');
1098
1305
  if (discoveredSkills.length === 0) {
1099
1306
  throw new Error(`No SKILL.md files found matching include patterns: ${skillsConfig.include.join(', ')}`);
1100
1307
  }
1101
- // Filter by skill name if specified
1102
- const skillsToBuild = filterSkillsByName(discoveredSkills, options.skill);
1103
- logger.info(`Found ${skillsToBuild.length} skill(s) to build`);
1308
+ // Filter by skill name if specified, then set the in-place skills aside.
1309
+ // `publish: false` names a skill the pool never carries (see
1310
+ // `isSkillPublished`), so the partition happens BEFORE the count is announced:
1311
+ // "Found N skill(s) to build" must be the number this run will bundle.
1312
+ // Plugin-local = a skill dir the plugin build packages (the same index the
1313
+ // consistency check and `vat verify` ask): such a skill is never in place.
1314
+ const { buildSpecs, inPlace, pluginOnly } = partitionInPlaceSkills(filterSkillsByName(discoveredSkills, options.skill), skillsConfig, indexPluginLocalSkills(config, cwd));
1315
+ const refusal = inPlaceSkillRefusal(options.skill, inPlace) ?? pluginOnlySkillRefusal(options.skill, pluginOnly);
1316
+ if (refusal !== undefined) {
1317
+ return { document: reportCommandError(refusal, logger, startTime, 'SkillsBuild'), exitCode: 1, failed: true };
1318
+ }
1319
+ logInPlaceSkills(inPlace, logger);
1320
+ logPluginOnlySkills(pluginOnly, logger);
1321
+ logger.info(`Found ${buildSpecs.length} skill(s) to build`);
1322
+ const setAside = {
1323
+ inPlace: inPlace.map((spec) => spec.skill.name),
1324
+ pluginOnly: pluginOnly.map((spec) => spec.skill.name),
1325
+ };
1104
1326
  // Handle dry-run mode. Nothing has touched `dist/` at this point — the
1105
1327
  // staging directory and the swap both live inside `runSkillBuild`, which a
1106
1328
  // dry run never reaches, so "preview without creating files" is now true of
@@ -1109,13 +1331,9 @@ async function buildCommand(pathArg, options) {
1109
1331
  // guard three lines up to stay honest.)
1110
1332
  if (options.dryRun) {
1111
1333
  const duration = Date.now() - startTime;
1112
- performDryRun(skillsToBuild, duration, logger);
1113
- process.exit(0);
1334
+ performDryRun(buildSpecs.map((spec) => spec.skill), setAside, duration, logger);
1335
+ return { document: undefined, exitCode: 0 };
1114
1336
  }
1115
- const buildSpecs = skillsToBuild.map((skill) => ({
1116
- skill,
1117
- packagingConfig: mergeSkillPackagingConfig(skillsConfig.defaults, skillsConfig.config?.[skill.name]),
1118
- }));
1119
1337
  // Assembled ONCE, from the UNFILTERED discovery: `--skill x` narrows the build,
1120
1338
  // not the set of files that count as some skill's declared test input.
1121
1339
  const projectSkills = collectDeclaredEvalSuites(skillsConfig, discoveredSkills);
@@ -1128,8 +1346,7 @@ async function buildCommand(pathArg, options) {
1128
1346
  verbose: options.verbose === true,
1129
1347
  });
1130
1348
  const duration = Date.now() - startTime;
1131
- // Output YAML results
1132
- outputBuildYaml(run, duration);
1349
+ const document = buildBuildDocument(run, setAside, duration);
1133
1350
  for (const line of formatRunIssueLines(run.runIssues)) {
1134
1351
  logger.info(line);
1135
1352
  }
@@ -1137,24 +1354,35 @@ async function buildCommand(pathArg, options) {
1137
1354
  // A promotion failure is a SYSTEM error (2), not a validation one (1): the
1138
1355
  // build's verdict on the skills is not what went wrong, and a CI script has
1139
1356
  // to be able to tell "your skills are broken" from "the filesystem refused
1140
- // and dist/skills is in a state someone must look at". Reported AFTER the
1141
- // document is written, which is the whole reason it rides on the run rather
1142
- // than being thrown from inside it.
1357
+ // and dist/skills is in a state someone must look at". The document is
1358
+ // returned WITH the failing code rather than suppressed, which is the whole
1359
+ // reason the error rides on the run rather than being thrown from inside it.
1143
1360
  if (run.promotionError !== undefined) {
1144
1361
  logger.error(`\n${run.promotionError}`);
1145
- process.exit(2);
1362
+ return { document, exitCode: 2 };
1146
1363
  }
1147
1364
  // Gated on the SAME fact that decided whether the swap happened, not on a
1148
1365
  // second copy of the predicate: the exit code and `outputCommitted` can then
1149
1366
  // never disagree about whether this run succeeded.
1150
1367
  if (!run.outputCommitted) {
1151
- process.exit(1);
1368
+ return { document, exitCode: 1 };
1152
1369
  }
1153
- logger.info(`\nBuilt ${run.results.length} skill(s) successfully`);
1154
- process.exit(0);
1370
+ logger.info(formatBuiltSuccessLine(run.results.length, { inPlace: inPlace.length, pluginOnly: pluginOnly.length }));
1371
+ return { document, exitCode: 0 };
1155
1372
  }
1156
1373
  catch (error) {
1157
- handleCommandError(error, logger, startTime, 'SkillsBuild');
1374
+ return {
1375
+ document: reportCommandError(error, logger, startTime, 'SkillsBuild'),
1376
+ exitCode: 2,
1377
+ failed: true,
1378
+ };
1158
1379
  }
1159
1380
  }
1381
+ async function buildCommand(pathArg, options) {
1382
+ // `undefined`: this command offers no `--format`, so its failure envelope is
1383
+ // YAML like its report.
1384
+ finishCommand(await runSkillsBuildPhase(pathArg, options), (document) => {
1385
+ outputBuildYaml(document);
1386
+ }, undefined);
1387
+ }
1160
1388
  //# sourceMappingURL=build.js.map