@boxes-dev/dvb-runtime 1.0.297 → 1.0.299

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 (488) hide show
  1. package/dist/bin/.bundle-state.json +2 -2
  2. package/dist/bin/dvb.cjs +6 -6
  3. package/dist/bin/dvbd.cjs +6 -6
  4. package/package.json +7 -5
  5. package/dist/devbox/auth.d.ts +0 -22
  6. package/dist/devbox/auth.d.ts.map +0 -1
  7. package/dist/devbox/auth.js +0 -233
  8. package/dist/devbox/auth.js.map +0 -1
  9. package/dist/devbox/browser.d.ts +0 -19
  10. package/dist/devbox/browser.d.ts.map +0 -1
  11. package/dist/devbox/browser.js +0 -60
  12. package/dist/devbox/browser.js.map +0 -1
  13. package/dist/devbox/cli.d.ts +0 -7
  14. package/dist/devbox/cli.d.ts.map +0 -1
  15. package/dist/devbox/cli.js +0 -124
  16. package/dist/devbox/cli.js.map +0 -1
  17. package/dist/devbox/commandRegistry/args.d.ts +0 -18
  18. package/dist/devbox/commandRegistry/args.d.ts.map +0 -1
  19. package/dist/devbox/commandRegistry/args.js +0 -107
  20. package/dist/devbox/commandRegistry/args.js.map +0 -1
  21. package/dist/devbox/commandRegistry/catalog.d.ts +0 -4
  22. package/dist/devbox/commandRegistry/catalog.d.ts.map +0 -1
  23. package/dist/devbox/commandRegistry/catalog.js +0 -763
  24. package/dist/devbox/commandRegistry/catalog.js.map +0 -1
  25. package/dist/devbox/commandRegistry/dispatch.d.ts +0 -3
  26. package/dist/devbox/commandRegistry/dispatch.d.ts.map +0 -1
  27. package/dist/devbox/commandRegistry/dispatch.js +0 -61
  28. package/dist/devbox/commandRegistry/dispatch.js.map +0 -1
  29. package/dist/devbox/commandRegistry/errors.d.ts +0 -8
  30. package/dist/devbox/commandRegistry/errors.d.ts.map +0 -1
  31. package/dist/devbox/commandRegistry/errors.js +0 -26
  32. package/dist/devbox/commandRegistry/errors.js.map +0 -1
  33. package/dist/devbox/commandRegistry/help.d.ts +0 -5
  34. package/dist/devbox/commandRegistry/help.d.ts.map +0 -1
  35. package/dist/devbox/commandRegistry/help.js +0 -94
  36. package/dist/devbox/commandRegistry/help.js.map +0 -1
  37. package/dist/devbox/commandRegistry/resolve.d.ts +0 -7
  38. package/dist/devbox/commandRegistry/resolve.d.ts.map +0 -1
  39. package/dist/devbox/commandRegistry/resolve.js +0 -32
  40. package/dist/devbox/commandRegistry/resolve.js.map +0 -1
  41. package/dist/devbox/commandRegistry/tab.d.ts +0 -10
  42. package/dist/devbox/commandRegistry/tab.d.ts.map +0 -1
  43. package/dist/devbox/commandRegistry/tab.js +0 -83
  44. package/dist/devbox/commandRegistry/tab.js.map +0 -1
  45. package/dist/devbox/commandRegistry/types.d.ts +0 -32
  46. package/dist/devbox/commandRegistry/types.d.ts.map +0 -1
  47. package/dist/devbox/commandRegistry/types.js +0 -2
  48. package/dist/devbox/commandRegistry/types.js.map +0 -1
  49. package/dist/devbox/commands/agent.d.ts +0 -52
  50. package/dist/devbox/commands/agent.d.ts.map +0 -1
  51. package/dist/devbox/commands/agent.js +0 -397
  52. package/dist/devbox/commands/agent.js.map +0 -1
  53. package/dist/devbox/commands/boxSelect.d.ts +0 -25
  54. package/dist/devbox/commands/boxSelect.d.ts.map +0 -1
  55. package/dist/devbox/commands/boxSelect.js +0 -94
  56. package/dist/devbox/commands/boxSelect.js.map +0 -1
  57. package/dist/devbox/commands/checkpoint.d.ts +0 -9
  58. package/dist/devbox/commands/checkpoint.d.ts.map +0 -1
  59. package/dist/devbox/commands/checkpoint.js +0 -105
  60. package/dist/devbox/commands/checkpoint.js.map +0 -1
  61. package/dist/devbox/commands/commandProvider.d.ts +0 -33
  62. package/dist/devbox/commands/commandProvider.d.ts.map +0 -1
  63. package/dist/devbox/commands/commandProvider.js +0 -156
  64. package/dist/devbox/commands/commandProvider.js.map +0 -1
  65. package/dist/devbox/commands/connect.d.ts +0 -39
  66. package/dist/devbox/commands/connect.d.ts.map +0 -1
  67. package/dist/devbox/commands/connect.js +0 -1367
  68. package/dist/devbox/commands/connect.js.map +0 -1
  69. package/dist/devbox/commands/connectSessionMapping.d.ts +0 -64
  70. package/dist/devbox/commands/connectSessionMapping.d.ts.map +0 -1
  71. package/dist/devbox/commands/connectSessionMapping.js +0 -153
  72. package/dist/devbox/commands/connectSessionMapping.js.map +0 -1
  73. package/dist/devbox/commands/cp.d.ts +0 -60
  74. package/dist/devbox/commands/cp.d.ts.map +0 -1
  75. package/dist/devbox/commands/cp.js +0 -383
  76. package/dist/devbox/commands/cp.js.map +0 -1
  77. package/dist/devbox/commands/daemon.d.ts +0 -4
  78. package/dist/devbox/commands/daemon.d.ts.map +0 -1
  79. package/dist/devbox/commands/daemon.js +0 -49
  80. package/dist/devbox/commands/daemon.js.map +0 -1
  81. package/dist/devbox/commands/destroy.d.ts +0 -2
  82. package/dist/devbox/commands/destroy.d.ts.map +0 -1
  83. package/dist/devbox/commands/destroy.js +0 -204
  84. package/dist/devbox/commands/destroy.js.map +0 -1
  85. package/dist/devbox/commands/destroyE2b.d.ts +0 -22
  86. package/dist/devbox/commands/destroyE2b.d.ts.map +0 -1
  87. package/dist/devbox/commands/destroyE2b.js +0 -12
  88. package/dist/devbox/commands/destroyE2b.js.map +0 -1
  89. package/dist/devbox/commands/destroyLocalState.d.ts +0 -34
  90. package/dist/devbox/commands/destroyLocalState.d.ts.map +0 -1
  91. package/dist/devbox/commands/destroyLocalState.js +0 -187
  92. package/dist/devbox/commands/destroyLocalState.js.map +0 -1
  93. package/dist/devbox/commands/destroyModal.d.ts +0 -21
  94. package/dist/devbox/commands/destroyModal.d.ts.map +0 -1
  95. package/dist/devbox/commands/destroyModal.js +0 -13
  96. package/dist/devbox/commands/destroyModal.js.map +0 -1
  97. package/dist/devbox/commands/destroyShared.d.ts +0 -14
  98. package/dist/devbox/commands/destroyShared.d.ts.map +0 -1
  99. package/dist/devbox/commands/destroyShared.js +0 -37
  100. package/dist/devbox/commands/destroyShared.js.map +0 -1
  101. package/dist/devbox/commands/fork.d.ts +0 -9
  102. package/dist/devbox/commands/fork.d.ts.map +0 -1
  103. package/dist/devbox/commands/fork.js +0 -94
  104. package/dist/devbox/commands/fork.js.map +0 -1
  105. package/dist/devbox/commands/ide.d.ts +0 -35
  106. package/dist/devbox/commands/ide.d.ts.map +0 -1
  107. package/dist/devbox/commands/ide.js +0 -987
  108. package/dist/devbox/commands/ide.js.map +0 -1
  109. package/dist/devbox/commands/init/args.d.ts +0 -18
  110. package/dist/devbox/commands/init/args.d.ts.map +0 -1
  111. package/dist/devbox/commands/init/args.js +0 -44
  112. package/dist/devbox/commands/init/args.js.map +0 -1
  113. package/dist/devbox/commands/init/clack.d.ts +0 -22
  114. package/dist/devbox/commands/init/clack.d.ts.map +0 -1
  115. package/dist/devbox/commands/init/clack.js +0 -158
  116. package/dist/devbox/commands/init/clack.js.map +0 -1
  117. package/dist/devbox/commands/init/claudeBootstrap.d.ts +0 -49
  118. package/dist/devbox/commands/init/claudeBootstrap.d.ts.map +0 -1
  119. package/dist/devbox/commands/init/claudeBootstrap.js +0 -504
  120. package/dist/devbox/commands/init/claudeBootstrap.js.map +0 -1
  121. package/dist/devbox/commands/init/codex/artifacts.d.ts +0 -49
  122. package/dist/devbox/commands/init/codex/artifacts.d.ts.map +0 -1
  123. package/dist/devbox/commands/init/codex/artifacts.js +0 -278
  124. package/dist/devbox/commands/init/codex/artifacts.js.map +0 -1
  125. package/dist/devbox/commands/init/codex/config.d.ts +0 -6
  126. package/dist/devbox/commands/init/codex/config.d.ts.map +0 -1
  127. package/dist/devbox/commands/init/codex/config.js +0 -43
  128. package/dist/devbox/commands/init/codex/config.js.map +0 -1
  129. package/dist/devbox/commands/init/codex/events.d.ts +0 -14
  130. package/dist/devbox/commands/init/codex/events.d.ts.map +0 -1
  131. package/dist/devbox/commands/init/codex/events.js +0 -435
  132. package/dist/devbox/commands/init/codex/events.js.map +0 -1
  133. package/dist/devbox/commands/init/codex/execConfig.d.ts +0 -5
  134. package/dist/devbox/commands/init/codex/execConfig.d.ts.map +0 -1
  135. package/dist/devbox/commands/init/codex/execConfig.js +0 -10
  136. package/dist/devbox/commands/init/codex/execConfig.js.map +0 -1
  137. package/dist/devbox/commands/init/codex/index.d.ts +0 -136
  138. package/dist/devbox/commands/init/codex/index.d.ts.map +0 -1
  139. package/dist/devbox/commands/init/codex/index.js +0 -1115
  140. package/dist/devbox/commands/init/codex/index.js.map +0 -1
  141. package/dist/devbox/commands/init/codex/local.d.ts +0 -124
  142. package/dist/devbox/commands/init/codex/local.d.ts.map +0 -1
  143. package/dist/devbox/commands/init/codex/local.js +0 -1381
  144. package/dist/devbox/commands/init/codex/local.js.map +0 -1
  145. package/dist/devbox/commands/init/codex/localExecArgs.d.ts +0 -25
  146. package/dist/devbox/commands/init/codex/localExecArgs.d.ts.map +0 -1
  147. package/dist/devbox/commands/init/codex/localExecArgs.js +0 -48
  148. package/dist/devbox/commands/init/codex/localExecArgs.js.map +0 -1
  149. package/dist/devbox/commands/init/codex/plan.d.ts +0 -99
  150. package/dist/devbox/commands/init/codex/plan.d.ts.map +0 -1
  151. package/dist/devbox/commands/init/codex/plan.js +0 -231
  152. package/dist/devbox/commands/init/codex/plan.js.map +0 -1
  153. package/dist/devbox/commands/init/codex/prompts.d.ts +0 -9
  154. package/dist/devbox/commands/init/codex/prompts.d.ts.map +0 -1
  155. package/dist/devbox/commands/init/codex/prompts.js +0 -51
  156. package/dist/devbox/commands/init/codex/prompts.js.map +0 -1
  157. package/dist/devbox/commands/init/codex/proxy.d.ts +0 -10
  158. package/dist/devbox/commands/init/codex/proxy.d.ts.map +0 -1
  159. package/dist/devbox/commands/init/codex/proxy.js +0 -32
  160. package/dist/devbox/commands/init/codex/proxy.js.map +0 -1
  161. package/dist/devbox/commands/init/codex/remote.d.ts +0 -96
  162. package/dist/devbox/commands/init/codex/remote.d.ts.map +0 -1
  163. package/dist/devbox/commands/init/codex/remote.js +0 -927
  164. package/dist/devbox/commands/init/codex/remote.js.map +0 -1
  165. package/dist/devbox/commands/init/codex/retry.d.ts +0 -17
  166. package/dist/devbox/commands/init/codex/retry.d.ts.map +0 -1
  167. package/dist/devbox/commands/init/codex/retry.js +0 -17
  168. package/dist/devbox/commands/init/codex/retry.js.map +0 -1
  169. package/dist/devbox/commands/init/codex/scanStatus.d.ts +0 -5
  170. package/dist/devbox/commands/init/codex/scanStatus.d.ts.map +0 -1
  171. package/dist/devbox/commands/init/codex/scanStatus.js +0 -27
  172. package/dist/devbox/commands/init/codex/scanStatus.js.map +0 -1
  173. package/dist/devbox/commands/init/codex/shellHistory.d.ts +0 -39
  174. package/dist/devbox/commands/init/codex/shellHistory.d.ts.map +0 -1
  175. package/dist/devbox/commands/init/codex/shellHistory.js +0 -258
  176. package/dist/devbox/commands/init/codex/shellHistory.js.map +0 -1
  177. package/dist/devbox/commands/init/codex/template.d.ts +0 -3
  178. package/dist/devbox/commands/init/codex/template.d.ts.map +0 -1
  179. package/dist/devbox/commands/init/codex/template.js +0 -3
  180. package/dist/devbox/commands/init/codex/template.js.map +0 -1
  181. package/dist/devbox/commands/init/finalizeFlow.d.ts +0 -95
  182. package/dist/devbox/commands/init/finalizeFlow.d.ts.map +0 -1
  183. package/dist/devbox/commands/init/finalizeFlow.js +0 -786
  184. package/dist/devbox/commands/init/finalizeFlow.js.map +0 -1
  185. package/dist/devbox/commands/init/index.d.ts +0 -11
  186. package/dist/devbox/commands/init/index.d.ts.map +0 -1
  187. package/dist/devbox/commands/init/index.js +0 -1058
  188. package/dist/devbox/commands/init/index.js.map +0 -1
  189. package/dist/devbox/commands/init/modal.d.ts +0 -5
  190. package/dist/devbox/commands/init/modal.d.ts.map +0 -1
  191. package/dist/devbox/commands/init/modal.js +0 -4
  192. package/dist/devbox/commands/init/modal.js.map +0 -1
  193. package/dist/devbox/commands/init/packaging.d.ts +0 -5
  194. package/dist/devbox/commands/init/packaging.d.ts.map +0 -1
  195. package/dist/devbox/commands/init/packaging.js +0 -81
  196. package/dist/devbox/commands/init/packaging.js.map +0 -1
  197. package/dist/devbox/commands/init/progress.d.ts +0 -31
  198. package/dist/devbox/commands/init/progress.d.ts.map +0 -1
  199. package/dist/devbox/commands/init/progress.js +0 -205
  200. package/dist/devbox/commands/init/progress.js.map +0 -1
  201. package/dist/devbox/commands/init/provider/e2b.d.ts +0 -29
  202. package/dist/devbox/commands/init/provider/e2b.d.ts.map +0 -1
  203. package/dist/devbox/commands/init/provider/e2b.js +0 -130
  204. package/dist/devbox/commands/init/provider/e2b.js.map +0 -1
  205. package/dist/devbox/commands/init/provider/e2bRuntime.d.ts +0 -39
  206. package/dist/devbox/commands/init/provider/e2bRuntime.d.ts.map +0 -1
  207. package/dist/devbox/commands/init/provider/e2bRuntime.js +0 -679
  208. package/dist/devbox/commands/init/provider/e2bRuntime.js.map +0 -1
  209. package/dist/devbox/commands/init/provider/index.d.ts +0 -8
  210. package/dist/devbox/commands/init/provider/index.d.ts.map +0 -1
  211. package/dist/devbox/commands/init/provider/index.js +0 -5
  212. package/dist/devbox/commands/init/provider/index.js.map +0 -1
  213. package/dist/devbox/commands/init/provider/modal.d.ts +0 -34
  214. package/dist/devbox/commands/init/provider/modal.d.ts.map +0 -1
  215. package/dist/devbox/commands/init/provider/modal.js +0 -274
  216. package/dist/devbox/commands/init/provider/modal.js.map +0 -1
  217. package/dist/devbox/commands/init/provider/modalRuntime.d.ts +0 -3
  218. package/dist/devbox/commands/init/provider/modalRuntime.d.ts.map +0 -1
  219. package/dist/devbox/commands/init/provider/modalRuntime.js +0 -2
  220. package/dist/devbox/commands/init/provider/modalRuntime.js.map +0 -1
  221. package/dist/devbox/commands/init/provider/resolve.d.ts +0 -44
  222. package/dist/devbox/commands/init/provider/resolve.d.ts.map +0 -1
  223. package/dist/devbox/commands/init/provider/resolve.js +0 -172
  224. package/dist/devbox/commands/init/provider/resolve.js.map +0 -1
  225. package/dist/devbox/commands/init/provider/shared.d.ts +0 -10
  226. package/dist/devbox/commands/init/provider/shared.d.ts.map +0 -1
  227. package/dist/devbox/commands/init/provider/shared.js +0 -2
  228. package/dist/devbox/commands/init/provider/shared.js.map +0 -1
  229. package/dist/devbox/commands/init/provider/sprites.d.ts +0 -30
  230. package/dist/devbox/commands/init/provider/sprites.d.ts.map +0 -1
  231. package/dist/devbox/commands/init/provider/sprites.js +0 -183
  232. package/dist/devbox/commands/init/provider/sprites.js.map +0 -1
  233. package/dist/devbox/commands/init/provider/types.d.ts +0 -19
  234. package/dist/devbox/commands/init/provider/types.d.ts.map +0 -1
  235. package/dist/devbox/commands/init/provider/types.js +0 -2
  236. package/dist/devbox/commands/init/provider/types.js.map +0 -1
  237. package/dist/devbox/commands/init/provisionFlow.d.ts +0 -53
  238. package/dist/devbox/commands/init/provisionFlow.d.ts.map +0 -1
  239. package/dist/devbox/commands/init/provisionFlow.js +0 -541
  240. package/dist/devbox/commands/init/provisionFlow.js.map +0 -1
  241. package/dist/devbox/commands/init/registry.d.ts +0 -15
  242. package/dist/devbox/commands/init/registry.d.ts.map +0 -1
  243. package/dist/devbox/commands/init/registry.js +0 -38
  244. package/dist/devbox/commands/init/registry.js.map +0 -1
  245. package/dist/devbox/commands/init/remote.d.ts +0 -48
  246. package/dist/devbox/commands/init/remote.d.ts.map +0 -1
  247. package/dist/devbox/commands/init/remote.js +0 -766
  248. package/dist/devbox/commands/init/remote.js.map +0 -1
  249. package/dist/devbox/commands/init/repo.d.ts +0 -45
  250. package/dist/devbox/commands/init/repo.d.ts.map +0 -1
  251. package/dist/devbox/commands/init/repo.js +0 -235
  252. package/dist/devbox/commands/init/repo.js.map +0 -1
  253. package/dist/devbox/commands/init/retryableErrors.d.ts +0 -4
  254. package/dist/devbox/commands/init/retryableErrors.d.ts.map +0 -1
  255. package/dist/devbox/commands/init/retryableErrors.js +0 -42
  256. package/dist/devbox/commands/init/retryableErrors.js.map +0 -1
  257. package/dist/devbox/commands/init/scanProgress.d.ts +0 -18
  258. package/dist/devbox/commands/init/scanProgress.d.ts.map +0 -1
  259. package/dist/devbox/commands/init/scanProgress.js +0 -47
  260. package/dist/devbox/commands/init/scanProgress.js.map +0 -1
  261. package/dist/devbox/commands/init/session.d.ts +0 -72
  262. package/dist/devbox/commands/init/session.d.ts.map +0 -1
  263. package/dist/devbox/commands/init/session.js +0 -348
  264. package/dist/devbox/commands/init/session.js.map +0 -1
  265. package/dist/devbox/commands/init/setupArtifactsValidation.d.ts +0 -28
  266. package/dist/devbox/commands/init/setupArtifactsValidation.d.ts.map +0 -1
  267. package/dist/devbox/commands/init/setupArtifactsValidation.js +0 -113
  268. package/dist/devbox/commands/init/setupArtifactsValidation.js.map +0 -1
  269. package/dist/devbox/commands/init/setupPlanFlow.d.ts +0 -34
  270. package/dist/devbox/commands/init/setupPlanFlow.d.ts.map +0 -1
  271. package/dist/devbox/commands/init/setupPlanFlow.js +0 -967
  272. package/dist/devbox/commands/init/setupPlanFlow.js.map +0 -1
  273. package/dist/devbox/commands/init/ssh.d.ts +0 -19
  274. package/dist/devbox/commands/init/ssh.d.ts.map +0 -1
  275. package/dist/devbox/commands/init/ssh.js +0 -276
  276. package/dist/devbox/commands/init/ssh.js.map +0 -1
  277. package/dist/devbox/commands/init/state.d.ts +0 -73
  278. package/dist/devbox/commands/init/state.d.ts.map +0 -1
  279. package/dist/devbox/commands/init/state.js +0 -118
  280. package/dist/devbox/commands/init/state.js.map +0 -1
  281. package/dist/devbox/commands/init/statusFlow.d.ts +0 -27
  282. package/dist/devbox/commands/init/statusFlow.d.ts.map +0 -1
  283. package/dist/devbox/commands/init/statusFlow.js +0 -160
  284. package/dist/devbox/commands/init/statusFlow.js.map +0 -1
  285. package/dist/devbox/commands/list.d.ts +0 -35
  286. package/dist/devbox/commands/list.d.ts.map +0 -1
  287. package/dist/devbox/commands/list.js +0 -311
  288. package/dist/devbox/commands/list.js.map +0 -1
  289. package/dist/devbox/commands/listFormatting.d.ts +0 -27
  290. package/dist/devbox/commands/listFormatting.d.ts.map +0 -1
  291. package/dist/devbox/commands/listFormatting.js +0 -155
  292. package/dist/devbox/commands/listFormatting.js.map +0 -1
  293. package/dist/devbox/commands/logout.d.ts +0 -2
  294. package/dist/devbox/commands/logout.d.ts.map +0 -1
  295. package/dist/devbox/commands/logout.js +0 -64
  296. package/dist/devbox/commands/logout.js.map +0 -1
  297. package/dist/devbox/commands/managedProviderClient.d.ts +0 -24
  298. package/dist/devbox/commands/managedProviderClient.d.ts.map +0 -1
  299. package/dist/devbox/commands/managedProviderClient.js +0 -42
  300. package/dist/devbox/commands/managedProviderClient.js.map +0 -1
  301. package/dist/devbox/commands/managedProviderContext.d.ts +0 -34
  302. package/dist/devbox/commands/managedProviderContext.d.ts.map +0 -1
  303. package/dist/devbox/commands/managedProviderContext.js +0 -34
  304. package/dist/devbox/commands/managedProviderContext.js.map +0 -1
  305. package/dist/devbox/commands/mount.d.ts +0 -25
  306. package/dist/devbox/commands/mount.d.ts.map +0 -1
  307. package/dist/devbox/commands/mount.js +0 -200
  308. package/dist/devbox/commands/mount.js.map +0 -1
  309. package/dist/devbox/commands/ports.d.ts +0 -11
  310. package/dist/devbox/commands/ports.d.ts.map +0 -1
  311. package/dist/devbox/commands/ports.js +0 -183
  312. package/dist/devbox/commands/ports.js.map +0 -1
  313. package/dist/devbox/commands/power.d.ts +0 -10
  314. package/dist/devbox/commands/power.d.ts.map +0 -1
  315. package/dist/devbox/commands/power.js +0 -139
  316. package/dist/devbox/commands/power.js.map +0 -1
  317. package/dist/devbox/commands/provider/daemonRuntimeShared.d.ts +0 -25
  318. package/dist/devbox/commands/provider/daemonRuntimeShared.d.ts.map +0 -1
  319. package/dist/devbox/commands/provider/daemonRuntimeShared.js +0 -217
  320. package/dist/devbox/commands/provider/daemonRuntimeShared.js.map +0 -1
  321. package/dist/devbox/commands/provider/directDaemonRuntime.d.ts +0 -106
  322. package/dist/devbox/commands/provider/directDaemonRuntime.d.ts.map +0 -1
  323. package/dist/devbox/commands/provider/directDaemonRuntime.js +0 -1442
  324. package/dist/devbox/commands/provider/directDaemonRuntime.js.map +0 -1
  325. package/dist/devbox/commands/provider/e2bCommandContext.d.ts +0 -11
  326. package/dist/devbox/commands/provider/e2bCommandContext.d.ts.map +0 -1
  327. package/dist/devbox/commands/provider/e2bCommandContext.js +0 -16
  328. package/dist/devbox/commands/provider/e2bCommandContext.js.map +0 -1
  329. package/dist/devbox/commands/provider/e2bLifecycleShared.d.ts +0 -20
  330. package/dist/devbox/commands/provider/e2bLifecycleShared.d.ts.map +0 -1
  331. package/dist/devbox/commands/provider/e2bLifecycleShared.js +0 -42
  332. package/dist/devbox/commands/provider/e2bLifecycleShared.js.map +0 -1
  333. package/dist/devbox/commands/provider/modalCommandContext.d.ts +0 -22
  334. package/dist/devbox/commands/provider/modalCommandContext.d.ts.map +0 -1
  335. package/dist/devbox/commands/provider/modalCommandContext.js +0 -47
  336. package/dist/devbox/commands/provider/modalCommandContext.js.map +0 -1
  337. package/dist/devbox/commands/provider/modalLifecycle.d.ts +0 -158
  338. package/dist/devbox/commands/provider/modalLifecycle.d.ts.map +0 -1
  339. package/dist/devbox/commands/provider/modalLifecycle.js +0 -702
  340. package/dist/devbox/commands/provider/modalLifecycle.js.map +0 -1
  341. package/dist/devbox/commands/provider/modalRuntime.d.ts +0 -25
  342. package/dist/devbox/commands/provider/modalRuntime.d.ts.map +0 -1
  343. package/dist/devbox/commands/provider/modalRuntime.js +0 -791
  344. package/dist/devbox/commands/provider/modalRuntime.js.map +0 -1
  345. package/dist/devbox/commands/provider/runtimeTypes.d.ts +0 -8
  346. package/dist/devbox/commands/provider/runtimeTypes.d.ts.map +0 -1
  347. package/dist/devbox/commands/provider/runtimeTypes.js +0 -2
  348. package/dist/devbox/commands/provider/runtimeTypes.js.map +0 -1
  349. package/dist/devbox/commands/providerClient.d.ts +0 -82
  350. package/dist/devbox/commands/providerClient.d.ts.map +0 -1
  351. package/dist/devbox/commands/providerClient.js +0 -719
  352. package/dist/devbox/commands/providerClient.js.map +0 -1
  353. package/dist/devbox/commands/reboot.d.ts +0 -8
  354. package/dist/devbox/commands/reboot.d.ts.map +0 -1
  355. package/dist/devbox/commands/reboot.js +0 -100
  356. package/dist/devbox/commands/reboot.js.map +0 -1
  357. package/dist/devbox/commands/reset.d.ts +0 -30
  358. package/dist/devbox/commands/reset.d.ts.map +0 -1
  359. package/dist/devbox/commands/reset.js +0 -114
  360. package/dist/devbox/commands/reset.js.map +0 -1
  361. package/dist/devbox/commands/runtimeClient.d.ts +0 -65
  362. package/dist/devbox/commands/runtimeClient.d.ts.map +0 -1
  363. package/dist/devbox/commands/runtimeClient.js +0 -127
  364. package/dist/devbox/commands/runtimeClient.js.map +0 -1
  365. package/dist/devbox/commands/sentryTest.d.ts +0 -2
  366. package/dist/devbox/commands/sentryTest.d.ts.map +0 -1
  367. package/dist/devbox/commands/sentryTest.js +0 -117
  368. package/dist/devbox/commands/sentryTest.js.map +0 -1
  369. package/dist/devbox/commands/services.d.ts +0 -2
  370. package/dist/devbox/commands/services.d.ts.map +0 -1
  371. package/dist/devbox/commands/services.js +0 -619
  372. package/dist/devbox/commands/services.js.map +0 -1
  373. package/dist/devbox/commands/servicesConfig.d.ts +0 -19
  374. package/dist/devbox/commands/servicesConfig.d.ts.map +0 -1
  375. package/dist/devbox/commands/servicesConfig.js +0 -61
  376. package/dist/devbox/commands/servicesConfig.js.map +0 -1
  377. package/dist/devbox/commands/servicesToml.d.ts +0 -13
  378. package/dist/devbox/commands/servicesToml.d.ts.map +0 -1
  379. package/dist/devbox/commands/servicesToml.js +0 -201
  380. package/dist/devbox/commands/servicesToml.js.map +0 -1
  381. package/dist/devbox/commands/sessionUtils.d.ts +0 -10
  382. package/dist/devbox/commands/sessionUtils.d.ts.map +0 -1
  383. package/dist/devbox/commands/sessionUtils.js +0 -48
  384. package/dist/devbox/commands/sessionUtils.js.map +0 -1
  385. package/dist/devbox/commands/sessions.d.ts +0 -3
  386. package/dist/devbox/commands/sessions.d.ts.map +0 -1
  387. package/dist/devbox/commands/sessions.js +0 -490
  388. package/dist/devbox/commands/sessions.js.map +0 -1
  389. package/dist/devbox/commands/setup.d.ts +0 -36
  390. package/dist/devbox/commands/setup.d.ts.map +0 -1
  391. package/dist/devbox/commands/setup.js +0 -816
  392. package/dist/devbox/commands/setup.js.map +0 -1
  393. package/dist/devbox/commands/setupClaude.d.ts +0 -51
  394. package/dist/devbox/commands/setupClaude.d.ts.map +0 -1
  395. package/dist/devbox/commands/setupClaude.js +0 -202
  396. package/dist/devbox/commands/setupClaude.js.map +0 -1
  397. package/dist/devbox/commands/setupTooling.d.ts +0 -56
  398. package/dist/devbox/commands/setupTooling.d.ts.map +0 -1
  399. package/dist/devbox/commands/setupTooling.js +0 -187
  400. package/dist/devbox/commands/setupTooling.js.map +0 -1
  401. package/dist/devbox/commands/sshAccess.d.ts +0 -31
  402. package/dist/devbox/commands/sshAccess.d.ts.map +0 -1
  403. package/dist/devbox/commands/sshAccess.js +0 -353
  404. package/dist/devbox/commands/sshAccess.js.map +0 -1
  405. package/dist/devbox/commands/sshConfig.d.ts +0 -23
  406. package/dist/devbox/commands/sshConfig.d.ts.map +0 -1
  407. package/dist/devbox/commands/sshConfig.js +0 -366
  408. package/dist/devbox/commands/sshConfig.js.map +0 -1
  409. package/dist/devbox/commands/sshProxy.d.ts +0 -2
  410. package/dist/devbox/commands/sshProxy.d.ts.map +0 -1
  411. package/dist/devbox/commands/sshProxy.js +0 -215
  412. package/dist/devbox/commands/sshProxy.js.map +0 -1
  413. package/dist/devbox/commands/uninstall.d.ts +0 -2
  414. package/dist/devbox/commands/uninstall.d.ts.map +0 -1
  415. package/dist/devbox/commands/uninstall.js +0 -365
  416. package/dist/devbox/commands/uninstall.js.map +0 -1
  417. package/dist/devbox/commands/upgrade.d.ts +0 -14
  418. package/dist/devbox/commands/upgrade.d.ts.map +0 -1
  419. package/dist/devbox/commands/upgrade.js +0 -60
  420. package/dist/devbox/commands/upgrade.js.map +0 -1
  421. package/dist/devbox/commands/version.d.ts +0 -8
  422. package/dist/devbox/commands/version.d.ts.map +0 -1
  423. package/dist/devbox/commands/version.js +0 -134
  424. package/dist/devbox/commands/version.js.map +0 -1
  425. package/dist/devbox/commands/whoami.d.ts +0 -2
  426. package/dist/devbox/commands/whoami.d.ts.map +0 -1
  427. package/dist/devbox/commands/whoami.js +0 -114
  428. package/dist/devbox/commands/whoami.js.map +0 -1
  429. package/dist/devbox/completions/cache.d.ts +0 -53
  430. package/dist/devbox/completions/cache.d.ts.map +0 -1
  431. package/dist/devbox/completions/cache.js +0 -227
  432. package/dist/devbox/completions/cache.js.map +0 -1
  433. package/dist/devbox/completions/index.d.ts +0 -18
  434. package/dist/devbox/completions/index.d.ts.map +0 -1
  435. package/dist/devbox/completions/index.js +0 -759
  436. package/dist/devbox/completions/index.js.map +0 -1
  437. package/dist/devbox/controlPlane.d.ts +0 -460
  438. package/dist/devbox/controlPlane.d.ts.map +0 -1
  439. package/dist/devbox/controlPlane.js +0 -1910
  440. package/dist/devbox/controlPlane.js.map +0 -1
  441. package/dist/devbox/daemonClient.d.ts +0 -44
  442. package/dist/devbox/daemonClient.d.ts.map +0 -1
  443. package/dist/devbox/daemonClient.js +0 -677
  444. package/dist/devbox/daemonClient.js.map +0 -1
  445. package/dist/devbox/e2bExecErrors.d.ts +0 -11
  446. package/dist/devbox/e2bExecErrors.d.ts.map +0 -1
  447. package/dist/devbox/e2bExecErrors.js +0 -19
  448. package/dist/devbox/e2bExecErrors.js.map +0 -1
  449. package/dist/devbox/latency.d.ts +0 -25
  450. package/dist/devbox/latency.d.ts.map +0 -1
  451. package/dist/devbox/latency.js +0 -186
  452. package/dist/devbox/latency.js.map +0 -1
  453. package/dist/devbox/logger.d.ts +0 -2
  454. package/dist/devbox/logger.d.ts.map +0 -1
  455. package/dist/devbox/logger.js +0 -3
  456. package/dist/devbox/logger.js.map +0 -1
  457. package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.d.ts +0 -11
  458. package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.d.ts.map +0 -1
  459. package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.js +0 -118
  460. package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.js.map +0 -1
  461. package/dist/devbox/terminal/osc.d.ts +0 -11
  462. package/dist/devbox/terminal/osc.d.ts.map +0 -1
  463. package/dist/devbox/terminal/osc.js +0 -84
  464. package/dist/devbox/terminal/osc.js.map +0 -1
  465. package/dist/devbox/terminal/sessionProtocol.d.ts +0 -46
  466. package/dist/devbox/terminal/sessionProtocol.d.ts.map +0 -1
  467. package/dist/devbox/terminal/sessionProtocol.js +0 -631
  468. package/dist/devbox/terminal/sessionProtocol.js.map +0 -1
  469. package/dist/devbox/ui/colors.d.ts +0 -19
  470. package/dist/devbox/ui/colors.d.ts.map +0 -1
  471. package/dist/devbox/ui/colors.js +0 -22
  472. package/dist/devbox/ui/colors.js.map +0 -1
  473. package/dist/devbox/ui/copyableUrl.d.ts +0 -4
  474. package/dist/devbox/ui/copyableUrl.d.ts.map +0 -1
  475. package/dist/devbox/ui/copyableUrl.js +0 -10
  476. package/dist/devbox/ui/copyableUrl.js.map +0 -1
  477. package/dist/devbox/ui/qr.d.ts +0 -3
  478. package/dist/devbox/ui/qr.d.ts.map +0 -1
  479. package/dist/devbox/ui/qr.js +0 -17
  480. package/dist/devbox/ui/qr.js.map +0 -1
  481. package/dist/devbox/ui/statusLine.d.ts +0 -14
  482. package/dist/devbox/ui/statusLine.d.ts.map +0 -1
  483. package/dist/devbox/ui/statusLine.js +0 -92
  484. package/dist/devbox/ui/statusLine.js.map +0 -1
  485. package/dist/devbox/updateNotice.d.ts +0 -2
  486. package/dist/devbox/updateNotice.d.ts.map +0 -1
  487. package/dist/devbox/updateNotice.js +0 -43
  488. package/dist/devbox/updateNotice.js.map +0 -1
