@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.
- 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,816 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { createWriteStream, constants as fsConstants } from "node:fs";
|
|
4
|
-
import { access, mkdtemp, mkdir, rm } from "node:fs/promises";
|
|
5
|
-
import os from "node:os";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
import { Readable } from "node:stream";
|
|
8
|
-
import { pipeline } from "node:stream/promises";
|
|
9
|
-
import { isCancel, select as clackSelect, spinner as clackSpinner, } from "@clack/prompts";
|
|
10
|
-
import { addDevboxClientVersionHeader, parseUpgradeRequiredResponseBody, resolveSocketInfo, DEFAULT_RELAY_BASE_URL, createSecretStore, loadConfig, resolveConfigPath, resolveCodexAuthMode, resolveDevboxDir, resolveDevboxProfile, resolveRemoteRelayBaseUrl, resolveSecretsPath, resolveRelayBaseUrl, saveConfig, } from "@boxes-dev/core";
|
|
11
|
-
import { CONTROL_PLANE_INTERACTIVE_SIGNIN_STAGE, ensureSpritesToken, } from "../auth.js";
|
|
12
|
-
import { parseCommandArgs, readBooleanFlag, readStringFlag, } from "../commandRegistry/args.js";
|
|
13
|
-
import { usageError } from "../commandRegistry/errors.js";
|
|
14
|
-
import { clearModalCredentials, fetchClaudeTokenStatus, clearSpriteToken, fetchResolvedE2bCredentials, fetchResolvedModalCredentials, fetchSpriteTokenStatus, getControlPlaneUrl, storeClaudeCodeOauthToken, storeModalCredentials, storeSpriteToken, } from "../controlPlane.js";
|
|
15
|
-
import { ensureDaemonRunning, stopDaemon } from "../daemonClient.js";
|
|
16
|
-
import { logger } from "../logger.js";
|
|
17
|
-
import { colors } from "../ui/colors.js";
|
|
18
|
-
import { renderTerminalQr } from "../ui/qr.js";
|
|
19
|
-
import { createStatusLine } from "../ui/statusLine.js";
|
|
20
|
-
import { maybeOfferCompletionsInstall } from "../completions/index.js";
|
|
21
|
-
import { collectClaudeCodeOauthTokenInteractively, formatClaudeSetupState, resolveClaudeSetupState, } from "./setupClaude.js";
|
|
22
|
-
import { ensureCodexCliForSetup, probeLocalCli } from "./setupTooling.js";
|
|
23
|
-
const trim = (value) => value.trim().replace(/\r/g, "");
|
|
24
|
-
const normalizeOrgSlug = (value) => {
|
|
25
|
-
const trimmed = value.trim();
|
|
26
|
-
if (!trimmed)
|
|
27
|
-
return undefined;
|
|
28
|
-
if (!/^[a-z0-9][a-z0-9-]*$/i.test(trimmed))
|
|
29
|
-
return undefined;
|
|
30
|
-
return trimmed;
|
|
31
|
-
};
|
|
32
|
-
export const extractOrgFromSpriteToken = (token) => {
|
|
33
|
-
const trimmed = token.trim();
|
|
34
|
-
if (!trimmed)
|
|
35
|
-
return undefined;
|
|
36
|
-
const normalized = trimmed.toLowerCase().startsWith("bearer ")
|
|
37
|
-
? trimmed.slice("bearer ".length).trim()
|
|
38
|
-
: trimmed;
|
|
39
|
-
const slashIndex = normalized.indexOf("/");
|
|
40
|
-
if (slashIndex <= 0)
|
|
41
|
-
return undefined;
|
|
42
|
-
return normalizeOrgSlug(normalized.slice(0, slashIndex));
|
|
43
|
-
};
|
|
44
|
-
const parseCodexAuthMode = (value) => {
|
|
45
|
-
const normalized = value.trim().toLowerCase();
|
|
46
|
-
if (normalized === "proxy" || normalized === "byo") {
|
|
47
|
-
return normalized;
|
|
48
|
-
}
|
|
49
|
-
throw new Error(`Invalid value for --codex-auth: ${value}. Expected "proxy" or "byo".`);
|
|
50
|
-
};
|
|
51
|
-
const parseSpriteAuthMode = (value) => {
|
|
52
|
-
const normalized = value.trim().toLowerCase();
|
|
53
|
-
if (normalized === "default" || normalized === "byo") {
|
|
54
|
-
return normalized;
|
|
55
|
-
}
|
|
56
|
-
throw new Error(`Invalid value for --sprite-auth: ${value}. Expected "default" or "byo".`);
|
|
57
|
-
};
|
|
58
|
-
const parseModalAuthMode = (value) => {
|
|
59
|
-
const normalized = value.trim().toLowerCase();
|
|
60
|
-
if (normalized === "default" || normalized === "byo") {
|
|
61
|
-
return normalized;
|
|
62
|
-
}
|
|
63
|
-
throw new Error(`Invalid value for --modal-auth: ${value}. Expected "default" or "byo".`);
|
|
64
|
-
};
|
|
65
|
-
const resolveSpriteAuthMode = (tokenSource) => {
|
|
66
|
-
return tokenSource === "user" ? "byo" : "default";
|
|
67
|
-
};
|
|
68
|
-
const resolveModalAuthMode = (source) => {
|
|
69
|
-
return source === "user" ? "byo" : "default";
|
|
70
|
-
};
|
|
71
|
-
const resolveE2bAuthMode = (source) => {
|
|
72
|
-
return source === "shared" ? "shared" : "unconfigured";
|
|
73
|
-
};
|
|
74
|
-
const normalizeSiteUrl = (raw) => {
|
|
75
|
-
const trimmed = trim(raw);
|
|
76
|
-
if (!trimmed)
|
|
77
|
-
return null;
|
|
78
|
-
const candidate = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed)
|
|
79
|
-
? trimmed
|
|
80
|
-
: `https://${trimmed}`;
|
|
81
|
-
try {
|
|
82
|
-
const url = new URL(candidate);
|
|
83
|
-
if (url.protocol !== "https:" && url.protocol !== "http:") {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
return `${url.protocol}//${url.host}`;
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const resolveSiteUrl = () => {
|
|
93
|
-
const runtimeSiteUrl = normalizeSiteUrl(process.env.SITE_URL ?? "");
|
|
94
|
-
if (runtimeSiteUrl)
|
|
95
|
-
return runtimeSiteUrl;
|
|
96
|
-
const embeddedSiteUrl = typeof __DEVBOX_SITE_URL__ === "string"
|
|
97
|
-
? normalizeSiteUrl(__DEVBOX_SITE_URL__)
|
|
98
|
-
: null;
|
|
99
|
-
if (embeddedSiteUrl)
|
|
100
|
-
return embeddedSiteUrl;
|
|
101
|
-
return "https://boxes.dev";
|
|
102
|
-
};
|
|
103
|
-
const MOBILE_DOWNLOAD_LINK = {
|
|
104
|
-
label: "Mobile",
|
|
105
|
-
url: new URL("/m", resolveSiteUrl()).toString(),
|
|
106
|
-
};
|
|
107
|
-
const DESKTOP_APP_BUNDLE_NAME = "Boxes.dev.app";
|
|
108
|
-
const DESKTOP_APP_TARGET_PATH = path.join("/Applications", DESKTOP_APP_BUNDLE_NAME);
|
|
109
|
-
const MAC_DESKTOP_DOWNLOAD_LINK = {
|
|
110
|
-
label: "Desktop (macOS)",
|
|
111
|
-
url: "https://deploy.boxes.dev/desktop/boxes-dev-latest.dmg",
|
|
112
|
-
};
|
|
113
|
-
const parseSetupArgs = (args) => {
|
|
114
|
-
const { flags, positionals } = parseCommandArgs({
|
|
115
|
-
args,
|
|
116
|
-
commandPath: ["setup"],
|
|
117
|
-
flagLabel: "setup",
|
|
118
|
-
boolean: ["json", "no-claude-auth", "no-verify"],
|
|
119
|
-
string: [
|
|
120
|
-
"token",
|
|
121
|
-
"sprite-token",
|
|
122
|
-
"claude-code-oauth-token",
|
|
123
|
-
"codex-auth",
|
|
124
|
-
"sprite-auth",
|
|
125
|
-
"modal-auth",
|
|
126
|
-
"e2b-auth",
|
|
127
|
-
"modal-token-id",
|
|
128
|
-
"modal-token-secret",
|
|
129
|
-
"e2b-api-key",
|
|
130
|
-
"org",
|
|
131
|
-
],
|
|
132
|
-
});
|
|
133
|
-
if (positionals.length > 0) {
|
|
134
|
-
throw usageError(["setup"], `Unknown setup flag: ${positionals[0]}`);
|
|
135
|
-
}
|
|
136
|
-
const token = readStringFlag(flags, "token") ?? readStringFlag(flags, "sprite-token");
|
|
137
|
-
const claudeCodeOauthToken = readStringFlag(flags, "claude-code-oauth-token");
|
|
138
|
-
const codexAuth = readStringFlag(flags, "codex-auth");
|
|
139
|
-
const spriteAuth = readStringFlag(flags, "sprite-auth");
|
|
140
|
-
const modalAuth = readStringFlag(flags, "modal-auth");
|
|
141
|
-
const e2bAuth = readStringFlag(flags, "e2b-auth");
|
|
142
|
-
const modalTokenId = readStringFlag(flags, "modal-token-id");
|
|
143
|
-
const modalTokenSecret = readStringFlag(flags, "modal-token-secret");
|
|
144
|
-
const e2bApiKey = readStringFlag(flags, "e2b-api-key");
|
|
145
|
-
const org = readStringFlag(flags, "org");
|
|
146
|
-
const parsed = {
|
|
147
|
-
verify: !readBooleanFlag(flags, "no-verify"),
|
|
148
|
-
...(token ? { token } : {}),
|
|
149
|
-
...(claudeCodeOauthToken ? { claudeCodeOauthToken } : {}),
|
|
150
|
-
...(codexAuth ? { codexAuthMode: parseCodexAuthMode(codexAuth) } : {}),
|
|
151
|
-
...(spriteAuth ? { spriteAuthMode: parseSpriteAuthMode(spriteAuth) } : {}),
|
|
152
|
-
...(modalAuth ? { modalAuthMode: parseModalAuthMode(modalAuth) } : {}),
|
|
153
|
-
...(modalTokenId ? { modalTokenId } : {}),
|
|
154
|
-
...(modalTokenSecret ? { modalTokenSecret } : {}),
|
|
155
|
-
...(org ? { org } : {}),
|
|
156
|
-
...(readBooleanFlag(flags, "no-claude-auth") ? { noClaudeAuth: true } : {}),
|
|
157
|
-
...(readBooleanFlag(flags, "json") ? { json: true } : {}),
|
|
158
|
-
};
|
|
159
|
-
if (parsed.claudeCodeOauthToken && parsed.noClaudeAuth) {
|
|
160
|
-
throw usageError(["setup"], "--claude-code-oauth-token cannot be used with --no-claude-auth.");
|
|
161
|
-
}
|
|
162
|
-
if (parsed.org && !parsed.token) {
|
|
163
|
-
throw usageError(["setup"], "--org requires --token or --sprite-token");
|
|
164
|
-
}
|
|
165
|
-
if (parsed.spriteAuthMode === "default" && parsed.token) {
|
|
166
|
-
throw usageError(["setup"], "--sprite-auth default cannot be used with --token or --sprite-token");
|
|
167
|
-
}
|
|
168
|
-
if (parsed.spriteAuthMode === "byo" && !parsed.token) {
|
|
169
|
-
throw usageError(["setup"], "--sprite-auth byo requires --token or --sprite-token");
|
|
170
|
-
}
|
|
171
|
-
if ((parsed.modalTokenId && !parsed.modalTokenSecret) ||
|
|
172
|
-
(!parsed.modalTokenId && parsed.modalTokenSecret)) {
|
|
173
|
-
throw usageError(["setup"], "--modal-token-id and --modal-token-secret must be provided together.");
|
|
174
|
-
}
|
|
175
|
-
if (parsed.modalAuthMode === "default" &&
|
|
176
|
-
(parsed.modalTokenId || parsed.modalTokenSecret)) {
|
|
177
|
-
throw usageError(["setup"], "--modal-auth default cannot be used with --modal-token-id/--modal-token-secret.");
|
|
178
|
-
}
|
|
179
|
-
if (parsed.modalAuthMode === "byo" &&
|
|
180
|
-
(!parsed.modalTokenId || !parsed.modalTokenSecret)) {
|
|
181
|
-
throw usageError(["setup"], "--modal-auth byo requires --modal-token-id and --modal-token-secret.");
|
|
182
|
-
}
|
|
183
|
-
if (e2bAuth) {
|
|
184
|
-
throw usageError(["setup"], "Managed compute uses the shared boxes.dev account only. Remove --e2b-auth.");
|
|
185
|
-
}
|
|
186
|
-
if (e2bApiKey) {
|
|
187
|
-
throw usageError(["setup"], "Managed compute uses the shared boxes.dev account only. Remove --e2b-api-key.");
|
|
188
|
-
}
|
|
189
|
-
return parsed;
|
|
190
|
-
};
|
|
191
|
-
const splitQrLines = (qr) => qr ? qr.trimEnd().split("\n") : [];
|
|
192
|
-
const printMobileDownloadQr = () => {
|
|
193
|
-
const link = MOBILE_DOWNLOAD_LINK;
|
|
194
|
-
const qrLines = splitQrLines(renderTerminalQr(link.url));
|
|
195
|
-
console.log("");
|
|
196
|
-
console.log(colors.boldWhite("Install the boxes.dev mobile app:"));
|
|
197
|
-
console.log(`${colors.style(link.label, ["bold", "cyan"])}: ${link.url}`);
|
|
198
|
-
for (const line of qrLines) {
|
|
199
|
-
console.log(line);
|
|
200
|
-
}
|
|
201
|
-
console.log("");
|
|
202
|
-
};
|
|
203
|
-
export const resolveDesktopAppInstallPaths = (homeDir = process.env.HOME ?? os.homedir()) => {
|
|
204
|
-
const installedPaths = [DESKTOP_APP_TARGET_PATH];
|
|
205
|
-
const normalizedHomeDir = trim(homeDir);
|
|
206
|
-
if (normalizedHomeDir) {
|
|
207
|
-
installedPaths.push(path.join(normalizedHomeDir, "Applications", DESKTOP_APP_BUNDLE_NAME));
|
|
208
|
-
}
|
|
209
|
-
return installedPaths;
|
|
210
|
-
};
|
|
211
|
-
const pathExists = async (candidate) => {
|
|
212
|
-
try {
|
|
213
|
-
await access(candidate, fsConstants.F_OK);
|
|
214
|
-
return true;
|
|
215
|
-
}
|
|
216
|
-
catch {
|
|
217
|
-
return false;
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
export const findInstalledDesktopAppPath = async ({ homeDir = process.env.HOME ?? os.homedir(), pathExistsFn = pathExists, } = {}) => {
|
|
221
|
-
for (const candidate of resolveDesktopAppInstallPaths(homeDir)) {
|
|
222
|
-
if (await pathExistsFn(candidate))
|
|
223
|
-
return candidate;
|
|
224
|
-
}
|
|
225
|
-
return null;
|
|
226
|
-
};
|
|
227
|
-
export const shouldOfferDesktopAppInstall = ({ platform = process.platform, stdinIsTTY = Boolean(process.stdin.isTTY), stdoutIsTTY = Boolean(process.stdout.isTTY), installedAppPath, }) => platform === "darwin" &&
|
|
228
|
-
stdinIsTTY &&
|
|
229
|
-
stdoutIsTTY &&
|
|
230
|
-
installedAppPath === null;
|
|
231
|
-
const shellEscape = (value) => `'${value.replace(/'/g, `'\\''`)}'`;
|
|
232
|
-
const appleScriptEscape = (value) => value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
233
|
-
const formatCommandFailure = ({ command, args, code, stderr, }) => {
|
|
234
|
-
const detail = trim(stderr);
|
|
235
|
-
if (detail) {
|
|
236
|
-
return `${command} ${args.join(" ")} failed: ${detail}`;
|
|
237
|
-
}
|
|
238
|
-
return `${command} exited with code ${code ?? "unknown"}.`;
|
|
239
|
-
};
|
|
240
|
-
const runCommand = async (command, args) => await new Promise((resolve, reject) => {
|
|
241
|
-
const child = spawn(command, args, {
|
|
242
|
-
stdio: ["ignore", "ignore", "pipe"],
|
|
243
|
-
});
|
|
244
|
-
let stderr = "";
|
|
245
|
-
child.stderr?.on("data", (chunk) => {
|
|
246
|
-
stderr += chunk.toString();
|
|
247
|
-
});
|
|
248
|
-
child.on("error", (error) => reject(error));
|
|
249
|
-
child.on("close", (code) => {
|
|
250
|
-
if (code === 0) {
|
|
251
|
-
resolve();
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
reject(new Error(formatCommandFailure({ command, args, code, stderr })));
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
const downloadFile = async ({ url, destinationPath, }) => {
|
|
258
|
-
const response = await fetch(url);
|
|
259
|
-
if (!response.ok) {
|
|
260
|
-
throw new Error(`Download failed with HTTP ${response.status}.`);
|
|
261
|
-
}
|
|
262
|
-
if (!response.body) {
|
|
263
|
-
throw new Error("Download failed: empty response body.");
|
|
264
|
-
}
|
|
265
|
-
await pipeline(Readable.fromWeb(response.body), createWriteStream(destinationPath));
|
|
266
|
-
};
|
|
267
|
-
const attachDmg = async ({ dmgPath, mountPath, }) => {
|
|
268
|
-
await mkdir(mountPath, { recursive: true });
|
|
269
|
-
await runCommand("/usr/bin/hdiutil", [
|
|
270
|
-
"attach",
|
|
271
|
-
"-nobrowse",
|
|
272
|
-
"-quiet",
|
|
273
|
-
"-mountpoint",
|
|
274
|
-
mountPath,
|
|
275
|
-
dmgPath,
|
|
276
|
-
]);
|
|
277
|
-
};
|
|
278
|
-
const detachDmg = async (mountPath) => {
|
|
279
|
-
await runCommand("/usr/bin/hdiutil", ["detach", mountPath, "-quiet"]);
|
|
280
|
-
};
|
|
281
|
-
const isWritable = async (candidate) => {
|
|
282
|
-
try {
|
|
283
|
-
await access(candidate, fsConstants.W_OK);
|
|
284
|
-
return true;
|
|
285
|
-
}
|
|
286
|
-
catch {
|
|
287
|
-
return false;
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
const buildInstallScript = ({ sourceAppPath, targetAppPath, }) => [
|
|
291
|
-
"set -eu",
|
|
292
|
-
`/bin/rm -rf ${shellEscape(targetAppPath)}`,
|
|
293
|
-
`/usr/bin/ditto ${shellEscape(sourceAppPath)} ${shellEscape(targetAppPath)}`,
|
|
294
|
-
].join(" && ");
|
|
295
|
-
const installDesktopAppToApplications = async ({ sourceAppPath, targetAppPath, }) => {
|
|
296
|
-
const installScript = buildInstallScript({ sourceAppPath, targetAppPath });
|
|
297
|
-
if (await isWritable(path.dirname(targetAppPath))) {
|
|
298
|
-
await runCommand("/bin/sh", ["-c", installScript]);
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
await runCommand("/usr/bin/osascript", [
|
|
302
|
-
"-e",
|
|
303
|
-
`do shell script "${appleScriptEscape(installScript)}" with administrator privileges`,
|
|
304
|
-
]);
|
|
305
|
-
};
|
|
306
|
-
const printDesktopDownloadOffer = () => {
|
|
307
|
-
console.log(colors.boldWhite("Install the boxes.dev desktop app for macOS:"));
|
|
308
|
-
console.log(`${colors.style(MAC_DESKTOP_DOWNLOAD_LINK.label, ["bold", "cyan"])}: ${MAC_DESKTOP_DOWNLOAD_LINK.url}`);
|
|
309
|
-
};
|
|
310
|
-
export const firstSetupCompleteMessage = {
|
|
311
|
-
heading: "boxes.dev setup complete!",
|
|
312
|
-
nextStep: "Next step: from your project's git repo, run `dvb init`.",
|
|
313
|
-
exampleLabel: "Example:",
|
|
314
|
-
exampleCommands: [" cd /path/to/repo", " dvb init"],
|
|
315
|
-
};
|
|
316
|
-
export const desktopAppInstallPrompt = {
|
|
317
|
-
message: `Download and install ${DESKTOP_APP_BUNDLE_NAME} to /Applications now?`,
|
|
318
|
-
options: [
|
|
319
|
-
{ value: "install", label: "Install desktop app (Recommended)" },
|
|
320
|
-
{ value: "skip", label: "Skip for now" },
|
|
321
|
-
],
|
|
322
|
-
initialValue: "install",
|
|
323
|
-
};
|
|
324
|
-
const maybeOfferDesktopAppInstall = async () => {
|
|
325
|
-
const installedAppPath = await findInstalledDesktopAppPath();
|
|
326
|
-
if (!shouldOfferDesktopAppInstall({ installedAppPath }))
|
|
327
|
-
return;
|
|
328
|
-
printDesktopDownloadOffer();
|
|
329
|
-
const decision = await clackSelect(desktopAppInstallPrompt);
|
|
330
|
-
if (isCancel(decision) || decision === "skip") {
|
|
331
|
-
console.log("");
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
const spinner = clackSpinner();
|
|
335
|
-
let tempDir = null;
|
|
336
|
-
let mounted = false;
|
|
337
|
-
let spinnerStarted = false;
|
|
338
|
-
const mountPath = () => path.join(tempDir ?? "", "mount");
|
|
339
|
-
try {
|
|
340
|
-
tempDir = await mkdtemp(path.join(os.tmpdir(), "devbox-desktop-app-"));
|
|
341
|
-
const dmgPath = path.join(tempDir, "Boxes.dev.dmg");
|
|
342
|
-
logger.info("setup_desktop_install_start", {
|
|
343
|
-
url: MAC_DESKTOP_DOWNLOAD_LINK.url,
|
|
344
|
-
targetPath: DESKTOP_APP_TARGET_PATH,
|
|
345
|
-
});
|
|
346
|
-
spinner.start("Downloading Boxes.dev desktop app");
|
|
347
|
-
spinnerStarted = true;
|
|
348
|
-
await downloadFile({
|
|
349
|
-
url: MAC_DESKTOP_DOWNLOAD_LINK.url,
|
|
350
|
-
destinationPath: dmgPath,
|
|
351
|
-
});
|
|
352
|
-
spinner.message("Mounting Boxes.dev installer");
|
|
353
|
-
await attachDmg({ dmgPath, mountPath: mountPath() });
|
|
354
|
-
mounted = true;
|
|
355
|
-
const sourceAppPath = path.join(mountPath(), DESKTOP_APP_BUNDLE_NAME);
|
|
356
|
-
if (!(await pathExists(sourceAppPath))) {
|
|
357
|
-
throw new Error(`Mounted installer did not contain ${DESKTOP_APP_BUNDLE_NAME}.`);
|
|
358
|
-
}
|
|
359
|
-
spinner.message(`Installing ${DESKTOP_APP_BUNDLE_NAME} to /Applications`);
|
|
360
|
-
await installDesktopAppToApplications({
|
|
361
|
-
sourceAppPath,
|
|
362
|
-
targetAppPath: DESKTOP_APP_TARGET_PATH,
|
|
363
|
-
});
|
|
364
|
-
spinner.stop(`Installed ${DESKTOP_APP_BUNDLE_NAME} to ${DESKTOP_APP_TARGET_PATH}.`);
|
|
365
|
-
console.log(`Run it with: open "${DESKTOP_APP_TARGET_PATH}"`);
|
|
366
|
-
console.log("");
|
|
367
|
-
logger.info("setup_desktop_install_complete", {
|
|
368
|
-
targetPath: DESKTOP_APP_TARGET_PATH,
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
catch (error) {
|
|
372
|
-
if (spinnerStarted) {
|
|
373
|
-
spinner.stop("Desktop install failed.");
|
|
374
|
-
}
|
|
375
|
-
const detail = error instanceof Error && error.message.trim().length > 0
|
|
376
|
-
? error.message.trim()
|
|
377
|
-
: String(error);
|
|
378
|
-
logger.warn("setup_desktop_install_failed", { error: detail });
|
|
379
|
-
console.error(`Failed to install ${DESKTOP_APP_BUNDLE_NAME} automatically: ${detail}`);
|
|
380
|
-
console.error(`Download it manually: ${MAC_DESKTOP_DOWNLOAD_LINK.url}`);
|
|
381
|
-
console.log("");
|
|
382
|
-
}
|
|
383
|
-
finally {
|
|
384
|
-
if (mounted && tempDir) {
|
|
385
|
-
await detachDmg(mountPath()).catch((error) => {
|
|
386
|
-
logger.warn("setup_desktop_install_detach_failed", {
|
|
387
|
-
mountPath: mountPath(),
|
|
388
|
-
error: String(error),
|
|
389
|
-
});
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
if (tempDir) {
|
|
393
|
-
await rm(tempDir, { recursive: true, force: true }).catch((error) => {
|
|
394
|
-
logger.warn("setup_desktop_install_cleanup_failed", {
|
|
395
|
-
tempDir,
|
|
396
|
-
error: String(error),
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
const printFirstSetupCompleteMessage = () => {
|
|
403
|
-
const isTty = process.stdout.isTTY;
|
|
404
|
-
const heading = isTty
|
|
405
|
-
? `${colors.style("boxes.dev", ["bold", "cyan"])} ${colors.style("setup complete!", ["bold", "green"])}`
|
|
406
|
-
: firstSetupCompleteMessage.heading;
|
|
407
|
-
const nextStep = isTty
|
|
408
|
-
? `Next step: from your project's git repo, run ${colors.style("`dvb init`", ["bold", "cyan"])}.`
|
|
409
|
-
: firstSetupCompleteMessage.nextStep;
|
|
410
|
-
console.log("");
|
|
411
|
-
console.log(heading);
|
|
412
|
-
console.log("");
|
|
413
|
-
console.log(nextStep);
|
|
414
|
-
console.log("");
|
|
415
|
-
console.log(firstSetupCompleteMessage.exampleLabel);
|
|
416
|
-
for (const line of firstSetupCompleteMessage.exampleCommands) {
|
|
417
|
-
console.log(line);
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
const normalizeUrlForCompare = (value) => {
|
|
421
|
-
const trimmed = value.trim();
|
|
422
|
-
if (!trimmed)
|
|
423
|
-
return "";
|
|
424
|
-
try {
|
|
425
|
-
const parsed = new URL(trimmed);
|
|
426
|
-
const pathname = parsed.pathname.replace(/\/+$/, "");
|
|
427
|
-
return `${parsed.protocol}//${parsed.host}${pathname}`;
|
|
428
|
-
}
|
|
429
|
-
catch {
|
|
430
|
-
return trimmed.replace(/\/+$/, "");
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
const resolveHostForCompare = (value) => {
|
|
434
|
-
const trimmed = value.trim();
|
|
435
|
-
if (!trimmed)
|
|
436
|
-
return "";
|
|
437
|
-
try {
|
|
438
|
-
const url = new URL(trimmed);
|
|
439
|
-
return url.host.toLowerCase();
|
|
440
|
-
}
|
|
441
|
-
catch {
|
|
442
|
-
return "";
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
const resolveCliName = () => {
|
|
446
|
-
const raw = process.env.DEVBOX_CLI_NAME?.trim();
|
|
447
|
-
if (!raw)
|
|
448
|
-
return "dvb";
|
|
449
|
-
return raw.length > 0 ? raw : "dvb";
|
|
450
|
-
};
|
|
451
|
-
export const formatSpritesApiError = ({ status, requestUrl, relayBaseUrl, responseBody, }) => {
|
|
452
|
-
const requestHost = resolveHostForCompare(requestUrl);
|
|
453
|
-
const relayHost = resolveHostForCompare(relayBaseUrl);
|
|
454
|
-
const viaRelay = requestHost.length > 0 && requestHost === relayHost;
|
|
455
|
-
const lines = [
|
|
456
|
-
viaRelay ? `Relay proxy error: ${status}` : `Runtime API error: ${status}`,
|
|
457
|
-
`request: GET ${requestUrl}`,
|
|
458
|
-
];
|
|
459
|
-
const detail = responseBody?.trim();
|
|
460
|
-
if (detail) {
|
|
461
|
-
lines.push(`response: ${detail.slice(0, 200)}`);
|
|
462
|
-
}
|
|
463
|
-
if (status === 403 && viaRelay) {
|
|
464
|
-
lines.push("Hint: relay auth failed before reaching Sprites upstream. Refresh control-plane auth by running `dvb setup` in a TTY.");
|
|
465
|
-
}
|
|
466
|
-
const isDevProfile = resolveDevboxProfile() === "dev";
|
|
467
|
-
const usingDefaultRelay = normalizeUrlForCompare(relayBaseUrl) ===
|
|
468
|
-
normalizeUrlForCompare(DEFAULT_RELAY_BASE_URL);
|
|
469
|
-
if (status === 403 && isDevProfile && usingDefaultRelay) {
|
|
470
|
-
lines.push("Hint: the dev CLI is usually expected to talk to a local relay, not https://relay.boxes.dev.");
|
|
471
|
-
const controlPlaneUrl = getControlPlaneUrl();
|
|
472
|
-
if (controlPlaneUrl) {
|
|
473
|
-
lines.push(`control plane: ${controlPlaneUrl}`);
|
|
474
|
-
}
|
|
475
|
-
const cliName = resolveCliName();
|
|
476
|
-
lines.push(`Start it with \`just dev\`, rebuild \`${cliName}\` with \`DEVBOX_RELAY_BASE_URL=http://127.0.0.1:8787 just cli build\`, then rerun setup.`);
|
|
477
|
-
}
|
|
478
|
-
return lines.join("\n");
|
|
479
|
-
};
|
|
480
|
-
const probeSpritesAccess = async (relayBaseUrl, token) => {
|
|
481
|
-
const requestId = randomUUID();
|
|
482
|
-
const url = new URL("/v1/sprites", relayBaseUrl);
|
|
483
|
-
url.searchParams.set("max_results", "1");
|
|
484
|
-
logger.info("sprites_request", {
|
|
485
|
-
requestId,
|
|
486
|
-
path: url.pathname,
|
|
487
|
-
method: "GET",
|
|
488
|
-
});
|
|
489
|
-
const headers = {
|
|
490
|
-
authorization: `Bearer ${token}`,
|
|
491
|
-
};
|
|
492
|
-
addDevboxClientVersionHeader(headers);
|
|
493
|
-
const response = await fetch(url, {
|
|
494
|
-
headers,
|
|
495
|
-
});
|
|
496
|
-
logger.info("sprites_response", {
|
|
497
|
-
requestId,
|
|
498
|
-
path: url.pathname,
|
|
499
|
-
status: response.status,
|
|
500
|
-
});
|
|
501
|
-
if (!response.ok) {
|
|
502
|
-
const errorBody = await response.text().catch(() => "");
|
|
503
|
-
const upgradeRequired = parseUpgradeRequiredResponseBody(errorBody, {
|
|
504
|
-
source: "relay",
|
|
505
|
-
statusCode: response.status,
|
|
506
|
-
});
|
|
507
|
-
if (upgradeRequired) {
|
|
508
|
-
throw upgradeRequired;
|
|
509
|
-
}
|
|
510
|
-
throw new Error(formatSpritesApiError({
|
|
511
|
-
status: response.status,
|
|
512
|
-
requestUrl: url.toString(),
|
|
513
|
-
relayBaseUrl,
|
|
514
|
-
responseBody: errorBody,
|
|
515
|
-
}));
|
|
516
|
-
}
|
|
517
|
-
const payload = (await response.json());
|
|
518
|
-
const orgs = new Set();
|
|
519
|
-
for (const sprite of payload.sprites ?? []) {
|
|
520
|
-
const org = normalizeOrgSlug(sprite.org_slug ?? sprite.organization ?? "");
|
|
521
|
-
if (org)
|
|
522
|
-
orgs.add(org);
|
|
523
|
-
}
|
|
524
|
-
return { orgs: [...orgs] };
|
|
525
|
-
};
|
|
526
|
-
export const runSetup = async (args) => {
|
|
527
|
-
const parsed = parseSetupArgs(args);
|
|
528
|
-
const canPromptInteractively = process.stdin.isTTY && process.stdout.isTTY && !parsed.json;
|
|
529
|
-
const statusEnabled = process.stderr.isTTY && !parsed.json;
|
|
530
|
-
const status = createStatusLine({ enabled: statusEnabled });
|
|
531
|
-
const run = async () => {
|
|
532
|
-
const homeDir = process.env.HOME;
|
|
533
|
-
status.stage("Checking local tooling");
|
|
534
|
-
await ensureCodexCliForSetup({
|
|
535
|
-
canPrompt: canPromptInteractively,
|
|
536
|
-
onPromptStart: () => {
|
|
537
|
-
status.stop();
|
|
538
|
-
},
|
|
539
|
-
});
|
|
540
|
-
const localClaudeCli = await probeLocalCli("claude");
|
|
541
|
-
status.stage("Loading devbox config");
|
|
542
|
-
const configOptions = homeDir ? { homeDir } : undefined;
|
|
543
|
-
const existingConfig = await loadConfig(configOptions);
|
|
544
|
-
const isFirstSetup = existingConfig === null;
|
|
545
|
-
const storeOptions = homeDir ? { homeDir } : undefined;
|
|
546
|
-
const store = await createSecretStore(undefined, storeOptions);
|
|
547
|
-
const relayBaseUrl = resolveRelayBaseUrl(existingConfig);
|
|
548
|
-
const didProvideModalTokenPair = Boolean(parsed.modalTokenId && parsed.modalTokenSecret);
|
|
549
|
-
const didUpdateModalAuthMode = parsed.modalAuthMode !== undefined || didProvideModalTokenPair;
|
|
550
|
-
const didProvideClaudeCodeOauthToken = Boolean(parsed.claudeCodeOauthToken);
|
|
551
|
-
const shouldOfferInteractiveClaudeSetup = canPromptInteractively &&
|
|
552
|
-
!parsed.noClaudeAuth &&
|
|
553
|
-
localClaudeCli.available;
|
|
554
|
-
const requireControlPlaneToken = parsed.spriteAuthMode ||
|
|
555
|
-
didUpdateModalAuthMode ||
|
|
556
|
-
didProvideClaudeCodeOauthToken ||
|
|
557
|
-
shouldOfferInteractiveClaudeSetup
|
|
558
|
-
? true
|
|
559
|
-
: parsed.verify;
|
|
560
|
-
const authStage = (message) => {
|
|
561
|
-
if (message === CONTROL_PLANE_INTERACTIVE_SIGNIN_STAGE) {
|
|
562
|
-
// Pause the generic status spinner while clack renders the
|
|
563
|
-
// interactive browser-login flow.
|
|
564
|
-
status.stop();
|
|
565
|
-
return;
|
|
566
|
-
}
|
|
567
|
-
status.stage(message);
|
|
568
|
-
};
|
|
569
|
-
const tokenResult = await ensureSpritesToken(store, authStage, parsed.token
|
|
570
|
-
? {
|
|
571
|
-
tokenOverride: parsed.token,
|
|
572
|
-
requireControlPlaneToken,
|
|
573
|
-
}
|
|
574
|
-
: undefined);
|
|
575
|
-
const token = tokenResult.token;
|
|
576
|
-
const tokenSource = tokenResult.source;
|
|
577
|
-
const controlPlaneToken = tokenResult.controlPlaneToken;
|
|
578
|
-
const remoteRelayBaseUrl = resolveRemoteRelayBaseUrl(existingConfig);
|
|
579
|
-
const codexAuthMode = parsed.codexAuthMode ?? resolveCodexAuthMode(existingConfig);
|
|
580
|
-
const didUpdateSpriteAuthMode = parsed.spriteAuthMode !== undefined;
|
|
581
|
-
if (parsed.spriteAuthMode === "default") {
|
|
582
|
-
if (!controlPlaneToken) {
|
|
583
|
-
throw new Error("Missing control plane session. Run `dvb setup` in a TTY first.");
|
|
584
|
-
}
|
|
585
|
-
status.stage("Updating sprite auth mode");
|
|
586
|
-
await clearSpriteToken(controlPlaneToken);
|
|
587
|
-
}
|
|
588
|
-
if (parsed.spriteAuthMode === "byo") {
|
|
589
|
-
if (!controlPlaneToken || !parsed.token) {
|
|
590
|
-
throw new Error("Missing control plane session. Run `dvb setup` in a TTY first.");
|
|
591
|
-
}
|
|
592
|
-
status.stage("Updating sprite auth mode");
|
|
593
|
-
await storeSpriteToken(controlPlaneToken, parsed.token);
|
|
594
|
-
}
|
|
595
|
-
if (parsed.modalAuthMode === "default") {
|
|
596
|
-
if (!controlPlaneToken) {
|
|
597
|
-
throw new Error("Missing control plane session. Run `dvb setup` in a TTY first.");
|
|
598
|
-
}
|
|
599
|
-
status.stage("Updating modal auth mode");
|
|
600
|
-
await clearModalCredentials(controlPlaneToken);
|
|
601
|
-
}
|
|
602
|
-
const shouldStoreModalCredentials = parsed.modalAuthMode === "byo" ||
|
|
603
|
-
(parsed.modalAuthMode === undefined && didProvideModalTokenPair);
|
|
604
|
-
if (shouldStoreModalCredentials) {
|
|
605
|
-
if (!controlPlaneToken ||
|
|
606
|
-
!parsed.modalTokenId ||
|
|
607
|
-
!parsed.modalTokenSecret) {
|
|
608
|
-
throw new Error("Missing control plane session. Run `dvb setup` in a TTY first.");
|
|
609
|
-
}
|
|
610
|
-
status.stage("Updating modal auth mode");
|
|
611
|
-
await storeModalCredentials(controlPlaneToken, parsed.modalTokenId, parsed.modalTokenSecret);
|
|
612
|
-
}
|
|
613
|
-
let spriteAuthMode;
|
|
614
|
-
if (controlPlaneToken) {
|
|
615
|
-
status.stage("Checking sprite auth mode");
|
|
616
|
-
try {
|
|
617
|
-
const tokenStatus = await fetchSpriteTokenStatus(controlPlaneToken);
|
|
618
|
-
spriteAuthMode = resolveSpriteAuthMode(tokenStatus.tokenSource);
|
|
619
|
-
}
|
|
620
|
-
catch (error) {
|
|
621
|
-
logger.warn("sprite_token_status_failed", { error: String(error) });
|
|
622
|
-
spriteAuthMode =
|
|
623
|
-
parsed.spriteAuthMode ?? (tokenSource === "flag" ? "byo" : "default");
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
else {
|
|
627
|
-
spriteAuthMode = tokenSource === "flag" ? "byo" : "default";
|
|
628
|
-
}
|
|
629
|
-
let modalAuthMode = "default";
|
|
630
|
-
if (controlPlaneToken) {
|
|
631
|
-
status.stage("Checking modal auth mode");
|
|
632
|
-
try {
|
|
633
|
-
const modalCredentialStatus = await fetchResolvedModalCredentials(controlPlaneToken);
|
|
634
|
-
modalAuthMode = resolveModalAuthMode(modalCredentialStatus.source);
|
|
635
|
-
}
|
|
636
|
-
catch (error) {
|
|
637
|
-
logger.warn("modal_credential_status_failed", { error: String(error) });
|
|
638
|
-
modalAuthMode = shouldStoreModalCredentials ? "byo" : "default";
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
modalAuthMode = shouldStoreModalCredentials ? "byo" : "default";
|
|
643
|
-
}
|
|
644
|
-
let e2bAuthMode = "shared";
|
|
645
|
-
if (controlPlaneToken) {
|
|
646
|
-
status.stage("Checking managed auth mode");
|
|
647
|
-
try {
|
|
648
|
-
const e2bCredentialStatus = await fetchResolvedE2bCredentials(controlPlaneToken);
|
|
649
|
-
e2bAuthMode = resolveE2bAuthMode(e2bCredentialStatus.source);
|
|
650
|
-
}
|
|
651
|
-
catch (error) {
|
|
652
|
-
logger.warn("e2b_credential_status_failed", { error: String(error) });
|
|
653
|
-
e2bAuthMode = "shared";
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
let claudeTokenStatus = {
|
|
657
|
-
hasToken: false,
|
|
658
|
-
expiresAt: null,
|
|
659
|
-
updatedAt: null,
|
|
660
|
-
lastValidatedAt: null,
|
|
661
|
-
lastRuntimeAuthFailureAt: null,
|
|
662
|
-
lastRuntimeAuthFailureReason: null,
|
|
663
|
-
};
|
|
664
|
-
let claudeAuthState = parsed.noClaudeAuth
|
|
665
|
-
? "skipped"
|
|
666
|
-
: controlPlaneToken
|
|
667
|
-
? "missing"
|
|
668
|
-
: "unknown";
|
|
669
|
-
let didUpdateClaudeAuth = false;
|
|
670
|
-
if (!parsed.noClaudeAuth && controlPlaneToken) {
|
|
671
|
-
status.stage("Checking Claude auth");
|
|
672
|
-
try {
|
|
673
|
-
claudeTokenStatus = await fetchClaudeTokenStatus(controlPlaneToken);
|
|
674
|
-
}
|
|
675
|
-
catch (error) {
|
|
676
|
-
logger.warn("claude_token_status_failed", { error: String(error) });
|
|
677
|
-
}
|
|
678
|
-
claudeAuthState = resolveClaudeSetupState({
|
|
679
|
-
hasToken: claudeTokenStatus.hasToken,
|
|
680
|
-
expiresAt: claudeTokenStatus.expiresAt,
|
|
681
|
-
});
|
|
682
|
-
const storeClaudeToken = async (claudeCodeOauthToken) => {
|
|
683
|
-
status.stage("Updating Claude auth");
|
|
684
|
-
await storeClaudeCodeOauthToken(controlPlaneToken, claudeCodeOauthToken);
|
|
685
|
-
didUpdateClaudeAuth = true;
|
|
686
|
-
status.stage("Checking Claude auth");
|
|
687
|
-
claudeTokenStatus = await fetchClaudeTokenStatus(controlPlaneToken);
|
|
688
|
-
claudeAuthState = resolveClaudeSetupState({
|
|
689
|
-
hasToken: claudeTokenStatus.hasToken,
|
|
690
|
-
expiresAt: claudeTokenStatus.expiresAt,
|
|
691
|
-
});
|
|
692
|
-
};
|
|
693
|
-
if (parsed.claudeCodeOauthToken) {
|
|
694
|
-
await storeClaudeToken(parsed.claudeCodeOauthToken);
|
|
695
|
-
}
|
|
696
|
-
else if (shouldOfferInteractiveClaudeSetup &&
|
|
697
|
-
(claudeAuthState === "missing" ||
|
|
698
|
-
claudeAuthState === "renewal_recommended" ||
|
|
699
|
-
claudeAuthState === "expired")) {
|
|
700
|
-
status.stop();
|
|
701
|
-
const collectedToken = await collectClaudeCodeOauthTokenInteractively({
|
|
702
|
-
state: claudeAuthState,
|
|
703
|
-
});
|
|
704
|
-
if (collectedToken) {
|
|
705
|
-
await storeClaudeToken(collectedToken);
|
|
706
|
-
}
|
|
707
|
-
else {
|
|
708
|
-
claudeAuthState = "skipped";
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
else if (didProvideClaudeCodeOauthToken && !controlPlaneToken) {
|
|
713
|
-
throw new Error("Missing control plane session. Run `dvb setup` in a TTY first before storing Claude auth.");
|
|
714
|
-
}
|
|
715
|
-
let org = tokenSource === "flag" ? (parsed.org ?? existingConfig?.org) : undefined;
|
|
716
|
-
if (!org && tokenSource === "flag" && parsed.token) {
|
|
717
|
-
org = extractOrgFromSpriteToken(parsed.token);
|
|
718
|
-
}
|
|
719
|
-
if (parsed.verify) {
|
|
720
|
-
status.stage("Verifying token");
|
|
721
|
-
const { orgs } = await probeSpritesAccess(relayBaseUrl, token);
|
|
722
|
-
if (tokenSource === "flag") {
|
|
723
|
-
if (!org && orgs.length > 0) {
|
|
724
|
-
org = orgs[0];
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
status.stage("Saving config");
|
|
729
|
-
const config = {
|
|
730
|
-
version: 1,
|
|
731
|
-
codexAuthMode,
|
|
732
|
-
relayBaseUrl,
|
|
733
|
-
remoteRelayBaseUrl,
|
|
734
|
-
tokenStore: store.kind,
|
|
735
|
-
tokenUpdatedAt: new Date().toISOString(),
|
|
736
|
-
lastSetupAt: new Date().toISOString(),
|
|
737
|
-
...(tokenSource === "flag" && org ? { org } : {}),
|
|
738
|
-
};
|
|
739
|
-
await saveConfig(config, configOptions);
|
|
740
|
-
status.stage("Starting dvbd");
|
|
741
|
-
const socketInfo = resolveSocketInfo();
|
|
742
|
-
// Setup can change the control-plane session. Restart dvbd so it doesn't
|
|
743
|
-
// keep running with a stale auth token.
|
|
744
|
-
await stopDaemon(socketInfo.socketPath);
|
|
745
|
-
const daemon = await ensureDaemonRunning(socketInfo.socketPath);
|
|
746
|
-
status.stop();
|
|
747
|
-
if (parsed.json) {
|
|
748
|
-
const payload = {
|
|
749
|
-
config,
|
|
750
|
-
configPath: resolveConfigPath(homeDir),
|
|
751
|
-
devboxDir: resolveDevboxDir(homeDir),
|
|
752
|
-
secretsPath: resolveSecretsPath(homeDir),
|
|
753
|
-
tokenStore: store.kind,
|
|
754
|
-
tokenSource,
|
|
755
|
-
spriteAuthMode,
|
|
756
|
-
modalAuthMode,
|
|
757
|
-
e2bAuthMode,
|
|
758
|
-
claudeAuthState,
|
|
759
|
-
claudeTokenExpiresAt: claudeTokenStatus.expiresAt,
|
|
760
|
-
claudeTokenUpdatedAt: claudeTokenStatus.updatedAt,
|
|
761
|
-
claudeLastRuntimeAuthFailureAt: claudeTokenStatus.lastRuntimeAuthFailureAt,
|
|
762
|
-
claudeLastRuntimeAuthFailureReason: claudeTokenStatus.lastRuntimeAuthFailureReason,
|
|
763
|
-
daemon,
|
|
764
|
-
};
|
|
765
|
-
console.log(JSON.stringify(payload, null, 2));
|
|
766
|
-
return;
|
|
767
|
-
}
|
|
768
|
-
const claudeNeedsAttention = claudeAuthState === "missing" ||
|
|
769
|
-
claudeAuthState === "renewal_recommended" ||
|
|
770
|
-
claudeAuthState === "expired";
|
|
771
|
-
if (existingConfig &&
|
|
772
|
-
tokenSource === "control_plane" &&
|
|
773
|
-
!didUpdateSpriteAuthMode &&
|
|
774
|
-
!didUpdateModalAuthMode &&
|
|
775
|
-
!didUpdateClaudeAuth &&
|
|
776
|
-
!claudeNeedsAttention) {
|
|
777
|
-
console.log("dvb already set up");
|
|
778
|
-
}
|
|
779
|
-
else {
|
|
780
|
-
console.log("dvb setup complete");
|
|
781
|
-
}
|
|
782
|
-
console.log(`config: ${resolveConfigPath(homeDir)}`);
|
|
783
|
-
console.log(`secrets: ${resolveSecretsPath(homeDir)}`);
|
|
784
|
-
if (tokenSource === "flag" && org) {
|
|
785
|
-
console.log(`org: ${org}`);
|
|
786
|
-
}
|
|
787
|
-
console.log(`codex auth mode: ${codexAuthMode}`);
|
|
788
|
-
console.log(`sprite auth mode: ${spriteAuthMode}`);
|
|
789
|
-
console.log(`modal auth mode: ${modalAuthMode}`);
|
|
790
|
-
console.log(`managed auth mode: ${e2bAuthMode}`);
|
|
791
|
-
console.log(`claude auth: ${formatClaudeSetupState(claudeAuthState, claudeTokenStatus)}`);
|
|
792
|
-
console.log(`token store: ${store.kind}`);
|
|
793
|
-
console.log(`token source: ${tokenSource}`);
|
|
794
|
-
console.log(`daemon: pid ${daemon.pid}`);
|
|
795
|
-
console.log(`socket: ${daemon.socketPath}`);
|
|
796
|
-
if (process.stdout.isTTY) {
|
|
797
|
-
printMobileDownloadQr();
|
|
798
|
-
}
|
|
799
|
-
await maybeOfferDesktopAppInstall();
|
|
800
|
-
await maybeOfferCompletionsInstall();
|
|
801
|
-
if (isFirstSetup) {
|
|
802
|
-
printFirstSetupCompleteMessage();
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
try {
|
|
806
|
-
await run();
|
|
807
|
-
}
|
|
808
|
-
catch (error) {
|
|
809
|
-
status.fail("Setup failed");
|
|
810
|
-
throw error;
|
|
811
|
-
}
|
|
812
|
-
finally {
|
|
813
|
-
status.stop();
|
|
814
|
-
}
|
|
815
|
-
};
|
|
816
|
-
//# sourceMappingURL=setup.js.map
|