@boxes-dev/dvb-runtime 1.0.1054 → 1.0.1055

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.
@@ -175,8 +175,10 @@ re-confirm with the user.
175
175
 
176
176
  ## Phase 6: Wrap up
177
177
 
178
- When `run` completes, tell the user their Template box is ready, using the
179
- options it prints. If any imported MCP servers need re-authentication, the
180
- remote setup notes them — the user completes those from the desktop app.
178
+ When `run` completes on a Mac with the boxes.dev app installed, it opens the
179
+ app on the setup thread, where the user can read the setup agent's summary.
180
+ Tell the user their Template box is ready, using the text it prints. If any
181
+ imported MCP servers need re-authentication, the remote setup notes them — the
182
+ user completes those from the desktop app.
181
183
 
182
184
  If anything fails, see `guide recovery` — setup is resumable at every stage.
package/dist/bin/dvb.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9c41cadc-e81c-5aa4-9937-e5ea56beec3a")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7953d21a-e340-5f5c-923a-10cac5e75ade")}catch(e){}}();
4
4
  import { createRequire as __dvbCreateRequire } from "node:module";
5
5
  import { dirname as __dvbDirname } from "node:path";
6
6
  import { fileURLToPath as __dvbFileURLToPath } from "node:url";
@@ -69702,9 +69702,9 @@ var init_sentry = __esm({
69702
69702
  uncaughtExceptionMonitorInstalled = false;
69703
69703
  currentDevboxSentryUser = null;
69704
69704
  readBuildMetadata = () => {
69705
- const rawPackageVersion = "1.0.1054";
69706
- const rawGitSha = "4a244bb28514548cb1ff7c63ae7ddd26e23079ad";
69707
- const rawSentryRelease = "boxes-dev-dvb@1.0.1054+4a244bb28514548cb1ff7c63ae7ddd26e23079ad";
69705
+ const rawPackageVersion = "1.0.1055";
69706
+ const rawGitSha = "f79c13a9c9d8ec1a57505f400122d23ec18b0a9c";
69707
+ const rawSentryRelease = "boxes-dev-dvb@1.0.1055+f79c13a9c9d8ec1a57505f400122d23ec18b0a9c";
69708
69708
  const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
69709
69709
  const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
69710
69710
  const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
@@ -75081,7 +75081,7 @@ var init_packageVersion = __esm({
75081
75081
  return path18.join(process.cwd(), "dvb");
75082
75082
  };
75083
75083
  readEmbeddedPackageVersion = () => {
75084
- const raw = "1.0.1054";
75084
+ const raw = "1.0.1055";
75085
75085
  return trimVersion(raw);
75086
75086
  };
75087
75087
  readNearestPackageMetadata = (basePath) => {
@@ -90093,7 +90093,7 @@ var init_index_node2 = __esm({
90093
90093
  // src/devbox/controlPlane.ts
90094
90094
  import http7 from "node:http";
90095
90095
  import { randomUUID as randomUUID5 } from "node:crypto";
90096
- var MANAGED_DAEMON_NOT_READY_CODE, CONVEX_INFLIGHT_ACTION_DISCONNECTED_MESSAGE, CONTROL_PLANE_ACTION_RETRY_MAX_ATTEMPTS, CONTROL_PLANE_ACTION_RETRY_BASE_DELAY_MS, MANAGED_DAEMON_RECOVERY_WAKING_TIMEOUT_MS, CONTROL_PLANE_CHECKPOINT_RECOVERY_MAX_ATTEMPTS, CONTROL_PLANE_CHECKPOINT_RECOVERY_POLL_MS, ManagedDaemonNotReadyError, isManagedDaemonNotReadyError, isManagedDaemonSleepingError, sleep2, isRetryableTransientConvexActionError, buildTransientConvexActionRetryMessage, announceTransientConvexActionRetry, retryTransientConvexAction, normalizeStringRecord, E2B_DEVBOX_ALIAS_EXISTS_CODE, isRecord3, maybeMapE2bProvisionControlPlaneError, mapE2bProvisionControlPlaneError, LOGIN_CODE_REJECTIONS, resolveControlPlaneUrl, resolveConvexUrl, escapeHtml2, CALLBACK_LOGO_MARK, CALLBACK_FULL_LOGO, renderCallbackPage, CONTROL_PLANE_REQUEST_UNAVAILABLE_CODE, ControlPlaneRequestUnavailableError, isControlPlaneRequestUnavailableError, requestJson, ControlPlaneRequestError, isControlPlaneAuthRejectionError, isControlPlaneSessionRefreshRejectionError, startCallbackServer, getControlPlaneUrl, getConvexUrl, createDefaultBrowserSignInDeps, signInWithBrowser, claudeTokenGet, claudeTokenSet, claudeTokenClear, agentAuthCredentialsList, fetchAgentCredentialRows, codexAuthCacheGet, codexAuthCacheSet, codexAuthCacheClear, claudeTokenReportRuntimeAuthFailureForViewer, claudeTokenReportRuntimeValidatedForViewer, e2bTokenResolvedGet, userSettingsGet, userSettingsSet, projectInstanceTypeOptionsGet, e2bDevboxRemove, e2bDevboxGet, e2bDevboxStatusesList, e2bDevboxDestroy, e2bDevboxProvision, e2bDevboxPause, e2bDevboxEnsureActive, e2bDevboxKeepAlive, e2bDevboxReset, e2bDevboxIssueBootstrapConnectInfo, e2bDevboxBootstrapDaemon, managedDevboxIssueDaemonConnectInfo, managedDaemonRecoverForInstance, managedDaemonControlGrantIssueForViewer, managedDevboxCreateCheckpoint, managedDevboxListRemoteStates, clientThreadsListForPrimaryInstance, threadTitleGenerationStatesListForPrimaryInstance, spriteDaemonSessionsList, clientThreadsUpsertRemoteInitCodexThread, clientThreadsDiscardRemoteInitCodexThread, projectInitJobsGetActiveForProject, agentInitProgressReportCliStep, instancesList, helloViewerGet, billingSummaryGet, convexBrowserModulePromise, loadConvexBrowserModule, buildConvexClientOptions, configureAuthenticatedConvexClient, createAuthenticatedConvexClient, withConvexClient, resolveInstanceIdForAlias, resolveManagedDaemonControlTargetWithClient, issueManagedDaemonControlGrantWithClient, resolveSpriteInstanceId, fetchClaudeTokenStatus, fetchResolvedE2bCredentials, fetchViewerIdentity, BILLING_ACTIVATION_STATES, readBillingActivationBoolean, parseBillingActivationDecision, parseBillingActivationSummary, fetchTeamBillingActivationForViewer, fetchActiveDesktopInitJobForProject, reportAgentInitStep, fetchViewerCodingAgentPreference, fetchProjectInstanceTypeOptionsForViewer, storeViewerCodingAgentPreference, storeClaudeCodeOauthToken, clearClaudeCodeOauthToken, reportClaudeRuntimeAuthFailureForViewer, reportClaudeRuntimeValidatedForViewer, fetchCodexAuthCacheStatus, storeCodexAuthCache, clearCodexAuthCache, normalizeE2bDevboxRecord, fetchE2bDevboxLifecycle, listE2bDevboxStatuses, destroyE2bDevbox, provisionE2bDevbox, pauseE2bDevbox, ensureE2bDevboxActive, keepAliveE2bDevbox, resetE2bDevbox, bootstrapE2bDaemon, throwManagedDaemonNotReady, normalizeOptionalString2, normalizeAliasForLookup, validateManagedDaemonRecoveryResponse, normalizeManagedCheckpointResponse, buildRecoveredManagedCheckpointResponse, readManagedCheckpointRecoveryState, recoverManagedCheckpointAfterDisconnect, buildManagedDaemonConnectInfoResponseSummary, buildManagedDaemonConnectInfoUnexpectedMessage, buildManagedDaemonConnectInfoSleepingMessage, logManagedDaemonConnectInfoResponse, fetchManagedDaemonConnectInfoWithAction, requestManagedDaemonConnectInfo, fetchManagedDaemonConnectInfo, recoverManagedDaemonForInit, recoverManagedDaemonControlTargetWithClient, fetchE2bBootstrapConnectInfo, createManagedCheckpoint, listManagedRemoteStates, listViewerInstances, listSpriteDaemonSessions, upsertRemoteInitCodexThread, discardRemoteInitCodexThread, signOutControlPlane, refreshControlPlaneSession, readLoginCodeRejection, exchangeLoginCode, createCliInitResponsesRelayTokenForViewer;
90096
+ var MANAGED_DAEMON_NOT_READY_CODE, CONVEX_INFLIGHT_ACTION_DISCONNECTED_MESSAGE, CONTROL_PLANE_ACTION_RETRY_MAX_ATTEMPTS, CONTROL_PLANE_ACTION_RETRY_BASE_DELAY_MS, MANAGED_DAEMON_RECOVERY_WAKING_TIMEOUT_MS, CONTROL_PLANE_CHECKPOINT_RECOVERY_MAX_ATTEMPTS, CONTROL_PLANE_CHECKPOINT_RECOVERY_POLL_MS, ManagedDaemonNotReadyError, isManagedDaemonNotReadyError, isManagedDaemonSleepingError, sleep2, isRetryableTransientConvexActionError, buildTransientConvexActionRetryMessage, announceTransientConvexActionRetry, retryTransientConvexAction, normalizeStringRecord, E2B_DEVBOX_ALIAS_EXISTS_CODE, isRecord3, maybeMapE2bProvisionControlPlaneError, mapE2bProvisionControlPlaneError, LOGIN_CODE_REJECTIONS, resolveControlPlaneUrl, resolveConvexUrl, escapeHtml2, CALLBACK_LOGO_MARK, CALLBACK_FULL_LOGO, renderCallbackPage, CONTROL_PLANE_REQUEST_UNAVAILABLE_CODE, ControlPlaneRequestUnavailableError, isControlPlaneRequestUnavailableError, requestJson, ControlPlaneRequestError, isControlPlaneAuthRejectionError, isControlPlaneSessionRefreshRejectionError, startCallbackServer, getControlPlaneUrl, getConvexUrl, createDefaultBrowserSignInDeps, signInWithBrowser, claudeTokenGet, claudeTokenSet, claudeTokenClear, agentAuthCredentialsList, fetchAgentCredentialRows, codexAuthCacheGet, codexAuthCacheSet, codexAuthCacheClear, claudeTokenReportRuntimeAuthFailureForViewer, claudeTokenReportRuntimeValidatedForViewer, e2bTokenResolvedGet, userSettingsGet, userSettingsSet, projectInstanceTypeOptionsGet, e2bDevboxRemove, e2bDevboxGet, e2bDevboxStatusesList, e2bDevboxDestroy, e2bDevboxProvision, e2bDevboxPause, e2bDevboxEnsureActive, e2bDevboxKeepAlive, e2bDevboxReset, e2bDevboxIssueBootstrapConnectInfo, e2bDevboxBootstrapDaemon, managedDevboxIssueDaemonConnectInfo, managedDaemonRecoverForInstance, managedDaemonControlGrantIssueForViewer, managedDevboxCreateCheckpoint, managedDevboxListRemoteStates, clientThreadsListForPrimaryInstance, threadTitleGenerationStatesListForPrimaryInstance, spriteDaemonSessionsList, clientThreadsUpsertRemoteInitCodexThread, clientThreadsDiscardRemoteInitCodexThread, projectInitJobsGetActiveForProject, agentInitProgressReportCliStep, instancesList, helloViewerGet, billingSummaryGet, convexBrowserModulePromise, loadConvexBrowserModule, buildConvexClientOptions, configureAuthenticatedConvexClient, createAuthenticatedConvexClient, withConvexClient, resolveInstanceIdForAlias, resolveManagedDaemonControlTargetWithClient, issueManagedDaemonControlGrantWithClient, resolveSpriteInstanceId, fetchClaudeTokenStatus, fetchResolvedE2bCredentials, fetchViewerIdentity, BILLING_ACTIVATION_STATES, readBillingActivationBoolean, parseBillingActivationDecision, parseBillingActivationSummary, fetchTeamBillingActivationForViewer, fetchActiveDesktopInitJobForProject, reportAgentInitStep, fetchViewerCodingAgentPreference, fetchProjectInstanceTypeOptionsForViewer, storeViewerCodingAgentPreference, storeClaudeCodeOauthToken, clearClaudeCodeOauthToken, reportClaudeRuntimeAuthFailureForViewer, reportClaudeRuntimeValidatedForViewer, fetchCodexAuthCacheStatus, storeCodexAuthCache, clearCodexAuthCache, normalizeE2bDevboxRecord, fetchE2bDevboxLifecycle, listE2bDevboxStatuses, destroyE2bDevbox, provisionE2bDevbox, pauseE2bDevbox, ensureE2bDevboxActive, keepAliveE2bDevbox, resetE2bDevbox, bootstrapE2bDaemon, throwManagedDaemonNotReady, normalizeOptionalString2, normalizeAliasForLookup, validateManagedDaemonRecoveryResponse, normalizeManagedCheckpointResponse, buildRecoveredManagedCheckpointResponse, readManagedCheckpointRecoveryState, recoverManagedCheckpointAfterDisconnect, buildManagedDaemonConnectInfoResponseSummary, buildManagedDaemonConnectInfoUnexpectedMessage, buildManagedDaemonConnectInfoSleepingMessage, buildManagedDaemonConnectInfoWakingMessage, readWakingRetryAfterMs, logManagedDaemonConnectInfoResponse, fetchManagedDaemonConnectInfoWithAction, requestManagedDaemonConnectInfo, fetchManagedDaemonConnectInfo, recoverManagedDaemonForInit, recoverManagedDaemonControlTargetWithClient, fetchE2bBootstrapConnectInfo, createManagedCheckpoint, listManagedRemoteStates, listViewerInstances, listSpriteDaemonSessions, upsertRemoteInitCodexThread, discardRemoteInitCodexThread, signOutControlPlane, refreshControlPlaneSession, readLoginCodeRejection, exchangeLoginCode, createCliInitResponsesRelayTokenForViewer;
90097
90097
  var init_controlPlane = __esm({
90098
90098
  "src/devbox/controlPlane.ts"() {
90099
90099
  "use strict";
@@ -91485,6 +91485,15 @@ var init_controlPlane = __esm({
91485
91485
  detail ? `Detail: ${detail}` : null
91486
91486
  ].filter((part) => part !== null).join(" ");
91487
91487
  };
91488
+ buildManagedDaemonConnectInfoWakingMessage = (summary) => {
91489
+ const alias = summary.responseAlias ?? summary.requestedAlias;
91490
+ const detail = summary.detail ?? summary.error ?? summary.message;
91491
+ return [
91492
+ `Machine "${alias}" is still waking up. Retry in a moment.`,
91493
+ detail ? `Detail: ${detail}` : null
91494
+ ].filter((part) => part !== null).join(" ");
91495
+ };
91496
+ readWakingRetryAfterMs = (response) => typeof response?.retryAfterMs === "number" && Number.isFinite(response.retryAfterMs) ? Math.max(0, Math.round(response.retryAfterMs)) : null;
91488
91497
  logManagedDaemonConnectInfoResponse = (event, summary) => {
91489
91498
  logger2.warn(event, {
91490
91499
  requestedAlias: summary.requestedAlias,
@@ -91506,11 +91515,22 @@ var init_controlPlane = __esm({
91506
91515
  });
91507
91516
  };
91508
91517
  fetchManagedDaemonConnectInfoWithAction = async (runAction, alias, intent, allowWake) => {
91509
- const response = await retryTransientConvexAction({
91518
+ const requestConnectInfo = async () => await retryTransientConvexAction({
91510
91519
  actionName: "devboxes:issueManagedDaemonConnectInfoForViewer",
91511
91520
  onRetry: announceTransientConvexActionRetry,
91512
91521
  run: runAction
91513
91522
  });
91523
+ const wakingDeadline = Date.now() + MANAGED_DAEMON_RECOVERY_WAKING_TIMEOUT_MS;
91524
+ let response = await requestConnectInfo();
91525
+ while (response?.ok === true && response.provider === "e2b" && response.status === "waking" && readWakingRetryAfterMs(response) !== null && Date.now() < wakingDeadline) {
91526
+ await sleep2(
91527
+ Math.min(
91528
+ readWakingRetryAfterMs(response) ?? 0,
91529
+ Math.max(0, wakingDeadline - Date.now())
91530
+ )
91531
+ );
91532
+ response = await requestConnectInfo();
91533
+ }
91514
91534
  if (response?.ok === false && response.code === MANAGED_DAEMON_NOT_READY_CODE) {
91515
91535
  throwManagedDaemonNotReady(response, alias);
91516
91536
  }
@@ -91539,6 +91559,18 @@ var init_controlPlane = __esm({
91539
91559
  ...summary.detail ? { detail: summary.detail } : {}
91540
91560
  });
91541
91561
  }
91562
+ if (provider === "e2b" && summary.ok === true && summary.status === "waking") {
91563
+ const retryAfterMs = readWakingRetryAfterMs(response);
91564
+ throw new ManagedDaemonNotReadyError({
91565
+ provider: "e2b",
91566
+ alias: resolvedAlias || alias,
91567
+ state: "pending",
91568
+ lifecycleStatus: "waking",
91569
+ message: buildManagedDaemonConnectInfoWakingMessage(summary),
91570
+ ...summary.detail ? { detail: summary.detail } : {},
91571
+ ...retryAfterMs !== null ? { retryAfterMs } : {}
91572
+ });
91573
+ }
91542
91574
  if (summary.ok !== true || provider !== "e2b" || !resolvedAlias || !sandboxId || !url3 || !connectToken) {
91543
91575
  logManagedDaemonConnectInfoResponse(
91544
91576
  "managed_daemon_connect_info_unexpected",
@@ -91716,9 +91748,12 @@ var init_controlPlane = __esm({
91716
91748
  return response.filter((entry) => entry && typeof entry === "object").map((entry) => entry);
91717
91749
  });
91718
91750
  };
91719
- listViewerInstances = async (token) => {
91751
+ listViewerInstances = async (token, { includeHiddenForks } = {
91752
+ includeHiddenForks: false
91753
+ }) => {
91720
91754
  return await withConvexClient(token, async (client) => {
91721
91755
  const entries = await client.query(instancesList, {
91756
+ includeHiddenForks,
91722
91757
  includeDaemonHeartbeat: false
91723
91758
  });
91724
91759
  const result = [];
@@ -138946,14 +138981,14 @@ var init_cp = __esm({
138946
138981
  init_devboxCore();
138947
138982
  init_daemonClient();
138948
138983
  init_logger3();
138949
- init_boxSelect();
138984
+ init_controlPlane();
138950
138985
  init_commandProvider();
138986
+ init_e2bCommandContext();
138951
138987
  init_progress();
138952
138988
  init_args();
138953
138989
  init_errors4();
138954
138990
  init_runtimeClient();
138955
138991
  init_projectWorkdir();
138956
- init_accountScope2();
138957
138992
  COPY_USAGE = [
138958
138993
  "Usage:",
138959
138994
  " dvb cp <src> <box>:<dest> [--json]",
@@ -139025,26 +139060,19 @@ var init_cp = __esm({
139025
139060
  };
139026
139061
  };
139027
139062
  resolveCopyProviderTarget = async (targetBox) => {
139028
- let providerLookupBoxes = null;
139029
- try {
139030
- providerLookupBoxes = await listDevboxes();
139031
- } catch (error55) {
139032
- logger2.warn("cp_provider_lookup_failed", {
139033
- box: targetBox,
139034
- error: String(error55)
139035
- });
139036
- }
139037
- const homeDir2 = process.env.HOME ?? os12.homedir();
139038
- const { accountScope } = await resolveCliAccountScopeFromLocalAuth({
139039
- cwd: process.cwd(),
139040
- homeDir: homeDir2
139041
- });
139042
- return await resolveCommandComputeProvider({
139043
- accountScope,
139044
- box: targetBox,
139045
- boxes: providerLookupBoxes,
139046
- homeDir: homeDir2
139063
+ const target = targetBox.trim();
139064
+ const { controlPlaneToken } = await resolveE2bCommandContext();
139065
+ const instances2 = await listViewerInstances(controlPlaneToken, {
139066
+ includeHiddenForks: true
139047
139067
  });
139068
+ const match = instances2.find((entry) => entry.instanceId === target) ?? instances2.find((entry) => entry.alias === target) ?? instances2.find((entry) => entry.providerInstanceId === target);
139069
+ if (!match) {
139070
+ throw new Error(`No machine named "${target}" found.`);
139071
+ }
139072
+ return {
139073
+ alias: match.alias,
139074
+ computeProvider: match.provider
139075
+ };
139048
139076
  };
139049
139077
  shouldAppendSourceBasename = (rawPath) => rawPath.length === 0 || rawPath === "." || rawPath === "./" || rawPath.endsWith("/");
139050
139078
  resolveRemoteHomeDir = async ({
@@ -262065,7 +262093,7 @@ import { constants as fsConstants3 } from "node:fs";
262065
262093
  import { access as access3 } from "node:fs/promises";
262066
262094
  import os26 from "node:os";
262067
262095
  import path62 from "node:path";
262068
- var trim12, createDesktopThreadQueryValue, DESKTOP_APP_BUNDLE_NAME, DESKTOP_APP_TARGET_PATH, resolveDesktopAppInstallPaths, pathExists7, findInstalledDesktopAppPath, buildDesktopAppWorkbenchUrl, buildDesktopAppOpenArgs, openDesktopApp;
262096
+ var trim12, createDesktopThreadQueryValue, DESKTOP_APP_BUNDLE_NAME, DESKTOP_APP_TARGET_PATH, resolveDesktopAppInstallPaths, pathExists7, findInstalledDesktopAppPath, setDesktopAppSelection, buildDesktopAppWorkbenchUrl, buildDesktopAppLink, buildDesktopAppOpenArgs, runOpen, openDesktopApp, openDesktopAppLink;
262069
262097
  var init_desktopApp = __esm({
262070
262098
  "src/devbox/commands/desktopApp.ts"() {
262071
262099
  "use strict";
@@ -262104,11 +262132,7 @@ var init_desktopApp = __esm({
262104
262132
  }
262105
262133
  return null;
262106
262134
  };
262107
- buildDesktopAppWorkbenchUrl = ({
262108
- alias,
262109
- clientThreadId
262110
- }) => {
262111
- const url3 = new URL("/desktop", resolveSiteUrl());
262135
+ setDesktopAppSelection = (url3, { alias, clientThreadId }) => {
262112
262136
  url3.searchParams.set("box", trim12(alias));
262113
262137
  const trimmedThreadId = trim12(clientThreadId ?? "");
262114
262138
  if (trimmedThreadId) {
@@ -262119,6 +262143,8 @@ var init_desktopApp = __esm({
262119
262143
  }
262120
262144
  return url3.toString();
262121
262145
  };
262146
+ buildDesktopAppWorkbenchUrl = (selection) => setDesktopAppSelection(new URL("/desktop", resolveSiteUrl()), selection);
262147
+ buildDesktopAppLink = (selection) => setDesktopAppSelection(new URL("boxesdesktop://desktop"), selection);
262122
262148
  buildDesktopAppOpenArgs = ({
262123
262149
  appPath,
262124
262150
  startUrl
@@ -262129,38 +262155,38 @@ var init_desktopApp = __esm({
262129
262155
  }
262130
262156
  return ["-a", appPath, "--args", "--start-url", trimmedStartUrl];
262131
262157
  };
262132
- openDesktopApp = ({
262133
- appPath,
262134
- startUrl,
262135
- spawnImpl = spawn19
262136
- }) => {
262158
+ runOpen = (args, spawnImpl) => {
262137
262159
  try {
262138
- const child = spawnImpl(
262139
- "open",
262140
- buildDesktopAppOpenArgs({
262141
- appPath,
262142
- startUrl
262143
- }),
262144
- {
262145
- detached: true,
262146
- stdio: "ignore"
262147
- }
262148
- );
262160
+ const child = spawnImpl("open", args, {
262161
+ detached: true,
262162
+ stdio: "ignore"
262163
+ });
262149
262164
  child.unref();
262150
262165
  return true;
262151
262166
  } catch {
262152
262167
  return false;
262153
262168
  }
262154
262169
  };
262170
+ openDesktopApp = ({
262171
+ appPath,
262172
+ startUrl,
262173
+ spawnImpl = spawn19
262174
+ }) => runOpen(buildDesktopAppOpenArgs({ appPath, startUrl }), spawnImpl);
262175
+ openDesktopAppLink = ({
262176
+ appPath,
262177
+ link: link2,
262178
+ spawnImpl = spawn19
262179
+ }) => runOpen(["-a", appPath, link2], spawnImpl);
262155
262180
  }
262156
262181
  });
262157
262182
 
262158
262183
  // src/devbox/agentInit/desktopHandoff.ts
262159
- var resolveDesktopHandoff, detectDesktopHandoff, buildSetupThreadHandoffMessage, detectSetupThreadHandoffMessage, buildCompletedSetupOptions;
262184
+ var resolveDesktopHandoff, detectDesktopHandoff, buildSetupThreadHandoffMessage, detectSetupThreadHandoffMessage, buildTerminalAndMobileOptions, buildCompletedSetupOptions, readSetupThreadId, openSetupInDesktopApp, reportCompletedSetup;
262160
262185
  var init_desktopHandoff = __esm({
262161
262186
  "src/devbox/agentInit/desktopHandoff.ts"() {
262162
262187
  "use strict";
262163
262188
  init_desktopApp();
262189
+ init_controlPlane();
262164
262190
  init_siteUrl();
262165
262191
  init_remoteSession();
262166
262192
  resolveDesktopHandoff = ({
@@ -262180,7 +262206,7 @@ var init_desktopHandoff = __esm({
262180
262206
  const started = "The setup thread has started on the Template box, and this command will keep running.";
262181
262207
  switch (handoff) {
262182
262208
  case "open_mac_app":
262183
- return `${started} Offer to open it in the boxes.dev Mac app. If the user agrees, run \`dvb agent-init open-desktop\`.`;
262209
+ return `${started} Offer to open it in the boxes.dev Mac app. If the user agrees, run \`dvb agent-init open-desktop\`. When setup finishes, this command will open the app on the setup thread.`;
262184
262210
  case "download_mac_app":
262185
262211
  return `${started} Tell the user they can follow it in the boxes.dev Mac app and give them the download link: ${siteUrl}/mac`;
262186
262212
  case "mobile_app":
@@ -262191,28 +262217,96 @@ var init_desktopHandoff = __esm({
262191
262217
  await detectDesktopHandoff(),
262192
262218
  resolveSiteUrl()
262193
262219
  );
262220
+ buildTerminalAndMobileOptions = ({
262221
+ alias,
262222
+ siteUrl
262223
+ }) => [
262224
+ `work with its coding agents from a terminal: \`dvb agents ${alias}\` (add \`--workspace\` to keep the thread list beside the open agent; this needs tmux 3.3 or newer)`,
262225
+ `use it from the boxes.dev mobile app: ${siteUrl}/m`
262226
+ ];
262194
262227
  buildCompletedSetupOptions = ({
262195
262228
  alias,
262196
262229
  handoff,
262197
262230
  siteUrl
262198
262231
  }) => {
262199
- const terminal2 = `work with its coding agents from a terminal: \`dvb agents ${alias}\` (add \`--workspace\` to keep the thread list beside the open agent; this needs tmux 3.3 or newer)`;
262200
- const mobile = `use it from the boxes.dev mobile app: ${siteUrl}/m`;
262232
+ const otherOptions = buildTerminalAndMobileOptions({ alias, siteUrl });
262201
262233
  switch (handoff) {
262202
262234
  case "open_mac_app":
262203
262235
  return [
262204
262236
  "open it in the boxes.dev Mac app (run `dvb agent-init open-desktop`)",
262205
- terminal2,
262206
- mobile
262237
+ ...otherOptions
262207
262238
  ];
262208
262239
  case "download_mac_app":
262209
262240
  return [
262210
262241
  `open it in the boxes.dev Mac app, which they can download from ${siteUrl}/mac`,
262211
- terminal2,
262212
- mobile
262242
+ ...otherOptions
262213
262243
  ];
262214
262244
  case "mobile_app":
262215
- return [terminal2, mobile];
262245
+ return otherOptions;
262246
+ }
262247
+ };
262248
+ readSetupThreadId = (job) => typeof job?.["setupThreadId"] === "string" && job["setupThreadId"] !== "" ? job["setupThreadId"] : null;
262249
+ openSetupInDesktopApp = async ({
262250
+ appPath,
262251
+ context: context34,
262252
+ repo,
262253
+ setupThreadId
262254
+ }) => {
262255
+ const clientThreadId = setupThreadId === null ? null : await upsertRemoteInitCodexThread(
262256
+ await context34.getControlPlaneToken(),
262257
+ repo.alias,
262258
+ setupThreadId
262259
+ );
262260
+ const link2 = buildDesktopAppLink({ alias: repo.alias, clientThreadId });
262261
+ if (!openDesktopAppLink({ appPath, link: link2 })) {
262262
+ throw new Error(
262263
+ `Couldn't open the boxes.dev Mac app. Ask the user to open it from ${appPath}.`
262264
+ );
262265
+ }
262266
+ console.log(
262267
+ setupThreadId === null ? `Opened the boxes.dev Mac app on ${repo.alias}.` : `Opened the boxes.dev Mac app on the setup thread for ${repo.alias}.`
262268
+ );
262269
+ };
262270
+ reportCompletedSetup = async ({
262271
+ context: context34,
262272
+ job,
262273
+ repo
262274
+ }) => {
262275
+ console.log("");
262276
+ console.log(`Template box setup is complete: ${repo.alias}`);
262277
+ console.log("");
262278
+ const siteUrl = resolveSiteUrl();
262279
+ const appPath = await findInstalledDesktopAppPath();
262280
+ const handoff = resolveDesktopHandoff({
262281
+ installedAppPath: appPath,
262282
+ platform: process.platform,
262283
+ remote: isRemoteShellSession()
262284
+ });
262285
+ if (handoff === "open_mac_app" && appPath !== null) {
262286
+ await openSetupInDesktopApp({
262287
+ appPath,
262288
+ context: context34,
262289
+ repo,
262290
+ setupThreadId: readSetupThreadId(job)
262291
+ });
262292
+ console.log(
262293
+ "Tell the user their Template box is ready and the setup thread is open in the boxes.dev Mac app. They can also:"
262294
+ );
262295
+ for (const option of buildTerminalAndMobileOptions({
262296
+ alias: repo.alias,
262297
+ siteUrl
262298
+ })) {
262299
+ console.log(` - ${option}`);
262300
+ }
262301
+ return;
262302
+ }
262303
+ console.log("Tell the user their Template box is ready. They can:");
262304
+ for (const option of buildCompletedSetupOptions({
262305
+ alias: repo.alias,
262306
+ handoff,
262307
+ siteUrl
262308
+ })) {
262309
+ console.log(` - ${option}`);
262216
262310
  }
262217
262311
  };
262218
262312
  }
@@ -262940,8 +263034,8 @@ var init_openDesktop = __esm({
262940
263034
  init_args();
262941
263035
  init_errors4();
262942
263036
  init_commandCore();
263037
+ init_desktopHandoff();
262943
263038
  init_jobLoop();
262944
- init_controlPlane();
262945
263039
  init_siteUrl();
262946
263040
  init_desktopApp();
262947
263041
  isRecord15 = (value) => typeof value === "object" && value !== null;
@@ -262977,24 +263071,12 @@ var init_openDesktop = __esm({
262977
263071
  const { context: context34, repo } = await resolveAgentInitProject({ projectPath });
262978
263072
  const progress = await fetchJobProgress({ context: context34, jobId: null, repo });
262979
263073
  const job = progress && isRecord15(progress["job"]) ? progress["job"] : null;
262980
- const setupThreadId = typeof job?.["setupThreadId"] === "string" && job["setupThreadId"] !== "" ? job["setupThreadId"] : null;
262981
- const clientThreadId = setupThreadId === null ? null : await upsertRemoteInitCodexThread(
262982
- context34.controlPlaneToken,
262983
- repo.alias,
262984
- setupThreadId
262985
- );
262986
- const startUrl = buildDesktopAppWorkbenchUrl({
262987
- alias: repo.alias,
262988
- clientThreadId
263074
+ await openSetupInDesktopApp({
263075
+ appPath,
263076
+ context: context34,
263077
+ repo,
263078
+ setupThreadId: readSetupThreadId(job)
262989
263079
  });
262990
- if (!openDesktopApp({ appPath, startUrl })) {
262991
- throw new Error(
262992
- `Couldn't open the boxes.dev Mac app. Ask the user to open it from ${appPath}.`
262993
- );
262994
- }
262995
- console.log(
262996
- setupThreadId === null ? `Opened the boxes.dev Mac app on ${repo.alias}.` : `Opened the boxes.dev Mac app on the setup thread for ${repo.alias}.`
262997
- );
262998
263080
  };
262999
263081
  }
263000
263082
  });
@@ -263010,6 +263092,7 @@ var init_recover = __esm({
263010
263092
  init_commandCore();
263011
263093
  init_jobLoop();
263012
263094
  init_progressReport();
263095
+ init_desktopHandoff();
263013
263096
  isRecord16 = (value) => typeof value === "object" && value !== null;
263014
263097
  runAgentInitRetry = async (args) => {
263015
263098
  const { flags, positionals } = parseCommandArgs({
@@ -263047,7 +263130,7 @@ var init_recover = __esm({
263047
263130
  repo
263048
263131
  });
263049
263132
  if (outcome.kind === "complete") {
263050
- console.log(`Template box setup is complete: ${repo.alias}`);
263133
+ await reportCompletedSetup({ context: context34, job: outcome.job, repo });
263051
263134
  return;
263052
263135
  }
263053
263136
  if (outcome.kind === "failed_recoverable") {
@@ -263559,7 +263642,6 @@ var init_run = __esm({
263559
263642
  init_driver();
263560
263643
  init_desktopHandoff();
263561
263644
  init_jobLoop();
263562
- init_siteUrl();
263563
263645
  init_check();
263564
263646
  init_compile();
263565
263647
  init_githubAccess();
@@ -263791,17 +263873,7 @@ ${JSON.stringify(compiled.initialProjectConfiguration)}`
263791
263873
  repo
263792
263874
  });
263793
263875
  if (outcome.kind === "complete") {
263794
- console.log("");
263795
- console.log(`Template box setup is complete: ${repo.alias}`);
263796
- console.log("");
263797
- console.log("Tell the user their Template box is ready. They can:");
263798
- for (const option of buildCompletedSetupOptions({
263799
- alias: repo.alias,
263800
- handoff: await detectDesktopHandoff(),
263801
- siteUrl: resolveSiteUrl()
263802
- })) {
263803
- console.log(` - ${option}`);
263804
- }
263876
+ await reportCompletedSetup({ context: context34, job: outcome.job, repo });
263805
263877
  return;
263806
263878
  }
263807
263879
  if (outcome.kind === "failed_recoverable") {
@@ -264476,7 +264548,7 @@ var init_status = __esm({
264476
264548
  repo
264477
264549
  });
264478
264550
  if (outcome.kind === "complete") {
264479
- console.log(`Template box setup is complete: ${repo.alias}`);
264551
+ await reportCompletedSetup({ context: context34, job: outcome.job, repo });
264480
264552
  return;
264481
264553
  }
264482
264554
  if (outcome.kind === "failed_recoverable") {
@@ -296483,4 +296555,4 @@ react/cjs/react-jsx-runtime.development.js:
296483
296555
  *)
296484
296556
  */
296485
296557
 
296486
- //# debugId=9c41cadc-e81c-5aa4-9937-e5ea56beec3a
296558
+ //# debugId=7953d21a-e340-5f5c-923a-10cac5e75ade
package/dist/bin/dvbd.mjs CHANGED
@@ -64667,9 +64667,9 @@ var init_sentry = __esm({
64667
64667
  uncaughtExceptionMonitorInstalled = false;
64668
64668
  currentDevboxSentryUser = null;
64669
64669
  readBuildMetadata = () => {
64670
- const rawPackageVersion = "1.0.1054";
64671
- const rawGitSha = "4a244bb28514548cb1ff7c63ae7ddd26e23079ad";
64672
- const rawSentryRelease = "boxes-dev-dvb@1.0.1054+4a244bb28514548cb1ff7c63ae7ddd26e23079ad";
64670
+ const rawPackageVersion = "1.0.1055";
64671
+ const rawGitSha = "f79c13a9c9d8ec1a57505f400122d23ec18b0a9c";
64672
+ const rawSentryRelease = "boxes-dev-dvb@1.0.1055+f79c13a9c9d8ec1a57505f400122d23ec18b0a9c";
64673
64673
  const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
64674
64674
  const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
64675
64675
  const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
@@ -66884,7 +66884,7 @@ var init_packageVersion = __esm({
66884
66884
  return path8.join(process.cwd(), "dvb");
66885
66885
  };
66886
66886
  readEmbeddedPackageVersion = () => {
66887
- const raw = "1.0.1054";
66887
+ const raw = "1.0.1055";
66888
66888
  return trimVersion(raw);
66889
66889
  };
66890
66890
  readNearestPackageMetadata = (basePath) => {
@@ -62,7 +62,8 @@ capacity. After a prepared devbox is assigned and wakes for the member, it is
62
62
  accounted for exactly like that member's other devboxes.
63
63
 
64
64
  The desktop titlebar can show a usage icon next to the project selector; hover
65
- it for current box-hour usage and awake devbox usage. The billing page shows
65
+ or click it for current box-hour usage, the billing period end date when
66
+ available, and awake devbox usage. The billing page shows
66
67
  usage for the current billing period. Its Usage history section shows
67
68
  box-hours used by hour for the last 24 hours or seven days, plus the boxes that
68
69
  contributed to that usage. The seven-day chart defaults to one bar per 24-hour
@@ -329,10 +329,12 @@ the agent where the user can follow it. On a Mac with the desktop app
329
329
  installed, the agent offers to open it with `dvb agent-init open-desktop`,
330
330
  which opens the Template box on the setup thread. On a Mac without the app,
331
331
  the agent gives the download link, and on other computers or over SSH, it
332
- points to the mobile app. When setup finishes, the agent lists the same
333
- choices along with `dvb agents <project>`, which opens the Template box's
334
- agent threads in the terminal (`--workspace` keeps the thread list beside the
335
- open agent).
332
+ points to the mobile app. When setup finishes on a Mac with the desktop app
333
+ installed, `dvb agent-init` opens the app on the setup thread, where the user
334
+ can read the setup agent's summary. Otherwise, the agent lists the same
335
+ choices. Either way, the agent also mentions `dvb agents <project>`, which
336
+ opens the Template box's agent threads in the terminal (`--workspace` keeps
337
+ the thread list beside the open agent).
336
338
 
337
339
  Launch requires the same billing activation as desktop setup. The machine
338
340
  created this way is a normal Template box: it appears in the desktop app,
@@ -35,6 +35,15 @@ If the title bar shows an Offline or Reconnecting badge, the app itself cannot
35
35
  reach boxes.dev. Threads and status will catch up on their own once the badge
36
36
  clears, so check your network before reloading.
37
37
 
38
+ If the full window stays on **Checking sign-in…** or **Loading workspace…**,
39
+ wait for the **Reload** button to appear after 15 seconds, then choose it to
40
+ reload the desktop app. You can also press Cmd+R.
41
+
42
+ If a reload fails, the desktop app will retry automatically. If the window
43
+ stays on **Still reloading boxes.dev…**, choose **Reload** to start loading
44
+ the app again. If it shows **Can’t reach boxes.dev**, check your connection
45
+ and choose **Retry now**.
46
+
38
47
  If the selected Template box, devbox, or agent seems like it is in a bad state,
39
48
  use **Machine > Reset** from the menu bar. Reset kills all non-essential
40
49
  processes on the selected machine and restarts the boxes.dev daemon.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxes-dev/dvb-runtime",
3
- "version": "1.0.1054",
3
+ "version": "1.0.1055",
4
4
  "description": "Runtime for the boxes.dev CLI. Install @boxes-dev/dvb to use the CLI.",
5
5
  "homepage": "https://boxes.dev",
6
6
  "type": "module",
@@ -77,5 +77,5 @@
77
77
  "e2b": "^2.18.0",
78
78
  "ink-testing-library": "^4.0.0"
79
79
  },
80
- "devboxReleasedAt": "2026-10-05T03:08:22Z"
80
+ "devboxReleasedAt": "2026-10-05T21:42:37Z"
81
81
  }