zidane 7.1.3 → 7.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/{acp-B5UfEhMd.js → acp-DbYGzaVK.js} +2 -2
  2. package/dist/{acp-B5UfEhMd.js.map → acp-DbYGzaVK.js.map} +1 -1
  3. package/dist/acp-cli.js +4 -4
  4. package/dist/acp.d.ts +1 -1
  5. package/dist/acp.js +1 -1
  6. package/dist/{agent-_xxElOgH.js → agent-BlGt76qk.js} +4 -53
  7. package/dist/agent-BlGt76qk.js.map +1 -0
  8. package/dist/agent.d.ts +1 -1
  9. package/dist/agent.js +1 -1
  10. package/dist/{anthropic-DPPs3wjJ.js → anthropic-BQdAnY-w.js} +2 -2
  11. package/dist/{anthropic-DPPs3wjJ.js.map → anthropic-BQdAnY-w.js.map} +1 -1
  12. package/dist/{approvals-u2T19Dc-.js → approvals-BznYVVGD.js} +137 -42
  13. package/dist/{approvals-u2T19Dc-.js.map → approvals-BznYVVGD.js.map} +1 -1
  14. package/dist/{auth-HRKkOErn.js → auth-DvMdkpGD.js} +245 -82
  15. package/dist/{auth-HRKkOErn.js.map → auth-DvMdkpGD.js.map} +1 -1
  16. package/dist/chat/pure.d.ts +4 -4
  17. package/dist/chat/pure.js +3 -3
  18. package/dist/chat.d.ts +6 -6
  19. package/dist/chat.js +6 -6
  20. package/dist/contexts/daytona.d.ts +1 -1
  21. package/dist/contexts/e2b.d.ts +1 -1
  22. package/dist/{context-segments-BrEsRhA0.js → cred-keys-BbbBr4q3.js} +104 -2
  23. package/dist/cred-keys-BbbBr4q3.js.map +1 -0
  24. package/dist/daemon-cli.js +2 -1
  25. package/dist/daemon-cli.js.map +1 -1
  26. package/dist/eval.d.ts +1 -1
  27. package/dist/extensions.d.ts +1 -1
  28. package/dist/extensions.js +1 -1
  29. package/dist/headless.d.ts +1 -1
  30. package/dist/headless.js +1 -1
  31. package/dist/{index-D3TTaaQ5.d.ts → index-D9ntsW7o.d.ts} +20 -198
  32. package/dist/index-D9ntsW7o.d.ts.map +1 -0
  33. package/dist/{index-DZhrTn-v.d.ts → index-Dw8ruU-j.d.ts} +37 -9
  34. package/dist/index-Dw8ruU-j.d.ts.map +1 -0
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.js +4 -4
  37. package/dist/{ipc-ChQeueur.js → ipc-CNrpBs9P.js} +2 -2
  38. package/dist/{ipc-ChQeueur.js.map → ipc-CNrpBs9P.js.map} +1 -1
  39. package/dist/ipc.d.ts +28 -6
  40. package/dist/ipc.d.ts.map +1 -1
  41. package/dist/ipc.js +4 -4
  42. package/dist/mcp.d.ts +1 -1
  43. package/dist/{oauth-B6F43fti.js → oauth-DxHO17JE.js} +10 -8
  44. package/dist/{oauth-B6F43fti.js.map → oauth-DxHO17JE.js.map} +1 -1
  45. package/dist/output/stream-json.d.ts +1 -1
  46. package/dist/output/terminal.d.ts +1 -1
  47. package/dist/plugins.d.ts +1 -1
  48. package/dist/presets.d.ts +1 -1
  49. package/dist/presets.js +1 -1
  50. package/dist/providers/anthropic.d.ts +1 -1
  51. package/dist/providers/anthropic.js +1 -1
  52. package/dist/providers/arcee.d.ts +1 -1
  53. package/dist/providers/baseten.d.ts +1 -1
  54. package/dist/providers/cerebras.d.ts +1 -1
  55. package/dist/providers/local.d.ts +1 -1
  56. package/dist/providers/openai-compat.d.ts +1 -1
  57. package/dist/providers/openai.d.ts +1 -1
  58. package/dist/providers/openai.js +1 -1
  59. package/dist/providers/openrouter.d.ts +1 -1
  60. package/dist/providers/xai.d.ts +1 -1
  61. package/dist/providers/xai.js +1 -1
  62. package/dist/{providers-DP9kwXYo.js → providers-BVhnFyiY.js} +2 -2
  63. package/dist/{providers-DP9kwXYo.js.map → providers-BVhnFyiY.js.map} +1 -1
  64. package/dist/providers.d.ts +1 -1
  65. package/dist/providers.js +3 -3
  66. package/dist/restate.d.ts +1 -1
  67. package/dist/restate.js +1 -1
  68. package/dist/session/sqlite.d.ts +1 -1
  69. package/dist/session.d.ts +1 -1
  70. package/dist/{server-CTUpOdh3.js → shell-path-3tZ2lyQ2.js} +95 -9
  71. package/dist/shell-path-3tZ2lyQ2.js.map +1 -0
  72. package/dist/skills.d.ts +1 -1
  73. package/dist/{tool-formatters-C5s88MUd.d.ts → tool-formatters-CJoSmRjH.d.ts} +83 -3
  74. package/dist/tool-formatters-CJoSmRjH.d.ts.map +1 -0
  75. package/dist/tools/fetch-url.d.ts +1 -1
  76. package/dist/tools/web-search.d.ts +1 -1
  77. package/dist/tools.d.ts +1 -1
  78. package/dist/tools.js +1 -1
  79. package/dist/{transcript-anchors-DxofXw_y.d.ts → transcript-anchors-nWzUc3WT.d.ts} +201 -3
  80. package/dist/transcript-anchors-nWzUc3WT.d.ts.map +1 -0
  81. package/dist/tui.d.ts +20 -6
  82. package/dist/tui.d.ts.map +1 -1
  83. package/dist/tui.js +388 -58
  84. package/dist/tui.js.map +1 -1
  85. package/dist/{turn-operations-BaQnxzhr.d.ts → turn-operations-GRw5vbtr.d.ts} +34 -4
  86. package/dist/{turn-operations-BaQnxzhr.d.ts.map → turn-operations-GRw5vbtr.d.ts.map} +1 -1
  87. package/dist/{turn-operations-6JDu2ewy.js → turn-operations-JynC5ODZ.js} +31 -3
  88. package/dist/{turn-operations-6JDu2ewy.js.map → turn-operations-JynC5ODZ.js.map} +1 -1
  89. package/dist/types.d.ts +1 -1
  90. package/docs/CHAT.md +10 -0
  91. package/docs/TUI.md +1 -1
  92. package/package.json +1 -1
  93. package/dist/agent-_xxElOgH.js.map +0 -1
  94. package/dist/context-segments-BrEsRhA0.js.map +0 -1
  95. package/dist/index-D3TTaaQ5.d.ts.map +0 -1
  96. package/dist/index-DZhrTn-v.d.ts.map +0 -1
  97. package/dist/server-CTUpOdh3.js.map +0 -1
  98. package/dist/tool-formatters-C5s88MUd.d.ts.map +0 -1
  99. package/dist/transcript-anchors-DxofXw_y.d.ts.map +0 -1
package/dist/tui.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { C as estimateRebilledCostUsd } from "./openai-compat-Dy56weK8.js";
2
2
  import { n as THINKING_LEVELS } from "./types-CWgENVLY.js";
