@readmagic/workmate 0.0.11 → 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-ag2JTpmU.js → AddWorkspaceDirectory-CtRxzRny.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-_bI4jo_P.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CSywJdVL.js → AgentsMdExternalIncludesDialog-_yJJ0wqu.js} +1 -1
- package/dist/chunks/{App-BuKmqFPm.js → App-DoAZ7CYS.js} +1 -1
- package/dist/chunks/{ApproveApiKey-M6U-NafA.js → ApproveApiKey-C8LwmDM2.js} +1 -1
- package/dist/chunks/ApproveApiKey-DQP3qmb0.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CDA2noEk.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-B05t83wa.js → BypassPermissionsModeDialog-COI_V57z.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-Dn8fO-o_.js +1 -0
- package/dist/chunks/{DiffDialog-DUbFrzKu.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-BDoVj02t.js → Grove-DRZrhbF0.js} +1 -1
- package/dist/chunks/{HybridTransport-C_U0IJfz.js → HybridTransport-BadJQe6u.js} +2 -2
- package/dist/chunks/{InvalidConfigDialog-bih293Xt.js → InvalidConfigDialog-DQaT6aen.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-Br8kQOHz.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-COa71S9q.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-to5eYBvI.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-DN4tCDEh.js → SSETransport-je346ofV.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-C85Sanww.js +1 -0
- package/dist/chunks/Settings-C8GKWod1.js +2 -0
- package/dist/chunks/{TeleportProgress-C2LQVLav.js → TeleportProgress-zmdAsogZ.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-BZL8Zblz.js → TeleportRepoMismatchDialog-CG32I4cO.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-wPiIs8xg.js → TeleportResumeWrapper-2Yjr74Lq.js} +1 -1
- package/dist/chunks/{ThemePicker-BT_NaRQC.js → ThemePicker-p7_hHk1V.js} +1 -1
- package/dist/chunks/TrustDialog-BVcny9vs.js +1 -0
- package/dist/chunks/{ValidationErrorsList-C-hWdy_8.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
- package/dist/chunks/{WelcomeV2-ZQRKlcT4.js → WelcomeV2-BnSYhyfu.js} +1 -1
- package/dist/chunks/add-dir-Bd7pilVx.js +1 -0
- package/dist/chunks/{agentDisplay-CuSHqgZc.js → agentDisplay-CfMLGPGH.js} +1 -1
- package/dist/chunks/{agents-CMC0iQP4.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-BbJfMXRS.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-7mJGtlZp.js → auth-yDsvFcM7.js} +1 -1
- package/dist/chunks/{autoMode-CBtY7ACs.js → autoMode-C2lnBot9.js} +5 -5
- package/dist/chunks/backgroundHousekeeping-DbpTGbwl.js +1 -0
- package/dist/chunks/backgroundHousekeeping-SpTxViUq.js +17 -0
- package/dist/chunks/{banner-1Wyeyawe.js → banner-BcAM7iSx.js} +1 -1
- package/dist/chunks/bg-Ci7pG4eo.js +9 -0
- package/dist/chunks/{branch-k3kirqbA.js → branch-DJiMa8td.js} +1 -1
- package/dist/chunks/{break-cache-CAoZ9b72.js → break-cache-4rlQORVk.js} +2 -2
- package/dist/chunks/{bridgeConfig-UgaUfuP6.js → bridgeConfig-BB6Hgali.js} +1 -1
- package/dist/chunks/bridgeConfig-Ccm79Jze.js +1 -0
- package/dist/chunks/{bridgeMessaging-Ci5H68MX.js → bridgeMessaging-C9D0Lly2.js} +1 -1
- package/dist/chunks/{bridgePointer-BL8-lGvN.js → bridgePointer-DHWK3LEe.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-C36w15ge.js → bridgeStatusUtil-D8UbcVrZ.js} +1 -1
- package/dist/chunks/btw-BO2B23f-.js +1 -0
- package/dist/chunks/caches-BQmbXerw.js +1 -0
- package/dist/chunks/caches-Dtjmjm6G.js +1 -0
- package/dist/chunks/{capacityWake-BOySRJUJ.js → capacityWake-ByL6fM6I.js} +1 -1
- package/dist/chunks/{ccrClient-Br4LAofR.js → ccrClient-BG9HU_fW.js} +1 -1
- package/dist/chunks/{claudeDesktop-Bgds1-YT.js → claudeDesktop-Ct_hyICL.js} +1 -1
- package/dist/chunks/{clear-C4Vtnbye.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-B9404qIP.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-kB2eazPX.js → config-DMKtiMzJ.js} +1 -1
- package/dist/chunks/{context-BN7DEjoH.js → context-BY5oO5is.js} +1 -1
- package/dist/chunks/{context-noninteractive-D91W2B8e.js → context-noninteractive-mAQt1p9l.js} +2 -2
- 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-DRqkLZWt.js → createSession-CftIZ3aq.js} +1 -1
- 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-BecbSVoN.js → debug-Dr1SjdXn.js} +2 -2
- package/dist/chunks/{debugUtils-CmJfIUxW.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-C15umvKN.js → detectRepository-CMEkS5_2.js} +1 -1
- package/dist/chunks/{diff-DeK4bwjw.js → diff-1HsxKGBh.js} +1 -1
- package/dist/chunks/{directoryCompletion-BJCu19HJ.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-Ka3lhafK.js → esm-BkOWaWVb.js} +1 -1
- package/dist/chunks/{execFileNoThrow-DHyW8FMX.js → execFileNoThrow-mXq4K0rl.js} +1 -1
- package/dist/chunks/{execSyncWrapper-CDzB0BM1.js → execSyncWrapper-Ne33rRiD.js} +1 -1
- package/dist/chunks/exit-B8MA4Ltm.js +1 -0
- package/dist/chunks/{extraUsage-BrKbpBK-.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-DWn40OcQ.js → fast-VOu2FUlV.js} +1 -1
- package/dist/chunks/{fileSuggestions-C7Pwq2yj.js → fileSuggestions-Be-pyLLq.js} +1 -1
- package/dist/chunks/firstPartyEventLogger-B8RVGBQB.js +1 -0
- package/dist/chunks/{firstPartyEventLogger-BHjBQH0J.js → firstPartyEventLogger-aFhcruXA.js} +2 -2
- package/dist/chunks/{flushGate-DdJjxCes.js → flushGate-BUSrMj_6.js} +1 -1
- package/dist/chunks/{gemini-DHv2iVfy.js → gemini-DB4M-MYv.js} +1 -1
- package/dist/chunks/{generateSessionName-DhS_6oHd.js → generateSessionName-DhCypqJ_.js} +1 -1
- package/dist/chunks/{genericProcessUtils-B2HcDYhg.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
- package/dist/chunks/git-Bs1vtuvX.js +1 -0
- package/dist/chunks/{git-DBlOv64X.js → git-CoQQ6YEf.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-CK56bUDe.js → githubRepoPathMapping-CmpEaQoo.js} +1 -1
- package/dist/chunks/goal-TxXtfkQ6.js +3 -0
- package/dist/chunks/{grok-BS57ZhyW.js → grok-D2a_J5wE.js} +1 -1
- package/dist/chunks/{grove-_zlQ83yR.js → grove-BnzBbGsX.js} +2 -2
- package/dist/chunks/{help-C_2tdXHC.js → help-C5ankDi4.js} +1 -1
- package/dist/chunks/{hooks-C7Bn7MBe.js → hooks-BZS105Rd.js} +3 -3
- package/dist/chunks/hooks-D-twhU_z.js +1 -0
- package/dist/chunks/{initReplBridge-NkZRcM77.js → initReplBridge-DL4klK0C.js} +1 -1
- package/dist/chunks/{install-Du-DSVzj.js → install-NZvHd_40.js} +1 -1
- package/dist/chunks/{instrumentation-DMs3b82f.js → instrumentation-CjBlVlFq.js} +4 -4
- package/dist/chunks/{job-rbX1VZmp.js → job-D502Zf8J.js} +1 -1
- package/dist/chunks/{jwtUtils-OzxN2zts.js → jwtUtils-FQWtM6iM.js} +1 -1
- package/dist/chunks/keybindings-D9Boc8FD.js +2 -0
- package/dist/chunks/{launchLocalMemory-BLRCK1_o.js → launchLocalMemory-DxC3LojF.js} +2 -2
- package/dist/chunks/{launchOnboarding-Al_X75Vz.js → launchOnboarding-BLp5k_H4.js} +1 -1
- package/dist/chunks/{loadAgentsDir-BL93ulMm.js → loadAgentsDir-BXtV2jiO.js} +597 -604
- package/dist/chunks/loadAgentsDir-BjsAQWqt.js +1 -0
- package/dist/chunks/{loadPluginHooks-B0au35a4.js → loadPluginHooks-Dt3XQ-3N.js} +1 -1
- package/dist/chunks/{localSearch-C5ipegd9.js → localSearch-CeP4ef0a.js} +1 -1
- package/dist/chunks/localSearch-Cz8Ot7k2.js +1 -0
- package/dist/chunks/{log-Dauqle-Z.js → log-27kCA_9u.js} +1 -1
- package/dist/chunks/{logoV2Utils-CkvOihX7.js → logoV2Utils-CEnU8qad.js} +1 -1
- package/dist/chunks/{magicDocs-DLav5QK0.js → magicDocs-YtfrqVC6.js} +3 -3
- package/dist/chunks/main-CGLCy2pM.js +31 -0
- package/dist/chunks/{main-CVNWNAoh.js → main-CkjTzYj1.js} +42 -42
- package/dist/chunks/{managedEnv-DJSCuqCb.js → managedEnv-B-BNY0xC.js} +1 -1
- package/dist/chunks/managedEnv-K9Si1UuL.js +1 -0
- package/dist/chunks/{mappers-DQxMcezy.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-FeyE7JEh.js → memoize-Co4vS6UF.js} +1 -1
- package/dist/chunks/memory-DDUoR63T.js +1 -0
- package/dist/chunks/{mode-Bl2RZC8M.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-BtEZe5BB.js → modelOptions-ut0xePEe.js} +1 -1
- package/dist/chunks/{nativeInstaller-BEwayifa.js → nativeInstaller-fgCMR_c0.js} +1 -1
- 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-ZdwI7boX.js → onChangeAppState-WbvtqDtk.js} +1 -1
- package/dist/chunks/{openai-DWs4D-nQ.js → openai-DaVFXyBB.js} +3 -3
- package/dist/chunks/{panel-CoNfXy3K.js → panel-CoF2a-h4.js} +1 -1
- package/dist/chunks/parser-B2PlJg4C.js +1 -0
- package/dist/chunks/{parser-BH4u7QiV.js → parser-CUUiH40T.js} +1 -1
- package/dist/chunks/partition-CzW_31Y1.js +1 -0
- package/dist/chunks/permissions-BT3lxYBM.js +3 -0
- package/dist/chunks/{pidLock-DgOBc1Xo.js → pidLock-d1VPd6CG.js} +2 -2
- package/dist/chunks/{plan-BNYDTnQd.js → plan-M9DG3AqN.js} +1 -1
- package/dist/chunks/{platform-B0uTQc9P.js → platform-Dg1c9F_1.js} +1 -1
- package/dist/chunks/plugin-BiNHuq3h.js +17 -0
- package/dist/chunks/{pluginAutoupdate-BBU9Jn4p.js → pluginAutoupdate-B5lel6s5.js} +1 -1
- package/dist/chunks/{pluginBlocklist-DXQlbG0P.js → pluginBlocklist-CNGmIlwU.js} +1 -1
- package/dist/chunks/pluginCliCommands-WLOEhb2M.js +1 -0
- package/dist/chunks/{pluginFlagging-DcJ_FQuv.js → pluginFlagging-CXSSOj4J.js} +1 -1
- package/dist/chunks/pluginOperations-BFbty6WT.js +2 -0
- package/dist/chunks/{pluginStartupCheck-CKBFaMFr.js → pluginStartupCheck-BEd0VeQC.js} +1 -1
- package/dist/chunks/pluginStartupCheck-Bcdxg484.js +1 -0
- package/dist/chunks/{plugins-CBW7kPyp.js → plugins-BMZ3aYKP.js} +4 -4
- package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
- package/dist/chunks/{poorMode-B_xEvuEV.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-Dx7IWhBt.js → prompt-CRc2QEZ5.js} +4 -4
- package/dist/chunks/prompt-EtAanewG.js +1 -0
- package/dist/chunks/{promptEditor-WCkmpejM.js → promptEditor-Bo1d8ZLq.js} +2 -2
- package/dist/chunks/{protocolHandler-BiVWrpHi.js → protocolHandler-B83fCYI4.js} +1 -1
- package/dist/chunks/{proxy-CVn7o19p.js → proxy-BEKNaTXI.js} +1 -1
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
- package/dist/chunks/{reconciler-C2Nd_e4n.js → reconciler-BGav_ezX.js} +1 -1
- package/dist/chunks/refresh-DumNiLvM.js +1 -0
- package/dist/chunks/{registerProtocol-E0Iu5hEx.js → registerProtocol-DduKPsn_.js} +1 -1
- package/dist/chunks/{reload-plugins-D-3AUT9g.js → reload-plugins-DNEgQ5vo.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CV6we3ZA.js → remoteBridgeCore-BGOqHADF.js} +1 -1
- package/dist/chunks/{remoteManagedSettings-D26Q09-7.js → remoteManagedSettings-26nhzuca.js} +1 -1
- package/dist/chunks/{rename-CSavuBIE.js → rename-BPknfVGF.js} +1 -1
- package/dist/chunks/{renderOptions-DDLbSMQU.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-C1ydIMzT.js → ripgrep-DQ_ILUJV.js} +1 -1
- package/dist/chunks/{runtimeObserver-L7pSIWBT.js → runtimeObserver-BZrF3GnQ.js} +4 -4
- package/dist/chunks/{runtimeObserver-OU8KrZQG.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-DUYsfPy_.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-Dv3Ba8eA.js → sessionObserver-CyLpHSkw.js} +2 -2
- package/dist/chunks/{sessionState-D-SaBzWD.js → sessionState-DSWN4tMV.js} +1 -1
- package/dist/chunks/sessionStorage-zJ1esSCE.js +1 -0
- package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
- package/dist/chunks/{sessionTitle-uCuYaNif.js → sessionTitle-L5tyJgdU.js} +2 -2
- package/dist/chunks/{sessionTracing-Bqb3vJTt.js → sessionTracing-DpHGGIZm.js} +1 -1
- 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-BzAZ57p2.js → shadowedRuleDetection-DZ0AA2Rw.js} +1 -1
- package/dist/chunks/{shellQuote-DS6WrivY.js → shellQuote-C_I6DHLV.js} +1 -1
- package/dist/chunks/{sideQuestion-CvMBBjI8.js → sideQuestion-BYT8FdPF.js} +1 -1
- package/dist/chunks/sinks-DppGvgz1.js +1 -0
- package/dist/chunks/{sinks-f7qYjbKJ.js → sinks-mFsijQ_S.js} +2 -2
- package/dist/chunks/skillChangeDetector-D-iq09Xs.js +1 -0
- package/dist/chunks/{skillGapStore-CqaT8c0C.js → skillGapStore-DQXHqoP7.js} +2 -2
- package/dist/chunks/{skillLifecycle-CnR8IqJM.js → skillLifecycle-BG_RnGSh.js} +2 -2
- package/dist/chunks/{skillSearchPanel-D9qrOXpI.js → skillSearchPanel-DxYP4Q6R.js} +5 -5
- package/dist/chunks/skills-BD-2ofXA.js +1 -0
- package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
- package/dist/chunks/{startupProfiler-CmH_aVy2.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-B8uQ-UDi.js → stats-BkadEKa-.js} +1 -1
- package/dist/chunks/{status-D6KlRJmR.js → status-BmHu-c7I.js} +2 -2
- package/dist/chunks/{status-BekdWoIj.js → status-CrmnCDIE.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-BMM8_uJ1.js → statusNoticeHelpers-DakAVtQO.js} +1 -1
- package/dist/chunks/{stringUtils-C8PaYpQF.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-ClP9aBqK.js → syncCache-BofuFJEe.js} +1 -1
- package/dist/chunks/{tasks-Dmh6qikm.js → tasks-NpI1iEem.js} +1 -1
- package/dist/chunks/teleport-Bs3kEipi.js +1 -0
- package/dist/chunks/{templateJobs-CxqU-s5i.js → templateJobs-C94jEE6O.js} +2 -2
- package/dist/chunks/{terminalSetup-BKGcmlWp.js → terminalSetup-CbXKCpWM.js} +1 -1
- package/dist/chunks/{terminalSetup-Cy19F1Js.js → terminalSetup-fwhFTxGi.js} +1 -1
- package/dist/chunks/{theme-U7lMFHQ0.js → theme-CEi3b_8f.js} +1 -1
- package/dist/chunks/tmux-d3cNCIZA.js +1 -0
- package/dist/chunks/{toolEventObserver-D9qjoVl5.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-DL0pWP4_.js → trustedDevice-Bzz03jCy.js} +1 -1
- package/dist/chunks/{types-DafcFtmb.js → types-BJ7qTz75.js} +1 -1
- package/dist/chunks/{udsClient-CWnfsgFP.js → udsClient-CF8BmZgN.js} +1 -1
- package/dist/chunks/{updateCCB-C6XftzIG.js → updateCCB-CzBxsuJe.js} +6 -6
- package/dist/chunks/{upstreamproxy-CXmjxHpl.js → upstreamproxy-BuBFDFAD.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DEEJhm_W.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-DbhqKk1-.js → useMergedTools-CHxnwR7R.js} +1 -1
- package/dist/chunks/{useSearchInput-gUDbkLaC.js → useSearchInput-q2CFPU4W.js} +1 -1
- package/dist/chunks/useSettingsErrors-CPVQbsqq.js +1 -0
- package/dist/chunks/{userAgent-CU7Ndh79.js → userAgent-B7WkjI6I.js} +1 -1
- package/dist/chunks/util-BfqXOA-P.js +1 -0
- package/dist/chunks/{validatePlugin-y_O_tCEL.js → validatePlugin-jrcrYEIu.js} +1 -1
- package/dist/chunks/{vim-w37BfGZ5.js → vim-C4Hs5U2h.js} +1 -1
- package/dist/chunks/{which-BRWBO7Gu.js → which-mplwBbc0.js} +1 -1
- package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
- package/dist/chunks/{windowsPaths-DtWHLjmE.js → windowsPaths-C7Mdo9aU.js} +1 -1
- package/dist/chunks/{workSecret-BEhXgH2M.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 +1 -1
- package/dist/chunks/ApproveApiKey-CIWOi_7v.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +0 -1
- package/dist/chunks/Doctor-BcnUfJ4I.js +0 -1
- package/dist/chunks/Doctor-Dz4TuYas.js +0 -3
- package/dist/chunks/ExitFlow-BwyAtIHx.js +0 -2
- package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +0 -1
- package/dist/chunks/MCPToolListView-DJ06N1DG.js +0 -1
- package/dist/chunks/MessageSelector-o4ULADFg.js +0 -3
- package/dist/chunks/Messages-qqwHuAW5.js +0 -11
- package/dist/chunks/Onboarding-BzuQjney.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-CfMFx-TF.js +0 -1
- package/dist/chunks/QueryEngine-Dt0BKUeF.js +0 -1
- package/dist/chunks/REPL-CUbEDqEl.js +0 -133
- package/dist/chunks/REPL-DMaKNhTa.js +0 -1
- package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +0 -2
- package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +0 -1
- package/dist/chunks/Settings-DfdcmvOV.js +0 -2
- package/dist/chunks/TrustDialog-ACaJ_m7A.js +0 -1
- package/dist/chunks/add-dir-SAKTkw0S.js +0 -1
- package/dist/chunks/agents-ZgRKpjHv.js +0 -103
- package/dist/chunks/allErrors-_cOQksHC.js +0 -1
- package/dist/chunks/api-DS1MiW01.js +0 -1
- package/dist/chunks/auth-DGZzCbU0.js +0 -1
- package/dist/chunks/auth-DN1MUpB8.js +0 -1
- package/dist/chunks/autonomy-DuQmYhq6.js +0 -15
- package/dist/chunks/autonomy-lJV7yWUl.js +0 -1
- package/dist/chunks/autonomyPanel-DAQm6lDz.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +0 -1
- package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +0 -17
- package/dist/chunks/bg-CJ0YWFli.js +0 -9
- package/dist/chunks/bg-CeUrRz_7.js +0 -1
- package/dist/chunks/bridgeConfig-CzRUPn-D.js +0 -1
- package/dist/chunks/btw-nVoVuIae.js +0 -1
- package/dist/chunks/caches-B8sM3Zys.js +0 -1
- package/dist/chunks/caches-Bp9MZ7IE.js +0 -1
- package/dist/chunks/cliLaunch-BTpfAGGI.js +0 -1
- package/dist/chunks/client-BCAbKdNz.js +0 -1
- package/dist/chunks/client-CJE6gEvU.js +0 -1
- package/dist/chunks/commands-DL-BzoMQ.js +0 -1
- package/dist/chunks/compact-Cx7BPXLU.js +0 -2
- package/dist/chunks/config-S5OW4Xqr.js +0 -1
- package/dist/chunks/config-aRiTrtCv.js +0 -3
- package/dist/chunks/context-noninteractive-DPacEFJ1.js +0 -1
- package/dist/chunks/conversation-D5Nbu9eT.js +0 -1
- package/dist/chunks/conversation-hcUx9e-C.js +0 -1
- package/dist/chunks/createSSHSession-DecOR6M5.js +0 -6
- package/dist/chunks/createSession-D27zvmOs.js +0 -1
- package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +0 -40
- package/dist/chunks/cwd-ClLru_7T.js +0 -1
- package/dist/chunks/datadog-bm551AVV.js +0 -1
- package/dist/chunks/detached-CIyF0M5O.js +0 -5
- package/dist/chunks/detectRepository-DDfLfKcM.js +0 -1
- package/dist/chunks/doctor-BJORBomU.js +0 -1
- package/dist/chunks/entry-mdegyj8z.js +0 -14
- package/dist/chunks/exit-CF3KBl-S.js +0 -1
- package/dist/chunks/extractMemories-4lBn134y.js +0 -1
- package/dist/chunks/fast-0Vi354KI.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +0 -1
- package/dist/chunks/git-DF4RFFaT.js +0 -1
- package/dist/chunks/goal-BZG4gtnb.js +0 -3
- package/dist/chunks/hooks-DT80Arzc.js +0 -1
- package/dist/chunks/keybindings-CwdC_8S0.js +0 -2
- package/dist/chunks/loadAgentsDir-eVKq8efm.js +0 -1
- package/dist/chunks/localSearch-CZlFfR_X.js +0 -1
- package/dist/chunks/main-LMyE3jXY.js +0 -31
- package/dist/chunks/managedEnv-CYepSnm8.js +0 -1
- package/dist/chunks/mcp-BAbbEaBA.js +0 -1
- package/dist/chunks/mcp-Ct4Sum6A.js +0 -6
- package/dist/chunks/mcp-D5HkCqUh.js +0 -2
- package/dist/chunks/memory-COa7aUbx.js +0 -1
- package/dist/chunks/model-B7rtZ7KV.js +0 -1
- package/dist/chunks/model-Bgh_r4lg.js +0 -1
- package/dist/chunks/model-DiuEAv6h.js +0 -1
- package/dist/chunks/oauth-BN2I0_jl.js +0 -1
- package/dist/chunks/oauth-C9VBDB0Y.js +0 -1
- package/dist/chunks/omit--yH_T4rf.js +0 -1
- package/dist/chunks/parser-BMIaRErw.js +0 -1
- package/dist/chunks/partition-DLcW5Oo_.js +0 -1
- package/dist/chunks/permissions-CaucYK3s.js +0 -3
- package/dist/chunks/plugin-BN-of1_H.js +0 -17
- package/dist/chunks/pluginCliCommands-CfdVNs8D.js +0 -1
- package/dist/chunks/pluginOperations-DnhzFbYI.js +0 -2
- package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +0 -1
- package/dist/chunks/poorMode-yH1o41cQ.js +0 -1
- package/dist/chunks/print-BZOx09SU.js +0 -26
- package/dist/chunks/processBashCommand-dcCNCiBp.js +0 -1
- package/dist/chunks/processSlashCommand-YDiM63Qr.js +0 -5
- package/dist/chunks/prompt-CXGy0llt.js +0 -1
- package/dist/chunks/prompt-DovNDmcx.js +0 -1
- package/dist/chunks/rcDebugLog-CARUIORE.js +0 -1
- package/dist/chunks/refresh-B84H2Ezd.js +0 -1
- package/dist/chunks/resume-CROylN3J.js +0 -2
- package/dist/chunks/ripgrep-2M1GkXqJ.js +0 -1
- package/dist/chunks/sandbox-adapter-6UwMLh6e.js +0 -1
- package/dist/chunks/sandbox-toggle-YrQNWGsr.js +0 -1
- package/dist/chunks/searchExtraTools-Bdv5HJ74.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +0 -1
- package/dist/chunks/sessionObserver-B0zucj_c.js +0 -1
- package/dist/chunks/sessionStorage-BM1x51Z7.js +0 -1
- package/dist/chunks/settings-BG15IFYx.js +0 -1
- package/dist/chunks/settings-D4CpDv2y.js +0 -20
- package/dist/chunks/settingsSync-BSrpnyqo.js +0 -1
- package/dist/chunks/setup-C62oq4AZ.js +0 -3
- package/dist/chunks/sinks-WJ7nzLQs.js +0 -1
- package/dist/chunks/skillChangeDetector-U5kRU5nd.js +0 -1
- package/dist/chunks/skills-BgcFh0vy.js +0 -1
- package/dist/chunks/startupProfiler-B4HBBbHN.js +0 -1
- package/dist/chunks/state-BAGmpVBn.js +0 -1
- package/dist/chunks/state-D_lk6z-C.js +0 -1
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
- package/dist/chunks/switcher-Ck9CrXrr.js +0 -1
- package/dist/chunks/switcher-DnAhkyIn.js +0 -1
- package/dist/chunks/teleport-DH3IuAUQ.js +0 -1
- package/dist/chunks/tmux-D5EvHWi3.js +0 -1
- package/dist/chunks/toolPool-69mfSPAs.js +0 -1
- package/dist/chunks/trustedDevice-B6AKlsl_.js +0 -1
- package/dist/chunks/useMainLoopModel-6w7mhwhU.js +0 -1
- package/dist/chunks/useManagePlugins-CjnsO-Of.js +0 -1
- package/dist/chunks/useSettingsErrors-CgPad-H0.js +0 -1
- package/dist/chunks/util-B4oMhJKh.js +0 -1
- package/dist/chunks/windowsPaths-BY-IVNwQ.js +0 -1
- package/dist/chunks/workerRegistry-Bq9bS5pw.js +0 -6
- package/dist/chunks/worktree-4SUJ4dtz.js +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{Bi as n,Cr as r,Cu as i,Fi as a,Su as o,U as s,W as c,bf as l,cr as u,ec as d,el as f,i as p,mb as m,o as h,tc as g,tl as _,ub as ee,yf as te}from"./loadAgentsDir-BXtV2jiO.js";import{A as v,C as y,M as b,O as x,P as S,b as C,j as w,l as ne,m as T,p as E,v as D,w as O}from"./external-CEp-aPkt.js";import{r as re}from"./lazySchema-B4D4qJVE.js";import{Bn as ie,Wt as k,_r as ae,et as oe,gr as se,ht as ce,or as A}from"./state-BPFYBqm1.js";import{f as le,g as ue}from"./settings-DiBMs2gM.js";import{h as de,r as fe}from"./config-9rLTDOYW.js";import{l as pe,p as me,r as he}from"./sessionStoragePortable-BhkGMZWp.js";import{_ as ge,u as _e}from"./model-CDnVaVDR.js";import{bn as ve,yn as ye}from"./prompt-CRc2QEZ5.js";import{n as be,r as xe}from"./managedEnv-B-BNY0xC.js";import{t as Se}from"./QueryEngine-HkswHUNv.js";import{n as Ce,t as we}from"./modelOptions-ut0xePEe.js";import{dirname as Te}from"node:path";import{randomUUID as j}from"node:crypto";import{Readable as Ee,Writable as De}from"node:stream";import{unlink as Oe}from"node:fs/promises";import*as M from"node:path/posix";import{isAbsolute as ke,resolve as Ae}from"node:path/posix";re();var N={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`},P={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`},je=O({_meta:x(v(),b()).nullish(),terminal:T().optional().default(!1)}),Me=O({_meta:x(v(),b()).nullish(),label:v().nullish(),name:v(),optional:T().optional().default(!1),secret:T().optional().default(!0)}),Ne=O({_meta:x(v(),b()).nullish(),description:v().nullish(),id:v(),name:v()}),Pe=O({_meta:x(v(),b()).nullish(),description:v().nullish(),id:v(),link:v().nullish(),name:v(),vars:E(Me)}),Fe=O({_meta:x(v(),b()).nullish(),args:E(v()).optional(),description:v().nullish(),env:x(v(),v()).optional(),id:v(),name:v()}),Ie=w([Pe.and(O({type:C(`env_var`)})),Fe.and(O({type:C(`terminal`)})),Ne]),Le=O({_meta:x(v(),b()).nullish(),methodId:v()}),Re=O({_meta:x(v(),b()).nullish()}),ze=O({_meta:x(v(),b()).nullish(),blob:v(),mimeType:v().nullish(),uri:v()}),Be=O({default:T().nullish(),description:v().nullish(),title:v().nullish()}),Ve=O({_meta:x(v(),b()).nullish()}),He=O({_meta:x(v(),b()).nullish()}),Ue=O({amount:y(),currency:v()}),We=O({_meta:x(v(),b()).nullish(),terminalId:v()}),Ge=O({_meta:x(v(),b()).nullish(),newText:v(),oldText:v().nullish(),path:v()}),Ke=w([v(),y(),y(),T(),E(v())]),qe=D(w([O({content:x(v(),Ke).nullish()}).and(O({action:C(`accept`)})),O({action:C(`decline`)}),O({action:C(`cancel`)})]),O({_meta:x(v(),b()).nullish()})),Je=O({_meta:x(v(),b()).nullish()}),Ye=v(),Xe=O({_meta:x(v(),b()).nullish(),elicitationId:Ye}),Ze=C(`object`),Qe=C(`string`),$e=O({_meta:x(v(),b()).nullish()}),et=O({_meta:x(v(),b()).nullish(),form:Je.nullish(),url:$e.nullish()}),tt=O({const:v(),title:v()}),nt=O({_meta:x(v(),b()).nullish(),name:v(),value:v()}),rt=O({code:w([C(-32700),C(-32600),C(-32601),C(-32602),C(-32603),C(-32800),C(-32e3),C(-32002),C(-32042),y().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:b().optional(),message:v()}),it=b(),at=b(),ot=b(),st=O({_meta:x(v(),b()).nullish(),readTextFile:T().optional().default(!1),writeTextFile:T().optional().default(!1)}),ct=O({_meta:x(v(),b()).nullish(),name:v(),value:v()}),lt=O({_meta:x(v(),b()).nullish(),name:v(),title:v().nullish(),version:v()}),ut=O({default:y().nullish(),description:v().nullish(),maximum:y().nullish(),minimum:y().nullish(),title:v().nullish()}),dt=O({_meta:x(v(),b()).nullish()}),ft=O({_meta:x(v(),b()).nullish(),additionalDirectories:E(v()).optional(),cursor:v().nullish(),cwd:v().nullish()}),pt=O({_meta:x(v(),b()).nullish()}),mt=O({_meta:x(v(),b()).nullish(),logout:pt.nullish()}),ht=O({_meta:x(v(),b()).nullish()}),gt=O({_meta:x(v(),b()).nullish()}),_t=O({_meta:x(v(),b()).nullish(),http:T().optional().default(!1),sse:T().optional().default(!1)}),vt=O({_meta:x(v(),b()).nullish(),headers:E(ct),name:v(),url:v()}),yt=O({_meta:x(v(),b()).nullish(),headers:E(ct),name:v(),url:v()}),bt=O({_meta:x(v(),b()).nullish(),args:E(v()),command:v(),env:E(nt),name:v()}),F=w([vt.and(O({type:C(`http`)})),yt.and(O({type:C(`sse`)})),bt]),xt=v(),St=O({_meta:x(v(),b()).nullish(),description:v().nullish(),modelId:xt,name:v()}),Ct=w([C(`error`),C(`warning`),C(`information`),C(`hint`)]),wt=O({_meta:x(v(),b()).nullish()}),Tt=O({_meta:x(v(),b()).nullish()}),Et=O({_meta:x(v(),b()).nullish()}),Dt=O({_meta:x(v(),b()).nullish()}),Ot=O({_meta:x(v(),b()).nullish()}),kt=O({_meta:x(v(),b()).nullish(),maxCount:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),At=O({diff:v(),uri:v()}),jt=O({endLine:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:v()}),Mt=O({_meta:x(v(),b()).nullish()}),Nt=O({_meta:x(v(),b()).nullish()}),Pt=O({languageId:v(),text:v(),uri:v()}),Ft=O({_meta:x(v(),b()).nullish(),maxCount:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),It=w([C(`rejected`),C(`ignored`),C(`replaced`),C(`cancelled`)]),Lt=O({excerpts:E(jt),uri:v()}),Rt=O({_meta:x(v(),b()).nullish()}),zt=O({_meta:x(v(),b()).nullish()}),Bt=O({name:v(),owner:v(),remoteUrl:v()}),Vt=O({_meta:x(v(),b()).nullish()}),Ht=O({_meta:x(v(),b()).nullish(),jump:Mt.nullish(),rename:zt.nullish(),searchAndReplace:Vt.nullish()}),Ut=O({id:v(),isRegex:T().nullish(),replace:v(),search:v(),uri:v()}),Wt=w([C(`automatic`),C(`diagnostic`),C(`manual`)]),Gt=O({_meta:x(v(),b()).nullish(),maxCount:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Kt=O({_meta:x(v(),b()).nullish(),diagnostics:wt.nullish(),editHistory:kt.nullish(),openFiles:Nt.nullish(),recentFiles:Ft.nullish(),relatedSnippets:Rt.nullish(),userActions:Gt.nullish()}),qt=O({_meta:x(v(),b()).nullish(),additionalDirectories:E(v()).optional(),cwd:v(),mcpServers:E(F)}),Jt=O({default:y().nullish(),description:v().nullish(),maximum:y().nullish(),minimum:y().nullish(),title:v().nullish()}),Yt=v(),Xt=w([C(`allow_once`),C(`allow_always`),C(`reject_once`),C(`reject_always`)]),Zt=O({_meta:x(v(),b()).nullish(),kind:Xt,name:v(),optionId:Yt}),Qt=w([C(`high`),C(`medium`),C(`low`)]),$t=w([C(`pending`),C(`in_progress`),C(`completed`)]),en=O({_meta:x(v(),b()).nullish(),content:v(),priority:Qt,status:$t}),tn=O({_meta:x(v(),b()).nullish(),entries:E(en)}),I=O({character:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),nn=O({id:v(),position:I,uri:v()}),rn=O({id:v(),newName:v(),position:I,uri:v()}),an=O({action:v(),position:I,timestampMs:y(),uri:v()}),on=w([C(`utf-16`),C(`utf-32`),C(`utf-8`)]),sn=O({_meta:x(v(),b()).nullish(),auth:je.optional().default({terminal:!1}),elicitation:et.nullish(),fs:st.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Ht.nullish(),positionEncodings:E(on).optional(),terminal:T().optional().default(!1)}),cn=O({_meta:x(v(),b()).nullish(),audio:T().optional().default(!1),embeddedContext:T().optional().default(!1),image:T().optional().default(!1)}),ln=y().int().gte(0).lte(65535),un=O({_meta:x(v(),b()).nullish(),clientCapabilities:sn.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:lt.nullish(),protocolVersion:ln}),L=O({end:I,start:I}),dn=O({message:v(),range:L,severity:Ct,uri:v()}),fn=O({languageId:v(),lastFocusedMs:y().nullish(),uri:v(),visibleRange:L.nullish()}),pn=O({_meta:x(v(),b()).nullish(),diagnostics:E(dn).nullish(),editHistory:E(At).nullish(),openFiles:E(fn).nullish(),recentFiles:E(Pt).nullish(),relatedSnippets:E(Lt).nullish(),userActions:E(an).nullish()}),mn=O({newText:v(),range:L}),hn=w([O({cursorPosition:I.nullish(),edits:E(mn),id:v(),uri:v()}).and(O({kind:C(`edit`)})),nn.and(O({kind:C(`jump`)})),rn.and(O({kind:C(`rename`)})),Ut.and(O({kind:C(`searchAndReplace`)}))]),gn=O({_meta:x(v(),b()).nullish(),content:v()}),_n=O({_meta:x(v(),b()).nullish()}),R=w([y(),v()]).nullable();O({_meta:x(v(),b()).nullish(),requestId:R});var vn=O({requestId:R}),yn=ne([`assistant`,`user`]),z=O({_meta:x(v(),b()).nullish(),audience:E(yn).nullish(),lastModified:v().nullish(),priority:y().nullish()}),bn=O({_meta:x(v(),b()).nullish(),annotations:z.nullish(),data:v(),mimeType:v()}),xn=O({_meta:x(v(),b()).nullish(),annotations:z.nullish(),data:v(),mimeType:v(),uri:v().nullish()}),Sn=O({_meta:x(v(),b()).nullish(),annotations:z.nullish(),description:v().nullish(),mimeType:v().nullish(),name:v(),size:y().nullish(),title:v().nullish(),uri:v()}),Cn=O({_meta:x(v(),b()).nullish(),optionId:Yt}),wn=w([O({outcome:C(`cancelled`)}),Cn.and(O({outcome:C(`selected`)}))]),Tn=O({_meta:x(v(),b()).nullish(),outcome:wn}),En=O({_meta:x(v(),b()).nullish()}),Dn=O({_meta:x(v(),b()).nullish()}),On=O({currentValue:T()}),kn=v(),An=v(),jn=w([C(`mode`),C(`model`),C(`thought_level`),v()]),Mn=v(),Nn=O({_meta:x(v(),b()).nullish(),description:v().nullish(),name:v(),value:Mn}),Pn=O({_meta:x(v(),b()).nullish(),group:kn,name:v(),options:E(Nn)}),B=D(w([O({currentValue:Mn,options:w([E(Nn),E(Pn)])}).and(O({type:C(`select`)})),On.and(O({type:C(`boolean`)}))]),O({_meta:x(v(),b()).nullish(),category:jn.nullish(),description:v().nullish(),id:An,name:v()})),Fn=O({_meta:x(v(),b()).nullish(),configOptions:E(B)}),In=O({_meta:x(v(),b()).nullish()}),V=v(),Ln=O({_meta:x(v(),b()).nullish(),id:v(),sessionId:V}),Rn=O({_meta:x(v(),b()).nullish(),sessionId:V}),zn=O({_meta:x(v(),b()).nullish(),sessionId:V}),Bn=O({_meta:x(v(),b()).nullish(),sessionId:V}),Vn=O({_meta:x(v(),b()).nullish(),args:E(v()).optional(),command:v(),cwd:v().nullish(),env:E(nt).optional(),outputByteLimit:y().nullish(),sessionId:V}),Hn=O({_meta:x(v(),b()).nullish(),sessionId:V,uri:v()}),Un=O({_meta:x(v(),b()).nullish(),position:I,sessionId:V,uri:v(),version:y(),visibleRange:L}),Wn=O({_meta:x(v(),b()).nullish(),languageId:v(),sessionId:V,text:v(),uri:v(),version:y()}),Gn=O({_meta:x(v(),b()).nullish(),sessionId:V,uri:v()}),Kn=O({_meta:x(v(),b()).nullish(),additionalDirectories:E(v()).optional(),cwd:v(),mcpServers:E(F).optional(),sessionId:V}),qn=O({_meta:x(v(),b()).nullish(),sessionId:V,terminalId:v()}),Jn=O({_meta:x(v(),b()).nullish(),additionalDirectories:E(v()).optional(),cwd:v(),mcpServers:E(F),sessionId:V}),Yn=O({_meta:x(v(),b()).nullish(),limit:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:v(),sessionId:V}),Xn=O({_meta:x(v(),b()).nullish(),id:v(),reason:It.nullish(),sessionId:V}),Zn=O({_meta:x(v(),b()).nullish(),sessionId:V,terminalId:v()}),Qn=O({_meta:x(v(),b()).nullish(),additionalDirectories:E(v()).optional(),cwd:v(),mcpServers:E(F).optional(),sessionId:V}),$n=O({_meta:x(v(),b()).nullish(),additionalDirectories:E(v()).optional(),cwd:v(),sessionId:V,title:v().nullish(),updatedAt:v().nullish()}),er=O({_meta:x(v(),b()).nullish(),nextCursor:v().nullish(),sessions:E($n)}),tr=O({_meta:x(v(),b()).nullish(),title:v().nullish(),updatedAt:v().nullish()}),nr=O({_meta:x(v(),b()).nullish()}),H=v(),rr=O({_meta:x(v(),b()).nullish(),currentModeId:H}),ir=O({_meta:x(v(),b()).nullish(),description:v().nullish(),id:H,name:v()}),U=O({_meta:x(v(),b()).nullish(),availableModes:E(ir),currentModeId:H}),W=O({_meta:x(v(),b()).nullish(),availableModels:E(St),currentModelId:xt}),ar=O({_meta:x(v(),b()).nullish(),configOptions:E(B).nullish(),models:W.nullish(),modes:U.nullish(),sessionId:V}),or=O({_meta:x(v(),b()).nullish(),configOptions:E(B).nullish(),models:W.nullish(),modes:U.nullish()}),sr=O({_meta:x(v(),b()).nullish(),configOptions:E(B).nullish(),models:W.nullish(),modes:U.nullish(),sessionId:V}),cr=O({_meta:x(v(),b()).nullish(),configOptions:E(B).nullish(),models:W.nullish(),modes:U.nullish()}),lr=O({_meta:x(v(),b()).nullish()}),ur=O({_meta:x(v(),b()).nullish(),additionalDirectories:En.nullish(),close:Dn.nullish(),fork:In.nullish(),list:nr.nullish(),resume:lr.nullish()}),dr=D(w([O({type:C(`boolean`),value:T()}),O({value:Mn})]),O({_meta:x(v(),b()).nullish(),configId:An,sessionId:V})),fr=O({_meta:x(v(),b()).nullish(),configOptions:E(B)}),pr=O({_meta:x(v(),b()).nullish(),modeId:H,sessionId:V}),mr=O({_meta:x(v(),b()).nullish()}),hr=O({_meta:x(v(),b()).nullish(),modelId:xt,sessionId:V}),gr=O({_meta:x(v(),b()).nullish()}),_r=O({_meta:x(v(),b()).nullish(),sessionId:V}),vr=w([C(`end_turn`),C(`max_tokens`),C(`max_turn_requests`),C(`refusal`),C(`cancelled`)]),yr=w([C(`email`),C(`uri`),C(`date`),C(`date-time`)]),br=O({default:v().nullish(),description:v().nullish(),enum:E(v()).nullish(),format:yr.nullish(),maxLength:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:E(tt).nullish(),pattern:v().nullish(),title:v().nullish()}),xr=O({_meta:x(v(),b()).nullish(),context:pn.nullish(),position:I,selection:L.nullish(),sessionId:V,triggerKind:Wt,uri:v(),version:y()}),Sr=O({_meta:x(v(),b()).nullish(),suggestions:E(hn)}),Cr=O({_meta:x(v(),b()).nullish(),terminalId:v()}),wr=O({_meta:x(v(),b()).nullish(),exitCode:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:v().nullish()}),Tr=O({_meta:x(v(),b()).nullish(),sessionId:V,terminalId:v()}),Er=O({_meta:x(v(),b()).nullish(),exitStatus:wr.nullish(),output:v(),truncated:T()}),Dr=O({_meta:x(v(),b()).nullish(),annotations:z.nullish(),text:v()}),Or=O({range:L.nullish(),text:v()}),kr=O({_meta:x(v(),b()).nullish(),contentChanges:E(Or),sessionId:V,uri:v(),version:y()});O({method:v(),params:w([Rn,Wn,kr,Hn,Gn,Un,Ln,Xn,it]).nullish()});var Ar=w([C(`full`),C(`incremental`)]),jr=O({_meta:x(v(),b()).nullish(),syncKind:Ar}),Mr=O({_meta:x(v(),b()).nullish(),didChange:jr.nullish(),didClose:Tt.nullish(),didFocus:Et.nullish(),didOpen:Dt.nullish(),didSave:Ot.nullish()}),Nr=O({_meta:x(v(),b()).nullish(),document:Mr.nullish()}),Pr=O({_meta:x(v(),b()).nullish(),context:Kt.nullish(),events:Nr.nullish()}),Fr=O({_meta:x(v(),b()).nullish(),auth:mt.optional().default({}),loadSession:T().optional().default(!1),mcpCapabilities:_t.optional().default({http:!1,sse:!1}),nes:Pr.nullish(),positionEncoding:on.nullish(),promptCapabilities:cn.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:ur.optional().default({})}),Ir=O({_meta:x(v(),b()).nullish(),agentCapabilities:Fr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:lt.nullish(),authMethods:E(Ie).optional().default([]),protocolVersion:ln}),Lr=w([O({_meta:x(v(),b()).nullish(),mimeType:v().nullish(),text:v(),uri:v()}),ze]),Rr=O({_meta:x(v(),b()).nullish(),annotations:z.nullish(),resource:Lr}),zr=w([Dr.and(O({type:C(`text`)})),xn.and(O({type:C(`image`)})),bn.and(O({type:C(`audio`)})),Sn.and(O({type:C(`resource_link`)})),Rr.and(O({type:C(`resource`)}))]),Br=O({_meta:x(v(),b()).nullish(),content:zr}),G=O({_meta:x(v(),b()).nullish(),content:zr,messageId:v().nullish()}),Vr=O({_meta:x(v(),b()).nullish(),messageId:v().nullish(),prompt:E(zr),sessionId:V}),Hr=O({anyOf:E(tt)}),Ur=w([Br.and(O({type:C(`content`)})),Ge.and(O({type:C(`diff`)})),Cr.and(O({type:C(`terminal`)}))]),Wr=v(),Gr=O({sessionId:V,toolCallId:Wr.nullish()}),Kr=D(w([Gr,vn]),O({elicitationId:Ye,url:v().url()})),qr=O({_meta:x(v(),b()).nullish(),line:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:v()}),Jr=w([C(`pending`),C(`in_progress`),C(`completed`),C(`failed`)]),Yr=w([C(`read`),C(`edit`),C(`delete`),C(`move`),C(`search`),C(`execute`),C(`think`),C(`fetch`),C(`switch_mode`),C(`other`)]),Xr=O({_meta:x(v(),b()).nullish(),content:E(Ur).optional(),kind:Yr.optional(),locations:E(qr).optional(),rawInput:b().optional(),rawOutput:b().optional(),status:Jr.optional(),title:v(),toolCallId:Wr}),Zr=O({_meta:x(v(),b()).nullish(),content:E(Ur).nullish(),kind:Yr.nullish(),locations:E(qr).nullish(),rawInput:b().optional(),rawOutput:b().optional(),status:Jr.nullish(),title:v().nullish(),toolCallId:Wr}),Qr=O({_meta:x(v(),b()).nullish(),options:E(Zt),sessionId:V,toolCall:Zr}),$r=O({_meta:x(v(),b()).nullish(),hint:v()}),ei=O({_meta:x(v(),b()).nullish(),description:v(),input:$r.nullish(),name:v()}),ti=O({_meta:x(v(),b()).nullish(),availableCommands:E(ei)}),ni=w([O({enum:E(v()),type:Qe}),Hr]),ri=O({default:E(v()).nullish(),description:v().nullish(),items:ni,maxItems:y().nullish(),minItems:y().nullish(),title:v().nullish()}),ii=w([br.and(O({type:C(`string`)})),Jt.and(O({type:C(`number`)})),ut.and(O({type:C(`integer`)})),Be.and(O({type:C(`boolean`)})),ri.and(O({type:C(`array`)}))]),ai=O({description:v().nullish(),properties:x(v(),ii).optional().default({}),required:E(v()).nullish(),title:v().nullish(),type:Ze.optional().default(`object`)}),oi=D(w([D(w([Gr,vn]),O({requestedSchema:ai})).and(O({mode:C(`form`)})),Kr.and(O({mode:C(`url`)}))]),O({_meta:x(v(),b()).nullish(),message:v()})),si=O({cachedReadTokens:y().nullish(),cachedWriteTokens:y().nullish(),inputTokens:y(),outputTokens:y(),thoughtTokens:y().nullish(),totalTokens:y()});w([O({id:R,result:w([Ir,Re,gt,sr,or,er,ar,cr,He,mr,fr,O({_meta:x(v(),b()).nullish(),stopReason:vr,usage:si.nullish(),userMessageId:v().nullish()}),gr,_r,Sr,Ve,ot])}),O({error:rt,id:R})]);var ci=O({_meta:x(v(),b()).nullish(),cost:Ue.nullish(),size:y(),used:y()}),li=w([G.and(O({sessionUpdate:C(`user_message_chunk`)})),G.and(O({sessionUpdate:C(`agent_message_chunk`)})),G.and(O({sessionUpdate:C(`agent_thought_chunk`)})),Xr.and(O({sessionUpdate:C(`tool_call`)})),Zr.and(O({sessionUpdate:C(`tool_call_update`)})),tn.and(O({sessionUpdate:C(`plan`)})),ti.and(O({sessionUpdate:C(`available_commands_update`)})),rr.and(O({sessionUpdate:C(`current_mode_update`)})),Fn.and(O({sessionUpdate:C(`config_option_update`)})),tr.and(O({sessionUpdate:C(`session_info_update`)})),ci.and(O({sessionUpdate:C(`usage_update`)}))]),ui=O({_meta:x(v(),b()).nullish(),sessionId:V,update:li});O({method:v(),params:w([ui,Xe,it]).nullish()});var di=O({_meta:x(v(),b()).nullish(),sessionId:V,terminalId:v()}),fi=O({_meta:x(v(),b()).nullish(),exitCode:y().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:v().nullish()}),pi=O({name:v(),uri:v()}),mi=O({_meta:x(v(),b()).nullish(),repository:Bt.nullish(),workspaceFolders:E(pi).nullish(),workspaceUri:v().nullish()});O({id:R,method:v(),params:w([un,Le,ht,qt,Jn,ft,Kn,Qn,Bn,pr,dr,Vr,hr,mi,xr,zn,at]).nullish()});var hi=O({_meta:x(v(),b()).nullish(),content:v(),path:v(),sessionId:V});O({id:R,method:v(),params:w([hi,Yn,Qr,Vn,Tr,Zn,di,qn,oi,at]).nullish()}),w([O({id:R,result:w([O({_meta:x(v(),b()).nullish()}),gn,Tn,We,Er,_n,fi,dt,qe,ot])}),O({error:rt,id:R})]),e();function gi(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()}}})}}re();var _i,vi=class{constructor(e,n){t(this,`connection`,void 0);let r=e(this),i=async(e,t)=>{switch(e){case N.initialize:{let e=un.parse(t);return r.initialize(e)}case N.session_new:{let e=qt.parse(t);return r.newSession(e)}case N.session_load:{if(!r.loadSession)throw K.methodNotFound(e);let n=Jn.parse(t);return r.loadSession(n)}case N.session_list:{if(!r.listSessions)throw K.methodNotFound(e);let n=ft.parse(t);return r.listSessions(n)}case N.session_fork:{if(!r.unstable_forkSession)throw K.methodNotFound(e);let n=Kn.parse(t);return r.unstable_forkSession(n)}case N.session_resume:{if(!r.unstable_resumeSession)throw K.methodNotFound(e);let n=Qn.parse(t);return r.unstable_resumeSession(n)}case N.session_close:{if(!r.unstable_closeSession)throw K.methodNotFound(e);let n=Bn.parse(t);return r.unstable_closeSession(n)}case N.session_set_mode:{if(!r.setSessionMode)throw K.methodNotFound(e);let n=pr.parse(t);return await r.setSessionMode(n)??{}}case N.authenticate:{let e=Le.parse(t);return await r.authenticate(e)??{}}case N.logout:{if(!r.unstable_logout)throw K.methodNotFound(e);let n=ht.parse(t);return await r.unstable_logout(n)??{}}case N.session_prompt:{let e=Vr.parse(t);return r.prompt(e)}case N.session_set_model:{if(!r.unstable_setSessionModel)throw K.methodNotFound(e);let n=hr.parse(t);return await r.unstable_setSessionModel(n)??{}}case N.session_set_config_option:{if(!r.setSessionConfigOption)throw K.methodNotFound(e);let n=dr.parse(t);return r.setSessionConfigOption(n)}case N.nes_start:{if(!r.unstable_startNes)throw K.methodNotFound(e);let n=mi.parse(t);return r.unstable_startNes(n)}case N.nes_suggest:{if(!r.unstable_suggestNes)throw K.methodNotFound(e);let n=xr.parse(t);return r.unstable_suggestNes(n)}case N.nes_close:{if(!r.unstable_closeNes)throw K.methodNotFound(e);let n=zn.parse(t);return await r.unstable_closeNes(n)??{}}default:if(r.extMethod)return r.extMethod(e,t);throw K.methodNotFound(e)}},a=async(e,t)=>{switch(e){case N.session_cancel:{let e=Rn.parse(t);return r.cancel(e)}case N.document_did_open:{if(!r.unstable_didOpenDocument)return;let e=Wn.parse(t);return r.unstable_didOpenDocument(e)}case N.document_did_change:{if(!r.unstable_didChangeDocument)return;let e=kr.parse(t);return r.unstable_didChangeDocument(e)}case N.document_did_close:{if(!r.unstable_didCloseDocument)return;let e=Hn.parse(t);return r.unstable_didCloseDocument(e)}case N.document_did_save:{if(!r.unstable_didSaveDocument)return;let e=Gn.parse(t);return r.unstable_didSaveDocument(e)}case N.document_did_focus:{if(!r.unstable_didFocusDocument)return;let e=Un.parse(t);return r.unstable_didFocusDocument(e)}case N.nes_accept:{if(!r.unstable_acceptNes)return;let e=Ln.parse(t);return r.unstable_acceptNes(e)}case N.nes_reject:{if(!r.unstable_rejectNes)return;let e=Xn.parse(t);return r.unstable_rejectNes(e)}default:if(r.extNotification)return r.extNotification(e,t);throw K.methodNotFound(e)}};this.connection=new bi(i,a,n)}async sessionUpdate(e){return await this.connection.sendNotification(P.session_update,e)}async requestPermission(e){return await this.connection.sendRequest(P.session_request_permission,e)}async readTextFile(e){return await this.connection.sendRequest(P.fs_read_text_file,e)}async writeTextFile(e){return await this.connection.sendRequest(P.fs_write_text_file,e)??{}}async createTerminal(e){return new yi((await this.connection.sendRequest(P.terminal_create,e)).terminalId,e.sessionId,this.connection)}async unstable_createElicitation(e){return await this.connection.sendRequest(P.elicitation_create,e)}async unstable_completeElicitation(e){return await this.connection.sendNotification(P.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}};_i=Symbol.asyncDispose;var yi=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(P.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}async waitForExit(){return await this.connection.sendRequest(P.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}async kill(){return await this.connection.sendRequest(P.terminal_kill,{sessionId:this.sessionId,terminalId:this.id})??{}}async release(){return await this.connection.sendRequest(P.terminal_release,{sessionId:this.sessionId,terminalId:this.id})??{}}async[_i](){await this.release()}},bi=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 K)return e.toResult();if(e instanceof S)return K.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 K.internalError(t?JSON.parse(t):{}).toResult()}catch{return K.internalError({details:t}).toResult()}}}async tryCallNotificationHandler(e,t){try{return await this.notificationHandler(e,t),{result:null}}catch(e){if(e instanceof K)return e.toResult();if(e instanceof S)return K.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 K.internalError(t?JSON.parse(t):{}).toResult()}catch{return K.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 K(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}},K=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}}};se(),k(),ue(),ve(),de(),m(),_(),g(),n(),c(),h(),xe();function q(e,t){if(e)return t?ke(e)?e:Ae(t,e):e}var xi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,Si={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Ci(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=Si[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!xi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function wi(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ti=256;function Ei(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ti?t:t.slice(0,Ti-1)+`…`}function J(e,t){if(!t)return e;let n=M.resolve(t),r=M.resolve(e);return r.startsWith(n+M.sep)||r===n?M.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?J(t,n):`File`,c=q(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?J(e,n):void 0,a=q(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?J(e,n):void 0,o=q(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=q(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=j());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=j()),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=j();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:j()});for(let e of t)await n.sessionUpdate(e)}}}function Bi(e,t,n,r,i,a,o,c){return async(n,l,u,d,f,p)=>{let m=Hi(r);if(n.name===`ExitPlanMode`)return Vi(e,t,f,l,m,i,a,o,c);if(p!==void 0)return p;try{let e=await s(n,l,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:l},m,i),g={toolCallId:f,title:h.title,kind:h.kind,status:`pending`,rawInput:l},_=[{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 c?.(),{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:l}}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}ge(),Ce(),te(),pe(),e(),i(),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:`workmate`,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||oe(),n=await he(t),r=await l({dir:t}),i=[];for(let e of r){if(!e.cwd||await he(e.cwd)!==n)continue;let t=Ei(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 me(e.sessionId);if(t)try{await Oe(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 K.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 u(e);n&&n.messages.length>0&&(t=o(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 Ci(e,t)}function Ji(e){if(e!=null)try{return Ci(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})}k();function ta(){return le().permissions?.defaultMode}async function na(e,t={}){fe();let n=t.sessionId??j(),r=e.cwd;A(n,ce()),ie(r);let i=process.cwd(),o=!1;try{process.chdir(r),o=!0}catch{}ae(),be();try{let i=ye(),o=f(i),s=e._meta,c=Yi(s,`permissionMode`),l=Ki(c?s?.permissionMode:void 0,c,ta()),u=$(this),m=this.conn,h=Bi(m,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,u,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),g=Xi(),_={...d(),toolPermissionContext:{...i,mode:l,isBypassPermissionsModeAvailable:g}},[te,v]=await Promise.all([a(r),p(r)]);_.agentDefinitions=v;let y=new Se({cwd:r,tools:o,commands:te,mcpClients:[],agents:v.activeAgents,canUseTool:h,getAppState:()=>_,setAppState:e=>{let t=e(_);Object.assign(_,t)},readFileCache:new ee(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),b={currentModeId:l,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.`},...g?[{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`}]},x=we(),S=_e(),C={availableModels:x.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:S};y.setModel(S);let w=Qi(b,C),ne={queryEngine:y,cancelled:!1,cancelGeneration:0,cwd:r,modes:b,models:C,configOptions:w,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:u,appState:_,commands:te,sessionFingerprint:wi({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,ne),{sessionId:n,modes:b,models:C,configOptions:w}}finally{o&&process.chdir(i)}}Object.assign(Z.prototype,{createSession:na}),i(),r(),k(),pe();async function ra(e){let t=e.replay!==!1,n=this.sessions.get(e.sessionId);if(n){if(wi({cwd:e.cwd,mcpServers:e.mcpServers})===n.sessionFingerprint){let r=await me(e.sessionId,e.cwd);return A(e.sessionId,r?Te(r.filePath):null),ie(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 me(e.sessionId,e.cwd),i=r?Te(r.filePath):null;A(e.sessionId,i),ie(e.cwd);let a;if(r)try{let t=await u(e.sessionId);t&&t.messages.length>0&&(a=o(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:a});if(t&&a&&a.length>0){let t=this.sessions.get(e.sessionId);t&&await zi(e.sessionId,a,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 u(e.sessionId);if(!t||t.messages.length===0)return;let n=o(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)}}k();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=j();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(),A(e.sessionId,ce());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=Ei(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}),de(),xe();function ha(e,t){let n=Ee.toWeb(e);return gi(De.toWeb(t),n)}async function ga(){fe(),be();let e=ha(process.stdin,process.stdout),t,n=new vi(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 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{homedir as r}from"os";import{join as i}from"path";function a(e){let t=process.env.NODE_OPTIONS;return t?t.split(/\s+/).includes(e):!1}function o(e){if(!e)return!1;if(typeof e==`boolean`)return e;let t=e.toLowerCase().trim();return[`1`,`true`,`yes`,`on`].includes(t)}function s(e){if(e===void 0)return!1;if(typeof e==`boolean`)return!e;if(!e)return!1;let t=e.toLowerCase().trim();return[`0`,`false`,`no`,`off`].includes(t)}function c(){return o(process.env.CLAUDE_CODE_SIMPLE)||process.argv.includes(`--bare`)}function l(e){let t={};if(e)for(let n of e){let[e,...r]=n.split(`=`);if(!e||r.length===0)throw Error(`Invalid environment variable format: ${n}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);t[e]=r.join(`=`)}return t}function u(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||`us-east-1`}function d(){return process.env.CLOUD_ML_REGION||`us-east5`}function f(){return o(process.env.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR)}function p(){return!1}function m(){return!1}function h(e){if(e){let t=_.find(([t])=>e.startsWith(t));if(t)return process.env[t[1]]||d()}return d()}var g,_,v=e((()=>{n(),g=t(()=>(process.env.
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{homedir as r}from"os";import{join as i}from"path";function a(e){let t=process.env.NODE_OPTIONS;return t?t.split(/\s+/).includes(e):!1}function o(e){if(!e)return!1;if(typeof e==`boolean`)return e;let t=e.toLowerCase().trim();return[`1`,`true`,`yes`,`on`].includes(t)}function s(e){if(e===void 0)return!1;if(typeof e==`boolean`)return!e;if(!e)return!1;let t=e.toLowerCase().trim();return[`0`,`false`,`no`,`off`].includes(t)}function c(){return o(process.env.CLAUDE_CODE_SIMPLE)||process.argv.includes(`--bare`)}function l(e){let t={};if(e)for(let n of e){let[e,...r]=n.split(`=`);if(!e||r.length===0)throw Error(`Invalid environment variable format: ${n}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);t[e]=r.join(`=`)}return t}function u(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||`us-east-1`}function d(){return process.env.CLOUD_ML_REGION||`us-east5`}function f(){return o(process.env.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR)}function p(){return!1}function m(){return!1}function h(e){if(e){let t=_.find(([t])=>e.startsWith(t));if(t)return process.env[t[1]]||d()}return d()}var g,_,v=e((()=>{n(),g=t(()=>(process.env.WORKMATE_CONFIG_DIR??i(r(),`.workmate`)).normalize(`NFC`),()=>process.env.WORKMATE_CONFIG_DIR),_=[[`claude-haiku-4-5`,`VERTEX_REGION_CLAUDE_HAIKU_4_5`],[`claude-3-5-haiku`,`VERTEX_REGION_CLAUDE_3_5_HAIKU`],[`claude-3-5-sonnet`,`VERTEX_REGION_CLAUDE_3_5_SONNET`],[`claude-3-7-sonnet`,`VERTEX_REGION_CLAUDE_3_7_SONNET`],[`claude-opus-4-1`,`VERTEX_REGION_CLAUDE_4_1_OPUS`],[`claude-opus-4`,`VERTEX_REGION_CLAUDE_4_0_OPUS`],[`claude-sonnet-4-6`,`VERTEX_REGION_CLAUDE_4_6_SONNET`],[`claude-sonnet-4-5`,`VERTEX_REGION_CLAUDE_4_5_SONNET`],[`claude-sonnet-4`,`VERTEX_REGION_CLAUDE_4_0_SONNET`]]}));export{a,s as c,p as d,l as f,g as i,o as l,d as n,v as o,f as p,h as r,c as s,u as t,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,o as i}from"./envUtils-BDhHQY0-.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{E as s,O as c,S as l,i as u,l as d,n as f,s as p,v as m}from"./esm-lWlUmoUA.js";import{C as h,D as g,E as _,I as v,O as y,S as ee,V as te,_ as ne,a as b,d as re,k as ie,l as ae,n as oe,p as se,s as ce,t as le,w as ue,x as de,y as x}from"./esm-Cb-L4oAk.js";import{a as S,r as fe,t as pe}from"./esm-Bx6rTxIs.js";import{C as me,R as he,Wt as ge,pt as _e,tt as ve}from"./state-BemZdQIl.js";import{C as ye,R as be,i as xe,x as Se}from"./debug-BecbSVoN.js";import{Gt as Ce,Jt as we,Kt as C,Yt as Te}from"./settings-D4CpDv2y.js";import{d as Ee,m as De}from"./git-DBlOv64X.js";import{r as Oe,t as ke}from"./execFileNoThrow-DHyW8FMX.js";import{a as Ae,n as je,o as Me,r as Ne}from"./platform-B0uTQc9P.js";import{An as Pe,Bt as Fe,Ft as Ie,Gt as Le,_ as Re,jn as ze,u as Be}from"./model-Bgh_r4lg.js";import{i as Ve,t as He}from"./genericProcessUtils-B2HcDYhg.js";import{arch as Ue,hostname as We,platform as Ge,release as Ke}from"os";import{extname as qe}from"path";import{stat as Je}from"fs/promises";import{inspect as Ye}from"util";import*as Xe from"process";import{AsyncLocalStorage as Ze}from"async_hooks";function Qe(){return process.platform===`linux`&&r(process.env.CLAUDE_CODE_BUBBLEWRAP)}function $e(){return process.platform===`linux`?w??!1:!1}async function et(){if(T!==void 0)return T;if(process.platform===`darwin`)return T=null,null;try{let e=await He(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of Ce)if(e.includes(t))return T=t,t}}catch{}return T=null,null}async function tt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&C.platform!==`darwin`?await et()||`pycharm`:C.terminal}function nt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&C.platform!==`darwin`?T===void 0?`pycharm`:T||`pycharm`:C.terminal}async function rt(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await et()}var it,w,T,E,at=e((()=>{n(),Te(),i(),Oe(),Ve(),it=t(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await ke(`test`,[`-f`,`/.dockerenv`]);return e===0}),w=null,process.platform===`linux`&&Je(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{w=!0},()=>{w=!1}),E={...C,terminal:nt(),getIsDocker:it,getIsBubblewrapSandbox:Qe,isMuslEnvironment:$e,getTerminalWithJetBrainsDetectionAsync:tt,initJetBrainsDetection:rt}}));function ot(e){return st?.has(e)??!1}var st,ct=e((()=>{xe(),be()}));function D(){return O.getStore()}function lt(e,t){return O.run(e,t)}function ut(e){return e?.agentType===`subagent`}function dt(){let e=D();if(!(!ut(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function ft(){let e=D();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var O,pt=e((()=>{O=new Ze}));function mt(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function ht(){return r(process.env.OTEL_LOG_TOOL_DETAILS)}function gt(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&ot(t))}function _t(e,t,n){let r=vt(e);return!r||!Et.has(r.serverName)&&!gt(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function vt(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function yt(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function k(e,t=0){if(typeof e==`string`)return e.length>Dt?`${e.slice(0,Ot)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=kt)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,M).map(e=>k(e,t+1));return e.length>M&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,M).map(([e,n])=>[e,k(n,t+1)]);return n.length>M&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function bt(e){if(!ht())return;let t=ye(k(e));return t.length>j&&(t=t.slice(0,j)+`…[truncated]`),t}function A(e){let t=qe(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>At?`other`:n}function xt(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=A(t);e&&(r.add(e),n=e)}for(let t of e.split(Mt)){if(!t)continue;let e=t.split(Nt);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(jt.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=A(i);a&&!r.has(a)&&(r.add(a),n=n?n+`,`+a:a)}}if(n)return n}function St(){let e=D();if(e)return{agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};let t=process.env.CLAUDE_CODE_AGENT_ID,n=process.env.CLAUDE_CODE_PARENT_SESSION_ID,r=t?`standalone`:void 0;if(t||r||n)return{...t?{agentId:t}:{},...r?{agentType:r}:{},...n?{parentSessionId:n}:{}};let i=ve();return i?{parentSessionId:i}:{}}function Ct(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(N&&P){let e=n-P;e>0&&(r=(t.user-N.user+(t.system-N.system))/(e*1e3)*100)}return N=t,P=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function wt(e={}){let t=e.model?String(e.model):Be(),n=typeof e.betas==`string`?e.betas:Pe(t).join(`,`),[r,i]=await Promise.all([Ft(),Ee()]),a=Ct();return{model:t,sessionId:_e(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(he()),clientType:me(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...St(),...Ie()&&{subscriptionType:Ie()},...i&&{rh:i}}}function Tt(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,skillMode:o,observerMode:s,...c}=e,l={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,is_claude_ai_auth:r.isClaudeAiAuth,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(l.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(l.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(l.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(l.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(l.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(l.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(l.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(l.github_action_ref=r.githubActionRef),r.wslVersion&&(l.wsl_version=r.wslVersion),r.linuxDistroId&&(l.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(l.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(l.linux_kernel=r.linuxKernel),r.vcs&&(l.vcs=r.vcs),r.versionBase&&(l.version_base=r.versionBase);let u={session_id:c.sessionId,model:c.model,user_type:c.userType,is_interactive:c.isInteractive===`true`,client_type:c.clientType};if(c.betas&&(u.betas=c.betas),c.entrypoint&&(u.entrypoint=c.entrypoint),c.agentSdkVersion&&(u.agent_sdk_version=c.agentSdkVersion),c.sweBenchRunId&&(u.swe_bench_run_id=c.sweBenchRunId),c.sweBenchInstanceId&&(u.swe_bench_instance_id=c.sweBenchInstanceId),c.sweBenchTaskId&&(u.swe_bench_task_id=c.sweBenchTaskId),c.agentId&&(u.agent_id=c.agentId),c.parentSessionId&&(u.parent_session_id=c.parentSessionId),c.agentType&&(u.agent_type=c.agentType),t.githubActionsMetadata){let e=t.githubActionsMetadata;l.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let d;return(t.accountUuid||t.organizationUuid)&&(d={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:l,...i&&{process:Buffer.from(ye(i)).toString(`base64`)},...d&&{auth:d},core:u,additional:{...a&&{rh:a},...o&&{skill_mode:o},...s&&{observer_mode:s},...n}}}var Et,Dt,Ot,j,M,kt,At,jt,Mt,Nt,Pt,Ft,N,P,It=e((()=>{n(),Te(),at(),ze(),Re(),ge(),i(),ct(),Fe(),De(),Me(),pt(),Se(),Et=new Set,Dt=512,Ot=128,j=4*1024,M=20,kt=2,At=10,jt=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),Mt=/\s*(?:&&|\|\||[;|])\s*/,Nt=/\s+/,Pt=t(()=>{let e=`0.0.11`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),Ft=t(async()=>{let[e,t,n,i]=await Promise.all([C.getPackageManagers(),C.getRuntimes(),Ne(),je()]);return{platform:we(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:C.arch,nodeVersion:C.nodeVersion,terminal:E.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:C.isRunningWithBun(),isCi:r(process.env.CI),isClaubbit:r(process.env.CLAUBBIT),isClaudeCodeRemote:r(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:C.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:r(process.env.GITHUB_ACTIONS),isClaudeCodeAction:r(process.env.CLAUDE_CODE_ACTION),isClaudeAiAuth:Le(),version:`0.0.11`,versionBase:Pt(),buildTime:`2026-08-13T03:55:30.763Z`,deploymentEnvironment:C.detectDeploymentEnvironment(),...r(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Ae()&&{wslVersion:Ae()},...n??{},...i.length>0?{vcs:i.join(`,`)}:{}}}),N=null,P=null}));function Lt(e){return e.setValue(zt,!0)}function Rt(e){return e.getValue(zt)===!0}var zt,Bt=e((()=>{f(),zt=c(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function Vt(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ht(n)){p.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ut(r)){p.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Ht(e){return typeof e==`string`&&e!==``}function Ut(e){return e==null?!0:Array.isArray(e)?Wt(e):Gt(typeof e)}function Wt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Gt(e)){t=e;continue}return!1}return!1}}return!0}function Gt(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var Kt=e((()=>{f()}));function qt(){return e=>{p.error(Jt(e))}}function Jt(e){return typeof e==`string`?e:JSON.stringify(Yt(e))}function Yt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Xt=e((()=>{f()}));function Zt(e){try{Qt(e)}catch{}}var Qt,$t=e((()=>{Xt(),Qt=qt()}));function en(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){p.warn(`Unknown value ${Ye(t)} for ${e}, expected a number, using defaults`);return}return n}function F(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var tn=e((()=>{f()})),nn,rn=e((()=>{nn=`2.9.0`})),an,on=e((()=>{an=`process.runtime.name`})),I,sn=e((()=>{rn(),x(),on(),I={[g]:`opentelemetry`,[an]:`node`,[_]:ie,[y]:nn}})),L,cn=e((()=>{tn(),sn(),L=performance})),ln=e((()=>{cn()}));function R(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*vn)]}function un(e){return gn(R(L.timeOrigin),R(typeof e==`number`?e:L.now()))}function dn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=z),[n,r]}function fn(e){return e[0]*1e6+e[1]/1e3}function pn(e){return e[0]+e[1]/z}function mn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function hn(e){return mn(e)||typeof e==`number`||e instanceof Date}function gn(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=z&&(n[1]-=z,n[0]+=1),n}var _n,vn,z,yn=e((()=>{ln(),_n=9,vn=10**6,z=10**_n})),B,bn=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(B||(B={}))}));function xn(e){if(!Sn(e)||Cn(e)!==En)return!1;let t=An(e);if(t===null)return!0;let n=U.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&V.call(n)===kn}function Sn(e){return typeof e==`object`&&!!e}function Cn(e){return e==null?e===void 0?On:Dn:W&&W in Object(e)?wn(e):Tn(e)}function wn(e){let t=U.call(e,W),n=e[W],r=!1;try{e[W]=void 0,r=!0}catch{}let i=G.call(e);return r&&(t?e[W]=n:delete e[W]),i}function Tn(e){return G.call(e)}var En,Dn,On,V,kn,An,H,U,W,G,jn=e((()=>{En=`[object Object]`,Dn=`[object Null]`,On=`[object Undefined]`,V=Function.prototype.toString,kn=V.call(Object),An=Object.getPrototypeOf,H=Object.prototype,U=H.hasOwnProperty,W=Symbol?Symbol.toStringTag:void 0,G=H.toString}));function Mn(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Nn(t,e.shift(),0,n);return t}function K(e){return q(e)?e.slice():e}function Nn(e,t,n=0,r){let i;if(!(n>Ln)){if(n++,Y(e)||Y(t)||Fn(t))i=K(t);else if(q(e)){if(i=e.slice(),q(t))for(let e=0,n=t.length;e<n;e++)i.push(K(t[e]));else if(J(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=K(t[r]))}}}else if(J(e))if(J(t)){if(!In(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(Y(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Pn(e,s,r)||Pn(t,s,r))delete i[s];else{if(J(a)&&J(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Nn(i[s],c,n,r)}}}}else i=t;return i}}function Pn(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function q(e){return Array.isArray(e)}function Fn(e){return typeof e==`function`}function J(e){return!Y(e)&&!q(e)&&!Fn(e)&&typeof e==`object`}function Y(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function In(e,t){return!(!xn(e)||!xn(t))}var Ln,Rn=e((()=>{jn(),Ln=20})),zn,Bn=e((()=>{a(),zn=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),Vn,Hn=e((()=>{Bn(),a(),Vn=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new zn),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Un(e,t){return new Promise(n=>{d.with(Lt(d.active()),()=>{e.export(t,n)})})}var Wn=e((()=>{f(),Bt()})),Gn,X=e((()=>{Bt(),Kt(),$t(),Xt(),yn(),bn(),ln(),Rn(),Hn(),Wn(),Gn={_export:Un}}));function Kn(){if(Z===void 0)try{let e=globalThis.process.argv0;Z=e?`unknown_service:${e}`:`unknown_service`}catch{Z=`unknown_service`}return Z}var Z,qn=e((()=>{})),Q,Jn=e((()=>{Q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Yn(e,t){return er.FromAttributeList(Object.entries(e),t)}function Xn(){return Yn({[ue]:Kn(),[_]:I[_],[g]:I[g],[y]:I[y]})}function Zn(e){return e.map(([e,t])=>Q(t)?[e,t.catch(t=>{p.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Qn(e){if(typeof e==`string`||e===void 0)return e;p.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function $n(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;p.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var er,tr=e((()=>{f(),X(),x(),qn(),Jn(),a(),er=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Zn(t),r._asyncAttributesPending=t.filter(([e,t])=>Q(t)).length>0,r}constructor(e,t){o(this,`_rawAttributes`,void 0),o(this,`_asyncAttributesPending`,!1),o(this,`_schemaUrl`,void 0),o(this,`_memoizedAttributes`,void 0);let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(Q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Zn(this._rawAttributes),this._schemaUrl=Qn(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&p.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Q(n)){p.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=$n(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),nr,rr,ir=e((()=>{f(),x(),X(),a(),nr=class{constructor(){o(this,`_MAX_LENGTH`,255),o(this,`_COMMA_SEPARATOR`,`,`),o(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=F(`OTEL_RESOURCE_ATTRIBUTES`),r=F(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){p.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[ue]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},rr=new nr})),ar,or,sr,cr,lr,ur=e((()=>{ar=`host.arch`,or=`host.id`,sr=`host.name`,cr=`os.type`,lr=`os.version`}));async function dr(){if(!$)switch(Xe.platform){case`darwin`:$=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:$=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:$=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:$=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:$=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return $()}var $,fr=e((()=>{})),pr,mr,hr=e((()=>{pr=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},mr=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),gr,_r,vr=e((()=>{ur(),fr(),hr(),gr=class{detect(e){return{attributes:{[sr]:We(),[ar]:pr(Ue()),[or]:dr()}}}},_r=new gr})),yr,br,xr=e((()=>{ur(),hr(),yr=class{detect(e){return{attributes:{[cr]:mr(Ge()),[lr]:Ke()}}}},br=new yr})),Sr=e((()=>{vr(),xr(),ur()})),Cr=e((()=>{Sr()})),wr=e((()=>{ir(),Cr()})),Tr=e((()=>{tr(),wr(),qn()}));function Er(e){return Dr(e,new WeakSet)}function Dr(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Dr(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Dr(e,t))}return!1}var Or=e((()=>{})),kr,Ar=e((()=>{f(),b(),x(),Or(),a(),kr=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){o(this,`hrTime`,void 0),o(this,`hrTimeObserved`,void 0),o(this,`spanContext`,void 0),o(this,`resource`,void 0),o(this,`instrumentationScope`,void 0),o(this,`attributes`,{}),o(this,`_severityText`,void 0),o(this,`_severityNumber`,void 0),o(this,`_body`,void 0),o(this,`_eventName`,void 0),o(this,`_attributesCount`,0),o(this,`_droppedAttributesCount`,0),o(this,`_isReadonly`,!1),o(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:s,severityText:c,body:l,attributes:d={},exception:f,context:p}=n,h=Date.now();if(this.hrTime=ne(r??h),this.hrTimeObserved=ne(i??h),p){let e=u.getSpanContext(p);e&&m(e)&&(this.spanContext=e)}this.severityNumber=s,this.severityText=c,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(d),f!=null&&this._setException(f)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return p.warn(`Invalid attribute key: ${e}`),this;if(!Er(t))return p.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&p.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return p.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(de,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(h,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(h,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(de,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(ee,n.stack),t=!0)}t||p.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&p.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),jr,Mr=e((()=>{pe(),f(),Ar(),a(),jr=class{constructor(e,t){o(this,`instrumentationScope`,void 0),o(this,`_sharedState`,void 0),o(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||d.active(),r=e.severityNumber??S.UNSPECIFIED;if(r!==S.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=u.getSpanContext(n);if(e&&m(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return}let i=new kr(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==S.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||d.active();if(t.traceBased){let e=u.getSpanContext(r);if(e&&m(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),Nr,Pr=e((()=>{Nr=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),Fr,Ir=e((()=>{b(),a(),Fr=class{constructor(e,t){o(this,`processors`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>ae(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function Lr(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var Rr=e((()=>{})),zr,Br=e((()=>{zr=`otel.sdk.log.created`})),Vr,Hr=e((()=>{Br(),a(),Vr=class{constructor(e){o(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(zr,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),Ur,Wr=e((()=>{Ur=`0.215.0`})),Gr,Kr,qr,Jr=e((()=>{f(),pe(),Pr(),Ir(),Rr(),Hr(),Wr(),a(),Gr={disabled:!1,minimumSeverity:S.UNSPECIFIED,traceBased:!1},Kr=()=>({...Gr}),qr=class{constructor(e,t,n,r,i,a){o(this,`loggers`,new Map),o(this,`activeProcessor`,void 0),o(this,`registeredLogRecordProcessors`,[]),o(this,`resource`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),o(this,`logRecordLimits`,void 0),o(this,`processors`,void 0),o(this,`loggerMetrics`,void 0),o(this,`_loggerConfigurator`,void 0),o(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new Fr(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Nr,this._loggerConfigurator=i??Kr;let c=a?a.getMeter(`@opentelemetry/sdk-logs`,Ur):s();this.loggerMetrics=new Vr(c)}getLoggerConfig(e){let t=Lr(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),Yr,Xr=e((()=>{f(),pe(),le(),b(),Mr(),Jr(),a(),Yr=class{constructor(e={}){o(this,`_shutdownOnce`,void 0),o(this,`_sharedState`,void 0);let t={resource:e.resource??oe(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??Kr,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new qr(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new ce(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return p.warn(`A shutdown LoggerProvider cannot provide a Logger`),fe;e||p.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new jr({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(p.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(p.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),Zr,Qr=e((()=>{b(),Zr=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:se(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:re.SUCCESS})}}}));async function $r(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var ei,ti,ni=e((()=>{f(),b(),a(),ei=class{constructor(e,t,n){o(this,`_exportCompleted`,void 0),o(this,`_exportScheduledPromise`,void 0),o(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await $r(t),await d.with(te(d.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){v(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===re.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},ti=class{constructor(e,t){o(this,`_maxExportBatchSize`,void 0),o(this,`_maxQueueSize`,void 0),o(this,`_scheduledDelayMillis`,void 0),o(this,`_exportTimeoutMillis`,void 0),o(this,`_exporter`,void 0),o(this,`_currentExport`,null),o(this,`_finishedLogRecords`,[]),o(this,`_timer`,void 0),o(this,`_shutdownOnce`,void 0),o(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new ce(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new ei(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){v(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new ei(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,v(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),ri,ii=e((()=>{ni(),ri=class extends ti{onShutdown(){}}})),ai=e((()=>{ii()})),oi=e((()=>{ai()})),si=e((()=>{Xr(),Qr(),oi()}));export{xt as $,pn as A,Zt as B,Mn as C,un as D,gn as E,cn as F,Bt as G,Kt as H,L as I,vt as J,Rt as K,en as L,hn as M,mn as N,dn as O,R as P,A as Q,F as R,Rn as S,bn as T,Ut as U,$t as V,Vt as W,bt as X,yt as Y,wt as Z,Yn as _,Qr as a,ft as at,Vn as b,Tr as c,pt as ct,_r as d,rt as dt,It as et,vr as f,at as ft,tr as g,Xn as h,Zr as i,Tt as it,yn as j,fn as k,xr as l,lt,ir as m,ri as n,_t as nt,Yr as o,D as ot,rr as p,Lt as q,ii as r,mt as rt,Xr as s,dt as st,si as t,ht as tt,br as u,E as ut,X as v,B as w,Hn as x,Gn as y,tn as z};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,o as i}from"./envUtils-DcaKZlRU.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{E as s,O as c,S as l,i as u,l as d,n as f,s as p,v as m}from"./esm-lWlUmoUA.js";import{C as h,D as g,E as _,I as v,O as y,S as ee,V as te,_ as ne,a as b,d as re,k as ie,l as ae,n as oe,p as se,s as ce,t as le,w as ue,x as de,y as x}from"./esm-Cb-L4oAk.js";import{a as S,r as fe,t as pe}from"./esm-Bx6rTxIs.js";import{C as me,R as he,Wt as ge,pt as _e,tt as ve}from"./state-BPFYBqm1.js";import{C as ye,R as be,i as xe,x as Se}from"./debug-Dr1SjdXn.js";import{Gt as Ce,Kt as C,Yt as we,qt as Te}from"./settings-DiBMs2gM.js";import{d as Ee,m as De}from"./git-CoQQ6YEf.js";import{r as Oe,t as ke}from"./execFileNoThrow-mXq4K0rl.js";import{a as Ae,n as je,o as Me,r as Ne}from"./platform-Dg1c9F_1.js";import{An as Pe,Bt as Fe,Ft as Ie,Gt as Le,_ as Re,jn as ze,u as Be}from"./model-CDnVaVDR.js";import{i as Ve,t as He}from"./genericProcessUtils-Dc1pfb7J.js";import{arch as Ue,hostname as We,platform as Ge,release as Ke}from"os";import{extname as qe}from"path";import{stat as Je}from"fs/promises";import{inspect as Ye}from"util";import*as Xe from"process";import{AsyncLocalStorage as Ze}from"async_hooks";function Qe(){return process.platform===`linux`&&r(process.env.CLAUDE_CODE_BUBBLEWRAP)}function $e(){return process.platform===`linux`?w??!1:!1}async function et(){if(T!==void 0)return T;if(process.platform===`darwin`)return T=null,null;try{let e=await He(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of Ce)if(e.includes(t))return T=t,t}}catch{}return T=null,null}async function tt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&C.platform!==`darwin`?await et()||`pycharm`:C.terminal}function nt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&C.platform!==`darwin`?T===void 0?`pycharm`:T||`pycharm`:C.terminal}async function rt(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await et()}var it,w,T,E,at=e((()=>{n(),we(),i(),Oe(),Ve(),it=t(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await ke(`test`,[`-f`,`/.dockerenv`]);return e===0}),w=null,process.platform===`linux`&&Je(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{w=!0},()=>{w=!1}),E={...C,terminal:nt(),getIsDocker:it,getIsBubblewrapSandbox:Qe,isMuslEnvironment:$e,getTerminalWithJetBrainsDetectionAsync:tt,initJetBrainsDetection:rt}}));function ot(e){return st?.has(e)??!1}var st,ct=e((()=>{xe(),be()}));function D(){return O.getStore()}function lt(e,t){return O.run(e,t)}function ut(e){return e?.agentType===`subagent`}function dt(){let e=D();if(!(!ut(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function ft(){let e=D();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var O,pt=e((()=>{O=new Ze}));function mt(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function ht(){return r(process.env.OTEL_LOG_TOOL_DETAILS)}function gt(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&ot(t))}function _t(e,t,n){let r=vt(e);return!r||!Et.has(r.serverName)&&!gt(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function vt(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function yt(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function k(e,t=0){if(typeof e==`string`)return e.length>Dt?`${e.slice(0,Ot)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=kt)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,M).map(e=>k(e,t+1));return e.length>M&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,M).map(([e,n])=>[e,k(n,t+1)]);return n.length>M&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function bt(e){if(!ht())return;let t=ye(k(e));return t.length>j&&(t=t.slice(0,j)+`…[truncated]`),t}function A(e){let t=qe(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>At?`other`:n}function xt(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=A(t);e&&(r.add(e),n=e)}for(let t of e.split(Mt)){if(!t)continue;let e=t.split(Nt);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(jt.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=A(i);a&&!r.has(a)&&(r.add(a),n=n?n+`,`+a:a)}}if(n)return n}function St(){let e=D();if(e)return{agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};let t=process.env.CLAUDE_CODE_AGENT_ID,n=process.env.CLAUDE_CODE_PARENT_SESSION_ID,r=t?`standalone`:void 0;if(t||r||n)return{...t?{agentId:t}:{},...r?{agentType:r}:{},...n?{parentSessionId:n}:{}};let i=ve();return i?{parentSessionId:i}:{}}function Ct(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(N&&P){let e=n-P;e>0&&(r=(t.user-N.user+(t.system-N.system))/(e*1e3)*100)}return N=t,P=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function wt(e={}){let t=e.model?String(e.model):Be(),n=typeof e.betas==`string`?e.betas:Pe(t).join(`,`),[r,i]=await Promise.all([Ft(),Ee()]),a=Ct();return{model:t,sessionId:_e(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(he()),clientType:me(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...St(),...Ie()&&{subscriptionType:Ie()},...i&&{rh:i}}}function Tt(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,skillMode:o,observerMode:s,...c}=e,l={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,is_claude_ai_auth:r.isClaudeAiAuth,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(l.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(l.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(l.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(l.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(l.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(l.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(l.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(l.github_action_ref=r.githubActionRef),r.wslVersion&&(l.wsl_version=r.wslVersion),r.linuxDistroId&&(l.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(l.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(l.linux_kernel=r.linuxKernel),r.vcs&&(l.vcs=r.vcs),r.versionBase&&(l.version_base=r.versionBase);let u={session_id:c.sessionId,model:c.model,user_type:c.userType,is_interactive:c.isInteractive===`true`,client_type:c.clientType};if(c.betas&&(u.betas=c.betas),c.entrypoint&&(u.entrypoint=c.entrypoint),c.agentSdkVersion&&(u.agent_sdk_version=c.agentSdkVersion),c.sweBenchRunId&&(u.swe_bench_run_id=c.sweBenchRunId),c.sweBenchInstanceId&&(u.swe_bench_instance_id=c.sweBenchInstanceId),c.sweBenchTaskId&&(u.swe_bench_task_id=c.sweBenchTaskId),c.agentId&&(u.agent_id=c.agentId),c.parentSessionId&&(u.parent_session_id=c.parentSessionId),c.agentType&&(u.agent_type=c.agentType),t.githubActionsMetadata){let e=t.githubActionsMetadata;l.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let d;return(t.accountUuid||t.organizationUuid)&&(d={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:l,...i&&{process:Buffer.from(ye(i)).toString(`base64`)},...d&&{auth:d},core:u,additional:{...a&&{rh:a},...o&&{skill_mode:o},...s&&{observer_mode:s},...n}}}var Et,Dt,Ot,j,M,kt,At,jt,Mt,Nt,Pt,Ft,N,P,It=e((()=>{n(),we(),at(),ze(),Re(),ge(),i(),ct(),Fe(),De(),Me(),pt(),Se(),Et=new Set,Dt=512,Ot=128,j=4*1024,M=20,kt=2,At=10,jt=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),Mt=/\s*(?:&&|\|\||[;|])\s*/,Nt=/\s+/,Pt=t(()=>{let e=`0.0.12`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),Ft=t(async()=>{let[e,t,n,i]=await Promise.all([C.getPackageManagers(),C.getRuntimes(),Ne(),je()]);return{platform:Te(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:C.arch,nodeVersion:C.nodeVersion,terminal:E.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:C.isRunningWithBun(),isCi:r(process.env.CI),isClaubbit:r(process.env.CLAUBBIT),isClaudeCodeRemote:r(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:C.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:r(process.env.GITHUB_ACTIONS),isClaudeCodeAction:r(process.env.CLAUDE_CODE_ACTION),isClaudeAiAuth:Le(),version:`0.0.12`,versionBase:Pt(),buildTime:`2026-08-13T05:57:11.301Z`,deploymentEnvironment:C.detectDeploymentEnvironment(),...r(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Ae()&&{wslVersion:Ae()},...n??{},...i.length>0?{vcs:i.join(`,`)}:{}}}),N=null,P=null}));function Lt(e){return e.setValue(zt,!0)}function Rt(e){return e.getValue(zt)===!0}var zt,Bt=e((()=>{f(),zt=c(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function Vt(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ht(n)){p.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ut(r)){p.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Ht(e){return typeof e==`string`&&e!==``}function Ut(e){return e==null?!0:Array.isArray(e)?Wt(e):Gt(typeof e)}function Wt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Gt(e)){t=e;continue}return!1}return!1}}return!0}function Gt(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var Kt=e((()=>{f()}));function qt(){return e=>{p.error(Jt(e))}}function Jt(e){return typeof e==`string`?e:JSON.stringify(Yt(e))}function Yt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Xt=e((()=>{f()}));function Zt(e){try{Qt(e)}catch{}}var Qt,$t=e((()=>{Xt(),Qt=qt()}));function en(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){p.warn(`Unknown value ${Ye(t)} for ${e}, expected a number, using defaults`);return}return n}function F(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var tn=e((()=>{f()})),nn,rn=e((()=>{nn=`2.9.0`})),an,on=e((()=>{an=`process.runtime.name`})),I,sn=e((()=>{rn(),x(),on(),I={[g]:`opentelemetry`,[an]:`node`,[_]:ie,[y]:nn}})),L,cn=e((()=>{tn(),sn(),L=performance})),ln=e((()=>{cn()}));function R(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*vn)]}function un(e){return gn(R(L.timeOrigin),R(typeof e==`number`?e:L.now()))}function dn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=z),[n,r]}function fn(e){return e[0]*1e6+e[1]/1e3}function pn(e){return e[0]+e[1]/z}function mn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function hn(e){return mn(e)||typeof e==`number`||e instanceof Date}function gn(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=z&&(n[1]-=z,n[0]+=1),n}var _n,vn,z,yn=e((()=>{ln(),_n=9,vn=10**6,z=10**_n})),B,bn=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(B||(B={}))}));function xn(e){if(!Sn(e)||Cn(e)!==En)return!1;let t=An(e);if(t===null)return!0;let n=U.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&V.call(n)===kn}function Sn(e){return typeof e==`object`&&!!e}function Cn(e){return e==null?e===void 0?On:Dn:W&&W in Object(e)?wn(e):Tn(e)}function wn(e){let t=U.call(e,W),n=e[W],r=!1;try{e[W]=void 0,r=!0}catch{}let i=G.call(e);return r&&(t?e[W]=n:delete e[W]),i}function Tn(e){return G.call(e)}var En,Dn,On,V,kn,An,H,U,W,G,jn=e((()=>{En=`[object Object]`,Dn=`[object Null]`,On=`[object Undefined]`,V=Function.prototype.toString,kn=V.call(Object),An=Object.getPrototypeOf,H=Object.prototype,U=H.hasOwnProperty,W=Symbol?Symbol.toStringTag:void 0,G=H.toString}));function Mn(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Nn(t,e.shift(),0,n);return t}function K(e){return q(e)?e.slice():e}function Nn(e,t,n=0,r){let i;if(!(n>Ln)){if(n++,Y(e)||Y(t)||Fn(t))i=K(t);else if(q(e)){if(i=e.slice(),q(t))for(let e=0,n=t.length;e<n;e++)i.push(K(t[e]));else if(J(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=K(t[r]))}}}else if(J(e))if(J(t)){if(!In(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(Y(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Pn(e,s,r)||Pn(t,s,r))delete i[s];else{if(J(a)&&J(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Nn(i[s],c,n,r)}}}}else i=t;return i}}function Pn(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function q(e){return Array.isArray(e)}function Fn(e){return typeof e==`function`}function J(e){return!Y(e)&&!q(e)&&!Fn(e)&&typeof e==`object`}function Y(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function In(e,t){return!(!xn(e)||!xn(t))}var Ln,Rn=e((()=>{jn(),Ln=20})),zn,Bn=e((()=>{a(),zn=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),Vn,Hn=e((()=>{Bn(),a(),Vn=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new zn),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Un(e,t){return new Promise(n=>{d.with(Lt(d.active()),()=>{e.export(t,n)})})}var Wn=e((()=>{f(),Bt()})),Gn,X=e((()=>{Bt(),Kt(),$t(),Xt(),yn(),bn(),ln(),Rn(),Hn(),Wn(),Gn={_export:Un}}));function Kn(){if(Z===void 0)try{let e=globalThis.process.argv0;Z=e?`unknown_service:${e}`:`unknown_service`}catch{Z=`unknown_service`}return Z}var Z,qn=e((()=>{})),Q,Jn=e((()=>{Q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Yn(e,t){return er.FromAttributeList(Object.entries(e),t)}function Xn(){return Yn({[ue]:Kn(),[_]:I[_],[g]:I[g],[y]:I[y]})}function Zn(e){return e.map(([e,t])=>Q(t)?[e,t.catch(t=>{p.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Qn(e){if(typeof e==`string`||e===void 0)return e;p.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function $n(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;p.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var er,tr=e((()=>{f(),X(),x(),qn(),Jn(),a(),er=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Zn(t),r._asyncAttributesPending=t.filter(([e,t])=>Q(t)).length>0,r}constructor(e,t){o(this,`_rawAttributes`,void 0),o(this,`_asyncAttributesPending`,!1),o(this,`_schemaUrl`,void 0),o(this,`_memoizedAttributes`,void 0);let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(Q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Zn(this._rawAttributes),this._schemaUrl=Qn(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&p.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Q(n)){p.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=$n(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),nr,rr,ir=e((()=>{f(),x(),X(),a(),nr=class{constructor(){o(this,`_MAX_LENGTH`,255),o(this,`_COMMA_SEPARATOR`,`,`),o(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=F(`OTEL_RESOURCE_ATTRIBUTES`),r=F(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){p.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[ue]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},rr=new nr})),ar,or,sr,cr,lr,ur=e((()=>{ar=`host.arch`,or=`host.id`,sr=`host.name`,cr=`os.type`,lr=`os.version`}));async function dr(){if(!$)switch(Xe.platform){case`darwin`:$=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:$=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:$=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:$=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:$=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return $()}var $,fr=e((()=>{})),pr,mr,hr=e((()=>{pr=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},mr=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),gr,_r,vr=e((()=>{ur(),fr(),hr(),gr=class{detect(e){return{attributes:{[sr]:We(),[ar]:pr(Ue()),[or]:dr()}}}},_r=new gr})),yr,br,xr=e((()=>{ur(),hr(),yr=class{detect(e){return{attributes:{[cr]:mr(Ge()),[lr]:Ke()}}}},br=new yr})),Sr=e((()=>{vr(),xr(),ur()})),Cr=e((()=>{Sr()})),wr=e((()=>{ir(),Cr()})),Tr=e((()=>{tr(),wr(),qn()}));function Er(e){return Dr(e,new WeakSet)}function Dr(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Dr(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Dr(e,t))}return!1}var Or=e((()=>{})),kr,Ar=e((()=>{f(),b(),x(),Or(),a(),kr=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){o(this,`hrTime`,void 0),o(this,`hrTimeObserved`,void 0),o(this,`spanContext`,void 0),o(this,`resource`,void 0),o(this,`instrumentationScope`,void 0),o(this,`attributes`,{}),o(this,`_severityText`,void 0),o(this,`_severityNumber`,void 0),o(this,`_body`,void 0),o(this,`_eventName`,void 0),o(this,`_attributesCount`,0),o(this,`_droppedAttributesCount`,0),o(this,`_isReadonly`,!1),o(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:s,severityText:c,body:l,attributes:d={},exception:f,context:p}=n,h=Date.now();if(this.hrTime=ne(r??h),this.hrTimeObserved=ne(i??h),p){let e=u.getSpanContext(p);e&&m(e)&&(this.spanContext=e)}this.severityNumber=s,this.severityText=c,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(d),f!=null&&this._setException(f)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return p.warn(`Invalid attribute key: ${e}`),this;if(!Er(t))return p.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&p.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return p.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(de,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(h,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(h,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(de,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(ee,n.stack),t=!0)}t||p.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&p.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),jr,Mr=e((()=>{pe(),f(),Ar(),a(),jr=class{constructor(e,t){o(this,`instrumentationScope`,void 0),o(this,`_sharedState`,void 0),o(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||d.active(),r=e.severityNumber??S.UNSPECIFIED;if(r!==S.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=u.getSpanContext(n);if(e&&m(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return}let i=new kr(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==S.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||d.active();if(t.traceBased){let e=u.getSpanContext(r);if(e&&m(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),Nr,Pr=e((()=>{Nr=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),Fr,Ir=e((()=>{b(),a(),Fr=class{constructor(e,t){o(this,`processors`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>ae(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function Lr(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var Rr=e((()=>{})),zr,Br=e((()=>{zr=`otel.sdk.log.created`})),Vr,Hr=e((()=>{Br(),a(),Vr=class{constructor(e){o(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(zr,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),Ur,Wr=e((()=>{Ur=`0.215.0`})),Gr,Kr,qr,Jr=e((()=>{f(),pe(),Pr(),Ir(),Rr(),Hr(),Wr(),a(),Gr={disabled:!1,minimumSeverity:S.UNSPECIFIED,traceBased:!1},Kr=()=>({...Gr}),qr=class{constructor(e,t,n,r,i,a){o(this,`loggers`,new Map),o(this,`activeProcessor`,void 0),o(this,`registeredLogRecordProcessors`,[]),o(this,`resource`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),o(this,`logRecordLimits`,void 0),o(this,`processors`,void 0),o(this,`loggerMetrics`,void 0),o(this,`_loggerConfigurator`,void 0),o(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new Fr(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Nr,this._loggerConfigurator=i??Kr;let c=a?a.getMeter(`@opentelemetry/sdk-logs`,Ur):s();this.loggerMetrics=new Vr(c)}getLoggerConfig(e){let t=Lr(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),Yr,Xr=e((()=>{f(),pe(),le(),b(),Mr(),Jr(),a(),Yr=class{constructor(e={}){o(this,`_shutdownOnce`,void 0),o(this,`_sharedState`,void 0);let t={resource:e.resource??oe(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??Kr,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new qr(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new ce(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return p.warn(`A shutdown LoggerProvider cannot provide a Logger`),fe;e||p.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new jr({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(p.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(p.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),Zr,Qr=e((()=>{b(),Zr=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:se(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:re.SUCCESS})}}}));async function $r(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var ei,ti,ni=e((()=>{f(),b(),a(),ei=class{constructor(e,t,n){o(this,`_exportCompleted`,void 0),o(this,`_exportScheduledPromise`,void 0),o(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await $r(t),await d.with(te(d.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){v(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===re.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},ti=class{constructor(e,t){o(this,`_maxExportBatchSize`,void 0),o(this,`_maxQueueSize`,void 0),o(this,`_scheduledDelayMillis`,void 0),o(this,`_exportTimeoutMillis`,void 0),o(this,`_exporter`,void 0),o(this,`_currentExport`,null),o(this,`_finishedLogRecords`,[]),o(this,`_timer`,void 0),o(this,`_shutdownOnce`,void 0),o(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new ce(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new ei(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){v(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new ei(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,v(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),ri,ii=e((()=>{ni(),ri=class extends ti{onShutdown(){}}})),ai=e((()=>{ii()})),oi=e((()=>{ai()})),si=e((()=>{Xr(),Qr(),oi()}));export{xt as $,pn as A,Zt as B,Mn as C,un as D,gn as E,cn as F,Bt as G,Kt as H,L as I,vt as J,Rt as K,en as L,hn as M,mn as N,dn as O,R as P,A as Q,F as R,Rn as S,bn as T,Ut as U,$t as V,Vt as W,bt as X,yt as Y,wt as Z,Yn as _,Qr as a,ft as at,Vn as b,Tr as c,pt as ct,_r as d,rt as dt,It as et,vr as f,at as ft,tr as g,Xn as h,Zr as i,Tt as it,yn as j,fn as k,xr as l,lt,ir as m,ri as n,_t as nt,Yr as o,D as ot,rr as p,Lt as q,ii as r,mt as rt,Xr as s,dt as st,si as t,ht as tt,br as u,E as ut,X as v,B as w,Hn as x,Gn as y,tn as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as m,t as h}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{i as g,n as _,r as v,t as y}from"./figures-5ThXQEtq.js";import{n as b,t as x}from"./cwd-
|
|
1
|
+
import{i as e,n as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as m,t as h}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{i as g,n as _,r as v,t as y}from"./figures-5ThXQEtq.js";import{n as b,t as x}from"./cwd-Besi3Os3.js";import{w as ee,x as te}from"./debug-Dr1SjdXn.js";import{o as ne,s as re}from"./log-27kCA_9u.js";import{aborted as ie,callbackify as S,debuglog as ae,inspect as oe,promisify as se,stripVTControlCharacters as ce}from"node:util";import C,{execArgv as le,execPath as ue,hrtime as de,platform as fe}from"node:process";import w from"node:path";import{ChildProcess as pe,execFile as me,spawn as he,spawnSync as ge}from"node:child_process";import{appendFileSync as _e,createReadStream as ve,createWriteStream as ye,readFileSync as be,statSync as xe,writeFileSync as Se}from"node:fs";import{constants as T}from"node:os";import Ce from"node:tty";import{EventEmitter as we,addAbortListener as Te,on as Ee,once as E,setMaxListeners as De}from"node:events";import{Duplex as Oe,PassThrough as ke,Readable as D,Transform as Ae,Writable as je,getDefaultHighWaterMark as Me}from"node:stream";import{StringDecoder as Ne}from"node:string_decoder";import{fileURLToPath as Pe}from"node:url";import{Buffer as Fe}from"node:buffer";import{scheduler as Ie,setImmediate as Le,setTimeout as Re}from"node:timers/promises";import{serialize as ze}from"node:v8";import{finished as O}from"node:stream/promises";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var A=t((()=>{})),Be,Ve,He,Ue,We=t((()=>{Be=(e,t)=>{let n=Ue(Ve(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},Ve=e=>He(e)?e.toString():e,He=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Ue=e=>e instanceof URL?Pe(e):e})),Ge,Ke=t((()=>{A(),We(),Ge=(e,t=[],n={})=>{let r=Be(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]}})),qe,Je,j,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,M=t((()=>{({toString:qe}=Object.prototype),Je=e=>qe.call(e)===`[object ArrayBuffer]`,j=e=>qe.call(e)===`[object Uint8Array]`,Ye=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Xe=new TextEncoder,Ze=e=>Xe.encode(e),Qe=new TextDecoder,$e=e=>Qe.decode(e),et=(e,t)=>tt(e,t).join(``),tt=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new Ne(t),r=e.map(e=>typeof e==`string`?Ze(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},nt=e=>e.length===1&&j(e[0])?e[0]:it(rt(e)),rt=e=>e.map(e=>typeof e==`string`?Ze(e):e),it=e=>{let t=new Uint8Array(at(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},at=e=>{let t=0;for(let n of e)t+=n.length;return t}})),ot,st,ct,lt,ut,dt,ft,pt,mt,ht=t((()=>{A(),M(),ot=e=>Array.isArray(e)&&Array.isArray(e.raw),st=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=ct({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},ct=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=lt(i,e.raw[r]),c=ft(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>pt(e)):[pt(l)];return ft(c,u,s)},lt=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=ut.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(ut.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
|
|
2
2
|
`?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=dt[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},ut=new Set([` `,` `,`\r`,`
|
|
3
3
|
`]),dt={x:3,u:5},ft=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],pt=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return mt(e);throw e instanceof pe||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},mt=({stdout:e})=>{if(typeof e==`string`)return e;if(j(e))return $e(e);throw TypeError(e===void 0?`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`:`Unexpected "${typeof e}" stdout in template expression`)}})),N,gt,P,_t,F=t((()=>{N=e=>gt.includes(e),gt=[C.stdin,C.stdout,C.stderr],P=[`stdin`,`stdout`,`stderr`],_t=e=>P[e]??`stdio[${e}]`})),vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,I=t((()=>{A(),F(),vt=e=>{let t={...e};for(let n of At)t[n]=yt(e,n);return t},yt=(e,t)=>{let n=Array.from({length:bt(e)+1}),r=xt(e[t],n,t);return Ot(r,t)},bt=({stdio:e})=>Array.isArray(e)?Math.max(e.length,P.length):P.length,xt=(e,t,n)=>k(e)?St(e,t,n):t.fill(e),St=(e,t,n)=>{for(let r of Object.keys(e).sort(Ct))for(let i of Tt(r,n,t))t[i]=e[r];return t},Ct=(e,t)=>wt(e)<wt(t)?1:-1,wt=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,Tt=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=Et(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
|
|
4
4
|
It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{w as t,x as n}from"./debug-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{w as t,x as n}from"./debug-Dr1SjdXn.js";import{execSync as r}from"child_process";function i(e,n){return t`execSync: ${e.slice(0,100)}`,r(e,n)}var a=e((()=>{n()}));export{a as n,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{FT as t,PT as n,Qd as r,St as i,Tt as a,Xd as o,vc as s,yc as c}from"./loadAgentsDir-BXtV2jiO.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-BFeftDv0.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=i()!==null;return t?(0,g.jsx)(f,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(m()),await o(0,`prompt_input_exit`),null)}var g,_;e((()=>{n(),l(),d(),s(),r(),a(),g=u(),_=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{h as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as n,Mp as r,Xu as i,Zu as a,jp as o,og as s,sg as c}from"./loadAgentsDir-BXtV2jiO.js";import{D as l,Gt as u,I as d,P as f,T as p,fi as m,t as h,x as g}from"./src-P_wYS_NJ2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{Bt as v,G as y,Gn as b,Gt as x,Kn as S,_ as C,et as w,nt as T,rt as E,tt as D,x as O}from"./model-CDnVaVDR.js";import{n as k,t as A}from"./useExitOnCtrlCDWithKeybindings-BHQfwlAl.js";import{n as j,t as M}from"./modelOptions-ut0xePEe.js";function N({initial:e,sessionModel:t,onSelect:n,onCancel:r,isStandaloneCommand:i,showFastModeNotice:s,headerText:m}){let h=k(),_=e===null?I:e,[v,x]=(0,P.useState)(_),S=c(e=>E()?e.fastMode:!1),[C,w]=(0,P.useState)(()=>new Set(b(_)?[_.replace(/\[1m\]/i,``)]:[])),A=(0,P.useCallback)(()=>{if(!v||v===I)return;let e=v.replace(/\[1m\]/i,``);w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[v]),j=(0,P.useMemo)(()=>M(S??!1),[S]),N=(0,P.useMemo)(()=>e!==null&&!j.some(t=>t.value===e)?[...j,{value:e,label:O(e),description:`Current model`}]:j,[j,e]),L=(0,P.useMemo)(()=>N.map(e=>({...e,value:e.value===null?I:e.value})),[N]),R=(0,P.useMemo)(()=>L.some(e=>e.value===_)?_:L[0]?.value??void 0,[L,_]),z=Math.min(10,L.length),B=Math.max(0,L.length-z),V=L.find(e=>e.value===v)?.label,H=v!==void 0&&v!==I&&C.has(v.replace(/\[1m\]/i,``)),U=(0,P.useCallback)(e=>{x(e)},[]);u({"modelPicker:toggle1M":()=>A()},{context:`ModelPicker`});function W(e){if(e===I){n(null);return}let t=e.replace(/\[1m\]/i,``);n(C.has(t)?`${t}[1m]`:t)}let G=(0,F.jsxs)(d,{flexDirection:`column`,children:[(0,F.jsxs)(d,{flexDirection:`column`,children:[(0,F.jsxs)(d,{marginBottom:1,flexDirection:`column`,children:[(0,F.jsx)(f,{color:`remember`,bold:!0,children:`Select model`}),(0,F.jsx)(f,{dimColor:!0,children:m??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,F.jsxs)(f,{dimColor:!0,children:[`Currently using `,O(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,F.jsxs)(d,{flexDirection:`column`,marginBottom:1,children:[(0,F.jsx)(d,{flexDirection:`column`,children:(0,F.jsx)(a,{defaultValue:_,defaultFocusValue:R,options:L,onChange:W,onFocus:U,onCancel:r??(()=>{}),visibleOptionCount:z})}),B>0&&(0,F.jsx)(d,{paddingLeft:3,children:(0,F.jsxs)(f,{dimColor:!0,children:[`and `,B,` more…`]})})]}),(0,F.jsx)(d,{marginBottom:1,flexDirection:`column`,children:H?(0,F.jsxs)(f,{dimColor:!0,children:[`1M context on`,(0,F.jsx)(f,{color:`subtle`,children:` · Space to toggle`})]}):(0,F.jsxs)(f,{color:`subtle`,children:[`1M context off`,V?` for ${V}`:``,(0,F.jsx)(f,{color:`subtle`,children:` · Space to toggle`})]})}),E()?s?(0,F.jsx)(d,{marginBottom:1,children:(0,F.jsxs)(f,{dimColor:!0,children:[`Fast mode is `,(0,F.jsx)(f,{bold:!0,children:`ON`}),` and available with `,y,` only (/fast). Switching to other models turn off fast mode.`]})}):D()&&!T()?(0,F.jsx)(d,{marginBottom:1,children:(0,F.jsxs)(f,{dimColor:!0,children:[`Use `,(0,F.jsx)(f,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,y,` only).`]})}):null:null]}),i&&(0,F.jsx)(f,{dimColor:!0,italic:!0,children:h.pending?(0,F.jsxs)(F.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,F.jsxs)(p,{children:[(0,F.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,F.jsx)(o,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return i?(0,F.jsx)(g,{color:`permission`,children:G}):G}var P,F,I,L=e((()=>{m(),P=t(m(),1),S(),A(),w(),h(),n(),s(),C(),j(),r(),i(),F=_(),I=`__NO_PREFERENCE__`}));function R(e,t,n){if(!x())return!1;if(t)return!0;if(e===null||!b(e))return!1;let r=e.toLowerCase().replace(/\[1m\]$/,``).trim(),i=r===`opus`||r.includes(`opus-4-6`)||r.includes(`opus-4-7`),a=r===`sonnet`||r.includes(`sonnet-4-6`);return i&&n?!1:i||a}var z=e((()=>{v(),S()}));export{L as i,R as n,N as r,z as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ic as e,Lc as t,Rc as n,zc as r}from"./loadAgentsDir-BXtV2jiO.js";r();export{e as drainPendingExtraction,t as executeExtractMemories,n as initExtractMemories};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./fast-VOu2FUlV.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as n,lg as r,og as i,sg as a}from"./loadAgentsDir-BXtV2jiO.js";import{Gt as o,I as s,Lt as c,P as l,di as u,fi as d,j as f,t as p,ui as m,y as h}from"./src-P_wYS_NJ2.js";import{t as g}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as _,g as v,x as y}from"./settings-DiBMs2gM.js";import{c as b,h as x}from"./config-9rLTDOYW.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{l as w,v as T}from"./startupProfiler-Dc5r6LgE.js";import{G as E,H as D,J as O,K as k,U as A,W as j,X as M,et as N,it as P,lt as F,q as I,rt as L}from"./model-CDnVaVDR.js";import{n as R,t as z}from"./systemTheme-Ceakddth.js";function B({cooldown:e}){return e?(0,H.jsx)(l,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(l,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let n=R(b().theme);return t?m.dim(f(`promptBorder`,n)(`↯`)):f(`fastMode`,n)(`↯`)}var H,U=e((()=>{u(),d(),_(),p(),x(),z(),H=g()}));function W(e,t){k(),y(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!P(e.mainLoopModel);return{...e,...t?{mainLoopModel:I(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=a(e=>e.mainLoopModel),i=a(e=>e.fastMode),u=r(),[d,f]=(0,J.useState)(i??!1),p=O(),m=p.status===`cooldown`,g=t!==null,_=D(A(!0));function v(){g||(W(d,u),C(`tengu_fast_mode_toggled`,{enabled:d,source:`picker`}),d?e(`${V(d)} Fast mode ON${P(n)?``:` · model set to ${E}`} · ${_}`):(u(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function y(){if(g){i&&W(!1,u),e(`Fast mode OFF`,{display:`system`});return}e(i?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function b(){g||f(e=>!e)}return o({"confirm:yes":v,"confirm:nextField":b,"confirm:next":b,"confirm:previous":b,"confirm:cycleMode":b,"confirm:toggle":b},{context:`Confirmation`}),(0,Y.jsxs)(h,{title:(0,Y.jsxs)(l,{children:[(0,Y.jsx)(B,{cooldown:m}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${E}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:y,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(l,{children:[`Press `,e.keyName,` again to exit`]}):g?(0,Y.jsx)(l,{children:`Esc to cancel`}):(0,Y.jsx)(l,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsx)(l,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(s,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(l,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(l,{color:d?`fastMode`:void 0,bold:d,children:d?`ON `:`OFF`}),(0,Y.jsx)(l,{dimColor:!0,children:_})]})}),m&&p.status===`cooldown`&&(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsxs)(l,{color:`warning`,children:[p.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,w(p.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(l,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(c,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=M();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),C(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${P(i)?``:` · model set to ${E}`} · ${D(A(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!L())return null;await F();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=M();return C(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{d(),J=t(d(),1),p(),U(),n(),S(),i(),N(),T(),j(),v(),Y=g()}));export{U as a,V as i,q as n,X as r,G as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{Bt as a,Pt as o,_ as s,g as c,p as l,vn as u}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{Bt as a,Pt as o,_ as s,g as c,p as l,vn as u}from"./loadAgentsDir-BXtV2jiO.js";import{lr as d,ur as f}from"./state-BPFYBqm1.js";import{n as p,t as m}from"./cwd-Besi3Os3.js";import{P as h,R as g,c as _,f as v,i as ee,u as y}from"./debug-Dr1SjdXn.js";import{cr as b,g as x,n as te,or as ne}from"./settings-DiBMs2gM.js";import{c as re,h as ie}from"./config-9rLTDOYW.js";import{m as ae,p as oe,r as S}from"./git-CoQQ6YEf.js";import{n as se,r as ce}from"./execFileNoThrow-mXq4K0rl.js";import{o as le,s as C}from"./log-27kCA_9u.js";import{n as ue,r as w}from"./analytics-DJobLaWP.js";import{a as de,s as fe}from"./ripgrep-DQ_ILUJV.js";import*as T from"path";import{statSync as pe}from"fs";function me(e,t,n){if(t===0)return n?k:0;let r=e.charCodeAt(t-1);return he(r)?be:ge(r)&&_e(e.charCodeAt(t))?D:0}function he(e){return e===47||e===92||e===45||e===95||e===46||e===32}function ge(e){return e>=97&&e<=122}function _e(e){return e>=65&&e<=90}function E(){return new Promise(e=>setImmediate(e))}function ve(e,t){let n=new Set;for(let r of e){let e=r.length;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if(n===47||n===92){e=t;break}}let i=r.slice(0,e);if(i.length>0&&(n.add(i),n.size>=t))break}let r=Array.from(n);return r.sort((e,t)=>{let n=e.length-t.length;return n===0?e<t?-1:+(e>t):n}),r.slice(0,t).map(e=>({path:e,score:0}))}var ye,be,D,O,k,A,j,M,N,P,F,xe=e((()=>{n(),ye=16,be=8,D=6,O=4,k=8,A=3,j=1,M=100,N=64,P=new Int32Array(N),F=class{constructor(){r(this,`paths`,[]),r(this,`lowerPaths`,[]),r(this,`charBits`,new Int32Array),r(this,`pathLens`,new Uint16Array),r(this,`topLevelCache`,null),r(this,`readyCount`,0)}loadFromFileList(e){let t=new Set,n=[];for(let r of e)r.length>0&&!t.has(r)&&(t.add(r),n.push(r));this.buildIndex(n)}loadFromFileListAsync(e){let t=()=>{};return{queryable:new Promise(e=>{t=e}),done:this.buildAsync(e,t)}}async buildAsync(e,t){let n=new Set,r=[],i=performance.now();for(let t=0;t<e.length;t++){let a=e[t];a.length>0&&!n.has(a)&&(n.add(a),r.push(a)),(t&255)==255&&performance.now()-i>4&&(await E(),i=performance.now())}this.resetArrays(r),i=performance.now();let a=!0;for(let e=0;e<r.length;e++)this.indexPath(e),(e&255)==255&&performance.now()-i>4&&(this.readyCount=e+1,a&&(t(),a=!1),await E(),i=performance.now());this.readyCount=r.length,t()}buildIndex(e){this.resetArrays(e);for(let t=0;t<e.length;t++)this.indexPath(t);this.readyCount=e.length}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=ve(e,M)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n>=97&&n<=122&&(r|=1<<n-97)}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0)return this.topLevelCache?this.topLevelCache.slice(0,t):[];let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),i=Math.min(r.length,N),a=Array(i),o=0;for(let e=0;e<i;e++){let t=r.charAt(e);a[e]=t;let n=t.charCodeAt(0);n>=97&&n<=122&&(o|=1<<n-97)}let s=i*24+k+32,c=[],l=-1/0,{paths:u,lowerPaths:d,charBits:f,pathLens:p,readyCount:m}=this;for(let e=0;e<m;e++){if((f[e]&o)!==o)continue;let r=n?u[e]:d[e],m=a[0],h=0,g=[],_=r.indexOf(m);if(_===-1)continue;g[h++]=_;for(let e=_+1;e<r.length;e++){if(r.charCodeAt(e)!==m.charCodeAt(0))continue;let t=r.charCodeAt(e-1);(t===47||t===92||t===45||t===95||t===46||t===32)&&(g[h++]=e)}let v=u[e],ee=p[e],y=Math.max(0,32-(ee>>2)),b=-1/0;for(let e=0;e<h;e++){P[0]=g[e];let n=0,o=0,u=P[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}P[e]=t;let i=t-u-1;i===0?o+=O:n+=A+i*j,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,P[0],!0);for(let e=1;e<i;e++)f+=me(v,P[e],!1);f+=y,f>b&&(b=f)}if(b===-1/0)continue;let x=b;if(c.length<t)c.push({path:v,fuzzScore:x}),c.length===t&&(c.sort((e,t)=>e.fuzzScore-t.fuzzScore),l=c[0].fuzzScore);else if(x>l){let e=0,t=c.length;for(;e<t;){let n=e+t>>1;c[n].fuzzScore<x?e=n+1:t=n}c.splice(e,0,{path:v,fuzzScore:x}),c.shift(),l=c[0].fuzzScore}}c.sort((e,t)=>t.fuzzScore-e.fuzzScore);let h=c.length,g=Math.max(h,1),_=Array(h);for(let e=0;e<h;e++){let t=c[e].path,n=e/g;_[e]={path:t,score:t.includes(`test`)?Math.min(n*1.05,1):n}}return _}}}));function I(){return z||(z=new F),z}function Se(){z=null,B=null,H++,U=null,W=[],G=[],K=[],V.clear(),q=null,J=null,Y=0,X=null,Z=null,Q=null}function Ce(e){let t=e.length,n=Math.max(1,Math.floor(t/500)),r=-2128831035;for(let i=0;i<t;i+=n){let t=e[i];for(let e=0;e<t.length;e++)r=(r^t.charCodeAt(e))*16777619|0;r=r*16777619|0}if(t>0){let n=e[t-1];for(let e=0;e<n.length;e++)r=(r^n.charCodeAt(e))*16777619|0}return`${t}:${(r>>>0).toString(16)}`}function we(){let e=S(m());if(!e)return null;try{return pe(T.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function Te(e,t,n){return n===t?e:e.map(e=>{let r=T.join(t,e);return T.relative(n,r)})}async function Ee(e){if(e.length===0||!z||W.length===0)return;let t=await ke(e),n=[...W,...G,...K,...e,...t],r=Ce(n);if(r===Q){_(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await z.loadFromFileListAsync(n).done,Q=r,_(`[FileIndex] rebuilt index with ${W.length} tracked + ${e.length} untracked files`)}async function De(e,t){let n=`${e}:${t}`;if(J===n)return q;let r=y(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,Be.default)(),s=!1,c=a.flatMap(e=>i.map(t=>T.join(e,t))),l=await Promise.all(c.map(e=>r.readFile(e,{encoding:`utf8`}).catch(()=>null)));for(let[e,t]of l.entries())t!==null&&(o.add(t),s=!0,_(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return q=u,J=n,u}async function Oe(e,t){let n=Date.now();_(`[FileIndex] getFilesUsingGit called`);let r=m(),i=S(r);if(!i)return _(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await se(oe(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(_(`[FileIndex] git ls-files (tracked) took ${Date.now()-a}ms`),o.code!==0)return _(`[FileIndex] git ls-files failed (code=${o.code}, stderr=${o.stderr}), falling back to ripgrep`),null;let s=Te(o.stdout.trim().split(`
|
|
2
2
|
`).filter(Boolean),i,r),c=await De(i,r);if(c){let e=s.length;s=c.filter(s),_(`[FileIndex] applied ignore patterns: ${e} -> ${s.length} files`)}W=s;let l=Date.now()-n;if(_(`[FileIndex] git ls-files: ${s.length} tracked files in ${l}ms`),w(`tengu_file_suggestions_git_ls_files`,{file_count:s.length,tracked_count:s.length,untracked_count:0,duration_ms:l}),!U){let e=t?[`-c`,`core.quotepath=false`,`ls-files`,`--others`,`--exclude-standard`]:[`-c`,`core.quotepath=false`,`ls-files`,`--others`],n=H;U=se(oe(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===H&&e.code===0){let t=Te(e.stdout.trim().split(`
|
|
3
3
|
`).filter(Boolean),i,r),n=await De(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),_(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}_(`[FileIndex] background untracked fetch: ${t.length} files`),Ee(t)}}).catch(e=>{_(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return s}catch(e){return _(`[FileIndex] git ls-files error: ${h(e)}`),null}}async function ke(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)Ae(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await E(),n=performance.now());return[...t].map(e=>e+T.sep)}function Ae(e,t,n,r){for(let i=t;i<n;i++){let t=T.dirname(e[i]);for(;t!==`.`&&!r.has(t);){let e=T.dirname(t);if(e===t)break;r.add(t),t=e}}}async function je(e){return(await Promise.all(l.map(t=>s(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function Me(e,t){_(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await Oe(e,t);if(n!==null)return _(`[FileIndex] using git ls-files result (${n.length} files)`),n;_(`[FileIndex] git ls-files returned null, falling back to ripgrep`);let r=Date.now(),i=[`--files`,`--follow`,`--hidden`,`--glob`,`!.git/`,`--glob`,`!.svn/`,`--glob`,`!.hg/`,`--glob`,`!.bzr/`,`--glob`,`!.jj/`,`--glob`,`!.sl/`];t||i.push(`--no-ignore-vcs`);let a=(await fe(i,`.`,e)).map(e=>T.relative(m(),e)),o=Date.now()-r;return _(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),w(`tengu_file_suggestions_ripgrep`,{file_count:a.length,duration_ms:o}),a}async function Ne(){let e=AbortSignal.timeout(1e4),t=I();try{let n=te(),r=re(),i=n.respectGitignore??r.respectGitignore??!0,a=m(),[o,s]=await Promise.all([Me(e,i),je(a)]);G=s;let c=[...o,...s],l=await ke(c);K=l;let u=[...l,...c],d=Ce(u);d===Z?_(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(u).done,Z=d,Q=null)}catch(e){C(e)}return t}function Pe(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return e.substring(0,r)}function Fe(e){if(e.length===0)return``;let t=e.map(e=>e.displayText),n=t[0];for(let e=1;e<t.length;e++){let r=t[e];if(n=Pe(n,r),n===``)return``}return n}function L(e,t){return{id:`file-${e}`,displayText:e,metadata:t===void 0?void 0:{score:t}}}function Ie(e,t){return e.search(t,$).map(e=>L(e.path,e.score))}function R(){if(B)return;let e=we();if(z&&!(e!==null&&e!==X)&&Date.now()-Y<He)return;let t=H,n=Date.now();I(),B=Ne().then(r=>t===H?(B=null,V.emit(),X=e,Y=Date.now(),_(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(_(`[FileIndex] Cache refresh failed: ${h(e)}`),C(e),t===H&&(B=null),I()))}async function Le(){let e=y(),t=m();try{return(await e.readdir(t)).map(e=>{let n=T.join(t,e.name),r=T.relative(t,n);return e.isDirectory()?r+T.sep:r})}catch(e){return C(e),[]}}async function Re(e,t=!1){if(!e&&!t)return[];if(te().fileSuggestion?.type===`command`)return(await a({...o(),query:e})).slice(0,$).map(L);if(e===``||e===`.`||e===`./`){let e=await Le();return R(),e.slice(0,$).map(L)}let n=Date.now();try{let t=B!==null;R();let r=e,i=`.`+T.sep;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=ne(r));let a=z?Ie(z,r):[],o=Date.now()-n;return _(`[FileIndex] generateFileSuggestions: ${a.length} results in ${o}ms (${t?`partial`:`full`} index)`),w(`tengu_file_suggestions_query`,{duration_ms:o,cache_hit:!t,result_count:a.length,query_length:e.length}),a}catch(e){return C(e),[]}}function ze(e,t,n,r,i,a){let o=typeof e==`string`?e:e.displayText;i(t.substring(0,r)+o+t.substring(r+n.length)),a(r+o.length)}var Be,z,B,V,Ve,H,U,W,G,K,q,J,Y,X,Z,Q,$,He,Ue=e((()=>{Be=t(i(),1),c(),xe(),ue(),ie(),p(),ee(),g(),ce(),v(),ae(),u(),le(),b(),de(),x(),f(),z=null,B=null,V=d(),Ve=V.subscribe,H=0,U=null,W=[],G=[],K=[],q=null,J=null,Y=0,X=null,Z=null,Q=null,$=15,He=5e3}));export{Ue as a,Re as i,Se as n,Ve as o,Fe as r,R as s,ze as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./firstPartyEventLogger-aFhcruXA.js";e();export{t as initialize1PEventLogging};
|