claude-code-best 2.6.0 → 2.6.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.
- package/dist/chunks/{AddWorkspaceDirectory-Cj5bvJgD.js → AddWorkspaceDirectory-BYyM_V0q.js} +1 -1
- package/dist/chunks/{App-2tgSv9lb.js → App-BboadKdn.js} +1 -1
- package/dist/chunks/{ApproveApiKey-DWa-XTLb.js → ApproveApiKey-BLp4742y.js} +1 -1
- package/dist/chunks/ApproveApiKey-DiEe4eui.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-DF9eeJZS.js → AssistantSessionChooser-B88DM0Oq.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-DXJdube9.js → BackgroundTasksDialog-ByraVuXh.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-BOSW4Zdy.js → BypassPermissionsModeDialog-BDvmz12S.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-BW4XHmkw.js → ClaudeInChromeOnboarding-B6XNhFqq.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-Bz0JyaOG.js → ClaudeMdExternalIncludesDialog-BNhlq7_K.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +1 -0
- package/dist/chunks/{DesktopHandoff-CcsM_OAS.js → DesktopHandoff-S-w4bs5T.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-DXRgY00D.js → DevChannelsDialog-BljR0X9X.js} +1 -1
- package/dist/chunks/{DiffDialog-PvNZfZby.js → DiffDialog-BhQ2QaLW.js} +1 -1
- package/dist/chunks/{Doctor-CE_jL9jC.js → Doctor-BXb0qv6n.js} +1 -1
- package/dist/chunks/Doctor-C5DYPEGl.js +1 -0
- package/dist/chunks/{ExitFlow-C4ybxKPn.js → ExitFlow-CSBDxw9H.js} +1 -1
- package/dist/chunks/{Feedback-B5rPGl_C.js → Feedback-DwHzc4UT.js} +1 -1
- package/dist/chunks/{Grove-CKVpREDU.js → Grove-DSXRnXKv.js} +1 -1
- package/dist/chunks/Grove-DnTo982-.js +1 -0
- package/dist/chunks/{HybridTransport-Byjvz-DL.js → HybridTransport-CuT3KI5e.js} +1 -1
- package/dist/chunks/{ITermBackend-Co9XpeS4.js → ITermBackend-mokGZVH_.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-CNsqbNU3.js → InvalidConfigDialog-Bi4RKYlk.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-ClnZaN6b.js → InvalidSettingsDialog-0zKo4-so.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-CDsa79pu.js → MCPConnectionManager-DYGoS1Ht.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-DZkzoeZf.js → McpParsingWarnings-EzgsOoHw.js} +1 -1
- package/dist/chunks/{MessageSelector-CkeGQPNM.js → MessageSelector-DTmUuEKJ.js} +1 -1
- package/dist/chunks/{Messages-PfbzLYOU.js → Messages-DWiKTx5o.js} +2 -2
- package/dist/chunks/{Onboarding-BwoGQB4g.js → Onboarding-odmthwzz.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-Q5g2YjQw.js → OverageCreditUpsell-Cpk_5Lv0.js} +1 -1
- package/dist/chunks/{PluginSettings-B2ASJ0Rx.js → PluginSettings-eYcWehI8.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-D4lMVCqj.js → PromptInputFooterSuggestions-DrrkNOuS.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-BvLtS6an.js → PromptInputHelpMenu-DMsF4D6d.js} +1 -1
- package/dist/chunks/{QueryEngine-Av0G5fze.js → QueryEngine-C_KZts4y.js} +1 -1
- package/dist/chunks/REPL-C6YR0VKU.js +1 -0
- package/dist/chunks/{REPL-Dh8vzGmF.js → REPL-DzHz-LOY.js} +6 -6
- package/dist/chunks/{RemoteCallout-BV_hoz98.js → RemoteCallout-CnpCWRPk.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-Cxoy1ud2.js → RemoteSessionManager-OWg_Yccq.js} +1 -1
- package/dist/chunks/{ResumeConversation-B3WuB8rs.js → ResumeConversation-BktSnsCm.js} +1 -1
- package/dist/chunks/{SSETransport-pIm26VJq.js → SSETransport-BpnapvlK.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-B6EWoJml.js → SentryErrorBoundary-C-NlfQZw.js} +1 -1
- package/dist/chunks/{Settings-CreAhCsb.js → Settings-vfFvcweR.js} +2 -2
- package/dist/chunks/{TeleportProgress-DPzGpyyM.js → TeleportProgress-CYXay2ZL.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-DqWQX6j8.js → TeleportRepoMismatchDialog-_zbZTvcJ.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-DPSO0S49.js → TeleportResumeWrapper-DiHQeZIM.js} +1 -1
- package/dist/chunks/{ThemePicker-DueihHcy.js → ThemePicker-BRh027fA.js} +1 -1
- package/dist/chunks/{TmuxBackend-BNaZNAeP.js → TmuxBackend-BaX2U7iZ.js} +1 -1
- package/dist/chunks/{TrustDialog-CIzAlGn9.js → TrustDialog-CVbzrv6g.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-1k1qbsRo.js → ValidationErrorsList-CdCUgfIl.js} +1 -1
- package/dist/chunks/{WelcomeV2-CR6TtXXM.js → WelcomeV2-DCXcYd2x.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-C5SeTXqC.js → WindowsTerminalBackend-BE9NX5IH.js} +1 -1
- package/dist/chunks/{add-dir-DAMizKzF.js → add-dir-ldGd3Ppz.js} +1 -1
- package/dist/chunks/{agentDisplay-B9z7i8b_.js → agentDisplay-CVnAeURF.js} +1 -1
- package/dist/chunks/{agents-DCh_gEvJ.js → agents-C08NzRZx.js} +1 -1
- package/dist/chunks/{agents-D5u0p1UC.js → agents-DH5fmbVw.js} +1 -1
- package/dist/chunks/{ant-DRJq-cEg.js → ant-DJren1Aa.js} +1 -1
- package/dist/chunks/api-6tcwJlf_.js +1 -0
- package/dist/chunks/{api-B6URs6nc.js → api-CGOR_Xfl.js} +1 -1
- package/dist/chunks/{assistant-BRGDWkKB.js → assistant-BlzrMSkM.js} +1 -1
- package/dist/chunks/assistant-CwbhlCM-.js +1 -0
- package/dist/chunks/{assistant-tPxOUa-Z.js → assistant-aWkDcurV.js} +1 -1
- package/dist/chunks/{auth-CqURlg4d.js → auth-CSB2RDKF.js} +1 -1
- package/dist/chunks/auth-GxZhOvQ1.js +1 -0
- package/dist/chunks/{autoMode-DVt4K4I2.js → autoMode-CWvZs1jO.js} +1 -1
- package/dist/chunks/{autonomy-Ffv0QIyl.js → autonomy-BkVcSMCZ.js} +1 -1
- package/dist/chunks/{autonomy-BZzW8QJZ.js → autonomy-DK42aJYt.js} +1 -1
- package/dist/chunks/{autonomyPanel-MwuzDvv_.js → autonomyPanel-Cn4IhXgE.js} +1 -1
- package/dist/chunks/{backgroundHousekeeping-CYnAG60-.js → backgroundHousekeeping-BIZTAYho.js} +2 -2
- package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +1 -0
- package/dist/chunks/{branch-DXefFdDE.js → branch-juox_fko.js} +1 -1
- package/dist/chunks/{bridge-qr4GQW_c.js → bridge-DudsCZkh.js} +2 -2
- package/dist/chunks/bridgeConfig-D4tpc568.js +1 -0
- package/dist/chunks/{bridgeConfig-CJ-KznTS.js → bridgeConfig-lRZfQqmA.js} +1 -1
- package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +1 -0
- package/dist/chunks/{bridgeEnabled-5vsPrjuq.js → bridgeEnabled-D2IykaHE.js} +1 -1
- package/dist/chunks/{bridgeMain-BimZwc2P.js → bridgeMain-C5RDihlX.js} +6 -6
- package/dist/chunks/bridgeMain-D7_lg2iJ.js +1 -0
- package/dist/chunks/{bridgeMessaging-BiE0CTqq.js → bridgeMessaging-CqNURC4-.js} +1 -1
- package/dist/chunks/{btw-FpimqEqk.js → btw-DKlE3Dea.js} +1 -1
- package/dist/chunks/{buddy-BA3Cr067.js → buddy-DQYgHR63.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-CSC9p8mO.js → bypassPermissionsKillswitch-Bof-UtM-.js} +1 -1
- package/dist/chunks/{caches-BUBkfP2Q.js → caches-B5QZDncQ.js} +2 -2
- package/dist/chunks/caches-dGk7xsDu.js +1 -0
- package/dist/chunks/{ccrClient-BOxUn9EJ.js → ccrClient-BaWg4E9-.js} +1 -1
- package/dist/chunks/changeDetector-DoLfg8a6.js +1 -0
- package/dist/chunks/{channelNotification-l3EXKDNB.js → channelNotification-B7A-9DIl.js} +1 -1
- package/dist/chunks/channelNotification-DDErroWn.js +1 -0
- package/dist/chunks/{chrome-BnKyWWQL.js → chrome-jMAks7-w.js} +1 -1
- package/dist/chunks/clear-OudnCGa7.js +1 -0
- package/dist/chunks/client-DxDmXXTh.js +1 -0
- package/dist/chunks/{color-D5MCzz9h.js → color-DG_R5-hl.js} +1 -1
- package/dist/chunks/commands-BWIOEBPs.js +1 -0
- package/dist/chunks/commitAttribution-BA4fcbHf.js +1 -0
- package/dist/chunks/{commitAttribution-BFshsh2H.js → commitAttribution-C22a3OCi.js} +1 -1
- package/dist/chunks/{compact-DWNaf1wR.js → compact-BWvnb4or.js} +1 -1
- package/dist/chunks/{companion-CyK_Dr1U.js → companion-Bkn2lSLj.js} +1 -1
- package/dist/chunks/{config-DNz6Eitr.js → config-BvpTbJ5p.js} +1 -1
- package/dist/chunks/{config-BdCuh6eA.js → config-D-dzD6n-.js} +1 -1
- package/dist/chunks/{context-BOjdTj0i.js → context-DzNahdyP.js} +1 -1
- package/dist/chunks/context-noninteractive-CM1-lUSe.js +1 -0
- package/dist/chunks/{context-noninteractive-k2ibficU.js → context-noninteractive-yiyJriiw.js} +1 -1
- package/dist/chunks/{conversation-Ci8O_eZ-.js → conversation-DKlz47xf.js} +1 -1
- package/dist/chunks/conversation-cUxdb8MN.js +1 -0
- package/dist/chunks/{copy-B0VUJ2rH.js → copy-9k9JPRqW.js} +1 -1
- package/dist/chunks/{createSSHSession-DqmkCS_k.js → createSSHSession-BZf-Loo5.js} +1 -1
- package/dist/chunks/createSession-BuJcoBAj.js +1 -0
- package/dist/chunks/{createSession-CJEsHz58.js → createSession-kiTHYXSL.js} +1 -1
- package/dist/chunks/{cronJitterConfig-BzPaa52I.js → cronJitterConfig-CYP7yrQu.js} +1 -1
- package/dist/chunks/{crossProjectResume-tWsqBUHc.js → crossProjectResume-BJisir9Z.js} +1 -1
- package/dist/chunks/{datadog-Bd1s_VFj.js → datadog-Bg-zL-i7.js} +1 -1
- package/dist/chunks/datadog-CVeFkaQu.js +1 -0
- package/dist/chunks/{desktop-BDowrzvG.js → desktop-DpaStjc-.js} +1 -1
- package/dist/chunks/{diff-auU5sUOw.js → diff-N_VSBo3Z.js} +1 -1
- package/dist/chunks/{doctor-bKPp6AeL.js → doctor-CUWjbh1X.js} +1 -1
- package/dist/chunks/{effort-BQj2QnnA.js → effort-loH1TUvE.js} +3 -3
- package/dist/chunks/{entry-CUu6-QhT.js → entry-D58E-E6Y.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +1 -0
- package/dist/chunks/{envLessBridgeConfig-Ju4W58xf.js → envLessBridgeConfig-SPEr9oqO.js} +1 -1
- package/dist/chunks/{exit-DijkO8eo.js → exit-D-tuPpbx.js} +1 -1
- package/dist/chunks/{export-DA-bBZkX.js → export-BIZ_SPXJ.js} +1 -1
- package/dist/chunks/{exportRenderer-3y4tGdSB.js → exportRenderer-CWPSMaqM.js} +1 -1
- package/dist/chunks/{extra-usage-CS6VwKJt.js → extra-usage-CCMwIa85.js} +1 -1
- package/dist/chunks/{extra-usage-core-DOgT4u4i.js → extra-usage-core-BNW4VT7o.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-DYnfiRlV.js → extra-usage-noninteractive-B_WjXO1E.js} +1 -1
- package/dist/chunks/extra-usage-rdJ7ecEb.js +1 -0
- package/dist/chunks/{extraUsage-CfxgfpX_.js → extraUsage-CNMMTNJi.js} +1 -1
- package/dist/chunks/extractMemories-BrvZVsmM.js +1 -0
- package/dist/chunks/{fast-CzRUJBTK.js → fast-CG1v3fRr.js} +1 -1
- package/dist/chunks/fast-CLKKsx2H.js +1 -0
- package/dist/chunks/{feedback-FoXtdHAV.js → feedback-CG4mS_-B.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-KIwaBY-E.js → firstPartyEventLogger-Y_jAnHoR.js} +1 -1
- package/dist/chunks/{flushGate-C2Icy43G.js → flushGate-COPcye5f.js} +1 -1
- package/dist/chunks/gates-CSHuXnUx.js +1 -0
- package/dist/chunks/{gates-CbQLZHtm.js → gates-CSKxLmMJ.js} +1 -1
- package/dist/chunks/{gemini-BrNJGX4k.js → gemini-B3uSLiNp.js} +1 -1
- package/dist/chunks/{generateRecap-B0fvSCjo.js → generateRecap-D7rG3jIm.js} +1 -1
- package/dist/chunks/{generateSessionName-DvRYa39O.js → generateSessionName-zbqanivg.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-Dut3d6nn.js → githubRepoPathMapping-B04nEUDG.js} +1 -1
- package/dist/chunks/{grok-Ftoheab3.js → grok-CDOpos8E.js} +1 -1
- package/dist/chunks/{growthbook-BynnuVTn.js → growthbook-C_EY78Sn.js} +1 -1
- package/dist/chunks/{heapdump-hQ_w0LPC.js → heapdump-CpmhJ55b.js} +1 -1
- package/dist/chunks/{help-DQsHHv6r.js → help-EHn2neTv.js} +1 -1
- package/dist/chunks/hooks-BFdX17Za.js +1 -0
- package/dist/chunks/{hooks-BhVDc8yb.js → hooks-BV6HqbU4.js} +1 -1
- package/dist/chunks/{hostAdapter-D1eWmmhu.js → hostAdapter-_SmFAVNf.js} +1 -1
- package/dist/chunks/{ide-CPmMXLL-.js → ide-DkN0KdTR.js} +1 -1
- package/dist/chunks/inboundAttachments-BVUunfAX.js +1 -0
- package/dist/chunks/{inboundAttachments-Bmf6vYsE.js → inboundAttachments-DnGQw7Pf.js} +1 -1
- package/dist/chunks/{initReplBridge-BiHXpDEY.js → initReplBridge-tPRGPBq7.js} +1 -1
- package/dist/chunks/{insights-CTlTyvjj.js → insights-Bs9kJDG6.js} +1 -1
- package/dist/chunks/{install-IPuD3Lq8.js → install-CFX_ph9z.js} +1 -1
- package/dist/chunks/{install-github-app-Bmu_sA9e.js → install-github-app-CvRjY1Wi.js} +1 -1
- package/dist/chunks/{install-slack-app-Rfl81Jqo.js → install-slack-app-DjhnVSe0.js} +1 -1
- package/dist/chunks/{instrumentation-DWwmOmr0.js → instrumentation-c5zlOWom.js} +3 -3
- package/dist/chunks/{job-BXEt0izn.js → job-3QwLq609.js} +1 -1
- package/dist/chunks/{keybindings-DRDgVvqz.js → keybindings-7mDm3UKD.js} +1 -1
- package/dist/chunks/{lang-D3ZHlfT6.js → lang-DyyjY20G.js} +1 -1
- package/dist/chunks/{language-DcSjogBx.js → language-CPRGmY8Q.js} +1 -1
- package/dist/chunks/language-Cf6bMI4N.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-BPm_VMln.js → launchAgentsPlatform-CpsMsTqQ.js} +1 -1
- package/dist/chunks/{launchAutofixPr-D2qac07g.js → launchAutofixPr-D9h6YAZY.js} +1 -1
- package/dist/chunks/{launchLocalMemory-D_hBbXKE.js → launchLocalMemory-DlYQcEQJ.js} +1 -1
- package/dist/chunks/{launchLocalVault-CPzNWvQ9.js → launchLocalVault-CP0AyPjj.js} +1 -1
- package/dist/chunks/{launchMemoryStores-Djq2KhKb.js → launchMemoryStores-BHoDFkJ5.js} +1 -1
- package/dist/chunks/{launchOnboarding-Bh6E7vdc.js → launchOnboarding-CFTNXcnc.js} +1 -1
- package/dist/chunks/{launchSchedule-C988bQ-5.js → launchSchedule-5KQr6x_A.js} +1 -1
- package/dist/chunks/{launchSkillStore-DqrP6Gme.js → launchSkillStore-D0yGuE68.js} +1 -1
- package/dist/chunks/{launchTeleport-DFhybaq_.js → launchTeleport-DRKnXOwY.js} +1 -1
- package/dist/chunks/{launchVault-p_CSK4ZQ.js → launchVault-XA-zAswX.js} +1 -1
- package/dist/chunks/loadAgentsDir-DCyiY0MN.js +1 -0
- package/dist/chunks/{loadAgentsDir-Ci5mr0vm.js → loadAgentsDir-DI1a76pd.js} +700 -700
- package/dist/chunks/{loadPluginHooks-xYCEZ6t5.js → loadPluginHooks-C0Ei-0E2.js} +1 -1
- package/dist/chunks/{localSearch-Vpn6W5aY.js → localSearch-CDOJNc_E.js} +1 -1
- package/dist/chunks/localSearch-MBx7KzC2.js +1 -0
- package/dist/chunks/login-D8UKKaud.js +1 -0
- package/dist/chunks/{login-D9IWjvza.js → login-nwTOoyxv.js} +1 -1
- package/dist/chunks/{logoV2Utils-SAulcC5x.js → logoV2Utils-DDUoPClc.js} +1 -1
- package/dist/chunks/logout-B0BjqlGi.js +1 -0
- package/dist/chunks/{magicDocs-BfoeYhin.js → magicDocs-CmUlOWjI.js} +1 -1
- package/dist/chunks/{main-DhMlhVj3.js → main-CeG_nUsC.js} +15 -15
- package/dist/chunks/{mappers-uIrAj-Wd.js → mappers-CJ8IO1o1.js} +1 -1
- package/dist/chunks/{mcp-DlM0OC6R.js → mcp-CanCqnch.js} +1 -1
- package/dist/chunks/{mcp-COQap0SM.js → mcp-Dq0kxZFx.js} +2 -2
- package/dist/chunks/{mcp-CAYGNxCb.js → mcp-zbxZM9BP.js} +1 -1
- package/dist/chunks/{mcpServer-DXvS3v4x.js → mcpServer-DPHQVYdC.js} +1 -1
- package/dist/chunks/{mcpServer-1SnOWb8_.js → mcpServer-lIneUZ5p.js} +1 -1
- package/dist/chunks/{memory-XccPLQLt.js → memory-BcWBkKV8.js} +1 -1
- package/dist/chunks/{model-CbiDGGJU.js → model-DJLzVvcF.js} +1 -1
- package/dist/chunks/model-H3rtl6eR.js +1 -0
- package/dist/chunks/{onChangeAppState-Dp0JIXd8.js → onChangeAppState-Dxbl8fvk.js} +1 -1
- package/dist/chunks/{openai-6KcHd4Hw.js → openai-DkYK4THc.js} +1 -1
- package/dist/chunks/{overageCreditGrant-DYiB4sr-.js → overageCreditGrant-DLKadMYU.js} +1 -1
- package/dist/chunks/{passes-Cbc6T_Tj.js → passes-BIfuerjL.js} +1 -1
- package/dist/chunks/{paths-Q2255dD7.js → paths-BBvuDQl9.js} +2 -2
- package/dist/chunks/{permissions-BLzPHh_3.js → permissions-S2EvIRKj.js} +1 -1
- package/dist/chunks/{pipeTransport-D7NIp3aA.js → pipeTransport-DVoIA1uN.js} +1 -1
- package/dist/chunks/{plan-DloFVJK7.js → plan--lnWxB3Q.js} +1 -1
- package/dist/chunks/{plugin-XR9IBPMM.js → plugin-DWLyrLw4.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-Cr9hP0zG.js → pluginAutoupdate-CGXIWBrb.js} +1 -1
- package/dist/chunks/{pluginBlocklist-CM9uP8CY.js → pluginBlocklist-DJrMdzT0.js} +1 -1
- package/dist/chunks/{pluginCliCommands-BQkrvES5.js → pluginCliCommands-C08q9dHk.js} +1 -1
- package/dist/chunks/{pluginFlagging-CJ1--2Kw.js → pluginFlagging-Dggxke70.js} +1 -1
- package/dist/chunks/{pluginOperations-B0rLuSvo.js → pluginOperations-CNCImIe8.js} +1 -1
- package/dist/chunks/{pluginStartupCheck-Bjdc8zhz.js → pluginStartupCheck-BW2fjg2P.js} +1 -1
- package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +1 -0
- package/dist/chunks/{plugins-BgOP_8TX.js → plugins-DQ3CRWWO.js} +1 -1
- package/dist/chunks/policyLimits-BotYrS-v.js +1 -0
- package/dist/chunks/{pollConfig-DhptuhFw.js → pollConfig-DAQ-ives.js} +1 -1
- package/dist/chunks/{poor-DF0aqXDx.js → poor-DqfrQT61.js} +1 -1
- package/dist/chunks/poorMode-DEAe3hiK.js +1 -0
- package/dist/chunks/{poorMode-C5Frra4j.js → poorMode-DzYT47KW.js} +1 -1
- package/dist/chunks/{print-CPtR0KTa.js → print-GGVp62vj.js} +4 -4
- package/dist/chunks/{privacy-settings-e-7lc7Un.js → privacy-settings-agwqjYJo.js} +1 -1
- package/dist/chunks/{processBashCommand-D5dC6Mya.js → processBashCommand-DHHN8Ca4.js} +1 -1
- package/dist/chunks/{processSlashCommand-DHRUtZ-C.js → processSlashCommand-COtIO6Jy.js} +1 -1
- package/dist/chunks/prompt-CO160cIr.js +1 -0
- package/dist/chunks/{prompt-DEPUnJdB.js → prompt-CjFAtm3w.js} +1 -1
- package/dist/chunks/prompt-GY9hlRvI.js +1 -0
- package/dist/chunks/{promptEditor-Ci-h04-5.js → promptEditor-EgosPsy-.js} +1 -1
- package/dist/chunks/{protocolHandler-DhqM32qE.js → protocolHandler-mtPUT9U0.js} +1 -1
- package/dist/chunks/{rate-limit-options-B0l29Zx8.js → rate-limit-options-C6SFOHue.js} +1 -1
- package/dist/chunks/{rcDebugLog-BbPkkigY.js → rcDebugLog-CPKZCtR8.js} +1 -1
- package/dist/chunks/{referral-ByevBJrE.js → referral-DeDr9zAE.js} +1 -1
- package/dist/chunks/{refresh-B_CwwIRX.js → refresh-D7pdoY_X.js} +1 -1
- package/dist/chunks/{registerProtocol-DzhaQH02.js → registerProtocol-BZBH8Zgl.js} +1 -1
- package/dist/chunks/{registry-DkHA4cRu.js → registry-Dz6AbiYP.js} +1 -1
- package/dist/chunks/{release-notes-CZthYkei.js → release-notes-DiUNOrg9.js} +1 -1
- package/dist/chunks/{releaseNotes-CwKpIsyd.js → releaseNotes-CnhQit0y.js} +2 -2
- package/dist/chunks/{reload-plugins-DxWfXvrN.js → reload-plugins-Dx52GcaG.js} +1 -1
- package/dist/chunks/{remote-env-BiRLWIrh.js → remote-env-B67Oo3sI.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-nz1fPY1U.js → remoteBridgeCore-BzSUgPbt.js} +1 -1
- package/dist/chunks/{remoteControlServer-FzLUxh2B.js → remoteControlServer-L8smP7Zu.js} +1 -1
- package/dist/chunks/{rename-DmGuyncE.js → rename-C4PauyTZ.js} +1 -1
- package/dist/chunks/{resume-7GeU7RMS.js → resume-CrSn26xq.js} +1 -1
- package/dist/chunks/{runtimeObserver-OgM9ZYxZ.js → runtimeObserver-YNy3mIb7.js} +1 -1
- package/dist/chunks/{runtimeObserver-Duod-ign.js → runtimeObserver-nAhH4Wca.js} +2 -2
- package/dist/chunks/sandbox-adapter-CzwHes1i.js +1 -0
- package/dist/chunks/{sandbox-toggle-Cc96R6Ox.js → sandbox-toggle-BYqbcI5d.js} +1 -1
- package/dist/chunks/searchExtraTools-CcpdCO6l.js +1 -0
- package/dist/chunks/{sentry-BUHYuYGj.js → sentry-BNVxoVLS.js} +1 -1
- package/dist/chunks/{session-DgLqm7ZI.js → session-BuEmHrqM.js} +1 -1
- package/dist/chunks/{sessionDiscovery-DgNea6qa.js → sessionDiscovery-Mcsfa0g-.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +1 -0
- package/dist/chunks/{sessionMemory-_dmj8lcH.js → sessionMemory-CMahwDdW.js} +1 -1
- package/dist/chunks/sessionMemory-pFSn4HSN.js +1 -0
- package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +1 -0
- package/dist/chunks/{sessionObserver-CuWMVPlT.js → sessionObserver-DG2zQgfi.js} +1 -1
- package/dist/chunks/sessionObserver-Je868MC9.js +1 -0
- package/dist/chunks/sessionStorage-D3FhAADV.js +1 -0
- package/dist/chunks/{sessionTitle-DzkMzHer.js → sessionTitle-zUVSAHO7.js} +1 -1
- package/dist/chunks/{sessionTracing-DTjmc0EF.js → sessionTracing-DoRJ4nSa.js} +1 -1
- package/dist/chunks/{settingsSync-CfYDkakY.js → settingsSync-B9bz77E1.js} +1 -1
- package/dist/chunks/{setup-BKUG46jQ.js → setup-B1JbPepL.js} +1 -1
- package/dist/chunks/{setup-CmLngvpJ.js → setup-CCOLlRtP.js} +1 -1
- package/dist/chunks/{setup-TqJ7-Nxh.js → setup-DWkSjA49.js} +2 -2
- package/dist/chunks/{shadowedRuleDetection-DesT0yKM.js → shadowedRuleDetection-BBR3uEgx.js} +1 -1
- package/dist/chunks/{sideQuestion-BAq0YyKY.js → sideQuestion-DHW5rgKz.js} +1 -1
- package/dist/chunks/{sink-B3uP8Cf8.js → sink-DxDOsLa2.js} +1 -1
- package/dist/chunks/sink-cQOgsnw3.js +1 -0
- package/dist/chunks/{sinks-COcy5GnB.js → sinks-BrrTUxkC.js} +2 -2
- package/dist/chunks/sinks-Djiz_5-Z.js +1 -0
- package/dist/chunks/{skill-learning-DOIMPtWE.js → skill-learning-C0nOKZfg.js} +1 -1
- package/dist/chunks/{skillChangeDetector-CA_Tdx8N.js → skillChangeDetector-D8C-uQSQ.js} +1 -1
- package/dist/chunks/{skillGapStore-CWuw1dYh.js → skillGapStore-Czi5jKjJ.js} +1 -1
- package/dist/chunks/{skillGapStore-DpEoKhn-.js → skillGapStore-_YuJP5KI.js} +2 -2
- package/dist/chunks/{skillGenerator-9y3Q4YoO.js → skillGenerator-kbaRbpqJ.js} +2 -2
- package/dist/chunks/skillLearning-3KWrBczS.js +1 -0
- package/dist/chunks/skillLearning-DBbdGbk-.js +1 -0
- package/dist/chunks/{skillPanel-Dt24mZTZ.js → skillPanel-BxDvlPzd.js} +3 -3
- package/dist/chunks/{skillSearchPanel-gaXN64Fu.js → skillSearchPanel-D-MX6Qgt.js} +2 -2
- package/dist/chunks/{skills-Dx3dMHYk.js → skills-NpEgFkFZ.js} +1 -1
- package/dist/chunks/{sprites-5OAB-Ui2.js → sprites-DD4eIkN7.js} +1 -1
- package/dist/chunks/{stats-TUExo9iU.js → stats-xL3NHwhp.js} +1 -1
- package/dist/chunks/{status-Dghaz1my.js → status-B5E70xRv.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-DVZSSXeK.js → statusNoticeHelpers-DcssRhLw.js} +1 -1
- package/dist/chunks/{tag-ZcVkzFjz.js → tag-BELr-qIa.js} +1 -1
- package/dist/chunks/{tasks-DbB33ekt.js → tasks-CrdWcSt-.js} +1 -1
- package/dist/chunks/{teamHelpers-BmN9nKz-.js → teamHelpers--3ZyNDlv.js} +1 -1
- package/dist/chunks/teamHelpers-CUAiXng3.js +1 -0
- package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-CPjJJDL1.js → teammateModeSnapshot-DOQMTKbQ.js} +1 -1
- package/dist/chunks/{teleport-JHgpwZIh.js → teleport-LXFOan9C.js} +1 -1
- package/dist/chunks/{templateJobs-Db630FZD.js → templateJobs-8IY2Cgig.js} +1 -1
- package/dist/chunks/{terminalSetup-ygKHrVKR.js → terminalSetup-C4psrmpb.js} +1 -1
- package/dist/chunks/{terminalSetup-DJqWE8fc.js → terminalSetup-Lyg4NbGA.js} +1 -1
- package/dist/chunks/{theme-MmfFhdTD.js → theme-B8GNnJ_q.js} +1 -1
- package/dist/chunks/{thinkback-CrNirB0V.js → thinkback-DPXwEK3B.js} +1 -1
- package/dist/chunks/thinkback-DZW3Mcx_.js +1 -0
- package/dist/chunks/{thinkback-play-CQ1s7oqg.js → thinkback-play-BMOE-ceh.js} +1 -1
- package/dist/chunks/{toolEventObserver-DBq2XBYY.js → toolEventObserver-D0TSHm01.js} +1 -1
- package/dist/chunks/{toolEventObserver-BqMplcIk.js → toolEventObserver-DzLd0MSn.js} +1 -1
- package/dist/chunks/toolPool-DVOfpjDz.js +1 -0
- package/dist/chunks/{toolPool-BkCtTKXz.js → toolPool-Dq-Vtvrj.js} +1 -1
- package/dist/chunks/{trustedDevice-DEuQUTbz.js → trustedDevice-1iTu4LEm.js} +1 -1
- package/dist/chunks/{trustedDevice-C9Zevohz.js → trustedDevice-BvYYXfd8.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-DrlfRrXq.js → ultrareviewCommand-BTXAN2wP.js} +1 -1
- package/dist/chunks/undercover-C_44e3oN.js +1 -0
- package/dist/chunks/{undercover-DKn95mh9.js → undercover-DvvnEmsX.js} +1 -1
- package/dist/chunks/{updateCCB-CJ7dCUan.js → updateCCB-C-qfLi0j.js} +1 -1
- package/dist/chunks/upgrade-CGXa5Dwy.js +1 -0
- package/dist/chunks/{upgrade-Degqbu8S.js → upgrade-DTBZSxwv.js} +1 -1
- package/dist/chunks/{upload-pTZQCPLt.js → upload-BF8tf_Eo.js} +1 -1
- package/dist/chunks/{usage-DVQMUMcC.js → usage-BRYRRgNt.js} +1 -1
- package/dist/chunks/{usage-D96a7Cke.js → usage-DvSTXEYY.js} +1 -1
- package/dist/chunks/{useMainLoopModel-B7ch2o9K.js → useMainLoopModel-CwvuTRXn.js} +1 -1
- package/dist/chunks/{useManagePlugins-BfGzHMvO.js → useManagePlugins-GmnI9K53.js} +1 -1
- package/dist/chunks/{useMergedTools-TemEvCrX.js → useMergedTools-Dah5KDMi.js} +1 -1
- package/dist/chunks/{useSearchInput-B-V4kIa-.js → useSearchInput-BV_azHiA.js} +1 -1
- package/dist/chunks/{useSettingsErrors-B2JGz1s8.js → useSettingsErrors-C-j_Zt7g.js} +1 -1
- package/dist/chunks/{useVoice-BuwYDm2U.js → useVoice-DR69NLxp.js} +1 -1
- package/dist/chunks/{util-CeIKZmj9.js → util-BpyJ4Bom.js} +1 -1
- package/dist/chunks/utils-CrZcpypC.js +1 -0
- package/dist/chunks/{validatePlugin-BlVho93x.js → validatePlugin-vptAYuYu.js} +1 -1
- package/dist/chunks/{vim-DUZQCWUP.js → vim-DvOw8dfR.js} +1 -1
- package/dist/chunks/{voice-BkRIHZiM.js → voice-B3BZs53f.js} +1 -1
- package/dist/chunks/{voiceModeEnabled-CPQUE3PU.js → voiceModeEnabled-DA76xN1Q.js} +1 -1
- package/dist/chunks/voiceModeEnabled-DIveLYGb.js +1 -0
- package/dist/chunks/{voiceStreamSTT-Dr_wH1Kh.js → voiceStreamSTT-_w1VjIOs.js} +1 -1
- package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +1 -0
- package/dist/chunks/{workerRegistry-CT7_kjvY.js → workerRegistry-2_MZVih1.js} +1 -1
- package/dist/chunks/worktree-CCuDwRmS.js +1 -0
- package/dist/chunks/{xml-DD_ldd3X.js → xml-Dx--sNE1.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-SIUwkD8j.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +0 -1
- package/dist/chunks/Doctor--B1HUENo.js +0 -1
- package/dist/chunks/Grove-C2YjB3zL.js +0 -1
- package/dist/chunks/REPL-DCwqua0C.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +0 -1
- package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +0 -1
- package/dist/chunks/api-Dz_3z1kl.js +0 -1
- package/dist/chunks/assistant-zVegFdAO.js +0 -1
- package/dist/chunks/auth-D4isgfuK.js +0 -1
- package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +0 -1
- package/dist/chunks/bridgeConfig-CNbOKpAg.js +0 -1
- package/dist/chunks/bridgeEnabled-BUJTCUHY.js +0 -1
- package/dist/chunks/bridgeMain-DYL4fl6A.js +0 -1
- package/dist/chunks/caches-CTfNpKhW.js +0 -1
- package/dist/chunks/changeDetector-Y9KV5LgG.js +0 -1
- package/dist/chunks/channelNotification-CC7Xb06W.js +0 -1
- package/dist/chunks/clear-OUVFUt8Z.js +0 -1
- package/dist/chunks/client-B47ZvTMo.js +0 -1
- package/dist/chunks/commands-FJGWgQsa.js +0 -1
- package/dist/chunks/commitAttribution-DSv9FggK.js +0 -1
- package/dist/chunks/context-noninteractive-Bd2HO-vU.js +0 -1
- package/dist/chunks/conversation-BP0phkOY.js +0 -1
- package/dist/chunks/createSession-B9MhWusY.js +0 -1
- package/dist/chunks/datadog-DJowkWhh.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +0 -1
- package/dist/chunks/extra-usage-DGHEQOrY.js +0 -1
- package/dist/chunks/extractMemories-jvjCvtpC.js +0 -1
- package/dist/chunks/fast-Bbtx_Bs1.js +0 -1
- package/dist/chunks/gates-DSI3vpwO.js +0 -1
- package/dist/chunks/hooks-BLLL4iPv.js +0 -1
- package/dist/chunks/inboundAttachments-D-p91z3w.js +0 -1
- package/dist/chunks/language-B_-BfBT4.js +0 -1
- package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +0 -1
- package/dist/chunks/localSearch-DtVqtfvk.js +0 -1
- package/dist/chunks/login-D-N78G6r.js +0 -1
- package/dist/chunks/logout-CFggVS-9.js +0 -1
- package/dist/chunks/model-DdbcxKub.js +0 -1
- package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +0 -1
- package/dist/chunks/policyLimits-CKy_gTEt.js +0 -1
- package/dist/chunks/poorMode-DJvjO2nW.js +0 -1
- package/dist/chunks/prompt-CQC-mh6u.js +0 -1
- package/dist/chunks/prompt-DawxLANl.js +0 -1
- package/dist/chunks/sandbox-adapter-CxkhKgaa.js +0 -1
- package/dist/chunks/searchExtraTools-DQ6e601b.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +0 -1
- package/dist/chunks/sessionMemory-DIrR3zvb.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +0 -1
- package/dist/chunks/sessionObserver-_adufOGQ.js +0 -1
- package/dist/chunks/sessionStorage-W7okgAlQ.js +0 -1
- package/dist/chunks/sink-CaWMZBw_.js +0 -1
- package/dist/chunks/sinks-oFfsKySL.js +0 -1
- package/dist/chunks/skillLearning-BhM09bQD.js +0 -1
- package/dist/chunks/skillLearning-_o2D06yM.js +0 -1
- package/dist/chunks/teamHelpers-yeTNtZbb.js +0 -1
- package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +0 -1
- package/dist/chunks/thinkback-Quc7KPmi.js +0 -1
- package/dist/chunks/toolPool-C7bOwJfR.js +0 -1
- package/dist/chunks/undercover-CBeHiWUd.js +0 -1
- package/dist/chunks/upgrade-ucJ-lnlY.js +0 -1
- package/dist/chunks/utils-CwhszpkT.js +0 -1
- package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +0 -1
- package/dist/chunks/voiceStreamSTT-DgoDscHn.js +0 -1
- package/dist/chunks/worktree-DU3xtwKW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-DR8-3Aex.js";import{Mt as e,Rn as t,b as n,f as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{E as s,O as c,w as l}from"./debug-UI3T040K.js";import{AS as u,Dx as d,ay as f,cy as p,iy as m,jS as h}from"./loadAgentsDir-
|
|
1
|
+
import"./chunk-DR8-3Aex.js";import{Mt as e,Rn as t,b as n,f as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{E as s,O as c,w as l}from"./debug-UI3T040K.js";import{AS as u,Dx as d,ay as f,cy as p,iy as m,jS as h}from"./loadAgentsDir-DI1a76pd.js";import{t as g}from"./renderOptions-BiyC2rj1.js";t(),i(),f(),h(),l(),p();var _=o();function v({filePath:e,errorDescription:t,onExit:i,onReset:o}){return(0,_.jsxs)(r,{title:`Configuration Error`,color:`error`,onCancel:i,children:[(0,_.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,_.jsxs)(n,{children:[`The configuration file at `,(0,_.jsx)(n,{bold:!0,children:e}),` contains invalid JSON.`]}),(0,_.jsx)(n,{children:t})]}),(0,_.jsxs)(a,{flexDirection:`column`,children:[(0,_.jsx)(n,{bold:!0,children:`Choose an option:`}),(0,_.jsx)(d,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?i():o()},onCancel:i})]})]})}var y=`dark`;async function b({error:t}){let n={...g(!1),theme:y};await new Promise(async r=>{let{unmount:i}=await e((0,_.jsx)(u,{children:(0,_.jsx)(m,{children:(0,_.jsx)(v,{filePath:t.filePath,errorDescription:t.message,onExit:()=>{i(),r(),process.exit(1)},onReset:()=>{c(t.filePath,s(t.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),i(),r(),process.exit(0)}})})}),n)})}export{b as showInvalidConfigDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-DR8-3Aex.js";import{Rn as e,b as t,f as n,t as r}from"./src-Di342QoJ.js";import{t as i}from"./jsx-runtime-D-D469L8.js";import{Dx as a,cy as o}from"./loadAgentsDir-
|
|
1
|
+
import"./chunk-DR8-3Aex.js";import{Rn as e,b as t,f as n,t as r}from"./src-Di342QoJ.js";import{t as i}from"./jsx-runtime-D-D469L8.js";import{Dx as a,cy as o}from"./loadAgentsDir-DI1a76pd.js";import{n as s,t as c}from"./ValidationErrorsList-CdCUgfIl.js";e(),r(),o(),s();var l=i();function u({settingsErrors:e,onContinue:r,onExit:i}){function o(e){e===`exit`?i():r()}return(0,l.jsxs)(n,{title:`Settings Error`,onCancel:i,color:`warning`,children:[(0,l.jsx)(c,{errors:e}),(0,l.jsx)(t,{dimColor:!0,children:`Files with errors are skipped entirely, not just the invalid settings.`}),(0,l.jsx)(a,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Continue without these settings`,value:`continue`}],onChange:o})]})}export{u as InvalidSettingsDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./chunk-DR8-3Aex.js";import{B as r,F as i,L as a,z as o}from"./server-DzOdtq8A.js";import{Rn as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Ct as l,cn as u,y as d}from"./state-sIHsFpDu.js";import{El as f,Ml as ee,S as p,Tl as m,_ as h,jl as g,ls as _,ss as v}from"./paths-Q2255dD7.js";import{E as y,L as b,V as x,d as te,s as S,w as C}from"./debug-UI3T040K.js";import{n as ne,r as w}from"./analytics-DqMQntaB.js";import{c as T,l as E,o as re}from"./log-CzsijfHZ.js";import{Cx as D,LC as ie,MS as O,NS as ae,OS as oe,PS as se,Sx as k,Tx as A,UC as ce,XC as le,aC as ue,aw as j,bx as M,cO as de,gw as fe,gx as N,hO as pe,hw as me,iC as he,jS as ge,kS as _e,lw as P,mw as F,nw as I,rw as ve,tw as ye,uw as L,vw as be,vx as R,yx as z}from"./loadAgentsDir-Ci5mr0vm.js";import{o as xe,s as Se}from"./localSearch-Vpn6W5aY.js";import{c as Ce,i as we,l as Te,o as Ee,r as De,s as Oe,t as ke}from"./channelNotification-l3EXKDNB.js";import{basename as Ae}from"path";function je(){return h(`tengu_harbor_permissions`,!0)}function B(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);t>>>=0;let n=``;for(let e=0;e<5;e++)n+=V[t%25],t=Math.floor(t/25);return n}function Me(e){let t=B(e);for(let n=0;n<10;n++){if(!H.some(e=>t.includes(e)))return t;t=B(`${e}:${n}`)}return t}function Ne(e){try{let t=y(e);return t.length>200?t.slice(0,200)+`…`:t}catch{return`(unserializable)`}}function Pe(e,t){return e.filter(e=>e.type===`connected`&&t(e.name)&&!!e.capabilities?.experimental?.[`claude/channel`]&&!!e.capabilities?.experimental?.[`claude/channel/permission`])}function Fe(){let e=new Map;return{onResponse(t,n){let r=t.toLowerCase();return e.set(r,n),()=>{e.delete(r)}},resolve(t,n,r){let i=t.toLowerCase(),a=e.get(i);return a?(e.delete(i),a({behavior:n,fromServer:r}),!0):!1}}}var V,H,U=t((()=>{C(),p(),V=`abcdefghijkmnopqrstuvwxyz`,H=[`fuck`,`shit`,`cunt`,`cock`,`dick`,`twat`,`piss`,`crap`,`bitch`,`whore`,`ass`,`tit`,`cum`,`fag`,`dyke`,`nig`,`kike`,`rape`,`nazi`,`damn`,`poo`,`pee`,`wank`,`anus`]}));function W(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function G(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>W(e))),r=t.filter(e=>!n.has(W(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function Ie(e,t=!1){let n=ae(),r=O(e=>e.authVersion),s=O(e=>e.mcp.pluginReconnectKey),c=se(),u=(0,K.useRef)(new Map),p=(0,K.useRef)(new Set),m=(0,K.useRef)(null);m.current===null&&(m.current=Fe()),(0,K.useEffect)(()=>{{let e=m.current;return!e||!je()?void 0:(c(t=>t.channelPermissionCallbacks===e?t:{...t,channelPermissionCallbacks:e}),()=>{c(e=>e.channelPermissionCallbacks===void 0?e:{...e,channelPermissionCallbacks:void 0})})}},[c]);let{addNotification:h}=_e(),g=(0,K.useRef)([]),_=(0,K.useRef)(null),y=(0,K.useCallback)(()=>{_.current=null;let e=g.current;e.length!==0&&(g.current=[],c(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=v(a.name),u=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),d=o===void 0?n.tools:[...f(n.tools,e=>e.name?.startsWith(l)),...o],p=s===void 0?n.commands:[...f(n.commands,e=>ie(e,a.name)),...s],m=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:ee(n.resources,a.name)};n={...n,clients:u,tools:d,commands:p,resources:m}}return{...t,mcp:n}}))},[c]),x=(0,K.useCallback)(e=>{g.current.push(e),_.current===null&&(_.current=setTimeout(y,16))},[y]),S=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(x({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:{ue(e.client,e.name,c),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(N(e.name,e.config).catch(()=>{te(`Failed to invalidate the server cache: ${e.name}`)}),L(e.name)){T(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=Le(t);T(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=u.current.get(e.name);r&&(clearTimeout(r),u.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(L(e.name)){T(e.name,`Server disabled during reconnection, stopping retry`),u.current.delete(e.name);return}x({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await A(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){T(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),u.current.delete(e.name),S(i);return}if(T(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){T(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),S(i);return}}catch(i){let a=Date.now()-r;if(E(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){T(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),x({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);T(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);u.current.set(e.name,n)})}})()}else x({...e,type:`failed`})};let t=Oe(e.name,e.capabilities,e.config.pluginSource),n=Ee(e.name,d()),r=n?.kind===`plugin`?`${n.name}@${n.marketplace}`:void 0;switch((t.action===`register`||t.kind!==`capability`)&&w(`tengu_mcp_channel_gate`,{registered:t.action===`register`,skip_kind:t.action===`skip`?t.kind:void 0,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),t.action){case`register`:T(e.name,`Channel notifications registered`),e.client.setNotificationHandler(De(),async t=>{let{content:i,meta:a}=t.params;T(e.name,`notifications/claude/channel: ${i.slice(0,80)}`),w(`tengu_mcp_channel_message`,{content_length:i.length,meta_key_count:Object.keys(a??{}).length,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),de({mode:`prompt`,value:Te(e.name,i,a),priority:`next`,isMeta:!0,origin:{kind:`channel`,server:e.name},skipSlashCommands:!0})}),e.capabilities?.experimental?.[`claude/channel/permission`]&&e.client.setNotificationHandler(we(),async t=>{let{request_id:n,behavior:r}=t.params,i=m.current?.resolve(n,r,e.name)??!1;T(e.name,`notifications/claude/channel/permission: ${n} → ${r} (${i?`matched pending`:`no pending entry — stale or unknown ID`})`)});break;case`skip`:if(e.client.removeNotificationHandler(`notifications/claude/channel`),e.client.removeNotificationHandler(ke),T(e.name,`Channel notifications skipped: ${t.reason}`),t.kind!==`capability`&&t.kind!==`session`&&!p.current.has(t.kind)&&(t.kind===`marketplace`||t.kind===`allowlist`||n!==void 0)){p.current.add(t.kind);let e=t.kind===`disabled`?`Channels are not currently available`:t.kind===`auth`?`Channels require claude.ai authentication · run /login`:t.kind===`policy`?`Channels are not enabled for your org · have an administrator set channelsEnabled: true in managed settings`:t.reason;h({key:`channels-blocked-${t.kind}`,priority:`high`,text:e,color:`warning`,timeoutMs:12e3})}break}e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(o,async()=>{T(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=M.cache.get(e.name);M.cache.delete(e.name);let n=await M(e),r=n.length;t?t.then(e=>{w(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{w(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):w(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),x({...e,tools:n})}catch(t){E(e.name,`Failed to refresh tools after list_changed notification: ${b(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(i,async()=>{T(e.name,`Received prompts/list_changed notification, refreshing prompts`),w(`tengu_mcp_list_changed`,{type:`prompts`});try{R.cache.delete(e.name);let[t,n]=await Promise.all([R(e),Promise.resolve([])]);x({...e,commands:[...t,...n]}),q?.()}catch(t){E(e.name,`Failed to refresh prompts after list_changed notification: ${b(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(a,async()=>{T(e.name,`Received resources/list_changed notification, refreshing resources`),w(`tengu_mcp_list_changed`,{type:`resources`});try{z.cache.delete(e.name);{let t=await z(e);x({...e,resources:t})}}catch(t){E(e.name,`Failed to refresh resources after list_changed notification: ${b(t)}`)}});break}case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[x]),C=l();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await j(e),i={...n,...e};G(c,r),c(e=>{let{stale:t,...n}=ce(e.mcp,i);for(let e of t){let t=u.current.get(e.name);t&&(clearTimeout(t),u.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,N(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),a=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:L(e)?`disabled`:`pending`,config:t}));return a.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...a]}}})}n().catch(e=>{E(`useManageMCPConnections`,`Failed to initialize servers as pending: ${b(e)}`)})},[t,e,c,C,s]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||I()?r=Promise.resolve({}):(me(),r=fe());let{servers:i,errors:a}=t?{servers:{},errors:[]}:await j(e,r);if(n)return;G(c,a);let o={...i,...e};k(S,Object.fromEntries(Object.entries(o).filter(([e])=>!L(e)))).catch(e=>{E(`useManageMcpConnections`,`Failed to get MCP resources: ${b(e)}`)});let s={};if(!t){if(s=ve(await r).allowed,n)return;if(Object.keys(s).length>0){let{servers:e}=ye(s,o);s=e}Object.keys(s).length>0&&(c(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(s).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:L(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}}),k(S,Object.fromEntries(Object.entries(s).filter(([e])=>!L(e)))).catch(e=>{E(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${b(e)}`)}))}let l={...o,...s},u={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},d=[];for(let[e,t]of Object.entries(l))t.scope===`enterprise`?u.enterprise++:t.scope===`user`?u.global++:t.scope===`project`?u.project++:t.scope===`local`?u.user++:t.scope===`dynamic`?u.plugin++:t.scope===`claudeai`&&u.claudeai++,process.env.USER_TYPE===`ant`&&!L(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&d.push(Ae(t.command));w(`tengu_mcp_servers`,{...u,...process.env.USER_TYPE===`ant`&&d.length>0?{stdio_commands:d.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,S,c,r,C,s]),(0,K.useEffect)(()=>{let e=u.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),_.current!==null&&(clearTimeout(_.current),_.current=null,y())}},[y]),{reconnectMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=u.current.get(e);r&&(clearTimeout(r),u.current.delete(e));let i=await A(e,t.config);return S(i),i},[n,S]),toggleMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=u.current.get(e);n&&(clearTimeout(n),u.current.delete(e)),F(e,!1),t.type===`connected`&&await N(e,t.config),x({name:e,type:`disabled`,config:t.config})}else F(e,!0),x({name:e,type:`pending`,config:t.config}),S(await A(e,t.config))},[n,x,S])}}function Le(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,Re=t((()=>{K=n(s(),1),u(),D(),r(),g(),m(),ne(),P(),S(),oe(),ge(),x(),re(),pe(),Ce(),U(),be(),he(),_(),le(),q=(xe(),e(Se)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ze(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function Be(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function Ve({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=Ie(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,He=t((()=>{Z=n(s(),1),Re(),Q=c(),$=(0,Z.createContext)(null)}));export{Pe as a,Ne as c,Be as i,He as n,U as o,ze as r,Me as s,Ve as t};
|
|
1
|
+
import{a as e,n as t,o as n}from"./chunk-DR8-3Aex.js";import{B as r,F as i,L as a,z as o}from"./server-DzOdtq8A.js";import{Rn as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Ct as l,cn as u,y as d}from"./state-sIHsFpDu.js";import{El as f,Ml as ee,S as p,Tl as m,_ as h,jl as g,ls as _,ss as v}from"./paths-BBvuDQl9.js";import{E as y,L as b,V as x,d as te,s as S,w as C}from"./debug-UI3T040K.js";import{n as ne,r as w}from"./analytics-DqMQntaB.js";import{c as T,l as E,o as re}from"./log-CzsijfHZ.js";import{Cx as D,LC as ie,MS as O,NS as ae,OS as oe,PS as se,Sx as k,Tx as A,UC as ce,XC as le,aC as ue,aw as j,bx as M,cO as de,gw as fe,gx as N,hO as pe,hw as me,iC as he,jS as ge,kS as _e,lw as P,mw as F,nw as I,rw as ve,tw as ye,uw as L,vw as be,vx as R,yx as z}from"./loadAgentsDir-DI1a76pd.js";import{o as xe,s as Se}from"./localSearch-CDOJNc_E.js";import{c as Ce,i as we,l as Te,o as Ee,r as De,s as Oe,t as ke}from"./channelNotification-B7A-9DIl.js";import{basename as Ae}from"path";function je(){return h(`tengu_harbor_permissions`,!0)}function B(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);t>>>=0;let n=``;for(let e=0;e<5;e++)n+=V[t%25],t=Math.floor(t/25);return n}function Me(e){let t=B(e);for(let n=0;n<10;n++){if(!H.some(e=>t.includes(e)))return t;t=B(`${e}:${n}`)}return t}function Ne(e){try{let t=y(e);return t.length>200?t.slice(0,200)+`…`:t}catch{return`(unserializable)`}}function Pe(e,t){return e.filter(e=>e.type===`connected`&&t(e.name)&&!!e.capabilities?.experimental?.[`claude/channel`]&&!!e.capabilities?.experimental?.[`claude/channel/permission`])}function Fe(){let e=new Map;return{onResponse(t,n){let r=t.toLowerCase();return e.set(r,n),()=>{e.delete(r)}},resolve(t,n,r){let i=t.toLowerCase(),a=e.get(i);return a?(e.delete(i),a({behavior:n,fromServer:r}),!0):!1}}}var V,H,U=t((()=>{C(),p(),V=`abcdefghijkmnopqrstuvwxyz`,H=[`fuck`,`shit`,`cunt`,`cock`,`dick`,`twat`,`piss`,`crap`,`bitch`,`whore`,`ass`,`tit`,`cum`,`fag`,`dyke`,`nig`,`kike`,`rape`,`nazi`,`damn`,`poo`,`pee`,`wank`,`anus`]}));function W(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function G(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>W(e))),r=t.filter(e=>!n.has(W(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function Ie(e,t=!1){let n=ae(),r=O(e=>e.authVersion),s=O(e=>e.mcp.pluginReconnectKey),c=se(),u=(0,K.useRef)(new Map),p=(0,K.useRef)(new Set),m=(0,K.useRef)(null);m.current===null&&(m.current=Fe()),(0,K.useEffect)(()=>{{let e=m.current;return!e||!je()?void 0:(c(t=>t.channelPermissionCallbacks===e?t:{...t,channelPermissionCallbacks:e}),()=>{c(e=>e.channelPermissionCallbacks===void 0?e:{...e,channelPermissionCallbacks:void 0})})}},[c]);let{addNotification:h}=_e(),g=(0,K.useRef)([]),_=(0,K.useRef)(null),y=(0,K.useCallback)(()=>{_.current=null;let e=g.current;e.length!==0&&(g.current=[],c(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=v(a.name),u=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),d=o===void 0?n.tools:[...f(n.tools,e=>e.name?.startsWith(l)),...o],p=s===void 0?n.commands:[...f(n.commands,e=>ie(e,a.name)),...s],m=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:ee(n.resources,a.name)};n={...n,clients:u,tools:d,commands:p,resources:m}}return{...t,mcp:n}}))},[c]),x=(0,K.useCallback)(e=>{g.current.push(e),_.current===null&&(_.current=setTimeout(y,16))},[y]),S=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(x({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:{ue(e.client,e.name,c),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(N(e.name,e.config).catch(()=>{te(`Failed to invalidate the server cache: ${e.name}`)}),L(e.name)){T(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=Le(t);T(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=u.current.get(e.name);r&&(clearTimeout(r),u.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(L(e.name)){T(e.name,`Server disabled during reconnection, stopping retry`),u.current.delete(e.name);return}x({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await A(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){T(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),u.current.delete(e.name),S(i);return}if(T(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){T(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),S(i);return}}catch(i){let a=Date.now()-r;if(E(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){T(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),x({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);T(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);u.current.set(e.name,n)})}})()}else x({...e,type:`failed`})};let t=Oe(e.name,e.capabilities,e.config.pluginSource),n=Ee(e.name,d()),r=n?.kind===`plugin`?`${n.name}@${n.marketplace}`:void 0;switch((t.action===`register`||t.kind!==`capability`)&&w(`tengu_mcp_channel_gate`,{registered:t.action===`register`,skip_kind:t.action===`skip`?t.kind:void 0,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),t.action){case`register`:T(e.name,`Channel notifications registered`),e.client.setNotificationHandler(De(),async t=>{let{content:i,meta:a}=t.params;T(e.name,`notifications/claude/channel: ${i.slice(0,80)}`),w(`tengu_mcp_channel_message`,{content_length:i.length,meta_key_count:Object.keys(a??{}).length,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),de({mode:`prompt`,value:Te(e.name,i,a),priority:`next`,isMeta:!0,origin:{kind:`channel`,server:e.name},skipSlashCommands:!0})}),e.capabilities?.experimental?.[`claude/channel/permission`]&&e.client.setNotificationHandler(we(),async t=>{let{request_id:n,behavior:r}=t.params,i=m.current?.resolve(n,r,e.name)??!1;T(e.name,`notifications/claude/channel/permission: ${n} → ${r} (${i?`matched pending`:`no pending entry — stale or unknown ID`})`)});break;case`skip`:if(e.client.removeNotificationHandler(`notifications/claude/channel`),e.client.removeNotificationHandler(ke),T(e.name,`Channel notifications skipped: ${t.reason}`),t.kind!==`capability`&&t.kind!==`session`&&!p.current.has(t.kind)&&(t.kind===`marketplace`||t.kind===`allowlist`||n!==void 0)){p.current.add(t.kind);let e=t.kind===`disabled`?`Channels are not currently available`:t.kind===`auth`?`Channels require claude.ai authentication · run /login`:t.kind===`policy`?`Channels are not enabled for your org · have an administrator set channelsEnabled: true in managed settings`:t.reason;h({key:`channels-blocked-${t.kind}`,priority:`high`,text:e,color:`warning`,timeoutMs:12e3})}break}e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(o,async()=>{T(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=M.cache.get(e.name);M.cache.delete(e.name);let n=await M(e),r=n.length;t?t.then(e=>{w(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{w(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):w(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),x({...e,tools:n})}catch(t){E(e.name,`Failed to refresh tools after list_changed notification: ${b(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(i,async()=>{T(e.name,`Received prompts/list_changed notification, refreshing prompts`),w(`tengu_mcp_list_changed`,{type:`prompts`});try{R.cache.delete(e.name);let[t,n]=await Promise.all([R(e),Promise.resolve([])]);x({...e,commands:[...t,...n]}),q?.()}catch(t){E(e.name,`Failed to refresh prompts after list_changed notification: ${b(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(a,async()=>{T(e.name,`Received resources/list_changed notification, refreshing resources`),w(`tengu_mcp_list_changed`,{type:`resources`});try{z.cache.delete(e.name);{let t=await z(e);x({...e,resources:t})}}catch(t){E(e.name,`Failed to refresh resources after list_changed notification: ${b(t)}`)}});break}case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[x]),C=l();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await j(e),i={...n,...e};G(c,r),c(e=>{let{stale:t,...n}=ce(e.mcp,i);for(let e of t){let t=u.current.get(e.name);t&&(clearTimeout(t),u.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,N(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),a=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:L(e)?`disabled`:`pending`,config:t}));return a.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...a]}}})}n().catch(e=>{E(`useManageMCPConnections`,`Failed to initialize servers as pending: ${b(e)}`)})},[t,e,c,C,s]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||I()?r=Promise.resolve({}):(me(),r=fe());let{servers:i,errors:a}=t?{servers:{},errors:[]}:await j(e,r);if(n)return;G(c,a);let o={...i,...e};k(S,Object.fromEntries(Object.entries(o).filter(([e])=>!L(e)))).catch(e=>{E(`useManageMcpConnections`,`Failed to get MCP resources: ${b(e)}`)});let s={};if(!t){if(s=ve(await r).allowed,n)return;if(Object.keys(s).length>0){let{servers:e}=ye(s,o);s=e}Object.keys(s).length>0&&(c(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(s).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:L(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}}),k(S,Object.fromEntries(Object.entries(s).filter(([e])=>!L(e)))).catch(e=>{E(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${b(e)}`)}))}let l={...o,...s},u={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},d=[];for(let[e,t]of Object.entries(l))t.scope===`enterprise`?u.enterprise++:t.scope===`user`?u.global++:t.scope===`project`?u.project++:t.scope===`local`?u.user++:t.scope===`dynamic`?u.plugin++:t.scope===`claudeai`&&u.claudeai++,process.env.USER_TYPE===`ant`&&!L(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&d.push(Ae(t.command));w(`tengu_mcp_servers`,{...u,...process.env.USER_TYPE===`ant`&&d.length>0?{stdio_commands:d.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,S,c,r,C,s]),(0,K.useEffect)(()=>{let e=u.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),_.current!==null&&(clearTimeout(_.current),_.current=null,y())}},[y]),{reconnectMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=u.current.get(e);r&&(clearTimeout(r),u.current.delete(e));let i=await A(e,t.config);return S(i),i},[n,S]),toggleMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=u.current.get(e);n&&(clearTimeout(n),u.current.delete(e)),F(e,!1),t.type===`connected`&&await N(e,t.config),x({name:e,type:`disabled`,config:t.config})}else F(e,!0),x({name:e,type:`pending`,config:t.config}),S(await A(e,t.config))},[n,x,S])}}function Le(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,Re=t((()=>{K=n(s(),1),u(),D(),r(),g(),m(),ne(),P(),S(),oe(),ge(),x(),re(),pe(),Ce(),U(),be(),he(),_(),le(),q=(xe(),e(Se)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ze(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function Be(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function Ve({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=Ie(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,He=t((()=>{Z=n(s(),1),Re(),Q=c(),$=(0,Z.createContext)(null)}));export{Pe as a,Ne as c,Be as i,He as n,U as o,ze as r,Me as s,Ve as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Q as n,Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{RC as c,XC as l,YC as u,lw as d,sw as f}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Q as n,Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{RC as c,XC as l,YC as u,lw as d,sw as f}from"./loadAgentsDir-DI1a76pd.js";function p({scope:e,parsingErrors:t,warnings:n}){let r=t.length>0,a=n.length>0;return!r&&!a?null:(0,_.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[(0,_.jsxs)(o,{children:[(r||a)&&(0,_.jsxs)(i,{color:r?`error`:`warning`,children:[`[`,r?`Failed to parse`:`Contains warnings`,`] `]}),(0,_.jsx)(i,{children:u(e)})]}),(0,_.jsxs)(o,{children:[(0,_.jsx)(i,{dimColor:!0,children:`Location: `}),(0,_.jsx)(i,{dimColor:!0,children:c(e)})]}),(0,_.jsxs)(o,{marginLeft:1,flexDirection:`column`,children:[t.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(o,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`error`,children:`[Error]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`error-${t}`)}),n.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(o,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`warning`,children:`[Warning]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`warning-${t}`)})]})]})}function m(){let e=(0,g.useMemo)(()=>[{scope:`user`,config:f(`user`)},{scope:`project`,config:f(`project`)},{scope:`local`,config:f(`local`)},{scope:`enterprise`,config:f(`enterprise`)}],[]),t=e.some(({config:e})=>h(e.errors,`fatal`).length>0),r=e.some(({config:e})=>h(e.errors,`warning`).length>0);return!t&&!r?null:(0,_.jsxs)(o,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,_.jsx)(i,{bold:!0,children:`MCP Config Diagnostics`}),(0,_.jsx)(o,{marginTop:1,children:(0,_.jsxs)(i,{dimColor:!0,children:[`For help configuring MCP servers, see:`,` `,(0,_.jsx)(n,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`})]})}),e.map(({scope:e,config:t})=>(0,_.jsx)(p,{scope:e,parsingErrors:h(t.errors,`fatal`),warnings:h(t.errors,`warning`)},e))]})}function h(e,t){return e.filter(e=>e.mcpErrorMetadata?.severity===t)}var g,_,v=e((()=>{g=t(r()),d(),l(),a(),_=s()}));export{v as n,m as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./figures-gfT9mM8P.js";import{F as a,Rn as o,b as s,m as c,nt as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Ct as m,cn as h,mr as g,vt as _}from"./state-sIHsFpDu.js";import{Ht as v,es as y,no as b,on as x,oo as S,pi as C,rs as w,vi as T}from"./paths-Q2255dD7.js";import{n as E,r as D}from"./analytics-DqMQntaB.js";import{n as O,t as k}from"./cwd--iizewsn.js";import{O as A,et as j,h as ee,m as te,o as ne,s as M}from"./log-CzsijfHZ.js";import{b as N,x as re}from"./teammate-DMYOtLTK.js";import{C as ie,g as ae,x as oe}from"./startupProfiler-DnXZaX4A.js";import{$S as se,BE as P,Dc as ce,Dx as le,Ec as F,Eo as ue,FO as I,Jv as de,Lo as L,Lw as fe,MO as R,MS as pe,Ox as me,PO as z,Rc as he,So as B,Ui as ge,Uo as _e,Vi as ve,Vo as ye,Xi as be,Xv as xe,Yv as Se,_o as Ce,an as we,bo as V,fo as Te,gy as Ee,hn as De,iu as H,jS as Oe,kc as ke,la as Ae,my as je,nu as Me,os as Ne,tC as Pe,ty as Fe,yn as Ie,zE as Le,zc as Re,zo as ze}from"./loadAgentsDir-Ci5mr0vm.js";import{E as Be,T as Ve,c as He,d as Ue,w as We}from"./sessionTracing-DTjmc0EF.js";import{t as Ge}from"./useKeybinding-FsOnjW6T.js";import{l as Ke,u as qe}from"./referral-ByevBJrE.js";import{n as Je,t as Ye}from"./slashCommandParsing-Cari0pNg.js";import*as U from"path";import{randomUUID as W}from"crypto";o();var G=p();r(),u(),h(),E(),O(),j(),te(),ne(),re(),oe(),w(),S(),x(),z(),We(),Le(),se(),He(),Me(),he(),ke(),Ne(),L(),be(),Ie(),Ye();var Xe={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Ze(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Xe[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else (o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Xe)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function K(e){return Ze(e,`ultraplan`)}function Qe(e){return Ze(e,`ultrareview`)}function $e(e){return K(e).length>0}function et(e){let[t]=K(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function tt(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function nt(e){let t=e.toLowerCase().trim();return t===`continue`?!0:/\b(keep going|go on)\b/.test(t)}function rt(e,t,n,r,i,a,o){let s=W();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;Ue(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Ve(`user_prompt`,{prompt_length:String(l.length),prompt:Be(l),"prompt.id":s}),D(`tengu_input_prompt`,{is_negative:tt(c),is_keep_going:nt(c)}),t.length>0?{messages:[V({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[V({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}E(),L();async function it({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null;n===`prompt`&&v!==null&&!h&&c?.(v),H(`query_process_user_input_base_start`);let y=i.getAppState(),b=await ot(e,n,r,i,a,o,s,l,u,d,f,y.toolPermissionContext.mode,p,m,h,g,t,_);if(H(`query_process_user_input_base_end`),!b.shouldQuery)return b;H(`query_hooks_start`);let x=ue(e)||``;for await(let t of we(x,y.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[Ce(`${De(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:b.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return b.messages.push(V({content:e})),b.shouldQuery=!1,b}if(t.additionalContexts&&t.additionalContexts.length>0&&b.messages.push(F({type:`hook_additional_context`,content:t.additionalContexts.map(at),hookName:`UserPromptSubmit`,toolUseID:`hook-${W()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;b.messages.push({...t.message,attachment:{...t.message.attachment,content:at(t.message.attachment.content)}});break;default:b.messages.push(t.message);break}}return H(`query_hooks_end`),b}var q=1e4;function at(e){return e.length>q?`${e.substring(0,q)}… [output truncated - exceeded ${q} characters]`:e}async function ot(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],b=[],x=e;if(typeof e==`string`)v=e;else if(e.length>0){H(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await I(n);if(e.dimensions){let t=R(e.dimensions);t&&b.push(t)}t.push(e.block)}else t.push(n);x=t,H(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let S=i?Object.values(i).filter(Re):[],C=S.map(e=>e.id),w=i?await Pe(i):new Map;H(`query_pasted_image_processing_start`);let T=await Promise.all(S.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return D(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await I(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??w.get(e.id)}})),E=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of T){if(e.dimensions){let t=R(e.dimensions,n);t&&b.push(t)}else if(t){let e=R(t,n);e&&b.push(e)}else n&&b.push(`[Image source: ${n}]`);E.push(e.block)}H(`query_pasted_image_processing_end`);let O=f;if(p&&v!==null&&v.startsWith(`/`)){let e=Je(v),t=e?ve(e.commandName,r.options.commands):void 0;if(t){let n=ge(t,e?.args??``);if(n.ok)O=!1;else{let e=n.reason??`/${Ae(t)} isn't available over Remote Control.`;return{messages:[V({content:v,uuid:s}),Te(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&v!==null&&!O&&!v.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&$e(g??v)){D(`tengu_ultraplan_keyword`,{});let e=et(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-DHRUtZ-C.js`);return J(await t(`/ultraplan ${e}`,y,E,[],r,n,s,c,u,_),b)}let k=!h&&v!==null&&(t!==`prompt`||O||!v.startsWith(`/`));H(`query_attachment_loading_start`);let A=k?await P(ce(v,r,a??null,[],o,l)):[];if(H(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-D5dC6Mya.js`);return J(await e(v,y,A,r,n),b)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-DHRUtZ-C.js`);return J(await e(v,y,E,A,r,n,s,c,u,_),b)}if(v!==null&&t===`prompt`){let e=v.trim(),t=A.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;D(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return J(rt(x,E,C,A,s,d,m),b)}function J(e,t){return t.length>0&&e.messages.push(V({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}h(),T();function st(e){return e===`Agent`?y:e}function ct(e){let t=b()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:k(),session_id:m(),tools:e.tools.map(e=>st(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:v().source,betas:_(),claude_code_version:`2.6.0`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:W()};return n.fast_mode_state=C(e.model,e.fastMode),n}var lt=n({MessageSelector:()=>dt,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function ut(e){return e.type===`text`}function Y(e){return e===`summarize`||e===`summarize_up_to`}function dt({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:u}){let p=pe(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=Se(),_=(0,Q.useMemo)(W,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...V({content:``}),uuid:_}],[e,_]),[y,b]=(0,Q.useState)(v.length-1),x=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),S=v.length>1,[C,w]=(0,Q.useState)(u),[T,E]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!u||!g)return;let e=!1;return xe(p,u.uuid).then(t=>{e||E(t)}),()=>{e=!0}},[u,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(`both`),[ne,N]=(0,Q.useState)(``),[re,ie]=(0,Q.useState)(``);function oe(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:N}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:ie}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{D(`tengu_message_selector_opened`,{})},[]);async function se(e){t(),k(!0);try{await n(e),k(!1),o()}catch(e){M(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function P(t){let n=e.indexOf(t);if(D(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!g){await se(t);return}let r=await xe(p,t.uuid);w(t),E(r)}async function ce(e){if(D(`tengu_message_selector_restore_option_selected`,{option:e}),!C){h(`Message not found.`);return}if(e===`nevermind`){u?o():w(void 0);return}if(Y(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`;await a(C,(t===`up_to`?re:ne).trim()||void 0,t),k(!1),j(null),w(void 0),o()}catch(e){M(e),k(!1),j(null),w(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,s=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,M(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){s=e,M(s)}k(!1),w(void 0),s&&i?h(`Failed to restore the conversation and code:\n${s}\n${i}`):s?h(`Failed to restore the conversation:\n${s}`):i?h(`Failed to restore the code:\n${i}`):o()}let F=qe(),ue=(0,Q.useCallback)(()=>{if(C&&!u){w(void 0);return}D(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),I=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),L=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),fe=(0,Q.useCallback)(()=>b(0),[]),R=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),me=(0,Q.useCallback)(()=>{let e=v[y];e&&P(e)},[v,y,P]);d(`confirm:no`,ue,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":I,"messageSelector:down":L,"messageSelector:top":fe,"messageSelector:bottom":R,"messageSelector:select":me},{context:`MessageSelector`,isActive:!O&&!m&&!C&&S});let[z,he]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=de(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;he(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let B=g&&T?.filesChanged&&T.filesChanged.length>0,ge=!m&&!C&&!u&&S;return(0,G.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,G.jsx)(c,{color:`suggestion`}),(0,G.jsxs)(f,{flexDirection:`column`,marginX:1,gap:1,children:[(0,G.jsx)(s,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{color:`error`,children:[`Error: `,m]})}),!S&&(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{children:`Nothing to rewind to yet.`})}),!m&&C&&S&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{children:[`Confirm you want to restore `,!T&&`the conversation `,`to the point before you sent this message:`]}),(0,G.jsxs)(f,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,G.jsx)(ht,{userMessage:C,color:`text`,isCurrent:!1}),(0,G.jsxs)(s,{dimColor:!0,children:[`(`,ae(new Date(C.timestamp)),`)`]})]}),(0,G.jsx)(pt,{selectedRestoreOption:ee,canRestoreCode:!!B,diffStatsForRestore:T}),O&&Y(A)?(0,G.jsxs)(f,{flexDirection:`row`,gap:1,children:[(0,G.jsx)(je,{}),(0,G.jsx)(s,{children:`Summarizing…`})]}):(0,G.jsx)(le,{isDisabled:O,options:oe(!!B),defaultFocusValue:B?`both`:`conversation`,onFocus:e=>te(e),onChange:e=>ce(e),onCancel:()=>u?o():w(void 0)}),B&&(0,G.jsx)(f,{marginBottom:1,children:(0,G.jsxs)(s,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ge&&(0,G.jsxs)(G.Fragment,{children:[g?(0,G.jsx)(s,{children:`Restore the code and/or conversation to the point before…`}):(0,G.jsx)(s,{children:`Restore and fork the conversation to the point before…`}),(0,G.jsx)(f,{width:`100%`,flexDirection:`column`,children:v.slice(x,x+$).map((e,t)=>{let n=x+t,r=n===y,a=e.uuid===_,o=n in z,c=z[n],l=c?.filesChanged&&c.filesChanged.length;return(0,G.jsxs)(f,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,G.jsx)(f,{width:2,minWidth:2,children:r?(0,G.jsxs)(s,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,G.jsx)(s,{children:` `})}),(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(f,{flexShrink:1,height:1,overflow:`hidden`,children:(0,G.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,G.jsx)(f,{height:1,flexDirection:`row`,children:c?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{dimColor:!r,color:`inactive`,children:l?(0,G.jsxs)(G.Fragment,{children:[l===1&&c.filesChanged[0]?`${U.basename(c.filesChanged[0])} `:`${l} files changed `,(0,G.jsx)(X,{diffStats:c})]}):(0,G.jsx)(G.Fragment,{children:`No code changes`})})}):(0,G.jsxs)(s,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,G.jsx)(s,{dimColor:!0,italic:!0,children:F.pending?(0,G.jsxs)(G.Fragment,{children:[`Press `,F.keyName,` again to exit`]}):(0,G.jsxs)(G.Fragment,{children:[!m&&S&&`Enter to continue · `,`Esc to exit`]})})]})]})}function ft(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function pt({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(s,{dimColor:!0,children:ft(e)}),!Y(e)&&(r?(0,G.jsx)(mt,{diffStatsForRestore:n}):(0,G.jsx)(s,{dimColor:!0,children:`The code will be unchanged.`}))]})}function mt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,G.jsx)(s,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?U.basename(e.filesChanged[0]||``):t===2?`${U.basename(e.filesChanged[0]||``)} and ${U.basename(e.filesChanged[1]||``)}`:`${U.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{dimColor:!0,children:[`The code will be restored `,(0,G.jsx)(X,{diffStats:e}),` in `,n,`.`]})})}function X({diffStats:e}){if(!(!e||!e.filesChanged))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,G.jsxs)(s,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:o}=a();if(r)return(0,G.jsx)(f,{width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`(current)`})});let c=e.message.content,l=typeof c==`string`?null:c[c.length-1],u=ee(typeof c==`string`?c.trim():l&&ut(l)?l.text.trim():`(no prompt)`);if(ze(u))return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=B(u,`bash-input`);if(e)return(0,G.jsxs)(f,{flexDirection:`row`,width:`100%`,children:[(0,G.jsx)(s,{color:`bashBorder`,children:`!`}),(0,G.jsxs)(s,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=B(u,A),r=B(u,`command-args`),i=B(u,`skill-format`)===`true`;if(e)return i?(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{color:t,dimColor:n,children:i?ie(u,o-i,!0):u.slice(0,500).split(`
|
|
1
|
+
import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./figures-gfT9mM8P.js";import{F as a,Rn as o,b as s,m as c,nt as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Ct as m,cn as h,mr as g,vt as _}from"./state-sIHsFpDu.js";import{Ht as v,es as y,no as b,on as x,oo as S,pi as C,rs as w,vi as T}from"./paths-BBvuDQl9.js";import{n as E,r as D}from"./analytics-DqMQntaB.js";import{n as O,t as k}from"./cwd--iizewsn.js";import{O as A,et as j,h as ee,m as te,o as ne,s as M}from"./log-CzsijfHZ.js";import{b as N,x as re}from"./teammate-DMYOtLTK.js";import{C as ie,g as ae,x as oe}from"./startupProfiler-DnXZaX4A.js";import{$S as se,BE as P,Dc as ce,Dx as le,Ec as F,Eo as ue,FO as I,Jv as de,Lo as L,Lw as fe,MO as R,MS as pe,Ox as me,PO as z,Rc as he,So as B,Ui as ge,Uo as _e,Vi as ve,Vo as ye,Xi as be,Xv as xe,Yv as Se,_o as Ce,an as we,bo as V,fo as Te,gy as Ee,hn as De,iu as H,jS as Oe,kc as ke,la as Ae,my as je,nu as Me,os as Ne,tC as Pe,ty as Fe,yn as Ie,zE as Le,zc as Re,zo as ze}from"./loadAgentsDir-DI1a76pd.js";import{E as Be,T as Ve,c as He,d as Ue,w as We}from"./sessionTracing-DoRJ4nSa.js";import{t as Ge}from"./useKeybinding-FsOnjW6T.js";import{l as Ke,u as qe}from"./referral-DeDr9zAE.js";import{n as Je,t as Ye}from"./slashCommandParsing-Cari0pNg.js";import*as U from"path";import{randomUUID as W}from"crypto";o();var G=p();r(),u(),h(),E(),O(),j(),te(),ne(),re(),oe(),w(),S(),x(),z(),We(),Le(),se(),He(),Me(),he(),ke(),Ne(),L(),be(),Ie(),Ye();var Xe={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Ze(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Xe[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else (o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Xe)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function K(e){return Ze(e,`ultraplan`)}function Qe(e){return Ze(e,`ultrareview`)}function $e(e){return K(e).length>0}function et(e){let[t]=K(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function tt(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function nt(e){let t=e.toLowerCase().trim();return t===`continue`?!0:/\b(keep going|go on)\b/.test(t)}function rt(e,t,n,r,i,a,o){let s=W();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;Ue(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Ve(`user_prompt`,{prompt_length:String(l.length),prompt:Be(l),"prompt.id":s}),D(`tengu_input_prompt`,{is_negative:tt(c),is_keep_going:nt(c)}),t.length>0?{messages:[V({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[V({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}E(),L();async function it({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null;n===`prompt`&&v!==null&&!h&&c?.(v),H(`query_process_user_input_base_start`);let y=i.getAppState(),b=await ot(e,n,r,i,a,o,s,l,u,d,f,y.toolPermissionContext.mode,p,m,h,g,t,_);if(H(`query_process_user_input_base_end`),!b.shouldQuery)return b;H(`query_hooks_start`);let x=ue(e)||``;for await(let t of we(x,y.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[Ce(`${De(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:b.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return b.messages.push(V({content:e})),b.shouldQuery=!1,b}if(t.additionalContexts&&t.additionalContexts.length>0&&b.messages.push(F({type:`hook_additional_context`,content:t.additionalContexts.map(at),hookName:`UserPromptSubmit`,toolUseID:`hook-${W()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;b.messages.push({...t.message,attachment:{...t.message.attachment,content:at(t.message.attachment.content)}});break;default:b.messages.push(t.message);break}}return H(`query_hooks_end`),b}var q=1e4;function at(e){return e.length>q?`${e.substring(0,q)}… [output truncated - exceeded ${q} characters]`:e}async function ot(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],b=[],x=e;if(typeof e==`string`)v=e;else if(e.length>0){H(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await I(n);if(e.dimensions){let t=R(e.dimensions);t&&b.push(t)}t.push(e.block)}else t.push(n);x=t,H(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let S=i?Object.values(i).filter(Re):[],C=S.map(e=>e.id),w=i?await Pe(i):new Map;H(`query_pasted_image_processing_start`);let T=await Promise.all(S.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return D(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await I(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??w.get(e.id)}})),E=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of T){if(e.dimensions){let t=R(e.dimensions,n);t&&b.push(t)}else if(t){let e=R(t,n);e&&b.push(e)}else n&&b.push(`[Image source: ${n}]`);E.push(e.block)}H(`query_pasted_image_processing_end`);let O=f;if(p&&v!==null&&v.startsWith(`/`)){let e=Je(v),t=e?ve(e.commandName,r.options.commands):void 0;if(t){let n=ge(t,e?.args??``);if(n.ok)O=!1;else{let e=n.reason??`/${Ae(t)} isn't available over Remote Control.`;return{messages:[V({content:v,uuid:s}),Te(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&v!==null&&!O&&!v.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&$e(g??v)){D(`tengu_ultraplan_keyword`,{});let e=et(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-COtIO6Jy.js`);return J(await t(`/ultraplan ${e}`,y,E,[],r,n,s,c,u,_),b)}let k=!h&&v!==null&&(t!==`prompt`||O||!v.startsWith(`/`));H(`query_attachment_loading_start`);let A=k?await P(ce(v,r,a??null,[],o,l)):[];if(H(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-DHHN8Ca4.js`);return J(await e(v,y,A,r,n),b)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-COtIO6Jy.js`);return J(await e(v,y,E,A,r,n,s,c,u,_),b)}if(v!==null&&t===`prompt`){let e=v.trim(),t=A.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;D(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return J(rt(x,E,C,A,s,d,m),b)}function J(e,t){return t.length>0&&e.messages.push(V({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}h(),T();function st(e){return e===`Agent`?y:e}function ct(e){let t=b()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:k(),session_id:m(),tools:e.tools.map(e=>st(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:v().source,betas:_(),claude_code_version:`2.6.5`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:W()};return n.fast_mode_state=C(e.model,e.fastMode),n}var lt=n({MessageSelector:()=>dt,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function ut(e){return e.type===`text`}function Y(e){return e===`summarize`||e===`summarize_up_to`}function dt({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:u}){let p=pe(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=Se(),_=(0,Q.useMemo)(W,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...V({content:``}),uuid:_}],[e,_]),[y,b]=(0,Q.useState)(v.length-1),x=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),S=v.length>1,[C,w]=(0,Q.useState)(u),[T,E]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!u||!g)return;let e=!1;return xe(p,u.uuid).then(t=>{e||E(t)}),()=>{e=!0}},[u,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(`both`),[ne,N]=(0,Q.useState)(``),[re,ie]=(0,Q.useState)(``);function oe(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:N}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:ie}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{D(`tengu_message_selector_opened`,{})},[]);async function se(e){t(),k(!0);try{await n(e),k(!1),o()}catch(e){M(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function P(t){let n=e.indexOf(t);if(D(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!g){await se(t);return}let r=await xe(p,t.uuid);w(t),E(r)}async function ce(e){if(D(`tengu_message_selector_restore_option_selected`,{option:e}),!C){h(`Message not found.`);return}if(e===`nevermind`){u?o():w(void 0);return}if(Y(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`;await a(C,(t===`up_to`?re:ne).trim()||void 0,t),k(!1),j(null),w(void 0),o()}catch(e){M(e),k(!1),j(null),w(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,s=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,M(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){s=e,M(s)}k(!1),w(void 0),s&&i?h(`Failed to restore the conversation and code:\n${s}\n${i}`):s?h(`Failed to restore the conversation:\n${s}`):i?h(`Failed to restore the code:\n${i}`):o()}let F=qe(),ue=(0,Q.useCallback)(()=>{if(C&&!u){w(void 0);return}D(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),I=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),L=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),fe=(0,Q.useCallback)(()=>b(0),[]),R=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),me=(0,Q.useCallback)(()=>{let e=v[y];e&&P(e)},[v,y,P]);d(`confirm:no`,ue,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":I,"messageSelector:down":L,"messageSelector:top":fe,"messageSelector:bottom":R,"messageSelector:select":me},{context:`MessageSelector`,isActive:!O&&!m&&!C&&S});let[z,he]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=de(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;he(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let B=g&&T?.filesChanged&&T.filesChanged.length>0,ge=!m&&!C&&!u&&S;return(0,G.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,G.jsx)(c,{color:`suggestion`}),(0,G.jsxs)(f,{flexDirection:`column`,marginX:1,gap:1,children:[(0,G.jsx)(s,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{color:`error`,children:[`Error: `,m]})}),!S&&(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{children:`Nothing to rewind to yet.`})}),!m&&C&&S&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{children:[`Confirm you want to restore `,!T&&`the conversation `,`to the point before you sent this message:`]}),(0,G.jsxs)(f,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,G.jsx)(ht,{userMessage:C,color:`text`,isCurrent:!1}),(0,G.jsxs)(s,{dimColor:!0,children:[`(`,ae(new Date(C.timestamp)),`)`]})]}),(0,G.jsx)(pt,{selectedRestoreOption:ee,canRestoreCode:!!B,diffStatsForRestore:T}),O&&Y(A)?(0,G.jsxs)(f,{flexDirection:`row`,gap:1,children:[(0,G.jsx)(je,{}),(0,G.jsx)(s,{children:`Summarizing…`})]}):(0,G.jsx)(le,{isDisabled:O,options:oe(!!B),defaultFocusValue:B?`both`:`conversation`,onFocus:e=>te(e),onChange:e=>ce(e),onCancel:()=>u?o():w(void 0)}),B&&(0,G.jsx)(f,{marginBottom:1,children:(0,G.jsxs)(s,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ge&&(0,G.jsxs)(G.Fragment,{children:[g?(0,G.jsx)(s,{children:`Restore the code and/or conversation to the point before…`}):(0,G.jsx)(s,{children:`Restore and fork the conversation to the point before…`}),(0,G.jsx)(f,{width:`100%`,flexDirection:`column`,children:v.slice(x,x+$).map((e,t)=>{let n=x+t,r=n===y,a=e.uuid===_,o=n in z,c=z[n],l=c?.filesChanged&&c.filesChanged.length;return(0,G.jsxs)(f,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,G.jsx)(f,{width:2,minWidth:2,children:r?(0,G.jsxs)(s,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,G.jsx)(s,{children:` `})}),(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(f,{flexShrink:1,height:1,overflow:`hidden`,children:(0,G.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,G.jsx)(f,{height:1,flexDirection:`row`,children:c?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(s,{dimColor:!r,color:`inactive`,children:l?(0,G.jsxs)(G.Fragment,{children:[l===1&&c.filesChanged[0]?`${U.basename(c.filesChanged[0])} `:`${l} files changed `,(0,G.jsx)(X,{diffStats:c})]}):(0,G.jsx)(G.Fragment,{children:`No code changes`})})}):(0,G.jsxs)(s,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,G.jsx)(s,{dimColor:!0,italic:!0,children:F.pending?(0,G.jsxs)(G.Fragment,{children:[`Press `,F.keyName,` again to exit`]}):(0,G.jsxs)(G.Fragment,{children:[!m&&S&&`Enter to continue · `,`Esc to exit`]})})]})]})}function ft(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function pt({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,G.jsxs)(f,{flexDirection:`column`,children:[(0,G.jsx)(s,{dimColor:!0,children:ft(e)}),!Y(e)&&(r?(0,G.jsx)(mt,{diffStatsForRestore:n}):(0,G.jsx)(s,{dimColor:!0,children:`The code will be unchanged.`}))]})}function mt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,G.jsx)(s,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?U.basename(e.filesChanged[0]||``):t===2?`${U.basename(e.filesChanged[0]||``)} and ${U.basename(e.filesChanged[1]||``)}`:`${U.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(s,{dimColor:!0,children:[`The code will be restored `,(0,G.jsx)(X,{diffStats:e}),` in `,n,`.`]})})}function X({diffStats:e}){if(!(!e||!e.filesChanged))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(s,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,G.jsxs)(s,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:o}=a();if(r)return(0,G.jsx)(f,{width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`(current)`})});let c=e.message.content,l=typeof c==`string`?null:c[c.length-1],u=ee(typeof c==`string`?c.trim():l&&ut(l)?l.text.trim():`(no prompt)`);if(ze(u))return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=B(u,`bash-input`);if(e)return(0,G.jsxs)(f,{flexDirection:`row`,width:`100%`,children:[(0,G.jsx)(s,{color:`bashBorder`,children:`!`}),(0,G.jsxs)(s,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=B(u,A),r=B(u,`command-args`),i=B(u,`skill-format`)===`true`;if(e)return i?(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsxs)(s,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,G.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,G.jsx)(s,{color:t,dimColor:n,children:i?ie(u,o-i,!0):u.slice(0,500).split(`
|
|
2
2
|
`).slice(0,4).join(`
|
|
3
3
|
`)})})}function gt(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!_e(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=N(e.lines,e=>e.startsWith(`+`)),n=N(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function Z(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||ye(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&ut(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1||r.indexOf(`<teammate-message`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!ye(t)&&!_e(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,vt=e((()=>{Q=t(o()),E(),Oe(),Fe(),Ke(),Ge(),L(),me(),Ee(),fe(),$=7}));export{Z as a,it as c,_t as i,K as l,lt as n,ct as o,vt as r,st as s,dt as t,Qe as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{n as o,t as s}from"./figures-gfT9mM8P.js";import{B as c,Cn as l,F as u,Ft as d,In as f,Ln as p,Lt as m,Rn as h,W as g,b as _,m as v,t as y,v as b,x,y as S}from"./src-Di342QoJ.js";import{t as C}from"./jsx-runtime-D-D469L8.js";import{L as w,W as ee,cn as T,y as E}from"./state-sIHsFpDu.js";import{Ac as D,Gs as O,Gt as te,Hs as ne,Ht as k,Ka as re,Ko as ie,Lr as A,Pc as j,Po as M,Pr as N,S as ae,Sc as P,Ur as oe,Zc as F,dn as I,el as se,g as L,jo as ce,on as le,oo as ue,qo as de,qt as fe}from"./paths-
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{n as o,t as s}from"./figures-gfT9mM8P.js";import{B as c,Cn as l,F as u,Ft as d,In as f,Ln as p,Lt as m,Rn as h,W as g,b as _,m as v,t as y,v as b,x,y as S}from"./src-Di342QoJ.js";import{t as C}from"./jsx-runtime-D-D469L8.js";import{L as w,W as ee,cn as T,y as E}from"./state-sIHsFpDu.js";import{Ac as D,Gs as O,Gt as te,Hs as ne,Ht as k,Ka as re,Ko as ie,Lr as A,Pc as j,Po as M,Pr as N,S as ae,Sc as P,Ur as oe,Zc as F,dn as I,el as se,g as L,jo as ce,on as le,oo as ue,qo as de,qt as fe}from"./paths-BBvuDQl9.js";import{c as pe,d as R,i as me,l as he,s as ge}from"./debug-UI3T040K.js";import{n as _e,r as z}from"./analytics-DqMQntaB.js";import{n as ve,t as ye}from"./cwd--iizewsn.js";import{a as be,n as xe}from"./env-chR0gV31.js";import{H as B,V as Se,W as Ce,et as we}from"./log-CzsijfHZ.js";import{C as Te,g as Ee,m as De,n as Oe,r as ke,t as Ae,x as je}from"./startupProfiler-DnXZaX4A.js";import{n as Me,t as Ne}from"./sleep-8Eb9j_Ly.js";import{$g as Pe,$o as Fe,Ah as Ie,Ao as Le,Bo as Re,Cu as ze,Dh as Be,ED as Ve,Es as He,Fg as Ue,Fu as We,Fx as Ge,Go as Ke,Gw as qe,Gx as Je,Hg as Ye,Hw as Xe,Io as Ze,Iu as Qe,Ix as $e,Jo as et,Jw as tt,Kw as nt,Ky as rt,Lo as it,Lu as at,Lw as ot,MS as st,Mo as ct,Ms as lt,Mu as ut,Nu as dt,Oh as ft,Oo as pt,Pg as mt,Pu as ht,Qb as gt,Qg as _t,Rx as vt,So as yt,TD as bt,Vg as xt,Ww as St,Xa as Ct,Xb as wt,Xw as Tt,Ya as Et,Yo as Dt,ZA as Ot,Za as kt,Zw as At,bv as jt,fx as Mt,hk as Nt,iA as Pt,io as Ft,jS as It,jh as Lt,jo as Rt,kh as zt,ko as Bt,lo as Vt,lw as Ht,nx as Ut,px as Wt,qA as Gt,qw as Kt,qx as qt,ro as Jt,sw as Yt,sx as Xt,tA as Zt,vk as Qt,xk as $t,xo as en,xv as tn,yk as nn}from"./loadAgentsDir-DI1a76pd.js";import{Vn as rn,zn as an}from"./prompt-CjFAtm3w.js";import{f as on,p as sn}from"./xml-Dx--sNE1.js";import{C as cn,y as ln}from"./rcDebugLog-CPKZCtR8.js";import{n as un,r as dn,t as fn}from"./browser-fLRXxIsQ.js";import{d as pn,f as mn,h as hn,p as gn}from"./terminalSetup-Lyg4NbGA.js";import{a as _n,o as vn,r as yn,s as bn,t as xn}from"./referral-DeDr9zAE.js";import{n as Sn,t as Cn}from"./SentryErrorBoundary-C-NlfQZw.js";import{a as wn,n as Tn}from"./voiceModeEnabled-DA76xN1Q.js";import{c as En,r as Dn}from"./releaseNotes-CnhQit0y.js";import{a as On,c as kn,d as An,i as jn,l as Mn,n as Nn,o as Pn,r as Fn,t as In,u as Ln}from"./logoV2Utils-DDUoPClc.js";import{n as Rn,t as zn}from"./systemTheme-dDbitcxB.js";import{n as Bn,r as Vn}from"./PromptInputFooterSuggestions-DrrkNOuS.js";import{n as Hn,t as Un}from"./useMainLoopModel-CwvuTRXn.js";import{n as Wn,t as Gn}from"./modalContext-CmSKRyea.js";import{i as Kn,n as qn,r as Jn,s as Yn,t as Xn}from"./OverageCreditUpsell-Cpk_5Lv0.js";import{n as Zn,r as Qn,t as $n}from"./statusNoticeHelpers-DcssRhLw.js";import{homedir as er}from"os";import{relative as tr}from"path";import{fileURLToPath as nr}from"url";function rr(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var ir=t((()=>{}));function ar(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||yt(t.text,`status`)!==`completed`?!1:yt(t.text,`summary`)?.startsWith(`Background command `)??!1}function or(e,t){if(!qt()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(ar(t)){let i=0;for(;r<e.length&&ar(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${Ce}><${Se}>completed</${Se}><${B}>${i} background commands completed</${B}></${Ce}>`}]}})}else n.push(t),r++}return n}var sr=t((()=>{we(),ze(),Je(),it()}));function cr(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function lr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(cr(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!cr(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var ur=t((()=>{}));function dr(e){return e.type===`attachment`&&e.attachment.type===`task_status`&&e.attachment.taskType===`in_process_teammate`&&e.attachment.status===`completed`}function fr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(dr(r)){let i=0;for(;n<e.length&&dr(e[n]);)i++,n++;i===1?t.push(r):t.push({type:`attachment`,uuid:r.uuid,timestamp:r.timestamp,attachment:{type:`teammate_shutdown_batch`,count:i}})}else t.push(r),n++}return t}var pr=t((()=>{}));function mr(e){let t=_r.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),_r.set(e,t)),t}function hr(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function gr(e,t,n=!1){if(n)return{messages:e};let r=mr(t),i=new Map;for(let t of e){let e=hr(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=hr(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=hr(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var _r,vr=t((()=>{_r=new WeakMap}));function yr(e){let t=Tr.get(e);if(t!==void 0)return t;let n=br(e).toLowerCase();return Tr.set(e,n),n}function br(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=wr.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?wr.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(Sr(e.toolUseResult));t=r.join(`
|
|
2
2
|
`)}break}case`assistant`:{let n=e.message.content;Array.isArray(n)&&(t=n.flatMap(e=>e.type===`text`?[e.text]:e.type===`tool_use`?[xr(e.input)]:[]).join(`
|
|
3
3
|
`));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
|
|
4
4
|
`);else if(e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
|
|
@@ -7,5 +7,5 @@ import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{s as i,u as a}fro
|
|
|
7
7
|
`)}function Sr(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`
|
|
8
8
|
`+e:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
|
|
9
9
|
`))}return n.join(`
|
|
10
|
-
`)}var Cr,wr,Tr,Er=t((()=>{it(),Cr=`</system-reminder>`,wr=new Set([Ct,kt]),Tr=new WeakMap}));function Dr({pose:e=`default`}={}){if(xe.terminal===`Apple_Terminal`)return(0,V.jsx)(Or,{pose:e});let t=kr[e];return(0,V.jsxs)(x,{flexDirection:`column`,children:[(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:t.r1L}),(0,V.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:t.r1E}),(0,V.jsx)(_,{color:`clawd_body`,children:t.r1R})]}),(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:t.r2L}),(0,V.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`█████`}),(0,V.jsx)(_,{color:`clawd_body`,children:t.r2R})]}),(0,V.jsxs)(_,{color:`clawd_body`,children:[` `,`▘▘ ▝▝`,` `]})]})}function Or({pose:e}){return(0,V.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:`▗`}),(0,V.jsx)(_,{color:`clawd_background`,backgroundColor:`clawd_body`,children:Ar[e]}),(0,V.jsx)(_,{color:`clawd_body`,children:`▖`})]}),(0,V.jsx)(_,{backgroundColor:`clawd_body`,children:` `.repeat(7)}),(0,V.jsx)(_,{color:`clawd_body`,children:`▘▘ ▝▝`})]})}var V,kr,Ar,jr=t((()=>{h(),y(),be(),V=C(),kr={default:{r1L:` ▐`,r1E:`▛███▜`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-left":{r1L:` ▐`,r1E:`▟███▟`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-right":{r1L:` ▐`,r1E:`▙███▙`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"arms-up":{r1L:`▗▟`,r1E:`▛███▜`,r1R:`▙▖`,r2L:` ▜`,r2R:`▛ `}},Ar={default:` ▗ ▖ `,"look-left":` ▘ ▘ `,"look-right":` ▝ ▝ `,"arms-up":` ▗ ▖ `}}));function Mr(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=l(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,l(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?l(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=l(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,l(r))),o}function Nr({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?l(e.timestamp):0));return(0,H.jsxs)(x,{flexDirection:`column`,width:t,children:[(0,H.jsx)(_,{bold:!0,color:`claude`,children:n}),o?(0,H.jsxs)(H.Fragment,{children:[o.content,i&&(0,H.jsx)(_,{dimColor:!0,italic:!0,children:Te(i,t)})]}):r.length===0&&a?(0,H.jsx)(_,{dimColor:!0,children:Te(a,t)}):(0,H.jsxs)(H.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,H.jsxs)(_,{children:[s>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,H.jsx)(_,{children:Te(e.text,r)})]},n)}),i&&(0,H.jsx)(_,{dimColor:!0,italic:!0,children:Te(i,t)})]})]})}var H,Pr=t((()=>{h(),y(),je(),H=C()}));function Fr({feeds:e,maxWidth:t}){let n=e.map(e=>Mr(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Lr.jsx)(x,{flexDirection:`column`,children:e.map((t,n)=>(0,Lr.jsxs)(Ir.Fragment,{children:[(0,Lr.jsx)(Nr,{config:t,actualWidth:i}),n<e.length-1&&(0,Lr.jsx)(v,{color:`claude`,width:i})]},n))})}var Ir,Lr,Rr=t((()=>{Ir=n(h(),1),y(),Pr(),Lr=C()}));function zr(e){let t=e.map(e=>{let t=Ee(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function Br(e){let t=e.map(e=>{if(process.env.USER_TYPE===`ant`){let t=e.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);if(t)return{timestamp:t[1],text:t[2]||``}}return{text:e}}),n=process.env.USER_TYPE===`ant`?`Unable to fetch latest claude-cli-internal commits`:`Check the Claude Code changelog for updates`;return{title:process.env.USER_TYPE===`ant`?`What's new [ANT-ONLY: Latest CC commits]`:`What's new`,lines:t,footer:t.length>0?`/release-notes for more`:void 0,emptyMessage:n}}function Vr(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${s.tick} `:``}${e}`})),n=ye()===er()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}function Hr(){let e=_n(),t=e?`Share Claude Code and earn ${yn(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(x,{marginY:1,children:(0,Ur.jsx)(_,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Ur.jsx)(_,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Ur,Wr=t((()=>{o(),y(),bn(),ve(),je(),Ur=C()}));function Gr(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Kr(){let{pose:e,bounceOffset:t,onClick:n}=qr();return(0,Yr.jsx)(x,{height:ti,flexDirection:`column`,onClick:n,children:(0,Yr.jsx)(x,{marginTop:t,flexShrink:0,children:(0,Yr.jsx)(Dr,{pose:e})})})}function qr(){let[e]=(0,Jr.useState)(()=>re().prefersReducedMotion??!1),[t,n]=(0,Jr.useState)(-1),r=(0,Jr.useRef)(Xr),i=()=>{e||t!==-1||(r.current=Zr[Math.floor(Math.random()*Zr.length)],n(0))};(0,Jr.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,$r,ei);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Qr;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni=t((()=>{h(),Jr=n(h(),1),y(),ue(),jr(),Yr=C(),Xr=[...Gr(`default`,1,2),...Gr(`arms-up`,0,3),...Gr(`default`,0,1),...Gr(`default`,1,2),...Gr(`arms-up`,0,3),...Gr(`default`,0,1)],Zr=[Xr,[...Gr(`look-right`,0,5),...Gr(`look-left`,0,5),...Gr(`default`,0,1)]],Qr={pose:`default`,offset:0},$r=60,ei=e=>e+1,ti=3}));function ri(){let e=vn();e==null||e<=0||e>(P().passesLastSeenRemaining??0)&&j(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function ii(){let{eligible:e,hasCache:t}=xn();if(!e||!t)return!1;ri();let n=P();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ai(){let[e]=(0,ci.useState)(()=>ii());return e}function oi(){let e=0;j(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),z(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function si(){let e=_n();return(0,li.jsxs)(_,{dimColor:!0,children:[(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${yn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var ci,li,ui=t((()=>{h(),ci=n(h(),1),y(),_e(),bn(),D(),li=C()}));function di(){let{columns:e}=u(),t=st(e=>e.agent),n=st(e=>e.effortValue),r=Hn(),i=oe(r),{version:a,cwd:o,billingType:s,agentName:c}=Pn(),d=t??c,f=ai(),p=Yn();(0,fi.useEffect)(()=>{f&&oi()},[f]),(0,fi.useEffect)(()=>{p&&!f&&Jn()},[p,f]);let m=Math.max(e-15,20),h=Te(a,Math.max(m-13,6)),{shouldSplit:g,truncatedModel:v,truncatedBilling:y}=Fn(i+Gt(r,n),s,m),b=d?m-1-l(d)-3:m,S=An(o,Math.max(b,10));return(0,U.jsx)(Ie,{children:(0,U.jsxs)(x,{flexDirection:`row`,gap:2,alignItems:`center`,children:[qt()?(0,U.jsx)(Kr,{}):(0,U.jsx)(Dr,{}),(0,U.jsxs)(x,{flexDirection:`column`,children:[(0,U.jsxs)(_,{children:[(0,U.jsx)(_,{bold:!0,children:`Claude Code`}),` `,(0,U.jsxs)(_,{dimColor:!0,children:[`v`,h]})]}),g?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(_,{dimColor:!0,children:v}),(0,U.jsx)(_,{dimColor:!0,children:y})]}):(0,U.jsxs)(_,{dimColor:!0,children:[v,` · `,y]}),(0,U.jsx)(_,{dimColor:!0,children:d?`@${d} · ${S}`:S}),f&&(0,U.jsx)(si,{}),!f&&p&&(0,U.jsx)(Xn,{maxWidth:m,twoLine:!0})]})]})})}var fi,U,pi=t((()=>{fi=n(h(),1),Un(),ot(),y(),It(),Ot(),je(),Je(),Ln(),N(),Lt(),ni(),jr(),ui(),Kn(),U=C()}));function mi(){let e=(0,gi.useMemo)(hi,[]),t=(0,gi.useMemo)(()=>P().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,gi.useEffect)(()=>{n&&j(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,_i.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,_i.jsx)(_,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function hi(){return L(vi,yi)}var gi,_i,vi,yi,bi=t((()=>{h(),gi=n(h(),1),y(),ae(),D(),_i=C(),vi=`tengu-top-of-feed-tip`,yi={tip:``,color:`dim`}}));function xi({char:e=`✻`}){let[t]=(0,Si.useState)(()=>re().prefersReducedMotion??!1),[n,r]=(0,Si.useState)(t),i=(0,Si.useRef)(null),[a,o]=c(n?null:50);return(0,Si.useEffect)(()=>{if(n)return;let e=setTimeout(r,Ti,!0);return()=>clearTimeout(e)},[n]),n?(0,Ci.jsx)(x,{ref:a,children:(0,Ci.jsx)(_,{color:Ei,children:e})}):(i.current===null&&(i.current=o),(0,Ci.jsx)(x,{ref:a,children:(0,Ci.jsx)(_,{color:vt(Ge((o-i.current)/wi*360%360)),children:e})}))}var Si,Ci,wi,Ti,Ei,Di=t((()=>{h(),Si=n(h(),1),O(),y(),ue(),$e(),Ci=C(),wi=1500,Ti=wi*2,Ei=vt({r:153,g:153,b:153})}));function Oi(){return A()&&(P().opus1mMergeNoticeSeenCount??0)<Mi}function ki(){let[e]=(0,Ai.useState)(Oi);return(0,Ai.useEffect)(()=>{if(!e)return;let t=(P().opus1mMergeNoticeSeenCount??0)+1;j(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,ji.jsxs)(x,{paddingLeft:2,children:[(0,ji.jsx)(xi,{char:`↑`}),(0,ji.jsx)(_,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var Ai,ji,Mi,Ni=t((()=>{h(),Ai=n(h(),1),O(),y(),D(),N(),Di(),ji=C(),Mi=6}));function Pi(){return(0,Li.jsx)(Fi,{})}function Fi(){let[e]=(0,Ii.useState)(()=>wn()&&re().voiceEnabled!==!0&&(P().voiceNoticeSeenCount??0)<Ri&&!Oi());return(0,Ii.useEffect)(()=>{if(!e)return;let t=(P().voiceNoticeSeenCount??0)+1;j(e=>(e.voiceNoticeSeenCount??0)>=t?e:{...e,voiceNoticeSeenCount:t})},[e]),e?(0,Li.jsxs)(x,{paddingLeft:2,children:[(0,Li.jsx)(xi,{}),(0,Li.jsx)(_,{dimColor:!0,children:` Voice mode is now available · /voice to enable`})]}):null}var Ii,Li,Ri,zi=t((()=>{h(),Ii=n(h(),1),y(),D(),ue(),Tn(),Di(),Ni(),Li=C(),Ri=3}));function Bi(){return null}var Vi=t((()=>{}));function Hi(){return null}var Ui=t((()=>{})),Wi=r({ChannelsNotice:()=>Gi,findUnmatched:()=>qi});function Gi(){let[{channels:e,list:t,unmatched:n}]=(0,Ji.useState)(()=>{let e=E();return e.length===0?{channels:e,list:``,unmatched:[]}:{channels:e,list:e.map(Ki).join(`, `),unmatched:qi(e)}});if(e.length===0)return null;let r=e.some(e=>!e.dev),i=w()&&r?`Channels`:w()?`--dangerously-load-development-channels`:`--channels`;return(0,Yi.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,Yi.jsxs)(_,{color:`error`,children:[`Listening for channel messages from: `,t]}),(0,Yi.jsxs)(_,{dimColor:!0,children:[`Experimental · inbound messages will be pushed into this session, this carries prompt injection risks. Restart Claude Code without `,i,` to disable.`]}),n.map(e=>(0,Yi.jsxs)(_,{color:`warning`,children:[Ki(e.entry),` · `,e.why]},`${Ki(e.entry)}:${e.why}`))]})}function Ki(e){return e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function qi(e,t){let n=t?.configuredServerNames??(()=>{let e=[`enterprise`,`user`,`project`,`local`],t=new Set;for(let n of e)for(let e of Object.keys(Yt(n).servers))t.add(e);return t})(),r=t?.installedPluginIds??(()=>{let e=new Set(Object.keys(lt().plugins)),t=on();for(let n of[...t.enabled,...t.disabled])e.add(n.source);return e})(),i=[];for(let t of e){if(t.kind===`server`){n.has(t.name)||i.push({entry:t,why:`no MCP server configured with that name`});continue}r.has(`${t.name}@${t.marketplace}`)||i.push({entry:t,why:`plugin not installed`})}return i}var Ji,Yi,Xi=t((()=>{h(),Ji=n(h(),1),T(),sn(),y(),Ht(),He(),Yi=C()}));function Zi(){let e=kn(),t=P().oauthAccount?.displayName??``,{columns:n}=u(),r=hn(),i=Zt.isSandboxingEnabled(),o=ai(),s=Yn(),c=st(e=>e.agent),d=st(e=>e.effortValue),f=P(),p;try{p=Mn(3)}catch{p=[]}let[m]=(0,Qi.useState)(()=>{let e=re().companyAnnouncements;if(!(!e||e.length===0))return f.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:h}=Dn(f.lastReleaseNotesSeen);(0,Qi.useEffect)(()=>{P().lastReleaseNotesSeen!==`2.6.0`&&(j(e=>e.lastReleaseNotesSeen===`2.6.0`?e:{...e,lastReleaseNotesSeen:`2.6.0`}),r&&mn())},[f,r]);let g=!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Qi.useEffect)(()=>{o&&!r&&!g&&oi()},[o,r,g]),(0,Qi.useEffect)(()=>{s&&!r&&!o&&!g&&Jn()},[s,r,o,g]);let v=Hn(),y=oe(v),{version:S,cwd:C,billingType:w,agentName:ee}=Pn(),T=c??ee,E=Te(y+Gt(v,d),ea-20);if(!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(di,{}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),pe()&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,W.jsx)(mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,W.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,W.jsx)(_,{children:m})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,W.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(bt())]}),(0,W.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,W.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]});let D=On(n),O=Rn(P().theme),te=` ${b(`claude`,O)(`Claude Code`)} ${b(`inactive`,O)(`v${S}`)} `,ne=b(`claude`,O)(` Claude Code `);if(D===`compact`){let e=jn(t);l(e)>n-4&&(e=jn(null));let r=T?n-4-1-l(T)-3:n-4,a=An(C,Math.max(r,10));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ie,{children:(0,W.jsxs)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ne,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,W.jsx)(_,{bold:!0,children:e}),(0,W.jsx)(x,{marginY:1,children:(0,W.jsx)(Dr,{})}),(0,W.jsx)(_,{dimColor:!0,children:E}),(0,W.jsx)(_,{dimColor:!0,children:w}),(0,W.jsx)(_,{dimColor:!0,children:T?`@${T} · ${a}`:a})]})}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),i&&(0,W.jsx)(x,{marginTop:1,flexDirection:`column`,children:(0,W.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]})}let k=jn(t),ie=!process.env.IS_DEMO&&f.oauthAccount?.organizationName?`${E} · ${w} · ${f.oauthAccount.organizationName}`:`${E} · ${w}`,A=T?ea-1-l(T)-3:ea,M=An(C,Math.max(A,10)),N=T?`@${T} · ${M}`:M,{leftWidth:ae,rightWidth:I}=In(n,D,Nn(k,N,ie));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ie,{children:(0,W.jsx)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:te,position:`top`,align:`start`,offset:3},children:(0,W.jsxs)(x,{flexDirection:D===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,W.jsxs)(x,{flexDirection:`column`,width:ae,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,W.jsx)(x,{marginTop:1,children:(0,W.jsx)(_,{bold:!0,children:k})}),(0,W.jsx)(Dr,{}),(0,W.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,W.jsx)(_,{dimColor:!0,children:ie}),(0,W.jsx)(_,{dimColor:!0,children:N})]})]}),D===`horizontal`&&(0,W.jsx)(x,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),D===`horizontal`&&(0,W.jsx)(Fr,{feeds:r?[Vr(pn()),zr(e)]:o?[zr(e),Hr()]:s?[zr(e),qn()]:[zr(e),Br(p)],maxWidth:I})]})})}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),pe()&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,W.jsx)(mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,W.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,W.jsx)(_,{children:m})]}),i&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,W.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(bt())]}),(0,W.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,W.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]})}var Qi,W,$i,ea,ta=t((()=>{h(),y(),ot(),Ln(),je(),se(),jr(),Rr(),Wr(),D(),zn(),ue(),ge(),Qi=n(h(),1),gn(),pi(),Lt(),En(),Ve(),i(),Oe(),bi(),zi(),Ni(),Vi(),Ui(),W=C(),Pt(),ui(),Kn(),It(),Ot(),Un(),N(),$i=(Xi(),e(Wi)),ea=50}));function na({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,ra.jsx)(x,{minWidth:l(i)+8,children:(0,ra.jsx)(_,{dimColor:!0,children:i})})}var ra,ia=t((()=>{h(),y(),ra=C()}));function aa({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,oa.jsx)(x,{minWidth:l(n),children:(0,oa.jsx)(_,{dimColor:!0,children:n})})}var oa,sa=t((()=>{h(),y(),oa=C()}));function ca(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ha(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(ht(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ha(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ha(t.messages[0]?.message.content)?.input;if(ht(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function la({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:l,onOpenRateLimitOptions:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(Qe(e,o)||m&&!n),S=v?e.displayMessage:y?dt(e):e,C=v||y?[]:Bt(e,h),w=Mo(e,s,o,v||y?Et:Le(e,h),c,h),ee=!1;if(l)if(v)ee=e.messages.some(e=>{let t=ha(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)ee=Qe(e,o);else{let t=Rt(e);ee=!t||o.has(t)}let T=_&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),E=(0,ma.jsx)(Be,{message:e,lookups:h,addMargin:!T,containerWidth:T?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:ee,shouldShowDot:!0,isTranscriptMode:_,isStatic:w,onOpenRateLimitOptions:u,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return T?(0,ma.jsx)(Ie,{children:(0,ma.jsxs)(x,{width:p,flexDirection:`column`,children:[(0,ma.jsxs)(x,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,ma.jsx)(aa,{message:S,isTranscriptMode:_}),(0,ma.jsx)(na,{message:S,isTranscriptMode:_})]}),E]})}):(0,ma.jsx)(Ie,{children:E})}function ua(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ha(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return We(e).some(e=>t.has(e));let n=Rt(e);return!!n&&t.has(n)}function da(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ha(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return We(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ha(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Rt(e);return!n||t.has(n)}function fa(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&ft(t.message))return!1;let n=ua(e.message,e.streamingToolUseIDs),r=da(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var pa,ma,ha,ga,_a=t((()=>{pa=n(h(),1),y(),at(),it(),zt(),ma=C(),ia(),Uo(),sa(),Lt(),ha=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},ga=pa.memo(la,fa)}));function va(e){return e.type===`attachment`&&ya.has(e.attachment.type)}var ya,ba=t((()=>{ya=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.team_context.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.companion_intro.token_usage.ultrathink_effort.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function xa(e){return Oa.filter(t=>t.isActive(e))}var G,Sa,Ca,wa,Ta,Ea,Da,Oa,ka=t((()=>{y(),h(),$t(),o(),ve(),je(),le(),Qn(),gt(),Mt(),G=C(),Sa={id:`large-memory-files`,type:`warning`,isActive:e=>Qt(e.memoryFiles).length>0,render:e=>(0,G.jsx)(G.Fragment,{children:Qt(e.memoryFiles).map(e=>{let t=e.path.startsWith(ye())?tr(ye(),e.path):e.path;return(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Large `,(0,G.jsx)(_,{bold:!0,children:t}),` will impact performance (`,De(e.content.length),` chars > `,De(Nt),`)`,(0,G.jsx)(_,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Ca={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=fe();return I()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=fe();return(0,G.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},wa={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0});return!!te()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0});return(0,G.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Ta={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0}),t=fe();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0}),t=fe();return(0,G.jsxs)(x,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,G.jsxs)(x,{flexDirection:`column`,marginLeft:3,children:[(0,G.jsxs)(_,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,G.jsxs)(_,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},Ea={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Zn(e.agentDefinitions)>$n,render:e=>{let t=Zn(e.agentDefinitions);return(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,De(t),` tokens > `,De($n),`)`,(0,G.jsx)(_,{dimColor:!0,children:` · /agents to manage`})]})]})}},Da={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!Ut()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=wt();return t!==null&&!Wt(t)},render:()=>{let e=Xt(wt());return(0,G.jsxs)(x,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,G.jsx)(_,{color:`ide`,children:s.arrowUp}),(0,G.jsxs)(_,{children:[`Install the `,(0,G.jsx)(_,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,G.jsx)(_,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},Oa=[Sa,Ea,Ca,wa,Ta,Da]}));function Aa({agentDefinitions:e}={}){let t={config:P(),agentDefinitions:e,memoryFiles:(0,Ma.use)(nn())},n=xa(t);return n.length===0?null:(0,Na.jsx)(x,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Na.jsx)(ja.Fragment,{children:e.render(t)},e.id))})}var ja,Ma,Na,Pa=t((()=>{ja=n(h(),1),Ma=n(h(),1),y(),$t(),D(),ka(),Na=C()}));function Fa(e,t,n){let r=(0,K.useRef)(new Map),i=(0,K.useRef)(0),a=(0,K.useRef)(0),o=(0,K.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,K.useRef)(new Map),c=(0,K.useRef)(new Map),l=(0,K.useRef)(n),u=(0,K.useRef)(!1),d=(0,K.useRef)(null),f=(0,K.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,K.useRef)(0),h=(0,K.useRef)(null);(0,K.useSyncExternalStore)((0,K.useCallback)(t=>e.current?.subscribe(t)??Ua,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/za);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,K.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??Ia);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-Ra),w=b;else{if(y){let e=v+La;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-La;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*La,y=Math.min(b,C+Va),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+La);)S+=r.current.get(t[w])??Ba,w++}let e=v+2*La,n=Math.max(0,w-Va),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??Ba;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??Ba;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Ha&&(C=e-Ha),w>t+Ha&&(w=t+Ha),C>w&&(w=Math.min(C+Ha,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let ee=(0,K.useDeferredValue)(C),T=(0,K.useDeferredValue)(w),E=C<ee?ee:C,D=w>T?T:w;if((E>D||y)&&(E=C,D=w),_>0&&(D=w),D-E>Va){let e=(x[E]+x[D])/2;g-m.current<e?D=E+Va:E=D-Va}let O=m.current,te=x[E],ne=E===0?0:te+O,k=D===b?1/0:Math.max(te,x[D]-v)+O;(0,K.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ne,k)}),(0,K.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let re=(0,K.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),ie=(0,K.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),A=(0,K.useCallback)(e=>s.current.get(t[e])??null,[t]),j=(0,K.useCallback)(e=>r.current.get(t[e]),[t]),M=(0,K.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),N=S-x[D];return{range:[E,D],topSpacer:te,bottomSpacer:N,measureRef:re,spacerRef:h,offsets:x,getItemTop:ie,getItemElement:A,getItemHeight:j,scrollToIndex:M}}var K,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa=t((()=>{K=n(h(),1),Ia=3,La=40,Ra=30,za=La>>1,Ba=1,Va=200,Ha=25,Ua=()=>{}}));function Ga({children:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null);return(0,Xa.jsx)(Qa.Provider,{value:n,children:(0,Xa.jsx)(eo.Provider,{value:i,children:(0,Xa.jsx)(Za.Provider,{value:t,children:(0,Xa.jsx)($a.Provider,{value:r,children:e})})})})}function Ka(){return(0,q.useContext)(Za)}function qa(){return(0,q.useContext)($a)}function Ja(e){let t=(0,q.useContext)(Qa);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ya(e){let t=(0,q.useContext)(eo);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var q,Xa,Za,Qa,$a,eo,to=t((()=>{q=n(h(),1),Xa=C(),Za=(0,q.createContext)(null),Qa=(0,q.createContext)(null),$a=(0,q.createContext)(null),eo=(0,q.createContext)(null)}));function no(e){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(e);r.current=e;let i=(0,J.useRef)(null),a=(0,J.useCallback)(()=>{n(null)},[]),o=(0,J.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,J.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,J.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,J.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function ro(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!io(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function io(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function ao(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||va(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=ro(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function oo({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:d=0,onPillClick:f}){let{rows:p,columns:h}=u(),[v,y]=(0,J.useState)(null),b=(0,J.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,J.useSyncExternalStore)((0,J.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,J.useLayoutEffect)(()=>{if(!qt())return;let e=m.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{dn(nr(e))}catch{}else un(e)},()=>{e.onHyperlinkClick=void 0}},[]),qt()){let s=l?null:v,u=s!=null&&s!==`clicked`&&n==null?s:null,m=s!=null&&n==null;return(0,Y.jsxs)(Ga,{children:[(0,Y.jsx)(x,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,Y.jsxs)(x,{flexDirection:`column`,flexGrow:1,width:h,overflow:`hidden`,children:[(0,Y.jsxs)(x,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[u&&(0,Y.jsx)(co,{text:u.text,onClick:u.scrollTo}),(0,Y.jsxs)(g,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!m,stickyScroll:!0,children:[(0,Y.jsx)(po,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,Y.jsx)(so,{count:d,onClick:f}),r!=null&&(0,Y.jsx)(x,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,Y.jsxs)(x,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,Y.jsx)(lo,{}),(0,Y.jsx)(uo,{}),(0,Y.jsx)(x,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,Y.jsx)(Gn,{value:{rows:p-fo-1,columns:h-4,scrollRef:a??null},children:(0,Y.jsxs)(x,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:p-fo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,Y.jsx)(x,{flexShrink:0,children:(0,Y.jsx)(_,{color:`permission`,children:`▔`.repeat(h)})}),(0,Y.jsx)(x,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,Y.jsxs)(Y.Fragment,{children:[e,t,n,i]})}function so({count:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(x,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,Y.jsx)(x,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(_,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${M(e,`message`)}`:`Jump to bottom`,` `,s.arrowDown,` `]})})})}function co({text:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(x,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(_,{color:`subtle`,wrap:`truncate-end`,children:[s.pointer,` `,e]})})}function lo(){let e=Ka();return!e||e.suggestions.length===0?null:(0,Y.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,Y.jsx)(Bn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function uo(){let e=qa();return e?(0,Y.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var J,Y,fo,po,mo=t((()=>{o(),J=n(h(),1),Wn(),to(),ot(),y(),fn(),Je(),ce(),ba(),Vn(),Y=C(),fo=2,po=(0,J.createContext)({setStickyPrompt:()=>{}})}));function ho(e){let t=So.get(e);if(t!==void 0)return t;let n=yr(e);return So.set(e,n),n}function go(e){let t=wo.get(e);if(t!==void 0)return t;let n=_o(e);return wo.set(e,n),n}function _o(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
|
|
10
|
+
`)}var Cr,wr,Tr,Er=t((()=>{it(),Cr=`</system-reminder>`,wr=new Set([Ct,kt]),Tr=new WeakMap}));function Dr({pose:e=`default`}={}){if(xe.terminal===`Apple_Terminal`)return(0,V.jsx)(Or,{pose:e});let t=kr[e];return(0,V.jsxs)(x,{flexDirection:`column`,children:[(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:t.r1L}),(0,V.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:t.r1E}),(0,V.jsx)(_,{color:`clawd_body`,children:t.r1R})]}),(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:t.r2L}),(0,V.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`█████`}),(0,V.jsx)(_,{color:`clawd_body`,children:t.r2R})]}),(0,V.jsxs)(_,{color:`clawd_body`,children:[` `,`▘▘ ▝▝`,` `]})]})}function Or({pose:e}){return(0,V.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,V.jsxs)(_,{children:[(0,V.jsx)(_,{color:`clawd_body`,children:`▗`}),(0,V.jsx)(_,{color:`clawd_background`,backgroundColor:`clawd_body`,children:Ar[e]}),(0,V.jsx)(_,{color:`clawd_body`,children:`▖`})]}),(0,V.jsx)(_,{backgroundColor:`clawd_body`,children:` `.repeat(7)}),(0,V.jsx)(_,{color:`clawd_body`,children:`▘▘ ▝▝`})]})}var V,kr,Ar,jr=t((()=>{h(),y(),be(),V=C(),kr={default:{r1L:` ▐`,r1E:`▛███▜`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-left":{r1L:` ▐`,r1E:`▟███▟`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-right":{r1L:` ▐`,r1E:`▙███▙`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"arms-up":{r1L:`▗▟`,r1E:`▛███▜`,r1R:`▙▖`,r2L:` ▜`,r2R:`▛ `}},Ar={default:` ▗ ▖ `,"look-left":` ▘ ▘ `,"look-right":` ▝ ▝ `,"arms-up":` ▗ ▖ `}}));function Mr(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=l(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,l(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?l(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=l(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,l(r))),o}function Nr({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?l(e.timestamp):0));return(0,H.jsxs)(x,{flexDirection:`column`,width:t,children:[(0,H.jsx)(_,{bold:!0,color:`claude`,children:n}),o?(0,H.jsxs)(H.Fragment,{children:[o.content,i&&(0,H.jsx)(_,{dimColor:!0,italic:!0,children:Te(i,t)})]}):r.length===0&&a?(0,H.jsx)(_,{dimColor:!0,children:Te(a,t)}):(0,H.jsxs)(H.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,H.jsxs)(_,{children:[s>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,H.jsx)(_,{children:Te(e.text,r)})]},n)}),i&&(0,H.jsx)(_,{dimColor:!0,italic:!0,children:Te(i,t)})]})]})}var H,Pr=t((()=>{h(),y(),je(),H=C()}));function Fr({feeds:e,maxWidth:t}){let n=e.map(e=>Mr(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Lr.jsx)(x,{flexDirection:`column`,children:e.map((t,n)=>(0,Lr.jsxs)(Ir.Fragment,{children:[(0,Lr.jsx)(Nr,{config:t,actualWidth:i}),n<e.length-1&&(0,Lr.jsx)(v,{color:`claude`,width:i})]},n))})}var Ir,Lr,Rr=t((()=>{Ir=n(h(),1),y(),Pr(),Lr=C()}));function zr(e){let t=e.map(e=>{let t=Ee(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function Br(e){let t=e.map(e=>{if(process.env.USER_TYPE===`ant`){let t=e.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);if(t)return{timestamp:t[1],text:t[2]||``}}return{text:e}}),n=process.env.USER_TYPE===`ant`?`Unable to fetch latest claude-cli-internal commits`:`Check the Claude Code changelog for updates`;return{title:process.env.USER_TYPE===`ant`?`What's new [ANT-ONLY: Latest CC commits]`:`What's new`,lines:t,footer:t.length>0?`/release-notes for more`:void 0,emptyMessage:n}}function Vr(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${s.tick} `:``}${e}`})),n=ye()===er()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}function Hr(){let e=_n(),t=e?`Share Claude Code and earn ${yn(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(x,{marginY:1,children:(0,Ur.jsx)(_,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Ur.jsx)(_,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Ur,Wr=t((()=>{o(),y(),bn(),ve(),je(),Ur=C()}));function Gr(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Kr(){let{pose:e,bounceOffset:t,onClick:n}=qr();return(0,Yr.jsx)(x,{height:ti,flexDirection:`column`,onClick:n,children:(0,Yr.jsx)(x,{marginTop:t,flexShrink:0,children:(0,Yr.jsx)(Dr,{pose:e})})})}function qr(){let[e]=(0,Jr.useState)(()=>re().prefersReducedMotion??!1),[t,n]=(0,Jr.useState)(-1),r=(0,Jr.useRef)(Xr),i=()=>{e||t!==-1||(r.current=Zr[Math.floor(Math.random()*Zr.length)],n(0))};(0,Jr.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,$r,ei);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Qr;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni=t((()=>{h(),Jr=n(h(),1),y(),ue(),jr(),Yr=C(),Xr=[...Gr(`default`,1,2),...Gr(`arms-up`,0,3),...Gr(`default`,0,1),...Gr(`default`,1,2),...Gr(`arms-up`,0,3),...Gr(`default`,0,1)],Zr=[Xr,[...Gr(`look-right`,0,5),...Gr(`look-left`,0,5),...Gr(`default`,0,1)]],Qr={pose:`default`,offset:0},$r=60,ei=e=>e+1,ti=3}));function ri(){let e=vn();e==null||e<=0||e>(P().passesLastSeenRemaining??0)&&j(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function ii(){let{eligible:e,hasCache:t}=xn();if(!e||!t)return!1;ri();let n=P();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ai(){let[e]=(0,ci.useState)(()=>ii());return e}function oi(){let e=0;j(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),z(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function si(){let e=_n();return(0,li.jsxs)(_,{dimColor:!0,children:[(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,li.jsx)(_,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${yn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var ci,li,ui=t((()=>{h(),ci=n(h(),1),y(),_e(),bn(),D(),li=C()}));function di(){let{columns:e}=u(),t=st(e=>e.agent),n=st(e=>e.effortValue),r=Hn(),i=oe(r),{version:a,cwd:o,billingType:s,agentName:c}=Pn(),d=t??c,f=ai(),p=Yn();(0,fi.useEffect)(()=>{f&&oi()},[f]),(0,fi.useEffect)(()=>{p&&!f&&Jn()},[p,f]);let m=Math.max(e-15,20),h=Te(a,Math.max(m-13,6)),{shouldSplit:g,truncatedModel:v,truncatedBilling:y}=Fn(i+Gt(r,n),s,m),b=d?m-1-l(d)-3:m,S=An(o,Math.max(b,10));return(0,U.jsx)(Ie,{children:(0,U.jsxs)(x,{flexDirection:`row`,gap:2,alignItems:`center`,children:[qt()?(0,U.jsx)(Kr,{}):(0,U.jsx)(Dr,{}),(0,U.jsxs)(x,{flexDirection:`column`,children:[(0,U.jsxs)(_,{children:[(0,U.jsx)(_,{bold:!0,children:`Claude Code`}),` `,(0,U.jsxs)(_,{dimColor:!0,children:[`v`,h]})]}),g?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(_,{dimColor:!0,children:v}),(0,U.jsx)(_,{dimColor:!0,children:y})]}):(0,U.jsxs)(_,{dimColor:!0,children:[v,` · `,y]}),(0,U.jsx)(_,{dimColor:!0,children:d?`@${d} · ${S}`:S}),f&&(0,U.jsx)(si,{}),!f&&p&&(0,U.jsx)(Xn,{maxWidth:m,twoLine:!0})]})]})})}var fi,U,pi=t((()=>{fi=n(h(),1),Un(),ot(),y(),It(),Ot(),je(),Je(),Ln(),N(),Lt(),ni(),jr(),ui(),Kn(),U=C()}));function mi(){let e=(0,gi.useMemo)(hi,[]),t=(0,gi.useMemo)(()=>P().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,gi.useEffect)(()=>{n&&j(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,_i.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,_i.jsx)(_,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function hi(){return L(vi,yi)}var gi,_i,vi,yi,bi=t((()=>{h(),gi=n(h(),1),y(),ae(),D(),_i=C(),vi=`tengu-top-of-feed-tip`,yi={tip:``,color:`dim`}}));function xi({char:e=`✻`}){let[t]=(0,Si.useState)(()=>re().prefersReducedMotion??!1),[n,r]=(0,Si.useState)(t),i=(0,Si.useRef)(null),[a,o]=c(n?null:50);return(0,Si.useEffect)(()=>{if(n)return;let e=setTimeout(r,Ti,!0);return()=>clearTimeout(e)},[n]),n?(0,Ci.jsx)(x,{ref:a,children:(0,Ci.jsx)(_,{color:Ei,children:e})}):(i.current===null&&(i.current=o),(0,Ci.jsx)(x,{ref:a,children:(0,Ci.jsx)(_,{color:vt(Ge((o-i.current)/wi*360%360)),children:e})}))}var Si,Ci,wi,Ti,Ei,Di=t((()=>{h(),Si=n(h(),1),O(),y(),ue(),$e(),Ci=C(),wi=1500,Ti=wi*2,Ei=vt({r:153,g:153,b:153})}));function Oi(){return A()&&(P().opus1mMergeNoticeSeenCount??0)<Mi}function ki(){let[e]=(0,Ai.useState)(Oi);return(0,Ai.useEffect)(()=>{if(!e)return;let t=(P().opus1mMergeNoticeSeenCount??0)+1;j(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,ji.jsxs)(x,{paddingLeft:2,children:[(0,ji.jsx)(xi,{char:`↑`}),(0,ji.jsx)(_,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var Ai,ji,Mi,Ni=t((()=>{h(),Ai=n(h(),1),O(),y(),D(),N(),Di(),ji=C(),Mi=6}));function Pi(){return(0,Li.jsx)(Fi,{})}function Fi(){let[e]=(0,Ii.useState)(()=>wn()&&re().voiceEnabled!==!0&&(P().voiceNoticeSeenCount??0)<Ri&&!Oi());return(0,Ii.useEffect)(()=>{if(!e)return;let t=(P().voiceNoticeSeenCount??0)+1;j(e=>(e.voiceNoticeSeenCount??0)>=t?e:{...e,voiceNoticeSeenCount:t})},[e]),e?(0,Li.jsxs)(x,{paddingLeft:2,children:[(0,Li.jsx)(xi,{}),(0,Li.jsx)(_,{dimColor:!0,children:` Voice mode is now available · /voice to enable`})]}):null}var Ii,Li,Ri,zi=t((()=>{h(),Ii=n(h(),1),y(),D(),ue(),Tn(),Di(),Ni(),Li=C(),Ri=3}));function Bi(){return null}var Vi=t((()=>{}));function Hi(){return null}var Ui=t((()=>{})),Wi=r({ChannelsNotice:()=>Gi,findUnmatched:()=>qi});function Gi(){let[{channels:e,list:t,unmatched:n}]=(0,Ji.useState)(()=>{let e=E();return e.length===0?{channels:e,list:``,unmatched:[]}:{channels:e,list:e.map(Ki).join(`, `),unmatched:qi(e)}});if(e.length===0)return null;let r=e.some(e=>!e.dev),i=w()&&r?`Channels`:w()?`--dangerously-load-development-channels`:`--channels`;return(0,Yi.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,Yi.jsxs)(_,{color:`error`,children:[`Listening for channel messages from: `,t]}),(0,Yi.jsxs)(_,{dimColor:!0,children:[`Experimental · inbound messages will be pushed into this session, this carries prompt injection risks. Restart Claude Code without `,i,` to disable.`]}),n.map(e=>(0,Yi.jsxs)(_,{color:`warning`,children:[Ki(e.entry),` · `,e.why]},`${Ki(e.entry)}:${e.why}`))]})}function Ki(e){return e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function qi(e,t){let n=t?.configuredServerNames??(()=>{let e=[`enterprise`,`user`,`project`,`local`],t=new Set;for(let n of e)for(let e of Object.keys(Yt(n).servers))t.add(e);return t})(),r=t?.installedPluginIds??(()=>{let e=new Set(Object.keys(lt().plugins)),t=on();for(let n of[...t.enabled,...t.disabled])e.add(n.source);return e})(),i=[];for(let t of e){if(t.kind===`server`){n.has(t.name)||i.push({entry:t,why:`no MCP server configured with that name`});continue}r.has(`${t.name}@${t.marketplace}`)||i.push({entry:t,why:`plugin not installed`})}return i}var Ji,Yi,Xi=t((()=>{h(),Ji=n(h(),1),T(),sn(),y(),Ht(),He(),Yi=C()}));function Zi(){let e=kn(),t=P().oauthAccount?.displayName??``,{columns:n}=u(),r=hn(),i=Zt.isSandboxingEnabled(),o=ai(),s=Yn(),c=st(e=>e.agent),d=st(e=>e.effortValue),f=P(),p;try{p=Mn(3)}catch{p=[]}let[m]=(0,Qi.useState)(()=>{let e=re().companyAnnouncements;if(!(!e||e.length===0))return f.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:h}=Dn(f.lastReleaseNotesSeen);(0,Qi.useEffect)(()=>{P().lastReleaseNotesSeen!==`2.6.5`&&(j(e=>e.lastReleaseNotesSeen===`2.6.5`?e:{...e,lastReleaseNotesSeen:`2.6.5`}),r&&mn())},[f,r]);let g=!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Qi.useEffect)(()=>{o&&!r&&!g&&oi()},[o,r,g]),(0,Qi.useEffect)(()=>{s&&!r&&!o&&!g&&Jn()},[s,r,o,g]);let v=Hn(),y=oe(v),{version:S,cwd:C,billingType:w,agentName:ee}=Pn(),T=c??ee,E=Te(y+Gt(v,d),ea-20);if(!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(di,{}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),pe()&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,W.jsx)(mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,W.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,W.jsx)(_,{children:m})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,W.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(bt())]}),(0,W.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,W.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]});let D=On(n),O=Rn(P().theme),te=` ${b(`claude`,O)(`Claude Code`)} ${b(`inactive`,O)(`v${S}`)} `,ne=b(`claude`,O)(` Claude Code `);if(D===`compact`){let e=jn(t);l(e)>n-4&&(e=jn(null));let r=T?n-4-1-l(T)-3:n-4,a=An(C,Math.max(r,10));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ie,{children:(0,W.jsxs)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ne,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,W.jsx)(_,{bold:!0,children:e}),(0,W.jsx)(x,{marginY:1,children:(0,W.jsx)(Dr,{})}),(0,W.jsx)(_,{dimColor:!0,children:E}),(0,W.jsx)(_,{dimColor:!0,children:w}),(0,W.jsx)(_,{dimColor:!0,children:T?`@${T} · ${a}`:a})]})}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),i&&(0,W.jsx)(x,{marginTop:1,flexDirection:`column`,children:(0,W.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]})}let k=jn(t),ie=!process.env.IS_DEMO&&f.oauthAccount?.organizationName?`${E} · ${w} · ${f.oauthAccount.organizationName}`:`${E} · ${w}`,A=T?ea-1-l(T)-3:ea,M=An(C,Math.max(A,10)),N=T?`@${T} · ${M}`:M,{leftWidth:ae,rightWidth:I}=In(n,D,Nn(k,N,ie));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ie,{children:(0,W.jsx)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:te,position:`top`,align:`start`,offset:3},children:(0,W.jsxs)(x,{flexDirection:D===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,W.jsxs)(x,{flexDirection:`column`,width:ae,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,W.jsx)(x,{marginTop:1,children:(0,W.jsx)(_,{bold:!0,children:k})}),(0,W.jsx)(Dr,{}),(0,W.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,W.jsx)(_,{dimColor:!0,children:ie}),(0,W.jsx)(_,{dimColor:!0,children:N})]})]}),D===`horizontal`&&(0,W.jsx)(x,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),D===`horizontal`&&(0,W.jsx)(Fr,{feeds:r?[Vr(pn()),zr(e)]:o?[zr(e),Hr()]:s?[zr(e),qn()]:[zr(e),Br(p)],maxWidth:I})]})})}),(0,W.jsx)(Pi,{}),(0,W.jsx)(ki,{}),$i&&(0,W.jsx)($i.ChannelsNotice,{}),pe()&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(_,{dimColor:!0,children:[`Logging to: `,he()?`stderr`:me()]})]}),(0,W.jsx)(mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,W.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,W.jsx)(_,{children:m})]}),i&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,W.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,W.jsxs)(_,{dimColor:!0,children:[`API calls: `,F(bt())]}),(0,W.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,F(me())]}),ke()&&(0,W.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,F(Ae())]})]}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Bi,{}),process.env.USER_TYPE===`ant`&&(0,W.jsx)(Hi,{})]})}var Qi,W,$i,ea,ta=t((()=>{h(),y(),ot(),Ln(),je(),se(),jr(),Rr(),Wr(),D(),zn(),ue(),ge(),Qi=n(h(),1),gn(),pi(),Lt(),En(),Ve(),i(),Oe(),bi(),zi(),Ni(),Vi(),Ui(),W=C(),Pt(),ui(),Kn(),It(),Ot(),Un(),N(),$i=(Xi(),e(Wi)),ea=50}));function na({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,ra.jsx)(x,{minWidth:l(i)+8,children:(0,ra.jsx)(_,{dimColor:!0,children:i})})}var ra,ia=t((()=>{h(),y(),ra=C()}));function aa({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,oa.jsx)(x,{minWidth:l(n),children:(0,oa.jsx)(_,{dimColor:!0,children:n})})}var oa,sa=t((()=>{h(),y(),oa=C()}));function ca(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ha(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(ht(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ha(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ha(t.messages[0]?.message.content)?.input;if(ht(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function la({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:l,onOpenRateLimitOptions:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(Qe(e,o)||m&&!n),S=v?e.displayMessage:y?dt(e):e,C=v||y?[]:Bt(e,h),w=Mo(e,s,o,v||y?Et:Le(e,h),c,h),ee=!1;if(l)if(v)ee=e.messages.some(e=>{let t=ha(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)ee=Qe(e,o);else{let t=Rt(e);ee=!t||o.has(t)}let T=_&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),E=(0,ma.jsx)(Be,{message:e,lookups:h,addMargin:!T,containerWidth:T?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:ee,shouldShowDot:!0,isTranscriptMode:_,isStatic:w,onOpenRateLimitOptions:u,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return T?(0,ma.jsx)(Ie,{children:(0,ma.jsxs)(x,{width:p,flexDirection:`column`,children:[(0,ma.jsxs)(x,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,ma.jsx)(aa,{message:S,isTranscriptMode:_}),(0,ma.jsx)(na,{message:S,isTranscriptMode:_})]}),E]})}):(0,ma.jsx)(Ie,{children:E})}function ua(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ha(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return We(e).some(e=>t.has(e));let n=Rt(e);return!!n&&t.has(n)}function da(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ha(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return We(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ha(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Rt(e);return!n||t.has(n)}function fa(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&ft(t.message))return!1;let n=ua(e.message,e.streamingToolUseIDs),r=da(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var pa,ma,ha,ga,_a=t((()=>{pa=n(h(),1),y(),at(),it(),zt(),ma=C(),ia(),Uo(),sa(),Lt(),ha=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},ga=pa.memo(la,fa)}));function va(e){return e.type===`attachment`&&ya.has(e.attachment.type)}var ya,ba=t((()=>{ya=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.team_context.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.companion_intro.token_usage.ultrathink_effort.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function xa(e){return Oa.filter(t=>t.isActive(e))}var G,Sa,Ca,wa,Ta,Ea,Da,Oa,ka=t((()=>{y(),h(),$t(),o(),ve(),je(),le(),Qn(),gt(),Mt(),G=C(),Sa={id:`large-memory-files`,type:`warning`,isActive:e=>Qt(e.memoryFiles).length>0,render:e=>(0,G.jsx)(G.Fragment,{children:Qt(e.memoryFiles).map(e=>{let t=e.path.startsWith(ye())?tr(ye(),e.path):e.path;return(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Large `,(0,G.jsx)(_,{bold:!0,children:t}),` will impact performance (`,De(e.content.length),` chars > `,De(Nt),`)`,(0,G.jsx)(_,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Ca={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=fe();return I()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=fe();return(0,G.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},wa={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0});return!!te()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0});return(0,G.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Ta={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0}),t=fe();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=k({skipRetrievingKeyFromApiKeyHelper:!0}),t=fe();return(0,G.jsxs)(x,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,G.jsxs)(x,{flexDirection:`column`,marginLeft:3,children:[(0,G.jsxs)(_,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,G.jsxs)(_,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},Ea={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Zn(e.agentDefinitions)>$n,render:e=>{let t=Zn(e.agentDefinitions);return(0,G.jsxs)(x,{flexDirection:`row`,children:[(0,G.jsx)(_,{color:`warning`,children:s.warning}),(0,G.jsxs)(_,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,De(t),` tokens > `,De($n),`)`,(0,G.jsx)(_,{dimColor:!0,children:` · /agents to manage`})]})]})}},Da={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!Ut()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=wt();return t!==null&&!Wt(t)},render:()=>{let e=Xt(wt());return(0,G.jsxs)(x,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,G.jsx)(_,{color:`ide`,children:s.arrowUp}),(0,G.jsxs)(_,{children:[`Install the `,(0,G.jsx)(_,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,G.jsx)(_,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},Oa=[Sa,Ea,Ca,wa,Ta,Da]}));function Aa({agentDefinitions:e}={}){let t={config:P(),agentDefinitions:e,memoryFiles:(0,Ma.use)(nn())},n=xa(t);return n.length===0?null:(0,Na.jsx)(x,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Na.jsx)(ja.Fragment,{children:e.render(t)},e.id))})}var ja,Ma,Na,Pa=t((()=>{ja=n(h(),1),Ma=n(h(),1),y(),$t(),D(),ka(),Na=C()}));function Fa(e,t,n){let r=(0,K.useRef)(new Map),i=(0,K.useRef)(0),a=(0,K.useRef)(0),o=(0,K.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,K.useRef)(new Map),c=(0,K.useRef)(new Map),l=(0,K.useRef)(n),u=(0,K.useRef)(!1),d=(0,K.useRef)(null),f=(0,K.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,K.useRef)(0),h=(0,K.useRef)(null);(0,K.useSyncExternalStore)((0,K.useCallback)(t=>e.current?.subscribe(t)??Ua,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/za);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,K.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??Ia);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-Ra),w=b;else{if(y){let e=v+La;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-La;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*La,y=Math.min(b,C+Va),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+La);)S+=r.current.get(t[w])??Ba,w++}let e=v+2*La,n=Math.max(0,w-Va),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??Ba;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??Ba;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Ha&&(C=e-Ha),w>t+Ha&&(w=t+Ha),C>w&&(w=Math.min(C+Ha,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let ee=(0,K.useDeferredValue)(C),T=(0,K.useDeferredValue)(w),E=C<ee?ee:C,D=w>T?T:w;if((E>D||y)&&(E=C,D=w),_>0&&(D=w),D-E>Va){let e=(x[E]+x[D])/2;g-m.current<e?D=E+Va:E=D-Va}let O=m.current,te=x[E],ne=E===0?0:te+O,k=D===b?1/0:Math.max(te,x[D]-v)+O;(0,K.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ne,k)}),(0,K.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let re=(0,K.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),ie=(0,K.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),A=(0,K.useCallback)(e=>s.current.get(t[e])??null,[t]),j=(0,K.useCallback)(e=>r.current.get(t[e]),[t]),M=(0,K.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),N=S-x[D];return{range:[E,D],topSpacer:te,bottomSpacer:N,measureRef:re,spacerRef:h,offsets:x,getItemTop:ie,getItemElement:A,getItemHeight:j,scrollToIndex:M}}var K,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa=t((()=>{K=n(h(),1),Ia=3,La=40,Ra=30,za=La>>1,Ba=1,Va=200,Ha=25,Ua=()=>{}}));function Ga({children:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null);return(0,Xa.jsx)(Qa.Provider,{value:n,children:(0,Xa.jsx)(eo.Provider,{value:i,children:(0,Xa.jsx)(Za.Provider,{value:t,children:(0,Xa.jsx)($a.Provider,{value:r,children:e})})})})}function Ka(){return(0,q.useContext)(Za)}function qa(){return(0,q.useContext)($a)}function Ja(e){let t=(0,q.useContext)(Qa);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ya(e){let t=(0,q.useContext)(eo);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var q,Xa,Za,Qa,$a,eo,to=t((()=>{q=n(h(),1),Xa=C(),Za=(0,q.createContext)(null),Qa=(0,q.createContext)(null),$a=(0,q.createContext)(null),eo=(0,q.createContext)(null)}));function no(e){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(e);r.current=e;let i=(0,J.useRef)(null),a=(0,J.useCallback)(()=>{n(null)},[]),o=(0,J.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,J.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,J.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,J.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function ro(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!io(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function io(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function ao(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||va(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=ro(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function oo({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:d=0,onPillClick:f}){let{rows:p,columns:h}=u(),[v,y]=(0,J.useState)(null),b=(0,J.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,J.useSyncExternalStore)((0,J.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,J.useLayoutEffect)(()=>{if(!qt())return;let e=m.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{dn(nr(e))}catch{}else un(e)},()=>{e.onHyperlinkClick=void 0}},[]),qt()){let s=l?null:v,u=s!=null&&s!==`clicked`&&n==null?s:null,m=s!=null&&n==null;return(0,Y.jsxs)(Ga,{children:[(0,Y.jsx)(x,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,Y.jsxs)(x,{flexDirection:`column`,flexGrow:1,width:h,overflow:`hidden`,children:[(0,Y.jsxs)(x,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[u&&(0,Y.jsx)(co,{text:u.text,onClick:u.scrollTo}),(0,Y.jsxs)(g,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!m,stickyScroll:!0,children:[(0,Y.jsx)(po,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,Y.jsx)(so,{count:d,onClick:f}),r!=null&&(0,Y.jsx)(x,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,Y.jsxs)(x,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,Y.jsx)(lo,{}),(0,Y.jsx)(uo,{}),(0,Y.jsx)(x,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,Y.jsx)(Gn,{value:{rows:p-fo-1,columns:h-4,scrollRef:a??null},children:(0,Y.jsxs)(x,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:p-fo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,Y.jsx)(x,{flexShrink:0,children:(0,Y.jsx)(_,{color:`permission`,children:`▔`.repeat(h)})}),(0,Y.jsx)(x,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,Y.jsxs)(Y.Fragment,{children:[e,t,n,i]})}function so({count:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(x,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,Y.jsx)(x,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(_,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${M(e,`message`)}`:`Jump to bottom`,` `,s.arrowDown,` `]})})})}function co({text:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(x,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(_,{color:`subtle`,wrap:`truncate-end`,children:[s.pointer,` `,e]})})}function lo(){let e=Ka();return!e||e.suggestions.length===0?null:(0,Y.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,Y.jsx)(Bn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function uo(){let e=qa();return e?(0,Y.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var J,Y,fo,po,mo=t((()=>{o(),J=n(h(),1),Wn(),to(),ot(),y(),fn(),Je(),ce(),ba(),Vn(),Y=C(),fo=2,po=(0,J.createContext)({setStickyPrompt:()=>{}})}));function ho(e){let t=So.get(e);if(t!==void 0)return t;let n=yr(e);return So.set(e,n),n}function go(e){let t=wo.get(e);if(t!==void 0)return t;let n=_o(e);return wo.set(e,n),n}function _o(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
|
|
11
11
|
`)}if(t===null)return null;let n=Kt(t);return n.startsWith(`<`)||n===``?null:n}function vo({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,Z.jsx)(x,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>l(e):void 0,children:(0,Z.jsx)(S.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function yo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=ho,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,X.useRef)([]),v=(0,X.useRef)(e),y=(0,X.useRef)(r);if(y.current!==r||e.length<_.current.length||e[0]!==v.current[0])_.current=e.map(e=>r(e));else for(let t=_.current.length;t<e.length;t++)_.current.push(r(e[t]));v.current=e,y.current=r;let b=_.current,{range:S,topSpacer:C,bottomSpacer:w,measureRef:ee,spacerRef:T,offsets:E,getItemTop:D,getItemElement:O,getItemHeight:te,scrollToIndex:ne}=Fa(t,b,n),[k,re]=S,ie=(0,X.useCallback)(t=>te(t)===0?!1:nt(e[t]),[te,e]);(0,X.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:tt(e)?.name}),r=u??-1,i=(t,r,i=ie)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>ie(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),f?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,u,f,ie]);let A=(0,X.useRef)({offsets:E,start:k,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ne});A.current={offsets:E,start:k,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ne},(0,X.useEffect)(()=>{if(u===void 0)return;let e=A.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let j=(0,X.useRef)(null),M=(0,X.useRef)({msgIdx:-1,positions:[]}),N=(0,X.useRef)(-1),ae=(0,X.useRef)(0),P=(0,X.useRef)(0),oe=(0,X.useRef)(()=>{}),F=(0,X.useRef)(()=>{}),I=(0,X.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),se=(0,X.useRef)(-1),L=(0,X.useRef)(!1);function ce(e){let t=A.current.getItemTop(e);return Math.max(0,t-xo)}function le(e){let n=t.current,{msgIdx:r,positions:i}=M.current;if(!n||i.length===0||r<0){g?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=A.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-xo)),l=s-n.getScrollTop(),d=c+l+o.row),g?.({positions:i,rowOffset:c+l,currentIdx:a});let f=I.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),R(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}F.current=le;let[ue,de]=(0,X.useState)(0),fe=(0,X.useCallback)(()=>de(e=>e+1),[]);(0,X.useEffect)(()=>{let e=j.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=A.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){j.current=null,R(`seek(i=${n}): no mount after scrollToIndex, skip`),oe.current(r?-1:1);return}j.current={idx:n,wantLast:r,tries:i+1},c(n),fe();return}j.current=null,a.scrollTo(Math.max(0,s(n)-xo));let d=h?.(l)??[];if(M.current={msgIdx:n,positions:d},R(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++ae.current>20){ae.current=0;return}oe.current(r?-1:1);return}ae.current=0;let f=r?d.length-1:0;I.current.screenOrd=f,N.current=-1,F.current(f);let p=P.current;p&&(P.current=0,oe.current(p))},[ue]);function pe(e,n){let r=t.current;if(!r)return;let i=A.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;g?.(null),M.current={msgIdx:-1,positions:[]},j.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(ce(e)):o(e),fe()}function me(e){let t=I.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(j.current){P.current=e;return}N.current<0&&(N.current=t.ptr);let{positions:a}=M.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,le(o),N.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===N.current){g?.(null),N.current=-1,R(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,pe(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}oe.current=me,(0,X.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(ce(e))},setSearchQuery:e=>{j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1,g?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=A.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=A.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=se.current>=0?se.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+l[r[e]]-t);i<=n&&(n=i,o=e)}R(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}I.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?pe(r[o],!0):se.current>=0&&s&&s.scrollTo(se.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>me(1),prevMatch:()=>me(-1),setAnchor:()=>{let e=t.current;e&&(se.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1},warmSearchIndex:async()=>{if(L.current)return 0;let e=A.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Me(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)c(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return R(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),L.current=!0,Math.round(t)}}),[t]);let[he,ge]=(0,X.useState)(null),_e=(0,X.useRef)({onItemClick:a,setHoveredKey:ge});_e.current={onItemClick:a,setHoveredKey:ge};let z=(0,X.useCallback)((e,t)=>{let n=_e.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),ve=(0,X.useCallback)(e=>{_e.current.setHoveredKey(e)},[]),ye=(0,X.useCallback)(e=>{_e.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(x,{ref:T,height:C,flexShrink:0}),e.slice(k,re).map((e,t)=>{let n=k+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&he===r,u=s?.(e);return(0,Z.jsx)(vo,{itemKey:r,msg:e,idx:n,measureRef:ee,expanded:u,hovered:l,clickable:c,onClickK:z,onEnterK:ve,onLeaveK:ye,renderItem:i},r)}),w>0&&(0,Z.jsx)(x,{height:w,flexShrink:0}),l&&(0,Z.jsx)(bo,{messages:e,start:k,end:re,offsets:E,getItemTop:D,getItemElement:O,scrollRef:t})]})}function bo({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,X.useContext)(po);(0,X.useSyncExternalStore)((0,X.useCallback)(e=>o.current?.subscribe(e)??To,[o]),()=>{let e=o.current;if(!e)return NaN;let t=e.getScrollTop()+e.getPendingDelta();return e.isSticky()?-1-t:t});let c=o.current?.isSticky()??!0,l=Math.max(0,(o.current?.getScrollTop()??0)+(o.current?.getPendingDelta()??0)),u=t,d=-1;for(let e=n-1;e>=t;e--){let t=i(e);if(t>=0){if(t<l)break;d=t}u=e}let f=-1,p=null;if(u>0&&!c)for(let t=u-1;t>=0;t--){let n=go(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,X.useRef)({idx:-1,tries:0}),_=(0,X.useRef)(`none`),v=(0,X.useRef)(-1);return(0,X.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Co).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,X.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var X,Z,xo,So,Co,wo,To,Eo=t((()=>{h(),X=n(h(),1),Wa(),y(),rt(),mo(),Z=C(),ge(),Ne(),Er(),qe(),xo=3,So=new WeakMap,Co=500,wo=new WeakMap,To=()=>{}}));function Do(e,t){let n=new Set(t),r=new Set;return e.filter(e=>{if(e.type===`system`)return e.subtype!==`api_metrics`;let t=e.message?.content[0];if(e.type===`assistant`)return e.isApiErrorMessage?!0:t?.type===`tool_use`&&t.name&&n.has(t.name)?(`id`in t&&r.add(t.id),!0):!1;if(e.type===`user`)return t?.type===`tool_result`?t.tool_use_id!==void 0&&r.has(t.tool_use_id):!e.isMeta;if(e.type===`attachment`){let t=e.attachment;return t?.type===`queued_command`&&t.commandMode===`prompt`&&!t.isMeta&&t.origin===void 0}return!1})}function Oo(e,t){let n=new Set(t),r=new Set,i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t],s=o.message?.content[0];if(o.type===`user`&&s?.type!==`tool_result`&&!o.isMeta){a++;continue}o.type===`assistant`&&(s?.type===`text`?i[t]=a:s?.type===`tool_use`&&s.name&&n.has(s.name)&&r.add(a))}return r.size===0?e:e.filter((e,t)=>{let n=i[t];return n===void 0||!r.has(n)})}function ko(e,t,n=zo,r=Bo){let i=t.current,a=i?e.findIndex(e=>e.uuid===i.uuid):-1,o=a>=0?a:i?Math.min(i.idx,Math.max(0,e.length-n)):0;e.length-o>n+r&&(o=e.length-n);let s=e[o];return s&&(i?.uuid!==s.uuid||i.idx!==o)?t.current={uuid:s.uuid,idx:o}:!s&&i&&(t.current=null),o}function Ao(e){return(e.type===`assistant`||e.type===`user`?Rt(e):null)??e.uuid}function jo(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mo(e,t,n,r,i,a){if(i===`transcript`)return!0;switch(e.type){case`attachment`:case`user`:case`assistant`:{if(e.type===`assistant`){let t=e.message.content[0];if(t?.type===`server_tool_use`)return a.resolvedToolUseIDs.has(t.id)}let i=Rt(e);return i?t.has(i)||n.has(i)||Ze(i,`PostToolUse`,a)?!1:rr(r,a.resolvedToolUseIDs):!0}case`system`:return e.subtype!==`api_error`;case`grouped_tool_use`:return e.messages.every(e=>{let t=e.message.content[0];return t?.type===`tool_use`&&a.resolvedToolUseIDs.has(t.id)});case`collapsed_read_search`:return!1;default:return!0}}var No,Q,$,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo=t((()=>{p(),Sn(),No=n(h(),1),Q=n(h(),1),ir(),T(),O(),ot(),y(),Tt(),rn(),_t(),sr(),ur(),at(),pr(),D(),i(),Je(),vr(),it(),ce(),Er(),ta(),Ye(),_a(),qe(),Ue(),ba(),Lt(),Pa(),$=C(),Eo(),Po=No.memo(function({agentDefinitions:e}){return(0,$.jsx)(Ie,{children:(0,$.jsxs)(x,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Zi,{}),(0,$.jsx)(No.Suspense,{fallback:null,children:(0,$.jsx)(Aa,{agentDefinitions:e})})]})})}),Fo=(ln(),e(cn)),Io=(ie(),e(de)).BRIEF_TOOL_NAME,Lo=(jt(),e(tn)).SEND_USER_FILE_TOOL_NAME,Ro=30,zo=200,Bo=50,Vo=({messages:e,tools:t,commands:n,verbose:r,toolJSX:i,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:l,screen:p,streamingToolUses:m,showAllInTranscript:h=!1,agentDefinitions:g,onOpenRateLimitOptions:y,hideLogo:b=!1,isLoading:S,hidePastThinking:C=!1,streamingThinking:w,streamingText:T,isBriefOnly:E=!1,unseenDivider:D,scrollRef:O,trackStickyPrompt:te,jumpRef:k,onSearchMatchesChange:re,scanElement:ie,setPositions:A,disableRenderCap:j=!1,cursor:N=null,setCursor:ae,cursorNavRef:oe,renderRange:F})=>{let{columns:I}=u(),se=At(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),L=(0,Q.useMemo)(()=>Ke(e).filter(Re),[e]),ce=(0,Q.useMemo)(()=>w?w.isStreaming?!0:w.streamingEndedAt?Date.now()-w.streamingEndedAt<3e4:!1:!1,[w]),{lastThinkingBlockId:le,latestBashOutputUUID:ue}=(0,Q.useMemo)(()=>{let e=null,t=null,n=C&&!ce;C&&ce&&(e=`streaming`);for(let r=L.length-1;r>=0;r--){let i=L[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return C||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[L,C,ce]),de=(0,Q.useMemo)(()=>ct(L),[L]),fe=(0,Q.useMemo)(()=>m.filter(e=>!s.has(e.contentBlock.id)&&!de.has(e.contentBlock.id)),[m,s,de]),pe=(0,Q.useMemo)(()=>fe.flatMap(e=>{let t=Vt({content:[e.contentBlock]});return t.uuid=en(e.contentBlock.id,0),Ke([t])}),[fe]),R=p===`transcript`,me=(0,Q.useMemo)(()=>a(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),he=O!=null&&!me,ge=R&&!h&&!he,_e=(0,Q.useRef)(null),z=(0,Q.useRef)(null),{collapsed:ve,lookups:ye,hasTruncatedMessages:be,hiddenMessageCount:xe}=(0,Q.useMemo)(()=>{let e=et((r||qt()?L:pt(L,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!va(e)&&Dt(e,R)),pe),n=[Io,Lo].filter(e=>e!==null),i=[Io].filter(e=>e!==null),a=n.length>0&&!R?E?Do(e,n):i.length>0?Oo(e,i):e:e,o=ge?a.slice(-Ro):a,s=ge&&a.length>Ro,{messages:c}=gr(o,t,r),l=or(lr(fr(ut(c,t))),r),u=Ft(L,o),d=(()=>{let e=o.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),f;if(z.current&&z.current.key===u)f=z.current.lookups;else if(z.current&&L.length>=z.current.normalizedCount&&o.length>=z.current.messageCount&&z.current.lastAssistantMsgId===d){let e=Fe(z.current.lookups,z.current.normalizedCount,z.current.messageCount,L,o);e?(f=e,z.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d}):(f=Jt(L,o),z.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d})}else f=Jt(L,o),z.current={key:u,lookups:f,normalizedCount:L.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-Ro;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[r,L,R,pe,ge,t,E]),B=(0,Q.useMemo)(()=>{let e=!he&&!j?ko(ve,_e):0;return F?ve.slice(F[0],F[1]):e>0?ve.slice(e):ve},[ve,F,he,j]),Se=(0,Q.useMemo)(()=>new Set(m.map(e=>e.contentBlock.id)),[m]),{dividerBeforeIndex:Ce,selectedIdx:we}=(0,Q.useMemo)(()=>{if(!D&&!N)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=D?.firstUnseenUuid.slice(0,24);for(let r=0;r<B.length;r++){let i=B[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&N&&i.uuid===N.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[D,N,B]),[Te,Ee]=(0,Q.useState)(()=>new Set),De=(0,Q.useCallback)(e=>{let t=Ao(e);Ee(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),Oe=(0,Q.useCallback)(e=>Te.size>0&&Te.has(Ao(e)),[Te]),ke=(0,Q.useRef)(ye);ke.current=ye;let Ae=(0,Q.useCallback)(e=>{if(e.type===`collapsed_read_search`)return!0;if(e.type===`assistant`){let t=e.message.content,n=Array.isArray(t)?t[0]:void 0;return n!=null&&Pe(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=ke.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?an(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),je=(!i||!!i.shouldContinueAnimation)&&!o.length&&!c,Me=s.size>0,{progress:Ne}=d(),Ie=(0,Q.useRef)(null),Le=P().terminalProgressBarEnabled&&!ee()&&!(Fo?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=Le?Me?`indeterminate`:`completed`:null;Ie.current!==e&&(Ie.current=e,Ne(e))},[Ne,Le,Me]),(0,Q.useEffect)(()=>()=>Ne(null),[Ne]);let ze=(0,Q.useCallback)(e=>`${e.uuid}-${l}`,[l]),Be=(e,i)=>{let a=i>0?B[i-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!T||ca(B,i,t,Se)),l=B.length-1-i>0,u=ze(e),d=(0,$.jsx)(ga,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:n,verbose:r||Oe(e)||N?.expanded===!0&&i===we,inProgressToolUseIDs:s,streamingToolUseIDs:Se,screen:p,canAnimate:je,onOpenRateLimitOptions:y,lastThinkingBlockId:le,latestBashOutputUUID:ue,columns:I,isLoading:S,lookups:ye,shouldCollapseDiffs:l},u),f=(0,$.jsx)(St.Provider,{value:i===we,children:d},u);return D&&i===Ce?[(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(v,{title:`${D.count} new ${M(D.count,`message`)}`,width:I,color:`inactive`})},`unseen-divider`),f]:f},Ve=(0,Q.useRef)(new WeakMap),He=(0,Q.useCallback)(e=>{let n=Ve.current.get(e);if(n!==void 0)return n;let r=yr(e);if(e.type===`user`&&e.toolUseResult&&Array.isArray(e.message.content)){let n=e.message.content.find(e=>e.type===`tool_result`);if(n&&`tool_use_id`in n){let i=ye.toolUseByToolUseID.get(n.tool_use_id),a=(i&&an(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Ve.current.set(e,i),i},[t,ye]);return(0,$.jsxs)(Cn,{name:`MessagesBoundary`,children:[!b&&!(F&&F[0]>0)&&(0,$.jsx)(Po,{agentDefinitions:g}),be&&(0,$.jsx)(v,{title:`${se} to show ${f.bold(xe)} previous messages`,width:I}),R&&h&&xe>0&&!j&&(0,$.jsx)(v,{title:`${se} to hide ${f.bold(xe)} previous messages`,width:I}),he?(0,$.jsx)(Xe.Provider,{value:!0,children:(0,$.jsx)(yo,{messages:B,scrollRef:O,columns:I,itemKey:ze,renderItem:Be,onItemClick:De,isItemClickable:Ae,isItemExpanded:Oe,trackStickyPrompt:te,selectedIndex:we>=0?we:void 0,cursorNavRef:oe,setCursor:ae,jumpRef:k,onSearchMatchesChange:re,scanElement:ie,setPositions:A,extractSearchText:He})}):B.flatMap(Be),T&&!E&&(0,$.jsx)(x,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(x,{flexDirection:`row`,children:[(0,$.jsx)(x,{minWidth:2,children:(0,$.jsx)(_,{color:`text`,children:ne})}),(0,$.jsx)(x,{flexDirection:`column`,children:(0,$.jsx)(xt,{children:T})})]})}),ce&&w&&!E&&(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(mt,{param:{type:`thinking`,thinking:w.thinking},addMargin:!1,isTranscriptMode:!0,verbose:r,hideInTranscript:!1})})]})},Ho=No.memo(Vo,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r===`onOpenRateLimitOptions`||r===`scrollRef`||r===`trackStickyPrompt`||r===`setCursor`||r===`cursorNavRef`||r===`jumpRef`||r===`onSearchMatchesChange`||r===`scanElement`||r===`setPositions`)&&e[r]!==t[r]){if(r===`streamingToolUses`){let n=e.streamingToolUses,r=t.streamingToolUses;if(n.length===r.length&&n.every((e,t)=>e.contentBlock===r[t]?.contentBlock))continue}if(r===`inProgressToolUseIDs`&&jo(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r===`unseenDivider`){let n=e.unseenDivider,r=t.unseenDivider;if(n?.firstUnseenUuid===r?.firstUnseenUuid&&n?.count===r?.count)continue}if(r===`tools`){let n=e.tools,r=t.tools;if(n.length===r.length&&n.every((e,t)=>e.name===r[t]?.name))continue}return!1}return!0})}));export{mo as a,Ja as c,ao as i,Ya as l,Uo as n,no as o,oo as r,to as s,Ho as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DR8-3Aex.js";import{f as t,s as n}from"./envUtils-BWeoiL4Y.js";import{J as r,Q as i,Rn as a,T as o,b as s,nt as c,t as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Xi as p,Zi as m,cn as h,on as g,xc as _}from"./paths-
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{f as t,s as n}from"./envUtils-BWeoiL4Y.js";import{J as r,Q as i,Rn as a,T as o,b as s,nt as c,t as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Xi as p,Zi as m,cn as h,on as g,xc as _}from"./paths-BBvuDQl9.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{a as b,n as x}from"./env-chR0gV31.js";import{Dx as S,Ox as C,dy as w,fy as T,gy as E}from"./loadAgentsDir-DI1a76pd.js";import{t as D}from"./useKeybinding-FsOnjW6T.js";import{c as O,i as k,s as A}from"./terminalSetup-Lyg4NbGA.js";import{l as j,u as M}from"./referral-DeDr9zAE.js";import{t as N}from"./WelcomeV2-DCXcYd2x.js";import{n as P,t as F}from"./ThemePicker-BRh027fA.js";import{n as I,t as L}from"./PressEnterToContinue-BdA9zDGs.js";import{t as R}from"./ApproveApiKey-BLp4742y.js";n();var z=e(a(),1),B=d();v(),b(),f(),p(),g(),D(),k(),j(),l(),l(),E(),C(),T(),P(),I(),l();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(u,{gap:1,children:[(0,B.jsx)(s,{dimColor:!0,children:t}),(0,B.jsx)(u,{flexDirection:`column`,children:e})]})}l();var U=(0,z.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,z.useContext)(U),n=0;for(let t of z.Children.toArray(e))!(0,z.isValidElement)(t)||t.type!==H||n++;let r=String(n).length;return(0,B.jsx)(u,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${t}${`${String(n+1).padStart(r)}.`}`;return(0,B.jsx)(U.Provider,{value:{marker:i},children:(0,B.jsx)(V.Provider,{value:{marker:i},children:e})})})})}W.Item=H;var G=W;l();function K({onDone:e}){let[n,a]=(0,z.useState)(0),[l,d]=(0,z.useState)(!1),[f]=(0,z.useState)(()=>h()),[p,g]=o();(0,z.useEffect)(()=>{y(`tengu_began_setup`,{oauthEnabled:f})},[f]);function v(){if(n<j.length-1){let e=n+1;a(e),y(`tengu_onboarding_step`,{oauthEnabled:f,stepId:j[e]?.id})}else e()}function b(e){g(e),v()}let C=M(),T=(0,B.jsx)(u,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:b,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),E=(0,B.jsxs)(u,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(u,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Always review changes before accepting`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(r,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(r,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(r,{}),(0,B.jsx)(i,{url:`https://code.claude.com/docs/en/security`})]})]})]})}),(0,B.jsx)(L,{})]}),D=(0,z.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=m(process.env.ANTHROPIC_API_KEY);if(_(e)===`new`)return e},[]);function k(e){e&&d(!0),v()}let j=[];j.push({id:`theme`,component:T}),D&&j.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),f&&j.push({id:`oauth`,component:(0,B.jsx)(q,{skip:l,onSkip:v,children:(0,B.jsx)(w,{onDone:v})})}),j.push({id:`security`,component:E}),O()&&j.push({id:`terminal-setup`,component:(0,B.jsxs)(u,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(u,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(s,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(r,{}),`for your terminal:`,` `,x.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(S,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(p).catch(()=>{}).finally(v):v()},onCancel:()=>v()}),(0,B.jsx)(s,{dimColor:!0,children:C.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,C.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=j[n],I=(0,z.useCallback)(()=>{n===j.length-1?e():v()},[n,j.length,f,e]),V=(0,z.useCallback)(()=>{v()},[n,j.length,f,e]);return c({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),c({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(u,{flexDirection:`column`,children:[(0,B.jsx)(N,{}),(0,B.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[P?.component,C.pending&&(0,B.jsx)(u,{padding:1,children:(0,B.jsxs)(s,{dimColor:!0,children:[`Press `,C.keyName,` again to exit`]})})]})]})}function q({skip:e,onSkip:t,children:n}){return(0,z.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{K as Onboarding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{Ac as o,Pc as s,Sc as c}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{Ac as o,Pc as s,Sc as c}from"./paths-BBvuDQl9.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{C as d,x as f}from"./startupProfiler-DnXZaX4A.js";import{a as p,n as m,r as h,t as g}from"./overageCreditGrant-DLKadMYU.js";function _(){let e=m();return!e||!e.available||e.granted?!1:g(e)!==null}function v(){if(!_())return!1;let e=c();return!(e.hasVisitedExtraUsage||(e.overageCreditUpsellSeenCount??0)>=O)}function y(){m()===null&&p()}function b(){let[e]=(0,E.useState)(()=>(y(),v()));return e}function x(){let e=0;s(t=>(e=(t.overageCreditUpsellSeenCount??0)+1,{...t,overageCreditUpsellSeenCount:e})),u(`tengu_overage_credit_upsell_shown`,{seen_count:e})}function S(e){return`${e} in extra usage for third-party apps · /extra-usage`}function C(e){return`${e} in extra usage`}function w({maxWidth:e,twoLine:t}){let n=m();if(!n)return null;let i=g(n);if(!i)return null;if(t){let t=C(i);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(r,{color:`claude`,children:e?d(t,e):t}),(0,D.jsx)(r,{dimColor:!0,children:e?d(k,e):k})]})}let a=S(i),o=e?d(a,e):a,s=Math.min(C(i).length,o.length);return(0,D.jsxs)(r,{dimColor:!0,children:[(0,D.jsx)(r,{color:`claude`,children:o.slice(0,s)}),o.slice(s)]})}function T(){let e=m(),t=e?g(e):null,n=t?C(t):`extra usage credit`;return{title:n,lines:[],customContent:{content:(0,D.jsx)(r,{dimColor:!0,children:k}),width:Math.max(n.length,47)}}}var E,D,O,k,A=e((()=>{n(),E=t(n(),1),i(),l(),h(),o(),f(),D=a(),O=3,k=`On us. Works on third-party apps · /extra-usage`}));export{_ as a,A as i,T as n,v as o,x as r,b as s,w as t};
|