claude-code-best 2.6.0 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-Cj5bvJgD.js → AddWorkspaceDirectory-Bb6crGWh.js} +1 -1
- package/dist/chunks/{App-2tgSv9lb.js → App-CW0Y4ceR.js} +1 -1
- package/dist/chunks/{ApproveApiKey-DWa-XTLb.js → ApproveApiKey-9rkwQfgT.js} +1 -1
- package/dist/chunks/ApproveApiKey-BhMr2Y5F.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-DF9eeJZS.js → AssistantSessionChooser-XzXZZdiH.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-BL_dfbZP.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-DlLWAKw2.js +1 -0
- package/dist/chunks/{ClaudeInChromeOnboarding-BW4XHmkw.js → ClaudeInChromeOnboarding-CjGydpBk.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-Bz0JyaOG.js → ClaudeMdExternalIncludesDialog-B04cjDwX.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DPki55Xa.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-D_j1NebK.js +1 -0
- package/dist/chunks/{DesktopHandoff-CcsM_OAS.js → DesktopHandoff-CFBUqcCf.js} +1 -1
- package/dist/chunks/DevChannelsDialog-ByTf41du.js +1 -0
- package/dist/chunks/DiffDialog-CY-8kw_Q.js +3 -0
- package/dist/chunks/Doctor-2D5Wz58o.js +1 -0
- package/dist/chunks/Doctor-CDez_u_U.js +3 -0
- package/dist/chunks/{ExitFlow-C4ybxKPn.js → ExitFlow-BlON8IgH.js} +2 -2
- package/dist/chunks/Feedback-CSeD3k4M.js +2 -0
- package/dist/chunks/Grove-Dwu_0zRw.js +1 -0
- package/dist/chunks/{Grove-CKVpREDU.js → Grove-Tp_UtIMg.js} +1 -1
- package/dist/chunks/{HybridTransport-Byjvz-DL.js → HybridTransport-CAko699F.js} +2 -2
- package/dist/chunks/{ITermBackend-Co9XpeS4.js → ITermBackend-5P3WJumD.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-CNsqbNU3.js → InvalidConfigDialog-CVcdra9v.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-ClnZaN6b.js → InvalidSettingsDialog-CfLdbmSI.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BK_3uwQj.js +1 -0
- package/dist/chunks/{McpParsingWarnings-DZkzoeZf.js → McpParsingWarnings-BOj-T8F3.js} +1 -1
- package/dist/chunks/MessageSelector-BRkxpO1O.js +3 -0
- package/dist/chunks/Messages-wyMyMP7U.js +11 -0
- package/dist/chunks/{Onboarding-BwoGQB4g.js → Onboarding-C06Mxlf-.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-Q5g2YjQw.js → OverageCreditUpsell-abcPm3PB.js} +1 -1
- package/dist/chunks/PluginSettings-DGpIVGvV.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-D4lMVCqj.js → PromptInputFooterSuggestions-ihnbjU0K.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-BvLtS6an.js → PromptInputHelpMenu-CMm8z7Gk.js} +1 -1
- package/dist/chunks/QueryEngine-I3Bqzbiz.js +1 -0
- package/dist/chunks/REPL-BxAsVlx3.js +1 -0
- package/dist/chunks/REPL-CBFcgD4r.js +97 -0
- package/dist/chunks/{RemoteCallout-BV_hoz98.js → RemoteCallout-Cy6lH-CZ.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-Cxoy1ud2.js → RemoteSessionManager-C7iGd5Og.js} +2 -2
- package/dist/chunks/ResumeConversation-AdLtgdVB.js +1 -0
- package/dist/chunks/{SSETransport-pIm26VJq.js → SSETransport-B5xlXeAN.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BJ8Nx_Nu.js +1 -0
- package/dist/chunks/SentryErrorBoundary-Bs7mtkPb.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-B6EWoJml.js → SentryErrorBoundary-iih9eFpM.js} +1 -1
- package/dist/chunks/Settings-PioHwsvg.js +2 -0
- package/dist/chunks/{TeleportProgress-DPzGpyyM.js → TeleportProgress-BX-uLwuL.js} +1 -1
- package/dist/chunks/TeleportRepoMismatchDialog-D8oPPTWd.js +1 -0
- package/dist/chunks/{TeleportResumeWrapper-DPSO0S49.js → TeleportResumeWrapper-B_CvNDbr.js} +1 -1
- package/dist/chunks/{ThemePicker-DueihHcy.js → ThemePicker-BG1ykSpX.js} +1 -1
- package/dist/chunks/{TmuxBackend-BNaZNAeP.js → TmuxBackend-CnMCWNS4.js} +1 -1
- package/dist/chunks/TrustDialog-Z_maAYj8.js +1 -0
- package/dist/chunks/{ValidationErrorsList-1k1qbsRo.js → ValidationErrorsList-C9swVkZ-.js} +1 -1
- package/dist/chunks/{WelcomeV2-CR6TtXXM.js → WelcomeV2-Au_5ddlT.js} +1 -1
- package/dist/chunks/WindowsTerminalBackend-CGxaYH74.js +2 -0
- package/dist/chunks/{add-dir-DAMizKzF.js → add-dir-Cm9u56YX.js} +1 -1
- package/dist/chunks/{agentDisplay-B9z7i8b_.js → agentDisplay-Bi_bEyEn.js} +1 -1
- package/dist/chunks/{agents-D5u0p1UC.js → agents-CMF9fLzV.js} +7 -7
- package/dist/chunks/{agents-DCh_gEvJ.js → agents-CbjR7hNr.js} +1 -1
- package/dist/chunks/{ant-DRJq-cEg.js → ant-Bu1Gs4WJ.js} +1 -1
- package/dist/chunks/api-CFNGoLoL.js +1 -0
- package/dist/chunks/{api-B6URs6nc.js → api-D_t0nHsS.js} +1 -1
- package/dist/chunks/assistant-BLd4y2FJ.js +1 -0
- package/dist/chunks/{assistant-tPxOUa-Z.js → assistant-C_pfWe2a.js} +1 -1
- package/dist/chunks/{assistant-BRGDWkKB.js → assistant-EA-MHNQ-.js} +1 -1
- package/dist/chunks/{auth-CqURlg4d.js → auth-D7PZvVPf.js} +1 -1
- package/dist/chunks/auth-DGfZCD_B.js +1 -0
- package/dist/chunks/{autoMode-DVt4K4I2.js → autoMode-B8iO05xy.js} +6 -6
- package/dist/chunks/{autonomy-Ffv0QIyl.js → autonomy-CaLvE5N6.js} +12 -12
- package/dist/chunks/{autonomy-BZzW8QJZ.js → autonomy-dQVtSiCJ.js} +1 -1
- package/dist/chunks/{autonomyPanel-MwuzDvv_.js → autonomyPanel-DSswVlCF.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-Ckj8W3RO.js +1 -0
- package/dist/chunks/backgroundHousekeeping-D2_Uopt7.js +17 -0
- package/dist/chunks/{branch-DXefFdDE.js → branch-C7pM8Sjh.js} +1 -1
- package/dist/chunks/{bridge-qr4GQW_c.js → bridge-CTYdzSWg.js} +2 -2
- package/dist/chunks/bridgeConfig-7c07tJm9.js +1 -0
- package/dist/chunks/{bridgeConfig-CJ-KznTS.js → bridgeConfig-Df6uyp3q.js} +1 -1
- package/dist/chunks/{bridgeEnabled-5vsPrjuq.js → bridgeEnabled-A-_xJ94c.js} +1 -1
- package/dist/chunks/bridgeEnabled-Z2S8lk0l.js +1 -0
- package/dist/chunks/bridgeMain-B7FZpvo0.js +68 -0
- package/dist/chunks/bridgeMain-C5UxF8ST.js +1 -0
- package/dist/chunks/{bridgeMessaging-BiE0CTqq.js → bridgeMessaging-DPVLAIzl.js} +1 -1
- package/dist/chunks/{btw-FpimqEqk.js → btw-CqgjLlFN.js} +1 -1
- package/dist/chunks/{buddy-BA3Cr067.js → buddy-DCGBAqF2.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-CSC9p8mO.js → bypassPermissionsKillswitch-CK0jeZTW.js} +1 -1
- package/dist/chunks/{caches-BUBkfP2Q.js → caches-CdVW8fYV.js} +2 -2
- package/dist/chunks/caches-Dt52PedI.js +1 -0
- package/dist/chunks/{ccrClient-BOxUn9EJ.js → ccrClient-B_3AmY7K.js} +1 -1
- package/dist/chunks/changeDetector-uO9CBvut.js +1 -0
- package/dist/chunks/{channelNotification-l3EXKDNB.js → channelNotification-BbDQdLZC.js} +1 -1
- package/dist/chunks/channelNotification-DzTzUrCe.js +1 -0
- package/dist/chunks/{chrome-BnKyWWQL.js → chrome-CGyqsCkL.js} +1 -1
- package/dist/chunks/clear-B_cVk64B.js +1 -0
- package/dist/chunks/client-BcqXgcrx.js +1 -0
- package/dist/chunks/{color-D5MCzz9h.js → color-DEXUx7gE.js} +1 -1
- package/dist/chunks/commands-BX0_wEGw.js +1 -0
- package/dist/chunks/commitAttribution-CSVDcgTO.js +1 -0
- package/dist/chunks/{commitAttribution-BFshsh2H.js → commitAttribution-e0kkanVT.js} +1 -1
- package/dist/chunks/{compact-DWNaf1wR.js → compact-Dh9RewNA.js} +3 -3
- package/dist/chunks/{companion-CyK_Dr1U.js → companion-DVFacTUw.js} +1 -1
- package/dist/chunks/{config-DNz6Eitr.js → config-CkSmYDJY.js} +1 -1
- package/dist/chunks/{config-BdCuh6eA.js → config-DwiVCSrY.js} +1 -1
- package/dist/chunks/{context-BOjdTj0i.js → context-B8VDDHTv.js} +1 -1
- package/dist/chunks/{context-noninteractive-k2ibficU.js → context-noninteractive-IZfWniex.js} +2 -2
- package/dist/chunks/context-noninteractive-SBxqQ3iu.js +1 -0
- package/dist/chunks/conversation-CQBl9Yy2.js +1 -0
- package/dist/chunks/conversation-DVZplNag.js +1 -0
- package/dist/chunks/{copy-B0VUJ2rH.js → copy-CIjrYoFa.js} +2 -2
- package/dist/chunks/{createSSHSession-DqmkCS_k.js → createSSHSession-ArNlbIZB.js} +1 -1
- package/dist/chunks/{createSession-CJEsHz58.js → createSession-CBheIT_G.js} +1 -1
- package/dist/chunks/createSession-DfEQy2dZ.js +1 -0
- package/dist/chunks/cronJitterConfig-DcMGWOa-.js +6 -0
- package/dist/chunks/crossProjectResume-Z-aR2q-d.js +40 -0
- package/dist/chunks/{datadog-Bd1s_VFj.js → datadog-BK8eJz8B.js} +1 -1
- package/dist/chunks/datadog-Uj6FjEuU.js +1 -0
- package/dist/chunks/{desktop-BDowrzvG.js → desktop-B9vWJeRu.js} +1 -1
- package/dist/chunks/{diff-auU5sUOw.js → diff-BTV7_Dca.js} +1 -1
- package/dist/chunks/{doctor-bKPp6AeL.js → doctor-Dpbh0aRz.js} +1 -1
- package/dist/chunks/{effort-BQj2QnnA.js → effort-Czlwa5qF.js} +4 -4
- package/dist/chunks/{entry-CUu6-QhT.js → entry-CdfuWjKu.js} +3 -3
- package/dist/chunks/{envLessBridgeConfig-Ju4W58xf.js → envLessBridgeConfig-BAFYaZ0E.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-DOO9eX07.js +1 -0
- package/dist/chunks/{exit-DijkO8eo.js → exit-DzOm62Dn.js} +1 -1
- package/dist/chunks/{export-DA-bBZkX.js → export-DHOR3z3Z.js} +1 -1
- package/dist/chunks/{exportRenderer-3y4tGdSB.js → exportRenderer-CiNXeNr9.js} +1 -1
- package/dist/chunks/extra-usage-CJcyfVCt.js +1 -0
- package/dist/chunks/{extra-usage-CS6VwKJt.js → extra-usage-DIYR_3ZR.js} +1 -1
- package/dist/chunks/{extra-usage-core-DOgT4u4i.js → extra-usage-core-C3uM9bOP.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-DYnfiRlV.js → extra-usage-noninteractive-Ctz9TfY8.js} +1 -1
- package/dist/chunks/{extraUsage-CfxgfpX_.js → extraUsage-CBwIvl73.js} +1 -1
- package/dist/chunks/extractMemories-C3SU-Osb.js +1 -0
- package/dist/chunks/fast-7iinMwk-.js +1 -0
- package/dist/chunks/{fast-CzRUJBTK.js → fast-BpBwjbSD.js} +1 -1
- package/dist/chunks/{feedback-FoXtdHAV.js → feedback-BkVnsZVx.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-KIwaBY-E.js → firstPartyEventLogger-BCzGkdpd.js} +1 -1
- package/dist/chunks/{flushGate-C2Icy43G.js → flushGate-CQsnMw8g.js} +1 -1
- package/dist/chunks/{gates-CbQLZHtm.js → gates-CxWIWtmd.js} +1 -1
- package/dist/chunks/gates-qgzva-fO.js +1 -0
- package/dist/chunks/{gemini-BrNJGX4k.js → gemini-BbV8D2SS.js} +1 -1
- package/dist/chunks/{generateRecap-B0fvSCjo.js → generateRecap-B3j2nUgh.js} +1 -1
- package/dist/chunks/{generateSessionName-DvRYa39O.js → generateSessionName-aGnXSNgN.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-Dut3d6nn.js → githubRepoPathMapping-DCJLSTLl.js} +1 -1
- package/dist/chunks/{grok-Ftoheab3.js → grok-C4QFXJnR.js} +1 -1
- package/dist/chunks/{growthbook-BynnuVTn.js → growthbook-prtWhMRg.js} +1 -1
- package/dist/chunks/{heapdump-hQ_w0LPC.js → heapdump-Czm-2XiG.js} +1 -1
- package/dist/chunks/{help-DQsHHv6r.js → help-CSAFsN0-.js} +1 -1
- package/dist/chunks/hooks-Ch2vPE8u.js +1 -0
- package/dist/chunks/{hooks-BhVDc8yb.js → hooks-DkbOP-bI.js} +2 -2
- package/dist/chunks/{hostAdapter-D1eWmmhu.js → hostAdapter-BcdDPVTj.js} +1 -1
- package/dist/chunks/{ide-CPmMXLL-.js → ide-BXERRFZF.js} +2 -2
- package/dist/chunks/{inboundAttachments-Bmf6vYsE.js → inboundAttachments-7rXrAtkb.js} +1 -1
- package/dist/chunks/inboundAttachments-C0rkLl2x.js +1 -0
- package/dist/chunks/initReplBridge-tXqkba08.js +1 -0
- package/dist/chunks/{insights-CTlTyvjj.js → insights-DrvqJgF8.js} +25 -25
- package/dist/chunks/{install-IPuD3Lq8.js → install-BGnxwO00.js} +1 -1
- package/dist/chunks/{install-github-app-Bmu_sA9e.js → install-github-app-CIpBHlr9.js} +2 -2
- package/dist/chunks/{install-slack-app-Rfl81Jqo.js → install-slack-app-By4Lh7ww.js} +1 -1
- package/dist/chunks/{instrumentation-DWwmOmr0.js → instrumentation-D9y7Ph_R.js} +3 -3
- package/dist/chunks/{job-BXEt0izn.js → job-BPVIMW_P.js} +1 -1
- package/dist/chunks/{keybindings-DRDgVvqz.js → keybindings-Ce6AHMLI.js} +2 -2
- package/dist/chunks/{lang-D3ZHlfT6.js → lang-DfDG_fSa.js} +1 -1
- package/dist/chunks/language-B1yHC1d6.js +1 -0
- package/dist/chunks/{language-DcSjogBx.js → language-yGoDFP3X.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-BPm_VMln.js → launchAgentsPlatform-DT01xZM7.js} +1 -1
- package/dist/chunks/launchAutofixPr-DrYd7WVf.js +18 -0
- package/dist/chunks/{launchLocalMemory-D_hBbXKE.js → launchLocalMemory-Bt3tMYVJ.js} +1 -1
- package/dist/chunks/{launchLocalVault-CPzNWvQ9.js → launchLocalVault-jyRHEa_Y.js} +1 -1
- package/dist/chunks/{launchMemoryStores-Djq2KhKb.js → launchMemoryStores-cmXnLAF5.js} +1 -1
- package/dist/chunks/{launchOnboarding-Bh6E7vdc.js → launchOnboarding-BPTNFftb.js} +1 -1
- package/dist/chunks/{launchSchedule-C988bQ-5.js → launchSchedule-141GqGC8.js} +1 -1
- package/dist/chunks/{launchSkillStore-DqrP6Gme.js → launchSkillStore-Bz0lok_o.js} +1 -1
- package/dist/chunks/{launchTeleport-DFhybaq_.js → launchTeleport-BMquJxIq.js} +2 -2
- package/dist/chunks/{launchVault-p_CSK4ZQ.js → launchVault-Bsuwqad6.js} +1 -1
- package/dist/chunks/{loadAgentsDir-Ci5mr0vm.js → loadAgentsDir-D7kapZB5.js} +717 -709
- package/dist/chunks/loadAgentsDir-DxPE2bIO.js +1 -0
- package/dist/chunks/{loadPluginHooks-xYCEZ6t5.js → loadPluginHooks-CL5aGDrb.js} +1 -1
- package/dist/chunks/localSearch-iozuZZhZ.js +1 -0
- package/dist/chunks/{localSearch-Vpn6W5aY.js → localSearch-r1_G8kfV.js} +1 -1
- package/dist/chunks/{login-D9IWjvza.js → login-7MvpaOkt.js} +1 -1
- package/dist/chunks/login-Dxza_KNT.js +1 -0
- package/dist/chunks/{logoV2Utils-SAulcC5x.js → logoV2Utils-DjThKW15.js} +1 -1
- package/dist/chunks/logout-BeGQR78E.js +1 -0
- package/dist/chunks/{magicDocs-BfoeYhin.js → magicDocs-Dy72LHIj.js} +2 -2
- package/dist/chunks/{main-DhMlhVj3.js → main-CF6Im-LV.js} +46 -46
- package/dist/chunks/{mappers-uIrAj-Wd.js → mappers-CkMESMy7.js} +1 -1
- package/dist/chunks/mcp-BTgHgOhR.js +2 -0
- package/dist/chunks/mcp-UJZ22IDJ.js +6 -0
- package/dist/chunks/mcp-fHf8Uc7h.js +1 -0
- package/dist/chunks/{mcpServer-1SnOWb8_.js → mcpServer-BueM5fWI.js} +1 -1
- package/dist/chunks/{mcpServer-DXvS3v4x.js → mcpServer-Dqm2PQQx.js} +1 -1
- package/dist/chunks/{memory-XccPLQLt.js → memory-BNZmqma1.js} +1 -1
- package/dist/chunks/model-D3g2QdU-.js +1 -0
- package/dist/chunks/{model-CbiDGGJU.js → model-DOw7wIKQ.js} +1 -1
- package/dist/chunks/{onChangeAppState-Dp0JIXd8.js → onChangeAppState-Cb9_yIuW.js} +1 -1
- package/dist/chunks/{openai-6KcHd4Hw.js → openai-Bvo0Gcec.js} +3 -3
- package/dist/chunks/{overageCreditGrant-DYiB4sr-.js → overageCreditGrant-BrN7dk3d.js} +1 -1
- package/dist/chunks/{passes-Cbc6T_Tj.js → passes-vgcY8_l8.js} +1 -1
- package/dist/chunks/{paths-Q2255dD7.js → paths-1ngPRtu3.js} +2 -2
- package/dist/chunks/permissions-BDbIjTT6.js +3 -0
- package/dist/chunks/{pipeTransport-D7NIp3aA.js → pipeTransport-KU8psPDI.js} +1 -1
- package/dist/chunks/{plan-DloFVJK7.js → plan-5NVPuxp6.js} +1 -1
- package/dist/chunks/{plugin-XR9IBPMM.js → plugin-t8jMqdsY.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-Cr9hP0zG.js → pluginAutoupdate-CAa4KLro.js} +1 -1
- package/dist/chunks/{pluginBlocklist-CM9uP8CY.js → pluginBlocklist-BG2LkLq1.js} +1 -1
- package/dist/chunks/{pluginCliCommands-BQkrvES5.js → pluginCliCommands-vqAtVibb.js} +1 -1
- package/dist/chunks/{pluginFlagging-CJ1--2Kw.js → pluginFlagging-BFCtv3kY.js} +1 -1
- package/dist/chunks/{pluginOperations-B0rLuSvo.js → pluginOperations-C9XP-mko.js} +2 -2
- package/dist/chunks/pluginStartupCheck-DZp0wnXP.js +1 -0
- package/dist/chunks/{pluginStartupCheck-Bjdc8zhz.js → pluginStartupCheck-RRcAbKfx.js} +1 -1
- package/dist/chunks/plugins-0SyID4Kx.js +4 -0
- package/dist/chunks/policyLimits-Cmmzuv-E.js +1 -0
- package/dist/chunks/{pollConfig-DhptuhFw.js → pollConfig-DTYIJ8lQ.js} +1 -1
- package/dist/chunks/{poor-DF0aqXDx.js → poor-Dw5dMZpM.js} +1 -1
- package/dist/chunks/{poorMode-C5Frra4j.js → poorMode-CsGLI_hm.js} +1 -1
- package/dist/chunks/poorMode-D_hB-rDf.js +1 -0
- package/dist/chunks/{print-CPtR0KTa.js → print-Ct8N4PYT.js} +12 -12
- package/dist/chunks/{privacy-settings-e-7lc7Un.js → privacy-settings-P2r-kg2i.js} +1 -1
- package/dist/chunks/processBashCommand-a8W8aTRu.js +1 -0
- package/dist/chunks/{processSlashCommand-DHRUtZ-C.js → processSlashCommand-BaUdUg3T.js} +3 -3
- package/dist/chunks/prompt-B1Qy8mi4.js +1 -0
- package/dist/chunks/{prompt-DEPUnJdB.js → prompt-BBg3jtfc.js} +1 -1
- package/dist/chunks/prompt-D4kWWEZC.js +1 -0
- package/dist/chunks/{promptEditor-Ci-h04-5.js → promptEditor-CvaugNTt.js} +2 -2
- package/dist/chunks/{protocolHandler-DhqM32qE.js → protocolHandler-DxBaHlaD.js} +1 -1
- package/dist/chunks/{rate-limit-options-B0l29Zx8.js → rate-limit-options-Df_sgE0b.js} +1 -1
- package/dist/chunks/rcDebugLog-CPGWJbI4.js +11 -0
- package/dist/chunks/{referral-ByevBJrE.js → referral-BKeCKnOJ.js} +1 -1
- package/dist/chunks/{refresh-B_CwwIRX.js → refresh-Cjv4jA6L.js} +1 -1
- package/dist/chunks/{registerProtocol-DzhaQH02.js → registerProtocol-DLuRm0mf.js} +1 -1
- package/dist/chunks/{registry-DkHA4cRu.js → registry-DVSgtCq5.js} +1 -1
- package/dist/chunks/{release-notes-CZthYkei.js → release-notes-CZcf8zB7.js} +1 -1
- package/dist/chunks/{releaseNotes-CwKpIsyd.js → releaseNotes-CvfZb3fZ.js} +2 -2
- package/dist/chunks/{reload-plugins-DxWfXvrN.js → reload-plugins-pSlDLk3b.js} +1 -1
- package/dist/chunks/{remote-env-BiRLWIrh.js → remote-env-BH89NuwC.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-nz1fPY1U.js → remoteBridgeCore-CrXlWEL1.js} +1 -1
- package/dist/chunks/{remoteControlServer-FzLUxh2B.js → remoteControlServer-BSOnq4yY.js} +1 -1
- package/dist/chunks/{rename-DmGuyncE.js → rename-DNGvNQm2.js} +1 -1
- package/dist/chunks/{resume-7GeU7RMS.js → resume-6UL38yL3.js} +2 -2
- package/dist/chunks/{runtimeObserver-Duod-ign.js → runtimeObserver-BhvHeiwD.js} +4 -4
- package/dist/chunks/{runtimeObserver-OgM9ZYxZ.js → runtimeObserver-Cp-DN8fP.js} +1 -1
- package/dist/chunks/sandbox-adapter-DGVtPPD0.js +1 -0
- package/dist/chunks/{sandbox-toggle-Cc96R6Ox.js → sandbox-toggle-D19YbI5G.js} +1 -1
- package/dist/chunks/searchExtraTools-DXWkpOIg.js +1 -0
- package/dist/chunks/{sentry-BUHYuYGj.js → sentry-BZmpC-iI.js} +1 -1
- package/dist/chunks/{session-DgLqm7ZI.js → session-lLpGqp0B.js} +2 -2
- package/dist/chunks/{sessionDiscovery-DgNea6qa.js → sessionDiscovery-BX3fjgzD.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BeuS4m7a.js +1 -0
- package/dist/chunks/sessionMemory-LMOQk90c.js +1 -0
- package/dist/chunks/sessionMemory-UpILj5ww.js +1 -0
- package/dist/chunks/sessionMemoryUtils-DE7AezA0.js +1 -0
- package/dist/chunks/{sessionObserver-CuWMVPlT.js → sessionObserver-CujNIWks.js} +1 -1
- package/dist/chunks/sessionObserver-HqvTXhs9.js +1 -0
- package/dist/chunks/sessionStorage-BN56DAAd.js +1 -0
- package/dist/chunks/{sessionTitle-DzkMzHer.js → sessionTitle-QxXslbJY.js} +1 -1
- package/dist/chunks/{sessionTracing-DTjmc0EF.js → sessionTracing-DognYcDf.js} +1 -1
- package/dist/chunks/{settingsSync-CfYDkakY.js → settingsSync-DEPET5O1.js} +1 -1
- package/dist/chunks/{setup-BKUG46jQ.js → setup-BUBUidOg.js} +1 -1
- package/dist/chunks/setup-BZMVuIIx.js +2 -0
- package/dist/chunks/{setup-CmLngvpJ.js → setup-C6G0lasE.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-DesT0yKM.js → shadowedRuleDetection-CQayPrmM.js} +1 -1
- package/dist/chunks/{sideQuestion-BAq0YyKY.js → sideQuestion-B9EE1vTM.js} +1 -1
- package/dist/chunks/sink-BRrEbL6h.js +1 -0
- package/dist/chunks/{sink-B3uP8Cf8.js → sink-Cugto5We.js} +1 -1
- package/dist/chunks/{sinks-COcy5GnB.js → sinks-B9A94oIj.js} +2 -2
- package/dist/chunks/sinks-CKaSBvU8.js +1 -0
- package/dist/chunks/{skill-learning-DOIMPtWE.js → skill-learning-CroDcatu.js} +1 -1
- package/dist/chunks/skillChangeDetector-DnyEQqe6.js +1 -0
- package/dist/chunks/{skillGapStore-DpEoKhn-.js → skillGapStore-91Mb3xDY.js} +2 -2
- package/dist/chunks/{skillGapStore-CWuw1dYh.js → skillGapStore-LKwap3o4.js} +1 -1
- package/dist/chunks/{skillGenerator-9y3Q4YoO.js → skillGenerator-B9GM0LHk.js} +2 -2
- package/dist/chunks/skillLearning-D6latSKi.js +1 -0
- package/dist/chunks/{skillLearning-BhM09bQD.js → skillLearning-DbOOqb6b.js} +1 -1
- package/dist/chunks/{skillPanel-Dt24mZTZ.js → skillPanel-rIIYgnBE.js} +3 -3
- package/dist/chunks/{skillSearchPanel-gaXN64Fu.js → skillSearchPanel-xAL-6uJF.js} +4 -4
- package/dist/chunks/{skills-Dx3dMHYk.js → skills-Doe47wxK.js} +1 -1
- package/dist/chunks/{sprites-5OAB-Ui2.js → sprites-D11F3i1M.js} +1 -1
- package/dist/chunks/{stats-TUExo9iU.js → stats-WNUyieG-.js} +1 -1
- package/dist/chunks/{status-Dghaz1my.js → status-CjBS9SkF.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-DVZSSXeK.js → statusNoticeHelpers-cnI4TiGw.js} +1 -1
- package/dist/chunks/{tag-ZcVkzFjz.js → tag-Gfb8vTAR.js} +2 -2
- package/dist/chunks/{tasks-DbB33ekt.js → tasks-BwX1rzOD.js} +1 -1
- package/dist/chunks/{teamHelpers-BmN9nKz-.js → teamHelpers-DEgaCpta.js} +1 -1
- package/dist/chunks/teamHelpers-EJxTXoTV.js +1 -0
- package/dist/chunks/teammateModeSnapshot-BgUQ4Phz.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-CPjJJDL1.js → teammateModeSnapshot-Dyukgtp9.js} +1 -1
- package/dist/chunks/teleport-B4p8XlAv.js +1 -0
- package/dist/chunks/{templateJobs-Db630FZD.js → templateJobs-DQXuFnkl.js} +1 -1
- package/dist/chunks/{terminalSetup-ygKHrVKR.js → terminalSetup-CTEIn08j.js} +1 -1
- package/dist/chunks/{terminalSetup-DJqWE8fc.js → terminalSetup-bSbq4LE7.js} +1 -1
- package/dist/chunks/{theme-MmfFhdTD.js → theme-DazaKPy8.js} +1 -1
- package/dist/chunks/thinkback-BOfZP_QG.js +1 -0
- package/dist/chunks/{thinkback-CrNirB0V.js → thinkback-CxWZV2Oz.js} +1 -1
- package/dist/chunks/{thinkback-play-CQ1s7oqg.js → thinkback-play-CHe1x2Hc.js} +1 -1
- package/dist/chunks/{toolEventObserver-BqMplcIk.js → toolEventObserver-D4h-QqVP.js} +1 -1
- package/dist/chunks/{toolEventObserver-DBq2XBYY.js → toolEventObserver-Dfvv2trb.js} +1 -1
- package/dist/chunks/toolPool-BHChMuLr.js +1 -0
- package/dist/chunks/toolPool-C5K43w4_.js +1 -0
- package/dist/chunks/{trustedDevice-DEuQUTbz.js → trustedDevice-CQ9PK-8m.js} +1 -1
- package/dist/chunks/{trustedDevice-C9Zevohz.js → trustedDevice-rdvUkS1W.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-DrlfRrXq.js → ultrareviewCommand-Zf9hO4wr.js} +2 -2
- package/dist/chunks/{undercover-DKn95mh9.js → undercover-DLyKv5TE.js} +1 -1
- package/dist/chunks/undercover-DNS9V_JT.js +1 -0
- package/dist/chunks/{updateCCB-CJ7dCUan.js → updateCCB-7WQRz9lW.js} +4 -4
- package/dist/chunks/{upgrade-Degqbu8S.js → upgrade-ByIumMQe.js} +1 -1
- package/dist/chunks/upgrade-bK4x32Ma.js +1 -0
- package/dist/chunks/{upload-pTZQCPLt.js → upload-CvOMbA9_.js} +1 -1
- package/dist/chunks/{usage-D96a7Cke.js → usage-C_d-Z-eb.js} +1 -1
- package/dist/chunks/{usage-DVQMUMcC.js → usage-DE4PSQiF.js} +1 -1
- package/dist/chunks/useMainLoopModel-Os8Ao8-x.js +1 -0
- package/dist/chunks/{useManagePlugins-BfGzHMvO.js → useManagePlugins-BYBubfHU.js} +1 -1
- package/dist/chunks/{useMergedTools-TemEvCrX.js → useMergedTools-BJAn2i-F.js} +1 -1
- package/dist/chunks/{useSearchInput-B-V4kIa-.js → useSearchInput-CF77X2OV.js} +1 -1
- package/dist/chunks/useSettingsErrors-DD7fQ-fU.js +1 -0
- package/dist/chunks/{useVoice-BuwYDm2U.js → useVoice-DwzMN0fq.js} +1 -1
- package/dist/chunks/{util-CeIKZmj9.js → util-DD30Y4o8.js} +1 -1
- package/dist/chunks/utils-D44M8obg.js +1 -0
- package/dist/chunks/validatePlugin-DpHiJRsT.js +1 -0
- package/dist/chunks/{vim-DUZQCWUP.js → vim-zc9EiMil.js} +1 -1
- package/dist/chunks/{voice-BkRIHZiM.js → voice-BRhZt4jW.js} +2 -2
- package/dist/chunks/{voiceModeEnabled-CPQUE3PU.js → voiceModeEnabled-168-1Ocs.js} +1 -1
- package/dist/chunks/voiceModeEnabled-CTT25yFj.js +1 -0
- package/dist/chunks/{voiceStreamSTT-Dr_wH1Kh.js → voiceStreamSTT-B80UegKG.js} +1 -1
- package/dist/chunks/voiceStreamSTT-BpYhKo2H.js +1 -0
- package/dist/chunks/{workerRegistry-CT7_kjvY.js → workerRegistry-s8nnpmUO.js} +1 -1
- package/dist/chunks/worktree-CkB4jLXK.js +1 -0
- package/dist/chunks/{xml-DD_ldd3X.js → xml-DTMvLcPg.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-SIUwkD8j.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +0 -1
- package/dist/chunks/DevChannelsDialog-DXRgY00D.js +0 -1
- package/dist/chunks/DiffDialog-PvNZfZby.js +0 -3
- package/dist/chunks/Doctor--B1HUENo.js +0 -1
- package/dist/chunks/Doctor-CE_jL9jC.js +0 -3
- package/dist/chunks/Feedback-B5rPGl_C.js +0 -2
- package/dist/chunks/Grove-C2YjB3zL.js +0 -1
- package/dist/chunks/MCPConnectionManager-CDsa79pu.js +0 -1
- package/dist/chunks/MessageSelector-CkeGQPNM.js +0 -3
- package/dist/chunks/Messages-PfbzLYOU.js +0 -11
- package/dist/chunks/PluginSettings-B2ASJ0Rx.js +0 -17
- package/dist/chunks/QueryEngine-Av0G5fze.js +0 -1
- package/dist/chunks/REPL-DCwqua0C.js +0 -1
- package/dist/chunks/REPL-Dh8vzGmF.js +0 -97
- package/dist/chunks/ResumeConversation-B3WuB8rs.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +0 -1
- package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +0 -1
- package/dist/chunks/Settings-CreAhCsb.js +0 -2
- package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +0 -1
- package/dist/chunks/TrustDialog-CIzAlGn9.js +0 -1
- package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +0 -2
- package/dist/chunks/api-Dz_3z1kl.js +0 -1
- package/dist/chunks/assistant-zVegFdAO.js +0 -1
- package/dist/chunks/auth-D4isgfuK.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +0 -17
- package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +0 -1
- package/dist/chunks/bridgeConfig-CNbOKpAg.js +0 -1
- package/dist/chunks/bridgeEnabled-BUJTCUHY.js +0 -1
- package/dist/chunks/bridgeMain-BimZwc2P.js +0 -68
- package/dist/chunks/bridgeMain-DYL4fl6A.js +0 -1
- package/dist/chunks/caches-CTfNpKhW.js +0 -1
- package/dist/chunks/changeDetector-Y9KV5LgG.js +0 -1
- package/dist/chunks/channelNotification-CC7Xb06W.js +0 -1
- package/dist/chunks/clear-OUVFUt8Z.js +0 -1
- package/dist/chunks/client-B47ZvTMo.js +0 -1
- package/dist/chunks/commands-FJGWgQsa.js +0 -1
- package/dist/chunks/commitAttribution-DSv9FggK.js +0 -1
- package/dist/chunks/context-noninteractive-Bd2HO-vU.js +0 -1
- package/dist/chunks/conversation-BP0phkOY.js +0 -1
- package/dist/chunks/conversation-Ci8O_eZ-.js +0 -1
- package/dist/chunks/createSession-B9MhWusY.js +0 -1
- package/dist/chunks/cronJitterConfig-BzPaa52I.js +0 -6
- package/dist/chunks/crossProjectResume-tWsqBUHc.js +0 -40
- package/dist/chunks/datadog-DJowkWhh.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +0 -1
- package/dist/chunks/extra-usage-DGHEQOrY.js +0 -1
- package/dist/chunks/extractMemories-jvjCvtpC.js +0 -1
- package/dist/chunks/fast-Bbtx_Bs1.js +0 -1
- package/dist/chunks/gates-DSI3vpwO.js +0 -1
- package/dist/chunks/hooks-BLLL4iPv.js +0 -1
- package/dist/chunks/inboundAttachments-D-p91z3w.js +0 -1
- package/dist/chunks/initReplBridge-BiHXpDEY.js +0 -1
- package/dist/chunks/language-B_-BfBT4.js +0 -1
- package/dist/chunks/launchAutofixPr-D2qac07g.js +0 -2
- package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +0 -1
- package/dist/chunks/localSearch-DtVqtfvk.js +0 -1
- package/dist/chunks/login-D-N78G6r.js +0 -1
- package/dist/chunks/logout-CFggVS-9.js +0 -1
- package/dist/chunks/mcp-CAYGNxCb.js +0 -1
- package/dist/chunks/mcp-COQap0SM.js +0 -6
- package/dist/chunks/mcp-DlM0OC6R.js +0 -2
- package/dist/chunks/model-DdbcxKub.js +0 -1
- package/dist/chunks/permissions-BLzPHh_3.js +0 -3
- package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +0 -1
- package/dist/chunks/plugins-BgOP_8TX.js +0 -4
- package/dist/chunks/policyLimits-CKy_gTEt.js +0 -1
- package/dist/chunks/poorMode-DJvjO2nW.js +0 -1
- package/dist/chunks/processBashCommand-D5dC6Mya.js +0 -1
- package/dist/chunks/prompt-CQC-mh6u.js +0 -1
- package/dist/chunks/prompt-DawxLANl.js +0 -1
- package/dist/chunks/rcDebugLog-BbPkkigY.js +0 -11
- package/dist/chunks/sandbox-adapter-CxkhKgaa.js +0 -1
- package/dist/chunks/searchExtraTools-DQ6e601b.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +0 -1
- package/dist/chunks/sessionMemory-DIrR3zvb.js +0 -1
- package/dist/chunks/sessionMemory-_dmj8lcH.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +0 -1
- package/dist/chunks/sessionObserver-_adufOGQ.js +0 -1
- package/dist/chunks/sessionStorage-W7okgAlQ.js +0 -1
- package/dist/chunks/setup-TqJ7-Nxh.js +0 -2
- package/dist/chunks/sink-CaWMZBw_.js +0 -1
- package/dist/chunks/sinks-oFfsKySL.js +0 -1
- package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +0 -1
- package/dist/chunks/skillLearning-_o2D06yM.js +0 -1
- package/dist/chunks/teamHelpers-yeTNtZbb.js +0 -1
- package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +0 -1
- package/dist/chunks/teleport-JHgpwZIh.js +0 -1
- package/dist/chunks/thinkback-Quc7KPmi.js +0 -1
- package/dist/chunks/toolPool-BkCtTKXz.js +0 -1
- package/dist/chunks/toolPool-C7bOwJfR.js +0 -1
- package/dist/chunks/undercover-CBeHiWUd.js +0 -1
- package/dist/chunks/upgrade-ucJ-lnlY.js +0 -1
- package/dist/chunks/useMainLoopModel-B7ch2o9K.js +0 -1
- package/dist/chunks/useSettingsErrors-B2JGz1s8.js +0 -1
- package/dist/chunks/utils-CwhszpkT.js +0 -1
- package/dist/chunks/validatePlugin-BlVho93x.js +0 -1
- package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +0 -1
- package/dist/chunks/voiceStreamSTT-DgoDscHn.js +0 -1
- package/dist/chunks/worktree-DU3xtwKW.js +0 -1
|
@@ -1 +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-Ci5mr0vm.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-CA_Tdx8N.js";import{a as I,i as L,n as R,o as z,r as ge,t as _e}from"./crossProjectResume-tWsqBUHc.js";import{t as ve}from"./REPL-Dh8vzGmF.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-Ci5mr0vm.js";t();export{e as clearSearchExtraToolsDescriptionCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./SentryErrorBoundary-B6EWoJml.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-Q2255dD7.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-Ci5mr0vm.js";import{r as Nt,t as Pt}from"./poorMode-C5Frra4j.js";import{t as U}from"./useKeybinding-FsOnjW6T.js";import{l as W,u as Ft}from"./referral-ByevBJrE.js";import{i as It,r as Lt}from"./bridgeEnabled-5vsPrjuq.js";import{a as Rt,n as zt,r as Bt}from"./teammateModeSnapshot-CPjJJDL1.js";import{i as Vt,n as G,r as Ht}from"./modalContext-CmSKRyea.js";import{n as Ut,t as Wt}from"./ThemePicker-DueihHcy.js";import{i as Gt,n as Kt,r as qt,t as Jt}from"./extraUsage-CfxgfpX_.js";import{n as Yt,t as Xt}from"./ClaudeMdExternalIncludesDialog-Bz0JyaOG.js";import{t as Zt}from"./SearchBox-DfOmUoaI.js";import{n as Qt,t as $t}from"./useSearchInput-B-V4kIa-.js";import{n as en,t as tn}from"./usage-DVQMUMcC.js";import{a as nn,i as rn,t as an}from"./OverageCreditUpsell-Q5g2YjQw.js";function on(){let e=v();return[{label:`Version`,value:`2.6.0`},{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.0`,onChoice:e=>{if(z(null),i(!1),e===`cancel`)return;L.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`2.6.0`),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{Rn as t,b as n,f as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{Zc as s,el as c}from"./paths-Q2255dD7.js";import{Dx as l,cy as u,gy as d,my as f}from"./loadAgentsDir-Ci5mr0vm.js";import{a as p,r as m}from"./githubRepoPathMapping-Dut3d6nn.js";var h=e(t(),1);i(),c(),u(),d();var g=o();function _({targetRepo:e,initialPaths:t,onSelectPath:i,onCancel:o}){let[c,u]=(0,h.useState)(t),[d,_]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),b=(0,h.useCallback)(async t=>{if(t===`cancel`){o();return}if(y(!0),_(null),await p(t,e)){i(t);return}m(e,t),u(c.filter(e=>e!==t)),y(!1),_(`${s(t)} no longer contains the correct repository. Select another path.`)},[e,c,i,o]),x=[...c.map(e=>({label:(0,g.jsxs)(n,{children:[`Use `,(0,g.jsx)(n,{bold:!0,children:s(e)})]}),value:e})),{label:`Cancel`,value:`cancel`}];return(0,g.jsx)(r,{title:`Teleport to Repo`,onCancel:o,color:`background`,children:c.length>0?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(a,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{children:[`Open Claude Code in `,(0,g.jsx)(n,{bold:!0,children:e}),`:`]})]}),v?(0,g.jsxs)(a,{children:[(0,g.jsx)(f,{}),(0,g.jsx)(n,{children:` Validating repository…`})]}):(0,g.jsx)(l,{options:x,onChange:e=>void b(e)})]}):(0,g.jsxs)(a,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{dimColor:!0,children:[`Run claude --teleport from a checkout of `,e]})]})})}export{_ as TeleportRepoMismatchDialog};
|
|
@@ -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-Q2255dD7.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-Ci5mr0vm.js";import{In as j}from"./prompt-DEPUnJdB.js";import{t as M}from"./useKeybinding-FsOnjW6T.js";import{l as N,u as P}from"./referral-ByevBJrE.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-Ci5mr0vm.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-B6URs6nc.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,s as t}from"./assistant-BRGDWkKB.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-Ci5mr0vm.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-Q2255dD7.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-Ci5mr0vm.js";import{Bn as be,Vn as xe}from"./prompt-DEPUnJdB.js";import{X as Se}from"./rcDebugLog-BbPkkigY.js";import{n as Ce,r as we}from"./magicDocs-BfoeYhin.js";import{n as Te,t as Ee}from"./pluginAutoupdate-Cr9hP0zG.js";import{n as De,r as Oe}from"./registerProtocol-DzhaQH02.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-jvjCvtpC.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-CYnAG60-.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,t as r}from"./bridgeConfig-CJ-KznTS.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-5vsPrjuq.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-Q2255dD7.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-Ci5mr0vm.js";import{n as ie,t as J}from"./rcDebugLog-BbPkkigY.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-Bd1s_VFj.js";import{a as X,i as fe}from"./trustedDevice-C9Zevohz.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-DhptuhFw.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.0
|
|
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-B9MhWusY.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-B9MhWusY.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-BdCuh6eA.js`);b();let{initSinks:T}=await import(`./sinks-oFfsKySL.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-CqURlg4d.js`),{getBridgeAccessToken:N,getBridgeBaseUrl:I}=await import(`./bridgeConfig-CNbOKpAg.js`);N()||(console.error(pe),process.exit(1));let{getGlobalConfig:te,saveGlobalConfig:ne,getCurrentProjectConfig:L,saveCurrentProjectConfig:R}=await import(`./config-BdCuh6eA.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-BLLL4iPv.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-CqURlg4d.js`),de=ee({baseUrl:z,getAccessToken:N,runnerVersion:`2.6.0`,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-B9MhWusY.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-B9MhWusY.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-BdCuh6eA.js`);o();let{initSinks:c}=await import(`./sinks-oFfsKySL.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-CNbOKpAg.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-BLLL4iPv.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.0`,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-B9MhWusY.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-BimZwc2P.js";export{e as bridgeMain};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./caches-BUBkfP2Q.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fA as e,gA as t}from"./loadAgentsDir-Ci5mr0vm.js";e();export{t as settingsChangeDetector};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t}from"./channelNotification-l3EXKDNB.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-Ci8O_eZ-.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-Q2255dD7.js";t();export{e as getOrganizationUUID};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Gi as e,Xi as t,zi as n}from"./loadAgentsDir-Ci5mr0vm.js";t();export{n as clearCommandsCache,e as getCommands};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,l as t}from"./commitAttribution-BFshsh2H.js";t();export{e as isInternalModelRepo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./context-noninteractive-k2ibficU.js";t();export{n as call,e as collectContextData};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./conversation-Ci8O_eZ-.js";e();export{t as clearConversation};
|
|
@@ -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-Ci5mr0vm.js";import{C as K,y as q}from"./rcDebugLog-BbPkkigY.js";import{l as J,r as Y}from"./commitAttribution-BFshsh2H.js";import{n as X,t as Z}from"./caches-BUBkfP2Q.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{a as e,i as t,n,r}from"./createSession-CJEsHz58.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./defineProperty-80gRi2ZW.js";import{Cn as i,Ln as a,Mn as o,Tt as s,Xn as c,Yn as l,kt as u,ln as d,un as f,vt as p,wn as m,wt as h}from"./schemas-BGAvj1T4.js";import{n as g,t as _}from"./v4-f1i_CNUT.js";import{Ct as v,St as ee,cn as y,gr as te,gt as b,ot as x,ut as S,vn as ne}from"./state-sIHsFpDu.js";import{Fl as C,Il as re,S as w,Ss as ie,al as ae,el as oe,v as se,xs as ce}from"./paths-Q2255dD7.js";import{E as T,L as le,R as ue,T as de,V as E,X as fe,Y as pe,d as D,k as me,s as O,w as k}from"./debug-UI3T040K.js";import{n as he,r as A}from"./analytics-DqMQntaB.js";import{n as ge,o as _e}from"./process-DMKLUQIO.js";import{F as ve,P as ye,n as be,v as xe}from"./git-CN3qtTb_.js";import{o as Se,s as j}from"./log-CzsijfHZ.js";import{s as Ce,u as we}from"./types-Csi32ZXh.js";import{n as M,t as N}from"./lazySchema-2sOku3cX.js";import{a as Te,i as Ee}from"./genericProcessUtils-BGvcwuPt.js";import{En as De,Fs as Oe,G as ke,Hs as Ae,K as je,Ls as Me,ND as Ne,NO as Pe,PD as Fe,PO as Ie,Sg as Le,Tn as Re,Ut as ze,Vs as Be,_g as Ve,ag as He,bg as Ue,cg as We,cu as Ge,dg as Ke,fg as P,gg as qe,hg as Je,iD as F,lg as Ye,lu as Xe,mg as Ze,nf as Qe,oD as I,og as $e,pg as et,sg as L,tD as R,tf as tt,ug as nt,vg as rt,xg as it,yg as at,yn as ot}from"./loadAgentsDir-Ci5mr0vm.js";import{B as z,H as st,I as B,J as ct,K as lt,R as ut,V as dt,W as ft,q as pt,z as mt}from"./prompt-DEPUnJdB.js";import{n as ht,r as gt}from"./cron-DiW7eIPP.js";import{d as _t,h as vt}from"./rcDebugLog-BbPkkigY.js";import{t as yt}from"./controlMessageCompat-BJhFiS7u.js";import{dirname as bt,isAbsolute as xt,join as St,resolve as Ct}from"path";import{randomUUID as V}from"crypto";import{mkdir as wt,readFile as Tt,unlink as Et,writeFile as H}from"fs/promises";_(),N(),Le();var Dt=M(()=>c()),Ot=M(()=>m({matcher:a().optional(),hookCallbackIds:s(a()),timeout:i().optional()}).describe(`Configuration for matching and routing hook callbacks.`)),kt=M(()=>m({subtype:f(`initialize`),hooks:o(Ye(),s(Ot())).optional(),sdkMcpServers:s(a()).optional(),jsonSchema:o(a(),c()).optional(),systemPrompt:a().optional(),appendSystemPrompt:a().optional(),agents:o(a(),$e()).optional(),promptSuggestions:u().optional(),agentProgressSummaries:u().optional()}).describe(`Initializes the SDK session with hooks, MCP servers, and agent configuration.`));M(()=>m({commands:s(it()),agents:s(L()),output_style:a(),available_output_styles:s(a()),models:s(et()),account:He(),pid:i().optional().describe(`@internal CLI process PID for tmux socket isolation`),fast_mode_state:We().optional()}).describe(`Response from session initialization with available commands, models, and account info.`));var At=M(()=>m({subtype:f(`interrupt`)}).describe(`Interrupts the currently running conversation turn.`)),jt=M(()=>m({subtype:f(`can_use_tool`),tool_name:a(),input:o(a(),c()),permission_suggestions:s(Je()).optional(),blocked_path:a().optional(),decision_reason:a().optional(),title:a().optional(),display_name:a().optional(),tool_use_id:a(),agent_id:a().optional(),description:a().optional()}).describe(`Requests permission to use a tool with the given input.`)),Mt=M(()=>m({subtype:f(`set_permission_mode`),mode:Ze(),ultraplan:u().optional().describe(`@internal CCR ultraplan session marker.`)}).describe(`Sets the permission mode for tool execution handling.`)),Nt=M(()=>m({subtype:f(`set_model`),model:a().optional()}).describe(`Sets the model to use for subsequent conversation turns.`)),Pt=M(()=>m({subtype:f(`set_max_thinking_tokens`),max_thinking_tokens:i().nullable()}).describe(`Sets the maximum number of thinking tokens for extended thinking.`)),Ft=M(()=>m({subtype:f(`mcp_status`)}).describe(`Requests the current status of all MCP server connections.`));M(()=>m({mcpServers:s(P())}).describe(`Response containing the current status of all MCP server connections.`));var It=M(()=>m({subtype:f(`get_context_usage`)}).describe(`Requests a breakdown of current context window usage by category.`)),Lt=M(()=>m({name:a(),tokens:i(),color:a(),isDeferred:u().optional()})),Rt=M(()=>m({color:a(),isFilled:u(),categoryName:a(),tokens:i(),percentage:i(),squareFullness:i()}));M(()=>m({categories:s(Lt()),totalTokens:i(),maxTokens:i(),rawMaxTokens:i(),percentage:i(),gridRows:s(s(Rt())),model:a(),memoryFiles:s(m({path:a(),type:a(),tokens:i()})),mcpTools:s(m({name:a(),serverName:a(),tokens:i(),isLoaded:u().optional()})),deferredBuiltinTools:s(m({name:a(),tokens:i(),isLoaded:u()})).optional(),systemTools:s(m({name:a(),tokens:i()})).optional(),systemPromptSections:s(m({name:a(),tokens:i()})).optional(),agents:s(m({agentType:a(),source:a(),tokens:i()})),slashCommands:m({totalCommands:i(),includedCommands:i(),tokens:i()}).optional(),skills:m({totalSkills:i(),includedSkills:i(),tokens:i(),skillFrontmatter:s(m({name:a(),source:a(),tokens:i()}))}).optional(),autoCompactThreshold:i().optional(),isAutoCompactEnabled:u(),messageBreakdown:m({toolCallTokens:i(),toolResultTokens:i(),attachmentTokens:i(),assistantMessageTokens:i(),userMessageTokens:i(),toolCallsByType:s(m({name:a(),callTokens:i(),resultTokens:i()})),attachmentsByType:s(m({name:a(),tokens:i()}))}).optional(),apiUsage:m({input_tokens:i(),output_tokens:i(),cache_creation_input_tokens:i(),cache_read_input_tokens:i()}).nullable()}).describe(`Breakdown of current context window usage by category (system prompt, tools, messages, etc.).`));var zt=M(()=>m({subtype:f(`rewind_files`),user_message_id:a(),dry_run:u().optional()}).describe(`Rewinds file changes made since a specific user message.`));M(()=>m({canRewind:u(),error:a().optional(),filesChanged:s(a()).optional(),insertions:i().optional(),deletions:i().optional()}).describe(`Result of a rewindFiles operation.`));var Bt=M(()=>m({subtype:f(`cancel_async_message`),message_uuid:a()}).describe(`Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.`));M(()=>m({cancelled:u()}).describe(`Result of a cancel_async_message operation. cancelled=false means the message was not in the queue (already dequeued or never enqueued).`));var Vt=M(()=>m({subtype:f(`seed_read_state`),path:a(),mtime:i()}).describe(`Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.`)),Ht=M(()=>m({subtype:f(`hook_callback`),callback_id:a(),input:nt(),tool_use_id:a().optional()}).describe(`Delivers a hook callback with its input data.`)),Ut=M(()=>m({subtype:f(`mcp_message`),server_name:a(),message:Dt()}).describe(`Sends a JSON-RPC message to a specific MCP server.`)),Wt=M(()=>m({subtype:f(`mcp_set_servers`),servers:o(a(),Ke())}).describe(`Replaces the set of dynamically managed MCP servers.`));M(()=>m({added:s(a()),removed:s(a()),errors:o(a(),a())}).describe(`Result of replacing the set of dynamically managed MCP servers.`));var Gt=M(()=>m({subtype:f(`reload_plugins`)}).describe(`Reloads plugins from disk and returns the refreshed session components.`));M(()=>m({commands:s(it()),agents:s(L()),plugins:s(m({name:a(),path:a(),source:a().optional()})),mcpServers:s(P()),error_count:i()}).describe(`Refreshed commands, agents, plugins, and MCP server status after reload.`));var Kt=M(()=>m({subtype:f(`mcp_reconnect`),serverName:a()}).describe(`Reconnects a disconnected or failed MCP server.`)),qt=M(()=>m({subtype:f(`mcp_toggle`),serverName:a(),enabled:u()}).describe(`Enables or disables an MCP server.`)),Jt=M(()=>m({subtype:f(`stop_task`),task_id:a()}).describe(`Stops a running task.`)),Yt=M(()=>m({subtype:f(`apply_flag_settings`),settings:o(a(),c())}).describe(`Merges the provided settings into the flag settings layer, updating the active configuration.`)),Xt=M(()=>m({subtype:f(`get_settings`)}).describe(`Returns the effective merged settings and the raw per-source settings.`));M(()=>m({effective:o(a(),c()),sources:s(m({source:p([`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`]),settings:o(a(),c())})).describe(`Ordered low-to-high priority — later entries override earlier ones.`),applied:m({model:a(),effort:p([`low`,`medium`,`high`,`xhigh`,`max`]).nullable()}).optional().describe("Runtime-resolved values after env overrides, session state, and model-specific defaults are applied. Unlike `effective` (disk merge), these reflect what will actually be sent to the API.")}).describe(`Effective merged settings plus raw per-source settings in merge order.`));var Zt=M(()=>m({subtype:f(`elicitation`),mcp_server_name:a(),message:a(),mode:p([`form`,`url`]).optional(),url:a().optional(),elicitation_id:a().optional(),requested_schema:o(a(),c()).optional()}).describe(`Requests the SDK consumer to handle an MCP elicitation (user input request).`)),Qt=M(()=>m({action:p([`accept`,`decline`,`cancel`]),content:o(a(),c()).optional()}).describe(`Response from the SDK consumer for an elicitation request.`)),$t=M(()=>l([At(),jt(),kt(),Mt(),Nt(),Pt(),Ft(),It(),Ht(),Ut(),zt(),Bt(),Vt(),Wt(),Gt(),Kt(),qt(),Jt(),Yt(),Xt(),Zt()])),U=M(()=>m({type:f(`control_request`),request_id:a(),request:$t()})),en=M(()=>m({subtype:f(`success`),request_id:a(),response:o(a(),c()).optional()})),tn=M(()=>m({subtype:f(`error`),request_id:a(),error:a(),pending_permission_requests:s(d(()=>U())).optional()})),nn=M(()=>m({type:f(`control_response`),response:l([en(),tn()])})),rn=M(()=>m({type:f(`control_cancel_request`),request_id:a()}).describe(`Cancels a currently open control request.`)),an=M(()=>m({type:f(`keep_alive`)}).describe(`Keep-alive message to maintain WebSocket connection.`)),on=M(()=>m({type:f(`update_environment_variables`),variables:o(a(),a())}).describe(`Updates environment variables at runtime.`));M(()=>l([qe(),rt(),at(),Ve(),nn(),U(),rn(),an()])),M(()=>l([Ue(),U(),nn(),an(),on()])),n(),y(),pe(),E(),k(),ge(),ye(),De(),_(),O(),N(),F(),tt(),M(()=>g.object({tool_name:g.string().describe(`The name of the tool requesting permission`),input:g.record(g.string(),g.unknown()).describe(`The input for the tool`),tool_use_id:g.string().optional().describe(`The unique tool use request ID`)}));var sn=M(()=>g.enum([`user_temporary`,`user_permanent`,`user_reject`]).optional().catch(void 0)),cn=M(()=>g.object({behavior:g.literal(`allow`),updatedInput:g.record(g.string(),g.unknown()),updatedPermissions:g.array(Qe()).optional().catch(e=>{D(`Malformed updatedPermissions from SDK host ignored: ${e.error.issues[0]?.message??`unknown`}`,{level:`warn`})}),toolUseID:g.string().optional(),decisionClassification:sn()})),ln=M(()=>g.object({behavior:g.literal(`deny`),message:g.string(),interrupt:g.boolean().optional(),toolUseID:g.string().optional(),decisionClassification:sn()})),W=M(()=>g.union([cn(),ln()]));function G(e,t,n,r){let i={type:`permissionPromptTool`,permissionPromptToolName:t.name,toolResult:e};if(e.behavior===`allow`){let t=e.updatedPermissions;t&&(r.setAppState(e=>({...e,toolPermissionContext:R(e.toolPermissionContext,t)})),I(t));let a=Object.keys(e.updatedInput).length>0?e.updatedInput:n;return{...e,updatedInput:a,decisionReason:i}}else e.behavior===`deny`&&e.interrupt&&(D(`SDK permission prompt deny+interrupt: tool=${t.name} message=${e.message}`),r.abortController.abort());return{...e,decisionReason:i}}he(),Se(),oe(),ce(),w(),Ne(),_t(),Xe(),ot(),je();var un=/\u2028|\u2029/g;function dn(e){return e.replace(un,e=>e===`\u2028`?`\\u2028`:`\\u2029`)}function fn(e){return dn(T(e))}O(),k(),_(),F();var pn=`SandboxNetworkAccess`;function mn(e){if(e){if(e.type===`classifier`)return e.reason;switch(e.type){case`rule`:case`mode`:case`subcommandResults`:case`permissionPromptTool`:return;case`hook`:case`asyncAgent`:case`sandboxOverride`:case`workingDir`:case`safetyCheck`:case`other`:return e.reason}}}function hn(e,t,n,r){let i;try{i=e.getActivityDescription?.(t)??e.getToolUseSummary?.(t)??e.userFacingName(t)}catch{i=e.name}return{tool_name:e.name,action_description:i,tool_use_id:n,request_id:r,input:t}}var gn=1e3,_n=class{constructor(e,t){r(this,`structuredInput`,void 0),r(this,`pendingRequests`,new Map),r(this,`restoredWorkerState`,Promise.resolve(null)),r(this,`inputClosed`,!1),r(this,`unexpectedResponseCallback`,void 0),r(this,`resolvedToolUseIds`,new Set),r(this,`prependedLines`,[]),r(this,`onControlRequestSent`,void 0),r(this,`onControlRequestResolved`,void 0),r(this,`outbound`,new Ge),this.input=e,this.replayUserMessages=t,this.input=e,this.structuredInput=this.read()}trackResolvedToolUseId(e){let t=e.request;if(t.subtype===`can_use_tool`&&(this.resolvedToolUseIds.add(t.tool_use_id),this.resolvedToolUseIds.size>gn)){let e=this.resolvedToolUseIds.values().next().value;e!==void 0&&this.resolvedToolUseIds.delete(e)}}flushInternalEvents(){return Promise.resolve()}get internalEventsPending(){return 0}prependUserMessage(e){this.prependedLines.push(T({type:`user`,content:e,uuid:``,session_id:``,message:{role:`user`,content:e},parent_tool_use_id:null})+`
|
|
2
|
-
`)}async*read(){let e=``,t=async function*(){for(;;){this.prependedLines.length>0&&(e=this.prependedLines.join(``)+e,this.prependedLines=[]);let t=e.indexOf(`
|
|
3
|
-
`);if(t===-1)break;let n=e.slice(0,t);e=e.slice(t+1);let r=await this.processLine(n);r&&(ve(`info`,`cli_stdin_message_parsed`,{type:r.type}),yield r)}}.bind(this);yield*t();for await(let n of this.input)e+=n,yield*t();if(e){let t=await this.processLine(e);t&&(yield t)}this.inputClosed=!0;for(let e of this.pendingRequests.values())e.reject(Error(`Tool permission stream closed before response received`))}getPendingPermissionRequests(){return Array.from(this.pendingRequests.values()).map(e=>e.request).filter(e=>e.request.subtype===`can_use_tool`)}setUnexpectedResponseCallback(e){this.unexpectedResponseCallback=e}injectControlResponse(e){let t=e.response,n=t?.request_id;if(!n)return;let r=this.pendingRequests.get(n);if(r)if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n),this.write({type:`control_cancel_request`,request_id:n}),t.subtype===`error`)r.reject(Error(t.error));else{let e=t.response;if(r.schema)try{r.resolve(r.schema.parse(e))}catch(e){r.reject(e)}else r.resolve({})}}setOnControlRequestSent(e){this.onControlRequestSent=e}setOnControlRequestResolved(e){this.onControlRequestResolved=e}async processLine(e){if(e)try{let t=yt(de(e));if(t.type===`keep_alive`)return;if(t.type===`update_environment_variables`){let e=t.variables??{},n=Object.keys(e);for(let[t,n]of Object.entries(e))process.env[t]=n;D(`[structuredIO] applied update_environment_variables: ${n.join(`, `)}`);return}if(t.type===`control_response`){let e=`uuid`in t&&typeof t.uuid==`string`?t.uuid:void 0;e&&Fe(e,`completed`);let n=t.response,r=this.pendingRequests.get(n.request_id);if(!r){let e=(n.subtype===`success`?n.response:void 0)?.toolUseID;if(typeof e==`string`&&this.resolvedToolUseIds.has(e)){D(`Ignoring duplicate control_response for already-resolved toolUseID=${e} request_id=${n.request_id}`);return}this.unexpectedResponseCallback&&await this.unexpectedResponseCallback(t);return}if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n.request_id),r.request.request.subtype===`can_use_tool`&&this.onControlRequestResolved&&this.onControlRequestResolved(n.request_id),n.subtype===`error`){r.reject(Error(n.error??`Unknown error`));return}let i=n.response;if(r.schema)try{r.resolve(r.schema.parse(i))}catch(e){r.reject(e)}else r.resolve({});return this.replayUserMessages?t:void 0}if(t.type!==`user`&&t.type!==`control_request`&&t.type!==`assistant`&&t.type!==`system`){D(`Ignoring unknown message type: ${t.type}`,{level:`warn`});return}return t.type===`control_request`?(t.request||vn(`Error: Missing request on control_request`),t):(t.type===`assistant`||t.type===`system`||t.message?.role!==`user`&&vn(`Error: Expected message role 'user', got '${t.message?.role}'`),t)}catch(t){console.error(`Error parsing streaming input line: ${e}: ${t}`),process.exit(1)}}async write(e){_e(fn(e)+`
|
|
4
|
-
`)}async sendRequest(e,t,n,r=V()){let i={type:`control_request`,request_id:r,request:e};if(this.inputClosed)throw Error(`Stream closed`);if(n?.aborted)throw Error(`Request aborted`);this.outbound.enqueue(i),e.subtype===`can_use_tool`&&this.onControlRequestSent&&this.onControlRequestSent(i);let a=()=>{this.outbound.enqueue({type:`control_cancel_request`,request_id:r});let e=this.pendingRequests.get(r);e&&(this.trackResolvedToolUseId(e.request),e.reject(new me))};n&&n.addEventListener(`abort`,a,{once:!0});try{return await new Promise((n,i)=>{this.pendingRequests.set(r,{request:{type:`control_request`,request_id:r,request:e},resolve:e=>{n(e)},reject:i,schema:t})})}finally{n&&n.removeEventListener(`abort`,a),this.pendingRequests.delete(r)}}createCanUseTool(e){return async(t,n,r,i,a,o)=>{let s=o??await ke(t,n,r,i,a);if(s.behavior===`allow`||s.behavior===`deny`)return s;let c=new AbortController,l=r.abortController.signal,u=()=>c.abort();l.addEventListener(`abort`,u,{once:!0});try{let i=yn(t.name,a,n,r,s.suggestions).then(e=>({source:`hook`,decision:e})),o=V();e?.(hn(t,n,a,o));let l=this.sendRequest({subtype:`can_use_tool`,tool_name:t.name,input:n,permission_suggestions:s.suggestions,blocked_path:s.blockedPath,decision_reason:mn(s.decisionReason),tool_use_id:a,agent_id:r.agentId},W(),c.signal,o).then(e=>({source:`sdk`,result:e})),u=await Promise.race([i,l]);return u.source===`hook`?u.decision?(l.catch(()=>{}),c.abort(),u.decision):G((await l).result,t,n,r):G(u.result,t,n,r)}catch(e){return G({behavior:`deny`,message:`Tool permission request failed: ${e}`,toolUseID:a},t,n,r)}finally{this.getPendingPermissionRequests().length===0&&vt(`running`),l.removeEventListener(`abort`,u)}}}createHookCallback(e,t){return{type:`callback`,timeout:t,callback:async(t,n,r)=>{try{return await this.sendRequest({subtype:`hook_callback`,callback_id:e,input:t,tool_use_id:n||void 0},Re(),r)}catch(t){return console.error(`Error in hook callback ${e}:`,t),{}}}}}async handleElicitation(e,t,n,r,i,a,o){try{return await this.sendRequest({subtype:`elicitation`,mcp_server_name:e,message:t,mode:i,url:a,elicitation_id:o,requested_schema:n},Qt(),r)}catch{return{action:`cancel`}}}createSandboxAskCallback(){return async e=>{try{return(await this.sendRequest({subtype:`can_use_tool`,tool_name:pn,input:{host:e.host},tool_use_id:V(),description:`Allow network connection to ${e.host}?`},W())).behavior===`allow`}catch{return!1}}}async sendMcpMessage(e,t){return(await this.sendRequest({subtype:`mcp_message`,server_name:e,message:t},m({mcp_response:h()}))).mcp_response}};function vn(e){console.error(e),process.exit(1)}async function yn(e,t,n,r,i){let a=r.getAppState().toolPermissionContext.mode,o=ze(e,t,n,r,a,i,r.abortController.signal);for await(let e of o)if(e.permissionRequestResult&&(e.permissionRequestResult.behavior===`allow`||e.permissionRequestResult.behavior===`deny`)){let t=e.permissionRequestResult;if(t.behavior===`allow`){let e=t.updatedInput||n,i=t.updatedPermissions??[];if(i.length>0){I(i);let e=R(r.getAppState().toolPermissionContext,i);r.setAppState(t=>t.toolPermissionContext===e?t:{...t,toolPermissionContext:e})}return{behavior:`allow`,updatedInput:e,userModified:!1,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}else return{behavior:`deny`,message:t.message||`Permission denied by PermissionRequest hook`,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}}Ie();function bn(e){if(e.type!==`user`)return;let t=e.message?.content;if(!t||Array.isArray(t)&&t.length===0)return;let n=`uuid`in e&&typeof e.uuid==`string`?e.uuid:void 0;return{content:Array.isArray(t)?xn(t):t,uuid:n}}function xn(e){return e.some(Sn)?e.map(e=>{if(!Sn(e))return e;let t=e.source,n=typeof t.mediaType==`string`&&t.mediaType?t.mediaType:Pe(e.source.data);return{...e,source:{type:`base64`,media_type:n,data:e.source.data}}}):e}function Sn(e){return e.type!==`image`||e.source?.type!==`base64`?!1:!e.source.media_type}C(),O(),E(),xe(),Be();function Cn(e,t,n){let r=[],i=[],a=[];for(let[o,s]of Object.entries(e)){let e=t[o],c=Tn(s.source,n?.projectRoot);e?s.sourceIsFallback||re(c,e.source)?a.push(o):i.push({name:o,declaredSource:c,materializedSource:e.source}):r.push(o)}return{missing:r,sourceChanged:i,upToDate:a}}async function wn(e){let t=Me();if(Object.keys(t).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let n;try{n=await Ae()}catch(e){j(e),n={}}let r=Cn(t,n,{projectRoot:x()}),i=[...r.missing.map(e=>({name:e,source:Tn(t[e].source),action:`install`})),...r.sourceChanged.map(({name:e,declaredSource:t})=>({name:e,source:t,action:`update`}))],a=[],o=[];for(let t of i){if(e?.skip?.(t.name,t.source)){a.push(t.name);continue}if(t.action===`update`&&ie(t.source)&&!await ae(t.source.path)){D(`[reconcile] '${t.name}' declared path does not exist; keeping materialized entry`),a.push(t.name);continue}o.push(t)}if(o.length===0)return{installed:[],updated:[],failed:[],upToDate:r.upToDate,skipped:a};D(`[reconcile] ${o.length} marketplace(s): ${o.map(e=>`${e.name}(${e.action})`).join(`, `)}`);let s=[],c=[],l=[];for(let t=0;t<o.length;t++){let{name:n,source:r,action:i}=o[t];e?.onProgress?.({type:`installing`,name:n,action:i,index:t+1,total:o.length});try{let t=await Oe(r);i===`install`?s.push(n):c.push(n),e?.onProgress?.({type:`installed`,name:n,alreadyMaterialized:t.alreadyMaterialized})}catch(t){let r=le(t);l.push({name:n,error:r}),e?.onProgress?.({type:`failed`,name:n,error:r}),j(t)}}return{installed:s,updated:c,failed:l,upToDate:r.upToDate,skipped:a}}function Tn(e,t){if((e.source===`directory`||e.source===`file`)&&!xt(e.path)){let n=t??x(),r=be(n);return{...e,path:Ct(r??n,e.path)}}return e}function K(e){return St(e??S(),kn)}async function En(e){let t;try{t=await Tt(K(e),`utf8`)}catch{return}let n=An().safeParse(we(t,!1));return n.success?n.data:void 0}async function Dn(e,t){let n=K(t),r=T(e);try{return await H(n,r,{flag:`wx`}),!0}catch(e){let t=ue(e);if(t===`EEXIST`)return!1;if(t===`ENOENT`){await wt(bt(n),{recursive:!0});try{return await H(n,r,{flag:`wx`}),!0}catch(e){if(ue(e)===`EEXIST`)return!1;throw e}}throw e}}function q(e){Y?.(),Y=fe(async()=>{await J(e)})}async function On(e){let t=e?.dir,n=e?.lockIdentity??v(),r={sessionId:n,pid:process.pid,acquiredAt:Date.now()};if(await Dn(r,t))return X=void 0,q(e),D(`[ScheduledTasks] acquired scheduler lock (PID ${process.pid})`),!0;let i=await En(t);return i?.sessionId===n?(i.pid!==process.pid&&(await H(K(t),T(r)),q(e)),!0):i&&Te(i.pid)?(X!==i.sessionId&&(X=i.sessionId,D(`[ScheduledTasks] scheduler lock held by session ${i.sessionId} (PID ${i.pid})`)),!1):(i&&D(`[ScheduledTasks] recovering stale scheduler lock from PID ${i.pid}`),await Et(K(t)).catch(()=>{}),await Dn(r,t)?(X=void 0,q(e),!0):!1)}async function J(e){Y?.(),Y=void 0,X=void 0;let t=e?.dir,n=e?.lockIdentity??v(),r=await En(t);if(!(!r||r.sessionId!==n))try{await Et(K(t)),D(`[ScheduledTasks] released scheduler lock`)}catch{}}var kn,An,Y,X,jn=e((()=>{_(),y(),O(),E(),Ee(),Ce(),N(),k(),kn=St(`.claude`,`scheduled_tasks.lock`),An=M(()=>m({sessionId:a(),pid:i(),acquiredAt:i()}))})),Mn=t({buildMissedTaskNotification:()=>Fn,createCronScheduler:()=>Pn,isRecurringTaskAged:()=>Nn});function Nn(e,t,n){return n===0?!1:!!(e.recurring&&!e.permanent&&t-e.createdAt>=n)}function Pn(e){let{onFire:t,isLoading:n,assistantMode:r=!1,onFireTask:i,onMissed:a,dir:o,lockIdentity:s,getJitterConfig:c,isKilled:l,filter:u}=e,d=o||s?{dir:o,lockIdentity:s}:void 0,f=[],p=new Map,m=new Set,h=new Set,g=null,_=null,v=null,y=null,x=!1,S=!1;async function C(e){let n=await pt(o);if(x||(f=n,!e))return;let r=ut(n,Date.now()).filter(e=>!e.recurring&&!m.has(e.id)&&(!u||u(e)));if(r.length>0){for(let e of r)m.add(e.id),p.set(e.id,1/0);A(`tengu_scheduled_task_missed`,{count:r.length,taskIds:r.map(e=>e.id).join(`,`)}),a?a(r):t(Fn(r)),ct(r.map(e=>e.id),o).catch(e=>D(`[ScheduledTasks] failed to remove missed tasks: ${e}`)),D(`[ScheduledTasks] surfaced ${r.length} missed one-shot task(s)`)}}function re(){if(l?.()||n()&&!r)return;let e=Date.now(),a=new Set,s=[],d=c?.()??B;function m(n,r){if(u&&!u(n)||(a.add(n.id),h.has(n.id)))return;let c=p.get(n.id);if(c===void 0&&(c=n.recurring?st(n.cron,n.lastFiredAt??n.createdAt,n.id,d)??1/0:lt(n.cron,n.createdAt,n.id,d)??1/0,p.set(n.id,c),D(`[ScheduledTasks] scheduled ${n.id} for ${c===1/0?`never`:new Date(c).toISOString()}`)),e<c)return;D(`[ScheduledTasks] firing ${n.id}${n.recurring?` (recurring)`:``}`),A(`tengu_scheduled_task_fire`,{recurring:n.recurring??!1,taskId:n.id}),i?i(n):t(n.prompt);let l=Nn(n,e,d.recurringMaxAgeMs);if(l){let t=Math.floor((e-n.createdAt)/1e3/60/60);D(`[ScheduledTasks] recurring task ${n.id} aged out (${t}h since creation), deleting after final fire`),A(`tengu_scheduled_task_expired`,{taskId:n.id,ageHours:t})}if(n.recurring&&!l){let t=st(n.cron,e,n.id,d)??1/0;p.set(n.id,t),r||s.push(n.id)}else r?(ne([n.id]),p.delete(n.id)):(h.add(n.id),ct([n.id],o).catch(e=>D(`[ScheduledTasks] failed to remove task ${n.id}: ${e}`)).finally(()=>h.delete(n.id)),p.delete(n.id))}if(S){for(let e of f)m(e,!1);if(s.length>0){for(let e of s)h.add(e);ft(s,e,o).catch(e=>D(`[ScheduledTasks] failed to persist lastFiredAt: ${e}`)).finally(()=>{for(let e of s)h.delete(e)})}}if(o===void 0)for(let e of ee())m(e,!0);if(a.size===0){p.clear();return}for(let e of p.keys())a.has(e)||p.delete(e)}async function w(){if(x)return;g&&(clearInterval(g),g=null);let{default:e}=await import(`./chokidar-BcI3rIKm.js`);if(x)return;if(S=await On(d).catch(()=>!1),x){S&&(S=!1,J(d));return}S||(v=setInterval(()=>{On(d).then(e=>{if(x){e&&J(d);return}e&&(S=!0,v&&(clearInterval(v),v=null))}).catch(e=>D(String(e),{level:`error`}))},Q),v.unref?.()),C(!0);let t=mt(o);y=e.watch(t,{persistent:!1,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:In},ignorePermissionErrors:!0}),y.on(`add`,()=>void C(!1)),y.on(`change`,()=>void C(!1)),y.on(`unlink`,()=>{x||(f=[],p.clear())}),_=setInterval(re,Z),_.unref?.()}return{start(){if(x=!1,o!==void 0){D(`[ScheduledTasks] scheduler start() — dir=${o}, hasTasks=${z(o)}`),w();return}if(D(`[ScheduledTasks] scheduler start() — enabled=${b()}, hasTasks=${z()}`),!b()&&(r||z())&&te(!0),b()){w();return}g=setInterval(e=>{b()&&e()},Z,w),g.unref?.()},stop(){x=!0,g&&(clearInterval(g),g=null),_&&(clearInterval(_),_=null),v&&(clearInterval(v),v=null),y?.close(),y=null,S&&(S=!1,J(d))},getNextFireTime(){let e=1/0;for(let t of p.values())t<e&&(e=t);return e===1/0?null:e}}}function Fn(e){let t=e.length>1;return`${`The following one-shot scheduled task${t?`s were`:` was`} missed while Claude was not running. ${t?`They have`:`It has`} already been removed from .claude/scheduled_tasks.json.\n\nDo NOT execute ${t?`these prompts`:`this prompt`} yet. First use the AskUserQuestion tool to ask whether to run ${t?`each one`:`it`} now. Only execute if the user confirms.`}\n\n${e.map(e=>{let t=`[${ht(e.cron)}, created ${new Date(e.createdAt).toLocaleString()}]`,n=(e.prompt.match(/`+/g)??[]).reduce((e,t)=>Math.max(e,t.length),0),r="`".repeat(Math.max(3,n+1));return`${t}\n${r}\n${e.prompt}\n${r}`}).join(`
|
|
5
|
-
|
|
6
|
-
`)}`}var Z,In,Q,Ln=e((()=>{y(),gt(),dt(),jn(),O(),Z=1e3,In=300,Q=5e3})),Rn=t({getCronJitterConfig:()=>zn});function zn(){let e=se(`tengu_kairos_cron_config`,B,Bn),t=Hn().safeParse(e);return t.success?t.data:B}var Bn,$,Vn,Hn,Un=e((()=>{_(),dt(),N(),Bn=60*1e3,$=1800*1e3,Vn=720*60*60*1e3,Hn=M(()=>m({recurringFrac:i().min(0).max(1),recurringCapMs:i().int().min(0).max($),oneShotMaxMs:i().int().min(0).max($),oneShotFloorMs:i().int().min(0).max($),oneShotMinuteMod:i().int().min(1).max(60),recurringMaxAgeMs:i().int().min(0).max(Vn).default(B.recurringMaxAgeMs)}).refine(e=>e.oneShotFloorMs<=e.oneShotMaxMs))}));export{Mn as a,wn as c,_n as d,fn as f,Pn as i,bn as l,G as m,zn as n,Ln as o,W as p,Un as r,Cn as s,Rn as t,pn as u};
|