claude-code-best 2.6.5 → 2.6.8
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/README.md +3 -5
- package/dist/chunks/{AddWorkspaceDirectory-BYyM_V0q.js → AddWorkspaceDirectory-YmrkKVv2.js} +1 -1
- package/dist/chunks/{App-BboadKdn.js → App-IAjCdPUn.js} +1 -1
- package/dist/chunks/ApproveApiKey-CAvlRKLr.js +1 -0
- package/dist/chunks/{ApproveApiKey-BLp4742y.js → ApproveApiKey-DhsT69v7.js} +1 -1
- package/dist/chunks/{AssistantSessionChooser-B88DM0Oq.js → AssistantSessionChooser-DCUVNGfn.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-Di_gH2TW.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BeZqE75e.js +1 -0
- package/dist/chunks/{ClaudeInChromeOnboarding-B6XNhFqq.js → ClaudeInChromeOnboarding-CZHktpPE.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BNhlq7_K.js → ClaudeMdExternalIncludesDialog-Dofr1TYr.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DrkzPawC.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-CtqOQRDT.js +1 -0
- package/dist/chunks/{DesktopHandoff-S-w4bs5T.js → DesktopHandoff-C8_CDNft.js} +1 -1
- package/dist/chunks/DevChannelsDialog-DkGWCFpL.js +1 -0
- package/dist/chunks/DiffDialog-93P95op8.js +3 -0
- package/dist/chunks/Doctor-CheDaF3O.js +1 -0
- package/dist/chunks/Doctor-Zd0UaR5d.js +3 -0
- package/dist/chunks/{ExitFlow-CSBDxw9H.js → ExitFlow-4edARxmd.js} +2 -2
- package/dist/chunks/Feedback-CZY-BikO.js +2 -0
- package/dist/chunks/Grove-CbcR0CsI.js +1 -0
- package/dist/chunks/{Grove-DSXRnXKv.js → Grove-TYf1glGP.js} +1 -1
- package/dist/chunks/{HybridTransport-CuT3KI5e.js → HybridTransport-BNexuwcN.js} +2 -2
- package/dist/chunks/{ITermBackend-mokGZVH_.js → ITermBackend-DuomVpsD.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-Bi4RKYlk.js → InvalidConfigDialog-Byury3Zx.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-0zKo4-so.js → InvalidSettingsDialog-B8_0AvWo.js} +1 -1
- package/dist/chunks/MCPConnectionManager-xL_wQCda.js +1 -0
- package/dist/chunks/{McpParsingWarnings-EzgsOoHw.js → McpParsingWarnings-C6u4RM2a.js} +1 -1
- package/dist/chunks/MessageSelector-DAyH1noQ.js +3 -0
- package/dist/chunks/Messages-QH8_sB13.js +11 -0
- package/dist/chunks/{Onboarding-odmthwzz.js → Onboarding-XWhelEBr.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-Cpk_5Lv0.js → OverageCreditUpsell-BvPz1jLU.js} +1 -1
- package/dist/chunks/PluginSettings-D1YHfrE1.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-DrrkNOuS.js → PromptInputFooterSuggestions-rqUoa9Ch.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-DMsF4D6d.js → PromptInputHelpMenu-OTViHSR0.js} +1 -1
- package/dist/chunks/QueryEngine-DigBggXq.js +1 -0
- package/dist/chunks/REPL-Cxh0Qnnt.js +1 -0
- package/dist/chunks/REPL-D2p-vgct.js +97 -0
- package/dist/chunks/{RemoteCallout-CnpCWRPk.js → RemoteCallout-CCIWIrd-.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-OWg_Yccq.js → RemoteSessionManager-Dx81p5dH.js} +2 -2
- package/dist/chunks/ResumeConversation-73r3Zh5P.js +1 -0
- package/dist/chunks/{SSETransport-BpnapvlK.js → SSETransport-C9hd2v-w.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BNpA8JzR.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BFwcMSIK.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-C-NlfQZw.js → SentryErrorBoundary-z8tMb-zO.js} +1 -1
- package/dist/chunks/Settings-D9qdaMe5.js +2 -0
- package/dist/chunks/{TeleportProgress-CYXay2ZL.js → TeleportProgress-CPXN7u3Z.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-_zbZTvcJ.js → TeleportRepoMismatchDialog-CiyXjTxq.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-DiHQeZIM.js → TeleportResumeWrapper-Dao8ktHk.js} +1 -1
- package/dist/chunks/{ThemePicker-BRh027fA.js → ThemePicker-CFYFNnPp.js} +1 -1
- package/dist/chunks/{TmuxBackend-BaX2U7iZ.js → TmuxBackend-B5DBBugq.js} +1 -1
- package/dist/chunks/TrustDialog-DtIXHMR_.js +1 -0
- package/dist/chunks/{ValidationErrorsList-CdCUgfIl.js → ValidationErrorsList-BK0wOS55.js} +1 -1
- package/dist/chunks/{WelcomeV2-DCXcYd2x.js → WelcomeV2-BjUbi9vp.js} +1 -1
- package/dist/chunks/WindowsTerminalBackend-DFLLlAOp.js +2 -0
- package/dist/chunks/{add-dir-ldGd3Ppz.js → add-dir-JoVgNFOk.js} +1 -1
- package/dist/chunks/{agentDisplay-CVnAeURF.js → agentDisplay-B3RjWR-3.js} +1 -1
- package/dist/chunks/{agents-DH5fmbVw.js → agents-BUyLUAIu.js} +7 -7
- package/dist/chunks/{agents-C08NzRZx.js → agents-UqS5PhD2.js} +1 -1
- package/dist/chunks/{ant-DJren1Aa.js → ant-Bq1wIvnP.js} +1 -1
- package/dist/chunks/{api-CGOR_Xfl.js → api-O4eHGLTY.js} +1 -1
- package/dist/chunks/api-kAjsowcb.js +1 -0
- package/dist/chunks/{assistant-aWkDcurV.js → assistant-CMIbt3Ir.js} +1 -1
- package/dist/chunks/{assistant-BlzrMSkM.js → assistant-D5Tg_1ry.js} +1 -1
- package/dist/chunks/assistant-nOCkNa3_.js +1 -0
- package/dist/chunks/auth-CDOk9J9A.js +1 -0
- package/dist/chunks/{auth-CSB2RDKF.js → auth-D3SKo0wT.js} +1 -1
- package/dist/chunks/{autoMode-CWvZs1jO.js → autoMode-BIVJlkBM.js} +6 -6
- package/dist/chunks/{autonomy-DK42aJYt.js → autonomy-BYi6z9LD.js} +1 -1
- package/dist/chunks/{autonomy-BkVcSMCZ.js → autonomy-Mi7Fkq1J.js} +7 -7
- package/dist/chunks/{autonomyPanel-Cn4IhXgE.js → autonomyPanel-D_GsUMOf.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-BG_UYxFF.js +17 -0
- package/dist/chunks/backgroundHousekeeping-wHy1eAso.js +1 -0
- package/dist/chunks/{branch-juox_fko.js → branch-BC-K45fw.js} +1 -1
- package/dist/chunks/{bridge-DudsCZkh.js → bridge-DBteRzgS.js} +2 -2
- package/dist/chunks/{bridgeConfig-lRZfQqmA.js → bridgeConfig-C_GoD1k5.js} +1 -1
- package/dist/chunks/bridgeConfig-V_pmBzSH.js +1 -0
- package/dist/chunks/bridgeEnabled-BxtxHb8R.js +1 -0
- package/dist/chunks/{bridgeEnabled-D2IykaHE.js → bridgeEnabled-cSK8a7tN.js} +1 -1
- package/dist/chunks/bridgeMain-CMNptMs4.js +1 -0
- package/dist/chunks/bridgeMain-QbfEOTqV.js +68 -0
- package/dist/chunks/{bridgeMessaging-CqNURC4-.js → bridgeMessaging-CqXQzew4.js} +1 -1
- package/dist/chunks/{btw-DKlE3Dea.js → btw-DBtPlEWc.js} +1 -1
- package/dist/chunks/{buddy-DQYgHR63.js → buddy-BYwTgNnf.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-Bof-UtM-.js → bypassPermissionsKillswitch-DkYLp9m0.js} +1 -1
- package/dist/chunks/caches-B-GiT9hm.js +1 -0
- package/dist/chunks/{caches-B5QZDncQ.js → caches-DGW9ovtw.js} +2 -2
- package/dist/chunks/{ccrClient-BaWg4E9-.js → ccrClient-B9pi3b8Y.js} +1 -1
- package/dist/chunks/changeDetector-S1Jti1bW.js +1 -0
- package/dist/chunks/channelNotification-Bx6dpA7I.js +1 -0
- package/dist/chunks/{channelNotification-B7A-9DIl.js → channelNotification-n7Avue-9.js} +1 -1
- package/dist/chunks/{chrome-jMAks7-w.js → chrome-BwZPfW9Z.js} +1 -1
- package/dist/chunks/clear-BXv0Sq3m.js +1 -0
- package/dist/chunks/client-DNQukPEE.js +1 -0
- package/dist/chunks/color-BsBrog6H.js +1 -0
- package/dist/chunks/commands-BK3ugb0u.js +1 -0
- package/dist/chunks/commitAttribution-CtQYmnw-.js +1 -0
- package/dist/chunks/{commitAttribution-C22a3OCi.js → commitAttribution-q7SEukgl.js} +1 -1
- package/dist/chunks/{compact-BWvnb4or.js → compact-DiY1w7pT.js} +3 -3
- package/dist/chunks/{companion-Bkn2lSLj.js → companion-D18UNnC7.js} +1 -1
- package/dist/chunks/{config-BvpTbJ5p.js → config-CSHnElBp.js} +1 -1
- package/dist/chunks/{config-D-dzD6n-.js → config-D3QKcEKz.js} +1 -1
- package/dist/chunks/{context-DzNahdyP.js → context-DnyYrN2X.js} +1 -1
- package/dist/chunks/context-noninteractive-0YpW67KZ.js +1 -0
- package/dist/chunks/{context-noninteractive-yiyJriiw.js → context-noninteractive-CFlod2Eg.js} +2 -2
- package/dist/chunks/conversation-CRoOMglD.js +1 -0
- package/dist/chunks/conversation-DCG0fiGV.js +1 -0
- package/dist/chunks/{copy-9k9JPRqW.js → copy-CHGX-YpC.js} +2 -2
- package/dist/chunks/{createSSHSession-BZf-Loo5.js → createSSHSession-Bf-8h3Sw.js} +1 -1
- package/dist/chunks/createSession-BYf27ahD.js +1 -0
- package/dist/chunks/{createSession-kiTHYXSL.js → createSession-rRZIkjl3.js} +1 -1
- package/dist/chunks/{cronJitterConfig-CYP7yrQu.js → cronJitterConfig-DmBBJDTf.js} +3 -3
- package/dist/chunks/crossProjectResume-BQxLBpDD.js +40 -0
- package/dist/chunks/{datadog-Bg-zL-i7.js → datadog-Bb65d6yd.js} +1 -1
- package/dist/chunks/datadog-NnzM1Mu3.js +1 -0
- package/dist/chunks/{desktop-DpaStjc-.js → desktop-DiCA6RUU.js} +1 -1
- package/dist/chunks/{diff-N_VSBo3Z.js → diff-BvLQ-t8P.js} +1 -1
- package/dist/chunks/{doctor-CUWjbh1X.js → doctor-bmTXLycZ.js} +1 -1
- package/dist/chunks/{effort-loH1TUvE.js → effort-CSTwkB2B.js} +2 -2
- package/dist/chunks/{entry-D58E-E6Y.js → entry-BUwwv2dM.js} +4 -4
- package/dist/chunks/{envLessBridgeConfig-SPEr9oqO.js → envLessBridgeConfig-DJJKeDBT.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-Dq02Vvx1.js +1 -0
- package/dist/chunks/{exit-D-tuPpbx.js → exit-eirVuF-n.js} +1 -1
- package/dist/chunks/{export-BIZ_SPXJ.js → export-CcJD8r8U.js} +1 -1
- package/dist/chunks/{exportRenderer-CWPSMaqM.js → exportRenderer-DtezFcml.js} +1 -1
- package/dist/chunks/{extra-usage-CCMwIa85.js → extra-usage-CBcgeIcJ.js} +1 -1
- package/dist/chunks/extra-usage-DhB0NElh.js +1 -0
- package/dist/chunks/{extra-usage-core-BNW4VT7o.js → extra-usage-core-DWM0Q56J.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-B_WjXO1E.js → extra-usage-noninteractive-BvJEi4WX.js} +1 -1
- package/dist/chunks/{extraUsage-CNMMTNJi.js → extraUsage-CWde-Mi0.js} +1 -1
- package/dist/chunks/extractMemories-wcRNh_jz.js +1 -0
- package/dist/chunks/{fast-CG1v3fRr.js → fast-DQyJ7c7s.js} +1 -1
- package/dist/chunks/fast-ukzN3wl2.js +1 -0
- package/dist/chunks/{feedback-CG4mS_-B.js → feedback-BzBBKT2y.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-Y_jAnHoR.js → firstPartyEventLogger-BOHIpp-w.js} +1 -1
- package/dist/chunks/{flushGate-COPcye5f.js → flushGate-DeCDhkKp.js} +1 -1
- package/dist/chunks/{gates-CSKxLmMJ.js → gates-CAVdjC23.js} +1 -1
- package/dist/chunks/gates-CB_pFChT.js +1 -0
- package/dist/chunks/{gemini-B3uSLiNp.js → gemini-CFrOUVS4.js} +1 -1
- package/dist/chunks/{generateRecap-D7rG3jIm.js → generateRecap-Bcp5DiiO.js} +1 -1
- package/dist/chunks/{generateSessionName-zbqanivg.js → generateSessionName-DeFGkHct.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-B04nEUDG.js → githubRepoPathMapping-B07Wb07_.js} +1 -1
- package/dist/chunks/grok-DtidcVWD.js +1 -0
- package/dist/chunks/{growthbook-C_EY78Sn.js → growthbook-gLwBDK-r.js} +1 -1
- package/dist/chunks/{heapdump-CpmhJ55b.js → heapdump-BxQYlnPR.js} +1 -1
- package/dist/chunks/{help-EHn2neTv.js → help-Bi0sABuv.js} +1 -1
- package/dist/chunks/hooks-BTBhK9sh.js +1 -0
- package/dist/chunks/{hooks-BV6HqbU4.js → hooks-Cc_DxF9N.js} +2 -2
- package/dist/chunks/{hostAdapter-_SmFAVNf.js → hostAdapter-D9_d4gU0.js} +1 -1
- package/dist/chunks/{ide-DkN0KdTR.js → ide-3wDIOoZF.js} +2 -2
- package/dist/chunks/inboundAttachments-DBaPmCTv.js +1 -0
- package/dist/chunks/{inboundAttachments-DnGQw7Pf.js → inboundAttachments-DPMETKd6.js} +1 -1
- package/dist/chunks/initReplBridge-BWP41EGm.js +1 -0
- package/dist/chunks/{insights-Bs9kJDG6.js → insights-w7qM4YyA.js} +24 -24
- package/dist/chunks/{install-CFX_ph9z.js → install-N2FgArWv.js} +1 -1
- package/dist/chunks/{install-github-app-CvRjY1Wi.js → install-github-app-By39Zi78.js} +2 -2
- package/dist/chunks/{install-slack-app-DjhnVSe0.js → install-slack-app-CVwZphU-.js} +1 -1
- package/dist/chunks/{instrumentation-c5zlOWom.js → instrumentation-BkLEupDC.js} +3 -3
- package/dist/chunks/{job-3QwLq609.js → job-CgBE27O7.js} +1 -1
- package/dist/chunks/{keybindings-7mDm3UKD.js → keybindings-DHXJzU3E.js} +2 -2
- package/dist/chunks/{lang-DyyjY20G.js → lang-DLneRt1b.js} +1 -1
- package/dist/chunks/{language-CPRGmY8Q.js → language-BVAzlrRz.js} +1 -1
- package/dist/chunks/language-ZBygqv6V.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-CpsMsTqQ.js → launchAgentsPlatform-CtfK0qPa.js} +1 -1
- package/dist/chunks/launchAutofixPr-CQBv0rQ0.js +18 -0
- package/dist/chunks/{launchLocalMemory-DlYQcEQJ.js → launchLocalMemory-BNE09TKr.js} +2 -2
- package/dist/chunks/{launchLocalVault-CP0AyPjj.js → launchLocalVault-Dw_NJUnd.js} +3 -3
- package/dist/chunks/{launchMemoryStores-BHoDFkJ5.js → launchMemoryStores-CRRB6Z5A.js} +1 -1
- package/dist/chunks/{launchOnboarding-CFTNXcnc.js → launchOnboarding-nMAF5iv7.js} +1 -1
- package/dist/chunks/{launchSchedule-5KQr6x_A.js → launchSchedule-Akq1AmK8.js} +1 -1
- package/dist/chunks/{launchSkillStore-D0yGuE68.js → launchSkillStore-Zwtasj13.js} +1 -1
- package/dist/chunks/{launchTeleport-DRKnXOwY.js → launchTeleport-BzlIYyll.js} +3 -3
- package/dist/chunks/{launchVault-XA-zAswX.js → launchVault-BevXlxJB.js} +1 -1
- package/dist/chunks/{loadAgentsDir-DI1a76pd.js → loadAgentsDir-DF6FgRn-.js} +812 -785
- package/dist/chunks/loadAgentsDir-OIIKHPq9.js +1 -0
- package/dist/chunks/loadPluginHooks-DBHkyJaj.js +1 -0
- package/dist/chunks/localSearch-DslXIfeC.js +1 -0
- package/dist/chunks/{localSearch-CDOJNc_E.js → localSearch-v4itMlCM.js} +1 -1
- package/dist/chunks/{login-nwTOoyxv.js → login-CKodBzyZ.js} +1 -1
- package/dist/chunks/login-CTIVwgFU.js +1 -0
- package/dist/chunks/{logoV2Utils-DDUoPClc.js → logoV2Utils-VebeEs7Y.js} +1 -1
- package/dist/chunks/logout-B3MyP8fk.js +1 -0
- package/dist/chunks/{magicDocs-CmUlOWjI.js → magicDocs-uX5n3NKh.js} +2 -2
- package/dist/chunks/{main-CeG_nUsC.js → main-Cd_i0ZPo.js} +40 -40
- package/dist/chunks/{mappers-CJ8IO1o1.js → mappers-CPL2ni36.js} +1 -1
- package/dist/chunks/{mcp-CanCqnch.js → mcp-Ci_TbB5m.js} +2 -2
- package/dist/chunks/mcp-DeWOD4B4.js +1 -0
- package/dist/chunks/mcp-Dhp1SaId.js +6 -0
- package/dist/chunks/{mcpServer-lIneUZ5p.js → mcpServer-CPJo2eKm.js} +1 -1
- package/dist/chunks/{mcpServer-DPHQVYdC.js → mcpServer-CTuPkyD6.js} +1 -1
- package/dist/chunks/{memory-BcWBkKV8.js → memory-enMuKEnU.js} +1 -1
- package/dist/chunks/{model-DJLzVvcF.js → model-4f3U2YMu.js} +1 -1
- package/dist/chunks/model-BsHyPvD0.js +1 -0
- package/dist/chunks/{onChangeAppState-Dxbl8fvk.js → onChangeAppState-DxTGoS7j.js} +1 -1
- package/dist/chunks/openai-CwG_KpH1.js +10 -0
- package/dist/chunks/openaiShared-Bjrci9n8.js +1 -0
- package/dist/chunks/{overageCreditGrant-DLKadMYU.js → overageCreditGrant-CCkJVN9k.js} +1 -1
- package/dist/chunks/{passes-BIfuerjL.js → passes-O0VEQz1a.js} +1 -1
- package/dist/chunks/{paths-BBvuDQl9.js → paths-o5iA-EnQ.js} +6 -6
- package/dist/chunks/permissions-BtYQvivG.js +3 -0
- package/dist/chunks/{pipeTransport-DVoIA1uN.js → pipeTransport-BEfqa7Uh.js} +1 -1
- package/dist/chunks/{plan--lnWxB3Q.js → plan-Jw4GjVL0.js} +1 -1
- package/dist/chunks/{plugin-DWLyrLw4.js → plugin-DZq0voFR.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-CGXIWBrb.js → pluginAutoupdate-D19vNoOp.js} +1 -1
- package/dist/chunks/{pluginBlocklist-DJrMdzT0.js → pluginBlocklist-DeX8I4dK.js} +1 -1
- package/dist/chunks/{pluginCliCommands-C08q9dHk.js → pluginCliCommands-CMgqxOaT.js} +1 -1
- package/dist/chunks/{pluginFlagging-Dggxke70.js → pluginFlagging-DFLE5fkh.js} +1 -1
- package/dist/chunks/{pluginOperations-CNCImIe8.js → pluginOperations-BTz69m3_.js} +2 -2
- package/dist/chunks/{pluginStartupCheck-BW2fjg2P.js → pluginStartupCheck-CWWKwD5F.js} +1 -1
- package/dist/chunks/pluginStartupCheck-Non969kz.js +1 -0
- package/dist/chunks/{plugins-DQ3CRWWO.js → plugins-BPUnAc0r.js} +4 -4
- package/dist/chunks/policyLimits-D6dpS-CU.js +1 -0
- package/dist/chunks/{pollConfig-DAQ-ives.js → pollConfig-DyHumJli.js} +1 -1
- package/dist/chunks/{poor-DqfrQT61.js → poor-CHHZIPDW.js} +1 -1
- package/dist/chunks/{poorMode-DzYT47KW.js → poorMode-7N6J6YN2.js} +1 -1
- package/dist/chunks/poorMode-DX4EXe0o.js +1 -0
- package/dist/chunks/print-QCXJDmz0.js +39 -0
- package/dist/chunks/{privacy-settings-agwqjYJo.js → privacy-settings-DR0_P3JF.js} +1 -1
- package/dist/chunks/processBashCommand-CkqKsBSD.js +1 -0
- package/dist/chunks/processSlashCommand-DIk_hLHW.js +6 -0
- package/dist/chunks/prompt-2ia5b-QO.js +1 -0
- package/dist/chunks/prompt-CNtVpGdl.js +1 -0
- package/dist/chunks/{prompt-CjFAtm3w.js → prompt-DiHksuOs.js} +1 -1
- package/dist/chunks/{promptEditor-EgosPsy-.js → promptEditor-B3S5E5Q7.js} +2 -2
- package/dist/chunks/{protocolHandler-mtPUT9U0.js → protocolHandler-D1XT2l3j.js} +1 -1
- package/dist/chunks/rate-limit-options-DHh1ksB5.js +1 -0
- package/dist/chunks/rcDebugLog-BNojB_eB.js +11 -0
- package/dist/chunks/{referral-DeDr9zAE.js → referral-BADm5sBf.js} +1 -1
- package/dist/chunks/refresh-D48fjYJ4.js +1 -0
- package/dist/chunks/{registerProtocol-BZBH8Zgl.js → registerProtocol-Dzmi6VC4.js} +1 -1
- package/dist/chunks/{registry-Dz6AbiYP.js → registry-CEu_N3dS.js} +1 -1
- package/dist/chunks/{release-notes-DiUNOrg9.js → release-notes-Dr61jYDO.js} +1 -1
- package/dist/chunks/{releaseNotes-CnhQit0y.js → releaseNotes-5SV7C5aV.js} +2 -2
- package/dist/chunks/{reload-plugins-Dx52GcaG.js → reload-plugins-BxuE-21F.js} +1 -1
- package/dist/chunks/{remote-env-B67Oo3sI.js → remote-env-BaQjT5em.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-BzSUgPbt.js → remoteBridgeCore-B8MjcW6f.js} +1 -1
- package/dist/chunks/{remoteControlServer-L8smP7Zu.js → remoteControlServer-BvoNcg9D.js} +2 -2
- package/dist/chunks/{rename-C4PauyTZ.js → rename-B3q0tgmd.js} +1 -1
- package/dist/chunks/{resume-CrSn26xq.js → resume-BSGOqus7.js} +2 -2
- package/dist/chunks/{runtimeObserver-YNy3mIb7.js → runtimeObserver-Bb6wSUMJ.js} +1 -1
- package/dist/chunks/{runtimeObserver-nAhH4Wca.js → runtimeObserver-BbwUiToa.js} +2 -2
- package/dist/chunks/sandbox-adapter-Cr6f6gjf.js +1 -0
- package/dist/chunks/{sandbox-toggle-BYqbcI5d.js → sandbox-toggle-L7YPKXba.js} +1 -1
- package/dist/chunks/searchExtraTools-DRVIhwVJ.js +1 -0
- package/dist/chunks/{sentry-BNVxoVLS.js → sentry-DG3ru8XE.js} +1 -1
- package/dist/chunks/{session-BuEmHrqM.js → session-B5wA2K9M.js} +2 -2
- package/dist/chunks/{sessionDiscovery-Mcsfa0g-.js → sessionDiscovery-DijWFNjj.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-DnbPctQc.js +1 -0
- package/dist/chunks/sessionMemory-BOT9f5f0.js +1 -0
- package/dist/chunks/sessionMemory-CeWjRuFL.js +1 -0
- package/dist/chunks/sessionMemoryUtils-B47JMJa2.js +1 -0
- package/dist/chunks/sessionObserver-BNZflr2e.js +1 -0
- package/dist/chunks/{sessionObserver-DG2zQgfi.js → sessionObserver-CsDT2GnB.js} +1 -1
- package/dist/chunks/sessionStorage-BUuPrnU0.js +1 -0
- package/dist/chunks/{sessionTitle-zUVSAHO7.js → sessionTitle-CxmvZO71.js} +2 -2
- package/dist/chunks/{sessionTracing-DoRJ4nSa.js → sessionTracing-Cy5dAplG.js} +1 -1
- package/dist/chunks/{settingsSync-B9bz77E1.js → settingsSync-54E8xV8N.js} +1 -1
- package/dist/chunks/setup-B5CMpp0c.js +2 -0
- package/dist/chunks/{setup-CCOLlRtP.js → setup-GJtdESQj.js} +1 -1
- package/dist/chunks/{setup-B1JbPepL.js → setup-KWELOokh.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-BBR3uEgx.js → shadowedRuleDetection-C4NGjljb.js} +1 -1
- package/dist/chunks/{sideQuestion-DHW5rgKz.js → sideQuestion-DBrzdgkl.js} +1 -1
- package/dist/chunks/{sink-DxDOsLa2.js → sink-BKc24wdw.js} +1 -1
- package/dist/chunks/sink-DG0SNHP7.js +1 -0
- package/dist/chunks/{sinks-BrrTUxkC.js → sinks-BTS1DWM4.js} +2 -2
- package/dist/chunks/sinks-Cbp-8X1S.js +1 -0
- package/dist/chunks/{skill-learning-C0nOKZfg.js → skill-learning-C5NrosiL.js} +1 -1
- package/dist/chunks/skillChangeDetector-NJrEtU47.js +1 -0
- package/dist/chunks/{skillGapStore-_YuJP5KI.js → skillGapStore-D1rkePoo.js} +2 -2
- package/dist/chunks/{skillGapStore-Czi5jKjJ.js → skillGapStore-uXpRqLGG.js} +1 -1
- package/dist/chunks/{skillGenerator-kbaRbpqJ.js → skillGenerator-Deog7yBO.js} +2 -2
- package/dist/chunks/skillLearning-BHjRTDJw.js +1 -0
- package/dist/chunks/skillLearning-By7jxHSI.js +1 -0
- package/dist/chunks/{skillPanel-BxDvlPzd.js → skillPanel-Bx63GX9w.js} +3 -3
- package/dist/chunks/{skillSearchPanel-D-MX6Qgt.js → skillSearchPanel-CM5EZGkH.js} +4 -4
- package/dist/chunks/{skills-NpEgFkFZ.js → skills-JvC7Ms0P.js} +1 -1
- package/dist/chunks/{sprites-DD4eIkN7.js → sprites-YBiqlYch.js} +1 -1
- package/dist/chunks/{stats-xL3NHwhp.js → stats-BJMKNvVK.js} +1 -1
- package/dist/chunks/{status-B5E70xRv.js → status-DAJ28yxZ.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-DcssRhLw.js → statusNoticeHelpers-B7nbsqLz.js} +1 -1
- package/dist/chunks/{tag-BELr-qIa.js → tag-B4y7cBqH.js} +1 -1
- package/dist/chunks/{tasks-CrdWcSt-.js → tasks-CSye58Ap.js} +1 -1
- package/dist/chunks/{teamHelpers--3ZyNDlv.js → teamHelpers-BFZ4eVwW.js} +1 -1
- package/dist/chunks/teamHelpers-CKBoDEPj.js +1 -0
- package/dist/chunks/teammateModeSnapshot-BfOLEMKn.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-DOQMTKbQ.js → teammateModeSnapshot-DXc2vyo2.js} +1 -1
- package/dist/chunks/teleport-NN6zSxxe.js +1 -0
- package/dist/chunks/{templateJobs-8IY2Cgig.js → templateJobs-DAVqqU0g.js} +1 -1
- package/dist/chunks/{terminalSetup-Lyg4NbGA.js → terminalSetup-DqL65XR2.js} +1 -1
- package/dist/chunks/{terminalSetup-C4psrmpb.js → terminalSetup-jZKBoPTc.js} +1 -1
- package/dist/chunks/{theme-B8GNnJ_q.js → theme-DPv2L3ut.js} +1 -1
- package/dist/chunks/thinkback-B0OSwcPG.js +1 -0
- package/dist/chunks/thinkback-play-D_uOESmO.js +1 -0
- package/dist/chunks/thinkback-tcfR5Uod.js +1 -0
- package/dist/chunks/{toolEventObserver-DzLd0MSn.js → toolEventObserver-CtApZXry.js} +1 -1
- package/dist/chunks/{toolEventObserver-D0TSHm01.js → toolEventObserver-D6ZTtdh_.js} +1 -1
- package/dist/chunks/toolPool-DFpa-yul.js +1 -0
- package/dist/chunks/toolPool-DqemSx_r.js +1 -0
- package/dist/chunks/{trustedDevice-BvYYXfd8.js → trustedDevice-Bxn7WW5C.js} +1 -1
- package/dist/chunks/{trustedDevice-1iTu4LEm.js → trustedDevice-DsgCQRsJ.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-BTXAN2wP.js → ultrareviewCommand-BfuSrdXz.js} +2 -2
- package/dist/chunks/undercover-B-R6dhHB.js +1 -0
- package/dist/chunks/{undercover-DvvnEmsX.js → undercover-CM8zTx5g.js} +1 -1
- package/dist/chunks/{updateCCB-C-qfLi0j.js → updateCCB-DTArxdyR.js} +4 -4
- package/dist/chunks/upgrade-CCrHxXrm.js +1 -0
- package/dist/chunks/{upgrade-DTBZSxwv.js → upgrade-CEd1Jxw_.js} +1 -1
- package/dist/chunks/{upload-BF8tf_Eo.js → upload-DNo3bZLc.js} +1 -1
- package/dist/chunks/{usage-DvSTXEYY.js → usage-DEwRsc7E.js} +1 -1
- package/dist/chunks/{usage-BRYRRgNt.js → usage-X4-qec8g.js} +1 -1
- package/dist/chunks/useMainLoopModel-2A9HV1H3.js +1 -0
- package/dist/chunks/{useManagePlugins-GmnI9K53.js → useManagePlugins-D9MBag8O.js} +1 -1
- package/dist/chunks/{useMergedTools-Dah5KDMi.js → useMergedTools-DCYrP_YE.js} +1 -1
- package/dist/chunks/{useSearchInput-BV_azHiA.js → useSearchInput-CepwLBvi.js} +1 -1
- package/dist/chunks/useSettingsErrors-C8ffWXbY.js +1 -0
- package/dist/chunks/{useVoice-DR69NLxp.js → useVoice-vHZVaTAN.js} +1 -1
- package/dist/chunks/{util-BpyJ4Bom.js → util-B13MVSse.js} +1 -1
- package/dist/chunks/utils-C-vk0zpl.js +1 -0
- package/dist/chunks/{validatePlugin-vptAYuYu.js → validatePlugin-Cf_toBOJ.js} +1 -1
- package/dist/chunks/{vim-DvOw8dfR.js → vim-6p7eiRPG.js} +1 -1
- package/dist/chunks/{voice-B3BZs53f.js → voice-Bvc_BxoI.js} +2 -2
- package/dist/chunks/{voiceModeEnabled-DA76xN1Q.js → voiceModeEnabled-BPbOh6jd.js} +1 -1
- package/dist/chunks/voiceModeEnabled-JSBux8GA.js +1 -0
- package/dist/chunks/{voiceStreamSTT-_w1VjIOs.js → voiceStreamSTT-CzCUhap3.js} +1 -1
- package/dist/chunks/voiceStreamSTT-D9ER6Ml3.js +1 -0
- package/dist/chunks/{workerRegistry-2_MZVih1.js → workerRegistry-DCtC-WN3.js} +1 -1
- package/dist/chunks/worktree-Dv0mPuy_.js +1 -0
- package/dist/chunks/{xml-Dx--sNE1.js → xml-CqxiCY4v.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-DiEe4eui.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-ByraVuXh.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-BDvmz12S.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +0 -1
- package/dist/chunks/DevChannelsDialog-BljR0X9X.js +0 -1
- package/dist/chunks/DiffDialog-BhQ2QaLW.js +0 -3
- package/dist/chunks/Doctor-BXb0qv6n.js +0 -3
- package/dist/chunks/Doctor-C5DYPEGl.js +0 -1
- package/dist/chunks/Feedback-DwHzc4UT.js +0 -2
- package/dist/chunks/Grove-DnTo982-.js +0 -1
- package/dist/chunks/MCPConnectionManager-DYGoS1Ht.js +0 -1
- package/dist/chunks/MessageSelector-DTmUuEKJ.js +0 -3
- package/dist/chunks/Messages-DWiKTx5o.js +0 -11
- package/dist/chunks/PluginSettings-eYcWehI8.js +0 -17
- package/dist/chunks/QueryEngine-C_KZts4y.js +0 -1
- package/dist/chunks/REPL-C6YR0VKU.js +0 -1
- package/dist/chunks/REPL-DzHz-LOY.js +0 -97
- package/dist/chunks/ResumeConversation-BktSnsCm.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +0 -1
- package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +0 -1
- package/dist/chunks/Settings-vfFvcweR.js +0 -2
- package/dist/chunks/TrustDialog-CVbzrv6g.js +0 -1
- package/dist/chunks/WindowsTerminalBackend-BE9NX5IH.js +0 -2
- package/dist/chunks/api-6tcwJlf_.js +0 -1
- package/dist/chunks/assistant-CwbhlCM-.js +0 -1
- package/dist/chunks/auth-GxZhOvQ1.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BIZTAYho.js +0 -17
- package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +0 -1
- package/dist/chunks/bridgeConfig-D4tpc568.js +0 -1
- package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +0 -1
- package/dist/chunks/bridgeMain-C5RDihlX.js +0 -68
- package/dist/chunks/bridgeMain-D7_lg2iJ.js +0 -1
- package/dist/chunks/caches-dGk7xsDu.js +0 -1
- package/dist/chunks/changeDetector-DoLfg8a6.js +0 -1
- package/dist/chunks/channelNotification-DDErroWn.js +0 -1
- package/dist/chunks/clear-OudnCGa7.js +0 -1
- package/dist/chunks/client-DxDmXXTh.js +0 -1
- package/dist/chunks/color-DG_R5-hl.js +0 -1
- package/dist/chunks/commands-BWIOEBPs.js +0 -1
- package/dist/chunks/commitAttribution-BA4fcbHf.js +0 -1
- package/dist/chunks/context-noninteractive-CM1-lUSe.js +0 -1
- package/dist/chunks/conversation-DKlz47xf.js +0 -1
- package/dist/chunks/conversation-cUxdb8MN.js +0 -1
- package/dist/chunks/createSession-BuJcoBAj.js +0 -1
- package/dist/chunks/crossProjectResume-BJisir9Z.js +0 -40
- package/dist/chunks/datadog-CVeFkaQu.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +0 -1
- package/dist/chunks/extra-usage-rdJ7ecEb.js +0 -1
- package/dist/chunks/extractMemories-BrvZVsmM.js +0 -1
- package/dist/chunks/fast-CLKKsx2H.js +0 -1
- package/dist/chunks/gates-CSHuXnUx.js +0 -1
- package/dist/chunks/grok-CDOpos8E.js +0 -1
- package/dist/chunks/hooks-BFdX17Za.js +0 -1
- package/dist/chunks/inboundAttachments-BVUunfAX.js +0 -1
- package/dist/chunks/initReplBridge-tPRGPBq7.js +0 -1
- package/dist/chunks/language-Cf6bMI4N.js +0 -1
- package/dist/chunks/launchAutofixPr-D9h6YAZY.js +0 -2
- package/dist/chunks/loadAgentsDir-DCyiY0MN.js +0 -1
- package/dist/chunks/loadPluginHooks-C0Ei-0E2.js +0 -1
- package/dist/chunks/localSearch-MBx7KzC2.js +0 -1
- package/dist/chunks/login-D8UKKaud.js +0 -1
- package/dist/chunks/logout-B0BjqlGi.js +0 -1
- package/dist/chunks/mcp-Dq0kxZFx.js +0 -6
- package/dist/chunks/mcp-zbxZM9BP.js +0 -1
- package/dist/chunks/model-H3rtl6eR.js +0 -1
- package/dist/chunks/openai-DkYK4THc.js +0 -10
- package/dist/chunks/openaiShared-D5lOejS1.js +0 -16
- package/dist/chunks/permissions-S2EvIRKj.js +0 -3
- package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +0 -1
- package/dist/chunks/policyLimits-BotYrS-v.js +0 -1
- package/dist/chunks/poorMode-DEAe3hiK.js +0 -1
- package/dist/chunks/print-GGVp62vj.js +0 -39
- package/dist/chunks/processBashCommand-DHHN8Ca4.js +0 -1
- package/dist/chunks/processSlashCommand-COtIO6Jy.js +0 -6
- package/dist/chunks/prompt-CO160cIr.js +0 -1
- package/dist/chunks/prompt-GY9hlRvI.js +0 -1
- package/dist/chunks/rate-limit-options-C6SFOHue.js +0 -1
- package/dist/chunks/rcDebugLog-CPKZCtR8.js +0 -11
- package/dist/chunks/refresh-D7pdoY_X.js +0 -1
- package/dist/chunks/sandbox-adapter-CzwHes1i.js +0 -1
- package/dist/chunks/searchExtraTools-CcpdCO6l.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +0 -1
- package/dist/chunks/sessionMemory-CMahwDdW.js +0 -1
- package/dist/chunks/sessionMemory-pFSn4HSN.js +0 -1
- package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +0 -1
- package/dist/chunks/sessionObserver-Je868MC9.js +0 -1
- package/dist/chunks/sessionStorage-D3FhAADV.js +0 -1
- package/dist/chunks/setup-DWkSjA49.js +0 -2
- package/dist/chunks/sink-cQOgsnw3.js +0 -1
- package/dist/chunks/sinks-Djiz_5-Z.js +0 -1
- package/dist/chunks/skillChangeDetector-D8C-uQSQ.js +0 -1
- package/dist/chunks/skillLearning-3KWrBczS.js +0 -1
- package/dist/chunks/skillLearning-DBbdGbk-.js +0 -1
- package/dist/chunks/teamHelpers-CUAiXng3.js +0 -1
- package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +0 -1
- package/dist/chunks/teleport-LXFOan9C.js +0 -1
- package/dist/chunks/thinkback-DPXwEK3B.js +0 -1
- package/dist/chunks/thinkback-DZW3Mcx_.js +0 -1
- package/dist/chunks/thinkback-play-BMOE-ceh.js +0 -1
- package/dist/chunks/toolPool-DVOfpjDz.js +0 -1
- package/dist/chunks/toolPool-Dq-Vtvrj.js +0 -1
- package/dist/chunks/undercover-C_44e3oN.js +0 -1
- package/dist/chunks/upgrade-CGXa5Dwy.js +0 -1
- package/dist/chunks/useMainLoopModel-CwvuTRXn.js +0 -1
- package/dist/chunks/useSettingsErrors-C-j_Zt7g.js +0 -1
- package/dist/chunks/utils-CrZcpypC.js +0 -1
- package/dist/chunks/voiceModeEnabled-DIveLYGb.js +0 -1
- package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +0 -1
- package/dist/chunks/worktree-CCuDwRmS.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,t as a,tn as ee,tt as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{cn as l,jr as u,ot as te}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{Ar as h,Kr as g,Lo as _,Lw as v,MS as ne,Mr as re,PS as ie,Vr as ae,Yn as oe,_m as y,_o as se,ar as ce,cE as b,cd as x,di as S,ei as C,fi as w,gE as T,gy as E,hE as le,jS as D,my as O,o as ue,pd as de,sE as k,u as fe,vm as pe,vv as A,wi as me,yv as he}from"./loadAgentsDir-DI1a76pd.js";import{t as j}from"./useKeybinding-FsOnjW6T.js";import{r as M}from"./asciicast-o5Zg4dJt.js";import{a as N,n as P,s as F}from"./skillChangeDetector-D8C-uQSQ.js";import{a as I,i as L,n as R,o as z,r as ge,t as _e}from"./crossProjectResume-BJisir9Z.js";import{t as ve}from"./REPL-DzHz-LOY.js";import{dirname as ye}from"path";var B=t(r(),1);v(),l(),z(),E(),y(),a(),j(),d(),D(),T(),L(),x(),A(),R(),p(),_(),h();var V=c();function be(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function H({commands:t,worktreePaths:r,initialTools:a,mcpClients:o,dynamicMcpConfig:c,debug:l,mainThreadAgentDefinition:d,autoConnectIdeFlag:p,strictMcpConfig:_=!1,systemPrompt:v,appendSystemPrompt:y,initialSearchQuery:x,disableSlashCommands:T=!1,forkSession:E,taskListId:D,filterByPr:A,thinkingConfig:j,onTurnComplete:L}){let{rows:R}=n(),z=ne(e=>e.agentDefinitions),H=ie(),[U,W]=B.useState([]),[Ce,G]=B.useState(!0),[we,Te]=B.useState(!1),[K,Ee]=B.useState(!1),[q,De]=B.useState(null),[J,Oe]=B.useState(null),Y=B.useRef(null),X=B.useRef(0),Z=B.useMemo(()=>{let e=U.filter(e=>!e.isSidechain);if(A!==void 0){if(A===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof A==`number`)e=e.filter(e=>e.prNumber===A);else if(typeof A==`string`){let t=be(A);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,A]),ke=re();B.useEffect(()=>{g(r).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{m(e),G(!1)})},[r]);let Q=B.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||ce(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=B.useCallback(e=>{G(!0),(e?ae():g(r)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{m(e)}).finally(()=>{G(!1)})},[r]),Ae=B.useCallback(()=>{let e=!K;Ee(e),$(e)},[K,$]);function je(){process.exit(1)}async function Me(t){Te(!0);let n=performance.now(),i=_e(t,K,r);if(i.isCrossProject&&!i.isSameRepoWorktree){let e=i.command,t=await ee(e);t&&process.stdout.write(t),Oe(e);return}try{let r=await he(t,void 0);if(!r)throw Error(`Failed to load conversation`);{let t=(b(),e(k)).matchSessionMode(r.mode);if(t){let{getAgentDefinitionsWithOverrides:n,getActiveAgentsFromList:i}=(ue(),e(fe));n.cache.clear?.();let a=await n(te());H(e=>({...e,agentDefinitions:{...a,allAgents:a.allAgents,activeAgents:i(a.allAgents)}})),r.messages.push(se(t,`warning`))}}r.sessionId&&!E?(u(le(r.sessionId),t.fullPath?ye(t.fullPath):null),await M(),await S(),pe(r.sessionId)):E&&r.contentReplacements?.length&&await C(r.contentReplacements);let{agentDefinition:i}=N(r.agentSetting,d,z);H(e=>({...e,agent:i?.agentType}));{let{saveMode:t}=(h(),e(me)),{isCoordinatorMode:n}=(b(),e(k));t(n()?`coordinator`:`normal`)}let a=P(r.agentName,r.agentColor);a&&H(e=>({...e,standaloneAgentContext:a})),de(r.agentName),w(E?{...r,worktreeSession:void 0}:r),E||(F(r.worktreeSession),r.sessionId&&oe()),f(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),W([]),De({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor===`default`?void 0:r.agentColor,mainThreadAgentDefinition:i})}catch(e){throw f(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),m(e),e}}return J?(0,V.jsx)(Se,{command:J}):q?(0,V.jsx)(ve,{debug:l,commands:t,initialTools:a,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:o,dynamicMcpConfig:c,strictMcpConfig:_,systemPrompt:v,appendSystemPrompt:y,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:p,disableSlashCommands:T,taskListId:D,thinkingConfig:j,onTurnComplete:L}):Ce?(0,V.jsxs)(s,{children:[(0,V.jsx)(O,{}),(0,V.jsx)(i,{children:` Loading conversations…`})]}):we?(0,V.jsxs)(s,{children:[(0,V.jsx)(O,{}),(0,V.jsx)(i,{children:` Resuming conversation…`})]}):Z.length===0?(0,V.jsx)(xe,{}):(0,V.jsx)(I,{logs:Z,maxHeight:R,onCancel:je,onSelect:Me,onLogsChanged:ke?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:x,showAllProjects:K,onToggleAllProjects:Ae,onAgenticSearch:ge})}function xe(){return o(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,V.jsxs)(s,{flexDirection:`column`,children:[(0,V.jsx)(i,{children:`No conversations found to resume.`}),(0,V.jsx)(i,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function Se({command:e}){return B.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,V.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,V.jsx)(i,{children:`This conversation is from a different directory.`}),(0,V.jsxs)(s,{flexDirection:`column`,children:[(0,V.jsx)(i,{children:`To resume, run:`}),(0,V.jsxs)(i,{children:[` `,e]})]}),(0,V.jsx)(i,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{H as ResumeConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{LO as e,RO as t}from"./loadAgentsDir-DI1a76pd.js";t();export{e as clearSearchExtraToolsDescriptionCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./SentryErrorBoundary-C-NlfQZw.js";e();export{t as SentryErrorBoundary};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./chunk-DR8-3Aex.js";import{f as r,s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{n as o,t as s}from"./figures-gfT9mM8P.js";import{E as c,F as ee,In as l,Ln as u,Rn as d,T as te,Ut as ne,_ as re,b as f,c as ie,f as ae,g as p,h as m,i as oe,n as se,nt as ce,p as le,r as ue,t as h,tt as de,x as g}from"./src-Di342QoJ.js";import{t as _}from"./jsx-runtime-D-D469L8.js";import{Ct as v,cn as y,kr as fe,tn as pe}from"./state-sIHsFpDu.js";import{Ac as b,Fs as me,Is as he,Ka as ge,Lr as _e,Ns as ve,Oc as ye,Pc as x,Pr as S,Qa as be,Rr as xe,Rs as Se,S as Ce,Sc as C,Si as we,Vs as Te,Xi as Ee,Zi as De,_ as Oe,bc as ke,di as Ae,it as je,li as Me,lo as w,on as T,oo as Ne,rt as Pe,tn as E,ui as Fe,vc as Ie,vi as Le,xi as Re,yc as ze,yi as Be}from"./paths-BBvuDQl9.js";import{E as D,w as Ve}from"./debug-UI3T040K.js";import{n as O,r as k}from"./analytics-DqMQntaB.js";import{n as A,t as He}from"./cwd--iizewsn.js";import{o as Ue,s as We}from"./log-CzsijfHZ.js";import{i as Ge,o as Ke}from"./platform-CuyedWpe.js";import{_ as j,x as M}from"./startupProfiler-DnXZaX4A.js";import{r as qe}from"./permissions-DXLfdE7b.js";import{$f as Je,Ar as Ye,C as Xe,Cb as Ze,Db as Qe,Dx as $e,Eb as et,Gx as tt,Hu as nt,I as rt,JS as N,Lw as it,MS as P,NS as at,Nx as F,Ob as ot,Ox as I,PS as st,Px as ct,Qb as lt,Rg as ut,Sb as dt,Tb as ft,Vu as pt,YS as mt,Zb as ht,_k as gt,_m as L,as as _t,bb as vt,bk as yt,cy as R,ep as bt,hr as z,is as B,jS as V,kb as xt,mm as St,os as Ct,qx as wt,rx as Tt,w as Et,wb as Dt,xb as Ot,xk as H,y as kt,yb as At,yk as jt,zg as Mt}from"./loadAgentsDir-DI1a76pd.js";import{r as Nt,t as Pt}from"./poorMode-DzYT47KW.js";import{t as U}from"./useKeybinding-FsOnjW6T.js";import{l as W,u as Ft}from"./referral-DeDr9zAE.js";import{i as It,r as Lt}from"./bridgeEnabled-D2IykaHE.js";import{a as Rt,n as zt,r as Bt}from"./teammateModeSnapshot-DOQMTKbQ.js";import{i as Vt,n as G,r as Ht}from"./modalContext-CmSKRyea.js";import{n as Ut,t as Wt}from"./ThemePicker-BRh027fA.js";import{i as Gt,n as Kt,r as qt,t as Jt}from"./extraUsage-CNMMTNJi.js";import{n as Yt,t as Xt}from"./ClaudeMdExternalIncludesDialog-BNhlq7_K.js";import{t as Zt}from"./SearchBox-DfOmUoaI.js";import{n as Qt,t as $t}from"./useSearchInput-BV_azHiA.js";import{n as en,t as tn}from"./usage-BRYRRgNt.js";import{a as nn,i as rn,t as an}from"./OverageCreditUpsell-Cpk_5Lv0.js";function on(){let e=v();return[{label:`Version`,value:`2.6.5`},{label:`Session name`,value:z(e)??(0,K.jsx)(f,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:He()},...vt(),...At()]}function sn({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:ot(e)},...Ot(t.clients,r.options.ideInstallationStatus,n),...Dt(t.clients,n),...et(),...Qe()]}async function cn(){return[...await dt(),...await Ze(),...await ft()]}function ln({value:e}){return Array.isArray(e)?(0,K.jsx)(g,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(f,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(f,{children:e}):e}function un({context:e,diagnosticsPromise:t}){let n=P(e=>e.mainLoopModel),r=P(e=>e.mcp),[i]=te(),a=fn.useMemo(()=>[on(),sn({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=Ht()?1:void 0;return(0,K.jsxs)(g,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(g,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(g,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(g,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(f,{bold:!0,children:[e,`:`]}),(0,K.jsx)(ln,{value:t})]},n))},t)),(0,K.jsx)(pn.Suspense,{fallback:null,children:(0,K.jsx)(dn,{promise:t})})]}),(0,K.jsx)(f,{dimColor:!0,children:(0,K.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function dn({promise:e}){let t=(0,pn.use)(e);return t.length===0?null:(0,K.jsxs)(g,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(f,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(g,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(f,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(f,{wrap:`wrap`,children:e}):e]},t))]})}var fn,pn,K,mn=t((()=>{o(),fn=n(d(),1),pn=n(d(),1),y(),G(),h(),V(),A(),Ye(),xt(),mt(),K=_()}));function hn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,gn.jsxs)(ae,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,gn.jsxs)(f,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,gn.jsx)(f,{dimColor:!0,children:`How would you like to handle this?`}),(0,gn.jsx)($e,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var gn,_n=t((()=>{d(),h(),R(),gn=_()}));function vn(e){return Object.entries(e).map(([e,t])=>({label:t?.name??xn,value:e,description:t?.description??Sn}))}function yn({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,bn.useState)([]),[o,s]=(0,bn.useState)(!0);(0,bn.useEffect)(()=>{_t(He()).then(e=>{a(vn(e)),s(!1)}).catch(()=>{a(vn(B)),s(!1)})},[]);let c=(0,bn.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(ae,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(g,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(g,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(f,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)($e,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var bn,q,xn,Sn,Cn=t((()=>{d(),bn=n(d(),1),Ct(),h(),A(),I(),q=_(),xn=`Default`,Sn=`Claude completes coding tasks efficiently and provides concise responses`}));function wn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,Tn.useState)(e),[a,o]=(0,Tn.useState)((e??``).length);de(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(g,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(f,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(g,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:s.pointer}),(0,J.jsx)(F,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(f,{dimColor:!0,children:`Leave empty for default (English)`})]})}var Tn,J,En=t((()=>{o(),Tn=n(d(),1),h(),U(),ct(),J=_()}));function Dn({onClose:t,context:n,setTabsHidden:i,onIsSearchModeChange:o,contentHeight:u}){let{headerFocused:d,focusHeader:ie}=oe(),se=Ht(),[,le]=te(),ue=c(),[h,_]=(0,X.useState)(C()),v=Y.useRef(C()),[y,b]=(0,X.useState)(ge()),ve=Y.useRef(ge()),[S,Ce]=(0,X.useState)(y?.outputStyle||`default`),Ee=Y.useRef(S),[T,Ne]=(0,X.useState)(y?.language),Pe=Y.useRef(T),[E,Le]=(0,X.useState)(0),[D,Ve]=(0,X.useState)(0),[O,A]=(0,X.useState)(!1),He=ne(),{rows:Ue}=ee(),Ke=u??Math.min(Math.floor(Ue*.8),30),j=Math.max(5,Ke-10),M=P(e=>e.mainLoopModel),Ye=P(e=>e.verbose),Ze=P(e=>e.thinkingEnabled),Qe=P(e=>Re()?e.fastMode:!1),et=P(e=>e.promptSuggestionEnabled),tt=he(y?.permissions?.defaultMode??`default`),nt=Xe()||kt()===`enabled`,it=(bt(),e(Je)).isBriefEntitled(),F=st(),[ot,I]=(0,X.useState)({}),ct=Y.useRef(Ze),[lt]=(0,X.useState)(()=>be(`localSettings`)),[ut]=(0,X.useState)(()=>be(`userSettings`)),dt=Y.useRef(ue),ft=at(),[pt]=(0,X.useState)(()=>{let e=ft.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,isBriefOnly:e.isBriefOnly,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),[mt]=(0,X.useState)(()=>pe()),L=Y.useRef(!1),[_t,vt]=(0,X.useState)(!1),[R,z]=(0,X.useState)(null),{query:B,setQuery:V,cursorOffset:xt}=Qt({isActive:O&&R===null&&!d,onExit:()=>A(!1),onExitUp:ie,passthroughCtrlKeys:[`c`,`d`]}),St=O&&!d;Y.useEffect(()=>{o?.(St)},[St,o]);let Ct=ht(n.options.mcpClients),Et=!a(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Dt=Y.use(jt(!0)),Ot=yt(Dt),H=ze();function At(e){k(`tengu_config_model_changed`,{from_model:M,to_model:e}),F(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),I(t=>{let n=xe(e)+(Kt(e,!1,_e())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function Mt(e){x(t=>({...t,verbose:e})),_({...C(),verbose:e}),F(t=>({...t,verbose:e})),I(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let U=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:h.autoCompactEnabled,type:`boolean`,onChange(e){x(t=>({...t,autoCompactEnabled:e})),_({...C(),autoCompactEnabled:e}),k(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:y?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){w(`localSettings`,{spinnerTipsEnabled:e}),b(t=>({...t,spinnerTipsEnabled:e})),k(`tengu_tips_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:y?.prefersReducedMotion??!1,type:`boolean`,onChange(e){w(`localSettings`,{prefersReducedMotion:e}),b(t=>({...t,prefersReducedMotion:e})),F(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),k(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ze??!0,type:`boolean`,onChange(e){F(t=>({...t,thinkingEnabled:e})),w(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),k(`tengu_thinking_toggled`,{enabled:e})}},...Re()&&Be()?[{id:`fastMode`,label:`Fast mode (${Me} only)`,value:!!Qe,type:`boolean`,onChange(e){Fe(),w(`userSettings`,{fastMode:e?!0:void 0}),e?(F(e=>({...e,mainLoopModel:Ae(),mainLoopModelForSession:null,fastMode:!0})),I(e=>({...e,model:Ae(),"Fast mode":`ON`}))):(F(e=>({...e,fastMode:!1})),I(e=>({...e,"Fast mode":`OFF`})))}}]:[],...Oe(`tengu_chomp_inflection`,!1)?[{id:`promptSuggestionEnabled`,label:`Prompt suggestions`,value:et,type:`boolean`,onChange(e){F(t=>({...t,promptSuggestionEnabled:e})),w(`userSettings`,{promptSuggestionEnabled:e?void 0:!1})}}]:[],...[{id:`poorMode`,label:`Poor mode (save tokens)`,value:(Pt(),e(Nt)).isPoorModeActive(),type:`boolean`,onChange(t){(Pt(),e(Nt)).setPoorMode(t),F(e=>({...e,promptSuggestionEnabled:!t}))}}],...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:h.speculationEnabled??!0,type:`boolean`,onChange(e){x(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),_({...C(),speculationEnabled:e}),k(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Et?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:h.fileCheckpointingEnabled,type:`boolean`,onChange(e){x(t=>({...t,fileCheckpointingEnabled:e})),_({...C(),fileCheckpointingEnabled:e}),k(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Ye,type:`boolean`,onChange:Mt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:h.terminalProgressBarEnabled,type:`boolean`,onChange(e){x(t=>({...t,terminalProgressBarEnabled:e})),_({...C(),terminalProgressBarEnabled:e}),k(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},...Oe(`tengu_terminal_sidebar`,!1)?[{id:`showStatusInTerminalTab`,label:`Show status in terminal tab`,value:h.showStatusInTerminalTab??!1,type:`boolean`,onChange(e){x(t=>({...t,showStatusInTerminalTab:e})),_({...C(),showStatusInTerminalTab:e}),k(`tengu_terminal_tab_status_setting_changed`,{enabled:e})}}]:[],{id:`showTurnDuration`,label:`Show turn duration`,value:h.showTurnDuration,type:`boolean`,onChange(e){x(t=>({...t,showTurnDuration:e})),_({...C(),showTurnDuration:e}),k(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:tt,options:(()=>{let e=[`default`,`plan`];return[...e,...qe.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=he(e),n=t===`auto`?t:me(t)?Te(t):t,r=w(`userSettings`,{permissions:{...y?.permissions,defaultMode:n}});if(r.error){We(r.error);return}b(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),I(t=>({...t,defaultPermissionMode:e})),k(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...nt?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:y?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){w(`userSettings`,{useAutoModeDuringPlan:e}),b(t=>({...t,useAutoModeDuringPlan:e})),F(e=>{let t=rt(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),I(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:h.respectGitignore,type:`boolean`,onChange(e){x(t=>({...t,respectGitignore:e})),_({...C(),respectGitignore:e}),k(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},{id:`copyFullResponse`,label:`Always copy full response (skip /copy picker)`,value:h.copyFullResponse,type:`boolean`,onChange(e){x(t=>({...t,copyFullResponse:e})),_({...C(),copyFullResponse:e}),k(`tengu_config_changed`,{setting:`copyFullResponse`,value:String(e)})}},...wt()?[{id:`copyOnSelect`,label:`Copy on select`,value:h.copyOnSelect??!0,type:`boolean`,onChange(e){x(t=>({...t,copyOnSelect:e})),_({...C(),copyOnSelect:e}),k(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],H?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:y?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:ue,type:`managedEnum`,onChange:le},{id:`notifChannel`,label:`Local notifications`,value:h.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){x(t=>({...t,preferredNotifChannel:e})),_({...C(),preferredNotifChannel:e})}},...[{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:h.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){x(t=>({...t,taskCompleteNotifEnabled:e})),_({...C(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:h.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){x(t=>({...t,inputNeededNotifEnabled:e})),_({...C(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:h.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){x(t=>({...t,agentPushNotifEnabled:e})),_({...C(),agentPushNotifEnabled:e})}}],{id:`outputStyle`,label:`Output style`,value:S,type:`managedEnum`,onChange:()=>{}},...it?[{id:`defaultView`,label:`What you see by default`,value:y?.defaultView===void 0?`default`:String(y.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e===`default`?void 0:e;w(`localSettings`,{defaultView:t}),b(e=>({...e,defaultView:t}));let n=t===`chat`;F(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),fe(n),I(t=>({...t,"Default view":e})),k(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:T??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:h.editorMode===`emacs`?`normal`:h.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){x(t=>({...t,editorMode:e})),_({...C(),editorMode:e}),k(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:h.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){x(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),_({...C(),prStatusFooterEnabled:e}),k(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:M===null?`Default (recommended)`:M,type:`managedEnum`,onChange:At},...Ct?[{id:`diffTool`,label:`Diff tool`,value:h.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){x(t=>({...t,diffTool:e})),_({...C(),diffTool:e}),k(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...Tt()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:h.autoConnectIde??!1,type:`boolean`,onChange(e){x(t=>({...t,autoConnectIde:e})),_({...C(),autoConnectIde:e}),k(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...Tt()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:h.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){x(t=>({...t,autoInstallIdeExtension:e})),_({...C(),autoInstallIdeExtension:e}),k(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],{id:`claudeInChromeDefaultEnabled`,label:`Claude in Chrome enabled by default`,value:h.claudeInChromeDefaultEnabled??!0,type:`boolean`,onChange(e){x(t=>({...t,claudeInChromeDefaultEnabled:e})),_({...C(),claudeInChromeDefaultEnabled:e}),k(`tengu_claude_in_chrome_setting_changed`,{enabled:e})}},...je()?(()=>{let e=Bt(),t=e?`Teammate mode [overridden: ${e}]`:`Teammate mode`,n=Ge()===`windows`,r=n?[`auto`,`tmux`,`windows-terminal`,`in-process`]:[`auto`,`tmux`,`in-process`];return[{id:`teammateMode`,label:t,value:h.teammateMode??`auto`,options:r,type:`enum`,onChange(e){e!==`auto`&&e!==`tmux`&&e!==`windows-terminal`&&e!==`in-process`||e===`windows-terminal`&&!n||(zt(e),x(t=>({...t,teammateMode:e})),_({...C(),teammateMode:e}),k(`tengu_teammate_mode_changed`,{mode:e}))}},{id:`teammateDefaultModel`,label:`Default teammate model`,value:On(h.teammateDefaultModel),type:`managedEnum`,onChange(){}}]})():[],...It()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:h.remoteControlAtStartup===void 0?`default`:String(h.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e===`default`)x(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),_({...C(),remoteControlAtStartup:void 0});else{let t=e===`true`;x(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),_({...C(),remoteControlAtStartup:t})}let t=ye();F(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Ot?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:ke().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(f,{children:[`Use custom API key: `,(0,Z.jsx)(f,{bold:!0,children:De(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&h.customApiKeyResponses?.approved?.includes(De(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){x(t=>{let n={...t};if(n.customApiKeyResponses||(n.customApiKeyResponses={approved:[],rejected:[]}),n.customApiKeyResponses.approved||(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]}),n.customApiKeyResponses.rejected||(n.customApiKeyResponses={...n.customApiKeyResponses,rejected:[]}),process.env.ANTHROPIC_API_KEY){let t=De(process.env.ANTHROPIC_API_KEY);e?n.customApiKeyResponses={...n.customApiKeyResponses,approved:[...(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),t],rejected:(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t)}:n.customApiKeyResponses={...n.customApiKeyResponses,approved:(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),rejected:[...(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t),t]}}return n}),_(C())}}]:[]],W=Y.useMemo(()=>{if(!B)return U;let e=B.toLowerCase();return U.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[U,B]);Y.useEffect(()=>{if(E>=W.length){let e=Math.max(0,W.length-1);Le(e),Ve(Math.max(0,e-j+1));return}Ve(e=>E<e?E:E>=e+j?E-j+1:e)},[W.length,E,j]);let Ft=(0,X.useCallback)(e=>{Ve(t=>e<t?e:e>=t+j?e-j+1:t)},[j]),Lt=(0,X.useCallback)(()=>{if(R!==null)return;let e=Object.entries(ot).map(([e,t])=>(k(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${l.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&v.current.customApiKeyResponses?.approved?.includes(De(n))),a=!!(n&&h.customApiKeyResponses?.approved?.includes(De(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),k(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),h.theme!==v.current.theme&&e.push(`Set theme to ${l.bold(h.theme)}`),h.preferredNotifChannel!==v.current.preferredNotifChannel&&e.push(`Set notifications to ${l.bold(h.preferredNotifChannel)}`),S!==Ee.current&&e.push(`Set output style to ${l.bold(S)}`),T!==Pe.current&&e.push(`Set response language to ${l.bold(T??`Default (English)`)}`),h.editorMode!==v.current.editorMode&&e.push(`Set editor mode to ${l.bold(h.editorMode||`emacs`)}`),h.diffTool!==v.current.diffTool&&e.push(`Set diff tool to ${l.bold(h.diffTool)}`),h.autoConnectIde!==v.current.autoConnectIde&&e.push(`${h.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),h.autoInstallIdeExtension!==v.current.autoInstallIdeExtension&&e.push(`${h.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),h.autoCompactEnabled!==v.current.autoCompactEnabled&&e.push(`${h.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),h.respectGitignore!==v.current.respectGitignore&&e.push(`${h.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),h.copyFullResponse!==v.current.copyFullResponse&&e.push(`${h.copyFullResponse?`Enabled`:`Disabled`} always copy full response`),h.copyOnSelect!==v.current.copyOnSelect&&e.push(`${h.copyOnSelect?`Enabled`:`Disabled`} copy on select`),h.terminalProgressBarEnabled!==v.current.terminalProgressBarEnabled&&e.push(`${h.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),h.showStatusInTerminalTab!==v.current.showStatusInTerminalTab&&e.push(`${h.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),h.showTurnDuration!==v.current.showTurnDuration&&e.push(`${h.showTurnDuration?`Enabled`:`Disabled`} turn duration`),h.remoteControlAtStartup!==v.current.remoteControlAtStartup){let t=h.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${h.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}y?.autoUpdatesChannel!==ve.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${l.bold(y?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
|
|
2
|
-
`)):t(`Config dialog dismissed`,{display:`system`})},[R,ot,h,M,S,T,y?.autoUpdatesChannel,Re()?y?.fastMode:void 0,t]),Rt=(0,X.useCallback)(()=>{ue!==dt.current&&le(dt.current),x(()=>v.current);let e=lt;w(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=ut;w(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,useAutoModeDuringPlan:t?.useAutoModeDuringPlan,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=pt;F(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,isBriefOnly:n.isBriefOnly,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:rt(e.toolPermissionContext)})),pe()!==mt&&fe(mt)},[ue,le,lt,ut,pt,mt,F]);de(`confirm:no`,(0,X.useCallback)(()=>{R===null&&(L.current&&Rt(),t(`Config dialog dismissed`,{display:`system`}))},[R,Rt,t]),{context:`Settings`,isActive:R===null&&!O&&!d}),de(`settings:close`,Lt,{context:`Settings`,isActive:R===null&&!O&&!d});let Vt=(0,X.useCallback)(()=>{let e=W[E];if(!(!e||!e.onChange)){if(e.type===`boolean`){L.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===ct.current?vt(!1):n.messages.some(e=>e.type===`assistant`)&&vt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`teammateDefaultModel`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:z(`Theme`),i(!0);return;case`model`:z(`Model`),i(!0);return;case`teammateDefaultModel`:z(`TeammateModel`),i(!0);return;case`showExternalIncludesDialog`:z(`ExternalIncludes`),i(!0);return;case`outputStyle`:z(`OutputStyle`),i(!0);return;case`language`:z(`Language`),i(!0);return}if(e.id===`autoUpdatesChannel`){if(H){z(`EnableAutoUpdates`),i(!0);return}(y?.autoUpdatesChannel??`latest`)===`latest`?(z(`ChannelDowngrade`),i(!0)):(L.current=!0,w(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),b(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),k(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){L.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[H,W,E,y?.autoUpdatesChannel,i]),G=e=>{vt(!1);let t=Math.max(0,Math.min(W.length-1,E+e));Le(t),Ft(t)};return ce({"select:previous":()=>{E===0?(vt(!1),A(!0),Ve(0)):G(-1)},"select:next":()=>G(1),"scroll:lineUp":()=>G(-1),"scroll:lineDown":()=>G(1),"select:accept":Vt,"select:previousValue":()=>Vt(),"select:nextValue":()=>Vt(),"settings:search":()=>{A(!0),V(``)}},{context:`Settings`,isActive:R===null&&!O&&!d}),(0,Z.jsx)(g,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(R===null&&!d){if(O){if(e.key===`escape`){e.preventDefault(),B.length>0?V(``):A(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),A(!1),Le(0),Ve(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),Vt();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),A(!0),V(e.key))}},[R,d,O,B,V,Vt]),children:R===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Wt,{onThemeSelect:e=>{L.current=!0,le(e),z(null),i(!1)},onCancel:()=>{z(null),i(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(g,{children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):R===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qt,{initial:M,onSelect:(e,t)=>{L.current=!0,At(e),z(null),i(!1)},onCancel:()=>{z(null),i(!1)},showFastModeNotice:Re()?Qe&&we(M)&&Be():!1}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`TeammateModel`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qt,{initial:h.teammateDefaultModel??null,skipSettingsWrite:!0,headerText:`Default model for newly spawned teammates. The leader can override via the tool call's model parameter.`,onSelect:(e,t)=>{z(null),i(!1),!(h.teammateDefaultModel===void 0&&e===null)&&(L.current=!0,x(t=>t.teammateDefaultModel===e?t:{...t,teammateDefaultModel:e}),_({...C(),teammateDefaultModel:e}),I(t=>({...t,teammateDefaultModel:On(e)})),k(`tengu_teammate_default_model_changed`,{model:e}))},onCancel:()=>{z(null),i(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Xt,{onDone:()=>{z(null),i(!1)},externalIncludes:gt(Dt)}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):R===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(yn,{initialStyle:S,onComplete:e=>{L.current=!0,Ce(e??`default`),z(null),i(!1),w(`localSettings`,{outputStyle:e}),k(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{z(null),i(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):R===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wn,{initialLanguage:T,onComplete:e=>{L.current=!0,Ne(e),z(null),i(!1),w(`userSettings`,{language:e}),k(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{z(null),i(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):R===`EnableAutoUpdates`?(0,Z.jsx)(ae,{title:`Enable Auto-Updates`,onCancel:()=>{z(null),i(!1)},hideBorder:!0,hideInputGuide:!0,children:H?.type===`config`?(0,Z.jsx)($e,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{L.current=!0,z(null),i(!1),x(e=>({...e,autoUpdates:!0})),_({...C(),autoUpdates:!0}),w(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),b(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),k(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{children:H?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),H?.type===`env`&&(0,Z.jsxs)(f,{dimColor:!0,children:[`Unset `,H.envVar,` to re-enable auto-updates.`]})]})}):R===`ChannelDowngrade`?(0,Z.jsx)(hn,{currentVersion:`2.6.5`,onChoice:e=>{if(z(null),i(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`2.6.5`),w(`userSettings`,t),b(e=>({...e,...t})),k(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(g,{flexDirection:`column`,gap:1,marginY:se?void 0:1,children:[(0,Z.jsx)(re,{query:B,isFocused:O&&!d,isTerminalFocused:He,cursorOffset:xt,placeholder:`Search settings…`}),(0,Z.jsx)(g,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[`No settings match "`,B,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[D>0&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowUp,` `,D,` more above`]}),W.slice(D,D+j).map((e,t)=>{let n=D+t===E&&!d&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(g,{width:`100%`,children:[(0,Z.jsx)(g,{width:44,children:(0,Z.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(g,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()}),_t&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(f,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:An[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(kn,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:Se(e.value)}):e.id===`autoUpdatesChannel`&&H?(0,Z.jsxs)(g,{flexDirection:`column`,children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`(`,Ie(H),`)`]})]}):(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),D+j<W.length&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowDown,` `,W.length-D-j,` more below`]})]})}),d?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(p,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(p,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(f,{children:`Type to filter`}),(0,Z.jsx)(p,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(p,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(m,{children:[(0,Z.jsx)(N,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(N,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(N,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function On(e){return e===void 0?xe(pt()):e===null?`Default (leader's model)`:xe(e)}function kn({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(f,{children:[`iTerm2 `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(f,{children:[`Terminal Bell `,(0,Z.jsx)(f,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(f,{children:[`Kitty `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(f,{children:[`Ghostty `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,An,jn=t((()=>{h(),Y=n(d(),1),X=n(d(),1),U(),o(),b(),Ee(),u(),ve(),Et(),Ue(),O(),Lt(),Ut(),V(),Gt(),S(),Jt(),Yt(),_n(),R(),Cn(),En(),H(),mt(),G(),Zt(),lt(),Ne(),y(),Ct(),i(),Ce(),Pe(),Rt(),nt(),$t(),it(),Le(),tt(),Ke(),Z=_(),An={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function Mn({title:e,limit:t,maxWidth:n,showTimeInReset:r=!0,extraSubtext:i}){let{utilization:a,resets_at:o}=t;if(a===null)return null;let s=`${Math.floor(a)}% used`,c;return o&&(c=`Resets ${j(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(g,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:e}),(0,Q.jsxs)(g,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ie,{ratio:a/100,width:50,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]}),c&&(0,Q.jsx)(f,{dimColor:!0,children:c})]}):(0,Q.jsxs)(g,{flexDirection:`column`,children:[(0,Q.jsxs)(f,{children:[(0,Q.jsx)(f,{bold:!0,children:e}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f,{children:` `}),(0,Q.jsxs)(f,{dimColor:!0,children:[`· `,c]})]})]}),(0,Q.jsx)(ie,{ratio:a/100,width:n,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]})}function Nn(){let[e,t]=(0,In.useState)(null),[n,r]=(0,In.useState)(null),[i,a]=(0,In.useState)(!0),{columns:o}=ee(),s=o-2,c=Math.min(s,80),l=Fn.useCallback(async()=>{a(!0),r(null);try{t(await tn())}catch(e){We(e);let t=e,n=t.response?.data?D(t.response.data):void 0;r(n?`Failed to load usage data: ${n}`:`Failed to load usage data`)}finally{a(!1)}},[]);if((0,In.useEffect)(()=>{l()},[l]),de(`settings:retry`,()=>{l()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(g,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(f,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsxs)(m,{children:[(0,Q.jsx)(N,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(g,{flexDirection:`column`,gap:1,children:[(0,Q.jsx)(f,{dimColor:!0,children:`Loading usage data…`}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let u=E(),d=u===`max`||u===`team`||u===null,te=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...d?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(g,{flexDirection:`column`,gap:1,width:`100%`,children:[te.some(({limit:e})=>e)||(0,Q.jsx)(f,{dimColor:!0,children:`/usage is only available for subscription plans.`}),te.map(({title:e,limit:t})=>t&&(0,Q.jsx)(Mn,{title:e,limit:t,maxWidth:c},e)),e.extra_usage&&(0,Q.jsx)(Pn,{extraUsage:e.extra_usage,maxWidth:c}),nn()&&(0,Q.jsx)(an,{maxWidth:c}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(N,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Pn({extraUsage:e,maxWidth:t}){let n=E();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return ut.isEnabled()?(0,Q.jsxs)(g,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Ln}),(0,Q.jsx)(f,{dimColor:!0,children:`Extra usage not enabled · /extra-usage to enable`})]}):null;if(e.monthly_limit===null)return(0,Q.jsxs)(g,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Ln}),(0,Q.jsx)(f,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=St(e.used_credits/100,2),i=St(e.monthly_limit/100,2),a=new Date,o=new Date(a.getFullYear(),a.getMonth()+1,1);return(0,Q.jsx)(Mn,{title:Ln,limit:{utilization:e.utilization,resets_at:o.toISOString()},showTimeInReset:!1,extraSubtext:`${r} / ${i} spent`,maxWidth:t})}var Fn,In,Q,Ln,Rn=t((()=>{Fn=n(d(),1),In=n(d(),1),Mt(),L(),T(),it(),h(),U(),en(),M(),Ue(),Ve(),mt(),rn(),Q=_(),Ln=`Extra usage`}));function zn({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Bn.useState)(n),[a,o]=(0,Bn.useState)(!1),[s,c]=(0,Bn.useState)(!1),l=Ht(),{rows:u}=Vt(ee()),d=l?u+1:Math.max(15,Math.min(Math.floor(u*.8),30)),[te]=(0,Bn.useState)(()=>cn().catch(()=>[]));return Ft(),de(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(le,{color:`permission`,children:(0,$.jsx)(ue,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:d,children:[(0,$.jsx)(se,{title:`Status`,children:(0,$.jsx)(un,{context:t,diagnosticsPromise:te})},`status`),(0,$.jsx)(se,{title:`Config`,children:(0,$.jsx)(Bn.Suspense,{fallback:null,children:(0,$.jsx)(Dn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:d})})},`config`),(0,$.jsx)(se,{title:`Usage`,children:(0,$.jsx)(Nn,{})},`usage`)]})})}var Bn,$,Vn=t((()=>{d(),Bn=n(d(),1),U(),W(),it(),G(),h(),mn(),jn(),Rn(),$=_()}));export{Vn as n,zn as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DR8-3Aex.js";import{Q as t,Rn as n,b as r,t as i,tt as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Cr as c,cn as l}from"./state-sIHsFpDu.js";import{Ac as u,Nc as d,Qa as f,gc as p,oo as m}from"./paths-BBvuDQl9.js";import{h,p as g}from"./debug-UI3T040K.js";import{n as _,r as v}from"./analytics-DqMQntaB.js";import{n as y,t as b}from"./cwd--iizewsn.js";import{Dx as x,KT as S,ba as C,cD as w,cy as T,lD as E,lw as D,qT as O,sw as k,xa as A}from"./loadAgentsDir-DI1a76pd.js";import{In as j}from"./prompt-CjFAtm3w.js";import{t as M}from"./useKeybinding-FsOnjW6T.js";import{l as N,u as P}from"./referral-DeDr9zAE.js";import{n as F,t as I}from"./PermissionDialog-5MlJf7ew.js";import{homedir as L}from"os";var R=e(n(),1),z=s();i(),l(),_(),y(),h(),u(),O(),M(),D(),T(),N(),F(),m(),j(),A(),E();function B(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function V(){let e=[];return B(f(`projectSettings`))&&e.push(`.claude/settings.json`),B(f(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function H(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function U(){let e=[];return H(w(`projectSettings`))&&e.push(`.claude/settings.json`),H(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function W(e){return!!e?.otelHeadersHelper}function G(){let e=[];return W(f(`projectSettings`))&&e.push(`.claude/settings.json`),W(f(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function K(e){return!!e?.apiKeyHelper}function q(){let e=[];return K(f(`projectSettings`))&&e.push(`.claude/settings.json`),K(f(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function J(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function Y(){let e=[];return J(f(`projectSettings`))&&e.push(`.claude/settings.json`),J(f(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function X(e){return!!e?.gcpAuthRefresh}function Z(){let e=[];return X(f(`projectSettings`))&&e.push(`.claude/settings.json`),X(f(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Q(e){return e?.env?Object.keys(e.env).some(e=>!C.has(e.toUpperCase())):!1}function $(){let e=[];return Q(f(`projectSettings`))&&e.push(`.claude/settings.json`),Q(f(`localSettings`))&&e.push(`.claude/settings.local.json`),e}j();function ee({onDone:e,commands:n}){let{servers:i}=k(`project`),s=Object.keys(i).length>0,l=V().length>0,u=U(),f=q().length>0,m=Y().length>0,h=Z().length>0,_=G().length>0,y=$().length>0,C=n?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,w=n?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,T=u.length>0||C||w,E=p();R.useEffect(()=>{v(`tengu_trust_dialog_shown`,{isHomeDir:L()===b(),hasMcpServers:s,hasHooks:l,hasBashExecution:T,hasApiKeyHelper:f,hasAwsCommands:m,hasGcpCommands:h,hasOtelHeadersHelper:_,hasDangerousEnvVars:y})},[s,l,T,f,m,h,_,y]);function D(t){if(t===`exit`){S(1);return}let n=L()===b();v(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:s,hasHooks:l,hasBashExecution:T,hasApiKeyHelper:f,hasAwsCommands:m,hasGcpCommands:h,hasOtelHeadersHelper:_,hasDangerousEnvVars:y}),n?c(!0):d(e=>({...e,hasTrustDialogAccepted:!0})),e()}let O=P(()=>S(1));return a(`confirm:no`,()=>{S(0)},{context:`Confirmation`}),E?(setTimeout(e),null):(0,z.jsx)(I,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,z.jsxs)(o,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,z.jsx)(r,{bold:!0,children:g().cwd()}),(0,z.jsx)(r,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,z.jsx)(r,{children:`Once trusted, Claude Code can read, edit, and run commands in this folder.`}),(0,z.jsx)(r,{dimColor:!0,children:(0,z.jsx)(t,{url:`https://code.claude.com/docs/en/security`,children:`Security guide`})}),(0,z.jsx)(x,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>D(e),onCancel:()=>D(`exit`)}),(0,z.jsx)(r,{dimColor:!0,children:O.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,O.keyName,` again to exit`]}):(0,z.jsx)(z.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})})}export{ee as TrustDialog};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-80gRi2ZW.js";import{d as r,s as i}from"./debug-UI3T040K.js";import{i as a,o}from"./platform-CuyedWpe.js";import{r as s,t as c}from"./execFileNoThrow-CuQN1sz8.js";import{Dd as l,Sd as u}from"./loadAgentsDir-DI1a76pd.js";import{a as d,r as f}from"./detection-CQsNad64.js";import{tmpdir as p}from"os";import{join as m}from"path";import{randomUUID as h}from"crypto";import{readFile as g}from"fs/promises";function _(e){return`'${e.replace(/'/g,`''`)}'`}function v(e,t){let n=_(t);return[`$ErrorActionPreference = 'Stop'`,`Set-Content -LiteralPath ${n} -Value $PID`,[`try { ${e}; if ($LASTEXITCODE -is [int]) { exit $LASTEXITCODE } }`,`catch { Write-Error $_; exit 1 }`,`finally { Remove-Item -LiteralPath ${n} -Force -ErrorAction SilentlyContinue }`].join(`
|
|
2
|
-
`)].join(`; `)}function y(e){return m(p(),`${e.replace(/[^a-zA-Z0-9_-]/g,`-`)}.pid`)}var b;e((()=>{i(),s(),o(),f(),u(),t(),b=class{constructor(e=c,t=a){n(this,`type`,`windows-terminal`),n(this,`displayName`,`Windows Terminal`),n(this,`supportsHideShow`,!1),n(this,`panes`,new Map),this.runCommand=e,this.getPlatformValue=t}async isAvailable(){return this.getPlatformValue()===`windows`?process.env.WT_SESSION?!0:(await this.runCommand(`where.exe`,[`wt.exe`])).code===0:!1}async isRunningInside(){return this.getPlatformValue()===`windows`&&d()}async createTeammatePaneInSwarmView(e,t){let n=`wt-${h()}`,r=this.panes.size===0;return this.panes.set(n,{title:e,mode:`pane`,pidFile:y(n)}),{paneId:n,isFirstTeammate:r}}async createTeammateWindowInSwarmView(e,t){let n=`wt-${h()}`,r=`teammate-${e.replace(/[^a-zA-Z0-9]/g,`-`).toLowerCase()}`;return this.panes.set(n,{title:e,mode:`window`,pidFile:y(n)}),{paneId:n,isFirstTeammate:!1,windowName:r}}async sendCommandToPane(e,t,n){let r=this.panes.get(e);if(!r)throw Error(`Unknown Windows Terminal pane id: ${e}`);let i=v(t,r.pidFile),a=Buffer.from(i,`utf16le`).toString(`base64`),o=r.mode===`window`?[`-w`,`-1`,`new-tab`,`--title`,r.title]:[`-w`,`0`,`split-pane`,`--vertical`,`--title`,r.title],s=await this.runCommand(`wt.exe`,[...o,`powershell.exe`,`-NoLogo`,`-NoProfile`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`,a]);if(s.code!==0)throw Error(`Failed to launch Windows Terminal teammate ${e}: ${s.stderr}`)}async setPaneBorderColor(e,t,n){}async setPaneTitle(e,t,n,r){}async enablePaneBorderStatus(e,t){}async rebalancePanes(e,t){}async killPane(e,t){let n=this.panes.get(e);if(!n)return!1;let i;try{i=Number.parseInt((await g(n.pidFile,`utf-8`)).trim(),10)}catch{return this.panes.delete(e),!1}if(!Number.isFinite(i))return this.panes.delete(e),!1;let a=await this.runCommand(`powershell.exe`,[`-NoLogo`,`-NoProfile`,`-Command`,`Stop-Process -Id ${i} -Force -ErrorAction Stop`]);return this.panes.delete(e),r(`[WindowsTerminalBackend] killPane ${e} pid=${i} code=${a.code}`),a.code===0}async hidePane(e,t){return!1}async showPane(e,t,n){return!1}},l(b)}))();export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./api-CGOR_Xfl.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,s as t}from"./assistant-BlzrMSkM.js";e();export{t as isAssistantMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_b as e,gb as t,hb as n,mb as r}from"./loadAgentsDir-DI1a76pd.js";e();export{r as authLogin,n as authLogout,t as authStatus};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,H as a,X as o,cn as s}from"./state-sIHsFpDu.js";import{Fa as c,Mr as l,Na as u,Pr as d,S as f,co as p,no as ee,oo as te}from"./paths-BBvuDQl9.js";import{K as ne,V as m,d as h,h as re,p as g,s as ie,w as _}from"./debug-UI3T040K.js";import{n as ae,r as v}from"./analytics-DqMQntaB.js";import{n as y,t as b}from"./cwd--iizewsn.js";import{o as x,s as S,v as C,y as w}from"./log-CzsijfHZ.js";import{E as T,O as E,T as oe}from"./teammate-DMYOtLTK.js";import{$S as se,AE as ce,Ab as le,Ar as ue,CD as de,Co as D,DD as O,Fb as k,Gl as A,IE as j,Lo as M,ME as N,Mb as P,SD as F,So as I,Wl as L,ZS as R,bo as z,fC as B,jE as V,jO as H,jb as fe,pt as pe,rt as me,tt as U,uC as he,vS as ge,wt as _e,xr as ve,yS as ye}from"./loadAgentsDir-DI1a76pd.js";import{Bn as be,Vn as xe}from"./prompt-CjFAtm3w.js";import{X as Se}from"./rcDebugLog-CPKZCtR8.js";import{n as Ce,r as we}from"./magicDocs-CmUlOWjI.js";import{n as Te,t as Ee}from"./pluginAutoupdate-CGXIWBrb.js";import{n as De,r as Oe}from"./registerProtocol-BZBH8Zgl.js";import{homedir as ke}from"os";import{join as W}from"path";import"crypto";import*as G from"fs/promises";r(),s(),y(),_(),re(),ie(),w(),te(),c(),d(),f(),xe(),O(),ce(),A(),ue(),we(),U(),x(),m(),M(),H(),U(),de(),m(),x(),M(),H();async function Ae(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),a=n(b(),`.claude`,`skills`,e,`SKILL.md`),o;try{o=await r.readFile(a,`utf-8`)}catch{S(Error(`Failed to read skill file for improvement: ${a}`));return}let s=t.map(e=>`- ${e.section}: ${e.change}`).join(`
|
|
2
|
-
`),c=l(),d=j()?V({sessionId:i(),model:c,provider:u(),name:`skill-improvement-apply`}):null,f=await me({messages:[z({content:`You are editing a skill definition file. Apply the following improvements to the skill.
|
|
3
|
-
|
|
4
|
-
<current_skill_file>
|
|
5
|
-
${o}
|
|
6
|
-
</current_skill_file>
|
|
7
|
-
|
|
8
|
-
<improvements>
|
|
9
|
-
${s}
|
|
10
|
-
</improvements>
|
|
11
|
-
|
|
12
|
-
Rules:
|
|
13
|
-
- Integrate the improvements naturally into the existing structure
|
|
14
|
-
- Preserve frontmatter (--- block) exactly as-is
|
|
15
|
-
- Preserve the overall format and style
|
|
16
|
-
- Do not remove existing content unless an improvement explicitly replaces it
|
|
17
|
-
- Output the complete updated file inside <updated_file> tags`})],systemPrompt:Se([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:F().signal,options:{getToolPermissionContext:async()=>be(),model:c,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[],langfuseTrace:d}});N(d);let p=I(D(Array.isArray(f.message.content)?f.message.content:[]).trim(),`updated_file`);if(!p){S(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(a,p,`utf-8`)}catch(e){S(ne(e))}}ae(),se(),oe(),x(),P(),ye(),fe(),B(),_e();var je=30;function K(){let e=((ee()||{}).cleanupPeriodDays??je)*24*60*60*1e3;return new Date(Date.now()-e)}function Me(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function Ne(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function q(e,t,n){let r={messages:0,errors:0};try{let i=await g().readdir(e);for(let a of i)try{Ne(a.name)<t&&(await g().unlink(W(e,a.name)),n?r.messages++:r.errors++)}catch(e){S(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&S(e)}return r}async function Pe(){let e=g(),t=K(),n=C.errors(),r=C.baseLogs(),i=await q(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>W(r,e.name));for(let n of a)i=Me(i,await q(n,t,!0)),await Y(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&S(e)}return i}async function J(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Y(e,t){try{await t.rmdir(e)}catch{}}async function Fe(){let e=K(),t={messages:0,errors:0},n=ve(),r=g(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=W(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=W(i,n.name),o=W(a,he),s;try{s=await r.readdir(o)}catch{await Y(a,r);continue}for(let n of s)if(n.isFile())try{await J(W(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=W(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Y(i,r)}await Y(o,r),await Y(a,r)}await Y(i,r)}return t}async function Ie(e,t,n=!0){let r=K(),i={messages:0,errors:0},a=g(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await J(W(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Y(e,a),i}function Le(){return Ie(W(n(),`plans`),`.md`)}async function Re(){let e=K(),t={messages:0,errors:0},r=g();try{let i=W(n(),`file-history`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));await Promise.all(o.map(async n=>{try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}})),await Y(i,r)}catch(e){S(e)}return t}async function ze(){let e=K(),t={messages:0,errors:0},r=g();try{let i=W(n(),`session-env`),a;try{a=await r.readdir(i)}catch{return t}let o=a.filter(e=>e.isDirectory()).map(e=>W(i,e.name));for(let n of o)try{(await r.stat(n)).mtime<e&&(await r.rm(n,{recursive:!0,force:!0}),t.messages++)}catch{t.errors++}await Y(i,r)}catch(e){S(e)}return t}async function X(){let e=K(),t={messages:0,errors:0},r=g(),i=W(n(),`debug`),a;try{a=await r.readdir(i)}catch{return t}for(let n of a)if(!(!n.isFile()||!n.name.endsWith(`.txt`)||n.name===`latest`))try{await J(W(i,n.name),e,r)&&t.messages++}catch{t.errors++}return t}var Z=1440*60*1e3;async function Q(){let e=W(n(),`.npm-cache-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){h(`npm cache cleanup: skipping, ran recently`);return}}catch{}try{await T(e,{retries:0,realpath:!1})}catch{h(`npm cache cleanup: skipping, lock held`);return}h(`npm cache cleanup: starting`);let r=W(ke(),`.npm`,`_cacache`),i=Date.now();try{let n=await import(`./lib-inCisXen.js`).then(e=>t(e.default,1)),a=i-Z,o=n.ls.stream(r),s=[];for await(let e of o)e.key.includes(`@anthropic-ai/claude-`)&&s.push({key:e.key,time:e.time});let c=new Map;for(let e of s){let t=e.key.lastIndexOf(`@`),n=t>0?e.key.slice(0,t):e.key,r=c.get(n)??[];r.push(e),c.set(n,r)}let l=[];for(let[,e]of c){e.sort((e,t)=>t.time-e.time);for(let t=0;t<e.length;t++){let n=e[t];(n.time<a||t>=5)&&l.push(n.key)}}await Promise.all(l.map(e=>n.rm.entry(r,e))),await G.writeFile(e,new Date().toISOString());let u=Date.now()-i;l.length>0?h(`npm cache cleanup: Removed ${l.length} old @anthropic-ai entries in ${u}ms`):h(`npm cache cleanup: completed in ${u}ms`),v(`tengu_npm_cache_cleanup`,{success:!0,durationMs:u,entriesRemoved:l.length})}catch(e){S(e),v(`tengu_npm_cache_cleanup`,{success:!1,durationMs:Date.now()-i})}finally{await E(e,{realpath:!1}).catch(()=>{})}}async function Be(){let e=W(n(),`.version-cleanup`);try{let t=await G.stat(e);if(Date.now()-t.mtimeMs<Z){h(`version cleanup: skipping, ran recently`);return}}catch{}try{await T(e,{retries:0,realpath:!1})}catch{h(`version cleanup: skipping, lock held`);return}h(`version cleanup: starting (throttled)`);try{await k(),await G.writeFile(e,new Date().toISOString())}catch(e){S(e)}finally{await E(e,{realpath:!1}).catch(()=>{})}}async function Ve(){let{errors:e}=le();if(e.length>0&&p(`cleanupPeriodDays`)){h(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await Pe(),await Fe(),await Le(),await Re(),await ze(),await X(),await R(),await ge(K());let t=await pe(K());t>0&&v(`tengu_worktree_cleanup`,{removed:t}),process.env.USER_TYPE===`ant`&&await Q()}s(),P(),Te();var He=(De(),e(Oe)),Ue=1440*60*1e3,$=600*1e3;function We(){Ce(),import(`./extractMemories-BrvZVsmM.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),L(),Ee(),a()&&He.ensureDeepLinkProtocolRegistered();let e=!0;async function t(){if(a()&&o()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Ve()),a()&&o()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await k()}setTimeout(t,$).unref(),process.env.USER_TYPE===`ant`&&setInterval(()=>{Q(),Be()},Ue).unref()}export{Ae as n,We as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./backgroundHousekeeping-BIZTAYho.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,t as r}from"./bridgeConfig-lRZfQqmA.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./bridgeEnabled-D2IykaHE.js";t();export{n as checkBridgeMinVersion,e as getBridgeDisabledReason};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{d as e,s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{Cn as r,In as i,Ln as a,t as o}from"./src-Di342QoJ.js";import{Gs as s,M as c,S as l,Us as u,Ws as d,l as f,z as p}from"./paths-BBvuDQl9.js";import{E as m,L as h,T as g,V as _,d as v,s as y,w as b}from"./debug-UI3T040K.js";import{i as x,n as S,r as C}from"./analytics-DqMQntaB.js";import{F as w,P as T}from"./git-CN3qtTb_.js";import{o as E,s as D}from"./log-CzsijfHZ.js";import{E as O,d as k,x as A}from"./startupProfiler-DnXZaX4A.js";import{n as j,t as M}from"./sleep-8Eb9j_Ly.js";import{Aa as N,Da as P,Ma as F,Oa as ee,aE as I,ab as te,db as ne,gt as L,ib as R,ja as z,ka as B,kt as re,lb as V,nb as H,oE as U,ob as W,sb as G,ub as K,wt as q}from"./loadAgentsDir-DI1a76pd.js";import{n as ie,t as J}from"./rcDebugLog-CPKZCtR8.js";import{c as Y,d as ae,f as oe,n as se,o as ce,r as le}from"./debugUtils-BBMFODKH.js";import{r as ue,t as de}from"./datadog-Bg-zL-i7.js";import{a as X,i as fe}from"./trustedDevice-BvYYXfd8.js";import{a as Z,t as pe}from"./types-RJTEOuIt.js";import{t as Q}from"./lib-B4Q0Nrpb.js";import{i as me,n as he,r as ge}from"./cliLaunch-BQa48gsr.js";import{t as _e}from"./capacityWake-BXlUpptF.js";import{t as $}from"./jwtUtils-CpXwh_du.js";import{t as ve}from"./pollConfig-DAQ-ives.js";import{a as ye,i as be,n as xe,r as Se,t as Ce}from"./workSecret-mS2OrpxF.js";import{hostname as we,tmpdir as Te}from"os";import{basename as Ee,dirname as De,join as Oe,resolve as ke}from"path";import{createWriteStream as Ae}from"fs";import{randomUUID as je}from"crypto";import{spawn as Me}from"child_process";import{createInterface as Ne}from"readline";t(),S(),_(),b(),T(),E(),A(),M(),c(),l(),U(),de(),ce(),J(),Z(),B(),q(),me(),a();var Pe=Q();s(),o(),y(),V();var Fe={type:`utf8`,errorCorrectionLevel:`L`,small:!0};async function Ie(e){return(await(0,Pe.toString)(e,Fe)).split(`
|
|
2
|
-
`).filter(e=>e.length>0)}function Le(e){let t=e.write??(e=>process.stdout.write(e)),n=e.verbose,a=0,o=`idle`,s=`Ready`,c=``,l=``,f=``,p=``,m=``,h=``,g=null,_=[],y=!1,b=null,x=0,S=0,C=1,w=null,T=`single-session`,E=new Map,D=null,A=0;function j(e){let t=process.stdout.columns||80,n=0;for(let i of e.split(`
|
|
3
|
-
`)){if(i.length===0){n++;continue}let e=r(i);n+=Math.max(1,Math.ceil(e/t))}return e.endsWith(`
|
|
4
|
-
`)&&n--,n}function M(e){t(e),a+=j(e)}function N(){a<=0||(v(`[bridge:ui] clearStatusLines count=${a}`),t(`\x1b[${a}A`),t(`\x1B[J`),a=0)}function P(e){N(),t(e)}function F(e){Ie(e).then(e=>{_=e,z()}).catch(e=>{v(`QR code generation failed: ${e}`,{level:`error`})})}function ee(){N();let e=d[A%d.length],t=``;c&&(t+=i.dim(` · `)+i.dim(c)),l&&(t+=i.dim(` · `)+i.dim(l)),M(`${i.yellow(e)} ${i.yellow(`Connecting`)}${t}\n`)}function I(){L(),ee(),D=setInterval(()=>{A++,ee()},150)}function L(){D&&(clearInterval(D),D=null)}function z(){if(o===`reconnecting`||o===`failed`)return;N();let e=o===`idle`;if(y)for(let e of _)M(`${i.dim(e)}\n`);let t=u,n=e?i.green:i.cyan,r=(e?i.green:i.cyan)(s),a=``;if(c&&(a+=i.dim(` · `)+i.dim(c)),l&&T!==`worktree`&&(a+=i.dim(` · `)+i.dim(l)),process.env.USER_TYPE===`ant`&&f&&M(`${i.yellow(`[ANT-ONLY] Logs:`)} ${i.dim(f)}\n`),M(`${n(t)} ${r}${a}\n`),C>1){let e=T===`worktree`?`New sessions will be created in an isolated worktree`:`New sessions will be created in the current directory`;M(` ${i.dim(`Capacity: ${S}/${C} \u00b7 ${e}`)}\n`);for(let[,e]of E){let t=ne(e.title?O(e.title,35):i.dim(`Attached`),e.url),n=e.activity;M(` ${t}${n&&n.type!==`result`&&n.type!==`error`?i.dim(` ${O(n.summary,40)}`):``}
|
|
5
|
-
`)}}if(C===1){let e=T===`single-session`?`Single session · exits when complete`:T===`worktree`?`Capacity: ${S}/1 \u00b7 New sessions will be created in an isolated worktree`:`Capacity: ${S}/1 \u00b7 New sessions will be created in the current directory`;M(` ${i.dim(e)}\n`)}C===1&&!e&&b&&Date.now()-x<3e4&&M(` ${i.dim(O(b,60))}\n`);let d=g??p;if(d){M(`
|
|
6
|
-
`);let t=e?G(d):R(d),n=y?i.dim.italic(`space to hide QR code`):i.dim.italic(`space to show QR code`),r=w?i.dim.italic(` · w to toggle spawn mode`):``;M(`${i.dim(t)}\n`),M(`${n}${r}\n`)}}return{printBanner(e,r){m=e.sessionIngressUrl,h=r,p=te(r,m),F(p),n&&t(i.dim(`Remote Control`)+` v2.6.5
|
|
7
|
-
`),n&&(e.spawnMode!==`single-session`&&(t(i.dim(`Spawn mode: `)+`${e.spawnMode}\n`),t(i.dim(`Max concurrent sessions: `)+`${e.maxSessions}\n`)),t(i.dim(`Environment ID: `)+`${r}\n`)),e.sandbox&&t(i.dim(`Sandbox: `)+`${i.green(`Enabled`)}\n`),t(`
|
|
8
|
-
`),I()},logSessionStart(e,t){if(n){let n=O(t,80);P(i.dim(`[${K()}]`)+` Session started: ${i.white(`"${n}"`)} (${i.dim(e)})\n`)}},logSessionComplete(e,t){P(i.dim(`[${K()}]`)+` Session ${i.green(`completed`)} (${k(t)}) ${i.dim(e)}\n`)},logSessionFailed(e,t){P(i.dim(`[${K()}]`)+` Session ${i.red(`failed`)}: ${t} ${i.dim(e)}\n`)},logStatus(e){P(i.dim(`[${K()}]`)+` ${e}\n`)},logVerbose(e){n&&P(i.dim(`[${K()}] ${e}`)+`
|
|
9
|
-
`)},logError(e){P(i.red(`[${K()}] Error: ${e}`)+`
|
|
10
|
-
`)},logReconnected(e){P(i.dim(`[${K()}]`)+` ${i.green(`Reconnected`)} after ${k(e)}\n`)},setRepoInfo(e,t){c=e,l=t},setDebugLogPath(e){f=e},updateIdleStatus(){L(),o=`idle`,s=`Ready`,b=null,x=0,g=null,F(p),z()},setAttached(e){L(),o=`attached`,s=`Connected`,b=null,x=0,C<=1&&(g=W(e,h,m),F(g)),z()},updateReconnectingStatus(e,t){if(L(),N(),o=`reconnecting`,y)for(let e of _)M(`${i.dim(e)}\n`);let n=d[A%d.length];A++,M(`${i.yellow(n)} ${i.yellow(`Reconnecting`)} ${i.dim(`·`)} ${i.dim(`retrying in ${e}`)} ${i.dim(`·`)} ${i.dim(`disconnected ${t}`)}\n`)},updateFailedStatus(e){L(),N(),o=`failed`;let t=``;c&&(t+=i.dim(` · `)+i.dim(c)),l&&(t+=i.dim(` · `)+i.dim(l)),M(`${i.red(`×`)} ${i.red(`Remote Control Failed`)}${t}\n`),M(`${i.dim(H)}\n`),e&&M(`${i.red(e)}\n`)},updateSessionStatus(e,t,n,r){n.type===`tool_start`&&(b=n.summary,x=Date.now()),z()},clearStatus(){L(),N()},toggleQr(){y=!y,z()},updateSessionCount(e,t,n){S===e&&C===t&&T===n||(S=e,C=t,T=n)},setSpawnModeDisplay(e){w!==e&&(w=e,e&&(T=e))},addSession(e,t){E.set(e,{url:t})},updateSessionActivity(e,t){let n=E.get(e);n&&(n.activity=t)},setSessionTitle(e,t){let n=E.get(e);n&&(n.title=t,!(o===`reconnecting`||o===`failed`)&&(C===1&&(o=`titled`,s=O(t,40)),z()))},removeSession(e){E.delete(e)},refreshDisplay(){o===`reconnecting`||o===`failed`||z()}}}Y();var Re=10,ze=10;function Be(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}var Ve={Read:`Reading`,Write:`Writing`,Edit:`Editing`,MultiEdit:`Editing`,Bash:`Running`,Glob:`Searching`,Grep:`Searching`,WebFetch:`Fetching`,WebSearch:`Searching`,Task:`Running task`,FileReadTool:`Reading`,FileWriteTool:`Writing`,FileEditTool:`Editing`,GlobTool:`Searching`,GrepTool:`Searching`,BashTool:`Running`,NotebookEditTool:`Editing notebook`,LSP:`LSP`};function He(e,t){let n=Ve[e]??e,r=t.file_path??t.filePath??t.pattern??t.command?.slice(0,60)??t.url??t.query??``;return r?`${n} ${r}`:n}function Ue(e,t,n){let r;try{r=g(e)}catch{return[]}if(!r||typeof r!=`object`)return[];let i=r,a=[],o=Date.now();switch(i.type){case`assistant`:{let e=i.message;if(!e)break;let r=e.content;if(!Array.isArray(r))break;for(let e of r){if(!e||typeof e!=`object`)continue;let r=e;if(r.type===`tool_use`){let e=r.name??`Tool`,i=r.input??{},s=He(e,i);a.push({type:`tool_start`,summary:s,timestamp:o}),n(`[bridge:activity] sessionId=${t} tool_use name=${e} ${Ge(i)}`)}else if(r.type===`text`){let e=r.text??``;e.length>0&&(a.push({type:`text`,summary:e.slice(0,80),timestamp:o}),n(`[bridge:activity] sessionId=${t} text "${e.slice(0,100)}"`))}}break}case`result`:{let e=i.subtype;if(e===`success`)a.push({type:`result`,summary:`Session completed`,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=success`);else if(e){let r=i.errors?.[0]??`Error: ${e}`;a.push({type:`error`,summary:r,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=${e} error="${r}"`)}else n(`[bridge:activity] sessionId=${t} result subtype=undefined`);break}default:break}return a}function We(e){if(e.parent_tool_use_id!=null||e.isSynthetic||e.isReplay)return;let t=e.message?.content,n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let e of t)if(e&&typeof e==`object`&&e.type===`text`){n=e.text;break}}return n=n?.trim(),n||void 0}function Ge(e){let t=[];for(let[n,r]of Object.entries(e))if(typeof r==`string`&&t.push(`${n}="${r.slice(0,100)}"`),t.length>=3)break;return t.join(` `)}function Ke(e){return{spawn(t,n){let r=Be(t.sessionId),i;if(e.debugFile){let t=e.debugFile.lastIndexOf(`.`);i=t>0?`${e.debugFile.slice(0,t)}-${r}${e.debugFile.slice(t)}`:`${e.debugFile}-${r}`}else (e.verbose||process.env.USER_TYPE===`ant`)&&(i=Oe(Te(),`claude`,`bridge-session-${r}.log`));let a=null,o;e.debugFile&&(o=Oe(De(e.debugFile),`bridge-transcript-${r}.jsonl`),a=Ae(o,{flags:`a`}),a.on(`error`,t=>{e.onDebug(`[bridge:session] Transcript write error: ${t.message}`),a=null}),e.onDebug(`[bridge:session] Transcript log: ${o}`));let s=[...e.scriptArgs,`--print`,`--sdk-url`,t.sdkUrl,`--session-id`,t.sessionId,`--input-format`,`stream-json`,`--output-format`,`stream-json`,`--replay-user-messages`,...e.verbose?[`--verbose`]:[],...i?[`--debug-file`,i]:[],...e.permissionMode?[`--permission-mode`,e.permissionMode]:[]],c={...e.env,CLAUDE_CODE_OAUTH_TOKEN:void 0,CLAUDE_CODE_ENVIRONMENT_KIND:`bridge`,...e.sandbox&&{CLAUDE_CODE_FORCE_SANDBOX:`1`},CLAUDE_CODE_SESSION_ACCESS_TOKEN:t.accessToken,CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2:`1`,...t.useCcrV2&&{CLAUDE_CODE_USE_CCR_V2:`1`,CLAUDE_CODE_WORKER_EPOCH:String(t.workerEpoch)}};e.onDebug(`[bridge:session] Spawning sessionId=${t.sessionId} sdkUrl=${t.sdkUrl} accessToken=${t.accessToken?`present`:`MISSING`}`),e.onDebug(`[bridge:session] Child args: ${s.join(` `)}`),i&&e.onDebug(`[bridge:session] Debug log: ${i}`);let l=Me(e.execPath,s,{cwd:n,stdio:[`pipe`,`pipe`,`pipe`],env:c,windowsHide:!0});e.onDebug(`[bridge:session] sessionId=${t.sessionId} pid=${l.pid}`);let u=[],d=null,f=[],p=!1,h=!1;l.stderr&&Ne({input:l.stderr}).on(`line`,t=>{e.verbose&&process.stderr.write(t+`
|
|
11
|
-
`),f.length>=ze&&f.shift(),f.push(t)}),l.stdout&&Ne({input:l.stdout}).on(`line`,n=>{a&&a.write(n+`
|
|
12
|
-
`),e.onDebug(`[bridge:ws] sessionId=${t.sessionId} <<< ${se(n)}`),e.verbose&&process.stderr.write(n+`
|
|
13
|
-
`);let r=Ue(n,t.sessionId,e.onDebug);for(let n of r)u.length>=Re&&u.shift(),u.push(n),d=n,e.onActivity?.(t.sessionId,n);{let r;try{r=g(n)}catch{}if(r&&typeof r==`object`){let n=r;if(n.type===`control_request`)n.request?.subtype===`can_use_tool`&&e.onPermissionRequest&&e.onPermissionRequest(t.sessionId,r,t.accessToken);else if(n.type===`user`&&!h&&t.onFirstUserMessage){let e=We(n);e&&(h=!0,t.onFirstUserMessage(e))}}}});let _=new Promise(n=>{l.on(`close`,(r,i)=>{a&&(a.end(),a=null),i===`SIGTERM`||i===`SIGINT`?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} interrupted signal=${i} pid=${l.pid}`),n(`interrupted`)):r===0?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} completed exit_code=0 pid=${l.pid}`),n(`completed`)):(e.onDebug(`[bridge:session] sessionId=${t.sessionId} failed exit_code=${r} pid=${l.pid}`),n(`failed`))}),l.on(`error`,r=>{e.onDebug(`[bridge:session] sessionId=${t.sessionId} spawn error: ${r.message}`),n(`failed`)})}),v={sessionId:t.sessionId,done:_,activities:u,accessToken:t.accessToken,lastStderr:f,get currentActivity(){return d},kill(){l.killed||(e.onDebug(`[bridge:session] Sending SIGTERM to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGTERM`))},forceKill(){!p&&l.pid&&(p=!0,e.onDebug(`[bridge:session] Sending SIGKILL to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGKILL`))},writeStdin(n){l.stdin&&!l.stdin.destroyed&&(e.onDebug(`[bridge:ws] sessionId=${t.sessionId} >>> ${se(n)}`),l.stdin.write(n))},updateAccessToken(n){v.accessToken=n,v.writeStdin(m({type:`update_environment_variables`,variables:{CLAUDE_CODE_SESSION_ACCESS_TOKEN:n}})+`
|
|
14
|
-
`),e.onDebug(`[bridge:session] Sent token refresh via stdin for sessionId=${t.sessionId}`)}};return v}}}y(),V(),ce(),X();var qe={connInitialMs:2e3,connCapMs:12e4,connGiveUpMs:6e5,generalInitialMs:500,generalCapMs:3e4,generalGiveUpMs:6e5},Je=1e3,Ye=32;async function Xe(){return f(`tengu_ccr_bridge_multi_session`)}function Ze(e){return e.connCapMs*2}function Qe(){let e=[...he()],t=ge();return t&&e.push(t),e}function $e(e,t,n){try{return e.spawn(t,n)}catch(e){let t=h(e);return D(Error(`Session spawn failed: ${t}`)),t}}async function et(t,r,i,a,o,s,c,l=qe,u,d){let f=new AbortController;c.aborted?f.abort():c.addEventListener(`abort`,()=>f.abort(),{once:!0});let p=f.signal,m=new Map,g=new Map,_=new Map,y=new Map,b=new Map,x=new Map,S=new Set,T=new Map,E=new Set,O=new Set,A=_e(p);async function M(){ie(`heartbeat: checking ${m.size} active session(s)`);let e=!1,t=!1,n=[];for(let[i]of m){let o=_.get(i),s=b.get(i);if(!(!o||!s))try{await a.heartbeatWork(r,o,s),e=!0}catch(e){v(`[bridge:heartbeat] Failed for sessionId=${i} workId=${o}: ${h(e)}`),e instanceof P&&(C(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),e.status===401||e.status===403?n.push(i):t=!0)}}for(let e of n){s.logVerbose(`Session ${e} token expired — re-queuing via bridge/reconnect`);try{await a.reconnectSession(r,e),v(`[bridge:heartbeat] Re-queued sessionId=${e} via bridge/reconnect`)}catch(t){s.logError(`Failed to refresh session ${e} token: ${h(t)}`),v(`[bridge:heartbeat] reconnectSession(${e}) failed: ${h(t)}`,{level:`error`})}}return t?`fatal`:n.length>0?`auth_failed`:e?`ok`:`failed`}let ee=new Set,te=d?$({getAccessToken:d,onRefresh:(e,t)=>{let n=m.get(e);n&&(ee.has(e)?(s.logVerbose(`Refreshing session ${e} token via bridge/reconnect`),a.reconnectSession(r,e).catch(t=>{s.logError(`Failed to refresh session ${e} token: ${h(t)}`),v(`[bridge:token] reconnectSession(${e}) failed: ${h(t)}`,{level:`error`})})):n.updateAccessToken(t))},label:`bridge`}):null,ne=Date.now(),R=new Set;function B(e){R.add(e),e.finally(()=>R.delete(e))}let V=0,H=0,U=null,W=null,G=null,K=null,q=!1;if(v(`[bridge:work] Starting poll loop spawnMode=${t.spawnMode} maxSessions=${t.maxSessions} environmentId=${r}`),w(`info`,`bridge_loop_started`,{max_sessions:t.maxSessions,spawn_mode:t.spawnMode}),process.env.USER_TYPE===`ant`){let e;if(t.debugFile){let n=t.debugFile.lastIndexOf(`.`);e=n>0?`${t.debugFile.slice(0,n)}-*${t.debugFile.slice(n)}`:`${t.debugFile}-*`}else e=Oe(Te(),`claude`,`bridge-session-*.log`);s.setDebugLogPath(e)}s.printBanner(t,r),s.updateSessionCount(0,t.maxSessions,t.spawnMode),u&&s.setAttached(u);function J(){s.updateSessionCount(m.size,t.maxSessions,t.spawnMode);for(let[e,t]of m){let n=t.currentActivity;n&&s.updateSessionActivity(y.get(e)??e,n)}if(m.size===0){s.updateIdleStatus();return}let[e,n]=[...m.entries()].pop(),r=g.get(e);if(!r)return;let i=n.currentActivity;if(!i||i.type===`result`||i.type===`error`){t.maxSessions>1&&s.refreshDisplay();return}let a=k(Date.now()-r),o=n.activities.filter(e=>e.type===`tool_start`).slice(-5).map(e=>e.summary);s.updateSessionStatus(e,a,i,o)}function Y(){oe(),J(),K=setInterval(J,Je)}function oe(){K&&(clearInterval(K),K=null)}function se(e,n,i){return o=>{let c=_.get(e);ie(`session done: sessionId=${e} workId=${c??`none`} status=${o} wasTimedOut=${E.has(e)} duration=${Math.round((Date.now()-n)/1e3)}s stderr=${i.lastStderr.length>0?i.lastStderr.join(`\\n`).slice(0,500):`(none)`}`),m.delete(e),g.delete(e),_.delete(e),b.delete(e);let u=y.get(e)??e;y.delete(e),s.removeSession(u),O.delete(u),ee.delete(e);let d=x.get(e);d&&(clearTimeout(d),x.delete(e)),te?.cancel(e),A.wake();let j=E.delete(e),M=j&&o===`interrupted`?`failed`:o,N=Date.now()-n;v(`[bridge:session] sessionId=${e} workId=${c??`unknown`} exited status=${M} duration=${k(N)}`),C(`tengu_bridge_session_done`,{status:M,duration_ms:N}),w(`info`,`bridge_session_done`,{status:M,duration_ms:N}),s.clearStatus(),oe();let P=i.lastStderr.length>0?i.lastStderr.join(`
|
|
15
|
-
`):void 0,F;switch(M){case`completed`:s.logSessionComplete(e,N);break;case`failed`:!j&&!p.aborted&&(F=P??`Process exited with error`,s.logSessionFailed(e,F),D(Error(`Bridge session failed: ${F}`)));break;case`interrupted`:s.logVerbose(`Session ${e} interrupted`);break}M!==`interrupted`&&c&&(B(ot(a,r,c,s,l.stopWorkBaseDelayMs)),S.add(c));let I=T.get(e);if(I&&(T.delete(e),B(re(I.worktreePath,I.worktreeBranch,I.gitRoot,I.hookBased).catch(e=>s.logVerbose(`Failed to remove worktree ${I.worktreePath}: ${h(e)}`)))),M!==`interrupted`&&!p.aborted)if(t.spawnMode!==`single-session`)B(a.archiveSession(u).catch(t=>s.logVerbose(`Failed to archive session ${e}: ${h(t)}`))),v(`[bridge:session] Session ${M}, returning to idle (multi-session mode)`);else{v(`[bridge:session] Session ${M}, aborting poll loop to tear down environment`),f.abort();return}p.aborted||Y()}}for(u||Y();!p.aborted;){let c=ve();try{ie(`poll: envId=${r} activeSessions=${m.size}`);let d=await a.pollForWork(r,i,p,c.reclaim_older_than_ms);if(U!==null||W!==null){let e=Date.now()-(U??W??Date.now());s.logReconnected(e),v(`[bridge:poll] Reconnected after ${k(e)}`),C(`tengu_bridge_reconnected`,{disconnected_ms:e})}if(V=0,H=0,U=null,W=null,G=null,!d){if(m.size>=t.maxSessions){let e=c.multisession_poll_interval_ms_at_capacity;if(c.non_exclusive_heartbeat_interval_ms>0){C(`tengu_bridge_heartbeat_mode_entered`,{active_sessions:m.size,heartbeat_interval_ms:c.non_exclusive_heartbeat_interval_ms});let n=e>0?Date.now()+e:null,r=`ok`,i=0;for(;!p.aborted&&m.size>=t.maxSessions&&(n===null||Date.now()<n);){let e=ve();if(e.non_exclusive_heartbeat_interval_ms<=0)break;let t=A.signal();if(r=await M(),r===`auth_failed`||r===`fatal`){t.cleanup();break}i++,await j(e.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}let a=r===`auth_failed`||r===`fatal`?r:p.aborted?`shutdown`:m.size<t.maxSessions?`capacity_changed`:n!==null&&Date.now()>=n?`poll_due`:`config_disabled`;if(C(`tengu_bridge_heartbeat_mode_exited`,{reason:a,heartbeat_cycles:i,active_sessions:m.size}),a===`poll_due`&&v(`[bridge:poll] Heartbeat poll_due after ${i} cycles — falling through to pollForWork`),r===`auth_failed`||r===`fatal`){let t=A.signal();await j(e>0?e:c.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}}else if(e>0){let t=A.signal();await j(e,t.signal),t.cleanup()}}else await j(m.size>0?c.multisession_poll_interval_ms_partial_capacity:c.multisession_poll_interval_ms_not_at_capacity,p);continue}let f=m.size>=t.maxSessions;if(S.has(d.id)){if(v(`[bridge:work] Skipping already-completed workId=${d.id}`),f){let e=A.signal();c.non_exclusive_heartbeat_interval_ms>0?(await M(),await j(c.non_exclusive_heartbeat_interval_ms,e.signal)):c.multisession_poll_interval_ms_at_capacity>0&&await j(c.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}else await j(1e3,p);continue}let N;try{N=Se(d.secret)}catch(e){let t=h(e);if(s.logError(`Failed to decode work secret for workId=${d.id}: ${t}`),C(`tengu_bridge_work_secret_failed`,{}),S.add(d.id),B(ot(a,r,d.id,s,l.stopWorkBaseDelayMs)),f){let e=A.signal();c.non_exclusive_heartbeat_interval_ms>0?(await M(),await j(c.non_exclusive_heartbeat_interval_ms,e.signal)):c.multisession_poll_interval_ms_at_capacity>0&&await j(c.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}continue}let P=async()=>{v(`[bridge:work] Acknowledging workId=${d.id}`);try{await a.acknowledgeWork(r,d.id,N.session_ingress_token)}catch(e){v(`[bridge:work] Acknowledge failed workId=${d.id}: ${h(e)}`)}},ne=d.data.type;switch(d.data.type){case`healthcheck`:await P(),v(`[bridge:work] Healthcheck received`),s.logVerbose(`Healthcheck received`);break;case`session`:{let i=d.data.id;ie(`work received: type=session sessionId=${i} workId=${d.id}`);try{F(i,`session_id`)}catch{await P(),s.logError(`Invalid session_id received: ${i}`);break}let c=m.get(i);if(c){c.updateAccessToken(N.session_ingress_token),b.set(i,N.session_ingress_token),_.set(i,d.id),te?.schedule(i,N.session_ingress_token),v(`[bridge:work] Updated access token for existing sessionId=${i} workId=${d.id}`),await P();break}if(m.size>=t.maxSessions){v(`[bridge:work] At capacity (${m.size}/${t.maxSessions}), cannot spawn new session for workId=${d.id}`);break}await P();let f=Date.now(),k,A=!1,M;if(N.use_code_sessions===!0||n(process.env.CLAUDE_BRIDGE_USE_CCR_V2)){k=Ce(t.apiBaseUrl,i);for(let e=1;e<=2;e++)try{M=await be(k,N.session_ingress_token),A=!0,v(`[bridge:session] CCR v2: registered worker sessionId=${i} epoch=${M} attempt=${e}`);break}catch(t){let n=h(t);if(e<2){if(v(`[bridge:session] CCR v2: registerWorker attempt ${e} failed, retrying: ${n}`),await j(2e3,p),p.aborted)break;continue}s.logError(`CCR v2 worker registration failed for session ${i}: ${n}`),D(Error(`registerWorker failed: ${n}`)),S.add(d.id),B(ot(a,r,d.id,s,l.stopWorkBaseDelayMs))}if(!A)break}else k=xe(t.sessionIngressUrl,i);let ne=t.spawnMode,R=t.dir,z=0;if(ne===`worktree`&&(u===void 0||!ye(i,u))){let e=Date.now();try{let t=await L(`bridge-${Be(i)}`);z=Date.now()-e,T.set(i,{worktreePath:t.worktreePath,worktreeBranch:t.worktreeBranch,gitRoot:t.gitRoot,hookBased:t.hookBased}),R=t.worktreePath,v(`[bridge:session] Created worktree for sessionId=${i} at ${t.worktreePath}`)}catch(e){let t=h(e);s.logError(`Failed to create worktree for session ${i}: ${t}`),D(Error(`Worktree creation failed: ${t}`)),S.add(d.id),B(ot(a,r,d.id,s,l.stopWorkBaseDelayMs));break}}v(`[bridge:session] Spawning sessionId=${i} sdkUrl=${k}`);let V=ae(i);ie(`spawning session: sessionId=${i} sdkUrl=${k} useCcrV2=${A} workerEpoch=${M} dir=${R} accessToken=${N.session_ingress_token?N.session_ingress_token.slice(0,8)+`...`:`NONE`}`);let H=$e(o,{sessionId:i,sdkUrl:k,accessToken:N.session_ingress_token,useCcrV2:A,workerEpoch:M,onFirstUserMessage:e=>{if(O.has(V))return;O.add(V);let n=mt(e);s.setSessionTitle(V,n),v(`[bridge:title] derived title for ${V}: ${n}`),import(`./createSession-BuJcoBAj.js`).then(({updateBridgeSessionTitle:e})=>e(V,n,{baseUrl:t.apiBaseUrl})).catch(e=>v(`[bridge:title] failed to update title for ${V}: ${e}`,{level:`error`}))}},R);if(typeof H==`string`){s.logError(`Failed to spawn session ${i}: ${H}`);let e=T.get(i);e&&(T.delete(i),B(re(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased).catch(t=>s.logVerbose(`Failed to remove worktree ${e.worktreePath}: ${h(t)}`)))),S.add(d.id),B(ot(a,r,d.id,s,l.stopWorkBaseDelayMs));break}let U=H,W=Date.now()-f;C(`tengu_bridge_session_started`,{active_sessions:m.size,spawn_mode:ne,in_worktree:T.has(i),spawn_duration_ms:W,worktree_create_ms:z,inProtectedNamespace:e()}),w(`info`,`bridge_session_started`,{spawn_mode:ne,in_worktree:T.has(i),spawn_duration_ms:W,worktree_create_ms:z}),m.set(i,U),_.set(i,d.id),b.set(i,N.session_ingress_token),y.set(i,V);let G=Date.now();g.set(i,G),s.logSessionStart(i,`Session ${i}`);let K=Be(i),q;if(t.debugFile){let e=t.debugFile.lastIndexOf(`.`);q=e>0?`${t.debugFile.slice(0,e)}-${K}${t.debugFile.slice(e)}`:`${t.debugFile}-${K}`}else (t.verbose||process.env.USER_TYPE===`ant`)&&(q=Oe(Te(),`claude`,`bridge-session-${K}.log`));q&&s.logVerbose(`Debug log: ${q}`),s.addSession(V,I(V,t.sessionIngressUrl)),Y(),s.setAttached(V),ht(V,t.apiBaseUrl).then(e=>{e&&m.has(i)&&(O.add(V),s.setSessionTitle(V,e),v(`[bridge:title] server title for ${V}: ${e}`))}).catch(e=>v(`[bridge:title] failed to fetch title for ${V}: ${e}`,{level:`error`}));let J=t.sessionTimeoutMs??864e5;if(J>0){let e=setTimeout(st,J,i,J,s,E,U);x.set(i,e)}A&&ee.add(i),te?.schedule(i,N.session_ingress_token),U.done.then(se(i,G,U));break}default:await P(),v(`[bridge:work] Unknown work type: ${ne}, skipping`);break}if(f){let e=A.signal();c.non_exclusive_heartbeat_interval_ms>0?(await M(),await j(c.non_exclusive_heartbeat_interval_ms,e.signal)):c.multisession_poll_interval_ms_at_capacity>0&&await j(c.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}}catch(e){if(p.aborted)break;if(e instanceof P){q=!0,N(e.errorType)?s.logStatus(e.message):z(e)?v(`[bridge:work] Suppressed 403 error: ${e.message}`):(s.logError(e.message),D(e)),C(`tengu_bridge_fatal_error`,{status:e.status,error_type:e.errorType}),w(N(e.errorType)?`info`:`error`,`bridge_fatal_error`,{status:e.status,error_type:e.errorType});break}let t=le(e);if(ie(`poll error: ${t} isConn=${nt(e)} isServer=${rt(e)} activeSessions=${m.size}`),nt(e)||rt(e)){let e=Date.now();G!==null&&e-G>Ze(l)&&(v(`[bridge:work] Detected system sleep (${Math.round((e-G)/1e3)}s gap), resetting error budget`),w(`info`,`bridge_poll_sleep_detected`,{gapMs:e-G}),U=null,V=0,W=null,H=0),G=e,U||(U=e);let n=e-U;if(n>=l.connGiveUpMs){s.logError(`Server unreachable for ${Math.round(n/6e4)} minutes, giving up.`),C(`tengu_bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),w(`error`,`bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),q=!0;break}W=null,H=0,V=V?Math.min(V*2,l.connCapMs):l.connInitialMs;let r=it(V);s.logVerbose(`Connection error, retrying in ${at(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),s.updateReconnectingStatus(at(r),k(n)),ve().non_exclusive_heartbeat_interval_ms>0&&await M(),await j(r,p)}else{let e=Date.now();G!==null&&e-G>Ze(l)&&(v(`[bridge:work] Detected system sleep (${Math.round((e-G)/1e3)}s gap), resetting error budget`),w(`info`,`bridge_poll_sleep_detected`,{gapMs:e-G}),U=null,V=0,W=null,H=0),G=e,W||(W=e);let n=e-W;if(n>=l.generalGiveUpMs){s.logError(`Persistent errors for ${Math.round(n/6e4)} minutes, giving up.`),C(`tengu_bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),w(`error`,`bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),q=!0;break}U=null,V=0,H=H?Math.min(H*2,l.generalCapMs):l.generalInitialMs;let r=it(H);s.logVerbose(`Poll failed, retrying in ${at(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),s.updateReconnectingStatus(at(r),k(n)),ve().non_exclusive_heartbeat_interval_ms>0&&await M(),await j(r,p)}}}oe(),s.clearStatus();let ce=Date.now()-ne;C(`tengu_bridge_shutdown`,{active_sessions:m.size,loop_duration_ms:ce}),w(`info`,`bridge_shutdown`,{active_sessions:m.size,loop_duration_ms:ce});let ue=new Set(m.keys());u&&ue.add(u);let de=new Map(y);if(m.size>0){v(`[bridge:shutdown] Shutting down ${m.size} active session(s)`),s.logStatus(`Shutting down ${m.size} active session(s)\u2026`);let e=new Map(_);for(let[e,t]of m.entries())v(`[bridge:shutdown] Sending SIGTERM to sessionId=${e}`),t.kill();let t=new AbortController;await Promise.race([Promise.allSettled([...m.values()].map(e=>e.done)),j(l.shutdownGraceMs??3e4,t.signal)]),t.abort();for(let[e,t]of m.entries())v(`[bridge:shutdown] Force-killing stuck sessionId=${e}`),t.forceKill();for(let e of x.values())clearTimeout(e);if(x.clear(),te?.cancelAll(),T.size>0){let e=[...T.values()];T.clear(),v(`[bridge:shutdown] Cleaning up ${e.length} worktree(s)`),await Promise.allSettled(e.map(e=>re(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased)))}await Promise.allSettled([...e.entries()].map(([e,t])=>a.stopWork(r,t,!0).catch(n=>s.logVerbose(`Failed to stop work ${t} for session ${e}: ${h(n)}`))))}if(R.size>0&&await Promise.allSettled([...R]),t.spawnMode===`single-session`&&u&&!q){s.logStatus("Resume this session by running `claude remote-control --continue`"),v(`[bridge:shutdown] Skipping archive+deregister to allow resume of session ${u}`);return}ue.size>0&&(v(`[bridge:shutdown] Archiving ${ue.size} session(s)`),await Promise.allSettled([...ue].map(e=>a.archiveSession(de.get(e)??ae(e)).catch(t=>s.logVerbose(`Failed to archive session ${e}: ${h(t)}`)))));try{await a.deregisterEnvironment(r),v(`[bridge:shutdown] Environment deregistered, bridge offline`),s.logVerbose(`Environment deregistered.`)}catch(e){s.logVerbose(`Failed to deregister environment: ${h(e)}`)}let{clearBridgePointer:X}=await import(`./bridgePointer-FvAMj3re.js`);await X(t.dir),s.logVerbose(`Environment offline.`)}var tt=new Set([`ECONNREFUSED`,`ECONNRESET`,`ETIMEDOUT`,`ENETUNREACH`,`EHOSTUNREACH`]);function nt(e){return!!(e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&tt.has(e.code))}function rt(e){return!!e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&e.code===`ERR_BAD_RESPONSE`}function it(e){return Math.max(0,e+e*.25*(2*Math.random()-1))}function at(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}async function ot(e,t,n,r,i=1e3){for(let a=1;a<=3;a++)try{await e.stopWork(t,n,!1),v(`[bridge:work] stopWork succeeded for workId=${n} on attempt ${a}/3`);return}catch(e){if(e instanceof P){z(e)?v(`[bridge:work] Suppressed stopWork 403 for ${n}: ${e.message}`):r.logError(`Failed to stop work ${n}: ${e.message}`),w(`error`,`bridge_stop_work_failed`,{attempts:a,fatal:!0});return}let t=h(e);if(a<3){let e=it(i*2**(a-1));r.logVerbose(`Failed to stop work ${n} (attempt ${a}/3), retrying in ${at(e)}: ${t}`),await j(e)}else r.logError(`Failed to stop work ${n} after 3 attempts: ${t}`),w(`error`,`bridge_stop_work_failed`,{attempts:3})}}function st(e,t,n,r,i){v(`[bridge:session] sessionId=${e} timed out after ${k(t)}`),C(`tengu_bridge_session_timeout`,{timeout_ms:t}),n.logSessionFailed(e,`Session timed out after ${k(t)}`),r.add(e),i.kill()}var ct=[`session`,`same-dir`,`worktree`];function lt(e){return e===`session`?`single-session`:e===`same-dir`?`same-dir`:e===`worktree`?`worktree`:`--spawn requires one of: ${ct.join(`, `)} (got: ${e??`<missing>`})`}function ut(e){let t=e===void 0?NaN:parseInt(e,10);return isNaN(t)||t<1?`--capacity requires a positive integer (got: ${e??`<missing>`})`:t}function dt(e){let t=!1,n=!1,r,i,a,o,s=!1,c,l,u,d,f=!1;for(let m=0;m<e.length;m++){let h=e[m];if(h===`--help`||h===`-h`)s=!0;else if(h===`--verbose`||h===`-v`)t=!0;else if(h===`--sandbox`)n=!0;else if(h===`--no-sandbox`)n=!1;else if(h===`--debug-file`&&m+1<e.length)r=ke(e[++m]);else if(h.startsWith(`--debug-file=`))r=ke(h.slice(13));else if(h===`--session-timeout`&&m+1<e.length)i=parseInt(e[++m],10)*1e3;else if(h.startsWith(`--session-timeout=`))i=parseInt(h.slice(18),10)*1e3;else if(h===`--permission-mode`&&m+1<e.length)a=e[++m];else if(h.startsWith(`--permission-mode=`))a=h.slice(18);else if(h===`--name`&&m+1<e.length)o=e[++m];else if(h.startsWith(`--name=`))o=h.slice(7);else if(h===`--session-id`&&m+1<e.length){if(d=e[++m],!d)return p(`--session-id requires a value`)}else if(h.startsWith(`--session-id=`)){if(d=h.slice(13),!d)return p(`--session-id requires a value`)}else if(h===`--continue`||h===`-c`)f=!0;else if(h===`--spawn`||h.startsWith(`--spawn=`)){if(c!==void 0)return p(`--spawn may only be specified once`);let t=lt(h.startsWith(`--spawn=`)?h.slice(8):e[++m]);if(t===`single-session`||t===`same-dir`||t===`worktree`)c=t;else return p(t)}else if(h===`--capacity`||h.startsWith(`--capacity=`)){if(l!==void 0)return p(`--capacity may only be specified once`);let t=ut(h.startsWith(`--capacity=`)?h.slice(11):e[++m]);if(typeof t==`number`)l=t;else return p(t)}else if(h===`--create-session-in-dir`)u=!0;else if(h===`--no-create-session-in-dir`)u=!1;else return p(`Unknown argument: ${h}\nRun 'claude remote-control --help' for usage.`)}if(c===`single-session`&&l!==void 0)return p(`--capacity cannot be used with --spawn=session (single-session mode has fixed capacity 1).`);if((d||f)&&(c!==void 0||l!==void 0||u!==void 0))return p(`--session-id and --continue cannot be used with --spawn, --capacity, or --create-session-in-dir.`);if(d&&f)return p(`--session-id and --continue cannot be used together.`);return{verbose:t,sandbox:n,debugFile:r,sessionTimeoutMs:i,permissionMode:a,name:o,spawnMode:c,capacity:l,createSessionInDir:u,sessionId:d,continueSession:f,help:s};function p(e){return{verbose:t,sandbox:n,debugFile:r,sessionTimeoutMs:i,permissionMode:a,name:o,spawnMode:c,capacity:l,createSessionInDir:u,sessionId:d,continueSession:f,help:s,error:e}}}async function ft(){let{EXTERNAL_PERMISSION_MODES:e}=await import(`./permissions-Ps_D01ZB.js`),t=e.join(`, `),n=await Xe(),r=`
|
|
16
|
-
Remote Control - Connect your local environment to claude.ai/code
|
|
17
|
-
|
|
18
|
-
USAGE
|
|
19
|
-
claude remote-control [options]
|
|
20
|
-
OPTIONS
|
|
21
|
-
--name <name> Name for the session (shown in claude.ai/code)
|
|
22
|
-
-c, --continue Resume the last session in this directory
|
|
23
|
-
--session-id <id> Resume a specific session by ID (cannot be
|
|
24
|
-
used with spawn flags or --continue)
|
|
25
|
-
--permission-mode <mode> Permission mode for spawned sessions
|
|
26
|
-
(${t})
|
|
27
|
-
--debug-file <path> Write debug logs to file
|
|
28
|
-
-v, --verbose Enable verbose output
|
|
29
|
-
-h, --help Show this help
|
|
30
|
-
${n?` --spawn <mode> Spawn mode: same-dir, worktree, session
|
|
31
|
-
(default: same-dir)
|
|
32
|
-
--capacity <N> Max concurrent sessions in worktree or
|
|
33
|
-
same-dir mode (default: ${Ye})
|
|
34
|
-
--[no-]create-session-in-dir Pre-create a session in the current
|
|
35
|
-
directory; in worktree mode this session
|
|
36
|
-
stays in cwd while on-demand sessions get
|
|
37
|
-
isolated worktrees (default: on)
|
|
38
|
-
`:``}
|
|
39
|
-
DESCRIPTION
|
|
40
|
-
Remote Control allows you to control sessions on your local device from
|
|
41
|
-
claude.ai/code (https://claude.ai/code). Run this command in the
|
|
42
|
-
directory you want to work in, then connect from the Claude app or web.
|
|
43
|
-
${n?`
|
|
44
|
-
Remote Control runs as a persistent server that accepts multiple concurrent
|
|
45
|
-
sessions in the current directory. One session is pre-created on start so
|
|
46
|
-
you have somewhere to type immediately. Use --spawn=worktree to isolate
|
|
47
|
-
each on-demand session in its own git worktree, or --spawn=session for
|
|
48
|
-
the classic single-session mode (exits when that session ends). Press 'w'
|
|
49
|
-
during runtime to toggle between same-dir and worktree.
|
|
50
|
-
`:``}
|
|
51
|
-
NOTES
|
|
52
|
-
- You must be logged in with a Claude account that has a subscription
|
|
53
|
-
- Run \`claude\` first in the directory to accept the workspace trust dialog
|
|
54
|
-
${n?` - Worktree mode requires a git repository or WorktreeCreate/WorktreeRemove hooks
|
|
55
|
-
`:``}`;console.log(r)}var pt=80;function mt(e){return O(e.replace(/\s+/g,` `).trim(),pt)}async function ht(e,t){let{getBridgeSession:n}=await import(`./createSession-BuJcoBAj.js`);return(await n(e,{baseUrl:t}))?.title||void 0}async function gt(e){let t=dt(e);if(t.help){await ft();return}t.error&&(console.error(`Error: ${t.error}`),process.exit(1));let{verbose:n,sandbox:r,debugFile:i,sessionTimeoutMs:a,permissionMode:o,name:s,spawnMode:c,capacity:l,createSessionInDir:u,sessionId:d,continueSession:f}=t,m=d,g,_=c!==void 0||l!==void 0||u!==void 0;if(o!==void 0){let{PERMISSION_MODES:e}=await import(`./permissions-Ps_D01ZB.js`),t=e;t.includes(o)||(console.error(`Error: Invalid permission mode '${o}'. Valid modes: ${t.join(`, `)}`),process.exit(1))}let y=ke(`.`),{enableConfigs:b,checkHasTrustDialogAccepted:S}=await import(`./config-D-dzD6n-.js`);b();let{initSinks:T}=await import(`./sinks-Djiz_5-Z.js`);T();let E=await Xe();_&&!E&&(await x(`tengu_bridge_multi_session_denied`,{used_spawn:c!==void 0,used_capacity:l!==void 0,used_create_session_in_dir:u!==void 0}),await Promise.race([Promise.all([p(),ue()]),j(500,void 0,{unref:!0})]).catch(()=>{}),console.error(`Error: Multi-session Remote Control is not enabled for your account yet.`),process.exit(1));let{setOriginalCwd:O,setCwdState:k}=await import(`./state-B2GIOsTB.js`);O(y),k(y),S()||(console.error(`Error: Workspace not trusted. Please run \`claude\` in ${y} first to review and accept the workspace trust dialog.`),process.exit(1));let{clearOAuthTokenCache:A,checkAndRefreshOAuthTokenIfNeeded:M}=await import(`./auth-CSB2RDKF.js`),{getBridgeAccessToken:N,getBridgeBaseUrl:I}=await import(`./bridgeConfig-D4tpc568.js`);N()||(console.error(pe),process.exit(1));let{getGlobalConfig:te,saveGlobalConfig:ne,getCurrentProjectConfig:L,saveCurrentProjectConfig:R}=await import(`./config-D-dzD6n-.js`);if(!te().remoteDialogSeen){let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout});console.log(`
|
|
56
|
-
Remote Control lets you access this CLI session from the web (claude.ai/code)
|
|
57
|
-
or the Claude app, so you can pick up where you left off on any device.
|
|
58
|
-
|
|
59
|
-
You can disconnect remote access anytime by running /remote-control again.
|
|
60
|
-
`);let t=await new Promise(t=>{e.question(`Enable Remote Control? (y/n) `,t)});e.close(),ne(e=>e.remoteDialogSeen?e:{...e,remoteDialogSeen:!0}),t.toLowerCase()!==`y`&&t.toLowerCase()!==`yes`&&process.exit(0)}if(f){let{readBridgePointerAcrossWorktrees:e}=await import(`./bridgePointer-FvAMj3re.js`),t=await e(y);t||(console.error("Error: No recent session found in this directory or its worktrees. Run `claude remote-control` to start a new one."),process.exit(1));let{pointer:n,dir:r}=t,i=Math.round(n.ageMs/6e4),a=i<60?`${i}m`:`${Math.round(i/60)}h`,o=r===y?``:` from worktree ${r}`;console.error(`Resuming session ${n.sessionId} (${a} ago)${o}\u2026`),m=n.sessionId,g=r}let z=I();z.startsWith(`http://`)&&!z.includes(`localhost`)&&!z.includes(`127.0.0.1`)&&(console.error(`Error: Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`),process.exit(1));let B=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||z,{getBranch:re,getRemoteUrl:V,findGitRoot:H}=await import(`./git-D23Mzu_K.js`),{hasWorktreeCreateHook:U}=await import(`./hooks-BFdX17Za.js`),W=U()||H(y)!==null,G=E?L().remoteControlSpawnMode:void 0;if(G===`worktree`&&!W&&(console.error(`Warning: Saved spawn mode is worktree but this directory is not a git repository. Falling back to same-dir.`),G=void 0,R(e=>e.remoteControlSpawnMode===void 0?e:{...e,remoteControlSpawnMode:void 0})),E&&!G&&W&&c===void 0&&!m&&process.stdin.isTTY){let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout});console.log(`
|
|
61
|
-
Claude Remote Control is launching in spawn mode which lets you create new sessions in this project from Claude Code on Web or your Mobile app. Learn more here: https://code.claude.com/docs/en/remote-control
|
|
62
|
-
|
|
63
|
-
Spawn mode for this project:
|
|
64
|
-
[1] same-dir — sessions share the current directory (default)
|
|
65
|
-
[2] worktree — each session gets an isolated git worktree
|
|
66
|
-
|
|
67
|
-
This can be changed later or explicitly set with --spawn=same-dir or --spawn=worktree.
|
|
68
|
-
`);let t=await new Promise(t=>{e.question(`Choose [1/2] (default: 1): `,t)});e.close();let n=t.trim()===`2`?`worktree`:`same-dir`;G=n,C(`tengu_bridge_spawn_mode_chosen`,{spawn_mode:n}),R(e=>e.remoteControlSpawnMode===n?e:{...e,remoteControlSpawnMode:n})}let K,q;m?(q=`single-session`,K=`resume`):c===void 0?G===void 0?(q=E?`same-dir`:`single-session`,K=`gate_default`):(q=G,K=`saved`):(q=c,K=`flag`);let ie=q===`single-session`?1:l??Ye,J=u??!0;if(!m){let{clearBridgePointer:e}=await import(`./bridgePointer-FvAMj3re.js`);await e(y)}q===`worktree`&&!W&&(console.error(`Error: Worktree mode requires a git repository or WorktreeCreate hooks configured. Use --spawn=session for single-session mode.`),process.exit(1));let Y=await re(),ae=await V(),se=we(),ce=je(),{handleOAuth401Error:le}=await import(`./auth-CSB2RDKF.js`),de=ee({baseUrl:z,getAccessToken:N,runnerVersion:`2.6.5`,onDebug:v,onAuth401:le,getTrustedDeviceToken:fe}),X;if(m){try{F(m,`sessionId`)}catch{console.error(`Error: Invalid session ID "${m}". Session IDs must not contain unsafe characters.`),process.exit(1)}await M(),A();let{getBridgeSession:e}=await import(`./createSession-BuJcoBAj.js`),t=await e(m,{baseUrl:z,getAccessToken:N});if(!t){if(g){let{clearBridgePointer:e}=await import(`./bridgePointer-FvAMj3re.js`);await e(g)}console.error(`Error: Session ${m} not found. It may have been archived or expired, or your login may have lapsed (run \`claude /login\`).`),process.exit(1)}if(!t.environment_id){if(g){let{clearBridgePointer:e}=await import(`./bridgePointer-FvAMj3re.js`);await e(g)}console.error(`Error: Session ${m} has no environment_id. It may never have been attached to a bridge.`),process.exit(1)}X=t.environment_id,v(`[bridge:init] Resuming session ${m} on environment ${X}`)}let Z={dir:y,machineName:se,branch:Y,gitRepoUrl:ae,maxSessions:ie,spawnMode:q,verbose:n,sandbox:r,bridgeId:ce,workerType:`claude_code`,environmentId:je(),reuseEnvironmentId:X,apiBaseUrl:z,sessionIngressUrl:B,debugFile:i,sessionTimeoutMs:a};v(`[bridge:init] bridgeId=${ce}${X?` reuseEnvironmentId=${X}`:``} dir=${y} branch=${Y} gitRepoUrl=${ae} machine=${se}`),v(`[bridge:init] apiBaseUrl=${z} sessionIngressUrl=${B}`),v(`[bridge:init] sandbox=${r}${i?` debugFile=${i}`:``}`);let Q,me;try{let e=await de.registerBridgeEnvironment(Z);Q=e.environment_id,me=e.environment_secret}catch(e){C(`tengu_bridge_registration_failed`,{status:e instanceof P?e.status:void 0}),console.error(e instanceof P&&e.status===404?`Remote Control environments are not available for your account.`:`Error: ${h(e)}`),process.exit(1)}let he;if(m)if(X&&Q!==X)D(Error(`Bridge resume env mismatch: requested ${X}, backend returned ${Q}. Falling back to fresh session.`)),console.warn(`Warning: Could not resume session ${m} — its environment has expired. Creating a fresh session instead.`);else{let e=oe(m),t=e===m?[m]:[m,e],n=!1,r;for(let e of t)try{await de.reconnectSession(Q,e),v(`[bridge:init] Session ${e} re-queued via bridge/reconnect`),he=m,n=!0;break}catch(t){r=t,v(`[bridge:init] reconnectSession(${e}) failed: ${h(t)}`)}if(!n){let e=r,t=e instanceof P;if(g&&t){let{clearBridgePointer:e}=await import(`./bridgePointer-FvAMj3re.js`);await e(g)}console.error(t?`Error: ${h(e)}`:`Error: Failed to reconnect session ${m}: ${h(e)}\nThe session may still be resumable — try running the same command again.`),process.exit(1)}}v(`[bridge:init] Registered, server environmentId=${Q}`);let ge=ve();C(`tengu_bridge_started`,{max_sessions:Z.maxSessions,has_debug_file:!!Z.debugFile,sandbox:Z.sandbox,verbose:Z.verbose,heartbeat_interval_ms:ge.non_exclusive_heartbeat_interval_ms,spawn_mode:Z.spawnMode,spawn_mode_source:K,multi_session_gate:E,pre_create_session:J,worktree_available:W}),w(`info`,`bridge_started`,{max_sessions:Z.maxSessions,sandbox:Z.sandbox,spawn_mode:Z.spawnMode});let _e=Ke({execPath:process.execPath,scriptArgs:Qe(),env:process.env,verbose:n,sandbox:r,debugFile:i,permissionMode:o,onDebug:v,onActivity:(e,t)=>{v(`[bridge:activity] sessionId=${e} ${t.type} ${t.summary}`)},onPermissionRequest:(e,t,n)=>{v(`[bridge:perm] sessionId=${e} tool=${t.request.tool_name} request_id=${t.request_id} (not auto-approving)`)}}),$=Le({verbose:n}),{parseGitHubRepository:ye}=await import(`./detectRepository-DCTvg4p0.js`),be=ae?ye(ae):null,xe=be?be.split(`/`).pop():Ee(y);$.setRepoInfo(xe,Y);let Se=q!==`single-session`&&W;Se&&$.setSpawnModeDisplay(q);let Ce=e=>{if(e[0]===3||e[0]===4){process.emit(`SIGINT`);return}if(e[0]===32){$.toggleQr();return}if(e[0]===119){if(!Se)return;let e=Z.spawnMode===`same-dir`?`worktree`:`same-dir`;Z.spawnMode=e,C(`tengu_bridge_spawn_mode_toggled`,{spawn_mode:e}),$.logStatus(e===`worktree`?`Spawn mode: worktree (new sessions get isolated git worktrees)`:`Spawn mode: same-dir (new sessions share the current directory)`),$.setSpawnModeDisplay(e),$.refreshDisplay(),R(t=>t.remoteControlSpawnMode===e?t:{...t,remoteControlSpawnMode:e});return}};process.stdin.isTTY&&(process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.on(`data`,Ce));let Te=new AbortController,De=()=>{v(`[bridge:shutdown] SIGINT received, shutting down`),Te.abort()},Oe=()=>{v(`[bridge:shutdown] SIGTERM received, shutting down`),Te.abort()};process.on(`SIGINT`,De),process.on(`SIGTERM`,Oe);let Ae=he||null;if(J&&!he){let{createBridgeSession:e}=await import(`./createSession-BuJcoBAj.js`);try{Ae=await e({environmentId:Q,title:s,events:[],gitRepoUrl:ae,branch:Y,signal:Te.signal,baseUrl:z,getAccessToken:N,permissionMode:o}),Ae&&v(`[bridge:init] Created initial session ${Ae}`)}catch(e){v(`[bridge:init] Session creation failed (non-fatal): ${h(e)}`)}}let Me=null;if(Ae&&q===`single-session`){let{writeBridgePointer:e}=await import(`./bridgePointer-FvAMj3re.js`),t={sessionId:Ae,environmentId:Q,source:`standalone`};await e(Z.dir,t),Me=setInterval(e,3600*1e3,Z.dir,t),Me.unref?.()}try{await et(Z,Q,me,de,_e,$,Te.signal,void 0,Ae??void 0,async()=>(A(),await M(),N()))}finally{Me!==null&&clearInterval(Me),process.off(`SIGINT`,De),process.off(`SIGTERM`,Oe),process.stdin.off(`data`,Ce),process.stdin.isTTY&&process.stdin.setRawMode(!1),process.stdin.pause()}process.exit(0)}var _t=class extends Error{constructor(e){super(e),this.name=`BridgeHeadlessPermanentError`}};async function vt(e,t){let{dir:n,log:r}=e;process.chdir(n);let{setOriginalCwd:i,setCwdState:a}=await import(`./state-B2GIOsTB.js`);i(n),a(n);let{enableConfigs:o,checkHasTrustDialogAccepted:s}=await import(`./config-D-dzD6n-.js`);o();let{initSinks:c}=await import(`./sinks-Djiz_5-Z.js`);if(c(),!s())throw new _t(`Workspace not trusted: ${n}. Run \`claude\` in that directory first to accept the trust dialog.`);if(!e.getAccessToken())throw Error(pe);let{getBridgeBaseUrl:l}=await import(`./bridgeConfig-D4tpc568.js`),u=l();if(u.startsWith(`http://`)&&!u.includes(`localhost`)&&!u.includes(`127.0.0.1`))throw new _t(`Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`);let d=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||u,{getBranch:f,getRemoteUrl:p,findGitRoot:m}=await import(`./git-D23Mzu_K.js`),{hasWorktreeCreateHook:g}=await import(`./hooks-BFdX17Za.js`);if(e.spawnMode===`worktree`&&!(g()||m(n)!==null))throw new _t(`Worktree mode requires a git repository or WorktreeCreate hooks. Directory ${n} has neither.`);let _=await f(),v=await p(),y=we(),b=je(),x={dir:n,machineName:y,branch:_,gitRepoUrl:v,maxSessions:e.capacity,spawnMode:e.spawnMode,verbose:!1,sandbox:e.sandbox,bridgeId:b,workerType:`claude_code`,environmentId:je(),apiBaseUrl:u,sessionIngressUrl:d,sessionTimeoutMs:e.sessionTimeoutMs},S=ee({baseUrl:u,getAccessToken:e.getAccessToken,runnerVersion:`2.6.5`,onDebug:r,onAuth401:e.onAuth401,getTrustedDeviceToken:fe}),C,w;try{let e=await S.registerBridgeEnvironment(x);C=e.environment_id,w=e.environment_secret}catch(e){throw Error(`Bridge registration failed: ${h(e)}`)}let T=Ke({execPath:process.execPath,scriptArgs:Qe(),env:process.env,verbose:!1,sandbox:e.sandbox,permissionMode:e.permissionMode,onDebug:r}),E=yt(r);E.printBanner(x,C);let D;if(e.createSessionOnStart){let{createBridgeSession:n}=await import(`./createSession-BuJcoBAj.js`);try{let i=await n({environmentId:C,title:e.name,events:[],gitRepoUrl:v,branch:_,signal:t,baseUrl:u,getAccessToken:e.getAccessToken,permissionMode:e.permissionMode});i&&(D=i,r(`created initial session ${i}`))}catch(e){r(`session pre-creation failed (non-fatal): ${h(e)}`)}}await et(x,C,w,S,T,E,t,void 0,D,async()=>e.getAccessToken())}function yt(e){let t=()=>{};return{printBanner:(t,n)=>e(`registered environmentId=${n} dir=${t.dir} spawnMode=${t.spawnMode} capacity=${t.maxSessions}`),logSessionStart:(t,n)=>e(`session start ${t}`),logSessionComplete:(t,n)=>e(`session complete ${t} (${n}ms)`),logSessionFailed:(t,n)=>e(`session failed ${t}: ${n}`),logStatus:e,logVerbose:e,logError:t=>e(`error: ${t}`),logReconnected:t=>e(`reconnected after ${t}ms`),addSession:(t,n)=>e(`session attached ${t}`),removeSession:t=>e(`session detached ${t}`),updateIdleStatus:t,updateReconnectingStatus:t,updateSessionStatus:t,updateSessionActivity:t,updateSessionCount:t,updateFailedStatus:t,setSpawnModeDisplay:t,setRepoInfo:t,setDebugLogPath:t,setAttached:t,setSessionTitle:t,clearStatus:t,toggleQr:t,refreshDisplay:t}}export{dt as a,rt as i,gt as n,vt as o,nt as r,et as s,_t as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./bridgeMain-C5RDihlX.js";export{e as bridgeMain};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./caches-B5QZDncQ.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fA as e,gA as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as settingsChangeDetector};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t}from"./channelNotification-B7A-9DIl.js";t();export{e as ChannelPermissionRequestNotificationSchema};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./conversation-DKlz47xf.js";var r;e((()=>{t(),r=async(e,t)=>(await n(t),{type:`text`,value:``})}))();export{r as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{la as e,ua as t}from"./paths-BBvuDQl9.js";t();export{e as getOrganizationUUID};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{f as r,l as i}from"./teammate-DMYOtLTK.js";import{Ar as a,Tr as o,Xy as s,pi as c,qy as l}from"./loadAgentsDir-DI1a76pd.js";async function u(e,n,i){if(r())return e(`Cannot set color: This session is a swarm teammate. Teammate colors are assigned by the team leader.`,{display:`system`}),null;if(!i||i.trim()===``)return e(`Please provide a color. Available colors: ${l.join(`, `)}, default`,{display:`system`}),null;let a=i.trim().toLowerCase();return d.includes(a)?(await c(t(),`default`,o()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:void 0}})),e(`Session color reset to default`,{display:`system`}),null):l.includes(a)?(await c(t(),a,o()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:a}})),e(`Session color set to: ${a}`,{display:`system`}),null):(e(`Invalid color "${a}". Available colors: ${l.join(`, `)}, default`,{display:`system`}),null)}var d;e((()=>{n(),s(),a(),i(),d=[`default`,`reset`,`none`,`gray`,`grey`]}))();export{u as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Gi as e,Xi as t,zi as n}from"./loadAgentsDir-DI1a76pd.js";t();export{n as clearCommandsCache,e as getCommands};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,l as t}from"./commitAttribution-C22a3OCi.js";t();export{e as isInternalModelRepo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./context-noninteractive-yiyJriiw.js";t();export{n as call,e as collectContextData};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Ct as n,Jn as r,Xn as i,Z as a,cn as o,gn as s,ot as c,qn as l,yn as u}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{$y as h,Ar as g,Cv as _,Du as v,Eu as y,F_ as b,Fv as x,Hm as S,Hv as C,Mn as w,P_ as T,Qy as E,Sv as D,Um as O,Yt as k,ad as A,cE as j,di as M,fr as N,gE as P,id as F,jn as ee,kn as I,mE as L,nr as R,sE as z,un as B,wi as V,wt as H,xi as U,xt as W,yn as G}from"./loadAgentsDir-DI1a76pd.js";import{C as K,y as q}from"./rcDebugLog-CPKZCtR8.js";import{l as J,r as Y}from"./commitAttribution-C22a3OCi.js";import{n as X,t as Z}from"./caches-B5QZDncQ.js";import{randomUUID as Q}from"crypto";function $(){let e=F();if(!e)return;e.markTranscriptReset?.();let t={type:`status`,subtype:`status`,status:`conversation_cleared`,message:`conversation_cleared`,uuid:Q()};e.writeSdkMessages([t])}async function te({setMessages:t,readFileState:o,discoveredSkillNames:d,loadedNestedMemoryPaths:p,getAppState:y,setAppState:S,setConversationId:C}){let w=B();await k(`clear`,{getAppState:y,setAppState:S,signal:AbortSignal.timeout(w),timeoutMs:w});let T=a();T&&f(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:T});let E=new Set,D=[],A=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(y)for(let e of Object.values(y().tasks))A(e)||(v(e)?(E.add(e.agentId),D.push(e)):h(e)&&E.add(e.identity.agentId));t(()=>[]),$();{let{setContextBlocked:t}=(q(),e(K));t(!1)}C&&C(Q()),Z(E),l(null),r(null),i(null),u(),O(c()),o.clear(),d?.clear(),p?.clear(),S&&S(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!A(r)){t[n]=r;continue}try{r.status===`running`&&(b(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){m(e)}I(n)}return{...e,tasks:t,attribution:Y(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),x(),R(),s({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=n()),await M();for(let e of D)e.status===`running`&&ee(e.id,N(L(e.agentId)));{let{saveMode:t}=(g(),e(V)),{isCoordinatorMode:n}=(j(),e(z));t(n()?`coordinator`:`normal`)}let P=W();P&&U(P);let F=await _(`clear`);F.length>0&&t(()=>F)}var ne=t((()=>{A(),o(),d(),E(),y(),T(),P(),J(),G(),p(),C(),S(),D(),g(),w(),H(),X()}));export{ne as n,te as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./conversation-DKlz47xf.js";e();export{t as clearConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r}from"./createSession-kiTHYXSL.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Cn as i,F as a,In as o,Ln as s,Mn as c,Rn as l,T as u,Ut as d,_ as f,b as p,g as m,h,l as ee,m as te,t as g,tt as _,x as v,xt as y}from"./src-Di342QoJ.js";import{t as b}from"./jsx-runtime-D-D469L8.js";import{Ct as ne,cn as x,ot as re}from"./state-sIHsFpDu.js";import{Mr as ie,Pr as ae}from"./paths-BBvuDQl9.js";import{T as S,d as C,s as w,w as T}from"./debug-UI3T040K.js";import{n as oe,r as E}from"./analytics-DqMQntaB.js";import{i as se,v as ce}from"./git-CN3qtTb_.js";import{a as le,o as D,s as ue}from"./log-CzsijfHZ.js";import{b as O,x as de}from"./teammate-DMYOtLTK.js";import{E as k,g as fe,p as pe,x as A}from"./startupProfiler-DnXZaX4A.js";import{Ar as me,By as he,Dx as ge,Gu as _e,JS as j,Lw as ve,Mi as ye,Mr as be,Ni as xe,Nx as Se,Ox as M,Pr as Ce,Px as we,Ur as Te,YS as Ee,_i as De,gr as Oe,gy as ke,m_ as Ae,my as je,p_ as Me,qu as Ne,wr as N,zy as Pe}from"./loadAgentsDir-DI1a76pd.js";import{i as P,r as F}from"./shellQuote-DgjT8KBA.js";import{t as Fe}from"./useKeybinding-FsOnjW6T.js";import{l as Ie,u as Le}from"./referral-DeDr9zAE.js";import{t as Re}from"./SearchBox-DfOmUoaI.js";import{n as ze,t as Be}from"./useSearchInput-BV_azHiA.js";import{n as Ve,t as I}from"./Messages-DWiKTx5o.js";import{n as He,t as Ue}from"./fuse-Ch_OAlm3.js";import{sep as L}from"path";function We({log:e,onExit:t,onSelect:n}){let[r,i]=R.useState(null);R.useEffect(()=>{i(null),Ce(e)&&Te(e).then(i)},[e]);let a=Ce(e)&&r===null,o=r??e,s=N(o)||``,c=_e();return _(`confirm:no`,t,{context:`Confirmation`}),_(`confirm:yes`,(0,R.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,z.jsxs)(v,{flexDirection:`column`,padding:1,children:[(0,z.jsx)(ee,{message:`Loading session…`}),(0,z.jsx)(p,{dimColor:!0,children:(0,z.jsx)(h,{children:(0,z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,z.jsxs)(v,{flexDirection:`column`,children:[(0,z.jsx)(I,{messages:o.messages,tools:c,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:s,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,z.jsxs)(v,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,z.jsxs)(p,{children:[fe(o.modified),` · `,o.messageCount,` messages`,o.gitBranch?` · ${o.gitBranch}`:``]}),(0,z.jsx)(p,{dimColor:!0,children:(0,z.jsxs)(h,{children:[(0,z.jsx)(m,{shortcut:`Enter`,action:`resume`}),(0,z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var R,z,B=e((()=>{R=t(l(),1),g(),Fe(),Ne(),A(),me(),Ee(),Ve(),z=b()}));function Ge(e,t){if(e===H)return 3+U;let n=i(e),r=t?Math.min(n,t-U-W):n;return Math.max(0,r)+U+W}function Ke(e,t){let n=t-U-W;return i(e)<=n?e:n<=1?e.charAt(0):k(e,n)}function qe({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(G,K),s=n-a-o-2,c=Math.max(0,Math.min(t,e.length-1)),l=Math.max(20,Math.floor(s/2)),u=e.map(e=>Ge(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-$e,n=u[c]??0;for(d=c,f=c+1;d>0||f<e.length;){let r=d>0,i=f<e.length;if(r){let e=(u[d-1]??0)+1;if(n+e<=t){d--,n+=e;continue}}if(i){let e=(u[f]??0)+1;if(n+e<=t){f++,n+=e;continue}}break}}let m=d,h=e.length-f,ee=e.slice(d,f),te=ee.map((e,t)=>d+t);return(0,V.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,V.jsx)(p,{color:`suggestion`,children:i}),m>0&&(0,V.jsxs)(p,{dimColor:!0,children:[Je,m]}),ee.map((e,t)=>{let n=te[t]===c,r=e===H?e:`#${Ke(e,l-U)}`;return(0,V.jsxs)(p,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),h>0?(0,V.jsxs)(p,{dimColor:!0,children:[Ye,h,Xe]}):(0,V.jsx)(p,{dimColor:!0,children:Ze})]})}var V,H,U,W,Je,Ye,Xe,Ze,Qe,$e,G,K,et=e((()=>{l(),g(),A(),V=b(),H=`All`,U=2,W=1,Je=`← `,Ye=`→`,Xe=` (tab to cycle)`,Ze=`(tab to cycle)`,Qe=2,$e=2+Qe+1,G=1+Qe+15,K=14}));function tt({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:o=`expanded`,isDisabled:s=!1,hideIndexes:c=!1,isNodeExpanded:l,onExpand:u,onCollapse:d,getParentPrefix:f,getChildPrefix:p,onUpFromFirstItem:m}){let[h,ee]=q.useState(new Set),te=q.useRef(!1),g=q.useRef(null),_=q.useCallback(e=>l?l(e):h.has(e),[l,h]),y=q.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),b=q.useCallback(e=>e?`▼ `:`▶ `,[]),ne=q.useCallback(e=>` ▸ `,[]),x=f??b,re=p??ne,ie=q.useCallback(e=>{let t=``;return e.hasChildren?t=x(e.isExpanded):e.depth>0&&(t=re(e.depth)),t+e.node.label},[x,re]),ae=q.useMemo(()=>y.map(e=>({label:ie(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[y,ie]),S=q.useMemo(()=>{let e=new Map;return y.forEach(t=>e.set(t.node.id,t.node)),e},[y]),C=q.useCallback(e=>y.find(t=>t.node.id===e),[y]),w=q.useCallback((e,t)=>{let n=C(e);!n||!n.hasChildren||(t?u?u(e):ee(t=>new Set(t).add(e)):d?d(e):ee(t=>{let n=new Set(t);return n.delete(e),n}))},[C,u,d]);return(0,nt.jsx)(v,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||s)return;let t=C(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),w(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),w(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),te.current=!0,w(t.parentId,!1),r)){let e=S.get(t.parentId);e&&r(e)}}}},children:(0,nt.jsx)(ge,{options:ae,onChange:q.useCallback(e=>{let n=S.get(e);n&&t(n)},[S,t]),onFocus:q.useCallback(e=>{if(te.current){te.current=!1;return}if(g.current!==e&&(g.current=e,r)){let t=S.get(e);t&&r(t)}},[r,S]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:o,isDisabled:s,hideIndexes:c,onUpFromFirstItem:m})})}var q,nt,rt=e((()=>{q=t(l(),1),g(),M(),nt=b()}));function it(e,t){return k(e.replace(/\s+/g,` `).trim(),t)}function at({before:e,match:t,after:n},r){return o.dim(e)+r(t)+o.dim(n)}function ot(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function st(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?mt:i?X:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${it(le(e),l)}${c}${s}`}function ct(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=pe(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function lt({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:i,onSelect:o,onLogsChanged:s,onLoadMore:l,initialSearchQuery:ee,showAllProjects:g=!1,onToggleAllProjects:b,onAgenticSearch:x}){let ie=a(),ae=n===void 0?ie.columns:n,S=Le(i),C=d(),w=be(),T=process.env.USER_TYPE===`ant`,[oe]=u(),ce=Pe(oe),D=J.useMemo(()=>e=>c(e,ce.warning),[ce.warning]),ue=process.env.USER_TYPE===`ant`,[O,de]=J.useState(null),[k,fe]=J.useState(!1),[A,me]=J.useState(!1),[he,_e]=J.useState(!1),ve=J.useMemo(()=>re(),[]),[xe,M]=J.useState(``),[Ce,we]=J.useState(0),[Te,Ee]=J.useState(new Set),[ke,Ae]=J.useState(null),[Me,Ne]=J.useState(1),[P,F]=J.useState(`list`),[Fe,Ie]=J.useState(null),Re=J.useRef(null),[Be,Ve]=J.useState(0),[I,He]=J.useState({status:`idle`}),[L,R]=J.useState(!1),z=J.useRef(null),{query:B,setQuery:Ge,cursorOffset:Ke}=ze({isActive:P===`search`&&I.status!==`searching`,onExit:()=>{F(`list`),E(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{F(`list`),E(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:ee||``}),V=J.useDeferredValue(B),[H,U]=J.useState(``);J.useEffect(()=>{if(!V){U(``);return}let e=setTimeout(U,300,V);return()=>clearTimeout(e)},[V]);let[W,Je]=J.useState(null),[Ye,Xe]=J.useState(!1);J.useEffect(()=>{se().then(e=>de(e)),ye(ve).then(e=>{_e(e.length>1)})},[ve]);let Ze=J.useMemo(()=>new Map(e.map(e=>[e,dt(e)])),[e]),Qe=J.useMemo(()=>T?new Ue(e.map(e=>({log:e,searchableText:Ze.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:gt,ignoreLocation:!0,includeScore:!0}):null,[e,Ze,T]),$e=J.useMemo(()=>pt(e),[e]),G=$e.length>0,K=J.useMemo(()=>G?[`All`,...$e]:[],[G,$e]),et=K.length>0&&Be<K.length?Be:0,q=K[et],nt=q===`All`?void 0:q,rt=+!!G,lt=J.useMemo(()=>{let t=e;return w&&(t=e.filter(e=>{let t=ne(),n=N(e);return!!(t&&n===t||e.customTitle||Oe(e.messages)||e.firstPrompt||e.customTitle)})),nt!==void 0&&(t=t.filter(e=>e.tag===nt)),k&&O&&(t=t.filter(e=>e.gitBranch===O)),he&&!A&&(t=t.filter(e=>e.projectPath===ve)),t},[e,w,nt,k,O,he,A,ve]),ut=J.useMemo(()=>{if(!B)return lt;let e=B.toLowerCase();return lt.filter(t=>{let n=le(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[lt,B]);J.useEffect(()=>{T&&V&&V!==H&&Xe(!0)},[V,H,T]),J.useEffect(()=>{if(!T||!H||!Qe){Je(null),Xe(!1);return}let e=setTimeout((e,t,n,r)=>{let i=e.search(t);i.sort((e,t)=>{let n=new Date(e.item.log.modified).getTime(),r=new Date(t.item.log.modified).getTime()-n;return Math.abs(r)>_t?r:(e.score??1)-(t.score??1)}),n({results:i.map(e=>({log:e.item.log,score:e.score,searchableText:e.item.searchableText})),query:t}),r(!1)},0,Qe,H,Je,Xe);return()=>{clearTimeout(e)}},[H,Qe,T]);let{filteredLogs:mt,snippets:X}=J.useMemo(()=>{let e=new Map,t=ut;if(W&&H&&W.query===H){for(let t of W.results)if(t.searchableText){let n=ot(t.searchableText,H,vt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=W.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[ut,W,H]),Z=J.useMemo(()=>I.status===`results`&&I.results.length>0?I.results:mt,[I,mt]),Q=Math.max(30,ae-4),ht=J.useMemo(()=>{if(!w)return[];let e=ft(Z);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=Z.indexOf(n),i=X.get(n),a=i?at(i,D):null;if(t.length===1){let t=ct(n,{showProjectPath:g});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:st(n,Q),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=Z.indexOf(t),i=X.get(t),a=i?at(i,D):null,o=ct(t,{isChild:!0,showProjectPath:g});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:st(t,Q,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=ct(n,{showProjectPath:g});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:st(n,Q,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[w,Z,Q,g,X,D]),yt=J.useMemo(()=>w?[]:Z.map((e,t)=>{let n=it(le(e)+(e.isSidechain?` (sidechain)`:``),Q),r=pe(e),i=g&&e.projectPath?` · ${e.projectPath}`:``,a=X.get(e),o=a?at(a,D):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[w,Z,D,Q,g,X]),$=ke?.value.log??null,bt=()=>{if(!w||!$)return``;let e=N($);if(!e)return``;let t=Z.filter(t=>N(t)===e);if(!(t.length>1))return``;let n=Te.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},xt=J.useCallback(async()=>{let e=$?N($):void 0;if(!$||!e){F(`list`),M(``);return}xe.trim()&&(await De(e,xe.trim(),$.fullPath),w&&s&&s()),F(`list`),M(``)},[$,xe,s,w]),St=J.useCallback(()=>{F(`list`),E(`tengu_session_search_toggled`,{enabled:!1})},[]),Ct=J.useCallback(()=>{F(`search`),E(`tengu_session_search_toggled`,{enabled:!0})},[]),wt=J.useCallback(async()=>{if(!B.trim()||!x||!ue)return;z.current?.abort();let t=new AbortController;z.current=t,He({status:`searching`}),E(`tengu_agentic_search_started`,{query_length:B.length});try{let n=await x(B,e,t.signal);if(t.signal.aborted)return;He({status:`results`,results:n,query:B}),E(`tengu_agentic_search_completed`,{query_length:B.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;He({status:`error`,message:e instanceof Error?e.message:`Search failed`}),E(`tengu_agentic_search_error`,{query_length:B.length})}},[B,x,ue,e]);J.useEffect(()=>{I.status!==`idle`&&I.status!==`searching`&&(I.status===`results`&&I.query!==B||I.status===`error`)&&He({status:`idle`})},[B,I]),J.useEffect(()=>()=>{z.current?.abort()},[]);let Tt=J.useRef(I.status);J.useEffect(()=>{let e=Tt.current;if(Tt.current=I.status,e===`searching`&&I.status===`results`){if(w&&ht.length>0)Ae(ht[0]);else if(!w&&Z.length>0){let e=Z[0];Ae({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[I.status,w,ht,Z]);let Et=J.useCallback(e=>{let t=parseInt(e,10),n=Z[t];!n||Re.current===t.toString()||(Re.current=t.toString(),Ae({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Ne(t+1))},[Z]),Dt=J.useCallback(e=>{Ae(e);let t=Z.findIndex(t=>N(t)===N(e.value.log));t>=0&&Ne(t+1)},[Z]);_(`confirm:no`,()=>{z.current?.abort(),He({status:`idle`}),E(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:P!==`preview`&&I.status===`searching`}),_(`confirm:no`,()=>{F(`list`),M(``)},{context:`Settings`,isActive:P===`rename`&&I.status!==`searching`}),_(`confirm:no`,()=>{Ge(``),R(!1),i?.()},{context:`Confirmation`,isActive:P!==`preview`&&P!==`rename`&&P!==`search`&&L&&I.status!==`searching`}),y((e,t)=>{if(P!==`preview`&&I.status!==`searching`&&P!==`rename`)if(P===`search`)e.toLowerCase()===`n`&&t.ctrl?St():(t.return||t.downArrow)&&B.trim()&&x&&ue&&I.status!==`results`&&R(!0);else{if(L){if(t.return){wt(),R(!1);return}else if(t.downArrow){R(!1);return}else if(t.upArrow){F(`search`),R(!1);return}}if(G&&t.tab){let e=t.shift?-1:1;Ve(t=>{let n=((t<K.length?t:0)+K.length+e)%K.length,r=K[n];return E(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:$e.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&b)b(),E(`tengu_session_all_projects_toggled`,{enabled:!g});else if(r===`b`&&t.ctrl){let e=!k;fe(e),E(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&he){let e=!A;me(e),E(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(F(`search`),E(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(F(`rename`),M(``),E(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Ie($),F(`preview`),E(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(F(`search`),Ge(e),E(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let Ot=[];k&&O&&Ot.push(O),he&&!A&&Ot.push(`current worktree`);let kt=8+ +(Ot.length>0&&P!==`search`)+rt,At=Math.max(1,Math.floor((t-kt-2)/3));return J.useEffect(()=>{l&&Me+At*2>=Z.length&&l(At*3)},[Me,At,Z.length,l]),e.length===0?null:P===`preview`&&Fe&&w?(0,Y.jsx)(We,{log:Fe,onExit:()=>{F(`list`),Ie(null)},onSelect:o}):(0,Y.jsxs)(v,{flexDirection:`column`,height:t-1,children:[(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsx)(te,{color:`suggestion`})}),(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsx)(p,{children:` `})}),G?(0,Y.jsx)(qe,{tabs:K,selectedIndex:et,availableWidth:ae,showAllProjects:g}):(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsxs)(p,{bold:!0,color:`suggestion`,children:[`Resume Session`,P===`list`&&Z.length>At&&(0,Y.jsxs)(p,{dimColor:!0,children:[` `,`(`,Me,` of `,Z.length,`)`]})]})}),(0,Y.jsx)(f,{query:B,isFocused:P===`search`,isTerminalFocused:C,cursorOffset:Ke}),Ot.length>0&&P!==`search`&&(0,Y.jsx)(v,{flexShrink:0,paddingLeft:2,children:(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsx)(h,{children:Ot})})}),(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsx)(p,{children:` `})}),I.status===`searching`&&(0,Y.jsxs)(v,{paddingLeft:1,flexShrink:0,children:[(0,Y.jsx)(je,{}),(0,Y.jsx)(p,{children:` Searching…`})]}),I.status===`results`&&I.results.length>0&&(0,Y.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(p,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),I.status===`results`&&I.results.length===0&&mt.length===0&&(0,Y.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),I.status===`error`&&mt.length===0&&(0,Y.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!B.trim()&&x&&ue&&I.status!==`searching`&&I.status!==`results`&&I.status!==`error`&&(0,Y.jsxs)(v,{flexShrink:0,flexDirection:`column`,children:[(0,Y.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,Y.jsx)(p,{color:L?`suggestion`:void 0,children:L?r.pointer:` `}),(0,Y.jsx)(p,{color:L?`suggestion`:void 0,bold:L,children:`Search deeply using Claude →`})]}),(0,Y.jsx)(v,{height:1})]}),I.status===`searching`?null:P===`rename`&&$?(0,Y.jsxs)(v,{paddingLeft:2,flexDirection:`column`,children:[(0,Y.jsx)(p,{bold:!0,children:`Rename session:`}),(0,Y.jsx)(v,{paddingTop:1,children:(0,Y.jsx)(Se,{value:xe,onChange:M,onSubmit:xt,placeholder:le($,`Enter new session name`),columns:ae,cursorOffset:Ce,onChangeCursorOffset:we,showCursor:!0})})]}):w?(0,Y.jsx)(tt,{nodes:ht,onSelect:e=>{o(e.value.log)},onFocus:Dt,onCancel:i,focusNodeId:ke?.id,visibleOptionCount:At,layout:`expanded`,isDisabled:P===`search`||L,hideIndexes:!1,isNodeExpanded:e=>{if(P===`search`||k)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?Te.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(Ee(e=>new Set(e).add(t)),E(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Ee(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Ct}):(0,Y.jsx)(ge,{options:yt,onChange:e=>{let t=Z[parseInt(e,10)];t&&o(t)},visibleOptionCount:At,onCancel:i,onFocus:Et,defaultFocusValue:ke?.id.toString(),layout:`expanded`,isDisabled:P===`search`||L,onUpFromFirstItem:Ct}),(0,Y.jsx)(v,{paddingLeft:2,children:S.pending?(0,Y.jsxs)(p,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]}):P===`rename`?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(m,{shortcut:`Enter`,action:`save`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I.status===`searching`?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(p,{children:`Searching with Claude…`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):L?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(m,{shortcut:`Enter`,action:`search`}),(0,Y.jsx)(m,{shortcut:`↓`,action:`skip`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):P===`search`?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(p,{children:Ye&&T?`Searching…`:`Type to Search`}),(0,Y.jsx)(m,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[b&&(0,Y.jsx)(m,{shortcut:`Ctrl+A`,action:`show ${g?`current dir`:`all projects`}`}),O&&(0,Y.jsx)(m,{shortcut:`Ctrl+B`,action:`toggle branch`}),he&&(0,Y.jsx)(m,{shortcut:`Ctrl+W`,action:`show ${A?`current worktree`:`all worktrees`}`}),(0,Y.jsx)(m,{shortcut:`Ctrl+V`,action:`preview`}),(0,Y.jsx)(m,{shortcut:`Ctrl+R`,action:`rename`}),(0,Y.jsx)(p,{children:`Type to search`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),bt()&&(0,Y.jsx)(p,{children:bt()})]})})})]})}function ut(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function dt(e){let t=(e.messages.length<=Z?e.messages:[...e.messages.slice(0,Q),...e.messages.slice(-Q)]).map(ut).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>ht?n.slice(0,ht):n}function ft(e){let t=new Map;for(let n of e){let e=N(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function pt(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var J,Y,mt,X,Z,Q,ht,gt,_t,vt,yt=e((()=>{s(),n(),He(),J=t(l(),1),x(),Ie(),Be(),ve(),g(),Fe(),oe(),A(),xe(),ce(),D(),me(),he(),Ee(),M(),Re(),B(),ke(),et(),we(),rt(),Y=b(),mt=2,X=4,Z=2e3,Q=1e3,ht=5e4,gt=.3,_t=60*1e3,vt=50}));function $(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function bt(e){if(e.length===0)return``;let t=(e.length<=wt?e:[...e.slice(0,wt/2),...e.slice(-wt/2)]).map($).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>Ct?t.slice(0,Ct)+`…`:t}function xt(e,t){return!!(le(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&bt(e.messages).toLowerCase().includes(t))}async function St(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>xt(e,r)),a;if(i.length>=Tt)a=i.slice(0,Tt);else{let e=t.filter(e=>!xt(e,r)),n=Tt-i.length;a=[...i,...e.slice(0,n)]}C(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${O(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(Ce(e))try{return await Te(e)}catch(t){return ue(t),e}return e}),s=await Promise.all(o);C(`Agentic search: loaded ${O(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
|
|
2
|
-
${s.map((e,t)=>{let n=[`${t}:`],r=le(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=bt(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
|
|
3
|
-
`)}
|
|
4
|
-
|
|
5
|
-
Search query: "${e}"
|
|
6
|
-
|
|
7
|
-
Find the sessions that are most relevant to this query.`;C(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=ie();C(`Agentic search using model: ${e}`);let t=(await Ae({model:e,system:Et,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(!t||t.type!==`text`)return C(`No text content in agentic search response`),[];C(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return C(`Could not find JSON in agentic search response`),[];let i=(S(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return C(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return ue(e),C(`Agentic search error: ${e}`),[]}}var Ct,wt,Tt,Et,Dt=e((()=>{de(),w(),D(),ae(),me(),Me(),T(),Ct=2e3,wt=100,Tt=100,Et=`Your goal is to find relevant sessions based on a user's search query.
|
|
8
|
-
|
|
9
|
-
You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
|
|
10
|
-
|
|
11
|
-
Each session may include:
|
|
12
|
-
- Title (display name or custom title)
|
|
13
|
-
- Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
|
|
14
|
-
- Branch (git branch name, shown as [branch: name])
|
|
15
|
-
- Summary (AI-generated summary)
|
|
16
|
-
- First message (beginning of the conversation)
|
|
17
|
-
- Transcript (excerpt of conversation content)
|
|
18
|
-
|
|
19
|
-
IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
|
|
20
|
-
|
|
21
|
-
For each session, consider (in order of priority):
|
|
22
|
-
1. Exact tag matches (highest priority - user explicitly categorized this session)
|
|
23
|
-
2. Partial tag matches or tag-related terms
|
|
24
|
-
3. Title matches (custom titles or first message content)
|
|
25
|
-
4. Branch name matches
|
|
26
|
-
5. Summary and transcript content matches
|
|
27
|
-
6. Semantic similarity and related concepts
|
|
28
|
-
|
|
29
|
-
CRITICAL: Be VERY inclusive in your matching. Include sessions that:
|
|
30
|
-
- Contain the query term anywhere in any field
|
|
31
|
-
- Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
|
|
32
|
-
- Discuss topics that could be related to the query
|
|
33
|
-
- Have transcripts that mention the concept even in passing
|
|
34
|
-
|
|
35
|
-
When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
|
|
36
|
-
|
|
37
|
-
Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
|
|
38
|
-
|
|
39
|
-
Respond with ONLY the JSON object, no markdown formatting:
|
|
40
|
-
{"relevant_indices": [2, 5, 0]}`}));function Ot(e,t,n){let r=re();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=N(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${P([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+L)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=N(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${P([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var kt=e((()=>{x(),F(),me()}));export{lt as a,Dt as i,kt as n,yt as o,St as r,Ot as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./datadog-Bg-zL-i7.js";t();export{e as shutdownDatadog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t}from"./envLessBridgeConfig-SPEr9oqO.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./extra-usage-CCMwIa85.js";e();export{t as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ql as e,Xl as t,Yl as n,Zl as r}from"./loadAgentsDir-DI1a76pd.js";e();export{n as drainPendingExtraction,t as executeExtractMemories,r as initExtractMemories};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./fast-CG1v3fRr.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./gates-CSKxLmMJ.js";e();export{t as getChicagoEnabled};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{ai as t,ci as n}from"./paths-BBvuDQl9.js";import{d as r,s as i}from"./debug-UI3T040K.js";import{o as a,u as o}from"./proxy-CfZp-wce.js";import{Ko as s,Lo as c,NE as l,PE as u,Wo as d,__ as f,_m as p,co as m,g_ as h,h_ as g,pm as _,st as v,ut as y,v_ as b}from"./loadAgentsDir-DI1a76pd.js";import{F as x,I as S,J as C,L as w,P as T,R as E}from"./rcDebugLog-CPKZCtR8.js";import{i as D,n as O,r as k,t as A}from"./openaiShared-D5lOejS1.js";import{randomUUID as j}from"crypto";function M(e){if(P)return P;let t=new D({apiKey:process.env.GROK_API_KEY||process.env.XAI_API_KEY||``,baseURL:process.env.GROK_BASE_URL||N,maxRetries:e?.maxRetries??0,timeout:parseInt(process.env.API_TIMEOUT_MS||`600000`,10),dangerouslyAllowBrowser:!0,fetchOptions:a({forAnthropicAPI:!1}),...e?.fetchOverride&&{fetch:e.fetchOverride}});return e?.fetchOverride||(P=t),t}var N,P,F=e((()=>{k(),o(),N=`https://api.x.ai/v1`,P=null}));async function*I(e,n,i,a,o){try{let c=C(o.model),l=s(e,i),p=await Promise.all(i.map(e=>y(e,{getToolPermissionContext:o.getToolPermissionContext,tools:i,agents:o.agents,allowedAgentTypes:o.allowedAgentTypes,model:o.model}))),m=p.filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),v=E(l,n),b=w(m),T=S(o.toolChoice),D=M({maxRetries:0,fetchOverride:o.fetchOverride,source:o.querySource});r(`[Grok] Calling model=${c}, messages=${v.length}, tools=${b.length}`);let k=x(await D.chat.completions.create({model:c,messages:v,...b.length>0&&{tools:b,...T&&{tool_choice:T}},stream:!0,stream_options:{include_usage:!0},...o.temperatureOverride!==void 0&&{temperature:o.temperatureOverride}},{signal:a}),c),A={},N=[],P,F={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},I=0,L=Date.now();for await(let e of k){switch(e.type){case`message_start`:P=e.message,I=Date.now()-L,e.message?.usage&&(F=O(F,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?A[t]={...n,input:``}:n.type===`text`?A[t]={...n,text:``}:n.type===`thinking`?A[t]={...n,thinking:``,signature:``}:A[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=A[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=A[e.index];if(!t||!P)break;let n={message:{...P,content:d([t],i,o.agentId)},requestId:void 0,type:`assistant`,uuid:j(),timestamp:new Date().toISOString()};N.push(n),yield n;break}case`message_delta`:{let t=e.usage;t&&(F=O(F,t));break}case`message_stop`:break}e.type===`message_stop`&&F.input_tokens+F.output_tokens>0&&_(t(c,F),F,o.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:I}:void 0}}u(o.langfuseTrace??null,{model:c,provider:`grok`,input:g(l,n),output:h(N),usage:{input_tokens:F.input_tokens,output_tokens:F.output_tokens,cache_creation_input_tokens:F.cache_creation_input_tokens,cache_read_input_tokens:F.cache_read_input_tokens},startTime:new Date(L),endTime:new Date,completionStartTime:I>0?new Date(L+I):void 0,tools:f(p)})}catch(e){let t=e instanceof Error?e.message:String(e);r(`[Grok] Error: ${t}`,{level:`error`}),yield m({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{F(),A(),T(),c(),v(),i(),p(),n(),l(),b()}))();export{I as queryModelGrok};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Yt as e,un as t,vn as n,yn as r}from"./loadAgentsDir-DI1a76pd.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./inboundAttachments-DnGQw7Pf.js";export{e as resolveAndPrepend};
|