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
|
@@ -0,0 +1,11 @@
|
|
|
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-1ngPRtu3.js";import{L as p,V as ee,X as m,Y as h,d as g,h as te,p as ne,s as re}from"./debug-UI3T040K.js";import{F as _,P as ie}from"./git-CN3qtTb_.js";import{join as ae}from"node:path";import{appendFileSync as oe,existsSync as se,mkdirSync as ce}from"node:fs";import{homedir as le}from"node:os";import{randomUUID as v}from"crypto";var ue=e((()=>{})),de,fe=e((()=>{de={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`}})),pe=e((()=>{}));function me(e){return e}var he=e((()=>{})),ge=e((()=>{ue(),fe(),pe(),he()}));function _e(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function ve(e){if(process.env.OPENAI_MODEL)return process.env.OPENAI_MODEL;let t=e.replace(/\[1m\]$/,``),n=_e(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 ye[t]??t}var ye,be=e((()=>{ye={"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 xe(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function Se(){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 Ce(e){if(process.env.GROK_MODEL)return process.env.GROK_MODEL;let t=e.replace(/\[1m\]$/,``),n=xe(t),r=Se();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 y[t]?y[t]:n&&b[n]?b[n]:t}var y,b,we=e((()=>{y={"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`},b={opus:`grok-4.20-reasoning`,sonnet:`grok-3-mini-fast`,haiku:`grok-3-mini-fast`}}));function Te(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function Ee(e){if(process.env.GEMINI_MODEL)return process.env.GEMINI_MODEL;let t=e.replace(/\[1m\]$/i,``),n=Te(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 De=e((()=>{})),x,Oe=e((()=>{x=`_geminiThoughtSignature`}));function S(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function ke(e,t){let n=[],r=new Map;for(let t of e){if(t.type===`assistant`){let e=Ne(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=je(t,r);e.parts.length>0&&n.push(e)}}let i=Ae(t);return{contents:n,...i?{systemInstruction:{parts:[{text:i}]}}:{}}}function Ae(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
2
|
+
|
|
3
|
+
`)}function je(e,t){let n=e.message.content;return typeof n==`string`?{role:`user`,parts:C(n)}:Array.isArray(n)?{role:`user`,parts:n.flatMap(e=>Me(e,t))}:{role:`user`,parts:[]}}function Me(e,t){if(typeof e==`string`)return C(e);if(e.type===`text`)return C(e.text);if(e.type===`tool_result`){let n=e;return[{functionResponse:{name:t.get(n.tool_use_id)??n.tool_use_id,response:Ie(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 C(`[image: ${t.url}]`)}return[]}function Ne(e){let t=e.message.content;if(typeof t==`string`)return{role:`model`,parts:C(t)};if(!Array.isArray(t))return{role:`model`,parts:[]};let n=[];for(let e of t){if(typeof e==`string`){n.push(...C(e));continue}if(e.type===`text`){n.push(...C(e.text,Re(e)));continue}if(e.type===`thinking`){let t=Pe(e.thinking,e.signature);t&&n.push(t);continue}if(e.type===`tool_use`){let t=e;n.push({functionCall:{name:t.name,args:Fe(t.input)},...Re(e)&&{thoughtSignature:Re(e)}})}}return{role:`model`,parts:n}}function C(e,t){return typeof e!=`string`||e.length===0?[]:[{text:e,...t&&{thoughtSignature:t}}]}function Pe(e,t){if(!(typeof e!=`string`||e.length===0))return{text:e,thought:!0,...t&&{thoughtSignature:t}}}function Fe(e){if(typeof e==`string`){let t=S(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 Ie(e){let t=Le(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 Le(e){if(typeof e==`string`)return S(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 S(t)??t}return e??``}function Re(e){let t=e[x];return typeof t==`string`&&t.length>0?t:void 0}var ze=e((()=>{Oe()}));function Be(e){if(typeof e==`string`)return T.has(e)?e:void 0;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`&&T.has(e)),n=Array.from(new Set(t));return n.length===0?void 0:n.length===1?n[0]:n}}function Ve(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 He(e){let t=e.map(Ve).filter(e=>e!==void 0),n=Array.from(new Set(t));if(n.length!==0)return n.length===1?n[0]:n}function Ue(e){return e===void 0?[`null`]:Array.isArray(e)?e.includes(`null`)?e:[...e,`null`]:e===`null`?e:[e,`null`]}function We(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=Object.entries(e).map(([e,t])=>[e,w(t)]).filter(([,e])=>Object.keys(e).length>0);if(t.length!==0)return Object.fromEntries(t)}function Ge(e){if(!Array.isArray(e))return;let t=e.map(e=>w(e)).filter(e=>Object.keys(e).length>0);return t.length>0?t:void 0}function w(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n={},r=Be(t.type);t.const===void 0?Array.isArray(t.enum)&&t.enum.length>0&&(n.enum=t.enum,r=r??He(t.enum)):(n.enum=[t.const],r=r??Ve(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=Ue(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=We(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=w(t.additionalProperties);Object.keys(e).length>0&&(n.additionalProperties=e)}let a=w(t.items);Object.keys(a).length>0&&(n.items=a);let o=Ge(t.prefixItems);o&&(n.prefixItems=o);let s=Ge(t.anyOf??t.oneOf);return s&&(n.anyOf=s),n}function Ke(e){let t=w(e);return Object.keys(t).length>0?t:{type:`object`,properties:{}}}function qe(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:Ke(t.input_schema??{type:`object`,properties:{}})}});return t.length>0?[{functionDeclarations:t}]:[]}function Je(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 T,Ye=e((()=>{T=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`,`null`])}));async function*Xe(e,t){let n=`msg_${v().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_${v().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=Ze(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:Qe(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 Ze(e){return typeof e.text==`string`?e.thought?`thinking`:`text`:null}function Qe(e,t){switch(e){case`MAX_TOKENS`:return`max_tokens`;default:return t?`tool_use`:`end_turn`}}var $e=e((()=>{}));function E(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=at.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 et(e){let t=E(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 D(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 tt(e){let t=e.message;return t?D(t):``}function nt(e){return typeof e==`object`&&!!e&&`error`in e&&typeof e.error==`object`&&e.error!==null}function rt(e){if(!nt(e))return null;let t=e.error,n=t?.error?.message;if(typeof n==`string`&&n.length>0){let e=D(n);if(e.length>0)return e}let r=t?.message;if(typeof r==`string`&&r.length>0){let e=D(r);if(e.length>0)return e}return null}function it(e){let t=E(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 rt(e)??`API error (status ${e.status??`unknown`})`;let n=tt(e);return n!==e.message&&n.length>0?n:e.message}var at,ot=e((()=>{at=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 st(e,t,n){let r=[],i=ct(t);i&&r.push({role:`system`,content:i});for(let t of e)switch(t.type){case`user`:r.push(...lt(t));break;case`assistant`:r.push(...dt(t));break;default:break}return r}function ct(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
5
|
+
|
|
6
|
+
`)}function lt(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=ft(t);e&&i.push(e)}for(let e of r)t.push(ut(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 ut(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 dt(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 ft(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 pt=e((()=>{}));function mt(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:O(i||{type:`object`,properties:{}})}}})}function O(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`?O(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]=O(n))}for(let e of[`anyOf`,`oneOf`,`allOf`]){let n=t[e];Array.isArray(n)&&(t[e]=n.map(e=>e&&typeof e==`object`?O(e):e))}return t}function ht(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 gt=e((()=>{}));async function*_t(e,t){let n=`msg_${v().replace(/-/g,``).slice(0,24)}`,r=!1,i=-1,a=new Map,o=!1,s=!1,c=0,l=0,u=0,d=0,f=new Set,p=null,ee=!1;for await(let m of e){let e=m.choices?.[0],h=e?.delta;if(m.usage){c=m.usage.prompt_tokens??c;let e=m.usage.prompt_tokens_details?.cached_tokens??d;l=Math.max(0,c-e),u=m.usage.completion_tokens??u,d=e}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:l,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:d}}}),!h)continue;let g=h.reasoning_content;if(g!=null&&(o||(i++,o=!0,f.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},f.delete(i),o=!1),i++,s=!0,f.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},f.delete(i),o=!1),s&&(yield{type:`content_block_stop`,index:i},f.delete(i),s=!1),i++;let n=e.id||`toolu_${v().replace(/-/g,``).slice(0,24)}`,r=e.function?.name||``;a.set(t,{contentIndex:i,id:n,name:r,arguments:``}),f.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},f.delete(i),o=!1),s&&(yield{type:`content_block_stop`,index:i},f.delete(i),s=!1);for(let[,e]of a)f.has(e.contentIndex)&&(yield{type:`content_block_stop`,index:e.contentIndex},f.delete(e.contentIndex));p=e.finish_reason,ee=a.size>0}}for(let e of f)yield{type:`content_block_stop`,index:e};p!==null&&(yield{type:`message_delta`,delta:{stop_reason:p===`length`?`max_tokens`:ee?`tool_use`:vt(p),stop_sequence:null},usage:{input_tokens:l,output_tokens:u,cache_read_input_tokens:d,cache_creation_input_tokens:0}},yield{type:`message_stop`})}function vt(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 yt=e((()=>{})),bt=e((()=>{ge(),be(),we(),De(),ze(),Ye(),$e(),Oe(),ot(),pt(),gt(),yt()}));function k(e){a()&&(A.length>=Ct&&A.shift(),A.push(e))}function xt(){return A.length===0?[]:A.splice(0).map(e=>({...e,uuid:v(),session_id:i()}))}function St(e,t,n){k({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 Ct,A,wt=e((()=>{s(),Ct=1e3,A=[]}));function Tt(){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 g(`CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${t}`,{level:`error`}),o(null),null;try{let e=ne(),t=process.platform===`darwin`||process.platform===`freebsd`?`/dev/fd/${n}`:`/proc/self/fd/${n}`,r=e.readFileSync(t,{encoding:`utf8`}).trim();return r?(g(`Successfully read token from file descriptor ${n}`),o(r),u(l,r,`session ingress token`),r):(g(`File descriptor contained empty token`,{level:`error`}),o(null),null)}catch(e){g(`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 Et(){return process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||Tt()}function Dt(){let e=Et();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 Ot(e){process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN=e}var kt=e((()=>{s(),f(),re(),ee(),te()})),At=t({activateProactive:()=>jt,deactivateProactive:()=>Mt,getActivationSource:()=>Bt,getNextTickAt:()=>zt,isContextBlocked:()=>Lt,isProactiveActive:()=>M,isProactivePaused:()=>Nt,pauseProactive:()=>Pt,resumeProactive:()=>Ft,setContextBlocked:()=>It,setNextTickAt:()=>Rt,shouldTick:()=>Ht,subscribeToProactiveChanges:()=>Vt});function j(){for(let e of R)try{e()}catch{}}function M(){return N}function jt(e){N||(N=!0,P=!1,F=!1,L=e,j())}function Mt(){N&&(N=!1,P=!1,F=!1,I=null,L=void 0,j())}function Nt(){return P}function Pt(){!N||P||(P=!0,I=null,j())}function Ft(){!N||!P||(P=!1,j())}function It(e){F!==e&&(F=e,e&&(I=null),j())}function Lt(){return F}function Rt(e){I=e,j()}function zt(){return!N||P||F?null:I}function Bt(){return L}function Vt(e){return R.add(e),()=>{R.delete(e)}}function Ht(){return N&&!P&&!F}var N,P,F,I,L,R,Ut=e((()=>{N=!1,P=!1,F=!1,I=null,R=new Set}));function Wt(e){B=e}function Gt(e,t){if(V=e,!e||!t?.replayCurrent)return;let n=Xt();Object.keys(n).length!==0&&e(n)}function Kt(e){H=e}function qt(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 Jt(e){return JSON.stringify(e)}function Yt(e){let t={...G};for(let n of Object.keys(e)){let r=e[n];if(r===void 0){delete t[n];continue}t[n]=r}G=t}function Xt(){let e={...G};return W?e.automation_state={...W}:`automation_state`in G&&(e.automation_state=G.automation_state??null),e}function Zt(){return tn}function Qt(e,t){tn=e,B?.(e,t),e===`requires_action`&&t?(U=!0,z({pending_action:t})):U&&(U=!1,z({pending_action:null})),e===`idle`&&z({task_summary:null}),e!==`idle`&&$t(M()?{enabled:!0,phase:null,next_tick_at:null,sleep_until:null}:null),r(process.env.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS)&&k({type:`system`,subtype:`session_state_changed`,state:e})}function z(e){Yt(e),V?.(e)}function $t(e){let t=qt(e);Jt(t)!==Jt(W)&&(W=t,Yt({automation_state:t}),V?.({automation_state:t}))}function en(e){H?.(e)}var B,V,H,U,tn,W,G,nn=e((()=>{Ut(),n(),wt(),B=null,V=null,H=null,U=!1,tn=`idle`,W=null,G={}}));function rn(){on(),X=setInterval(()=>{_(`debug`,`session_keepalive_heartbeat`,{refcount:q}),r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&K?.()},pn)}function an(){on(),K!==null&&(Z=setTimeout(()=>{_(`info`,`session_idle_30s`),Z=null},pn))}function on(){Z!==null&&(clearTimeout(Z),Z=null)}function sn(e){K=e,q>0&&X===null&&rn()}function cn(){K=null,X!==null&&(clearInterval(X),X=null),on()}function ln(){r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&K?.()}function un(){return K!==null}function dn(e){q++,J.set(e,(J.get(e)??0)+1),q===1&&(Y=Date.now(),K!==null&&X===null&&rn()),mn||(mn=!0,m(async()=>{_(`info`,`session_activity_at_shutdown`,{refcount:q,active:Object.fromEntries(J),oldest_activity_ms:q>0&&Y!==null?Date.now()-Y:null})}))}function fn(e){q>0&&q--;let t=(J.get(e)??0)-1;t>0?J.set(e,t):J.delete(e),q===0&&X!==null&&(clearInterval(X),X=null,an())}var pn,K,q,J,Y,X,Z,mn,hn=e((()=>{h(),ie(),n(),pn=3e4,K=null,q=0,J=new Map,Y=null,X=null,Z=null,mn=!1}));function gn(){let e=ae(le(),`.claude`);se(e)||ce(e,{recursive:!0})}function _n(e){try{$||(gn(),oe(Q,`\n===== RC-DEBUG session ${new Date().toISOString()} =====\n`),$=!0),oe(Q,`[${new Date().toISOString().slice(11,23)}] ${e}\n`)}catch{}}var Q,$,vn=e((()=>{Q=ae(le(),`.claude`,`rc-debug.log`),$=!1}));export{xt as A,it as B,At as C,Et as D,Dt as E,_t as F,ke as G,Xe as H,ht as I,Ce as J,x as K,mt as L,k as M,wt as N,kt as O,bt as P,st as R,Nt as S,Ht as T,Je as U,et as V,qe as W,me as X,ve as Y,de as Z,Gt as _,sn as a,Lt as b,fn as c,nn as d,$t as f,Kt as g,Qt as h,un as i,St as j,Ot as k,cn as l,z as m,_n as n,ln as o,en as p,Ee as q,hn as r,dn as s,vn as t,Zt as u,Wt as v,Rt as w,M as x,Ut as y,E as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{H as i,M as a,Rn as o,nt as s,t as c}from"./src-Di342QoJ.js";import{Ac as l,Pc as u,Sc as d,Zt as f,dn as p,on as m,tn as h}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{H as i,M as a,Rn as o,nt as s,t as c}from"./src-Di342QoJ.js";import{Ac as l,Pc as u,Sc as d,Zt as f,dn as p,on as m,tn as h}from"./paths-1ngPRtu3.js";import{d as g,s as _}from"./debug-UI3T040K.js";import{l as v,u as y}from"./oauth-CdZEzMww.js";import{d as b,f as x,o as S,s as C}from"./log-CzsijfHZ.js";import{a as w,l as T,o as E}from"./api-D_t0nHsS.js";import{t as D}from"./useKeybinding-FsOnjW6T.js";var O=e((()=>{c()}));function k(e,t,n,r=!0){let{exit:o}=i(),[s,c]=(0,A.useState)({pending:!1,keyName:null}),l=(0,A.useMemo)(()=>n??o,[n,o]),u=a(e=>c({pending:e,keyName:`Ctrl-C`}),l),d=a(e=>c({pending:e,keyName:`Ctrl-D`}),l),f=(0,A.useCallback)(()=>{t?.()||u()},[u,t]),p=(0,A.useCallback)(()=>{d()},[d]);return e((0,A.useMemo)(()=>({"app:interrupt":f,"app:exit":p}),[f,p]),{context:`Global`,isActive:r}),s}var A,j=e((()=>{A=t(o(),1),c(),O()}));function M(e,t,n){return k(s,t,e,n)}var N=e((()=>{D(),j()}));async function P(e=`claude_code_guest_pass`){let{accessToken:t,orgUUID:r}=await T(),i={...w(t),"x-organization-uuid":r},a=`${v().BASE_API_URL}/api/oauth/organizations/${r}/referral/eligibility`;return(await n.get(a,{headers:i,params:{campaign:e},timeout:5e3})).data}async function F(e=`claude_code_guest_pass`){let{accessToken:t,orgUUID:r}=await T(),i={...w(t),"x-organization-uuid":r},a=`${v().BASE_API_URL}/api/oauth/organizations/${r}/referral/redemptions`;return(await n.get(a,{headers:i,params:{campaign:e},timeout:1e4})).data}function I(){return!!(f()?.organizationUuid&&p()&&h()===`max`)}function L(){if(!I())return{eligible:!1,needsRefresh:!1,hasCache:!1};let e=f()?.organizationUuid;if(!e)return{eligible:!1,needsRefresh:!1,hasCache:!1};let t=d().passesEligibilityCache?.[e];if(!t)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:n,timestamp:r}=t;return{eligible:n,needsRefresh:Date.now()-r>W,hasCache:!0}}function R(e){let t=K[e.currency]??`${e.currency} `,n=e.amount_minor_units/100;return`${t}${n%1==0?n.toString():n.toFixed(2)}`}function z(){let e=f()?.organizationUuid;return e?d().passesEligibilityCache?.[e]?.referrer_reward??null:null}function B(){let e=f()?.organizationUuid;return e?d().passesEligibilityCache?.[e]?.remaining_passes??null:null}async function V(){if(G)return g(`Passes: Reusing in-flight eligibility fetch`),G;let e=f()?.organizationUuid;return e?(G=(async()=>{try{let t=await P(),n={...t,timestamp:Date.now()};return u(t=>({...t,passesEligibilityCache:{...t.passesEligibilityCache,[e]:n}})),g(`Passes eligibility cached for org ${e}: ${t.eligible}`),t}catch(e){return g(`Failed to fetch and cache passes eligibility`),C(e),null}finally{G=null}})(),G):null}async function H(){if(!I())return null;let e=f()?.organizationUuid;if(!e)return null;let t=d().passesEligibilityCache?.[e],n=Date.now();if(!t)return g(`Passes: No cache, fetching eligibility in background (command unavailable this session)`),V(),null;if(n-t.timestamp>W){g(`Passes: Cache stale, returning cached data and refreshing in background`),V();let{timestamp:e,...n}=t;return n}g(`Passes: Using fresh cached eligibility data`);let{timestamp:r,...i}=t;return i}async function U(){x()||H()}var W,G,K,q=e((()=>{r(),y(),m(),l(),_(),S(),b(),E(),W=1440*60*1e3,G=null,K={USD:`$`,EUR:`€`,GBP:`£`,BRL:`R$`,CAD:`CA$`,AUD:`A$`,NZD:`NZ$`,SGD:`S$`}}));export{z as a,U as c,O as d,H as i,N as l,F as n,B as o,R as r,q as s,L as t,M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{cn as t,ot as n}from"./state-sIHsFpDu.js";import{L as r,V as i,d as a,s as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{cn as t,ot as n}from"./state-sIHsFpDu.js";import{L as r,V as i,d as a,s as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{Av as l,Cc as u,Ew as d,Ip as f,Pp as p,Sc as m,Tw as h,fs as g,gh as _,i as v,jv as y,lc as b,mh as x,o as S,ps as C,uc as w,vh as T,yh as E}from"./loadAgentsDir-D7kapZB5.js";async function D(e){a(`refreshActivePlugins: clearing all plugin caches`),b(),p();let t=await C(),[i,o]=await Promise.all([m(),v(n())]),{enabled:s,disabled:l,errors:u}=t,[f,h]=await Promise.all([Promise.all(s.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await d(e,u);return t&&(e.mcpServers=t),t?Object.keys(t).length:0})),Promise.all(s.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await E(e,u);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))]),g=f.reduce((e,t)=>e+t,0),x=h.reduce((e,t)=>e+t,0);e(e=>({...e,plugins:{...e.plugins,enabled:s,disabled:l,commands:i,errors:O(e.plugins.errors,u),needsRefresh:!1},agentDefinitions:o,mcp:{...e.mcp,pluginReconnectKey:e.mcp.pluginReconnectKey+1}})),_();let S=!1;try{await y()}catch(e){S=!0,c(e),a(`refreshActivePlugins: loadPluginHooks failed: ${r(e)}`)}let w=s.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return a(`refreshActivePlugins: ${s.length} enabled, ${i.length} commands, ${o.allAgents.length} agents, ${w} hooks, ${g} MCP, ${x} LSP`),{enabled_count:s.length,disabled_count:l.length,command_count:i.length,agent_count:o.allAgents.length,hook_count:w,mcp_count:g,lsp_count:x,error_count:u.length+ +!!S,agentDefinitions:o,pluginCommands:i}}function O(e,t){let n=e.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r=new Set(t.map(k));return[...n.filter(e=>!r.has(k(e))),...t]}function k(e){return e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`}var A=e((()=>{t(),x(),S(),o(),i(),s(),w(),u(),l(),T(),h(),f(),g()}));export{D as n,A as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{Ka as i,S as a,_ as o,oo as s}from"./paths-
|
|
1
|
+
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{Ka as i,S as a,_ as o,oo as s}from"./paths-1ngPRtu3.js";import{R as c,V as l,d as u,s as d}from"./debug-UI3T040K.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{n as m,t as h}from"./which-DqSAIvp2.js";import{r as g,t as _}from"./execFileNoThrow-CuQN1sz8.js";import{a as v,r as y,t as b}from"./xdg-CBxMmQux.js";import{n as x,t as S}from"./sanitization-CYp-9DbE.js";import*as C from"os";import*as w from"path";import{promises as T}from"fs";function E(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function D(e){let t=e.startsWith(`claude-cli://`)?e:e.startsWith(`claude-cli:`)?e.replace(`${O}:`,`${O}://`):null;if(!t)throw Error(`Invalid deep link: expected ${O}:// scheme, got "${e}"`);let n;try{n=new URL(t)}catch{throw Error(`Invalid deep link URL: "${e}"`)}if(n.hostname!==`open`)throw Error(`Unknown deep link action: "${n.hostname}"`);let r=n.searchParams.get(`cwd`)??void 0,i=n.searchParams.get(`repo`)??void 0,a=n.searchParams.get(`q`);if(r&&!r.startsWith(`/`)&&!/^[a-zA-Z]:[/\\]/.test(r))throw Error(`Invalid cwd in deep link: must be an absolute path, got "${r}"`);if(r&&E(r))throw Error(`Deep link cwd contains disallowed control characters`);if(r&&r.length>j)throw Error(`Deep link cwd exceeds ${j} characters (got ${r.length})`);if(i&&!k.test(i))throw Error(`Invalid repo in deep link: expected "owner/repo", got "${i}"`);let o;if(a&&a.trim().length>0){if(o=x(a.trim()),E(o))throw Error(`Deep link query contains disallowed control characters`);if(o.length>A)throw Error(`Deep link query exceeds ${A} characters (got ${o.length})`)}return{query:o,cwd:r,repo:i}}var O,k,A,j,M=e((()=>{S(),O=`claude-cli`,k=/^[\w.-]+\/[\w.-]+$/,A=5e3,j=4096})),N=t({MACOS_BUNDLE_ID:()=>W,ensureDeepLinkProtocolRegistered:()=>U,isProtocolHandlerCurrent:()=>H,registerProtocolHandler:()=>B});function P(){return w.join(y(),`applications`,K)}function F(e){return`Exec="${e}" --handle-uri %u`}function I(e){return`"${e}" --handle-uri "%1"`}async function L(e){let t=w.join(q,`Contents`);try{await T.rm(q,{recursive:!0})}catch(e){if(c(e)!==`ENOENT`)throw e}await T.mkdir(w.dirname(J),{recursive:!0});let n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
3
|
<plist version="1.0">
|
|
4
4
|
<dict>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cd as e,Dd as t,Ed as n,Od as r,Sd as i,Td as a,_d as o,bd as s,gd as c,hd as l,md as u,vd as d,wd as f,xd as p,yd as m}from"./loadAgentsDir-
|
|
1
|
+
import{Cd as e,Dd as t,Ed as n,Od as r,Sd as i,Td as a,_d as o,bd as s,gd as c,hd as l,md as u,vd as d,wd as f,xd as p,yd as m}from"./loadAgentsDir-D7kapZB5.js";i();export{u as detectAndGetBackend,l as ensureBackendsRegistered,c as getBackendByType,o as getCachedBackend,d as getCachedDetectionResult,m as getInProcessBackend,s as getResolvedTeammateMode,p as getTeammateExecutor,e as isInProcessEnabled,f as markInProcessFallback,a as registerITermBackend,n as registerTmuxBackend,t as registerWindowsTerminalBackend,r as resetBackendDetection};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{a as t,c as n,i as r,o as i,t as a}from"./releaseNotes-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{a as t,c as n,i as r,o as i,t as a}from"./releaseNotes-CvfZb3fZ.js";function o(e){return e.map(([e,t])=>`${`Version ${e}:`}\n${t.map(e=>`· ${e}`).join(`
|
|
2
2
|
`)}`).join(`
|
|
3
3
|
|
|
4
4
|
`)}async function s(){let e=[];try{let n=new Promise((e,t)=>{setTimeout(e=>e(Error(`Timeout`)),500,t)});await Promise.race([r(),n]),e=t(await i())}catch{}if(e.length>0)return{type:`text`,value:o(e)};let n=t(await i());return n.length>0?{type:`text`,value:o(n)}:{type:`text`,value:`See the full changelog at: ${a}`}}e((()=>{n()}))();export{s as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{t as r}from"./semver-Cq33BYay.js";import{n as i,t as a}from"./axios-DhfaybwJ.js";import{U as o,cn as s}from"./state-sIHsFpDu.js";import{Ac as c,Pc as l,Sc as u}from"./paths-
|
|
2
|
-
`);if(n.length===0)continue;let r=n[0];if(!r)continue;let i=r.split(` - `)[0]?.trim()||``;if(!i)continue;let a=n.slice(1).filter(e=>e.trim().startsWith(`- `)).map(e=>e.trim().substring(2).trim()).filter(Boolean);a.length>0&&(t[i]=a)}return t}catch(e){return g(d(e)),{}}}function A(e,t,n=O()){try{let r=k(n),i=(0,P.coerce)(e),a=t?(0,P.coerce)(t):null;if(!a||i&&v(i.version,a.version))return Object.entries(r).filter(([e])=>!a||v(e,a.version)).sort(([e],[t])=>v(e,t)?-1:1).flatMap(([e,t])=>t).filter(Boolean).slice(0,F)}catch(e){return g(d(e)),[]}return[]}function j(e=O()){try{let t=k(e);return Object.keys(t).sort((e,t)=>v(e,t)?1:-1).map(e=>{let n=t[e];if(!n||n.length===0)return null;let r=n.filter(Boolean);return r.length===0?null:[e,r]}).filter(e=>e!==null)}catch(e){return g(d(e)),[]}}async function M(e,t=`2.6.
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{t as r}from"./semver-Cq33BYay.js";import{n as i,t as a}from"./axios-DhfaybwJ.js";import{U as o,cn as s}from"./state-sIHsFpDu.js";import{Ac as c,Pc as l,Sc as u}from"./paths-1ngPRtu3.js";import{K as d,V as f}from"./debug-UI3T040K.js";import{d as p,f as m,o as h,s as g}from"./log-CzsijfHZ.js";import{r as _,t as v}from"./semver-Tw0AFar5.js";import{dirname as y,join as b}from"path";import{mkdir as x,readFile as S,writeFile as C}from"fs/promises";function w(){return b(t(),`cache`,`changelog.md`)}async function T(){let e=u();if(!e.cachedChangelog)return;let t=w();try{await x(y(t),{recursive:!0}),await C(t,e.cachedChangelog,{encoding:`utf-8`,flag:`wx`})}catch{}l(({cachedChangelog:e,...t})=>t)}async function E(){if(o()||m())return;let e=await i.get(L);if(e.status===200){let t=e.data;if(t===R)return;let n=w();await x(y(n),{recursive:!0}),await C(n,t,{encoding:`utf-8`}),R=t;let r=Date.now();l(e=>({...e,changelogLastFetched:r}))}}async function D(){if(R!==null)return R;let e=w();try{let t=await S(e,`utf-8`);return R=t,t}catch{return R=``,``}}function O(){return R??``}function k(e){try{if(!e)return{};let t={},n=e.split(/^## /gm).slice(1);for(let e of n){let n=e.trim().split(`
|
|
2
|
+
`);if(n.length===0)continue;let r=n[0];if(!r)continue;let i=r.split(` - `)[0]?.trim()||``;if(!i)continue;let a=n.slice(1).filter(e=>e.trim().startsWith(`- `)).map(e=>e.trim().substring(2).trim()).filter(Boolean);a.length>0&&(t[i]=a)}return t}catch(e){return g(d(e)),{}}}function A(e,t,n=O()){try{let r=k(n),i=(0,P.coerce)(e),a=t?(0,P.coerce)(t):null;if(!a||i&&v(i.version,a.version))return Object.entries(r).filter(([e])=>!a||v(e,a.version)).sort(([e],[t])=>v(e,t)?-1:1).flatMap(([e,t])=>t).filter(Boolean).slice(0,F)}catch(e){return g(d(e)),[]}return[]}function j(e=O()){try{let t=k(e);return Object.keys(t).sort((e,t)=>v(e,t)?1:-1).map(e=>{let n=t[e];if(!n||n.length===0)return null;let r=n.filter(Boolean);return r.length===0?null:[e,r]}).filter(e=>e!==null)}catch(e){return g(d(e)),[]}}async function M(e,t=`2.6.6`){if(process.env.USER_TYPE===`ant`)return{hasReleaseNotes:!1,releaseNotes:[]};let n=await D();(e!==t||!n)&&E().catch(e=>g(d(e)));let r=A(t,e,n);return{hasReleaseNotes:r.length>0,releaseNotes:r}}function N(e,t=`2.6.6`){if(process.env.USER_TYPE===`ant`)return{hasReleaseNotes:!1,releaseNotes:[]};let n=A(t,e);return{hasReleaseNotes:n.length>0,releaseNotes:n}}var P,F,I,L,R,z=e((()=>{a(),P=r(),s(),c(),n(),f(),h(),p(),_(),F=5,I=`https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md`,L=`https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md`,R=null}));export{j as a,z as c,E as i,T as l,M as n,D as o,N as r,O as s,I as t,k as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{s as t}from"./envUtils-BWeoiL4Y.js";import{cn as n}from"./state-sIHsFpDu.js";import{Po as r,jo as i}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{s as t}from"./envUtils-BWeoiL4Y.js";import{cn as n}from"./state-sIHsFpDu.js";import{Po as r,jo as i}from"./paths-1ngPRtu3.js";import{mA as a}from"./loadAgentsDir-D7kapZB5.js";import{t as o}from"./settingsSync-DEPET5O1.js";import{n as s,t as c}from"./refresh-Cjv4jA6L.js";function l(e,t){return`${e} ${r(e,t)}`}var u;e((()=>{n(),o(),t(),c(),a(),i(),u=async(e,t)=>{let n=await s(t.setAppState),r=`Reloaded: ${[l(n.enabled_count,`plugin`),l(n.command_count,`skill`),l(n.agent_count,`agent`),l(n.hook_count,`hook`),l(n.mcp_count,`plugin MCP server`),l(n.lsp_count,`plugin LSP server`)].join(` · `)}`;return n.error_count>0&&(r+=`\n${l(n.error_count,`error`)} during load. Run /doctor for details.`),{type:`text`,value:r}}}))();export{u as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{In as i,Ln as a,Rn as o,b as s,f as c,g as l,h as u,l as d,t as f,tt as p}from"./src-Di342QoJ.js";import{t as m}from"./jsx-runtime-D-D469L8.js";import{Qa as h,Ys as g,ec as _,lo as v,nc as y,no as b,oo as x}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{In as i,Ln as a,Rn as o,b as s,f as c,g as l,h as u,l as d,t as f,tt as p}from"./src-Di342QoJ.js";import{t as m}from"./jsx-runtime-D-D469L8.js";import{Qa as h,Ys as g,ec as _,lo as v,nc as y,no as b,oo as x}from"./paths-1ngPRtu3.js";import{K as S,V as C}from"./debug-UI3T040K.js";import{o as w,s as T}from"./log-CzsijfHZ.js";import{Ax as E,XS as D,ZS as O,kx as k,nE as A,tE as j}from"./loadAgentsDir-D7kapZB5.js";import{t as M}from"./useKeybinding-FsOnjW6T.js";async function N(){let e=await j();if(e.length===0)return{availableEnvironments:[],selectedEnvironment:null,selectedEnvironmentSource:null};let t=b()?.remote?.defaultEnvironmentId,n=e.find(e=>e.kind!==`bridge`)??e[0],r=null;if(t){let i=e.find(e=>e.environment_id===t);if(i){n=i;for(let e=g.length-1;e>=0;e--){let n=g[e];if(!(!n||n===`flagSettings`)&&h(n)?.remote?.defaultEnvironmentId===t){r=n;break}}}}return{availableEnvironments:e,selectedEnvironment:n,selectedEnvironmentSource:r}}var P=e((()=>{y(),x(),A()}));function F({onDone:e}){let[t,n]=(0,z.useState)(`loading`),[r,a]=(0,z.useState)([]),[o,l]=(0,z.useState)(null),[u,f]=(0,z.useState)(null),[p,m]=(0,z.useState)(null);(0,z.useEffect)(()=>{let e=!1;async function t(){try{let t=await N();if(e)return;a(t.availableEnvironments),l(t.selectedEnvironment),f(t.selectedEnvironmentSource),n(null)}catch(t){if(e)return;let r=S(t);T(r),m(r.message),n(null)}}return t(),()=>{e=!0}},[]);function h(t){if(t===`cancel`){e();return}n(`updating`);let a=r.find(e=>e.environment_id===t);if(!a){e(`Error: Selected environment not found`);return}v(`localSettings`,{remote:{defaultEnvironmentId:a.environment_id}}),e(`Set default remote environment to ${i.bold(a.name)} (${a.environment_id})`)}return t===`loading`?(0,B.jsx)(c,{title:V,onCancel:e,hideInputGuide:!0,children:(0,B.jsx)(d,{message:`Loading environments…`})}):p?(0,B.jsx)(c,{title:V,onCancel:e,children:(0,B.jsxs)(s,{color:`error`,children:[`Error: `,p]})}):o?r.length===1?(0,B.jsx)(L,{environment:o,onDone:e}):(0,B.jsx)(R,{environments:r,selectedEnvironment:o,selectedEnvironmentSource:u,loadingState:t,onSelect:h,onCancel:e}):(0,B.jsx)(c,{title:V,subtitle:H,onCancel:e,children:(0,B.jsx)(s,{children:`No remote environments available.`})})}function I({environment:e}){return(0,B.jsxs)(s,{children:[r.tick,` Using `,(0,B.jsx)(s,{bold:!0,children:e.name}),` `,(0,B.jsxs)(s,{dimColor:!0,children:[`(`,e.environment_id,`)`]})]})}function L({environment:e,onDone:t}){return p(`confirm:yes`,t,{context:`Confirmation`}),(0,B.jsx)(c,{title:V,subtitle:H,onCancel:t,children:(0,B.jsx)(I,{environment:e})})}function R({environments:e,selectedEnvironment:t,selectedEnvironmentSource:n,loadingState:r,onSelect:i,onCancel:a}){let o=n&&n!==`localSettings`?` (from ${_(n)} settings)`:``;return(0,B.jsxs)(c,{title:V,subtitle:(0,B.jsxs)(s,{children:[`Currently using: `,(0,B.jsx)(s,{bold:!0,children:t.name}),o]}),onCancel:a,hideInputGuide:!0,children:[(0,B.jsx)(s,{dimColor:!0,children:H}),r===`updating`?(0,B.jsx)(d,{message:`Updating…`}):(0,B.jsx)(k,{options:e.map(e=>({label:(0,B.jsxs)(s,{children:[e.name,` `,(0,B.jsxs)(s,{dimColor:!0,children:[`(`,e.environment_id,`)`]})]}),value:e.environment_id})),defaultValue:t.environment_id,onChange:i,onCancel:()=>i(`cancel`),layout:`compact-vertical`}),(0,B.jsx)(s,{dimColor:!0,children:(0,B.jsxs)(u,{children:[(0,B.jsx)(l,{shortcut:`Enter`,action:`select`}),(0,B.jsx)(D,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})}var z,B,V,H,U=e((()=>{a(),n(),o(),z=t(o(),1),f(),M(),C(),w(),y(),x(),P(),O(),E(),B=m(),V=`Select Remote Environment`,H=`Configure environments at: https://claude.ai/code`}));async function W(e){return(0,G.jsx)(F,{onDone:e})}var G;e((()=>{o(),U(),G=m()}))();export{W as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{E as i,L as a,V as o,X as s,Y as c,d as l,s as u,w as d}from"./debug-UI3T040K.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{F as m,P as h}from"./git-CN3qtTb_.js";import{n as g,t as _}from"./sleep-8Eb9j_Ly.js";import{_ as ee,d as v}from"./rcDebugLog-BbPkkigY.js";import{c as y,d as b,i as x,o as S,s as C}from"./debugUtils-BBMFODKH.js";import{a as w,i as T}from"./trustedDevice-C9Zevohz.js";import{a as E,r as D}from"./bridgeConfig-CJ-KznTS.js";import{t as te}from"./jwtUtils-CpXwh_du.js";import{t as O}from"./workSecret-mS2OrpxF.js";import{i as k,r as ne}from"./envLessBridgeConfig-Ju4W58xf.js";import{a as A,c as j,i as re,n as ie,o as M,r as ae,s as oe,t as N}from"./bridgeMessaging-BiE0CTqq.js";import{r as P,t as se}from"./flushGate-C2Icy43G.js";t(),f(),c(),h(),_(),y(),w(),v(),k(),r(),u(),o(),d(),S();var F=`2023-06-01`;function I(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":F}}async function ce(e,t,r,o,s){let c=`${e}/v1/code/sessions`,u;try{u=await n.post(c,{title:r,bridge:{},...s?.length?{tags:s}:{}},{headers:I(t),timeout:o,validateStatus:e=>e<500})}catch(e){return l(`[code-session] Session create request failed: ${a(e)}`),null}if(u.status!==200&&u.status!==201){let e=x(u.data);return l(`[code-session] Session create failed ${u.status}${e?`: ${e}`:``}`),null}let d=u.data;return!d||typeof d!=`object`||!(`session`in d)||!d.session||typeof d.session!=`object`||!(`id`in d.session)||typeof d.session.id!=`string`||!d.session.id.startsWith(`cse_`)?(l(`[code-session] No session.id (cse_*) in response: ${i(d).slice(0,200)}`),null):d.session.id}async function L(e,t,r,o,s){let c=`${t}/v1/code/sessions/${e}/bridge`,u=I(r);s&&(u[`X-Trusted-Device-Token`]=s);let d;try{d=await n.post(c,{},{headers:u,timeout:o,validateStatus:e=>e<500})}catch(e){return l(`[code-session] /bridge request failed: ${a(e)}`),null}if(d.status!==200){let e=x(d.data);return l(`[code-session] /bridge failed ${d.status}${e?`: ${e}`:``}`),null}let f=d.data;if(typeof f!=`object`||!f||!(`worker_jwt`in f)||typeof f.worker_jwt!=`string`||!(`expires_in`in f)||typeof f.expires_in!=`number`||!(`api_base_url`in f)||typeof f.api_base_url!=`string`||!(`worker_epoch`in f))return l(`[code-session] /bridge response malformed (need worker_jwt, expires_in, api_base_url, worker_epoch): ${i(f).slice(0,200)}`),null;let p=f.worker_epoch,m=typeof p==`string`?Number(p):p;return typeof m!=`number`||!Number.isFinite(m)||!Number.isSafeInteger(m)?(l(`[code-session] /bridge worker_epoch invalid: ${i(p)}`),null):{worker_jwt:f.worker_jwt,api_base_url:f.api_base_url,expires_in:f.expires_in,worker_epoch:m}}r(),S(),u(),o(),E();var R=`2023-06-01`;function z(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":R}}async function B(t){let{baseUrl:n,orgUUID:r,title:i,getAccessToken:o,onAuth401:c,toSDKMessages:u,initialHistoryCap:d,initialMessages:f,onInboundMessage:h,onUserMessage:g,onPermissionResponse:_,onInterrupt:v,onSetModel:y,onSetMaxThinkingTokens:b,onSetPermissionMode:x,onStateChange:S,outboundOnly:w,tags:T}=t,E=await ne(),D=o();if(!D)return l(`[remote-bridge] No OAuth token`),null;let k=await V(()=>ce(n,D,i,E.http_timeout_ms,T),`createCodeSession`,E);if(!k)return S?.(`failed`,`Session creation failed — see debug log`),C(`v2_session_create_failed`,void 0,!0),null;let F=k;l(`[remote-bridge] Created session ${F}`),m(`info`,`bridge_repl_v2_session_created`);let I=await V(()=>H(F,n,D,E.http_timeout_ms),`fetchRemoteCredentials`,E);if(!I)return S?.(`failed`,`Remote credentials fetch failed — see debug log`),C(`v2_remote_creds_failed`,void 0,!0),U(F,n,D,r,E.http_timeout_ms),null;l(`[remote-bridge] Fetched bridge credentials (expires_in=${I.expires_in}s)`);let L=O(I.api_base_url,F);l(`[remote-bridge] v2 session URL: ${L}`);let R;try{R=await P({sessionUrl:L,ingressToken:I.worker_jwt,sessionId:F,epoch:I.worker_epoch,heartbeatIntervalMs:E.heartbeat_interval_ms,heartbeatJitterFraction:E.heartbeat_jitter_fraction,getAuthToken:()=>I.worker_jwt,outboundOnly:w})}catch(e){return l(`[remote-bridge] v2 transport setup failed: ${a(e)}`,{level:`error`}),S?.(`failed`,`Transport setup failed: ${a(e)}`),C(`v2_transport_setup_failed`,void 0,!0),U(F,n,D,r,E.http_timeout_ms),null}l(`[remote-bridge] v2 transport created (epoch=${I.worker_epoch})`),S?.(`ready`);let z=new N(E.uuid_dedup_buffer_size),B=new Set;if(f)for(let e of f)B.add(e.uuid),z.add(e.uuid);let le=new N(E.uuid_dedup_buffer_size),W=new se,G=!1,K=!1,q=!1,J=!g,Y=`initial`,X;function Z(e){K||p(`tengu_bridge_repl_connect_timeout`,{v2:!0,elapsed_ms:E.connect_timeout_ms,cause:e})}ee(e=>{K||R.reportMetadata(e)},{replayCurrent:!0});let Q=te({refreshBufferMs:E.token_refresh_buffer_ms,getAccessToken:async()=>{let e=o();return c&&await c(e??``),o()??e},onRefresh:(e,t)=>{(async()=>{if(q||K){l(`[remote-bridge] Recovery already in flight, skipping proactive refresh`);return}q=!0;try{let r=await V(()=>H(e,n,t,E.http_timeout_ms),`fetchRemoteCredentials (proactive)`,E);if(!r||K)return;await ue(r,`proactive_refresh`),l(`[remote-bridge] Transport rebuilt (proactive refresh)`)}catch(e){l(`[remote-bridge] Proactive refresh rebuild failed: ${a(e)}`,{level:`error`}),m(`error`,`bridge_repl_v2_proactive_refresh_failed`),K||S?.(`failed`,`Refresh failed: ${a(e)}`)}finally{q=!1}})()},label:`remote`});Q.scheduleFromExpiresIn(F,I.expires_in);function $(){R.setOnConnect(()=>{if(clearTimeout(X),l(`[remote-bridge] v2 transport connected`),m(`info`,`bridge_repl_v2_transport_connected`),p(`tengu_bridge_repl_ws_connected`,{v2:!0,cause:Y}),!G&&f&&f.length>0){G=!0;let e=R;pe(f).catch(e=>l(`[remote-bridge] flushHistory failed: ${e}`)).finally(()=>{R!==e||K||q||(fe(),S?.(`connected`))})}else W.active||S?.(`connected`)}),R.setOnData(e=>{ae(e,z,le,h,_?e=>{R.reportState(`running`),_(e)}:void 0,e=>re(e,{transport:R,sessionId:F,onInterrupt:v,onSetModel:y,onSetMaxThinkingTokens:b,onSetPermissionMode:x,outboundOnly:w}))}),R.setOnClose(e=>{if(clearTimeout(X),!K){if(l(`[remote-bridge] v2 transport closed (code=${e})`),p(`tengu_bridge_repl_ws_closed`,{code:e,v2:!0}),e===401&&!q){de();return}S?.(`failed`,`Transport closed (code ${e})`)}})}async function ue(e,t){Y=t,W.start();try{let t=R.getLastSequenceNum();if(R.close(),R=await P({sessionUrl:O(e.api_base_url,F),ingressToken:e.worker_jwt,sessionId:F,epoch:e.worker_epoch,heartbeatIntervalMs:E.heartbeat_interval_ms,heartbeatJitterFraction:E.heartbeat_jitter_fraction,initialSequenceNum:t,getAuthToken:()=>e.worker_jwt,outboundOnly:w}),K){R.close();return}$(),R.connect(),X=setTimeout(Z,E.connect_timeout_ms,Y),Q.scheduleFromExpiresIn(F,e.expires_in),fe()}finally{W.drop()}}async function de(){if(!q){q=!0,S?.(`reconnecting`,`JWT expired — refreshing`),l(`[remote-bridge] 401 on SSE — attempting JWT refresh`);try{let e=o();c&&await c(e??``);let t=o()??e;if(!t||K){K||S?.(`failed`,`JWT refresh failed: no OAuth token`);return}let r=await V(()=>H(F,n,t,E.http_timeout_ms),`fetchRemoteCredentials (recovery)`,E);if(!r||K){K||S?.(`failed`,`JWT refresh failed after 401`);return}G=!1,await ue(r,`auth_401_recovery`),l(`[remote-bridge] Transport rebuilt after 401`)}catch(e){l(`[remote-bridge] 401 recovery failed: ${a(e)}`,{level:`error`}),m(`error`,`bridge_repl_v2_jwt_refresh_failed`),K||S?.(`failed`,`JWT refresh failed: ${a(e)}`)}finally{q=!1}}}$(),f&&f.length>0&&W.start(),R.connect(),X=setTimeout(Z,E.connect_timeout_ms,Y);function fe(){let e=W.end();if(e.length===0)return;for(let t of e)z.add(t.uuid);let t=u(e).map(e=>({...e,session_id:F}));j(e)&&R.reportState(`running`),l(`[remote-bridge] Drained ${e.length} queued message(s) after flush`),R.writeBatch(t)}async function pe(e){let t=e.filter(A),n=d>0&&t.length>d?t.slice(-d):t;n.length<t.length&&l(`[remote-bridge] Capped initial flush: ${t.length} -> ${n.length} (cap=${d})`);let r=u(n).map(e=>({...e,session_id:F}));if(r.length===0)return;let i=t.at(-1);i&&oe(i)&&R.reportState(`running`),l(`[remote-bridge] Flushing ${r.length} history events`),await R.writeBatch(r)}async function me(){if(K)return;K=!0,Q.cancelAll(),clearTimeout(X),W.drop(),R.reportState(`idle`);let e={...M(F),session_id:F};R.write(e);let t=o(),i=await U(F,n,t,r,E.teardown_archive_timeout_ms);if(i===401&&c)try{await c(t??``),t=o(),i=await U(F,n,t,r,E.teardown_archive_timeout_ms)}catch(e){l(`[remote-bridge] Teardown 401 retry threw: ${a(e)}`,{level:`error`})}R.close();let s=i===`no_token`?`skipped_no_token`:i===`timeout`||i===`error`?`network_error`:i>=500?`server_5xx`:i>=400?`server_4xx`:`ok`;l(`[remote-bridge] Torn down (archive=${i})`),m(`info`,`bridge_repl_v2_teardown`),p(`tengu_bridge_repl_teardown`,{v2:!0,archive_status:s,archive_ok:typeof i==`number`&&i<400,archive_http_status:typeof i==`number`?i:void 0,archive_timeout:i===`timeout`,archive_no_token:i===`no_token`})}let he=s(me);return p(`tengu_bridge_repl_started`,{has_initial_messages:!!(f&&f.length>0),v2:!0,expires_in_s:I.expires_in,inProtectedNamespace:e()}),{bridgeSessionId:F,environmentId:``,sessionIngressUrl:I.api_base_url,writeMessages(e){let t=e.filter(e=>A(e)&&!B.has(e.uuid)&&!z.has(e.uuid));if(t.length===0)return;if(!J)for(let e of t){let t=ie(e);if(t!==void 0&&g?.(t,F)){J=!0;break}}if(W.enqueue(...t)){l(`[remote-bridge] Queued ${t.length} message(s) during flush`);return}for(let e of t)z.add(e.uuid);let n=u(t).map(e=>({...e,session_id:F}));j(t)&&R.reportState(`running`),l(`[remote-bridge] Sending ${t.length} message(s)`),R.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!z.has(e.uuid));if(t.length===0)return;for(let e of t)e.uuid&&z.add(e.uuid);let n=t.map(e=>({...e,session_id:F}));R.writeBatch(n)},sendControlRequest(e){if(q){l(`[remote-bridge] Dropping control_request during 401 recovery: ${e.request_id}`);return}let t={...e,session_id:F};e.request?.subtype===`can_use_tool`&&R.reportState(`requires_action`),R.write(t),l(`[remote-bridge] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(q){l(`[remote-bridge] Dropping control_response during 401 recovery`);return}let t={...e,session_id:F};R.reportState(`running`),R.write(t),l(`[remote-bridge] Sent control_response`)},sendControlCancelRequest(e){if(q){l(`[remote-bridge] Dropping control_cancel_request during 401 recovery: ${e}`);return}let t={type:`control_cancel_request`,request_id:e,session_id:F};R.reportState(`running`),R.write(t),l(`[remote-bridge] Sent control_cancel_request request_id=${e}`)},sendResult(){if(q){l(`[remote-bridge] Dropping result during 401 recovery`);return}R.reportState(`idle`);let e={...M(F),session_id:F};R.write(e),l(`[remote-bridge] Sent result`)},async teardown(){he(),await me()}}}async function V(e,t,n){let r=n.init_retry_max_attempts;for(let i=1;i<=r;i++){let a=await e();if(a!==null)return a;if(i<r){let e=n.init_retry_base_delay_ms*2**(i-1),a=e*n.init_retry_jitter_fraction*(2*Math.random()-1),o=Math.min(e+a,n.init_retry_max_delay_ms);l(`[remote-bridge] ${t} failed (attempt ${i}/${r}), retrying in ${Math.round(o)}ms`),await g(o)}}return null}async function H(e,t,n,r){let i=await L(e,t,n,r,T());return i?D()?{...i,api_base_url:t}:i:null}async function U(e,t,r,i,o){if(!r)return`no_token`;let s=b(e);try{let e=await n.post(`${t}/v1/sessions/${s}/archive`,{},{headers:{...z(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i},timeout:o,validateStatus:()=>!0});return l(`[remote-bridge] Archive ${s} status=${e.status}`),e.status}catch(e){return l(`[remote-bridge] Archive failed: ${a(e)}`),n.isAxiosError(e)&&e.code===`ECONNABORTED`?`timeout`:`error`}}export{B as initEnvLessBridgeCore};
|
|
1
|
+
import{d as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{E as i,L as a,V as o,X as s,Y as c,d as l,s as u,w as d}from"./debug-UI3T040K.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{F as m,P as h}from"./git-CN3qtTb_.js";import{n as g,t as _}from"./sleep-8Eb9j_Ly.js";import{_ as ee,d as v}from"./rcDebugLog-CPGWJbI4.js";import{c as y,d as b,i as x,o as S,s as C}from"./debugUtils-BBMFODKH.js";import{a as w,i as T}from"./trustedDevice-rdvUkS1W.js";import{a as E,r as D}from"./bridgeConfig-Df6uyp3q.js";import{t as te}from"./jwtUtils-CpXwh_du.js";import{t as O}from"./workSecret-mS2OrpxF.js";import{i as k,r as ne}from"./envLessBridgeConfig-BAFYaZ0E.js";import{a as A,c as j,i as re,n as ie,o as M,r as ae,s as oe,t as N}from"./bridgeMessaging-DPVLAIzl.js";import{r as P,t as se}from"./flushGate-CQsnMw8g.js";t(),f(),c(),h(),_(),y(),w(),v(),k(),r(),u(),o(),d(),S();var F=`2023-06-01`;function I(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":F}}async function ce(e,t,r,o,s){let c=`${e}/v1/code/sessions`,u;try{u=await n.post(c,{title:r,bridge:{},...s?.length?{tags:s}:{}},{headers:I(t),timeout:o,validateStatus:e=>e<500})}catch(e){return l(`[code-session] Session create request failed: ${a(e)}`),null}if(u.status!==200&&u.status!==201){let e=x(u.data);return l(`[code-session] Session create failed ${u.status}${e?`: ${e}`:``}`),null}let d=u.data;return!d||typeof d!=`object`||!(`session`in d)||!d.session||typeof d.session!=`object`||!(`id`in d.session)||typeof d.session.id!=`string`||!d.session.id.startsWith(`cse_`)?(l(`[code-session] No session.id (cse_*) in response: ${i(d).slice(0,200)}`),null):d.session.id}async function L(e,t,r,o,s){let c=`${t}/v1/code/sessions/${e}/bridge`,u=I(r);s&&(u[`X-Trusted-Device-Token`]=s);let d;try{d=await n.post(c,{},{headers:u,timeout:o,validateStatus:e=>e<500})}catch(e){return l(`[code-session] /bridge request failed: ${a(e)}`),null}if(d.status!==200){let e=x(d.data);return l(`[code-session] /bridge failed ${d.status}${e?`: ${e}`:``}`),null}let f=d.data;if(typeof f!=`object`||!f||!(`worker_jwt`in f)||typeof f.worker_jwt!=`string`||!(`expires_in`in f)||typeof f.expires_in!=`number`||!(`api_base_url`in f)||typeof f.api_base_url!=`string`||!(`worker_epoch`in f))return l(`[code-session] /bridge response malformed (need worker_jwt, expires_in, api_base_url, worker_epoch): ${i(f).slice(0,200)}`),null;let p=f.worker_epoch,m=typeof p==`string`?Number(p):p;return typeof m!=`number`||!Number.isFinite(m)||!Number.isSafeInteger(m)?(l(`[code-session] /bridge worker_epoch invalid: ${i(p)}`),null):{worker_jwt:f.worker_jwt,api_base_url:f.api_base_url,expires_in:f.expires_in,worker_epoch:m}}r(),S(),u(),o(),E();var R=`2023-06-01`;function z(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":R}}async function B(t){let{baseUrl:n,orgUUID:r,title:i,getAccessToken:o,onAuth401:c,toSDKMessages:u,initialHistoryCap:d,initialMessages:f,onInboundMessage:h,onUserMessage:g,onPermissionResponse:_,onInterrupt:v,onSetModel:y,onSetMaxThinkingTokens:b,onSetPermissionMode:x,onStateChange:S,outboundOnly:w,tags:T}=t,E=await ne(),D=o();if(!D)return l(`[remote-bridge] No OAuth token`),null;let k=await V(()=>ce(n,D,i,E.http_timeout_ms,T),`createCodeSession`,E);if(!k)return S?.(`failed`,`Session creation failed — see debug log`),C(`v2_session_create_failed`,void 0,!0),null;let F=k;l(`[remote-bridge] Created session ${F}`),m(`info`,`bridge_repl_v2_session_created`);let I=await V(()=>H(F,n,D,E.http_timeout_ms),`fetchRemoteCredentials`,E);if(!I)return S?.(`failed`,`Remote credentials fetch failed — see debug log`),C(`v2_remote_creds_failed`,void 0,!0),U(F,n,D,r,E.http_timeout_ms),null;l(`[remote-bridge] Fetched bridge credentials (expires_in=${I.expires_in}s)`);let L=O(I.api_base_url,F);l(`[remote-bridge] v2 session URL: ${L}`);let R;try{R=await P({sessionUrl:L,ingressToken:I.worker_jwt,sessionId:F,epoch:I.worker_epoch,heartbeatIntervalMs:E.heartbeat_interval_ms,heartbeatJitterFraction:E.heartbeat_jitter_fraction,getAuthToken:()=>I.worker_jwt,outboundOnly:w})}catch(e){return l(`[remote-bridge] v2 transport setup failed: ${a(e)}`,{level:`error`}),S?.(`failed`,`Transport setup failed: ${a(e)}`),C(`v2_transport_setup_failed`,void 0,!0),U(F,n,D,r,E.http_timeout_ms),null}l(`[remote-bridge] v2 transport created (epoch=${I.worker_epoch})`),S?.(`ready`);let z=new N(E.uuid_dedup_buffer_size),B=new Set;if(f)for(let e of f)B.add(e.uuid),z.add(e.uuid);let le=new N(E.uuid_dedup_buffer_size),W=new se,G=!1,K=!1,q=!1,J=!g,Y=`initial`,X;function Z(e){K||p(`tengu_bridge_repl_connect_timeout`,{v2:!0,elapsed_ms:E.connect_timeout_ms,cause:e})}ee(e=>{K||R.reportMetadata(e)},{replayCurrent:!0});let Q=te({refreshBufferMs:E.token_refresh_buffer_ms,getAccessToken:async()=>{let e=o();return c&&await c(e??``),o()??e},onRefresh:(e,t)=>{(async()=>{if(q||K){l(`[remote-bridge] Recovery already in flight, skipping proactive refresh`);return}q=!0;try{let r=await V(()=>H(e,n,t,E.http_timeout_ms),`fetchRemoteCredentials (proactive)`,E);if(!r||K)return;await ue(r,`proactive_refresh`),l(`[remote-bridge] Transport rebuilt (proactive refresh)`)}catch(e){l(`[remote-bridge] Proactive refresh rebuild failed: ${a(e)}`,{level:`error`}),m(`error`,`bridge_repl_v2_proactive_refresh_failed`),K||S?.(`failed`,`Refresh failed: ${a(e)}`)}finally{q=!1}})()},label:`remote`});Q.scheduleFromExpiresIn(F,I.expires_in);function $(){R.setOnConnect(()=>{if(clearTimeout(X),l(`[remote-bridge] v2 transport connected`),m(`info`,`bridge_repl_v2_transport_connected`),p(`tengu_bridge_repl_ws_connected`,{v2:!0,cause:Y}),!G&&f&&f.length>0){G=!0;let e=R;pe(f).catch(e=>l(`[remote-bridge] flushHistory failed: ${e}`)).finally(()=>{R!==e||K||q||(fe(),S?.(`connected`))})}else W.active||S?.(`connected`)}),R.setOnData(e=>{ae(e,z,le,h,_?e=>{R.reportState(`running`),_(e)}:void 0,e=>re(e,{transport:R,sessionId:F,onInterrupt:v,onSetModel:y,onSetMaxThinkingTokens:b,onSetPermissionMode:x,outboundOnly:w}))}),R.setOnClose(e=>{if(clearTimeout(X),!K){if(l(`[remote-bridge] v2 transport closed (code=${e})`),p(`tengu_bridge_repl_ws_closed`,{code:e,v2:!0}),e===401&&!q){de();return}S?.(`failed`,`Transport closed (code ${e})`)}})}async function ue(e,t){Y=t,W.start();try{let t=R.getLastSequenceNum();if(R.close(),R=await P({sessionUrl:O(e.api_base_url,F),ingressToken:e.worker_jwt,sessionId:F,epoch:e.worker_epoch,heartbeatIntervalMs:E.heartbeat_interval_ms,heartbeatJitterFraction:E.heartbeat_jitter_fraction,initialSequenceNum:t,getAuthToken:()=>e.worker_jwt,outboundOnly:w}),K){R.close();return}$(),R.connect(),X=setTimeout(Z,E.connect_timeout_ms,Y),Q.scheduleFromExpiresIn(F,e.expires_in),fe()}finally{W.drop()}}async function de(){if(!q){q=!0,S?.(`reconnecting`,`JWT expired — refreshing`),l(`[remote-bridge] 401 on SSE — attempting JWT refresh`);try{let e=o();c&&await c(e??``);let t=o()??e;if(!t||K){K||S?.(`failed`,`JWT refresh failed: no OAuth token`);return}let r=await V(()=>H(F,n,t,E.http_timeout_ms),`fetchRemoteCredentials (recovery)`,E);if(!r||K){K||S?.(`failed`,`JWT refresh failed after 401`);return}G=!1,await ue(r,`auth_401_recovery`),l(`[remote-bridge] Transport rebuilt after 401`)}catch(e){l(`[remote-bridge] 401 recovery failed: ${a(e)}`,{level:`error`}),m(`error`,`bridge_repl_v2_jwt_refresh_failed`),K||S?.(`failed`,`JWT refresh failed: ${a(e)}`)}finally{q=!1}}}$(),f&&f.length>0&&W.start(),R.connect(),X=setTimeout(Z,E.connect_timeout_ms,Y);function fe(){let e=W.end();if(e.length===0)return;for(let t of e)z.add(t.uuid);let t=u(e).map(e=>({...e,session_id:F}));j(e)&&R.reportState(`running`),l(`[remote-bridge] Drained ${e.length} queued message(s) after flush`),R.writeBatch(t)}async function pe(e){let t=e.filter(A),n=d>0&&t.length>d?t.slice(-d):t;n.length<t.length&&l(`[remote-bridge] Capped initial flush: ${t.length} -> ${n.length} (cap=${d})`);let r=u(n).map(e=>({...e,session_id:F}));if(r.length===0)return;let i=t.at(-1);i&&oe(i)&&R.reportState(`running`),l(`[remote-bridge] Flushing ${r.length} history events`),await R.writeBatch(r)}async function me(){if(K)return;K=!0,Q.cancelAll(),clearTimeout(X),W.drop(),R.reportState(`idle`);let e={...M(F),session_id:F};R.write(e);let t=o(),i=await U(F,n,t,r,E.teardown_archive_timeout_ms);if(i===401&&c)try{await c(t??``),t=o(),i=await U(F,n,t,r,E.teardown_archive_timeout_ms)}catch(e){l(`[remote-bridge] Teardown 401 retry threw: ${a(e)}`,{level:`error`})}R.close();let s=i===`no_token`?`skipped_no_token`:i===`timeout`||i===`error`?`network_error`:i>=500?`server_5xx`:i>=400?`server_4xx`:`ok`;l(`[remote-bridge] Torn down (archive=${i})`),m(`info`,`bridge_repl_v2_teardown`),p(`tengu_bridge_repl_teardown`,{v2:!0,archive_status:s,archive_ok:typeof i==`number`&&i<400,archive_http_status:typeof i==`number`?i:void 0,archive_timeout:i===`timeout`,archive_no_token:i===`no_token`})}let he=s(me);return p(`tengu_bridge_repl_started`,{has_initial_messages:!!(f&&f.length>0),v2:!0,expires_in_s:I.expires_in,inProtectedNamespace:e()}),{bridgeSessionId:F,environmentId:``,sessionIngressUrl:I.api_base_url,writeMessages(e){let t=e.filter(e=>A(e)&&!B.has(e.uuid)&&!z.has(e.uuid));if(t.length===0)return;if(!J)for(let e of t){let t=ie(e);if(t!==void 0&&g?.(t,F)){J=!0;break}}if(W.enqueue(...t)){l(`[remote-bridge] Queued ${t.length} message(s) during flush`);return}for(let e of t)z.add(e.uuid);let n=u(t).map(e=>({...e,session_id:F}));j(t)&&R.reportState(`running`),l(`[remote-bridge] Sending ${t.length} message(s)`),R.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!z.has(e.uuid));if(t.length===0)return;for(let e of t)e.uuid&&z.add(e.uuid);let n=t.map(e=>({...e,session_id:F}));R.writeBatch(n)},sendControlRequest(e){if(q){l(`[remote-bridge] Dropping control_request during 401 recovery: ${e.request_id}`);return}let t={...e,session_id:F};e.request?.subtype===`can_use_tool`&&R.reportState(`requires_action`),R.write(t),l(`[remote-bridge] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(q){l(`[remote-bridge] Dropping control_response during 401 recovery`);return}let t={...e,session_id:F};R.reportState(`running`),R.write(t),l(`[remote-bridge] Sent control_response`)},sendControlCancelRequest(e){if(q){l(`[remote-bridge] Dropping control_cancel_request during 401 recovery: ${e}`);return}let t={type:`control_cancel_request`,request_id:e,session_id:F};R.reportState(`running`),R.write(t),l(`[remote-bridge] Sent control_cancel_request request_id=${e}`)},sendResult(){if(q){l(`[remote-bridge] Dropping result during 401 recovery`);return}R.reportState(`idle`);let e={...M(F),session_id:F};R.write(e),l(`[remote-bridge] Sent result`)},async teardown(){he(),await me()}}}async function V(e,t,n){let r=n.init_retry_max_attempts;for(let i=1;i<=r;i++){let a=await e();if(a!==null)return a;if(i<r){let e=n.init_retry_base_delay_ms*2**(i-1),a=e*n.init_retry_jitter_fraction*(2*Math.random()-1),o=Math.min(e+a,n.init_retry_max_delay_ms);l(`[remote-bridge] ${t} failed (attempt ${i}/${r}), retrying in ${Math.round(o)}ms`),await g(o)}}return null}async function H(e,t,n,r){let i=await L(e,t,n,r,T());return i?D()?{...i,api_base_url:t}:i:null}async function U(e,t,r,i,o){if(!r)return`no_token`;let s=b(e);try{let e=await n.post(`${t}/v1/sessions/${s}/archive`,{},{headers:{...z(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i},timeout:o,validateStatus:()=>!0});return l(`[remote-bridge] Archive ${s} status=${e.status}`),e.status}catch(e){return l(`[remote-bridge] Archive failed: ${a(e)}`),n.isAxiosError(e)&&e.code===`ECONNABORTED`?`timeout`:`error`}}export{B as initEnvLessBridgeCore};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,d as i,f as a,nt as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{L as u,V as d}from"./debug-UI3T040K.js";import{
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,d as i,f as a,nt as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{L as u,V as d}from"./debug-UI3T040K.js";import{Px as f,jx as p}from"./loadAgentsDir-D7kapZB5.js";import{t as m}from"./useKeybinding-FsOnjW6T.js";import{a as h,t as g}from"./bridgeConfig-Df6uyp3q.js";import{n as _,r as v}from"./bridgeEnabled-A-_xJ94c.js";import{a as y,n as b}from"./types-RJTEOuIt.js";import{t as x}from"./Dialog-DYFGqyDs.js";import{t as S}from"./ListItem-OFARanN7.js";import{i as C,o as w,t as T}from"./cliLaunch-BQa48gsr.js";import{resolve as E}from"path";function D({onDone:e}){let[t,n]=(0,N.useState)(I),[r,i]=(0,N.useState)(null);return(0,N.useEffect)(()=>{if(F&&!F.killed){n(`running`);return}let t=!1;return(async()=>{let r=await k();if(!t){if(r){e(r,{display:`system`});return}n(`starting`);try{A(),t||(n(`running`),I=`running`,e(`Remote Control Server started. Use /remote-control-server to manage.`,{display:`system`}))}catch(r){if(!t){let t=u(r);n(`error`),i(t),I=`error`,e(`Remote Control Server failed to start: ${t}`,{display:`system`})}}}})(),()=>{t=!0}},[]),t===`running`&&F&&!F.killed?(0,P.jsx)(O,{onDone:e}):null}function O({onDone:e}){f(`remote-control-server-dialog`);let[t,n]=(0,N.useState)(2),s=L.slice(-5);function l(){j(),e(`Remote Control Server stopped.`,{display:`system`})}function d(){j();try{A(),e(`Remote Control Server restarted.`,{display:`system`})}catch(t){e(`Failed to restart: ${u(t)}`,{display:`system`})}}function p(){e(void 0,{display:`skip`})}return o({"select:next":()=>n(e=>(e+1)%3),"select:previous":()=>n(e=>(e-1+3)%3),"select:accept":()=>{t===0?l():t===1?d():p()}},{context:`Select`}),(0,P.jsx)(a,{title:`Remote Control Server`,onCancel:p,hideInputGuide:!0,children:(0,P.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,P.jsxs)(r,{children:[`Remote Control Server is`,` `,(0,P.jsx)(r,{bold:!0,color:`success`,children:`running`}),F?` (PID: ${F.pid})`:``]}),s.length>0&&(0,P.jsxs)(c,{flexDirection:`column`,children:[(0,P.jsx)(r,{dimColor:!0,children:`Recent logs:`}),s.map((e,t)=>(0,P.jsx)(r,{dimColor:!0,children:e},t))]}),(0,P.jsxs)(c,{flexDirection:`column`,children:[(0,P.jsx)(i,{isFocused:t===0,children:(0,P.jsx)(r,{children:`Stop server`})}),(0,P.jsx)(i,{isFocused:t===1,children:(0,P.jsx)(r,{children:`Restart server`})}),(0,P.jsx)(i,{isFocused:t===2,children:(0,P.jsx)(r,{children:`Continue`})})]}),(0,P.jsx)(r,{dimColor:!0,children:`Enter to select · Esc to continue`})]})})}async function k(){return await _()||(g()?null:b)}function A(){let e=E(`.`),t=w(T([`daemon`,`start`,`--dir=${e}`]),{cwd:e,stdio:[`ignore`,`pipe`,`pipe`],detached:!1});F=t,L=[],t.stdout?.on(`data`,e=>{let t=e.toString().trimEnd().split(`
|
|
2
2
|
`);for(let e of t)L.push(e),L.length>R&&L.shift()}),t.stderr?.on(`data`,e=>{let t=e.toString().trimEnd().split(`
|
|
3
3
|
`);for(let e of t)L.push(`[err] ${e}`),L.length>R&&L.shift()}),t.on(`exit`,(e,t)=>{F=null,I=`stopped`,L.push(`[daemon] exited (code=${e??`unknown`}, signal=${t})`)}),t.on(`error`,e=>{F=null,I=`error`,L.push(`[daemon] error: ${e.message}`)})}function j(){if(F&&!F.killed){F.kill(`SIGTERM`);let e=F.pid;setTimeout(()=>{try{e&&process.kill(e,0),F&&!F.killed&&F.kill(`SIGKILL`)}catch{}},1e4)}F=null,I=`stopped`}async function M(e,t,n){return(0,P.jsx)(D,{onDone:e})}var N,P,F,I,L,R;e((()=>{n(),N=t(n(),1),v(),h(),y(),x(),S(),p(),s(),m(),C(),d(),P=l(),F=null,I=`stopped`,L=[],R=50}))();export{M as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{f as r,l as i}from"./teammate-DMYOtLTK.js";import{Ar as a,Lo as o,Oo as s,Tr as c,_i as l,mi as u}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{f as r,l as i}from"./teammate-DMYOtLTK.js";import{Ar as a,Lo as o,Oo as s,Tr as c,_i as l,mi as u}from"./loadAgentsDir-D7kapZB5.js";import{a as d,i as f,r as p}from"./bridgeConfig-Df6uyp3q.js";import{n as m,t as h}from"./generateSessionName-aGnXSNgN.js";async function g(e,n,i){if(r())return e(`Cannot rename: This session is a swarm teammate. Teammate names are set by the team leader.`,{display:`system`}),null;let a;if(!i||i.trim()===``){let t=await h(s(n.messages),n.abortController.signal);if(!t)return e(`Could not generate a name: no conversation context yet. Usage: /rename <name>`,{display:`system`}),null;a=t}else a=i.trim();let o=t(),d=c();await l(o,a,d);let m=n.getAppState().replBridgeSessionId;if(m){let e=f();import(`./createSession-DfEQy2dZ.js`).then(({updateBridgeSessionTitle:t})=>t(m,a,{baseUrl:p(),getAccessToken:e?()=>e:void 0}).catch(()=>{}))}return await u(o,a,d),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:a}})),e(`Session renamed to: ${a}`,{display:`system`}),null}e((()=>{n(),d(),o(),a(),i(),m()}))();export{g as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
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,Ln as o,Rn as s,b as c,t as l,tn as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Ct as p,cn as m,ot as h}from"./state-sIHsFpDu.js";import{o as g,s as _}from"./log-CzsijfHZ.js";import{Ar as v,Br as y,
|
|
2
|
-
`),{display:`user`});return}m(!0),t(r,i,`slash_command_picker`)}function O(){e(`Resume cancelled`,{display:`system`})}return s?(0,Y.jsxs)(d,{children:[(0,Y.jsx)(
|
|
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,Ln as o,Rn as s,b as c,t as l,tn as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{Ct as p,cn as m,ot as h}from"./state-sIHsFpDu.js";import{o as g,s as _}from"./log-CzsijfHZ.js";import{Ar as v,Br as y,Bw as b,Gr as x,I_ as S,L_ as C,Mi as w,Mr as T,Ni as E,Pr as D,Si as O,Ur as k,Vw as A,_r as j,gy as M,vy as N,wr as P,zw as F}from"./loadAgentsDir-D7kapZB5.js";import{n as I,r as L}from"./modalContext-CmSKRyea.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./crossProjectResume-Z-aR2q-d.js";function W(e){switch(e.resultType){case`sessionNotFound`:return`Session ${a.bold(e.arg)} was not found. Run ${a.bold(`/resume`)} without arguments to browse all sessions.`;case`multipleMatches`:return`Found ${e.count} sessions matching ${a.bold(e.arg)}. Run ${a.bold(`/resume`)} to pick one from the list.`}}function G({message:e,args:t,onDone:n}){return J.useEffect(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,Y.jsxs)(d,{flexDirection:`column`,children:[(0,Y.jsxs)(c,{dimColor:!0,children:[r.pointer,` /resume `,t]}),(0,Y.jsx)(b,{children:(0,Y.jsx)(c,{children:e})})]})}function K({onDone:e,onResume:t}){let[n,r]=J.useState([]),[a,o]=J.useState([]),[s,l]=J.useState(!0),[f,m]=J.useState(!1),[g,_]=J.useState(!1),{rows:v}=i(),b=L(),S=J.useCallback(async(t,n)=>{l(!0);try{let i=q(t?await y():await x(n),p());if(i.length===0){e(`No conversations found to resume`);return}r(i)}catch{e(`Failed to load conversations`)}finally{l(!1)}},[e]);J.useEffect(()=>{async function e(){let e=await w(h());o(e),S(!1,e)}e()},[S]);let T=J.useCallback(()=>{let e=!g;_(e),S(e,a)},[g,S,a]);async function E(n){let r=C(P(n));if(!r){e(`Failed to resume conversation`);return}let i=D(n)?await k(n):n,o=U(i,g,a);if(o.isCrossProject){if(o.isSameRepoWorktree){m(!0),t(r,i,`slash_command_picker`);return}let n=await u(o.command);n&&process.stdout.write(n),e([``,`This conversation is from a different directory.`,``,`To resume, run:`,` ${o.command}`,``,`(Command copied to clipboard)`,``].join(`
|
|
2
|
+
`),{display:`user`});return}m(!0),t(r,i,`slash_command_picker`)}function O(){e(`Resume cancelled`,{display:`system`})}return s?(0,Y.jsxs)(d,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:` Loading conversations…`})]}):f?(0,Y.jsxs)(d,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:` Resuming conversation…`})]}):(0,Y.jsx)(R,{logs:n,maxHeight:b?Math.floor(v/2):v-2,onCancel:O,onSelect:E,onLogsChanged:()=>S(g,a),showAllProjects:g,onToggleAllProjects:T,onAgenticSearch:H})}function q(e,t){return e.filter(e=>!e.isSidechain&&P(e)!==t)}var J,Y,X;e((()=>{o(),n(),J=t(s(),1),m(),V(),A(),N(),I(),F(),l(),z(),B(),E(),g(),v(),S(),Y=f(),X=async(e,t,n)=>{let r=async(n,r,i)=>{try{await t.resume?.(n,r,i),e(void 0,{display:`skip`})}catch(t){_(t),e(`Failed to resume: ${t.message}`)}},i=n?.trim();if(!i)return(0,Y.jsx)(K,{onDone:e,onResume:r},Date.now());let a=await x(await w(h()));if(a.length===0){let t=`No conversations found to resume.`;return(0,Y.jsx)(G,{message:t,args:i,onDone:()=>e(t)})}let o=C(i);if(o){let e=a.filter(e=>P(e)===o).sort((e,t)=>t.modified.getTime()-e.modified.getTime());if(e.length>0){let t=e[0];return r(o,D(t)?await k(t):t,`slash_command_session_id`),null}let t=await j(o);if(t)return r(o,t,`slash_command_session_id`),null}if(T()){let t=await O(i,{exact:!0});if(t.length===1){let e=t[0],n=P(e);if(n)return r(n,D(e)?await k(e):e,`slash_command_title`),null}if(t.length>1){let n=W({resultType:`multipleMatches`,arg:i,count:t.length});return(0,Y.jsx)(G,{message:n,args:i,onDone:()=>e(n)})}}let s=W({resultType:`sessionNotFound`,arg:i});return(0,Y.jsx)(G,{message:s,args:i,onDone:()=>e(s)})}}))();export{X as call,q as filterResumableSessions};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{AD as r,Xi as i,kD as a,zi as o}from"./loadAgentsDir-D7kapZB5.js";import{r as s,t as c}from"./featureCheck-Cm0YNDXO.js";import{a as l,c as u,i as d,l as f,n as p,o as m,r as ee,s as te,u as ne}from"./instinctParser-DHMa8xa0.js";import{C as h,S as g,b as _,c as re,f as ie,i as ae,m as oe,o as v,r as se,u as y}from"./skillGenerator-B9GM0LHk.js";import{a as ce,i as b,l as le,n as x,o as ue,t as de}from"./observationStore-tvkldXUo.js";import{a as fe,c as pe}from"./projectContext-eXMSfgdZ.js";import{d as me,i as he,l as ge,p as _e}from"./sessionObserver-CujNIWks.js";import{dirname as ve,join as S}from"node:path";import{existsSync as C}from"node:fs";import{randomBytes as ye}from"node:crypto";import{mkdir as w,readFile as be,readdir as T,rename as xe,unlink as Se,writeFile as E}from"node:fs/promises";function D(e,t){if(e.length===0)throw Error(`Cannot generate a command draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=g(t?.name??Ce(e)),i=Ee(e),a=t?.description??we(e),o=k(r,n,t),s=Te({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function O(e){await w(e.outputPath,{recursive:!0});let t=S(e.outputPath,`${e.name}.md`);return C(t)?t:(await E(t,e.content,`utf8`),o(),t)}function k(e,n,r){return r?.outputRoot?r.outputRoot:n===`project`?S(r?.cwd??process.cwd(),`.claude`,`commands`):r?.globalCommandsDir??S(t(),`commands`)}function Ce(e){return g([`learned`,...De(e,4)].join(`-`))||`learned-command`}function we(e){return(e[0]?.trigger??`Reuse the learned workflow`).replace(/\s+/g,` `).slice(0,120)}function Te(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# /${t}`,``,`## When to use`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
2
2
|
`),``,`## Steps`,``,i.map(e=>`- ${e.action}`).join(`
|
|
3
3
|
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).join(`
|
|
4
4
|
`),``].join(`
|
|
5
|
-
`)}function Ee(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function De(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`run`,`use`,`prefer`,`avoid`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var A=e((()=>{n(),
|
|
5
|
+
`)}function Ee(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function De(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`run`,`use`,`prefer`,`avoid`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var A=e((()=>{n(),i(),_()}));function j(e,t){if(e.length===0)throw Error(`Cannot generate an agent draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=g(t?.name??Oe(e)),i=je(e),a=t?.description??ke(e),o=N(r,n,t),s=Ae({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function M(e){await w(e.outputPath,{recursive:!0});let t=S(e.outputPath,`${e.name}.md`);return C(t)?t:(await E(t,e.content,`utf8`),o(),t)}function N(e,n,r){return r?.outputRoot?r.outputRoot:n===`project`?S(r?.cwd??process.cwd(),`.claude`,`agents`):r?.globalAgentsDir??S(t(),`agents`)}function Oe(e){return g([`learned`,`agent`,...Me(e,4)].join(`-`))||`learned-agent`}function ke(e){return(e[0]?.trigger??`Run the learned multi-step workflow`).replace(/\s+/g,` `).slice(0,120)}function Ae(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`You are the ${t} learned agent.`,``,`## Triggers`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
6
6
|
`),``,`## Playbook`,``,i.map(e=>`- ${e.action}`).join(`
|
|
7
7
|
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,20).join(`
|
|
8
8
|
`),``].join(`
|
|
9
|
-
`)}function je(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function Me(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`debug`,`investigate`,`research`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var P=e((()=>{n(),
|
|
10
|
-
`):``}function lt(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_use`?[{toolName:String(t.name??`unknown_tool`),input:le(t.input)}]:[]}):[]}function ut(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_result`?[{toolName:String(t.name??t.tool_name??`unknown_tool`),output:le(t.content),isError:t.is_error===!0}]:[]}):[]}var K,q,J,Y,X,Z,Q,dt,$,ft=e((()=>{
|
|
9
|
+
`)}function je(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function Me(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`debug`,`investigate`,`research`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var P=e((()=>{n(),i(),_()}));function F(e){let t=new Map;for(let n of e){if(n.status!==`active`&&n.status!==`pending`)continue;let e=`${n.domain}:${Pe(n.trigger)}`,r=t.get(e)??[];r.push(n),t.set(e,r)}return Array.from(t.values()).filter(e=>e.length>=f().minClusterSize).map(e=>{let t=e.reduce((e,t)=>e+t.confidence,0)/e.length;return{target:I(e),trigger:e[0]?.trigger??`learned pattern`,domain:e[0]?.domain??`project`,instincts:e,averageConfidence:Number(t.toFixed(2))}}).sort((e,t)=>t.averageConfidence-e.averageConfidence)}function I(e){let t=Array.isArray(e)?e:e.instincts,n=t.map(e=>`${e.trigger} ${e.action}`).join(` `).toLowerCase();return/user asks|explicitly request|command|run /.test(n)?`command`:t.length>=4&&/(debug|investigate|research|multi-step)/.test(n)?`agent`:`skill`}function Ne(e,t){return F(e).filter(e=>e.target===`skill`&&h(e.instincts)).map(e=>ae(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function L(e,t){return F(e).filter(e=>e.target===`command`&&h(e.instincts)).map(e=>D(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function R(e,t){return F(e).filter(e=>e.target===`agent`&&h(e.instincts)).map(e=>j(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function Pe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,` `).split(/\s+/).filter(Boolean).slice(0,6).join(` `)}var z=e((()=>{_(),v(),A(),P(),ne()}));function B(e){let t=x(e),n=e?.project;return(e?.scope??n?.scope??`project`)===`global`||!n||n.projectId===`global`?S(t,`global`,`instincts`,`personal`):S(t,`projects`,n.projectId,`instincts`,`personal`)}async function V(e,t){let n=m(e);await w(B(t),{recursive:!0});let r=He(n.id,t),i=`${r}.${ye(6).toString(`hex`)}.tmp`;return await E(i,u(n)),await xe(i,r),n}async function H(e){let t=B(e),n=[];try{n=await T(t)}catch(e){if(e.code===`ENOENT`)return[];throw e}let r=[];for(let e of n.filter(e=>e.endsWith(`.json`))){let n=await be(S(t,e),`utf8`);r.push(te(n))}return r.sort((e,t)=>e.id.localeCompare(t.id))}function Fe(e,t){let n=U.then(()=>Ie(e,t));return U=n.catch(()=>{}),n}async function Ie(e,t){let n=await H(t),r=n.find(t=>t.id===e.id)??n.find(t=>t.trigger.toLowerCase()===e.trigger.toLowerCase()&&l(t,e)),i=new Date().toISOString();if(!r)return V(e,t);let a=l(r,e),o=a?-.1:ze(e.evidenceOutcome),s=p(r.confidence+o),c=Le(r.status,s,a);return V(m({...r,confidence:s,evidence:[...r.evidence,...e.evidence],evidenceOutcome:e.evidenceOutcome??r.evidenceOutcome,observationIds:[...r.observationIds??[],...e.observationIds??[]],updatedAt:i,status:c}),t)}function Le(e,t,n){return n&&t<.3?`conflict-hold`:e===`conflict-hold`&&t>=.5||e===`pending`&&t>=.8?`active`:e}async function Re(e){let t=await H(e),n=Date.now(),r=0;for(let i of t){if(i.status!==`pending`&&i.status!==`active`)continue;let t=Date.parse(i.updatedAt);if(Number.isNaN(t))continue;let a=Math.floor((n-t)/We);if(a<1)continue;let o=-Ue*a,s=p(i.confidence+o);s!==i.confidence&&(await V(m({...i,confidence:s,updatedAt:new Date(n).toISOString()}),e),r+=1)}return r}function ze(e){return e===`failure`?-.05:.05}async function Be(e,t){let n=await H(t);return await w(ve(e),{recursive:!0}),await E(e,`${JSON.stringify(n,null,2)}\n`),n}async function Ve(e,t){let n=await H(t),r=Date.now()-e*24*60*60*1e3,i=[];for(let e of n)e.status===`pending`&&Date.parse(e.updatedAt)<r&&(await Se(He(e.id,t)),i.push(e));return i}function He(e,t){return S(B(t),`${e}.json`)}var U,Ue,We,W=e((()=>{b(),d(),U=Promise.resolve(),Ue=.02,We=10080*60*1e3}));function Ge(e){if(G.add(e),G.size>Xe){let e=G.size-Ze,t=G.values();for(let n=0;n<e;n++){let e=t.next();if(e.done)break;G.delete(e.value)}}}function Ke(e,t=2,n=.8){let r=new Map;for(let t of e){if(t.scope!==`project`)continue;let e=r.get(t.id)??[];e.push(t),r.set(t.id,e)}return Array.from(r.entries()).flatMap(([e,r])=>{let i=Array.from(new Set(r.map(e=>e.projectId).filter(Boolean))),a=r.reduce((e,t)=>e+t.confidence,0)/r.length;return i.length>=t&&a>=n?[{instinctId:e,projectIds:i,averageConfidence:Number(a.toFixed(2))}]:[]})}async function qe(e={}){let t=e.minProjects??2,n=e.minConfidence??.8,r=await Je(e.rootDir),i=Ke(r,t,n),a=[];for(let t of i){if(G.has(t.instinctId))continue;let n=r.find(e=>e.id===t.instinctId);n&&(await V({...n,scope:`global`,projectId:void 0,projectName:void 0,confidence:t.averageConfidence,updatedAt:new Date().toISOString()},{rootDir:e.rootDir,scope:`global`,project:Ye(e.rootDir)}),Ge(t.instinctId),a.push(t))}return a}async function Je(e){let t=S(x(e?{rootDir:e}:void 0),`projects`);if(!C(t))return[];let n=await T(t,{withFileTypes:!0}),r=[];for(let i of n){if(!i.isDirectory())continue;let n=await H({rootDir:e,project:{projectId:i.name,projectName:i.name,scope:`project`,source:`git_root`,cwd:t,storageDir:S(t,i.name)},scope:`project`});r.push(...n)}return r}function Ye(e){let t=x(e?{rootDir:e}:void 0);return{projectId:`global`,projectName:`Global`,scope:`global`,source:`global`,cwd:t,storageDir:S(t,`global`)}}var Xe,Ze,G,Qe=e((()=>{W(),b(),Xe=256,Ze=192,G=new Set}));function $e(){X=0,Z=0,Q.clear()}function et(){return J}function tt(){if(!q){q=!0;try{_e()}catch{}r(it),nt().catch(()=>{})}}async function nt(){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE)return;let e={project:pe(process.cwd())};await Promise.allSettled([Re(e),ce(e),Ve(30,e)])}function rt(e){try{let t=x();return e.startsWith(t)}catch{return!1}}async function it(e){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE||!e.querySource?.startsWith(`repl_main_thread`)||e.toolUseContext.agentId)return;let t=process.cwd();if(rt(t))return;let n=pe(t),r={project:n};++J;let i=[];for(let t of st(e.messages,n))i.push(await de(t,r));let a=(await ue(r)).filter(e=>e.source===`tool-hook`&&e.sessionId===`runtime-session`&&typeof e.timestamp==`string`&&e.timestamp>Y);i.push(...a);for(let e of a)e.timestamp>Y&&(Y=e.timestamp);if(i.length===0)return;let o=Date.now(),{llm:c}=f(),l=i.length>=5&&X<c.maxCallsPerSession&&o-Z>=c.cooldownMs,u;if(l)X++,Z=o,u=await ge(i,{project:n});else{let{heuristicObserverBackend:e}=await import(`./sessionObserver-HqvTXhs9.js`),t=e.analyze(i,{project:n});u=Array.isArray(t)?t:await t}for(let e of u)await Fe(ee(e),r);await ot(r)}function at(){J=0,Y=``,$e()}async function ot(e){let n=await H(e),r=process.cwd(),i=[S(r,`.claude`,`skills`),S(t(),`skills`)],a=F(n).filter(e=>e.target===`skill`&&h(e.instincts));for(let e of a){let t=await se(e.instincts,{cwd:r,scope:e.instincts[0]?.scope??`project`},i);if(t.action===`append-evidence`)continue;let n=t.draft;C(S(n.outputPath,`SKILL.md`))||await re(ie(n,await y(`skill`,n,i)))}let o=L(n,{cwd:r});for(let e of o)(await y(`command`,e,[S(r,`.claude`,`commands`),S(t(),`commands`)])).length>0||await O(e);let s=R(n,{cwd:r});for(let e of s)(await y(`agent`,e,[S(r,`.claude`,`agents`),S(t(),`agents`)])).length>0||await M(e);await qe()}function st(e,t){let n=K,r={sessionId:n,projectId:t.projectId,projectName:t.projectName,cwd:t.cwd,timestamp:new Date().toISOString(),source:`hook`};return e.flatMap(e=>{let t=`${n}:${String(e.uuid)}`;if(Q.has(t))return[];if(Q.add(t),Q.size>dt){let e=Q.size-$,t=Q.values();for(let n=0;n<e;n++){let e=t.next();if(e.done)break;Q.delete(e.value)}}if(e.type===`user`){let t=ut(e.message?.content);if(t.length>0)return t.map(e=>({...r,id:crypto.randomUUID(),event:`tool_complete`,toolName:e.toolName,toolOutput:e.output,outcome:e.isError?`failure`:`success`}));let n=ct(e.message?.content);return n.trim()?[{...r,id:crypto.randomUUID(),event:`user_message`,messageText:n}]:[]}if(e.type===`assistant`){let t=lt(e.message?.content),n=ct(e.message?.content);return[...t.map(e=>({...r,id:crypto.randomUUID(),event:`tool_start`,toolName:e.toolName,toolInput:e.input})),...n.trim()?[{...r,id:crypto.randomUUID(),event:`assistant_message`,messageText:n}]:[]]}return[]})}function ct(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:``}).filter(Boolean).join(`
|
|
10
|
+
`):``}function lt(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_use`?[{toolName:String(t.name??`unknown_tool`),input:le(t.input)}]:[]}):[]}function ut(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_result`?[{toolName:String(t.name??t.tool_name??`unknown_tool`),output:le(t.content),isError:t.is_error===!0}]:[]}):[]}var K,q,J,Y,X,Z,Q,dt,$,ft=e((()=>{a(),ne(),c(),b(),fe(),he(),d(),me(),W(),oe(),z(),v(),_(),A(),P(),Qe(),n(),K=`runtime-session`,q=!1,J=0,Y=``,X=0,Z=0,Q=new Set,dt=1e3,$=500}));export{O as A,j as C,D,M as E,k as O,z as S,P as T,I as _,$e as a,L as b,qe as c,Be as d,W as f,Fe as g,V as h,ft as i,A as k,Ke as l,Ve as m,et as n,at as o,H as p,tt as r,it as s,K as t,Qe as u,F as v,N as w,Ne as x,R as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./runtimeObserver-
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./runtimeObserver-BhvHeiwD.js";t();export{o as RUNTIME_SESSION_ID,n as getRuntimeTurn,i as initSkillLearning,e as resetRuntimeLLMBookkeeping,r as resetRuntimeObserverForTest,a as runSkillLearningPostSampling};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{oA as e,rA as t}from"./loadAgentsDir-D7kapZB5.js";e();export{t as SandboxManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Q as t,Rn as n,T as r,b as i,i as a,n as o,nt as s,p as c,r as l,t as u,v as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,j as h}from"./state-sIHsFpDu.js";import{Za as g,no as _,oo as v}from"./paths-Q2255dD7.js";import{i as y,o as b}from"./platform-CuyedWpe.js";import{Dx as x,Ox as S,iA as C,nA as w,sA as T,tA as E}from"./loadAgentsDir-Ci5mr0vm.js";import{t as D}from"./useKeybinding-FsOnjW6T.js";import{relative as O}from"path";function k(){let e=E.isSandboxingEnabled(),t=E.checkDependencies(),n=t.warnings.length>0?(0,A.jsx)(f,{marginTop:1,flexDirection:`column`,children:t.warnings.map((e,t)=>(0,A.jsx)(i,{dimColor:!0,children:e},t))}):null;if(!e)return(0,A.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,A.jsx)(i,{color:`subtle`,children:`Sandbox is not enabled`}),n]});let r=E.getFsReadConfig(),a=E.getFsWriteConfig(),o=E.getNetworkRestrictionConfig(),s=E.getAllowUnixSockets(),c=E.getExcludedCommands(),l=E.getLinuxGlobPatternWarnings();return(0,A.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,A.jsxs)(f,{flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Excluded Commands:`}),(0,A.jsx)(i,{dimColor:!0,children:c.length>0?c.join(`, `):`None`})]}),r.denyOnly.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Filesystem Read Restrictions:`}),(0,A.jsxs)(i,{dimColor:!0,children:[`Denied: `,r.denyOnly.join(`, `)]}),r.allowWithinDeny&&r.allowWithinDeny.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed within denied: `,r.allowWithinDeny.join(`, `)]})]}),a.allowOnly.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Filesystem Write Restrictions:`}),(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed: `,a.allowOnly.join(`, `)]}),a.denyWithinAllow.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Denied within allowed: `,a.denyWithinAllow.join(`, `)]})]}),(o.allowedHosts&&o.allowedHosts.length>0||o.deniedHosts&&o.deniedHosts.length>0)&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsxs)(i,{bold:!0,color:`permission`,children:[`Network Restrictions`,T()?` (Managed)`:``,`:`]}),o.allowedHosts&&o.allowedHosts.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed: `,o.allowedHosts.join(`, `)]}),o.deniedHosts&&o.deniedHosts.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Denied: `,o.deniedHosts.join(`, `)]})]}),s&&s.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Allowed Unix Sockets:`}),(0,A.jsx)(i,{dimColor:!0,children:s.join(`, `)})]}),l.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`warning`,children:`⚠ Warning: Glob patterns not fully supported on Linux`}),(0,A.jsxs)(i,{dimColor:!0,children:[`The following patterns will be ignored: `,l.slice(0,3).join(`, `),l.length>3&&` (${l.length-3} more)`]})]}),n]})}var A,j=e((()=>{n(),u(),C(),A=p()}));function M({depCheck:e}){let t=y()===`macos`,n=e.errors.some(e=>e.includes(`ripgrep`)),r=e.errors.some(e=>e.includes(`bwrap`)),a=e.errors.some(e=>e.includes(`socat`)),o=e.warnings.length>0,s=e.errors.filter(e=>!e.includes(`ripgrep`)&&!e.includes(`bwrap`)&&!e.includes(`socat`));return(0,N.jsxs)(f,{flexDirection:`column`,paddingY:1,gap:1,children:[t&&(0,N.jsx)(f,{flexDirection:`column`,children:(0,N.jsxs)(i,{children:[`seatbelt: `,(0,N.jsx)(i,{color:`success`,children:`built-in (macOS)`})]})}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`ripgrep (rg): `,n?(0,N.jsx)(i,{color:`error`,children:`not found`}):(0,N.jsx)(i,{color:`success`,children:`found`})]}),n&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· `,t?`brew install ripgrep`:`apt install ripgrep`]})]}),!t&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`bubblewrap (bwrap):`,` `,r?(0,N.jsx)(i,{color:`error`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`})]}),r&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· apt install bubblewrap`]})]}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`socat: `,a?(0,N.jsx)(i,{color:`error`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`})]}),a&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· apt install socat`]})]}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`seccomp filter:`,` `,o?(0,N.jsx)(i,{color:`warning`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`}),o&&(0,N.jsx)(i,{dimColor:!0,children:` (required to block unix domain sockets)`})]}),o&&(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· npm install -g @anthropic-ai/sandbox-runtime`]}),(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· or copy vendor/seccomp/* from sandbox-runtime and set`]}),(0,N.jsxs)(i,{dimColor:!0,children:[` `,`sandbox.seccomp.bpfPath and applyPath in settings.json`]})]})]})]}),s.map(e=>(0,N.jsx)(i,{color:`error`,children:e},e))]})}var N,P=e((()=>{n(),u(),b(),N=p()}));function F({onComplete:e}){let t=E.isSandboxingEnabled(),n=E.areSandboxSettingsLockedByPolicy(),r=E.areUnsandboxedCommandsAllowed();return t?n?(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,L.jsx)(i,{color:`subtle`,children:`Override settings are managed by a higher-priority configuration and cannot be changed locally.`}),(0,L.jsx)(f,{marginTop:1,children:(0,L.jsxs)(i,{dimColor:!0,children:[`Current setting: `,r?`Allow unsandboxed fallback`:`Strict sandbox mode`]})})]}):(0,L.jsx)(I,{onComplete:e,currentMode:r?`open`:`closed`}):(0,L.jsx)(f,{flexDirection:`column`,paddingY:1,children:(0,L.jsx)(i,{color:`subtle`,children:`Sandbox is not enabled. Enable sandbox to configure override settings.`})})}function I({onComplete:e,currentMode:n}){let[o]=r(),{headerFocused:s,focusHeader:c}=a(),l=d(`success`,o)(`(current)`),u=[{label:n===`open`?`Allow unsandboxed fallback ${l}`:`Allow unsandboxed fallback`,value:`open`},{label:n===`closed`?`Strict sandbox mode ${l}`:`Strict sandbox mode`,value:`closed`}];async function p(t){let n=t;await E.setSandboxSettings({allowUnsandboxedCommands:n===`open`}),e(n===`open`?`✓ Unsandboxed fallback allowed - commands can run outside sandbox when necessary`:"✓ Strict sandbox mode - all commands must run in sandbox or be excluded via the `excludedCommands` option")}return(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,L.jsx)(f,{marginBottom:1,children:(0,L.jsx)(i,{bold:!0,children:`Configure Overrides:`})}),(0,L.jsx)(x,{options:u,onChange:p,onCancel:()=>e(void 0,{display:`skip`}),onUpFromFirstItem:c,isDisabled:s}),(0,L.jsxs)(f,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,L.jsxs)(i,{dimColor:!0,children:[(0,L.jsx)(i,{bold:!0,dimColor:!0,children:`Allow unsandboxed fallback:`}),` `,`When a command fails due to sandbox restrictions, Claude can retry with dangerouslyDisableSandbox to run outside the sandbox (falling back to default permissions).`]}),(0,L.jsxs)(i,{dimColor:!0,children:[(0,L.jsx)(i,{bold:!0,dimColor:!0,children:`Strict sandbox mode:`}),` `,`All bash commands invoked by the model must run in the sandbox unless they are explicitly listed in excludedCommands.`]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Learn more:`,` `,(0,L.jsx)(t,{url:`https://code.claude.com/docs/en/sandboxing#configure-sandboxing`,children:`code.claude.com/docs/en/sandboxing#configure-sandboxing`})]})]})]})}var L,R=e((()=>{n(),u(),C(),S(),L=p()}));function z({onComplete:e,depCheck:t}){let[n]=r(),i=E.isSandboxingEnabled(),a=E.isAutoAllowBashIfSandboxedEnabled(),u=t.warnings.length>0,f=_().sandbox?.network?.allowAllUnixSockets,p=u&&!f,m=i?a?`auto-allow`:`regular`:`disabled`,h=d(`success`,n)(`(current)`),g=[{label:m===`auto-allow`?`Sandbox BashTool, with auto-allow ${h}`:`Sandbox BashTool, with auto-allow`,value:`auto-allow`},{label:m===`regular`?`Sandbox BashTool, with regular permissions ${h}`:`Sandbox BashTool, with regular permissions`,value:`regular`},{label:m===`disabled`?`No Sandbox ${h}`:`No Sandbox`,value:`disabled`}];async function v(t){switch(t){case`auto-allow`:await E.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!0}),e(`✓ Sandbox enabled with auto-allow for bash commands`);break;case`regular`:await E.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!1}),e(`✓ Sandbox enabled with regular bash permissions`);break;case`disabled`:await E.setSandboxSettings({enabled:!1,autoAllowBashIfSandboxed:!1}),e(`○ Sandbox disabled`);break}}s({"confirm:no":()=>e(void 0,{display:`skip`})},{context:`Settings`});let y=(0,V.jsx)(o,{title:`Mode`,children:(0,V.jsx)(B,{showSocketWarning:p,options:g,onSelect:v,onComplete:e})},`mode`),b=(0,V.jsx)(o,{title:`Overrides`,children:(0,V.jsx)(F,{onComplete:e})},`overrides`),x=(0,V.jsx)(o,{title:`Config`,children:(0,V.jsx)(k,{})},`config`);return(0,V.jsx)(c,{color:`permission`,children:(0,V.jsx)(l,{title:`Sandbox:`,color:`permission`,defaultTab:`Mode`,children:t.errors.length>0?[(0,V.jsx)(o,{title:`Dependencies`,children:(0,V.jsx)(M,{depCheck:t})},`dependencies`)]:[y,...u?[(0,V.jsx)(o,{title:`Dependencies`,children:(0,V.jsx)(M,{depCheck:t})},`dependencies`)]:[],b,x]})})}function B({showSocketWarning:e,options:n,onSelect:r,onComplete:o}){let{headerFocused:s,focusHeader:c}=a();return(0,V.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[e&&(0,V.jsx)(f,{marginBottom:1,children:(0,V.jsx)(i,{color:`warning`,children:`Cannot block unix domain sockets (see Dependencies tab)`})}),(0,V.jsx)(f,{marginBottom:1,children:(0,V.jsx)(i,{bold:!0,children:`Configure Mode:`})}),(0,V.jsx)(x,{options:n,onChange:r,onCancel:()=>o(void 0,{display:`skip`}),onUpFromFirstItem:c,isDisabled:s}),(0,V.jsxs)(f,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,V.jsxs)(i,{dimColor:!0,children:[(0,V.jsx)(i,{bold:!0,dimColor:!0,children:`Auto-allow mode:`}),` `,`Commands will try to run in the sandbox automatically, and attempts to run outside of the sandbox fallback to regular permissions. Explicit ask/deny rules are always respected.`]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Learn more: `,(0,V.jsx)(t,{url:`https://code.claude.com/docs/en/sandboxing`,children:`code.claude.com/docs/en/sandboxing`})]})]})]})}var V,H=e((()=>{n(),u(),D(),C(),v(),S(),j(),P(),R(),V=p()}));async function U(e,t,n){let r=_().theme||`light`,i=y();if(!E.isSupportedPlatform()){let t=i===`wsl`?`Error: Sandboxing requires WSL2. WSL1 is not supported.`:`Error: Sandboxing is currently only supported on macOS, Linux, and WSL2.`;return e(d(`error`,r)(t)),null}let a=E.checkDependencies();if(!E.isPlatformInEnabledList())return e(d(`error`,r)(`Error: Sandboxing is disabled for this platform (${i}) via the enabledPlatforms setting.`)),null;if(E.areSandboxSettingsLockedByPolicy())return e(d(`error`,r)(`Error: Sandbox settings are overridden by a higher-priority configuration and cannot be changed locally.`)),null;let o=n?.trim()||``;if(!o)return(0,W.jsx)(z,{onComplete:e,depCheck:a});if(o){let t=o.split(` `)[0];if(t===`exclude`){let t=o.slice(8).trim();if(!t)return e(d(`error`,r)(`Error: Please provide a command pattern to exclude (e.g., /sandbox exclude "npm run test:*")`)),null;let n=t.replace(/^["']|["']$/g,``);w(n);let i=g(`localSettings`),a=i?O(h(),i):`.claude/settings.local.json`;return e(d(`success`,r)(`Added "${n}" to excluded commands in ${a}`)),null}else return e(d(`error`,r)(`Error: Unknown subcommand "${t}". Available subcommand: exclude`)),null}return null}var W;e((()=>{n(),m(),H(),u(),b(),C(),v(),W=p()}))();export{U as call};
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Q as t,Rn as n,T as r,b as i,i as a,n as o,nt as s,p as c,r as l,t as u,v as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,j as h}from"./state-sIHsFpDu.js";import{Za as g,no as _,oo as v}from"./paths-1ngPRtu3.js";import{i as y,o as b}from"./platform-CuyedWpe.js";import{Ax as x,iA as S,kx as C,lA as w,oA as T,rA as E}from"./loadAgentsDir-D7kapZB5.js";import{t as D}from"./useKeybinding-FsOnjW6T.js";import{relative as O}from"path";function k(){let e=E.isSandboxingEnabled(),t=E.checkDependencies(),n=t.warnings.length>0?(0,A.jsx)(f,{marginTop:1,flexDirection:`column`,children:t.warnings.map((e,t)=>(0,A.jsx)(i,{dimColor:!0,children:e},t))}):null;if(!e)return(0,A.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,A.jsx)(i,{color:`subtle`,children:`Sandbox is not enabled`}),n]});let r=E.getFsReadConfig(),a=E.getFsWriteConfig(),o=E.getNetworkRestrictionConfig(),s=E.getAllowUnixSockets(),c=E.getExcludedCommands(),l=E.getLinuxGlobPatternWarnings();return(0,A.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,A.jsxs)(f,{flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Excluded Commands:`}),(0,A.jsx)(i,{dimColor:!0,children:c.length>0?c.join(`, `):`None`})]}),r.denyOnly.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Filesystem Read Restrictions:`}),(0,A.jsxs)(i,{dimColor:!0,children:[`Denied: `,r.denyOnly.join(`, `)]}),r.allowWithinDeny&&r.allowWithinDeny.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed within denied: `,r.allowWithinDeny.join(`, `)]})]}),a.allowOnly.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Filesystem Write Restrictions:`}),(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed: `,a.allowOnly.join(`, `)]}),a.denyWithinAllow.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Denied within allowed: `,a.denyWithinAllow.join(`, `)]})]}),(o.allowedHosts&&o.allowedHosts.length>0||o.deniedHosts&&o.deniedHosts.length>0)&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsxs)(i,{bold:!0,color:`permission`,children:[`Network Restrictions`,w()?` (Managed)`:``,`:`]}),o.allowedHosts&&o.allowedHosts.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed: `,o.allowedHosts.join(`, `)]}),o.deniedHosts&&o.deniedHosts.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Denied: `,o.deniedHosts.join(`, `)]})]}),s&&s.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Allowed Unix Sockets:`}),(0,A.jsx)(i,{dimColor:!0,children:s.join(`, `)})]}),l.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`warning`,children:`⚠ Warning: Glob patterns not fully supported on Linux`}),(0,A.jsxs)(i,{dimColor:!0,children:[`The following patterns will be ignored: `,l.slice(0,3).join(`, `),l.length>3&&` (${l.length-3} more)`]})]}),n]})}var A,j=e((()=>{n(),u(),T(),A=p()}));function M({depCheck:e}){let t=y()===`macos`,n=e.errors.some(e=>e.includes(`ripgrep`)),r=e.errors.some(e=>e.includes(`bwrap`)),a=e.errors.some(e=>e.includes(`socat`)),o=e.warnings.length>0,s=e.errors.filter(e=>!e.includes(`ripgrep`)&&!e.includes(`bwrap`)&&!e.includes(`socat`));return(0,N.jsxs)(f,{flexDirection:`column`,paddingY:1,gap:1,children:[t&&(0,N.jsx)(f,{flexDirection:`column`,children:(0,N.jsxs)(i,{children:[`seatbelt: `,(0,N.jsx)(i,{color:`success`,children:`built-in (macOS)`})]})}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`ripgrep (rg): `,n?(0,N.jsx)(i,{color:`error`,children:`not found`}):(0,N.jsx)(i,{color:`success`,children:`found`})]}),n&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· `,t?`brew install ripgrep`:`apt install ripgrep`]})]}),!t&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`bubblewrap (bwrap):`,` `,r?(0,N.jsx)(i,{color:`error`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`})]}),r&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· apt install bubblewrap`]})]}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`socat: `,a?(0,N.jsx)(i,{color:`error`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`})]}),a&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· apt install socat`]})]}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`seccomp filter:`,` `,o?(0,N.jsx)(i,{color:`warning`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`}),o&&(0,N.jsx)(i,{dimColor:!0,children:` (required to block unix domain sockets)`})]}),o&&(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· npm install -g @anthropic-ai/sandbox-runtime`]}),(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· or copy vendor/seccomp/* from sandbox-runtime and set`]}),(0,N.jsxs)(i,{dimColor:!0,children:[` `,`sandbox.seccomp.bpfPath and applyPath in settings.json`]})]})]})]}),s.map(e=>(0,N.jsx)(i,{color:`error`,children:e},e))]})}var N,P=e((()=>{n(),u(),b(),N=p()}));function F({onComplete:e}){let t=E.isSandboxingEnabled(),n=E.areSandboxSettingsLockedByPolicy(),r=E.areUnsandboxedCommandsAllowed();return t?n?(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,L.jsx)(i,{color:`subtle`,children:`Override settings are managed by a higher-priority configuration and cannot be changed locally.`}),(0,L.jsx)(f,{marginTop:1,children:(0,L.jsxs)(i,{dimColor:!0,children:[`Current setting: `,r?`Allow unsandboxed fallback`:`Strict sandbox mode`]})})]}):(0,L.jsx)(I,{onComplete:e,currentMode:r?`open`:`closed`}):(0,L.jsx)(f,{flexDirection:`column`,paddingY:1,children:(0,L.jsx)(i,{color:`subtle`,children:`Sandbox is not enabled. Enable sandbox to configure override settings.`})})}function I({onComplete:e,currentMode:n}){let[o]=r(),{headerFocused:s,focusHeader:c}=a(),l=d(`success`,o)(`(current)`),u=[{label:n===`open`?`Allow unsandboxed fallback ${l}`:`Allow unsandboxed fallback`,value:`open`},{label:n===`closed`?`Strict sandbox mode ${l}`:`Strict sandbox mode`,value:`closed`}];async function p(t){let n=t;await E.setSandboxSettings({allowUnsandboxedCommands:n===`open`}),e(n===`open`?`✓ Unsandboxed fallback allowed - commands can run outside sandbox when necessary`:"✓ Strict sandbox mode - all commands must run in sandbox or be excluded via the `excludedCommands` option")}return(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,L.jsx)(f,{marginBottom:1,children:(0,L.jsx)(i,{bold:!0,children:`Configure Overrides:`})}),(0,L.jsx)(C,{options:u,onChange:p,onCancel:()=>e(void 0,{display:`skip`}),onUpFromFirstItem:c,isDisabled:s}),(0,L.jsxs)(f,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,L.jsxs)(i,{dimColor:!0,children:[(0,L.jsx)(i,{bold:!0,dimColor:!0,children:`Allow unsandboxed fallback:`}),` `,`When a command fails due to sandbox restrictions, Claude can retry with dangerouslyDisableSandbox to run outside the sandbox (falling back to default permissions).`]}),(0,L.jsxs)(i,{dimColor:!0,children:[(0,L.jsx)(i,{bold:!0,dimColor:!0,children:`Strict sandbox mode:`}),` `,`All bash commands invoked by the model must run in the sandbox unless they are explicitly listed in excludedCommands.`]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Learn more:`,` `,(0,L.jsx)(t,{url:`https://code.claude.com/docs/en/sandboxing#configure-sandboxing`,children:`code.claude.com/docs/en/sandboxing#configure-sandboxing`})]})]})]})}var L,R=e((()=>{n(),u(),T(),x(),L=p()}));function z({onComplete:e,depCheck:t}){let[n]=r(),i=E.isSandboxingEnabled(),a=E.isAutoAllowBashIfSandboxedEnabled(),u=t.warnings.length>0,f=_().sandbox?.network?.allowAllUnixSockets,p=u&&!f,m=i?a?`auto-allow`:`regular`:`disabled`,h=d(`success`,n)(`(current)`),g=[{label:m===`auto-allow`?`Sandbox BashTool, with auto-allow ${h}`:`Sandbox BashTool, with auto-allow`,value:`auto-allow`},{label:m===`regular`?`Sandbox BashTool, with regular permissions ${h}`:`Sandbox BashTool, with regular permissions`,value:`regular`},{label:m===`disabled`?`No Sandbox ${h}`:`No Sandbox`,value:`disabled`}];async function v(t){switch(t){case`auto-allow`:await E.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!0}),e(`✓ Sandbox enabled with auto-allow for bash commands`);break;case`regular`:await E.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!1}),e(`✓ Sandbox enabled with regular bash permissions`);break;case`disabled`:await E.setSandboxSettings({enabled:!1,autoAllowBashIfSandboxed:!1}),e(`○ Sandbox disabled`);break}}s({"confirm:no":()=>e(void 0,{display:`skip`})},{context:`Settings`});let y=(0,V.jsx)(o,{title:`Mode`,children:(0,V.jsx)(B,{showSocketWarning:p,options:g,onSelect:v,onComplete:e})},`mode`),b=(0,V.jsx)(o,{title:`Overrides`,children:(0,V.jsx)(F,{onComplete:e})},`overrides`),x=(0,V.jsx)(o,{title:`Config`,children:(0,V.jsx)(k,{})},`config`);return(0,V.jsx)(c,{color:`permission`,children:(0,V.jsx)(l,{title:`Sandbox:`,color:`permission`,defaultTab:`Mode`,children:t.errors.length>0?[(0,V.jsx)(o,{title:`Dependencies`,children:(0,V.jsx)(M,{depCheck:t})},`dependencies`)]:[y,...u?[(0,V.jsx)(o,{title:`Dependencies`,children:(0,V.jsx)(M,{depCheck:t})},`dependencies`)]:[],b,x]})})}function B({showSocketWarning:e,options:n,onSelect:r,onComplete:o}){let{headerFocused:s,focusHeader:c}=a();return(0,V.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[e&&(0,V.jsx)(f,{marginBottom:1,children:(0,V.jsx)(i,{color:`warning`,children:`Cannot block unix domain sockets (see Dependencies tab)`})}),(0,V.jsx)(f,{marginBottom:1,children:(0,V.jsx)(i,{bold:!0,children:`Configure Mode:`})}),(0,V.jsx)(C,{options:n,onChange:r,onCancel:()=>o(void 0,{display:`skip`}),onUpFromFirstItem:c,isDisabled:s}),(0,V.jsxs)(f,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,V.jsxs)(i,{dimColor:!0,children:[(0,V.jsx)(i,{bold:!0,dimColor:!0,children:`Auto-allow mode:`}),` `,`Commands will try to run in the sandbox automatically, and attempts to run outside of the sandbox fallback to regular permissions. Explicit ask/deny rules are always respected.`]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Learn more: `,(0,V.jsx)(t,{url:`https://code.claude.com/docs/en/sandboxing`,children:`code.claude.com/docs/en/sandboxing`})]})]})]})}var V,H=e((()=>{n(),u(),D(),T(),v(),x(),j(),P(),R(),V=p()}));async function U(e,t,n){let r=_().theme||`light`,i=y();if(!E.isSupportedPlatform()){let t=i===`wsl`?`Error: Sandboxing requires WSL2. WSL1 is not supported.`:`Error: Sandboxing is currently only supported on macOS, Linux, and WSL2.`;return e(d(`error`,r)(t)),null}let a=E.checkDependencies();if(!E.isPlatformInEnabledList())return e(d(`error`,r)(`Error: Sandboxing is disabled for this platform (${i}) via the enabledPlatforms setting.`)),null;if(E.areSandboxSettingsLockedByPolicy())return e(d(`error`,r)(`Error: Sandbox settings are overridden by a higher-priority configuration and cannot be changed locally.`)),null;let o=n?.trim()||``;if(!o)return(0,W.jsx)(z,{onComplete:e,depCheck:a});if(o){let t=o.split(` `)[0];if(t===`exclude`){let t=o.slice(8).trim();if(!t)return e(d(`error`,r)(`Error: Please provide a command pattern to exclude (e.g., /sandbox exclude "npm run test:*")`)),null;let n=t.replace(/^["']|["']$/g,``);S(n);let i=g(`localSettings`),a=i?O(h(),i):`.claude/settings.local.json`;return e(d(`success`,r)(`Added "${n}" to excluded commands in ${a}`)),null}else return e(d(`error`,r)(`Error: Unknown subcommand "${t}". Available subcommand: exclude`)),null}return null}var W;e((()=>{n(),m(),H(),u(),b(),T(),v(),W=p()}))();export{U as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Yc as e,Zc as t}from"./loadAgentsDir-D7kapZB5.js";e();export{t as isSearchExtraToolsEnabled};
|