@boxes-dev/dvb-runtime 1.0.1066 → 1.0.1067

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/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]="a9f47e29-7959-5442-80a0-659295eee021")}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]="839be569-0d96-58c6-b81d-d57585ce022a")}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";
@@ -27010,7 +27010,7 @@ var init_chatGptBrowserSignIn = __esm({
27010
27010
  });
27011
27011
 
27012
27012
  // ../../../../shared/devboxCore/dist/claudeOAuthParams.js
27013
- var CLAUDE_OAUTH_SOURCE_VERSION, CLAUDE_OAUTH_AUTHORIZE_URL, CLAUDE_OAUTH_CLIENT_ID, CLAUDE_OAUTH_MANUAL_REDIRECT_URL, CLAUDE_OAUTH_AUTOMATIC_REDIRECT_URL, CLAUDE_SETUP_TOKEN_SCOPE, CLAUDE_SETUP_TOKEN_EXPIRES_IN_SECONDS, CLAUDE_OAUTH_HTTP_USER_AGENT, buildClaudeAuthDiscovery;
27013
+ var CLAUDE_OAUTH_SOURCE_VERSION, CLAUDE_OAUTH_AUTHORIZE_URL, CLAUDE_OAUTH_CLIENT_ID, CLAUDE_OAUTH_MANUAL_REDIRECT_URL, CLAUDE_OAUTH_AUTOMATIC_REDIRECT_URL, CLAUDE_SETUP_TOKEN_EXPIRES_IN_SECONDS, CLAUDE_LOGIN_SCOPES, CLAUDE_OAUTH_HTTP_USER_AGENT, buildClaudeAuthDiscovery;
27014
27014
  var init_claudeOAuthParams = __esm({
27015
27015
  "../../../../shared/devboxCore/dist/claudeOAuthParams.js"() {
27016
27016
  "use strict";
@@ -27019,8 +27019,16 @@ var init_claudeOAuthParams = __esm({
27019
27019
  CLAUDE_OAUTH_CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e";
27020
27020
  CLAUDE_OAUTH_MANUAL_REDIRECT_URL = "https://platform.claude.com/oauth/code/callback";
27021
27021
  CLAUDE_OAUTH_AUTOMATIC_REDIRECT_URL = "http://localhost/callback";
27022
- CLAUDE_SETUP_TOKEN_SCOPE = "user:inference";
27023
27022
  CLAUDE_SETUP_TOKEN_EXPIRES_IN_SECONDS = 365 * 24 * 60 * 60;
27023
+ CLAUDE_LOGIN_SCOPES = [
27024
+ "org:create_api_key",
27025
+ "user:profile",
27026
+ "user:inference",
27027
+ "user:sessions:claude_code",
27028
+ "user:mcp_servers",
27029
+ "user:file_upload",
27030
+ "user:plugins"
27031
+ ];
27024
27032
  CLAUDE_OAUTH_HTTP_USER_AGENT = "axios/1.15.2";
27025
27033
  buildClaudeAuthDiscovery = () => {
27026
27034
  const authorizeUrl = new URL(CLAUDE_OAUTH_AUTHORIZE_URL);
@@ -69709,9 +69717,9 @@ var init_sentry = __esm({
69709
69717
  uncaughtExceptionMonitorInstalled = false;
69710
69718
  currentDevboxSentryUser = null;
69711
69719
  readBuildMetadata = () => {
69712
- const rawPackageVersion = "1.0.1066";
69713
- const rawGitSha = "264816c4f2dbdb6e253743fa1b1c9220d63d69e2";
69714
- const rawSentryRelease = "boxes-dev-dvb@1.0.1066+264816c4f2dbdb6e253743fa1b1c9220d63d69e2";
69720
+ const rawPackageVersion = "1.0.1067";
69721
+ const rawGitSha = "5b600df1098728373e216a3fc68035049a1a1ed8";
69722
+ const rawSentryRelease = "boxes-dev-dvb@1.0.1067+5b600df1098728373e216a3fc68035049a1a1ed8";
69715
69723
  const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
69716
69724
  const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
69717
69725
  const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
@@ -75095,7 +75103,7 @@ var init_packageVersion = __esm({
75095
75103
  return path18.join(process.cwd(), "dvb");
75096
75104
  };
75097
75105
  readEmbeddedPackageVersion = () => {
75098
- const raw = "1.0.1066";
75106
+ const raw = "1.0.1067";
75099
75107
  return trimVersion(raw);
75100
75108
  };
75101
75109
  readNearestPackageMetadata = (basePath) => {
@@ -90108,7 +90116,7 @@ var init_index_node2 = __esm({
90108
90116
  // src/devbox/controlPlane.ts
90109
90117
  import http7 from "node:http";
90110
90118
  import { randomUUID as randomUUID5 } from "node:crypto";
90111
- 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, AGENT_INIT_STEP_REPORT_TIMEOUT_MS, 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;
90119
+ 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, claudeLoginSave, 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, AGENT_INIT_STEP_REPORT_TIMEOUT_MS, reportAgentInitStep, fetchViewerCodingAgentPreference, fetchProjectInstanceTypeOptionsForViewer, storeViewerCodingAgentPreference, storeClaudeCodeOauthToken, storeClaudeLogin, 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;
90112
90120
  var init_controlPlane = __esm({
90113
90121
  "src/devbox/controlPlane.ts"() {
90114
90122
  "use strict";
@@ -90691,6 +90699,7 @@ var init_controlPlane = __esm({
90691
90699
  };
90692
90700
  claudeTokenGet = makeFunctionReference("claudeTokens:getForViewer");
90693
90701
  claudeTokenSet = makeFunctionReference("claudeTokens:setForViewer");
90702
+ claudeLoginSave = makeFunctionReference("claudeLoginSignIn:saveForViewer");
90694
90703
  claudeTokenClear = makeFunctionReference("claudeTokens:clearForViewer");
90695
90704
  agentAuthCredentialsList = makeFunctionReference("agentAuthCredentials:listForViewer");
90696
90705
  fetchAgentCredentialRows = async (token) => await withConvexClient(token, async (client) => {
@@ -90831,6 +90840,7 @@ var init_controlPlane = __esm({
90831
90840
  const response = await client.query(claudeTokenGet, {});
90832
90841
  return {
90833
90842
  authMode: response?.authMode === "api_key" || response?.authMode === "oauth" ? response.authMode : null,
90843
+ oauthKind: response?.oauthKind === "login" || response?.oauthKind === "setup_token" ? response.oauthKind : null,
90834
90844
  hasToken: response?.hasToken === true,
90835
90845
  expiresAt: typeof response?.expiresAt === "number" ? response.expiresAt : null,
90836
90846
  updatedAt: typeof response?.updatedAt === "number" ? response.updatedAt : null,
@@ -91020,6 +91030,17 @@ var init_controlPlane = __esm({
91020
91030
  };
91021
91031
  });
91022
91032
  };
91033
+ storeClaudeLogin = async (token, tokenResponse, exchangeIdentity) => await withConvexClient(token, async (client) => {
91034
+ const response = await client.action(claudeLoginSave, {
91035
+ tokenResponse,
91036
+ exchangeIdentity,
91037
+ intent: "add"
91038
+ });
91039
+ return {
91040
+ expiresAt: response.expiresAt ?? 0,
91041
+ updatedAt: response.updatedAt
91042
+ };
91043
+ });
91023
91044
  clearClaudeCodeOauthToken = async (token) => {
91024
91045
  await withConvexClient(token, async (client) => {
91025
91046
  await client.mutation(claudeTokenClear, {});
@@ -250379,7 +250400,7 @@ var init_claudeSetupOauth = __esm({
250379
250400
  automaticUrl.searchParams.set("client_id", discovery.clientId);
250380
250401
  automaticUrl.searchParams.set("response_type", "code");
250381
250402
  automaticUrl.searchParams.set("redirect_uri", automaticRedirectUrl);
250382
- automaticUrl.searchParams.set("scope", CLAUDE_SETUP_TOKEN_SCOPE);
250403
+ automaticUrl.searchParams.set("scope", CLAUDE_LOGIN_SCOPES.join(" "));
250383
250404
  automaticUrl.searchParams.set("code_challenge", codeChallenge);
250384
250405
  automaticUrl.searchParams.set("code_challenge_method", "S256");
250385
250406
  automaticUrl.searchParams.set("state", state);
@@ -250388,7 +250409,7 @@ var init_claudeSetupOauth = __esm({
250388
250409
  manualUrl.searchParams.set("client_id", discovery.clientId);
250389
250410
  manualUrl.searchParams.set("response_type", "code");
250390
250411
  manualUrl.searchParams.set("redirect_uri", discovery.manualRedirectUrl);
250391
- manualUrl.searchParams.set("scope", CLAUDE_SETUP_TOKEN_SCOPE);
250412
+ manualUrl.searchParams.set("scope", CLAUDE_LOGIN_SCOPES.join(" "));
250392
250413
  manualUrl.searchParams.set("code_challenge", codeChallenge);
250393
250414
  manualUrl.searchParams.set("code_challenge_method", "S256");
250394
250415
  manualUrl.searchParams.set("state", state);
@@ -250672,8 +250693,9 @@ var init_claudeSetupOauth = __esm({
250672
250693
  redirect_uri: redirectUrl,
250673
250694
  client_id: discovery.clientId,
250674
250695
  code_verifier: codeVerifier,
250675
- state,
250676
- expires_in: CLAUDE_SETUP_TOKEN_EXPIRES_IN_SECONDS
250696
+ state
250697
+ // A claude.ai login takes Anthropic's default lifetime; a custom one is
250698
+ // refused for its scopes.
250677
250699
  });
250678
250700
  const response = await sendClaudeSetupJsonRequest({
250679
250701
  url: tokenUrl,
@@ -250711,6 +250733,16 @@ var init_claudeSetupOauth = __esm({
250711
250733
  "expires_in"
250712
250734
  );
250713
250735
  const scope = requireNullableString2(parsed.scope);
250736
+ const tokenResponse = {
250737
+ access_token: accessToken,
250738
+ refresh_token: requireNonEmptyString(parsed.refresh_token, "refresh_token"),
250739
+ expires_in: expiresInSeconds,
250740
+ refresh_token_expires_in: requirePositiveInteger(
250741
+ parsed.refresh_token_expires_in,
250742
+ "refresh_token_expires_in"
250743
+ ),
250744
+ scope: requireNonEmptyString(parsed.scope, "scope")
250745
+ };
250714
250746
  const account = isRecord7(parsed.account) ? parsed.account : null;
250715
250747
  const organization = isRecord7(parsed.organization) ? parsed.organization : null;
250716
250748
  return {
@@ -250719,7 +250751,8 @@ var init_claudeSetupOauth = __esm({
250719
250751
  emailAddress: account ? requireNullableString2(account.email_address) : null,
250720
250752
  expiresInSeconds,
250721
250753
  organizationUuid: organization ? requireNullableString2(organization.uuid) : null,
250722
- scope
250754
+ scope,
250755
+ tokenResponse
250723
250756
  };
250724
250757
  };
250725
250758
  prepareClaudeSetupAuthorizeUrls = ({
@@ -250873,7 +250906,8 @@ var init_claudeSetupOauth = __esm({
250873
250906
  accountEmail: null,
250874
250907
  accountUuid: null,
250875
250908
  organizationUuid: null,
250876
- source: "existing_token"
250909
+ source: "existing_token",
250910
+ tokenResponse: null
250877
250911
  };
250878
250912
  }
250879
250913
  const tokenExchange = await exchangeClaudeSetupOauthCodeFn({
@@ -250888,7 +250922,8 @@ var init_claudeSetupOauth = __esm({
250888
250922
  accountEmail: tokenExchange.emailAddress,
250889
250923
  accountUuid: tokenExchange.accountUuid,
250890
250924
  organizationUuid: tokenExchange.organizationUuid,
250891
- source: "oauth"
250925
+ source: "oauth",
250926
+ tokenResponse: tokenExchange.tokenResponse
250892
250927
  };
250893
250928
  } finally {
250894
250929
  await callbackServer.close().catch(() => void 0);
@@ -250925,7 +250960,8 @@ var init_claudeSetupOauth = __esm({
250925
250960
  accountEmail: null,
250926
250961
  accountUuid: null,
250927
250962
  organizationUuid: null,
250928
- source: "existing_token"
250963
+ source: "existing_token",
250964
+ tokenResponse: null
250929
250965
  };
250930
250966
  }
250931
250967
  const tokenExchange = await exchangeClaudeSetupOauthCodeFn({
@@ -250940,25 +250976,29 @@ var init_claudeSetupOauth = __esm({
250940
250976
  accountEmail: tokenExchange.emailAddress,
250941
250977
  accountUuid: tokenExchange.accountUuid,
250942
250978
  organizationUuid: tokenExchange.organizationUuid,
250943
- source: "oauth"
250979
+ source: "oauth",
250980
+ tokenResponse: tokenExchange.tokenResponse
250944
250981
  };
250945
250982
  };
250946
250983
  }
250947
250984
  });
250948
250985
 
250949
250986
  // src/devbox/commands/setupClaude.ts
250950
- var CLAUDE_TOKEN_RENEWAL_WINDOW_MS, trim11, formatDate, resolveClaudeSetupState, formatClaudeSetupState, preflightClaudeSetupToken, resolveClaudeSetupPromptContent, needsClaudeSetupAttention, promptForClaudeSetupAuthMethod, collectClaudeCodeOauthTokenInteractively, ensureManagedClaudeAuth;
250987
+ var CLAUDE_TOKEN_RENEWAL_WINDOW_MS, CLAUDE_LOGIN_RENEWAL_WINDOW_MS, trim11, formatDate, resolveClaudeSetupState, formatClaudeSetupState, preflightClaudeSetupToken, resolveClaudeSetupPromptContent, needsClaudeSetupAttention, promptForClaudeSetupAuthMethod, collectClaudeCodeOauthTokenInteractively, ensureManagedClaudeAuth;
250951
250988
  var init_setupClaude = __esm({
250952
250989
  "src/devbox/commands/setupClaude.ts"() {
250953
250990
  "use strict";
250954
250991
  init_dist5();
250955
250992
  init_devboxCore();
250956
250993
  init_claudeSetupOauth();
250994
+ init_controlPlane();
250957
250995
  CLAUDE_TOKEN_RENEWAL_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
250996
+ CLAUDE_LOGIN_RENEWAL_WINDOW_MS = 3 * 24 * 60 * 60 * 1e3;
250958
250997
  trim11 = (value) => value.trim().replace(/\r/g, "");
250959
250998
  formatDate = (value) => typeof value === "number" ? new Date(value).toISOString().slice(0, 10) : "unknown";
250960
250999
  resolveClaudeSetupState = ({
250961
251000
  authMode = null,
251001
+ oauthKind = null,
250962
251002
  hasToken,
250963
251003
  expiresAt,
250964
251004
  lastRuntimeAuthFailureAt,
@@ -250980,7 +251020,7 @@ var init_setupClaude = __esm({
250980
251020
  if (expiresAt <= nowMs) {
250981
251021
  return "expired";
250982
251022
  }
250983
- if (expiresAt <= nowMs + CLAUDE_TOKEN_RENEWAL_WINDOW_MS) {
251023
+ if (expiresAt <= nowMs + (oauthKind === "login" ? CLAUDE_LOGIN_RENEWAL_WINDOW_MS : CLAUDE_TOKEN_RENEWAL_WINDOW_MS)) {
250984
251024
  return "renewal_recommended";
250985
251025
  }
250986
251026
  return "healthy";
@@ -251143,6 +251183,7 @@ var init_setupClaude = __esm({
251143
251183
  };
251144
251184
  ensureManagedClaudeAuth = async ({
251145
251185
  controlPlaneToken,
251186
+ refreshControlPlaneToken: refreshControlPlaneToken2,
251146
251187
  providedClaudeCodeOauthToken = null,
251147
251188
  skipClaudeAuth = false,
251148
251189
  forceReplace = false,
@@ -251150,6 +251191,7 @@ var init_setupClaude = __esm({
251150
251191
  canPromptInteractively,
251151
251192
  fetchClaudeTokenStatusFn,
251152
251193
  storeClaudeCodeOauthTokenFn,
251194
+ storeClaudeLoginFn = storeClaudeLogin,
251153
251195
  collectClaudeCodeOauthTokenInteractivelyFn = collectClaudeCodeOauthTokenInteractively,
251154
251196
  onStatusStage,
251155
251197
  onInteractivePromptStart,
@@ -251161,6 +251203,7 @@ var init_setupClaude = __esm({
251161
251203
  );
251162
251204
  let claudeTokenStatus = {
251163
251205
  authMode: null,
251206
+ oauthKind: null,
251164
251207
  hasToken: false,
251165
251208
  expiresAt: null,
251166
251209
  updatedAt: null,
@@ -251181,15 +251224,19 @@ var init_setupClaude = __esm({
251181
251224
  }
251182
251225
  return { claudeTokenStatus, claudeAuthState, didUpdateClaudeAuth };
251183
251226
  }
251227
+ let currentControlPlaneToken = controlPlaneToken;
251184
251228
  const refreshClaudeStatus = async () => {
251185
251229
  onStatusStage?.("Checking Claude auth");
251186
251230
  try {
251187
- claudeTokenStatus = await fetchClaudeTokenStatusFn(controlPlaneToken);
251231
+ claudeTokenStatus = await fetchClaudeTokenStatusFn(
251232
+ currentControlPlaneToken
251233
+ );
251188
251234
  } catch (error55) {
251189
251235
  onFetchStatusError?.(error55);
251190
251236
  }
251191
251237
  claudeAuthState = resolveClaudeSetupState({
251192
251238
  authMode: claudeTokenStatus.authMode,
251239
+ oauthKind: claudeTokenStatus.oauthKind,
251193
251240
  hasToken: claudeTokenStatus.hasToken,
251194
251241
  expiresAt: claudeTokenStatus.expiresAt,
251195
251242
  lastRuntimeAuthFailureAt: claudeTokenStatus.lastRuntimeAuthFailureAt,
@@ -251200,11 +251247,23 @@ var init_setupClaude = __esm({
251200
251247
  accessToken,
251201
251248
  accountEmail,
251202
251249
  accountUuid,
251203
- organizationUuid
251250
+ organizationUuid,
251251
+ tokenResponse
251204
251252
  }) => {
251205
251253
  onStatusStage?.("Updating Claude auth");
251254
+ currentControlPlaneToken = await refreshControlPlaneToken2();
251255
+ if (tokenResponse) {
251256
+ await storeClaudeLoginFn(currentControlPlaneToken, tokenResponse, {
251257
+ accountEmail,
251258
+ accountUuid,
251259
+ organizationUuid
251260
+ });
251261
+ didUpdateClaudeAuth = true;
251262
+ await refreshClaudeStatus();
251263
+ return;
251264
+ }
251206
251265
  const stored = await storeClaudeCodeOauthTokenFn(
251207
- controlPlaneToken,
251266
+ currentControlPlaneToken,
251208
251267
  accessToken,
251209
251268
  {
251210
251269
  accountEmail,
@@ -251228,7 +251287,8 @@ var init_setupClaude = __esm({
251228
251287
  accountEmail: null,
251229
251288
  accountUuid: null,
251230
251289
  organizationUuid: null,
251231
- source: "existing_token"
251290
+ source: "existing_token",
251291
+ tokenResponse: null
251232
251292
  });
251233
251293
  return { claudeTokenStatus, claudeAuthState, didUpdateClaudeAuth };
251234
251294
  }
@@ -251353,7 +251413,7 @@ var init_accounts = __esm({
251353
251413
  redirectUrl: signIn.redirectUrl,
251354
251414
  state
251355
251415
  });
251356
- await storeClaudeCodeOauthToken(controlPlaneToken, exchange.accessToken, {
251416
+ await storeClaudeLogin(controlPlaneToken, exchange.tokenResponse, {
251357
251417
  accountEmail: exchange.emailAddress,
251358
251418
  accountUuid: exchange.accountUuid,
251359
251419
  organizationUuid: exchange.organizationUuid
@@ -280888,6 +280948,7 @@ var init_setupAgents = __esm({
280888
280948
  codingAgentSelectionsEqual = (left, right) => left.codex === right.codex && left.claudeCode === right.claudeCode;
280889
280949
  DEFAULT_CLAUDE_TOKEN_STATUS = {
280890
280950
  authMode: null,
280951
+ oauthKind: null,
280891
280952
  hasToken: false,
280892
280953
  expiresAt: null,
280893
280954
  updatedAt: null,
@@ -280980,6 +281041,7 @@ var init_setupAgents = __esm({
280980
281041
  storeClaudeCodeOauthTokenFn = storeClaudeCodeOauthToken,
280981
281042
  clearClaudeCodeOauthTokenFn = clearClaudeCodeOauthToken,
280982
281043
  ensureControlPlaneTokenFn = ensureControlPlaneToken,
281044
+ ensureExistingControlPlaneTokenFn = ensureExistingControlPlaneToken,
280983
281045
  validateManagedCodexAuthFn = validateManagedCodexAuth,
280984
281046
  loginManagedCodexFn = loginManagedCodex,
280985
281047
  clearManagedCodexAuthFn = clearManagedCodexAuth
@@ -281061,6 +281123,13 @@ var init_setupAgents = __esm({
281061
281123
  }
281062
281124
  const outcome = await ensureManagedClaudeAuthFn({
281063
281125
  controlPlaneToken: skipClaudeAuth ? controlPlaneToken : await ensureControlPlaneTokenForAgents(),
281126
+ refreshControlPlaneToken: async () => {
281127
+ controlPlaneToken = await ensureExistingControlPlaneTokenFn(
281128
+ store,
281129
+ onStatusStage
281130
+ );
281131
+ return controlPlaneToken;
281132
+ },
281064
281133
  providedClaudeCodeOauthToken,
281065
281134
  skipClaudeAuth,
281066
281135
  forceReplace: shouldForceReplaceClaudeAuth,
@@ -288484,6 +288553,7 @@ var init_agentsSection = __esm({
288484
288553
  status,
288485
288554
  pathSetup,
288486
288555
  controlPlaneToken,
288556
+ refreshControlPlaneToken: refreshControlPlaneToken2,
288487
288557
  usesCodex,
288488
288558
  shouldProbeRemoteCodexAuth,
288489
288559
  shouldBootstrapManagedLocalCodexAuthFromRemote,
@@ -288536,6 +288606,7 @@ var init_agentsSection = __esm({
288536
288606
  let nextPendingManagedClaudeTokenUpdate = pendingManagedClaudeTokenUpdate;
288537
288607
  claudeAuthOutcome = await ensureManagedClaudeAuthFn({
288538
288608
  controlPlaneToken,
288609
+ refreshControlPlaneToken: refreshControlPlaneToken2,
288539
288610
  skipClaudeAuth: !usesClaudeCode,
288540
288611
  requireSetupConfirmation: false,
288541
288612
  canPromptInteractively,
@@ -289161,7 +289232,8 @@ var init_init = __esm({
289161
289232
  return {
289162
289233
  config: config5,
289163
289234
  relayBaseUrl,
289164
- controlPlaneToken
289235
+ controlPlaneToken,
289236
+ store
289165
289237
  };
289166
289238
  }
289167
289239
  });
@@ -289551,6 +289623,7 @@ var init_init = __esm({
289551
289623
  }
289552
289624
  const config5 = runtime.config;
289553
289625
  const controlPlaneToken = runtime.controlPlaneToken;
289626
+ const refreshControlPlaneToken2 = async () => await ensureExistingControlPlaneToken(runtime.store);
289554
289627
  const managedDaemonTarget = resolveManagedDaemonTarget();
289555
289628
  await runInitStep({
289556
289629
  enabled: progressEnabled,
@@ -289558,6 +289631,7 @@ var init_init = __esm({
289558
289631
  fn: async ({ status, ok }) => {
289559
289632
  claudeAuthOutcome = await ensureManagedClaudeAuth({
289560
289633
  controlPlaneToken,
289634
+ refreshControlPlaneToken: refreshControlPlaneToken2,
289561
289635
  skipClaudeAuth: !usesClaudeCode,
289562
289636
  requireSetupConfirmation: false,
289563
289637
  canPromptInteractively,
@@ -289920,6 +289994,7 @@ var init_init = __esm({
289920
289994
  status,
289921
289995
  pathSetup,
289922
289996
  controlPlaneToken,
289997
+ refreshControlPlaneToken: refreshControlPlaneToken2,
289923
289998
  usesCodex,
289924
289999
  shouldProbeRemoteCodexAuth,
289925
290000
  shouldBootstrapManagedLocalCodexAuthFromRemote: codexExecutionPreparation.shouldBootstrapLocalAuthFromRemote,
@@ -297280,4 +297355,4 @@ react/cjs/react-jsx-runtime.development.js:
297280
297355
  *)
297281
297356
  */
297282
297357
 
297283
- //# debugId=a9f47e29-7959-5442-80a0-659295eee021
297358
+ //# debugId=839be569-0d96-58c6-b81d-d57585ce022a
package/dist/bin/dvbd.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]="69a5c6a9-80c5-56fe-a38e-2b80f6682217")}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]="6aa06b37-c4ab-5e7c-8473-071b4c6c723a")}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";
@@ -64674,9 +64674,9 @@ var init_sentry = __esm({
64674
64674
  uncaughtExceptionMonitorInstalled = false;
64675
64675
  currentDevboxSentryUser = null;
64676
64676
  readBuildMetadata = () => {
64677
- const rawPackageVersion = "1.0.1066";
64678
- const rawGitSha = "264816c4f2dbdb6e253743fa1b1c9220d63d69e2";
64679
- const rawSentryRelease = "boxes-dev-dvb@1.0.1066+264816c4f2dbdb6e253743fa1b1c9220d63d69e2";
64677
+ const rawPackageVersion = "1.0.1067";
64678
+ const rawGitSha = "5b600df1098728373e216a3fc68035049a1a1ed8";
64679
+ const rawSentryRelease = "boxes-dev-dvb@1.0.1067+5b600df1098728373e216a3fc68035049a1a1ed8";
64680
64680
  const packageVersion = typeof rawPackageVersion === "string" ? rawPackageVersion : void 0;
64681
64681
  const gitSha = typeof rawGitSha === "string" ? rawGitSha : void 0;
64682
64682
  const sentryRelease = typeof rawSentryRelease === "string" ? rawSentryRelease : void 0;
@@ -66893,7 +66893,7 @@ var init_packageVersion = __esm({
66893
66893
  return path8.join(process.cwd(), "dvb");
66894
66894
  };
66895
66895
  readEmbeddedPackageVersion = () => {
66896
- const raw = "1.0.1066";
66896
+ const raw = "1.0.1067";
66897
66897
  return trimVersion(raw);
66898
66898
  };
66899
66899
  readNearestPackageMetadata = (basePath) => {
@@ -80046,4 +80046,4 @@ smol-toml/dist/index.js:
80046
80046
  *)
80047
80047
  */
80048
80048
 
80049
- //# debugId=69a5c6a9-80c5-56fe-a38e-2b80f6682217
80049
+ //# debugId=6aa06b37-c4ab-5e7c-8473-071b4c6c723a
@@ -351,7 +351,11 @@ Configure agents in the desktop app. Each agent has its own list of saved
351
351
  logins and API keys, and the checked row is the one your devboxes use. Tap
352
352
  **Add** beside an agent to sign in or save an API key. Tap a saved row to
353
353
  choose **Use this account**, **Re-authenticate** or **Edit API key**, **Check
354
- now**, or **Remove**.
354
+ now**, or **Remove**. An older Claude account labeled **Setup token** offers
355
+ **Switch to claude.ai login** instead of **Re-authenticate**. Once a claude.ai
356
+ login is saved, the **Allow claude.ai connectors** switch below the Claude
357
+ accounts controls whether new Claude sessions can use the connectors added on
358
+ claude.ai.
355
359
 
356
360
  To sign in to Codex, tap **Log in with ChatGPT**. The app shows a one-time
357
361
  code, and **Open ChatGPT** copies it and opens the ChatGPT device sign-in page.
@@ -363,10 +367,13 @@ approve access. Claude will show a code; copy it, return to the app, paste it,
363
367
  and tap **Continue**. Closing either sign-in cancels it.
364
368
 
365
369
  When the active Codex or Claude account needs you to sign in again, or its API
366
- key was rejected, a banner appears at the top of the app. **Reconnect** opens
367
- that agent's sign-in, or opens Agent accounts when both agents need attention
368
- or a key needs replacing. Dismissing the banner hides it until the app restarts
369
- or another account starts failing.
370
+ key was rejected, a banner appears at the top of the app. A claude.ai login
371
+ also shows one three days before its sign-in deadline, which comes about
372
+ every four weeks. **Reconnect**
373
+ opens that agent's sign-in, or opens Agent accounts when both agents need
374
+ attention or a key needs replacing. Dismissing the banner hides it until the
375
+ app restarts or another account starts failing; dismissing a sign-in reminder
376
+ does not hide a later failure.
370
377
 
371
378
  ## Mobile Versus Desktop
372
379
 
@@ -396,6 +396,27 @@ devboxes. On macOS, Configure agents is in the boxes.dev app menu. Saving a new
396
396
  API key does not replace a working subscription that is already selected; the
397
397
  user selects the key to switch to it.
398
398
 
399
+ **Log in with Claude** saves a claude.ai login, the same kind of sign-in
400
+ Claude Code gets from `/login` on a computer. Claude on Template boxes and
401
+ devboxes then has the account's claude.ai features: skills and plugins synced
402
+ from claude.ai and the connectors the user added there, such as Gmail.
403
+ boxes.dev keeps the sign-in current, but Claude requires a new sign-in about
404
+ every four weeks; Claude sets the exact date at each sign-in. Three days
405
+ before that deadline, the account's row shows **Sign in again by** a date and
406
+ the mobile app shows a reminder banner; after it passes, Claude reports that
407
+ the sign-in expired until the user signs in again. Accounts connected before claude.ai logins were available show
408
+ **Setup token**. They keep working without claude.ai features, and the row's
409
+ **Switch to claude.ai login** action signs in again and converts that saved
410
+ account to a claude.ai login. An older account saved without a Claude account
411
+ ID gets a new row for the login instead, which becomes active; the user can
412
+ then remove the old row. Claude API keys are unchanged.
413
+
414
+ Once a claude.ai login is saved, Configure agents and mobile Agent accounts
415
+ show **Allow claude.ai connectors**, which is on by default. Turning it off
416
+ keeps claude.ai connectors out of new Claude sessions, including automation
417
+ and Slack runs that use the account; synced skills and plugins still load.
418
+ Sessions that are already running keep their connectors until they restart.
419
+
399
420
  Each saved subscription row in desktop Configure agents shows a small bar for
400
421
  the weekly limit's remaining usage. A 5-hour bar appears below it only when
401
422
  that limit is low (below 20% left) or the account has no weekly limit. Hovering
@@ -102,6 +102,14 @@ key, depending on the agent. boxes.dev runs the real agent tools the user
102
102
  authorizes; it does not replace them with a separate model account. If an agent
103
103
  auth flow is broken or stale, users can reconnect from Configure agents.
104
104
 
105
+ For a claude.ai login, boxes.dev keeps the login's long-lived renewal
106
+ credential and renews the sign-in centrally. Template boxes and devboxes
107
+ receive only Claude's current short-lived access, written where Claude Code
108
+ reads its own login. A claude.ai login also lets Claude use the connectors the
109
+ user added on claude.ai, such as Gmail, so an agent on a box can reach those
110
+ services; **Allow claude.ai connectors** in Configure agents or Agent accounts
111
+ turns that off for new sessions.
112
+
105
113
  Agent credentials should be treated like other development credentials. If a
106
114
  user no longer wants an agent credential available in boxes.dev, they should
107
115
  disconnect or rotate it through the relevant agent account and
@@ -154,7 +154,8 @@ usage. It does not copy either teammate's existing devbox filesystem.
154
154
 
155
155
  An allowed teammate's request has the same reach as the owner's own request:
156
156
  the agent can use anything the owner's devbox can reach, including code,
157
- credentials, and connected accounts. Owners should allow only teammates they
157
+ credentials, and connected accounts, such as the owner's claude.ai connectors
158
+ when Claude uses a claude.ai login. Owners should allow only teammates they
158
159
  would trust with that access, including on named commands that allow
159
160
  teammates.
160
161
 
@@ -159,6 +159,15 @@ Codex can be connected through ChatGPT login or an API key. Claude can be
159
159
  connected through Claude login or an API key. After reconnecting, retry the
160
160
  thread or start a new one.
161
161
 
162
+ Likewise, do not run `/login` or `/logout` in Claude on a managed machine:
163
+ boxes.dev manages Claude's sign-in there. A claude.ai login needs a new
164
+ sign-in about every four weeks; reconnect it from Configure agents or Agent
165
+ accounts when the reminder appears. If Claude on a box lacks the skills,
166
+ plugins, or connectors you have on claude.ai, check that the active Claude
167
+ account says **claude.ai login** rather than **Setup token** (use **Switch to
168
+ claude.ai login** from its menu) and, for connectors, that **Allow claude.ai
169
+ connectors** is on. Start a new Claude session after changing either.
170
+
162
171
  If an MCP server needs auth, open **Integrations → MCPs** and use the agent chip
163
172
  on that connection. In a project with a Template box, MCP servers installed
164
173
  directly there are under **Template-managed MCPs** in the same place. Team
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxes-dev/dvb-runtime",
3
- "version": "1.0.1066",
3
+ "version": "1.0.1067",
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-11T01:33:37Z"
80
+ "devboxReleasedAt": "2026-10-11T03:12:02Z"
81
81
  }