@@ -1,679 +0,0 @@
1
- import path from "node:path";
2
- import { CommandExitError, NotFoundError, Sandbox } from "e2b";
3
- import { ProviderNotImplementedError, SpritesApiError, } from "@boxes-dev/core";
4
- import { createManagedCheckpoint, fetchE2bBootstrapConnectInfo, fetchManagedDaemonConnectInfo, isManagedDaemonNotReadyError, } from "../../../controlPlane.js";
5
- import { coerceE2bExecResponse } from "../../../e2bExecErrors.js";
6
- import { CORE_SERVICE_NAMES, mapDaemonControlSessionRecord, mapProviderServiceRecord, mapProviderServiceRecordToSpriteService, parseDaemonControlError, } from "../../provider/daemonRuntimeShared.js";
7
- import { DirectDaemonExecSocket, isDirectDaemonTransportError, runDirectDaemonControlRequest, } from "../../provider/directDaemonRuntime.js";
8
- const E2B_NATIVE_WRITE_THRESHOLD_BYTES = 512 * 1024;
9
- const E2B_DAEMON_CONTROL_TIMEOUT_MS = 15_000;
10
- const E2B_EXPECTED_RUNTIME_USER = "boxes";
11
- const E2B_EXPECTED_RUNTIME_HOME = "/home/boxes";
12
- const MANAGED_DAEMON_CONTROL_ERROR = "Managed daemon control request failed.";
13
- const requireAlias = (value) => {
14
- const alias = value.trim();
15
- if (!alias) {
16
- throw new Error("Devbox alias is required.");
17
- }
18
- return alias;
19
- };
20
- const requireControlPlaneToken = (value) => {
21
- const token = value.trim();
22
- if (!token) {
23
- throw new Error("Control plane session required for managed runtime operations.");
24
- }
25
- return token;
26
- };
27
- const shellQuote = (value) => `'${value.replace(/'/g, `'\\''`)}'`;
28
- const normalizeRemotePath = (targetPath, workingDir) => {
29
- const trimmedPath = targetPath.trim();
30
- if (!trimmedPath) {
31
- throw new Error("path is required.");
32
- }
33
- if (path.posix.isAbsolute(trimmedPath)) {
34
- return path.posix.normalize(trimmedPath);
35
- }
36
- const baseDir = workingDir?.trim();
37
- if (!baseDir) {
38
- throw new Error(`Relative path "${targetPath}" requires workingDir to be provided.`);
39
- }
40
- if (!path.posix.isAbsolute(baseDir)) {
41
- throw new Error(`workingDir must be absolute: ${workingDir}`);
42
- }
43
- return path.posix.normalize(path.posix.join(baseDir, trimmedPath));
44
- };
45
- const serializeCommand = (cmd) => {
46
- if (cmd.length === 0) {
47
- throw new Error("cmd must contain at least one argument.");
48
- }
49
- const [command, ...args] = cmd;
50
- if (!command || !command.trim()) {
51
- throw new Error("cmd[0] must be a non-empty string.");
52
- }
53
- return [command, ...args].map((segment) => shellQuote(segment)).join(" ");
54
- };
55
- const toArrayBuffer = (data) => {
56
- const bytes = Buffer.from(data);
57
- return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
58
- };
59
- const createBootstrapSandbox = (connectInfo) => new Sandbox({
60
- sandboxId: connectInfo.sandboxId,
61
- sandboxDomain: connectInfo.sandboxDomain,
62
- envdVersion: connectInfo.envdVersion,
63
- envdAccessToken: connectInfo.envdAccessToken,
64
- ...(connectInfo.trafficAccessToken
65
- ? { trafficAccessToken: connectInfo.trafficAccessToken }
66
- : {}),
67
- });
68
- const createDefaultBootstrapTransport = (options) => {
69
- const sandboxByAlias = new Map();
70
- const resolveSandbox = async (alias) => {
71
- const cached = sandboxByAlias.get(alias);
72
- if (cached) {
73
- return await cached;
74
- }
75
- const pending = options
76
- .resolveBootstrapConnectInfo(alias)
77
- .then((connectInfo) => createBootstrapSandbox(connectInfo))
78
- .catch((error) => {
79
- sandboxByAlias.delete(alias);
80
- throw error;
81
- });
82
- sandboxByAlias.set(alias, pending);
83
- return await pending;
84
- };
85
- return {
86
- exec: async (alias, cmd, execOptions) => {
87
- const sandbox = await resolveSandbox(alias);
88
- try {
89
- const completed = await sandbox.commands.run(serializeCommand(cmd), {
90
- ...(typeof execOptions?.timeoutMs === "number"
91
- ? { timeoutMs: execOptions.timeoutMs }
92
- : {}),
93
- });
94
- return {
95
- exitCode: completed.exitCode,
96
- stdout: completed.stdout,
97
- stderr: completed.stderr,
98
- };
99
- }
100
- catch (error) {
101
- if (error instanceof CommandExitError) {
102
- const providerError = typeof error.error === "string" ? error.error.trim() : "";
103
- const stderr = error.stderr || providerError;
104
- return {
105
- exitCode: error.exitCode,
106
- stdout: error.stdout,
107
- stderr,
108
- };
109
- }
110
- throw error;
111
- }
112
- },
113
- readFile: async (alias, readOptions) => {
114
- const sandbox = await resolveSandbox(alias);
115
- const resolvedPath = normalizeRemotePath(readOptions.path, readOptions.workingDir);
116
- try {
117
- return await sandbox.files.read(resolvedPath, { format: "bytes" });
118
- }
119
- catch (error) {
120
- if (error instanceof NotFoundError) {
121
- throw new Error(`E2B_FILE_NOT_FOUND:${resolvedPath}`);
122
- }
123
- throw error;
124
- }
125
- },
126
- writeFile: async (alias, writeOptions) => {
127
- const sandbox = await resolveSandbox(alias);
128
- const resolvedPath = normalizeRemotePath(writeOptions.path);
129
- await sandbox.files.write(resolvedPath, toArrayBuffer(writeOptions.data));
130
- },
131
- };
132
- };
133
- const buildE2bRuntimeIdentityCommand = () => [
134
- "/bin/bash",
135
- "--noprofile",
136
- "--norc",
137
- "-lc",
138
- [
139
- "set -euo pipefail",
140
- 'printf \'user=%s\\nhome=%s\\npwd=%s\\n\' "$(whoami)" "$HOME" "$PWD"',
141
- ].join("\n"),
142
- ];
143
- const parseE2bRuntimeIdentity = (stdout) => {
144
- const values = new Map();
145
- for (const line of stdout.split(/\r?\n/)) {
146
- const separatorIndex = line.indexOf("=");
147
- if (separatorIndex <= 0) {
148
- continue;
149
- }
150
- const key = line.slice(0, separatorIndex).trim();
151
- const value = line.slice(separatorIndex + 1).trim();
152
- if (!key || !value) {
153
- continue;
154
- }
155
- values.set(key, value);
156
- }
157
- const user = values.get("user") ?? "";
158
- const home = values.get("home") ?? "";
159
- const pwd = values.get("pwd") ?? "";
160
- if (!user || !home || !pwd) {
161
- throw new Error(`Managed runtime identity probe returned unexpected output: ${stdout.trim() || "(empty)"}`);
162
- }
163
- return { user, home, pwd };
164
- };
165
- const formatE2bRuntimeIdentity = (identity) => `user=${identity.user} home=${identity.home} pwd=${identity.pwd}`;
166
- const buildUnsupportedE2bRuntimeIdentityMessage = (alias, identity) => [
167
- `Devbox "${alias}" is using an unsupported runtime identity ${formatE2bRuntimeIdentity(identity)}.`,
168
- `Expected user=${E2B_EXPECTED_RUNTIME_USER} home=${E2B_EXPECTED_RUNTIME_HOME} pwd=${E2B_EXPECTED_RUNTIME_HOME}.`,
169
- "This devbox was provisioned from an outdated managed template.",
170
- "Destroy it and re-run `dvb init` after updating the managed template.",
171
- ].join(" ");
172
- const parseKillTimeoutOption = (value) => {
173
- if (!value)
174
- return undefined;
175
- const trimmed = value.trim().toLowerCase();
176
- if (!trimmed)
177
- return undefined;
178
- const match = /^(\d+)(ms|s|m)?$/.exec(trimmed);
179
- if (!match)
180
- return undefined;
181
- const amount = Number.parseInt(match[1] ?? "", 10);
182
- if (!Number.isFinite(amount) || amount <= 0) {
183
- return undefined;
184
- }
185
- const unit = match[2] ?? "ms";
186
- if (unit === "ms")
187
- return amount;
188
- if (unit === "s")
189
- return amount * 1000;
190
- if (unit === "m")
191
- return amount * 60_000;
192
- return undefined;
193
- };
194
- const isE2bBootstrapPendingError = (error) => {
195
- if (isDirectDaemonTransportError(error)) {
196
- return error.retryable;
197
- }
198
- if (isManagedDaemonNotReadyError(error)) {
199
- return error.provider === "e2b" && error.state === "pending";
200
- }
201
- const message = error instanceof Error ? error.message : String(error);
202
- return (message.includes("Failed to read managed daemon config") ||
203
- message.includes("daemon host is unavailable"));
204
- };
205
- const coerceBootstrapReadFileError = (targetPath, error) => {
206
- const message = error instanceof Error ? error.message : String(error);
207
- if (message.includes("E2B_FILE_NOT_FOUND:")) {
208
- throw new SpritesApiError(404, "GET", targetPath, "path does not exist");
209
- }
210
- throw error;
211
- };
212
- const throwE2bNotImplemented = (capability) => {
213
- throw new ProviderNotImplementedError({
214
- provider: "e2b",
215
- capability,
216
- message: `Managed init runtime capability "${capability}" is not implemented yet.`,
217
- });
218
- };
219
- const createE2bInitRuntimeClient = (options) => {
220
- const controlPlaneToken = requireControlPlaneToken(options.controlPlaneToken);
221
- const serviceRole = options.serviceRole ?? "user";
222
- const transportMode = options.transportMode ?? "auto";
223
- const daemonConnectInfoByAlias = new Map();
224
- const daemonReadyAliases = new Set();
225
- const resolveBootstrapConnectInfo = options.resolveBootstrapConnectInfo ??
226
- (async (alias) => {
227
- const info = await fetchE2bBootstrapConnectInfo(controlPlaneToken, alias);
228
- return {
229
- sandboxId: info.sandboxId,
230
- sandboxDomain: info.sandboxDomain,
231
- envdVersion: info.envdVersion,
232
- envdAccessToken: info.envdAccessToken,
233
- trafficAccessToken: info.trafficAccessToken,
234
- };
235
- });
236
- const bootstrapTransport = options.bootstrapTransport ??
237
- createDefaultBootstrapTransport({ resolveBootstrapConnectInfo });
238
- const bootstrapIdentityByAlias = new Map();
239
- const ensureBootstrapRuntimeIdentity = async (name) => {
240
- const alias = requireAlias(name);
241
- const cached = bootstrapIdentityByAlias.get(alias);
242
- if (cached) {
243
- await cached;
244
- return;
245
- }
246
- const pending = bootstrapTransport
247
- .exec(alias, buildE2bRuntimeIdentityCommand(), {
248
- timeoutMs: E2B_DAEMON_CONTROL_TIMEOUT_MS,
249
- })
250
- .then((result) => {
251
- if (result.exitCode !== 0) {
252
- throw new Error(`Managed runtime identity check failed for "${alias}": ${result.stderr || result.stdout || "unknown error"}`);
253
- }
254
- const identity = parseE2bRuntimeIdentity(result.stdout);
255
- if (identity.user !== E2B_EXPECTED_RUNTIME_USER ||
256
- identity.home !== E2B_EXPECTED_RUNTIME_HOME ||
257
- identity.pwd !== E2B_EXPECTED_RUNTIME_HOME) {
258
- throw new Error(buildUnsupportedE2bRuntimeIdentityMessage(alias, identity));
259
- }
260
- })
261
- .catch((error) => {
262
- bootstrapIdentityByAlias.delete(alias);
263
- throw error;
264
- });
265
- bootstrapIdentityByAlias.set(alias, pending);
266
- await pending;
267
- };
268
- const createCheckpoint = async (name, checkpointOptions) => {
269
- const alias = requireAlias(name);
270
- return await createManagedCheckpoint(controlPlaneToken, alias, checkpointOptions?.comment);
271
- };
272
- const resolveDaemonConnectInfo = async ({ alias: rawAlias, forceRefresh, allowWake, }) => {
273
- const alias = requireAlias(rawAlias);
274
- if (forceRefresh) {
275
- daemonConnectInfoByAlias.delete(alias);
276
- }
277
- const cached = daemonConnectInfoByAlias.get(alias);
278
- if (cached) {
279
- const info = await cached;
280
- return {
281
- provider: "e2b",
282
- url: info.url,
283
- authToken: info.token,
284
- };
285
- }
286
- const resolveConnectInfo = options.resolveDaemonConnectInfo ??
287
- (async (resolvedAlias) => {
288
- const connectInfo = await fetchManagedDaemonConnectInfo(controlPlaneToken, resolvedAlias, "proxy", allowWake);
289
- if (connectInfo.provider !== "e2b") {
290
- throw new Error(`Managed daemon connect returned provider "${connectInfo.provider}" for alias "${resolvedAlias}".`);
291
- }
292
- return connectInfo;
293
- });
294
- const pending = resolveConnectInfo(alias)
295
- .then((info) => ({
296
- url: info.url,
297
- token: info.token,
298
- }))
299
- .catch((error) => {
300
- daemonConnectInfoByAlias.delete(alias);
301
- throw error;
302
- });
303
- daemonConnectInfoByAlias.set(alias, pending);
304
- const info = await pending;
305
- return {
306
- provider: "e2b",
307
- url: info.url,
308
- authToken: info.token,
309
- };
310
- };
311
- const runControlRequest = async (name, requestPayload, expectedType, timeoutMs = E2B_DAEMON_CONTROL_TIMEOUT_MS) => {
312
- const alias = requireAlias(name);
313
- return await runDirectDaemonControlRequest({
314
- alias,
315
- provider: "e2b",
316
- resolveConnectInfo: resolveDaemonConnectInfo,
317
- requestPayload,
318
- expectedType,
319
- timeoutMs,
320
- });
321
- };
322
- const exec = async (name, cmd, execOptions) => {
323
- const alias = requireAlias(name);
324
- if (transportMode === "bootstrap_only") {
325
- await ensureBootstrapRuntimeIdentity(alias);
326
- return await bootstrapTransport.exec(alias, cmd, {
327
- ...(typeof execOptions?.timeoutMs === "number"
328
- ? { timeoutMs: execOptions.timeoutMs }
329
- : {}),
330
- });
331
- }
332
- let response;
333
- try {
334
- response = await runControlRequest(alias, {
335
- type: "exec",
336
- cmd,
337
- ...(typeof execOptions?.timeoutMs === "number"
338
- ? { timeoutMs: execOptions.timeoutMs }
339
- : {}),
340
- }, "exec_result", typeof execOptions?.timeoutMs === "number"
341
- ? Math.max(E2B_DAEMON_CONTROL_TIMEOUT_MS, execOptions.timeoutMs + 5_000)
342
- : E2B_DAEMON_CONTROL_TIMEOUT_MS);
343
- daemonReadyAliases.add(alias);
344
- }
345
- catch (error) {
346
- if (daemonReadyAliases.has(alias) || !isE2bBootstrapPendingError(error)) {
347
- throw error;
348
- }
349
- await ensureBootstrapRuntimeIdentity(alias);
350
- return await bootstrapTransport.exec(alias, cmd, {
351
- ...(typeof execOptions?.timeoutMs === "number"
352
- ? { timeoutMs: execOptions.timeoutMs }
353
- : {}),
354
- });
355
- }
356
- if (response.status !== "ok") {
357
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
358
- throw new Error(text);
359
- }
360
- return coerceE2bExecResponse(response);
361
- };
362
- const writeFileWithBootstrapTransport = async (alias, remotePath, bytes, writeOptions) => {
363
- await ensureBootstrapRuntimeIdentity(alias);
364
- await bootstrapTransport.writeFile(alias, {
365
- path: remotePath,
366
- data: bytes,
367
- });
368
- writeOptions?.onProgress?.(bytes.length, bytes.length);
369
- };
370
- const readFile = async (name, readOptions) => {
371
- const alias = requireAlias(name);
372
- if (transportMode === "bootstrap_only") {
373
- await ensureBootstrapRuntimeIdentity(alias);
374
- try {
375
- return await bootstrapTransport.readFile(alias, {
376
- path: readOptions.path,
377
- ...(typeof readOptions.workingDir === "string"
378
- ? { workingDir: readOptions.workingDir }
379
- : {}),
380
- });
381
- }
382
- catch (error) {
383
- return coerceBootstrapReadFileError(readOptions.path, error);
384
- }
385
- }
386
- let response;
387
- try {
388
- response = await runControlRequest(alias, {
389
- type: "fs_read",
390
- path: readOptions.path,
391
- ...(typeof readOptions.workingDir === "string"
392
- ? { workingDir: readOptions.workingDir }
393
- : {}),
394
- }, "fs_read_result");
395
- daemonReadyAliases.add(alias);
396
- }
397
- catch (error) {
398
- if (daemonReadyAliases.has(alias) || !isE2bBootstrapPendingError(error)) {
399
- throw error;
400
- }
401
- await ensureBootstrapRuntimeIdentity(alias);
402
- try {
403
- return await bootstrapTransport.readFile(alias, {
404
- path: readOptions.path,
405
- ...(typeof readOptions.workingDir === "string"
406
- ? { workingDir: readOptions.workingDir }
407
- : {}),
408
- });
409
- }
410
- catch (bootstrapError) {
411
- return coerceBootstrapReadFileError(readOptions.path, bootstrapError);
412
- }
413
- }
414
- if (response.status !== "ok") {
415
- const { code, text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
416
- if (code === "not_found") {
417
- throw new SpritesApiError(404, "GET", readOptions.path, text);
418
- }
419
- throw new Error(text);
420
- }
421
- const data = typeof response.data === "string"
422
- ? Buffer.from(response.data, "base64")
423
- : Buffer.alloc(0);
424
- return new Uint8Array(data);
425
- };
426
- const writeFile = async (name, remotePath, data, writeOptions) => {
427
- const alias = requireAlias(name);
428
- const bytes = Uint8Array.from(data);
429
- writeOptions?.onProgress?.(0, bytes.length);
430
- if (transportMode === "bootstrap_only" ||
431
- bytes.length > E2B_NATIVE_WRITE_THRESHOLD_BYTES) {
432
- await writeFileWithBootstrapTransport(alias, remotePath, bytes, writeOptions);
433
- return;
434
- }
435
- let response;
436
- try {
437
- response = await runControlRequest(alias, {
438
- type: "fs_write",
439
- path: remotePath,
440
- mkdir: true,
441
- data: Buffer.from(bytes).toString("base64"),
442
- }, "fs_write_result");
443
- daemonReadyAliases.add(alias);
444
- }
445
- catch (error) {
446
- if (daemonReadyAliases.has(alias) || !isE2bBootstrapPendingError(error)) {
447
- throw error;
448
- }
449
- await writeFileWithBootstrapTransport(alias, remotePath, bytes, writeOptions);
450
- return;
451
- }
452
- if (response.status !== "ok") {
453
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
454
- throw new Error(text);
455
- }
456
- writeOptions?.onProgress?.(bytes.length, bytes.length);
457
- };
458
- const listServiceRecords = async (name) => {
459
- const response = await runControlRequest(name, { type: "services_list" }, "services_list_result");
460
- if (response.status !== "ok") {
461
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
462
- throw new Error(text);
463
- }
464
- const records = Array.isArray(response.services) ? response.services : [];
465
- return records.map((entry) => mapProviderServiceRecord(entry));
466
- };
467
- const getServiceRecord = async (name, service) => {
468
- const response = await runControlRequest(name, { type: "service_get", serviceName: service }, "service_get_result");
469
- if (response.status !== "ok") {
470
- const { code, text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
471
- if (code === "service_not_found") {
472
- return null;
473
- }
474
- throw new Error(text);
475
- }
476
- return mapProviderServiceRecord(response.service);
477
- };
478
- const upsertServiceRecord = async (name, service, input) => {
479
- const response = await runControlRequest(name, {
480
- type: "service_upsert",
481
- serviceName: service,
482
- actor: serviceRole,
483
- scope: input.scope,
484
- cmd: input.cmd,
485
- args: input.args,
486
- httpPort: input.httpPort,
487
- workingDir: input.workingDir,
488
- autostart: input.autostart,
489
- restartPolicy: input.restartPolicy,
490
- }, "service_upsert_result");
491
- if (response.status !== "ok") {
492
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
493
- throw new Error(text);
494
- }
495
- return mapProviderServiceRecord(response.service);
496
- };
497
- const listExecSessions = async (name) => {
498
- const response = await runControlRequest(name, { type: "sessions_list" }, "sessions_list_result");
499
- if (response.status !== "ok") {
500
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
501
- throw new Error(text);
502
- }
503
- const records = Array.isArray(response.sessions) ? response.sessions : [];
504
- const sessions = [];
505
- for (const entry of records) {
506
- const mapped = mapDaemonControlSessionRecord(entry);
507
- if (!mapped)
508
- continue;
509
- sessions.push(mapped);
510
- }
511
- return sessions;
512
- };
513
- const killExecSession = async (name, sessionId, options) => {
514
- const alias = requireAlias(name);
515
- const normalizedSessionId = sessionId.trim();
516
- if (!normalizedSessionId) {
517
- throw new Error("Session id is required.");
518
- }
519
- const timeoutMs = parseKillTimeoutOption(options?.timeout);
520
- const response = await runControlRequest(alias, {
521
- type: "session_kill",
522
- sessionId: normalizedSessionId,
523
- ...(options?.signal ? { signal: options.signal } : {}),
524
- ...(typeof timeoutMs === "number" ? { timeoutMs } : {}),
525
- }, "session_kill_result", typeof timeoutMs === "number"
526
- ? Math.max(E2B_DAEMON_CONTROL_TIMEOUT_MS, timeoutMs + 5_000)
527
- : E2B_DAEMON_CONTROL_TIMEOUT_MS);
528
- if (response.status !== "ok") {
529
- const { code, text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
530
- if (code === "not_found") {
531
- throw new SpritesApiError(404, "DELETE", `/v1/sprites/${encodeURIComponent(alias)}/exec/${encodeURIComponent(normalizedSessionId)}`, text);
532
- }
533
- throw new Error(text);
534
- }
535
- return Array.isArray(response.events)
536
- ? response.events
537
- .filter((entry) => entry && typeof entry === "object")
538
- .map((entry) => entry)
539
- : [{ event: "killed", session_id: normalizedSessionId }];
540
- };
541
- const listServices = async (name) => {
542
- const records = await listServiceRecords(name);
543
- return records.map((record) => mapProviderServiceRecordToSpriteService(record));
544
- };
545
- const getService = async (name, service) => {
546
- const record = await getServiceRecord(name, service);
547
- return record ? mapProviderServiceRecordToSpriteService(record) : null;
548
- };
549
- const createService = async (name, service, input) => {
550
- if (!input.cmd || !input.cmd.trim()) {
551
- throw new Error(`Service "${service}" is missing a command.`);
552
- }
553
- if (input.needs && input.needs.length > 0) {
554
- throw new Error("Service dependencies are not supported yet.");
555
- }
556
- const record = await upsertServiceRecord(name, service, {
557
- scope: CORE_SERVICE_NAMES.has(service) ? "core" : "user",
558
- cmd: input.cmd.trim(),
559
- args: input.args ?? [],
560
- httpPort: typeof input.httpPort === "number" ? input.httpPort : null,
561
- workingDir: null,
562
- autostart: true,
563
- restartPolicy: "always",
564
- });
565
- if (!record) {
566
- throw new Error(`Service "${service}" failed to initialize.`);
567
- }
568
- return mapProviderServiceRecordToSpriteService(record);
569
- };
570
- const startService = async (name, service) => {
571
- const response = await runControlRequest(name, { type: "service_start", serviceName: service, actor: serviceRole }, "service_start_result");
572
- if (response.status !== "ok") {
573
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
574
- throw new Error(text);
575
- }
576
- return Array.isArray(response.events)
577
- ? response.events
578
- .filter((entry) => entry && typeof entry === "object")
579
- .map((entry) => entry)
580
- : [{ event: "started", service }];
581
- };
582
- const stopService = async (name, service, options) => {
583
- const response = await runControlRequest(name, {
584
- type: "service_stop",
585
- serviceName: service,
586
- actor: serviceRole,
587
- ...(options?.timeout ? { timeout: options.timeout } : {}),
588
- }, "service_stop_result");
589
- if (response.status !== "ok") {
590
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
591
- throw new Error(text);
592
- }
593
- return Array.isArray(response.events)
594
- ? response.events
595
- .filter((entry) => entry && typeof entry === "object")
596
- .map((entry) => entry)
597
- : [{ event: "stopped", service }];
598
- };
599
- const signalService = async (name, service, options) => {
600
- const response = await runControlRequest(name, {
601
- type: "service_signal",
602
- serviceName: service,
603
- actor: serviceRole,
604
- signal: typeof options?.signal === "string" &&
605
- options.signal.trim().length > 0
606
- ? options.signal.trim()
607
- : "TERM",
608
- }, "service_signal_result");
609
- if (response.status !== "ok") {
610
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
611
- throw new Error(text);
612
- }
613
- return Array.isArray(response.events)
614
- ? response.events
615
- .filter((entry) => entry && typeof entry === "object")
616
- .map((entry) => entry)
617
- : [{ event: "signaled", service }];
618
- };
619
- const deleteService = async (name, service) => {
620
- const response = await runControlRequest(name, { type: "service_delete", serviceName: service, actor: serviceRole }, "service_delete_result");
621
- if (response.status !== "ok") {
622
- const { code, text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
623
- if (code === "service_not_found") {
624
- throw new SpritesApiError(404, "DELETE", `/v1/sprites/${encodeURIComponent(name)}/services/${encodeURIComponent(service)}`, text);
625
- }
626
- throw new Error(text);
627
- }
628
- };
629
- const readServiceLogs = async (name, service, options) => {
630
- const tailValue = typeof options?.tail === "number" && Number.isFinite(options.tail)
631
- ? Math.max(1, Math.min(20_000, Math.floor(options.tail)))
632
- : 200;
633
- const response = await runControlRequest(name, { type: "service_logs_tail", serviceName: service, tail: tailValue }, "service_logs_tail_result");
634
- if (response.status !== "ok") {
635
- const { text } = parseDaemonControlError(response, MANAGED_DAEMON_CONTROL_ERROR);
636
- throw new Error(text);
637
- }
638
- const lines = Array.isArray(response.lines)
639
- ? response.lines.map((entry) => String(entry))
640
- : [];
641
- return lines.join("\n");
642
- };
643
- const openExecSession = (name, options) => {
644
- const alias = requireAlias(name);
645
- return new DirectDaemonExecSocket("e2b", resolveDaemonConnectInfo, alias, options);
646
- };
647
- const attachExecSession = (name, sessionId) => {
648
- const alias = requireAlias(name);
649
- return new DirectDaemonExecSocket("e2b", resolveDaemonConnectInfo, alias, {
650
- cmd: [],
651
- tty: true,
652
- stdin: true,
653
- sessionId,
654
- });
655
- };
656
- return {
657
- exec,
658
- readFile,
659
- writeFile,
660
- createCheckpoint,
661
- listExecSessions,
662
- killExecSession,
663
- listServices,
664
- getService,
665
- createService,
666
- startService,
667
- stopService,
668
- signalService,
669
- deleteService,
670
- readServiceLogs,
671
- listServiceRecords,
672
- getServiceRecord,
673
- upsertServiceRecord,
674
- openExecSession,
675
- attachExecSession,
676
- };
677
- };
678
- export { createE2bInitRuntimeClient };
679
- //# sourceMappingURL=e2bRuntime.js.map