@readmagic/workmate 0.0.24 → 0.0.26

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.
Files changed (436) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-mS8iUoWY.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-BHBkysy0.js +1 -0
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +1 -0
  4. package/dist/chunks/App-D--vtCyq.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +2 -0
  6. package/dist/chunks/BypassPermissionsModeDialog-DyqI98d2.js +1 -0
  7. package/dist/chunks/CustomSelect-CpMbxYbt.js +1 -0
  8. package/dist/chunks/DiffDialog-BQAU2pJx.js +6 -0
  9. package/dist/chunks/Doctor-BU69VQzw.js +1 -0
  10. package/dist/chunks/Doctor-DJOMbSDE.js +3 -0
  11. package/dist/chunks/ExitFlow-xBOnvhiW.js +2 -0
  12. package/dist/chunks/InvalidConfigDialog-NiuhcaG5.js +1 -0
  13. package/dist/chunks/{InvalidSettingsDialog-iwh8H52b.js → InvalidSettingsDialog-DrromC1I.js} +1 -1
  14. package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +1 -0
  15. package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +1 -0
  16. package/dist/chunks/MCPToolListView-BRxjOaOL.js +1 -0
  17. package/dist/chunks/McpParsingWarnings-BYG2yqjO.js +1 -0
  18. package/dist/chunks/MessageSelector-B7xAQqZI.js +3 -0
  19. package/dist/chunks/Messages-CxMsfjOa.js +10 -0
  20. package/dist/chunks/Onboarding-CkATe87e.js +1 -0
  21. package/dist/chunks/{PermissionDialog-BaibiQae.js → PermissionDialog-tEMMa5-a.js} +1 -1
  22. package/dist/chunks/{PressEnterToContinue-DZc_s_pE.js → PressEnterToContinue-CPOaYnym.js} +1 -1
  23. package/dist/chunks/PromptInputFooterSuggestions-CwqAsTI2.js +1 -0
  24. package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +1 -0
  25. package/dist/chunks/{ProviderSetup-BCSPsvfv.js → ProviderSetup-J6Ty-Wj8.js} +1 -1
  26. package/dist/chunks/QueryEngine-Mdi_kUaL.js +1 -0
  27. package/dist/chunks/REPL-BgzQtSFF.js +1 -0
  28. package/dist/chunks/REPL-rirm6s_7.js +124 -0
  29. package/dist/chunks/ResumeConversation-Cmsbo5m7.js +1 -0
  30. package/dist/chunks/{SearchBox-C9xxQzh1.js → SearchBox-DQBLKyzJ.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +1 -0
  32. package/dist/chunks/{SelectMulti-BQRHed-d.js → SelectMulti-BpAjjhsn.js} +1 -1
  33. package/dist/chunks/Settings-B6DImvca.js +2 -0
  34. package/dist/chunks/Spinner-DhhSOFcN.js +1 -0
  35. package/dist/chunks/{SpinnerGlyph-CmkRUvHe.js → SpinnerGlyph-CmVXC-_9.js} +1 -1
  36. package/dist/chunks/TextInput-BboKIug2.js +22 -0
  37. package/dist/chunks/ThemePicker-DTpXbEY0.js +1 -0
  38. package/dist/chunks/TrustDialog-CZ8JpySm.js +1 -0
  39. package/dist/chunks/{ValidationErrorsList-DgNzJQUP.js → ValidationErrorsList-C_gDQfm1.js} +1 -1
  40. package/dist/chunks/_baseEach-DGbaIpJA.js +1 -0
  41. package/dist/chunks/_baseSlice-D67_NpZ1.js +1 -0
  42. package/dist/chunks/add-dir-B576wzi9.js +1 -0
  43. package/dist/chunks/{agentDisplay-M4pfwbMC.js → agentDisplay-ZuFoBZYu.js} +1 -1
  44. package/dist/chunks/{agents-DddX7lLX.js → agents-Dy4_hDic.js} +1 -1
  45. package/dist/chunks/agents-HIOBiw4w.js +101 -0
  46. package/dist/chunks/allErrors-CxPNR2WN.js +1 -0
  47. package/dist/chunks/analytics-COpjZpvd.js +1 -0
  48. package/dist/chunks/appleTerminalBackup-C9kjzdM9.js +1 -0
  49. package/dist/chunks/backgroundHousekeeping-PyLNnGdw.js +1 -0
  50. package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +1 -0
  51. package/dist/chunks/banner-DqFectPg.js +2 -0
  52. package/dist/chunks/branch-B_BL5N9N.js +2 -0
  53. package/dist/chunks/{break-cache-BMXqFTeS.js → break-cache-DL95nKZl.js} +2 -2
  54. package/dist/chunks/btw-Y44ctueB.js +1 -0
  55. package/dist/chunks/bundledMode-BxyD5cqq.js +1 -0
  56. package/dist/chunks/caches-5xZ4dSXt.js +1 -0
  57. package/dist/chunks/caches-Be9saXxV.js +1 -0
  58. package/dist/chunks/{claudeDesktop-D8ml2767.js → claudeDesktop-g8eUUY2E.js} +1 -1
  59. package/dist/chunks/{clear-B8ZtFPOK.js → clear-DtTkA707.js} +1 -1
  60. package/dist/chunks/{client-CpTCeWba.js → client-Bw_L3lSc.js} +1 -1
  61. package/dist/chunks/{client-4iqhC8xq.js → client-aJ2Nr_sh.js} +1 -1
  62. package/dist/chunks/client-mnUISv_N.js +1 -0
  63. package/dist/chunks/client-wPqIdEVm.js +1 -0
  64. package/dist/chunks/commands-wfE12a4L.js +1 -0
  65. package/dist/chunks/compact-CvNOtu7J.js +2 -0
  66. package/dist/chunks/config-D3K87Mm1.js +3 -0
  67. package/dist/chunks/config-DTga6Ku8.js +1 -0
  68. package/dist/chunks/config-DtmqWusU.js +1 -0
  69. package/dist/chunks/context-Opu4E8dL.js +1 -0
  70. package/dist/chunks/{context-noninteractive-C7wrRZnM.js → context-noninteractive-B1V2Mp26.js} +5 -5
  71. package/dist/chunks/context-noninteractive-eIlneYiL.js +1 -0
  72. package/dist/chunks/conversation-CG_z7TLE.js +1 -0
  73. package/dist/chunks/conversation-CHesBfFZ.js +1 -0
  74. package/dist/chunks/conversationRecovery-OhitW-7g.js +1 -0
  75. package/dist/chunks/crossProjectResume-mmYx8PrZ.js +40 -0
  76. package/dist/chunks/cwd-BH2f3u0o.js +1 -0
  77. package/dist/chunks/cwd-DrEEb4f5.js +1 -0
  78. package/dist/chunks/debug-kBjDaVkQ.js +39 -0
  79. package/dist/chunks/{detectRepository-CfX8Lc0A.js → detectRepository-M6K2wc7h.js} +1 -1
  80. package/dist/chunks/{diff-DdpHThJ7.js → diff-Cv7tX2-P.js} +1 -1
  81. package/dist/chunks/{directoryCompletion-D_Rtg-4j.js → directoryCompletion-BHyjyKAM.js} +1 -1
  82. package/dist/chunks/doctor-DeBG5SL5.js +1 -0
  83. package/dist/chunks/entry-CbhyIWgj.js +13 -0
  84. package/dist/chunks/envUtils-DZ_SvEVz.js +1 -0
  85. package/dist/chunks/{esm-CGx9qY3q.js → esm-DUH16IqH.js} +1 -1
  86. package/dist/chunks/execAsync-D6SA-YsV.js +1 -0
  87. package/dist/chunks/execFileNoThrow-BfZFnCGa.js +1 -0
  88. package/dist/chunks/execa-CBhG1doD.js +34 -0
  89. package/dist/chunks/exit-OKEV_ddw.js +1 -0
  90. package/dist/chunks/extraUsage-BlRL3yeb.js +1 -0
  91. package/dist/chunks/extractMemories-jnsv-_n_.js +1 -0
  92. package/dist/chunks/fast-4I_qPJCd.js +1 -0
  93. package/dist/chunks/fast-DiolM1M7.js +1 -0
  94. package/dist/chunks/fetchModelList-BRFTQim4.js +1 -0
  95. package/dist/chunks/fetchModelList-qPKAuu4m.js +1 -0
  96. package/dist/chunks/fileSuggestions-iWVXvvLB.js +3 -0
  97. package/dist/chunks/firstPartyEventLogger-CN9UOmEC.js +1 -0
  98. package/dist/chunks/firstPartyEventLogger-RR5rvDtk.js +1 -0
  99. package/dist/chunks/{fpsMetrics-wxj9GAsd.js → fpsMetrics-Ixd0J4CH.js} +1 -1
  100. package/dist/chunks/{gemini-C_ApXgwc.js → gemini-BfVyavwQ.js} +2 -2
  101. package/dist/chunks/generateSessionName-CGaTTXCA.js +1 -0
  102. package/dist/chunks/genericProcessUtils-CVtQOTO2.js +12 -0
  103. package/dist/chunks/getMachineId-bsd-DTYGimUN.js +1 -0
  104. package/dist/chunks/getMachineId-darwin-DqIFUVvd.js +2 -0
  105. package/dist/chunks/getMachineId-linux-CnCTmdzd.js +1 -0
  106. package/dist/chunks/getMachineId-unsupported-Cx21ssu1.js +1 -0
  107. package/dist/chunks/getMachineId-win-vZhex7KX.js +1 -0
  108. package/dist/chunks/goal-BidR-GFa.js +3 -0
  109. package/dist/chunks/grok-DLcuI-U7.js +1 -0
  110. package/dist/chunks/help-CZuvYhXj.js +1 -0
  111. package/dist/chunks/history-BxPGftQw.js +1 -0
  112. package/dist/chunks/hooks-Bg9WIjZQ.js +1 -0
  113. package/dist/chunks/{hooks-DR3IYPJ3.js → hooks-ehqfAM5F.js} +2 -2
  114. package/dist/chunks/install-ACGY0vhM.js +1 -0
  115. package/dist/chunks/instrumentation-B9bfF2mA.js +21 -0
  116. package/dist/chunks/{job-YhJQWgE0.js → job-Coztdn6A.js} +1 -1
  117. package/dist/chunks/keybindings-DwSdLpaE.js +1 -0
  118. package/dist/chunks/launchLocalMemory-DRzfpIOB.js +3 -0
  119. package/dist/chunks/launchOnboarding-D2zFCJf-.js +8 -0
  120. package/dist/chunks/{loadAgentsDir-B0Anodo0.js → loadAgentsDir-DR5PVAc3.js} +590 -594
  121. package/dist/chunks/loadAgentsDir-DqAbnpB-.js +1 -0
  122. package/dist/chunks/{loadPluginHooks-BSwCtQ6T.js → loadPluginHooks-BiQgGfUJ.js} +1 -1
  123. package/dist/chunks/{loader-CICGtLp2.js → loader-6MqzNGmV.js} +1 -1
  124. package/dist/chunks/{localSearch-BxLYi6w_.js → localSearch-CzkxDuOR.js} +1 -1
  125. package/dist/chunks/localSearch-DW3JT2MA.js +1 -0
  126. package/dist/chunks/lockfile-D_9vif6E.js +1 -0
  127. package/dist/chunks/{log-D2TIwHBV.js → log-DWZny1vM.js} +1 -1
  128. package/dist/chunks/logoUtils-DR5T0pr3.js +1 -0
  129. package/dist/chunks/{magicDocs-Bkz7ZcmL.js → magicDocs-BwBxjfLo.js} +2 -2
  130. package/dist/chunks/main-Ryi27wYq.js +345 -0
  131. package/dist/chunks/managedEnv-DCEJh3z3.js +1 -0
  132. package/dist/chunks/managedEnv-Do9fgLpk.js +1 -0
  133. package/dist/chunks/managedEnvConstants-CWcT7nYr.js +1 -0
  134. package/dist/chunks/mcp-BCpnF6wD.js +1 -0
  135. package/dist/chunks/mcp-CJ6SDJEK.js +6 -0
  136. package/dist/chunks/mcp-CZBTxbhu.js +2 -0
  137. package/dist/chunks/memory-BQO6Y0ak.js +1 -0
  138. package/dist/chunks/{modalContext-DDZdU1J8.js → modalContext-CBE8xuck.js} +1 -1
  139. package/dist/chunks/mode-wq70cR44.js +2 -0
  140. package/dist/chunks/model-D42epddJ.js +1 -0
  141. package/dist/chunks/model-DVk9-2dk.js +1 -0
  142. package/dist/chunks/modelOptions-beLgXORr.js +1 -0
  143. package/dist/chunks/nativeInstaller-ChGSz1lb.js +1 -0
  144. package/dist/chunks/{notifications-Bc6k-Ozy.js → notifications-dGBuNvFj.js} +1 -1
  145. package/dist/chunks/onChangeAppState-B4K-rSaF.js +1 -0
  146. package/dist/chunks/open-Cyrr4E5x.js +1 -0
  147. package/dist/chunks/openai-DAwnAV9K.js +2 -0
  148. package/dist/chunks/overlayContext-B6i_6y_0.js +1 -0
  149. package/dist/chunks/{panel-CVS4SK_E.js → panel-C0CF3noE.js} +1 -1
  150. package/dist/chunks/parser-BZt0VFd_.js +1 -0
  151. package/dist/chunks/{parser-Cg6hSCmn.js → parser-DThLwgdM.js} +1 -1
  152. package/dist/chunks/partition-BRQHofxD.js +1 -0
  153. package/dist/chunks/{pasteStore-P0zP-ch0.js → pasteStore-BmehVo5j.js} +1 -1
  154. package/dist/chunks/permissions-DkfWKN-B.js +3 -0
  155. package/dist/chunks/pidLock-YvAaIrIY.js +3 -0
  156. package/dist/chunks/plan-B6U3ioer.js +1 -0
  157. package/dist/chunks/platform-Vl9IynC3.js +2 -0
  158. package/dist/chunks/plugin-CTA2_-F7.js +17 -0
  159. package/dist/chunks/{pluginAutoupdate-ennb9k8_.js → pluginAutoupdate-Dy5W3HWE.js} +1 -1
  160. package/dist/chunks/{pluginBlocklist-9OrNEh--.js → pluginBlocklist-DAoUENwc.js} +1 -1
  161. package/dist/chunks/pluginCliCommands-CaHnj0C_.js +1 -0
  162. package/dist/chunks/{pluginFlagging-js_-WmYj.js → pluginFlagging-BCj9LJP3.js} +1 -1
  163. package/dist/chunks/pluginOperations-ClXNOOG6.js +2 -0
  164. package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +1 -0
  165. package/dist/chunks/{pluginStartupCheck-SRXOyqr7.js → pluginStartupCheck-U8_xk25t.js} +1 -1
  166. package/dist/chunks/plugins-D7zyI9c4.js +4 -0
  167. package/dist/chunks/{poller-CpLBoB-N.js → poller-BeyVwHAf.js} +1 -1
  168. package/dist/chunks/poorMode-DtzWNhsY.js +1 -0
  169. package/dist/chunks/poorMode-Ocff_UT1.js +1 -0
  170. package/dist/chunks/print-BzljdXem.js +13 -0
  171. package/dist/chunks/processBashCommand-RUkmyAl4.js +1 -0
  172. package/dist/chunks/processSlashCommand-DRLO-jNV.js +5 -0
  173. package/dist/chunks/{projectContext-5fmRr6Sd.js → projectContext-COeHKDrk.js} +1 -1
  174. package/dist/chunks/{projectContext-DhtjLv3k.js → projectContext-QN5U3Ggr.js} +1 -1
  175. package/dist/chunks/{projectOnboardingState-B5YATuc6.js → projectOnboardingState-KqcpRXls.js} +1 -1
  176. package/dist/chunks/{prompt-CJ1l3XXk.js → prompt-CTByhpUI.js} +21 -21
  177. package/dist/chunks/prompt-DTpfW6yP.js +1 -0
  178. package/dist/chunks/prompt-D__eHY_5.js +1 -0
  179. package/dist/chunks/promptEditor-CpUFgGzc.js +4 -0
  180. package/dist/chunks/protocolHandler-BQSLVGnG.js +13 -0
  181. package/dist/chunks/{proxy-CDBfZjO7.js → proxy-BtWuysHM.js} +2 -2
  182. package/dist/chunks/reconciler-D6BUq8WB.js +1 -0
  183. package/dist/chunks/refresh-B4pqFp12.js +1 -0
  184. package/dist/chunks/reject-C6IvUvBt.js +1 -0
  185. package/dist/chunks/{reload-plugins-CQZFQLWP.js → reload-plugins-DXQqk7q6.js} +1 -1
  186. package/dist/chunks/rename-D4XBmTBI.js +1 -0
  187. package/dist/chunks/{renderOptions-DV0dn0IW.js → renderOptions-DkP98P_d.js} +1 -1
  188. package/dist/chunks/resume-DzIev0JI.js +2 -0
  189. package/dist/chunks/ripgrep-CYP26Fhg.js +1 -0
  190. package/dist/chunks/ripgrep-D1f1pbCz.js +5 -0
  191. package/dist/chunks/{runtimeObserver-PJ1o8GRA.js → runtimeObserver-BPqlbu0B.js} +4 -4
  192. package/dist/chunks/{runtimeObserver-DEuR8z0f.js → runtimeObserver-BUHs3qjs.js} +1 -1
  193. package/dist/chunks/sandbox-adapter-CumL75tU.js +1 -0
  194. package/dist/chunks/sandbox-toggle-CTtET6Xq.js +1 -0
  195. package/dist/chunks/searchExtraTools-BMCU2zEf.js +1 -0
  196. package/dist/chunks/select-FrwoTzuc.js +1 -0
  197. package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +1 -0
  198. package/dist/chunks/{sessionObserver-BtKjvteq.js → sessionObserver-B6xzxckA.js} +2 -2
  199. package/dist/chunks/sessionObserver-CBrM4opL.js +1 -0
  200. package/dist/chunks/sessionStorage-C1EAxDWG.js +1 -0
  201. package/dist/chunks/sessionTracing-UFK96PxT.js +11 -0
  202. package/dist/chunks/settings-BK6gCko-.js +1 -0
  203. package/dist/chunks/settings-YIDksG5Z.js +24 -0
  204. package/dist/chunks/setup-BBvZyrfz.js +3 -0
  205. package/dist/chunks/{shadowedRuleDetection-Bg_aIc5Z.js → shadowedRuleDetection-D6R2OeoH.js} +1 -1
  206. package/dist/chunks/{sideQuestion-D49GsfH7.js → sideQuestion-5jcbOMsR.js} +3 -3
  207. package/dist/chunks/sinks-B-kFqjjd.js +1 -0
  208. package/dist/chunks/sinks-DB_D4lmu.js +1 -0
  209. package/dist/chunks/skillChangeDetector-103-nEle.js +1 -0
  210. package/dist/chunks/{skillGapStore-CcFoHNLl.js → skillGapStore-DOz1KCqo.js} +2 -2
  211. package/dist/chunks/{skillLifecycle-Bnz_4wE5.js → skillLifecycle-D9NkIwFQ.js} +2 -2
  212. package/dist/chunks/{skillSearchPanel-C_5yUhqn.js → skillSearchPanel-DFiSZaJ4.js} +4 -4
  213. package/dist/chunks/skills-DgeLr52a.js +1 -0
  214. package/dist/chunks/sleep-BbWr_FL1.js +1 -0
  215. package/dist/chunks/{src-CiJCsqUl.js → src-C8gyNm5a.js} +1 -1
  216. package/dist/chunks/{src-9vmGsuSI.js → src-Cy5_qH26.js} +1 -1
  217. package/dist/chunks/src-Db7K3F_i.js +3 -0
  218. package/dist/chunks/{src-DL3w8VPk.js → src-WZ94ZKI3.js} +4 -4
  219. package/dist/chunks/startupProfiler-DIM_Ihyp.js +3 -0
  220. package/dist/chunks/startupProfiler-FpGsKWYk.js +1 -0
  221. package/dist/chunks/{state-B4jiUise.js → state-CXY-q5gr.js} +1 -1
  222. package/dist/chunks/state-DXt6rahM.js +1 -0
  223. package/dist/chunks/{staticRender-BVWx0IM1.js → staticRender-RHUIg5ln.js} +1 -1
  224. package/dist/chunks/status-CKLecQZV.js +1 -0
  225. package/dist/chunks/statusNoticeHelpers-DI45AH-c.js +1 -0
  226. package/dist/chunks/stringUtils-D_xPrwGQ.js +4 -0
  227. package/dist/chunks/switcher-D2Z2ZNQ0.js +1 -0
  228. package/dist/chunks/switcher-DhZCaAun.js +1 -0
  229. package/dist/chunks/{tasks-DdcUQEeD.js → tasks-6suPhqsK.js} +1 -1
  230. package/dist/chunks/{templateJobs-C8qsPrLj.js → templateJobs-BKVEWCsb.js} +1 -1
  231. package/dist/chunks/{terminalSetup-qc2PlvOm.js → terminalSetup-7PUR4hfo.js} +1 -1
  232. package/dist/chunks/{terminalSetup-B_10N_gE.js → terminalSetup-Cqy5_PhJ.js} +4 -4
  233. package/dist/chunks/{theme-f1h2QI8J.js → theme-B-HG2PUs.js} +1 -1
  234. package/dist/chunks/tipRegistry-BR_lSGRw.js +2 -0
  235. package/dist/chunks/{toolEventObserver-7QP38x4t.js → toolEventObserver-BY3QVnr6.js} +1 -1
  236. package/dist/chunks/toolPool-BcwIF8Q_.js +1 -0
  237. package/dist/chunks/{types-Dx7P7JLQ.js → types-CD25a50S.js} +16 -16
  238. package/dist/chunks/udsClient-CCxgLiZy.js +1 -0
  239. package/dist/chunks/urlHandler-BNsQKqba.js +1 -0
  240. package/dist/chunks/{use-select-navigation-hWL5VHnL.js → use-select-navigation-CW5alA9r.js} +1 -1
  241. package/dist/chunks/{useDoublePress-C9xxQzh1.js → useDoublePress-DQBLKyzJ.js} +1 -1
  242. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BgJrnuDl.js +1 -0
  243. package/dist/chunks/useMainLoopModel-BVgJo4hN.js +1 -0
  244. package/dist/chunks/useManagePlugins-CrWjzESW.js +1 -0
  245. package/dist/chunks/useMergedTools-r6GQq5mI.js +1 -0
  246. package/dist/chunks/useSearchInput-BITV_Txn.js +1 -0
  247. package/dist/chunks/useSettingsErrors-CO0fTNzn.js +1 -0
  248. package/dist/chunks/util-_zo3I1y8.js +1 -0
  249. package/dist/chunks/validatePlugin-DFGdRhA-.js +1 -0
  250. package/dist/chunks/vim-qgMS88ss.js +1 -0
  251. package/dist/chunks/worktree-CR_M6Qfy.js +1 -0
  252. package/dist/cli.js +1 -1
  253. package/package.json +1 -12
  254. package/scripts/postinstall.cjs +16 -16
  255. package/dist/chunks/AddWorkspaceDirectory-Ch8IcWXO.js +0 -1
  256. package/dist/chunks/AgentsMdExternalIncludesDialog-Cyia0s4g.js +0 -1
  257. package/dist/chunks/AgentsMdExternalIncludesDialog-LjI_H_Au.js +0 -1
  258. package/dist/chunks/App-BOqh_1tN.js +0 -1
  259. package/dist/chunks/BackgroundTasksDialog-CSEuuoq9.js +0 -2
  260. package/dist/chunks/BypassPermissionsModeDialog-CwfCwUr9.js +0 -1
  261. package/dist/chunks/CustomSelect-wmZ9jz0W.js +0 -1
  262. package/dist/chunks/DiffDialog-BpXIEWiE.js +0 -6
  263. package/dist/chunks/Doctor-CMpr7tdf.js +0 -1
  264. package/dist/chunks/Doctor-DqW6j3_B.js +0 -3
  265. package/dist/chunks/ExitFlow-DacaBTlk.js +0 -2
  266. package/dist/chunks/Grove-CNqYPWI6.js +0 -11
  267. package/dist/chunks/InvalidConfigDialog-0TMJItCC.js +0 -1
  268. package/dist/chunks/KeybindingProviderSetup-D49HHTXD.js +0 -1
  269. package/dist/chunks/MCPConnectionManager-Cie77ZAK.js +0 -1
  270. package/dist/chunks/MCPToolListView-B4ehtkXd.js +0 -1
  271. package/dist/chunks/McpParsingWarnings-Bff66RtJ.js +0 -1
  272. package/dist/chunks/MessageSelector-Dpd6Iywp.js +0 -3
  273. package/dist/chunks/Messages-DN7M3oS_.js +0 -10
  274. package/dist/chunks/Onboarding-CQmE3rUf.js +0 -1
  275. package/dist/chunks/PromptInputFooterSuggestions-HI6HH3TP.js +0 -1
  276. package/dist/chunks/PromptInputHelpMenu-3QNUC2Cg.js +0 -1
  277. package/dist/chunks/QueryEngine-DdLWvJv6.js +0 -1
  278. package/dist/chunks/REPL-BqO9KcK_.js +0 -124
  279. package/dist/chunks/REPL-CmZmypfF.js +0 -1
  280. package/dist/chunks/ResumeConversation-DBqX7gva.js +0 -1
  281. package/dist/chunks/SearchExtraToolsTool-BsSoILFj.js +0 -1
  282. package/dist/chunks/Settings-B-7yBewS.js +0 -3
  283. package/dist/chunks/Spinner-ByQXTvAA.js +0 -1
  284. package/dist/chunks/TextInput-B8ruWRf2.js +0 -22
  285. package/dist/chunks/ThemePicker-BQErFFW1.js +0 -1
  286. package/dist/chunks/TrustDialog-BIhz6AZE.js +0 -1
  287. package/dist/chunks/_baseEach-CsIRoaTH.js +0 -1
  288. package/dist/chunks/add-dir-CrUDs19x.js +0 -1
  289. package/dist/chunks/agents-CGaCQeLw.js +0 -101
  290. package/dist/chunks/allErrors-BF73lon8.js +0 -1
  291. package/dist/chunks/analytics-DJobLaWP.js +0 -1
  292. package/dist/chunks/appleTerminalBackup-BArZWB21.js +0 -1
  293. package/dist/chunks/backgroundHousekeeping-Bq3LMsVR.js +0 -17
  294. package/dist/chunks/backgroundHousekeeping-Cl3Ox7Qh.js +0 -1
  295. package/dist/chunks/banner-Cu2-XUek.js +0 -2
  296. package/dist/chunks/branch-Yg_taNlT.js +0 -2
  297. package/dist/chunks/btw-udbprVvu.js +0 -1
  298. package/dist/chunks/caches-ChjIEcdd.js +0 -1
  299. package/dist/chunks/caches-DLJ6urv-.js +0 -1
  300. package/dist/chunks/client-BiqbIkwr.js +0 -1
  301. package/dist/chunks/client-CZ8nyVh5.js +0 -1
  302. package/dist/chunks/commands-CVCpJo7M.js +0 -1
  303. package/dist/chunks/compact-izk6RKHQ.js +0 -2
  304. package/dist/chunks/config-C-Y2qtB2.js +0 -3
  305. package/dist/chunks/config-CFqpXMFX.js +0 -1
  306. package/dist/chunks/config-DD8fCYXn.js +0 -1
  307. package/dist/chunks/context-BbVm4SWK.js +0 -1
  308. package/dist/chunks/context-noninteractive-x0HAzWhc.js +0 -1
  309. package/dist/chunks/conversation-DouVzO0K.js +0 -1
  310. package/dist/chunks/conversation-DrVkifKy.js +0 -1
  311. package/dist/chunks/conversationRecovery-DliPBo_z.js +0 -1
  312. package/dist/chunks/crossProjectResume-DxMy05_P.js +0 -40
  313. package/dist/chunks/cwd-Dc3NV7s8.js +0 -1
  314. package/dist/chunks/cwd-Pa83R95t.js +0 -1
  315. package/dist/chunks/datadog-Cu3s7P48.js +0 -1
  316. package/dist/chunks/debug-Bglx1aTu.js +0 -39
  317. package/dist/chunks/doctor-D_kV_D_l.js +0 -1
  318. package/dist/chunks/entry-Bxseqbi_.js +0 -13
  319. package/dist/chunks/envUtils-DfkgIdYf.js +0 -1
  320. package/dist/chunks/esm-BXTZz3av.js +0 -1
  321. package/dist/chunks/execAsync-Bv2yxuGe.js +0 -1
  322. package/dist/chunks/execFileNoThrow-BTachNBI.js +0 -34
  323. package/dist/chunks/exit-C_R_FgzR.js +0 -1
  324. package/dist/chunks/extraUsage-xMuDiNKh.js +0 -1
  325. package/dist/chunks/extractMemories-D4Dl1itt.js +0 -1
  326. package/dist/chunks/fast-DH-C5IZs.js +0 -1
  327. package/dist/chunks/fast-bopOPrtf.js +0 -1
  328. package/dist/chunks/fetchModelList-DC4VQpqa.js +0 -1
  329. package/dist/chunks/fetchModelList-FE8tzTDc.js +0 -1
  330. package/dist/chunks/fileSuggestions-C-9unnoJ.js +0 -3
  331. package/dist/chunks/firstPartyEventLogger-QmjjQmgt.js +0 -3
  332. package/dist/chunks/firstPartyEventLogger-lFeqhtfh.js +0 -1
  333. package/dist/chunks/generateSessionName-CQ03xlYI.js +0 -1
  334. package/dist/chunks/genericProcessUtils-DwQFuna9.js +0 -23
  335. package/dist/chunks/getMachineId-bsd-Cut1kHoA.js +0 -1
  336. package/dist/chunks/getMachineId-darwin-CsRhaP3y.js +0 -2
  337. package/dist/chunks/getMachineId-linux-Bd7UBNRQ.js +0 -1
  338. package/dist/chunks/getMachineId-unsupported-vFGP8E_8.js +0 -1
  339. package/dist/chunks/getMachineId-win-DamF2CH_.js +0 -1
  340. package/dist/chunks/goal-CdL29Y8C.js +0 -3
  341. package/dist/chunks/grok-C6WAslUT.js +0 -1
  342. package/dist/chunks/grove-O6qp7ITR.js +0 -1
  343. package/dist/chunks/help-DxanITNN.js +0 -1
  344. package/dist/chunks/history-BMycjPTT.js +0 -1
  345. package/dist/chunks/hooks-D9ApLkBp.js +0 -1
  346. package/dist/chunks/install-0D9u2dZw.js +0 -1
  347. package/dist/chunks/instrumentation-BFiGwntt.js +0 -21
  348. package/dist/chunks/keybindings-DZrF9iNd.js +0 -1
  349. package/dist/chunks/launchLocalMemory-DhJ56KDc.js +0 -3
  350. package/dist/chunks/launchOnboarding-DmMoZwv5.js +0 -8
  351. package/dist/chunks/loadAgentsDir-BbUR6pqH.js +0 -1
  352. package/dist/chunks/localSearch-zfn7jgrh.js +0 -1
  353. package/dist/chunks/logoUtils-CRxTutvr.js +0 -1
  354. package/dist/chunks/main-9ksgUUY_.js +0 -345
  355. package/dist/chunks/managedEnv-BEqrGqn1.js +0 -1
  356. package/dist/chunks/managedEnv-OPlzUPbJ.js +0 -1
  357. package/dist/chunks/managedEnvConstants-BPwL2aWI.js +0 -1
  358. package/dist/chunks/mcp-ChF12reQ.js +0 -1
  359. package/dist/chunks/mcp-DoEl5uah.js +0 -2
  360. package/dist/chunks/mcp-hp9qqjAy.js +0 -6
  361. package/dist/chunks/memory-Qv-wGNQ5.js +0 -1
  362. package/dist/chunks/mode-bFXPCR2P.js +0 -2
  363. package/dist/chunks/model-6lkW4o2c.js +0 -1
  364. package/dist/chunks/model-BvQFFOf8.js +0 -1
  365. package/dist/chunks/modelOptions-BBvF3wHK.js +0 -1
  366. package/dist/chunks/nativeInstaller-CdjmE9Zy.js +0 -1
  367. package/dist/chunks/onChangeAppState-DLjZ1x95.js +0 -1
  368. package/dist/chunks/open-BtQHzzL9.js +0 -1
  369. package/dist/chunks/openai-D46QvESE.js +0 -2
  370. package/dist/chunks/overlayContext-8--_fbvY.js +0 -1
  371. package/dist/chunks/parser-CG5RuOCK.js +0 -1
  372. package/dist/chunks/partition-DznN4XZH.js +0 -1
  373. package/dist/chunks/permissions-DmGFViHI.js +0 -3
  374. package/dist/chunks/pidLock-Cm4sW35f.js +0 -3
  375. package/dist/chunks/plan-CzGBz_87.js +0 -1
  376. package/dist/chunks/platform-BacQ6ACS.js +0 -2
  377. package/dist/chunks/plugin-CluR79xX.js +0 -17
  378. package/dist/chunks/pluginCliCommands-CJv5uhOG.js +0 -1
  379. package/dist/chunks/pluginOperations-CcUSHAIa.js +0 -2
  380. package/dist/chunks/pluginStartupCheck-CRBUO9gP.js +0 -1
  381. package/dist/chunks/plugins-IwwaCDba.js +0 -4
  382. package/dist/chunks/poorMode-B0QGV6Ci.js +0 -1
  383. package/dist/chunks/poorMode-G-pnu6NM.js +0 -1
  384. package/dist/chunks/print-CgszM1ea.js +0 -13
  385. package/dist/chunks/processBashCommand-D098WsqY.js +0 -1
  386. package/dist/chunks/processSlashCommand-DOQFjJ88.js +0 -5
  387. package/dist/chunks/prompt-BKPmDAuL.js +0 -1
  388. package/dist/chunks/prompt-CgOklk7z.js +0 -1
  389. package/dist/chunks/promptEditor-DoGHJN_W.js +0 -4
  390. package/dist/chunks/protocolHandler-DjQALaU2.js +0 -13
  391. package/dist/chunks/reconciler-ykkSPR-i.js +0 -1
  392. package/dist/chunks/refresh-Dn_I1R4v.js +0 -1
  393. package/dist/chunks/registerProtocol-CAsDme_E.js +0 -1
  394. package/dist/chunks/reject-DtcCfuZV.js +0 -1
  395. package/dist/chunks/rename-DyEfsZiq.js +0 -1
  396. package/dist/chunks/resume-BcXEDUqZ.js +0 -2
  397. package/dist/chunks/ripgrep-DLs8MraF.js +0 -1
  398. package/dist/chunks/ripgrep-Dl3y5r4m.js +0 -5
  399. package/dist/chunks/sandbox-adapter-DfB9kgQD.js +0 -1
  400. package/dist/chunks/sandbox-toggle-D9GDUsTl.js +0 -1
  401. package/dist/chunks/searchExtraTools-D4gMMQv0.js +0 -1
  402. package/dist/chunks/select-DIxfl_VN.js +0 -1
  403. package/dist/chunks/sessionFileAccessHooks-lbgHnVvi.js +0 -1
  404. package/dist/chunks/sessionObserver-D6qzEdGJ.js +0 -1
  405. package/dist/chunks/sessionStorage-C_7gow_z.js +0 -1
  406. package/dist/chunks/sessionTracing-CtbeAD0s.js +0 -11
  407. package/dist/chunks/settings-B2jvL8Dp.js +0 -24
  408. package/dist/chunks/settings-CisDe8DB.js +0 -1
  409. package/dist/chunks/setup-qecdf-ES.js +0 -3
  410. package/dist/chunks/sinks-C-lP7uyO.js +0 -1
  411. package/dist/chunks/sinks-De-B1lPQ.js +0 -1
  412. package/dist/chunks/skillChangeDetector-DkOJoNhT.js +0 -1
  413. package/dist/chunks/skills-BE5scC-g.js +0 -1
  414. package/dist/chunks/src-CHw1lvBc.js +0 -3
  415. package/dist/chunks/startupProfiler-BH0FoI66.js +0 -1
  416. package/dist/chunks/startupProfiler-CJdr3SxP.js +0 -3
  417. package/dist/chunks/state-BhOKSFi5.js +0 -1
  418. package/dist/chunks/status-Dw09WZLd.js +0 -1
  419. package/dist/chunks/statusNoticeHelpers-BRQpUIlH.js +0 -1
  420. package/dist/chunks/stringUtils-C718f5ey.js +0 -4
  421. package/dist/chunks/switcher-CgZVah7U.js +0 -1
  422. package/dist/chunks/switcher-DZwUo5Ed.js +0 -1
  423. package/dist/chunks/tipRegistry-B71o4qWr.js +0 -2
  424. package/dist/chunks/toolPool-V-7Yv0GA.js +0 -1
  425. package/dist/chunks/udsClient-cQz6nJ_T.js +0 -1
  426. package/dist/chunks/urlHandler-DLz3FZm1.js +0 -1
  427. package/dist/chunks/useExitOnCtrlCDWithKeybindings-BKwzUpgb.js +0 -1
  428. package/dist/chunks/useMainLoopModel-DxvV70Ru.js +0 -1
  429. package/dist/chunks/useManagePlugins-BXLXazrR.js +0 -1
  430. package/dist/chunks/useMergedTools-CCgnBJzO.js +0 -1
  431. package/dist/chunks/useSearchInput-CzopttqC.js +0 -1
  432. package/dist/chunks/useSettingsErrors-SFPWfxsA.js +0 -1
  433. package/dist/chunks/util-Cbb3S6SX.js +0 -1
  434. package/dist/chunks/validatePlugin-BMSoeb_b.js +0 -1
  435. package/dist/chunks/vim-CoRp9lY1.js +0 -1
  436. package/dist/chunks/worktree-Vm-SNY5x.js +0 -1
@@ -1,13 +0,0 @@
1
- import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{B as n,Ds as r,E_ as i,Ec as a,Es as o,Jl as s,Ni as c,Oi as l,S_ as u,Tc as d,V as f,Yl as p,_r as m,i as h,o as g,rr as _}from"./loadAgentsDir-B0Anodo0.js";import{$ as v,A as y,F as b,G as x,P as S,Q as C,V as w,W as T,Y as E,Z as D,tt as ee,x as te,z as O}from"./types-Dx7P7JLQ.js";import{Dn as k,It as A,J as ne,Wn as j,ct as re,er as ie,tr as ae}from"./state-B4jiUise.js";import{_r as oe,d as se,h as ce,pr as le,sr as ue}from"./settings-B2jvL8Dp.js";import{p as de,r as fe}from"./config-C-Y2qtB2.js";import{d as pe,o as me}from"./model-BvQFFOf8.js";import{_n as he,vn as ge}from"./prompt-CJ1l3XXk.js";import{t as _e}from"./conversationRecovery-DliPBo_z.js";import{t as ve}from"./QueryEngine-DdLWvJv6.js";import{n as ye,r as be}from"./modelOptions-BBvF3wHK.js";import{n as xe,r as Se}from"./managedEnv-OPlzUPbJ.js";import{dirname as Ce}from"node:path";import{randomUUID as M}from"node:crypto";import{Readable as we,Writable as Te}from"node:stream";import{unlink as Ee}from"node:fs/promises";import*as N from"node:path/posix";import{isAbsolute as De,resolve as Oe}from"node:path/posix";te();var P={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},F={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},ke=x({_meta:E(D(),v()).nullish(),terminal:b().optional().default(!1)}),Ae=x({_meta:E(D(),v()).nullish(),label:D().nullish(),name:D(),optional:b().optional().default(!1),secret:b().optional().default(!0)}),je=x({_meta:E(D(),v()).nullish(),description:D().nullish(),id:D(),name:D()}),Me=x({_meta:E(D(),v()).nullish(),description:D().nullish(),id:D(),link:D().nullish(),name:D(),vars:S(Ae)}),Ne=x({_meta:E(D(),v()).nullish(),args:S(D()).optional(),description:D().nullish(),env:E(D(),D()).optional(),id:D(),name:D()}),Pe=C([Me.and(x({type:w(`env_var`)})),Ne.and(x({type:w(`terminal`)})),je]),Fe=x({_meta:E(D(),v()).nullish(),methodId:D()}),Ie=x({_meta:E(D(),v()).nullish()}),Le=x({_meta:E(D(),v()).nullish(),blob:D(),mimeType:D().nullish(),uri:D()}),Re=x({default:b().nullish(),description:D().nullish(),title:D().nullish()}),ze=x({_meta:E(D(),v()).nullish()}),Be=x({_meta:E(D(),v()).nullish()}),Ve=x({amount:T(),currency:D()}),He=x({_meta:E(D(),v()).nullish(),terminalId:D()}),Ue=x({_meta:E(D(),v()).nullish(),newText:D(),oldText:D().nullish(),path:D()}),We=C([D(),T(),T(),b(),S(D())]),Ge=O(C([x({content:E(D(),We).nullish()}).and(x({action:w(`accept`)})),x({action:w(`decline`)}),x({action:w(`cancel`)})]),x({_meta:E(D(),v()).nullish()})),Ke=x({_meta:E(D(),v()).nullish()}),qe=D(),Je=x({_meta:E(D(),v()).nullish(),elicitationId:qe}),Ye=w(`object`),Xe=w(`string`),Ze=x({_meta:E(D(),v()).nullish()}),Qe=x({_meta:E(D(),v()).nullish(),form:Ke.nullish(),url:Ze.nullish()}),$e=x({const:D(),title:D()}),et=x({_meta:E(D(),v()).nullish(),name:D(),value:D()}),tt=x({code:C([w(-32700),w(-32600),w(-32601),w(-32602),w(-32603),w(-32800),w(-32e3),w(-32002),w(-32042),T().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:v().optional(),message:D()}),nt=v(),rt=v(),it=v(),at=x({_meta:E(D(),v()).nullish(),readTextFile:b().optional().default(!1),writeTextFile:b().optional().default(!1)}),ot=x({_meta:E(D(),v()).nullish(),name:D(),value:D()}),st=x({_meta:E(D(),v()).nullish(),name:D(),title:D().nullish(),version:D()}),ct=x({default:T().nullish(),description:D().nullish(),maximum:T().nullish(),minimum:T().nullish(),title:D().nullish()}),lt=x({_meta:E(D(),v()).nullish()}),ut=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cursor:D().nullish(),cwd:D().nullish()}),dt=x({_meta:E(D(),v()).nullish()}),ft=x({_meta:E(D(),v()).nullish(),logout:dt.nullish()}),pt=x({_meta:E(D(),v()).nullish()}),mt=x({_meta:E(D(),v()).nullish()}),ht=x({_meta:E(D(),v()).nullish(),http:b().optional().default(!1),sse:b().optional().default(!1)}),gt=x({_meta:E(D(),v()).nullish(),headers:S(ot),name:D(),url:D()}),_t=x({_meta:E(D(),v()).nullish(),headers:S(ot),name:D(),url:D()}),vt=x({_meta:E(D(),v()).nullish(),args:S(D()),command:D(),env:S(et),name:D()}),I=C([gt.and(x({type:w(`http`)})),_t.and(x({type:w(`sse`)})),vt]),yt=D(),bt=x({_meta:E(D(),v()).nullish(),description:D().nullish(),modelId:yt,name:D()}),xt=C([w(`error`),w(`warning`),w(`information`),w(`hint`)]),St=x({_meta:E(D(),v()).nullish()}),Ct=x({_meta:E(D(),v()).nullish()}),wt=x({_meta:E(D(),v()).nullish()}),Tt=x({_meta:E(D(),v()).nullish()}),Et=x({_meta:E(D(),v()).nullish()}),Dt=x({_meta:E(D(),v()).nullish(),maxCount:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Ot=x({diff:D(),uri:D()}),kt=x({endLine:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:D()}),At=x({_meta:E(D(),v()).nullish()}),jt=x({_meta:E(D(),v()).nullish()}),Mt=x({languageId:D(),text:D(),uri:D()}),Nt=x({_meta:E(D(),v()).nullish(),maxCount:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Pt=C([w(`rejected`),w(`ignored`),w(`replaced`),w(`cancelled`)]),Ft=x({excerpts:S(kt),uri:D()}),It=x({_meta:E(D(),v()).nullish()}),Lt=x({_meta:E(D(),v()).nullish()}),Rt=x({name:D(),owner:D(),remoteUrl:D()}),zt=x({_meta:E(D(),v()).nullish()}),Bt=x({_meta:E(D(),v()).nullish(),jump:At.nullish(),rename:Lt.nullish(),searchAndReplace:zt.nullish()}),Vt=x({id:D(),isRegex:b().nullish(),replace:D(),search:D(),uri:D()}),Ht=C([w(`automatic`),w(`diagnostic`),w(`manual`)]),Ut=x({_meta:E(D(),v()).nullish(),maxCount:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Wt=x({_meta:E(D(),v()).nullish(),diagnostics:St.nullish(),editHistory:Dt.nullish(),openFiles:jt.nullish(),recentFiles:Nt.nullish(),relatedSnippets:It.nullish(),userActions:Ut.nullish()}),Gt=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I)}),Kt=x({default:T().nullish(),description:D().nullish(),maximum:T().nullish(),minimum:T().nullish(),title:D().nullish()}),qt=D(),Jt=C([w(`allow_once`),w(`allow_always`),w(`reject_once`),w(`reject_always`)]),Yt=x({_meta:E(D(),v()).nullish(),kind:Jt,name:D(),optionId:qt}),Xt=C([w(`high`),w(`medium`),w(`low`)]),Zt=C([w(`pending`),w(`in_progress`),w(`completed`)]),Qt=x({_meta:E(D(),v()).nullish(),content:D(),priority:Xt,status:Zt}),$t=x({_meta:E(D(),v()).nullish(),entries:S(Qt)}),L=x({character:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),en=x({id:D(),position:L,uri:D()}),tn=x({id:D(),newName:D(),position:L,uri:D()}),nn=x({action:D(),position:L,timestampMs:T(),uri:D()}),rn=C([w(`utf-16`),w(`utf-32`),w(`utf-8`)]),an=x({_meta:E(D(),v()).nullish(),auth:ke.optional().default({terminal:!1}),elicitation:Qe.nullish(),fs:at.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Bt.nullish(),positionEncodings:S(rn).optional(),terminal:b().optional().default(!1)}),on=x({_meta:E(D(),v()).nullish(),audio:b().optional().default(!1),embeddedContext:b().optional().default(!1),image:b().optional().default(!1)}),sn=T().int().gte(0).lte(65535),cn=x({_meta:E(D(),v()).nullish(),clientCapabilities:an.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:st.nullish(),protocolVersion:sn}),R=x({end:L,start:L}),ln=x({message:D(),range:R,severity:xt,uri:D()}),un=x({languageId:D(),lastFocusedMs:T().nullish(),uri:D(),visibleRange:R.nullish()}),dn=x({_meta:E(D(),v()).nullish(),diagnostics:S(ln).nullish(),editHistory:S(Ot).nullish(),openFiles:S(un).nullish(),recentFiles:S(Mt).nullish(),relatedSnippets:S(Ft).nullish(),userActions:S(nn).nullish()}),fn=x({newText:D(),range:R}),pn=C([x({cursorPosition:L.nullish(),edits:S(fn),id:D(),uri:D()}).and(x({kind:w(`edit`)})),en.and(x({kind:w(`jump`)})),tn.and(x({kind:w(`rename`)})),Vt.and(x({kind:w(`searchAndReplace`)}))]),mn=x({_meta:E(D(),v()).nullish(),content:D()}),hn=x({_meta:E(D(),v()).nullish()}),z=C([T(),D()]).nullable();x({_meta:E(D(),v()).nullish(),requestId:z});var gn=x({requestId:z}),_n=y([`assistant`,`user`]),B=x({_meta:E(D(),v()).nullish(),audience:S(_n).nullish(),lastModified:D().nullish(),priority:T().nullish()}),vn=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),data:D(),mimeType:D()}),yn=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),data:D(),mimeType:D(),uri:D().nullish()}),bn=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),description:D().nullish(),mimeType:D().nullish(),name:D(),size:T().nullish(),title:D().nullish(),uri:D()}),xn=x({_meta:E(D(),v()).nullish(),optionId:qt}),Sn=C([x({outcome:w(`cancelled`)}),xn.and(x({outcome:w(`selected`)}))]),Cn=x({_meta:E(D(),v()).nullish(),outcome:Sn}),wn=x({_meta:E(D(),v()).nullish()}),Tn=x({_meta:E(D(),v()).nullish()}),En=x({currentValue:b()}),Dn=D(),On=D(),kn=C([w(`mode`),w(`model`),w(`thought_level`),D()]),V=D(),An=x({_meta:E(D(),v()).nullish(),description:D().nullish(),name:D(),value:V}),jn=x({_meta:E(D(),v()).nullish(),group:Dn,name:D(),options:S(An)}),H=O(C([x({currentValue:V,options:C([S(An),S(jn)])}).and(x({type:w(`select`)})),En.and(x({type:w(`boolean`)}))]),x({_meta:E(D(),v()).nullish(),category:kn.nullish(),description:D().nullish(),id:On,name:D()})),Mn=x({_meta:E(D(),v()).nullish(),configOptions:S(H)}),Nn=x({_meta:E(D(),v()).nullish()}),U=D(),Pn=x({_meta:E(D(),v()).nullish(),id:D(),sessionId:U}),Fn=x({_meta:E(D(),v()).nullish(),sessionId:U}),In=x({_meta:E(D(),v()).nullish(),sessionId:U}),Ln=x({_meta:E(D(),v()).nullish(),sessionId:U}),Rn=x({_meta:E(D(),v()).nullish(),args:S(D()).optional(),command:D(),cwd:D().nullish(),env:S(et).optional(),outputByteLimit:T().nullish(),sessionId:U}),zn=x({_meta:E(D(),v()).nullish(),sessionId:U,uri:D()}),Bn=x({_meta:E(D(),v()).nullish(),position:L,sessionId:U,uri:D(),version:T(),visibleRange:R}),Vn=x({_meta:E(D(),v()).nullish(),languageId:D(),sessionId:U,text:D(),uri:D(),version:T()}),Hn=x({_meta:E(D(),v()).nullish(),sessionId:U,uri:D()}),Un=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I).optional(),sessionId:U}),Wn=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),Gn=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I),sessionId:U}),Kn=x({_meta:E(D(),v()).nullish(),limit:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:D(),sessionId:U}),qn=x({_meta:E(D(),v()).nullish(),id:D(),reason:Pt.nullish(),sessionId:U}),Jn=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),Yn=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I).optional(),sessionId:U}),Xn=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),sessionId:U,title:D().nullish(),updatedAt:D().nullish()}),Zn=x({_meta:E(D(),v()).nullish(),nextCursor:D().nullish(),sessions:S(Xn)}),Qn=x({_meta:E(D(),v()).nullish(),title:D().nullish(),updatedAt:D().nullish()}),$n=x({_meta:E(D(),v()).nullish()}),W=D(),er=x({_meta:E(D(),v()).nullish(),currentModeId:W}),tr=x({_meta:E(D(),v()).nullish(),description:D().nullish(),id:W,name:D()}),G=x({_meta:E(D(),v()).nullish(),availableModes:S(tr),currentModeId:W}),K=x({_meta:E(D(),v()).nullish(),availableModels:S(bt),currentModelId:yt}),nr=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish(),sessionId:U}),rr=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish()}),ir=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish(),sessionId:U}),ar=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish()}),or=x({_meta:E(D(),v()).nullish()}),sr=x({_meta:E(D(),v()).nullish(),additionalDirectories:wn.nullish(),close:Tn.nullish(),fork:Nn.nullish(),list:$n.nullish(),resume:or.nullish()}),cr=O(C([x({type:w(`boolean`),value:b()}),x({value:V})]),x({_meta:E(D(),v()).nullish(),configId:On,sessionId:U})),lr=x({_meta:E(D(),v()).nullish(),configOptions:S(H)}),ur=x({_meta:E(D(),v()).nullish(),modeId:W,sessionId:U}),dr=x({_meta:E(D(),v()).nullish()}),fr=x({_meta:E(D(),v()).nullish(),modelId:yt,sessionId:U}),pr=x({_meta:E(D(),v()).nullish()}),mr=x({_meta:E(D(),v()).nullish(),sessionId:U}),hr=C([w(`end_turn`),w(`max_tokens`),w(`max_turn_requests`),w(`refusal`),w(`cancelled`)]),gr=C([w(`email`),w(`uri`),w(`date`),w(`date-time`)]),_r=x({default:D().nullish(),description:D().nullish(),enum:S(D()).nullish(),format:gr.nullish(),maxLength:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:S($e).nullish(),pattern:D().nullish(),title:D().nullish()}),vr=x({_meta:E(D(),v()).nullish(),context:dn.nullish(),position:L,selection:R.nullish(),sessionId:U,triggerKind:Ht,uri:D(),version:T()}),yr=x({_meta:E(D(),v()).nullish(),suggestions:S(pn)}),br=x({_meta:E(D(),v()).nullish(),terminalId:D()}),xr=x({_meta:E(D(),v()).nullish(),exitCode:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:D().nullish()}),Sr=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),Cr=x({_meta:E(D(),v()).nullish(),exitStatus:xr.nullish(),output:D(),truncated:b()}),wr=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),text:D()}),Tr=x({range:R.nullish(),text:D()}),Er=x({_meta:E(D(),v()).nullish(),contentChanges:S(Tr),sessionId:U,uri:D(),version:T()});x({method:D(),params:C([Fn,Vn,Er,zn,Hn,Bn,Pn,qn,nt]).nullish()});var Dr=C([w(`full`),w(`incremental`)]),Or=x({_meta:E(D(),v()).nullish(),syncKind:Dr}),kr=x({_meta:E(D(),v()).nullish(),didChange:Or.nullish(),didClose:Ct.nullish(),didFocus:wt.nullish(),didOpen:Tt.nullish(),didSave:Et.nullish()}),Ar=x({_meta:E(D(),v()).nullish(),document:kr.nullish()}),jr=x({_meta:E(D(),v()).nullish(),context:Wt.nullish(),events:Ar.nullish()}),Mr=x({_meta:E(D(),v()).nullish(),auth:ft.optional().default({}),loadSession:b().optional().default(!1),mcpCapabilities:ht.optional().default({http:!1,sse:!1}),nes:jr.nullish(),positionEncoding:rn.nullish(),promptCapabilities:on.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:sr.optional().default({})}),Nr=x({_meta:E(D(),v()).nullish(),agentCapabilities:Mr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:st.nullish(),authMethods:S(Pe).optional().default([]),protocolVersion:sn}),Pr=C([x({_meta:E(D(),v()).nullish(),mimeType:D().nullish(),text:D(),uri:D()}),Le]),Fr=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),resource:Pr}),Ir=C([wr.and(x({type:w(`text`)})),yn.and(x({type:w(`image`)})),vn.and(x({type:w(`audio`)})),bn.and(x({type:w(`resource_link`)})),Fr.and(x({type:w(`resource`)}))]),Lr=x({_meta:E(D(),v()).nullish(),content:Ir}),Rr=x({_meta:E(D(),v()).nullish(),content:Ir,messageId:D().nullish()}),zr=x({_meta:E(D(),v()).nullish(),messageId:D().nullish(),prompt:S(Ir),sessionId:U}),Br=x({anyOf:S($e)}),Vr=C([Lr.and(x({type:w(`content`)})),Ue.and(x({type:w(`diff`)})),br.and(x({type:w(`terminal`)}))]),Hr=D(),Ur=x({sessionId:U,toolCallId:Hr.nullish()}),Wr=O(C([Ur,gn]),x({elicitationId:qe,url:D().url()})),Gr=x({_meta:E(D(),v()).nullish(),line:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:D()}),Kr=C([w(`pending`),w(`in_progress`),w(`completed`),w(`failed`)]),qr=C([w(`read`),w(`edit`),w(`delete`),w(`move`),w(`search`),w(`execute`),w(`think`),w(`fetch`),w(`switch_mode`),w(`other`)]),Jr=x({_meta:E(D(),v()).nullish(),content:S(Vr).optional(),kind:qr.optional(),locations:S(Gr).optional(),rawInput:v().optional(),rawOutput:v().optional(),status:Kr.optional(),title:D(),toolCallId:Hr}),Yr=x({_meta:E(D(),v()).nullish(),content:S(Vr).nullish(),kind:qr.nullish(),locations:S(Gr).nullish(),rawInput:v().optional(),rawOutput:v().optional(),status:Kr.nullish(),title:D().nullish(),toolCallId:Hr}),Xr=x({_meta:E(D(),v()).nullish(),options:S(Yt),sessionId:U,toolCall:Yr}),Zr=x({_meta:E(D(),v()).nullish(),hint:D()}),Qr=x({_meta:E(D(),v()).nullish(),description:D(),input:Zr.nullish(),name:D()}),$r=x({_meta:E(D(),v()).nullish(),availableCommands:S(Qr)}),ei=C([x({enum:S(D()),type:Xe}),Br]),ti=x({default:S(D()).nullish(),description:D().nullish(),items:ei,maxItems:T().nullish(),minItems:T().nullish(),title:D().nullish()}),ni=C([_r.and(x({type:w(`string`)})),Kt.and(x({type:w(`number`)})),ct.and(x({type:w(`integer`)})),Re.and(x({type:w(`boolean`)})),ti.and(x({type:w(`array`)}))]),ri=x({description:D().nullish(),properties:E(D(),ni).optional().default({}),required:S(D()).nullish(),title:D().nullish(),type:Ye.optional().default(`object`)}),ii=O(C([O(C([Ur,gn]),x({requestedSchema:ri})).and(x({mode:w(`form`)})),Wr.and(x({mode:w(`url`)}))]),x({_meta:E(D(),v()).nullish(),message:D()})),ai=x({cachedReadTokens:T().nullish(),cachedWriteTokens:T().nullish(),inputTokens:T(),outputTokens:T(),thoughtTokens:T().nullish(),totalTokens:T()});C([x({id:z,result:C([Nr,Ie,mt,ir,rr,Zn,nr,ar,Be,dr,lr,x({_meta:E(D(),v()).nullish(),stopReason:hr,usage:ai.nullish(),userMessageId:D().nullish()}),pr,mr,yr,ze,it])}),x({error:tt,id:z})]);var oi=x({_meta:E(D(),v()).nullish(),cost:Ve.nullish(),size:T(),used:T()}),si=C([Rr.and(x({sessionUpdate:w(`user_message_chunk`)})),Rr.and(x({sessionUpdate:w(`agent_message_chunk`)})),Rr.and(x({sessionUpdate:w(`agent_thought_chunk`)})),Jr.and(x({sessionUpdate:w(`tool_call`)})),Yr.and(x({sessionUpdate:w(`tool_call_update`)})),$t.and(x({sessionUpdate:w(`plan`)})),$r.and(x({sessionUpdate:w(`available_commands_update`)})),er.and(x({sessionUpdate:w(`current_mode_update`)})),Mn.and(x({sessionUpdate:w(`config_option_update`)})),Qn.and(x({sessionUpdate:w(`session_info_update`)})),oi.and(x({sessionUpdate:w(`usage_update`)}))]),ci=x({_meta:E(D(),v()).nullish(),sessionId:U,update:si});x({method:D(),params:C([ci,Je,nt]).nullish()});var li=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),ui=x({_meta:E(D(),v()).nullish(),exitCode:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:D().nullish()}),di=x({name:D(),uri:D()}),fi=x({_meta:E(D(),v()).nullish(),repository:Rt.nullish(),workspaceFolders:S(di).nullish(),workspaceUri:D().nullish()});x({id:z,method:D(),params:C([cn,Fe,pt,Gt,Gn,ut,Un,Yn,Ln,ur,cr,zr,fr,fi,vr,In,rt]).nullish()});var pi=x({_meta:E(D(),v()).nullish(),content:D(),path:D(),sessionId:U});x({id:z,method:D(),params:C([pi,Kn,Xr,Rn,Sr,Jn,li,Wn,ii,rt]).nullish()}),C([x({id:z,result:C([x({_meta:E(D(),v()).nullish()}),mn,Cn,He,Cr,hn,ui,lt,Ge,it])}),x({error:tt,id:z})]),e();function mi(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a){n+=r.decode();break}if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
2
- `);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}let t=n.trim();if(t)try{let n=JSON.parse(t);e.enqueue(n)}catch(e){console.error(`Failed to parse JSON message:`,t,e)}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
3
- `,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}te();var hi,gi=class{constructor(e,n){t(this,`connection`,void 0);let r=e(this),i=async(e,t)=>{switch(e){case P.initialize:{let e=cn.parse(t);return r.initialize(e)}case P.session_new:{let e=Gt.parse(t);return r.newSession(e)}case P.session_load:{if(!r.loadSession)throw q.methodNotFound(e);let n=Gn.parse(t);return r.loadSession(n)}case P.session_list:{if(!r.listSessions)throw q.methodNotFound(e);let n=ut.parse(t);return r.listSessions(n)}case P.session_fork:{if(!r.unstable_forkSession)throw q.methodNotFound(e);let n=Un.parse(t);return r.unstable_forkSession(n)}case P.session_resume:{if(!r.unstable_resumeSession)throw q.methodNotFound(e);let n=Yn.parse(t);return r.unstable_resumeSession(n)}case P.session_close:{if(!r.unstable_closeSession)throw q.methodNotFound(e);let n=Ln.parse(t);return r.unstable_closeSession(n)}case P.session_set_mode:{if(!r.setSessionMode)throw q.methodNotFound(e);let n=ur.parse(t);return await r.setSessionMode(n)??{}}case P.authenticate:{let e=Fe.parse(t);return await r.authenticate(e)??{}}case P.logout:{if(!r.unstable_logout)throw q.methodNotFound(e);let n=pt.parse(t);return await r.unstable_logout(n)??{}}case P.session_prompt:{let e=zr.parse(t);return r.prompt(e)}case P.session_set_model:{if(!r.unstable_setSessionModel)throw q.methodNotFound(e);let n=fr.parse(t);return await r.unstable_setSessionModel(n)??{}}case P.session_set_config_option:{if(!r.setSessionConfigOption)throw q.methodNotFound(e);let n=cr.parse(t);return r.setSessionConfigOption(n)}case P.nes_start:{if(!r.unstable_startNes)throw q.methodNotFound(e);let n=fi.parse(t);return r.unstable_startNes(n)}case P.nes_suggest:{if(!r.unstable_suggestNes)throw q.methodNotFound(e);let n=vr.parse(t);return r.unstable_suggestNes(n)}case P.nes_close:{if(!r.unstable_closeNes)throw q.methodNotFound(e);let n=In.parse(t);return await r.unstable_closeNes(n)??{}}default:if(r.extMethod)return r.extMethod(e,t);throw q.methodNotFound(e)}},a=async(e,t)=>{switch(e){case P.session_cancel:{let e=Fn.parse(t);return r.cancel(e)}case P.document_did_open:{if(!r.unstable_didOpenDocument)return;let e=Vn.parse(t);return r.unstable_didOpenDocument(e)}case P.document_did_change:{if(!r.unstable_didChangeDocument)return;let e=Er.parse(t);return r.unstable_didChangeDocument(e)}case P.document_did_close:{if(!r.unstable_didCloseDocument)return;let e=zn.parse(t);return r.unstable_didCloseDocument(e)}case P.document_did_save:{if(!r.unstable_didSaveDocument)return;let e=Hn.parse(t);return r.unstable_didSaveDocument(e)}case P.document_did_focus:{if(!r.unstable_didFocusDocument)return;let e=Bn.parse(t);return r.unstable_didFocusDocument(e)}case P.nes_accept:{if(!r.unstable_acceptNes)return;let e=Pn.parse(t);return r.unstable_acceptNes(e)}case P.nes_reject:{if(!r.unstable_rejectNes)return;let e=qn.parse(t);return r.unstable_rejectNes(e)}default:if(r.extNotification)return r.extNotification(e,t);throw q.methodNotFound(e)}};this.connection=new vi(i,a,n)}async sessionUpdate(e){return await this.connection.sendNotification(F.session_update,e)}async requestPermission(e){return await this.connection.sendRequest(F.session_request_permission,e)}async readTextFile(e){return await this.connection.sendRequest(F.fs_read_text_file,e)}async writeTextFile(e){return await this.connection.sendRequest(F.fs_write_text_file,e)??{}}async createTerminal(e){return new _i((await this.connection.sendRequest(F.terminal_create,e)).terminalId,e.sessionId,this.connection)}async unstable_createElicitation(e){return await this.connection.sendRequest(F.elicitation_create,e)}async unstable_completeElicitation(e){return await this.connection.sendNotification(F.elicitation_complete,e)}async extMethod(e,t){return await this.connection.sendRequest(e,t)}async extNotification(e,t){return await this.connection.sendNotification(e,t)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}};hi=Symbol.asyncDispose;var _i=class{constructor(e,n,r){t(this,`id`,void 0),t(this,`sessionId`,void 0),t(this,`connection`,void 0),this.id=e,this.sessionId=n,this.connection=r}async currentOutput(){return await this.connection.sendRequest(F.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}async waitForExit(){return await this.connection.sendRequest(F.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}async kill(){return await this.connection.sendRequest(F.terminal_kill,{sessionId:this.sessionId,terminalId:this.id})??{}}async release(){return await this.connection.sendRequest(F.terminal_release,{sessionId:this.sessionId,terminalId:this.id})??{}}async[hi](){await this.release()}},vi=class{constructor(e,n,r){t(this,`pendingResponses`,new Map),t(this,`nextRequestId`,0),t(this,`requestHandler`,void 0),t(this,`notificationHandler`,void 0),t(this,`stream`,void 0),t(this,`writeQueue`,Promise.resolve()),t(this,`abortController`,new AbortController),t(this,`closedPromise`,void 0),this.requestHandler=e,this.notificationHandler=n,this.stream=r,this.closedPromise=new Promise(e=>{this.abortController.signal.addEventListener(`abort`,()=>e())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let e=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:t,done:n}=await e.read();if(n)break;if(t)try{this.processMessage(t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&this.sendMessage({jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of this.pendingResponses.values())e.reject(t);this.pendingResponses.clear(),this.abortController.abort(t)}async processMessage(e){if(`method`in e&&`id`in e){let t=await this.tryCallRequestHandler(e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await this.sendMessage({jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await this.tryCallNotificationHandler(e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else`id`in e?this.handleResponse(e):console.error(`Invalid message`,{message:e})}async tryCallRequestHandler(e,t){try{return{result:await this.requestHandler(e,t)??null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof ee)return q.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}async tryCallNotificationHandler(e,t){try{return await this.notificationHandler(e,t),{result:null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof ee)return q.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}handleResponse(e){let t=this.pendingResponses.get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new q(n,r,i))}this.pendingResponses.delete(e.id)}else console.error(`Got response to unknown request`,e.id)}sendRequest(e,t){this.throwIfClosed();let n=this.nextRequestId++,r=new Promise((e,t)=>{this.pendingResponses.set(n,{resolve:e,reject:t})});return r.catch(()=>{}),this.sendMessage({jsonrpc:`2.0`,id:n,method:e,params:t}),r}async sendNotification(e,t){this.throwIfClosed(),await this.sendMessage({jsonrpc:`2.0`,method:e,params:t})}throwIfClosed(){if(this.abortController.signal.aborted)throw this.abortController.signal.reason??Error(`ACP connection closed`)}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let t=this.stream.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{this.close(e)}),this.writeQueue}},q=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};ie(),A(),ce(),ge(),de(),i(),a(),r(),c(),f(),g(),Se();function J(e,t){if(e)return t?De(e)?e:Oe(t,e):e}var yi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function xi(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!yi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Si(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ci=256;function wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ci?t:`${t.slice(0,Ci-1)}…`}function Ti(e,t){if(!t)return e;let n=N.resolve(t),r=N.resolve(e);return r.startsWith(n+N.sep)||r===n?N.relative(n,r):e}function Ei(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return`${t}\n${e}${e.endsWith(`
4
- `)?``:`
5
- `}${t}`}function Y(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let e=i?.command??`Terminal`,t=i?.description;return{title:e,kind:`execute`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Read`:{let e=i?.file_path,t=e??`File`,r=i?.offset,a=i?.limit,o=``;a&&a>0?o=` (${r??1} - ${(r??1)+a-1})`:r&&(o=` (from line ${r})`);let s=t?Ti(t,n):`File`,c=J(e,n);return{title:`Read ${s}${o}`,kind:`read`,locations:c?[{path:c,line:r??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Ti(e,n):void 0,a=J(e,n);return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:a?[{type:`diff`,path:a,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:a?[{path:a}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Ti(e,n):void 0,o=J(e,n);return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:o?[{type:`diff`,path:o,oldText:t||null,newText:r}]:[],locations:o?[{path:o}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,r=J(e,n),a=`Find`;return e&&(a+=` \`${e}\``),t&&(a+=` \`${t}\``),{title:a,kind:`search`,content:[],locations:r?[{path:r}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function Di(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Oi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Oi(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`resource_link`:{let t=e.uri;return{type:`resource_link`,uri:t,name:e.name??t,mimeType:e.mimeType}}case`resource`:{let t=e.resource;return{type:`resource`,resource:{uri:t?.uri??``,mimeType:t?.mimeType,...typeof t?.text==`string`?{text:t.text}:{},...typeof t?.blob==`string`?{blob:t.blob}:{}}}}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
6
- `)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function ki(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Di(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Ei(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Ei(e.text)}:Oi(e,!1)}))}:{};case`Bash`:{let e=``;if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
7
- `)}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
8
- `));return e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return Di(i??``,r)}}function Ai(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}function X(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:{let e=i.thinking??``;a={sessionUpdate:`agent_thought_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:Ai(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,status:`in_progress`,rawInput:e,...Y({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Y({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=ki(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function ji(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,...i?.messageId?{messageId:i.messageId}:{},content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:X(s,`assistant`,t,n,r,void 0,i)}function Mi(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`content_block_delta`:{let o=a.delta;return o?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function Ni(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function Pi(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=Ni(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}var Fi=console;function Ii(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Li(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5,p=!1,m=null;try{for(;!r.aborted;){let s=await Ii(t,r);if(s.done||r.aborted)break;let h=s.value;if(h==null)continue;let g=h;switch(g.type){case`system`:g.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
9
-
10
- Compacting completed.`}}}));break;case`result`:{let t=g.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=g.modelUsage;if(i&&d){let e=Pi(i,d);e?.contextWindow&&(f=e.contextWindow)}u!==null&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:u,size:f}});let a=g.subtype,o=g.is_error;if(r.aborted){c=`cancelled`;break}switch(a){case`success`:{let e=g.stop_reason;c=e===`max_tokens`?`max_tokens`:e===`refusal`?`refusal`:`end_turn`,o&&(c=`end_turn`);break}case`error_during_execution`:c=g.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=g.parent_tool_use_id;t===null&&m===null&&(m=M());let r=Mi(g,e,i,n,{clientCapabilities:a,cwd:o,messageId:t===null?m??void 0:void 0});for(let e of r)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=g.message,r=g.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s;r===null&&(m===null&&(m=M()),s=m);let c=ji(g,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p,messageId:s});for(let e of c)await n.sessionUpdate(e);r===null&&(m=null);break}case`user`:break;case`progress`:{let t=g.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
11
-
12
- Compacting completed.`}}});break;default:Fi.debug(`Ignoring unknown SDK message type`);break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}async function Ri(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){Fi.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;let t=M();await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,...t?{messageId:t}:{},content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=X(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a,messageId:M()});for(let e of t)await n.sessionUpdate(e)}}}function zi(e,t,r,i,a,o,s,c){return async(r,l,u,d,f,p)=>{let m=Vi(i);if(r.name===`ExitPlanMode`)return Bi(e,t,f,l,m,a,o,s,c);if(p!==void 0)return p;try{let e=await n(r,l,u,d,f);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:f}}let h=Y({name:r.name,id:f,input:l},m,a),g={toolCallId:f,title:h.title,kind:h.kind,status:`pending`,rawInput:l},_=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`},{kind:`reject_always`,name:`Always Reject`,optionId:`reject_always`}];try{let n=await e.requestPermission({sessionId:t,toolCall:g,options:_});if(n.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`},toolUseID:f};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:l}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function Bi(e,t,n,r,i,a,o,s,c){let l=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&l.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let u=Y({name:`ExitPlanMode`,id:n,input:r},i,a),d={toolCallId:n,title:u.title,kind:u.kind,status:`pending`,rawInput:r},f=await e.requestPermission({sessionId:t,toolCall:d,options:l});if(f.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(f.outcome.outcome===`selected`&&`optionId`in f.outcome&&f.outcome.optionId!==void 0){let n=f.outcome.optionId;if(l.some(e=>e.optionId===n)&&(n==="default"||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function Vi(e){if(!e)return!1;if(e.terminal===!0)return!0;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}pe(),be(),s(),le(),e(),m();var Z=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,authMethods:[],agentInfo:{name:`workmate`,title:`Work Mate`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0,forkSession:!0}},promptCapabilities:{image:!1,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{list:{},resume:{},close:{},delete:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession({...e,replay:!1});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){if(e.cursor!==void 0&&e.cursor!==null)throw Error(`Pagination cursor not supported: listSessions returns all results in a single page.`);let t=e.cwd||ne(),n=await ue(t),r=await p({dir:t}),i=[];for(let e of r){if(!e.cwd||await ue(e.cwd)!==n)continue;let t=wi(e.summary??``);i.push({sessionId:e.sessionId,cwd:e.cwd,...t?{title:t}:{},updatedAt:new Date(e.lastModified).toISOString()})}return{sessions:i}}async unstable_forkSession(e){let{initialMessages:t}=await Hi(e.sessionId),n=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{initialMessages:t});return this.scheduleAvailableCommandsUpdate(n.sessionId),n}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async unstable_deleteSession(e){let t=await oe(e.sessionId);if(t)try{await Ee(t.filePath)}catch(e){if(e.code!==`ENOENT`)throw e}return this.sessions.has(e.sessionId)&&await this.teardownSession(e.sessionId),{}}async extMethod(e,t){if(e===`session/delete`){let e=t.sessionId;if(typeof e!=`string`||e.length===0)throw Error(`session/delete requires a non-empty sessionId`);return this.unstable_deleteSession({sessionId:e})}throw q.methodNotFound(e)}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:e.modeId}}),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}};async function Hi(e){let t;try{let n=await _(e);n&&n.messages.length>0&&(t=_e(n.messages))}catch(e){console.error(`[ACP] fork source load failed:`,e)}return{initialMessages:t}}var Ui=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function Wi(e){return Ui.includes(e)}function Gi(e,t,n){if(t){let t=Ki(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!Yi())throw Error(`Mode not available: bypassPermissions cannot run as root (start the agent as a non-root user, or set IS_SANDBOX=1).`);return t}return qi(n)??`default`}function Ki(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return xi(e,t)}function qi(e){if(e!=null)try{return xi(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function Ji(e,t){return!!e&&Object.hasOwn(e,t)}function Yi(){return Xi()}function Xi(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid!=`function`||process.getuid()!==0}function Zi(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}function Qi(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(Array.isArray(e.options))for(let n of e.options)n&&typeof n==`object`&&typeof n.value==`string`&&t.push(n.value);else typeof n.value==`string`&&t.push(n.value)}return t}function Q(e){return e.conn}function $(e){return e.clientCapabilities}function $i(e,t,n,r){n===`mode`?t.modes={...t.modes,currentModeId:r}:n===`model`&&(t.models={...t.models,currentModelId:r})}A();function ea(){return se().permissions?.defaultMode}async function ta(e,t={}){fe();let n=t.sessionId??M(),r=e.cwd;j(n,re()),k(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}ae(),xe();try{let i=he(),a=d(i),s=e._meta,c=Ji(s,`permissionMode`),f=Gi(c?s?.permissionMode:void 0,c,ea()),p=$(this),m=this.conn,g=zi(m,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,p,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),_=Yi(),v={...o(),toolPermissionContext:{...i,mode:f,isBypassPermissionsModeAvailable:_}},[y,b]=await Promise.all([l(r),h(r)]);v.agentDefinitions=b;let x=new ve({cwd:r,tools:a,commands:y,mcpClients:[],agents:b.activeAgents,canUseTool:g,getAppState:()=>v,setAppState:e=>{let t=e(v);Object.assign(v,t)},readFileCache:new u(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),S={currentModeId:f,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},..._?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},C=ye(),w=me(),T={availableModels:C.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:w};x.setModel(w);let E=Zi(S,T),D={queryEngine:x,cancelled:!1,cancelGeneration:0,cwd:r,modes:S,models:T,configOptions:E,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:p,appState:v,commands:y,sessionFingerprint:Si({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,D),{sessionId:n,modes:S,models:T,configOptions:E}}finally{a&&process.chdir(i)}}Object.assign(Z.prototype,{createSession:ta}),m(),A(),le();async function na(e){let t=e.replay!==!1,n=this.sessions.get(e.sessionId);if(n){if(Si({cwd:e.cwd,mcpServers:e.mcpServers})===n.sessionFingerprint){let r=await oe(e.sessionId,e.cwd);return j(e.sessionId,r?Ce(r.filePath):null),k(e.cwd),t&&await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:n.modes,models:n.models,configOptions:n.configOptions}}await this.teardownSession(e.sessionId)}let r=await oe(e.sessionId,e.cwd),i=r?Ce(r.filePath):null;j(e.sessionId,i),k(e.cwd);let a;if(r)try{let t=await _(e.sessionId);t&&t.messages.length>0&&(a=_e(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let o=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:a});if(t&&a&&a.length>0){let t=this.sessions.get(e.sessionId);t&&await Ri(e.sessionId,a,Q(this),t.toolUseCache,$(this),t.cwd)}return{sessionId:o.sessionId,modes:o.modes,models:o.models,configOptions:o.configOptions}}async function ra(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async function ia(e){try{let t=await _(e.sessionId);if(!t||t.messages.length===0)return;let n=_e(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await Ri(e.sessionId,n,Q(this),r.toolUseCache,$(this),r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}function aa(e,t){if(!Wi(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async function oa(e,t,n){let r=this.sessions.get(e);r&&($i(this,r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await Q(this).sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}Object.assign(Z.prototype,{getOrCreateSession:na,teardownSession:ra,replaySessionHistory:ia,applySessionMode:aa,updateConfigOption:oa});function sa(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(ca(n,r))}else if(e.type===`resource`){let n=e.resource;if(n&&typeof n.text==`string`)t.push(n.text);else if(n&&typeof n.blob==`string`){let e=typeof n.mimeType==`string`?n.mimeType:`application/octet-stream`,r=typeof n.uri==`string`?n.uri:`(unknown uri)`;t.push(`Embedded resource: ${r} (${e}, base64 blob, ${n.blob.length} chars)`)}}}return t.filter(e=>e.length>0).join(`
13
- `)}function ca(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}function la(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),ua(e),n}ua(e)}function ua(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}A();async function da(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=e.messageId??void 0,r=sa(e.prompt);if(!r.trim())throw Error(`Prompt content is empty`);let i=t.cancelGeneration;if(t.promptRunning){let e=M();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==i)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),j(e.sessionId,re());let i=t.queryEngine.submitMessage(r),{stopReason:a,usage:o}=await Li(e.sessionId,i,Q(this),t.queryEngine.getAbortSignal(),t.toolUseCache,$(this),t.cwd,()=>t.cancelled);if(t.cancelled)return{stopReason:`cancelled`};if(await pa(this,e.sessionId,r),o){let e={inputTokens:o.inputTokens,outputTokens:o.outputTokens,cachedReadTokens:o.cachedReadTokens,cachedWriteTokens:o.cachedWriteTokens,thoughtTokens:0,totalTokens:o.inputTokens+o.outputTokens+o.cachedReadTokens+o.cachedWriteTokens+0};return{stopReason:a,usage:e,...n?{userMessageId:n}:{},_meta:{claudeCode:{usage:e}}}}return{stopReason:a,...n?{userMessageId:n}:{}}}catch(n){let r=n instanceof Error&&(n.name===`AbortError`||/abort|cancelled|interrupt/i.test(n.message));if(t.cancelled||r)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(await this.teardownSession(e.sessionId),Error(`The Work Mate Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=la(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async function fa(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);let n=t.configOptions.find(t=>t.id===e.configId);if(!n)throw Error(`Unknown config option: ${e.configId}`);if(n.type===`select`){let t=Qi(n.options);if(!t.includes(e.value))throw Error(`Invalid value '${e.value}' for config option ${e.configId}; must be one of: ${t.join(`, `)}`)}let r=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,r),await Q(this).sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:r}})):e.configId===`model`&&t.queryEngine.setModel(r),$i(this,t,e.configId,r),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:r}:t),{configOptions:t.configOptions}}async function pa(e,t,n){let r=e.sessions.get(t);if(!r)return;let i=r.toolUseCache;if(i.__sessionInfoTitleSent)return;i.__sessionInfoTitleSent=!0;let a=wi(n).slice(0,100);try{await Q(e).sessionUpdate({sessionId:t,update:{sessionUpdate:`session_info_update`,...a?{title:a}:{},updatedAt:new Date().toISOString()}})}catch(e){console.error(`[ACP] Failed to send session_info_update:`,e)}}Object.assign(Z.prototype,{prompt:da,setSessionConfigOption:fa}),de(),Se();function ma(e,t){let n=we.toWeb(e);return mi(Te.toWeb(t),n)}async function ha(){fe(),xe();let e=ma(process.stdin,process.stdout),t,n=new gi(e=>(t=new Z(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{ha as runAcpAgent};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{homedir as r}from"os";import{join as i}from"path";function a(e){let t=process.env.NODE_OPTIONS;return t?t.split(/\s+/).includes(e):!1}function o(e){if(!e)return!1;if(typeof e==`boolean`)return e;let t=e.toLowerCase().trim();return[`1`,`true`,`yes`,`on`].includes(t)}function s(e){if(e===void 0)return!1;if(typeof e==`boolean`)return!e;if(!e)return!1;let t=e.toLowerCase().trim();return[`0`,`false`,`no`,`off`].includes(t)}function c(){return o(process.env.CLAUDE_CODE_SIMPLE)||process.argv.includes(`--bare`)}function l(e){let t={};if(e)for(let n of e){let[e,...r]=n.split(`=`);if(!e||r.length===0)throw Error(`Invalid environment variable format: ${n}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);t[e]=r.join(`=`)}return t}function u(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||`us-east-1`}function d(){return process.env.CLOUD_ML_REGION||`us-east5`}function f(){return o(process.env.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR)}function p(){return!1}function m(e){if(e){let t=g.find(([t])=>e.startsWith(t));if(t)return process.env[t[1]]||d()}return d()}var h,g,_=e((()=>{n(),h=t(()=>(process.env.WORKMATE_CONFIG_DIR??i(r(),`.workmate`)).normalize(`NFC`),()=>process.env.WORKMATE_CONFIG_DIR),g=[[`claude-haiku-4-5`,`VERTEX_REGION_CLAUDE_HAIKU_4_5`],[`claude-3-5-haiku`,`VERTEX_REGION_CLAUDE_3_5_HAIKU`],[`claude-3-5-sonnet`,`VERTEX_REGION_CLAUDE_3_5_SONNET`],[`claude-3-7-sonnet`,`VERTEX_REGION_CLAUDE_3_7_SONNET`],[`claude-opus-4-1`,`VERTEX_REGION_CLAUDE_4_1_OPUS`],[`claude-opus-4`,`VERTEX_REGION_CLAUDE_4_0_OPUS`],[`claude-sonnet-4-6`,`VERTEX_REGION_CLAUDE_4_6_SONNET`],[`claude-sonnet-4-5`,`VERTEX_REGION_CLAUDE_4_5_SONNET`],[`claude-sonnet-4`,`VERTEX_REGION_CLAUDE_4_0_SONNET`]]}));export{a,s as c,l as d,f,h as i,o as l,d as n,_ as o,m as r,c as s,u as t,p as u};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,o as i}from"./envUtils-DfkgIdYf.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{E as s,O as c,S as l,i as u,l as d,n as f,s as p,v as ee}from"./esm-lWlUmoUA.js";import{B as m,C as te,D as h,E as ne,F as re,O as ie,S as ae,T as oe,b as se,c as ce,i as le,m as ue,n as g,o as de,u as fe,v as _,x as pe}from"./esm-BbMeEYcz.js";import{n as me,t as he}from"./esm-sVMjGuep.js";import{F as ge,I as _e,It as ve,Y as ye,at as be,st as xe,x as Se}from"./state-B4jiUise.js";import{C as Ce,I as we,i as Te,x as Ee}from"./debug-Bglx1aTu.js";import{Gt as De,Lr as Oe,Pr as ke,Ut as Ae,Wt as v,h as je,qt as Me,t as Ne}from"./settings-B2jvL8Dp.js";import{i as Pe,t as Fe}from"./execFileNoThrow-BTachNBI.js";import{a as Ie,n as Le,o as Re,r as ze}from"./platform-BacQ6ACS.js";import{Bt as Be,Ft as Ve,Gt as He,It as Ue,Lt as We,Pt as Ge,Qt as Ke,Vt as qe,Yt as y,Zt as Je,bt as Ye,d as Xe,o as Ze,t as b,yt as Qe,zt as $e}from"./model-BvQFFOf8.js";import{i as et,t as tt}from"./genericProcessUtils-DwQFuna9.js";import{arch as nt,hostname as rt,platform as it,release as at}from"os";import{extname as ot}from"path";import{stat as st}from"fs/promises";import{inspect as ct}from"util";import*as lt from"process";import{AsyncLocalStorage as ut}from"async_hooks";var x,dt=e((()=>{(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(x||(x={}))})),ft,pt,mt=e((()=>{ft=class{emit(e){}enabled(){return!1}},pt=new ft}));function ht(e,t,n){return r=>r===e?t:n}var S,C,gt=e((()=>{S=Symbol.for(`io.opentelemetry.js.api.logs`),C=globalThis})),_t,vt,yt=e((()=>{mt(),_t=class{getLogger(e,t,n){return new ft}},vt=new _t})),bt,xt=e((()=>{mt(),bt=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):pt}}})),w,St=e((()=>{yt(),xt(),w=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new bt(this,e,t,n)}_getDelegate(){return this._delegate??vt}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),Ct,wt=e((()=>{gt(),yt(),St(),Ct=class e{constructor(){this._proxyLoggerProvider=new w}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return C[S]?this.getLoggerProvider():(C[S]=ht(1,e,vt),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return C[S]?.call(C,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete C[S],this._proxyLoggerProvider=new w}}})),Tt,T=e((()=>{dt(),mt(),wt(),Tt=Ct.getInstance()}));function Et(){return`workmate/0.0.24`}var Dt=e((()=>{})),Ot,kt,E,At=e((()=>{n(),Je(),Ot=[{modelEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],kt=[{modelEnvVar:`OPENAI_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],E=t((e,t)=>{if(y()===`firstParty`)return;let n=e.toLowerCase(),r=y()===`openai`?kt:Ot;for(let e of r){let r=process.env[e.modelEnvVar],i=process.env[e.capabilitiesEnvVar];if(!(!r||i===void 0)&&n===r.toLowerCase())return i.toLowerCase().split(`,`).map(e=>e.trim()).includes(t)}},(e,t)=>`${e.toLowerCase()}:${t}`)}));function jt(e){let t=[],n=[];for(let r of e)O.includes(r)?t.push(r):n.push(r);return{allowed:t,disallowed:n}}function Mt(e){if(!e||e.length===0)return;let{allowed:t,disallowed:n}=jt(e);for(let e of n)console.warn(`Warning: Beta header '${e}' is not allowed. Only the following betas are supported: ${O.join(`, `)}`);return t.length>0?t:void 0}function Nt(e){let t=E(e,`interleaved_thinking`);if(t!==void 0)return t;let n=b(e),r=y();return r===`foundry`?!0:r===`firstParty`?!n.includes(`claude-3-`):n.includes(`claude-opus-4`)||n.includes(`claude-sonnet-4`)}function Pt(e){let t=b(e),n=y();return n===`foundry`?!0:n===`firstParty`?!t.includes(`claude-3-`):t.includes(`claude-opus-4`)||t.includes(`claude-sonnet-4`)||t.includes(`claude-haiku-4`)}function Ft(e){let t=b(e),n=y();return n!==`firstParty`&&n!==`foundry`?!1:t.includes(`claude-sonnet-4-6`)||t.includes(`claude-sonnet-4-5`)||t.includes(`claude-opus-4-1`)||t.includes(`claude-opus-4-5`)||t.includes(`claude-opus-4-6`)||t.includes(`claude-opus-4-7`)||t.includes(`claude-haiku-4-5`)}function It(e){return!0}function D(){return(y()===`firstParty`||y()===`foundry`)&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)&&Ke()}function Lt(){return y()===`firstParty`&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function Rt(e,t){let n=[...k(e)];t?.isAgenticQuery&&(n.includes(`claude-code-20250219`)||n.push(Ve));let r=be();return!r||r.length===0?n:[...n,...r.filter(e=>!n.includes(e))]}var O,zt,k,Bt,Vt=e((()=>{n(),ve(),He(),Ye(),i(),Xe(),At(),Je(),je(),O=[Ue],zt=t(e=>{let t=[],n=b(e).includes(`haiku`);y();let i=D();n||t.push(Ve),Qe(e)&&t.push(Ue),!r(process.env.DISABLE_INTERLEAVED_THINKING)&&Nt(e)&&t.push($e),i&&Nt(e)&&!_e()&&Ne().showThinkingSummaries!==!0&&t.push(qe);let a=r(process.env.USE_API_CONTEXT_MANAGEMENT)||Pt(e),o=Pt(e);return D()&&(a||o)&&t.push(We),i&&Ft(e),i&&t.push(Be),process.env.ANTHROPIC_BETAS&&t.push(...process.env.ANTHROPIC_BETAS.split(`,`).map(e=>e.trim()).filter(Boolean)),t}),k=t(e=>{let t=zt(e);return y()===`bedrock`?t.filter(e=>!Ge.has(e)):t}),Bt=t(e=>zt(e).filter(e=>Ge.has(e)))}));function Ht(){return process.platform===`linux`&&r(process.env.CLAUDE_CODE_BUBBLEWRAP)}function Ut(){return process.platform===`linux`?A??!1:!1}async function Wt(){if(j!==void 0)return j;if(process.platform===`darwin`)return j=null,null;try{let e=await tt(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of Ae)if(e.includes(t))return j=t,t}}catch{}return j=null,null}async function Gt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?await Wt()||`pycharm`:v.terminal}function Kt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?j===void 0?`pycharm`:j||`pycharm`:v.terminal}async function qt(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await Wt()}var Jt,A,j,Yt,Xt=e((()=>{n(),Me(),i(),Pe(),et(),Jt=t(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await Fe(`test`,[`-f`,`/.dockerenv`]);return e===0}),A=null,process.platform===`linux`&&st(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{A=!0},()=>{A=!1}),Yt={...v,terminal:Kt(),getIsDocker:Jt,getIsBubblewrapSandbox:Ht,isMuslEnvironment:Ut,getTerminalWithJetBrainsDetectionAsync:Gt,initJetBrainsDetection:qt}}));function Zt(e){return Qt?.has(e)??!1}var Qt,$t=e((()=>{Te(),we()}));function M(){return an.getStore()}function en(e,t){return an.run(e,t)}function tn(e){return e?.agentType===`subagent`}function nn(){let e=M();if(!(!tn(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function rn(){let e=M();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var an,on=e((()=>{an=new ut}));function sn(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function cn(){return r(process.env.OTEL_LOG_TOOL_DETAILS)}function ln(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&Zt(t))}function un(e,t,n){let r=dn(e);return!r||!yn.has(r.serverName)&&!ln(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function dn(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function fn(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function N(e,t=0){if(typeof e==`string`)return e.length>bn?`${e.slice(0,xn)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=Sn)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,I).map(e=>N(e,t+1));return e.length>I&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,I).map(([e,n])=>[e,N(n,t+1)]);return n.length>I&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function pn(e){if(!cn())return;let t=Ce(N(e));return t.length>F&&(t=`${t.slice(0,F)}…[truncated]`),t}function P(e){let t=ot(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>Cn?`other`:n}function mn(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=P(t);e&&(r.add(e),n=e)}for(let t of e.split(Tn)){if(!t)continue;let e=t.split(En);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(wn.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=P(i);a&&!r.has(a)&&(r.add(a),n=n?`${n},${a}`:a)}}if(n)return n}function hn(){let e=M();if(e)return{agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};let t=process.env.CLAUDE_CODE_AGENT_ID,n=process.env.CLAUDE_CODE_PARENT_SESSION_ID,r=t?`standalone`:void 0;if(t||r||n)return{...t?{agentId:t}:{},...r?{agentType:r}:{},...n?{parentSessionId:n}:{}};let i=ye();return i?{parentSessionId:i}:{}}function gn(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(L&&R){let e=n-R;e>0&&(r=(t.user-L.user+(t.system-L.system))/(e*1e3)*100)}return L=t,R=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function _n(e={}){let t=e.model?String(e.model):Ze(),n=typeof e.betas==`string`?e.betas:k(t).join(`,`),[r,i]=await Promise.all([On(),ke()]),a=gn();return{model:t,sessionId:xe(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(ge()),clientType:Se(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...hn(),...i&&{rh:i}}}function vn(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,skillMode:o,observerMode:s,...c}=e,l={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(l.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(l.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(l.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(l.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(l.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(l.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(l.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(l.github_action_ref=r.githubActionRef),r.wslVersion&&(l.wsl_version=r.wslVersion),r.linuxDistroId&&(l.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(l.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(l.linux_kernel=r.linuxKernel),r.vcs&&(l.vcs=r.vcs),r.versionBase&&(l.version_base=r.versionBase);let u={session_id:c.sessionId,model:c.model,user_type:c.userType,is_interactive:c.isInteractive===`true`,client_type:c.clientType};if(c.betas&&(u.betas=c.betas),c.entrypoint&&(u.entrypoint=c.entrypoint),c.agentSdkVersion&&(u.agent_sdk_version=c.agentSdkVersion),c.sweBenchRunId&&(u.swe_bench_run_id=c.sweBenchRunId),c.sweBenchInstanceId&&(u.swe_bench_instance_id=c.sweBenchInstanceId),c.sweBenchTaskId&&(u.swe_bench_task_id=c.sweBenchTaskId),c.agentId&&(u.agent_id=c.agentId),c.parentSessionId&&(u.parent_session_id=c.parentSessionId),c.agentType&&(u.agent_type=c.agentType),t.githubActionsMetadata){let e=t.githubActionsMetadata;l.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let d;return(t.accountUuid||t.organizationUuid)&&(d={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:l,...i&&{process:Buffer.from(Ce(i)).toString(`base64`)},...d&&{auth:d},core:u,additional:{...a&&{rh:a},...o&&{skill_mode:o},...s&&{observer_mode:s},...n}}}var yn,bn,xn,F,I,Sn,Cn,wn,Tn,En,Dn,On,L,R,kn=e((()=>{n(),Me(),Xt(),Vt(),Xe(),ve(),i(),$t(),Oe(),Re(),on(),Ee(),yn=new Set,bn=512,xn=128,F=4*1024,I=20,Sn=2,Cn=10,wn=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),Tn=/\s*(?:&&|\|\||[;|])\s*/,En=/\s+/,Dn=t(()=>{let e=`0.0.24`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),On=t(async()=>{let[e,t,n,i]=await Promise.all([v.getPackageManagers(),v.getRuntimes(),ze(),Le()]);return{platform:De(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:v.arch,nodeVersion:v.nodeVersion,terminal:Yt.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:v.isRunningWithBun(),isCi:r(process.env.CI),isClaubbit:r(process.env.CLAUBBIT),isClaudeCodeRemote:r(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:v.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:r(process.env.GITHUB_ACTIONS),isClaudeCodeAction:r(process.env.CLAUDE_CODE_ACTION),version:`0.0.24`,versionBase:Dn(),buildTime:`2026-08-26T10:41:05.156Z`,deploymentEnvironment:v.detectDeploymentEnvironment(),...r(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Ie()&&{wslVersion:Ie()},...n??{},...i.length>0?{vcs:i.join(`,`)}:{}}}),L=null,R=null}));function An(e){return e.setValue(z,!0)}function jn(e){return e.getValue(z)===!0}var z,B=e((()=>{f(),z=c(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function Mn(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Nn(n)){p.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Pn(r)){p.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Nn(e){return typeof e==`string`&&e!==``}function Pn(e){return e==null?!0:Array.isArray(e)?Fn(e):In(typeof e)}function Fn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(In(e)){t=e;continue}return!1}return!1}}return!0}function In(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var Ln=e((()=>{f()}));function Rn(){return e=>{p.error(zn(e))}}function zn(e){return typeof e==`string`?e:JSON.stringify(Bn(e))}function Bn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Vn=e((()=>{f()}));function Hn(e){try{Un(e)}catch{}}var Un,Wn=e((()=>{Vn(),Un=Rn()}));function Gn(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){p.warn(`Unknown value ${ct(t)} for ${e}, expected a number, using defaults`);return}return n}function V(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var Kn=e((()=>{f()})),qn,Jn=e((()=>{qn=`2.9.0`})),Yn,Xn=e((()=>{Yn=`process.runtime.name`})),H,Zn=e((()=>{Jn(),_(),Xn(),H={[ne]:`opentelemetry`,[Yn]:`node`,[oe]:ie,[h]:qn}})),U,Qn=e((()=>{Kn(),Zn(),U=performance})),$n=e((()=>{Qn()}));function W(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*cr)]}function er(e){return or(W(U.timeOrigin),W(typeof e==`number`?e:U.now()))}function tr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=G),[n,r]}function nr(e){return e[0]*1e6+e[1]/1e3}function rr(e){return e[0]+e[1]/G}function ir(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ar(e){return ir(e)||typeof e==`number`||e instanceof Date}function or(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=G&&(n[1]-=G,n[0]+=1),n}var sr,cr,G,lr=e((()=>{$n(),sr=9,cr=10**6,G=10**sr})),K,ur=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(K||(K={}))}));function dr(e){if(!fr(e)||pr(e)!==gr)return!1;let t=xr(e);if(t===null)return!0;let n=Cr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&yr.call(n)===br}function fr(e){return typeof e==`object`&&!!e}function pr(e){return e==null?e===void 0?vr:_r:q&&q in Object(e)?mr(e):hr(e)}function mr(e){let t=Cr.call(e,q),n=e[q],r=!1;try{e[q]=void 0,r=!0}catch{}let i=wr.call(e);return r&&(t?e[q]=n:delete e[q]),i}function hr(e){return wr.call(e)}var gr,_r,vr,yr,br,xr,Sr,Cr,q,wr,Tr=e((()=>{gr=`[object Object]`,_r=`[object Null]`,vr=`[object Undefined]`,yr=Function.prototype.toString,br=yr.call(Object),xr=Object.getPrototypeOf,Sr=Object.prototype,Cr=Sr.hasOwnProperty,q=Symbol?Symbol.toStringTag:void 0,wr=Sr.toString}));function Er(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Or(t,e.shift(),0,n);return t}function Dr(e){return J(e)?e.slice():e}function Or(e,t,n=0,r){let i;if(!(n>Mr)){if(n++,X(e)||X(t)||Ar(t))i=Dr(t);else if(J(e)){if(i=e.slice(),J(t))for(let e=0,n=t.length;e<n;e++)i.push(Dr(t[e]));else if(Y(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Dr(t[r]))}}}else if(Y(e))if(Y(t)){if(!jr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(X(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(kr(e,s,r)||kr(t,s,r))delete i[s];else{if(Y(a)&&Y(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Or(i[s],c,n,r)}}}}else i=t;return i}}function kr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function J(e){return Array.isArray(e)}function Ar(e){return typeof e==`function`}function Y(e){return!X(e)&&!J(e)&&!Ar(e)&&typeof e==`object`}function X(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function jr(e,t){return!(!dr(e)||!dr(t))}var Mr,Nr=e((()=>{Tr(),Mr=20})),Pr,Fr=e((()=>{a(),Pr=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),Ir,Lr=e((()=>{Fr(),a(),Ir=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new Pr),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Rr(e,t){return new Promise(n=>{d.with(An(d.active()),()=>{e.export(t,n)})})}var zr=e((()=>{f(),B()})),Br,Vr=e((()=>{B(),Ln(),Wn(),Vn(),lr(),ur(),$n(),Nr(),Lr(),zr(),Br={_export:Rr}}));function Hr(){if(Z===void 0)try{let e=globalThis.process.argv0;Z=e?`unknown_service:${e}`:`unknown_service`}catch{Z=`unknown_service`}return Z}var Z,Ur=e((()=>{})),Q,Wr=e((()=>{Q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Gr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Kr(){return Gr({[te]:Hr(),[oe]:H[oe],[ne]:H[ne],[h]:H[h]})}function qr(e){return e.map(([e,t])=>Q(t)?[e,t.catch(t=>{p.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Jr(e){if(typeof e==`string`||e===void 0)return e;p.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Yr(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;p.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Xr,Zr=e((()=>{f(),Vr(),_(),Ur(),Wr(),a(),Xr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=qr(t),r._asyncAttributesPending=t.filter(([e,t])=>Q(t)).length>0,r}constructor(e,t){o(this,`_rawAttributes`,void 0),o(this,`_asyncAttributesPending`,!1),o(this,`_schemaUrl`,void 0),o(this,`_memoizedAttributes`,void 0);let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(Q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=qr(this._rawAttributes),this._schemaUrl=Jr(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&p.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Q(n)){p.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Yr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),Qr,$r,ei=e((()=>{f(),_(),Vr(),a(),Qr=class{constructor(){o(this,`_MAX_LENGTH`,255),o(this,`_COMMA_SEPARATOR`,`,`),o(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=V(`OTEL_RESOURCE_ATTRIBUTES`),r=V(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){p.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[te]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},$r=new Qr})),ti,ni,ri,ii,ai,oi=e((()=>{ti=`host.arch`,ni=`host.id`,ri=`host.name`,ii=`os.type`,ai=`os.version`}));async function si(){if(!$)switch(lt.platform){case`darwin`:$=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:$=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:$=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:$=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:$=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return $()}var $,ci=e((()=>{})),li,ui,di=e((()=>{li=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},ui=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),fi,pi,mi=e((()=>{oi(),ci(),di(),fi=class{detect(e){return{attributes:{[ri]:rt(),[ti]:li(nt()),[ni]:si()}}}},pi=new fi})),hi,gi,_i=e((()=>{oi(),di(),hi=class{detect(e){return{attributes:{[ii]:ui(it()),[ai]:at()}}}},gi=new hi})),vi=e((()=>{mi(),_i(),oi()})),yi=e((()=>{vi()})),bi=e((()=>{ei(),yi()})),xi=e((()=>{Zr(),bi(),Ur()}));function Si(e){return Ci(e,new WeakSet)}function Ci(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Ci(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Ci(e,t))}return!1}var wi=e((()=>{})),Ti,Ei=e((()=>{f(),g(),_(),wi(),a(),Ti=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){o(this,`hrTime`,void 0),o(this,`hrTimeObserved`,void 0),o(this,`spanContext`,void 0),o(this,`resource`,void 0),o(this,`instrumentationScope`,void 0),o(this,`attributes`,{}),o(this,`_severityText`,void 0),o(this,`_severityNumber`,void 0),o(this,`_body`,void 0),o(this,`_eventName`,void 0),o(this,`_attributesCount`,0),o(this,`_droppedAttributesCount`,0),o(this,`_isReadonly`,!1),o(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:s,severityText:c,body:l,attributes:d={},exception:f,context:p}=n,m=Date.now();if(this.hrTime=ue(r??m),this.hrTimeObserved=ue(i??m),p){let e=u.getSpanContext(p);e&&ee(e)&&(this.spanContext=e)}this.severityNumber=s,this.severityText=c,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(d),f!=null&&this._setException(f)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return p.warn(`Invalid attribute key: ${e}`),this;if(!Si(t))return p.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&p.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return p.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(pe,n.stack),t=!0)}t||p.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&p.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),Di,Oi=e((()=>{T(),f(),Ei(),a(),Di=class{constructor(e,t){o(this,`instrumentationScope`,void 0),o(this,`_sharedState`,void 0),o(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||d.active(),r=e.severityNumber??x.UNSPECIFIED;if(r!==x.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=u.getSpanContext(n);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return}let i=new Ti(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==x.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||d.active();if(t.traceBased){let e=u.getSpanContext(r);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),ki,Ai=e((()=>{ki=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),ji,Mi=e((()=>{g(),a(),ji=class{constructor(e,t){o(this,`processors`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>de(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function Ni(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var Pi=e((()=>{})),Fi,Ii=e((()=>{Fi=`otel.sdk.log.created`})),Li,Ri=e((()=>{Ii(),a(),Li=class{constructor(e){o(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(Fi,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),zi,Bi=e((()=>{zi=`0.215.0`})),Vi,Hi,Ui,Wi=e((()=>{f(),T(),Ai(),Mi(),Pi(),Ri(),Bi(),a(),Vi={disabled:!1,minimumSeverity:x.UNSPECIFIED,traceBased:!1},Hi=()=>({...Vi}),Ui=class{constructor(e,t,n,r,i,a){o(this,`loggers`,new Map),o(this,`activeProcessor`,void 0),o(this,`registeredLogRecordProcessors`,[]),o(this,`resource`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),o(this,`logRecordLimits`,void 0),o(this,`processors`,void 0),o(this,`loggerMetrics`,void 0),o(this,`_loggerConfigurator`,void 0),o(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new ji(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ki,this._loggerConfigurator=i??Hi;let c=a?a.getMeter(`@opentelemetry/sdk-logs`,zi):s();this.loggerMetrics=new Li(c)}getLoggerConfig(e){let t=Ni(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),Gi,Ki=e((()=>{f(),T(),he(),g(),Oi(),Wi(),a(),Gi=class{constructor(e={}){o(this,`_shutdownOnce`,void 0),o(this,`_sharedState`,void 0);let t={resource:e.resource??me(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??Hi,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new Ui(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new le(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return p.warn(`A shutdown LoggerProvider cannot provide a Logger`),pt;e||p.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new Di({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(p.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(p.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),qi,Ji=e((()=>{g(),qi=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:fe(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:ce.SUCCESS})}}}));async function Yi(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var Xi,Zi,Qi=e((()=>{f(),g(),a(),Xi=class{constructor(e,t,n){o(this,`_exportCompleted`,void 0),o(this,`_exportScheduledPromise`,void 0),o(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await Yi(t),await d.with(m(d.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){re(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===ce.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},Zi=class{constructor(e,t){o(this,`_maxExportBatchSize`,void 0),o(this,`_maxQueueSize`,void 0),o(this,`_scheduledDelayMillis`,void 0),o(this,`_exportTimeoutMillis`,void 0),o(this,`_exporter`,void 0),o(this,`_currentExport`,null),o(this,`_finishedLogRecords`,[]),o(this,`_timer`,void 0),o(this,`_shutdownOnce`,void 0),o(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new le(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new Xi(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){re(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new Xi(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,re(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),$i,ea=e((()=>{Qi(),$i=class extends Zi{onShutdown(){}}})),ta=e((()=>{ea()})),na=e((()=>{ta()})),ra=e((()=>{Ki(),Ji(),na(),T()}));export{mn as $,rr as A,Hn as B,Er as C,At as Ct,er as D,Tt as Dt,or as E,T as Et,Qn as F,B as G,Ln as H,U as I,dn as J,jn as K,Gn as L,ar as M,ir as N,tr as O,W as P,P as Q,V as R,Nr as S,E as St,ur as T,Dt as Tt,Pn as U,Wn as V,Mn as W,pn as X,fn as Y,_n as Z,Gr as _,Vt as _t,Ji as a,rn as at,Ir as b,D as bt,xi as c,on as ct,pi as d,qt as dt,kn as et,mi as f,Xt as ft,Zr as g,k as gt,Kr as h,Rt as ht,qi as i,vn as it,lr as j,nr as k,_i as l,en as lt,ei as m,Bt as mt,$i as n,un as nt,Gi as o,M as ot,$r as p,Mt as pt,An as q,ea as r,sn as rt,Ki as s,nn as st,ra as t,cn as tt,gi as u,Yt as ut,Vr as v,It as vt,K as w,Et as wt,Lr as x,Lt as xt,Br as y,Ft as yt,Kn as z};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import*as t from"util";import*as n from"child_process";var r,i=e((()=>{r=t.promisify(n.exec)}));export{i as n,r as t};
@@ -1,34 +0,0 @@
1
- import{i as e,n as t,o as n,t as r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as m,t as h}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{i as g,n as _,r as v,t as y}from"./figures-5ThXQEtq.js";import{n as b,t as x}from"./cwd-Pa83R95t.js";import{w as ee,x as te}from"./debug-Bglx1aTu.js";import{o as ne,s as re}from"./log-D2TIwHBV.js";import{aborted as ie,callbackify as S,debuglog as ae,inspect as oe,promisify as se,stripVTControlCharacters as ce}from"node:util";import C,{execArgv as le,execPath as ue,hrtime as de,platform as fe}from"node:process";import w from"node:path";import{ChildProcess as pe,execFile as me,spawn as he,spawnSync as ge}from"node:child_process";import{appendFileSync as _e,createReadStream as ve,createWriteStream as ye,readFileSync as be,statSync as xe,writeFileSync as Se}from"node:fs";import{constants as Ce}from"node:os";import we from"node:tty";import{EventEmitter as Te,addAbortListener as Ee,on as De,once as T,setMaxListeners as Oe}from"node:events";import{Duplex as ke,PassThrough as Ae,Readable as E,Transform as je,Writable as Me,getDefaultHighWaterMark as Ne}from"node:stream";import{StringDecoder as Pe}from"node:string_decoder";import{fileURLToPath as Fe}from"node:url";import{Buffer as Ie}from"node:buffer";import{scheduler as Le,setImmediate as Re,setTimeout as ze}from"node:timers/promises";import{serialize as Be}from"node:v8";import{finished as D}from"node:stream/promises";function O(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 k=t((()=>{})),Ve,He,Ue,We,Ge=t((()=>{Ve=(e,t)=>{let n=We(He(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},He=e=>Ue(e)?e.toString():e,Ue=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,We=e=>e instanceof URL?Fe(e):e})),Ke,qe=t((()=>{k(),Ge(),Ke=(e,t=[],n={})=>{let r=Ve(e,`First argument`),[i,a]=O(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(!O(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]}})),Je,Ye,A,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,j=t((()=>{({toString:Je}=Object.prototype),Ye=e=>Je.call(e)===`[object ArrayBuffer]`,A=e=>Je.call(e)===`[object Uint8Array]`,Xe=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ze=new TextEncoder,Qe=e=>Ze.encode(e),$e=new TextDecoder,et=e=>$e.decode(e),tt=(e,t)=>nt(e,t).join(``),nt=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new Pe(t),r=e.map(e=>typeof e==`string`?Qe(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},rt=e=>e.length===1&&A(e[0])?e[0]:at(it(e)),it=e=>e.map(e=>typeof e==`string`?Qe(e):e),at=e=>{let t=new Uint8Array(ot(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},ot=e=>{let t=0;for(let n of e)t+=n.length;return t}})),st,ct,lt,ut,dt,ft,pt,mt,ht,gt=t((()=>{k(),j(),st=e=>Array.isArray(e)&&Array.isArray(e.raw),ct=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=lt({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,{}]},lt=({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}=ut(i,e.raw[r]),c=pt(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>mt(e)):[mt(l)];return pt(c,u,s)},ut=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=dt.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(dt.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+=ft[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},dt=new Set([` `,` `,`\r`,`
3
- `]),ft={x:3,u:5},pt=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],mt=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(O(e)&&(`stdout`in e||`isMaxBuffer`in e))return ht(e);throw e instanceof pe||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},ht=({stdout:e})=>{if(typeof e==`string`)return e;if(A(e))return et(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`)}})),M,_t,N,vt,P=t((()=>{M=e=>_t.includes(e),_t=[C.stdin,C.stdout,C.stderr],N=[`stdin`,`stdout`,`stderr`],vt=e=>N[e]??`stdio[${e}]`})),yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,F=t((()=>{k(),P(),yt=e=>{let t={...e};for(let n of jt)t[n]=bt(e,n);return t},bt=(e,t)=>{let n=Array.from({length:xt(e)+1}),r=St(e[t],n,t);return kt(r,t)},xt=({stdio:e})=>Array.isArray(e)?Math.max(e.length,N.length):N.length,St=(e,t,n)=>O(e)?Ct(e,t,n):t.fill(e),Ct=(e,t,n)=>{for(let r of Object.keys(e).sort(wt))for(let i of Et(r,n,t))t[i]=e[r];return t},wt=(e,t)=>Tt(e)<Tt(t)?1:-1,Tt=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,Et=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=Dt(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]},Dt=e=>{if(e===`all`)return e;if(N.includes(e))return N.indexOf(e);let t=Ot.exec(e);if(t!==null)return Number(t[1])},Ot=/^fd(\d+)$/,kt=(e,t)=>e.map(e=>e===void 0?At[t]:e),At={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ae(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},jt=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],Mt=(e,t)=>t===`ipc`?e.at(-1):e[t]})),Nt,Pt,Ft,It,Lt,Rt,zt,I=t((()=>{F(),Nt=({verbose:e},t)=>It(e,t)!==`none`,Pt=({verbose:e},t)=>![`none`,`short`].includes(It(e,t)),Ft=({verbose:e},t)=>{let n=It(e,t);return Rt(n)?n:void 0},It=(e,t)=>t===void 0?Lt(e):Mt(e,t),Lt=e=>e.find(e=>Rt(e))??zt.findLast(t=>e.includes(t)),Rt=e=>typeof e==`function`,zt=[`none`,`short`,`full`]})),Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt=t((()=>{Bt=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>Jt(Ht(e))).join(` `)}},Vt=e=>ce(e).split(`
6
- `).map(e=>Ht(e)).join(`
7
- `),Ht=e=>e.replaceAll(Gt,e=>Ut(e)),Ut=e=>{let t=Kt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=qt?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},Wt=()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Gt=Wt(),Kt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},qt=65535,Jt=e=>Yt.test(e)?e:fe===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Yt=/^[\w./-]+$/})),Zt,L,Qt,$t,en,tn,nn=t((()=>{Zt=we?.WriteStream?.prototype?.hasColors?.()??!1,L=(e,t)=>{if(!Zt)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}},L(0,0),Qt=L(1,22),L(2,22),L(3,23),L(4,24),L(53,55),L(7,27),L(8,28),L(9,29),L(30,39),L(31,39),L(32,39),L(33,39),L(34,39),L(35,39),L(36,39),L(37,39),$t=L(90,39),L(40,49),L(41,49),L(42,49),L(43,49),L(44,49),L(45,49),L(46,49),L(47,49),L(100,49),en=L(91,39),L(92,39),tn=L(93,39),L(94,39),L(95,39),L(96,39),L(97,39),L(101,49),L(102,49),L(103,49),L(104,49),L(105,49),L(106,49),L(107,49)})),rn=t((()=>{nn(),nn()})),an,on,sn,cn,ln,un,dn,fn=t((()=>{_(),rn(),an=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=on(n),c=ln[e]({failed:a,reject:o,piped:r}),l=dn[e]({reject:o});return`${$t(`[${s}]`)} ${$t(`[${i}]`)} ${l(c)} ${l(t)}`},on=e=>`${sn(e.getHours(),2)}:${sn(e.getMinutes(),2)}:${sn(e.getSeconds(),2)}.${sn(e.getMilliseconds(),3)}`,sn=(e,t)=>String(e).padStart(t,`0`),cn=({failed:e,reject:t})=>e?t?y.cross:y.warning:y.tick,ln={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:cn,duration:cn},un=e=>e,dn={command:()=>Qt,output:()=>un,ipc:()=>un,error:({reject:e})=>e?en:tn,duration:()=>$t}})),pn,mn,hn,gn=t((()=>{I(),pn=(e,t,n)=>{let r=Ft(t,n);return e.map(({verboseLine:e,verboseObject:t})=>mn(e,t,r)).filter(e=>e!==void 0).map(e=>hn(e)).join(``)},mn=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},hn=e=>e.endsWith(`
8
- `)?e:`${e}\n`})),_n,vn,yn,bn,xn,Sn,Cn=t((()=>{Xt(),fn(),gn(),_n=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=vn({type:e,result:i,verboseInfo:r}),o=pn(yn(t,a),r,n);o!==``&&console.warn(o.slice(0,-1))},vn=({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}),yn=(e,t)=>e.split(`
9
- `).map(e=>bn({...t,message:e})),bn=e=>({verboseLine:an(e),verboseObject:e}),xn=e=>Vt(typeof e==`string`?e:oe(e)).replaceAll(` `,` `.repeat(Sn)),Sn=2})),wn,Tn=t((()=>{I(),Cn(),wn=(e,t)=>{Nt(t)&&_n({type:`command`,verboseMessage:e,verboseInfo:t})}})),En,Dn,On,kn,An=t((()=>{I(),En=(e,t,n)=>(kn(e),{verbose:e,escapedCommand:t,commandId:Dn(e),rawOptions:n}),Dn=e=>Nt({verbose:e})?On++:void 0,On=0n,kn=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(!zt.includes(t)&&!Rt(t)){let e=zt.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}}})),jn,Mn,Nn=t((()=>{jn=()=>de.bigint(),Mn=e=>Number(de.bigint()-e)/1e6})),Pn,Fn=t((()=>{Tn(),An(),Nn(),Xt(),F(),Pn=(e,t,n)=>{let r=jn(),{command:i,escapedCommand:a}=Bt(e,t),o=En(bt(n,`verbose`),a,{...n});return wn(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}}})),In=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)}})),Ln=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}})),Rn=r(((t,n)=>{e(`fs`);var r=process.platform===`win32`||global.TESTING_WINDOWS?In():Ln();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}}})),zn=r(((t,n)=>{var r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=e(`path`),a=r?`;`:`:`,o=Rn(),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)}})),Bn=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})),Vn=r(((t,n)=>{var r=e(`path`),i=zn(),a=Bn();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})),Hn=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})),Un=r(((e,t)=>{t.exports=/^#!(.*)/})),Wn=r(((e,t)=>{var n=Un();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}})),Gn=r(((t,n)=>{var r=e(`fs`),i=Wn();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})),Kn=r(((t,n)=>{var r=e(`path`),i=Vn(),a=Hn(),o=Gn(),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})),qn=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}})),Jn=r(((t,n)=>{var r=e(`child_process`),i=Kn(),a=qn();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 Yn(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 Xn=t((()=>{})),Zn=t((()=>{}));function Qn(e){return e instanceof URL?Fe(e):e}function $n(e){return{*[Symbol.iterator](){let t=w.resolve(Qn(e)),n;for(;n!==t;)yield t,n=t,t=w.resolve(t,`..`)}}}var er=t((()=>{Zn(),se(me)})),tr,nr,rr,ir,ar=t((()=>{Xn(),er(),tr=({cwd:e=C.cwd(),path:t=C.env[Yn()],preferLocal:n=!0,execPath:r=C.execPath,addExecPath:i=!0}={})=>{let a=w.resolve(Qn(e)),o=[],s=t.split(w.delimiter);return n&&nr(o,s,a),i&&rr(o,s,r,a),t===``||t===w.delimiter?`${o.join(w.delimiter)}${t}`:[...o,t].join(w.delimiter)},nr=(e,t,n)=>{for(let r of $n(n)){let n=w.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},rr=(e,t,n,r)=>{let i=w.resolve(r,Qn(n),`..`);t.includes(i)||e.push(i)},ir=({env:e=C.env,...t}={})=>{e={...e};let n=Yn({env:e});return t.path=e[n],e[n]=tr(t),e}})),or,sr,cr,lr,ur,dr,fr,pr,R=t((()=>{or=(e,t,n)=>new(n?pr:fr)(t,e instanceof sr?{}:{cause:e}),sr=class extends Error{},cr=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,ur,{value:!0,writable:!1,enumerable:!1,configurable:!1})},lr=e=>dr(e)&&ur in e,ur=Symbol(`isExecaError`),dr=e=>Object.prototype.toString.call(e)===`[object Error]`,fr=class extends Error{},cr(fr,fr.name),pr=class extends Error{},cr(pr,pr.name)})),mr,hr,gr,_r=t((()=>{mr=()=>{let e=64-gr+1;return Array.from({length:e},hr)},hr=(e,t)=>({name:`SIGRT${t+1}`,number:gr+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),gr=34})),vr,yr=t((()=>{vr=[{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`}]})),br,xr,Sr=t((()=>{yr(),_r(),br=()=>{let e=mr();return[...vr,...e].map(xr)},xr=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=Ce,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}}})),Cr,wr,Tr,Er,Dr,Or,kr=t((()=>{_r(),Sr(),Cr=()=>{let e=br();return Object.fromEntries(e.map(wr))},wr=({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}],Tr=Cr(),Er=()=>{let e=br(),t=Array.from({length:65},(t,n)=>Dr(n,e));return Object.assign({},...t)},Dr=(e,t)=>{let n=Or(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}}},Or=(e,t)=>{let n=t.find(({name:t})=>Ce.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n},Er()})),Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr=t((()=>{kr(),Ar=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Mr(e,t)},jr=e=>e===0?e:Mr(e,"`subprocess.kill()`'s argument"),Mr=(e,t)=>{if(Number.isInteger(e))return Nr(e,t);if(typeof e==`string`)return Ir(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Lr()}`)},Nr=(e,t)=>{if(Fr.has(e))return Fr.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Lr()}`)},Pr=()=>new Map(Object.entries(Ce.signals).reverse().map(([e,t])=>[t,e])),Fr=Pr(),Ir=(e,t)=>{if(e in Ce.signals)return e;throw e.toUpperCase()in Ce.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Lr()}`)},Lr=()=>`Available signal names: ${Rr()}.
10
- Available signal numbers: ${zr()}.`,Rr=()=>Object.keys(Ce.signals).sort().map(e=>`'${e}'`).join(`, `),zr=()=>[...new Set(Object.values(Ce.signals).sort((e,t)=>e-t))].join(`, `),Br=e=>Tr[e].description})),Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr=t((()=>{R(),Vr(),Hr=e=>{if(e===!1)return e;if(e===!0)return Ur;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ur=1e3*5,Wr=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Gr(o,s,n);Kr(l,r);let u=e(c);return qr({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Gr=(e,t,n)=>{let[r=n,i]=dr(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&&!dr(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:jr(r),error:i}},Kr=(e,t)=>{e!==void 0&&t.reject(e)},qr=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&Jr({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},Jr=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await ze(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??(n.isForcefullyTerminated=!0))}catch{}}})),Xr,Zr=t((()=>{Xr=async(e,t)=>{e.aborted||await T(e,`abort`,{signal:t})}})),Qr,$r,ei,ti=t((()=>{Zr(),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)}`)},$r=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[ei(e,t,r,i)],ei=async(e,t,n,{signal:r})=>{throw await Xr(t,r),n.terminationReason??(n.terminationReason=`cancel`),e.kill(),t.reason}})),ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,z,_i,B,vi,yi=t((()=>{ni=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{ri(e,t,n),ii(e,t,r)},ri=(e,t,n)=>{if(!n)throw Error(`${z(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},ii=(e,t,n)=>{if(!n)throw Error(`${z(e,t)} cannot be used: the ${B(t)} has already exited or disconnected.`)},ai=e=>{throw Error(`${z(`getOneMessage`,e)} could not complete: the ${B(e)} exited or disconnected.`)},oi=e=>{throw Error(`${z(`sendMessage`,e)} failed: the ${B(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
- ${z(`getOneMessage`,e)},
15
- ${z(`sendMessage`,e,`message, {strict: true}`)},
16
- ]);`)},si=(e,t)=>Error(`${z(`sendMessage`,t)} failed when sending an acknowledgment response to the ${B(t)}.`,{cause:e}),ci=e=>{throw Error(`${z(`sendMessage`,e)} failed: the ${B(e)} is not listening to incoming messages.`)},li=e=>{throw Error(`${z(`sendMessage`,e)} failed: the ${B(e)} exited without listening to incoming messages.`)},ui=()=>Error(`\`cancelSignal\` aborted: the ${B(!0)} disconnected.`),di=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},fi=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${z(t,n)} cannot be used: the ${B(n)} is disconnecting.`,{cause:e})},pi=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(mi(e))throw Error(`${z(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},mi=({code:e,message:t})=>hi.has(e)||gi.some(e=>t.includes(e)),hi=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),gi=[`could not be cloned`,`circular structure`,`call stack size exceeded`],z=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${_i(t)}${e}(${n})`,_i=e=>e?``:`subprocess.`,B=e=>e?`parent process`:`subprocess`,vi=e=>{e.connected&&e.disconnect()}})),bi,xi=t((()=>{bi=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)}})),Si,Ci,V,wi,Ti,Ei,Di,Oi,ki,Ai,ji,H=t((()=>{F(),Si=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=V.get(e),i=wi(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(Di(i,t,n,!0));return a},Ci=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=V.get(e),i=wi(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(Di(i,t,n,!1));return a},V=new WeakMap,wi=(e,t,n)=>{let r=Ti(t,n);return Ei(r,t,n,e),r},Ti=(e,t)=>{let n=Dt(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(`"${Ai(t)}" must not be "${e}".
17
- It must be ${r} or "fd3", "fd4" (and so on).
18
- It is optional and defaults to "${i}".`)},Ei=(e,t,n,r)=>{let i=r[ki(e)];if(i===void 0)throw TypeError(`"${Ai(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(`"${Ai(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${Ai(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Di=(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}=Oi(e,n);return`The "${i}: ${ji(a)}" option is incompatible with using "${Ai(r)}: ${ji(t)}".
20
- Please set this option with "pipe" instead.`},Oi=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=ki(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]}},ki=e=>e===`all`?1:e,Ai=e=>e?`to`:`from`,ji=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`})),Mi,Ni=t((()=>{Mi=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),Ee(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))}})),Pi,Fi,Ii,Li,Ri,zi,Bi=t((()=>{Pi=(e,t)=>{t&&Fi(e)},Fi=e=>{e.refCounted()},Ii=(e,t)=>{t&&Li(e)},Li=e=>{e.unrefCounted()},Ri=(e,t)=>{t&&(Li(e),Li(e))},zi=(e,t)=>{t&&(Fi(e),Fi(e))}})),Vi,Hi,Ui,Wi=t((()=>{pa(),Bi(),oa(),Oa(),Vi=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(ea(i)||wa(i))return;Ui.has(e)||Ui.set(e,[]);let a=Ui.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await la(e,r,i),await Le.yield();let o=await $i({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Hi=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{Ea();let a=Ui.get(e);for(;a?.length>0;)await T(r,`message:done`);e.removeListener(`message`,i),zi(t,n),r.connected=!1,r.emit(`disconnect`)},Ui=new WeakMap})),Gi,Ki,qi,Ji,Yi=t((()=>{Wi(),Bi(),Gi=(e,t,n)=>{if(Ki.has(e))return Ki.get(e);let r=new Te;return r.connected=!0,Ki.set(e,r),qi({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Ki=new WeakMap,qi=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Vi.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Hi.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Ri(n,r)},Ji=e=>{let t=Ki.get(e);return t===void 0?e.channel!==null:t.connected}})),Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa=t((()=>{xi(),Ni(),ya(),yi(),Yi(),pa(),Xi=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=da(e,Gi(e,t,n));return{id:Zi++,type:ia,message:r,hasListeners:a}},Zi=0n,Qi=(e,t)=>{if(!(t?.type!==ia||t.hasListeners))for(let{id:t}of e)t!==void 0&&na[t].resolve({isDeadlock:!0,hasListeners:!1})},$i=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==ia||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:aa,message:da(t,i)};try{await ma({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},ea=e=>{if(e?.type!==aa)return!1;let{id:t,message:n}=e;return na[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},ta=async(e,t,n)=>{if(e?.type!==ia)return;let r=bi();na[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,ra(t,n,i)]);e&&oi(n),a||ci(n)}finally{i.abort(),delete na[e.id]}},na={},ra=async(e,t,{signal:n})=>{Mi(e,1,n),await T(e,`disconnect`,{signal:n}),li(t)},ia=`execa:ipc:request`,aa=`execa:ipc:response`})),sa,ca,la,ua,da,fa,pa=t((()=>{xi(),F(),H(),oa(),sa=(e,t,n)=>{ua.has(e)||ua.set(e,new Set);let r=ua.get(e),i={onMessageSent:bi(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},ca=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},la=async(e,t,n)=>{for(;!da(e,t)&&ua.get(e)?.size>0;){let t=[...ua.get(e)];Qi(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},ua=new WeakMap,da=(e,t)=>t.listenerCount(`message`)>fa(e),fa=e=>V.has(e)&&!Mt(V.get(e).options.buffer,`ipc`)?1:0})),ma,ha,ga,_a,va,ya=t((()=>{yi(),pa(),oa(),ma=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return ni({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),ha({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},ha=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Xi({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=sa(e,o,a);try{await ga({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw vi(e),t}finally{ca(s)}},ga=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=_a(e);try{await Promise.all([ta(r,e,n),a(r)])}catch(e){throw fi({error:e,methodName:t,isSubprocess:n}),pi({error:e,methodName:t,isSubprocess:n,message:i}),e}},_a=e=>{if(va.has(e))return va.get(e);let t=se(e.send.bind(e));return va.set(e,t),t},va=new WeakMap})),ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa=t((()=>{ya(),Yi(),yi(),ba=(e,t)=>{let n=`cancelSignal`;return ii(n,!1,e.connected),ga({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:Ta,message:t},message:t})},xa=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await Sa({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),Da.signal),Sa=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!Ca){if(Ca=!0,!r){di();return}if(t===null){Ea();return}Gi(e,t,n),await Le.yield()}},Ca=!1,wa=e=>e?.type===Ta?(Da.abort(e.message),!0):!1,Ta=`execa:ipc:cancel`,Ea=()=>{Da.abort(ui())},Da=new AbortController})),ka,Aa,ja,Ma,Na=t((()=>{Zr(),Oa(),Yr(),ka=({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.")}},Aa=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[ja({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],ja=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await Xr(t,i),await ba(e,Ma(t)),Jr({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??(r.terminationReason=`gracefulCancel`),t.reason},Ma=({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}})),Pa,Fa,Ia,La=t((()=>{R(),Pa=({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})`)},Fa=(e,t,n,r)=>t===0||t===void 0?[]:[Ia(e,t,n,r)],Ia=async(e,t,n,{signal:r})=>{throw await ze(t,void 0,{signal:r}),n.terminationReason??(n.terminationReason=`timeout`),e.kill(),new sr}})),Ra,za,Ba=t((()=>{Ge(),Ra=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},za=(e,t,{node:n=!1,nodePath:r=ue,nodeOptions:i=le.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=Ve(r,`The "nodePath" option`),l=w.resolve(a,c),u={...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(w.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}]}})),Va,Ha,Ua,Wa,Ga,Ka=t((()=>{Va=({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`.");Wa[n](e)}},Ha=e=>{try{Be(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Ua=e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},Wa={advanced:Ha,json:Ua},Ga=async(e,t)=>{t!==void 0&&await e.sendMessage(t)}})),qa,Ja,U,Ya,Xa,Za,Qa,$a=t((()=>{qa=({encoding:e})=>{if(Ya.has(e))return;let t=Xa(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Qa(e)}\`.
21
- Please rename it to ${Qa(t)}.`);let n=[...Ya].map(e=>Qa(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Qa(e)}\`.
22
- Please rename it to one of: ${n}.`)},Ja=new Set([`utf8`,`utf16le`]),U=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Ya=new Set([...Ja,...U]),Xa=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Za)return Za[t];if(Ya.has(t))return t},Za={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Qa=e=>typeof e==`string`?`"${e}"`:String(e)})),eo,to,no,ro=t((()=>{Ge(),eo=(e=to())=>{let t=Ve(e,`The "cwd" option`);return w.resolve(t)},to=()=>{try{return C.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},no=(e,t)=>{if(t===to())return e;let n;try{n=xe(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}`}})),io,ao,oo,so,co=t((()=>{io=n(Jn(),1),ar(),Yr(),Vr(),ti(),Na(),La(),Ba(),Ka(),$a(),ro(),Ge(),F(),ao=(e,t,n)=>{n.cwd=eo(n.cwd);let[r,i,a]=za(e,t,n),{command:o,args:s,options:c}=io.default._parse(r,i,a),l=yt(c),u=oo(l);return Pa(u),qa(u),Va(u),Qr(u),ka(u),u.shell=We(u.shell),u.env=so(u),u.killSignal=Ar(u.killSignal),u.forceKillAfterDelay=Hr(u.forceKillAfterDelay),u.lines=u.lines.map((e,t)=>e&&!U.has(u.encoding)&&u.buffer[t]),C.platform===`win32`&&w.basename(o,`.exe`)===`cmd`&&s.unshift(`/q`),{file:o,commandArguments:s,options:u}},oo=({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}),so=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{...C.env,...e}:e;return n||r?ir({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o}})),lo,uo=t((()=>{lo=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n]}));function fo(e){if(typeof e==`string`)return po(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return mo(e)}var po,mo,ho,go,_o,vo,yo=t((()=>{po=e=>e.at(-1)===ho?e.slice(0,e.at(-2)===_o?-2:-1):e,mo=e=>e.at(-1)===go?e.subarray(0,e.at(-2)===vo?-2:-1):e,ho=`
23
- `,go=ho.codePointAt(0),_o=`\r`,vo=_o.codePointAt(0)}));function W(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 bo(e,{checkOpen:t=!0}={}){return W(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 xo(e,{checkOpen:t=!0}={}){return W(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 So(e,t){return bo(e,t)&&xo(e,t)}var Co=t((()=>{}));async function wo(){if(d(K,this))return{done:!0,value:void 0};let e;try{e=await d(G,this).read()}catch(e){throw p(q,this,void 0),p(K,this,!0),d(G,this).releaseLock(),e}return e.done&&(p(q,this,void 0),p(K,this,!0),d(G,this).releaseLock()),e}async function To(e){if(d(K,this))return{done:!0,value:e};if(p(K,this,!0),!d(Ao,this)){let t=d(G,this).cancel(e);return d(G,this).releaseLock(),await t,{done:!0,value:e}}return d(G,this).releaseLock(),{done:!0,value:e}}function Eo(){return this[No].next()}function Do(e){return this[No].return(e)}function Oo({preventCancel:e=!1}={}){let t=this.getReader(),n=new Mo(t,e),r=Object.create(Po);return r[No]=n,r}var ko,G,Ao,K,q,jo,Mo,No,Po,Fo=t((()=>{m(),s(),l(),u(),c(),ko=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),G=new WeakMap,Ao=new WeakMap,K=new WeakMap,q=new WeakMap,jo=new WeakSet,Mo=class{constructor(e,t){h(this,jo),f(this,G,void 0),f(this,Ao,void 0),f(this,K,!1),f(this,q,void 0),p(G,this,e),p(Ao,this,t)}next(){let e=()=>o(jo,this,wo).call(this);return p(q,this,d(q,this)?d(q,this).then(e,e):e()),d(q,this)}return(e){let t=()=>o(jo,this,To).call(this,e);return d(q,this)?d(q,this).then(t,t):t()}},No=Symbol(),Object.defineProperty(Eo,"name",{value:`next`}),Object.defineProperty(Do,"name",{value:`return`}),Po=Object.create(ko,{next:{enumerable:!0,configurable:!0,writable:!0,value:Eo},return:{enumerable:!0,configurable:!0,writable:!0,value:Do}})})),Io=t((()=>{Fo()})),Lo,Ro,zo,Bo,Vo,Ho=t((()=>{Co(),Io(),Lo=e=>{if(xo(e,{checkOpen:!1})&&Vo.on!==void 0)return zo(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Ro.call(e)===`[object ReadableStream]`)return Oo.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Ro}=Object.prototype,zo=async function*(e){let t=new AbortController,n={};Bo(e,t,n);try{for await(let[n]of Vo.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()}},Bo=async(e,t,n)=>{try{await Vo.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},Vo={}})),Uo,Wo,Go,Ko,qo,Jo,Yo,Xo=t((()=>{Ho(),i(),Uo=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Lo(e),u=t();u.length=0;try{for await(let e of l){let t=n[qo(e)](e,u);Go({convertedChunk:t,state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return Wo({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}},Wo=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&Go({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},Go=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Ko(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Ko(c,t,i,a),new Yo},Ko=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},qo=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=Jo.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Jo.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Jo}=Object.prototype,Yo=class extends Error{constructor(){super(`maxBuffer exceeded`),a(this,`name`,`MaxBufferError`)}}})),J,Zo,Qo,$o,es,ts=t((()=>{J=e=>e,Zo=()=>void 0,Qo=({contents:e})=>e,$o=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},es=e=>e.length}));async function ns(e,t){return Uo(e,os,t)}var rs,is,as,os,ss=t((()=>{Xo(),ts(),rs=()=>({contents:[]}),is=()=>1,as=(e,{contents:t})=>(t.push(e),t),os={init:rs,convertChunk:{string:J,buffer:J,arrayBuffer:J,dataView:J,typedArray:J,others:J},getSize:is,truncateChunk:Zo,addChunk:as,getFinalChunk:Zo,finalize:Qo}}));async function cs(e,t){return Uo(e,Ss,t)}var ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs=t((()=>{Xo(),ts(),ls=()=>({contents:new ArrayBuffer(0)}),us=e=>ds.encode(e),ds=new TextEncoder,fs=e=>new Uint8Array(e),ps=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ms=(e,t)=>e.slice(0,t),hs=(e,{contents:t,length:n},r)=>{let i=xs()?_s(t,r):gs(t,r);return new Uint8Array(i).set(e,n),i},gs=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(vs(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},_s=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:vs(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},vs=e=>ys**Math.ceil(Math.log(e)/Math.log(ys)),ys=2,bs=({contents:e,length:t})=>xs()?e:e.slice(0,t),xs=()=>`resize`in ArrayBuffer.prototype,Ss={init:ls,convertChunk:{string:us,buffer:fs,arrayBuffer:fs,dataView:ps,typedArray:ps,others:$o},getSize:es,truncateChunk:ms,addChunk:hs,getFinalChunk:Zo,finalize:bs}}));async function ws(e,t){return Uo(e,As,t)}var Ts,Es,Ds,Os,ks,As,js=t((()=>{Xo(),ts(),Ts=()=>({contents:``,textDecoder:new TextDecoder}),Es=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Ds=(e,{contents:t})=>t+e,Os=(e,t)=>e.slice(0,t),ks=({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},As={init:Ts,convertChunk:{string:J,buffer:Es,arrayBuffer:Es,dataView:Es,typedArray:Es,others:$o},getSize:es,truncateChunk:Os,addChunk:Ds,getFinalChunk:ks,finalize:Qo}})),Ms=t((()=>{ss(),Cs(),js(),Xo()})),Ns=t((()=>{Ms()})),Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs=t((()=>{Ns(),P(),F(),Ps=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof Yo))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:Fs(n,r,i)},t.destroy(),e},Fs=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,Is=(e,t,n)=>{if(t.length!==n)return;let r=new Yo;throw r.maxBufferInfo={fdNumber:`ipc`},r},Ls=(e,t)=>{let{streamName:n,threshold:r,unit:i}=Rs(e,t);return`Command's ${n} was larger than ${r} ${i}`},Rs=(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=Mt(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:vt(n),threshold:i,unit:r}},zs=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>Vs(n)),Bs=(e,t,n)=>{if(!t)return e;let r=Vs(n);return e.length>r?e.slice(0,r):e},Vs=([,e])=>e})),Us,Ws,Gs,Ks,qs,Js,Ys,Xs=t((()=>{yo(),j(),ro(),Xt(),Hs(),Vr(),R(),Us=({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=Ws({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=Ks(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=>qs(e)).join(`
24
- `)].map(e=>Vt(fo(Js(e)))).filter(Boolean).join(`
25
-
26
- `)}},Ws=({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=Gs(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?`${Ls(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${Br(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}`},Gs=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,Ks=(e,t)=>{if(e instanceof sr)return;let n=Vt(no(lr(e)?e.originalMessage:String(e?.message??e),t));return n===``?void 0:n},qs=e=>typeof e==`string`?e:oe(e),Js=e=>Array.isArray(e)?e.map(e=>fo(Ys(e))).filter(Boolean).join(`
27
- `):Ys(e),Ys=e=>typeof e==`string`?e:A(e)?et(e):``})),Zs,Qs,$s,ec,tc,nc,rc=t((()=>{Vr(),Nn(),R(),Xs(),Zs=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>tc({command:e,escapedCommand:t,cwd:a,durationMs:Mn(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})=>$s({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}),$s=({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}=nc(l,u),{originalMessage:ne,shortMessage:re,message:ie}=Us({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}),S=or(e,ie,b);return Object.assign(S,ec({error:S,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})),S},ec=({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:_})=>tc({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:Mn(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:[]}),tc=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),nc=(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:Br(t)}}}));function ic(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(sc(e*1e3)%1e3),nanoseconds:Math.trunc(sc(e*1e6)%1e3)}}function ac(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 oc(e){switch(typeof e){case`number`:if(Number.isFinite(e))return ic(e);break;case`bigint`:return ac(e)}throw TypeError(`Expected a finite number or bigint`)}var sc,cc=t((()=>{sc=e=>Number.isFinite(e)?e:0}));function lc(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+fc);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&uc(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?` `+dc(n,e):r;i.push(a)}},s=oc(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%pc):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 uc,dc,fc,pc,mc=t((()=>{cc(),uc=e=>e===0||e===0n,dc=(e,t)=>t===1||t===1n?e:`${e}s`,fc=1e-7,pc=24n*60n*60n*1000n})),hc,gc=t((()=>{Cn(),hc=(e,t)=>{e.failed&&_n({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})}})),_c,vc,yc=t((()=>{mc(),I(),Cn(),gc(),_c=(e,t)=>{Nt(t)&&(hc(e,t),vc(e,t))},vc=(e,t)=>{_n({type:`duration`,verboseMessage:`(done in ${lc(e.durationMs)})`,verboseInfo:t,result:e})}})),bc,xc=t((()=>{yc(),bc=(e,t,{reject:n})=>{if(_c(e,t),e.failed&&n)throw e;return e}})),Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,Y,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,X,qc,Jc,Yc,Xc,Zc,Z=t((()=>{Co(),k(),j(),Sc=(e,t)=>Y(e)?`asyncGenerator`:jc(e)?`generator`:Nc(e)?`fileUrl`:Fc(e)?`filePath`:Hc(e)?`webStream`:W(e,{checkOpen:!1})?`native`:A(e)?`uint8Array`:Wc(e)?`asyncIterable`:Gc(e)?`iterable`:Uc(e)?Tc({transform:e},t):Mc(e)?Cc(e,t):`native`,Cc=(e,t)=>So(e.transform,{checkOpen:!1})?wc(e,t):Uc(e.transform)?Tc(e,t):Oc(e,t),wc=(e,t)=>(Ec(e,t,`Duplex stream`),`duplex`),Tc=(e,t)=>(Ec(e,t,`web TransformStream`),`webTransform`),Ec=({final:e,binary:t,objectMode:n},r,i)=>{Dc(e,`${r}.final`,i),Dc(t,`${r}.binary`,i),kc(n,`${r}.objectMode`)},Dc=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Oc=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Ac(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(So(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Uc(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Ac(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return kc(n,`${i}.binary`),kc(r,`${i}.objectMode`),Y(e)||Y(t)?`asyncGenerator`:`generator`},kc=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},Ac=e=>Y(e)||jc(e),Y=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,jc=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Mc=e=>O(e)&&(e.transform!==void 0||e.final!==void 0),Nc=e=>Object.prototype.toString.call(e)===`[object URL]`,Pc=e=>Nc(e)&&e.protocol!==`file:`,Fc=e=>O(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>Ic.has(e))&&Lc(e.file),Ic=new Set([`file`,`append`]),Lc=e=>typeof e==`string`,Rc=(e,t)=>e===`native`&&typeof t==`string`&&!zc.has(t),zc=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),Bc=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,Vc=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,Hc=e=>Bc(e)||Vc(e),Uc=e=>Bc(e?.readable)&&Vc(e?.writable),Wc=e=>Kc(e)&&typeof e[Symbol.asyncIterator]==`function`,Gc=e=>Kc(e)&&typeof e[Symbol.iterator]==`function`,Kc=e=>typeof e==`object`&&!!e,X=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),qc=new Set([`fileUrl`,`filePath`,`fileNumber`]),Jc=new Set([`fileUrl`,`filePath`]),Yc=new Set([...Jc,`webStream`,`nodeStream`]),Xc=new Set([`webTransform`,`duplex`]),Zc={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,$c,el,tl,nl=t((()=>{Z(),Qc=(e,t,n,r)=>r===`output`?$c(e,t,n):el(e,t,n),$c=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},el=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},tl=(e,t)=>{let n=e.findLast(({type:e})=>X.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode}})),rl,il,al,ol,sl,cl,ll,ul=t((()=>{k(),$a(),Z(),nl(),rl=(e,t,n,r)=>[...e.filter(({type:e})=>!X.has(e)),...il(e,t,n,r)],il=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>X.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=al({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return ll(a,n)},al=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?ol({stdioItem:e,optionName:i}):t===`webTransform`?sl({stdioItem:e,index:n,newTransforms:r,direction:a}):cl({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),ol=({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}}},sl=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=O(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=Qc(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},cl=({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}=O(t)?t:{transform:t},d=c||U.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}}},ll=(e,t)=>t===`input`?e.reverse():e})),dl,fl,pl,ml,hl,gl,_l,vl,yl=t((()=>{Co(),Z(),dl=(e,t,n)=>{let r=e.map(e=>fl(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)??vl},fl=({type:e,value:t},n)=>pl[n]??gl[e](t),pl=[`input`,`output`,`output`],ml=()=>void 0,hl=()=>`input`,gl={generator:ml,asyncGenerator:ml,fileUrl:ml,filePath:ml,iterable:hl,asyncIterable:hl,uint8Array:hl,webStream:e=>Vc(e)?`output`:`input`,nodeStream(e){return xo(e,{checkOpen:!1})?bo(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:ml,duplex:ml,native(e){let t=_l(e);if(t!==void 0)return t;if(W(e,{checkOpen:!1}))return gl.nodeStream(e)}},_l=e=>{if([0,C.stdin].includes(e))return`input`;if([1,2,C.stdout,C.stderr].includes(e))return`output`},vl=`output`})),bl,xl=t((()=>{bl=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e})),Sl,Cl,wl,Tl,El,Dl,Ol=t((()=>{P(),xl(),I(),Sl=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=Cl(e,r).map((e,t)=>Tl(e,t));return a?El(o,n,i):bl(o,t)},Cl=(e,t)=>{if(e===void 0)return N.map(e=>t[e]);if(wl(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N.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,N.length);return Array.from({length:n},(t,n)=>e[n])},wl=e=>N.some(t=>e[t]!==void 0),Tl=(e,t)=>Array.isArray(e)?e.map(e=>Tl(e,t)):e??(t>=N.length?`ignore`:`pipe`),El=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!Pt(n,r)&&Dl(e)?`ignore`:e),Dl=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`)})),kl,Al,jl,Ml,Nl,Pl,Fl=t((()=>{Co(),P(),j(),H(),kl=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?Al({stdioItem:e,fdNumber:r,direction:i}):Nl({stdioItem:e,fdNumber:r}),Al=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=jl({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(W(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},jl=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Ml(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(we.isatty(i))throw TypeError(`The \`${t}: ${ji(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:Xe(be(i)),optionName:t}}},Ml=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=_t.indexOf(e);if(n!==-1)return n},Nl=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Pl(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Pl(t,t,n),optionName:n}:W(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Pl=(e,t,n)=>{let r=_t[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r}})),Il,Ll,Rl,zl,Bl,Vl=t((()=>{Co(),j(),Z(),Il=({input:e,inputFile:t},n)=>n===0?[...Ll(e),...zl(t)]:[],Ll=e=>e===void 0?[]:[{type:Rl(e),value:e,optionName:`input`}],Rl=e=>{if(xo(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(A(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},zl=e=>e===void 0?[]:[{...Bl(e),optionName:`inputFile`}],Bl=e=>{if(Nc(e))return{type:`fileUrl`,value:e};if(Lc(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")}})),Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl=t((()=>{Z(),Hl=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),Ul=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=Wl(i,e);if(o.length!==0){if(a){Gl({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(Yc.has(e))return Kl({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});Xc.has(e)&&Jl({otherStdioItems:o,type:e,value:t,optionName:n})}},Wl=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),Gl=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Jc.has(t)&&Kl({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},Kl=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>ql(e,n));if(a.length===0)return;let o=a.find(e=>e.direction!==i);return Yl(o,r,t),i===`output`?a[0].stream:void 0},ql=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,Jl=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let i=e.find(({value:{transform:e}})=>e===n.transform);Yl(i,r,t)},Yl=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Zc[n]} that is the same.`)}})),Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du=t((()=>{P(),ul(),nl(),Z(),yl(),Ol(),Fl(),Vl(),Xl(),Zl=(e,t,n,r)=>{let i=Sl(t,n,r).map((e,n)=>Ql({stdioOption:e,fdNumber:n,options:t,isSync:r})),a=ou({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:e})=>uu(e)),a},Ql=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=vt(t),{stdioItems:a,isStdioArray:o}=$l({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=dl(a,t,i),c=rl(a.map(e=>kl({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=tl(c,s);return au(c,l),{direction:s,objectMode:l,stdioItems:c}},$l=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=Hl([...(Array.isArray(e)?e:[e]).map(e=>eu(e,r)),...Il(n,t)]),a=i.length>1;return tu(i,a,r),ru(i),{stdioItems:i,isStdioArray:a}},eu=(e,t)=>({type:Sc(e,t),value:e,optionName:t}),tu=(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(nu.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},nu=new Set([`ignore`,`ipc`]),ru=e=>{for(let t of e)iu(t)},iu=({type:e,value:t,optionName:n})=>{if(Pc(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(Rc(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},au=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>qc.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},ou=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(su({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw lu(i),e}},su=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>cu({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),cu=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=Ul({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},lu=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!M(e)&&e.destroy()},uu=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`}})),fu,Q,pu,mu,hu,gu,_u=t((()=>{j(),du(),Z(),fu=(e,t)=>Zl(gu,e,t,!0),Q=({type:e,optionName:t})=>{mu(t,Zc[e])},pu=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&mu(e,`"${t}"`),{}),mu=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},hu={generator(){},asyncGenerator:Q,webStream:Q,nodeStream:Q,webTransform:Q,duplex:Q,asyncIterable:Q,native:pu},gu={input:{...hu,fileUrl:({value:e})=>({contents:[Xe(be(e))]}),filePath:({value:{file:e}})=>({contents:[Xe(be(e))]}),fileNumber:Q,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...hu,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}}})),vu,yu,bu=t((()=>{yo(),vu=(e,{stripFinalNewline:t},n)=>yu(t,n)&&e!==void 0&&!Array.isArray(e)?fo(e):e,yu=(e,t)=>t===`all`?e[1]||e[2]:e[t]})),xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu=t((()=>{xu=(e,t,n,r)=>e||n?void 0:wu(t,r),Su=(e,t,n)=>n?e.flatMap(e=>Cu(e,t)):Cu(e,t),Cu=(e,t)=>{let{transform:n,final:r}=wu(t,{});return[...n(e),...r()]},wu=(e,t)=>(t.previousChunks=``,{transform:Tu.bind(void 0,t,e),final:Du.bind(void 0,t)}),Tu=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=Eu(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=Au(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=Au(r,n.slice(i+1))),e.previousChunks=r},Eu=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),Du=function*({previousChunks:e}){e.length>0&&(yield e)},Ou=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:ku.bind(void 0,r)},ku=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?ju:Nu;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},Au=(e,t)=>`${e}${t}`,ju={windowsNewline:`\r
30
- `,unixNewline:`
31
- `,LF:`
32
- `,concatBytes:Au},Mu=(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},Nu={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Mu}})),Fu,Iu,Lu,Ru,zu,Bu,Vu=t((()=>{j(),Fu=(e,t)=>e?void 0:Iu.bind(void 0,t),Iu=function*(e,t){if(typeof t!=`string`&&!A(t)&&!Ie.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Lu=(e,t)=>e?Ru.bind(void 0,t):zu.bind(void 0,t),Ru=function*(e,t){Bu(e,t),yield t},zu=function*(e,t){if(Bu(e,t),typeof t!=`string`&&!A(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Bu=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
33
- Instead, \`yield\` should either be called with a value, or not be called at all. For example:
34
- if (condition) { yield value; }`)}})),Hu,Uu,Wu,Gu,Ku=t((()=>{j(),Hu=(e,t,n)=>{if(n)return;if(e)return{transform:Uu.bind(void 0,new TextEncoder)};let r=new Pe(t);return{transform:Wu.bind(void 0,r),final:Gu.bind(void 0,r)}},Uu=function*(e,t){Ie.isBuffer(t)?yield Xe(t):typeof t==`string`?yield e.encode(t):yield t},Wu=function*(e,t){yield A(t)?e.write(t):t},Gu=function*(e){let t=e.end();t!==``&&(yield t)}})),qu,Ju,Yu,Xu,Zu,Qu,$u=t((()=>{qu=S(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Ju=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Qu}=t[n];for await(let i of r(e))yield*Ju(i,t,n+1)},Yu=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Xu(n,Number(t),e)},Xu=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Ju(r,n,t+1)},Zu=S(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Qu=function*(e){yield e}})),ed,td,nd,rd,id,ad,od=t((()=>{ed=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},td=(e,t)=>[...t.flatMap(t=>[...nd(t,e,0)]),...rd(e)],nd=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=ad}=t[n];for(let i of r(e))yield*nd(i,t,n+1)},rd=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*id(n,Number(t),e)},id=function*(e,t,n){if(e!==void 0)for(let r of e())yield*nd(r,n,t+1)},ad=function*(e){yield e}})),sd,cd,ld,ud=t((()=>{Z(),Pu(),Vu(),Ku(),$u(),od(),sd=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=ld(e,o,a),l=Y(t),u=Y(n),d=l?qu.bind(void 0,Ju,s):ed.bind(void 0,nd),f=l||u?qu.bind(void 0,Yu,s):ed.bind(void 0,rd),p=l||u?Zu.bind(void 0,s):void 0;return{stream:new je({writableObjectMode:r,writableHighWaterMark:Ne(r),readableObjectMode:i,readableHighWaterMark:Ne(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},cd=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a)e=td(ld(t,n,r),e);return e},ld=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Fu(r,s)},Hu(n,o,r),xu(n,a,r,c),{transform:e,final:t},{transform:Lu(i,s)},Ou({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)}})),dd,fd,pd,md,hd,gd=t((()=>{ud(),j(),Z(),dd=(e,t)=>{for(let n of fd(e))pd(e,n,t)},fd=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),pd=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${Zc[e]} with synchronous methods.`)}n.input=rt(i.map(({contents:e})=>e).map(e=>md(e,r)))}},md=(e,t)=>{let n=cd(e,t,`utf8`,!0);return hd(n),rt(n)},hd=e=>{let t=e.find(e=>typeof e!=`string`&&!A(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)}})),_d,vd,yd,bd,xd,Sd,Cd,wd=t((()=>{$a(),Z(),Cn(),I(),_d=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&Pt(n,r)&&!U.has(t)&&vd(r)&&(e.some(({type:e,value:t})=>e===`native`&&yd.has(t))||e.every(({type:e})=>X.has(e))),vd=e=>e===1||e===2,yd=new Set([`pipe`,`overlapped`]),bd=async(e,t,n,r)=>{for await(let i of e)Sd(t)||Cd(i,n,r)},xd=(e,t,n)=>{for(let r of e)Cd(r,t,n)},Sd=e=>e._readableState.pipes.length>0,Cd=(e,t,n)=>{_n({type:`output`,verboseMessage:xn(e),fdNumber:t,verboseInfo:n})}})),Td,Ed,Dd,Od,kd,Ad,jd=t((()=>{wd(),ud(),Pu(),j(),Z(),Hs(),Td=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Ed({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Ed=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=Xe(Bs(e,a,d)),{stdioItems:p,objectMode:m}=t[n],h=Dd([f],p,c,r),{serializedResult:g,finalResult:_=g}=Od({chunks:h,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});kd({serializedResult:g,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let v=s[n]?_:void 0;try{return r.error===void 0&&Ad(g,p,i),v}catch(e){return r.error=e,v}},Dd=(e,t,n,r)=>{try{return cd(e,t,n,!1)}catch(t){return r.error=t,e}},Od=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:rt(e)};let o=tt(e,n);return r[a]?{serializedResult:o,finalResult:Su(o,!i[a],t)}:{serializedResult:o}},kd=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!_d({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=Su(e,!1,o);try{xd(s,t,r)}catch(e){n.error??(n.error=e)}},Ad=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>qc.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?_e(r,e):(n.add(t),Se(r,e))}}})),Md,Nd=t((()=>{j(),bu(),Md=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,vu(t,n,`all`)]:Array.isArray(t)?[vu(e,n,`all`),...t]:A(e)&&A(t)?at([e,t]):`${e}${t}`}})),Pd,Fd,Id,Ld,Rd,zd,Bd=t((()=>{R(),Pd=async(e,t)=>{let[n,r]=await Fd(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},Fd=async e=>{let[t,n]=await Promise.allSettled([T(e,`spawn`),T(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Id(e):n.value},Id=async e=>{try{return await T(e,`exit`)}catch{return Id(e)}},Ld=async e=>{let[t,n]=await e;if(!Rd(t,n)&&zd(t,n))throw new sr;return[t,n]},Rd=(e,t)=>e===void 0&&t===void 0,zd=(e,t)=>e!==0||t!==null})),Vd,Hd,Ud=t((()=>{R(),Hs(),Bd(),Vd=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=Hd(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:zs(a,r,i)}},Hd=(e,t,n)=>e===void 0?zd(t,n)?new sr:void 0:e})),Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d=t((()=>{Fn(),co(),uo(),rc(),xc(),_u(),bu(),gd(),jd(),Hs(),Nd(),Ud(),Wd=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Gd(e,t,n);return bc(Yd({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},Gd=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Pn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,Kd(n));return qd(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:fu(l,o)}},Kd=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,qd=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Jd(`ipcInput`),e&&Jd(`ipc: true`),n&&Jd(`detached: true`),r&&Jd(`cancelSignal`)},Jd=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Yd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Xd({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Vd(c,n),{output:m,error:h=l}=Td({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>vu(e,n,t)),_=vu(Md(m,n),n,`all`);return Qd({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},Xd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return dd(a,n),ge(...lo(e,t,Zd(n)))}catch(e){return Qs({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},Zd=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Vs(t)}),Qd=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?Zs({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):$s({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0})})),ef,tf,nf,rf,af,of=t((()=>{yi(),Yi(),Bi(),ef=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ni({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),tf({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),tf=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Pi(t,i);let a=Gi(e,t,n),o=new AbortController;try{return await Promise.race([nf(a,r,o),rf(a,n,o),af(a,n,o)])}catch(t){throw vi(e),t}finally{o.abort(),Ii(t,i)}},nf=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await T(e,`message`,{signal:n});return t}for await(let[r]of De(e,`message`,{signal:n}))if(t(r))return r},rf=async(e,t,{signal:n})=>{await T(e,`disconnect`,{signal:n}),ai(t)},af=async(e,t,{signal:n})=>{let[r]=await T(e,`strict:error`,{signal:n});throw si(r,t)}})),sf,cf,lf,uf,df,ff,pf=t((()=>{yi(),Yi(),Bi(),sf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>cf({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),cf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ni({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),Pi(t,a);let o=Gi(e,t,n),s=new AbortController,c={};return lf(e,o,s),uf({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),df({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},lf=async(e,t,n)=>{try{await T(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},uf=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await T(e,`strict:error`,{signal:n.signal});r.error=si(i,t),n.abort()}catch{}},df=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of De(n,`message`,{signal:a.signal}))ff(o),yield e}catch{ff(o)}finally{a.abort(),Ii(t,s),r||vi(e),i&&await e}},ff=({error:e})=>{if(e)throw e}})),mf,hf,gf,_f=t((()=>{ya(),of(),pf(),Oa(),mf=(e,{ipc:t})=>{Object.assign(e,gf(e,!1,t))},hf=()=>{let e=C,t=C.channel!==void 0;return{...gf(e,!0,t),getCancelSignal:xa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},gf=(e,t,n)=>({sendMessage:ma.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:ef.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:sf.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})})})),vf,yf,bf,xf,Sf,Cf,wf,Tf=t((()=>{du(),rc(),xc(),vf=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{lu(r);let s=new pe;yf(s,r),Object.assign(s,{readable:xf,writable:Sf,duplex:Cf});let c=Qs({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1});return{subprocess:s,promise:wf(c,o,i)}},yf=(e,t)=>{let n=bf(),r=bf(),i=bf(),a=Array.from({length:t.length-3},bf),o=bf(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},bf=()=>{let e=new Ae;return e.end(),e},xf=()=>new E({read(){}}),Sf=()=>new Me({write(){}}),Cf=()=>new ke({read(){},write(){}}),wf=async(e,t,n)=>bc(e,t,n)})),Ef,Df,Of,kf,Af=t((()=>{ud(),du(),Z(),Ef=(e,t)=>Zl(kf,e,t,!1),Df=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Zc[e]}.`)},Of={fileNumber:Df,generator:sd,asyncGenerator:sd,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:ke.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},kf={input:{...Of,fileUrl:({value:e})=>({stream:ve(e)}),filePath:({value:{file:e}})=>({stream:ve(e)}),webStream:({value:e})=>({stream:E.fromWeb(e)}),iterable:({value:e})=>({stream:E.from(e)}),asyncIterable:({value:e})=>({stream:E.from(e)}),string:({value:e})=>({stream:E.from(e)}),uint8Array:({value:e})=>({stream:E.from(Ie.from(e))})},output:{...Of,fileUrl:({value:e})=>({stream:ye(e)}),filePath:({value:{file:e,append:t}})=>({stream:ye(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:Me.fromWeb(e)}),iterable:Df,asyncIterable:Df,string:Df,uint8Array:Df}}}));function jf(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Uf(t);let t=e.some(({readableObjectMode:e})=>e),n=Mf(e,t),r=new zf({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}var Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp=t((()=>{s(),c(),l(),Mf=(e,t)=>{if(e.length===0)return Ne(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)},Nf=new WeakMap,Pf=new WeakMap,Ff=new WeakMap,If=new WeakMap,Lf=new WeakMap,Rf=new WeakMap,zf=class extends Ae{constructor(...e){super(...e),f(this,Nf,new Set([])),f(this,Pf,new Set([])),f(this,Ff,new Set([])),f(this,If,void 0),f(this,Lf,Symbol(`unpipe`)),f(this,Rf,new WeakMap)}add(e){if(Uf(e),d(Nf,this).has(e))return;d(Nf,this).add(e),d(If,this)??p(If,this,Bf(this,d(Nf,this),d(Lf,this)));let t=Wf({passThroughStream:this,stream:e,streams:d(Nf,this),ended:d(Pf,this),aborted:d(Ff,this),onFinished:d(If,this),unpipeEvent:d(Lf,this)});d(Rf,this).set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Uf(e),!d(Nf,this).has(e))return!1;let t=d(Rf,this).get(e);return t===void 0?!1:(d(Rf,this).delete(e),e.unpipe(this),await t,!0)}},Bf=async(e,t,n)=>{ep(e,tp);let r=new AbortController;try{await Promise.race([Vf(e,r),Hf(e,t,n,r)])}finally{r.abort(),ep(e,-tp)}},Vf=async(e,{signal:t})=>{try{await D(e,{signal:t,cleanup:!0})}catch(t){throw Yf(e,t),t}},Hf=async(e,t,n,{signal:r})=>{for await(let[i]of De(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Uf=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Wf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{ep(e,np);let s=new AbortController;try{await Promise.race([Gf(a,t,s),Kf({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),qf({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),ep(e,-np)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Zf(e):Jf(e))},Gf=async(e,t,{signal:n})=>{try{await e,n.aborted||Zf(t)}catch(e){n.aborted||Yf(t,e)}},Kf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await D(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Xf(r)?i.add(t):Qf(e,r)}},qf=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await T(e,i,{signal:a}),!e.readable)return T(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},Jf=e=>{e.writable&&e.end()},Yf=(e,t)=>{Xf(t)?Zf(e):Qf(e,t)},Xf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Zf=e=>{(e.readable||e.writable)&&e.destroy()},Qf=(e,t)=>{e.destroyed||(e.once(`error`,$f),e.destroy(t))},$f=()=>{},ep=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},tp=2,np=1})),ip,ap,op,sp,cp,lp=t((()=>{P(),ip=(e,t)=>{e.pipe(t),ap(e,t),sp(e,t)},ap=async(e,t)=>{if(!(M(e)||M(t))){try{await D(e,{cleanup:!0,readable:!0,writable:!1})}catch{}op(t)}},op=e=>{e.writable&&e.end()},sp=async(e,t)=>{if(!(M(e)||M(t))){try{await D(t,{cleanup:!0,readable:!1,writable:!0})}catch{}cp(e)}},cp=e=>{e.readable&&e.destroy()}})),up,dp,fp,pp,mp,hp,gp=t((()=>{rp(),P(),Ni(),Z(),lp(),up=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>X.has(e)))dp(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!X.has(e)))pp({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())ip(t.length===1?t[0]:jf(t),e)},dp=(e,t,n,r)=>{n===`output`?ip(e.stdio[r],t):ip(t,e.stdio[r]);let i=fp[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},fp=[`stdin`,`stdout`,`stderr`],pp=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;mp(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},mp=(e,{signal:t})=>{M(e)&&Mi(e,hp,t)},hp=2})),_p,vp=t((()=>{v(),_p=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=g(()=>{e.kill()});Ee(r,()=>{i()})}})),yp,bp,xp,Sp,Cp,wp=t((()=>{qe(),Nn(),H(),Ge(),yp=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=jn(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=bp(n,r,i),{sourceStream:d,sourceError:f}=Cp(e,l),{options:p,fileDescriptors:m}=V.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},bp=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=xp(e,t,...n);return{destination:r,destinationStream:Si(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},xp=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Sp,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||Ue(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]=Ke(n,...r);return{destination:t(Sp)(i,a,o),pipeOptions:o}}if(V.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Sp=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Cp=(e,t)=>{try{return{sourceStream:Ci(e,t)}}catch(e){return{sourceError:e}}}})),Tp,Ep,Dp,Op,kp=t((()=>{rc(),lp(),Tp=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Ep({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Dp({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Ep=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return cp(e),r;if(t!==void 0)return op(n),t},Dp=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>Qs({error:e,command:Op,escapedCommand:Op,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Op=`source.pipe(destination)`})),Ap,jp=t((()=>{Ap=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o}})),Mp,Np,Pp,Fp,Ip,Lp,Rp,zp=t((()=>{rp(),Ni(),lp(),Mp=(e,t,n)=>{let r=Ip.has(t)?Pp(e,t):Np(e,t);return Mi(e,Lp,n.signal),Mi(t,Rp,n.signal),Fp(t),r},Np=(e,t)=>{let n=jf([e]);return ip(n,t),Ip.set(t,n),n},Pp=(e,t)=>{let n=Ip.get(t);return n.add(e),n},Fp=async e=>{try{await D(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ip.delete(e)},Ip=new WeakMap,Lp=2,Rp=1})),Bp,Vp,Hp=t((()=>{kp(),Bp=(e,t)=>e===void 0?[]:[Vp(e,t)],Vp=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await ie(e,t),await n.remove(t),Dp({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})}})),Up,Wp,Gp,Kp=t((()=>{k(),wp(),kp(),jp(),zp(),Hp(),Up=(e,...t)=>{if(O(t[0]))return Up.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=yp(e,...t),i=Wp({...r,destination:n});return i.pipe=Up.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Wp=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Gp(e,i);Tp({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Mp(t,a,d);return await Promise.race([Ap(u),...Bp(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Gp=(e,t)=>Promise.allSettled([e,t])})),qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm=t((()=>{Ku(),Pu(),od(),qp=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Jp(t,o),Zp({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Jp=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Yp=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Xp(t,o,e);let s=e.readableObjectMode&&!a;return Zp({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Xp=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Zp=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=De(e,`data`,{signal:t.signal,highWaterMark:$p,highWatermark:$p});return em({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},Qp=Ne(!0),$p=Qp,em=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=tm({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*nd(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*rd(s)}},tm=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Hu(e,n,!t),xu(e,i,!r,{})].filter(Boolean)})),rm,im,am,om,sm,cm,lm=t((()=>{Ns(),j(),wd(),nm(),Hs(),bu(),rm=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=im({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([am(e),d]);return}let f=Yp({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:yu(c,n),allMixed:s}),[p]=await Promise.all([om({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},im=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{_d({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await bd(Yp({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},am=async e=>{await Re(),e.readableFlowing===null&&e.resume()},om=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await ns(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await cs(n,{maxBuffer:a})):await ws(n,{maxBuffer:a})}catch(n){return cm(Ps({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},sm=async e=>{try{return await e}catch(e){return cm(e)}},cm=({bufferedData:e})=>Ye(e)?new Uint8Array(e):e})),um,dm,fm,pm,mm,hm,gm,_m,vm,ym=t((()=>{um=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=dm(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],D(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||mm(e,t,n,r)}finally{o.abort()}},dm=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&fm(e,n,r),r},fm=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{pm(t,n),r.call(e,...i)}},pm=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},mm=(e,t,n,r)=>{if(!hm(e,t,n,r))throw e},hm=(e,t,n,r=!0)=>n.propagating?vm(e)||_m(e):(n.propagating=!0,gm(n,t)===r?vm(e):_m(e)),gm=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,_m=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,vm=e=>e?.code===`EPIPE`})),bm,xm,Sm=t((()=>{lm(),ym(),bm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>xm({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),xm=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=um(e,t,l);if(gm(l,t)){await u;return}let[d]=await Promise.all([rm({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d}})),Cm,wm,Tm,Em,Dm=t((()=>{rp(),Sm(),Cm=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?jf([e,t].filter(Boolean)):void 0,wm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>xm({...Tm(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Em(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Tm=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},Em=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode})),Om,km,Am=t((()=>{Cn(),I(),Om=e=>Pt(e,`ipc`),km=(e,t)=>{_n({type:`ipc`,verboseMessage:xn(e),fdNumber:`ipc`,verboseInfo:t})}})),jm,Mm,Nm=t((()=>{Hs(),Am(),F(),pf(),jm=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Om(a),s=Mt(t,`ipc`),c=Mt(n,`ipc`);for await(let t of cf({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(Is(e,i,c),i.push(t)),o&&km(t,a);return i},Mm=async(e,t)=>(await Promise.allSettled([e]),t)})),Pm,Fm,Im,Lm,Rm=t((()=>{Co(),La(),ti(),Na(),P(),Z(),lm(),Nm(),Ka(),Dm(),Sm(),Bd(),ym(),Pm=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=Pd(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=bm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=wm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),ee=[],te=jm({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:ee,verboseInfo:p}),ne=Fm(h,e,y),re=Im(m,y);try{return await Promise.race([Promise.all([{},Ld(v),Promise.all(b),x,te,Ga(e,d),...ne,...re]),g,Lm(e,_),...Fa(e,a,f,_),...$r({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Aa({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??(f.terminationReason=`other`),Promise.all([{error:e},v,Promise.all(b.map(e=>sm(e))),sm(x),Mm(te,ee),Promise.allSettled(ne),Promise.allSettled(re)])}},Fm=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:um(e,r,n)),Im=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>W(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:r,stream:i=r})=>um(i,n,t,{isSameDirection:X.has(e),stopOnExit:e===`native`}))),Lm=async(e,{signal:t})=>{let[n]=await T(e,`error`,{signal:t});throw n}})),zm,Bm,Vm,Hm=t((()=>{xi(),zm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Bm=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=bi();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Vm=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r}})),Um,Wm,Gm,Km,qm,Jm,Ym=t((()=>{ym(),Um=async e=>{if(e!==void 0)try{await Gm(e)}catch{}},Wm=async e=>{if(e!==void 0)try{await Km(e)}catch{}},Gm=async e=>{await D(e,{cleanup:!0,readable:!1,writable:!0})},Km=async e=>{await D(e,{cleanup:!0,readable:!0,writable:!1})},qm=async(e,t)=>{if(await e,t)throw t},Jm=(e,t,n)=>{n&&!_m(n)?e.destroy(n):t&&e.destroy()}})),Xm,Zm,Qm,$m,eh,th,nh,rh,ih=t((()=>{$a(),H(),nm(),xi(),Hm(),Ym(),Xm=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||U.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Zm(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Qm(s,o),{read:f,onStdoutDataDone:p}=$m({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new E({read:f,destroy:S(nh.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return th({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},Zm=(e,t,n)=>{let r=Ci(e,t);return{subprocessStdout:r,waitReadableDestroy:Bm(n,r,`readableDestroy`)}},Qm=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Qp},$m=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=bi(),o=qp({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){eh(this,o,a)},onStdoutDataDone:a}},eh=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},th=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Km(e),await r,await Um(i),await t,n.readable&&n.push(null)}catch(e){await Um(i),rh(n,e)}},nh=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Vm(n,t)&&(rh(e,r),await qm(t,r))},rh=(e,t)=>{Jm(e,e.readable,t)}})),ah,oh,sh,ch,lh,uh,dh,fh,ph=t((()=>{H(),Hm(),Ym(),ah=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=oh(e,n,t),o=new Me({...sh(r,e,i),destroy:S(dh.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return uh(r,o),o},oh=(e,t,n)=>{let r=Si(e,t);return{subprocessStdin:r,waitWritableFinal:Bm(n,r,`writableFinal`),waitWritableDestroy:Bm(n,r,`writableDestroy`)}},sh=(e,t,n)=>({write:ch.bind(void 0,e),final:S(lh.bind(void 0,e,t,n))}),ch=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},lh=async(e,t,n)=>{await Vm(n,t)&&(e.writable&&e.end(),await t)},uh=async(e,t,n)=>{try{await Gm(e),t.writable&&t.end()}catch(e){await Wm(n),fh(t,e)}},dh=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Vm(n,t),await Vm(r,t)&&(fh(e,i),await qm(t,i))},fh=(e,t)=>{Jm(e,e.writable,t)}})),mh,hh,gh=t((()=>{$a(),ih(),ph(),mh=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||U.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Zm(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=oh(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=Qm(c,s),{read:g,onStdoutDataDone:_}=$m({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new ke({read:g,...sh(u,e,d),destroy:S(hh.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return th({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),uh(u,v,c),v},hh=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([nh({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),dh({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])}})),_h,vh,yh=t((()=>{$a(),H(),nm(),_h=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||U.has(t),o=Ci(e,n),s=qp({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return vh(s,o,e)},vh=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}}})),bh,xh=t((()=>{Hm(),ih(),ph(),gh(),yh(),bh=(e,{encoding:t})=>{let n=zm();e.readable=Xm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=ah.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=mh.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=_h.bind(void 0,e,t),e[Symbol.asyncIterator]=_h.bind(void 0,e,t,{})}})),Sh,Ch,wh,Th=t((()=>{Sh=(e,t)=>{for(let[n,r]of wh){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Ch=(async()=>{})().constructor.prototype,wh=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ch,e)])})),Eh,Dh,Oh,kh,Ah,jh,Mh=t((()=>{Ns(),Fn(),co(),H(),uo(),_f(),rc(),xc(),Tf(),Af(),bu(),gp(),Yr(),vp(),Kp(),Dm(),Rm(),xh(),xi(),Th(),Eh=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Dh(e,t,n),{subprocess:f,promise:p}=kh({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Up.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Sh(f,p),V.set(f,{options:u,fileDescriptors:d}),f},Dh=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Pn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,n),u=Oh(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Ef(u,o)}},Oh=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},kh=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=he(...lo(e,t,n))}catch(e){return vf({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;Oe(1/0,l.signal);let u=[...c.stdio];up(c,s,l),_p(c,n,l);let d={},f=bi();c.kill=Wr.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Cm(c,n),bh(c,n),mf(c,n);let p=Ah({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:a,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Ah=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Pm({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});u.abort(),l.resolve();let _=m.map((e,n)=>vu(e,t,n)),v=vu(h,t,`all`);return bc(jh({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},jh=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?$s({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof Yo,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Zs({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u})})),Nh,Ph,Fh,Ih=t((()=>{k(),F(),Nh=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Ph(t,e[t],n)]));return{...e,...n}},Ph=(e,t,n)=>Fh.has(e)&&O(t)&&O(n)?{...t,...n}:n,Fh=new Set([`env`,...jt])})),$,Lh,Rh,zh=t((()=>{k(),qe(),gt(),$d(),Mh(),Ih(),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>Lh({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Lh=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(O(a))return i(e,Nh(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Rh({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Wd(s,c,l):Eh(s,c,l,i)},Rh=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ke(...st(t)?ct(t,n):[t,...n]),c=Nh(Nh(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}}})),Bh,Vh,Hh,Uh,Wh,Gh=t((()=>{Bh=({file:e,commandArguments:t})=>Hh(e,t),Vh=({file:e,commandArguments:t})=>({...Hh(e,t),isSync:!0}),Hh=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=Uh(e);return{file:n,commandArguments:r}},Uh=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(Wh)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Wh=/ +/g})),Kh,qh,Jh,Yh,Xh,Zh,Qh=t((()=>{Kh=(e,t,n)=>{e.sync=t(Jh,n),e.s=e.sync},qh=({options:e})=>Yh(e),Jh=({options:e})=>({...Yh(e),isSync:!0}),Yh=e=>({options:{...Xh(e),...e}}),Xh=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Zh={preferLocal:!0}})),$h,eg,tg,ng,rg,ig,ag=t((()=>{zh(),Gh(),Ba(),Qh(),_f(),R(),$h=$(()=>({})),eg=$(()=>({isSync:!0})),$(Bh),$(Vh),$(Ra),$(qh,{},Zh,Kh),{sendMessage:tg,getOneMessage:ng,getEachMessage:rg,getCancelSignal:ig}=hf()}));function og(e,t,n=10*dg*ug){let r;r=t===void 0?{}:t instanceof AbortSignal?{abortSignal:t,timeout:n}:t;let{abortSignal:i,timeout:a=10*dg*ug,input:o,stdio:s=[`ignore`,`pipe`,`pipe`]}=r;i?.throwIfAborted(),ee`exec: ${e.slice(0,200)}`;try{let t=eg(e,{env:process.env,maxBuffer:1e6,timeout:a,cwd:x(),stdio:s,shell:!0,reject:!1,input:o});return t.stdout&&t.stdout.trim()||null}catch{return null}}function sg(e,t,n={timeout:10*dg*ug,preserveOutputOnError:!0,useCwd:!0}){return lg(e,t,{abortSignal:n.abortSignal,timeout:n.timeout,preserveOutputOnError:n.preserveOutputOnError,cwd:n.useCwd?x():void 0,env:n.env,stdin:n.stdin,input:n.input})}function cg(e,t){return e.shortMessage?e.shortMessage:typeof e.signal==`string`?e.signal:String(t)}function lg(e,t,{abortSignal:n,timeout:r=10*dg*ug,preserveOutputOnError:i=!0,cwd:a,env:o,maxBuffer:s,shell:c,stdin:l,input:u}={timeout:10*dg*ug,preserveOutputOnError:!0,maxBuffer:1e6}){return new Promise(d=>{$h(e,t,{maxBuffer:s,cancelSignal:n,timeout:r,cwd:a,env:o,shell:c,stdin:l,input:u,reject:!1}).then(e=>{if(e.failed)if(i){let t=e.exitCode??1;d({stdout:e.stdout||``,stderr:e.stderr||``,code:t,error:cg(e,t)})}else d({stdout:``,stderr:``,code:e.exitCode??1});else d({stdout:e.stdout,stderr:e.stderr,code:0})}).catch(e=>{re(e),d({stdout:``,stderr:``,code:1})})})}var ug,dg,fg=t((()=>{ag(),b(),ne(),te(),ug=1e3,dg=60}));export{$h as a,Jn as c,fg as i,lg as n,eg as o,og as r,ag as s,sg as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as t,Xs as n,Ys as r,_i as i,hi as a,jC as o,vt as s,xt as c}from"./loadAgentsDir-B0Anodo0.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,t as d}from"./ExitFlow-DacaBTlk.js";import{spawnSync as f}from"child_process";function p(){return o(g)??`Goodbye!`}async function m(e){if(n())return e(),f(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=s()!==null;return t?(0,h.jsx)(d,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(p()),await a(0,`prompt_input_exit`),null)}var h,g;e((()=>{t(),u(),r(),i(),c(),h=l(),g=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{m as call};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,md as a,pd as o}from"./loadAgentsDir-B0Anodo0.js";import{D as s,Gt as c,I as l,P as u,T as d,ai as f,t as p,x as m}from"./src-DL3w8VPk.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{G as g,H as _,N as v,U as y,W as b,bt as x,d as S,h as C,yt as w}from"./model-BvQFFOf8.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-BKwzUpgb.js";import{t as D}from"./select-DIxfl_VN.js";import{n as O,r as k,t as A}from"./modelOptions-BBvF3wHK.js";import{t as j}from"./CustomSelect-wmZ9jz0W.js";import{n as M,t as N}from"./fetchModelList-FE8tzTDc.js";function P({initial:e,sessionModel:t,onSelect:n,onCancel:i,isStandaloneCommand:a,showFastModeNotice:f,headerText:p}){let h=T(),_=e===null?L:e,[x,S]=(0,F.useState)(_),E=r(e=>g()?e.fastMode:!1),[k,j]=(0,F.useState)(()=>new Set(w(_)?[_.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===_)?_:G[0]?.value??void 0,[G,_]),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)},[]);c({"modelPicker:toggle1M":()=>M()},{context:`ModelPicker`});function Q(e){if(e===L){n(null);return}let t=e.replace(/\[1m\]/i,``);n(k.has(t)?`${t}[1m]`:t)}let $=(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(l,{marginBottom:1,flexDirection:`column`,children:[(0,I.jsx)(u,{color:`remember`,bold:!0,children:`Select model`}),(0,I.jsx)(u,{dimColor:!0,children:p??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,I.jsxs)(u,{dimColor:!0,children:[`Currently using `,C(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,I.jsxs)(l,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsx)(l,{flexDirection:`column`,children:(0,I.jsx)(D,{defaultValue:_,defaultFocusValue:K,options:G,onChange:Q,onFocus:Z,onCancel:i??(()=>{}),visibleOptionCount:q})}),J>0&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsxs)(u,{dimColor:!0,children:[`and `,J,` more…`]})}),U&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsx)(u,{dimColor:!0,children:`正在从 API 拉取可用模型列表…`})}),B&&R===null&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsx)(u,{dimColor:!0,children:`API 拉取失败,使用内置列表`})})]}),(0,I.jsx)(l,{marginBottom:1,flexDirection:`column`,children:X?(0,I.jsxs)(u,{dimColor:!0,children:[`1M context on`,(0,I.jsx)(u,{color:`subtle`,children:` · Space to toggle`})]}):(0,I.jsxs)(u,{color:`subtle`,children:[`1M context off`,Y?` for ${Y}`:``,(0,I.jsx)(u,{color:`subtle`,children:` · Space to toggle`})]})}),g()?f?(0,I.jsx)(l,{marginBottom:1,children:(0,I.jsxs)(u,{dimColor:!0,children:[`Fast mode is `,(0,I.jsx)(u,{bold:!0,children:`ON`}),` and available with `,v,` only (/fast). Switching to other models turn off fast mode.`]})}):y()&&!b()?(0,I.jsx)(l,{marginBottom:1,children:(0,I.jsxs)(u,{dimColor:!0,children:[`Use `,(0,I.jsx)(u,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,v,` only).`]})}):null:null]}),a&&(0,I.jsx)(u,{dimColor:!0,italic:!0,children:h.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,I.jsxs)(d,{children:[(0,I.jsx)(s,{shortcut:`Enter`,action:`confirm`}),(0,I.jsx)(o,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return a?(0,I.jsx)(m,{color:`permission`,children:$}):$}var F,I,L,R=e((()=>{F=t(f(),1),x(),E(),_(),p(),i(),n(),S(),k(),M(),a(),j(),I=h(),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};
@@ -1 +0,0 @@
1
- import{cc as e,lc as t,sc as n,uc as r}from"./loadAgentsDir-B0Anodo0.js";r();export{n as drainPendingExtraction,e as executeExtractMemories,t as initExtractMemories};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,zp as a}from"./loadAgentsDir-B0Anodo0.js";import{Gt as o,I as s,Lt as c,P as l,ai as u,di as d,fi as f,j as p,t as m,y as h}from"./src-DL3w8VPk.js";import{t as g}from"./jsx-runtime-Bb4Xn-E0.js";import{Ht as _,b as v,h as y}from"./settings-B2jvL8Dp.js";import{p as b,s as x}from"./config-C-Y2qtB2.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{_ as w,l as T}from"./startupProfiler-CJdr3SxP.js";import{A as E,F as D,G as O,H as k,I as A,K as j,M,N,P,R as F,Z as I,j as L}from"./model-BvQFFOf8.js";import{n as R,t as z}from"./systemTheme-Ceakddth.js";function B({cooldown:e}){return e?(0,H.jsx)(l,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(l,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let n=R(x().theme);return t?d.dim(p(`promptBorder`,n)(`↯`)):p(`fastMode`,n)(`↯`)}var H,U=e((()=>{f(),_(),m(),b(),z(),H=g()}));function W(e,t){P(),v(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!j(e.mainLoopModel);return{...e,...t?{mainLoopModel:D(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=r(e=>e.mainLoopModel),i=r(e=>e.fastMode),u=a(),[d,f]=(0,J.useState)(i??!1),p=A(),m=p.status===`cooldown`,g=t!==null,_=E(L(!0));function v(){g||(W(d,u),C(`tengu_fast_mode_toggled`,{enabled:d,source:`picker`}),d?e(`${V(d)} Fast mode ON${j(n)?``:` · model set to ${N}`} · ${_}`):(u(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function y(){if(g){i&&W(!1,u),e(`Fast mode OFF`,{display:`system`});return}e(i?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function b(){g||f(e=>!e)}return o({"confirm:yes":v,"confirm:nextField":b,"confirm:next":b,"confirm:previous":b,"confirm:cycleMode":b,"confirm:toggle":b},{context:`Confirmation`}),(0,Y.jsxs)(h,{title:(0,Y.jsxs)(l,{children:[(0,Y.jsx)(B,{cooldown:m}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${N}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:y,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(l,{children:[`Press `,e.keyName,` again to exit`]}):g?(0,Y.jsx)(l,{children:`Esc to cancel`}):(0,Y.jsx)(l,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsx)(l,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(s,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(l,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(l,{color:d?`fastMode`:void 0,bold:d,children:d?`ON `:`OFF`}),(0,Y.jsx)(l,{dimColor:!0,children:_})]})}),m&&p.status===`cooldown`&&(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsxs)(l,{color:`warning`,children:[p.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,T(p.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(l,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(c,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=F();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),C(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${j(i)?``:` · model set to ${N}`} · ${E(L(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!O())return null;await I();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=F();return C(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{J=t(u(),1),m(),U(),i(),S(),n(),k(),w(),M(),y(),Y=g()}));export{U as a,V as i,q as n,X as r,G as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./fast-DH-C5IZs.js";t();export{n as FastModePicker,e as call};