@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,967 +0,0 @@
1
- import path from "node:path";
2
- import fs from "node:fs/promises";
3
- import os from "node:os";
4
- import { confirm as clackConfirm, isCancel, log as clackLog, note as clackNote, select as clackSelect, taskLog as clackTaskLog, } from "@clack/prompts";
5
- import { createSetupArtifacts, ensureLocalCodexAuthForByoInit, promptForPlanApproval, promptForServicesApproval, readSetupPlan, readSetupEnvSecretsPlan, readSetupExternalPlan, readSetupExtraArtifactsPlan, readServicesPlan, runLocalShellHistoryScan, runLocalServicesScan, runLocalSetupEnvSecretsScan, runLocalSetupExternalScan, runLocalSetupExtraArtifactsScan, setupApprovalPrefaceLines, mergeExternalPlanEntries, mergeSetupScans, writeSetupPlan, writeSetupEnvSecretsSchema, writeSetupExternalSchema, writeSetupExtraArtifactsSchema, writeServicesSchema, } from "./codex/index.js";
6
- import { isCodexScanIncomplete, summarizeIncompleteScanResult, } from "./codex/scanStatus.js";
7
- import { runInitStep } from "./progress.js";
8
- import { applyScanRowProgressUpdate, applyScanRowStatus, createInitialScanRowState, formatScanRow, } from "./scanProgress.js";
9
- import { collectMissingSetupArtifacts, remapSelectedPathEntries, } from "./setupArtifactsValidation.js";
10
- const SETUP_ARTIFACT_REGEN_MAX_ATTEMPTS = 3;
11
- const toPosixPath = (value) => value.split(path.sep).join(path.posix.sep);
12
- const toRepoRelativePath = (repoRoot, filePath) => {
13
- const resolved = path.isAbsolute(filePath)
14
- ? filePath
15
- : path.resolve(repoRoot, filePath);
16
- const relative = path.relative(repoRoot, resolved) || filePath;
17
- return toPosixPath(relative);
18
- };
19
- const isOutsideRepoPath = (relativePath) => relativePath === ".." || relativePath.startsWith(`..${path.posix.sep}`);
20
- const shouldSkipSetupUpload = ({ shouldResume, initialState, }) => Boolean(shouldResume && initialState?.steps.setupUploaded);
21
- const runSetupPlanFlow = async ({ projectDir, repoRoot, localHomeDir, shouldResume, nonInteractive, progressEnabled, parsed, localScanSandboxMode, getInitState, updateInitState, initCodexProxyOptions, throwInitCanceled, }) => {
22
- const setupDir = projectDir;
23
- const setupPath = path.join(setupDir, "setup.json");
24
- const scansDir = path.join(setupDir, "scans");
25
- const logDir = path.join(setupDir, "logs");
26
- const setupEnvSecretsScanPath = path.join(scansDir, "setup-env-secrets.json");
27
- const setupExternalScanPath = path.join(scansDir, "setup-external.json");
28
- const shellHistoryScanPath = path.join(scansDir, "shell-history.json");
29
- const setupExtraArtifactsScanPath = path.join(scansDir, "setup-extra-artifacts.json");
30
- const servicesScanPath = path.join(scansDir, "services.json");
31
- const scanThreadsPath = path.join(scansDir, "codex-scan-threads.json");
32
- let setupArtifacts = null;
33
- const initialState = getInitState();
34
- const skipSetupPlan = Boolean(shouldResume && initialState?.steps.setupPlanWritten);
35
- const skipServicesConfig = Boolean(shouldResume && initialState?.steps.servicesConfigWritten);
36
- const skipServicesEnable = Boolean(shouldResume && initialState?.steps.servicesEnabled);
37
- const skipSetupUpload = shouldSkipSetupUpload({
38
- shouldResume,
39
- initialState,
40
- });
41
- let approvedPlan = null;
42
- const setupTempDir = await fs.mkdtemp(path.join(os.tmpdir(), "devbox-setup-"));
43
- try {
44
- await fs.mkdir(setupDir, { recursive: true, mode: 0o700 });
45
- try {
46
- await fs.chmod(setupDir, 0o700);
47
- }
48
- catch {
49
- // best effort on filesystems that do not support chmod
50
- }
51
- const tryReadSetupPlan = async () => {
52
- try {
53
- return await readSetupPlan(setupPath);
54
- }
55
- catch {
56
- return null;
57
- }
58
- };
59
- const tryReadServicesPlan = async () => {
60
- try {
61
- return await readServicesPlan(servicesScanPath);
62
- }
63
- catch {
64
- return null;
65
- }
66
- };
67
- const tryReadEnvSecretsScan = async () => {
68
- try {
69
- return await readSetupEnvSecretsPlan(setupEnvSecretsScanPath);
70
- }
71
- catch {
72
- return null;
73
- }
74
- };
75
- const tryReadExternalScan = async () => {
76
- try {
77
- return await readSetupExternalPlan(setupExternalScanPath);
78
- }
79
- catch {
80
- return null;
81
- }
82
- };
83
- const tryReadShellHistoryScan = async () => {
84
- try {
85
- return await readSetupExternalPlan(shellHistoryScanPath);
86
- }
87
- catch {
88
- return null;
89
- }
90
- };
91
- const tryReadExtraArtifactsScan = async () => {
92
- try {
93
- return await readSetupExtraArtifactsPlan(setupExtraArtifactsScanPath);
94
- }
95
- catch {
96
- return null;
97
- }
98
- };
99
- const tryReadScanThreads = async () => {
100
- try {
101
- const raw = await fs.readFile(scanThreadsPath, "utf8");
102
- const parsed = JSON.parse(raw);
103
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
104
- return {};
105
- }
106
- const record = parsed;
107
- return {
108
- ...(typeof record.envSecretsThreadId === "string"
109
- ? { envSecretsThreadId: record.envSecretsThreadId }
110
- : {}),
111
- ...(typeof record.externalThreadId === "string"
112
- ? { externalThreadId: record.externalThreadId }
113
- : {}),
114
- ...(typeof record.shellHistoryThreadId === "string"
115
- ? { shellHistoryThreadId: record.shellHistoryThreadId }
116
- : {}),
117
- ...(typeof record.extraArtifactsThreadId === "string"
118
- ? { extraArtifactsThreadId: record.extraArtifactsThreadId }
119
- : {}),
120
- ...(typeof record.servicesThreadId === "string"
121
- ? { servicesThreadId: record.servicesThreadId }
122
- : {}),
123
- };
124
- }
125
- catch {
126
- return {};
127
- }
128
- };
129
- let scanThreads = shouldResume
130
- ? await tryReadScanThreads()
131
- : {};
132
- let scanThreadsDirty = false;
133
- const persistScanThreads = async () => {
134
- await fs.mkdir(scansDir, { recursive: true });
135
- await fs.writeFile(scanThreadsPath, JSON.stringify(scanThreads, null, 2), "utf8");
136
- };
137
- const flushScanThreads = async () => {
138
- if (!scanThreadsDirty)
139
- return;
140
- await persistScanThreads();
141
- scanThreadsDirty = false;
142
- };
143
- const saveScanThreadId = (key, threadId) => {
144
- if (!threadId)
145
- return;
146
- if (scanThreads[key] === threadId)
147
- return;
148
- scanThreads = { ...scanThreads, [key]: threadId };
149
- scanThreadsDirty = true;
150
- };
151
- const runCodexScanWithImmediateRetry = async ({ run, read, outputPath, update, shouldRetry, scanLabel, }) => {
152
- try {
153
- await run();
154
- let out = await read();
155
- const needsImmediateRetry = shouldRetry(out);
156
- if (needsImmediateRetry) {
157
- const retrySummary = summarizeIncompleteScanResult(out);
158
- update(retrySummary ? `retrying - ${retrySummary}` : "retrying");
159
- await fs.rm(outputPath, { force: true });
160
- await run();
161
- out = await read();
162
- if (shouldRetry(out)) {
163
- const retrySummary = summarizeIncompleteScanResult(out);
164
- throw new Error(retrySummary
165
- ? `${scanLabel} scan returned incomplete results after retry (${retrySummary}).`
166
- : `${scanLabel} scan returned incomplete results after retry.`);
167
- }
168
- }
169
- update("done");
170
- return out;
171
- }
172
- catch (error) {
173
- update("failed");
174
- if (error instanceof Error) {
175
- throw new Error(`${scanLabel} scan failed: ${error.message}`);
176
- }
177
- throw error;
178
- }
179
- };
180
- let setupPlan = skipSetupPlan || !shouldResume ? null : await tryReadSetupPlan();
181
- const needsSetupScan = !skipSetupPlan && !setupPlan;
182
- let servicesPlan = !needsSetupScan || !shouldResume ? null : await tryReadServicesPlan();
183
- let envSecretsScan = !needsSetupScan || !shouldResume ? null : await tryReadEnvSecretsScan();
184
- let externalScan = !needsSetupScan || !shouldResume ? null : await tryReadExternalScan();
185
- let shellHistoryScan = !needsSetupScan || !shouldResume ? null : await tryReadShellHistoryScan();
186
- let extraArtifactsScan = !needsSetupScan || !shouldResume
187
- ? null
188
- : await tryReadExtraArtifactsScan();
189
- if (servicesPlan &&
190
- isCodexScanIncomplete(servicesPlan.scanFullyCompleted)) {
191
- servicesPlan = null;
192
- }
193
- if (envSecretsScan &&
194
- isCodexScanIncomplete(envSecretsScan.scanFullyCompleted)) {
195
- envSecretsScan = null;
196
- }
197
- if (externalScan &&
198
- isCodexScanIncomplete(externalScan.scanFullyCompleted)) {
199
- externalScan = null;
200
- }
201
- if (shellHistoryScan &&
202
- isCodexScanIncomplete(shellHistoryScan.scanFullyCompleted)) {
203
- shellHistoryScan = null;
204
- }
205
- if (extraArtifactsScan &&
206
- isCodexScanIncomplete(extraArtifactsScan.scanFullyCompleted)) {
207
- extraArtifactsScan = null;
208
- }
209
- const needsServicesScan = needsSetupScan && !servicesPlan;
210
- const needsEnvSecretsScan = needsSetupScan && !envSecretsScan;
211
- const needsExternalScan = needsSetupScan && !externalScan;
212
- const needsShellHistoryScan = needsSetupScan && !shellHistoryScan;
213
- const needsExtraArtifactsScan = needsSetupScan && !extraArtifactsScan;
214
- if ((needsSetupScan || needsServicesScan) && !initCodexProxyOptions) {
215
- await ensureLocalCodexAuthForByoInit();
216
- }
217
- if (needsSetupScan || needsServicesScan) {
218
- const runLocalEnvironmentAnalysis = async ({ updateEnvSecrets, updateExternal, updateShellHistory, updateExtraArtifacts, updateServices, }) => {
219
- let envSecretsSchemaPath = null;
220
- let sharedExternalSchemaPath = null;
221
- let extraArtifactsSchemaPath = null;
222
- let servicesSchemaPath = null;
223
- if (needsEnvSecretsScan) {
224
- envSecretsSchemaPath = await writeSetupEnvSecretsSchema(setupTempDir);
225
- }
226
- if (needsExternalScan || needsShellHistoryScan) {
227
- sharedExternalSchemaPath =
228
- await writeSetupExternalSchema(setupTempDir);
229
- }
230
- if (needsExtraArtifactsScan) {
231
- extraArtifactsSchemaPath =
232
- await writeSetupExtraArtifactsSchema(setupTempDir);
233
- }
234
- if (needsServicesScan) {
235
- servicesSchemaPath = await writeServicesSchema(setupTempDir);
236
- }
237
- if (needsEnvSecretsScan && !envSecretsSchemaPath) {
238
- throw new Error("Env/secrets schema path missing.");
239
- }
240
- if ((needsExternalScan || needsShellHistoryScan) &&
241
- !sharedExternalSchemaPath) {
242
- throw new Error("External schema path missing.");
243
- }
244
- if (needsExtraArtifactsScan && !extraArtifactsSchemaPath) {
245
- throw new Error("Extra artifacts schema path missing.");
246
- }
247
- if (needsServicesScan && !servicesSchemaPath) {
248
- throw new Error("Services schema path missing.");
249
- }
250
- if (needsSetupScan) {
251
- await fs.mkdir(scansDir, { recursive: true });
252
- }
253
- const envSecretsPromise = !needsSetupScan
254
- ? Promise.resolve(null)
255
- : !needsEnvSecretsScan
256
- ? Promise.resolve(envSecretsScan)
257
- : runCodexScanWithImmediateRetry({
258
- run: async () => {
259
- const threadId = await runLocalSetupEnvSecretsScan({
260
- cwd: repoRoot,
261
- logDir,
262
- schemaPath: envSecretsSchemaPath,
263
- outputPath: setupEnvSecretsScanPath,
264
- ...(localScanSandboxMode
265
- ? { sandboxMode: localScanSandboxMode }
266
- : {}),
267
- ...(initCodexProxyOptions
268
- ? { proxyOptions: initCodexProxyOptions }
269
- : {}),
270
- onProgress: updateEnvSecrets,
271
- });
272
- saveScanThreadId("envSecretsThreadId", threadId);
273
- },
274
- read: async () => await readSetupEnvSecretsPlan(setupEnvSecretsScanPath),
275
- outputPath: setupEnvSecretsScanPath,
276
- update: updateEnvSecrets,
277
- shouldRetry: (plan) => isCodexScanIncomplete(plan.scanFullyCompleted),
278
- scanLabel: "env/secrets",
279
- });
280
- const externalPromise = !needsSetupScan
281
- ? Promise.resolve(null)
282
- : !needsExternalScan
283
- ? Promise.resolve(externalScan)
284
- : runCodexScanWithImmediateRetry({
285
- run: async () => {
286
- const threadId = await runLocalSetupExternalScan({
287
- cwd: repoRoot,
288
- logDir,
289
- schemaPath: sharedExternalSchemaPath,
290
- outputPath: setupExternalScanPath,
291
- homeDir: localHomeDir,
292
- ...(localScanSandboxMode
293
- ? { sandboxMode: localScanSandboxMode }
294
- : {}),
295
- ...(initCodexProxyOptions
296
- ? { proxyOptions: initCodexProxyOptions }
297
- : {}),
298
- onProgress: updateExternal,
299
- });
300
- saveScanThreadId("externalThreadId", threadId);
301
- },
302
- read: async () => await readSetupExternalPlan(setupExternalScanPath),
303
- outputPath: setupExternalScanPath,
304
- update: updateExternal,
305
- shouldRetry: (plan) => isCodexScanIncomplete(plan.scanFullyCompleted),
306
- scanLabel: "external",
307
- });
308
- const shellHistoryPromise = !needsSetupScan
309
- ? Promise.resolve(null)
310
- : !needsShellHistoryScan
311
- ? Promise.resolve(shellHistoryScan)
312
- : runCodexScanWithImmediateRetry({
313
- run: async () => {
314
- const threadId = await runLocalShellHistoryScan({
315
- cwd: repoRoot,
316
- logDir,
317
- schemaPath: sharedExternalSchemaPath,
318
- outputPath: shellHistoryScanPath,
319
- homeDir: localHomeDir,
320
- ...(localScanSandboxMode
321
- ? { sandboxMode: localScanSandboxMode }
322
- : {}),
323
- ...(initCodexProxyOptions
324
- ? { proxyOptions: initCodexProxyOptions }
325
- : {}),
326
- onProgress: updateShellHistory,
327
- });
328
- saveScanThreadId("shellHistoryThreadId", threadId);
329
- },
330
- read: async () => await readSetupExternalPlan(shellHistoryScanPath),
331
- outputPath: shellHistoryScanPath,
332
- update: updateShellHistory,
333
- shouldRetry: (plan) => isCodexScanIncomplete(plan.scanFullyCompleted),
334
- scanLabel: "shell history",
335
- });
336
- const extraArtifactsPromise = !needsSetupScan
337
- ? Promise.resolve(null)
338
- : !needsExtraArtifactsScan
339
- ? Promise.resolve(extraArtifactsScan)
340
- : runCodexScanWithImmediateRetry({
341
- run: async () => {
342
- const threadId = await runLocalSetupExtraArtifactsScan({
343
- cwd: repoRoot,
344
- logDir,
345
- schemaPath: extraArtifactsSchemaPath,
346
- outputPath: setupExtraArtifactsScanPath,
347
- ...(localScanSandboxMode
348
- ? { sandboxMode: localScanSandboxMode }
349
- : {}),
350
- ...(initCodexProxyOptions
351
- ? { proxyOptions: initCodexProxyOptions }
352
- : {}),
353
- onProgress: updateExtraArtifacts,
354
- });
355
- saveScanThreadId("extraArtifactsThreadId", threadId);
356
- },
357
- read: async () => await readSetupExtraArtifactsPlan(setupExtraArtifactsScanPath),
358
- outputPath: setupExtraArtifactsScanPath,
359
- update: updateExtraArtifacts,
360
- shouldRetry: (plan) => isCodexScanIncomplete(plan.scanFullyCompleted),
361
- scanLabel: "extra artifacts",
362
- });
363
- const servicesPromise = !needsServicesScan
364
- ? Promise.resolve(servicesPlan)
365
- : runCodexScanWithImmediateRetry({
366
- run: async () => {
367
- const threadId = await runLocalServicesScan({
368
- cwd: repoRoot,
369
- logDir,
370
- schemaPath: servicesSchemaPath,
371
- outputPath: servicesScanPath,
372
- homeDir: localHomeDir,
373
- ...(localScanSandboxMode
374
- ? { sandboxMode: localScanSandboxMode }
375
- : {}),
376
- ...(initCodexProxyOptions
377
- ? { proxyOptions: initCodexProxyOptions }
378
- : {}),
379
- onProgress: updateServices,
380
- });
381
- saveScanThreadId("servicesThreadId", threadId);
382
- },
383
- read: async () => await readServicesPlan(servicesScanPath),
384
- outputPath: servicesScanPath,
385
- update: updateServices,
386
- shouldRetry: (plan) => isCodexScanIncomplete(plan.scanFullyCompleted),
387
- scanLabel: "services",
388
- });
389
- const [envSecrets, external, shellHistory, extraArtifacts, services] = await Promise.all([
390
- envSecretsPromise,
391
- externalPromise,
392
- shellHistoryPromise,
393
- extraArtifactsPromise,
394
- servicesPromise,
395
- ]);
396
- await flushScanThreads();
397
- if (needsServicesScan) {
398
- if (!services) {
399
- throw new Error("Services scan missing.");
400
- }
401
- servicesPlan = services;
402
- }
403
- if (needsSetupScan) {
404
- if (!envSecrets) {
405
- throw new Error("Env/secrets scan missing.");
406
- }
407
- if (!external) {
408
- throw new Error("External scan missing.");
409
- }
410
- if (!shellHistory) {
411
- throw new Error("Shell history scan missing.");
412
- }
413
- if (!extraArtifacts) {
414
- throw new Error("Extra artifacts scan missing.");
415
- }
416
- if (!servicesPlan) {
417
- throw new Error("Services scan missing.");
418
- }
419
- updateEnvSecrets("merging setup plan");
420
- const merged = mergeSetupScans({
421
- envSecrets,
422
- external,
423
- shellHistory,
424
- extraArtifacts,
425
- services: {
426
- appEntrypoints: servicesPlan.appEntrypoints,
427
- backgroundServices: servicesPlan.backgroundServices,
428
- },
429
- });
430
- await writeSetupPlan(setupPath, merged);
431
- setupPlan = merged;
432
- }
433
- };
434
- if (!progressEnabled) {
435
- await runLocalEnvironmentAnalysis({
436
- updateEnvSecrets: () => { },
437
- updateExternal: () => { },
438
- updateShellHistory: () => { },
439
- updateExtraArtifacts: () => { },
440
- updateServices: () => { },
441
- });
442
- }
443
- else {
444
- const log = clackTaskLog({
445
- title: "Analyzing local env",
446
- limit: 1,
447
- spacing: 0,
448
- });
449
- let active = true;
450
- const envSecretsRow = log.group("");
451
- const externalRow = log.group("");
452
- const shellHistoryRow = log.group("");
453
- const extraArtifactsRow = log.group("");
454
- const servicesRow = log.group("");
455
- const makeUpdater = (row, label) => {
456
- let state = createInitialScanRowState("starting");
457
- const render = () => {
458
- // Keep task-log rows plain text. Clack clears rows based on raw
459
- // string length, so embedding ANSI escape codes here can make it
460
- // erase lines above the task log.
461
- row.message(formatScanRow({
462
- label,
463
- state,
464
- }));
465
- };
466
- return (message) => {
467
- if (!active)
468
- return;
469
- state =
470
- typeof message === "string"
471
- ? applyScanRowStatus(state, message)
472
- : applyScanRowProgressUpdate(state, message);
473
- render();
474
- };
475
- };
476
- const updateEnvSecrets = makeUpdater(envSecretsRow, "env/secrets");
477
- const updateExternal = makeUpdater(externalRow, "external");
478
- const updateShellHistory = makeUpdater(shellHistoryRow, "shell history");
479
- const updateExtraArtifacts = makeUpdater(extraArtifactsRow, "extra artifacts");
480
- const updateServices = makeUpdater(servicesRow, "services");
481
- updateEnvSecrets(needsSetupScan
482
- ? needsEnvSecretsScan
483
- ? "starting"
484
- : "cached"
485
- : "skipped");
486
- updateExternal(needsSetupScan
487
- ? needsExternalScan
488
- ? "starting"
489
- : "cached"
490
- : "skipped");
491
- updateShellHistory(needsSetupScan
492
- ? needsShellHistoryScan
493
- ? "starting"
494
- : "cached"
495
- : "skipped");
496
- updateExtraArtifacts(needsSetupScan
497
- ? needsExtraArtifactsScan
498
- ? "starting"
499
- : "cached"
500
- : "skipped");
501
- updateServices(needsServicesScan ? "starting" : "cached");
502
- try {
503
- await runLocalEnvironmentAnalysis({
504
- updateEnvSecrets,
505
- updateExternal,
506
- updateShellHistory,
507
- updateExtraArtifacts,
508
- updateServices,
509
- });
510
- active = false;
511
- log.success("Analyzing local env");
512
- }
513
- catch (error) {
514
- active = false;
515
- log.error("Analyzing local env");
516
- throw error;
517
- }
518
- }
519
- }
520
- if (!skipSetupPlan && !setupPlan) {
521
- setupPlan = await readSetupPlan(setupPath);
522
- }
523
- if (!skipSetupPlan && !setupPlan) {
524
- throw new Error("Setup plan missing.");
525
- }
526
- const scanStepUpdate = {};
527
- const afterScanState = getInitState();
528
- if (!skipSetupPlan && setupPlan) {
529
- if (!afterScanState?.steps.setupEnvSecretsScanned) {
530
- scanStepUpdate.setupEnvSecretsScanned = true;
531
- }
532
- if (!afterScanState?.steps.setupExternalScanned) {
533
- scanStepUpdate.setupExternalScanned = true;
534
- }
535
- if (!afterScanState?.steps.setupExtraArtifactsScanned) {
536
- scanStepUpdate.setupExtraArtifactsScanned = true;
537
- }
538
- if (!afterScanState?.steps.setupPlanScanned) {
539
- scanStepUpdate.setupPlanScanned = true;
540
- }
541
- if (!afterScanState?.steps.servicesPlanScanned) {
542
- scanStepUpdate.servicesPlanScanned = true;
543
- }
544
- }
545
- if (Object.keys(scanStepUpdate).length > 0) {
546
- await updateInitState({ steps: scanStepUpdate });
547
- }
548
- if (skipSetupPlan) {
549
- approvedPlan = await readSetupPlan(setupPath);
550
- }
551
- if (shouldResume && approvedPlan) {
552
- const backfillStepUpdate = {};
553
- const currentState = getInitState();
554
- if (!currentState?.steps.setupEnvSecretsScanned) {
555
- backfillStepUpdate.setupEnvSecretsScanned = true;
556
- }
557
- if (!currentState?.steps.setupExternalScanned) {
558
- backfillStepUpdate.setupExternalScanned = true;
559
- }
560
- if (!currentState?.steps.setupExtraArtifactsScanned) {
561
- backfillStepUpdate.setupExtraArtifactsScanned = true;
562
- }
563
- if (!currentState?.steps.setupPlanScanned) {
564
- backfillStepUpdate.setupPlanScanned = true;
565
- }
566
- if (!currentState?.steps.servicesPlanScanned) {
567
- backfillStepUpdate.servicesPlanScanned = true;
568
- }
569
- if (Object.keys(backfillStepUpdate).length > 0) {
570
- await updateInitState({ steps: backfillStepUpdate });
571
- }
572
- }
573
- const formatMissingSetupArtifact = (entry) => {
574
- const categoryLabel = entry.category === "envFiles" || entry.category === "secretFiles"
575
- ? "env/secrets"
576
- : entry.category === "externalConfigs"
577
- ? "external"
578
- : "extra artifacts";
579
- return `${categoryLabel}: ${entry.path}`;
580
- };
581
- const buildMissingPathsFeedback = (categoryLabel, entries) => [
582
- `Your previous ${categoryLabel} scan output included path(s) that do not exist on disk right now.`,
583
- "Fix the result and return corrected JSON. Only include paths that currently exist.",
584
- "Missing paths:",
585
- ...entries.map((entry) => `- ${entry.path} (resolved: ${toRepoRelativePath(repoRoot, entry.resolvedPath)})`),
586
- ].join("\n");
587
- const regenerateSetupPlanForMissingArtifacts = async ({ plan, missingArtifacts, status, }) => {
588
- const categories = new Set(missingArtifacts.map((entry) => entry.category));
589
- const needsEnvSecrets = categories.has("envFiles") || categories.has("secretFiles");
590
- const needsExternal = categories.has("externalConfigs");
591
- const needsExtraArtifacts = categories.has("extraArtifacts");
592
- let nextPlan = plan;
593
- if (needsEnvSecrets) {
594
- const envSecretsMissing = missingArtifacts.filter((entry) => entry.category === "envFiles" || entry.category === "secretFiles");
595
- const envSecretsSchemaPath = await writeSetupEnvSecretsSchema(setupTempDir);
596
- envSecretsScan = await runCodexScanWithImmediateRetry({
597
- run: async () => {
598
- const threadId = await runLocalSetupEnvSecretsScan({
599
- cwd: repoRoot,
600
- logDir,
601
- schemaPath: envSecretsSchemaPath,
602
- outputPath: setupEnvSecretsScanPath,
603
- ...(localScanSandboxMode
604
- ? { sandboxMode: localScanSandboxMode }
605
- : {}),
606
- ...(scanThreads.envSecretsThreadId
607
- ? { resumeThreadId: scanThreads.envSecretsThreadId }
608
- : {}),
609
- retryFeedback: buildMissingPathsFeedback("env/secrets", envSecretsMissing),
610
- ...(initCodexProxyOptions
611
- ? { proxyOptions: initCodexProxyOptions }
612
- : {}),
613
- onProgress: (update) => status.stage(`Rescan env/secrets - ${update.message}`),
614
- });
615
- saveScanThreadId("envSecretsThreadId", threadId);
616
- },
617
- read: async () => await readSetupEnvSecretsPlan(setupEnvSecretsScanPath),
618
- outputPath: setupEnvSecretsScanPath,
619
- update: (message) => status.stage(`Rescan env/secrets - ${message}`),
620
- shouldRetry: (scan) => isCodexScanIncomplete(scan.scanFullyCompleted),
621
- scanLabel: "env/secrets",
622
- });
623
- nextPlan = {
624
- ...nextPlan,
625
- envFiles: remapSelectedPathEntries({
626
- selected: nextPlan.envFiles,
627
- refreshed: envSecretsScan.envFiles,
628
- }),
629
- secretFiles: remapSelectedPathEntries({
630
- selected: nextPlan.secretFiles,
631
- refreshed: envSecretsScan.secretFiles,
632
- }),
633
- };
634
- }
635
- if (needsExternal) {
636
- const externalMissing = missingArtifacts.filter((entry) => entry.category === "externalConfigs");
637
- const externalSchemaPath = await writeSetupExternalSchema(setupTempDir);
638
- externalScan = await runCodexScanWithImmediateRetry({
639
- run: async () => {
640
- const threadId = await runLocalSetupExternalScan({
641
- cwd: repoRoot,
642
- logDir,
643
- schemaPath: externalSchemaPath,
644
- outputPath: setupExternalScanPath,
645
- homeDir: localHomeDir,
646
- ...(localScanSandboxMode
647
- ? { sandboxMode: localScanSandboxMode }
648
- : {}),
649
- ...(scanThreads.externalThreadId
650
- ? { resumeThreadId: scanThreads.externalThreadId }
651
- : {}),
652
- retryFeedback: buildMissingPathsFeedback("external", externalMissing),
653
- ...(initCodexProxyOptions
654
- ? { proxyOptions: initCodexProxyOptions }
655
- : {}),
656
- onProgress: (update) => status.stage(`Rescan external - ${update.message}`),
657
- });
658
- saveScanThreadId("externalThreadId", threadId);
659
- },
660
- read: async () => await readSetupExternalPlan(setupExternalScanPath),
661
- outputPath: setupExternalScanPath,
662
- update: (message) => status.stage(`Rescan external - ${message}`),
663
- shouldRetry: (scan) => isCodexScanIncomplete(scan.scanFullyCompleted),
664
- scanLabel: "external",
665
- });
666
- shellHistoryScan = await runCodexScanWithImmediateRetry({
667
- run: async () => {
668
- const threadId = await runLocalShellHistoryScan({
669
- cwd: repoRoot,
670
- logDir,
671
- schemaPath: externalSchemaPath,
672
- outputPath: shellHistoryScanPath,
673
- homeDir: localHomeDir,
674
- ...(localScanSandboxMode
675
- ? { sandboxMode: localScanSandboxMode }
676
- : {}),
677
- ...(scanThreads.shellHistoryThreadId
678
- ? { resumeThreadId: scanThreads.shellHistoryThreadId }
679
- : {}),
680
- retryFeedback: buildMissingPathsFeedback("external", externalMissing),
681
- ...(initCodexProxyOptions
682
- ? { proxyOptions: initCodexProxyOptions }
683
- : {}),
684
- onProgress: (update) => status.stage(`Rescan shell history - ${update.message}`),
685
- });
686
- saveScanThreadId("shellHistoryThreadId", threadId);
687
- },
688
- read: async () => await readSetupExternalPlan(shellHistoryScanPath),
689
- outputPath: shellHistoryScanPath,
690
- update: (message) => status.stage(`Rescan shell history - ${message}`),
691
- shouldRetry: (scan) => isCodexScanIncomplete(scan.scanFullyCompleted),
692
- scanLabel: "shell history",
693
- });
694
- const mergedExternal = mergeExternalPlanEntries([
695
- externalScan,
696
- shellHistoryScan,
697
- ]);
698
- nextPlan = {
699
- ...nextPlan,
700
- externalConfigs: remapSelectedPathEntries({
701
- selected: nextPlan.externalConfigs,
702
- refreshed: mergedExternal.externalConfigs,
703
- }),
704
- };
705
- }
706
- if (needsExtraArtifacts) {
707
- const extraArtifactsMissing = missingArtifacts.filter((entry) => entry.category === "extraArtifacts");
708
- const extraArtifactsSchemaPath = await writeSetupExtraArtifactsSchema(setupTempDir);
709
- extraArtifactsScan = await runCodexScanWithImmediateRetry({
710
- run: async () => {
711
- const threadId = await runLocalSetupExtraArtifactsScan({
712
- cwd: repoRoot,
713
- logDir,
714
- schemaPath: extraArtifactsSchemaPath,
715
- outputPath: setupExtraArtifactsScanPath,
716
- ...(localScanSandboxMode
717
- ? { sandboxMode: localScanSandboxMode }
718
- : {}),
719
- ...(scanThreads.extraArtifactsThreadId
720
- ? { resumeThreadId: scanThreads.extraArtifactsThreadId }
721
- : {}),
722
- retryFeedback: buildMissingPathsFeedback("extra artifacts", extraArtifactsMissing),
723
- ...(initCodexProxyOptions
724
- ? { proxyOptions: initCodexProxyOptions }
725
- : {}),
726
- onProgress: (update) => status.stage(`Rescan extra artifacts - ${update.message}`),
727
- });
728
- saveScanThreadId("extraArtifactsThreadId", threadId);
729
- },
730
- read: async () => await readSetupExtraArtifactsPlan(setupExtraArtifactsScanPath),
731
- outputPath: setupExtraArtifactsScanPath,
732
- update: (message) => status.stage(`Rescan extra artifacts - ${message}`),
733
- shouldRetry: (scan) => isCodexScanIncomplete(scan.scanFullyCompleted),
734
- scanLabel: "extra artifacts",
735
- });
736
- nextPlan = {
737
- ...nextPlan,
738
- extraArtifacts: remapSelectedPathEntries({
739
- selected: nextPlan.extraArtifacts,
740
- refreshed: extraArtifactsScan.extraArtifacts,
741
- }),
742
- };
743
- }
744
- await flushScanThreads();
745
- return nextPlan;
746
- };
747
- if (nonInteractive) {
748
- if (setupPlan)
749
- approvedPlan = setupPlan;
750
- }
751
- else if (!skipSetupPlan && setupPlan) {
752
- if (!process.stdin.isTTY || parsed.json) {
753
- throw new Error("Interactive terminal required to approve setup.");
754
- }
755
- const statCache = new Map();
756
- const readPathInfo = async (candidatePath) => {
757
- const cached = statCache.get(candidatePath);
758
- if (cached)
759
- return cached;
760
- const resolved = path.isAbsolute(candidatePath)
761
- ? candidatePath
762
- : path.resolve(repoRoot, candidatePath);
763
- const relative = toRepoRelativePath(repoRoot, candidatePath);
764
- const outsideRepo = isOutsideRepoPath(relative);
765
- let isDirectory = false;
766
- try {
767
- const stat = await fs.stat(resolved);
768
- isDirectory = stat.isDirectory();
769
- }
770
- catch {
771
- isDirectory = false;
772
- }
773
- const info = { relative, outsideRepo, isDirectory };
774
- statCache.set(candidatePath, info);
775
- return info;
776
- };
777
- const buildApprovalSummary = async (plan) => {
778
- const lines = [];
779
- lines.push("Setup");
780
- lines.push(`- .env files: ${plan.envFiles.length}`);
781
- for (const entry of plan.envFiles) {
782
- lines.push(` - ${toRepoRelativePath(repoRoot, entry.path)}`);
783
- }
784
- lines.push(`- Secret/config files: ${plan.secretFiles.length}`);
785
- for (const entry of plan.secretFiles) {
786
- lines.push(` - ${toRepoRelativePath(repoRoot, entry.path)}`);
787
- }
788
- lines.push(`- Other artifacts: ${plan.extraArtifacts.length}`);
789
- for (const entry of plan.extraArtifacts) {
790
- lines.push(` - ${toRepoRelativePath(repoRoot, entry.path)}`);
791
- }
792
- lines.push(`- External dependencies: ${plan.externalDependencies.length}`);
793
- for (const entry of plan.externalDependencies) {
794
- lines.push(` - ${entry.version ? `${entry.name}@${entry.version}` : entry.name}`);
795
- }
796
- lines.push(`- External config/secret files: ${plan.externalConfigs.length}`);
797
- for (const entry of plan.externalConfigs) {
798
- lines.push(` - ${toRepoRelativePath(repoRoot, entry.path)}`);
799
- }
800
- lines.push("");
801
- lines.push("Services");
802
- lines.push(`- App entrypoints: ${plan.services.appEntrypoints.length}`);
803
- for (const entry of plan.services.appEntrypoints) {
804
- lines.push(` - ${entry.command}`);
805
- }
806
- lines.push(`- Background services: ${plan.services.backgroundServices.length}`);
807
- for (const entry of plan.services.backgroundServices) {
808
- lines.push(` - ${entry.name}`);
809
- }
810
- const candidatePaths = new Set();
811
- for (const entry of [
812
- ...plan.envFiles,
813
- ...plan.secretFiles,
814
- ...plan.extraArtifacts,
815
- ...plan.externalConfigs,
816
- ]) {
817
- candidatePaths.add(entry.path);
818
- }
819
- const outsideRepoPaths = [];
820
- const directoryPaths = [];
821
- for (const candidatePath of candidatePaths) {
822
- const info = await readPathInfo(candidatePath);
823
- if (info.outsideRepo)
824
- outsideRepoPaths.push(info.relative);
825
- if (info.isDirectory)
826
- directoryPaths.push(info.relative);
827
- }
828
- outsideRepoPaths.sort();
829
- directoryPaths.sort();
830
- const warningLines = [];
831
- if (outsideRepoPaths.length > 0) {
832
- warningLines.push("Outside repo:");
833
- for (const entry of outsideRepoPaths) {
834
- warningLines.push(`- ${entry}`);
835
- }
836
- warningLines.push("");
837
- }
838
- if (directoryPaths.length > 0) {
839
- warningLines.push("Directories:");
840
- for (const entry of directoryPaths) {
841
- warningLines.push(`- ${entry}`);
842
- }
843
- }
844
- return {
845
- summary: lines.join("\n"),
846
- warning: warningLines.length > 0 ? warningLines.join("\n") : null,
847
- };
848
- };
849
- let draftSetup = setupPlan;
850
- clackLog.message([...setupApprovalPrefaceLines], { withGuide: false });
851
- while (true) {
852
- const nextSetup = await promptForPlanApproval({
853
- plan: setupPlan,
854
- repoRoot,
855
- initialPlan: draftSetup,
856
- });
857
- const nextServices = await promptForServicesApproval({
858
- plan: setupPlan.services,
859
- initialSelection: draftSetup?.services ?? null,
860
- });
861
- const nextPlan = { ...nextSetup, services: nextServices };
862
- const { summary, warning } = await buildApprovalSummary(nextPlan);
863
- clackNote(summary, "Selected setup requirements");
864
- if (warning) {
865
- clackNote(warning, "Special attention");
866
- }
867
- const decision = await clackSelect({
868
- message: "Proceed with these selections?",
869
- options: [
870
- { value: "proceed", label: "Proceed" },
871
- { value: "edit", label: "Edit selections" },
872
- { value: "cancel", label: "Cancel" },
873
- ],
874
- initialValue: "proceed",
875
- });
876
- if (isCancel(decision) || decision === "cancel") {
877
- throwInitCanceled();
878
- }
879
- if (decision === "edit") {
880
- draftSetup = nextPlan;
881
- continue;
882
- }
883
- approvedPlan = nextPlan;
884
- break;
885
- }
886
- }
887
- if (!approvedPlan) {
888
- throw new Error("Setup plan missing.");
889
- }
890
- let ensuredPlan = approvedPlan;
891
- if (!skipSetupPlan) {
892
- await writeSetupPlan(setupPath, ensuredPlan);
893
- await updateInitState({ steps: { setupPlanWritten: true } });
894
- }
895
- if (!skipSetupUpload) {
896
- setupArtifacts = await runInitStep({
897
- enabled: progressEnabled,
898
- title: "Packaging setup artifacts",
899
- fn: async ({ status }) => {
900
- let planForArtifacts = ensuredPlan;
901
- for (let attempt = 1; attempt <= SETUP_ARTIFACT_REGEN_MAX_ATTEMPTS + 1; attempt += 1) {
902
- const missingArtifacts = await collectMissingSetupArtifacts({
903
- repoRoot,
904
- homeDir: localHomeDir,
905
- plan: planForArtifacts,
906
- });
907
- if (missingArtifacts.length === 0) {
908
- ensuredPlan = planForArtifacts;
909
- approvedPlan = planForArtifacts;
910
- return await createSetupArtifacts({
911
- repoRoot,
912
- plan: planForArtifacts,
913
- outputDir: setupDir,
914
- tempDir: setupTempDir,
915
- homeDir: localHomeDir,
916
- });
917
- }
918
- if (attempt > SETUP_ARTIFACT_REGEN_MAX_ATTEMPTS) {
919
- const lines = missingArtifacts
920
- .map((entry) => `- ${formatMissingSetupArtifact(entry)}`)
921
- .sort((a, b) => a.localeCompare(b));
922
- throw new Error([
923
- "Setup artifact scan returned paths that do not exist locally.",
924
- `Retried regeneration ${SETUP_ARTIFACT_REGEN_MAX_ATTEMPTS} time(s) and still found missing files:`,
925
- ...lines,
926
- ].join("\n"));
927
- }
928
- const needsEnvSecrets = missingArtifacts.some((entry) => entry.category === "envFiles" ||
929
- entry.category === "secretFiles");
930
- const needsExternal = missingArtifacts.some((entry) => entry.category === "externalConfigs");
931
- const needsExtraArtifacts = missingArtifacts.some((entry) => entry.category === "extraArtifacts");
932
- const scanLabels = [
933
- ...(needsEnvSecrets ? ["env/secrets"] : []),
934
- ...(needsExternal ? ["external"] : []),
935
- ...(needsExtraArtifacts ? ["extra artifacts"] : []),
936
- ];
937
- status.stage(`Missing setup paths; rescan ${scanLabels.join(", ")} (${attempt}/${SETUP_ARTIFACT_REGEN_MAX_ATTEMPTS})`);
938
- planForArtifacts = await regenerateSetupPlanForMissingArtifacts({
939
- plan: planForArtifacts,
940
- missingArtifacts,
941
- status,
942
- });
943
- await writeSetupPlan(setupPath, planForArtifacts);
944
- }
945
- throw new Error("Unreachable setup artifacts retry path.");
946
- },
947
- });
948
- }
949
- }
950
- finally {
951
- await fs.rm(setupTempDir, { recursive: true, force: true });
952
- }
953
- if (!approvedPlan) {
954
- throw new Error("Setup plan missing.");
955
- }
956
- const finalApprovedPlan = approvedPlan;
957
- return {
958
- setupPath,
959
- finalApprovedPlan,
960
- setupArtifacts,
961
- skipServicesConfig,
962
- skipServicesEnable,
963
- skipSetupUpload,
964
- };
965
- };
966
- export { runSetupPlanFlow, shouldSkipSetupUpload };
967
- //# sourceMappingURL=setupPlanFlow.js.map