@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,298 @@
1
+ /**
2
+ * CLI Namespace Registry (compatibility layer)
3
+ *
4
+ * Provides a lightweight namespace registry used by legacy config services.
5
+ * New CLI surfaces are descriptor-driven; this module exists to keep older
6
+ * imports functional while commands are migrated.
7
+ */
8
+
9
+ import { join } from 'path';
10
+ import { homedir } from 'os';
11
+ import { mkdir } from 'node:fs/promises';
12
+ import {
13
+ getNestedValue,
14
+ setNestedValue
15
+ } from '@vibesdotdev/config/form/core';
16
+ import type {
17
+ ConfigScope,
18
+ ConfigValue,
19
+ NamespaceDefinition,
20
+ NamespaceListEntry,
21
+ NamespaceConfigAccessor
22
+ } from './schemas';
23
+
24
+ // Config loader — file-based JSON storage
25
+ //
26
+ // Reads/writes scoped config files:
27
+ // global: ~/.vibes/config.json
28
+ // local: ./.vibes/config.json
29
+ // project: ./vibes.config.json
30
+ //
31
+ // When loading with merge=true, configs are deep-merged in specificity order
32
+ // (global < local < project) so more-specific scopes override less-specific.
33
+
34
+ interface LegacyLoadOptions {
35
+ scopes?: string[];
36
+ merge?: boolean;
37
+ }
38
+
39
+ interface LegacySaveOptions {
40
+ scope: ConfigScope;
41
+ format?: string;
42
+ pretty?: boolean;
43
+ encrypt?: boolean;
44
+ merge?: boolean;
45
+ }
46
+
47
+ function getConfigPath(scope: ConfigScope): string {
48
+ switch (scope) {
49
+ case 'global':
50
+ return join(homedir(), '.vibes', 'config.json');
51
+ case 'local':
52
+ return join(process.cwd(), '.vibes', 'config.json');
53
+ case 'project':
54
+ return join(process.cwd(), 'vibes.config.json');
55
+ }
56
+ }
57
+
58
+ async function readJsonFile(path: string): Promise<Record<string, ConfigValue>> {
59
+ try {
60
+ const file = Bun.file(path);
61
+ if (!(await file.exists())) return {};
62
+ const text = await file.text();
63
+ const parsed = JSON.parse(text);
64
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
65
+ return parsed as Record<string, ConfigValue>;
66
+ }
67
+ return {};
68
+ } catch {
69
+ return {};
70
+ }
71
+ }
72
+
73
+ function deepMergeConfigs(
74
+ target: Record<string, ConfigValue>,
75
+ source: Record<string, ConfigValue>
76
+ ): Record<string, ConfigValue> {
77
+ const result = { ...target };
78
+ for (const [key, value] of Object.entries(source)) {
79
+ const existing = result[key];
80
+ if (
81
+ value && typeof value === 'object' && !Array.isArray(value) &&
82
+ existing && typeof existing === 'object' && !Array.isArray(existing)
83
+ ) {
84
+ result[key] = deepMergeConfigs(
85
+ existing as Record<string, ConfigValue>,
86
+ value as Record<string, ConfigValue>
87
+ );
88
+ } else {
89
+ result[key] = value;
90
+ }
91
+ }
92
+ return result;
93
+ }
94
+
95
+ async function loadConfig(options: LegacyLoadOptions): Promise<{ config: Record<string, ConfigValue> }> {
96
+ const scopes = (options.scopes ?? ['global', 'project', 'local']) as ConfigScope[];
97
+ const merge = options.merge ?? true;
98
+
99
+ // Specificity order: global < local < project
100
+ const scopeOrder: ConfigScope[] = ['global', 'local', 'project'];
101
+ const orderedScopes = scopeOrder.filter((s) => scopes.includes(s));
102
+
103
+ let merged: Record<string, ConfigValue> = {};
104
+
105
+ for (const scope of orderedScopes) {
106
+ const data = await readJsonFile(getConfigPath(scope));
107
+ if (Object.keys(data).length === 0) continue;
108
+
109
+ if (merge) {
110
+ merged = deepMergeConfigs(merged, data);
111
+ } else {
112
+ // Return first found
113
+ return { config: data };
114
+ }
115
+ }
116
+
117
+ return { config: merged };
118
+ }
119
+
120
+ async function saveConfig(config: Record<string, ConfigValue>, options: LegacySaveOptions): Promise<void> {
121
+ const filePath = getConfigPath(options.scope);
122
+ const dir = filePath.substring(0, filePath.lastIndexOf('/'));
123
+
124
+ await mkdir(dir, { recursive: true });
125
+
126
+ let dataToWrite: Record<string, ConfigValue>;
127
+
128
+ if (options.merge !== false) {
129
+ // Merge with existing content at this scope
130
+ const existing = await readJsonFile(filePath);
131
+ dataToWrite = deepMergeConfigs(existing, config);
132
+ } else {
133
+ dataToWrite = config;
134
+ }
135
+
136
+ const pretty = options.pretty !== false;
137
+ const content = JSON.stringify(dataToWrite, null, pretty ? 2 : 0);
138
+ await Bun.write(filePath, content);
139
+ }
140
+
141
+
142
+ function asObject(
143
+ value: ConfigValue | Record<string, ConfigValue> | undefined
144
+ ): Record<string, ConfigValue> {
145
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
146
+ return {};
147
+ }
148
+ return value as Record<string, ConfigValue>;
149
+ }
150
+
151
+ function deleteNestedValue(root: Record<string, ConfigValue>, path: string): void {
152
+ const parts = path.split('.').filter(Boolean);
153
+ if (parts.length === 0) return;
154
+
155
+ let current = root;
156
+ for (let i = 0; i < parts.length - 1; i++) {
157
+ const key = parts[i];
158
+ const next = current[key];
159
+ if (!next || typeof next !== 'object' || Array.isArray(next)) {
160
+ return;
161
+ }
162
+ current = next as Record<string, ConfigValue>;
163
+ }
164
+
165
+ delete current[parts[parts.length - 1]];
166
+ }
167
+
168
+ function flattenConfig(source: Record<string, ConfigValue>, prefix = ''): NamespaceListEntry[] {
169
+ const entries: NamespaceListEntry[] = [];
170
+ for (const [key, value] of Object.entries(source)) {
171
+ const fullKey = prefix ? `${prefix}.${key}` : key;
172
+ if (value && typeof value === 'object' && !Array.isArray(value)) {
173
+ entries.push(...flattenConfig(value as Record<string, ConfigValue>, fullKey));
174
+ continue;
175
+ }
176
+ entries.push({ key: fullKey, value });
177
+ }
178
+ return entries;
179
+ }
180
+
181
+ async function loadRootConfig(scope?: ConfigScope): Promise<Record<string, ConfigValue>> {
182
+ const scopes = scope ? [scope] : ['global', 'project', 'local'];
183
+ const loaded = await loadConfig({ scopes, merge: true });
184
+ return asObject(loaded.config);
185
+ }
186
+
187
+ function createAccessor<TConfig extends Record<string, ConfigValue>>(
188
+ definition: NamespaceDefinition
189
+ ): NamespaceConfigAccessor<TConfig> {
190
+ const namespaceId = definition.id;
191
+ const defaults = definition.configDefaults ?? {};
192
+
193
+ return {
194
+ async get(key: string): Promise<ConfigValue | undefined> {
195
+ const config = await loadRootConfig();
196
+ const namespaceConfig = asObject(
197
+ getNestedValue(config as Record<string, unknown>, namespaceId) as ConfigValue | undefined
198
+ );
199
+ const value = getNestedValue(namespaceConfig as Record<string, unknown>, key);
200
+ if (value !== undefined) return value as ConfigValue;
201
+ return getNestedValue(defaults as Record<string, unknown>, key) as ConfigValue | undefined;
202
+ },
203
+
204
+ async set(key: string, value: ConfigValue, scope: ConfigScope = 'global'): Promise<void> {
205
+ const config = await loadRootConfig(scope);
206
+ const namespaceConfig = asObject(
207
+ getNestedValue(config as Record<string, unknown>, namespaceId) as ConfigValue | undefined
208
+ );
209
+ setNestedValue(namespaceConfig as Record<string, unknown>, key, value);
210
+ setNestedValue(config as Record<string, unknown>, namespaceId, namespaceConfig);
211
+ await saveConfig(config, {
212
+ scope,
213
+ format: 'json',
214
+ pretty: true,
215
+ encrypt: true,
216
+ merge: false
217
+ });
218
+ },
219
+
220
+ async delete(key: string, scope: ConfigScope = 'global'): Promise<void> {
221
+ const config = await loadRootConfig(scope);
222
+ const namespaceConfig = asObject(
223
+ getNestedValue(config as Record<string, unknown>, namespaceId) as ConfigValue | undefined
224
+ );
225
+ deleteNestedValue(namespaceConfig, key);
226
+ setNestedValue(config as Record<string, unknown>, namespaceId, namespaceConfig);
227
+ await saveConfig(config, {
228
+ scope,
229
+ format: 'json',
230
+ pretty: true,
231
+ encrypt: true,
232
+ merge: false
233
+ });
234
+ },
235
+
236
+ async list(): Promise<NamespaceListEntry[]> {
237
+ const config = await loadRootConfig();
238
+ const namespaceConfig = asObject(
239
+ getNestedValue(config as Record<string, unknown>, namespaceId) as ConfigValue | undefined
240
+ );
241
+ return flattenConfig(namespaceConfig);
242
+ },
243
+
244
+ async getConfig(): Promise<TConfig> {
245
+ const config = await loadRootConfig();
246
+ const namespaceConfig = asObject(
247
+ getNestedValue(config as Record<string, unknown>, namespaceId) as ConfigValue | undefined
248
+ );
249
+ return { ...defaults, ...namespaceConfig } as TConfig;
250
+ },
251
+
252
+ async setConfig(config: Partial<TConfig>, scope: ConfigScope = 'global'): Promise<void> {
253
+ const rootConfig = await loadRootConfig(scope);
254
+ const current = asObject(getNestedValue(rootConfig as Record<string, unknown>, namespaceId) as ConfigValue | undefined);
255
+ const merged = { ...defaults, ...current, ...config } as Record<string, ConfigValue>;
256
+ setNestedValue(rootConfig as Record<string, unknown>, namespaceId, merged);
257
+ await saveConfig(rootConfig, {
258
+ scope,
259
+ format: 'json',
260
+ pretty: true,
261
+ encrypt: true,
262
+ merge: false
263
+ });
264
+ }
265
+ };
266
+ }
267
+
268
+ class NamespaceRegistry {
269
+ private definitions = new Map<string, NamespaceDefinition>();
270
+
271
+ register(definition: NamespaceDefinition): void {
272
+ this.definitions.set(definition.id, definition);
273
+ }
274
+
275
+ has(id: string): boolean {
276
+ return this.definitions.has(id);
277
+ }
278
+
279
+ getIds(): string[] {
280
+ return [...this.definitions.keys()];
281
+ }
282
+
283
+ getConfig<TConfig extends Record<string, ConfigValue>>(
284
+ id: string
285
+ ): NamespaceConfigAccessor<TConfig> {
286
+ const definition = this.definitions.get(id) ?? { id };
287
+ if (!this.definitions.has(id)) {
288
+ this.definitions.set(id, definition);
289
+ }
290
+ return createAccessor<TConfig>(definition);
291
+ }
292
+ }
293
+
294
+ const registry = new NamespaceRegistry();
295
+
296
+ export function getNamespaceRegistry(): NamespaceRegistry {
297
+ return registry;
298
+ }
@@ -0,0 +1,25 @@
1
+ export type ConfigScope = 'global' | 'project' | 'local';
2
+
3
+ type PrimitiveValue = string | number | boolean | null;
4
+ export type ConfigValue = PrimitiveValue | ConfigValue[] | { [key: string]: ConfigValue };
5
+
6
+ export interface NamespaceDefinition {
7
+ id: string;
8
+ name?: string;
9
+ description?: string;
10
+ configDefaults?: Record<string, ConfigValue>;
11
+ }
12
+
13
+ export interface NamespaceListEntry {
14
+ key: string;
15
+ value: ConfigValue;
16
+ }
17
+
18
+ export interface NamespaceConfigAccessor<TConfig extends Record<string, ConfigValue>> {
19
+ get(key: string, scope?: ConfigScope): Promise<ConfigValue | undefined>;
20
+ set(key: string, value: ConfigValue, scope?: ConfigScope): Promise<void>;
21
+ delete(key: string, scope?: ConfigScope): Promise<void>;
22
+ list(scope?: ConfigScope): Promise<NamespaceListEntry[]>;
23
+ getConfig(scope?: ConfigScope): Promise<TConfig>;
24
+ setConfig(config: Partial<TConfig>, scope?: ConfigScope): Promise<void>;
25
+ }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * CLI Plugin Types
3
+ * Compatibility shim for plugins that need CLI runtime context
4
+ */
5
+
6
+ import type { UIContext } from '../../providers.ts';
7
+
8
+ /**
9
+ * Command layout interface for structured output
10
+ */
11
+ export interface CommandLayout {
12
+ appendError(message: string): void;
13
+ appendOutput(message: string): void;
14
+ appendInfo(message: string): void;
15
+ appendSuccess(message: string): void;
16
+ appendWarning(message: string): void;
17
+ appendJSON(data: unknown): void;
18
+ appendTable(data: unknown[], columns?: string[]): void;
19
+ showProgress(message?: string): void;
20
+ hideProgress(): void;
21
+ complete(): Promise<void>;
22
+ }
23
+
24
+ /**
25
+ * UI Toolkit interface providing rich output capabilities for CLI commands
26
+ */
27
+ export interface UIToolkit {
28
+ // Basic output
29
+ info(message: string): void;
30
+ warn(message: string): void;
31
+ warning(message: string): void;
32
+ error(message: string): void;
33
+ success(message: string): void;
34
+ log(message: string): void;
35
+ table(data: unknown[], options?: string | { columns?: string[]; title?: string }): void;
36
+ json(data: unknown): void;
37
+ yaml(data: unknown): void;
38
+ markdown(data: unknown): void;
39
+ setFormat(format: 'json' | 'yaml' | 'table' | 'markdown'): void;
40
+
41
+ // Rich command execution
42
+ withCommand(
43
+ options: {
44
+ plugin: string;
45
+ command: string;
46
+ args?: Record<string, unknown>;
47
+ flags?: Record<string, unknown>;
48
+ },
49
+ fn: (toolkit: UIToolkit) => Promise<void>
50
+ ): Promise<void>;
51
+
52
+ createCommand(options: {
53
+ plugin: string;
54
+ command: string;
55
+ args?: Record<string, unknown>;
56
+ }): Promise<CommandLayout>;
57
+
58
+ render(data: unknown, options?: { format?: string }): Promise<void>;
59
+ prompt(questions: unknown[]): Promise<Record<string, unknown>>;
60
+ confirm(message: string, options?: Record<string, unknown>): Promise<boolean>;
61
+ createInteractiveCommand(options: Record<string, unknown>): Promise<CommandLayout>;
62
+ appendInfo?(message: string): void;
63
+ appendSuccess?(message: string): void;
64
+ appendTable?(data: unknown[], columns?: string[]): void;
65
+ [key: string]: unknown;
66
+ }
67
+
68
+ /**
69
+ * CLI Runtime Context with plugin-specific extensions
70
+ */
71
+ export interface CLIRuntimeContext {
72
+ ui?: UIContext | UIToolkit;
73
+ logger?: {
74
+ info(msg: string, ...args: unknown[]): void;
75
+ warn(msg: string, ...args: unknown[]): void;
76
+ error(msg: string, ...args: unknown[]): void;
77
+ debug(msg: string, ...args: unknown[]): void;
78
+ };
79
+ config?: unknown;
80
+ pm?: unknown;
81
+ runtime?: unknown;
82
+ cli?: {
83
+ cwd?: string;
84
+ [key: string]: unknown;
85
+ };
86
+ [key: string]: unknown;
87
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * CLI Runtime Context
3
+ *
4
+ * The context object passed to CLI command handlers.
5
+ * Provides UI output, logging, and lifecycle control.
6
+ */
7
+
8
+ import type { UIContext, AppContext, LoggerContext } from '../../providers.ts';
9
+ type PMContext = unknown;
10
+
11
+ export interface RuntimeContext {
12
+ ui: UIContext;
13
+ app?: AppContext;
14
+ logger?: LoggerContext;
15
+ // Extended context properties (set by plugins and consumers)
16
+ config?: unknown;
17
+ pm?: PMContext;
18
+ runtime?: unknown;
19
+ cli?: {
20
+ cwd?: string;
21
+ [key: string]: unknown;
22
+ };
23
+ [key: string]: unknown;
24
+ }
25
+
26
+ let _context: RuntimeContext | null = null;
27
+
28
+ export function getContext(): RuntimeContext {
29
+ if (!_context) {
30
+ // Return a minimal context when not set
31
+ return {
32
+ ui: {
33
+ info: (msg: string): void => {
34
+ process.stdout.write(`${msg}\n`);
35
+ },
36
+ warn: (msg: string): void => {
37
+ process.stderr.write(`${msg}\n`);
38
+ },
39
+ error: (msg: string): void => {
40
+ process.stderr.write(`${msg}\n`);
41
+ }
42
+ } as UIContext
43
+ };
44
+ }
45
+ return _context;
46
+ }
47
+
48
+ export function setContext(ctx: RuntimeContext): void {
49
+ _context = ctx;
50
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * CLI Runtime Hooks
3
+ * Compatibility shim for plugins that need lifecycle hooks
4
+ */
5
+ import type { RuntimeContext } from './context.ts';
6
+
7
+ export interface Hook {
8
+ id: string;
9
+ name: string;
10
+ dependencies?: string[];
11
+ init(context: RuntimeContext): Promise<void> | void;
12
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * CLI Runtime Context Loader
3
+ *
4
+ * Convenience accessor for the standard CLI runtime context bundle —
5
+ * the live `cli/ui` + `cli/logger` (with a fallback) + optional
6
+ * `pm/client` resolved from the active `VibesRuntime`. Command
7
+ * implementations should call this once at the top of `execute()` to
8
+ * obtain the surfaces they need rather than calling
9
+ * `runtime.context()` for each one.
10
+ *
11
+ * Canonical home per RUNTIME-FIRST-MODULES.md (`packages/cli` owns
12
+ * "the helpers that make runtime-discovered commands usable in shells").
13
+ * Feature packages (bridge, expert, etc.) import from
14
+ * `@vibesdotdev/cli/core/runtime/shared/context` rather than
15
+ * maintaining per-package copies.
16
+ */
17
+
18
+ import type { LoggerContext, UIContext } from '../../../providers.ts';
19
+ type IProcessManager = unknown;
20
+ import { getVibesRuntime } from '@vibesdotdev/runtime';
21
+ import { getLogger } from '@vibesdotdev/logging';
22
+
23
+ function fallbackLogger(): LoggerContext {
24
+ const logger = getLogger('cli:runtime-context');
25
+ return {
26
+ info: (message: string, meta?: unknown) =>
27
+ logger.info(message, meta as Record<string, unknown>),
28
+ warn: (message: string, meta?: unknown) =>
29
+ logger.warn(message, meta as Record<string, unknown>),
30
+ error: (message: string, meta?: unknown) =>
31
+ logger.error(message, meta as Record<string, unknown>),
32
+ debug: (message: string, meta?: unknown) =>
33
+ logger.debug(message, meta as Record<string, unknown>)
34
+ };
35
+ }
36
+
37
+ async function optionalContext<T>(id: string): Promise<T | undefined> {
38
+ const runtime = getVibesRuntime();
39
+ try {
40
+ return await runtime.context<T>(id);
41
+ } catch {
42
+ return undefined;
43
+ }
44
+ }
45
+
46
+ export interface CliRuntimeContext {
47
+ ui: UIContext;
48
+ logger: LoggerContext;
49
+ pm?: IProcessManager;
50
+ }
51
+
52
+ /**
53
+ * Resolve the standard CLI runtime context bundle.
54
+ *
55
+ * Throws if `cli/ui` is unavailable (every CLI command needs it).
56
+ * Falls back to a logging-namespace-scoped logger if `cli/logger`
57
+ * isn't registered. Returns `pm` only when `pm/client` is registered.
58
+ */
59
+ export async function loadCliRuntimeContext(): Promise<CliRuntimeContext> {
60
+ const runtime = getVibesRuntime();
61
+ const ui = await runtime.context<UIContext>('cli/ui');
62
+ const logger = (await optionalContext<LoggerContext>('cli/logger')) ?? fallbackLogger();
63
+ const pm = await optionalContext<IProcessManager>('pm/client');
64
+ return { ui, logger, pm };
65
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * CLI Option Parsers
3
+ *
4
+ * Pure helpers for normalizing the `Record<string, unknown>` shape that
5
+ * Commander.js / our descriptor-driven CLI surface delivers to command
6
+ * handlers. Every parser returns `undefined` for empty/invalid input so
7
+ * callers can apply their own defaulting.
8
+ *
9
+ * Canonical home for option parsing per RUNTIME-FIRST-MODULES.md
10
+ * (`packages/cli` owns "the helpers that make runtime-discovered
11
+ * commands usable in shells"). Feature packages (bridge, expert, etc.)
12
+ * import from `@vibesdotdev/cli/core/runtime/shared/options` rather
13
+ * than maintaining per-package copies.
14
+ */
15
+
16
+ export function readString(value: unknown): string | undefined {
17
+ if (typeof value !== 'string') return undefined;
18
+ const trimmed = value.trim();
19
+ return trimmed.length > 0 ? trimmed : undefined;
20
+ }
21
+
22
+ export function readBoolean(value: unknown): boolean | undefined {
23
+ if (typeof value === 'boolean') return value;
24
+ if (typeof value === 'string') {
25
+ if (value === 'true') return true;
26
+ if (value === 'false') return false;
27
+ }
28
+ return undefined;
29
+ }
30
+
31
+ export function readNumber(value: unknown): number | undefined {
32
+ if (typeof value === 'number' && Number.isFinite(value)) return value;
33
+ if (typeof value === 'string' && value.trim().length > 0) {
34
+ const parsed = Number(value);
35
+ return Number.isFinite(parsed) ? parsed : undefined;
36
+ }
37
+ return undefined;
38
+ }
39
+
40
+ export function readStringArray(value: unknown): string[] | undefined {
41
+ if (Array.isArray(value)) {
42
+ const items = value
43
+ .map((entry) => readString(entry))
44
+ .filter((entry): entry is string => typeof entry === 'string');
45
+ return items.length > 0 ? items : undefined;
46
+ }
47
+
48
+ const single = readString(value);
49
+ return single ? [single] : undefined;
50
+ }
51
+
52
+ export function splitCsv(value: unknown): string[] | undefined {
53
+ const raw = readString(value);
54
+ if (!raw) return undefined;
55
+ const items = raw
56
+ .split(',')
57
+ .map((entry) => entry.trim())
58
+ .filter((entry) => entry.length > 0);
59
+ return items.length > 0 ? items : undefined;
60
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * CLI Core Schema Manifest
3
+ * Compatibility shim for command manifests
4
+ */
5
+
6
+ export interface CommandDoc {
7
+ path: string;
8
+ title: string;
9
+ }
10
+
11
+ export interface CommandEntry {
12
+ name: string;
13
+ description: string;
14
+ schema?: unknown;
15
+ access?: {
16
+ auth?: 'required' | 'optional' | 'none';
17
+ };
18
+ docs?: CommandDoc[];
19
+ }
20
+
21
+ export interface CommandManifest {
22
+ namespace: string;
23
+ description: string;
24
+ commands: CommandEntry[];
25
+ docs?: CommandDoc[];
26
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * CLI Core Schema Types
3
+ * Compatibility shim
4
+ */
5
+ export type { CLIContext } from '../../providers.ts';
6
+ export type { RuntimeContext } from '../runtime/context.ts';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * CLI UI Interface
3
+ * Compatibility shim for UI handles
4
+ */
5
+
6
+ export interface IUIHandles {
7
+ info(message: string): void;
8
+ warn(message: string): void;
9
+ error(message: string): void;
10
+ success(message: string): void;
11
+ log(message: string): void;
12
+ }