@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,1058 +0,0 @@
1
- import path from "node:path";
2
- import os from "node:os";
3
- import { cancel as clackCancel, confirm as clackConfirm, isCancel, } from "@clack/prompts";
4
- import { resolveSocketInfo } from "@boxes-dev/core";
5
- import { createSecretStore, loadConfig, resolveCodexAuthMode, normalizeGitRemoteUrl, resolveRemoteRelayBaseUrl, resolveRelayBaseUrl, resolveDevboxProjectDir, SpritesApiError, slugify, } from "@boxes-dev/core";
6
- import { DAEMON_TIMEOUT_MS, ensureDaemonRunning, requestJson, requireDaemonFeatures, } from "../../daemonClient.js";
7
- import { ensureSpritesToken } from "../../auth.js";
8
- import { ensureModalDaemonInstalled, fetchManagedDaemonConnectInfo, fetchResolvedModalCredentials, fetchSpriteDaemonRelease, getConvexUrl, isManagedDaemonNotReadyError, issueSpriteDaemonToken, markE2bDaemonBootstrapFailed, markE2bDaemonBootstrapReady, upsertModalDevboxLifecycle, } from "../../controlPlane.js";
9
- import { logger } from "../../logger.js";
10
- import { parseInitArgs } from "./args.js";
11
- import { getErrorCode, isRetryableInitError } from "./retryableErrors.js";
12
- import { runInitStatusFlow } from "./statusFlow.js";
13
- import { acquireInitSessionLock, createCodexCheckpointRecorder, createInitStateUpdater, extractInitCheckpointId, prepareInitSessionState, } from "./session.js";
14
- import { findRepoRoot, ensureRepoProjectId, readRepoOrigin } from "./repo.js";
15
- import { bootstrapDevbox, ensureSpriteDaemonService, expandHome, installSpriteDaemon, resolveRemoteHomeDir, shellQuote, } from "./remote.js";
16
- import { readRepoMarker, removeRepoMarker, writeRepoMarker, } from "./registry.js";
17
- import { hasCompletedManagedInitSetup, hasInitRemoteState, readInitState, writeInitState, } from "./state.js";
18
- import { ensureKnownHostsFile, ensureLocalSshKey, ensureRemoteSshAccess, ensureSshdService, readLocalSshPublicKey, } from "../sshAccess.js";
19
- import { ensureRemoteCodexInstalled } from "./codex/index.js";
20
- import { runInitStep } from "./progress.js";
21
- import { runSetupPlanFlow } from "./setupPlanFlow.js";
22
- import { hasResumeRemoteRepoState, reconcileResumeRemoteRepoState, runProvisionFlow, } from "./provisionFlow.js";
23
- import { runFinalizeFlow } from "./finalizeFlow.js";
24
- import { runE2bProviderInitPhases, resolveInitProviderClient, runModalProviderInitPhases, runSpritesProviderInitPhases, } from "./provider/index.js";
25
- import { createE2bInitRuntimeClient } from "./provider/e2bRuntime.js";
26
- import { resolveModalSandboxTimeoutMs, } from "../provider/modalLifecycle.js";
27
- const requireDaemonJsonOk = (response, label) => {
28
- if (response.status >= 200 && response.status < 300) {
29
- return response.body;
30
- }
31
- const parseError = response.parseError
32
- ? ` (invalid json: ${response.parseError})`
33
- : "";
34
- const raw = typeof response.rawBody === "string" && response.rawBody.trim().length > 0
35
- ? response.rawBody.trim()
36
- : "";
37
- const snippet = raw ? raw.slice(0, 500) : "";
38
- throw new Error(`${label} failed: daemon returned ${response.status}${parseError}${snippet ? `: ${snippet}` : ""}`);
39
- };
40
- const resolveInitStatus = (steps, complete) => {
41
- if (complete || hasCompletedManagedInitSetup(steps))
42
- return "complete";
43
- if (steps?.setupUploaded && steps?.workdirProvisioned) {
44
- return "remote_ready";
45
- }
46
- return "local_required";
47
- };
48
- const mergeLocalPaths = (existing, repoRoot) => {
49
- const merged = new Set(existing ?? []);
50
- merged.add(repoRoot);
51
- return [...merged];
52
- };
53
- const buildRemoteInitPaths = (workdir, remoteHome) => {
54
- const expandedWorkdir = expandHome(workdir, remoteHome);
55
- return {
56
- remoteHome,
57
- expandedWorkdir,
58
- remoteSetupPath: path.posix.join(expandedWorkdir, ".devbox", "setup.json"),
59
- remoteArtifactsBundlePath: path.posix.join(expandedWorkdir, ".devbox", "setup-artifacts.tgz"),
60
- remoteArtifactsManifestPath: path.posix.join(expandedWorkdir, ".devbox", "setup-artifacts.json"),
61
- remoteArtifactsPartsDescriptorPath: path.posix.join(expandedWorkdir, ".devbox", "setup-artifacts.parts.json"),
62
- };
63
- };
64
- const shouldRetryManagedInitCompletionValidation = (error) => isRetryableInitError(error) ||
65
- (isManagedDaemonNotReadyError(error) && error.state === "pending");
66
- const DEFAULT_INIT_STEP_RETRIES = 3;
67
- const ALIAS_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
68
- const RESERVED_ALIAS_PATTERN = /^dvb-[a-f0-9]{12}-/;
69
- const DEFAULT_COMPUTE_PROVIDER = "e2b";
70
- const delay = async (ms) => new Promise((resolve) => setTimeout(resolve, ms));
71
- const normalizeAlias = (value) => value.trim().toLowerCase();
72
- export const resolveComputeProvider = ({ requested, checkpoint, registry, marker, shouldResume, allowCheckpointOverride, }) => {
73
- if (requested &&
74
- checkpoint &&
75
- requested !== checkpoint &&
76
- !allowCheckpointOverride) {
77
- throw new Error(`Init checkpoint compute provider is "${checkpoint}", but --compute was "${requested}". Re-run with \`--compute ${checkpoint}\` or \`dvb init --force --compute ${requested}\`.`);
78
- }
79
- if (shouldResume && checkpoint && registry && checkpoint !== registry) {
80
- throw new Error(`Init checkpoint compute provider is "${checkpoint}", but registry compute provider is "${registry}". Re-run with \`dvb init --force --compute ${registry}\` to reset state.`);
81
- }
82
- return (requested ?? checkpoint ?? registry ?? marker ?? DEFAULT_COMPUTE_PROVIDER);
83
- };
84
- const validateAlias = (alias) => {
85
- if (!alias) {
86
- throw new Error("Alias is required.");
87
- }
88
- if (RESERVED_ALIAS_PATTERN.test(alias)) {
89
- throw new Error(`Alias "${alias}" is reserved. Choose an alias that does not start with dvb-<12 hex>-.`);
90
- }
91
- if (!ALIAS_PATTERN.test(alias)) {
92
- throw new Error(`Invalid alias "${alias}". Use lowercase letters, numbers, and dashes.`);
93
- }
94
- };
95
- const computeRetryDelayMs = (retryIndex) => {
96
- // retryIndex is 1-based (1..N)
97
- const base = 500;
98
- const cap = 5000;
99
- const exp = Math.min(cap, base * 2 ** Math.max(0, retryIndex - 1));
100
- const jitter = Math.floor(Math.random() * 150);
101
- return exp + jitter;
102
- };
103
- const retryInitStep = async ({ status, title, retries = DEFAULT_INIT_STEP_RETRIES, shouldRetry = isRetryableInitError, fn, }) => {
104
- let lastError = null;
105
- const maxRetries = Math.max(0, Math.floor(retries));
106
- const attempts = maxRetries + 1;
107
- for (let attempt = 1; attempt <= attempts; attempt += 1) {
108
- try {
109
- return await fn();
110
- }
111
- catch (error) {
112
- lastError = error;
113
- const retryIndex = attempt; // 1-based retry count for the next attempt
114
- if (retryIndex > maxRetries || !shouldRetry(error)) {
115
- throw error;
116
- }
117
- status.stage(`${title} (retry ${retryIndex}/${maxRetries})`);
118
- logger.warn("init_step_retry", {
119
- title,
120
- retry: retryIndex,
121
- retries: maxRetries,
122
- errorName: error instanceof Error ? error.name : undefined,
123
- errorMessage: error instanceof Error ? error.message : String(error),
124
- errorCode: getErrorCode(error),
125
- ...(error instanceof SpritesApiError ? { status: error.status } : {}),
126
- });
127
- await delay(computeRetryDelayMs(retryIndex));
128
- }
129
- }
130
- throw lastError instanceof Error
131
- ? lastError
132
- : new Error(`Init step failed: ${title}`);
133
- };
134
- const throwInitCanceled = () => {
135
- clackCancel("Init canceled.");
136
- throw new Error("Init canceled.");
137
- };
138
- const confirmDestroyExistingDevbox = async ({ existingEntry, parsed, }) => {
139
- if (parsed.yes)
140
- return true;
141
- if (!process.stdin.isTTY || parsed.json) {
142
- throw new Error(`Repo already initialized (box: ${existingEntry.canonical}). Re-run with --force --yes to destroy and recreate.`);
143
- }
144
- const displayAlias = existingEntry.alias?.trim() || existingEntry.canonical;
145
- const prompt = {
146
- message: `Devbox "${displayAlias}" already exists. Destroy it and continue init?`,
147
- active: "Destroy and continue",
148
- inactive: "Abort init",
149
- initialValue: false,
150
- };
151
- const confirmedDestroy = await clackConfirm(prompt);
152
- if (isCancel(confirmedDestroy)) {
153
- throwInitCanceled();
154
- }
155
- if (!confirmedDestroy) {
156
- throw new Error("Init canceled.");
157
- }
158
- return true;
159
- };
160
- export const runInit = async (args) => {
161
- const parsed = parseInitArgs(args);
162
- const progressEnabled = process.stdout.isTTY && !parsed.json;
163
- const run = async () => {
164
- const detected = await runInitStep({
165
- enabled: progressEnabled,
166
- title: "Detecting repository",
167
- fn: async () => {
168
- const cwd = process.cwd();
169
- const repoRoot = await findRepoRoot(cwd);
170
- const repoName = path.basename(repoRoot);
171
- const slug = slugify(repoName);
172
- const localHomeDir = process.env.HOME ?? os.homedir();
173
- // Recoverability contract:
174
- // - Every init step must be idempotent and/or checkpointed in init-state.json.
175
- // - `complete` must only be true when the setup is actually usable without
176
- // additional `dvb init --resume` work.
177
- // See: apps/cli/docs/INIT_RECOVERABILITY.md
178
- const projectId = await ensureRepoProjectId(repoRoot);
179
- const projectDir = resolveDevboxProjectDir(projectId, localHomeDir);
180
- const repoMarker = await readRepoMarker(projectDir);
181
- const origin = await readRepoOrigin(repoRoot);
182
- const normalizedOrigin = origin ? normalizeGitRemoteUrl(origin) : null;
183
- const fingerprint = projectId;
184
- let initState = await readInitState(projectDir);
185
- const initFingerprintMismatch = Boolean(initState?.fingerprint) &&
186
- initState?.fingerprint !== fingerprint;
187
- if (!initFingerprintMismatch &&
188
- initState?.complete &&
189
- !hasCompletedManagedInitSetup(initState.steps)) {
190
- // Older versions could mark init "complete" before both remote Codex
191
- // setup and post-setup validation had finished. Treat this as
192
- // incomplete so `dvb init --resume` can recover.
193
- initState = { ...initState, complete: false };
194
- await writeInitState(projectDir, initState);
195
- }
196
- if (!initFingerprintMismatch &&
197
- initState?.complete &&
198
- hasCompletedManagedInitSetup(initState.steps) &&
199
- !initState.checkpoints?.postCodexSetup?.id) {
200
- // Prior behavior could finish setup before creating the post-setup
201
- // snapshot, then mark init complete on resume. Keep init resumable
202
- // until the post-setup snapshot is recorded.
203
- initState = { ...initState, complete: false };
204
- await writeInitState(projectDir, initState);
205
- }
206
- return {
207
- repoRoot,
208
- repoName,
209
- slug,
210
- localHomeDir,
211
- projectId,
212
- projectDir,
213
- repoMarker,
214
- origin,
215
- normalizedOrigin,
216
- fingerprint,
217
- initState,
218
- initFingerprintMismatch,
219
- };
220
- },
221
- });
222
- const { repoRoot, repoName, slug, localHomeDir, projectId, projectDir, repoMarker, origin, normalizedOrigin, fingerprint, } = detected;
223
- let initState = detected.initState;
224
- const initFingerprintMismatch = detected.initFingerprintMismatch;
225
- if (await runInitStatusFlow({
226
- parsed,
227
- repoRoot,
228
- origin,
229
- normalizedOrigin,
230
- projectId,
231
- projectDir,
232
- fingerprint,
233
- repoMarker,
234
- initState,
235
- initFingerprintMismatch,
236
- requireDaemonJsonOk,
237
- resolveInitStatus,
238
- })) {
239
- return;
240
- }
241
- const initSessionLock = await acquireInitSessionLock(projectDir);
242
- try {
243
- const preparedSession = await prepareInitSessionState({
244
- parsed,
245
- requestedComputeProvider: parsed.compute,
246
- initState,
247
- initFingerprintMismatch,
248
- projectDir,
249
- fingerprint,
250
- });
251
- initState = preparedSession.initState;
252
- const { shouldResume, nonInteractive, skipCodexCliEnsure } = preparedSession;
253
- const getInitState = () => initState;
254
- const { updateInitState } = createInitStateUpdater({
255
- fingerprint,
256
- projectDir,
257
- getInitState,
258
- setInitState: (next) => {
259
- initState = next;
260
- },
261
- });
262
- const recordCodexCheckpoint = createCodexCheckpointRecorder({
263
- repoName,
264
- fingerprint,
265
- getInitState,
266
- updateInitState,
267
- extractCheckpointId: extractInitCheckpointId,
268
- onCheckpointIdMissing: ({ canonical, phaseLabel }) => {
269
- logger.warn("init_checkpoint_id_missing", {
270
- box: canonical,
271
- fingerprint,
272
- phase: phaseLabel,
273
- });
274
- },
275
- onCheckpointMetaUpdateFailed: ({ canonical, phaseLabel, error }) => {
276
- logger.warn("init_checkpoint_meta_update_failed", {
277
- box: canonical,
278
- fingerprint,
279
- phase: phaseLabel,
280
- error,
281
- });
282
- },
283
- });
284
- const socketInfo = resolveSocketInfo();
285
- await runInitStep({
286
- enabled: progressEnabled,
287
- title: "Starting dvbd",
288
- fn: async () => {
289
- await ensureDaemonRunning(socketInfo.socketPath);
290
- await requireDaemonFeatures(socketInfo.socketPath, ["registry"]);
291
- },
292
- });
293
- let existingEntry = await runInitStep({
294
- enabled: progressEnabled,
295
- title: "Checking devboxes",
296
- fn: async () => {
297
- const existingProject = await requestJson(socketInfo.socketPath, "GET", `/registry/project?fingerprint=${encodeURIComponent(fingerprint)}`, DAEMON_TIMEOUT_MS.registry);
298
- return (requireDaemonJsonOk(existingProject, "Checking devboxes (/registry/project)").project ?? null);
299
- },
300
- });
301
- if (existingEntry && !parsed.force) {
302
- if (shouldResume) {
303
- const pendingAlias = normalizeAlias(initState?.alias ?? "");
304
- const existingAlias = normalizeAlias(existingEntry.alias ?? "");
305
- if (pendingAlias && existingAlias && existingAlias !== pendingAlias) {
306
- throw new Error(`Repo already initialized (alias: ${existingAlias}) and does not match pending init (alias: ${pendingAlias}).`);
307
- }
308
- }
309
- else {
310
- await confirmDestroyExistingDevbox({
311
- existingEntry,
312
- parsed,
313
- });
314
- parsed.force = true;
315
- }
316
- }
317
- const computeProvider = resolveComputeProvider({
318
- requested: parsed.compute,
319
- checkpoint: hasInitRemoteState(initState)
320
- ? initState?.computeProvider
321
- : undefined,
322
- registry: existingEntry?.computeProvider,
323
- marker: repoMarker?.computeProvider,
324
- shouldResume,
325
- allowCheckpointOverride: parsed.force && !shouldResume,
326
- });
327
- const alias = normalizeAlias(parsed.alias ?? initState?.alias ?? existingEntry?.alias ?? slug);
328
- validateAlias(alias);
329
- const workdir = `~/${slug}`;
330
- await updateInitState({ computeProvider, alias, workdir });
331
- let { remoteHome, expandedWorkdir, remoteSetupPath, remoteArtifactsBundlePath, remoteArtifactsManifestPath, remoteArtifactsPartsDescriptorPath, } = buildRemoteInitPaths(workdir, computeProvider === "modal"
332
- ? "/root"
333
- : computeProvider === "e2b"
334
- ? "/home/boxes"
335
- : "/home/sprite");
336
- const pathSetup = 'export PATH="$HOME/.local/bin:$PATH"';
337
- let canonical = alias;
338
- let projectCreatedAt = existingEntry?.createdAt ?? new Date().toISOString();
339
- let projectLocalPaths = mergeLocalPaths(existingEntry?.localPaths, repoRoot);
340
- let projectOrigin = normalizedOrigin ?? existingEntry?.origin ?? undefined;
341
- const resetProjectMetadata = () => {
342
- projectCreatedAt = new Date().toISOString();
343
- projectLocalPaths = [repoRoot];
344
- projectOrigin = normalizedOrigin ?? undefined;
345
- };
346
- const buildProjectEntry = (initStatus) => ({
347
- fingerprint,
348
- alias,
349
- computeProvider,
350
- providerInstanceId: canonical,
351
- origin: projectOrigin,
352
- createdAt: projectCreatedAt,
353
- initStatus,
354
- initUpdatedAt: new Date().toISOString(),
355
- localPaths: projectLocalPaths,
356
- });
357
- const updateRegistryProjectStatus = async (initStatus) => {
358
- const response = await requestJson(socketInfo.socketPath, "POST", "/registry/upsert", DAEMON_TIMEOUT_MS.registry, {
359
- project: buildProjectEntry(initStatus),
360
- });
361
- requireDaemonJsonOk(response, "Updating registry project (/registry/upsert)");
362
- };
363
- const resolveRegistryProject = async () => await runInitStep({
364
- enabled: progressEnabled,
365
- title: "Resolving devbox",
366
- fn: async () => {
367
- const response = await requestJson(socketInfo.socketPath, "GET", `/registry/project?fingerprint=${encodeURIComponent(fingerprint)}`, DAEMON_TIMEOUT_MS.registry);
368
- return (requireDaemonJsonOk(response, "Resolving devbox (/registry/project)").project ?? null);
369
- },
370
- });
371
- const writeLocalMetadata = async (resolvedCanonical) => await runInitStep({
372
- enabled: progressEnabled,
373
- title: "Writing local metadata",
374
- fn: async () => {
375
- await writeRepoMarker(projectDir, {
376
- fingerprint,
377
- canonical: resolvedCanonical,
378
- alias,
379
- computeProvider,
380
- });
381
- },
382
- });
383
- const clearLocalMetadata = async () => {
384
- await removeRepoMarker(projectDir);
385
- };
386
- if (parsed.force && !shouldResume && !existingEntry && repoMarker) {
387
- await clearLocalMetadata();
388
- }
389
- const modalOperationOptions = computeProvider === "modal"
390
- ? await runInitStep({
391
- enabled: progressEnabled,
392
- title: "Loading managed devbox access",
393
- fn: async ({ status }) => {
394
- status.stage("Loading devbox config");
395
- const config = await loadConfig(process.env.HOME ? { homeDir: process.env.HOME } : undefined);
396
- const store = await createSecretStore(config?.tokenStore, process.env.HOME ? { homeDir: process.env.HOME } : undefined);
397
- const { controlPlaneToken } = await ensureSpritesToken(store, (message) => status.stage(message));
398
- if (!controlPlaneToken) {
399
- throw new Error("Missing control plane session. Run `dvb setup` in a TTY first.");
400
- }
401
- status.stage("Resolving Modal credentials");
402
- const resolved = await fetchResolvedModalCredentials(controlPlaneToken);
403
- const tokenId = typeof resolved.tokenId === "string"
404
- ? resolved.tokenId.trim()
405
- : "";
406
- const tokenSecret = typeof resolved.tokenSecret === "string"
407
- ? resolved.tokenSecret.trim()
408
- : "";
409
- if ((tokenId && !tokenSecret) || (!tokenId && tokenSecret)) {
410
- throw new Error("Modal credentials are incomplete. Re-run `dvb setup --modal-auth byo --modal-token-id <id> --modal-token-secret <secret>`.");
411
- }
412
- return {
413
- credentials: {
414
- mode: "auto",
415
- controlPlaneToken,
416
- spritesToken: null,
417
- modalTokenId: tokenId || null,
418
- modalTokenSecret: tokenSecret || null,
419
- e2bApiKey: null,
420
- },
421
- };
422
- },
423
- })
424
- : undefined;
425
- if (computeProvider === "modal") {
426
- const modalResult = await runModalProviderInitPhases({
427
- parsed,
428
- shouldResume,
429
- alias,
430
- workdir,
431
- progressEnabled,
432
- getInitState,
433
- updateInitState,
434
- updateRegistryProjectStatus,
435
- resolveInitStatus,
436
- existingEntry,
437
- canonical,
438
- clearLocalMetadata,
439
- resetProjectMetadata,
440
- resolveRegistryProject,
441
- writeLocalMetadata,
442
- throwInitCanceled,
443
- ...(modalOperationOptions ? { modalOperationOptions } : {}),
444
- });
445
- existingEntry = modalResult.existingEntry;
446
- canonical = modalResult.canonical;
447
- }
448
- const runtime = await runInitStep({
449
- enabled: progressEnabled,
450
- title: "Loading devbox config",
451
- fn: async ({ status }) => {
452
- const config = await loadConfig(process.env.HOME ? { homeDir: process.env.HOME } : undefined);
453
- const store = await createSecretStore(config?.tokenStore, process.env.HOME ? { homeDir: process.env.HOME } : undefined);
454
- const relayBaseUrl = resolveRelayBaseUrl(config);
455
- const { token, controlPlaneToken } = await ensureSpritesToken(store, (message) => status.stage(message));
456
- return {
457
- config,
458
- relayBaseUrl,
459
- token,
460
- controlPlaneToken,
461
- };
462
- },
463
- });
464
- const config = runtime.config;
465
- const controlPlaneToken = runtime.controlPlaneToken;
466
- const modalCredentialContext = {
467
- mode: "auto",
468
- controlPlaneToken: controlPlaneToken ? controlPlaneToken.trim() : null,
469
- spritesToken: runtime.token ? runtime.token.trim() : null,
470
- modalTokenId: modalOperationOptions?.credentials?.modalTokenId ?? null,
471
- modalTokenSecret: modalOperationOptions?.credentials?.modalTokenSecret ?? null,
472
- e2bApiKey: null,
473
- };
474
- const client = computeProvider === "modal"
475
- ? (() => {
476
- const modalSandbox = initState?.modal;
477
- if (!modalSandbox?.sandboxId || !modalSandbox.appName) {
478
- throw new Error("Modal init state is missing sandbox metadata after provisioning.");
479
- }
480
- return resolveInitProviderClient({
481
- computeProvider: "modal",
482
- modal: {
483
- alias,
484
- appName: modalSandbox.appName,
485
- sandboxId: modalSandbox.sandboxId,
486
- credentials: modalCredentialContext,
487
- },
488
- });
489
- })()
490
- : computeProvider === "e2b"
491
- ? resolveInitProviderClient({
492
- computeProvider: "e2b",
493
- e2b: {
494
- credentials: {
495
- mode: "shared",
496
- controlPlaneToken: controlPlaneToken && controlPlaneToken.trim().length > 0
497
- ? controlPlaneToken.trim()
498
- : null,
499
- spritesToken: runtime.token ? runtime.token.trim() : null,
500
- modalTokenId: null,
501
- modalTokenSecret: null,
502
- e2bApiKey: null,
503
- },
504
- },
505
- })
506
- : resolveInitProviderClient({
507
- computeProvider: "sprites",
508
- sprites: {
509
- apiBaseUrl: runtime.relayBaseUrl,
510
- token: runtime.token,
511
- },
512
- });
513
- if (computeProvider === "modal") {
514
- await runInitStep({
515
- enabled: progressEnabled,
516
- title: "Registering modal lifecycle",
517
- fn: async () => {
518
- const token = (controlPlaneToken ?? "").trim();
519
- if (!token) {
520
- throw new Error("Control plane session required to register modal lifecycle.");
521
- }
522
- const modalSandbox = initState?.modal;
523
- if (!modalSandbox?.sandboxId ||
524
- !modalSandbox.appName ||
525
- !modalSandbox.appId ||
526
- !Array.isArray(modalSandbox.regions)) {
527
- throw new Error("Modal init state is missing sandbox metadata for lifecycle registration.");
528
- }
529
- await upsertModalDevboxLifecycle(token, {
530
- alias,
531
- appName: modalSandbox.appName,
532
- appId: modalSandbox.appId,
533
- sandboxId: modalSandbox.sandboxId,
534
- timeoutMs: modalSandbox.timeoutMs ?? resolveModalSandboxTimeoutMs(),
535
- memorySnapshotEnabled: modalSandbox.memorySnapshotEnabled ?? false,
536
- regions: modalSandbox.regions,
537
- ...(modalSandbox.imageTag
538
- ? { imageTag: modalSandbox.imageTag }
539
- : {}),
540
- ...(modalSandbox.platformVersion
541
- ? { runningPlatformVersion: modalSandbox.platformVersion }
542
- : {}),
543
- ...(modalSandbox.bootstrapContractVersion
544
- ? {
545
- runningBootstrapContractVersion: modalSandbox.bootstrapContractVersion,
546
- }
547
- : {}),
548
- runningStartedAt: Date.now(),
549
- });
550
- },
551
- });
552
- }
553
- const initCodexAuthMode = resolveCodexAuthMode(config);
554
- const localInitCodexProxyOptions = initCodexAuthMode === "proxy"
555
- ? {
556
- relayBaseUrl: runtime.relayBaseUrl,
557
- controlPlaneToken: (controlPlaneToken ?? "").trim(),
558
- }
559
- : undefined;
560
- const remoteInitCodexProxyOptions = initCodexAuthMode === "proxy"
561
- ? {
562
- relayBaseUrl: resolveRemoteRelayBaseUrl(config),
563
- controlPlaneToken: (controlPlaneToken ?? "").trim(),
564
- }
565
- : undefined;
566
- if (initCodexAuthMode === "proxy" &&
567
- !localInitCodexProxyOptions?.controlPlaneToken) {
568
- throw new Error("Control plane session required for init Codex proxy mode.");
569
- }
570
- if (computeProvider === "sprites") {
571
- const spritesResult = await runSpritesProviderInitPhases({
572
- parsed,
573
- shouldResume,
574
- alias,
575
- workdir,
576
- fingerprint,
577
- progressEnabled,
578
- client,
579
- getInitState,
580
- updateInitState,
581
- existingEntry,
582
- canonical,
583
- socketPath: socketInfo.socketPath,
584
- ensurePortsFeature: async () => await requireDaemonFeatures(socketInfo.socketPath, ["ports"]),
585
- clearLocalMetadata,
586
- resetProjectMetadata,
587
- throwInitCanceled,
588
- });
589
- existingEntry = spritesResult.existingEntry;
590
- canonical = spritesResult.canonical;
591
- }
592
- if (computeProvider === "e2b") {
593
- const e2bResult = await runE2bProviderInitPhases({
594
- parsed,
595
- shouldResume,
596
- alias,
597
- workdir,
598
- progressEnabled,
599
- client,
600
- getInitState,
601
- updateInitState,
602
- existingEntry,
603
- canonical,
604
- socketPath: socketInfo.socketPath,
605
- ensurePortsFeature: async () => await requireDaemonFeatures(socketInfo.socketPath, ["ports"]),
606
- clearLocalMetadata,
607
- resetProjectMetadata,
608
- throwInitCanceled,
609
- });
610
- existingEntry = e2bResult.existingEntry;
611
- canonical = e2bResult.canonical;
612
- }
613
- if (computeProvider === "modal") {
614
- await runInitStep({
615
- enabled: progressEnabled,
616
- title: "Installing remote daemon",
617
- fn: async ({ status, fail }) => {
618
- try {
619
- const token = (controlPlaneToken ?? "").trim();
620
- if (!token) {
621
- throw new Error("Control plane session required to install daemon.");
622
- }
623
- await retryInitStep({
624
- status,
625
- title: "Installing remote daemon",
626
- fn: async () => {
627
- status.stage("Installing via control plane");
628
- await ensureModalDaemonInstalled(token, alias);
629
- },
630
- });
631
- await updateInitState({ steps: { daemonInstalled: true } });
632
- }
633
- catch (error) {
634
- logger.warn("sprite_daemon_install_failed", {
635
- box: canonical,
636
- error: String(error),
637
- });
638
- fail("Installing remote daemon (failed)");
639
- throw error;
640
- }
641
- },
642
- });
643
- }
644
- await runInitStep({
645
- enabled: progressEnabled,
646
- title: "Bootstrapping devbox",
647
- fn: async ({ status, fail }) => {
648
- try {
649
- await retryInitStep({
650
- status,
651
- title: "Bootstrapping devbox",
652
- retries: 5,
653
- fn: async () => await bootstrapDevbox(client, alias, {
654
- onPhase: (completedPhases, totalPhases, detail) => {
655
- status.phaseProgress({
656
- title: "Bootstrapping devbox",
657
- completedPhases,
658
- totalPhases,
659
- detail,
660
- });
661
- },
662
- }),
663
- });
664
- }
665
- catch (error) {
666
- logger.warn("devbox_bootstrap_failed", {
667
- box: canonical,
668
- error: String(error),
669
- });
670
- fail("Bootstrapping devbox (failed)");
671
- throw error;
672
- }
673
- },
674
- });
675
- const initialStatus = resolveInitStatus(initState?.steps, initState?.complete);
676
- if (!shouldResume || !initState?.steps.registrySynced) {
677
- await runInitStep({
678
- enabled: progressEnabled,
679
- title: "Syncing devboxes",
680
- fn: async () => {
681
- await updateRegistryProjectStatus(initialStatus);
682
- await updateInitState({
683
- canonical,
684
- alias,
685
- workdir,
686
- steps: { registrySynced: true },
687
- });
688
- },
689
- });
690
- }
691
- if (shouldResume &&
692
- computeProvider === "e2b" &&
693
- !initState?.steps.daemonInstalled) {
694
- try {
695
- await ensureSpriteDaemonService({
696
- client,
697
- spriteName: alias,
698
- computeProvider,
699
- });
700
- if (controlPlaneToken) {
701
- await markE2bDaemonBootstrapReady(controlPlaneToken, alias);
702
- }
703
- await updateInitState({ steps: { daemonInstalled: true } });
704
- }
705
- catch (error) {
706
- logger.info("sprite_daemon_resume_probe_failed", {
707
- box: canonical,
708
- error: String(error),
709
- });
710
- }
711
- }
712
- if (computeProvider !== "modal" &&
713
- (!shouldResume || !initState?.steps.daemonInstalled)) {
714
- await runInitStep({
715
- enabled: progressEnabled,
716
- title: "Installing remote daemon",
717
- fn: async ({ status, fail }) => {
718
- try {
719
- const convexUrl = getConvexUrl();
720
- if (!controlPlaneToken) {
721
- throw new Error("Control plane session required to install daemon.");
722
- }
723
- if (!convexUrl) {
724
- throw new Error("Convex URL unavailable.");
725
- }
726
- status.stage("Resolving daemon release");
727
- const release = await fetchSpriteDaemonRelease(controlPlaneToken, computeProvider);
728
- if (!release) {
729
- throw new Error("No remote daemon release available.");
730
- }
731
- status.stage("Issuing daemon token");
732
- const heartbeatToken = await issueSpriteDaemonToken(controlPlaneToken, alias);
733
- if (!heartbeatToken) {
734
- throw new Error("Daemon token unavailable.");
735
- }
736
- await retryInitStep({
737
- status,
738
- title: "Installing remote daemon",
739
- fn: async () => {
740
- const bootstrapClient = computeProvider === "e2b"
741
- ? createE2bInitRuntimeClient({
742
- controlPlaneToken,
743
- serviceRole: "system",
744
- transportMode: "bootstrap_only",
745
- })
746
- : undefined;
747
- return await installSpriteDaemon({
748
- client,
749
- ...(bootstrapClient ? { bootstrapClient } : {}),
750
- spriteName: alias,
751
- release,
752
- convexUrl,
753
- heartbeatToken,
754
- computeProvider,
755
- onDownloadProgress: (downloadedBytes, totalBytes) => {
756
- status.byteProgress({
757
- title: "Installing remote daemon",
758
- uploadedBytes: downloadedBytes,
759
- totalBytes,
760
- detail: computeProvider === "e2b"
761
- ? "fetching package"
762
- : "downloading package",
763
- });
764
- },
765
- ...(computeProvider === "e2b"
766
- ? {}
767
- : {
768
- onUploadProgress: (uploadedBytes, totalBytes) => {
769
- status.byteProgress({
770
- title: "Installing remote daemon",
771
- uploadedBytes,
772
- totalBytes,
773
- detail: "uploading package",
774
- });
775
- },
776
- }),
777
- onPhase: (completedPhases, totalPhases, detail) => {
778
- status.phaseProgress({
779
- title: "Installing remote daemon",
780
- completedPhases,
781
- totalPhases,
782
- detail,
783
- });
784
- },
785
- });
786
- },
787
- });
788
- if (computeProvider === "e2b") {
789
- await markE2bDaemonBootstrapReady(controlPlaneToken, alias);
790
- }
791
- await updateInitState({ steps: { daemonInstalled: true } });
792
- }
793
- catch (error) {
794
- if (computeProvider === "e2b" && controlPlaneToken) {
795
- try {
796
- await markE2bDaemonBootstrapFailed(controlPlaneToken, alias, error instanceof Error ? error.message : String(error));
797
- }
798
- catch (stateError) {
799
- logger.warn("sprite_daemon_install_state_update_failed", {
800
- box: canonical,
801
- error: String(stateError),
802
- });
803
- }
804
- }
805
- logger.warn("sprite_daemon_install_failed", {
806
- box: canonical,
807
- error: String(error),
808
- });
809
- fail("Installing remote daemon (failed)");
810
- throw error;
811
- }
812
- },
813
- });
814
- }
815
- await runInitStep({
816
- enabled: progressEnabled,
817
- title: "Ensuring daemon service",
818
- fn: async ({ status, fail }) => {
819
- try {
820
- await retryInitStep({
821
- status,
822
- title: "Ensuring daemon service",
823
- fn: async () => await ensureSpriteDaemonService({
824
- client,
825
- spriteName: alias,
826
- computeProvider,
827
- }),
828
- });
829
- await updateInitState({ steps: { daemonServiceEnsured: true } });
830
- }
831
- catch (error) {
832
- logger.warn("sprite_daemon_service_failed", {
833
- box: canonical,
834
- error: String(error),
835
- });
836
- fail("Ensuring daemon service (failed)");
837
- throw error;
838
- }
839
- },
840
- });
841
- const skipSshdConfig = shouldResume && initState?.steps.sshdConfigured;
842
- if (!skipSshdConfig) {
843
- await runInitStep({
844
- enabled: progressEnabled,
845
- title: "SSH access setup",
846
- fn: async ({ status, fail }) => {
847
- const totalPhases = 5;
848
- const setPhase = (completedPhases, detail) => {
849
- status.phaseProgress({
850
- title: "SSH access setup",
851
- completedPhases,
852
- totalPhases,
853
- detail,
854
- });
855
- };
856
- try {
857
- await retryInitStep({
858
- status,
859
- title: "SSH access setup",
860
- fn: async () => {
861
- setPhase(0, "ensure ssh key");
862
- await ensureLocalSshKey();
863
- setPhase(1, "ensure known_hosts");
864
- await ensureKnownHostsFile();
865
- setPhase(2, "read ssh key");
866
- const publicKey = await readLocalSshPublicKey();
867
- setPhase(3, "bootstrap sshd");
868
- await ensureRemoteSshAccess({
869
- client,
870
- box: alias,
871
- publicKey,
872
- computeProvider,
873
- });
874
- setPhase(4, "ensure sshd service");
875
- await ensureSshdService(client, alias, computeProvider);
876
- setPhase(5, "completed");
877
- },
878
- });
879
- await updateInitState({ steps: { sshdConfigured: true } });
880
- }
881
- catch (error) {
882
- logger.warn("sshd_config_failed", {
883
- box: canonical,
884
- error: String(error),
885
- });
886
- fail("SSH access setup (failed)");
887
- throw error;
888
- }
889
- },
890
- });
891
- }
892
- if (!skipCodexCliEnsure) {
893
- await runInitStep({
894
- enabled: progressEnabled,
895
- title: "Ensuring Codex CLI",
896
- fn: async ({ status, fail }) => {
897
- try {
898
- await retryInitStep({
899
- status,
900
- title: "Ensuring Codex CLI",
901
- fn: async () => await ensureRemoteCodexInstalled(client, alias, computeProvider),
902
- });
903
- await updateInitState({ steps: { codexCliEnsured: true } });
904
- }
905
- catch (error) {
906
- logger.warn("codex_cli_ensure_failed", {
907
- box: canonical,
908
- fingerprint,
909
- error: error instanceof Error ? error.message : String(error),
910
- });
911
- fail("Ensuring Codex CLI (failed)");
912
- throw error;
913
- }
914
- },
915
- });
916
- }
917
- if (shouldResume && hasResumeRemoteRepoState(getInitState())) {
918
- await runInitStep({
919
- enabled: progressEnabled,
920
- title: "Checking remote repo state",
921
- fn: async () => {
922
- const remoteWorkdirState = await reconcileResumeRemoteRepoState({
923
- client,
924
- spriteAlias: alias,
925
- expandedWorkdir,
926
- getInitState,
927
- updateInitState,
928
- });
929
- if (remoteWorkdirState === "missing") {
930
- logger.info("init_resume_remote_repo_missing", {
931
- box: canonical,
932
- workdir: expandedWorkdir,
933
- });
934
- }
935
- },
936
- });
937
- }
938
- const { setupPath, finalApprovedPlan, setupArtifacts, skipServicesConfig, skipServicesEnable, skipSetupUpload, } = await runSetupPlanFlow({
939
- projectDir,
940
- repoRoot,
941
- localHomeDir,
942
- shouldResume,
943
- nonInteractive,
944
- progressEnabled,
945
- parsed,
946
- getInitState,
947
- updateInitState,
948
- ...(localInitCodexProxyOptions
949
- ? { initCodexProxyOptions: localInitCodexProxyOptions }
950
- : {}),
951
- throwInitCanceled,
952
- });
953
- if (computeProvider === "e2b") {
954
- const resolvedRemoteHome = await runInitStep({
955
- enabled: progressEnabled,
956
- title: "Resolving remote home",
957
- fn: async ({ status }) => {
958
- status.stage("Connecting managed daemon");
959
- return await resolveRemoteHomeDir(client, alias);
960
- },
961
- });
962
- ({
963
- remoteHome,
964
- expandedWorkdir,
965
- remoteSetupPath,
966
- remoteArtifactsBundlePath,
967
- remoteArtifactsManifestPath,
968
- remoteArtifactsPartsDescriptorPath,
969
- } = buildRemoteInitPaths(workdir, resolvedRemoteHome));
970
- }
971
- await runProvisionFlow({
972
- client,
973
- spriteAlias: alias,
974
- expandedWorkdir,
975
- repoRoot,
976
- localHomeDir,
977
- shouldResume,
978
- parsed,
979
- progressEnabled,
980
- setupPath,
981
- remoteSetupPath,
982
- setupArtifacts,
983
- skipSetupUpload,
984
- remoteArtifactsBundlePath,
985
- remoteArtifactsManifestPath,
986
- remoteArtifactsPartsDescriptorPath,
987
- getInitState,
988
- updateInitState,
989
- refreshRegistryProjectStatus: async () => await updateRegistryProjectStatus(resolveInitStatus(initState?.steps, initState?.complete)),
990
- });
991
- await runFinalizeFlow({
992
- client,
993
- canonical,
994
- spriteAlias: alias,
995
- alias,
996
- computeProvider,
997
- workdir,
998
- repoRoot,
999
- projectDir,
1000
- fingerprint,
1001
- projectCreatedAt,
1002
- ...(projectOrigin !== undefined ? { projectOrigin } : {}),
1003
- finalApprovedPlan,
1004
- shouldResume,
1005
- nonInteractive,
1006
- progressEnabled,
1007
- parsed,
1008
- skipCodexApply: Boolean(shouldResume && getInitState()?.steps.remoteCodexApplied),
1009
- skipServicesConfig,
1010
- skipServicesEnable,
1011
- remoteHome,
1012
- remoteSetupPath,
1013
- remoteArtifactsBundlePath,
1014
- remoteArtifactsManifestPath,
1015
- socketInfo,
1016
- pathSetup,
1017
- ...(remoteInitCodexProxyOptions
1018
- ? { initCodexProxyOptions: remoteInitCodexProxyOptions }
1019
- : {}),
1020
- throwInitCanceled,
1021
- getInitState,
1022
- updateInitState,
1023
- updateRegistryProjectStatus,
1024
- resolveInitStatus,
1025
- ...(computeProvider === "sprites"
1026
- ? {}
1027
- : {
1028
- validateManagedInitCompletion: async (status) => {
1029
- if (!controlPlaneToken) {
1030
- throw new Error("Control plane session required to validate managed daemon.");
1031
- }
1032
- for (const intent of ["proxy", "shell"]) {
1033
- await retryInitStep({
1034
- status,
1035
- title: "Validating managed daemon",
1036
- shouldRetry: shouldRetryManagedInitCompletionValidation,
1037
- fn: async () => {
1038
- status.stage(intent === "proxy"
1039
- ? "Checking managed daemon proxy access"
1040
- : "Checking managed daemon shell access");
1041
- await fetchManagedDaemonConnectInfo(controlPlaneToken, alias, intent, true);
1042
- },
1043
- });
1044
- }
1045
- },
1046
- }),
1047
- isRetryableInitError,
1048
- retryInitStep,
1049
- recordCodexCheckpoint,
1050
- });
1051
- }
1052
- finally {
1053
- await initSessionLock.release();
1054
- }
1055
- };
1056
- await run();
1057
- };
1058
- //# sourceMappingURL=index.js.map