@readmagic/workmate 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-Vmmm7p1c.js → AddWorkspaceDirectory-ag2JTpmU.js} +1 -1
- package/dist/chunks/App-BuKmqFPm.js +1 -0
- package/dist/chunks/ApproveApiKey-CIWOi_7v.js +1 -0
- package/dist/chunks/ApproveApiKey-M6U-NafA.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-CLSACUmo.js → BypassPermissionsModeDialog-B05t83wa.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-BqNxQOXJ.js → ClaudeMdExternalIncludesDialog-CSywJdVL.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +1 -0
- package/dist/chunks/{DiffDialog-9AYwtupw.js → DiffDialog-DUbFrzKu.js} +2 -2
- package/dist/chunks/Doctor-BcnUfJ4I.js +1 -0
- package/dist/chunks/Doctor-Dz4TuYas.js +3 -0
- package/dist/chunks/ExitFlow-BwyAtIHx.js +2 -0
- package/dist/chunks/{Grove-B9-hhkZA.js → Grove-BDoVj02t.js} +2 -2
- package/dist/chunks/{HybridTransport-MxJ_W_np.js → HybridTransport-C_U0IJfz.js} +4 -4
- package/dist/chunks/InvalidConfigDialog-bih293Xt.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-YyQcHocx.js → InvalidSettingsDialog-Br8kQOHz.js} +1 -1
- package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +1 -0
- package/dist/chunks/MCPToolListView-DJ06N1DG.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BCpfHaBK.js → McpParsingWarnings-COa71S9q.js} +1 -1
- package/dist/chunks/MessageSelector-o4ULADFg.js +3 -0
- package/dist/chunks/Messages-qqwHuAW5.js +11 -0
- package/dist/chunks/{Onboarding-ClwHS5rh.js → Onboarding-BzuQjney.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-BSA9NrZc.js → PromptInputFooterSuggestions-to5eYBvI.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-Bb4KdIX_.js → PromptInputHelpMenu-CfMFx-TF.js} +1 -1
- package/dist/chunks/QueryEngine-Dt0BKUeF.js +1 -0
- package/dist/chunks/REPL-CUbEDqEl.js +133 -0
- package/dist/chunks/REPL-DMaKNhTa.js +1 -0
- package/dist/chunks/{RemoteSessionManager-CS6mywIn.js → RemoteSessionManager-Bf44A0Ol.js} +2 -2
- package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +1 -0
- package/dist/chunks/{SSETransport-CoxQ8YpH.js → SSETransport-DN4tCDEh.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +1 -0
- package/dist/chunks/Settings-DfdcmvOV.js +2 -0
- package/dist/chunks/{TeleportProgress-Doucj-50.js → TeleportProgress-C2LQVLav.js} +1 -1
- package/dist/chunks/TeleportRepoMismatchDialog-BZL8Zblz.js +1 -0
- package/dist/chunks/{TeleportResumeWrapper-D6kpr2c6.js → TeleportResumeWrapper-wPiIs8xg.js} +1 -1
- package/dist/chunks/{ThemePicker-DrC8tlp0.js → ThemePicker-BT_NaRQC.js} +1 -1
- package/dist/chunks/{TrustDialog-Fk4m_Sy4.js → TrustDialog-ACaJ_m7A.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-D_OUa4RT.js → ValidationErrorsList-C-hWdy_8.js} +1 -1
- package/dist/chunks/{WelcomeV2-DvfQHnZY.js → WelcomeV2-ZQRKlcT4.js} +1 -1
- package/dist/chunks/add-dir-SAKTkw0S.js +1 -0
- package/dist/chunks/{agentDisplay-B755vMZE.js → agentDisplay-CuSHqgZc.js} +1 -1
- package/dist/chunks/{agents-CIvP8l0s.js → agents-CMC0iQP4.js} +1 -1
- package/dist/chunks/agents-ZgRKpjHv.js +103 -0
- package/dist/chunks/allErrors-_cOQksHC.js +1 -0
- package/dist/chunks/{api-nSHc_GIQ.js → api-BbJfMXRS.js} +1 -1
- package/dist/chunks/api-DS1MiW01.js +1 -0
- package/dist/chunks/{auth-5QB6tsfB.js → auth-7mJGtlZp.js} +2 -2
- package/dist/chunks/auth-DGZzCbU0.js +1 -0
- package/dist/chunks/auth-DN1MUpB8.js +1 -0
- package/dist/chunks/{autoMode-BnUiK9Cu.js → autoMode-CBtY7ACs.js} +6 -6
- package/dist/chunks/{autonomy-Src6sKCp.js → autonomy-DuQmYhq6.js} +9 -9
- package/dist/chunks/{autonomy-C1aSgWPQ.js → autonomy-lJV7yWUl.js} +1 -1
- package/dist/chunks/autonomyPanel-DAQm6lDz.js +1 -0
- package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +1 -0
- package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +17 -0
- package/dist/chunks/{banner-D0P7wXdw.js → banner-1Wyeyawe.js} +1 -1
- package/dist/chunks/{bg-DAPORXF3.js → bg-CJ0YWFli.js} +2 -2
- package/dist/chunks/bg-CeUrRz_7.js +1 -0
- package/dist/chunks/{branch-DFWa4Oxo.js → branch-k3kirqbA.js} +2 -2
- package/dist/chunks/{break-cache-Chj9i9MP.js → break-cache-CAoZ9b72.js} +1 -1
- package/dist/chunks/bridgeConfig-CzRUPn-D.js +1 -0
- package/dist/chunks/{bridgeConfig-Bb6URf4Q.js → bridgeConfig-UgaUfuP6.js} +1 -1
- package/dist/chunks/{bridgeMessaging-C3huGcR3.js → bridgeMessaging-Ci5H68MX.js} +1 -1
- package/dist/chunks/{bridgePointer-DLYyvRKb.js → bridgePointer-BL8-lGvN.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-DFMftajD.js → bridgeStatusUtil-C36w15ge.js} +1 -1
- package/dist/chunks/btw-nVoVuIae.js +1 -0
- package/dist/chunks/caches-B8sM3Zys.js +1 -0
- package/dist/chunks/caches-Bp9MZ7IE.js +1 -0
- package/dist/chunks/{capacityWake-amzeeBz0.js → capacityWake-BOySRJUJ.js} +1 -1
- package/dist/chunks/ccrClient-Br4LAofR.js +1 -0
- package/dist/chunks/{claudeDesktop-CsJfF1b-.js → claudeDesktop-Bgds1-YT.js} +1 -1
- package/dist/chunks/{clear-ClFDpWVJ.js → clear-C4Vtnbye.js} +1 -1
- package/dist/chunks/{cliLaunch-BWcoyZDP.js → cliLaunch-BTpfAGGI.js} +1 -1
- package/dist/chunks/{client-DFlE4fYh.js → client-B9404qIP.js} +1 -1
- package/dist/chunks/client-BCAbKdNz.js +1 -0
- package/dist/chunks/client-CJE6gEvU.js +1 -0
- package/dist/chunks/commands-DL-BzoMQ.js +1 -0
- package/dist/chunks/compact-Cx7BPXLU.js +2 -0
- package/dist/chunks/config-S5OW4Xqr.js +1 -0
- package/dist/chunks/{config-Do1870_d.js → config-aRiTrtCv.js} +2 -2
- package/dist/chunks/{config-CVHMRMwd.js → config-kB2eazPX.js} +1 -1
- package/dist/chunks/context-BN7DEjoH.js +1 -0
- package/dist/chunks/{context-noninteractive-D5iQhasu.js → context-noninteractive-D91W2B8e.js} +5 -5
- package/dist/chunks/context-noninteractive-DPacEFJ1.js +1 -0
- package/dist/chunks/conversation-D5Nbu9eT.js +1 -0
- package/dist/chunks/conversation-hcUx9e-C.js +1 -0
- package/dist/chunks/{createSSHSession-CJtzNQdZ.js → createSSHSession-DecOR6M5.js} +6 -6
- package/dist/chunks/createSession-D27zvmOs.js +1 -0
- package/dist/chunks/createSession-DRqkLZWt.js +1 -0
- package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +40 -0
- package/dist/chunks/{datadog-DjeJThpV.js → datadog-bm551AVV.js} +1 -1
- package/dist/chunks/debug-BecbSVoN.js +39 -0
- package/dist/chunks/{debugUtils-DX0KAXNK.js → debugUtils-CmJfIUxW.js} +1 -1
- package/dist/chunks/{detached-X_yjYR7x.js → detached-CIyF0M5O.js} +1 -1
- package/dist/chunks/detectRepository-C15umvKN.js +1 -0
- package/dist/chunks/detectRepository-DDfLfKcM.js +1 -0
- package/dist/chunks/{diff-jEJJe58I.js → diff-DeK4bwjw.js} +1 -1
- package/dist/chunks/{directoryCompletion-BbXR2bfy.js → directoryCompletion-BJCu19HJ.js} +1 -1
- package/dist/chunks/doctor-BJORBomU.js +1 -0
- package/dist/chunks/{entry-oIqjxIjQ.js → entry-mdegyj8z.js} +3 -3
- package/dist/chunks/{esm-Cf4nSRjF.js → esm-Ka3lhafK.js} +1 -1
- package/dist/chunks/{execFileNoThrow-Dwu6psHW.js → execFileNoThrow-DHyW8FMX.js} +2 -2
- package/dist/chunks/execSyncWrapper-CDzB0BM1.js +1 -0
- package/dist/chunks/exit-CF3KBl-S.js +1 -0
- package/dist/chunks/{extraUsage-Mi66JwFZ.js → extraUsage-BrKbpBK-.js} +1 -1
- package/dist/chunks/extractMemories-4lBn134y.js +1 -0
- package/dist/chunks/fast-0Vi354KI.js +1 -0
- package/dist/chunks/{fast-BU4iUZ8E.js → fast-DWn40OcQ.js} +1 -1
- package/dist/chunks/{fileSuggestions-BMfQIDdW.js → fileSuggestions-C7Pwq2yj.js} +3 -3
- package/dist/chunks/{firstPartyEventLogger-B3cXgR67.js → firstPartyEventLogger-BHjBQH0J.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +1 -0
- package/dist/chunks/{flushGate-DgSDVGKZ.js → flushGate-DdJjxCes.js} +1 -1
- package/dist/chunks/gemini-DHv2iVfy.js +1 -0
- package/dist/chunks/generateSessionName-DhS_6oHd.js +1 -0
- package/dist/chunks/{genericProcessUtils-CmsUPyRz.js → genericProcessUtils-B2HcDYhg.js} +1 -1
- package/dist/chunks/git-DBlOv64X.js +6 -0
- package/dist/chunks/git-DF4RFFaT.js +1 -0
- package/dist/chunks/githubRepoPathMapping-CK56bUDe.js +1 -0
- package/dist/chunks/{goal-ZmSRBx4q.js → goal-BZG4gtnb.js} +3 -3
- package/dist/chunks/{grok-BXMvezWb.js → grok-BS57ZhyW.js} +1 -1
- package/dist/chunks/{grove-CeOjTaY6.js → grove-_zlQ83yR.js} +2 -2
- package/dist/chunks/{help-5DNZO6_H.js → help-C_2tdXHC.js} +1 -1
- package/dist/chunks/{hooks-C637tFtd.js → hooks-C7Bn7MBe.js} +2 -2
- package/dist/chunks/hooks-DT80Arzc.js +1 -0
- package/dist/chunks/{initReplBridge-D1h10vQ9.js → initReplBridge-NkZRcM77.js} +1 -1
- package/dist/chunks/{install-C-6ItpH0.js → install-Du-DSVzj.js} +1 -1
- package/dist/chunks/{instrumentation-DaiPDUst.js → instrumentation-DMs3b82f.js} +5 -5
- package/dist/chunks/{job-BeYzQUiR.js → job-rbX1VZmp.js} +1 -1
- package/dist/chunks/jwtUtils-OzxN2zts.js +1 -0
- package/dist/chunks/keybindings-CwdC_8S0.js +2 -0
- package/dist/chunks/{launchLocalMemory-CE4J98xO.js → launchLocalMemory-BLRCK1_o.js} +2 -2
- package/dist/chunks/{launchOnboarding-BfTdC6vp.js → launchOnboarding-Al_X75Vz.js} +1 -1
- package/dist/chunks/{loadAgentsDir-C7lOqvfh.js → loadAgentsDir-BL93ulMm.js} +619 -619
- package/dist/chunks/loadAgentsDir-eVKq8efm.js +1 -0
- package/dist/chunks/loadPluginHooks-B0au35a4.js +1 -0
- package/dist/chunks/{localSearch-BKrznW5x.js → localSearch-C5ipegd9.js} +1 -1
- package/dist/chunks/localSearch-CZlFfR_X.js +1 -0
- package/dist/chunks/{log-CezCRpAN.js → log-Dauqle-Z.js} +1 -1
- package/dist/chunks/{logoV2Utils-BkQfyQ1-.js → logoV2Utils-CkvOihX7.js} +1 -1
- package/dist/chunks/{magicDocs-BpVcON9o.js → magicDocs-DLav5QK0.js} +3 -3
- package/dist/chunks/main-CVNWNAoh.js +513 -0
- package/dist/chunks/{main-CvOv59-7.js → main-LMyE3jXY.js} +2 -2
- package/dist/chunks/managedEnv-CYepSnm8.js +1 -0
- package/dist/chunks/{managedEnv-DhWRJ5DK.js → managedEnv-DJSCuqCb.js} +1 -1
- package/dist/chunks/{mappers-bOab8ipV.js → mappers-DQxMcezy.js} +1 -1
- package/dist/chunks/mcp-BAbbEaBA.js +1 -0
- package/dist/chunks/mcp-Ct4Sum6A.js +6 -0
- package/dist/chunks/{mcp-VcGPYCkW.js → mcp-D5HkCqUh.js} +2 -2
- package/dist/chunks/{memoize-DsqYrbeR.js → memoize-FeyE7JEh.js} +1 -1
- package/dist/chunks/memory-COa7aUbx.js +1 -0
- package/dist/chunks/{mode-DlKnUM8l.js → mode-Bl2RZC8M.js} +2 -2
- package/dist/chunks/model-B7rtZ7KV.js +1 -0
- package/dist/chunks/{model-BsZ4sP_H.js → model-Bgh_r4lg.js} +1 -1
- package/dist/chunks/model-DiuEAv6h.js +1 -0
- package/dist/chunks/{modelOptions-CxP067Qv.js → modelOptions-BtEZe5BB.js} +1 -1
- package/dist/chunks/nativeInstaller-BEwayifa.js +1 -0
- package/dist/chunks/omit--yH_T4rf.js +1 -0
- package/dist/chunks/onChangeAppState-ZdwI7boX.js +1 -0
- package/dist/chunks/{openai-B9C2XN5Q.js → openai-DWs4D-nQ.js} +3 -3
- package/dist/chunks/panel-CoNfXy3K.js +1 -0
- package/dist/chunks/{parser-BwPXQomy.js → parser-BH4u7QiV.js} +1 -1
- package/dist/chunks/parser-BMIaRErw.js +1 -0
- package/dist/chunks/{partition-D-UhsUCx.js → partition-DLcW5Oo_.js} +1 -1
- package/dist/chunks/permissions-CaucYK3s.js +3 -0
- package/dist/chunks/pidLock-DgOBc1Xo.js +3 -0
- package/dist/chunks/{plan-CyU2zrCK.js → plan-BNYDTnQd.js} +1 -1
- package/dist/chunks/{platform-BMPbglug.js → platform-B0uTQc9P.js} +1 -1
- package/dist/chunks/plugin-BN-of1_H.js +17 -0
- package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +1 -0
- package/dist/chunks/pluginBlocklist-DXQlbG0P.js +1 -0
- package/dist/chunks/pluginCliCommands-CfdVNs8D.js +1 -0
- package/dist/chunks/pluginFlagging-DcJ_FQuv.js +1 -0
- package/dist/chunks/pluginOperations-DnhzFbYI.js +2 -0
- package/dist/chunks/pluginStartupCheck-CKBFaMFr.js +1 -0
- package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +1 -0
- package/dist/chunks/plugins-CBW7kPyp.js +4 -0
- package/dist/chunks/{poorMode-DEwQOAJt.js → poorMode-B_xEvuEV.js} +1 -1
- package/dist/chunks/poorMode-yH1o41cQ.js +1 -0
- package/dist/chunks/{print-eCRv_Li-.js → print-BZOx09SU.js} +16 -16
- package/dist/chunks/processBashCommand-dcCNCiBp.js +1 -0
- package/dist/chunks/processSlashCommand-YDiM63Qr.js +5 -0
- package/dist/chunks/prompt-CXGy0llt.js +1 -0
- package/dist/chunks/prompt-DovNDmcx.js +1 -0
- package/dist/chunks/{prompt-M2lu8_Oa.js → prompt-Dx7IWhBt.js} +2 -2
- package/dist/chunks/{promptEditor-DhcZY-iu.js → promptEditor-WCkmpejM.js} +2 -2
- package/dist/chunks/{protocolHandler-CkFaJKKo.js → protocolHandler-BiVWrpHi.js} +4 -4
- package/dist/chunks/{proxy-CuMaO_YV.js → proxy-CVn7o19p.js} +3 -3
- package/dist/chunks/reconciler-C2Nd_e4n.js +1 -0
- package/dist/chunks/refresh-B84H2Ezd.js +1 -0
- package/dist/chunks/{registerProtocol-CsNYRZKr.js → registerProtocol-E0Iu5hEx.js} +2 -2
- package/dist/chunks/{reload-plugins-B7JAE3b4.js → reload-plugins-D-3AUT9g.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CFLJhsB6.js → remoteBridgeCore-CV6we3ZA.js} +1 -1
- package/dist/chunks/remoteManagedSettings-D26Q09-7.js +1 -0
- package/dist/chunks/{rename-BCp2Vtqu.js → rename-CSavuBIE.js} +1 -1
- package/dist/chunks/{renderOptions-Q5oCLFIC.js → renderOptions-DDLbSMQU.js} +1 -1
- package/dist/chunks/resume-CROylN3J.js +2 -0
- package/dist/chunks/ripgrep-2M1GkXqJ.js +1 -0
- package/dist/chunks/{ripgrep-DvOOsDMv.js → ripgrep-C1ydIMzT.js} +5 -5
- package/dist/chunks/{runtimeObserver-CS_3BDNo.js → runtimeObserver-L7pSIWBT.js} +2 -2
- package/dist/chunks/{runtimeObserver-DYUva6g-.js → runtimeObserver-OU8KrZQG.js} +1 -1
- package/dist/chunks/sandbox-adapter-6UwMLh6e.js +1 -0
- package/dist/chunks/{sandbox-toggle--zNSKce_.js → sandbox-toggle-YrQNWGsr.js} +1 -1
- package/dist/chunks/searchExtraTools-Bdv5HJ74.js +1 -0
- package/dist/chunks/{session-CO3gEqQP.js → session-DUYsfPy_.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +1 -0
- package/dist/chunks/sessionObserver-B0zucj_c.js +1 -0
- package/dist/chunks/{sessionObserver-YkRHC-Aa.js → sessionObserver-Dv3Ba8eA.js} +2 -2
- package/dist/chunks/{sessionState-Bifmu95-.js → sessionState-D-SaBzWD.js} +2 -2
- package/dist/chunks/sessionStorage-BM1x51Z7.js +1 -0
- package/dist/chunks/{sessionTitle-COBSgSXS.js → sessionTitle-uCuYaNif.js} +2 -2
- package/dist/chunks/{sessionTracing-BrNx1k2V.js → sessionTracing-Bqb3vJTt.js} +3 -3
- package/dist/chunks/settings-BG15IFYx.js +1 -0
- package/dist/chunks/settings-D4CpDv2y.js +20 -0
- package/dist/chunks/settingsSync-BSrpnyqo.js +1 -0
- package/dist/chunks/setup-C62oq4AZ.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DEaw-X5j.js → shadowedRuleDetection-BzAZ57p2.js} +1 -1
- package/dist/chunks/{shellQuote-BYeOv3Ip.js → shellQuote-DS6WrivY.js} +2 -2
- package/dist/chunks/{sideQuestion-D0OKljee.js → sideQuestion-CvMBBjI8.js} +2 -2
- package/dist/chunks/sinks-WJ7nzLQs.js +1 -0
- package/dist/chunks/sinks-f7qYjbKJ.js +2 -0
- package/dist/chunks/skillChangeDetector-U5kRU5nd.js +1 -0
- package/dist/chunks/{skillGapStore-N_kmvXML.js → skillGapStore-CqaT8c0C.js} +2 -2
- package/dist/chunks/{skillLifecycle-C4F5RXuh.js → skillLifecycle-CnR8IqJM.js} +2 -2
- package/dist/chunks/skillSearchPanel-D9qrOXpI.js +21 -0
- package/dist/chunks/{skills-C4CTRN9o.js → skills-BgcFh0vy.js} +1 -1
- package/dist/chunks/startupProfiler-B4HBBbHN.js +1 -0
- package/dist/chunks/{startupProfiler-L_UWZ03w.js → startupProfiler-CmH_aVy2.js} +2 -2
- package/dist/chunks/{stats-IzV0_vEc.js → stats-B8uQ-UDi.js} +1 -1
- package/dist/chunks/{status-CeVP_uDT.js → status-BekdWoIj.js} +1 -1
- package/dist/chunks/status-D6KlRJmR.js +2 -0
- package/dist/chunks/{statusNoticeHelpers-Bb9gxdSt.js → statusNoticeHelpers-BMM8_uJ1.js} +1 -1
- package/dist/chunks/{stringUtils-C84IJ91d.js → stringUtils-C8PaYpQF.js} +1 -1
- package/dist/chunks/switcher-Ck9CrXrr.js +1 -0
- package/dist/chunks/{switcher-CCs9xl1z.js → switcher-DnAhkyIn.js} +1 -1
- package/dist/chunks/syncCache-ClP9aBqK.js +1 -0
- package/dist/chunks/{tasks-DZDhgx0w.js → tasks-Dmh6qikm.js} +1 -1
- package/dist/chunks/teleport-DH3IuAUQ.js +1 -0
- package/dist/chunks/{templateJobs-CrNPEKkh.js → templateJobs-CxqU-s5i.js} +1 -1
- package/dist/chunks/{terminalSetup-CBqcwQll.js → terminalSetup-BKGcmlWp.js} +1 -1
- package/dist/chunks/{terminalSetup-D-N8YPiQ.js → terminalSetup-Cy19F1Js.js} +4 -4
- package/dist/chunks/{theme-Dazsirbw.js → theme-U7lMFHQ0.js} +1 -1
- package/dist/chunks/{tmux-DewYVEBm.js → tmux-D5EvHWi3.js} +1 -1
- package/dist/chunks/{toolEventObserver-lnHJ9fLQ.js → toolEventObserver-D9qjoVl5.js} +1 -1
- package/dist/chunks/toolPool-69mfSPAs.js +1 -0
- package/dist/chunks/trustedDevice-B6AKlsl_.js +1 -0
- package/dist/chunks/trustedDevice-DL0pWP4_.js +1 -0
- package/dist/chunks/{types-3j8PS-Du.js → types-DafcFtmb.js} +2 -2
- package/dist/chunks/udsClient-CWnfsgFP.js +1 -0
- package/dist/chunks/{updateCCB-BPe9_FW6.js → updateCCB-C6XftzIG.js} +6 -6
- package/dist/chunks/{upstreamproxy-DF00RzGG.js → upstreamproxy-CXmjxHpl.js} +2 -2
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js → useExitOnCtrlCDWithKeybindings-DEEJhm_W.js} +1 -1
- package/dist/chunks/useMainLoopModel-6w7mhwhU.js +1 -0
- package/dist/chunks/useManagePlugins-CjnsO-Of.js +1 -0
- package/dist/chunks/{useMergedTools-Dk5cPqLc.js → useMergedTools-DbhqKk1-.js} +1 -1
- package/dist/chunks/{useSearchInput-C7Y1I9P9.js → useSearchInput-gUDbkLaC.js} +1 -1
- package/dist/chunks/{useSettingsErrors-DAEO7AyB.js → useSettingsErrors-CgPad-H0.js} +1 -1
- package/dist/chunks/{userAgent-CIq27vUR.js → userAgent-CU7Ndh79.js} +1 -1
- package/dist/chunks/util-B4oMhJKh.js +1 -0
- package/dist/chunks/validatePlugin-y_O_tCEL.js +1 -0
- package/dist/chunks/{vim-EYQn94Kx.js → vim-w37BfGZ5.js} +1 -1
- package/dist/chunks/{which-DzFN5TNM.js → which-BRWBO7Gu.js} +1 -1
- package/dist/chunks/windowsPaths-BY-IVNwQ.js +1 -0
- package/dist/chunks/windowsPaths-DtWHLjmE.js +1 -0
- package/dist/chunks/{workSecret-DUqdPy44.js → workSecret-BEhXgH2M.js} +1 -1
- package/dist/chunks/{workerRegistry-C07BcZIw.js → workerRegistry-Bq9bS5pw.js} +5 -5
- package/dist/chunks/worktree-4SUJ4dtz.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -3
- package/dist/chunks/App-C2yQjBgY.js +0 -1
- package/dist/chunks/ApproveApiKey-CKbv5C1x.js +0 -1
- package/dist/chunks/ApproveApiKey-MscC-ssL.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CL5NWsFL.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C0-psohX.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-4mOvEer_.js +0 -1
- package/dist/chunks/Doctor-DmgAwce2.js +0 -1
- package/dist/chunks/Doctor-jEs9chPk.js +0 -3
- package/dist/chunks/ExitFlow-DVKxFdpX.js +0 -2
- package/dist/chunks/InvalidConfigDialog-o9DF1REI.js +0 -1
- package/dist/chunks/MCPConnectionManager-CUTuaa8T.js +0 -1
- package/dist/chunks/MCPToolListView-CvqB4nCw.js +0 -1
- package/dist/chunks/MessageSelector-BLzw172f.js +0 -3
- package/dist/chunks/Messages-4K5sLmNh.js +0 -11
- package/dist/chunks/QueryEngine-DPHLSsax.js +0 -1
- package/dist/chunks/REPL-Bf46iQCN.js +0 -1
- package/dist/chunks/REPL-DIaAo9M9.js +0 -133
- package/dist/chunks/ResumeConversation-Br2KsBoe.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-i_YO3QvV.js +0 -1
- package/dist/chunks/Settings-BMXysXIx.js +0 -2
- package/dist/chunks/TeleportRepoMismatchDialog-B5I73j7Y.js +0 -1
- package/dist/chunks/add-dir-CZ6Clvq8.js +0 -1
- package/dist/chunks/agents-DHnNg4h6.js +0 -103
- package/dist/chunks/allErrors-CU89tF-z.js +0 -1
- package/dist/chunks/api-BSeE6MwB.js +0 -1
- package/dist/chunks/auth-BIGJth5U.js +0 -1
- package/dist/chunks/auth-CDQMhIZP.js +0 -1
- package/dist/chunks/autonomyPanel-DnHpuiy4.js +0 -1
- package/dist/chunks/backgroundHousekeeping-B-cw0UcS.js +0 -17
- package/dist/chunks/backgroundHousekeeping-BS_8z3_x.js +0 -1
- package/dist/chunks/bg-50rllUNh.js +0 -1
- package/dist/chunks/bridgeConfig-BeqChxJC.js +0 -1
- package/dist/chunks/btw-DSK9R2C8.js +0 -1
- package/dist/chunks/caches-BTQAW9zc.js +0 -1
- package/dist/chunks/caches-BVtSCnV1.js +0 -1
- package/dist/chunks/ccrClient-Bu7Tf1Z5.js +0 -1
- package/dist/chunks/client-BWQ4-rN7.js +0 -1
- package/dist/chunks/client-c-3-PW1F.js +0 -1
- package/dist/chunks/commands-Bi7k3Wg-.js +0 -1
- package/dist/chunks/compact-J-h0Yf4b.js +0 -2
- package/dist/chunks/config-yyFe87vW.js +0 -1
- package/dist/chunks/context-Tb1Ca2Q-.js +0 -1
- package/dist/chunks/context-noninteractive-soPYKAc9.js +0 -1
- package/dist/chunks/conversation-CSEtUxOY.js +0 -1
- package/dist/chunks/conversation-Dk1WDQuN.js +0 -1
- package/dist/chunks/createSession-DkT1GL8y.js +0 -1
- package/dist/chunks/createSession-eE8mswkv.js +0 -1
- package/dist/chunks/crossProjectResume-04n3Ppy9.js +0 -40
- package/dist/chunks/debug-RAynG_nM.js +0 -39
- package/dist/chunks/detectRepository-DgpNd87p.js +0 -1
- package/dist/chunks/detectRepository-ctF9KDbb.js +0 -1
- package/dist/chunks/doctor-B-Wag4C1.js +0 -1
- package/dist/chunks/execSyncWrapper-BTZJjCuv.js +0 -1
- package/dist/chunks/exit-BtW7LfRX.js +0 -1
- package/dist/chunks/extractMemories-CUrdiNcr.js +0 -1
- package/dist/chunks/fast-C60p6AqJ.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BfCYN7lt.js +0 -1
- package/dist/chunks/gemini-BwvSxGgn.js +0 -1
- package/dist/chunks/generateSessionName-DlrdedOk.js +0 -1
- package/dist/chunks/git-2c7WlGDL.js +0 -6
- package/dist/chunks/git-XtKbtJMc.js +0 -1
- package/dist/chunks/githubRepoPathMapping-DbWG4hFQ.js +0 -1
- package/dist/chunks/hooks-DWg07LmS.js +0 -1
- package/dist/chunks/jwtUtils-CUPXdX3W.js +0 -1
- package/dist/chunks/keybindings-DgIPdBy9.js +0 -2
- package/dist/chunks/loadAgentsDir-zikjxLvn.js +0 -1
- package/dist/chunks/loadPluginHooks-Cp8MSwAc.js +0 -1
- package/dist/chunks/localSearch-ZFyFy5FN.js +0 -1
- package/dist/chunks/main-9r5gLzUW.js +0 -605
- package/dist/chunks/managedEnv-B61yLpwp.js +0 -1
- package/dist/chunks/mcp-BckPBjaM.js +0 -6
- package/dist/chunks/mcp-CS1DA3JL.js +0 -1
- package/dist/chunks/memory-C5ohwh-T.js +0 -1
- package/dist/chunks/model-BGu1AGq0.js +0 -1
- package/dist/chunks/model-D19IIcll.js +0 -1
- package/dist/chunks/nativeInstaller-QB8cEJ18.js +0 -1
- package/dist/chunks/omit-DDUIPHnl.js +0 -1
- package/dist/chunks/onChangeAppState-RBl6H7ho.js +0 -1
- package/dist/chunks/panel-KW-wmEvU.js +0 -1
- package/dist/chunks/parser-xSBaQRLH.js +0 -1
- package/dist/chunks/permissions-BoLXYN1j.js +0 -3
- package/dist/chunks/pidLock-nJHbufJN.js +0 -3
- package/dist/chunks/plugin-C6-GQke5.js +0 -17
- package/dist/chunks/pluginAutoupdate-SlRFJlTT.js +0 -1
- package/dist/chunks/pluginBlocklist-n6Imlh3y.js +0 -1
- package/dist/chunks/pluginCliCommands-Bd96zSOQ.js +0 -1
- package/dist/chunks/pluginFlagging-DZaYzecY.js +0 -1
- package/dist/chunks/pluginOperations-D90IRawu.js +0 -2
- package/dist/chunks/pluginStartupCheck-Bxkxpm4k.js +0 -1
- package/dist/chunks/pluginStartupCheck-CB2q2dLv.js +0 -1
- package/dist/chunks/plugins-B9eSjLSA.js +0 -4
- package/dist/chunks/poorMode-BAnubpn1.js +0 -1
- package/dist/chunks/processBashCommand-B5F2Cl7K.js +0 -1
- package/dist/chunks/processSlashCommand-BC_D3cH5.js +0 -5
- package/dist/chunks/prompt-C1JPqinc.js +0 -1
- package/dist/chunks/prompt-DZhBz_Vu.js +0 -1
- package/dist/chunks/reconciler-B4GDm_iC.js +0 -1
- package/dist/chunks/refresh-DBVizOzg.js +0 -1
- package/dist/chunks/remoteManagedSettings-xh_MViZH.js +0 -1
- package/dist/chunks/resume-DVCSzKvv.js +0 -2
- package/dist/chunks/ripgrep-e-iewvTf.js +0 -1
- package/dist/chunks/sandbox-adapter-BFZFHplu.js +0 -1
- package/dist/chunks/searchExtraTools-ui5y2VSE.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-CZvCqQJ6.js +0 -1
- package/dist/chunks/sessionObserver-Ba7um95p.js +0 -1
- package/dist/chunks/sessionStorage-CedwLLQs.js +0 -1
- package/dist/chunks/settings-DkDH7WQT.js +0 -1
- package/dist/chunks/settings-DnptdP79.js +0 -20
- package/dist/chunks/settingsSync-PmU7SmkU.js +0 -1
- package/dist/chunks/setup-BEsBuzsk.js +0 -3
- package/dist/chunks/sinks-BJHgxz6Y.js +0 -1
- package/dist/chunks/sinks-D5-yhcgU.js +0 -2
- package/dist/chunks/skillChangeDetector-Dd0WPdkO.js +0 -1
- package/dist/chunks/skillSearchPanel-CftorvAM.js +0 -21
- package/dist/chunks/startupProfiler-D4FBdEQr.js +0 -1
- package/dist/chunks/status-Dzuw3hBv.js +0 -2
- package/dist/chunks/switcher-4KzBvuKH.js +0 -1
- package/dist/chunks/syncCache-CBRiRU5x.js +0 -1
- package/dist/chunks/teleport-Bw0jSxe9.js +0 -1
- package/dist/chunks/toolPool-CkXFlqsn.js +0 -1
- package/dist/chunks/trustedDevice-CFf5yaG-.js +0 -1
- package/dist/chunks/trustedDevice-CuwSv8dG.js +0 -1
- package/dist/chunks/udsClient-e9dIkwVA.js +0 -1
- package/dist/chunks/useMainLoopModel-2-eujv0n.js +0 -1
- package/dist/chunks/useManagePlugins-CYBIkaB1.js +0 -1
- package/dist/chunks/util-VO98TdOz.js +0 -1
- package/dist/chunks/validatePlugin-Kk6pxnO2.js +0 -1
- package/dist/chunks/windowsPaths-BU3yQWTB.js +0 -1
- package/dist/chunks/windowsPaths-DgZ3YY4a.js +0 -1
- package/dist/chunks/worktree-dFUkhVE_.js +0 -1
|
@@ -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-Cfdf7z7s.js";import{
|
|
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-Cfdf7z7s.js";import{w as ee,x as te}from"./debug-BecbSVoN.js";import{o as ne,s as re}from"./log-Dauqle-Z.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.
|
|
@@ -31,4 +31,4 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
|
31
31
|
`,LF:`
|
|
32
32
|
`,concatBytes:Au},Mu=(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},Nu={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Mu}})),Fu,Iu,Lu,Ru,zu,Bu,Vu=t((()=>{M(),Fu=(e,t)=>e?void 0:Iu.bind(void 0,t),Iu=function*(e,t){if(typeof t!=`string`&&!j(t)&&!Fe.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Lu=(e,t)=>e?Ru.bind(void 0,t):zu.bind(void 0,t),Ru=function*(e,t){Bu(e,t),yield t},zu=function*(e,t){if(Bu(e,t),typeof t!=`string`&&!j(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Bu=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
33
33
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
34
|
-
if (condition) { yield value; }`)}})),Hu,Uu,Wu,Gu,Ku=t((()=>{M(),Hu=(e,t,n)=>{if(n)return;if(e)return{transform:Uu.bind(void 0,new TextEncoder)};let r=new Ne(t);return{transform:Wu.bind(void 0,r),final:Gu.bind(void 0,r)}},Uu=function*(e,t){Fe.isBuffer(t)?yield Ye(t):typeof t==`string`?yield e.encode(t):yield t},Wu=function*(e,t){yield j(t)?e.write(t):t},Gu=function*(e){let t=e.end();t!==``&&(yield t)}})),qu,Ju,Yu,Xu,Zu,Qu,$u=t((()=>{qu=S(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Ju=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Qu}=t[n];for await(let i of r(e))yield*Ju(i,t,n+1)},Yu=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Xu(n,Number(t),e)},Xu=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Ju(r,n,t+1)},Zu=S(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Qu=function*(e){yield e}})),ed,td,nd,rd,id,ad,od=t((()=>{ed=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},td=(e,t)=>[...t.flatMap(t=>[...nd(t,e,0)]),...rd(e)],nd=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=ad}=t[n];for(let i of r(e))yield*nd(i,t,n+1)},rd=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*id(n,Number(t),e)},id=function*(e,t,n){if(e!==void 0)for(let r of e())yield*nd(r,n,t+1)},ad=function*(e){yield e}})),sd,cd,ld,ud=t((()=>{Z(),Pu(),Vu(),Ku(),$u(),od(),sd=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=ld(e,o,a),l=Y(t),u=Y(n),d=l?qu.bind(void 0,Ju,s):ed.bind(void 0,nd),f=l||u?qu.bind(void 0,Yu,s):ed.bind(void 0,rd),p=l||u?Zu.bind(void 0,s):void 0;return{stream:new Ae({writableObjectMode:r,writableHighWaterMark:Me(r),readableObjectMode:i,readableHighWaterMark:Me(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},cd=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a)e=td(ld(t,n,r),e);return e},ld=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Fu(r,s)},Hu(n,o,r),xu(n,a,r,c),{transform:e,final:t},{transform:Lu(i,s)},Ou({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)}})),dd,fd,pd,md,hd,gd=t((()=>{ud(),M(),Z(),dd=(e,t)=>{for(let n of fd(e))pd(e,n,t)},fd=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),pd=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${Zc[e]} with synchronous methods.`)}n.input=nt(i.map(({contents:e})=>e).map(e=>md(e,r)))}},md=(e,t)=>{let n=cd(e,t,`utf8`,!0);return hd(n),nt(n)},hd=e=>{let t=e.find(e=>typeof e!=`string`&&!j(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)}})),_d,vd,yd,bd,xd,Sd,Cd,wd=t((()=>{$a(),Z(),Sn(),L(),_d=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&Nt(n,r)&&!U.has(t)&&vd(r)&&(e.some(({type:e,value:t})=>e===`native`&&yd.has(t))||e.every(({type:e})=>X.has(e))),vd=e=>e===1||e===2,yd=new Set([`pipe`,`overlapped`]),bd=async(e,t,n,r)=>{for await(let i of e)Sd(t)||Cd(i,n,r)},xd=(e,t,n)=>{for(let r of e)Cd(r,t,n)},Sd=e=>e._readableState.pipes.length>0,Cd=(e,t,n)=>{gn({type:`output`,verboseMessage:bn(e),fdNumber:t,verboseInfo:n})}})),Td,Ed,Dd,Od,kd,Ad,jd=t((()=>{wd(),ud(),Pu(),M(),Z(),Hs(),Td=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Ed({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Ed=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=Ye(Bs(e,a,d)),{stdioItems:p,objectMode:m}=t[n],h=Dd([f],p,c,r),{serializedResult:g,finalResult:_=g}=Od({chunks:h,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});kd({serializedResult:g,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let v=s[n]?_:void 0;try{return r.error===void 0&&Ad(g,p,i),v}catch(e){return r.error=e,v}},Dd=(e,t,n,r)=>{try{return cd(e,t,n,!1)}catch(t){return r.error=t,e}},Od=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:nt(e)};let o=et(e,n);return r[a]?{serializedResult:o,finalResult:Su(o,!i[a],t)}:{serializedResult:o}},kd=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!_d({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=Su(e,!1,o);try{xd(s,t,r)}catch(e){n.error??(n.error=e)}},Ad=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>qc.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?_e(r,e):(n.add(t),Se(r,e))}}})),Md,Nd=t((()=>{M(),bu(),Md=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,vu(t,n,`all`)]:Array.isArray(t)?[vu(e,n,`all`),...t]:j(e)&&j(t)?it([e,t]):`${e}${t}`}})),Pd,Fd,Id,Ld,Rd,zd,Bd=t((()=>{z(),Pd=async(e,t)=>{let[n,r]=await Fd(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},Fd=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Id(e):n.value},Id=async e=>{try{return await E(e,`exit`)}catch{return Id(e)}},Ld=async e=>{let[t,n]=await e;if(!Rd(t,n)&&zd(t,n))throw new or;return[t,n]},Rd=(e,t)=>e===void 0&&t===void 0,zd=(e,t)=>e!==0||t!==null})),Vd,Hd,Ud=t((()=>{z(),Hs(),Bd(),Vd=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=Hd(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:zs(a,r,i)}},Hd=(e,t,n)=>e===void 0?zd(t,n)?new or:void 0:e})),Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d=t((()=>{Pn(),co(),uo(),rc(),xc(),_u(),bu(),gd(),jd(),Hs(),Nd(),Ud(),Wd=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Gd(e,t,n);return bc(Yd({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},Gd=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Nn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,Kd(n));return qd(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:fu(l,o)}},Kd=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,qd=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Jd(`ipcInput`),e&&Jd(`ipc: true`),n&&Jd(`detached: true`),r&&Jd(`cancelSignal`)},Jd=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Yd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Xd({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Vd(c,n),{output:m,error:h=l}=Td({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>vu(e,n,t)),_=vu(Md(m,n),n,`all`);return Qd({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},Xd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return dd(a,n),ge(...lo(e,t,Zd(n)))}catch(e){return Qs({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},Zd=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Vs(t)}),Qd=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?Zs({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):$s({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0})})),ef,tf,nf,rf,af,of=t((()=>{vi(),Yi(),Bi(),ef=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ti({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),tf({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),tf=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Pi(t,i);let a=Gi(e,t,n),o=new AbortController;try{return await Promise.race([nf(a,r,o),rf(a,n,o),af(a,n,o)])}catch(t){throw _i(e),t}finally{o.abort(),Ii(t,i)}},nf=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of Ee(e,`message`,{signal:n}))if(t(r))return r},rf=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),ii(t)},af=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw oi(r,t)}})),sf,cf,lf,uf,df,ff,pf=t((()=>{vi(),Yi(),Bi(),sf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>cf({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),cf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ti({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),Pi(t,a);let o=Gi(e,t,n),s=new AbortController,c={};return lf(e,o,s),uf({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),df({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},lf=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},uf=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=oi(i,t),n.abort()}catch{}},df=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of Ee(n,`message`,{signal:a.signal}))ff(o),yield e}catch{ff(o)}finally{a.abort(),Ii(t,s),r||_i(e),i&&await e}},ff=({error:e})=>{if(e)throw e}})),mf,hf,gf,_f=t((()=>{ya(),of(),pf(),Oa(),mf=(e,{ipc:t})=>{Object.assign(e,gf(e,!1,t))},hf=()=>{let e=C,t=C.channel!==void 0;return{...gf(e,!0,t),getCancelSignal:xa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},gf=(e,t,n)=>({sendMessage:ma.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:ef.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:sf.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})})})),vf,yf,bf,xf,Sf,Cf,wf,Tf=t((()=>{du(),rc(),xc(),vf=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{lu(r);let s=new pe;yf(s,r),Object.assign(s,{readable:xf,writable:Sf,duplex:Cf});let c=Qs({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1});return{subprocess:s,promise:wf(c,o,i)}},yf=(e,t)=>{let n=bf(),r=bf(),i=bf(),a=Array.from({length:t.length-3},bf),o=bf(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},bf=()=>{let e=new ke;return e.end(),e},xf=()=>new D({read(){}}),Sf=()=>new je({write(){}}),Cf=()=>new Oe({read(){},write(){}}),wf=async(e,t,n)=>bc(e,t,n)})),Ef,Df,Of,kf,Af=t((()=>{ud(),du(),Z(),Ef=(e,t)=>Zl(kf,e,t,!1),Df=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Zc[e]}.`)},Of={fileNumber:Df,generator:sd,asyncGenerator:sd,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:Oe.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},kf={input:{...Of,fileUrl:({value:e})=>({stream:ve(e)}),filePath:({value:{file:e}})=>({stream:ve(e)}),webStream:({value:e})=>({stream:D.fromWeb(e)}),iterable:({value:e})=>({stream:D.from(e)}),asyncIterable:({value:e})=>({stream:D.from(e)}),string:({value:e})=>({stream:D.from(e)}),uint8Array:({value:e})=>({stream:D.from(Fe.from(e))})},output:{...Of,fileUrl:({value:e})=>({stream:ye(e)}),filePath:({value:{file:e,append:t}})=>({stream:ye(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:je.fromWeb(e)}),iterable:Df,asyncIterable:Df,string:Df,uint8Array:Df}}}));function jf(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Uf(t);let t=e.some(({readableObjectMode:e})=>e),n=Mf(e,t),r=new zf({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}var Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp=t((()=>{s(),c(),l(),Mf=(e,t)=>{if(e.length===0)return Me(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)},Nf=new WeakMap,Pf=new WeakMap,Ff=new WeakMap,If=new WeakMap,Lf=new WeakMap,Rf=new WeakMap,zf=class extends ke{constructor(...e){super(...e),f(this,Nf,new Set([])),f(this,Pf,new Set([])),f(this,Ff,new Set([])),f(this,If,void 0),f(this,Lf,Symbol(`unpipe`)),f(this,Rf,new WeakMap)}add(e){if(Uf(e),d(Nf,this).has(e))return;d(Nf,this).add(e),d(If,this)??p(If,this,Bf(this,d(Nf,this),d(Lf,this)));let t=Wf({passThroughStream:this,stream:e,streams:d(Nf,this),ended:d(Pf,this),aborted:d(Ff,this),onFinished:d(If,this),unpipeEvent:d(Lf,this)});d(Rf,this).set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Uf(e),!d(Nf,this).has(e))return!1;let t=d(Rf,this).get(e);return t===void 0?!1:(d(Rf,this).delete(e),e.unpipe(this),await t,!0)}},Bf=async(e,t,n)=>{ep(e,tp);let r=new AbortController;try{await Promise.race([Vf(e,r),Hf(e,t,n,r)])}finally{r.abort(),ep(e,-tp)}},Vf=async(e,{signal:t})=>{try{await O(e,{signal:t,cleanup:!0})}catch(t){throw Yf(e,t),t}},Hf=async(e,t,n,{signal:r})=>{for await(let[i]of Ee(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Uf=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Wf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{ep(e,np);let s=new AbortController;try{await Promise.race([Gf(a,t,s),Kf({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),qf({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),ep(e,-np)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Zf(e):Jf(e))},Gf=async(e,t,{signal:n})=>{try{await e,n.aborted||Zf(t)}catch(e){n.aborted||Yf(t,e)}},Kf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await O(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Xf(r)?i.add(t):Qf(e,r)}},qf=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},Jf=e=>{e.writable&&e.end()},Yf=(e,t)=>{Xf(t)?Zf(e):Qf(e,t)},Xf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Zf=e=>{(e.readable||e.writable)&&e.destroy()},Qf=(e,t)=>{e.destroyed||(e.once(`error`,$f),e.destroy(t))},$f=()=>{},ep=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},tp=2,np=1})),ip,ap,op,sp,cp,lp=t((()=>{F(),ip=(e,t)=>{e.pipe(t),ap(e,t),sp(e,t)},ap=async(e,t)=>{if(!(N(e)||N(t))){try{await O(e,{cleanup:!0,readable:!0,writable:!1})}catch{}op(t)}},op=e=>{e.writable&&e.end()},sp=async(e,t)=>{if(!(N(e)||N(t))){try{await O(t,{cleanup:!0,readable:!1,writable:!0})}catch{}cp(e)}},cp=e=>{e.readable&&e.destroy()}})),up,dp,fp,pp,mp,hp,gp=t((()=>{rp(),F(),Ni(),Z(),lp(),up=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>X.has(e)))dp(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!X.has(e)))pp({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())ip(t.length===1?t[0]:jf(t),e)},dp=(e,t,n,r)=>{n===`output`?ip(e.stdio[r],t):ip(t,e.stdio[r]);let i=fp[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},fp=[`stdin`,`stdout`,`stderr`],pp=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;mp(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},mp=(e,{signal:t})=>{N(e)&&Mi(e,hp,t)},hp=2})),_p,vp=t((()=>{v(),_p=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=g(()=>{e.kill()});Te(r,()=>{i()})}})),yp,bp,xp,Sp,Cp,wp=t((()=>{Ke(),Mn(),ji(),We(),yp=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=An(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=bp(n,r,i),{sourceStream:d,sourceError:f}=Cp(e,l),{options:p,fileDescriptors:m}=H.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},bp=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=xp(e,t,...n);return{destination:r,destinationStream:xi(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},xp=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Sp,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||He(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ge(n,...r);return{destination:t(Sp)(i,a,o),pipeOptions:o}}if(H.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Sp=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Cp=(e,t)=>{try{return{sourceStream:Si(e,t)}}catch(e){return{sourceError:e}}}})),Tp,Ep,Dp,Op,kp=t((()=>{rc(),lp(),Tp=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Ep({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Dp({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Ep=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return cp(e),r;if(t!==void 0)return op(n),t},Dp=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>Qs({error:e,command:Op,escapedCommand:Op,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Op=`source.pipe(destination)`})),Ap,jp=t((()=>{Ap=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o}})),Mp,Np,Pp,Fp,Ip,Lp,Rp,zp=t((()=>{rp(),Ni(),lp(),Mp=(e,t,n)=>{let r=Ip.has(t)?Pp(e,t):Np(e,t);return Mi(e,Lp,n.signal),Mi(t,Rp,n.signal),Fp(t),r},Np=(e,t)=>{let n=jf([e]);return ip(n,t),Ip.set(t,n),n},Pp=(e,t)=>{let n=Ip.get(t);return n.add(e),n},Fp=async e=>{try{await O(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ip.delete(e)},Ip=new WeakMap,Lp=2,Rp=1})),Bp,Vp,Hp=t((()=>{kp(),Bp=(e,t)=>e===void 0?[]:[Vp(e,t)],Vp=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await ie(e,t),await n.remove(t),Dp({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})}})),Up,Wp,Gp,Kp=t((()=>{A(),wp(),kp(),jp(),zp(),Hp(),Up=(e,...t)=>{if(k(t[0]))return Up.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=yp(e,...t),i=Wp({...r,destination:n});return i.pipe=Up.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Wp=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Gp(e,i);Tp({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Mp(t,a,d);return await Promise.race([Ap(u),...Bp(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Gp=(e,t)=>Promise.allSettled([e,t])})),qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm=t((()=>{Ku(),Pu(),od(),qp=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Jp(t,o),Zp({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Jp=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Yp=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Xp(t,o,e);let s=e.readableObjectMode&&!a;return Zp({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Xp=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Zp=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=Ee(e,`data`,{signal:t.signal,highWaterMark:$p,highWatermark:$p});return em({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},Qp=Me(!0),$p=Qp,em=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=tm({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*nd(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*rd(s)}},tm=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Hu(e,n,!t),xu(e,i,!r,{})].filter(Boolean)})),rm,im,am,om,sm,cm,lm=t((()=>{Ns(),M(),wd(),nm(),Hs(),bu(),rm=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=im({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([am(e),d]);return}let f=Yp({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:yu(c,n),allMixed:s}),[p]=await Promise.all([om({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},im=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{_d({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await bd(Yp({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},am=async e=>{await Le(),e.readableFlowing===null&&e.resume()},om=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await ns(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await cs(n,{maxBuffer:a})):await ws(n,{maxBuffer:a})}catch(n){return cm(Ps({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},sm=async e=>{try{return await e}catch(e){return cm(e)}},cm=({bufferedData:e})=>Je(e)?new Uint8Array(e):e})),um,dm,fm,pm,mm,hm,gm,_m,vm,ym=t((()=>{um=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=dm(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],O(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||mm(e,t,n,r)}finally{o.abort()}},dm=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&fm(e,n,r),r},fm=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{pm(t,n),r.call(e,...i)}},pm=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},mm=(e,t,n,r)=>{if(!hm(e,t,n,r))throw e},hm=(e,t,n,r=!0)=>n.propagating?vm(e)||_m(e):(n.propagating=!0,gm(n,t)===r?vm(e):_m(e)),gm=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,_m=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,vm=e=>e?.code===`EPIPE`})),bm,xm,Sm=t((()=>{lm(),ym(),bm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>xm({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),xm=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=um(e,t,l);if(gm(l,t)){await u;return}let[d]=await Promise.all([rm({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d}})),Cm,wm,Tm,Em,Dm=t((()=>{rp(),Sm(),Cm=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?jf([e,t].filter(Boolean)):void 0,wm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>xm({...Tm(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Em(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Tm=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},Em=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode})),Om,km,Am=t((()=>{Sn(),L(),Om=e=>Nt(e,`ipc`),km=(e,t)=>{gn({type:`ipc`,verboseMessage:bn(e),fdNumber:`ipc`,verboseInfo:t})}})),jm,Mm,Nm=t((()=>{Hs(),Am(),I(),pf(),jm=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Om(a),s=jt(t,`ipc`),c=jt(n,`ipc`);for await(let t of cf({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(Is(e,i,c),i.push(t)),o&&km(t,a);return i},Mm=async(e,t)=>(await Promise.allSettled([e]),t)})),Pm,Fm,Im,Lm,Rm=t((()=>{Co(),La(),ei(),Na(),F(),Z(),lm(),Nm(),Ka(),Dm(),Sm(),Bd(),ym(),Pm=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=Pd(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=bm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=wm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),ee=[],te=jm({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:ee,verboseInfo:p}),ne=Fm(h,e,y),re=Im(m,y);try{return await Promise.race([Promise.all([{},Ld(v),Promise.all(b),x,te,Ga(e,d),...ne,...re]),g,Lm(e,_),...Fa(e,a,f,_),...Qr({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Aa({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??(f.terminationReason=`other`),Promise.all([{error:e},v,Promise.all(b.map(e=>sm(e))),sm(x),Mm(te,ee),Promise.allSettled(ne),Promise.allSettled(re)])}},Fm=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:um(e,r,n)),Im=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>W(t,{checkOpen:!1})&&!N(t)).map(({type:e,value:r,stream:i=r})=>um(i,n,t,{isSameDirection:X.has(e),stopOnExit:e===`native`}))),Lm=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n}})),zm,Bm,Vm,Hm=t((()=>{bi(),zm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Bm=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=yi();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Vm=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r}})),Um,Wm,Gm,Km,qm,Jm,Ym=t((()=>{ym(),Um=async e=>{if(e!==void 0)try{await Gm(e)}catch{}},Wm=async e=>{if(e!==void 0)try{await Km(e)}catch{}},Gm=async e=>{await O(e,{cleanup:!0,readable:!1,writable:!0})},Km=async e=>{await O(e,{cleanup:!0,readable:!0,writable:!1})},qm=async(e,t)=>{if(await e,t)throw t},Jm=(e,t,n)=>{n&&!_m(n)?e.destroy(n):t&&e.destroy()}})),Xm,Zm,Qm,$m,eh,th,nh,rh,ih=t((()=>{$a(),ji(),nm(),bi(),Hm(),Ym(),Xm=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||U.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Zm(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Qm(s,o),{read:f,onStdoutDataDone:p}=$m({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new D({read:f,destroy:S(nh.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return th({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},Zm=(e,t,n)=>{let r=Si(e,t);return{subprocessStdout:r,waitReadableDestroy:Bm(n,r,`readableDestroy`)}},Qm=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Qp},$m=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=yi(),o=qp({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){eh(this,o,a)},onStdoutDataDone:a}},eh=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},th=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Km(e),await r,await Um(i),await t,n.readable&&n.push(null)}catch(e){await Um(i),rh(n,e)}},nh=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Vm(n,t)&&(rh(e,r),await qm(t,r))},rh=(e,t)=>{Jm(e,e.readable,t)}})),ah,oh,sh,ch,lh,uh,dh,fh,ph=t((()=>{ji(),Hm(),Ym(),ah=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=oh(e,n,t),o=new je({...sh(r,e,i),destroy:S(dh.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return uh(r,o),o},oh=(e,t,n)=>{let r=xi(e,t);return{subprocessStdin:r,waitWritableFinal:Bm(n,r,`writableFinal`),waitWritableDestroy:Bm(n,r,`writableDestroy`)}},sh=(e,t,n)=>({write:ch.bind(void 0,e),final:S(lh.bind(void 0,e,t,n))}),ch=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},lh=async(e,t,n)=>{await Vm(n,t)&&(e.writable&&e.end(),await t)},uh=async(e,t,n)=>{try{await Gm(e),t.writable&&t.end()}catch(e){await Wm(n),fh(t,e)}},dh=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Vm(n,t),await Vm(r,t)&&(fh(e,i),await qm(t,i))},fh=(e,t)=>{Jm(e,e.writable,t)}})),mh,hh,gh=t((()=>{$a(),ih(),ph(),mh=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||U.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Zm(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=oh(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=Qm(c,s),{read:g,onStdoutDataDone:_}=$m({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new Oe({read:g,...sh(u,e,d),destroy:S(hh.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return th({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),uh(u,v,c),v},hh=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([nh({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),dh({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])}})),_h,vh,yh=t((()=>{$a(),ji(),nm(),_h=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||U.has(t),o=Si(e,n),s=qp({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return vh(s,o,e)},vh=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}}})),bh,xh=t((()=>{Hm(),ih(),ph(),gh(),yh(),bh=(e,{encoding:t})=>{let n=zm();e.readable=Xm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=ah.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=mh.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=_h.bind(void 0,e,t),e[Symbol.asyncIterator]=_h.bind(void 0,e,t,{})}})),Sh,Ch,wh,Th=t((()=>{Sh=(e,t)=>{for(let[n,r]of wh){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Ch=(async()=>{})().constructor.prototype,wh=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ch,e)])})),Eh,Dh,Oh,kh,Ah,jh,Mh=t((()=>{Ns(),Pn(),co(),ji(),uo(),_f(),rc(),xc(),Tf(),Af(),bu(),gp(),Jr(),vp(),Kp(),Dm(),Rm(),xh(),bi(),Th(),Eh=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Dh(e,t,n),{subprocess:f,promise:p}=kh({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Up.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Sh(f,p),H.set(f,{options:u,fileDescriptors:d}),f},Dh=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Nn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,n),u=Oh(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Ef(u,o)}},Oh=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},kh=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=he(...lo(e,t,n))}catch(e){return vf({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;De(1/0,l.signal);let u=[...c.stdio];up(c,s,l),_p(c,n,l);let d={},f=yi();c.kill=Ur.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Cm(c,n),bh(c,n),mf(c,n);let p=Ah({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:a,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Ah=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Pm({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});u.abort(),l.resolve();let _=m.map((e,n)=>vu(e,t,n)),v=vu(h,t,`all`);return bc(jh({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},jh=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?$s({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof Yo,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Zs({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u})})),Nh,Ph,Fh,Ih=t((()=>{A(),I(),Nh=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Ph(t,e[t],n)]));return{...e,...n}},Ph=(e,t,n)=>Fh.has(e)&&k(t)&&k(n)?{...t,...n}:n,Fh=new Set([`env`,...At])})),$,Lh,Rh,zh=t((()=>{A(),Ke(),ht(),$d(),Mh(),Ih(),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>Lh({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Lh=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,Nh(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Rh({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Wd(s,c,l):Eh(s,c,l,i)},Rh=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ge(...ot(t)?st(t,n):[t,...n]),c=Nh(Nh(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}}})),Bh,Vh,Hh,Uh,Wh,Gh=t((()=>{Bh=({file:e,commandArguments:t})=>Hh(e,t),Vh=({file:e,commandArguments:t})=>({...Hh(e,t),isSync:!0}),Hh=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=Uh(e);return{file:n,commandArguments:r}},Uh=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(Wh)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Wh=/ +/g})),Kh,qh,Jh,Yh,Xh,Zh,Qh=t((()=>{Kh=(e,t,n)=>{e.sync=t(Jh,n),e.s=e.sync},qh=({options:e})=>Yh(e),Jh=({options:e})=>({...Yh(e),isSync:!0}),Yh=e=>({options:{...Xh(e),...e}}),Xh=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Zh={preferLocal:!0}})),$h,eg,tg,ng,rg,ig,ag=t((()=>{zh(),Gh(),Ba(),Qh(),_f(),z(),$h=$(()=>({})),eg=$(()=>({isSync:!0})),$(Bh),$(Vh),$(Ra),$(qh,{},Zh,Kh),{sendMessage:tg,getOneMessage:ng,getEachMessage:rg,getCancelSignal:ig}=hf()}));function og(e,t,n=10*cg*sg){let r;r=t===void 0?{}:t instanceof AbortSignal?{abortSignal:t,timeout:n}:t;let{abortSignal:i,timeout:a=10*cg*sg,input:o,stdio:s=[`ignore`,`pipe`,`pipe`]}=r;i?.throwIfAborted(),te`exec: ${e.slice(0,200)}`;try{let t=eg(e,{env:process.env,maxBuffer:1e6,timeout:a,cwd:x(),stdio:s,shell:!0,reject:!1,input:o});return t.stdout&&t.stdout.trim()||null}catch{return null}}var sg,cg,lg=t((()=>{ag(),b(),ee(),sg=1e3,cg=60}));function ug(e,t,n={timeout:10*mg*pg,preserveOutputOnError:!0,useCwd:!0}){return fg(e,t,{abortSignal:n.abortSignal,timeout:n.timeout,preserveOutputOnError:n.preserveOutputOnError,cwd:n.useCwd?x():void 0,env:n.env,stdin:n.stdin,input:n.input})}function dg(e,t){return e.shortMessage?e.shortMessage:typeof e.signal==`string`?e.signal:String(t)}function fg(e,t,{abortSignal:n,timeout:r=10*mg*pg,preserveOutputOnError:i=!0,cwd:a,env:o,maxBuffer:s,shell:c,stdin:l,input:u}={timeout:10*mg*pg,preserveOutputOnError:!0,maxBuffer:1e6}){return new Promise(d=>{$h(e,t,{maxBuffer:s,cancelSignal:n,timeout:r,cwd:a,env:o,shell:c,stdin:l,input:u,reject:!1}).then(e=>{if(e.failed)if(i){let t=e.exitCode??1;d({stdout:e.stdout||``,stderr:e.stderr||``,code:t,error:dg(e,t)})}else d({stdout:``,stderr:``,code:e.exitCode??1});else d({stdout:e.stdout,stderr:e.stderr,code:0})}).catch(e=>{re(e),d({stdout:``,stderr:``,code:1})})})}var pg,mg,hg=t((()=>{ag(),b(),ne(),lg(),pg=1e3,mg=60}));export{lg as a,ag as c,og as i,qn as l,fg as n,$h as o,hg as r,eg as s,ug as t};
|
|
34
|
+
if (condition) { yield value; }`)}})),Hu,Uu,Wu,Gu,Ku=t((()=>{M(),Hu=(e,t,n)=>{if(n)return;if(e)return{transform:Uu.bind(void 0,new TextEncoder)};let r=new Ne(t);return{transform:Wu.bind(void 0,r),final:Gu.bind(void 0,r)}},Uu=function*(e,t){Fe.isBuffer(t)?yield Ye(t):typeof t==`string`?yield e.encode(t):yield t},Wu=function*(e,t){yield j(t)?e.write(t):t},Gu=function*(e){let t=e.end();t!==``&&(yield t)}})),qu,Ju,Yu,Xu,Zu,Qu,$u=t((()=>{qu=S(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Ju=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Qu}=t[n];for await(let i of r(e))yield*Ju(i,t,n+1)},Yu=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Xu(n,Number(t),e)},Xu=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Ju(r,n,t+1)},Zu=S(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Qu=function*(e){yield e}})),ed,td,nd,rd,id,ad,od=t((()=>{ed=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},td=(e,t)=>[...t.flatMap(t=>[...nd(t,e,0)]),...rd(e)],nd=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=ad}=t[n];for(let i of r(e))yield*nd(i,t,n+1)},rd=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*id(n,Number(t),e)},id=function*(e,t,n){if(e!==void 0)for(let r of e())yield*nd(r,n,t+1)},ad=function*(e){yield e}})),sd,cd,ld,ud=t((()=>{Z(),Pu(),Vu(),Ku(),$u(),od(),sd=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=ld(e,o,a),l=Y(t),u=Y(n),d=l?qu.bind(void 0,Ju,s):ed.bind(void 0,nd),f=l||u?qu.bind(void 0,Yu,s):ed.bind(void 0,rd),p=l||u?Zu.bind(void 0,s):void 0;return{stream:new Ae({writableObjectMode:r,writableHighWaterMark:Me(r),readableObjectMode:i,readableHighWaterMark:Me(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},cd=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a)e=td(ld(t,n,r),e);return e},ld=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Fu(r,s)},Hu(n,o,r),xu(n,a,r,c),{transform:e,final:t},{transform:Lu(i,s)},Ou({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)}})),dd,fd,pd,md,hd,gd=t((()=>{ud(),M(),Z(),dd=(e,t)=>{for(let n of fd(e))pd(e,n,t)},fd=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),pd=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${Zc[e]} with synchronous methods.`)}n.input=nt(i.map(({contents:e})=>e).map(e=>md(e,r)))}},md=(e,t)=>{let n=cd(e,t,`utf8`,!0);return hd(n),nt(n)},hd=e=>{let t=e.find(e=>typeof e!=`string`&&!j(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)}})),_d,vd,yd,bd,xd,Sd,Cd,wd=t((()=>{$a(),Z(),Sn(),L(),_d=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&Nt(n,r)&&!U.has(t)&&vd(r)&&(e.some(({type:e,value:t})=>e===`native`&&yd.has(t))||e.every(({type:e})=>X.has(e))),vd=e=>e===1||e===2,yd=new Set([`pipe`,`overlapped`]),bd=async(e,t,n,r)=>{for await(let i of e)Sd(t)||Cd(i,n,r)},xd=(e,t,n)=>{for(let r of e)Cd(r,t,n)},Sd=e=>e._readableState.pipes.length>0,Cd=(e,t,n)=>{gn({type:`output`,verboseMessage:bn(e),fdNumber:t,verboseInfo:n})}})),Td,Ed,Dd,Od,kd,Ad,jd=t((()=>{wd(),ud(),Pu(),M(),Z(),Hs(),Td=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Ed({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Ed=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=Ye(Bs(e,a,d)),{stdioItems:p,objectMode:m}=t[n],h=Dd([f],p,c,r),{serializedResult:g,finalResult:_=g}=Od({chunks:h,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});kd({serializedResult:g,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let v=s[n]?_:void 0;try{return r.error===void 0&&Ad(g,p,i),v}catch(e){return r.error=e,v}},Dd=(e,t,n,r)=>{try{return cd(e,t,n,!1)}catch(t){return r.error=t,e}},Od=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:nt(e)};let o=et(e,n);return r[a]?{serializedResult:o,finalResult:Su(o,!i[a],t)}:{serializedResult:o}},kd=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!_d({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=Su(e,!1,o);try{xd(s,t,r)}catch(e){n.error??(n.error=e)}},Ad=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>qc.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?_e(r,e):(n.add(t),Se(r,e))}}})),Md,Nd=t((()=>{M(),bu(),Md=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,vu(t,n,`all`)]:Array.isArray(t)?[vu(e,n,`all`),...t]:j(e)&&j(t)?it([e,t]):`${e}${t}`}})),Pd,Fd,Id,Ld,Rd,zd,Bd=t((()=>{z(),Pd=async(e,t)=>{let[n,r]=await Fd(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},Fd=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Id(e):n.value},Id=async e=>{try{return await E(e,`exit`)}catch{return Id(e)}},Ld=async e=>{let[t,n]=await e;if(!Rd(t,n)&&zd(t,n))throw new or;return[t,n]},Rd=(e,t)=>e===void 0&&t===void 0,zd=(e,t)=>e!==0||t!==null})),Vd,Hd,Ud=t((()=>{z(),Hs(),Bd(),Vd=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=Hd(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:zs(a,r,i)}},Hd=(e,t,n)=>e===void 0?zd(t,n)?new or:void 0:e})),Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d=t((()=>{Pn(),co(),uo(),rc(),xc(),_u(),bu(),gd(),jd(),Hs(),Nd(),Ud(),Wd=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Gd(e,t,n);return bc(Yd({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},Gd=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Nn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,Kd(n));return qd(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:fu(l,o)}},Kd=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,qd=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Jd(`ipcInput`),e&&Jd(`ipc: true`),n&&Jd(`detached: true`),r&&Jd(`cancelSignal`)},Jd=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Yd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Xd({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Vd(c,n),{output:m,error:h=l}=Td({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>vu(e,n,t)),_=vu(Md(m,n),n,`all`);return Qd({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},Xd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return dd(a,n),ge(...lo(e,t,Zd(n)))}catch(e){return Qs({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},Zd=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Vs(t)}),Qd=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?Zs({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):$s({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0})})),ef,tf,nf,rf,af,of=t((()=>{vi(),Yi(),Bi(),ef=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ti({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),tf({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),tf=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Pi(t,i);let a=Gi(e,t,n),o=new AbortController;try{return await Promise.race([nf(a,r,o),rf(a,n,o),af(a,n,o)])}catch(t){throw _i(e),t}finally{o.abort(),Ii(t,i)}},nf=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of Ee(e,`message`,{signal:n}))if(t(r))return r},rf=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),ii(t)},af=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw oi(r,t)}})),sf,cf,lf,uf,df,ff,pf=t((()=>{vi(),Yi(),Bi(),sf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>cf({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),cf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ti({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),Pi(t,a);let o=Gi(e,t,n),s=new AbortController,c={};return lf(e,o,s),uf({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),df({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},lf=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},uf=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=oi(i,t),n.abort()}catch{}},df=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of Ee(n,`message`,{signal:a.signal}))ff(o),yield e}catch{ff(o)}finally{a.abort(),Ii(t,s),r||_i(e),i&&await e}},ff=({error:e})=>{if(e)throw e}})),mf,hf,gf,_f=t((()=>{ya(),of(),pf(),Oa(),mf=(e,{ipc:t})=>{Object.assign(e,gf(e,!1,t))},hf=()=>{let e=C,t=C.channel!==void 0;return{...gf(e,!0,t),getCancelSignal:xa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},gf=(e,t,n)=>({sendMessage:ma.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:ef.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:sf.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})})})),vf,yf,bf,xf,Sf,Cf,wf,Tf=t((()=>{du(),rc(),xc(),vf=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{lu(r);let s=new pe;yf(s,r),Object.assign(s,{readable:xf,writable:Sf,duplex:Cf});let c=Qs({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1});return{subprocess:s,promise:wf(c,o,i)}},yf=(e,t)=>{let n=bf(),r=bf(),i=bf(),a=Array.from({length:t.length-3},bf),o=bf(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},bf=()=>{let e=new ke;return e.end(),e},xf=()=>new D({read(){}}),Sf=()=>new je({write(){}}),Cf=()=>new Oe({read(){},write(){}}),wf=async(e,t,n)=>bc(e,t,n)})),Ef,Df,Of,kf,Af=t((()=>{ud(),du(),Z(),Ef=(e,t)=>Zl(kf,e,t,!1),Df=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Zc[e]}.`)},Of={fileNumber:Df,generator:sd,asyncGenerator:sd,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:Oe.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},kf={input:{...Of,fileUrl:({value:e})=>({stream:ve(e)}),filePath:({value:{file:e}})=>({stream:ve(e)}),webStream:({value:e})=>({stream:D.fromWeb(e)}),iterable:({value:e})=>({stream:D.from(e)}),asyncIterable:({value:e})=>({stream:D.from(e)}),string:({value:e})=>({stream:D.from(e)}),uint8Array:({value:e})=>({stream:D.from(Fe.from(e))})},output:{...Of,fileUrl:({value:e})=>({stream:ye(e)}),filePath:({value:{file:e,append:t}})=>({stream:ye(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:je.fromWeb(e)}),iterable:Df,asyncIterable:Df,string:Df,uint8Array:Df}}}));function jf(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Uf(t);let t=e.some(({readableObjectMode:e})=>e),n=Mf(e,t),r=new zf({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}var Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp=t((()=>{s(),c(),l(),Mf=(e,t)=>{if(e.length===0)return Me(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)},Nf=new WeakMap,Pf=new WeakMap,Ff=new WeakMap,If=new WeakMap,Lf=new WeakMap,Rf=new WeakMap,zf=class extends ke{constructor(...e){super(...e),f(this,Nf,new Set([])),f(this,Pf,new Set([])),f(this,Ff,new Set([])),f(this,If,void 0),f(this,Lf,Symbol(`unpipe`)),f(this,Rf,new WeakMap)}add(e){if(Uf(e),d(Nf,this).has(e))return;d(Nf,this).add(e),d(If,this)??p(If,this,Bf(this,d(Nf,this),d(Lf,this)));let t=Wf({passThroughStream:this,stream:e,streams:d(Nf,this),ended:d(Pf,this),aborted:d(Ff,this),onFinished:d(If,this),unpipeEvent:d(Lf,this)});d(Rf,this).set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Uf(e),!d(Nf,this).has(e))return!1;let t=d(Rf,this).get(e);return t===void 0?!1:(d(Rf,this).delete(e),e.unpipe(this),await t,!0)}},Bf=async(e,t,n)=>{ep(e,tp);let r=new AbortController;try{await Promise.race([Vf(e,r),Hf(e,t,n,r)])}finally{r.abort(),ep(e,-tp)}},Vf=async(e,{signal:t})=>{try{await O(e,{signal:t,cleanup:!0})}catch(t){throw Yf(e,t),t}},Hf=async(e,t,n,{signal:r})=>{for await(let[i]of Ee(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Uf=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Wf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{ep(e,np);let s=new AbortController;try{await Promise.race([Gf(a,t,s),Kf({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),qf({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),ep(e,-np)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Zf(e):Jf(e))},Gf=async(e,t,{signal:n})=>{try{await e,n.aborted||Zf(t)}catch(e){n.aborted||Yf(t,e)}},Kf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await O(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Xf(r)?i.add(t):Qf(e,r)}},qf=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},Jf=e=>{e.writable&&e.end()},Yf=(e,t)=>{Xf(t)?Zf(e):Qf(e,t)},Xf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Zf=e=>{(e.readable||e.writable)&&e.destroy()},Qf=(e,t)=>{e.destroyed||(e.once(`error`,$f),e.destroy(t))},$f=()=>{},ep=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},tp=2,np=1})),ip,ap,op,sp,cp,lp=t((()=>{F(),ip=(e,t)=>{e.pipe(t),ap(e,t),sp(e,t)},ap=async(e,t)=>{if(!(N(e)||N(t))){try{await O(e,{cleanup:!0,readable:!0,writable:!1})}catch{}op(t)}},op=e=>{e.writable&&e.end()},sp=async(e,t)=>{if(!(N(e)||N(t))){try{await O(t,{cleanup:!0,readable:!1,writable:!0})}catch{}cp(e)}},cp=e=>{e.readable&&e.destroy()}})),up,dp,fp,pp,mp,hp,gp=t((()=>{rp(),F(),Ni(),Z(),lp(),up=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>X.has(e)))dp(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!X.has(e)))pp({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())ip(t.length===1?t[0]:jf(t),e)},dp=(e,t,n,r)=>{n===`output`?ip(e.stdio[r],t):ip(t,e.stdio[r]);let i=fp[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},fp=[`stdin`,`stdout`,`stderr`],pp=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;mp(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},mp=(e,{signal:t})=>{N(e)&&Mi(e,hp,t)},hp=2})),_p,vp=t((()=>{v(),_p=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=g(()=>{e.kill()});Te(r,()=>{i()})}})),yp,bp,xp,Sp,Cp,wp=t((()=>{Ke(),Mn(),ji(),We(),yp=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=An(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=bp(n,r,i),{sourceStream:d,sourceError:f}=Cp(e,l),{options:p,fileDescriptors:m}=H.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},bp=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=xp(e,t,...n);return{destination:r,destinationStream:xi(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},xp=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Sp,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||He(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ge(n,...r);return{destination:t(Sp)(i,a,o),pipeOptions:o}}if(H.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Sp=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Cp=(e,t)=>{try{return{sourceStream:Si(e,t)}}catch(e){return{sourceError:e}}}})),Tp,Ep,Dp,Op,kp=t((()=>{rc(),lp(),Tp=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Ep({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Dp({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Ep=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return cp(e),r;if(t!==void 0)return op(n),t},Dp=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>Qs({error:e,command:Op,escapedCommand:Op,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Op=`source.pipe(destination)`})),Ap,jp=t((()=>{Ap=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o}})),Mp,Np,Pp,Fp,Ip,Lp,Rp,zp=t((()=>{rp(),Ni(),lp(),Mp=(e,t,n)=>{let r=Ip.has(t)?Pp(e,t):Np(e,t);return Mi(e,Lp,n.signal),Mi(t,Rp,n.signal),Fp(t),r},Np=(e,t)=>{let n=jf([e]);return ip(n,t),Ip.set(t,n),n},Pp=(e,t)=>{let n=Ip.get(t);return n.add(e),n},Fp=async e=>{try{await O(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ip.delete(e)},Ip=new WeakMap,Lp=2,Rp=1})),Bp,Vp,Hp=t((()=>{kp(),Bp=(e,t)=>e===void 0?[]:[Vp(e,t)],Vp=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await ie(e,t),await n.remove(t),Dp({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})}})),Up,Wp,Gp,Kp=t((()=>{A(),wp(),kp(),jp(),zp(),Hp(),Up=(e,...t)=>{if(k(t[0]))return Up.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=yp(e,...t),i=Wp({...r,destination:n});return i.pipe=Up.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Wp=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Gp(e,i);Tp({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Mp(t,a,d);return await Promise.race([Ap(u),...Bp(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Gp=(e,t)=>Promise.allSettled([e,t])})),qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm=t((()=>{Ku(),Pu(),od(),qp=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Jp(t,o),Zp({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Jp=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Yp=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Xp(t,o,e);let s=e.readableObjectMode&&!a;return Zp({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Xp=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Zp=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=Ee(e,`data`,{signal:t.signal,highWaterMark:$p,highWatermark:$p});return em({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},Qp=Me(!0),$p=Qp,em=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=tm({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*nd(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*rd(s)}},tm=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Hu(e,n,!t),xu(e,i,!r,{})].filter(Boolean)})),rm,im,am,om,sm,cm,lm=t((()=>{Ns(),M(),wd(),nm(),Hs(),bu(),rm=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=im({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([am(e),d]);return}let f=Yp({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:yu(c,n),allMixed:s}),[p]=await Promise.all([om({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},im=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{_d({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await bd(Yp({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},am=async e=>{await Le(),e.readableFlowing===null&&e.resume()},om=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await ns(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await cs(n,{maxBuffer:a})):await ws(n,{maxBuffer:a})}catch(n){return cm(Ps({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},sm=async e=>{try{return await e}catch(e){return cm(e)}},cm=({bufferedData:e})=>Je(e)?new Uint8Array(e):e})),um,dm,fm,pm,mm,hm,gm,_m,vm,ym=t((()=>{um=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=dm(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],O(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||mm(e,t,n,r)}finally{o.abort()}},dm=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&fm(e,n,r),r},fm=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{pm(t,n),r.call(e,...i)}},pm=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},mm=(e,t,n,r)=>{if(!hm(e,t,n,r))throw e},hm=(e,t,n,r=!0)=>n.propagating?vm(e)||_m(e):(n.propagating=!0,gm(n,t)===r?vm(e):_m(e)),gm=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,_m=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,vm=e=>e?.code===`EPIPE`})),bm,xm,Sm=t((()=>{lm(),ym(),bm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>xm({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),xm=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=um(e,t,l);if(gm(l,t)){await u;return}let[d]=await Promise.all([rm({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d}})),Cm,wm,Tm,Em,Dm=t((()=>{rp(),Sm(),Cm=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?jf([e,t].filter(Boolean)):void 0,wm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>xm({...Tm(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Em(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Tm=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},Em=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode})),Om,km,Am=t((()=>{Sn(),L(),Om=e=>Nt(e,`ipc`),km=(e,t)=>{gn({type:`ipc`,verboseMessage:bn(e),fdNumber:`ipc`,verboseInfo:t})}})),jm,Mm,Nm=t((()=>{Hs(),Am(),I(),pf(),jm=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Om(a),s=jt(t,`ipc`),c=jt(n,`ipc`);for await(let t of cf({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(Is(e,i,c),i.push(t)),o&&km(t,a);return i},Mm=async(e,t)=>(await Promise.allSettled([e]),t)})),Pm,Fm,Im,Lm,Rm=t((()=>{Co(),La(),ei(),Na(),F(),Z(),lm(),Nm(),Ka(),Dm(),Sm(),Bd(),ym(),Pm=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=Pd(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=bm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=wm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),ee=[],te=jm({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:ee,verboseInfo:p}),ne=Fm(h,e,y),re=Im(m,y);try{return await Promise.race([Promise.all([{},Ld(v),Promise.all(b),x,te,Ga(e,d),...ne,...re]),g,Lm(e,_),...Fa(e,a,f,_),...Qr({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Aa({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??(f.terminationReason=`other`),Promise.all([{error:e},v,Promise.all(b.map(e=>sm(e))),sm(x),Mm(te,ee),Promise.allSettled(ne),Promise.allSettled(re)])}},Fm=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:um(e,r,n)),Im=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>W(t,{checkOpen:!1})&&!N(t)).map(({type:e,value:r,stream:i=r})=>um(i,n,t,{isSameDirection:X.has(e),stopOnExit:e===`native`}))),Lm=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n}})),zm,Bm,Vm,Hm=t((()=>{bi(),zm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Bm=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=yi();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Vm=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r}})),Um,Wm,Gm,Km,qm,Jm,Ym=t((()=>{ym(),Um=async e=>{if(e!==void 0)try{await Gm(e)}catch{}},Wm=async e=>{if(e!==void 0)try{await Km(e)}catch{}},Gm=async e=>{await O(e,{cleanup:!0,readable:!1,writable:!0})},Km=async e=>{await O(e,{cleanup:!0,readable:!0,writable:!1})},qm=async(e,t)=>{if(await e,t)throw t},Jm=(e,t,n)=>{n&&!_m(n)?e.destroy(n):t&&e.destroy()}})),Xm,Zm,Qm,$m,eh,th,nh,rh,ih=t((()=>{$a(),ji(),nm(),bi(),Hm(),Ym(),Xm=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||U.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Zm(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Qm(s,o),{read:f,onStdoutDataDone:p}=$m({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new D({read:f,destroy:S(nh.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return th({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},Zm=(e,t,n)=>{let r=Si(e,t);return{subprocessStdout:r,waitReadableDestroy:Bm(n,r,`readableDestroy`)}},Qm=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Qp},$m=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=yi(),o=qp({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){eh(this,o,a)},onStdoutDataDone:a}},eh=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},th=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Km(e),await r,await Um(i),await t,n.readable&&n.push(null)}catch(e){await Um(i),rh(n,e)}},nh=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Vm(n,t)&&(rh(e,r),await qm(t,r))},rh=(e,t)=>{Jm(e,e.readable,t)}})),ah,oh,sh,ch,lh,uh,dh,fh,ph=t((()=>{ji(),Hm(),Ym(),ah=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=oh(e,n,t),o=new je({...sh(r,e,i),destroy:S(dh.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return uh(r,o),o},oh=(e,t,n)=>{let r=xi(e,t);return{subprocessStdin:r,waitWritableFinal:Bm(n,r,`writableFinal`),waitWritableDestroy:Bm(n,r,`writableDestroy`)}},sh=(e,t,n)=>({write:ch.bind(void 0,e),final:S(lh.bind(void 0,e,t,n))}),ch=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},lh=async(e,t,n)=>{await Vm(n,t)&&(e.writable&&e.end(),await t)},uh=async(e,t,n)=>{try{await Gm(e),t.writable&&t.end()}catch(e){await Wm(n),fh(t,e)}},dh=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Vm(n,t),await Vm(r,t)&&(fh(e,i),await qm(t,i))},fh=(e,t)=>{Jm(e,e.writable,t)}})),mh,hh,gh=t((()=>{$a(),ih(),ph(),mh=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||U.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Zm(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=oh(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=Qm(c,s),{read:g,onStdoutDataDone:_}=$m({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new Oe({read:g,...sh(u,e,d),destroy:S(hh.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return th({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),uh(u,v,c),v},hh=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([nh({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),dh({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])}})),_h,vh,yh=t((()=>{$a(),ji(),nm(),_h=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||U.has(t),o=Si(e,n),s=qp({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return vh(s,o,e)},vh=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}}})),bh,xh=t((()=>{Hm(),ih(),ph(),gh(),yh(),bh=(e,{encoding:t})=>{let n=zm();e.readable=Xm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=ah.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=mh.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=_h.bind(void 0,e,t),e[Symbol.asyncIterator]=_h.bind(void 0,e,t,{})}})),Sh,Ch,wh,Th=t((()=>{Sh=(e,t)=>{for(let[n,r]of wh){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Ch=(async()=>{})().constructor.prototype,wh=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ch,e)])})),Eh,Dh,Oh,kh,Ah,jh,Mh=t((()=>{Ns(),Pn(),co(),ji(),uo(),_f(),rc(),xc(),Tf(),Af(),bu(),gp(),Jr(),vp(),Kp(),Dm(),Rm(),xh(),bi(),Th(),Eh=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Dh(e,t,n),{subprocess:f,promise:p}=kh({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Up.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Sh(f,p),H.set(f,{options:u,fileDescriptors:d}),f},Dh=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Nn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,n),u=Oh(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Ef(u,o)}},Oh=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},kh=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=he(...lo(e,t,n))}catch(e){return vf({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;De(1/0,l.signal);let u=[...c.stdio];up(c,s,l),_p(c,n,l);let d={},f=yi();c.kill=Ur.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Cm(c,n),bh(c,n),mf(c,n);let p=Ah({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:a,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Ah=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Pm({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});u.abort(),l.resolve();let _=m.map((e,n)=>vu(e,t,n)),v=vu(h,t,`all`);return bc(jh({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},jh=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?$s({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof Yo,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Zs({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u})})),Nh,Ph,Fh,Ih=t((()=>{A(),I(),Nh=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Ph(t,e[t],n)]));return{...e,...n}},Ph=(e,t,n)=>Fh.has(e)&&k(t)&&k(n)?{...t,...n}:n,Fh=new Set([`env`,...At])})),$,Lh,Rh,zh=t((()=>{A(),Ke(),ht(),$d(),Mh(),Ih(),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>Lh({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Lh=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,Nh(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Rh({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Wd(s,c,l):Eh(s,c,l,i)},Rh=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ge(...ot(t)?st(t,n):[t,...n]),c=Nh(Nh(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}}})),Bh,Vh,Hh,Uh,Wh,Gh=t((()=>{Bh=({file:e,commandArguments:t})=>Hh(e,t),Vh=({file:e,commandArguments:t})=>({...Hh(e,t),isSync:!0}),Hh=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=Uh(e);return{file:n,commandArguments:r}},Uh=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(Wh)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Wh=/ +/g})),Kh,qh,Jh,Yh,Xh,Zh,Qh=t((()=>{Kh=(e,t,n)=>{e.sync=t(Jh,n),e.s=e.sync},qh=({options:e})=>Yh(e),Jh=({options:e})=>({...Yh(e),isSync:!0}),Yh=e=>({options:{...Xh(e),...e}}),Xh=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Zh={preferLocal:!0}})),$h,eg,tg,ng,rg,ig,ag=t((()=>{zh(),Gh(),Ba(),Qh(),_f(),z(),$h=$(()=>({})),eg=$(()=>({isSync:!0})),$(Bh),$(Vh),$(Ra),$(qh,{},Zh,Kh),{sendMessage:tg,getOneMessage:ng,getEachMessage:rg,getCancelSignal:ig}=hf()}));function og(e,t,n=10*cg*sg){let r;r=t===void 0?{}:t instanceof AbortSignal?{abortSignal:t,timeout:n}:t;let{abortSignal:i,timeout:a=10*cg*sg,input:o,stdio:s=[`ignore`,`pipe`,`pipe`]}=r;i?.throwIfAborted(),ee`exec: ${e.slice(0,200)}`;try{let t=eg(e,{env:process.env,maxBuffer:1e6,timeout:a,cwd:x(),stdio:s,shell:!0,reject:!1,input:o});return t.stdout&&t.stdout.trim()||null}catch{return null}}var sg,cg,lg=t((()=>{ag(),b(),te(),sg=1e3,cg=60}));function ug(e,t,n={timeout:10*mg*pg,preserveOutputOnError:!0,useCwd:!0}){return fg(e,t,{abortSignal:n.abortSignal,timeout:n.timeout,preserveOutputOnError:n.preserveOutputOnError,cwd:n.useCwd?x():void 0,env:n.env,stdin:n.stdin,input:n.input})}function dg(e,t){return e.shortMessage?e.shortMessage:typeof e.signal==`string`?e.signal:String(t)}function fg(e,t,{abortSignal:n,timeout:r=10*mg*pg,preserveOutputOnError:i=!0,cwd:a,env:o,maxBuffer:s,shell:c,stdin:l,input:u}={timeout:10*mg*pg,preserveOutputOnError:!0,maxBuffer:1e6}){return new Promise(d=>{$h(e,t,{maxBuffer:s,cancelSignal:n,timeout:r,cwd:a,env:o,shell:c,stdin:l,input:u,reject:!1}).then(e=>{if(e.failed)if(i){let t=e.exitCode??1;d({stdout:e.stdout||``,stderr:e.stderr||``,code:t,error:dg(e,t)})}else d({stdout:``,stderr:``,code:e.exitCode??1});else d({stdout:e.stdout,stderr:e.stderr,code:0})}).catch(e=>{re(e),d({stdout:``,stderr:``,code:1})})})}var pg,mg,hg=t((()=>{ag(),b(),ne(),lg(),pg=1e3,mg=60}));export{lg as a,ag as c,og as i,qn as l,fg as n,$h as o,hg as r,eg as s,ug as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{w as t,x as n}from"./debug-BecbSVoN.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{$d as t,St as n,Tt as r,XT as i,YT as a,tf as o,vc as s,yc as c}from"./loadAgentsDir-BL93ulMm.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-BwyAtIHx.js";import{spawnSync as p}from"child_process";function m(){return i(_)??`Goodbye!`}async function h(e){if(c())return e(),p(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let r=n()!==null;return r?(0,g.jsx)(f,{showWorktree:r,onDone:e,onCancel:()=>e()}):(e(m()),await t(0,`prompt_input_exit`),null)}var g,_;e((()=>{a(),l(),d(),s(),o(),r(),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{$u as n,Fp as r,GC as i,Pp as a,Sg as o,ed as s,xg as c}from"./loadAgentsDir-BL93ulMm.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-Bgh_r4lg.js";import{n as k,t as A}from"./useExitOnCtrlCDWithKeybindings-DEEJhm_W.js";import{n as j,t as M}from"./modelOptions-BtEZe5BB.js";function N({initial:e,sessionModel:t,onSelect:n,onCancel:r,isStandaloneCommand:i,showFastModeNotice:c,headerText:m}){let h=k(),_=e===null?I:e,[v,x]=(0,P.useState)(_),S=o(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)(s,{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()?c?(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)(a,{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(),i(),c(),C(),j(),r(),n(),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-BL93ulMm.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-DWn40OcQ.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{GC as n,Sg as r,wg as i,xg as a}from"./loadAgentsDir-BL93ulMm.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-D4CpDv2y.js";import{c as b,h as x}from"./config-aRiTrtCv.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{l as w,v as T}from"./startupProfiler-CmH_aVy2.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-Bgh_r4lg.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=r(e=>e.mainLoopModel),a=r(e=>e.fastMode),u=i(),[d,f]=(0,J.useState)(a??!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){a&&W(!1,u),e(`Fast mode OFF`,{display:`system`});return}e(a?`${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.claude.com/docs/en/fast-mode`,children:`https://code.claude.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(),a(),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-
|
|
2
|
-
`).filter(Boolean),i,r),c=await De(i,r);if(c){let e=s.length;s=c.filter(s),
|
|
3
|
-
`).filter(Boolean),i,r),n=await De(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),
|
|
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-BL93ulMm.js";import{lr as d,ur as f}from"./state-BemZdQIl.js";import{n as p,t as m}from"./cwd-Cfdf7z7s.js";import{P as h,R as g,c as _,f as v,i as ee,u as y}from"./debug-BecbSVoN.js";import{cr as b,g as x,n as te,or as ne}from"./settings-D4CpDv2y.js";import{c as re,h as ie}from"./config-aRiTrtCv.js";import{m as ae,p as oe,r as S}from"./git-DBlOv64X.js";import{n as se,r as ce}from"./execFileNoThrow-DHyW8FMX.js";import{o as le,s as C}from"./log-Dauqle-Z.js";import{n as ue,r as w}from"./analytics-DJobLaWP.js";import{a as de,s as fe}from"./ripgrep-C1ydIMzT.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
|
+
`).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
|
+
`).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};
|
|
@@ -1,5 +1,5 @@
|
|
|
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,n as i,o as a}from"./envUtils-BDhHQY0-.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{Wt as p,pt as m,z as ee}from"./state-BemZdQIl.js";import{n as te,t as ne}from"./cwd-Cfdf7z7s.js";import{F as re,H as ie,S as ae,W as oe,w as h,z as se}from"./debug-RAynG_nM.js";import{Jt as ce,qt as le}from"./settings-DnptdP79.js";import{c as ue,d as g,h as _,n as de}from"./config-Do1870_d.js";import{c as fe,o as pe}from"./execFileNoThrow-Dwu6psHW.js";import{d as me,o as he,p as v,s as y}from"./log-CezCRpAN.js";import{a as ge,i as _e,o as ve}from"./platform-BMPbglug.js";import{l as ye,s as be}from"./types-3j8PS-Du.js";import{i as xe,n as Se}from"./analytics-DJobLaWP.js";import{n as Ce,r as b}from"./startupProfiler-L_UWZ03w.js";import{$n as we,Bt as x,Fr as Te,Ft as Ee,Gt as De,Ir as Oe,Nt as ke,Ot as Ae,_n as je,jt as S,nr as Me,vn as Ne,zt as Pe}from"./model-BsZ4sP_H.js";import{n as Fe,t as Ie}from"./userAgent-CIq27vUR.js";import{Z as Le,_ as Re,c as ze,et as C,it as Be,n as Ve,o as He,t as Ue,v as We,w}from"./esm-Cf4nSRjF.js";import*as T from"path";import{randomUUID as E}from"crypto";import{appendFile as Ge,mkdir as D,readdir as Ke,unlink as O,writeFile as qe}from"fs/promises";function k(){return r(process.env.CLAUDE_CODE_USE_BEDROCK)||r(process.env.CLAUDE_CODE_USE_VERTEX)||r(process.env.CLAUDE_CODE_USE_FOUNDRY)||v()}function Je(){return v()}var A=e((()=>{a(),me()}));async function Ye(){j===null&&!M&&(M=Qe(),j=await M,M=null,N.cache.clear?.())}function Xe(){j=null,M=null,N.cache.clear?.(),P.cache.clear?.()}function Ze(){if(j!==null)return j;let e=S();if(e?.emailAddress)return e.emailAddress}async function Qe(){let e=S();if(e?.emailAddress)return e.emailAddress}var j,M,N,P,F=e((()=>{fe(),n(),p(),x(),_(),te(),ce(),a(),j=null,M=null,N=t(e=>{let t=g(),n=ue(),i,a,o;if(e&&(i=Ee()??void 0,a=ke()??void 0,i&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=S(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.10`,platform:le(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:i,rateLimitTier:a,firstTokenTime:o,...r(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),P=t(async()=>{let e=await pe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function $e(){return{seconds:0,nanos:0}}function I(e){return e!=null}var L,et=e((()=>{L={fromJSON(e){return{seconds:I(e.seconds)?globalThis.Number(e.seconds):0,nanos:I(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=$e();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function tt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,nt=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=tt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function rt(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function it(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function at(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ot(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function st(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):st(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ct=e((()=>{et(),nt(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=rt();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=H.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return U.fromPartial(e??{})},fromPartial(e){let t=it();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?H.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=at();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=U.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=z.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=W.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=ot();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?U.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?z.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?W.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function K(){return T.join(i(),`telemetry`)}function lt(e){if(!d.isAxiosError(e))return re(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var q,J,Y,ut=e((()=>{We(),f(),p(),ct(),x(),_(),a(),se(),Me(),be(),he(),je(),ae(),Fe(),Te(),Se(),C(),o(),q=E(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return T.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await ye(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await O(e)}catch{}else await D(K(),{recursive:!0}),await qe(e,t.map(e=>h(e)).join(`
|
|
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,n as i,o as a}from"./envUtils-BDhHQY0-.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{Wt as p,pt as m,z as ee}from"./state-BemZdQIl.js";import{n as te,t as ne}from"./cwd-Cfdf7z7s.js";import{C as h,P as re,R as ie,U as ae,V as oe,x as se}from"./debug-BecbSVoN.js";import{Jt as ce,Yt as le}from"./settings-D4CpDv2y.js";import{c as ue,d as g,h as _,n as de}from"./config-aRiTrtCv.js";import{c as fe,o as pe}from"./execFileNoThrow-DHyW8FMX.js";import{d as me,o as he,p as v,s as y}from"./log-Dauqle-Z.js";import{a as ge,i as _e,o as ve}from"./platform-B0uTQc9P.js";import{l as ye,s as be}from"./types-DafcFtmb.js";import{i as xe,n as Se}from"./analytics-DJobLaWP.js";import{n as Ce,r as b}from"./startupProfiler-CmH_aVy2.js";import{$n as we,Bt as x,Fr as Te,Ft as Ee,Gt as De,Ir as Oe,Nt as ke,Ot as Ae,_n as je,jt as S,nr as Me,vn as Ne,zt as Pe}from"./model-Bgh_r4lg.js";import{n as Fe,t as Ie}from"./userAgent-CU7Ndh79.js";import{Z as Le,_ as Re,c as ze,et as C,it as Be,n as Ve,o as He,t as Ue,v as We,w}from"./esm-Ka3lhafK.js";import*as T from"path";import{randomUUID as E}from"crypto";import{appendFile as Ge,mkdir as D,readdir as Ke,unlink as O,writeFile as qe}from"fs/promises";function k(){return r(process.env.CLAUDE_CODE_USE_BEDROCK)||r(process.env.CLAUDE_CODE_USE_VERTEX)||r(process.env.CLAUDE_CODE_USE_FOUNDRY)||v()}function Je(){return v()}var A=e((()=>{a(),me()}));async function Ye(){j===null&&!M&&(M=Qe(),j=await M,M=null,N.cache.clear?.())}function Xe(){j=null,M=null,N.cache.clear?.(),P.cache.clear?.()}function Ze(){if(j!==null)return j;let e=S();if(e?.emailAddress)return e.emailAddress}async function Qe(){let e=S();if(e?.emailAddress)return e.emailAddress}var j,M,N,P,F=e((()=>{fe(),n(),p(),x(),_(),te(),le(),a(),j=null,M=null,N=t(e=>{let t=g(),n=ue(),i,a,o;if(e&&(i=Ee()??void 0,a=ke()??void 0,i&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=S(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.11`,platform:ce(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:i,rateLimitTier:a,firstTokenTime:o,...r(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),P=t(async()=>{let e=await pe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function $e(){return{seconds:0,nanos:0}}function I(e){return e!=null}var L,et=e((()=>{L={fromJSON(e){return{seconds:I(e.seconds)?globalThis.Number(e.seconds):0,nanos:I(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=$e();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function tt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,nt=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=tt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function rt(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function it(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function at(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ot(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function st(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):st(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ct=e((()=>{et(),nt(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=rt();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=H.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return U.fromPartial(e??{})},fromPartial(e){let t=it();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?H.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=at();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=U.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=z.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=W.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=ot();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?U.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?z.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?W.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function K(){return T.join(i(),`telemetry`)}function lt(e){if(!d.isAxiosError(e))return re(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var q,J,Y,ut=e((()=>{We(),f(),p(),ct(),x(),_(),a(),ie(),Me(),be(),he(),je(),se(),Fe(),Te(),Se(),C(),o(),q=E(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return T.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await ye(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await O(e)}catch{}else await D(K(),{recursive:!0}),await qe(e,t.map(e=>h(e)).join(`
|
|
2
2
|
`)+`
|
|
3
3
|
`,`utf8`)}catch(e){y(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await D(K(),{recursive:!0}),await Ge(e,t.map(e=>h(e)).join(`
|
|
4
4
|
`)+`
|
|
5
|
-
`,`utf8`)}catch(e){y(e)}}async deleteFile(e){try{await O(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ke(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(
|
|
5
|
+
`,`utf8`)}catch(e){y(e)}}async deleteFile(e){try{await O(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ke(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(oe(e))return;throw e}for(let e of t){let t=T.join(K(),e);this.retryFileInBackground(t)}}catch(e){y(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}let n=await this.sendEventsInBatches(t);n.length===0?await this.deleteFile(e):await this.saveEventsToFile(e,n)}async export(e,t){if(this.isShutdown){t({code:w.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:w.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:w.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:w.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:w.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:w.SUCCESS})}catch(e){y(e),t({code:w.FAILED,error:ae(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=lt(i);for(let r=e;r<t.length;r++)n.push(...t[r]);break}e<t.length-1&&this.batchDelayMs>0&&await Ne(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;y(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":Ie(),"x-service-name":`claude-code`},n=de()||ee(),r=this.skipAuth||!n;if(!r&&De()){let e=Ae();Pe()?e&&Oe(e.expiresAt)&&(r=!0):r=!0}let i=r?{headers:{},error:`trust not established or Oauth token expired`}:we(),a=!i.error,o=a?{...t,...i.headers}:t;try{let t=await d.post(this.endpoint,e,{timeout:this.timeout,headers:o});this.logSuccess(e.events.length,a,t.data);return}catch(n){if(a&&d.isAxiosError(n)&&n.response?.status===401){let n=await d.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}throw n}}logSuccess(e,t,n){}hrTimeToDate(e){let[t,n]=e;return new Date(t*1e3+n/1e6)}transformLogsToEvents(e){let t=[];for(let n of e){let e=n.attributes||{},r=e.event_name||n.body||`unknown`,i=e.core_metadata,a=e.user_metadata,o=e.event_metadata||{};if(!i){t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:m(),additional_metadata:Buffer.from(h({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Be(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=xe(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),device_id:e.user_id,email:a?.email,auth:s.auth,...s.core,env:s.env,process:s.process,skill_name:typeof c==`string`?c:void 0,plugin_name:typeof l==`string`?l:void 0,marketplace_name:typeof u==`string`?u:void 0,additional_metadata:Object.keys(f).length>0?Buffer.from(h(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush()}async forceFlush(){await Promise.all(this.pendingExports)}}}));function X(e){return!1}var dt=e((()=>{}));function ft(){return{}}function pt(e){let t=ft()[e];if(!t)return null;let n=t.sample_rate;return typeof n!=`number`||n<0||n>1||n>=1?null:n<=0?0:Math.random()<n?n:0}async function mt(){if($)try{await $.shutdown()}catch{}}function Z(){return!k()}async function ht(e,t,n={}){try{let r=await Le({model:n.model,betas:n.betas}),i={event_name:t,event_id:E(),core_metadata:r,user_metadata:N(!0),event_metadata:n},a=g();a&&(i.user_id=a),e.emit({body:t,attributes:i})}catch{}}function gt(e,t={}){Z()&&(!Q||X(`firstParty`)||ht(Q,e,t))}function _t(){if(b(`1p_event_logging_start`),!Z())return;b(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||vt.toString(),10),t=yt,n=bt,r=_e(),i={[l]:`claude-code`,[c]:`0.0.11`};if(r===`wsl`){let e=ge();e&&(i[`wsl.version`]=e)}$=new He({resource:Re(i),processors:[new Ve(new Y({maxBatchSize:t,isKilled:()=>X(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.11`)}var vt,yt,bt,Q,$,xt=e((()=>{ze(),Ue(),u(),_(),ve(),Ce(),F(),A(),ut(),C(),dt(),vt=1e4,yt=200,bt=8192,Q=null,$=null}));export{gt as a,P as c,Xe as d,A as f,Z as i,Ye as l,Je as m,xt as n,pt as o,k as p,_t as r,mt as s,ft as t,F as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./firstPartyEventLogger-BHjBQH0J.js";e();export{t as initialize1PEventLogging};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{A as n,C as r,m as i,w as a}from"./external-CEp-aPkt.js";import{n as o,r as s,t as c}from"./lazySchema-B4D4qJVE.js";import{
|
|
1
|
+
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{A as n,C as r,m as i,w as a}from"./external-CEp-aPkt.js";import{n as o,r as s,t as c}from"./lazySchema-B4D4qJVE.js";import{P as l,R as u,c as d,i as f}from"./debug-BecbSVoN.js";import{A as p,dt as m,ft as h,j as g}from"./sessionState-D-SaBzWD.js";import"./bridgeMessaging-Ci5H68MX.js";import{i as _}from"./workSecret-BEhXgH2M.js";import{t as v}from"./ccrClient-Br4LAofR.js";import{n as y,t as b}from"./SSETransport-DN4tCDEh.js";s(),c(),m();var x={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},S=o(()=>a({init_retry_max_attempts:r().int().min(1).max(10).default(3),init_retry_base_delay_ms:r().int().min(100).default(500),init_retry_jitter_fraction:r().min(0).max(1).default(.25),init_retry_max_delay_ms:r().int().min(500).default(4e3),http_timeout_ms:r().int().min(2e3).default(1e4),uuid_dedup_buffer_size:r().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:r().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:r().min(0).max(.5).default(.1),token_refresh_buffer_ms:r().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:r().int().min(500).max(2e3).default(1500),connect_timeout_ms:r().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return h(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:i().default(!1)}));async function C(){let e=x,t=S().safeParse(e);return t.success?t.data:x}async function w(){let e=await C();return e.min_version&&h(`0.0.11`,e.min_version)?`Your version of Work Mate (0.0.11) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}y(),f(),u(),p();function T(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function E(e){let{sessionUrl:t,ingressToken:n,sessionId:r,initialSequenceNum:i,getAuthToken:a}=e,o;a?o=()=>{let e=a();return e?{Authorization:`Bearer ${e}`}:{}}:g(n);let s=e.epoch??await _(t,n);d(`[bridge:repl] CCR v2: worker sessionId=${r} epoch=${s}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let c=new URL(t);c.pathname=c.pathname.replace(/\/$/,``)+`/worker/events/stream`;let u=new b(c,{},r,void 0,i,o),f,p=new v(u,new URL(t),{getAuthHeaders:o,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{d(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{p.close(),u.close(),f?.(4090)}catch(e){d(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${l(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});u.setOnEvent(e=>{p.reportDelivery(e.event_id,`received`),p.reportDelivery(e.event_id,`processed`)});let m,h=!1,y=!1;return{write(e){return p.writeEvent(e)},async writeBatch(e){for(let t of e){if(y)break;await p.writeEvent(t)}},close(){y=!0,p.close(),u.close()},isConnectedStatus(){return h},getStateLabel(){return u.isClosedStatus()?`closed`:u.isConnectedStatus()?h?`connected`:`init`:`connecting`},setOnData(e){u.setOnData(e)},setOnClose(e){f=e,u.setOnClose(t=>{p.close(),e(t??4092)})},setOnConnect(e){m=e},getLastSequenceNum(){return u.getLastSequenceNum()},droppedBatchCount:0,reportState(e){p.reportState(e)},reportMetadata(e){p.reportMetadata(e)},reportDelivery(e,t){p.reportDelivery(e,t)},flush(){return p.flush()},connect(){e.outboundOnly||u.connect(),p.initialize(s).then(()=>{h=!0,d(`[bridge:repl] v2 transport ready for writes (epoch=${s}, sse=${u.isConnectedStatus()?`open`:`opening`})`),m?.()},e=>{d(`[bridge:repl] CCR v2 initialize failed: ${l(e)}`,{level:`error`}),p.close(),u.close(),f?.(4091)})}}}e();var D=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{C as a,w as i,T as n,E as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ba as t,Ya as n,ga as r,it as i,qa as a,st as o}from"./loadAgentsDir-BL93ulMm.js";import{P as s,R as c,c as l,i as u}from"./debug-BecbSVoN.js";import{a as d,l as f}from"./proxy-CVn7o19p.js";import{K as p,M as m,W as h,Y as g,Z as _,et as v,q as y}from"./sessionState-D-SaBzWD.js";import{n as b,r as x}from"./SSETransport-DN4tCDEh.js";import{randomUUID as S}from"crypto";function C(){return(process.env.GEMINI_BASE_URL||E).replace(/\/+$/,``)}function w(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*T(e){let t=await(e.fetchOverride??fetch)(`${C()}/${w(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...d({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,D);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${s(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${s(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),c(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,t,i,s,c,u){try{let r=v(c.model),d=n(e,i),f=(await Promise.all(i.map(e=>o(e,{getToolPermissionContext:c.getToolPermissionContext,tools:i,agents:c.agents,allowedAgentTypes:c.allowedAgentTypes,model:c.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:m,systemInstruction:b}=g(d,t),x=y(f),C=p(c.toolChoice),w=T({model:r,signal:s,fetchOverride:c.fetchOverride,body:{contents:m,...b&&{systemInstruction:b},...x.length>0&&{tools:x},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...c.temperatureOverride!==void 0&&{temperature:c.temperatureOverride},...u.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...u.type===`enabled`&&{thinkingBudget:u.budgetTokens}}}}}});l(`[Gemini] Calling model=${r}, messages=${m.length}, tools=${x.length}`);let E=h(w,r),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[_]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:a([t],i,c.agentId)},requestId:void 0,type:`assistant`,uuid:S(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Gemini] Error: ${t}`,{level:`error`}),yield r({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{i(),u(),t(),O(),m()}))();export{k as queryModelGemini};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$ as t,Ba as n,Oa as r,_v as i,et as a}from"./loadAgentsDir-BL93ulMm.js";import{P as o,R as s,c,i as l}from"./debug-BecbSVoN.js";import{s as u,u as d}from"./types-DafcFtmb.js";import{at as f}from"./sessionState-D-SaBzWD.js";import{r as p,t as m}from"./sessionTitle-uCuYaNif.js";async function h(e,t){let n=m(e);if(!n)return null;try{let e=await a({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),i=d(Array.isArray(e.message.content)?r(e.message.content):e.message.content);return i&&typeof i==`object`&&`name`in i&&typeof i.name==`string`?i.name:null}catch(e){return c(`generateSessionName failed: ${o(e)}`,{level:`error`}),null}}var g=e((()=>{t(),l(),s(),u(),n(),p(),i()}));export{g as n,h as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-DHyW8FMX.js";function i(e){if(e<=1)return!1;try{return process.kill(e,0),!0}catch{return!1}}async function a(e,t=10){if(process.platform===`win32`){let r=await n(`powershell.exe`,[`-NoProfile`,`-Command`,`
|
|
2
2
|
$pid = ${String(e)}
|
|
3
3
|
$ancestors = @()
|
|
4
4
|
for ($i = 0; $i -lt ${t}; $i++) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{Wt as a,cr as o}from"./state-BemZdQIl.js";import{n as s,t as c}from"./cwd-Cfdf7z7s.js";import{C as ee,f as l,i as te,nt as ne,tt as re,u,x as ie}from"./debug-BecbSVoN.js";import{r as ae,t as d}from"./execFileNoThrow-DHyW8FMX.js";import{o as oe}from"./log-Dauqle-Z.js";import{n as f,t as se}from"./memoize-FeyE7JEh.js";import{r as ce,t as le}from"./which-BRWBO7Gu.js";import{basename as ue,dirname as p,join as m,resolve as h,sep as g}from"path";import{readFileSync as _,realpathSync as v,statSync as y,unwatchFile as b,watchFile as de}from"fs";import{createHash as fe}from"crypto";import{readFile as x,readdir as pe,stat as me}from"fs/promises";function S(e,t,n){let r=he();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=u(),o=ee(i)+`
|
|
2
|
+
`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(p(r)),a.appendFileSync(r,o)}catch{}}}function he(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function ge(e,t,n){let r=Date.now();S(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return S(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw S(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var C=e((()=>{l(),ie()}));async function w(e,t,n,r){try{return _e(await x(m(e,`config`),`utf-8`),t,n,r)}catch{return null}}function _e(e,t,n,r){let i=e.split(`
|
|
3
|
+
`),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=xe(t,a,n);continue}if(!s)continue;let r=ve(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ve(e){let t=0;for(;t<e.length&&Se(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:ye(e,t)}}function ye(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
|
|
4
|
+
`;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=be(n)),n}function be(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function xe(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function Se(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var T=e((()=>{}));function Ce(){N.clear()}async function E(e){let t=h(e??c()),n=N.get(t);if(n!==void 0)return n;let r=V(t);if(!r)return N.set(t,null),null;let i=m(r,`.git`);try{if((await me(i)).isFile()){let e=(await x(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=h(r,e.slice(7).trim());return N.set(t,n),n}}return N.set(t,i),i}catch{return N.set(t,null),null}}function D(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function O(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function k(e){try{let t=(await x(m(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return D(e)?{type:`branch`,name:e}:null}if(!D(n))return null;let r=await A(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return O(t)?{type:`detached`,sha:t}:null}catch{return null}}async function A(e,t){let n=await j(e,t);if(n)return n;let r=await M(e);return r&&r!==e?j(r,t):null}async function j(e,t){try{let n=(await x(m(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return D(t)?A(e,t):null}return O(n)?n:null}catch{}try{let n=await x(m(e,`packed-refs`),`utf-8`);for(let e of n.split(`
|
|
5
|
+
`)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return O(t)?t:null}}}catch{}return null}async function M(e){try{return h(e,(await x(m(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function we(e,t,n){try{let r=(await x(m(e,t),`utf-8`)).trim();if(r.startsWith(`ref:`)){let e=r.slice(4).trim();if(e.startsWith(n)){let t=e.slice(n.length);return D(t)?t:null}}}catch{}return null}async function Te(){let e=await E();if(!e)return`HEAD`;let t=await k(e);return t&&t.type===`branch`?t.name:`HEAD`}async function Ee(){let e=await E();if(!e)return null;let t=await w(e,`remote`,`origin`,`url`);if(t)return t;let n=await M(e);return n&&n!==e?w(n,`remote`,`origin`,`url`):null}async function De(){let e=await E();if(!e)return`main`;let t=await M(e)??e,n=await we(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await A(t,`refs/remotes/origin/${e}`))return e;return`main`}function Oe(){return I.get(`branch`,Te)}function ke(){return I.get(`remoteUrl`,Ee)}function Ae(){return I.get(`defaultBranch`,De)}async function je(e){let t=await E(e);if(!t)return null;let n=await k(t);return n?n.type===`branch`?A(t,`refs/heads/${n.name}`):n.sha:null}async function Me(e){let t;try{let n=(await x(m(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=h(e,n.slice(7).trim())}catch{return null}let n=await k(t);return n?n.type===`branch`?A(t,`refs/heads/${n.name}`):n.sha:null}async function Ne(e){let t=await E(e);if(!t)return null;let n=await w(t,`remote`,`origin`,`url`);if(n)return n;let r=await M(t);return r&&r!==t?w(r,`remote`,`origin`,`url`):null}async function Pe(){try{let e=await E();return e?(await pe(m(await M(e)??e,`worktrees`))).length+1:0}catch{return 1}}var N,P,F,I,L=e((()=>{a(),re(),s(),Ve(),T(),r(),N=new Map,P=1e3,F=class{constructor(){i(this,`gitDir`,null),i(this,`commonDir`,null),i(this,`initialized`,!1),i(this,`initPromise`,null),i(this,`watchedPaths`,[]),i(this,`branchRefPath`,null),i(this,`cache`,new Map)}async ensureStarted(){if(!this.initialized)return this.initPromise||(this.initPromise=this.start()),this.initPromise}async start(){this.gitDir=await E(),this.initialized=!0,this.gitDir&&(this.commonDir=await M(this.gitDir),this.watchPath(m(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(m(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),ne(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),de(e,{interval:P},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await k(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?m(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(b(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter(e=>e!==this.branchRefPath)),this.branchRefPath=n,n&&this.watchPath(n,()=>{this.invalidate()}))}async onHeadChanged(){this.invalidate(),await o(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)b(e);this.watchedPaths=[],this.branchRefPath=null}async get(e,t){await this.ensureStarted();let n=this.cache.get(e);if(n&&!n.dirty)return n.value;n&&(n.dirty=!1);let r=await t(),i=this.cache.get(e);return i&&!i.dirty&&(i.value=r),i||this.cache.set(e,{value:r,dirty:!1,compute:t}),r}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}},I=new F}));function Fe(){function e(e){let t=B(e);return t===z?null:t}return e.cache=B.cache,e}function Ie(){function e(e){let t=V(e);return t?H(t):null}return e.cache=H.cache,e}function Le(e){return E(e)}function R(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n&&n[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r&&r[1]&&r[2]){let e=r[1],t=r[2];if(ze(e)&&t.startsWith(`git/`)){let e=t.slice(4),n=e.split(`/`);return n.length>=3&&n[0].includes(`.`)?e.toLowerCase():`github.com/${e}`.toLowerCase()}return`${e}/${t}`.toLowerCase()}return null}async function Re(){let e=await Y();if(!e)return null;let t=R(e);return t?fe(`sha256`).update(t).digest(`hex`).substring(0,16):null}function ze(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Be(){let e=u(),t=c(),n=m(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=m(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(m(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(m(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(m(t,`refs`)).isDirectory())return!0}catch{}return!1}var z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q,$,Ve=e((()=>{n(),s(),te(),C(),ae(),l(),L(),oe(),se(),le(),z=Symbol(`git-root-not-found`),B=f(e=>{let t=Date.now();S(`info`,`find_git_root_started`);let n=h(e),r=n.substring(0,n.indexOf(g)+1)||g,i=0;for(;n!==r;){try{let e=m(n,`.git`);i++;let r=y(e);if(r.isDirectory()||r.isFile())return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=p(n);if(e===n)break;n=e}try{let e=m(r,`.git`);i++;let n=y(e);if(n.isDirectory()||n.isFile())return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),z},e=>e,50),V=Fe(),H=f(e=>{try{let t=_(m(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=h(e,t.slice(7).trim()),r=h(n,_(m(n,`commondir`),`utf-8`).trim());return h(p(n))!==m(r,`worktrees`)||v(_(m(n,`gitdir`),`utf-8`).trim())!==m(v(e),`.git`)?e:ue(r)===`.git`?p(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),U=Ie(),W=t(()=>ce(`git`)||`git`),G=t(async()=>{let e=Date.now();S(`info`,`is_git_check_started`);let t=V(c())!==null;return S(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),K=async e=>V(e)!==null,q=async()=>Oe(),J=async()=>Ae(),Y=async()=>ke(),X=async e=>{let t=[`--no-optional-locks`,`status`,`--porcelain`];e?.ignoreUntracked&&t.push(`-uno`);let{stdout:n}=await d(W(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await d(W(),[`--no-optional-locks`,`status`,`--porcelain`],{preserveOutputOnError:!1}),t=[],n=[];return e.trim().split(`
|
|
6
|
+
`).filter(e=>e.length>0).forEach(e=>{let r=e.substring(0,2),i=e.substring(2).trim();r===`??`?n.push(i):i&&t.push(i)}),{tracked:t,untracked:n}},Q=async()=>Pe(),$=async e=>{try{let t=e||`Work Mate auto-stash - ${new Date().toISOString()}`,{untracked:n}=await Z();if(n.length>0){let{code:e}=await d(W(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await d(W(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{ge as A,Me as C,w as D,T as E,C as O,L as S,A as T,$ as _,J as a,je as b,X as c,Re as d,Q as f,R as g,Be as h,q as i,S as k,G as l,Ve as m,U as n,Z as o,W as p,V as r,Le as s,K as t,Y as u,Ce as v,E as w,Ne as x,M as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,m as n,r,u as i}from"./git-DBlOv64X.js";n();export{r as findGitRoot,t as getBranch,e as getDefaultBranch,i as getRemoteUrl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Wt as e,et as t}from"./state-BemZdQIl.js";import{c as n,i as r}from"./debug-BecbSVoN.js";import{kn as i,wn as a}from"./settings-D4CpDv2y.js";import{c as o,h as s,y as c}from"./config-aRiTrtCv.js";import{S as l,m as u,r as d,x as f}from"./git-DBlOv64X.js";import{a as p,i as m,n as h}from"./detectRepository-C15umvKN.js";import{realpath as g}from"fs/promises";e(),s(),r(),m(),a(),l(),u();async function _(){try{let e=await h();if(!e){n(`Not in a GitHub repository, skipping path mapping update`);return}let r=t(),i=d(r)??r,a;try{a=(await g(i)).normalize(`NFC`)}catch{a=i}let s=e.toLowerCase(),l=o().githubRepoPaths?.[s]??[];if(l[0]===a){n(`Path ${a} already tracked for repo ${s}`);return}let u=l.filter(e=>e!==a),f=[a,...u];c(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[s]:f}})),n(`Added ${a} to tracked paths for repo ${s}`)}catch(e){n(`Error updating repo path mapping: ${e}`)}}function v(e){let t=o(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(i));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await f(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let r=o(),i=e.toLowerCase(),a=r.githubRepoPaths?.[i]??[],s=a.filter(e=>e!==t);if(s.length===a.length)return;let l={...r.githubRepoPaths};s.length===0?delete l[i]:l[i]=s,c(e=>({...e,githubRepoPaths:l})),n(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
|