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,40 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Cn as i,F as a,In as o,Ln as s,Mn as c,Rn as l,T as u,Ut as d,_ as f,b as p,g as m,h,l as ee,m as te,t as g,tt as _,x as v,xt as y}from"./src-Di342QoJ.js";import{t as b}from"./jsx-runtime-D-D469L8.js";import{Ct as ne,cn as x,ot as re}from"./state-sIHsFpDu.js";import{Mr as ie,Pr as ae}from"./paths-Q2255dD7.js";import{T as S,d as C,s as w,w as T}from"./debug-UI3T040K.js";import{n as oe,r as E}from"./analytics-DqMQntaB.js";import{i as se,v as ce}from"./git-CN3qtTb_.js";import{a as le,o as D,s as ue}from"./log-CzsijfHZ.js";import{b as O,x as de}from"./teammate-DMYOtLTK.js";import{E as k,g as fe,p as pe,x as A}from"./startupProfiler-DnXZaX4A.js";import{Ar as me,By as he,Dx as ge,Gu as _e,JS as j,Lw as ve,Mi as ye,Mr as be,Ni as xe,Nx as Se,Ox as M,Pr as Ce,Px as we,Ur as Te,YS as Ee,_i as De,gr as Oe,gy as ke,m_ as Ae,my as je,p_ as Me,qu as Ne,wr as N,zy as Pe}from"./loadAgentsDir-Ci5mr0vm.js";import{i as P,r as F}from"./shellQuote-DgjT8KBA.js";import{t as Fe}from"./useKeybinding-FsOnjW6T.js";import{l as Ie,u as Le}from"./referral-ByevBJrE.js";import{t as Re}from"./SearchBox-DfOmUoaI.js";import{n as ze,t as Be}from"./useSearchInput-B-V4kIa-.js";import{n as Ve,t as I}from"./Messages-PfbzLYOU.js";import{n as He,t as Ue}from"./fuse-Ch_OAlm3.js";import{sep as L}from"path";function We({log:e,onExit:t,onSelect:n}){let[r,i]=R.useState(null);R.useEffect(()=>{i(null),Ce(e)&&Te(e).then(i)},[e]);let a=Ce(e)&&r===null,o=r??e,s=N(o)||``,c=_e();return _(`confirm:no`,t,{context:`Confirmation`}),_(`confirm:yes`,(0,R.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,z.jsxs)(v,{flexDirection:`column`,padding:1,children:[(0,z.jsx)(ee,{message:`Loading session…`}),(0,z.jsx)(p,{dimColor:!0,children:(0,z.jsx)(h,{children:(0,z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,z.jsxs)(v,{flexDirection:`column`,children:[(0,z.jsx)(I,{messages:o.messages,tools:c,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:s,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,z.jsxs)(v,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,z.jsxs)(p,{children:[fe(o.modified),` · `,o.messageCount,` messages`,o.gitBranch?` · ${o.gitBranch}`:``]}),(0,z.jsx)(p,{dimColor:!0,children:(0,z.jsxs)(h,{children:[(0,z.jsx)(m,{shortcut:`Enter`,action:`resume`}),(0,z.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var R,z,B=e((()=>{R=t(l(),1),g(),Fe(),Ne(),A(),me(),Ee(),Ve(),z=b()}));function Ge(e,t){if(e===H)return 3+U;let n=i(e),r=t?Math.min(n,t-U-W):n;return Math.max(0,r)+U+W}function Ke(e,t){let n=t-U-W;return i(e)<=n?e:n<=1?e.charAt(0):k(e,n)}function qe({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(G,K),s=n-a-o-2,c=Math.max(0,Math.min(t,e.length-1)),l=Math.max(20,Math.floor(s/2)),u=e.map(e=>Ge(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-$e,n=u[c]??0;for(d=c,f=c+1;d>0||f<e.length;){let r=d>0,i=f<e.length;if(r){let e=(u[d-1]??0)+1;if(n+e<=t){d--,n+=e;continue}}if(i){let e=(u[f]??0)+1;if(n+e<=t){f++,n+=e;continue}}break}}let m=d,h=e.length-f,ee=e.slice(d,f),te=ee.map((e,t)=>d+t);return(0,V.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,V.jsx)(p,{color:`suggestion`,children:i}),m>0&&(0,V.jsxs)(p,{dimColor:!0,children:[Je,m]}),ee.map((e,t)=>{let n=te[t]===c,r=e===H?e:`#${Ke(e,l-U)}`;return(0,V.jsxs)(p,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),h>0?(0,V.jsxs)(p,{dimColor:!0,children:[Ye,h,Xe]}):(0,V.jsx)(p,{dimColor:!0,children:Ze})]})}var V,H,U,W,Je,Ye,Xe,Ze,Qe,$e,G,K,et=e((()=>{l(),g(),A(),V=b(),H=`All`,U=2,W=1,Je=`← `,Ye=`→`,Xe=` (tab to cycle)`,Ze=`(tab to cycle)`,Qe=2,$e=2+Qe+1,G=1+Qe+15,K=14}));function tt({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:o=`expanded`,isDisabled:s=!1,hideIndexes:c=!1,isNodeExpanded:l,onExpand:u,onCollapse:d,getParentPrefix:f,getChildPrefix:p,onUpFromFirstItem:m}){let[h,ee]=q.useState(new Set),te=q.useRef(!1),g=q.useRef(null),_=q.useCallback(e=>l?l(e):h.has(e),[l,h]),y=q.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),b=q.useCallback(e=>e?`▼ `:`▶ `,[]),ne=q.useCallback(e=>` ▸ `,[]),x=f??b,re=p??ne,ie=q.useCallback(e=>{let t=``;return e.hasChildren?t=x(e.isExpanded):e.depth>0&&(t=re(e.depth)),t+e.node.label},[x,re]),ae=q.useMemo(()=>y.map(e=>({label:ie(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[y,ie]),S=q.useMemo(()=>{let e=new Map;return y.forEach(t=>e.set(t.node.id,t.node)),e},[y]),C=q.useCallback(e=>y.find(t=>t.node.id===e),[y]),w=q.useCallback((e,t)=>{let n=C(e);!n||!n.hasChildren||(t?u?u(e):ee(t=>new Set(t).add(e)):d?d(e):ee(t=>{let n=new Set(t);return n.delete(e),n}))},[C,u,d]);return(0,nt.jsx)(v,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||s)return;let t=C(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),w(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),w(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),te.current=!0,w(t.parentId,!1),r)){let e=S.get(t.parentId);e&&r(e)}}}},children:(0,nt.jsx)(ge,{options:ae,onChange:q.useCallback(e=>{let n=S.get(e);n&&t(n)},[S,t]),onFocus:q.useCallback(e=>{if(te.current){te.current=!1;return}if(g.current!==e&&(g.current=e,r)){let t=S.get(e);t&&r(t)}},[r,S]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:o,isDisabled:s,hideIndexes:c,onUpFromFirstItem:m})})}var q,nt,rt=e((()=>{q=t(l(),1),g(),M(),nt=b()}));function it(e,t){return k(e.replace(/\s+/g,` `).trim(),t)}function at({before:e,match:t,after:n},r){return o.dim(e)+r(t)+o.dim(n)}function ot(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function st(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?mt:i?X:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${it(le(e),l)}${c}${s}`}function ct(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=pe(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function lt({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:i,onSelect:o,onLogsChanged:s,onLoadMore:l,initialSearchQuery:ee,showAllProjects:g=!1,onToggleAllProjects:b,onAgenticSearch:x}){let ie=a(),ae=n===void 0?ie.columns:n,S=Le(i),C=d(),w=be(),T=process.env.USER_TYPE===`ant`,[oe]=u(),ce=Pe(oe),D=J.useMemo(()=>e=>c(e,ce.warning),[ce.warning]),ue=process.env.USER_TYPE===`ant`,[O,de]=J.useState(null),[k,fe]=J.useState(!1),[A,me]=J.useState(!1),[he,_e]=J.useState(!1),ve=J.useMemo(()=>re(),[]),[xe,M]=J.useState(``),[Ce,we]=J.useState(0),[Te,Ee]=J.useState(new Set),[ke,Ae]=J.useState(null),[Me,Ne]=J.useState(1),[P,F]=J.useState(`list`),[Fe,Ie]=J.useState(null),Re=J.useRef(null),[Be,Ve]=J.useState(0),[I,He]=J.useState({status:`idle`}),[L,R]=J.useState(!1),z=J.useRef(null),{query:B,setQuery:Ge,cursorOffset:Ke}=ze({isActive:P===`search`&&I.status!==`searching`,onExit:()=>{F(`list`),E(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{F(`list`),E(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:ee||``}),V=J.useDeferredValue(B),[H,U]=J.useState(``);J.useEffect(()=>{if(!V){U(``);return}let e=setTimeout(U,300,V);return()=>clearTimeout(e)},[V]);let[W,Je]=J.useState(null),[Ye,Xe]=J.useState(!1);J.useEffect(()=>{se().then(e=>de(e)),ye(ve).then(e=>{_e(e.length>1)})},[ve]);let Ze=J.useMemo(()=>new Map(e.map(e=>[e,dt(e)])),[e]),Qe=J.useMemo(()=>T?new Ue(e.map(e=>({log:e,searchableText:Ze.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:gt,ignoreLocation:!0,includeScore:!0}):null,[e,Ze,T]),$e=J.useMemo(()=>pt(e),[e]),G=$e.length>0,K=J.useMemo(()=>G?[`All`,...$e]:[],[G,$e]),et=K.length>0&&Be<K.length?Be:0,q=K[et],nt=q===`All`?void 0:q,rt=+!!G,lt=J.useMemo(()=>{let t=e;return w&&(t=e.filter(e=>{let t=ne(),n=N(e);return!!(t&&n===t||e.customTitle||Oe(e.messages)||e.firstPrompt||e.customTitle)})),nt!==void 0&&(t=t.filter(e=>e.tag===nt)),k&&O&&(t=t.filter(e=>e.gitBranch===O)),he&&!A&&(t=t.filter(e=>e.projectPath===ve)),t},[e,w,nt,k,O,he,A,ve]),ut=J.useMemo(()=>{if(!B)return lt;let e=B.toLowerCase();return lt.filter(t=>{let n=le(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[lt,B]);J.useEffect(()=>{T&&V&&V!==H&&Xe(!0)},[V,H,T]),J.useEffect(()=>{if(!T||!H||!Qe){Je(null),Xe(!1);return}let e=setTimeout((e,t,n,r)=>{let i=e.search(t);i.sort((e,t)=>{let n=new Date(e.item.log.modified).getTime(),r=new Date(t.item.log.modified).getTime()-n;return Math.abs(r)>_t?r:(e.score??1)-(t.score??1)}),n({results:i.map(e=>({log:e.item.log,score:e.score,searchableText:e.item.searchableText})),query:t}),r(!1)},0,Qe,H,Je,Xe);return()=>{clearTimeout(e)}},[H,Qe,T]);let{filteredLogs:mt,snippets:X}=J.useMemo(()=>{let e=new Map,t=ut;if(W&&H&&W.query===H){for(let t of W.results)if(t.searchableText){let n=ot(t.searchableText,H,vt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=W.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[ut,W,H]),Z=J.useMemo(()=>I.status===`results`&&I.results.length>0?I.results:mt,[I,mt]),Q=Math.max(30,ae-4),ht=J.useMemo(()=>{if(!w)return[];let e=ft(Z);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=Z.indexOf(n),i=X.get(n),a=i?at(i,D):null;if(t.length===1){let t=ct(n,{showProjectPath:g});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:st(n,Q),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=Z.indexOf(t),i=X.get(t),a=i?at(i,D):null,o=ct(t,{isChild:!0,showProjectPath:g});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:st(t,Q,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=ct(n,{showProjectPath:g});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:st(n,Q,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[w,Z,Q,g,X,D]),yt=J.useMemo(()=>w?[]:Z.map((e,t)=>{let n=it(le(e)+(e.isSidechain?` (sidechain)`:``),Q),r=pe(e),i=g&&e.projectPath?` · ${e.projectPath}`:``,a=X.get(e),o=a?at(a,D):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[w,Z,D,Q,g,X]),$=ke?.value.log??null,bt=()=>{if(!w||!$)return``;let e=N($);if(!e)return``;let t=Z.filter(t=>N(t)===e);if(!(t.length>1))return``;let n=Te.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},xt=J.useCallback(async()=>{let e=$?N($):void 0;if(!$||!e){F(`list`),M(``);return}xe.trim()&&(await De(e,xe.trim(),$.fullPath),w&&s&&s()),F(`list`),M(``)},[$,xe,s,w]),St=J.useCallback(()=>{F(`list`),E(`tengu_session_search_toggled`,{enabled:!1})},[]),Ct=J.useCallback(()=>{F(`search`),E(`tengu_session_search_toggled`,{enabled:!0})},[]),wt=J.useCallback(async()=>{if(!B.trim()||!x||!ue)return;z.current?.abort();let t=new AbortController;z.current=t,He({status:`searching`}),E(`tengu_agentic_search_started`,{query_length:B.length});try{let n=await x(B,e,t.signal);if(t.signal.aborted)return;He({status:`results`,results:n,query:B}),E(`tengu_agentic_search_completed`,{query_length:B.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;He({status:`error`,message:e instanceof Error?e.message:`Search failed`}),E(`tengu_agentic_search_error`,{query_length:B.length})}},[B,x,ue,e]);J.useEffect(()=>{I.status!==`idle`&&I.status!==`searching`&&(I.status===`results`&&I.query!==B||I.status===`error`)&&He({status:`idle`})},[B,I]),J.useEffect(()=>()=>{z.current?.abort()},[]);let Tt=J.useRef(I.status);J.useEffect(()=>{let e=Tt.current;if(Tt.current=I.status,e===`searching`&&I.status===`results`){if(w&&ht.length>0)Ae(ht[0]);else if(!w&&Z.length>0){let e=Z[0];Ae({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[I.status,w,ht,Z]);let Et=J.useCallback(e=>{let t=parseInt(e,10),n=Z[t];!n||Re.current===t.toString()||(Re.current=t.toString(),Ae({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Ne(t+1))},[Z]),Dt=J.useCallback(e=>{Ae(e);let t=Z.findIndex(t=>N(t)===N(e.value.log));t>=0&&Ne(t+1)},[Z]);_(`confirm:no`,()=>{z.current?.abort(),He({status:`idle`}),E(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:P!==`preview`&&I.status===`searching`}),_(`confirm:no`,()=>{F(`list`),M(``)},{context:`Settings`,isActive:P===`rename`&&I.status!==`searching`}),_(`confirm:no`,()=>{Ge(``),R(!1),i?.()},{context:`Confirmation`,isActive:P!==`preview`&&P!==`rename`&&P!==`search`&&L&&I.status!==`searching`}),y((e,t)=>{if(P!==`preview`&&I.status!==`searching`&&P!==`rename`)if(P===`search`)e.toLowerCase()===`n`&&t.ctrl?St():(t.return||t.downArrow)&&B.trim()&&x&&ue&&I.status!==`results`&&R(!0);else{if(L){if(t.return){wt(),R(!1);return}else if(t.downArrow){R(!1);return}else if(t.upArrow){F(`search`),R(!1);return}}if(G&&t.tab){let e=t.shift?-1:1;Ve(t=>{let n=((t<K.length?t:0)+K.length+e)%K.length,r=K[n];return E(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:$e.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&b)b(),E(`tengu_session_all_projects_toggled`,{enabled:!g});else if(r===`b`&&t.ctrl){let e=!k;fe(e),E(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&he){let e=!A;me(e),E(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(F(`search`),E(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(F(`rename`),M(``),E(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Ie($),F(`preview`),E(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(F(`search`),Ge(e),E(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let Ot=[];k&&O&&Ot.push(O),he&&!A&&Ot.push(`current worktree`);let kt=8+ +(Ot.length>0&&P!==`search`)+rt,At=Math.max(1,Math.floor((t-kt-2)/3));return J.useEffect(()=>{l&&Me+At*2>=Z.length&&l(At*3)},[Me,At,Z.length,l]),e.length===0?null:P===`preview`&&Fe&&w?(0,Y.jsx)(We,{log:Fe,onExit:()=>{F(`list`),Ie(null)},onSelect:o}):(0,Y.jsxs)(v,{flexDirection:`column`,height:t-1,children:[(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsx)(te,{color:`suggestion`})}),(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsx)(p,{children:` `})}),G?(0,Y.jsx)(qe,{tabs:K,selectedIndex:et,availableWidth:ae,showAllProjects:g}):(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsxs)(p,{bold:!0,color:`suggestion`,children:[`Resume Session`,P===`list`&&Z.length>At&&(0,Y.jsxs)(p,{dimColor:!0,children:[` `,`(`,Me,` of `,Z.length,`)`]})]})}),(0,Y.jsx)(f,{query:B,isFocused:P===`search`,isTerminalFocused:C,cursorOffset:Ke}),Ot.length>0&&P!==`search`&&(0,Y.jsx)(v,{flexShrink:0,paddingLeft:2,children:(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsx)(h,{children:Ot})})}),(0,Y.jsx)(v,{flexShrink:0,children:(0,Y.jsx)(p,{children:` `})}),I.status===`searching`&&(0,Y.jsxs)(v,{paddingLeft:1,flexShrink:0,children:[(0,Y.jsx)(je,{}),(0,Y.jsx)(p,{children:` Searching…`})]}),I.status===`results`&&I.results.length>0&&(0,Y.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(p,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),I.status===`results`&&I.results.length===0&&mt.length===0&&(0,Y.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),I.status===`error`&&mt.length===0&&(0,Y.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,Y.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!B.trim()&&x&&ue&&I.status!==`searching`&&I.status!==`results`&&I.status!==`error`&&(0,Y.jsxs)(v,{flexShrink:0,flexDirection:`column`,children:[(0,Y.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,Y.jsx)(p,{color:L?`suggestion`:void 0,children:L?r.pointer:` `}),(0,Y.jsx)(p,{color:L?`suggestion`:void 0,bold:L,children:`Search deeply using Claude →`})]}),(0,Y.jsx)(v,{height:1})]}),I.status===`searching`?null:P===`rename`&&$?(0,Y.jsxs)(v,{paddingLeft:2,flexDirection:`column`,children:[(0,Y.jsx)(p,{bold:!0,children:`Rename session:`}),(0,Y.jsx)(v,{paddingTop:1,children:(0,Y.jsx)(Se,{value:xe,onChange:M,onSubmit:xt,placeholder:le($,`Enter new session name`),columns:ae,cursorOffset:Ce,onChangeCursorOffset:we,showCursor:!0})})]}):w?(0,Y.jsx)(tt,{nodes:ht,onSelect:e=>{o(e.value.log)},onFocus:Dt,onCancel:i,focusNodeId:ke?.id,visibleOptionCount:At,layout:`expanded`,isDisabled:P===`search`||L,hideIndexes:!1,isNodeExpanded:e=>{if(P===`search`||k)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?Te.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(Ee(e=>new Set(e).add(t)),E(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Ee(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Ct}):(0,Y.jsx)(ge,{options:yt,onChange:e=>{let t=Z[parseInt(e,10)];t&&o(t)},visibleOptionCount:At,onCancel:i,onFocus:Et,defaultFocusValue:ke?.id.toString(),layout:`expanded`,isDisabled:P===`search`||L,onUpFromFirstItem:Ct}),(0,Y.jsx)(v,{paddingLeft:2,children:S.pending?(0,Y.jsxs)(p,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]}):P===`rename`?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(m,{shortcut:`Enter`,action:`save`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I.status===`searching`?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(p,{children:`Searching with Claude…`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):L?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(m,{shortcut:`Enter`,action:`search`}),(0,Y.jsx)(m,{shortcut:`↓`,action:`skip`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):P===`search`?(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[(0,Y.jsx)(p,{children:Ye&&T?`Searching…`:`Type to Search`}),(0,Y.jsx)(m,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,Y.jsx)(p,{dimColor:!0,children:(0,Y.jsxs)(h,{children:[b&&(0,Y.jsx)(m,{shortcut:`Ctrl+A`,action:`show ${g?`current dir`:`all projects`}`}),O&&(0,Y.jsx)(m,{shortcut:`Ctrl+B`,action:`toggle branch`}),he&&(0,Y.jsx)(m,{shortcut:`Ctrl+W`,action:`show ${A?`current worktree`:`all worktrees`}`}),(0,Y.jsx)(m,{shortcut:`Ctrl+V`,action:`preview`}),(0,Y.jsx)(m,{shortcut:`Ctrl+R`,action:`rename`}),(0,Y.jsx)(p,{children:`Type to search`}),(0,Y.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),bt()&&(0,Y.jsx)(p,{children:bt()})]})})})]})}function ut(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function dt(e){let t=(e.messages.length<=Z?e.messages:[...e.messages.slice(0,Q),...e.messages.slice(-Q)]).map(ut).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>ht?n.slice(0,ht):n}function ft(e){let t=new Map;for(let n of e){let e=N(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function pt(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var J,Y,mt,X,Z,Q,ht,gt,_t,vt,yt=e((()=>{s(),n(),He(),J=t(l(),1),x(),Ie(),Be(),ve(),g(),Fe(),oe(),A(),xe(),ce(),D(),me(),he(),Ee(),M(),Re(),B(),ke(),et(),we(),rt(),Y=b(),mt=2,X=4,Z=2e3,Q=1e3,ht=5e4,gt=.3,_t=60*1e3,vt=50}));function $(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function bt(e){if(e.length===0)return``;let t=(e.length<=wt?e:[...e.slice(0,wt/2),...e.slice(-wt/2)]).map($).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>Ct?t.slice(0,Ct)+`…`:t}function xt(e,t){return!!(le(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&bt(e.messages).toLowerCase().includes(t))}async function St(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>xt(e,r)),a;if(i.length>=Tt)a=i.slice(0,Tt);else{let e=t.filter(e=>!xt(e,r)),n=Tt-i.length;a=[...i,...e.slice(0,n)]}C(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${O(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(Ce(e))try{return await Te(e)}catch(t){return ue(t),e}return e}),s=await Promise.all(o);C(`Agentic search: loaded ${O(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
|
|
2
|
-
${s.map((e,t)=>{let n=[`${t}:`],r=le(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=bt(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
|
|
3
|
-
`)}
|
|
4
|
-
|
|
5
|
-
Search query: "${e}"
|
|
6
|
-
|
|
7
|
-
Find the sessions that are most relevant to this query.`;C(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=ie();C(`Agentic search using model: ${e}`);let t=(await Ae({model:e,system:Et,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(!t||t.type!==`text`)return C(`No text content in agentic search response`),[];C(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return C(`Could not find JSON in agentic search response`),[];let i=(S(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return C(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return ue(e),C(`Agentic search error: ${e}`),[]}}var Ct,wt,Tt,Et,Dt=e((()=>{de(),w(),D(),ae(),me(),Me(),T(),Ct=2e3,wt=100,Tt=100,Et=`Your goal is to find relevant sessions based on a user's search query.
|
|
8
|
-
|
|
9
|
-
You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
|
|
10
|
-
|
|
11
|
-
Each session may include:
|
|
12
|
-
- Title (display name or custom title)
|
|
13
|
-
- Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
|
|
14
|
-
- Branch (git branch name, shown as [branch: name])
|
|
15
|
-
- Summary (AI-generated summary)
|
|
16
|
-
- First message (beginning of the conversation)
|
|
17
|
-
- Transcript (excerpt of conversation content)
|
|
18
|
-
|
|
19
|
-
IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
|
|
20
|
-
|
|
21
|
-
For each session, consider (in order of priority):
|
|
22
|
-
1. Exact tag matches (highest priority - user explicitly categorized this session)
|
|
23
|
-
2. Partial tag matches or tag-related terms
|
|
24
|
-
3. Title matches (custom titles or first message content)
|
|
25
|
-
4. Branch name matches
|
|
26
|
-
5. Summary and transcript content matches
|
|
27
|
-
6. Semantic similarity and related concepts
|
|
28
|
-
|
|
29
|
-
CRITICAL: Be VERY inclusive in your matching. Include sessions that:
|
|
30
|
-
- Contain the query term anywhere in any field
|
|
31
|
-
- Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
|
|
32
|
-
- Discuss topics that could be related to the query
|
|
33
|
-
- Have transcripts that mention the concept even in passing
|
|
34
|
-
|
|
35
|
-
When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
|
|
36
|
-
|
|
37
|
-
Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
|
|
38
|
-
|
|
39
|
-
Respond with ONLY the JSON object, no markdown formatting:
|
|
40
|
-
{"relevant_indices": [2, 5, 0]}`}));function Ot(e,t,n){let r=re();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=N(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${P([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+L)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=N(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${P([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var kt=e((()=>{x(),F(),me()}));export{lt as a,Dt as i,kt as n,yt as o,St as r,Ot as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./datadog-Bd1s_VFj.js";t();export{e as shutdownDatadog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t}from"./envLessBridgeConfig-Ju4W58xf.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./extra-usage-CS6VwKJt.js";e();export{t as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ql as e,Xl as t,Yl as n,Zl as r}from"./loadAgentsDir-Ci5mr0vm.js";e();export{n as drainPendingExtraction,t as executeExtractMemories,r as initExtractMemories};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./fast-CzRUJBTK.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./gates-CbQLZHtm.js";e();export{t as getChicagoEnabled};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Yt as e,un as t,vn as n,yn as r}from"./loadAgentsDir-Ci5mr0vm.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./inboundAttachments-Bmf6vYsE.js";export{e as resolveAndPrepend};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,cn as a,ot as o}from"./state-sIHsFpDu.js";import{Ac as s,Jt as c,Pc as l,Pt as u,S as d,Sc as f,la as p,nn as m,on as h,ua as g,v as _}from"./paths-Q2255dD7.js";import{L as v,V as y,X as ee,Y as b,d as x,s as S}from"./debug-UI3T040K.js";import{n as te,r as C}from"./analytics-DqMQntaB.js";import{F as w,P as T,i as ne,m as re,v as E}from"./git-CN3qtTb_.js";import{g as D,m as O}from"./log-CzsijfHZ.js";import{n as k,t as A}from"./sleep-8Eb9j_Ly.js";import{Aa as ie,Ar as ae,Ba as j,Ca as M,Da as N,Ea as oe,Eo as se,Gv as P,Ka as ce,Lo as F,Ma as I,Oa as le,Oo as L,Ra as R,Sa as ue,Ta as de,Vo as fe,Wv as pe,cd as z,fd as me,hr as B,ja as V,ka as he,wa as ge}from"./loadAgentsDir-Ci5mr0vm.js";import{O as H,_ as _e,d as U,k as ve,n as ye,t as W}from"./rcDebugLog-BbPkkigY.js";import{a as G,c as K,d as be,f as xe,o as q,r as Se,s as J,u as Y}from"./debugUtils-BBMFODKH.js";import{a as Ce,i as we}from"./trustedDevice-C9Zevohz.js";import{a as X,i as Te,n as Z,o as Q,t as $}from"./bridgeConfig-CJ-KznTS.js";import{a as Ee,o as De,r as Oe,s as ke,t as Ae}from"./bridgeEnabled-5vsPrjuq.js";import{i as je,t as Me}from"./assistant-BRGDWkKB.js";import{t as Ne}from"./capacityWake-BXlUpptF.js";import{n as Pe,t as Fe}from"./pollConfig-DhptuhFw.js";import{a as Ie,n as Le,r as Re,t as ze}from"./workSecret-mS2OrpxF.js";import{a as Be,i as Ve,n as He,t as Ue}from"./createSession-CJEsHz58.js";import{i as We,n as Ge}from"./envLessBridgeConfig-Ju4W58xf.js";import{n as Ke,o as qe}from"./mappers-uIrAj-Wd.js";import{n as Je,r as Ye,t as Xe}from"./sessionTitle-DzkMzHer.js";import{a as Ze,i as Qe,n as $e,o as et,r as tt,t as nt}from"./bridgeMessaging-BiE0CTqq.js";import{t as rt}from"./HybridTransport-Byjvz-DL.js";import{n as it,r as at,t as ot}from"./flushGate-C2Icy43G.js";import{hostname as st}from"os";import{randomUUID as ct}from"crypto";a(),O(),E(),s(),g(),h(),d(),X(),P(),Oe(),F(),R(),ae(),Ve(),We(),Ke(),Ye(),he(),S(),W(),T(),te(),b(),K(),z(),Ce(),H(),U(),n(),q(),y(),A(),M();var lt=2e3,ut=6e4,dt=900*1e3,ft=0;async function pt(e){let{dir:n,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:c,sessionIngressUrl:l,workerType:u,getAccessToken:d,createSession:f,archiveSession:p,getCurrentTitle:m=()=>s,toSDKMessages:h=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:g,getPollIntervalConfig:_=()=>Pe,initialHistoryCap:y=200,initialMessages:b,previouslyFlushedUUIDs:S,onInboundMessage:te,onPermissionResponse:T,onInterrupt:ne,onSetModel:re,onSetMaxThinkingTokens:E,onSetPermissionMode:D,onStateChange:O,onUserMessage:k,perpetual:A,initialSSESequenceNum:ie=0}=e,ae=++ft,{writeBridgePointer:j,clearBridgePointer:M,readBridgePointer:N}=await import(`./bridgePointer-FvAMj3re.js`),se=A?await N(n):null,P=se?.source===`repl`?se:null;x(`[bridge:repl] initBridgeCore #${ae} starting (initialMessages=${b?.length??0}${P?` perpetual prior=env:${P.environmentId}`:``})`);let ce=le({baseUrl:c,getAccessToken:d,runnerVersion:`2.6.0`,onDebug:x,onAuth401:g,getTrustedDeviceToken:we}),F=process.env.USER_TYPE===`ant`?oe(ce):ce,I={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:ct(),workerType:u,environmentId:ct(),reuseEnvironmentId:P?.environmentId,apiBaseUrl:c,sessionIngressUrl:l},L,R;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return J(`registration_failed`,`[bridge:repl] Environment registration failed: ${v(e)}`),P&&await M(n),O?.(`failed`,v(e)),null}x(`[bridge:repl] Environment registered: ${L}`),w(`info`,`bridge_repl_env_registered`),C(`tengu_bridge_repl_env_registered`,{});async function fe(e,t){if(L!==e)return x(`[bridge:repl] Env mismatch (requested ${e}, got ${L}) — cannot reconnect in place`),!1;let n=xe(t),r=n===t?[t]:[t,n];for(let e of r)try{return await F.reconnectSession(L,e),x(`[bridge:repl] Reconnected session ${e} in place on env ${L}`),!0}catch(t){x(`[bridge:repl] reconnectSession(${e}) failed: ${v(t)}`)}return x(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let pe=P?await fe(P.environmentId,P.sessionId):!1;P&&!pe&&await M(n);let z;if(pe&&P){if(z=P.sessionId,x(`[bridge:repl] Perpetual session reused: ${z}`),b&&S)for(let e of b)S.add(e.uuid)}else{let e=await f({environmentId:L,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return x(`[bridge:repl] Session creation failed, deregistering environment`),C(`tengu_bridge_repl_session_failed`,{}),await F.deregisterEnvironment(L).catch(()=>{}),O?.(`failed`,`Session creation failed`),null;z=e,x(`[bridge:repl] Session created: ${z}`)}await j(n,{sessionId:z,environmentId:L,source:`repl`}),w(`info`,`bridge_repl_session_created`),C(`tengu_bridge_repl_started`,{has_initial_messages:!!(b&&b.length>0),inProtectedNamespace:t()});let B=new Set;if(b)for(let e of b)B.add(e.uuid);let V=new nt(2e3);for(let e of B)V.add(e);let he=new nt(2e3),H=new AbortController,U=null;_e(e=>{H.signal.aborted||U?.reportMetadata(e)},{replayCurrent:!0});let W=0,G=pe?ie:0,K=null,q=null,Se=Ne(H.signal),Y=Se.wake,Ce=Se.signal,X=new ot,Te=!k,Z=0,Q=null;async function $(){if(Q)return Q;Q=Ee();try{return await Q}finally{Q=null}}async function Ee(){if(Z++,ye(`doReconnect: attempt=${Z}/3 envId=${L} sessionId=${z} workId=${K}`),W++,x(`[bridge:repl] Reconnecting after env lost (attempt ${Z}/3)`),Z>3)return x(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}if(Y(),X.drop(),K){let e=K;if(await F.stopWork(L,e,!1).catch(()=>{}),K!==e)return x(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),Z=0,!0;K=null,q=null}if(H.signal.aborted)return x(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=L;I.reuseEnvironmentId=e;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return I.reuseEnvironmentId=void 0,x(`[bridge:repl] Environment re-registration failed: ${v(e)}`),!1}if(I.reuseEnvironmentId=void 0,x(`[bridge:repl] Re-registered: requested=${e} got=${L}`),H.signal.aborted)return x(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;if(U!==null)return x(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),Z=0,!0;if(await fe(e,z))return C(`tengu_bridge_repl_reconnected_in_place`,{}),Z=0,!0;if(L!==e&&C(`tengu_bridge_repl_env_expired_fresh_session`,{}),await p(z),H.signal.aborted)return x(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;let t=m(),r=await f({environmentId:L,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?H.signal.aborted?(x(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await p(r),!1):(z=r,me(be(r)).catch(()=>{}),G=0,he.clear(),Te=!k,x(`[bridge:repl] Re-created session: ${z}`),await j(n,{sessionId:z,environmentId:L,source:`repl`}),S?.clear(),Z=0,!0):(x(`[bridge:repl] Session creation failed during reconnection`),!1)}function De(){return d()}function Oe(){let e=X.end();if(e.length===0)return;if(!U){x(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)V.add(t.uuid);let t=h(e).map(e=>({...e,session_id:z}));x(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),U.writeBatch(t)}let ke=null;function Ae(){ke?.()}function je(e){if(ye(`handleTransportPermanentClose: code=${e} transport=${U?`exists`:`null`} pollAborted=${H.signal.aborted}`),x(`[bridge:repl] Transport permanently closed: code=${e}`),C(`tengu_bridge_repl_ws_closed`,{code:e}),U){let e=U.getLastSequenceNum();e>G&&(G=e),U=null}Y();let t=X.drop();if(t>0&&x(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){O?.(`failed`,`session ended`),H.abort(),Ae();return}O?.(`reconnecting`,`Remote Control connection lost (code ${e})`),x(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),$().then(t=>{t||H.signal.aborted||(x(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),C(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),O?.(`failed`,`reconnection failed`),Ae())})}let Me;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(Me=()=>{x(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),$()},process.on(`SIGUSR2`,Me));let Fe=null;process.env.USER_TYPE===`ant`&&de({fireClose:e=>{if(!Fe){x(`[bridge:debug] fireClose: no transport wired yet`);return}x(`[bridge:debug] fireClose(${e}) — injecting`),Fe(e)},forceReconnect:()=>{x(`[bridge:debug] forceReconnect — injecting`),$()},injectFault:ge,wakePollLoop:Y,describe:()=>`env=${L} session=${z} transport=${U?.getStateLabel()??`null`} workId=${K??`null`}`}),mt({api:F,getCredentials:()=>({environmentId:L,environmentSecret:R}),signal:H.signal,getPollIntervalConfig:_,onStateChange:O,getWsState:()=>U?.getStateLabel()??`null`,isAtCapacity:()=>U!==null,capacitySignal:Ce,onFatalError:Ae,getHeartbeatInfo:()=>!K||!q?null:{environmentId:L,workId:K,sessionToken:q},onHeartbeatFatal:e=>{if(x(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}X.drop(),K&&F.stopWork(L,K,!1).catch(e=>{x(`[bridge:repl] stopWork after heartbeat fatal: ${v(e)}`)}),K=null,q=null,Y(),O?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await $()?{environmentId:L,environmentSecret:R}:null},onWorkReceived:(e,t,i,a)=>{if(U?.isConnectedStatus()&&x(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),x(`[bridge:repl] Work received: workId=${i} workSessionId=${e} currentSessionId=${z} match=${Ie(e,z)}`),j(n,{sessionId:z,environmentId:L,source:`repl`}),!Ie(e,z)){x(`[bridge:repl] Rejecting foreign session: expected=${z} got=${e}`);return}K=i,q=t;let o=a||r(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=De(),!s){x(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}ve(s)}if(C(`tengu_bridge_repl_work_received`,{}),U){let e=U;U=null;let t=e.getLastSequenceNum();t>G&&(G=t),e.close()}X.deactivate();let u=e=>Qe(e,{transport:U,sessionId:z,onInterrupt:ne,onSetModel:re,onSetMaxThinkingTokens:E,onSetPermissionMode:D}),d=!1,f=e=>{U=e,e.setOnConnect(()=>{if(U===e){if(x(`[bridge:repl] Ingress transport connected`),C(`tengu_bridge_repl_ws_connected`,{}),!o){let e=De();e&&ve(e)}if(He=!1,!d&&b&&b.length>0){d=!0;let t=y,n=b.filter(e=>Ze(e)&&!S?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(x(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),C(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=h(r);if(i.length>0){x(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:z})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){x(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(S)for(let e of i)e.uuid&&S.add(e.uuid)}).catch(e=>x(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{U===e&&(Oe(),O?.(`connected`))})}else Oe(),O?.(`connected`)}else X.active||O?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);ye(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{ye(`ingress (non-JSON): ${String(e).slice(0,200)}`)}tt(e,V,he,te,T,u)}),Fe=je,e.setOnClose(t=>{U===e&&(ye(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),je(t))}),!d&&b&&b.length>0&&X.start(),e.connect()};if(W++,o){let n=ze(c,e),r=W;x(`[bridge:repl] CCR v2: sessionUrl=${n} session=${e} gen=${r}`),at({sessionUrl:n,ingressToken:t,sessionId:e,initialSequenceNum:G}).then(e=>{if(H.signal.aborted){e.close();return}if(r!==W){x(`[bridge:repl] CCR v2: discarding stale handshake gen=${r} current=${W}`),e.close();return}f(e)},e=>{x(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${v(e)}`,{level:`error`}),C(`tengu_bridge_repl_ccr_v2_init_failed`,{}),r===W&&(K&&(F.stopWork(L,K,!1).catch(e=>{x(`[bridge:repl] stopWork after v2 init failure: ${v(e)}`)}),K=null,q=null),Y())})}else{let t=Le(l,e);x(`[bridge:repl] Ingress URL: ${t}`),x(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=s??``;f(it(new rt(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${De()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{O?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),Y()}})))}}});let Re=A?setInterval(()=>{Q||j(n,{sessionId:z,environmentId:L,source:`repl`})},60*6e4):null;Re?.unref?.();let Be=_().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{U&&(x(`[bridge:repl] keep_alive sent`),U.write({type:`keep_alive`}).catch(e=>{x(`[bridge:repl] keep_alive write failed: ${v(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;ke=async()=>{if(He){x(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${L} session=${z}`);return}He=!0;let e=Date.now();if(x(`[bridge:repl] Teardown starting: env=${L} session=${z} workId=${K??`none`} transportState=${U?.getStateLabel()??`null`}`),Re!==null&&clearInterval(Re),Ve!==null&&clearInterval(Ve),Me&&process.off(`SIGUSR2`,Me),process.env.USER_TYPE===`ant`&&(ue(),Fe=null),H.abort(),x(`[bridge:repl] Teardown: poll loop aborted`),U){let e=U.getLastSequenceNum();e>G&&(G=e)}if(A){U=null,X.drop(),await j(n,{sessionId:z,environmentId:L,source:`repl`}),x(`[bridge:repl] Teardown (perpetual): leaving env=${L} session=${z} alive on server, duration=${Date.now()-e}ms`);return}let t=U;if(U=null,X.drop(),t){let e={...et(z),session_id:z};t.write(e)}let r=K?F.stopWork(L,K,!0).then(()=>{x(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{x(`[bridge:repl] Teardown stopWork failed: ${v(e)}`)}):Promise.resolve();await Promise.all([r,p(z)]),t?.close(),x(`[bridge:repl] Teardown: transport closed`),await F.deregisterEnvironment(L).catch(e=>{x(`[bridge:repl] Teardown deregister failed: ${v(e)}`)}),await M(n),x(`[bridge:repl] Teardown complete: env=${L} duration=${Date.now()-e}ms`)};let Ue=ee(()=>ke?.());return x(`[bridge:repl] Ready: env=${L} session=${z}`),O?.(`ready`),{get bridgeSessionId(){return z},get environmentId(){return L},getSSESequenceNum(){let e=U?.getLastSequenceNum()??0;return Math.max(G,e)},sessionIngressUrl:l,writeMessages(e){let t=e.filter(e=>Ze(e)&&!B.has(e.uuid)&&!V.has(e.uuid));if(t.length===0)return;if(!Te)for(let e of t){let t=$e(e);if(t!==void 0&&k?.(t,z)){Te=!0;break}}if(X.enqueue(...t)){x(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!U){let e=t.map(e=>e.type).join(`,`);x(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${z}`,{level:`warn`});return}for(let e of t)V.add(e.uuid);x(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=h(t).map(e=>({...e,session_id:z}));U.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!V.has(e.uuid));if(t.length===0)return;if(!U){x(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${z}`,{level:`warn`});return}for(let e of t)e.uuid&&V.add(e.uuid);let n=t.map(e=>({...e,session_id:z}));U.writeBatch(n)},sendControlRequest(e){if(!U){x(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:z};U.write(t),x(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!U){x(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:z};U.write(t),x(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!U){x(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:z};U.write(t),x(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!U){x(`[bridge:repl] sendResult: skipping, transport not configured session=${z}`);return}U.reportState(`idle`);let e={...et(z),session_id:z};U.write(e),x(`[bridge:repl] Sent result for session=${z}`)},async teardown(){Ue(),await ke?.(),x(`[bridge:repl] Torn down`),C(`tengu_bridge_repl_teardown`,{})}}}async function mt({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:s,capacitySignal:c,onFatalError:l,getPollIntervalConfig:u=()=>Pe,getHeartbeatInfo:d,onHeartbeatFatal:f}){x(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let p=0,m=null,h=null,g=0,_=!1;for(;!n.aborted;){let{environmentId:y,environmentSecret:ee}=t(),b=u();try{let t=await e.pollForWork(y,ee,n,b.reclaim_older_than_ms);if(g=0,p>0&&(x(`[bridge:repl] Poll recovered after ${p} consecutive error(s)`),p=0,m=null,h=null,r?.(`ready`)),!t){let t=_;if(_=!1,s?.()&&c&&!t){let t=b.poll_interval_ms_at_capacity;if(b.non_exclusive_heartbeat_interval_ms>0&&d){C(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:b.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&s()&&(r===null||Date.now()<r);){let t=u();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=d();if(!n)break;let r=c();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(x(`[bridge:repl:heartbeat] Failed: ${v(e)}`),e instanceof N){r.cleanup(),C(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),f?(f(e),x(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await k(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:s()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(C(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&x(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:b.non_exclusive_heartbeat_interval_ms;if(r>0){let e=c(),t=Date.now();await k(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(x(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),C(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),_=!0)}}else await k(b.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=Re(t.secret)}catch(n){x(`[bridge:repl] Failed to decode work secret: ${v(n)}`),C(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(y,t.id,!1).catch(()=>{});continue}x(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(y,t.id,a.session_ingress_token)}catch(e){x(`[bridge:repl] Acknowledge failed workId=${t.id}: ${v(e)}`)}if(t.data.type===`healthcheck`){x(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{I(e,`session_id`)}catch{x(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),x(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof N&&i.status===404&&a){let e=t().environmentId;if(y!==e){x(`[bridge:repl] Stale poll error for old env=${y}, current env=${e} — skipping onEnvironmentLost`),p=0,m=null;continue}if(g++,x(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${g}/3)`),C(`tengu_bridge_repl_env_lost`,{attempt:g}),g>3){x(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),l?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){p=0,m=null,r?.(`ready`),x(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),l?.();break}if(i instanceof N){let e=ie(i.errorType),t=V(i);x(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),C(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),w(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),l?.();break}let s=Date.now();h!==null&&s-h>6e4*2&&(x(`[bridge:repl] Detected system sleep (${Math.round((s-h)/1e3)}s gap), resetting poll error budget`),w(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:s-h}),p=0,m=null),h=s,p++,m===null&&(m=s);let c=s-m,f=G(i),_=Se(i),v=o?.()??`unknown`;if(x(`[bridge:repl] Poll error (attempt ${p}, elapsed ${Math.round(c/1e3)}s, ws=${v}): ${_}`),C(`tengu_bridge_repl_poll_error`,{status:f,consecutiveErrors:p,elapsedMs:c}),p===1&&r?.(`reconnecting`,_),c>=9e5){x(`[bridge:repl] Poll failures exceeded ${dt/1e3}s (${p} errors), giving up`),w(`info`,`bridge_repl_poll_give_up`),C(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:p,elapsedMs:c,lastStatus:f}),r?.(`failed`,`connection to server lost`);break}let ee=Math.min(lt*2**(p-1),ut);if(u().non_exclusive_heartbeat_interval_ms>0){let t=d?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await k(ee,n)}}x(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}S(),y(),q(),K();async function ht(t){let{onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,initialMessages:y,getMessages:ee,previouslyFlushedUUIDs:b,initialName:S,perpetual:te,outboundOnly:C,tags:w}=t??{};if(Y(De),!await Ee())return J(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!$())return J(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),g?.(`failed`,`/login`),null;if(await ce(),!j(`allow_remote_control`))return J(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),g?.(`failed`,`disabled by your organization's policy`),null;if(!Te()){let e=f();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&c()?.expiresAt===e.bridgeOauthDeadExpiresAt)return x(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await u();let t=c();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){J(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),g?.(`failed`,`/login`);let e=t.expiresAt;return l(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let T=Z(),E=`remote-control-${pe()}`,D=!1,O=!1;if(S)E=S,D=!0,O=!0;else{let e=i(),t=e?B(e):void 0;if(t)E=t,D=!0,O=!0;else if(y&&y.length>0)for(let e=y.length-1;e>=0;e--){let t=y[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||fe(t))continue;let n=se(t.message.content);if(!n)continue;let r=_t(n);if(r){E=r,D=!0;break}}}let k=0,A,ie=0,ae=(e,t,n)=>{D=!0,E=e,x(`[bridge:repl] derived title from message ${n}: ${e}`),Be(t,e,{baseUrl:T,getAccessToken:$}).catch(()=>{})},M=(e,t)=>{let n=++ie,r=k;Je(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===ie&&A===t&&!B(i())&&ae(e,t,r)})},N=(e,t)=>{if(O||B(i()))return!0;if(A!==void 0&&A!==t&&(k=0),A=t,k++,k===1&&!D){let n=_t(e);n&&ae(n,t,k),M(e,t)}else if(k===3){let n=ee?.();M(n?Xe(L(n)):e,t)}return k>=3},oe=_(`tengu_bridge_initial_history_cap`,200,300*1e3),P=Q()?`self-hosted`:await p();if(!P)return J(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),g?.(`failed`,`/login`),null;if(ke()&&!te){let e=await Ge();if(e)return J(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),g?.(`failed`,"run `claude update` to upgrade"),null;x(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:t}=await import(`./remoteBridgeCore-nz1fPY1U.js`);return t({baseUrl:T,orgUUID:P,title:E,getAccessToken:$,onAuth401:m,toSDKMessages:qe,initialHistoryCap:oe,initialMessages:y,onInboundMessage:n,onUserMessage:N,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,outboundOnly:C,tags:w})}let F=Ae();if(F)return J(`version_too_old`,`[bridge:repl] Skipping: ${F}`),g?.(`failed`,"run `claude update` to upgrade"),null;let I=await ne(),le=await re(),R=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||T,ue=`claude_code`;{let{isAssistantMode:t}=(je(),e(Me));t()&&(ue=`claude_code_assistant`)}return pt({dir:o(),machineName:st(),branch:I,gitRepoUrl:le,title:E,baseUrl:T,sessionIngressUrl:R,workerType:ue,getAccessToken:$,createSession:e=>He({...e,events:[],baseUrl:T,getAccessToken:$}),archiveSession:e=>Ue(e,{baseUrl:T,getAccessToken:$,timeoutMs:1500}).catch(e=>{x(`[bridge:repl] archiveBridgeSession threw: ${v(e)}`,{level:`error`})}),getCurrentTitle:()=>B(i())??E,onUserMessage:N,toSDKMessages:qe,onAuth401:m,getPollIntervalConfig:Fe,initialHistoryCap:oe,initialMessages:y,previouslyFlushedUUIDs:b,onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,perpetual:te})}var gt=50;function _t(e){let t=D(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>gt?n.slice(0,gt-1)+`…`:n}export{ht as initReplBridge};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./language-DcSjogBx.js";t();export{e as getResolvedLanguage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{Ct as s,cn as c}from"./state-sIHsFpDu.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{$_ as d,Q_ as f,X_ as p,Y_ as m,Z_ as h,cv as g,rv as _}from"./loadAgentsDir-Ci5mr0vm.js";import{a as v,r as y}from"./detectRepository-CBk3S2zv.js";import{join as b}from"node:path";import{existsSync as x}from"node:fs";import{randomUUID as S}from"node:crypto";function C(e){return D.indexOf(e)}function w({phase:e,target:t,sessionUrl:n,errorMessage:i}){let o=C(e),s=e===`error`;return(0,T.jsxs)(a,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(r,{bold:!0,children:`Autofix PR `}),(0,T.jsx)(r,{color:`claude`,children:t})]}),D.map((e,t)=>{let n=o>t,i=o===t&&!s;return(0,T.jsx)(a,{marginLeft:2,children:(0,T.jsxs)(r,{color:n?`success`:i?`warning`:`subtle`,children:[n?`✓`:i?`→`:`·`,` `,E[e]]})},e)}),s&&i&&(0,T.jsx)(a,{marginLeft:2,marginTop:1,children:(0,T.jsxs)(r,{color:`error`,children:[`✗ `,i]})}),n&&(0,T.jsxs)(a,{marginTop:1,marginLeft:2,children:[(0,T.jsx)(r,{color:`subtle`,children:`Track: `}),(0,T.jsx)(r,{color:`claude`,children:n})]})]})}var T,E,D,O=e((()=>{n(),i(),T=o(),E={detecting:`Detecting repository...`,checking_eligibility:`Checking remote agent eligibility...`,acquiring_lock:`Acquiring monitor lock...`,launching:`Launching remote session...`,registered:`Session registered`,done:`Autofix launched`,error:`Error`},D=[`detecting`,`checking_eligibility`,`acquiring_lock`,`launching`,`registered`,`done`]}));function k(e,t){return{agentId:S(),agentName:`autofix-pr`,teamName:`_autofix`,color:void 0,planModeRequired:!1,parentSessionId:s(),abortController:new AbortController,taskId:S()}}var A=e((()=>{c()}));function j(){return F}function M(e){return F?!1:(F=e,!0)}function N(e){F&&(e&&F.taskId!==e||(F.abortController.abort(),F=null))}function P(e,t,n){return F?.owner===e&&F?.repo===t&&F?.prNumber===n}var F,I=e((()=>{F=null}));function L(e){if(!/^[1-9]\d{0,9}$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function R(e){let t=e.trim();if(!t)return{action:`invalid`,reason:`empty`};if(t===`stop`||t===`off`)return{action:`stop`};let n=L(t);if(n!==null)return{action:`start`,prNumber:n};let r=t.match(/^([\w.-]+)\/([\w.-]+)#(\d+)$/);if(r){let e=L(r[3]);return e===null?{action:`invalid`,reason:`pr_number_out_of_range`}:{action:`start`,owner:r[1],repo:r[2],prNumber:e}}return{action:`freeform`,prompt:t}}var z=e((()=>{}));function B(e){return[`AUTOFIX.md`,`.claude/skills/autofix.md`,`.claude/skills/autofix-pr/SKILL.md`].filter(t=>x(b(e,t)))}function V(e){return e.length===0?``:` Run ${e.join(` and `)} for custom instructions on how to autofix.`}var H=e((()=>{}));function U(e,t){return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:t}),`Autofix PR failed: ${e}`}var W,G;e((()=>{W=t(n(),1),l(),f(),v(),_(),O(),A(),I(),z(),H(),G=async(e,t,n)=>{try{let r=R(n);if(r.action===`stop`){let t=j();return t?(N(),e(`Stopped local monitoring of ${t.repo}#${t.prNumber}. Any already-running remote session continues until it finishes or is cancelled from claude.ai/code.`,{display:`system`}),null):(e(`No active autofix monitor.`,{display:`system`}),null)}if(r.action===`invalid`)return e(`Invalid args: ${r.reason}. Use /autofix-pr <pr-number> | stop | <owner>/<repo>#<n>`,{display:`system`}),null;if(r.action===`freeform`)return e(`Freeform prompt mode not yet supported. Use /autofix-pr <pr-number>.`,{display:`system`}),null;u(`tengu_autofix_pr_started`,{action:`start`,has_pr_number:`true`,has_repo_path:String(!!(r.owner&&r.repo))});let i;try{i=await y()}catch{return e(U(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null}if(!i||i.host!==`github.com`)return e(U(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null;if(r.owner&&r.owner!==i.owner||r.repo&&r.repo!==i.name)return e(U(`Cross-repo autofix is not supported from this directory. Run from ${i.owner}/${i.name} or pass only the PR number.`,`repo_mismatch`),{display:`system`}),null;let a=i.owner,o=i.name,{prNumber:s}=r;if(P(a,o,s))return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Already monitoring ${o}#${s} in background.`,{display:`system`}),null;let c=await m({skipBundle:!0});if(!c.eligible){let t=c.errors.filter(e=>e.type!==`no_remote_environment`);if(t.length>0)return e(U(`Remote agent not available:\n${t.map(p).join(`
|
|
2
|
-
`)}`,`session_create_failed`),{display:`system`}),null}let l=V(B(process.cwd())),f=`${a}/${o}#${s}`,_=`refs/pull/${s}/head`,v=`Auto-fix failing CI checks on PR #${s} in ${a}/${o}.${l}`,b=k(v,f);if(!M({taskId:b.taskId,owner:a,repo:o,prNumber:s,abortController:b.abortController,startedAt:Date.now()})){let t=j();return e(U(`already monitoring ${t?.repo}#${t?.prNumber}. Run /autofix-pr stop first.`,`rc_already_monitoring_other`),{display:`system`}),null}let x,S=e=>{x=e},C=null;try{C=await g({initialMessage:v,source:`autofix_pr`,branchName:_,skipBundle:!0,title:`Autofix PR: ${f}`,useDefaultEnvironment:!0,signal:b.abortController.signal,githubPr:{owner:a,repo:o,number:s},onBundleFail:S,onCreateFail:S})}catch(t){return N(b.taskId),e(U(`teleport failed: ${t instanceof Error?t.message:String(t)}`,`teleport_failed`),{display:`system`}),null}if(!C)return N(b.taskId),e(U(x??`remote session creation failed.`,`session_create_failed`),{display:`system`}),null;try{d({remoteTaskType:`autofix-pr`,session:C,command:`/autofix-pr ${s}`,context:t,isLongRunning:!0,remoteTaskMetadata:{owner:a,repo:o,prNumber:s}})}catch(t){return N(b.taskId),e(U(`task registration failed: ${t instanceof Error?t.message:String(t)}`,`registration_failed`),{display:`system`}),null}let T=h(C.id);return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Autofix launched for ${f}. Track: ${T}`,{display:`system`}),W.createElement(w,{phase:`done`,target:f,sessionUrl:T})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:`exception`}),e(`Autofix PR failed: ${n}`,{display:`system`}),null}}}))();export{G as callAutofixPr};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e,t}from"./loadAgentsDir-Ci5mr0vm.js";e();export{t as clearAgentDefinitionsCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,o as n,t as r}from"./localSearch-Vpn6W5aY.js";n();export{r as clearSkillIndexCache,e as getSkillIndex,t as searchSkills};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./login-D9IWjvza.js";t();export{n as Login,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DT as e,ET as t,TT as n,wT as r}from"./loadAgentsDir-Ci5mr0vm.js";t();export{r as call,n as clearAuthRelatedCaches,e as performLogout};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Q as i,Rn as a,T as o,b as s,f as c,g as l,h as u,nt as d,t as f,tt as p,v as m,x as h}from"./src-Di342QoJ.js";import{t as g}from"./jsx-runtime-D-D469L8.js";import{Do as _,Po as v,jo as y}from"./paths-Q2255dD7.js";import{c as b,s as x}from"./debug-UI3T040K.js";import{Dx as S,GC as C,JS as w,MS as T,NS as E,RC as D,SC as ee,XC as O,YS as k,_C as A,cy as j,gC as M,gy as N,jS as P,my as te,qC as F,xC as I}from"./loadAgentsDir-Ci5mr0vm.js";import{D as ne,O as re}from"./rcDebugLog-BbPkkigY.js";import{t as ie}from"./useKeybinding-FsOnjW6T.js";import{i as ae,n as oe,r as se}from"./MCPConnectionManager-CDsa79pu.js";import{n as ce,t as le}from"./McpParsingWarnings-DZkzoeZf.js";import{a as ue,c as L,i as R,l as de,n as fe,o as z,r as pe,s as me,t as he,u as B}from"./PluginSettings-B2ASJ0Rx.js";function ge({agentServer:e,onCancel:t,onComplete:n}){let[a]=o(),[d,f]=(0,V.useState)(!1),[g,v]=(0,V.useState)(null),[y,b]=(0,V.useState)(null),x=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>x.current?.abort(),[]),p(`confirm:no`,(0,V.useCallback)(()=>{d&&(x.current?.abort(),x.current=null,f(!1),b(null))},[d]),{context:`Confirmation`,isActive:d});let C=(0,V.useCallback)(async()=>{if(!e.needsAuth||!e.url)return;f(!0),v(null);let t=new AbortController;x.current=t;try{let r={type:e.transport,url:e.url};await ee(e.name,r,b,t.signal),n?.(`Authentication successful for ${e.name}. The server will connect when the agent runs.`)}catch(e){e instanceof Error&&!(e instanceof M)&&v(e.message)}finally{f(!1),x.current=null}},[e,n]),T=_(String(e.name));if(d)return(0,H.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,H.jsxs)(s,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,H.jsxs)(h,{children:[(0,H.jsx)(te,{}),(0,H.jsx)(s,{children:` A browser window will open for authentication`})]}),y&&(0,H.jsxs)(h,{flexDirection:`column`,children:[(0,H.jsx)(s,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually:`}),(0,H.jsx)(i,{url:y})]}),(0,H.jsx)(h,{marginLeft:3,children:(0,H.jsxs)(s,{dimColor:!0,children:[`Return here after authenticating in your browser.`,` `,(0,H.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})})]});let E=[];return e.needsAuth&&E.push({label:e.isAuthenticated?`Re-authenticate`:`Authenticate`,value:`auth`}),E.push({label:`Back`,value:`back`}),(0,H.jsxs)(c,{title:`${T} MCP Server`,subtitle:`agent-only`,onCancel:t,inputGuide:e=>e.pending?(0,H.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):(0,H.jsxs)(u,{children:[(0,H.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,H.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:[(0,H.jsxs)(h,{flexDirection:`column`,gap:0,children:[(0,H.jsxs)(h,{children:[(0,H.jsx)(s,{bold:!0,children:`Type: `}),(0,H.jsx)(s,{dimColor:!0,children:e.transport})]}),e.url&&(0,H.jsxs)(h,{children:[(0,H.jsx)(s,{bold:!0,children:`URL: `}),(0,H.jsx)(s,{dimColor:!0,children:e.url})]}),e.command&&(0,H.jsxs)(h,{children:[(0,H.jsx)(s,{bold:!0,children:`Command: `}),(0,H.jsx)(s,{dimColor:!0,children:e.command})]}),(0,H.jsxs)(h,{children:[(0,H.jsx)(s,{bold:!0,children:`Used by: `}),(0,H.jsx)(s,{dimColor:!0,children:e.sourceAgents.join(`, `)})]}),(0,H.jsxs)(h,{marginTop:1,children:[(0,H.jsx)(s,{bold:!0,children:`Status: `}),(0,H.jsxs)(s,{children:[m(`inactive`,a)(r.radioOff),` not connected (agent-only)`]})]}),e.needsAuth&&(0,H.jsxs)(h,{children:[(0,H.jsx)(s,{bold:!0,children:`Auth: `}),e.isAuthenticated?(0,H.jsxs)(s,{children:[m(`success`,a)(r.tick),` authenticated`]}):(0,H.jsxs)(s,{children:[m(`warning`,a)(r.triangleUpOutline),` may need authentication`]})]})]}),(0,H.jsx)(h,{children:(0,H.jsx)(s,{dimColor:!0,children:`This server connects only when running the agent.`})}),g&&(0,H.jsx)(h,{children:(0,H.jsxs)(s,{color:`error`,children:[`Error: `,g]})}),(0,H.jsx)(h,{children:(0,H.jsx)(S,{options:E,onChange:async e=>{switch(e){case`auth`:await C();break;case`back`:t();break}},onCancel:t})})]})}var V,H,U=e((()=>{n(),V=t(a(),1),f(),ie(),I(),y(),k(),j(),N(),H=g()}));function W(e){switch(e){case`project`:return{label:`Project MCPs`,path:D(e)};case`user`:return{label:`User MCPs`,path:D(e)};case`local`:return{label:`Local MCPs`,path:D(e)};case`enterprise`:return{label:`Enterprise MCPs`};case`dynamic`:return{label:`Built-in MCPs`,path:`always available`};default:return{label:e}}}function _e(e){let t=new Map;for(let n of e){let e=n.scope;t.has(e)||t.set(e,[]),t.get(e).push(n)}for(let[,e]of t)e.sort((e,t)=>e.name.localeCompare(t.name));return t}function ve({servers:e,agentServers:t=[],onSelectServer:n,onSelectAgentServer:a,onComplete:f}){let[p]=o(),[g,_]=(0,G.useState)(0),y=G.useMemo(()=>_e(e.filter(e=>e.client.config.type!==`claudeai-proxy`)),[e]),x=G.useMemo(()=>e.filter(e=>e.client.config.type===`claudeai-proxy`).sort((e,t)=>e.name.localeCompare(t.name)),[e]),S=G.useMemo(()=>(y.get(`dynamic`)??[]).sort((e,t)=>e.name.localeCompare(t.name)),[y]),C=W(`dynamic`),T=G.useMemo(()=>{let e=[];for(let t of q){let n=y.get(t)??[];for(let t of n)e.push({type:`server`,server:t})}for(let t of x)e.push({type:`server`,server:t});for(let n of t)e.push({type:`agent-server`,agentServer:n});for(let t of S)e.push({type:`server`,server:t});return e},[y,x,t,S]),E=(0,G.useCallback)(()=>{f(`MCP dialog dismissed`,{display:`system`})},[f]);d({"confirm:previous":()=>_(e=>e===0?T.length-1:e-1),"confirm:next":()=>_(e=>e===T.length-1?0:e+1),"confirm:yes":(0,G.useCallback)(()=>{let e=T[g];e&&(e.type===`server`?n(e.server):e.type===`agent-server`&&a&&a(e.agentServer))},[T,g,n,a]),"confirm:no":E},{context:`Confirmation`});let D=e=>T.findIndex(t=>t.type===`server`&&t.server===e),ee=e=>T.findIndex(t=>t.type===`agent-server`&&t.agentServer===e),O=b(),k=e.some(e=>e.client.type===`failed`);if(e.length===0&&t.length===0)return null;let A=e=>{let t=D(e),n=g===t,i=``,a=``;if(e.client.type===`disabled`)i=m(`inactive`,p)(r.radioOff),a=`disabled`;else if(e.client.type===`connected`)i=m(`success`,p)(r.tick),a=`connected`;else if(e.client.type===`pending`){i=m(`inactive`,p)(r.radioOff);let{reconnectAttempt:t,maxReconnectAttempts:n}=e.client;a=t&&n?`reconnecting (${t}/${n})…`:`connecting…`}else e.client.type===`needs-auth`?(i=m(`warning`,p)(r.triangleUpOutline),a=`needs authentication`):(i=m(`error`,p)(r.cross),a=`failed`);return(0,K.jsxs)(h,{children:[(0,K.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,K.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,K.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,K.jsx)(s,{dimColor:!n,children:a})]},`${e.name}-${t}`)},j=e=>{let t=ee(e),n=g===t,i=e.needsAuth?m(`warning`,p)(r.triangleUpOutline):m(`inactive`,p)(r.radioOff),a=e.needsAuth?`may need auth`:`agent-only`;return(0,K.jsxs)(h,{children:[(0,K.jsx)(s,{color:n?`suggestion`:void 0,children:n?`${r.pointer} `:` `}),(0,K.jsx)(s,{color:n?`suggestion`:void 0,children:e.name}),(0,K.jsxs)(s,{dimColor:!n,children:[` · `,i,` `]}),(0,K.jsx)(s,{dimColor:!n,children:a})]},`agent-${e.name}-${t}`)},M=e.length+t.length;return(0,K.jsxs)(h,{flexDirection:`column`,children:[(0,K.jsx)(le,{}),(0,K.jsx)(c,{title:`Manage MCP servers`,subtitle:`${M} ${v(M,`server`)}`,onCancel:E,hideInputGuide:!0,children:(0,K.jsxs)(h,{flexDirection:`column`,children:[q.map(e=>{let t=y.get(e);if(!t||t.length===0)return null;let n=W(e);return(0,K.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsxs)(h,{paddingLeft:2,children:[(0,K.jsx)(s,{bold:!0,children:n.label}),n.path&&(0,K.jsxs)(s,{dimColor:!0,children:[` (`,n.path,`)`]})]}),t.map(e=>A(e))]},e)}),x.length>0&&(0,K.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsx)(h,{paddingLeft:2,children:(0,K.jsx)(s,{bold:!0,children:`claude.ai`})}),x.map(e=>A(e))]}),t.length>0&&(0,K.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsx)(h,{paddingLeft:2,children:(0,K.jsx)(s,{bold:!0,children:`Agent MCPs`})}),[...new Set(t.flatMap(e=>e.sourceAgents))].map(e=>(0,K.jsxs)(h,{flexDirection:`column`,marginTop:1,children:[(0,K.jsx)(h,{paddingLeft:2,children:(0,K.jsxs)(s,{dimColor:!0,children:[`@`,e]})}),t.filter(t=>t.sourceAgents.includes(e)).map(e=>j(e))]},e))]}),S.length>0&&(0,K.jsxs)(h,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsxs)(h,{paddingLeft:2,children:[(0,K.jsx)(s,{bold:!0,children:C.label}),C.path&&(0,K.jsxs)(s,{dimColor:!0,children:[` (`,C.path,`)`]})]}),S.map(e=>A(e))]}),(0,K.jsxs)(h,{flexDirection:`column`,children:[k&&(0,K.jsx)(s,{dimColor:!0,children:O?`※ Error logs shown inline with --debug`:`※ Run claude --debug to see error logs`}),(0,K.jsxs)(s,{dimColor:!0,children:[(0,K.jsx)(i,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`}),` for help`]})]})]})}),(0,K.jsx)(h,{paddingX:1,children:(0,K.jsx)(s,{dimColor:!0,italic:!0,children:(0,K.jsxs)(u,{children:[(0,K.jsx)(l,{shortcut:`↑↓`,action:`navigate`}),(0,K.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,K.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}var G,K,q,ye=e((()=>{n(),G=t(a(),1),f(),ie(),O(),x(),y(),k(),ce(),K=g(),q=[`project`,`local`,`user`,`enterprise`]}));function be({serverName:e,onComplete:t}){let[n]=o(),i=E(),a=se(),[c,l]=(0,J.useState)(!0),[u,d]=(0,J.useState)(null);return(0,J.useEffect)(()=>{async function n(){try{if(!i.getState().mcp.clients.find(t=>t.name===e)){d(`MCP server "${e}" not found`),l(!1),t(`MCP server "${e}" not found`);return}switch((await a(e)).client.type){case`connected`:l(!1),t(`Successfully reconnected to ${e}`);break;case`needs-auth`:d(`${e} requires authentication`),l(!1),t(`${e} requires authentication. Use /mcp to authenticate.`);break;case`pending`:case`failed`:case`disabled`:d(`Failed to reconnect to ${e}`),l(!1),t(`Failed to reconnect to ${e}`);break}}catch(e){let n=e instanceof Error?e.message:String(e);d(n),l(!1),t(`Error: ${n}`)}}n()},[e,a,i,t]),c?(0,Y.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,Y.jsxs)(s,{color:`text`,children:[`Reconnecting to `,(0,Y.jsx)(s,{bold:!0,children:e})]}),(0,Y.jsxs)(h,{children:[(0,Y.jsx)(te,{}),(0,Y.jsx)(s,{children:` Establishing connection to MCP server`})]})]}):u?(0,Y.jsxs)(h,{flexDirection:`column`,gap:1,padding:1,children:[(0,Y.jsxs)(h,{children:[(0,Y.jsxs)(s,{children:[m(`error`,n)(r.cross),` `]}),(0,Y.jsxs)(s,{color:`error`,children:[`Failed to reconnect to `,e]})]}),(0,Y.jsxs)(s,{dimColor:!0,children:[`Error: `,u]})]}):null}var J,Y,xe=e((()=>{n(),J=t(a(),1),f(),oe(),P(),N(),Y=g()}));function Se({onComplete:e}){let t=T(e=>e.mcp),n=T(e=>e.agentDefinitions),r=t.clients,[i,a]=X.useState({type:`list`}),[o,s]=X.useState([]),c=(0,X.useMemo)(()=>C(n.allAgents),[n.allAgents]),l=X.useMemo(()=>r.filter(e=>e.name!==`ide`).sort((e,t)=>e.name.localeCompare(t.name)),[r]);switch(X.useEffect(()=>{let e=!1;async function n(){let n=await Promise.all(l.map(async e=>{let n=e.config.scope,r=e.config.type===`sse`,i=e.config.type===`http`,a=e.config.type===`claudeai-proxy`,o;if(r||i){let n=await new A(e.name,e.config).tokens(),r=ne()!==null&&e.type===`connected`,i=e.type===`connected`&&F(t.tools,e.name).length>0;o=!!n||r||i}let s={name:e.name,client:e,scope:n};return a?{...s,transport:`claudeai-proxy`,isAuthenticated:!1,config:e.config}:r?{...s,transport:`sse`,isAuthenticated:o,config:e.config}:i?{...s,transport:`http`,isAuthenticated:o,config:e.config}:{...s,transport:`stdio`,config:e.config}}));e||s(n)}return n(),()=>{e=!0}},[l,t.tools]),(0,X.useEffect)(()=>{o.length===0&&l.length>0||o.length===0&&c.length===0&&e("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.")},[o.length,l.length,c.length,e]),i.type){case`list`:return(0,Z.jsx)(ve,{servers:o,agentServers:c,onSelectServer:e=>a({type:`server-menu`,server:e}),onSelectAgentServer:e=>a({type:`agent-server-menu`,agentServer:e}),onComplete:e,defaultTab:i.defaultTab});case`server-menu`:{let n=F(t.tools,i.server.name),r=i.server.transport===`claudeai-proxy`?`claude.ai`:`Claude Code`;return i.server.transport===`stdio`?(0,Z.jsx)(me,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e}):(0,Z.jsx)(de,{server:i.server,serverToolsCount:n.length,onViewTools:()=>a({type:`server-tools`,server:i.server}),onCancel:()=>a({type:`list`,defaultTab:r}),onComplete:e})}case`server-tools`:return(0,Z.jsx)(pe,{server:i.server,onSelectTool:(e,t)=>a({type:`server-tool-detail`,server:i.server,toolIndex:t}),onBack:()=>a({type:`server-menu`,server:i.server})});case`server-tool-detail`:{let e=F(t.tools,i.server.name)[i.toolIndex];return e?(0,Z.jsx)(ue,{tool:e,server:i.server,onBack:()=>a({type:`server-tools`,server:i.server})}):(a({type:`server-tools`,server:i.server}),null)}case`agent-server-menu`:return(0,Z.jsx)(ge,{agentServer:i.agentServer,onCancel:()=>a({type:`list`,defaultTab:`Agents`}),onComplete:e})}}var X,Z,Ce=e((()=>{X=t(a(),1),I(),O(),P(),re(),U(),ye(),B(),L(),z(),R(),Z=g()})),we=e((()=>{U(),ye(),xe(),B(),Ce(),L(),z(),R()}));function Te({action:e,target:t,onComplete:n}){let r=T(e=>e.mcp.clients),i=ae(),a=(0,Q.useRef)(!1);return(0,Q.useEffect)(()=>{if(a.current)return;a.current=!0;let o=e===`enable`,s=r.filter(e=>e.name!==`ide`),c=t===`all`?s.filter(e=>o?e.type===`disabled`:e.type!==`disabled`):s.filter(e=>e.name===t);if(c.length===0){n(t===`all`?`All MCP servers are already ${o?`enabled`:`disabled`}`:`MCP server "${t}" not found`);return}for(let e of c)i(e.name);n(t===`all`?`${o?`Enabled`:`Disabled`} ${c.length} MCP server(s)`:`MCP server "${t}" ${o?`enabled`:`disabled`}`)},[e,t,r,i,n]),null}async function Ee(e,t,n){if(n){let t=n.trim().split(/\s+/);if(t[0]===`no-redirect`)return(0,$.jsx)(Se,{onComplete:e});if(t[0]===`reconnect`&&t[1])return(0,$.jsx)(be,{serverName:t.slice(1).join(` `),onComplete:e});if(t[0]===`enable`||t[0]===`disable`)return(0,$.jsx)(Te,{action:t[0],target:t.length>1?t.slice(1).join(` `):`all`,onComplete:e})}return process.env.USER_TYPE===`ant`?(0,$.jsx)(he,{onComplete:e,args:`manage`,showMcpRedirectMessage:!0}):(0,$.jsx)(Se,{onComplete:e})}var Q,$;e((()=>{Q=t(a(),1),we(),xe(),oe(),P(),fe(),$=g()}))();export{Ee as call};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./p-map-D7WEmnBE.js";import{Mt as r,Rn as i,T as a,b as o,f as s,g as c,h as l,t as u,v as ee,x as te}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Nc as p,Po as m,Sc as h,bc as g,jo as ne}from"./paths-Q2255dD7.js";import{V as re,W as ie}from"./debug-UI3T040K.js";import{n as _,r as v}from"./analytics-DqMQntaB.js";import{n as y,o as ae}from"./process-DMKLUQIO.js";import{i as b,o as x}from"./platform-CuyedWpe.js";import{s as S,u as C}from"./types-Csi32ZXh.js";import{$C as w,AS as T,CC as E,Cx as D,GT as O,JS as k,RC as A,TC as j,XC as M,YC as N,YS as P,_x as F,ay as I,bC as L,iw as R,iy as z,jS as B,lw as V,ly as H,ow as U,pw as W,qT as G,sw as K,uy as q,vC as oe,xC as se,xx as ce,yC as le,zC as J}from"./loadAgentsDir-Ci5mr0vm.js";import{n as Y,t as X}from"./exit-_obETqBv.js";import{stat as ue}from"fs/promises";import{cwd as de}from"process";n();var Z=e(i(),1);G(),y(),u(),V(),ne(),P(),q();var Q=d();function fe({servers:e,scope:t,onDone:n}){let r=Object.keys(e),[i,u]=(0,Z.useState)({});(0,Z.useEffect)(()=>{R().then(({servers:e})=>u(e))},[]);let d=r.filter(e=>i[e]!==void 0);async function f(n){let r=0;for(let a of n){let n=e[a];if(n){let e=a;if(i[e]!==void 0){let t=1;for(;i[`${a}_${t}`]!==void 0;)t++;e=`${a}_${t}`}await w(e,n,t),r++}}h(r)}let[p]=a(),h=(0,Z.useCallback)(e=>{ae(e>0?`\n${ee(`success`,p)(`Successfully imported ${e} MCP ${m(e,`server`)} to ${t} config.`)}\n`:`
|
|
2
|
-
No servers were imported.`),n(),O()},[p,t,n]),g=(0,Z.useCallback)(()=>{h(0)},[h]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(s,{title:`Import MCP Servers from Claude Desktop`,subtitle:`Found ${r.length} MCP ${m(r.length,`server`)} in Claude Desktop.`,color:`success`,onCancel:g,hideInputGuide:!0,children:[d.length>0&&(0,Q.jsx)(o,{color:`warning`,children:`Note: Some servers already exist with the same name. If selected, they will be imported with a numbered suffix.`}),(0,Q.jsx)(o,{children:`Please select the servers you want to import:`}),(0,Q.jsx)(H,{options:r.map(e=>({label:`${e}${d.includes(e)?` (already exists)`:``}`,value:e})),defaultValue:r.filter(e=>!d.includes(e)),onSubmit:f,onCancel:g,hideIndexes:!0})]}),(0,Q.jsx)(te,{paddingX:1,children:(0,Q.jsx)(o,{dimColor:!0,italic:!0,children:(0,Q.jsxs)(l,{children:[(0,Q.jsx)(c,{shortcut:`Space`,action:`select`}),(0,Q.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Q.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}u(),I(),_(),se(),D(),V(),M(),B(),f(),re(),G(),S(),x();async function $(e,t){try{let n=await F(e,t);return n.type===`connected`?`✓ Connected`:n.type===`needs-auth`?`! Needs authentication`:`✗ Failed to connect`}catch{return`✗ Connection error`}}async function pe({debug:e,verbose:t}){let n=de();v(`tengu_mcp_start`,{});try{await ue(n)}catch(e){throw ie(e)&&X(`Error: Directory ${n} does not exist`),e}try{let{setup:r}=await import(`./setup-TqJ7-Nxh.js`);await r(n,`default`,!1,!1,void 0,!1);let{startMCPServer:i}=await import(`./mcp-DlM0OC6R.js`);await i(n,e??!1,t??!1)}catch(e){X(`Error: Failed to start MCP server: ${e}`)}}async function me(e,t){let n=U(e),r=()=>{n&&(n.type===`sse`||n.type===`http`)&&(le(e,n),oe(e,n))};try{if(t.scope){let n=J(t.scope);v(`tengu_mcp_delete`,{name:e,scope:n}),await W(e,n),r(),process.stdout.write(`Removed MCP server ${e} from ${n} config\n`),Y(`File modified: ${A(n)}`)}let n=g(),i=h(),{servers:a}=K(`project`),o=!!a[e],s=[];if(n.mcpServers?.[e]&&s.push(`local`),o&&s.push(`project`),i.mcpServers?.[e]&&s.push(`user`),s.length===0)X(`No MCP server found with name: "${e}"`);else if(s.length===1){let t=s[0];v(`tengu_mcp_delete`,{name:e,scope:t}),await W(e,t),r(),process.stdout.write(`Removed MCP server "${e}" from ${t} config\n`),Y(`File modified: ${A(t)}`)}else process.stderr.write(`MCP server "${e}" exists in multiple scopes:\n`),s.forEach(e=>{process.stderr.write(` - ${N(e)} (${A(e)})\n`)}),process.stderr.write(`
|
|
3
|
-
To remove from a specific scope, use:
|
|
4
|
-
`),s.forEach(t=>{process.stderr.write(` claude mcp remove "${e}" -s ${t}\n`)}),X()}catch(e){X(e.message)}}async function he(){v(`tengu_mcp_list`,{});let{servers:e}=await R();if(Object.keys(e).length===0)console.log("No MCP servers configured. Use `claude mcp add` to add a server.");else{console.log(`Checking MCP server health...
|
|
5
|
-
`);let n=await t(Object.entries(e),async([e,t])=>({name:e,server:t,status:await $(e,t)}),{concurrency:ce()});for(let{name:e,server:t,status:r}of n)if(t.type===`sse`)console.log(`${e}: ${t.url} (SSE) - ${r}`);else if(t.type===`http`)console.log(`${e}: ${t.url} (HTTP) - ${r}`);else if(t.type===`claudeai-proxy`)console.log(`${e}: ${t.url} - ${r}`);else if(!t.type||t.type===`stdio`){let n=t,i=Array.isArray(n.args)?n.args:[];console.log(`${e}: ${n.command} ${i.join(` `)} - ${r}`)}}await O(0)}async function ge(e){v(`tengu_mcp_get`,{name:e});let t=U(e);t||X(`No MCP server found with name: ${e}`),console.log(`${e}:`),console.log(` Scope: ${N(t.scope)}`);let n=await $(e,t);if(console.log(` Status: ${n}`),t.type===`sse`){if(console.log(` Type: sse`),console.log(` URL: ${t.url}`),t.headers){console.log(` Headers:`);for(let[e,n]of Object.entries(t.headers))console.log(` ${e}: ${n}`)}if(t.oauth?.clientId||t.oauth?.callbackPort){let n=[];t.oauth.clientId&&(n.push(`client_id configured`),L(e,t)?.clientSecret&&n.push(`client_secret configured`)),t.oauth.callbackPort&&n.push(`callback_port ${t.oauth.callbackPort}`),console.log(` OAuth: ${n.join(`, `)}`)}}else if(t.type===`http`){if(console.log(` Type: http`),console.log(` URL: ${t.url}`),t.headers){console.log(` Headers:`);for(let[e,n]of Object.entries(t.headers))console.log(` ${e}: ${n}`)}if(t.oauth?.clientId||t.oauth?.callbackPort){let n=[];t.oauth.clientId&&(n.push(`client_id configured`),L(e,t)?.clientSecret&&n.push(`client_secret configured`)),t.oauth.callbackPort&&n.push(`callback_port ${t.oauth.callbackPort}`),console.log(` OAuth: ${n.join(`, `)}`)}}else if(t.type===`stdio`){console.log(` Type: stdio`),console.log(` Command: ${t.command}`);let e=Array.isArray(t.args)?t.args:[];if(console.log(` Args: ${e.join(` `)}`),t.env){console.log(` Environment:`);for(let[e,n]of Object.entries(t.env))console.log(` ${e}=${n}`)}}console.log(`\nTo remove this server, run: claude mcp remove "${e}" -s ${t.scope}`),await O(0)}async function _e(e,t,n){try{let r=J(n.scope),i=C(t),a=n.clientSecret&&i&&typeof i==`object`&&`type`in i&&(i.type===`sse`||i.type===`http`)&&`url`in i&&typeof i.url==`string`&&`oauth`in i&&i.oauth&&typeof i.oauth==`object`&&`clientId`in i.oauth?await E():void 0;await w(e,i,r);let o=i&&typeof i==`object`&&`type`in i?String(i.type||`stdio`):`stdio`;a&&i&&typeof i==`object`&&`type`in i&&(i.type===`sse`||i.type===`http`)&&`url`in i&&typeof i.url==`string`&&j(e,{type:i.type,url:i.url},a),v(`tengu_mcp_add`,{scope:r,source:`json`,type:o}),Y(`Added ${o} MCP server ${e} to ${r} config`)}catch(e){X(e.message)}}async function ve(e){try{let t=J(e.scope);v(`tengu_mcp_add`,{scope:t,platform:b(),source:`desktop`});let{readClaudeDesktopMcpServers:n}=await import(`./claudeDesktop-D0S1eq1F.js`),i=await n();Object.keys(i).length===0&&Y(`No MCP servers found in Claude Desktop configuration or configuration file does not exist.`);let{unmount:a}=await r((0,Q.jsx)(T,{children:(0,Q.jsx)(z,{children:(0,Q.jsx)(fe,{servers:i,scope:t,onDone:()=>{a()}})})}),{exitOnCtrlC:!0})}catch(e){X(e.message)}}async function ye(){v(`tengu_mcp_reset_mcpjson_choices`,{}),p(e=>({...e,enabledMcpjsonServers:[],disabledMcpjsonServers:[],enableAllProjectMcpServers:!1})),Y(`All project-scoped (.mcp.json) server approvals and rejections have been reset.
|
|
6
|
-
You will be prompted for approval next time you start Claude Code.`)}export{ve as mcpAddFromDesktopHandler,_e as mcpAddJsonHandler,ge as mcpGetHandler,he as mcpListHandler,me as mcpRemoveHandler,ye as mcpResetChoicesHandler,pe as mcpServeHandler};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{B as e,M as t,d as n,n as r,t as i}from"./server-DzOdtq8A.js";import{Dr as a,Pr as o}from"./paths-Q2255dD7.js";import{E as s,w as c}from"./debug-UI3T040K.js";import{o as l,s as u}from"./log-CzsijfHZ.js";import{CD as d,G as f,HE as p,Hm as m,K as h,Ku as g,Lo as _,Na as v,Pa as y,SD as b,UE as x,Um as S,lo as C,nl as w,ou as T,qu as E,su as D,tl as O}from"./loadAgentsDir-Ci5mr0vm.js";import{Bn as k,Vn as A,zn as j}from"./prompt-DEPUnJdB.js";import{a as M,o as N}from"./fileStateCache-C7-TxF8G.js";import{n as P,t as F}from"./stdio-BEEzuxaZ.js";r(),P(),e(),x(),v(),A(),E(),d(),N(),l(),_(),o(),h(),m(),c(),D(),O();var I=[y];async function L(e,r,o){let c=M(100);S(e);let l=new i({name:`claude/tengu`,version:`2.6.0`},{capabilities:{tools:{}}});l.setRequestHandler(t,async()=>{let e=k(),t=g(e);return{tools:await Promise.all(t.map(async n=>{let r;if(n.outputSchema){let e=w(n.outputSchema);typeof e==`object`&&e&&`type`in e&&e.type===`object`&&(r=e)}return{...n,description:await n.prompt({getToolPermissionContext:async()=>e,tools:t,agents:[]}),inputSchema:w(n.inputSchema),outputSchema:r}}))}}),l.setRequestHandler(n,async({params:{name:e,arguments:t}})=>{let n=g(k()),i=j(n,e);if(!i)throw Error(`Tool ${e} not found`);let l={abortController:b(),options:{commands:I,tools:n,mainLoopModel:a(),thinkingConfig:{type:`disabled`},mcpClients:[],mcpResources:{},isNonInteractiveSession:!0,debug:r,verbose:o,agentDefinitions:{activeAgents:[],allAgents:[]}},getAppState:()=>p(),setAppState:()=>{},messages:[],readFileState:c,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}};try{if(!i.isEnabled())throw Error(`Tool ${e} is not enabled`);let n=await i.validateInput?.(t??{},l);if(n&&!n.result)throw Error(`Tool ${e} input is invalid: ${n.message}`);let r=await i.call(t??{},l,f,C({content:[]}));return{content:[{type:`text`,text:typeof r==`string`?r:s(r.data)}]}}catch(e){return u(e),{isError:!0,content:[{type:`text`,text:(e instanceof Error?T(e):[String(e)]).filter(Boolean).join(`
|
|
2
|
-
`).trim()||`Error`}]}}});async function d(){let e=new F;await l.connect(e)}return await d()}export{L as startMCPServer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Dr as e,Pr as t}from"./paths-Q2255dD7.js";t();export{e as getMainLoopModel};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,In as a,J as o,Ln as s,Rn as c,Ut as l,_ as u,a as d,b as f,f as p,i as m,n as h,o as g,p as ee,r as te,t as _,tt as ne,x as v,xt as y}from"./src-Di342QoJ.js";import{t as b}from"./jsx-runtime-D-D469L8.js";import{cn as re,ot as x}from"./state-sIHsFpDu.js";import{Bo as S,Po as C,Ro as w,Vo as T,Xa as E,Xs as D,jo as O,nc as k,oo as A}from"./paths-Q2255dD7.js";import{E as j,w as M}from"./debug-UI3T040K.js";import{Dx as N,H as ie,K as ae,Lo as P,Lw as oe,MS as se,Nx as ce,Ox as F,PS as le,Px as I,U as ue,V as de,W as fe,aD as pe,eD as me,hp as L,hu as R,iA as he,iD as z,jS as ge,mo as _e,mp as ve,mu as B,q as ye,tA as V}from"./loadAgentsDir-Ci5mr0vm.js";import{t as be}from"./useKeybinding-FsOnjW6T.js";import{l as xe,u as Se}from"./referral-ByevBJrE.js";import{n as Ce,t as we}from"./AddWorkspaceDirectory-Cj5bvJgD.js";import{t as Te}from"./SearchBox-DfOmUoaI.js";import{n as Ee,t as De}from"./useSearchInput-B-V4kIa-.js";import{n as H,t as Oe}from"./shadowedRuleDetection-DesT0yKM.js";import{n as ke,t as Ae}from"./autoModeDenials-Cp6VFdsm.js";function je({ruleValue:e}){switch(e.toolName){case B.name:return e.ruleContent?e.ruleContent.endsWith(`:*`)?(0,U.jsxs)(f,{dimColor:!0,children:[`Any Bash command starting with `,(0,U.jsx)(f,{bold:!0,children:e.ruleContent.slice(0,-2)})]}):(0,U.jsxs)(f,{dimColor:!0,children:[`The Bash command `,(0,U.jsx)(f,{bold:!0,children:e.ruleContent})]}):(0,U.jsx)(f,{dimColor:!0,children:`Any Bash command`});default:return e.ruleContent?null:(0,U.jsxs)(f,{dimColor:!0,children:[`Any use of the `,(0,U.jsx)(f,{bold:!0,children:e.toolName}),` tool`]})}}var U,Me=e((()=>{c(),_(),R(),U=b()}));function Ne(e){switch(e){case`localSettings`:return{label:`Project settings (local)`,description:`Saved in ${E(`localSettings`)}`,value:e};case`projectSettings`:return{label:`Project settings`,description:`Checked in at ${E(`projectSettings`)}`,value:e};case`userSettings`:return{label:`User settings`,description:`Saved in at ~/.claude/settings.json`,value:e}}}function Pe({onAddRules:e,onCancel:t,ruleValues:n,ruleBehavior:r,initialContext:i,setToolPermissionContext:a}){let o=D.map(Ne),s=(0,Fe.useCallback)(o=>{if(o===`cancel`){t();return}else if(D.includes(o)){let t=o,s=me(i,{type:`addRules`,rules:n,behavior:r,destination:t});pe({type:`addRules`,rules:n,behavior:r,destination:t}),a(s);let c=n.map(e=>({ruleValue:e,ruleBehavior:r,source:t})),l=Oe(s,{sandboxAutoAllowEnabled:V.isSandboxingEnabled()&&V.isAutoAllowBashIfSandboxedEnabled()}).filter(e=>n.some(t=>t.toolName===e.rule.ruleValue.toolName&&t.ruleContent===e.rule.ruleValue.ruleContent));e(c,l.length>0?l:void 0)}},[e,t,n,r,i,a]);return(0,W.jsxs)(p,{title:`Add ${r} permission ${C(n.length,`rule`)}`,onCancel:t,color:`permission`,children:[(0,W.jsx)(v,{flexDirection:`column`,paddingX:2,children:n.map(e=>(0,W.jsxs)(v,{flexDirection:`column`,children:[(0,W.jsx)(f,{bold:!0,children:T(e)}),(0,W.jsx)(je,{ruleValue:e})]},T(e)))}),(0,W.jsxs)(v,{flexDirection:`column`,marginY:1,children:[(0,W.jsx)(f,{children:n.length===1?`Where should this rule be saved?`:`Where should these rules be saved?`}),(0,W.jsx)(N,{options:o,onChange:s})]})]})}var Fe,W,Ie=e((()=>{c(),Fe=t(c(),1),F(),_(),z(),w(),H(),he(),k(),A(),O(),Me(),W=b()}));function Le({onCancel:e,onSubmit:t,ruleBehavior:n}){let[a,s]=(0,Re.useState)(``),[c,l]=(0,Re.useState)(0),u=Se();ne(`confirm:no`,e,{context:`Settings`});let{columns:d}=i(),p=d-6;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(v,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,G.jsxs)(f,{bold:!0,color:`permission`,children:[`Add `,n,` permission rule`]}),(0,G.jsxs)(v,{flexDirection:`column`,children:[(0,G.jsxs)(f,{children:[`Permission rules are a tool name, optionally followed by a specifier in parentheses.`,(0,G.jsx)(o,{}),`e.g., `,(0,G.jsx)(f,{bold:!0,children:T({toolName:ve.name})}),(0,G.jsx)(f,{bold:!1,children:` or `}),(0,G.jsx)(f,{bold:!0,children:T({toolName:B.name,ruleContent:`ls:*`})})]}),(0,G.jsx)(v,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,G.jsx)(ce,{showCursor:!0,value:a,onChange:s,onSubmit:e=>{let r=e.trim();r.length!==0&&t(S(r),n)},placeholder:`Enter permission rule${r.ellipsis}`,columns:p,cursorOffset:c,onChangeCursorOffset:l})})]})]}),(0,G.jsx)(v,{marginLeft:3,children:u.pending?(0,G.jsxs)(f,{dimColor:!0,children:[`Press `,u.keyName,` again to exit`]}):(0,G.jsx)(f,{dimColor:!0,children:`Enter to submit · Esc to cancel`})})]})}var Re,G,ze=e((()=>{n(),c(),Re=t(c(),1),I(),xe(),oe(),_(),be(),R(),L(),w(),G=b()}));function Be({onHeaderFocusChange:e,onStateChange:t}){let{headerFocused:n,focusHeader:r}=m();(0,K.useEffect)(()=>{e?.(n)},[n,e]);let[i]=(0,K.useState)(()=>Ae()),[a,o]=(0,K.useState)(()=>new Set),[s,c]=(0,K.useState)(()=>new Set),[l,u]=(0,K.useState)(0);(0,K.useEffect)(()=>{t({approved:a,retry:s,denials:i})},[a,s,i,t]);let d=(0,K.useCallback)(e=>{let t=Number(e);o(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),p=(0,K.useCallback)(e=>{u(Number(e))},[]);if(y((e,t)=>{e===`r`&&(c(e=>{let t=new Set(e);return t.has(l)?t.delete(l):t.add(l),t}),o(e=>{if(e.has(l))return e;let t=new Set(e);return t.add(l),t}))},{isActive:i.length>0}),i.length===0)return(0,q.jsx)(f,{dimColor:!0,children:`No recent denials. Commands denied by the auto mode classifier will appear here.`});let h=i.map((e,t)=>{let n=a.has(t),r=s.has(t)?` (retry)`:``;return{label:(0,q.jsxs)(f,{children:[(0,q.jsx)(g,{status:n?`success`:`error`,withSpace:!0}),e.display,(0,q.jsx)(f,{dimColor:!0,children:r})]}),value:String(t)}});return(0,q.jsxs)(v,{flexDirection:`column`,children:[(0,q.jsx)(f,{children:`Commands recently denied by the auto mode classifier.`}),(0,q.jsx)(v,{marginTop:1,children:(0,q.jsx)(N,{options:h,onChange:d,onFocus:p,visibleOptionCount:Math.min(10,h.length),isDisabled:n,onUpFromFirstItem:r})})]})}var K,q,Ve=e((()=>{c(),K=t(c(),1),_(),ke(),F(),q=b()}));function He({directoryPath:e,onRemove:t,onCancel:n,permissionContext:r,setPermissionContext:i}){let a=(0,J.useCallback)(()=>{i(me(r,{type:`removeDirectories`,directories:[e],destination:`session`})),t()},[e,r,i,t]),o=(0,J.useCallback)(e=>{e===`yes`?a():n()},[a,n]);return(0,Y.jsxs)(p,{title:`Remove directory from workspace?`,onCancel:n,color:`error`,children:[(0,Y.jsx)(v,{marginX:2,flexDirection:`column`,children:(0,Y.jsx)(f,{bold:!0,children:e})}),(0,Y.jsx)(f,{children:`Claude Code will no longer have access to files in this directory.`}),(0,Y.jsx)(N,{onChange:o,onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]})}var J,Y,Ue=e((()=>{c(),J=t(c(),1),F(),_(),z(),Y=b()}));function We({onExit:e,toolPermissionContext:t,onRequestAddDirectory:n,onRequestRemoveDirectory:i,onHeaderFocusChange:a}){let{headerFocused:o,focusHeader:s}=m();(0,X.useEffect)(()=>{a?.(o)},[o,a]);let c=Ge.useMemo(()=>Array.from(t.additionalWorkingDirectories.keys()).map(e=>({path:e,isCurrent:!1,isDeletable:!0})),[t.additionalWorkingDirectories]),l=(0,X.useCallback)(e=>{if(e===`add-directory`){n();return}let t=c.find(t=>t.path===e);t&&t.isDeletable&&i(t.path)},[c,n,i]),u=(0,X.useCallback)(()=>e(`Workspace dialog dismissed`,{display:`system`}),[e]),d=Ge.useMemo(()=>{let e=c.map(e=>({label:e.path,value:e.path}));return e.push({label:`Add directory${r.ellipsis}`,value:`add-directory`}),e},[c]);return(0,Z.jsxs)(v,{flexDirection:`column`,marginBottom:1,children:[(0,Z.jsxs)(v,{flexDirection:`row`,marginTop:1,marginLeft:2,gap:1,children:[(0,Z.jsx)(f,{children:`- ${x()}`}),(0,Z.jsx)(f,{dimColor:!0,children:`(Original working directory)`})]}),(0,Z.jsx)(N,{options:d,onChange:l,onCancel:u,visibleOptionCount:Math.min(10,d.length),onUpFromFirstItem:s,isDisabled:o})]})}var Ge,X,Z,Ke=e((()=>{n(),Ge=t(c(),1),X=t(c(),1),re(),F(),_(),Z=b()}));function qe({rule:e}){return(0,$.jsx)(f,{dimColor:!0,children:`From ${ye(e.source)}`})}function Je(e){switch(e){case`allow`:return`allowed`;case`deny`:return`denied`;case`ask`:return`ask`}}function Ye({rule:e,onDelete:t,onCancel:n}){let r=Se();ne(`confirm:no`,n,{context:`Confirmation`});let i=(0,$.jsxs)(v,{flexDirection:`column`,marginX:2,children:[(0,$.jsx)(f,{bold:!0,children:T(e.ruleValue)}),(0,$.jsx)(je,{ruleValue:e.ruleValue}),(0,$.jsx)(qe,{rule:e})]}),a=(0,$.jsx)(v,{marginLeft:3,children:r.pending?(0,$.jsxs)(f,{dimColor:!0,children:[`Press `,r.keyName,` again to exit`]}):(0,$.jsx)(f,{dimColor:!0,children:`Esc to cancel`})});return e.source===`policySettings`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(v,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`permission`,children:[(0,$.jsx)(f,{bold:!0,color:`permission`,children:`Rule details`}),i,(0,$.jsxs)(f,{italic:!0,children:[`This rule is configured by managed settings and cannot be modified.`,`
|
|
2
|
-
`,`Contact your system administrator for more information.`]})]}),a]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(v,{flexDirection:`column`,gap:1,borderStyle:`round`,paddingLeft:1,paddingRight:1,borderColor:`error`,children:[(0,$.jsxs)(f,{bold:!0,color:`error`,children:[`Delete `,Je(e.ruleBehavior),` tool?`]}),i,(0,$.jsx)(f,{children:`Are you sure you want to delete this permission rule?`}),(0,$.jsx)(N,{onChange:e=>e===`yes`?t():n(),onCancel:n,options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}]})]}),a]})}function Xe(e){let{options:t,searchQuery:n,isSearchMode:r,isFocused:i,onSelect:a,onCancel:o,lastFocusedRuleKey:s,cursorOffset:c,onHeaderFocusChange:l}=e,f=d(),{headerFocused:p,focusHeader:h,blurHeader:g}=m();return(0,Q.useEffect)(()=>{r&&p&&g()},[r,p,g]),(0,Q.useEffect)(()=>{l?.(p)},[p,l]),(0,$.jsxs)(v,{flexDirection:`column`,children:[(0,$.jsx)(v,{marginBottom:1,flexDirection:`column`,children:(0,$.jsx)(u,{query:n,isFocused:r&&!p,isTerminalFocused:i,width:f,cursorOffset:c})}),(0,$.jsx)(N,{options:t,onChange:a,onCancel:o,visibleOptionCount:Math.min(10,t.length),isDisabled:r||p,defaultFocusValue:s,onUpFromFirstItem:h})]})}function Ze({tab:e,getRulesOptions:t,handleToolSelect:n,...r}){return(0,$.jsxs)(v,{flexDirection:`column`,flexShrink:e===`allow`?0:void 0,children:[(0,$.jsx)(f,{children:{allow:`Claude Code won't ask before using allowed tools.`,ask:`Claude Code will always ask for confirmation before using these tools.`,deny:`Claude Code will always reject requests to use denied tools.`}[e]}),(0,$.jsx)(Xe,{options:t(e,r.searchQuery).options,onSelect:t=>n(t,e),...r})]})}function Qe({onExit:e,initialTab:t,onRetryDenials:n}){let i=Ae().length>0,o=t??(i?`recent`:`allow`),[s,c]=(0,Q.useState)([]),u=se(e=>e.toolPermissionContext),d=le(),p=l(),m=(0,Q.useRef)({approved:new Set,retry:new Set,denials:[]}),g=(0,Q.useCallback)(e=>{m.current=e},[]),[_,y]=(0,Q.useState)(),[b,re]=(0,Q.useState)(),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(null),[A,M]=(0,Q.useState)(!1),[N,ae]=(0,Q.useState)(!0),P=(0,Q.useCallback)(e=>{ae(e)},[]),oe=(0,Q.useMemo)(()=>{let e=new Map;return ie(u).forEach(t=>{e.set(j(t),t)}),e},[u]),ce=(0,Q.useMemo)(()=>{let e=new Map;return fe(u).forEach(t=>{e.set(j(t),t)}),e},[u]),F=(0,Q.useMemo)(()=>{let e=new Map;return ue(u).forEach(t=>{e.set(j(t),t)}),e},[u]),I=(0,Q.useCallback)((e,t=``)=>{let n=(()=>{switch(e){case`allow`:return oe;case`deny`:return ce;case`ask`:return F;case`workspace`:case`recent`:return new Map}})(),i=[];e!==`workspace`&&e!==`recent`&&!t&&i.push({label:`Add a new rule${r.ellipsis}`,value:`add-new-rule`});let a=Array.from(n.keys()).sort((e,t)=>{let r=n.get(e),i=n.get(t);if(r&&i){let e=T(r.ruleValue).toLowerCase(),t=T(i.ruleValue).toLowerCase();return e.localeCompare(t)}return 0}),o=t.toLowerCase();for(let e of a){let r=n.get(e);if(r){let n=T(r.ruleValue);if(t&&!n.toLowerCase().includes(o))continue;i.push({label:n,value:e})}}return{options:i,rulesByKey:n}},[oe,ce,F]),L=Se(),R=!_&&!x&&!C&&!E&&!O,{query:he,setQuery:z,cursorOffset:ge}=Ee({isActive:R&&A,onExit:()=>{M(!1)}}),_e=(0,Q.useCallback)(e=>{R&&(A||e.ctrl||e.meta||(e.key===`/`?(e.preventDefault(),M(!0),z(``)):e.key.length===1&&e.key!==`j`&&e.key!==`k`&&e.key!==`m`&&e.key!==`i`&&e.key!==`r`&&e.key!==` `&&(e.preventDefault(),M(!0),z(e.key))))},[R,A,z]),ve=(0,Q.useCallback)((e,t)=>{let{rulesByKey:n}=I(t);if(e===`add-new-rule`){S(t);return}else{y(n.get(e));return}},[I]),B=(0,Q.useCallback)(()=>{S(null)},[]),ye=(0,Q.useCallback)((e,t)=>{w({ruleValue:e,ruleBehavior:t}),S(null)},[]),V=(0,Q.useCallback)((e,t)=>{w(null);for(let t of e)c(e=>[...e,`Added ${t.ruleBehavior} rule ${a.bold(T(t.ruleValue))}`]);if(t&&t.length>0)for(let e of t){let t=e.shadowType===`deny`?`blocked`:`shadowed`;c(n=>[...n,a.yellow(`${r.warning} Warning: ${T(e.rule.ruleValue)} is ${t}`),a.dim(` ${e.reason}`),a.dim(` Fix: ${e.fix}`)])}},[]),be=(0,Q.useCallback)(()=>{w(null)},[]),xe=(0,Q.useCallback)(()=>D(!0),[]),Ce=(0,Q.useCallback)(e=>k(e),[]),Te=(0,Q.useCallback)(()=>{let t=m.current,r=e=>Array.from(e).map(e=>t.denials[e]).filter(e=>e!==void 0),i=r(t.retry);if(i.length>0){let t=i.map(e=>e.display);n?.(t),e(void 0,{shouldQuery:!0,metaMessages:[`Permission granted for: ${t.join(`, `)}. You may now retry ${t.length===1?`this command`:`these commands`} if you would like.`]});return}let o=r(t.approved);o.length>0||s.length>0?e([...o.length>0?[`Approved ${o.map(e=>a.bold(e.display)).join(`, `)}`]:[],...s].join(`
|
|
3
|
-
`)):e(`Permissions dialog dismissed`,{display:`system`})},[s,e,n]);ne(`confirm:no`,Te,{context:`Settings`,isActive:R&&!A});let De=()=>{if(!_)return;let{options:e}=I(_.ruleBehavior),t=j(_),n=e.filter(e=>e.value!==`add-new-rule`).map(e=>e.value),r=n.indexOf(t),i;r!==-1&&(r<n.length-1?i=n[r+1]:r>0&&(i=n[r-1])),re(i),de({rule:_,initialContext:u,setToolPermissionContext(e){d(t=>({...t,toolPermissionContext:e}))}}),c(e=>[...e,`Deleted ${_.ruleBehavior} rule ${a.bold(T(_.ruleValue))}`]),y(void 0)};if(_)return(0,$.jsx)(Ye,{rule:_,onDelete:De,onCancel:()=>y(void 0)});if(x&&x!==`workspace`&&x!==`recent`)return(0,$.jsx)(Le,{onCancel:B,onSubmit:ye,ruleBehavior:x});if(C)return(0,$.jsx)(Pe,{onAddRules:V,onCancel:be,ruleValues:[C.ruleValue],ruleBehavior:C.ruleBehavior,initialContext:u,setToolPermissionContext:e=>{d(t=>({...t,toolPermissionContext:e}))}});if(E)return(0,$.jsx)(we,{onAddDirectory:(e,t)=>{let n={type:`addDirectories`,directories:[e],destination:t?`localSettings`:`session`},r=me(u,n);d(e=>({...e,toolPermissionContext:r})),t&&pe(n),c(n=>[...n,`Added directory ${a.bold(e)} to workspace${t?` and saved to local settings`:` for this session`}`]),D(!1)},onCancel:()=>D(!1),permissionContext:u});if(O)return(0,$.jsx)(He,{directoryPath:O,onRemove:()=>{c(e=>[...e,`Removed directory ${a.bold(O)} from workspace`]),k(null)},onCancel:()=>k(null),permissionContext:u,setPermissionContext:e=>{d(t=>({...t,toolPermissionContext:e}))}});let H={searchQuery:he,isSearchMode:A,isFocused:p,onCancel:Te,lastFocusedRuleKey:b,cursorOffset:ge,getRulesOptions:I,handleToolSelect:ve,onHeaderFocusChange:P};return(0,$.jsx)(v,{flexDirection:`column`,onKeyDown:_e,children:(0,$.jsxs)(ee,{color:`permission`,children:[(0,$.jsxs)(te,{title:`Permissions:`,color:`permission`,defaultTab:o,hidden:!!_||!!x||!!C||E||!!O,initialHeaderFocused:!i,navFromContent:!A,children:[(0,$.jsx)(h,{id:`recent`,title:`Recently denied`,children:(0,$.jsx)(Be,{onHeaderFocusChange:P,onStateChange:g})}),(0,$.jsx)(h,{id:`allow`,title:`Allow`,children:(0,$.jsx)(Ze,{tab:`allow`,...H})}),(0,$.jsx)(h,{id:`ask`,title:`Ask`,children:(0,$.jsx)(Ze,{tab:`ask`,...H})}),(0,$.jsx)(h,{id:`deny`,title:`Deny`,children:(0,$.jsx)(Ze,{tab:`deny`,...H})}),(0,$.jsx)(h,{id:`workspace`,title:`Workspace`,children:(0,$.jsxs)(v,{flexDirection:`column`,children:[(0,$.jsx)(f,{children:`Claude Code can read files in the workspace, and make edits when auto-accept edits is on.`}),(0,$.jsx)(We,{onExit:e,toolPermissionContext:u,onRequestAddDirectory:xe,onRequestRemoveDirectory:Ce,onHeaderFocusChange:P})]})})]}),(0,$.jsx)(v,{marginTop:1,paddingLeft:1,children:(0,$.jsx)(f,{dimColor:!0,children:L.pending?(0,$.jsxs)($.Fragment,{children:[`Press `,L.keyName,` again to exit`]}):N?(0,$.jsx)($.Fragment,{children:`←/→ tab switch · ↓ return · Esc cancel`}):A?(0,$.jsx)($.Fragment,{children:`Type to filter · Enter/↓ select · ↑ tabs · Esc clear`}):i&&o===`recent`?(0,$.jsx)($.Fragment,{children:`Enter approve · r retry · ↑↓ navigate · ←/→ switch · Esc cancel`}):(0,$.jsx)($.Fragment,{children:`↑↓ navigate · Enter select · Type to search · ←/→ switch · Esc cancel`})})})]})})}var Q,$,$e=e((()=>{s(),n(),c(),Q=t(c(),1),ge(),z(),F(),xe(),De(),_(),be(),ke(),w(),ae(),M(),Te(),Ie(),Ce(),Me(),ze(),Ve(),Ue(),Ke(),$=b()})),et,tt;e((()=>{$e(),P(),et=b(),tt=async(e,t)=>(0,et.jsx)(Qe,{onExit:e,onRetryDenials:e=>{t.setMessages(t=>[...t,_e(e)])}})}))();export{tt as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./pluginStartupCheck-Bjdc8zhz.js";e();export{t as getPluginEditableScopes};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./figures-gfT9mM8P.js";import{Or as n,cn as r}from"./state-sIHsFpDu.js";import{Po as i,jo as a}from"./paths-Q2255dD7.js";import{E as o,L as s,V as c,w as l}from"./debug-UI3T040K.js";import{n as u,r as d}from"./analytics-DqMQntaB.js";import{o as f,s as p}from"./log-CzsijfHZ.js";import{$s as m,As as h,Cw as g,Es as _,Fs as v,Gs as y,Hs as b,Ms as ee,NA as x,PA as S,Vs as C,Ws as w,Ys as T,ac as te,fs as ne,lc as E,ps as D,qs as O,sc as k,uc as A,ww as j}from"./loadAgentsDir-Ci5mr0vm.js";import{i as M,o as N,s as P}from"./xml-DD_ldd3X.js";import{n as F,t as I}from"./exit-_obETqBv.js";import{n as L,t as R}from"./pluginOperations-B0rLuSvo.js";import{a as z,i as B,n as V,o as H,r as U,t as W}from"./pluginCliCommands-BQkrvES5.js";import{a as re,c as G,i as K,n as q,r as J,s as Y,t as X}from"./validatePlugin-BlVho93x.js";import{basename as ie,dirname as Z}from"path";e(),r(),u(),S(),c(),f(),A(),G(),_(),te(),C(),g(),K(),M(),ne(),X(),l(),a();function Q(e,n){p(e),I(`${t.cross} Failed to ${n}: ${s(e)}`)}function $(e){e.errors.length>0&&(console.log(`${t.cross} Found ${e.errors.length} ${i(e.errors.length,`error`)}:\n`),e.errors.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``)),e.warnings.length>0&&(console.log(`${t.warning} Found ${e.warnings.length} ${i(e.warnings.length,`warning`)}:\n`),e.warnings.forEach(e=>{console.log(` ${t.pointer} ${e.path}: ${e.message}`)}),console.log(``))}async function ae(e,r){r.cowork&&n(!0);try{let n=await q(e);console.log(`Validating ${n.fileType} manifest: ${n.filePath}\n`),$(n);let r=[];if(n.fileType===`plugin`){let e=Z(n.filePath);if(ie(e)===`.claude-plugin`){r=await J(Z(e));for(let e of r)console.log(`Validating ${e.fileType}: ${e.filePath}\n`),$(e)}}let i=n.success&&r.every(e=>e.success),a=n.warnings.length>0||r.some(e=>e.warnings.length>0);i?F(a?`${t.tick} Validation passed with warnings`:`${t.tick} Validation passed`):(console.log(`${t.cross} Validation failed`),process.exit(1))}catch(e){p(e),console.error(`${t.cross} Unexpected error during validation: ${s(e)}`),process.exit(2)}}async function oe(e){e.cowork&&n(!0),d(`tengu_plugin_list_command`,{});let r=ee(),{getPluginEditableScopes:i}=await import(`./pluginStartupCheck-Cu2ezD51.js`),a=i(),s=Object.keys(r.plugins),{enabled:c,disabled:l,errors:u}=await D(),f=[...c,...l],p=f.filter(e=>e.source.endsWith(`@inline`)),g=u.filter(e=>e.source.endsWith(`@inline`)||e.source.startsWith(`inline[`));if(e.json){let t=new Map(f.map(e=>[e.source,e])),n=[];for(let e of s.sort()){let i=r.plugins[e];if(!i||i.length===0)continue;let o=N(e).name,s=u.filter(t=>t.source===e||`plugin`in t&&t.plugin===o).map(x);for(let r of i){let i=t.get(e),o;if(i){let e=i.mcpServers||await j(i);e&&Object.keys(e).length>0&&(o=e)}n.push({id:e,version:r.version||`unknown`,scope:r.scope,enabled:a.has(e),installPath:r.installPath,installedAt:r.installedAt,lastUpdated:r.lastUpdated,projectPath:r.projectPath,mcpServers:o,errors:s.length>0?s:void 0})}}for(let e of p){let t=e.mcpServers||await j(e),r=g.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name).map(x);n.push({id:e.source,version:e.manifest.version??`unknown`,scope:`session`,enabled:e.enabled!==!1,installPath:e.path,mcpServers:t&&Object.keys(t).length>0?t:void 0,errors:r.length>0?r:void 0})}for(let e of g.filter(e=>e.source.startsWith(`inline[`)))n.push({id:e.source,version:`unknown`,scope:`session`,enabled:!1,installPath:`path`in e?e.path:``,errors:[x(e)]});if(e.available){let e=[];try{let[t,n]=await Promise.all([b(),Y()]),{marketplaces:r}=await k(t);for(let{name:t,data:i}of r)if(i)for(let r of i.plugins){let i=m(r.name,t);h(i)||e.push({pluginId:i,name:r.name,description:r.description,marketplaceName:t,version:r.version,source:r.source,installCount:n?.get(i)})}}catch{}F(o({installed:n,available:e},null,2))}else F(o(n,null,2))}s.length===0&&p.length===0&&g.length===0&&F("No plugins installed. Use `claude plugin install` to install a plugin."),s.length>0&&console.log(`Installed plugins:
|
|
2
|
-
`);for(let e of s.sort()){let n=r.plugins[e];if(!n||n.length===0)continue;let i=N(e).name,o=u.filter(t=>t.source===e||`plugin`in t&&t.plugin===i);for(let r of n){let n=a.has(e),i=o.length>0?`${t.cross} failed to load`:n?`${t.tick} enabled`:`${t.cross} disabled`,s=r.version||`unknown`,c=r.scope;console.log(` ${t.pointer} ${e}`),console.log(` Version: ${s}`),console.log(` Scope: ${c}`),console.log(` Status: ${i}`);for(let e of o)console.log(` Error: ${x(e)}`);console.log(``)}}if(p.length>0||g.length>0){console.log(`Session-only plugins (--plugin-dir):
|
|
3
|
-
`);for(let e of p){let n=g.filter(t=>t.source===e.source||`plugin`in t&&t.plugin===e.name),r=n.length>0?`${t.cross} loaded with errors`:`${t.tick} loaded`;console.log(` ${t.pointer} ${e.source}`),console.log(` Version: ${e.manifest.version??`unknown`}`),console.log(` Path: ${e.path}`),console.log(` Status: ${r}`);for(let e of n)console.log(` Error: ${x(e)}`);console.log(``)}for(let e of g.filter(e=>e.source.startsWith(`inline[`)))console.log(` ${t.pointer} ${e.source}: ${t.cross} ${x(e)}\n`)}F()}async function se(e,r){r.cowork&&n(!0);try{let n=await re(e);n||I(`${t.cross} Invalid marketplace source format. Try: owner/repo, https://..., or ./path`),`error`in n&&I(`${t.cross} ${n.error}`);let i=r.scope??`user`;i!==`user`&&i!==`project`&&i!==`local`&&I(`${t.cross} Invalid scope '${i}'. Use: user, project, or local`);let a=P(i),o=n;r.sparse&&r.sparse.length>0&&(o.source===`github`||o.source===`git`?o={...o,sparsePaths:r.sparse}:I(`${t.cross} --sparse is only supported for github and git marketplace sources (got: ${o.source})`)),console.log(`Adding marketplace...`);let{name:s,alreadyMaterialized:c,resolvedSource:l}=await v(o,e=>{console.log(e)});T(s,{source:l},a),E();let u=o.source;o.source===`github`&&(u=o.repo),d(`tengu_marketplace_added`,{source_type:u}),F(c?`${t.tick} Marketplace '${s}' already on disk — declared in ${i} settings`:`${t.tick} Successfully added marketplace: ${s} (declared in ${i} settings)`)}catch(e){Q(e,`add marketplace`)}}async function ce(e){e.cowork&&n(!0);try{let n=await b(),r=Object.keys(n);e.json&&F(o(r.sort().map(e=>{let t=n[e],r=t?.source;return{name:e,source:r?.source,...r?.source===`github`&&{repo:r.repo},...r?.source===`git`&&{url:r.url},...r?.source===`url`&&{url:r.url},...r?.source===`directory`&&{path:r.path},...r?.source===`file`&&{path:r.path},installLocation:t?.installLocation}}),null,2)),r.length===0&&F(`No marketplaces configured`),console.log(`Configured marketplaces:
|
|
4
|
-
`),r.forEach(e=>{let r=n[e];if(console.log(` ${t.pointer} ${e}`),r?.source){let e=r.source;e.source===`github`?console.log(` Source: GitHub (${e.repo})`):e.source===`git`?console.log(` Source: Git (${e.url})`):e.source===`url`?console.log(` Source: URL (${e.url})`):e.source===`directory`?console.log(` Source: Directory (${e.path})`):e.source===`file`&&console.log(` Source: File (${e.path})`)}console.log(``)}),F()}catch(e){Q(e,`list marketplaces`)}}async function le(e,r){r.cowork&&n(!0);try{await O(e),E(),d(`tengu_marketplace_removed`,{marketplace_name:e}),F(`${t.tick} Successfully removed marketplace: ${e}`)}catch(e){Q(e,`remove marketplace`)}}async function ue(e,r){r.cowork&&n(!0);try{if(e)console.log(`Updating marketplace: ${e}...`),await y(e,e=>{console.log(e)}),E(),d(`tengu_marketplace_updated`,{marketplace_name:e}),F(`${t.tick} Successfully updated marketplace: ${e}`);else{let e=await b(),n=Object.keys(e);n.length===0&&F(`No marketplaces configured`),console.log(`Updating ${n.length} marketplace(s)...`),await w(),E(),d(`tengu_marketplace_updated_all`,{count:n.length}),F(`${t.tick} Successfully updated ${n.length} marketplace(s)`)}}catch(e){Q(e,`update marketplace(s)`)}}async function de(e,t){t.cowork&&n(!0);let r=t.scope||`user`;t.cowork&&r!==`user`&&I(`--cowork can only be used with user scope`),R.includes(r)||I(`Invalid scope: ${r}. Must be one of: ${R.join(`, `)}.`);let{name:i,marketplace:a}=N(e);d(`tengu_plugin_install_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r}),await B(e,r)}async function fe(e,t){t.cowork&&n(!0);let r=t.scope||`user`;t.cowork&&r!==`user`&&I(`--cowork can only be used with user scope`),R.includes(r)||I(`Invalid scope: ${r}. Must be one of: ${R.join(`, `)}.`);let{name:i,marketplace:a}=N(e);d(`tengu_plugin_uninstall_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r}),await z(e,r,t.keepData)}async function pe(e,t){t.cowork&&n(!0);let r;t.scope&&(R.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${R.join(`, `)}`),r=t.scope),t.cowork&&r!==void 0&&r!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&r===void 0&&(r=`user`);let{name:i,marketplace:a}=N(e);d(`tengu_plugin_enable_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r??`auto`}),await U(e,r)}async function me(e,t){if(t.all&&e&&I(`Cannot use --all with a specific plugin`),!t.all&&!e&&I(`Please specify a plugin name or use --all to disable all plugins`),t.cowork&&n(!0),t.all){t.scope&&I(`Cannot use --scope with --all`),d(`tengu_plugin_disable_command`,{}),await W();return}let r;t.scope&&(R.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${R.join(`, `)}`),r=t.scope),t.cowork&&r!==void 0&&r!==`user`&&I(`--cowork can only be used with user scope`),t.cowork&&r===void 0&&(r=`user`);let{name:i,marketplace:a}=N(e);d(`tengu_plugin_disable_command`,{_PROTO_plugin_name:i,...a&&{_PROTO_marketplace_name:a},scope:r??`auto`}),await V(e,r)}async function he(e,t){t.cowork&&n(!0);let{name:r,marketplace:i}=N(e);d(`tengu_plugin_update_command`,{_PROTO_plugin_name:r,...i&&{_PROTO_marketplace_name:i}});let a=`user`;t.scope&&(L.includes(t.scope)||I(`Invalid scope "${t.scope}". Valid scopes: ${L.join(`, `)}`),a=t.scope),t.cowork&&a!==`user`&&I(`--cowork can only be used with user scope`),await H(e,a)}export{se as marketplaceAddHandler,ce as marketplaceListHandler,le as marketplaceRemoveHandler,ue as marketplaceUpdateHandler,me as pluginDisableHandler,pe as pluginEnableHandler,de as pluginInstallHandler,oe as pluginListHandler,fe as pluginUninstallHandler,he as pluginUpdateHandler,ae as pluginValidateHandler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ba as e,Ka as t,Ra as n}from"./loadAgentsDir-Ci5mr0vm.js";n();export{e as isPolicyAllowed,t as waitForPolicyLimitsToLoad};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./poorMode-C5Frra4j.js";t();export{e as isPoorModeActive};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-DR8-3Aex.js";import{Rn as t,t as n,x as r}from"./src-Di342QoJ.js";import{t as i}from"./jsx-runtime-D-D469L8.js";import{Ka as a,oo as o}from"./paths-Q2255dD7.js";import{L as s,N as c,V as l}from"./debug-UI3T040K.js";import{n as u,r as d}from"./analytics-DqMQntaB.js";import{Bm as f,Dg as p,Dm as m,Lo as h,Og as g,Om as _,bo as v,fC as y,go as b,hu as x,mu as S,pC as C,qo as w,yo as T,zm as E}from"./loadAgentsDir-Ci5mr0vm.js";import{Ft as D,Pt as O}from"./prompt-DEPUnJdB.js";import{r as k,t as A}from"./xml-DD_ldd3X.js";import{randomUUID as j}from"crypto";t(),n(),x(),g(),f();var M=i();function N({input:e,progress:t,verbose:n}){return(0,M.jsxs)(r,{flexDirection:`column`,marginTop:1,children:[(0,M.jsx)(p,{addMargin:!1,param:{text:`<bash-input>${e}</bash-input>`,type:`text`}}),t?(0,M.jsx)(E,{fullOutput:t.fullOutput,output:t.output,elapsedTimeSeconds:t.elapsedTimeSeconds,totalLines:t.totalLines,verbose:n}):S.renderToolUseProgressMessage?.([],{verbose:n,tools:[],terminalSize:void 0})]})}u(),l(),y(),h(),o();function P(){return a().defaultShell??`bash`}x(),O(),k();async function F(t,n,r,i,a){let o=D()&&P()===`powershell`;d(`tengu_input_bash`,{powershell:o});let l=v({content:w({inputString:`<bash-input>${t}</bash-input>`,precedingInputBlocks:n})}),u;a({jsx:(0,M.jsx)(N,{input:t,progress:null,verbose:i.options.verbose}),shouldHidePromptInput:!1});try{let n={...i,setToolJSX:e=>{u=e?.jsx}},s=e=>{a({jsx:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{input:t,progress:e.data,verbose:i.options.verbose}),u]}),shouldHidePromptInput:!1,showSpinner:!1})},c=null;o&&(c=(_(),e(m)).PowerShellTool);let d=c??S,f=(c?await c.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,s):await S.call({command:t,dangerouslyDisableSandbox:!0},n,void 0,void 0,s)).data;if(!f)throw Error(`No result received from shell command`);let p=f.stderr,h=await C(d,{...f,stderr:``},j()),g=typeof h.content==`string`?h.content:A(f.stdout);return{messages:[b(),l,...r,v({content:`<bash-stdout>${g}</bash-stdout><bash-stderr>${A(p)}</bash-stderr>`})],shouldQuery:!1}}catch(e){return e instanceof c?e.interrupted?{messages:[b(),l,T({toolUse:!1}),...r],shouldQuery:!1}:{messages:[b(),l,...r,v({content:`<bash-stdout>${A(e.stdout)}</bash-stdout><bash-stderr>${A(e.stderr)}</bash-stderr>`})],shouldQuery:!1}:{messages:[b(),l,...r,v({content:`<bash-stderr>Command failed: ${A(s(e))}</bash-stderr>`})],shouldQuery:!1}}finally{a(null)}}export{F as processBashCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Hk as e,Jk as t}from"./loadAgentsDir-Ci5mr0vm.js";t();export{e as clearPromptCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./prompt-DEPUnJdB.js";t();export{e as isDeferredTool};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,U as a,br as o,cn as s,wt as c}from"./state-sIHsFpDu.js";import{ea as l,na as u,ra as d,ta as f}from"./paths-Q2255dD7.js";import{L as p,V as m,X as h,Y as g,d as _,h as ee,p as te,s as ne}from"./debug-UI3T040K.js";import{F as v,P as re}from"./git-CN3qtTb_.js";import{join as ie}from"node:path";import{appendFileSync as ae,existsSync as oe,mkdirSync as se}from"node:fs";import{homedir as ce}from"node:os";import{randomUUID as y}from"crypto";var le=e((()=>{})),ue,de=e((()=>{ue={input_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,output_tokens:0,server_tool_use:{web_search_requests:0,web_fetch_requests:0},service_tier:`standard`,cache_creation:{ephemeral_1h_input_tokens:0,ephemeral_5m_input_tokens:0},inference_geo:``,iterations:[],speed:`standard`}})),fe=e((()=>{}));function pe(e){return e}var me=e((()=>{})),he=e((()=>{le(),de(),fe(),me()}));function ge(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function _e(e){if(process.env.OPENAI_MODEL)return process.env.OPENAI_MODEL;let t=e.replace(/\[1m\]$/,``),n=ge(t);if(n){let e=`OPENAI_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return ve[t]??t}var ve,ye=e((()=>{ve={"claude-sonnet-4-20250514":`gpt-4o`,"claude-sonnet-4-5-20250929":`gpt-4o`,"claude-sonnet-4-6":`gpt-4o`,"claude-opus-4-20250514":`o3`,"claude-opus-4-1-20250805":`o3`,"claude-opus-4-5-20251101":`o3`,"claude-opus-4-6":`o3`,"claude-haiku-4-5-20251001":`gpt-4o-mini`,"claude-3-5-haiku-20241022":`gpt-4o-mini`,"claude-3-7-sonnet-20250219":`gpt-4o`,"claude-3-5-sonnet-20241022":`gpt-4o`}}));function be(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function xe(){let e=process.env.GROK_MODEL_MAP;if(!e)return null;try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return null}function Se(e){if(process.env.GROK_MODEL)return process.env.GROK_MODEL;let t=e.replace(/\[1m\]$/,``),n=be(t),r=xe();if(r&&n&&r[n])return r[n];if(n){let e=`GROK_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return b[t]?b[t]:n&&x[n]?x[n]:t}var b,x,Ce=e((()=>{b={"claude-sonnet-4-20250514":`grok-3-mini-fast`,"claude-sonnet-4-5-20250929":`grok-3-mini-fast`,"claude-sonnet-4-6":`grok-3-mini-fast`,"claude-opus-4-20250514":`grok-4.20-reasoning`,"claude-opus-4-1-20250805":`grok-4.20-reasoning`,"claude-opus-4-5-20251101":`grok-4.20-reasoning`,"claude-opus-4-6":`grok-4.20-reasoning`,"claude-haiku-4-5-20251001":`grok-3-mini-fast`,"claude-3-5-haiku-20241022":`grok-3-mini-fast`,"claude-3-7-sonnet-20250219":`grok-3-mini-fast`,"claude-3-5-sonnet-20241022":`grok-3-mini-fast`},x={opus:`grok-4.20-reasoning`,sonnet:`grok-3-mini-fast`,haiku:`grok-3-mini-fast`}}));function we(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function Te(e){if(process.env.GEMINI_MODEL)return process.env.GEMINI_MODEL;let t=e.replace(/\[1m\]$/i,``),n=we(t);if(!n)return t;let r=`GEMINI_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i;let a=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,o=process.env[a];if(o)return o;throw Error(`Gemini provider requires GEMINI_MODEL or ${r} (or ${a} for backward compatibility) to be configured.`)}var Ee=e((()=>{})),S,De=e((()=>{S=`_geminiThoughtSignature`}));function C(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Oe(e,t){let n=[],r=new Map;for(let t of e){if(t.type===`assistant`){let e=Me(t);e.parts.length>0&&n.push(e);let i=t.message.content;if(Array.isArray(i))for(let e of i)typeof e!=`string`&&e.type===`tool_use`&&r.set(e.id,e.name);continue}if(t.type===`user`){let e=Ae(t,r);e.parts.length>0&&n.push(e)}}let i=ke(t);return{contents:n,...i?{systemInstruction:{parts:[{text:i}]}}:{}}}function ke(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
2
|
-
|
|
3
|
-
`)}function Ae(e,t){let n=e.message.content;return typeof n==`string`?{role:`user`,parts:w(n)}:Array.isArray(n)?{role:`user`,parts:n.flatMap(e=>je(e,t))}:{role:`user`,parts:[]}}function je(e,t){if(typeof e==`string`)return w(e);if(e.type===`text`)return w(e.text);if(e.type===`tool_result`){let n=e;return[{functionResponse:{name:t.get(n.tool_use_id)??n.tool_use_id,response:Fe(n)}}]}if(e.type===`image`){let t=e.source;if(t?.type===`base64`&&typeof t.data==`string`)return[{inlineData:{mimeType:t.media_type||`image/png`,data:t.data}}];if(t?.type===`url`&&typeof t.url==`string`)return w(`[image: ${t.url}]`)}return[]}function Me(e){let t=e.message.content;if(typeof t==`string`)return{role:`model`,parts:w(t)};if(!Array.isArray(t))return{role:`model`,parts:[]};let n=[];for(let e of t){if(typeof e==`string`){n.push(...w(e));continue}if(e.type===`text`){n.push(...w(e.text,T(e)));continue}if(e.type===`thinking`){let t=Ne(e.thinking,e.signature);t&&n.push(t);continue}if(e.type===`tool_use`){let t=e;n.push({functionCall:{name:t.name,args:Pe(t.input)},...T(e)&&{thoughtSignature:T(e)}})}}return{role:`model`,parts:n}}function w(e,t){return typeof e!=`string`||e.length===0?[]:[{text:e,...t&&{thoughtSignature:t}}]}function Ne(e,t){if(!(typeof e!=`string`||e.length===0))return{text:e,thought:!0,...t&&{thoughtSignature:t}}}function Pe(e){if(typeof e==`string`){let t=C(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:t===null?{}:{value:t}}return e&&typeof e==`object`&&!Array.isArray(e)?e:e===void 0?{}:{value:e}}function Fe(e){let t=Ie(e.content);return t&&typeof t==`object`&&!Array.isArray(t)?e.is_error?{...t,is_error:!0}:t:{result:t,...e.is_error?{is_error:!0}:{}}}function Ie(e){if(typeof e==`string`)return C(e)??e;if(Array.isArray(e)){let t=e.map(e=>typeof e==`string`?e:e&&typeof e==`object`&&`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(`
|
|
4
|
-
`);return C(t)??t}return e??``}function T(e){let t=e[S];return typeof t==`string`&&t.length>0?t:void 0}var Le=e((()=>{De()}));function Re(e){if(typeof e==`string`)return D.has(e)?e:void 0;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`&&D.has(e)),n=Array.from(new Set(t));return n.length===0?void 0:n.length===1?n[0]:n}}function ze(e){if(e===null)return`null`;if(Array.isArray(e))return`array`;if(typeof e==`string`)return`string`;if(typeof e==`boolean`)return`boolean`;if(typeof e==`number`)return Number.isInteger(e)?`integer`:`number`;if(typeof e==`object`)return`object`}function Be(e){let t=e.map(ze).filter(e=>e!==void 0),n=Array.from(new Set(t));if(n.length!==0)return n.length===1?n[0]:n}function Ve(e){return e===void 0?[`null`]:Array.isArray(e)?e.includes(`null`)?e:[...e,`null`]:e===`null`?e:[e,`null`]}function He(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=Object.entries(e).map(([e,t])=>[e,E(t)]).filter(([,e])=>Object.keys(e).length>0);if(t.length!==0)return Object.fromEntries(t)}function Ue(e){if(!Array.isArray(e))return;let t=e.map(e=>E(e)).filter(e=>Object.keys(e).length>0);return t.length>0?t:void 0}function E(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n={},r=Re(t.type);t.const===void 0?Array.isArray(t.enum)&&t.enum.length>0&&(n.enum=t.enum,r=r??Be(t.enum)):(n.enum=[t.const],r=r??ze(t.const)),r||(t.properties&&typeof t.properties==`object`?r=`object`:(t.items!==void 0||t.prefixItems!==void 0)&&(r=`array`)),t.nullable===!0&&(r=Ve(r)),r&&(n.type=r),typeof t.title==`string`&&(n.title=t.title),typeof t.description==`string`&&(n.description=t.description),typeof t.format==`string`&&(n.format=t.format),typeof t.pattern==`string`&&(n.pattern=t.pattern),typeof t.minimum==`number`?n.minimum=t.minimum:typeof t.exclusiveMinimum==`number`&&(n.minimum=t.exclusiveMinimum),typeof t.maximum==`number`?n.maximum=t.maximum:typeof t.exclusiveMaximum==`number`&&(n.maximum=t.exclusiveMaximum),typeof t.minItems==`number`&&(n.minItems=t.minItems),typeof t.maxItems==`number`&&(n.maxItems=t.maxItems),typeof t.minLength==`number`&&(n.minLength=t.minLength),typeof t.maxLength==`number`&&(n.maxLength=t.maxLength),typeof t.minProperties==`number`&&(n.minProperties=t.minProperties),typeof t.maxProperties==`number`&&(n.maxProperties=t.maxProperties);let i=He(t.properties);if(i&&(n.properties=i,n.propertyOrdering=Object.keys(i)),Array.isArray(t.required)){let e=t.required.filter(e=>typeof e==`string`);e.length>0&&(n.required=e)}if(typeof t.additionalProperties==`boolean`)n.additionalProperties=t.additionalProperties;else{let e=E(t.additionalProperties);Object.keys(e).length>0&&(n.additionalProperties=e)}let a=E(t.items);Object.keys(a).length>0&&(n.items=a);let o=Ue(t.prefixItems);o&&(n.prefixItems=o);let s=Ue(t.anyOf??t.oneOf);return s&&(n.anyOf=s),n}function We(e){let t=E(e);return Object.keys(t).length>0?t:{type:`object`,properties:{}}}function Ge(e){let t=e.filter(e=>{let t=e.type;return e.type===`custom`||!(`type`in e)||t!==`server`}).map(e=>{let t=e;return{name:t.name||``,description:t.description||``,parametersJsonSchema:We(t.input_schema??{type:`object`,properties:{}})}});return t.length>0?[{functionDeclarations:t}]:[]}function Ke(e){if(!e||typeof e!=`object`)return;let t=e;switch(t.type){case`auto`:return{mode:`AUTO`};case`any`:return{mode:`ANY`};case`tool`:return{mode:`ANY`,allowedFunctionNames:typeof t.name==`string`?[t.name]:void 0};default:return}}var D,qe=e((()=>{D=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`,`null`])}));async function*Je(e,t){let n=`msg_${y().replace(/-/g,``).slice(0,24)}`,r=!1,i=!1,a=0,o=null,s=!1,c,l=0,u=0,d=0;for await(let i of e){let e=i.usageMetadata;e&&(l=e.promptTokenCount??l,u=(e.candidatesTokenCount??0)+(e.thoughtsTokenCount??0),d=e.cachedContentTokenCount??d),r||(r=!0,yield{type:`message_start`,message:{id:n,type:`message`,role:`assistant`,content:[],model:t,stop_reason:null,stop_sequence:null,usage:{input_tokens:l,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:d}}});let f=i.candidates?.[0],p=f?.content?.parts??[];for(let e of p){if(e.functionCall){o&&(yield{type:`content_block_stop`,index:o.index},o=null),s=!0;let t=a++;yield{type:`content_block_start`,index:t,content_block:{type:`tool_use`,id:`toolu_${y().replace(/-/g,``).slice(0,24)}`,name:e.functionCall.name||``,input:{}}},e.thoughtSignature&&(yield{type:`content_block_delta`,index:t,delta:{type:`signature_delta`,signature:e.thoughtSignature}}),e.functionCall.args&&Object.keys(e.functionCall.args).length>0&&(yield{type:`content_block_delta`,index:t,delta:{type:`input_json_delta`,partial_json:JSON.stringify(e.functionCall.args)}}),yield{type:`content_block_stop`,index:t};continue}let t=Ye(e);if(t){(!o||o.type!==t)&&(o&&(yield{type:`content_block_stop`,index:o.index}),o={index:a++,type:t},yield{type:`content_block_start`,index:o.index,content_block:t===`thinking`?{type:`thinking`,thinking:``,signature:``}:{type:`text`,text:``}}),e.text&&(yield{type:`content_block_delta`,index:o.index,delta:t===`thinking`?{type:`thinking_delta`,thinking:e.text}:{type:`text_delta`,text:e.text}}),e.thoughtSignature&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}});continue}e.thoughtSignature&&o&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}})}f?.finishReason&&(c=f.finishReason)}r&&(o&&(yield{type:`content_block_stop`,index:o.index}),i||(yield{type:`message_delta`,delta:{stop_reason:Xe(c,s),stop_sequence:null},usage:{input_tokens:l,output_tokens:u,cache_creation_input_tokens:0,cache_read_input_tokens:d}},yield{type:`message_stop`},i=!0))}function Ye(e){return typeof e.text==`string`?e.thought?`thinking`:`text`:null}function Xe(e,t){switch(e){case`MAX_TOKENS`:return`max_tokens`;default:return t?`tool_use`:`end_turn`}}var Ze=e((()=>{}));function O(e){if(!e||typeof e!=`object`)return null;let t=e,n=0;for(;t&&n<5;){if(t instanceof Error&&`code`in t&&typeof t.code==`string`){let e=t.code,n=rt.has(e);return{code:e,message:t.message,isSSLError:n}}if(t instanceof Error&&`cause`in t&&t.cause!==t)t=t.cause,n++;else break}return null}function Qe(e){let t=O(e);return t?.isSSLError?`SSL certificate error (${t.code}). If you are behind a corporate proxy or TLS-intercepting firewall, set NODE_EXTRA_CA_CERTS to your CA bundle path, or ask IT to allowlist *.anthropic.com. Run /doctor for details.`:null}function k(e){if(e.includes(`<!DOCTYPE html`)||e.includes(`<html`)){let t=e.match(/<title>([^<]+)<\/title>/);return t&&t[1]?t[1].trim():``}return e}function $e(e){let t=e.message;return t?k(t):``}function et(e){return typeof e==`object`&&!!e&&`error`in e&&typeof e.error==`object`&&e.error!==null}function tt(e){if(!et(e))return null;let t=e.error,n=t?.error?.message;if(typeof n==`string`&&n.length>0){let e=k(n);if(e.length>0)return e}let r=t?.message;if(typeof r==`string`&&r.length>0){let e=k(r);if(e.length>0)return e}return null}function nt(e){let t=O(e);if(t){let{code:e,isSSLError:n}=t;if(e===`ETIMEDOUT`)return`Request timed out. Check your internet connection and proxy settings`;if(n)switch(e){case`UNABLE_TO_VERIFY_LEAF_SIGNATURE`:case`UNABLE_TO_GET_ISSUER_CERT`:case`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`:return`Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates`;case`CERT_HAS_EXPIRED`:return`Unable to connect to API: SSL certificate has expired`;case`CERT_REVOKED`:return`Unable to connect to API: SSL certificate has been revoked`;case`DEPTH_ZERO_SELF_SIGNED_CERT`:case`SELF_SIGNED_CERT_IN_CHAIN`:return`Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates`;case`ERR_TLS_CERT_ALTNAME_INVALID`:case`HOSTNAME_MISMATCH`:return`Unable to connect to API: SSL certificate hostname mismatch`;case`CERT_NOT_YET_VALID`:return`Unable to connect to API: SSL certificate is not yet valid`;default:return`Unable to connect to API: SSL error (${e})`}}if(e.message===`Connection error.`)return t?.code?`Unable to connect to API (${t.code})`:`Unable to connect to API. Check your internet connection`;if(!e.message)return tt(e)??`API error (status ${e.status??`unknown`})`;let n=$e(e);return n!==e.message&&n.length>0?n:e.message}var rt,it=e((()=>{rt=new Set([`UNABLE_TO_VERIFY_LEAF_SIGNATURE`,`UNABLE_TO_GET_ISSUER_CERT`,`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`,`CERT_SIGNATURE_FAILURE`,`CERT_NOT_YET_VALID`,`CERT_HAS_EXPIRED`,`CERT_REVOKED`,`CERT_REJECTED`,`CERT_UNTRUSTED`,`DEPTH_ZERO_SELF_SIGNED_CERT`,`SELF_SIGNED_CERT_IN_CHAIN`,`CERT_CHAIN_TOO_LONG`,`PATH_LENGTH_EXCEEDED`,`ERR_TLS_CERT_ALTNAME_INVALID`,`HOSTNAME_MISMATCH`,`ERR_TLS_HANDSHAKE_TIMEOUT`,`ERR_SSL_WRONG_VERSION_NUMBER`,`ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC`])}));function at(e,t,n){let r=[],i=ot(t);i&&r.push({role:`system`,content:i});for(let t of e)switch(t.type){case`user`:r.push(...st(t));break;case`assistant`:r.push(...lt(t));break;default:break}return r}function ot(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
5
|
-
|
|
6
|
-
`)}function st(e){let t=[],n=e.message.content;if(typeof n==`string`)t.push({role:`user`,content:n});else if(Array.isArray(n)){let e=[],r=[],i=[];for(let t of n)if(typeof t==`string`)e.push(t);else if(t.type===`text`)e.push(t.text);else if(t.type===`tool_result`)r.push(t);else if(t.type===`image`){let e=ut(t);e&&i.push(e)}for(let e of r)t.push(ct(e));if(i.length>0){let n=[];e.length>0&&n.push({type:`text`,text:e.join(`
|
|
7
|
-
`)}),n.push(...i),t.push({role:`user`,content:n})}else e.length>0&&t.push({role:`user`,content:e.join(`
|
|
8
|
-
`)})}return t}function ct(e){let t;return t=typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.map(e=>typeof e==`string`?e:`text`in e?e.text:``).filter(Boolean).join(`
|
|
9
|
-
`):``,{role:`tool`,tool_call_id:e.tool_use_id,content:t}}function lt(e){let t=e.message.content;if(typeof t==`string`)return[{role:`assistant`,content:t}];if(!Array.isArray(t))return[{role:`assistant`,content:``}];let n=[],r=[],i=[];for(let e of t)if(typeof e==`string`)n.push(e);else if(e.type===`text`)n.push(e.text);else if(e.type===`tool_use`){let t=e;r.push({id:t.id,type:`function`,function:{name:t.name,arguments:typeof t.input==`string`?t.input:JSON.stringify(t.input)}})}else if(e.type===`thinking`){let t=e.thinking;typeof t==`string`&&i.push(t)}return[{role:`assistant`,content:n.length>0?n.join(`
|
|
10
|
-
`):null,...r.length>0&&{tool_calls:r},...i.length>0&&{reasoning_content:i.join(`
|
|
11
|
-
`)}}]}function ut(e){let t=e.source;return t?t.type===`base64`&&typeof t.data==`string`?{type:`image_url`,image_url:{url:`data:${t.media_type||`image/png`};base64,${t.data}`}}:t.type===`url`&&typeof t.url==`string`?{type:`image_url`,image_url:{url:t.url}}:null:null}var dt=e((()=>{}));function ft(e){return e.filter(e=>{let t=e.type;return e.type===`custom`||!(`type`in e)||t!==`server`}).map(e=>{let t=e,n=t.name||``,r=t.description||``,i=t.input_schema;return{type:`function`,function:{name:n,description:r,parameters:A(i||{type:`object`,properties:{}})}}})}function A(e){if(!e||typeof e!=`object`)return e;let t={...e};`const`in t&&(t.enum=[t.const],delete t.const);for(let e of[`properties`,`definitions`,`$defs`,`patternProperties`]){let n=t[e];if(n&&typeof n==`object`){let r={};for(let[e,t]of Object.entries(n))r[e]=t&&typeof t==`object`?A(t):t;t[e]=r}}for(let e of[`items`,`additionalProperties`,`not`,`if`,`then`,`else`,`contains`,`propertyNames`]){let n=t[e];n&&typeof n==`object`&&!Array.isArray(n)&&(t[e]=A(n))}for(let e of[`anyOf`,`oneOf`,`allOf`]){let n=t[e];Array.isArray(n)&&(t[e]=n.map(e=>e&&typeof e==`object`?A(e):e))}return t}function pt(e){if(!e||typeof e!=`object`)return;let t=e;switch(t.type){case`auto`:return`auto`;case`any`:return`required`;case`tool`:return{type:`function`,function:{name:t.name}};default:return}}var mt=e((()=>{}));async function*ht(e,t){let n=`msg_${y().replace(/-/g,``).slice(0,24)}`,r=!1,i=-1,a=new Map,o=!1,s=!1,c=0,l=0,u=0,d=new Set,f=null,p=!1;for await(let m of e){let e=m.choices?.[0],h=e?.delta;if(m.usage){c=m.usage.prompt_tokens??c,l=m.usage.completion_tokens??l;let e=m.usage.prompt_tokens_details;e?.cached_tokens!=null&&(u=e.cached_tokens)}if(r||(r=!0,yield{type:`message_start`,message:{id:n,type:`message`,role:`assistant`,content:[],model:t,stop_reason:null,stop_sequence:null,usage:{input_tokens:c,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:u}}}),!h)continue;let g=h.reasoning_content;if(g!=null&&(o||(i++,o=!0,d.add(i),yield{type:`content_block_start`,index:i,content_block:{type:`thinking`,thinking:``,signature:``}}),g!==``&&(yield{type:`content_block_delta`,index:i,delta:{type:`thinking_delta`,thinking:g}})),h.content!=null&&h.content!==``&&(s||(o&&(yield{type:`content_block_stop`,index:i},d.delete(i),o=!1),i++,s=!0,d.add(i),yield{type:`content_block_start`,index:i,content_block:{type:`text`,text:``}}),yield{type:`content_block_delta`,index:i,delta:{type:`text_delta`,text:h.content}}),h.tool_calls)for(let e of h.tool_calls){let t=e.index;if(!a.has(t)){o&&(yield{type:`content_block_stop`,index:i},d.delete(i),o=!1),s&&(yield{type:`content_block_stop`,index:i},d.delete(i),s=!1),i++;let n=e.id||`toolu_${y().replace(/-/g,``).slice(0,24)}`,r=e.function?.name||``;a.set(t,{contentIndex:i,id:n,name:r,arguments:``}),d.add(i),yield{type:`content_block_start`,index:i,content_block:{type:`tool_use`,id:n,name:r,input:{}}}}let n=e.function?.arguments;n&&(a.get(t).arguments+=n,yield{type:`content_block_delta`,index:a.get(t).contentIndex,delta:{type:`input_json_delta`,partial_json:n}})}if(e?.finish_reason){o&&(yield{type:`content_block_stop`,index:i},d.delete(i),o=!1),s&&(yield{type:`content_block_stop`,index:i},d.delete(i),s=!1);for(let[,e]of a)d.has(e.contentIndex)&&(yield{type:`content_block_stop`,index:e.contentIndex},d.delete(e.contentIndex));f=e.finish_reason,p=a.size>0}}for(let e of d)yield{type:`content_block_stop`,index:e};f!==null&&(yield{type:`message_delta`,delta:{stop_reason:f===`length`?`max_tokens`:p?`tool_use`:gt(f),stop_sequence:null},usage:{input_tokens:c,output_tokens:l,cache_read_input_tokens:u,cache_creation_input_tokens:0}},yield{type:`message_stop`})}function gt(e){switch(e){case`stop`:return`end_turn`;case`tool_calls`:return`tool_use`;case`length`:return`max_tokens`;case`content_filter`:return`end_turn`;default:return`end_turn`}}var _t=e((()=>{})),vt=e((()=>{he(),ye(),Ce(),Ee(),Le(),qe(),Ze(),De(),it(),dt(),mt(),_t()}));function j(e){a()&&(M.length>=xt&&M.shift(),M.push(e))}function yt(){return M.length===0?[]:M.splice(0).map(e=>({...e,uuid:y(),session_id:i()}))}function bt(e,t,n){j({type:`system`,subtype:`task_notification`,task_id:e,tool_use_id:n?.toolUseId,status:t,output_file:n?.outputFile??``,summary:n?.summary??``,usage:n?.usage})}var xt,M,St=e((()=>{s(),xt=1e3,M=[]}));function Ct(){let e=c();if(e!==void 0)return e;let t=process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(!t){let e=d(process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE??l,`session ingress token`);return o(e),e}let n=parseInt(t,10);if(Number.isNaN(n))return _(`CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${t}`,{level:`error`}),o(null),null;try{let e=te(),t=process.platform===`darwin`||process.platform===`freebsd`?`/dev/fd/${n}`:`/proc/self/fd/${n}`,r=e.readFileSync(t,{encoding:`utf8`}).trim();return r?(_(`Successfully read token from file descriptor ${n}`),o(r),u(l,r,`session ingress token`),r):(_(`File descriptor contained empty token`,{level:`error`}),o(null),null)}catch(e){_(`Failed to read token from file descriptor ${n}: ${p(e)}`,{level:`error`});let t=d(process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE??l,`session ingress token`);return o(t),t}}function wt(){return process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||Ct()}function Tt(){let e=wt();if(!e)return{};if(e.startsWith(`sk-ant-sid`)){let t={Cookie:`sessionKey=${e}`},n=process.env.CLAUDE_CODE_ORGANIZATION_UUID;return n&&(t[`X-Organization-Uuid`]=n),t}return{Authorization:`Bearer ${e}`}}function Et(e){process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN=e}var Dt=e((()=>{s(),f(),ne(),m(),ee()})),Ot=t({activateProactive:()=>kt,deactivateProactive:()=>At,getActivationSource:()=>Rt,getNextTickAt:()=>Lt,isContextBlocked:()=>Ft,isProactiveActive:()=>P,isProactivePaused:()=>jt,pauseProactive:()=>Mt,resumeProactive:()=>Nt,setContextBlocked:()=>Pt,setNextTickAt:()=>It,shouldTick:()=>Bt,subscribeToProactiveChanges:()=>zt});function N(){for(let e of B)try{e()}catch{}}function P(){return F}function kt(e){F||(F=!0,I=!1,L=!1,z=e,N())}function At(){F&&(F=!1,I=!1,L=!1,R=null,z=void 0,N())}function jt(){return I}function Mt(){!F||I||(I=!0,R=null,N())}function Nt(){!F||!I||(I=!1,N())}function Pt(e){L!==e&&(L=e,e&&(R=null),N())}function Ft(){return L}function It(e){R=e,N()}function Lt(){return!F||I||L?null:R}function Rt(){return z}function zt(e){return B.add(e),()=>{B.delete(e)}}function Bt(){return F&&!I&&!L}var F,I,L,R,z,B,Vt=e((()=>{F=!1,I=!1,L=!1,R=null,B=new Set}));function Ht(e){H=e}function Ut(e,t){if(U=e,!e||!t?.replayCurrent)return;let n=Jt();Object.keys(n).length!==0&&e(n)}function Wt(e){$t=e}function Gt(e){return!e||e.enabled!==!0?null:{enabled:!0,phase:e.phase===`standby`||e.phase===`sleeping`?e.phase:null,next_tick_at:typeof e.next_tick_at==`number`?e.next_tick_at:null,sleep_until:typeof e.sleep_until==`number`?e.sleep_until:null}}function Kt(e){return JSON.stringify(e)}function qt(e){let t={...K};for(let n of Object.keys(e)){let r=e[n];if(r===void 0){delete t[n];continue}t[n]=r}K=t}function Jt(){let e={...K};return G?e.automation_state={...G}:`automation_state`in K&&(e.automation_state=K.automation_state??null),e}function Yt(){return en}function Xt(e,t){en=e,H?.(e,t),e===`requires_action`&&t?(W=!0,V({pending_action:t})):W&&(W=!1,V({pending_action:null})),e===`idle`&&V({task_summary:null}),e!==`idle`&&Zt(P()?{enabled:!0,phase:null,next_tick_at:null,sleep_until:null}:null),r(process.env.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS)&&j({type:`system`,subtype:`session_state_changed`,state:e})}function V(e){qt(e),U?.(e)}function Zt(e){let t=Gt(e);Kt(t)!==Kt(G)&&(G=t,qt({automation_state:t}),U?.({automation_state:t}))}function Qt(e){$t?.(e)}var H,U,$t,W,en,G,K,tn=e((()=>{Vt(),n(),St(),H=null,U=null,$t=null,W=!1,en=`idle`,G=null,K={}}));function nn(){an(),Z=setInterval(()=>{v(`debug`,`session_keepalive_heartbeat`,{refcount:J}),r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&q?.()},fn)}function rn(){an(),q!==null&&(Q=setTimeout(()=>{v(`info`,`session_idle_30s`),Q=null},fn))}function an(){Q!==null&&(clearTimeout(Q),Q=null)}function on(e){q=e,J>0&&Z===null&&nn()}function sn(){q=null,Z!==null&&(clearInterval(Z),Z=null),an()}function cn(){r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&q?.()}function ln(){return q!==null}function un(e){J++,Y.set(e,(Y.get(e)??0)+1),J===1&&(X=Date.now(),q!==null&&Z===null&&nn()),pn||(pn=!0,h(async()=>{v(`info`,`session_activity_at_shutdown`,{refcount:J,active:Object.fromEntries(Y),oldest_activity_ms:J>0&&X!==null?Date.now()-X:null})}))}function dn(e){J>0&&J--;let t=(Y.get(e)??0)-1;t>0?Y.set(e,t):Y.delete(e),J===0&&Z!==null&&(clearInterval(Z),Z=null,rn())}var fn,q,J,Y,X,Z,Q,pn,mn=e((()=>{g(),re(),n(),fn=3e4,q=null,J=0,Y=new Map,X=null,Z=null,Q=null,pn=!1}));function hn(){let e=ie(ce(),`.claude`);oe(e)||se(e,{recursive:!0})}function gn(e){try{$||(hn(),ae(_n,`\n===== RC-DEBUG session ${new Date().toISOString()} =====\n`),$=!0),ae(_n,`[${new Date().toISOString().slice(11,23)}] ${e}\n`)}catch{}}var _n,$,vn=e((()=>{_n=ie(ce(),`.claude`,`rc-debug.log`),$=!1}));export{yt as A,nt as B,Ot as C,wt as D,Tt as E,ht as F,Oe as G,Je as H,pt as I,Se as J,S as K,ft as L,j as M,St as N,Dt as O,vt as P,at as R,jt as S,Bt as T,Ke as U,Qe as V,Ge as W,pe as X,_e as Y,ue as Z,Ut as _,on as a,Ft as b,dn as c,tn as d,Zt as f,Wt as g,Xt as h,ln as i,bt as j,Et as k,sn as l,V as m,gn as n,cn as o,Qt as p,Te as q,mn as r,un as s,vn as t,Yt as u,Ht as v,It as w,P as x,Vt as y,O as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{iA as e,tA as t}from"./loadAgentsDir-Ci5mr0vm.js";e();export{t as SandboxManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Yc as e,Zc as t}from"./loadAgentsDir-Ci5mr0vm.js";e();export{t as isSearchExtraToolsEnabled};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gu as e,vu as t}from"./loadAgentsDir-Ci5mr0vm.js";e();export{t as registerSessionFileAccessHooks};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./sessionMemory-_dmj8lcH.js";t();export{e as manuallyExtractSessionMemory};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{S as a,_ as o,g as s,mc as c,pc as l}from"./paths-Q2255dD7.js";import{L as u,R as d,V as f,h as ee,p as te}from"./debug-UI3T040K.js";import{n as ne,r as p}from"./analytics-DqMQntaB.js";import{b as m,x as h}from"./teammate-DMYOtLTK.js";import{$O as g,Bc as re,DD as _,Fo as v,GO as y,In as b,JO as x,KO as S,Ln as ie,Lo as ae,Ml as oe,OD as se,Ol as ce,Pl as C,QO as le,Rn as ue,UO as w,VO as T,Vc as E,XO as D,YO as O,ZO as k,bo as A,cl as j,dk as M,dt as N,ek as P,fk as F,fl as I,ft as L,jO as R,kl as z,lk as B,ml as V,ok as H,pk as de,pl as fe,qO as pe,sk as me,sl as he,tk as ge}from"./loadAgentsDir-Ci5mr0vm.js";import{On as U,jn as _e}from"./prompt-DEPUnJdB.js";import{X as ve}from"./rcDebugLog-BbPkkigY.js";import{writeFile as W}from"fs/promises";function ye(){return o(`tengu_session_memory`,!1)}function G(){return s(`tengu_sm_config`,{})}function be(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=m(e,e=>e.type===`tool_use`))}}return n}function K(e){let t=B(e);if(!O()){if(!S(t))return!1;le()}let n=pe(t),r=be(e,X)>=y(),i=v(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(X=t.uuid),!0}return!1}async function q(e){let t=te(),n=b();await t.mkdir(n,{mode:448});let r=ie();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await V(),{encoding:`utf-8`,mode:384})}catch(e){if(d(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await re.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),p(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function xe(){if(r())return;let e=j();process.env.USER_TYPE===`ant`&&p(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&se($)}async function Se(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};k();try{let n=z(t),{memoryPath:r,currentMemory:i}=await q(n),a=await I(i,r),{tools:o,mainLoopModel:s}=t.options,[c,l,u]=await Promise.all([N(o,s),F(),M()]),d=ve(c);return await C({promptMessages:[A({content:a})],cacheSafeParams:{systemPrompt:d,userContext:l,systemContext:u,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),p(`tengu_session_memory_manual_extraction`,{}),g(B(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:u(e)}}finally{D()}}function J(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${U} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${U} on ${e} is allowed`}}}}function Y(e){if(!v(e)){let t=e[e.length-1];t?.uuid&&P(t.uuid)}}var X,Z,Q,$,Ce=e((()=>{n(),i(),L(),de(),_e(),E(),h(),oe(),ee(),_(),ae(),ue(),l(),R(),me(),ne(),he(),fe(),x(),f(),a(),Z=t(()=>{let e=G();ge({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:T.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:T.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:T.toolCallsBetweenUpdates})}),Q=!1,$=c(async function(e){let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`)return;{let{isPoorModeActive:e}=await import(`./poorMode-DJvjO2nW.js`);if(e())return}if(!ye()){process.env.USER_TYPE===`ant`&&!Q&&(Q=!0,p(`tengu_session_memory_gate_disabled`,{}));return}if(Z(),!K(t))return;k();let i=z(n),{memoryPath:a,currentMemory:o}=await q(i);await C({promptMessages:[A({content:await I(o,a)})],cacheSafeParams:ce(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?H(s):void 0,l=w();p(`tengu_session_memory_extraction`,{input_tokens:c?.input_tokens,output_tokens:c?.output_tokens,cache_read_input_tokens:c?.cache_read_input_tokens??void 0,cache_creation_input_tokens:c?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:l.minimumMessageTokensToInit,config_min_tokens_between_update:l.minimumTokensBetweenUpdate,config_tool_calls_between_updates:l.toolCallsBetweenUpdates}),g(B(t)),Y(t),D()})}));export{K as a,Se as i,xe as n,Ce as r,J as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{JO as e,WO as t}from"./loadAgentsDir-Ci5mr0vm.js";e();export{t as getSessionMemoryContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./sessionObserver-CuWMVPlT.js";e();export{t as heuristicObserverBackend};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ar as e,Lr as t,oi as n}from"./loadAgentsDir-Ci5mr0vm.js";e();export{t as linkSessionToPR,n as recordTranscript};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as e,s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{In as r,Ln as i}from"./src-Di342QoJ.js";import{Ct as ee,U as a,cn as o,dr as s,jr as c,lr as l,ut as te}from"./state-sIHsFpDu.js";import{Ac as u,Cn as ne,Pc as d,Sc as f,at as p,bc as m,it as h,on as g,rt as _,st as v}from"./paths-Q2255dD7.js";import{L as y,V as b}from"./debug-UI3T040K.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{n as C,t as w}from"./cwd--iizewsn.js";import{F as T,P as E,f as re,n as D,r as O,v as k}from"./git-CN3qtTb_.js";import{a as A,n as j}from"./env-chR0gV31.js";import{o as M,s as N}from"./log-CzsijfHZ.js";import{a as P,n as F}from"./startupProfiler-DnXZaX4A.js";import{Ar as I,Bv as L,Gi as R,Hm as z,Hv as B,LS as V,Mb as H,Mt as U,Mv as W,Nv as G,RS as K,Rb as q,Um as J,Xi as Y,_t as X,bt as Z,gE as ie,gk as ae,hE as oe,vn as se,vt as ce,wt as le,xi as ue,xk as de,yn as fe,zS as pe}from"./loadAgentsDir-Ci5mr0vm.js";import{l as me,u as he}from"./terminalSetup-DJqWE8fc.js";import{c as ge,n as _e}from"./releaseNotes-CwKpIsyd.js";import{s as ve,u as ye}from"./logoV2Utils-SAulcC5x.js";import{i as be,r as xe}from"./runtimeObserver-Duod-ign.js";import{n as Q,r as Se}from"./sessionMemory-_dmj8lcH.js";import{t as Ce}from"./sinks-COcy5GnB.js";import{homedir as we}from"os";import{join as Te}from"path";import{copyFile as Ee,stat as De}from"fs/promises";t(),i(),o(),x(),C(),b(),E(),A(),k(),g(),v(),_(),de(),ie(),K(),he(),W(),z(),Y(),I(),fe(),ge(),be(),Se(),u(),M();function $(){d(e=>({...e,iterm2SetupInProgress:!1}))}function Oe(){let e=f();return{inProgress:e.iterm2SetupInProgress??!1,backupPath:e.iterm2BackupPath||null}}function ke(){return Te(we(),`Library`,`Preferences`,`com.googlecode.iterm2.plist`)}async function Ae(){let{inProgress:e,backupPath:t}=Oe();if(!e)return{status:`no_backup`};if(!t)return $(),{status:`no_backup`};try{await De(t)}catch{return $(),{status:`no_backup`}}try{return await Ee(t,ke()),$(),{status:`restored`}}catch(e){return N(Error(`Failed to restore iTerm2 settings with: ${e}`)),$(),{status:`failed`,backupPath:t}}}u(),M(),ye(),H(),B(),F(),le();async function je(t,i,o,u,d,g,_,v,b){T(`info`,`setup_started`);let x=process.version.match(/^v(\d+)\./)?.[1];if((!x||parseInt(x,10)<18)&&(console.error(r.bold.red(`Error: Claude Code requires Node.js version 18 or higher.`)),process.exit(1)),_&&c(oe(_)),e(),!e()&&h()){let{captureTeammateModeSnapshot:e}=await import(`./teammateModeSnapshot-CsNIJTKi.js`);e()}if(!a()){if(h()){let e=await Ae();e.status===`restored`?console.log(r.yellow(`Detected an interrupted iTerm2 setup. Your original settings have been restored. You may need to restart iTerm2 for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore iTerm2 settings. Please manually restore your original settings with: defaults import com.googlecode.iterm2 ${e.backupPath}.`))}try{let e=await me();e.status===`restored`?console.log(r.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){N(e)}}J(t);let C=Date.now();if(V(),T(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-C}),G(t),u){let e=se(),n=await re();!e&&!n&&(process.stderr.write(r.red(`Error: Can only use --worktree in a git repository, but ${r.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let i=v?`pr-${v}`:d??L(),a;if(n){let e=D(w());e||(process.stderr.write(r.red(`Error: Could not determine the main git repository root.
|
|
2
|
-
`)),process.exit(1)),e!==(O(w())??w())&&(T(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),J(e)),a=g?Z(e,U(i)):void 0}else a=g?Z(w(),U(i)):void 0;let o;try{o=await ce(ee(),i,a,v?{prNumber:v}:void 0)}catch(e){process.stderr.write(r.red(`Error creating worktree: ${y(e)}\n`)),process.exit(1)}if(S(`tengu_worktree_created`,{tmux_enabled:g}),g&&a){let e=await X(a,o.worktreePath);e.created?console.log(r.green(`Created tmux session: ${r.bold(a)}\nTo attach: ${r.bold(`tmux attach -t ${a}`)}`)):console.error(r.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(o.worktreePath),J(o.worktreePath),l(w()),s(w()),ue(o),ae(),pe()}T(`info`,`setup_background_jobs_starting`),e()||(Q(),xe()),q(),T(`info`,`setup_background_jobs_launched`),P(`setup_before_prefetch`),T(`info`,`setup_prefetch_starting`);let E=a()&&n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||e();if(E||R(te()),import(`./loadPluginHooks-xYCEZ6t5.js`).then(e=>{E||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),e()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-DSv9FggK.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-DB93ZNWP.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-PygdohOh.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-7Svz-7S-.js`).then(e=>e.registerSessionFileAccessHooks())),Ce(),S(`tengu_started`,{}),ne(a()),P(`setup_after_prefetch`),!e()){let{hasReleaseNotes:e}=await _e(f().lastReleaseNotesSeen);e&&await ve()}if((i===`bypassPermissions`||o)&&(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.CLAUDE_CODE_BUBBLEWRAP)&&(console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1)),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`)){let[e,t]=await Promise.all([p.getIsDocker(),j.hasInternetAccess()]),n=p.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}let k=m();k.lastCost!==void 0&&k.lastDuration!==void 0&&S(`tengu_exit`,{last_session_cost:k.lastCost,last_session_api_duration:k.lastAPIDuration,last_session_tool_duration:k.lastToolDuration,last_session_duration:k.lastDuration,last_session_lines_added:k.lastLinesAdded,last_session_lines_removed:k.lastLinesRemoved,last_session_total_input_tokens:k.lastTotalInputTokens,last_session_total_output_tokens:k.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:k.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:k.lastTotalCacheReadInputTokens,last_session_fps_average:k.lastFpsAverage,last_session_fps_low_1_pct:k.lastFpsLow1Pct,last_session_id:k.lastSessionId,...k.lastSessionMetrics})}export{je as setup};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./sink-B3uP8Cf8.js";t();export{e as initializeAnalyticsSink};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./sinks-COcy5GnB.js";export{e as initSinks};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./chokidar-SzksMqYp.js";import{Ct as n,Fr as r,Pr as i,cn as a,et as o,g as s,jr as ee,lr as c,nr as l,tr as te}from"./state-sIHsFpDu.js";import{Br as ne,Pr as re}from"./paths-Q2255dD7.js";import{X as ie,Y as ae,d as u,h as oe,p as se,s as d}from"./debug-UI3T040K.js";import{n as ce,r as le}from"./analytics-DqMQntaB.js";import{n as ue,t as f}from"./cwd--iizewsn.js";import{$v as de,Ac as fe,Ar as pe,At as p,Cm as m,Hm as h,Hv as g,Lo as me,Pt as he,Ri as ge,Tm as _e,Um as _,Vv as v,Xi as ve,Yn as ye,_m as y,_o as b,cd as x,di as S,ei as C,fi as w,gE as T,gk as E,gn as D,hE as O,i as k,iE as A,kc as j,o as M,pd as N,r as P,rE as be,ty as xe,vi as Se,vm as Ce,wm as we,wt as Te,xi as F,xk as Ee,xm as De,xt as I,yn as Oe,zi as ke}from"./loadAgentsDir-Ci5mr0vm.js";import{zt as L}from"./prompt-DEPUnJdB.js";import{f as Ae,l as je,t as Me}from"./commitAttribution-BFshsh2H.js";import{F as Ne,P as Pe}from"./teamHelpers-BmN9nKz-.js";import{n as R,r as Fe}from"./systemPromptSections-BcN_XBTx.js";import{r as Ie}from"./asciicast-o5Zg4dJt.js";import*as z from"path";import{dirname as Le}from"path";a(),Fe(),y(),M(),L(),T(),Ee(),je(),x(),ue(),d(),xe(),me(),re(),g(),h(),pe(),Pe(),A(),Te();function Re(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=be().safeParse(i.todos);return a.success?a.data:[]}return[]}function ze(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&de(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Me(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!Ne()&&e.messages&&e.messages.length>0){let r=Re(e.messages);if(r.length>0){let e=n();t(t=>({...t,todos:{...t.todos,[e]:r}}))}}}function Be(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return Ae(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t===`default`?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return l(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(l(r.agentType),!o()&&r.model&&r.model!==`inherit`&&te(ne(r.model)),{agentDefinition:r,agentType:r.agentType}):(u(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),l(void 0),{agentDefinition:void 0,agentType:void 0})}async function Ve(e,t,n,r){if(!e)return r;k.cache.clear?.();let i=await k(t),a=[...i.allAgents,...n];return{...i,allAgents:a,activeAgents:P(a)}}function H(e){let t=I();if(t){F(t);return}if(e){try{process.chdir(e.worktreePath)}catch{F(null);return}_(e.worktreePath),c(f()),p(e),E(),R(),v.cache.clear?.()}}function He(){let e=I();if(e){p(null),E(),R(),v.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}_(e.originalCwd),c(f())}}async function Ue(e,t,n){let r;if(r=n.modeApi?.matchSessionMode(e.mode),r&&e.messages.push(b(r,`warning`)),t.forkSession)e.contentReplacements?.length&&await C(e.contentReplacements);else{let n=t.sessionIdOverride??e.sessionId;n&&(ee(O(n),t.transcriptPath?Le(t.transcriptPath):null),await Ie(),await S(),Ce(n))}w(t.forkSession?{...e,worktreeSession:void 0}:e),t.forkSession||(H(e.worktreeSession),ye());let{agentDefinition:i,agentType:a}=V(e.agentSetting,n.mainThreadAgentDefinition,n.agentDefinitions);Se(n.modeApi?.isCoordinatorMode()?`coordinator`:`normal`);let o=t.includeAttribution?Be(e):void 0,s=B(e.agentName,e.agentColor);N(e.agentName);let c=await Ve(!!r,n.currentCwd,n.cliAgents,n.agentDefinitions);return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor===`default`?void 0:e.agentColor,restoredAgentDef:i,initialState:{...n.initialState,...a&&{agent:a},...o&&{attribution:o},...s&&{standaloneAgentContext:s},agentDefinitions:c}}}e(),a(),ve(),ce(),we(),j(),ae(),d(),oe(),Oe(),r();var We=1e3,Ge=500,Ke=300,qe=2e3,Je=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=i(),Z=null;async function Ye(){if(K||q)return;K=!0,J||(J=!0,_e(()=>{ge(),X.emit()}));let e=await Ze();e.length!==0&&(u(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=t.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??We,pollInterval:Z?.pollInterval??Ge},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Je,interval:Z?.chokidarInterval??qe,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=ie(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var Xe=X.subscribe;async function Ze(){let e=se(),t=[],n=m(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=m(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=m(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=m(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of s()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){u(`Detected skill change: ${e}`),le(`tengu_skill_file_changed`,{source:`chokidar`}),Qe(e)}function Qe(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),D(await he(`skills`,e[0]))){u(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}De(),ke(),fe(),X.emit()},Z?.reloadDebounce??Ke)}async function $e(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var et={initialize:Ye,dispose:Q,subscribe:Xe,resetForTesting:$e};export{V as a,Ue as i,B as n,ze as o,He as r,H as s,et as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./featureCheck-Cm0YNDXO.js";import"./instinctParser-DHMa8xa0.js";import"./skillGenerator-9y3Q4YoO.js";import{p as e}from"./runtimeObserver-Duod-ign.js";import{o as t}from"./observationStore-tvkldXUo.js";import{c as n}from"./projectContext-eXMSfgdZ.js";import"./sessionObserver-CuWMVPlT.js";import"./toolEventObserver-BqMplcIk.js";import"./skillGapStore-DpEoKhn-.js";import{t as r}from"./skillLearning-BhM09bQD.js";r();export{e as loadInstincts,t as readObservations,n as resolveProjectContext};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./teamHelpers-BmN9nKz-.js";e();export{t as cleanupSessionTeams};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./teammateModeSnapshot-CPjJJDL1.js";e();export{t as captureTeammateModeSnapshot};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{av as e,nv as t,rv as n,sv as r,uv as i}from"./loadAgentsDir-Ci5mr0vm.js";n();export{t as checkOutTeleportedSessionBranch,e as processMessagesForTeleportResume,r as teleportResumeCodeSession,i as validateGitState};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./thinkback-CrNirB0V.js";e();export{n as call,t as playAnimation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Dl as n,Ol as r,bl as i,yl as a}from"./paths-Q2255dD7.js";import{XC as o,ZC as s,cE as c,sE as l}from"./loadAgentsDir-Ci5mr0vm.js";import{s as u,u as d}from"./prompt-DEPUnJdB.js";function f(e){return h.some(t=>e.endsWith(t))}function p(e){return e.filter(e=>u.has(e.name)||f(e.name))}function m(e,t,n){let[a,o]=r(i([...e,...t],`name`),s),c=(e,t)=>e.name.localeCompare(t.name),l=[...o.sort(c),...a.sort(c)];return g&&g.isCoordinatorMode()?p(l):l}var h,g,_=t((()=>{n(),a(),d(),o(),h=[`subscribe_pr_activity`,`unsubscribe_pr_activity`],g=(c(),e(l))}));export{m as i,_ as n,f as r,p as t};
|