@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,193 @@
1
+ import { Command, CommanderError } from 'commander';
2
+ import { writeSync } from 'node:fs';
3
+ import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
4
+ import { CLIExitSignal, registerCLIProviders, resetKeepAlive, shouldKeepAlive } from '../providers';
5
+ import { createPatternResolver, type PatternResolver } from '../patterns';
6
+ import type { CLIGroupAssetDescriptor } from '../schemas/descriptors';
7
+ import type { CLISurfaceOptions, CommandContext } from '../schemas/surface';
8
+ import { buildCommandContext } from './build-context';
9
+ import { registerGroups } from './register-groups';
10
+ import { registerCommands } from './register-commands';
11
+ import { getLogger } from '../logging';
12
+
13
+ const logger = getLogger('surface');
14
+
15
+ /**
16
+ * Strip frames pointing into the `bun build --compile` virtual filesystem
17
+ * (`/$bunfs/root/vibes.js:...`) and other bundle-only paths. These leak
18
+ * implementation details that aren't actionable for users.
19
+ */
20
+ function stripBundlePaths(text: string): string {
21
+ return text
22
+ .split('\n')
23
+ .filter((line) => {
24
+ if (line.includes('/$bunfs/')) return false;
25
+ if (line.includes('B:/~BUN/')) return false;
26
+ return true;
27
+ })
28
+ .join('\n')
29
+ .trim();
30
+ }
31
+
32
+ /**
33
+ * Map common runtime errors to actionable, user-facing guidance.
34
+ * Falls back to the original message when no mapping applies.
35
+ *
36
+ * Returns `null` when no friendly mapping is known (caller falls back to
37
+ * the raw error message).
38
+ */
39
+ function mapKnownError(rawMessage: string): string | null {
40
+ // "No matching implementation found for query (filtered to: foo.bar)"
41
+ const noMatchingImpl =
42
+ /No matching implementation found for query \(filtered to:\s*([^)]+)\)/i.exec(rawMessage);
43
+ if (noMatchingImpl) {
44
+ const target = noMatchingImpl[1].trim();
45
+ return (
46
+ `No provider for "${target}". The plugin owning this query did not register, ` +
47
+ `or its dependencies are missing. Run with -v for plugin-load details.`
48
+ );
49
+ }
50
+
51
+ // "No available adapter for record 'session.sessions'. Checked: storage.localdb"
52
+ const noAdapter =
53
+ /No available adapter for record\s*'?([^'"\s]+)'?\.?\s*Checked:\s*([^\n]+)/i.exec(rawMessage);
54
+ if (noAdapter) {
55
+ const record = noAdapter[1].trim();
56
+ const checked = noAdapter[2].trim();
57
+ return (
58
+ `No storage adapter is initialized for "${record}" (checked: ${checked}).\n` +
59
+ `Run \`vibes os init\` to set up local storage, or run with -v for details.`
60
+ );
61
+ }
62
+
63
+ if (rawMessage.includes('getRuntimePathSync() called before the runtime path service was resolved')) {
64
+ return (
65
+ 'The runtime path service has not been initialized yet. ' +
66
+ 'This is a bug — please report it. Run with -v for the full stack.'
67
+ );
68
+ }
69
+
70
+ return null;
71
+ }
72
+
73
+ function formatCliError(error: unknown, verbose: boolean): string {
74
+ if (verbose) {
75
+ const text =
76
+ error instanceof Error ? error.stack?.trim() || error.message.trim() : String(error);
77
+ return text;
78
+ }
79
+
80
+ const rawMessage =
81
+ error instanceof Error ? error.message.trim() : String(error).trim();
82
+ const friendly = mapKnownError(rawMessage);
83
+ const body = friendly ?? rawMessage;
84
+ const cleaned = stripBundlePaths(body);
85
+ return cleaned || 'CLI command failed (run with -v for details).';
86
+ }
87
+
88
+ export class CLISurface {
89
+ private groups = new Map<string, Command>();
90
+ private groupDescriptors = new Map<string, CLIGroupAssetDescriptor>();
91
+ private patternResolver: PatternResolver | null = null;
92
+ private initialized = false;
93
+
94
+ constructor(
95
+ private runtime: VibesRuntime,
96
+ private program: Command,
97
+ private options: CLISurfaceOptions = {}
98
+ ) {}
99
+
100
+ async initialize(): Promise<void> {
101
+ if (this.initialized) throw new Error('CLISurface already initialized');
102
+
103
+ const { verbose, enablePatterns } = this.options;
104
+ this.program.exitOverride();
105
+
106
+ registerCLIProviders(this.runtime, this.options);
107
+ if (verbose) logger.debug('Registered context providers');
108
+
109
+ if (enablePatterns) {
110
+ this.patternResolver = await createPatternResolver(this.runtime);
111
+ if (verbose) {
112
+ logger.debug(`Pattern resolver: ${this.patternResolver.getPatternTypes().join(', ')}`);
113
+ }
114
+ }
115
+
116
+ const buildContext = async (): Promise<CommandContext> => buildCommandContext(this.runtime);
117
+
118
+ if (verbose) {
119
+ logger.debug(`Registering groups...`);
120
+ logger.debug(`Runtime assets: cli/group=${this.runtime.assets('cli/group').descriptors().length}, cli/command=${this.runtime.assets('cli/command').descriptors().length}`);
121
+ }
122
+
123
+ await registerGroups({
124
+ runtime: this.runtime,
125
+ program: this.program,
126
+ groups: this.groups,
127
+ groupDescriptors: this.groupDescriptors,
128
+ options: this.options,
129
+ patternResolver: this.patternResolver,
130
+ buildContext
131
+ });
132
+
133
+ if (verbose) logger.debug(`Registered ${this.groups.size} groups`);
134
+
135
+ await registerCommands({
136
+ runtime: this.runtime,
137
+ program: this.program,
138
+ groups: this.groups,
139
+ groupDescriptors: this.groupDescriptors,
140
+ options: this.options,
141
+ patternResolver: this.patternResolver,
142
+ buildContext
143
+ });
144
+
145
+ this.initialized = true;
146
+ if (verbose) logger.debug('Surface initialized');
147
+ }
148
+
149
+ async run(argv: string[] = process.argv): Promise<void> {
150
+ if (!this.initialized) await this.initialize();
151
+ // Ensure stale keepAlive state from eager module side effects never leaks into a new invocation.
152
+ resetKeepAlive();
153
+
154
+ let exitCode: number | undefined;
155
+ try {
156
+ if (argv.slice(2).length === 0) {
157
+ this.program.outputHelp();
158
+ exitCode = 0;
159
+ } else {
160
+ await this.program.parseAsync(argv);
161
+ }
162
+ } catch (error: any) {
163
+ if (error instanceof CLIExitSignal) {
164
+ exitCode = error.code;
165
+ } else if (error instanceof CommanderError || ('exitCode' in error && 'code' in error)) {
166
+ // `commander.help` / `commander.helpDisplayed` / `commander.version`
167
+ // are not failures — they're successful help/version output. Map them
168
+ // to exit 0 so non-TTY callers (CI, subprocesses) treat them the
169
+ // same way TTY users see them.
170
+ const helpCodes = new Set([
171
+ 'commander.help',
172
+ 'commander.helpDisplayed',
173
+ 'commander.version'
174
+ ]);
175
+ exitCode = helpCodes.has(error.code) ? 0 : error.exitCode;
176
+ } else {
177
+ exitCode = 1;
178
+ const formatted = formatCliError(error, !!this.options.verbose);
179
+ if (formatted) {
180
+ writeSync(2, `${formatted}\n`);
181
+ }
182
+ }
183
+ }
184
+
185
+ if (exitCode !== undefined) {
186
+ process.exitCode = exitCode;
187
+ }
188
+ if (!shouldKeepAlive()) {
189
+ if (this.options.onBeforeAutoExit) await this.options.onBeforeAutoExit();
190
+ process.exit(exitCode ?? process.exitCode ?? 0);
191
+ }
192
+ }
193
+ }
@@ -0,0 +1,76 @@
1
+ import type { Command } from 'commander';
2
+ import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
3
+ import type { CLICommandAssetDescriptor } from '../schemas/descriptors';
4
+
5
+ interface TuiActionHooks {
6
+ beforeExecute?: (params: {
7
+ args: Record<string, unknown>;
8
+ options: Record<string, unknown>;
9
+ }) => Promise<void>;
10
+ }
11
+
12
+ export async function attachTuiAction(
13
+ cmd: Command,
14
+ runtime: VibesRuntime,
15
+ descriptor: CLICommandAssetDescriptor,
16
+ hooks: TuiActionHooks = {}
17
+ ): Promise<void> {
18
+ const tuiAppId = descriptor.tuiAppId!;
19
+
20
+ cmd.action(async (...actionArgs: unknown[]) => {
21
+ actionArgs.pop();
22
+ const options = actionArgs.pop() as Record<string, unknown>;
23
+
24
+ const args: Record<string, unknown> = {};
25
+ if (descriptor.arguments) {
26
+ descriptor.arguments.forEach((arg: (typeof descriptor.arguments)[number], i: number) => {
27
+ if (i < actionArgs.length) args[arg.name] = actionArgs[i];
28
+ });
29
+ }
30
+ if (hooks.beforeExecute) {
31
+ await hooks.beforeExecute({ args, options });
32
+ }
33
+
34
+ const { ensureOpenTuiReactRuntimePluginSupport } = (await import(
35
+ '@vibesdotdev/tui/services/runtime-plugin-support.impl.consumer' as string
36
+ )) as {
37
+ ensureOpenTuiReactRuntimePluginSupport: () => boolean;
38
+ };
39
+ ensureOpenTuiReactRuntimePluginSupport();
40
+
41
+ // Dynamic imports to avoid hard dependency on tui/react from cli
42
+ const { startTuiApp } = (await import('@vibesdotdev/tui/services' as string)) as {
43
+ startTuiApp: (opts: Record<string, unknown>) => Promise<void>;
44
+ };
45
+ const { TuiAppShell } = (await import('@vibesdotdev/tui/shell' as string)) as {
46
+ TuiAppShell: unknown;
47
+ };
48
+ const _reactId = 'react';
49
+ const React = (await import(/* @vite-ignore */ _reactId)) as {
50
+ createElement: (type: unknown, props: Record<string, unknown>, ...children: unknown[]) => unknown;
51
+ };
52
+
53
+ const appDescriptor = runtime
54
+ .assets('tui/app')
55
+ .descriptors()
56
+ .find((d: { id: string }) => d.id === tuiAppId) as
57
+ | (Record<string, unknown> & { states?: unknown })
58
+ | undefined;
59
+
60
+ const appImpl = (await runtime.query('tui/app').withId(tuiAppId).resolve()) as {
61
+ component: (props: Record<string, unknown>) => unknown;
62
+ };
63
+
64
+ await startTuiApp({
65
+ errorBoundary: false,
66
+ keyboardProvider: false,
67
+ render: (onExit: () => void) =>
68
+ React.createElement(TuiAppShell as unknown, {
69
+ runtime,
70
+ states: appDescriptor?.states,
71
+ onExit,
72
+ children: React.createElement(appImpl.component, { runtime, onExit, options, args })
73
+ })
74
+ });
75
+ });
76
+ }
@@ -0,0 +1,49 @@
1
+ import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
2
+ import type { AppContext, ConfigContext, LoggerContext, UIContext } from '../providers';
3
+ import type { CommandContext } from '../schemas/surface';
4
+
5
+ export async function buildCommandContext(runtime: VibesRuntime): Promise<CommandContext> {
6
+ const ctx: CommandContext = { runtime };
7
+
8
+ try {
9
+ ctx.ui = await runtime.context<UIContext>('cli/ui');
10
+ } catch {
11
+ try {
12
+ ctx.ui = await runtime.context<UIContext>('ui');
13
+ } catch {
14
+ /* optional */
15
+ }
16
+ }
17
+
18
+ try {
19
+ ctx.logger = await runtime.context<LoggerContext>('cli/logger');
20
+ } catch {
21
+ try {
22
+ ctx.logger = await runtime.context<LoggerContext>('logger');
23
+ } catch {
24
+ /* optional */
25
+ }
26
+ }
27
+
28
+ try {
29
+ ctx.app = await runtime.context<AppContext>('cli/app');
30
+ } catch {
31
+ try {
32
+ ctx.app = await runtime.context<AppContext>('app');
33
+ } catch {
34
+ /* optional */
35
+ }
36
+ }
37
+
38
+ try {
39
+ ctx.config = await runtime.context<ConfigContext>('config/context');
40
+ } catch {
41
+ try {
42
+ ctx.config = await runtime.context<ConfigContext>('config');
43
+ } catch {
44
+ /* optional */
45
+ }
46
+ }
47
+
48
+ return ctx;
49
+ }
@@ -0,0 +1,52 @@
1
+ import type { CLICommandAssetDescriptor } from '../schemas/descriptors';
2
+ import type { CLISurfaceOptions } from '../schemas/surface';
3
+
4
+ export const DEFAULT_ROOT_FALLBACK_GROUPS = Object.freeze([
5
+ 'chat',
6
+ 'shell-integration',
7
+ 'man',
8
+ 'marshal',
9
+ 'settings',
10
+ 'studio',
11
+ 'work'
12
+ ]);
13
+
14
+ export function allowedRootFallbackGroups(options: CLISurfaceOptions): Set<string> {
15
+ const extra = options.rootFallbackGroups ?? [];
16
+ return new Set([...DEFAULT_ROOT_FALLBACK_GROUPS, ...extra]);
17
+ }
18
+
19
+ export function findUnexpectedMissingGroups(
20
+ commands: Array<Pick<CLICommandAssetDescriptor, 'id' | 'group'>>,
21
+ knownGroups: Set<string>,
22
+ rootFallbackGroups: Set<string>
23
+ ): Map<string, string[]> {
24
+ const missing = new Map<string, string[]>();
25
+ for (const descriptor of commands) {
26
+ const groupId = descriptor.group;
27
+ if (knownGroups.has(groupId) || rootFallbackGroups.has(groupId)) continue;
28
+ const commandIds = missing.get(groupId) ?? [];
29
+ commandIds.push(descriptor.id);
30
+ missing.set(groupId, commandIds);
31
+ }
32
+ return missing;
33
+ }
34
+
35
+ export function findScopeMissingGroups(
36
+ commands: Array<Pick<CLICommandAssetDescriptor, 'id' | 'group'>>,
37
+ registeredGroups: Set<string>,
38
+ declaredGroups: Set<string>,
39
+ rootFallbackGroups: Set<string>
40
+ ): Map<string, string[]> {
41
+ const missing = new Map<string, string[]>();
42
+ for (const descriptor of commands) {
43
+ const groupId = descriptor.group;
44
+ if (registeredGroups.has(groupId)) continue;
45
+ if (rootFallbackGroups.has(groupId)) continue;
46
+ if (!declaredGroups.has(groupId)) continue;
47
+ const commandIds = missing.get(groupId) ?? [];
48
+ commandIds.push(descriptor.id);
49
+ missing.set(groupId, commandIds);
50
+ }
51
+ return missing;
52
+ }
@@ -0,0 +1,143 @@
1
+ import type { VibesRuntime } from '@vibesdotdev/runtime/api/runtime';
2
+ import type {
3
+ CLICommandAssetDescriptor,
4
+ CLIGroupAssetDescriptor
5
+ } from '../schemas/descriptors';
6
+
7
+ export interface CLIDiscoveryOptions {
8
+ includeInternal?: boolean;
9
+ }
10
+
11
+ export interface CLIDiscovery {
12
+ allGroups: CLIGroupAssetDescriptor[];
13
+ allCommands: CLICommandAssetDescriptor[];
14
+ groups: CLIGroupAssetDescriptor[];
15
+ commands: CLICommandAssetDescriptor[];
16
+ groupsById: Map<string, CLIGroupAssetDescriptor>;
17
+ sortedGroups: CLIGroupAssetDescriptor[];
18
+ sortedCommands: CLICommandAssetDescriptor[];
19
+ }
20
+
21
+ interface CachedDiscovery {
22
+ fingerprint: string;
23
+ discovery: CLIDiscovery;
24
+ }
25
+
26
+ const discoveryCache = new WeakMap<VibesRuntime, Map<string, CachedDiscovery>>();
27
+
28
+ export function getCLIDiscovery(
29
+ runtime: VibesRuntime,
30
+ options: CLIDiscoveryOptions = {}
31
+ ): CLIDiscovery {
32
+ const includeInternal = options.includeInternal === true;
33
+ const allGroups = runtime.assets('cli/group').descriptors() as CLIGroupAssetDescriptor[];
34
+ const allCommands = runtime.assets('cli/command').descriptors() as CLICommandAssetDescriptor[];
35
+ const scope = runtime.scope;
36
+ const cacheKey = [
37
+ scope.surface ?? '',
38
+ scope.hardware ?? '',
39
+ scope.purpose ?? '',
40
+ includeInternal ? 'internal' : 'public'
41
+ ].join(':');
42
+ const fingerprint = buildFingerprint(allGroups, allCommands);
43
+ let runtimeCache = discoveryCache.get(runtime);
44
+ if (!runtimeCache) {
45
+ runtimeCache = new Map();
46
+ discoveryCache.set(runtime, runtimeCache);
47
+ }
48
+
49
+ const cached = runtimeCache.get(cacheKey);
50
+ if (cached?.fingerprint === fingerprint) return cached.discovery;
51
+
52
+ const groupsById = new Map(allGroups.map((group) => [group.id, group]));
53
+ const groups = allGroups.filter((group) => {
54
+ if (group.enabled === false) return false;
55
+ if (group.hardware?.length && !group.hardware.includes(scope.hardware)) return false;
56
+ if (group.surfaces?.length && !group.surfaces.includes(scope.surface as (typeof group.surfaces)[number]))
57
+ return false;
58
+ if (!includeInternal && group.internal === true) return false;
59
+ return true;
60
+ });
61
+ const commands = allCommands.filter((command) => {
62
+ if (command.enabled === false) return false;
63
+ if (command.hardware?.length && !command.hardware.includes(scope.hardware)) return false;
64
+ if (
65
+ command.surfaces?.length &&
66
+ !command.surfaces.includes(scope.surface as (typeof command.surfaces)[number])
67
+ )
68
+ return false;
69
+ if (!includeInternal && command.internal === true) return false;
70
+ if (!includeInternal && groupsById.get(command.group)?.internal === true) return false;
71
+ return true;
72
+ });
73
+
74
+ const discovery: CLIDiscovery = {
75
+ allGroups,
76
+ allCommands,
77
+ groups,
78
+ commands,
79
+ groupsById,
80
+ sortedGroups: sortGroupsByDepth(groups),
81
+ sortedCommands: [...commands].sort(byOrder)
82
+ };
83
+ runtimeCache.set(cacheKey, { fingerprint, discovery });
84
+ return discovery;
85
+ }
86
+
87
+ export function clearCLIDiscoveryCache(runtime?: VibesRuntime): void {
88
+ if (runtime) {
89
+ discoveryCache.delete(runtime);
90
+ return;
91
+ }
92
+ // WeakMap cannot be cleared. This helper intentionally supports targeted
93
+ // invalidation for tests or runtimes that mutate descriptors after bootstrap.
94
+ }
95
+
96
+ function sortGroupsByDepth(groups: CLIGroupAssetDescriptor[]): CLIGroupAssetDescriptor[] {
97
+ const groupMap = new Map(groups.map((group) => [group.id, group]));
98
+ const depths = new Map<string, number>();
99
+
100
+ const getDepth = (group: CLIGroupAssetDescriptor): number => {
101
+ const existing = depths.get(group.id);
102
+ if (existing !== undefined) return existing;
103
+
104
+ if (!group.parent) {
105
+ depths.set(group.id, 0);
106
+ return 0;
107
+ }
108
+
109
+ const parent = groupMap.get(group.parent);
110
+ if (!parent) {
111
+ depths.set(group.id, 0);
112
+ return 0;
113
+ }
114
+
115
+ const depth = getDepth(parent) + 1;
116
+ depths.set(group.id, depth);
117
+ return depth;
118
+ };
119
+
120
+ for (const group of groups) getDepth(group);
121
+
122
+ return [...groups].sort((a, b) => {
123
+ const depthDiff = (depths.get(a.id) ?? 0) - (depths.get(b.id) ?? 0);
124
+ if (depthDiff !== 0) return depthDiff;
125
+ return byOrder(a, b);
126
+ });
127
+ }
128
+
129
+ function byOrder(
130
+ a: Pick<CLICommandAssetDescriptor | CLIGroupAssetDescriptor, 'order' | 'id'>,
131
+ b: Pick<CLICommandAssetDescriptor | CLIGroupAssetDescriptor, 'order' | 'id'>
132
+ ): number {
133
+ const orderDiff = (a.order ?? 999) - (b.order ?? 999);
134
+ if (orderDiff !== 0) return orderDiff;
135
+ return a.id.localeCompare(b.id);
136
+ }
137
+
138
+ function buildFingerprint(
139
+ groups: CLIGroupAssetDescriptor[],
140
+ commands: CLICommandAssetDescriptor[]
141
+ ): string {
142
+ return JSON.stringify({ groups, commands });
143
+ }