@readmagic/workmate 0.0.9 → 0.0.11
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-qFZy3FOD.js → AddWorkspaceDirectory-ag2JTpmU.js} +1 -1
- package/dist/chunks/{App-DW4elk6E.js → App-BuKmqFPm.js} +1 -1
- package/dist/chunks/ApproveApiKey-CIWOi_7v.js +1 -0
- package/dist/chunks/ApproveApiKey-M6U-NafA.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-BuRFF1fQ.js → BypassPermissionsModeDialog-B05t83wa.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CDrArsSX.js → ClaudeMdExternalIncludesDialog-CSywJdVL.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +1 -0
- package/dist/chunks/{DiffDialog-BIcwpgSr.js → DiffDialog-DUbFrzKu.js} +3 -3
- package/dist/chunks/Doctor-BcnUfJ4I.js +1 -0
- package/dist/chunks/Doctor-Dz4TuYas.js +3 -0
- package/dist/chunks/ExitFlow-BwyAtIHx.js +2 -0
- package/dist/chunks/{Grove-BmirUB6V.js → Grove-BDoVj02t.js} +2 -2
- package/dist/chunks/{HybridTransport-BVmSUHf0.js → HybridTransport-C_U0IJfz.js} +4 -4
- package/dist/chunks/{InvalidConfigDialog-WRywkKeS.js → InvalidConfigDialog-bih293Xt.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-C4n3A72C.js → InvalidSettingsDialog-Br8kQOHz.js} +1 -1
- package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +1 -0
- package/dist/chunks/MCPToolListView-DJ06N1DG.js +1 -0
- package/dist/chunks/{McpParsingWarnings-CH4yyMAL.js → McpParsingWarnings-COa71S9q.js} +1 -1
- package/dist/chunks/MessageSelector-o4ULADFg.js +3 -0
- package/dist/chunks/Messages-qqwHuAW5.js +11 -0
- package/dist/chunks/{Onboarding-BboWs1pp.js → Onboarding-BzuQjney.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-BpC9COmh.js → PromptInputFooterSuggestions-to5eYBvI.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-CfMFx-TF.js +1 -0
- package/dist/chunks/QueryEngine-Dt0BKUeF.js +1 -0
- package/dist/chunks/REPL-CUbEDqEl.js +133 -0
- package/dist/chunks/REPL-DMaKNhTa.js +1 -0
- package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +2 -0
- package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +1 -0
- package/dist/chunks/{SSETransport-1KBBUikF.js → SSETransport-DN4tCDEh.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +1 -0
- package/dist/chunks/Settings-DfdcmvOV.js +2 -0
- package/dist/chunks/{TeleportProgress-BmgPAZAi.js → TeleportProgress-C2LQVLav.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-sgxNOeM_.js → TeleportRepoMismatchDialog-BZL8Zblz.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-GptvrUdv.js → TeleportResumeWrapper-wPiIs8xg.js} +1 -1
- package/dist/chunks/{ThemePicker-gAMqqD1P.js → ThemePicker-BT_NaRQC.js} +1 -1
- package/dist/chunks/{TrustDialog-CWt-4Evl.js → TrustDialog-ACaJ_m7A.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-De3kzHtz.js → ValidationErrorsList-C-hWdy_8.js} +1 -1
- package/dist/chunks/WelcomeV2-ZQRKlcT4.js +1 -0
- package/dist/chunks/add-dir-SAKTkw0S.js +1 -0
- package/dist/chunks/{agentDisplay-5gnCQwUY.js → agentDisplay-CuSHqgZc.js} +1 -1
- package/dist/chunks/{agents-Bz1MLp4A.js → agents-CMC0iQP4.js} +1 -1
- package/dist/chunks/agents-ZgRKpjHv.js +103 -0
- package/dist/chunks/allErrors-_cOQksHC.js +1 -0
- package/dist/chunks/{api-DzccRM_z.js → api-BbJfMXRS.js} +1 -1
- package/dist/chunks/api-DS1MiW01.js +1 -0
- package/dist/chunks/{auth-Cjnyy10u.js → auth-7mJGtlZp.js} +2 -2
- package/dist/chunks/auth-DGZzCbU0.js +1 -0
- package/dist/chunks/auth-DN1MUpB8.js +1 -0
- package/dist/chunks/{autoMode-CQ5nqP9c.js → autoMode-CBtY7ACs.js} +6 -6
- package/dist/chunks/autonomy-DuQmYhq6.js +15 -0
- package/dist/chunks/{autonomy-CPUCe-YU.js → autonomy-lJV7yWUl.js} +1 -1
- package/dist/chunks/autonomyPanel-DAQm6lDz.js +1 -0
- package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +1 -0
- package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +17 -0
- package/dist/chunks/{banner-BJZNMppT.js → banner-1Wyeyawe.js} +1 -1
- package/dist/chunks/{bg-w3Vlsm3Y.js → bg-CJ0YWFli.js} +2 -2
- package/dist/chunks/bg-CeUrRz_7.js +1 -0
- package/dist/chunks/branch-k3kirqbA.js +3 -0
- package/dist/chunks/{break-cache-DXV0brco.js → break-cache-CAoZ9b72.js} +2 -2
- package/dist/chunks/bridgeConfig-CzRUPn-D.js +1 -0
- package/dist/chunks/{bridgeConfig-vORehbGG.js → bridgeConfig-UgaUfuP6.js} +1 -1
- package/dist/chunks/bridgeMessaging-Ci5H68MX.js +1 -0
- package/dist/chunks/{bridgePointer-D4W9GpWw.js → bridgePointer-BL8-lGvN.js} +1 -1
- package/dist/chunks/bridgeStatusUtil-C36w15ge.js +1 -0
- package/dist/chunks/{btw-DDUC_t0w.js → btw-nVoVuIae.js} +1 -1
- package/dist/chunks/caches-B8sM3Zys.js +1 -0
- package/dist/chunks/caches-Bp9MZ7IE.js +1 -0
- package/dist/chunks/{capacityWake-L7b1mMft.js → capacityWake-BOySRJUJ.js} +1 -1
- package/dist/chunks/ccrClient-Br4LAofR.js +1 -0
- package/dist/chunks/{claudeDesktop-CAmnheYx.js → claudeDesktop-Bgds1-YT.js} +1 -1
- package/dist/chunks/{clear-DdWexxbM.js → clear-C4Vtnbye.js} +1 -1
- package/dist/chunks/{cliLaunch-BWWOgBFh.js → cliLaunch-BTpfAGGI.js} +1 -1
- package/dist/chunks/{client-CoXtVRzi.js → client-B9404qIP.js} +1 -1
- package/dist/chunks/client-BCAbKdNz.js +1 -0
- package/dist/chunks/client-CJE6gEvU.js +1 -0
- package/dist/chunks/commands-DL-BzoMQ.js +1 -0
- package/dist/chunks/compact-Cx7BPXLU.js +2 -0
- package/dist/chunks/config-S5OW4Xqr.js +1 -0
- package/dist/chunks/config-aRiTrtCv.js +3 -0
- package/dist/chunks/{config-CVvUNkj2.js → config-kB2eazPX.js} +1 -1
- package/dist/chunks/{context-BWcfhhDj.js → context-BN7DEjoH.js} +1 -1
- package/dist/chunks/{context-noninteractive-c7jGVWHQ.js → context-noninteractive-D91W2B8e.js} +5 -5
- package/dist/chunks/context-noninteractive-DPacEFJ1.js +1 -0
- package/dist/chunks/conversation-D5Nbu9eT.js +1 -0
- package/dist/chunks/conversation-hcUx9e-C.js +1 -0
- package/dist/chunks/{createSSHSession-DP7B8yvb.js → createSSHSession-DecOR6M5.js} +6 -6
- package/dist/chunks/createSession-D27zvmOs.js +1 -0
- package/dist/chunks/createSession-DRqkLZWt.js +1 -0
- package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +40 -0
- package/dist/chunks/cwd-Cfdf7z7s.js +1 -0
- package/dist/chunks/cwd-ClLru_7T.js +1 -0
- package/dist/chunks/datadog-bm551AVV.js +1 -0
- package/dist/chunks/debug-BecbSVoN.js +39 -0
- package/dist/chunks/{debugUtils-CezNYZ-4.js → debugUtils-CmJfIUxW.js} +1 -1
- package/dist/chunks/{detached-CkPpYMJj.js → detached-CIyF0M5O.js} +1 -1
- package/dist/chunks/detectRepository-C15umvKN.js +1 -0
- package/dist/chunks/detectRepository-DDfLfKcM.js +1 -0
- package/dist/chunks/{diff-DHzz9WAp.js → diff-DeK4bwjw.js} +1 -1
- package/dist/chunks/{directoryCompletion-D5AvL7TF.js → directoryCompletion-BJCu19HJ.js} +1 -1
- package/dist/chunks/doctor-BJORBomU.js +1 -0
- package/dist/chunks/earlyInput-BEjRkAtH.js +1 -0
- package/dist/chunks/{earlyInput-BTC_Wucv.js → earlyInput-IghoCjG5.js} +1 -1
- package/dist/chunks/entry-mdegyj8z.js +14 -0
- package/dist/chunks/esm-Ka3lhafK.js +1 -0
- package/dist/chunks/{execFileNoThrow-5SylUnAI.js → execFileNoThrow-DHyW8FMX.js} +2 -2
- package/dist/chunks/execSyncWrapper-CDzB0BM1.js +1 -0
- package/dist/chunks/exit-CF3KBl-S.js +1 -0
- package/dist/chunks/{extraUsage-Dt5mw35U.js → extraUsage-BrKbpBK-.js} +1 -1
- package/dist/chunks/extractMemories-4lBn134y.js +1 -0
- package/dist/chunks/fast-0Vi354KI.js +1 -0
- package/dist/chunks/{fast-ClYQcEv5.js → fast-DWn40OcQ.js} +1 -1
- package/dist/chunks/featureCheck-D6FjD-nt.js +1 -0
- package/dist/chunks/featureCheck-JOur3pHb.js +1 -0
- package/dist/chunks/{fileSuggestions-fNxREjpe.js → fileSuggestions-C7Pwq2yj.js} +3 -3
- package/dist/chunks/firstPartyEventLogger-BHjBQH0J.js +5 -0
- package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +1 -0
- package/dist/chunks/flushGate-DdJjxCes.js +1 -0
- package/dist/chunks/{gemini-fZ0VPU2A.js → gemini-DHv2iVfy.js} +1 -1
- package/dist/chunks/generateSessionName-DhS_6oHd.js +1 -0
- package/dist/chunks/{genericProcessUtils-BmDSLcMf.js → genericProcessUtils-B2HcDYhg.js} +1 -1
- package/dist/chunks/git-DBlOv64X.js +6 -0
- package/dist/chunks/git-DF4RFFaT.js +1 -0
- package/dist/chunks/githubRepoPathMapping-CK56bUDe.js +1 -0
- package/dist/chunks/{goal-IasZVqKh.js → goal-BZG4gtnb.js} +3 -3
- package/dist/chunks/{grok-Dk3LyzMa.js → grok-BS57ZhyW.js} +1 -1
- package/dist/chunks/{grove-BE4fQ6tG.js → grove-_zlQ83yR.js} +2 -2
- package/dist/chunks/help-C_2tdXHC.js +1 -0
- package/dist/chunks/{hooks-BrKy5XWQ.js → hooks-C7Bn7MBe.js} +2 -2
- package/dist/chunks/hooks-DT80Arzc.js +1 -0
- package/dist/chunks/initReplBridge-NkZRcM77.js +1 -0
- package/dist/chunks/{install-CVGZ55wV.js → install-Du-DSVzj.js} +1 -1
- package/dist/chunks/{instrumentation-BmWotlxR.js → instrumentation-DMs3b82f.js} +5 -5
- package/dist/chunks/intl-D2kgJmX7.js +1 -0
- package/dist/chunks/{job-DEXxW_Zo.js → job-rbX1VZmp.js} +1 -1
- package/dist/chunks/jwtUtils-OzxN2zts.js +1 -0
- package/dist/chunks/keybindings-CwdC_8S0.js +2 -0
- package/dist/chunks/{launchLocalMemory-CLSSVFoj.js → launchLocalMemory-BLRCK1_o.js} +2 -2
- package/dist/chunks/{launchOnboarding-BkJfKviO.js → launchOnboarding-Al_X75Vz.js} +1 -1
- package/dist/chunks/{loadAgentsDir-CKSb56Gp.js → loadAgentsDir-BL93ulMm.js} +2197 -2332
- package/dist/chunks/loadAgentsDir-eVKq8efm.js +1 -0
- package/dist/chunks/loadPluginHooks-B0au35a4.js +1 -0
- package/dist/chunks/{localSearch-CPOnyi8I.js → localSearch-C5ipegd9.js} +1 -1
- package/dist/chunks/localSearch-CZlFfR_X.js +1 -0
- package/dist/chunks/log-Dauqle-Z.js +1 -0
- package/dist/chunks/{logoV2Utils-we1sfJvf.js → logoV2Utils-CkvOihX7.js} +1 -1
- package/dist/chunks/{magicDocs-DmKlTQvK.js → magicDocs-DLav5QK0.js} +3 -3
- package/dist/chunks/main-CVNWNAoh.js +513 -0
- package/dist/chunks/{main-ClXu1ilx.js → main-LMyE3jXY.js} +4 -4
- package/dist/chunks/managedEnv-CYepSnm8.js +1 -0
- package/dist/chunks/{managedEnv-Cl7YbYzf.js → managedEnv-DJSCuqCb.js} +1 -1
- package/dist/chunks/{mappers-xQC-Z4-h.js → mappers-DQxMcezy.js} +1 -1
- package/dist/chunks/mcp-BAbbEaBA.js +1 -0
- package/dist/chunks/mcp-Ct4Sum6A.js +6 -0
- package/dist/chunks/mcp-D5HkCqUh.js +2 -0
- package/dist/chunks/{memoize-FJv2HV1u.js → memoize-FeyE7JEh.js} +1 -1
- package/dist/chunks/memory-COa7aUbx.js +1 -0
- package/dist/chunks/{mode-lYTs0XHs.js → mode-Bl2RZC8M.js} +2 -2
- package/dist/chunks/model-B7rtZ7KV.js +1 -0
- package/dist/chunks/model-Bgh_r4lg.js +1 -0
- package/dist/chunks/model-DiuEAv6h.js +1 -0
- package/dist/chunks/{modelOptions-efCGKnXT.js → modelOptions-BtEZe5BB.js} +1 -1
- package/dist/chunks/nativeInstaller-BEwayifa.js +1 -0
- package/dist/chunks/omit--yH_T4rf.js +1 -0
- package/dist/chunks/onChangeAppState-ZdwI7boX.js +1 -0
- package/dist/chunks/{openai-DJLYqiRl.js → openai-DWs4D-nQ.js} +3 -3
- package/dist/chunks/panel-CoNfXy3K.js +1 -0
- package/dist/chunks/{parser-BdCj2GrE.js → parser-BH4u7QiV.js} +1 -1
- package/dist/chunks/parser-BMIaRErw.js +1 -0
- package/dist/chunks/partition-DLcW5Oo_.js +1 -0
- package/dist/chunks/permissions-CaucYK3s.js +3 -0
- package/dist/chunks/pidLock-DgOBc1Xo.js +3 -0
- package/dist/chunks/{plan-BeoIjNPv.js → plan-BNYDTnQd.js} +1 -1
- package/dist/chunks/{platform-D6IMiyqT.js → platform-B0uTQc9P.js} +1 -1
- package/dist/chunks/plugin-BN-of1_H.js +17 -0
- package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +1 -0
- package/dist/chunks/pluginBlocklist-DXQlbG0P.js +1 -0
- package/dist/chunks/pluginCliCommands-CfdVNs8D.js +1 -0
- package/dist/chunks/pluginFlagging-DcJ_FQuv.js +1 -0
- package/dist/chunks/pluginOperations-DnhzFbYI.js +2 -0
- package/dist/chunks/pluginStartupCheck-CKBFaMFr.js +1 -0
- package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +1 -0
- package/dist/chunks/{plugins-pmipe7kE.js → plugins-CBW7kPyp.js} +4 -4
- package/dist/chunks/{poorMode-BxsyllUK.js → poorMode-B_xEvuEV.js} +1 -1
- package/dist/chunks/poorMode-yH1o41cQ.js +1 -0
- package/dist/chunks/print-BZOx09SU.js +26 -0
- package/dist/chunks/processBashCommand-dcCNCiBp.js +1 -0
- package/dist/chunks/processSlashCommand-YDiM63Qr.js +5 -0
- package/dist/chunks/prompt-CXGy0llt.js +1 -0
- package/dist/chunks/prompt-DovNDmcx.js +1 -0
- package/dist/chunks/{prompt-CybUvG8G.js → prompt-Dx7IWhBt.js} +34 -34
- package/dist/chunks/{promptEditor-0Ug93P2I.js → promptEditor-WCkmpejM.js} +2 -2
- package/dist/chunks/{protocolHandler-ClfbHTjI.js → protocolHandler-BiVWrpHi.js} +4 -4
- package/dist/chunks/{proxy-Blq4W6Ox.js → proxy-CVn7o19p.js} +3 -3
- package/dist/chunks/reconciler-C2Nd_e4n.js +1 -0
- package/dist/chunks/refresh-B84H2Ezd.js +1 -0
- package/dist/chunks/{registerProtocol-3_ozAuDK.js → registerProtocol-E0Iu5hEx.js} +2 -2
- package/dist/chunks/{reload-plugins-Dn1ibOiI.js → reload-plugins-D-3AUT9g.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-Dpg6Se9C.js → remoteBridgeCore-CV6we3ZA.js} +1 -1
- package/dist/chunks/remoteManagedSettings-D26Q09-7.js +1 -0
- package/dist/chunks/rename-CSavuBIE.js +1 -0
- package/dist/chunks/{renderOptions-CLcco6fc.js → renderOptions-DDLbSMQU.js} +1 -1
- package/dist/chunks/resume-CROylN3J.js +2 -0
- package/dist/chunks/ripgrep-2M1GkXqJ.js +1 -0
- package/dist/chunks/{ripgrep-DkL2S7-I.js → ripgrep-C1ydIMzT.js} +5 -5
- package/dist/chunks/{runtimeObserver-DonWCJOx.js → runtimeObserver-L7pSIWBT.js} +4 -4
- package/dist/chunks/{runtimeObserver-B0xfyLiA.js → runtimeObserver-OU8KrZQG.js} +1 -1
- package/dist/chunks/sandbox-adapter-6UwMLh6e.js +1 -0
- package/dist/chunks/{sandbox-toggle-CSdnHWp-.js → sandbox-toggle-YrQNWGsr.js} +1 -1
- package/dist/chunks/searchExtraTools-Bdv5HJ74.js +1 -0
- package/dist/chunks/{session-BbQlh2S5.js → session-DUYsfPy_.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +1 -0
- package/dist/chunks/sessionObserver-B0zucj_c.js +1 -0
- package/dist/chunks/{sessionObserver-XV6N0XER.js → sessionObserver-Dv3Ba8eA.js} +2 -2
- package/dist/chunks/sessionState-D-SaBzWD.js +11 -0
- package/dist/chunks/sessionStorage-BM1x51Z7.js +1 -0
- package/dist/chunks/{sessionTitle-E1FvsKM9.js → sessionTitle-uCuYaNif.js} +2 -2
- package/dist/chunks/{sessionTracing-ClGQ08jM.js → sessionTracing-Bqb3vJTt.js} +3 -3
- package/dist/chunks/settings-BG15IFYx.js +1 -0
- package/dist/chunks/settings-D4CpDv2y.js +20 -0
- package/dist/chunks/settingsSync-BSrpnyqo.js +1 -0
- package/dist/chunks/setup-C62oq4AZ.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-B9iSx6mB.js → shadowedRuleDetection-BzAZ57p2.js} +1 -1
- package/dist/chunks/{shellQuote-Bth6IZgX.js → shellQuote-DS6WrivY.js} +2 -2
- package/dist/chunks/{sideQuestion-D2dPToW8.js → sideQuestion-CvMBBjI8.js} +3 -3
- package/dist/chunks/sinks-WJ7nzLQs.js +1 -0
- package/dist/chunks/sinks-f7qYjbKJ.js +2 -0
- package/dist/chunks/skillChangeDetector-U5kRU5nd.js +1 -0
- package/dist/chunks/{skillGapStore-DylpOKJ6.js → skillGapStore-CqaT8c0C.js} +2 -2
- package/dist/chunks/{skillLifecycle-GK-8eyyn.js → skillLifecycle-CnR8IqJM.js} +2 -2
- package/dist/chunks/skillSearchPanel-D9qrOXpI.js +21 -0
- package/dist/chunks/{skills-t6krW8GZ.js → skills-BgcFh0vy.js} +1 -1
- package/dist/chunks/startupProfiler-B4HBBbHN.js +1 -0
- package/dist/chunks/{startupProfiler-jeId9f2i.js → startupProfiler-CmH_aVy2.js} +3 -3
- package/dist/chunks/state-BemZdQIl.js +1 -0
- package/dist/chunks/state-D_lk6z-C.js +1 -0
- package/dist/chunks/{stats-BJBhl-Lc.js → stats-B8uQ-UDi.js} +1 -1
- package/dist/chunks/{status-BtsnKNVY.js → status-BekdWoIj.js} +1 -1
- package/dist/chunks/{status-nZQEar7T.js → status-D6KlRJmR.js} +2 -2
- package/dist/chunks/statusNoticeHelpers-BMM8_uJ1.js +1 -0
- package/dist/chunks/{stringUtils-CbS6OkmE.js → stringUtils-C8PaYpQF.js} +1 -1
- package/dist/chunks/switcher-Ck9CrXrr.js +1 -0
- package/dist/chunks/{switcher-77h2J5HC.js → switcher-DnAhkyIn.js} +1 -1
- package/dist/chunks/syncCache-ClP9aBqK.js +1 -0
- package/dist/chunks/{tasks-BNrdmF9p.js → tasks-Dmh6qikm.js} +1 -1
- package/dist/chunks/teleport-DH3IuAUQ.js +1 -0
- package/dist/chunks/{templateJobs-Dkv4I9c1.js → templateJobs-CxqU-s5i.js} +1 -1
- package/dist/chunks/{terminalSetup-DQopnSPR.js → terminalSetup-BKGcmlWp.js} +1 -1
- package/dist/chunks/{terminalSetup-DTGm1Eo2.js → terminalSetup-Cy19F1Js.js} +4 -4
- package/dist/chunks/{theme-BjpBVRf5.js → theme-U7lMFHQ0.js} +1 -1
- package/dist/chunks/{tmux-CMRiI6CD.js → tmux-D5EvHWi3.js} +1 -1
- package/dist/chunks/{toolEventObserver-D-sNBvOe.js → toolEventObserver-D9qjoVl5.js} +1 -1
- package/dist/chunks/toolPool-69mfSPAs.js +1 -0
- package/dist/chunks/trustedDevice-B6AKlsl_.js +1 -0
- package/dist/chunks/trustedDevice-DL0pWP4_.js +1 -0
- package/dist/chunks/{types-DWRxAH0E.js → types-DafcFtmb.js} +2 -2
- package/dist/chunks/udsClient-CWnfsgFP.js +1 -0
- package/dist/chunks/updateCCB-C6XftzIG.js +11 -0
- package/dist/chunks/{upstreamproxy-DDVMwoRi.js → upstreamproxy-CXmjxHpl.js} +2 -2
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-D2FvHieH.js → useExitOnCtrlCDWithKeybindings-DEEJhm_W.js} +1 -1
- package/dist/chunks/useMainLoopModel-6w7mhwhU.js +1 -0
- package/dist/chunks/useManagePlugins-CjnsO-Of.js +1 -0
- package/dist/chunks/{useMergedTools-B-Z9XQ6U.js → useMergedTools-DbhqKk1-.js} +1 -1
- package/dist/chunks/{useSearchInput-C6d6nt9S.js → useSearchInput-gUDbkLaC.js} +1 -1
- package/dist/chunks/useSettingsErrors-CgPad-H0.js +1 -0
- package/dist/chunks/{userAgent-Ng_TTjWr.js → userAgent-CU7Ndh79.js} +1 -1
- package/dist/chunks/util-B4oMhJKh.js +1 -0
- package/dist/chunks/validatePlugin-y_O_tCEL.js +1 -0
- package/dist/chunks/{vim-3mUqsEJm.js → vim-w37BfGZ5.js} +1 -1
- package/dist/chunks/{which-DznMOwny.js → which-BRWBO7Gu.js} +1 -1
- package/dist/chunks/windowsPaths-BY-IVNwQ.js +1 -0
- package/dist/chunks/windowsPaths-DtWHLjmE.js +1 -0
- package/dist/chunks/{workSecret-DtiFreRl.js → workSecret-BEhXgH2M.js} +1 -1
- package/dist/chunks/workerRegistry-Bq9bS5pw.js +6 -0
- package/dist/chunks/worktree-4SUJ4dtz.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -3
- package/dist/chunks/ApproveApiKey-D05WywHU.js +0 -1
- package/dist/chunks/ApproveApiKey-DHAbdwkC.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +0 -1
- package/dist/chunks/Doctor-D160J8Ad.js +0 -3
- package/dist/chunks/Doctor-VhJi2cmL.js +0 -1
- package/dist/chunks/ExitFlow-CoWHhKHJ.js +0 -2
- package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +0 -1
- package/dist/chunks/MCPToolListView-BPmE0C2o.js +0 -1
- package/dist/chunks/MessageSelector-kOn2GaU-.js +0 -3
- package/dist/chunks/Messages-4EnHFeh1.js +0 -11
- package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +0 -1
- package/dist/chunks/QueryEngine-J6ElcO16.js +0 -1
- package/dist/chunks/REPL-DBjbAJsm.js +0 -133
- package/dist/chunks/REPL-oBemMXvp.js +0 -1
- package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +0 -2
- package/dist/chunks/ResumeConversation-wBG8OD9P.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +0 -1
- package/dist/chunks/Settings-DptKuJE7.js +0 -2
- package/dist/chunks/WelcomeV2-BWF-cJOu.js +0 -1
- package/dist/chunks/add-dir-DBVT1cEK.js +0 -1
- package/dist/chunks/agents-CnwTOlqO.js +0 -103
- package/dist/chunks/allErrors-DYw_q14e.js +0 -1
- package/dist/chunks/api-DXDXTFGa.js +0 -1
- package/dist/chunks/attributionTrailer-oKKrF3z8.js +0 -1
- package/dist/chunks/auth-CnLb6RWc.js +0 -1
- package/dist/chunks/auth-D-SGHS0K.js +0 -1
- package/dist/chunks/autonomy-dSJl0hN1.js +0 -15
- package/dist/chunks/autonomyPanel-Ccr9ilei.js +0 -1
- package/dist/chunks/backgroundHousekeeping--cs5crp7.js +0 -17
- package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +0 -1
- package/dist/chunks/bg-DWloqGwk.js +0 -1
- package/dist/chunks/branch-CG0AKS1J.js +0 -3
- package/dist/chunks/bridgeConfig-Dmc1ZDev.js +0 -1
- package/dist/chunks/bridgeMessaging-DlczTV9X.js +0 -1
- package/dist/chunks/caches-1IFb6_M_.js +0 -1
- package/dist/chunks/caches-CB8MHqy2.js +0 -1
- package/dist/chunks/ccrClient-CG6HTv_n.js +0 -1
- package/dist/chunks/client-Crrwkw7g.js +0 -1
- package/dist/chunks/client-D8hKghba.js +0 -1
- package/dist/chunks/color-Cuq0c6xy.js +0 -1
- package/dist/chunks/commands-D3sESsTp.js +0 -1
- package/dist/chunks/compact-DIpwuBDq.js +0 -2
- package/dist/chunks/config-D4G8_MqJ.js +0 -3
- package/dist/chunks/config-q9D4hFiK.js +0 -1
- package/dist/chunks/context-noninteractive-Bwt9A3XD.js +0 -1
- package/dist/chunks/conversation-Bjo_8kia.js +0 -1
- package/dist/chunks/conversation-DrHZIQX2.js +0 -1
- package/dist/chunks/createSession-CPo6GBSb.js +0 -1
- package/dist/chunks/createSession-DnykRoia.js +0 -1
- package/dist/chunks/crossProjectResume-D2A-qjgP.js +0 -40
- package/dist/chunks/cwd--q1ONL7P.js +0 -1
- package/dist/chunks/cwd-L4wygFqJ.js +0 -1
- package/dist/chunks/daemon-D2vFIVOz.js +0 -2
- package/dist/chunks/datadog-DrmHyl3_.js +0 -1
- package/dist/chunks/debug-BdqxZ7rV.js +0 -39
- package/dist/chunks/detectRepository-DA1Q_Skc.js +0 -1
- package/dist/chunks/detectRepository-DvxoaPlk.js +0 -1
- package/dist/chunks/doctor-PWqB46xd.js +0 -1
- package/dist/chunks/earlyInput-xcoTbKQn.js +0 -1
- package/dist/chunks/entry-4JtoJONR.js +0 -14
- package/dist/chunks/esm-DcIr7tVd.js +0 -1
- package/dist/chunks/execSyncWrapper-DKuxVTaf.js +0 -1
- package/dist/chunks/exit-OW9g7b9A.js +0 -1
- package/dist/chunks/extractMemories-1VlmCGwa.js +0 -1
- package/dist/chunks/fast-CrvLdpy3.js +0 -1
- package/dist/chunks/featureCheck-CrJeuheQ.js +0 -1
- package/dist/chunks/featureCheck-HslM03dr.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +0 -1
- package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +0 -5
- package/dist/chunks/flushGate-ch-Tvwjj.js +0 -1
- package/dist/chunks/generateRecap-BIBVlB__.js +0 -1
- package/dist/chunks/generateSessionName-nZj_VvKZ.js +0 -1
- package/dist/chunks/git-B9uvt96d.js +0 -6
- package/dist/chunks/git-BfS5Hk4S.js +0 -1
- package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +0 -1
- package/dist/chunks/help-D2-v9Ug9.js +0 -1
- package/dist/chunks/hooks-DGd02IKF.js +0 -1
- package/dist/chunks/initReplBridge-RhCAlmHE.js +0 -1
- package/dist/chunks/intl-cKc-V6Mq.js +0 -1
- package/dist/chunks/jwtUtils-C9sdGhvT.js +0 -1
- package/dist/chunks/keybindings-BRdSOSUD.js +0 -2
- package/dist/chunks/language-C0cIpKE2.js +0 -1
- package/dist/chunks/language-CxThoWRC.js +0 -1
- package/dist/chunks/loadAgentsDir-8UprzS4w.js +0 -1
- package/dist/chunks/loadPluginHooks-LbaURHVH.js +0 -1
- package/dist/chunks/localSearch-DNjbr4S9.js +0 -1
- package/dist/chunks/log-CTFl4qpD.js +0 -1
- package/dist/chunks/main-BIiwW4mM.js +0 -605
- package/dist/chunks/managedEnv-CpiiQx_v.js +0 -1
- package/dist/chunks/mcp-B_m1XBDt.js +0 -6
- package/dist/chunks/mcp-BiyfH9Sd.js +0 -1
- package/dist/chunks/mcp-BjlaPUWX.js +0 -2
- package/dist/chunks/memory-LN8f_p2b.js +0 -1
- package/dist/chunks/model-C2e73CJD.js +0 -1
- package/dist/chunks/model-CvmS-Esk.js +0 -1
- package/dist/chunks/model-DJ8mFfuR.js +0 -1
- package/dist/chunks/nativeInstaller-DQIFwdat.js +0 -1
- package/dist/chunks/omit-CLPZGevl.js +0 -1
- package/dist/chunks/onChangeAppState-DhBO34OK.js +0 -1
- package/dist/chunks/panel-q0_iT9cg.js +0 -1
- package/dist/chunks/panelCall-sum-3zvi.js +0 -1
- package/dist/chunks/parser-BcdhBGx0.js +0 -1
- package/dist/chunks/partition-CpfoVrg1.js +0 -1
- package/dist/chunks/permissions-DTb9wkAP.js +0 -3
- package/dist/chunks/pidLock-BR5M6RQw.js +0 -3
- package/dist/chunks/pipeTransport-B3TIkTAp.js +0 -1
- package/dist/chunks/plugin-D_dHjTud.js +0 -17
- package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +0 -1
- package/dist/chunks/pluginBlocklist-D93Hd1GF.js +0 -1
- package/dist/chunks/pluginCliCommands-vv0wNt4O.js +0 -1
- package/dist/chunks/pluginFlagging-CxuRF2Vc.js +0 -1
- package/dist/chunks/pluginOperations-BTq4AjYB.js +0 -2
- package/dist/chunks/pluginStartupCheck-B6leNWq9.js +0 -1
- package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +0 -1
- package/dist/chunks/poorMode-iV1NwC5L.js +0 -1
- package/dist/chunks/print-CAUvczBM.js +0 -23
- package/dist/chunks/processBashCommand-CdeQg_c6.js +0 -1
- package/dist/chunks/processSlashCommand-CbkshIC6.js +0 -5
- package/dist/chunks/prompt-RBn4JdEg.js +0 -1
- package/dist/chunks/prompt-Rb8zXlDo.js +0 -1
- package/dist/chunks/reconciler-Drq3HSkj.js +0 -4
- package/dist/chunks/refresh-D8TLHO_T.js +0 -1
- package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +0 -1
- package/dist/chunks/rename-CKsSc7Z3.js +0 -1
- package/dist/chunks/replBridgeHandle-DNC797_T.js +0 -1
- package/dist/chunks/resume-B1a5gLVR.js +0 -2
- package/dist/chunks/ripgrep-BisRODQ2.js +0 -1
- package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +0 -1
- package/dist/chunks/searchExtraTools-DbgfnQkH.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +0 -1
- package/dist/chunks/sessionMemory-7UOFdp29.js +0 -1
- package/dist/chunks/sessionMemory-fAzgAS7Q.js +0 -1
- package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +0 -1
- package/dist/chunks/sessionObserver-Cl26OdaW.js +0 -1
- package/dist/chunks/sessionState-BvECKycx.js +0 -11
- package/dist/chunks/sessionStorage-DSj9yZkl.js +0 -1
- package/dist/chunks/settings-B-R9ZJNY.js +0 -1
- package/dist/chunks/settings-Xbq6AaD-.js +0 -20
- package/dist/chunks/settingsSync-NCN0a4sc.js +0 -1
- package/dist/chunks/setup-uZ0dSekt.js +0 -3
- package/dist/chunks/sinks-C7q46rvE.js +0 -2
- package/dist/chunks/sinks-D3bXeHlQ.js +0 -1
- package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +0 -1
- package/dist/chunks/skillSearchPanel-mpaC62y4.js +0 -21
- package/dist/chunks/startupProfiler-BaiXZ9tr.js +0 -1
- package/dist/chunks/state-B4HwLt8i.js +0 -1
- package/dist/chunks/state-Bs5xweDL.js +0 -1
- package/dist/chunks/statusNoticeHelpers-DMqRGFOh.js +0 -1
- package/dist/chunks/switcher-B2CYzCC_.js +0 -1
- package/dist/chunks/syncCache-By_-buUC.js +0 -1
- package/dist/chunks/teleport-mdnhIZBj.js +0 -1
- package/dist/chunks/toolPool-Di30gn_Y.js +0 -1
- package/dist/chunks/trustedDevice-CupLMpO8.js +0 -1
- package/dist/chunks/trustedDevice-j1u2TG5U.js +0 -1
- package/dist/chunks/udsClient-Cm3HqYUu.js +0 -1
- package/dist/chunks/updateCCB-BlUAU2Vp.js +0 -11
- package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +0 -1
- package/dist/chunks/useManagePlugins-BbWJNLe8.js +0 -1
- package/dist/chunks/useSettingsErrors-DKh4rkGi.js +0 -1
- package/dist/chunks/util-D-X8i5Z2.js +0 -1
- package/dist/chunks/validatePlugin-DSw08u76.js +0 -1
- package/dist/chunks/windowsPaths-1mgenSWa.js +0 -1
- package/dist/chunks/windowsPaths-BVztIhXM.js +0 -1
- package/dist/chunks/workerRegistry-DdOYjLm3.js +0 -6
- package/dist/chunks/worktree-BX1ULzrw.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-BDhHQY0-.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{$f as s,AT as c,Ap as l,BC as u,Ba as d,Cp as f,Da as p,Ea as m,FS as h,FT as g,Fa as _,Gf as v,HC as y,Hu as b,IS as x,Ia as ee,Ja as S,Jf as C,KC as w,LC as te,LS as T,Lf as E,Ma as ne,Na as re,Pa as ie,Qa as ae,Qf as oe,RT as D,Rf as O,Sb as k,Sg as A,Sp as se,UC as ce,Ua as le,Uu as j,VC as ue,Vu as M,Xf as N,Yf as de,ZC as fe,Za as pe,Zf as me,_a as he,_h as ge,aa as _e,bb as ve,eo as ye,fa as be,gb as xe,gh as P,hg as Se,ia as Ce,jT as we,jp as Te,mg as F,oa as Ee,pa as De,qC as Oe,t_ as ke,xg as Ae,yb as je,zC as Me,za as I,zf as Ne}from"./loadAgentsDir-BL93ulMm.js";import{C as Pe,Gr as L,I as R,N as Fe,P as z,Pn as Ie,Rn as Le,di as Re,fi as B,j as ze,mt as Be,ot as Ve,t as V,ui as He,xt as Ue}from"./src-P_wYS_NJ2.js";import{t as H}from"./jsx-runtime-Bb4Xn-E0.js";import{B as We,Wt as Ge}from"./state-BemZdQIl.js";import{n as Ke,t as qe}from"./cwd-Cfdf7z7s.js";import{a as Je,c as Ye,i as Xe,n as Ze,o as Qe}from"./debug-BecbSVoN.js";import{Ht as $e,Wt as et,g as tt,n as nt}from"./settings-D4CpDv2y.js";import{c as rt,h as it,y as at}from"./config-aRiTrtCv.js";import{B as ot,L as st,R as ct,q as lt}from"./log-Dauqle-Z.js";import{b as ut,f as dt,m as ft,v as pt}from"./startupProfiler-CmH_aVy2.js";import{l as mt,o as ht}from"./stringUtils-C8PaYpQF.js";import{Bt as gt,Dt as _t,E as vt,Gt as yt,St as bt,Tt as xt,_ as St,_n as Ct,b as wt,vn as Tt}from"./model-Bgh_r4lg.js";import{bn as Et,vn as Dt}from"./prompt-Dx7IWhBt.js";import{d as Ot,f as kt,h as At,p as jt}from"./terminalSetup-Cy19F1Js.js";import{_ as Mt,x as Nt}from"./sessionState-D-SaBzWD.js";import{n as Pt,t as Ft}from"./systemTheme-Ceakddth.js";import{n as It,r as Lt}from"./PromptInputFooterSuggestions-to5eYBvI.js";import{n as Rt,t as zt}from"./useMainLoopModel-6w7mhwhU.js";import{n as Bt,t as Vt}from"./modalContext-CUThy6Ph.js";import{n as Ht,r as Ut,t as Wt}from"./statusNoticeHelpers-BMM8_uJ1.js";import{a as Gt,c as Kt,i as qt,l as Jt,n as Yt,o as Xt,r as Zt,t as Qt,u as $t}from"./logoV2Utils-CkvOihX7.js";import{homedir as en}from"os";import{relative as tn}from"path";import{fileURLToPath as nn}from"url";function rn(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var an=t((()=>{}));function on(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`)||p(t.text,`status`)!==`completed`?!1:p(t.text,`summary`)?.startsWith(`Background command `)??!1}function sn(e,t){if(!Se()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(on(t)){let i=0;for(;r<e.length&&on(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${ot}><${st}>completed</${st}><${ct}>${i} background commands completed</${ct}></${ot}>`}]}})}else n.push(t),r++}return n}var cn=t((()=>{lt(),ke(),F(),d()}));function ln(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function un(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(ln(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!ln(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 dn=t((()=>{}));function fn(e){let t=hn.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),hn.set(e,t)),t}function pn(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 mn(e,t,n=!1){if(n)return{messages:e};let r=fn(t),i=new Map;for(let t of e){let e=pn(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=pn(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=pn(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 hn,gn=t((()=>{hn=new WeakMap}));function _n(e){let t=Cn.get(e);if(t!==void 0)return t;let n=vn(e).toLowerCase();return Cn.set(e,n),n}function vn(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=Sn.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?Sn.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(bn(e.toolUseResult));t=r.join(`
|
|
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`?[yn(e.input)]:[]).join(`
|
|
3
|
+
`));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
|
|
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(`
|
|
5
|
+
`)}break;case`collapsed_read_search`:e.relevantMemories&&(t=e.relevantMemories.map(e=>e.content).join(`
|
|
6
|
+
`));break;default:break}let n=t,r=n.indexOf(`<system-reminder>`);for(;r>=0;){let e=n.indexOf(xn,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function yn(e){if(!e||typeof e!=`object`)return``;let t=e,n=[];for(let e of[`command`,`pattern`,`file_path`,`path`,`prompt`,`description`,`query`,`url`,`skill`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`args`,`files`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(` `))}return n.join(`
|
|
7
|
+
`)}function bn(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
|
+
`+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
|
+
`))}return n.join(`
|
|
10
|
+
`)}var xn,Sn,Cn,wn=t((()=>{d(),xn=`</system-reminder>`,Sn=new Set([_e,Ee]),Cn=new WeakMap}));function Tn({pose:e=`default`}={}){return(0,En.jsxs)(R,{flexDirection:`column`,alignItems:`center`,children:[(0,En.jsx)(z,{color:`clawd_body`,children:` █████ `}),(0,En.jsx)(z,{color:`clawd_body`,children:`██ ● ● ██`}),(0,En.jsx)(z,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,En.jsx)(z,{color:`clawd_body`,children:` █ █ █ █ `})]})}var En,Dn=t((()=>{B(),V(),En=H()}));function On(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 kn({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,U.jsxs)(R,{flexDirection:`column`,width:t,children:[(0,U.jsx)(z,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(z,{dimColor:!0,italic:!0,children:ut(i,t)})]}):r.length===0&&a?(0,U.jsx)(z,{dimColor:!0,children:ut(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(z,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(z,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(z,{children:ut(e.text,r)})]},n)}),i&&(0,U.jsx)(z,{dimColor:!0,italic:!0,children:ut(i,t)})]})]})}var U,An=t((()=>{B(),V(),pt(),U=H()}));function jn({feeds:e,maxWidth:t}){let n=e.map(e=>On(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Nn.jsx)(R,{flexDirection:`column`,children:e.map((t,n)=>(0,Nn.jsxs)(Mn.Fragment,{children:[(0,Nn.jsx)(kn,{config:t,actualWidth:i}),n<e.length-1&&(0,Nn.jsx)(Pe,{color:`claude`,width:i})]},n))})}var Mn,Nn,Pn=t((()=>{Mn=n(B(),1),V(),An(),Nn=H()}));function Fn(e){let t=e.map(e=>{let t=ft(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 In(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:``}${e}`})),n=qe()===en()?`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}}var Ln=t((()=>{a(),Ke(),pt()}));function Rn(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function zn(){let{pose:e,bounceOffset:t,onClick:n}=Bn();return(0,Hn.jsx)(R,{height:Jn,flexDirection:`column`,onClick:n,children:(0,Hn.jsx)(R,{marginTop:t,flexShrink:0,children:(0,Hn.jsx)(Tn,{pose:e})})})}function Bn(){let[e]=(0,Vn.useState)(()=>nt().prefersReducedMotion??!1),[t,n]=(0,Vn.useState)(-1),r=(0,Vn.useRef)(Un),i=()=>{e||t!==-1||(r.current=Wn[Math.floor(Math.random()*Wn.length)],n(0))};(0,Vn.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Kn,qn);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Gn;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn=t((()=>{B(),Vn=n(B(),1),V(),tt(),Dn(),Hn=H(),Un=[...Rn(`default`,1,2),...Rn(`arms-up`,0,3),...Rn(`default`,0,1),...Rn(`default`,1,2),...Rn(`arms-up`,0,3),...Rn(`default`,0,1)],Wn=[Un,[...Rn(`look-right`,0,5),...Rn(`look-left`,0,5),...Rn(`default`,0,1)]],Gn={pose:`default`,offset:0},Kn=60,qn=e=>e+1,Jn=3}));function Xn(){let{columns:e}=Ve(),t=A(e=>e.agent),n=vt(Rt()),{version:r,cwd:i,billingType:a,agentName:o}=Xt(),s=t??o,c=Math.max(e-15,20),l=ut(r,Math.max(c-11,6)),{shouldSplit:u,truncatedModel:d,truncatedBilling:f}=Zt(n,a,c),p=s?c-1-L(s)-3:c,m=$t(i,Math.max(p,10));return(0,W.jsx)(P,{children:(0,W.jsxs)(R,{flexDirection:`row`,gap:2,alignItems:`center`,children:[Se()?(0,W.jsx)(zn,{}):(0,W.jsx)(Tn,{}),(0,W.jsxs)(R,{flexDirection:`column`,children:[(0,W.jsxs)(z,{children:[(0,W.jsx)(z,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(z,{dimColor:!0,children:[`v`,l]})]}),u?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(z,{dimColor:!0,children:d}),(0,W.jsx)(z,{dimColor:!0,children:f})]}):(0,W.jsxs)(z,{dimColor:!0,children:[d,` · `,f]}),(0,W.jsx)(z,{dimColor:!0,children:s?`@${s} · ${m}`:m})]})]})})}var W,Zn=t((()=>{zt(),fe(),V(),Ae(),pt(),F(),Jt(),St(),ge(),Yn(),Dn(),W=H()}));function Qn(){let e=(0,er.useMemo)($n,[]),t=(0,er.useMemo)(()=>rt().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,er.useEffect)(()=>{n&&at(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,tr.jsx)(R,{paddingLeft:2,flexDirection:`column`,children:(0,tr.jsx)(z,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function $n(){return nr}var er,tr,nr,rr=t((()=>{B(),er=n(B(),1),V(),it(),tr=H(),nr={tip:``,color:`dim`}}));function ir({char:e=`✻`}){let[t]=(0,ar.useState)(()=>nt().prefersReducedMotion??!1),[n,r]=(0,ar.useState)(t),i=(0,ar.useRef)(null),[a,o]=Be(n?null:50);return(0,ar.useEffect)(()=>{if(n)return;let e=setTimeout(r,cr,!0);return()=>clearTimeout(e)},[n]),n?(0,or.jsx)(R,{ref:a,children:(0,or.jsx)(z,{color:lr,children:e})}):(i.current===null&&(i.current=o),(0,or.jsx)(R,{ref:a,children:(0,or.jsx)(z,{color:j(M((o-i.current)/sr*360%360)),children:e})}))}var ar,or,sr,cr,lr,ur=t((()=>{B(),ar=n(B(),1),et(),V(),tt(),b(),or=H(),sr=1500,cr=sr*2,lr=j({r:153,g:153,b:153})}));function dr(){return wt()&&(rt().opus1mMergeNoticeSeenCount??0)<hr}function fr(){let[e]=(0,pr.useState)(dr);return(0,pr.useEffect)(()=>{if(!e)return;let t=(rt().opus1mMergeNoticeSeenCount??0)+1;at(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,mr.jsxs)(R,{paddingLeft:2,children:[(0,mr.jsx)(ir,{char:`↑`}),(0,mr.jsx)(z,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var pr,mr,hr,gr=t((()=>{B(),pr=n(B(),1),et(),V(),it(),St(),ur(),mr=H(),hr=6}));function _r(){let e=Kt(),t=rt().oauthAccount?.displayName??``,{columns:n}=Ve(),i=At(),a=g.isSandboxingEnabled(),o=A(e=>e.agent),s=rt(),[c]=(0,vr.useState)(()=>{let e=nt().companyAnnouncements;if(!(!e||e.length===0))return s.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]});(0,vr.useEffect)(()=>{i&&kt()},[i]),!i&&r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);let l=vt(Rt()),{version:u,cwd:d,billingType:f,agentName:p}=Xt(),m=o??p,h=ut(l,yr-20);if(!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xn,{}),(0,G.jsx)(fr,{}),Je()&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(z,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(z,{dimColor:!0,children:[`Logging to: `,Qe()?`stderr`:Ze()]})]}),(0,G.jsx)(Qn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(z,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(z,{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`})]}),c&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(z,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(z,{children:c})]})]});let _=Gt(n),v=Pt(rt().theme),y=` ${ze(`claude`,v)(`Work Mate`)} ${ze(`inactive`,v)(`v${u}`)} `,b=ze(`claude`,v)(` Work Mate `);if(_===`compact`){let e=qt(t);L(e)>n-4&&(e=qt(null));let r=m?n-4-1-L(m)-3:n-4,i=$t(d,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(P,{children:(0,G.jsxs)(R,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:b,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(z,{bold:!0,children:e}),(0,G.jsx)(R,{marginY:1,children:(0,G.jsx)(Tn,{})}),(0,G.jsx)(z,{dimColor:!0,children:h}),(0,G.jsx)(z,{dimColor:!0,children:f}),(0,G.jsx)(z,{dimColor:!0,children:m?`@${m} · ${i}`:i})]})}),(0,G.jsx)(fr,{}),a&&(0,G.jsx)(R,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(z,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}let x=qt(t),ee=!process.env.IS_DEMO&&s.oauthAccount?.organizationName?`${h} · ${f} · ${s.oauthAccount.organizationName}`:`${h} · ${f}`,S=m?yr-1-L(m)-3:yr,C=$t(d,Math.max(S,10)),w=m?`@${m} · ${C}`:C,{leftWidth:te,rightWidth:T}=Qt(n,_,Yt(x,w,ee));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(P,{children:(0,G.jsx)(R,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:y,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(R,{flexDirection:_===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(R,{flexDirection:`column`,width:te,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{bold:!0,children:x})}),(0,G.jsx)(Tn,{}),(0,G.jsxs)(R,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(z,{dimColor:!0,children:ee}),(0,G.jsx)(z,{dimColor:!0,children:w})]})]}),_===`horizontal`&&(0,G.jsx)(R,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),_===`horizontal`&&(0,G.jsx)(jn,{feeds:i?[In(Ot()),Fn(e)]:[Fn(e)],maxWidth:T})]})})}),(0,G.jsx)(fr,{}),Je()&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(z,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(z,{dimColor:!0,children:[`Logging to: `,Qe()?`stderr`:Ze()]})]}),(0,G.jsx)(Qn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(z,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(z,{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`})]}),c&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(z,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(z,{children:c})]}),a&&(0,G.jsx)(R,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(z,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}var vr,G,yr,br=t((()=>{B(),V(),fe(),Jt(),pt(),Dn(),Pn(),Ln(),it(),Ft(),tt(),Xe(),vr=n(B(),1),jt(),Zn(),ge(),i(),rr(),gr(),D(),Ae(),zt(),St(),G=H(),yr=50}));function xr({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,Sr.jsx)(R,{minWidth:L(i)+8,children:(0,Sr.jsx)(z,{dimColor:!0,children:i})})}var Sr,Cr=t((()=>{B(),V(),Sr=H()}));function wr({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,Tr.jsx)(R,{minWidth:L(n),children:(0,Tr.jsx)(z,{dimColor:!0,children:n})})}var Tr,Er=t((()=>{B(),V(),Tr=H()}));function Dr(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=Pr(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(N(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&Pr(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=Pr(t.messages[0]?.message.content)?.input;if(N(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function Or({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:l,lastThinkingBlockId:u,latestBashOutputUUID:d,columns:f,isLoading:p,lookups:m,shouldCollapseDiffs:h}){let g=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(oe(e,o)||p&&!n),x=v?e.displayMessage:y?de(e):e,ee=v||y?[]:re(e,m),S=Ji(e,s,o,v||y?Ce:ie(e,m),c,m),C=!1;if(l)if(v)C=e.messages.some(e=>{let t=Pr(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)C=oe(e,o);else{let t=_(e);C=!t||o.has(t)}let w=g&&x.type===`assistant`&&Array.isArray(x.message.content)&&x.message.content.some(e=>e.type===`text`)&&(x.timestamp||x.message.model),te=(0,Nr.jsx)(E,{message:e,lookups:m,addMargin:!w,containerWidth:w?void 0:f,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:ee,shouldAnimate:C,shouldShowDot:!0,isTranscriptMode:g,isStatic:S,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:u,latestBashOutputUUID:d,shouldCollapseDiffs:h});return w?(0,Nr.jsx)(P,{children:(0,Nr.jsxs)(R,{width:f,flexDirection:`column`,children:[(0,Nr.jsxs)(R,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,Nr.jsx)(wr,{message:x,isTranscriptMode:g}),(0,Nr.jsx)(xr,{message:x,isTranscriptMode:g})]}),te]})}):(0,Nr.jsx)(P,{children:te})}function kr(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=Pr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return me(e).some(e=>t.has(e));let n=_(e);return!!n&&t.has(n)}function Ar(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=Pr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return me(e).every(e=>t.has(e));if(e.type===`assistant`){let n=Pr(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=_(e);return!n||t.has(n)}function jr(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&&O(t.message))return!1;let n=kr(e.message,e.streamingToolUseIDs),r=Ar(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var Mr,Nr,Pr,Fr,Ir=t((()=>{Mr=n(B(),1),V(),s(),d(),Ne(),Nr=H(),Cr(),ra(),Er(),ge(),Pr=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},Fr=Mr.memo(Or,jr)}));function Lr(e){return e.type===`attachment`&&Rr.has(e.attachment.type)}var Rr,zr=t((()=>{Rr=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.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.token_usage.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 Br(e){return Kr.filter(t=>t.isActive(e))}var K,Vr,Hr,Ur,Wr,Gr,Kr,qr=t((()=>{V(),B(),k(),a(),Ke(),pt(),gt(),Ut(),K=H(),Vr={id:`large-memory-files`,type:`warning`,isActive:e=>je(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:je(e.memoryFiles).map(e=>{let t=e.path.startsWith(qe())?tn(qe(),e.path):e.path;return(0,K.jsxs)(R,{flexDirection:`row`,children:[(0,K.jsx)(z,{color:`warning`,children:o.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Large `,(0,K.jsx)(z,{bold:!0,children:t}),` will impact performance (`,dt(e.content.length),` chars > `,dt(xe),`)`,(0,K.jsx)(z,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Hr={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=_t();return yt()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=_t();return(0,K.jsxs)(R,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(z,{color:`warning`,children:o.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Ur={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=bt({skipRetrievingKeyFromApiKeyHelper:!0});return!!xt()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=bt({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(R,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(z,{color:`warning`,children:o.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Wr={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=bt({skipRetrievingKeyFromApiKeyHelper:!0}),t=_t();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=bt({skipRetrievingKeyFromApiKeyHelper:!0}),t=_t();return(0,K.jsxs)(R,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(R,{flexDirection:`row`,children:[(0,K.jsx)(z,{color:`warning`,children:o.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(R,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(z,{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,K.jsxs)(z,{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.`]})]})]})}},Gr={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Ht(e.agentDefinitions)>Wt,render:e=>{let t=Ht(e.agentDefinitions);return(0,K.jsxs)(R,{flexDirection:`row`,children:[(0,K.jsx)(z,{color:`warning`,children:o.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,dt(t),` tokens > `,dt(Wt),`)`,(0,K.jsx)(z,{dimColor:!0,children:` · /agents to manage`})]})]})}},Kr=[Vr,Gr,Hr,Ur,Wr]}));function Jr({agentDefinitions:e}={}){let t={config:rt(),agentDefinitions:e,memoryFiles:(0,Xr.use)(ve())},n=Br(t);return n.length===0?null:(0,Zr.jsx)(R,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Zr.jsx)(Yr.Fragment,{children:e.render(t)},e.id))})}var Yr,Xr,Zr,Qr=t((()=>{Yr=n(B(),1),Xr=n(B(),1),V(),k(),it(),qr(),Zr=H()}));function $r(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.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,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??si,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/ri);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,q.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])??ei);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,ee=x[b],S,C;if(p)[S,C]=p,S=Math.min(S,b),C=Math.min(C,b);else if(v===0||g<0)S=Math.max(0,b-ni),C=b;else{if(y){let e=v+ti;for(S=b;S>0&&ee-x[S-1]<e;)S--;C=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-ti;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}S=e}{let e=d.current;if(e&&e[0]<S)for(let n=e[0];n<Math.min(S,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){S=n;break}}}let h=v+2*ti,y=Math.min(b,S+ai),ee=0;for(C=S;C<y&&(ee<h||x[C]<f+v+ti);)ee+=r.current.get(t[C])??ii,C++}let e=v+2*ti,n=Math.max(0,C-ai),i=0;for(let e=S;e<C;e++)i+=r.current.get(t[e])??ii;for(;S>n&&i<e;)S--,i+=r.current.get(t[S])??ii;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;S<e-oi&&(S=e-oi),C>t+oi&&(C=t+oi),S>C&&(C=Math.min(S+oi,b))}a.current=g}f.current>0?f.current--:d.current=[S,C];let w=(0,q.useDeferredValue)(S),te=(0,q.useDeferredValue)(C),T=S<w?w:S,E=C>te?te:C;if((T>E||y)&&(T=S,E=C),_>0&&(E=C),E-T>ai){let e=(x[T]+x[E])/2;g-m.current<e?E=T+ai:T=E-ai}let ne=m.current,re=x[T],ie=T===0?0:re+ne,ae=E===b?1/0:Math.max(re,x[E]-v)+ne;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ie,ae)}),(0,q.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 oe=(0,q.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},[]),D=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),O=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),k=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),A=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),se=ee-x[E];return{range:[T,E],topSpacer:re,bottomSpacer:se,measureRef:oe,spacerRef:h,offsets:x,getItemTop:D,getItemElement:O,getItemHeight:k,scrollToIndex:A}}var q,ei,ti,ni,ri,ii,ai,oi,si,ci=t((()=>{q=n(B(),1),ei=3,ti=40,ni=30,ri=20,ii=1,ai=200,oi=25,si=()=>{}}));function li({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,mi.jsx)(gi.Provider,{value:n,children:(0,mi.jsx)(vi.Provider,{value:i,children:(0,mi.jsx)(hi.Provider,{value:t,children:(0,mi.jsx)(_i.Provider,{value:r,children:e})})})})}function ui(){return(0,J.useContext)(hi)}function di(){return(0,J.useContext)(_i)}function fi(e){let t=(0,J.useContext)(gi);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function pi(e){let t=(0,J.useContext)(vi);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,mi,hi,gi,_i,vi,yi=t((()=>{J=n(B(),1),mi=H(),hi=(0,J.createContext)(null),gi=(0,J.createContext)(null),_i=(0,J.createContext)(null),vi=(0,J.createContext)(null)}));function bi(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.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,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.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,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function xi(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`&&!Si(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function Si(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 Ci(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||Lr(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=xi(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function wi({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:u=0,onPillClick:d}){let{rows:f,columns:p}=Ve(),[m,h]=(0,Y.useState)(null),g=(0,Y.useMemo)(()=>({setStickyPrompt:h}),[]),_=(0,Y.useSyncExternalStore)((0,Y.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,Y.useLayoutEffect)(()=>{if(!Se())return;let e=Le.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{T(nn(e))}catch{}else x(e)},()=>{e.onHyperlinkClick=void 0}},[]),Se()){let s=l?null:m,h=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(li,{children:[(0,X.jsx)(R,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(R,{flexDirection:`column`,flexGrow:1,width:p,overflow:`hidden`,children:[(0,X.jsxs)(R,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[h&&(0,X.jsx)(Ei,{text:h.text,onClick:h.scrollTo}),(0,X.jsxs)(Ue,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(Ai,{value:g,children:e}),n]}),!c&&_&&n==null&&(0,X.jsx)(Ti,{count:u,onClick:d}),r!=null&&(0,X.jsx)(R,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(R,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(Di,{}),(0,X.jsx)(Oi,{}),(0,X.jsx)(R,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Vt,{value:{rows:f-ki-1,columns:p-4,scrollRef:a??null},children:(0,X.jsxs)(R,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:f-ki,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(R,{flexShrink:0,children:(0,X.jsx)(z,{color:`permission`,children:`▔`.repeat(p)})}),(0,X.jsx)(R,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function Ti({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(R,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(R,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(z,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${mt(e,`message`)}`:`Jump to bottom`,` `,o.arrowDown,` `]})})})}function Ei({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(R,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(z,{color:`subtle`,wrap:`truncate-end`,children:[o.pointer,` `,e]})})}function Di(){let e=ui();return!e||e.suggestions.length===0?null:(0,X.jsx)(R,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(It,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function Oi(){let e=di();return e?(0,X.jsx)(R,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,ki,Ai,ji=t((()=>{a(),Y=n(B(),1),Bt(),yi(),fe(),V(),h(),F(),ht(),zr(),Lt(),X=H(),ki=2,Ai=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function Mi(e){let t=Bi.get(e);if(t!==void 0)return t;let n=_n(e);return Bi.set(e,n),n}function Ni(e){let t=Hi.get(e);if(t!==void 0)return t;let n=Pi(e);return Hi.set(e,n),n}function Pi(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
|
+
`)}if(t===null)return null;let n=y(t);return n.startsWith(`<`)||n===``?null:n}function Fi({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,Ri.jsx)(R,{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,Ri.jsx)(Fe.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function Ii({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=Mi,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,Z.useRef)([]),v=(0,Z.useRef)(e),y=(0,Z.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:x,topSpacer:ee,bottomSpacer:S,measureRef:C,spacerRef:w,offsets:te,getItemTop:T,getItemElement:E,getItemHeight:ne,scrollToIndex:re}=$r(t,b,n),[ie,ae]=x,oe=(0,Z.useCallback)(t=>ne(t)!==0&&ue(e[t]),[ne,e]);(0,Z.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:ce(e)?.name}),r=u??-1,i=(t,r,i=oe)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>oe(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,oe]);let D=(0,Z.useRef)({offsets:te,start:ie,getItemElement:E,getItemTop:T,messages:e,scrollToIndex:re});D.current={offsets:te,start:ie,getItemElement:E,getItemTop:T,messages:e,scrollToIndex:re},(0,Z.useEffect)(()=>{if(u===void 0)return;let e=D.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let O=(0,Z.useRef)(null),k=(0,Z.useRef)({msgIdx:-1,positions:[]}),A=(0,Z.useRef)(-1),se=(0,Z.useRef)(0),le=(0,Z.useRef)(0),j=(0,Z.useRef)(()=>{}),M=(0,Z.useRef)(()=>{}),N=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),de=(0,Z.useRef)(-1),fe=(0,Z.useRef)(!1);function pe(e){let t=D.current.getItemTop(e);return Math.max(0,t-zi)}function me(e){let n=t.current,{msgIdx:r,positions:i}=k.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=D.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-zi)),l=s-n.getScrollTop(),d=c+l+o.row),g?.({positions:i,rowOffset:c+l,currentIdx:a});let f=N.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),Ye(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}M.current=me;let[he,ge]=(0,Z.useState)(0),_e=(0,Z.useCallback)(()=>ge(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=O.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}=D.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){O.current=null,Ye(`seek(i=${n}): no mount after scrollToIndex, skip`),j.current(r?-1:1);return}O.current={idx:n,wantLast:r,tries:i+1},c(n),_e();return}O.current=null,a.scrollTo(Math.max(0,s(n)-zi));let d=h?.(l)??[];if(k.current={msgIdx:n,positions:d},Ye(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++se.current>20){se.current=0;return}j.current(r?-1:1);return}se.current=0;let f=r?d.length-1:0;N.current.screenOrd=f,A.current=-1,M.current(f);let p=le.current;p&&(le.current=0,j.current(p))},[he]);function ve(e,n){let r=t.current;if(!r)return;let i=D.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;g?.(null),k.current={msgIdx:-1,positions:[]},O.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(pe(e)):o(e),_e()}function ye(e){let t=N.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(O.current){le.current=e;return}A.current<0&&(A.current=t.ptr);let{positions:a}=k.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,me(o),A.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===A.current){g?.(null),A.current=-1,Ye(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,ve(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}j.current=ye,(0,Z.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(pe(e))},setSearchQuery:e=>{O.current=null,k.current={msgIdx:-1,positions:[]},A.current=-1,g?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=D.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}=D.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=de.current>=0?de.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)}Ye(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}N.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?ve(r[o],!0):de.current>=0&&s&&s.scrollTo(de.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>ye(1),prevMatch:()=>ye(-1),setAnchor:()=>{let e=t.current;e&&(de.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),O.current=null,k.current={msgIdx:-1,positions:[]},A.current=-1},warmSearchIndex:async()=>{if(fe.current)return 0;let e=D.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Tt(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 Ye(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),fe.current=!0,Math.round(t)}}),[t]);let[be,xe]=(0,Z.useState)(null),P=(0,Z.useRef)({onItemClick:a,setHoveredKey:xe});P.current={onItemClick:a,setHoveredKey:xe};let Se=(0,Z.useCallback)((e,t)=>{let n=P.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),Ce=(0,Z.useCallback)(e=>{P.current.setHoveredKey(e)},[]),we=(0,Z.useCallback)(e=>{P.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Ri.jsxs)(Ri.Fragment,{children:[(0,Ri.jsx)(R,{ref:w,height:ee,flexShrink:0}),e.slice(ie,ae).map((e,t)=>{let n=ie+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&be===r,u=s?.(e);return(0,Ri.jsx)(Fi,{itemKey:r,msg:e,idx:n,measureRef:C,expanded:u,hovered:l,clickable:c,onClickK:Se,onEnterK:Ce,onLeaveK:we,renderItem:i},r)}),S>0&&(0,Ri.jsx)(R,{height:S,flexShrink:0}),l&&(0,Ri.jsx)(Li,{messages:e,start:ie,end:ae,offsets:te,getItemTop:T,getItemElement:E,scrollRef:t})]})}function Li({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(Ai);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??Ui,[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=Ni(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,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.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,Vi).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,Z.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 Z,Ri,zi,Bi,Vi,Hi,Ui,Wi=t((()=>{B(),Z=n(B(),1),ci(),V(),v(),ji(),Ri=H(),Xe(),Ct(),wn(),u(),zi=3,Bi=new WeakMap,Vi=500,Hi=new WeakMap,Ui=()=>{}}));function Gi(e,t,n=$i,r=ea){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 Ki(e){return(e.type===`assistant`||e.type===`user`?_(e):null)??e.uuid}function qi(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ji(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=_(e);return i?t.has(i)||n.has(i)||I(i,`PostToolUse`,a)?!1:rn(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 Yi,Q,$,Xi,Zi,Qi,$i,ea,ta,na,ra=t((()=>{Re(),Yi=n(B(),1),Q=n(B(),1),an(),Ge(),et(),fe(),V(),w(),Et(),c(),cn(),dn(),s(),it(),i(),F(),gn(),d(),ht(),wn(),br(),Te(),Ir(),u(),f(),zr(),ge(),Qr(),$=H(),Wi(),Xi=Yi.memo(function({agentDefinitions:e}){return(0,$.jsx)(P,{children:(0,$.jsxs)(R,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(_r,{}),(0,$.jsx)(Yi.Suspense,{fallback:null,children:(0,$.jsx)(Jr,{agentDefinitions:e})})]})})}),Zi=(Mt(),e(Nt)),Qi=30,$i=200,ea=50,ta=({messages:e,tools:t,commands:n,verbose:i,toolJSX:a,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:u,screen:d,streamingToolUses:f,showAllInTranscript:p=!1,agentDefinitions:h,hideLogo:g=!1,isLoading:_,hidePastThinking:v=!1,streamingThinking:y,streamingText:b,unseenDivider:x,scrollRef:w,trackStickyPrompt:T,jumpRef:E,onSearchMatchesChange:re,scanElement:ie,setPositions:oe,disableRenderCap:D=!1,cursor:O=null,setCursor:k,cursorNavRef:A,renderRange:ce})=>{let{columns:j}=Ve(),ue=Oe(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),M=(0,Q.useMemo)(()=>S(e).filter(le),[e]),N=(0,Q.useMemo)(()=>y?y.isStreaming?!0:y.streamingEndedAt?Date.now()-y.streamingEndedAt<3e4:!1:!1,[y]),{lastThinkingBlockId:de,latestBashOutputUUID:fe}=(0,Q.useMemo)(()=>{let e=null,t=null,n=v&&!N;v&&N&&(e=`streaming`);for(let r=M.length-1;r>=0;r--){let i=M[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 v||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[M,v,N]),me=(0,Q.useMemo)(()=>ee(M),[M]),ge=(0,Q.useMemo)(()=>f.filter(e=>!s.has(e.contentBlock.id)&&!me.has(e.contentBlock.id)),[f,s,me]),_e=(0,Q.useMemo)(()=>ge.flatMap(e=>{let t=he({content:[e.contentBlock]});return t.uuid=m(e.contentBlock.id,0),S([t])}),[ge]),ve=d===`transcript`,xe=(0,Q.useMemo)(()=>r(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),P=w!=null&&!xe,Ce=ve&&!p&&!P,Te=(0,Q.useRef)(null),F=(0,Q.useRef)(null),{collapsed:Ee,lookups:ke,hasTruncatedMessages:Ae,hiddenMessageCount:je}=(0,Q.useMemo)(()=>{let e=pe((i||Se()?M:ne(M,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!Lr(e)&&ae(e,ve)),_e),n=Ce?e.slice(-30):e,r=Ce&&e.length>Qi,{messages:a}=mn(n,t,i),o=sn(un(C(a,t)),i),s=De(M,n),c=(()=>{let e=n.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),l;if(F.current&&F.current.key===s)l=F.current.lookups;else if(F.current&&M.length>=F.current.normalizedCount&&n.length>=F.current.messageCount&&F.current.lastAssistantMsgId===c){let e=ye(F.current.lookups,F.current.normalizedCount,F.current.messageCount,M,n);e?(l=e,F.current={key:s,lookups:l,normalizedCount:M.length,messageCount:n.length,lastAssistantMsgId:c}):(l=be(M,n),F.current={key:s,lookups:l,normalizedCount:M.length,messageCount:n.length,lastAssistantMsgId:c})}else l=be(M,n),F.current={key:s,lookups:l,normalizedCount:M.length,messageCount:n.length,lastAssistantMsgId:c};let u=e.length-Qi;return{collapsed:o,lookups:l,hasTruncatedMessages:r,hiddenMessageCount:u}},[i,M,ve,_e,Ce,t]),I=(0,Q.useMemo)(()=>{let e=!P&&!D?Gi(Ee,Te):0;return ce?Ee.slice(ce[0],ce[1]):e>0?Ee.slice(e):Ee},[Ee,ce,P,D]),Ne=(0,Q.useMemo)(()=>new Set(f.map(e=>e.contentBlock.id)),[f]),{dividerBeforeIndex:L,selectedIdx:Fe}=(0,Q.useMemo)(()=>{if(!x&&!O)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=x?.firstUnseenUuid.slice(0,24);for(let r=0;r<I.length;r++){let i=I[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&O&&i.uuid===O.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[x,O,I]),[Le,Re]=(0,Q.useState)(()=>new Set),B=(0,Q.useCallback)(e=>{let t=Ki(e);Re(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),ze=(0,Q.useCallback)(e=>Le.size>0&&Le.has(Ki(e)),[Le]),Be=(0,Q.useRef)(ke);Be.current=ke;let V=(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&&we(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=Be.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?Dt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),Ue=(!a||!!a.shouldContinueAnimation)&&!o.length&&!c,H=s.size>0,{progress:Ge}=Ie(),Ke=(0,Q.useRef)(null),qe=rt().terminalProgressBarEnabled&&!We()&&!(Zi?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=qe?H?`indeterminate`:`completed`:null;Ke.current!==e&&(Ke.current=e,Ge(e))},[Ge,qe,H]),(0,Q.useEffect)(()=>()=>Ge(null),[Ge]);let Je=(0,Q.useCallback)(e=>`${e.uuid}-${u}`,[u]),Ye=(e,r)=>{let a=r>0?I[r-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!b||Dr(I,r,t,Ne)),l=I.length-1-r>0,u=Je(e),f=(0,$.jsx)(Fr,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:n,verbose:i||ze(e)||O?.expanded===!0&&r===Fe,inProgressToolUseIDs:s,streamingToolUseIDs:Ne,screen:d,canAnimate:Ue,lastThinkingBlockId:de,latestBashOutputUUID:fe,columns:j,isLoading:_,lookups:ke,shouldCollapseDiffs:l},u),p=(0,$.jsx)(Me.Provider,{value:r===Fe,children:f},u);return x&&r===L?[(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(Pe,{title:`${x.count} new ${mt(x.count,`message`)}`,width:j,color:`inactive`})},`unseen-divider`),p]:p},Xe=(0,Q.useRef)(new WeakMap),Ze=(0,Q.useCallback)(e=>{let n=Xe.current.get(e);if(n!==void 0)return n;let r=_n(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=ke.toolUseByToolUseID.get(n.tool_use_id),a=(i&&Dt(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Xe.current.set(e,i),i},[t,ke]);return(0,$.jsxs)($.Fragment,{children:[!g&&!(ce&&ce[0]>0)&&(0,$.jsx)(Xi,{agentDefinitions:h}),Ae&&(0,$.jsx)(Pe,{title:`${ue} to show ${He.bold(je)} previous messages`,width:j}),ve&&p&&je>0&&!D&&(0,$.jsx)(Pe,{title:`${ue} to hide ${He.bold(je)} previous messages`,width:j}),P?(0,$.jsx)(te.Provider,{value:!0,children:(0,$.jsx)(Ii,{messages:I,scrollRef:w,columns:j,itemKey:Je,renderItem:Ye,onItemClick:B,isItemClickable:V,isItemExpanded:ze,trackStickyPrompt:T,selectedIndex:Fe>=0?Fe:void 0,cursorNavRef:A,setCursor:k,jumpRef:E,onSearchMatchesChange:re,scanElement:ie,setPositions:oe,extractSearchText:Ze})}):I.flatMap(Ye),b&&(0,$.jsx)(R,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(R,{flexDirection:`row`,children:[(0,$.jsx)(R,{minWidth:2,children:(0,$.jsx)(z,{color:`text`,children:$e})}),(0,$.jsx)(R,{flexDirection:`column`,children:(0,$.jsx)(l,{children:b})})]})}),N&&y&&(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(se,{param:{type:`thinking`,thinking:y.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},na=Yi.memo(ta,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(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`&&qi(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{ji as a,fi as c,Ci as i,pi as l,ra as n,bi as o,wi as r,yi as s,na as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-BDhHQY0-.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-BDhHQY0-.js";import{GC as r,Iu as i,cd as a,ed as o,ld as s,td as c}from"./loadAgentsDir-BL93ulMm.js";import{Gt as l,H as u,I as d,Lt as f,P as p,fi as m,kt as h,t as g}from"./src-P_wYS_NJ2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as v,Yt as y}from"./settings-D4CpDv2y.js";import{h as b,s as x}from"./config-aRiTrtCv.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{Bt as w,Ht as T,Sr as E,xr as D}from"./model-Bgh_r4lg.js";import{c as O,i as k,s as A}from"./terminalSetup-Cy19F1Js.js";import{t as j}from"./WelcomeV2-ZQRKlcT4.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{n as P,t as F}from"./ThemePicker-BT_NaRQC.js";import{n as I,t as L}from"./PressEnterToContinue-Dq0Imo9c.js";import{t as R}from"./ApproveApiKey-M6U-NafA.js";n();var z=e(m(),1),B=_();S(),y(),b(),D(),w(),r(),k(),N(),g(),g(),i(),s(),c(),P(),I(),g();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(d,{gap:1,children:[(0,B.jsx)(p,{dimColor:!0,children:t}),(0,B.jsx)(d,{flexDirection:`column`,children:e})]})}g();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)(d,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,B.jsx)(U.Provider,{value:{marker:a},children:(0,B.jsx)(V.Provider,{value:{marker:a},children:e})})})})}W.Item=H;var G=W;g();function K({onDone:e}){let[n,r]=(0,z.useState)(0),[i,s]=(0,z.useState)(!1),[c]=(0,z.useState)(()=>T()),[m,g]=u();(0,z.useEffect)(()=>{C(`tengu_began_setup`,{oauthEnabled:c})},[c]);function _(){if(n<N.length-1){let e=n+1;r(e),C(`tengu_onboarding_step`,{oauthEnabled:c,stepId:N[e]?.id})}else e()}function y(e){g(e),_()}let b=M(),S=(0,B.jsx)(d,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:y,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),w=(0,B.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(p,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(d,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(p,{children:`Always review changes before accepting`}),(0,B.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(h,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(h,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(p,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(h,{}),(0,B.jsx)(f,{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=E(process.env.ANTHROPIC_API_KEY);if(x(e)===`new`)return e},[]);function k(e){e&&s(!0),_()}let N=[];N.push({id:`theme`,component:S}),D&&N.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),c&&N.push({id:`oauth`,component:(0,B.jsx)(q,{skip:i,onSkip:_,children:(0,B.jsx)(a,{onDone:_})})}),N.push({id:`security`,component:w}),O()&&N.push({id:`terminal-setup`,component:(0,B.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(p,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(d,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(p,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(h,{}),`for your terminal:`,` `,v.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(o,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(m).catch(()=>{}).finally(_):_()},onCancel:()=>_()}),(0,B.jsx)(p,{dimColor:!0,children:b.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=N[n],I=(0,z.useCallback)(()=>{n===N.length-1?e():_()},[n,N.length,c,e]),V=(0,z.useCallback)(()=>{_()},[n,N.length,c,e]);return l({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),l({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(d,{flexDirection:`column`,children:[(0,B.jsx)(j,{}),(0,B.jsxs)(d,{flexDirection:`column`,marginTop:1,children:[P?.component,b.pending&&(0,B.jsx)(d,{padding:1,children:(0,B.jsxs)(p,{dimColor:!0,children:[`Press `,b.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"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ZC as n}from"./loadAgentsDir-BL93ulMm.js";import{Gr as r,I as i,P as a,fi as o,ot as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{C as u,v as d,x as f}from"./startupProfiler-CmH_aVy2.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:n,overlay:a}){let{rows:o}=s(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=n??Math.max(...e.map(e=>r(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(i,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(o(),1),n(),c(),d(),_=l(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:n}){let i=s().columns;if(m(e.id)){let t=p(e.id),o=n?`suggestion`:void 0,s=!n,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,r(e.description)):0,n=i-2-4-d-t;m=f(e.displayText,n)}else m=l?u(e.displayText,30):e.displayText;let h=i-2-r(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:o,dimColor:s,wrap:`truncate`,children:g})}let o=Math.floor(i*.4),c=Math.min(t??r(e.displayText)+5,o),l=e.color||(n?`suggestion`:void 0),d=!n,h=e.displayText;r(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-r(h))),v=e.tag?`[${e.tag}] `:``,y=r(v),b=Math.max(0,i-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:n?`suggestion`:void 0,dimColor:!n,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{KC as t,mE as n,pE as r,qC as i}from"./loadAgentsDir-BL93ulMm.js";import{I as a,P as o,fi as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as u,Yt as d}from"./settings-D4CpDv2y.js";import{c as f,h as p}from"./config-aRiTrtCv.js";import{i as m,o as h}from"./platform-B0uTQc9P.js";import{et as g,rt as _,tt as v}from"./model-Bgh_r4lg.js";import{a as y,i as b,r as x}from"./terminalSetup-Cy19F1Js.js";function S(){return f().editorMode===`vim`}function C(){return u.terminal===`Apple_Terminal`&&process.platform===`darwin`||y()?`shift + ⏎ for newline`:x()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function w(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var T=e((()=>{b(),p(),d()}));function E(e){return e.replace(/\+/g,` + `)}function D(e){let{dimColor:t,fixedWidth:r,gap:s,paddingX:c}=e,l=E(i(`app:toggleTranscript`,`Global`,`ctrl+o`)),u=E(i(`app:toggleTodos`,`Global`,`ctrl+t`)),d=E(i(`chat:undo`,`Chat`,`ctrl+_`)),f=E(i(`chat:stash`,`Chat`,`ctrl+s`)),p=E(i(`chat:cycleMode`,`Chat`,`shift+tab`)),h=E(i(`chat:modelPicker`,`Chat`,`alt+p`)),g=E(i(`chat:fastMode`,`Chat`,`alt+o`)),y=E(i(`chat:externalEditor`,`Chat`,`ctrl+g`));E(i(`app:toggleTerminal`,`Global`,`meta+j`));let b=E(i(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,O.jsxs)(a,{paddingX:c,flexDirection:`row`,gap:s,children:[(0,O.jsxs)(a,{flexDirection:`column`,width:r?24:void 0,children:[(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`! for bash mode`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`/ for commands`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`@ for file paths`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`& for background`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`/btw for side question`})})]}),(0,O.jsxs)(a,{flexDirection:`column`,width:r?35:void 0,children:[(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`double tap esc to clear input`})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[p,` to auto-accept edits`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[l,` for verbose output`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[u,` to toggle tasks`]})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:C()})})]}),(0,O.jsxs)(a,{flexDirection:`column`,children:[(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[d,` to undo`]})}),m()!==`windows`&&(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`ctrl + z to suspend`})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[b,` to paste images`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[h,` to switch model`]})}),_()&&v()&&(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[g,` to toggle fast mode`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[f,` to stash prompt`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:t,children:[y,` to edit in $EDITOR`]})}),n()&&(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:t,children:`/keybindings to customize`})})]})]})}var O,k=e((()=>{s(),c(),h(),r(),t(),g(),T(),O=l()}));export{S as a,w as i,k as n,T as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,s as r}from"./envUtils-BDhHQY0-.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{$ as o,$r as s,Ba as c,Bi as l,Cr as u,Db as d,Gg as f,HE as ee,Hg as p,Q as te,Qs as m,Ri as h,Sm as g,VE as ne,Xs as _,Xy as v,Ys as re,Zs as ie,_p as y,_v as b,ao as ae,ay as x,bm as S,bn as C,bv as w,ct as T,da as oe,do as se,dw as ce,gc as le,gx as E,hc as D,hx as O,iy as ue,kb as k,lt as A,ma as de,mp as fe,nE as pe,nr as j,nt as me,po as he,tE as M,uw as N,xn as ge,xv as P,yv as F,zg as _e}from"./loadAgentsDir-BL93ulMm.js";import{Kr as ve,qr as ye}from"./src-P_wYS_NJ2.js";import{Et as I,Gt as be,Q as L,St as R,Wt as z,dt as xe,pt as B}from"./state-BemZdQIl.js";import{n as V,t as Se}from"./cwd-Cfdf7z7s.js";import{Q as H,Y as Ce,f as we,g as U}from"./settings-D4CpDv2y.js";import{M as W,c as Te,h as Ee,j as De}from"./config-aRiTrtCv.js";import{i as Oe,o as ke,q as Ae}from"./log-Dauqle-Z.js";import{Bt as je,C as Me,St as G,Y as K,_ as Ne,et as Pe,u as Fe}from"./model-Bgh_r4lg.js";import{bn as Ie,ot as q,rt as Le,xn as Re}from"./prompt-Dx7IWhBt.js";import{M as ze,at as Be,st as Ve}from"./sessionState-D-SaBzWD.js";import{a as He,n as Ue,r as We}from"./mappers-DQxMcezy.js";import{n as J,o as Ge,r as Y}from"./MessageSelector-o4ULADFg.js";import{n as Ke,t as qe}from"./systemTheme-Ceakddth.js";import{randomUUID as X}from"crypto";n(),i(),ve(),z(),V(),Ae(),ke(),H(),U(),W(),Ie(),Ee(),ne(),je(),Pe(),M(),ze(),k(),v(),x(),q(),f(),g(),D(),se(),ae(),c(),l(),u(),C(),o(),A(),P(),E(),Ne(),b(),fe();async function Je({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?T(e,t,n,r):Promise.resolve([]),w(),i===void 0?F():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function Ye({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=Fe(),f=a(),{defaultSystemPrompt:ee,userContext:p,systemContext:te}=await Je({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),m=Be([...s===void 0?ee:[s],...c?[c]:[]]),h=r.at(-1),g=h?.type===`assistant`&&h.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:m,userContext:p,systemContext:te,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(y()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:O(),readFileState:i,getAppState:a,setAppState:o,messages:g,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:g}}N(),Ue(),qe();function Xe(e){return e===`Agent`?Ce:e}function Ze(e){let t=we()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:Se(),session_id:B(),tools:e.tools.map(e=>Xe(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:G().source,betas:xe(),claude_code_version:`0.0.11`,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:X()};return n.fast_mode_state=K(e.model,e.fastMode),n}z(),E(),V(),Pe(),Ne(),b(),fe(),_();var Qe=()=>{try{return Y(),e(J)}catch{return null}},Z=class{constructor(e){a(this,`config`,void 0),a(this,`mutableMessages`,void 0),a(this,`abortController`,void 0),a(this,`permissionDenials`,void 0),a(this,`totalUsage`,void 0),a(this,`hasHandledOrphanedPermission`,!1),a(this,`readFileState`,void 0),a(this,`discoveredSkillNames`,new Set),a(this,`loadedNestedMemoryPaths`,new Set),this.config=e,this.mutableMessages=e.initialMessages??[],this.abortController=e.abortController??O(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=Ve}async*submitMessage(e,n){let{cwd:i,commands:a,tools:o,mcpClients:c,verbose:l=!1,thinkingConfig:u,maxTurns:d,maxBudgetUsd:f,taskBudget:g,canUseTool:ne,customSystemPrompt:_,appendSystemPrompt:v,userSpecifiedModel:b,fallbackModel:ae,jsonSchema:x,getAppState:C,setAppState:w,replayUserMessages:T=!1,includePartialMessages:se=!1,agents:E=[],setSDKStatus:D,orphanedPermission:O}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],ce(i);let k=!be(),A=Date.now(),fe=async(e,t,n,r,i,a)=>{let o=await ne(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:Xe(e.name),tool_use_id:i,tool_input:t}),o},M=C(),N=b?Me(b):Fe(),P=u||(y()===!1?{type:`disabled`}:{type:`adaptive`});S(`before_getSystemPrompt`);let F=typeof _==`string`?_:void 0,{defaultSystemPrompt:ve,userContext:z,systemContext:xe}=await Je({tools:o,mainLoopModel:N,additionalWorkingDirectories:Array.from(M.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:c,customSystemPrompt:F});S(`after_getSystemPrompt`);let V={...z},H=F!==void 0&&De()?await ee():null,Ce=Be([...F===void 0?ve:[F],...H?[H]:[],...v?[v]:[]]),we=o.some(e=>Re(e,Le));x&&we&&ge(w,B());let U={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:l,mainLoopModel:N,thinkingConfig:P,mcpClients:c,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:_,appendSystemPrompt:v,agentDefinitions:{activeAgents:E,allAgents:[]},theme:Ke(Te().theme),maxBudgetUsd:f},getAppState:C,setAppState:w,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{w(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{w(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:D};if(O&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of re(O,o,this.mutableMessages,U))yield e}let{messages:W,shouldQuery:Ee,allowedTools:ke,model:Ae,resultText:je}=await Ge({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...U,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...W);let G=[...this.mutableMessages];if(k&&W.length>0){let e=s(G);r()||(await e,(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await j())}let Ne=Qe(),Pe=W.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(Ne?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),Ie=T?Pe:[];w(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:ke}}}));let q=Ae??N;U={messages:G,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:l,mainLoopModel:q,thinkingConfig:P,mcpClients:c,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:_,appendSystemPrompt:v,theme:Ke(Te().theme),agentDefinitions:{activeAgents:E,allAgents:[]},maxBudgetUsd:f},getAppState:C,setAppState:w,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:U.updateFileHistoryState,updateAttributionState:U.updateAttributionState,setSDKStatus:D},S(`before_skills_plugins`);let[ze,{enabled:Ue}]=await Promise.all([h(Se()),he()]);if(S(`after_skills_plugins`),yield Ze({tools:o,mcpClients:c,model:q,permissionMode:M.toolPermissionContext.mode,commands:a,agents:E,skills:ze,plugins:Ue,fastMode:M.fastMode}),S(`system_message_yielded`),!Ee){for(let e of W)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:ye(e.message.content)},session_id:B(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!e.isCompactSummary,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly}),e.type===`system`&&e.subtype===`local_command`&&typeof e.content==`string`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))&&(yield We(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:B(),uuid:e.uuid,compact_metadata:He(t.compactMetadata)}}k&&(await s(G),(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await j()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-A,duration_api_ms:R(),num_turns:G.length-1,result:je??``,stop_reason:null,session_id:B(),total_cost_usd:I(),usage:this.totalUsage,modelUsage:L(),permission_denials:this.permissionDenials,fast_mode_state:K(q,M.fastMode),uuid:X()};return}if(_e()&&k){let e=Qe()?.selectableUserMessagesFilter??(e=>!0);W.filter(e).forEach(e=>{p(e=>{w(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let J=Ve,Y=1,qe=!1,Ye,Z=null,Q=Oe().at(-1),$e=x?de(this.mutableMessages,Le):0;for await(let e of le({messages:G,systemPrompt:Ce,userContext:V,systemContext:xe,canUseTool:fe,toolUseContext:U,fallbackModel:ae,querySource:`sdk`,maxTurns:d,taskBudget:g})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(k&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await s(this.mutableMessages.slice(0,e+1))}}if(G.push(e),k&&(e.type===`assistant`?s(G):await s(G)),!qe&&Ie.length>0){qe=!0;for(let e of Ie)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:B(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&Y++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Z=n),this.mutableMessages.push(t),yield*m(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),k&&(G.push(t),s(G)),yield*m(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*m(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){J=Ve;let e=t.message;J=me(J,e.usage)}if(t.type===`message_delta`){J=me(J,t.usage);let e=t.delta;e.stop_reason!=null&&(Z=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=te(this.totalUsage,J)),se&&(yield{type:`stream_event`,event:t,session_id:B(),parent_tool_use_id:null,uuid:X()});break}case`attachment`:{let n=e;this.mutableMessages.push(n),k&&(G.push(n),s(G));let r=n.attachment;if(r.type===`structured_output`)Ye=r.data;else if(r.type===`max_turns_reached`){k&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await j(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-A,duration_api_ms:R(),is_error:!0,num_turns:r.turnCount,stop_reason:Z,session_id:B(),total_cost_usd:I(),usage:this.totalUsage,modelUsage:L(),permission_denials:this.permissionDenials,fast_mode_state:K(q,M.fastMode),uuid:X(),errors:[`Reached maximum number of turns (${r.maxTurns})`]};return}else T&&r.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:r.prompt},session_id:B(),parent_tool_use_id:null,uuid:r.source_uuid||n.uuid,timestamp:n.timestamp,isReplay:!0});break}case`stream_request_start`:break;case`system`:{let t=e,n=this.config.snipReplay?.(t,this.mutableMessages);if(n!==void 0){n.executed&&(this.mutableMessages.length=0,this.mutableMessages.push(...n.messages));break}if(this.mutableMessages.push(t),t.subtype===`compact_boundary`&&t.compactMetadata){let e=t,n=this.mutableMessages.length-1;n>0&&this.mutableMessages.splice(0,n);let r=G.length-1;r>0&&G.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:B(),uuid:t.uuid,compact_metadata:He(e.compactMetadata)}}if(t.subtype===`api_error`){let e=t;yield{type:`system`,subtype:`api_retry`,attempt:e.retryAttempt,max_retries:e.maxRetries,retry_delay_ms:e.retryInMs,error_status:e.error.status??null,error:ue(e.error),session_id:B(),uuid:t.uuid}}break}case`tool_use_summary`:{let t=e;yield{type:`tool_use_summary`,summary:t.summary,preceding_tool_use_ids:t.precedingToolUseIds,session_id:B(),uuid:t.uuid};break}}if(f!==void 0&&I()>=f){k&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await j(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-A,duration_api_ms:R(),is_error:!0,num_turns:Y,stop_reason:Z,session_id:B(),total_cost_usd:I(),usage:this.totalUsage,modelUsage:L(),permission_denials:this.permissionDenials,fast_mode_state:K(q,M.fastMode),uuid:X(),errors:[`Reached maximum budget ($${f}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&x){let e=de(this.mutableMessages,Le)-$e,n=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=n){k&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await j(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-A,duration_api_ms:R(),is_error:!0,num_turns:Y,stop_reason:Z,session_id:B(),total_cost_usd:I(),usage:this.totalUsage,modelUsage:L(),permission_denials:this.permissionDenials,fast_mode_state:K(q,M.fastMode),uuid:X(),errors:[`Failed to provide valid structured output after ${n} attempts`]};return}}}let $=G.findLast(e=>e.type===`assistant`||e.type===`user`),et=$?.type??`undefined`,tt=$?.type===`assistant`?pe($.message.content)?.type??`none`:`n/a`;if(k&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await j(),!ie($,Z)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-A,duration_api_ms:R(),is_error:!0,num_turns:Y,stop_reason:Z,session_id:B(),total_cost_usd:I(),usage:this.totalUsage,modelUsage:L(),permission_denials:this.permissionDenials,fast_mode_state:K(q,M.fastMode),uuid:X(),errors:(()=>{let e=Oe(),t=Q?e.lastIndexOf(Q)+1:0;return[`[ede_diagnostic] result_type=${et} last_content_type=${tt} stop_reason=${Z}`,...e.slice(t).map(e=>e.error)]})()};return}let nt=``,rt=!1;if($.type===`assistant`){let e=pe($.message.content);e?.type===`text`&&!oe.has(e.text)&&(nt=e.text),rt=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:rt,duration_ms:Date.now()-A,duration_api_ms:R(),num_turns:Y,result:nt,stop_reason:Z,session_id:B(),total_cost_usd:I(),usage:this.totalUsage,modelUsage:L(),permission_denials:this.permissionDenials,structured_output:Ye,fast_mode_state:K(q,M.fastMode),uuid:X()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=O()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return B()}setModel(e){this.config.userSpecifiedModel=e}};async function*Q({commands:e,prompt:t,promptUuid:n,isMeta:r,cwd:i,tools:a,mcpClients:o,verbose:s=!1,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:f,canUseTool:ee,mutableMessages:p=[],getReadFileCache:te,setReadFileCache:m,customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:ne,fallbackModel:_,jsonSchema:v,getAppState:re,setAppState:ie,abortController:y,replayUserMessages:b=!1,includePartialMessages:ae=!1,handleElicitation:x,agents:S=[],setSDKStatus:C,orphanedPermission:w}){let T=new Z({cwd:i,tools:a,commands:e,mcpClients:o,agents:S??[],canUseTool:ee,getAppState:re,setAppState:ie,initialMessages:p,readFileCache:d(te()),customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:ne,fallbackModel:_,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:f,jsonSchema:v,verbose:s,handleElicitation:x,replayUserMessages:b,includePartialMessages:ae,setSDKStatus:C,abortController:y,orphanedPermission:w});try{yield*T.submitMessage(t,{uuid:n,isMeta:r})}finally{m(T.getReadFileState())}}export{Q as n,Ye as r,Z as t};
|