@agentuity/cli 3.0.0-alpha.7 → 3.0.0-beta.0

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 (2453) hide show
  1. package/AGENTS.md +146 -21
  2. package/bin/cli.js +31 -0
  3. package/dist/agent-detection.d.ts.map +1 -1
  4. package/dist/agent-detection.js +127 -34
  5. package/dist/agent-detection.js.map +1 -1
  6. package/dist/ai-help.d.ts +1 -1
  7. package/dist/ai-help.d.ts.map +1 -1
  8. package/dist/api.d.ts +1 -1
  9. package/dist/api.d.ts.map +1 -1
  10. package/dist/api.js +1 -1
  11. package/dist/api.js.map +1 -1
  12. package/dist/auth.d.ts +2 -2
  13. package/dist/auth.d.ts.map +1 -1
  14. package/dist/auth.js +10 -10
  15. package/dist/auth.js.map +1 -1
  16. package/dist/banner.d.ts.map +1 -1
  17. package/dist/banner.js +6 -13
  18. package/dist/banner.js.map +1 -1
  19. package/dist/build-report.d.ts +1 -1
  20. package/dist/build-report.d.ts.map +1 -1
  21. package/dist/build-report.js +3 -4
  22. package/dist/build-report.js.map +1 -1
  23. package/dist/bun-path.d.ts +11 -4
  24. package/dist/bun-path.d.ts.map +1 -1
  25. package/dist/bun-path.js +27 -14
  26. package/dist/bun-path.js.map +1 -1
  27. package/dist/cache/index.d.ts +3 -4
  28. package/dist/cache/index.d.ts.map +1 -1
  29. package/dist/cache/index.js +3 -4
  30. package/dist/cache/index.js.map +1 -1
  31. package/dist/cache/resource-region.d.ts.map +1 -1
  32. package/dist/cache/resource-region.js +62 -33
  33. package/dist/cache/resource-region.js.map +1 -1
  34. package/dist/cache/user-cache.d.ts +4 -4
  35. package/dist/cache/user-cache.d.ts.map +1 -1
  36. package/dist/cache/user-cache.js +19 -17
  37. package/dist/cache/user-cache.js.map +1 -1
  38. package/dist/cli-logger.d.ts +2 -2
  39. package/dist/cli-logger.d.ts.map +1 -1
  40. package/dist/cli-logger.js +1 -1
  41. package/dist/cli-logger.js.map +1 -1
  42. package/dist/cli.d.ts +1 -1
  43. package/dist/cli.d.ts.map +1 -1
  44. package/dist/cli.js +51 -48
  45. package/dist/cli.js.map +1 -1
  46. package/dist/cmd/ai/capabilities/index.d.ts +1 -1
  47. package/dist/cmd/ai/capabilities/index.d.ts.map +1 -1
  48. package/dist/cmd/ai/capabilities/index.js +3 -3
  49. package/dist/cmd/ai/capabilities/index.js.map +1 -1
  50. package/dist/cmd/ai/capabilities/show.d.ts +1 -1
  51. package/dist/cmd/ai/capabilities/show.d.ts.map +1 -1
  52. package/dist/cmd/ai/capabilities/show.js +3 -3
  53. package/dist/cmd/ai/capabilities/show.js.map +1 -1
  54. package/dist/cmd/ai/claude-code/index.d.ts +1 -1
  55. package/dist/cmd/ai/claude-code/index.d.ts.map +1 -1
  56. package/dist/cmd/ai/claude-code/index.js +4 -4
  57. package/dist/cmd/ai/claude-code/index.js.map +1 -1
  58. package/dist/cmd/ai/claude-code/install.d.ts +1 -1
  59. package/dist/cmd/ai/claude-code/install.d.ts.map +1 -1
  60. package/dist/cmd/ai/claude-code/install.js +12 -11
  61. package/dist/cmd/ai/claude-code/install.js.map +1 -1
  62. package/dist/cmd/ai/claude-code/uninstall.d.ts +1 -1
  63. package/dist/cmd/ai/claude-code/uninstall.d.ts.map +1 -1
  64. package/dist/cmd/ai/claude-code/uninstall.js +8 -7
  65. package/dist/cmd/ai/claude-code/uninstall.js.map +1 -1
  66. package/dist/cmd/ai/detect.d.ts +1 -1
  67. package/dist/cmd/ai/detect.d.ts.map +1 -1
  68. package/dist/cmd/ai/detect.js +4 -4
  69. package/dist/cmd/ai/detect.js.map +1 -1
  70. package/dist/cmd/ai/index.d.ts +1 -1
  71. package/dist/cmd/ai/index.d.ts.map +1 -1
  72. package/dist/cmd/ai/index.js +9 -9
  73. package/dist/cmd/ai/index.js.map +1 -1
  74. package/dist/cmd/ai/intro.d.ts +1 -1
  75. package/dist/cmd/ai/intro.d.ts.map +1 -1
  76. package/dist/cmd/ai/intro.js +5 -5
  77. package/dist/cmd/ai/intro.js.map +1 -1
  78. package/dist/cmd/ai/opencode/dashboard.d.ts +1 -1
  79. package/dist/cmd/ai/opencode/dashboard.d.ts.map +1 -1
  80. package/dist/cmd/ai/opencode/dashboard.js +16 -15
  81. package/dist/cmd/ai/opencode/dashboard.js.map +1 -1
  82. package/dist/cmd/ai/opencode/db.d.ts.map +1 -1
  83. package/dist/cmd/ai/opencode/db.js +3 -2
  84. package/dist/cmd/ai/opencode/db.js.map +1 -1
  85. package/dist/cmd/ai/opencode/index.d.ts +1 -1
  86. package/dist/cmd/ai/opencode/index.d.ts.map +1 -1
  87. package/dist/cmd/ai/opencode/index.js +7 -7
  88. package/dist/cmd/ai/opencode/index.js.map +1 -1
  89. package/dist/cmd/ai/opencode/inspect.d.ts +1 -1
  90. package/dist/cmd/ai/opencode/inspect.d.ts.map +1 -1
  91. package/dist/cmd/ai/opencode/inspect.js +15 -15
  92. package/dist/cmd/ai/opencode/inspect.js.map +1 -1
  93. package/dist/cmd/ai/opencode/install.d.ts +1 -1
  94. package/dist/cmd/ai/opencode/install.d.ts.map +1 -1
  95. package/dist/cmd/ai/opencode/install.js +3 -3
  96. package/dist/cmd/ai/opencode/install.js.map +1 -1
  97. package/dist/cmd/ai/opencode/run.d.ts +1 -1
  98. package/dist/cmd/ai/opencode/run.d.ts.map +1 -1
  99. package/dist/cmd/ai/opencode/run.js +8 -9
  100. package/dist/cmd/ai/opencode/run.js.map +1 -1
  101. package/dist/cmd/ai/opencode/uninstall.d.ts +1 -1
  102. package/dist/cmd/ai/opencode/uninstall.d.ts.map +1 -1
  103. package/dist/cmd/ai/opencode/uninstall.js +3 -3
  104. package/dist/cmd/ai/opencode/uninstall.js.map +1 -1
  105. package/dist/cmd/ai/prompt/api.d.ts +1 -1
  106. package/dist/cmd/ai/prompt/api.d.ts.map +1 -1
  107. package/dist/cmd/ai/prompt/api.js +10 -4
  108. package/dist/cmd/ai/prompt/api.js.map +1 -1
  109. package/dist/cmd/ai/prompt/index.d.ts +1 -1
  110. package/dist/cmd/ai/prompt/index.d.ts.map +1 -1
  111. package/dist/cmd/ai/prompt/index.js +5 -5
  112. package/dist/cmd/ai/prompt/index.js.map +1 -1
  113. package/dist/cmd/ai/prompt/llm.d.ts +1 -1
  114. package/dist/cmd/ai/prompt/llm.d.ts.map +1 -1
  115. package/dist/cmd/ai/prompt/llm.js +2 -2
  116. package/dist/cmd/ai/prompt/llm.js.map +1 -1
  117. package/dist/cmd/ai/prompt/version.d.ts +1 -1
  118. package/dist/cmd/ai/prompt/version.d.ts.map +1 -1
  119. package/dist/cmd/ai/prompt/version.js +3 -4
  120. package/dist/cmd/ai/prompt/version.js.map +1 -1
  121. package/dist/cmd/ai/prompt/web.d.ts +1 -1
  122. package/dist/cmd/ai/prompt/web.d.ts.map +1 -1
  123. package/dist/cmd/ai/prompt/web.js +11 -4
  124. package/dist/cmd/ai/prompt/web.js.map +1 -1
  125. package/dist/cmd/ai/schema/generate.d.ts +1 -1
  126. package/dist/cmd/ai/schema/generate.d.ts.map +1 -1
  127. package/dist/cmd/ai/schema/generate.js +3 -3
  128. package/dist/cmd/ai/schema/generate.js.map +1 -1
  129. package/dist/cmd/ai/schema/index.d.ts +1 -1
  130. package/dist/cmd/ai/schema/index.d.ts.map +1 -1
  131. package/dist/cmd/ai/schema/index.js +4 -4
  132. package/dist/cmd/ai/schema/index.js.map +1 -1
  133. package/dist/cmd/ai/schema/show.d.ts +1 -1
  134. package/dist/cmd/ai/schema/show.d.ts.map +1 -1
  135. package/dist/cmd/ai/schema/show.js +3 -3
  136. package/dist/cmd/ai/schema/show.js.map +1 -1
  137. package/dist/cmd/auth/api.d.ts +1 -1
  138. package/dist/cmd/auth/api.d.ts.map +1 -1
  139. package/dist/cmd/auth/api.js +6 -5
  140. package/dist/cmd/auth/api.js.map +1 -1
  141. package/dist/cmd/auth/apikey.d.ts +1 -1
  142. package/dist/cmd/auth/apikey.d.ts.map +1 -1
  143. package/dist/cmd/auth/apikey.js +2 -2
  144. package/dist/cmd/auth/apikey.js.map +1 -1
  145. package/dist/cmd/auth/index.d.ts +1 -1
  146. package/dist/cmd/auth/index.d.ts.map +1 -1
  147. package/dist/cmd/auth/index.js +9 -9
  148. package/dist/cmd/auth/index.js.map +1 -1
  149. package/dist/cmd/auth/login.d.ts +1 -1
  150. package/dist/cmd/auth/login.d.ts.map +1 -1
  151. package/dist/cmd/auth/login.js +9 -21
  152. package/dist/cmd/auth/login.js.map +1 -1
  153. package/dist/cmd/auth/logout.d.ts +1 -1
  154. package/dist/cmd/auth/logout.d.ts.map +1 -1
  155. package/dist/cmd/auth/logout.js +6 -6
  156. package/dist/cmd/auth/logout.js.map +1 -1
  157. package/dist/cmd/auth/org/enroll.d.ts +1 -1
  158. package/dist/cmd/auth/org/enroll.d.ts.map +1 -1
  159. package/dist/cmd/auth/org/enroll.js +6 -5
  160. package/dist/cmd/auth/org/enroll.js.map +1 -1
  161. package/dist/cmd/auth/org/index.d.ts +1 -1
  162. package/dist/cmd/auth/org/index.d.ts.map +1 -1
  163. package/dist/cmd/auth/org/index.js +7 -7
  164. package/dist/cmd/auth/org/index.js.map +1 -1
  165. package/dist/cmd/auth/org/status.d.ts +1 -1
  166. package/dist/cmd/auth/org/status.d.ts.map +1 -1
  167. package/dist/cmd/auth/org/status.js +4 -4
  168. package/dist/cmd/auth/org/status.js.map +1 -1
  169. package/dist/cmd/auth/org/unenroll.d.ts +1 -1
  170. package/dist/cmd/auth/org/unenroll.d.ts.map +1 -1
  171. package/dist/cmd/auth/org/unenroll.js +4 -4
  172. package/dist/cmd/auth/org/unenroll.js.map +1 -1
  173. package/dist/cmd/auth/signup.d.ts +1 -1
  174. package/dist/cmd/auth/signup.d.ts.map +1 -1
  175. package/dist/cmd/auth/signup.js +6 -6
  176. package/dist/cmd/auth/signup.js.map +1 -1
  177. package/dist/cmd/auth/ssh/add.d.ts +1 -1
  178. package/dist/cmd/auth/ssh/add.d.ts.map +1 -1
  179. package/dist/cmd/auth/ssh/add.js +11 -10
  180. package/dist/cmd/auth/ssh/add.js.map +1 -1
  181. package/dist/cmd/auth/ssh/api.d.ts +1 -1
  182. package/dist/cmd/auth/ssh/api.d.ts.map +1 -1
  183. package/dist/cmd/auth/ssh/delete.d.ts +1 -1
  184. package/dist/cmd/auth/ssh/delete.d.ts.map +1 -1
  185. package/dist/cmd/auth/ssh/delete.js +6 -6
  186. package/dist/cmd/auth/ssh/delete.js.map +1 -1
  187. package/dist/cmd/auth/ssh/index.d.ts +1 -1
  188. package/dist/cmd/auth/ssh/index.d.ts.map +1 -1
  189. package/dist/cmd/auth/ssh/index.js +5 -5
  190. package/dist/cmd/auth/ssh/index.js.map +1 -1
  191. package/dist/cmd/auth/ssh/list.d.ts +1 -1
  192. package/dist/cmd/auth/ssh/list.d.ts.map +1 -1
  193. package/dist/cmd/auth/ssh/list.js +5 -5
  194. package/dist/cmd/auth/ssh/list.js.map +1 -1
  195. package/dist/cmd/auth/whoami.d.ts +1 -1
  196. package/dist/cmd/auth/whoami.d.ts.map +1 -1
  197. package/dist/cmd/auth/whoami.js +3 -3
  198. package/dist/cmd/auth/whoami.js.map +1 -1
  199. package/dist/cmd/build/adapters/generic.d.ts +1 -1
  200. package/dist/cmd/build/adapters/generic.d.ts.map +1 -1
  201. package/dist/cmd/build/adapters/generic.js +20 -18
  202. package/dist/cmd/build/adapters/generic.js.map +1 -1
  203. package/dist/cmd/build/adapters/index.d.ts +2 -2
  204. package/dist/cmd/build/adapters/index.d.ts.map +1 -1
  205. package/dist/cmd/build/adapters/index.js +2 -2
  206. package/dist/cmd/build/adapters/index.js.map +1 -1
  207. package/dist/cmd/build/adapters/nextjs.d.ts +1 -1
  208. package/dist/cmd/build/adapters/nextjs.d.ts.map +1 -1
  209. package/dist/cmd/build/adapters/nextjs.js +1 -1
  210. package/dist/cmd/build/adapters/nextjs.js.map +1 -1
  211. package/dist/cmd/build/adapters/static-server.d.ts.map +1 -1
  212. package/dist/cmd/build/adapters/static-server.js +16 -7
  213. package/dist/cmd/build/adapters/static-server.js.map +1 -1
  214. package/dist/cmd/build/adapters/types.d.ts +3 -3
  215. package/dist/cmd/build/adapters/types.d.ts.map +1 -1
  216. package/dist/cmd/build/ci.d.ts.map +1 -1
  217. package/dist/cmd/build/ci.js +12 -19
  218. package/dist/cmd/build/ci.js.map +1 -1
  219. package/dist/cmd/build/detect/engine.d.ts +2 -2
  220. package/dist/cmd/build/detect/engine.d.ts.map +1 -1
  221. package/dist/cmd/build/detect/engine.js +4 -3
  222. package/dist/cmd/build/detect/engine.js.map +1 -1
  223. package/dist/cmd/build/detect/generic.d.ts +1 -1
  224. package/dist/cmd/build/detect/generic.d.ts.map +1 -1
  225. package/dist/cmd/build/detect/generic.js +3 -3
  226. package/dist/cmd/build/detect/generic.js.map +1 -1
  227. package/dist/cmd/build/detect/index.d.ts +2 -2
  228. package/dist/cmd/build/detect/index.d.ts.map +1 -1
  229. package/dist/cmd/build/detect/index.js +4 -4
  230. package/dist/cmd/build/detect/index.js.map +1 -1
  231. package/dist/cmd/build/detect/util.d.ts +1 -1
  232. package/dist/cmd/build/detect/util.d.ts.map +1 -1
  233. package/dist/cmd/build/detect/util.js +11 -10
  234. package/dist/cmd/build/detect/util.js.map +1 -1
  235. package/dist/cmd/build/ids.d.ts.map +1 -1
  236. package/dist/cmd/build/ids.js +5 -3
  237. package/dist/cmd/build/ids.js.map +1 -1
  238. package/dist/cmd/build/index.d.ts +1 -1
  239. package/dist/cmd/build/index.d.ts.map +1 -1
  240. package/dist/cmd/build/index.js +15 -14
  241. package/dist/cmd/build/index.js.map +1 -1
  242. package/dist/cmd/build/package/index.d.ts +4 -4
  243. package/dist/cmd/build/package/index.d.ts.map +1 -1
  244. package/dist/cmd/build/package/index.js +1 -1
  245. package/dist/cmd/build/package/index.js.map +1 -1
  246. package/dist/cmd/build/package/launch.d.ts +2 -2
  247. package/dist/cmd/build/package/launch.d.ts.map +1 -1
  248. package/dist/cmd/build/patch/aisdk.d.ts +1 -1
  249. package/dist/cmd/build/patch/aisdk.d.ts.map +1 -1
  250. package/dist/cmd/build/patch/aisdk.js +1 -1
  251. package/dist/cmd/build/patch/aisdk.js.map +1 -1
  252. package/dist/cmd/build/patch/index.d.ts +8 -2
  253. package/dist/cmd/build/patch/index.d.ts.map +1 -1
  254. package/dist/cmd/build/patch/index.js +6 -5
  255. package/dist/cmd/build/patch/index.js.map +1 -1
  256. package/dist/cmd/build/patch/llm.d.ts +1 -1
  257. package/dist/cmd/build/patch/llm.d.ts.map +1 -1
  258. package/dist/cmd/build/patch/llm.js +1 -1
  259. package/dist/cmd/build/patch/llm.js.map +1 -1
  260. package/dist/cmd/build/patch/otel-llm.d.ts +1 -1
  261. package/dist/cmd/build/patch/otel-llm.d.ts.map +1 -1
  262. package/dist/cmd/build/typecheck.d.ts +2 -2
  263. package/dist/cmd/build/typecheck.d.ts.map +1 -1
  264. package/dist/cmd/build/typecheck.js +14 -14
  265. package/dist/cmd/build/typecheck.js.map +1 -1
  266. package/dist/cmd/canary/index.d.ts +1 -1
  267. package/dist/cmd/canary/index.d.ts.map +1 -1
  268. package/dist/cmd/canary/index.js +10 -7
  269. package/dist/cmd/canary/index.js.map +1 -1
  270. package/dist/cmd/cloud/agent/get.d.ts +1 -1
  271. package/dist/cmd/cloud/agent/get.d.ts.map +1 -1
  272. package/dist/cmd/cloud/agent/get.js +4 -4
  273. package/dist/cmd/cloud/agent/get.js.map +1 -1
  274. package/dist/cmd/cloud/agent/index.d.ts +1 -1
  275. package/dist/cmd/cloud/agent/index.d.ts.map +1 -1
  276. package/dist/cmd/cloud/agent/index.js +4 -4
  277. package/dist/cmd/cloud/agent/index.js.map +1 -1
  278. package/dist/cmd/cloud/agent/list.d.ts +1 -1
  279. package/dist/cmd/cloud/agent/list.d.ts.map +1 -1
  280. package/dist/cmd/cloud/agent/list.js +5 -5
  281. package/dist/cmd/cloud/agent/list.js.map +1 -1
  282. package/dist/cmd/cloud/apikey/create.d.ts +1 -1
  283. package/dist/cmd/cloud/apikey/create.d.ts.map +1 -1
  284. package/dist/cmd/cloud/apikey/create.js +4 -4
  285. package/dist/cmd/cloud/apikey/create.js.map +1 -1
  286. package/dist/cmd/cloud/apikey/delete.d.ts +1 -1
  287. package/dist/cmd/cloud/apikey/delete.d.ts.map +1 -1
  288. package/dist/cmd/cloud/apikey/delete.js +4 -4
  289. package/dist/cmd/cloud/apikey/delete.js.map +1 -1
  290. package/dist/cmd/cloud/apikey/get.d.ts +1 -1
  291. package/dist/cmd/cloud/apikey/get.d.ts.map +1 -1
  292. package/dist/cmd/cloud/apikey/get.js +4 -4
  293. package/dist/cmd/cloud/apikey/get.js.map +1 -1
  294. package/dist/cmd/cloud/apikey/index.d.ts +1 -1
  295. package/dist/cmd/cloud/apikey/index.d.ts.map +1 -1
  296. package/dist/cmd/cloud/apikey/index.js +6 -6
  297. package/dist/cmd/cloud/apikey/index.js.map +1 -1
  298. package/dist/cmd/cloud/apikey/list.d.ts +1 -1
  299. package/dist/cmd/cloud/apikey/list.d.ts.map +1 -1
  300. package/dist/cmd/cloud/apikey/list.js +3 -3
  301. package/dist/cmd/cloud/apikey/list.js.map +1 -1
  302. package/dist/cmd/cloud/db/create.d.ts +1 -1
  303. package/dist/cmd/cloud/db/create.d.ts.map +1 -1
  304. package/dist/cmd/cloud/db/create.js +7 -7
  305. package/dist/cmd/cloud/db/create.js.map +1 -1
  306. package/dist/cmd/cloud/db/delete.d.ts +1 -1
  307. package/dist/cmd/cloud/db/delete.d.ts.map +1 -1
  308. package/dist/cmd/cloud/db/delete.js +8 -8
  309. package/dist/cmd/cloud/db/delete.js.map +1 -1
  310. package/dist/cmd/cloud/db/get.d.ts +1 -1
  311. package/dist/cmd/cloud/db/get.d.ts.map +1 -1
  312. package/dist/cmd/cloud/db/get.js +6 -6
  313. package/dist/cmd/cloud/db/get.js.map +1 -1
  314. package/dist/cmd/cloud/db/index.d.ts +1 -1
  315. package/dist/cmd/cloud/db/index.d.ts.map +1 -1
  316. package/dist/cmd/cloud/db/index.js +9 -9
  317. package/dist/cmd/cloud/db/index.js.map +1 -1
  318. package/dist/cmd/cloud/db/list.d.ts +1 -1
  319. package/dist/cmd/cloud/db/list.d.ts.map +1 -1
  320. package/dist/cmd/cloud/db/list.js +4 -4
  321. package/dist/cmd/cloud/db/list.js.map +1 -1
  322. package/dist/cmd/cloud/db/logs.d.ts +1 -1
  323. package/dist/cmd/cloud/db/logs.d.ts.map +1 -1
  324. package/dist/cmd/cloud/db/logs.js +6 -6
  325. package/dist/cmd/cloud/db/logs.js.map +1 -1
  326. package/dist/cmd/cloud/db/sql.d.ts +1 -1
  327. package/dist/cmd/cloud/db/sql.d.ts.map +1 -1
  328. package/dist/cmd/cloud/db/sql.js +4 -4
  329. package/dist/cmd/cloud/db/sql.js.map +1 -1
  330. package/dist/cmd/cloud/db/stats.d.ts +1 -1
  331. package/dist/cmd/cloud/db/stats.d.ts.map +1 -1
  332. package/dist/cmd/cloud/db/stats.js +4 -4
  333. package/dist/cmd/cloud/db/stats.js.map +1 -1
  334. package/dist/cmd/cloud/deploy/build.d.ts +68 -0
  335. package/dist/cmd/cloud/deploy/build.d.ts.map +1 -0
  336. package/dist/cmd/cloud/deploy/build.js +166 -0
  337. package/dist/cmd/cloud/deploy/build.js.map +1 -0
  338. package/dist/cmd/cloud/deploy/discover.d.ts +42 -0
  339. package/dist/cmd/cloud/deploy/discover.d.ts.map +1 -0
  340. package/dist/cmd/cloud/deploy/discover.js +85 -0
  341. package/dist/cmd/cloud/deploy/discover.js.map +1 -0
  342. package/dist/cmd/cloud/deploy/preflight.d.ts +81 -0
  343. package/dist/cmd/cloud/deploy/preflight.d.ts.map +1 -0
  344. package/dist/cmd/cloud/deploy/preflight.js +116 -0
  345. package/dist/cmd/cloud/deploy/preflight.js.map +1 -0
  346. package/dist/cmd/cloud/deploy/register.d.ts +62 -0
  347. package/dist/cmd/cloud/deploy/register.d.ts.map +1 -0
  348. package/dist/cmd/cloud/deploy/register.js +135 -0
  349. package/dist/cmd/cloud/deploy/register.js.map +1 -0
  350. package/dist/cmd/cloud/deploy/types.d.ts +43 -0
  351. package/dist/cmd/cloud/deploy/types.d.ts.map +1 -0
  352. package/dist/cmd/cloud/deploy/types.js +12 -0
  353. package/dist/cmd/cloud/deploy/types.js.map +1 -0
  354. package/dist/cmd/cloud/deploy/upload.d.ts +77 -0
  355. package/dist/cmd/cloud/deploy/upload.d.ts.map +1 -0
  356. package/dist/cmd/cloud/deploy/upload.js +343 -0
  357. package/dist/cmd/cloud/deploy/upload.js.map +1 -0
  358. package/dist/cmd/cloud/deploy/wait.d.ts +84 -0
  359. package/dist/cmd/cloud/deploy/wait.d.ts.map +1 -0
  360. package/dist/cmd/cloud/deploy/wait.js +237 -0
  361. package/dist/cmd/cloud/deploy/wait.js.map +1 -0
  362. package/dist/cmd/cloud/deploy-fork.d.ts +2 -2
  363. package/dist/cmd/cloud/deploy-fork.d.ts.map +1 -1
  364. package/dist/cmd/cloud/deploy-fork.js +59 -46
  365. package/dist/cmd/cloud/deploy-fork.js.map +1 -1
  366. package/dist/cmd/cloud/deploy.d.ts +1 -1
  367. package/dist/cmd/cloud/deploy.d.ts.map +1 -1
  368. package/dist/cmd/cloud/deploy.js +128 -718
  369. package/dist/cmd/cloud/deploy.js.map +1 -1
  370. package/dist/cmd/cloud/deployment/index.d.ts +1 -1
  371. package/dist/cmd/cloud/deployment/index.d.ts.map +1 -1
  372. package/dist/cmd/cloud/deployment/index.js +8 -8
  373. package/dist/cmd/cloud/deployment/index.js.map +1 -1
  374. package/dist/cmd/cloud/deployment/list.d.ts +1 -1
  375. package/dist/cmd/cloud/deployment/list.d.ts.map +1 -1
  376. package/dist/cmd/cloud/deployment/list.js +4 -4
  377. package/dist/cmd/cloud/deployment/list.js.map +1 -1
  378. package/dist/cmd/cloud/deployment/logs.d.ts +1 -1
  379. package/dist/cmd/cloud/deployment/logs.d.ts.map +1 -1
  380. package/dist/cmd/cloud/deployment/logs.js +5 -5
  381. package/dist/cmd/cloud/deployment/logs.js.map +1 -1
  382. package/dist/cmd/cloud/deployment/remove.d.ts +1 -1
  383. package/dist/cmd/cloud/deployment/remove.d.ts.map +1 -1
  384. package/dist/cmd/cloud/deployment/remove.js +4 -4
  385. package/dist/cmd/cloud/deployment/remove.js.map +1 -1
  386. package/dist/cmd/cloud/deployment/rollback.d.ts +1 -1
  387. package/dist/cmd/cloud/deployment/rollback.d.ts.map +1 -1
  388. package/dist/cmd/cloud/deployment/rollback.js +4 -4
  389. package/dist/cmd/cloud/deployment/rollback.js.map +1 -1
  390. package/dist/cmd/cloud/deployment/show.d.ts +1 -1
  391. package/dist/cmd/cloud/deployment/show.d.ts.map +1 -1
  392. package/dist/cmd/cloud/deployment/show.js +4 -4
  393. package/dist/cmd/cloud/deployment/show.js.map +1 -1
  394. package/dist/cmd/cloud/deployment/undeploy.d.ts +1 -1
  395. package/dist/cmd/cloud/deployment/undeploy.d.ts.map +1 -1
  396. package/dist/cmd/cloud/deployment/undeploy.js +4 -4
  397. package/dist/cmd/cloud/deployment/undeploy.js.map +1 -1
  398. package/dist/cmd/cloud/deployment/utils.d.ts +1 -1
  399. package/dist/cmd/cloud/deployment/utils.d.ts.map +1 -1
  400. package/dist/cmd/cloud/email/create.d.ts +1 -1
  401. package/dist/cmd/cloud/email/create.d.ts.map +1 -1
  402. package/dist/cmd/cloud/email/create.js +5 -5
  403. package/dist/cmd/cloud/email/create.js.map +1 -1
  404. package/dist/cmd/cloud/email/delete.d.ts +1 -1
  405. package/dist/cmd/cloud/email/delete.d.ts.map +1 -1
  406. package/dist/cmd/cloud/email/delete.js +3 -3
  407. package/dist/cmd/cloud/email/delete.js.map +1 -1
  408. package/dist/cmd/cloud/email/destination/delete.d.ts +1 -1
  409. package/dist/cmd/cloud/email/destination/delete.d.ts.map +1 -1
  410. package/dist/cmd/cloud/email/destination/delete.js +3 -3
  411. package/dist/cmd/cloud/email/destination/delete.js.map +1 -1
  412. package/dist/cmd/cloud/email/destination/index.d.ts +1 -1
  413. package/dist/cmd/cloud/email/destination/index.d.ts.map +1 -1
  414. package/dist/cmd/cloud/email/destination/index.js +4 -4
  415. package/dist/cmd/cloud/email/destination/index.js.map +1 -1
  416. package/dist/cmd/cloud/email/destination/list.d.ts +1 -1
  417. package/dist/cmd/cloud/email/destination/list.d.ts.map +1 -1
  418. package/dist/cmd/cloud/email/destination/list.js +4 -4
  419. package/dist/cmd/cloud/email/destination/list.js.map +1 -1
  420. package/dist/cmd/cloud/email/destination/url.d.ts +1 -1
  421. package/dist/cmd/cloud/email/destination/url.d.ts.map +1 -1
  422. package/dist/cmd/cloud/email/destination/url.js +6 -6
  423. package/dist/cmd/cloud/email/destination/url.js.map +1 -1
  424. package/dist/cmd/cloud/email/get.d.ts +1 -1
  425. package/dist/cmd/cloud/email/get.d.ts.map +1 -1
  426. package/dist/cmd/cloud/email/get.js +3 -3
  427. package/dist/cmd/cloud/email/get.js.map +1 -1
  428. package/dist/cmd/cloud/email/inbound/get.d.ts +1 -1
  429. package/dist/cmd/cloud/email/inbound/get.d.ts.map +1 -1
  430. package/dist/cmd/cloud/email/inbound/get.js +4 -4
  431. package/dist/cmd/cloud/email/inbound/get.js.map +1 -1
  432. package/dist/cmd/cloud/email/inbound/index.d.ts +1 -1
  433. package/dist/cmd/cloud/email/inbound/index.d.ts.map +1 -1
  434. package/dist/cmd/cloud/email/inbound/index.js +3 -3
  435. package/dist/cmd/cloud/email/inbound/index.js.map +1 -1
  436. package/dist/cmd/cloud/email/inbound/list.d.ts +1 -1
  437. package/dist/cmd/cloud/email/inbound/list.d.ts.map +1 -1
  438. package/dist/cmd/cloud/email/inbound/list.js +4 -4
  439. package/dist/cmd/cloud/email/inbound/list.js.map +1 -1
  440. package/dist/cmd/cloud/email/index.d.ts +1 -1
  441. package/dist/cmd/cloud/email/index.d.ts.map +1 -1
  442. package/dist/cmd/cloud/email/index.js +10 -10
  443. package/dist/cmd/cloud/email/index.js.map +1 -1
  444. package/dist/cmd/cloud/email/list.d.ts +1 -1
  445. package/dist/cmd/cloud/email/list.d.ts.map +1 -1
  446. package/dist/cmd/cloud/email/list.js +3 -3
  447. package/dist/cmd/cloud/email/list.js.map +1 -1
  448. package/dist/cmd/cloud/email/outbound/get.d.ts +1 -1
  449. package/dist/cmd/cloud/email/outbound/get.d.ts.map +1 -1
  450. package/dist/cmd/cloud/email/outbound/get.js +4 -4
  451. package/dist/cmd/cloud/email/outbound/get.js.map +1 -1
  452. package/dist/cmd/cloud/email/outbound/index.d.ts +1 -1
  453. package/dist/cmd/cloud/email/outbound/index.d.ts.map +1 -1
  454. package/dist/cmd/cloud/email/outbound/index.js +3 -3
  455. package/dist/cmd/cloud/email/outbound/index.js.map +1 -1
  456. package/dist/cmd/cloud/email/outbound/list.d.ts +1 -1
  457. package/dist/cmd/cloud/email/outbound/list.d.ts.map +1 -1
  458. package/dist/cmd/cloud/email/outbound/list.js +4 -4
  459. package/dist/cmd/cloud/email/outbound/list.js.map +1 -1
  460. package/dist/cmd/cloud/email/send.d.ts +1 -1
  461. package/dist/cmd/cloud/email/send.d.ts.map +1 -1
  462. package/dist/cmd/cloud/email/send.js +10 -8
  463. package/dist/cmd/cloud/email/send.js.map +1 -1
  464. package/dist/cmd/cloud/email/stats.d.ts +1 -1
  465. package/dist/cmd/cloud/email/stats.d.ts.map +1 -1
  466. package/dist/cmd/cloud/email/stats.js +4 -4
  467. package/dist/cmd/cloud/email/stats.js.map +1 -1
  468. package/dist/cmd/cloud/email/util.d.ts +1 -1
  469. package/dist/cmd/cloud/email/util.d.ts.map +1 -1
  470. package/dist/cmd/cloud/email/util.js +3 -3
  471. package/dist/cmd/cloud/email/util.js.map +1 -1
  472. package/dist/cmd/cloud/env/delete.d.ts +1 -1
  473. package/dist/cmd/cloud/env/delete.d.ts.map +1 -1
  474. package/dist/cmd/cloud/env/delete.js +6 -6
  475. package/dist/cmd/cloud/env/delete.js.map +1 -1
  476. package/dist/cmd/cloud/env/env-diff.js +2 -2
  477. package/dist/cmd/cloud/env/env-diff.js.map +1 -1
  478. package/dist/cmd/cloud/env/get.d.ts +1 -1
  479. package/dist/cmd/cloud/env/get.d.ts.map +1 -1
  480. package/dist/cmd/cloud/env/get.js +5 -5
  481. package/dist/cmd/cloud/env/get.js.map +1 -1
  482. package/dist/cmd/cloud/env/import.d.ts +1 -1
  483. package/dist/cmd/cloud/env/import.d.ts.map +1 -1
  484. package/dist/cmd/cloud/env/import.js +5 -5
  485. package/dist/cmd/cloud/env/import.js.map +1 -1
  486. package/dist/cmd/cloud/env/index.d.ts +1 -1
  487. package/dist/cmd/cloud/env/index.d.ts.map +1 -1
  488. package/dist/cmd/cloud/env/index.js +9 -9
  489. package/dist/cmd/cloud/env/index.js.map +1 -1
  490. package/dist/cmd/cloud/env/list.d.ts +1 -1
  491. package/dist/cmd/cloud/env/list.d.ts.map +1 -1
  492. package/dist/cmd/cloud/env/list.js +4 -4
  493. package/dist/cmd/cloud/env/list.js.map +1 -1
  494. package/dist/cmd/cloud/env/org-util.d.ts +2 -2
  495. package/dist/cmd/cloud/env/org-util.d.ts.map +1 -1
  496. package/dist/cmd/cloud/env/org-util.js +1 -1
  497. package/dist/cmd/cloud/env/org-util.js.map +1 -1
  498. package/dist/cmd/cloud/env/pull.d.ts +1 -1
  499. package/dist/cmd/cloud/env/pull.d.ts.map +1 -1
  500. package/dist/cmd/cloud/env/pull.js +6 -6
  501. package/dist/cmd/cloud/env/pull.js.map +1 -1
  502. package/dist/cmd/cloud/env/push.d.ts +1 -1
  503. package/dist/cmd/cloud/env/push.d.ts.map +1 -1
  504. package/dist/cmd/cloud/env/push.js +6 -6
  505. package/dist/cmd/cloud/env/push.js.map +1 -1
  506. package/dist/cmd/cloud/env/set.d.ts +1 -1
  507. package/dist/cmd/cloud/env/set.d.ts.map +1 -1
  508. package/dist/cmd/cloud/env/set.js +5 -5
  509. package/dist/cmd/cloud/env/set.js.map +1 -1
  510. package/dist/cmd/cloud/index.d.ts +1 -1
  511. package/dist/cmd/cloud/index.d.ts.map +1 -1
  512. package/dist/cmd/cloud/index.js +29 -29
  513. package/dist/cmd/cloud/index.js.map +1 -1
  514. package/dist/cmd/cloud/keyvalue/create-namespace.d.ts +1 -1
  515. package/dist/cmd/cloud/keyvalue/create-namespace.d.ts.map +1 -1
  516. package/dist/cmd/cloud/keyvalue/create-namespace.js +4 -4
  517. package/dist/cmd/cloud/keyvalue/create-namespace.js.map +1 -1
  518. package/dist/cmd/cloud/keyvalue/delete-namespace.d.ts +1 -1
  519. package/dist/cmd/cloud/keyvalue/delete-namespace.d.ts.map +1 -1
  520. package/dist/cmd/cloud/keyvalue/delete-namespace.js +5 -5
  521. package/dist/cmd/cloud/keyvalue/delete-namespace.js.map +1 -1
  522. package/dist/cmd/cloud/keyvalue/delete.d.ts +1 -1
  523. package/dist/cmd/cloud/keyvalue/delete.d.ts.map +1 -1
  524. package/dist/cmd/cloud/keyvalue/delete.js +4 -4
  525. package/dist/cmd/cloud/keyvalue/delete.js.map +1 -1
  526. package/dist/cmd/cloud/keyvalue/get.d.ts +1 -1
  527. package/dist/cmd/cloud/keyvalue/get.d.ts.map +1 -1
  528. package/dist/cmd/cloud/keyvalue/get.js +5 -5
  529. package/dist/cmd/cloud/keyvalue/get.js.map +1 -1
  530. package/dist/cmd/cloud/keyvalue/index.d.ts +1 -1
  531. package/dist/cmd/cloud/keyvalue/index.d.ts.map +1 -1
  532. package/dist/cmd/cloud/keyvalue/index.js +12 -12
  533. package/dist/cmd/cloud/keyvalue/index.js.map +1 -1
  534. package/dist/cmd/cloud/keyvalue/keys.d.ts +1 -1
  535. package/dist/cmd/cloud/keyvalue/keys.d.ts.map +1 -1
  536. package/dist/cmd/cloud/keyvalue/keys.js +4 -4
  537. package/dist/cmd/cloud/keyvalue/keys.js.map +1 -1
  538. package/dist/cmd/cloud/keyvalue/list-namespaces.d.ts +1 -1
  539. package/dist/cmd/cloud/keyvalue/list-namespaces.d.ts.map +1 -1
  540. package/dist/cmd/cloud/keyvalue/list-namespaces.js +4 -4
  541. package/dist/cmd/cloud/keyvalue/list-namespaces.js.map +1 -1
  542. package/dist/cmd/cloud/keyvalue/repl.d.ts +1 -1
  543. package/dist/cmd/cloud/keyvalue/repl.d.ts.map +1 -1
  544. package/dist/cmd/cloud/keyvalue/repl.js +10 -14
  545. package/dist/cmd/cloud/keyvalue/repl.js.map +1 -1
  546. package/dist/cmd/cloud/keyvalue/search.d.ts +1 -1
  547. package/dist/cmd/cloud/keyvalue/search.d.ts.map +1 -1
  548. package/dist/cmd/cloud/keyvalue/search.js +13 -20
  549. package/dist/cmd/cloud/keyvalue/search.js.map +1 -1
  550. package/dist/cmd/cloud/keyvalue/set.d.ts +1 -1
  551. package/dist/cmd/cloud/keyvalue/set.d.ts.map +1 -1
  552. package/dist/cmd/cloud/keyvalue/set.js +5 -5
  553. package/dist/cmd/cloud/keyvalue/set.js.map +1 -1
  554. package/dist/cmd/cloud/keyvalue/stats.d.ts +1 -1
  555. package/dist/cmd/cloud/keyvalue/stats.d.ts.map +1 -1
  556. package/dist/cmd/cloud/keyvalue/stats.js +4 -4
  557. package/dist/cmd/cloud/keyvalue/stats.js.map +1 -1
  558. package/dist/cmd/cloud/keyvalue/util.d.ts +1 -1
  559. package/dist/cmd/cloud/keyvalue/util.d.ts.map +1 -1
  560. package/dist/cmd/cloud/keyvalue/util.js +2 -2
  561. package/dist/cmd/cloud/keyvalue/util.js.map +1 -1
  562. package/dist/cmd/cloud/machine/delete.d.ts +1 -1
  563. package/dist/cmd/cloud/machine/delete.d.ts.map +1 -1
  564. package/dist/cmd/cloud/machine/delete.js +5 -5
  565. package/dist/cmd/cloud/machine/delete.js.map +1 -1
  566. package/dist/cmd/cloud/machine/deployments.d.ts +1 -1
  567. package/dist/cmd/cloud/machine/deployments.d.ts.map +1 -1
  568. package/dist/cmd/cloud/machine/deployments.js +5 -5
  569. package/dist/cmd/cloud/machine/deployments.js.map +1 -1
  570. package/dist/cmd/cloud/machine/get.d.ts +1 -1
  571. package/dist/cmd/cloud/machine/get.d.ts.map +1 -1
  572. package/dist/cmd/cloud/machine/get.js +5 -5
  573. package/dist/cmd/cloud/machine/get.js.map +1 -1
  574. package/dist/cmd/cloud/machine/index.d.ts +1 -1
  575. package/dist/cmd/cloud/machine/index.d.ts.map +1 -1
  576. package/dist/cmd/cloud/machine/index.js +6 -6
  577. package/dist/cmd/cloud/machine/index.js.map +1 -1
  578. package/dist/cmd/cloud/machine/list.d.ts +1 -1
  579. package/dist/cmd/cloud/machine/list.d.ts.map +1 -1
  580. package/dist/cmd/cloud/machine/list.js +5 -5
  581. package/dist/cmd/cloud/machine/list.js.map +1 -1
  582. package/dist/cmd/cloud/monitor.d.ts +1 -1
  583. package/dist/cmd/cloud/monitor.d.ts.map +1 -1
  584. package/dist/cmd/cloud/monitor.js +4 -4
  585. package/dist/cmd/cloud/monitor.js.map +1 -1
  586. package/dist/cmd/cloud/oidc/activity.d.ts +1 -1
  587. package/dist/cmd/cloud/oidc/activity.d.ts.map +1 -1
  588. package/dist/cmd/cloud/oidc/activity.js +4 -4
  589. package/dist/cmd/cloud/oidc/activity.js.map +1 -1
  590. package/dist/cmd/cloud/oidc/create.d.ts +1 -1
  591. package/dist/cmd/cloud/oidc/create.d.ts.map +1 -1
  592. package/dist/cmd/cloud/oidc/create.js +4 -4
  593. package/dist/cmd/cloud/oidc/create.js.map +1 -1
  594. package/dist/cmd/cloud/oidc/delete.d.ts +1 -1
  595. package/dist/cmd/cloud/oidc/delete.d.ts.map +1 -1
  596. package/dist/cmd/cloud/oidc/delete.js +5 -5
  597. package/dist/cmd/cloud/oidc/delete.js.map +1 -1
  598. package/dist/cmd/cloud/oidc/get.d.ts +1 -1
  599. package/dist/cmd/cloud/oidc/get.d.ts.map +1 -1
  600. package/dist/cmd/cloud/oidc/get.js +5 -5
  601. package/dist/cmd/cloud/oidc/get.js.map +1 -1
  602. package/dist/cmd/cloud/oidc/index.d.ts +1 -1
  603. package/dist/cmd/cloud/oidc/index.d.ts.map +1 -1
  604. package/dist/cmd/cloud/oidc/index.js +9 -9
  605. package/dist/cmd/cloud/oidc/index.js.map +1 -1
  606. package/dist/cmd/cloud/oidc/list.d.ts +1 -1
  607. package/dist/cmd/cloud/oidc/list.d.ts.map +1 -1
  608. package/dist/cmd/cloud/oidc/list.js +4 -4
  609. package/dist/cmd/cloud/oidc/list.js.map +1 -1
  610. package/dist/cmd/cloud/oidc/rotate-secret.d.ts +1 -1
  611. package/dist/cmd/cloud/oidc/rotate-secret.d.ts.map +1 -1
  612. package/dist/cmd/cloud/oidc/rotate-secret.js +5 -5
  613. package/dist/cmd/cloud/oidc/rotate-secret.js.map +1 -1
  614. package/dist/cmd/cloud/oidc/users.d.ts +1 -1
  615. package/dist/cmd/cloud/oidc/users.d.ts.map +1 -1
  616. package/dist/cmd/cloud/oidc/users.js +4 -4
  617. package/dist/cmd/cloud/oidc/users.js.map +1 -1
  618. package/dist/cmd/cloud/oidc/util.d.ts +1 -1
  619. package/dist/cmd/cloud/oidc/util.d.ts.map +1 -1
  620. package/dist/cmd/cloud/oidc/util.js +2 -2
  621. package/dist/cmd/cloud/oidc/util.js.map +1 -1
  622. package/dist/cmd/cloud/queue/ack.d.ts +1 -1
  623. package/dist/cmd/cloud/queue/ack.d.ts.map +1 -1
  624. package/dist/cmd/cloud/queue/ack.js +4 -4
  625. package/dist/cmd/cloud/queue/ack.js.map +1 -1
  626. package/dist/cmd/cloud/queue/consumers.d.ts +1 -1
  627. package/dist/cmd/cloud/queue/consumers.d.ts.map +1 -1
  628. package/dist/cmd/cloud/queue/consumers.js +4 -4
  629. package/dist/cmd/cloud/queue/consumers.js.map +1 -1
  630. package/dist/cmd/cloud/queue/create.d.ts +1 -1
  631. package/dist/cmd/cloud/queue/create.d.ts.map +1 -1
  632. package/dist/cmd/cloud/queue/create.js +4 -4
  633. package/dist/cmd/cloud/queue/create.js.map +1 -1
  634. package/dist/cmd/cloud/queue/delete.d.ts +1 -1
  635. package/dist/cmd/cloud/queue/delete.d.ts.map +1 -1
  636. package/dist/cmd/cloud/queue/delete.js +5 -5
  637. package/dist/cmd/cloud/queue/delete.js.map +1 -1
  638. package/dist/cmd/cloud/queue/destinations.d.ts +1 -1
  639. package/dist/cmd/cloud/queue/destinations.d.ts.map +1 -1
  640. package/dist/cmd/cloud/queue/destinations.js +5 -5
  641. package/dist/cmd/cloud/queue/destinations.js.map +1 -1
  642. package/dist/cmd/cloud/queue/dlq.d.ts +1 -1
  643. package/dist/cmd/cloud/queue/dlq.d.ts.map +1 -1
  644. package/dist/cmd/cloud/queue/dlq.js +5 -5
  645. package/dist/cmd/cloud/queue/dlq.js.map +1 -1
  646. package/dist/cmd/cloud/queue/get.d.ts +1 -1
  647. package/dist/cmd/cloud/queue/get.d.ts.map +1 -1
  648. package/dist/cmd/cloud/queue/get.js +4 -4
  649. package/dist/cmd/cloud/queue/get.js.map +1 -1
  650. package/dist/cmd/cloud/queue/index.d.ts +1 -1
  651. package/dist/cmd/cloud/queue/index.d.ts.map +1 -1
  652. package/dist/cmd/cloud/queue/index.js +18 -18
  653. package/dist/cmd/cloud/queue/index.js.map +1 -1
  654. package/dist/cmd/cloud/queue/list.d.ts +1 -1
  655. package/dist/cmd/cloud/queue/list.d.ts.map +1 -1
  656. package/dist/cmd/cloud/queue/list.js +4 -4
  657. package/dist/cmd/cloud/queue/list.js.map +1 -1
  658. package/dist/cmd/cloud/queue/messages.d.ts +1 -1
  659. package/dist/cmd/cloud/queue/messages.d.ts.map +1 -1
  660. package/dist/cmd/cloud/queue/messages.js +4 -4
  661. package/dist/cmd/cloud/queue/messages.js.map +1 -1
  662. package/dist/cmd/cloud/queue/nack.d.ts +1 -1
  663. package/dist/cmd/cloud/queue/nack.d.ts.map +1 -1
  664. package/dist/cmd/cloud/queue/nack.js +4 -4
  665. package/dist/cmd/cloud/queue/nack.js.map +1 -1
  666. package/dist/cmd/cloud/queue/pause.d.ts +1 -1
  667. package/dist/cmd/cloud/queue/pause.d.ts.map +1 -1
  668. package/dist/cmd/cloud/queue/pause.js +4 -4
  669. package/dist/cmd/cloud/queue/pause.js.map +1 -1
  670. package/dist/cmd/cloud/queue/publish.d.ts +1 -1
  671. package/dist/cmd/cloud/queue/publish.d.ts.map +1 -1
  672. package/dist/cmd/cloud/queue/publish.js +5 -5
  673. package/dist/cmd/cloud/queue/publish.js.map +1 -1
  674. package/dist/cmd/cloud/queue/receive.d.ts +1 -1
  675. package/dist/cmd/cloud/queue/receive.d.ts.map +1 -1
  676. package/dist/cmd/cloud/queue/receive.js +4 -4
  677. package/dist/cmd/cloud/queue/receive.js.map +1 -1
  678. package/dist/cmd/cloud/queue/resume.d.ts +1 -1
  679. package/dist/cmd/cloud/queue/resume.d.ts.map +1 -1
  680. package/dist/cmd/cloud/queue/resume.js +4 -4
  681. package/dist/cmd/cloud/queue/resume.js.map +1 -1
  682. package/dist/cmd/cloud/queue/sources.d.ts +1 -1
  683. package/dist/cmd/cloud/queue/sources.d.ts.map +1 -1
  684. package/dist/cmd/cloud/queue/sources.js +5 -5
  685. package/dist/cmd/cloud/queue/sources.js.map +1 -1
  686. package/dist/cmd/cloud/queue/stats.d.ts +1 -1
  687. package/dist/cmd/cloud/queue/stats.d.ts.map +1 -1
  688. package/dist/cmd/cloud/queue/stats.js +4 -4
  689. package/dist/cmd/cloud/queue/stats.js.map +1 -1
  690. package/dist/cmd/cloud/queue/util.d.ts +1 -1
  691. package/dist/cmd/cloud/queue/util.d.ts.map +1 -1
  692. package/dist/cmd/cloud/queue/util.js +1 -1
  693. package/dist/cmd/cloud/queue/util.js.map +1 -1
  694. package/dist/cmd/cloud/redis/get.d.ts +1 -1
  695. package/dist/cmd/cloud/redis/get.d.ts.map +1 -1
  696. package/dist/cmd/cloud/redis/get.js +4 -4
  697. package/dist/cmd/cloud/redis/get.js.map +1 -1
  698. package/dist/cmd/cloud/redis/index.d.ts +1 -1
  699. package/dist/cmd/cloud/redis/index.d.ts.map +1 -1
  700. package/dist/cmd/cloud/redis/index.js +3 -3
  701. package/dist/cmd/cloud/redis/index.js.map +1 -1
  702. package/dist/cmd/cloud/region/index.d.ts +1 -1
  703. package/dist/cmd/cloud/region/index.d.ts.map +1 -1
  704. package/dist/cmd/cloud/region/index.js +5 -5
  705. package/dist/cmd/cloud/region/index.js.map +1 -1
  706. package/dist/cmd/cloud/region/list.d.ts +1 -1
  707. package/dist/cmd/cloud/region/list.d.ts.map +1 -1
  708. package/dist/cmd/cloud/region/list.js +3 -3
  709. package/dist/cmd/cloud/region/list.js.map +1 -1
  710. package/dist/cmd/cloud/region-lookup.d.ts +1 -1
  711. package/dist/cmd/cloud/region-lookup.d.ts.map +1 -1
  712. package/dist/cmd/cloud/region-lookup.js +4 -4
  713. package/dist/cmd/cloud/region-lookup.js.map +1 -1
  714. package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts +1 -1
  715. package/dist/cmd/cloud/sandbox/checkpoint/create.d.ts.map +1 -1
  716. package/dist/cmd/cloud/sandbox/checkpoint/create.js +6 -7
  717. package/dist/cmd/cloud/sandbox/checkpoint/create.js.map +1 -1
  718. package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts +1 -1
  719. package/dist/cmd/cloud/sandbox/checkpoint/delete.d.ts.map +1 -1
  720. package/dist/cmd/cloud/sandbox/checkpoint/delete.js +6 -7
  721. package/dist/cmd/cloud/sandbox/checkpoint/delete.js.map +1 -1
  722. package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts +1 -1
  723. package/dist/cmd/cloud/sandbox/checkpoint/index.d.ts.map +1 -1
  724. package/dist/cmd/cloud/sandbox/checkpoint/index.js +6 -6
  725. package/dist/cmd/cloud/sandbox/checkpoint/index.js.map +1 -1
  726. package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts +1 -1
  727. package/dist/cmd/cloud/sandbox/checkpoint/list.d.ts.map +1 -1
  728. package/dist/cmd/cloud/sandbox/checkpoint/list.js +6 -7
  729. package/dist/cmd/cloud/sandbox/checkpoint/list.js.map +1 -1
  730. package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts +1 -1
  731. package/dist/cmd/cloud/sandbox/checkpoint/restore.d.ts.map +1 -1
  732. package/dist/cmd/cloud/sandbox/checkpoint/restore.js +6 -7
  733. package/dist/cmd/cloud/sandbox/checkpoint/restore.js.map +1 -1
  734. package/dist/cmd/cloud/sandbox/create.d.ts +1 -1
  735. package/dist/cmd/cloud/sandbox/create.d.ts.map +1 -1
  736. package/dist/cmd/cloud/sandbox/create.js +62 -11
  737. package/dist/cmd/cloud/sandbox/create.js.map +1 -1
  738. package/dist/cmd/cloud/sandbox/delete.d.ts +1 -1
  739. package/dist/cmd/cloud/sandbox/delete.d.ts.map +1 -1
  740. package/dist/cmd/cloud/sandbox/delete.js +6 -7
  741. package/dist/cmd/cloud/sandbox/delete.js.map +1 -1
  742. package/dist/cmd/cloud/sandbox/env.d.ts +1 -1
  743. package/dist/cmd/cloud/sandbox/env.d.ts.map +1 -1
  744. package/dist/cmd/cloud/sandbox/env.js +6 -8
  745. package/dist/cmd/cloud/sandbox/env.js.map +1 -1
  746. package/dist/cmd/cloud/sandbox/events.d.ts +1 -1
  747. package/dist/cmd/cloud/sandbox/events.d.ts.map +1 -1
  748. package/dist/cmd/cloud/sandbox/events.js +4 -4
  749. package/dist/cmd/cloud/sandbox/events.js.map +1 -1
  750. package/dist/cmd/cloud/sandbox/exec.d.ts +1 -1
  751. package/dist/cmd/cloud/sandbox/exec.d.ts.map +1 -1
  752. package/dist/cmd/cloud/sandbox/exec.js +83 -26
  753. package/dist/cmd/cloud/sandbox/exec.js.map +1 -1
  754. package/dist/cmd/cloud/sandbox/execution/get.d.ts +1 -1
  755. package/dist/cmd/cloud/sandbox/execution/get.d.ts.map +1 -1
  756. package/dist/cmd/cloud/sandbox/execution/get.js +4 -4
  757. package/dist/cmd/cloud/sandbox/execution/get.js.map +1 -1
  758. package/dist/cmd/cloud/sandbox/execution/index.d.ts +1 -1
  759. package/dist/cmd/cloud/sandbox/execution/index.d.ts.map +1 -1
  760. package/dist/cmd/cloud/sandbox/execution/index.js +4 -4
  761. package/dist/cmd/cloud/sandbox/execution/index.js.map +1 -1
  762. package/dist/cmd/cloud/sandbox/execution/list.d.ts +1 -1
  763. package/dist/cmd/cloud/sandbox/execution/list.d.ts.map +1 -1
  764. package/dist/cmd/cloud/sandbox/execution/list.js +6 -8
  765. package/dist/cmd/cloud/sandbox/execution/list.js.map +1 -1
  766. package/dist/cmd/cloud/sandbox/fs/cp.d.ts +1 -1
  767. package/dist/cmd/cloud/sandbox/fs/cp.d.ts.map +1 -1
  768. package/dist/cmd/cloud/sandbox/fs/cp.js +68 -119
  769. package/dist/cmd/cloud/sandbox/fs/cp.js.map +1 -1
  770. package/dist/cmd/cloud/sandbox/fs/download.d.ts +1 -1
  771. package/dist/cmd/cloud/sandbox/fs/download.d.ts.map +1 -1
  772. package/dist/cmd/cloud/sandbox/fs/download.js +14 -25
  773. package/dist/cmd/cloud/sandbox/fs/download.js.map +1 -1
  774. package/dist/cmd/cloud/sandbox/fs/index.d.ts +1 -1
  775. package/dist/cmd/cloud/sandbox/fs/index.d.ts.map +1 -1
  776. package/dist/cmd/cloud/sandbox/fs/index.js +9 -9
  777. package/dist/cmd/cloud/sandbox/fs/index.js.map +1 -1
  778. package/dist/cmd/cloud/sandbox/fs/ls.d.ts +1 -1
  779. package/dist/cmd/cloud/sandbox/fs/ls.d.ts.map +1 -1
  780. package/dist/cmd/cloud/sandbox/fs/ls.js +6 -8
  781. package/dist/cmd/cloud/sandbox/fs/ls.js.map +1 -1
  782. package/dist/cmd/cloud/sandbox/fs/mkdir.d.ts +1 -1
  783. package/dist/cmd/cloud/sandbox/fs/mkdir.d.ts.map +1 -1
  784. package/dist/cmd/cloud/sandbox/fs/mkdir.js +6 -8
  785. package/dist/cmd/cloud/sandbox/fs/mkdir.js.map +1 -1
  786. package/dist/cmd/cloud/sandbox/fs/rm.d.ts +1 -1
  787. package/dist/cmd/cloud/sandbox/fs/rm.d.ts.map +1 -1
  788. package/dist/cmd/cloud/sandbox/fs/rm.js +6 -8
  789. package/dist/cmd/cloud/sandbox/fs/rm.js.map +1 -1
  790. package/dist/cmd/cloud/sandbox/fs/rmdir.d.ts +1 -1
  791. package/dist/cmd/cloud/sandbox/fs/rmdir.d.ts.map +1 -1
  792. package/dist/cmd/cloud/sandbox/fs/rmdir.js +6 -8
  793. package/dist/cmd/cloud/sandbox/fs/rmdir.js.map +1 -1
  794. package/dist/cmd/cloud/sandbox/fs/upload.d.ts +1 -1
  795. package/dist/cmd/cloud/sandbox/fs/upload.d.ts.map +1 -1
  796. package/dist/cmd/cloud/sandbox/fs/upload.js +10 -11
  797. package/dist/cmd/cloud/sandbox/fs/upload.js.map +1 -1
  798. package/dist/cmd/cloud/sandbox/get.d.ts +1 -1
  799. package/dist/cmd/cloud/sandbox/get.d.ts.map +1 -1
  800. package/dist/cmd/cloud/sandbox/get.js +24 -10
  801. package/dist/cmd/cloud/sandbox/get.js.map +1 -1
  802. package/dist/cmd/cloud/sandbox/index.d.ts +1 -1
  803. package/dist/cmd/cloud/sandbox/index.d.ts.map +1 -1
  804. package/dist/cmd/cloud/sandbox/index.js +19 -19
  805. package/dist/cmd/cloud/sandbox/index.js.map +1 -1
  806. package/dist/cmd/cloud/sandbox/job/create.d.ts +1 -1
  807. package/dist/cmd/cloud/sandbox/job/create.d.ts.map +1 -1
  808. package/dist/cmd/cloud/sandbox/job/create.js +6 -7
  809. package/dist/cmd/cloud/sandbox/job/create.js.map +1 -1
  810. package/dist/cmd/cloud/sandbox/job/destroy.d.ts +1 -1
  811. package/dist/cmd/cloud/sandbox/job/destroy.d.ts.map +1 -1
  812. package/dist/cmd/cloud/sandbox/job/destroy.js +6 -7
  813. package/dist/cmd/cloud/sandbox/job/destroy.js.map +1 -1
  814. package/dist/cmd/cloud/sandbox/job/get.d.ts +1 -1
  815. package/dist/cmd/cloud/sandbox/job/get.d.ts.map +1 -1
  816. package/dist/cmd/cloud/sandbox/job/get.js +5 -6
  817. package/dist/cmd/cloud/sandbox/job/get.js.map +1 -1
  818. package/dist/cmd/cloud/sandbox/job/index.d.ts +1 -1
  819. package/dist/cmd/cloud/sandbox/job/index.d.ts.map +1 -1
  820. package/dist/cmd/cloud/sandbox/job/index.js +7 -7
  821. package/dist/cmd/cloud/sandbox/job/index.js.map +1 -1
  822. package/dist/cmd/cloud/sandbox/job/list.d.ts +1 -1
  823. package/dist/cmd/cloud/sandbox/job/list.d.ts.map +1 -1
  824. package/dist/cmd/cloud/sandbox/job/list.js +5 -6
  825. package/dist/cmd/cloud/sandbox/job/list.js.map +1 -1
  826. package/dist/cmd/cloud/sandbox/job/logs.d.ts +1 -1
  827. package/dist/cmd/cloud/sandbox/job/logs.d.ts.map +1 -1
  828. package/dist/cmd/cloud/sandbox/job/logs.js +7 -8
  829. package/dist/cmd/cloud/sandbox/job/logs.js.map +1 -1
  830. package/dist/cmd/cloud/sandbox/list.d.ts +1 -1
  831. package/dist/cmd/cloud/sandbox/list.d.ts.map +1 -1
  832. package/dist/cmd/cloud/sandbox/list.js +3 -3
  833. package/dist/cmd/cloud/sandbox/list.js.map +1 -1
  834. package/dist/cmd/cloud/sandbox/pause.d.ts +1 -1
  835. package/dist/cmd/cloud/sandbox/pause.d.ts.map +1 -1
  836. package/dist/cmd/cloud/sandbox/pause.js +24 -8
  837. package/dist/cmd/cloud/sandbox/pause.js.map +1 -1
  838. package/dist/cmd/cloud/sandbox/resume.d.ts +1 -1
  839. package/dist/cmd/cloud/sandbox/resume.d.ts.map +1 -1
  840. package/dist/cmd/cloud/sandbox/resume.js +6 -7
  841. package/dist/cmd/cloud/sandbox/resume.js.map +1 -1
  842. package/dist/cmd/cloud/sandbox/run.d.ts +1 -1
  843. package/dist/cmd/cloud/sandbox/run.d.ts.map +1 -1
  844. package/dist/cmd/cloud/sandbox/run.js +15 -11
  845. package/dist/cmd/cloud/sandbox/run.js.map +1 -1
  846. package/dist/cmd/cloud/sandbox/runtime/index.d.ts +1 -1
  847. package/dist/cmd/cloud/sandbox/runtime/index.d.ts.map +1 -1
  848. package/dist/cmd/cloud/sandbox/runtime/index.js +3 -3
  849. package/dist/cmd/cloud/sandbox/runtime/index.js.map +1 -1
  850. package/dist/cmd/cloud/sandbox/runtime/list.d.ts +1 -1
  851. package/dist/cmd/cloud/sandbox/runtime/list.d.ts.map +1 -1
  852. package/dist/cmd/cloud/sandbox/runtime/list.js +4 -4
  853. package/dist/cmd/cloud/sandbox/runtime/list.js.map +1 -1
  854. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts +1 -1
  855. package/dist/cmd/cloud/sandbox/snapshot/build.d.ts.map +1 -1
  856. package/dist/cmd/cloud/sandbox/snapshot/build.js +36 -33
  857. package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
  858. package/dist/cmd/cloud/sandbox/snapshot/create.d.ts +1 -1
  859. package/dist/cmd/cloud/sandbox/snapshot/create.d.ts.map +1 -1
  860. package/dist/cmd/cloud/sandbox/snapshot/create.js +7 -7
  861. package/dist/cmd/cloud/sandbox/snapshot/create.js.map +1 -1
  862. package/dist/cmd/cloud/sandbox/snapshot/delete.d.ts +1 -1
  863. package/dist/cmd/cloud/sandbox/snapshot/delete.d.ts.map +1 -1
  864. package/dist/cmd/cloud/sandbox/snapshot/delete.js +4 -4
  865. package/dist/cmd/cloud/sandbox/snapshot/delete.js.map +1 -1
  866. package/dist/cmd/cloud/sandbox/snapshot/generate.d.ts +1 -1
  867. package/dist/cmd/cloud/sandbox/snapshot/generate.d.ts.map +1 -1
  868. package/dist/cmd/cloud/sandbox/snapshot/generate.js +2 -2
  869. package/dist/cmd/cloud/sandbox/snapshot/generate.js.map +1 -1
  870. package/dist/cmd/cloud/sandbox/snapshot/get.d.ts +1 -1
  871. package/dist/cmd/cloud/sandbox/snapshot/get.d.ts.map +1 -1
  872. package/dist/cmd/cloud/sandbox/snapshot/get.js +4 -4
  873. package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
  874. package/dist/cmd/cloud/sandbox/snapshot/index.d.ts +1 -1
  875. package/dist/cmd/cloud/sandbox/snapshot/index.d.ts.map +1 -1
  876. package/dist/cmd/cloud/sandbox/snapshot/index.js +9 -9
  877. package/dist/cmd/cloud/sandbox/snapshot/index.js.map +1 -1
  878. package/dist/cmd/cloud/sandbox/snapshot/list.d.ts +1 -1
  879. package/dist/cmd/cloud/sandbox/snapshot/list.d.ts.map +1 -1
  880. package/dist/cmd/cloud/sandbox/snapshot/list.js +4 -4
  881. package/dist/cmd/cloud/sandbox/snapshot/list.js.map +1 -1
  882. package/dist/cmd/cloud/sandbox/snapshot/tag.d.ts +1 -1
  883. package/dist/cmd/cloud/sandbox/snapshot/tag.d.ts.map +1 -1
  884. package/dist/cmd/cloud/sandbox/snapshot/tag.js +4 -4
  885. package/dist/cmd/cloud/sandbox/snapshot/tag.js.map +1 -1
  886. package/dist/cmd/cloud/sandbox/stats.d.ts +1 -1
  887. package/dist/cmd/cloud/sandbox/stats.d.ts.map +1 -1
  888. package/dist/cmd/cloud/sandbox/stats.js +4 -4
  889. package/dist/cmd/cloud/sandbox/stats.js.map +1 -1
  890. package/dist/cmd/cloud/sandbox/util.d.ts +11 -1
  891. package/dist/cmd/cloud/sandbox/util.d.ts.map +1 -1
  892. package/dist/cmd/cloud/sandbox/util.js +26 -7
  893. package/dist/cmd/cloud/sandbox/util.js.map +1 -1
  894. package/dist/cmd/cloud/schedule/create.d.ts +1 -1
  895. package/dist/cmd/cloud/schedule/create.d.ts.map +1 -1
  896. package/dist/cmd/cloud/schedule/create.js +4 -4
  897. package/dist/cmd/cloud/schedule/create.js.map +1 -1
  898. package/dist/cmd/cloud/schedule/delete.d.ts +1 -1
  899. package/dist/cmd/cloud/schedule/delete.d.ts.map +1 -1
  900. package/dist/cmd/cloud/schedule/delete.js +4 -4
  901. package/dist/cmd/cloud/schedule/delete.js.map +1 -1
  902. package/dist/cmd/cloud/schedule/delivery/get.d.ts +1 -1
  903. package/dist/cmd/cloud/schedule/delivery/get.d.ts.map +1 -1
  904. package/dist/cmd/cloud/schedule/delivery/get.js +4 -4
  905. package/dist/cmd/cloud/schedule/delivery/get.js.map +1 -1
  906. package/dist/cmd/cloud/schedule/delivery/index.d.ts +1 -1
  907. package/dist/cmd/cloud/schedule/delivery/index.d.ts.map +1 -1
  908. package/dist/cmd/cloud/schedule/delivery/index.js +4 -4
  909. package/dist/cmd/cloud/schedule/delivery/index.js.map +1 -1
  910. package/dist/cmd/cloud/schedule/delivery/list.d.ts +1 -1
  911. package/dist/cmd/cloud/schedule/delivery/list.d.ts.map +1 -1
  912. package/dist/cmd/cloud/schedule/delivery/list.js +4 -4
  913. package/dist/cmd/cloud/schedule/delivery/list.js.map +1 -1
  914. package/dist/cmd/cloud/schedule/destination/create.d.ts +1 -1
  915. package/dist/cmd/cloud/schedule/destination/create.d.ts.map +1 -1
  916. package/dist/cmd/cloud/schedule/destination/create.js +4 -4
  917. package/dist/cmd/cloud/schedule/destination/create.js.map +1 -1
  918. package/dist/cmd/cloud/schedule/destination/delete.d.ts +1 -1
  919. package/dist/cmd/cloud/schedule/destination/delete.d.ts.map +1 -1
  920. package/dist/cmd/cloud/schedule/destination/delete.js +4 -4
  921. package/dist/cmd/cloud/schedule/destination/delete.js.map +1 -1
  922. package/dist/cmd/cloud/schedule/destination/get.d.ts +1 -1
  923. package/dist/cmd/cloud/schedule/destination/get.d.ts.map +1 -1
  924. package/dist/cmd/cloud/schedule/destination/get.js +4 -4
  925. package/dist/cmd/cloud/schedule/destination/get.js.map +1 -1
  926. package/dist/cmd/cloud/schedule/destination/index.d.ts +1 -1
  927. package/dist/cmd/cloud/schedule/destination/index.d.ts.map +1 -1
  928. package/dist/cmd/cloud/schedule/destination/index.js +6 -6
  929. package/dist/cmd/cloud/schedule/destination/index.js.map +1 -1
  930. package/dist/cmd/cloud/schedule/destination/list.d.ts +1 -1
  931. package/dist/cmd/cloud/schedule/destination/list.d.ts.map +1 -1
  932. package/dist/cmd/cloud/schedule/destination/list.js +4 -4
  933. package/dist/cmd/cloud/schedule/destination/list.js.map +1 -1
  934. package/dist/cmd/cloud/schedule/get.d.ts +1 -1
  935. package/dist/cmd/cloud/schedule/get.d.ts.map +1 -1
  936. package/dist/cmd/cloud/schedule/get.js +4 -4
  937. package/dist/cmd/cloud/schedule/get.js.map +1 -1
  938. package/dist/cmd/cloud/schedule/index.d.ts +1 -1
  939. package/dist/cmd/cloud/schedule/index.d.ts.map +1 -1
  940. package/dist/cmd/cloud/schedule/index.js +10 -10
  941. package/dist/cmd/cloud/schedule/index.js.map +1 -1
  942. package/dist/cmd/cloud/schedule/list.d.ts +1 -1
  943. package/dist/cmd/cloud/schedule/list.d.ts.map +1 -1
  944. package/dist/cmd/cloud/schedule/list.js +4 -4
  945. package/dist/cmd/cloud/schedule/list.js.map +1 -1
  946. package/dist/cmd/cloud/schedule/stats.d.ts +1 -1
  947. package/dist/cmd/cloud/schedule/stats.d.ts.map +1 -1
  948. package/dist/cmd/cloud/schedule/stats.js +4 -4
  949. package/dist/cmd/cloud/schedule/stats.js.map +1 -1
  950. package/dist/cmd/cloud/schedule/update.d.ts +1 -1
  951. package/dist/cmd/cloud/schedule/update.d.ts.map +1 -1
  952. package/dist/cmd/cloud/schedule/update.js +4 -4
  953. package/dist/cmd/cloud/schedule/update.js.map +1 -1
  954. package/dist/cmd/cloud/schedule/util.d.ts +1 -1
  955. package/dist/cmd/cloud/schedule/util.d.ts.map +1 -1
  956. package/dist/cmd/cloud/schedule/util.js +3 -3
  957. package/dist/cmd/cloud/schedule/util.js.map +1 -1
  958. package/dist/cmd/cloud/scp/download.d.ts +1 -1
  959. package/dist/cmd/cloud/scp/download.d.ts.map +1 -1
  960. package/dist/cmd/cloud/scp/download.js +10 -13
  961. package/dist/cmd/cloud/scp/download.js.map +1 -1
  962. package/dist/cmd/cloud/scp/index.d.ts +1 -1
  963. package/dist/cmd/cloud/scp/index.d.ts.map +1 -1
  964. package/dist/cmd/cloud/scp/index.js +4 -4
  965. package/dist/cmd/cloud/scp/index.js.map +1 -1
  966. package/dist/cmd/cloud/scp/upload.d.ts +1 -1
  967. package/dist/cmd/cloud/scp/upload.d.ts.map +1 -1
  968. package/dist/cmd/cloud/scp/upload.js +10 -13
  969. package/dist/cmd/cloud/scp/upload.js.map +1 -1
  970. package/dist/cmd/cloud/services/index.d.ts +1 -1
  971. package/dist/cmd/cloud/services/index.d.ts.map +1 -1
  972. package/dist/cmd/cloud/services/index.js +2 -2
  973. package/dist/cmd/cloud/services/index.js.map +1 -1
  974. package/dist/cmd/cloud/services/stats.d.ts +1 -1
  975. package/dist/cmd/cloud/services/stats.d.ts.map +1 -1
  976. package/dist/cmd/cloud/services/stats.js +4 -4
  977. package/dist/cmd/cloud/services/stats.js.map +1 -1
  978. package/dist/cmd/cloud/session/get.d.ts +1 -1
  979. package/dist/cmd/cloud/session/get.d.ts.map +1 -1
  980. package/dist/cmd/cloud/session/get.js +5 -5
  981. package/dist/cmd/cloud/session/get.js.map +1 -1
  982. package/dist/cmd/cloud/session/index.d.ts +1 -1
  983. package/dist/cmd/cloud/session/index.d.ts.map +1 -1
  984. package/dist/cmd/cloud/session/index.js +5 -5
  985. package/dist/cmd/cloud/session/index.js.map +1 -1
  986. package/dist/cmd/cloud/session/list.d.ts +1 -1
  987. package/dist/cmd/cloud/session/list.d.ts.map +1 -1
  988. package/dist/cmd/cloud/session/list.js +5 -5
  989. package/dist/cmd/cloud/session/list.js.map +1 -1
  990. package/dist/cmd/cloud/session/logs.d.ts +1 -1
  991. package/dist/cmd/cloud/session/logs.d.ts.map +1 -1
  992. package/dist/cmd/cloud/session/logs.js +4 -4
  993. package/dist/cmd/cloud/session/logs.js.map +1 -1
  994. package/dist/cmd/cloud/ssh.d.ts +1 -1
  995. package/dist/cmd/cloud/ssh.d.ts.map +1 -1
  996. package/dist/cmd/cloud/ssh.js +8 -14
  997. package/dist/cmd/cloud/ssh.js.map +1 -1
  998. package/dist/cmd/cloud/storage/config.d.ts +1 -1
  999. package/dist/cmd/cloud/storage/config.d.ts.map +1 -1
  1000. package/dist/cmd/cloud/storage/config.js +5 -5
  1001. package/dist/cmd/cloud/storage/config.js.map +1 -1
  1002. package/dist/cmd/cloud/storage/create.d.ts +1 -1
  1003. package/dist/cmd/cloud/storage/create.d.ts.map +1 -1
  1004. package/dist/cmd/cloud/storage/create.js +7 -7
  1005. package/dist/cmd/cloud/storage/create.js.map +1 -1
  1006. package/dist/cmd/cloud/storage/delete.d.ts +1 -1
  1007. package/dist/cmd/cloud/storage/delete.d.ts.map +1 -1
  1008. package/dist/cmd/cloud/storage/delete.js +9 -9
  1009. package/dist/cmd/cloud/storage/delete.js.map +1 -1
  1010. package/dist/cmd/cloud/storage/download.d.ts +1 -1
  1011. package/dist/cmd/cloud/storage/download.d.ts.map +1 -1
  1012. package/dist/cmd/cloud/storage/download.js +9 -8
  1013. package/dist/cmd/cloud/storage/download.js.map +1 -1
  1014. package/dist/cmd/cloud/storage/get.d.ts +1 -1
  1015. package/dist/cmd/cloud/storage/get.d.ts.map +1 -1
  1016. package/dist/cmd/cloud/storage/get.js +6 -6
  1017. package/dist/cmd/cloud/storage/get.js.map +1 -1
  1018. package/dist/cmd/cloud/storage/index.d.ts +1 -1
  1019. package/dist/cmd/cloud/storage/index.d.ts.map +1 -1
  1020. package/dist/cmd/cloud/storage/index.js +9 -9
  1021. package/dist/cmd/cloud/storage/index.js.map +1 -1
  1022. package/dist/cmd/cloud/storage/list.d.ts +1 -1
  1023. package/dist/cmd/cloud/storage/list.d.ts.map +1 -1
  1024. package/dist/cmd/cloud/storage/list.js +7 -7
  1025. package/dist/cmd/cloud/storage/list.js.map +1 -1
  1026. package/dist/cmd/cloud/storage/upload.d.ts +1 -1
  1027. package/dist/cmd/cloud/storage/upload.d.ts.map +1 -1
  1028. package/dist/cmd/cloud/storage/upload.js +20 -16
  1029. package/dist/cmd/cloud/storage/upload.js.map +1 -1
  1030. package/dist/cmd/cloud/storage/utils.d.ts +13 -13
  1031. package/dist/cmd/cloud/storage/utils.d.ts.map +1 -1
  1032. package/dist/cmd/cloud/storage/utils.js +13 -16
  1033. package/dist/cmd/cloud/storage/utils.js.map +1 -1
  1034. package/dist/cmd/cloud/stream/create.d.ts +1 -1
  1035. package/dist/cmd/cloud/stream/create.d.ts.map +1 -1
  1036. package/dist/cmd/cloud/stream/create.js +11 -10
  1037. package/dist/cmd/cloud/stream/create.js.map +1 -1
  1038. package/dist/cmd/cloud/stream/delete.d.ts +1 -1
  1039. package/dist/cmd/cloud/stream/delete.d.ts.map +1 -1
  1040. package/dist/cmd/cloud/stream/delete.js +4 -4
  1041. package/dist/cmd/cloud/stream/delete.js.map +1 -1
  1042. package/dist/cmd/cloud/stream/get.d.ts +1 -1
  1043. package/dist/cmd/cloud/stream/get.d.ts.map +1 -1
  1044. package/dist/cmd/cloud/stream/get.js +11 -9
  1045. package/dist/cmd/cloud/stream/get.js.map +1 -1
  1046. package/dist/cmd/cloud/stream/index.d.ts +1 -1
  1047. package/dist/cmd/cloud/stream/index.d.ts.map +1 -1
  1048. package/dist/cmd/cloud/stream/index.js +7 -7
  1049. package/dist/cmd/cloud/stream/index.js.map +1 -1
  1050. package/dist/cmd/cloud/stream/list.d.ts +1 -1
  1051. package/dist/cmd/cloud/stream/list.d.ts.map +1 -1
  1052. package/dist/cmd/cloud/stream/list.js +3 -3
  1053. package/dist/cmd/cloud/stream/list.js.map +1 -1
  1054. package/dist/cmd/cloud/stream/stats.d.ts +1 -1
  1055. package/dist/cmd/cloud/stream/stats.d.ts.map +1 -1
  1056. package/dist/cmd/cloud/stream/stats.js +4 -4
  1057. package/dist/cmd/cloud/stream/stats.js.map +1 -1
  1058. package/dist/cmd/cloud/stream/util.d.ts +1 -1
  1059. package/dist/cmd/cloud/stream/util.d.ts.map +1 -1
  1060. package/dist/cmd/cloud/stream/util.js +2 -2
  1061. package/dist/cmd/cloud/stream/util.js.map +1 -1
  1062. package/dist/cmd/cloud/task/attachment.d.ts +1 -1
  1063. package/dist/cmd/cloud/task/attachment.d.ts.map +1 -1
  1064. package/dist/cmd/cloud/task/attachment.js +19 -13
  1065. package/dist/cmd/cloud/task/attachment.js.map +1 -1
  1066. package/dist/cmd/cloud/task/close.d.ts +1 -1
  1067. package/dist/cmd/cloud/task/close.d.ts.map +1 -1
  1068. package/dist/cmd/cloud/task/close.js +9 -8
  1069. package/dist/cmd/cloud/task/close.js.map +1 -1
  1070. package/dist/cmd/cloud/task/create.d.ts +1 -1
  1071. package/dist/cmd/cloud/task/create.d.ts.map +1 -1
  1072. package/dist/cmd/cloud/task/create.js +22 -18
  1073. package/dist/cmd/cloud/task/create.js.map +1 -1
  1074. package/dist/cmd/cloud/task/delete.d.ts +2 -2
  1075. package/dist/cmd/cloud/task/delete.d.ts.map +1 -1
  1076. package/dist/cmd/cloud/task/delete.js +6 -6
  1077. package/dist/cmd/cloud/task/delete.js.map +1 -1
  1078. package/dist/cmd/cloud/task/get.d.ts +1 -1
  1079. package/dist/cmd/cloud/task/get.d.ts.map +1 -1
  1080. package/dist/cmd/cloud/task/get.js +4 -4
  1081. package/dist/cmd/cloud/task/get.js.map +1 -1
  1082. package/dist/cmd/cloud/task/index.d.ts +1 -1
  1083. package/dist/cmd/cloud/task/index.d.ts.map +1 -1
  1084. package/dist/cmd/cloud/task/index.js +12 -12
  1085. package/dist/cmd/cloud/task/index.js.map +1 -1
  1086. package/dist/cmd/cloud/task/list.d.ts +1 -1
  1087. package/dist/cmd/cloud/task/list.d.ts.map +1 -1
  1088. package/dist/cmd/cloud/task/list.js +4 -4
  1089. package/dist/cmd/cloud/task/list.js.map +1 -1
  1090. package/dist/cmd/cloud/task/project.d.ts +1 -1
  1091. package/dist/cmd/cloud/task/project.d.ts.map +1 -1
  1092. package/dist/cmd/cloud/task/project.js +4 -4
  1093. package/dist/cmd/cloud/task/project.js.map +1 -1
  1094. package/dist/cmd/cloud/task/stats.d.ts +1 -1
  1095. package/dist/cmd/cloud/task/stats.d.ts.map +1 -1
  1096. package/dist/cmd/cloud/task/stats.js +4 -4
  1097. package/dist/cmd/cloud/task/stats.js.map +1 -1
  1098. package/dist/cmd/cloud/task/update.d.ts +1 -1
  1099. package/dist/cmd/cloud/task/update.d.ts.map +1 -1
  1100. package/dist/cmd/cloud/task/update.js +4 -4
  1101. package/dist/cmd/cloud/task/update.js.map +1 -1
  1102. package/dist/cmd/cloud/task/user.d.ts +1 -1
  1103. package/dist/cmd/cloud/task/user.d.ts.map +1 -1
  1104. package/dist/cmd/cloud/task/user.js +4 -4
  1105. package/dist/cmd/cloud/task/user.js.map +1 -1
  1106. package/dist/cmd/cloud/task/util.d.ts +1 -1
  1107. package/dist/cmd/cloud/task/util.d.ts.map +1 -1
  1108. package/dist/cmd/cloud/task/util.js +4 -4
  1109. package/dist/cmd/cloud/task/util.js.map +1 -1
  1110. package/dist/cmd/cloud/thread/delete.d.ts +1 -1
  1111. package/dist/cmd/cloud/thread/delete.d.ts.map +1 -1
  1112. package/dist/cmd/cloud/thread/delete.js +5 -5
  1113. package/dist/cmd/cloud/thread/delete.js.map +1 -1
  1114. package/dist/cmd/cloud/thread/get.d.ts +1 -1
  1115. package/dist/cmd/cloud/thread/get.d.ts.map +1 -1
  1116. package/dist/cmd/cloud/thread/get.js +5 -5
  1117. package/dist/cmd/cloud/thread/get.js.map +1 -1
  1118. package/dist/cmd/cloud/thread/index.d.ts +1 -1
  1119. package/dist/cmd/cloud/thread/index.d.ts.map +1 -1
  1120. package/dist/cmd/cloud/thread/index.js +5 -5
  1121. package/dist/cmd/cloud/thread/index.js.map +1 -1
  1122. package/dist/cmd/cloud/thread/list.d.ts +1 -1
  1123. package/dist/cmd/cloud/thread/list.d.ts.map +1 -1
  1124. package/dist/cmd/cloud/thread/list.js +5 -5
  1125. package/dist/cmd/cloud/thread/list.js.map +1 -1
  1126. package/dist/cmd/cloud/vector/delete-namespace.d.ts +1 -1
  1127. package/dist/cmd/cloud/vector/delete-namespace.d.ts.map +1 -1
  1128. package/dist/cmd/cloud/vector/delete-namespace.js +5 -5
  1129. package/dist/cmd/cloud/vector/delete-namespace.js.map +1 -1
  1130. package/dist/cmd/cloud/vector/delete.d.ts +1 -1
  1131. package/dist/cmd/cloud/vector/delete.d.ts.map +1 -1
  1132. package/dist/cmd/cloud/vector/delete.js +5 -5
  1133. package/dist/cmd/cloud/vector/delete.js.map +1 -1
  1134. package/dist/cmd/cloud/vector/get.d.ts +1 -1
  1135. package/dist/cmd/cloud/vector/get.d.ts.map +1 -1
  1136. package/dist/cmd/cloud/vector/get.js +4 -4
  1137. package/dist/cmd/cloud/vector/get.js.map +1 -1
  1138. package/dist/cmd/cloud/vector/index.d.ts +1 -1
  1139. package/dist/cmd/cloud/vector/index.d.ts.map +1 -1
  1140. package/dist/cmd/cloud/vector/index.js +9 -9
  1141. package/dist/cmd/cloud/vector/index.js.map +1 -1
  1142. package/dist/cmd/cloud/vector/list-namespaces.d.ts +1 -1
  1143. package/dist/cmd/cloud/vector/list-namespaces.d.ts.map +1 -1
  1144. package/dist/cmd/cloud/vector/list-namespaces.js +4 -4
  1145. package/dist/cmd/cloud/vector/list-namespaces.js.map +1 -1
  1146. package/dist/cmd/cloud/vector/search.d.ts +1 -1
  1147. package/dist/cmd/cloud/vector/search.d.ts.map +1 -1
  1148. package/dist/cmd/cloud/vector/search.js +4 -4
  1149. package/dist/cmd/cloud/vector/search.js.map +1 -1
  1150. package/dist/cmd/cloud/vector/stats.d.ts +1 -1
  1151. package/dist/cmd/cloud/vector/stats.d.ts.map +1 -1
  1152. package/dist/cmd/cloud/vector/stats.js +4 -4
  1153. package/dist/cmd/cloud/vector/stats.js.map +1 -1
  1154. package/dist/cmd/cloud/vector/upsert.d.ts +1 -1
  1155. package/dist/cmd/cloud/vector/upsert.d.ts.map +1 -1
  1156. package/dist/cmd/cloud/vector/upsert.js +10 -19
  1157. package/dist/cmd/cloud/vector/upsert.js.map +1 -1
  1158. package/dist/cmd/cloud/vector/util.d.ts +1 -1
  1159. package/dist/cmd/cloud/vector/util.d.ts.map +1 -1
  1160. package/dist/cmd/cloud/vector/util.js +2 -2
  1161. package/dist/cmd/cloud/vector/util.js.map +1 -1
  1162. package/dist/cmd/cloud/webhook/create.d.ts +1 -1
  1163. package/dist/cmd/cloud/webhook/create.d.ts.map +1 -1
  1164. package/dist/cmd/cloud/webhook/create.js +4 -4
  1165. package/dist/cmd/cloud/webhook/create.js.map +1 -1
  1166. package/dist/cmd/cloud/webhook/delete.d.ts +1 -1
  1167. package/dist/cmd/cloud/webhook/delete.d.ts.map +1 -1
  1168. package/dist/cmd/cloud/webhook/delete.js +5 -5
  1169. package/dist/cmd/cloud/webhook/delete.js.map +1 -1
  1170. package/dist/cmd/cloud/webhook/deliveries.d.ts +1 -1
  1171. package/dist/cmd/cloud/webhook/deliveries.d.ts.map +1 -1
  1172. package/dist/cmd/cloud/webhook/deliveries.js +4 -4
  1173. package/dist/cmd/cloud/webhook/deliveries.js.map +1 -1
  1174. package/dist/cmd/cloud/webhook/destinations.d.ts +1 -1
  1175. package/dist/cmd/cloud/webhook/destinations.d.ts.map +1 -1
  1176. package/dist/cmd/cloud/webhook/destinations.js +5 -5
  1177. package/dist/cmd/cloud/webhook/destinations.js.map +1 -1
  1178. package/dist/cmd/cloud/webhook/get.d.ts +1 -1
  1179. package/dist/cmd/cloud/webhook/get.d.ts.map +1 -1
  1180. package/dist/cmd/cloud/webhook/get.js +4 -4
  1181. package/dist/cmd/cloud/webhook/get.js.map +1 -1
  1182. package/dist/cmd/cloud/webhook/index.d.ts +1 -1
  1183. package/dist/cmd/cloud/webhook/index.d.ts.map +1 -1
  1184. package/dist/cmd/cloud/webhook/index.js +9 -9
  1185. package/dist/cmd/cloud/webhook/index.js.map +1 -1
  1186. package/dist/cmd/cloud/webhook/list.d.ts +1 -1
  1187. package/dist/cmd/cloud/webhook/list.d.ts.map +1 -1
  1188. package/dist/cmd/cloud/webhook/list.js +4 -4
  1189. package/dist/cmd/cloud/webhook/list.js.map +1 -1
  1190. package/dist/cmd/cloud/webhook/receipts.d.ts +1 -1
  1191. package/dist/cmd/cloud/webhook/receipts.d.ts.map +1 -1
  1192. package/dist/cmd/cloud/webhook/receipts.js +4 -4
  1193. package/dist/cmd/cloud/webhook/receipts.js.map +1 -1
  1194. package/dist/cmd/cloud/webhook/util.d.ts +1 -1
  1195. package/dist/cmd/cloud/webhook/util.d.ts.map +1 -1
  1196. package/dist/cmd/cloud/webhook/util.js +1 -1
  1197. package/dist/cmd/cloud/webhook/util.js.map +1 -1
  1198. package/dist/cmd/cloud/workflow/get.d.ts +1 -1
  1199. package/dist/cmd/cloud/workflow/get.d.ts.map +1 -1
  1200. package/dist/cmd/cloud/workflow/get.js +4 -4
  1201. package/dist/cmd/cloud/workflow/get.js.map +1 -1
  1202. package/dist/cmd/cloud/workflow/index.d.ts +1 -1
  1203. package/dist/cmd/cloud/workflow/index.d.ts.map +1 -1
  1204. package/dist/cmd/cloud/workflow/index.js +4 -4
  1205. package/dist/cmd/cloud/workflow/index.js.map +1 -1
  1206. package/dist/cmd/cloud/workflow/list.d.ts +1 -1
  1207. package/dist/cmd/cloud/workflow/list.d.ts.map +1 -1
  1208. package/dist/cmd/cloud/workflow/list.js +4 -4
  1209. package/dist/cmd/cloud/workflow/list.js.map +1 -1
  1210. package/dist/cmd/cloud/workflow/util.d.ts +1 -1
  1211. package/dist/cmd/cloud/workflow/util.d.ts.map +1 -1
  1212. package/dist/cmd/cloud/workflow/util.js +3 -3
  1213. package/dist/cmd/cloud/workflow/util.js.map +1 -1
  1214. package/dist/cmd/coder/archive.d.ts +1 -1
  1215. package/dist/cmd/coder/archive.d.ts.map +1 -1
  1216. package/dist/cmd/coder/archive.js +4 -4
  1217. package/dist/cmd/coder/archive.js.map +1 -1
  1218. package/dist/cmd/coder/create.d.ts +1 -1
  1219. package/dist/cmd/coder/create.d.ts.map +1 -1
  1220. package/dist/cmd/coder/create.js +7 -7
  1221. package/dist/cmd/coder/create.js.map +1 -1
  1222. package/dist/cmd/coder/delete.d.ts +1 -1
  1223. package/dist/cmd/coder/delete.d.ts.map +1 -1
  1224. package/dist/cmd/coder/delete.js +4 -4
  1225. package/dist/cmd/coder/delete.js.map +1 -1
  1226. package/dist/cmd/coder/events.d.ts +1 -1
  1227. package/dist/cmd/coder/events.d.ts.map +1 -1
  1228. package/dist/cmd/coder/events.js +4 -4
  1229. package/dist/cmd/coder/events.js.map +1 -1
  1230. package/dist/cmd/coder/extension-path.d.ts.map +1 -1
  1231. package/dist/cmd/coder/extension-path.js +5 -4
  1232. package/dist/cmd/coder/extension-path.js.map +1 -1
  1233. package/dist/cmd/coder/get.d.ts +1 -1
  1234. package/dist/cmd/coder/get.d.ts.map +1 -1
  1235. package/dist/cmd/coder/get.js +4 -4
  1236. package/dist/cmd/coder/get.js.map +1 -1
  1237. package/dist/cmd/coder/index.d.ts +1 -1
  1238. package/dist/cmd/coder/index.d.ts.map +1 -1
  1239. package/dist/cmd/coder/index.js +16 -16
  1240. package/dist/cmd/coder/index.js.map +1 -1
  1241. package/dist/cmd/coder/list.d.ts +1 -1
  1242. package/dist/cmd/coder/list.d.ts.map +1 -1
  1243. package/dist/cmd/coder/list.js +4 -4
  1244. package/dist/cmd/coder/list.js.map +1 -1
  1245. package/dist/cmd/coder/loop.d.ts +1 -1
  1246. package/dist/cmd/coder/loop.d.ts.map +1 -1
  1247. package/dist/cmd/coder/loop.js +4 -4
  1248. package/dist/cmd/coder/loop.js.map +1 -1
  1249. package/dist/cmd/coder/participants.d.ts +1 -1
  1250. package/dist/cmd/coder/participants.d.ts.map +1 -1
  1251. package/dist/cmd/coder/participants.js +4 -4
  1252. package/dist/cmd/coder/participants.js.map +1 -1
  1253. package/dist/cmd/coder/replay.d.ts +1 -1
  1254. package/dist/cmd/coder/replay.d.ts.map +1 -1
  1255. package/dist/cmd/coder/replay.js +4 -4
  1256. package/dist/cmd/coder/replay.js.map +1 -1
  1257. package/dist/cmd/coder/skill/buckets.d.ts +1 -1
  1258. package/dist/cmd/coder/skill/buckets.d.ts.map +1 -1
  1259. package/dist/cmd/coder/skill/buckets.js +4 -4
  1260. package/dist/cmd/coder/skill/buckets.js.map +1 -1
  1261. package/dist/cmd/coder/skill/delete.d.ts +1 -1
  1262. package/dist/cmd/coder/skill/delete.d.ts.map +1 -1
  1263. package/dist/cmd/coder/skill/delete.js +4 -4
  1264. package/dist/cmd/coder/skill/delete.js.map +1 -1
  1265. package/dist/cmd/coder/skill/index.d.ts +1 -1
  1266. package/dist/cmd/coder/skill/index.d.ts.map +1 -1
  1267. package/dist/cmd/coder/skill/index.js +6 -6
  1268. package/dist/cmd/coder/skill/index.js.map +1 -1
  1269. package/dist/cmd/coder/skill/list.d.ts +1 -1
  1270. package/dist/cmd/coder/skill/list.d.ts.map +1 -1
  1271. package/dist/cmd/coder/skill/list.js +4 -4
  1272. package/dist/cmd/coder/skill/list.js.map +1 -1
  1273. package/dist/cmd/coder/skill/save.d.ts +1 -1
  1274. package/dist/cmd/coder/skill/save.d.ts.map +1 -1
  1275. package/dist/cmd/coder/skill/save.js +4 -4
  1276. package/dist/cmd/coder/skill/save.js.map +1 -1
  1277. package/dist/cmd/coder/start.d.ts +1 -1
  1278. package/dist/cmd/coder/start.d.ts.map +1 -1
  1279. package/dist/cmd/coder/start.js +23 -20
  1280. package/dist/cmd/coder/start.js.map +1 -1
  1281. package/dist/cmd/coder/update.d.ts +1 -1
  1282. package/dist/cmd/coder/update.d.ts.map +1 -1
  1283. package/dist/cmd/coder/update.js +4 -4
  1284. package/dist/cmd/coder/update.js.map +1 -1
  1285. package/dist/cmd/coder/users.d.ts +1 -1
  1286. package/dist/cmd/coder/users.d.ts.map +1 -1
  1287. package/dist/cmd/coder/users.js +4 -4
  1288. package/dist/cmd/coder/users.js.map +1 -1
  1289. package/dist/cmd/coder/workspace/create.d.ts +1 -1
  1290. package/dist/cmd/coder/workspace/create.d.ts.map +1 -1
  1291. package/dist/cmd/coder/workspace/create.js +5 -5
  1292. package/dist/cmd/coder/workspace/create.js.map +1 -1
  1293. package/dist/cmd/coder/workspace/delete.d.ts +1 -1
  1294. package/dist/cmd/coder/workspace/delete.d.ts.map +1 -1
  1295. package/dist/cmd/coder/workspace/delete.js +4 -4
  1296. package/dist/cmd/coder/workspace/delete.js.map +1 -1
  1297. package/dist/cmd/coder/workspace/get.d.ts +1 -1
  1298. package/dist/cmd/coder/workspace/get.d.ts.map +1 -1
  1299. package/dist/cmd/coder/workspace/get.js +4 -4
  1300. package/dist/cmd/coder/workspace/get.js.map +1 -1
  1301. package/dist/cmd/coder/workspace/index.d.ts +1 -1
  1302. package/dist/cmd/coder/workspace/index.d.ts.map +1 -1
  1303. package/dist/cmd/coder/workspace/index.js +6 -6
  1304. package/dist/cmd/coder/workspace/index.js.map +1 -1
  1305. package/dist/cmd/coder/workspace/list.d.ts +1 -1
  1306. package/dist/cmd/coder/workspace/list.d.ts.map +1 -1
  1307. package/dist/cmd/coder/workspace/list.js +4 -4
  1308. package/dist/cmd/coder/workspace/list.js.map +1 -1
  1309. package/dist/cmd/dev/index.d.ts +1 -1
  1310. package/dist/cmd/dev/index.d.ts.map +1 -1
  1311. package/dist/cmd/dev/index.js +18 -14
  1312. package/dist/cmd/dev/index.js.map +1 -1
  1313. package/dist/cmd/git/account/add.d.ts +3 -3
  1314. package/dist/cmd/git/account/add.d.ts.map +1 -1
  1315. package/dist/cmd/git/account/add.js +8 -17
  1316. package/dist/cmd/git/account/add.js.map +1 -1
  1317. package/dist/cmd/git/account/index.d.ts +1 -1
  1318. package/dist/cmd/git/account/index.d.ts.map +1 -1
  1319. package/dist/cmd/git/account/index.js +4 -4
  1320. package/dist/cmd/git/account/index.js.map +1 -1
  1321. package/dist/cmd/git/account/list.d.ts +1 -1
  1322. package/dist/cmd/git/account/list.d.ts.map +1 -1
  1323. package/dist/cmd/git/account/list.js +5 -5
  1324. package/dist/cmd/git/account/list.js.map +1 -1
  1325. package/dist/cmd/git/account/remove.d.ts +1 -1
  1326. package/dist/cmd/git/account/remove.d.ts.map +1 -1
  1327. package/dist/cmd/git/account/remove.js +5 -5
  1328. package/dist/cmd/git/account/remove.js.map +1 -1
  1329. package/dist/cmd/git/api.d.ts +1 -1
  1330. package/dist/cmd/git/api.d.ts.map +1 -1
  1331. package/dist/cmd/git/api.js +2 -1
  1332. package/dist/cmd/git/api.js.map +1 -1
  1333. package/dist/cmd/git/identity/connect.d.ts +3 -3
  1334. package/dist/cmd/git/identity/connect.d.ts.map +1 -1
  1335. package/dist/cmd/git/identity/connect.js +8 -17
  1336. package/dist/cmd/git/identity/connect.js.map +1 -1
  1337. package/dist/cmd/git/identity/disconnect.d.ts +1 -1
  1338. package/dist/cmd/git/identity/disconnect.d.ts.map +1 -1
  1339. package/dist/cmd/git/identity/disconnect.js +5 -5
  1340. package/dist/cmd/git/identity/disconnect.js.map +1 -1
  1341. package/dist/cmd/git/identity/index.d.ts +1 -1
  1342. package/dist/cmd/git/identity/index.d.ts.map +1 -1
  1343. package/dist/cmd/git/identity/index.js +4 -4
  1344. package/dist/cmd/git/identity/index.js.map +1 -1
  1345. package/dist/cmd/git/identity/status.d.ts +1 -1
  1346. package/dist/cmd/git/identity/status.d.ts.map +1 -1
  1347. package/dist/cmd/git/identity/status.js +5 -5
  1348. package/dist/cmd/git/identity/status.js.map +1 -1
  1349. package/dist/cmd/git/index.d.ts +1 -1
  1350. package/dist/cmd/git/index.d.ts.map +1 -1
  1351. package/dist/cmd/git/index.js +7 -7
  1352. package/dist/cmd/git/index.js.map +1 -1
  1353. package/dist/cmd/git/link.d.ts +4 -4
  1354. package/dist/cmd/git/link.d.ts.map +1 -1
  1355. package/dist/cmd/git/link.js +26 -36
  1356. package/dist/cmd/git/link.js.map +1 -1
  1357. package/dist/cmd/git/list.d.ts +1 -1
  1358. package/dist/cmd/git/list.d.ts.map +1 -1
  1359. package/dist/cmd/git/list.js +5 -5
  1360. package/dist/cmd/git/list.js.map +1 -1
  1361. package/dist/cmd/git/status.d.ts +1 -1
  1362. package/dist/cmd/git/status.d.ts.map +1 -1
  1363. package/dist/cmd/git/status.js +5 -5
  1364. package/dist/cmd/git/status.js.map +1 -1
  1365. package/dist/cmd/git/unlink.d.ts +1 -1
  1366. package/dist/cmd/git/unlink.d.ts.map +1 -1
  1367. package/dist/cmd/git/unlink.js +5 -5
  1368. package/dist/cmd/git/unlink.js.map +1 -1
  1369. package/dist/cmd/help/index.d.ts +1 -1
  1370. package/dist/cmd/help/index.d.ts.map +1 -1
  1371. package/dist/cmd/help/index.js +3 -3
  1372. package/dist/cmd/help/index.js.map +1 -1
  1373. package/dist/cmd/index.d.ts +1 -1
  1374. package/dist/cmd/index.d.ts.map +1 -1
  1375. package/dist/cmd/index.js +16 -16
  1376. package/dist/cmd/index.js.map +1 -1
  1377. package/dist/cmd/profile/create.d.ts +1 -1
  1378. package/dist/cmd/profile/create.d.ts.map +1 -1
  1379. package/dist/cmd/profile/create.js +5 -5
  1380. package/dist/cmd/profile/create.js.map +1 -1
  1381. package/dist/cmd/profile/current.d.ts +1 -1
  1382. package/dist/cmd/profile/current.d.ts.map +1 -1
  1383. package/dist/cmd/profile/current.js +2 -2
  1384. package/dist/cmd/profile/current.js.map +1 -1
  1385. package/dist/cmd/profile/delete.d.ts +1 -1
  1386. package/dist/cmd/profile/delete.d.ts.map +1 -1
  1387. package/dist/cmd/profile/delete.js +5 -5
  1388. package/dist/cmd/profile/delete.js.map +1 -1
  1389. package/dist/cmd/profile/index.d.ts +1 -1
  1390. package/dist/cmd/profile/index.d.ts.map +1 -1
  1391. package/dist/cmd/profile/index.js +8 -8
  1392. package/dist/cmd/profile/index.js.map +1 -1
  1393. package/dist/cmd/profile/list.d.ts +1 -1
  1394. package/dist/cmd/profile/list.d.ts.map +1 -1
  1395. package/dist/cmd/profile/list.js +4 -4
  1396. package/dist/cmd/profile/list.js.map +1 -1
  1397. package/dist/cmd/profile/show.d.ts +1 -1
  1398. package/dist/cmd/profile/show.d.ts.map +1 -1
  1399. package/dist/cmd/profile/show.js +5 -5
  1400. package/dist/cmd/profile/show.js.map +1 -1
  1401. package/dist/cmd/profile/use.d.ts +1 -1
  1402. package/dist/cmd/profile/use.d.ts.map +1 -1
  1403. package/dist/cmd/profile/use.js +4 -4
  1404. package/dist/cmd/profile/use.js.map +1 -1
  1405. package/dist/cmd/project/add/database.d.ts +1 -1
  1406. package/dist/cmd/project/add/database.d.ts.map +1 -1
  1407. package/dist/cmd/project/add/database.js +8 -8
  1408. package/dist/cmd/project/add/database.js.map +1 -1
  1409. package/dist/cmd/project/add/domain.d.ts +1 -1
  1410. package/dist/cmd/project/add/domain.d.ts.map +1 -1
  1411. package/dist/cmd/project/add/domain.js +8 -8
  1412. package/dist/cmd/project/add/domain.js.map +1 -1
  1413. package/dist/cmd/project/add/index.d.ts +1 -1
  1414. package/dist/cmd/project/add/index.d.ts.map +1 -1
  1415. package/dist/cmd/project/add/index.js +5 -5
  1416. package/dist/cmd/project/add/index.js.map +1 -1
  1417. package/dist/cmd/project/add/storage.d.ts +1 -1
  1418. package/dist/cmd/project/add/storage.d.ts.map +1 -1
  1419. package/dist/cmd/project/add/storage.js +8 -8
  1420. package/dist/cmd/project/add/storage.js.map +1 -1
  1421. package/dist/cmd/project/create.d.ts +1 -1
  1422. package/dist/cmd/project/create.d.ts.map +1 -1
  1423. package/dist/cmd/project/create.js +153 -4
  1424. package/dist/cmd/project/create.js.map +1 -1
  1425. package/dist/cmd/project/delete.d.ts +1 -1
  1426. package/dist/cmd/project/delete.d.ts.map +1 -1
  1427. package/dist/cmd/project/delete.js +3 -3
  1428. package/dist/cmd/project/delete.js.map +1 -1
  1429. package/dist/cmd/project/detect-existing.d.ts +46 -0
  1430. package/dist/cmd/project/detect-existing.d.ts.map +1 -0
  1431. package/dist/cmd/project/detect-existing.js +113 -0
  1432. package/dist/cmd/project/detect-existing.js.map +1 -0
  1433. package/dist/cmd/project/domain/check.d.ts +1 -1
  1434. package/dist/cmd/project/domain/check.d.ts.map +1 -1
  1435. package/dist/cmd/project/domain/check.js +6 -6
  1436. package/dist/cmd/project/domain/check.js.map +1 -1
  1437. package/dist/cmd/project/domain/index.d.ts +1 -1
  1438. package/dist/cmd/project/domain/index.d.ts.map +1 -1
  1439. package/dist/cmd/project/domain/index.js +3 -3
  1440. package/dist/cmd/project/domain/index.js.map +1 -1
  1441. package/dist/cmd/project/frameworks.d.ts.map +1 -1
  1442. package/dist/cmd/project/frameworks.js +18 -15
  1443. package/dist/cmd/project/frameworks.js.map +1 -1
  1444. package/dist/cmd/project/hostname/get.d.ts +1 -1
  1445. package/dist/cmd/project/hostname/get.d.ts.map +1 -1
  1446. package/dist/cmd/project/hostname/get.js +4 -4
  1447. package/dist/cmd/project/hostname/get.js.map +1 -1
  1448. package/dist/cmd/project/hostname/index.d.ts +1 -1
  1449. package/dist/cmd/project/hostname/index.d.ts.map +1 -1
  1450. package/dist/cmd/project/hostname/index.js +4 -4
  1451. package/dist/cmd/project/hostname/index.js.map +1 -1
  1452. package/dist/cmd/project/hostname/set.d.ts +1 -1
  1453. package/dist/cmd/project/hostname/set.d.ts.map +1 -1
  1454. package/dist/cmd/project/hostname/set.js +5 -5
  1455. package/dist/cmd/project/hostname/set.js.map +1 -1
  1456. package/dist/cmd/project/import.d.ts +1 -1
  1457. package/dist/cmd/project/import.d.ts.map +1 -1
  1458. package/dist/cmd/project/import.js +7 -7
  1459. package/dist/cmd/project/import.js.map +1 -1
  1460. package/dist/cmd/project/index.d.ts +1 -1
  1461. package/dist/cmd/project/index.d.ts.map +1 -1
  1462. package/dist/cmd/project/index.js +10 -10
  1463. package/dist/cmd/project/index.js.map +1 -1
  1464. package/dist/cmd/project/list.d.ts +1 -1
  1465. package/dist/cmd/project/list.d.ts.map +1 -1
  1466. package/dist/cmd/project/list.js +3 -3
  1467. package/dist/cmd/project/list.js.map +1 -1
  1468. package/dist/cmd/project/provisioning-decisions.d.ts +43 -0
  1469. package/dist/cmd/project/provisioning-decisions.d.ts.map +1 -0
  1470. package/dist/cmd/project/provisioning-decisions.js +51 -0
  1471. package/dist/cmd/project/provisioning-decisions.js.map +1 -0
  1472. package/dist/cmd/project/random-name.d.ts +17 -0
  1473. package/dist/cmd/project/random-name.d.ts.map +1 -0
  1474. package/dist/cmd/project/random-name.js +144 -0
  1475. package/dist/cmd/project/random-name.js.map +1 -0
  1476. package/dist/cmd/project/reconcile.d.ts +5 -5
  1477. package/dist/cmd/project/reconcile.d.ts.map +1 -1
  1478. package/dist/cmd/project/reconcile.js +17 -16
  1479. package/dist/cmd/project/reconcile.js.map +1 -1
  1480. package/dist/cmd/project/remote-import.d.ts +2 -2
  1481. package/dist/cmd/project/remote-import.d.ts.map +1 -1
  1482. package/dist/cmd/project/remote-import.js +50 -79
  1483. package/dist/cmd/project/remote-import.js.map +1 -1
  1484. package/dist/cmd/project/scaffold.d.ts +1 -1
  1485. package/dist/cmd/project/scaffold.d.ts.map +1 -1
  1486. package/dist/cmd/project/scaffold.js +9 -8
  1487. package/dist/cmd/project/scaffold.js.map +1 -1
  1488. package/dist/cmd/project/services-catalog.d.ts +72 -0
  1489. package/dist/cmd/project/services-catalog.d.ts.map +1 -0
  1490. package/dist/cmd/project/services-catalog.js +141 -0
  1491. package/dist/cmd/project/services-catalog.js.map +1 -0
  1492. package/dist/cmd/project/services-composer.d.ts +49 -0
  1493. package/dist/cmd/project/services-composer.d.ts.map +1 -0
  1494. package/dist/cmd/project/services-composer.js +366 -0
  1495. package/dist/cmd/project/services-composer.js.map +1 -0
  1496. package/dist/cmd/project/show.d.ts +1 -1
  1497. package/dist/cmd/project/show.d.ts.map +1 -1
  1498. package/dist/cmd/project/show.js +3 -3
  1499. package/dist/cmd/project/show.js.map +1 -1
  1500. package/dist/cmd/project/template-flow.d.ts +9 -2
  1501. package/dist/cmd/project/template-flow.d.ts.map +1 -1
  1502. package/dist/cmd/project/template-flow.js +250 -169
  1503. package/dist/cmd/project/template-flow.js.map +1 -1
  1504. package/dist/cmd/project/templates/astro/manifest.json +27 -0
  1505. package/dist/cmd/project/templates/astro/src/lib/translate.ts +40 -0
  1506. package/dist/cmd/project/templates/astro/src/pages/api/translate.ts +10 -0
  1507. package/dist/cmd/project/templates/astro/src/pages/index.astro +173 -0
  1508. package/dist/cmd/project/templates/hono/manifest.json +35 -0
  1509. package/dist/cmd/project/templates/hono/src/index.ts +29 -0
  1510. package/dist/cmd/project/templates/hono/src/landing.html +91 -0
  1511. package/dist/cmd/project/templates/hono/src/translate.ts +40 -0
  1512. package/dist/cmd/project/templates/nextjs/manifest.json +27 -0
  1513. package/dist/cmd/project/templates/nextjs/src/app/api/translate/route.ts +8 -0
  1514. package/dist/cmd/project/templates/nextjs/src/app/page.tsx +246 -0
  1515. package/dist/cmd/project/templates/nextjs/src/lib/translate.ts +40 -0
  1516. package/dist/cmd/project/templates/nuxt/app.vue +203 -0
  1517. package/dist/cmd/project/templates/nuxt/manifest.json +27 -0
  1518. package/dist/cmd/project/templates/nuxt/server/api/translate.post.ts +4 -0
  1519. package/dist/cmd/project/templates/nuxt/server/utils/translate.ts +40 -0
  1520. package/dist/cmd/project/templates/remix/app/lib/translate.ts +40 -0
  1521. package/dist/cmd/project/templates/remix/app/routes/api.translate.ts +17 -0
  1522. package/dist/cmd/project/templates/remix/app/routes/home.tsx +249 -0
  1523. package/dist/cmd/project/templates/remix/manifest.json +27 -0
  1524. package/dist/cmd/project/templates/services/db/files/astro/drizzle.config.ts +10 -0
  1525. package/dist/cmd/project/templates/services/db/files/astro/src/db/index.ts +10 -0
  1526. package/dist/cmd/project/templates/services/db/files/astro/src/db/schema.ts +20 -0
  1527. package/dist/cmd/project/templates/services/db/files/astro/src/pages/api/history.ts +14 -0
  1528. package/dist/cmd/project/templates/services/db/files/hono/drizzle.config.ts +10 -0
  1529. package/dist/cmd/project/templates/services/db/files/hono/src/db/index.ts +10 -0
  1530. package/dist/cmd/project/templates/services/db/files/hono/src/db/schema.ts +20 -0
  1531. package/dist/cmd/project/templates/services/db/files/nextjs/drizzle.config.ts +10 -0
  1532. package/dist/cmd/project/templates/services/db/files/nextjs/src/app/api/history/route.ts +12 -0
  1533. package/dist/cmd/project/templates/services/db/files/nextjs/src/db/index.ts +10 -0
  1534. package/dist/cmd/project/templates/services/db/files/nextjs/src/db/schema.ts +20 -0
  1535. package/dist/cmd/project/templates/services/db/files/nuxt/drizzle.config.ts +10 -0
  1536. package/dist/cmd/project/templates/services/db/files/nuxt/server/api/history.get.ts +10 -0
  1537. package/dist/cmd/project/templates/services/db/files/nuxt/server/db/index.ts +10 -0
  1538. package/dist/cmd/project/templates/services/db/files/nuxt/server/db/schema.ts +20 -0
  1539. package/dist/cmd/project/templates/services/db/files/remix/app/db/index.ts +10 -0
  1540. package/dist/cmd/project/templates/services/db/files/remix/app/db/schema.ts +20 -0
  1541. package/dist/cmd/project/templates/services/db/files/remix/app/routes/api.history.ts +12 -0
  1542. package/dist/cmd/project/templates/services/db/files/remix/drizzle.config.ts +10 -0
  1543. package/dist/cmd/project/templates/services/db/files/sveltekit/drizzle.config.ts +10 -0
  1544. package/dist/cmd/project/templates/services/db/files/sveltekit/src/lib/server/db/index.ts +10 -0
  1545. package/dist/cmd/project/templates/services/db/files/sveltekit/src/lib/server/db/schema.ts +20 -0
  1546. package/dist/cmd/project/templates/services/db/files/sveltekit/src/routes/api/history/+server.ts +12 -0
  1547. package/dist/cmd/project/templates/services/db/files/vite-react/drizzle.config.ts +10 -0
  1548. package/dist/cmd/project/templates/services/db/files/vite-react/server/db/index.ts +10 -0
  1549. package/dist/cmd/project/templates/services/db/files/vite-react/server/db/schema.ts +20 -0
  1550. package/dist/cmd/project/templates/services/db/manifest.json +23 -0
  1551. package/dist/cmd/project/templates/services/db/snippets/astro/page.after-form.astro +1 -0
  1552. package/dist/cmd/project/templates/services/db/snippets/astro/page.on-mount.astro +1 -0
  1553. package/dist/cmd/project/templates/services/db/snippets/astro/page.on-result.astro +7 -0
  1554. package/dist/cmd/project/templates/services/db/snippets/astro/page.state.astro +44 -0
  1555. package/dist/cmd/project/templates/services/db/snippets/astro/translate.imports.ts +2 -0
  1556. package/dist/cmd/project/templates/services/db/snippets/astro/translate.translate-post.ts +9 -0
  1557. package/dist/cmd/project/templates/services/db/snippets/astro/translate.translate-pre.ts +21 -0
  1558. package/dist/cmd/project/templates/services/db/snippets/hono/page.after-form.html +1 -0
  1559. package/dist/cmd/project/templates/services/db/snippets/hono/page.on-mount.html +1 -0
  1560. package/dist/cmd/project/templates/services/db/snippets/hono/page.on-result.html +7 -0
  1561. package/dist/cmd/project/templates/services/db/snippets/hono/page.state.html +37 -0
  1562. package/dist/cmd/project/templates/services/db/snippets/hono/server.imports.ts +2 -0
  1563. package/dist/cmd/project/templates/services/db/snippets/hono/server.routes.ts +9 -0
  1564. package/dist/cmd/project/templates/services/db/snippets/hono/translate.imports.ts +2 -0
  1565. package/dist/cmd/project/templates/services/db/snippets/hono/translate.translate-post.ts +9 -0
  1566. package/dist/cmd/project/templates/services/db/snippets/hono/translate.translate-pre.ts +21 -0
  1567. package/dist/cmd/project/templates/services/db/snippets/nextjs/page.after-form.tsx +22 -0
  1568. package/dist/cmd/project/templates/services/db/snippets/nextjs/page.after-result.tsx +3 -0
  1569. package/dist/cmd/project/templates/services/db/snippets/nextjs/page.imports.tsx +2 -0
  1570. package/dist/cmd/project/templates/services/db/snippets/nextjs/page.on-mount.tsx +6 -0
  1571. package/dist/cmd/project/templates/services/db/snippets/nextjs/page.on-result.tsx +8 -0
  1572. package/dist/cmd/project/templates/services/db/snippets/nextjs/page.state.tsx +1 -0
  1573. package/dist/cmd/project/templates/services/db/snippets/nextjs/translate.imports.ts +2 -0
  1574. package/dist/cmd/project/templates/services/db/snippets/nextjs/translate.translate-post.ts +9 -0
  1575. package/dist/cmd/project/templates/services/db/snippets/nextjs/translate.translate-pre.ts +21 -0
  1576. package/dist/cmd/project/templates/services/db/snippets/nuxt/page.after-form.vue +17 -0
  1577. package/dist/cmd/project/templates/services/db/snippets/nuxt/page.after-result.vue +3 -0
  1578. package/dist/cmd/project/templates/services/db/snippets/nuxt/page.imports.vue +1 -0
  1579. package/dist/cmd/project/templates/services/db/snippets/nuxt/page.on-result.vue +5 -0
  1580. package/dist/cmd/project/templates/services/db/snippets/nuxt/page.state.vue +3 -0
  1581. package/dist/cmd/project/templates/services/db/snippets/nuxt/translate.imports.ts +2 -0
  1582. package/dist/cmd/project/templates/services/db/snippets/nuxt/translate.translate-post.ts +9 -0
  1583. package/dist/cmd/project/templates/services/db/snippets/nuxt/translate.translate-pre.ts +21 -0
  1584. package/dist/cmd/project/templates/services/db/snippets/remix/page.after-form.tsx +22 -0
  1585. package/dist/cmd/project/templates/services/db/snippets/remix/page.after-result.tsx +3 -0
  1586. package/dist/cmd/project/templates/services/db/snippets/remix/page.imports.tsx +2 -0
  1587. package/dist/cmd/project/templates/services/db/snippets/remix/page.on-mount.tsx +6 -0
  1588. package/dist/cmd/project/templates/services/db/snippets/remix/page.on-result.tsx +8 -0
  1589. package/dist/cmd/project/templates/services/db/snippets/remix/page.state.tsx +1 -0
  1590. package/dist/cmd/project/templates/services/db/snippets/remix/translate.imports.ts +2 -0
  1591. package/dist/cmd/project/templates/services/db/snippets/remix/translate.translate-post.ts +9 -0
  1592. package/dist/cmd/project/templates/services/db/snippets/remix/translate.translate-pre.ts +21 -0
  1593. package/dist/cmd/project/templates/services/db/snippets/sveltekit/page.after-form.svelte +17 -0
  1594. package/dist/cmd/project/templates/services/db/snippets/sveltekit/page.after-result.svelte +3 -0
  1595. package/dist/cmd/project/templates/services/db/snippets/sveltekit/page.imports.svelte +11 -0
  1596. package/dist/cmd/project/templates/services/db/snippets/sveltekit/page.on-mount.svelte +1 -0
  1597. package/dist/cmd/project/templates/services/db/snippets/sveltekit/page.on-result.svelte +3 -0
  1598. package/dist/cmd/project/templates/services/db/snippets/sveltekit/page.state.svelte +8 -0
  1599. package/dist/cmd/project/templates/services/db/snippets/sveltekit/translate.imports.ts +2 -0
  1600. package/dist/cmd/project/templates/services/db/snippets/sveltekit/translate.translate-post.ts +9 -0
  1601. package/dist/cmd/project/templates/services/db/snippets/sveltekit/translate.translate-pre.ts +21 -0
  1602. package/dist/cmd/project/templates/services/db/snippets/vite-react/page.after-form.tsx +22 -0
  1603. package/dist/cmd/project/templates/services/db/snippets/vite-react/page.after-result.tsx +3 -0
  1604. package/dist/cmd/project/templates/services/db/snippets/vite-react/page.imports.tsx +3 -0
  1605. package/dist/cmd/project/templates/services/db/snippets/vite-react/page.on-result.tsx +5 -0
  1606. package/dist/cmd/project/templates/services/db/snippets/vite-react/page.state.tsx +9 -0
  1607. package/dist/cmd/project/templates/services/db/snippets/vite-react/server.imports.ts +2 -0
  1608. package/dist/cmd/project/templates/services/db/snippets/vite-react/server.routes.ts +8 -0
  1609. package/dist/cmd/project/templates/services/db/snippets/vite-react/translate.imports.ts +2 -0
  1610. package/dist/cmd/project/templates/services/db/snippets/vite-react/translate.translate-post.ts +9 -0
  1611. package/dist/cmd/project/templates/services/db/snippets/vite-react/translate.translate-pre.ts +21 -0
  1612. package/dist/cmd/project/templates/services/keyvalue/files/astro/src/pages/api/preferences.ts +21 -0
  1613. package/dist/cmd/project/templates/services/keyvalue/files/nextjs/src/app/api/preferences/route.ts +22 -0
  1614. package/dist/cmd/project/templates/services/keyvalue/files/nuxt/server/api/preferences.get.ts +11 -0
  1615. package/dist/cmd/project/templates/services/keyvalue/files/nuxt/server/api/preferences.post.ts +9 -0
  1616. package/dist/cmd/project/templates/services/keyvalue/files/remix/app/routes/api.preferences.ts +23 -0
  1617. package/dist/cmd/project/templates/services/keyvalue/files/sveltekit/src/routes/api/preferences/+server.ts +17 -0
  1618. package/dist/cmd/project/templates/services/keyvalue/manifest.json +9 -0
  1619. package/dist/cmd/project/templates/services/keyvalue/snippets/astro/page.on-mount.astro +8 -0
  1620. package/dist/cmd/project/templates/services/keyvalue/snippets/astro/page.on-result.astro +5 -0
  1621. package/dist/cmd/project/templates/services/keyvalue/snippets/hono/page.on-mount.html +10 -0
  1622. package/dist/cmd/project/templates/services/keyvalue/snippets/hono/page.on-result.html +5 -0
  1623. package/dist/cmd/project/templates/services/keyvalue/snippets/hono/server.imports.ts +1 -0
  1624. package/dist/cmd/project/templates/services/keyvalue/snippets/hono/server.module.ts +3 -0
  1625. package/dist/cmd/project/templates/services/keyvalue/snippets/hono/server.routes.ts +14 -0
  1626. package/dist/cmd/project/templates/services/keyvalue/snippets/nextjs/page.imports.tsx +1 -0
  1627. package/dist/cmd/project/templates/services/keyvalue/snippets/nextjs/page.on-mount.tsx +9 -0
  1628. package/dist/cmd/project/templates/services/keyvalue/snippets/nextjs/page.on-result.tsx +9 -0
  1629. package/dist/cmd/project/templates/services/keyvalue/snippets/nuxt/page.on-mount.vue +11 -0
  1630. package/dist/cmd/project/templates/services/keyvalue/snippets/nuxt/page.on-result.vue +8 -0
  1631. package/dist/cmd/project/templates/services/keyvalue/snippets/remix/page.imports.tsx +1 -0
  1632. package/dist/cmd/project/templates/services/keyvalue/snippets/remix/page.on-mount.tsx +9 -0
  1633. package/dist/cmd/project/templates/services/keyvalue/snippets/remix/page.on-result.tsx +9 -0
  1634. package/dist/cmd/project/templates/services/keyvalue/snippets/sveltekit/page.imports.svelte +1 -0
  1635. package/dist/cmd/project/templates/services/keyvalue/snippets/sveltekit/page.on-mount.svelte +9 -0
  1636. package/dist/cmd/project/templates/services/keyvalue/snippets/sveltekit/page.on-result.svelte +9 -0
  1637. package/dist/cmd/project/templates/services/keyvalue/snippets/vite-react/page.imports.tsx +1 -0
  1638. package/dist/cmd/project/templates/services/keyvalue/snippets/vite-react/page.on-mount.tsx +9 -0
  1639. package/dist/cmd/project/templates/services/keyvalue/snippets/vite-react/page.on-result.tsx +9 -0
  1640. package/dist/cmd/project/templates/services/keyvalue/snippets/vite-react/server.imports.ts +1 -0
  1641. package/dist/cmd/project/templates/services/keyvalue/snippets/vite-react/server.module.ts +3 -0
  1642. package/dist/cmd/project/templates/services/keyvalue/snippets/vite-react/server.routes.ts +13 -0
  1643. package/dist/cmd/project/templates/services/queue/files/astro/src/pages/api/jobs.ts +13 -0
  1644. package/dist/cmd/project/templates/services/queue/files/nextjs/src/app/api/jobs/route.ts +11 -0
  1645. package/dist/cmd/project/templates/services/queue/files/nuxt/server/api/jobs.post.ts +9 -0
  1646. package/dist/cmd/project/templates/services/queue/files/remix/app/routes/api.jobs.ts +12 -0
  1647. package/dist/cmd/project/templates/services/queue/files/sveltekit/src/routes/api/jobs/+server.ts +11 -0
  1648. package/dist/cmd/project/templates/services/queue/manifest.json +9 -0
  1649. package/dist/cmd/project/templates/services/queue/snippets/astro/page.after-form.astro +1 -0
  1650. package/dist/cmd/project/templates/services/queue/snippets/astro/page.inside-form-buttons.astro +7 -0
  1651. package/dist/cmd/project/templates/services/queue/snippets/astro/page.state.astro +50 -0
  1652. package/dist/cmd/project/templates/services/queue/snippets/hono/page.after-form.html +1 -0
  1653. package/dist/cmd/project/templates/services/queue/snippets/hono/page.inside-form-buttons.html +7 -0
  1654. package/dist/cmd/project/templates/services/queue/snippets/hono/page.state.html +42 -0
  1655. package/dist/cmd/project/templates/services/queue/snippets/hono/server.imports.ts +1 -0
  1656. package/dist/cmd/project/templates/services/queue/snippets/hono/server.module.ts +2 -0
  1657. package/dist/cmd/project/templates/services/queue/snippets/hono/server.routes.ts +6 -0
  1658. package/dist/cmd/project/templates/services/queue/snippets/nextjs/page.after-form.tsx +21 -0
  1659. package/dist/cmd/project/templates/services/queue/snippets/nextjs/page.inside-form-buttons.tsx +8 -0
  1660. package/dist/cmd/project/templates/services/queue/snippets/nextjs/page.state.tsx +19 -0
  1661. package/dist/cmd/project/templates/services/queue/snippets/nuxt/page.after-form.vue +18 -0
  1662. package/dist/cmd/project/templates/services/queue/snippets/nuxt/page.inside-form-buttons.vue +8 -0
  1663. package/dist/cmd/project/templates/services/queue/snippets/nuxt/page.state.vue +25 -0
  1664. package/dist/cmd/project/templates/services/queue/snippets/remix/page.after-form.tsx +21 -0
  1665. package/dist/cmd/project/templates/services/queue/snippets/remix/page.inside-form-buttons.tsx +8 -0
  1666. package/dist/cmd/project/templates/services/queue/snippets/remix/page.state.tsx +19 -0
  1667. package/dist/cmd/project/templates/services/queue/snippets/sveltekit/page.after-form.svelte +18 -0
  1668. package/dist/cmd/project/templates/services/queue/snippets/sveltekit/page.inside-form-buttons.svelte +8 -0
  1669. package/dist/cmd/project/templates/services/queue/snippets/sveltekit/page.state.svelte +19 -0
  1670. package/dist/cmd/project/templates/services/queue/snippets/vite-react/page.after-form.tsx +21 -0
  1671. package/dist/cmd/project/templates/services/queue/snippets/vite-react/page.inside-form-buttons.tsx +8 -0
  1672. package/dist/cmd/project/templates/services/queue/snippets/vite-react/page.state.tsx +19 -0
  1673. package/dist/cmd/project/templates/services/queue/snippets/vite-react/server.imports.ts +1 -0
  1674. package/dist/cmd/project/templates/services/queue/snippets/vite-react/server.module.ts +2 -0
  1675. package/dist/cmd/project/templates/services/queue/snippets/vite-react/server.routes.ts +5 -0
  1676. package/dist/cmd/project/templates/services/storage/files/astro/src/pages/api/export.ts +18 -0
  1677. package/dist/cmd/project/templates/services/storage/files/astro/src/storage/index.ts +15 -0
  1678. package/dist/cmd/project/templates/services/storage/files/hono/src/storage/index.ts +15 -0
  1679. package/dist/cmd/project/templates/services/storage/files/nextjs/src/app/api/export/route.ts +16 -0
  1680. package/dist/cmd/project/templates/services/storage/files/nextjs/src/storage/index.ts +15 -0
  1681. package/dist/cmd/project/templates/services/storage/files/nuxt/server/api/export.post.ts +15 -0
  1682. package/dist/cmd/project/templates/services/storage/files/nuxt/server/storage/index.ts +15 -0
  1683. package/dist/cmd/project/templates/services/storage/files/remix/app/routes/api.export.ts +16 -0
  1684. package/dist/cmd/project/templates/services/storage/files/remix/app/storage/index.ts +15 -0
  1685. package/dist/cmd/project/templates/services/storage/files/sveltekit/src/lib/server/storage/index.ts +15 -0
  1686. package/dist/cmd/project/templates/services/storage/files/sveltekit/src/routes/api/export/+server.ts +16 -0
  1687. package/dist/cmd/project/templates/services/storage/files/vite-react/server/storage/index.ts +15 -0
  1688. package/dist/cmd/project/templates/services/storage/manifest.json +19 -0
  1689. package/dist/cmd/project/templates/services/storage/snippets/astro/page.after-form.astro +13 -0
  1690. package/dist/cmd/project/templates/services/storage/snippets/astro/page.state.astro +17 -0
  1691. package/dist/cmd/project/templates/services/storage/snippets/hono/page.after-form.html +13 -0
  1692. package/dist/cmd/project/templates/services/storage/snippets/hono/page.state.html +17 -0
  1693. package/dist/cmd/project/templates/services/storage/snippets/hono/server.imports.ts +1 -0
  1694. package/dist/cmd/project/templates/services/storage/snippets/hono/server.routes.ts +12 -0
  1695. package/dist/cmd/project/templates/services/storage/snippets/nextjs/page.after-form.tsx +18 -0
  1696. package/dist/cmd/project/templates/services/storage/snippets/nextjs/page.state.tsx +12 -0
  1697. package/dist/cmd/project/templates/services/storage/snippets/nuxt/page.after-form.vue +16 -0
  1698. package/dist/cmd/project/templates/services/storage/snippets/nuxt/page.state.vue +13 -0
  1699. package/dist/cmd/project/templates/services/storage/snippets/remix/page.after-form.tsx +18 -0
  1700. package/dist/cmd/project/templates/services/storage/snippets/remix/page.state.tsx +12 -0
  1701. package/dist/cmd/project/templates/services/storage/snippets/sveltekit/page.after-form.svelte +18 -0
  1702. package/dist/cmd/project/templates/services/storage/snippets/sveltekit/page.state.svelte +12 -0
  1703. package/dist/cmd/project/templates/services/storage/snippets/vite-react/page.after-form.tsx +18 -0
  1704. package/dist/cmd/project/templates/services/storage/snippets/vite-react/page.state.tsx +12 -0
  1705. package/dist/cmd/project/templates/services/storage/snippets/vite-react/server.imports.ts +1 -0
  1706. package/dist/cmd/project/templates/services/storage/snippets/vite-react/server.routes.ts +11 -0
  1707. package/dist/cmd/project/templates/services/vector/files/astro/src/pages/api/similar.ts +18 -0
  1708. package/dist/cmd/project/templates/services/vector/files/nextjs/src/app/api/similar/route.ts +13 -0
  1709. package/dist/cmd/project/templates/services/vector/files/nuxt/server/api/similar.get.ts +10 -0
  1710. package/dist/cmd/project/templates/services/vector/files/remix/app/routes/api.similar.ts +14 -0
  1711. package/dist/cmd/project/templates/services/vector/files/sveltekit/src/routes/api/similar/+server.ts +12 -0
  1712. package/dist/cmd/project/templates/services/vector/manifest.json +9 -0
  1713. package/dist/cmd/project/templates/services/vector/snippets/astro/page.after-result.astro +1 -0
  1714. package/dist/cmd/project/templates/services/vector/snippets/astro/page.on-result.astro +6 -0
  1715. package/dist/cmd/project/templates/services/vector/snippets/astro/page.state.astro +29 -0
  1716. package/dist/cmd/project/templates/services/vector/snippets/astro/translate.imports.ts +1 -0
  1717. package/dist/cmd/project/templates/services/vector/snippets/astro/translate.module.ts +2 -0
  1718. package/dist/cmd/project/templates/services/vector/snippets/astro/translate.translate-post.ts +6 -0
  1719. package/dist/cmd/project/templates/services/vector/snippets/hono/page.after-result.html +1 -0
  1720. package/dist/cmd/project/templates/services/vector/snippets/hono/page.on-result.html +6 -0
  1721. package/dist/cmd/project/templates/services/vector/snippets/hono/page.state.html +25 -0
  1722. package/dist/cmd/project/templates/services/vector/snippets/hono/server.imports.ts +1 -0
  1723. package/dist/cmd/project/templates/services/vector/snippets/hono/server.module.ts +2 -0
  1724. package/dist/cmd/project/templates/services/vector/snippets/hono/server.routes.ts +7 -0
  1725. package/dist/cmd/project/templates/services/vector/snippets/hono/translate.imports.ts +1 -0
  1726. package/dist/cmd/project/templates/services/vector/snippets/hono/translate.module.ts +2 -0
  1727. package/dist/cmd/project/templates/services/vector/snippets/hono/translate.translate-post.ts +6 -0
  1728. package/dist/cmd/project/templates/services/vector/snippets/nextjs/page.after-result.tsx +13 -0
  1729. package/dist/cmd/project/templates/services/vector/snippets/nextjs/page.imports.tsx +1 -0
  1730. package/dist/cmd/project/templates/services/vector/snippets/nextjs/page.on-result.tsx +7 -0
  1731. package/dist/cmd/project/templates/services/vector/snippets/nextjs/page.state.tsx +6 -0
  1732. package/dist/cmd/project/templates/services/vector/snippets/nextjs/translate.imports.ts +1 -0
  1733. package/dist/cmd/project/templates/services/vector/snippets/nextjs/translate.module.ts +2 -0
  1734. package/dist/cmd/project/templates/services/vector/snippets/nextjs/translate.translate-post.ts +6 -0
  1735. package/dist/cmd/project/templates/services/vector/snippets/nuxt/page.after-result.vue +16 -0
  1736. package/dist/cmd/project/templates/services/vector/snippets/nuxt/page.on-result.vue +10 -0
  1737. package/dist/cmd/project/templates/services/vector/snippets/nuxt/page.state.vue +6 -0
  1738. package/dist/cmd/project/templates/services/vector/snippets/nuxt/translate.imports.ts +1 -0
  1739. package/dist/cmd/project/templates/services/vector/snippets/nuxt/translate.module.ts +2 -0
  1740. package/dist/cmd/project/templates/services/vector/snippets/nuxt/translate.translate-post.ts +6 -0
  1741. package/dist/cmd/project/templates/services/vector/snippets/remix/page.after-result.tsx +13 -0
  1742. package/dist/cmd/project/templates/services/vector/snippets/remix/page.imports.tsx +1 -0
  1743. package/dist/cmd/project/templates/services/vector/snippets/remix/page.on-result.tsx +7 -0
  1744. package/dist/cmd/project/templates/services/vector/snippets/remix/page.state.tsx +6 -0
  1745. package/dist/cmd/project/templates/services/vector/snippets/remix/translate.imports.ts +1 -0
  1746. package/dist/cmd/project/templates/services/vector/snippets/remix/translate.module.ts +2 -0
  1747. package/dist/cmd/project/templates/services/vector/snippets/remix/translate.translate-post.ts +6 -0
  1748. package/dist/cmd/project/templates/services/vector/snippets/sveltekit/page.after-result.svelte +13 -0
  1749. package/dist/cmd/project/templates/services/vector/snippets/sveltekit/page.on-result.svelte +11 -0
  1750. package/dist/cmd/project/templates/services/vector/snippets/sveltekit/page.state.svelte +6 -0
  1751. package/dist/cmd/project/templates/services/vector/snippets/sveltekit/translate.imports.ts +1 -0
  1752. package/dist/cmd/project/templates/services/vector/snippets/sveltekit/translate.module.ts +2 -0
  1753. package/dist/cmd/project/templates/services/vector/snippets/sveltekit/translate.translate-post.ts +6 -0
  1754. package/dist/cmd/project/templates/services/vector/snippets/vite-react/page.after-result.tsx +13 -0
  1755. package/dist/cmd/project/templates/services/vector/snippets/vite-react/page.imports.tsx +1 -0
  1756. package/dist/cmd/project/templates/services/vector/snippets/vite-react/page.on-result.tsx +7 -0
  1757. package/dist/cmd/project/templates/services/vector/snippets/vite-react/page.state.tsx +6 -0
  1758. package/dist/cmd/project/templates/services/vector/snippets/vite-react/server.imports.ts +1 -0
  1759. package/dist/cmd/project/templates/services/vector/snippets/vite-react/server.module.ts +2 -0
  1760. package/dist/cmd/project/templates/services/vector/snippets/vite-react/server.routes.ts +6 -0
  1761. package/dist/cmd/project/templates/services/vector/snippets/vite-react/translate.imports.ts +1 -0
  1762. package/dist/cmd/project/templates/services/vector/snippets/vite-react/translate.module.ts +2 -0
  1763. package/dist/cmd/project/templates/services/vector/snippets/vite-react/translate.translate-post.ts +6 -0
  1764. package/dist/cmd/project/templates/sveltekit/manifest.json +27 -0
  1765. package/dist/cmd/project/templates/sveltekit/src/lib/server/translate.ts +40 -0
  1766. package/dist/cmd/project/templates/sveltekit/src/routes/+page.server.ts +13 -0
  1767. package/dist/cmd/project/templates/sveltekit/src/routes/+page.svelte +216 -0
  1768. package/dist/cmd/project/templates/vite-react/manifest.json +35 -0
  1769. package/dist/cmd/project/templates/vite-react/server/translate.ts +40 -0
  1770. package/dist/cmd/project/templates/vite-react/server.ts +33 -0
  1771. package/dist/cmd/project/templates/vite-react/src/App.tsx +253 -0
  1772. package/dist/cmd/repl/index.d.ts +1 -1
  1773. package/dist/cmd/repl/index.d.ts.map +1 -1
  1774. package/dist/cmd/repl/index.js +3 -3
  1775. package/dist/cmd/repl/index.js.map +1 -1
  1776. package/dist/cmd/setup/index.d.ts +1 -1
  1777. package/dist/cmd/setup/index.d.ts.map +1 -1
  1778. package/dist/cmd/setup/index.js +9 -13
  1779. package/dist/cmd/setup/index.js.map +1 -1
  1780. package/dist/cmd/support/index.d.ts +1 -1
  1781. package/dist/cmd/support/index.d.ts.map +1 -1
  1782. package/dist/cmd/support/index.js +4 -4
  1783. package/dist/cmd/support/index.js.map +1 -1
  1784. package/dist/cmd/support/logs/index.d.ts +1 -1
  1785. package/dist/cmd/support/logs/index.js +3 -3
  1786. package/dist/cmd/support/logs/index.js.map +1 -1
  1787. package/dist/cmd/support/logs/path.d.ts +1 -1
  1788. package/dist/cmd/support/logs/path.js +3 -3
  1789. package/dist/cmd/support/logs/path.js.map +1 -1
  1790. package/dist/cmd/support/logs/show.d.ts +1 -1
  1791. package/dist/cmd/support/logs/show.js +3 -3
  1792. package/dist/cmd/support/logs/show.js.map +1 -1
  1793. package/dist/cmd/support/report.d.ts +1 -1
  1794. package/dist/cmd/support/report.d.ts.map +1 -1
  1795. package/dist/cmd/support/report.js +25 -22
  1796. package/dist/cmd/support/report.js.map +1 -1
  1797. package/dist/cmd/support/system.d.ts +1 -1
  1798. package/dist/cmd/support/system.d.ts.map +1 -1
  1799. package/dist/cmd/support/system.js +10 -9
  1800. package/dist/cmd/support/system.js.map +1 -1
  1801. package/dist/cmd/upgrade/index.d.ts +2 -2
  1802. package/dist/cmd/upgrade/index.d.ts.map +1 -1
  1803. package/dist/cmd/upgrade/index.js +11 -11
  1804. package/dist/cmd/upgrade/index.js.map +1 -1
  1805. package/dist/cmd/upgrade/npm-availability.d.ts +3 -2
  1806. package/dist/cmd/upgrade/npm-availability.d.ts.map +1 -1
  1807. package/dist/cmd/upgrade/npm-availability.js +12 -29
  1808. package/dist/cmd/upgrade/npm-availability.js.map +1 -1
  1809. package/dist/cmd/version/index.d.ts +1 -1
  1810. package/dist/cmd/version/index.d.ts.map +1 -1
  1811. package/dist/cmd/version/index.js +4 -4
  1812. package/dist/cmd/version/index.js.map +1 -1
  1813. package/dist/command-prefix.js +2 -2
  1814. package/dist/command-prefix.js.map +1 -1
  1815. package/dist/composite-logger.d.ts.map +1 -1
  1816. package/dist/composite-logger.js +19 -0
  1817. package/dist/composite-logger.js.map +1 -1
  1818. package/dist/config.d.ts +2 -2
  1819. package/dist/config.d.ts.map +1 -1
  1820. package/dist/config.js +34 -43
  1821. package/dist/config.js.map +1 -1
  1822. package/dist/deploy-metadata.d.ts +4 -5
  1823. package/dist/deploy-metadata.d.ts.map +1 -1
  1824. package/dist/deploy-metadata.js +11 -5
  1825. package/dist/deploy-metadata.js.map +1 -1
  1826. package/dist/domain.d.ts +1 -1
  1827. package/dist/domain.d.ts.map +1 -1
  1828. package/dist/domain.js +6 -4
  1829. package/dist/domain.js.map +1 -1
  1830. package/dist/download.js +2 -2
  1831. package/dist/download.js.map +1 -1
  1832. package/dist/env-util.d.ts.map +1 -1
  1833. package/dist/env-util.js +5 -4
  1834. package/dist/env-util.js.map +1 -1
  1835. package/dist/errors.d.ts +1 -1
  1836. package/dist/errors.d.ts.map +1 -1
  1837. package/dist/explain.d.ts +1 -1
  1838. package/dist/explain.d.ts.map +1 -1
  1839. package/dist/explain.js +1 -1
  1840. package/dist/explain.js.map +1 -1
  1841. package/dist/git-helper.d.ts +51 -9
  1842. package/dist/git-helper.d.ts.map +1 -1
  1843. package/dist/git-helper.js +70 -45
  1844. package/dist/git-helper.js.map +1 -1
  1845. package/dist/index.d.ts +31 -31
  1846. package/dist/index.d.ts.map +1 -1
  1847. package/dist/index.js +28 -28
  1848. package/dist/index.js.map +1 -1
  1849. package/dist/internal-logger.d.ts.map +1 -1
  1850. package/dist/internal-logger.js +8 -6
  1851. package/dist/internal-logger.js.map +1 -1
  1852. package/dist/keychain.d.ts.map +1 -1
  1853. package/dist/keychain.js +35 -38
  1854. package/dist/keychain.js.map +1 -1
  1855. package/dist/main.d.ts +2 -0
  1856. package/dist/main.d.ts.map +1 -0
  1857. package/dist/main.js +396 -0
  1858. package/dist/main.js.map +1 -0
  1859. package/dist/node-compat/ansi.d.ts +134 -0
  1860. package/dist/node-compat/ansi.d.ts.map +1 -0
  1861. package/dist/node-compat/ansi.js +128 -0
  1862. package/dist/node-compat/ansi.js.map +1 -0
  1863. package/dist/node-compat/crypto.d.ts +30 -0
  1864. package/dist/node-compat/crypto.d.ts.map +1 -0
  1865. package/dist/node-compat/crypto.js +33 -0
  1866. package/dist/node-compat/crypto.js.map +1 -0
  1867. package/dist/node-compat/fs.d.ts +31 -0
  1868. package/dist/node-compat/fs.d.ts.map +1 -0
  1869. package/dist/node-compat/fs.js +44 -0
  1870. package/dist/node-compat/fs.js.map +1 -0
  1871. package/dist/node-compat/index.d.ts +31 -0
  1872. package/dist/node-compat/index.d.ts.map +1 -0
  1873. package/dist/node-compat/index.js +31 -0
  1874. package/dist/node-compat/index.js.map +1 -0
  1875. package/dist/node-compat/proc.d.ts +120 -0
  1876. package/dist/node-compat/proc.d.ts.map +1 -0
  1877. package/dist/node-compat/proc.js +184 -0
  1878. package/dist/node-compat/proc.js.map +1 -0
  1879. package/dist/node-compat/runtime-info.d.ts +47 -0
  1880. package/dist/node-compat/runtime-info.d.ts.map +1 -0
  1881. package/dist/node-compat/runtime-info.js +65 -0
  1882. package/dist/node-compat/runtime-info.js.map +1 -0
  1883. package/dist/node-compat/sqlite.d.ts +58 -0
  1884. package/dist/node-compat/sqlite.d.ts.map +1 -0
  1885. package/dist/node-compat/sqlite.js +47 -0
  1886. package/dist/node-compat/sqlite.js.map +1 -0
  1887. package/dist/node-compat/stdin.d.ts +18 -0
  1888. package/dist/node-compat/stdin.d.ts.map +1 -0
  1889. package/dist/node-compat/stdin.js +24 -0
  1890. package/dist/node-compat/stdin.js.map +1 -0
  1891. package/dist/node-compat/which.d.ts +21 -0
  1892. package/dist/node-compat/which.d.ts.map +1 -0
  1893. package/dist/node-compat/which.js +58 -0
  1894. package/dist/node-compat/which.js.map +1 -0
  1895. package/dist/output.d.ts +1 -1
  1896. package/dist/output.d.ts.map +1 -1
  1897. package/dist/output.js +1 -1
  1898. package/dist/output.js.map +1 -1
  1899. package/dist/regions.d.ts +1 -1
  1900. package/dist/regions.d.ts.map +1 -1
  1901. package/dist/regions.js +7 -8
  1902. package/dist/regions.js.map +1 -1
  1903. package/dist/repl.d.ts +1 -1
  1904. package/dist/repl.d.ts.map +1 -1
  1905. package/dist/repl.js +8 -7
  1906. package/dist/repl.js.map +1 -1
  1907. package/dist/runtime.d.ts +6 -1
  1908. package/dist/runtime.d.ts.map +1 -1
  1909. package/dist/runtime.js +26 -12
  1910. package/dist/runtime.js.map +1 -1
  1911. package/dist/schema-generator.d.ts +1 -1
  1912. package/dist/schema-generator.d.ts.map +1 -1
  1913. package/dist/schema-generator.js +2 -2
  1914. package/dist/schema-generator.js.map +1 -1
  1915. package/dist/schema-parser.d.ts +1 -1
  1916. package/dist/schema-parser.d.ts.map +1 -1
  1917. package/dist/sound.d.ts +1 -1
  1918. package/dist/sound.d.ts.map +1 -1
  1919. package/dist/sound.js +5 -5
  1920. package/dist/sound.js.map +1 -1
  1921. package/dist/steps.d.ts +1 -1
  1922. package/dist/steps.d.ts.map +1 -1
  1923. package/dist/steps.js +3 -3
  1924. package/dist/steps.js.map +1 -1
  1925. package/dist/system/browser.d.ts +39 -0
  1926. package/dist/system/browser.d.ts.map +1 -0
  1927. package/dist/system/browser.js +54 -0
  1928. package/dist/system/browser.js.map +1 -0
  1929. package/dist/tui/box.js +5 -5
  1930. package/dist/tui/box.js.map +1 -1
  1931. package/dist/tui/colors.js +1 -1
  1932. package/dist/tui/colors.js.map +1 -1
  1933. package/dist/tui/prompt.d.ts +29 -0
  1934. package/dist/tui/prompt.d.ts.map +1 -1
  1935. package/dist/tui/prompt.js +182 -10
  1936. package/dist/tui/prompt.js.map +1 -1
  1937. package/dist/tui/symbols.js +1 -1
  1938. package/dist/tui/symbols.js.map +1 -1
  1939. package/dist/tui.d.ts +14 -14
  1940. package/dist/tui.d.ts.map +1 -1
  1941. package/dist/tui.js +54 -69
  1942. package/dist/tui.js.map +1 -1
  1943. package/dist/types.d.ts +1 -1
  1944. package/dist/types.d.ts.map +1 -1
  1945. package/dist/typescript-errors.d.ts +1 -1
  1946. package/dist/typescript-errors.d.ts.map +1 -1
  1947. package/dist/typescript-errors.js +7 -6
  1948. package/dist/typescript-errors.js.map +1 -1
  1949. package/dist/utils/apt-validator.d.ts +1 -1
  1950. package/dist/utils/apt-validator.d.ts.map +1 -1
  1951. package/dist/utils/apt-validator.js +8 -8
  1952. package/dist/utils/apt-validator.js.map +1 -1
  1953. package/dist/utils/deps.d.ts +1 -1
  1954. package/dist/utils/deps.d.ts.map +1 -1
  1955. package/dist/utils/deps.js +10 -6
  1956. package/dist/utils/deps.js.map +1 -1
  1957. package/dist/utils/git.d.ts.map +1 -1
  1958. package/dist/utils/git.js +45 -58
  1959. package/dist/utils/git.js.map +1 -1
  1960. package/dist/utils/installation-type.d.ts.map +1 -1
  1961. package/dist/utils/installation-type.js +8 -3
  1962. package/dist/utils/installation-type.js.map +1 -1
  1963. package/dist/utils/stream-url.js +1 -1
  1964. package/dist/utils/stream-url.js.map +1 -1
  1965. package/dist/utils/zip.d.ts.map +1 -1
  1966. package/dist/utils/zip.js +11 -5
  1967. package/dist/utils/zip.js.map +1 -1
  1968. package/dist/version-check.d.ts +1 -1
  1969. package/dist/version-check.d.ts.map +1 -1
  1970. package/dist/version-check.js +11 -16
  1971. package/dist/version-check.js.map +1 -1
  1972. package/dist/version.d.ts +25 -4
  1973. package/dist/version.d.ts.map +1 -1
  1974. package/dist/version.js +45 -7
  1975. package/dist/version.js.map +1 -1
  1976. package/package.json +18 -11
  1977. package/bin/cli.ts +0 -455
  1978. package/dist/cache/agent-intro.d.ts +0 -23
  1979. package/dist/cache/agent-intro.d.ts.map +0 -1
  1980. package/dist/cache/agent-intro.js +0 -104
  1981. package/dist/cache/agent-intro.js.map +0 -1
  1982. package/dist/cmd/upgrade/npm-availability.test.d.ts +0 -2
  1983. package/dist/cmd/upgrade/npm-availability.test.d.ts.map +0 -1
  1984. package/dist/cmd/upgrade/npm-availability.test.js +0 -48
  1985. package/dist/cmd/upgrade/npm-availability.test.js.map +0 -1
  1986. package/src/agent-detection.ts +0 -588
  1987. package/src/ai-help.ts +0 -454
  1988. package/src/api-errors.md +0 -115
  1989. package/src/api.ts +0 -105
  1990. package/src/auth.ts +0 -539
  1991. package/src/banner.ts +0 -92
  1992. package/src/build-report.ts +0 -456
  1993. package/src/bun-path.ts +0 -27
  1994. package/src/cache/agent-intro.ts +0 -115
  1995. package/src/cache/index.ts +0 -22
  1996. package/src/cache/project-cache.ts +0 -41
  1997. package/src/cache/resource-region.ts +0 -209
  1998. package/src/cache/user-cache.ts +0 -92
  1999. package/src/catalyst.ts +0 -24
  2000. package/src/cli-logger.ts +0 -80
  2001. package/src/cli.ts +0 -2514
  2002. package/src/cmd/ai/capabilities/index.ts +0 -16
  2003. package/src/cmd/ai/capabilities/show.ts +0 -258
  2004. package/src/cmd/ai/claude-code/constants.ts +0 -26
  2005. package/src/cmd/ai/claude-code/index.ts +0 -23
  2006. package/src/cmd/ai/claude-code/install.ts +0 -178
  2007. package/src/cmd/ai/claude-code/uninstall.ts +0 -122
  2008. package/src/cmd/ai/detect.ts +0 -54
  2009. package/src/cmd/ai/index.ts +0 -51
  2010. package/src/cmd/ai/intro.ts +0 -174
  2011. package/src/cmd/ai/opencode/dashboard.ts +0 -772
  2012. package/src/cmd/ai/opencode/db.ts +0 -66
  2013. package/src/cmd/ai/opencode/index.ts +0 -44
  2014. package/src/cmd/ai/opencode/inspect.ts +0 -516
  2015. package/src/cmd/ai/opencode/install.ts +0 -120
  2016. package/src/cmd/ai/opencode/run.ts +0 -112
  2017. package/src/cmd/ai/opencode/uninstall.ts +0 -90
  2018. package/src/cmd/ai/prompt/api.ts +0 -31
  2019. package/src/cmd/ai/prompt/index.ts +0 -22
  2020. package/src/cmd/ai/prompt/llm.ts +0 -368
  2021. package/src/cmd/ai/prompt/version.ts +0 -62
  2022. package/src/cmd/ai/prompt/web.ts +0 -31
  2023. package/src/cmd/ai/schema/generate.ts +0 -64
  2024. package/src/cmd/ai/schema/index.ts +0 -15
  2025. package/src/cmd/ai/schema/show.ts +0 -30
  2026. package/src/cmd/auth/README.md +0 -129
  2027. package/src/cmd/auth/api.ts +0 -159
  2028. package/src/cmd/auth/apikey.ts +0 -36
  2029. package/src/cmd/auth/index.ts +0 -29
  2030. package/src/cmd/auth/login.ts +0 -147
  2031. package/src/cmd/auth/logout.ts +0 -26
  2032. package/src/cmd/auth/org/enroll.ts +0 -104
  2033. package/src/cmd/auth/org/index.ts +0 -192
  2034. package/src/cmd/auth/org/status.ts +0 -64
  2035. package/src/cmd/auth/org/unenroll.ts +0 -80
  2036. package/src/cmd/auth/signup.ts +0 -64
  2037. package/src/cmd/auth/ssh/add.ts +0 -309
  2038. package/src/cmd/auth/ssh/api.ts +0 -106
  2039. package/src/cmd/auth/ssh/delete.ts +0 -168
  2040. package/src/cmd/auth/ssh/index.ts +0 -16
  2041. package/src/cmd/auth/ssh/list.ts +0 -82
  2042. package/src/cmd/auth/whoami.ts +0 -77
  2043. package/src/cmd/build/adapters/generic.ts +0 -239
  2044. package/src/cmd/build/adapters/index.ts +0 -30
  2045. package/src/cmd/build/adapters/nextjs.ts +0 -146
  2046. package/src/cmd/build/adapters/static-server.ts +0 -143
  2047. package/src/cmd/build/adapters/types.ts +0 -93
  2048. package/src/cmd/build/ci.ts +0 -225
  2049. package/src/cmd/build/detect/engine.ts +0 -111
  2050. package/src/cmd/build/detect/frameworks.ts +0 -335
  2051. package/src/cmd/build/detect/generic.ts +0 -71
  2052. package/src/cmd/build/detect/index.ts +0 -122
  2053. package/src/cmd/build/detect/types.ts +0 -109
  2054. package/src/cmd/build/detect/util.ts +0 -104
  2055. package/src/cmd/build/ids.ts +0 -19
  2056. package/src/cmd/build/index.ts +0 -260
  2057. package/src/cmd/build/package/index.ts +0 -66
  2058. package/src/cmd/build/package/launch.ts +0 -104
  2059. package/src/cmd/build/patch/_util.ts +0 -90
  2060. package/src/cmd/build/patch/aisdk.ts +0 -130
  2061. package/src/cmd/build/patch/index.ts +0 -109
  2062. package/src/cmd/build/patch/llm.ts +0 -36
  2063. package/src/cmd/build/patch/otel-llm.ts +0 -421
  2064. package/src/cmd/build/typecheck.ts +0 -141
  2065. package/src/cmd/canary/index.ts +0 -149
  2066. package/src/cmd/cloud/agent/get.ts +0 -119
  2067. package/src/cmd/cloud/agent/index.ts +0 -16
  2068. package/src/cmd/cloud/agent/list.ts +0 -123
  2069. package/src/cmd/cloud/agent/schema.ts +0 -25
  2070. package/src/cmd/cloud/apikey/create.ts +0 -117
  2071. package/src/cmd/cloud/apikey/delete.ts +0 -66
  2072. package/src/cmd/cloud/apikey/get.ts +0 -63
  2073. package/src/cmd/cloud/apikey/index.ts +0 -22
  2074. package/src/cmd/cloud/apikey/list.ts +0 -65
  2075. package/src/cmd/cloud/db/create.ts +0 -109
  2076. package/src/cmd/cloud/db/delete.ts +0 -222
  2077. package/src/cmd/cloud/db/get.ts +0 -225
  2078. package/src/cmd/cloud/db/index.ts +0 -29
  2079. package/src/cmd/cloud/db/list.ts +0 -132
  2080. package/src/cmd/cloud/db/logs.ts +0 -198
  2081. package/src/cmd/cloud/db/sql.ts +0 -84
  2082. package/src/cmd/cloud/db/stats.ts +0 -78
  2083. package/src/cmd/cloud/deploy-fork.ts +0 -430
  2084. package/src/cmd/cloud/deploy.ts +0 -1464
  2085. package/src/cmd/cloud/deployment/index.ts +0 -27
  2086. package/src/cmd/cloud/deployment/list.ts +0 -123
  2087. package/src/cmd/cloud/deployment/logs.ts +0 -84
  2088. package/src/cmd/cloud/deployment/remove.ts +0 -75
  2089. package/src/cmd/cloud/deployment/rollback.ts +0 -92
  2090. package/src/cmd/cloud/deployment/show.ts +0 -203
  2091. package/src/cmd/cloud/deployment/undeploy.ts +0 -56
  2092. package/src/cmd/cloud/deployment/utils.ts +0 -20
  2093. package/src/cmd/cloud/email/create.ts +0 -75
  2094. package/src/cmd/cloud/email/delete.ts +0 -53
  2095. package/src/cmd/cloud/email/destination/delete.ts +0 -69
  2096. package/src/cmd/cloud/email/destination/index.ts +0 -15
  2097. package/src/cmd/cloud/email/destination/list.ts +0 -46
  2098. package/src/cmd/cloud/email/destination/schemas.ts +0 -9
  2099. package/src/cmd/cloud/email/destination/url.ts +0 -76
  2100. package/src/cmd/cloud/email/get.ts +0 -88
  2101. package/src/cmd/cloud/email/inbound/get.ts +0 -53
  2102. package/src/cmd/cloud/email/inbound/index.ts +0 -13
  2103. package/src/cmd/cloud/email/inbound/list.ts +0 -48
  2104. package/src/cmd/cloud/email/inbound/schemas.ts +0 -13
  2105. package/src/cmd/cloud/email/index.ts +0 -31
  2106. package/src/cmd/cloud/email/list.ts +0 -45
  2107. package/src/cmd/cloud/email/outbound/get.ts +0 -55
  2108. package/src/cmd/cloud/email/outbound/index.ts +0 -13
  2109. package/src/cmd/cloud/email/outbound/list.ts +0 -50
  2110. package/src/cmd/cloud/email/outbound/schemas.ts +0 -15
  2111. package/src/cmd/cloud/email/send.ts +0 -85
  2112. package/src/cmd/cloud/email/stats.ts +0 -79
  2113. package/src/cmd/cloud/email/util.ts +0 -68
  2114. package/src/cmd/cloud/env/delete.ts +0 -185
  2115. package/src/cmd/cloud/env/env-diff.ts +0 -180
  2116. package/src/cmd/cloud/env/get.ts +0 -119
  2117. package/src/cmd/cloud/env/import.ts +0 -173
  2118. package/src/cmd/cloud/env/index.ts +0 -40
  2119. package/src/cmd/cloud/env/list.ts +0 -200
  2120. package/src/cmd/cloud/env/org-util.ts +0 -40
  2121. package/src/cmd/cloud/env/pull.ts +0 -197
  2122. package/src/cmd/cloud/env/push.ts +0 -243
  2123. package/src/cmd/cloud/env/set.ts +0 -272
  2124. package/src/cmd/cloud/index.ts +0 -69
  2125. package/src/cmd/cloud/keyvalue/create-namespace.ts +0 -53
  2126. package/src/cmd/cloud/keyvalue/delete-namespace.ts +0 -86
  2127. package/src/cmd/cloud/keyvalue/delete.ts +0 -62
  2128. package/src/cmd/cloud/keyvalue/get.ts +0 -80
  2129. package/src/cmd/cloud/keyvalue/index.ts +0 -40
  2130. package/src/cmd/cloud/keyvalue/keys.ts +0 -62
  2131. package/src/cmd/cloud/keyvalue/list-namespaces.ts +0 -49
  2132. package/src/cmd/cloud/keyvalue/repl.ts +0 -297
  2133. package/src/cmd/cloud/keyvalue/search.ts +0 -87
  2134. package/src/cmd/cloud/keyvalue/set.ts +0 -84
  2135. package/src/cmd/cloud/keyvalue/stats.ts +0 -222
  2136. package/src/cmd/cloud/keyvalue/util.ts +0 -41
  2137. package/src/cmd/cloud/machine/delete.ts +0 -97
  2138. package/src/cmd/cloud/machine/deployments.ts +0 -100
  2139. package/src/cmd/cloud/machine/get.ts +0 -116
  2140. package/src/cmd/cloud/machine/index.ts +0 -22
  2141. package/src/cmd/cloud/machine/list.ts +0 -105
  2142. package/src/cmd/cloud/monitor.ts +0 -375
  2143. package/src/cmd/cloud/oidc/activity.ts +0 -64
  2144. package/src/cmd/cloud/oidc/create.ts +0 -230
  2145. package/src/cmd/cloud/oidc/delete.ts +0 -66
  2146. package/src/cmd/cloud/oidc/get.ts +0 -69
  2147. package/src/cmd/cloud/oidc/index.ts +0 -35
  2148. package/src/cmd/cloud/oidc/list.ts +0 -53
  2149. package/src/cmd/cloud/oidc/rotate-secret.ts +0 -80
  2150. package/src/cmd/cloud/oidc/users.ts +0 -60
  2151. package/src/cmd/cloud/oidc/util.ts +0 -28
  2152. package/src/cmd/cloud/queue/ack.ts +0 -50
  2153. package/src/cmd/cloud/queue/consumers.ts +0 -97
  2154. package/src/cmd/cloud/queue/create.ts +0 -92
  2155. package/src/cmd/cloud/queue/delete.ts +0 -57
  2156. package/src/cmd/cloud/queue/destinations.ts +0 -402
  2157. package/src/cmd/cloud/queue/dlq.ts +0 -209
  2158. package/src/cmd/cloud/queue/get.ts +0 -159
  2159. package/src/cmd/cloud/queue/index.ts +0 -68
  2160. package/src/cmd/cloud/queue/list.ts +0 -99
  2161. package/src/cmd/cloud/queue/messages.ts +0 -160
  2162. package/src/cmd/cloud/queue/nack.ts +0 -50
  2163. package/src/cmd/cloud/queue/pause.ts +0 -41
  2164. package/src/cmd/cloud/queue/publish.ts +0 -94
  2165. package/src/cmd/cloud/queue/receive.ts +0 -84
  2166. package/src/cmd/cloud/queue/resume.ts +0 -40
  2167. package/src/cmd/cloud/queue/sources.ts +0 -352
  2168. package/src/cmd/cloud/queue/stats.ts +0 -297
  2169. package/src/cmd/cloud/queue/util.ts +0 -35
  2170. package/src/cmd/cloud/redis/get.ts +0 -72
  2171. package/src/cmd/cloud/redis/index.ts +0 -13
  2172. package/src/cmd/cloud/region/index.ts +0 -159
  2173. package/src/cmd/cloud/region/list.ts +0 -62
  2174. package/src/cmd/cloud/region-lookup.ts +0 -220
  2175. package/src/cmd/cloud/sandbox/checkpoint/create.ts +0 -86
  2176. package/src/cmd/cloud/sandbox/checkpoint/delete.ts +0 -93
  2177. package/src/cmd/cloud/sandbox/checkpoint/index.ts +0 -33
  2178. package/src/cmd/cloud/sandbox/checkpoint/list.ts +0 -83
  2179. package/src/cmd/cloud/sandbox/checkpoint/restore.ts +0 -72
  2180. package/src/cmd/cloud/sandbox/create.ts +0 -231
  2181. package/src/cmd/cloud/sandbox/delete.ts +0 -82
  2182. package/src/cmd/cloud/sandbox/env.ts +0 -108
  2183. package/src/cmd/cloud/sandbox/events.ts +0 -108
  2184. package/src/cmd/cloud/sandbox/exec.ts +0 -343
  2185. package/src/cmd/cloud/sandbox/execution/get.ts +0 -120
  2186. package/src/cmd/cloud/sandbox/execution/index.ts +0 -25
  2187. package/src/cmd/cloud/sandbox/execution/list.ts +0 -120
  2188. package/src/cmd/cloud/sandbox/fs/cp.ts +0 -646
  2189. package/src/cmd/cloud/sandbox/fs/download.ts +0 -106
  2190. package/src/cmd/cloud/sandbox/fs/index.ts +0 -36
  2191. package/src/cmd/cloud/sandbox/fs/ls.ts +0 -131
  2192. package/src/cmd/cloud/sandbox/fs/mkdir.ts +0 -70
  2193. package/src/cmd/cloud/sandbox/fs/rm.ts +0 -62
  2194. package/src/cmd/cloud/sandbox/fs/rmdir.ts +0 -75
  2195. package/src/cmd/cloud/sandbox/fs/upload.ts +0 -95
  2196. package/src/cmd/cloud/sandbox/get.ts +0 -187
  2197. package/src/cmd/cloud/sandbox/index.ts +0 -62
  2198. package/src/cmd/cloud/sandbox/job/create.ts +0 -63
  2199. package/src/cmd/cloud/sandbox/job/destroy.ts +0 -67
  2200. package/src/cmd/cloud/sandbox/job/get.ts +0 -78
  2201. package/src/cmd/cloud/sandbox/job/index.ts +0 -42
  2202. package/src/cmd/cloud/sandbox/job/list.ts +0 -81
  2203. package/src/cmd/cloud/sandbox/job/logs.ts +0 -140
  2204. package/src/cmd/cloud/sandbox/list.ts +0 -174
  2205. package/src/cmd/cloud/sandbox/pause.ts +0 -60
  2206. package/src/cmd/cloud/sandbox/resume.ts +0 -60
  2207. package/src/cmd/cloud/sandbox/run.ts +0 -282
  2208. package/src/cmd/cloud/sandbox/runtime/index.ts +0 -20
  2209. package/src/cmd/cloud/sandbox/runtime/list.ts +0 -90
  2210. package/src/cmd/cloud/sandbox/snapshot/build.ts +0 -1059
  2211. package/src/cmd/cloud/sandbox/snapshot/create.ts +0 -143
  2212. package/src/cmd/cloud/sandbox/snapshot/delete.ts +0 -80
  2213. package/src/cmd/cloud/sandbox/snapshot/generate.ts +0 -147
  2214. package/src/cmd/cloud/sandbox/snapshot/get.ts +0 -259
  2215. package/src/cmd/cloud/sandbox/snapshot/index.ts +0 -46
  2216. package/src/cmd/cloud/sandbox/snapshot/list.ts +0 -110
  2217. package/src/cmd/cloud/sandbox/snapshot/tag.ts +0 -92
  2218. package/src/cmd/cloud/sandbox/stats.ts +0 -88
  2219. package/src/cmd/cloud/sandbox/util.ts +0 -145
  2220. package/src/cmd/cloud/schedule/create.ts +0 -83
  2221. package/src/cmd/cloud/schedule/delete.ts +0 -45
  2222. package/src/cmd/cloud/schedule/delivery/get.ts +0 -85
  2223. package/src/cmd/cloud/schedule/delivery/index.ts +0 -24
  2224. package/src/cmd/cloud/schedule/delivery/list.ts +0 -83
  2225. package/src/cmd/cloud/schedule/destination/create.ts +0 -123
  2226. package/src/cmd/cloud/schedule/destination/delete.ts +0 -45
  2227. package/src/cmd/cloud/schedule/destination/get.ts +0 -67
  2228. package/src/cmd/cloud/schedule/destination/index.ts +0 -29
  2229. package/src/cmd/cloud/schedule/destination/list.ts +0 -79
  2230. package/src/cmd/cloud/schedule/get.ts +0 -103
  2231. package/src/cmd/cloud/schedule/index.ts +0 -41
  2232. package/src/cmd/cloud/schedule/list.ts +0 -79
  2233. package/src/cmd/cloud/schedule/stats.ts +0 -78
  2234. package/src/cmd/cloud/schedule/update.ts +0 -74
  2235. package/src/cmd/cloud/schedule/util.ts +0 -28
  2236. package/src/cmd/cloud/scp/download.ts +0 -113
  2237. package/src/cmd/cloud/scp/index.ts +0 -21
  2238. package/src/cmd/cloud/scp/upload.ts +0 -114
  2239. package/src/cmd/cloud/services/index.ts +0 -11
  2240. package/src/cmd/cloud/services/stats.ts +0 -205
  2241. package/src/cmd/cloud/session/get.ts +0 -206
  2242. package/src/cmd/cloud/session/index.ts +0 -17
  2243. package/src/cmd/cloud/session/list.ts +0 -191
  2244. package/src/cmd/cloud/session/logs.ts +0 -73
  2245. package/src/cmd/cloud/ssh.ts +0 -114
  2246. package/src/cmd/cloud/storage/config.ts +0 -245
  2247. package/src/cmd/cloud/storage/create.ts +0 -125
  2248. package/src/cmd/cloud/storage/delete.ts +0 -394
  2249. package/src/cmd/cloud/storage/download.ts +0 -197
  2250. package/src/cmd/cloud/storage/get.ts +0 -140
  2251. package/src/cmd/cloud/storage/index.ts +0 -32
  2252. package/src/cmd/cloud/storage/list.ts +0 -309
  2253. package/src/cmd/cloud/storage/upload.ts +0 -210
  2254. package/src/cmd/cloud/storage/utils.ts +0 -26
  2255. package/src/cmd/cloud/stream/create.ts +0 -252
  2256. package/src/cmd/cloud/stream/delete.ts +0 -79
  2257. package/src/cmd/cloud/stream/get.ts +0 -157
  2258. package/src/cmd/cloud/stream/index.ts +0 -35
  2259. package/src/cmd/cloud/stream/list.ts +0 -195
  2260. package/src/cmd/cloud/stream/stats.ts +0 -76
  2261. package/src/cmd/cloud/stream/util.ts +0 -99
  2262. package/src/cmd/cloud/task/attachment.ts +0 -432
  2263. package/src/cmd/cloud/task/close.ts +0 -319
  2264. package/src/cmd/cloud/task/create.ts +0 -280
  2265. package/src/cmd/cloud/task/delete.ts +0 -314
  2266. package/src/cmd/cloud/task/get.ts +0 -229
  2267. package/src/cmd/cloud/task/index.ts +0 -80
  2268. package/src/cmd/cloud/task/list.ts +0 -314
  2269. package/src/cmd/cloud/task/project.ts +0 -227
  2270. package/src/cmd/cloud/task/stats.ts +0 -80
  2271. package/src/cmd/cloud/task/update.ts +0 -125
  2272. package/src/cmd/cloud/task/user.ts +0 -202
  2273. package/src/cmd/cloud/task/util.ts +0 -132
  2274. package/src/cmd/cloud/thread/delete.ts +0 -47
  2275. package/src/cmd/cloud/thread/get.ts +0 -96
  2276. package/src/cmd/cloud/thread/index.ts +0 -18
  2277. package/src/cmd/cloud/thread/list.ts +0 -144
  2278. package/src/cmd/cloud/vector/delete-namespace.ts +0 -90
  2279. package/src/cmd/cloud/vector/delete.ts +0 -117
  2280. package/src/cmd/cloud/vector/get.ts +0 -116
  2281. package/src/cmd/cloud/vector/index.ts +0 -40
  2282. package/src/cmd/cloud/vector/list-namespaces.ts +0 -50
  2283. package/src/cmd/cloud/vector/search.ts +0 -174
  2284. package/src/cmd/cloud/vector/stats.ts +0 -209
  2285. package/src/cmd/cloud/vector/upsert.ts +0 -244
  2286. package/src/cmd/cloud/vector/util.ts +0 -41
  2287. package/src/cmd/cloud/webhook/create.ts +0 -72
  2288. package/src/cmd/cloud/webhook/delete.ts +0 -57
  2289. package/src/cmd/cloud/webhook/deliveries.ts +0 -161
  2290. package/src/cmd/cloud/webhook/destinations.ts +0 -286
  2291. package/src/cmd/cloud/webhook/get.ts +0 -60
  2292. package/src/cmd/cloud/webhook/index.ts +0 -46
  2293. package/src/cmd/cloud/webhook/list.ts +0 -82
  2294. package/src/cmd/cloud/webhook/receipts.ts +0 -170
  2295. package/src/cmd/cloud/webhook/util.ts +0 -35
  2296. package/src/cmd/cloud/workflow/get.ts +0 -58
  2297. package/src/cmd/cloud/workflow/index.ts +0 -22
  2298. package/src/cmd/cloud/workflow/list.ts +0 -84
  2299. package/src/cmd/cloud/workflow/util.ts +0 -28
  2300. package/src/cmd/coder/archive.ts +0 -59
  2301. package/src/cmd/coder/create.ts +0 -291
  2302. package/src/cmd/coder/delete.ts +0 -67
  2303. package/src/cmd/coder/events.ts +0 -106
  2304. package/src/cmd/coder/extension-path.ts +0 -71
  2305. package/src/cmd/coder/get.ts +0 -199
  2306. package/src/cmd/coder/index.ts +0 -81
  2307. package/src/cmd/coder/list.ts +0 -106
  2308. package/src/cmd/coder/loop.ts +0 -85
  2309. package/src/cmd/coder/participants.ts +0 -100
  2310. package/src/cmd/coder/replay.ts +0 -58
  2311. package/src/cmd/coder/resolve-repo.ts +0 -119
  2312. package/src/cmd/coder/skill/buckets.ts +0 -191
  2313. package/src/cmd/coder/skill/delete.ts +0 -67
  2314. package/src/cmd/coder/skill/index.ts +0 -35
  2315. package/src/cmd/coder/skill/list.ts +0 -97
  2316. package/src/cmd/coder/skill/save.ts +0 -84
  2317. package/src/cmd/coder/start.ts +0 -459
  2318. package/src/cmd/coder/tui-init.ts +0 -92
  2319. package/src/cmd/coder/update.ts +0 -145
  2320. package/src/cmd/coder/users.ts +0 -101
  2321. package/src/cmd/coder/workspace/create.ts +0 -173
  2322. package/src/cmd/coder/workspace/delete.ts +0 -70
  2323. package/src/cmd/coder/workspace/get.ts +0 -112
  2324. package/src/cmd/coder/workspace/index.ts +0 -40
  2325. package/src/cmd/coder/workspace/list.ts +0 -101
  2326. package/src/cmd/dev/index.ts +0 -212
  2327. package/src/cmd/git/account/add.ts +0 -179
  2328. package/src/cmd/git/account/index.ts +0 -10
  2329. package/src/cmd/git/account/list.ts +0 -108
  2330. package/src/cmd/git/account/remove.ts +0 -163
  2331. package/src/cmd/git/api.ts +0 -444
  2332. package/src/cmd/git/identity/connect.ts +0 -178
  2333. package/src/cmd/git/identity/disconnect.ts +0 -103
  2334. package/src/cmd/git/identity/index.ts +0 -10
  2335. package/src/cmd/git/identity/status.ts +0 -96
  2336. package/src/cmd/git/index.ts +0 -20
  2337. package/src/cmd/git/link.ts +0 -465
  2338. package/src/cmd/git/list.ts +0 -151
  2339. package/src/cmd/git/status.ts +0 -159
  2340. package/src/cmd/git/unlink.ts +0 -117
  2341. package/src/cmd/help/index.ts +0 -26
  2342. package/src/cmd/index.ts +0 -60
  2343. package/src/cmd/profile/README.md +0 -80
  2344. package/src/cmd/profile/create.ts +0 -113
  2345. package/src/cmd/profile/current.ts +0 -31
  2346. package/src/cmd/profile/delete.ts +0 -78
  2347. package/src/cmd/profile/index.ts +0 -30
  2348. package/src/cmd/profile/list.ts +0 -54
  2349. package/src/cmd/profile/show.ts +0 -81
  2350. package/src/cmd/profile/use.ts +0 -52
  2351. package/src/cmd/project/add/database.ts +0 -196
  2352. package/src/cmd/project/add/domain.ts +0 -187
  2353. package/src/cmd/project/add/index.ts +0 -35
  2354. package/src/cmd/project/add/storage.ts +0 -198
  2355. package/src/cmd/project/create.ts +0 -132
  2356. package/src/cmd/project/delete.ts +0 -188
  2357. package/src/cmd/project/domain/check.ts +0 -153
  2358. package/src/cmd/project/domain/index.ts +0 -20
  2359. package/src/cmd/project/frameworks.ts +0 -219
  2360. package/src/cmd/project/hostname/get.ts +0 -55
  2361. package/src/cmd/project/hostname/index.ts +0 -18
  2362. package/src/cmd/project/hostname/set.ts +0 -123
  2363. package/src/cmd/project/import.ts +0 -170
  2364. package/src/cmd/project/index.ts +0 -44
  2365. package/src/cmd/project/list.ts +0 -55
  2366. package/src/cmd/project/reconcile.ts +0 -755
  2367. package/src/cmd/project/remote-import.ts +0 -1349
  2368. package/src/cmd/project/scaffold.ts +0 -311
  2369. package/src/cmd/project/show.ts +0 -74
  2370. package/src/cmd/project/template-flow.ts +0 -679
  2371. package/src/cmd/project/templates/astro/src/pages/api/translate.ts +0 -22
  2372. package/src/cmd/project/templates/astro/src/pages/index.astro +0 -160
  2373. package/src/cmd/project/templates/hono/src/index.ts +0 -103
  2374. package/src/cmd/project/templates/nextjs/src/app/api/translate/route.ts +0 -19
  2375. package/src/cmd/project/templates/nextjs/src/app/page.tsx +0 -234
  2376. package/src/cmd/project/templates/nuxt/app.vue +0 -191
  2377. package/src/cmd/project/templates/nuxt/server/api/translate.post.ts +0 -18
  2378. package/src/cmd/project/templates/remix/app/routes/api.translate.ts +0 -24
  2379. package/src/cmd/project/templates/remix/app/routes/home.tsx +0 -241
  2380. package/src/cmd/project/templates/sveltekit/src/routes/+page.server.ts +0 -24
  2381. package/src/cmd/project/templates/sveltekit/src/routes/+page.svelte +0 -204
  2382. package/src/cmd/project/templates/vite-react/server.ts +0 -39
  2383. package/src/cmd/project/templates/vite-react/src/App.tsx +0 -241
  2384. package/src/cmd/repl/index.ts +0 -477
  2385. package/src/cmd/setup/index.ts +0 -93
  2386. package/src/cmd/support/index.ts +0 -11
  2387. package/src/cmd/support/logs/index.ts +0 -9
  2388. package/src/cmd/support/logs/path.ts +0 -56
  2389. package/src/cmd/support/logs/show.ts +0 -144
  2390. package/src/cmd/support/report.ts +0 -427
  2391. package/src/cmd/support/system.ts +0 -136
  2392. package/src/cmd/upgrade/index.ts +0 -308
  2393. package/src/cmd/upgrade/npm-availability.test.ts +0 -57
  2394. package/src/cmd/upgrade/npm-availability.ts +0 -261
  2395. package/src/cmd/version/index.ts +0 -42
  2396. package/src/coder-hub-url.ts +0 -32
  2397. package/src/command-prefix.ts +0 -34
  2398. package/src/composite-logger.ts +0 -86
  2399. package/src/config.ts +0 -923
  2400. package/src/crypto/box.ts +0 -529
  2401. package/src/deploy-metadata.ts +0 -253
  2402. package/src/domain.ts +0 -378
  2403. package/src/download.ts +0 -105
  2404. package/src/env-util.ts +0 -466
  2405. package/src/errors.ts +0 -288
  2406. package/src/explain.ts +0 -126
  2407. package/src/git-helper.ts +0 -74
  2408. package/src/index.ts +0 -128
  2409. package/src/internal-logger.ts +0 -599
  2410. package/src/json.ts +0 -28
  2411. package/src/keychain.ts +0 -205
  2412. package/src/log-collector.ts +0 -77
  2413. package/src/onboarding/agentPrompt.ts +0 -260
  2414. package/src/output.ts +0 -359
  2415. package/src/program-ref.ts +0 -11
  2416. package/src/regions.ts +0 -95
  2417. package/src/repl.ts +0 -1523
  2418. package/src/runtime-bootstrap.md +0 -160
  2419. package/src/runtime.ts +0 -36
  2420. package/src/schema-generator.ts +0 -443
  2421. package/src/schema-parser.ts +0 -550
  2422. package/src/sound.ts +0 -30
  2423. package/src/steps.ts +0 -748
  2424. package/src/terminal.ts +0 -151
  2425. package/src/tsc-output-parser.ts +0 -1138
  2426. package/src/tui/box.ts +0 -319
  2427. package/src/tui/colors.ts +0 -112
  2428. package/src/tui/group.ts +0 -56
  2429. package/src/tui/prompt.ts +0 -578
  2430. package/src/tui/symbols.ts +0 -75
  2431. package/src/tui.md +0 -254
  2432. package/src/tui.ts +0 -2266
  2433. package/src/types/md.d.ts +0 -8
  2434. package/src/types.ts +0 -608
  2435. package/src/typescript-errors.ts +0 -422
  2436. package/src/utils/apt-validator.ts +0 -215
  2437. package/src/utils/date.ts +0 -66
  2438. package/src/utils/deps.ts +0 -219
  2439. package/src/utils/format.ts +0 -17
  2440. package/src/utils/git.ts +0 -209
  2441. package/src/utils/installation-type.ts +0 -106
  2442. package/src/utils/jsonc.ts +0 -67
  2443. package/src/utils/normalize-path.ts +0 -12
  2444. package/src/utils/stream-url.ts +0 -226
  2445. package/src/utils/zip.ts +0 -68
  2446. package/src/version-check.ts +0 -329
  2447. package/src/version.ts +0 -57
  2448. /package/{src → dist}/cmd/ai/prompt/api.md +0 -0
  2449. /package/{src → dist}/cmd/ai/prompt/web.md +0 -0
  2450. /package/{src → dist}/cmd/project/templates/nextjs/src/app/globals.css +0 -0
  2451. /package/{src → dist}/cmd/project/templates/vite-react/src/index.css +0 -0
  2452. /package/{src → dist}/cmd/project/templates/vite-react/src/main.tsx +0 -0
  2453. /package/{src → dist}/cmd/project/templates/vite-react/vite.config.ts +0 -0
