zidane 7.1.8 → 7.1.9

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 (92) hide show
  1. package/dist/{acp-BxRfclPQ.js → acp-Bt-eb5Z8.js} +2 -2
  2. package/dist/{acp-BxRfclPQ.js.map → acp-Bt-eb5Z8.js.map} +1 -1
  3. package/dist/acp-cli.js +3 -3
  4. package/dist/acp.d.ts +1 -1
  5. package/dist/acp.js +1 -1
  6. package/dist/{agent-CJbmpTmA.js → agent-B6etKd_o.js} +44 -10
  7. package/dist/agent-B6etKd_o.js.map +1 -0
  8. package/dist/agent.d.ts +1 -1
  9. package/dist/agent.js +2 -2
  10. package/dist/{approvals-DMxUgyVd.js → approvals-CIKGWmiU.js} +6 -6
  11. package/dist/{approvals-DMxUgyVd.js.map → approvals-CIKGWmiU.js.map} +1 -1
  12. package/dist/{auth-DvMdkpGD.js → auth-CDDNbEmd.js} +2 -2
  13. package/dist/{auth-DvMdkpGD.js.map → auth-CDDNbEmd.js.map} +1 -1
  14. package/dist/{cache-telemetry-ehVdWsg2.js → cache-telemetry-D0xemhgK.js} +2 -2
  15. package/dist/{cache-telemetry-ehVdWsg2.js.map → cache-telemetry-D0xemhgK.js.map} +1 -1
  16. package/dist/chat/pure.d.ts +57 -4
  17. package/dist/chat/pure.d.ts.map +1 -1
  18. package/dist/chat/pure.js +4 -4
  19. package/dist/chat.d.ts +5 -5
  20. package/dist/chat.js +5 -5
  21. package/dist/contexts/daytona.d.ts +1 -1
  22. package/dist/contexts/e2b.d.ts +1 -1
  23. package/dist/daemon-cli.js +1 -1
  24. package/dist/eval.d.ts +1 -1
  25. package/dist/extensions.d.ts +2 -2
  26. package/dist/extensions.js +3 -2
  27. package/dist/headless.d.ts +1 -1
  28. package/dist/headless.js +1 -1
  29. package/dist/{index-BMOl2Bog.d.ts → index-C45NxBZm.d.ts} +5 -5
  30. package/dist/{index-BMOl2Bog.d.ts.map → index-C45NxBZm.d.ts.map} +1 -1
  31. package/dist/{index-DCYh6lOp.d.ts → index-dXnPmqFx.d.ts} +129 -17
  32. package/dist/index-dXnPmqFx.d.ts.map +1 -0
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.js +2 -2
  35. package/dist/{ipc-BqEflvqC.js → ipc-BWsncell.js} +2 -2
  36. package/dist/{ipc-BqEflvqC.js.map → ipc-BWsncell.js.map} +1 -1
  37. package/dist/ipc.d.ts +5 -5
  38. package/dist/ipc.js +3 -3
  39. package/dist/mcp.d.ts +1 -1
  40. package/dist/output/stream-json.d.ts +1 -1
  41. package/dist/output/terminal.d.ts +1 -1
  42. package/dist/{cred-keys-BbbBr4q3.js → panels-B6gRk4bf.js} +174 -2
  43. package/dist/panels-B6gRk4bf.js.map +1 -0
  44. package/dist/plugins.d.ts +1 -1
  45. package/dist/presets.d.ts +1 -1
  46. package/dist/presets.js +1 -1
  47. package/dist/providers/anthropic.d.ts +1 -1
  48. package/dist/providers/arcee.d.ts +1 -1
  49. package/dist/providers/baseten.d.ts +1 -1
  50. package/dist/providers/cerebras.d.ts +1 -1
  51. package/dist/providers/local.d.ts +1 -1
  52. package/dist/providers/openai-compat.d.ts +1 -1
  53. package/dist/providers/openai.d.ts +1 -1
  54. package/dist/providers/openrouter.d.ts +1 -1
  55. package/dist/providers/xai.d.ts +1 -1
  56. package/dist/providers.d.ts +1 -1
  57. package/dist/restate.d.ts +1 -1
  58. package/dist/restate.js +1 -1
  59. package/dist/session/sqlite.d.ts +1 -1
  60. package/dist/session.d.ts +1 -1
  61. package/dist/{shell-path-DeSQjoHJ.js → shell-path-CY7nWoF8.js} +6 -6
  62. package/dist/{shell-path-DeSQjoHJ.js.map → shell-path-CY7nWoF8.js.map} +1 -1
  63. package/dist/skills.d.ts +1 -1
  64. package/dist/{todo-edits-Dw2oO2ON.js → todo-edits-PxMJvYIX.js} +91 -2
  65. package/dist/todo-edits-PxMJvYIX.js.map +1 -0
  66. package/dist/{tool-formatters-BDm0tjgy.d.ts → tool-formatters-Bl1afA8N.d.ts} +2 -2
  67. package/dist/{tool-formatters-BDm0tjgy.d.ts.map → tool-formatters-Bl1afA8N.d.ts.map} +1 -1
  68. package/dist/tools/fetch-url.d.ts +1 -1
  69. package/dist/tools/web-search.d.ts +1 -1
  70. package/dist/tools.d.ts +1 -1
  71. package/dist/tools.js +1 -1
  72. package/dist/{transcript-anchors-DjcEsOYq.d.ts → transcript-anchors-BfI3ZXh1.d.ts} +3 -3
  73. package/dist/transcript-anchors-BfI3ZXh1.d.ts.map +1 -0
  74. package/dist/tui.d.ts +3 -3
  75. package/dist/tui.d.ts.map +1 -1
  76. package/dist/tui.js +425 -67
  77. package/dist/tui.js.map +1 -1
  78. package/dist/{turn-operations-Rqk3E0Ue.d.ts → turn-operations-D0x_g6XQ.d.ts} +14 -8
  79. package/dist/turn-operations-D0x_g6XQ.d.ts.map +1 -0
  80. package/dist/{turn-operations-JynC5ODZ.js → turn-operations-D_k_FEur.js} +21 -10
  81. package/dist/{turn-operations-JynC5ODZ.js.map → turn-operations-D_k_FEur.js.map} +1 -1
  82. package/dist/types.d.ts +1 -1
  83. package/docs/EXTENSIONS.md +27 -6
  84. package/docs/PANELS.md +86 -0
  85. package/docs/README.md +2 -0
  86. package/package.json +1 -1
  87. package/dist/agent-CJbmpTmA.js.map +0 -1
  88. package/dist/cred-keys-BbbBr4q3.js.map +0 -1
  89. package/dist/index-DCYh6lOp.d.ts.map +0 -1
  90. package/dist/todo-edits-Dw2oO2ON.js.map +0 -1
  91. package/dist/transcript-anchors-DjcEsOYq.d.ts.map +0 -1
  92. package/dist/turn-operations-Rqk3E0Ue.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 { 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-CJbmpTmA.js";
3
+ import { m as buildContextSegments, n as normalizePanelContent, p as oauthAccountLabel, r as panelBadgeText, s as DEFAULT_OAUTH_ACCOUNT_LABEL } from "./panels-B6gRk4bf.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-B6etKd_o.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";
@@ -16,17 +16,17 @@ import { replaceDynamicSection, splitSystemPrompt } from "./prompt.js";
16
16
  import { a as getExtensionSessionState, c as setExtensionSessionState, i as demoteStaleRunningStatus, l as withExtensionSession, o as loadSession, t as createSession } from "./session-BqRP1hS7.js";
17
17
  import { t as effectiveInputFromTurn } from "./stats-DAKBEKjc.js";
18
18
  import { s as withTimeout } from "./timeout-CjOG2mea.js";
19
- import { i as installCacheBreakLogger } from "./cache-telemetry-ehVdWsg2.js";
19
+ import { i as installCacheBreakLogger } from "./cache-telemetry-D0xemhgK.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 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";
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-D_k_FEur.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 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-DMxUgyVd.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-DeSQjoHJ.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-CIKGWmiU.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-CDDNbEmd.js";
26
+ import { _ as selfDaemonSpawnCommand, c as connectIpcClient, h as ensureDaemonRunning, l as connectOrSpawnDaemon, m as defaultSocketPath } from "./shell-path-CY7nWoF8.js";
27
27
  import { createDockerContext } from "./contexts/docker.js";
28
28
  import { createTuiStore } from "./session/sqlite.js";
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";
29
+ import { A as parentProviderKey, D as buildVisibleAuthRows, E as instructionPreviewLines, O as indexOfProviderRow, S as validateMcpForm, T as instructionOriginBadge, _ as togglePanel, a as editTodo, d as buildPanelCatalog, g as resolveActiveTab, h as pickTab, i as cycleTodoStatus, j as selectableSources, n as buildTodoRetryMessage, p as cycleTab, r as clearTodos, s as removeTodo, t as addTodo, u as INITIAL_PANEL_STATE, v as NOTICE_GLYPH, w as buildVisibleInstructionRows, y as MCP_TRANSPORTS } from "./todo-edits-PxMJvYIX.js";
30
30
  import { basename, dirname, join, relative, resolve } from "node:path";
31
31
  import { Buffer } from "node:buffer";
32
32
  import * as fs from "node:fs";
@@ -4735,7 +4735,7 @@ function TodoInProgressList({ input, dim }) {
4735
4735
  }, item.id))
