@readmagic/workmate 0.0.10 → 0.0.12
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-Vmmm7p1c.js → AddWorkspaceDirectory-CtRxzRny.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-_bI4jo_P.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-_yJJ0wqu.js +1 -0
- package/dist/chunks/App-DoAZ7CYS.js +1 -0
- package/dist/chunks/ApproveApiKey-C8LwmDM2.js +1 -0
- package/dist/chunks/ApproveApiKey-DQP3qmb0.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CDA2noEk.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-CLSACUmo.js → BypassPermissionsModeDialog-COI_V57z.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-Dn8fO-o_.js +1 -0
- package/dist/chunks/{DiffDialog-9AYwtupw.js → DiffDialog-CRWtQ1R5.js} +3 -3
- package/dist/chunks/Doctor-CZ513Df9.js +3 -0
- package/dist/chunks/Doctor-CzPvNZzF.js +1 -0
- package/dist/chunks/ExitFlow-BFeftDv0.js +2 -0
- package/dist/chunks/{Grove-B9-hhkZA.js → Grove-DRZrhbF0.js} +2 -2
- package/dist/chunks/{HybridTransport-MxJ_W_np.js → HybridTransport-BadJQe6u.js} +4 -4
- package/dist/chunks/InvalidConfigDialog-DQaT6aen.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-YyQcHocx.js → InvalidSettingsDialog-ISzcIGPU.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BpjC7CEo.js +1 -0
- package/dist/chunks/MCPToolListView-Rb1Q--jG.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BCpfHaBK.js → McpParsingWarnings-xv0RZCSL.js} +1 -1
- package/dist/chunks/MessageSelector-BHB55sZb.js +3 -0
- package/dist/chunks/Messages-CPX-nIdA.js +11 -0
- package/dist/chunks/Onboarding-CymgipoF.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-BSA9NrZc.js → PromptInputFooterSuggestions-8-awCxOn.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-BP3UgCdi.js +1 -0
- package/dist/chunks/QueryEngine-HkswHUNv.js +1 -0
- package/dist/chunks/REPL-CZfg65kg.js +133 -0
- package/dist/chunks/REPL-eZsYNBfl.js +1 -0
- package/dist/chunks/RemoteSessionManager-B4jqKVd3.js +2 -0
- package/dist/chunks/ResumeConversation-B03XN_SP.js +1 -0
- package/dist/chunks/{SSETransport-CoxQ8YpH.js → SSETransport-je346ofV.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-C85Sanww.js +1 -0
- package/dist/chunks/Settings-C8GKWod1.js +2 -0
- package/dist/chunks/{TeleportProgress-Doucj-50.js → TeleportProgress-zmdAsogZ.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-B5I73j7Y.js → TeleportRepoMismatchDialog-CG32I4cO.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-D6kpr2c6.js → TeleportResumeWrapper-2Yjr74Lq.js} +1 -1
- package/dist/chunks/{ThemePicker-DrC8tlp0.js → ThemePicker-p7_hHk1V.js} +1 -1
- package/dist/chunks/TrustDialog-BVcny9vs.js +1 -0
- package/dist/chunks/{ValidationErrorsList-D_OUa4RT.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
- package/dist/chunks/{WelcomeV2-DvfQHnZY.js → WelcomeV2-BnSYhyfu.js} +1 -1
- package/dist/chunks/add-dir-Bd7pilVx.js +1 -0
- package/dist/chunks/{agentDisplay-B755vMZE.js → agentDisplay-CfMLGPGH.js} +1 -1
- package/dist/chunks/{agents-CIvP8l0s.js → agents-BT82hwBN.js} +1 -1
- package/dist/chunks/agents-qR6r94-F.js +103 -0
- package/dist/chunks/allErrors-CS77lRvU.js +1 -0
- package/dist/chunks/api-C4VflFau.js +1 -0
- package/dist/chunks/{api-nSHc_GIQ.js → api-DAubp5q9.js} +1 -1
- package/dist/chunks/auth-CNCehj7y.js +1 -0
- package/dist/chunks/auth-DrD9DW6X.js +1 -0
- package/dist/chunks/{auth-5QB6tsfB.js → auth-yDsvFcM7.js} +2 -2
- package/dist/chunks/{autoMode-BnUiK9Cu.js → autoMode-C2lnBot9.js} +6 -6
- package/dist/chunks/backgroundHousekeeping-DbpTGbwl.js +1 -0
- package/dist/chunks/backgroundHousekeeping-SpTxViUq.js +17 -0
- package/dist/chunks/{banner-D0P7wXdw.js → banner-BcAM7iSx.js} +1 -1
- package/dist/chunks/bg-Ci7pG4eo.js +9 -0
- package/dist/chunks/{branch-DFWa4Oxo.js → branch-DJiMa8td.js} +2 -2
- package/dist/chunks/{break-cache-Chj9i9MP.js → break-cache-4rlQORVk.js} +2 -2
- package/dist/chunks/{bridgeConfig-Bb6URf4Q.js → bridgeConfig-BB6Hgali.js} +1 -1
- package/dist/chunks/bridgeConfig-Ccm79Jze.js +1 -0
- package/dist/chunks/{bridgeMessaging-C3huGcR3.js → bridgeMessaging-C9D0Lly2.js} +1 -1
- package/dist/chunks/{bridgePointer-DLYyvRKb.js → bridgePointer-DHWK3LEe.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-DFMftajD.js → bridgeStatusUtil-D8UbcVrZ.js} +1 -1
- package/dist/chunks/{btw-DSK9R2C8.js → btw-BO2B23f-.js} +1 -1
- package/dist/chunks/caches-BQmbXerw.js +1 -0
- package/dist/chunks/caches-Dtjmjm6G.js +1 -0
- package/dist/chunks/{capacityWake-amzeeBz0.js → capacityWake-ByL6fM6I.js} +1 -1
- package/dist/chunks/ccrClient-BG9HU_fW.js +1 -0
- package/dist/chunks/{claudeDesktop-CsJfF1b-.js → claudeDesktop-Ct_hyICL.js} +1 -1
- package/dist/chunks/{clear-ClFDpWVJ.js → clear-B4XN2fib.js} +1 -1
- package/dist/chunks/cliLaunch-OPOtzhvA.js +1 -0
- package/dist/chunks/client-7lIxWcaM.js +1 -0
- package/dist/chunks/client-B-2ccQZk.js +1 -0
- package/dist/chunks/{client-DFlE4fYh.js → client-BMA05FW8.js} +1 -1
- package/dist/chunks/commands-D_-v6_A0.js +1 -0
- package/dist/chunks/compact-kM0ETtB2.js +2 -0
- package/dist/chunks/config-9rLTDOYW.js +3 -0
- package/dist/chunks/config-Crf6Mzu3.js +1 -0
- package/dist/chunks/{config-CVHMRMwd.js → config-DMKtiMzJ.js} +1 -1
- package/dist/chunks/context-BY5oO5is.js +1 -0
- package/dist/chunks/{context-noninteractive-D5iQhasu.js → context-noninteractive-mAQt1p9l.js} +5 -5
- package/dist/chunks/context-noninteractive-tc4KTYfI.js +1 -0
- package/dist/chunks/conversation-CFIn-KsW.js +1 -0
- package/dist/chunks/conversation-DPI7VKBL.js +1 -0
- package/dist/chunks/createSSHSession-DjLSGm-0.js +6 -0
- package/dist/chunks/createSession-CftIZ3aq.js +1 -0
- package/dist/chunks/createSession-CjdLcRec.js +1 -0
- package/dist/chunks/crossProjectResume-BJqXBzkf.js +40 -0
- package/dist/chunks/{cwd-Cfdf7z7s.js → cwd-Besi3Os3.js} +1 -1
- package/dist/chunks/cwd-DpqwaYHw.js +1 -0
- package/dist/chunks/datadog-BGati3aQ.js +1 -0
- package/dist/chunks/debug-Dr1SjdXn.js +39 -0
- package/dist/chunks/{debugUtils-DX0KAXNK.js → debugUtils-cK-iOsEV.js} +1 -1
- package/dist/chunks/detached-CqfQYVOi.js +5 -0
- package/dist/chunks/detectRepository-BsKZDRoI.js +1 -0
- package/dist/chunks/detectRepository-CMEkS5_2.js +1 -0
- package/dist/chunks/{diff-jEJJe58I.js → diff-1HsxKGBh.js} +1 -1
- package/dist/chunks/{directoryCompletion-BbXR2bfy.js → directoryCompletion-ByBTSuLu.js} +1 -1
- package/dist/chunks/doctor-CJfvt9zR.js +1 -0
- package/dist/chunks/entry-CrZCZQQC.js +14 -0
- package/dist/chunks/{envUtils-BDhHQY0-.js → envUtils-DcaKZlRU.js} +1 -1
- package/dist/chunks/{esm-Cf4nSRjF.js → esm-BkOWaWVb.js} +1 -1
- package/dist/chunks/{execFileNoThrow-Dwu6psHW.js → execFileNoThrow-mXq4K0rl.js} +2 -2
- package/dist/chunks/execSyncWrapper-Ne33rRiD.js +1 -0
- package/dist/chunks/exit-B8MA4Ltm.js +1 -0
- package/dist/chunks/{extraUsage-Mi66JwFZ.js → extraUsage-0pUcYexI.js} +1 -1
- package/dist/chunks/extractMemories-DqhN0lba.js +1 -0
- package/dist/chunks/fast-DT5WDe3L.js +1 -0
- package/dist/chunks/{fast-BU4iUZ8E.js → fast-VOu2FUlV.js} +1 -1
- package/dist/chunks/{fileSuggestions-BMfQIDdW.js → fileSuggestions-Be-pyLLq.js} +3 -3
- package/dist/chunks/firstPartyEventLogger-B8RVGBQB.js +1 -0
- package/dist/chunks/{firstPartyEventLogger-B3cXgR67.js → firstPartyEventLogger-aFhcruXA.js} +2 -2
- package/dist/chunks/{flushGate-DgSDVGKZ.js → flushGate-BUSrMj_6.js} +1 -1
- package/dist/chunks/gemini-DB4M-MYv.js +1 -0
- package/dist/chunks/generateSessionName-DhCypqJ_.js +1 -0
- package/dist/chunks/{genericProcessUtils-CmsUPyRz.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
- package/dist/chunks/git-Bs1vtuvX.js +1 -0
- package/dist/chunks/git-CoQQ6YEf.js +6 -0
- package/dist/chunks/githubRepoPathMapping-CmpEaQoo.js +1 -0
- package/dist/chunks/goal-TxXtfkQ6.js +3 -0
- package/dist/chunks/{grok-BXMvezWb.js → grok-D2a_J5wE.js} +1 -1
- package/dist/chunks/{grove-CeOjTaY6.js → grove-BnzBbGsX.js} +1 -1
- package/dist/chunks/{help-5DNZO6_H.js → help-C5ankDi4.js} +1 -1
- package/dist/chunks/{hooks-C637tFtd.js → hooks-BZS105Rd.js} +3 -3
- package/dist/chunks/hooks-D-twhU_z.js +1 -0
- package/dist/chunks/{initReplBridge-D1h10vQ9.js → initReplBridge-DL4klK0C.js} +1 -1
- package/dist/chunks/{install-C-6ItpH0.js → install-NZvHd_40.js} +1 -1
- package/dist/chunks/{instrumentation-DaiPDUst.js → instrumentation-CjBlVlFq.js} +5 -5
- package/dist/chunks/{job-BeYzQUiR.js → job-D502Zf8J.js} +1 -1
- package/dist/chunks/jwtUtils-FQWtM6iM.js +1 -0
- package/dist/chunks/keybindings-D9Boc8FD.js +2 -0
- package/dist/chunks/{launchLocalMemory-CE4J98xO.js → launchLocalMemory-DxC3LojF.js} +2 -2
- package/dist/chunks/{launchOnboarding-BfTdC6vp.js → launchOnboarding-BLp5k_H4.js} +1 -1
- package/dist/chunks/{loadAgentsDir-C7lOqvfh.js → loadAgentsDir-BXtV2jiO.js} +563 -570
- package/dist/chunks/loadAgentsDir-BjsAQWqt.js +1 -0
- package/dist/chunks/loadPluginHooks-Dt3XQ-3N.js +1 -0
- package/dist/chunks/{localSearch-BKrznW5x.js → localSearch-CeP4ef0a.js} +1 -1
- package/dist/chunks/localSearch-Cz8Ot7k2.js +1 -0
- package/dist/chunks/{log-CezCRpAN.js → log-27kCA_9u.js} +1 -1
- package/dist/chunks/{logoV2Utils-BkQfyQ1-.js → logoV2Utils-CEnU8qad.js} +1 -1
- package/dist/chunks/{magicDocs-BpVcON9o.js → magicDocs-YtfrqVC6.js} +4 -4
- package/dist/chunks/main-CGLCy2pM.js +31 -0
- package/dist/chunks/main-CkjTzYj1.js +513 -0
- package/dist/chunks/{managedEnv-DhWRJ5DK.js → managedEnv-B-BNY0xC.js} +1 -1
- package/dist/chunks/managedEnv-K9Si1UuL.js +1 -0
- package/dist/chunks/{mappers-bOab8ipV.js → mappers-IuJeXgvr.js} +1 -1
- package/dist/chunks/mcp-DMBoeQzm.js +6 -0
- package/dist/chunks/mcp-TMOPfLcW.js +1 -0
- package/dist/chunks/mcp-x5rgv-uv.js +2 -0
- package/dist/chunks/{memoize-DsqYrbeR.js → memoize-Co4vS6UF.js} +1 -1
- package/dist/chunks/memory-DDUoR63T.js +1 -0
- package/dist/chunks/{mode-DlKnUM8l.js → mode-GzBwK--u.js} +2 -2
- package/dist/chunks/model-BydaMaPr.js +1 -0
- package/dist/chunks/model-CDnVaVDR.js +1 -0
- package/dist/chunks/model-CIvbC7rW.js +1 -0
- package/dist/chunks/{modelOptions-CxP067Qv.js → modelOptions-ut0xePEe.js} +1 -1
- package/dist/chunks/nativeInstaller-fgCMR_c0.js +1 -0
- package/dist/chunks/oauth-D38aRTUb.js +1 -0
- package/dist/chunks/oauth-U649LV5H.js +1 -0
- package/dist/chunks/{observationStore-BpjlK0pG.js → observationStore-D0rm3GhP.js} +1 -1
- package/dist/chunks/omit-D4Udf-p-.js +1 -0
- package/dist/chunks/onChangeAppState-WbvtqDtk.js +1 -0
- package/dist/chunks/{openai-B9C2XN5Q.js → openai-DaVFXyBB.js} +3 -3
- package/dist/chunks/panel-CoF2a-h4.js +1 -0
- package/dist/chunks/parser-B2PlJg4C.js +1 -0
- package/dist/chunks/{parser-BwPXQomy.js → parser-CUUiH40T.js} +1 -1
- package/dist/chunks/{partition-D-UhsUCx.js → partition-CzW_31Y1.js} +1 -1
- package/dist/chunks/permissions-BT3lxYBM.js +3 -0
- package/dist/chunks/pidLock-d1VPd6CG.js +3 -0
- package/dist/chunks/{plan-CyU2zrCK.js → plan-M9DG3AqN.js} +1 -1
- package/dist/chunks/{platform-BMPbglug.js → platform-Dg1c9F_1.js} +1 -1
- package/dist/chunks/plugin-BiNHuq3h.js +17 -0
- package/dist/chunks/pluginAutoupdate-B5lel6s5.js +1 -0
- package/dist/chunks/pluginBlocklist-CNGmIlwU.js +1 -0
- package/dist/chunks/pluginCliCommands-WLOEhb2M.js +1 -0
- package/dist/chunks/pluginFlagging-CXSSOj4J.js +1 -0
- package/dist/chunks/pluginOperations-BFbty6WT.js +2 -0
- package/dist/chunks/pluginStartupCheck-BEd0VeQC.js +1 -0
- package/dist/chunks/pluginStartupCheck-Bcdxg484.js +1 -0
- package/dist/chunks/plugins-BMZ3aYKP.js +4 -0
- package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
- package/dist/chunks/{poorMode-DEwQOAJt.js → poorMode-DxgO_bUb.js} +1 -1
- package/dist/chunks/print-DmoLcwVq.js +26 -0
- package/dist/chunks/processBashCommand-B-VqME9O.js +1 -0
- package/dist/chunks/processSlashCommand-D6zEooTy.js +5 -0
- package/dist/chunks/{projectContext-CIxul6vA.js → projectContext-BN2ZWzOG.js} +1 -1
- package/dist/chunks/{projectContext-RUMJB798.js → projectContext-Bw3o5BrN.js} +1 -1
- package/dist/chunks/prompt-C3RRe4kW.js +1 -0
- package/dist/chunks/{prompt-M2lu8_Oa.js → prompt-CRc2QEZ5.js} +5 -5
- package/dist/chunks/prompt-EtAanewG.js +1 -0
- package/dist/chunks/{promptEditor-DhcZY-iu.js → promptEditor-Bo1d8ZLq.js} +2 -2
- package/dist/chunks/{protocolHandler-CkFaJKKo.js → protocolHandler-B83fCYI4.js} +4 -4
- package/dist/chunks/{proxy-CuMaO_YV.js → proxy-BEKNaTXI.js} +3 -3
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
- package/dist/chunks/reconciler-BGav_ezX.js +1 -0
- package/dist/chunks/refresh-DumNiLvM.js +1 -0
- package/dist/chunks/{registerProtocol-CsNYRZKr.js → registerProtocol-DduKPsn_.js} +2 -2
- package/dist/chunks/{reload-plugins-B7JAE3b4.js → reload-plugins-DNEgQ5vo.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CFLJhsB6.js → remoteBridgeCore-BGOqHADF.js} +1 -1
- package/dist/chunks/remoteManagedSettings-26nhzuca.js +1 -0
- package/dist/chunks/{rename-BCp2Vtqu.js → rename-BPknfVGF.js} +1 -1
- package/dist/chunks/{renderOptions-Q5oCLFIC.js → renderOptions-45A-EdsK.js} +1 -1
- package/dist/chunks/resume-DGz04xDh.js +2 -0
- package/dist/chunks/ripgrep-BLQnqPnE.js +1 -0
- package/dist/chunks/{ripgrep-DvOOsDMv.js → ripgrep-DQ_ILUJV.js} +5 -5
- package/dist/chunks/{runtimeObserver-CS_3BDNo.js → runtimeObserver-BZrF3GnQ.js} +4 -4
- package/dist/chunks/{runtimeObserver-DYUva6g-.js → runtimeObserver-CBV-7-w7.js} +1 -1
- package/dist/chunks/sandbox-adapter-DUqeqkQD.js +1 -0
- package/dist/chunks/sandbox-toggle-D61gVqcT.js +1 -0
- package/dist/chunks/searchExtraTools-CgsV6kb1.js +1 -0
- package/dist/chunks/{session-CO3gEqQP.js → session-Dy-_R7KP.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-BJlrZaRD.js +1 -0
- package/dist/chunks/sessionObserver-BGYoLRGx.js +1 -0
- package/dist/chunks/{sessionObserver-YkRHC-Aa.js → sessionObserver-CyLpHSkw.js} +1 -1
- package/dist/chunks/{sessionState-Bifmu95-.js → sessionState-DSWN4tMV.js} +2 -2
- package/dist/chunks/sessionStorage-zJ1esSCE.js +1 -0
- package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
- package/dist/chunks/{sessionTitle-COBSgSXS.js → sessionTitle-L5tyJgdU.js} +2 -2
- package/dist/chunks/{sessionTracing-BrNx1k2V.js → sessionTracing-DpHGGIZm.js} +3 -3
- package/dist/chunks/settings-3ionQKNv.js +1 -0
- package/dist/chunks/settings-DiBMs2gM.js +20 -0
- package/dist/chunks/settingsSync-dBqlrbcU.js +1 -0
- package/dist/chunks/setup-zf3v3ICe.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DEaw-X5j.js → shadowedRuleDetection-DZ0AA2Rw.js} +1 -1
- package/dist/chunks/{shellQuote-BYeOv3Ip.js → shellQuote-C_I6DHLV.js} +2 -2
- package/dist/chunks/{sideQuestion-D0OKljee.js → sideQuestion-BYT8FdPF.js} +2 -2
- package/dist/chunks/sinks-DppGvgz1.js +1 -0
- package/dist/chunks/sinks-mFsijQ_S.js +2 -0
- package/dist/chunks/skillChangeDetector-D-iq09Xs.js +1 -0
- package/dist/chunks/{skillGapStore-N_kmvXML.js → skillGapStore-DQXHqoP7.js} +2 -2
- package/dist/chunks/{skillLifecycle-C4F5RXuh.js → skillLifecycle-BG_RnGSh.js} +2 -2
- package/dist/chunks/skillSearchPanel-DxYP4Q6R.js +21 -0
- package/dist/chunks/skills-BD-2ofXA.js +1 -0
- package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
- package/dist/chunks/{startupProfiler-L_UWZ03w.js → startupProfiler-Dc5r6LgE.js} +2 -2
- package/dist/chunks/{state-BemZdQIl.js → state-BPFYBqm1.js} +1 -1
- package/dist/chunks/state-CsdHk8n-.js +1 -0
- package/dist/chunks/{stats-IzV0_vEc.js → stats-BkadEKa-.js} +1 -1
- package/dist/chunks/status-BmHu-c7I.js +2 -0
- package/dist/chunks/{status-CeVP_uDT.js → status-CrmnCDIE.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-Bb9gxdSt.js → statusNoticeHelpers-DakAVtQO.js} +1 -1
- package/dist/chunks/{stringUtils-C84IJ91d.js → stringUtils-Df-Lnjxd.js} +1 -1
- package/dist/chunks/{subprocessEnv-Ci8VV_bi.js → subprocessEnv-CNBOhlDV.js} +1 -1
- package/dist/chunks/subprocessEnv-DtBCqQIo.js +1 -0
- package/dist/chunks/switcher-Dm646gO5.js +1 -0
- package/dist/chunks/switcher-sYTxnJQA.js +1 -0
- package/dist/chunks/syncCache-BofuFJEe.js +1 -0
- package/dist/chunks/{tasks-DZDhgx0w.js → tasks-NpI1iEem.js} +1 -1
- package/dist/chunks/teleport-Bs3kEipi.js +1 -0
- package/dist/chunks/{templateJobs-CrNPEKkh.js → templateJobs-C94jEE6O.js} +2 -2
- package/dist/chunks/{terminalSetup-CBqcwQll.js → terminalSetup-CbXKCpWM.js} +1 -1
- package/dist/chunks/{terminalSetup-D-N8YPiQ.js → terminalSetup-fwhFTxGi.js} +4 -4
- package/dist/chunks/{theme-Dazsirbw.js → theme-CEi3b_8f.js} +1 -1
- package/dist/chunks/tmux-d3cNCIZA.js +1 -0
- package/dist/chunks/{toolEventObserver-lnHJ9fLQ.js → toolEventObserver-DlL9CHmI.js} +1 -1
- package/dist/chunks/toolPool-DIT_uhtD.js +1 -0
- package/dist/chunks/trustedDevice-BokywSKL.js +1 -0
- package/dist/chunks/trustedDevice-Bzz03jCy.js +1 -0
- package/dist/chunks/{types-3j8PS-Du.js → types-BJ7qTz75.js} +2 -2
- package/dist/chunks/udsClient-CF8BmZgN.js +1 -0
- package/dist/chunks/{updateCCB-BPe9_FW6.js → updateCCB-CzBxsuJe.js} +1 -1
- package/dist/chunks/{upstreamproxy-DF00RzGG.js → upstreamproxy-BuBFDFAD.js} +2 -2
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js → useExitOnCtrlCDWithKeybindings-BHQfwlAl.js} +1 -1
- package/dist/chunks/useMainLoopModel-BkyIIW9t.js +1 -0
- package/dist/chunks/useManagePlugins-BWROoGDs.js +1 -0
- package/dist/chunks/{useMergedTools-Dk5cPqLc.js → useMergedTools-CHxnwR7R.js} +1 -1
- package/dist/chunks/{useSearchInput-C7Y1I9P9.js → useSearchInput-q2CFPU4W.js} +1 -1
- package/dist/chunks/{useSettingsErrors-DAEO7AyB.js → useSettingsErrors-CPVQbsqq.js} +1 -1
- package/dist/chunks/{userAgent-CIq27vUR.js → userAgent-B7WkjI6I.js} +1 -1
- package/dist/chunks/util-BfqXOA-P.js +1 -0
- package/dist/chunks/{validatePlugin-Kk6pxnO2.js → validatePlugin-jrcrYEIu.js} +1 -1
- package/dist/chunks/{vim-EYQn94Kx.js → vim-C4Hs5U2h.js} +1 -1
- package/dist/chunks/{which-DzFN5TNM.js → which-mplwBbc0.js} +1 -1
- package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
- package/dist/chunks/windowsPaths-C7Mdo9aU.js +1 -0
- package/dist/chunks/{workSecret-DUqdPy44.js → workSecret-XLodD7tw.js} +1 -1
- package/dist/chunks/workerRegistry-Cfo7bKlm.js +6 -0
- package/dist/chunks/worktree-D0k_pCEz.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -3
- package/dist/chunks/App-C2yQjBgY.js +0 -1
- package/dist/chunks/ApproveApiKey-CKbv5C1x.js +0 -1
- package/dist/chunks/ApproveApiKey-MscC-ssL.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CL5NWsFL.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BqNxQOXJ.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C0-psohX.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-4mOvEer_.js +0 -1
- package/dist/chunks/Doctor-DmgAwce2.js +0 -1
- package/dist/chunks/Doctor-jEs9chPk.js +0 -3
- package/dist/chunks/ExitFlow-DVKxFdpX.js +0 -2
- package/dist/chunks/InvalidConfigDialog-o9DF1REI.js +0 -1
- package/dist/chunks/MCPConnectionManager-CUTuaa8T.js +0 -1
- package/dist/chunks/MCPToolListView-CvqB4nCw.js +0 -1
- package/dist/chunks/MessageSelector-BLzw172f.js +0 -3
- package/dist/chunks/Messages-4K5sLmNh.js +0 -11
- package/dist/chunks/Onboarding-ClwHS5rh.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-Bb4KdIX_.js +0 -1
- package/dist/chunks/QueryEngine-DPHLSsax.js +0 -1
- package/dist/chunks/REPL-Bf46iQCN.js +0 -1
- package/dist/chunks/REPL-DIaAo9M9.js +0 -133
- package/dist/chunks/RemoteSessionManager-CS6mywIn.js +0 -2
- package/dist/chunks/ResumeConversation-Br2KsBoe.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-i_YO3QvV.js +0 -1
- package/dist/chunks/Settings-BMXysXIx.js +0 -2
- package/dist/chunks/TrustDialog-Fk4m_Sy4.js +0 -1
- package/dist/chunks/add-dir-CZ6Clvq8.js +0 -1
- package/dist/chunks/agents-DHnNg4h6.js +0 -103
- package/dist/chunks/allErrors-CU89tF-z.js +0 -1
- package/dist/chunks/api-BSeE6MwB.js +0 -1
- package/dist/chunks/auth-BIGJth5U.js +0 -1
- package/dist/chunks/auth-CDQMhIZP.js +0 -1
- package/dist/chunks/autonomy-C1aSgWPQ.js +0 -1
- package/dist/chunks/autonomy-Src6sKCp.js +0 -15
- package/dist/chunks/autonomyPanel-DnHpuiy4.js +0 -1
- package/dist/chunks/backgroundHousekeeping-B-cw0UcS.js +0 -17
- package/dist/chunks/backgroundHousekeeping-BS_8z3_x.js +0 -1
- package/dist/chunks/bg-50rllUNh.js +0 -1
- package/dist/chunks/bg-DAPORXF3.js +0 -9
- package/dist/chunks/bridgeConfig-BeqChxJC.js +0 -1
- package/dist/chunks/caches-BTQAW9zc.js +0 -1
- package/dist/chunks/caches-BVtSCnV1.js +0 -1
- package/dist/chunks/ccrClient-Bu7Tf1Z5.js +0 -1
- package/dist/chunks/cliLaunch-BWcoyZDP.js +0 -1
- package/dist/chunks/client-BWQ4-rN7.js +0 -1
- package/dist/chunks/client-c-3-PW1F.js +0 -1
- package/dist/chunks/commands-Bi7k3Wg-.js +0 -1
- package/dist/chunks/compact-J-h0Yf4b.js +0 -2
- package/dist/chunks/config-Do1870_d.js +0 -3
- package/dist/chunks/config-yyFe87vW.js +0 -1
- package/dist/chunks/context-Tb1Ca2Q-.js +0 -1
- package/dist/chunks/context-noninteractive-soPYKAc9.js +0 -1
- package/dist/chunks/conversation-CSEtUxOY.js +0 -1
- package/dist/chunks/conversation-Dk1WDQuN.js +0 -1
- package/dist/chunks/createSSHSession-CJtzNQdZ.js +0 -6
- package/dist/chunks/createSession-DkT1GL8y.js +0 -1
- package/dist/chunks/createSession-eE8mswkv.js +0 -1
- package/dist/chunks/crossProjectResume-04n3Ppy9.js +0 -40
- package/dist/chunks/cwd-ClLru_7T.js +0 -1
- package/dist/chunks/datadog-DjeJThpV.js +0 -1
- package/dist/chunks/debug-RAynG_nM.js +0 -39
- package/dist/chunks/detached-X_yjYR7x.js +0 -5
- package/dist/chunks/detectRepository-DgpNd87p.js +0 -1
- package/dist/chunks/detectRepository-ctF9KDbb.js +0 -1
- package/dist/chunks/doctor-B-Wag4C1.js +0 -1
- package/dist/chunks/entry-oIqjxIjQ.js +0 -14
- package/dist/chunks/execSyncWrapper-BTZJjCuv.js +0 -1
- package/dist/chunks/exit-BtW7LfRX.js +0 -1
- package/dist/chunks/extractMemories-CUrdiNcr.js +0 -1
- package/dist/chunks/fast-C60p6AqJ.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BfCYN7lt.js +0 -1
- package/dist/chunks/gemini-BwvSxGgn.js +0 -1
- package/dist/chunks/generateSessionName-DlrdedOk.js +0 -1
- package/dist/chunks/git-2c7WlGDL.js +0 -6
- package/dist/chunks/git-XtKbtJMc.js +0 -1
- package/dist/chunks/githubRepoPathMapping-DbWG4hFQ.js +0 -1
- package/dist/chunks/goal-ZmSRBx4q.js +0 -3
- package/dist/chunks/hooks-DWg07LmS.js +0 -1
- package/dist/chunks/jwtUtils-CUPXdX3W.js +0 -1
- package/dist/chunks/keybindings-DgIPdBy9.js +0 -2
- package/dist/chunks/loadAgentsDir-zikjxLvn.js +0 -1
- package/dist/chunks/loadPluginHooks-Cp8MSwAc.js +0 -1
- package/dist/chunks/localSearch-ZFyFy5FN.js +0 -1
- package/dist/chunks/main-9r5gLzUW.js +0 -605
- package/dist/chunks/main-CvOv59-7.js +0 -31
- package/dist/chunks/managedEnv-B61yLpwp.js +0 -1
- package/dist/chunks/mcp-BckPBjaM.js +0 -6
- package/dist/chunks/mcp-CS1DA3JL.js +0 -1
- package/dist/chunks/mcp-VcGPYCkW.js +0 -2
- package/dist/chunks/memory-C5ohwh-T.js +0 -1
- package/dist/chunks/model-BGu1AGq0.js +0 -1
- package/dist/chunks/model-BsZ4sP_H.js +0 -1
- package/dist/chunks/model-D19IIcll.js +0 -1
- package/dist/chunks/nativeInstaller-QB8cEJ18.js +0 -1
- package/dist/chunks/oauth-BN2I0_jl.js +0 -1
- package/dist/chunks/oauth-C9VBDB0Y.js +0 -1
- package/dist/chunks/omit-DDUIPHnl.js +0 -1
- package/dist/chunks/onChangeAppState-RBl6H7ho.js +0 -1
- package/dist/chunks/panel-KW-wmEvU.js +0 -1
- package/dist/chunks/parser-xSBaQRLH.js +0 -1
- package/dist/chunks/permissions-BoLXYN1j.js +0 -3
- package/dist/chunks/pidLock-nJHbufJN.js +0 -3
- package/dist/chunks/plugin-C6-GQke5.js +0 -17
- package/dist/chunks/pluginAutoupdate-SlRFJlTT.js +0 -1
- package/dist/chunks/pluginBlocklist-n6Imlh3y.js +0 -1
- package/dist/chunks/pluginCliCommands-Bd96zSOQ.js +0 -1
- package/dist/chunks/pluginFlagging-DZaYzecY.js +0 -1
- package/dist/chunks/pluginOperations-D90IRawu.js +0 -2
- package/dist/chunks/pluginStartupCheck-Bxkxpm4k.js +0 -1
- package/dist/chunks/pluginStartupCheck-CB2q2dLv.js +0 -1
- package/dist/chunks/plugins-B9eSjLSA.js +0 -4
- package/dist/chunks/poorMode-BAnubpn1.js +0 -1
- package/dist/chunks/print-eCRv_Li-.js +0 -26
- package/dist/chunks/processBashCommand-B5F2Cl7K.js +0 -1
- package/dist/chunks/processSlashCommand-BC_D3cH5.js +0 -5
- package/dist/chunks/prompt-C1JPqinc.js +0 -1
- package/dist/chunks/prompt-DZhBz_Vu.js +0 -1
- package/dist/chunks/rcDebugLog-CARUIORE.js +0 -1
- package/dist/chunks/reconciler-B4GDm_iC.js +0 -1
- package/dist/chunks/refresh-DBVizOzg.js +0 -1
- package/dist/chunks/remoteManagedSettings-xh_MViZH.js +0 -1
- package/dist/chunks/resume-DVCSzKvv.js +0 -2
- package/dist/chunks/ripgrep-e-iewvTf.js +0 -1
- package/dist/chunks/sandbox-adapter-BFZFHplu.js +0 -1
- package/dist/chunks/sandbox-toggle--zNSKce_.js +0 -1
- package/dist/chunks/searchExtraTools-ui5y2VSE.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-CZvCqQJ6.js +0 -1
- package/dist/chunks/sessionObserver-Ba7um95p.js +0 -1
- package/dist/chunks/sessionStorage-CedwLLQs.js +0 -1
- package/dist/chunks/settings-DkDH7WQT.js +0 -1
- package/dist/chunks/settings-DnptdP79.js +0 -20
- package/dist/chunks/settingsSync-PmU7SmkU.js +0 -1
- package/dist/chunks/setup-BEsBuzsk.js +0 -3
- package/dist/chunks/sinks-BJHgxz6Y.js +0 -1
- package/dist/chunks/sinks-D5-yhcgU.js +0 -2
- package/dist/chunks/skillChangeDetector-Dd0WPdkO.js +0 -1
- package/dist/chunks/skillSearchPanel-CftorvAM.js +0 -21
- package/dist/chunks/skills-C4CTRN9o.js +0 -1
- package/dist/chunks/startupProfiler-D4FBdEQr.js +0 -1
- package/dist/chunks/state-BAGmpVBn.js +0 -1
- package/dist/chunks/state-D_lk6z-C.js +0 -1
- package/dist/chunks/status-Dzuw3hBv.js +0 -2
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
- package/dist/chunks/switcher-4KzBvuKH.js +0 -1
- package/dist/chunks/switcher-CCs9xl1z.js +0 -1
- package/dist/chunks/syncCache-CBRiRU5x.js +0 -1
- package/dist/chunks/teleport-Bw0jSxe9.js +0 -1
- package/dist/chunks/tmux-DewYVEBm.js +0 -1
- package/dist/chunks/toolPool-CkXFlqsn.js +0 -1
- package/dist/chunks/trustedDevice-CFf5yaG-.js +0 -1
- package/dist/chunks/trustedDevice-CuwSv8dG.js +0 -1
- package/dist/chunks/udsClient-e9dIkwVA.js +0 -1
- package/dist/chunks/useMainLoopModel-2-eujv0n.js +0 -1
- package/dist/chunks/useManagePlugins-CYBIkaB1.js +0 -1
- package/dist/chunks/util-VO98TdOz.js +0 -1
- package/dist/chunks/windowsPaths-BU3yQWTB.js +0 -1
- package/dist/chunks/windowsPaths-DgZ3YY4a.js +0 -1
- package/dist/chunks/workerRegistry-C07BcZIw.js +0 -6
- package/dist/chunks/worktree-dFUkhVE_.js +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{Bi as n,Cr as r,Db as i,Du as a,Fi as o,Ou as s,Tf as c,U as l,W as u,cr as d,i as f,jb as p,nc as m,nl as h,o as g,rc as _,rl as v,wf as ee}from"./loadAgentsDir-C7lOqvfh.js";import{A as y,C as b,M as x,O as S,P as C,b as w,j as T,l as te,m as E,p as D,v as O,w as k}from"./external-CEp-aPkt.js";import{r as ne}from"./lazySchema-B4D4qJVE.js";import{Bn as re,Wt as A,_r as ie,et as ae,gr as oe,ht as se,or as j}from"./state-BemZdQIl.js";import{f as ce,g as le}from"./settings-DnptdP79.js";import{h as ue,r as de}from"./config-Do1870_d.js";import{l as fe,p as M,r as pe}from"./sessionStoragePortable-JZnGwqUM.js";import{_ as me,u as he}from"./model-BsZ4sP_H.js";import{bn as ge,yn as _e}from"./prompt-M2lu8_Oa.js";import{n as ve,r as ye}from"./managedEnv-DhWRJ5DK.js";import{t as be}from"./QueryEngine-DPHLSsax.js";import{n as xe,t as Se}from"./modelOptions-CxP067Qv.js";import{dirname as Ce}from"node:path";import{randomUUID as N}from"node:crypto";import{Readable as we,Writable as Te}from"node:stream";import{unlink as Ee}from"node:fs/promises";import*as P from"node:path/posix";import{isAbsolute as De,resolve as Oe}from"node:path/posix";ne();var F={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`},I={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`},ke=k({_meta:S(y(),x()).nullish(),terminal:E().optional().default(!1)}),Ae=k({_meta:S(y(),x()).nullish(),label:y().nullish(),name:y(),optional:E().optional().default(!1),secret:E().optional().default(!0)}),je=k({_meta:S(y(),x()).nullish(),description:y().nullish(),id:y(),name:y()}),Me=k({_meta:S(y(),x()).nullish(),description:y().nullish(),id:y(),link:y().nullish(),name:y(),vars:D(Ae)}),Ne=k({_meta:S(y(),x()).nullish(),args:D(y()).optional(),description:y().nullish(),env:S(y(),y()).optional(),id:y(),name:y()}),Pe=T([Me.and(k({type:w(`env_var`)})),Ne.and(k({type:w(`terminal`)})),je]),Fe=k({_meta:S(y(),x()).nullish(),methodId:y()}),Ie=k({_meta:S(y(),x()).nullish()}),Le=k({_meta:S(y(),x()).nullish(),blob:y(),mimeType:y().nullish(),uri:y()}),Re=k({default:E().nullish(),description:y().nullish(),title:y().nullish()}),ze=k({_meta:S(y(),x()).nullish()}),Be=k({_meta:S(y(),x()).nullish()}),Ve=k({amount:b(),currency:y()}),He=k({_meta:S(y(),x()).nullish(),terminalId:y()}),Ue=k({_meta:S(y(),x()).nullish(),newText:y(),oldText:y().nullish(),path:y()}),We=T([y(),b(),b(),E(),D(y())]),Ge=O(T([k({content:S(y(),We).nullish()}).and(k({action:w(`accept`)})),k({action:w(`decline`)}),k({action:w(`cancel`)})]),k({_meta:S(y(),x()).nullish()})),Ke=k({_meta:S(y(),x()).nullish()}),qe=y(),Je=k({_meta:S(y(),x()).nullish(),elicitationId:qe}),Ye=w(`object`),Xe=w(`string`),Ze=k({_meta:S(y(),x()).nullish()}),Qe=k({_meta:S(y(),x()).nullish(),form:Ke.nullish(),url:Ze.nullish()}),$e=k({const:y(),title:y()}),et=k({_meta:S(y(),x()).nullish(),name:y(),value:y()}),tt=k({code:T([w(-32700),w(-32600),w(-32601),w(-32602),w(-32603),w(-32800),w(-32e3),w(-32002),w(-32042),b().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:x().optional(),message:y()}),nt=x(),rt=x(),it=x(),at=k({_meta:S(y(),x()).nullish(),readTextFile:E().optional().default(!1),writeTextFile:E().optional().default(!1)}),ot=k({_meta:S(y(),x()).nullish(),name:y(),value:y()}),st=k({_meta:S(y(),x()).nullish(),name:y(),title:y().nullish(),version:y()}),ct=k({default:b().nullish(),description:y().nullish(),maximum:b().nullish(),minimum:b().nullish(),title:y().nullish()}),lt=k({_meta:S(y(),x()).nullish()}),ut=k({_meta:S(y(),x()).nullish(),additionalDirectories:D(y()).optional(),cursor:y().nullish(),cwd:y().nullish()}),dt=k({_meta:S(y(),x()).nullish()}),ft=k({_meta:S(y(),x()).nullish(),logout:dt.nullish()}),pt=k({_meta:S(y(),x()).nullish()}),mt=k({_meta:S(y(),x()).nullish()}),ht=k({_meta:S(y(),x()).nullish(),http:E().optional().default(!1),sse:E().optional().default(!1)}),gt=k({_meta:S(y(),x()).nullish(),headers:D(ot),name:y(),url:y()}),_t=k({_meta:S(y(),x()).nullish(),headers:D(ot),name:y(),url:y()}),vt=k({_meta:S(y(),x()).nullish(),args:D(y()),command:y(),env:D(et),name:y()}),L=T([gt.and(k({type:w(`http`)})),_t.and(k({type:w(`sse`)})),vt]),yt=y(),bt=k({_meta:S(y(),x()).nullish(),description:y().nullish(),modelId:yt,name:y()}),xt=T([w(`error`),w(`warning`),w(`information`),w(`hint`)]),St=k({_meta:S(y(),x()).nullish()}),Ct=k({_meta:S(y(),x()).nullish()}),wt=k({_meta:S(y(),x()).nullish()}),Tt=k({_meta:S(y(),x()).nullish()}),Et=k({_meta:S(y(),x()).nullish()}),Dt=k({_meta:S(y(),x()).nullish(),maxCount:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Ot=k({diff:y(),uri:y()}),kt=k({endLine:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:y()}),At=k({_meta:S(y(),x()).nullish()}),jt=k({_meta:S(y(),x()).nullish()}),Mt=k({languageId:y(),text:y(),uri:y()}),Nt=k({_meta:S(y(),x()).nullish(),maxCount:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Pt=T([w(`rejected`),w(`ignored`),w(`replaced`),w(`cancelled`)]),Ft=k({excerpts:D(kt),uri:y()}),It=k({_meta:S(y(),x()).nullish()}),Lt=k({_meta:S(y(),x()).nullish()}),Rt=k({name:y(),owner:y(),remoteUrl:y()}),zt=k({_meta:S(y(),x()).nullish()}),Bt=k({_meta:S(y(),x()).nullish(),jump:At.nullish(),rename:Lt.nullish(),searchAndReplace:zt.nullish()}),Vt=k({id:y(),isRegex:E().nullish(),replace:y(),search:y(),uri:y()}),Ht=T([w(`automatic`),w(`diagnostic`),w(`manual`)]),Ut=k({_meta:S(y(),x()).nullish(),maxCount:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Wt=k({_meta:S(y(),x()).nullish(),diagnostics:St.nullish(),editHistory:Dt.nullish(),openFiles:jt.nullish(),recentFiles:Nt.nullish(),relatedSnippets:It.nullish(),userActions:Ut.nullish()}),Gt=k({_meta:S(y(),x()).nullish(),additionalDirectories:D(y()).optional(),cwd:y(),mcpServers:D(L)}),Kt=k({default:b().nullish(),description:y().nullish(),maximum:b().nullish(),minimum:b().nullish(),title:y().nullish()}),qt=y(),Jt=T([w(`allow_once`),w(`allow_always`),w(`reject_once`),w(`reject_always`)]),Yt=k({_meta:S(y(),x()).nullish(),kind:Jt,name:y(),optionId:qt}),Xt=T([w(`high`),w(`medium`),w(`low`)]),Zt=T([w(`pending`),w(`in_progress`),w(`completed`)]),Qt=k({_meta:S(y(),x()).nullish(),content:y(),priority:Xt,status:Zt}),$t=k({_meta:S(y(),x()).nullish(),entries:D(Qt)}),R=k({character:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),en=k({id:y(),position:R,uri:y()}),tn=k({id:y(),newName:y(),position:R,uri:y()}),nn=k({action:y(),position:R,timestampMs:b(),uri:y()}),rn=T([w(`utf-16`),w(`utf-32`),w(`utf-8`)]),an=k({_meta:S(y(),x()).nullish(),auth:ke.optional().default({terminal:!1}),elicitation:Qe.nullish(),fs:at.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Bt.nullish(),positionEncodings:D(rn).optional(),terminal:E().optional().default(!1)}),on=k({_meta:S(y(),x()).nullish(),audio:E().optional().default(!1),embeddedContext:E().optional().default(!1),image:E().optional().default(!1)}),sn=b().int().gte(0).lte(65535),cn=k({_meta:S(y(),x()).nullish(),clientCapabilities:an.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:st.nullish(),protocolVersion:sn}),z=k({end:R,start:R}),ln=k({message:y(),range:z,severity:xt,uri:y()}),un=k({languageId:y(),lastFocusedMs:b().nullish(),uri:y(),visibleRange:z.nullish()}),dn=k({_meta:S(y(),x()).nullish(),diagnostics:D(ln).nullish(),editHistory:D(Ot).nullish(),openFiles:D(un).nullish(),recentFiles:D(Mt).nullish(),relatedSnippets:D(Ft).nullish(),userActions:D(nn).nullish()}),fn=k({newText:y(),range:z}),pn=T([k({cursorPosition:R.nullish(),edits:D(fn),id:y(),uri:y()}).and(k({kind:w(`edit`)})),en.and(k({kind:w(`jump`)})),tn.and(k({kind:w(`rename`)})),Vt.and(k({kind:w(`searchAndReplace`)}))]),mn=k({_meta:S(y(),x()).nullish(),content:y()}),hn=k({_meta:S(y(),x()).nullish()}),B=T([b(),y()]).nullable();k({_meta:S(y(),x()).nullish(),requestId:B});var gn=k({requestId:B}),_n=te([`assistant`,`user`]),V=k({_meta:S(y(),x()).nullish(),audience:D(_n).nullish(),lastModified:y().nullish(),priority:b().nullish()}),vn=k({_meta:S(y(),x()).nullish(),annotations:V.nullish(),data:y(),mimeType:y()}),yn=k({_meta:S(y(),x()).nullish(),annotations:V.nullish(),data:y(),mimeType:y(),uri:y().nullish()}),bn=k({_meta:S(y(),x()).nullish(),annotations:V.nullish(),description:y().nullish(),mimeType:y().nullish(),name:y(),size:b().nullish(),title:y().nullish(),uri:y()}),xn=k({_meta:S(y(),x()).nullish(),optionId:qt}),Sn=T([k({outcome:w(`cancelled`)}),xn.and(k({outcome:w(`selected`)}))]),Cn=k({_meta:S(y(),x()).nullish(),outcome:Sn}),wn=k({_meta:S(y(),x()).nullish()}),Tn=k({_meta:S(y(),x()).nullish()}),En=k({currentValue:E()}),Dn=y(),On=y(),kn=T([w(`mode`),w(`model`),w(`thought_level`),y()]),An=y(),jn=k({_meta:S(y(),x()).nullish(),description:y().nullish(),name:y(),value:An}),Mn=k({_meta:S(y(),x()).nullish(),group:Dn,name:y(),options:D(jn)}),H=O(T([k({currentValue:An,options:T([D(jn),D(Mn)])}).and(k({type:w(`select`)})),En.and(k({type:w(`boolean`)}))]),k({_meta:S(y(),x()).nullish(),category:kn.nullish(),description:y().nullish(),id:On,name:y()})),Nn=k({_meta:S(y(),x()).nullish(),configOptions:D(H)}),Pn=k({_meta:S(y(),x()).nullish()}),U=y(),Fn=k({_meta:S(y(),x()).nullish(),id:y(),sessionId:U}),In=k({_meta:S(y(),x()).nullish(),sessionId:U}),Ln=k({_meta:S(y(),x()).nullish(),sessionId:U}),Rn=k({_meta:S(y(),x()).nullish(),sessionId:U}),zn=k({_meta:S(y(),x()).nullish(),args:D(y()).optional(),command:y(),cwd:y().nullish(),env:D(et).optional(),outputByteLimit:b().nullish(),sessionId:U}),Bn=k({_meta:S(y(),x()).nullish(),sessionId:U,uri:y()}),Vn=k({_meta:S(y(),x()).nullish(),position:R,sessionId:U,uri:y(),version:b(),visibleRange:z}),Hn=k({_meta:S(y(),x()).nullish(),languageId:y(),sessionId:U,text:y(),uri:y(),version:b()}),Un=k({_meta:S(y(),x()).nullish(),sessionId:U,uri:y()}),Wn=k({_meta:S(y(),x()).nullish(),additionalDirectories:D(y()).optional(),cwd:y(),mcpServers:D(L).optional(),sessionId:U}),Gn=k({_meta:S(y(),x()).nullish(),sessionId:U,terminalId:y()}),Kn=k({_meta:S(y(),x()).nullish(),additionalDirectories:D(y()).optional(),cwd:y(),mcpServers:D(L),sessionId:U}),qn=k({_meta:S(y(),x()).nullish(),limit:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:y(),sessionId:U}),Jn=k({_meta:S(y(),x()).nullish(),id:y(),reason:Pt.nullish(),sessionId:U}),Yn=k({_meta:S(y(),x()).nullish(),sessionId:U,terminalId:y()}),Xn=k({_meta:S(y(),x()).nullish(),additionalDirectories:D(y()).optional(),cwd:y(),mcpServers:D(L).optional(),sessionId:U}),Zn=k({_meta:S(y(),x()).nullish(),additionalDirectories:D(y()).optional(),cwd:y(),sessionId:U,title:y().nullish(),updatedAt:y().nullish()}),Qn=k({_meta:S(y(),x()).nullish(),nextCursor:y().nullish(),sessions:D(Zn)}),$n=k({_meta:S(y(),x()).nullish(),title:y().nullish(),updatedAt:y().nullish()}),er=k({_meta:S(y(),x()).nullish()}),W=y(),tr=k({_meta:S(y(),x()).nullish(),currentModeId:W}),nr=k({_meta:S(y(),x()).nullish(),description:y().nullish(),id:W,name:y()}),G=k({_meta:S(y(),x()).nullish(),availableModes:D(nr),currentModeId:W}),K=k({_meta:S(y(),x()).nullish(),availableModels:D(bt),currentModelId:yt}),rr=k({_meta:S(y(),x()).nullish(),configOptions:D(H).nullish(),models:K.nullish(),modes:G.nullish(),sessionId:U}),ir=k({_meta:S(y(),x()).nullish(),configOptions:D(H).nullish(),models:K.nullish(),modes:G.nullish()}),ar=k({_meta:S(y(),x()).nullish(),configOptions:D(H).nullish(),models:K.nullish(),modes:G.nullish(),sessionId:U}),or=k({_meta:S(y(),x()).nullish(),configOptions:D(H).nullish(),models:K.nullish(),modes:G.nullish()}),sr=k({_meta:S(y(),x()).nullish()}),cr=k({_meta:S(y(),x()).nullish(),additionalDirectories:wn.nullish(),close:Tn.nullish(),fork:Pn.nullish(),list:er.nullish(),resume:sr.nullish()}),lr=O(T([k({type:w(`boolean`),value:E()}),k({value:An})]),k({_meta:S(y(),x()).nullish(),configId:On,sessionId:U})),ur=k({_meta:S(y(),x()).nullish(),configOptions:D(H)}),dr=k({_meta:S(y(),x()).nullish(),modeId:W,sessionId:U}),fr=k({_meta:S(y(),x()).nullish()}),pr=k({_meta:S(y(),x()).nullish(),modelId:yt,sessionId:U}),mr=k({_meta:S(y(),x()).nullish()}),hr=k({_meta:S(y(),x()).nullish(),sessionId:U}),gr=T([w(`end_turn`),w(`max_tokens`),w(`max_turn_requests`),w(`refusal`),w(`cancelled`)]),_r=T([w(`email`),w(`uri`),w(`date`),w(`date-time`)]),vr=k({default:y().nullish(),description:y().nullish(),enum:D(y()).nullish(),format:_r.nullish(),maxLength:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:D($e).nullish(),pattern:y().nullish(),title:y().nullish()}),yr=k({_meta:S(y(),x()).nullish(),context:dn.nullish(),position:R,selection:z.nullish(),sessionId:U,triggerKind:Ht,uri:y(),version:b()}),br=k({_meta:S(y(),x()).nullish(),suggestions:D(pn)}),xr=k({_meta:S(y(),x()).nullish(),terminalId:y()}),Sr=k({_meta:S(y(),x()).nullish(),exitCode:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:y().nullish()}),Cr=k({_meta:S(y(),x()).nullish(),sessionId:U,terminalId:y()}),wr=k({_meta:S(y(),x()).nullish(),exitStatus:Sr.nullish(),output:y(),truncated:E()}),Tr=k({_meta:S(y(),x()).nullish(),annotations:V.nullish(),text:y()}),Er=k({range:z.nullish(),text:y()}),Dr=k({_meta:S(y(),x()).nullish(),contentChanges:D(Er),sessionId:U,uri:y(),version:b()});k({method:y(),params:T([In,Hn,Dr,Bn,Un,Vn,Fn,Jn,nt]).nullish()});var Or=T([w(`full`),w(`incremental`)]),kr=k({_meta:S(y(),x()).nullish(),syncKind:Or}),Ar=k({_meta:S(y(),x()).nullish(),didChange:kr.nullish(),didClose:Ct.nullish(),didFocus:wt.nullish(),didOpen:Tt.nullish(),didSave:Et.nullish()}),jr=k({_meta:S(y(),x()).nullish(),document:Ar.nullish()}),Mr=k({_meta:S(y(),x()).nullish(),context:Wt.nullish(),events:jr.nullish()}),Nr=k({_meta:S(y(),x()).nullish(),auth:ft.optional().default({}),loadSession:E().optional().default(!1),mcpCapabilities:ht.optional().default({http:!1,sse:!1}),nes:Mr.nullish(),positionEncoding:rn.nullish(),promptCapabilities:on.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:cr.optional().default({})}),Pr=k({_meta:S(y(),x()).nullish(),agentCapabilities:Nr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:st.nullish(),authMethods:D(Pe).optional().default([]),protocolVersion:sn}),Fr=T([k({_meta:S(y(),x()).nullish(),mimeType:y().nullish(),text:y(),uri:y()}),Le]),Ir=k({_meta:S(y(),x()).nullish(),annotations:V.nullish(),resource:Fr}),Lr=T([Tr.and(k({type:w(`text`)})),yn.and(k({type:w(`image`)})),vn.and(k({type:w(`audio`)})),bn.and(k({type:w(`resource_link`)})),Ir.and(k({type:w(`resource`)}))]),Rr=k({_meta:S(y(),x()).nullish(),content:Lr}),zr=k({_meta:S(y(),x()).nullish(),content:Lr,messageId:y().nullish()}),Br=k({_meta:S(y(),x()).nullish(),messageId:y().nullish(),prompt:D(Lr),sessionId:U}),Vr=k({anyOf:D($e)}),Hr=T([Rr.and(k({type:w(`content`)})),Ue.and(k({type:w(`diff`)})),xr.and(k({type:w(`terminal`)}))]),Ur=y(),Wr=k({sessionId:U,toolCallId:Ur.nullish()}),Gr=O(T([Wr,gn]),k({elicitationId:qe,url:y().url()})),Kr=k({_meta:S(y(),x()).nullish(),line:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:y()}),qr=T([w(`pending`),w(`in_progress`),w(`completed`),w(`failed`)]),Jr=T([w(`read`),w(`edit`),w(`delete`),w(`move`),w(`search`),w(`execute`),w(`think`),w(`fetch`),w(`switch_mode`),w(`other`)]),Yr=k({_meta:S(y(),x()).nullish(),content:D(Hr).optional(),kind:Jr.optional(),locations:D(Kr).optional(),rawInput:x().optional(),rawOutput:x().optional(),status:qr.optional(),title:y(),toolCallId:Ur}),Xr=k({_meta:S(y(),x()).nullish(),content:D(Hr).nullish(),kind:Jr.nullish(),locations:D(Kr).nullish(),rawInput:x().optional(),rawOutput:x().optional(),status:qr.nullish(),title:y().nullish(),toolCallId:Ur}),Zr=k({_meta:S(y(),x()).nullish(),options:D(Yt),sessionId:U,toolCall:Xr}),Qr=k({_meta:S(y(),x()).nullish(),hint:y()}),$r=k({_meta:S(y(),x()).nullish(),description:y(),input:Qr.nullish(),name:y()}),ei=k({_meta:S(y(),x()).nullish(),availableCommands:D($r)}),ti=T([k({enum:D(y()),type:Xe}),Vr]),ni=k({default:D(y()).nullish(),description:y().nullish(),items:ti,maxItems:b().nullish(),minItems:b().nullish(),title:y().nullish()}),ri=T([vr.and(k({type:w(`string`)})),Kt.and(k({type:w(`number`)})),ct.and(k({type:w(`integer`)})),Re.and(k({type:w(`boolean`)})),ni.and(k({type:w(`array`)}))]),ii=k({description:y().nullish(),properties:S(y(),ri).optional().default({}),required:D(y()).nullish(),title:y().nullish(),type:Ye.optional().default(`object`)}),ai=O(T([O(T([Wr,gn]),k({requestedSchema:ii})).and(k({mode:w(`form`)})),Gr.and(k({mode:w(`url`)}))]),k({_meta:S(y(),x()).nullish(),message:y()})),oi=k({cachedReadTokens:b().nullish(),cachedWriteTokens:b().nullish(),inputTokens:b(),outputTokens:b(),thoughtTokens:b().nullish(),totalTokens:b()});T([k({id:B,result:T([Pr,Ie,mt,ar,ir,Qn,rr,or,Be,fr,ur,k({_meta:S(y(),x()).nullish(),stopReason:gr,usage:oi.nullish(),userMessageId:y().nullish()}),mr,hr,br,ze,it])}),k({error:tt,id:B})]);var si=k({_meta:S(y(),x()).nullish(),cost:Ve.nullish(),size:b(),used:b()}),ci=T([zr.and(k({sessionUpdate:w(`user_message_chunk`)})),zr.and(k({sessionUpdate:w(`agent_message_chunk`)})),zr.and(k({sessionUpdate:w(`agent_thought_chunk`)})),Yr.and(k({sessionUpdate:w(`tool_call`)})),Xr.and(k({sessionUpdate:w(`tool_call_update`)})),$t.and(k({sessionUpdate:w(`plan`)})),ei.and(k({sessionUpdate:w(`available_commands_update`)})),tr.and(k({sessionUpdate:w(`current_mode_update`)})),Nn.and(k({sessionUpdate:w(`config_option_update`)})),$n.and(k({sessionUpdate:w(`session_info_update`)})),si.and(k({sessionUpdate:w(`usage_update`)}))]),li=k({_meta:S(y(),x()).nullish(),sessionId:U,update:ci});k({method:y(),params:T([li,Je,nt]).nullish()});var ui=k({_meta:S(y(),x()).nullish(),sessionId:U,terminalId:y()}),di=k({_meta:S(y(),x()).nullish(),exitCode:b().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:y().nullish()}),fi=k({name:y(),uri:y()}),pi=k({_meta:S(y(),x()).nullish(),repository:Rt.nullish(),workspaceFolders:D(fi).nullish(),workspaceUri:y().nullish()});k({id:B,method:y(),params:T([cn,Fe,pt,Gt,Kn,ut,Wn,Xn,Rn,dr,lr,Br,pr,pi,yr,Ln,rt]).nullish()});var mi=k({_meta:S(y(),x()).nullish(),content:y(),path:y(),sessionId:U});k({id:B,method:y(),params:T([mi,qn,Zr,zn,Cr,Yn,ui,Gn,ai,rt]).nullish()}),T([k({id:B,result:T([k({_meta:S(y(),x()).nullish()}),mn,Cn,He,wr,hn,di,lt,Ge,it])}),k({error:tt,id:B})]),e();function hi(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){n+=r.decode();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)}}}let t=n.trim();if(t)try{let n=JSON.parse(t);e.enqueue(n)}catch(e){console.error(`Failed to parse JSON message:`,t,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 gi,_i=class{constructor(e,n){t(this,`connection`,void 0);let r=e(this),i=async(e,t)=>{switch(e){case F.initialize:{let e=cn.parse(t);return r.initialize(e)}case F.session_new:{let e=Gt.parse(t);return r.newSession(e)}case F.session_load:{if(!r.loadSession)throw q.methodNotFound(e);let n=Kn.parse(t);return r.loadSession(n)}case F.session_list:{if(!r.listSessions)throw q.methodNotFound(e);let n=ut.parse(t);return r.listSessions(n)}case F.session_fork:{if(!r.unstable_forkSession)throw q.methodNotFound(e);let n=Wn.parse(t);return r.unstable_forkSession(n)}case F.session_resume:{if(!r.unstable_resumeSession)throw q.methodNotFound(e);let n=Xn.parse(t);return r.unstable_resumeSession(n)}case F.session_close:{if(!r.unstable_closeSession)throw q.methodNotFound(e);let n=Rn.parse(t);return r.unstable_closeSession(n)}case F.session_set_mode:{if(!r.setSessionMode)throw q.methodNotFound(e);let n=dr.parse(t);return await r.setSessionMode(n)??{}}case F.authenticate:{let e=Fe.parse(t);return await r.authenticate(e)??{}}case F.logout:{if(!r.unstable_logout)throw q.methodNotFound(e);let n=pt.parse(t);return await r.unstable_logout(n)??{}}case F.session_prompt:{let e=Br.parse(t);return r.prompt(e)}case F.session_set_model:{if(!r.unstable_setSessionModel)throw q.methodNotFound(e);let n=pr.parse(t);return await r.unstable_setSessionModel(n)??{}}case F.session_set_config_option:{if(!r.setSessionConfigOption)throw q.methodNotFound(e);let n=lr.parse(t);return r.setSessionConfigOption(n)}case F.nes_start:{if(!r.unstable_startNes)throw q.methodNotFound(e);let n=pi.parse(t);return r.unstable_startNes(n)}case F.nes_suggest:{if(!r.unstable_suggestNes)throw q.methodNotFound(e);let n=yr.parse(t);return r.unstable_suggestNes(n)}case F.nes_close:{if(!r.unstable_closeNes)throw q.methodNotFound(e);let n=Ln.parse(t);return await r.unstable_closeNes(n)??{}}default:if(r.extMethod)return r.extMethod(e,t);throw q.methodNotFound(e)}},a=async(e,t)=>{switch(e){case F.session_cancel:{let e=In.parse(t);return r.cancel(e)}case F.document_did_open:{if(!r.unstable_didOpenDocument)return;let e=Hn.parse(t);return r.unstable_didOpenDocument(e)}case F.document_did_change:{if(!r.unstable_didChangeDocument)return;let e=Dr.parse(t);return r.unstable_didChangeDocument(e)}case F.document_did_close:{if(!r.unstable_didCloseDocument)return;let e=Bn.parse(t);return r.unstable_didCloseDocument(e)}case F.document_did_save:{if(!r.unstable_didSaveDocument)return;let e=Un.parse(t);return r.unstable_didSaveDocument(e)}case F.document_did_focus:{if(!r.unstable_didFocusDocument)return;let e=Vn.parse(t);return r.unstable_didFocusDocument(e)}case F.nes_accept:{if(!r.unstable_acceptNes)return;let e=Fn.parse(t);return r.unstable_acceptNes(e)}case F.nes_reject:{if(!r.unstable_rejectNes)return;let e=Jn.parse(t);return r.unstable_rejectNes(e)}default:if(r.extNotification)return r.extNotification(e,t);throw q.methodNotFound(e)}};this.connection=new yi(i,a,n)}async sessionUpdate(e){return await this.connection.sendNotification(I.session_update,e)}async requestPermission(e){return await this.connection.sendRequest(I.session_request_permission,e)}async readTextFile(e){return await this.connection.sendRequest(I.fs_read_text_file,e)}async writeTextFile(e){return await this.connection.sendRequest(I.fs_write_text_file,e)??{}}async createTerminal(e){return new vi((await this.connection.sendRequest(I.terminal_create,e)).terminalId,e.sessionId,this.connection)}async unstable_createElicitation(e){return await this.connection.sendRequest(I.elicitation_create,e)}async unstable_completeElicitation(e){return await this.connection.sendNotification(I.elicitation_complete,e)}async extMethod(e,t){return await this.connection.sendRequest(e,t)}async extNotification(e,t){return await this.connection.sendNotification(e,t)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}};gi=Symbol.asyncDispose;var vi=class{constructor(e,n,r){t(this,`id`,void 0),t(this,`sessionId`,void 0),t(this,`connection`,void 0),this.id=e,this.sessionId=n,this.connection=r}async currentOutput(){return await this.connection.sendRequest(I.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}async waitForExit(){return await this.connection.sendRequest(I.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}async kill(){return await this.connection.sendRequest(I.terminal_kill,{sessionId:this.sessionId,terminalId:this.id})??{}}async release(){return await this.connection.sendRequest(I.terminal_release,{sessionId:this.sessionId,terminalId:this.id})??{}}async[gi](){await this.release()}},yi=class{constructor(e,n,r){t(this,`pendingResponses`,new Map),t(this,`nextRequestId`,0),t(this,`requestHandler`,void 0),t(this,`notificationHandler`,void 0),t(this,`stream`,void 0),t(this,`writeQueue`,Promise.resolve()),t(this,`abortController`,new AbortController),t(this,`closedPromise`,void 0),this.requestHandler=e,this.notificationHandler=n,this.stream=r,this.closedPromise=new Promise(e=>{this.abortController.signal.addEventListener(`abort`,()=>e())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let e=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:t,done:n}=await e.read();if(n)break;if(t)try{this.processMessage(t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&this.sendMessage({jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of this.pendingResponses.values())e.reject(t);this.pendingResponses.clear(),this.abortController.abort(t)}async processMessage(e){if(`method`in e&&`id`in e){let t=await this.tryCallRequestHandler(e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await this.sendMessage({jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await this.tryCallNotificationHandler(e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else`id`in e?this.handleResponse(e):console.error(`Invalid message`,{message:e})}async tryCallRequestHandler(e,t){try{return{result:await this.requestHandler(e,t)??null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof C)return q.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 q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}async tryCallNotificationHandler(e,t){try{return await this.notificationHandler(e,t),{result:null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof C)return q.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 q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}handleResponse(e){let t=this.pendingResponses.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 q(n,r,i))}this.pendingResponses.delete(e.id)}else console.error(`Got response to unknown request`,e.id)}sendRequest(e,t){this.throwIfClosed();let n=this.nextRequestId++,r=new Promise((e,t)=>{this.pendingResponses.set(n,{resolve:e,reject:t})});return r.catch(()=>{}),this.sendMessage({jsonrpc:`2.0`,id:n,method:e,params:t}),r}async sendNotification(e,t){this.throwIfClosed(),await this.sendMessage({jsonrpc:`2.0`,method:e,params:t})}throwIfClosed(){if(this.abortController.signal.aborted)throw this.abortController.signal.reason??Error(`ACP connection closed`)}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let t=this.stream.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{this.close(e)}),this.writeQueue}},q=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}}};oe(),A(),le(),ge(),ue(),p(),v(),_(),n(),u(),g(),ye();function J(e,t){if(e)return t?De(e)?e:Oe(t,e):e}var bi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,xi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Si(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=xi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!bi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Ci(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var wi=256;function Ti(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=wi?t:t.slice(0,wi-1)+`…`}function Ei(e,t){if(!t)return e;let n=P.resolve(t),r=P.resolve(e);return r.startsWith(n+P.sep)||r===n?P.relative(n,r):e}function Di(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}function Y(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 e=i?.command??`Terminal`,t=i?.description;return{title:e,kind:`execute`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Read`:{let e=i?.file_path,t=e??`File`,r=i?.offset,a=i?.limit,o=``;a&&a>0?o=` (${r??1} - ${(r??1)+a-1})`:r&&(o=` (from line ${r})`);let s=t?Ei(t,n):`File`,c=J(e,n);return{title:`Read ${s}${o}`,kind:`read`,locations:c?[{path:c,line:r??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Ei(e,n):void 0,a=J(e,n);return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:a?[{type:`diff`,path:a,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:a?[{path:a}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Ei(e,n):void 0,o=J(e,n);return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:o?[{type:`diff`,path:o,oldText:t||null,newText:r}]:[],locations:o?[{path:o}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,r=J(e,n),a=`Find`;return e&&(a+=` \`${e}\``),t&&(a+=` \`${t}\``),{title:a,kind:`search`,content:[],locations:r?[{path:r}]:[]}}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`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 Oi(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:ki(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function ki(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`resource_link`:{let t=e.uri;return{type:`resource_link`,uri:t,name:e.name??t,mimeType:e.mimeType}}case`resource`:{let t=e.resource;return{type:`resource`,resource:{uri:t?.uri??``,mimeType:t?.mimeType,...typeof t?.text==`string`?{text:t.text}:{},...typeof t?.blob==`string`?{blob:t.blob}:{}}}}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_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(`
|
|
7
|
-
`)||``)}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 Ai(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Oi(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Di(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Di(e.text)}:ki(e,!1)}))}:{};case`Bash`:{let e=``;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(`
|
|
8
|
-
`)}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
9
|
-
`));return 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 Oi(i??``,r)}}function ji(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}function X(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`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:{let e=i.thinking??``;a={sessionUpdate:`agent_thought_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},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:ji(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,status:`in_progress`,rawInput:e,...Y({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Y({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=Ai(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 Mi(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`,...i?.messageId?{messageId:i.messageId}:{},content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:X(s,`assistant`,t,n,r,void 0,i)}function Ni(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?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`content_block_delta`:{let o=a.delta;return o?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function Pi(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function Fi(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=Pi(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}var Ii=console;function Li(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 Ri(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,m=null;try{for(;!r.aborted;){let s=await Li(t,r);if(s.done||r.aborted)break;let h=s.value;if(h==null)continue;let g=h;switch(g.type){case`system`:g.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
10
|
-
|
|
11
|
-
Compacting completed.`}}}));break;case`result`:{let t=g.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=g.modelUsage;if(i&&d){let e=Fi(i,d);e?.contextWindow&&(f=e.contextWindow)}u!==null&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:u,size:f}});let a=g.subtype,o=g.is_error;if(r.aborted){c=`cancelled`;break}switch(a){case`success`:{let e=g.stop_reason;c=e===`max_tokens`?`max_tokens`:e===`refusal`?`refusal`:`end_turn`,o&&(c=`end_turn`);break}case`error_during_execution`:c=g.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=g.parent_tool_use_id;t===null&&m===null&&(m=N());let r=Ni(g,e,i,n,{clientCapabilities:a,cwd:o,messageId:t===null?m??void 0:void 0});for(let e of r)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=g.message,r=g.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;r===null&&(m===null&&(m=N()),s=m);let c=Mi(g,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p,messageId:s});for(let e of c)await n.sessionUpdate(e);r===null&&(m=null);break}case`user`:break;case`progress`:{let t=g.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:`agent_message_chunk`,content:{type:`text`,text:`
|
|
12
|
-
|
|
13
|
-
Compacting completed.`}}});break;default:Ii.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}}async function zi(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){Ii.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;let t=N();await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,...t?{messageId:t}:{},content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=X(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a,messageId:N()});for(let e of t)await n.sessionUpdate(e)}}}function Bi(e,t,n,r,i,a,o,s){return async(n,c,u,d,f,p)=>{let m=Hi(r);if(n.name===`ExitPlanMode`)return Vi(e,t,f,c,m,i,a,o,s);if(p!==void 0)return p;try{let e=await l(n,c,u,d,f);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:f}}let h=Y({name:n.name,id:f,input:c},m,i),g={toolCallId:f,title:h.title,kind:h.kind,status:`pending`,rawInput:c},_=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`},{kind:`reject_always`,name:`Always Reject`,optionId:`reject_always`}];try{let n=await e.requestPermission({sessionId:t,toolCall:g,options:_});if(n.outcome.outcome===`cancelled`)return s?.(),{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`},toolUseID:f};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:c}}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 Vi(e,t,n,r,i,a,o,s,c){let l=[{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&&l.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let u=Y({name:`ExitPlanMode`,id:n,input:r},i,a),d={toolCallId:n,title:u.title,kind:u.kind,status:`pending`,rawInput:r},f=await e.requestPermission({sessionId:t,toolCall:d,options:l});if(f.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(f.outcome.outcome===`selected`&&`optionId`in f.outcome&&f.outcome.optionId!==void 0){let n=f.outcome.optionId;if(l.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 Hi(e){if(!e)return!1;if(e.terminal===!0)return!0;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}me(),xe(),ee(),fe(),e(),s(),r();var Z=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,authMethods:[],agentInfo:{name:`claude-code`,title:`Work Mate`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0,forkSession:!0}},promptCapabilities:{image:!1,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{list:{},resume:{},close:{},delete:{}}}}}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,replay:!1});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){if(e.cursor!==void 0&&e.cursor!==null)throw Error(`Pagination cursor not supported: listSessions returns all results in a single page.`);let t=e.cwd||ae(),n=await pe(t),r=await c({dir:t}),i=[];for(let e of r){if(!e.cwd||await pe(e.cwd)!==n)continue;let t=Ti(e.summary??``);i.push({sessionId:e.sessionId,cwd:e.cwd,...t?{title:t}:{},updatedAt:new Date(e.lastModified).toISOString()})}return{sessions:i}}async unstable_forkSession(e){let{initialMessages:t}=await Ui(e.sessionId),n=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{initialMessages:t});return this.scheduleAvailableCommandsUpdate(n.sessionId),n}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async unstable_deleteSession(e){let t=await M(e.sessionId);if(t)try{await Ee(t.filePath)}catch(e){if(e.code!==`ENOENT`)throw e}return this.sessions.has(e.sessionId)&&await this.teardownSession(e.sessionId),{}}async extMethod(e,t){if(e===`session/delete`){let e=t.sessionId;if(typeof e!=`string`||e.length===0)throw Error(`session/delete requires a non-empty sessionId`);return this.unstable_deleteSession({sessionId:e})}throw q.methodNotFound(e)}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.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId: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 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)}};async function Ui(e){let t;try{let n=await d(e);n&&n.messages.length>0&&(t=a(n.messages))}catch(e){console.error(`[ACP] fork source load failed:`,e)}return{initialMessages:t}}var Wi=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function Gi(e){return Wi.includes(e)}function Ki(e,t,n){if(t){let t=qi(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!Xi())throw Error(`Mode not available: bypassPermissions cannot run as root (start the agent as a non-root user, or set IS_SANDBOX=1).`);return t}return Ji(n)??`default`}function qi(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Si(e,t)}function Ji(e){if(e!=null)try{return Si(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 Yi(e,t){return!!e&&Object.hasOwn(e,t)}function Xi(){return Zi()}function Zi(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid!=`function`||process.getuid()!==0}function Qi(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}))}]}function $i(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(Array.isArray(e.options))for(let n of e.options)n&&typeof n==`object`&&typeof n.value==`string`&&t.push(n.value);else typeof n.value==`string`&&t.push(n.value)}return t}function Q(e){return e.conn}function $(e){return e.clientCapabilities}function ea(e,t,n,r){n===`mode`?t.modes={...t.modes,currentModeId:r}:n===`model`&&(t.models={...t.models,currentModelId:r})}A();function ta(){return ce().permissions?.defaultMode}async function na(e,t={}){de();let n=t.sessionId??N(),r=e.cwd;j(n,se()),re(r);let a=process.cwd(),s=!1;try{process.chdir(r),s=!0}catch{}ie(),ve();try{let a=_e(),s=h(a),c=e._meta,l=Yi(c,`permissionMode`),u=Ki(l?c?.permissionMode:void 0,l,ta()),d=$(this),p=this.conn,g=Bi(p,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,d,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),_=Xi(),v={...m(),toolPermissionContext:{...a,mode:u,isBypassPermissionsModeAvailable:_}},[ee,y]=await Promise.all([o(r),f(r)]);v.agentDefinitions=y;let b=new be({cwd:r,tools:s,commands:ee,mcpClients:[],agents:y.activeAgents,canUseTool:g,getAppState:()=>v,setAppState:e=>{let t=e(v);Object.assign(v,t)},readFileCache:new i(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),x={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.`},..._?[{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`}]},S=Se(),C=he(),w={availableModels:S.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:C};b.setModel(C);let T=Qi(x,w),te={queryEngine:b,cancelled:!1,cancelGeneration:0,cwd:r,modes:x,models:w,configOptions:T,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:d,appState:v,commands:ee,sessionFingerprint:Ci({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,te),{sessionId:n,modes:x,models:w,configOptions:T}}finally{s&&process.chdir(a)}}Object.assign(Z.prototype,{createSession:na}),s(),r(),A(),fe();async function ra(e){let t=e.replay!==!1,n=this.sessions.get(e.sessionId);if(n){if(Ci({cwd:e.cwd,mcpServers:e.mcpServers})===n.sessionFingerprint){let r=await M(e.sessionId,e.cwd);return j(e.sessionId,r?Ce(r.filePath):null),re(e.cwd),t&&await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:n.modes,models:n.models,configOptions:n.configOptions}}await this.teardownSession(e.sessionId)}let r=await M(e.sessionId,e.cwd),i=r?Ce(r.filePath):null;j(e.sessionId,i),re(e.cwd);let o;if(r)try{let t=await d(e.sessionId);t&&t.messages.length>0&&(o=a(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let s=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:o});if(t&&o&&o.length>0){let t=this.sessions.get(e.sessionId);t&&await zi(e.sessionId,o,Q(this),t.toolUseCache,$(this),t.cwd)}return{sessionId:s.sessionId,modes:s.modes,models:s.models,configOptions:s.configOptions}}async function ia(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async function aa(e){try{let t=await d(e.sessionId);if(!t||t.messages.length===0)return;let n=a(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await zi(e.sessionId,n,Q(this),r.toolUseCache,$(this),r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}function oa(e,t){if(!Gi(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 function sa(e,t,n){let r=this.sessions.get(e);r&&(ea(this,r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await Q(this).sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}Object.assign(Z.prototype,{getOrCreateSession:ra,teardownSession:ia,replaySessionHistory:aa,applySessionMode:oa,updateConfigOption:sa});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;if(n&&typeof n.text==`string`)t.push(n.text);else if(n&&typeof n.blob==`string`){let e=typeof n.mimeType==`string`?n.mimeType:`application/octet-stream`,r=typeof n.uri==`string`?n.uri:`(unknown uri)`;t.push(`Embedded resource: ${r} (${e}, base64 blob, ${n.blob.length} chars)`)}}}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`}function ua(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),da(e),n}da(e)}function da(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)}}A();async function fa(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=e.messageId??void 0,r=ca(e.prompt);if(!r.trim())throw Error(`Prompt content is empty`);let i=t.cancelGeneration;if(t.promptRunning){let e=N();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==i)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),j(e.sessionId,se());let i=t.queryEngine.submitMessage(r),{stopReason:a,usage:o}=await Ri(e.sessionId,i,Q(this),t.queryEngine.getAbortSignal(),t.toolUseCache,$(this),t.cwd,()=>t.cancelled);if(t.cancelled)return{stopReason:`cancelled`};if(await ma(this,e.sessionId,r),o){let e={inputTokens:o.inputTokens,outputTokens:o.outputTokens,cachedReadTokens:o.cachedReadTokens,cachedWriteTokens:o.cachedWriteTokens,thoughtTokens:0,totalTokens:o.inputTokens+o.outputTokens+o.cachedReadTokens+o.cachedWriteTokens+0};return{stopReason:a,usage:e,...n?{userMessageId:n}:{},_meta:{claudeCode:{usage:e}}}}return{stopReason:a,...n?{userMessageId:n}:{}}}catch(n){let r=n instanceof Error&&(n.name===`AbortError`||/abort|cancelled|interrupt/i.test(n.message));if(t.cancelled||r)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(await this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=ua(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async function pa(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)}`);let n=t.configOptions.find(t=>t.id===e.configId);if(!n)throw Error(`Unknown config option: ${e.configId}`);if(n.type===`select`){let t=$i(n.options);if(!t.includes(e.value))throw Error(`Invalid value '${e.value}' for config option ${e.configId}; must be one of: ${t.join(`, `)}`)}let r=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,r),await Q(this).sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:r}})):e.configId===`model`&&t.queryEngine.setModel(r),ea(this,t,e.configId,r),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:r}:t),{configOptions:t.configOptions}}async function ma(e,t,n){let r=e.sessions.get(t);if(!r)return;let i=r.toolUseCache;if(i.__sessionInfoTitleSent)return;i.__sessionInfoTitleSent=!0;let a=Ti(n).slice(0,100);try{await Q(e).sessionUpdate({sessionId:t,update:{sessionUpdate:`session_info_update`,...a?{title:a}:{},updatedAt:new Date().toISOString()}})}catch(e){console.error(`[ACP] Failed to send session_info_update:`,e)}}Object.assign(Z.prototype,{prompt:fa,setSessionConfigOption:pa}),ue(),ye();function ha(e,t){let n=we.toWeb(e);return hi(Te.toWeb(t),n)}async function ga(){de(),ve();let e=ha(process.stdin,process.stdout),t,n=new _i(e=>(t=new Z(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{ga as runAcpAgent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{S as t,T as n}from"./debug-RAynG_nM.js";import{execSync as r}from"child_process";function i(e,t){return n`execSync: ${e.slice(0,100)}`,r(e,t)}var a=e((()=>{t()}));export{a as n,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{QT as t,St as n,Tt as r,ZT as i,bc as a,rf as o,tf as s,xc as c}from"./loadAgentsDir-C7lOqvfh.js";import{fi as l}from"./src-P_wYS_NJ2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{n as d,t as f}from"./ExitFlow-DVKxFdpX.js";import{spawnSync as p}from"child_process";function m(){return t(_)??`Goodbye!`}async function h(e){if(c())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=n()!==null;return t?(0,g.jsx)(f,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(m()),await s(0,`prompt_input_exit`),null)}var g,_;e((()=>{i(),l(),d(),a(),o(),r(),g=u(),_=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{h as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Bc as e,Rc as t,Vc as n,zc as r}from"./loadAgentsDir-C7lOqvfh.js";n();export{t as drainPendingExtraction,r as executeExtractMemories,e as initExtractMemories};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./fast-BU4iUZ8E.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./firstPartyEventLogger-B3cXgR67.js";e();export{t as initialize1PEventLogging};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ba as t,Ya as n,ga as r,it as i,qa as a,st as o}from"./loadAgentsDir-C7lOqvfh.js";import{F as s,a as c,l,z as u}from"./debug-RAynG_nM.js";import{a as d,l as f}from"./proxy-CuMaO_YV.js";import{K as p,M as m,W as h,Y as g,Z as _,et as v,q as y}from"./sessionState-Bifmu95-.js";import{n as b,r as x}from"./SSETransport-CoxQ8YpH.js";import{randomUUID as S}from"crypto";function C(){return(process.env.GEMINI_BASE_URL||E).replace(/\/+$/,``)}function w(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*T(e){let t=await(e.fetchOverride??fetch)(`${C()}/${w(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...d({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,D);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${s(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${s(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),u(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,t,i,s,c,u){try{let r=v(c.model),d=n(e,i),f=(await Promise.all(i.map(e=>o(e,{getToolPermissionContext:c.getToolPermissionContext,tools:i,agents:c.agents,allowedAgentTypes:c.allowedAgentTypes,model:c.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:m,systemInstruction:b}=g(d,t),x=y(f),C=p(c.toolChoice),w=T({model:r,signal:s,fetchOverride:c.fetchOverride,body:{contents:m,...b&&{systemInstruction:b},...x.length>0&&{tools:x},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...c.temperatureOverride!==void 0&&{temperature:c.temperatureOverride},...u.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...u.type===`enabled`&&{thinkingBudget:u.budgetTokens}}}}}});l(`[Gemini] Calling model=${r}, messages=${m.length}, tools=${x.length}`);let E=h(w,r),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[_]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:a([t],i,c.agentId)},requestId:void 0,type:`assistant`,uuid:S(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Gemini] Error: ${t}`,{level:`error`}),yield r({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{i(),c(),t(),O(),m()}))();export{k as queryModelGemini};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$ as t,Ba as n,Oa as r,et as i,yv as a}from"./loadAgentsDir-C7lOqvfh.js";import{F as o,a as s,l as c,z as l}from"./debug-RAynG_nM.js";import{s as u,u as d}from"./types-3j8PS-Du.js";import{at as f}from"./sessionState-Bifmu95-.js";import{r as p,t as m}from"./sessionTitle-COBSgSXS.js";async function h(e,t){let n=m(e);if(!n)return null;try{let e=await i({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),a=d(Array.isArray(e.message.content)?r(e.message.content):e.message.content);return a&&typeof a==`object`&&`name`in a&&typeof a.name==`string`?a.name:null}catch(e){return c(`generateSessionName failed: ${o(e)}`,{level:`error`}),null}}var g=e((()=>{t(),s(),l(),u(),n(),p(),a()}));export{g as n,h as t};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{Wt as a,cr as o}from"./state-BemZdQIl.js";import{n as s,t as c}from"./cwd-Cfdf7z7s.js";import{S as ee,a as te,d as l,nt as ne,p as u,rt as re,w as ie}from"./debug-RAynG_nM.js";import{r as ae,t as d}from"./execFileNoThrow-Dwu6psHW.js";import{o as oe}from"./log-CezCRpAN.js";import{n as f,t as se}from"./memoize-DsqYrbeR.js";import{r as ce,t as le}from"./which-DzFN5TNM.js";import{basename as ue,dirname as p,join as m,resolve as h,sep as g}from"path";import{readFileSync as _,realpathSync as v,statSync as y,unwatchFile as b,watchFile as de}from"fs";import{createHash as fe}from"crypto";import{readFile as x,readdir as pe,stat as me}from"fs/promises";function S(e,t,n){let r=he();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=l(),o=ie(i)+`
|
|
2
|
-
`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(p(r)),a.appendFileSync(r,o)}catch{}}}function he(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function ge(e,t,n){let r=Date.now();S(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return S(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw S(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var C=e((()=>{u(),ee()}));async function w(e,t,n,r){try{return _e(await x(m(e,`config`),`utf-8`),t,n,r)}catch{return null}}function _e(e,t,n,r){let i=e.split(`
|
|
3
|
-
`),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=xe(t,a,n);continue}if(!s)continue;let r=ve(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ve(e){let t=0;for(;t<e.length&&Se(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:ye(e,t)}}function ye(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
|
|
4
|
-
`;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=be(n)),n}function be(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function xe(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function Se(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var T=e((()=>{}));function Ce(){N.clear()}async function E(e){let t=h(e??c()),n=N.get(t);if(n!==void 0)return n;let r=V(t);if(!r)return N.set(t,null),null;let i=m(r,`.git`);try{if((await me(i)).isFile()){let e=(await x(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=h(r,e.slice(7).trim());return N.set(t,n),n}}return N.set(t,i),i}catch{return N.set(t,null),null}}function D(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function O(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function k(e){try{let t=(await x(m(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return D(e)?{type:`branch`,name:e}:null}if(!D(n))return null;let r=await A(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return O(t)?{type:`detached`,sha:t}:null}catch{return null}}async function A(e,t){let n=await j(e,t);if(n)return n;let r=await M(e);return r&&r!==e?j(r,t):null}async function j(e,t){try{let n=(await x(m(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return D(t)?A(e,t):null}return O(n)?n:null}catch{}try{let n=await x(m(e,`packed-refs`),`utf-8`);for(let e of n.split(`
|
|
5
|
-
`)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return O(t)?t:null}}}catch{}return null}async function M(e){try{return h(e,(await x(m(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function we(e,t,n){try{let r=(await x(m(e,t),`utf-8`)).trim();if(r.startsWith(`ref:`)){let e=r.slice(4).trim();if(e.startsWith(n)){let t=e.slice(n.length);return D(t)?t:null}}}catch{}return null}async function Te(){let e=await E();if(!e)return`HEAD`;let t=await k(e);return t&&t.type===`branch`?t.name:`HEAD`}async function Ee(){let e=await E();if(!e)return null;let t=await w(e,`remote`,`origin`,`url`);if(t)return t;let n=await M(e);return n&&n!==e?w(n,`remote`,`origin`,`url`):null}async function De(){let e=await E();if(!e)return`main`;let t=await M(e)??e,n=await we(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await A(t,`refs/remotes/origin/${e}`))return e;return`main`}function Oe(){return I.get(`branch`,Te)}function ke(){return I.get(`remoteUrl`,Ee)}function Ae(){return I.get(`defaultBranch`,De)}async function je(e){let t=await E(e);if(!t)return null;let n=await k(t);return n?n.type===`branch`?A(t,`refs/heads/${n.name}`):n.sha:null}async function Me(e){let t;try{let n=(await x(m(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=h(e,n.slice(7).trim())}catch{return null}let n=await k(t);return n?n.type===`branch`?A(t,`refs/heads/${n.name}`):n.sha:null}async function Ne(e){let t=await E(e);if(!t)return null;let n=await w(t,`remote`,`origin`,`url`);if(n)return n;let r=await M(t);return r&&r!==t?w(r,`remote`,`origin`,`url`):null}async function Pe(){try{let e=await E();return e?(await pe(m(await M(e)??e,`worktrees`))).length+1:0}catch{return 1}}var N,P,F,I,L=e((()=>{a(),ne(),s(),$(),T(),r(),N=new Map,P=1e3,F=class{constructor(){i(this,`gitDir`,null),i(this,`commonDir`,null),i(this,`initialized`,!1),i(this,`initPromise`,null),i(this,`watchedPaths`,[]),i(this,`branchRefPath`,null),i(this,`cache`,new Map)}async ensureStarted(){if(!this.initialized)return this.initPromise||(this.initPromise=this.start()),this.initPromise}async start(){this.gitDir=await E(),this.initialized=!0,this.gitDir&&(this.commonDir=await M(this.gitDir),this.watchPath(m(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(m(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),re(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),de(e,{interval:P},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await k(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?m(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(b(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter(e=>e!==this.branchRefPath)),this.branchRefPath=n,n&&this.watchPath(n,()=>{this.invalidate()}))}async onHeadChanged(){this.invalidate(),await o(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)b(e);this.watchedPaths=[],this.branchRefPath=null}async get(e,t){await this.ensureStarted();let n=this.cache.get(e);if(n&&!n.dirty)return n.value;n&&(n.dirty=!1);let r=await t(),i=this.cache.get(e);return i&&!i.dirty&&(i.value=r),i||this.cache.set(e,{value:r,dirty:!1,compute:t}),r}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}},I=new F}));function Fe(){function e(e){let t=B(e);return t===z?null:t}return e.cache=B.cache,e}function Ie(){function e(e){let t=V(e);return t?H(t):null}return e.cache=H.cache,e}function Le(e){return E(e)}function R(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n&&n[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r&&r[1]&&r[2]){let e=r[1],t=r[2];if(ze(e)&&t.startsWith(`git/`)){let e=t.slice(4),n=e.split(`/`);return n.length>=3&&n[0].includes(`.`)?e.toLowerCase():`github.com/${e}`.toLowerCase()}return`${e}/${t}`.toLowerCase()}return null}async function Re(){let e=await Y();if(!e)return null;let t=R(e);return t?fe(`sha256`).update(t).digest(`hex`).substring(0,16):null}function ze(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Be(){let e=l(),t=c(),n=m(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=m(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(m(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(m(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(m(t,`refs`)).isDirectory())return!0}catch{}return!1}var z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q,Ve,$=e((()=>{n(),s(),te(),C(),ae(),u(),L(),oe(),se(),le(),z=Symbol(`git-root-not-found`),B=f(e=>{let t=Date.now();S(`info`,`find_git_root_started`);let n=h(e),r=n.substring(0,n.indexOf(g)+1)||g,i=0;for(;n!==r;){try{let e=m(n,`.git`);i++;let r=y(e);if(r.isDirectory()||r.isFile())return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=p(n);if(e===n)break;n=e}try{let e=m(r,`.git`);i++;let n=y(e);if(n.isDirectory()||n.isFile())return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),z},e=>e,50),V=Fe(),H=f(e=>{try{let t=_(m(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=h(e,t.slice(7).trim()),r=h(n,_(m(n,`commondir`),`utf-8`).trim());return h(p(n))!==m(r,`worktrees`)||v(_(m(n,`gitdir`),`utf-8`).trim())!==m(v(e),`.git`)?e:ue(r)===`.git`?p(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),U=Ie(),W=t(()=>ce(`git`)||`git`),G=t(async()=>{let e=Date.now();S(`info`,`is_git_check_started`);let t=V(c())!==null;return S(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),K=async e=>V(e)!==null,q=async()=>Oe(),J=async()=>Ae(),Y=async()=>ke(),X=async e=>{let t=[`--no-optional-locks`,`status`,`--porcelain`];e?.ignoreUntracked&&t.push(`-uno`);let{stdout:n}=await d(W(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await d(W(),[`--no-optional-locks`,`status`,`--porcelain`],{preserveOutputOnError:!1}),t=[],n=[];return e.trim().split(`
|
|
6
|
-
`).filter(e=>e.length>0).forEach(e=>{let r=e.substring(0,2),i=e.substring(2).trim();r===`??`?n.push(i):i&&t.push(i)}),{tracked:t,untracked:n}},Q=async()=>Pe(),Ve=async e=>{try{let t=e||`Work Mate auto-stash - ${new Date().toISOString()}`,{untracked:n}=await Z();if(n.length>0){let{code:e}=await d(W(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await d(W(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{ge as A,Me as C,w as D,T as E,C as O,L as S,A as T,Ve as _,J as a,je as b,X as c,Re as d,Q as f,R as g,Be as h,q as i,S as k,G as l,$ as m,U as n,Z as o,W as p,V as r,Le as s,K as t,Y as u,Ce as v,E as w,Ne as x,M as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,m as n,r,u as i}from"./git-2c7WlGDL.js";n();export{r as findGitRoot,t as getBranch,e as getDefaultBranch,i as getRemoteUrl};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wt as e,et as t}from"./state-BemZdQIl.js";import{a as n,l as r}from"./debug-RAynG_nM.js";import{Cn as i,On as a}from"./settings-DnptdP79.js";import{c as o,h as s,y as c}from"./config-Do1870_d.js";import{S as l,m as u,r as d,x as f}from"./git-2c7WlGDL.js";import{a as p,i as m,n as h}from"./detectRepository-DgpNd87p.js";import{realpath as g}from"fs/promises";e(),s(),n(),m(),i(),l(),u();async function _(){try{let e=await h();if(!e){r(`Not in a GitHub repository, skipping path mapping update`);return}let n=t(),i=d(n)??n,a;try{a=(await g(i)).normalize(`NFC`)}catch{a=i}let s=e.toLowerCase(),l=o().githubRepoPaths?.[s]??[];if(l[0]===a){r(`Path ${a} already tracked for repo ${s}`);return}let u=l.filter(e=>e!==a),f=[a,...u];c(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[s]:f}})),r(`Added ${a} to tracked paths for repo ${s}`)}catch(e){r(`Error updating repo path mapping: ${e}`)}}function v(e){let t=o(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(a));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await f(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let n=o(),i=e.toLowerCase(),a=n.githubRepoPaths?.[i]??[],s=a.filter(e=>e!==t);if(s.length===a.length)return;let l={...n.githubRepoPaths};s.length===0?delete l[i]:l[i]=s,c(e=>({...e,githubRepoPaths:l})),r(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Iy as t,ab as n,bl as r,cb as i,db as a,fb as o,ib as s,jy as c,lb as l,nb as u,nd as d,ob as f,pb as p,rb as m,tb as h,td as g,xl as _,yl as v}from"./loadAgentsDir-C7lOqvfh.js";import{I as y,P as b,fi as x,t as S}from"./src-P_wYS_NJ2.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{n as w,t as T}from"./PermissionDialog-Cb3z8OUP.js";function E({currentGoal:e,newObjective:t,onConfirm:r,onCancel:i}){function a(e){e===`yes`?r():i()}let o=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(y,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(b,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(y,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(b,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Status: `}),n(e.status)]}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Time: `}),s(e)]}),(0,D.jsxs)(b,{children:[(0,D.jsx)(b,{dimColor:!0,children:`· Tokens: `}),o]})]}),(0,D.jsxs)(y,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(b,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(b,{children:t})]}),(0,D.jsx)(y,{marginTop:1,children:(0,D.jsx)(d,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:a,onCancel:i})})]})})}var D,O=e((()=>{x(),S(),g(),w(),l(),D=C()}));function k(e){let t=e.split(`
|
|
2
|
-
`)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){t(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=f();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,r=[`Goal: ${e.objective}`,`Status: ${n(e.status)}`,`Time: ${s(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&r.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),r.join(`
|
|
3
|
-
`)}function M(e){return p(e),i(),r(),`Goal set.`}async function N(e,t,n){let i=n.trim();if(!i||i.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let s=i.toLowerCase();if(s===`clear`){let t=h();return t&&(_(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(s===`pause`){let t=a();return t&&(r(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(s===`resume`){if(f()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=o();return t&&r(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(s===`continue`){let t=m();return t&&r(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(s===`complete`){let t=u();return t&&(r(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(i.length>F)return e(`Goal objective is too long (${i.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let c=f();return c&&c.status!==`complete`?(0,P.jsx)(E,{currentGoal:c,newObjective:i,onConfirm:()=>{A(),e(M(i),{display:`system`,shouldQuery:!0,displayArgs:k(i),metaMessages:[`<goal-objective-updated>\n${i}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(i),{display:`system`,shouldQuery:!0,displayArgs:k(i),metaMessages:[`<goal-objective-updated>\n${i}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{x(),l(),v(),c(),O(),P=C(),F=4e3,I=80}))();export{N as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Xt as e,_n as t,un as n,vn as r}from"./loadAgentsDir-C7lOqvfh.js";r();export{e as executeSessionEndHooks,n as getSessionEndHookTimeoutMs,t as hasWorktreeCreateHook};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,F as t,S as n,a as r,l as i,z as a}from"./debug-RAynG_nM.js";import{O as o,k as s}from"./git-2c7WlGDL.js";import{n as c,r as l}from"./analytics-DJobLaWP.js";c(),r(),o(),a(),n();function u(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return n>0?`${t}m ${n}s`:`${t}m`}function d(t){let n=(t.startsWith(`sk-ant-si-`)?t.slice(10):t).split(`.`);if(n.length!==3||!n[1])return null;try{return e(Buffer.from(n[1],`base64url`).toString(`utf8`))}catch{return null}}function f(e){let t=d(e);return typeof t==`object`&&t&&`exp`in t&&typeof t.exp==`number`?t.exp:null}var p=300*1e3,m=1800*1e3,h=3,g=6e4;function _({getAccessToken:e,onRefresh:n,label:r,refreshBufferMs:a=p}){let o=new Map,c=new Map,d=new Map;function _(e){let t=(d.get(e)??0)+1;return d.set(e,t),t}function v(e,t){let n=f(t);if(!n){i(`[${r}:token] Could not decode JWT expiry for sessionId=${e}, token prefix=${t.slice(0,15)}…, keeping existing timer`);return}let s=o.get(e);s&&clearTimeout(s);let c=_(e),l=new Date(n*1e3).toISOString(),d=n*1e3-Date.now()-a;if(d<=0){i(`[${r}:token] Token for sessionId=${e} expires=${l} (past or within buffer), refreshing immediately`),b(e,c);return}i(`[${r}:token] Scheduled token refresh for sessionId=${e} in ${u(d)} (expires=${l}, buffer=${a/1e3}s)`);let p=setTimeout(b,d,e,c);o.set(e,p)}function y(e,t){let n=o.get(e);n&&clearTimeout(n);let s=_(e),c=Math.max(t*1e3-a,3e4);i(`[${r}:token] Scheduled token refresh for sessionId=${e} in ${u(c)} (expires_in=${t}s, buffer=${a/1e3}s)`);let l=setTimeout(b,c,e,s);o.set(e,l)}async function b(a,f){let p;try{p=await e()}catch(e){i(`[${r}:token] getAccessToken threw for sessionId=${a}: ${t(e)}`,{level:`error`})}if(d.get(a)!==f){i(`[${r}:token] doRefresh for sessionId=${a} stale (gen ${f} vs ${d.get(a)}), skipping`);return}if(!p){let e=(c.get(a)??0)+1;if(c.set(a,e),i(`[${r}:token] No OAuth token available for refresh, sessionId=${a} (failure ${e}/${h})`,{level:`error`}),s(`error`,`bridge_token_refresh_no_oauth`),e<h){let e=setTimeout(b,g,a,f);o.set(a,e)}return}c.delete(a),i(`[${r}:token] Refreshing token for sessionId=${a}: new token prefix=${p.slice(0,15)}…`),l(`tengu_bridge_token_refreshed`,{}),n(a,p);let _=setTimeout(b,m,a,f);o.set(a,_),i(`[${r}:token] Scheduled follow-up refresh for sessionId=${a} in ${u(m)}`)}function x(e){_(e);let t=o.get(e);t&&(clearTimeout(t),o.delete(e)),c.delete(e)}function S(){for(let e of d.keys())_(e);for(let e of o.values())clearTimeout(e);o.clear(),c.clear()}return{schedule:v,scheduleFromExpiresIn:y,cancel:x,cancelAll:S}}export{f as n,_ as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{CE as t,SE as n,gE as r,hE as i,mE as a,wE as o,xE as s,yE as c}from"./loadAgentsDir-C7lOqvfh.js";import{I as l,S as u,w as d,z as f}from"./debug-RAynG_nM.js";import{r as p,t as m}from"./promptEditor-DhcZY-iu.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(c.map(e=>n(e.key)));return e.map(e=>{let r={};for(let[i,a]of Object.entries(e.bindings))t.has(n(i))||(r[i]=a);return{context:e.context,bindings:r}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return d({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:v(t)},null,2)+`
|
|
2
|
-
`}var b=e((()=>{u(),o(),s()}));async function x(){if(!r())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=a(),t=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(l(e)===`EEXIST`)t=!0;else throw e}let n=await m(e);return n.error?{type:`text`,value:`${t?`Opened`:`Created`} ${e}. Could not open in editor: ${n.error}`}:{type:`text`,value:t?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{i(),b(),f(),p()}))();export{x as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e,t}from"./loadAgentsDir-C7lOqvfh.js";e();export{t as clearAgentDefinitionsCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J_ as e,X_ as t,q_ as n}from"./loadAgentsDir-C7lOqvfh.js";n();export{e as loadPluginHooks,t as setupPluginHookHotReload};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,o as n,t as r}from"./localSearch-BKrznW5x.js";n();export{r as clearSkillIndexCache,e as getSkillIndex,t as searchSkills};
|