claude-code-best 2.7.0 → 2.7.2
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-V2tF7iCY.js +1 -0
- package/dist/chunks/App-DLdRpU7c.js +1 -0
- package/dist/chunks/ApproveApiKey-B7_TCGwt.js +1 -0
- package/dist/chunks/ApproveApiKey-DPws3jax.js +1 -0
- package/dist/chunks/AssistantSessionChooser-D6rS0OVe.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-hGlbm5z5.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-CuEpdRVd.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-CTTKMRbt.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B-GkVoA_.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DxJK9NiM.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-LPZ97jsm.js +1 -0
- package/dist/chunks/DesktopHandoff-BjPylhOT.js +1 -0
- package/dist/chunks/DevChannelsDialog-c4YVqBX9.js +1 -0
- package/dist/chunks/DiffDialog-I5wuXw2C.js +3 -0
- package/dist/chunks/Doctor-Cr_MlSPc.js +3 -0
- package/dist/chunks/Doctor-hgf3dMAW.js +1 -0
- package/dist/chunks/ExitFlow-Bz5grDWv.js +2 -0
- package/dist/chunks/Feedback-COgMI5tY.js +2 -0
- package/dist/chunks/Grove-Bwmghb-e.js +1 -0
- package/dist/chunks/Grove-m57x4tY1.js +11 -0
- package/dist/chunks/HybridTransport-Bok4-Ptt.js +4 -0
- package/dist/chunks/ITermBackend-BBSP-NNa.js +1 -0
- package/dist/chunks/InvalidConfigDialog-uTSuSBvO.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-B-Os12-H.js +1 -0
- package/dist/chunks/MCPConnectionManager-y97Inszc.js +1 -0
- package/dist/chunks/McpParsingWarnings-DMFUZw92.js +1 -0
- package/dist/chunks/MessageSelector-DwdAC2io.js +3 -0
- package/dist/chunks/Messages-FEBcX-cT.js +11 -0
- package/dist/chunks/Onboarding-B8qMJaBh.js +1 -0
- package/dist/chunks/OverageCreditUpsell-DnFv5z-z.js +1 -0
- package/dist/chunks/PluginSettings-B_xVgTTp.js +17 -0
- package/dist/chunks/PromptInputFooterSuggestions-DhIQ0Nge.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-CoMkWchC.js +1 -0
- package/dist/chunks/QueryEngine-C7r7O-hH.js +1 -0
- package/dist/chunks/REPL-CmJdJrGO.js +147 -0
- package/dist/chunks/REPL-nP7H_-qa.js +1 -0
- package/dist/chunks/RemoteCallout-4JOZROfT.js +1 -0
- package/dist/chunks/RemoteSessionManager-jcPnywfY.js +2 -0
- package/dist/chunks/ResumeConversation-CZ2Uedkf.js +1 -0
- package/dist/chunks/SSETransport-kEH_p4Yq.js +4 -0
- package/dist/chunks/SearchExtraToolsTool-C64oVFUD.js +1 -0
- package/dist/chunks/SentryErrorBoundary-2E2qGV11.js +1 -0
- package/dist/chunks/SentryErrorBoundary-97iY7Nb7.js +2 -0
- package/dist/chunks/Settings-CuljH0mu.js +2 -0
- package/dist/chunks/TeleportProgress-Ctdqi7iS.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-DyTBg1YD.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-B66clYsG.js +1 -0
- package/dist/chunks/ThemePicker-WKmYvrqz.js +1 -0
- package/dist/chunks/TmuxBackend-OKX2NP14.js +9 -0
- package/dist/chunks/TrustDialog-0anSIf-G.js +1 -0
- package/dist/chunks/TungstenTool-B40YHYXC.js +1 -0
- package/dist/chunks/ValidationErrorsList-CfgC1KJb.js +2 -0
- package/dist/chunks/WelcomeV2-BMHXiNt3.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-fCSGVe4W.js +2 -0
- package/dist/chunks/add-dir-CMtuW667.js +1 -0
- package/dist/chunks/agentDisplay-CgYKW3G7.js +1 -0
- package/dist/chunks/agents-CdqcGm9o.js +103 -0
- package/dist/chunks/agents-D90TsYOf.js +2 -0
- package/dist/chunks/ant-DZjimiuz.js +1 -0
- package/dist/chunks/api-CQWbpxLP.js +1 -0
- package/dist/chunks/api-quOYYOhi.js +1 -0
- package/dist/chunks/asciicast-C_1Pi99k.js +4 -0
- package/dist/chunks/asciicast-DA6TudSH.js +1 -0
- package/dist/chunks/assistant-B5_xx00q.js +1 -0
- package/dist/chunks/assistant-CEmC_DlU.js +1 -0
- package/dist/chunks/assistant-CyVcFPIR.js +1 -0
- package/dist/chunks/auth-CjtaiRtF.js +1 -0
- package/dist/chunks/auth-DsQEVs9W.js +1 -0
- package/dist/chunks/autoMode-DEbM9UaE.js +45 -0
- package/dist/chunks/autonomy-Clap6Swl.js +1 -0
- package/dist/chunks/autonomy-lNpGnyiu.js +19 -0
- package/dist/chunks/autonomyPanel-BqEvfI0e.js +1 -0
- package/dist/chunks/backgroundHousekeeping-D-jt-ocx.js +1 -0
- package/dist/chunks/backgroundHousekeeping-KvOpP_4M.js +17 -0
- package/dist/chunks/banner-D9Cq292T.js +2 -0
- package/dist/chunks/bg-CngkAkgc.js +1 -0
- package/dist/chunks/bg-DgpgS_VU.js +9 -0
- package/dist/chunks/branch-CSYB04xC.js +3 -0
- package/dist/chunks/break-cache-DrIa8RdW.js +8 -0
- package/dist/chunks/bridge-DDgASypO.js +2 -0
- package/dist/chunks/bridgeConfig-BdZVEqhx.js +1 -0
- package/dist/chunks/bridgeConfig-DjC4oig1.js +1 -0
- package/dist/chunks/bridgeEnabled-Csn6Ym3k.js +1 -0
- package/dist/chunks/bridgeEnabled-DLRIH243.js +1 -0
- package/dist/chunks/bridgeMain-B5wsmwkN.js +68 -0
- package/dist/chunks/bridgeMain-BN0Sag35.js +1 -0
- package/dist/chunks/bridgeMessaging-ChOzzVWj.js +1 -0
- package/dist/chunks/bridgePointer-Clcvh52n.js +1 -0
- package/dist/chunks/browser-Bt-ckCaU.js +1 -0
- package/dist/chunks/btw-BgjcOoeo.js +1 -0
- package/dist/chunks/buddy-C1wE3noR.js +3 -0
- package/dist/chunks/bypassPermissionsKillswitch-C0diGLRB.js +1 -0
- package/dist/chunks/caches-CIoVGP24.js +3 -0
- package/dist/chunks/caches-DMYdTEAr.js +1 -0
- package/dist/chunks/ccrClient-C1msT1E3.js +1 -0
- package/dist/chunks/changeDetector-DoOBZOt1.js +1 -0
- package/dist/chunks/channelNotification-CWlu9ZWs.js +1 -0
- package/dist/chunks/channelNotification-oZ6vG5R5.js +1 -0
- package/dist/chunks/chrome-Bo9uNZ7s.js +1 -0
- package/dist/chunks/chromeNativeHost-BldB1Zzi.js +1 -0
- package/dist/chunks/claudeDesktop-BqTW_pbB.js +1 -0
- package/dist/chunks/cleanup-rCLlo4w8.js +1 -0
- package/dist/chunks/clear-BxdX_MUP.js +1 -0
- package/dist/chunks/cliLaunch-Citfs01Q.js +1 -0
- package/dist/chunks/client-BSoJ_vaA.js +1 -0
- package/dist/chunks/color-CkzktPHt.js +1 -0
- package/dist/chunks/commands-hyVX9-Lh.js +1 -0
- package/dist/chunks/commitAttribution-BwT0TbYF.js +1 -0
- package/dist/chunks/commitAttribution-csu3NO7Y.js +2 -0
- package/dist/chunks/common-Bi4yZBkh.js +1 -0
- package/dist/chunks/common-Da57Qwms.js +1 -0
- package/dist/chunks/common-NEOWMwtB.js +1 -0
- package/dist/chunks/compact-DNGIVZRN.js +3 -0
- package/dist/chunks/companion-Diuav3lA.js +1 -0
- package/dist/chunks/completionCache-BQgiR45Q.js +1 -0
- package/dist/chunks/completionCache-C7hDqIDL.js +4 -0
- package/dist/chunks/config-B25IrkTA.js +1 -0
- package/dist/chunks/config-ODoYZY8i.js +1 -0
- package/dist/chunks/context-CZ5enuPE.js +1 -0
- package/dist/chunks/context-noninteractive-62P5EnN5.js +54 -0
- package/dist/chunks/context-noninteractive-CjuzL9q5.js +1 -0
- package/dist/chunks/conversation-DyhWeHw2.js +1 -0
- package/dist/chunks/conversation-uY-V0SNK.js +1 -0
- package/dist/chunks/copy-9JLr2-Xs.js +7 -0
- package/dist/chunks/createSSHSession-B1hTuDpB.js +6 -0
- package/dist/chunks/createSession-Qurw-N4x.js +1 -0
- package/dist/chunks/createSession-fzjzy0aS.js +1 -0
- package/dist/chunks/cron-DwR6OJuW.js +1 -0
- package/dist/chunks/cronJitterConfig-9OmmYmIT.js +6 -0
- package/dist/chunks/crossProjectResume-B6efoIur.js +40 -0
- package/dist/chunks/daemon-BRKR4D1D.js +2 -0
- package/dist/chunks/datadog-C-llbwzP.js +1 -0
- package/dist/chunks/datadog-SSxsxcC-.js +1 -0
- package/dist/chunks/desktop-CQnMcbex.js +1 -0
- package/dist/chunks/detached-C_2ZXr7X.js +5 -0
- package/dist/chunks/detectRepository-2ICvGD0U.js +1 -0
- package/dist/chunks/detectRepository-BLwSmun2.js +1 -0
- package/dist/chunks/detection-0mMj--Bt.js +1 -0
- package/dist/chunks/detection-95TCHkW8.js +1 -0
- package/dist/chunks/diff-uAwKYa51.js +1 -0
- package/dist/chunks/directoryCompletion-DqtWZsoW.js +1 -0
- package/dist/chunks/doctor-CBF0fkBF.js +1 -0
- package/dist/chunks/earlyInput-CFYRGxau.js +2 -0
- package/dist/chunks/earlyInput-D3OhUZ4G.js +1 -0
- package/dist/chunks/effort-F-bhAM2u.js +9 -0
- package/dist/chunks/entry-DHN_Gr1b.js +14 -0
- package/dist/chunks/env-C2A9gV_G.js +1 -0
- package/dist/chunks/envLessBridgeConfig-CDVtIEWT.js +1 -0
- package/dist/chunks/envLessBridgeConfig-Dg0hNsdi.js +1 -0
- package/dist/chunks/execFileNoThrow-azCkYhmF.js +1 -0
- package/dist/chunks/executor-BVh1PTF-.js +1561 -0
- package/dist/chunks/executor-CvTuHx-k.js +1 -0
- package/dist/chunks/exit-CqcvZJwI.js +1 -0
- package/dist/chunks/export-c6WoGlsG.js +2 -0
- package/dist/chunks/exportRenderer-CaegIP5N.js +1 -0
- package/dist/chunks/extra-usage-Cj8fokgc.js +1 -0
- package/dist/chunks/extra-usage-Dk-wcvAu.js +1 -0
- package/dist/chunks/extra-usage-core-sHzc4eE1.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-D0kqrqsg.js +1 -0
- package/dist/chunks/extraUsage-CbkqfG1U.js +1 -0
- package/dist/chunks/extractMemories-BP8Opsbp.js +1 -0
- package/dist/chunks/fast-DS3iQ1CH.js +1 -0
- package/dist/chunks/fast-DklfqySb.js +1 -0
- package/dist/chunks/featureCheck-CUJ2rPM6.js +1 -0
- package/dist/chunks/feedback-QJynmG5q.js +1 -0
- package/dist/chunks/fileStateCache-BhVfo23e.js +1 -0
- package/dist/chunks/files-Bdr_PQyV.js +2 -0
- package/dist/chunks/findExecutable-BHQl4NaS.js +1 -0
- package/dist/chunks/firstPartyEventLogger-DlW8BUXq.js +1 -0
- package/dist/chunks/flushGate-CK5B9-Zn.js +1 -0
- package/dist/chunks/gates-6amRNsYl.js +1 -0
- package/dist/chunks/gates-vlrMjO-X.js +1 -0
- package/dist/chunks/gemini-B5ZRjDrh.js +1 -0
- package/dist/chunks/generateRecap-SgRMdsyN.js +1 -0
- package/dist/chunks/generateSessionName-sZFzpwsq.js +1 -0
- package/dist/chunks/genericProcessUtils-tJxf3yqB.js +23 -0
- package/dist/chunks/git-C0IuvuIy.js +6 -0
- package/dist/chunks/git-hSvFiuiG.js +1 -0
- package/dist/chunks/githubRepoPathMapping-DUGvTwPB.js +1 -0
- package/dist/chunks/goal-Dy-GGn9r.js +3 -0
- package/dist/chunks/grok-BG4_buNt.js +1 -0
- package/dist/chunks/growthbook-Br1dDRtd.js +1 -0
- package/dist/chunks/heapdump-B9PVKMxa.js +5 -0
- package/dist/chunks/help-BfWF7xij.js +1 -0
- package/dist/chunks/hooks-BVrhxysz.js +1 -0
- package/dist/chunks/hooks-KK32pxq3.js +79 -0
- package/dist/chunks/hostAdapter-TBJav3vX.js +1 -0
- package/dist/chunks/hostGuard-DSOEyH-P.js +1 -0
- package/dist/chunks/ide-BU1A79BE.js +2 -0
- package/dist/chunks/inboundAttachments-D4tBPCB8.js +1 -0
- package/dist/chunks/inboundAttachments-DWJplT9p.js +1 -0
- package/dist/chunks/initReplBridge-99sUBVEk.js +1 -0
- package/dist/chunks/insights-lDHodCMG.js +822 -0
- package/dist/chunks/install-Bg4ZgW81.js +1 -0
- package/dist/chunks/install-github-app-RLbUq5EL.js +147 -0
- package/dist/chunks/install-slack-app-CHmIwsbm.js +1 -0
- package/dist/chunks/instrumentation-BCiV3SKX.js +12 -0
- package/dist/chunks/job-xOGf0j5Q.js +2 -0
- package/dist/chunks/jwtUtils-BQXXBwqW.js +1 -0
- package/dist/chunks/keybindings-DMbReZ4p.js +2 -0
- package/dist/chunks/lang-A6LUGP_7.js +1 -0
- package/dist/chunks/language-Bzp5KDCE.js +1 -0
- package/dist/chunks/language-CGfURU2y.js +1 -0
- package/dist/chunks/launchAgentsPlatform-Dbpm7Jyo.js +1 -0
- package/dist/chunks/launchAutofixPr-RZfqx5eM.js +18 -0
- package/dist/chunks/launchLocalMemory-DIntbsvg.js +3 -0
- package/dist/chunks/launchLocalVault-CCUw0ayu.js +3 -0
- package/dist/chunks/launchMemoryStores-QJTh8KSP.js +1 -0
- package/dist/chunks/launchOnboarding--Pe30AYd.js +8 -0
- package/dist/chunks/launchSchedule-DjN1RbRX.js +1 -0
- package/dist/chunks/launchSkillStore-CcKmVDz1.js +1 -0
- package/dist/chunks/launchTeleport-BKlEo0yF.js +3 -0
- package/dist/chunks/launchVault-C7UHA-IG.js +1 -0
- package/dist/chunks/loadAgentsDir-ClTeo0nk.js +4697 -0
- package/dist/chunks/loadAgentsDir-CshktEpX.js +1 -0
- package/dist/chunks/loadPluginHooks-DVZmzYLl.js +1 -0
- package/dist/chunks/localSearch-BtLNJRij.js +1 -0
- package/dist/chunks/localSearch-Koc8naSr.js +1 -0
- package/dist/chunks/log-DSV4Ht5l.js +1 -0
- package/dist/chunks/login-BngE89_j.js +1 -0
- package/dist/chunks/login-C3MZQTDL.js +1 -0
- package/dist/chunks/logoV2Utils-DAIIwt5R.js +1 -0
- package/dist/chunks/logout-CXZBaUen.js +1 -0
- package/dist/chunks/magicDocs-C_inI3JJ.js +57 -0
- package/dist/chunks/main-CfkIGrBF.js +31 -0
- package/dist/chunks/main-qqcmncHA.js +1312 -0
- package/dist/chunks/mappers-7BSMbYvH.js +1 -0
- package/dist/chunks/mcp-DRBiobrN.js +2 -0
- package/dist/chunks/mcp-DV8Prhgi.js +1 -0
- package/dist/chunks/mcp-HQ8-nEZ1.js +6 -0
- package/dist/chunks/mcpServer-CLIYAgGs.js +1 -0
- package/dist/chunks/mcpServer-DS0yRfcu.js +1 -0
- package/dist/chunks/memoize-DJ1XCN-z.js +1 -0
- package/dist/chunks/memory-Cz_JaFLF.js +1 -0
- package/dist/chunks/mobile-BMglW1NB.js +2 -0
- package/dist/chunks/mode-Kx0kSZkr.js +2 -0
- package/dist/chunks/model-Bwvn_acH.js +1 -0
- package/dist/chunks/model-CNXtfiLg.js +1 -0
- package/dist/chunks/onChangeAppState-C4ic-Mib.js +1 -0
- package/dist/chunks/openai-CGGSfpPh.js +10 -0
- package/dist/chunks/overageCreditGrant-BqW_6R5v.js +1 -0
- package/dist/chunks/panel-BYfvo_mR.js +1 -0
- package/dist/chunks/panel-D3wvAEFE.js +1 -0
- package/dist/chunks/panelCall-DgPjuhQf.js +1 -0
- package/dist/chunks/parser-DGXE1uWd.js +1 -0
- package/dist/chunks/passes-sYE91Vtr.js +1 -0
- package/dist/chunks/path-BE28AJwZ.js +1 -0
- package/dist/chunks/paths-DO4WOQtD.js +36 -0
- package/dist/chunks/permissions-BE-1pIly.js +1 -0
- package/dist/chunks/permissions-BPerbf1I.js +3 -0
- package/dist/chunks/pipeTransport-CW9zF_UN.js +1 -0
- package/dist/chunks/plan-CDKBVRw6.js +1 -0
- package/dist/chunks/platform-mh9ypxS8.js +2 -0
- package/dist/chunks/plugin-C6US4b8W.js +1 -0
- package/dist/chunks/pluginAutoupdate-BQKtcAhC.js +1 -0
- package/dist/chunks/pluginBlocklist-B8DKXi0i.js +1 -0
- package/dist/chunks/pluginCliCommands-DWCeXYTl.js +1 -0
- package/dist/chunks/pluginFlagging-DFMlWw2P.js +1 -0
- package/dist/chunks/pluginOperations-CKmwDC3G.js +2 -0
- package/dist/chunks/pluginStartupCheck-D6IbyWKe.js +1 -0
- package/dist/chunks/pluginStartupCheck-cYnLsWOs.js +1 -0
- package/dist/chunks/plugins-BwZIRMh_.js +4 -0
- package/dist/chunks/policyLimits-CFLBtFh3.js +1 -0
- package/dist/chunks/pollConfig-C3NjXYFc.js +1 -0
- package/dist/chunks/poller-BA1jhG3F.js +1 -0
- package/dist/chunks/poor-BHhbua95.js +1 -0
- package/dist/chunks/poorMode-CCK7Ek5w.js +1 -0
- package/dist/chunks/poorMode-mtlnXU-z.js +1 -0
- package/dist/chunks/print-kxnXkqGc.js +39 -0
- package/dist/chunks/privacy-settings-DjY1annR.js +1 -0
- package/dist/chunks/processBashCommand-BrqLqSva.js +1 -0
- package/dist/chunks/processSlashCommand-DJGdVGbK.js +6 -0
- package/dist/chunks/projectContext-Cd7V9pES.js +1 -0
- package/dist/chunks/prompt-BZjXpviP.js +1 -0
- package/dist/chunks/prompt-CfM_xGPc.js +227 -0
- package/dist/chunks/prompt-CusKF4-p.js +1 -0
- package/dist/chunks/promptEditor-FI_ewCpV.js +4 -0
- package/dist/chunks/protocolHandler-B7ybKpgJ.js +13 -0
- package/dist/chunks/rate-limit-options-DPJMNNou.js +1 -0
- package/dist/chunks/rcDebugLog-CwU_wJBE.js +11 -0
- package/dist/chunks/referral-Da4mpbd3.js +1 -0
- package/dist/chunks/refresh-B6X4xb9r.js +1 -0
- package/dist/chunks/registerProtocol-D8fFnceq.js +36 -0
- package/dist/chunks/registry-y_z3pTg3.js +1 -0
- package/dist/chunks/release-notes--tnd4K56.js +4 -0
- package/dist/chunks/releaseNotes-BPA229-J.js +2 -0
- package/dist/chunks/reload-plugins-yQ7tEUVh.js +1 -0
- package/dist/chunks/remote-env-CER5UxTX.js +1 -0
- package/dist/chunks/remoteBridgeCore-Bi31i8gt.js +1 -0
- package/dist/chunks/remoteControlServer-oUAcWB4i.js +3 -0
- package/dist/chunks/rename-BTngRRZU.js +1 -0
- package/dist/chunks/renderOptions-Caca3bCd.js +1 -0
- package/dist/chunks/resume-DZHKfBmm.js +2 -0
- package/dist/chunks/ripgrep-Bzwdi5-K.js +5 -0
- package/dist/chunks/ripgrep-DEa1djpJ.js +1 -0
- package/dist/chunks/runtimeObserver-B4KekIF0.js +1 -0
- package/dist/chunks/runtimeObserver-BUOcYxiK.js +10 -0
- package/dist/chunks/sandbox-adapter-C--j-c76.js +1 -0
- package/dist/chunks/sandbox-toggle-DLBL7myN.js +1 -0
- package/dist/chunks/searchExtraTools-CBYp5XeI.js +1 -0
- package/dist/chunks/sentry-B7ZBc8fA.js +13 -0
- package/dist/chunks/session-DWYQk9YN.js +2 -0
- package/dist/chunks/sessionDiscovery-BP0nv36F.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-DVilA3Mm.js +1 -0
- package/dist/chunks/sessionMemory-cMgcTxtP.js +1 -0
- package/dist/chunks/sessionMemory-pT4lc1C-.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BgYf2OvX.js +1 -0
- package/dist/chunks/sessionObserver-CzyEF7mg.js +1 -0
- package/dist/chunks/sessionObserver-D4SV0Ar3.js +20 -0
- package/dist/chunks/sessionStorage-CXBgVAx-.js +1 -0
- package/dist/chunks/sessionStoragePortable-CJUZrbIq.js +3 -0
- package/dist/chunks/sessionTitle-CkrnWEW1.js +14 -0
- package/dist/chunks/sessionTracing-Caw-kvQr.js +11 -0
- package/dist/chunks/settingsSync-Dn_lGonC.js +1 -0
- package/dist/chunks/setup-DGkOT4DX.js +2 -0
- package/dist/chunks/setup-Dihjl7jo.js +9 -0
- package/dist/chunks/setup-II1titXI.js +1 -0
- package/dist/chunks/shadowedRuleDetection-DASW3j9H.js +1 -0
- package/dist/chunks/shellQuote-CBjhlaFO.js +1 -0
- package/dist/chunks/sideQuestion-C1qbLTAL.js +20 -0
- package/dist/chunks/sink-BSPyC453.js +1 -0
- package/dist/chunks/sink-CqOAfFlL.js +1 -0
- package/dist/chunks/sinks-BT_lBY6T.js +2 -0
- package/dist/chunks/sinks-CpuRIC3H.js +1 -0
- package/dist/chunks/skill-learning-kh0HKn6u.js +5 -0
- package/dist/chunks/skillChangeDetector-DQuNepIV.js +1 -0
- package/dist/chunks/skillGapStore-B1gUQXhE.js +5 -0
- package/dist/chunks/skillGapStore-CFmLJlYm.js +1 -0
- package/dist/chunks/skillGenerator-DIAwRpPg.js +8 -0
- package/dist/chunks/skillLearning-Bxu1Uzl-.js +1 -0
- package/dist/chunks/skillLearning-CxAbHYEk.js +1 -0
- package/dist/chunks/skillPanel-B9zJLHKV.js +28 -0
- package/dist/chunks/skillSearchPanel-C1O9sxYS.js +21 -0
- package/dist/chunks/skills-C6_3snFY.js +1 -0
- package/dist/chunks/sprites-59l7vF4l.js +1 -0
- package/dist/chunks/src-BGzuPZ5q.js +26 -0
- package/dist/chunks/src-kgpr3s-l.js +1 -0
- package/dist/chunks/startupProfiler-CAntGAbs.js +3 -0
- package/dist/chunks/startupProfiler-WtUzkMKV.js +1 -0
- package/dist/chunks/stats-BmGdg4nj.js +1 -0
- package/dist/chunks/status-KLPT7uYP.js +1 -0
- package/dist/chunks/statusNoticeHelpers-DuqyBY-N.js +1 -0
- package/dist/chunks/stdio-Cg20AQ5W.js +1 -0
- package/dist/chunks/stickers-DDAm--86.js +1 -0
- package/dist/chunks/stringUtils-KZoO4GUd.js +4 -0
- package/dist/chunks/subprocessEnv-D4Cbyl2J.js +1 -0
- package/dist/chunks/systemPromptSections-CVpefuSD.js +1 -0
- package/dist/chunks/tag-0vahEnrx.js +11 -0
- package/dist/chunks/tasks-zVPemGv7.js +1 -0
- package/dist/chunks/teamHelpers-B83RwCCC.js +1 -0
- package/dist/chunks/teamHelpers-CXAmvFco.js +1 -0
- package/dist/chunks/teammateModeSnapshot-AdUFmPGC.js +1 -0
- package/dist/chunks/teammateModeSnapshot-CdiglTzv.js +1 -0
- package/dist/chunks/teleport-D6PvdjPy.js +1 -0
- package/dist/chunks/templateJobs-Ox5ZTKjW.js +12 -0
- package/dist/chunks/terminalSetup-Dh70ynBX.js +1 -0
- package/dist/chunks/terminalSetup-hLCi-2uB.js +33 -0
- package/dist/chunks/theme-DxgUVq9C.js +1 -0
- package/dist/chunks/thinkback-C5vFU8dM.js +1 -0
- package/dist/chunks/thinkback-DWgU7Qhr.js +1 -0
- package/dist/chunks/thinkback-play-CDzY6Ux4.js +1 -0
- package/dist/chunks/tmux-DelKEjda.js +1 -0
- package/dist/chunks/toolEventObserver-DPoMAJwr.js +1 -0
- package/dist/chunks/toolEventObserver-jO6-mlFU.js +1 -0
- package/dist/chunks/toolPool-BmA-BnAq.js +1 -0
- package/dist/chunks/toolPool-Dgn1Clq8.js +1 -0
- package/dist/chunks/trustedDevice-CYR5AgSB.js +1 -0
- package/dist/chunks/trustedDevice-D35gYkBT.js +1 -0
- package/dist/chunks/tui-DoOiz2RW.js +6 -0
- package/dist/chunks/types-BCy5hsQR.js +1 -0
- package/dist/chunks/types-KeqFPzY5.js +17 -0
- package/dist/chunks/udsClient-CBF_cZFW.js +1 -0
- package/dist/chunks/ultrareviewCommand-o4GjzoXK.js +3 -0
- package/dist/chunks/undercover-B4xr62Ux.js +31 -0
- package/dist/chunks/undercover-nakrQDLh.js +1 -0
- package/dist/chunks/up-DaiW-V1N.js +12 -0
- package/dist/chunks/updateCCB-Cthn50OV.js +11 -0
- package/dist/chunks/upgrade-D4Id4ebd.js +1 -0
- package/dist/chunks/upgrade-DJTCV8sr.js +1 -0
- package/dist/chunks/upload-BFDXvdfb.js +1 -0
- package/dist/chunks/upstreamproxy-CLf1UaJv.js +11 -0
- package/dist/chunks/usage-Csbso5mD.js +1 -0
- package/dist/chunks/usage-DxudeFLL.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-BHi41Ku_.js +1 -0
- package/dist/chunks/useMainLoopModel-CEqP4HOc.js +1 -0
- package/dist/chunks/useManagePlugins-BmS3Adja.js +1 -0
- package/dist/chunks/useMergedTools-wR6Bglqq.js +1 -0
- package/dist/chunks/useSearchInput-BhKAGgEN.js +1 -0
- package/dist/chunks/useSettingsErrors-CjK3P-Ki.js +1 -0
- package/dist/chunks/useTerminalSize-Du-EamDN.js +1 -0
- package/dist/chunks/useVoice-DP1hHBWA.js +1 -0
- package/dist/chunks/util-CMSErQoz.js +1 -0
- package/dist/chunks/utils-CAQfwbv8.js +1 -0
- package/dist/chunks/validatePlugin-_g0AqWZG.js +1 -0
- package/dist/chunks/vim-8y-2Q09k.js +1 -0
- package/dist/chunks/voice-BJAsr0K-.js +2 -0
- package/dist/chunks/voice-YtzCcIoM.js +8 -0
- package/dist/chunks/voiceModeEnabled-BD9GZhQ3.js +1 -0
- package/dist/chunks/voiceModeEnabled-DZbxaFIg.js +1 -0
- package/dist/chunks/voiceStreamSTT-B1T-8adN.js +1 -0
- package/dist/chunks/voiceStreamSTT-B39XaGOU.js +1 -0
- package/dist/chunks/web-tools-DVIvcP41.js +1 -0
- package/dist/chunks/windowsPaths-BeDSnJ23.js +2 -0
- package/dist/chunks/windowsPaths-ttHiMKpR.js +1 -0
- package/dist/chunks/workerRegistry-60_UCyc3.js +1 -0
- package/dist/chunks/worktree-DNK8NprA.js +1 -0
- package/dist/chunks/worktreeModeEnabled-RtizNgNg.js +1 -0
- package/dist/chunks/xml-CTdKuU6f.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-BqR8LhJq.js +0 -1
- package/dist/chunks/App-DkBMWXkK.js +0 -1
- package/dist/chunks/ApproveApiKey-5xd0lUV7.js +0 -1
- package/dist/chunks/ApproveApiKey-Dmr2VaVA.js +0 -1
- package/dist/chunks/AssistantSessionChooser-C7rigDkQ.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-RtEwbumC.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-7s3ULbNF.js +0 -1
- package/dist/chunks/ClaudeInChromeOnboarding-Bjv-sERa.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BTysDIlI.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DosNL91g.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-Cc1yaM-M.js +0 -1
- package/dist/chunks/DesktopHandoff-Cy89ZB_9.js +0 -1
- package/dist/chunks/DevChannelsDialog-ws8prcNK.js +0 -1
- package/dist/chunks/DiffDialog-BhqgxA7o.js +0 -3
- package/dist/chunks/Doctor-BWouB_9X.js +0 -1
- package/dist/chunks/Doctor-Ts5k8hn1.js +0 -3
- package/dist/chunks/ExitFlow-BBoImtT_.js +0 -2
- package/dist/chunks/Feedback-BVbSMBwY.js +0 -2
- package/dist/chunks/Grove-CTQrX7WO.js +0 -1
- package/dist/chunks/Grove-ZMHK4CBZ.js +0 -11
- package/dist/chunks/HybridTransport-B9g074Y1.js +0 -4
- package/dist/chunks/ITermBackend-DaFK8DOH.js +0 -1
- package/dist/chunks/InvalidConfigDialog-BkZkVKB4.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-Lr60eQWj.js +0 -1
- package/dist/chunks/MCPConnectionManager-DmJ6dLOp.js +0 -1
- package/dist/chunks/McpParsingWarnings-CE2pQPXV.js +0 -1
- package/dist/chunks/MessageSelector-BT1FDbwv.js +0 -3
- package/dist/chunks/Messages-DT2gDtrJ.js +0 -11
- package/dist/chunks/Onboarding-DsqnXQel.js +0 -1
- package/dist/chunks/OverageCreditUpsell-UWtCrOmN.js +0 -1
- package/dist/chunks/PluginSettings-OJQz3d5V.js +0 -17
- package/dist/chunks/PromptInputFooterSuggestions-BImBB6Yk.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-CblAb9vk.js +0 -1
- package/dist/chunks/QueryEngine-_re1pGHr.js +0 -1
- package/dist/chunks/REPL-eBTeslsR.js +0 -147
- package/dist/chunks/REPL-wIg0cBqS.js +0 -1
- package/dist/chunks/RemoteCallout-DMQai8_P.js +0 -1
- package/dist/chunks/RemoteSessionManager-DQmsHvj_.js +0 -2
- package/dist/chunks/ResumeConversation-D81hDeTl.js +0 -1
- package/dist/chunks/SSETransport-BbeM6bi9.js +0 -4
- package/dist/chunks/SearchExtraToolsTool-QbJQCWXd.js +0 -1
- package/dist/chunks/SentryErrorBoundary-BQJXHbWh.js +0 -2
- package/dist/chunks/SentryErrorBoundary-Cnw74oVG.js +0 -1
- package/dist/chunks/Settings-DiXc-_IG.js +0 -2
- package/dist/chunks/TeleportProgress-B3oRJlWH.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-GPuEipFy.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-CcDuR6o9.js +0 -1
- package/dist/chunks/ThemePicker-BjSRjA_L.js +0 -1
- package/dist/chunks/TmuxBackend-BE3zsPKE.js +0 -9
- package/dist/chunks/TrustDialog-B6Qg0xUr.js +0 -1
- package/dist/chunks/TungstenTool-C5IqKVr0.js +0 -1
- package/dist/chunks/ValidationErrorsList-C5BoLiye.js +0 -2
- package/dist/chunks/WelcomeV2-BJAKZYz1.js +0 -1
- package/dist/chunks/WindowsTerminalBackend-BcwpxU2Q.js +0 -2
- package/dist/chunks/add-dir-OR7-VVcq.js +0 -1
- package/dist/chunks/agentDisplay-CMqTUh0A.js +0 -1
- package/dist/chunks/agents-DRtgUZ6t.js +0 -103
- package/dist/chunks/agents-EolUGDZB.js +0 -2
- package/dist/chunks/ant-Bgl31h7a.js +0 -1
- package/dist/chunks/api-BpQPVgif.js +0 -1
- package/dist/chunks/api-xFvB7WoB.js +0 -1
- package/dist/chunks/asciicast-CJObpRg9.js +0 -1
- package/dist/chunks/asciicast-Dr_Div_R.js +0 -4
- package/dist/chunks/assistant-CENsWvTb.js +0 -1
- package/dist/chunks/assistant-CHawoD04.js +0 -1
- package/dist/chunks/assistant-s7XNIA76.js +0 -1
- package/dist/chunks/auth-DX12yVM8.js +0 -1
- package/dist/chunks/auth-h6VL9BbC.js +0 -1
- package/dist/chunks/autoMode-BDzVqEPm.js +0 -45
- package/dist/chunks/autonomy-CeqOXzJl.js +0 -19
- package/dist/chunks/autonomy-D2YudQnH.js +0 -1
- package/dist/chunks/autonomyPanel-B0OQV4lv.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CvHD981l.js +0 -17
- package/dist/chunks/backgroundHousekeeping-DMkk-QoZ.js +0 -1
- package/dist/chunks/banner-DNLUJFS_.js +0 -2
- package/dist/chunks/bg-D_H-uZDS.js +0 -9
- package/dist/chunks/bg-FtpmvQuT.js +0 -1
- package/dist/chunks/branch-D44HjlJp.js +0 -3
- package/dist/chunks/break-cache-ByJ7U2Ts.js +0 -8
- package/dist/chunks/bridge-4sldfa8u.js +0 -2
- package/dist/chunks/bridgeConfig-BM7iHryd.js +0 -1
- package/dist/chunks/bridgeConfig-CcCNsSBX.js +0 -1
- package/dist/chunks/bridgeEnabled-CYddgTU1.js +0 -1
- package/dist/chunks/bridgeEnabled-DoT2l1Oj.js +0 -1
- package/dist/chunks/bridgeMain-DaO51duk.js +0 -68
- package/dist/chunks/bridgeMain-Dc4-ZK69.js +0 -1
- package/dist/chunks/bridgeMessaging-IlSWKGmC.js +0 -1
- package/dist/chunks/bridgePointer-fFD_tbSk.js +0 -1
- package/dist/chunks/browser-DwnUS505.js +0 -1
- package/dist/chunks/btw-CrdUyRUP.js +0 -1
- package/dist/chunks/buddy-Ci0hdCf9.js +0 -3
- package/dist/chunks/bypassPermissionsKillswitch-BWOlc_sK.js +0 -1
- package/dist/chunks/caches-BHRJHGlc.js +0 -1
- package/dist/chunks/caches-CitduRKp.js +0 -3
- package/dist/chunks/ccrClient-yNKhQYnf.js +0 -1
- package/dist/chunks/changeDetector-B1tCH9Pa.js +0 -1
- package/dist/chunks/channelNotification-D8NPg8I8.js +0 -1
- package/dist/chunks/channelNotification-oE3eipDZ.js +0 -1
- package/dist/chunks/chrome-CwAwCY0V.js +0 -1
- package/dist/chunks/chromeNativeHost-63xqELw-.js +0 -1
- package/dist/chunks/claudeDesktop-CX1AsJie.js +0 -1
- package/dist/chunks/cleanup-C0gyKaOb.js +0 -1
- package/dist/chunks/clear-B5D08sZ0.js +0 -1
- package/dist/chunks/cliLaunch-8aeIk2ts.js +0 -1
- package/dist/chunks/client-un1k_6md.js +0 -1
- package/dist/chunks/color-BtVvrSvq.js +0 -1
- package/dist/chunks/commands--qEK1j9j.js +0 -1
- package/dist/chunks/commitAttribution-AEb-sE-t.js +0 -1
- package/dist/chunks/commitAttribution-HP_CWP0X.js +0 -2
- package/dist/chunks/common-BBRP_KzA.js +0 -1
- package/dist/chunks/common-BD4Q7osK.js +0 -1
- package/dist/chunks/common-C56I-_O3.js +0 -1
- package/dist/chunks/compact-BNhxD2UA.js +0 -3
- package/dist/chunks/companion-BlhNrZiL.js +0 -1
- package/dist/chunks/completionCache-BHSsdkBs.js +0 -1
- package/dist/chunks/completionCache-Daqaxlf3.js +0 -4
- package/dist/chunks/config-9z8716kz.js +0 -1
- package/dist/chunks/config-f8Cx16Z6.js +0 -1
- package/dist/chunks/context-BdOjhAmM.js +0 -1
- package/dist/chunks/context-noninteractive-CnaDbgvf.js +0 -54
- package/dist/chunks/context-noninteractive-DRM7gbFk.js +0 -1
- package/dist/chunks/conversation-B9pq-m4L.js +0 -1
- package/dist/chunks/conversation-DUxXVrGj.js +0 -1
- package/dist/chunks/copy-Cjl0-hg1.js +0 -7
- package/dist/chunks/createSSHSession-CYaHalxc.js +0 -6
- package/dist/chunks/createSession-DoR2K7ay.js +0 -1
- package/dist/chunks/createSession-VlSLvi7J.js +0 -1
- package/dist/chunks/cron-DiW7eIPP.js +0 -1
- package/dist/chunks/cronJitterConfig-DjSd7nvj.js +0 -6
- package/dist/chunks/crossProjectResume-CDWr5DFl.js +0 -40
- package/dist/chunks/daemon-FAp0WyY6.js +0 -2
- package/dist/chunks/datadog-CahWdK03.js +0 -1
- package/dist/chunks/datadog-DPkKCR8M.js +0 -1
- package/dist/chunks/desktop-y3mzgaWo.js +0 -1
- package/dist/chunks/detached-Brq3-vHi.js +0 -5
- package/dist/chunks/detectRepository-CSN3yxkq.js +0 -1
- package/dist/chunks/detectRepository-CbR0WgtE.js +0 -1
- package/dist/chunks/detection-BPPZCanO.js +0 -1
- package/dist/chunks/detection-DrdKrqbQ.js +0 -1
- package/dist/chunks/diff-hpp0dp6U.js +0 -1
- package/dist/chunks/directoryCompletion-DAc3u1K2.js +0 -1
- package/dist/chunks/doctor-B230p0R_.js +0 -1
- package/dist/chunks/earlyInput-BFcdUMaX.js +0 -2
- package/dist/chunks/earlyInput-vv9abU2L.js +0 -1
- package/dist/chunks/effort-D7i2v6vd.js +0 -9
- package/dist/chunks/entry-Du3gtq9o.js +0 -14
- package/dist/chunks/env-BH-OBzcA.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CKD4eOEe.js +0 -1
- package/dist/chunks/envLessBridgeConfig-DI0ouryy.js +0 -1
- package/dist/chunks/execFileNoThrow-B_aZH_GP.js +0 -1
- package/dist/chunks/executor-BJb5d6mo.js +0 -1
- package/dist/chunks/executor-Dmn3RTuI.js +0 -1561
- package/dist/chunks/exit-fntBGxEC.js +0 -1
- package/dist/chunks/export-Dy9M7FnZ.js +0 -2
- package/dist/chunks/exportRenderer-Ckv4v0ye.js +0 -1
- package/dist/chunks/extra-usage-DLEvlKzs.js +0 -1
- package/dist/chunks/extra-usage-core-3KkeQSve.js +0 -1
- package/dist/chunks/extra-usage-noninteractive-DUezD54f.js +0 -1
- package/dist/chunks/extra-usage-pU11YXHS.js +0 -1
- package/dist/chunks/extraUsage-B-l-oe-7.js +0 -1
- package/dist/chunks/extractMemories-CXarlmZp.js +0 -1
- package/dist/chunks/fast-BzfzSH7K.js +0 -1
- package/dist/chunks/fast-CbLu_WYL.js +0 -1
- package/dist/chunks/featureCheck-p7OeCYzj.js +0 -1
- package/dist/chunks/feedback-DiyZIbov.js +0 -1
- package/dist/chunks/fileStateCache-C7-TxF8G.js +0 -1
- package/dist/chunks/files-DYvAZGxp.js +0 -2
- package/dist/chunks/firstPartyEventLogger-Dig8Mv7_.js +0 -1
- package/dist/chunks/flushGate-Ci3NHOV4.js +0 -1
- package/dist/chunks/gates-CtkQH6jy.js +0 -1
- package/dist/chunks/gates-xscCu8-N.js +0 -1
- package/dist/chunks/gemini-BCuY2aYj.js +0 -1
- package/dist/chunks/generateRecap-DA0SNyFR.js +0 -1
- package/dist/chunks/generateSessionName-BtQ4NGXP.js +0 -1
- package/dist/chunks/genericProcessUtils-D-78JZxz.js +0 -23
- package/dist/chunks/git-BZEgupMC.js +0 -1
- package/dist/chunks/git-DayFjsvj.js +0 -6
- package/dist/chunks/githubRepoPathMapping-C5RkiJWj.js +0 -1
- package/dist/chunks/goal-B6GHfd9J.js +0 -3
- package/dist/chunks/grok-DDM6xYuy.js +0 -1
- package/dist/chunks/growthbook-D-Po5Uxl.js +0 -1
- package/dist/chunks/heapdump-DHlUfpVV.js +0 -5
- package/dist/chunks/help-BulgC9m7.js +0 -1
- package/dist/chunks/hooks-D5AcFnD1.js +0 -1
- package/dist/chunks/hooks-jxIrev-X.js +0 -79
- package/dist/chunks/hostAdapter-BvraKy0o.js +0 -1
- package/dist/chunks/hostGuard-CWijeIyE.js +0 -1
- package/dist/chunks/ide-tx4qMFln.js +0 -2
- package/dist/chunks/inboundAttachments-C93Q7Dvt.js +0 -1
- package/dist/chunks/inboundAttachments-DxcFiX4f.js +0 -1
- package/dist/chunks/initReplBridge-BEldrf6f.js +0 -1
- package/dist/chunks/insights-HEsEDeCQ.js +0 -822
- package/dist/chunks/install-DRsM0bJO.js +0 -1
- package/dist/chunks/install-github-app-BVK5Z95c.js +0 -147
- package/dist/chunks/install-slack-app-DCw3O2J_.js +0 -1
- package/dist/chunks/instrumentation-DJ-R1s8C.js +0 -12
- package/dist/chunks/job-CUz_OGIq.js +0 -2
- package/dist/chunks/jwtUtils-DVyv2jab.js +0 -1
- package/dist/chunks/keybindings-Chr5nGBu.js +0 -2
- package/dist/chunks/lang-C7kJlPIh.js +0 -1
- package/dist/chunks/language-CQXwoDkI.js +0 -1
- package/dist/chunks/language-Lx3WlBN6.js +0 -1
- package/dist/chunks/launchAgentsPlatform-Fsslu42L.js +0 -1
- package/dist/chunks/launchAutofixPr-Cww8uS_5.js +0 -18
- package/dist/chunks/launchLocalMemory-BywmyvSJ.js +0 -3
- package/dist/chunks/launchLocalVault-BU3a5NV7.js +0 -3
- package/dist/chunks/launchMemoryStores-QUCODCJS.js +0 -1
- package/dist/chunks/launchOnboarding-BriZ0oIA.js +0 -8
- package/dist/chunks/launchSchedule-uLm7zt_B.js +0 -1
- package/dist/chunks/launchSkillStore-DMo2bV8X.js +0 -1
- package/dist/chunks/launchTeleport-DgQWSfXM.js +0 -3
- package/dist/chunks/launchVault-DfnBBFne.js +0 -1
- package/dist/chunks/loadAgentsDir-Br5fGLLI.js +0 -4697
- package/dist/chunks/loadAgentsDir-DDYPdQKP.js +0 -1
- package/dist/chunks/loadPluginHooks-C4soqr6g.js +0 -1
- package/dist/chunks/localSearch-CELyiWF6.js +0 -1
- package/dist/chunks/localSearch-DhZMcy5t.js +0 -1
- package/dist/chunks/log-DS97_rIr.js +0 -1
- package/dist/chunks/login-CvvIpkpq.js +0 -1
- package/dist/chunks/login-DjgITOAw.js +0 -1
- package/dist/chunks/logoV2Utils-BN_HrHSc.js +0 -1
- package/dist/chunks/logout-DOFJpZEJ.js +0 -1
- package/dist/chunks/magicDocs-2Zr7bYY_.js +0 -57
- package/dist/chunks/main-BafHJuKH.js +0 -31
- package/dist/chunks/main-D61CvHRy.js +0 -1312
- package/dist/chunks/mappers-BCiceNt3.js +0 -1
- package/dist/chunks/mcp-BV4m1Gbl.js +0 -2
- package/dist/chunks/mcp-CrAgAK9u.js +0 -1
- package/dist/chunks/mcp-DK4m73gO.js +0 -6
- package/dist/chunks/mcpServer-7zyXl9Wg.js +0 -1
- package/dist/chunks/mcpServer-sa9Z183j.js +0 -1
- package/dist/chunks/memoize-CPexXTP7.js +0 -1
- package/dist/chunks/memory-BrJPVgxn.js +0 -1
- package/dist/chunks/mobile-Cydobb55.js +0 -2
- package/dist/chunks/mode-Cr-NTlRa.js +0 -2
- package/dist/chunks/model-CCjuMV6k.js +0 -1
- package/dist/chunks/model-aJS_plgM.js +0 -1
- package/dist/chunks/onChangeAppState-C9EvI3EH.js +0 -1
- package/dist/chunks/openai-Cvb_-1A-.js +0 -10
- package/dist/chunks/overageCreditGrant-cGQilawd.js +0 -1
- package/dist/chunks/panel-ByW1omJn.js +0 -1
- package/dist/chunks/panel-DO_faHV-.js +0 -1
- package/dist/chunks/panelCall-DqZuxAf0.js +0 -1
- package/dist/chunks/parser-DbKSpFRq.js +0 -1
- package/dist/chunks/passes-DsrceO14.js +0 -1
- package/dist/chunks/path-nCzt96pE.js +0 -1
- package/dist/chunks/paths-DfGsIjPm.js +0 -39
- package/dist/chunks/permissions-CjPIu4IE.js +0 -3
- package/dist/chunks/permissions-Ps_D01ZB.js +0 -1
- package/dist/chunks/pipeTransport-C5u1K0wu.js +0 -1
- package/dist/chunks/plan-YjMAcn6g.js +0 -1
- package/dist/chunks/platform-DYZVoA9J.js +0 -2
- package/dist/chunks/plugin-Oux5bBQj.js +0 -1
- package/dist/chunks/pluginAutoupdate-Dl9U-fbk.js +0 -1
- package/dist/chunks/pluginBlocklist-BzI5DNeN.js +0 -1
- package/dist/chunks/pluginCliCommands-CExAcsaR.js +0 -1
- package/dist/chunks/pluginFlagging-BeqrbhgG.js +0 -1
- package/dist/chunks/pluginOperations-s0FQGOBm.js +0 -2
- package/dist/chunks/pluginStartupCheck-BVag9B-T.js +0 -1
- package/dist/chunks/pluginStartupCheck-BuorUEEf.js +0 -1
- package/dist/chunks/plugins-DTQHVJtY.js +0 -4
- package/dist/chunks/policyLimits-zoyF_6O4.js +0 -1
- package/dist/chunks/pollConfig-C19GiX7i.js +0 -1
- package/dist/chunks/poller-DADqVTWi.js +0 -1
- package/dist/chunks/poor-Bx5vvamq.js +0 -1
- package/dist/chunks/poorMode-BCoeB5zB.js +0 -1
- package/dist/chunks/poorMode-CTd_csCl.js +0 -1
- package/dist/chunks/print-UXl3rG8y.js +0 -39
- package/dist/chunks/privacy-settings-e43D9a4o.js +0 -1
- package/dist/chunks/processBashCommand-CvR9-gf8.js +0 -1
- package/dist/chunks/processSlashCommand-CB3wyAX7.js +0 -6
- package/dist/chunks/projectContext-D3_u80TY.js +0 -1
- package/dist/chunks/prompt-53lRY98R.js +0 -1
- package/dist/chunks/prompt-B8M-HLIS.js +0 -227
- package/dist/chunks/prompt-CooZNM1u.js +0 -1
- package/dist/chunks/promptEditor-CHiopfD7.js +0 -4
- package/dist/chunks/protocolHandler-DjivYn8H.js +0 -13
- package/dist/chunks/rate-limit-options-B-vndk5W.js +0 -1
- package/dist/chunks/rcDebugLog-BoroyfjB.js +0 -11
- package/dist/chunks/referral-DOqhciQu.js +0 -1
- package/dist/chunks/refresh-C8uLznwm.js +0 -1
- package/dist/chunks/registerProtocol-4lQ7O4Cc.js +0 -36
- package/dist/chunks/registry-q6v98JYd.js +0 -1
- package/dist/chunks/release-notes-C7JHshX3.js +0 -4
- package/dist/chunks/releaseNotes-CXY-xAja.js +0 -2
- package/dist/chunks/reload-plugins-DLS5lQcc.js +0 -1
- package/dist/chunks/remote-env-DhHea8yK.js +0 -1
- package/dist/chunks/remoteBridgeCore-BhOLhQIA.js +0 -1
- package/dist/chunks/remoteControlServer-CI0F83pg.js +0 -3
- package/dist/chunks/rename-DiKWWCzB.js +0 -1
- package/dist/chunks/renderOptions-DKe32LfM.js +0 -1
- package/dist/chunks/resume-DA4ToJFW.js +0 -2
- package/dist/chunks/runtimeObserver-BfVC8KK9.js +0 -1
- package/dist/chunks/runtimeObserver-DetZ5Tek.js +0 -10
- package/dist/chunks/sandbox-adapter-wh4cKN45.js +0 -1
- package/dist/chunks/sandbox-toggle-D8MgV0DT.js +0 -1
- package/dist/chunks/searchExtraTools-DbPpcAPw.js +0 -1
- package/dist/chunks/sentry-C3sL9nhF.js +0 -13
- package/dist/chunks/session-Bd-4QCqc.js +0 -2
- package/dist/chunks/sessionDiscovery-D_KPF86E.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-COne5L2E.js +0 -1
- package/dist/chunks/sessionMemory-0Jqo1_MV.js +0 -1
- package/dist/chunks/sessionMemory-BDt_8bNB.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BFIJ1nqF.js +0 -1
- package/dist/chunks/sessionObserver-CEky1SLb.js +0 -1
- package/dist/chunks/sessionObserver-CQxIKV8D.js +0 -20
- package/dist/chunks/sessionStorage-D1XhqZyW.js +0 -1
- package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +0 -3
- package/dist/chunks/sessionTitle-CB0ZEkS_.js +0 -14
- package/dist/chunks/sessionTracing-BIKXLTJZ.js +0 -11
- package/dist/chunks/settingsSync-pI3L3CeR.js +0 -1
- package/dist/chunks/setup-BSi50fkU.js +0 -1
- package/dist/chunks/setup-DjsmjRKQ.js +0 -2
- package/dist/chunks/setup-Dq0_SRA1.js +0 -9
- package/dist/chunks/shadowedRuleDetection-DvAjOOPL.js +0 -1
- package/dist/chunks/shellQuote-D8XPeqkc.js +0 -1
- package/dist/chunks/sideQuestion-BrTA8ooG.js +0 -20
- package/dist/chunks/sink-CqWxcRl9.js +0 -1
- package/dist/chunks/sink-Dkat5kH9.js +0 -1
- package/dist/chunks/sinks--frMI4-5.js +0 -2
- package/dist/chunks/sinks-CvPAVcMY.js +0 -1
- package/dist/chunks/skill-learning-2LV0yuwF.js +0 -5
- package/dist/chunks/skillChangeDetector-B5CGPl7e.js +0 -1
- package/dist/chunks/skillGapStore-Dc29T-OG.js +0 -1
- package/dist/chunks/skillGapStore-KzRf6Ezr.js +0 -5
- package/dist/chunks/skillGenerator-BdOHsgc4.js +0 -8
- package/dist/chunks/skillLearning-CdcVIG14.js +0 -1
- package/dist/chunks/skillLearning-DXWMxSA2.js +0 -1
- package/dist/chunks/skillPanel-zMY8o-86.js +0 -28
- package/dist/chunks/skillSearchPanel-l8aolUP8.js +0 -21
- package/dist/chunks/skills-BeMWJPup.js +0 -1
- package/dist/chunks/sprites-qel_EgTP.js +0 -1
- package/dist/chunks/src-BIPP3_mo.js +0 -26
- package/dist/chunks/src-DJXKJavk.js +0 -1
- package/dist/chunks/startupProfiler-CnDpob1v.js +0 -3
- package/dist/chunks/startupProfiler-TrMfE6Q4.js +0 -1
- package/dist/chunks/stats-CEBfahqM.js +0 -1
- package/dist/chunks/status-C9KXyfDk.js +0 -1
- package/dist/chunks/statusNoticeHelpers-CxoN9oDh.js +0 -1
- package/dist/chunks/stdio-BEEzuxaZ.js +0 -1
- package/dist/chunks/stickers-eHrGA1W5.js +0 -1
- package/dist/chunks/subprocessEnv-CggQWZCx.js +0 -1
- package/dist/chunks/systemPromptSections-DB93ZNWP.js +0 -1
- package/dist/chunks/tag-Dvl7Us9y.js +0 -11
- package/dist/chunks/tasks-BhiwUF0n.js +0 -1
- package/dist/chunks/teamHelpers-COQazluD.js +0 -1
- package/dist/chunks/teamHelpers-Mgfrv-Jf.js +0 -1
- package/dist/chunks/teammateModeSnapshot-8EWjlA-s.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BV-P8s5r.js +0 -1
- package/dist/chunks/teleport-U5Zgqw3H.js +0 -1
- package/dist/chunks/templateJobs-C3idypN_.js +0 -12
- package/dist/chunks/terminalSetup-CmAEgt-5.js +0 -33
- package/dist/chunks/terminalSetup-mvAN4no7.js +0 -1
- package/dist/chunks/theme-BD2H4vJi.js +0 -1
- package/dist/chunks/thinkback-BOByXYp2.js +0 -1
- package/dist/chunks/thinkback-Dzu2mnNF.js +0 -1
- package/dist/chunks/thinkback-play-BX1K2UMY.js +0 -1
- package/dist/chunks/tmux-DruHFjDy.js +0 -1
- package/dist/chunks/toolEventObserver-B6cLV_dK.js +0 -1
- package/dist/chunks/toolEventObserver-i6it3p2_.js +0 -1
- package/dist/chunks/toolPool--2gNFbrz.js +0 -1
- package/dist/chunks/toolPool-dNV2JxUI.js +0 -1
- package/dist/chunks/trustedDevice-DY8OosTr.js +0 -1
- package/dist/chunks/trustedDevice-zya_Ml1N.js +0 -1
- package/dist/chunks/tui-KoYD82tT.js +0 -6
- package/dist/chunks/types-CQ1wrnQ0.js +0 -1
- package/dist/chunks/types-D5R26wwH.js +0 -17
- package/dist/chunks/udsClient-RkYuzeZC.js +0 -1
- package/dist/chunks/ultrareviewCommand-CCkKby4J.js +0 -3
- package/dist/chunks/undercover-CIutVLEO.js +0 -1
- package/dist/chunks/undercover-D9O2McNG.js +0 -31
- package/dist/chunks/up-BPM85EYl.js +0 -12
- package/dist/chunks/updateCCB-Bmn3Y63Y.js +0 -11
- package/dist/chunks/upgrade-D3rVOeHO.js +0 -1
- package/dist/chunks/upgrade-Dq3l14ZY.js +0 -1
- package/dist/chunks/upload-1PmElPfW.js +0 -1
- package/dist/chunks/upstreamproxy-BBTSJnad.js +0 -11
- package/dist/chunks/usage-B5G8FOZ3.js +0 -1
- package/dist/chunks/usage-VtTu7beE.js +0 -1
- package/dist/chunks/useMainLoopModel-CaQLIr1V.js +0 -1
- package/dist/chunks/useManagePlugins-BvoeOnqq.js +0 -1
- package/dist/chunks/useMergedTools-C133BfRp.js +0 -1
- package/dist/chunks/useSearchInput-CROB7AbC.js +0 -1
- package/dist/chunks/useSettingsErrors-DRxtFXoe.js +0 -1
- package/dist/chunks/useVoice-BQ9aSFJe.js +0 -1
- package/dist/chunks/util-BZnJgF79.js +0 -1
- package/dist/chunks/utils-4gsxQpga.js +0 -1
- package/dist/chunks/validatePlugin-DlrnBhPA.js +0 -1
- package/dist/chunks/vim-BXQCLoFJ.js +0 -1
- package/dist/chunks/voice-CeRmLRHT.js +0 -2
- package/dist/chunks/voice-QHyDff3f.js +0 -8
- package/dist/chunks/voiceModeEnabled-Bq_rttkL.js +0 -1
- package/dist/chunks/voiceModeEnabled-CLAVCVLW.js +0 -1
- package/dist/chunks/voiceStreamSTT-BDKenO5F.js +0 -1
- package/dist/chunks/voiceStreamSTT-CL52x8wZ.js +0 -1
- package/dist/chunks/windowsPaths-43st5EQF.js +0 -1
- package/dist/chunks/windowsPaths-DerzGPcz.js +0 -2
- package/dist/chunks/workerRegistry-BUD3lBk_.js +0 -1
- package/dist/chunks/worktree-C0f9Ke-R.js +0 -1
- package/dist/chunks/worktreeModeEnabled-THQb19xR.js +0 -1
- package/dist/chunks/xml-DvVQHZ1N.js +0 -1
- /package/dist/chunks/{Dialog-DYFGqyDs.js → Dialog-91X6ZGg9.js} +0 -0
- /package/dist/chunks/{InProcessTransport-B0mmAoxw.js → InProcessTransport-B9II3BiO.js} +0 -0
- /package/dist/chunks/{ListItem-OFARanN7.js → ListItem-DCQhApdJ.js} +0 -0
- /package/dist/chunks/{PermissionDialog-5MlJf7ew.js → PermissionDialog-_WQPRYHQ.js} +0 -0
- /package/dist/chunks/{PressEnterToContinue-BdA9zDGs.js → PressEnterToContinue-BJ58eCFC.js} +0 -0
- /package/dist/chunks/{SearchBox-DfOmUoaI.js → SearchBox-CkO4rQ-9.js} +0 -0
- /package/dist/chunks/{TungstenTool-V-Bwqlx3.js → TungstenTool-CnAF4y0E.js} +0 -0
- /package/dist/chunks/{attributionHooks-DZJjA8p9.js → attributionHooks-VGSpz4mk.js} +0 -0
- /package/dist/chunks/{attributionTrailer-CZY9XTcr.js → attributionTrailer-C8uqiLIb.js} +0 -0
- /package/dist/chunks/{autoModeDenials-CGAtAGGf.js → autoModeDenials-DlO5g6E9.js} +0 -0
- /package/dist/chunks/{bedrockClient-DZgaJTHp.js → bedrockClient-BUmO2U-X.js} +0 -0
- /package/dist/chunks/{capacityWake-BXlUpptF.js → capacityWake-DtmDHwEt.js} +0 -0
- /package/dist/chunks/{ccshareResume-CZggHNOf.js → ccshareResume-DKwcd0Vc.js} +0 -0
- /package/dist/chunks/{computerUseLock-BoEK9xYv.js → computerUseLock-Diig5B8p.js} +0 -0
- /package/dist/chunks/{connectHeadless-KNT0Sg7Z.js → connectHeadless-ByewVfOb.js} +0 -0
- /package/dist/chunks/{constants-41VpZw2G.js → constants-BljlAJOX.js} +0 -0
- /package/dist/chunks/{controlMessageCompat-BJhFiS7u.js → controlMessageCompat-Ds-CF-sM.js} +0 -0
- /package/dist/chunks/{dangerousBackend-ByOAEFld.js → dangerousBackend-Dkjtndh1.js} +0 -0
- /package/dist/chunks/{debugUtils-CiEnbhiz.js → debugUtils-l8nsUZ6R.js} +0 -0
- /package/dist/chunks/{distRoot-CcxmnzqQ.js → distRoot-BNg_iO5-.js} +0 -0
- /package/dist/chunks/{escHotkey-DfdC44i7.js → escHotkey-D8WgbSyj.js} +0 -0
- /package/dist/chunks/{esm-C-1qL9Mn.js → esm-vlR7mK5b.js} +0 -0
- /package/dist/chunks/{eventLoopStallDetector-l83_98VR.js → eventLoopStallDetector-bYy0fesH.js} +0 -0
- /package/dist/chunks/{exit-_obETqBv.js → exit-DOBLl8jN.js} +0 -0
- /package/dist/chunks/{featureCheck-Cm0YNDXO.js → featureCheck-j7P30mry.js} +0 -0
- /package/dist/chunks/{fpsMetrics-DOI_SIeY.js → fpsMetrics-DKWp7vng.js} +0 -0
- /package/dist/chunks/{fuse-Bp7rmZ5x.js → fuse-D3B-UE5Y.js} +0 -0
- /package/dist/chunks/{hash-BRmOQc3c.js → hash-CaUkS-30.js} +0 -0
- /package/dist/chunks/{index.min-BJnb9GQI.js → index.min-BNgJ2wVD.js} +0 -0
- /package/dist/chunks/{instinctParser-Bxhe2LOF.js → instinctParser-DOtj1Kni.js} +0 -0
- /package/dist/chunks/{intl-Pse97ORk.js → intl-CLeE9DsD.js} +0 -0
- /package/dist/chunks/{launchCommand-Du91jxMC.js → launchCommand-9eYsPG7W.js} +0 -0
- /package/dist/chunks/{lazySchema-2sOku3cX.js → lazySchema-B0QShMaQ.js} +0 -0
- /package/dist/chunks/{lib-B4Q0Nrpb.js → lib-Cf16LgKj.js} +0 -0
- /package/dist/chunks/{lockfile-CeCEBLtN.js → lockfile-C3JsqLpb.js} +0 -0
- /package/dist/chunks/{modalContext-CmSKRyea.js → modalContext-c5Yqx_CQ.js} +0 -0
- /package/dist/chunks/{normalization-Cox8C0dP.js → normalization-BLfP0Kqt.js} +0 -0
- /package/dist/chunks/{observationStore-BaPq7CKI.js → observationStore-rLlDwRtG.js} +0 -0
- /package/dist/chunks/{openaiShared-Crt0cZLO.js → openaiShared-C-AuktRP.js} +0 -0
- /package/dist/chunks/{output-style-BkOnFmfe.js → output-style-B64-Zum6.js} +0 -0
- /package/dist/chunks/{parseConnectUrl-BFNiff4c.js → parseConnectUrl-DL390ePs.js} +0 -0
- /package/dist/chunks/{parser-BXWr_mLL.js → parser-aIWfAYnt.js} +0 -0
- /package/dist/chunks/{permissions-DXLfdE7b.js → permissions-BsVJvaEe.js} +0 -0
- /package/dist/chunks/{postCommitAttribution-CA9Z2sqn.js → postCommitAttribution-D8MoHFoz.js} +0 -0
- /package/dist/chunks/{projectContext-CwJlxP2Y.js → projectContext-Dn7umMp6.js} +0 -0
- /package/dist/chunks/{prompt-4tea6NJQ.js → prompt-IqfIbvg9.js} +0 -0
- /package/dist/chunks/{proxy-nPT6a6QY.js → proxy-CF7ZDxaW.js} +0 -0
- /package/dist/chunks/{rewind-DTk4TFYB.js → rewind-Djt1zU_3.js} +0 -0
- /package/dist/chunks/{rollback-DbSpxmJE.js → rollback-CtS4yEQx.js} +0 -0
- /package/dist/chunks/{sanitization-DD414_3t.js → sanitization-Ds6zRQyx.js} +0 -0
- /package/dist/chunks/{sdkHeapDumpMonitor-fNRF2fbK.js → sdkHeapDumpMonitor-DLMMNeqo.js} +0 -0
- /package/dist/chunks/{semver-Tw0AFar5.js → semver-Di5OaTd5.js} +0 -0
- /package/dist/chunks/{server-DTd90dmm.js → server-DONKdvGc.js} +0 -0
- /package/dist/chunks/{serverBanner-B7UaaCCl.js → serverBanner-DIyjgIM-.js} +0 -0
- /package/dist/chunks/{serverLog-DRvGpDtt.js → serverLog-D1N5yx8A.js} +0 -0
- /package/dist/chunks/{sessionDataUploader-BDsz_1Uy.js → sessionDataUploader-CsNePsOb.js} +0 -0
- /package/dist/chunks/{sessionManager-Bh-Z-YXy.js → sessionManager-BOmgJd1l.js} +0 -0
- /package/dist/chunks/{slashCommandParsing-Cari0pNg.js → slashCommandParsing-BfanVchF.js} +0 -0
- /package/dist/chunks/{sleep-8Eb9j_Ly.js → sleep-C6koP5Ka.js} +0 -0
- /package/dist/chunks/{src-x7u_sB6m.js → src-BWpNn6Yz.js} +0 -0
- /package/dist/chunks/{src-BRAdBA8A.js → src-C-Ho8kYe.js} +0 -0
- /package/dist/chunks/{src-BlLavFUS.js → src-Cu58IYYb.js} +0 -0
- /package/dist/chunks/{src-CI_jaaBj.js → src-d2UJ68oX.js} +0 -0
- /package/dist/chunks/{state-Ce1HlR-H.js → state-BiRT9RAF.js} +0 -0
- /package/dist/chunks/{staticRender-Br64h1E1.js → staticRender-C5v46np_.js} +0 -0
- /package/dist/chunks/{stdio-D4cT86R0.js → stdio-Oy68T2eE.js} +0 -0
- /package/dist/chunks/{store-DhI7Lcan.js → store-DYC8zeL1.js} +0 -0
- /package/dist/chunks/{subprocessEnv-DV6q6o6w.js → subprocessEnv-DIeTJ-xE.js} +0 -0
- /package/dist/chunks/{systemPromptSections-BcN_XBTx.js → systemPromptSections-DY7epA2Y.js} +0 -0
- /package/dist/chunks/{systemTheme-dDbitcxB.js → systemTheme-eRWGHYSL.js} +0 -0
- /package/dist/chunks/{teammate-DMYOtLTK.js → teammate-CbskW5G9.js} +0 -0
- /package/dist/chunks/{types-RJTEOuIt.js → types-C0nqJFkV.js} +0 -0
- /package/dist/chunks/{useKeybinding-FsOnjW6T.js → useKeybinding-DPOUuymz.js} +0 -0
- /package/dist/chunks/{workSecret-qRMNrQy2.js → workSecret-DJu7k30X.js} +0 -0
- /package/dist/chunks/{worktreeModeEnabled-Db6b_Iy_.js → worktreeModeEnabled-KtHEqeFA.js} +0 -0
- /package/dist/chunks/{xdg-CBxMmQux.js → xdg-BFD9ydDV.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Ct as n,Jn as r,Xn as i,Z as a,cn as o,gn as s,ot as c,qn as l,yn as u}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-DS97_rIr.js";import{$t as h,Ab as g,Ai as _,BE as v,Cn as y,Di as b,Fn as x,Fr as S,In as C,JE as w,KE as T,Mu as E,Nn as D,Nu as O,Ot as k,Tt as A,_d as j,_r as M,by as N,ey as P,gi as F,jb as ee,lv as I,mh as L,mn as R,ph as z,py as B,sr as V,ty as H,uv as U,vd as W,zE as G}from"./loadAgentsDir-Br5fGLLI.js";import{C as K,y as q}from"./rcDebugLog-BoroyfjB.js";import{l as J,r as Y}from"./commitAttribution-HP_CWP0X.js";import{n as X,t as Z}from"./caches-CitduRKp.js";import{randomUUID as Q}from"crypto";function $(){let e=j();if(!e)return;e.markTranscriptReset?.();let t={type:`status`,subtype:`status`,status:`conversation_cleared`,message:`conversation_cleared`,uuid:Q()};e.writeSdkMessages([t])}async function te({setMessages:t,readFileState:o,discoveredSkillNames:d,loadedNestedMemoryPaths:p,getAppState:g,setAppState:y,setConversationId:C}){let w=R();await h(`clear`,{getAppState:g,setAppState:y,signal:AbortSignal.timeout(w),timeoutMs:w});let E=a();E&&f(`tengu_cache_eviction_hint`,{scope:`conversation_clear`,last_request_id:E});let k=new Set,j=[],N=e=>`isBackgrounded`in e&&e.isBackgrounded===!1;if(g)for(let e of Object.values(g().tasks))N(e)||(O(e)?(k.add(e.agentId),j.push(e)):ee(e)&&k.add(e.identity.agentId));t(()=>[]),$();{let{setContextBlocked:t}=(q(),e(K));t(!1)}C&&C(Q()),Z(k),l(null),r(null),i(null),u(),L(c()),o.clear(),d?.clear(),p?.clear(),y&&y(e=>{let t={};for(let[n,r]of Object.entries(e.tasks)){if(!N(r)){t[n]=r;continue}try{r.status===`running`&&(U(r)&&(r.shellCommand?.kill(),r.shellCommand?.cleanup(),r.cleanupTimeoutId&&clearTimeout(r.cleanupTimeoutId)),`abortController`in r&&r.abortController?.abort(),`unregisterCleanup`in r&&r.unregisterCleanup?.())}catch(e){m(e)}D(n)}return{...e,tasks:t,attribution:Y(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:e.mcp.pluginReconnectKey}}}),B(),V(),s({setCurrentAsParent:!0}),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_SESSION_ID&&(process.env.CLAUDE_CODE_SESSION_ID=n()),await F();for(let e of j)e.status===`running`&&x(e.id,M(T(e.agentId)));{let{saveMode:t}=(S(),e(_)),{isCoordinatorMode:n}=(v(),e(G));t(n()?`coordinator`:`normal`)}let P=A();P&&b(P);let I=await H(`clear`);I.length>0&&t(()=>I)}var ne=t((()=>{W(),o(),d(),g(),E(),I(),w(),J(),y(),p(),N(),z(),P(),S(),C(),k(),X()}));export{ne as n,te as t};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Cn as n,Rn as r,b as i,g as a,h as o,p as s,t as c,tn as l,x as u}from"./src-Di342QoJ.js";import{t as d}from"./jsx-runtime-D-D469L8.js";import{Ac as f,Oo as p,Pc as m,Sc as h,jo as g}from"./paths-DfGsIjPm.js";import{n as _,r as v}from"./analytics-DqMQntaB.js";import{Uo as y,aS as b,ko as x,nA as S,ns as C,oS as w,rA as T}from"./loadAgentsDir-Br5fGLLI.js";import{tmpdir as E}from"os";import{join as D}from"path";import{mkdir as O,writeFile as k}from"fs/promises";function A(e){let t=S.lexer(C(e)),n=[];for(let e of t)if(e.type===`code`){let t=e;n.push({code:t.text,lang:t.lang})}return n}function j(e){let t=[];for(let n=e.length-1;n>=0&&t.length<V;n--){let r=e[n];if(r?.type!==`assistant`||r.isApiErrorMessage)continue;let i=r.message.content;if(!Array.isArray(i))continue;let a=x(i,`
|
|
2
|
-
|
|
3
|
-
`);a&&t.push(a)}return t}function M(e){if(e){let t=e.replace(/[^a-zA-Z0-9]/g,``);if(t&&t!==`plaintext`)return`.${t}`}return`.txt`}async function N(e,t){let n=D(z,t);return await O(z,{recursive:!0}),await k(n,e,`utf-8`),n}async function P(e,t){let n=await l(e);n&&process.stdout.write(n);let r=p(e,`
|
|
4
|
-
`)+1,i=e.length;try{return`Copied to clipboard (${i} characters, ${r} lines)\nAlso written to ${await N(e,t)}`}catch{return`Copied to clipboard (${i} characters, ${r} lines)`}}function F(e,t){let r=e.split(`
|
|
5
|
-
`)[0]??``;if(n(r)<=t)return r;let i=``,a=0,o=t-1;for(let e of r){let t=n(e);if(a+t>o)break;i+=e,a+=t}return i+`…`}function I({fullText:e,codeBlocks:t,messageAge:n,onDone:r}){let c=(0,L.useRef)(`full`),l=[{label:`Full response`,value:`full`,description:`${e.length} chars, ${p(e,`
|
|
6
|
-
`)+1} lines`},...t.map((e,t)=>{let n=p(e.code,`
|
|
7
|
-
`)+1;return{label:F(e.code,60),value:t,description:[e.lang,n>1?`${n} lines`:void 0].filter(Boolean).join(`, `)||void 0}}),{label:`Always copy full response`,value:`always`,description:`Skip this picker in the future (revert via /config)`}];function d(n){if(n===`full`||n===`always`)return{text:e,filename:B};let r=t[n];return{text:r.code,filename:`copy${M(r.lang)}`,blockIndex:n}}async function f(e){let i=d(e);if(e===`always`){h().copyFullResponse||m(e=>({...e,copyFullResponse:!0})),v(`tengu_copy`,{block_count:t.length,always:!0,message_age:n}),r(`${await P(i.text,i.filename)}\nPreference saved. Use /config to change copyFullResponse`);return}v(`tengu_copy`,{selected_block:i.blockIndex,block_count:t.length,message_age:n}),r(await P(i.text,i.filename))}async function g(e){let i=d(e);v(`tengu_copy`,{selected_block:i.blockIndex,block_count:t.length,message_age:n,write_shortcut:!0});try{r(`Written to ${await N(i.text,i.filename)}`)}catch(e){r(`Failed to write file: ${e instanceof Error?e.message:e}`)}}function _(e){e.key===`w`&&(e.preventDefault(),g(c.current))}return(0,R.jsx)(s,{children:(0,R.jsxs)(u,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:_,children:[(0,R.jsx)(i,{dimColor:!0,children:`Select content to copy:`}),(0,R.jsx)(b,{options:l,hideIndexes:!1,onFocus:e=>{c.current=e},onChange:e=>{f(e)},onCancel:()=>{r(`Copy cancelled`,{display:`system`})}}),(0,R.jsx)(i,{dimColor:!0,children:(0,R.jsxs)(o,{children:[(0,R.jsx)(a,{shortcut:`enter`,action:`copy`}),(0,R.jsx)(a,{shortcut:`w`,action:`write to file`}),(0,R.jsx)(a,{shortcut:`esc`,action:`cancel`})]})})]})})}var L,R,z,B,V,H;e((()=>{T(),L=t(r(),1),w(),c(),_(),f(),y(),g(),R=d(),z=D(E(),`claude`),B=`response.md`,V=20,H=async(e,t,n)=>{let r=j(t.messages);if(r.length===0)return e(`No assistant message to copy`),null;let i=0,a=n?.trim();if(a){let t=Number(a);if(!Number.isInteger(t)||t<1)return e(`Usage: /copy [N] where N is 1 (latest), 2, 3, \u2026 Got: ${a}`),null;if(t>r.length)return e(`Only ${r.length} assistant ${r.length===1?`message`:`messages`} available to copy`),null;i=t-1}let o=r[i],s=A(o),c=h();return s.length===0||c.copyFullResponse?(v(`tengu_copy`,{always:c.copyFullResponse,block_count:s.length,message_age:i}),e(await P(o,B)),null):(0,R.jsx)(I,{fullText:o,codeBlocks:s,messageAge:i,onDone:e})}}))();export{H as call,j as collectRecentAssistantTexts,M as fileExtension};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{Jt as n,on as r}from"./paths-DfGsIjPm.js";import{D as i,E as a,O as o,l as s,p as c}from"./debug-otxXY3j-.js";import{l,u}from"./oauth-CdZEzMww.js";import{i as d,t as f}from"./cliLaunch-8aeIk2ts.js";import{resolve as p}from"path";import{existsSync as m,unlinkSync as h}from"fs";import{randomUUID as g}from"crypto";s(),a(),e();function _(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}var v=2e3,y=15e3,b=3,x=class{constructor(e,n){t(this,`proc`,void 0),t(this,`options`,void 0),t(this,`connected`,!1),t(this,`disconnected`,!1),t(this,`readLoopAbort`,null),t(this,`reconnectAttempt`,0),t(this,`maxReconnectAttempts`,void 0),t(this,`userInitiatedDisconnect`,!1),t(this,`reconnecting`,!1),this.proc=e,this.options=n,this.maxReconnectAttempts=n.maxReconnectAttempts??b}connect(){this.connected||(this.readLoopAbort=new AbortController,this.startReadLoop(),this.monitorExit(),this.connected=!0,this.options.onConnected())}async startReadLoop(){let e=this.proc.stdout;if(!e){this.options.onError(Error(`SSH process stdout is not available`));return}let t=e.getReader(),n=new TextDecoder,r=``;try{for(;!this.disconnected;){let{done:e,value:i}=await t.read();if(e)break;r+=n.decode(i,{stream:!0});let a=r.split(`
|
|
2
|
-
`);r=a.pop()??``;for(let e of a){let t=e.trim();t&&this.processLine(t)}}}catch(e){this.disconnected||this.options.onError(e instanceof Error?e:Error(String(e)))}finally{t.releaseLock(),!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}}monitorExit(){if(this.proc.exitCode!==null){this.userInitiatedDisconnect||this.handleProcessExit();return}this.proc.exited.then(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()}).catch(()=>{!this.disconnected&&!this.userInitiatedDisconnect&&this.handleProcessExit()})}async handleProcessExit(){if(!(this.disconnected||this.reconnecting)){if(this.connected=!1,!this.options.reconnect){this.disconnected=!0,this.options.onDisconnected();return}if(this.reconnectAttempt>=this.maxReconnectAttempts){this.disconnected=!0,this.options.onDisconnected();return}this.reconnecting=!0;try{await this.attemptReconnect()}finally{this.reconnecting=!1}}}async attemptReconnect(){let e=this.options.reconnect;for(;this.reconnectAttempt<this.maxReconnectAttempts;){this.reconnectAttempt++,this.options.onReconnecting(this.reconnectAttempt,this.maxReconnectAttempts);let t=Math.min(v*2**(this.reconnectAttempt-1),y);if(await new Promise(e=>setTimeout(e,t)),this.userInitiatedDisconnect)return;try{this.proc=await e(),this.reconnectAttempt=0,this.connected=!0,this.startReadLoop(),this.monitorExit(),this.options.onConnected();return}catch(e){c(`[SSH] reconnect attempt ${this.reconnectAttempt} failed: ${e instanceof Error?e.message:String(e)}`)}}this.disconnected=!0,this.options.onDisconnected()}processLine(e){let t;try{t=i(e)}catch{return}if(!_(t))return;let n=t;if(n.type===`control_request`){let e=n;e.request.subtype===`can_use_tool`?this.options.onPermissionRequest(e.request,e.request_id):(c(`[SSH] Unsupported control request subtype: ${e.request.subtype}`),this.sendErrorResponse(e.request_id,`Unsupported control request subtype: ${e.request.subtype}`));return}n.type!==`control_response`&&n.type!==`keep_alive`&&n.type!==`control_cancel_request`&&n.type!==`streamlined_text`&&n.type!==`streamlined_tool_use_summary`&&!(n.type===`system`&&n.subtype===`post_turn_summary`)&&this.options.onMessage(n)}writeToStdin(e){try{let t=this.proc.stdin;if(!t||typeof t==`number`||this.disconnected)return!1;let n=new TextEncoder().encode(e+`
|
|
3
|
-
`);return t.write(n),t.flush?.(),!0}catch{return!1}}async sendMessage(e){let t=o({type:`user`,message:{role:`user`,content:e},parent_tool_use_id:null,session_id:``});return this.writeToStdin(t)}sendInterrupt(){let e=o({type:`control_request`,request_id:crypto.randomUUID(),request:{subtype:`interrupt`}});this.writeToStdin(e)}respondToPermissionRequest(e,t){let n=o({type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}});this.writeToStdin(n)}sendErrorResponse(e,t){let n=o({type:`control_response`,response:{subtype:`error`,request_id:e,error:t}});this.writeToStdin(n)}disconnect(){if(!this.disconnected){this.userInitiatedDisconnect=!0,this.disconnected=!0,this.connected=!1,this.readLoopAbort?.abort();try{let e=this.proc.stdin;e&&typeof e!=`number`&&e.end?.()}catch{}try{this.proc.kill()}catch{}}}isConnected(){return this.connected&&!this.disconnected}};r(),u(),s();var S=process.platform===`win32`;function C(){let e=process.env.ANTHROPIC_API_KEY;if(e)return{"x-api-key":e};let t=n();return t?.accessToken?{Authorization:`Bearer ${t.accessToken}`}:{}}function w(){return process.env.ANTHROPIC_BASE_URL||l().BASE_API_URL}async function T(e,t){if(t&&e.headers.get(`x-auth-nonce`)!==t)return new Response(`Forbidden`,{status:403});let n=w(),r=new URL(e.url),i=`${n}${r.pathname}${r.search}`,a=C();if(Object.keys(a).length===0)return new Response(JSON.stringify({error:`No API credentials available on local machine`}),{status:401,headers:{"content-type":`application/json`}});let o=new Headers(e.headers);for(let[e,t]of Object.entries(a))o.set(e,t);o.delete(`host`),o.delete(`x-auth-nonce`),c(`[SSHAuthProxy] ${e.method} ${r.pathname} -> ${i}`);try{let t=await fetch(i,{method:e.method,headers:o,body:e.body,duplex:`half`}),n=new Headers(t.headers);return n.delete(`content-encoding`),n.delete(`content-length`),new Response(t.body,{status:t.status,statusText:t.statusText,headers:n})}catch(e){let t=e instanceof Error?e.message:String(e);return c(`[SSHAuthProxy] upstream error: ${t}`),new Response(JSON.stringify({error:`Proxy upstream error: ${t}`}),{status:502,headers:{"content-type":`application/json`}})}}async function E(){let e=g();return S?O(e):D(e)}async function D(e){let t=`/tmp/claude-ssh-auth-${e}.sock`,n=Bun.serve({unix:t,fetch:e=>T(e,null)});return c(`[SSHAuthProxy] listening on unix:${t}`),{proxy:{stop(){n.stop(!0);try{h(t)}catch{}}},localAddress:t,authEnv:{ANTHROPIC_AUTH_SOCKET:t}}}async function O(e){let t=g(),n=Bun.serve({port:0,hostname:`127.0.0.1`,fetch:e=>T(e,t)}),r=n.port;return c(`[SSHAuthProxy] listening on TCP 127.0.0.1:${r} (nonce-protected)`),{proxy:{stop(){n.stop(!0)}},localAddress:`127.0.0.1:${r}`,authEnv:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${r}`,ANTHROPIC_AUTH_NONCE:t}}}s();var k=15e3,A=class extends Error{constructor(e){super(e),this.name=`SSHProbeError`}};async function j(e,t){t?.(`Probing remote host…`);let n=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=10`,e,`CLAUDE_BIN=$(test -x "$HOME/.local/bin/claude" && echo "$HOME/.local/bin/claude" || command -v claude 2>/dev/null); echo "$CLAUDE_BIN"; $CLAUDE_BIN --version 2>/dev/null; uname -sm; pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`pipe`}),r=await Promise.race([n.exited,new Promise((e,t)=>setTimeout(()=>t(new A(`SSH probe timed out after ${k/1e3}s`)),k))]),i=await new Response(n.stdout).text(),a=await new Response(n.stderr).text();if(r!==0)throw new A(`SSH probe failed: ${a.trim()||`exit code ${r}`}`);let o=i.split(`
|
|
4
|
-
`).map(e=>e.trim()).filter(Boolean);c(`[SSHProbe] raw lines: ${JSON.stringify(o)}`);let s=o.findIndex(e=>/^(Linux|Darwin)\s/.test(e));if(s===-1)throw new A(`Could not detect remote platform (uname output missing)`);let l=s>=2&&o[s-2]||null,u=s>=1&&o[s-1]||null,d=u&&/^\d+\.\d+/.test(u)?u:null,f=l!==null&&l.startsWith(`/`),p=o[s+1]||`/`,[m,h]=o[s].split(/\s+/),g=m===`Darwin`?`darwin`:`linux`,_=h===`aarch64`||h===`arm64`?`arm64`:`x64`;return t?.(`Detected ${g}/${_}`),{hasBinary:f&&d!==null,remoteVersion:d,remotePlatform:g,remoteArch:_,defaultCwd:p,binaryPath:f?l:null}}s();var M=6e4,N=`~/.local/bin`,P=`claude-code-cli.js`,F=`claude`;async function I(e,t,n=M){let r=Bun.spawn([`ssh`,`-o`,`ConnectTimeout=10`,e,t],{stdout:`pipe`,stderr:`pipe`}),i=setTimeout(()=>r.kill(),n);try{let[e,t]=await Promise.all([new Response(r.stdout).text(),new Response(r.stderr).text()]),n=await r.exited;return{stdout:e.trim(),stderr:t.trim(),exitCode:n}}finally{clearTimeout(i)}}function L(){let e=p(import.meta.dir,`../..`),t=p(e,`dist/cli.js`);if(m(t))return t;let n=p(e,`src/entrypoints/cli.tsx`);if(m(n))return n;throw Error("Cannot find local CLI binary to deploy. Run `bun run build` first.")}async function R(e){let{host:t,remotePlatform:n,remoteArch:r,localVersion:i,onProgress:a}=e;if(n!==`linux`&&n!==`darwin`)throw Error(`Remote platform "${n}" is not supported. Only linux and darwin are supported.`);c(`[SSHDeploy] deploying to ${t} (${n}/${r}, v${i})`);let o=L();c(`[SSHDeploy] local binary: ${o}`),a?.(`Creating remote directory...`);let s=await I(t,`mkdir -p ${N}`);if(s.exitCode!==0)throw Error(`Failed to create remote directory: ${s.stderr}`);a?.(`Uploading binary...`);let l=`${N}/${P}`,u=Bun.spawn([`scp`,`-o`,`ConnectTimeout=10`,o,`${t}:${l}`],{stdout:`pipe`,stderr:`pipe`}),d=setTimeout(()=>u.kill(),M),f=await new Response(u.stderr).text(),p=await u.exited;if(clearTimeout(d),p!==0)throw Error(`SCP upload failed (exit ${p}): ${f.trim()}`);a?.(`Installing wrapper script...`);let m=await I(t,[`cat > ${N}/${F} << 'WRAPPER'`,`#!/bin/sh`,`exec bun ${N}/${P} "$@"`,`WRAPPER`,`chmod +x ${N}/${F}`].join(`
|
|
5
|
-
`));if(m.exitCode!==0)throw Error(`Failed to install wrapper script: ${m.stderr}`);a?.(`Verifying installation...`);let h=await I(t,`${N}/${F} --version`);if(h.exitCode!==0)throw Error(`Binary deployed but verification failed (exit ${h.exitCode}): ${h.stderr}`);return c(`[SSHDeploy] deployed successfully, remote version: ${h.stdout}`),a?.(`Deployed v${h.stdout}`),`${N}/${F}`}d(),s(),a();var z=3e4,B=20,V=class extends Error{constructor(e){super(e),this.name=`SSHSessionError`}};async function H(e,t){let{host:n,localVersion:r,extraCliArgs:i,remoteBin:a}=e,o=t?.onProgress,s,l=`/`;if(a){o?.(`Using custom remote binary, skipping probe/deploy…`),s=a,c(`[SSH] custom remoteBin: ${a}`);try{let e=Bun.spawn([`ssh`,`-o`,`BatchMode=yes`,`-o`,`ConnectTimeout=5`,n,`pwd`],{stdin:`ignore`,stdout:`pipe`,stderr:`ignore`});await e.exited;let t=(await new Response(e.stdout).text()).trim();t.startsWith(`/`)&&(l=t)}catch{}}else{let e=await j(n,o);c(`[SSH] probe result: ${JSON.stringify(e)}`),l=e.defaultCwd,s=e.binaryPath??`~/.local/bin/claude`,(!e.hasBinary||e.remoteVersion!==r)&&(o?.(e.hasBinary?`Updating remote binary (${e.remoteVersion} → ${r})…`:`Deploying binary to remote…`),s=await R({host:n,remotePlatform:e.remotePlatform,remoteArch:e.remoteArch,localVersion:r,onProgress:o}))}let{proxy:u,localAddress:d,authEnv:f}=await E();c(`[SSH] auth proxy listening on ${d}`);let p=g().slice(0,8),m=process.platform===`win32`,h=[];for(let[e,t]of Object.entries(f))h.push(`${e}=${t}`);h.push(s,`--output-format`,`stream-json`,`--input-format`,`stream-json`,`--verbose`,`-p`),e.cwd&&h.push(`--cwd`,e.cwd),e.permissionMode&&h.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&h.push(`--dangerously-skip-permissions`),h.push(...i);let _=[`ssh`];if(m){let e=d.split(`:`)[1],t=1e4+Math.floor(Math.random()*5e4);_.push(`-R`,`${t}:127.0.0.1:${e}`);let n=h.findIndex(e=>e.startsWith(`ANTHROPIC_BASE_URL=`));n!==-1&&(h[n]=`ANTHROPIC_BASE_URL=http://127.0.0.1:${t}`)}else{let e=`/tmp/claude-ssh-auth-${p}.sock`;_.push(`-R`,`${e}:${d}`),_.push(`-o`,`StreamLocalBindUnlink=yes`);let t=h.indexOf(`ANTHROPIC_AUTH_SOCKET=${f.ANTHROPIC_AUTH_SOCKET}`);t!==-1&&(h[t]=`ANTHROPIC_AUTH_SOCKET=${e}`)}_.push(n,h.join(` `)),o?.(`Starting remote session…`),c(`[SSH] spawning: ${_.join(` `)}`);let v;try{v=Bun.spawn(_,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`})}catch(e){throw u.stop(),new V(`Failed to spawn SSH process: ${e instanceof Error?e.message:String(e)}`)}let y=[];G(v,y);let b;if(a){let t=await Promise.race([v.exited.then(e=>e),new Promise(e=>setTimeout(()=>e(null),3e3))]);if(t!==null){u.stop();let e=y.join(``).trim();throw new V(`Remote process exited immediately (code ${t})${e?`: ${e}`:``}`)}b=e.cwd||l||`/`}else try{b=await W(v,e.cwd||l)}catch(e){throw u.stop(),v.kill(),e}c(`[SSH] remote session initialized, remoteCwd=${b}`);let S=v,C=async()=>{c(`[SSH] reconnect: re-spawning SSH process with --continue`);let e=[..._],t=e.length-1,n=e[t];n.includes(`--continue`)||(e[t]=n.replace(/ -p(?:\s|$)/,` -p --continue `));let r=Bun.spawn(e,{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`}),i=[];return G(r,i),await W(r,b),S=r,y.length=0,y.push(...i),r};return{remoteCwd:b,get proc(){return S},proxy:u,createManager(e){return new x(S,{...e,reconnect:C})},getStderrTail(){return y.slice(-B).join(``)}}}async function U(e){let{proxy:t,authEnv:n}=await E(),r=[`--output-format`,`stream-json`,`--input-format`,`stream-json`,`-p`];e.cwd&&r.push(`--cwd`,e.cwd),e.permissionMode&&r.push(`--permission-mode`,e.permissionMode),e.dangerouslySkipPermissions&&r.push(`--dangerously-skip-permissions`);let i=f(r),a;try{a=Bun.spawn([i.execPath,...i.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...i.env,...n}})}catch(e){throw t.stop(),new V(`Failed to spawn local CLI process: ${e instanceof Error?e.message:String(e)}`)}c(`[SSH] local session spawned, waiting for init message...`);let o=[];G(a,o);let s;try{s=await W(a,e.cwd)}catch(e){throw t.stop(),a.kill(),e}c(`[SSH] local session initialized, remoteCwd=${s}`);let l=a,u=async()=>{c(`[SSH] local reconnect: re-spawning CLI with --continue`);let e=[...r];e.includes(`--continue`)||e.push(`--continue`);let t=f(e),i=Bun.spawn([t.execPath,...t.args],{stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,env:{...t.env,...n}}),a=[];return G(i,a),await W(i,s),l=i,o.length=0,o.push(...a),i};return{remoteCwd:s,get proc(){return l},proxy:t,createManager(e){return new x(l,{...e,reconnect:u})},getStderrTail(){return o.slice(-B).join(``)}}}async function W(e,t){let n=e.stdout;if(!n)throw new V(`Child process stdout is not readable`);let r=n.getReader(),a=new TextDecoder,o=``,s=Date.now()+z;try{for(;Date.now()<s;){let e=s-Date.now(),n=await Promise.race([r.read(),new Promise((t,n)=>setTimeout(()=>n(new V(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)),e))]);if(n.done)throw new V(`Child process exited before sending init message`);o+=a.decode(n.value,{stream:!0});let c=o.split(`
|
|
6
|
-
`);o=c.pop()??``;for(let e of c){let n=e.trim();if(n)try{let e=i(n);if(e.type===`system`&&e.subtype===`init`)return r.releaseLock(),e.cwd||t||process.cwd()}catch{}}}}catch(e){throw r.releaseLock(),e instanceof V?e:new V(`Error reading init message: ${e instanceof Error?e.message:String(e)}`)}throw r.releaseLock(),new V(`Remote CLI did not initialize within 30 seconds. Check SSH connectivity and remote binary.`)}function G(e,t){let n=e.stderr;if(!n)return;let r=n.getReader(),i=new TextDecoder;(async()=>{try{for(;;){let{done:e,value:n}=await r.read();if(e)break;t.push(i.decode(n,{stream:!0})),t.length>B*2&&t.splice(0,t.length-B)}}catch{}})()}export{V as SSHSessionError,U as createLocalSSHSession,H as createSSHSession};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r}from"./createSession-VlSLvi7J.js";t();export{n as createBridgeSession,r as getBridgeSession,e as updateBridgeSessionTitle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{U as t,l as n,p as r,z as i}from"./debug-otxXY3j-.js";import{c as a,d as o,i as s,o as c}from"./debugUtils-CiEnbhiz.js";async function l({environmentId:e,title:t,events:n,gitRepoUrl:a,branch:o,signal:c,baseUrl:l,getAccessToken:u,permissionMode:d}){let{getClaudeAIOAuthTokens:f}=await import(`./auth-h6VL9BbC.js`),{getOrganizationUUID:p}=await import(`./client-un1k_6md.js`),{getOauthConfig:m}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:h}=await import(`./api-xFvB7WoB.js`),{parseGitHubRepository:g}=await import(`./detectRepository-CbR0WgtE.js`),{getDefaultBranch:_}=await import(`./git-BZEgupMC.js`),{getMainLoopModel:v}=await import(`./model-CCjuMV6k.js`),{default:y}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:b}=await import(`./bridgeConfig-BM7iHryd.js`),x=u?.()??f()?.accessToken;if(!x)return r(`[bridge] No access token for session creation`),null;let S=b()?`self-hosted`:await p();if(!S)return r(`[bridge] No org UUID for session creation`),null;let C=null,w=null;if(a){let{parseGitRemote:e}=await import(`./detectRepository-CbR0WgtE.js`),t=e(a);if(t){let{host:e,owner:n,name:r}=t,i=o||await _()||void 0;C={type:`git_repository`,url:`https://${e}/${n}/${r}`,revision:i},w={type:`git_repository`,git_info:{type:`github`,repo:`${n}/${r}`,branches:[`claude/${o||`task`}`]}}}else{let e=g(a);if(e){let[t,n]=e.split(`/`);if(t&&n){let e=o||await _()||void 0;C={type:`git_repository`,url:`https://github.com/${t}/${n}`,revision:e},w={type:`git_repository`,git_info:{type:`github`,repo:`${t}/${n}`,branches:[`claude/${o||`task`}`]}}}}}}let T={...t!==void 0&&{title:t},events:n,session_context:{sources:C?[C]:[],outcomes:w?[w]:[],model:v()},environment_id:e,source:`remote-control`,...d&&{permission_mode:d}},E={...h(x),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":S},D=`${l??m().BASE_API_URL}/v1/sessions`,O;try{O=await y.post(D,T,{headers:E,signal:c,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session creation request failed: ${i(e)}`),null}if(!(O.status===200||O.status===201)){let e=s(O.data);return r(`[bridge] Session creation failed with status ${O.status}${e?`: ${e}`:``}`),null}let k=O.data;return!k||typeof k!=`object`||!(`id`in k)||typeof k.id!=`string`?(r(`[bridge] No session ID in response`),null):k.id}async function u(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-h6VL9BbC.js`),{getOrganizationUUID:a}=await import(`./client-un1k_6md.js`),{getOauthConfig:o}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:c}=await import(`./api-xFvB7WoB.js`),{default:l}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:u}=await import(`./bridgeConfig-BM7iHryd.js`),d=t?.getAccessToken?.()??n()?.accessToken;if(!d)return r(`[bridge] No access token for session fetch`),null;let f=u()?`self-hosted`:await a();if(!f)return r(`[bridge] No org UUID for session fetch`),null;let p={...c(d),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":f},m=`${t?.baseUrl??o().BASE_API_URL}/v1/sessions/${e}`;r(`[bridge] Fetching session ${e}`);let h;try{h=await l.get(m,{headers:p,timeout:1e4,validateStatus:e=>e<500})}catch(e){return r(`[bridge] Session fetch request failed: ${i(e)}`),null}if(h.status!==200){let e=s(h.data);return r(`[bridge] Session fetch failed with status ${h.status}${e?`: ${e}`:``}`),null}return h.data}async function d(e,t){let{getClaudeAIOAuthTokens:n}=await import(`./auth-h6VL9BbC.js`),{getOrganizationUUID:i}=await import(`./client-un1k_6md.js`),{getOauthConfig:a}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:o}=await import(`./api-xFvB7WoB.js`),{default:c}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:l}=await import(`./bridgeConfig-BM7iHryd.js`),u=t?.getAccessToken?.()??n()?.accessToken;if(!u){r(`[bridge] No access token for session archive`);return}let d=l()?`self-hosted`:await i();if(!d){r(`[bridge] No org UUID for session archive`);return}let f={...o(u),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":d},p=`${t?.baseUrl??a().BASE_API_URL}/v1/sessions/${e}/archive`;r(`[bridge] Archiving session ${e}`);let m=await c.post(p,{},{headers:f,timeout:t?.timeoutMs??1e4,validateStatus:e=>e<500});if(m.status===200)r(`[bridge] Session ${e} archived successfully`);else{let e=s(m.data);r(`[bridge] Session archive failed with status ${m.status}${e?`: ${e}`:``}`)}}async function f(e,t,n){let{getClaudeAIOAuthTokens:a}=await import(`./auth-h6VL9BbC.js`),{getOrganizationUUID:c}=await import(`./client-un1k_6md.js`),{getOauthConfig:l}=await import(`./oauth-CmensepG.js`),{getOAuthHeaders:u}=await import(`./api-xFvB7WoB.js`),{default:d}=await import(`./axios-DLnc2dVy.js`),{isSelfHostedBridge:f}=await import(`./bridgeConfig-BM7iHryd.js`),p=n?.getAccessToken?.()??a()?.accessToken;if(!p){r(`[bridge] No access token for session title update`);return}let m=f()?`self-hosted`:await c();if(!m){r(`[bridge] No org UUID for session title update`);return}let h={...u(p),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":m},g=o(e),_=`${n?.baseUrl??l().BASE_API_URL}/v1/sessions/${g}`;r(`[bridge] Updating session title: ${g} → ${t}`);try{let e=await d.patch(_,{title:t},{headers:h,timeout:1e4,validateStatus:e=>e<500});if(e.status===200)r(`[bridge] Session title updated successfully`);else{let t=s(e.data);r(`[bridge] Session title update failed with status ${e.status}${t?`: ${t}`:``}`)}}catch(e){r(`[bridge] Session title update request failed: ${i(e)}`)}}var p=e((()=>{n(),t(),c(),a()}));export{f as a,p as i,l as n,u as r,d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";function t(e,t){let{min:n,max:r}=t,i=new Set;for(let t of e.split(`,`)){let e=t.match(/^\*(?:\/(\d+))?$/);if(e){let t=e[1]?parseInt(e[1],10):1;if(t<1)return null;for(let e=n;e<=r;e+=t)i.add(e);continue}let a=t.match(/^(\d+)-(\d+)(?:\/(\d+))?$/);if(a){let e=parseInt(a[1],10),t=parseInt(a[2],10),o=a[3]?parseInt(a[3],10):1,s=n===0&&r===6;if(e>t||o<1||e<n||t>(s?7:r))return null;for(let n=e;n<=t;n+=o)i.add(s&&n===7?0:n);continue}if(t.match(/^\d+$/)){let e=parseInt(t,10);if(n===0&&r===6&&e===7&&(e=0),e<n||e>r)return null;i.add(e);continue}return null}return i.size===0?null:Array.from(i).sort((e,t)=>e-t)}function n(e){let n=e.trim().split(/\s+/);if(n.length!==5)return null;let r=[];for(let e=0;e<5;e++){let i=t(n[e],s[e]);if(!i)return null;r.push(i)}return{minute:r[0],hour:r[1],dayOfMonth:r[2],month:r[3],dayOfWeek:r[4]}}function r(e,t){let n=new Set(e.minute),r=new Set(e.hour),i=new Set(e.dayOfMonth),a=new Set(e.month),o=new Set(e.dayOfWeek),s=e.dayOfMonth.length===31,c=e.dayOfWeek.length===7,l=new Date(t.getTime());l.setSeconds(0,0),l.setMinutes(l.getMinutes()+1);for(let e=0;e<527040;e++){let e=l.getMonth()+1;if(!a.has(e)){l.setMonth(l.getMonth()+1,1),l.setHours(0,0,0,0);continue}let t=l.getDate(),u=l.getDay();if(!(s&&c||(s?o.has(u):c?i.has(t):i.has(t)||o.has(u)))){l.setDate(l.getDate()+1),l.setHours(0,0,0,0);continue}if(!r.has(l.getHours())){l.setHours(l.getHours()+1,0,0,0);continue}if(!n.has(l.getMinutes())){l.setMinutes(l.getMinutes()+1);continue}return l}return null}function i(e,t){return new Date(2e3,0,1,t,e).toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`})}function a(e,t){let n=new Date;return n.setUTCHours(t,e,0,0),n.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:`2-digit`,timeZoneName:`short`})}function o(e,t){let n=t?.utc??!1,r=e.trim().split(/\s+/);if(r.length!==5)return e;let[o,s,l,u,d]=r,f=o.match(/^\*\/(\d+)$/);if(f&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(f[1],10);return e===1?`Every minute`:`Every ${e} minutes`}if(o.match(/^\d+$/)&&s===`*`&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(o,10);return e===0?`Every hour`:`Every hour at :${e.toString().padStart(2,`0`)}`}let p=s.match(/^\*\/(\d+)$/);if(o.match(/^\d+$/)&&p&&l===`*`&&u===`*`&&d===`*`){let e=parseInt(p[1],10),t=parseInt(o,10),n=t===0?``:` at :${t.toString().padStart(2,`0`)}`;return e===1?`Every hour${n}`:`Every ${e} hours${n}`}if(!o.match(/^\d+$/)||!s.match(/^\d+$/))return e;let m=parseInt(o,10),h=parseInt(s,10),g=n?a:i;if(l===`*`&&u===`*`&&d===`*`)return`Every day at ${g(m,h)}`;if(l===`*`&&u===`*`&&d.match(/^\d$/)){let e=parseInt(d,10)%7,t;if(n){let n=new Date,r=(e-n.getUTCDay()+7)%7;n.setUTCDate(n.getUTCDate()+r),n.setUTCHours(h,m,0,0),t=c[n.getDay()]}else t=c[e];if(t)return`Every ${t} at ${g(m,h)}`}return l===`*`&&u===`*`&&d===`1-5`?`Weekdays at ${g(m,h)}`:e}var s,c,l=e((()=>{s=[{min:0,max:59},{min:0,max:23},{min:1,max:31},{min:1,max:12},{min:0,max:6}],c=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]}));export{n as i,o as n,l as r,r as t};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./defineProperty-80gRi2ZW.js";import{Cn as i,Ln as a,Mn as o,Tt as s,Xn as c,Yn as l,kt as u,ln as d,un as f,vt as p,wn as m,wt as h}from"./schemas-BGAvj1T4.js";import{n as g,t as _}from"./v4-f1i_CNUT.js";import{Ct as v,St as ee,cn as y,gr as te,gt as b,ot as x,ut as S,vn as ne}from"./state-sIHsFpDu.js";import{Fl as C,Il as re,S as w,Ss as ie,al as ae,el as oe,v as se,xs as ce}from"./paths-DfGsIjPm.js";import{B as le,D as ue,E as T,O as E,Q as de,U as D,Z as fe,j as pe,l as O,p as k,z as me}from"./debug-otxXY3j-.js";import{n as he,r as A}from"./analytics-DqMQntaB.js";import{n as ge,o as _e}from"./process-DMKLUQIO.js";import{F as ve,P as ye,n as be,v as xe}from"./git-DayFjsvj.js";import{o as Se,s as j}from"./log-DS97_rIr.js";import{s as Ce,u as we}from"./types-D5R26wwH.js";import{n as M,t as N}from"./lazySchema-2sOku3cX.js";import{a as Te,i as Ee}from"./genericProcessUtils-D-78JZxz.js";import{Ag as De,An as Oe,Bg as ke,Cn as Ae,Fg as je,G as Me,Gg as Ne,Hg as Pe,ID as P,Ig as Fe,Js as Ie,K as Le,Kg as F,Lg as I,Mg as L,ND as R,Ng as Re,Pg as ze,RD as Be,Rg as Ve,Ug as He,Us as Ue,Vg as We,Vs as Ge,Wg as Ke,dO as qe,dk as Je,fO as Ye,fk as Xe,hf as Ze,hu as Qe,jg as $e,kn as et,mf as tt,mu as nt,qg as rt,qs as it,qt as at,zg as ot}from"./loadAgentsDir-Br5fGLLI.js";import{B as z,H as st,I as B,J as ct,K as lt,R as ut,V as dt,W as ft,q as pt,z as mt}from"./prompt-B8M-HLIS.js";import{n as ht,r as gt}from"./cron-DiW7eIPP.js";import{d as _t,h as vt}from"./rcDebugLog-BoroyfjB.js";import{t as yt}from"./controlMessageCompat-BJhFiS7u.js";import{dirname as bt,isAbsolute as xt,join as St,resolve as Ct}from"path";import{randomUUID as V}from"crypto";import{mkdir as wt,readFile as Tt,unlink as Et,writeFile as H}from"fs/promises";_(),N(),rt();var Dt=M(()=>c()),Ot=M(()=>m({matcher:a().optional(),hookCallbackIds:s(a()),timeout:i().optional()}).describe(`Configuration for matching and routing hook callbacks.`)),kt=M(()=>m({subtype:f(`initialize`),hooks:o(ze(),s(Ot())).optional(),sdkMcpServers:s(a()).optional(),jsonSchema:o(a(),c()).optional(),systemPrompt:a().optional(),appendSystemPrompt:a().optional(),agents:o(a(),$e()).optional(),promptSuggestions:u().optional(),agentProgressSummaries:u().optional()}).describe(`Initializes the SDK session with hooks, MCP servers, and agent configuration.`));M(()=>m({commands:s(F()),agents:s(L()),output_style:a(),available_output_styles:s(a()),models:s(Ve()),account:De(),pid:i().optional().describe(`@internal CLI process PID for tmux socket isolation`),fast_mode_state:Re().optional()}).describe(`Response from session initialization with available commands, models, and account info.`));var At=M(()=>m({subtype:f(`interrupt`)}).describe(`Interrupts the currently running conversation turn.`)),jt=M(()=>m({subtype:f(`can_use_tool`),tool_name:a(),input:o(a(),c()),permission_suggestions:s(ke()).optional(),blocked_path:a().optional(),decision_reason:a().optional(),title:a().optional(),display_name:a().optional(),tool_use_id:a(),agent_id:a().optional(),description:a().optional()}).describe(`Requests permission to use a tool with the given input.`)),Mt=M(()=>m({subtype:f(`set_permission_mode`),mode:ot(),ultraplan:u().optional().describe(`@internal CCR ultraplan session marker.`)}).describe(`Sets the permission mode for tool execution handling.`)),Nt=M(()=>m({subtype:f(`set_model`),model:a().optional()}).describe(`Sets the model to use for subsequent conversation turns.`)),Pt=M(()=>m({subtype:f(`set_max_thinking_tokens`),max_thinking_tokens:i().nullable()}).describe(`Sets the maximum number of thinking tokens for extended thinking.`)),Ft=M(()=>m({subtype:f(`mcp_status`)}).describe(`Requests the current status of all MCP server connections.`));M(()=>m({mcpServers:s(I())}).describe(`Response containing the current status of all MCP server connections.`));var It=M(()=>m({subtype:f(`get_context_usage`)}).describe(`Requests a breakdown of current context window usage by category.`)),Lt=M(()=>m({name:a(),tokens:i(),color:a(),isDeferred:u().optional()})),Rt=M(()=>m({color:a(),isFilled:u(),categoryName:a(),tokens:i(),percentage:i(),squareFullness:i()}));M(()=>m({categories:s(Lt()),totalTokens:i(),maxTokens:i(),rawMaxTokens:i(),percentage:i(),gridRows:s(s(Rt())),model:a(),memoryFiles:s(m({path:a(),type:a(),tokens:i()})),mcpTools:s(m({name:a(),serverName:a(),tokens:i(),isLoaded:u().optional()})),deferredBuiltinTools:s(m({name:a(),tokens:i(),isLoaded:u()})).optional(),systemTools:s(m({name:a(),tokens:i()})).optional(),systemPromptSections:s(m({name:a(),tokens:i()})).optional(),agents:s(m({agentType:a(),source:a(),tokens:i()})),slashCommands:m({totalCommands:i(),includedCommands:i(),tokens:i()}).optional(),skills:m({totalSkills:i(),includedSkills:i(),tokens:i(),skillFrontmatter:s(m({name:a(),source:a(),tokens:i()}))}).optional(),autoCompactThreshold:i().optional(),isAutoCompactEnabled:u(),messageBreakdown:m({toolCallTokens:i(),toolResultTokens:i(),attachmentTokens:i(),assistantMessageTokens:i(),userMessageTokens:i(),toolCallsByType:s(m({name:a(),callTokens:i(),resultTokens:i()})),attachmentsByType:s(m({name:a(),tokens:i()}))}).optional(),apiUsage:m({input_tokens:i(),output_tokens:i(),cache_creation_input_tokens:i(),cache_read_input_tokens:i()}).nullable()}).describe(`Breakdown of current context window usage by category (system prompt, tools, messages, etc.).`));var zt=M(()=>m({subtype:f(`rewind_files`),user_message_id:a(),dry_run:u().optional()}).describe(`Rewinds file changes made since a specific user message.`));M(()=>m({canRewind:u(),error:a().optional(),filesChanged:s(a()).optional(),insertions:i().optional(),deletions:i().optional()}).describe(`Result of a rewindFiles operation.`));var Bt=M(()=>m({subtype:f(`cancel_async_message`),message_uuid:a()}).describe(`Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.`));M(()=>m({cancelled:u()}).describe(`Result of a cancel_async_message operation. cancelled=false means the message was not in the queue (already dequeued or never enqueued).`));var Vt=M(()=>m({subtype:f(`seed_read_state`),path:a(),mtime:i()}).describe(`Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.`)),Ht=M(()=>m({subtype:f(`hook_callback`),callback_id:a(),input:je(),tool_use_id:a().optional()}).describe(`Delivers a hook callback with its input data.`)),Ut=M(()=>m({subtype:f(`mcp_message`),server_name:a(),message:Dt()}).describe(`Sends a JSON-RPC message to a specific MCP server.`)),Wt=M(()=>m({subtype:f(`mcp_set_servers`),servers:o(a(),Fe())}).describe(`Replaces the set of dynamically managed MCP servers.`));M(()=>m({added:s(a()),removed:s(a()),errors:o(a(),a())}).describe(`Result of replacing the set of dynamically managed MCP servers.`));var Gt=M(()=>m({subtype:f(`reload_plugins`)}).describe(`Reloads plugins from disk and returns the refreshed session components.`));M(()=>m({commands:s(F()),agents:s(L()),plugins:s(m({name:a(),path:a(),source:a().optional()})),mcpServers:s(I()),error_count:i()}).describe(`Refreshed commands, agents, plugins, and MCP server status after reload.`));var Kt=M(()=>m({subtype:f(`mcp_reconnect`),serverName:a()}).describe(`Reconnects a disconnected or failed MCP server.`)),qt=M(()=>m({subtype:f(`mcp_toggle`),serverName:a(),enabled:u()}).describe(`Enables or disables an MCP server.`)),Jt=M(()=>m({subtype:f(`stop_task`),task_id:a()}).describe(`Stops a running task.`)),Yt=M(()=>m({subtype:f(`apply_flag_settings`),settings:o(a(),c())}).describe(`Merges the provided settings into the flag settings layer, updating the active configuration.`)),Xt=M(()=>m({subtype:f(`get_settings`)}).describe(`Returns the effective merged settings and the raw per-source settings.`));M(()=>m({effective:o(a(),c()),sources:s(m({source:p([`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`]),settings:o(a(),c())})).describe(`Ordered low-to-high priority — later entries override earlier ones.`),applied:m({model:a(),effort:p([`low`,`medium`,`high`,`xhigh`,`max`]).nullable()}).optional().describe("Runtime-resolved values after env overrides, session state, and model-specific defaults are applied. Unlike `effective` (disk merge), these reflect what will actually be sent to the API.")}).describe(`Effective merged settings plus raw per-source settings in merge order.`));var Zt=M(()=>m({subtype:f(`elicitation`),mcp_server_name:a(),message:a(),mode:p([`form`,`url`]).optional(),url:a().optional(),elicitation_id:a().optional(),requested_schema:o(a(),c()).optional()}).describe(`Requests the SDK consumer to handle an MCP elicitation (user input request).`)),Qt=M(()=>m({action:p([`accept`,`decline`,`cancel`]),content:o(a(),c()).optional()}).describe(`Response from the SDK consumer for an elicitation request.`)),$t=M(()=>l([At(),jt(),kt(),Mt(),Nt(),Pt(),Ft(),It(),Ht(),Ut(),zt(),Bt(),Vt(),Wt(),Gt(),Kt(),qt(),Jt(),Yt(),Xt(),Zt()])),U=M(()=>m({type:f(`control_request`),request_id:a(),request:$t()})),en=M(()=>m({subtype:f(`success`),request_id:a(),response:o(a(),c()).optional()})),tn=M(()=>m({subtype:f(`error`),request_id:a(),error:a(),pending_permission_requests:s(d(()=>U())).optional()})),nn=M(()=>m({type:f(`control_response`),response:l([en(),tn()])})),rn=M(()=>m({type:f(`control_cancel_request`),request_id:a()}).describe(`Cancels a currently open control request.`)),an=M(()=>m({type:f(`keep_alive`)}).describe(`Keep-alive message to maintain WebSocket connection.`)),on=M(()=>m({type:f(`update_environment_variables`),variables:o(a(),a())}).describe(`Updates environment variables at runtime.`));M(()=>l([We(),He(),Ke(),Pe(),nn(),U(),rn(),an()])),M(()=>l([Ne(),U(),nn(),an(),on()])),n(),y(),fe(),D(),T(),ge(),ye(),Oe(),_(),O(),N(),P(),tt(),M(()=>g.object({tool_name:g.string().describe(`The name of the tool requesting permission`),input:g.record(g.string(),g.unknown()).describe(`The input for the tool`),tool_use_id:g.string().optional().describe(`The unique tool use request ID`)}));var sn=M(()=>g.enum([`user_temporary`,`user_permanent`,`user_reject`]).optional().catch(void 0)),cn=M(()=>g.object({behavior:g.literal(`allow`),updatedInput:g.record(g.string(),g.unknown()),updatedPermissions:g.array(Ze()).optional().catch(e=>{k(`Malformed updatedPermissions from SDK host ignored: ${e.error.issues[0]?.message??`unknown`}`,{level:`warn`})}),toolUseID:g.string().optional(),decisionClassification:sn()})),ln=M(()=>g.object({behavior:g.literal(`deny`),message:g.string(),interrupt:g.boolean().optional(),toolUseID:g.string().optional(),decisionClassification:sn()})),W=M(()=>g.union([cn(),ln()]));function G(e,t,n,r){let i={type:`permissionPromptTool`,permissionPromptToolName:t.name,toolResult:e};if(e.behavior===`allow`){let t=e.updatedPermissions;t&&(r.setAppState(e=>({...e,toolPermissionContext:R(e.toolPermissionContext,t)})),Be(t));let a=Object.keys(e.updatedInput).length>0?e.updatedInput:n;return{...e,updatedInput:a,decisionReason:i}}else e.behavior===`deny`&&e.interrupt&&(k(`SDK permission prompt deny+interrupt: tool=${t.name} message=${e.message}`),r.abortController.abort());return{...e,decisionReason:i}}he(),Se(),oe(),ce(),w(),qe(),_t(),Qe(),Ae(),Le();var un=/\u2028|\u2029/g;function dn(e){return e.replace(un,e=>e===`\u2028`?`\\u2028`:`\\u2029`)}function fn(e){return dn(E(e))}O(),T(),_(),P();var pn=`SandboxNetworkAccess`;function mn(e){if(e){if(e.type===`classifier`)return e.reason;switch(e.type){case`rule`:case`mode`:case`subcommandResults`:case`permissionPromptTool`:return;case`hook`:case`asyncAgent`:case`sandboxOverride`:case`workingDir`:case`safetyCheck`:case`other`:return e.reason}}}function hn(e,t,n,r){let i;try{i=e.getActivityDescription?.(t)??e.getToolUseSummary?.(t)??e.userFacingName(t)}catch{i=e.name}return{tool_name:e.name,action_description:i,tool_use_id:n,request_id:r,input:t}}var gn=1e3,_n=class{constructor(e,t){r(this,`structuredInput`,void 0),r(this,`pendingRequests`,new Map),r(this,`restoredWorkerState`,Promise.resolve(null)),r(this,`inputClosed`,!1),r(this,`unexpectedResponseCallback`,void 0),r(this,`resolvedToolUseIds`,new Set),r(this,`prependedLines`,[]),r(this,`onControlRequestSent`,void 0),r(this,`onControlRequestResolved`,void 0),r(this,`outbound`,new nt),this.input=e,this.replayUserMessages=t,this.input=e,this.structuredInput=this.read()}trackResolvedToolUseId(e){let t=e.request;if(t.subtype===`can_use_tool`&&(this.resolvedToolUseIds.add(t.tool_use_id),this.resolvedToolUseIds.size>gn)){let e=this.resolvedToolUseIds.values().next().value;e!==void 0&&this.resolvedToolUseIds.delete(e)}}flushInternalEvents(){return Promise.resolve()}get internalEventsPending(){return 0}prependUserMessage(e){this.prependedLines.push(E({type:`user`,content:e,uuid:``,session_id:``,message:{role:`user`,content:e},parent_tool_use_id:null})+`
|
|
2
|
-
`)}async*read(){let e=``,t=async function*(){for(;;){this.prependedLines.length>0&&(e=this.prependedLines.join(``)+e,this.prependedLines=[]);let t=e.indexOf(`
|
|
3
|
-
`);if(t===-1)break;let n=e.slice(0,t);e=e.slice(t+1);let r=await this.processLine(n);r&&(ve(`info`,`cli_stdin_message_parsed`,{type:r.type}),yield r)}}.bind(this);yield*t();for await(let n of this.input)e+=n,yield*t();if(e){let t=await this.processLine(e);t&&(yield t)}this.inputClosed=!0;for(let e of this.pendingRequests.values())e.reject(Error(`Tool permission stream closed before response received`))}getPendingPermissionRequests(){return Array.from(this.pendingRequests.values()).map(e=>e.request).filter(e=>e.request.subtype===`can_use_tool`)}setUnexpectedResponseCallback(e){this.unexpectedResponseCallback=e}injectControlResponse(e){let t=e.response,n=t?.request_id;if(!n)return;let r=this.pendingRequests.get(n);if(r)if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n),this.write({type:`control_cancel_request`,request_id:n}),t.subtype===`error`)r.reject(Error(t.error));else{let e=t.response;if(r.schema)try{r.resolve(r.schema.parse(e))}catch(e){r.reject(e)}else r.resolve({})}}setOnControlRequestSent(e){this.onControlRequestSent=e}setOnControlRequestResolved(e){this.onControlRequestResolved=e}async processLine(e){if(e)try{let t=yt(ue(e));if(t.type===`keep_alive`)return;if(t.type===`update_environment_variables`){let e=t.variables??{},n=Object.keys(e);for(let[t,n]of Object.entries(e))process.env[t]=n;k(`[structuredIO] applied update_environment_variables: ${n.join(`, `)}`);return}if(t.type===`control_response`){let e=`uuid`in t&&typeof t.uuid==`string`?t.uuid:void 0;e&&Ye(e,`completed`);let n=t.response,r=this.pendingRequests.get(n.request_id);if(!r){let e=(n.subtype===`success`?n.response:void 0)?.toolUseID;if(typeof e==`string`&&this.resolvedToolUseIds.has(e)){k(`Ignoring duplicate control_response for already-resolved toolUseID=${e} request_id=${n.request_id}`);return}this.unexpectedResponseCallback&&await this.unexpectedResponseCallback(t);return}if(this.trackResolvedToolUseId(r.request),this.pendingRequests.delete(n.request_id),r.request.request.subtype===`can_use_tool`&&this.onControlRequestResolved&&this.onControlRequestResolved(n.request_id),n.subtype===`error`){r.reject(Error(n.error??`Unknown error`));return}let i=n.response;if(r.schema)try{r.resolve(r.schema.parse(i))}catch(e){r.reject(e)}else r.resolve({});return this.replayUserMessages?t:void 0}if(t.type!==`user`&&t.type!==`control_request`&&t.type!==`assistant`&&t.type!==`system`){k(`Ignoring unknown message type: ${t.type}`,{level:`warn`});return}return t.type===`control_request`?(t.request||vn(`Error: Missing request on control_request`),t):(t.type===`assistant`||t.type===`system`||t.message?.role!==`user`&&vn(`Error: Expected message role 'user', got '${t.message?.role}'`),t)}catch(t){console.error(`Error parsing streaming input line: ${e}: ${t}`),process.exit(1)}}async write(e){_e(fn(e)+`
|
|
4
|
-
`)}async sendRequest(e,t,n,r=V()){let i={type:`control_request`,request_id:r,request:e};if(this.inputClosed)throw Error(`Stream closed`);if(n?.aborted)throw Error(`Request aborted`);this.outbound.enqueue(i),e.subtype===`can_use_tool`&&this.onControlRequestSent&&this.onControlRequestSent(i);let a=()=>{this.outbound.enqueue({type:`control_cancel_request`,request_id:r});let e=this.pendingRequests.get(r);e&&(this.trackResolvedToolUseId(e.request),e.reject(new pe))};n&&n.addEventListener(`abort`,a,{once:!0});try{return await new Promise((n,i)=>{this.pendingRequests.set(r,{request:{type:`control_request`,request_id:r,request:e},resolve:e=>{n(e)},reject:i,schema:t})})}finally{n&&n.removeEventListener(`abort`,a),this.pendingRequests.delete(r)}}createCanUseTool(e){return async(t,n,r,i,a,o)=>{let s=o??await Me(t,n,r,i,a);if(s.behavior===`allow`||s.behavior===`deny`)return s;let c=new AbortController,l=r.abortController.signal,u=()=>c.abort();l.addEventListener(`abort`,u,{once:!0});try{let i=yn(t.name,a,n,r,s.suggestions).then(e=>({source:`hook`,decision:e})),o=V();e?.(hn(t,n,a,o));let l=this.sendRequest({subtype:`can_use_tool`,tool_name:t.name,input:n,permission_suggestions:s.suggestions,blocked_path:s.blockedPath,decision_reason:mn(s.decisionReason),tool_use_id:a,agent_id:r.agentId},W(),c.signal,o).then(e=>({source:`sdk`,result:e})),u=await Promise.race([i,l]);return u.source===`hook`?u.decision?(l.catch(()=>{}),c.abort(),u.decision):G((await l).result,t,n,r):G(u.result,t,n,r)}catch(e){return G({behavior:`deny`,message:`Tool permission request failed: ${e}`,toolUseID:a},t,n,r)}finally{this.getPendingPermissionRequests().length===0&&vt(`running`),l.removeEventListener(`abort`,u)}}}createHookCallback(e,t){return{type:`callback`,timeout:t,callback:async(t,n,r)=>{try{return await this.sendRequest({subtype:`hook_callback`,callback_id:e,input:t,tool_use_id:n||void 0},et(),r)}catch(t){return console.error(`Error in hook callback ${e}:`,t),{}}}}}async handleElicitation(e,t,n,r,i,a,o){try{return await this.sendRequest({subtype:`elicitation`,mcp_server_name:e,message:t,mode:i,url:a,elicitation_id:o,requested_schema:n},Qt(),r)}catch{return{action:`cancel`}}}createSandboxAskCallback(){return async e=>{try{return(await this.sendRequest({subtype:`can_use_tool`,tool_name:pn,input:{host:e.host},tool_use_id:V(),description:`Allow network connection to ${e.host}?`},W())).behavior===`allow`}catch{return!1}}}async sendMcpMessage(e,t){return(await this.sendRequest({subtype:`mcp_message`,server_name:e,message:t},m({mcp_response:h()}))).mcp_response}};function vn(e){console.error(e),process.exit(1)}async function yn(e,t,n,r,i){let a=r.getAppState().toolPermissionContext.mode,o=at(e,t,n,r,a,i,r.abortController.signal);for await(let e of o)if(e.permissionRequestResult&&(e.permissionRequestResult.behavior===`allow`||e.permissionRequestResult.behavior===`deny`)){let t=e.permissionRequestResult;if(t.behavior===`allow`){let e=t.updatedInput||n,i=t.updatedPermissions??[];if(i.length>0){Be(i);let e=R(r.getAppState().toolPermissionContext,i);r.setAppState(t=>t.toolPermissionContext===e?t:{...t,toolPermissionContext:e})}return{behavior:`allow`,updatedInput:e,userModified:!1,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}else return{behavior:`deny`,message:t.message||`Permission denied by PermissionRequest hook`,decisionReason:{type:`hook`,hookName:`PermissionRequest`}}}}Xe();function bn(e){if(e.type!==`user`)return;let t=e.message?.content;if(!t||Array.isArray(t)&&t.length===0)return;let n=`uuid`in e&&typeof e.uuid==`string`?e.uuid:void 0;return{content:Array.isArray(t)?xn(t):t,uuid:n}}function xn(e){return e.some(Sn)?e.map(e=>{if(!Sn(e))return e;let t=e.source,n=typeof t.mediaType==`string`&&t.mediaType?t.mediaType:Je(e.source.data);return{...e,source:{type:`base64`,media_type:n,data:e.source.data}}}):e}function Sn(e){return e.type!==`image`||e.source?.type!==`base64`?!1:!e.source.media_type}C(),O(),D(),xe(),it();function Cn(e,t,n){let r=[],i=[],a=[];for(let[o,s]of Object.entries(e)){let e=t[o],c=Tn(s.source,n?.projectRoot);e?s.sourceIsFallback||re(c,e.source)?a.push(o):i.push({name:o,declaredSource:c,materializedSource:e.source}):r.push(o)}return{missing:r,sourceChanged:i,upToDate:a}}async function wn(e){let t=Ue();if(Object.keys(t).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let n;try{n=await Ie()}catch(e){j(e),n={}}let r=Cn(t,n,{projectRoot:x()}),i=[...r.missing.map(e=>({name:e,source:Tn(t[e].source),action:`install`})),...r.sourceChanged.map(({name:e,declaredSource:t})=>({name:e,source:t,action:`update`}))],a=[],o=[];for(let t of i){if(e?.skip?.(t.name,t.source)){a.push(t.name);continue}if(t.action===`update`&&ie(t.source)&&!await ae(t.source.path)){k(`[reconcile] '${t.name}' declared path does not exist; keeping materialized entry`),a.push(t.name);continue}o.push(t)}if(o.length===0)return{installed:[],updated:[],failed:[],upToDate:r.upToDate,skipped:a};k(`[reconcile] ${o.length} marketplace(s): ${o.map(e=>`${e.name}(${e.action})`).join(`, `)}`);let s=[],c=[],l=[];for(let t=0;t<o.length;t++){let{name:n,source:r,action:i}=o[t];e?.onProgress?.({type:`installing`,name:n,action:i,index:t+1,total:o.length});try{let t=await Ge(r);i===`install`?s.push(n):c.push(n),e?.onProgress?.({type:`installed`,name:n,alreadyMaterialized:t.alreadyMaterialized})}catch(t){let r=me(t);l.push({name:n,error:r}),e?.onProgress?.({type:`failed`,name:n,error:r}),j(t)}}return{installed:s,updated:c,failed:l,upToDate:r.upToDate,skipped:a}}function Tn(e,t){if((e.source===`directory`||e.source===`file`)&&!xt(e.path)){let n=t??x(),r=be(n);return{...e,path:Ct(r??n,e.path)}}return e}function K(e){return St(e??S(),kn)}async function En(e){let t;try{t=await Tt(K(e),`utf8`)}catch{return}let n=An().safeParse(we(t,!1));return n.success?n.data:void 0}async function Dn(e,t){let n=K(t),r=E(e);try{return await H(n,r,{flag:`wx`}),!0}catch(e){let t=le(e);if(t===`EEXIST`)return!1;if(t===`ENOENT`){await wt(bt(n),{recursive:!0});try{return await H(n,r,{flag:`wx`}),!0}catch(e){if(le(e)===`EEXIST`)return!1;throw e}}throw e}}function q(e){Y?.(),Y=de(async()=>{await J(e)})}async function On(e){let t=e?.dir,n=e?.lockIdentity??v(),r={sessionId:n,pid:process.pid,acquiredAt:Date.now()};if(await Dn(r,t))return X=void 0,q(e),k(`[ScheduledTasks] acquired scheduler lock (PID ${process.pid})`),!0;let i=await En(t);return i?.sessionId===n?(i.pid!==process.pid&&(await H(K(t),E(r)),q(e)),!0):i&&Te(i.pid)?(X!==i.sessionId&&(X=i.sessionId,k(`[ScheduledTasks] scheduler lock held by session ${i.sessionId} (PID ${i.pid})`)),!1):(i&&k(`[ScheduledTasks] recovering stale scheduler lock from PID ${i.pid}`),await Et(K(t)).catch(()=>{}),await Dn(r,t)?(X=void 0,q(e),!0):!1)}async function J(e){Y?.(),Y=void 0,X=void 0;let t=e?.dir,n=e?.lockIdentity??v(),r=await En(t);if(!(!r||r.sessionId!==n))try{await Et(K(t)),k(`[ScheduledTasks] released scheduler lock`)}catch{}}var kn,An,Y,X,jn=e((()=>{_(),y(),O(),D(),Ee(),Ce(),N(),T(),kn=St(`.claude`,`scheduled_tasks.lock`),An=M(()=>m({sessionId:a(),pid:i(),acquiredAt:i()}))})),Mn=t({buildMissedTaskNotification:()=>Fn,createCronScheduler:()=>Pn,isRecurringTaskAged:()=>Nn});function Nn(e,t,n){return n===0?!1:!!(e.recurring&&!e.permanent&&t-e.createdAt>=n)}function Pn(e){let{onFire:t,isLoading:n,assistantMode:r=!1,onFireTask:i,onMissed:a,dir:o,lockIdentity:s,getJitterConfig:c,isKilled:l,filter:u}=e,d=o||s?{dir:o,lockIdentity:s}:void 0,f=[],p=new Map,m=new Set,h=new Set,g=null,_=null,v=null,y=null,x=!1,S=!1;async function C(e){let n=await pt(o);if(x||(f=n,!e))return;let r=ut(n,Date.now()).filter(e=>!e.recurring&&!m.has(e.id)&&(!u||u(e)));if(r.length>0){for(let e of r)m.add(e.id),p.set(e.id,1/0);A(`tengu_scheduled_task_missed`,{count:r.length,taskIds:r.map(e=>e.id).join(`,`)}),a?a(r):t(Fn(r)),ct(r.map(e=>e.id),o).catch(e=>k(`[ScheduledTasks] failed to remove missed tasks: ${e}`)),k(`[ScheduledTasks] surfaced ${r.length} missed one-shot task(s)`)}}function re(){if(l?.()||n()&&!r)return;let e=Date.now(),a=new Set,s=[],d=c?.()??B;function m(n,r){if(u&&!u(n)||(a.add(n.id),h.has(n.id)))return;let c=p.get(n.id);if(c===void 0&&(c=n.recurring?st(n.cron,n.lastFiredAt??n.createdAt,n.id,d)??1/0:lt(n.cron,n.createdAt,n.id,d)??1/0,p.set(n.id,c),k(`[ScheduledTasks] scheduled ${n.id} for ${c===1/0?`never`:new Date(c).toISOString()}`)),e<c)return;k(`[ScheduledTasks] firing ${n.id}${n.recurring?` (recurring)`:``}`),A(`tengu_scheduled_task_fire`,{recurring:n.recurring??!1,taskId:n.id}),i?i(n):t(n.prompt);let l=Nn(n,e,d.recurringMaxAgeMs);if(l){let t=Math.floor((e-n.createdAt)/1e3/60/60);k(`[ScheduledTasks] recurring task ${n.id} aged out (${t}h since creation), deleting after final fire`),A(`tengu_scheduled_task_expired`,{taskId:n.id,ageHours:t})}if(n.recurring&&!l){let t=st(n.cron,e,n.id,d)??1/0;p.set(n.id,t),r||s.push(n.id)}else r?(ne([n.id]),p.delete(n.id)):(h.add(n.id),ct([n.id],o).catch(e=>k(`[ScheduledTasks] failed to remove task ${n.id}: ${e}`)).finally(()=>h.delete(n.id)),p.delete(n.id))}if(S){for(let e of f)m(e,!1);if(s.length>0){for(let e of s)h.add(e);ft(s,e,o).catch(e=>k(`[ScheduledTasks] failed to persist lastFiredAt: ${e}`)).finally(()=>{for(let e of s)h.delete(e)})}}if(o===void 0)for(let e of ee())m(e,!0);if(a.size===0){p.clear();return}for(let e of p.keys())a.has(e)||p.delete(e)}async function w(){if(x)return;g&&(clearInterval(g),g=null);let{default:e}=await import(`./chokidar-BcI3rIKm.js`);if(x)return;if(S=await On(d).catch(()=>!1),x){S&&(S=!1,J(d));return}S||(v=setInterval(()=>{On(d).then(e=>{if(x){e&&J(d);return}e&&(S=!0,v&&(clearInterval(v),v=null))}).catch(e=>k(String(e),{level:`error`}))},Q),v.unref?.()),C(!0);let t=mt(o);y=e.watch(t,{persistent:!1,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:In},ignorePermissionErrors:!0}),y.on(`add`,()=>void C(!1)),y.on(`change`,()=>void C(!1)),y.on(`unlink`,()=>{x||(f=[],p.clear())}),_=setInterval(re,Z),_.unref?.()}return{start(){if(x=!1,o!==void 0){k(`[ScheduledTasks] scheduler start() — dir=${o}, hasTasks=${z(o)}`),w();return}if(k(`[ScheduledTasks] scheduler start() — enabled=${b()}, hasTasks=${z()}`),!b()&&(r||z())&&te(!0),b()){w();return}g=setInterval(e=>{b()&&e()},Z,w),g.unref?.()},stop(){x=!0,g&&(clearInterval(g),g=null),_&&(clearInterval(_),_=null),v&&(clearInterval(v),v=null),y?.close(),y=null,S&&(S=!1,J(d))},getNextFireTime(){let e=1/0;for(let t of p.values())t<e&&(e=t);return e===1/0?null:e}}}function Fn(e){let t=e.length>1;return`${`The following one-shot scheduled task${t?`s were`:` was`} missed while Claude was not running. ${t?`They have`:`It has`} already been removed from .claude/scheduled_tasks.json.\n\nDo NOT execute ${t?`these prompts`:`this prompt`} yet. First use the AskUserQuestion tool to ask whether to run ${t?`each one`:`it`} now. Only execute if the user confirms.`}\n\n${e.map(e=>{let t=`[${ht(e.cron)}, created ${new Date(e.createdAt).toLocaleString()}]`,n=(e.prompt.match(/`+/g)??[]).reduce((e,t)=>Math.max(e,t.length),0),r="`".repeat(Math.max(3,n+1));return`${t}\n${r}\n${e.prompt}\n${r}`}).join(`
|
|
5
|
-
|
|
6
|
-
`)}`}var Z,In,Q,Ln=e((()=>{y(),gt(),dt(),jn(),O(),Z=1e3,In=300,Q=5e3})),Rn=t({getCronJitterConfig:()=>zn});function zn(){let e=se(`tengu_kairos_cron_config`,B,Bn),t=Hn().safeParse(e);return t.success?t.data:B}var Bn,$,Vn,Hn,Un=e((()=>{_(),dt(),N(),Bn=60*1e3,$=1800*1e3,Vn=720*60*60*1e3,Hn=M(()=>m({recurringFrac:i().min(0).max(1),recurringCapMs:i().int().min(0).max($),oneShotMaxMs:i().int().min(0).max($),oneShotFloorMs:i().int().min(0).max($),oneShotMinuteMod:i().int().min(1).max(60),recurringMaxAgeMs:i().int().min(0).max(Vn).default(B.recurringMaxAgeMs)}).refine(e=>e.oneShotFloorMs<=e.oneShotMaxMs))}));export{Mn as a,wn as c,_n as d,fn as f,Pn as i,bn as l,G as m,zn as n,Ln as o,W as p,Un as r,Cn as s,Rn as t,pn as u};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{Cn as i,F as a,In as o,Ln as s,Mn as c,Rn as l,T as u,Ut as d,_ as f,b as p,g as m,h,l as ee,m as te,t as g,tt as _,x as v,xt as y}from"./src-Di342QoJ.js";import{t as b}from"./jsx-runtime-D-D469L8.js";import{Ct as ne,cn as x,ot as re}from"./state-sIHsFpDu.js";import{Mr as ie,Pr as ae}from"./paths-DfGsIjPm.js";import{D as S,E as oe,l as C,p as w}from"./debug-otxXY3j-.js";import{n as se,r as T}from"./analytics-DqMQntaB.js";import{i as ce,v as le}from"./git-DayFjsvj.js";import{a as ue,o as E,s as de}from"./log-DS97_rIr.js";import{b as D,x as fe}from"./teammate-DMYOtLTK.js";import{E as O,g as pe,p as me,x as k}from"./startupProfiler-CnDpob1v.js";import{$u as he,DC as A,EC as j,Fr as ge,Jr as _e,Jy as ve,Ky as ye,Lr as be,R_ as xe,Ri as Se,Si as Ce,Zu as we,_b as Te,aS as Ee,dS as De,fS as Oe,hT as ke,kr as M,oS as Ae,vb as je,xr as Me,z_ as Ne,zi as Pe,zr as Fe}from"./loadAgentsDir-Br5fGLLI.js";import{i as N,r as P}from"./shellQuote-D8XPeqkc.js";import{t as Ie}from"./useKeybinding-FsOnjW6T.js";import{l as Le,u as Re}from"./referral-DOqhciQu.js";import{t as ze}from"./SearchBox-DfOmUoaI.js";import{n as Be,t as Ve}from"./useSearchInput-CROB7AbC.js";import{n as He,t as F}from"./Messages-DT2gDtrJ.js";import{n as Ue,t as We}from"./fuse-Bp7rmZ5x.js";import{sep as I}from"path";function Ge({log:e,onExit:t,onSelect:n}){let[r,i]=L.useState(null);L.useEffect(()=>{i(null),Fe(e)&&_e(e).then(i)},[e]);let a=Fe(e)&&r===null,o=r??e,s=M(o)||``,c=we();return _(`confirm:no`,t,{context:`Confirmation`}),_(`confirm:yes`,(0,L.useCallback)(()=>{n(r??e)},[n,r,e]),{context:`Confirmation`}),a?(0,R.jsxs)(v,{flexDirection:`column`,padding:1,children:[(0,R.jsx)(ee,{message:`Loading session…`}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsx)(h,{children:(0,R.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})})})]}):(0,R.jsxs)(v,{flexDirection:`column`,children:[(0,R.jsx)(F,{messages:o.messages,tools:c,commands:[],verbose:!0,toolJSX:null,toolUseConfirmQueue:[],inProgressToolUseIDs:new Set,isMessageSelectorVisible:!1,conversationId:s,screen:`transcript`,streamingToolUses:[],showAllInTranscript:!0,isLoading:!1}),(0,R.jsxs)(v,{flexShrink:0,flexDirection:`column`,borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:`single`,paddingLeft:2,children:[(0,R.jsxs)(p,{children:[pe(o.modified),` · `,o.messageCount,` messages`,o.gitBranch?` · ${o.gitBranch}`:``]}),(0,R.jsx)(p,{dimColor:!0,children:(0,R.jsxs)(h,{children:[(0,R.jsx)(m,{shortcut:`Enter`,action:`resume`}),(0,R.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})]})}var L,R,z=e((()=>{L=t(l(),1),g(),Ie(),he(),k(),ge(),A(),He(),R=b()}));function Ke(e,t){if(e===V)return 3+H;let n=i(e),r=t?Math.min(n,t-H-U):n;return Math.max(0,r)+H+U}function qe(e,t){let n=t-H-U;return i(e)<=n?e:n<=1?e.charAt(0):O(e,n)}function Je({tabs:e,selectedIndex:t,availableWidth:n,showAllProjects:r=!1}){let i=r?`Resume (All Projects)`:`Resume`,a=i.length+1,o=Math.max(W,G),s=n-a-o-2,c=Math.max(0,Math.min(t,e.length-1)),l=Math.max(20,Math.floor(s/2)),u=e.map(e=>Ke(e,l)),d=0,f=e.length;if(u.reduce((e,t,n)=>e+t+ +(n<u.length-1),0)>s){let t=s-et,n=u[c]??0;for(d=c,f=c+1;d>0||f<e.length;){let r=d>0,i=f<e.length;if(r){let e=(u[d-1]??0)+1;if(n+e<=t){d--,n+=e;continue}}if(i){let e=(u[f]??0)+1;if(n+e<=t){f++,n+=e;continue}}break}}let m=d,h=e.length-f,ee=e.slice(d,f),te=ee.map((e,t)=>d+t);return(0,B.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,B.jsx)(p,{color:`suggestion`,children:i}),m>0&&(0,B.jsxs)(p,{dimColor:!0,children:[Ye,m]}),ee.map((e,t)=>{let n=te[t]===c,r=e===V?e:`#${qe(e,l-H)}`;return(0,B.jsxs)(p,{backgroundColor:n?`suggestion`:void 0,color:n?`inverseText`:void 0,bold:n,children:[` `,r,` `]},e)}),h>0?(0,B.jsxs)(p,{dimColor:!0,children:[Xe,h,Ze]}):(0,B.jsx)(p,{dimColor:!0,children:Qe})]})}var B,V,H,U,Ye,Xe,Ze,Qe,$e,et,W,G,tt=e((()=>{l(),g(),k(),B=b(),V=`All`,H=2,U=1,Ye=`← `,Xe=`→`,Ze=` (tab to cycle)`,Qe=`(tab to cycle)`,$e=2,et=2+$e+1,W=1+$e+15,G=14}));function nt({nodes:e,onSelect:t,onCancel:n,onFocus:r,focusNodeId:i,visibleOptionCount:a,layout:o=`expanded`,isDisabled:s=!1,hideIndexes:c=!1,isNodeExpanded:l,onExpand:u,onCollapse:d,getParentPrefix:f,getChildPrefix:p,onUpFromFirstItem:m}){let[h,ee]=K.useState(new Set),te=K.useRef(!1),g=K.useRef(null),_=K.useCallback(e=>l?l(e):h.has(e),[l,h]),y=K.useMemo(()=>{let t=[];function n(e,r,i){let a=!!e.children&&e.children.length>0,o=_(e.id);if(t.push({node:e,depth:r,isExpanded:o,hasChildren:a,parentId:i}),a&&o&&e.children)for(let t of e.children)n(t,r+1,e.id)}for(let t of e)n(t,0);return t},[e,_]),b=K.useCallback(e=>e?`▼ `:`▶ `,[]),ne=K.useCallback(e=>` ▸ `,[]),x=f??b,re=p??ne,ie=K.useCallback(e=>{let t=``;return e.hasChildren?t=x(e.isExpanded):e.depth>0&&(t=re(e.depth)),t+e.node.label},[x,re]),ae=K.useMemo(()=>y.map(e=>({label:ie(e),description:e.node.description,dimDescription:e.node.dimDescription??!0,value:e.node.id})),[y,ie]),S=K.useMemo(()=>{let e=new Map;return y.forEach(t=>e.set(t.node.id,t.node)),e},[y]),oe=K.useCallback(e=>y.find(t=>t.node.id===e),[y]),C=K.useCallback((e,t)=>{let n=oe(e);!n||!n.hasChildren||(t?u?u(e):ee(t=>new Set(t).add(e)):d?d(e):ee(t=>{let n=new Set(t);return n.delete(e),n}))},[oe,u,d]);return(0,rt.jsx)(v,{tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(!i||s)return;let t=oe(i);if(t){if(e.key===`right`&&t.hasChildren)e.preventDefault(),C(i,!0);else if(e.key===`left`){if(t.hasChildren&&t.isExpanded)e.preventDefault(),C(i,!1);else if(t.parentId!==void 0&&(e.preventDefault(),te.current=!0,C(t.parentId,!1),r)){let e=S.get(t.parentId);e&&r(e)}}}},children:(0,rt.jsx)(Ee,{options:ae,onChange:K.useCallback(e=>{let n=S.get(e);n&&t(n)},[S,t]),onFocus:K.useCallback(e=>{if(te.current){te.current=!1;return}if(g.current!==e&&(g.current=e,r)){let t=S.get(e);t&&r(t)}},[r,S]),onCancel:n,defaultFocusValue:i,visibleOptionCount:a,layout:o,isDisabled:s,hideIndexes:c,onUpFromFirstItem:m})})}var K,rt,it=e((()=>{K=t(l(),1),g(),Ae(),rt=b()}));function at(e,t){return O(e.replace(/\s+/g,` `).trim(),t)}function ot({before:e,match:t,after:n},r){return o.dim(e)+r(t)+o.dim(n)}function st(e,t,n){let r=e.toLowerCase().indexOf(t.toLowerCase());if(r===-1)return null;let i=r+t.length,a=Math.max(0,r-n),o=Math.min(e.length,i+n),s=e.slice(a,r),c=e.slice(r,i),l=e.slice(i,o);return{before:(a>0?`…`:``)+s.replace(/\s+/g,` `).trimStart(),match:c.trim(),after:l.replace(/\s+/g,` `).trimEnd()+(o<e.length?`…`:``)}}function ct(e,t,n){let{isGroupHeader:r=!1,isChild:i=!1,forkCount:a=0}=n||{},o=r&&a>0?ht:i?Y:0,s=r&&a>0?` (+${a} other ${a===1?`session`:`sessions`})`:``,c=e.isSidechain?` (sidechain)`:``,l=t-o-c.length-s.length;return`${at(ue(e),l)}${c}${s}`}function lt(e,t){let{isChild:n=!1,showProjectPath:r=!1}=t||{},i=n?` `:``,a=me(e),o=r&&e.projectPath?` · ${e.projectPath}`:``;return i+a+o}function ut({logs:e,maxHeight:t=1/0,forceWidth:n,onCancel:i,onSelect:o,onLogsChanged:s,onLoadMore:l,initialSearchQuery:ee,showAllProjects:g=!1,onToggleAllProjects:b,onAgenticSearch:x}){let ie=a(),ae=n===void 0?ie.columns:n,S=Re(i),oe=d(),C=be(),w=process.env.USER_TYPE===`ant`,[se]=u(),le=Te(se),E=q.useMemo(()=>e=>c(e,le.warning),[le.warning]),de=process.env.USER_TYPE===`ant`,[D,fe]=q.useState(null),[O,pe]=q.useState(!1),[k,he]=q.useState(!1),[A,ge]=q.useState(!1),_e=q.useMemo(()=>re(),[]),[ve,xe]=q.useState(``),[we,Oe]=q.useState(0),[ke,Ae]=q.useState(new Set),[je,Ne]=q.useState(null),[Pe,Fe]=q.useState(1),[N,P]=q.useState(`list`),[Ie,Le]=q.useState(null),ze=q.useRef(null),[Ve,He]=q.useState(0),[F,Ue]=q.useState({status:`idle`}),[I,L]=q.useState(!1),R=q.useRef(null),{query:z,setQuery:Ke,cursorOffset:qe}=Be({isActive:N===`search`&&F.status!==`searching`,onExit:()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},onExitUp:()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},passthroughCtrlKeys:[`n`],initialQuery:ee||``}),B=q.useDeferredValue(z),[V,H]=q.useState(``);q.useEffect(()=>{if(!B){H(``);return}let e=setTimeout(H,300,B);return()=>clearTimeout(e)},[B]);let[U,Ye]=q.useState(null),[Xe,Ze]=q.useState(!1);q.useEffect(()=>{ce().then(e=>fe(e)),Se(_e).then(e=>{ge(e.length>1)})},[_e]);let Qe=q.useMemo(()=>new Map(e.map(e=>[e,ft(e)])),[e]),$e=q.useMemo(()=>w?new We(e.map(e=>({log:e,searchableText:Qe.get(e)??``})).filter(e=>e.searchableText),{keys:[`searchableText`],threshold:gt,ignoreLocation:!0,includeScore:!0}):null,[e,Qe,w]),et=q.useMemo(()=>mt(e),[e]),W=et.length>0,G=q.useMemo(()=>W?[`All`,...et]:[],[W,et]),tt=G.length>0&&Ve<G.length?Ve:0,K=G[tt],rt=K===`All`?void 0:K,it=+!!W,ut=q.useMemo(()=>{let t=e;return C&&(t=e.filter(e=>{let t=ne(),n=M(e);return!!(t&&n===t||e.customTitle||Me(e.messages)||e.firstPrompt||e.customTitle)})),rt!==void 0&&(t=t.filter(e=>e.tag===rt)),O&&D&&(t=t.filter(e=>e.gitBranch===D)),A&&!k&&(t=t.filter(e=>e.projectPath===_e)),t},[e,C,rt,O,D,A,k,_e]),dt=q.useMemo(()=>{if(!z)return ut;let e=z.toLowerCase();return ut.filter(t=>{let n=ue(t).toLowerCase(),r=(t.gitBranch||``).toLowerCase(),i=(t.tag||``).toLowerCase(),a=t.prNumber?`pr #${t.prNumber} ${t.prRepository||``}`.toLowerCase():``;return n.includes(e)||r.includes(e)||i.includes(e)||a.includes(e)})},[ut,z]);q.useEffect(()=>{w&&B&&B!==V&&Ze(!0)},[B,V,w]),q.useEffect(()=>{if(!w||!V||!$e){Ye(null),Ze(!1);return}let e=setTimeout((e,t,n,r)=>{let i=e.search(t);i.sort((e,t)=>{let n=new Date(e.item.log.modified).getTime(),r=new Date(t.item.log.modified).getTime()-n;return Math.abs(r)>_t?r:(e.score??1)-(t.score??1)}),n({results:i.map(e=>({log:e.item.log,score:e.score,searchableText:e.item.searchableText})),query:t}),r(!1)},0,$e,V,Ye,Ze);return()=>{clearTimeout(e)}},[V,$e,w]);let{filteredLogs:ht,snippets:Y}=q.useMemo(()=>{let e=new Map,t=dt;if(U&&V&&U.query===V){for(let t of U.results)if(t.searchableText){let n=st(t.searchableText,V,vt);n&&e.set(t.log,n)}let n=new Set(t.map(e=>e.messages[0]?.uuid)),r=U.results.map(e=>e.log).filter(e=>!n.has(e.messages[0]?.uuid));t=[...t,...r]}return{filteredLogs:t,snippets:e}},[dt,U,V]),X=q.useMemo(()=>F.status===`results`&&F.results.length>0?F.results:ht,[F,ht]),Z=Math.max(30,ae-4),Q=q.useMemo(()=>{if(!C)return[];let e=pt(X);return Array.from(e.entries()).map(([e,t])=>{let n=t[0],r=X.indexOf(n),i=Y.get(n),a=i?ot(i,E):null;if(t.length===1){let t=lt(n,{showProjectPath:g});return{id:`log:${e}:0`,value:{log:n,indexInFiltered:r},label:ct(n,Z),description:a?`${t}\n ${a}`:t,dimDescription:!0}}let o=t.length-1,s=t.slice(1).map((t,n)=>{let r=X.indexOf(t),i=Y.get(t),a=i?ot(i,E):null,o=lt(t,{isChild:!0,showProjectPath:g});return{id:`log:${e}:${n+1}`,value:{log:t,indexInFiltered:r},label:ct(t,Z,{isChild:!0}),description:a?`${o}\n ${a}`:o,dimDescription:!0}}),c=lt(n,{showProjectPath:g});return{id:`group:${e}`,value:{log:n,indexInFiltered:r},label:ct(n,Z,{isGroupHeader:!0,forkCount:o}),description:a?`${c}\n ${a}`:c,dimDescription:!0,children:s}})},[C,X,Z,g,Y,E]),yt=q.useMemo(()=>C?[]:X.map((e,t)=>{let n=at(ue(e)+(e.isSidechain?` (sidechain)`:``),Z),r=me(e),i=g&&e.projectPath?` · ${e.projectPath}`:``,a=Y.get(e),o=a?ot(a,E):null;return{label:n,description:o?`${r}${i}\n ${o}`:r+i,dimDescription:!0,value:t.toString()}}),[C,X,E,Z,g,Y]),$=je?.value.log??null,bt=()=>{if(!C||!$)return``;let e=M($);if(!e)return``;let t=X.filter(t=>M(t)===e);if(!(t.length>1))return``;let n=ke.has(e);return t.indexOf($)>0||n?`← to collapse`:`→ to expand`},xt=q.useCallback(async()=>{let e=$?M($):void 0;if(!$||!e){P(`list`),xe(``);return}ve.trim()&&(await Ce(e,ve.trim(),$.fullPath),C&&s&&s()),P(`list`),xe(``)},[$,ve,s,C]),St=q.useCallback(()=>{P(`list`),T(`tengu_session_search_toggled`,{enabled:!1})},[]),Ct=q.useCallback(()=>{P(`search`),T(`tengu_session_search_toggled`,{enabled:!0})},[]),wt=q.useCallback(async()=>{if(!z.trim()||!x||!de)return;R.current?.abort();let t=new AbortController;R.current=t,Ue({status:`searching`}),T(`tengu_agentic_search_started`,{query_length:z.length});try{let n=await x(z,e,t.signal);if(t.signal.aborted)return;Ue({status:`results`,results:n,query:z}),T(`tengu_agentic_search_completed`,{query_length:z.length,results_count:n.length})}catch(e){if(t.signal.aborted)return;Ue({status:`error`,message:e instanceof Error?e.message:`Search failed`}),T(`tengu_agentic_search_error`,{query_length:z.length})}},[z,x,de,e]);q.useEffect(()=>{F.status!==`idle`&&F.status!==`searching`&&(F.status===`results`&&F.query!==z||F.status===`error`)&&Ue({status:`idle`})},[z,F]),q.useEffect(()=>()=>{R.current?.abort()},[]);let Tt=q.useRef(F.status);q.useEffect(()=>{let e=Tt.current;if(Tt.current=F.status,e===`searching`&&F.status===`results`){if(C&&Q.length>0)Ne(Q[0]);else if(!C&&X.length>0){let e=X[0];Ne({id:`0`,value:{log:e,indexInFiltered:0},label:``})}}},[F.status,C,Q,X]);let Et=q.useCallback(e=>{let t=parseInt(e,10),n=X[t];!n||ze.current===t.toString()||(ze.current=t.toString(),Ne({id:t.toString(),value:{log:n,indexInFiltered:t},label:``}),Fe(t+1))},[X]),Dt=q.useCallback(e=>{Ne(e);let t=X.findIndex(t=>M(t)===M(e.value.log));t>=0&&Fe(t+1)},[X]);_(`confirm:no`,()=>{R.current?.abort(),Ue({status:`idle`}),T(`tengu_agentic_search_cancelled`,{})},{context:`Confirmation`,isActive:N!==`preview`&&F.status===`searching`}),_(`confirm:no`,()=>{P(`list`),xe(``)},{context:`Settings`,isActive:N===`rename`&&F.status!==`searching`}),_(`confirm:no`,()=>{Ke(``),L(!1),i?.()},{context:`Confirmation`,isActive:N!==`preview`&&N!==`rename`&&N!==`search`&&I&&F.status!==`searching`}),y((e,t)=>{if(N!==`preview`&&F.status!==`searching`&&N!==`rename`)if(N===`search`)e.toLowerCase()===`n`&&t.ctrl?St():(t.return||t.downArrow)&&z.trim()&&x&&de&&F.status!==`results`&&L(!0);else{if(I){if(t.return){wt(),L(!1);return}else if(t.downArrow){L(!1);return}else if(t.upArrow){P(`search`),L(!1);return}}if(W&&t.tab){let e=t.shift?-1:1;He(t=>{let n=((t<G.length?t:0)+G.length+e)%G.length,r=G[n];return T(`tengu_session_tag_filter_changed`,{is_all:r===`All`,tag_count:et.length}),n});return}let n=!t.ctrl&&!t.meta,r=e.toLowerCase();if(r===`a`&&t.ctrl&&b)b(),T(`tengu_session_all_projects_toggled`,{enabled:!g});else if(r===`b`&&t.ctrl){let e=!O;pe(e),T(`tengu_session_branch_filter_toggled`,{enabled:e})}else if(r===`w`&&t.ctrl&&A){let e=!k;he(e),T(`tengu_session_worktree_filter_toggled`,{enabled:e})}else r===`/`&&n?(P(`search`),T(`tengu_session_search_toggled`,{enabled:!0})):r===`r`&&t.ctrl&&$?(P(`rename`),xe(``),T(`tengu_session_rename_started`,{})):r===`v`&&t.ctrl&&$?(Le($),P(`preview`),T(`tengu_session_preview_opened`,{messageCount:$.messageCount})):$&&n&&e.length>0&&!/^\s+$/.test(e)&&(P(`search`),Ke(e),T(`tengu_session_search_toggled`,{enabled:!0}))}},{isActive:!0});let Ot=[];O&&D&&Ot.push(D),A&&!k&&Ot.push(`current worktree`);let kt=8+ +(Ot.length>0&&N!==`search`)+it,At=Math.max(1,Math.floor((t-kt-2)/3));return q.useEffect(()=>{l&&Pe+At*2>=X.length&&l(At*3)},[Pe,At,X.length,l]),e.length===0?null:N===`preview`&&Ie&&C?(0,J.jsx)(Ge,{log:Ie,onExit:()=>{P(`list`),Le(null)},onSelect:o}):(0,J.jsxs)(v,{flexDirection:`column`,height:t-1,children:[(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(te,{color:`suggestion`})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),W?(0,J.jsx)(Je,{tabs:G,selectedIndex:tt,availableWidth:ae,showAllProjects:g}):(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsxs)(p,{bold:!0,color:`suggestion`,children:[`Resume Session`,N===`list`&&X.length>At&&(0,J.jsxs)(p,{dimColor:!0,children:[` `,`(`,Pe,` of `,X.length,`)`]})]})}),(0,J.jsx)(f,{query:z,isFocused:N===`search`,isTerminalFocused:oe,cursorOffset:qe}),Ot.length>0&&N!==`search`&&(0,J.jsx)(v,{flexShrink:0,paddingLeft:2,children:(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsx)(h,{children:Ot})})}),(0,J.jsx)(v,{flexShrink:0,children:(0,J.jsx)(p,{children:` `})}),F.status===`searching`&&(0,J.jsxs)(v,{paddingLeft:1,flexShrink:0,children:[(0,J.jsx)(ye,{}),(0,J.jsx)(p,{children:` Searching…`})]}),F.status===`results`&&F.results.length>0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Claude found these results:`})}),F.status===`results`&&F.results.length===0&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),F.status===`error`&&ht.length===0&&(0,J.jsx)(v,{paddingLeft:1,marginBottom:1,flexShrink:0,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`No matching sessions found.`})}),!!z.trim()&&x&&de&&F.status!==`searching`&&F.status!==`results`&&F.status!==`error`&&(0,J.jsxs)(v,{flexShrink:0,flexDirection:`column`,children:[(0,J.jsxs)(v,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(p,{color:I?`suggestion`:void 0,children:I?r.pointer:` `}),(0,J.jsx)(p,{color:I?`suggestion`:void 0,bold:I,children:`Search deeply using Claude →`})]}),(0,J.jsx)(v,{height:1})]}),F.status===`searching`?null:N===`rename`&&$?(0,J.jsxs)(v,{paddingLeft:2,flexDirection:`column`,children:[(0,J.jsx)(p,{bold:!0,children:`Rename session:`}),(0,J.jsx)(v,{paddingTop:1,children:(0,J.jsx)(De,{value:ve,onChange:xe,onSubmit:xt,placeholder:ue($,`Enter new session name`),columns:ae,cursorOffset:we,onChangeCursorOffset:Oe,showCursor:!0})})]}):C?(0,J.jsx)(nt,{nodes:Q,onSelect:e=>{o(e.value.log)},onFocus:Dt,onCancel:i,focusNodeId:je?.id,visibleOptionCount:At,layout:`expanded`,isDisabled:N===`search`||I,hideIndexes:!1,isNodeExpanded:e=>{if(N===`search`||O)return!0;let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;return t?ke.has(t):!1},onExpand:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&(Ae(e=>new Set(e).add(t)),T(`tengu_session_group_expanded`,{}))},onCollapse:e=>{let t=typeof e==`string`&&e.startsWith(`group:`)?e.substring(6):null;t&&Ae(e=>{let n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Ct}):(0,J.jsx)(Ee,{options:yt,onChange:e=>{let t=X[parseInt(e,10)];t&&o(t)},visibleOptionCount:At,onCancel:i,onFocus:Et,defaultFocusValue:je?.id.toString(),layout:`expanded`,isDisabled:N===`search`||I,onUpFromFirstItem:Ct}),(0,J.jsx)(v,{paddingLeft:2,children:S.pending?(0,J.jsxs)(p,{dimColor:!0,children:[`Press `,S.keyName,` again to exit`]}):N===`rename`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`save`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):F.status===`searching`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:`Searching with Claude…`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):I?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(m,{shortcut:`Enter`,action:`search`}),(0,J.jsx)(m,{shortcut:`↓`,action:`skip`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}):N===`search`?(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[(0,J.jsx)(p,{children:Xe&&w?`Searching…`:`Type to Search`}),(0,J.jsx)(m,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`clear`})]})}):(0,J.jsx)(p,{dimColor:!0,children:(0,J.jsxs)(h,{children:[b&&(0,J.jsx)(m,{shortcut:`Ctrl+A`,action:`show ${g?`current dir`:`all projects`}`}),D&&(0,J.jsx)(m,{shortcut:`Ctrl+B`,action:`toggle branch`}),A&&(0,J.jsx)(m,{shortcut:`Ctrl+W`,action:`show ${k?`current worktree`:`all worktrees`}`}),(0,J.jsx)(m,{shortcut:`Ctrl+V`,action:`preview`}),(0,J.jsx)(m,{shortcut:`Ctrl+R`,action:`rename`}),(0,J.jsx)(p,{children:`Type to search`}),(0,J.jsx)(j,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`}),bt()&&(0,J.jsx)(p,{children:bt()})]})})})]})}function dt(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function ft(e){let t=(e.messages.length<=X?e.messages:[...e.messages.slice(0,Z),...e.messages.slice(-Z)]).map(dt).filter(Boolean).join(` `),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(` `)} ${t}`.trim();return n.length>Q?n.slice(0,Q):n}function pt(e){let t=new Map;for(let n of e){let e=M(n);if(e){let r=t.get(e);r?r.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}function mt(e){let t=new Set;for(let n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}var q,J,ht,Y,X,Z,Q,gt,_t,vt,yt=e((()=>{s(),n(),Ue(),q=t(l(),1),x(),Le(),Ve(),ke(),g(),Ie(),se(),k(),Pe(),le(),E(),ge(),je(),A(),Ae(),ze(),z(),ve(),tt(),Oe(),it(),J=b(),ht=2,Y=4,X=2e3,Z=1e3,Q=5e4,gt=.3,_t=60*1e3,vt=50}));function $(e){if(e.type!==`user`&&e.type!==`assistant`)return``;let t=`message`in e?e.message?.content:void 0;return t?typeof t==`string`?t:Array.isArray(t)?t.map(e=>typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(` `):``:``}function bt(e){if(e.length===0)return``;let t=(e.length<=wt?e:[...e.slice(0,wt/2),...e.slice(-wt/2)]).map($).filter(Boolean).join(` `).replace(/\s+/g,` `).trim();return t.length>Ct?t.slice(0,Ct)+`…`:t}function xt(e,t){return!!(ue(e).toLowerCase().includes(t)||e.customTitle?.toLowerCase().includes(t)||e.tag?.toLowerCase().includes(t)||e.gitBranch?.toLowerCase().includes(t)||e.summary?.toLowerCase().includes(t)||e.firstPrompt?.toLowerCase().includes(t)||e.messages&&e.messages.length>0&&bt(e.messages).toLowerCase().includes(t))}async function St(e,t,n){if(!e.trim()||t.length===0)return[];let r=e.toLowerCase(),i=t.filter(e=>xt(e,r)),a;if(i.length>=Tt)a=i.slice(0,Tt);else{let e=t.filter(e=>!xt(e,r)),n=Tt-i.length;a=[...i,...e.slice(0,n)]}w(`Agentic search: ${a.length}/${t.length} logs, query="${e}", matching: ${i.length}, with messages: ${D(a,e=>e.messages?.length>0)}`);let o=a.map(async e=>{if(Fe(e))try{return await _e(e)}catch(t){return de(t),e}return e}),s=await Promise.all(o);w(`Agentic search: loaded ${D(s,e=>e.messages?.length>0)}/${a.length} logs with transcripts`);let c=`Sessions:
|
|
2
|
-
${s.map((e,t)=>{let n=[`${t}:`],r=ue(e);if(n.push(r),e.customTitle&&e.customTitle!==r&&n.push(`[custom title: ${e.customTitle}]`),e.tag&&n.push(`[tag: ${e.tag}]`),e.gitBranch&&n.push(`[branch: ${e.gitBranch}]`),e.summary&&n.push(`- Summary: ${e.summary}`),e.firstPrompt&&e.firstPrompt!==`No prompt`&&n.push(`- First message: ${e.firstPrompt.slice(0,300)}`),e.messages&&e.messages.length>0){let t=bt(e.messages);t&&n.push(`- Transcript: ${t}`)}return n.join(` `)}).join(`
|
|
3
|
-
`)}
|
|
4
|
-
|
|
5
|
-
Search query: "${e}"
|
|
6
|
-
|
|
7
|
-
Find the sessions that are most relevant to this query.`;w(`Agentic search prompt (first 500 chars): ${c.slice(0,500)}...`);try{let e=ie();w(`Agentic search using model: ${e}`);let t=(await Ne({model:e,system:Et,messages:[{role:`user`,content:c}],signal:n,querySource:`session_search`})).content.find(e=>e.type===`text`);if(!t||t.type!==`text`)return w(`No text content in agentic search response`),[];w(`Agentic search response: ${t.text}`);let r=t.text.match(/\{[\s\S]*\}/);if(!r)return w(`Could not find JSON in agentic search response`),[];let i=(S(r[0]).relevant_indices||[]).filter(e=>e>=0&&e<s.length).map(e=>s[e]);return w(`Agentic search found ${i.length} relevant sessions`),i}catch(e){return de(e),w(`Agentic search error: ${e}`),[]}}var Ct,wt,Tt,Et,Dt=e((()=>{fe(),C(),E(),ae(),ge(),xe(),oe(),Ct=2e3,wt=100,Tt=100,Et=`Your goal is to find relevant sessions based on a user's search query.
|
|
8
|
-
|
|
9
|
-
You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
|
|
10
|
-
|
|
11
|
-
Each session may include:
|
|
12
|
-
- Title (display name or custom title)
|
|
13
|
-
- Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
|
|
14
|
-
- Branch (git branch name, shown as [branch: name])
|
|
15
|
-
- Summary (AI-generated summary)
|
|
16
|
-
- First message (beginning of the conversation)
|
|
17
|
-
- Transcript (excerpt of conversation content)
|
|
18
|
-
|
|
19
|
-
IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
|
|
20
|
-
|
|
21
|
-
For each session, consider (in order of priority):
|
|
22
|
-
1. Exact tag matches (highest priority - user explicitly categorized this session)
|
|
23
|
-
2. Partial tag matches or tag-related terms
|
|
24
|
-
3. Title matches (custom titles or first message content)
|
|
25
|
-
4. Branch name matches
|
|
26
|
-
5. Summary and transcript content matches
|
|
27
|
-
6. Semantic similarity and related concepts
|
|
28
|
-
|
|
29
|
-
CRITICAL: Be VERY inclusive in your matching. Include sessions that:
|
|
30
|
-
- Contain the query term anywhere in any field
|
|
31
|
-
- Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
|
|
32
|
-
- Discuss topics that could be related to the query
|
|
33
|
-
- Have transcripts that mention the concept even in passing
|
|
34
|
-
|
|
35
|
-
When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
|
|
36
|
-
|
|
37
|
-
Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
|
|
38
|
-
|
|
39
|
-
Respond with ONLY the JSON object, no markdown formatting:
|
|
40
|
-
{"relevant_indices": [2, 5, 0]}`}));function Ot(e,t,n){let r=re();if(!t||!e.projectPath||e.projectPath===r)return{isCrossProject:!1};if(process.env.USER_TYPE!==`ant`){let t=M(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${N([e.projectPath])} && claude --resume ${t}`,projectPath:e.projectPath}}if(n.some(t=>e.projectPath===t||e.projectPath.startsWith(t+I)))return{isCrossProject:!0,isSameRepoWorktree:!0,projectPath:e.projectPath};let i=M(e);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${N([e.projectPath])} && claude --resume ${i}`,projectPath:e.projectPath}}var kt=e((()=>{x(),P(),ge()}));export{ut as a,Dt as i,kt as n,yt as o,St as r,Ot as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,r){let i=r?r.trim().split(/\s+/):[],a=i[0]||`status`;return a===`attach`?(e("Use `claude daemon attach` from the CLI. Attach is not available inside the REPL.",{display:`system`}),null):(e((await n(async()=>{if(a===`bg`)await(await import(`./bg-FtpmvQuT.js`)).handleBgStart(i.slice(1));else{let{daemonMain:e}=await import(`./main-BafHJuKH.js`);await e([a,...i.slice(1)])}})).join(`
|
|
2
|
-
`)||`Done.`,{display:`system`}),null)}async function n(e){let t=[],n=console.log,r=console.error;console.log=(...e)=>t.push(e.map(String).join(` `)),console.error=(...e)=>t.push(e.map(String).join(` `));try{await e()}finally{console.log=n,console.error=r}return t}e((()=>{}))();export{t as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./datadog-DPkKCR8M.js";t();export{e as shutdownDatadog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{n as r,t as i}from"./axios-DhfaybwJ.js";import{Ac as a,Ec as o,Fa as s,G as c,J as l,Na as u,Pr as d,br as f,ci as p,ct as m,lt as h,ri as g}from"./paths-DfGsIjPm.js";import{o as _,s as v}from"./log-DS97_rIr.js";import{createHash as y}from"crypto";function b(e){return e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}async function x(){if(N.length===0)return;let e=N;N=[];try{await r.post(E,e,{headers:{"Content-Type":`application/json`,"DD-API-KEY":D},timeout:A})}catch(e){v(e)}}function S(){P||(P=setTimeout(()=>{P=null,x()},T()).unref())}async function C(){P&&(clearTimeout(P),P=null),await x()}async function w(e,t){if(u()!==`firstParty`)return;let n=F;if(n===null&&(n=await I()),!(!n||!j.has(e)))try{let{envContext:n,...r}=await c({model:t.model,betas:t.betas}),i={...r,...n,...t,userBucket:R()};if(typeof i.toolName==`string`&&i.toolName.startsWith(`mcp__`)&&(i.toolName=`mcp`),process.env.USER_TYPE!==`ant`&&typeof i.model==`string`){let e=f(i.model.replace(/\[1m]$/i,``));i.model=e in g?e:`other`}if(typeof i.version==`string`&&(i.version=i.version.replace(/^(\d+\.\d+\.\d+-dev\.\d{8})\.t\d+\.sha[a-f0-9]+$/,`$1`)),i.status!==void 0&&i.status!==null){let e=String(i.status);i.http_status=e;let t=e.charAt(0);t>=`1`&&t<=`5`&&(i.http_status_range=`${t}xx`),delete i.status}let a=i,o={ddsource:`nodejs`,ddtags:[`event:${e}`,...M.filter(e=>a[e]!==void 0&&a[e]!==null).map(e=>`${b(e)}:${a[e]}`)].join(`,`),message:e,service:`claude-code`,hostname:`claude-code`,env:process.env.USER_TYPE};for(let[e,t]of Object.entries(i))t!=null&&(o[b(e)]=t);N.push(o),N.length>=k?(P&&(clearTimeout(P),P=null),x()):S()}catch(e){v(e)}}function T(){return parseInt(process.env.CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS||``,10)||O}var E,D,O,k,A,j,M,N,P,F,I,L,R,z=e((()=>{i(),n(),a(),_(),d(),s(),p(),m(),l(),E=process.env.DATADOG_LOGS_ENDPOINT??``,D=process.env.DATADOG_API_KEY??``,O=15e3,k=100,A=5e3,j=new Set(`chrome_bridge_connection_succeeded.chrome_bridge_connection_failed.chrome_bridge_disconnected.chrome_bridge_tool_call_completed.chrome_bridge_tool_call_error.chrome_bridge_tool_call_started.chrome_bridge_tool_call_timeout.tengu_api_error.tengu_api_success.tengu_brief_mode_enabled.tengu_brief_mode_toggled.tengu_brief_send.tengu_cancel.tengu_compact_failed.tengu_exit.tengu_flicker.tengu_init.tengu_model_fallback_triggered.tengu_oauth_error.tengu_oauth_success.tengu_oauth_token_refresh_failure.tengu_oauth_token_refresh_success.tengu_oauth_token_refresh_lock_acquiring.tengu_oauth_token_refresh_lock_acquired.tengu_oauth_token_refresh_starting.tengu_oauth_token_refresh_completed.tengu_oauth_token_refresh_lock_releasing.tengu_oauth_token_refresh_lock_released.tengu_query_error.tengu_session_file_read.tengu_started.tengu_tool_use_error.tengu_tool_use_granted_in_prompt_permanent.tengu_tool_use_granted_in_prompt_temporary.tengu_tool_use_rejected_in_prompt.tengu_tool_use_success.tengu_uncaught_exception.tengu_unhandled_rejection.tengu_voice_recording_started.tengu_voice_toggled.tengu_team_mem_sync_pull.tengu_team_mem_sync_push.tengu_team_mem_sync_started.tengu_team_mem_entries_capped`.split(`.`)),M=[`arch`,`clientType`,`errorType`,`http_status_range`,`http_status`,`kairosActive`,`model`,`platform`,`provider`,`skillMode`,`subscriptionType`,`toolName`,`userBucket`,`userType`,`version`,`versionBase`],N=[],P=null,F=null,I=t(async()=>{if(h()||!E||!D)return F=!1,!1;try{return F=!0,!0}catch(e){return v(e),F=!1,!1}}),L=30,R=t(()=>{let e=o(),t=y(`sha256`).update(e).digest(`hex`);return parseInt(t.slice(0,8),16)%L})}));export{w as i,I as n,C as r,z as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{n as r,t as i}from"./DesktopHandoff-Cy89ZB_9.js";async function a(e){return(0,o.jsx)(i,{onDone:e})}var o;e((()=>{t(),r(),o=n()}))();export{a as call};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-80gRi2ZW.js";import{i as r,o as i,t as a}from"./cliLaunch-8aeIk2ts.js";import{dirname as o}from"path";import{closeSync as s,createReadStream as c,mkdirSync as l,openSync as u,readSync as d,statSync as f,unwatchFile as p,watchFile as m}from"fs";import{createInterface as h}from"readline";async function g(e){let t=0;try{if(t=f(e).size,t>0){let n=h({input:c(e,{start:0,end:t-1})});for await(let e of n)process.stdout.write(e+`
|
|
2
|
-
`)}}catch{}return console.log(`
|
|
3
|
-
[tail] Watching for new output... (Ctrl+C to detach)
|
|
4
|
-
`),new Promise(n=>{let r=()=>{p(e),process.removeListener(`SIGINT`,r),console.log(`
|
|
5
|
-
[tail] Detached from session.`),n()};process.on(`SIGINT`,r),m(e,{interval:300},()=>{try{let n=f(e);if(n.size<=t)return;let r=u(e,`r`);try{let e=Buffer.alloc(n.size-t);d(r,e,0,e.length,t),process.stdout.write(e),t=n.size}finally{s(r)}}catch{}})})}var _=e((()=>{})),v;e((()=>{r(),_(),t(),v=class{constructor(){n(this,`name`,`detached`),n(this,`supportsInteractiveInput`,!1)}async available(){return!0}async start(e){l(o(e.logPath),{recursive:!0});let t=u(e.logPath,`a`),n=i(a(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath}}),{detached:!0,stdio:[`ignore`,t,t],cwd:e.cwd});return n.unref(),s(t),{pid:n.pid??0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`detached`}}async attach(e){if(!e.logPath)throw Error(`Session ${e.sessionId} has no log path.`);await g(e.logPath)}}}))();export{v as DetachedEngine};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,p as n}from"./debug-otxXY3j-.js";import{n as r,t as i}from"./cwd--iizewsn.js";import{m as a,v as o}from"./git-DayFjsvj.js";function s(){m.clear()}async function c(){let e=await l();return!e||e.host!==`github.com`?null:`${e.owner}/${e.name}`}async function l(){let e=i();if(m.has(e))return m.get(e)??null;try{let t=await a();if(n(`Git remote URL: ${t}`),!t)return n(`No git remote URL found`),m.set(e,null),null;let r=d(t);return n(`Parsed repository: ${r?`${r.host}/${r.owner}/${r.name}`:null} from URL: ${t}`),m.set(e,r),r}catch(t){return n(`Error detecting repository: ${t}`),m.set(e,null),null}}function u(){let e=m.get(i());return!e||e.host!==`github.com`?null:`${e.owner}/${e.name}`}function d(e){let t=e.trim(),n=t.match(/^git@([^:]+):([^/]+)\/([^/]+?)(?:\.git)?$/);if(n?.[1]&&n[2]&&n[3])return p(n[1])?{host:n[1],owner:n[2],name:n[3]}:null;let r=t.match(/^(https?|ssh|git):\/\/(?:[^@]+@)?([^/:]+(?::\d+)?)\/([^/]+)\/([^/]+?)(?:\.git)?$/);if(r?.[1]&&r[2]&&r[3]&&r[4]){let e=r[1],t=r[2],n=t.split(`:`)[0]??``;return p(n)?{host:e===`https`||e===`http`?t:n,owner:r[3],name:r[4]}:null}return null}function f(e){let t=e.trim(),r=d(t);if(r)return r.host===`github.com`?`${r.owner}/${r.name}`:null;if(!t.includes(`://`)&&!t.includes(`@`)&&t.includes(`/`)){let e=t.split(`/`);if(e.length===2&&e[0]&&e[1]){let t=e[1].replace(/\.git$/,``);return`${e[0]}/${t}`}}return n(`Could not parse repository from: ${t}`),null}function p(e){if(!e.includes(`.`))return!1;let t=e.split(`.`).pop();return t?/^[a-zA-Z]+$/.test(t):!1}var m,h=e((()=>{r(),t(),o(),m=new Map}));export{h as a,u as i,c as n,f as o,l as r,d as s,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t,s as n}from"./detectRepository-CSN3yxkq.js";e();export{t as parseGitHubRepository,n as parseGitRemote};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{a as t,n}from"./env-BH-OBzcA.js";import{r,t as i}from"./execFileNoThrow-B_aZH_GP.js";import{c as a,o}from"./constants-41VpZw2G.js";function s(){return!!g}async function c(){return v===null&&(v=!!g),v}function l(){return _||null}async function u(){return(await i(o,[`-V`])).code===0}async function d(){return process.env.WT_SESSION?!0:(await i(`where.exe`,[`wt.exe`])).code===0}function f(){if(y!==null)return y;let e=process.env.TERM_PROGRAM,t=!!process.env.ITERM_SESSION_ID,r=n.terminal===`iTerm.app`;return y=e===`iTerm.app`||t||r,y}function p(){return b===null&&(b=!!process.env.WT_SESSION),b}async function m(){return(await i(`it2`,[`session`,`list`])).code===0}function h(){v=null,y=null,b=null}var g,_,v,y,b,x,S=e((()=>{t(),r(),a(),g=process.env.TMUX,_=process.env.TMUX_PANE,v=null,y=null,b=null,x=`it2`}));export{p as a,m as c,h as d,f as i,u as l,l as n,c as o,S as r,s,x as t,d as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,i as r,l as i,n as a,o,r as s,s as c,t as l,u}from"./detection-BPPZCanO.js";s();export{l as IT2_COMMAND,a as getLeaderPaneId,r as isInITerm2,e as isInWindowsTerminal,o as isInsideTmux,c as isInsideTmuxSync,t as isIt2CliAvailable,i as isTmuxAvailable,u as isWindowsTerminalAvailable,n as resetDetectionCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";var n,r;e((()=>{n=t(),r=async(e,t)=>{let{DiffDialog:r}=await import(`./DiffDialog-BhqgxA7o.js`);return(0,n.jsx)(r,{messages:t.messages,onDone:e})}}))();export{r as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{_ as t,h as n}from"./debug-otxXY3j-.js";import{n as r,t as i}from"./cwd--iizewsn.js";import{o as a,s as o}from"./log-DS97_rIr.js";import{n as s,t as c}from"./index.min-BJnb9GQI.js";import{i as l,n as u}from"./path-nCzt96pE.js";import{basename as d,dirname as f,join as p,sep as m}from"path";function h(e,t){if(!e)return{directory:t||i(),prefix:``};let n=u(e,t);return e.endsWith(`/`)||e.endsWith(m)?{directory:n,prefix:``}:{directory:f(n),prefix:d(e)}}async function g(e){let t=C.get(e);if(t)return t;try{let t=(await n().readdir(e)).filter(e=>e.isDirectory()&&!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:`directory`})).slice(0,100);return C.set(e,t),t}catch(e){return o(e),[]}}async function _(e,t={}){let{basePath:n=i(),maxResults:r=10}=t,{directory:a,prefix:o}=h(e,n),s=await g(a),c=o.toLowerCase();return s.filter(e=>e.name.toLowerCase().startsWith(c)).slice(0,r).map(e=>({id:e.path,displayText:e.name+`/`,description:`directory`,metadata:{type:`directory`}}))}function v(e){return e.startsWith(`~/`)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`)||e===`~`||e===`.`||e===`..`}async function y(e,t=!1){let r=`${e}:${t}`,i=w.get(r);if(i)return i;try{let i=(await n().readdir(e)).filter(e=>t||!e.name.startsWith(`.`)).map(t=>({name:t.name,path:p(e,t.name),type:t.isDirectory()?`directory`:`file`})).sort((e,t)=>e.type===`directory`&&t.type!==`directory`?-1:e.type!==`directory`&&t.type===`directory`?1:e.name.localeCompare(t.name)).slice(0,100);return w.set(r,i),i}catch(e){return o(e),[]}}async function b(e,t={}){let{basePath:n=i(),maxResults:r=10,includeFiles:a=!0,includeHidden:o=!1}=t,{directory:s,prefix:c}=h(e,n),l=await y(s,o),u=c.toLowerCase(),d=l.filter(e=>!a&&e.type===`file`?!1:e.name.toLowerCase().startsWith(u)).slice(0,r),f=e.includes(`/`)||e.includes(m),p=``;if(f){let t=e.lastIndexOf(`/`),n=e.lastIndexOf(m),r=Math.max(t,n);p=e.substring(0,r+1)}return(p.startsWith(`./`)||p.startsWith(`.`+m))&&(p=p.slice(2)),d.map(e=>{let t=p+e.name;return{id:t,displayText:e.type===`directory`?t+`/`:t,metadata:{type:e.type}}})}var x,S,C,w,T=e((()=>{s(),r(),t(),a(),l(),x=500,S=300*1e3,C=new c({max:x,ttl:S}),w=new c({max:x,ttl:S})}));export{v as i,b as n,T as r,_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Doctor-Ts5k8hn1.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as e,s as t}from"./intl-Pse97ORk.js";t();var n=``,r=!1,i=null,a=null;function o(){if(!(!process.stdin.isTTY||r||process.argv.includes(`-p`)||process.argv.includes(`--print`))){r=!0,n=``;try{process.stdin.setEncoding(`utf8`),process.stdin.setRawMode(!0),process.stdin.ref(),i=()=>{let e=process.stdin.read();for(;e!==null;)typeof e==`string`&&s(e),e=process.stdin.read()},process.stdin.on(`readable`,i),a=setTimeout(()=>{r&&c()},1e4),a&&typeof a==`object`&&`unref`in a&&a.unref()}catch{r=!1}}}function s(t){let r=0;for(;r<t.length;){let i=t[r],a=i.charCodeAt(0);if(a===3){c(),process.exit(130);return}if(a===4){c();return}if(a===127||a===8){if(n.length>0){let t=e(n);n=n.slice(0,-(t.length||1))}r++;continue}if(a===27){if(r++,r>=t.length)continue;let e=t.charCodeAt(r);if(e===91){for(r++;r<t.length&&t.charCodeAt(r)>=32&&t.charCodeAt(r)<=63;)r++;r<t.length&&t.charCodeAt(r)>=64&&t.charCodeAt(r)<=126&&r++;continue}if(e===80||e===93||e===88||e===94){for(r++;r<t.length;){if(t.charCodeAt(r)===7){r++;break}if(t.charCodeAt(r)===27&&r+1<t.length&&t.charCodeAt(r+1)===92){r+=2;break}r++}continue}r<t.length&&r++;continue}if(a<32&&a!==9&&a!==10&&a!==13){r++;continue}if(a===13){n+=`
|
|
2
|
-
`,r++;continue}n+=i,r++}}function c(){if(r){r=!1,a&&(clearTimeout(a),a=null),i&&(process.stdin.removeListener(`readable`,i),i=null);try{process.stdin.unref()}catch{}}}function l(){c();let e=n.trim();return n=``,e}function u(e){n=e}export{c as i,u as n,o as r,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./earlyInput-BFcdUMaX.js";export{e as startCapturingEarlyInput};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{B as n,F as r,Rn as i,Vt as a,b as o,nt as s,t as c,x as l}from"./src-Di342QoJ.js";import{t as u}from"./jsx-runtime-D-D469L8.js";import{lo as d,oo as f}from"./paths-DfGsIjPm.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{Aj as h,Cj as g,Ej as _,Lj as v,fC as y,kj as b,lC as x,uC as S,wj as C}from"./loadAgentsDir-Br5fGLLI.js";import{t as w}from"./useKeybinding-FsOnjW6T.js";import{n as T,t as E}from"./useMainLoopModel-CaQLIr1V.js";function D(e){return typeof e==`string`&&e!==`ultracode`&&A.includes(e)}function O(e){if(e!=null&&typeof e!=`number`&&D(e))return e}function ee(e){let t=A.indexOf(e);return t<=0?A[0]:A[t-1]}function te(e){let t=A.indexOf(e);return t===-1||t>=A.length-1?A[A.length-1]:A[t+1]}function k(e){return e===`ultracode`}function ne(e){let t=O(e.envOverride);return t===void 0?e.displayed:t}function re(e,t){if(k(e))return{kind:`ultracode-hint`,message:j};let n=t(e);return{kind:`apply`,message:n.message,effortUpdate:n.effortUpdate}}var A,j,M,ie=e((()=>{A=[`low`,`medium`,`high`,`xhigh`,`max`,`ultracode`],j=`ultracode is not an effort level. Use /ultracode <context> to start a multi-agent workflow.`,M=`Effort unchanged.`}));function ae(e){let[t,r]=n(e?N:null);return[t,e?r:0]}var N,oe=e((()=>{c(),N=60}));function se(e){if(!/^#[0-9a-fA-F]{6}$/.test(e))return{h:0,s:0,l:0};let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return{h:0,s:0,l:o};let c=s/(1-Math.abs(2*o-1)),l;return l=i===t?60*((n-r)/s%6):i===n?60*((r-t)/s+2):60*((t-n)/s+4),l<0&&(l+=360),{h:l,s:c,l:o}}function ce(e,t,n){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=r/60,o=i*(1-Math.abs(a%2-1)),s=0,c=0,l=0;a<1?(s=i,c=o):a<2?(s=o,c=i):a<3?(c=i,l=o):a<4?(c=o,l=i):a<5?(s=o,l=i):(s=i,l=o);let u=n-i/2,d=e=>Math.round((e+u)*255).toString(16).padStart(2,`0`);return`#${d(s)}${d(c)}${d(l)}`}function P(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e)||t===0)return e;let{h:n,s:r,l:i}=se(e);return ce(n+t,r,i)}function F(e){return e*L%360}function le(e,t=0){let n=e<0?0:e>1?1:e,r=I[Math.min(I.length-1,Math.floor(n*I.length))];return t===0?r:P(r,t)}function ue(e){let{y:t,width:n,time:r,sourceX:i,sourceY:a}=e;if(n<=0)return[];let o=F(r),s=Array(n);for(let e=0;e<n;e++){let n=e-i,c=(t-a)*1.5,l=Math.sqrt(n*n+c*c),u=l*.35-r*.004;s[e]={char:z,color:le((Math.sin(u)+1)/2*Math.max(0,1-l/90),o)}}return s}function de(e,t){let n=e.map(e=>({...e}));for(let e of t){let t=e.x;if(!(t>=n.length))for(let r=0;r<e.text.length;r++){let i=t+r;if(!(i<0)){if(i>=n.length)break;n[i]={char:e.text[r],color:e.color??n[i].color}}}}return n}function fe(e){if(e.length===0)return[];let t=[],n={text:e[0].char,color:e[0].color};for(let r=1;r<e.length;r++){let i=e[r];i.color===n.color?n.text+=i.char:(t.push(n),n={text:i.char,color:i.color})}return t.push(n),t}function pe(e,t){if(e===`transparent`)return R;let n=t<0?0:t>1?1:t;if(n<=.01)return R;if(!/^#[0-9a-fA-F]{6}$/.test(e))return e;let r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return`#${Math.round(r*n).toString(16).padStart(2,`0`)}${Math.round(i*n).toString(16).padStart(2,`0`)}${Math.round(a*n).toString(16).padStart(2,`0`)}`}function me(e,t){return e.map(e=>({char:e.char,color:pe(e.color,t)}))}var I,L,R,z,he=e((()=>{I=[`#1a1f3a`,`#1f2543`,`#252c55`,`#2e3870`,`#3a4582`,`#4a5bb0`,`#5769F7`],L=.03,R=`transparent`,z=` `}));function ge(e){let t=e-2;return t<=W*A.length?W:Math.floor(t/A.length)}function _e(e){let t=Math.max(0,Math.floor((e-9)/2));return e*(A.length-1)+t+4}function B(e,t,n){return n*e+Math.max(0,Math.floor((n-t)/2))}function ve({appStateEffort:e,onDone:t}){let n=y(),i=T(),{columns:a}=r(),c=H.useMemo(()=>ge(a),[a]),u=c*A.length,d=H.useMemo(()=>_e(c),[c]),f=C(),p=ne({envOverride:f,appStateEffort:e,displayed:g(i,e)}),[m,h]=H.useState(p),[_,v]=H.useState(!1),b=m===`ultracode`,[x,S]=H.useState(0),w=b||x>.001,[E,D]=ae(w);H.useEffect(()=>{if(!w)return;let e=+!!b;S(t=>{if(t===e)return t;let n=e>t?t+Y:t-Y;return e>t?Math.min(e,n):Math.max(e,n)})},[D,b,w]),s({"effortPanel:decrease":()=>h(e=>ee(e)),"effortPanel:increase":()=>h(e=>te(e)),"effortPanel:home":()=>h(`low`),"effortPanel:end":()=>h(`ultracode`),"effortPanel:confirm":H.useCallback(()=>{if(_)return;v(!0);let e=re(m,Q);e.kind===`apply`&&e.effortUpdate&&n(t=>({...t,effortValue:e.effortUpdate.value})),t(e.message)},[m,_,t,n]),"effortPanel:cancel":H.useCallback(()=>{_||(v(!0),t(M))},[_,t])},{context:`EffortPanel`});let O=f!=null,k=process.env.CLAUDE_CODE_EFFORT_LEVEL,j=H.useCallback((e,t)=>fe(me(de(ue({y:e+X,width:u,time:D,sourceX:d,sourceY:X}),t),x)),[D,x,u,d]);return(0,U.jsxs)(l,{ref:E,flexDirection:`column`,paddingX:1,width:u+2,children:[(0,U.jsx)(o,{bold:!0,color:`suggestion`,children:`Effort`}),O&&(0,U.jsx)(o,{color:`warning`,children:`⚠ CLAUDE_CODE_EFFORT_LEVEL=${k} overrides this session`}),w?(0,U.jsx)(be,{renderRow:j,cursor:m,fade:x,segment:c,panelWidth:u,time:D}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ye,{cursor:m,segment:c,panelWidth:u}),(0,U.jsx)(l,{marginTop:1,children:(0,U.jsx)(o,{color:`subtle`,children:`←/→ adjust · Enter confirm · Esc cancel`})})]})]})}function ye({cursor:e,segment:t,panelWidth:n}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(l,{marginTop:1,flexDirection:`row`,justifyContent:`space-between`,children:[(0,U.jsx)(o,{color:`suggestion`,children:`Faster`}),(0,U.jsx)(o,{color:`suggestion`,children:`Smarter`})]}),(0,U.jsx)(o,{color:`subtle`,children:`─`.repeat(n)}),(0,U.jsx)(l,{flexDirection:`row`,children:A.map(n=>(0,U.jsx)(l,{width:t,justifyContent:`center`,children:(0,U.jsx)(o,{bold:!0,color:e===n?`suggestion`:`subtle`,children:e===n?`▲`:` `})},`cursor-${n}`))}),(0,U.jsx)(l,{flexDirection:`row`,children:A.map(n=>(0,U.jsx)(l,{width:t,justifyContent:`center`,children:(0,U.jsx)(o,{bold:e===n,color:e===n?`suggestion`:`subtle`,children:n})},`label-${n}`))}),(0,U.jsxs)(l,{flexDirection:`row`,children:[(0,U.jsx)(l,{width:t*(A.length-1)}),(0,U.jsx)(l,{width:t,justifyContent:`center`,children:(0,U.jsx)(o,{color:`subtle`,children:G})})]})]})}function be({renderRow:e,cursor:t,segment:n,panelWidth:r,time:i}){let a=A.indexOf(t),s=A.length-1,c=F(i),l=P(J,c),u=P(K,c),d=P(q,c),f={text:`Faster`,x:0,color:l},p={text:`Smarter`,x:r-7,color:l},m={text:`─`.repeat(r),x:0,color:d},h={text:`▲`,x:B(a,1,n),color:l},g=A.map((e,r)=>({text:e,x:B(r,e.length,n),color:e===t?u:d})),_={text:G,x:B(s,17,n),color:d};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(V,{segments:e(-4,[])}),(0,U.jsx)(V,{segments:e(-3,[f,p])}),(0,U.jsx)(V,{segments:e(-2,[m])}),(0,U.jsx)(V,{segments:e(-1,[h])}),(0,U.jsx)(V,{segments:e(0,g)}),(0,U.jsx)(V,{segments:e(1,[_])}),(0,U.jsx)(V,{segments:e(2,[])}),(0,U.jsx)(o,{color:q,children:`←/→ adjust · Enter confirm · Esc cancel`})]})}function V({segments:e}){let t=[];for(let n of e){let e=``,r=null,i=()=>{e===``||r===null||(t.push({text:e,kind:r?`space`:`text`,color:n.color}),e=``,r=null)};for(let t of n.text){let n=t===` `;r===null?(e=t,r=n):n===r?e+=t:(i(),e=t,r=n)}i()}return(0,U.jsx)(l,{flexDirection:`row`,children:t.map((e,t)=>e.kind===`space`?e.color===`transparent`?(0,U.jsx)(a,{children:e.text},t):(0,U.jsx)(a,{backgroundColor:e.color,children:e.text},t):(0,U.jsx)(o,{color:e.color,bold:!0,children:e.text},t))})}var H,U,W,G,K,q,J,Y,X,xe=e((()=>{H=t(i(),1),c(),w(),b(),ie(),Ae(),E(),x(),oe(),he(),U=u(),W=12,G=`xhigh + workflows`,K=`#5769F7`,q=`#7a8eff`,J=`#5769F7`,Y=.2,X=0}));function Se(e){let t=v(e);if(t!==void 0){let e=d(`userSettings`,{effortLevel:t});if(e.error)return{message:`Failed to set effort level: ${e.error.message}`}}m(`tengu_effort_command`,{effort:e});let n=C();if(n!==void 0&&n!==e){let n=process.env.CLAUDE_CODE_EFFORT_LEVEL;return t===void 0?{message:`Not applied: CLAUDE_CODE_EFFORT_LEVEL=${n} overrides effort this session, and ${e} is session-only (nothing saved)`,effortUpdate:{value:e}}:{message:`CLAUDE_CODE_EFFORT_LEVEL=${n} overrides this session — clear it and ${e} takes over`,effortUpdate:{value:e}}}let r=_(e);return{message:`Set effort level to ${e}${t===void 0?` (this session only)`:``}: ${r}`,effortUpdate:{value:e}}}function Z(e,t){let n=C(),r=n===null?void 0:n??e;return r===void 0?{message:`Effort level: auto (currently ${g(t,e)})`}:{message:`Current effort level: ${r} (${_(r)})`}}function Ce(){let e=d(`userSettings`,{effortLevel:void 0});return e.error?{message:`Failed to set effort level: ${e.error.message}`}:(m(`tengu_effort_command`,{effort:`auto`}),C()==null?{message:`Effort level set to auto`,effortUpdate:{value:void 0}}:{message:`Cleared effort from settings, but CLAUDE_CODE_EFFORT_LEVEL=${process.env.CLAUDE_CODE_EFFORT_LEVEL} still controls this session`,effortUpdate:{value:void 0}})}function Q(e){let t=e.toLowerCase();return t===`auto`||t===`unset`?Ce():h(t)?Se(t):{message:`Invalid argument: ${e}. Valid options are: low, medium, high, max, auto`}}function we({onDone:e}){let{message:t}=Z(S(e=>e.effortValue),T());return e(t),null}function Te({result:e,onDone:t}){let n=y(),{effortUpdate:r,message:i}=e;return Oe.useEffect(()=>{r&&n(e=>({...e,effortValue:r.value})),t(i)},[n,r,i,t]),null}async function Ee(e,t,n){if(n=n?.trim()||``,ke.includes(n)){e(`Usage: /effort [low|medium|high|xhigh|max|auto]
|
|
2
|
-
|
|
3
|
-
Effort levels:
|
|
4
|
-
- low: Quick, straightforward implementation
|
|
5
|
-
- medium: Balanced approach with standard testing
|
|
6
|
-
- high: Comprehensive implementation with extensive testing
|
|
7
|
-
- xhigh: Extended reasoning beyond high, short of max; including ChatGPT Codex models
|
|
8
|
-
- max: Maximum capability with deepest reasoning; maps to xhigh for ChatGPT Codex models
|
|
9
|
-
- auto: Use the default effort level for your model`);return}return!n||n===`current`||n===`status`?n===`current`||n===`status`?(0,$.jsx)(we,{onDone:e}):(0,$.jsx)(De,{onDone:e}):(0,$.jsx)(Te,{result:Q(n),onDone:e})}function De({onDone:e}){return(0,$.jsx)(ve,{appStateEffort:S(e=>e.effortValue),onDone:e})}var Oe,$,ke,Ae=e((()=>{Oe=t(i(),1),xe(),E(),p(),x(),b(),f(),$=u(),ke=[`help`,`-h`,`--help`]}));Ae();export{Ee as call,Q as executeEffort,Z as showCurrentEffort};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./classPrivateFieldSet2-EAQNhHs8.js";import{Cn as f,Ln as p,Mn as m,Tt as h,Xn as g,Yn as _,_r as ee,kt as v,nn as y,un as b,vt as te,wn as x}from"./schemas-BGAvj1T4.js";import{t as ne}from"./v4-f1i_CNUT.js";import{Tt as re,cn as ie,jr as S,lr as C}from"./state-sIHsFpDu.js";import{Ac as ae,Dr as oe,Pr as se,_c as ce,no as le,oo as ue}from"./paths-DfGsIjPm.js";import{l as de,p as fe}from"./sessionStoragePortable-DJZ_6cL8.js";import{$u as pe,Ep as me,Fr as he,G as ge,Hf as _e,K as ve,Qu as ye,Sr as be,Ta as xe,Tp as Se,Vf as Ce,Xv as we,Yv as Te,Zi as Ee,bD as De,i as Oe,na as ke,o as Ae,wa as je,xD as Me}from"./loadAgentsDir-Br5fGLLI.js";import{Qn as Ne,Zn as Pe}from"./prompt-B8M-HLIS.js";import{o as Fe,t as Ie}from"./fileStateCache-C7-TxF8G.js";import{t as Le}from"./QueryEngine-_re1pGHr.js";import*as w from"node:path";import{dirname as Re}from"node:path";import{randomUUID as ze}from"node:crypto";import{Readable as Be,Writable as Ve}from"node:stream";ne();var T={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},E={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},He=x({_meta:m(p(),g()).nullish(),terminal:v().optional().default(!1)}),Ue=x({_meta:m(p(),g()).nullish(),label:p().nullish(),name:p(),optional:v().optional().default(!1),secret:v().optional().default(!0)}),We=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),name:p()}),Ge=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:h(Ue)}),Ke=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),description:p().nullish(),env:m(p(),p()).optional(),id:p(),name:p()}),qe=_([Ge.and(x({type:b(`env_var`)})),Ke.and(x({type:b(`terminal`)})),We]),Je=x({_meta:m(p(),g()).nullish(),methodId:p()}),Ye=x({_meta:m(p(),g()).nullish()}),Xe=x({_meta:m(p(),g()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),Ze=x({default:v().nullish(),description:p().nullish(),title:p().nullish()}),Qe=x({_meta:m(p(),g()).nullish()}),$e=x({_meta:m(p(),g()).nullish()}),et=x({amount:f(),currency:p()}),tt=x({_meta:m(p(),g()).nullish(),terminalId:p()}),nt=x({_meta:m(p(),g()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),rt=_([p(),f(),f(),v(),h(p())]),it=y(_([x({content:m(p(),rt).nullish()}).and(x({action:b(`accept`)})),x({action:b(`decline`)}),x({action:b(`cancel`)})]),x({_meta:m(p(),g()).nullish()})),at=x({_meta:m(p(),g()).nullish()}),ot=p(),st=x({_meta:m(p(),g()).nullish(),elicitationId:ot}),ct=b(`object`),lt=b(`string`),ut=x({_meta:m(p(),g()).nullish()}),dt=x({_meta:m(p(),g()).nullish(),form:at.nullish(),url:ut.nullish()}),ft=x({const:p(),title:p()}),pt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),mt=x({code:_([b(-32700),b(-32600),b(-32601),b(-32602),b(-32603),b(-32800),b(-32e3),b(-32002),b(-32042),f().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:g().optional(),message:p()}),ht=g(),gt=g(),_t=g(),vt=x({_meta:m(p(),g()).nullish(),readTextFile:v().optional().default(!1),writeTextFile:v().optional().default(!1)}),yt=x({_meta:m(p(),g()).nullish(),name:p(),value:p()}),bt=x({_meta:m(p(),g()).nullish(),name:p(),title:p().nullish(),version:p()}),xt=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),St=x({_meta:m(p(),g()).nullish()}),Ct=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),wt=x({_meta:m(p(),g()).nullish()}),Tt=x({_meta:m(p(),g()).nullish(),logout:wt.nullish()}),Et=x({_meta:m(p(),g()).nullish()}),Dt=x({_meta:m(p(),g()).nullish()}),Ot=x({_meta:m(p(),g()).nullish(),http:v().optional().default(!1),sse:v().optional().default(!1)}),kt=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),At=x({_meta:m(p(),g()).nullish(),headers:h(yt),name:p(),url:p()}),jt=x({_meta:m(p(),g()).nullish(),args:h(p()),command:p(),env:h(pt),name:p()}),D=_([kt.and(x({type:b(`http`)})),At.and(x({type:b(`sse`)})),jt]),O=p(),Mt=x({_meta:m(p(),g()).nullish(),description:p().nullish(),modelId:O,name:p()}),Nt=_([b(`error`),b(`warning`),b(`information`),b(`hint`)]),Pt=x({_meta:m(p(),g()).nullish()}),Ft=x({_meta:m(p(),g()).nullish()}),It=x({_meta:m(p(),g()).nullish()}),Lt=x({_meta:m(p(),g()).nullish()}),Rt=x({_meta:m(p(),g()).nullish()}),zt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Bt=x({diff:p(),uri:p()}),Vt=x({endLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:p()}),Ht=x({_meta:m(p(),g()).nullish()}),Ut=x({_meta:m(p(),g()).nullish()}),Wt=x({languageId:p(),text:p(),uri:p()}),Gt=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Kt=_([b(`rejected`),b(`ignored`),b(`replaced`),b(`cancelled`)]),qt=x({excerpts:h(Vt),uri:p()}),Jt=x({_meta:m(p(),g()).nullish()}),Yt=x({_meta:m(p(),g()).nullish()}),Xt=x({name:p(),owner:p(),remoteUrl:p()}),Zt=x({_meta:m(p(),g()).nullish()}),Qt=x({_meta:m(p(),g()).nullish(),jump:Ht.nullish(),rename:Yt.nullish(),searchAndReplace:Zt.nullish()}),$t=x({id:p(),isRegex:v().nullish(),replace:p(),search:p(),uri:p()}),en=_([b(`automatic`),b(`diagnostic`),b(`manual`)]),tn=x({_meta:m(p(),g()).nullish(),maxCount:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),nn=x({_meta:m(p(),g()).nullish(),diagnostics:Pt.nullish(),editHistory:zt.nullish(),openFiles:Ut.nullish(),recentFiles:Gt.nullish(),relatedSnippets:Jt.nullish(),userActions:tn.nullish()}),rn=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D)}),an=x({default:f().nullish(),description:p().nullish(),maximum:f().nullish(),minimum:f().nullish(),title:p().nullish()}),on=p(),sn=_([b(`allow_once`),b(`allow_always`),b(`reject_once`),b(`reject_always`)]),cn=x({_meta:m(p(),g()).nullish(),kind:sn,name:p(),optionId:on}),ln=_([b(`high`),b(`medium`),b(`low`)]),un=_([b(`pending`),b(`in_progress`),b(`completed`)]),dn=x({_meta:m(p(),g()).nullish(),content:p(),priority:ln,status:un}),fn=x({_meta:m(p(),g()).nullish(),entries:h(dn)}),k=x({character:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),pn=x({id:p(),position:k,uri:p()}),mn=x({id:p(),newName:p(),position:k,uri:p()}),hn=x({action:p(),position:k,timestampMs:f(),uri:p()}),gn=_([b(`utf-16`),b(`utf-32`),b(`utf-8`)]),_n=x({_meta:m(p(),g()).nullish(),auth:He.optional().default({terminal:!1}),elicitation:dt.nullish(),fs:vt.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Qt.nullish(),positionEncodings:h(gn).optional(),terminal:v().optional().default(!1)}),vn=x({_meta:m(p(),g()).nullish(),audio:v().optional().default(!1),embeddedContext:v().optional().default(!1),image:v().optional().default(!1)}),yn=f().int().gte(0).lte(65535),bn=x({_meta:m(p(),g()).nullish(),clientCapabilities:_n.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:bt.nullish(),protocolVersion:yn}),A=x({end:k,start:k}),xn=x({message:p(),range:A,severity:Nt,uri:p()}),Sn=x({languageId:p(),lastFocusedMs:f().nullish(),uri:p(),visibleRange:A.nullish()}),Cn=x({_meta:m(p(),g()).nullish(),diagnostics:h(xn).nullish(),editHistory:h(Bt).nullish(),openFiles:h(Sn).nullish(),recentFiles:h(Wt).nullish(),relatedSnippets:h(qt).nullish(),userActions:h(hn).nullish()}),wn=x({newText:p(),range:A}),Tn=_([x({cursorPosition:k.nullish(),edits:h(wn),id:p(),uri:p()}).and(x({kind:b(`edit`)})),pn.and(x({kind:b(`jump`)})),mn.and(x({kind:b(`rename`)})),$t.and(x({kind:b(`searchAndReplace`)}))]),En=x({_meta:m(p(),g()).nullish(),content:p()}),Dn=x({_meta:m(p(),g()).nullish()}),j=_([f(),p()]).nullable();x({_meta:m(p(),g()).nullish(),requestId:j});var On=x({requestId:j}),kn=te([`assistant`,`user`]),M=x({_meta:m(p(),g()).nullish(),audience:h(kn).nullish(),lastModified:p().nullish(),priority:f().nullish()}),An=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p()}),jn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),Mn=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:f().nullish(),title:p().nullish(),uri:p()}),Nn=x({_meta:m(p(),g()).nullish(),optionId:on}),Pn=_([x({outcome:b(`cancelled`)}),Nn.and(x({outcome:b(`selected`)}))]),Fn=x({_meta:m(p(),g()).nullish(),outcome:Pn}),In=x({_meta:m(p(),g()).nullish()}),Ln=x({_meta:m(p(),g()).nullish()}),Rn=x({currentValue:v()}),zn=p(),Bn=p(),Vn=_([b(`mode`),b(`model`),b(`thought_level`),p()]),N=p(),Hn=x({_meta:m(p(),g()).nullish(),description:p().nullish(),name:p(),value:N}),Un=x({_meta:m(p(),g()).nullish(),group:zn,name:p(),options:h(Hn)}),P=y(_([x({currentValue:N,options:_([h(Hn),h(Un)])}).and(x({type:b(`select`)})),Rn.and(x({type:b(`boolean`)}))]),x({_meta:m(p(),g()).nullish(),category:Vn.nullish(),description:p().nullish(),id:Bn,name:p()})),Wn=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Gn=x({_meta:m(p(),g()).nullish()}),F=p(),Kn=x({_meta:m(p(),g()).nullish(),id:p(),sessionId:F}),qn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Jn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Yn=x({_meta:m(p(),g()).nullish(),sessionId:F}),Xn=x({_meta:m(p(),g()).nullish(),args:h(p()).optional(),command:p(),cwd:p().nullish(),env:h(pt).optional(),outputByteLimit:f().nullish(),sessionId:F}),Zn=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),Qn=x({_meta:m(p(),g()).nullish(),position:k,sessionId:F,uri:p(),version:f(),visibleRange:A}),$n=x({_meta:m(p(),g()).nullish(),languageId:p(),sessionId:F,text:p(),uri:p(),version:f()}),er=x({_meta:m(p(),g()).nullish(),sessionId:F,uri:p()}),tr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),nr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),rr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D),sessionId:F}),ir=x({_meta:m(p(),g()).nullish(),limit:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p(),sessionId:F}),ar=x({_meta:m(p(),g()).nullish(),id:p(),reason:Kt.nullish(),sessionId:F}),or=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),sr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),mcpServers:h(D).optional(),sessionId:F}),cr=x({_meta:m(p(),g()).nullish(),additionalDirectories:h(p()).optional(),cwd:p(),sessionId:F,title:p().nullish(),updatedAt:p().nullish()}),lr=x({_meta:m(p(),g()).nullish(),nextCursor:p().nullish(),sessions:h(cr)}),ur=x({_meta:m(p(),g()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),dr=x({_meta:m(p(),g()).nullish()}),I=p(),fr=x({_meta:m(p(),g()).nullish(),currentModeId:I}),pr=x({_meta:m(p(),g()).nullish(),description:p().nullish(),id:I,name:p()}),L=x({_meta:m(p(),g()).nullish(),availableModes:h(pr),currentModeId:I}),R=x({_meta:m(p(),g()).nullish(),availableModels:h(Mt),currentModelId:O}),mr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),hr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),gr=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish(),sessionId:F}),_r=x({_meta:m(p(),g()).nullish(),configOptions:h(P).nullish(),models:R.nullish(),modes:L.nullish()}),vr=x({_meta:m(p(),g()).nullish()}),yr=x({_meta:m(p(),g()).nullish(),additionalDirectories:In.nullish(),close:Ln.nullish(),fork:Gn.nullish(),list:dr.nullish(),resume:vr.nullish()}),br=y(_([x({type:b(`boolean`),value:v()}),x({value:N})]),x({_meta:m(p(),g()).nullish(),configId:Bn,sessionId:F})),xr=x({_meta:m(p(),g()).nullish(),configOptions:h(P)}),Sr=x({_meta:m(p(),g()).nullish(),modeId:I,sessionId:F}),Cr=x({_meta:m(p(),g()).nullish()}),wr=x({_meta:m(p(),g()).nullish(),modelId:O,sessionId:F}),Tr=x({_meta:m(p(),g()).nullish()}),Er=x({_meta:m(p(),g()).nullish(),sessionId:F}),Dr=_([b(`end_turn`),b(`max_tokens`),b(`max_turn_requests`),b(`refusal`),b(`cancelled`)]),Or=_([b(`email`),b(`uri`),b(`date`),b(`date-time`)]),kr=x({default:p().nullish(),description:p().nullish(),enum:h(p()).nullish(),format:Or.nullish(),maxLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:h(ft).nullish(),pattern:p().nullish(),title:p().nullish()}),Ar=x({_meta:m(p(),g()).nullish(),context:Cn.nullish(),position:k,selection:A.nullish(),sessionId:F,triggerKind:en,uri:p(),version:f()}),jr=x({_meta:m(p(),g()).nullish(),suggestions:h(Tn)}),Mr=x({_meta:m(p(),g()).nullish(),terminalId:p()}),Nr=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),Pr=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),Fr=x({_meta:m(p(),g()).nullish(),exitStatus:Nr.nullish(),output:p(),truncated:v()}),Ir=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),text:p()}),Lr=x({range:A.nullish(),text:p()}),Rr=x({_meta:m(p(),g()).nullish(),contentChanges:h(Lr),sessionId:F,uri:p(),version:f()});x({method:p(),params:_([qn,$n,Rr,Zn,er,Qn,Kn,ar,ht]).nullish()});var zr=_([b(`full`),b(`incremental`)]),Br=x({_meta:m(p(),g()).nullish(),syncKind:zr}),Vr=x({_meta:m(p(),g()).nullish(),didChange:Br.nullish(),didClose:Ft.nullish(),didFocus:It.nullish(),didOpen:Lt.nullish(),didSave:Rt.nullish()}),Hr=x({_meta:m(p(),g()).nullish(),document:Vr.nullish()}),Ur=x({_meta:m(p(),g()).nullish(),context:nn.nullish(),events:Hr.nullish()}),Wr=x({_meta:m(p(),g()).nullish(),auth:Tt.optional().default({}),loadSession:v().optional().default(!1),mcpCapabilities:Ot.optional().default({http:!1,sse:!1}),nes:Ur.nullish(),positionEncoding:gn.nullish(),promptCapabilities:vn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:yr.optional().default({})}),Gr=x({_meta:m(p(),g()).nullish(),agentCapabilities:Wr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:bt.nullish(),authMethods:h(qe).optional().default([]),protocolVersion:yn}),Kr=_([x({_meta:m(p(),g()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),Xe]),qr=x({_meta:m(p(),g()).nullish(),annotations:M.nullish(),resource:Kr}),z=_([Ir.and(x({type:b(`text`)})),jn.and(x({type:b(`image`)})),An.and(x({type:b(`audio`)})),Mn.and(x({type:b(`resource_link`)})),qr.and(x({type:b(`resource`)}))]),Jr=x({_meta:m(p(),g()).nullish(),content:z}),B=x({_meta:m(p(),g()).nullish(),content:z,messageId:p().nullish()}),Yr=x({_meta:m(p(),g()).nullish(),messageId:p().nullish(),prompt:h(z),sessionId:F}),Xr=x({anyOf:h(ft)}),Zr=_([Jr.and(x({type:b(`content`)})),nt.and(x({type:b(`diff`)})),Mr.and(x({type:b(`terminal`)}))]),V=p(),Qr=x({sessionId:F,toolCallId:V.nullish()}),$r=y(_([Qr,On]),x({elicitationId:ot,url:p().url()})),ei=x({_meta:m(p(),g()).nullish(),line:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:p()}),ti=_([b(`pending`),b(`in_progress`),b(`completed`),b(`failed`)]),ni=_([b(`read`),b(`edit`),b(`delete`),b(`move`),b(`search`),b(`execute`),b(`think`),b(`fetch`),b(`switch_mode`),b(`other`)]),ri=x({_meta:m(p(),g()).nullish(),content:h(Zr).optional(),kind:ni.optional(),locations:h(ei).optional(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.optional(),title:p(),toolCallId:V}),ii=x({_meta:m(p(),g()).nullish(),content:h(Zr).nullish(),kind:ni.nullish(),locations:h(ei).nullish(),rawInput:g().optional(),rawOutput:g().optional(),status:ti.nullish(),title:p().nullish(),toolCallId:V}),ai=x({_meta:m(p(),g()).nullish(),options:h(cn),sessionId:F,toolCall:ii}),oi=x({_meta:m(p(),g()).nullish(),hint:p()}),si=x({_meta:m(p(),g()).nullish(),description:p(),input:oi.nullish(),name:p()}),ci=x({_meta:m(p(),g()).nullish(),availableCommands:h(si)}),li=_([x({enum:h(p()),type:lt}),Xr]),ui=x({default:h(p()).nullish(),description:p().nullish(),items:li,maxItems:f().nullish(),minItems:f().nullish(),title:p().nullish()}),di=_([kr.and(x({type:b(`string`)})),an.and(x({type:b(`number`)})),xt.and(x({type:b(`integer`)})),Ze.and(x({type:b(`boolean`)})),ui.and(x({type:b(`array`)}))]),fi=x({description:p().nullish(),properties:m(p(),di).optional().default({}),required:h(p()).nullish(),title:p().nullish(),type:ct.optional().default(`object`)}),pi=y(_([y(_([Qr,On]),x({requestedSchema:fi})).and(x({mode:b(`form`)})),$r.and(x({mode:b(`url`)}))]),x({_meta:m(p(),g()).nullish(),message:p()})),mi=x({cachedReadTokens:f().nullish(),cachedWriteTokens:f().nullish(),inputTokens:f(),outputTokens:f(),thoughtTokens:f().nullish(),totalTokens:f()});_([x({id:j,result:_([Gr,Ye,Dt,gr,hr,lr,mr,_r,$e,Cr,xr,x({_meta:m(p(),g()).nullish(),stopReason:Dr,usage:mi.nullish(),userMessageId:p().nullish()}),Tr,Er,jr,Qe,_t])}),x({error:mt,id:j})]);var hi=x({_meta:m(p(),g()).nullish(),cost:et.nullish(),size:f(),used:f()}),gi=_([B.and(x({sessionUpdate:b(`user_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_message_chunk`)})),B.and(x({sessionUpdate:b(`agent_thought_chunk`)})),ri.and(x({sessionUpdate:b(`tool_call`)})),ii.and(x({sessionUpdate:b(`tool_call_update`)})),fn.and(x({sessionUpdate:b(`plan`)})),ci.and(x({sessionUpdate:b(`available_commands_update`)})),fr.and(x({sessionUpdate:b(`current_mode_update`)})),Wn.and(x({sessionUpdate:b(`config_option_update`)})),ur.and(x({sessionUpdate:b(`session_info_update`)})),hi.and(x({sessionUpdate:b(`usage_update`)}))]),_i=x({_meta:m(p(),g()).nullish(),sessionId:F,update:gi});x({method:p(),params:_([_i,st,ht]).nullish()});var vi=x({_meta:m(p(),g()).nullish(),sessionId:F,terminalId:p()}),yi=x({_meta:m(p(),g()).nullish(),exitCode:f().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:p().nullish()}),bi=x({name:p(),uri:p()}),xi=x({_meta:m(p(),g()).nullish(),repository:Xt.nullish(),workspaceFolders:h(bi).nullish(),workspaceUri:p().nullish()});x({id:j,method:p(),params:_([bn,Je,Et,rn,rr,Ct,tr,sr,Yn,Sr,br,Yr,wr,xi,Ar,Jn,gt]).nullish()});var Si=x({_meta:m(p(),g()).nullish(),content:p(),path:p(),sessionId:F});x({id:j,method:p(),params:_([Si,ir,ai,Xn,Pr,or,vi,nr,pi,gt]).nullish()}),_([x({id:j,result:_([x({_meta:m(p(),g()).nullish()}),En,Fn,tt,Fr,Dn,yi,St,it,_t])}),x({error:mt,id:j})]),e(),d(),r(),s(),i(),o();function Ci(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
|
2
|
-
`);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
|
|
3
|
-
`,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}ne();var wi,H=new WeakMap,Ti=class{constructor(e,t){l(this,H,void 0);let n=e(this);u(H,this,new ji(async(e,t)=>{switch(e){case T.initialize:{let e=bn.parse(t);return n.initialize(e)}case T.session_new:{let e=rn.parse(t);return n.newSession(e)}case T.session_load:{if(!n.loadSession)throw Z.methodNotFound(e);let r=rr.parse(t);return n.loadSession(r)}case T.session_list:{if(!n.listSessions)throw Z.methodNotFound(e);let r=Ct.parse(t);return n.listSessions(r)}case T.session_fork:{if(!n.unstable_forkSession)throw Z.methodNotFound(e);let r=tr.parse(t);return n.unstable_forkSession(r)}case T.session_resume:{if(!n.unstable_resumeSession)throw Z.methodNotFound(e);let r=sr.parse(t);return n.unstable_resumeSession(r)}case T.session_close:{if(!n.unstable_closeSession)throw Z.methodNotFound(e);let r=Yn.parse(t);return n.unstable_closeSession(r)}case T.session_set_mode:{if(!n.setSessionMode)throw Z.methodNotFound(e);let r=Sr.parse(t);return await n.setSessionMode(r)??{}}case T.authenticate:{let e=Je.parse(t);return await n.authenticate(e)??{}}case T.logout:{if(!n.unstable_logout)throw Z.methodNotFound(e);let r=Et.parse(t);return await n.unstable_logout(r)??{}}case T.session_prompt:{let e=Yr.parse(t);return n.prompt(e)}case T.session_set_model:{if(!n.unstable_setSessionModel)throw Z.methodNotFound(e);let r=wr.parse(t);return await n.unstable_setSessionModel(r)??{}}case T.session_set_config_option:{if(!n.setSessionConfigOption)throw Z.methodNotFound(e);let r=br.parse(t);return n.setSessionConfigOption(r)}case T.nes_start:{if(!n.unstable_startNes)throw Z.methodNotFound(e);let r=xi.parse(t);return n.unstable_startNes(r)}case T.nes_suggest:{if(!n.unstable_suggestNes)throw Z.methodNotFound(e);let r=Ar.parse(t);return n.unstable_suggestNes(r)}case T.nes_close:{if(!n.unstable_closeNes)throw Z.methodNotFound(e);let r=Jn.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw Z.methodNotFound(e)}},async(e,t)=>{switch(e){case T.session_cancel:{let e=qn.parse(t);return n.cancel(e)}case T.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=$n.parse(t);return n.unstable_didOpenDocument(e)}case T.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=Rr.parse(t);return n.unstable_didChangeDocument(e)}case T.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=Zn.parse(t);return n.unstable_didCloseDocument(e)}case T.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=er.parse(t);return n.unstable_didSaveDocument(e)}case T.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=Qn.parse(t);return n.unstable_didFocusDocument(e)}case T.nes_accept:{if(!n.unstable_acceptNes)return;let e=Kn.parse(t);return n.unstable_acceptNes(e)}case T.nes_reject:{if(!n.unstable_rejectNes)return;let e=ar.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw Z.methodNotFound(e)}},t))}async sessionUpdate(e){return await c(H,this).sendNotification(E.session_update,e)}async requestPermission(e){return await c(H,this).sendRequest(E.session_request_permission,e)}async readTextFile(e){return await c(H,this).sendRequest(E.fs_read_text_file,e)}async writeTextFile(e){return await c(H,this).sendRequest(E.fs_write_text_file,e)??{}}async createTerminal(e){return new Ei((await c(H,this).sendRequest(E.terminal_create,e)).terminalId,e.sessionId,c(H,this))}async unstable_createElicitation(e){return await c(H,this).sendRequest(E.elicitation_create,e)}async unstable_completeElicitation(e){return await c(H,this).sendNotification(E.elicitation_complete,e)}async extMethod(e,t){return await c(H,this).sendRequest(e,t)}async extNotification(e,t){return await c(H,this).sendNotification(e,t)}get signal(){return c(H,this).signal}get closed(){return c(H,this).closed}},U=new WeakMap,W=new WeakMap;wi=Symbol.asyncDispose;var Ei=class{constructor(e,n,r){t(this,`id`,void 0),l(this,U,void 0),l(this,W,void 0),this.id=e,u(U,this,n),u(W,this,r)}async currentOutput(){return await c(W,this).sendRequest(E.terminal_output,{sessionId:c(U,this),terminalId:this.id})}async waitForExit(){return await c(W,this).sendRequest(E.terminal_wait_for_exit,{sessionId:c(U,this),terminalId:this.id})}async kill(){return await c(W,this).sendRequest(E.terminal_kill,{sessionId:c(U,this),terminalId:this.id})??{}}async release(){return await c(W,this).sendRequest(E.terminal_release,{sessionId:c(U,this),terminalId:this.id})??{}}async[wi](){await this.release()}},G=new WeakMap,Di=new WeakMap,Oi=new WeakMap,ki=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Ai=new WeakMap,Y=new WeakSet,ji=class{constructor(e,t,r){a(this,Y),l(this,G,new Map),l(this,Di,0),l(this,Oi,void 0),l(this,ki,void 0),l(this,K,void 0),l(this,q,Promise.resolve()),l(this,J,new AbortController),l(this,Ai,void 0),u(Oi,this,e),u(ki,this,t),u(K,this,r),u(Ai,this,new Promise(e=>{c(J,this).signal.addEventListener(`abort`,()=>e())})),n(Y,this,Mi).call(this)}get signal(){return c(J,this).signal}get closed(){return c(Ai,this)}async sendRequest(e,t){var r,i;n(Y,this,Ri).call(this);let a=(u(Di,this,(r=c(Di,this),i=r++,r)),i),o=new Promise((e,t)=>{c(G,this).set(a,{resolve:e,reject:t})});return await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:a,method:e,params:t}),o}async sendNotification(e,t){n(Y,this,Ri).call(this),await n(Y,this,X).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function Mi(){let e;try{let e=c(K,this).readable.getReader();try{for(;!c(J,this).signal.aborted;){let{value:t,done:r}=await e.read();if(r)break;if(t)try{n(Y,this,Pi).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&n(Y,this,X).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{n(Y,this,Ni).call(this,e)}}function Ni(e){if(c(J,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of c(G,this).values())e.reject(t);c(G,this).clear(),c(J,this).abort(t)}async function Pi(e){if(`method`in e&&`id`in e){let t=await n(Y,this,Fi).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await n(Y,this,X).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await n(Y,this,Ii).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?n(Y,this,Li).call(this,e):console.error(`Invalid message`,{message:e})}async function Fi(e,t){try{return{result:await c(Oi,this).call(this,e,t)??null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}async function Ii(e,t){try{return await c(ki,this).call(this,e,t),{result:null}}catch(e){if(e instanceof Z)return e.toResult();if(e instanceof ee)return Z.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return Z.internalError(t?JSON.parse(t):{}).toResult()}catch{return Z.internalError({details:t}).toResult()}}}function Li(e){let t=c(G,this).get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new Z(n,r,i))}c(G,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function Ri(){if(c(J,this).signal.aborted)throw c(J,this).signal.reason??Error(`ACP connection closed`)}async function X(e){return u(q,this,c(q,this).then(async()=>{let t=c(K,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{n(Y,this,Ni).call(this,e)})),c(q,this)}var Z=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};ie(),de(),ae(),ue(),Ne(),Fe(),Me(),we(),pe(),ke(),he(),ve(),Ae();var zi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Vi(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=Bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!zi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Hi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ui=256;function Wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ui?t:t.slice(0,Ui-1)+`…`}function Gi(e,t){if(!t)return e;let n=w.resolve(t),r=w.resolve(e);return r.startsWith(n+w.sep)||r===n?w.relative(n,r).replaceAll(`\\`,`/`):e}function Ki(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
|
|
4
|
-
`+e+(e.endsWith(`
|
|
5
|
-
`)?``:`
|
|
6
|
-
`)+t}var qi=console;function Q(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let n=i?.command??`Terminal`,r=i?.description;return{title:n,kind:`execute`,content:t?[{type:`terminal`,terminalId:e.id}]:r?[{type:`content`,content:{type:`text`,text:r}}]:[]}}case`Read`:{let e=i?.file_path??`File`,t=i?.offset,r=i?.limit,a=``;return r&&r>0?a=` (${t??1} - ${(t??1)+r-1})`:t&&(a=` (from line ${t})`),{title:`Read ${e?Gi(e,n):`File`}${a}`,kind:`read`,locations:e?[{path:e,line:t??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Gi(e,n):void 0;return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:e?[{path:e}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Gi(e,n):void 0;return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:e?[{type:`diff`,path:e,oldText:t||null,newText:r}]:[],locations:e?[{path:e}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,n=`Find`;return e&&(n+=` \`${e}\``),t&&(n+=` \`${t}\``),{title:n,kind:`search`,content:[],locations:e?[{path:e}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function Ji(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Yi(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Ki(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Ki(e.text)}:Xi(e,!1)}))}:{};case`Bash`:{let e=``,a=+!!r,o=String(t.id);if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
|
|
7
|
-
`),a=t.return_code??+!!r}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
8
|
-
`));return n?{content:[{type:`terminal`,terminalId:o}],_meta:{terminal_info:{terminal_id:o},terminal_output:{terminal_id:o,data:e},terminal_exit:{terminal_id:o,exit_code:a,signal:null}}}:e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return Yi(i??``,r)}}function Yi(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Xi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Xi(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_search_result`:return n(`${e.title} (${e.url})`);case`web_search_tool_result_error`:return n(`Error: ${e.error_code}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
|
|
9
|
-
`)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function Zi(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Qi(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5,p=!1;try{for(;!r.aborted;){let s=await Zi(t,r);if(s.done||r.aborted)break;let m=s.value;if(m==null)continue;let h=m;switch(h.type){case`system`:h.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
10
|
-
|
|
11
|
-
Compacting completed.`}}}));break;case`result`:{let t=h.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=h.modelUsage;if(i&&d){let e=ia(i,d);e?.contextWindow&&(f=e.contextWindow)}let a=u??l.inputTokens+l.outputTokens+l.cachedReadTokens+l.cachedWriteTokens,o=h.total_cost_usd;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:a,size:f,cost:o==null?void 0:{amount:o,currency:`USD`}}});let s=h.subtype,p=h.is_error;if(r.aborted){c=`cancelled`;break}switch(s){case`success`:h.stop_reason===`max_tokens`&&(c=`max_tokens`),p&&(c=`end_turn`);break;case`error_during_execution`:c=h.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=ea(h,e,i,n,{clientCapabilities:a,cwd:o});for(let e of t)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=h.message,r=h.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s=$i(h,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p});for(let e of s)await n.sessionUpdate(e);break}case`user`:break;case`progress`:{let t=h.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:0,size:f}}),await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
12
|
-
|
|
13
|
-
Compacting completed.`}}});break;default:qi.debug(`Ignoring unknown SDK message type`);break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}function $i(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:$(s,`assistant`,t,n,r,void 0,i)}function ea(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`content_block_delta`:{let o=a.delta;return o?$([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function $(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:a={sessionUpdate:`agent_thought_chunk`,content:{type:`text`,text:i.thinking??``}};break;case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:ta(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,rawInput:e,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Q({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=Ji(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function ta(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}async function na(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){qi.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=$(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a});for(let e of t)await n.sessionUpdate(e)}}}function ra(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function ia(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=ra(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}function aa(e,t,n,r,i,a,o){return async(n,s,c,l,u,d)=>{let f=sa(r);if(n.name===`ExitPlanMode`)return oa(e,t,u,s,f,i,a,o);if(d!==void 0)return d;try{let e=await ge(n,s,c,l,u);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:u}}let p=Q({name:n.name,id:u,input:s},f,i),m={toolCallId:u,title:p.title,kind:p.kind,status:`pending`,rawInput:s},h=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`}];try{let n=await e.requestPermission({sessionId:t,toolCall:m,options:h});if(n.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`}};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:s}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function oa(e,t,n,r,i,a,o,s){let c=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&c.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let l=Q({name:`ExitPlanMode`,id:n,input:r},i,a),u={toolCallId:n,title:l.title,kind:l.kind,status:`pending`,rawInput:r},d=await e.requestPermission({sessionId:t,toolCall:u,options:c});if(d.outcome.outcome===`cancelled`)return{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(d.outcome.outcome===`selected`&&`optionId`in d.outcome&&d.outcome.optionId!==void 0){let n=d.outcome.optionId;if(c.some(e=>e.optionId===n)&&(n===`default`||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function sa(e){if(!e)return!1;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}function ca(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(la(n,r))}else if(e.type===`resource`){let n=e.resource;n&&typeof n.text==`string`&&t.push(n.text)}}return t.filter(e=>e.length>0).join(`
|
|
14
|
-
`)}function la(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}Se(),se(),_e(),e();var ua=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0}},promptCapabilities:{image:!0,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{fork:{},list:{},resume:{},close:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){let t=await me({dir:e.cwd??void 0,limit:100}),n=[];for(let e of t)e.cwd&&n.push({sessionId:e.sessionId,cwd:e.cwd,title:Wi(e.summary??``),updatedAt:new Date(e.lastModified).toISOString()});return{sessions:n}}async unstable_forkSession(e){let t=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async prompt(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=ca(e.prompt);if(!n.trim())return{stopReason:`end_turn`};let r=t.cancelGeneration;if(t.promptRunning){let e=ze();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==r)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),S(e.sessionId,re());let r=t.queryEngine.submitMessage(n),{stopReason:i,usage:a}=await Qi(e.sessionId,r,this.conn,t.queryEngine.getAbortSignal(),t.toolUseCache,this.clientCapabilities,t.cwd,()=>t.cancelled);return t.cancelled?{stopReason:`cancelled`}:{stopReason:i,usage:a?{inputTokens:a.inputTokens,outputTokens:a.outputTokens,cachedReadTokens:a.cachedReadTokens,cachedWriteTokens:a.cachedWriteTokens,totalTokens:a.inputTokens+a.outputTokens+a.cachedReadTokens+a.cachedWriteTokens}:void 0}}catch(n){if(t.cancelled)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=Sa(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async setSessionConfigOption(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);if(!t.configOptions.find(t=>t.id===e.configId))throw Error(`Unknown config option: ${e.configId}`);let n=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,n),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:n}})):e.configId===`model`&&t.queryEngine.setModel(n),this.syncSessionConfigState(t,e.configId,n),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:n}:t),{configOptions:t.configOptions}}async createSession(e,t={}){ce();let n=t.sessionId??ze(),r=e.cwd;S(n,re()),C(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}try{let i=Pe(),a=ye(i),o=e._meta,s=ga(o,`permissionMode`),c=s?o?.permissionMode:void 0,l=this.getSetting(`permissions.defaultMode`),u=pa(c,s,l),d=aa(this.conn,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,this.clientCapabilities,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=_a(l),p={...De(),toolPermissionContext:{...i,mode:u,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([Ee(r),Oe(r)]);p.agentDefinitions=h;let g=new Le({cwd:r,tools:a,commands:m,mcpClients:[],agents:h.activeAgents,canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Ie(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={currentModeId:u,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},ee=Ce(),v=oe(),y={availableModels:ee.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:v};g.setModel(v);let b=wa(_,y),te={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:y,configOptions:b,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:this.clientCapabilities,appState:p,commands:m,sessionFingerprint:Hi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,models:y,modes:_,configOptions:b}}finally{a&&process.chdir(i)}}async getOrCreateSession(e){let t=this.sessions.get(e.sessionId);if(t){if(Hi({cwd:e.cwd,mcpServers:e.mcpServers})===t.sessionFingerprint){let n=await fe(e.sessionId,e.cwd);return S(e.sessionId,n?Re(n.filePath):null),C(e.cwd),await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:t.modes,models:t.models,configOptions:t.configOptions}}await this.teardownSession(e.sessionId)}let n=await fe(e.sessionId,e.cwd),r=n?Re(n.filePath):null;S(e.sessionId,r),C(e.cwd);let i;if(n)try{let t=await be(e.sessionId);t&&t.messages.length>0&&(i=Te(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let a=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:i});if(i&&i.length>0){let t=this.sessions.get(e.sessionId);t&&await na(e.sessionId,i,this.conn,t.toolUseCache,this.clientCapabilities,t.cwd)}return{sessionId:a.sessionId,modes:a.modes,models:a.models,configOptions:a.configOptions}}async teardownSession(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async replaySessionHistory(e){try{let t=await be(e.sessionId);if(!t||t.messages.length===0)return;let n=Te(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await na(e.sessionId,n,this.conn,r.toolUseCache,this.clientCapabilities,r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}applySessionMode(e,t){if(!fa(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async updateConfigOption(e,t,n){let r=this.sessions.get(e);r&&(this.syncSessionConfigState(r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}syncSessionConfigState(e,t,n){t===`mode`?e.modes={...e.modes,currentModeId:n}:t===`model`&&(e.models={...e.models,currentModelId:n})}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}getSetting(e){let t=le();return e.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t)}},da=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function fa(e){return da.includes(e)}function pa(e,t,n){if(t){let t=ma(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!_a(n))throw Error(`Mode not available: bypassPermissions requires a local ACP bypass opt-in.`);return t}return ha(n)??`default`}function ma(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Vi(e,t)}function ha(e){if(e!=null)try{return Vi(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function ga(e,t){return!!e&&Object.hasOwn(e,t)}function _a(e){return va()&&(ya()||ba(e))}function va(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function ya(){return process.env.ACP_PERMISSION_MODE===`bypassPermissions`||xa(process.env.CLAUDE_CODE_ACP_ALLOW_BYPASS_PERMISSIONS)}function ba(e){try{return Vi(e)===`bypassPermissions`}catch{return!1}}function xa(e){return e===`1`||e?.toLowerCase()===`true`}function Sa(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),Ca(e),n}Ca(e)}function Ca(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}function wa(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}ae(),xe();function Ta(e,t){let n=Be.toWeb(e);return Ci(Ve.toWeb(t),n)}async function Ea(){ce(),je();let e=Ta(process.stdin,process.stdout),t,n=new Ti(e=>(t=new ua(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{Ea as runAcpAgent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{n as r,s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{_ as o,h as s}from"./debug-otxXY3j-.js";import{c,u as l}from"./oauth-CdZEzMww.js";import{r as u,t as d}from"./bundledMode-kSQejuY4.js";import{n as f,r as p,t as m}from"./which-BnEnzWhs.js";import{homedir as h}from"os";import{join as g}from"path";function _(e,t){return{cmd:p(e)??e,args:t}}var v=e((()=>{m()}));async function y(e){try{return!!await f(e)}catch{return!1}}function b(){return process.env.__CFBundleIdentifier===`com.conductor.app`}function x(){if(process.env.CURSOR_TRACE_ID||process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`cursor`))return`cursor`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`windsurf`))return`windsurf`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`antigravity`))return`antigravity`;let e=process.env.__CFBundleIdentifier?.toLowerCase();if(e?.includes(`vscodium`))return`codium`;if(e?.includes(`windsurf`))return`windsurf`;if(e?.includes(`com.google.android.studio`))return`androidstudio`;if(e){for(let t of A)if(e.includes(t))return t}if(process.env.VisualStudioVersion)return`visualstudio`;if(process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`)return process.platform,`pycharm`;if(process.env.TERM===`xterm-ghostty`)return`ghostty`;if(process.env.TERM?.includes(`kitty`))return`kitty`;if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return`tmux`;if(process.env.STY)return`screen`;if(process.env.KONSOLE_VERSION)return`konsole`;if(process.env.GNOME_TERMINAL_SERVICE)return`gnome-terminal`;if(process.env.XTERM_VERSION)return`xterm`;if(process.env.VTE_VERSION)return`vte-based`;if(process.env.TERMINATOR_UUID)return`terminator`;if(process.env.KITTY_WINDOW_ID)return`kitty`;if(process.env.ALACRITTY_LOG)return`alacritty`;if(process.env.TILIX_ID)return`tilix`;if(process.env.WT_SESSION)return`windows-terminal`;if(process.env.SESSIONNAME&&process.env.TERM===`cygwin`)return`cygwin`;if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return`conemu`;if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(S())return`ssh-session`;if(process.env.TERM){let e=process.env.TERM;return e.includes(`alacritty`)?`alacritty`:e.includes(`rxvt`)?`rxvt`:e.includes(`termite`)?`termite`:process.env.TERM}return process.stdout.isTTY?null:`non-interactive`}function S(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function C(){let e=process.env.CLAUDE_CODE_HOST_PLATFORM;return e===`win32`||e===`darwin`||e===`linux`?e:M.platform}var w,T,E,D,O,k,A,j,M,N=e((()=>{n(),l(),d(),i(),v(),o(),m(),w=t(()=>{if(s().existsSync(g(r(),`.config.json`)))return g(r(),`.config.json`);let e=`.claude${c()}.json`;return g(process.env.CLAUDE_CONFIG_DIR||h(),e)}),T=t(async()=>{try{let{default:e}=await import(`./axios-DLnc2dVy.js`);return await e.head(`http://1.1.1.1`,{signal:AbortSignal.timeout(1e3)}),!0}catch{return!1}}),E=t(async()=>{let e=[];return await y(`npm`)&&e.push(`npm`),await y(`yarn`)&&e.push(`yarn`),await y(`pnpm`)&&e.push(`pnpm`),e}),D=t(async()=>{let e=[];return await y(`bun`)&&e.push(`bun`),await y(`deno`)&&e.push(`deno`),await y(`node`)&&e.push(`node`),e}),O=t(()=>{try{return s().existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)}catch{return!1}}),k=t(()=>{try{if(!O())return!1;let{cmd:e}=_(`npm`,[]);return e.startsWith(`/mnt/c/`)}catch{return!1}}),A=[`pycharm`,`intellij`,`webstorm`,`phpstorm`,`rubymine`,`clion`,`goland`,`rider`,`datagrip`,`appcode`,`dataspell`,`aqua`,`gateway`,`fleet`,`jetbrains`,`androidstudio`],j=t(()=>{if(a(process.env.CODESPACES))return`codespaces`;if(process.env.GITPOD_WORKSPACE_ID)return`gitpod`;if(process.env.REPL_ID||process.env.REPL_SLUG)return`replit`;if(process.env.PROJECT_DOMAIN)return`glitch`;if(a(process.env.VERCEL))return`vercel`;if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return`railway`;if(a(process.env.RENDER))return`render`;if(a(process.env.NETLIFY))return`netlify`;if(process.env.DYNO)return`heroku`;if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return`fly.io`;if(a(process.env.CF_PAGES))return`cloudflare-pages`;if(process.env.DENO_DEPLOYMENT_ID)return`deno-deploy`;if(process.env.AWS_LAMBDA_FUNCTION_NAME)return`aws-lambda`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_FARGATE`)return`aws-fargate`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_EC2`)return`aws-ecs`;try{if(s().readFileSync(`/sys/hypervisor/uuid`,{encoding:`utf8`}).trim().toLowerCase().startsWith(`ec2`))return`aws-ec2`}catch{}if(process.env.K_SERVICE)return`gcp-cloud-run`;if(process.env.GOOGLE_CLOUD_PROJECT)return`gcp`;if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return`azure-app-service`;if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return`azure-functions`;if(process.env.APP_URL?.includes(`ondigitalocean.app`))return`digitalocean-app-platform`;if(process.env.SPACE_CREATOR_USER_ID)return`huggingface-spaces`;if(a(process.env.GITHUB_ACTIONS))return`github-actions`;if(a(process.env.GITLAB_CI))return`gitlab-ci`;if(process.env.CIRCLECI)return`circleci`;if(process.env.BUILDKITE)return`buildkite`;if(a(process.env.CI))return`ci`;if(process.env.KUBERNETES_SERVICE_HOST)return`kubernetes`;try{if(s().existsSync(`/.dockerenv`))return`docker`}catch{}return M.platform===`darwin`?`unknown-darwin`:M.platform===`linux`?`unknown-linux`:M.platform===`win32`?`unknown-win32`:`unknown`}),M={hasInternetAccess:T,isCI:a(process.env.CI),platform:[`win32`,`darwin`].includes(process.platform)?process.platform:`linux`,arch:process.arch,nodeVersion:process.version,terminal:x(),isSSH:S,getPackageManagers:E,getRuntimes:D,isRunningWithBun:t(u),isWslEnvironment:O,isNpmFromWindowsPath:k,isConductor:b,detectDeploymentEnvironment:j}}));export{N as a,C as i,M as n,_ as o,w as r,v as s,A as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t}from"./envLessBridgeConfig-DI0ouryy.js";t();export{e as shouldShowAppUpgradeMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,kt as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{S as o,y as s}from"./paths-DfGsIjPm.js";import{n as c,t as l}from"./lazySchema-2sOku3cX.js";import{i as u,r as d}from"./semver-Tw0AFar5.js";import{r as f,s as p}from"./bridgeEnabled-DoT2l1Oj.js";async function m(){let e=await s(`tengu_bridge_repl_v2_config`,_),t=v().safeParse(e);return t.success?t.data:_}async function h(){let e=await m();return e.min_version&&u(`2.7.0`,e.min_version)?`Your version of Claude Code (2.7.0) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function g(){return p()?(await m()).should_show_app_upgrade_message:!1}var _,v,y=e((()=>{a(),o(),l(),d(),f(),_={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},v=c(()=>i({init_retry_max_attempts:t().int().min(1).max(10).default(3),init_retry_base_delay_ms:t().int().min(100).default(500),init_retry_jitter_fraction:t().min(0).max(1).default(.25),init_retry_max_delay_ms:t().int().min(500).default(4e3),http_timeout_ms:t().int().min(2e3).default(1e4),uuid_dedup_buffer_size:t().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:t().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:t().min(0).max(.5).default(.1),token_refresh_buffer_ms:t().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:t().int().min(500).max(2e3).default(1500),connect_timeout_ms:t().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return u(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:r().default(!1)}))}));export{g as a,y as i,h as n,m as r,_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{E as t,k as n}from"./debug-otxXY3j-.js";import{n as r,t as i}from"./cwd--iizewsn.js";import{n as a,r as o,t as s}from"./execa-CGue6Z3n.js";import{o as c,s as l}from"./log-DS97_rIr.js";function u(e,t,r=10*f*d){let o;o=t===void 0?{}:t instanceof AbortSignal?{abortSignal:t,timeout:r}:t;let{abortSignal:s,timeout:c=10*f*d,input:l,stdio:u=[`ignore`,`pipe`,`pipe`]}=o;s?.throwIfAborted(),n`exec: ${e.slice(0,200)}`;try{let t=a(e,{env:process.env,maxBuffer:1e6,timeout:c,cwd:i(),stdio:u,shell:!0,reject:!1,input:l});return t.stdout&&t.stdout.trim()||null}catch{return null}}var d,f,p=e((()=>{o(),r(),t(),d=1e3,f=60}));function m(e,t,n={timeout:10*v*_,preserveOutputOnError:!0,useCwd:!0}){return g(e,t,{abortSignal:n.abortSignal,timeout:n.timeout,preserveOutputOnError:n.preserveOutputOnError,cwd:n.useCwd?i():void 0,env:n.env,stdin:n.stdin,input:n.input})}function h(e,t){return e.shortMessage?e.shortMessage:typeof e.signal==`string`?e.signal:String(t)}function g(e,t,{abortSignal:n,timeout:r=10*v*_,preserveOutputOnError:i=!0,cwd:a,env:o,maxBuffer:c,shell:u,stdin:d,input:f}={timeout:10*v*_,preserveOutputOnError:!0,maxBuffer:1e6}){return new Promise(p=>{s(e,t,{maxBuffer:c,cancelSignal:n,timeout:r,cwd:a,env:o,shell:u,stdin:d,input:f,reject:!1}).then(e=>{if(e.failed)if(i){let t=e.exitCode??1;p({stdout:e.stdout||``,stderr:e.stderr||``,code:t,error:h(e,t)})}else p({stdout:``,stderr:``,code:e.exitCode??1});else p({stdout:e.stdout,stderr:e.stderr,code:0})}).catch(e=>{l(e),p({stdout:``,stderr:``,code:1})})})}var _,v,y=e((()=>{o(),r(),c(),p(),_=1e3,v=60}));export{p as a,u as i,g as n,y as r,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./executor-Dmn3RTuI.js";e();export{t as unhideComputerUseApps};
|