@boxes-dev/dvb-runtime 1.0.298 → 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.
- package/dist/bin/.bundle-state.json +2 -2
- package/dist/bin/dvb.cjs +6 -6
- package/dist/bin/dvbd.cjs +6 -6
- package/package.json +7 -5
- package/dist/devbox/auth.d.ts +0 -22
- package/dist/devbox/auth.d.ts.map +0 -1
- package/dist/devbox/auth.js +0 -233
- package/dist/devbox/auth.js.map +0 -1
- package/dist/devbox/browser.d.ts +0 -19
- package/dist/devbox/browser.d.ts.map +0 -1
- package/dist/devbox/browser.js +0 -60
- package/dist/devbox/browser.js.map +0 -1
- package/dist/devbox/cli.d.ts +0 -7
- package/dist/devbox/cli.d.ts.map +0 -1
- package/dist/devbox/cli.js +0 -124
- package/dist/devbox/cli.js.map +0 -1
- package/dist/devbox/commandRegistry/args.d.ts +0 -18
- package/dist/devbox/commandRegistry/args.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/args.js +0 -107
- package/dist/devbox/commandRegistry/args.js.map +0 -1
- package/dist/devbox/commandRegistry/catalog.d.ts +0 -4
- package/dist/devbox/commandRegistry/catalog.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/catalog.js +0 -763
- package/dist/devbox/commandRegistry/catalog.js.map +0 -1
- package/dist/devbox/commandRegistry/dispatch.d.ts +0 -3
- package/dist/devbox/commandRegistry/dispatch.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/dispatch.js +0 -61
- package/dist/devbox/commandRegistry/dispatch.js.map +0 -1
- package/dist/devbox/commandRegistry/errors.d.ts +0 -8
- package/dist/devbox/commandRegistry/errors.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/errors.js +0 -26
- package/dist/devbox/commandRegistry/errors.js.map +0 -1
- package/dist/devbox/commandRegistry/help.d.ts +0 -5
- package/dist/devbox/commandRegistry/help.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/help.js +0 -94
- package/dist/devbox/commandRegistry/help.js.map +0 -1
- package/dist/devbox/commandRegistry/resolve.d.ts +0 -7
- package/dist/devbox/commandRegistry/resolve.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/resolve.js +0 -32
- package/dist/devbox/commandRegistry/resolve.js.map +0 -1
- package/dist/devbox/commandRegistry/tab.d.ts +0 -10
- package/dist/devbox/commandRegistry/tab.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/tab.js +0 -83
- package/dist/devbox/commandRegistry/tab.js.map +0 -1
- package/dist/devbox/commandRegistry/types.d.ts +0 -32
- package/dist/devbox/commandRegistry/types.d.ts.map +0 -1
- package/dist/devbox/commandRegistry/types.js +0 -2
- package/dist/devbox/commandRegistry/types.js.map +0 -1
- package/dist/devbox/commands/agent.d.ts +0 -52
- package/dist/devbox/commands/agent.d.ts.map +0 -1
- package/dist/devbox/commands/agent.js +0 -397
- package/dist/devbox/commands/agent.js.map +0 -1
- package/dist/devbox/commands/boxSelect.d.ts +0 -25
- package/dist/devbox/commands/boxSelect.d.ts.map +0 -1
- package/dist/devbox/commands/boxSelect.js +0 -94
- package/dist/devbox/commands/boxSelect.js.map +0 -1
- package/dist/devbox/commands/checkpoint.d.ts +0 -9
- package/dist/devbox/commands/checkpoint.d.ts.map +0 -1
- package/dist/devbox/commands/checkpoint.js +0 -105
- package/dist/devbox/commands/checkpoint.js.map +0 -1
- package/dist/devbox/commands/commandProvider.d.ts +0 -33
- package/dist/devbox/commands/commandProvider.d.ts.map +0 -1
- package/dist/devbox/commands/commandProvider.js +0 -156
- package/dist/devbox/commands/commandProvider.js.map +0 -1
- package/dist/devbox/commands/connect.d.ts +0 -39
- package/dist/devbox/commands/connect.d.ts.map +0 -1
- package/dist/devbox/commands/connect.js +0 -1367
- package/dist/devbox/commands/connect.js.map +0 -1
- package/dist/devbox/commands/connectSessionMapping.d.ts +0 -64
- package/dist/devbox/commands/connectSessionMapping.d.ts.map +0 -1
- package/dist/devbox/commands/connectSessionMapping.js +0 -153
- package/dist/devbox/commands/connectSessionMapping.js.map +0 -1
- package/dist/devbox/commands/cp.d.ts +0 -60
- package/dist/devbox/commands/cp.d.ts.map +0 -1
- package/dist/devbox/commands/cp.js +0 -383
- package/dist/devbox/commands/cp.js.map +0 -1
- package/dist/devbox/commands/daemon.d.ts +0 -4
- package/dist/devbox/commands/daemon.d.ts.map +0 -1
- package/dist/devbox/commands/daemon.js +0 -49
- package/dist/devbox/commands/daemon.js.map +0 -1
- package/dist/devbox/commands/destroy.d.ts +0 -2
- package/dist/devbox/commands/destroy.d.ts.map +0 -1
- package/dist/devbox/commands/destroy.js +0 -204
- package/dist/devbox/commands/destroy.js.map +0 -1
- package/dist/devbox/commands/destroyE2b.d.ts +0 -22
- package/dist/devbox/commands/destroyE2b.d.ts.map +0 -1
- package/dist/devbox/commands/destroyE2b.js +0 -12
- package/dist/devbox/commands/destroyE2b.js.map +0 -1
- package/dist/devbox/commands/destroyLocalState.d.ts +0 -34
- package/dist/devbox/commands/destroyLocalState.d.ts.map +0 -1
- package/dist/devbox/commands/destroyLocalState.js +0 -187
- package/dist/devbox/commands/destroyLocalState.js.map +0 -1
- package/dist/devbox/commands/destroyModal.d.ts +0 -21
- package/dist/devbox/commands/destroyModal.d.ts.map +0 -1
- package/dist/devbox/commands/destroyModal.js +0 -13
- package/dist/devbox/commands/destroyModal.js.map +0 -1
- package/dist/devbox/commands/destroyShared.d.ts +0 -14
- package/dist/devbox/commands/destroyShared.d.ts.map +0 -1
- package/dist/devbox/commands/destroyShared.js +0 -37
- package/dist/devbox/commands/destroyShared.js.map +0 -1
- package/dist/devbox/commands/fork.d.ts +0 -9
- package/dist/devbox/commands/fork.d.ts.map +0 -1
- package/dist/devbox/commands/fork.js +0 -94
- package/dist/devbox/commands/fork.js.map +0 -1
- package/dist/devbox/commands/ide.d.ts +0 -35
- package/dist/devbox/commands/ide.d.ts.map +0 -1
- package/dist/devbox/commands/ide.js +0 -987
- package/dist/devbox/commands/ide.js.map +0 -1
- package/dist/devbox/commands/init/args.d.ts +0 -18
- package/dist/devbox/commands/init/args.d.ts.map +0 -1
- package/dist/devbox/commands/init/args.js +0 -44
- package/dist/devbox/commands/init/args.js.map +0 -1
- package/dist/devbox/commands/init/clack.d.ts +0 -22
- package/dist/devbox/commands/init/clack.d.ts.map +0 -1
- package/dist/devbox/commands/init/clack.js +0 -158
- package/dist/devbox/commands/init/clack.js.map +0 -1
- package/dist/devbox/commands/init/claudeBootstrap.d.ts +0 -49
- package/dist/devbox/commands/init/claudeBootstrap.d.ts.map +0 -1
- package/dist/devbox/commands/init/claudeBootstrap.js +0 -504
- package/dist/devbox/commands/init/claudeBootstrap.js.map +0 -1
- package/dist/devbox/commands/init/codex/artifacts.d.ts +0 -49
- package/dist/devbox/commands/init/codex/artifacts.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/artifacts.js +0 -278
- package/dist/devbox/commands/init/codex/artifacts.js.map +0 -1
- package/dist/devbox/commands/init/codex/config.d.ts +0 -6
- package/dist/devbox/commands/init/codex/config.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/config.js +0 -43
- package/dist/devbox/commands/init/codex/config.js.map +0 -1
- package/dist/devbox/commands/init/codex/events.d.ts +0 -14
- package/dist/devbox/commands/init/codex/events.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/events.js +0 -435
- package/dist/devbox/commands/init/codex/events.js.map +0 -1
- package/dist/devbox/commands/init/codex/execConfig.d.ts +0 -5
- package/dist/devbox/commands/init/codex/execConfig.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/execConfig.js +0 -10
- package/dist/devbox/commands/init/codex/execConfig.js.map +0 -1
- package/dist/devbox/commands/init/codex/index.d.ts +0 -136
- package/dist/devbox/commands/init/codex/index.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/index.js +0 -1115
- package/dist/devbox/commands/init/codex/index.js.map +0 -1
- package/dist/devbox/commands/init/codex/local.d.ts +0 -124
- package/dist/devbox/commands/init/codex/local.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/local.js +0 -1381
- package/dist/devbox/commands/init/codex/local.js.map +0 -1
- package/dist/devbox/commands/init/codex/localExecArgs.d.ts +0 -25
- package/dist/devbox/commands/init/codex/localExecArgs.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/localExecArgs.js +0 -48
- package/dist/devbox/commands/init/codex/localExecArgs.js.map +0 -1
- package/dist/devbox/commands/init/codex/plan.d.ts +0 -99
- package/dist/devbox/commands/init/codex/plan.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/plan.js +0 -231
- package/dist/devbox/commands/init/codex/plan.js.map +0 -1
- package/dist/devbox/commands/init/codex/prompts.d.ts +0 -9
- package/dist/devbox/commands/init/codex/prompts.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/prompts.js +0 -51
- package/dist/devbox/commands/init/codex/prompts.js.map +0 -1
- package/dist/devbox/commands/init/codex/proxy.d.ts +0 -10
- package/dist/devbox/commands/init/codex/proxy.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/proxy.js +0 -32
- package/dist/devbox/commands/init/codex/proxy.js.map +0 -1
- package/dist/devbox/commands/init/codex/remote.d.ts +0 -96
- package/dist/devbox/commands/init/codex/remote.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/remote.js +0 -927
- package/dist/devbox/commands/init/codex/remote.js.map +0 -1
- package/dist/devbox/commands/init/codex/retry.d.ts +0 -17
- package/dist/devbox/commands/init/codex/retry.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/retry.js +0 -17
- package/dist/devbox/commands/init/codex/retry.js.map +0 -1
- package/dist/devbox/commands/init/codex/scanStatus.d.ts +0 -5
- package/dist/devbox/commands/init/codex/scanStatus.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/scanStatus.js +0 -27
- package/dist/devbox/commands/init/codex/scanStatus.js.map +0 -1
- package/dist/devbox/commands/init/codex/shellHistory.d.ts +0 -39
- package/dist/devbox/commands/init/codex/shellHistory.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/shellHistory.js +0 -258
- package/dist/devbox/commands/init/codex/shellHistory.js.map +0 -1
- package/dist/devbox/commands/init/codex/template.d.ts +0 -3
- package/dist/devbox/commands/init/codex/template.d.ts.map +0 -1
- package/dist/devbox/commands/init/codex/template.js +0 -3
- package/dist/devbox/commands/init/codex/template.js.map +0 -1
- package/dist/devbox/commands/init/finalizeFlow.d.ts +0 -95
- package/dist/devbox/commands/init/finalizeFlow.d.ts.map +0 -1
- package/dist/devbox/commands/init/finalizeFlow.js +0 -786
- package/dist/devbox/commands/init/finalizeFlow.js.map +0 -1
- package/dist/devbox/commands/init/index.d.ts +0 -11
- package/dist/devbox/commands/init/index.d.ts.map +0 -1
- package/dist/devbox/commands/init/index.js +0 -1058
- package/dist/devbox/commands/init/index.js.map +0 -1
- package/dist/devbox/commands/init/modal.d.ts +0 -5
- package/dist/devbox/commands/init/modal.d.ts.map +0 -1
- package/dist/devbox/commands/init/modal.js +0 -4
- package/dist/devbox/commands/init/modal.js.map +0 -1
- package/dist/devbox/commands/init/packaging.d.ts +0 -5
- package/dist/devbox/commands/init/packaging.d.ts.map +0 -1
- package/dist/devbox/commands/init/packaging.js +0 -81
- package/dist/devbox/commands/init/packaging.js.map +0 -1
- package/dist/devbox/commands/init/progress.d.ts +0 -31
- package/dist/devbox/commands/init/progress.d.ts.map +0 -1
- package/dist/devbox/commands/init/progress.js +0 -205
- package/dist/devbox/commands/init/progress.js.map +0 -1
- package/dist/devbox/commands/init/provider/e2b.d.ts +0 -29
- package/dist/devbox/commands/init/provider/e2b.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/e2b.js +0 -130
- package/dist/devbox/commands/init/provider/e2b.js.map +0 -1
- package/dist/devbox/commands/init/provider/e2bRuntime.d.ts +0 -39
- package/dist/devbox/commands/init/provider/e2bRuntime.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/e2bRuntime.js +0 -679
- package/dist/devbox/commands/init/provider/e2bRuntime.js.map +0 -1
- package/dist/devbox/commands/init/provider/index.d.ts +0 -8
- package/dist/devbox/commands/init/provider/index.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/index.js +0 -5
- package/dist/devbox/commands/init/provider/index.js.map +0 -1
- package/dist/devbox/commands/init/provider/modal.d.ts +0 -34
- package/dist/devbox/commands/init/provider/modal.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/modal.js +0 -274
- package/dist/devbox/commands/init/provider/modal.js.map +0 -1
- package/dist/devbox/commands/init/provider/modalRuntime.d.ts +0 -3
- package/dist/devbox/commands/init/provider/modalRuntime.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/modalRuntime.js +0 -2
- package/dist/devbox/commands/init/provider/modalRuntime.js.map +0 -1
- package/dist/devbox/commands/init/provider/resolve.d.ts +0 -44
- package/dist/devbox/commands/init/provider/resolve.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/resolve.js +0 -172
- package/dist/devbox/commands/init/provider/resolve.js.map +0 -1
- package/dist/devbox/commands/init/provider/shared.d.ts +0 -10
- package/dist/devbox/commands/init/provider/shared.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/shared.js +0 -2
- package/dist/devbox/commands/init/provider/shared.js.map +0 -1
- package/dist/devbox/commands/init/provider/sprites.d.ts +0 -30
- package/dist/devbox/commands/init/provider/sprites.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/sprites.js +0 -183
- package/dist/devbox/commands/init/provider/sprites.js.map +0 -1
- package/dist/devbox/commands/init/provider/types.d.ts +0 -19
- package/dist/devbox/commands/init/provider/types.d.ts.map +0 -1
- package/dist/devbox/commands/init/provider/types.js +0 -2
- package/dist/devbox/commands/init/provider/types.js.map +0 -1
- package/dist/devbox/commands/init/provisionFlow.d.ts +0 -53
- package/dist/devbox/commands/init/provisionFlow.d.ts.map +0 -1
- package/dist/devbox/commands/init/provisionFlow.js +0 -541
- package/dist/devbox/commands/init/provisionFlow.js.map +0 -1
- package/dist/devbox/commands/init/registry.d.ts +0 -15
- package/dist/devbox/commands/init/registry.d.ts.map +0 -1
- package/dist/devbox/commands/init/registry.js +0 -38
- package/dist/devbox/commands/init/registry.js.map +0 -1
- package/dist/devbox/commands/init/remote.d.ts +0 -48
- package/dist/devbox/commands/init/remote.d.ts.map +0 -1
- package/dist/devbox/commands/init/remote.js +0 -766
- package/dist/devbox/commands/init/remote.js.map +0 -1
- package/dist/devbox/commands/init/repo.d.ts +0 -45
- package/dist/devbox/commands/init/repo.d.ts.map +0 -1
- package/dist/devbox/commands/init/repo.js +0 -235
- package/dist/devbox/commands/init/repo.js.map +0 -1
- package/dist/devbox/commands/init/retryableErrors.d.ts +0 -4
- package/dist/devbox/commands/init/retryableErrors.d.ts.map +0 -1
- package/dist/devbox/commands/init/retryableErrors.js +0 -42
- package/dist/devbox/commands/init/retryableErrors.js.map +0 -1
- package/dist/devbox/commands/init/scanProgress.d.ts +0 -18
- package/dist/devbox/commands/init/scanProgress.d.ts.map +0 -1
- package/dist/devbox/commands/init/scanProgress.js +0 -47
- package/dist/devbox/commands/init/scanProgress.js.map +0 -1
- package/dist/devbox/commands/init/session.d.ts +0 -72
- package/dist/devbox/commands/init/session.d.ts.map +0 -1
- package/dist/devbox/commands/init/session.js +0 -348
- package/dist/devbox/commands/init/session.js.map +0 -1
- package/dist/devbox/commands/init/setupArtifactsValidation.d.ts +0 -28
- package/dist/devbox/commands/init/setupArtifactsValidation.d.ts.map +0 -1
- package/dist/devbox/commands/init/setupArtifactsValidation.js +0 -113
- package/dist/devbox/commands/init/setupArtifactsValidation.js.map +0 -1
- package/dist/devbox/commands/init/setupPlanFlow.d.ts +0 -34
- package/dist/devbox/commands/init/setupPlanFlow.d.ts.map +0 -1
- package/dist/devbox/commands/init/setupPlanFlow.js +0 -967
- package/dist/devbox/commands/init/setupPlanFlow.js.map +0 -1
- package/dist/devbox/commands/init/ssh.d.ts +0 -19
- package/dist/devbox/commands/init/ssh.d.ts.map +0 -1
- package/dist/devbox/commands/init/ssh.js +0 -276
- package/dist/devbox/commands/init/ssh.js.map +0 -1
- package/dist/devbox/commands/init/state.d.ts +0 -73
- package/dist/devbox/commands/init/state.d.ts.map +0 -1
- package/dist/devbox/commands/init/state.js +0 -118
- package/dist/devbox/commands/init/state.js.map +0 -1
- package/dist/devbox/commands/init/statusFlow.d.ts +0 -27
- package/dist/devbox/commands/init/statusFlow.d.ts.map +0 -1
- package/dist/devbox/commands/init/statusFlow.js +0 -160
- package/dist/devbox/commands/init/statusFlow.js.map +0 -1
- package/dist/devbox/commands/list.d.ts +0 -35
- package/dist/devbox/commands/list.d.ts.map +0 -1
- package/dist/devbox/commands/list.js +0 -311
- package/dist/devbox/commands/list.js.map +0 -1
- package/dist/devbox/commands/listFormatting.d.ts +0 -27
- package/dist/devbox/commands/listFormatting.d.ts.map +0 -1
- package/dist/devbox/commands/listFormatting.js +0 -155
- package/dist/devbox/commands/listFormatting.js.map +0 -1
- package/dist/devbox/commands/logout.d.ts +0 -2
- package/dist/devbox/commands/logout.d.ts.map +0 -1
- package/dist/devbox/commands/logout.js +0 -64
- package/dist/devbox/commands/logout.js.map +0 -1
- package/dist/devbox/commands/managedProviderClient.d.ts +0 -24
- package/dist/devbox/commands/managedProviderClient.d.ts.map +0 -1
- package/dist/devbox/commands/managedProviderClient.js +0 -42
- package/dist/devbox/commands/managedProviderClient.js.map +0 -1
- package/dist/devbox/commands/managedProviderContext.d.ts +0 -34
- package/dist/devbox/commands/managedProviderContext.d.ts.map +0 -1
- package/dist/devbox/commands/managedProviderContext.js +0 -34
- package/dist/devbox/commands/managedProviderContext.js.map +0 -1
- package/dist/devbox/commands/mount.d.ts +0 -25
- package/dist/devbox/commands/mount.d.ts.map +0 -1
- package/dist/devbox/commands/mount.js +0 -200
- package/dist/devbox/commands/mount.js.map +0 -1
- package/dist/devbox/commands/ports.d.ts +0 -11
- package/dist/devbox/commands/ports.d.ts.map +0 -1
- package/dist/devbox/commands/ports.js +0 -183
- package/dist/devbox/commands/ports.js.map +0 -1
- package/dist/devbox/commands/power.d.ts +0 -10
- package/dist/devbox/commands/power.d.ts.map +0 -1
- package/dist/devbox/commands/power.js +0 -139
- package/dist/devbox/commands/power.js.map +0 -1
- package/dist/devbox/commands/provider/daemonRuntimeShared.d.ts +0 -25
- package/dist/devbox/commands/provider/daemonRuntimeShared.d.ts.map +0 -1
- package/dist/devbox/commands/provider/daemonRuntimeShared.js +0 -217
- package/dist/devbox/commands/provider/daemonRuntimeShared.js.map +0 -1
- package/dist/devbox/commands/provider/directDaemonRuntime.d.ts +0 -106
- package/dist/devbox/commands/provider/directDaemonRuntime.d.ts.map +0 -1
- package/dist/devbox/commands/provider/directDaemonRuntime.js +0 -1442
- package/dist/devbox/commands/provider/directDaemonRuntime.js.map +0 -1
- package/dist/devbox/commands/provider/e2bCommandContext.d.ts +0 -11
- package/dist/devbox/commands/provider/e2bCommandContext.d.ts.map +0 -1
- package/dist/devbox/commands/provider/e2bCommandContext.js +0 -16
- package/dist/devbox/commands/provider/e2bCommandContext.js.map +0 -1
- package/dist/devbox/commands/provider/e2bLifecycleShared.d.ts +0 -20
- package/dist/devbox/commands/provider/e2bLifecycleShared.d.ts.map +0 -1
- package/dist/devbox/commands/provider/e2bLifecycleShared.js +0 -42
- package/dist/devbox/commands/provider/e2bLifecycleShared.js.map +0 -1
- package/dist/devbox/commands/provider/modalCommandContext.d.ts +0 -22
- package/dist/devbox/commands/provider/modalCommandContext.d.ts.map +0 -1
- package/dist/devbox/commands/provider/modalCommandContext.js +0 -47
- package/dist/devbox/commands/provider/modalCommandContext.js.map +0 -1
- package/dist/devbox/commands/provider/modalLifecycle.d.ts +0 -158
- package/dist/devbox/commands/provider/modalLifecycle.d.ts.map +0 -1
- package/dist/devbox/commands/provider/modalLifecycle.js +0 -702
- package/dist/devbox/commands/provider/modalLifecycle.js.map +0 -1
- package/dist/devbox/commands/provider/modalRuntime.d.ts +0 -25
- package/dist/devbox/commands/provider/modalRuntime.d.ts.map +0 -1
- package/dist/devbox/commands/provider/modalRuntime.js +0 -791
- package/dist/devbox/commands/provider/modalRuntime.js.map +0 -1
- package/dist/devbox/commands/provider/runtimeTypes.d.ts +0 -8
- package/dist/devbox/commands/provider/runtimeTypes.d.ts.map +0 -1
- package/dist/devbox/commands/provider/runtimeTypes.js +0 -2
- package/dist/devbox/commands/provider/runtimeTypes.js.map +0 -1
- package/dist/devbox/commands/providerClient.d.ts +0 -82
- package/dist/devbox/commands/providerClient.d.ts.map +0 -1
- package/dist/devbox/commands/providerClient.js +0 -719
- package/dist/devbox/commands/providerClient.js.map +0 -1
- package/dist/devbox/commands/reboot.d.ts +0 -8
- package/dist/devbox/commands/reboot.d.ts.map +0 -1
- package/dist/devbox/commands/reboot.js +0 -100
- package/dist/devbox/commands/reboot.js.map +0 -1
- package/dist/devbox/commands/reset.d.ts +0 -30
- package/dist/devbox/commands/reset.d.ts.map +0 -1
- package/dist/devbox/commands/reset.js +0 -114
- package/dist/devbox/commands/reset.js.map +0 -1
- package/dist/devbox/commands/runtimeClient.d.ts +0 -65
- package/dist/devbox/commands/runtimeClient.d.ts.map +0 -1
- package/dist/devbox/commands/runtimeClient.js +0 -127
- package/dist/devbox/commands/runtimeClient.js.map +0 -1
- package/dist/devbox/commands/sentryTest.d.ts +0 -2
- package/dist/devbox/commands/sentryTest.d.ts.map +0 -1
- package/dist/devbox/commands/sentryTest.js +0 -117
- package/dist/devbox/commands/sentryTest.js.map +0 -1
- package/dist/devbox/commands/services.d.ts +0 -2
- package/dist/devbox/commands/services.d.ts.map +0 -1
- package/dist/devbox/commands/services.js +0 -619
- package/dist/devbox/commands/services.js.map +0 -1
- package/dist/devbox/commands/servicesConfig.d.ts +0 -19
- package/dist/devbox/commands/servicesConfig.d.ts.map +0 -1
- package/dist/devbox/commands/servicesConfig.js +0 -61
- package/dist/devbox/commands/servicesConfig.js.map +0 -1
- package/dist/devbox/commands/servicesToml.d.ts +0 -13
- package/dist/devbox/commands/servicesToml.d.ts.map +0 -1
- package/dist/devbox/commands/servicesToml.js +0 -201
- package/dist/devbox/commands/servicesToml.js.map +0 -1
- package/dist/devbox/commands/sessionUtils.d.ts +0 -10
- package/dist/devbox/commands/sessionUtils.d.ts.map +0 -1
- package/dist/devbox/commands/sessionUtils.js +0 -48
- package/dist/devbox/commands/sessionUtils.js.map +0 -1
- package/dist/devbox/commands/sessions.d.ts +0 -3
- package/dist/devbox/commands/sessions.d.ts.map +0 -1
- package/dist/devbox/commands/sessions.js +0 -490
- package/dist/devbox/commands/sessions.js.map +0 -1
- package/dist/devbox/commands/setup.d.ts +0 -36
- package/dist/devbox/commands/setup.d.ts.map +0 -1
- package/dist/devbox/commands/setup.js +0 -816
- package/dist/devbox/commands/setup.js.map +0 -1
- package/dist/devbox/commands/setupClaude.d.ts +0 -51
- package/dist/devbox/commands/setupClaude.d.ts.map +0 -1
- package/dist/devbox/commands/setupClaude.js +0 -202
- package/dist/devbox/commands/setupClaude.js.map +0 -1
- package/dist/devbox/commands/setupTooling.d.ts +0 -56
- package/dist/devbox/commands/setupTooling.d.ts.map +0 -1
- package/dist/devbox/commands/setupTooling.js +0 -187
- package/dist/devbox/commands/setupTooling.js.map +0 -1
- package/dist/devbox/commands/sshAccess.d.ts +0 -31
- package/dist/devbox/commands/sshAccess.d.ts.map +0 -1
- package/dist/devbox/commands/sshAccess.js +0 -353
- package/dist/devbox/commands/sshAccess.js.map +0 -1
- package/dist/devbox/commands/sshConfig.d.ts +0 -23
- package/dist/devbox/commands/sshConfig.d.ts.map +0 -1
- package/dist/devbox/commands/sshConfig.js +0 -366
- package/dist/devbox/commands/sshConfig.js.map +0 -1
- package/dist/devbox/commands/sshProxy.d.ts +0 -2
- package/dist/devbox/commands/sshProxy.d.ts.map +0 -1
- package/dist/devbox/commands/sshProxy.js +0 -215
- package/dist/devbox/commands/sshProxy.js.map +0 -1
- package/dist/devbox/commands/uninstall.d.ts +0 -2
- package/dist/devbox/commands/uninstall.d.ts.map +0 -1
- package/dist/devbox/commands/uninstall.js +0 -365
- package/dist/devbox/commands/uninstall.js.map +0 -1
- package/dist/devbox/commands/upgrade.d.ts +0 -14
- package/dist/devbox/commands/upgrade.d.ts.map +0 -1
- package/dist/devbox/commands/upgrade.js +0 -60
- package/dist/devbox/commands/upgrade.js.map +0 -1
- package/dist/devbox/commands/version.d.ts +0 -8
- package/dist/devbox/commands/version.d.ts.map +0 -1
- package/dist/devbox/commands/version.js +0 -134
- package/dist/devbox/commands/version.js.map +0 -1
- package/dist/devbox/commands/whoami.d.ts +0 -2
- package/dist/devbox/commands/whoami.d.ts.map +0 -1
- package/dist/devbox/commands/whoami.js +0 -114
- package/dist/devbox/commands/whoami.js.map +0 -1
- package/dist/devbox/completions/cache.d.ts +0 -53
- package/dist/devbox/completions/cache.d.ts.map +0 -1
- package/dist/devbox/completions/cache.js +0 -227
- package/dist/devbox/completions/cache.js.map +0 -1
- package/dist/devbox/completions/index.d.ts +0 -18
- package/dist/devbox/completions/index.d.ts.map +0 -1
- package/dist/devbox/completions/index.js +0 -759
- package/dist/devbox/completions/index.js.map +0 -1
- package/dist/devbox/controlPlane.d.ts +0 -460
- package/dist/devbox/controlPlane.d.ts.map +0 -1
- package/dist/devbox/controlPlane.js +0 -1910
- package/dist/devbox/controlPlane.js.map +0 -1
- package/dist/devbox/daemonClient.d.ts +0 -44
- package/dist/devbox/daemonClient.d.ts.map +0 -1
- package/dist/devbox/daemonClient.js +0 -677
- package/dist/devbox/daemonClient.js.map +0 -1
- package/dist/devbox/e2bExecErrors.d.ts +0 -11
- package/dist/devbox/e2bExecErrors.d.ts.map +0 -1
- package/dist/devbox/e2bExecErrors.js +0 -19
- package/dist/devbox/e2bExecErrors.js.map +0 -1
- package/dist/devbox/latency.d.ts +0 -25
- package/dist/devbox/latency.d.ts.map +0 -1
- package/dist/devbox/latency.js +0 -186
- package/dist/devbox/latency.js.map +0 -1
- package/dist/devbox/logger.d.ts +0 -2
- package/dist/devbox/logger.d.ts.map +0 -1
- package/dist/devbox/logger.js +0 -3
- package/dist/devbox/logger.js.map +0 -1
- package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.d.ts +0 -11
- package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.d.ts.map +0 -1
- package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.js +0 -118
- package/dist/devbox/terminal/kittyCtrlCReleaseSuppressor.js.map +0 -1
- package/dist/devbox/terminal/osc.d.ts +0 -11
- package/dist/devbox/terminal/osc.d.ts.map +0 -1
- package/dist/devbox/terminal/osc.js +0 -84
- package/dist/devbox/terminal/osc.js.map +0 -1
- package/dist/devbox/terminal/sessionProtocol.d.ts +0 -46
- package/dist/devbox/terminal/sessionProtocol.d.ts.map +0 -1
- package/dist/devbox/terminal/sessionProtocol.js +0 -631
- package/dist/devbox/terminal/sessionProtocol.js.map +0 -1
- package/dist/devbox/ui/colors.d.ts +0 -19
- package/dist/devbox/ui/colors.d.ts.map +0 -1
- package/dist/devbox/ui/colors.js +0 -22
- package/dist/devbox/ui/colors.js.map +0 -1
- package/dist/devbox/ui/copyableUrl.d.ts +0 -4
- package/dist/devbox/ui/copyableUrl.d.ts.map +0 -1
- package/dist/devbox/ui/copyableUrl.js +0 -10
- package/dist/devbox/ui/copyableUrl.js.map +0 -1
- package/dist/devbox/ui/qr.d.ts +0 -3
- package/dist/devbox/ui/qr.d.ts.map +0 -1
- package/dist/devbox/ui/qr.js +0 -17
- package/dist/devbox/ui/qr.js.map +0 -1
- package/dist/devbox/ui/statusLine.d.ts +0 -14
- package/dist/devbox/ui/statusLine.d.ts.map +0 -1
- package/dist/devbox/ui/statusLine.js +0 -92
- package/dist/devbox/ui/statusLine.js.map +0 -1
- package/dist/devbox/updateNotice.d.ts +0 -2
- package/dist/devbox/updateNotice.d.ts.map +0 -1
- package/dist/devbox/updateNotice.js +0 -43
- 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
|