3
- import { t as buildContextSegments } from "./context-segments-BrEsRhA0.js";
4
- import { $ as ExtensionInstallError, $n as effectiveContextWindow, A as buildPostCompactAttachments, Bn as artifactKindLabel, C as rehomePersistedStubs, Cn as parseExtensionScanPathEnv, Ct as basic_default, D as resolvePersistDir, E as resolveMcpWarningsDir, En as setDebugLogSink, Jn as renderArtifactRow, Ln as createExtensionBus, Lt as tailTruncate, M as selectFilesFromSession, Nn as resolveExtensionConfigValue, O as resolveSessionDir, P as compactConversation, Pn as sanitizeExtensionConfigActionPatch, Q as createExtensionPromptBridge, Qn as OUTPUT_RESERVE_TOKENS, T as resolveLegacySessionDir, Tn as createDebugLog, Vt as createModelSearchTool, Xt as artifacts_default, _n as registerExtensionHostModules, an as groupBindings, at as removeInstalledExtension, b as cleanupPersistedSession, bt as composePresets, ct as discoverAndBuildExtensionRegistry, dt as composeExtensionPreset, f as applyCompactSummaryCutoff, fn as resolveExtensionKeybindings, ft as disposeExtensionRegistry, gt as partitionExtensionCatalog, in as formatBindingForDisplay, k as resolveTasksDir, kn as coerceExtensionConfigInput, kt as isSpawnTool, mt as filterRegistryPlugins, nn as KEYBINDING_KEY_COL_WIDTH, on as keybindingsPath, ot as updateInstalledExtension, pt as filterExtensionRegistry, q as summaryToTurn, qn as refreshArtifact, rn as ensureKeybindingsFile, sn as matchesBinding, st as createExtensionHud, t as createAgent, tt as installExtensionFromSpec, vt as createExtensionHostRuntimeBridge, w as resolveLegacyPersistDir, wn as scanExtensionDirectories, xn as inlineLoadedExtension, zt as looksBinary } from "./agent-_xxElOgH.js";
3
+ import { d as buildContextSegments, i as DEFAULT_OAUTH_ACCOUNT_LABEL, u as oauthAccountLabel } from "./cred-keys-BbbBr4q3.js";
4
+ import { $ as ExtensionInstallError, A as buildPostCompactAttachments, An as resolveExtensionConfigValue, C as rehomePersistedStubs, Cn as setDebugLogSink, Ct as basic_default, D as resolvePersistDir, E as resolveMcpWarningsDir, En as coerceExtensionConfigInput, Gn as renderArtifactRow, Ln as artifactKindLabel, Lt as tailTruncate, M as selectFilesFromSession, O as resolveSessionDir, P as compactConversation, Pn as createExtensionBus, Q as createExtensionPromptBridge, Sn as createDebugLog, T as resolveLegacySessionDir, Vt as createModelSearchTool, Wn as refreshArtifact, Xn as effectiveContextWindow, Xt as artifacts_default, Yn as OUTPUT_RESERVE_TOKENS, an as groupBindings, at as removeInstalledExtension, b as cleanupPersistedSession, bn as parseExtensionScanPathEnv, bt as composePresets, ct as discoverAndBuildExtensionRegistry, dt as composeExtensionPreset, f as applyCompactSummaryCutoff, fn as resolveExtensionKeybindings, ft as disposeExtensionRegistry, gt as partitionExtensionCatalog, in as formatBindingForDisplay, jn as sanitizeExtensionConfigActionPatch, k as resolveTasksDir, kt as isSpawnTool, mn as registerExtensionHostModules, mt as filterRegistryPlugins, nn as KEYBINDING_KEY_COL_WIDTH, on as keybindingsPath, ot as updateInstalledExtension, pt as filterExtensionRegistry, q as summaryToTurn, rn as ensureKeybindingsFile, sn as matchesBinding, st as createExtensionHud, t as createAgent, tt as installExtensionFromSpec, vn as inlineLoadedExtension, vt as createExtensionHostRuntimeBridge, w as resolveLegacyPersistDir, xn as scanExtensionDirectories, zt as looksBinary } from "./agent-BlGt76qk.js";
5
5
  import { D as shouldAutoGenerateTitle, E as generateSessionTitle, F as parseCommandInvocation, M as commandBlocksToContent, P as executeCommand, S as resolveInlineSuggestion, a as loginMcpServer, b as createPathAutocompleteProvider, c as SKILL_EDIT_METADATA_KEY, g as readSkillEditMarker, h as extensionScaffold, j as commandBlockToEvent, l as ZIDANE_EXTENSION_SKILL_NAME, m as extensionDirForCwd, p as editSessionMetadata, u as ZIDANE_SKILL_EDIT_SKILL_NAME, v as withZidaneExtensionSkill, w as generateStructuredData, x as patchInlineGhost, y as withZidaneSkillEditSkill } from "./src-CkNQKFKr.js";
6
6
  import { a as formatDuration, c as previewLine, i as fmtTokens, l as shortId, n as compactPath, o as formatTaskStatus, r as fmtCost, s as formatTaskSummary, t as ageString } from "./format-BF745pLL.js";
7
7
  import { i as killProcessGroup, n as SUPPORTS_PROCESS_GROUPS, r as createProcessContext } from "./contexts-CRE9pw07.js";
@@ -19,11 +19,11 @@ import { s as withTimeout } from "./timeout-CjOG2mea.js";
19
19
  import { i as installCacheBreakLogger } from "./cache-telemetry-ehVdWsg2.js";
20
20
  import { s as resolveCompletionSubmit } from "./completion-core-BRo86R_L.js";
21
21
  import { n as JsonRpcRemoteError, t as JsonRpcConnectionClosedError } from "./json-rpc-rSWMUh9b.js";
22
- import { $ as providerKeySetChanged, $t as formatRunReceiptLine, A as chunkMarkdownForRender, C as usageTone, Cn as summarizeOutcomes, Dt as selectionAfterTurnRemoval, E as filterModelCatalog, En as createChatsCompletionProvider, Et as selectableTurnIds, F as stripHtmlCommentsOutsideCode, Gt as sessionEventMeta, Ht as sessionDirLabel, I as cacheBreakChip, K as chainPositionOf, Kt as shortSessionId, Lt as isMainSession, M as codeTokenHasClosingFence, N as normalizeMarkdownCodeFences, Nt as SESSION_EVENT_STATUS_STYLE, O as parseCustomModelQuery, Ot as streamEventSearchText, P as splitMarkdownCodeBlocks, Qt as formatRunReceiptCells, R as compactingLabel, S as resetLabel, Sn as stripEditOutcomesAnnotation, St as promptHistoryFromEvents, T as buildModelCatalog, Tt as retagUserPromptEventsFromRefs, U as DAEMON_HEALTH_STYLE, Ut as sessionEventExcerpt, V as streamingLabel, W as buildRunModel, X as pickChainPrimary, Xt as formatCostUsd, Y as filterChainFallbacks, Yt as fitRunReceiptCells, _ as turnContextSize, _t as isEditErrorResult, a as TOOL_DISPLAY, an as buildContextualDiff, b as formatUsagePercent, bn as resolveApprovalForPayload, bt as isVisible, d as finalizeStreamingMarkdown, dn as filetypeFromPath, en as formatTokenCount, et as reorderKeyed, f as finalizeStreamingMarkdownForOwner, fn as previewEditPayload, ft as createCommandsCompletionProvider, g as revealEarlierTranscriptEvents, gn as buildEditOutcomesAnnotation, gt as EDIT_TOOL_NAMES, h as replaceTranscriptTurnEvents, ht as BASH_CALL_ID_PREFIX, i as turnAsText, j as closeDanglingCodeFence, kt as turnSelectionOwnership, lt as createFilesCompletionProvider, mn as summarizeEditPayload, mt as buildLinearRamp, n as deleteTurnSafely, nn as hasRunReceipt, o as displayNameFor, on as buildUnifiedDiff, ot as createSkillsCompletionProvider, p as hiddenEarlierTranscriptCount, pt as blendHsl, q as chainsEqual, qt as truncateTitle, r as truncateTurnsAt, rn as runReceiptFromRun, rt as toggleChainEntry, s as formatToolCall, sn as clipDiffForRender, st as uniqueSkillNamesFromReferences, tt as restoreChainFallbacks, u as capTranscriptEvents, un as extractEditPayload, v as formatBalance, vn as mergeApprovalAndBodyOutcomes, vt as isTurnHighlighted, w as splitPromptSegments, wt as retagUserPromptEvents, x as mostConstrainedWindow, xn as rewriteMultiEditHeader, xt as isVisibleDuringSearch, yn as parseEditOutcomesFromResult, yt as isUserBashEvent, z as liveSessionCost } from "./turn-operations-6JDu2ewy.js";
22
+ import { $ as pickChainPrimary, $t as formatCostUsd, At as selectionAfterTurnRemoval, Bt as isMainSession, C as resetLabel, Cn as resolveApprovalForPayload, Ct as isVisible, D as splitPromptSegments, Dt as retagUserPromptEvents, E as usageTone, En as summarizeOutcomes, F as codeTokenHasClosingFence, Gt as sessionDirLabel, H as liveSessionCost, I as normalizeMarkdownCodeFences, It as SESSION_EVENT_STATUS_STYLE, Jt as sessionEventMeta, K as DAEMON_HEALTH_STYLE, Kt as sessionEventExcerpt, L as splitMarkdownCodeBlocks, Mt as turnSelectionOwnership, N as chunkMarkdownForRender, O as buildModelCatalog, Ot as retagUserPromptEventsFromRefs, P as closeDanglingCodeFence, Q as filterChainFallbacks, Qt as fitRunReceiptCells, R as stripHtmlCommentsOutsideCode, S as mostConstrainedWindow, Sn as parseEditOutcomesFromResult, St as isUserBashEvent, T as updatedLabel, Tn as stripEditOutcomesAnnotation, Tt as promptHistoryFromEvents, V as compactingLabel, W as streamingLabel, X as chainsEqual, Xt as truncateTitle, Y as chainPositionOf, Yt as shortSessionId, _ as turnContextSize, _n as summarizeEditPayload, _t as buildLinearRamp, a as TOOL_DISPLAY, an as hasRunReceipt, bt as isEditErrorResult, cn as buildContextualDiff, d as finalizeStreamingMarkdown, f as finalizeStreamingMarkdownForOwner, ft as createFilesCompletionProvider, g as revealEarlierTranscriptEvents, gt as blendHsl, h as replaceTranscriptTurnEvents, hn as previewEditPayload, ht as createCommandsCompletionProvider, i as turnAsText, it as restoreChainFallbacks, j as parseCustomModelQuery, jt as streamEventSearchText, k as filterModelCatalog, kn as createChatsCompletionProvider, kt as selectableTurnIds, ln as buildUnifiedDiff, lt as createSkillsCompletionProvider, mn as filetypeFromPath, n as deleteTurnSafely, nn as formatRunReceiptLine, nt as providerKeySetChanged, o as displayNameFor, on as runReceiptFromRun, ot as toggleChainEntry, p as hiddenEarlierTranscriptCount, pn as extractEditPayload, q as buildRunModel, r as truncateTurnsAt, rn as formatTokenCount, rt as reorderKeyed, s as formatToolCall, tn as formatRunReceiptCells, u as capTranscriptEvents, un as clipDiffForRender, ut as uniqueSkillNamesFromReferences, vt as BASH_CALL_ID_PREFIX, w as showsAccount, wn as rewriteMultiEditHeader, wt as isVisibleDuringSearch, x as formatUsagePercent, xn as mergeApprovalAndBodyOutcomes, xt as isTurnHighlighted, y as formatBalance, yn as buildEditOutcomesAnnotation, yt as EDIT_TOOL_NAMES, z as cacheBreakChip } from "./turn-operations-JynC5ODZ.js";
23
23
  import { a as searchHighlightRanges, c as searchSessionHistoryIndexAsync, i as highlightSegments, n as buildSessionSearchIndexAsync, r as filterSessionSearchCatalog, u as searchSessionIndexAsync } from "./history-search-C4bk1Wz_.js";
