dedalus-cli 0.0.0-stage → 0.7.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 (684) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +296 -2
  3. package/SKILL.md +73 -0
  4. package/api.md +340 -0
  5. package/dist/cjs/bin.d.ts +3 -0
  6. package/dist/cjs/bin.d.ts.map +1 -0
  7. package/dist/cjs/bin.js +7 -0
  8. package/dist/cjs/bin.js.map +1 -0
  9. package/dist/cjs/cli/completions.d.ts +6 -0
  10. package/dist/cjs/cli/completions.d.ts.map +1 -0
  11. package/dist/cjs/cli/completions.js +11 -0
  12. package/dist/cjs/cli/completions.js.map +1 -0
  13. package/dist/cjs/cli/credentials.d.ts +169 -0
  14. package/dist/cjs/cli/credentials.d.ts.map +1 -0
  15. package/dist/cjs/cli/credentials.js +630 -0
  16. package/dist/cjs/cli/credentials.js.map +1 -0
  17. package/dist/cjs/cli/keychain.d.ts +34 -0
  18. package/dist/cjs/cli/keychain.d.ts.map +1 -0
  19. package/dist/cjs/cli/keychain.js +246 -0
  20. package/dist/cjs/cli/keychain.js.map +1 -0
  21. package/dist/cjs/cli/list.d.ts +23 -0
  22. package/dist/cjs/cli/list.d.ts.map +1 -0
  23. package/dist/cjs/cli/list.js +32 -0
  24. package/dist/cjs/cli/list.js.map +1 -0
  25. package/dist/cjs/cli/login.d.ts +137 -0
  26. package/dist/cjs/cli/login.d.ts.map +1 -0
  27. package/dist/cjs/cli/login.js +2060 -0
  28. package/dist/cjs/cli/login.js.map +1 -0
  29. package/dist/cjs/cli/runtime.d.ts +98 -0
  30. package/dist/cjs/cli/runtime.d.ts.map +1 -0
  31. package/dist/cjs/cli/runtime.js +1356 -0
  32. package/dist/cjs/cli/runtime.js.map +1 -0
  33. package/dist/cjs/cli/toon.d.ts +6 -0
  34. package/dist/cjs/cli/toon.d.ts.map +1 -0
  35. package/dist/cjs/cli/toon.js +165 -0
  36. package/dist/cjs/cli/toon.js.map +1 -0
  37. package/dist/cjs/cli/upgrade.d.ts +28 -0
  38. package/dist/cjs/cli/upgrade.d.ts.map +1 -0
  39. package/dist/cjs/cli/upgrade.js +1191 -0
  40. package/dist/cjs/cli/upgrade.js.map +1 -0
  41. package/dist/cjs/commands/index.d.ts +47 -0
  42. package/dist/cjs/commands/index.d.ts.map +1 -0
  43. package/dist/cjs/commands/index.js +1202 -0
  44. package/dist/cjs/commands/index.js.map +1 -0
  45. package/dist/cjs/custom/browser-routing.d.ts +4 -0
  46. package/dist/cjs/custom/browser-routing.d.ts.map +1 -0
  47. package/dist/cjs/custom/browser-routing.js +51 -0
  48. package/dist/cjs/custom/browser-routing.js.map +1 -0
  49. package/dist/cjs/custom/images.d.ts +6 -0
  50. package/dist/cjs/custom/images.d.ts.map +1 -0
  51. package/dist/cjs/custom/images.js +74 -0
  52. package/dist/cjs/custom/images.js.map +1 -0
  53. package/dist/cjs/custom/machines.d.ts +20 -0
  54. package/dist/cjs/custom/machines.d.ts.map +1 -0
  55. package/dist/cjs/custom/machines.js +84 -0
  56. package/dist/cjs/custom/machines.js.map +1 -0
  57. package/dist/cjs/custom/ssh-picker.d.ts +19 -0
  58. package/dist/cjs/custom/ssh-picker.d.ts.map +1 -0
  59. package/dist/cjs/custom/ssh-picker.js +157 -0
  60. package/dist/cjs/custom/ssh-picker.js.map +1 -0
  61. package/dist/cjs/custom/ssh.d.ts +18 -0
  62. package/dist/cjs/custom/ssh.d.ts.map +1 -0
  63. package/dist/cjs/custom/ssh.js +152 -0
  64. package/dist/cjs/custom/ssh.js.map +1 -0
  65. package/dist/cjs/feedback/bundle.d.ts +41 -0
  66. package/dist/cjs/feedback/bundle.d.ts.map +1 -0
  67. package/dist/cjs/feedback/bundle.js +88 -0
  68. package/dist/cjs/feedback/bundle.js.map +1 -0
  69. package/dist/cjs/feedback/command.d.ts +6 -0
  70. package/dist/cjs/feedback/command.d.ts.map +1 -0
  71. package/dist/cjs/feedback/command.js +100 -0
  72. package/dist/cjs/feedback/command.js.map +1 -0
  73. package/dist/cjs/feedback/diagnostics.d.ts +30 -0
  74. package/dist/cjs/feedback/diagnostics.d.ts.map +1 -0
  75. package/dist/cjs/feedback/diagnostics.js +278 -0
  76. package/dist/cjs/feedback/diagnostics.js.map +1 -0
  77. package/dist/cjs/index.d.ts +4 -0
  78. package/dist/cjs/index.d.ts.map +1 -0
  79. package/dist/cjs/index.js +11 -0
  80. package/dist/cjs/index.js.map +1 -0
  81. package/dist/cjs/package.json +3 -0
  82. package/dist/cjs/sdk/api-promise.d.ts +31 -0
  83. package/dist/cjs/sdk/api-promise.d.ts.map +1 -0
  84. package/dist/cjs/sdk/api-promise.js +73 -0
  85. package/dist/cjs/sdk/api-promise.js.map +1 -0
  86. package/dist/cjs/sdk/client.d.ts +267 -0
  87. package/dist/cjs/sdk/client.d.ts.map +1 -0
  88. package/dist/cjs/sdk/client.js +965 -0
  89. package/dist/cjs/sdk/client.js.map +1 -0
  90. package/dist/cjs/sdk/core/api-promise.d.ts +3 -0
  91. package/dist/cjs/sdk/core/api-promise.d.ts.map +1 -0
  92. package/dist/cjs/sdk/core/api-promise.js +8 -0
  93. package/dist/cjs/sdk/core/api-promise.js.map +1 -0
  94. package/dist/cjs/sdk/core/error.d.ts +46 -0
  95. package/dist/cjs/sdk/core/error.d.ts.map +1 -0
  96. package/dist/cjs/sdk/core/error.js +135 -0
  97. package/dist/cjs/sdk/core/error.js.map +1 -0
  98. package/dist/cjs/sdk/core/pagination.d.ts +38 -0
  99. package/dist/cjs/sdk/core/pagination.d.ts.map +1 -0
  100. package/dist/cjs/sdk/core/pagination.js +98 -0
  101. package/dist/cjs/sdk/core/pagination.js.map +1 -0
  102. package/dist/cjs/sdk/core/resource.d.ts +2 -0
  103. package/dist/cjs/sdk/core/resource.d.ts.map +1 -0
  104. package/dist/cjs/sdk/core/resource.js +7 -0
  105. package/dist/cjs/sdk/core/resource.js.map +1 -0
  106. package/dist/cjs/sdk/core/uploads.d.ts +3 -0
  107. package/dist/cjs/sdk/core/uploads.d.ts.map +1 -0
  108. package/dist/cjs/sdk/core/uploads.js +7 -0
  109. package/dist/cjs/sdk/core/uploads.js.map +1 -0
  110. package/dist/cjs/sdk/error.d.ts +3 -0
  111. package/dist/cjs/sdk/error.d.ts.map +1 -0
  112. package/dist/cjs/sdk/error.js +20 -0
  113. package/dist/cjs/sdk/error.js.map +1 -0
  114. package/dist/cjs/sdk/helpers/images.d.ts +31 -0
  115. package/dist/cjs/sdk/helpers/images.d.ts.map +1 -0
  116. package/dist/cjs/sdk/helpers/images.js +195 -0
  117. package/dist/cjs/sdk/helpers/images.js.map +1 -0
  118. package/dist/cjs/sdk/index.d.ts +7 -0
  119. package/dist/cjs/sdk/index.d.ts.map +1 -0
  120. package/dist/cjs/sdk/index.js +29 -0
  121. package/dist/cjs/sdk/index.js.map +1 -0
  122. package/dist/cjs/sdk/internal/builtin-types.d.ts +73 -0
  123. package/dist/cjs/sdk/internal/builtin-types.d.ts.map +1 -0
  124. package/dist/cjs/sdk/internal/builtin-types.js +4 -0
  125. package/dist/cjs/sdk/internal/builtin-types.js.map +1 -0
  126. package/dist/cjs/sdk/internal/detect-platform.d.ts +15 -0
  127. package/dist/cjs/sdk/internal/detect-platform.d.ts.map +1 -0
  128. package/dist/cjs/sdk/internal/detect-platform.js +185 -0
  129. package/dist/cjs/sdk/internal/detect-platform.js.map +1 -0
  130. package/dist/cjs/sdk/internal/errors.d.ts +3 -0
  131. package/dist/cjs/sdk/internal/errors.d.ts.map +1 -0
  132. package/dist/cjs/sdk/internal/errors.js +41 -0
  133. package/dist/cjs/sdk/internal/errors.js.map +1 -0
  134. package/dist/cjs/sdk/internal/headers.d.ts +43 -0
  135. package/dist/cjs/sdk/internal/headers.d.ts.map +1 -0
  136. package/dist/cjs/sdk/internal/headers.js +142 -0
  137. package/dist/cjs/sdk/internal/headers.js.map +1 -0
  138. package/dist/cjs/sdk/internal/parse.d.ts +3 -0
  139. package/dist/cjs/sdk/internal/parse.d.ts.map +1 -0
  140. package/dist/cjs/sdk/internal/parse.js +7 -0
  141. package/dist/cjs/sdk/internal/parse.js.map +1 -0
  142. package/dist/cjs/sdk/internal/qs/formats.d.ts +7 -0
  143. package/dist/cjs/sdk/internal/qs/formats.d.ts.map +1 -0
  144. package/dist/cjs/sdk/internal/qs/formats.js +13 -0
  145. package/dist/cjs/sdk/internal/qs/formats.js.map +1 -0
  146. package/dist/cjs/sdk/internal/qs/index.d.ts +10 -0
  147. package/dist/cjs/sdk/internal/qs/index.d.ts.map +1 -0
  148. package/dist/cjs/sdk/internal/qs/index.js +14 -0
  149. package/dist/cjs/sdk/internal/qs/index.js.map +1 -0
  150. package/dist/cjs/sdk/internal/qs/stringify.d.ts +3 -0
  151. package/dist/cjs/sdk/internal/qs/stringify.d.ts.map +1 -0
  152. package/dist/cjs/sdk/internal/qs/stringify.js +278 -0
  153. package/dist/cjs/sdk/internal/qs/stringify.js.map +1 -0
  154. package/dist/cjs/sdk/internal/qs/types.d.ts +57 -0
  155. package/dist/cjs/sdk/internal/qs/types.d.ts.map +1 -0
  156. package/dist/cjs/sdk/internal/qs/types.js +3 -0
  157. package/dist/cjs/sdk/internal/qs/types.js.map +1 -0
  158. package/dist/cjs/sdk/internal/qs/utils.d.ts +15 -0
  159. package/dist/cjs/sdk/internal/qs/utils.d.ts.map +1 -0
  160. package/dist/cjs/sdk/internal/qs/utils.js +230 -0
  161. package/dist/cjs/sdk/internal/qs/utils.js.map +1 -0
  162. package/dist/cjs/sdk/internal/request-options.d.ts +33 -0
  163. package/dist/cjs/sdk/internal/request-options.d.ts.map +1 -0
  164. package/dist/cjs/sdk/internal/request-options.js +15 -0
  165. package/dist/cjs/sdk/internal/request-options.js.map +1 -0
  166. package/dist/cjs/sdk/internal/shim-types.d.ts +17 -0
  167. package/dist/cjs/sdk/internal/shim-types.d.ts.map +1 -0
  168. package/dist/cjs/sdk/internal/shim-types.js +4 -0
  169. package/dist/cjs/sdk/internal/shim-types.js.map +1 -0
  170. package/dist/cjs/sdk/internal/shims.d.ts +26 -0
  171. package/dist/cjs/sdk/internal/shims.d.ts.map +1 -0
  172. package/dist/cjs/sdk/internal/shims.js +92 -0
  173. package/dist/cjs/sdk/internal/shims.js.map +1 -0
  174. package/dist/cjs/sdk/internal/to-file.d.ts +45 -0
  175. package/dist/cjs/sdk/internal/to-file.d.ts.map +1 -0
  176. package/dist/cjs/sdk/internal/to-file.js +91 -0
  177. package/dist/cjs/sdk/internal/to-file.js.map +1 -0
  178. package/dist/cjs/sdk/internal/types.d.ts +63 -0
  179. package/dist/cjs/sdk/internal/types.d.ts.map +1 -0
  180. package/dist/cjs/sdk/internal/types.js +4 -0
  181. package/dist/cjs/sdk/internal/types.js.map +1 -0
  182. package/dist/cjs/sdk/internal/uploads.d.ts +42 -0
  183. package/dist/cjs/sdk/internal/uploads.d.ts.map +1 -0
  184. package/dist/cjs/sdk/internal/uploads.js +158 -0
  185. package/dist/cjs/sdk/internal/uploads.js.map +1 -0
  186. package/dist/cjs/sdk/internal/utils/base64.d.ts +3 -0
  187. package/dist/cjs/sdk/internal/utils/base64.d.ts.map +1 -0
  188. package/dist/cjs/sdk/internal/utils/base64.js +38 -0
  189. package/dist/cjs/sdk/internal/utils/base64.js.map +1 -0
  190. package/dist/cjs/sdk/internal/utils/body.d.ts +40 -0
  191. package/dist/cjs/sdk/internal/utils/body.d.ts.map +1 -0
  192. package/dist/cjs/sdk/internal/utils/body.js +148 -0
  193. package/dist/cjs/sdk/internal/utils/body.js.map +1 -0
  194. package/dist/cjs/sdk/internal/utils/bytes.d.ts +4 -0
  195. package/dist/cjs/sdk/internal/utils/bytes.d.ts.map +1 -0
  196. package/dist/cjs/sdk/internal/utils/bytes.js +31 -0
  197. package/dist/cjs/sdk/internal/utils/bytes.js.map +1 -0
  198. package/dist/cjs/sdk/internal/utils/env.d.ts +9 -0
  199. package/dist/cjs/sdk/internal/utils/env.d.ts.map +1 -0
  200. package/dist/cjs/sdk/internal/utils/env.js +22 -0
  201. package/dist/cjs/sdk/internal/utils/env.js.map +1 -0
  202. package/dist/cjs/sdk/internal/utils/log.d.ts +52 -0
  203. package/dist/cjs/sdk/internal/utils/log.d.ts.map +1 -0
  204. package/dist/cjs/sdk/internal/utils/log.js +413 -0
  205. package/dist/cjs/sdk/internal/utils/log.js.map +1 -0
  206. package/dist/cjs/sdk/internal/utils/path.d.ts +41 -0
  207. package/dist/cjs/sdk/internal/utils/path.d.ts.map +1 -0
  208. package/dist/cjs/sdk/internal/utils/path.js +115 -0
  209. package/dist/cjs/sdk/internal/utils/path.js.map +1 -0
  210. package/dist/cjs/sdk/internal/utils/query-string.d.ts +21 -0
  211. package/dist/cjs/sdk/internal/utils/query-string.d.ts.map +1 -0
  212. package/dist/cjs/sdk/internal/utils/query-string.js +128 -0
  213. package/dist/cjs/sdk/internal/utils/query-string.js.map +1 -0
  214. package/dist/cjs/sdk/internal/utils/query.d.ts +2 -0
  215. package/dist/cjs/sdk/internal/utils/query.d.ts.map +1 -0
  216. package/dist/cjs/sdk/internal/utils/query.js +12 -0
  217. package/dist/cjs/sdk/internal/utils/query.js.map +1 -0
  218. package/dist/cjs/sdk/internal/utils/sleep.d.ts +2 -0
  219. package/dist/cjs/sdk/internal/utils/sleep.d.ts.map +1 -0
  220. package/dist/cjs/sdk/internal/utils/sleep.js +7 -0
  221. package/dist/cjs/sdk/internal/utils/sleep.js.map +1 -0
  222. package/dist/cjs/sdk/internal/utils/uuid.d.ts +5 -0
  223. package/dist/cjs/sdk/internal/utils/uuid.d.ts.map +1 -0
  224. package/dist/cjs/sdk/internal/utils/uuid.js +19 -0
  225. package/dist/cjs/sdk/internal/utils/uuid.js.map +1 -0
  226. package/dist/cjs/sdk/internal/utils/values.d.ts +18 -0
  227. package/dist/cjs/sdk/internal/utils/values.d.ts.map +1 -0
  228. package/dist/cjs/sdk/internal/utils/values.js +112 -0
  229. package/dist/cjs/sdk/internal/utils/values.js.map +1 -0
  230. package/dist/cjs/sdk/internal/utils.d.ts +8 -0
  231. package/dist/cjs/sdk/internal/utils.d.ts.map +1 -0
  232. package/dist/cjs/sdk/internal/utils.js +25 -0
  233. package/dist/cjs/sdk/internal/utils.js.map +1 -0
  234. package/dist/cjs/sdk/pagination.d.ts +3 -0
  235. package/dist/cjs/sdk/pagination.d.ts.map +1 -0
  236. package/dist/cjs/sdk/pagination.js +20 -0
  237. package/dist/cjs/sdk/pagination.js.map +1 -0
  238. package/dist/cjs/sdk/resource.d.ts +6 -0
  239. package/dist/cjs/sdk/resource.d.ts.map +1 -0
  240. package/dist/cjs/sdk/resource.js +12 -0
  241. package/dist/cjs/sdk/resource.js.map +1 -0
  242. package/dist/cjs/sdk/resources/images/images.d.ts +202 -0
  243. package/dist/cjs/sdk/resources/images/images.d.ts.map +1 -0
  244. package/dist/cjs/sdk/resources/images/images.js +139 -0
  245. package/dist/cjs/sdk/resources/images/images.js.map +1 -0
  246. package/dist/cjs/sdk/resources/images/index.d.ts +5 -0
  247. package/dist/cjs/sdk/resources/images/index.d.ts.map +1 -0
  248. package/dist/cjs/sdk/resources/images/index.js +9 -0
  249. package/dist/cjs/sdk/resources/images/index.js.map +1 -0
  250. package/dist/cjs/sdk/resources/images/uploads.d.ts +50 -0
  251. package/dist/cjs/sdk/resources/images/uploads.d.ts.map +1 -0
  252. package/dist/cjs/sdk/resources/images/uploads.js +28 -0
  253. package/dist/cjs/sdk/resources/images/uploads.js.map +1 -0
  254. package/dist/cjs/sdk/resources/images.d.ts +2 -0
  255. package/dist/cjs/sdk/resources/images.d.ts.map +1 -0
  256. package/dist/cjs/sdk/resources/images.js +19 -0
  257. package/dist/cjs/sdk/resources/images.js.map +1 -0
  258. package/dist/cjs/sdk/resources/index.d.ts +6 -0
  259. package/dist/cjs/sdk/resources/index.d.ts.map +1 -0
  260. package/dist/cjs/sdk/resources/index.js +11 -0
  261. package/dist/cjs/sdk/resources/index.js.map +1 -0
  262. package/dist/cjs/sdk/resources/machines/autoresizing.d.ts +115 -0
  263. package/dist/cjs/sdk/resources/machines/autoresizing.d.ts.map +1 -0
  264. package/dist/cjs/sdk/resources/machines/autoresizing.js +46 -0
  265. package/dist/cjs/sdk/resources/machines/autoresizing.js.map +1 -0
  266. package/dist/cjs/sdk/resources/machines/executions/executions.d.ts +341 -0
  267. package/dist/cjs/sdk/resources/machines/executions/executions.d.ts.map +1 -0
  268. package/dist/cjs/sdk/resources/machines/executions/executions.js +161 -0
  269. package/dist/cjs/sdk/resources/machines/executions/executions.js.map +1 -0
  270. package/dist/cjs/sdk/resources/machines/executions/index.d.ts +5 -0
  271. package/dist/cjs/sdk/resources/machines/executions/index.d.ts.map +1 -0
  272. package/dist/cjs/sdk/resources/machines/executions/index.js +9 -0
  273. package/dist/cjs/sdk/resources/machines/executions/index.js.map +1 -0
  274. package/dist/cjs/sdk/resources/machines/executions/logs.d.ts +103 -0
  275. package/dist/cjs/sdk/resources/machines/executions/logs.d.ts.map +1 -0
  276. package/dist/cjs/sdk/resources/machines/executions/logs.js +48 -0
  277. package/dist/cjs/sdk/resources/machines/executions/logs.js.map +1 -0
  278. package/dist/cjs/sdk/resources/machines/executions.d.ts +2 -0
  279. package/dist/cjs/sdk/resources/machines/executions.d.ts.map +1 -0
  280. package/dist/cjs/sdk/resources/machines/executions.js +19 -0
  281. package/dist/cjs/sdk/resources/machines/executions.js.map +1 -0
  282. package/dist/cjs/sdk/resources/machines/index.d.ts +9 -0
  283. package/dist/cjs/sdk/resources/machines/index.d.ts.map +1 -0
  284. package/dist/cjs/sdk/resources/machines/index.js +13 -0
  285. package/dist/cjs/sdk/resources/machines/index.js.map +1 -0
  286. package/dist/cjs/sdk/resources/machines/machines.d.ts +496 -0
  287. package/dist/cjs/sdk/resources/machines/machines.d.ts.map +1 -0
  288. package/dist/cjs/sdk/resources/machines/machines.js +220 -0
  289. package/dist/cjs/sdk/resources/machines/machines.js.map +1 -0
  290. package/dist/cjs/sdk/resources/machines/ssh.d.ts +175 -0
  291. package/dist/cjs/sdk/resources/machines/ssh.d.ts.map +1 -0
  292. package/dist/cjs/sdk/resources/machines/ssh.js +89 -0
  293. package/dist/cjs/sdk/resources/machines/ssh.js.map +1 -0
  294. package/dist/cjs/sdk/resources/machines.d.ts +2 -0
  295. package/dist/cjs/sdk/resources/machines.d.ts.map +1 -0
  296. package/dist/cjs/sdk/resources/machines.js +19 -0
  297. package/dist/cjs/sdk/resources/machines.js.map +1 -0
  298. package/dist/cjs/sdk/resources/organization/autoresizing.d.ts +86 -0
  299. package/dist/cjs/sdk/resources/organization/autoresizing.d.ts.map +1 -0
  300. package/dist/cjs/sdk/resources/organization/autoresizing.js +38 -0
  301. package/dist/cjs/sdk/resources/organization/autoresizing.js.map +1 -0
  302. package/dist/cjs/sdk/resources/organization/index.d.ts +4 -0
  303. package/dist/cjs/sdk/resources/organization/index.d.ts.map +1 -0
  304. package/dist/cjs/sdk/resources/organization/index.js +9 -0
  305. package/dist/cjs/sdk/resources/organization/index.js.map +1 -0
  306. package/dist/cjs/sdk/resources/organization/organization.d.ts +10 -0
  307. package/dist/cjs/sdk/resources/organization/organization.d.ts.map +1 -0
  308. package/dist/cjs/sdk/resources/organization/organization.js +46 -0
  309. package/dist/cjs/sdk/resources/organization/organization.js.map +1 -0
  310. package/dist/cjs/sdk/resources/organization.d.ts +2 -0
  311. package/dist/cjs/sdk/resources/organization.d.ts.map +1 -0
  312. package/dist/cjs/sdk/resources/organization.js +19 -0
  313. package/dist/cjs/sdk/resources/organization.js.map +1 -0
  314. package/dist/cjs/sdk/resources.d.ts +3 -0
  315. package/dist/cjs/sdk/resources.d.ts.map +1 -0
  316. package/dist/cjs/sdk/resources.js +9 -0
  317. package/dist/cjs/sdk/resources.js.map +1 -0
  318. package/dist/cjs/sdk/uploads.d.ts +2 -0
  319. package/dist/cjs/sdk/uploads.d.ts.map +1 -0
  320. package/dist/cjs/sdk/uploads.js +7 -0
  321. package/dist/cjs/sdk/uploads.js.map +1 -0
  322. package/dist/cjs/sdk/version.d.ts +2 -0
  323. package/dist/cjs/sdk/version.d.ts.map +1 -0
  324. package/dist/cjs/sdk/version.js +6 -0
  325. package/dist/cjs/sdk/version.js.map +1 -0
  326. package/dist/esm/bin.d.ts +3 -0
  327. package/dist/esm/bin.d.ts.map +1 -0
  328. package/dist/esm/bin.js +5 -0
  329. package/dist/esm/bin.js.map +1 -0
  330. package/dist/esm/cli/completions.d.ts +6 -0
  331. package/dist/esm/cli/completions.d.ts.map +1 -0
  332. package/dist/esm/cli/completions.js +8 -0
  333. package/dist/esm/cli/completions.js.map +1 -0
  334. package/dist/esm/cli/credentials.d.ts +169 -0
  335. package/dist/esm/cli/credentials.d.ts.map +1 -0
  336. package/dist/esm/cli/credentials.js +614 -0
  337. package/dist/esm/cli/credentials.js.map +1 -0
  338. package/dist/esm/cli/keychain.d.ts +34 -0
  339. package/dist/esm/cli/keychain.d.ts.map +1 -0
  340. package/dist/esm/cli/keychain.js +237 -0
  341. package/dist/esm/cli/keychain.js.map +1 -0
  342. package/dist/esm/cli/list.d.ts +23 -0
  343. package/dist/esm/cli/list.d.ts.map +1 -0
  344. package/dist/esm/cli/list.js +27 -0
  345. package/dist/esm/cli/list.js.map +1 -0
  346. package/dist/esm/cli/login.d.ts +137 -0
  347. package/dist/esm/cli/login.d.ts.map +1 -0
  348. package/dist/esm/cli/login.js +2053 -0
  349. package/dist/esm/cli/login.js.map +1 -0
  350. package/dist/esm/cli/runtime.d.ts +98 -0
  351. package/dist/esm/cli/runtime.d.ts.map +1 -0
  352. package/dist/esm/cli/runtime.js +1345 -0
  353. package/dist/esm/cli/runtime.js.map +1 -0
  354. package/dist/esm/cli/toon.d.ts +6 -0
  355. package/dist/esm/cli/toon.d.ts.map +1 -0
  356. package/dist/esm/cli/toon.js +161 -0
  357. package/dist/esm/cli/toon.js.map +1 -0
  358. package/dist/esm/cli/upgrade.d.ts +28 -0
  359. package/dist/esm/cli/upgrade.d.ts.map +1 -0
  360. package/dist/esm/cli/upgrade.js +1186 -0
  361. package/dist/esm/cli/upgrade.js.map +1 -0
  362. package/dist/esm/commands/index.d.ts +47 -0
  363. package/dist/esm/commands/index.d.ts.map +1 -0
  364. package/dist/esm/commands/index.js +1195 -0
  365. package/dist/esm/commands/index.js.map +1 -0
  366. package/dist/esm/custom/browser-routing.d.ts +4 -0
  367. package/dist/esm/custom/browser-routing.d.ts.map +1 -0
  368. package/dist/esm/custom/browser-routing.js +47 -0
  369. package/dist/esm/custom/browser-routing.js.map +1 -0
  370. package/dist/esm/custom/images.d.ts +6 -0
  371. package/dist/esm/custom/images.d.ts.map +1 -0
  372. package/dist/esm/custom/images.js +68 -0
  373. package/dist/esm/custom/images.js.map +1 -0
  374. package/dist/esm/custom/machines.d.ts +20 -0
  375. package/dist/esm/custom/machines.d.ts.map +1 -0
  376. package/dist/esm/custom/machines.js +76 -0
  377. package/dist/esm/custom/machines.js.map +1 -0
  378. package/dist/esm/custom/ssh-picker.d.ts +19 -0
  379. package/dist/esm/custom/ssh-picker.d.ts.map +1 -0
  380. package/dist/esm/custom/ssh-picker.js +149 -0
  381. package/dist/esm/custom/ssh-picker.js.map +1 -0
  382. package/dist/esm/custom/ssh.d.ts +18 -0
  383. package/dist/esm/custom/ssh.d.ts.map +1 -0
  384. package/dist/esm/custom/ssh.js +147 -0
  385. package/dist/esm/custom/ssh.js.map +1 -0
  386. package/dist/esm/feedback/bundle.d.ts +41 -0
  387. package/dist/esm/feedback/bundle.d.ts.map +1 -0
  388. package/dist/esm/feedback/bundle.js +83 -0
  389. package/dist/esm/feedback/bundle.js.map +1 -0
  390. package/dist/esm/feedback/command.d.ts +6 -0
  391. package/dist/esm/feedback/command.d.ts.map +1 -0
  392. package/dist/esm/feedback/command.js +92 -0
  393. package/dist/esm/feedback/command.js.map +1 -0
  394. package/dist/esm/feedback/diagnostics.d.ts +30 -0
  395. package/dist/esm/feedback/diagnostics.d.ts.map +1 -0
  396. package/dist/esm/feedback/diagnostics.js +270 -0
  397. package/dist/esm/feedback/diagnostics.js.map +1 -0
  398. package/dist/esm/index.d.ts +4 -0
  399. package/dist/esm/index.d.ts.map +1 -0
  400. package/dist/esm/index.js +7 -0
  401. package/dist/esm/index.js.map +1 -0
  402. package/dist/esm/sdk/api-promise.d.ts +31 -0
  403. package/dist/esm/sdk/api-promise.d.ts.map +1 -0
  404. package/dist/esm/sdk/api-promise.js +68 -0
  405. package/dist/esm/sdk/api-promise.js.map +1 -0
  406. package/dist/esm/sdk/client.d.ts +267 -0
  407. package/dist/esm/sdk/client.d.ts.map +1 -0
  408. package/dist/esm/sdk/client.js +928 -0
  409. package/dist/esm/sdk/client.js.map +1 -0
  410. package/dist/esm/sdk/core/api-promise.d.ts +3 -0
  411. package/dist/esm/sdk/core/api-promise.d.ts.map +1 -0
  412. package/dist/esm/sdk/core/api-promise.js +3 -0
  413. package/dist/esm/sdk/core/api-promise.js.map +1 -0
  414. package/dist/esm/sdk/core/error.d.ts +46 -0
  415. package/dist/esm/sdk/core/error.d.ts.map +1 -0
  416. package/dist/esm/sdk/core/error.js +119 -0
  417. package/dist/esm/sdk/core/error.js.map +1 -0
  418. package/dist/esm/sdk/core/pagination.d.ts +38 -0
  419. package/dist/esm/sdk/core/pagination.d.ts.map +1 -0
  420. package/dist/esm/sdk/core/pagination.js +92 -0
  421. package/dist/esm/sdk/core/pagination.js.map +1 -0
  422. package/dist/esm/sdk/core/resource.d.ts +2 -0
  423. package/dist/esm/sdk/core/resource.d.ts.map +1 -0
  424. package/dist/esm/sdk/core/resource.js +3 -0
  425. package/dist/esm/sdk/core/resource.js.map +1 -0
  426. package/dist/esm/sdk/core/uploads.d.ts +3 -0
  427. package/dist/esm/sdk/core/uploads.d.ts.map +1 -0
  428. package/dist/esm/sdk/core/uploads.js +3 -0
  429. package/dist/esm/sdk/core/uploads.js.map +1 -0
  430. package/dist/esm/sdk/error.d.ts +3 -0
  431. package/dist/esm/sdk/error.d.ts.map +1 -0
  432. package/dist/esm/sdk/error.js +4 -0
  433. package/dist/esm/sdk/error.js.map +1 -0
  434. package/dist/esm/sdk/helpers/images.d.ts +31 -0
  435. package/dist/esm/sdk/helpers/images.d.ts.map +1 -0
  436. package/dist/esm/sdk/helpers/images.js +189 -0
  437. package/dist/esm/sdk/helpers/images.js.map +1 -0
  438. package/dist/esm/sdk/index.d.ts +7 -0
  439. package/dist/esm/sdk/index.d.ts.map +1 -0
  440. package/dist/esm/sdk/index.js +8 -0
  441. package/dist/esm/sdk/index.js.map +1 -0
  442. package/dist/esm/sdk/internal/builtin-types.d.ts +73 -0
  443. package/dist/esm/sdk/internal/builtin-types.d.ts.map +1 -0
  444. package/dist/esm/sdk/internal/builtin-types.js +3 -0
  445. package/dist/esm/sdk/internal/builtin-types.js.map +1 -0
  446. package/dist/esm/sdk/internal/detect-platform.d.ts +15 -0
  447. package/dist/esm/sdk/internal/detect-platform.d.ts.map +1 -0
  448. package/dist/esm/sdk/internal/detect-platform.js +180 -0
  449. package/dist/esm/sdk/internal/detect-platform.js.map +1 -0
  450. package/dist/esm/sdk/internal/errors.d.ts +3 -0
  451. package/dist/esm/sdk/internal/errors.d.ts.map +1 -0
  452. package/dist/esm/sdk/internal/errors.js +36 -0
  453. package/dist/esm/sdk/internal/errors.js.map +1 -0
  454. package/dist/esm/sdk/internal/headers.d.ts +43 -0
  455. package/dist/esm/sdk/internal/headers.d.ts.map +1 -0
  456. package/dist/esm/sdk/internal/headers.js +133 -0
  457. package/dist/esm/sdk/internal/headers.js.map +1 -0
  458. package/dist/esm/sdk/internal/parse.d.ts +3 -0
  459. package/dist/esm/sdk/internal/parse.d.ts.map +1 -0
  460. package/dist/esm/sdk/internal/parse.js +3 -0
  461. package/dist/esm/sdk/internal/parse.js.map +1 -0
  462. package/dist/esm/sdk/internal/qs/formats.d.ts +7 -0
  463. package/dist/esm/sdk/internal/qs/formats.d.ts.map +1 -0
  464. package/dist/esm/sdk/internal/qs/formats.js +9 -0
  465. package/dist/esm/sdk/internal/qs/formats.js.map +1 -0
  466. package/dist/esm/sdk/internal/qs/index.d.ts +10 -0
  467. package/dist/esm/sdk/internal/qs/index.d.ts.map +1 -0
  468. package/dist/esm/sdk/internal/qs/index.js +10 -0
  469. package/dist/esm/sdk/internal/qs/index.js.map +1 -0
  470. package/dist/esm/sdk/internal/qs/stringify.d.ts +3 -0
  471. package/dist/esm/sdk/internal/qs/stringify.d.ts.map +1 -0
  472. package/dist/esm/sdk/internal/qs/stringify.js +275 -0
  473. package/dist/esm/sdk/internal/qs/stringify.js.map +1 -0
  474. package/dist/esm/sdk/internal/qs/types.d.ts +57 -0
  475. package/dist/esm/sdk/internal/qs/types.d.ts.map +1 -0
  476. package/dist/esm/sdk/internal/qs/types.js +2 -0
  477. package/dist/esm/sdk/internal/qs/types.js.map +1 -0
  478. package/dist/esm/sdk/internal/qs/utils.d.ts +15 -0
  479. package/dist/esm/sdk/internal/qs/utils.d.ts.map +1 -0
  480. package/dist/esm/sdk/internal/qs/utils.js +217 -0
  481. package/dist/esm/sdk/internal/qs/utils.js.map +1 -0
  482. package/dist/esm/sdk/internal/request-options.d.ts +33 -0
  483. package/dist/esm/sdk/internal/request-options.d.ts.map +1 -0
  484. package/dist/esm/sdk/internal/request-options.js +11 -0
  485. package/dist/esm/sdk/internal/request-options.js.map +1 -0
  486. package/dist/esm/sdk/internal/shim-types.d.ts +17 -0
  487. package/dist/esm/sdk/internal/shim-types.d.ts.map +1 -0
  488. package/dist/esm/sdk/internal/shim-types.js +3 -0
  489. package/dist/esm/sdk/internal/shim-types.js.map +1 -0
  490. package/dist/esm/sdk/internal/shims.d.ts +26 -0
  491. package/dist/esm/sdk/internal/shims.d.ts.map +1 -0
  492. package/dist/esm/sdk/internal/shims.js +85 -0
  493. package/dist/esm/sdk/internal/shims.js.map +1 -0
  494. package/dist/esm/sdk/internal/to-file.d.ts +45 -0
  495. package/dist/esm/sdk/internal/to-file.d.ts.map +1 -0
  496. package/dist/esm/sdk/internal/to-file.js +88 -0
  497. package/dist/esm/sdk/internal/to-file.js.map +1 -0
  498. package/dist/esm/sdk/internal/types.d.ts +63 -0
  499. package/dist/esm/sdk/internal/types.d.ts.map +1 -0
  500. package/dist/esm/sdk/internal/types.js +3 -0
  501. package/dist/esm/sdk/internal/types.js.map +1 -0
  502. package/dist/esm/sdk/internal/uploads.d.ts +42 -0
  503. package/dist/esm/sdk/internal/uploads.d.ts.map +1 -0
  504. package/dist/esm/sdk/internal/uploads.js +148 -0
  505. package/dist/esm/sdk/internal/uploads.js.map +1 -0
  506. package/dist/esm/sdk/internal/utils/base64.d.ts +3 -0
  507. package/dist/esm/sdk/internal/utils/base64.d.ts.map +1 -0
  508. package/dist/esm/sdk/internal/utils/base64.js +33 -0
  509. package/dist/esm/sdk/internal/utils/base64.js.map +1 -0
  510. package/dist/esm/sdk/internal/utils/body.d.ts +40 -0
  511. package/dist/esm/sdk/internal/utils/body.d.ts.map +1 -0
  512. package/dist/esm/sdk/internal/utils/body.js +140 -0
  513. package/dist/esm/sdk/internal/utils/body.js.map +1 -0
  514. package/dist/esm/sdk/internal/utils/bytes.d.ts +4 -0
  515. package/dist/esm/sdk/internal/utils/bytes.d.ts.map +1 -0
  516. package/dist/esm/sdk/internal/utils/bytes.js +26 -0
  517. package/dist/esm/sdk/internal/utils/bytes.js.map +1 -0
  518. package/dist/esm/sdk/internal/utils/env.d.ts +9 -0
  519. package/dist/esm/sdk/internal/utils/env.d.ts.map +1 -0
  520. package/dist/esm/sdk/internal/utils/env.js +18 -0
  521. package/dist/esm/sdk/internal/utils/env.js.map +1 -0
  522. package/dist/esm/sdk/internal/utils/log.d.ts +52 -0
  523. package/dist/esm/sdk/internal/utils/log.d.ts.map +1 -0
  524. package/dist/esm/sdk/internal/utils/log.js +405 -0
  525. package/dist/esm/sdk/internal/utils/log.js.map +1 -0
  526. package/dist/esm/sdk/internal/utils/path.d.ts +41 -0
  527. package/dist/esm/sdk/internal/utils/path.d.ts.map +1 -0
  528. package/dist/esm/sdk/internal/utils/path.js +108 -0
  529. package/dist/esm/sdk/internal/utils/path.js.map +1 -0
  530. package/dist/esm/sdk/internal/utils/query-string.d.ts +21 -0
  531. package/dist/esm/sdk/internal/utils/query-string.d.ts.map +1 -0
  532. package/dist/esm/sdk/internal/utils/query-string.js +125 -0
  533. package/dist/esm/sdk/internal/utils/query-string.js.map +1 -0
  534. package/dist/esm/sdk/internal/utils/query.d.ts +2 -0
  535. package/dist/esm/sdk/internal/utils/query.d.ts.map +1 -0
  536. package/dist/esm/sdk/internal/utils/query.js +9 -0
  537. package/dist/esm/sdk/internal/utils/query.js.map +1 -0
  538. package/dist/esm/sdk/internal/utils/sleep.d.ts +2 -0
  539. package/dist/esm/sdk/internal/utils/sleep.d.ts.map +1 -0
  540. package/dist/esm/sdk/internal/utils/sleep.js +3 -0
  541. package/dist/esm/sdk/internal/utils/sleep.js.map +1 -0
  542. package/dist/esm/sdk/internal/utils/uuid.d.ts +5 -0
  543. package/dist/esm/sdk/internal/utils/uuid.d.ts.map +1 -0
  544. package/dist/esm/sdk/internal/utils/uuid.js +15 -0
  545. package/dist/esm/sdk/internal/utils/uuid.js.map +1 -0
  546. package/dist/esm/sdk/internal/utils/values.d.ts +18 -0
  547. package/dist/esm/sdk/internal/utils/values.d.ts.map +1 -0
  548. package/dist/esm/sdk/internal/utils/values.js +94 -0
  549. package/dist/esm/sdk/internal/utils/values.js.map +1 -0
  550. package/dist/esm/sdk/internal/utils.d.ts +8 -0
  551. package/dist/esm/sdk/internal/utils.d.ts.map +1 -0
  552. package/dist/esm/sdk/internal/utils.js +9 -0
  553. package/dist/esm/sdk/internal/utils.js.map +1 -0
  554. package/dist/esm/sdk/pagination.d.ts +3 -0
  555. package/dist/esm/sdk/pagination.d.ts.map +1 -0
  556. package/dist/esm/sdk/pagination.js +4 -0
  557. package/dist/esm/sdk/pagination.js.map +1 -0
  558. package/dist/esm/sdk/resource.d.ts +6 -0
  559. package/dist/esm/sdk/resource.d.ts.map +1 -0
  560. package/dist/esm/sdk/resource.js +8 -0
  561. package/dist/esm/sdk/resource.js.map +1 -0
  562. package/dist/esm/sdk/resources/images/images.d.ts +202 -0
  563. package/dist/esm/sdk/resources/images/images.d.ts.map +1 -0
  564. package/dist/esm/sdk/resources/images/images.js +102 -0
  565. package/dist/esm/sdk/resources/images/images.js.map +1 -0
  566. package/dist/esm/sdk/resources/images/index.d.ts +5 -0
  567. package/dist/esm/sdk/resources/images/index.d.ts.map +1 -0
  568. package/dist/esm/sdk/resources/images/index.js +4 -0
  569. package/dist/esm/sdk/resources/images/index.js.map +1 -0
  570. package/dist/esm/sdk/resources/images/uploads.d.ts +50 -0
  571. package/dist/esm/sdk/resources/images/uploads.d.ts.map +1 -0
  572. package/dist/esm/sdk/resources/images/uploads.js +24 -0
  573. package/dist/esm/sdk/resources/images/uploads.js.map +1 -0
  574. package/dist/esm/sdk/resources/images.d.ts +2 -0
  575. package/dist/esm/sdk/resources/images.d.ts.map +1 -0
  576. package/dist/esm/sdk/resources/images.js +3 -0
  577. package/dist/esm/sdk/resources/images.js.map +1 -0
  578. package/dist/esm/sdk/resources/index.d.ts +6 -0
  579. package/dist/esm/sdk/resources/index.d.ts.map +1 -0
  580. package/dist/esm/sdk/resources/index.js +5 -0
  581. package/dist/esm/sdk/resources/index.js.map +1 -0
  582. package/dist/esm/sdk/resources/machines/autoresizing.d.ts +115 -0
  583. package/dist/esm/sdk/resources/machines/autoresizing.d.ts.map +1 -0
  584. package/dist/esm/sdk/resources/machines/autoresizing.js +42 -0
  585. package/dist/esm/sdk/resources/machines/autoresizing.js.map +1 -0
  586. package/dist/esm/sdk/resources/machines/executions/executions.d.ts +341 -0
  587. package/dist/esm/sdk/resources/machines/executions/executions.d.ts.map +1 -0
  588. package/dist/esm/sdk/resources/machines/executions/executions.js +124 -0
  589. package/dist/esm/sdk/resources/machines/executions/executions.js.map +1 -0
  590. package/dist/esm/sdk/resources/machines/executions/index.d.ts +5 -0
  591. package/dist/esm/sdk/resources/machines/executions/index.d.ts.map +1 -0
  592. package/dist/esm/sdk/resources/machines/executions/index.js +4 -0
  593. package/dist/esm/sdk/resources/machines/executions/index.js.map +1 -0
  594. package/dist/esm/sdk/resources/machines/executions/logs.d.ts +103 -0
  595. package/dist/esm/sdk/resources/machines/executions/logs.d.ts.map +1 -0
  596. package/dist/esm/sdk/resources/machines/executions/logs.js +44 -0
  597. package/dist/esm/sdk/resources/machines/executions/logs.js.map +1 -0
  598. package/dist/esm/sdk/resources/machines/executions.d.ts +2 -0
  599. package/dist/esm/sdk/resources/machines/executions.d.ts.map +1 -0
  600. package/dist/esm/sdk/resources/machines/executions.js +3 -0
  601. package/dist/esm/sdk/resources/machines/executions.js.map +1 -0
  602. package/dist/esm/sdk/resources/machines/index.d.ts +9 -0
  603. package/dist/esm/sdk/resources/machines/index.d.ts.map +1 -0
  604. package/dist/esm/sdk/resources/machines/index.js +6 -0
  605. package/dist/esm/sdk/resources/machines/index.js.map +1 -0
  606. package/dist/esm/sdk/resources/machines/machines.d.ts +496 -0
  607. package/dist/esm/sdk/resources/machines/machines.d.ts.map +1 -0
  608. package/dist/esm/sdk/resources/machines/machines.js +183 -0
  609. package/dist/esm/sdk/resources/machines/machines.js.map +1 -0
  610. package/dist/esm/sdk/resources/machines/ssh.d.ts +175 -0
  611. package/dist/esm/sdk/resources/machines/ssh.d.ts.map +1 -0
  612. package/dist/esm/sdk/resources/machines/ssh.js +85 -0
  613. package/dist/esm/sdk/resources/machines/ssh.js.map +1 -0
  614. package/dist/esm/sdk/resources/machines.d.ts +2 -0
  615. package/dist/esm/sdk/resources/machines.d.ts.map +1 -0
  616. package/dist/esm/sdk/resources/machines.js +3 -0
  617. package/dist/esm/sdk/resources/machines.js.map +1 -0
  618. package/dist/esm/sdk/resources/organization/autoresizing.d.ts +86 -0
  619. package/dist/esm/sdk/resources/organization/autoresizing.d.ts.map +1 -0
  620. package/dist/esm/sdk/resources/organization/autoresizing.js +34 -0
  621. package/dist/esm/sdk/resources/organization/autoresizing.js.map +1 -0
  622. package/dist/esm/sdk/resources/organization/index.d.ts +4 -0
  623. package/dist/esm/sdk/resources/organization/index.d.ts.map +1 -0
  624. package/dist/esm/sdk/resources/organization/index.js +4 -0
  625. package/dist/esm/sdk/resources/organization/index.js.map +1 -0
  626. package/dist/esm/sdk/resources/organization/organization.d.ts +10 -0
  627. package/dist/esm/sdk/resources/organization/organization.d.ts.map +1 -0
  628. package/dist/esm/sdk/resources/organization/organization.js +9 -0
  629. package/dist/esm/sdk/resources/organization/organization.js.map +1 -0
  630. package/dist/esm/sdk/resources/organization.d.ts +2 -0
  631. package/dist/esm/sdk/resources/organization.d.ts.map +1 -0
  632. package/dist/esm/sdk/resources/organization.js +3 -0
  633. package/dist/esm/sdk/resources/organization.js.map +1 -0
  634. package/dist/esm/sdk/resources.d.ts +3 -0
  635. package/dist/esm/sdk/resources.d.ts.map +1 -0
  636. package/dist/esm/sdk/resources.js +3 -0
  637. package/dist/esm/sdk/resources.js.map +1 -0
  638. package/dist/esm/sdk/uploads.d.ts +2 -0
  639. package/dist/esm/sdk/uploads.d.ts.map +1 -0
  640. package/dist/esm/sdk/uploads.js +3 -0
  641. package/dist/esm/sdk/uploads.js.map +1 -0
  642. package/dist/esm/sdk/version.d.ts +2 -0
  643. package/dist/esm/sdk/version.d.ts.map +1 -0
  644. package/dist/esm/sdk/version.js +3 -0
  645. package/dist/esm/sdk/version.js.map +1 -0
  646. package/man/dedalus-completion.1 +35 -0
  647. package/man/dedalus-images-create.1 +126 -0
  648. package/man/dedalus-images-delete.1 +102 -0
  649. package/man/dedalus-images-import.1 +34 -0
  650. package/man/dedalus-images-list.1 +105 -0
  651. package/man/dedalus-images-retrieve.1 +102 -0
  652. package/man/dedalus-images-update.1 +108 -0
  653. package/man/dedalus-images-uploads-create.1 +112 -0
  654. package/man/dedalus-login.1 +47 -0
  655. package/man/dedalus-logout.1 +28 -0
  656. package/man/dedalus-machines-autoresizing-retrieve.1 +104 -0
  657. package/man/dedalus-machines-autoresizing-update.1 +116 -0
  658. package/man/dedalus-machines-create.1 +119 -0
  659. package/man/dedalus-machines-delete.1 +107 -0
  660. package/man/dedalus-machines-executions-create.1 +120 -0
  661. package/man/dedalus-machines-executions-delete.1 +108 -0
  662. package/man/dedalus-machines-executions-events.1 +118 -0
  663. package/man/dedalus-machines-executions-list.1 +114 -0
  664. package/man/dedalus-machines-executions-logs-create-token.1 +108 -0
  665. package/man/dedalus-machines-executions-logs-retrieve.1 +108 -0
  666. package/man/dedalus-machines-executions-output.1 +108 -0
  667. package/man/dedalus-machines-executions-retrieve.1 +108 -0
  668. package/man/dedalus-machines-list.1 +108 -0
  669. package/man/dedalus-machines-reboot.1 +107 -0
  670. package/man/dedalus-machines-resize.1 +110 -0
  671. package/man/dedalus-machines-retrieve.1 +104 -0
  672. package/man/dedalus-machines-sleep.1 +104 -0
  673. package/man/dedalus-machines-ssh-create.1 +108 -0
  674. package/man/dedalus-machines-ssh-delete.1 +108 -0
  675. package/man/dedalus-machines-ssh-list.1 +114 -0
  676. package/man/dedalus-machines-ssh-retrieve.1 +108 -0
  677. package/man/dedalus-machines-update.1 +110 -0
  678. package/man/dedalus-machines-wake.1 +104 -0
  679. package/man/dedalus-organization-autoresizing-retrieve.1 +99 -0
  680. package/man/dedalus-organization-autoresizing-update.1 +111 -0
  681. package/man/dedalus-uninstall.1 +23 -0
  682. package/man/dedalus-upgrade.1 +32 -0
  683. package/man/dedalus.1 +222 -0
  684. package/package.json +88 -4