4736
4736
  });
4737
4737
  }
4738
- function ArtifactsPanel({ load, subscribe, registry, onOpen, onActions, onRefresh, width = 34 }) {
4738
+ function ArtifactsPanel({ load, subscribe, registry, onOpen, onActions, onRefresh, width = 34, header }) {
4739
4739
  const [footerHovered, setFooterHovered] = useState(false);
4740
4740
  const COLOR = useColors();
4741
4741
  const [artifacts, setArtifacts] = useState(null);
@@ -4782,52 +4782,56 @@ function ArtifactsPanel({ load, subscribe, registry, onOpen, onActions, onRefres
4782
4782
  paddingLeft: 1,
4783
4783
  paddingRight: 1
4784
4784
  },
4785
- children: [/* @__PURE__ */ jsx$1("scrollbox", {
4786
- focusable: false,
4787
- stickyScroll: false,
4788
- style: {
4789
- flexGrow: 1,
4790
- flexShrink: 1
4791
- },
4792
- children: artifacts === null ? /* @__PURE__ */ jsx$1("text", { children: /* @__PURE__ */ jsx$1("span", {
4793
- fg: COLOR.mute,
4794
- children: "loading…"
4795
- }) }) : total === 0 ? /* @__PURE__ */ jsx$1(EmptyState, { inner }) : groups.map((group, gi) => /* @__PURE__ */ jsxs("box", {
4785
+ children: [
4786
+ header,
4787
+ /* @__PURE__ */ jsx$1("scrollbox", {
4788
+ focusable: false,
4789
+ stickyScroll: false,
4796
4790
  style: {
4797
- flexDirection: "column",
4798
- flexShrink: 0,
4799
- marginTop: gi === 0 ? 0 : 1
4791
+ flexGrow: 1,
4792
+ flexShrink: 1
4800
4793
  },
4801
- children: [/* @__PURE__ */ jsx$1("text", {
4802
- wrapMode: "none",
4803
- children: /* @__PURE__ */ jsx$1("span", {
4804
- fg: COLOR.mute,
4805
- children: (group.rows.length === 1 ? group.label : `${group.label}s`).toUpperCase()
4806
- })
4807
- }), group.rows.map(({ artifact, row }) => /* @__PURE__ */ jsx$1(Row, {
4808
- artifact,
4809
- row,
4810
- inner,
4811
- onOpen
4812
- }, artifact.id))]
4813
- }, group.kind))
4814
- }), onActions && /* @__PURE__ */ jsx$1("text", {
4815
- wrapMode: "none",
4816
- style: { flexShrink: 0 },
4817
- selectable: false,
4818
- onMouseDown: (event) => {
4819
- event.stopPropagation();
4820
- event.preventDefault();
4821
- onActions();
4822
- },
4823
- onMouseOver: () => setFooterHovered(true),
4824
- onMouseOut: () => setFooterHovered(false),
4825
- children: /* @__PURE__ */ jsx$1("span", {
4826
- fg: footerHovered ? COLOR.accent : COLOR.mute,
4827
- children: "⋯ actions"
4794
+ children: artifacts === null ? /* @__PURE__ */ jsx$1("text", { children: /* @__PURE__ */ jsx$1("span", {
4795
+ fg: COLOR.mute,
4796
+ children: "loading…"
4797
+ }) }) : total === 0 ? /* @__PURE__ */ jsx$1(EmptyState, { inner }) : groups.map((group, gi) => /* @__PURE__ */ jsxs("box", {
4798
+ style: {
4799
+ flexDirection: "column",
4800
+ flexShrink: 0,
4801
+ marginTop: gi === 0 ? 0 : 1
4802
+ },
4803
+ children: [/* @__PURE__ */ jsx$1("text", {
4804
+ wrapMode: "none",
4805
+ children: /* @__PURE__ */ jsx$1("span", {
4806
+ fg: COLOR.mute,
4807
+ children: (group.rows.length === 1 ? group.label : `${group.label}s`).toUpperCase()
4808
+ })
4809
+ }), group.rows.map(({ artifact, row }) => /* @__PURE__ */ jsx$1(Row, {
4810
+ artifact,
4811
+ row,
4812
+ inner,
4813
+ onOpen
4814
+ }, artifact.id))]
4815
+ }, group.kind))
4816
+ }),
4817
+ onActions && /* @__PURE__ */ jsx$1("text", {
4818
+ wrapMode: "none",
4819
+ style: { flexShrink: 0 },
4820
+ selectable: false,
4821
+ onMouseDown: (event) => {
4822
+ event.stopPropagation();
4823
+ event.preventDefault();
4824
+ onActions();
4825
+ },
4826
+ onMouseOver: () => setFooterHovered(true),
4827
+ onMouseOut: () => setFooterHovered(false),
4828
+ children: /* @__PURE__ */ jsx$1("span", {
4829
+ fg: footerHovered ? COLOR.accent : COLOR.mute,
4830
+ children: "⋯ actions"
4831
+ })
4828
4832
  })
4829
- })]
4830
- }), /* @__PURE__ */ jsx$1(TitleOverlay, {
4833
+ ]
4834
+ }), !header && /* @__PURE__ */ jsx$1(TitleOverlay, {
4831
4835
  title: "artifacts",
4832
4836
  parentWidth: width,
4833
4837
  meta: total > 0 ? [{
@@ -4840,9 +4844,9 @@ function ArtifactsPanel({ load, subscribe, registry, onOpen, onActions, onRefres
4840
4844
  function Row({ artifact, row, inner, onOpen }) {
4841
4845
  const COLOR = useColors();
4842
4846
  const status = row.status ? ` ${row.status}` : "";
4843
- const clipFor = (text, max) => text.includes("/") ? clipStart(text, max) : clip(text, max);
4847
+ const clipFor = (text, max) => text.includes("/") ? clipStart$1(text, max) : clip$1(text, max);
4844
4848
  const title = clipFor(row.title, Math.max(4, inner - 2 - status.length));
4845
- const subtitle = row.subtitle && row.subtitle !== row.title ? clipStart(tail(row.subtitle), inner - 2) : null;
4849
+ const subtitle = row.subtitle && row.subtitle !== row.title ? clipStart$1(tail(row.subtitle), inner - 2) : null;
4846
4850
  return /* @__PURE__ */ jsxs("box", {
4847
4851
  style: {
4848
4852
  flexDirection: "column",
@@ -4956,10 +4960,10 @@ function statusColor$1(status, COLOR) {
4956
4960
  default: return COLOR.mute;
4957
4961
  }
4958
4962
  }
4959
- function clipStart(text, max) {
4963
+ function clipStart$1(text, max) {
4960
4964
  return text.length <= max ? text : `…${text.slice(text.length - Math.max(0, max - 1))}`;
4961
4965
  }
4962
- function clip(text, max) {
4966
+ function clip$1(text, max) {
4963
4967
  return text.length <= max ? text : `${text.slice(0, Math.max(0, max - 1))}…`;
4964
4968
  }
4965
4969
  /** For paths / URLs, the tail is the informative end — keep it. */
@@ -8304,6 +8308,338 @@ function describeModel(m) {
8304
8308
  return parts.join(" · ");
8305
8309
  }
8306
8310
  //#endregion
8311
+ //#region src/tui/panel-rail.tsx
8312
+ function PanelRail({ tabs, active, onPick, panels, loadCtx, artifacts, onOpenHref, width = 34 }) {
8313
+ const COLOR = useColors();
8314
+ const inner = Math.max(8, width - 4);
8315
+ const [badges, setBadges] = useState({});
8316
+ const onBadge = useCallback((id, badge) => {
8317
+ setBadges((prev) => prev[id] === badge ? prev : {
8318
+ ...prev,
8319
+ [id]: badge
8320
+ });
8321
+ }, []);
8322
+ const strip = /* @__PURE__ */ jsx$1(TabStrip$1, {
8323
+ tabs,
8324
+ activeId: active.id,
8325
+ badges,
8326
+ inner,
8327
+ onPick
8328
+ });
8329
+ if (active.builtin) return /* @__PURE__ */ jsx$1(ArtifactsPanel, {
8330
+ width,
8331
+ header: strip,
8332
+ load: artifacts.load,
8333
+ subscribe: artifacts.subscribe,
8334
+ registry: artifacts.registry,
8335
+ onOpen: artifacts.onOpen,
8336
+ onActions: artifacts.onActions,
8337
+ onRefresh: artifacts.onRefresh
8338
+ });
8339
+ const panel = panels.find((p) => p.id === active.id);
8340
+ return /* @__PURE__ */ jsx$1("box", {
8341
+ style: {
8342
+ width,
8343
+ flexShrink: 0,
8344
+ flexDirection: "column",
8345
+ marginLeft: 1
8346
+ },
8347
+ children: /* @__PURE__ */ jsxs("box", {
8348
+ style: {
8349
+ flexGrow: 1,
8350
+ flexDirection: "column",
8351
+ border: true,
8352
+ borderColor: COLOR.border,
8353
+ paddingLeft: 1,
8354
+ paddingRight: 1
8355
+ },
8356
+ children: [strip, panel ? /* @__PURE__ */ jsx$1(ExtensionTab, {
8357
+ panel,
8358
+ loadCtx,
8359
+ inner,
8360
+ onOpenHref,
8361
+ onBadge: (badge) => onBadge(panel.id, badge)
8362
+ }, panel.id) : /* @__PURE__ */ jsx$1("text", { children: /* @__PURE__ */ jsx$1("span", {
8363
+ fg: COLOR.mute,
8364
+ children: "panel unavailable"
8365
+ }) })]
8366
+ })
8367
+ });
8368
+ }
8369
+ function TabStrip$1({ tabs, activeId, badges, inner, onPick }) {
8370
+ const COLOR = useColors();
8371
+ const per = Math.max(4, Math.floor((inner - (tabs.length - 1) * 3) / Math.max(1, tabs.length)));
8372
+ return /* @__PURE__ */ jsx$1("box", {
8373
+ style: {
8374
+ flexDirection: "row",
8375
+ flexShrink: 0,
8376
+ marginBottom: 1
8377
+ },
8378
+ children: tabs.map((tab, i) => {
8379
+ const isActive = tab.id === activeId;
8380
+ const glyph = tab.icon?.tui ? `${tab.icon.tui} ` : "";
8381
+ const badge = tab.builtin ? void 0 : badges[tab.id];
8382
+ const label = clip(`${glyph}${tab.label.toLowerCase()}`, Math.max(3, per - (badge ? badge.length + 1 : 0)));
8383
+ return /* @__PURE__ */ jsxs("text", {
8384
+ wrapMode: "none",
8385
+ selectable: false,
8386
+ onMouseDown: (event) => {
8387
+ event.stopPropagation();
8388
+ event.preventDefault();
8389
+ onPick(tab.id);
8390
+ },
8391
+ children: [
8392
+ i > 0 && /* @__PURE__ */ jsx$1("span", {
8393
+ fg: COLOR.mute,
8394
+ children: " · "
8395
+ }),
8396
+ /* @__PURE__ */ jsx$1("span", {
8397
+ fg: isActive ? COLOR.brand : COLOR.dim,
8398
+ attributes: isActive ? 1 : 0,
8399
+ children: label
8400
+ }),
8401
+ badge && /* @__PURE__ */ jsx$1("span", {
8402
+ fg: COLOR.warn,
8403
+ children: ` ${badge}`
8404
+ })
8405
+ ]
8406
+ }, tab.id);
8407
+ })
8408
+ });
8409
+ }
8410
+ function ExtensionTab({ panel, loadCtx, inner, onOpenHref, onBadge }) {
8411
+ const COLOR = useColors();
8412
+ const [content, setContent] = useState(null);
8413
+ const [error, setError] = useState(null);
8414
+ const generation = useRef(0);
8415
+ const refresh = useCallback(() => {
8416
+ const gen = ++generation.current;
8417
+ Promise.resolve().then(() => panel.load(loadCtx)).then((raw) => {
8418
+ if (gen !== generation.current) return;
8419
+ const next = normalizePanelContent(raw);
8420
+ setContent(next);
8421
+ setError(null);
8422
+ onBadge(panelBadgeText(next.badge));
8423
+ }).catch((err) => {
8424
+ if (gen !== generation.current) return;
8425
+ setError(err instanceof Error ? err.message : String(err));
8426
+ });
8427
+ }, [
8428
+ panel,
8429
+ loadCtx,
8430
+ onBadge
8431
+ ]);
8432
+ useEffect(() => {
8433
+ refresh();
8434
+ }, [refresh]);
8435
+ useEffect(() => {
8436
+ if (!panel.subscribe) return;
8437
+ let timer = null;
8438
+ const unsubscribe = panel.subscribe(() => {
8439
+ if (timer) return;
8440
+ timer = setTimeout(() => {
8441
+ timer = null;
8442
+ refresh();
8443
+ }, 150);
8444
+ });
8445
+ return () => {
8446
+ if (timer) clearTimeout(timer);
8447
+ unsubscribe();
8448
+ };
8449
+ }, [panel, refresh]);
8450
+ const act = useCallback((actionId, payload) => {
8451
+ if (!panel.onAction) return;
8452
+ Promise.resolve().then(() => panel.onAction?.(actionId, payload, loadCtx)).then(refresh).catch((err) => setError(err instanceof Error ? err.message : String(err)));
8453
+ }, [
8454
+ panel,
8455
+ loadCtx,
8456
+ refresh
8457
+ ]);
8458
+ if (!content) return /* @__PURE__ */ jsx$1("text", { children: /* @__PURE__ */ jsx$1("span", {
8459
+ fg: error ? COLOR.warn : COLOR.mute,
8460
+ children: error ?? "loading…"
8461
+ }) });
8462
+ const isEmpty = content.sections.every((s) => s.items.length === 0);
8463
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("scrollbox", {
8464
+ focusable: false,
8465
+ stickyScroll: false,
8466
+ style: {
8467
+ flexGrow: 1,
8468
+ flexShrink: 1
8469
+ },
8470
+ children: [error && /* @__PURE__ */ jsx$1("text", {
8471
+ wrapMode: "none",
8472
+ children: /* @__PURE__ */ jsx$1("span", {
8473
+ fg: COLOR.warn,
8474
+ children: clip(error, inner)
8475
+ })
8476
+ }), isEmpty ? /* @__PURE__ */ jsx$1("text", {
8477
+ wrapMode: "none",
8478
+ children: /* @__PURE__ */ jsx$1("span", {
8479
+ fg: COLOR.mute,
8480
+ children: clip(content.empty ?? "nothing yet", inner)
8481
+ })
8482
+ }) : content.sections.map((section, si) => /* @__PURE__ */ jsxs("box", {
8483
+ style: {
8484
+ flexDirection: "column",
8485
+ flexShrink: 0,
8486
+ marginTop: si === 0 ? 0 : 1
8487
+ },
8488
+ children: [section.title && /* @__PURE__ */ jsx$1("text", {
8489
+ wrapMode: "none",
8490
+ children: /* @__PURE__ */ jsx$1("span", {
8491
+ fg: COLOR.mute,
8492
+ children: clip(section.title.toUpperCase(), inner)
8493
+ })
8494
+ }), section.items.map((item, ii) => /* @__PURE__ */ jsx$1(Item, {
8495
+ item,
8496
+ inner,
8497
+ onAct: act,
8498
+ onOpenHref
8499
+ }, `${section.id}:${ii}`))]
8500
+ }, section.id))]
8501
+ }), content.actions && content.actions.length > 0 && /* @__PURE__ */ jsx$1(Actions, {
8502
+ actions: content.actions,
8503
+ inner,
8504
+ onAct: act
8505
+ })] });
8506
+ }
8507
+ function Actions({ actions, inner, onAct }) {
8508
+ const COLOR = useColors();
8509
+ const [hover, setHover] = useState(null);
8510
+ return /* @__PURE__ */ jsx$1("box", {
8511
+ style: {
8512
+ flexDirection: "row",
8513
+ flexShrink: 0,
8514
+ flexWrap: "wrap"
8515
+ },
8516
+ children: actions.map((a, i) => /* @__PURE__ */ jsxs("text", {
8517
+ wrapMode: "none",
8518
+ selectable: false,
8519
+ onMouseDown: (event) => {
8520
+ event.stopPropagation();
8521
+ event.preventDefault();
8522
+ onAct(a.id);
8523
+ },
8524
+ onMouseOver: () => setHover(a.id),
8525
+ onMouseOut: () => setHover(null),
8526
+ children: [i > 0 && /* @__PURE__ */ jsx$1("span", {
8527
+ fg: COLOR.mute,
8528
+ children: " · "
8529
+ }), /* @__PURE__ */ jsx$1("span", {
8530
+ fg: hover === a.id ? COLOR.accent : a.tone === "danger" ? COLOR.error : COLOR.mute,
8531
+ children: clip(a.label, Math.max(3, inner))
8532
+ })]
8533
+ }, a.id))
8534
+ });
8535
+ }
8536
+ function Item({ item, inner, onAct, onOpenHref }) {
8537
+ const COLOR = useColors();
8538
+ const renderers = useExtensionRenderers();
8539
+ switch (item.kind) {
8540
+ case "row": {
8541
+ const status = item.status ? `${item.status} ` : "";
8542
+ const title = clipFor(item.title, Math.max(4, inner - status.length));
8543
+ const subtitle = item.subtitle && item.subtitle !== item.title ? clip(item.subtitle, inner - 2) : null;
8544
+ const clickable = Boolean(item.actionId || item.href && onOpenHref);
8545
+ const activate = () => {
8546
+ if (item.actionId) onAct(item.actionId, item.payload);
8547
+ else if (item.href && onOpenHref) onOpenHref(item.href);
8548
+ };
8549
+ return /* @__PURE__ */ jsxs("box", {
8550
+ style: {
8551
+ flexDirection: "column",
8552
+ flexShrink: 0
8553
+ },
8554
+ ...clickable ? { onMouseDown: (event) => {
8555
+ event.stopPropagation();
8556
+ event.preventDefault();
8557
+ activate();
8558
+ } } : {},
8559
+ children: [/* @__PURE__ */ jsxs("text", {
8560
+ wrapMode: "none",
8561
+ children: [status && /* @__PURE__ */ jsx$1("span", {
8562
+ fg: COLOR.warn,
8563
+ children: status
8564
+ }), /* @__PURE__ */ jsx$1("span", {
8565
+ fg: clickable ? COLOR.brand : COLOR.dim,
8566
+ children: title
8567
+ })]
8568
+ }), subtitle && /* @__PURE__ */ jsx$1("text", {
8569
+ wrapMode: "none",
8570
+ children: /* @__PURE__ */ jsx$1("span", {
8571
+ fg: COLOR.mute,
8572
+ children: ` ${subtitle}`
8573
+ })
8574
+ })]
8575
+ });
8576
+ }
8577
+ case "kv": return /* @__PURE__ */ jsx$1("box", {
8578
+ style: {
8579
+ flexDirection: "column",
8580
+ flexShrink: 0
8581
+ },
8582
+ children: item.rows.map((r, i) => {
8583
+ const label = clip(r.label, Math.max(3, Math.floor(inner / 3)));
8584
+ return /* @__PURE__ */ jsxs("text", {
8585
+ wrapMode: "none",
8586
+ children: [/* @__PURE__ */ jsx$1("span", {
8587
+ fg: COLOR.mute,
8588
+ children: label
8589
+ }), /* @__PURE__ */ jsx$1("span", {
8590
+ fg: COLOR.dim,
8591
+ children: ` ${clip(r.value, Math.max(3, inner - label.length - 1))}`
8592
+ })]
8593
+ }, `${r.label}:${i}`);
8594
+ })
8595
+ });
8596
+ case "markdown": return /* @__PURE__ */ jsx$1(Markdownish, {
8597
+ text: item.text,
8598
+ inner
8599
+ });
8600
+ case "custom": {
8601
+ const render = renderers.custom(item.renderer);
8602
+ if (!render) return /* @__PURE__ */ jsx$1(Markdownish, {
8603
+ text: item.fallback,
8604
+ inner
8605
+ });
8606
+ return /* @__PURE__ */ jsx$1("box", {
8607
+ style: {
8608
+ flexDirection: "column",
8609
+ flexShrink: 0
8610
+ },
8611
+ children: render(item.data)
8612
+ });
8613
+ }
8614
+ }
8615
+ }
8616
+ /** Plain-text rendering of markdown in a narrow rail: one line per source line, clipped. */
8617
+ function Markdownish({ text, inner }) {
8618
+ const COLOR = useColors();
8619
+ return /* @__PURE__ */ jsx$1("box", {
8620
+ style: {
8621
+ flexDirection: "column",
8622
+ flexShrink: 0
8623
+ },
8624
+ children: useMemo(() => text.split("\n").filter((l) => l.trim().length > 0).slice(0, 40), [text]).map((line, i) => /* @__PURE__ */ jsx$1("text", {
8625
+ wrapMode: "none",
8626
+ children: /* @__PURE__ */ jsx$1("span", {
8627
+ fg: COLOR.dim,
8628
+ children: clip(line.replace(/^#+\s*/, "").replace(/[*_`]/g, ""), inner)
8629
+ })
8630
+ }, i))
8631
+ });
8632
+ }
8633
+ function clipFor(text, max) {
8634
+ return text.includes("/") ? clipStart(text, max) : clip(text, max);
8635
+ }
8636
+ function clipStart(text, max) {
8637
+ return text.length <= max ? text : `…${text.slice(text.length - Math.max(0, max - 1))}`;
8638
+ }
8639
+ function clip(text, max) {
8640
+ return text.length <= max ? text : `${text.slice(0, Math.max(0, max - 1))}…`;
8641
+ }
8642
+ //#endregion
8307
8643
  //#region src/tui/tui-logging.ts
8308
8644
  let holder$4 = null;
8309
8645
  /**
@@ -23282,9 +23618,15 @@ function AppShell() {
23282
23618
  artifactCatalogRef.current = [];
23283
23619
  artifactCatalogSessionRef.current = null;
23284
23620
  }), [subscribeArtifacts]);
23285
- const [artifactsPanelOpen, setArtifactsPanelOpen] = useState(false);
23621
+ const [panelState, setPanelState] = useState(INITIAL_PANEL_STATE);
23622
+ const panelTabs = useMemo(() => buildPanelCatalog(filteredExtensionRegistry.panels, { showArtifacts: settings.artifacts !== false }), [filteredExtensionRegistry.panels, settings.artifacts]);
23623
+ const activePanelTab = useMemo(() => resolveActiveTab(panelState, panelTabs), [panelState, panelTabs]);
23624
+ const panelLoadCtx = useMemo(() => ({
23625
+ ...currentSession ? { sessionId: currentSession.id } : {},
23626
+ cwd
23627
+ }), [currentSession, cwd]);
23286
23628
  const { width: termWidth } = useTerminalDimensions();
23287
- const artifactsPanelVisible = settings.artifacts !== false && artifactsPanelOpen && screen === "chat" && currentSession !== null && termWidth >= 110;
23629
+ const artifactsPanelVisible = panelState.open && activePanelTab !== null && screen === "chat" && currentSession !== null && termWidth >= 110;
23288
23630
  const loadPanelArtifacts = useCallback(() => listArtifactsRef.current("session"), []);
23289
23631
  const openArtifactHref = useCallback((href) => {
23290
23632
  if (/^https?:\/\//.test(href)) {
@@ -28556,8 +28898,16 @@ function AppShell() {
28556
28898
  }));
28557
28899
  return;
28558
28900
  }
28559
- if (matchesBinding(key, keybindings.openArtifacts) && screen === "chat" && currentSession && settings.artifacts !== false) {
28560
- setArtifactsPanelOpen((open) => !open);
28901
+ if (matchesBinding(key, keybindings.openArtifacts) && screen === "chat" && currentSession && panelTabs.length > 0) {
28902
+ setPanelState(togglePanel);
28903
+ return;
28904
+ }
28905
+ if (matchesBinding(key, keybindings.panelNext) && screen === "chat" && currentSession && panelTabs.length > 0) {
28906
+ setPanelState((state) => cycleTab(state, panelTabs, 1));
28907
+ return;
28908
+ }
28909
+ if (matchesBinding(key, keybindings.panelPrev) && screen === "chat" && currentSession && panelTabs.length > 0) {
28910
+ setPanelState((state) => cycleTab(state, panelTabs, -1));
28561
28911
  return;
28562
28912
  }
28563
28913
  if (matchesBinding(key, keybindings.openContextPanel) && screen === "chat" && picked) {
@@ -29044,13 +29394,21 @@ function AppShell() {
29044
29394
  sessionDetailsBinding: keybindings.openSessionDetails,
29045
29395
  abortBinding: keybindings.abortRun
29046
29396
  })
29047
- }), artifactsPanelVisible && /* @__PURE__ */ jsx$1(ArtifactsPanel, {
29048
- load: loadPanelArtifacts,
29049
- subscribe: subscribeArtifacts,
29050
- registry: filteredExtensionRegistry,
29051
- onOpen: openArtifactHref,
29052
- onActions: () => openArtifactsModal("session"),
29053
- onRefresh: (artifact) => refreshArtifactRow(artifact, { force: true })
29397
+ }), artifactsPanelVisible && activePanelTab && /* @__PURE__ */ jsx$1(PanelRail, {
29398
+ tabs: panelTabs,
29399
+ active: activePanelTab,
29400
+ onPick: (id) => setPanelState((state) => pickTab(state, id)),
29401
+ panels: filteredExtensionRegistry.panels,
29402
+ loadCtx: panelLoadCtx,
29403
+ onOpenHref: openArtifactHref,
29404
+ artifacts: {
29405
+ load: loadPanelArtifacts,
29406
+ subscribe: subscribeArtifacts,
29407
+ registry: filteredExtensionRegistry,
29408
+ onOpen: openArtifactHref,
29409
+ onActions: () => openArtifactsModal("session"),
29410
+ onRefresh: (artifact) => refreshArtifactRow(artifact, { force: true })
29411
+ }
29054
29412
  })]
29055
29413
  })
29056
29414
  ]