24
- import { $ as supportsOAuth, $t as parsePluginScanPathEnv, A as useSafeModeQueue, Ai as listSessionMeta, Ar as chatWindowBehavior, At as useInteractionsActions, Bi as toolResultText, Bn as resolveStoragePaths, Cn as resolveTheme, Ct as createAutomaticInteractionResponse, Di as eventsFromTurns, Dt as makeRequestInteraction, Ei as deriveSessionTitle, Et as isModelInteraction, Fi as serverToolResultSummary, Fn as useDiscovery, Ft as installProviderDiagnosticHook, G as usageChecksOptedOut, Gn as countClaudeSessionFiles, H as fetchAllProviderUsage, Hi as usageByModel, Hn as createArtifactsCompletionProvider, Ht as applyThinkingBindingSetting, Ii as stripSpawnTokensLine, In as useDiscoveryOptional, J as fetchOAuthRedirect, Jn as mcpsWritePath, Jr as TODO_STATUS_GLYPHS, Kn as hasClaudeCodeSetup, Kt as resolveSandboxFromSettings, Li as sumRunCosts, Ln as ConfigProvider, M as addToSafelist, Mi as marginTopFor, Mn as quoteForShell, N as getSafelist, Ni as noticeTurnContent, Nn as createDiscoverySlot, Nr as discoverAgentsMd, O as SafeModeProvider, Oi as getSessionMeta, Ot as pendingInteractionsFromTurns, P as isOnSafelist, Pn as DiscoveryProvider, Q as runOAuthLogin, Qn as dedupMcpServersByName, Qt as discoverProjectPlugins, R as suggestSafelistEntries, Rn as useConfig, Si as createChatTurnsReadTool, Sn as resolveChipColor, St as buildResumedToolResultsTurn, U as fetchProviderUsage, Ut as createMainSession, V as clearProviderUsageCache, Vi as updateToolEventOutcomes, Vr as accentColor, Vt as createBuiltinCommands, W as providerUsageSupported, Wn as useCompletion, Wt as modelChainMetadata, X as redirectUriFromAuthUrl, Xn as upsertMcpServer, Xr as applyTodosSnapshot, Xt as runEndNotice, Yn as removeMcpServer, Z as oauthUsesManualCodePaste, Zn as buildMcpServers, Zt as buildPluginContributions, _ as buildSpawnEndEvent, _n as clampFps, _t as ASK_USER_TOOL, ai as setTodosForRun, an as hintsLength, ar as bootTick, at as subscribeMcpToolsCache, b as defaultSkillScanPaths, bi as envSection, bt as InteractionsProvider, c as useSelectStyle, cr as buildUpdateHint, d as useTheme, dn as DEFAULT_SETTINGS, dt as parentServerName, en as attachMcpWarnLog, er as discoverProjectMcps, f as discoverSystemMd, fn as SETTINGS_CATEGORIES, ft as McpAuthProvider, g as useStreamBuffer, gn as SettingsProvider, gr as useRestartRequired, h as userSystemMdPath, hn as SETTINGS_TOGGLES, ht as getMcpAuthStatus, ii as selectActiveTodos, in as clipHintsToWidth, ji as loadState, jn as parseEditorCommand, jr as groupArtifacts, jt as useInteractionsQueue, k as useSafeModeActions, ki as lastContextSizeFromTurns, l as useSurfaces, ln as listProjectFiles, lr as useUpdateCheck, lt as buildVisibleMcpRows, m as userScopeOverridesLoad, mn as SETTINGS_INPUTS, mt as useMcpAuthState, ni as pruneTodosByRun, nr as tryOpenBrowser, nt as mcpToolsCachePath, o as ThemeProvider, oi as todoProgressLabel, on as truncateTrailing, p as renderSystemMdSeed, pn as SETTINGS_CHOICES, pt as useMcpAuthDispatch, q as formatPathForCwd, qn as importFromClaudeCode, qt as createFileMcpCredentialStore, r as computeTurnAnchors, rn as EMPTY_HINTS, rr as tryRevealPath, rt as refreshMcpToolsCatalog, s as useColors, si as useActiveTodos, sn as buildHints, sr as buildRestartHint, st as useMcpToolToggleMap, ti as pickActiveRunId, tt as loadMcpToolsCache, un as useEnabledToggleSet, ut as indexOfServerRow, v as buildSpawnStartEvent, vi as buildBuildSystem, w as writeSessionExport, wi as compactSummaryEvent, wt as createInteractionTools, x as discoverProjectSkills, xi as chatReferenceTokensForPrompt, xt as PRESENT_PLAN_TOOL, y as buildSkillsConfig, yi as buildPlanSystem, yn as useSettings, yt as HOST_INTERACTION_ID_PREFIX, zi as toolCallPreview, zn as resolveConfig } from "./approvals-u2T19Dc-.js";
25
- import { E as renderDefaultCallbackPage, T as restoreModelOptions, b as modelSupportsReasoning, c as setPreferredCredential, g as getContextWindow, h as enabledModelOptions, l as setProviderCredential, n as applyApiKeyEnv, t as detectAuth, w as piIdOf, y as modelOptionsFor } from "./auth-HRKkOErn.js";
26
- import { a as connectIpcClient, d as defaultSocketPath, f as ensureDaemonRunning, m as selfDaemonSpawnCommand, o as connectOrSpawnDaemon } from "./server-CTUpOdh3.js";
24
+ import { $ as runOAuthLogin, $n as dedupMcpServersByName, $t as discoverProjectPlugins, A as useSafeModeQueue, Ai as lastContextSizeFromTurns, Bi as toolCallPreview, Bn as resolveConfig, Ci as createChatTurnsReadTool, Cn as resolveChipColor, Ct as buildResumedToolResultsTurn, Di as deriveSessionTitle, Dt as isModelInteraction, Fn as DiscoveryProvider, G as providerUsageSupported, Gn as useCompletion, Gt as modelChainMetadata, H as fetchAllProviderUsage, Hi as updateToolEventOutcomes, Hr as accentColor, Ht as createBuiltinCommands, Ii as serverToolResultSummary, In as useDiscovery, It as installProviderDiagnosticHook, J as formatPathForCwd, Jn as importFromClaudeCode, Jt as createFileMcpCredentialStore, K as usageChecksOptedOut, Kn as countClaudeSessionFiles, Li as stripSpawnTokensLine, Ln as useDiscoveryOptional, M as addToSafelist, Mi as loadState, Mn as parseEditorCommand, Mr as groupArtifacts, Mt as useInteractionsQueue, N as getSafelist, Ni as marginTopFor, Nn as quoteForShell, O as SafeModeProvider, Oi as eventsFromTurns, Ot as makeRequestInteraction, P as isOnSafelist, Pi as noticeTurnContent, Pn as createDiscoverySlot, Pr as discoverAgentsMd, Q as oauthUsesManualCodePaste, Qn as buildMcpServers, Qt as buildPluginContributions, R as suggestSafelistEntries, Ri as sumRunCosts, Rn as ConfigProvider, Si as chatReferenceTokensForPrompt, St as PRESENT_PLAN_TOOL, Ti as compactSummaryEvent, Tt as createInteractionTools, U as fetchProviderUsage, Ui as usageByModel, Un as createArtifactsCompletionProvider, Ut as applyThinkingBindingSetting, V as clearProviderUsageCache, Vi as toolResultText, Vn as resolveStoragePaths, Wt as createMainSession, Xn as removeMcpServer, Y as fetchOAuthRedirect, Yn as mcpsWritePath, Yr as TODO_STATUS_GLYPHS, Z as redirectUriFromAuthUrl, Zn as upsertMcpServer, Zr as applyTodosSnapshot, Zt as runEndNotice, _ as buildSpawnEndEvent, _n as SettingsProvider, _r as useRestartRequired, ai as selectActiveTodos, an as clipHintsToWidth, b as defaultSkillScanPaths, bi as buildPlanSystem, bn as useSettings, bt as HOST_INTERACTION_ID_PREFIX, c as useSelectStyle, ci as useActiveTodos, cn as buildHints, cr as buildRestartHint, ct as useMcpToolToggleMap, d as useTheme, dn as useEnabledToggleSet, dt as indexOfServerRow, en as parsePluginScanPathEnv, et as supportsOAuth, f as discoverSystemMd, fn as DEFAULT_SETTINGS, ft as parentServerName, g as useStreamBuffer, gn as SETTINGS_TOGGLES, gt as getMcpAuthStatus, h as userSystemMdPath, hn as SETTINGS_INPUTS, ht as useMcpAuthState, in as EMPTY_HINTS, ir as tryRevealPath, it as refreshMcpToolsCatalog, ji as listSessionMeta, jr as chatWindowBehavior, jt as useInteractionsActions, k as useSafeModeActions, ki as getSessionMeta, kt as pendingInteractionsFromTurns, l as useSurfaces, lr as buildUpdateHint, m as userScopeOverridesLoad, mn as SETTINGS_CHOICES, mt as useMcpAuthDispatch, ni as pickActiveRunId, nt as loadMcpToolsCache, o as ThemeProvider, oi as setTodosForRun, on as hintsLength, or as bootTick, ot as subscribeMcpToolsCache, p as renderSystemMdSeed, pn as SETTINGS_CATEGORIES, pt as McpAuthProvider, qn as hasClaudeCodeSetup, qt as resolveSandboxFromSettings, r as computeTurnAnchors, ri as pruneTodosByRun, rr as tryOpenBrowser, rt as mcpToolsCachePath, s as useColors, si as todoProgressLabel, sn as truncateTrailing, tn as attachMcpWarnLog, tr as discoverProjectMcps, un as listProjectFiles, ur as useUpdateCheck, ut as buildVisibleMcpRows, v as buildSpawnStartEvent, vn as clampFps, vt as ASK_USER_TOOL, w as writeSessionExport, wn as resolveTheme, wt as createAutomaticInteractionResponse, x as discoverProjectSkills, xi as envSection, xt as InteractionsProvider, y as buildSkillsConfig, yi as buildBuildSystem, zn as useConfig } from "./approvals-BznYVVGD.js";
25
+ import { A as renderDefaultCallbackPage, C as modelOptionsFor, O as piIdOf, b as getContextWindow, d as setPreferredCredential, f as setProviderCredential, k as restoreModelOptions, l as removeStoredCredential, n as applyApiKeyEnv, s as readProviderCredentials, t as detectAuth, u as setCredentialLabel, w as modelSupportsReasoning, y as enabledModelOptions } from "./auth-DvMdkpGD.js";
26
+ import { _ as selfDaemonSpawnCommand, c as connectIpcClient, h as ensureDaemonRunning, l as connectOrSpawnDaemon, m as defaultSocketPath } from "./shell-path-3tZ2lyQ2.js";
27
27
  import { createDockerContext } from "./contexts/docker.js";
