@readmagic/workmate 0.0.25 → 0.0.27
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-Y5S_lMjD.js → AddWorkspaceDirectory-DqlPtsVK.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CgSethgo.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-DVbU-BaD.js → AgentsMdExternalIncludesDialog-rJS5l6yk.js} +1 -1
- package/dist/chunks/App-DzRQpRKr.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CBhSmdz_.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-DjqGAL4C.js → BypassPermissionsModeDialog-zz-lnmJt.js} +1 -1
- package/dist/chunks/CustomSelect-CYmc4vRh.js +1 -0
- package/dist/chunks/DiffDialog-CTUIAcEE.js +6 -0
- package/dist/chunks/Doctor-CLOYkPRR.js +3 -0
- package/dist/chunks/Doctor-CiZNe_qx.js +1 -0
- package/dist/chunks/{ExitFlow-Dh9QdaYK.js → ExitFlow-CATwJC4c.js} +2 -2
- package/dist/chunks/{InvalidConfigDialog-C9boykQn.js → InvalidConfigDialog-B-9Z58oD.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-UN5mleCK.js → InvalidSettingsDialog-B4EWjbp7.js} +1 -1
- package/dist/chunks/KeybindingProviderSetup-Dzg77_Xn.js +1 -0
- package/dist/chunks/MCPConnectionManager-CBY8nqdU.js +1 -0
- package/dist/chunks/MCPToolListView-C7HT6rrl.js +1 -0
- package/dist/chunks/{McpParsingWarnings-zkM_lGd0.js → McpParsingWarnings-Dj_Fu5o-.js} +1 -1
- package/dist/chunks/MessageSelector-Dw_ERK_Z.js +3 -0
- package/dist/chunks/Messages-RBfRELKn.js +10 -0
- package/dist/chunks/Onboarding-BRSXxc2E.js +1 -0
- package/dist/chunks/{PermissionDialog-BaibiQae.js → PermissionDialog-DjCRuzSm.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-DZc_s_pE.js → PressEnterToContinue-DE1RxMX_.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-CCTZYbWI.js → PromptInputFooterSuggestions-ChpyD9B7.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-CrTT8MKE.js +1 -0
- package/dist/chunks/{ProviderSetup-yIj8YOKF.js → ProviderSetup-BEV95bnz.js} +1 -1
- package/dist/chunks/QueryEngine-BBBkZWu2.js +1 -0
- package/dist/chunks/REPL-BDnZnm__.js +124 -0
- package/dist/chunks/REPL-BHk0vZDf.js +1 -0
- package/dist/chunks/ResumeConversation-BuSqBrm1.js +1 -0
- package/dist/chunks/{SearchBox-C9xxQzh1.js → SearchBox-zA5QwIpO.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-CdWB9sO8.js +1 -0
- package/dist/chunks/Settings-DYKmPdbd.js +2 -0
- package/dist/chunks/Spinner-DOI8qqZi.js +1 -0
- package/dist/chunks/SpinnerGlyph-BR_SiV9L.js +1 -0
- package/dist/chunks/{TextInput-Cev5Awdd.js → TextInput-ZKU-x_FD.js} +11 -11
- package/dist/chunks/ThemePicker-B69oDgXN.js +1 -0
- package/dist/chunks/TrustDialog-BSG8Ibh8.js +1 -0
- package/dist/chunks/{ValidationErrorsList-INwwoerV.js → ValidationErrorsList-BUYHEft4.js} +1 -1
- package/dist/chunks/{_baseEach-DrPH_FGo.js → _baseEach-P0u1zIx6.js} +1 -1
- package/dist/chunks/_baseSlice-D67_NpZ1.js +1 -0
- package/dist/chunks/{add-dir-D3RMaYxy.js → add-dir-C8RmmyQK.js} +1 -1
- package/dist/chunks/{agentDisplay-B3npXoCS.js → agentDisplay-np7CH47m.js} +1 -1
- package/dist/chunks/{agents-2mPGmeq6.js → agents-DRQlR5M1.js} +1 -1
- package/dist/chunks/agents-DedoH0Q4.js +101 -0
- package/dist/chunks/allErrors-DvcU0w0F.js +1 -0
- package/dist/chunks/appleTerminalBackup-Bemd4RXh.js +1 -0
- package/dist/chunks/backgroundHousekeeping-B56nFTzq.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-BkFxfjOf.js → backgroundHousekeeping-BtEJ6TeC.js} +1 -1
- package/dist/chunks/banner-CuoceXzz.js +2 -0
- package/dist/chunks/branch-ClhlS7f8.js +2 -0
- package/dist/chunks/{break-cache-UUt6Dkf2.js → break-cache-B1nuWtD_.js} +2 -2
- package/dist/chunks/{btw-DUml5L1w.js → btw-B-FLxlx-.js} +1 -1
- package/dist/chunks/bundledMode-D9omqD3L.js +2 -0
- package/dist/chunks/caches-D7arwhaa.js +1 -0
- package/dist/chunks/caches-Dn8yrJmL.js +1 -0
- package/dist/chunks/{clear-CrGjNe6E.js → clear-BnWv0i65.js} +1 -1
- package/dist/chunks/{client-BYFVVMcf.js → client-2w-g5kMx.js} +1 -1
- package/dist/chunks/client-B0ngS4Uu.js +1 -0
- package/dist/chunks/client-BP4DOH3K.js +1 -0
- package/dist/chunks/{client-BDuhbzLD.js → client-pA7fKk0-.js} +1 -1
- package/dist/chunks/commands-AcfFLgl5.js +1 -0
- package/dist/chunks/compact-Banc-SNk.js +2 -0
- package/dist/chunks/config-BDn2YIjC.js +3 -0
- package/dist/chunks/config-BhBcadjZ.js +1 -0
- package/dist/chunks/config-Bm5pVdCq.js +1 -0
- package/dist/chunks/{context-mV5zjqmc.js → context-BvDBAyJ9.js} +1 -1
- package/dist/chunks/context-noninteractive-BK2IDLSS.js +1 -0
- package/dist/chunks/{context-noninteractive-DvfVvmSE.js → context-noninteractive-CuHHniJn.js} +7 -7
- package/dist/chunks/conversation-B2dX3X4Z.js +1 -0
- package/dist/chunks/conversation-Cjaftrrw.js +1 -0
- package/dist/chunks/conversationRecovery-NL05oJb1.js +1 -0
- package/dist/chunks/crossProjectResume-BzltC4NJ.js +40 -0
- package/dist/chunks/cwd-BH2f3u0o.js +1 -0
- package/dist/chunks/{cwd-BvNt_018.js → cwd-DrEEb4f5.js} +1 -1
- package/dist/chunks/{debug-CRnGsZOV.js → debug-2pVES-2G.js} +3 -3
- package/dist/chunks/detectRepository--luIRv5H.js +1 -0
- package/dist/chunks/{diff-DUEoNCnJ.js → diff--6gQCx_x.js} +1 -1
- package/dist/chunks/directoryCompletion-BC0qRmrz.js +1 -0
- package/dist/chunks/doctor-CQf8xPZH.js +1 -0
- package/dist/chunks/entry-DWYOrkFS.js +13 -0
- package/dist/chunks/envUtils-QyzA_cFM.js +1 -0
- package/dist/chunks/execFileNoThrow-DXSEj8ZO.js +1 -0
- package/dist/chunks/execa-CBhG1doD.js +34 -0
- package/dist/chunks/exit-uKtXb5U3.js +1 -0
- package/dist/chunks/{extraUsage-BtHE-SBX.js → extraUsage-Dr0YXm1w.js} +1 -1
- package/dist/chunks/extractMemories-8yvMGZ1J.js +1 -0
- package/dist/chunks/fast-C5-lNCQi.js +1 -0
- package/dist/chunks/fast-aNkj6WvB.js +1 -0
- package/dist/chunks/fetchModelList-9w1E4Ue8.js +1 -0
- package/dist/chunks/fetchModelList-D2quBF6M.js +1 -0
- package/dist/chunks/fileSuggestions-BYD78vcF.js +3 -0
- package/dist/chunks/{fpsMetrics-wxj9GAsd.js → fpsMetrics-DIpm2-xw.js} +1 -1
- package/dist/chunks/{gemini-4YGElN3H.js → gemini-BNBptTET.js} +2 -2
- package/dist/chunks/generateSessionName-CO2484aJ.js +1 -0
- package/dist/chunks/genericProcessUtils-GqURdVAv.js +12 -0
- package/dist/chunks/{goal-ePK_jLo3.js → goal-j0wdadwM.js} +1 -1
- package/dist/chunks/grok-BpO1ZwK_.js +1 -0
- package/dist/chunks/{help-B7xRle-V.js → help-DwhA0qQ6.js} +1 -1
- package/dist/chunks/history-CUrqO9rV.js +1 -0
- package/dist/chunks/hooks-B5Wq-KxE.js +1 -0
- package/dist/chunks/{hooks-BN5f58HY.js → hooks-DG4_WdZ2.js} +2 -2
- package/dist/chunks/{install-DrMiHa2Q.js → install-BbmCNCuM.js} +1 -1
- package/dist/chunks/{instrumentation-Oj5xagJG.js → instrumentation-DpPmDyNF.js} +6 -6
- package/dist/chunks/{job-D9ypO0cd.js → job-GcmX1ALd.js} +1 -1
- package/dist/chunks/keybindings-CxgQqQJe.js +1 -0
- package/dist/chunks/{launchLocalMemory-DliLezJw.js → launchLocalMemory-CDgT5lst.js} +1 -1
- package/dist/chunks/{launchOnboarding-A-kk-7ID.js → launchOnboarding-uQ_ux9sS.js} +1 -1
- package/dist/chunks/loadAgentsDir-BBbIAiay.js +1 -0
- package/dist/chunks/{loadAgentsDir-DGozQu_6.js → loadAgentsDir-uuZYOgKn.js} +573 -577
- package/dist/chunks/{loadPluginHooks-BiHPKDaY.js → loadPluginHooks-QoVXsBjy.js} +1 -1
- package/dist/chunks/loader-BMAtuwRa.js +1 -0
- package/dist/chunks/localSearch-D6MhwvnR.js +1 -0
- package/dist/chunks/{localSearch-BU02Qsv9.js → localSearch-yVCDrVrf.js} +1 -1
- package/dist/chunks/lockfile-D_9vif6E.js +1 -0
- package/dist/chunks/{log-DoSpAwRP.js → log-L1kqxa_P.js} +1 -1
- package/dist/chunks/{logoUtils-DLd6JKqW.js → logoUtils-B4wCDKs9.js} +1 -1
- package/dist/chunks/{magicDocs-Bj8LYrN2.js → magicDocs-D53lV8b5.js} +2 -2
- package/dist/chunks/main-fy_XSXGj.js +345 -0
- package/dist/chunks/managedEnv-B8YWmM4A.js +1 -0
- package/dist/chunks/managedEnv-ulQBH73B.js +1 -0
- package/dist/chunks/managedEnvConstants-BPY8yF1A.js +1 -0
- package/dist/chunks/mcp--LmEVBRg.js +1 -0
- package/dist/chunks/mcp-CZUVaPb3.js +5 -0
- package/dist/chunks/mcp-DCl-Tz-C.js +2 -0
- package/dist/chunks/memory-Bu5ku7y9.js +1 -0
- package/dist/chunks/{modalContext-DDZdU1J8.js → modalContext-sU2lfR08.js} +1 -1
- package/dist/chunks/{mode-CBKawxnD.js → mode-Bteqe2QG.js} +1 -1
- package/dist/chunks/{model-DwbqvCY2.js → model-CHDU5yqH.js} +1 -1
- package/dist/chunks/model-CcHyMyBv.js +1 -0
- package/dist/chunks/modelOptions-CJV1R3Jt.js +1 -0
- package/dist/chunks/nativeInstaller-CIUYh1aD.js +1 -0
- package/dist/chunks/{notifications-ql0eSo0Y.js → notifications-GLnjirCl.js} +1 -1
- package/dist/chunks/{observationStore-D0rm3GhP.js → observationStore-pnSSxec_.js} +1 -1
- package/dist/chunks/{onChangeAppState-D85b33R5.js → onChangeAppState-CxGW2d-l.js} +1 -1
- package/dist/chunks/openai-BpGQT2Iv.js +2 -0
- package/dist/chunks/{overlayContext-CLjlCFBl.js → overlayContext-7wgLio1O.js} +1 -1
- package/dist/chunks/{panel-DMZkOEiU.js → panel-DNiXDhBX.js} +1 -1
- package/dist/chunks/{parser-UqADrvxF.js → parser-CTnaXFVJ.js} +1 -1
- package/dist/chunks/parser-Diihup2V.js +1 -0
- package/dist/chunks/{partition-CwxTlmMd.js → partition-djFY9gGI.js} +1 -1
- package/dist/chunks/{pasteStore-ovtxMVR5.js → pasteStore-njJCBMKr.js} +1 -1
- package/dist/chunks/permissions-DNedQyLg.js +3 -0
- package/dist/chunks/pidLock-CFUBtZck.js +3 -0
- package/dist/chunks/plan-DI0n7LIV.js +1 -0
- package/dist/chunks/plugin-BQ8gRVYF.js +17 -0
- package/dist/chunks/pluginAutoupdate-CNrHb4RJ.js +1 -0
- package/dist/chunks/{pluginBlocklist-BAr9WTup.js → pluginBlocklist-CKCsgWdY.js} +1 -1
- package/dist/chunks/pluginCliCommands-CACeyIwz.js +1 -0
- package/dist/chunks/{pluginFlagging-BO_3qjfs.js → pluginFlagging-CUvkKGOB.js} +1 -1
- package/dist/chunks/pluginOperations-Ca_T-HYn.js +2 -0
- package/dist/chunks/pluginStartupCheck-DftTiXct.js +1 -0
- package/dist/chunks/pluginStartupCheck-Du9yx2P8.js +1 -0
- package/dist/chunks/{plugins-9crasx2V.js → plugins-Divl-P-X.js} +4 -4
- package/dist/chunks/{poller-CpLBoB-N.js → poller-BeyVwHAf.js} +1 -1
- package/dist/chunks/poorMode-CG2JNTD0.js +1 -0
- package/dist/chunks/poorMode-eMIFCAC_.js +1 -0
- package/dist/chunks/print-DSHypGJa.js +13 -0
- package/dist/chunks/processBashCommand-BLcFmbyG.js +1 -0
- package/dist/chunks/processSlashCommand-Caif46Gi.js +5 -0
- package/dist/chunks/{projectContext-DhtjLv3k.js → projectContext-BFfHgAMh.js} +1 -1
- package/dist/chunks/{projectContext-5fmRr6Sd.js → projectContext-DnJHynXv.js} +1 -1
- package/dist/chunks/{projectOnboardingState--L3BKjOE.js → projectOnboardingState-nTCycGCD.js} +1 -1
- package/dist/chunks/prompt-BZmu5CeK.js +1 -0
- package/dist/chunks/{prompt-DzO1um1h.js → prompt-BfXryFt-.js} +21 -21
- package/dist/chunks/prompt-Cogr_WZr.js +1 -0
- package/dist/chunks/promptEditor-14TB3MYt.js +4 -0
- package/dist/chunks/protocolHandler-VigBkAQQ.js +13 -0
- package/dist/chunks/{proxy-BjkGlmBu.js → proxy--_NfbJhm.js} +2 -2
- package/dist/chunks/reconciler-B9XFdL4f.js +1 -0
- package/dist/chunks/refresh-CBHbWTGg.js +1 -0
- package/dist/chunks/reject-CBxnwckZ.js +1 -0
- package/dist/chunks/{reload-plugins-DeyJTx4s.js → reload-plugins-5eFWrQlL.js} +1 -1
- package/dist/chunks/rename-Cw7cMerG.js +1 -0
- package/dist/chunks/{renderOptions-DRS2EslG.js → renderOptions-B0RFpjRI.js} +1 -1
- package/dist/chunks/{resume-N4O5YI-S.js → resume-U2D0ybfU.js} +2 -2
- package/dist/chunks/ripgrep-67m14ImZ.js +5 -0
- package/dist/chunks/ripgrep-DB7KB8RZ.js +1 -0
- package/dist/chunks/{runtimeObserver-DMSzdFWt.js → runtimeObserver-CWaYMJG8.js} +4 -4
- package/dist/chunks/{runtimeObserver-C0CJvA3q.js → runtimeObserver-DOYlxx9H.js} +1 -1
- package/dist/chunks/sandbox-adapter-Df7Wpt77.js +1 -0
- package/dist/chunks/sandbox-toggle-BtiPyjT3.js +1 -0
- package/dist/chunks/searchExtraTools-CbJVb_Zk.js +1 -0
- package/dist/chunks/select-BuTJbu_Q.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-_mxyfQmn.js +1 -0
- package/dist/chunks/sessionObserver-BZVgzp3W.js +1 -0
- package/dist/chunks/{sessionObserver-CRie77tp.js → sessionObserver-cfwD8pV8.js} +2 -2
- package/dist/chunks/sessionStorage-SC5RfnUP.js +1 -0
- package/dist/chunks/sessionTracing-DsdcOqvc.js +11 -0
- package/dist/chunks/settings-D4M13toi.js +104 -0
- package/dist/chunks/settings-Dfit5gGT.js +1 -0
- package/dist/chunks/setup-DR-KEmxL.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-CTnYVrmP.js → shadowedRuleDetection-DiZUDzxU.js} +1 -1
- package/dist/chunks/{sideQuestion-Cl8m2qYx.js → sideQuestion-CdgUarC2.js} +3 -3
- package/dist/chunks/{sinks-CiupmfTg.js → sinks-Cy3NqVbk.js} +1 -1
- package/dist/chunks/sinks-D41OiGE4.js +1 -0
- package/dist/chunks/skillChangeDetector-CVFCJcG7.js +1 -0
- package/dist/chunks/{skillGapStore-es3K-aYe.js → skillGapStore-BJV8ZIB1.js} +2 -2
- package/dist/chunks/{skillLifecycle-BcgoOQBk.js → skillLifecycle-iO_3s9Ff.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CuDDb1L-.js → skillSearchPanel-BL5gXTHU.js} +2 -2
- package/dist/chunks/skills-BEp3_RyT.js +1 -0
- package/dist/chunks/sleep-xKMbXTJe.js +1 -0
- package/dist/chunks/{src-DL3w8VPk.js → src-BX54x08P.js} +4 -4
- package/dist/chunks/{src-9vmGsuSI.js → src-HB5wLari.js} +1 -1
- package/dist/chunks/{startupProfiler-DF0AjiDf.js → startupProfiler-B9Qv2QGH.js} +2 -2
- package/dist/chunks/startupProfiler-DWcM4QBl.js +1 -0
- package/dist/chunks/{state-BQ4BEGin.js → state-CXY-q5gr.js} +1 -1
- package/dist/chunks/state-DXt6rahM.js +1 -0
- package/dist/chunks/{staticRender-BVWx0IM1.js → staticRender-Bt82RvGc.js} +1 -1
- package/dist/chunks/status-6JMz8jmM.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-BfmIub5L.js → statusNoticeHelpers-BoloSeXY.js} +1 -1
- package/dist/chunks/stringUtils-Cs6E5f-B.js +4 -0
- package/dist/chunks/switcher-95d4TrQH.js +1 -0
- package/dist/chunks/switcher-DSt2cVjA.js +1 -0
- package/dist/chunks/{tasks-B6gYXxOx.js → tasks-DyBUXnQb.js} +1 -1
- package/dist/chunks/{templateJobs-BW6TaqEC.js → templateJobs-BBnReWWj.js} +7 -7
- package/dist/chunks/{terminalSetup-C-g9Xvj3.js → terminalSetup-CDpFfqqV.js} +1 -1
- package/dist/chunks/{terminalSetup-BgIXFBpd.js → terminalSetup-DedaY1P7.js} +4 -4
- package/dist/chunks/{theme-9AZceq_m.js → theme-BZOy9Iqh.js} +1 -1
- package/dist/chunks/tipRegistry-Cl5sdLRX.js +2 -0
- package/dist/chunks/{toolEventObserver-DTuJcREC.js → toolEventObserver-ClwWmVbH.js} +1 -1
- package/dist/chunks/toolPool-DSTbgGmX.js +1 -0
- package/dist/chunks/udsClient-CWeoNrm3.js +1 -0
- package/dist/chunks/urlHandler-BNsQKqba.js +1 -0
- package/dist/chunks/{useDoublePress-C9xxQzh1.js → useDoublePress-zA5QwIpO.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DWRFdFoU.js → useExitOnCtrlCDWithKeybindings-ClN4NJnB.js} +1 -1
- package/dist/chunks/useMainLoopModel-Bgxpmn2Q.js +1 -0
- package/dist/chunks/useManagePlugins-CxHz-gUP.js +1 -0
- package/dist/chunks/useMergedTools-BUuWew0-.js +1 -0
- package/dist/chunks/{useSearchInput-B_mY9wBq.js → useSearchInput-BIQN_-Hm.js} +1 -1
- package/dist/chunks/{useSettingsErrors-CM7tThcp.js → useSettingsErrors-BDJCLei_.js} +1 -1
- package/dist/chunks/util-BHr5l6Bx.js +1 -0
- package/dist/chunks/validatePlugin-fx1Y8vam.js +1 -0
- package/dist/chunks/{vim-Dpnhgoz_.js → vim-CYjMtnwH.js} +1 -1
- package/dist/chunks/worktree-CGu_58ue.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -2
- package/scripts/postinstall.cjs +16 -16
- package/dist/chunks/AgentsMdExternalIncludesDialog-Bnb1jWcg.js +0 -1
- package/dist/chunks/App-B8q8PV77.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-i0TkZgQp.js +0 -2
- package/dist/chunks/CustomSelect-BvTftqEH.js +0 -1
- package/dist/chunks/DiffDialog-v5r8cBKW.js +0 -6
- package/dist/chunks/Doctor-DKpBnbuI.js +0 -1
- package/dist/chunks/Doctor-uvO6NM5m.js +0 -3
- package/dist/chunks/KeybindingProviderSetup-DsJqfEt-.js +0 -1
- package/dist/chunks/MCPConnectionManager-DkZVxLEj.js +0 -1
- package/dist/chunks/MCPToolListView-De1W4jpj.js +0 -1
- package/dist/chunks/MessageSelector-DW_itlX-.js +0 -3
- package/dist/chunks/Messages-BFsCpACq.js +0 -10
- package/dist/chunks/Onboarding-BT90cFkn.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-Bm5KY0Ma.js +0 -1
- package/dist/chunks/QueryEngine-egz5mbaW.js +0 -1
- package/dist/chunks/REPL-D27CE4WN.js +0 -124
- package/dist/chunks/REPL-e8wAT1wN.js +0 -1
- package/dist/chunks/ResumeConversation-CWA27Lke.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BRchtZ9Q.js +0 -1
- package/dist/chunks/SelectMulti-BW7Ffk1G.js +0 -1
- package/dist/chunks/Settings-axHLvYIy.js +0 -3
- package/dist/chunks/Spinner-VjwI7m_g.js +0 -1
- package/dist/chunks/SpinnerGlyph-CqrOK3Mx.js +0 -1
- package/dist/chunks/ThemePicker-CtQYHmOr.js +0 -1
- package/dist/chunks/TrustDialog-8Sjmuu0e.js +0 -1
- package/dist/chunks/agents-DEnmg8Xo.js +0 -101
- package/dist/chunks/allErrors-C9kx6lnk.js +0 -1
- package/dist/chunks/appleTerminalBackup-CT7g8yOs.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CvWfd99M.js +0 -1
- package/dist/chunks/banner-DHpTmEO7.js +0 -2
- package/dist/chunks/branch-Be_yDFU8.js +0 -2
- package/dist/chunks/caches-DWjwe-DN.js +0 -1
- package/dist/chunks/caches-VLs1tQkZ.js +0 -1
- package/dist/chunks/claudeDesktop-mBGFDbI6.js +0 -1
- package/dist/chunks/client-CO_6v4yl.js +0 -1
- package/dist/chunks/client-DO-O441l.js +0 -1
- package/dist/chunks/commands-Cn1P7Tms.js +0 -1
- package/dist/chunks/compact-DGUhdXcc.js +0 -2
- package/dist/chunks/config-C7GTF4iI.js +0 -1
- package/dist/chunks/config-CWPHVTic.js +0 -3
- package/dist/chunks/config-Cox0TM2Z.js +0 -1
- package/dist/chunks/context-noninteractive--OuiZUzL.js +0 -1
- package/dist/chunks/conversation--y8PD2Lk.js +0 -1
- package/dist/chunks/conversation-BIPJEOwO.js +0 -1
- package/dist/chunks/conversationRecovery-BBJzrA0g.js +0 -1
- package/dist/chunks/crossProjectResume-CwZb3cEU.js +0 -40
- package/dist/chunks/cwd-BZMp3CZ8.js +0 -1
- package/dist/chunks/detectRepository-CsJLbVEe.js +0 -1
- package/dist/chunks/directoryCompletion-Bgi8DBT5.js +0 -1
- package/dist/chunks/doctor-4NiE46ZG.js +0 -1
- package/dist/chunks/entry-D1iD76SW.js +0 -13
- package/dist/chunks/envUtils-DfkgIdYf.js +0 -1
- package/dist/chunks/execFileNoThrow-BgRsj_SW.js +0 -34
- package/dist/chunks/exit-CrsQsjbx.js +0 -1
- package/dist/chunks/extractMemories-kogJzpit.js +0 -1
- package/dist/chunks/fast-CuNVwVTr.js +0 -1
- package/dist/chunks/fast-RlFnwGRV.js +0 -1
- package/dist/chunks/fetchModelList-Cjow_QGy.js +0 -1
- package/dist/chunks/fetchModelList-uiCPVqbJ.js +0 -1
- package/dist/chunks/fileSuggestions-C96V9-Ne.js +0 -3
- package/dist/chunks/generateSessionName-BHIKyXpz.js +0 -1
- package/dist/chunks/genericProcessUtils-BNlr-QxM.js +0 -23
- package/dist/chunks/grok-DnmklTrm.js +0 -1
- package/dist/chunks/history-kOw3CcLT.js +0 -1
- package/dist/chunks/hooks-BDY1jMbS.js +0 -1
- package/dist/chunks/keybindings-BRRN_eap.js +0 -1
- package/dist/chunks/loadAgentsDir-CJAK4kif.js +0 -1
- package/dist/chunks/loader-CtoR-vO-.js +0 -1
- package/dist/chunks/localSearch-DyaB2Rm-.js +0 -1
- package/dist/chunks/main-B_09WbaG.js +0 -345
- package/dist/chunks/managedEnv-BJGfe3m7.js +0 -1
- package/dist/chunks/managedEnv-CIWJsuty.js +0 -1
- package/dist/chunks/managedEnvConstants-BPwL2aWI.js +0 -1
- package/dist/chunks/mcp-1nBvcNxw.js +0 -1
- package/dist/chunks/mcp-7DXpXMdT.js +0 -2
- package/dist/chunks/mcp-kw99WVi2.js +0 -6
- package/dist/chunks/memory-CjWvzR_9.js +0 -1
- package/dist/chunks/model-DpZaKZMb.js +0 -1
- package/dist/chunks/modelOptions-CXBfKFXA.js +0 -1
- package/dist/chunks/nativeInstaller-SmPeEisk.js +0 -1
- package/dist/chunks/openai-D_j7-KW6.js +0 -2
- package/dist/chunks/parser-2usBI4G-.js +0 -1
- package/dist/chunks/permissions-CgsvWOk_.js +0 -3
- package/dist/chunks/pidLock-B-SW3Nhx.js +0 -3
- package/dist/chunks/plan-BJrWtXEh.js +0 -1
- package/dist/chunks/platform-DsMIk3eq.js +0 -2
- package/dist/chunks/plugin-D97VJAxW.js +0 -17
- package/dist/chunks/pluginAutoupdate-DQqYDPVg.js +0 -1
- package/dist/chunks/pluginCliCommands-CUGPc853.js +0 -1
- package/dist/chunks/pluginOperations-rTrzu6Vg.js +0 -2
- package/dist/chunks/pluginStartupCheck-BRHnXlym.js +0 -1
- package/dist/chunks/pluginStartupCheck-BX6cv-vs.js +0 -1
- package/dist/chunks/poorMode-BaS0DBUO.js +0 -1
- package/dist/chunks/poorMode-DmvzFAz_.js +0 -1
- package/dist/chunks/print-Bi3xVdB3.js +0 -13
- package/dist/chunks/processBashCommand-BBtnCx-7.js +0 -1
- package/dist/chunks/processSlashCommand-jzF0GmLO.js +0 -5
- package/dist/chunks/prompt-CmijKW7G.js +0 -1
- package/dist/chunks/prompt-DYBx_D0H.js +0 -1
- package/dist/chunks/promptEditor-B6S_Rzcu.js +0 -4
- package/dist/chunks/protocolHandler-BWgH1jaF.js +0 -13
- package/dist/chunks/reconciler-CVMmAaCy.js +0 -1
- package/dist/chunks/refresh-CAGv8BJY.js +0 -1
- package/dist/chunks/reject-CEUkoI2G.js +0 -1
- package/dist/chunks/rename-DPFis9g_.js +0 -1
- package/dist/chunks/ripgrep-3omwGI-l.js +0 -1
- package/dist/chunks/ripgrep-CgQrN3XX.js +0 -5
- package/dist/chunks/sandbox-adapter-D15jjHJR.js +0 -1
- package/dist/chunks/sandbox-toggle-Tbbaw18C.js +0 -1
- package/dist/chunks/searchExtraTools-BoFc__Eg.js +0 -1
- package/dist/chunks/select-Fq6g2Ejk.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Rgsp4_Ex.js +0 -1
- package/dist/chunks/sessionObserver-PcaVCVkX.js +0 -1
- package/dist/chunks/sessionStorage-Dkf7FRgA.js +0 -1
- package/dist/chunks/sessionTracing-D7rekMdW.js +0 -11
- package/dist/chunks/settings-8fwIkMDV.js +0 -1
- package/dist/chunks/settings-CodSADx8.js +0 -24
- package/dist/chunks/setup-DBiIrXrh.js +0 -3
- package/dist/chunks/sinks-DH83d_kd.js +0 -1
- package/dist/chunks/skillChangeDetector-BrrZaFkT.js +0 -1
- package/dist/chunks/skills-BRtgqnLz.js +0 -1
- package/dist/chunks/startupProfiler-D1NRu2nj.js +0 -1
- package/dist/chunks/state-D3gvDiu8.js +0 -1
- package/dist/chunks/status-WXA16wIM.js +0 -1
- package/dist/chunks/stringUtils-Bu_lJH5c.js +0 -4
- package/dist/chunks/switcher-5gilU5_R.js +0 -1
- package/dist/chunks/switcher-DMfuKuw_.js +0 -1
- package/dist/chunks/tipRegistry-DtO1H_Wo.js +0 -2
- package/dist/chunks/toolPool-DHS8jWaL.js +0 -1
- package/dist/chunks/types-97nL3naE.js +0 -81
- package/dist/chunks/udsClient-CmYHFiBD.js +0 -1
- package/dist/chunks/urlHandler-DLz3FZm1.js +0 -1
- package/dist/chunks/use-select-navigation-BStVRvcX.js +0 -1
- package/dist/chunks/useMainLoopModel-DSN5HjV1.js +0 -1
- package/dist/chunks/useManagePlugins-ntnOf5OU.js +0 -1
- package/dist/chunks/useMergedTools-C5Yns9Ij.js +0 -1
- package/dist/chunks/util-Bb2S6g9N.js +0 -1
- package/dist/chunks/validatePlugin-D8WQ5z4W.js +0 -1
- package/dist/chunks/worktree-a5oOPSYl.js +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
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{aborted as b,callbackify as x,debuglog as ee,inspect as te,promisify as ne,stripVTControlCharacters as re}from"node:util";import S,{execArgv as ie,execPath as ae,hrtime as oe,platform as se}from"node:process";import C from"node:path";import{ChildProcess as ce,execFile as le,spawn as ue,spawnSync as de}from"node:child_process";import{appendFileSync as fe,createReadStream as pe,createWriteStream as me,readFileSync as he,statSync as ge,writeFileSync as _e}from"node:fs";import{constants as ve}from"node:os";import ye from"node:tty";import{EventEmitter as be,addAbortListener as xe,on as Se,once as w,setMaxListeners as Ce}from"node:events";import{Duplex as we,PassThrough as Te,Readable as T,Transform as Ee,Writable as De,getDefaultHighWaterMark as Oe}from"node:stream";import{Buffer as ke}from"node:buffer";import{fileURLToPath as Ae}from"node:url";import{StringDecoder as je}from"node:string_decoder";import{scheduler as Me,setImmediate as Ne,setTimeout as Pe}from"node:timers/promises";import{serialize as Fe}from"node:v8";import{finished as E}from"node:stream/promises";function D(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 O=t((()=>{})),Ie,Le,Re,ze,Be=t((()=>{Ie=(e,t)=>{let n=ze(Le(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},Le=e=>Re(e)?e.toString():e,Re=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,ze=e=>e instanceof URL?Ae(e):e})),Ve,He=t((()=>{O(),Be(),Ve=(e,t=[],n={})=>{let r=Ie(e,`First argument`),[i,a]=D(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(!D(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]}})),Ue,We,k,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,A=t((()=>{({toString:Ue}=Object.prototype),We=e=>Ue.call(e)===`[object ArrayBuffer]`,k=e=>Ue.call(e)===`[object Uint8Array]`,Ge=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ke=new TextEncoder,qe=e=>Ke.encode(e),Je=new TextDecoder,Ye=e=>Je.decode(e),Xe=(e,t)=>Ze(e,t).join(``),Ze=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new je(t),r=e.map(e=>typeof e==`string`?qe(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Qe=e=>e.length===1&&k(e[0])?e[0]:et($e(e)),$e=e=>e.map(e=>typeof e==`string`?qe(e):e),et=e=>{let t=new Uint8Array(tt(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},tt=e=>{let t=0;for(let n of e)t+=n.length;return t}})),nt,rt,it,at,ot,st,ct,lt,ut,dt=t((()=>{O(),A(),nt=e=>Array.isArray(e)&&Array.isArray(e.raw),rt=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=it({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,{}]},it=({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}=at(i,e.raw[r]),c=ct(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>lt(e)):[lt(l)];return ct(c,u,s)},at=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=ot.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(ot.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
|
|
2
|
+
`?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=st[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},ot=new Set([` `,` `,`\r`,`
|
|
3
|
+
`]),st={x:3,u:5},ct=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],lt=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(D(e)&&(`stdout`in e||`isMaxBuffer`in e))return ut(e);throw e instanceof ce||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`)},ut=({stdout:e})=>{if(typeof e==`string`)return e;if(k(e))return Ye(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`)}})),j,ft,M,pt,N=t((()=>{j=e=>ft.includes(e),ft=[S.stdin,S.stdout,S.stderr],M=[`stdin`,`stdout`,`stderr`],pt=e=>M[e]??`stdio[${e}]`})),mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,P=t((()=>{O(),N(),mt=e=>{let t={...e};for(let n of Et)t[n]=ht(e,n);return t},ht=(e,t)=>{let n=Array.from({length:gt(e)+1}),r=_t(e[t],n,t);return wt(r,t)},gt=({stdio:e})=>Array.isArray(e)?Math.max(e.length,M.length):M.length,_t=(e,t,n)=>D(e)?vt(e,t,n):t.fill(e),vt=(e,t,n)=>{for(let r of Object.keys(e).sort(yt))for(let i of xt(r,n,t))t[i]=e[r];return t},yt=(e,t)=>bt(e)<bt(t)?1:-1,bt=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,xt=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=St(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
|
|
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.
|
|
5
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},St=e=>{if(e===`all`)return e;if(M.includes(e))return M.indexOf(e);let t=Ct.exec(e);if(t!==null)return Number(t[1])},Ct=/^fd(\d+)$/,wt=(e,t)=>e.map(e=>e===void 0?Tt[t]:e),Tt={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ee(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},Et=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],Dt=(e,t)=>t===`ipc`?e.at(-1):e[t]})),Ot,kt,At,jt,Mt,Nt,Pt,F=t((()=>{P(),Ot=({verbose:e},t)=>jt(e,t)!==`none`,kt=({verbose:e},t)=>![`none`,`short`].includes(jt(e,t)),At=({verbose:e},t)=>{let n=jt(e,t);return Nt(n)?n:void 0},jt=(e,t)=>t===void 0?Mt(e):Dt(e,t),Mt=e=>e.find(e=>Nt(e))??Pt.findLast(t=>e.includes(t)),Nt=e=>typeof e==`function`,Pt=[`none`,`short`,`full`]})),Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt=t((()=>{Ft=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>Ut(Lt(e))).join(` `)}},It=e=>re(e).split(`
|
|
6
|
+
`).map(e=>Lt(e)).join(`
|
|
7
|
+
`),Lt=e=>e.replaceAll(Bt,e=>Rt(e)),Rt=e=>{let t=Vt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=Ht?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},zt=()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Bt=zt(),Vt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Ht=65535,Ut=e=>Wt.test(e)?e:se===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Wt=/^[\w./-]+$/})),Kt,I,qt,Jt,Yt,Xt,Zt=t((()=>{Kt=ye?.WriteStream?.prototype?.hasColors?.()??!1,I=(e,t)=>{if(!Kt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}},I(0,0),qt=I(1,22),I(2,22),I(3,23),I(4,24),I(53,55),I(7,27),I(8,28),I(9,29),I(30,39),I(31,39),I(32,39),I(33,39),I(34,39),I(35,39),I(36,39),I(37,39),Jt=I(90,39),I(40,49),I(41,49),I(42,49),I(43,49),I(44,49),I(45,49),I(46,49),I(47,49),I(100,49),Yt=I(91,39),I(92,39),Xt=I(93,39),I(94,39),I(95,39),I(96,39),I(97,39),I(101,49),I(102,49),I(103,49),I(104,49),I(105,49),I(106,49),I(107,49)})),Qt=t((()=>{Zt(),Zt()})),$t,en,tn,nn,rn,an,on,sn=t((()=>{_(),Qt(),$t=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=en(n),c=rn[e]({failed:a,reject:o,piped:r}),l=on[e]({reject:o});return`${Jt(`[${s}]`)} ${Jt(`[${i}]`)} ${l(c)} ${l(t)}`},en=e=>`${tn(e.getHours(),2)}:${tn(e.getMinutes(),2)}:${tn(e.getSeconds(),2)}.${tn(e.getMilliseconds(),3)}`,tn=(e,t)=>String(e).padStart(t,`0`),nn=({failed:e,reject:t})=>e?t?y.cross:y.warning:y.tick,rn={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:nn,duration:nn},an=e=>e,on={command:()=>qt,output:()=>an,ipc:()=>an,error:({reject:e})=>e?Yt:Xt,duration:()=>Jt}})),cn,ln,un,dn=t((()=>{F(),cn=(e,t,n)=>{let r=At(t,n);return e.map(({verboseLine:e,verboseObject:t})=>ln(e,t,r)).filter(e=>e!==void 0).map(e=>un(e)).join(``)},ln=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},un=e=>e.endsWith(`
|
|
8
|
+
`)?e:`${e}\n`})),fn,pn,mn,hn,gn,_n,vn=t((()=>{Gt(),sn(),dn(),fn=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=pn({type:e,result:i,verboseInfo:r}),o=cn(mn(t,a),r,n);o!==``&&console.warn(o.slice(0,-1))},pn=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...a}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:a}),mn=(e,t)=>e.split(`
|
|
9
|
+
`).map(e=>hn({...t,message:e})),hn=e=>({verboseLine:$t(e),verboseObject:e}),gn=e=>It(typeof e==`string`?e:te(e)).replaceAll(` `,` `.repeat(_n)),_n=2})),yn,bn=t((()=>{F(),vn(),yn=(e,t)=>{Ot(t)&&fn({type:`command`,verboseMessage:e,verboseInfo:t})}})),xn,Sn,Cn,wn,Tn=t((()=>{F(),xn=(e,t,n)=>(wn(e),{verbose:e,escapedCommand:t,commandId:Sn(e),rawOptions:n}),Sn=e=>Ot({verbose:e})?Cn++:void 0,Cn=0n,wn=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Pt.includes(t)&&!Nt(t)){let e=Pt.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}}})),En,Dn,On=t((()=>{En=()=>oe.bigint(),Dn=e=>Number(oe.bigint()-e)/1e6})),kn,An=t((()=>{bn(),Tn(),On(),Gt(),P(),kn=(e,t,n)=>{let r=En(),{command:i,escapedCommand:a}=Ft(e,t),o=xn(ht(n,`verbose`),a,{...n});return yn(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}}})),jn=r(((t,n)=>{n.exports=o,o.sync=s;var r=e(`fs`);function i(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function a(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:i(t,n)}function o(e,t,n){r.stat(e,function(r,i){n(r,!r&&a(i,e,t))})}function s(e,t){return a(r.statSync(e),e,t)}})),Mn=r(((t,n)=>{n.exports=i,i.sync=a;var r=e(`fs`);function i(e,t,n){r.stat(e,function(e,r){n(e,!e&&o(r,t))})}function a(e,t){return o(r.statSync(e),t)}function o(e,t){return e.isFile()&&s(e,t)}function s(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),Nn=r(((t,n)=>{e(`fs`);var r=process.platform===`win32`||global.TESTING_WINDOWS?jn():Mn();n.exports=i,i.sync=a;function i(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){i(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function a(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),Pn=r(((t,n)=>{var r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=e(`path`),a=r?`;`:`:`,o=Nn(),s=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),c=(e,t)=>{let n=t.colon||a,i=e.match(/\//)||r&&e.match(/\\/)?[``]:[...r?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(n)],o=r?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=r?o.split(n):[``];return r&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:i,pathExt:s,pathExtExe:o}},l=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:a,pathExtExe:l}=c(e,t),u=[],d=n=>new Promise((a,o)=>{if(n===r.length)return t.all&&u.length?a(u):o(s(e));let c=r[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;a(f(p,n,0))}),f=(e,n,r)=>new Promise((i,s)=>{if(r===a.length)return i(d(n+1));let c=a[r];o(e+c,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+c);else return i(e+c);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};n.exports=l,l.sync=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:a}=c(e,t),l=[];for(let s=0;s<n.length;s++){let c=n[s],u=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<r.length;e++){let n=f+r[e];try{if(o.sync(n,{pathExt:a}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw s(e)}})),Fn=r(((e,t)=>{var n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),In=r(((t,n)=>{var r=e(`path`),i=Pn(),a=Fn();function o(e,t){let n=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=i.sync(e.command,{path:n[a({env:n})],pathExt:t?r.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&(l=r.resolve(s?e.options.cwd:``,l)),l}function s(e){return o(e)||o(e,!0)}n.exports=s})),Ln=r(((e,t)=>{var n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),Rn=r(((e,t)=>{t.exports=/^#!(.*)/})),zn=r(((e,t)=>{var n=Rn();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),Bn=r(((t,n)=>{var r=e(`fs`),i=zn();function a(e){let t=Buffer.alloc(150),n;try{n=r.openSync(e,`r`),r.readSync(n,t,0,150,0),r.closeSync(n)}catch{}return i(t.toString())}n.exports=a})),Vn=r(((t,n)=>{var r=e(`path`),i=In(),a=Ln(),o=Bn(),s=process.platform===`win32`,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(e){e.file=i(e);let t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}function d(e){if(!s)return e;let t=u(e),n=!c.test(t);if(e.options.forceShell||n){let n=l.test(t);e.command=r.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,n)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function f(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:d(r)}n.exports=f})),Hn=r(((e,t)=>{var n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}})),Un=r(((t,n)=>{var r=e(`child_process`),i=Vn(),a=Hn();function o(e,t,n){let o=i(e,t,n),s=r.spawn(o.command,o.args,o.options);return a.hookChildProcess(s,o),s}function s(e,t,n){let o=i(e,t,n),s=r.spawnSync(o.command,o.args,o.options);return s.error=s.error||a.verifyENOENTSync(s.status,o),s}n.exports=o,n.exports.spawn=o,n.exports.sync=s,n.exports._parse=i,n.exports._enoent=a}));function Wn(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}var Gn=t((()=>{})),Kn=t((()=>{}));function qn(e){return e instanceof URL?Ae(e):e}function Jn(e){return{*[Symbol.iterator](){let t=C.resolve(qn(e)),n;for(;n!==t;)yield t,n=t,t=C.resolve(t,`..`)}}}var Yn=t((()=>{Kn(),ne(le)})),Xn,Zn,Qn,$n,er=t((()=>{Gn(),Yn(),Xn=({cwd:e=S.cwd(),path:t=S.env[Wn()],preferLocal:n=!0,execPath:r=S.execPath,addExecPath:i=!0}={})=>{let a=C.resolve(qn(e)),o=[],s=t.split(C.delimiter);return n&&Zn(o,s,a),i&&Qn(o,s,r,a),t===``||t===C.delimiter?`${o.join(C.delimiter)}${t}`:[...o,t].join(C.delimiter)},Zn=(e,t,n)=>{for(let r of Jn(n)){let n=C.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},Qn=(e,t,n,r)=>{let i=C.resolve(r,qn(n),`..`);t.includes(i)||e.push(i)},$n=({env:e=S.env,...t}={})=>{e={...e};let n=Wn({env:e});return t.path=e[n],e[n]=Xn(t),e}})),tr,nr,rr,ir,ar,or,sr,cr,L=t((()=>{tr=(e,t,n)=>new(n?cr:sr)(t,e instanceof nr?{}:{cause:e}),nr=class extends Error{},rr=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,ar,{value:!0,writable:!1,enumerable:!1,configurable:!1})},ir=e=>or(e)&&ar in e,ar=Symbol(`isExecaError`),or=e=>Object.prototype.toString.call(e)===`[object Error]`,sr=class extends Error{},rr(sr,sr.name),cr=class extends Error{},rr(cr,cr.name)})),lr,ur,dr,fr=t((()=>{lr=()=>{let e=64-dr+1;return Array.from({length:e},ur)},ur=(e,t)=>({name:`SIGRT${t+1}`,number:dr+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),dr=34})),pr,mr=t((()=>{pr=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}]})),hr,gr,_r=t((()=>{mr(),fr(),hr=()=>{let e=lr();return[...pr,...e].map(gr)},gr=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=ve,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}}})),vr,yr,br,xr,Sr,Cr,wr=t((()=>{fr(),_r(),vr=()=>{let e=hr();return Object.fromEntries(e.map(yr))},yr=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],br=vr(),xr=()=>{let e=hr(),t=Array.from({length:65},(t,n)=>Sr(n,e));return Object.assign({},...t)},Sr=(e,t)=>{let n=Cr(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},Cr=(e,t)=>{let n=t.find(({name:t})=>ve.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n},xr()})),Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir=t((()=>{wr(),Tr=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Dr(e,t)},Er=e=>e===0?e:Dr(e,"`subprocess.kill()`'s argument"),Dr=(e,t)=>{if(Number.isInteger(e))return Or(e,t);if(typeof e==`string`)return jr(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Mr()}`)},Or=(e,t)=>{if(Ar.has(e))return Ar.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Mr()}`)},kr=()=>new Map(Object.entries(ve.signals).reverse().map(([e,t])=>[t,e])),Ar=kr(),jr=(e,t)=>{if(e in ve.signals)return e;throw e.toUpperCase()in ve.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Mr()}`)},Mr=()=>`Available signal names: ${Nr()}.
|
|
10
|
+
Available signal numbers: ${Pr()}.`,Nr=()=>Object.keys(ve.signals).sort().map(e=>`'${e}'`).join(`, `),Pr=()=>[...new Set(Object.values(ve.signals).sort((e,t)=>e-t))].join(`, `),Fr=e=>br[e].description})),Lr,Rr,zr,Br,Vr,Hr,Ur,Wr=t((()=>{L(),Ir(),Lr=e=>{if(e===!1)return e;if(e===!0)return Rr;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Rr=1e3*5,zr=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Br(o,s,n);Vr(l,r);let u=e(c);return Hr({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Br=(e,t,n)=>{let[r=n,i]=or(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!or(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Er(r),error:i}},Vr=(e,t)=>{e!==void 0&&t.reject(e)},Hr=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&Ur({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},Ur=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await Pe(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??(n.isForcefullyTerminated=!0))}catch{}}})),Gr,Kr=t((()=>{Gr=async(e,t)=>{e.aborted||await w(e,`abort`,{signal:t})}})),qr,Jr,Yr,Xr=t((()=>{Kr(),qr=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Jr=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Yr(e,t,r,i)],Yr=async(e,t,n,{signal:r})=>{throw await Gr(t,r),n.terminationReason??(n.terminationReason=`cancel`),e.kill(),t.reason}})),Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,R,fi,z,pi,mi=t((()=>{Zr=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{Qr(e,t,n),$r(e,t,r)},Qr=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},$r=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} cannot be used: the ${z(t)} has already exited or disconnected.`)},ei=e=>{throw Error(`${R(`getOneMessage`,e)} could not complete: the ${z(e)} exited or disconnected.`)},ti=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is sending a message too, instead of listening to incoming messages.
|
|
11
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
12
|
+
|
|
13
|
+
const [receivedMessage] = await Promise.all([
|
|
14
|
+
${R(`getOneMessage`,e)},
|
|
15
|
+
${R(`sendMessage`,e,`message, {strict: true}`)},
|
|
16
|
+
]);`)},ni=(e,t)=>Error(`${R(`sendMessage`,t)} failed when sending an acknowledgment response to the ${z(t)}.`,{cause:e}),ri=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is not listening to incoming messages.`)},ii=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} exited without listening to incoming messages.`)},ai=()=>Error(`\`cancelSignal\` aborted: the ${z(!0)} disconnected.`),oi=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},si=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${R(t,n)} cannot be used: the ${z(n)} is disconnecting.`,{cause:e})},ci=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(li(e))throw Error(`${R(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},li=({code:e,message:t})=>ui.has(e)||di.some(e=>t.includes(e)),ui=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),di=[`could not be cloned`,`circular structure`,`call stack size exceeded`],R=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${fi(t)}${e}(${n})`,fi=e=>e?``:`subprocess.`,z=e=>e?`parent process`:`subprocess`,pi=e=>{e.connected&&e.disconnect()}})),hi,gi=t((()=>{hi=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)}})),_i,vi,B,yi,bi,xi,Si,Ci,wi,Ti,Ei,V=t((()=>{P(),_i=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=B.get(e),i=yi(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(Si(i,t,n,!0));return a},vi=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=B.get(e),i=yi(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(Si(i,t,n,!1));return a},B=new WeakMap,yi=(e,t,n)=>{let r=bi(t,n);return xi(r,t,n,e),r},bi=(e,t)=>{let n=St(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${Ti(t)}" must not be "${e}".
|
|
17
|
+
It must be ${r} or "fd3", "fd4" (and so on).
|
|
18
|
+
It is optional and defaults to "${i}".`)},xi=(e,t,n,r)=>{let i=r[wi(e)];if(i===void 0)throw TypeError(`"${Ti(n)}" must not be ${t}. That file descriptor does not exist.
|
|
19
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${Ti(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${Ti(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Si=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=Ci(e,n);return`The "${i}: ${Ei(a)}" option is incompatible with using "${Ti(r)}: ${Ei(t)}".
|
|
20
|
+
Please set this option with "pipe" instead.`},Ci=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=wi(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},wi=e=>e===`all`?1:e,Ti=e=>e?`to`:`from`,Ei=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`})),Di,Oi=t((()=>{Di=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),xe(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))}})),ki,Ai,ji,Mi,Ni,Pi,Fi=t((()=>{ki=(e,t)=>{t&&Ai(e)},Ai=e=>{e.refCounted()},ji=(e,t)=>{t&&Mi(e)},Mi=e=>{e.unrefCounted()},Ni=(e,t)=>{t&&(Mi(e),Mi(e))},Pi=(e,t)=>{t&&(Ai(e),Ai(e))}})),Ii,Li,Ri,zi=t((()=>{ca(),Fi(),ta(),Ca(),Ii=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Yi(i)||ya(i))return;Ri.has(e)||Ri.set(e,[]);let a=Ri.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await ia(e,r,i),await Me.yield();let o=await Ji({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Li=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{xa();let a=Ri.get(e);for(;a?.length>0;)await w(r,`message:done`);e.removeListener(`message`,i),Pi(t,n),r.connected=!1,r.emit(`disconnect`)},Ri=new WeakMap})),Bi,Vi,Hi,Ui,Wi=t((()=>{zi(),Fi(),Bi=(e,t,n)=>{if(Vi.has(e))return Vi.get(e);let r=new be;return r.connected=!0,Vi.set(e,r),Hi({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Vi=new WeakMap,Hi=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Ii.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Li.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Ni(n,r)},Ui=e=>{let t=Vi.get(e);return t===void 0?e.channel!==null:t.connected}})),Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta=t((()=>{gi(),Oi(),ma(),mi(),Wi(),ca(),Gi=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=oa(e,Bi(e,t,n));return{id:Ki++,type:$i,message:r,hasListeners:a}},Ki=0n,qi=(e,t)=>{if(!(t?.type!==$i||t.hasListeners))for(let{id:t}of e)t!==void 0&&Zi[t].resolve({isDeadlock:!0,hasListeners:!1})},Ji=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==$i||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:ea,message:oa(t,i)};try{await la({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Yi=e=>{if(e?.type!==ea)return!1;let{id:t,message:n}=e;return Zi[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Xi=async(e,t,n)=>{if(e?.type!==$i)return;let r=hi();Zi[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Qi(t,n,i)]);e&&ti(n),a||ri(n)}finally{i.abort(),delete Zi[e.id]}},Zi={},Qi=async(e,t,{signal:n})=>{Di(e,1,n),await w(e,`disconnect`,{signal:n}),ii(t)},$i=`execa:ipc:request`,ea=`execa:ipc:response`})),na,ra,ia,aa,oa,sa,ca=t((()=>{gi(),P(),V(),ta(),na=(e,t,n)=>{aa.has(e)||aa.set(e,new Set);let r=aa.get(e),i={onMessageSent:hi(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},ra=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},ia=async(e,t,n)=>{for(;!oa(e,t)&&aa.get(e)?.size>0;){let t=[...aa.get(e)];qi(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},aa=new WeakMap,oa=(e,t)=>t.listenerCount(`message`)>sa(e),sa=e=>B.has(e)&&!Dt(B.get(e).options.buffer,`ipc`)?1:0})),la,ua,da,fa,pa,ma=t((()=>{mi(),ca(),ta(),la=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return Zr({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),ua({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},ua=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Gi({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=na(e,o,a);try{await da({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw pi(e),t}finally{ra(s)}},da=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=fa(e);try{await Promise.all([Xi(r,e,n),a(r)])}catch(e){throw si({error:e,methodName:t,isSubprocess:n}),ci({error:e,methodName:t,isSubprocess:n,message:i}),e}},fa=e=>{if(pa.has(e))return pa.get(e);let t=ne(e.send.bind(e));return pa.set(e,t),t},pa=new WeakMap})),ha,ga,_a,va,ya,ba,xa,Sa,Ca=t((()=>{ma(),Wi(),mi(),ha=(e,t)=>{let n=`cancelSignal`;return $r(n,!1,e.connected),da({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:ba,message:t},message:t})},ga=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await _a({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),Sa.signal),_a=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!va){if(va=!0,!r){oi();return}if(t===null){xa();return}Bi(e,t,n),await Me.yield()}},va=!1,ya=e=>e?.type===ba?(Sa.abort(e.message),!0):!1,ba=`execa:ipc:cancel`,xa=()=>{Sa.abort(ai())},Sa=new AbortController})),wa,Ta,Ea,Da,Oa=t((()=>{Kr(),Ca(),Wr(),wa=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Ta=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[Ea({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],Ea=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await Gr(t,i),await ha(e,Da(t)),Ur({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??(r.terminationReason=`gracefulCancel`),t.reason},Da=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t}})),ka,Aa,ja,Ma=t((()=>{L(),ka=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Aa=(e,t,n,r)=>t===0||t===void 0?[]:[ja(e,t,n,r)],ja=async(e,t,n,{signal:r})=>{throw await Pe(t,void 0,{signal:r}),n.terminationReason??(n.terminationReason=`timeout`),e.kill(),new nr}})),Na,Pa,Fa=t((()=>{Be(),Na=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Pa=(e,t,{node:n=!1,nodePath:r=ae,nodeOptions:i=ie.filter(e=>!e.startsWith(`--inspect`)),cwd:a,execPath:o,...s})=>{if(o!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let c=Ie(r,`The "nodePath" option`),l=C.resolve(a,c),u={...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(C.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[l,[...i,e,...t],{ipc:!0,...u,shell:!1}]}})),Ia,La,Ra,za,Ba,Va=t((()=>{Ia=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");za[n](e)}},La=e=>{try{Fe(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Ra=e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},za={advanced:La,json:Ra},Ba=async(e,t)=>{t!==void 0&&await e.sendMessage(t)}})),Ha,Ua,H,Wa,Ga,Ka,qa,Ja=t((()=>{Ha=({encoding:e})=>{if(Wa.has(e))return;let t=Ga(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${qa(e)}\`.
|
|
21
|
+
Please rename it to ${qa(t)}.`);let n=[...Wa].map(e=>qa(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${qa(e)}\`.
|
|
22
|
+
Please rename it to one of: ${n}.`)},Ua=new Set([`utf8`,`utf16le`]),H=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Wa=new Set([...Ua,...H]),Ga=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Ka)return Ka[t];if(Wa.has(t))return t},Ka={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},qa=e=>typeof e==`string`?`"${e}"`:String(e)})),Ya,Xa,Za,Qa=t((()=>{Be(),Ya=(e=Xa())=>{let t=Ie(e,`The "cwd" option`);return C.resolve(t)},Xa=()=>{try{return S.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Za=(e,t)=>{if(t===Xa())return e;let n;try{n=ge(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`}})),$a,eo,to,no,ro=t((()=>{$a=n(Un(),1),er(),Wr(),Ir(),Xr(),Oa(),Ma(),Fa(),Va(),Ja(),Qa(),Be(),P(),eo=(e,t,n)=>{n.cwd=Ya(n.cwd);let[r,i,a]=Pa(e,t,n),{command:o,args:s,options:c}=$a.default._parse(r,i,a),l=mt(c),u=to(l);return ka(u),Ha(u),Ia(u),qr(u),wa(u),u.shell=ze(u.shell),u.env=no(u),u.killSignal=Tr(u.killSignal),u.forceKillAfterDelay=Lr(u.forceKillAfterDelay),u.lines=u.lines.map((e,t)=>e&&!H.has(u.encoding)&&u.buffer[t]),S.platform===`win32`&&C.basename(o,`.exe`)===`cmd`&&s.unshift(`/q`),{file:o,commandArguments:s,options:u}},to=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,all:s=!1,windowsHide:c=!0,killSignal:l=`SIGTERM`,forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m=`advanced`,...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,all:s,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),no=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{...S.env,...e}:e;return n||r?$n({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o}})),io,ao=t((()=>{io=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n]}));function oo(e){if(typeof e==`string`)return so(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return co(e)}var so,co,lo,uo,fo,po,mo=t((()=>{so=e=>e.at(-1)===lo?e.slice(0,e.at(-2)===fo?-2:-1):e,co=e=>e.at(-1)===uo?e.subarray(0,e.at(-2)===po?-2:-1):e,lo=`
|
|
23
|
+
`,uo=lo.codePointAt(0),fo=`\r`,po=fo.codePointAt(0)}));function U(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function ho(e,{checkOpen:t=!0}={}){return U(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==`function`&&typeof e.end==`function`&&typeof e.writable==`boolean`&&typeof e.writableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function go(e,{checkOpen:t=!0}={}){return U(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==`function`&&typeof e.readable==`boolean`&&typeof e.readableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function _o(e,t){return ho(e,t)&&go(e,t)}var vo=t((()=>{}));async function yo(){if(d(G,this))return{done:!0,value:void 0};let e;try{e=await d(W,this).read()}catch(e){throw p(K,this,void 0),p(G,this,!0),d(W,this).releaseLock(),e}return e.done&&(p(K,this,void 0),p(G,this,!0),d(W,this).releaseLock()),e}async function bo(e){if(d(G,this))return{done:!0,value:e};if(p(G,this,!0),!d(To,this)){let t=d(W,this).cancel(e);return d(W,this).releaseLock(),await t,{done:!0,value:e}}return d(W,this).releaseLock(),{done:!0,value:e}}function xo(){return this[Oo].next()}function So(e){return this[Oo].return(e)}function Co({preventCancel:e=!1}={}){let t=this.getReader(),n=new Do(t,e),r=Object.create(ko);return r[Oo]=n,r}var wo,W,To,G,K,Eo,Do,Oo,ko,Ao=t((()=>{m(),s(),l(),u(),c(),wo=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),W=new WeakMap,To=new WeakMap,G=new WeakMap,K=new WeakMap,Eo=new WeakSet,Do=class{constructor(e,t){h(this,Eo),f(this,W,void 0),f(this,To,void 0),f(this,G,!1),f(this,K,void 0),p(W,this,e),p(To,this,t)}next(){let e=()=>o(Eo,this,yo).call(this);return p(K,this,d(K,this)?d(K,this).then(e,e):e()),d(K,this)}return(e){let t=()=>o(Eo,this,bo).call(this,e);return d(K,this)?d(K,this).then(t,t):t()}},Oo=Symbol(),Object.defineProperty(xo,"name",{value:`next`}),Object.defineProperty(So,"name",{value:`return`}),ko=Object.create(wo,{next:{enumerable:!0,configurable:!0,writable:!0,value:xo},return:{enumerable:!0,configurable:!0,writable:!0,value:So}})})),jo=t((()=>{Ao()})),Mo,No,Po,Fo,Io,Lo=t((()=>{vo(),jo(),Mo=e=>{if(go(e,{checkOpen:!1})&&Io.on!==void 0)return Po(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(No.call(e)===`[object ReadableStream]`)return Co.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:No}=Object.prototype,Po=async function*(e){let t=new AbortController,n={};Fo(e,t,n);try{for await(let[n]of Io.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},Fo=async(e,t,n)=>{try{await Io.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},Io={}})),Ro,zo,Bo,Vo,Ho,Uo,Wo,Go=t((()=>{Lo(),i(),Ro=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Mo(e),u=t();u.length=0;try{for await(let e of l){let t=n[Ho(e)](e,u);Bo({convertedChunk:t,state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return zo({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},zo=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&Bo({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},Bo=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Vo(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Vo(c,t,i,a),new Wo},Vo=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},Ho=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=Uo.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Uo.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Uo}=Object.prototype,Wo=class extends Error{constructor(){super(`maxBuffer exceeded`),a(this,`name`,`MaxBufferError`)}}})),q,Ko,qo,Jo,Yo,Xo=t((()=>{q=e=>e,Ko=()=>void 0,qo=({contents:e})=>e,Jo=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Yo=e=>e.length}));async function Zo(e,t){return Ro(e,ts,t)}var Qo,$o,es,ts,ns=t((()=>{Go(),Xo(),Qo=()=>({contents:[]}),$o=()=>1,es=(e,{contents:t})=>(t.push(e),t),ts={init:Qo,convertChunk:{string:q,buffer:q,arrayBuffer:q,dataView:q,typedArray:q,others:q},getSize:$o,truncateChunk:Ko,addChunk:es,getFinalChunk:Ko,finalize:qo}}));async function rs(e,t){return Ro(e,_s,t)}var is,as,os,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs=t((()=>{Go(),Xo(),is=()=>({contents:new ArrayBuffer(0)}),as=e=>os.encode(e),os=new TextEncoder,ss=e=>new Uint8Array(e),cs=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ls=(e,t)=>e.slice(0,t),us=(e,{contents:t,length:n},r)=>{let i=gs()?fs(t,r):ds(t,r);return new Uint8Array(i).set(e,n),i},ds=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(ps(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},fs=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:ps(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},ps=e=>ms**Math.ceil(Math.log(e)/Math.log(ms)),ms=2,hs=({contents:e,length:t})=>gs()?e:e.slice(0,t),gs=()=>`resize`in ArrayBuffer.prototype,_s={init:is,convertChunk:{string:as,buffer:ss,arrayBuffer:ss,dataView:cs,typedArray:cs,others:Jo},getSize:Yo,truncateChunk:ls,addChunk:us,getFinalChunk:Ko,finalize:hs}}));async function ys(e,t){return Ro(e,Ts,t)}var bs,xs,Ss,Cs,ws,Ts,Es=t((()=>{Go(),Xo(),bs=()=>({contents:``,textDecoder:new TextDecoder}),xs=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Ss=(e,{contents:t})=>t+e,Cs=(e,t)=>e.slice(0,t),ws=({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},Ts={init:bs,convertChunk:{string:q,buffer:xs,arrayBuffer:xs,dataView:xs,typedArray:xs,others:Jo},getSize:Yo,truncateChunk:Cs,addChunk:Ss,getFinalChunk:ws,finalize:qo}})),Ds=t((()=>{ns(),vs(),Es(),Go()})),Os=t((()=>{Ds()})),ks,As,js,Ms,Ns,Ps,Fs,Is,Ls=t((()=>{Os(),N(),P(),ks=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof Wo))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:As(n,r,i)},t.destroy(),e},As=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,js=(e,t,n)=>{if(t.length!==n)return;let r=new Wo;throw r.maxBufferInfo={fdNumber:`ipc`},r},Ms=(e,t)=>{let{streamName:n,threshold:r,unit:i}=Ns(e,t);return`Command's ${n} was larger than ${r} ${i}`},Ns=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=Dt(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:pt(n),threshold:i,unit:r}},Ps=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>Is(n)),Fs=(e,t,n)=>{if(!t)return e;let r=Is(n);return e.length>r?e.slice(0,r):e},Is=([,e])=>e})),Rs,zs,Bs,Vs,Hs,Us,Ws,Gs=t((()=>{mo(),A(),Qa(),Gt(),Ls(),Ir(),L(),Rs=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:a,exitCode:o,escapedCommand:s,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:_})=>{let v=r?.code,y=zs({originalError:r,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:v,signal:i,signalDescription:a,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),b=Vs(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>Hs(e)).join(`
|
|
24
|
+
`)].map(e=>It(oo(Us(e)))).filter(Boolean).join(`
|
|
25
|
+
|
|
26
|
+
`)}},zs=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:a,signal:o,signalDescription:s,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=Bs(d,f);return t?`Command timed out after ${n} milliseconds${m}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${s})`:l?`Command was canceled${m}`:r?`${Ms(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${Fr(p)})${m}`:o===void 0?c===void 0?`Command failed`:`Command failed with exit code ${c}`:`Command was killed with ${o} (${s})`:`Command failed with ${a}${m}`},Bs=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,Vs=(e,t)=>{if(e instanceof nr)return;let n=It(Za(ir(e)?e.originalMessage:String(e?.message??e),t));return n===``?void 0:n},Hs=e=>typeof e==`string`?e:te(e),Us=e=>Array.isArray(e)?e.map(e=>oo(Ws(e))).filter(Boolean).join(`
|
|
27
|
+
`):Ws(e),Ws=e=>typeof e==`string`?e:k(e)?Ye(e):``})),Ks,qs,Js,Ys,Xs,Zs,Qs=t((()=>{Ir(),On(),L(),Gs(),Ks=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>Xs({command:e,escapedCommand:t,cwd:a,durationMs:Dn(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),qs=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>Js({error:e,command:t,escapedCommand:n,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),Js=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:_,cwd:v,maxBuffer:y},isSync:b})=>{let{exitCode:x,signal:ee,signalDescription:te}=Zs(l,u),{originalMessage:ne,shortMessage:re,message:S}=Rs({stdio:d,all:f,ipcOutput:p,originalError:e,signal:ee,signalDescription:te,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),ie=tr(e,S,b);return Object.assign(ie,Ys({error:ie,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:ee,signalDescription:te,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:ne,shortMessage:re})),ie},Ys=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:_})=>Xs({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:Dn(r),failed:!0,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),Xs=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Zs=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:Fr(t)}}}));function $s(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(nc(e*1e3)%1e3),nanoseconds:Math.trunc(nc(e*1e6)%1e3)}}function ec(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function tc(e){switch(typeof e){case`number`:if(Number.isFinite(e))return $s(e);break;case`bigint`:return ec(e)}throw TypeError(`Expected a finite number or bigint`)}var nc,rc=t((()=>{nc=e=>Number.isFinite(e)?e:0}));function ic(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+sc);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&ac(e)&&!(t.colonNotation&&r===`m`))){if(a??(a=String(e)),t.colonNotation){let e=a.includes(`.`)?a.split(`.`)[0].length:a.length,t=i.length>0?2:1;a=`0`.repeat(Math.max(0,t-e))+a}else a+=t.verbose?` `+oc(n,e):r;i.push(a)}},s=tc(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%cc):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}var ac,oc,sc,cc,lc=t((()=>{rc(),ac=e=>e===0||e===0n,oc=(e,t)=>t===1||t===1n?e:`${e}s`,sc=1e-7,cc=24n*60n*60n*1000n})),uc,dc=t((()=>{vn(),uc=(e,t)=>{e.failed&&fn({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})}})),fc,pc,mc=t((()=>{lc(),F(),vn(),dc(),fc=(e,t)=>{Ot(t)&&(uc(e,t),pc(e,t))},pc=(e,t)=>{fn({type:`duration`,verboseMessage:`(done in ${ic(e.durationMs)})`,verboseInfo:t,result:e})}})),hc,gc=t((()=>{mc(),hc=(e,t,{reject:n})=>{if(fc(e,t),e.failed&&n)throw e;return e}})),_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,J,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Y,Hc,Uc,Wc,Gc,Kc,X=t((()=>{vo(),O(),A(),_c=(e,t)=>J(e)?`asyncGenerator`:Ec(e)?`generator`:Oc(e)?`fileUrl`:Ac(e)?`filePath`:Lc(e)?`webStream`:U(e,{checkOpen:!1})?`native`:k(e)?`uint8Array`:zc(e)?`asyncIterable`:Bc(e)?`iterable`:Rc(e)?bc({transform:e},t):Dc(e)?vc(e,t):`native`,vc=(e,t)=>_o(e.transform,{checkOpen:!1})?yc(e,t):Rc(e.transform)?bc(e,t):Cc(e,t),yc=(e,t)=>(xc(e,t,`Duplex stream`),`duplex`),bc=(e,t)=>(xc(e,t,`web TransformStream`),`webTransform`),xc=({final:e,binary:t,objectMode:n},r,i)=>{Sc(e,`${r}.final`,i),Sc(t,`${r}.binary`,i),wc(n,`${r}.objectMode`)},Sc=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Cc=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Tc(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(_o(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Rc(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Tc(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return wc(n,`${i}.binary`),wc(r,`${i}.objectMode`),J(e)||J(t)?`asyncGenerator`:`generator`},wc=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},Tc=e=>J(e)||Ec(e),J=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Ec=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Dc=e=>D(e)&&(e.transform!==void 0||e.final!==void 0),Oc=e=>Object.prototype.toString.call(e)===`[object URL]`,kc=e=>Oc(e)&&e.protocol!==`file:`,Ac=e=>D(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>jc.has(e))&&Mc(e.file),jc=new Set([`file`,`append`]),Mc=e=>typeof e==`string`,Nc=(e,t)=>e===`native`&&typeof t==`string`&&!Pc.has(t),Pc=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),Fc=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,Ic=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,Lc=e=>Fc(e)||Ic(e),Rc=e=>Fc(e?.readable)&&Ic(e?.writable),zc=e=>Vc(e)&&typeof e[Symbol.asyncIterator]==`function`,Bc=e=>Vc(e)&&typeof e[Symbol.iterator]==`function`,Vc=e=>typeof e==`object`&&!!e,Y=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),Hc=new Set([`fileUrl`,`filePath`,`fileNumber`]),Uc=new Set([`fileUrl`,`filePath`]),Wc=new Set([...Uc,`webStream`,`nodeStream`]),Gc=new Set([`webTransform`,`duplex`]),Kc={generator:`a generator`,asyncGenerator:`an async generator`,fileUrl:`a file URL`,filePath:`a file path string`,fileNumber:`a file descriptor number`,webStream:`a web stream`,nodeStream:`a Node.js stream`,webTransform:`a web TransformStream`,duplex:`a Duplex stream`,native:`any value`,iterable:`an iterable`,asyncIterable:`an async iterable`,string:`a string`,uint8Array:`a Uint8Array`}})),qc,Jc,Yc,Xc,Zc=t((()=>{X(),qc=(e,t,n,r)=>r===`output`?Jc(e,t,n):Yc(e,t,n),Jc=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},Yc=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},Xc=(e,t)=>{let n=e.findLast(({type:e})=>Y.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode}})),Qc,$c,el,tl,nl,rl,il,al=t((()=>{O(),Ja(),X(),Zc(),Qc=(e,t,n,r)=>[...e.filter(({type:e})=>!Y.has(e)),...$c(e,t,n,r)],$c=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>Y.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=el({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return il(a,n)},el=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?tl({stdioItem:e,optionName:i}):t===`webTransform`?nl({stdioItem:e,index:n,newTransforms:r,direction:a}):rl({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),tl=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:a})=>{if(i&&!r)throw TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},nl=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=D(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=qc(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},rl=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=D(t)?t:{transform:t},d=c||H.has(a),{writableObjectMode:f,readableObjectMode:p}=qc(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},il=(e,t)=>t===`input`?e.reverse():e})),ol,sl,cl,Z,ll,ul,dl,fl,pl=t((()=>{vo(),X(),ol=(e,t,n)=>{let r=e.map(e=>sl(e,t));if(r.includes(`input`)&&r.includes(`output`))throw TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??fl},sl=({type:e,value:t},n)=>cl[n]??ul[e](t),cl=[`input`,`output`,`output`],Z=()=>void 0,ll=()=>`input`,ul={generator:Z,asyncGenerator:Z,fileUrl:Z,filePath:Z,iterable:ll,asyncIterable:ll,uint8Array:ll,webStream:e=>Ic(e)?`output`:`input`,nodeStream(e){return go(e,{checkOpen:!1})?ho(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:Z,duplex:Z,native(e){let t=dl(e);if(t!==void 0)return t;if(U(e,{checkOpen:!1}))return ul.nodeStream(e)}},dl=e=>{if([0,S.stdin].includes(e))return`input`;if([1,2,S.stdout,S.stderr].includes(e))return`output`},fl=`output`})),ml,hl=t((()=>{ml=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e})),gl,_l,vl,yl,bl,xl,Sl=t((()=>{N(),hl(),F(),gl=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=_l(e,r).map((e,t)=>yl(e,t));return a?bl(o,n,i):ml(o,t)},_l=(e,t)=>{if(e===void 0)return M.map(e=>t[e]);if(vl(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${M.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,M.length);return Array.from({length:n},(t,n)=>e[n])},vl=e=>M.some(t=>e[t]!==void 0),yl=(e,t)=>Array.isArray(e)?e.map(e=>yl(e,t)):e??(t>=M.length?`ignore`:`pipe`),bl=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!kt(n,r)&&xl(e)?`ignore`:e),xl=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`)})),Cl,wl,Tl,El,Dl,Ol,kl=t((()=>{vo(),N(),A(),V(),Cl=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?wl({stdioItem:e,fdNumber:r,direction:i}):Dl({stdioItem:e,fdNumber:r}),wl=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=Tl({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(U(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},Tl=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=El(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(ye.isatty(i))throw TypeError(`The \`${t}: ${Ei(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:Ge(he(i)),optionName:t}}},El=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=ft.indexOf(e);if(n!==-1)return n},Dl=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Ol(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Ol(t,t,n),optionName:n}:U(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Ol=(e,t,n)=>{let r=ft[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r}})),Al,jl,Ml,Nl,Pl,Fl=t((()=>{vo(),A(),X(),Al=({input:e,inputFile:t},n)=>n===0?[...jl(e),...Nl(t)]:[],jl=e=>e===void 0?[]:[{type:Ml(e),value:e,optionName:`input`}],Ml=e=>{if(go(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(k(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Nl=e=>e===void 0?[]:[{...Pl(e),optionName:`inputFile`}],Pl=e=>{if(Oc(e))return{type:`fileUrl`,value:e};if(Mc(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")}})),Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl=t((()=>{X(),Il=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),Ll=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=Rl(i,e);if(o.length!==0){if(a){zl({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(Wc.has(e))return Bl({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});Gc.has(e)&&Hl({otherStdioItems:o,type:e,value:t,optionName:n})}},Rl=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),zl=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Uc.has(t)&&Bl({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},Bl=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>Vl(e,n));if(a.length===0)return;let o=a.find(e=>e.direction!==i);return Ul(o,r,t),i===`output`?a[0].stream:void 0},Vl=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,Hl=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let i=e.find(({value:{transform:e}})=>e===n.transform);Ul(i,r,t)},Ul=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Kc[n]} that is the same.`)}})),Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au=t((()=>{N(),al(),Zc(),X(),pl(),Sl(),kl(),Fl(),Wl(),Gl=(e,t,n,r)=>{let i=gl(t,n,r).map((e,n)=>Kl({stdioOption:e,fdNumber:n,options:t,isSync:r})),a=eu({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:e})=>iu(e)),a},Kl=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=pt(t),{stdioItems:a,isStdioArray:o}=ql({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=ol(a,t,i),c=Qc(a.map(e=>Cl({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=Xc(c,s);return $l(c,l),{direction:s,objectMode:l,stdioItems:c}},ql=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=Il([...(Array.isArray(e)?e:[e]).map(e=>Jl(e,r)),...Al(n,t)]),a=i.length>1;return Yl(i,a,r),Zl(i),{stdioItems:i,isStdioArray:a}},Jl=(e,t)=>({type:_c(e,t),value:e,optionName:t}),Yl=(e,t,n)=>{if(e.length===0)throw TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:n}of e)if(Xl.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},Xl=new Set([`ignore`,`ipc`]),Zl=e=>{for(let t of e)Ql(t)},Ql=({type:e,value:t,optionName:n})=>{if(kc(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
28
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Nc(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},$l=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>Hc.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},eu=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(tu({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw ru(i),e}},tu=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>nu({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),nu=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=Ll({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},ru=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!j(e)&&e.destroy()},iu=e=>{if(e.length>1)return e.some(({value:e})=>e===`overlapped`)?`overlapped`:`pipe`;let[{type:t,value:n}]=e;return t===`native`?n:`pipe`}})),ou,Q,su,cu,lu,uu,du=t((()=>{A(),au(),X(),ou=(e,t)=>Gl(uu,e,t,!0),Q=({type:e,optionName:t})=>{cu(t,Kc[e])},su=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&cu(e,`"${t}"`),{}),cu=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},lu={generator(){},asyncGenerator:Q,webStream:Q,nodeStream:Q,webTransform:Q,duplex:Q,asyncIterable:Q,native:su},uu={input:{...lu,fileUrl:({value:e})=>({contents:[Ge(he(e))]}),filePath:({value:{file:e}})=>({contents:[Ge(he(e))]}),fileNumber:Q,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...lu,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:Q,string:Q,uint8Array:Q}}})),fu,pu,mu=t((()=>{mo(),fu=(e,{stripFinalNewline:t},n)=>pu(t,n)&&e!==void 0&&!Array.isArray(e)?oo(e):e,pu=(e,t)=>t===`all`?e[1]||e[2]:e[t]})),hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou=t((()=>{hu=(e,t,n,r)=>e||n?void 0:vu(t,r),gu=(e,t,n)=>n?e.flatMap(e=>_u(e,t)):_u(e,t),_u=(e,t)=>{let{transform:n,final:r}=vu(t,{});return[...n(e),...r()]},vu=(e,t)=>(t.previousChunks=``,{transform:yu.bind(void 0,t,e),final:xu.bind(void 0,t)}),yu=function*(e,t,n){if(typeof n!=`string`){yield n;return}let{previousChunks:r}=e,i=-1;for(let a=0;a<n.length;a+=1)if(n[a]===`
|
|
29
|
+
`){let o=bu(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=wu(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=wu(r,n.slice(i+1))),e.previousChunks=r},bu=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),xu=function*({previousChunks:e}){e.length>0&&(yield e)},Su=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Cu.bind(void 0,r)},Cu=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?Tu:Du;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},wu=(e,t)=>`${e}${t}`,Tu={windowsNewline:`\r
|
|
30
|
+
`,unixNewline:`
|
|
31
|
+
`,LF:`
|
|
32
|
+
`,concatBytes:wu},Eu=(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},Du={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Eu}})),ku,Au,ju,Mu,Nu,Pu,Fu=t((()=>{A(),ku=(e,t)=>e?void 0:Au.bind(void 0,t),Au=function*(e,t){if(typeof t!=`string`&&!k(t)&&!ke.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},ju=(e,t)=>e?Mu.bind(void 0,t):Nu.bind(void 0,t),Mu=function*(e,t){Pu(e,t),yield t},Nu=function*(e,t){if(Pu(e,t),typeof t!=`string`&&!k(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Pu=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
33
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
34
|
+
if (condition) { yield value; }`)}})),Iu,Lu,Ru,zu,Bu=t((()=>{A(),Iu=(e,t,n)=>{if(n)return;if(e)return{transform:Lu.bind(void 0,new TextEncoder)};let r=new je(t);return{transform:Ru.bind(void 0,r),final:zu.bind(void 0,r)}},Lu=function*(e,t){ke.isBuffer(t)?yield Ge(t):typeof t==`string`?yield e.encode(t):yield t},Ru=function*(e,t){yield k(t)?e.write(t):t},zu=function*(e){let t=e.end();t!==``&&(yield t)}})),Vu,Hu,Uu,Wu,Gu,Ku,qu=t((()=>{Vu=x(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Hu=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Ku}=t[n];for await(let i of r(e))yield*Hu(i,t,n+1)},Uu=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Wu(n,Number(t),e)},Wu=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Hu(r,n,t+1)},Gu=x(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Ku=function*(e){yield e}})),Ju,Yu,Xu,Zu,Qu,$u,ed=t((()=>{Ju=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},Yu=(e,t)=>[...t.flatMap(t=>[...Xu(t,e,0)]),...Zu(e)],Xu=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=$u}=t[n];for(let i of r(e))yield*Xu(i,t,n+1)},Zu=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Qu(n,Number(t),e)},Qu=function*(e,t,n){if(e!==void 0)for(let r of e())yield*Xu(r,n,t+1)},$u=function*(e){yield e}})),td,nd,rd,id=t((()=>{X(),Ou(),Fu(),Bu(),qu(),ed(),td=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=rd(e,o,a),l=J(t),u=J(n),d=l?Vu.bind(void 0,Hu,s):Ju.bind(void 0,Xu),f=l||u?Vu.bind(void 0,Uu,s):Ju.bind(void 0,Zu),p=l||u?Gu.bind(void 0,s):void 0;return{stream:new Ee({writableObjectMode:r,writableHighWaterMark:Oe(r),readableObjectMode:i,readableHighWaterMark:Oe(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},nd=(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=Yu(rd(t,n,r),e);return e},rd=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:ku(r,s)},Iu(n,o,r),hu(n,a,r,c),{transform:e,final:t},{transform:ju(i,s)},Su({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)}})),ad,od,sd,cd,ld,ud=t((()=>{id(),A(),X(),ad=(e,t)=>{for(let n of od(e))sd(e,n,t)},od=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),sd=(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 ${Kc[e]} with synchronous methods.`)}n.input=Qe(i.map(({contents:e})=>e).map(e=>cd(e,r)))}},cd=(e,t)=>{let n=nd(e,t,`utf8`,!0);return ld(n),Qe(n)},ld=e=>{let t=e.find(e=>typeof e!=`string`&&!k(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}.`)}})),dd,fd,pd,md,hd,gd,_d,vd=t((()=>{Ja(),X(),vn(),F(),dd=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&kt(n,r)&&!H.has(t)&&fd(r)&&(e.some(({type:e,value:t})=>e===`native`&&pd.has(t))||e.every(({type:e})=>Y.has(e))),fd=e=>e===1||e===2,pd=new Set([`pipe`,`overlapped`]),md=async(e,t,n,r)=>{for await(let i of e)gd(t)||_d(i,n,r)},hd=(e,t,n)=>{for(let r of e)_d(r,t,n)},gd=e=>e._readableState.pipes.length>0,_d=(e,t,n)=>{fn({type:`output`,verboseMessage:gn(e),fdNumber:t,verboseInfo:n})}})),yd,bd,xd,Sd,Cd,wd,Td=t((()=>{vd(),id(),Ou(),A(),X(),Ls(),yd=({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)=>bd({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},bd=({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=Ge(Fs(e,a,d)),{stdioItems:p,objectMode:m}=t[n],h=xd([f],p,c,r),{serializedResult:g,finalResult:_=g}=Sd({chunks:h,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});Cd({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&&wd(g,p,i),v}catch(e){return r.error=e,v}},xd=(e,t,n,r)=>{try{return nd(e,t,n,!1)}catch(t){return r.error=t,e}},Sd=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Qe(e)};let o=Xe(e,n);return r[a]?{serializedResult:o,finalResult:gu(o,!i[a],t)}:{serializedResult:o}},Cd=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!dd({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=gu(e,!1,o);try{hd(s,t,r)}catch(e){n.error??(n.error=e)}},wd=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>Hc.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?fe(r,e):(n.add(t),_e(r,e))}}})),Ed,Dd=t((()=>{A(),mu(),Ed=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,fu(t,n,`all`)]:Array.isArray(t)?[fu(e,n,`all`),...t]:k(e)&&k(t)?et([e,t]):`${e}${t}`}})),Od,kd,Ad,jd,Md,Nd,Pd=t((()=>{L(),Od=async(e,t)=>{let[n,r]=await kd(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},kd=async e=>{let[t,n]=await Promise.allSettled([w(e,`spawn`),w(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Ad(e):n.value},Ad=async e=>{try{return await w(e,`exit`)}catch{return Ad(e)}},jd=async e=>{let[t,n]=await e;if(!Md(t,n)&&Nd(t,n))throw new nr;return[t,n]},Md=(e,t)=>e===void 0&&t===void 0,Nd=(e,t)=>e!==0||t!==null})),Fd,Id,Ld=t((()=>{L(),Ls(),Pd(),Fd=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=Id(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:Ps(a,r,i)}},Id=(e,t,n)=>e===void 0?Nd(t,n)?new nr:void 0:e})),Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd=t((()=>{An(),ro(),ao(),Qs(),gc(),du(),mu(),ud(),Td(),Ls(),Dd(),Ld(),Rd=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=zd(e,t,n);return hc(Ud({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},zd=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=kn(e,t,n),{file:s,commandArguments:c,options:l}=eo(e,t,Bd(n));return Vd(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:ou(l,o)}},Bd=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Vd=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Hd(`ipcInput`),e&&Hd(`ipc: true`),n&&Hd(`detached: true`),r&&Hd(`cancelSignal`)},Hd=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Ud=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Wd({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}=Fd(c,n),{output:m,error:h=l}=yd({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>fu(e,n,t)),_=fu(Ed(m,n),n,`all`);return Kd({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},Wd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return ad(a,n),de(...io(e,t,Gd(n)))}catch(e){return qs({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},Gd=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Is(t)}),Kd=({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?Ks({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):Js({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})})),Jd,Yd,Xd,Zd,Qd,$d=t((()=>{mi(),Wi(),Fi(),Jd=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(Zr({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ui(e)}),Yd({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Yd=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{ki(t,i);let a=Bi(e,t,n),o=new AbortController;try{return await Promise.race([Xd(a,r,o),Zd(a,n,o),Qd(a,n,o)])}catch(t){throw pi(e),t}finally{o.abort(),ji(t,i)}},Xd=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await w(e,`message`,{signal:n});return t}for await(let[r]of Se(e,`message`,{signal:n}))if(t(r))return r},Zd=async(e,t,{signal:n})=>{await w(e,`disconnect`,{signal:n}),ei(t)},Qd=async(e,t,{signal:n})=>{let[r]=await w(e,`strict:error`,{signal:n});throw ni(r,t)}})),ef,tf,nf,rf,af,of,sf=t((()=>{mi(),Wi(),Fi(),ef=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>tf({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),tf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{Zr({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ui(e)}),ki(t,a);let o=Bi(e,t,n),s=new AbortController,c={};return nf(e,o,s),rf({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),af({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},nf=async(e,t,n)=>{try{await w(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},rf=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await w(e,`strict:error`,{signal:n.signal});r.error=ni(i,t),n.abort()}catch{}},af=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of Se(n,`message`,{signal:a.signal}))of(o),yield e}catch{of(o)}finally{a.abort(),ji(t,s),r||pi(e),i&&await e}},of=({error:e})=>{if(e)throw e}})),cf,lf,uf,df=t((()=>{ma(),$d(),sf(),Ca(),cf=(e,{ipc:t})=>{Object.assign(e,uf(e,!1,t))},lf=()=>{let e=S,t=S.channel!==void 0;return{...uf(e,!0,t),getCancelSignal:ga.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},uf=(e,t,n)=>({sendMessage:la.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Jd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:ef.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})})})),ff,pf,mf,hf,gf,_f,vf,yf=t((()=>{au(),Qs(),gc(),ff=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{ru(r);let s=new ce;pf(s,r),Object.assign(s,{readable:hf,writable:gf,duplex:_f});let c=qs({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1});return{subprocess:s,promise:vf(c,o,i)}},pf=(e,t)=>{let n=mf(),r=mf(),i=mf(),a=Array.from({length:t.length-3},mf),o=mf(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},mf=()=>{let e=new Te;return e.end(),e},hf=()=>new T({read(){}}),gf=()=>new De({write(){}}),_f=()=>new we({read(){},write(){}}),vf=async(e,t,n)=>hc(e,t,n)})),bf,xf,Sf,Cf,wf=t((()=>{id(),au(),X(),bf=(e,t)=>Gl(Cf,e,t,!1),xf=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Kc[e]}.`)},Sf={fileNumber:xf,generator:td,asyncGenerator:td,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:we.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Cf={input:{...Sf,fileUrl:({value:e})=>({stream:pe(e)}),filePath:({value:{file:e}})=>({stream:pe(e)}),webStream:({value:e})=>({stream:T.fromWeb(e)}),iterable:({value:e})=>({stream:T.from(e)}),asyncIterable:({value:e})=>({stream:T.from(e)}),string:({value:e})=>({stream:T.from(e)}),uint8Array:({value:e})=>({stream:T.from(ke.from(e))})},output:{...Sf,fileUrl:({value:e})=>({stream:me(e)}),filePath:({value:{file:e,append:t}})=>({stream:me(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:De.fromWeb(e)}),iterable:xf,asyncIterable:xf,string:xf,uint8Array:xf}}}));function Tf(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Lf(t);let t=e.some(({readableObjectMode:e})=>e),n=Ef(e,t),r=new Nf({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}var Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf=t((()=>{s(),c(),l(),Ef=(e,t)=>{if(e.length===0)return Oe(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)},Df=new WeakMap,Of=new WeakMap,kf=new WeakMap,Af=new WeakMap,jf=new WeakMap,Mf=new WeakMap,Nf=class extends Te{constructor(...e){super(...e),f(this,Df,new Set([])),f(this,Of,new Set([])),f(this,kf,new Set([])),f(this,Af,void 0),f(this,jf,Symbol(`unpipe`)),f(this,Mf,new WeakMap)}add(e){if(Lf(e),d(Df,this).has(e))return;d(Df,this).add(e),d(Af,this)??p(Af,this,Pf(this,d(Df,this),d(jf,this)));let t=Rf({passThroughStream:this,stream:e,streams:d(Df,this),ended:d(Of,this),aborted:d(kf,this),onFinished:d(Af,this),unpipeEvent:d(jf,this)});d(Mf,this).set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Lf(e),!d(Df,this).has(e))return!1;let t=d(Mf,this).get(e);return t===void 0?!1:(d(Mf,this).delete(e),e.unpipe(this),await t,!0)}},Pf=async(e,t,n)=>{Jf(e,Yf);let r=new AbortController;try{await Promise.race([Ff(e,r),If(e,t,n,r)])}finally{r.abort(),Jf(e,-Yf)}},Ff=async(e,{signal:t})=>{try{await E(e,{signal:t,cleanup:!0})}catch(t){throw Uf(e,t),t}},If=async(e,t,n,{signal:r})=>{for await(let[i]of Se(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Lf=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Rf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{Jf(e,Xf);let s=new AbortController;try{await Promise.race([zf(a,t,s),Bf({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),Vf({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),Jf(e,-Xf)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Gf(e):Hf(e))},zf=async(e,t,{signal:n})=>{try{await e,n.aborted||Gf(t)}catch(e){n.aborted||Uf(t,e)}},Bf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await E(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Wf(r)?i.add(t):Kf(e,r)}},Vf=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await w(e,i,{signal:a}),!e.readable)return w(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},Hf=e=>{e.writable&&e.end()},Uf=(e,t)=>{Wf(t)?Gf(e):Kf(e,t)},Wf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Gf=e=>{(e.readable||e.writable)&&e.destroy()},Kf=(e,t)=>{e.destroyed||(e.once(`error`,qf),e.destroy(t))},qf=()=>{},Jf=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},Yf=2,Xf=1})),Qf,$f,ep,tp,np,rp=t((()=>{N(),Qf=(e,t)=>{e.pipe(t),$f(e,t),tp(e,t)},$f=async(e,t)=>{if(!(j(e)||j(t))){try{await E(e,{cleanup:!0,readable:!0,writable:!1})}catch{}ep(t)}},ep=e=>{e.writable&&e.end()},tp=async(e,t)=>{if(!(j(e)||j(t))){try{await E(t,{cleanup:!0,readable:!1,writable:!0})}catch{}np(e)}},np=e=>{e.readable&&e.destroy()}})),ip,ap,op,sp,cp,lp,up=t((()=>{Zf(),N(),Oi(),X(),rp(),ip=(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})=>Y.has(e)))ap(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!Y.has(e)))sp({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())Qf(t.length===1?t[0]:Tf(t),e)},ap=(e,t,n,r)=>{n===`output`?Qf(e.stdio[r],t):Qf(t,e.stdio[r]);let i=op[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},op=[`stdin`,`stdout`,`stderr`],sp=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;cp(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},cp=(e,{signal:t})=>{j(e)&&Di(e,lp,t)},lp=2})),dp,fp=t((()=>{v(),dp=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=g(()=>{e.kill()});xe(r,()=>{i()})}})),pp,mp,hp,gp,_p,vp=t((()=>{He(),On(),V(),Be(),pp=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=En(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=mp(n,r,i),{sourceStream:d,sourceError:f}=_p(e,l),{options:p,fileDescriptors:m}=B.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},mp=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=hp(e,t,...n);return{destination:r,destinationStream:_i(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},hp=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(gp,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||Re(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]=Ve(n,...r);return{destination:t(gp)(i,a,o),pipeOptions:o}}if(B.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}`)},gp=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),_p=(e,t)=>{try{return{sourceStream:vi(e,t)}}catch(e){return{sourceError:e}}}})),yp,bp,xp,Sp,Cp=t((()=>{Qs(),rp(),yp=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=bp({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw xp({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},bp=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return np(e),r;if(t!==void 0)return ep(n),t},xp=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>qs({error:e,command:Sp,escapedCommand:Sp,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Sp=`source.pipe(destination)`})),wp,Tp=t((()=>{wp=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}})),Ep,Dp,Op,kp,Ap,jp,Mp,Np=t((()=>{Zf(),Oi(),rp(),Ep=(e,t,n)=>{let r=Ap.has(t)?Op(e,t):Dp(e,t);return Di(e,jp,n.signal),Di(t,Mp,n.signal),kp(t),r},Dp=(e,t)=>{let n=Tf([e]);return Qf(n,t),Ap.set(t,n),n},Op=(e,t)=>{let n=Ap.get(t);return n.add(e),n},kp=async e=>{try{await E(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ap.delete(e)},Ap=new WeakMap,jp=2,Mp=1})),Pp,Fp,Ip=t((()=>{Cp(),Pp=(e,t)=>e===void 0?[]:[Fp(e,t)],Fp=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await b(e,t),await n.remove(t),xp({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})}})),Lp,Rp,zp,Bp=t((()=>{O(),vp(),Cp(),Tp(),Np(),Ip(),Lp=(e,...t)=>{if(D(t[0]))return Lp.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=pp(e,...t),i=Rp({...r,destination:n});return i.pipe=Lp.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Rp=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=zp(e,i);yp({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Ep(t,a,d);return await Promise.race([wp(u),...Pp(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},zp=(e,t)=>Promise.allSettled([e,t])})),Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp=t((()=>{Bu(),Ou(),ed(),Vp=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Hp(t,o),Gp({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Hp=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Up=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Wp(t,o,e);let s=e.readableObjectMode&&!a;return Gp({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Wp=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Gp=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=Se(e,`data`,{signal:t.signal,highWaterMark:qp,highWatermark:qp});return Jp({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},Kp=Oe(!0),qp=Kp,Jp=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=Yp({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*Xu(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Zu(s)}},Yp=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Iu(e,n,!t),hu(e,i,!r,{})].filter(Boolean)})),Zp,Qp,$p,em,tm,nm,rm=t((()=>{Os(),A(),vd(),Xp(),Ls(),mu(),Zp=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=Qp({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([$p(e),d]);return}let f=Up({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:pu(c,n),allMixed:s}),[p]=await Promise.all([em({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},Qp=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{dd({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await md(Up({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},$p=async e=>{await Ne(),e.readableFlowing===null&&e.resume()},em=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await Zo(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await rs(n,{maxBuffer:a})):await ys(n,{maxBuffer:a})}catch(n){return nm(ks({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},tm=async e=>{try{return await e}catch(e){return nm(e)}},nm=({bufferedData:e})=>We(e)?new Uint8Array(e):e})),im,am,om,sm,cm,lm,um,dm,fm,pm=t((()=>{im=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=am(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],E(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||cm(e,t,n,r)}finally{o.abort()}},am=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&om(e,n,r),r},om=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{sm(t,n),r.call(e,...i)}},sm=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},cm=(e,t,n,r)=>{if(!lm(e,t,n,r))throw e},lm=(e,t,n,r=!0)=>n.propagating?fm(e)||dm(e):(n.propagating=!0,um(n,t)===r?fm(e):dm(e)),um=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,dm=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,fm=e=>e?.code===`EPIPE`})),mm,hm,gm=t((()=>{rm(),pm(),mm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>hm({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),hm=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=im(e,t,l);if(um(l,t)){await u;return}let[d]=await Promise.all([Zp({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}})),_m,vm,ym,bm,xm=t((()=>{Zf(),gm(),_m=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Tf([e,t].filter(Boolean)):void 0,vm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>hm({...ym(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:bm(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),ym=({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}},bm=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode})),Sm,Cm,wm=t((()=>{vn(),F(),Sm=e=>kt(e,`ipc`),Cm=(e,t)=>{fn({type:`ipc`,verboseMessage:gn(e),fdNumber:`ipc`,verboseInfo:t})}})),Tm,Em,Dm=t((()=>{Ls(),wm(),P(),sf(),Tm=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Sm(a),s=Dt(t,`ipc`),c=Dt(n,`ipc`);for await(let t of tf({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(js(e,i,c),i.push(t)),o&&Cm(t,a);return i},Em=async(e,t)=>(await Promise.allSettled([e]),t)})),Om,km,Am,jm,Mm=t((()=>{vo(),Ma(),Xr(),Oa(),N(),X(),rm(),Dm(),Va(),xm(),gm(),Pd(),pm(),Om=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=Od(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=mm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=vm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),ee=[],te=Tm({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:ee,verboseInfo:p}),ne=km(h,e,y),re=Am(m,y);try{return await Promise.race([Promise.all([{},jd(v),Promise.all(b),x,te,Ba(e,d),...ne,...re]),g,jm(e,_),...Aa(e,a,f,_),...Jr({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Ta({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=>tm(e))),tm(x),Em(te,ee),Promise.allSettled(ne),Promise.allSettled(re)])}},km=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:im(e,r,n)),Am=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>U(t,{checkOpen:!1})&&!j(t)).map(({type:e,value:r,stream:i=r})=>im(i,n,t,{isSameDirection:Y.has(e),stopOnExit:e===`native`}))),jm=async(e,{signal:t})=>{let[n]=await w(e,`error`,{signal:t});throw n}})),Nm,Pm,Fm,Im=t((()=>{gi(),Nm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Pm=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=hi();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Fm=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r}})),Lm,Rm,zm,Bm,Vm,Hm,Um=t((()=>{pm(),Lm=async e=>{if(e!==void 0)try{await zm(e)}catch{}},Rm=async e=>{if(e!==void 0)try{await Bm(e)}catch{}},zm=async e=>{await E(e,{cleanup:!0,readable:!1,writable:!0})},Bm=async e=>{await E(e,{cleanup:!0,readable:!0,writable:!1})},Vm=async(e,t)=>{if(await e,t)throw t},Hm=(e,t,n)=>{n&&!dm(n)?e.destroy(n):t&&e.destroy()}})),Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm=t((()=>{Ja(),V(),Xp(),gi(),Im(),Um(),Wm=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||H.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Gm(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Km(s,o),{read:f,onStdoutDataDone:p}=qm({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new T({read:f,destroy:x(Xm.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Ym({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},Gm=(e,t,n)=>{let r=vi(e,t);return{subprocessStdout:r,waitReadableDestroy:Pm(n,r,`readableDestroy`)}},Km=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Kp},qm=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=hi(),o=Vp({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Jm(this,o,a)},onStdoutDataDone:a}},Jm=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},Ym=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Bm(e),await r,await Lm(i),await t,n.readable&&n.push(null)}catch(e){await Lm(i),Zm(n,e)}},Xm=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Fm(n,t)&&(Zm(e,r),await Vm(t,r))},Zm=(e,t)=>{Hm(e,e.readable,t)}})),$m,eh,th,nh,rh,ih,ah,oh,sh=t((()=>{V(),Im(),Um(),$m=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=eh(e,n,t),o=new De({...th(r,e,i),destroy:x(ah.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return ih(r,o),o},eh=(e,t,n)=>{let r=_i(e,t);return{subprocessStdin:r,waitWritableFinal:Pm(n,r,`writableFinal`),waitWritableDestroy:Pm(n,r,`writableDestroy`)}},th=(e,t,n)=>({write:nh.bind(void 0,e),final:x(rh.bind(void 0,e,t,n))}),nh=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},rh=async(e,t,n)=>{await Fm(n,t)&&(e.writable&&e.end(),await t)},ih=async(e,t,n)=>{try{await zm(e),t.writable&&t.end()}catch(e){await Rm(n),oh(t,e)}},ah=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Fm(n,t),await Fm(r,t)&&(oh(e,i),await Vm(t,i))},oh=(e,t)=>{Hm(e,e.writable,t)}})),ch,lh,uh=t((()=>{Ja(),Qm(),sh(),ch=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||H.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Gm(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=eh(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=Km(c,s),{read:g,onStdoutDataDone:_}=qm({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new we({read:g,...th(u,e,d),destroy:x(lh.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 Ym({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),ih(u,v,c),v},lh=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([Xm({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),ah({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])}})),dh,fh,ph=t((()=>{Ja(),V(),Xp(),dh=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||H.has(t),o=vi(e,n),s=Vp({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return fh(s,o,e)},fh=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}}})),mh,hh=t((()=>{Im(),Qm(),sh(),uh(),ph(),mh=(e,{encoding:t})=>{let n=Nm();e.readable=Wm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=$m.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=ch.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=dh.bind(void 0,e,t),e[Symbol.asyncIterator]=dh.bind(void 0,e,t,{})}})),gh,_h,vh,yh=t((()=>{gh=(e,t)=>{for(let[n,r]of vh){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},_h=(async()=>{})().constructor.prototype,vh=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(_h,e)])})),bh,xh,Sh,Ch,wh,Th,Eh=t((()=>{Os(),An(),ro(),V(),ao(),df(),Qs(),gc(),yf(),wf(),mu(),up(),Wr(),fp(),Bp(),xm(),Mm(),hh(),gi(),yh(),bh=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=xh(e,t,n),{subprocess:f,promise:p}=Ch({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Lp.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),gh(f,p),B.set(f,{options:u,fileDescriptors:d}),f},xh=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=kn(e,t,n),{file:s,commandArguments:c,options:l}=eo(e,t,n),u=Sh(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:bf(u,o)}},Sh=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},Ch=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=ue(...io(e,t,n))}catch(e){return ff({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;Ce(1/0,l.signal);let u=[...c.stdio];ip(c,s,l),dp(c,n,l);let d={},f=hi();c.kill=zr.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=_m(c,n),mh(c,n),cf(c,n);let p=wh({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}},wh=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 Om({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)=>fu(e,t,n)),v=fu(h,t,`all`);return hc(Th({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},Th=({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?Js({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 Wo,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Ks({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u})})),Dh,Oh,kh,Ah=t((()=>{O(),P(),Dh=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Oh(t,e[t],n)]));return{...e,...n}},Oh=(e,t,n)=>kh.has(e)&&D(t)&&D(n)?{...t,...n}:n,kh=new Set([`env`,...Et])})),$,jh,Mh,Nh=t((()=>{O(),He(),dt(),qd(),Eh(),Ah(),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>jh({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},jh=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(D(a))return i(e,Dh(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Mh({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Rd(s,c,l):bh(s,c,l,i)},Mh=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ve(...nt(t)?rt(t,n):[t,...n]),c=Dh(Dh(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}}})),Ph,Fh,Ih,Lh,Rh,zh=t((()=>{Ph=({file:e,commandArguments:t})=>Ih(e,t),Fh=({file:e,commandArguments:t})=>({...Ih(e,t),isSync:!0}),Ih=(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]=Lh(e);return{file:n,commandArguments:r}},Lh=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(Rh)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Rh=/ +/g})),Bh,Vh,Hh,Uh,Wh,Gh,Kh=t((()=>{Bh=(e,t,n)=>{e.sync=t(Hh,n),e.s=e.sync},Vh=({options:e})=>Uh(e),Hh=({options:e})=>({...Uh(e),isSync:!0}),Uh=e=>({options:{...Wh(e),...e}}),Wh=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Gh={preferLocal:!0}})),qh,Jh,Yh,Xh,Zh,Qh,$h=t((()=>{Nh(),zh(),Fa(),Kh(),df(),L(),qh=$(()=>({})),Jh=$(()=>({isSync:!0})),$(Ph),$(Fh),$(Na),$(Vh,{},Gh,Bh),{sendMessage:Yh,getOneMessage:Xh,getEachMessage:Zh,getCancelSignal:Qh}=lf()}));export{Un as i,Jh as n,$h as r,qh as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{St as n,Xs as r,Zs as i,gi as a,mC as o,mi as s,pC as c,yt as l}from"./loadAgentsDir-uuZYOgKn.js";import{n as u,t as d}from"./ExitFlow-CATwJC4c.js";import{spawnSync as f}from"child_process";function p(){return o(g)??`Goodbye!`}async function m(e){if(i())return e(),f(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=l()!==null;return t?(0,h.jsx)(d,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(p()),await s(0,`prompt_input_exit`),null)}var h,g;e((()=>{c(),u(),r(),a(),n(),h=t(),g=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{m as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{D as n,Gt as r,I as i,P as a,T as o,ai as s,t as c,x as l}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{D as n,Gt as r,I as i,P as a,T as o,ai as s,t as c,x as l}from"./src-BX54x08P.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{AC as d,Bh as f,CC as p,MC as m,NC as h,hd as g,jC as _,md as v,tb as y,zh as b}from"./loadAgentsDir-uuZYOgKn.js";import{at as x,f as S,g as C,it as w}from"./model-CcHyMyBv.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-ClN4NJnB.js";import{t as D}from"./select-BuTJbu_Q.js";import{n as O,r as k,t as A}from"./modelOptions-CJV1R3Jt.js";import{t as j}from"./CustomSelect-CYmc4vRh.js";import{n as M,t as N}from"./fetchModelList-9w1E4Ue8.js";function P({initial:e,sessionModel:t,onSelect:s,onCancel:c,isStandaloneCommand:u,showFastModeNotice:d,headerText:g}){let y=T(),b=e===null?L:e,[x,S]=(0,F.useState)(b),E=f(e=>h()?e.fastMode:!1),[k,j]=(0,F.useState)(()=>new Set(w(b)?[b.replace(/\[1m\]/i,``)]:[])),M=(0,F.useCallback)(()=>{if(!x||x===L)return;let e=x.replace(/\[1m\]/i,``);j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[x]),P=(0,F.useMemo)(()=>O(E??!1),[E]),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)(!1);(0,F.useEffect)(()=>{let e=!1;return V(!1),N().then(t=>{if(!e){if(!t||t.length===0){z(null),V(!0);return}z(t)}}).catch(()=>{e||V(!0)}),()=>{e=!0}},[]);let H=(0,F.useMemo)(()=>R?A(R,E??!1):null,[R,E]),U=R===null&&!B,W=(0,F.useMemo)(()=>{let t=H??P;return e!==null&&!t.some(t=>t.value===e)?[...t,{value:e,label:C(e),description:`Current model`}]:t},[H,P,e]),G=(0,F.useMemo)(()=>W.map(e=>({...e,value:e.value===null?L:e.value})),[W]),K=(0,F.useMemo)(()=>G.some(e=>e.value===b)?b:G[0]?.value??void 0,[G,b]),q=Math.min(10,G.length),J=Math.max(0,G.length-q),Y=G.find(e=>e.value===x)?.label,X=x!==void 0&&x!==L&&k.has(x.replace(/\[1m\]/i,``)),Z=(0,F.useCallback)(e=>{S(e)},[]);r({"modelPicker:toggle1M":()=>M()},{context:`ModelPicker`});function Q(e){if(e===L){s(null);return}let t=e.replace(/\[1m\]/i,``);s(k.has(t)?`${t}[1m]`:t)}let $=(0,I.jsxs)(i,{flexDirection:`column`,children:[(0,I.jsxs)(i,{flexDirection:`column`,children:[(0,I.jsxs)(i,{marginBottom:1,flexDirection:`column`,children:[(0,I.jsx)(a,{color:`remember`,bold:!0,children:`Select model`}),(0,I.jsx)(a,{dimColor:!0,children:g??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,I.jsxs)(a,{dimColor:!0,children:[`Currently using `,C(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,I.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsx)(i,{flexDirection:`column`,children:(0,I.jsx)(D,{defaultValue:b,defaultFocusValue:K,options:G,onChange:Q,onFocus:Z,onCancel:c??(()=>{}),visibleOptionCount:q})}),J>0&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsxs)(a,{dimColor:!0,children:[`and `,J,` more…`]})}),U&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsx)(a,{dimColor:!0,children:`正在从 API 拉取可用模型列表…`})}),B&&R===null&&(0,I.jsx)(i,{paddingLeft:3,children:(0,I.jsx)(a,{dimColor:!0,children:`API 拉取失败,使用内置列表`})})]}),(0,I.jsx)(i,{marginBottom:1,flexDirection:`column`,children:X?(0,I.jsxs)(a,{dimColor:!0,children:[`1M context on`,(0,I.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]}):(0,I.jsxs)(a,{color:`subtle`,children:[`1M context off`,Y?` for ${Y}`:``,(0,I.jsx)(a,{color:`subtle`,children:` · Space to toggle`})]})}),h()?d?(0,I.jsx)(i,{marginBottom:1,children:(0,I.jsxs)(a,{dimColor:!0,children:[`Fast mode is `,(0,I.jsx)(a,{bold:!0,children:`ON`}),` and available with `,p,` only (/fast). Switching to other models turn off fast mode.`]})}):_()&&!m()?(0,I.jsx)(i,{marginBottom:1,children:(0,I.jsxs)(a,{dimColor:!0,children:[`Use `,(0,I.jsx)(a,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,p,` only).`]})}):null:null]}),u&&(0,I.jsx)(a,{dimColor:!0,italic:!0,children:y.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,y.keyName,` again to exit`]}):(0,I.jsxs)(o,{children:[(0,I.jsx)(n,{shortcut:`Enter`,action:`confirm`}),(0,I.jsx)(v,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return u?(0,I.jsx)(l,{color:`permission`,children:$}):$}var F,I,L,R=e((()=>{F=t(s(),1),x(),E(),d(),c(),y(),b(),S(),k(),M(),g(),j(),I=u(),L=`__NO_PREFERENCE__`}));function z(e,t,n){return!1}var B=e((()=>{}));export{R as i,z as n,P as r,B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cc as e,dc as t,lc as n,uc as r}from"./loadAgentsDir-uuZYOgKn.js";t();export{e as drainPendingExtraction,n as executeExtractMemories,r as initExtractMemories};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,I as r,Lt as i,P as a,ai as o,di as s,fi as c,j as l,t as u,y as d}from"./src-BX54x08P.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as p,m,y as h}from"./settings-D4M13toi.js";import{AC as g,Bh as _,CC as v,EC as y,Hh as b,NC as x,OC as S,PC as C,TC as w,_y as T,gy as E,tb as D,vy as O,wC as k,zC as A,zh as j}from"./loadAgentsDir-uuZYOgKn.js";import{d as M,o as N}from"./config-BDn2YIjC.js";import{n as P}from"./analytics-COpjZpvd.js";import{_ as F,l as I}from"./startupProfiler-B9Qv2QGH.js";import{n as L,t as R}from"./systemTheme-Ceakddth.js";function z({cooldown:e}){return e?(0,V.jsx)(a,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,V.jsx)(a,{color:`fastMode`,children:`↯`})}function B(e=!0,t=!1){if(!e)return`↯`;let n=L(N().theme);return t?s.dim(l(`promptBorder`,n)(`↯`)):l(`fastMode`,n)(`↯`)}var V,H=e((()=>{c(),p(),u(),M(),R(),V=f()}));function U(e,t){k(),h(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!C(e.mainLoopModel);return{...e,...t?{mainLoopModel:w(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function W({onDone:e,unavailableReason:t}){let o=_(e=>e.mainLoopModel),s=_(e=>e.fastMode),c=b(),[l,u]=(0,q.useState)(s??!1),f=y(),p=f.status===`cooldown`,m=t!==null,h=E(T(!0));function g(){m||(U(l,c),l?e(`${B(l)} Fast mode ON${C(o)?``:` · model set to ${v}`} · ${h}`):(c(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function x(){if(m){s&&U(!1,c),e(`Fast mode OFF`,{display:`system`});return}e(s?`${B()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function S(){m||u(e=>!e)}return n({"confirm:yes":g,"confirm:nextField":S,"confirm:next":S,"confirm:previous":S,"confirm:cycleMode":S,"confirm:toggle":S},{context:`Confirmation`}),(0,J.jsxs)(d,{title:(0,J.jsxs)(a,{children:[(0,J.jsx)(z,{cooldown:p}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${v}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:x,color:`fastMode`,inputGuide:e=>e.pending?(0,J.jsxs)(a,{children:[`Press `,e.keyName,` again to exit`]}):m?(0,J.jsx)(a,{children:`Esc to cancel`}):(0,J.jsx)(a,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,J.jsx)(r,{marginLeft:2,children:(0,J.jsx)(a,{color:`error`,children:t})}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(r,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,J.jsxs)(r,{flexDirection:`row`,gap:2,children:[(0,J.jsx)(a,{bold:!0,children:`Fast mode`}),(0,J.jsx)(a,{color:l?`fastMode`:void 0,bold:l,children:l?`ON `:`OFF`}),(0,J.jsx)(a,{dimColor:!0,children:h})]})}),p&&f.status===`cooldown`&&(0,J.jsx)(r,{marginLeft:2,children:(0,J.jsxs)(a,{color:`warning`,children:[f.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,I(f.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,J.jsxs)(a,{dimColor:!0,children:[`Learn more:`,` `,(0,J.jsx)(i,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function G(e,t,n){let r=S();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return U(e,n),e?`${B(!0)} Fast mode ON${C(i)?``:` · model set to ${v}`} · ${E(T(!0))}`:`Fast mode OFF`}async function K(e,t,n){if(!x())return null;await A();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await G(r===`on`,t.getAppState,t.setAppState)),null;let i=S();return(0,J.jsx)(W,{onDone:e,unavailableReason:i})}var q,J,Y=e((()=>{q=t(o(),1),u(),H(),D(),P(),j(),g(),F(),O(),m(),J=f()}));export{H as a,B as i,K as n,Y as r,W as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./fast-C5-lNCQi.js";t();export{n as FastModePicker,e as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Yr as t,Zr as n}from"./settings-D4M13toi.js";import{c as r,i}from"./debug-2pVES-2G.js";import{Mt as a,Pt as o,W as s,dt as c,q as l,ut as u}from"./model-CcHyMyBv.js";import{n as d,r as f}from"./client-2w-g5kMx.js";async function p(){let e=a();try{switch(e){case`firstParty`:{let e=await u({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.display_name??n.id,description:n.id});return t.length>0?t:null}case`openai`:{let e=d({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.id,description:`via openai-compat`});return t.length>0?t:null}case`grok`:{let{getGrokClient:e}=await import(`./client-B0ngS4Uu.js`),t=e({maxRetries:1}),n=[];for await(let e of t.models.list())n.push({value:e.id,label:e.id,description:`via grok`});return n.length>0?n:null}case`bedrock`:{let e=(await s()).map(e=>({value:e,label:e,description:`Bedrock inference profile`}));return e.length>0?e:null}case`gemini`:case`vertex`:case`foundry`:return null}}catch(t){return r(`[fetchModelList] ${e} failed: ${t instanceof Error?t.message:`unknown`}`),null}return null}var m,h,g=e((()=>{c(),f(),i(),t(),l(),o(),m=300*1e3,h=n(p,m)}));export{g as n,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./fetchModelList-9w1E4Ue8.js";e();export{t as fetchAvailableModels};
|
|
@@ -0,0 +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{Kr as a,dr as o,m as s,pr as c,qr as l,t as u,zr as d}from"./settings-D4M13toi.js";import{Gn as f,Kn as p}from"./state-CXY-q5gr.js";import{Mt as m,Rt as h,_ as g,g as _,mn as v,p as ee}from"./loadAgentsDir-uuZYOgKn.js";import{n as y,t as b}from"./cwd-DrEEb4f5.js";import{I as x,M as te,c as S,f as ne,i as re,u as ie}from"./debug-2pVES-2G.js";import{d as ae,o as oe}from"./config-BDn2YIjC.js";import{o as se,s as C}from"./log-L1kqxa_P.js";import{i as ce,n as le}from"./execFileNoThrow-DXSEj8ZO.js";import{n as ue}from"./analytics-COpjZpvd.js";import{a as de,s as fe}from"./ripgrep-67m14ImZ.js";import*as w from"path";import{statSync as pe}from"fs";function me(e,t,n){if(t===0)return n?D:0;let r=e.charCodeAt(t-1);return he(r)?be:ge(r)&&_e(e.charCodeAt(t))?xe: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 T(){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,xe,E,D,O,k,A,j,M,N,Se=e((()=>{n(),ye=16,be=8,xe=6,E=4,D=8,O=3,k=1,A=100,j=64,M=new Int32Array(j),N=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 T(),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 T(),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,A)}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,j),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+D+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++){M[0]=g[e];let n=0,o=0,u=M[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}M[e]=t;let i=t-u-1;i===0?o+=E:n+=O+i*k,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,M[0],!0);for(let e=1;e<i;e++)f+=me(v,M[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 P(){return z||(z=new N),z}function Ce(){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 F(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=d(b());if(!e)return null;try{return pe(w.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function I(e,t,n){return n===t?e:e.map(e=>{let r=w.join(t,e);return w.relative(n,r)})}async function Te(e){if(e.length===0||!z||W.length===0)return;let t=await Oe(e),n=[...W,...G,...K,...e,...t],r=F(n);if(r===Q){S(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await z.loadFromFileListAsync(n).done,Q=r,S(`[FileIndex] rebuilt index with ${W.length} tracked + ${e.length} untracked files`)}async function Ee(e,t){let n=`${e}:${t}`;if(J===n)return q;let r=ie(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,ze.default)(),s=!1,c=a.flatMap(e=>i.map(t=>w.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,S(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return q=u,J=n,u}async function De(e,t){let n=Date.now();S(`[FileIndex] getFilesUsingGit called`);let r=b(),i=d(r);if(!i)return S(`[FileIndex] not a git repo, returning null`),null;try{let o=Date.now(),s=await le(a(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(S(`[FileIndex] git ls-files (tracked) took ${Date.now()-o}ms`),s.code!==0)return S(`[FileIndex] git ls-files failed (code=${s.code}, stderr=${s.stderr}), falling back to ripgrep`),null;let c=I(s.stdout.trim().split(`
|
|
2
|
+
`).filter(Boolean),i,r),l=await Ee(i,r);if(l){let e=c.length;c=l.filter(c),S(`[FileIndex] applied ignore patterns: ${e} -> ${c.length} files`)}W=c;let u=Date.now()-n;if(S(`[FileIndex] git ls-files: ${c.length} tracked files in ${u}ms`),c.length,c.length,!U){let e=t?[`-c`,`core.quotepath=false`,`ls-files`,`--others`,`--exclude-standard`]:[`-c`,`core.quotepath=false`,`ls-files`,`--others`],n=H;U=le(a(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===H&&e.code===0){let t=I(e.stdout.trim().split(`
|
|
3
|
+
`).filter(Boolean),i,r),n=await Ee(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),S(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}S(`[FileIndex] background untracked fetch: ${t.length} files`),Te(t)}}).catch(e=>{S(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return c}catch(e){return S(`[FileIndex] git ls-files error: ${te(e)}`),null}}async function Oe(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)ke(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await T(),n=performance.now());return[...t].map(e=>e+w.sep)}function ke(e,t,n,r){for(let i=t;i<n;i++){let t=w.dirname(e[i]);for(;t!==`.`&&!r.has(t);){let e=w.dirname(t);if(e===t)break;r.add(t),t=e}}}async function Ae(e){return(await Promise.all(ee.map(t=>g(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function je(e,t){S(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await De(e,t);if(n!==null)return S(`[FileIndex] using git ls-files result (${n.length} files)`),n;S(`[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=>w.relative(b(),e)),o=Date.now()-r;return S(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),a.length,a}async function Me(){let e=AbortSignal.timeout(1e4),t=P();try{let n=u(),r=oe(),i=n.respectGitignore??r.respectGitignore??!0,a=b(),[o,s]=await Promise.all([je(e,i),Ae(a)]);G=s;let c=[...o,...s],l=await Oe(c);K=l;let d=[...l,...c],f=F(d);f===Z?S(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(d).done,Z=f,Q=null)}catch(e){C(e)}return t}function Ne(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 Pe(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=Ne(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 Fe(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<Ve)return;let t=H,n=Date.now();P(),B=Me().then(r=>t===H?(B=null,V.emit(),X=e,Y=Date.now(),S(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(S(`[FileIndex] Cache refresh failed: ${te(e)}`),C(e),t===H&&(B=null),P()))}async function Ie(){let e=ie(),t=b();try{return(await e.readdir(t)).map(e=>{let n=w.join(t,e.name),r=w.relative(t,n);return e.isDirectory()?r+w.sep:r})}catch(e){return C(e),[]}}async function Le(e,t=!1){if(!e&&!t)return[];if(u().fileSuggestion?.type===`command`)return(await h({...m(),query:e})).slice(0,$).map(L);if(e===``||e===`.`||e===`./`){let e=await Ie();return R(),e.slice(0,$).map(L)}let n=Date.now();try{let t=B!==null;R();let r=e,i=`.${w.sep}`;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=o(r));let a=z?Fe(z,r):[],s=Date.now()-n;return S(`[FileIndex] generateFileSuggestions: ${a.length} results in ${s}ms (${t?`partial`:`full`} index)`),a.length,e.length,a}catch(e){return C(e),[]}}function Re(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 ze,z,B,V,Be,H,U,W,G,K,q,J,Y,X,Z,Q,$,Ve,He=e((()=>{ze=t(i(),1),_(),Se(),ue(),ae(),y(),re(),x(),ce(),ne(),l(),v(),se(),c(),de(),s(),p(),z=null,B=null,V=f(),Be=V.subscribe,H=0,U=null,W=[],G=[],K=[],q=null,J=null,Y=0,X=null,Z=null,Q=null,$=15,Ve=5e3}));export{He as a,Le as i,Ce as n,Be as o,Pe as r,R as s,Re as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-BX54x08P.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";var r=e(t(),1),i=n(),a=(0,r.createContext)(void 0);function o({getFpsMetrics:e,children:t}){return(0,i.jsx)(a.Provider,{value:e,children:t})}function s(){return(0,r.useContext)(a)}export{s as n,o as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
2
|
-
`)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`))continue;let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);r===`data`&&(o.data=o.data?`${o.data}\n${i}`:i)}o.data&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function S(){return(process.env.GEMINI_BASE_URL||T).replace(/\/+$/,``)}function C(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*w(e){let t=await(e.fetchOverride??fetch)(`${S()}/${C(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,...y({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,E);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: ${h(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: ${h(e)}`)}}finally{n.releaseLock()}}var T,E,D=e((()=>{m(),v(),T=`https://generativelanguage.googleapis.com/v1beta`,E={stream:!0}}));async function*O(e,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AS as t,BS as n,FS as r,Ji as i,LS as a,MS as o,NS as s,Wx as c,bS as l,ca as u,et as d,rt as f,ua as p}from"./loadAgentsDir-uuZYOgKn.js";import{I as m,M as h,c as g,i as _}from"./debug-2pVES-2G.js";import{c as v,i as y}from"./proxy--_NfbJhm.js";import{randomUUID as b}from"crypto";function x(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={};for(let e of a.split(`
|
|
2
|
+
`)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`))continue;let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);r===`data`&&(o.data=o.data?`${o.data}\n${i}`:i)}o.data&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function S(){return(process.env.GEMINI_BASE_URL||T).replace(/\/+$/,``)}function C(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*w(e){let t=await(e.fetchOverride??fetch)(`${S()}/${C(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,...y({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,E);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: ${h(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: ${h(e)}`)}}finally{n.releaseLock()}}var T,E,D=e((()=>{m(),v(),T=`https://generativelanguage.googleapis.com/v1beta`,E={stream:!0}}));async function*O(e,i,l,d,m,h){try{let c=n(m.model),_=p(e,l),v=(await Promise.all(l.map(e=>f(e,{getToolPermissionContext:m.getToolPermissionContext,tools:l,agents:m.agents,allowedAgentTypes:m.allowedAgentTypes,model:m.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:y,systemInstruction:x}=r(_,i),S=s(v),C=o(m.toolChoice),T=w({model:c,signal:d,fetchOverride:m.fetchOverride,body:{contents:y,...x&&{systemInstruction:x},...S.length>0&&{tools:S},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...m.temperatureOverride!==void 0&&{temperature:m.temperatureOverride},...h.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...h.type===`enabled`&&{thinkingBudget:h.budgetTokens}}}}}});g(`[Gemini] Calling model=${c}, messages=${y.length}, tools=${S.length}`);let E=t(T,c),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[a]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:u([t],l,m.agentId)},requestId:void 0,type:`assistant`,uuid:b(),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);g(`[Gemini] Error: ${t}`,{level:`error`}),yield c({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{d(),_(),i(),D(),l()}))();export{O as queryModelGemini};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{bn as t,vn as n}from"./settings-D4M13toi.js";import{Fx as r,GS as i,Ji as a,X as o,Z as s,ty as c}from"./loadAgentsDir-uuZYOgKn.js";import{I as l,M as u,c as d,i as f}from"./debug-2pVES-2G.js";import{r as p,t as m}from"./sessionTitle-k4wpUS5l.js";async function h(e,n){let a=m(e);if(!a)return null;try{let e=await s({systemPrompt:i([`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:a,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:n,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),o=t(Array.isArray(e.message.content)?r(e.message.content):e.message.content);return o&&typeof o==`object`&&`name`in o&&typeof o.name==`string`?o.name:null}catch(e){return d(`generateSessionName failed: ${u(e)}`,{level:`error`}),null}}var g=e((()=>{o(),f(),l(),n(),a(),p(),c()}));export{g as n,h as t};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-DXSEj8ZO.js";function i(e){if(e<=1)return!1;try{return process.kill(e,0),!0}catch{return!1}}function a(e){try{let t=String(e),n=r(process.platform===`win32`?`powershell.exe -NoProfile -Command "(Get-CimInstance Win32_Process -Filter \\"ProcessId=${t}\\").CommandLine"`:`ps -o command= -p ${t}`,{timeout:1e3});return n?n.trim():null}catch{return null}}async function o(e,t=10){if(process.platform===`win32`){let r=await n(`powershell.exe`,[`-NoProfile`,`-Command`,`
|
|
2
|
+
$currentPid = ${String(e)}
|
|
3
|
+
$commands = @()
|
|
4
|
+
for ($i = 0; $i -lt ${t}; $i++) {
|
|
5
|
+
$proc = Get-CimInstance Win32_Process -Filter "ProcessId=$currentPid" -ErrorAction SilentlyContinue
|
|
6
|
+
if (-not $proc) { break }
|
|
7
|
+
if ($proc.CommandLine) { $commands += $proc.CommandLine }
|
|
8
|
+
if (-not $proc.ParentProcessId -or $proc.ParentProcessId -eq 0) { break }
|
|
9
|
+
$currentPid = $proc.ParentProcessId
|
|
10
|
+
}
|
|
11
|
+
$commands -join [char]0
|
|
12
|
+
`.trim()],{timeout:3e3});return r.code!==0||!r.stdout?.trim()?[]:r.stdout.split(`\0`).filter(Boolean)}let r=await n(`sh`,[`-c`,`currentpid=${String(e)}; for i in $(seq 1 ${t}); do cmd=$(ps -o command= -p $currentpid 2>/dev/null); if [ -n "$cmd" ]; then printf '%s\\0' "$cmd"; fi; ppid=$(ps -o ppid= -p $currentpid 2>/dev/null | tr -d ' '); if [ -z "$ppid" ] || [ "$ppid" = "0" ] || [ "$ppid" = "1" ]; then break; fi; currentpid=$ppid; done`],{timeout:3e3});return r.code!==0||!r.stdout?.trim()?[]:r.stdout.split(`\0`).filter(Boolean)}var s=e((()=>{t()}));export{i,a as n,s as r,o as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{$c as a,Av as o,Fv as s,al as c,el as l,fl as u,il as d,ll as f,ml as p,nl as m,ol as h,pl as g,rl as _,sl as v,tl as y,ul as b}from"./loadAgentsDir-uuZYOgKn.js";import{t as x}from"./select-BuTJbu_Q.js";import{t as S}from"./CustomSelect-CYmc4vRh.js";import{n as C,t as w}from"./PermissionDialog-DjCRuzSm.js";function T({currentGoal:e,newObjective:r,onConfirm:i,onCancel:a}){function o(e){e===`yes`?i():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,E.jsx)(w,{color:`warning`,title:`Replace active goal?`,children:(0,E.jsxs)(t,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,E.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,E.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Status: `}),h(e.status)]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Time: `}),c(e)]}),(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,E.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,E.jsx)(n,{children:r})]}),(0,E.jsx)(t,{marginTop:1,children:(0,E.jsx)(x,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var E,D=e((()=>{r(),S(),C(),b(),E=i()}));function O(e){let t=e.split(`
|
|
2
2
|
`)[0]??e;return t.length<=F?t:`${t.slice(0,F)}…`}function k(){s(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function A(){let e=v();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${h(e.status)}`,`Time: ${c(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
|
|
3
3
|
`)}function j(e){return p(e),f(),l(),`Goal set.`}async function M(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(A(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=m();return t&&(y(),k()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=u();return t&&(l(),k()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(v()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=g();return t&&l(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=d();return t&&l(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=_();return t&&(l(),k()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>P)return e(`Goal objective is too long (${r.length} chars; limit ${P}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=v();return a&&a.status!==`complete`?(0,N.jsx)(T,{currentGoal:a,newObjective:r,onConfirm:()=>{k(),e(j(r),{display:`system`,shouldQuery:!0,displayArgs:O(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(j(r),{display:`system`,shouldQuery:!0,displayArgs:O(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var N,P,F;e((()=>{b(),a(),o(),D(),N=i(),P=4e3,F=80}))();export{M as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{CS as t,ES as n,HS as r,Ji as i,Wx as a,bS as o,ca as s,dy as c,et as l,hy as u,rt as d,sy as f,ua as p,vy as m,wS as h,xS as g}from"./loadAgentsDir-uuZYOgKn.js";import{c as _,i as v}from"./debug-2pVES-2G.js";import{n as y,t as b}from"./client-pA7fKk0-.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,i,o,c,l){try{let a=r(l.model),m=p(e,o),v=(await Promise.all(o.map(e=>d(e,{getToolPermissionContext:l.getToolPermissionContext,tools:o,agents:l.agents,allowedAgentTypes:l.allowedAgentTypes,model:l.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=n(m,i),S=h(v),w=t(l.toolChoice),T=b({maxRetries:0,fetchOverride:l.fetchOverride,source:l.querySource});_(`[Grok] Calling model=${a}, messages=${y.length}, tools=${S.length}`);let E=g(await T.chat.completions.create({model:a,messages:y,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...l.temperatureOverride!==void 0&&{temperature:l.temperatureOverride}},{signal:c}),a),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));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.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:s([t],o,l.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&f(u(a,k),k,l.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);_(`[Grok] Error: ${t}`,{level:`error`}),yield a({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{y(),S(),o(),i(),l(),v(),c(),m()}))();export{w as queryModelGrok};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,ai as s,n as c,ot as l,r as u,t as d,x as f}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,ai as s,n as c,ot as l,r as u,t as d,x as f}from"./src-BX54x08P.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Mi as m,Ti as h,nb as g,rb as _,sb as v,tb as y,xi as b}from"./loadAgentsDir-uuZYOgKn.js";import{v as x,y as S}from"./startupProfiler-B9Qv2QGH.js";import{n as C,t as w}from"./useExitOnCtrlCDWithKeybindings-ClN4NJnB.js";import{n as T,t as E}from"./select-BuTJbu_Q.js";import{n as D,r as O}from"./modalContext-sU2lfR08.js";import{n as k,t as A}from"./PromptInputHelpMenu-CrTT8MKE.js";function j({commands:e,maxHeight:t,columns:r,title:a,onCancel:s,emptyMessage:c}){let{headerFocused:l,focusHeader:u}=o(),d=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),p=(0,M.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:S(h(e),d,!0)}))},[e,d]);return(0,N.jsx)(n,{flexDirection:`column`,paddingY:1,children:e.length===0&&c?(0,N.jsx)(i,{dimColor:!0,children:c}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(i,{children:a}),(0,N.jsx)(n,{marginTop:1,children:(0,N.jsx)(E,{options:p,visibleOptionCount:f,onCancel:s,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:u,isDisabled:l})})]})})}var M,N,P=e((()=>{M=t(s(),1),m(),x(),d(),T(),N=p()}));function F(){return(0,I.jsxs)(n,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(i,{bold:!0,children:`Getting started`}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`1. `}),(0,I.jsx)(i,{children:`Ask a question or describe a task — Work Mate will explore your code and respond.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`2. `}),(0,I.jsx)(i,{children:`When Work Mate wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(i,{children:[(0,I.jsx)(i,{bold:!0,children:`3. `}),(0,I.jsx)(i,{children:`Type `}),(0,I.jsx)(i,{bold:!0,children:`/help`}),(0,I.jsx)(i,{children:` for commands, or `}),(0,I.jsx)(i,{bold:!0,children:`?`}),(0,I.jsx)(i,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(n,{flexDirection:`column`,children:[(0,I.jsx)(n,{children:(0,I.jsx)(i,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{d(),k(),I=p()}));function R({onClose:e,commands:t}){let{rows:o,columns:s}=l(),d=Math.floor(o/2),p=O(),m=()=>e(`Help dialog dismissed`,{display:`system`});a(`help:dismiss`,m,{context:`Help`});let h=C(m),g=_(`help:dismiss`,`Help`,`esc`),v=b(),y=t.filter(e=>v.has(e.name)&&!e.isHidden),x=t.filter(e=>!v.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(c,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(c,{title:`commands`,children:(0,z.jsx)(j,{commands:y,maxHeight:d,columns:s,title:`Browse default commands:`,onCancel:m})},`commands`)),S.push((0,z.jsx)(c,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:x,maxHeight:d,columns:s,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:m})},`custom`)),(0,z.jsx)(n,{flexDirection:`column`,height:p?void 0:d,children:(0,z.jsxs)(f,{color:`professionalBlue`,children:[(0,z.jsx)(u,{title:`Work Mate v0.0.27`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsxs)(i,{children:[`For more help: `,(0,z.jsx)(r,{url:`https://code.workmate.com/docs/en/overview`})]})}),(0,z.jsx)(n,{marginTop:1,children:(0,z.jsx)(i,{dimColor:!0,children:h.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,z.jsxs)(i,{italic:!0,children:[g,` to cancel`]})})})]})})}var z,B=e((()=>{w(),g(),m(),D(),v(),d(),y(),P(),L(),z=p()})),V,H;e((()=>{B(),V=p(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-QyzA_cFM.js";import{Pt as i,X as a,at as o}from"./state-CXY-q5gr.js";import{$ as s,C as c,I as l,N as u,S as d,c as f,et as p,f as m,h,i as g,x as _}from"./debug-2pVES-2G.js";import{n as v,r as y}from"./lockfile-D_9vif6E.js";import{n as b,t as x}from"./sleep-xKMbXTJe.js";import{a as S,i as C,n as w,r as T}from"./pasteStore-njJCBMKr.js";import{join as E}from"path";import{appendFile as D,writeFile as O}from"fs/promises";function k(e){return(e.match(/\r\n|\r|\n/g)||[]).length}function A(e,t){return t===0?`[Pasted text #${e}]`:`[Pasted text #${e} +${t} lines]`}function j(e){return`[Image #${e}]`}function M(e){return[...e.matchAll(/\[(Pasted text|Image|\.\.\.Truncated text) #(\d+)(?: \+\d+ lines)?(\.)*\]/g)].map(e=>({id:parseInt(e[2]||`0`,10),match:e[0],index:e.index})).filter(e=>e.id>0)}function N(e,t){let n=M(e),r=e;for(let e=n.length-1;e>=0;e--){let i=n[e],a=t[i.id];a?.type===`text`&&(r=r.slice(0,i.index)+a.content+r.slice(i.index+i.match.length))}return r}function P(e){return d(e)}async function*F(){let e=o();for(let e=q.length-1;e>=0;e--)yield q[e];let n=E(t(),`history.jsonl`);try{for await(let t of h(n))try{let n=P(t);if(n.sessionId===e&&Q.has(n.timestamp))continue;yield n}catch(e){f(`Failed to parse history line: ${e}`)}}catch(e){if(u(e)===`ENOENT`)return;throw e}}async function*I(){for await(let e of F())yield await z(e)}async function*L(){let e=a(),t=o(),n=[],r=0;for await(let i of F())if(!(!i||typeof i.project!=`string`)&&i.project===e&&(i.sessionId===t?(yield await z(i),r++):n.push(i),r+n.length>=G))break;for(let e of n){if(r>=G)return;yield await z(e),r++}}async function R(e){if(e.content)return{id:e.id,type:e.type,content:e.content,mediaType:e.mediaType,filename:e.filename};if(e.contentHash){let t=await C(e.contentHash);if(t)return{id:e.id,type:e.type,content:t,mediaType:e.mediaType,filename:e.filename}}return null}async function z(e){let t={};for(let[n,r]of Object.entries(e.pastedContents||{})){let e=await R(r);e&&(t[Number(n)]=e)}return{display:e.display,pastedContents:t}}async function B(){if(q.length===0)return;let e;try{let n=E(t(),`history.jsonl`);await O(n,``,{encoding:`utf8`,mode:384,flag:`a`}),e=await y(n,{stale:1e4,retries:{retries:3,minTimeout:50}});let r=q.map(e=>`${c(e)}\n`);q=[],await D(n,r.join(``),{mode:384})}catch(e){f(`Failed to write prompt history: ${e}`)}finally{e&&await e()}}async function V(e){if(!(J||q.length===0)&&!(e>5)){J=!0;try{await B()}finally{J=!1,q.length>0&&(await b(500),V(e+1))}}}async function H(e){let t=typeof e==`string`?{display:e,pastedContents:{}}:e,n={};if(t.pastedContents){for(let[e,r]of Object.entries(t.pastedContents))if(r.type!==`image`)if(r.content.length<=K)n[Number(e)]={id:r.id,type:r.type,content:r.content,mediaType:r.mediaType,filename:r.filename};else{let t=w(r.content);n[Number(e)]={id:r.id,type:r.type,contentHash:t,mediaType:r.mediaType,filename:r.filename},S(t,r.content)}}let r={...t,pastedContents:n,timestamp:Date.now(),project:a(),sessionId:o()};q.push(r),Z=r,Y=V(0)}function U(e){n(process.env.WORKMATE_SKIP_PROMPT_HISTORY)||(X||(X=!0,p(async()=>{Y&&await Y,q.length>0&&await B()})),H(e))}function W(){if(!Z)return;let e=Z;Z=null;let t=q.lastIndexOf(e);t===-1?Q.add(e.timestamp):q.splice(t,1)}var G,K,q,J,Y,X,Z,Q,$=e((()=>{i(),s(),g(),r(),l(),m(),v(),T(),x(),_(),G=100,K=1024,q=[],J=!1,Y=null,X=!1,Z=null,Q=new Set}));export{L as a,I as c,A as i,M as l,N as n,k as o,j as r,$ as s,U as t,W as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mn as e,on as t,qt as n}from"./loadAgentsDir-uuZYOgKn.js";e();export{n as executeSessionEndHooks,t as getSessionEndHookTimeoutMs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{I as o,Lt as s,P as c,Wt as l,ai as u,t as d,y as f}from"./src-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{I as o,Lt as s,P as c,Wt as l,ai as u,t as d,y as f}from"./src-BX54x08P.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{d as m,m as h,s as g}from"./settings-D4M13toi.js";import{Pt as _,tt as v}from"./state-CXY-q5gr.js";import{Bh as y,Cd as b,Dc as x,Dd as S,Ec as C,Ed as w,Gh as T,Kh as E,Sd as D,Td as O,Vh as k,tb as A,wd as j,xd as M,zh as ee}from"./loadAgentsDir-uuZYOgKn.js";import{n as te}from"./analytics-COpjZpvd.js";import{l as N,o as P}from"./stringUtils-Cs6E5f-B.js";import{n as F,t as I}from"./select-BuTJbu_Q.js";function ne(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=R(t);M(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=v();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}}}return n}function re(e,t){return S(Object.keys(e[t]||{}),e,t)}function ie(e,t,n){let r=n??``;return e[t]?.[r]??[]}function L(e,t){return R(t)[e].matcherMetadata}var R,ae=e((()=>{r(),_(),w(),R=n(e=>({PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
|
|
2
2
|
Exit code 0 - stdout/stderr not shown
|
|
3
3
|
Exit code 2 - show stderr to model and block tool call
|
|
4
4
|
Other exit codes - show stderr to user only but continue with tool call`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUse:{summary:`After tool execution`,description:`Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
|
|
@@ -76,4 +76,4 @@ CLAUDE_ENV_FILE is set — write bash exports there to apply env to subsequent B
|
|
|
76
76
|
The matcher field specifies filenames to watch in the current directory (e.g. ".envrc|.env").
|
|
77
77
|
Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to dynamically update the watch list.
|
|
78
78
|
Exit code 0 - command completes successfully
|
|
79
|
-
Other exit codes - show stderr to user only`}}),e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:l}){return(0,B.jsx)(f,{title:`Hooks`,subtitle:`${n} ${
|
|
79
|
+
Other exit codes - show stderr to user only`}}),e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:l}){return(0,B.jsx)(f,{title:`Hooks`,subtitle:`${n} ${N(n,`hook`)} configured`,onCancel:l,children:(0,B.jsxs)(o,{flexDirection:`column`,gap:1,children:[r&&(0,B.jsxs)(o,{flexDirection:`column`,children:[(0,B.jsxs)(c,{color:`suggestion`,children:[a.info,` Hooks Restricted by Policy`]}),(0,B.jsx)(c,{dimColor:!0,children:`Only hooks from managed settings can run. User-defined hooks from ~/.workmate/settings.json, .workmate/settings.json, and .workmate/settings.local.json are blocked.`})]}),(0,B.jsx)(o,{flexDirection:`column`,children:(0,B.jsxs)(c,{dimColor:!0,children:[a.info,` This menu is read-only. To add or modify hooks, edit settings.json directly or ask Work Mate.`,` `,(0,B.jsx)(s,{url:`https://code.workmate.com/docs/en/hooks`,children:`Learn more`})]})}),(0,B.jsx)(o,{flexDirection:`column`,children:(0,B.jsx)(I,{onChange:e=>{i(e)},onCancel:l,options:Object.entries(e).map(([e,n])=>{let r=t[e]||0;return{label:r>0?(0,B.jsxs)(c,{children:[e,` `,(0,B.jsxs)(c,{color:`suggestion`,children:[`(`,r,`)`]})]}):e,value:e,description:n.summary}})})})]})})}var B,V=e((()=>{i(),d(),P(),F(),B=p()}));function H({selectedEvent:e,selectedMatcher:t,hooksForSelectedMatcher:n,hookEventMetadata:r,onSelect:i,onCancel:a}){let s=r.matcherMetadata===void 0?e:`${e} - Matcher: ${t||`(all)`}`;return n.length===0?(0,U.jsx)(f,{title:s,subtitle:r.description,onCancel:a,inputGuide:()=>(0,U.jsx)(c,{children:`Esc to go back`}),children:(0,U.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,U.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,U.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Work Mate.`})]})}):(0,U.jsx)(f,{title:s,subtitle:r.description,onCancel:a,children:(0,U.jsx)(o,{flexDirection:`column`,children:(0,U.jsx)(I,{options:n.map((e,t)=>({label:`[${e.config.type}] ${D(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${j(e.source)} (${e.pluginName})`:j(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{d(),w(),F(),U=p()}));function G({selectedEvent:e,matchersForSelectedEvent:t,hooksByEventAndMatcher:n,eventDescription:r,onSelect:i,onCancel:a}){let s=K.useMemo(()=>t.map(t=>{let r=n[e]?.[t]||[];return{matcher:t,sources:Array.from(new Set(r.map(e=>e.source))),hookCount:r.length}}),[t,n,e]);return t.length===0?(0,q.jsx)(f,{title:`${e} - Matchers`,subtitle:r,onCancel:a,inputGuide:()=>(0,q.jsx)(c,{children:`Esc to go back`}),children:(0,q.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,q.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Work Mate.`})]})}):(0,q.jsx)(f,{title:`${e} - Matchers`,subtitle:r,onCancel:a,children:(0,q.jsx)(o,{flexDirection:`column`,children:(0,q.jsx)(I,{options:s.map(e=>({label:`[${e.sources.map(O).join(`, `)}] ${e.matcher||`(all)`}`,value:e.matcher,description:`${e.hookCount} ${N(e.hookCount,`hook`)}`})),onChange:e=>{i(e)},onCancel:a})})})}var K,q,oe=e((()=>{K=t(u(),1),d(),w(),P(),F(),q=p()}));function se({selectedHook:e,eventSupportsMatcher:t,onCancel:n}){return(0,J.jsx)(f,{title:`Hook details`,onCancel:n,inputGuide:()=>(0,J.jsx)(c,{children:`Esc to go back`}),children:(0,J.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(c,{children:[`Event: `,(0,J.jsx)(c,{bold:!0,children:e.event})]}),t&&(0,J.jsxs)(c,{children:[`Matcher: `,(0,J.jsx)(c,{bold:!0,children:e.matcher||`(all)`})]}),(0,J.jsxs)(c,{children:[`Type: `,(0,J.jsx)(c,{bold:!0,children:e.config.type})]}),(0,J.jsxs)(c,{children:[`Source: `,(0,J.jsx)(c,{dimColor:!0,children:b(e.source)})]}),e.pluginName&&(0,J.jsxs)(c,{children:[`Plugin: `,(0,J.jsx)(c,{dimColor:!0,children:e.pluginName})]})]}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(c,{dimColor:!0,children:[ce(e.config),`:`]}),(0,J.jsx)(o,{borderStyle:`round`,borderDimColor:!0,paddingLeft:1,paddingRight:1,children:(0,J.jsx)(c,{children:le(e.config)})})]}),`statusMessage`in e.config&&e.config.statusMessage&&(0,J.jsxs)(c,{children:[`Status message: `,(0,J.jsx)(c,{dimColor:!0,children:e.config.statusMessage})]}),(0,J.jsx)(c,{dimColor:!0,children:`To modify or remove this hook, edit settings.json directly or ask Work Mate to help.`})]})})}function ce(e){switch(e.type){case`command`:return`Command`;case`prompt`:return`Prompt`;case`agent`:return`Prompt`;case`http`:return`URL`}}function le(e){switch(e.type){case`command`:return e.command;case`prompt`:return e.prompt;case`agent`:return e.prompt;case`http`:return e.url}}var J,ue=e((()=>{d(),w(),J=p()}));function Y({toolNames:e,onExit:t}){let[n,r]=(0,X.useState)({mode:`select-event`}),[i,a]=(0,X.useState)(()=>m()?.disableAllHooks===!0&&g(`policySettings`)?.disableAllHooks===!0),[s,u]=(0,X.useState)(()=>g(`policySettings`)?.allowManagedHooksOnly===!0);E(e=>{if(e===`policySettings`){let e=m()?.disableAllHooks===!0;a(e&&g(`policySettings`)?.disableAllHooks===!0),u(g(`policySettings`)?.allowManagedHooksOnly===!0)}});let d=n.mode,p=`event`in n?n.event:`PreToolUse`,h=`matcher`in n?n.matcher:null,_=y(e=>e.mcp),v=k(),b=(0,X.useMemo)(()=>[...e,..._.tools.map(e=>e.name)],[e,_.tools]),x=(0,X.useMemo)(()=>ne(v.getState(),b),[b,v]),S=(0,X.useMemo)(()=>re(x,p),[x,p]),C=(0,X.useMemo)(()=>ie(x,p,h),[x,p,h]),w=(0,X.useCallback)(()=>{t(`Hooks dialog dismissed`,{display:`system`})},[t]);l(`confirm:no`,w,{context:`Confirmation`,isActive:d===`select-event`}),l(`confirm:no`,()=>{r({mode:`select-event`})},{context:`Confirmation`,isActive:d===`select-matcher`}),l(`confirm:no`,()=>{`event`in n&&(L(n.event,b)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event}))},{context:`Confirmation`,isActive:d===`select-hook`}),l(`confirm:no`,()=>{if(n.mode===`view-hook`){let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}},{context:`Confirmation`,isActive:d===`view-hook`});let T=R(b),D=m()?.disableAllHooks===!0,{hooksByEvent:O,totalHooksCount:A}=(0,X.useMemo)(()=>{let e={},t=0;for(let[n,r]of Object.entries(x)){let i=Object.values(r).reduce((e,t)=>e+t.length,0);e[n]=i,t+=i}return{hooksByEvent:e,totalHooksCount:t}},[x]);if(D)return(0,Z.jsx)(f,{title:`Hook Configuration - Disabled`,onCancel:w,inputGuide:()=>(0,Z.jsx)(c,{children:`Esc to close`}),children:(0,Z.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,Z.jsxs)(o,{flexDirection:`column`,children:[(0,Z.jsxs)(c,{children:[`All hooks are currently `,(0,Z.jsx)(c,{bold:!0,children:`disabled`}),i&&` by a managed settings file`,`. You have `,(0,Z.jsx)(c,{bold:!0,children:A}),` `,`configured `,N(A,`hook`),` that `,N(A,`is`,`are`),` not running.`]}),(0,Z.jsx)(o,{marginTop:1,children:(0,Z.jsx)(c,{dimColor:!0,children:`When hooks are disabled:`})}),(0,Z.jsx)(c,{dimColor:!0,children:`· No hook commands will execute`}),(0,Z.jsx)(c,{dimColor:!0,children:`· StatusLine will not be displayed`}),(0,Z.jsx)(c,{dimColor:!0,children:`· Tool operations will proceed without hook validation`})]}),!i&&(0,Z.jsx)(c,{dimColor:!0,children:`To re-enable hooks, remove "disableAllHooks" from settings.json or ask Work Mate.`})]})});switch(n.mode){case`select-event`:return(0,Z.jsx)(z,{hookEventMetadata:T,hooksByEvent:O,totalHooksCount:A,restrictedByPolicy:s,onSelectEvent:e=>{L(e,b)===void 0?r({mode:`select-hook`,event:e,matcher:``}):r({mode:`select-matcher`,event:e})},onCancel:w});case`select-matcher`:return(0,Z.jsx)(G,{selectedEvent:n.event,matchersForSelectedEvent:S,hooksByEventAndMatcher:x,eventDescription:T[n.event].description,onSelect:e=>{r({mode:`select-hook`,event:n.event,matcher:e})},onCancel:()=>{r({mode:`select-event`})}});case`select-hook`:return(0,Z.jsx)(H,{selectedEvent:n.event,selectedMatcher:n.matcher,hooksForSelectedMatcher:C,hookEventMetadata:T[n.event],onSelect:e=>{r({mode:`view-hook`,event:n.event,hook:e})},onCancel:()=>{L(n.event,b)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event})}});case`view-hook`:return(0,Z.jsx)(se,{selectedHook:n.hook,eventSupportsMatcher:L(n.event,b)!==void 0,onCancel:()=>{let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}})}}var X,Z,de=e((()=>{X=t(u(),1),ee(),T(),d(),A(),ae(),h(),P(),V(),W(),oe(),ue(),Z=p()})),Q,$;e((()=>{de(),te(),x(),Q=p(),$=async(e,t)=>{let n=t.getAppState().toolPermissionContext;return(0,Q.jsx)(Y,{toolNames:C(n).map(e=>e.name),onExit:e})}}))();export{$ as call};
|