@@ -0,0 +1,1356 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Scalar. See README.md for details.
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.usageExitCode = exports.normalizeFormat = exports.errorExitCode = exports.writeError = exports.writeOutput = exports.sdkClientOptions = exports.createProgram = void 0;
8
+ const node_fs_1 = require("node:fs");
9
+ const node_process_1 = require("node:process");
10
+ const ansis_1 = __importDefault(require("ansis"));
11
+ const commander_1 = require("commander");
12
+ const yaml_1 = require("yaml");
13
+ const list_1 = require("./list");
14
+ const toon_js_1 = require("./toon.js");
15
+ const credentials_1 = require("./credentials");
16
+ const login_1 = require("./login");
17
+ const diagnostics_js_1 = require("../feedback/diagnostics.js");
18
+ const browser_routing_js_1 = require("../custom/browser-routing.js");
19
+ const LOGIN_COMMAND = 'dedalus login';
20
+ // The sign-in command for the environment a request targeted.
21
+ const loginCommandFor = (environment) => {
22
+ if (environment === undefined)
23
+ return LOGIN_COMMAND;
24
+ const word = /^[A-Za-z0-9._-]+$/u.test(environment) ? environment : shellQuote(environment);
25
+ return LOGIN_COMMAND + ' --environment ' + word;
26
+ };
27
+ // Quotes one word for a POSIX shell so it reaches the command exactly as written.
28
+ // biome-ignore lint/suspicious/noControlCharactersInRegex: dropping control characters is the point.
29
+ const shellQuote = (value) => "'" + value.replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/gu, '').replace(/'/gu, "'\\''") + "'";
30
+ const createProgram = ({ SDK, binaryName, version, description, defaultFormat, defaultErrorFormat, clientOptions, commands, groups, completions, environments = [], defaultEnvironment, environmentEnv, baseUrlEnv, auth, }) => {
31
+ const selection = { environments, defaultEnvironment, environmentEnv, baseUrlEnv };
32
+ const program = usageExitCode(new commander_1.Command());
33
+ program
34
+ .enablePositionalOptions()
35
+ .name(binaryName)
36
+ .description(description)
37
+ .version(version, '-v, --version')
38
+ .showHelpAfterError()
39
+ .option('--base-url <url>', 'Override the base URL for API requests')
40
+ .option('--timeout <ms>', 'Request timeout in milliseconds')
41
+ .option('--max-retries <count>', 'Number of retries for retryable failures')
42
+ .option('--format <format>', 'Output format: auto, json, jsonl, pretty, raw, toon, yaml', defaultFormat)
43
+ .option('--format-error <format>', 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml', defaultErrorFormat)
44
+ .option('--transform <path>', 'Dot-path transform for data output')
45
+ .option('--transform-error <path>', 'Dot-path transform for error output')
46
+ .option('-r, --raw-output', 'Print transformed string values without JSON quotes')
47
+ .option('--debug', 'Enable SDK debug logging');
48
+ // Registered only for an API that declares more than one environment, because that is when the
49
+ // embedded SDK accepts an `environment` option at all. No Commander default is set: the SDK
50
+ // applies its own default, and a value here would look explicitly passed and trip the
51
+ // mutual-exclusion check below against a `--base-url` the user did pass on purpose.
52
+ if (environments.length > 0) {
53
+ program.option('--environment <name>', environmentFlagDescription(selection));
54
+ }
55
+ // Register configured client options (auth credentials, org headers, etc.) as global flags.
56
+ // Mirrored on each subcommand below so users can supply them either before or after the verb.
57
+ for (const option of clientOptions) {
58
+ program.option('--' + option.name + ' <value>', clientOptionDescription(option));
59
+ }
60
+ for (const definition of commands)
61
+ addGeneratedCommand(program, SDK, clientOptions, definition, groups, selection, auth);
62
+ if (environments.length > 0)
63
+ addEnvironmentsCommand(program, selection, defaultFormat);
64
+ if (completions)
65
+ addCompletionCommand(program, binaryName, completions);
66
+ if (auth)
67
+ addAuthCommands(program, auth, selection);
68
+ return program;
69
+ };
70
+ exports.createProgram = createProgram;
71
+ // Routes Commander's own exits through the documented status.
72
+ //
73
+ // Commander defaults every parse failure — unknown flag, missing option-argument, unknown
74
+ // command — to exit 1, which is the status reserved here for an unclassified API failure, so a
75
+ // caller branching on the status could not tell a typo from a request that actually ran and
76
+ // failed. Only a zero exit (--help, --version) is passed through unchanged; everything else
77
+ // Commander exits on is a usage error by definition.
78
+ //
79
+ // This has to be applied to every command object: `addCommand` does not copy the callback the
80
+ // way `.command()` does, so setting it on the program alone would leave the subcommands — where
81
+ // flags are actually parsed — still exiting 1.
82
+ const usageExitCode = (command) => command.exitOverride((error) => process.exit(error.exitCode === 0 ? 0 : 2));
83
+ exports.usageExitCode = usageExitCode;
84
+ // Prints the completion script for one shell. The scripts are generated from the same command
85
+ // table this program is built from, so they always describe the commands and flags below; nothing
86
+ // is derived from the live Commander tree, and no shell code is assembled at runtime.
87
+ const addCompletionCommand = (program, binaryName, completions) => {
88
+ const shells = Object.keys(completions);
89
+ program
90
+ .command('completion')
91
+ .description('Print a shell completion script (' + shells.join(', ') + ')')
92
+ .argument('<shell>', 'Shell to print a completion script for: ' + shells.join(', '))
93
+ .addHelpText('after', completionHelpExamples(binaryName, shells))
94
+ .action((shell) => {
95
+ // Own-property lookup only: a bare `completions[shell]` would resolve inherited keys like
96
+ // "constructor" or "__proto__" to something that is not a completion script.
97
+ const script = Object.prototype.hasOwnProperty.call(completions, shell)
98
+ ? completions[shell]
99
+ : undefined;
100
+ if (script === undefined) {
101
+ process.stderr.write("Unsupported shell '" + shell + "'. Supported shells: " + shells.join(', ') + '\n');
102
+ process.exitCode = 2;
103
+ return;
104
+ }
105
+ node_process_1.stdout.write(script);
106
+ });
107
+ };
108
+ // Shows how to load each script, since every shell wires completions up differently.
109
+ const completionHelpExamples = (binaryName, shells) => {
110
+ const examples = {
111
+ bash: ' eval "$(' + binaryName + ' completion bash)" # or write it to /etc/bash_completion.d',
112
+ zsh: ' eval "$(' + binaryName + ' completion zsh)" # or write it to a directory on $fpath',
113
+ fish: ' ' + binaryName + ' completion fish | source # or write it to ~/.config/fish/completions',
114
+ };
115
+ const lines = shells.map((shell) => examples[shell]).filter((line) => line !== undefined);
116
+ return lines.length > 0 ? '\nAdd one of these to your shell startup file:\n' + lines.join('\n') : '';
117
+ };
118
+ // Help text for `--environment`, naming the environments the embedded SDK accepts and the one it
119
+ // falls back to.
120
+ //
121
+ // Kept in step with `environmentFlagDescription` in the generator's `helpers/environments.ts`, which
122
+ // renders the same sentence into the man pages, the README, and the completion scripts. It is built
123
+ // here rather than passed in because this runtime is one fixed file for every generated CLI: only
124
+ // the data handed to `createProgram` varies.
125
+ const environmentFlagDescription = ({ environments, defaultEnvironment, environmentEnv, }) => {
126
+ const names = environments.map((environment) => environmentLabel(environment.name)).join(', ');
127
+ return ('Named environment to target: ' +
128
+ names +
129
+ (environmentEnv ? ' (can also be set with ' + environmentEnv + ' env var)' : '') +
130
+ (defaultEnvironment ? ' (default: ' + environmentLabel(defaultEnvironment) + ')' : ''));
131
+ };
132
+ // Reduces a configured environment name to text that is safe on one line of the help column.
133
+ //
134
+ // Commander wraps a flag description into a column, so a newline in a name would tear the option
135
+ // list apart, and a control character would be written to the terminal as an escape sequence when
136
+ // help is printed. Only the description is reduced: `--environment` still matches against the name
137
+ // itself, and the `environments` command prints it unchanged.
138
+ // biome-ignore lint/suspicious/noControlCharactersInRegex: dropping control characters is the point.
139
+ // Whitespace collapses first, so a line break becomes the space it reads as; dropping control
140
+ // characters first would swallow it and run the words either side of it together.
141
+ const environmentLabel = (name) => name
142
+ .replace(/\s+/gu, ' ')
143
+ .replace(/[\u0000-\u001F\u007F-\u009F]/gu, '')
144
+ .trim();
145
+ // Lists the configured environments, so what `--environment` accepts is discoverable from the CLI
146
+ // itself rather than only from its docs.
147
+ //
148
+ // It prints through the same writer every generated command uses and takes its own `--format`, so a
149
+ // script can read the URLs straight out of it (`--format json`) instead of parsing the table a human
150
+ // reads.
151
+ //
152
+ // "Default" is the environment a command without `--environment` uses, so an exported
153
+ // environment variable naming a configured one moves the mark there: every such command now goes
154
+ // to it. An unknown name leaves the configured default marked, since every other command refuses
155
+ // that value and this list is where a user looks up what it should have been.
156
+ const addEnvironmentsCommand = (program, { environments, defaultEnvironment, environmentEnv }, defaultFormat) => {
157
+ // Read when the command runs, not when it is registered, like every other environment variable.
158
+ const listRows = () => {
159
+ const ambient = ambientEnvironment(environmentEnv);
160
+ const effective = environments.some((environment) => environment.name === ambient)
161
+ ? ambient
162
+ : defaultEnvironment;
163
+ return environments.map((environment) => ({
164
+ name: environment.name,
165
+ url: environment.url,
166
+ default: environment.name === effective,
167
+ }));
168
+ };
169
+ program
170
+ .command('environments')
171
+ .description('List the named environments --environment can select')
172
+ .option('--format <format>', 'Output format: auto, json, jsonl, pretty, raw, toon, yaml')
173
+ .action(async (options) => {
174
+ // A machine format asked for by name is answered with the rows; anything else is a person
175
+ // reading, so the list is drawn the way the sign-in picker draws its own. `auto` lands here
176
+ // rather than on JSON because this command exists to be read, not parsed — a script names
177
+ // the format it wants, and `--format json` is what the README and the man page tell it to.
178
+ const rows = listRows();
179
+ const requested = options.format ?? program.opts().format;
180
+ if (requested === undefined || requested === 'auto' || requested === 'pretty') {
181
+ writeEnvironmentList(rows);
182
+ return;
183
+ }
184
+ await (0, exports.writeOutput)(rows, { format: normalizeFormat(requested, defaultFormat), title: 'environments' });
185
+ });
186
+ };
187
+ // Draws the environments as the list a person reads: the default marked and coloured, each URL
188
+ // dimmed behind its name, through the same renderer the sign-in picker uses for its rows.
189
+ //
190
+ // Escapes only when stdout is a terminal, so a redirected list is the same text without them —
191
+ // and the names are printed as configured, since this is the one place they are the value to type
192
+ // rather than prose about it.
193
+ const writeEnvironmentList = (rows) => {
194
+ const columns = Number(node_process_1.stdout.columns) || 80;
195
+ const color = Boolean(node_process_1.stdout.isTTY);
196
+ const width = Math.max(0, ...rows.map((row) => row.name.length));
197
+ for (const row of rows) {
198
+ const label = row.name.padEnd(width, ' ');
199
+ const detail = row.url + (row.default ? ' (default)' : '');
200
+ node_process_1.stdout.write((0, list_1.listRow)(label, detail, { columns, selected: row.default, color }) + '\n');
201
+ }
202
+ };
203
+ // The environment the selecting variable names, or undefined when it is unset or not offered.
204
+ // Blank is unset, as the embedded SDK treats its own variables: an `export NAME=` left in a shell
205
+ // profile must not select an environment called "". Shared by `resolveEnvironment` and the
206
+ // `environments` list, so the two cannot disagree about which environment the variable picks.
207
+ const ambientEnvironment = (environmentEnv) => environmentEnv ? process.env[environmentEnv]?.trim() || undefined : undefined;
208
+ // Resolves the environment a command targets: `--environment`, else the environment variable that
209
+ // stands in for it, checked against the configured list.
210
+ //
211
+ // Every failure is a usage error: no request is built for any of them, and none is one the embedded
212
+ // SDK can report in command-line terms. An unknown name reaches the client as a key it cannot index,
213
+ // leaving it with no base URL at all, and a URL paired with an environment is rejected there with a
214
+ // message naming `baseURL: null` — a library construct a command line has no spelling for, which is
215
+ // the same reason `buildClient` restates the credential guard.
216
+ //
217
+ // `login` and `logout` resolve through here too, because the environment decides which stored
218
+ // credential a request carries: the two must agree on it or a sign-in lands where no request looks.
219
+ const resolveEnvironment = (options, command, { environments, environmentEnv, baseUrlEnv }) => {
220
+ // Answered before the option bag is read at all: with no environments configured the CLI never
221
+ // registers `--environment`, so an `environment` key here belongs to something else — a client
222
+ // option of that name, whose value would otherwise be rejected as an environment (and, for a
223
+ // credential, echoed into the error).
224
+ if (environments.length === 0)
225
+ return undefined;
226
+ const flagged = options.environment;
227
+ // A URL typed on this command line outranks an environment exported for the whole shell, the
228
+ // precedence every other option follows — so the variable is not even read, and a stale value in
229
+ // it cannot fail a command that named its URL. Trimmed, as the request path trims it: a blank
230
+ // `--base-url` is no flag at all, so it cannot outrank anything.
231
+ if (flagged === undefined && options.baseUrl?.trim())
232
+ return undefined;
233
+ const ambient = ambientEnvironment(environmentEnv);
234
+ const selected = flagged ?? ambient;
235
+ if (selected === undefined)
236
+ return undefined;
237
+ const names = environments.map((environment) => environment.name);
238
+ if (!names.includes(selected)) {
239
+ command.error("error: unknown environment '" +
240
+ environmentLabel(selected) +
241
+ "'" +
242
+ (flagged === undefined ? ' in ' + environmentEnv : '') +
243
+ '. Available environments: ' +
244
+ names.map(environmentLabel).join(', '), { exitCode: 2 });
245
+ }
246
+ if (flagged !== undefined) {
247
+ // Each names a base URL on its own, so honoring either would silently discard the other.
248
+ // Trimmed like every other reading of the flag: a blank `--base-url` names no URL, so it
249
+ // conflicts with nothing, and the variable form below already treats it that way.
250
+ if (options.baseUrl?.trim()) {
251
+ command.error('error: --environment cannot be combined with --base-url, which already names the URL to call', { exitCode: 2 });
252
+ }
253
+ return selected;
254
+ }
255
+ // Two exported variables, each naming where requests go, with nothing to say which was meant.
256
+ // The embedded SDK refuses a base URL beside an environment for the same reason, so this is not
257
+ // settled by picking one: a production URL exported last week must not quietly beat a staging
258
+ // environment exported today, or the other way round.
259
+ if (baseUrlEnv && process.env[baseUrlEnv]?.trim()) {
260
+ command.error('error: ' +
261
+ environmentEnv +
262
+ ' and ' +
263
+ baseUrlEnv +
264
+ ' are both set, and each names where requests go. Unset one, or pass --environment or --base-url to choose.', { exitCode: 2 });
265
+ }
266
+ return selected;
267
+ };
268
+ // `login`/`logout` sit at the top level unless the API already claims one of those names, in
269
+ // which case they fall back under an `auth` parent. That parent is created here rather than
270
+ // from the command table, so it needs its own description or `--help` lists a bare `auth`,
271
+ // which is the very thing the group table exists to prevent. Both paths are described so
272
+ // whichever one creates the group first carries it.
273
+ const authGroups = (auth) => [
274
+ { commandPath: auth.loginPath.slice(0, -1), description: 'Sign in and out' },
275
+ { commandPath: auth.logoutPath.slice(0, -1), description: 'Sign in and out' },
276
+ ];
277
+ const addAuthCommands = (program, auth, selection) => {
278
+ const flows = auth.methods.map((method) => method.name).join(', ');
279
+ const login = usageExitCode(new commander_1.Command(auth.loginPath.at(-1) ?? 'login'))
280
+ .description('Sign in and save credentials for later commands')
281
+ .showHelpAfterError()
282
+ .option('--base-url <url>', 'Sign in against this base URL instead of the default')
283
+ .option('--flow <name>', 'Sign-in flow to use: ' + flows)
284
+ .addHelpText('after', authFlowHelp(auth))
285
+ .action(async (_options, command) => {
286
+ const options = command.optsWithGlobals();
287
+ const environment = resolveEnvironment(options, command, selection);
288
+ await runAuthCommand(() => (0, login_1.runLogin)(auth, credentialBaseUrl(auth, options.baseUrl, environment), options.flow, loginCommandFor(environment)));
289
+ });
290
+ addEnvironmentOption(login, selection);
291
+ ensureCommandPath(program, auth.loginPath.slice(0, -1), authGroups(auth)).addCommand(login);
292
+ const logout = usageExitCode(new commander_1.Command(auth.logoutPath.at(-1) ?? 'logout'))
293
+ .description('Forget saved credentials, and revoke them if the provider supports it')
294
+ .showHelpAfterError()
295
+ .option('--base-url <url>', 'Forget the credentials saved for this base URL (not with --all)')
296
+ .option('--all', 'Forget every saved credential, for every base URL')
297
+ .action(async (_options, command) => {
298
+ const options = command.optsWithGlobals();
299
+ if (options.all === true) {
300
+ if (options.baseUrl?.trim()) {
301
+ command.error('error: --base-url cannot be combined with --all, which forgets the credentials of every base URL', { exitCode: 2 });
302
+ }
303
+ if (selection.environments.length > 0 && options.environment !== undefined) {
304
+ command.error('error: --environment cannot be combined with --all, which forgets the credentials of every environment', { exitCode: 2 });
305
+ }
306
+ await runAuthCommand(() => (0, login_1.runLogout)(auth, '', true));
307
+ return;
308
+ }
309
+ const environment = resolveEnvironment(options, command, selection);
310
+ await runAuthCommand(() => (0, login_1.runLogout)(auth, credentialBaseUrl(auth, options.baseUrl, environment), false));
311
+ });
312
+ addEnvironmentOption(logout, selection);
313
+ ensureCommandPath(program, auth.logoutPath.slice(0, -1), authGroups(auth)).addCommand(logout);
314
+ };
315
+ // Lets `login` and `logout` take `--environment` after the verb, as every request command does.
316
+ const addEnvironmentOption = (command, selection) => {
317
+ if (selection.environments.length > 0)
318
+ command.option('--environment <name>', environmentFlagDescription(selection));
319
+ };
320
+ const runAuthCommand = async (run) => {
321
+ try {
322
+ node_process_1.stdout.write((await run()) + '\n');
323
+ }
324
+ catch (error) {
325
+ process.stderr.write((error instanceof Error ? error.message : String(error)) + '\n');
326
+ process.exitCode = error instanceof login_1.UsageError ? 2 : 10;
327
+ }
328
+ finally {
329
+ for (const warning of (0, credentials_1.takeWarnings)())
330
+ process.stderr.write(warning + '\n');
331
+ }
332
+ };
333
+ // The base URL a stored credential is filed under for this invocation. One resolver for `login`,
334
+ // `logout` and the request path, so a sign-in lands exactly where a later request looks.
335
+ const credentialBaseUrl = (auth, flag, environment) => flag?.trim() ||
336
+ auth.environments?.find((entry) => entry.name === environment)?.url ||
337
+ process.env[auth.baseUrlEnv]?.trim() ||
338
+ auth.defaultBaseUrl;
339
+ // Lists the flows by name so `--flow` can be used without first running the picker.
340
+ const authFlowHelp = (auth) => '\nSign-in flows:\n' + auth.methods.map((method) => ' ' + method.name + ' ' + method.label).join('\n');
341
+ const clientOptionDescription = (option) => {
342
+ const parts = [];
343
+ if (option.description)
344
+ parts.push(option.description);
345
+ if (option.env)
346
+ parts.push('(can also be set with ' + option.env + ' env var)');
347
+ // Stated last, matching resolution order: the flag wins, then the env var, then this value.
348
+ if (option.defaultValue !== undefined)
349
+ parts.push('(defaults to ' + option.defaultValue + ')');
350
+ return parts.join(' ');
351
+ };
352
+ // Constructs the embedded client, restating its credential guard in command-line terms.
353
+ //
354
+ // The SDK's own guard is worded for a library caller — "instantiate the X client with an apiKey
355
+ // option, like new X({ apiKey: ... })" — which names something a CLI user cannot do. That wording
356
+ // is fixed upstream to match the reference SDKs byte for byte, so it is restated here rather than
357
+ // changed there. The environment variable is the anchor for the match: it is the one token of the
358
+ // message this runtime also knows, so an unrelated constructor failure is rethrown untouched
359
+ // instead of being reported as a missing credential.
360
+ const buildClient = (SDK, options, clientOptions, environment) => {
361
+ try {
362
+ return new SDK(options);
363
+ }
364
+ catch (error) {
365
+ const message = error instanceof Error ? error.message : String(error);
366
+ const missing = clientOptions.find((option) => option.env !== undefined && message.includes(option.env));
367
+ if (!missing)
368
+ throw error;
369
+ throw new Error('Missing credential: run `' +
370
+ loginCommandFor(environment) +
371
+ '`, pass --' +
372
+ missing.name +
373
+ ' <value>' +
374
+ (missing.env ? ' or set the ' + missing.env + ' environment variable' : '') +
375
+ '.');
376
+ }
377
+ };
378
+ const addGeneratedCommand = (program, SDK, clientOptions, definition, groups, selection, auth) => {
379
+ const parent = ensureCommandPath(program, definition.commandPath.slice(0, -1), groups);
380
+ const commandName = definition.commandPath.at(-1) ?? definition.methodName;
381
+ const command = usageExitCode(new commander_1.Command(commandName))
382
+ .description(definition.summary ?? definition.description ?? '')
383
+ .showHelpAfterError()
384
+ .option('--base-url <url>', 'Override the base URL for API requests')
385
+ .option('--timeout <ms>', 'Request timeout in milliseconds')
386
+ .option('--max-retries <count>', 'Number of retries for retryable failures')
387
+ .option('--format <format>', 'Output format: auto, json, jsonl, pretty, raw, toon, yaml')
388
+ .option('--format-error <format>', 'Error output format: auto, json, jsonl, pretty, raw, toon, yaml')
389
+ .option('--transform <path>', 'Dot-path transform for data output')
390
+ .option('--transform-error <path>', 'Dot-path transform for error output')
391
+ .option('-r, --raw-output', 'Print transformed string values without JSON quotes')
392
+ .option('--debug', 'Enable SDK debug logging');
393
+ // Mirrored on the subcommand for the same reason the client options below are: so it can be
394
+ // passed before or after the verb. Registered only when the API declares more than one
395
+ // environment, matching the program-level registration.
396
+ if (selection.environments.length > 0) {
397
+ command.option('--environment <name>', environmentFlagDescription(selection));
398
+ }
399
+ // Mirror configured client-option flags on the subcommand so they can appear before or after the verb.
400
+ for (const option of clientOptions) {
401
+ command.option('--' + option.name + ' <value>', clientOptionDescription(option));
402
+ }
403
+ if (definition.iterable)
404
+ command.option('--max-items <count>', 'Maximum number of streamed items to print; use -1 for unlimited');
405
+ // Positionals are registered as optional Commander arguments because each one is also
406
+ // accepted as an equivalent flag (e.g. `workers retrieve wkr_1` or `workers retrieve --id
407
+ // wkr_1`); requiredness is enforced at call time once both spellings have been merged.
408
+ for (const positional of definition.positional) {
409
+ command.argument('[' + positional.name + ']', positional.description ?? '');
410
+ }
411
+ for (const flag of definition.flags) {
412
+ // A file flag takes a filesystem path, so it says so: the placeholder is the only hint in
413
+ // `--help` that the value is opened rather than sent verbatim.
414
+ const isPath = flag.valueKind === 'file' || flag.itemKind === 'file';
415
+ const value = flag.valueKind === 'boolean' ? '' : isPath ? ' <path>' : ' <value>';
416
+ if (flag.name === 'send') {
417
+ command.option('--' + flag.name + value, flag.description ?? '', (value, previous) => [...(previous ?? []), value]);
418
+ continue;
419
+ }
420
+ // Array params are repeatable single-value switches (`--status a --status b`); the custom
421
+ // option-argument accumulates each occurrence so Commander does not overwrite the prior value.
422
+ if (flag.repeatable) {
423
+ command.option('--' + flag.name + value, flag.description ?? '', (value, previous) => [...(previous ?? []), value]);
424
+ continue;
425
+ }
426
+ command.option('--' + flag.name + value, flag.description ?? '');
427
+ }
428
+ // Flag spelling for path params (`--id wkr_1`). `flagName` is absent when the name is already
429
+ // taken — by a global flag, a client option, a generated flag, or Commander's own `--help`, which
430
+ // lives in `_helpOption` where no scan of `command.options` could see it — and the param is then
431
+ // accepted positionally only. The decision is made once, by the emitter, so the man pages and the
432
+ // completion scripts advertise exactly the spellings registered here.
433
+ for (const positional of definition.positional) {
434
+ if (!positional.flagName)
435
+ continue;
436
+ command.option('--' + positional.flagName + ' <value>', positional.description ?? '');
437
+ }
438
+ command.action(async (...args) => {
439
+ const command = args.at(-1);
440
+ if (!(command instanceof commander_1.Command))
441
+ throw new Error('Expected Commander command context');
442
+ const positionalValues = args.slice(0, -1);
443
+ await runGeneratedCommand(SDK, clientOptions, definition, command, positionalValues, selection, auth);
444
+ });
445
+ parent.addCommand(command);
446
+ };
447
+ const ensureCommandPath = (program, path, groups) => {
448
+ let parent = program;
449
+ const walked = [];
450
+ for (const part of path) {
451
+ walked.push(part);
452
+ const existing = parent.commands.find((command) => command.name() === part);
453
+ if (existing) {
454
+ parent = existing;
455
+ continue;
456
+ }
457
+ const next = usageExitCode(new commander_1.Command(part)).showHelpAfterError();
458
+ // A group is created as the parent of its first command, so this is the only moment it can be
459
+ // described: Commander never revisits it, and an undescribed group is a bare name in --help.
460
+ const description = groupDescription(groups, walked);
461
+ if (description)
462
+ next.description(description);
463
+ parent.addCommand(next);
464
+ parent = next;
465
+ }
466
+ return parent;
467
+ };
468
+ // Matched on the full walked path rather than the last segment, so a nested group is described by
469
+ // the resource it was actually built from and two resources sharing a leaf name cannot collide.
470
+ const groupDescription = (groups, path) => groups?.find((group) => group.commandPath.length === path.length &&
471
+ group.commandPath.every((part, index) => part === path[index]))?.description;
472
+ const runGeneratedCommand = async (SDK, clientOptions, definition, command, positionalValues, selection, auth) => {
473
+ const rootOptions = command.optsWithGlobals();
474
+ const commandOptions = command.opts();
475
+ // Resolved before the request is set up, not inside the try below: a rejected `--environment`
476
+ // is a usage error reported by Commander, and running it through the catch that classifies API
477
+ // failures would re-report it as one.
478
+ const environment = resolveEnvironment(rootOptions, command, selection);
479
+ const maxItems = definition.iterable ? normalizeMaxItems(commandOptions.maxItems) : undefined;
480
+ const outputOptions = {
481
+ format: normalizeFormat(commandOptions.format ?? rootOptions.format, 'auto'),
482
+ title: definition.commandPath.join(' '),
483
+ ...((commandOptions.transform ?? rootOptions.transform)
484
+ ? { transform: commandOptions.transform ?? rootOptions.transform }
485
+ : {}),
486
+ ...(commandOptions.rawOutput || rootOptions.rawOutput ? { rawOutput: true } : {}),
487
+ ...(maxItems !== undefined ? { maxItems } : {}),
488
+ };
489
+ const errorOptions = {
490
+ format: normalizeFormat(commandOptions.formatError ?? rootOptions.formatError, 'auto'),
491
+ ...((commandOptions.transformError ?? rootOptions.transformError)
492
+ ? { transform: commandOptions.transformError ?? rootOptions.transformError }
493
+ : {}),
494
+ ...(commandOptions.rawOutput || rootOptions.rawOutput ? { rawOutput: true } : {}),
495
+ };
496
+ let diagnostics;
497
+ try {
498
+ const clientConfig = await (0, exports.sdkClientOptions)(rootOptions, command, clientOptions, auth, definition.authClientKeyRequirements, environment);
499
+ const call = await callArguments(definition, command.opts(), positionalValues);
500
+ const organization = call.params['X-Dedalus-Org-Id'];
501
+ const scopeOptions = organization === undefined ? clientConfig : { ...clientConfig, dedalusOrgID: organization };
502
+ diagnostics = (0, diagnostics_js_1.createDiagnostics)('dedalus ' + definition.commandPath.join(' '), (0, diagnostics_js_1.diagnosticScope)(scopeOptions));
503
+ const client = buildClient(SDK, { ...clientConfig, fetch: diagnostics.fetch }, clientOptions, environment);
504
+ const method = sdkMethod(client, definition);
505
+ // Required positionals are validated here (not by Commander) because each one may also be
506
+ // supplied through its flag spelling or stdin; `call.params` has all sources merged.
507
+ for (const param of definition.positional) {
508
+ if (param.required && call.params[param.paramKey] === undefined) {
509
+ command.error("error: missing required argument '" + param.name + "'", { exitCode: 2 });
510
+ }
511
+ }
512
+ const result = method(...call.args);
513
+ if (definition.transport === 'websocket') {
514
+ await handleWebSocket(result, call.params, outputOptions);
515
+ return;
516
+ }
517
+ if (definition.iterable && !definition.streaming) {
518
+ await writePaginated(result, outputOptions);
519
+ return;
520
+ }
521
+ const resolved = await result;
522
+ if (definition.streaming) {
523
+ await writeIterable(resolved, outputOptions);
524
+ return;
525
+ }
526
+ await (0, exports.writeOutput)(resolved, outputOptions);
527
+ }
528
+ catch (error) {
529
+ diagnostics?.record({ kind: 'command_failure' });
530
+ await (0, exports.writeError)(error, errorOptions, clientOptions, SDK, environment);
531
+ process.exitCode = (0, exports.errorExitCode)(error, SDK);
532
+ }
533
+ finally {
534
+ diagnostics?.record({ kind: 'command_complete' });
535
+ }
536
+ };
537
+ // Generated commands pass operation-specific requirements. Custom commands use the API-wide requirements.
538
+ const sdkClientOptions = async (options, command, clientOptions, auth, requirements = auth?.requirements ?? [], environment = undefined) => {
539
+ // Forward configured client-option flags (auth keys, org headers, etc.) to the embedded SDK
540
+ // using the SDK-facing camelCased key. Only forward values that were explicitly set so the
541
+ // SDK's own env-var fallback keeps working when no CLI flag was passed.
542
+ const rootOptions = options;
543
+ const commandOptions = command.opts();
544
+ const forwarded = {};
545
+ for (const option of clientOptions) {
546
+ const commandValue = commandOptions[option.optionKey];
547
+ const value = commandValue === undefined ? rootOptions[option.optionKey] : commandValue;
548
+ if (value === undefined)
549
+ continue;
550
+ // A credential is exactly the kind of value that belongs in a file rather than in shell
551
+ // history, so a client option reads `@path` like any other flag. It never reaches the
552
+ // structured decoding below it: an SDK client option is always a scalar.
553
+ forwarded[option.sdkKey] = typeof value === 'string' ? clientOptionValue(value, option) : value;
554
+ }
555
+ await applyStoredCredentials(forwarded, clientOptions, requirements, auth, options.baseUrl, environment);
556
+ const organization = commandOptions['xDedalusOrgId'] ?? rootOptions['xDedalusOrgId'] ??
557
+ forwarded['dedalusOrgID'] ?? process.env['DEDALUS_ORG_ID'];
558
+ if (organization !== undefined)
559
+ forwarded['dedalusOrgID'] = organization;
560
+ return (0, browser_routing_js_1.routeBrowserCredential)({
561
+ ...(options.baseUrl?.trim() ? { baseURL: options.baseUrl.trim() } : {}),
562
+ ...(environment !== undefined ? { environment, baseURL: null } : {}),
563
+ ...(options.timeout ? { timeout: Number(options.timeout) } : {}),
564
+ ...(options.maxRetries ? { maxRetries: Number(options.maxRetries) } : {}),
565
+ ...(options.debug ? { logLevel: 'debug' } : {}),
566
+ ...forwarded,
567
+ defaultHeaders: {
568
+ 'X-Request-ID': null,
569
+ ...(organization ? { 'X-Dedalus-Org-Id': organization } : {}),
570
+ 'X-Scalar-Lang': 'cli',
571
+ 'X-Scalar-Runtime': 'cli',
572
+ 'X-Scalar-CLI-Command': command.name(),
573
+ 'X-Dedalus-CLI-Command': commandPath(command),
574
+ 'User-Agent': 'Dedalus/CLI ' + rootCommand(command).version(),
575
+ },
576
+ });
577
+ };
578
+ exports.sdkClientOptions = sdkClientOptions;
579
+ const applyStoredCredentials = async (forwarded, clientOptions, authClientKeyRequirements, auth, baseUrl, environment) => {
580
+ if (!auth)
581
+ return;
582
+ if (authClientKeyRequirements.length === 0)
583
+ return;
584
+ const hasExplicitValue = (option) => forwarded[option.sdkKey] !== undefined || Boolean(option.env && (process.env[option.env] ?? '').trim());
585
+ const explicit = authClientKeyRequirements.find((keys) => keys.every((key) => {
586
+ const option = clientOptions.find((candidate) => candidate.clientKey === key);
587
+ return option !== undefined && hasExplicitValue(option);
588
+ }));
589
+ if (explicit)
590
+ return;
591
+ const stored = await (0, login_1.storedCredentials)(auth, credentialBaseUrl(auth, baseUrl, environment));
592
+ const isSatisfiable = (keys) => keys.every((key) => {
593
+ const option = clientOptions.find((candidate) => candidate.clientKey === key);
594
+ if (!option)
595
+ return false;
596
+ return hasExplicitValue(option) || (typeof stored[key] === 'string' && stored[key] !== '');
597
+ });
598
+ const selected = authClientKeyRequirements.find((keys) => isSatisfiable(keys)) ?? authClientKeyRequirements[0] ?? [];
599
+ const pending = clientOptions.filter((option) => option.auth && selected.includes(option.clientKey) && !hasExplicitValue(option));
600
+ for (const option of pending) {
601
+ // Own-property lookup only: the store is a JSON file, so a key like "constructor"
602
+ // would otherwise resolve to something off Object.prototype rather than a credential.
603
+ if (!Object.prototype.hasOwnProperty.call(stored, option.clientKey))
604
+ continue;
605
+ const value = stored[option.clientKey];
606
+ if (typeof value === 'string' && value)
607
+ forwarded[option.sdkKey] = value;
608
+ }
609
+ };
610
+ const commandPath = (command) => {
611
+ const parts = [];
612
+ for (let current = command; current; current = current.parent)
613
+ parts.unshift(current.name());
614
+ return parts.join(' ');
615
+ };
616
+ const rootCommand = (command) => {
617
+ let root = command;
618
+ while (root.parent)
619
+ root = root.parent;
620
+ return root;
621
+ };
622
+ const sdkMethod = (client, definition) => {
623
+ let target = client;
624
+ for (const resource of definition.resourcePath) {
625
+ target = target[resource];
626
+ }
627
+ const method = target[definition.methodName];
628
+ if (typeof method !== 'function') {
629
+ throw new Error('Generated CLI could not find SDK method ' +
630
+ [...definition.resourcePath, definition.methodName].join('.'));
631
+ }
632
+ return method.bind(target);
633
+ };
634
+ const callArguments = async (definition, options, positionalValues) => {
635
+ const positionalParams = {};
636
+ definition.positional.forEach((param, index) => {
637
+ // `optionKey` is only this positional's when it was given a flag spelling. Without one the key
638
+ // belongs to whatever took the name — a `--environment` selector, say — and reading it would
639
+ // fill the path param with that flag's value and satisfy the required-argument check below.
640
+ const value = positionalValues[index] ?? (param.flagName === undefined ? undefined : options[param.optionKey]);
641
+ if (value !== undefined)
642
+ positionalParams[param.paramKey] = coerceValue(value, param.valueKind, undefined, param.name);
643
+ });
644
+ const flagParams = {};
645
+ for (const flag of definition.flags) {
646
+ if (flag.objectPath)
647
+ continue;
648
+ const value = options[flag.optionKey];
649
+ if (value !== undefined)
650
+ flagParams[flag.paramKey] = coerceValue(value, flag.valueKind, flag.itemKind, '--' + flag.name);
651
+ }
652
+ // Dotted leaf flags (e.g. `--address.city`) are applied after the JSON-blob flag for the same
653
+ // param so an explicit leaf value always overrides the corresponding blob field.
654
+ for (const flag of definition.flags) {
655
+ if (!flag.objectPath || flag.objectPath.length === 0)
656
+ continue;
657
+ const value = options[flag.optionKey];
658
+ if (value === undefined)
659
+ continue;
660
+ flagParams[flag.paramKey] = setNestedValue(flagParams[flag.paramKey], flag.objectPath, coerceValue(value, flag.valueKind, flag.itemKind, '--' + flag.name));
661
+ }
662
+ const stdin = await readStdinValue();
663
+ const params = mergeObjects(stdin, { ...flagParams, ...positionalParams });
664
+ const positionalArgs = definition.positional.map((param) => params[param.paramKey]);
665
+ // A positional path param is handed to the SDK method as a leading argument, and the method
666
+ // never destructures it back out of `params` — only the path params it did *not* take
667
+ // positionally are pulled out there. Leaving it in `params` makes it fall through the
668
+ // method's `...query` / `...body` rest and reach the wire a second time, as
669
+ // `/version/1.0.0?semver=1.0.0` or as a `namespace` field in a body that has no such field.
670
+ //
671
+ // Dropping it cannot remove a field the call needs: a positional whose name collides with a
672
+ // params field is already disambiguated when the command table is built (a body `slug` beside
673
+ // a path one leaves the positional as `slug2`), so the two never share a key.
674
+ const omitted = definition.positional.map((param) => param.paramKey);
675
+ if (definition.transport === 'websocket')
676
+ omitted.push('send');
677
+ const sdkParams = omitParams(params, omitted);
678
+ if (definition.callShape === 'options')
679
+ return { args: [...positionalArgs, undefined], params };
680
+ if (definition.callShape === 'body')
681
+ return { args: [...positionalArgs, bodyValue(sdkParams, definition), undefined], params };
682
+ return { args: [...positionalArgs, paramsValue(sdkParams, definition), undefined], params };
683
+ };
684
+ const paramsValue = (params, definition) => {
685
+ if (definition.bodyParamKey === undefined)
686
+ return params;
687
+ const body = params[definition.bodyParamKey];
688
+ if (body === undefined)
689
+ return params;
690
+ // Scoped union bodies with headers are typed as the params root. A `--body` JSON blob therefore
691
+ // needs to sit beside header/query flags, or be passed as the root when it cannot be merged.
692
+ if (!isPlainObject(body))
693
+ return body;
694
+ return mergeObjects(body, omitParams(params, [definition.bodyParamKey]));
695
+ };
696
+ const bodyValue = (params, definition) => {
697
+ // A non-flattenable body is forwarded as a single value: the SDK method takes that param
698
+ // directly, so return it bare. Its dotted leaf flags (`--payload.city`) share this key and have
699
+ // already been merged into the param value, so counting body flags would wrongly treat one
700
+ // logical body as many and re-wrap it under the param key. `params.body` covers a bare value
701
+ // piped via stdin.
702
+ if (definition.bodyParamKey !== undefined) {
703
+ if (params[definition.bodyParamKey] !== undefined)
704
+ return params[definition.bodyParamKey];
705
+ if (params.body !== undefined)
706
+ return params.body;
707
+ }
708
+ // A flattenable body is reassembled from its per-property flags into a single object. Leaf flags
709
+ // share their parent property key, so keying by paramKey collapses them back onto that property.
710
+ const bodyFlags = definition.flags.filter((flag) => flag.location === 'body' && flag.paramKey !== 'send');
711
+ const body = {};
712
+ for (const flag of bodyFlags) {
713
+ if (params[flag.paramKey] !== undefined)
714
+ body[flag.paramKey] = params[flag.paramKey];
715
+ }
716
+ return Object.keys(body).length > 0 ? body : params;
717
+ };
718
+ const readStdinValue = async () => {
719
+ if (node_process_1.stdin.isTTY)
720
+ return {};
721
+ const source = await readStdinSource();
722
+ if (!source)
723
+ return {};
724
+ const parsed = parseStructuredValue(source);
725
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed))
726
+ return parsed;
727
+ return { body: parsed };
728
+ };
729
+ const readStdinSource = async () => {
730
+ const chunks = [];
731
+ const done = new Promise((resolve, reject) => {
732
+ const cleanup = () => {
733
+ clearTimeout(timer);
734
+ node_process_1.stdin.off('data', onData);
735
+ node_process_1.stdin.off('end', onEnd);
736
+ node_process_1.stdin.off('error', onError);
737
+ node_process_1.stdin.pause();
738
+ };
739
+ const onData = (chunk) => {
740
+ clearTimeout(timer);
741
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
742
+ };
743
+ const onEnd = () => {
744
+ cleanup();
745
+ resolve(Buffer.concat(chunks).toString('utf8').trim());
746
+ };
747
+ const onError = (error) => {
748
+ cleanup();
749
+ reject(error);
750
+ };
751
+ const timer = setTimeout(() => {
752
+ cleanup();
753
+ resolve('');
754
+ }, 25);
755
+ node_process_1.stdin.on('data', onData);
756
+ node_process_1.stdin.on('end', onEnd);
757
+ node_process_1.stdin.on('error', onError);
758
+ });
759
+ node_process_1.stdin.resume();
760
+ return done;
761
+ };
762
+ // An empty argument is an empty STRING, not YAML's empty document. `--tag ''` asks for one
763
+ // empty tag; parsing it as YAML answers `null`, which the request builder then refuses
764
+ // ("Received null for "tags[]""). Only the empty case is special-cased: `--tag null` still
765
+ // means null, and every other value keeps the JSON-then-YAML reading.
766
+ const parseStructuredValue = (source) => {
767
+ if (source === '')
768
+ return source;
769
+ try {
770
+ return JSON.parse(source);
771
+ }
772
+ catch {
773
+ return (0, yaml_1.parse)(source);
774
+ }
775
+ };
776
+ const setNestedValue = (target, path, value) => {
777
+ const root = isPlainObject(target) ? { ...target } : {};
778
+ let cursor = root;
779
+ for (const segment of path.slice(0, -1)) {
780
+ const existing = cursor[segment];
781
+ const next = isPlainObject(existing) ? { ...existing } : {};
782
+ cursor[segment] = next;
783
+ cursor = next;
784
+ }
785
+ const leaf = path.at(-1);
786
+ if (leaf !== undefined)
787
+ cursor[leaf] = value;
788
+ return root;
789
+ };
790
+ const isPlainObject = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
791
+ const mergeObjects = (base, overlay) => ({
792
+ ...base,
793
+ ...Object.fromEntries(Object.entries(overlay).filter(([, value]) => value !== undefined)),
794
+ });
795
+ const omitParams = (params, names) => {
796
+ const out = { ...params };
797
+ for (const name of names)
798
+ delete out[name];
799
+ return out;
800
+ };
801
+ // A file argument is spelled `@path`, the spelling curl and the reference CLIs already use, so a
802
+ // command written against one of those keeps working here. A command line carries a path but never
803
+ // the bytes behind it, and without this the path itself went on the wire as the value.
804
+ const FILE_ARG_PREFIX = '@';
805
+ // `@file://x` sends the bytes as text and `@data://x` sends them base64-encoded; a bare `@x` lets the
806
+ // file decide, which is what a caller who has not thought about encoding means.
807
+ const FILE_ARG_TEXT_SCHEME = 'file://';
808
+ const FILE_ARG_DATA_SCHEME = 'data://';
809
+ // `\@value` is how a value that genuinely begins with `@` (an npm scope, a handle) is spelled.
810
+ const ESCAPED_FILE_ARG_PREFIX = '\\@';
811
+ // The part after `@`, or `undefined` when the value is not a file argument at all.
812
+ const fileArgRest = (value) => value.startsWith(FILE_ARG_PREFIX) ? value.slice(FILE_ARG_PREFIX.length) : undefined;
813
+ // Drops the escape from `\@literal`, which is the only thing a leading backslash means here.
814
+ const unescapeFileArg = (value) => value.startsWith(ESCAPED_FILE_ARG_PREFIX) ? value.slice(1) : value;
815
+ // Resolves one scalar value: a file argument becomes the file's contents, `\@` becomes a literal `@`,
816
+ // and anything else is passed through untouched.
817
+ const flagValue = (value, label) => {
818
+ const rest = fileArgRest(value);
819
+ if (rest === undefined) {
820
+ const unescaped = unescapeFileArg(value);
821
+ return { text: unescaped, origin: unescaped === value ? 'literal' : 'escaped' };
822
+ }
823
+ if (rest.startsWith(FILE_ARG_TEXT_SCHEME)) {
824
+ return {
825
+ text: readFileArg(rest.slice(FILE_ARG_TEXT_SCHEME.length), label, true).toString('utf8'),
826
+ origin: 'file',
827
+ };
828
+ }
829
+ if (rest.startsWith(FILE_ARG_DATA_SCHEME)) {
830
+ return {
831
+ text: readFileArg(rest.slice(FILE_ARG_DATA_SCHEME.length), label, true).toString('base64'),
832
+ origin: 'encoded',
833
+ };
834
+ }
835
+ const bytes = readFileArg(rest, label, false);
836
+ // Bytes that are not text cannot travel as a JSON string, so they are base64-encoded. A caller who
837
+ // wants one encoding regardless of what the file holds spells it with `@file://` or `@data://`.
838
+ return looksBinary(bytes)
839
+ ? { text: bytes.toString('base64'), origin: 'encoded' }
840
+ : { text: bytes.toString('utf8'), origin: 'file' };
841
+ };
842
+ // A `file://` or `data://` value is a URL and is percent-decoded as one; a bare `@path` is not a URL
843
+ // and is opened exactly as typed, or a file genuinely named `100%20pct.txt` would be looked up as
844
+ // `100 pct.txt`.
845
+ const readFileArg = (source, label, url) => {
846
+ const path = url ? fileUrlToPath(source) : source;
847
+ try {
848
+ return (0, node_fs_1.readFileSync)(path);
849
+ }
850
+ catch (error) {
851
+ throw new Error(fileArgFailure(label, path, error));
852
+ }
853
+ };
854
+ // A missing file names the flag, the path, and the escape, because the likeliest reason `@abe` names
855
+ // nothing on disk is that it was meant as a literal value.
856
+ const fileArgFailure = (label, path, error) => label +
857
+ ': could not read ' +
858
+ path +
859
+ ' (' +
860
+ (error instanceof Error ? error.message : String(error)) +
861
+ '). Write \\@ to send a literal value beginning with @.';
862
+ // Bytes are text when they round-trip through UTF-8. A NUL byte is checked separately because it is
863
+ // legal UTF-8, so it round-trips, yet no text field is meant to carry one.
864
+ const looksBinary = (bytes) => bytes.includes(0) || !Buffer.from(bytes.toString('utf8'), 'utf8').equals(bytes);
865
+ // `file://./x` and `file:///abs/x` are both spelled by hand often enough to accept: the first is not
866
+ // a legal file URL, so `new URL()` is not used and the remainder is treated as a path. The slash
867
+ // before a drive letter (`file:///C:/x`) is the Windows spelling of an absolute path and is dropped,
868
+ // since `/C:/x` names nothing.
869
+ const fileUrlToPath = (rest) => {
870
+ const decoded = decodeFileUrl(rest);
871
+ return /^\/[A-Za-z]:/u.test(decoded) ? decoded.slice(1) : decoded;
872
+ };
873
+ // Percent-decoding applies only when the value decodes cleanly. A literal `%` in a file name is
874
+ // likelier than a hand-encoded one, and letting `decodeURIComponent` throw would surface a bare
875
+ // "URI error" naming neither the flag nor the path.
876
+ const decodeFileUrl = (rest) => {
877
+ try {
878
+ return decodeURIComponent(rest);
879
+ }
880
+ catch {
881
+ return rest;
882
+ }
883
+ };
884
+ // The path a file-kinded flag names, with or without the `@`. An upload value is a path by
885
+ // definition, so the prefix is optional there and both spellings open the same file.
886
+ const uploadPath = (value) => {
887
+ const rest = fileArgRest(value);
888
+ if (rest === undefined)
889
+ return unescapeFileArg(value);
890
+ if (rest.startsWith(FILE_ARG_TEXT_SCHEME))
891
+ return fileUrlToPath(rest.slice(FILE_ARG_TEXT_SCHEME.length));
892
+ if (rest.startsWith(FILE_ARG_DATA_SCHEME))
893
+ return fileUrlToPath(rest.slice(FILE_ARG_DATA_SCHEME.length));
894
+ return rest;
895
+ };
896
+ // `createReadStream` defers a missing file to an asynchronous `error` event, which surfaces as an
897
+ // unhandled rejection rather than a usage error, so the path is checked before the stream is opened.
898
+ const uploadStream = (value, label) => {
899
+ const path = uploadPath(value);
900
+ try {
901
+ (0, node_fs_1.accessSync)(path, node_fs_1.constants.R_OK);
902
+ }
903
+ catch (error) {
904
+ throw new Error(fileArgFailure(label, path, error));
905
+ }
906
+ return (0, node_fs_1.createReadStream)(path);
907
+ };
908
+ // `@` works inside a JSON or YAML blob too (`--metadata '{"notes": "@notes.txt"}'`), so a nested
909
+ // field names a file the same way a flag does. Only a blob typed on the command line is walked; see
910
+ // `FlagValueOrigin` for why a blob read out of a file is not.
911
+ const expandFileArgs = (value, label) => {
912
+ if (typeof value === 'string')
913
+ return flagValue(value, label).text;
914
+ if (Array.isArray(value))
915
+ return value.map((item) => expandFileArgs(item, label));
916
+ if (isPlainObject(value)) {
917
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, expandFileArgs(item, label)]));
918
+ }
919
+ return value;
920
+ };
921
+ // `itemKind` types one occurrence of a repeatable array flag; a definition without one (an injected
922
+ // field with no item schema) falls back to parsing each occurrence as structured text. `label` names
923
+ // the flag a file-argument failure came from, since a path names no flag on its own.
924
+ // A failing client option cannot name the path it tried to open when the option carries a
925
+ // credential: the likeliest reason `@sk-live-...` names no file is that it *is* the key, and the
926
+ // message reaches stderr and every CI log capturing it.
927
+ const clientOptionValue = (value, option) => {
928
+ try {
929
+ return flagValue(value, '--' + option.name).text;
930
+ }
931
+ catch (error) {
932
+ if (!option.auth)
933
+ throw error;
934
+ throw new Error('--' +
935
+ option.name +
936
+ ': could not read the file it names. Write \\@ to send a literal value beginning with @.');
937
+ }
938
+ };
939
+ const coerceValue = (value, kind, itemKind, label = 'value') => {
940
+ if (Array.isArray(value)) {
941
+ const elementKind = kind === 'array' ? (itemKind ?? 'unknown') : kind;
942
+ return value.map((item) => coerceValue(item, elementKind, undefined, label));
943
+ }
944
+ if (typeof value !== 'string')
945
+ return value;
946
+ // A file field takes bytes, and a path is the only thing a command line can carry. The stream is
947
+ // what the SDK's multipart encoder detects (it is async iterable) and it names the part from the
948
+ // stream's `path`, so the upload keeps its file name.
949
+ if (kind === 'file')
950
+ return uploadStream(value, label);
951
+ const source = flagValue(value, label);
952
+ if (kind === 'boolean')
953
+ return source.text === 'true' || source.text === '1';
954
+ if (kind === 'number' || kind === 'integer')
955
+ return Number(source.text);
956
+ if (kind === 'object' || kind === 'array' || kind === 'unknown') {
957
+ // Base64 is the value itself, and an escaped literal was declared to be text: parsing
958
+ // either would read it as YAML, and `@remote` is not even legal YAML.
959
+ if (source.origin === 'encoded' || source.origin === 'escaped')
960
+ return source.text;
961
+ const parsed = parseStructuredValue(source.text);
962
+ return source.origin === 'literal' ? expandFileArgs(parsed, label) : parsed;
963
+ }
964
+ return source.text;
965
+ };
966
+ // Iterator commands print one item at a time so pipes can consume long-running streams immediately.
967
+ // One streamed item, framed so consecutive items stay separable.
968
+ //
969
+ // Every other format self-frames per item: `jsonl` is one record per line, `json` wraps each in
970
+ // braces. A TOON object is several bare `key: value` lines, so two events written back to back
971
+ // would run together with nothing marking the boundary — recoverable only by guessing that a
972
+ // repeated key starts a new record, which fails the moment a field is optional. Encoding the item
973
+ // as a one-element list gives each record its own `[1]` header at column 0, keeps the count
974
+ // marker honest about what follows, and leaves every other format untouched.
975
+ const streamItemText = (value, options) => {
976
+ if (options.format !== 'toon')
977
+ return serializeOutput(value, options);
978
+ if (options.rawOutput && typeof value === 'string')
979
+ return value;
980
+ return serializeOutput([value], options);
981
+ };
982
+ const writeIterable = async (value, options) => {
983
+ if (!isAsyncIterable(value)) {
984
+ await (0, exports.writeOutput)(value, options);
985
+ return;
986
+ }
987
+ if (options.maxItems === 0) {
988
+ options.onLimit?.();
989
+ return;
990
+ }
991
+ let written = 0;
992
+ for await (const item of value) {
993
+ if (options.failOnWebSocketError)
994
+ throwWebSocketEventError(item);
995
+ node_process_1.stdout.write(streamItemText(transformValue(item, options.transform), options) + '\n');
996
+ if (!countsTowardLimit(item, options))
997
+ continue;
998
+ written += 1;
999
+ if (options.maxItems !== undefined && options.maxItems > -1 && written >= options.maxItems) {
1000
+ options.onLimit?.();
1001
+ break;
1002
+ }
1003
+ }
1004
+ };
1005
+ // Paginated list commands auto-page across cursors: the SDK PagePromise iterates items across
1006
+ // pages. `raw` is the explicit escape hatch for the unmodified single-response envelope, so it
1007
+ // stays a single request with no auto-paging. For every other format we hand the page iterator
1008
+ // to writeOutput, which already makes the right split: `jsonl` streams each item as it arrives,
1009
+ // while `json`/`auto`/`pretty`/`yaml` collect the fully auto-paged items into one value (honoring
1010
+ // --max-items either way). Routing through writeIterable here instead would stream items for
1011
+ // every format, emitting newline-delimited objects under `--format json` (invalid as a single
1012
+ // JSON document) and nothing at all for an empty result.
1013
+ const writePaginated = async (result, options) => {
1014
+ if (options.format === 'raw') {
1015
+ const page = await result;
1016
+ const envelope = page && typeof page === 'object' && 'body' in page ? page.body : undefined;
1017
+ await (0, exports.writeOutput)(envelope ?? page, options);
1018
+ return;
1019
+ }
1020
+ if (isAsyncIterable(result)) {
1021
+ await (0, exports.writeOutput)(result, options);
1022
+ return;
1023
+ }
1024
+ await (0, exports.writeOutput)(await result, options);
1025
+ };
1026
+ const countsTowardLimit = (item, options) => {
1027
+ if (!options.failOnWebSocketError)
1028
+ return true;
1029
+ if (!item || typeof item !== 'object')
1030
+ return false;
1031
+ const type = item.type;
1032
+ return type === 'message' || type === 'raw';
1033
+ };
1034
+ // WebSocket SDKs expose lifecycle events as iterator values; error events should fail CLI commands.
1035
+ const handleWebSocket = async (socket, params, options) => {
1036
+ const closer = () => {
1037
+ closeSocket(socket, 'interrupted');
1038
+ };
1039
+ process.once('SIGINT', closer);
1040
+ try {
1041
+ const output = writeIterable(socket, {
1042
+ ...options,
1043
+ failOnWebSocketError: true,
1044
+ onLimit: () => closeSocket(socket, 'max-items reached'),
1045
+ });
1046
+ await Promise.resolve();
1047
+ const sendValue = params.send;
1048
+ if (sendValue !== undefined)
1049
+ sendSocketValue(socket, sendValue);
1050
+ if (!node_process_1.stdin.isTTY) {
1051
+ const stdin = await readStdinValue();
1052
+ if (Object.keys(stdin).length > 0)
1053
+ sendSocketValue(socket, stdin.body ?? stdin);
1054
+ }
1055
+ await output;
1056
+ }
1057
+ finally {
1058
+ process.off('SIGINT', closer);
1059
+ }
1060
+ };
1061
+ const closeSocket = (socket, reason) => {
1062
+ const close = socket.close;
1063
+ if (typeof close === 'function')
1064
+ close.call(socket, { code: 1000, reason });
1065
+ };
1066
+ const sendSocketValue = (socket, value) => {
1067
+ const send = socket.send;
1068
+ if (typeof send !== 'function')
1069
+ throw new Error('Generated CLI could not send on SDK WebSocket client');
1070
+ if (Array.isArray(value)) {
1071
+ for (const item of value)
1072
+ send.call(socket, item);
1073
+ return;
1074
+ }
1075
+ send.call(socket, value);
1076
+ };
1077
+ const writeOutput = async (value, options) => {
1078
+ if (isAsyncIterable(value)) {
1079
+ if (options.format === 'jsonl') {
1080
+ await writeIterable(value, options);
1081
+ return;
1082
+ }
1083
+ await (0, exports.writeOutput)(await collectIterable(value, options.maxItems), options);
1084
+ return;
1085
+ }
1086
+ node_process_1.stdout.write(serializeOutput(transformValue(value, options.transform), options) + '\n');
1087
+ };
1088
+ exports.writeOutput = writeOutput;
1089
+ const collectIterable = async (value, maxItems) => {
1090
+ const items = [];
1091
+ for await (const item of value) {
1092
+ if (maxItems === 0)
1093
+ break;
1094
+ items.push(item);
1095
+ if (maxItems !== undefined && maxItems > -1 && items.length >= maxItems)
1096
+ break;
1097
+ }
1098
+ return items;
1099
+ };
1100
+ // `auto` renders like `json` (2-space pretty-printed): `pretty` is reserved for the distinct
1101
+ // human-readable card view, matching common CLI defaults.
1102
+ const serializeOutput = (value, options) => {
1103
+ const normalized = options.format === 'auto' ? 'json' : options.format;
1104
+ if (options.rawOutput && typeof value === 'string')
1105
+ return value;
1106
+ const safeValue = value === undefined ? null : value;
1107
+ if (normalized === 'raw')
1108
+ return typeof safeValue === 'string' ? safeValue : JSON.stringify(safeValue);
1109
+ if (normalized === 'yaml')
1110
+ return (0, yaml_1.stringify)(JSON.parse(JSON.stringify(safeValue))).trimEnd();
1111
+ if (normalized === 'jsonl')
1112
+ return JSON.stringify(safeValue);
1113
+ if (normalized === 'pretty')
1114
+ return prettyCard(safeValue, options);
1115
+ // TOON keeps the JSON data model but drops repeated syntax, so a list response costs an agent
1116
+ // markedly fewer context tokens than the same data as JSON.
1117
+ if (normalized === 'toon')
1118
+ return (0, toon_js_1.encodeToon)(JSON.parse(JSON.stringify(safeValue)));
1119
+ return JSON.stringify(safeValue, null, 2);
1120
+ };
1121
+ // Human-readable `pretty` view: a bordered key/value card titled with the command path,
1122
+ // rendering booleans as yes/no and array entries as numbered items.
1123
+ const prettyCard = (value, options) => {
1124
+ const lines = prettyLines(value, '');
1125
+ const width = Math.max(0, ...lines.map((line) => line.length));
1126
+ const body = lines.length > 0 ? lines : [''];
1127
+ return [
1128
+ ...(options.title ? [' ' + options.title] : []),
1129
+ '\u256d' + '\u2500'.repeat(width + 2) + '\u256e',
1130
+ ...body.map((line) => '\u2502 ' + line.padEnd(width, ' ') + ' \u2502'),
1131
+ '\u2570' + '\u2500'.repeat(width + 2) + '\u256f',
1132
+ ].join('\n');
1133
+ };
1134
+ const prettyLines = (value, indent) => {
1135
+ if (Array.isArray(value)) {
1136
+ return value.flatMap((item, index) => {
1137
+ const label = indent + (index + 1) + '.';
1138
+ if (item && typeof item === 'object')
1139
+ return [label, ...prettyLines(item, indent + ' ')];
1140
+ return [label + ' ' + prettyScalar(item)];
1141
+ });
1142
+ }
1143
+ if (value && typeof value === 'object') {
1144
+ return Object.entries(value).flatMap(([key, entry]) => {
1145
+ if (entry && typeof entry === 'object')
1146
+ return [indent + key + ':', ...prettyLines(entry, indent + ' ')];
1147
+ return [indent + key + ': ' + prettyScalar(entry)];
1148
+ });
1149
+ }
1150
+ return [indent + prettyScalar(value)];
1151
+ };
1152
+ const prettyScalar = (value) => {
1153
+ if (value === true)
1154
+ return 'yes';
1155
+ if (value === false)
1156
+ return 'no';
1157
+ if (value === null || value === undefined)
1158
+ return '';
1159
+ return String(value);
1160
+ };
1161
+ const writeError = async (error, options, clientOptions, SDK, environment = undefined) => {
1162
+ const body = transformValue(errorBody(error, clientOptions, SDK, environment), options.transform);
1163
+ if (options.rawOutput && typeof body === 'string') {
1164
+ process.stderr.write(body + '\n');
1165
+ return;
1166
+ }
1167
+ if (options.format === 'raw') {
1168
+ // The hint is appended rather than dropped: before failures were classified, the auth hint
1169
+ // *was* the message, so printing the message alone would lose advice `raw` used to show.
1170
+ const hint = errorHintText(body);
1171
+ process.stderr.write(String(errorMessage(body)) + (hint ? ' ' + hint : '') + '\n');
1172
+ return;
1173
+ }
1174
+ const output = options.format === 'auto' ? 'pretty' : options.format;
1175
+ const safeBody = body === undefined ? null : body;
1176
+ const serialized = serializeErrorBody(safeBody, output);
1177
+ process.stderr.write((output === 'pretty' ? ansis_1.default.red(serialized) : serialized) + '\n');
1178
+ };
1179
+ exports.writeError = writeError;
1180
+ const serializeErrorBody = (body, format) => {
1181
+ if (format === 'yaml')
1182
+ return (0, yaml_1.stringify)(body).trimEnd();
1183
+ if (format === 'toon')
1184
+ return (0, toon_js_1.encodeToon)(JSON.parse(JSON.stringify(body)));
1185
+ return JSON.stringify(body, null, format === 'jsonl' ? 0 : 2);
1186
+ };
1187
+ const errorMessage = (value) => value && typeof value === 'object' && 'message' in value ? value.message : value;
1188
+ /** The `hint` on an error body, when the body is one and carries a non-empty hint. */
1189
+ const errorHintText = (value) => {
1190
+ if (!value || typeof value !== 'object')
1191
+ return '';
1192
+ const hint = value.hint;
1193
+ return typeof hint === 'string' ? hint : '';
1194
+ };
1195
+ const errorBody = (error, clientOptions, SDK, environment) => {
1196
+ if (error && typeof error === 'object') {
1197
+ const record = error;
1198
+ const hint = errorHint(record, clientOptions, environment);
1199
+ return {
1200
+ name: record.name,
1201
+ // Stable class identifier so a caller can branch on the kind of failure without parsing prose.
1202
+ code: errorCode(record, SDK),
1203
+ // The upstream message is passed through untouched; advice goes in `hint` beside it, so a
1204
+ // caller logging the message never loses what the API actually said.
1205
+ message: record.message ?? String(error),
1206
+ status: record.status,
1207
+ requestId: record.requestID ?? record.requestId,
1208
+ ...(hint !== undefined ? { hint } : {}),
1209
+ body: record.body ?? record.error,
1210
+ };
1211
+ }
1212
+ return { code: 'error', message: String(error) };
1213
+ };
1214
+ // Stable error class for the failure, derived from the HTTP status, or from the SDK error class
1215
+ // for transport failures that never reached a response. Drives both the `code` field and the
1216
+ // process exit status.
1217
+ const errorCode = (record, SDK) => {
1218
+ const status = typeof record.status === 'number' ? record.status : undefined;
1219
+ if (status === 401 || status === 403)
1220
+ return 'auth-failed';
1221
+ if (status === 404)
1222
+ return 'not-found';
1223
+ if (status === 429)
1224
+ return 'rate-limited';
1225
+ if (status !== undefined && status >= 400 && status < 500)
1226
+ return 'client-error';
1227
+ if (status !== undefined && status >= 500)
1228
+ return 'server-error';
1229
+ if (isConnectionError(record, SDK))
1230
+ return 'connection-error';
1231
+ return 'error';
1232
+ };
1233
+ // Identifies a transport failure — one that never reached a response, so there is no status to
1234
+ // classify it by.
1235
+ //
1236
+ // Matched by identity against the error class the SDK exposes as a static, never by class name:
1237
+ // release binaries are built with `bun build --compile --minify`, which renames classes, so
1238
+ // `constructor.name` there is a mangled single letter and `.name` is the inherited "Error". The
1239
+ // name check stays only as a fallback for a host object that is not an SDK error at all (an
1240
+ // undici `ConnectTimeoutError` surfacing through a custom fetch, say).
1241
+ // Transport failure codes Node and undici set on the error, none of which are CamelCase.
1242
+ const CONNECTION_ERROR_CODE = /^(ECONN|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|EHOSTUNREACH|ENETUNREACH|EPIPE|UND_ERR)/u;
1243
+ const isConnectionError = (record, SDK) => {
1244
+ const connectionError = SDK.APIConnectionError;
1245
+ if (typeof connectionError === 'function' &&
1246
+ record instanceof connectionError)
1247
+ return true;
1248
+ const name = typeof record.name === 'string' ? record.name : '';
1249
+ const code = typeof record.code === 'string' ? record.code : '';
1250
+ // Class names are CamelCase (`ConnectTimeoutError`) but Node/undici transport codes are
1251
+ // SCREAMING_SNAKE_CASE (`ECONNREFUSED`, `UND_ERR_CONNECT_TIMEOUT`), so the two need different
1252
+ // tests: a substring match on the code would never fire, leaving a host that cannot be reached
1253
+ // through a custom fetch falling through to the unclassified status.
1254
+ if (name.includes('Connection') || name.includes('Timeout'))
1255
+ return true;
1256
+ return CONNECTION_ERROR_CODE.test(code);
1257
+ };
1258
+ // One exit status per error class so a caller can decide what to do next — fix credentials, back
1259
+ // off, retry, give up — from the status alone.
1260
+ const ERROR_EXIT_CODES = {
1261
+ error: 1,
1262
+ 'auth-failed': 10,
1263
+ 'not-found': 11,
1264
+ 'rate-limited': 12,
1265
+ 'client-error': 13,
1266
+ 'server-error': 14,
1267
+ 'connection-error': 15,
1268
+ };
1269
+ const errorExitCode = (error, SDK) => {
1270
+ if (!error || typeof error !== 'object')
1271
+ return 1;
1272
+ return ERROR_EXIT_CODES[errorCode(error, SDK)] ?? 1;
1273
+ };
1274
+ exports.errorExitCode = errorExitCode;
1275
+ // Actionable next step for the classes where one exists, surfaced beside the upstream message.
1276
+ const errorHint = (error, clientOptions, environment) => {
1277
+ const status = error.status;
1278
+ if (status === 401)
1279
+ return authHint(clientOptions, environment);
1280
+ // 403 is a permission failure, not a credential one: the request authenticated fine, so
1281
+ // telling the caller to set the auth env var would send it round the same loop again.
1282
+ if (status === 403)
1283
+ return 'Access denied. The credential is valid but lacks permission for this resource.';
1284
+ if (status === 404)
1285
+ return 'Resource not found. Check the identifier and path arguments.';
1286
+ if (status === 429)
1287
+ return 'Rate limited. Wait and retry, or reduce request frequency.';
1288
+ return undefined;
1289
+ };
1290
+ // Undefined when the SDK declares no authentication: there would be no variable to name, and a
1291
+ // generic "set the required environment variable" would point at something that does not exist.
1292
+ const authHint = (clientOptions, environment) => {
1293
+ const authOptions = clientOptions.filter((option) => option.auth);
1294
+ if (authOptions.length === 0)
1295
+ return undefined;
1296
+ const env = authOptions
1297
+ .map((option) => option.env)
1298
+ .filter((value) => !!value)
1299
+ .join(', ');
1300
+ return ('Authentication failed. Run `' +
1301
+ loginCommandFor(environment) +
1302
+ '`' +
1303
+ (env ? ', or set ' + env : '') +
1304
+ ', and try again.');
1305
+ };
1306
+ // Keep transforms small and dependency-free; the CLI supports the common dot-path extraction case.
1307
+ const transformValue = (value, transform) => {
1308
+ if (!transform)
1309
+ return value;
1310
+ return transform
1311
+ .split('.')
1312
+ .filter(Boolean)
1313
+ .reduce((current, segment) => {
1314
+ if (current === undefined || current === null)
1315
+ return undefined;
1316
+ if (Array.isArray(current) && /^\\d+$/u.test(segment))
1317
+ return current[Number(segment)];
1318
+ if (typeof current === 'object')
1319
+ return current[segment];
1320
+ return undefined;
1321
+ }, value);
1322
+ };
1323
+ const throwWebSocketEventError = (value) => {
1324
+ if (!value || typeof value !== 'object')
1325
+ return;
1326
+ const record = value;
1327
+ if (record.type !== 'error')
1328
+ return;
1329
+ const error = record.error;
1330
+ if (error instanceof Error)
1331
+ throw error;
1332
+ throw new Error(typeof error === 'string' ? error : JSON.stringify(error ?? record));
1333
+ };
1334
+ const normalizeFormat = (value, fallback) => {
1335
+ if (value === 'auto' ||
1336
+ value === 'json' ||
1337
+ value === 'jsonl' ||
1338
+ value === 'pretty' ||
1339
+ value === 'raw' ||
1340
+ value === 'toon' ||
1341
+ value === 'yaml') {
1342
+ return value;
1343
+ }
1344
+ return fallback;
1345
+ };
1346
+ exports.normalizeFormat = normalizeFormat;
1347
+ const normalizeMaxItems = (value) => {
1348
+ if (value === undefined)
1349
+ return undefined;
1350
+ const parsed = Number(value);
1351
+ if (!Number.isFinite(parsed))
1352
+ return undefined;
1353
+ return Math.trunc(parsed);
1354
+ };
1355
+ const isAsyncIterable = (value) => !!value && typeof value[Symbol.asyncIterator] === 'function';
1356
+ //# sourceMappingURL=runtime.js.map