28
28
  import { createTuiStore } from "./session/sqlite.js";
29
29
  import { _ as buildVisibleAuthRows, a as editTodo, b as parentProviderKey, c as NOTICE_GLYPH, f as validateMcpForm, g as instructionPreviewLines, h as instructionOriginBadge, i as cycleTodoStatus, l as MCP_TRANSPORTS, m as buildVisibleInstructionRows, n as buildTodoRetryMessage, r as clearTodos, s as removeTodo, t as addTodo, v as indexOfProviderRow, x as selectableSources } from "./todo-edits-Dw2oO2ON.js";
@@ -12228,6 +12228,14 @@ function AuthScreen({ onPick, initialConfigureKey }) {
12228
12228
  }), /* @__PURE__ */ jsx$1(TitleOverlay, { title: "pick a provider" })]
12229
12229
  });
12230
12230
  }
12231
+ /** Stored OAuth accounts of a provider, as the account picker lists them. */
12232
+ function oauthAccountsOf(dataDir, descriptor) {
12233
+ return readProviderCredentials(dataDir, descriptor).flatMap((s) => s.credential.kind === "oauth" ? [{
12234
+ key: s.key,
12235
+ label: oauthAccountLabel(s.credential),
12236
+ active: s.active
12237
+ }] : []);
12238
+ }
12231
12239
  /**
12232
12240
  * First credential step for a chosen provider. The method picker only earns
12233
12241
  * its place when there's a genuine choice — i.e. the provider supports OAuth
@@ -12269,9 +12277,46 @@ function SetupWizard({ registry, dataDir, initialDescriptor, onConfigured, onCan
12269
12277
  descriptor,
12270
12278
  customFields: {}
12271
12279
  });
12272
- else setStep({
12280
+ else {
12281
+ const accounts = oauthAccountsOf(dataDir, descriptor);
12282
+ if (accounts.length === 0) setStep({
12283
+ kind: "oauth-running",
12284
+ descriptor,
12285
+ target: { label: DEFAULT_OAUTH_ACCOUNT_LABEL }
12286
+ });
12287
+ else setStep({
12288
+ kind: "pick-oauth-account",
12289
+ descriptor,
12290
+ accounts
12291
+ });
12292
+ }
12293
+ }, [dataDir]);
12294
+ const onPickOAuthAccount = useCallback((descriptor, choice) => {
12295
+ setError(null);
12296
+ const target = choice === "add" ? { label: "" } : {
12297
+ replaceKey: choice.key,
12298
+ label: choice.label
12299
+ };
12300
+ setStep({
12301
+ kind: "name-oauth-account",
12302
+ descriptor,
12303
+ target
12304
+ });
12305
+ }, []);
12306
+ const onNameOAuthAccount = useCallback((descriptor, target, label) => {
12307
+ const trimmed = label.trim();
12308
+ if (!trimmed && target.replaceKey === void 0) {
12309
+ setError("Enter a name for this account.");
12310
+ return;
12311
+ }
12312
+ setError(null);
12313
+ setStep({
12273
12314
  kind: "oauth-running",
12274
- descriptor
12315
+ descriptor,
12316
+ target: {
12317
+ ...target,
12318
+ label: trimmed || "Default"
12319
+ }
12275
12320
  });
12276
12321
  }, []);
12277
12322
  /**
@@ -12364,9 +12409,23 @@ function SetupWizard({ registry, dataDir, initialDescriptor, onConfigured, onCan
12364
12409
  error,
12365
12410
  onSubmit: onApiKeySubmit
12366
12411
  });
12412
+ if (step.kind === "pick-oauth-account") return /* @__PURE__ */ jsx$1(PickOAuthAccountStep, {
12413
+ descriptor: step.descriptor,
12414
+ accounts: step.accounts,
12415
+ error,
12416
+ onPick: onPickOAuthAccount
12417
+ });
12418
+ if (step.kind === "name-oauth-account") return /* @__PURE__ */ jsx$1(NameOAuthAccountStep, {
12419
+ descriptor: step.descriptor,
12420
+ target: step.target,
12421
+ error,
12422
+ onSubmit: onNameOAuthAccount
12423
+ });
12367
12424
  return /* @__PURE__ */ jsx$1(OAuthRunningStep, {
12368
12425
  descriptor: step.descriptor,
12369
12426
  dataDir,
12427
+ label: step.target.label,
12428
+ replaceKey: step.target.replaceKey,
12370
12429
  onSuccess: onOAuthSuccess,
12371
12430
  onError: onOAuthError
12372
12431
  });
