@vibe-agent-toolkit/cli 0.2.0-rc.6 → 0.2.0-rc.8

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 (422) hide show
  1. package/README.md +4 -5
  2. package/dist/bin/vat +34 -19
  3. package/dist/bin/vat.js +34 -19
  4. package/dist/bin/vat.js.map +1 -1
  5. package/dist/bin.js +44 -158
  6. package/dist/bin.js.map +1 -1
  7. package/dist/command-loaders.d.ts +2 -2
  8. package/dist/command-loaders.d.ts.map +1 -1
  9. package/dist/command-loaders.js +4 -2
  10. package/dist/command-loaders.js.map +1 -1
  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/install-path.d.ts +36 -0
  18. package/dist/commands/agent/install-path.d.ts.map +1 -0
  19. package/dist/commands/agent/install-path.js +44 -0
  20. package/dist/commands/agent/install-path.js.map +1 -0
  21. package/dist/commands/agent/install.d.ts.map +1 -1
  22. package/dist/commands/agent/install.js +22 -10
  23. package/dist/commands/agent/install.js.map +1 -1
  24. package/dist/commands/agent/installed.d.ts.map +1 -1
  25. package/dist/commands/agent/installed.js +22 -12
  26. package/dist/commands/agent/installed.js.map +1 -1
  27. package/dist/commands/agent/list.d.ts.map +1 -1
  28. package/dist/commands/agent/list.js +2 -1
  29. package/dist/commands/agent/list.js.map +1 -1
  30. package/dist/commands/agent/run.d.ts.map +1 -1
  31. package/dist/commands/agent/run.js +2 -1
  32. package/dist/commands/agent/run.js.map +1 -1
  33. package/dist/commands/agent/uninstall.d.ts.map +1 -1
  34. package/dist/commands/agent/uninstall.js +13 -6
  35. package/dist/commands/agent/uninstall.js.map +1 -1
  36. package/dist/commands/agent/validate.d.ts.map +1 -1
  37. package/dist/commands/agent/validate.js +3 -2
  38. package/dist/commands/agent/validate.js.map +1 -1
  39. package/dist/commands/ard/emit.d.ts +153 -0
  40. package/dist/commands/ard/emit.d.ts.map +1 -0
  41. package/dist/commands/ard/emit.js +276 -0
  42. package/dist/commands/ard/emit.js.map +1 -0
  43. package/dist/commands/ard/index.d.ts +12 -0
  44. package/dist/commands/ard/index.d.ts.map +1 -0
  45. package/dist/commands/ard/index.js +80 -0
  46. package/dist/commands/ard/index.js.map +1 -0
  47. package/dist/commands/ard/surfaces.d.ts +56 -0
  48. package/dist/commands/ard/surfaces.d.ts.map +1 -0
  49. package/dist/commands/ard/surfaces.js +150 -0
  50. package/dist/commands/ard/surfaces.js.map +1 -0
  51. package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
  52. package/dist/commands/audit/distributed-tree.js +9 -6
  53. package/dist/commands/audit/distributed-tree.js.map +1 -1
  54. package/dist/commands/audit/scan-population.d.ts +158 -0
  55. package/dist/commands/audit/scan-population.d.ts.map +1 -0
  56. package/dist/commands/audit/scan-population.js +292 -0
  57. package/dist/commands/audit/scan-population.js.map +1 -0
  58. package/dist/commands/audit-settings.d.ts.map +1 -1
  59. package/dist/commands/audit-settings.js +6 -5
  60. package/dist/commands/audit-settings.js.map +1 -1
  61. package/dist/commands/audit.d.ts +78 -9
  62. package/dist/commands/audit.d.ts.map +1 -1
  63. package/dist/commands/audit.js +853 -473
  64. package/dist/commands/audit.js.map +1 -1
  65. package/dist/commands/build.d.ts.map +1 -1
  66. package/dist/commands/build.js +24 -24
  67. package/dist/commands/build.js.map +1 -1
  68. package/dist/commands/cache/clear.d.ts.map +1 -1
  69. package/dist/commands/cache/clear.js +17 -10
  70. package/dist/commands/cache/clear.js.map +1 -1
  71. package/dist/commands/claude/budget.d.ts +136 -24
  72. package/dist/commands/claude/budget.d.ts.map +1 -1
  73. package/dist/commands/claude/budget.js +152 -57
  74. package/dist/commands/claude/budget.js.map +1 -1
  75. package/dist/commands/claude/context.d.ts.map +1 -1
  76. package/dist/commands/claude/context.js +4 -3
  77. package/dist/commands/claude/context.js.map +1 -1
  78. package/dist/commands/claude/marketplace/changelog-utils.d.ts +1 -1
  79. package/dist/commands/claude/marketplace/changelog-utils.d.ts.map +1 -1
  80. package/dist/commands/claude/marketplace/changelog-utils.js +1 -2
  81. package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
  82. package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
  83. package/dist/commands/claude/marketplace/git-publish.js +3 -2
  84. package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
  85. package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
  86. package/dist/commands/claude/marketplace/license-utils.js +0 -1
  87. package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
  88. package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
  89. package/dist/commands/claude/marketplace/publish-tree.js +0 -6
  90. package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
  91. package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
  92. package/dist/commands/claude/marketplace/publish.js +2 -1
  93. package/dist/commands/claude/marketplace/publish.js.map +1 -1
  94. package/dist/commands/claude/marketplace/validate.d.ts +55 -22
  95. package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
  96. package/dist/commands/claude/marketplace/validate.js +392 -77
  97. package/dist/commands/claude/marketplace/validate.js.map +1 -1
  98. package/dist/commands/claude/org/api-keys.d.ts +0 -3
  99. package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
  100. package/dist/commands/claude/org/api-keys.js +2 -1
  101. package/dist/commands/claude/org/api-keys.js.map +1 -1
  102. package/dist/commands/claude/org/helpers.d.ts +17 -22
  103. package/dist/commands/claude/org/helpers.d.ts.map +1 -1
  104. package/dist/commands/claude/org/helpers.js +6 -22
  105. package/dist/commands/claude/org/helpers.js.map +1 -1
  106. package/dist/commands/claude/org/invites.d.ts +0 -3
  107. package/dist/commands/claude/org/invites.d.ts.map +1 -1
  108. package/dist/commands/claude/org/invites.js +3 -2
  109. package/dist/commands/claude/org/invites.js.map +1 -1
  110. package/dist/commands/claude/org/skills.d.ts +103 -4
  111. package/dist/commands/claude/org/skills.d.ts.map +1 -1
  112. package/dist/commands/claude/org/skills.js +331 -123
  113. package/dist/commands/claude/org/skills.js.map +1 -1
  114. package/dist/commands/claude/org/users.d.ts +0 -3
  115. package/dist/commands/claude/org/users.d.ts.map +1 -1
  116. package/dist/commands/claude/org/users.js +3 -2
  117. package/dist/commands/claude/org/users.js.map +1 -1
  118. package/dist/commands/claude/org/workspaces.d.ts +0 -3
  119. package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
  120. package/dist/commands/claude/org/workspaces.js +6 -5
  121. package/dist/commands/claude/org/workspaces.js.map +1 -1
  122. package/dist/commands/claude/plugin/build.d.ts +8 -0
  123. package/dist/commands/claude/plugin/build.d.ts.map +1 -1
  124. package/dist/commands/claude/plugin/build.js +28 -33
  125. package/dist/commands/claude/plugin/build.js.map +1 -1
  126. package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
  127. package/dist/commands/claude/plugin/helpers.js +0 -6
  128. package/dist/commands/claude/plugin/helpers.js.map +1 -1
  129. package/dist/commands/claude/plugin/install.d.ts +12 -0
  130. package/dist/commands/claude/plugin/install.d.ts.map +1 -1
  131. package/dist/commands/claude/plugin/install.js +71 -60
  132. package/dist/commands/claude/plugin/install.js.map +1 -1
  133. package/dist/commands/claude/plugin/list.d.ts.map +1 -1
  134. package/dist/commands/claude/plugin/list.js +3 -2
  135. package/dist/commands/claude/plugin/list.js.map +1 -1
  136. package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
  137. package/dist/commands/claude/plugin/plugin-changelog.js +0 -2
  138. package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
  139. package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
  140. package/dist/commands/claude/plugin/plugin-files.js +0 -3
  141. package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
  142. package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
  143. package/dist/commands/claude/plugin/plugin-validators.js +3 -6
  144. package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
  145. package/dist/commands/claude/plugin/tree-copy.d.ts +73 -0
  146. package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
  147. package/dist/commands/claude/plugin/tree-copy.js +221 -15
  148. package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
  149. package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
  150. package/dist/commands/claude/plugin/uninstall.js +4 -4
  151. package/dist/commands/claude/plugin/uninstall.js.map +1 -1
  152. package/dist/commands/consistency-check.d.ts +9 -13
  153. package/dist/commands/consistency-check.d.ts.map +1 -1
  154. package/dist/commands/consistency-check.js +91 -81
  155. package/dist/commands/consistency-check.js.map +1 -1
  156. package/dist/commands/corpus/index.d.ts.map +1 -1
  157. package/dist/commands/corpus/index.js +3 -0
  158. package/dist/commands/corpus/index.js.map +1 -1
  159. package/dist/commands/corpus/report.d.ts +0 -1
  160. package/dist/commands/corpus/report.d.ts.map +1 -1
  161. package/dist/commands/corpus/report.js +1 -3
  162. package/dist/commands/corpus/report.js.map +1 -1
  163. package/dist/commands/corpus/runner.d.ts +58 -1
  164. package/dist/commands/corpus/runner.d.ts.map +1 -1
  165. package/dist/commands/corpus/runner.js +92 -21
  166. package/dist/commands/corpus/runner.js.map +1 -1
  167. package/dist/commands/corpus/scan.d.ts.map +1 -1
  168. package/dist/commands/corpus/scan.js +2 -4
  169. package/dist/commands/corpus/scan.js.map +1 -1
  170. package/dist/commands/corpus/seed.d.ts +4 -4
  171. package/dist/commands/corpus/seed.d.ts.map +1 -1
  172. package/dist/commands/corpus/seed.js +1 -3
  173. package/dist/commands/corpus/seed.js.map +1 -1
  174. package/dist/commands/doctor.d.ts +14 -0
  175. package/dist/commands/doctor.d.ts.map +1 -1
  176. package/dist/commands/doctor.js +147 -51
  177. package/dist/commands/doctor.js.map +1 -1
  178. package/dist/commands/inventory.d.ts.map +1 -1
  179. package/dist/commands/inventory.js +6 -7
  180. package/dist/commands/inventory.js.map +1 -1
  181. package/dist/commands/mcp/list-collections.d.ts.map +1 -1
  182. package/dist/commands/mcp/list-collections.js +2 -1
  183. package/dist/commands/mcp/list-collections.js.map +1 -1
  184. package/dist/commands/mcp/serve.d.ts.map +1 -1
  185. package/dist/commands/mcp/serve.js +3 -2
  186. package/dist/commands/mcp/serve.js.map +1 -1
  187. package/dist/commands/okf/index.d.ts +11 -0
  188. package/dist/commands/okf/index.d.ts.map +1 -0
  189. package/dist/commands/okf/index.js +114 -0
  190. package/dist/commands/okf/index.js.map +1 -0
  191. package/dist/commands/okf/validate.d.ts +191 -0
  192. package/dist/commands/okf/validate.d.ts.map +1 -0
  193. package/dist/commands/okf/validate.js +190 -0
  194. package/dist/commands/okf/validate.js.map +1 -0
  195. package/dist/commands/phase-utils.d.ts +30 -13
  196. package/dist/commands/phase-utils.d.ts.map +1 -1
  197. package/dist/commands/phase-utils.js +56 -19
  198. package/dist/commands/phase-utils.js.map +1 -1
  199. package/dist/commands/positional-args.d.ts.map +1 -1
  200. package/dist/commands/positional-args.js +2 -1
  201. package/dist/commands/positional-args.js.map +1 -1
  202. package/dist/commands/rag/clear-command.d.ts.map +1 -1
  203. package/dist/commands/rag/clear-command.js +2 -1
  204. package/dist/commands/rag/clear-command.js.map +1 -1
  205. package/dist/commands/rag/index-command.d.ts +27 -2
  206. package/dist/commands/rag/index-command.d.ts.map +1 -1
  207. package/dist/commands/rag/index-command.js +48 -8
  208. package/dist/commands/rag/index-command.js.map +1 -1
  209. package/dist/commands/rag/index.d.ts.map +1 -1
  210. package/dist/commands/rag/index.js +2 -0
  211. package/dist/commands/rag/index.js.map +1 -1
  212. package/dist/commands/rag/query-command.d.ts.map +1 -1
  213. package/dist/commands/rag/query-command.js +2 -1
  214. package/dist/commands/rag/query-command.js.map +1 -1
  215. package/dist/commands/rag/stats-command.d.ts.map +1 -1
  216. package/dist/commands/rag/stats-command.js +2 -1
  217. package/dist/commands/rag/stats-command.js.map +1 -1
  218. package/dist/commands/resources/check-progress.d.ts +3 -0
  219. package/dist/commands/resources/check-progress.d.ts.map +1 -1
  220. package/dist/commands/resources/check-progress.js +11 -2
  221. package/dist/commands/resources/check-progress.js.map +1 -1
  222. package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
  223. package/dist/commands/resources/check-supervisor.js +14 -7
  224. package/dist/commands/resources/check-supervisor.js.map +1 -1
  225. package/dist/commands/resources/check.d.ts +168 -8
  226. package/dist/commands/resources/check.d.ts.map +1 -1
  227. package/dist/commands/resources/check.js +222 -118
  228. package/dist/commands/resources/check.js.map +1 -1
  229. package/dist/commands/resources/index.d.ts.map +1 -1
  230. package/dist/commands/resources/index.js +64 -29
  231. package/dist/commands/resources/index.js.map +1 -1
  232. package/dist/commands/resources/query.d.ts +18 -1
  233. package/dist/commands/resources/query.d.ts.map +1 -1
  234. package/dist/commands/resources/query.js +33 -12
  235. package/dist/commands/resources/query.js.map +1 -1
  236. package/dist/commands/resources/scan.d.ts.map +1 -1
  237. package/dist/commands/resources/scan.js +4 -8
  238. package/dist/commands/resources/scan.js.map +1 -1
  239. package/dist/commands/resources/validate.d.ts +30 -1
  240. package/dist/commands/resources/validate.d.ts.map +1 -1
  241. package/dist/commands/resources/validate.js +116 -14
  242. package/dist/commands/resources/validate.js.map +1 -1
  243. package/dist/commands/skill/review-checklist.d.ts +3 -2
  244. package/dist/commands/skill/review-checklist.d.ts.map +1 -1
  245. package/dist/commands/skill/review-checklist.js +4 -2
  246. package/dist/commands/skill/review-checklist.js.map +1 -1
  247. package/dist/commands/skill/review.d.ts +247 -0
  248. package/dist/commands/skill/review.d.ts.map +1 -1
  249. package/dist/commands/skill/review.js +98 -61
  250. package/dist/commands/skill/review.js.map +1 -1
  251. package/dist/commands/skill/test/configure.d.ts.map +1 -1
  252. package/dist/commands/skill/test/configure.js +0 -1
  253. package/dist/commands/skill/test/configure.js.map +1 -1
  254. package/dist/commands/skill/test/run.d.ts +12 -6
  255. package/dist/commands/skill/test/run.d.ts.map +1 -1
  256. package/dist/commands/skill/test/run.js +137 -67
  257. package/dist/commands/skill/test/run.js.map +1 -1
  258. package/dist/commands/skills/build.d.ts +69 -2
  259. package/dist/commands/skills/build.d.ts.map +1 -1
  260. package/dist/commands/skills/build.js +128 -42
  261. package/dist/commands/skills/build.js.map +1 -1
  262. package/dist/commands/skills/install.d.ts +2 -1
  263. package/dist/commands/skills/install.d.ts.map +1 -1
  264. package/dist/commands/skills/install.js +20 -30
  265. package/dist/commands/skills/install.js.map +1 -1
  266. package/dist/commands/skills/list.d.ts +2 -1
  267. package/dist/commands/skills/list.d.ts.map +1 -1
  268. package/dist/commands/skills/list.js +44 -26
  269. package/dist/commands/skills/list.js.map +1 -1
  270. package/dist/commands/skills/package.d.ts +1 -1
  271. package/dist/commands/skills/package.d.ts.map +1 -1
  272. package/dist/commands/skills/package.js +6 -8
  273. package/dist/commands/skills/package.js.map +1 -1
  274. package/dist/commands/skills/scope-guard.d.ts.map +1 -1
  275. package/dist/commands/skills/scope-guard.js +2 -4
  276. package/dist/commands/skills/scope-guard.js.map +1 -1
  277. package/dist/commands/skills/shared.d.ts.map +1 -1
  278. package/dist/commands/skills/shared.js +2 -4
  279. package/dist/commands/skills/shared.js.map +1 -1
  280. package/dist/commands/skills/skill-discovery.d.ts +40 -1
  281. package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
  282. package/dist/commands/skills/skill-discovery.js +32 -4
  283. package/dist/commands/skills/skill-discovery.js.map +1 -1
  284. package/dist/commands/skills/source-resolvers.d.ts +15 -0
  285. package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
  286. package/dist/commands/skills/source-resolvers.js +25 -4
  287. package/dist/commands/skills/source-resolvers.js.map +1 -1
  288. package/dist/commands/skills/validate-command.d.ts.map +1 -1
  289. package/dist/commands/skills/validate-command.js +11 -3
  290. package/dist/commands/skills/validate-command.js.map +1 -1
  291. package/dist/commands/skills/validate.d.ts +66 -7
  292. package/dist/commands/skills/validate.d.ts.map +1 -1
  293. package/dist/commands/skills/validate.js +133 -29
  294. package/dist/commands/skills/validate.js.map +1 -1
  295. package/dist/commands/validate.d.ts +1 -1
  296. package/dist/commands/validate.js +8 -6
  297. package/dist/commands/validate.js.map +1 -1
  298. package/dist/commands/verify.d.ts +102 -5
  299. package/dist/commands/verify.d.ts.map +1 -1
  300. package/dist/commands/verify.js +246 -69
  301. package/dist/commands/verify.js.map +1 -1
  302. package/dist/index.d.ts +0 -1
  303. package/dist/index.d.ts.map +1 -1
  304. package/dist/index.js +5 -1
  305. package/dist/index.js.map +1 -1
  306. package/dist/report-schemas.d.ts +45 -0
  307. package/dist/report-schemas.d.ts.map +1 -0
  308. package/dist/report-schemas.js +102 -0
  309. package/dist/report-schemas.js.map +1 -0
  310. package/dist/skill-resolution/packaging-config.d.ts +49 -5
  311. package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
  312. package/dist/skill-resolution/packaging-config.js +59 -19
  313. package/dist/skill-resolution/packaging-config.js.map +1 -1
  314. package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
  315. package/dist/skill-resolution/resolve-skill-reference.js +8 -6
  316. package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
  317. package/dist/utils/agent-discovery.d.ts.map +1 -1
  318. package/dist/utils/agent-discovery.js +22 -11
  319. package/dist/utils/agent-discovery.js.map +1 -1
  320. package/dist/utils/agent-runner.d.ts.map +1 -1
  321. package/dist/utils/agent-runner.js +0 -1
  322. package/dist/utils/agent-runner.js.map +1 -1
  323. package/dist/utils/command-error.d.ts +87 -55
  324. package/dist/utils/command-error.d.ts.map +1 -1
  325. package/dist/utils/command-error.js +113 -64
  326. package/dist/utils/command-error.js.map +1 -1
  327. package/dist/utils/config-loader.d.ts +2 -1
  328. package/dist/utils/config-loader.d.ts.map +1 -1
  329. package/dist/utils/config-loader.js +3 -6
  330. package/dist/utils/config-loader.js.map +1 -1
  331. package/dist/utils/context-budget-issues.d.ts +1 -1
  332. package/dist/utils/context-budget-issues.js +1 -1
  333. package/dist/utils/corpus-target.d.ts +5 -27
  334. package/dist/utils/corpus-target.d.ts.map +1 -1
  335. package/dist/utils/corpus-target.js +7 -33
  336. package/dist/utils/corpus-target.js.map +1 -1
  337. package/dist/utils/edge-lens-evaluation.d.ts +83 -0
  338. package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
  339. package/dist/utils/edge-lens-evaluation.js +110 -0
  340. package/dist/utils/edge-lens-evaluation.js.map +1 -0
  341. package/dist/utils/help-loader.d.ts.map +1 -1
  342. package/dist/utils/help-loader.js +0 -1
  343. package/dist/utils/help-loader.js.map +1 -1
  344. package/dist/utils/issue-rendering.d.ts +2 -2
  345. package/dist/utils/issue-rendering.js +2 -2
  346. package/dist/utils/optional-backend.d.ts +5 -4
  347. package/dist/utils/optional-backend.d.ts.map +1 -1
  348. package/dist/utils/optional-backend.js +7 -5
  349. package/dist/utils/optional-backend.js.map +1 -1
  350. package/dist/utils/output.d.ts +9 -0
  351. package/dist/utils/output.d.ts.map +1 -1
  352. package/dist/utils/output.js +16 -0
  353. package/dist/utils/output.js.map +1 -1
  354. package/dist/utils/package-json.d.ts +24 -0
  355. package/dist/utils/package-json.d.ts.map +1 -0
  356. package/dist/utils/package-json.js +49 -0
  357. package/dist/utils/package-json.js.map +1 -0
  358. package/dist/utils/project-root-policy.d.ts +20 -0
  359. package/dist/utils/project-root-policy.d.ts.map +1 -1
  360. package/dist/utils/project-root-policy.js +30 -0
  361. package/dist/utils/project-root-policy.js.map +1 -1
  362. package/dist/utils/projection-query.d.ts +41 -4
  363. package/dist/utils/projection-query.d.ts.map +1 -1
  364. package/dist/utils/projection-query.js +44 -10
  365. package/dist/utils/projection-query.js.map +1 -1
  366. package/dist/utils/projection-store.d.ts +41 -15
  367. package/dist/utils/projection-store.d.ts.map +1 -1
  368. package/dist/utils/projection-store.js +65 -18
  369. package/dist/utils/projection-store.js.map +1 -1
  370. package/dist/utils/repeatable-option.d.ts +37 -0
  371. package/dist/utils/repeatable-option.d.ts.map +1 -0
  372. package/dist/utils/repeatable-option.js +39 -0
  373. package/dist/utils/repeatable-option.js.map +1 -0
  374. package/dist/utils/resource-loader.d.ts +4 -3
  375. package/dist/utils/resource-loader.d.ts.map +1 -1
  376. package/dist/utils/resource-loader.js +63 -32
  377. package/dist/utils/resource-loader.js.map +1 -1
  378. package/dist/utils/root-argv.d.ts +53 -0
  379. package/dist/utils/root-argv.d.ts.map +1 -0
  380. package/dist/utils/root-argv.js +215 -0
  381. package/dist/utils/root-argv.js.map +1 -0
  382. package/dist/utils/run-integrity.d.ts +95 -0
  383. package/dist/utils/run-integrity.d.ts.map +1 -0
  384. package/dist/utils/run-integrity.js +102 -0
  385. package/dist/utils/run-integrity.js.map +1 -0
  386. package/dist/utils/skill-packaging-config.d.ts +27 -0
  387. package/dist/utils/skill-packaging-config.d.ts.map +1 -1
  388. package/dist/utils/skill-packaging-config.js +30 -0
  389. package/dist/utils/skill-packaging-config.js.map +1 -1
  390. package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
  391. package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
  392. package/dist/utils/sqlite-experimental-warning.js +144 -0
  393. package/dist/utils/sqlite-experimental-warning.js.map +1 -0
  394. package/dist/utils/url-redact.d.ts.map +1 -1
  395. package/dist/utils/url-redact.js +4 -6
  396. package/dist/utils/url-redact.js.map +1 -1
  397. package/dist/utils/user-context-scanner.d.ts +8 -0
  398. package/dist/utils/user-context-scanner.d.ts.map +1 -1
  399. package/dist/utils/user-context-scanner.js +4 -2
  400. package/dist/utils/user-context-scanner.js.map +1 -1
  401. package/dist/utils/validate-help-files.d.ts.map +1 -1
  402. package/dist/utils/validate-help-files.js +12 -6
  403. package/dist/utils/validate-help-files.js.map +1 -1
  404. package/dist/utils/vat-bin-path.d.ts.map +1 -1
  405. package/dist/utils/vat-bin-path.js +0 -1
  406. package/dist/utils/vat-bin-path.js.map +1 -1
  407. package/dist/version.d.ts.map +1 -1
  408. package/dist/version.js +1 -3
  409. package/dist/version.js.map +1 -1
  410. package/docs/audit.md +141 -37
  411. package/docs/doctor.md +7 -6
  412. package/docs/index.md +19 -11
  413. package/docs/rag.md +3 -2
  414. package/docs/resources.md +5 -2
  415. package/docs/skill-test.md +10 -9
  416. package/docs/skills.md +53 -69
  417. package/package.json +24 -29
  418. package/schemas/ard-emit.json +149 -0
  419. package/schemas/claude-budget.json +197 -0
  420. package/schemas/okf-validate.json +170 -0
  421. package/schemas/resources-check.json +186 -0
  422. package/schemas/skill-review.json +230 -0
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/agent/validate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAMxE,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAAkB,EAClB,OAA+B;IAE/B,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,wDAAwD;QACxD,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,oBAAoB,CAAC,CAAC;QAExD,uCAAuC;QACvC,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAE9D,MAAM,CAAC,KAAK,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C,OAAO;YAC1C,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,UAAU,EAAE;gBACV,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B;YACD,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI;SACxC,CAAC;QAEF,eAAe,CAAC,MAAM,CAAC,CAAC;QAExB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YACxC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClC,MAAM,CAAC,KAAK,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;YAC/B,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;YAChD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACtC,MAAM,CAAC,IAAI,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAChE,CAAC;AACH,CAAC"}
@@ -0,0 +1,153 @@
1
+ /**
2
+ * `vat ard emit` — write the project's `/.well-known/ard.json`.
3
+ *
4
+ * **Emit, never depend.** This command produces a document and stops. Nothing
5
+ * in VAT reads one back, and no VAT behaviour is derived from one — ARD is
6
+ * v0.91, status Proposal, and wiring internals to a moving shape is the cost
7
+ * this rule avoids.
8
+ */
9
+ import { type ShadowedArdOverrideKey } from '@vibe-agent-toolkit/resources';
10
+ import { type Report } from '@vibe-agent-toolkit/schema';
11
+ import { VatError } from '@vibe-agent-toolkit/utils';
12
+ import { z } from 'zod';
13
+ import { type SkippedArdSurface } from './surfaces.js';
14
+ /** Default destination, relative to the project root — the path ARD publishes at. */
15
+ export declare const DEFAULT_ARD_OUTPUT = ".well-known/ard.json";
16
+ /**
17
+ * Which of the three absences stopped the run.
18
+ *
19
+ * 🚨 `loadConfig` returns `undefined` for both "that directory does not exist"
20
+ * and "that directory has no config file", and the command used to report the
21
+ * third case for all of them: `--project-root /nope/nothing/here` answered "No
22
+ * `ard:` configuration found … Add an `ard:` block to
23
+ * vibe-agent-toolkit.config.yaml", prescribing an edit to a file in a directory
24
+ * that does not exist. Only a `stat` can tell them apart, so the command does
25
+ * one rather than inferring from a shared `undefined`.
26
+ *
27
+ * The distinction is also what the exit code reads: the first two are system
28
+ * errors (exit 2, as `vat okf validate` documents for the same conditions), the
29
+ * third is a project that never opted in (exit 1).
30
+ */
31
+ export type ArdConfigAbsence = 'no-project-root' | 'no-config-file' | 'no-ard-block';
32
+ /** No manifest could be built, and this says which absence caused it. */
33
+ export declare class ArdConfigMissingError extends VatError {
34
+ readonly projectRoot: string;
35
+ readonly absence: ArdConfigAbsence;
36
+ constructor(projectRoot: string, absence: ArdConfigAbsence);
37
+ }
38
+ export interface ArdEmitOptions {
39
+ /** Project root to read the config from (default: cwd). */
40
+ projectRoot?: string | undefined;
41
+ /** Destination path, absolute or relative to the project root. */
42
+ output?: string | undefined;
43
+ /**
44
+ * How the run reports itself: a human line (default) or {@link ArdEmitReport}.
45
+ *
46
+ * `text` is the default because it is what the command already wrote, and
47
+ * this lane's stdout is a published contract.
48
+ */
49
+ format?: 'text' | 'json' | undefined;
50
+ /** Fail the run when it advertises nothing, or skipped a configured surface. */
51
+ strict?: boolean | undefined;
52
+ debug?: boolean | undefined;
53
+ }
54
+ export interface ArdEmitResult {
55
+ readonly outputPath: string;
56
+ readonly entryCount: number;
57
+ readonly skipped: readonly SkippedArdSurface[];
58
+ /**
59
+ * Bare `ard.entries` keys a qualified key for the same surface outranked.
60
+ *
61
+ * Not a failure — the precedence is deterministic and documented — but the
62
+ * losing block is dead config, and an author cannot see that from the file.
63
+ */
64
+ readonly shadowed: readonly ShadowedArdOverrideKey[];
65
+ }
66
+ /**
67
+ * Build and write the manifest.
68
+ *
69
+ * @throws {ArdConfigMissingError} when no config, or no `ard:` block, is found.
70
+ * @throws {ArdDerivationError} when a surface cannot be turned into a
71
+ * conformant entry — a missing `ard.baseUrl`, an unusable URN segment, or a
72
+ * trust identity that does not align with the publisher.
73
+ */
74
+ export declare function runArdEmit(options: ArdEmitOptions): Promise<ArdEmitResult>;
75
+ /**
76
+ * The codes this run's findings carry. Not registry codes: nothing here is a
77
+ * validation an adopter tunes through `validation.severity` — a skipped
78
+ * surface is a fact about what the manifest could not advertise, and its
79
+ * severity is the run's to decide.
80
+ */
81
+ export declare const ARD_EMIT_CODES: {
82
+ /** A configured surface that became no entry, and why — the thing `--strict` gates. */
83
+ readonly SURFACE_SKIPPED: "ARD_SURFACE_SKIPPED";
84
+ /**
85
+ * A bare `ard.entries` key a qualified key for the same surface outranked.
86
+ * Not a failure — the precedence is deterministic and documented — but the
87
+ * losing block is dead config, and an author cannot see that from the file.
88
+ */
89
+ readonly OVERRIDE_KEY_SHADOWED: "ARD_OVERRIDE_KEY_SHADOWED";
90
+ };
91
+ /**
92
+ * What the run reports beyond its findings.
93
+ *
94
+ * 🪤 `entryCount: 0` is the empty manifest. A run that wrote `{"entries":[]}`
95
+ * and one that wrote a full catalogue both used to end at exit 0 with a
96
+ * cheerful line on stdout, and nothing a machine could read told them apart —
97
+ * so a CI step that emits and publishes was green over a discovery document
98
+ * advertising nothing. The envelope's `examined` is every configured surface
99
+ * the run considered, so "nothing declared" (`examined: 0`) and "everything
100
+ * declared was skipped" (`examined: N`, `entryCount: 0`) read differently too.
101
+ */
102
+ export declare const ArdEmitDataSchema: z.ZodObject<{
103
+ outputPath: z.ZodString;
104
+ entryCount: z.ZodNumber;
105
+ /**
106
+ * Counts BESIDE the findings. The count is what a CI step gates on without
107
+ * a JSON path into an array; the finding is what the human it pages then
108
+ * acts on. Publishing only one of them answers "how many" or "which", never
109
+ * both.
110
+ */
111
+ skippedCount: z.ZodNumber;
112
+ shadowedCount: z.ZodNumber;
113
+ }, "strict", z.ZodTypeAny, {
114
+ outputPath: string;
115
+ entryCount: number;
116
+ skippedCount: number;
117
+ shadowedCount: number;
118
+ }, {
119
+ outputPath: string;
120
+ entryCount: number;
121
+ skippedCount: number;
122
+ shadowedCount: number;
123
+ }>;
124
+ export type ArdEmitData = z.infer<typeof ArdEmitDataSchema>;
125
+ /** The document `--format json` publishes. */
126
+ export declare const ARD_EMIT_REPORT_SCHEMA: import("@vibe-agent-toolkit/schema").ReportZodSchema<z.ZodObject<{
127
+ outputPath: z.ZodString;
128
+ entryCount: z.ZodNumber;
129
+ /**
130
+ * Counts BESIDE the findings. The count is what a CI step gates on without
131
+ * a JSON path into an array; the finding is what the human it pages then
132
+ * acts on. Publishing only one of them answers "how many" or "which", never
133
+ * both.
134
+ */
135
+ skippedCount: z.ZodNumber;
136
+ shadowedCount: z.ZodNumber;
137
+ }, "strict", z.ZodTypeAny, {
138
+ outputPath: string;
139
+ entryCount: number;
140
+ skippedCount: number;
141
+ shadowedCount: number;
142
+ }, {
143
+ outputPath: string;
144
+ entryCount: number;
145
+ skippedCount: number;
146
+ shadowedCount: number;
147
+ }>>;
148
+ export type ArdEmitReport = Report<ArdEmitData>;
149
+ /** Pure: the report a result becomes, so the status rule is unit-testable. */
150
+ export declare function buildArdEmitReport(result: ArdEmitResult): ArdEmitReport;
151
+ /** Action handler for `vat ard emit`. */
152
+ export declare function ardEmitCommand(options: ArdEmitOptions): Promise<void>;
153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AAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC/C;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACtD;AAuBD;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAyChF;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc;IACzB,uFAAuF;;IAEvF;;;;OAIG;;CAEK,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB;;;IAG5B;;;;;OAKG;;;;;;;;;;;;;EAGM,CAAC;AAEZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,8CAA8C;AAC9C,eAAO,MAAM,sBAAsB;;;IAbjC;;;;;OAKG;;;;;;;;;;;;;GAQgE,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAwBhD,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAavE;AAoCD,yCAAyC;AACzC,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA4D3E"}
@@ -0,0 +1,276 @@
1
+ /**
2
+ * `vat ard emit` — write the project's `/.well-known/ard.json`.
3
+ *
4
+ * **Emit, never depend.** This command produces a document and stops. Nothing
5
+ * in VAT reads one back, and no VAT behaviour is derived from one — ARD is
6
+ * v0.91, status Proposal, and wiring internals to a moving shape is the cost
7
+ * this rule avoids.
8
+ */
9
+ import { existsSync } from 'node:fs';
10
+ import { ArdDerivationError, buildArdEntries, buildArdManifest, findShadowedArdOverrideKeys, writeArdManifest, } from '@vibe-agent-toolkit/resources';
11
+ import { buildReport, ExitCode, reportSchema } from '@vibe-agent-toolkit/schema';
12
+ import { safePath, VatError } from '@vibe-agent-toolkit/utils';
13
+ import { z } from 'zod';
14
+ import { handleReportCommandError, handleReportExpectedFailure } from '../../utils/command-error.js';
15
+ import { loadConfig } from '../../utils/config-loader.js';
16
+ import { createLogger } from '../../utils/logger.js';
17
+ import { writeJsonOutput } from '../../utils/output.js';
18
+ import { readPackageJsonOrAbsent } from '../../utils/package-json.js';
19
+ import { discoverSkillsFromConfig } from '../skills/skill-discovery.js';
20
+ import { collectArdSurfaces } from './surfaces.js';
21
+ /** Default destination, relative to the project root — the path ARD publishes at. */
22
+ export const DEFAULT_ARD_OUTPUT = '.well-known/ard.json';
23
+ /** The config filename every VAT project declares its surfaces in. */
24
+ const CONFIG_FILENAME = 'vibe-agent-toolkit.config.yaml';
25
+ /** No manifest could be built, and this says which absence caused it. */
26
+ export class ArdConfigMissingError extends VatError {
27
+ projectRoot;
28
+ absence;
29
+ constructor(projectRoot, absence) {
30
+ super('ARD_CONFIG_MISSING', ABSENCE_MESSAGES[absence](projectRoot));
31
+ this.projectRoot = projectRoot;
32
+ this.absence = absence;
33
+ }
34
+ }
35
+ const ABSENCE_MESSAGES = {
36
+ 'no-project-root': (projectRoot) => `Project root ${projectRoot} does not exist. Pass --project-root a directory that does, or ` +
37
+ 'run `vat ard emit` from inside the project.',
38
+ 'no-config-file': (projectRoot) => `No ${CONFIG_FILENAME} found in ${projectRoot}. ` +
39
+ 'ARD entries are derived from the surfaces that file declares, so there is nothing to emit.',
40
+ 'no-ard-block': (projectRoot) => `No \`ard:\` configuration found for ${projectRoot}. ` +
41
+ `Add an \`ard:\` block with a \`publisher\` domain to ${CONFIG_FILENAME}.`,
42
+ };
43
+ /**
44
+ * The project's own package version, when it has one.
45
+ *
46
+ * The npm package version is the only version this project recognises, and an
47
+ * adopter's is the only one VAT can honestly stamp on an entry. Absent, the
48
+ * field is simply omitted. A `package.json` that is there and is not JSON is
49
+ * refused by name instead: it used to be read as "no version" too, and a
50
+ * manifest emitted with no `version` from a tree npm itself cannot read is a
51
+ * manifest that hid the one fact worth reporting.
52
+ */
53
+ function readProjectVersion(projectRoot) {
54
+ const parsed = readPackageJsonOrAbsent(safePath.join(projectRoot, 'package.json'));
55
+ const version = parsed?.['version'];
56
+ // `""` is ABSENT, not a version. A `package.json` carrying it emitted
57
+ // `"version": ""` on every entry at exit 0 — a field asserting a version
58
+ // that does not exist. The entry schema now refuses it too, so leaving this
59
+ // would turn a blank field into a hard emission failure instead.
60
+ if (typeof version !== 'string' || version === '')
61
+ return undefined;
62
+ return version;
63
+ }
64
+ /**
65
+ * Build and write the manifest.
66
+ *
67
+ * @throws {ArdConfigMissingError} when no config, or no `ard:` block, is found.
68
+ * @throws {ArdDerivationError} when a surface cannot be turned into a
69
+ * conformant entry — a missing `ard.baseUrl`, an unusable URN segment, or a
70
+ * trust identity that does not align with the publisher.
71
+ */
72
+ export async function runArdEmit(options) {
73
+ const projectRoot = options.projectRoot ?? process.cwd();
74
+ if (!existsSync(projectRoot)) {
75
+ throw new ArdConfigMissingError(projectRoot, 'no-project-root');
76
+ }
77
+ const config = loadConfig(projectRoot);
78
+ if (config === undefined) {
79
+ throw new ArdConfigMissingError(projectRoot, 'no-config-file');
80
+ }
81
+ const ard = config.ard;
82
+ if (ard === undefined) {
83
+ throw new ArdConfigMissingError(projectRoot, 'no-ard-block');
84
+ }
85
+ const { surfaces, skipped } = collectArdSurfaces(config, {
86
+ version: readProjectVersion(projectRoot),
87
+ // The SAME discovery `vat verify` runs, so the two commands cannot disagree
88
+ // about which skills this project has. Omitted entirely when the project
89
+ // declares no `skills` block: there is nothing to cross-check, and passing
90
+ // `[]` would claim discovery ran and found nothing.
91
+ ...(config.skills === undefined
92
+ ? {}
93
+ : {
94
+ // `'refuse'`: a manifest cross-checked against a partial skill list
95
+ // would advertise or omit entries on a population it never saw. The
96
+ // throw is an invocation failure → exit 2 (see the catch in
97
+ // `ardEmitCommand`).
98
+ discoveredSkills: (await discoverSkillsFromConfig(config.skills, projectRoot, 'refuse')).map((skill) => skill.name),
99
+ }),
100
+ });
101
+ const manifest = buildArdManifest(buildArdEntries(surfaces, ard));
102
+ const outputPath = safePath.resolve(projectRoot, options.output ?? DEFAULT_ARD_OUTPUT);
103
+ await writeArdManifest(manifest, outputPath);
104
+ return {
105
+ outputPath,
106
+ entryCount: manifest.entries.length,
107
+ skipped,
108
+ shadowed: findShadowedArdOverrideKeys(surfaces, ard),
109
+ };
110
+ }
111
+ /**
112
+ * The codes this run's findings carry. Not registry codes: nothing here is a
113
+ * validation an adopter tunes through `validation.severity` — a skipped
114
+ * surface is a fact about what the manifest could not advertise, and its
115
+ * severity is the run's to decide.
116
+ */
117
+ export const ARD_EMIT_CODES = {
118
+ /** A configured surface that became no entry, and why — the thing `--strict` gates. */
119
+ SURFACE_SKIPPED: 'ARD_SURFACE_SKIPPED',
120
+ /**
121
+ * A bare `ard.entries` key a qualified key for the same surface outranked.
122
+ * Not a failure — the precedence is deterministic and documented — but the
123
+ * losing block is dead config, and an author cannot see that from the file.
124
+ */
125
+ OVERRIDE_KEY_SHADOWED: 'ARD_OVERRIDE_KEY_SHADOWED',
126
+ };
127
+ /**
128
+ * What the run reports beyond its findings.
129
+ *
130
+ * 🪤 `entryCount: 0` is the empty manifest. A run that wrote `{"entries":[]}`
131
+ * and one that wrote a full catalogue both used to end at exit 0 with a
132
+ * cheerful line on stdout, and nothing a machine could read told them apart —
133
+ * so a CI step that emits and publishes was green over a discovery document
134
+ * advertising nothing. The envelope's `examined` is every configured surface
135
+ * the run considered, so "nothing declared" (`examined: 0`) and "everything
136
+ * declared was skipped" (`examined: N`, `entryCount: 0`) read differently too.
137
+ */
138
+ export const ArdEmitDataSchema = z.object({
139
+ outputPath: z.string(),
140
+ entryCount: z.number().int().nonnegative(),
141
+ /**
142
+ * Counts BESIDE the findings. The count is what a CI step gates on without
143
+ * a JSON path into an array; the finding is what the human it pages then
144
+ * acts on. Publishing only one of them answers "how many" or "which", never
145
+ * both.
146
+ */
147
+ skippedCount: z.number().int().nonnegative(),
148
+ shadowedCount: z.number().int().nonnegative(),
149
+ }).strict();
150
+ /** The document `--format json` publishes. */
151
+ export const ARD_EMIT_REPORT_SCHEMA = reportSchema(ArdEmitDataSchema);
152
+ /** The finding one skipped surface becomes. Its text is the stderr line, so the two channels agree. */
153
+ function skippedFinding(item) {
154
+ return {
155
+ code: ARD_EMIT_CODES.SURFACE_SKIPPED,
156
+ severity: 'warning',
157
+ message: `skipped ${item.kind} "${item.name}": ${item.reason}`,
158
+ };
159
+ }
160
+ /** The finding one shadowed override key becomes, pointing at the dead config block. */
161
+ function shadowedFinding(item) {
162
+ return {
163
+ code: ARD_EMIT_CODES.OVERRIDE_KEY_SHADOWED,
164
+ severity: 'info',
165
+ message: `ignored \`ard.entries.${item.shadowedKey}\`: the ${item.kind} "${item.name}" is also named ` +
166
+ `by \`ard.entries."${item.winningKey}"\`, and the kind-qualified key wins. Nothing in the ` +
167
+ 'bare block was read — fold it into the qualified one or delete it.',
168
+ field: `ard.entries.${item.shadowedKey}`,
169
+ };
170
+ }
171
+ /** Pure: the report a result becomes, so the status rule is unit-testable. */
172
+ export function buildArdEmitReport(result) {
173
+ return buildReport({
174
+ // Every configured surface the run considered: the ones that became
175
+ // entries and the ones it had to skip.
176
+ examined: result.entryCount + result.skipped.length,
177
+ findings: [...result.skipped.map(skippedFinding), ...result.shadowed.map(shadowedFinding)],
178
+ data: {
179
+ outputPath: result.outputPath,
180
+ entryCount: result.entryCount,
181
+ skippedCount: result.skipped.length,
182
+ shadowedCount: result.shadowed.length,
183
+ },
184
+ });
185
+ }
186
+ /**
187
+ * Why `--strict` fails this run, or `undefined` when it does not.
188
+ *
189
+ * ⚠️ A shadowed override key is deliberately NOT a strict failure: the
190
+ * precedence is deterministic and documented, the entry is still emitted, and
191
+ * nothing about the published manifest is wrong. What `--strict` gates is the
192
+ * manifest's CONTENT — a surface an author declared and a consumer will never
193
+ * see, and the empty document that is the limit case of that.
194
+ */
195
+ function strictFailure(report) {
196
+ const { skippedCount, entryCount } = report.data;
197
+ if (skippedCount > 0) {
198
+ const surfaces = skippedCount === 1 ? '1 configured surface was' : `${skippedCount} configured surfaces were`;
199
+ // Not "see above": in `--format json` the reasons are IN the report, not on
200
+ // stderr, so a message naming a position would be wrong on one of the two
201
+ // channels.
202
+ return `--strict: ${surfaces} not advertised — each is named, with its reason, in this run's \`findings\`.`;
203
+ }
204
+ if (entryCount === 0) {
205
+ return '--strict: the manifest advertises nothing. Nothing this project declares became an ARD entry.';
206
+ }
207
+ return undefined;
208
+ }
209
+ /** The human rendering: findings on stderr, the one summary line on stdout. */
210
+ function writeArdEmitText(report) {
211
+ for (const finding of report.findings) {
212
+ process.stderr.write(`${finding.message}\n`);
213
+ }
214
+ const { entryCount, outputPath } = report.data;
215
+ process.stdout.write(`Wrote ${entryCount} ARD entr${entryCount === 1 ? 'y' : 'ies'} to ${outputPath}\n`);
216
+ }
217
+ /** Action handler for `vat ard emit`. */
218
+ export async function ardEmitCommand(options) {
219
+ const logger = createLogger(options.debug === true ? { debug: true } : {});
220
+ const startTime = Date.now();
221
+ try {
222
+ const report = { ...buildArdEmitReport(await runArdEmit(options)), durationMs: Date.now() - startTime };
223
+ if (options.format === 'json') {
224
+ // The report carries every skipped and shadowed surface in full, so the
225
+ // stderr lines would be the same facts twice on two channels.
226
+ writeJsonOutput(report);
227
+ }
228
+ else {
229
+ writeArdEmitText(report);
230
+ }
231
+ const failure = options.strict === true ? strictFailure(report) : undefined;
232
+ if (failure !== undefined) {
233
+ process.stderr.write(`${failure}\n`);
234
+ process.exit(ExitCode.FINDINGS);
235
+ }
236
+ }
237
+ catch (error) {
238
+ // 🔑 THE RULE, in one sentence: **exit 1 means VAT read this project and
239
+ // produced no manifest by its own rules — it declares no `ard:` block, or a
240
+ // surface could not be derived into a conformant entry; exit 2 means VAT
241
+ // never got that far — no project root, no config file, a config it cannot
242
+ // parse, or an unexpected internal failure.**
243
+ //
244
+ // ⚠️ Not "1 is reserved for a check that ran and failed": `ard emit` is not
245
+ // a check, and "no `ard:` block" is not a failed one. The distinction that
246
+ // matters to a caller is whether the PROJECT is the subject (1) or the
247
+ // INVOCATION is (2) — the first is fixed by editing config, the second by
248
+ // fixing the command line or the file itself. A CI job that tolerates
249
+ // repositories which have not opted into ARD keys on exactly that split.
250
+ //
251
+ // Exit 2 is also what `vat okf validate` documents for the same conditions,
252
+ // and what an invalid config already did here through `handleReportCommandError`.
253
+ // The old split had a missing config file exiting 1 and an invalid one
254
+ // exiting 2 while the help called 2 "Unexpected internal failure" — so a CI
255
+ // job reading 2 as a crash was paged for a typo.
256
+ //
257
+ // ⚠️ Both endings publish their document through `handleReportExpectedFailure`,
258
+ // in the format the operator asked for. Written inline they published
259
+ // NOTHING — a `--format json` run of the commonest case of all, a
260
+ // repository that never opted into ARD, wrote zero bytes to stdout and left
261
+ // a CI wrapper parsing stderr for a fact the report is supposed to carry.
262
+ //
263
+ // 🪤 `return` the call, though its type is `never`: under test `process.exit`
264
+ // is a spy that RETURNS, so a bare call falls through to the handler below
265
+ // and the run records a second exit — the same reason the inline endings
266
+ // this replaced each carried a `return`.
267
+ if (error instanceof ArdConfigMissingError) {
268
+ return handleReportExpectedFailure(error.message, error.absence === 'no-ard-block' ? ExitCode.FINDINGS : ExitCode.ERROR, startTime, options.format);
269
+ }
270
+ if (error instanceof ArdDerivationError) {
271
+ return handleReportExpectedFailure(error.message, ExitCode.FINDINGS, startTime, options.format);
272
+ }
273
+ handleReportCommandError(error, logger, startTime, 'ARD emit', options.format);
274
+ }
275
+ }
276
+ //# sourceMappingURL=emit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.js","sourceRoot":"","sources":["../../../src/commands/ard/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,gBAAgB,GAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,E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;QAC9E,2EAA2E;QAC3E,yEAAyE;QACzE,yCAAyC;QACzC,IAAI,KAAK,YAAY,qBAAqB,EAAE,CAAC;YAC3C,OAAO,2BAA2B,CAChC,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,OAAO,KAAK,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EACrE,SAAS,EACT,OAAO,CAAC,MAAM,CACf,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;YACxC,OAAO,2BAA2B,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAClG,CAAC;QACD,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACjF,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `vat ard` — Agentic Resource Discovery emission.
3
+ *
4
+ * Not registered in `command-loaders.ts` by this module: the loader table is
5
+ * owned elsewhere, and this file only builds the command.
6
+ */
7
+ import { Command } from 'commander';
8
+ export { ardEmitCommand, buildArdEmitReport, runArdEmit, ArdConfigMissingError, DEFAULT_ARD_OUTPUT, type ArdEmitReport, } from './emit.js';
9
+ export { collectArdSurfaces, type ArdSurfaceCollection, type SkippedArdSurface } from './surfaces.js';
10
+ /** Build the `vat ard` command group. */
11
+ export declare function createArdCommand(): Command;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/ard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,aAAa,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtG,yCAAyC;AACzC,wBAAgB,gBAAgB,IAAI,OAAO,CAgF1C"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * `vat ard` — Agentic Resource Discovery emission.
3
+ *
4
+ * Not registered in `command-loaders.ts` by this module: the loader table is
5
+ * owned elsewhere, and this file only builds the command.
6
+ */
7
+ import { Command, Option } from 'commander';
8
+ import { ardEmitCommand, DEFAULT_ARD_OUTPUT } from './emit.js';
9
+ export { ardEmitCommand, buildArdEmitReport, runArdEmit, ArdConfigMissingError, DEFAULT_ARD_OUTPUT, } from './emit.js';
10
+ export { collectArdSurfaces } from './surfaces.js';
11
+ /** Build the `vat ard` command group. */
12
+ export function createArdCommand() {
13
+ const ard = new Command('ard');
14
+ ard.description('Emit an Agentic Resource Discovery (ARD) manifest for this project').addHelpText('after', `
15
+ Description:
16
+ ARD has no registry and no upload: a publisher hosts a JSON-LD document at
17
+ https://{domain}/.well-known/ard.json and registries crawl it. VAT builds that
18
+ document out of the surfaces this project already declares.
19
+
20
+ ⚠️ ARD is v0.91, status Proposal. VAT emits against it and reads nothing back.
21
+ `);
22
+ ard
23
+ .command('emit')
24
+ .description('Build the ARD manifest and write it to disk')
25
+ .option('-o, --output <path>', `Output path (default: ${DEFAULT_ARD_OUTPUT})`)
26
+ .option('--project-root <dir>', 'Project root to read the config from (default: cwd)')
27
+ .addOption(
28
+ // Rejected by Commander rather than falling through to `text`, as the
29
+ // sibling `vat okf validate` does: `--format Json` in a pipeline must
30
+ // fail HERE, where the mistake is, not downstream in `jq`.
31
+ new Option('--format <format>', 'Output format: text (default) or json')
32
+ .choices(['text', 'json'])
33
+ .default('text'))
34
+ .option('--strict', 'Exit 1 when the manifest advertises nothing, or a configured surface was skipped')
35
+ .option('--debug', 'Verbose logging to stderr')
36
+ .action(ardEmitCommand)
37
+ .addHelpText('after', `
38
+ Derivation:
39
+ Every published skill in \`skills.config\` becomes an entry, typed
40
+ application/ai-skill+md — a media type VAT COINS, since the specification
41
+ names none for a skill (it occurs once, in an example).
42
+
43
+ A marketplace, an OKF bundle and an MCP server are emitted ONLY when the
44
+ author supplies \`ard.entries."<kind>:<name>".type\`; the specification names
45
+ no media type for any of them, and VAT does not guess. Skipped surfaces are
46
+ reported on stderr — including a \`skills.config\` key that discovery does not
47
+ find, which is never advertised.
48
+
49
+ \`ard.entries\` is keyed by "<kind>:<name>" — skills, marketplaces and OKF
50
+ bundles are independent key spaces, so a bare name that matches two of them
51
+ is REFUSED rather than applied to both.
52
+
53
+ \`representativeQueries\` is authored, never generated. Its absence is a
54
+ conformance WARNING upstream, not an error — an honest gap beats a
55
+ fabricated query that makes a resource discoverable for the wrong task.
56
+
57
+ Requirements:
58
+ ard.publisher Required — anchors every entry URN.
59
+ ard.baseUrl Required in practice — VAT has no inline artifact document for
60
+ these surfaces, so without it no entry has a \`url\` or a
61
+ \`data\` and emission fails.
62
+
63
+ Exit Codes:
64
+ 0 - Manifest written — INCLUDING one that advertises nothing. An empty
65
+ \`entries\` list is a legal ARD document, and skipped surfaces are reported
66
+ on stderr at this exit code. Gate on \`--format json\` (the report
67
+ envelope: \`examined\`, \`findings\`, \`summary\`, \`data.entryCount\`,
68
+ \`data.skippedCount\`; schema: packages/cli/schemas/ard-emit.json), or
69
+ make both conditions fail with \`--strict\`
70
+ 1 - No \`ard:\` block in the config, or a surface could not be derived. Under
71
+ \`--strict\`, also an empty manifest or a skipped surface
72
+ 2 - System error (no project root, no config file, invalid config, unexpected
73
+ internal failure)
74
+
75
+ Example:
76
+ $ vat ard emit --format json --strict
77
+ `);
78
+ return ard;
79
+ }
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/ard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,kBAAkB,EAAqD,MAAM,eAAe,CAAC;AAEtG,yCAAyC;AACzC,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAE/B,GAAG,CAAC,WAAW,CAAC,oEAAoE,CAAC,CAAC,WAAW,CAC/F,OAAO,EACP;;;;;;;CAOH,CACE,CAAC;IAEF,GAAG;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,qBAAqB,EAAE,yBAAyB,kBAAkB,GAAG,CAAC;SAC7E,MAAM,CAAC,sBAAsB,EAAE,qDAAqD,CAAC;SACrF,SAAS;IACR,sEAAsE;IACtE,sEAAsE;IACtE,2DAA2D;IAC3D,IAAI,MAAM,CAAC,mBAAmB,EAAE,uCAAuC,CAAC;SACrE,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACzB,OAAO,CAAC,MAAM,CAAC,CACnB;SACA,MAAM,CACL,UAAU,EACV,kFAAkF,CACnF;SACA,MAAM,CAAC,SAAS,EAAE,2BAA2B,CAAC;SAC9C,MAAM,CAAC,cAAc,CAAC;SACtB,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCL,CACI,CAAC;IAEJ,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Reading the project config for the surfaces an ARD manifest can advertise.
3
+ *
4
+ * Everything here is pure — config in, surfaces out — so the derivation rules
5
+ * are unit-testable without touching a filesystem or a manifest.
6
+ *
7
+ * ## Two collectors, because two rules
8
+ *
9
+ * A **skill** derives its media type from the surface kind alone, so every
10
+ * published skill becomes an entry with no author action. A **marketplace**, an
11
+ * **OKF bundle** and an MCP server derive nothing: the ARD specification names
12
+ * no media type for any of them (see `deriveArdMediaType`), so they are emitted
13
+ * only when the author supplies `ard.entries.<name>.type`, and are otherwise
14
+ * *reported as skipped* — never silently dropped, and never guessed at.
15
+ */
16
+ import { type ArdSurface, type ArdSurfaceKind, type ProjectConfig } from '@vibe-agent-toolkit/resources';
17
+ /** A surface VAT declined to emit, and the reason a reader can act on. */
18
+ export interface SkippedArdSurface {
19
+ readonly name: string;
20
+ readonly kind: ArdSurfaceKind;
21
+ readonly reason: string;
22
+ }
23
+ export interface ArdSurfaceCollection {
24
+ readonly surfaces: readonly ArdSurface[];
25
+ readonly skipped: readonly SkippedArdSurface[];
26
+ }
27
+ /** Facts that apply to every surface in a run, derived once by the caller. */
28
+ export interface ArdSurfaceDefaults {
29
+ /** The project's own package version, when it has one. */
30
+ readonly version?: string | undefined;
31
+ /**
32
+ * Names of the skills `skills.include` discovery actually found.
33
+ *
34
+ * 🚨 Without this, every `skills.config` key was advertised on the author's
35
+ * word alone: a project with NO `skills/` directory and two config keys
36
+ * emitted two entries carrying real URLs at exit 0, with nothing on stderr —
37
+ * a published discovery document that is entirely 404s. The `skipped` channel
38
+ * exists so a surface is never silently DROPPED; the mirror case, silently
39
+ * INVENTING one, had no guard at all.
40
+ *
41
+ * Supplied by the caller rather than crawled here so this module stays pure,
42
+ * and `undefined` rather than `[]` when discovery did not run — an empty
43
+ * array is the answer "nothing exists", which must not be spelled the same
44
+ * way as "nobody asked".
45
+ */
46
+ readonly discoveredSkills?: readonly string[] | undefined;
47
+ }
48
+ /**
49
+ * Every surface the project config declares, split into what VAT will emit and
50
+ * what it declined to.
51
+ *
52
+ * @throws never — a config with no `ard` block yields an empty collection; the
53
+ * caller decides whether that is a failure (`runArdEmit` does).
54
+ */
55
+ export declare function collectArdSurfaces(config: ProjectConfig, defaults: ArdSurfaceDefaults): ArdSurfaceCollection;
56
+ //# sourceMappingURL=surfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../../../src/commands/ard/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AAEvC,0EAA0E;AAC1E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD;AAED,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAC3D;AA+ID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,CAwBtB"}