@vibesdotdev/cli 0.0.1

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 (432) hide show
  1. package/README.md +41 -0
  2. package/SPEC.md +97 -0
  3. package/bin/vibes.ts +26 -0
  4. package/dist/api/client/factory.d.ts +29 -0
  5. package/dist/api/client/factory.d.ts.map +1 -0
  6. package/dist/api/client/factory.js +189 -0
  7. package/dist/api/client/factory.js.map +1 -0
  8. package/dist/api/schemas/common.d.ts +58 -0
  9. package/dist/api/schemas/common.d.ts.map +1 -0
  10. package/dist/api/schemas/common.js +48 -0
  11. package/dist/api/schemas/common.js.map +1 -0
  12. package/dist/api/schemas/types.d.ts +30 -0
  13. package/dist/api/schemas/types.d.ts.map +1 -0
  14. package/dist/api/schemas/types.js +2 -0
  15. package/dist/api/schemas/types.js.map +1 -0
  16. package/dist/api/services/api.d.ts +14 -0
  17. package/dist/api/services/api.d.ts.map +1 -0
  18. package/dist/api/services/api.js +110 -0
  19. package/dist/api/services/api.js.map +1 -0
  20. package/dist/api/types.d.ts +6 -0
  21. package/dist/api/types.d.ts.map +1 -0
  22. package/dist/api/types.js +5 -0
  23. package/dist/api/types.js.map +1 -0
  24. package/dist/bin.d.ts +28 -0
  25. package/dist/bin.d.ts.map +1 -0
  26. package/dist/bin.js +73 -0
  27. package/dist/bin.js.map +1 -0
  28. package/dist/bootstrap.d.ts +14 -0
  29. package/dist/bootstrap.d.ts.map +1 -0
  30. package/dist/bootstrap.js +14 -0
  31. package/dist/bootstrap.js.map +1 -0
  32. package/dist/cli.plugin.d.ts +20 -0
  33. package/dist/cli.plugin.d.ts.map +1 -0
  34. package/dist/cli.plugin.js +170 -0
  35. package/dist/cli.plugin.js.map +1 -0
  36. package/dist/commands/completion/bash.d.ts +8 -0
  37. package/dist/commands/completion/bash.d.ts.map +1 -0
  38. package/dist/commands/completion/bash.js +60 -0
  39. package/dist/commands/completion/bash.js.map +1 -0
  40. package/dist/commands/completion/completion.descriptor.d.ts +10 -0
  41. package/dist/commands/completion/completion.descriptor.d.ts.map +1 -0
  42. package/dist/commands/completion/completion.descriptor.js +41 -0
  43. package/dist/commands/completion/completion.descriptor.js.map +1 -0
  44. package/dist/commands/completion/completion.impl.d.ts +12 -0
  45. package/dist/commands/completion/completion.impl.d.ts.map +1 -0
  46. package/dist/commands/completion/completion.impl.js +167 -0
  47. package/dist/commands/completion/completion.impl.js.map +1 -0
  48. package/dist/commands/completion/fig.d.ts +12 -0
  49. package/dist/commands/completion/fig.d.ts.map +1 -0
  50. package/dist/commands/completion/fig.js +71 -0
  51. package/dist/commands/completion/fig.js.map +1 -0
  52. package/dist/commands/completion/fish.d.ts +8 -0
  53. package/dist/commands/completion/fish.d.ts.map +1 -0
  54. package/dist/commands/completion/fish.js +38 -0
  55. package/dist/commands/completion/fish.js.map +1 -0
  56. package/dist/commands/completion/tree.d.ts +33 -0
  57. package/dist/commands/completion/tree.d.ts.map +1 -0
  58. package/dist/commands/completion/tree.js +75 -0
  59. package/dist/commands/completion/tree.js.map +1 -0
  60. package/dist/commands/completion/zsh-widget.d.ts +13 -0
  61. package/dist/commands/completion/zsh-widget.d.ts.map +1 -0
  62. package/dist/commands/completion/zsh-widget.js +39 -0
  63. package/dist/commands/completion/zsh-widget.js.map +1 -0
  64. package/dist/commands/completion/zsh.d.ts +9 -0
  65. package/dist/commands/completion/zsh.d.ts.map +1 -0
  66. package/dist/commands/completion/zsh.js +146 -0
  67. package/dist/commands/completion/zsh.js.map +1 -0
  68. package/dist/commands/profile/_utils.d.ts +21 -0
  69. package/dist/commands/profile/_utils.d.ts.map +1 -0
  70. package/dist/commands/profile/_utils.js +61 -0
  71. package/dist/commands/profile/_utils.js.map +1 -0
  72. package/dist/commands/profile/profile-group.descriptor.d.ts +4 -0
  73. package/dist/commands/profile/profile-group.descriptor.d.ts.map +1 -0
  74. package/dist/commands/profile/profile-group.descriptor.js +12 -0
  75. package/dist/commands/profile/profile-group.descriptor.js.map +1 -0
  76. package/dist/commands/profile/profile.create.descriptor.d.ts +4 -0
  77. package/dist/commands/profile/profile.create.descriptor.d.ts.map +1 -0
  78. package/dist/commands/profile/profile.create.descriptor.js +22 -0
  79. package/dist/commands/profile/profile.create.descriptor.js.map +1 -0
  80. package/dist/commands/profile/profile.create.impl.d.ts +10 -0
  81. package/dist/commands/profile/profile.create.impl.d.ts.map +1 -0
  82. package/dist/commands/profile/profile.create.impl.js +29 -0
  83. package/dist/commands/profile/profile.create.impl.js.map +1 -0
  84. package/dist/commands/profile/profile.delete.descriptor.d.ts +4 -0
  85. package/dist/commands/profile/profile.delete.descriptor.d.ts.map +1 -0
  86. package/dist/commands/profile/profile.delete.descriptor.js +29 -0
  87. package/dist/commands/profile/profile.delete.descriptor.js.map +1 -0
  88. package/dist/commands/profile/profile.delete.impl.d.ts +11 -0
  89. package/dist/commands/profile/profile.delete.impl.d.ts.map +1 -0
  90. package/dist/commands/profile/profile.delete.impl.js +50 -0
  91. package/dist/commands/profile/profile.delete.impl.js.map +1 -0
  92. package/dist/commands/profile/profile.info.descriptor.d.ts +4 -0
  93. package/dist/commands/profile/profile.info.descriptor.d.ts.map +1 -0
  94. package/dist/commands/profile/profile.info.descriptor.js +23 -0
  95. package/dist/commands/profile/profile.info.descriptor.js.map +1 -0
  96. package/dist/commands/profile/profile.info.impl.d.ts +10 -0
  97. package/dist/commands/profile/profile.info.impl.d.ts.map +1 -0
  98. package/dist/commands/profile/profile.info.impl.js +33 -0
  99. package/dist/commands/profile/profile.info.impl.js.map +1 -0
  100. package/dist/commands/profile/profile.list.descriptor.d.ts +4 -0
  101. package/dist/commands/profile/profile.list.descriptor.d.ts.map +1 -0
  102. package/dist/commands/profile/profile.list.descriptor.js +16 -0
  103. package/dist/commands/profile/profile.list.descriptor.js.map +1 -0
  104. package/dist/commands/profile/profile.list.impl.d.ts +10 -0
  105. package/dist/commands/profile/profile.list.impl.d.ts.map +1 -0
  106. package/dist/commands/profile/profile.list.impl.js +33 -0
  107. package/dist/commands/profile/profile.list.impl.js.map +1 -0
  108. package/dist/commands/profile/profile.use.descriptor.d.ts +4 -0
  109. package/dist/commands/profile/profile.use.descriptor.d.ts.map +1 -0
  110. package/dist/commands/profile/profile.use.descriptor.js +23 -0
  111. package/dist/commands/profile/profile.use.descriptor.js.map +1 -0
  112. package/dist/commands/profile/profile.use.impl.d.ts +10 -0
  113. package/dist/commands/profile/profile.use.impl.d.ts.map +1 -0
  114. package/dist/commands/profile/profile.use.impl.js +24 -0
  115. package/dist/commands/profile/profile.use.impl.js.map +1 -0
  116. package/dist/commands/runtime/_logging.d.ts +11 -0
  117. package/dist/commands/runtime/_logging.d.ts.map +1 -0
  118. package/dist/commands/runtime/_logging.js +40 -0
  119. package/dist/commands/runtime/_logging.js.map +1 -0
  120. package/dist/commands/runtime/codegen.command.descriptor.d.ts +15 -0
  121. package/dist/commands/runtime/codegen.command.descriptor.d.ts.map +1 -0
  122. package/dist/commands/runtime/codegen.command.descriptor.js +18 -0
  123. package/dist/commands/runtime/codegen.command.descriptor.js.map +1 -0
  124. package/dist/commands/runtime/codegen.command.impl.d.ts +4 -0
  125. package/dist/commands/runtime/codegen.command.impl.d.ts.map +1 -0
  126. package/dist/commands/runtime/codegen.command.impl.js +39 -0
  127. package/dist/commands/runtime/codegen.command.impl.js.map +1 -0
  128. package/dist/commands/runtime/codegen.d.ts +17 -0
  129. package/dist/commands/runtime/codegen.d.ts.map +1 -0
  130. package/dist/commands/runtime/codegen.js +65 -0
  131. package/dist/commands/runtime/codegen.js.map +1 -0
  132. package/dist/commands/runtime/index.d.ts +4 -0
  133. package/dist/commands/runtime/index.d.ts.map +1 -0
  134. package/dist/commands/runtime/index.js +8 -0
  135. package/dist/commands/runtime/index.js.map +1 -0
  136. package/dist/commands/runtime/plugin.d.ts +2 -0
  137. package/dist/commands/runtime/plugin.d.ts.map +1 -0
  138. package/dist/commands/runtime/plugin.js +7 -0
  139. package/dist/commands/runtime/plugin.js.map +1 -0
  140. package/dist/commands/runtime/runtime-group.descriptor.d.ts +4 -0
  141. package/dist/commands/runtime/runtime-group.descriptor.d.ts.map +1 -0
  142. package/dist/commands/runtime/runtime-group.descriptor.js +10 -0
  143. package/dist/commands/runtime/runtime-group.descriptor.js.map +1 -0
  144. package/dist/config.d.ts +17 -0
  145. package/dist/config.d.ts.map +1 -0
  146. package/dist/config.js +11 -0
  147. package/dist/config.js.map +1 -0
  148. package/dist/core/index.d.ts +9 -0
  149. package/dist/core/index.d.ts.map +1 -0
  150. package/dist/core/index.js +5 -0
  151. package/dist/core/index.js.map +1 -0
  152. package/dist/core/namespace/hook.d.ts +12 -0
  153. package/dist/core/namespace/hook.d.ts.map +1 -0
  154. package/dist/core/namespace/hook.js +15 -0
  155. package/dist/core/namespace/hook.js.map +1 -0
  156. package/dist/core/namespace/index.d.ts +18 -0
  157. package/dist/core/namespace/index.d.ts.map +1 -0
  158. package/dist/core/namespace/index.js +214 -0
  159. package/dist/core/namespace/index.js.map +1 -0
  160. package/dist/core/namespace/schemas/index.d.ts +25 -0
  161. package/dist/core/namespace/schemas/index.d.ts.map +1 -0
  162. package/dist/core/namespace/schemas/index.js +2 -0
  163. package/dist/core/namespace/schemas/index.js.map +1 -0
  164. package/dist/core/plugins/types.d.ts +81 -0
  165. package/dist/core/plugins/types.d.ts.map +1 -0
  166. package/dist/core/plugins/types.js +6 -0
  167. package/dist/core/plugins/types.js.map +1 -0
  168. package/dist/core/runtime/context.d.ts +25 -0
  169. package/dist/core/runtime/context.d.ts.map +1 -0
  170. package/dist/core/runtime/context.js +30 -0
  171. package/dist/core/runtime/context.js.map +1 -0
  172. package/dist/core/runtime/hooks.d.ts +12 -0
  173. package/dist/core/runtime/hooks.d.ts.map +1 -0
  174. package/dist/core/runtime/hooks.js +2 -0
  175. package/dist/core/runtime/hooks.js.map +1 -0
  176. package/dist/core/runtime/shared/context.d.ts +33 -0
  177. package/dist/core/runtime/shared/context.d.ts.map +1 -0
  178. package/dist/core/runtime/shared/context.js +51 -0
  179. package/dist/core/runtime/shared/context.js.map +1 -0
  180. package/dist/core/runtime/shared/options.d.ts +20 -0
  181. package/dist/core/runtime/shared/options.d.ts.map +1 -0
  182. package/dist/core/runtime/shared/options.js +61 -0
  183. package/dist/core/runtime/shared/options.js.map +1 -0
  184. package/dist/core/schemas/manifest.d.ts +24 -0
  185. package/dist/core/schemas/manifest.d.ts.map +1 -0
  186. package/dist/core/schemas/manifest.js +6 -0
  187. package/dist/core/schemas/manifest.js.map +1 -0
  188. package/dist/core/schemas/types.d.ts +7 -0
  189. package/dist/core/schemas/types.d.ts.map +1 -0
  190. package/dist/core/schemas/types.js +2 -0
  191. package/dist/core/schemas/types.js.map +1 -0
  192. package/dist/core/ui/interface.d.ts +12 -0
  193. package/dist/core/ui/interface.d.ts.map +1 -0
  194. package/dist/core/ui/interface.js +6 -0
  195. package/dist/core/ui/interface.js.map +1 -0
  196. package/dist/docs/cli.commands.docs.descriptor.d.ts +4 -0
  197. package/dist/docs/cli.commands.docs.descriptor.d.ts.map +1 -0
  198. package/dist/docs/cli.commands.docs.descriptor.js +207 -0
  199. package/dist/docs/cli.commands.docs.descriptor.js.map +1 -0
  200. package/dist/docs/cli.groups.docs.descriptor.d.ts +4 -0
  201. package/dist/docs/cli.groups.docs.descriptor.d.ts.map +1 -0
  202. package/dist/docs/cli.groups.docs.descriptor.js +330 -0
  203. package/dist/docs/cli.groups.docs.descriptor.js.map +1 -0
  204. package/dist/docs/cli.output.docs.descriptor.d.ts +4 -0
  205. package/dist/docs/cli.output.docs.descriptor.d.ts.map +1 -0
  206. package/dist/docs/cli.output.docs.descriptor.js +442 -0
  207. package/dist/docs/cli.output.docs.descriptor.js.map +1 -0
  208. package/dist/docs/types.d.ts +19 -0
  209. package/dist/docs/types.d.ts.map +1 -0
  210. package/dist/docs/types.js +2 -0
  211. package/dist/docs/types.js.map +1 -0
  212. package/dist/errors.d.ts +74 -0
  213. package/dist/errors.d.ts.map +1 -0
  214. package/dist/errors.js +113 -0
  215. package/dist/errors.js.map +1 -0
  216. package/dist/index.d.ts +22 -0
  217. package/dist/index.d.ts.map +1 -0
  218. package/dist/index.js +29 -0
  219. package/dist/index.js.map +1 -0
  220. package/dist/logging/cli-startup.logger.descriptor.d.ts +7 -0
  221. package/dist/logging/cli-startup.logger.descriptor.d.ts.map +1 -0
  222. package/dist/logging/cli-startup.logger.descriptor.js +13 -0
  223. package/dist/logging/cli-startup.logger.descriptor.js.map +1 -0
  224. package/dist/logging.d.ts +4 -0
  225. package/dist/logging.d.ts.map +1 -0
  226. package/dist/logging.js +21 -0
  227. package/dist/logging.js.map +1 -0
  228. package/dist/patterns/config-namespace.d.ts +23 -0
  229. package/dist/patterns/config-namespace.d.ts.map +1 -0
  230. package/dist/patterns/config-namespace.js +218 -0
  231. package/dist/patterns/config-namespace.js.map +1 -0
  232. package/dist/patterns/crud.d.ts +23 -0
  233. package/dist/patterns/crud.d.ts.map +1 -0
  234. package/dist/patterns/crud.js +164 -0
  235. package/dist/patterns/crud.js.map +1 -0
  236. package/dist/patterns/index.d.ts +13 -0
  237. package/dist/patterns/index.d.ts.map +1 -0
  238. package/dist/patterns/index.js +13 -0
  239. package/dist/patterns/index.js.map +1 -0
  240. package/dist/patterns/log-viewer.d.ts +19 -0
  241. package/dist/patterns/log-viewer.d.ts.map +1 -0
  242. package/dist/patterns/log-viewer.js +74 -0
  243. package/dist/patterns/log-viewer.js.map +1 -0
  244. package/dist/patterns/pattern-types.d.ts +21 -0
  245. package/dist/patterns/pattern-types.d.ts.map +1 -0
  246. package/dist/patterns/pattern-types.js +7 -0
  247. package/dist/patterns/pattern-types.js.map +1 -0
  248. package/dist/patterns/process-manager.d.ts +21 -0
  249. package/dist/patterns/process-manager.d.ts.map +1 -0
  250. package/dist/patterns/process-manager.js +134 -0
  251. package/dist/patterns/process-manager.js.map +1 -0
  252. package/dist/patterns/resolver.contracts.d.ts +14 -0
  253. package/dist/patterns/resolver.contracts.d.ts.map +1 -0
  254. package/dist/patterns/resolver.contracts.js +9 -0
  255. package/dist/patterns/resolver.contracts.js.map +1 -0
  256. package/dist/patterns/resolver.d.ts +40 -0
  257. package/dist/patterns/resolver.d.ts.map +1 -0
  258. package/dist/patterns/resolver.js +63 -0
  259. package/dist/patterns/resolver.js.map +1 -0
  260. package/dist/patterns/schemas.d.ts +496 -0
  261. package/dist/patterns/schemas.d.ts.map +1 -0
  262. package/dist/patterns/schemas.js +105 -0
  263. package/dist/patterns/schemas.js.map +1 -0
  264. package/dist/patterns/tool-wrapper.d.ts +18 -0
  265. package/dist/patterns/tool-wrapper.d.ts.map +1 -0
  266. package/dist/patterns/tool-wrapper.js +130 -0
  267. package/dist/patterns/tool-wrapper.js.map +1 -0
  268. package/dist/providers.d.ts +105 -0
  269. package/dist/providers.d.ts.map +1 -0
  270. package/dist/providers.js +164 -0
  271. package/dist/providers.js.map +1 -0
  272. package/dist/schemas/descriptors.d.ts +130 -0
  273. package/dist/schemas/descriptors.d.ts.map +1 -0
  274. package/dist/schemas/descriptors.js +96 -0
  275. package/dist/schemas/descriptors.js.map +1 -0
  276. package/dist/schemas/surface.d.ts +40 -0
  277. package/dist/schemas/surface.d.ts.map +1 -0
  278. package/dist/schemas/surface.js +2 -0
  279. package/dist/schemas/surface.js.map +1 -0
  280. package/dist/schemas/types.d.ts +202 -0
  281. package/dist/schemas/types.d.ts.map +1 -0
  282. package/dist/schemas/types.js +2 -0
  283. package/dist/schemas/types.js.map +1 -0
  284. package/dist/support/ui-toolkit.d.ts +62 -0
  285. package/dist/support/ui-toolkit.d.ts.map +1 -0
  286. package/dist/support/ui-toolkit.js +172 -0
  287. package/dist/support/ui-toolkit.js.map +1 -0
  288. package/dist/surface/CLISurface.d.ts +16 -0
  289. package/dist/surface/CLISurface.d.ts.map +1 -0
  290. package/dist/surface/CLISurface.js +173 -0
  291. package/dist/surface/CLISurface.js.map +1 -0
  292. package/dist/surface/attach-tui-action.d.ts +12 -0
  293. package/dist/surface/attach-tui-action.d.ts.map +1 -0
  294. package/dist/surface/attach-tui-action.js +48 -0
  295. package/dist/surface/attach-tui-action.js.map +1 -0
  296. package/dist/surface/build-context.d.ts +4 -0
  297. package/dist/surface/build-context.d.ts.map +1 -0
  298. package/dist/surface/build-context.js +49 -0
  299. package/dist/surface/build-context.js.map +1 -0
  300. package/dist/surface/command-group-policy.d.ts +7 -0
  301. package/dist/surface/command-group-policy.d.ts.map +1 -0
  302. package/dist/surface/command-group-policy.js +42 -0
  303. package/dist/surface/command-group-policy.js.map +1 -0
  304. package/dist/surface/discovery-cache.d.ts +17 -0
  305. package/dist/surface/discovery-cache.d.ts.map +1 -0
  306. package/dist/surface/discovery-cache.js +106 -0
  307. package/dist/surface/discovery-cache.js.map +1 -0
  308. package/dist/surface/register-commands.d.ts +15 -0
  309. package/dist/surface/register-commands.d.ts.map +1 -0
  310. package/dist/surface/register-commands.js +197 -0
  311. package/dist/surface/register-commands.js.map +1 -0
  312. package/dist/surface/register-groups.d.ts +15 -0
  313. package/dist/surface/register-groups.d.ts.map +1 -0
  314. package/dist/surface/register-groups.js +52 -0
  315. package/dist/surface/register-groups.js.map +1 -0
  316. package/dist/surface.d.ts +9 -0
  317. package/dist/surface.d.ts.map +1 -0
  318. package/dist/surface.js +8 -0
  319. package/dist/surface.js.map +1 -0
  320. package/dist/types.d.ts +4 -0
  321. package/dist/types.d.ts.map +1 -0
  322. package/dist/types.js +2 -0
  323. package/dist/types.js.map +1 -0
  324. package/dist/ui/schemas/types.d.ts +2 -0
  325. package/dist/ui/schemas/types.d.ts.map +1 -0
  326. package/dist/ui/schemas/types.js +2 -0
  327. package/dist/ui/schemas/types.js.map +1 -0
  328. package/dist/ui/toolkit/VibesUIToolkit.d.ts +2 -0
  329. package/dist/ui/toolkit/VibesUIToolkit.d.ts.map +1 -0
  330. package/dist/ui/toolkit/VibesUIToolkit.js +2 -0
  331. package/dist/ui/toolkit/VibesUIToolkit.js.map +1 -0
  332. package/dist/ui.context.descriptor.d.ts +21 -0
  333. package/dist/ui.context.descriptor.d.ts.map +1 -0
  334. package/dist/ui.context.descriptor.js +12 -0
  335. package/dist/ui.context.descriptor.js.map +1 -0
  336. package/dist/utils/open.d.ts +2 -0
  337. package/dist/utils/open.d.ts.map +1 -0
  338. package/dist/utils/open.js +30 -0
  339. package/dist/utils/open.js.map +1 -0
  340. package/dist/version.d.ts +2 -0
  341. package/dist/version.d.ts.map +1 -0
  342. package/dist/version.js +2 -0
  343. package/dist/version.js.map +1 -0
  344. package/package.json +186 -0
  345. package/src/api/client/factory.ts +265 -0
  346. package/src/api/schemas/common.ts +50 -0
  347. package/src/api/schemas/types.ts +32 -0
  348. package/src/api/services/api.ts +129 -0
  349. package/src/api/types.ts +12 -0
  350. package/src/bin.ts +84 -0
  351. package/src/bootstrap.ts +19 -0
  352. package/src/cli.plugin.d.ts +19 -0
  353. package/src/cli.plugin.ts +202 -0
  354. package/src/commands/completion/bash.ts +68 -0
  355. package/src/commands/completion/completion.descriptor.ts +48 -0
  356. package/src/commands/completion/completion.impl.ts +188 -0
  357. package/src/commands/completion/fig.ts +78 -0
  358. package/src/commands/completion/fish.ts +52 -0
  359. package/src/commands/completion/tree.ts +115 -0
  360. package/src/commands/completion/zsh-widget.ts +39 -0
  361. package/src/commands/completion/zsh.ts +165 -0
  362. package/src/commands/profile/_utils.ts +72 -0
  363. package/src/commands/profile/profile-group.descriptor.ts +14 -0
  364. package/src/commands/profile/profile.create.descriptor.ts +24 -0
  365. package/src/commands/profile/profile.create.impl.ts +44 -0
  366. package/src/commands/profile/profile.delete.descriptor.ts +31 -0
  367. package/src/commands/profile/profile.delete.impl.ts +71 -0
  368. package/src/commands/profile/profile.info.descriptor.ts +25 -0
  369. package/src/commands/profile/profile.info.impl.ts +51 -0
  370. package/src/commands/profile/profile.list.descriptor.ts +18 -0
  371. package/src/commands/profile/profile.list.impl.ts +46 -0
  372. package/src/commands/profile/profile.use.descriptor.ts +25 -0
  373. package/src/commands/profile/profile.use.impl.ts +39 -0
  374. package/src/commands/runtime/_logging.ts +47 -0
  375. package/src/commands/runtime/codegen.command.descriptor.ts +18 -0
  376. package/src/commands/runtime/codegen.command.impl.ts +44 -0
  377. package/src/commands/runtime/codegen.ts +84 -0
  378. package/src/commands/runtime/index.ts +14 -0
  379. package/src/commands/runtime/plugin.ts +7 -0
  380. package/src/commands/runtime/runtime-group.descriptor.ts +12 -0
  381. package/src/config.ts +22 -0
  382. package/src/core/index.ts +9 -0
  383. package/src/core/namespace/hook.ts +25 -0
  384. package/src/core/namespace/index.ts +298 -0
  385. package/src/core/namespace/schemas/index.ts +25 -0
  386. package/src/core/plugins/types.ts +87 -0
  387. package/src/core/runtime/context.ts +50 -0
  388. package/src/core/runtime/hooks.ts +12 -0
  389. package/src/core/runtime/shared/context.ts +65 -0
  390. package/src/core/runtime/shared/options.ts +60 -0
  391. package/src/core/schemas/manifest.ts +26 -0
  392. package/src/core/schemas/types.ts +6 -0
  393. package/src/core/ui/interface.ts +12 -0
  394. package/src/docs/cli.commands.docs.descriptor.ts +210 -0
  395. package/src/docs/cli.groups.docs.descriptor.ts +333 -0
  396. package/src/docs/cli.output.docs.descriptor.ts +445 -0
  397. package/src/docs/types.ts +18 -0
  398. package/src/errors.ts +123 -0
  399. package/src/index.ts +76 -0
  400. package/src/logging/cli-startup.logger.descriptor.ts +16 -0
  401. package/src/logging.ts +35 -0
  402. package/src/patterns/config-namespace.ts +251 -0
  403. package/src/patterns/crud.ts +217 -0
  404. package/src/patterns/index.ts +24 -0
  405. package/src/patterns/log-viewer.ts +118 -0
  406. package/src/patterns/pattern-types.ts +22 -0
  407. package/src/patterns/process-manager.ts +180 -0
  408. package/src/patterns/resolver.contracts.ts +15 -0
  409. package/src/patterns/resolver.ts +86 -0
  410. package/src/patterns/schemas.ts +146 -0
  411. package/src/patterns/tool-wrapper.ts +165 -0
  412. package/src/providers.ts +282 -0
  413. package/src/schemas/descriptors.d.ts +119 -0
  414. package/src/schemas/descriptors.ts +136 -0
  415. package/src/schemas/surface.ts +52 -0
  416. package/src/schemas/types.d.ts +195 -0
  417. package/src/schemas/types.ts +225 -0
  418. package/src/support/ui-toolkit.ts +224 -0
  419. package/src/surface/CLISurface.ts +193 -0
  420. package/src/surface/attach-tui-action.ts +76 -0
  421. package/src/surface/build-context.ts +49 -0
  422. package/src/surface/command-group-policy.ts +52 -0
  423. package/src/surface/discovery-cache.ts +143 -0
  424. package/src/surface/register-commands.ts +266 -0
  425. package/src/surface/register-groups.ts +84 -0
  426. package/src/surface.ts +9 -0
  427. package/src/types.ts +3 -0
  428. package/src/ui/schemas/types.ts +1 -0
  429. package/src/ui/toolkit/VibesUIToolkit.ts +1 -0
  430. package/src/ui.context.descriptor.ts +13 -0
  431. package/src/utils/open.ts +36 -0
  432. package/src/version.ts +10 -0
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Tool Wrapper Pattern Implementation
3
+ *
4
+ * Wraps a tools/tool as a CLI command.
5
+ */
6
+ export class ToolWrapperPatternImpl {
7
+ runtime;
8
+ constructor(runtime) {
9
+ this.runtime = runtime;
10
+ }
11
+ async register(descriptor, parent, context) {
12
+ const { target, toolWrapper, name, group } = descriptor;
13
+ // Get tool descriptor for metadata
14
+ const toolDesc = this.runtime
15
+ .query(target.kind)
16
+ .withId(target.id)
17
+ .firstDescriptor();
18
+ const description = descriptor.description ?? toolDesc?.description ?? `Run ${name}`;
19
+ const cmd = parent.command(name).description(description);
20
+ // Add arguments
21
+ if (toolWrapper?.arguments) {
22
+ for (const arg of toolWrapper.arguments) {
23
+ const variadic = arg.variadic ? '...' : '';
24
+ const spec = arg.required ? `<${arg.name}${variadic}>` : `[${arg.name}${variadic}]`;
25
+ cmd.argument(spec, arg.description ?? arg.name);
26
+ }
27
+ }
28
+ // Add options
29
+ if (toolWrapper?.options) {
30
+ for (const opt of toolWrapper.options) {
31
+ // Note: In Commander.js, choices must be added as part of addOption(), not chained
32
+ if (opt.choices && opt.choices.length > 0) {
33
+ const { Option } = await import('commander');
34
+ const option = new Option(opt.flags, opt.description ?? opt.toolParam);
35
+ if (opt.default !== undefined)
36
+ option.default(opt.default);
37
+ option.choices(opt.choices);
38
+ cmd.addOption(option);
39
+ }
40
+ else {
41
+ cmd.option(opt.flags, opt.description ?? opt.toolParam, opt.default);
42
+ }
43
+ }
44
+ }
45
+ // Add output format option (avoid clashing with global --format)
46
+ const outputCfg = toolWrapper?.output ?? { format: 'raw' };
47
+ cmd.option('--output-format <format>', 'Output format', outputCfg.format);
48
+ cmd.action(async (...args) => {
49
+ const opts = args.pop();
50
+ const posArgs = args;
51
+ // Build tool input
52
+ const input = {};
53
+ if (toolWrapper?.arguments) {
54
+ toolWrapper.arguments.forEach((arg, i) => {
55
+ if (i < posArgs.length) {
56
+ input[arg.toolParam] = posArgs[i];
57
+ }
58
+ });
59
+ }
60
+ if (toolWrapper?.options) {
61
+ for (const opt of toolWrapper.options) {
62
+ const optName = this.extractOptionName(opt.flags);
63
+ if (opts[optName] !== undefined) {
64
+ input[opt.toolParam] = opts[optName];
65
+ }
66
+ }
67
+ }
68
+ // Execute tool
69
+ const tool = await this.runtime.resolve(target.kind, target.id);
70
+ const logger = await this.runtime.resolve('logging/logger', 'cli');
71
+ const toolCallCtx = {
72
+ callId: `cli:${target.id}:${Date.now()}`,
73
+ logger: logger.child(target.id)
74
+ };
75
+ const result = await tool.execute(input, this.runtime, toolCallCtx);
76
+ this.output(result, String(opts.outputFormat ?? outputCfg.format), context, outputCfg.extractField);
77
+ });
78
+ }
79
+ extractOptionName(flags) {
80
+ const long = flags.match(/--(\w[\w-]*)/);
81
+ if (long)
82
+ return long[1].replace(/-([a-z])/g, (_, c) => c.toUpperCase());
83
+ const short = flags.match(/-(\w)/);
84
+ if (short)
85
+ return short[1];
86
+ throw new Error(`Cannot extract option name from: ${flags}`);
87
+ }
88
+ output(data, format, ctx, extractField) {
89
+ let output = data;
90
+ if (extractField && typeof data === 'object' && data !== null) {
91
+ output = data[extractField] ?? data;
92
+ }
93
+ if (!ctx.ui) {
94
+ if (format === 'raw' && typeof output === 'string') {
95
+ process.stdout.write(`${output}\n`);
96
+ }
97
+ else {
98
+ process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
99
+ }
100
+ return;
101
+ }
102
+ switch (format) {
103
+ case 'raw':
104
+ if (typeof output === 'string') {
105
+ process.stdout.write(`${output}\n`);
106
+ }
107
+ else {
108
+ ctx.ui.json(output);
109
+ }
110
+ break;
111
+ case 'json':
112
+ ctx.ui.json(output);
113
+ break;
114
+ case 'yaml':
115
+ ctx.ui.yaml(output);
116
+ break;
117
+ case 'table':
118
+ if (Array.isArray(output)) {
119
+ ctx.ui.table(output);
120
+ }
121
+ else {
122
+ ctx.ui.yaml(output);
123
+ }
124
+ break;
125
+ default:
126
+ ctx.ui.json(output);
127
+ }
128
+ }
129
+ }
130
+ //# sourceMappingURL=tool-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-wrapper.js","sourceRoot":"","sources":["../../src/patterns/tool-wrapper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,MAAM,OAAO,sBAAsB;IACd;IAApB,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,QAAQ,CACb,UAA2C,EAC3C,MAAe,EACf,OAAuB;QAEvB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC;QAExD,mCAAmC;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO;aAC3B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;aAClB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;aACjB,eAAe,EAAgC,CAAC;QAElD,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,QAAQ,EAAE,WAAW,IAAI,OAAO,IAAI,EAAE,CAAC;QAErF,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE1D,gBAAgB;QAChB,IAAI,WA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E,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;IACF,CAAC;CACD"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * CLI Context Providers
3
+ *
4
+ * Registers CLI-specific context providers with the universal runtime.
5
+ * These contexts are available to CLI commands and patterns.
6
+ */
7
+ import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
8
+ /**
9
+ * UI Context - output formatting and display
10
+ */
11
+ export interface UIContext {
12
+ info(message: string): void;
13
+ success(message: string): void;
14
+ warn(message: string): void;
15
+ error(message: string): void;
16
+ log(message: string): void;
17
+ table(data: unknown[], options?: {
18
+ columns?: string[];
19
+ } | string | string[]): void;
20
+ json(data: unknown): void;
21
+ yaml(data: unknown): void;
22
+ keyValue(data: Record<string, unknown>): void;
23
+ progress(message?: string): {
24
+ update: (nextMessage?: string) => void;
25
+ complete: (nextMessage?: string) => void;
26
+ fail: (nextMessage?: string) => void;
27
+ };
28
+ setFormat(format: 'json' | 'yaml' | 'table' | 'markdown'): void;
29
+ /**
30
+ * Render a value in a caller-selected format. Higher-level convenience over
31
+ * `json` / `yaml` / `table` used by command implementations that defer their
32
+ * output format to an `--output` flag.
33
+ */
34
+ render(data: unknown, options?: {
35
+ format?: 'json' | 'yaml' | 'table' | 'markdown' | 'text';
36
+ }): void | Promise<void>;
37
+ }
38
+ /**
39
+ * Logger Context - structured logging
40
+ */
41
+ export interface LoggerContext {
42
+ info(message: string, meta?: unknown): void;
43
+ warn(message: string, meta?: unknown): void;
44
+ error(message: string, meta?: unknown): void;
45
+ debug(message: string, meta?: unknown): void;
46
+ }
47
+ /**
48
+ * App Context - lifecycle control
49
+ */
50
+ export interface AppContext {
51
+ keepAlive(): void;
52
+ shouldKeepAlive(): boolean;
53
+ exit(code?: number): void;
54
+ }
55
+ export interface ConfigContext {
56
+ get(key: string): Promise<unknown>;
57
+ set(key: string, value: unknown): Promise<void>;
58
+ getNamespace(namespace: string): Promise<Record<string, unknown>>;
59
+ delete(key: string): Promise<void>;
60
+ }
61
+ /**
62
+ * Signal used to abort command execution without forcing process termination.
63
+ * CLISurface catches this and lets the process unwind naturally.
64
+ */
65
+ export declare class CLIExitSignal extends Error {
66
+ readonly code: number;
67
+ constructor(code: number);
68
+ }
69
+ export declare function requestCLIExit(code?: number): never;
70
+ /**
71
+ * CLI Invocation Context - how the CLI was invoked
72
+ */
73
+ export interface CLIContext {
74
+ command: string[];
75
+ bin: string;
76
+ script?: string;
77
+ cwd: string;
78
+ args: string[];
79
+ }
80
+ /**
81
+ * Options for CLI provider registration
82
+ */
83
+ export interface CLIProviderOptions {
84
+ verbose?: boolean;
85
+ format?: 'json' | 'yaml' | 'table' | 'markdown';
86
+ }
87
+ /**
88
+ * Register CLI context providers with the runtime
89
+ *
90
+ * Call this before initializing CLISurface.
91
+ */
92
+ export declare function registerCLIProviders(runtime: VibesRuntime, options?: CLIProviderOptions): void;
93
+ /**
94
+ * Detect output format from CLI arguments
95
+ */
96
+ export declare function detectOutputFormat(): 'json' | 'yaml' | 'table' | 'markdown';
97
+ /**
98
+ * Check if process should keep alive (for long-running commands)
99
+ */
100
+ export declare function shouldKeepAlive(): boolean;
101
+ /**
102
+ * Reset keep alive flag (for testing)
103
+ */
104
+ export declare function resetKeepAlive(): void;
105
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,GAA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AAE,YAAY,EACrB,OAAO,GAAE,kBAAuB,GAC9B,IAAI,CAoFN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAkB3E;AAwCD;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * CLI Context Providers
3
+ *
4
+ * Registers CLI-specific context providers with the universal runtime.
5
+ * These contexts are available to CLI commands and patterns.
6
+ */
7
+ import { VibesUIToolkit } from './support/ui-toolkit';
8
+ import { getLogger } from './logging';
9
+ const providerLogger = getLogger('providers');
10
+ /**
11
+ * Signal used to abort command execution without forcing process termination.
12
+ * CLISurface catches this and lets the process unwind naturally.
13
+ */
14
+ export class CLIExitSignal extends Error {
15
+ code;
16
+ constructor(code) {
17
+ super(`CLI requested exit with code ${code}`);
18
+ this.code = code;
19
+ this.name = 'CLIExitSignal';
20
+ }
21
+ }
22
+ export function requestCLIExit(code = 0) {
23
+ process.exitCode = code;
24
+ throw new CLIExitSignal(code);
25
+ }
26
+ // Shared state for keepAlive across the process
27
+ let keepAliveFlag = false;
28
+ function makeContextLoader(id, factory) {
29
+ return async () => ({
30
+ meta: { id, kind: 'context', priority: 0 },
31
+ impl: { provide: factory }
32
+ });
33
+ }
34
+ /**
35
+ * Register CLI context providers with the runtime
36
+ *
37
+ * Call this before initializing CLISurface.
38
+ */
39
+ export function registerCLIProviders(runtime, options = {}) {
40
+ const format = options.format ?? detectOutputFormat();
41
+ // Debug: Check if context kind exists
42
+ if (!runtime.hasKind('context')) {
43
+ throw new Error('Context kind not registered - cannot register CLI providers');
44
+ }
45
+ const ctx = runtime.assets('context');
46
+ // UI Context
47
+ ctx.registerLoader('cli/ui', makeContextLoader('cli/ui', () => {
48
+ const ui = new VibesUIToolkit({
49
+ mode: 'rich',
50
+ compact: false,
51
+ autoExit: false
52
+ });
53
+ ui.setFormat(format);
54
+ return ui;
55
+ }), {
56
+ constraint: { surfaces: ['cli'] },
57
+ priority: 0
58
+ });
59
+ // Logger Context
60
+ ctx.registerLoader('cli/logger', makeContextLoader('cli/logger', () => ({
61
+ info: (msg, meta) => {
62
+ if (options.verbose)
63
+ providerLogger.info(msg, { meta });
64
+ },
65
+ warn: (msg, meta) => providerLogger.warn(msg, { meta }),
66
+ error: (msg, meta) => providerLogger.error(msg, { meta }),
67
+ debug: (msg, meta) => {
68
+ if (options.verbose)
69
+ providerLogger.debug(msg, { meta });
70
+ }
71
+ })), {
72
+ constraint: { surfaces: ['cli'] },
73
+ priority: 0
74
+ });
75
+ // App Context
76
+ ctx.registerLoader('cli/app', makeContextLoader('cli/app', () => ({
77
+ keepAlive: () => {
78
+ keepAliveFlag = true;
79
+ },
80
+ shouldKeepAlive: () => keepAliveFlag,
81
+ exit: (code = 0) => requestCLIExit(code)
82
+ })), {
83
+ constraint: { surfaces: ['cli'] },
84
+ priority: 0
85
+ });
86
+ // CLI Invocation Context
87
+ ctx.registerLoader('cli/invocation', makeContextLoader('cli/invocation', () => detectCLIInvocation()), {
88
+ constraint: { surfaces: ['cli'] },
89
+ priority: 0
90
+ });
91
+ // Output Format Context
92
+ ctx.registerLoader('cli/output-format', makeContextLoader('cli/output-format', () => format), {
93
+ constraint: { surfaces: ['cli'] },
94
+ priority: 0
95
+ });
96
+ }
97
+ /**
98
+ * Detect output format from CLI arguments
99
+ */
100
+ export function detectOutputFormat() {
101
+ const inline = process.argv.find((arg) => arg.startsWith('--format='));
102
+ if (inline) {
103
+ const fmt = inline.slice('--format='.length).toLowerCase();
104
+ if (fmt === 'json' || fmt === 'yaml' || fmt === 'table' || fmt === 'markdown') {
105
+ return fmt;
106
+ }
107
+ }
108
+ const idx = process.argv.findIndex((arg) => arg === '--format');
109
+ if (idx >= 0 && idx + 1 < process.argv.length) {
110
+ const fmt = String(process.argv[idx + 1]).toLowerCase();
111
+ if (fmt === 'json' || fmt === 'yaml' || fmt === 'table' || fmt === 'markdown') {
112
+ return fmt;
113
+ }
114
+ }
115
+ return 'table';
116
+ }
117
+ /**
118
+ * Detect how the CLI was invoked
119
+ */
120
+ function detectCLIInvocation() {
121
+ const argv = process.argv;
122
+ const cwd = process.cwd();
123
+ const interpreter = argv[0] ?? '';
124
+ const isInterpreted = interpreter.includes('bun') || interpreter.includes('node');
125
+ let command = [];
126
+ let bin = interpreter;
127
+ let script;
128
+ let args = [];
129
+ if (isInterpreted) {
130
+ let scriptIndex = 1;
131
+ while (scriptIndex < argv.length && argv[scriptIndex].startsWith('-')) {
132
+ scriptIndex++;
133
+ }
134
+ if (scriptIndex < argv.length) {
135
+ script = argv[scriptIndex];
136
+ command = [interpreter, ...argv.slice(1, scriptIndex + 1)];
137
+ args = argv.slice(scriptIndex + 1);
138
+ }
139
+ else {
140
+ command = [interpreter];
141
+ args = argv.slice(1);
142
+ }
143
+ bin = command.join(' ');
144
+ }
145
+ else {
146
+ command = [interpreter];
147
+ args = argv.slice(1);
148
+ bin = interpreter;
149
+ }
150
+ return { command, bin, script, cwd, args };
151
+ }
152
+ /**
153
+ * Check if process should keep alive (for long-running commands)
154
+ */
155
+ export function shouldKeepAlive() {
156
+ return keepAliveFlag;
157
+ }
158
+ /**
159
+ * Reset keep alive flag (for testing)
160
+ */
161
+ export function resetKeepAlive() {
162
+ keepAliveFlag = false;
163
+ }
164
+ //# sourceMappingURL=providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;AA0D9C;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACX;IAA5B,YAA4B,IAAY;QACvC,KA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AG,CAAC,CAAC,CAAC,CAAC;YAC3D,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACP,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;YACxB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;QACD,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;SAAM,CAAC;QACP,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QACxB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,GAAG,GAAG,WAAW,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe;IAC9B,OAAO,aAAa,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC7B,aAAa,GAAG,KAAK,CAAC;AACvB,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * CLI Descriptor Schemas
3
+ *
4
+ * Kind-specific descriptor schemas for cli/group and cli/command.
5
+ * These are owned by the CLI module and registered with the runtime via cli.plugin.ts.
6
+ */
7
+ import * as z from 'zod/v4';
8
+ /**
9
+ * Log buffer behavior — controls how CLI output is buffered during command execution.
10
+ */
11
+ export declare const CLILogBufferBehaviorSchema: z.ZodObject<{
12
+ enabled: z.ZodOptional<z.ZodBoolean>;
13
+ sinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ fallbackToStdout: z.ZodOptional<z.ZodBoolean>;
15
+ }, z.core.$strip>;
16
+ /**
17
+ * CLI Group descriptor config — groups organize commands into subcommand trees.
18
+ */
19
+ export declare const CLIGroupDescriptorConfigSchema: z.ZodObject<{
20
+ name: z.ZodString;
21
+ description: z.ZodString;
22
+ parent: z.ZodOptional<z.ZodString>;
23
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ surfaces: z.ZodOptional<z.ZodArray<z.ZodEnum<{
25
+ cli: "cli";
26
+ web: "web";
27
+ worker: "worker";
28
+ bridge: "bridge";
29
+ }>>>;
30
+ internal: z.ZodOptional<z.ZodBoolean>;
31
+ order: z.ZodOptional<z.ZodNumber>;
32
+ logBuffer: z.ZodOptional<z.ZodObject<{
33
+ enabled: z.ZodOptional<z.ZodBoolean>;
34
+ sinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
+ fallbackToStdout: z.ZodOptional<z.ZodBoolean>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>;
38
+ export declare const CLIGroupDescriptorSchema: z.ZodObject<{
39
+ [x: string]: any;
40
+ }, z.core.$strip>;
41
+ /**
42
+ * CLI argument definition
43
+ */
44
+ export declare const CLIArgumentSchema: z.ZodObject<{
45
+ name: z.ZodString;
46
+ description: z.ZodString;
47
+ required: z.ZodOptional<z.ZodBoolean>;
48
+ variadic: z.ZodOptional<z.ZodBoolean>;
49
+ default: z.ZodOptional<z.ZodUnknown>;
50
+ }, z.core.$strip>;
51
+ /**
52
+ * CLI option definition
53
+ */
54
+ export declare const CLIOptionSchema: z.ZodObject<{
55
+ flags: z.ZodString;
56
+ description: z.ZodString;
57
+ default: z.ZodOptional<z.ZodUnknown>;
58
+ choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
+ type: z.ZodOptional<z.ZodEnum<{
60
+ string: "string";
61
+ number: "number";
62
+ boolean: "boolean";
63
+ }>>;
64
+ }, z.core.$strip>;
65
+ /**
66
+ * CLI command example
67
+ */
68
+ export declare const CLICommandExampleSchema: z.ZodObject<{
69
+ command: z.ZodString;
70
+ description: z.ZodString;
71
+ }, z.core.$strip>;
72
+ /**
73
+ * CLI Command descriptor config — individual executable commands.
74
+ */
75
+ export declare const CLICommandDescriptorConfigSchema: z.ZodObject<{
76
+ name: z.ZodString;
77
+ description: z.ZodString;
78
+ group: z.ZodString;
79
+ arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
80
+ name: z.ZodString;
81
+ description: z.ZodString;
82
+ required: z.ZodOptional<z.ZodBoolean>;
83
+ variadic: z.ZodOptional<z.ZodBoolean>;
84
+ default: z.ZodOptional<z.ZodUnknown>;
85
+ }, z.core.$strip>>>;
86
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
87
+ flags: z.ZodString;
88
+ description: z.ZodString;
89
+ default: z.ZodOptional<z.ZodUnknown>;
90
+ choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
+ type: z.ZodOptional<z.ZodEnum<{
92
+ string: "string";
93
+ number: "number";
94
+ boolean: "boolean";
95
+ }>>;
96
+ }, z.core.$strip>>>;
97
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ surfaces: z.ZodOptional<z.ZodArray<z.ZodEnum<{
99
+ cli: "cli";
100
+ web: "web";
101
+ worker: "worker";
102
+ bridge: "bridge";
103
+ }>>>;
104
+ internal: z.ZodOptional<z.ZodBoolean>;
105
+ examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
106
+ command: z.ZodString;
107
+ description: z.ZodString;
108
+ }, z.core.$strip>>>;
109
+ order: z.ZodOptional<z.ZodNumber>;
110
+ tuiAppId: z.ZodOptional<z.ZodString>;
111
+ logBuffer: z.ZodOptional<z.ZodObject<{
112
+ enabled: z.ZodOptional<z.ZodBoolean>;
113
+ sinks: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ fallbackToStdout: z.ZodOptional<z.ZodBoolean>;
115
+ }, z.core.$strip>>;
116
+ }, z.core.$strip>;
117
+ export declare const CLICommandDescriptorSchema: z.ZodObject<{
118
+ [x: string]: any;
119
+ }, z.core.$strip>;
120
+ export type { CLICommandArgument, CLICommandAssetDescriptor, CLICommandExample, CLICommandOption, CLIGroupAssetDescriptor, CLILogBufferBehavior } from './types';
121
+ /**
122
+ * Declaration merging for type-safe runtime asset resolution.
123
+ */
124
+ declare module '@vibesdotdev/runtime/schemas/asset' {
125
+ interface RuntimeAssetSchemaRegistry {
126
+ 'cli/group': CLIGroupAssetDescriptor;
127
+ 'cli/command': CLICommandAssetDescriptor;
128
+ }
129
+ }
130
+ //# sourceMappingURL=descriptors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptors.d.ts","sourceRoot":"","sources":["../../src/schemas/descriptors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAW5B;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;iBAiBzC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;iBAGpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;iBAM1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyB3C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;iBAGtC,CAAC;AACF,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,OAAO,QAAQ,oCAAoC,CAAC;IACnD,UAAU,0BAA0B;QACnC,WAAW,EAAE,uBAAuB,CAAC;QACrC,aAAa,EAAE,yBAAyB,CAAC;KACzC;CACD"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * CLI Descriptor Schemas
3
+ *
4
+ * Kind-specific descriptor schemas for cli/group and cli/command.
5
+ * These are owned by the CLI module and registered with the runtime via cli.plugin.ts.
6
+ */
7
+ import * as z from 'zod/v4';
8
+ import { createRuntimeAssetSchema } from '@vibesdotdev/runtime/schemas/asset';
9
+ /**
10
+ * Log buffer behavior — controls how CLI output is buffered during command execution.
11
+ */
12
+ export const CLILogBufferBehaviorSchema = z.object({
13
+ enabled: z.boolean().optional(),
14
+ sinks: z.array(z.string()).optional(),
15
+ fallbackToStdout: z.boolean().optional()
16
+ });
17
+ /**
18
+ * CLI Group descriptor config — groups organize commands into subcommand trees.
19
+ */
20
+ export const CLIGroupDescriptorConfigSchema = z.object({
21
+ /** Human-readable name */
22
+ name: z.string().min(1),
23
+ /** Description of the group */
24
+ description: z.string().min(1),
25
+ /** Parent group ID (for nested groups) */
26
+ parent: z.string().optional(),
27
+ /** Command aliases */
28
+ aliases: z.array(z.string()).optional(),
29
+ /** Surfaces where this group is available */
30
+ surfaces: z.array(z.enum(['cli', 'web', 'worker', 'bridge'])).optional(),
31
+ /** Whether this group is internal-only unless the surface opts into internal commands */
32
+ internal: z.boolean().optional(),
33
+ /** Sort order within parent */
34
+ order: z.number().int().optional(),
35
+ /** Log buffer behavior for all commands in this group */
36
+ logBuffer: CLILogBufferBehaviorSchema.optional()
37
+ });
38
+ export const CLIGroupDescriptorSchema = createRuntimeAssetSchema('cli/group', CLIGroupDescriptorConfigSchema);
39
+ /**
40
+ * CLI argument definition
41
+ */
42
+ export const CLIArgumentSchema = z.object({
43
+ name: z.string().min(1),
44
+ description: z.string(),
45
+ required: z.boolean().optional(),
46
+ variadic: z.boolean().optional(),
47
+ default: z.unknown().optional()
48
+ });
49
+ /**
50
+ * CLI option definition
51
+ */
52
+ export const CLIOptionSchema = z.object({
53
+ flags: z.string().min(1),
54
+ description: z.string().min(1),
55
+ default: z.unknown().optional(),
56
+ choices: z.array(z.string()).optional(),
57
+ type: z.enum(['string', 'number', 'boolean']).optional()
58
+ });
59
+ /**
60
+ * CLI command example
61
+ */
62
+ export const CLICommandExampleSchema = z.object({
63
+ command: z.string().min(1),
64
+ description: z.string().min(1)
65
+ });
66
+ /**
67
+ * CLI Command descriptor config — individual executable commands.
68
+ */
69
+ export const CLICommandDescriptorConfigSchema = z.object({
70
+ /** Human-readable name */
71
+ name: z.string().min(1),
72
+ /** Description of the command */
73
+ description: z.string().min(1),
74
+ /** Group this command belongs to */
75
+ group: z.string().min(1),
76
+ /** Positional arguments */
77
+ arguments: z.array(CLIArgumentSchema).optional(),
78
+ /** Named options/flags */
79
+ options: z.array(CLIOptionSchema).optional(),
80
+ /** Command aliases */
81
+ aliases: z.array(z.string()).optional(),
82
+ /** Surfaces where this command is available */
83
+ surfaces: z.array(z.enum(['cli', 'web', 'worker', 'bridge'])).optional(),
84
+ /** Whether this command is internal-only unless the surface opts into internal commands */
85
+ internal: z.boolean().optional(),
86
+ /** Examples of command usage */
87
+ examples: z.array(CLICommandExampleSchema).optional(),
88
+ /** Sort order within group */
89
+ order: z.number().int().optional(),
90
+ /** TUI app ID to launch instead of execute() */
91
+ tuiAppId: z.string().optional(),
92
+ /** Log buffer behavior for this command */
93
+ logBuffer: CLILogBufferBehaviorSchema.optional()
94
+ });
95
+ export const CLICommandDescriptorSchema = createRuntimeAssetSchema('cli/command', CLICommandDescriptorConfigSchema);
96
+ //# sourceMappingURL=descriptors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptors.js","sourceRoot":"","sources":["../../src/schemas/descriptors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAU9E;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrC,gBAAgB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