@@ -12474,7 +12533,7 @@ function PickProviderStep({ descriptors, error, onPick, onCancel }) {
12474
12533
  children: [!onCancel && /* @__PURE__ */ jsxs("text", {
12475
12534
  fg: COLOR.dim,
12476
12535
  children: [
12477
- "No provider credentials yet. Pick a provider to configure — keys are stored in",
12536
+ "No provider credentials yet. Pick a provider to configure. Keys are stored in",
12478
12537
  /* @__PURE__ */ jsx$1("span", {
12479
12538
  fg: COLOR.model,
12480
12539
  children: " ~/.zidane/credentials.json "
@@ -12714,7 +12773,86 @@ function EnterApiKeyStep({ descriptor, customFields, error, onSubmit }) {
12714
12773
  })]
12715
12774
  });
12716
12775
  }
12717
- function OAuthRunningStep({ descriptor, dataDir, onSuccess, onError }) {
12776
+ /** Sentinel option value for the account picker's "add another account" row. */
12777
+ const ADD_OAUTH_ACCOUNT_VALUE = "__add__";
12778
+ function PickOAuthAccountStep({ descriptor, accounts, error, onPick }) {
12779
+ const focused = useModalAwareFocus();
12780
+ const SELECT_THEME = useSelectStyle();
12781
+ const options = [{
12782
+ name: "+ add another account",
12783
+ description: "sign in with a different account",
12784
+ value: ADD_OAUTH_ACCOUNT_VALUE
12785
+ }, ...accounts.map((a) => ({
12786
+ name: a.label,
12787
+ description: a.active ? "re-authenticate (in use)" : "re-authenticate",
12788
+ value: a.key
12789
+ }))];
12790
+ return /* @__PURE__ */ jsxs(WizardPanel, {
12791
+ title: `configure ${descriptor.label} · OAuth account`,
12792
+ error,
12793
+ children: [/* @__PURE__ */ jsx$1(WizardEscHint, {}), /* @__PURE__ */ jsx$1("select", {
12794
+ ...SELECT_THEME,
12795
+ focused,
12796
+ options,
12797
+ wrapSelection: true,
12798
+ onSelect: (_idx, option) => {
12799
+ if (!option) return;
12800
+ if (option.value === ADD_OAUTH_ACCOUNT_VALUE) {
12801
+ onPick(descriptor, "add");
12802
+ return;
12803
+ }
12804
+ const choice = accounts.find((a) => a.key === option.value);
12805
+ if (choice) onPick(descriptor, choice);
12806
+ },
12807
+ style: { flexGrow: 1 }
12808
+ })]
12809
+ });
12810
+ }
12811
+ function NameOAuthAccountStep({ descriptor, target, error, onSubmit }) {
12812
+ const focused = useModalAwareFocus();
12813
+ const inputRef = useRef(null);
12814
+ const COLOR = useColors();
12815
+ const submit = useCallback(() => {
12816
+ onSubmit(descriptor, target, inputRef.current?.value ?? "");
12817
+ }, [
12818
+ descriptor,
12819
+ target,
12820
+ onSubmit
12821
+ ]);
12822
+ return /* @__PURE__ */ jsxs(WizardPanel, {
12823
+ title: `configure ${descriptor.label} · account name`,
12824
+ error,
12825
+ children: [/* @__PURE__ */ jsxs("text", {
12826
+ fg: COLOR.dim,
12827
+ children: [
12828
+ "Name this account so you can tell it apart in Settings (for example work or personal), then press",
12829
+ /* @__PURE__ */ jsx$1("span", {
12830
+ fg: COLOR.model,
12831
+ children: " enter "
12832
+ }),
12833
+ "to open the browser. Esc to exit."
12834
+ ]
12835
+ }), /* @__PURE__ */ jsx$1("box", {
12836
+ style: {
12837
+ border: true,
12838
+ borderColor: COLOR.borderActive,
12839
+ paddingLeft: 1,
12840
+ paddingRight: 1,
12841
+ height: 3
12842
+ },
12843
+ children: /* @__PURE__ */ jsx$1("input", {
12844
+ ref: inputRef,
12845
+ focused,
12846
+ keyBindings: API_KEY_INPUT_BINDINGS,
12847
+ value: target.label,
12848
+ placeholder: "account name",
12849
+ onSubmit: submit,
12850
+ style: { flexGrow: 1 }
12851
+ })
12852
+ })]
12853
+ });
12854
+ }
12855
+ function OAuthRunningStep({ descriptor, dataDir, label, replaceKey, onSuccess, onError }) {
12718
12856
  const usesManualPaste = oauthUsesManualCodePaste(descriptor);
12719
12857
  const [url, setUrl] = useState(null);
12720
12858
  const [status, setStatus] = useState(usesManualPaste ? "opening browser…" : "starting browser…");
@@ -12765,8 +12903,9 @@ function OAuthRunningStep({ descriptor, dataDir, onSuccess, onError }) {
12765
12903
  if (cancelled) return;
12766
12904
  setProviderCredential(dataDir, descriptor, {
12767
12905
  kind: "oauth",
12768
- ...creds
12769
- });
12906
+ ...creds,
12907
+ label
12908
+ }, replaceKey ? { replaceKey } : {});
12770
12909
  if (descriptor.envKey) delete process.env[descriptor.envKey];
12771
12910
  onSuccess();
12772
12911
  } catch (err) {
@@ -12783,6 +12922,8 @@ function OAuthRunningStep({ descriptor, dataDir, onSuccess, onError }) {
12783
12922
  }, [
12784
12923
  descriptor,
12785
12924
  dataDir,
12925
+ label,
12926
+ replaceKey,
12786
12927
  onSuccess,
12787
12928
  onError,
12788
12929
  usesManualPaste
@@ -16587,6 +16728,7 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
16587
16728
  const scrollboxRef = useRef(null);
16588
16729
  const [editingInputKey, setEditingInputKey] = useState(null);
16589
16730
  const editInputRef = useRef(null);
16731
+ const renameInputRef = useRef(null);
16590
16732
  const { width: termWidth } = useTerminalDimensions();
16591
16733
  const contentCols = Math.max(40, termWidth - 2 - 4 - 2 - 1);
16592
16734
  const discovery = useDiscoveryOptional();
@@ -16837,6 +16979,9 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
16837
16979
  * here, so the swap is visible in place.
16838
16980
  */
16839
16981
  const [providersAfterSwap, setProvidersAfterSwap] = useState(null);
16982
+ const [credentialRemoveArmed, setCredentialRemoveArmed] = useState(null);
16983
+ const [authNotice, setAuthNotice] = useState(null);
16984
+ const [renamingCredential, setRenamingCredential] = useState(null);
16840
16985
  const [instructionsNotice, setInstructionsNotice] = useState(null);
16841
16986
  const [instructionSegments, setInstructionSegments] = useState([]);
16842
16987
  const [instructionsLoading, setInstructionsLoading] = useState(false);
@@ -17456,21 +17601,28 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
17456
17601
  useEffect(() => {
17457
17602
  setMcpRemoveArmed(null);
17458
17603
  }, [focusedMcp?.config.name, activeTab]);
17604
+ useEffect(() => {
17605
+ setCredentialRemoveArmed(null);
17606
+ }, [cursor, activeTab]);
17459
17607
  const authorizingMcp = activeTab === "mcps" ? mcpsCatalog.map((entry) => ({
17460
17608
  entry,
17461
17609
  status: getMcpAuthStatus(authState, entry.config.name)
17462
17610
  })).find(({ status }) => status.kind === "authorizing") : void 0;
17463
17611
  const oauthPasteActive = !!authorizingMcp && authorizingMcp.status.kind === "authorizing" && !!authorizingMcp.status.url;
17464
17612
  useEffect(() => {
17465
- if (!oauthPasteActive && !editingInputKey && !authorizingMcp) inputRef.current?.focus();
17613
+ if (!oauthPasteActive && !editingInputKey && !renamingCredential && !authorizingMcp) inputRef.current?.focus();
17466
17614
  }, [
17467
17615
  oauthPasteActive,
17468
17616
  editingInputKey,
17617
+ renamingCredential,
17469
17618
  authorizingMcp
17470
17619
  ]);
17471
17620
  useEffect(() => {
17472
17621
  if (editingInputKey) editInputRef.current?.focus();
17473
17622
  }, [editingInputKey]);
17623
+ useEffect(() => {
17624
+ if (renamingCredential) renameInputRef.current?.focus();
17625
+ }, [renamingCredential]);
17474
17626
  /**
17475
17627
  * Activate the row at `index` on the ACTIVE tab — the ↵ semantics
17476
17628
  * (toggle / cycle / open editor / run action), extracted so row
@@ -17548,7 +17700,8 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
17548
17700
  if (row.method.source === "env" || row.method.active) return;
17549
17701
  const provider = filteredProviders.find((p) => p.key === row.providerKey);
17550
17702
  if (!provider) return;
17551
- const refreshed = actions?.onSetPreferredCredential?.(provider, row.method.source);
17703
+ const target = row.method.key ? { key: row.method.key } : row.method.source;
17704
+ const refreshed = actions?.onSetPreferredCredential?.(provider, target);
17552
17705
  if (refreshed) setProvidersAfterSwap(refreshed);
17553
17706
  }
17554
17707
  }, [
@@ -17583,7 +17736,7 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
17583
17736
  * switch tabs behind the user's back. Also drives the lists' `focused`
17584
17737
  * prop, so "list looks focused" and "list accepts input" cannot drift.
17585
17738
  */
17586
- const modalInputCaptured = oauthPasteActive || configEditActive || editingInputKey !== null || extInstallActive || skillInstallActive || skillImportAllActive || mcpAddActive;
17739
+ const modalInputCaptured = oauthPasteActive || configEditActive || editingInputKey !== null || renamingCredential !== null || extInstallActive || skillInstallActive || skillImportAllActive || mcpAddActive;
17587
17740
  /**
17588
17741
  * Row CLICK dispatch: focus the clicked row, then act on it. Expandable
17589
17742
  * headers (MCP servers, extensions with config) expand/collapse — the
@@ -17669,6 +17822,10 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
17669
17822
  if (key.name === "escape") setEditingInputKey(null);
17670
17823
  return;
17671
17824
  }
17825
+ if (renamingCredential) {
17826
+ if (key.name === "escape") setRenamingCredential(null);
17827
+ return;
17828
+ }
17672
17829
  if (!key.ctrl && !key.meta && !key.shift && (key.name === "left" || key.name === "right")) {
17673
17830
  key.preventDefault();
17674
17831
  const idx = tabOrder.indexOf(activeTab);
@@ -17722,6 +17879,39 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
17722
17879
  toggleExpandFocusedProviderRow();
17723
17880
  return;
17724
17881
  }
17882
+ if (activeTab === "authentication" && key.ctrl && key.name === "x" && actions?.onRemoveCredential) {
17883
+ key.preventDefault();
17884
+ const row = authVisibleRows[cursor];
17885
+ if (row?.kind !== "source" || !row.method.key) return;
17886
+ const provider = filteredProviders.find((p) => p.key === row.providerKey);
17887
+ if (!provider) return;
17888
+ const name = row.method.label ?? row.method.source;
17889
+ if (credentialRemoveArmed !== row.method.key) {
17890
+ setCredentialRemoveArmed(row.method.key);
17891
+ setAuthNotice(`remove ${provider.label} ${name}${row.method.active ? " (in use)" : ""}? press ctrl+x again to confirm.`);
17892
+ return;
17893
+ }
17894
+ setCredentialRemoveArmed(null);
17895
+ const refreshed = actions.onRemoveCredential(provider, row.method.key);
17896
+ if (refreshed) setProvidersAfterSwap(refreshed);
17897
+ setAuthNotice(`removed ${provider.label} ${name}.`);
17898
+ return;
17899
+ }
17900
+ if (activeTab === "authentication" && key.ctrl && key.name === "e" && actions?.onRenameCredential) {
17901
+ key.preventDefault();
17902
+ const row = authVisibleRows[cursor];
17903
+ if (row?.kind !== "source" || row.method.source !== "oauth" || !row.method.key) return;
17904
+ const provider = filteredProviders.find((p) => p.key === row.providerKey);
17905
+ if (!provider) return;
17906
+ setCredentialRemoveArmed(null);
17907
+ setAuthNotice(null);
17908
+ setRenamingCredential({
17909
+ provider,
17910
+ key: row.method.key,
17911
+ label: row.method.label ?? ""
17912
+ });
17913
+ return;
17914
+ }
17725
17915
  if (key.name === "return") {
17726
17916
  activateRowAt(cursor);
17727
17917
  return;
@@ -17974,7 +18164,7 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
17974
18164
  horizontalMargin: 0,
17975
18165
  verticalMargin: 0,
17976
18166
  ...version ? { bottomTitle: `zidane v${version}` } : {},
17977
- disableEscape: configEditActive || !!editingInputKey || extInstallActive || skillInstallActive || skillImportAllActive || mcpAddActive,
18167
+ disableEscape: configEditActive || !!editingInputKey || !!renamingCredential || extInstallActive || skillInstallActive || skillImportAllActive || mcpAddActive,
17978
18168
  children: [
17979
18169
  /* @__PURE__ */ jsx$1("box", {
17980
18170
  style: { flexShrink: 0 },
@@ -18170,6 +18360,67 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
18170
18360
  children: mcpOp.text
18171
18361
  })
18172
18362
  }),
18363
+ activeTab === "authentication" && authNotice && !renamingCredential && /* @__PURE__ */ jsx$1("box", {
18364
+ style: { flexShrink: 0 },
18365
+ children: /* @__PURE__ */ jsx$1("text", {
18366
+ fg: COLOR.dim,
18367
+ children: authNotice
18368
+ })
18369
+ }),
18370
+ renamingCredential && /* @__PURE__ */ jsxs("box", {
18371
+ style: {
18372
+ flexShrink: 0,
18373
+ flexDirection: "column",
18374
+ border: ["top"],
18375
+ borderColor: COLOR.border,
18376
+ paddingTop: 1
18377
+ },
18378
+ children: [
18379
+ /* @__PURE__ */ jsx$1("text", {
18380
+ fg: COLOR.brand,
18381
+ children: `Rename ${renamingCredential.provider.label} account`
18382
+ }),
18383
+ /* @__PURE__ */ jsx$1("box", {
18384
+ style: {
18385
+ border: true,
18386
+ borderColor: COLOR.borderActive,
18387
+ paddingLeft: 1,
18388
+ paddingRight: 1,
18389
+ height: 3
18390
+ },
18391
+ children: /* @__PURE__ */ jsx$1("input", {
18392
+ ref: renameInputRef,
18393
+ focused: true,
18394
+ value: renamingCredential.label,
18395
+ placeholder: "account name",
18396
+ onSubmit: () => {
18397
+ const next = (renameInputRef.current?.value ?? "").trim();
18398
+ const { provider, key, label } = renamingCredential;
18399
+ setRenamingCredential(null);
18400
+ if (next === label) return;
18401
+ const refreshed = actions?.onRenameCredential?.(provider, key, next);
18402
+ if (refreshed) setProvidersAfterSwap(refreshed);
18403
+ setAuthNotice(`renamed ${provider.label} ${label} to ${next || "Default"}.`);
18404
+ },
18405
+ style: { flexGrow: 1 }
18406
+ })
18407
+ }),
18408
+ /* @__PURE__ */ jsx$1(ModalHints, { hints: [
18409
+ {
18410
+ key: "↵",
18411
+ label: "save"
18412
+ },
18413
+ {
18414
+ key: "esc",
18415
+ label: "cancel"
18416
+ },
18417
+ {
18418
+ key: "",
18419
+ label: `empty = Default`
18420
+ }
18421
+ ] })
18422
+ ]
18423
+ }),
18173
18424
  editingInputItem && /* @__PURE__ */ jsxs("box", {
18174
18425
  style: {
18175
18426
  flexShrink: 0,
@@ -18241,6 +18492,14 @@ function SettingsModal({ skillsCatalog: skillsCatalogProp, mcpsCatalog: mcpsCata
18241
18492
  canAddMcp: !!actions?.onAddMcp,
18242
18493
  canRemoveSkill: !!actions?.onRemoveSkill,
18243
18494
  canRemoveMcp: !!actions?.onRemoveMcp,
18495
+ canRemoveCredential: !!actions?.onRemoveCredential && activeTab === "authentication" && (() => {
18496
+ const row = authVisibleRows[cursor];
18497
+ return row?.kind === "source" && !!row.method.key;
18498
+ })(),
18499
+ canRenameCredential: !!actions?.onRenameCredential && activeTab === "authentication" && (() => {
18500
+ const row = authVisibleRows[cursor];
18501
+ return row?.kind === "source" && row.method.source === "oauth" && !!row.method.key;
18502
+ })(),
18244
18503
  focusedExtensionExpandable: activeTab === "extensions" && extensionVisibleRows[cursor] !== void 0 && (() => {
18245
18504
  const row = extensionVisibleRows[cursor];
18246
18505
  return row.kind === "config" || row.kind === "extension" && row.hasConfig;
@@ -19602,6 +19861,8 @@ function AuthenticationList({ view, providers, rows, cursor, highlightBg, query
19602
19861
  const { method } = row;
19603
19862
  const isEnv = method.source === "env";
19604
19863
  const dotColor = isEnv ? COLOR.model : method.active ? COLOR.accent : COLOR.mute;
19864
+ const title = method.label ?? method.source;
19865
+ const detail = method.label && method.detail.startsWith(`${method.label} · `) ? `${method.source} · ${method.detail.slice(method.label.length + 3)}` : method.detail;
19605
19866
  return /* @__PURE__ */ jsx$1("box", {
19606
19867
  id: anchorIdFor(i),
19607
19868
  style: {
@@ -19623,11 +19884,11 @@ function AuthenticationList({ view, providers, rows, cursor, highlightBg, query
19623
19884
  }),
19624
19885
  /* @__PURE__ */ jsx$1("span", {
19625
19886
  fg: isEnv ? COLOR.model : method.active ? COLOR.accent : focused ? COLOR.brand : COLOR.dim,
19626
- children: method.source
19887
+ children: title
19627
19888
  }),
19628
19889
  /* @__PURE__ */ jsx$1("span", {
19629
19890
  fg: COLOR.mute,
19630
- children: ` ${displayPath$1(method.detail, home)}`
19891
+ children: ` ${displayPath$1(detail, home)}`
19631
19892
  }),
19632
19893
  method.active && /* @__PURE__ */ jsx$1("span", {
19633
19894
  fg: COLOR.mute,
@@ -19635,7 +19896,7 @@ function AuthenticationList({ view, providers, rows, cursor, highlightBg, query
19635
19896
  })
19636
19897
  ]
19637
19898
  })
19638
- }, `${i}:${row.providerKey}:${method.source}`);
19899
+ }, `${i}:${row.providerKey}:${method.key ?? method.source}`);
19639
19900
  }
19640
19901
  const p = row.provider;
19641
19902
  const expanded = row.expandable && rows[i + 1]?.kind === "source";
@@ -19990,7 +20251,7 @@ function renderMcpErrors(errors, home, warnColor, dimColor) {
19990
20251
  }, err.path))
19991
20252
  });
19992
20253
  }
19993
- function Hints({ activeTab, authorizing = false, focusedMcp, focusedMcpRow, focusedMcpStatus, canRefreshSkills, canRefreshMcps, canRefreshPlugins, canEditExtension, canCreateExtension, canUpdateExtension, canRemoveExtension, canInstallExtension, canInstallSkill, canEditSkill, canAddMcp, canRemoveSkill, canRemoveMcp, focusedExtensionExpandable, focusedSecretClearable = false, focusedInstructionOpenable = false, focusedInstructionCreatable = false }) {
20254
+ function Hints({ activeTab, authorizing = false, focusedMcp, focusedMcpRow, focusedMcpStatus, canRefreshSkills, canRefreshMcps, canRefreshPlugins, canEditExtension, canCreateExtension, canUpdateExtension, canRemoveExtension, canInstallExtension, canInstallSkill, canEditSkill, canAddMcp, canRemoveSkill, canRemoveMcp, canRemoveCredential, canRenameCredential, focusedExtensionExpandable, focusedSecretClearable = false, focusedInstructionOpenable = false, focusedInstructionCreatable = false }) {
19994
20255
  const COLOR = useColors();
19995
20256
  const onServerRow = focusedMcpRow?.kind === "server";
19996
20257
  const showLogin = activeTab === "mcps" && onServerRow && !!focusedMcp && !!focusedMcpStatus && canLogin$1(focusedMcp, focusedMcpStatus);
@@ -20075,6 +20336,14 @@ function Hints({ activeTab, authorizing = false, focusedMcp, focusedMcpRow, focu
20075
20336
  key: "ctrl+x",
20076
20337
  label: "remove"
20077
20338
  }] : [],
20339
+ ...canRenameCredential ? [{
20340
+ key: "ctrl+e",
20341
+ label: "rename"
20342
+ }] : [],
20343
+ ...canRemoveCredential ? [{
20344
+ key: "ctrl+x",
20345
+ label: "remove"
20346
+ }] : [],
20078
20347
  ...showLogin ? [{
20079
20348
  key: "ctrl+L",
20080
20349
  label: "login"
@@ -21306,13 +21575,15 @@ function UsagePanelModal({ dataDir, registry, activeProviderKey, autoLoad = true
21306
21575
  return (a.providerKey === activeProviderKey ? 0 : 1) - (b.providerKey === activeProviderKey ? 0 : 1);
21307
21576
  });
21308
21577
  const { height: termHeight } = useTerminalDimensions();
21578
+ const bodyMaxHeight = Math.max(6, termHeight - 11);
21579
+ const updated = updatedLabel(snapshots);
21309
21580
  return /* @__PURE__ */ jsxs(Modal, {
21310
21581
  title: "subscription usage",
21311
21582
  maxWidth: 72,
21312
21583
  children: [/* @__PURE__ */ jsx$1("box", {
21313
21584
  style: {
21314
21585
  flexDirection: "column",
21315
- maxHeight: Math.max(6, termHeight - 11),
21586
+ maxHeight: bodyMaxHeight,
21316
21587
  flexShrink: 1,
21317
21588
  overflow: "hidden"
21318
21589
  },
@@ -21334,23 +21605,32 @@ function UsagePanelModal({ dataDir, registry, activeProviderKey, autoLoad = true
21334
21605
  })
21335
21606
  }) : ordered.map((snapshot, index) => /* @__PURE__ */ jsx$1(ProviderSection, {
21336
21607
  snapshot,
21337
- isActive: snapshot.providerKey === activeProviderKey,
21608
+ account: showsAccount(snapshot, ordered) ? snapshot.account : null,
21609
+ isActive: snapshot.providerKey === activeProviderKey && snapshot.activeCredential,
21338
21610
  first: index === 0,
21339
21611
  COLOR
21340
- }, snapshot.providerKey))
21612
+ }, snapshot.credentialKey))
21341
21613
  })
21342
- }), /* @__PURE__ */ jsx$1(ModalHints, { hints: [...envOptedOut ? [] : [{
21343
- key: "ctrl+r",
21344
- label: loading ? "refreshing" : "refresh",
21345
- labelColor: COLOR.dim
21346
- }], {
21347
- key: "esc",
21348
- label: "close",
21349
- labelColor: COLOR.dim
21350
- }] })]
21614
+ }), /* @__PURE__ */ jsx$1(ModalHints, { hints: [
21615
+ ...envOptedOut ? [] : [{
21616
+ key: "ctrl+r",
21617
+ label: loading ? "refreshing" : "refresh",
21618
+ labelColor: COLOR.dim
21619
+ }],
21620
+ ...updated && !loading ? [{
21621
+ key: "",
21622
+ label: updated,
21623
+ labelColor: COLOR.dim
21624
+ }] : [],
21625
+ {
21626
+ key: "esc",
21627
+ label: "close",
21628
+ labelColor: COLOR.dim
21629
+ }
21630
+ ] })]
21351
21631
  });