package/src/cli.ts DELETED
@@ -1,2514 +0,0 @@
1
- import { homedir } from 'node:os';
2
- import { resolve } from 'node:path';
3
- import { Command } from 'commander';
4
- import type {
5
- CommandDefinition,
6
- SubcommandDefinition,
7
- CommandContext,
8
- ProjectConfig,
9
- Config,
10
- Requires,
11
- Optional,
12
- Logger,
13
- AuthData,
14
- GlobalOptions,
15
- } from './types';
16
- import { showBanner, generateBanner } from './banner';
17
- import { getExecutingAgent } from './agent-detection';
18
- import {
19
- requireAuth,
20
- optionalAuth,
21
- requireOrg,
22
- optionalOrg as selectOptionalOrg,
23
- hasPrefixedResourceId,
24
- resolveOrgIdWithoutPrompt,
25
- } from './auth';
26
- import { type RegionList, ValidationOutputError } from '@agentuity/server';
27
- import { fetchRegionsWithCache } from './regions';
28
- import enquirer from 'enquirer';
29
- import * as tui from './tui';
30
- import { parseArgsSchema, parseOptionsSchema, buildValidationInputAsync } from './schema-parser';
31
- import { defaultProfileName, loadProjectConfig, saveProjectId, saveRegion } from './config';
32
- import { APIClient, getAPIBaseURL, getAppBaseURL, type APIClient as APIClientType } from './api';
33
- import { ErrorCode, ExitCode, createError, exitWithError, formatErrorJSON } from './errors';
34
- import { getCommand } from './command-prefix';
35
- import {
36
- getOutputOptions,
37
- isValidateMode,
38
- outputValidation,
39
- type ValidationResult,
40
- } from './output';
41
- import { StructuredError } from '@agentuity/core';
42
- import { setProgram } from './program-ref';
43
- import { generateIntroPrompt } from './cmd/ai/intro';
44
- import {
45
- getCachedProject,
46
- getResourceInfo,
47
- setCachedProject,
48
- type ResourceType,
49
- hasAgentSeenIntro,
50
- markAgentIntroSeen,
51
- } from './cache';
52
-
53
- /**
54
- * Check if an error is a CLI input validation error (Zod error from schema parsing),
55
- * and not an API response validation error (ValidationOutputError).
56
- */
57
- function isCLIValidationError(error: unknown): boolean {
58
- if (!error || typeof error !== 'object' || !('issues' in error)) {
59
- return false;
60
- }
61
- // ValidationOutputError from API responses should NOT be treated as CLI validation errors
62
- if (error instanceof ValidationOutputError) {
63
- return false;
64
- }
65
- // Check for Zod error structure (has name 'ZodError' or is from SchemaValidationError)
66
- return true;
67
- }
68
-
69
- const APIClientConfigError = StructuredError('APIClientConfigError');
70
-
71
- function createAPIClient(baseCtx: CommandContext, config: Config | null): APIClient {
72
- try {
73
- const apiUrl = getAPIBaseURL(config);
74
- const apiClient = new APIClient(apiUrl, baseCtx.logger, config);
75
-
76
- if (!apiClient) {
77
- throw new APIClientConfigError({
78
- message: 'APIClient constructor returned null/undefined',
79
- });
80
- }
81
-
82
- if (typeof apiClient.request !== 'function') {
83
- throw new APIClientConfigError({
84
- message: 'APIClient instance is missing request method',
85
- });
86
- }
87
-
88
- return apiClient;
89
- } catch (error) {
90
- baseCtx.logger.error('Failed to create API client:', error);
91
- throw new APIClientConfigError({
92
- message: `API client initialization failed: ${error instanceof Error ? error.message : 'Unknown error'}`,
93
- cause: error,
94
- });
95
- }
96
- }
97
-
98
- type WebUrlSpec = string | ((ctx: CommandContext) => string | undefined | null);
99
-
100
- function resolveWebUrl(ctx: CommandContext, spec?: WebUrlSpec): string | undefined {
101
- if (!spec) return undefined;
102
-
103
- const raw = typeof spec === 'function' ? spec(ctx) : spec;
104
- if (!raw) return undefined;
105
-
106
- if (raw.startsWith('http://') || raw.startsWith('https://')) {
107
- return raw;
108
- }
109
-
110
- const appBase = getAppBaseURL(ctx.config ?? null).replace(/\/$/, '');
111
- const path = raw.startsWith('/') ? raw : `/${raw}`;
112
- return `${appBase}${path}`;
113
- }
114
-
115
- function maybeRenderWebLink(ctx: CommandContext, spec?: WebUrlSpec): void {
116
- if (ctx.options.json) return;
117
- if (isValidateMode(ctx.options)) return;
118
- if (getExecutingAgent()) return;
119
-
120
- const url = resolveWebUrl(ctx, spec);
121
- if (!url) return;
122
-
123
- if (tui.supportsHyperlinks()) {
124
- tui.output(tui.muted(`→ ${tui.link(url, 'View on the web', '')}`));
125
- } else {
126
- tui.output(tui.muted(`→ View on the web: ${url}`));
127
- }
128
- tui.newline();
129
- }
130
-
131
- /**
132
- * Execute handler or output validation result based on mode
133
- */
134
- async function executeOrValidate(
135
- ctx: CommandContext,
136
- commandName: string,
137
- handler?: (ctx: CommandContext) => unknown | Promise<unknown>,
138
- hasResponseSchema?: boolean,
139
- webUrl?: WebUrlSpec
140
- ): Promise<void> {
141
- if (isValidateMode(ctx.options)) {
142
- // In validate mode, just output success (validation already passed via Zod)
143
- const result: ValidationResult = {
144
- valid: true,
145
- command: commandName,
146
- };
147
- outputValidation(result, ctx.options);
148
- } else if (handler) {
149
- // Normal execution
150
- const result = await handler(ctx);
151
-
152
- // Render "View on the web" link after successful execution (not shown on errors)
153
- maybeRenderWebLink(ctx, webUrl);
154
-
155
- // If --json flag is set
156
- if (ctx.options.json) {
157
- // If command has a response schema but returned nothing, that's an error
158
- if (hasResponseSchema && result === undefined) {
159
- const { createError, exitWithError, ErrorCode } = await import('./errors');
160
- exitWithError(
161
- createError(
162
- ErrorCode.INTERNAL_ERROR,
163
- `Command '${commandName}' declares a response schema but returned no data. This is a bug in the command implementation.`
164
- ),
165
- ctx.logger,
166
- ctx.options.errorFormat
167
- );
168
- }
169
-
170
- // Output the result as JSON if we have data
171
- if (result !== undefined) {
172
- const { outputJSON } = await import('./output');
173
- outputJSON(result);
174
- }
175
- }
176
- }
177
- }
178
-
179
- /**
180
- * Handle validation error - output structured result in validate mode, otherwise log and exit
181
- */
182
- /**
183
- * Format a user-friendly message for a validation issue
184
- */
185
- function formatValidationIssueMessage(
186
- field: string,
187
- message: string,
188
- isArg: boolean = false
189
- ): string {
190
- // Detect "expected X, received undefined" pattern (missing required value)
191
- if (message.includes('received undefined')) {
192
- if (field && field !== 'unknown') {
193
- if (isArg) {
194
- return `Missing required argument: <${field}>`;
195
- }
196
- return `Missing required option: --${field}`;
197
- }
198
- return 'Missing required value';
199
- }
200
-
201
- // Detect "expected X, received Y" pattern (wrong type)
202
- const typeMatch = message.match(/expected (\w+), received (\w+)/i);
203
- if (typeMatch) {
204
- const [, expected, received] = typeMatch;
205
- if (field && field !== 'unknown') {
206
- if (isArg) {
207
- return `Invalid value for <${field}>: expected ${expected}, got ${received}`;
208
- }
209
- return `Invalid value for --${field}: expected ${expected}, got ${received}`;
210
- }
211
- return `Invalid value: expected ${expected}, got ${received}`;
212
- }
213
-
214
- // Default: include the field name if we have it
215
- if (field && field !== 'unknown') {
216
- if (isArg) {
217
- return `<${field}>: ${message}`;
218
- }
219
- return `--${field}: ${message}`;
220
- }
221
- return message;
222
- }
223
-
224
- /**
225
- * Custom error class to wrap ZodErrors with context about whether they are for args or options
226
- */
227
- class SchemaValidationError extends Error {
228
- constructor(
229
- public readonly originalError: unknown,
230
- public readonly isArg: boolean
231
- ) {
232
- super('Schema validation error');
233
- }
234
- }
235
-
236
- /**
237
- * Parse args schema and wrap any ZodError with context
238
- */
239
- function parseArgs<T>(schema: { parse: (input: unknown) => T }, input: unknown): T {
240
- try {
241
- return schema.parse(input);
242
- } catch (error) {
243
- if (error && typeof error === 'object' && 'issues' in error) {
244
- throw new SchemaValidationError(error, true);
245
- }
246
- throw error;
247
- }
248
- }
249
-
250
- /**
251
- * Parse options schema (no wrapping needed, isArg defaults to false)
252
- */
253
- function parseOptions<T>(schema: { parse: (input: unknown) => T }, input: unknown): T {
254
- return schema.parse(input);
255
- }
256
-
257
- function handleValidationError(
258
- error: unknown,
259
- commandName: string,
260
- baseCtx: { options: GlobalOptions; logger: Logger }
261
- ): never {
262
- // Unwrap SchemaValidationError to get context about whether it's an arg or option
263
- let actualError = error;
264
- let isArg = false;
265
- if (error instanceof SchemaValidationError) {
266
- actualError = error.originalError;
267
- isArg = error.isArg;
268
- }
269
-
270
- if (actualError && typeof actualError === 'object' && 'issues' in actualError) {
271
- const issues = (actualError as { issues: Array<{ path: string[]; message: string }> }).issues;
272
-
273
- const formattedIssues = issues.map((issue) => {
274
- const field = issue.path?.length ? issue.path.join('.') : 'unknown';
275
- return {
276
- field,
277
- message: issue.message,
278
- formatted: formatValidationIssueMessage(field, issue.message, isArg),
279
- };
280
- });
281
-
282
- if (isValidateMode(baseCtx.options)) {
283
- // In validate mode, output structured validation result
284
- const result: ValidationResult = {
285
- valid: false,
286
- command: commandName,
287
- errors: formattedIssues.map(({ field, message }) => ({ field, message })),
288
- };
289
- outputValidation(result, baseCtx.options);
290
- process.exit(ExitCode.VALIDATION_ERROR);
291
- } else {
292
- // Build a clear, actionable error message
293
- const errorMessages = formattedIssues.map((i) => i.formatted);
294
- const primaryMessage =
295
- errorMessages.length === 1 && errorMessages[0]
296
- ? errorMessages[0]
297
- : 'Invalid options or arguments';
298
-
299
- const suggestions = [`Run 'agentuity ${commandName} --help' for usage information`];
300
- // Add agent-friendly hints when running from an AI agent
301
- if (getExecutingAgent()) {
302
- suggestions.push(
303
- `Run 'agentuity ${commandName} --describe' to see the command schema as JSON`,
304
- `Use --input '{...}' to pass arguments and options as a JSON object`
305
- );
306
- }
307
- exitWithError(
308
- {
309
- code: ErrorCode.VALIDATION_FAILED,
310
- message: primaryMessage,
311
- details: errorMessages.length > 1 ? { errors: errorMessages } : undefined,
312
- suggestions,
313
- },
314
- baseCtx.logger,
315
- baseCtx.options.errorFormat ?? 'text'
316
- );
317
- }
318
- }
319
- throw error;
320
- }
321
-
322
- type Normalized = {
323
- requiresAuth: boolean;
324
- optionalAuth: false | string;
325
- requiresProject: boolean;
326
- optionalProject: boolean;
327
- requiresAPIClient: boolean;
328
- requiresOrg: boolean;
329
- optionalOrg: boolean;
330
- requiresRegions: boolean;
331
- requiresRegion: boolean;
332
- optionalRegion: boolean;
333
- };
334
-
335
- /**
336
- * Get the full command path for a command (e.g., "cloud sandbox snapshot delete")
337
- * Uses Commander's _getCommandAndAncestors to traverse the command hierarchy.
338
- */
339
- function getFullCommandPath(cmd: Command): string {
340
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
341
- const ancestors = (cmd as any)._getCommandAndAncestors() as Command[];
342
- // ancestors is [current, parent, grandparent, ...root] - reverse and skip root program name
343
- const names = ancestors.map((c) => c.name()).reverse();
344
- // Skip the first entry if it's the root program (usually empty or 'agentuity')
345
- if (names.length > 1 && (names[0] === '' || names[0] === 'agentuity')) {
346
- return names.slice(1).join(' ');
347
- }
348
- return names.join(' ');
349
- }
350
-
351
- function normalizeReqs(def: CommandDefinition | SubcommandDefinition): Normalized {
352
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
353
- const d: any = def as any;
354
- const requires = d.requires as Requires | undefined;
355
- const optional = d.optional as Optional | undefined;
356
-
357
- const requiresAuth = requires?.auth === true;
358
- const optionalAuthValue = optional?.auth;
359
- const optionalAuth: false | string =
360
- optionalAuthValue === true ? 'Continue without authentication' : optionalAuthValue || false;
361
-
362
- const requiresProject = requires?.project === true;
363
- const optionalProject = optional?.project === true;
364
-
365
- const requiresOrg = requires?.org === true;
366
- const optionalOrg = optional?.org === true;
367
- const requiresRegions = requires?.regions === true;
368
- const requiresRegion = requires?.region === true;
369
- const optionalRegion = optional?.region === true;
370
-
371
- // Implicitly require apiClient if org or region is required or optional
372
- const requiresAPIClient =
373
- requires?.apiClient === true ||
374
- requiresOrg ||
375
- optionalOrg ||
376
- requiresRegion ||
377
- optionalRegion ||
378
- requiresRegions;
379
-
380
- return {
381
- requiresAuth,
382
- optionalAuth,
383
- requiresProject,
384
- optionalProject,
385
- requiresAPIClient,
386
- requiresOrg,
387
- optionalOrg,
388
- requiresRegions,
389
- requiresRegion,
390
- optionalRegion,
391
- };
392
- }
393
-
394
- function handleProjectConfigError(
395
- error: unknown,
396
- requiresProject: boolean,
397
- logger: Logger,
398
- errorFormat?: 'json' | 'text'
399
- ): never {
400
- if (
401
- requiresProject &&
402
- error &&
403
- typeof error === 'object' &&
404
- 'name' in error &&
405
- error.name === 'ProjectConfigNotFoundException'
406
- ) {
407
- exitWithError(
408
- createError(ErrorCode.PROJECT_NOT_FOUND, 'Invalid project folder', undefined, [
409
- 'Use --dir to specify a different directory',
410
- 'Change to a directory containing agentuity.json',
411
- `Run "${getCommand('project create')}" to create a new project`,
412
- ]),
413
- logger,
414
- errorFormat ?? 'text'
415
- );
416
- }
417
- throw error;
418
- }
419
-
420
- /**
421
- * Prompt user to select a project from their available projects
422
- */
423
- async function promptProjectSelection(baseCtx: CommandContext): Promise<ProjectConfig | null> {
424
- const { config } = baseCtx;
425
-
426
- // Need auth and API client to fetch projects
427
- const auth = await requireAuth(baseCtx);
428
- if (!auth) {
429
- return null;
430
- }
431
-
432
- const apiClient = createAPIClient(baseCtx, config);
433
-
434
- // Fetch available projects
435
- const { projectList } = await import('@agentuity/server');
436
- const projects = await projectList(apiClient);
437
-
438
- if (!projects || projects.length === 0) {
439
- tui.warning('No projects found. Please create a project first.');
440
- return null;
441
- }
442
-
443
- // Sort projects: prioritize those matching orgId in preferences
444
- const preferredOrgId = config?.preferences?.orgId;
445
- const sortedProjects = [...projects].sort((a, b) => {
446
- // Prioritize preferred org
447
- if (preferredOrgId) {
448
- if (a.orgId === preferredOrgId && b.orgId !== preferredOrgId) return -1;
449
- if (b.orgId === preferredOrgId && a.orgId !== preferredOrgId) return 1;
450
- }
451
- // Otherwise sort by name
452
- return a.name.localeCompare(b.name);
453
- });
454
-
455
- // Build select options with aligned formatting
456
- const { createPrompt } = tui;
457
- const prompt = createPrompt();
458
-
459
- // Calculate max name length for padding (with reasonable max)
460
- const maxNameLength = Math.min(40, Math.max(...sortedProjects.map((p) => p.name.length)));
461
-
462
- const selectedProjectId = await prompt.select<string>({
463
- message: 'Select a project',
464
- options: sortedProjects.map((p) => {
465
- // Truncate and pad name for alignment
466
- const displayName =
467
- p.name.length > maxNameLength
468
- ? p.name.substring(0, maxNameLength - 1) + '…'
469
- : p.name.padEnd(maxNameLength);
470
-
471
- return {
472
- value: p.id,
473
- label: `${displayName} ${tui.muted(p.id)}`,
474
- };
475
- }),
476
- });
477
-
478
- // Cleanup stdin after prompt to prevent hanging
479
- if (process.stdin.isTTY) {
480
- process.stdin.pause();
481
- }
482
-
483
- const selectedProject = sortedProjects.find((p) => p.id === selectedProjectId);
484
- if (!selectedProject) {
485
- return null;
486
- }
487
-
488
- if (selectedProject.id !== config?.preferences?.projectId) {
489
- await saveProjectId(selectedProject.id);
490
- }
491
-
492
- // Convert to ProjectConfig format
493
- return {
494
- projectId: selectedProject.id,
495
- orgId: selectedProject.orgId,
496
- region: selectedProject.cloudRegion || '',
497
- };
498
- }
499
-
500
- export async function createCLI(version: string): Promise<Command> {
501
- const program = new Command();
502
- setProgram(program);
503
-
504
- program
505
- .name('agentuity')
506
- .version(version, '-v, --version', 'Display version')
507
- .helpOption('-h, --help [json]', 'Display help (with optional JSON output)')
508
- .allowUnknownOption(false)
509
- .allowExcessArguments(false)
510
- .showHelpAfterError(true);
511
-
512
- program
513
- .option('--config <path>', 'Config file path')
514
- .option('--log-level <level>', 'Log level', process.env.AGENTUITY_LOG_LEVEL ?? 'info')
515
- .option('--log-timestamp', 'Show timestamps in log output', false)
516
- .option('--no-log-prefix', 'Hide log level prefixes', true)
517
- .option(
518
- '--org-id <id>',
519
- 'Use a specific organization when performing operations',
520
- process.env.AGENTUITY_CLOUD_ORG_ID
521
- )
522
- .option(
523
- '--project-id <id>',
524
- 'Use a specific project when performing operations (AGENTUITY_CLOUD_PROJECT_ID)',
525
- process.env.AGENTUITY_CLOUD_PROJECT_ID
526
- )
527
- .option('--color-scheme <scheme>', 'Color scheme: light or dark')
528
- .option('--color <mode>', 'Color output: auto, always, never', 'auto')
529
- .option('--error-format <format>', 'Error output format: json or text', 'text')
530
- .option('--json', 'Output in JSON format (machine-readable)', false)
531
- .option('--quiet', 'Suppress non-essential output', false)
532
- .option('--no-progress', 'Disable progress indicators', false)
533
- .option('--explain', 'Show what the command would do without executing', false)
534
- .option('--dry-run', 'Execute command without making changes', false)
535
- .option('--validate', 'Validate arguments and options without executing', false)
536
- .option('--ai-help', 'Show AI-optimized help in dashdash format', false)
537
- .option('--input <json>', 'Pass arguments and options as a JSON object (for agents)')
538
- .option('--describe', 'Output command schema as JSON for agent introspection', false)
539
- .option(
540
- '--fields <fields>',
541
- 'Filter JSON output to specified fields (comma-separated, dot notation for nested)'
542
- );
543
-
544
- // Note: We intentionally do NOT add a global --org alias for --org-id because
545
- // some subcommands (like env commands) define their own --org option with
546
- // different semantics (boolean for "use org scope" vs string for specific org ID).
547
- // Adding a global --org would shadow the subcommand's --org option.
548
-
549
- const skipVersionCheckOption = program.createOption(
550
- '--skip-version-check',
551
- 'Skip version compatibility check (dev only)'
552
- );
553
- skipVersionCheckOption.hideHelp();
554
- program.addOption(skipVersionCheckOption);
555
-
556
- const profileOption = program.createOption(
557
- '--profile <name>',
558
- 'Override the default profile (takes precedence over AGENTUITY_PROFILE env var)'
559
- );
560
- profileOption.hideHelp();
561
- program.addOption(profileOption);
562
-
563
- program.action(() => {
564
- program.help();
565
- });
566
-
567
- // Handle unknown commands
568
- program.on('command:*', (operands: string[]) => {
569
- const unknownCommand = operands[0];
570
- const opts = getOutputOptions();
571
- if (opts?.json || opts?.errorFormat === 'json') {
572
- console.error(
573
- formatErrorJSON(
574
- createError(ErrorCode.UNKNOWN_COMMAND, `unknown command '${unknownCommand}'`)
575
- )
576
- );
577
- process.exit(1);
578
- return;
579
- }
580
- console.error(`error: unknown command '${unknownCommand}'`);
581
- console.error();
582
- const availableCommands = program.commands.map((cmd) => cmd.name());
583
- if (availableCommands.length > 0) {
584
- console.error('Available commands:');
585
- availableCommands.forEach((name) => {
586
- console.error(` ${name}`);
587
- });
588
- }
589
- console.error();
590
- console.error(`Run '${getCommand('--help')}' for usage information.`);
591
- process.exit(1);
592
- });
593
-
594
- // Track whether a JSON error was already emitted by outputError
595
- // so we can suppress Commander's help-after-error text in JSON mode
596
- let jsonErrorEmitted = false;
597
-
598
- // Custom error handling for argument/command parsing errors
599
- program.configureOutput({
600
- writeErr: (str) => {
601
- // In JSON mode, suppress Commander's help-after-error text
602
- // (we already emitted a structured JSON error in outputError)
603
- const opts = getOutputOptions();
604
- if (jsonErrorEmitted && (opts?.json || opts?.errorFormat === 'json')) {
605
- return;
606
- }
607
- process.stderr.write(str);
608
- },
609
- outputError: (str, write) => {
610
- // Suppress "unknown option '--help'" error since we handle help flags specially
611
- if (str.includes("unknown option '--help'")) {
612
- return;
613
- }
614
- // In JSON mode, output structured JSON errors for all Commander parsing errors
615
- const opts = getOutputOptions();
616
- if (opts?.json || opts?.errorFormat === 'json') {
617
- // Strip "error: " prefix and trailing newline for clean message
618
- let message = str.replace(/^error:\s*/, '').replace(/\n$/, '');
619
- let code = ErrorCode.INVALID_OPTION;
620
- if (str.includes('unknown command') || str.includes('too many arguments')) {
621
- code = ErrorCode.UNKNOWN_COMMAND;
622
- } else if (str.includes('missing required argument')) {
623
- code = ErrorCode.MISSING_ARGUMENT;
624
- }
625
- // Extract Commander's "Did you mean" suggestion into a separate field
626
- let suggestions: string[] | undefined;
627
- const suggestionMatch = message.match(/\n\(Did you mean (.+)\?\)/);
628
- if (suggestionMatch?.[1] != null) {
629
- suggestions = [suggestionMatch[1] as string];
630
- message = message.replace(/\n\(Did you mean .+\?\)/, '');
631
- }
632
- // Write directly to stderr (not via write/writeErr) to avoid
633
- // self-suppression — writeErr suppresses output when jsonErrorEmitted is true
634
- jsonErrorEmitted = true;
635
- process.stderr.write(
636
- formatErrorJSON(createError(code, message, undefined, suggestions)) + '\n'
637
- );
638
- return;
639
- }
640
- // Intercept commander.js error messages
641
- if (str.includes('too many arguments') || str.includes('unknown command')) {
642
- // Extract potential command name from error context
643
- const match = str.match(/got (\d+)/);
644
- if (match) {
645
- write(`${tui.colorError('error: unknown command or subcommand')}\n`);
646
- write(tui.warn(`\nRun '${getCommand('--help')}' for available commands.\n`));
647
- } else {
648
- write(str);
649
- }
650
- } else if (str.startsWith('error:')) {
651
- // Colorize all error: lines in red
652
- write(tui.colorError(str));
653
- } else {
654
- write(str);
655
- }
656
- },
657
- });
658
-
659
- // Configure help to show only main command names, not aliases
660
- program.configureHelp({
661
- subcommandTerm: (cmd) => cmd.name(),
662
- formatHelp: (cmd, helper) => {
663
- // Check if JSON help was requested via --help=json (converted to --help json)
664
- const args = process.argv.slice(2);
665
- const helpIndex = args.findIndex((a) => a === '--help' || a === '-h');
666
- const wantsJson = helpIndex !== -1 && args[helpIndex + 1] === 'json';
667
-
668
- if (wantsJson) {
669
- // Generate JSON help for this specific command
670
- const commands = helper.visibleCommands(cmd);
671
-
672
- // Extract examples if available
673
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
674
- const cmdAny = cmd as any;
675
- const examples = cmdAny._examples || [];
676
-
677
- const cmdHelp = {
678
- name: cmd.name(),
679
- description: cmd.description(),
680
- usage: cmd.usage(),
681
- commands: commands.map((c) => ({
682
- name: c.name(),
683
- aliases: c.aliases(),
684
- description: c.description(),
685
- })),
686
- arguments: helper.visibleArguments(cmd).map((arg) => ({
687
- term: helper.argumentTerm(arg),
688
- description: helper.argumentDescription(arg),
689
- })),
690
- options: helper.visibleOptions(cmd).map((opt) => ({
691
- flags: helper.optionTerm(opt),
692
- description: helper.optionDescription(opt),
693
- })),
694
- globalOptions: helper.visibleGlobalOptions(cmd).map((opt) => ({
695
- flags: helper.optionTerm(opt),
696
- description: helper.optionDescription(opt),
697
- })),
698
- ...(examples.length > 0 && { examples }),
699
- };
700
- return JSON.stringify(cmdHelp, null, 2);
701
- }
702
-
703
- const termWidth = helper.padWidth(cmd, helper);
704
- const itemIndentWidth = 2;
705
- const itemSeparatorWidth = 2;
706
-
707
- function formatItem(term: string, description: string) {
708
- if (description) {
709
- return `${' '.repeat(itemIndentWidth)}${tui.colorInfo(
710
- term.padEnd(termWidth + itemSeparatorWidth)
711
- )}${tui.colorMuted(description)}`;
712
- }
713
- return term;
714
- }
715
-
716
- // Format each section (show banner for root command)
717
- let output = '';
718
-
719
- // Show intro for first-time agents (before normal help output)
720
- // AGENTUITY_SHOW_INTRO=1 forces showing the intro (useful for testing)
721
- const agent = getExecutingAgent();
722
- const forceShowIntro = process.env.AGENTUITY_SHOW_INTRO === '1';
723
- const hasSeenIntro = agent ? hasAgentSeenIntro(agent) : true;
724
-
725
- if (agent && (forceShowIntro || !hasSeenIntro)) {
726
- // Only mark as seen if this is their first time (not on forced re-shows)
727
- if (!hasSeenIntro) {
728
- markAgentIntroSeen(agent);
729
- }
730
-
731
- const separator = '='.repeat(79);
732
- output += `${separator}\n\n`;
733
- output += generateIntroPrompt(agent);
734
- output += `\n${separator}\n\n`;
735
- }
736
-
737
- // Show banner (full for root, compact for subcommands)
738
- // Skip banner when running from an AI coding agent
739
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
740
- const isRootCommand = !(cmd as any).parent;
741
- if (!agent) {
742
- if (isRootCommand) {
743
- output += `${generateBanner(version)}\n\n`;
744
- } else {
745
- output += `${generateBanner(version, true)}\n`;
746
- }
747
- }
748
-
749
- // Description
750
- const description = helper.commandDescription(cmd);
751
- if (description) {
752
- output += `${tui.colorInfo(description)}\n`;
753
- }
754
-
755
- // Usage
756
- const usage = helper.commandUsage(cmd);
757
- if (usage) {
758
- output += `\n${tui.colorPrimary('\x1b[4mUsage\x1b[24m')}\n ${tui.bold(tui.colorPrimary(usage))}\n`;
759
- }
760
-
761
- // Arguments
762
- const argumentList = helper.visibleArguments(cmd).map((argument) => {
763
- return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
764
- });
765
- if (argumentList.length > 0) {
766
- output += `\n${tui.colorPrimary('\x1b[4mArguments\x1b[24m')}\n${argumentList.join('\n')}\n`;
767
- }
768
-
769
- // Options
770
- const optionList = helper.visibleOptions(cmd).map((option) => {
771
- return formatItem(helper.optionTerm(option), helper.optionDescription(option));
772
- });
773
- if (optionList.length > 0) {
774
- output += `\n${tui.colorPrimary('\x1b[4mOptions\x1b[24m')}\n${optionList.join('\n')}\n`;
775
- }
776
-
777
- // Global options
778
- const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
779
- return formatItem(helper.optionTerm(option), helper.optionDescription(option));
780
- });
781
- if (globalOptionList.length > 0) {
782
- output += `\n${tui.colorPrimary('\x1b[4mGlobal Options\x1b[24m')}\n${globalOptionList.join('\n')}\n`;
783
- }
784
-
785
- // Commands
786
- const commandList = helper.visibleCommands(cmd).map((cmd) => {
787
- return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));
788
- });
789
- if (commandList.length > 0) {
790
- output += `\n${tui.colorPrimary('\x1b[4mCommands\x1b[24m')}\n${commandList.join('\n')}\n`;
791
- }
792
-
793
- return output;
794
- },
795
- });
796
-
797
- return program;
798
- }
799
-
800
- async function getRegion(regions: RegionList, preferredRegion?: string): Promise<string> {
801
- const firstRegion = regions[0];
802
- if (regions.length === 1 && firstRegion) {
803
- return firstRegion.region;
804
- } else {
805
- const preferredIndex = preferredRegion
806
- ? regions.findIndex((region) => region.region === preferredRegion)
807
- : -1;
808
- const response = await enquirer.prompt<{ region: string }>({
809
- type: 'select',
810
- name: 'region',
811
- message: 'Select a cloud region:',
812
- ...(preferredIndex >= 0 && { initial: preferredIndex }),
813
- choices: regions.map((r) => ({
814
- name: r.region,
815
- message: `${r.description.padEnd(15, ' ')} ${tui.muted(r.region)}`,
816
- })),
817
- });
818
- return response.region;
819
- }
820
- }
821
-
822
- const RESOURCE_PREFIXES: Array<{ prefix: string; type: ResourceType }> = [
823
- { prefix: 'sbx_', type: 'sandbox' },
824
- { prefix: 'proj_', type: 'project' },
825
- { prefix: 'db_', type: 'db' },
826
- { prefix: 'deploy_', type: 'deployment' },
827
- { prefix: 'machine_', type: 'machine' },
828
- { prefix: 'que_', type: 'queue' },
829
- { prefix: 'vec_', type: 'vector' },
830
- { prefix: 'kv_', type: 'kv' },
831
- { prefix: 'stream_', type: 'stream' },
832
- ];
833
-
834
- type PrefixedResource = { id: string; type: ResourceType };
835
-
836
- function getResourceTypeFromId(id: string): ResourceType | undefined {
837
- for (const entry of RESOURCE_PREFIXES) {
838
- if (id.startsWith(entry.prefix)) {
839
- return entry.type;
840
- }
841
- }
842
- return undefined;
843
- }
844
-
845
- function collectPrefixedResources(
846
- values?: Record<string, unknown> | unknown[]
847
- ): PrefixedResource[] {
848
- if (!values) {
849
- return [];
850
- }
851
- const results = new Map<string, ResourceType>();
852
- const addValue = (value: unknown) => {
853
- if (typeof value === 'string') {
854
- const resourceType = getResourceTypeFromId(value);
855
- if (resourceType) {
856
- results.set(value, resourceType);
857
- }
858
- return;
859
- }
860
- if (Array.isArray(value)) {
861
- for (const entry of value) {
862
- addValue(entry);
863
- }
864
- }
865
- };
866
-
867
- if (Array.isArray(values)) {
868
- for (const entry of values) {
869
- addValue(entry);
870
- }
871
- } else {
872
- for (const value of Object.values(values)) {
873
- addValue(value);
874
- }
875
- }
876
-
877
- return Array.from(results.entries()).map(([id, type]) => ({ id, type }));
878
- }
879
-
880
- export interface ResolveRegionOptions {
881
- options: Record<string, unknown>;
882
- regions: RegionList;
883
- logger: Logger;
884
- required: boolean;
885
- region?: string;
886
- config?: Config | null;
887
- args?: Record<string, unknown> | unknown[];
888
- }
889
-
890
- export async function resolveRegion(opts: ResolveRegionOptions): Promise<string | undefined> {
891
- const { options, regions, logger, required, config, args } = opts;
892
-
893
- // No regions available
894
- if (regions.length === 0) {
895
- if (required) {
896
- const errorFormat = (options as Record<string, unknown>).errorFormat as
897
- | 'json'
898
- | 'text'
899
- | undefined;
900
- exitWithError(
901
- createError(ErrorCode.NO_REGIONS_AVAILABLE, 'No cloud regions available', undefined, [
902
- 'Contact support if you need access to cloud regions',
903
- ]),
904
- logger,
905
- errorFormat ?? 'text'
906
- );
907
- }
908
- return undefined;
909
- }
910
-
911
- // Check if region was provided via flag
912
- let region = options.region as string | undefined;
913
-
914
- // Validate --region flag if provided
915
- if (region) {
916
- const found = regions.find((r) => r.region === region);
917
- if (!found) {
918
- const errorFormat = (options as Record<string, unknown>).errorFormat as
919
- | 'json'
920
- | 'text'
921
- | undefined;
922
- exitWithError(
923
- createError(
924
- ErrorCode.REGION_NOT_FOUND,
925
- `Invalid region '${region}'`,
926
- { region, availableRegions: regions.map((r) => r.region) },
927
- [`Use one of: ${regions.map((r) => r.region).join(', ')}`]
928
- ),
929
- logger,
930
- errorFormat ?? 'text'
931
- );
932
- }
933
- return region;
934
- }
935
-
936
- const profileName = config?.name ?? defaultProfileName;
937
- const candidateResources = new Map<string, ResourceType>();
938
- for (const resource of collectPrefixedResources(args)) {
939
- candidateResources.set(resource.id, resource.type);
940
- }
941
- for (const resource of collectPrefixedResources(options)) {
942
- candidateResources.set(resource.id, resource.type);
943
- }
944
- for (const [id, type] of candidateResources.entries()) {
945
- const cachedInfo = await getResourceInfo(type, profileName, id);
946
- if (cachedInfo?.region) {
947
- logger.trace('resolved region from cache for %s (%s): %s', id, type, cachedInfo.region);
948
- return cachedInfo.region;
949
- }
950
- }
951
-
952
- // Auto-select if only one region available
953
- const singleRegion = regions[0];
954
- if (regions.length === 1 && singleRegion) {
955
- region = singleRegion.region;
956
- if (!process.stdin.isTTY) {
957
- logger.trace('auto-selected region (non-TTY): %s', region);
958
- }
959
- return region;
960
- }
961
-
962
- // Check for AGENTUITY_REGION environment variable
963
- const envRegion = process.env.AGENTUITY_REGION;
964
- if (envRegion) {
965
- // Validate that the env region is in the available regions
966
- const matchingRegion = regions.find((r) => r.region === envRegion);
967
- if (matchingRegion) {
968
- return matchingRegion.region;
969
- }
970
- // If not valid, fall through to error/prompt
971
- }
972
-
973
- // Check for preferred region in config
974
- const preferredRegion = config?.preferences?.region;
975
- if (preferredRegion) {
976
- const matchingRegion = regions.find((r) => r.region === preferredRegion);
977
- if (matchingRegion) {
978
- if (process.stdin.isTTY) {
979
- region = await getRegion(regions, matchingRegion.region);
980
- return region;
981
- }
982
- logger.trace('selected preferred region (non-TTY): %s', matchingRegion.region);
983
- return matchingRegion.region;
984
- }
985
- }
986
-
987
- // Check for project region fallback
988
- const projectRegion = opts.region;
989
- if (projectRegion) {
990
- const matchingRegion = regions.find((r) => r.region === projectRegion);
991
- if (matchingRegion) {
992
- return matchingRegion.region;
993
- }
994
- }
995
-
996
- // No flag provided - handle TTY vs non-TTY
997
- if (required && !process.stdin.isTTY) {
998
- const errorFormat = (options as Record<string, unknown>).errorFormat as
999
- | 'json'
1000
- | 'text'
1001
- | undefined;
1002
- exitWithError(
1003
- createError(
1004
- ErrorCode.REGION_REQUIRED,
1005
- '--region flag is required in non-interactive mode',
1006
- { availableRegions: regions.map((r) => r.region) },
1007
- [
1008
- `Use --region with one of: ${regions.map((r) => r.region).join(', ')}`,
1009
- `Or set AGENTUITY_REGION environment variable`,
1010
- ]
1011
- ),
1012
- logger,
1013
- errorFormat ?? 'text'
1014
- );
1015
- }
1016
-
1017
- if (process.stdin.isTTY) {
1018
- // Interactive mode - prompt user
1019
- region = await getRegion(regions);
1020
-
1021
- const hasSavedPreference = !!config?.preferences?.region;
1022
- const hasEnvRegion = !!process.env.AGENTUITY_REGION;
1023
- const hasTTY = process.stdin.isTTY && process.stdout.isTTY;
1024
- if (region && hasTTY && !hasSavedPreference && !hasEnvRegion) {
1025
- const selectedRegionInfo = regions.find((r) => r.region === region);
1026
- const regionLabel = selectedRegionInfo
1027
- ? `${selectedRegionInfo.description} (${selectedRegionInfo.region})`
1028
- : region;
1029
- const shouldSave = await tui.confirm(
1030
- `Would you like to set "${regionLabel}" as your default region?`,
1031
- true
1032
- );
1033
- if (shouldSave) {
1034
- await saveRegion(region);
1035
- }
1036
- }
1037
-
1038
- return region;
1039
- }
1040
-
1041
- // Non-interactive, optional region - return undefined
1042
- return undefined;
1043
- }
1044
-
1045
- async function registerSubcommand(
1046
- parent: Command,
1047
- subcommand: SubcommandDefinition,
1048
- baseCtx: CommandContext,
1049
- hidden?: boolean
1050
- ): Promise<void> {
1051
- const cmd = parent.command(subcommand.name, { hidden }).description(subcommand.description);
1052
-
1053
- // Allow pass-through args for commands that need to forward unknown options
1054
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1055
- if ((subcommand as any).passThroughArgs) {
1056
- cmd.allowUnknownOption();
1057
- cmd.allowExcessArguments();
1058
- // Disable help option so --help passes through to the target command
1059
- cmd.helpOption(false);
1060
- } else {
1061
- cmd.helpOption('-h, --help [json]', 'Display help (with optional JSON output)');
1062
- }
1063
-
1064
- if (subcommand.aliases) {
1065
- cmd.aliases(subcommand.aliases);
1066
- }
1067
-
1068
- // Add examples to help text (skip in JSON mode)
1069
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1070
- const examples = (subcommand as any).examples as
1071
- | Array<{ command: string; description: string }>
1072
- | undefined;
1073
- if (examples && examples.length > 0) {
1074
- // Store examples for JSON help generation
1075
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1076
- (cmd as any)._examples = examples;
1077
-
1078
- // Add formatted examples to text help
1079
- cmd.addHelpText('after', () => {
1080
- // Skip examples in JSON mode
1081
- const args = process.argv.slice(2);
1082
- const helpIndex = args.findIndex((a) => a === '--help' || a === '-h');
1083
- if (helpIndex !== -1 && args[helpIndex + 1] === 'json') {
1084
- return '';
1085
- }
1086
-
1087
- const maxLength = Math.max(...examples.map((ex) => ex.command.length));
1088
- const formatted = examples.map((ex) => {
1089
- const padding = ' '.repeat(maxLength - ex.command.length + 1);
1090
- return ` ${tui.colorPrimary(ex.command)}${padding}${tui.muted('#')} ${tui.muted(ex.description)}`;
1091
- });
1092
- return `\n${tui.colorPrimary('\x1b[4mExamples:\x1b[24m')}\n` + formatted.join('\n');
1093
- });
1094
- }
1095
-
1096
- // Check if this subcommand has its own subcommands (nested subcommands)
1097
- const subDef = subcommand as unknown as { subcommands?: SubcommandDefinition[] };
1098
- if (subDef.subcommands && subDef.subcommands.length > 0) {
1099
- // Register nested subcommands recursively
1100
- for (const nestedSub of subDef.subcommands) {
1101
- await registerSubcommand(cmd, nestedSub, baseCtx);
1102
- }
1103
-
1104
- // Add a virtual 'help' subcommand
1105
- cmd.command('help', { hidden: true })
1106
- .description('Display help')
1107
- .action(() => {
1108
- cmd.help();
1109
- });
1110
-
1111
- // Handle --describe for command-group nodes
1112
- cmd.action(async () => {
1113
- if (baseCtx.options.describe) {
1114
- const { extractSubcommandSchema } = await import('./schema-generator');
1115
- const schema = extractSubcommandSchema(subcommand);
1116
- const { outputJSON } = await import('./output');
1117
- outputJSON(schema);
1118
- return;
1119
- }
1120
- cmd.help();
1121
- });
1122
-
1123
- // Don't add options to parent commands - only to leaf commands
1124
- return;
1125
- }
1126
-
1127
- const {
1128
- requiresProject,
1129
- optionalProject,
1130
- requiresOrg,
1131
- optionalOrg,
1132
- requiresRegion,
1133
- optionalRegion,
1134
- } = normalizeReqs(subcommand);
1135
-
1136
- if (requiresProject || optionalProject) {
1137
- cmd.option('--dir <path>', 'project directory (default: current directory)');
1138
- }
1139
-
1140
- // Note: --org-id may also be added below if the schema defines orgId;
1141
- // in that case we skip adding it here to avoid conflicts.
1142
- const _deferOrgIdFlag = requiresOrg || optionalOrg;
1143
-
1144
- if (requiresRegion || optionalRegion) {
1145
- cmd.option('--region <region>', 'cloud region');
1146
- }
1147
-
1148
- if (subcommand.schema?.args) {
1149
- const parsed = parseArgsSchema(subcommand.schema.args);
1150
- for (const argMeta of parsed.metadata) {
1151
- let argSyntax: string;
1152
- if (argMeta.variadic) {
1153
- argSyntax = argMeta.optional ? `[${argMeta.name}...]` : `<${argMeta.name}...>`;
1154
- } else {
1155
- argSyntax = argMeta.optional ? `[${argMeta.name}]` : `<${argMeta.name}>`;
1156
- }
1157
- cmd.argument(argSyntax);
1158
- }
1159
- }
1160
-
1161
- // Track if projectId/orgId is defined in schema options
1162
- let hasProjectIdInSchema = false;
1163
- let hasOrgIdInSchema = false;
1164
-
1165
- if (subcommand.schema?.options) {
1166
- const parsed = parseOptionsSchema(subcommand.schema.options);
1167
- const aliases = subcommand.schema.aliases ?? {};
1168
- for (const opt of parsed) {
1169
- const flag = opt.name
1170
- .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
1171
- .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
1172
- .toLowerCase();
1173
-
1174
- // Track if this schema defines projectId (as 'projectId' or 'project-id')
1175
- if (opt.name === 'projectId' || opt.name === 'project-id' || flag === 'project-id') {
1176
- hasProjectIdInSchema = true;
1177
- }
1178
-
1179
- // Track if this schema defines orgId (as 'orgId' or 'org-id')
1180
- if (opt.name === 'orgId' || opt.name === 'org-id' || flag === 'org-id') {
1181
- hasOrgIdInSchema = true;
1182
- }
1183
-
1184
- const desc = opt.description || '';
1185
- // Build flag spec with aliases (check both camelCase and kebab-case names)
1186
- // Auto-add -y alias for confirm flag
1187
- let optAliases = aliases[opt.name] ?? aliases[flag] ?? [];
1188
- if (flag === 'confirm' && !optAliases.includes('y')) {
1189
- optAliases = ['y', ...optAliases];
1190
- }
1191
- let flagSpec = `--${flag}`;
1192
- if (flag === 'verbose') {
1193
- flagSpec = `-v, --${flag}`;
1194
- } else if (flag === 'confirm') {
1195
- // Add -y short alias for --confirm
1196
- flagSpec = `-y, --${flag}`;
1197
- } else if (optAliases.length > 0) {
1198
- const aliasFlags = optAliases
1199
- .map((a) => (a.length === 1 ? `-${a}` : `--${a}`))
1200
- .join(', ');
1201
- flagSpec = `${aliasFlags}, --${flag}`;
1202
- }
1203
- if (opt.type === 'boolean') {
1204
- if (opt.hasDefault) {
1205
- const defaultValue =
1206
- typeof opt.defaultValue === 'function' ? opt.defaultValue() : opt.defaultValue;
1207
- // Register both positive and negative forms so both work,
1208
- // but only show one in help based on the default value
1209
- const baseDesc = desc.replace(/\s*\(use\s+--no-\S+\s+to\s+skip\)/i, '').trim();
1210
- const negatedDesc = baseDesc.toLowerCase().startsWith('run ')
1211
- ? `Skip ${baseDesc.slice(4)}`
1212
- : `Do not ${baseDesc.charAt(0).toLowerCase()}${baseDesc.slice(1)}`;
1213
-
1214
- if (defaultValue === true) {
1215
- // Show --no-* in help, hide positive flag
1216
- cmd.option(`--no-${flag}`, negatedDesc);
1217
- const positiveOption = cmd.createOption(flagSpec, baseDesc);
1218
- positiveOption.default(defaultValue);
1219
- positiveOption.hideHelp();
1220
- cmd.addOption(positiveOption);
1221
- } else {
1222
- // Show positive flag in help, but also register --no-* hidden
1223
- cmd.option(flagSpec, desc);
1224
- const negativeOption = cmd.createOption(`--no-${flag}`, negatedDesc);
1225
- negativeOption.hideHelp();
1226
- cmd.addOption(negativeOption);
1227
- }
1228
- } else {
1229
- cmd.option(flagSpec, desc);
1230
- }
1231
- } else if (opt.type === 'number') {
1232
- const numDefault = opt.hasDefault
1233
- ? typeof opt.defaultValue === 'function'
1234
- ? opt.defaultValue()
1235
- : opt.defaultValue
1236
- : undefined;
1237
- const numDesc =
1238
- opt.hasDefault && numDefault !== undefined
1239
- ? `${desc} (default: ${numDefault})`
1240
- : desc;
1241
- cmd.option(`${flagSpec} <${opt.name}>`, numDesc, parseFloat);
1242
- } else if (opt.type === 'array') {
1243
- const arrayDefault = opt.hasDefault
1244
- ? typeof opt.defaultValue === 'function'
1245
- ? opt.defaultValue()
1246
- : opt.defaultValue
1247
- : undefined;
1248
- const arrayDesc =
1249
- opt.hasDefault && Array.isArray(arrayDefault) && arrayDefault.length > 0
1250
- ? `${desc} (default: ${JSON.stringify(arrayDefault)})`
1251
- : desc;
1252
- cmd.option(
1253
- `${flagSpec} <${opt.name}>`,
1254
- arrayDesc,
1255
- (value: string, previous: string[]) => (previous ?? []).concat([value])
1256
- );
1257
- } else if (opt.type === 'optionalString') {
1258
- // Optional string: --flag uses true, --flag=value uses the string value
1259
- // In Commander.js, [value] means optional argument
1260
- cmd.option(`${flagSpec} [${opt.name}]`, desc);
1261
- } else {
1262
- const strDefault = opt.hasDefault
1263
- ? typeof opt.defaultValue === 'function'
1264
- ? opt.defaultValue()
1265
- : opt.defaultValue
1266
- : undefined;
1267
- let strDesc = desc;
1268
- if (opt.enumValues && opt.enumValues.length > 0) {
1269
- strDesc += ` (${opt.enumValues.join(', ')})`;
1270
- }
1271
- if (opt.hasDefault && strDefault !== undefined) {
1272
- strDesc += ` (default: ${JSON.stringify(strDefault)})`;
1273
- }
1274
- cmd.option(`${flagSpec} <${opt.name}>`, strDesc);
1275
- }
1276
- }
1277
- }
1278
-
1279
- // Add hidden --yes and --force aliases for --confirm if command has a confirm option
1280
- if (subcommand.schema?.options) {
1281
- const parsed = parseOptionsSchema(subcommand.schema.options);
1282
- const hasConfirmOption = parsed.some((opt) => opt.name === 'confirm');
1283
- if (hasConfirmOption) {
1284
- // Add hidden --yes option that sets confirm to true
1285
- const yesOption = cmd.createOption('--yes', 'Alias for --confirm');
1286
- yesOption.hideHelp();
1287
- cmd.addOption(yesOption);
1288
- // Add hidden --force option that sets confirm to true,
1289
- // but only if the schema doesn't already declare its own --force option
1290
- const hasForceOption = parsed.some((opt) => opt.name === 'force');
1291
- if (!hasForceOption) {
1292
- const forceOption = cmd.createOption('--force', 'Alias for --confirm');
1293
- forceOption.hideHelp();
1294
- cmd.addOption(forceOption);
1295
- }
1296
- }
1297
- }
1298
-
1299
- // Add --org-id if command requires/optional org and doesn't define it in schema
1300
- if (_deferOrgIdFlag && !hasOrgIdInSchema) {
1301
- cmd.option('--org-id <id>', 'organization ID');
1302
- // Add hidden --org alias, but only if schema doesn't define its own --org option
1303
- // (e.g., env commands use --org for "org scope" which is different from --org-id)
1304
- const schemaDefinesOrg = subcommand.schema?.options
1305
- ? parseOptionsSchema(subcommand.schema.options).some((o) => o.name === 'org')
1306
- : false;
1307
- if (!schemaDefinesOrg) {
1308
- // Use [id] (optional) to allow --org without argument for default org
1309
- const orgAlias = cmd.createOption('--org [id]', 'Alias for --org-id');
1310
- orgAlias.hideHelp();
1311
- cmd.addOption(orgAlias);
1312
- }
1313
- }
1314
-
1315
- // Add --project-id if command requires/optional project and doesn't define it in schema
1316
- if ((requiresProject || optionalProject) && !hasProjectIdInSchema) {
1317
- cmd.option('--project-id <id>', 'project ID (alternative to --dir)');
1318
- }
1319
-
1320
- cmd.action(async (...rawArgs: unknown[]) => {
1321
- const cmdObj = rawArgs[rawArgs.length - 1] as { opts: () => Record<string, unknown> };
1322
- const options = cmdObj.opts();
1323
- const args = rawArgs.slice(0, -1);
1324
-
1325
- // Normalize --org to --org-id for downstream code
1326
- // The --org [id] option is parsed into options.org, but code uses options.orgId
1327
- // Handle: --org (true -> undefined for default org), --org org_123 (string -> string)
1328
- if (options.org !== undefined && options.orgId === undefined) {
1329
- if (options.org === true) {
1330
- // --org without argument: mark as explicitly requested (use default org)
1331
- // Set to undefined so org resolution falls through to preference/env/prompt
1332
- options.orgId = undefined;
1333
- } else if (typeof options.org === 'string') {
1334
- options.orgId = options.org;
1335
- }
1336
- }
1337
-
1338
- // Handle --describe mode: output command schema and exit
1339
- if (baseCtx.options.describe) {
1340
- const { extractSubcommandSchema } = await import('./schema-generator');
1341
- const schema = extractSubcommandSchema(subcommand);
1342
- const { outputJSON } = await import('./output');
1343
- outputJSON(schema);
1344
- return;
1345
- }
1346
-
1347
- // One-time hint for agents about structured input/output features
1348
- // Emitted on stderr so it doesn't interfere with --json stdout
1349
- const detectedAgent = getExecutingAgent();
1350
- if (detectedAgent) {
1351
- const { hasAgentSeenInputHint, markAgentInputHintSeen } = await import('./cache');
1352
- if (!hasAgentSeenInputHint(detectedAgent)) {
1353
- markAgentInputHintSeen(detectedAgent);
1354
- console.error(
1355
- `[agent] This CLI supports structured I/O for agents: --input <json> (structured input), --describe (schema introspection), --fields (output filtering). Run --ai-help for details.`
1356
- );
1357
- }
1358
- }
1359
-
1360
- // Merge global --org-id and --project-id into subcommand options when the schema
1361
- // defines these fields. Global options (program-level) capture the values first,
1362
- // so subcommand-level options may not have them. Only merge when the user
1363
- // explicitly passed the flag on the CLI (not from env var defaults).
1364
- const argv = process.argv;
1365
- const hasExplicitOrgId = argv.some(
1366
- (a) =>
1367
- a === '--org-id' || a.startsWith('--org-id=') || a === '--org' || a.startsWith('--org=')
1368
- );
1369
- const hasExplicitProjectId = argv.some(
1370
- (a) => a === '--project-id' || a.startsWith('--project-id=')
1371
- );
1372
- if (
1373
- hasOrgIdInSchema &&
1374
- options.orgId === undefined &&
1375
- hasExplicitOrgId &&
1376
- baseCtx.options.orgId
1377
- ) {
1378
- options.orgId = baseCtx.options.orgId;
1379
- }
1380
- if (
1381
- hasProjectIdInSchema &&
1382
- options.projectId === undefined &&
1383
- hasExplicitProjectId &&
1384
- (baseCtx.options as unknown as Record<string, unknown>).projectId
1385
- ) {
1386
- options.projectId = (baseCtx.options as unknown as Record<string, unknown>).projectId;
1387
- }
1388
-
1389
- if (subcommand.banner) {
1390
- showBanner();
1391
- }
1392
-
1393
- const normalized = normalizeReqs(subcommand);
1394
-
1395
- let project: ProjectConfig | undefined;
1396
- let projectDir: string | undefined;
1397
- const dirNeeded = normalized.requiresProject || normalized.optionalProject;
1398
-
1399
- if (dirNeeded) {
1400
- const optionsProjectId = options.projectId as string | undefined;
1401
-
1402
- // Helper to fetch project from API by ID
1403
- const fetchProjectFromAPI = async (
1404
- projectId: string
1405
- ): Promise<ProjectConfig | undefined> => {
1406
- const auth = await requireAuth(baseCtx);
1407
- if (auth) {
1408
- // Create config with auth credentials for API client
1409
- const configWithAuth = {
1410
- ...baseCtx.config,
1411
- auth: {
1412
- api_key: auth.apiKey,
1413
- user_id: auth.userId,
1414
- expires: auth.expires.getTime(),
1415
- },
1416
- };
1417
- const apiClient = createAPIClient(baseCtx, configWithAuth as Config);
1418
- // Check cache first to avoid duplicate API calls
1419
- const profile = baseCtx.config?.name ?? 'default';
1420
- let projectDetails = getCachedProject(profile, projectId);
1421
- if (!projectDetails) {
1422
- const { projectGet } = await import('@agentuity/server');
1423
- // Use keys: false to match other callers and ensure cache consistency
1424
- projectDetails = await projectGet(apiClient, { id: projectId, keys: false });
1425
- setCachedProject(profile, projectId, projectDetails);
1426
- }
1427
- return {
1428
- projectId: projectDetails.id,
1429
- orgId: projectDetails.orgId,
1430
- region: projectDetails.cloudRegion || '',
1431
- };
1432
- }
1433
- return undefined;
1434
- };
1435
-
1436
- // Resolution precedence:
1437
- // 1. --project-id flag (or AGENTUITY_CLOUD_PROJECT_ID env var)
1438
- // 2. agentuity.json in project directory
1439
- // 3. config.preferences.projectId (global preference) - fallback only
1440
- // 4. Interactive selection (if TTY)
1441
-
1442
- if (optionsProjectId) {
1443
- // Priority 1: Explicit flag/env var provided
1444
- try {
1445
- project = await fetchProjectFromAPI(optionsProjectId);
1446
- } catch (_error) {
1447
- if (normalized.requiresProject) {
1448
- exitWithError(
1449
- createError(
1450
- ErrorCode.PROJECT_NOT_FOUND,
1451
- `Project not found: ${optionsProjectId}`,
1452
- undefined,
1453
- [
1454
- 'Verify the project ID is correct',
1455
- `Run "${getCommand('project list')}" to see available projects`,
1456
- ]
1457
- ),
1458
- baseCtx.logger,
1459
- baseCtx.options.errorFormat
1460
- );
1461
- }
1462
- }
1463
- } else {
1464
- // Priority 2: Try to load from agentuity.json in directory
1465
- const dir = (options.dir as string | undefined) ?? process.cwd();
1466
- projectDir = dir;
1467
- if (projectDir.startsWith('~/')) {
1468
- projectDir = projectDir.replace('~/', homedir());
1469
- }
1470
- projectDir = resolve(projectDir);
1471
- try {
1472
- project = await loadProjectConfig(dir, baseCtx.config);
1473
- } catch (error) {
1474
- const isConfigNotFound =
1475
- error &&
1476
- typeof error === 'object' &&
1477
- 'name' in error &&
1478
- error.name === 'ProjectConfigNotFoundException';
1479
-
1480
- if (isConfigNotFound) {
1481
- // Priority 3: Try global preference (only when no agentuity.json found)
1482
- const projectIdFromPreference = baseCtx.config?.preferences?.projectId as
1483
- | string
1484
- | undefined;
1485
- if (projectIdFromPreference) {
1486
- try {
1487
- project = await fetchProjectFromAPI(projectIdFromPreference);
1488
- if (project) {
1489
- // Set the project ID in options so it can be used by the command
1490
- (options as Record<string, unknown>).projectId = projectIdFromPreference;
1491
- }
1492
- } catch (_preferenceError) {
1493
- // Preference project not found, fall through to interactive selection
1494
- baseCtx.logger.trace(
1495
- 'Preference project not found: %s',
1496
- projectIdFromPreference
1497
- );
1498
- }
1499
- }
1500
-
1501
- // Priority 4: Interactive selection (if TTY and still no project)
1502
- if (!project && normalized.requiresProject) {
1503
- const hasTTY = process.stdin.isTTY && process.stdout.isTTY;
1504
-
1505
- if (hasTTY) {
1506
- // Try to prompt for project selection
1507
- try {
1508
- const selectedProject = await promptProjectSelection(baseCtx);
1509
- if (selectedProject) {
1510
- // Set the project ID in options so it can be used by the command
1511
- (options as Record<string, unknown>).projectId =
1512
- selectedProject.projectId;
1513
- project = selectedProject;
1514
- }
1515
- } catch (promptError) {
1516
- // If prompting fails, fall through to the original error
1517
- baseCtx.logger.trace('Project selection prompt failed: %s', promptError);
1518
- }
1519
- }
1520
-
1521
- if (!project) {
1522
- exitWithError(
1523
- createError(
1524
- ErrorCode.PROJECT_NOT_FOUND,
1525
- 'Invalid project folder',
1526
- undefined,
1527
- [
1528
- 'Use --dir to specify a different directory',
1529
- 'Use --project-id to specify a project by ID',
1530
- 'Change to a directory containing agentuity.json',
1531
- `Run "${getCommand('project create')}" to create a new project`,
1532
- ]
1533
- ),
1534
- baseCtx.logger,
1535
- baseCtx.options.errorFormat
1536
- );
1537
- }
1538
- }
1539
- } else if (normalized.requiresProject) {
1540
- throw error;
1541
- }
1542
- // For optional projects, silently continue without project config
1543
- }
1544
- }
1545
- }
1546
-
1547
- if (normalized.requiresAuth) {
1548
- // Create apiClient before requireAuth since login command needs it
1549
- if (normalized.requiresAPIClient) {
1550
- (baseCtx as Record<string, unknown>).apiClient = createAPIClient(
1551
- baseCtx,
1552
- baseCtx.config ?? null
1553
- );
1554
- }
1555
-
1556
- const auth = await requireAuth(baseCtx as CommandContext<undefined>);
1557
-
1558
- if (subcommand.schema) {
1559
- try {
1560
- // Check if command uses stdin (don't auto-confirm if it does)
1561
- const usesStdin = subcommand.tags?.includes('uses-stdin') ?? false;
1562
- const input = await buildValidationInputAsync(
1563
- subcommand.schema,
1564
- args,
1565
- options,
1566
- { usesStdin },
1567
- baseCtx.options.input
1568
- );
1569
- const ctx: Record<string, unknown> = {
1570
- ...baseCtx,
1571
- config: {
1572
- ...(baseCtx.config ?? {}),
1573
- auth: {
1574
- api_key: auth.apiKey,
1575
- user_id: auth.userId,
1576
- expires: auth.expires.getTime(),
1577
- },
1578
- },
1579
- auth,
1580
- };
1581
- if (project || projectDir) {
1582
- if (project) {
1583
- ctx.project = project;
1584
- }
1585
- ctx.projectDir = projectDir;
1586
- }
1587
- if (subcommand.schema.args) {
1588
- ctx.args = parseArgs(subcommand.schema.args, input.args);
1589
- }
1590
- if (subcommand.schema.options) {
1591
- ctx.opts = parseOptions(subcommand.schema.options, input.options);
1592
- }
1593
- if (normalized.requiresAPIClient) {
1594
- // Recreate apiClient with auth credentials
1595
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
1596
- }
1597
- // Auto-select org when --confirm flag is used
1598
- const autoSelectOrg = options.confirm === true;
1599
- const hasPrefixedId = hasPrefixedResourceId(
1600
- ctx.args as Record<string, unknown> | undefined,
1601
- ctx.opts as Record<string, unknown> | undefined
1602
- );
1603
- const prefixedOrgId = hasPrefixedId
1604
- ? await resolveOrgIdWithoutPrompt({
1605
- options,
1606
- config: (ctx.config as Config | null) ?? null,
1607
- args: ctx.args as Record<string, unknown> | undefined,
1608
- opts: ctx.opts as Record<string, unknown> | undefined,
1609
- })
1610
- : undefined;
1611
- if (normalized.requiresOrg) {
1612
- ctx.orgId = hasPrefixedId
1613
- ? prefixedOrgId
1614
- : await requireOrg(
1615
- ctx as CommandContext & { apiClient: APIClientType },
1616
- autoSelectOrg
1617
- );
1618
- }
1619
- // Skip org handling if --no-register is set (org only needed for registration)
1620
- const skipOrg =
1621
- normalized.optionalOrg &&
1622
- !normalized.requiresOrg &&
1623
- ctx.opts &&
1624
- (ctx.opts as Record<string, unknown>).register === false;
1625
-
1626
- if (normalized.optionalOrg && ctx.auth && !skipOrg) {
1627
- ctx.orgId = hasPrefixedId
1628
- ? prefixedOrgId
1629
- : await selectOptionalOrg(
1630
- ctx as CommandContext & { apiClient: APIClientType },
1631
- autoSelectOrg
1632
- );
1633
- }
1634
- // Skip region handling if --no-register is set (region only needed for registration)
1635
- const skipRegion =
1636
- normalized.optionalRegion &&
1637
- !normalized.requiresRegion &&
1638
- !normalized.requiresRegions &&
1639
- ctx.opts &&
1640
- (ctx.opts as Record<string, unknown>).register === false;
1641
-
1642
- if (
1643
- (normalized.requiresRegion ||
1644
- normalized.optionalRegion ||
1645
- normalized.requiresRegions) &&
1646
- ctx.apiClient &&
1647
- !skipRegion
1648
- ) {
1649
- const apiClient: APIClientType = ctx.apiClient as APIClientType;
1650
- const regions = await tui.spinner({
1651
- message: 'Fetching cloud regions',
1652
- clearOnSuccess: true,
1653
- callback: async () => {
1654
- return fetchRegionsWithCache(
1655
- baseCtx.config?.name ?? defaultProfileName,
1656
- apiClient,
1657
- baseCtx.logger
1658
- );
1659
- },
1660
- });
1661
- if (normalized.requiresRegions) {
1662
- ctx.regions = regions;
1663
- }
1664
- if (normalized.requiresRegion || normalized.optionalRegion) {
1665
- const region = await resolveRegion({
1666
- options: options as Record<string, unknown>,
1667
- args: ctx.args as Record<string, unknown> | undefined,
1668
- regions,
1669
- logger: baseCtx.logger,
1670
- required: !!normalized.requiresRegion,
1671
- region: project?.region,
1672
- config: baseCtx.config ?? null,
1673
- });
1674
- if (region) {
1675
- ctx.region = region;
1676
- }
1677
- }
1678
- }
1679
- await executeOrValidate(
1680
- ctx as CommandContext,
1681
- getFullCommandPath(cmd),
1682
- subcommand.handler,
1683
- !!subcommand.schema?.response,
1684
- subcommand.webUrl
1685
- );
1686
- } catch (error) {
1687
- if (isCLIValidationError(error)) {
1688
- handleValidationError(error, getFullCommandPath(cmd), baseCtx);
1689
- }
1690
- handleProjectConfigError(
1691
- error,
1692
- normalized.requiresProject,
1693
- baseCtx.logger,
1694
- baseCtx.options.errorFormat
1695
- );
1696
- }
1697
- } else {
1698
- const ctx: Record<string, unknown> = {
1699
- ...baseCtx,
1700
- config: baseCtx.config
1701
- ? {
1702
- ...baseCtx.config,
1703
- name: baseCtx.config.name ?? defaultProfileName,
1704
- auth: {
1705
- api_key: auth.apiKey,
1706
- user_id: auth.userId,
1707
- expires: auth.expires.getTime(),
1708
- },
1709
- }
1710
- : null,
1711
- auth,
1712
- };
1713
- if (project || projectDir) {
1714
- if (project) {
1715
- ctx.project = project;
1716
- }
1717
- ctx.projectDir = projectDir;
1718
- }
1719
- if (normalized.requiresAPIClient) {
1720
- // Recreate apiClient with auth credentials
1721
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
1722
- }
1723
- // Auto-select org when --confirm flag is used
1724
- const autoSelectOrg2 = options.confirm === true;
1725
- const hasPrefixedId = hasPrefixedResourceId(args as unknown[]);
1726
- const prefixedOrgId = hasPrefixedId
1727
- ? await resolveOrgIdWithoutPrompt({
1728
- options,
1729
- config: (ctx.config as Config | null) ?? null,
1730
- args: args as unknown[],
1731
- })
1732
- : undefined;
1733
- if (normalized.requiresOrg) {
1734
- ctx.orgId = hasPrefixedId
1735
- ? prefixedOrgId
1736
- : await requireOrg(
1737
- ctx as CommandContext & { apiClient: APIClientType },
1738
- autoSelectOrg2
1739
- );
1740
- }
1741
- // Skip org handling if --no-register is set (org only needed for registration)
1742
- const skipOrg =
1743
- normalized.optionalOrg &&
1744
- !normalized.requiresOrg &&
1745
- ctx.opts &&
1746
- (ctx.opts as Record<string, unknown>).register === false;
1747
-
1748
- if (normalized.optionalOrg && ctx.auth && !skipOrg) {
1749
- ctx.orgId = hasPrefixedId
1750
- ? prefixedOrgId
1751
- : await selectOptionalOrg(
1752
- ctx as CommandContext & { apiClient: APIClientType },
1753
- autoSelectOrg2
1754
- );
1755
- }
1756
- // Skip region handling if --no-register is set (region only needed for registration)
1757
- const skipRegion =
1758
- normalized.optionalRegion &&
1759
- !normalized.requiresRegion &&
1760
- !normalized.requiresRegions &&
1761
- ctx.opts &&
1762
- (ctx.opts as Record<string, unknown>).register === false;
1763
-
1764
- if (
1765
- (normalized.requiresRegion ||
1766
- normalized.optionalRegion ||
1767
- normalized.requiresRegions) &&
1768
- ctx.apiClient &&
1769
- !skipRegion
1770
- ) {
1771
- const apiClient: APIClientType = ctx.apiClient as APIClientType;
1772
- const regions = await tui.spinner({
1773
- message: 'Fetching cloud regions',
1774
- clearOnSuccess: true,
1775
- callback: async () => {
1776
- return fetchRegionsWithCache(
1777
- baseCtx.config?.name ?? defaultProfileName,
1778
- apiClient,
1779
- baseCtx.logger
1780
- );
1781
- },
1782
- });
1783
- if (normalized.requiresRegions) {
1784
- ctx.regions = regions;
1785
- }
1786
- if (normalized.requiresRegion || normalized.optionalRegion) {
1787
- const region = await resolveRegion({
1788
- options: options as Record<string, unknown>,
1789
- args: args as unknown[],
1790
- regions,
1791
- logger: baseCtx.logger,
1792
- required: !!normalized.requiresRegion,
1793
- region: project?.region,
1794
- config: baseCtx.config ?? null,
1795
- });
1796
- if (region) {
1797
- ctx.region = region;
1798
- }
1799
- }
1800
- }
1801
- if (subcommand.handler) {
1802
- const result = await subcommand.handler(ctx as CommandContext);
1803
- // Render "View on the web" link after successful execution (not shown on errors)
1804
- maybeRenderWebLink(ctx as CommandContext, subcommand.webUrl);
1805
-
1806
- // If --json flag is set
1807
- if (baseCtx.options.json) {
1808
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1809
- const hasResponseSchema = !!(subcommand as any).schema?.response;
1810
-
1811
- // If command has a response schema but returned nothing, that's an error
1812
- if (hasResponseSchema && result === undefined) {
1813
- const { createError, exitWithError, ErrorCode } = await import('./errors');
1814
- exitWithError(
1815
- createError(
1816
- ErrorCode.INTERNAL_ERROR,
1817
- `Command '${getFullCommandPath(cmd)}' declares a response schema but returned no data. This is a bug in the command implementation.`
1818
- ),
1819
- baseCtx.logger,
1820
- baseCtx.options.errorFormat
1821
- );
1822
- }
1823
-
1824
- // Output the result as JSON if we have data
1825
- if (result !== undefined) {
1826
- const { outputJSON } = await import('./output');
1827
- outputJSON(result);
1828
- }
1829
- }
1830
- }
1831
- }
1832
- } else if (normalized.optionalAuth) {
1833
- const continueText =
1834
- typeof normalized.optionalAuth === 'string' ? normalized.optionalAuth : undefined;
1835
-
1836
- // Create apiClient before optionalAuth since login command needs it
1837
- if (normalized.requiresAPIClient) {
1838
- (baseCtx as Record<string, unknown>).apiClient = createAPIClient(
1839
- baseCtx,
1840
- baseCtx.config ?? null
1841
- );
1842
- }
1843
-
1844
- // Check if --confirm flag or --no-register flag is set to skip interactive prompts
1845
- const skipPrompts = options.confirm === true || options.register === false;
1846
- const auth = await optionalAuth(
1847
- baseCtx as CommandContext<undefined>,
1848
- continueText,
1849
- skipPrompts
1850
- );
1851
-
1852
- if (subcommand.schema) {
1853
- try {
1854
- // Check if command uses stdin (don't auto-confirm if it does)
1855
- const usesStdin = subcommand.tags?.includes('uses-stdin') ?? false;
1856
- const input = await buildValidationInputAsync(
1857
- subcommand.schema,
1858
- args,
1859
- options,
1860
- {
1861
- usesStdin,
1862
- },
1863
- baseCtx.options.input
1864
- );
1865
- const ctx: Record<string, unknown> = {
1866
- ...baseCtx,
1867
- config: auth
1868
- ? {
1869
- ...(baseCtx.config ?? {}),
1870
- auth: {
1871
- api_key: auth.apiKey,
1872
- user_id: auth.userId,
1873
- expires: auth.expires.getTime(),
1874
- },
1875
- }
1876
- : baseCtx.config,
1877
- auth,
1878
- };
1879
- if (project || projectDir) {
1880
- if (project) {
1881
- ctx.project = project;
1882
- }
1883
- ctx.projectDir = projectDir;
1884
- }
1885
- if (subcommand.schema.args) {
1886
- ctx.args = parseArgs(subcommand.schema.args, input.args);
1887
- }
1888
- if (subcommand.schema.options) {
1889
- ctx.opts = parseOptions(subcommand.schema.options, input.options);
1890
- }
1891
- if (normalized.requiresAPIClient) {
1892
- // Recreate apiClient with auth credentials
1893
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
1894
- }
1895
- baseCtx.logger.trace(
1896
- 'optionalAuth path: org=%s, region=%s, hasApiClient=%s, hasAuth=%s',
1897
- normalized.optionalOrg,
1898
- normalized.optionalRegion,
1899
- !!ctx.apiClient,
1900
- !!auth
1901
- );
1902
- // Auto-select org when --confirm flag is used
1903
- const autoSelectOrg3 = options.confirm === true;
1904
- const hasPrefixedId3 = hasPrefixedResourceId(
1905
- ctx.args as Record<string, unknown> | undefined,
1906
- ctx.opts as Record<string, unknown> | undefined
1907
- );
1908
- const prefixedOrgId3 = hasPrefixedId3
1909
- ? await resolveOrgIdWithoutPrompt({
1910
- options,
1911
- config: (ctx.config as Config | null) ?? null,
1912
- args: ctx.args as Record<string, unknown> | undefined,
1913
- opts: ctx.opts as Record<string, unknown> | undefined,
1914
- })
1915
- : undefined;
1916
- if (normalized.requiresOrg && ctx.apiClient) {
1917
- ctx.orgId = hasPrefixedId3
1918
- ? prefixedOrgId3
1919
- : await requireOrg(
1920
- ctx as CommandContext & { apiClient: APIClientType },
1921
- autoSelectOrg3
1922
- );
1923
- }
1924
- // Skip org handling if --no-register is set (org only needed for registration)
1925
- const skipOrg =
1926
- normalized.optionalOrg &&
1927
- !normalized.requiresOrg &&
1928
- ctx.opts &&
1929
- (ctx.opts as Record<string, unknown>).register === false;
1930
-
1931
- if (normalized.optionalOrg && ctx.apiClient && auth && !skipOrg) {
1932
- ctx.orgId = hasPrefixedId3
1933
- ? prefixedOrgId3
1934
- : await selectOptionalOrg(
1935
- ctx as CommandContext & { apiClient?: APIClientType; auth?: AuthData },
1936
- autoSelectOrg3
1937
- );
1938
- baseCtx.logger.trace('selected orgId: %s', ctx.orgId);
1939
- }
1940
- // Skip region handling if --no-register is set (region only needed for registration)
1941
- const skipRegion =
1942
- normalized.optionalRegion &&
1943
- !normalized.requiresRegion &&
1944
- ctx.opts &&
1945
- (ctx.opts as Record<string, unknown>).register === false;
1946
-
1947
- if (
1948
- (normalized.requiresRegion || normalized.optionalRegion) &&
1949
- ctx.apiClient &&
1950
- auth &&
1951
- !skipRegion
1952
- ) {
1953
- const apiClient: APIClientType = ctx.apiClient as APIClientType;
1954
- const regions = await tui.spinner({
1955
- message: 'Fetching cloud regions',
1956
- clearOnSuccess: true,
1957
- callback: async () => {
1958
- return fetchRegionsWithCache(
1959
- baseCtx.config?.name ?? defaultProfileName,
1960
- apiClient,
1961
- baseCtx.logger
1962
- );
1963
- },
1964
- });
1965
- const region = await resolveRegion({
1966
- options: options as Record<string, unknown>,
1967
- args: ctx.args as Record<string, unknown> | undefined,
1968
- regions,
1969
- logger: baseCtx.logger,
1970
- required: !!normalized.requiresRegion,
1971
- region: project?.region,
1972
- config: baseCtx.config ?? null,
1973
- });
1974
- if (region) {
1975
- ctx.region = region;
1976
- }
1977
- }
1978
- await executeOrValidate(
1979
- ctx as CommandContext,
1980
- getFullCommandPath(cmd),
1981
- subcommand.handler,
1982
- !!subcommand.schema?.response,
1983
- subcommand.webUrl
1984
- );
1985
- } catch (error) {
1986
- if (isCLIValidationError(error)) {
1987
- handleValidationError(error, getFullCommandPath(cmd), baseCtx);
1988
- }
1989
- handleProjectConfigError(
1990
- error,
1991
- normalized.requiresProject,
1992
- baseCtx.logger,
1993
- baseCtx.options.errorFormat
1994
- );
1995
- }
1996
- } else {
1997
- const ctx: Record<string, unknown> = {
1998
- ...baseCtx,
1999
- config: auth
2000
- ? {
2001
- ...(baseCtx.config ?? {}),
2002
- auth: {
2003
- api_key: auth.apiKey,
2004
- user_id: auth.userId,
2005
- expires: auth.expires.getTime(),
2006
- },
2007
- }
2008
- : baseCtx.config,
2009
- auth,
2010
- };
2011
- if (project || projectDir) {
2012
- if (project) {
2013
- ctx.project = project;
2014
- }
2015
- ctx.projectDir = projectDir;
2016
- }
2017
- if (normalized.requiresAPIClient) {
2018
- // Recreate apiClient with auth credentials if auth was provided
2019
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
2020
- }
2021
- // Auto-select org when --confirm flag is used
2022
- const autoSelectOrg4 = options.confirm === true;
2023
- const hasPrefixedId4 = hasPrefixedResourceId(args as unknown[]);
2024
- const prefixedOrgId4 = hasPrefixedId4
2025
- ? await resolveOrgIdWithoutPrompt({
2026
- options,
2027
- config: (ctx.config as Config | null) ?? null,
2028
- args: args as unknown[],
2029
- })
2030
- : undefined;
2031
- if (normalized.requiresOrg && ctx.apiClient) {
2032
- ctx.orgId = hasPrefixedId4
2033
- ? prefixedOrgId4
2034
- : await requireOrg(
2035
- ctx as CommandContext & { apiClient: APIClientType },
2036
- autoSelectOrg4
2037
- );
2038
- }
2039
- // Skip org handling if --no-register is set (org only needed for registration)
2040
- // For non-schema commands, check options directly (Commander passes all options)
2041
- const skipOrg =
2042
- normalized.optionalOrg &&
2043
- !normalized.requiresOrg &&
2044
- (options as Record<string, unknown>).register === false;
2045
-
2046
- if (normalized.optionalOrg && ctx.apiClient && !skipOrg) {
2047
- ctx.orgId = hasPrefixedId4
2048
- ? prefixedOrgId4
2049
- : await selectOptionalOrg(
2050
- ctx as CommandContext & { apiClient?: APIClientType; auth?: AuthData },
2051
- autoSelectOrg4
2052
- );
2053
- }
2054
- // Skip region handling if --no-register is set (region only needed for registration)
2055
- const skipRegion =
2056
- normalized.optionalRegion &&
2057
- !normalized.requiresRegion &&
2058
- (options as Record<string, unknown>).register === false;
2059
-
2060
- if (
2061
- (normalized.requiresRegion || normalized.optionalRegion) &&
2062
- ctx.apiClient &&
2063
- !skipRegion
2064
- ) {
2065
- const apiClient: APIClientType = ctx.apiClient as APIClientType;
2066
- const regions = await tui.spinner({
2067
- message: 'Fetching cloud regions',
2068
- clearOnSuccess: true,
2069
- callback: async () => {
2070
- return fetchRegionsWithCache(
2071
- baseCtx.config?.name ?? defaultProfileName,
2072
- apiClient,
2073
- baseCtx.logger
2074
- );
2075
- },
2076
- });
2077
- const region = await resolveRegion({
2078
- options: options as Record<string, unknown>,
2079
- args: args as unknown[],
2080
- regions,
2081
- logger: baseCtx.logger,
2082
- required: !!normalized.requiresRegion,
2083
- region: project?.region,
2084
- config: baseCtx.config ?? null,
2085
- });
2086
- if (region) {
2087
- ctx.region = region;
2088
- }
2089
- }
2090
- if (subcommand.handler) {
2091
- const result = await subcommand.handler(ctx as CommandContext);
2092
- // Render "View on the web" link after successful execution (not shown on errors)
2093
- maybeRenderWebLink(ctx as CommandContext, subcommand.webUrl);
2094
-
2095
- // If --json flag is set
2096
- if (baseCtx.options.json) {
2097
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2098
- const hasResponseSchema = !!(subcommand as any).schema?.response;
2099
-
2100
- // If command has a response schema but returned nothing, that's an error
2101
- if (hasResponseSchema && result === undefined) {
2102
- const { createError, exitWithError, ErrorCode } = await import('./errors');
2103
- exitWithError(
2104
- createError(
2105
- ErrorCode.INTERNAL_ERROR,
2106
- `Command '${getFullCommandPath(cmd)}' declares a response schema but returned no data. This is a bug in the command implementation.`
2107
- ),
2108
- baseCtx.logger,
2109
- baseCtx.options.errorFormat
2110
- );
2111
- }
2112
-
2113
- // Output the result as JSON if we have data
2114
- if (result !== undefined) {
2115
- const { outputJSON } = await import('./output');
2116
- outputJSON(result);
2117
- }
2118
- }
2119
- }
2120
- }
2121
- } else {
2122
- if (subcommand.schema) {
2123
- try {
2124
- // Check if command uses stdin (don't auto-confirm if it does)
2125
- const usesStdin = subcommand.tags?.includes('uses-stdin') ?? false;
2126
- const input = await buildValidationInputAsync(
2127
- subcommand.schema,
2128
- args,
2129
- options,
2130
- {
2131
- usesStdin,
2132
- },
2133
- baseCtx.options.input
2134
- );
2135
- const ctx: Record<string, unknown> = {
2136
- ...baseCtx,
2137
- };
2138
- if (project || projectDir) {
2139
- if (project) {
2140
- ctx.project = project;
2141
- }
2142
- ctx.projectDir = projectDir;
2143
- }
2144
- if (subcommand.schema.args) {
2145
- ctx.args = parseArgs(subcommand.schema.args, input.args);
2146
- }
2147
- if (subcommand.schema.options) {
2148
- ctx.opts = parseOptions(subcommand.schema.options, input.options);
2149
- }
2150
- if (normalized.requiresAPIClient && !ctx.apiClient) {
2151
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
2152
- }
2153
- // Auto-select org when --confirm flag is used
2154
- const autoSelectOrg5 = options.confirm === true;
2155
- if (normalized.requiresOrg && ctx.apiClient) {
2156
- ctx.orgId = await requireOrg(
2157
- ctx as CommandContext & { apiClient: APIClientType },
2158
- autoSelectOrg5
2159
- );
2160
- }
2161
- if (normalized.optionalOrg && ctx.apiClient && ctx.auth) {
2162
- ctx.orgId = await requireOrg(
2163
- ctx as CommandContext & { apiClient: APIClientType },
2164
- autoSelectOrg5
2165
- );
2166
- }
2167
- await executeOrValidate(
2168
- ctx as CommandContext,
2169
- getFullCommandPath(cmd),
2170
- subcommand.handler,
2171
- !!subcommand.schema?.response,
2172
- subcommand.webUrl
2173
- );
2174
- } catch (error) {
2175
- if (isCLIValidationError(error)) {
2176
- handleValidationError(error, getFullCommandPath(cmd), baseCtx);
2177
- }
2178
- handleProjectConfigError(
2179
- error,
2180
- normalized.requiresProject,
2181
- baseCtx.logger,
2182
- baseCtx.options.errorFormat
2183
- );
2184
- }
2185
- } else {
2186
- const ctx: Record<string, unknown> = {
2187
- ...baseCtx,
2188
- };
2189
- if (project || projectDir) {
2190
- if (project) {
2191
- ctx.project = project;
2192
- }
2193
- ctx.projectDir = projectDir;
2194
- }
2195
- if (normalized.requiresAPIClient && !ctx.apiClient) {
2196
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
2197
- }
2198
- // Auto-select org when --confirm flag is used
2199
- const autoSelectOrg6 = options.confirm === true;
2200
- if (normalized.requiresOrg && ctx.apiClient) {
2201
- ctx.orgId = await requireOrg(
2202
- ctx as CommandContext & { apiClient: APIClientType },
2203
- autoSelectOrg6
2204
- );
2205
- }
2206
- if (normalized.optionalOrg && ctx.apiClient && ctx.auth) {
2207
- ctx.orgId = await requireOrg(
2208
- ctx as CommandContext & { apiClient: APIClientType },
2209
- autoSelectOrg6
2210
- );
2211
- }
2212
- if ((normalized.requiresRegion || normalized.optionalRegion) && ctx.apiClient) {
2213
- const apiClient: APIClientType = ctx.apiClient as APIClientType;
2214
- const regions = await tui.spinner({
2215
- message: 'Fetching cloud regions',
2216
- clearOnSuccess: true,
2217
- callback: async () => {
2218
- return fetchRegionsWithCache(
2219
- baseCtx.config?.name ?? defaultProfileName,
2220
- apiClient,
2221
- baseCtx.logger
2222
- );
2223
- },
2224
- });
2225
- const region = await resolveRegion({
2226
- options: options as Record<string, unknown>,
2227
- args: args as unknown[],
2228
- regions,
2229
- logger: baseCtx.logger,
2230
- required: !!normalized.requiresRegion,
2231
- region: project?.region,
2232
- config: baseCtx.config ?? null,
2233
- });
2234
- if (region) {
2235
- ctx.region = region;
2236
- }
2237
- }
2238
- if (subcommand.handler) {
2239
- const result = await subcommand.handler(ctx as CommandContext);
2240
- // Render "View on the web" link after successful execution (not shown on errors)
2241
- maybeRenderWebLink(ctx as CommandContext, subcommand.webUrl);
2242
-
2243
- // If --json flag is set
2244
- if (baseCtx.options.json) {
2245
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2246
- const hasResponseSchema = !!(subcommand as any).schema?.response;
2247
-
2248
- // If command has a response schema but returned nothing, that's an error
2249
- if (hasResponseSchema && result === undefined) {
2250
- const { createError, exitWithError, ErrorCode } = await import('./errors');
2251
- exitWithError(
2252
- createError(
2253
- ErrorCode.INTERNAL_ERROR,
2254
- `Command '${getFullCommandPath(cmd)}' declares a response schema but returned no data. This is a bug in the command implementation.`
2255
- ),
2256
- baseCtx.logger,
2257
- baseCtx.options.errorFormat
2258
- );
2259
- }
2260
-
2261
- // Output the result as JSON if we have data
2262
- if (result !== undefined) {
2263
- const { outputJSON } = await import('./output');
2264
- outputJSON(result);
2265
- }
2266
- }
2267
- }
2268
- }
2269
- }
2270
- });
2271
- }
2272
-
2273
- export async function registerCommands(
2274
- program: Command,
2275
- commands: CommandDefinition[],
2276
- baseCtx: CommandContext
2277
- ): Promise<void> {
2278
- for (const cmdDef of commands) {
2279
- if (cmdDef.subcommands) {
2280
- const cmd = program
2281
- .command(cmdDef.name, { hidden: cmdDef.hidden })
2282
- .description(cmdDef.description);
2283
-
2284
- cmd.helpOption('-h, --help [json]', 'Display help (with optional JSON output)');
2285
-
2286
- if (cmdDef.aliases) {
2287
- cmd.aliases(cmdDef.aliases);
2288
- }
2289
-
2290
- // Add examples to help text (skip in JSON mode)
2291
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2292
- const examples = (cmdDef as any).examples as
2293
- | Array<{ command: string; description: string }>
2294
- | undefined;
2295
- if (examples && examples.length > 0) {
2296
- // Store examples for JSON help generation
2297
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2298
- (cmd as any)._examples = examples;
2299
-
2300
- // Add formatted examples to text help
2301
- cmd.addHelpText('after', () => {
2302
- // Skip examples in JSON mode
2303
- const args = process.argv.slice(2);
2304
- const helpIndex = args.findIndex((a) => a === '--help' || a === '-h');
2305
- if (helpIndex !== -1 && args[helpIndex + 1] === 'json') {
2306
- return '';
2307
- }
2308
-
2309
- const maxLength = Math.max(...examples.map((ex) => ex.command.length));
2310
- const formatted = examples.map((ex) => {
2311
- const padding = ' '.repeat(maxLength - ex.command.length + 1);
2312
- return ` ${tui.colorPrimary(ex.command)}${padding}${tui.muted('#')} ${tui.muted(ex.description)}`;
2313
- });
2314
- return `\n${tui.colorPrimary('\x1b[4mExamples:\x1b[24m')}\n` + formatted.join('\n');
2315
- });
2316
- }
2317
-
2318
- if (cmdDef.handler) {
2319
- cmd.action(async () => {
2320
- // Handle --describe mode: output command schema and exit
2321
- if (baseCtx.options.describe) {
2322
- const { extractCommandSchema } = await import('./schema-generator');
2323
- const schema = extractCommandSchema(cmdDef);
2324
- const { outputJSON } = await import('./output');
2325
- outputJSON(schema);
2326
- return;
2327
- }
2328
-
2329
- if (cmdDef.banner) {
2330
- showBanner();
2331
- }
2332
-
2333
- const normalized = normalizeReqs(cmdDef);
2334
- if (normalized.requiresAuth) {
2335
- // Create apiClient before requireAuth since login command needs it
2336
- if (normalized.requiresAPIClient) {
2337
- (baseCtx as Record<string, unknown>).apiClient = createAPIClient(
2338
- baseCtx,
2339
- baseCtx.config ?? null
2340
- );
2341
- }
2342
-
2343
- const auth = await requireAuth(baseCtx as CommandContext<undefined>);
2344
- const ctx: Record<string, unknown> = {
2345
- ...baseCtx,
2346
- config: baseCtx.config
2347
- ? {
2348
- ...baseCtx.config,
2349
- name: baseCtx.config.name ?? defaultProfileName,
2350
- auth: {
2351
- api_key: auth.apiKey,
2352
- user_id: auth.userId,
2353
- expires: auth.expires.getTime(),
2354
- },
2355
- }
2356
- : null,
2357
- auth,
2358
- };
2359
- if (normalized.requiresAPIClient) {
2360
- // Recreate apiClient with auth credentials
2361
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
2362
- }
2363
- if ((normalized.requiresRegion || normalized.optionalRegion) && ctx.apiClient) {
2364
- const apiClient: APIClientType = ctx.apiClient as APIClientType;
2365
- const regions = await tui.spinner({
2366
- message: 'Fetching cloud regions',
2367
- clearOnSuccess: true,
2368
- callback: async () => {
2369
- return fetchRegionsWithCache(
2370
- baseCtx.config?.name ?? defaultProfileName,
2371
- apiClient,
2372
- baseCtx.logger
2373
- );
2374
- },
2375
- });
2376
- const region = await resolveRegion({
2377
- options: baseCtx.options as unknown as Record<string, unknown>,
2378
- regions,
2379
- logger: baseCtx.logger,
2380
- required: !!normalized.requiresRegion,
2381
- config: baseCtx.config ?? null,
2382
- });
2383
- if (region) {
2384
- ctx.region = region;
2385
- }
2386
- }
2387
- await cmdDef.handler!(ctx as CommandContext);
2388
- } else if (normalized.optionalAuth) {
2389
- const continueText =
2390
- typeof normalized.optionalAuth === 'string'
2391
- ? normalized.optionalAuth
2392
- : undefined;
2393
-
2394
- // Create apiClient before optionalAuth since login command needs it
2395
- if (normalized.requiresAPIClient) {
2396
- (baseCtx as Record<string, unknown>).apiClient = createAPIClient(
2397
- baseCtx,
2398
- baseCtx.config ?? null
2399
- );
2400
- }
2401
-
2402
- const auth = await optionalAuth(
2403
- baseCtx as CommandContext<undefined>,
2404
- continueText
2405
- );
2406
- const ctx: Record<string, unknown> = {
2407
- ...baseCtx,
2408
- config: auth
2409
- ? baseCtx.config
2410
- ? {
2411
- ...baseCtx.config,
2412
- auth: {
2413
- api_key: auth.apiKey,
2414
- user_id: auth.userId,
2415
- expires: auth.expires.getTime(),
2416
- },
2417
- }
2418
- : {
2419
- auth: {
2420
- api_key: auth.apiKey,
2421
- user_id: auth.userId,
2422
- expires: auth.expires.getTime(),
2423
- },
2424
- }
2425
- : baseCtx.config,
2426
- auth,
2427
- };
2428
- if (normalized.requiresAPIClient) {
2429
- // Recreate apiClient with auth credentials if auth was provided
2430
- ctx.apiClient = createAPIClient(baseCtx, ctx.config as Config | null);
2431
- }
2432
- if ((normalized.requiresRegion || normalized.optionalRegion) && ctx.apiClient) {
2433
- const apiClient: APIClientType = ctx.apiClient as APIClientType;
2434
- const regions = await tui.spinner({
2435
- message: 'Fetching cloud regions',
2436
- clearOnSuccess: true,
2437
- callback: async () => {
2438
- return fetchRegionsWithCache(
2439
- baseCtx.config?.name ?? defaultProfileName,
2440
- apiClient,
2441
- baseCtx.logger
2442
- );
2443
- },
2444
- });
2445
- const region = await resolveRegion({
2446
- options: baseCtx.options as unknown as Record<string, unknown>,
2447
- regions,
2448
- logger: baseCtx.logger,
2449
- required: !!normalized.requiresRegion,
2450
- config: baseCtx.config ?? null,
2451
- });
2452
- if (region) {
2453
- ctx.region = region;
2454
- }
2455
- }
2456
- await cmdDef.handler!(ctx as CommandContext);
2457
- } else {
2458
- const ctx: Record<string, unknown> = {
2459
- ...baseCtx,
2460
- };
2461
- if (normalized.requiresAPIClient && !(ctx as CommandContext).apiClient) {
2462
- ctx.apiClient = createAPIClient(baseCtx, baseCtx.config);
2463
- }
2464
- if ((normalized.requiresRegion || normalized.optionalRegion) && ctx.apiClient) {
2465
- const apiClient = ctx.apiClient as APIClientType;
2466
- const regions = await tui.spinner({
2467
- message: 'Fetching cloud regions',
2468
- clearOnSuccess: true,
2469
- callback: async () => {
2470
- return fetchRegionsWithCache(
2471
- baseCtx.config?.name ?? defaultProfileName,
2472
- apiClient,
2473
- baseCtx.logger
2474
- );
2475
- },
2476
- });
2477
- const region = await resolveRegion({
2478
- options: baseCtx.options as unknown as Record<string, unknown>,
2479
- regions,
2480
- logger: baseCtx.logger,
2481
- required: !!normalized.requiresRegion,
2482
- config: baseCtx.config ?? null,
2483
- });
2484
- if (region) {
2485
- ctx.region = region;
2486
- }
2487
- }
2488
- await cmdDef.handler!(ctx as CommandContext);
2489
- }
2490
- });
2491
- } else {
2492
- cmd.action(() => cmd.help());
2493
- }
2494
-
2495
- for (const sub of cmdDef.subcommands) {
2496
- await registerSubcommand(cmd, sub, baseCtx);
2497
- }
2498
-
2499
- // Add a virtual 'help' subcommand for commands with subcommands
2500
- cmd.command('help', { hidden: true })
2501
- .description('Display help')
2502
- .action(() => {
2503
- cmd.help();
2504
- });
2505
- } else {
2506
- await registerSubcommand(
2507
- program,
2508
- cmdDef as unknown as SubcommandDefinition,
2509
- baseCtx,
2510
- cmdDef.hidden
2511
- );
2512
- }
2513
- }
2514
- }