21352
21632
  }
21353
- function ProviderSection({ snapshot, isActive, first, COLOR }) {
21633
+ function ProviderSection({ snapshot, account, isActive, first, COLOR }) {
21354
21634
  const SURFACE = useSurfaces();
21355
21635
  const looseCredits = snapshot.windows.some((win) => win.id === "credits") ? null : snapshot.credits;
21356
21636
  return /* @__PURE__ */ jsxs("box", {
@@ -21373,13 +21653,20 @@ function ProviderSection({ snapshot, isActive, first, COLOR }) {
21373
21653
  children: [
21374
21654
  /* @__PURE__ */ jsxs("text", {
21375
21655
  wrapMode: "none",
21376
- children: [/* @__PURE__ */ jsx$1("span", {
21377
- fg: isActive ? COLOR.brand : COLOR.model,
21378
- children: snapshot.label
21379
- }), snapshot.plan ? /* @__PURE__ */ jsx$1("span", {
21380
- fg: COLOR.mute,
21381
- children: ` · ${snapshot.plan}`
21382
- }) : null]
21656
+ children: [
21657
+ /* @__PURE__ */ jsx$1("span", {
21658
+ fg: isActive ? COLOR.brand : COLOR.model,
21659
+ children: snapshot.label
21660
+ }),
21661
+ account ? /* @__PURE__ */ jsx$1("span", {
21662
+ fg: COLOR.dim,
21663
+ children: ` · ${account}`
21664
+ }) : null,
21665
+ snapshot.plan ? /* @__PURE__ */ jsx$1("span", {
21666
+ fg: COLOR.mute,
21667
+ children: ` · ${snapshot.plan}`
21668
+ }) : null
21669
+ ]
21383
21670
  }),
21384
21671
  /* @__PURE__ */ jsx$1("box", { style: { flexGrow: 1 } }),
21385
21672
  isActive && /* @__PURE__ */ jsx$1("text", {
@@ -27077,16 +27364,36 @@ function AppShell() {
27077
27364
  }, []);
27078
27365
  rebuildActiveAgentRef.current = rebuildActiveAgent;
27079
27366
  /**
27367
+ * Shared tail of every in-modal credential mutation (swap, per-account
27368
+ * removal): re-reconcile `process.env`, rebuild the live agent when it is the
27369
+ * one affected, and hand back fresh detection for the modal to render.
27370
+ *
27371
+ * `applyApiKeyEnv` is the step that actually makes a change take effect: a
27372
+ * promoted API key has to be injected, and a promoted OAuth grant has to
27373
+ * CLEAR the ambient var so the refresh path runs instead of a stale token.
27374
+ */
27375
+ const afterCredentialChange = useCallback((providerKey) => {
27376
+ applyApiKeyEnv(config.paths.userDir, providerRegistry, { log: (message) => getTuiLogging()?.sink.emit({
27377
+ level: "debug",
27378
+ timestamp: Date.now(),
27379
+ message: message.trimEnd(),
27380
+ attrs: { scope: "chat" }
27381
+ }) });
27382
+ if (providerKey === pickedRef.current?.provider.key) rebuildActiveAgent().catch((err) => debugLog("afterCredentialChange: rebuild failed", err));
27383
+ return detectAuth(config.paths.userDir, providerRegistry);
27384
+ }, [
27385
+ config.paths.userDir,
27386
+ providerRegistry,
27387
+ rebuildActiveAgent
27388
+ ]);
27389
+ /**
27080
27390
  * Promote one of a provider's stored credentials — Settings → Authentication
27081
- * → `↵` on a source row, for a provider holding both an API key and an OAuth
27082
- * grant.
27391
+ * → `↵` on a source row, for a provider holding more than one (an API key,
27392
+ * several OAuth accounts).
27083
27393
  *
27084
27394
  * The preference IS the storage layout (the canonical file key holds the
27085
27395
  * winner), so persisting it is the entire change — there is no separate
27086
- * precedence setting to keep in sync. `applyApiKeyEnv` then re-reconciles
27087
- * `process.env`, which is the step that actually makes it take effect: a
27088
- * promoted API key has to be injected, and a promoted OAuth grant has to
27089
- * CLEAR the ambient var so the refresh path runs instead of a stale token.
27396
+ * precedence setting to keep in sync.
27090
27397
  *
27091
27398
  * Returns freshly-detected providers instead of closing the modal. The
27092
27399
  * settings modal's provider list is frozen at open time, so an earlier
@@ -27100,26 +27407,47 @@ function AppShell() {
27100
27407
  */
27101
27408
  const onSetPreferredCredential = useMemo(() => {
27102
27409
  if (busy || pendingApproval) return void 0;
27103
- return (provider, source) => {
27410
+ return (provider, target) => {
27104
27411
  const descriptor = providerRegistry[provider.key];
27105
27412
  if (!descriptor) return void 0;
27106
- if (setPreferredCredential(config.paths.userDir, descriptor, source) !== "promoted") return void 0;
27107
- applyApiKeyEnv(config.paths.userDir, providerRegistry, { log: (message) => getTuiLogging()?.sink.emit({
27108
- level: "debug",
27109
- timestamp: Date.now(),
27110
- message: message.trimEnd(),
27111
- attrs: { scope: "chat" }
27112
- }) });
27113
- if (provider.key === pickedRef.current?.provider.key) rebuildActiveAgent().catch((err) => debugLog("onSetPreferredCredential: rebuild failed", err));
27114
- return detectAuth(config.paths.userDir, providerRegistry);
27413
+ if (setPreferredCredential(config.paths.userDir, descriptor, target) !== "promoted") return void 0;
27414
+ return afterCredentialChange(provider.key);
27115
27415
  };
27116
27416
  }, [
27117
27417
  busy,
27118
27418
  pendingApproval,
27119
- config.paths.userDir,
27120
27419
  providerRegistry,
27121
- rebuildActiveAgent
27420
+ afterCredentialChange
27122
27421
  ]);
27422
+ /**
27423
+ * Drop ONE stored credential — Settings → Authentication → `ctrl+x` on a
27424
+ * source row. Removing the active one promotes a survivor (`removeStoredCredential`),
27425
+ * so the same env + agent reconciliation as a swap applies.
27426
+ */
27427
+ const onRemoveCredential = useMemo(() => {
27428
+ if (busy || pendingApproval) return void 0;
27429
+ return (provider, key) => {
27430
+ const descriptor = providerRegistry[provider.key];
27431
+ if (!descriptor) return void 0;
27432
+ if (!removeStoredCredential(config.paths.userDir, descriptor, key)) return void 0;
27433
+ return afterCredentialChange(provider.key);
27434
+ };
27435
+ }, [
27436
+ busy,
27437
+ pendingApproval,
27438
+ providerRegistry,
27439
+ afterCredentialChange
27440
+ ]);
27441
+ /**
27442
+ * Rename a stored OAuth account — Settings → Authentication → `ctrl+e` on
27443
+ * its row. Presentation only: the name plays no part in credential
27444
+ * resolution, so no env reconcile or agent rebuild follows.
27445
+ */
27446
+ const onRenameCredential = useCallback((provider, key, label) => {
27447
+ const descriptor = providerRegistry[provider.key];
27448
+ if (!descriptor || !setCredentialLabel(config.paths.userDir, descriptor, key, label)) return void 0;
27449
+ return detectAuth(config.paths.userDir, providerRegistry);
27450
+ }, [config.paths.userDir, providerRegistry]);
27123
27451
  useEffect(() => {
27124
27452
  const prev = mcpRuntimeKeyRef.current;
27125
27453
  if (prev === null) {
@@ -28138,6 +28466,8 @@ function AppShell() {
28138
28466
  actions: {
28139
28467
  onConfigureProvider,
28140
28468
  onSetPreferredCredential,
28469
+ onRemoveCredential,
28470
+ onRenameCredential,
28141
28471
  onOpenKeybindings: onOpenKeybindingsFile,
28142
28472
  getContextSegments: onReadContextSegments,
28143
28473
  onOpenInstructionsFile,