@readmagic/workmate 0.0.20 → 0.0.22

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 (509) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-DWgTWJ7R.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +1 -0
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-s0Orgord.js +1 -0
  4. package/dist/chunks/App-BcEI6U5j.js +1 -0
  5. package/dist/chunks/ApproveApiKey-DegdTXZl.js +1 -0
  6. package/dist/chunks/ApproveApiKey-_VXIMSwY.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +2 -0
  8. package/dist/chunks/BypassPermissionsModeDialog-D2Gesf-u.js +1 -0
  9. package/dist/chunks/CustomSelect-B46Eh0gU.js +1 -0
  10. package/dist/chunks/DiffDialog-v2IiYyi3.js +6 -0
  11. package/dist/chunks/Doctor-BP0Rqraa.js +1 -0
  12. package/dist/chunks/Doctor-By_y3C2V.js +3 -0
  13. package/dist/chunks/ExitFlow-BasHk1mk.js +2 -0
  14. package/dist/chunks/Grove-C3mhgshv.js +11 -0
  15. package/dist/chunks/InvalidConfigDialog-DYVQK5js.js +1 -0
  16. package/dist/chunks/InvalidSettingsDialog-Dg6OiStR.js +1 -0
  17. package/dist/chunks/KeybindingProviderSetup-Bn1jzN5F.js +1 -0
  18. package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +1 -0
  19. package/dist/chunks/MCPToolListView-DLSrQHDc.js +1 -0
  20. package/dist/chunks/McpParsingWarnings-DZejAh8b.js +1 -0
  21. package/dist/chunks/MessageSelector-CdDlJE48.js +3 -0
  22. package/dist/chunks/Messages-DuL_r1Or.js +10 -0
  23. package/dist/chunks/Onboarding-CE2GNA-h.js +1 -0
  24. package/dist/chunks/PermissionDialog-BaibiQae.js +1 -0
  25. package/dist/chunks/PressEnterToContinue-DZc_s_pE.js +1 -0
  26. package/dist/chunks/PromptInputFooterSuggestions-lkr_A5jQ.js +1 -0
  27. package/dist/chunks/PromptInputHelpMenu-DaQKKyM5.js +1 -0
  28. package/dist/chunks/QueryEngine-DNNy1UCD.js +1 -0
  29. package/dist/chunks/REPL-CEhW-C41.js +1 -0
  30. package/dist/chunks/REPL-CkSL4C_8.js +124 -0
  31. package/dist/chunks/ResumeConversation-BMCO_3X7.js +1 -0
  32. package/dist/chunks/{SearchBox-CwwV0W-w.js → SearchBox-C9xxQzh1.js} +1 -1
  33. package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +1 -0
  34. package/dist/chunks/SelectMulti-CNE06VAN.js +1 -0
  35. package/dist/chunks/Settings-mDykHLok.js +2 -0
  36. package/dist/chunks/Spinner-DwsJJUtn.js +1 -0
  37. package/dist/chunks/SpinnerGlyph-A6G-gloN.js +1 -0
  38. package/dist/chunks/TextInput-7uqPhq9T.js +22 -0
  39. package/dist/chunks/ThemePicker-DT9zVy-0.js +1 -0
  40. package/dist/chunks/TrustDialog-G4jM9IfM.js +1 -0
  41. package/dist/chunks/{ValidationErrorsList-BfZ5gcIv.js → ValidationErrorsList-BLtP647v.js} +1 -1
  42. package/dist/chunks/add-dir-7RfQAC3h.js +1 -0
  43. package/dist/chunks/{agentDisplay-BM4QG_RX.js → agentDisplay-vLQHFrmq.js} +1 -1
  44. package/dist/chunks/agents-BNg_skSm.js +101 -0
  45. package/dist/chunks/{agents-BbDBN5l9.js → agents-DLz0kfsr.js} +1 -1
  46. package/dist/chunks/allErrors-DaztSMrw.js +1 -0
  47. package/dist/chunks/appleTerminalBackup-BYKdf3of.js +1 -0
  48. package/dist/chunks/auth-BTB00dq5.js +10 -0
  49. package/dist/chunks/auth-Bbc0Ny8i.js +1 -0
  50. package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +1 -0
  51. package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +17 -0
  52. package/dist/chunks/banner-mqZEluky.js +2 -0
  53. package/dist/chunks/branch-exFKkymg.js +2 -0
  54. package/dist/chunks/{break-cache-CcwOjTKt.js → break-cache-BL2gnDLX.js} +2 -2
  55. package/dist/chunks/btw-3l78DYET.js +1 -0
  56. package/dist/chunks/caches-6Nx6tsk9.js +1 -0
  57. package/dist/chunks/caches-ouaWB9bY.js +1 -0
  58. package/dist/chunks/claudeDesktop-D3PEgx3U.js +1 -0
  59. package/dist/chunks/{clear-DmqQBNKg.js → clear-CXfhVRp8.js} +1 -1
  60. package/dist/chunks/client-C01Bnxxv.js +1 -0
  61. package/dist/chunks/client-DYRgRQsr.js +1 -0
  62. package/dist/chunks/{client-C_jBL1yC.js → client-DdenNfkQ.js} +1 -1
  63. package/dist/chunks/client-DvhWKIOx.js +1 -0
  64. package/dist/chunks/commands-BoxOw75F.js +1 -0
  65. package/dist/chunks/compact-BOYr105K.js +2 -0
  66. package/dist/chunks/config-BddEvZZl.js +3 -0
  67. package/dist/chunks/config-GEv9hUzz.js +1 -0
  68. package/dist/chunks/config-kw4xg7Nk.js +1 -0
  69. package/dist/chunks/context-3s9wtn4L.js +1 -0
  70. package/dist/chunks/{context-noninteractive-BzDVMnWC.js → context-noninteractive-CJhUu_4y.js} +9 -9
  71. package/dist/chunks/context-noninteractive-DFvoZ2L9.js +1 -0
  72. package/dist/chunks/conversation-CoGharlH.js +1 -0
  73. package/dist/chunks/conversation-MxEVm54C.js +1 -0
  74. package/dist/chunks/conversationRecovery-Da_8uldZ.js +1 -0
  75. package/dist/chunks/convert-legacy-node-http-options-BZnGSjx2.js +1 -0
  76. package/dist/chunks/crossProjectResume-CzPCHq_K.js +40 -0
  77. package/dist/chunks/cwd-BcO6WHKo.js +1 -0
  78. package/dist/chunks/cwd-CDUelriw.js +1 -0
  79. package/dist/chunks/{datadog-Bc6wkPne.js → datadog-v_mXWncN.js} +1 -1
  80. package/dist/chunks/{debug-D58GQBDG.js → debug-8DCufdSp.js} +4 -4
  81. package/dist/chunks/detectRepository-DfX8xXw2.js +1 -0
  82. package/dist/chunks/{diff-DIg66U_d.js → diff-DJSt7QO6.js} +1 -1
  83. package/dist/chunks/directoryCompletion-CT6YVeg7.js +1 -0
  84. package/dist/chunks/doctor-DWvioSU9.js +1 -0
  85. package/dist/chunks/entry-ex0-RyYV.js +13 -0
  86. package/dist/chunks/esm-0CwQE5CJ.js +10 -0
  87. package/dist/chunks/esm-BCmY8V0C.js +1 -0
  88. package/dist/chunks/esm-BQY8jJNR.js +1 -0
  89. package/dist/chunks/esm-BUJtY-Rb.js +1 -0
  90. package/dist/chunks/esm-BadZVa27.js +1 -0
  91. package/dist/chunks/esm-BbMeEYcz.js +1 -0
  92. package/dist/chunks/esm-sVMjGuep.js +1 -0
  93. package/dist/chunks/execFileNoThrow-BsfuytkN.js +34 -0
  94. package/dist/chunks/exit-BxC_ZEtO.js +1 -0
  95. package/dist/chunks/extraUsage-DYm33Occ.js +1 -0
  96. package/dist/chunks/extractMemories-CzN3Ax2B.js +1 -0
  97. package/dist/chunks/fast-DqUpl_Lr.js +1 -0
  98. package/dist/chunks/fast-NUdUyAaM.js +1 -0
  99. package/dist/chunks/fetchModelList-CqsTAWEN.js +1 -0
  100. package/dist/chunks/fetchModelList-DBMHE6Ng.js +1 -0
  101. package/dist/chunks/fileSuggestions-B-SLfb-o.js +3 -0
  102. package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +3 -0
  103. package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +1 -0
  104. package/dist/chunks/fpsMetrics-wxj9GAsd.js +1 -0
  105. package/dist/chunks/gemini-BC9kHhwe.js +2 -0
  106. package/dist/chunks/generateSessionName-ChvKBVxB.js +1 -0
  107. package/dist/chunks/{genericProcessUtils-6E7fB1dI.js → genericProcessUtils-BYi0OefF.js} +3 -3
  108. package/dist/chunks/goal-ByyimpVU.js +3 -0
  109. package/dist/chunks/grok-DenjixMl.js +1 -0
  110. package/dist/chunks/grove-Dq8QbQ9o.js +7 -0
  111. package/dist/chunks/help-CK90i4hE.js +1 -0
  112. package/dist/chunks/history-CNQNd6hT.js +1 -0
  113. package/dist/chunks/{hooks-7iyENdDG.js → hooks-BRFDg9DV.js} +2 -2
  114. package/dist/chunks/hooks-BaYwmkxD.js +1 -0
  115. package/dist/chunks/install-ZMll-dAa.js +1 -0
  116. package/dist/chunks/instrumentation-BwVyvRfY.js +21 -0
  117. package/dist/chunks/{job-CXz7SLZp.js → job-G_ukhLc4.js} +1 -1
  118. package/dist/chunks/keybindings-wNxBzDVQ.js +1 -0
  119. package/dist/chunks/launchLocalMemory-BcRlXLm6.js +3 -0
  120. package/dist/chunks/launchOnboarding-CDjQ64RO.js +8 -0
  121. package/dist/chunks/{loadAgentsDir-DaNpxaO-.js → loadAgentsDir-C1LkW7gl.js} +571 -641
  122. package/dist/chunks/loadAgentsDir-DKXap_Om.js +1 -0
  123. package/dist/chunks/loadPluginHooks-DtmHtEiS.js +1 -0
  124. package/dist/chunks/{loader-C33o_5kS.js → loader-C61fB6vU.js} +1 -1
  125. package/dist/chunks/localSearch-BB9x5C2N.js +1 -0
  126. package/dist/chunks/{localSearch-C2SZ9bGW.js → localSearch-DFo_WTMm.js} +1 -1
  127. package/dist/chunks/log-DaILwWJa.js +1 -0
  128. package/dist/chunks/logoUtils-Dj_2SWmO.js +1 -0
  129. package/dist/chunks/{magicDocs-CrTwULyJ.js → magicDocs-DYc9TFmI.js} +2 -2
  130. package/dist/chunks/main-BRg8L_aw.js +346 -0
  131. package/dist/chunks/managedEnv-DsqAYOJ4.js +1 -0
  132. package/dist/chunks/managedEnv-lybrMred.js +1 -0
  133. package/dist/chunks/mcp-Bsw3cMiJ.js +6 -0
  134. package/dist/chunks/mcp-DDdud6Y7.js +1 -0
  135. package/dist/chunks/mcp-DbgTDUt7.js +2 -0
  136. package/dist/chunks/memory-CzwTzihf.js +1 -0
  137. package/dist/chunks/modalContext-DDZdU1J8.js +1 -0
  138. package/dist/chunks/mode-Pan-Q2c4.js +2 -0
  139. package/dist/chunks/model-BYfmXKHf.js +1 -0
  140. package/dist/chunks/model-BwBE0Pt5.js +1 -0
  141. package/dist/chunks/modelOptions-DvNBapgG.js +1 -0
  142. package/dist/chunks/nativeInstaller-DnSNJWIi.js +1 -0
  143. package/dist/chunks/notifications-B0DTaYoy.js +1 -0
  144. package/dist/chunks/omit-Dl1Us_PY.js +1 -0
  145. package/dist/chunks/onChangeAppState-4KOJMN82.js +1 -0
  146. package/dist/chunks/openai-C_6C1_0N.js +10 -0
  147. package/dist/chunks/overlayContext-CMV7nYR9.js +1 -0
  148. package/dist/chunks/panel-D9fGQgln.js +1 -0
  149. package/dist/chunks/parser-BKAVMTyD.js +1 -0
  150. package/dist/chunks/{parser-eVu-cTRs.js → parser-D8slvrJP.js} +1 -1
  151. package/dist/chunks/partition-B504IgAa.js +1 -0
  152. package/dist/chunks/pasteStore-DNV1M5Xd.js +1 -0
  153. package/dist/chunks/permissions-CLFMhdRk.js +3 -0
  154. package/dist/chunks/pidLock-D9do1Afy.js +3 -0
  155. package/dist/chunks/plan-CQLnPLuE.js +1 -0
  156. package/dist/chunks/{platform-DMQxcm4K.js → platform-Dzff1WWw.js} +1 -1
  157. package/dist/chunks/plugin-BYdF7uob.js +17 -0
  158. package/dist/chunks/pluginAutoupdate-BJaAqwTH.js +1 -0
  159. package/dist/chunks/pluginBlocklist-DKKmOnWM.js +1 -0
  160. package/dist/chunks/pluginCliCommands-z8TtJMKH.js +1 -0
  161. package/dist/chunks/{pluginFlagging-DRA0m76J.js → pluginFlagging-DQP8tBi2.js} +1 -1
  162. package/dist/chunks/pluginOperations-BcfJCDco.js +2 -0
  163. package/dist/chunks/{pluginStartupCheck-BF1N4Lih.js → pluginStartupCheck-CfRvCrFg.js} +1 -1
  164. package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +1 -0
  165. package/dist/chunks/plugins-CTM8jpOw.js +4 -0
  166. package/dist/chunks/policyLimits-a7ix6GnU.js +1 -0
  167. package/dist/chunks/poorMode-C11JEH3d.js +1 -0
  168. package/dist/chunks/{poorMode-CKQfWf3S.js → poorMode-J5SYJvoY.js} +1 -1
  169. package/dist/chunks/print-u6MzL5Cr.js +13 -0
  170. package/dist/chunks/processBashCommand-DIwrI2QC.js +1 -0
  171. package/dist/chunks/processSlashCommand-B-Gujpxm.js +5 -0
  172. package/dist/chunks/projectOnboardingState-CJycxw5P.js +1 -0
  173. package/dist/chunks/{prompt-8u06WVES.js → prompt-BGqgPgCU.js} +3 -3
  174. package/dist/chunks/prompt-BPJDGlx5.js +1 -0
  175. package/dist/chunks/prompt-DEdZzkEz.js +1 -0
  176. package/dist/chunks/promptEditor-CmQ9p4oe.js +4 -0
  177. package/dist/chunks/{protocolHandler-DzHVaPl3.js → protocolHandler-CJo9-PfZ.js} +2 -2
  178. package/dist/chunks/{proxy-BhIc7-mj.js → proxy-CB17QimU.js} +2 -2
  179. package/dist/chunks/reconciler-DSKLuOS7.js +1 -0
  180. package/dist/chunks/refresh-BbZFCNpn.js +1 -0
  181. package/dist/chunks/registerProtocol-CLIpzVwF.js +1 -0
  182. package/dist/chunks/reload-plugins-DjugL8jH.js +1 -0
  183. package/dist/chunks/rename-DOtCOtEr.js +1 -0
  184. package/dist/chunks/{renderOptions-D-aQZbzS.js → renderOptions-Zqfm2U1y.js} +1 -1
  185. package/dist/chunks/resume-BB4T4WIV.js +2 -0
  186. package/dist/chunks/ripgrep-BuzOTf1S.js +5 -0
  187. package/dist/chunks/ripgrep-CZ2CqaHb.js +1 -0
  188. package/dist/chunks/{runtimeObserver-DzesbvgI.js → runtimeObserver-CK_iZ6OB.js} +1 -1
  189. package/dist/chunks/{runtimeObserver-L6041elO.js → runtimeObserver-CpP0L9T9.js} +4 -4
  190. package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +1 -0
  191. package/dist/chunks/sandbox-toggle-KOHYvbQT.js +1 -0
  192. package/dist/chunks/searchExtraTools-CdJghGkj.js +1 -0
  193. package/dist/chunks/select-C_KXmqbI.js +1 -0
  194. package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +1 -0
  195. package/dist/chunks/sessionObserver-DB-sLv-X.js +1 -0
  196. package/dist/chunks/{sessionObserver-0D8xFoRK.js → sessionObserver-WOYv2n7C.js} +2 -2
  197. package/dist/chunks/sessionStorage-sgOAbDn7.js +1 -0
  198. package/dist/chunks/sessionTracing-yBre24PH.js +11 -0
  199. package/dist/chunks/settings-C-KNkvsM.js +1 -0
  200. package/dist/chunks/settings-DKN4xSpQ.js +24 -0
  201. package/dist/chunks/setup-CN_Pk7AR.js +3 -0
  202. package/dist/chunks/{shadowedRuleDetection-Cy9tsuKc.js → shadowedRuleDetection-Df-kZ_pK.js} +1 -1
  203. package/dist/chunks/{sideQuestion-Ds7Elgs4.js → sideQuestion-CMB8hfgX.js} +3 -3
  204. package/dist/chunks/sinks-BS17vtN0.js +1 -0
  205. package/dist/chunks/sinks-D1EjkHb4.js +1 -0
  206. package/dist/chunks/skillChangeDetector-CBKuGuEi.js +1 -0
  207. package/dist/chunks/{skillGapStore-BxCxKPev.js → skillGapStore-CfmlO6pb.js} +2 -2
  208. package/dist/chunks/{skillLifecycle-CfyNC3sW.js → skillLifecycle-BQ2LMfMx.js} +2 -2
  209. package/dist/chunks/{skillSearchPanel-CMNJFIEC.js → skillSearchPanel-BwYuwLFs.js} +4 -4
  210. package/dist/chunks/skills-BVHPQma0.js +1 -0
  211. package/dist/chunks/src-9vmGsuSI.js +1 -0
  212. package/dist/chunks/{src-CgZmCiiH.js → src-BacxF9BD.js} +2 -2
  213. package/dist/chunks/startupProfiler-B_U4QDtf.js +1 -0
  214. package/dist/chunks/startupProfiler-DTs9w9EN.js +3 -0
  215. package/dist/chunks/{state-D5D6QpTX.js → state-BowF111d.js} +1 -1
  216. package/dist/chunks/state-CGuyDES7.js +1 -0
  217. package/dist/chunks/staticRender-BVWx0IM1.js +1 -0
  218. package/dist/chunks/status-BurdTfyz.js +2 -0
  219. package/dist/chunks/status-DMq1An5h.js +1 -0
  220. package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +1 -0
  221. package/dist/chunks/stringUtils-BQm3OfeJ.js +4 -0
  222. package/dist/chunks/{switcher-DQF5ZNal.js → switcher-Bq1Ct_Sn.js} +1 -1
  223. package/dist/chunks/switcher-DGD4ORVf.js +1 -0
  224. package/dist/chunks/{tasks-C8pb6ftc.js → tasks-0c8Uy04D.js} +1 -1
  225. package/dist/chunks/tempfile-CHO5wXsV.js +1 -0
  226. package/dist/chunks/{templateJobs-DJ4dcfcL.js → templateJobs-BdFzE9XG.js} +1 -1
  227. package/dist/chunks/terminalSetup-Cf_r6pwK.js +32 -0
  228. package/dist/chunks/{terminalSetup-7PdC4fV5.js → terminalSetup-D7J6bxcn.js} +1 -1
  229. package/dist/chunks/theme-Bby4fssR.js +1 -0
  230. package/dist/chunks/tipRegistry-CyRXWWTz.js +2 -0
  231. package/dist/chunks/{toolEventObserver-D2nk8ZbW.js → toolEventObserver-CzFZUIsM.js} +1 -1
  232. package/dist/chunks/toolPool-CnrZcprA.js +1 -0
  233. package/dist/chunks/types-zk5Ltv5q.js +81 -0
  234. package/dist/chunks/udsClient-ftP0yIpe.js +1 -0
  235. package/dist/chunks/use-select-navigation-DMaC_3iw.js +1 -0
  236. package/dist/chunks/useDoublePress-C9xxQzh1.js +1 -0
  237. package/dist/chunks/useExitOnCtrlCDWithKeybindings-CjW3gUOt.js +1 -0
  238. package/dist/chunks/useMainLoopModel-DWscpA9I.js +1 -0
  239. package/dist/chunks/useManagePlugins-CYXVcql2.js +1 -0
  240. package/dist/chunks/useMergedTools-DarmnCEw.js +1 -0
  241. package/dist/chunks/useSearchInput-C2JuUW3g.js +1 -0
  242. package/dist/chunks/useSettingsErrors-DutJBiKZ.js +1 -0
  243. package/dist/chunks/util-Bq5l7FF5.js +1 -0
  244. package/dist/chunks/validatePlugin-DIdEydz_.js +1 -0
  245. package/dist/chunks/{vim-BagKUX4j.js → vim-D8prM2IH.js} +1 -1
  246. package/dist/chunks/worktree-Caqt2WRZ.js +1 -0
  247. package/dist/cli.js +1 -1
  248. package/package.json +3 -21
  249. package/dist/chunks/AddWorkspaceDirectory-BYNvxNrD.js +0 -1
  250. package/dist/chunks/AgentsMdExternalIncludesDialog-BSSz86ER.js +0 -1
  251. package/dist/chunks/AgentsMdExternalIncludesDialog-CMEGV4Md.js +0 -1
  252. package/dist/chunks/App-W_9d1DjK.js +0 -1
  253. package/dist/chunks/ApproveApiKey-Bf1Rb8Ql.js +0 -1
  254. package/dist/chunks/ApproveApiKey-wpdvXpFr.js +0 -1
  255. package/dist/chunks/BackgroundTasksDialog-lGn1Wj1k.js +0 -2
  256. package/dist/chunks/BypassPermissionsModeDialog-CjVjyNf8.js +0 -1
  257. package/dist/chunks/DiffDialog-DCpchgp5.js +0 -6
  258. package/dist/chunks/Doctor-6SjW91rd.js +0 -1
  259. package/dist/chunks/Doctor-FPYTivHw.js +0 -3
  260. package/dist/chunks/ExitFlow-Dy8_1D8J.js +0 -2
  261. package/dist/chunks/Grove-Dd6rjs5P.js +0 -11
  262. package/dist/chunks/HybridTransport-CJVkWa2u.js +0 -2
  263. package/dist/chunks/InvalidConfigDialog-Bisj9ic_.js +0 -1
  264. package/dist/chunks/InvalidSettingsDialog-DyTPNRQR.js +0 -1
  265. package/dist/chunks/MCPConnectionManager-DfyoZaiu.js +0 -1
  266. package/dist/chunks/MCPToolListView-Dioupv8F.js +0 -1
  267. package/dist/chunks/McpParsingWarnings-BUlgpZAF.js +0 -1
  268. package/dist/chunks/MessageSelector-D8fylxPg.js +0 -3
  269. package/dist/chunks/Messages-BZDFMYBT.js +0 -10
  270. package/dist/chunks/Onboarding-BKLomZYo.js +0 -1
  271. package/dist/chunks/PermissionDialog-BPhvs5xH.js +0 -1
  272. package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +0 -1
  273. package/dist/chunks/PromptInputFooterSuggestions-DCum89fF.js +0 -1
  274. package/dist/chunks/PromptInputHelpMenu-DG2lRqis.js +0 -1
  275. package/dist/chunks/QueryEngine-CyGHpX7M.js +0 -1
  276. package/dist/chunks/REPL-BDsz8KIx.js +0 -1
  277. package/dist/chunks/REPL-CCBNfZfs.js +0 -128
  278. package/dist/chunks/RemoteSessionManager-BfsOv4K6.js +0 -2
  279. package/dist/chunks/ResumeConversation-pC8NLq0F.js +0 -1
  280. package/dist/chunks/SSETransport-B3K6eH9I.js +0 -2
  281. package/dist/chunks/SearchExtraToolsTool-DYoxHo9T.js +0 -1
  282. package/dist/chunks/Settings-CKaGmKg2.js +0 -2
  283. package/dist/chunks/TeleportProgress-CkgSp1cs.js +0 -1
  284. package/dist/chunks/TeleportRepoMismatchDialog-DdO_rECq.js +0 -1
  285. package/dist/chunks/TeleportResumeWrapper-BeG4N-2z.js +0 -1
  286. package/dist/chunks/ThemePicker-iD9ufy99.js +0 -1
  287. package/dist/chunks/TrustDialog-qO5OdQt8.js +0 -1
  288. package/dist/chunks/add-dir-C4eSVlZ6.js +0 -1
  289. package/dist/chunks/agents-D3APE_8d.js +0 -101
  290. package/dist/chunks/allErrors-BkgB7JNK.js +0 -1
  291. package/dist/chunks/api-BHBK9axp.js +0 -1
  292. package/dist/chunks/api-DyUWfg3a.js +0 -1
  293. package/dist/chunks/auth-0rn1U4Eq.js +0 -10
  294. package/dist/chunks/auth-BEoTPSgC.js +0 -1
  295. package/dist/chunks/auth-BPug7U_u.js +0 -1
  296. package/dist/chunks/backgroundHousekeeping-D7xAhUaE.js +0 -1
  297. package/dist/chunks/backgroundHousekeeping-km82qEh0.js +0 -17
  298. package/dist/chunks/banner-BkUdig-T.js +0 -2
  299. package/dist/chunks/bg-tGgpwpYx.js +0 -9
  300. package/dist/chunks/branch-CQ38cx5n.js +0 -2
  301. package/dist/chunks/bridgeConfig-C5L-7KaP.js +0 -1
  302. package/dist/chunks/bridgeConfig-CJMjDoaP.js +0 -1
  303. package/dist/chunks/bridgeMessaging-DVC3qj-C.js +0 -1
  304. package/dist/chunks/bridgePointer-DfTOjgtX.js +0 -1
  305. package/dist/chunks/bridgeStatusUtil-Cex6VowM.js +0 -1
  306. package/dist/chunks/btw-_P96ffHR.js +0 -1
  307. package/dist/chunks/bundledMode--fG1S62b.js +0 -1
  308. package/dist/chunks/caches-DH-q8Fjf.js +0 -1
  309. package/dist/chunks/caches-Dq0pJFDP.js +0 -1
  310. package/dist/chunks/capacityWake-BpP6c7x3.js +0 -3
  311. package/dist/chunks/ccrClient-DO563xlf.js +0 -1
  312. package/dist/chunks/claudeDesktop-DPc_SaVn.js +0 -1
  313. package/dist/chunks/cliLaunch-DDtwAolw.js +0 -1
  314. package/dist/chunks/client-9uHzAmFH.js +0 -1
  315. package/dist/chunks/client-BVal_QII.js +0 -1
  316. package/dist/chunks/client-C19cqYQS.js +0 -1
  317. package/dist/chunks/client-Dd7CKMRX.js +0 -1
  318. package/dist/chunks/commands-BkpqHY9F.js +0 -1
  319. package/dist/chunks/compact-DuVIvqMu.js +0 -2
  320. package/dist/chunks/config-DMP6-Ccr.js +0 -1
  321. package/dist/chunks/config-DRy1I12M.js +0 -3
  322. package/dist/chunks/config-e0Goy478.js +0 -1
  323. package/dist/chunks/context-DjgMzIfe.js +0 -1
  324. package/dist/chunks/context-noninteractive-DV7bIJCm.js +0 -1
  325. package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +0 -1
  326. package/dist/chunks/conversation-BBOE_EoE.js +0 -1
  327. package/dist/chunks/conversation-WxH5pb2z.js +0 -1
  328. package/dist/chunks/createSSHSession-LVGVXHXL.js +0 -5
  329. package/dist/chunks/createSession-BUzna9-E.js +0 -1
  330. package/dist/chunks/createSession-Dgwxk1WA.js +0 -1
  331. package/dist/chunks/crossProjectResume-6B2NYy8a.js +0 -40
  332. package/dist/chunks/cwd-DLK3znO7.js +0 -1
  333. package/dist/chunks/cwd-Nh5IZNKO.js +0 -1
  334. package/dist/chunks/debugUtils-DXBRbwCE.js +0 -1
  335. package/dist/chunks/detached-Biz-xhu0.js +0 -4
  336. package/dist/chunks/detectRepository-CDOJ-M7h.js +0 -1
  337. package/dist/chunks/detectRepository-Cv9-k6dg.js +0 -1
  338. package/dist/chunks/directoryCompletion-BDGcGDuv.js +0 -1
  339. package/dist/chunks/doctor-BhUmhHQU.js +0 -1
  340. package/dist/chunks/entry-B-Y-AYeK.js +0 -13
  341. package/dist/chunks/esm-BYnFh4pG.js +0 -1
  342. package/dist/chunks/esm-Bx6rTxIs.js +0 -1
  343. package/dist/chunks/esm-C367Cyo-.js +0 -1
  344. package/dist/chunks/esm-CXM9jqO_.js +0 -1
  345. package/dist/chunks/esm-CXczu_-W.js +0 -1
  346. package/dist/chunks/esm-CXt5K8Xt.js +0 -1
  347. package/dist/chunks/esm-Cb-L4oAk.js +0 -1
  348. package/dist/chunks/esm-CvHtYRrr.js +0 -1
  349. package/dist/chunks/esm-DhRjocaU.js +0 -1
  350. package/dist/chunks/esm-DklLYEuz.js +0 -1
  351. package/dist/chunks/esm-IYgGg4wR.js +0 -1
  352. package/dist/chunks/esm-lyfry1WB.js +0 -10
  353. package/dist/chunks/execFileNoThrow-Bmb5HEFz.js +0 -34
  354. package/dist/chunks/execSyncWrapper-C3ZFV9od.js +0 -1
  355. package/dist/chunks/exit-CW2eqUrR.js +0 -1
  356. package/dist/chunks/extraUsage-CkTon7ib.js +0 -1
  357. package/dist/chunks/extractMemories-CfmbvayQ.js +0 -1
  358. package/dist/chunks/fast-ByahC7Gw.js +0 -1
  359. package/dist/chunks/fast-xtIP4u4y.js +0 -1
  360. package/dist/chunks/fetchModelList-D9aePIPW.js +0 -1
  361. package/dist/chunks/fetchModelList-Dy-x4h3G.js +0 -1
  362. package/dist/chunks/fileSuggestions-CFkJktgc.js +0 -3
  363. package/dist/chunks/firstPartyEventLogger-Bt9iG9xk.js +0 -1
  364. package/dist/chunks/firstPartyEventLogger-DqGSujCz.js +0 -3
  365. package/dist/chunks/flushGate-BjKW7PFC.js +0 -1
  366. package/dist/chunks/fpsMetrics-Dk_pnSHJ.js +0 -1
  367. package/dist/chunks/gemini-NnmxBoEp.js +0 -1
  368. package/dist/chunks/generateSessionName-EpqGW-T2.js +0 -1
  369. package/dist/chunks/git-By_J4XJL.js +0 -5
  370. package/dist/chunks/git-zJCasBa6.js +0 -1
  371. package/dist/chunks/githubRepoPathMapping-CzgPGOHQ.js +0 -1
  372. package/dist/chunks/goal-DbS8yJfB.js +0 -3
  373. package/dist/chunks/grok-BxZ4vTDw.js +0 -1
  374. package/dist/chunks/grove-CYE1Cfcz.js +0 -7
  375. package/dist/chunks/hash-Tu-My5Vp.js +0 -1
  376. package/dist/chunks/help-DatnwM25.js +0 -1
  377. package/dist/chunks/hooks-DjbqtbUV.js +0 -1
  378. package/dist/chunks/initReplBridge-BEZW5PEY.js +0 -1
  379. package/dist/chunks/install-DJukI-kL.js +0 -1
  380. package/dist/chunks/instrumentation-2HH15DPu.js +0 -21
  381. package/dist/chunks/jwtUtils-C_LG1txt.js +0 -1
  382. package/dist/chunks/keybindings-C9l5il16.js +0 -1
  383. package/dist/chunks/launchLocalMemory-BfGenqj1.js +0 -3
  384. package/dist/chunks/launchOnboarding-DjMmXeQE.js +0 -8
  385. package/dist/chunks/lazySchema-DULtBUCI.js +0 -65
  386. package/dist/chunks/lib-BlVGipXx.js +0 -14
  387. package/dist/chunks/loadAgentsDir-DcI-8FQF.js +0 -1
  388. package/dist/chunks/loadPluginHooks-CGgpcyEC.js +0 -1
  389. package/dist/chunks/localSearch-CTTwYTU1.js +0 -1
  390. package/dist/chunks/log-CZ7ploQm.js +0 -1
  391. package/dist/chunks/logoUtils-CbIqOFrX.js +0 -1
  392. package/dist/chunks/main-Blm02_Js.js +0 -31
  393. package/dist/chunks/main-bJXadFi0.js +0 -356
  394. package/dist/chunks/managedEnv-CUsdYhAI.js +0 -1
  395. package/dist/chunks/managedEnv-DXeaUDSK.js +0 -1
  396. package/dist/chunks/mappers-_B-s9fNz.js +0 -1
  397. package/dist/chunks/mcp-BbbYzWpy.js +0 -6
  398. package/dist/chunks/mcp-D91sH9a8.js +0 -1
  399. package/dist/chunks/mcp-Dx-zgUgu.js +0 -2
  400. package/dist/chunks/memoize-CumjjK2Q.js +0 -1
  401. package/dist/chunks/memory-BeL7ui9m.js +0 -1
  402. package/dist/chunks/modalContext-wY9CeN4G.js +0 -1
  403. package/dist/chunks/mode-D695kgLI.js +0 -2
  404. package/dist/chunks/model-DX0TtzqX.js +0 -1
  405. package/dist/chunks/model-Do0f476p.js +0 -1
  406. package/dist/chunks/model-DpcM8dz5.js +0 -1
  407. package/dist/chunks/modelOptions-B3nis9cC.js +0 -1
  408. package/dist/chunks/nativeInstaller-CymO8TNe.js +0 -1
  409. package/dist/chunks/oauth-D38aRTUb.js +0 -1
  410. package/dist/chunks/oauth-U649LV5H.js +0 -1
  411. package/dist/chunks/omit-DO61BHZu.js +0 -1
  412. package/dist/chunks/onChangeAppState-vKml_lit.js +0 -1
  413. package/dist/chunks/openai-DdupGVdC.js +0 -10
  414. package/dist/chunks/panel-CVd1dzYl.js +0 -1
  415. package/dist/chunks/parser-Cq9X7HMP.js +0 -1
  416. package/dist/chunks/partition-BivH9MBJ.js +0 -1
  417. package/dist/chunks/permissions-C9iqR4_N.js +0 -3
  418. package/dist/chunks/pidLock-DiKz5Tza.js +0 -3
  419. package/dist/chunks/plan-KDN5IGWY.js +0 -1
  420. package/dist/chunks/plugin-D0rzUb8E.js +0 -17
  421. package/dist/chunks/pluginAutoupdate-C2xTKLR_.js +0 -1
  422. package/dist/chunks/pluginBlocklist-xdiUmUpt.js +0 -1
  423. package/dist/chunks/pluginCliCommands-CIDDvVN7.js +0 -1
  424. package/dist/chunks/pluginOperations-BEYsarAn.js +0 -2
  425. package/dist/chunks/pluginStartupCheck-DVkI4pqo.js +0 -1
  426. package/dist/chunks/plugins-CWWU4BKs.js +0 -4
  427. package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
  428. package/dist/chunks/poorMode-BTIe8W_H.js +0 -1
  429. package/dist/chunks/print-B5H2xbBS.js +0 -14
  430. package/dist/chunks/processBashCommand-EQ9EWaRV.js +0 -1
  431. package/dist/chunks/processSlashCommand-C4PKNyFT.js +0 -5
  432. package/dist/chunks/prompt-B9sDzLPK.js +0 -1
  433. package/dist/chunks/prompt-WsoTRhoh.js +0 -1
  434. package/dist/chunks/promptEditor-Cr4w-4Bz.js +0 -4
  435. package/dist/chunks/rcDebugLog-DSchf3Hs.js +0 -1
  436. package/dist/chunks/reconciler-RIKmaPg7.js +0 -1
  437. package/dist/chunks/refresh-CCSCAjgz.js +0 -1
  438. package/dist/chunks/registerProtocol-C0IlPEoa.js +0 -1
  439. package/dist/chunks/reload-plugins-DC-tbXVv.js +0 -1
  440. package/dist/chunks/remoteBridgeCore-NGTnhQgw.js +0 -1
  441. package/dist/chunks/remoteManagedSettings-BoOYHzYP.js +0 -1
  442. package/dist/chunks/rename-DS1AmW-F.js +0 -1
  443. package/dist/chunks/resume-Cf5PSoPw.js +0 -2
  444. package/dist/chunks/ripgrep-C3jtZL7k.js +0 -5
  445. package/dist/chunks/ripgrep-CBUbn6Po.js +0 -1
  446. package/dist/chunks/sandbox-adapter-Z4Phj31K.js +0 -1
  447. package/dist/chunks/sandbox-toggle-COZE8Lo4.js +0 -1
  448. package/dist/chunks/searchExtraTools-CvkRbL2m.js +0 -1
  449. package/dist/chunks/session-BvA99K4j.js +0 -2
  450. package/dist/chunks/sessionFileAccessHooks-6XfAf6ke.js +0 -1
  451. package/dist/chunks/sessionIdCompat-Dgp6PW_1.js +0 -1
  452. package/dist/chunks/sessionObserver-CRWUBJEY.js +0 -1
  453. package/dist/chunks/sessionState-CQhbGfmh.js +0 -11
  454. package/dist/chunks/sessionStorage-DqEuxDlb.js +0 -1
  455. package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +0 -3
  456. package/dist/chunks/sessionTracing-BoOZsXU2.js +0 -11
  457. package/dist/chunks/settings-3xZ0fsvE.js +0 -19
  458. package/dist/chunks/settings-Crx1cI1u.js +0 -1
  459. package/dist/chunks/settingsSync-rkWmClKS.js +0 -1
  460. package/dist/chunks/setup-D8L275fT.js +0 -3
  461. package/dist/chunks/shellQuote-Ddgr1vif.js +0 -4
  462. package/dist/chunks/sinks-BXX72cbf.js +0 -1
  463. package/dist/chunks/sinks-DMp6uEzM.js +0 -1
  464. package/dist/chunks/skillChangeDetector-CtithJ4a.js +0 -1
  465. package/dist/chunks/skills-DXMk-498.js +0 -1
  466. package/dist/chunks/src-D3yIF9I42.js +0 -1
  467. package/dist/chunks/src-DQOX_xI1.js +0 -1
  468. package/dist/chunks/src-Dt5IJd3C.js +0 -1
  469. package/dist/chunks/src-Dvp6-vB7.js +0 -19
  470. package/dist/chunks/src-PM8NIIu_.js +0 -1
  471. package/dist/chunks/startupProfiler-CbzxVmbv.js +0 -3
  472. package/dist/chunks/startupProfiler-uHetQush.js +0 -1
  473. package/dist/chunks/state-BStOuCh4.js +0 -1
  474. package/dist/chunks/staticRender-D9AbnQFr.js +0 -1
  475. package/dist/chunks/stats-Ce15gc3E.js +0 -1
  476. package/dist/chunks/status-CFrLuGbf.js +0 -2
  477. package/dist/chunks/status-D5OCkMZG.js +0 -1
  478. package/dist/chunks/statusNoticeHelpers-CZoOse-_.js +0 -1
  479. package/dist/chunks/stringUtils-CKD8qDqx.js +0 -4
  480. package/dist/chunks/subprocessEnv-CNBOhlDV.js +0 -1
  481. package/dist/chunks/subprocessEnv-DtBCqQIo.js +0 -1
  482. package/dist/chunks/switcher-AiMcRzoi.js +0 -1
  483. package/dist/chunks/syncCache-qWJ_VfBo.js +0 -1
  484. package/dist/chunks/teleport-Bi_1VFIZ.js +0 -1
  485. package/dist/chunks/terminalSetup-kWdZRKWq.js +0 -32
  486. package/dist/chunks/theme-CEKOCSLw.js +0 -1
  487. package/dist/chunks/tmux-CpGd0Aca.js +0 -1
  488. package/dist/chunks/toolPool-Df5iUqJ-.js +0 -1
  489. package/dist/chunks/trustedDevice-CB6rNzl-.js +0 -1
  490. package/dist/chunks/trustedDevice-DXGePUAC.js +0 -1
  491. package/dist/chunks/types-APu4OCXJ.js +0 -17
  492. package/dist/chunks/udsClient-U7MEfYj7.js +0 -1
  493. package/dist/chunks/upstreamproxy-CTOuotLO.js +0 -10
  494. package/dist/chunks/useExitOnCtrlCDWithKeybindings-Bw0mlTT9.js +0 -1
  495. package/dist/chunks/useMainLoopModel-CIG2cjS2.js +0 -1
  496. package/dist/chunks/useManagePlugins-MSHw-qHx.js +0 -1
  497. package/dist/chunks/useMergedTools-Bb-INJa2.js +0 -1
  498. package/dist/chunks/useSearchInput-QL_VtdJD.js +0 -1
  499. package/dist/chunks/useSettingsErrors-Dvi6zLCr.js +0 -1
  500. package/dist/chunks/userAgent-i-oGzf40.js +0 -1
  501. package/dist/chunks/util-CLQvtXuD.js +0 -1
  502. package/dist/chunks/validatePlugin-1mTZ3TJR.js +0 -1
  503. package/dist/chunks/which-BxQ1hpjp.js +0 -1
  504. package/dist/chunks/windowsPaths-BdhjMYTm.js +0 -1
  505. package/dist/chunks/windowsPaths-DtGZ83kH.js +0 -1
  506. package/dist/chunks/workSecret-CaM2yIJD.js +0 -1
  507. package/dist/chunks/workerRegistry-BjxoZ12l.js +0 -2
  508. package/dist/chunks/worktree-DpksgxdF.js +0 -1
  509. /package/dist/chunks/{src-DL3w8VPk2.js → src-DL3w8VPk.js} +0 -0
@@ -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-Nh5IZNKO.js";import{w as ee,x as te}from"./debug-D58GQBDG.js";import{o as ne,s as re}from"./log-CZ7ploQm.js";import{aborted as ie,callbackify as S,debuglog as ae,inspect as oe,promisify as se,stripVTControlCharacters as ce}from"node:util";import C,{execArgv as le,execPath as ue,hrtime as de,platform as fe}from"node:process";import w from"node:path";import{ChildProcess as pe,execFile as me,spawn as he,spawnSync as ge}from"node:child_process";import{appendFileSync as _e,createReadStream as ve,createWriteStream as ye,readFileSync as be,statSync as xe,writeFileSync as Se}from"node:fs";import{constants as T}from"node:os";import Ce from"node:tty";import{EventEmitter as we,addAbortListener as Te,on as Ee,once as E,setMaxListeners as De}from"node:events";import{Duplex as Oe,PassThrough as ke,Readable as D,Transform as Ae,Writable as je,getDefaultHighWaterMark as Me}from"node:stream";import{StringDecoder as Ne}from"node:string_decoder";import{fileURLToPath as Pe}from"node:url";import{Buffer as Fe}from"node:buffer";import{scheduler as Ie,setImmediate as Le,setTimeout as Re}from"node:timers/promises";import{serialize as ze}from"node:v8";import{finished as O}from"node:stream/promises";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var A=t((()=>{})),Be,Ve,He,Ue,We=t((()=>{Be=(e,t)=>{let n=Ue(Ve(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},Ve=e=>He(e)?e.toString():e,He=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Ue=e=>e instanceof URL?Pe(e):e})),Ge,Ke=t((()=>{A(),We(),Ge=(e,t=[],n={})=>{let r=Be(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]}})),qe,Je,j,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,M=t((()=>{({toString:qe}=Object.prototype),Je=e=>qe.call(e)===`[object ArrayBuffer]`,j=e=>qe.call(e)===`[object Uint8Array]`,Ye=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Xe=new TextEncoder,Ze=e=>Xe.encode(e),Qe=new TextDecoder,$e=e=>Qe.decode(e),et=(e,t)=>tt(e,t).join(``),tt=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new Ne(t),r=e.map(e=>typeof e==`string`?Ze(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},nt=e=>e.length===1&&j(e[0])?e[0]:it(rt(e)),rt=e=>e.map(e=>typeof e==`string`?Ze(e):e),it=e=>{let t=new Uint8Array(at(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},at=e=>{let t=0;for(let n of e)t+=n.length;return t}})),ot,st,ct,lt,ut,dt,ft,pt,mt,ht=t((()=>{A(),M(),ot=e=>Array.isArray(e)&&Array.isArray(e.raw),st=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=ct({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},ct=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=lt(i,e.raw[r]),c=ft(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>pt(e)):[pt(l)];return ft(c,u,s)},lt=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=ut.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(ut.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
2
- `?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=dt[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},ut=new Set([` `,` `,`\r`,`
3
- `]),dt={x:3,u:5},ft=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],pt=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return mt(e);throw e instanceof pe||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},mt=({stdout:e})=>{if(typeof e==`string`)return e;if(j(e))return $e(e);throw TypeError(e===void 0?`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`:`Unexpected "${typeof e}" stdout in template expression`)}})),N,gt,P,_t,F=t((()=>{N=e=>gt.includes(e),gt=[C.stdin,C.stdout,C.stderr],P=[`stdin`,`stdout`,`stderr`],_t=e=>P[e]??`stdio[${e}]`})),vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,I=t((()=>{A(),F(),vt=e=>{let t={...e};for(let n of At)t[n]=yt(e,n);return t},yt=(e,t)=>{let n=Array.from({length:bt(e)+1}),r=xt(e[t],n,t);return Ot(r,t)},bt=({stdio:e})=>Array.isArray(e)?Math.max(e.length,P.length):P.length,xt=(e,t,n)=>k(e)?St(e,t,n):t.fill(e),St=(e,t,n)=>{for(let r of Object.keys(e).sort(Ct))for(let i of Tt(r,n,t))t[i]=e[r];return t},Ct=(e,t)=>wt(e)<wt(t)?1:-1,wt=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,Tt=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=Et(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
4
- 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]},Et=e=>{if(e===`all`)return e;if(P.includes(e))return P.indexOf(e);let t=Dt.exec(e);if(t!==null)return Number(t[1])},Dt=/^fd(\d+)$/,Ot=(e,t)=>e.map(e=>e===void 0?kt[t]:e),kt={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ae(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},At=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],jt=(e,t)=>t===`ipc`?e.at(-1):e[t]})),Mt,Nt,Pt,Ft,It,Lt,Rt,L=t((()=>{I(),Mt=({verbose:e},t)=>Ft(e,t)!==`none`,Nt=({verbose:e},t)=>![`none`,`short`].includes(Ft(e,t)),Pt=({verbose:e},t)=>{let n=Ft(e,t);return Lt(n)?n:void 0},Ft=(e,t)=>t===void 0?It(e):jt(e,t),It=e=>e.find(e=>Lt(e))??Rt.findLast(t=>e.includes(t)),Lt=e=>typeof e==`function`,Rt=[`none`,`short`,`full`]})),zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt=t((()=>{zt=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>qt(Vt(e))).join(` `)}},Bt=e=>ce(e).split(`
6
- `).map(e=>Vt(e)).join(`
7
- `),Vt=e=>e.replaceAll(Wt,e=>Ht(e)),Ht=e=>{let t=Gt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=Kt?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},Ut=()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Wt=Ut(),Gt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Kt=65535,qt=e=>Jt.test(e)?e:fe===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Jt=/^[\w./-]+$/})),Xt,R,Zt,Qt,$t,en,tn=t((()=>{Xt=Ce?.WriteStream?.prototype?.hasColors?.()??!1,R=(e,t)=>{if(!Xt)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}},R(0,0),Zt=R(1,22),R(2,22),R(3,23),R(4,24),R(53,55),R(7,27),R(8,28),R(9,29),R(30,39),R(31,39),R(32,39),R(33,39),R(34,39),R(35,39),R(36,39),R(37,39),Qt=R(90,39),R(40,49),R(41,49),R(42,49),R(43,49),R(44,49),R(45,49),R(46,49),R(47,49),R(100,49),$t=R(91,39),R(92,39),en=R(93,39),R(94,39),R(95,39),R(96,39),R(97,39),R(101,49),R(102,49),R(103,49),R(104,49),R(105,49),R(106,49),R(107,49)})),nn=t((()=>{tn(),tn()})),rn,an,on,sn,cn,ln,un,dn=t((()=>{_(),nn(),rn=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=an(n),c=cn[e]({failed:a,reject:o,piped:r}),l=un[e]({reject:o});return`${Qt(`[${s}]`)} ${Qt(`[${i}]`)} ${l(c)} ${l(t)}`},an=e=>`${on(e.getHours(),2)}:${on(e.getMinutes(),2)}:${on(e.getSeconds(),2)}.${on(e.getMilliseconds(),3)}`,on=(e,t)=>String(e).padStart(t,`0`),sn=({failed:e,reject:t})=>e?t?y.cross:y.warning:y.tick,cn={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:sn,duration:sn},ln=e=>e,un={command:()=>Zt,output:()=>ln,ipc:()=>ln,error:({reject:e})=>e?$t:en,duration:()=>Qt}})),fn,pn,mn,hn=t((()=>{L(),fn=(e,t,n)=>{let r=Pt(t,n);return e.map(({verboseLine:e,verboseObject:t})=>pn(e,t,r)).filter(e=>e!==void 0).map(e=>mn(e)).join(``)},pn=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},mn=e=>e.endsWith(`
8
- `)?e:`${e}\n`})),gn,_n,vn,yn,bn,xn,Sn=t((()=>{Yt(),dn(),hn(),gn=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=_n({type:e,result:i,verboseInfo:r}),o=fn(vn(t,a),r,n);o!==``&&console.warn(o.slice(0,-1))},_n=({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}),vn=(e,t)=>e.split(`
9
- `).map(e=>yn({...t,message:e})),yn=e=>({verboseLine:rn(e),verboseObject:e}),bn=e=>Bt(typeof e==`string`?e:oe(e)).replaceAll(` `,` `.repeat(xn)),xn=2})),Cn,wn=t((()=>{L(),Sn(),Cn=(e,t)=>{Mt(t)&&gn({type:`command`,verboseMessage:e,verboseInfo:t})}})),Tn,En,Dn,On,kn=t((()=>{L(),Tn=(e,t,n)=>(On(e),{verbose:e,escapedCommand:t,commandId:En(e),rawOptions:n}),En=e=>Mt({verbose:e})?Dn++:void 0,Dn=0n,On=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(!Rt.includes(t)&&!Lt(t)){let e=Rt.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}}})),An,jn,Mn=t((()=>{An=()=>de.bigint(),jn=e=>Number(de.bigint()-e)/1e6})),Nn,Pn=t((()=>{wn(),kn(),Mn(),Yt(),I(),Nn=(e,t,n)=>{let r=An(),{command:i,escapedCommand:a}=zt(e,t),o=Tn(yt(n,`verbose`),a,{...n});return Cn(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}}})),Fn=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)}})),In=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}})),Ln=r(((t,n)=>{e(`fs`);var r=process.platform===`win32`||global.TESTING_WINDOWS?Fn():In();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}}})),Rn=r(((t,n)=>{var r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=e(`path`),a=r?`;`:`:`,o=Ln(),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)}})),zn=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})),Bn=r(((t,n)=>{var r=e(`path`),i=Rn(),a=zn();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})),Vn=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})),Hn=r(((e,t)=>{t.exports=/^#!(.*)/})),Un=r(((e,t)=>{var n=Hn();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}})),Wn=r(((t,n)=>{var r=e(`fs`),i=Un();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})),Gn=r(((t,n)=>{var r=e(`path`),i=Bn(),a=Vn(),o=Wn(),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})),Kn=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}})),qn=r(((t,n)=>{var r=e(`child_process`),i=Gn(),a=Kn();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 Jn(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 Yn=t((()=>{})),Xn=t((()=>{}));function Zn(e){return e instanceof URL?Pe(e):e}function Qn(e){return{*[Symbol.iterator](){let t=w.resolve(Zn(e)),n;for(;n!==t;)yield t,n=t,t=w.resolve(t,`..`)}}}var $n=t((()=>{Xn(),se(me)})),er,tr,nr,rr,ir=t((()=>{Yn(),$n(),er=({cwd:e=C.cwd(),path:t=C.env[Jn()],preferLocal:n=!0,execPath:r=C.execPath,addExecPath:i=!0}={})=>{let a=w.resolve(Zn(e)),o=[],s=t.split(w.delimiter);return n&&tr(o,s,a),i&&nr(o,s,r,a),t===``||t===w.delimiter?`${o.join(w.delimiter)}${t}`:[...o,t].join(w.delimiter)},tr=(e,t,n)=>{for(let r of Qn(n)){let n=w.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},nr=(e,t,n,r)=>{let i=w.resolve(r,Zn(n),`..`);t.includes(i)||e.push(i)},rr=({env:e=C.env,...t}={})=>{e={...e};let n=Jn({env:e});return t.path=e[n],e[n]=er(t),e}})),ar,or,sr,cr,lr,ur,dr,fr,z=t((()=>{ar=(e,t,n)=>new(n?fr:dr)(t,e instanceof or?{}:{cause:e}),or=class extends Error{},sr=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,lr,{value:!0,writable:!1,enumerable:!1,configurable:!1})},cr=e=>ur(e)&&lr in e,lr=Symbol(`isExecaError`),ur=e=>Object.prototype.toString.call(e)===`[object Error]`,dr=class extends Error{},sr(dr,dr.name),fr=class extends Error{},sr(fr,fr.name)})),pr,mr,hr,gr=t((()=>{pr=()=>{let e=64-hr+1;return Array.from({length:e},mr)},mr=(e,t)=>({name:`SIGRT${t+1}`,number:hr+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),hr=34})),_r,vr=t((()=>{_r=[{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`}]})),yr,br,xr=t((()=>{vr(),gr(),yr=()=>{let e=pr();return[..._r,...e].map(br)},br=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=T,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}}})),Sr,Cr,wr,Tr,Er,Dr,Or=t((()=>{gr(),xr(),Sr=()=>{let e=yr();return Object.fromEntries(e.map(Cr))},Cr=({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}],wr=Sr(),Tr=()=>{let e=yr(),t=Array.from({length:65},(t,n)=>Er(n,e));return Object.assign({},...t)},Er=(e,t)=>{let n=Dr(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}}},Dr=(e,t)=>{let n=t.find(({name:t})=>T.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n},Tr()})),kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br=t((()=>{Or(),kr=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return jr(e,t)},Ar=e=>e===0?e:jr(e,"`subprocess.kill()`'s argument"),jr=(e,t)=>{if(Number.isInteger(e))return Mr(e,t);if(typeof e==`string`)return Fr(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Ir()}`)},Mr=(e,t)=>{if(Pr.has(e))return Pr.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Ir()}`)},Nr=()=>new Map(Object.entries(T.signals).reverse().map(([e,t])=>[t,e])),Pr=Nr(),Fr=(e,t)=>{if(e in T.signals)return e;throw e.toUpperCase()in T.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Ir()}`)},Ir=()=>`Available signal names: ${Lr()}.
10
- Available signal numbers: ${Rr()}.`,Lr=()=>Object.keys(T.signals).sort().map(e=>`'${e}'`).join(`, `),Rr=()=>[...new Set(Object.values(T.signals).sort((e,t)=>e-t))].join(`, `),zr=e=>wr[e].description})),Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr=t((()=>{z(),Br(),Vr=e=>{if(e===!1)return e;if(e===!0)return Hr;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Hr=1e3*5,Ur=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Wr(o,s,n);Gr(l,r);let u=e(c);return Kr({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Wr=(e,t,n)=>{let[r=n,i]=ur(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&&!ur(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Ar(r),error:i}},Gr=(e,t)=>{e!==void 0&&t.reject(e)},Kr=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&qr({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},qr=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await Re(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??(n.isForcefullyTerminated=!0))}catch{}}})),Yr,Xr=t((()=>{Yr=async(e,t)=>{e.aborted||await E(e,`abort`,{signal:t})}})),Zr,Qr,$r,ei=t((()=>{Xr(),Zr=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Qr=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[$r(e,t,r,i)],$r=async(e,t,n,{signal:r})=>{throw await Yr(t,r),n.terminationReason??(n.terminationReason=`cancel`),e.kill(),t.reason}})),ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,B,gi,V,_i,vi=t((()=>{ti=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{ni(e,t,n),ri(e,t,r)},ni=(e,t,n)=>{if(!n)throw Error(`${B(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},ri=(e,t,n)=>{if(!n)throw Error(`${B(e,t)} cannot be used: the ${V(t)} has already exited or disconnected.`)},ii=e=>{throw Error(`${B(`getOneMessage`,e)} could not complete: the ${V(e)} exited or disconnected.`)},ai=e=>{throw Error(`${B(`sendMessage`,e)} failed: the ${V(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
- ${B(`getOneMessage`,e)},
15
- ${B(`sendMessage`,e,`message, {strict: true}`)},
16
- ]);`)},oi=(e,t)=>Error(`${B(`sendMessage`,t)} failed when sending an acknowledgment response to the ${V(t)}.`,{cause:e}),si=e=>{throw Error(`${B(`sendMessage`,e)} failed: the ${V(e)} is not listening to incoming messages.`)},ci=e=>{throw Error(`${B(`sendMessage`,e)} failed: the ${V(e)} exited without listening to incoming messages.`)},li=()=>Error(`\`cancelSignal\` aborted: the ${V(!0)} disconnected.`),ui=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},di=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${B(t,n)} cannot be used: the ${V(n)} is disconnecting.`,{cause:e})},fi=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(pi(e))throw Error(`${B(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},pi=({code:e,message:t})=>mi.has(e)||hi.some(e=>t.includes(e)),mi=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),hi=[`could not be cloned`,`circular structure`,`call stack size exceeded`],B=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${gi(t)}${e}(${n})`,gi=e=>e?``:`subprocess.`,V=e=>e?`parent process`:`subprocess`,_i=e=>{e.connected&&e.disconnect()}})),yi,bi=t((()=>{yi=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)}})),xi,Si,H,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji=t((()=>{I(),xi=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=H.get(e),i=Ci(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(Ei(i,t,n,!0));return a},Si=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=H.get(e),i=Ci(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(Ei(i,t,n,!1));return a},H=new WeakMap,Ci=(e,t,n)=>{let r=wi(t,n);return Ti(r,t,n,e),r},wi=(e,t)=>{let n=Et(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(`"${ki(t)}" must not be "${e}".
17
- It must be ${r} or "fd3", "fd4" (and so on).
18
- It is optional and defaults to "${i}".`)},Ti=(e,t,n,r)=>{let i=r[Oi(e)];if(i===void 0)throw TypeError(`"${ki(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(`"${ki(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${ki(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Ei=(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}=Di(e,n);return`The "${i}: ${Ai(a)}" option is incompatible with using "${ki(r)}: ${Ai(t)}".
20
- Please set this option with "pipe" instead.`},Di=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=Oi(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]}},Oi=e=>e===`all`?1:e,ki=e=>e?`to`:`from`,Ai=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),Te(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 Ie.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 E(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 we;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((()=>{bi(),Ni(),ya(),vi(),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=yi();na[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,ra(t,n,i)]);e&&ai(n),a||si(n)}finally{i.abort(),delete na[e.id]}},na={},ra=async(e,t,{signal:n})=>{Mi(e,1,n),await E(e,`disconnect`,{signal:n}),ci(t)},ia=`execa:ipc:request`,aa=`execa:ipc:response`})),sa,ca,la,ua,da,fa,pa=t((()=>{bi(),I(),ji(),oa(),sa=(e,t,n)=>{ua.has(e)||ua.set(e,new Set);let r=ua.get(e),i={onMessageSent:yi(),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=>H.has(e)&&!jt(H.get(e).options.buffer,`ipc`)?1:0})),ma,ha,ga,_a,va,ya=t((()=>{vi(),pa(),oa(),ma=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return ti({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 _i(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 di({error:e,methodName:t,isSubprocess:n}),fi({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(),vi(),ba=(e,t)=>{let n=`cancelSignal`;return ri(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){ui();return}if(t===null){Ea();return}Gi(e,t,n),await Ie.yield()}},Ca=!1,wa=e=>e?.type===Ta?(Da.abort(e.message),!0):!1,Ta=`execa:ipc:cancel`,Ea=()=>{Da.abort(li())},Da=new AbortController})),ka,Aa,ja,Ma,Na=t((()=>{Xr(),Oa(),Jr(),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 Yr(t,i),await ba(e,Ma(t)),qr({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((()=>{z(),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 Re(t,void 0,{signal:r}),n.terminationReason??(n.terminationReason=`timeout`),e.kill(),new or}})),Ra,za,Ba=t((()=>{We(),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=Be(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{ze(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((()=>{We(),eo=(e=to())=>{let t=Be(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(qn(),1),ir(),Jr(),Br(),ei(),Na(),La(),Ba(),Ka(),$a(),ro(),We(),I(),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=vt(c),u=oo(l);return Pa(u),qa(u),Va(u),Zr(u),ka(u),u.shell=Ue(u.shell),u.env=so(u),u.killSignal=kr(u.killSignal),u.forceKillAfterDelay=Vr(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?rr({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(),F(),I(),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=jt(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:_t(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(),M(),ro(),Yt(),Hs(),Br(),z(),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=>Bt(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} (${zr(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 or)return;let n=Bt(no(cr(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:j(e)?$e(e):``})),Zs,Qs,$s,ec,tc,nc,rc=t((()=>{Br(),Mn(),z(),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:jn(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=ar(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:jn(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:zr(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((()=>{Sn(),hc=(e,t)=>{e.failed&&gn({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})}})),_c,vc,yc=t((()=>{mc(),L(),Sn(),gc(),_c=(e,t)=>{Mt(t)&&(hc(e,t),vc(e,t))},vc=(e,t)=>{gn({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(),A(),M(),Sc=(e,t)=>Y(e)?`asyncGenerator`:jc(e)?`generator`:Nc(e)?`fileUrl`:Fc(e)?`filePath`:Hc(e)?`webStream`:W(e,{checkOpen:!1})?`native`:j(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=>k(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=>k(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((()=>{A(),$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}=k(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}=k(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((()=>{F(),xl(),L(),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 P.map(e=>t[e]);if(wl(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${P.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,P.length);return Array.from({length:n},(t,n)=>e[n])},wl=e=>P.some(t=>e[t]!==void 0),Tl=(e,t)=>Array.isArray(e)?e.map(e=>Tl(e,t)):e??(t>=P.length?`ignore`:`pipe`),El=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!Nt(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(),F(),M(),ji(),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(Ce.isatty(i))throw TypeError(`The \`${t}: ${Ai(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:Ye(be(i)),optionName:t}}},Ml=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=gt.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=gt[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(),M(),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(j(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((()=>{F(),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=_t(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&&!N(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((()=>{M(),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:[Ye(be(e))]}),filePath:({value:{file:e}})=>({contents:[Ye(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((()=>{M(),Fu=(e,t)=>e?void 0:Iu.bind(void 0,t),Iu=function*(e,t){if(typeof t!=`string`&&!j(t)&&!Fe.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Lu=(e,t)=>e?Ru.bind(void 0,t):zu.bind(void 0,t),Ru=function*(e,t){Bu(e,t),yield t},zu=function*(e,t){if(Bu(e,t),typeof t!=`string`&&!j(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Bu=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
33
- Instead, \`yield\` should either be called with a value, or not be called at all. For example:
34
- if (condition) { yield value; }`)}})),Hu,Uu,Wu,Gu,Ku=t((()=>{M(),Hu=(e,t,n)=>{if(n)return;if(e)return{transform:Uu.bind(void 0,new TextEncoder)};let r=new Ne(t);return{transform:Wu.bind(void 0,r),final:Gu.bind(void 0,r)}},Uu=function*(e,t){Fe.isBuffer(t)?yield Ye(t):typeof t==`string`?yield e.encode(t):yield t},Wu=function*(e,t){yield j(t)?e.write(t):t},Gu=function*(e){let t=e.end();t!==``&&(yield t)}})),qu,Ju,Yu,Xu,Zu,Qu,$u=t((()=>{qu=S(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Ju=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Qu}=t[n];for await(let i of r(e))yield*Ju(i,t,n+1)},Yu=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Xu(n,Number(t),e)},Xu=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Ju(r,n,t+1)},Zu=S(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Qu=function*(e){yield e}})),ed,td,nd,rd,id,ad,od=t((()=>{ed=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},td=(e,t)=>[...t.flatMap(t=>[...nd(t,e,0)]),...rd(e)],nd=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=ad}=t[n];for(let i of r(e))yield*nd(i,t,n+1)},rd=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*id(n,Number(t),e)},id=function*(e,t,n){if(e!==void 0)for(let r of e())yield*nd(r,n,t+1)},ad=function*(e){yield e}})),sd,cd,ld,ud=t((()=>{Z(),Pu(),Vu(),Ku(),$u(),od(),sd=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=ld(e,o,a),l=Y(t),u=Y(n),d=l?qu.bind(void 0,Ju,s):ed.bind(void 0,nd),f=l||u?qu.bind(void 0,Yu,s):ed.bind(void 0,rd),p=l||u?Zu.bind(void 0,s):void 0;return{stream:new Ae({writableObjectMode:r,writableHighWaterMark:Me(r),readableObjectMode:i,readableHighWaterMark:Me(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},cd=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a)e=td(ld(t,n,r),e);return e},ld=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Fu(r,s)},Hu(n,o,r),xu(n,a,r,c),{transform:e,final:t},{transform:Lu(i,s)},Ou({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)}})),dd,fd,pd,md,hd,gd=t((()=>{ud(),M(),Z(),dd=(e,t)=>{for(let n of fd(e))pd(e,n,t)},fd=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),pd=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${Zc[e]} with synchronous methods.`)}n.input=nt(i.map(({contents:e})=>e).map(e=>md(e,r)))}},md=(e,t)=>{let n=cd(e,t,`utf8`,!0);return hd(n),nt(n)},hd=e=>{let t=e.find(e=>typeof e!=`string`&&!j(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)}})),_d,vd,yd,bd,xd,Sd,Cd,wd=t((()=>{$a(),Z(),Sn(),L(),_d=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&Nt(n,r)&&!U.has(t)&&vd(r)&&(e.some(({type:e,value:t})=>e===`native`&&yd.has(t))||e.every(({type:e})=>X.has(e))),vd=e=>e===1||e===2,yd=new Set([`pipe`,`overlapped`]),bd=async(e,t,n,r)=>{for await(let i of e)Sd(t)||Cd(i,n,r)},xd=(e,t,n)=>{for(let r of e)Cd(r,t,n)},Sd=e=>e._readableState.pipes.length>0,Cd=(e,t,n)=>{gn({type:`output`,verboseMessage:bn(e),fdNumber:t,verboseInfo:n})}})),Td,Ed,Dd,Od,kd,Ad,jd=t((()=>{wd(),ud(),Pu(),M(),Z(),Hs(),Td=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>Ed({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Ed=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=Ye(Bs(e,a,d)),{stdioItems:p,objectMode:m}=t[n],h=Dd([f],p,c,r),{serializedResult:g,finalResult:_=g}=Od({chunks:h,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});kd({serializedResult:g,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let v=s[n]?_:void 0;try{return r.error===void 0&&Ad(g,p,i),v}catch(e){return r.error=e,v}},Dd=(e,t,n,r)=>{try{return cd(e,t,n,!1)}catch(t){return r.error=t,e}},Od=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:nt(e)};let o=et(e,n);return r[a]?{serializedResult:o,finalResult:Su(o,!i[a],t)}:{serializedResult:o}},kd=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!_d({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=Su(e,!1,o);try{xd(s,t,r)}catch(e){n.error??(n.error=e)}},Ad=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>qc.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?_e(r,e):(n.add(t),Se(r,e))}}})),Md,Nd=t((()=>{M(),bu(),Md=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,vu(t,n,`all`)]:Array.isArray(t)?[vu(e,n,`all`),...t]:j(e)&&j(t)?it([e,t]):`${e}${t}`}})),Pd,Fd,Id,Ld,Rd,zd,Bd=t((()=>{z(),Pd=async(e,t)=>{let[n,r]=await Fd(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},Fd=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Id(e):n.value},Id=async e=>{try{return await E(e,`exit`)}catch{return Id(e)}},Ld=async e=>{let[t,n]=await e;if(!Rd(t,n)&&zd(t,n))throw new or;return[t,n]},Rd=(e,t)=>e===void 0&&t===void 0,zd=(e,t)=>e!==0||t!==null})),Vd,Hd,Ud=t((()=>{z(),Hs(),Bd(),Vd=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=Hd(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:zs(a,r,i)}},Hd=(e,t,n)=>e===void 0?zd(t,n)?new or:void 0:e})),Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d=t((()=>{Pn(),co(),uo(),rc(),xc(),_u(),bu(),gd(),jd(),Hs(),Nd(),Ud(),Wd=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Gd(e,t,n);return bc(Yd({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},Gd=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Nn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,Kd(n));return qd(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:fu(l,o)}},Kd=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,qd=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Jd(`ipcInput`),e&&Jd(`ipc: true`),n&&Jd(`detached: true`),r&&Jd(`cancelSignal`)},Jd=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Yd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Xd({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Vd(c,n),{output:m,error:h=l}=Td({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>vu(e,n,t)),_=vu(Md(m,n),n,`all`);return Qd({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},Xd=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return dd(a,n),ge(...lo(e,t,Zd(n)))}catch(e){return Qs({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},Zd=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Vs(t)}),Qd=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?Zs({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):$s({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0})})),ef,tf,nf,rf,af,of=t((()=>{vi(),Yi(),Bi(),ef=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ti({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),tf({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),tf=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Pi(t,i);let a=Gi(e,t,n),o=new AbortController;try{return await Promise.race([nf(a,r,o),rf(a,n,o),af(a,n,o)])}catch(t){throw _i(e),t}finally{o.abort(),Ii(t,i)}},nf=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of Ee(e,`message`,{signal:n}))if(t(r))return r},rf=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),ii(t)},af=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw oi(r,t)}})),sf,cf,lf,uf,df,ff,pf=t((()=>{vi(),Yi(),Bi(),sf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>cf({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),cf=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ti({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ji(e)}),Pi(t,a);let o=Gi(e,t,n),s=new AbortController,c={};return lf(e,o,s),uf({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),df({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},lf=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},uf=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=oi(i,t),n.abort()}catch{}},df=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of Ee(n,`message`,{signal:a.signal}))ff(o),yield e}catch{ff(o)}finally{a.abort(),Ii(t,s),r||_i(e),i&&await e}},ff=({error:e})=>{if(e)throw e}})),mf,hf,gf,_f=t((()=>{ya(),of(),pf(),Oa(),mf=(e,{ipc:t})=>{Object.assign(e,gf(e,!1,t))},hf=()=>{let e=C,t=C.channel!==void 0;return{...gf(e,!0,t),getCancelSignal:xa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},gf=(e,t,n)=>({sendMessage:ma.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:ef.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:sf.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})})})),vf,yf,bf,xf,Sf,Cf,wf,Tf=t((()=>{du(),rc(),xc(),vf=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{lu(r);let s=new pe;yf(s,r),Object.assign(s,{readable:xf,writable:Sf,duplex:Cf});let c=Qs({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1});return{subprocess:s,promise:wf(c,o,i)}},yf=(e,t)=>{let n=bf(),r=bf(),i=bf(),a=Array.from({length:t.length-3},bf),o=bf(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},bf=()=>{let e=new ke;return e.end(),e},xf=()=>new D({read(){}}),Sf=()=>new je({write(){}}),Cf=()=>new Oe({read(){},write(){}}),wf=async(e,t,n)=>bc(e,t,n)})),Ef,Df,Of,kf,Af=t((()=>{ud(),du(),Z(),Ef=(e,t)=>Zl(kf,e,t,!1),Df=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Zc[e]}.`)},Of={fileNumber:Df,generator:sd,asyncGenerator:sd,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:Oe.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},kf={input:{...Of,fileUrl:({value:e})=>({stream:ve(e)}),filePath:({value:{file:e}})=>({stream:ve(e)}),webStream:({value:e})=>({stream:D.fromWeb(e)}),iterable:({value:e})=>({stream:D.from(e)}),asyncIterable:({value:e})=>({stream:D.from(e)}),string:({value:e})=>({stream:D.from(e)}),uint8Array:({value:e})=>({stream:D.from(Fe.from(e))})},output:{...Of,fileUrl:({value:e})=>({stream:ye(e)}),filePath:({value:{file:e,append:t}})=>({stream:ye(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:je.fromWeb(e)}),iterable:Df,asyncIterable:Df,string:Df,uint8Array:Df}}}));function jf(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Uf(t);let t=e.some(({readableObjectMode:e})=>e),n=Mf(e,t),r=new zf({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}var Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp=t((()=>{s(),c(),l(),Mf=(e,t)=>{if(e.length===0)return Me(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)},Nf=new WeakMap,Pf=new WeakMap,Ff=new WeakMap,If=new WeakMap,Lf=new WeakMap,Rf=new WeakMap,zf=class extends ke{constructor(...e){super(...e),f(this,Nf,new Set([])),f(this,Pf,new Set([])),f(this,Ff,new Set([])),f(this,If,void 0),f(this,Lf,Symbol(`unpipe`)),f(this,Rf,new WeakMap)}add(e){if(Uf(e),d(Nf,this).has(e))return;d(Nf,this).add(e),d(If,this)??p(If,this,Bf(this,d(Nf,this),d(Lf,this)));let t=Wf({passThroughStream:this,stream:e,streams:d(Nf,this),ended:d(Pf,this),aborted:d(Ff,this),onFinished:d(If,this),unpipeEvent:d(Lf,this)});d(Rf,this).set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Uf(e),!d(Nf,this).has(e))return!1;let t=d(Rf,this).get(e);return t===void 0?!1:(d(Rf,this).delete(e),e.unpipe(this),await t,!0)}},Bf=async(e,t,n)=>{ep(e,tp);let r=new AbortController;try{await Promise.race([Vf(e,r),Hf(e,t,n,r)])}finally{r.abort(),ep(e,-tp)}},Vf=async(e,{signal:t})=>{try{await O(e,{signal:t,cleanup:!0})}catch(t){throw Yf(e,t),t}},Hf=async(e,t,n,{signal:r})=>{for await(let[i]of Ee(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Uf=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Wf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{ep(e,np);let s=new AbortController;try{await Promise.race([Gf(a,t,s),Kf({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),qf({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),ep(e,-np)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Zf(e):Jf(e))},Gf=async(e,t,{signal:n})=>{try{await e,n.aborted||Zf(t)}catch(e){n.aborted||Yf(t,e)}},Kf=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await O(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Xf(r)?i.add(t):Qf(e,r)}},qf=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},Jf=e=>{e.writable&&e.end()},Yf=(e,t)=>{Xf(t)?Zf(e):Qf(e,t)},Xf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Zf=e=>{(e.readable||e.writable)&&e.destroy()},Qf=(e,t)=>{e.destroyed||(e.once(`error`,$f),e.destroy(t))},$f=()=>{},ep=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},tp=2,np=1})),ip,ap,op,sp,cp,lp=t((()=>{F(),ip=(e,t)=>{e.pipe(t),ap(e,t),sp(e,t)},ap=async(e,t)=>{if(!(N(e)||N(t))){try{await O(e,{cleanup:!0,readable:!0,writable:!1})}catch{}op(t)}},op=e=>{e.writable&&e.end()},sp=async(e,t)=>{if(!(N(e)||N(t))){try{await O(t,{cleanup:!0,readable:!1,writable:!0})}catch{}cp(e)}},cp=e=>{e.readable&&e.destroy()}})),up,dp,fp,pp,mp,hp,gp=t((()=>{rp(),F(),Ni(),Z(),lp(),up=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>X.has(e)))dp(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!X.has(e)))pp({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())ip(t.length===1?t[0]:jf(t),e)},dp=(e,t,n,r)=>{n===`output`?ip(e.stdio[r],t):ip(t,e.stdio[r]);let i=fp[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},fp=[`stdin`,`stdout`,`stderr`],pp=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;mp(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},mp=(e,{signal:t})=>{N(e)&&Mi(e,hp,t)},hp=2})),_p,vp=t((()=>{v(),_p=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=g(()=>{e.kill()});Te(r,()=>{i()})}})),yp,bp,xp,Sp,Cp,wp=t((()=>{Ke(),Mn(),ji(),We(),yp=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=An(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=bp(n,r,i),{sourceStream:d,sourceError:f}=Cp(e,l),{options:p,fileDescriptors:m}=H.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},bp=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=xp(e,t,...n);return{destination:r,destinationStream:xi(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},xp=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Sp,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||He(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ge(n,...r);return{destination:t(Sp)(i,a,o),pipeOptions:o}}if(H.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Sp=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Cp=(e,t)=>{try{return{sourceStream:Si(e,t)}}catch(e){return{sourceError:e}}}})),Tp,Ep,Dp,Op,kp=t((()=>{rc(),lp(),Tp=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Ep({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Dp({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Ep=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return cp(e),r;if(t!==void 0)return op(n),t},Dp=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>Qs({error:e,command:Op,escapedCommand:Op,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Op=`source.pipe(destination)`})),Ap,jp=t((()=>{Ap=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o}})),Mp,Np,Pp,Fp,Ip,Lp,Rp,zp=t((()=>{rp(),Ni(),lp(),Mp=(e,t,n)=>{let r=Ip.has(t)?Pp(e,t):Np(e,t);return Mi(e,Lp,n.signal),Mi(t,Rp,n.signal),Fp(t),r},Np=(e,t)=>{let n=jf([e]);return ip(n,t),Ip.set(t,n),n},Pp=(e,t)=>{let n=Ip.get(t);return n.add(e),n},Fp=async e=>{try{await O(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ip.delete(e)},Ip=new WeakMap,Lp=2,Rp=1})),Bp,Vp,Hp=t((()=>{kp(),Bp=(e,t)=>e===void 0?[]:[Vp(e,t)],Vp=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await ie(e,t),await n.remove(t),Dp({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})}})),Up,Wp,Gp,Kp=t((()=>{A(),wp(),kp(),jp(),zp(),Hp(),Up=(e,...t)=>{if(k(t[0]))return Up.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=yp(e,...t),i=Wp({...r,destination:n});return i.pipe=Up.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Wp=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Gp(e,i);Tp({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Mp(t,a,d);return await Promise.race([Ap(u),...Bp(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Gp=(e,t)=>Promise.allSettled([e,t])})),qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm=t((()=>{Ku(),Pu(),od(),qp=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Jp(t,o),Zp({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Jp=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Yp=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Xp(t,o,e);let s=e.readableObjectMode&&!a;return Zp({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Xp=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Zp=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=Ee(e,`data`,{signal:t.signal,highWaterMark:$p,highWatermark:$p});return em({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},Qp=Me(!0),$p=Qp,em=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=tm({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*nd(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*rd(s)}},tm=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Hu(e,n,!t),xu(e,i,!r,{})].filter(Boolean)})),rm,im,am,om,sm,cm,lm=t((()=>{Ns(),M(),wd(),nm(),Hs(),bu(),rm=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=im({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([am(e),d]);return}let f=Yp({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:yu(c,n),allMixed:s}),[p]=await Promise.all([om({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},im=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{_d({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await bd(Yp({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},am=async e=>{await Le(),e.readableFlowing===null&&e.resume()},om=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await ns(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await cs(n,{maxBuffer:a})):await ws(n,{maxBuffer:a})}catch(n){return cm(Ps({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},sm=async e=>{try{return await e}catch(e){return cm(e)}},cm=({bufferedData:e})=>Je(e)?new Uint8Array(e):e})),um,dm,fm,pm,mm,hm,gm,_m,vm,ym=t((()=>{um=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=dm(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],O(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||mm(e,t,n,r)}finally{o.abort()}},dm=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&fm(e,n,r),r},fm=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{pm(t,n),r.call(e,...i)}},pm=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},mm=(e,t,n,r)=>{if(!hm(e,t,n,r))throw e},hm=(e,t,n,r=!0)=>n.propagating?vm(e)||_m(e):(n.propagating=!0,gm(n,t)===r?vm(e):_m(e)),gm=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,_m=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,vm=e=>e?.code===`EPIPE`})),bm,xm,Sm=t((()=>{lm(),ym(),bm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>xm({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),xm=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=um(e,t,l);if(gm(l,t)){await u;return}let[d]=await Promise.all([rm({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d}})),Cm,wm,Tm,Em,Dm=t((()=>{rp(),Sm(),Cm=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?jf([e,t].filter(Boolean)):void 0,wm=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>xm({...Tm(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Em(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Tm=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},Em=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode})),Om,km,Am=t((()=>{Sn(),L(),Om=e=>Nt(e,`ipc`),km=(e,t)=>{gn({type:`ipc`,verboseMessage:bn(e),fdNumber:`ipc`,verboseInfo:t})}})),jm,Mm,Nm=t((()=>{Hs(),Am(),I(),pf(),jm=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Om(a),s=jt(t,`ipc`),c=jt(n,`ipc`);for await(let t of cf({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(Is(e,i,c),i.push(t)),o&&km(t,a);return i},Mm=async(e,t)=>(await Promise.allSettled([e]),t)})),Pm,Fm,Im,Lm,Rm=t((()=>{Co(),La(),ei(),Na(),F(),Z(),lm(),Nm(),Ka(),Dm(),Sm(),Bd(),ym(),Pm=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=Pd(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=bm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=wm({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),ee=[],te=jm({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:ee,verboseInfo:p}),ne=Fm(h,e,y),re=Im(m,y);try{return await Promise.race([Promise.all([{},Ld(v),Promise.all(b),x,te,Ga(e,d),...ne,...re]),g,Lm(e,_),...Fa(e,a,f,_),...Qr({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Aa({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??(f.terminationReason=`other`),Promise.all([{error:e},v,Promise.all(b.map(e=>sm(e))),sm(x),Mm(te,ee),Promise.allSettled(ne),Promise.allSettled(re)])}},Fm=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:um(e,r,n)),Im=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>W(t,{checkOpen:!1})&&!N(t)).map(({type:e,value:r,stream:i=r})=>um(i,n,t,{isSameDirection:X.has(e),stopOnExit:e===`native`}))),Lm=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n}})),zm,Bm,Vm,Hm=t((()=>{bi(),zm=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Bm=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=yi();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},Vm=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r}})),Um,Wm,Gm,Km,qm,Jm,Ym=t((()=>{ym(),Um=async e=>{if(e!==void 0)try{await Gm(e)}catch{}},Wm=async e=>{if(e!==void 0)try{await Km(e)}catch{}},Gm=async e=>{await O(e,{cleanup:!0,readable:!1,writable:!0})},Km=async e=>{await O(e,{cleanup:!0,readable:!0,writable:!1})},qm=async(e,t)=>{if(await e,t)throw t},Jm=(e,t,n)=>{n&&!_m(n)?e.destroy(n):t&&e.destroy()}})),Xm,Zm,Qm,$m,eh,th,nh,rh,ih=t((()=>{$a(),ji(),nm(),bi(),Hm(),Ym(),Xm=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||U.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Zm(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Qm(s,o),{read:f,onStdoutDataDone:p}=$m({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new D({read:f,destroy:S(nh.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return th({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},Zm=(e,t,n)=>{let r=Si(e,t);return{subprocessStdout:r,waitReadableDestroy:Bm(n,r,`readableDestroy`)}},Qm=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Qp},$m=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=yi(),o=qp({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){eh(this,o,a)},onStdoutDataDone:a}},eh=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},th=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Km(e),await r,await Um(i),await t,n.readable&&n.push(null)}catch(e){await Um(i),rh(n,e)}},nh=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Vm(n,t)&&(rh(e,r),await qm(t,r))},rh=(e,t)=>{Jm(e,e.readable,t)}})),ah,oh,sh,ch,lh,uh,dh,fh,ph=t((()=>{ji(),Hm(),Ym(),ah=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=oh(e,n,t),o=new je({...sh(r,e,i),destroy:S(dh.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return uh(r,o),o},oh=(e,t,n)=>{let r=xi(e,t);return{subprocessStdin:r,waitWritableFinal:Bm(n,r,`writableFinal`),waitWritableDestroy:Bm(n,r,`writableDestroy`)}},sh=(e,t,n)=>({write:ch.bind(void 0,e),final:S(lh.bind(void 0,e,t,n))}),ch=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},lh=async(e,t,n)=>{await Vm(n,t)&&(e.writable&&e.end(),await t)},uh=async(e,t,n)=>{try{await Gm(e),t.writable&&t.end()}catch(e){await Wm(n),fh(t,e)}},dh=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Vm(n,t),await Vm(r,t)&&(fh(e,i),await qm(t,i))},fh=(e,t)=>{Jm(e,e.writable,t)}})),mh,hh,gh=t((()=>{$a(),ih(),ph(),mh=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||U.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Zm(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=oh(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=Qm(c,s),{read:g,onStdoutDataDone:_}=$m({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new Oe({read:g,...sh(u,e,d),destroy:S(hh.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return th({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),uh(u,v,c),v},hh=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([nh({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),dh({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])}})),_h,vh,yh=t((()=>{$a(),ji(),nm(),_h=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||U.has(t),o=Si(e,n),s=qp({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return vh(s,o,e)},vh=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}}})),bh,xh=t((()=>{Hm(),ih(),ph(),gh(),yh(),bh=(e,{encoding:t})=>{let n=zm();e.readable=Xm.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=ah.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=mh.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=_h.bind(void 0,e,t),e[Symbol.asyncIterator]=_h.bind(void 0,e,t,{})}})),Sh,Ch,wh,Th=t((()=>{Sh=(e,t)=>{for(let[n,r]of wh){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Ch=(async()=>{})().constructor.prototype,wh=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ch,e)])})),Eh,Dh,Oh,kh,Ah,jh,Mh=t((()=>{Ns(),Pn(),co(),ji(),uo(),_f(),rc(),xc(),Tf(),Af(),bu(),gp(),Jr(),vp(),Kp(),Dm(),Rm(),xh(),bi(),Th(),Eh=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Dh(e,t,n),{subprocess:f,promise:p}=kh({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Up.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Sh(f,p),H.set(f,{options:u,fileDescriptors:d}),f},Dh=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Nn(e,t,n),{file:s,commandArguments:c,options:l}=ao(e,t,n),u=Oh(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Ef(u,o)}},Oh=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},kh=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=he(...lo(e,t,n))}catch(e){return vf({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;De(1/0,l.signal);let u=[...c.stdio];up(c,s,l),_p(c,n,l);let d={},f=yi();c.kill=Ur.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Cm(c,n),bh(c,n),mf(c,n);let p=Ah({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:a,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Ah=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Pm({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});u.abort(),l.resolve();let _=m.map((e,n)=>vu(e,t,n)),v=vu(h,t,`all`);return bc(jh({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},jh=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?$s({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof Yo,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Zs({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u})})),Nh,Ph,Fh,Ih=t((()=>{A(),I(),Nh=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Ph(t,e[t],n)]));return{...e,...n}},Ph=(e,t,n)=>Fh.has(e)&&k(t)&&k(n)?{...t,...n}:n,Fh=new Set([`env`,...At])})),$,Lh,Rh,zh=t((()=>{A(),Ke(),ht(),$d(),Mh(),Ih(),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>Lh({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Lh=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,Nh(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Rh({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Wd(s,c,l):Eh(s,c,l,i)},Rh=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ge(...ot(t)?st(t,n):[t,...n]),c=Nh(Nh(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}}})),Bh,Vh,Hh,Uh,Wh,Gh=t((()=>{Bh=({file:e,commandArguments:t})=>Hh(e,t),Vh=({file:e,commandArguments:t})=>({...Hh(e,t),isSync:!0}),Hh=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=Uh(e);return{file:n,commandArguments:r}},Uh=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(Wh)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Wh=/ +/g})),Kh,qh,Jh,Yh,Xh,Zh,Qh=t((()=>{Kh=(e,t,n)=>{e.sync=t(Jh,n),e.s=e.sync},qh=({options:e})=>Yh(e),Jh=({options:e})=>({...Yh(e),isSync:!0}),Yh=e=>({options:{...Xh(e),...e}}),Xh=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Zh={preferLocal:!0}})),$h,eg,tg,ng,rg,ig,ag=t((()=>{zh(),Gh(),Ba(),Qh(),_f(),z(),$h=$(()=>({})),eg=$(()=>({isSync:!0})),$(Bh),$(Vh),$(Ra),$(qh,{},Zh,Kh),{sendMessage:tg,getOneMessage:ng,getEachMessage:rg,getCancelSignal:ig}=hf()}));function og(e,t,n=10*cg*sg){let r;r=t===void 0?{}:t instanceof AbortSignal?{abortSignal:t,timeout:n}:t;let{abortSignal:i,timeout:a=10*cg*sg,input:o,stdio:s=[`ignore`,`pipe`,`pipe`]}=r;i?.throwIfAborted(),ee`exec: ${e.slice(0,200)}`;try{let t=eg(e,{env:process.env,maxBuffer:1e6,timeout:a,cwd:x(),stdio:s,shell:!0,reject:!1,input:o});return t.stdout&&t.stdout.trim()||null}catch{return null}}var sg,cg,lg=t((()=>{ag(),b(),te(),sg=1e3,cg=60}));function ug(e,t,n={timeout:10*mg*pg,preserveOutputOnError:!0,useCwd:!0}){return fg(e,t,{abortSignal:n.abortSignal,timeout:n.timeout,preserveOutputOnError:n.preserveOutputOnError,cwd:n.useCwd?x():void 0,env:n.env,stdin:n.stdin,input:n.input})}function dg(e,t){return e.shortMessage?e.shortMessage:typeof e.signal==`string`?e.signal:String(t)}function fg(e,t,{abortSignal:n,timeout:r=10*mg*pg,preserveOutputOnError:i=!0,cwd:a,env:o,maxBuffer:s,shell:c,stdin:l,input:u}={timeout:10*mg*pg,preserveOutputOnError:!0,maxBuffer:1e6}){return new Promise(d=>{$h(e,t,{maxBuffer:s,cancelSignal:n,timeout:r,cwd:a,env:o,shell:c,stdin:l,input:u,reject:!1}).then(e=>{if(e.failed)if(i){let t=e.exitCode??1;d({stdout:e.stdout||``,stderr:e.stderr||``,code:t,error:dg(e,t)})}else d({stdout:``,stderr:``,code:e.exitCode??1});else d({stdout:e.stdout,stderr:e.stderr,code:0})}).catch(e=>{re(e),d({stdout:``,stderr:``,code:1})})})}var pg,mg,hg=t((()=>{ag(),b(),ne(),lg(),pg=1e3,mg=60}));export{lg as a,ag as c,og as i,qn as l,fg as n,$h as o,hg as r,eg as s,ug as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{w as t,x as n}from"./debug-D58GQBDG.js";import{execSync as r}from"child_process";function i(e,n){return t`execSync: ${e.slice(0,100)}`,r(e,n)}var a=e((()=>{n()}));export{a as n,i as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as t,St as n,Zd as r,fT as i,gc as a,hc as o,pT as s,yt as c}from"./loadAgentsDir-DaNpxaO-.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,t as d}from"./ExitFlow-Dy8_1D8J.js";import{spawnSync as f}from"child_process";function p(){return s(g)??`Goodbye!`}async function m(e){if(a())return e(),f(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=c()!==null;return t?(0,h.jsx)(d,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(p()),await r(0,`prompt_input_exit`),null)}var h,g;e((()=>{i(),u(),o(),t(),n(),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{Dp as n,Op as r,Qu as i,Xh as a,Zh as o,Zu as s,uC as c}from"./loadAgentsDir-DaNpxaO-.js";import{D as l,Gt as u,I as d,P as f,T as p,ai as m,t as h,x as g}from"./src-DL3w8VPk2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{Bn as v,J as y,Pt as b,X as x,Y as S,Z as C,_ as w,x as T,z as E,zn as D,zt as O}from"./model-Do0f476p.js";import{n as k,t as A}from"./useExitOnCtrlCDWithKeybindings-Bw0mlTT9.js";import{n as j,r as M,t as N}from"./modelOptions-B3nis9cC.js";import{n as P,t as F}from"./fetchModelList-Dy-x4h3G.js";function I({initial:e,sessionModel:t,onSelect:r,onCancel:a,isStandaloneCommand:s,showFastModeNotice:c,headerText:m}){let h=k(),_=e===null?z:e,[v,y]=(0,L.useState)(_),b=o(e=>C()?e.fastMode:!1),[w,O]=(0,L.useState)(()=>new Set(D(_)?[_.replace(/\[1m\]/i,``)]:[])),A=(0,L.useCallback)(()=>{if(!v||v===z)return;let e=v.replace(/\[1m\]/i,``);O(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[v]),M=(0,L.useMemo)(()=>j(b??!1),[b]),[P,I]=(0,L.useState)(null),[B,V]=(0,L.useState)(!1);(0,L.useEffect)(()=>{let e=!1;return V(!1),F().then(t=>{if(!e){if(!t||t.length===0){I(null),V(!0);return}I(t)}}).catch(()=>{e||V(!0)}),()=>{e=!0}},[]);let H=(0,L.useMemo)(()=>P?N(P,b??!1):null,[P,b]),U=P===null&&!B,W=(0,L.useMemo)(()=>{let t=H??M;return e!==null&&!t.some(t=>t.value===e)?[...t,{value:e,label:T(e),description:`Current model`}]:t},[H,M,e]),G=(0,L.useMemo)(()=>W.map(e=>({...e,value:e.value===null?z:e.value})),[W]),K=(0,L.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===v)?.label,X=v!==void 0&&v!==z&&w.has(v.replace(/\[1m\]/i,``)),Z=(0,L.useCallback)(e=>{y(e)},[]);u({"modelPicker:toggle1M":()=>A()},{context:`ModelPicker`});function Q(e){if(e===z){r(null);return}let t=e.replace(/\[1m\]/i,``);r(w.has(t)?`${t}[1m]`:t)}let $=(0,R.jsxs)(d,{flexDirection:`column`,children:[(0,R.jsxs)(d,{flexDirection:`column`,children:[(0,R.jsxs)(d,{marginBottom:1,flexDirection:`column`,children:[(0,R.jsx)(f,{color:`remember`,bold:!0,children:`Select model`}),(0,R.jsx)(f,{dimColor:!0,children:m??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,R.jsxs)(f,{dimColor:!0,children:[`Currently using `,T(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,R.jsxs)(d,{flexDirection:`column`,marginBottom:1,children:[(0,R.jsx)(d,{flexDirection:`column`,children:(0,R.jsx)(i,{defaultValue:_,defaultFocusValue:K,options:G,onChange:Q,onFocus:Z,onCancel:a??(()=>{}),visibleOptionCount:q})}),J>0&&(0,R.jsx)(d,{paddingLeft:3,children:(0,R.jsxs)(f,{dimColor:!0,children:[`and `,J,` more…`]})}),U&&(0,R.jsx)(d,{paddingLeft:3,children:(0,R.jsx)(f,{dimColor:!0,children:`正在从 API 拉取可用模型列表…`})}),B&&P===null&&(0,R.jsx)(d,{paddingLeft:3,children:(0,R.jsx)(f,{dimColor:!0,children:`API 拉取失败,使用内置列表`})})]}),(0,R.jsx)(d,{marginBottom:1,flexDirection:`column`,children:X?(0,R.jsxs)(f,{dimColor:!0,children:[`1M context on`,(0,R.jsx)(f,{color:`subtle`,children:` · Space to toggle`})]}):(0,R.jsxs)(f,{color:`subtle`,children:[`1M context off`,Y?` for ${Y}`:``,(0,R.jsx)(f,{color:`subtle`,children:` · Space to toggle`})]})}),C()?c?(0,R.jsx)(d,{marginBottom:1,children:(0,R.jsxs)(f,{dimColor:!0,children:[`Fast mode is `,(0,R.jsx)(f,{bold:!0,children:`ON`}),` and available with `,E,` only (/fast). Switching to other models turn off fast mode.`]})}):S()&&!x()?(0,R.jsx)(d,{marginBottom:1,children:(0,R.jsxs)(f,{dimColor:!0,children:[`Use `,(0,R.jsx)(f,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,E,` only).`]})}):null:null]}),s&&(0,R.jsx)(f,{dimColor:!0,italic:!0,children:h.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,R.jsxs)(p,{children:[(0,R.jsx)(l,{shortcut:`Enter`,action:`confirm`}),(0,R.jsx)(n,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return s?(0,R.jsx)(g,{color:`permission`,children:$}):$}var L,R,z,B=e((()=>{L=t(m(),1),v(),A(),y(),h(),c(),a(),w(),M(),P(),r(),s(),R=_(),z=`__NO_PREFERENCE__`}));function V(e,t,n){if(!O())return!1;if(t)return!0;if(e===null||!D(e))return!1;let r=e.toLowerCase().replace(/\[1m\]$/,``).trim(),i=r===`opus`||r.includes(`opus-4-6`)||r.includes(`opus-4-7`),a=r===`sonnet`||r.includes(`sonnet-4-6`);return i&&n?!1:i||a}var H=e((()=>{b(),v()}));export{B as i,V as n,I as r,H as t};
@@ -1 +0,0 @@
1
- import{Ac as e,Oc as t,jc as n,kc as r}from"./loadAgentsDir-DaNpxaO-.js";n();export{t as drainPendingExtraction,r as executeExtractMemories,e as initExtractMemories};
@@ -1 +0,0 @@
1
- import{n as e,r as t,t as n}from"./fast-xtIP4u4y.js";t();export{n as FastModePicker,e as call};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$h as n,Xh as r,Zh as i,uC as a}from"./loadAgentsDir-DaNpxaO-.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-DL3w8VPk2.js";import{t as g}from"./jsx-runtime-Bb4Xn-E0.js";import{Ut as _,b as v,h as y}from"./settings-3xZ0fsvE.js";import{c as b,h as x}from"./config-DRy1I12M.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{l as w,v as T}from"./startupProfiler-CbzxVmbv.js";import{B as E,H as D,I as O,J as k,L as A,Q as j,R as M,V as N,W as P,Z as F,rt as I,z as L}from"./model-Do0f476p.js";import{n as R,t as z}from"./systemTheme-Ceakddth.js";function B({cooldown:e}){return e?(0,H.jsx)(l,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(l,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let n=R(b().theme);return t?d.dim(p(`promptBorder`,n)(`↯`)):p(`fastMode`,n)(`↯`)}var H,U=e((()=>{f(),_(),m(),x(),z(),H=g()}));function W(e,t){E(),v(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!j(e.mainLoopModel);return{...e,...t?{mainLoopModel:N(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let r=i(e=>e.mainLoopModel),a=i(e=>e.fastMode),u=n(),[d,f]=(0,J.useState)(a??!1),p=D(),m=p.status===`cooldown`,g=t!==null,_=O(A(!0));function v(){g||(W(d,u),C(`tengu_fast_mode_toggled`,{enabled:d,source:`picker`}),d?e(`${V(d)} Fast mode ON${j(r)?``:` · model set to ${L}`} · ${_}`):(u(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function y(){if(g){a&&W(!1,u),e(`Fast mode OFF`,{display:`system`});return}e(a?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function b(){g||f(e=>!e)}return o({"confirm:yes":v,"confirm:nextField":b,"confirm:next":b,"confirm:previous":b,"confirm:cycleMode":b,"confirm:toggle":b},{context:`Confirmation`}),(0,Y.jsxs)(h,{title:(0,Y.jsxs)(l,{children:[(0,Y.jsx)(B,{cooldown:m}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${L}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:y,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(l,{children:[`Press `,e.keyName,` again to exit`]}):g?(0,Y.jsx)(l,{children:`Esc to cancel`}):(0,Y.jsx)(l,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsx)(l,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(s,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(l,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(l,{color:d?`fastMode`:void 0,bold:d,children:d?`ON `:`OFF`}),(0,Y.jsx)(l,{dimColor:!0,children:_})]})}),m&&p.status===`cooldown`&&(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsxs)(l,{color:`warning`,children:[p.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,w(p.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(l,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(c,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=P();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 ${L}`} · ${O(A(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!F())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=P();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(),a(),S(),r(),k(),T(),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,t}from"./fetchModelList-Dy-x4h3G.js";e();export{t as fetchAvailableModels};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-D58GQBDG.js";import{r,t as i}from"./memoize-CumjjK2Q.js";import{s as a,u as o}from"./oauth-D38aRTUb.js";import{$r as s,Gn as c,Kn as l,Kr as u,Pt as d,Ur as f,ti as p,zt as m}from"./model-Do0f476p.js";import{n as h,r as g}from"./client-C_jBL1yC.js";async function _(){let e=s();try{switch(e){case`firstParty`:{let e=await c({maxRetries:1}),t=m()?[a]:void 0,n=[];for await(let r of e.models.list({betas:t}))n.push({value:r.id,label:r.display_name??r.id,description:r.id});return n.length>0?n:null}case`openai`:{let e=h({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.id,description:`via openai-compat`});return t.length>0?t:null}case`grok`:{let{getGrokClient:e}=await import(`./client-Dd7CKMRX.js`),t=e({maxRetries:1}),n=[];for await(let e of t.models.list())n.push({value:e.id,label:e.id,description:`via grok`});return n.length>0?n:null}case`bedrock`:{let e=(await f()).map(e=>({value:e,label:e,description:`Bedrock inference profile`}));return e.length>0?e:null}case`gemini`:case`vertex`:case`foundry`:return null}}catch(n){return t(`[fetchModelList] ${e} failed: ${n instanceof Error?n.message:`unknown`}`),null}return null}var v,y,b=e((()=>{o(),l(),g(),d(),n(),i(),u(),p(),v=300*1e3,y=r(_,v)}));export{b as n,y as t};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{Mt as a,Rt as o,_ as s,g as c,hn as l,p as u}from"./loadAgentsDir-DaNpxaO-.js";import{cr as d,lr as f}from"./state-D5D6QpTX.js";import{n as p,t as m}from"./cwd-Nh5IZNKO.js";import{P as h,R as g,c as _,f as v,i as ee,u as y}from"./debug-D58GQBDG.js";import{ar as b,h as x,sr as te,t as ne}from"./settings-3xZ0fsvE.js";import{c as re,h as ie}from"./config-DRy1I12M.js";import{m as ae,p as oe,r as S}from"./git-By_J4XJL.js";import{n as se,r as ce}from"./execFileNoThrow-Bmb5HEFz.js";import{o as le,s as C}from"./log-CZ7ploQm.js";import{n as ue,r as w}from"./analytics-DJobLaWP.js";import{a as de,s as fe}from"./ripgrep-C3jtZL7k.js";import*as T from"path";import{statSync as pe}from"fs";function me(e,t,n){if(t===0)return n?k:0;let r=e.charCodeAt(t-1);return he(r)?be:ge(r)&&_e(e.charCodeAt(t))?D:0}function he(e){return e===47||e===92||e===45||e===95||e===46||e===32}function ge(e){return e>=97&&e<=122}function _e(e){return e>=65&&e<=90}function E(){return new Promise(e=>setImmediate(e))}function ve(e,t){let n=new Set;for(let r of e){let e=r.length;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if(n===47||n===92){e=t;break}}let i=r.slice(0,e);if(i.length>0&&(n.add(i),n.size>=t))break}let r=Array.from(n);return r.sort((e,t)=>{let n=e.length-t.length;return n===0?e<t?-1:+(e>t):n}),r.slice(0,t).map(e=>({path:e,score:0}))}var ye,be,D,O,k,A,j,M,N,P,F,xe=e((()=>{n(),ye=16,be=8,D=6,O=4,k=8,A=3,j=1,M=100,N=64,P=new Int32Array(N),F=class{constructor(){r(this,`paths`,[]),r(this,`lowerPaths`,[]),r(this,`charBits`,new Int32Array),r(this,`pathLens`,new Uint16Array),r(this,`topLevelCache`,null),r(this,`readyCount`,0)}loadFromFileList(e){let t=new Set,n=[];for(let r of e)r.length>0&&!t.has(r)&&(t.add(r),n.push(r));this.buildIndex(n)}loadFromFileListAsync(e){let t=()=>{};return{queryable:new Promise(e=>{t=e}),done:this.buildAsync(e,t)}}async buildAsync(e,t){let n=new Set,r=[],i=performance.now();for(let t=0;t<e.length;t++){let a=e[t];a.length>0&&!n.has(a)&&(n.add(a),r.push(a)),(t&255)==255&&performance.now()-i>4&&(await E(),i=performance.now())}this.resetArrays(r),i=performance.now();let a=!0;for(let e=0;e<r.length;e++)this.indexPath(e),(e&255)==255&&performance.now()-i>4&&(this.readyCount=e+1,a&&(t(),a=!1),await E(),i=performance.now());this.readyCount=r.length,t()}buildIndex(e){this.resetArrays(e);for(let t=0;t<e.length;t++)this.indexPath(t);this.readyCount=e.length}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=ve(e,M)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n>=97&&n<=122&&(r|=1<<n-97)}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0)return this.topLevelCache?this.topLevelCache.slice(0,t):[];let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),i=Math.min(r.length,N),a=Array(i),o=0;for(let e=0;e<i;e++){let t=r.charAt(e);a[e]=t;let n=t.charCodeAt(0);n>=97&&n<=122&&(o|=1<<n-97)}let s=i*24+k+32,c=[],l=-1/0,{paths:u,lowerPaths:d,charBits:f,pathLens:p,readyCount:m}=this;for(let e=0;e<m;e++){if((f[e]&o)!==o)continue;let r=n?u[e]:d[e],m=a[0],h=0,g=[],_=r.indexOf(m);if(_===-1)continue;g[h++]=_;for(let e=_+1;e<r.length;e++){if(r.charCodeAt(e)!==m.charCodeAt(0))continue;let t=r.charCodeAt(e-1);(t===47||t===92||t===45||t===95||t===46||t===32)&&(g[h++]=e)}let v=u[e],ee=p[e],y=Math.max(0,32-(ee>>2)),b=-1/0;for(let e=0;e<h;e++){P[0]=g[e];let n=0,o=0,u=P[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}P[e]=t;let i=t-u-1;i===0?o+=O:n+=A+i*j,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,P[0],!0);for(let e=1;e<i;e++)f+=me(v,P[e],!1);f+=y,f>b&&(b=f)}if(b===-1/0)continue;let x=b;if(c.length<t)c.push({path:v,fuzzScore:x}),c.length===t&&(c.sort((e,t)=>e.fuzzScore-t.fuzzScore),l=c[0].fuzzScore);else if(x>l){let e=0,t=c.length;for(;e<t;){let n=e+t>>1;c[n].fuzzScore<x?e=n+1:t=n}c.splice(e,0,{path:v,fuzzScore:x}),c.shift(),l=c[0].fuzzScore}}c.sort((e,t)=>t.fuzzScore-e.fuzzScore);let h=c.length,g=Math.max(h,1),_=Array(h);for(let e=0;e<h;e++){let t=c[e].path,n=e/g;_[e]={path:t,score:t.includes(`test`)?Math.min(n*1.05,1):n}}return _}}}));function I(){return z||(z=new F),z}function Se(){z=null,B=null,H++,U=null,W=[],G=[],K=[],V.clear(),q=null,J=null,Y=0,X=null,Z=null,Q=null}function Ce(e){let t=e.length,n=Math.max(1,Math.floor(t/500)),r=-2128831035;for(let i=0;i<t;i+=n){let t=e[i];for(let e=0;e<t.length;e++)r=(r^t.charCodeAt(e))*16777619|0;r=r*16777619|0}if(t>0){let n=e[t-1];for(let e=0;e<n.length;e++)r=(r^n.charCodeAt(e))*16777619|0}return`${t}:${(r>>>0).toString(16)}`}function we(){let e=S(m());if(!e)return null;try{return pe(T.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function Te(e,t,n){return n===t?e:e.map(e=>{let r=T.join(t,e);return T.relative(n,r)})}async function Ee(e){if(e.length===0||!z||W.length===0)return;let t=await ke(e),n=[...W,...G,...K,...e,...t],r=Ce(n);if(r===Q){_(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await z.loadFromFileListAsync(n).done,Q=r,_(`[FileIndex] rebuilt index with ${W.length} tracked + ${e.length} untracked files`)}async function De(e,t){let n=`${e}:${t}`;if(J===n)return q;let r=y(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,Be.default)(),s=!1,c=a.flatMap(e=>i.map(t=>T.join(e,t))),l=await Promise.all(c.map(e=>r.readFile(e,{encoding:`utf8`}).catch(()=>null)));for(let[e,t]of l.entries())t!==null&&(o.add(t),s=!0,_(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return q=u,J=n,u}async function Oe(e,t){let n=Date.now();_(`[FileIndex] getFilesUsingGit called`);let r=m(),i=S(r);if(!i)return _(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await se(oe(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(_(`[FileIndex] git ls-files (tracked) took ${Date.now()-a}ms`),o.code!==0)return _(`[FileIndex] git ls-files failed (code=${o.code}, stderr=${o.stderr}), falling back to ripgrep`),null;let s=Te(o.stdout.trim().split(`
2
- `).filter(Boolean),i,r),c=await De(i,r);if(c){let e=s.length;s=c.filter(s),_(`[FileIndex] applied ignore patterns: ${e} -> ${s.length} files`)}W=s;let l=Date.now()-n;if(_(`[FileIndex] git ls-files: ${s.length} tracked files in ${l}ms`),w(`tengu_file_suggestions_git_ls_files`,{file_count:s.length,tracked_count:s.length,untracked_count:0,duration_ms:l}),!U){let e=t?[`-c`,`core.quotepath=false`,`ls-files`,`--others`,`--exclude-standard`]:[`-c`,`core.quotepath=false`,`ls-files`,`--others`],n=H;U=se(oe(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===H&&e.code===0){let t=Te(e.stdout.trim().split(`
3
- `).filter(Boolean),i,r),n=await De(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),_(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}_(`[FileIndex] background untracked fetch: ${t.length} files`),Ee(t)}}).catch(e=>{_(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return s}catch(e){return _(`[FileIndex] git ls-files error: ${h(e)}`),null}}async function ke(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)Ae(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await E(),n=performance.now());return[...t].map(e=>e+T.sep)}function Ae(e,t,n,r){for(let i=t;i<n;i++){let t=T.dirname(e[i]);for(;t!==`.`&&!r.has(t);){let e=T.dirname(t);if(e===t)break;r.add(t),t=e}}}async function je(e){return(await Promise.all(u.map(t=>s(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function Me(e,t){_(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await Oe(e,t);if(n!==null)return _(`[FileIndex] using git ls-files result (${n.length} files)`),n;_(`[FileIndex] git ls-files returned null, falling back to ripgrep`);let r=Date.now(),i=[`--files`,`--follow`,`--hidden`,`--glob`,`!.git/`,`--glob`,`!.svn/`,`--glob`,`!.hg/`,`--glob`,`!.bzr/`,`--glob`,`!.jj/`,`--glob`,`!.sl/`];t||i.push(`--no-ignore-vcs`);let a=(await fe(i,`.`,e)).map(e=>T.relative(m(),e)),o=Date.now()-r;return _(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),w(`tengu_file_suggestions_ripgrep`,{file_count:a.length,duration_ms:o}),a}async function Ne(){let e=AbortSignal.timeout(1e4),t=I();try{let n=ne(),r=re(),i=n.respectGitignore??r.respectGitignore??!0,a=m(),[o,s]=await Promise.all([Me(e,i),je(a)]);G=s;let c=[...o,...s],l=await ke(c);K=l;let u=[...l,...c],d=Ce(u);d===Z?_(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(u).done,Z=d,Q=null)}catch(e){C(e)}return t}function Pe(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return e.substring(0,r)}function Fe(e){if(e.length===0)return``;let t=e.map(e=>e.displayText),n=t[0];for(let e=1;e<t.length;e++){let r=t[e];if(n=Pe(n,r),n===``)return``}return n}function L(e,t){return{id:`file-${e}`,displayText:e,metadata:t===void 0?void 0:{score:t}}}function Ie(e,t){return e.search(t,$).map(e=>L(e.path,e.score))}function R(){if(B)return;let e=we();if(z&&!(e!==null&&e!==X)&&Date.now()-Y<He)return;let t=H,n=Date.now();I(),B=Ne().then(r=>t===H?(B=null,V.emit(),X=e,Y=Date.now(),_(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(_(`[FileIndex] Cache refresh failed: ${h(e)}`),C(e),t===H&&(B=null),I()))}async function Le(){let e=y(),t=m();try{return(await e.readdir(t)).map(e=>{let n=T.join(t,e.name),r=T.relative(t,n);return e.isDirectory()?r+T.sep:r})}catch(e){return C(e),[]}}async function Re(e,t=!1){if(!e&&!t)return[];if(ne().fileSuggestion?.type===`command`)return(await o({...a(),query:e})).slice(0,$).map(L);if(e===``||e===`.`||e===`./`){let e=await Le();return R(),e.slice(0,$).map(L)}let n=Date.now();try{let t=B!==null;R();let r=e,i=`.${T.sep}`;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=b(r));let a=z?Ie(z,r):[],o=Date.now()-n;return _(`[FileIndex] generateFileSuggestions: ${a.length} results in ${o}ms (${t?`partial`:`full`} index)`),w(`tengu_file_suggestions_query`,{duration_ms:o,cache_hit:!t,result_count:a.length,query_length:e.length}),a}catch(e){return C(e),[]}}function ze(e,t,n,r,i,a){let o=typeof e==`string`?e:e.displayText;i(t.substring(0,r)+o+t.substring(r+n.length)),a(r+o.length)}var Be,z,B,V,Ve,H,U,W,G,K,q,J,Y,X,Z,Q,$,He,Ue=e((()=>{Be=t(i(),1),c(),xe(),ue(),ie(),p(),ee(),g(),ce(),v(),ae(),l(),le(),te(),de(),x(),f(),z=null,B=null,V=d(),Ve=V.subscribe,H=0,U=null,W=[],G=[],K=[],q=null,J=null,Y=0,X=null,Z=null,Q=null,$=15,He=5e3}));export{Ue as a,Re as i,Se as n,Ve as o,Fe as r,R as s,ze as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./firstPartyEventLogger-DqGSujCz.js";e();export{t as initialize1PEventLogging};
@@ -1,3 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{i as r,l as i,o as a}from"./envUtils-DcaKZlRU.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{R as ee,Ut as p,ft as m}from"./state-D5D6QpTX.js";import{n as te,t as ne}from"./cwd-Nh5IZNKO.js";import{C as h,P as re,R as ie,U as ae,V as oe,x as se}from"./debug-D58GQBDG.js";import{Jt as ce,Kt as le}from"./settings-3xZ0fsvE.js";import{c as ue,d as g,h as _,n as de}from"./config-DRy1I12M.js";import{c as fe,o as pe}from"./execFileNoThrow-Bmb5HEFz.js";import{d as me,o as he,p as v,s as y}from"./log-CZ7ploQm.js";import{a as ge,i as _e,o as ve}from"./platform-DMQxcm4K.js";import{l as ye,s as be}from"./types-APu4OCXJ.js";import{i as xe,n as Se}from"./analytics-DJobLaWP.js";import{n as Ce,r as b}from"./startupProfiler-CbzxVmbv.js";import{Dt as we,Nt as Te,Or as Ee,Pt as x,St as De,Tt as S,Xn as Oe,dn as ke,fn as Ae,kr as je,kt as Me,qn as Ne,zt as Pe}from"./model-Do0f476p.js";import{n as Fe,t as Ie}from"./userAgent-i-oGzf40.js";import{Z as Le,_ as Re,c as ze,et as C,it as Be,n as Ve,o as He,t as Ue,v as We,w}from"./esm-CvHtYRrr.js";import*as T from"path";import{randomUUID as E}from"crypto";import{appendFile as Ge,mkdir as D,readdir as Ke,unlink as O,writeFile as qe}from"fs/promises";function k(){return i(process.env.CLAUDE_CODE_USE_BEDROCK)||i(process.env.CLAUDE_CODE_USE_VERTEX)||i(process.env.CLAUDE_CODE_USE_FOUNDRY)||v()}function Je(){return v()}var A=e((()=>{a(),me()}));async function Ye(){j===null&&!M&&(M=Qe(),j=await M,M=null,N.cache.clear?.())}function Xe(){j=null,M=null,N.cache.clear?.(),P.cache.clear?.()}function Ze(){if(j!==null)return j;let e=S();if(e?.emailAddress)return e.emailAddress}async function Qe(){let e=S();if(e?.emailAddress)return e.emailAddress}var j,M,N,P,F=e((()=>{fe(),n(),p(),x(),_(),te(),ce(),a(),j=null,M=null,N=t(e=>{let t=g(),n=ue(),r,a,o;if(e&&(r=Me()??void 0,a=we()??void 0,r&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=S(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.20`,platform:le(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:r,rateLimitTier:a,firstTokenTime:o,...i(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}}),P=t(async()=>{let e=await pe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function $e(){return{seconds:0,nanos:0}}function I(e){return e!=null}var L,et=e((()=>{L={fromJSON(e){return{seconds:I(e.seconds)?globalThis.Number(e.seconds):0,nanos:I(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=$e();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function tt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,nt=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=tt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function rt(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function it(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function at(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ot(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function st(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):st(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ct=e((()=>{et(),nt(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=rt();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=H.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return U.fromPartial(e??{})},fromPartial(e){let t=it();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?H.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=at();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=U.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=z.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=W.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=ot();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?U.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?z.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?W.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function K(){return T.join(r(),`telemetry`)}function lt(e){if(!d.isAxiosError(e))return re(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var q,J,Y,ut=e((()=>{We(),f(),p(),ct(),x(),_(),a(),ie(),Oe(),be(),he(),ke(),se(),Fe(),Ee(),Se(),C(),o(),q=E(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.skipAuth=e.skipAuth??!1,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return T.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await ye(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await O(e)}catch{}else await D(K(),{recursive:!0}),await qe(e,`${t.map(e=>h(e)).join(`
2
- `)}\n`,`utf8`)}catch(e){y(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await D(K(),{recursive:!0}),await Ge(e,`${t.map(e=>h(e)).join(`
3
- `)}\n`,`utf8`)}catch(e){y(e)}}async deleteFile(e){try{await O(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ke(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(oe(e))return;throw e}for(let e of t){let t=T.join(K(),e);this.retryFileInBackground(t)}}catch(e){y(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}let n=await this.sendEventsInBatches(t);n.length===0?await this.deleteFile(e):await this.saveEventsToFile(e,n)}async export(e,t){if(this.isShutdown){t({code:w.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:w.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:w.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:w.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:w.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:w.SUCCESS})}catch(e){y(e),t({code:w.FAILED,error:ae(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=lt(i);for(let r=e;r<t.length;r++)n.push(...t[r]);break}e<t.length-1&&this.batchDelayMs>0&&await Ae(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;y(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":Ie(),"x-service-name":`workmate`},n=de()||ee(),r=this.skipAuth||!n;if(!r&&Pe()){let e=De();Te()?e&&je(e.expiresAt)&&(r=!0):r=!0}let i=r?{headers:{},error:`trust not established or Oauth token expired`}:Ne(),a=!i.error,o=a?{...t,...i.headers}:t;try{let t=await d.post(this.endpoint,e,{timeout:this.timeout,headers:o});this.logSuccess(e.events.length,a,t.data);return}catch(n){if(a&&d.isAxiosError(n)&&n.response?.status===401){let n=await d.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}throw n}}logSuccess(e,t,n){}hrTimeToDate(e){let[t,n]=e;return new Date(t*1e3+n/1e6)}transformLogsToEvents(e){let t=[];for(let n of e){let e=n.attributes||{},r=e.event_name||n.body||`unknown`,i=e.core_metadata,a=e.user_metadata,o=e.event_metadata||{};if(!i){t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:m(),additional_metadata:Buffer.from(h({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Be(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=xe(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),device_id:e.user_id,email:a?.email,auth:s.auth,...s.core,env:s.env,process:s.process,skill_name:typeof c==`string`?c:void 0,plugin_name:typeof l==`string`?l:void 0,marketplace_name:typeof u==`string`?u:void 0,additional_metadata:Object.keys(f).length>0?Buffer.from(h(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush()}async forceFlush(){await Promise.all(this.pendingExports)}}}));function X(e){return!1}var dt=e((()=>{}));function ft(){return{}}function pt(e){let t=ft()[e];if(!t)return null;let n=t.sample_rate;return typeof n!=`number`||n<0||n>1||n>=1?null:n<=0?0:Math.random()<n?n:0}async function mt(){if($)try{await $.shutdown()}catch{}}function Z(){return!k()}async function ht(e,t,n={}){try{let r=await Le({model:n.model,betas:n.betas}),i={event_name:t,event_id:E(),core_metadata:r,user_metadata:N(!0),event_metadata:n},a=g();a&&(i.user_id=a),e.emit({body:t,attributes:i})}catch{}}function gt(e,t={}){Z()&&(!Q||X(`firstParty`)||ht(Q,e,t))}function _t(){if(b(`1p_event_logging_start`),!Z())return;b(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||vt.toString(),10),t=yt,n=bt,r=_e(),i={[l]:`workmate`,[c]:`0.0.20`};if(r===`wsl`){let e=ge();e&&(i[`wsl.version`]=e)}$=new He({resource:Re(i),processors:[new Ve(new Y({maxBatchSize:t,isKilled:()=>X(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.20`)}var vt,yt,bt,Q,$,xt=e((()=>{ze(),Ue(),u(),_(),ve(),Ce(),F(),A(),ut(),C(),dt(),vt=1e4,yt=200,bt=8192,Q=null,$=null}));export{gt as a,P as c,Xe as d,A as f,Z as i,Ye as l,Je as m,xt as n,pt as o,k as p,_t as r,mt as s,ft as t,F as u};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{D as n,E as r,N as i,_ as a,n as o,r as s,t as c}from"./lazySchema-DULtBUCI.js";import{P as l,R as u,c as d,i as f}from"./debug-D58GQBDG.js";import{C as p,vt as m,w as h,yt as g}from"./sessionState-CQhbGfmh.js";import"./bridgeMessaging-DVC3qj-C.js";import{i as _}from"./workSecret-CaM2yIJD.js";import{t as v}from"./ccrClient-DO563xlf.js";import{n as y,t as b}from"./SSETransport-B3K6eH9I.js";s(),c(),m();var x={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},S=o(()=>n({init_retry_max_attempts:r().int().min(1).max(10).default(3),init_retry_base_delay_ms:r().int().min(100).default(500),init_retry_jitter_fraction:r().min(0).max(1).default(.25),init_retry_max_delay_ms:r().int().min(500).default(4e3),http_timeout_ms:r().int().min(2e3).default(1e4),uuid_dedup_buffer_size:r().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:r().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:r().min(0).max(.5).default(.1),token_refresh_buffer_ms:r().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:r().int().min(500).max(2e3).default(1500),connect_timeout_ms:r().int().min(5e3).max(6e4).default(15e3),min_version:i().refine(e=>{try{return g(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:a().default(!1)}));async function C(){let e=x,t=S().safeParse(e);return t.success?t.data:x}async function w(){let e=await C();return e.min_version&&g(`0.0.20`,e.min_version)?`Your version of Work Mate (0.0.20) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}y(),f(),u(),p();function T(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function E(e){let{sessionUrl:t,ingressToken:n,sessionId:r,initialSequenceNum:i,getAuthToken:a}=e,o;a?o=()=>{let e=a();return e?{Authorization:`Bearer ${e}`}:{}}:h(n);let s=e.epoch??await _(t,n);d(`[bridge:repl] CCR v2: worker sessionId=${r} epoch=${s}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let c=new URL(t);c.pathname=`${c.pathname.replace(/\/$/,``)}/worker/events/stream`;let u=new b(c,{},r,void 0,i,o),f,p=new v(u,new URL(t),{getAuthHeaders:o,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{d(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{p.close(),u.close(),f?.(4090)}catch(e){d(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${l(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});u.setOnEvent(e=>{p.reportDelivery(e.event_id,`received`),p.reportDelivery(e.event_id,`processed`)});let m,g=!1,y=!1;return{write(e){return p.writeEvent(e)},async writeBatch(e){for(let t of e){if(y)break;await p.writeEvent(t)}},close(){y=!0,p.close(),u.close()},isConnectedStatus(){return g},getStateLabel(){return u.isClosedStatus()?`closed`:u.isConnectedStatus()?g?`connected`:`init`:`connecting`},setOnData(e){u.setOnData(e)},setOnClose(e){f=e,u.setOnClose(t=>{p.close(),e(t??4092)})},setOnConnect(e){m=e},getLastSequenceNum(){return u.getLastSequenceNum()},droppedBatchCount:0,reportState(e){p.reportState(e)},reportMetadata(e){p.reportMetadata(e)},reportDelivery(e,t){p.reportDelivery(e,t)},flush(){return p.flush()},connect(){e.outboundOnly||u.connect(),p.initialize(s).then(()=>{g=!0,d(`[bridge:repl] v2 transport ready for writes (epoch=${s}, sse=${u.isConnectedStatus()?`open`:`opening`})`),m?.()},e=>{d(`[bridge:repl] CCR v2 initialize failed: ${l(e)}`,{level:`error`}),p.close(),u.close(),f?.(4091)})}}}e();var D=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{C as a,w as i,T as n,E as r,D as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-DL3w8VPk2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";var r=e(t(),1),i=n(),a=(0,r.createContext)(void 0);function o({getFpsMetrics:e,children:t}){return(0,i.jsx)(a.Provider,{value:e,children:t})}function s(){return(0,r.useContext)(a)}export{s as n,o as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ka as t,La as n,Wa as r,it as i,pa as a,tt as o}from"./loadAgentsDir-DaNpxaO-.js";import{P as s,R as c,c as l,i as u}from"./debug-D58GQBDG.js";import{a as d,l as f}from"./proxy-BhIc7-mj.js";import{B as p,H as m,L as h,T as g,W as _,q as v,z as y}from"./sessionState-CQhbGfmh.js";import{n as b,r as x}from"./SSETransport-B3K6eH9I.js";import{randomUUID as S}from"crypto";function C(){return(process.env.GEMINI_BASE_URL||E).replace(/\/+$/,``)}function w(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*T(e){let t=await(e.fetchOverride??fetch)(`${C()}/${w(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...d({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,D);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${s(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${s(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),c(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,n,o,s,c,u){try{let a=v(c.model),d=t(e,o),f=(await Promise.all(o.map(e=>i(e,{getToolPermissionContext:c.getToolPermissionContext,tools:o,agents:c.agents,allowedAgentTypes:c.allowedAgentTypes,model:c.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:g,systemInstruction:b}=m(d,n),x=p(f),C=y(c.toolChoice),w=T({model:a,signal:s,fetchOverride:c.fetchOverride,body:{contents:g,...b&&{systemInstruction:b},...x.length>0&&{tools:x},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...c.temperatureOverride!==void 0&&{temperature:c.temperatureOverride},...u.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...u.type===`enabled`&&{thinkingBudget:u.budgetTokens}}}}}});l(`[Gemini] Calling model=${a}, messages=${g.length}, tools=${x.length}`);let E=h(w,a),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.type===`thinking`?r.signature=n.signature:r[_]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:r([t],o,c.agentId)},requestId:void 0,type:`assistant`,uuid:S(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Gemini] Error: ${t}`,{level:`error`}),yield a({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{o(),u(),n(),O(),g()}))();export{k as queryModelGemini};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{La as t,Ta as n,X as r,Z as i,by as a}from"./loadAgentsDir-DaNpxaO-.js";import{P as o,R as s,c,i as l}from"./debug-D58GQBDG.js";import{s as u,u as d}from"./types-APu4OCXJ.js";import{Q as f}from"./sessionState-CQhbGfmh.js";import{r as p,t as m}from"./sessionTitle-k4wpUS5l.js";async function h(e,t){let r=m(e);if(!r)return null;try{let e=await i({systemPrompt:f([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:r,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),a=d(Array.isArray(e.message.content)?n(e.message.content):e.message.content);return a&&typeof a==`object`&&`name`in a&&typeof a.name==`string`?a.name:null}catch(e){return c(`generateSessionName failed: ${o(e)}`,{level:`error`}),null}}var g=e((()=>{r(),l(),s(),u(),t(),p(),a()}));export{g as n,h as t};
@@ -1,5 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{Ut as a,sr as o}from"./state-D5D6QpTX.js";import{n as s,t as c}from"./cwd-Nh5IZNKO.js";import{C as ee,f as l,i as te,nt as ne,tt as re,u,x as ie}from"./debug-D58GQBDG.js";import{r as ae,t as d}from"./execFileNoThrow-Bmb5HEFz.js";import{o as oe}from"./log-CZ7ploQm.js";import{n as f,t as se}from"./memoize-CumjjK2Q.js";import{r as ce,t as le}from"./which-BxQ1hpjp.js";import{basename as ue,dirname as p,join as m,resolve as h,sep as g}from"path";import{readFileSync as _,realpathSync as v,statSync as y,unwatchFile as b,watchFile as de}from"fs";import{createHash as fe}from"crypto";import{readFile as x,readdir as pe,stat as me}from"fs/promises";function S(e,t,n){let r=he();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=u(),o=`${ee(i)}\n`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(p(r)),a.appendFileSync(r,o)}catch{}}}function he(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function ge(e,t,n){let r=Date.now();S(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return S(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw S(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var C=e((()=>{l(),ie()}));async function w(e,t,n,r){try{return _e(await x(m(e,`config`),`utf-8`),t,n,r)}catch{return null}}function _e(e,t,n,r){let i=e.split(`
2
- `),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=xe(t,a,n);continue}if(!s)continue;let r=ve(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ve(e){let t=0;for(;t<e.length&&Se(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:ye(e,t)}}function ye(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
3
- `;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=be(n)),n}function be(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function xe(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function Se(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var T=e((()=>{}));function Ce(){N.clear()}async function E(e){let t=h(e??c()),n=N.get(t);if(n!==void 0)return n;let r=V(t);if(!r)return N.set(t,null),null;let i=m(r,`.git`);try{if((await me(i)).isFile()){let e=(await x(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=h(r,e.slice(7).trim());return N.set(t,n),n}}return N.set(t,i),i}catch{return N.set(t,null),null}}function D(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function O(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function k(e){try{let t=(await x(m(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return D(e)?{type:`branch`,name:e}:null}if(!D(n))return null;let r=await A(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return O(t)?{type:`detached`,sha:t}:null}catch{return null}}async function A(e,t){let n=await j(e,t);if(n)return n;let r=await M(e);return r&&r!==e?j(r,t):null}async function j(e,t){try{let n=(await x(m(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return D(t)?A(e,t):null}return O(n)?n:null}catch{}try{let n=await x(m(e,`packed-refs`),`utf-8`);for(let e of n.split(`
4
- `)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return O(t)?t:null}}}catch{}return null}async function M(e){try{return h(e,(await x(m(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function we(e,t,n){try{let r=(await x(m(e,t),`utf-8`)).trim();if(r.startsWith(`ref:`)){let e=r.slice(4).trim();if(e.startsWith(n)){let t=e.slice(n.length);return D(t)?t:null}}}catch{}return null}async function Te(){let e=await E();if(!e)return`HEAD`;let t=await k(e);return t&&t.type===`branch`?t.name:`HEAD`}async function Ee(){let e=await E();if(!e)return null;let t=await w(e,`remote`,`origin`,`url`);if(t)return t;let n=await M(e);return n&&n!==e?w(n,`remote`,`origin`,`url`):null}async function De(){let e=await E();if(!e)return`main`;let t=await M(e)??e,n=await we(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await A(t,`refs/remotes/origin/${e}`))return e;return`main`}function Oe(){return I.get(`branch`,Te)}function ke(){return I.get(`remoteUrl`,Ee)}function Ae(){return I.get(`defaultBranch`,De)}async function je(e){let t=await E(e);if(!t)return null;let n=await k(t);return n?n.type===`branch`?A(t,`refs/heads/${n.name}`):n.sha:null}async function Me(e){let t;try{let n=(await x(m(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=h(e,n.slice(7).trim())}catch{return null}let n=await k(t);return n?n.type===`branch`?A(t,`refs/heads/${n.name}`):n.sha:null}async function Ne(e){let t=await E(e);if(!t)return null;let n=await w(t,`remote`,`origin`,`url`);if(n)return n;let r=await M(t);return r&&r!==t?w(r,`remote`,`origin`,`url`):null}async function Pe(){try{let e=await E();return e?(await pe(m(await M(e)??e,`worktrees`))).length+1:0}catch{return 1}}var N,P,F,I,L=e((()=>{a(),re(),s(),Ve(),T(),r(),N=new Map,P=1e3,F=class{constructor(){i(this,`gitDir`,null),i(this,`commonDir`,null),i(this,`initialized`,!1),i(this,`initPromise`,null),i(this,`watchedPaths`,[]),i(this,`branchRefPath`,null),i(this,`cache`,new Map)}async ensureStarted(){if(!this.initialized)return this.initPromise||(this.initPromise=this.start()),this.initPromise}async start(){this.gitDir=await E(),this.initialized=!0,this.gitDir&&(this.commonDir=await M(this.gitDir),this.watchPath(m(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(m(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),ne(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),de(e,{interval:P},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await k(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?m(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(b(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter(e=>e!==this.branchRefPath)),this.branchRefPath=n,n&&this.watchPath(n,()=>{this.invalidate()}))}async onHeadChanged(){this.invalidate(),await o(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)b(e);this.watchedPaths=[],this.branchRefPath=null}async get(e,t){await this.ensureStarted();let n=this.cache.get(e);if(n&&!n.dirty)return n.value;n&&(n.dirty=!1);let r=await t(),i=this.cache.get(e);return i&&!i.dirty&&(i.value=r),i||this.cache.set(e,{value:r,dirty:!1,compute:t}),r}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}},I=new F}));function Fe(){function e(e){let t=B(e);return t===z?null:t}return e.cache=B.cache,e}function Ie(){function e(e){let t=V(e);return t?H(t):null}return e.cache=H.cache,e}function Le(e){return E(e)}function R(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n?.[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r?.[1]&&r[2]){let e=r[1],t=r[2];if(ze(e)&&t.startsWith(`git/`)){let e=t.slice(4),n=e.split(`/`);return n.length>=3&&n[0].includes(`.`)?e.toLowerCase():`github.com/${e}`.toLowerCase()}return`${e}/${t}`.toLowerCase()}return null}async function Re(){let e=await Y();if(!e)return null;let t=R(e);return t?fe(`sha256`).update(t).digest(`hex`).substring(0,16):null}function ze(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Be(){let e=u(),t=c(),n=m(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=m(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(m(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(m(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(m(t,`refs`)).isDirectory())return!0}catch{}return!1}var z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q,$,Ve=e((()=>{n(),s(),te(),C(),ae(),l(),L(),oe(),se(),le(),z=Symbol(`git-root-not-found`),B=f(e=>{let t=Date.now();S(`info`,`find_git_root_started`);let n=h(e),r=n.substring(0,n.indexOf(g)+1)||g,i=0;for(;n!==r;){try{let e=m(n,`.git`);i++;let r=y(e);if(r.isDirectory()||r.isFile())return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=p(n);if(e===n)break;n=e}try{let e=m(r,`.git`);i++;let n=y(e);if(n.isDirectory()||n.isFile())return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return S(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),z},e=>e,50),V=Fe(),H=f(e=>{try{let t=_(m(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=h(e,t.slice(7).trim()),r=h(n,_(m(n,`commondir`),`utf-8`).trim());return h(p(n))!==m(r,`worktrees`)||v(_(m(n,`gitdir`),`utf-8`).trim())!==m(v(e),`.git`)?e:ue(r)===`.git`?p(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),U=Ie(),W=t(()=>ce(`git`)||`git`),G=t(async()=>{let e=Date.now();S(`info`,`is_git_check_started`);let t=V(c())!==null;return S(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),K=async e=>V(e)!==null,q=async()=>Oe(),J=async()=>Ae(),Y=async()=>ke(),X=async e=>{let t=[`--no-optional-locks`,`status`,`--porcelain`];e?.ignoreUntracked&&t.push(`-uno`);let{stdout:n}=await d(W(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await d(W(),[`--no-optional-locks`,`status`,`--porcelain`],{preserveOutputOnError:!1}),t=[],n=[];return e.trim().split(`
5
- `).filter(e=>e.length>0).forEach(e=>{let r=e.substring(0,2),i=e.substring(2).trim();r===`??`?n.push(i):i&&t.push(i)}),{tracked:t,untracked:n}},Q=async()=>Pe(),$=async e=>{try{let t=e||`Work Mate auto-stash - ${new Date().toISOString()}`,{untracked:n}=await Z();if(n.length>0){let{code:e}=await d(W(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await d(W(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{ge as A,Me as C,w as D,T as E,C as O,L as S,A as T,$ as _,J as a,je as b,X as c,Re as d,Q as f,R as g,Be as h,q as i,S as k,G as l,Ve as m,U as n,Z as o,W as p,V as r,Le as s,K as t,Y as u,Ce as v,E as w,Ne as x,M as y};
@@ -1 +0,0 @@
1
- import{a as e,i as t,m as n,r,u as i}from"./git-By_J4XJL.js";n();export{r as findGitRoot,t as getBranch,e as getDefaultBranch,i as getRemoteUrl};
@@ -1 +0,0 @@
1
- import{$ as e,Ut as t}from"./state-D5D6QpTX.js";import{c as n,i as r}from"./debug-D58GQBDG.js";import{Cn as i,On as a}from"./settings-3xZ0fsvE.js";import{c as o,h as s,y as c}from"./config-DRy1I12M.js";import{S as l,m as u,r as d,x as f}from"./git-By_J4XJL.js";import{a as p,i as m,n as h}from"./detectRepository-CDOJ-M7h.js";import{realpath as g}from"fs/promises";t(),s(),r(),m(),i(),l(),u();async function _(){try{let t=await h();if(!t){n(`Not in a GitHub repository, skipping path mapping update`);return}let r=e(),i=d(r)??r,a;try{a=(await g(i)).normalize(`NFC`)}catch{a=i}let s=t.toLowerCase(),l=o().githubRepoPaths?.[s]??[];if(l[0]===a){n(`Path ${a} already tracked for repo ${s}`);return}let u=l.filter(e=>e!==a),f=[a,...u];c(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[s]:f}})),n(`Added ${a} to tracked paths for repo ${s}`)}catch(e){n(`Error updating repo path mapping: ${e}`)}}function v(e){let t=o(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(a));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await f(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let r=o(),i=e.toLowerCase(),a=r.githubRepoPaths?.[i]??[],s=a.filter(e=>e!==t);if(s.length===a.length)return;let l={...r.githubRepoPaths};s.length===0?delete l[i]:l[i]=s,c(e=>({...e,githubRepoPaths:l})),n(`Removed ${t} from tracked paths for repo ${i}`)}export{b as a,_ as i,v as n,x as r,y as t};
@@ -1,3 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Cl as n,Dl as r,El as i,Ml as a,Nl as o,Pl as s,Qu as c,Sl as l,Tl as u,Zu as d,bl as f,cy as p,kl as m,ry as h,wl as g,xl as _,yl as v}from"./loadAgentsDir-DaNpxaO-.js";import{I as y,P as b,t as x}from"./src-DL3w8VPk2.js";import{t as S}from"./jsx-runtime-Bb4Xn-E0.js";import{n as C,t as w}from"./PermissionDialog-BPhvs5xH.js";function T({currentGoal:e,newObjective:t,onConfirm:n,onCancel:r}){function a(e){e===`yes`?n():r()}let o=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,E.jsx)(w,{color:`warning`,title:`Replace active goal?`,children:(0,E.jsxs)(y,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,E.jsx)(b,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,E.jsxs)(y,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(b,{dimColor:!0,children:`Current goal:`}),(0,E.jsxs)(b,{children:[(0,E.jsx)(b,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,E.jsxs)(b,{children:[(0,E.jsx)(b,{dimColor:!0,children:`· Status: `}),i(e.status)]}),(0,E.jsxs)(b,{children:[(0,E.jsx)(b,{dimColor:!0,children:`· Time: `}),u(e)]}),(0,E.jsxs)(b,{children:[(0,E.jsx)(b,{dimColor:!0,children:`· Tokens: `}),o]})]}),(0,E.jsxs)(y,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(b,{dimColor:!0,children:`New objective:`}),(0,E.jsx)(b,{children:t})]}),(0,E.jsx)(y,{marginTop:1,children:(0,E.jsx)(c,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:a,onCancel:r})})]})})}var E,D=e((()=>{x(),d(),C(),t(),E=S()}));function O(e){let t=e.split(`
2
- `)[0]??e;return t.length<=F?t:`${t.slice(0,F)}…`}function k(){p(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function A(){let e=r();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${i(e.status)}`,`Time: ${u(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
3
- `)}function j(e){return s(e),m(),f(),`Goal set.`}async function M(e,t,i){let s=i.trim();if(!s||s.toLowerCase()===`status`)return e(A(),{display:`system`}),null;let c=s.toLowerCase();if(c===`clear`){let t=l();return t&&(_(),k()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(c===`pause`){let t=a();return t&&(f(),k()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(c===`resume`){if(r()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=o();return t&&f(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(c===`continue`){let t=g();return t&&f(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(c===`complete`){let t=n();return t&&(f(),k()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(s.length>P)return e(`Goal objective is too long (${s.length} chars; limit ${P}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let u=r();return u&&u.status!==`complete`?(0,N.jsx)(T,{currentGoal:u,newObjective:s,onConfirm:()=>{k(),e(j(s),{display:`system`,shouldQuery:!0,displayArgs:O(s),metaMessages:[`<goal-objective-updated>\n${s}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(j(s),{display:`system`,shouldQuery:!0,displayArgs:O(s),metaMessages:[`<goal-objective-updated>\n${s}\n</goal-objective-updated>`]}),null)}var N,P,F;e((()=>{t(),v(),h(),D(),N=S(),P=4e3,F=80}))();export{M as call};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ka as t,La as n,Ny as r,Wa as i,it as a,ky as o,pa as s,tt as c}from"./loadAgentsDir-DaNpxaO-.js";import{c as l,i as u}from"./debug-D58GQBDG.js";import{F as d,R as f}from"./model-Do0f476p.js";import{E as p,O as m,T as h,Y as g,j as _,k as v}from"./sessionState-CQhbGfmh.js";import{n as y,t as b}from"./client-9uHzAmFH.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,n,r,c,u){try{let s=g(u.model),f=t(e,r),h=(await Promise.all(r.map(e=>a(e,{getToolPermissionContext:u.getToolPermissionContext,tools:r,agents:u.agents,allowedAgentTypes:u.allowedAgentTypes,model:u.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=_(f,n),S=v(h),w=m(u.toolChoice),T=b({maxRetries:0,fetchOverride:u.fetchOverride,source:u.querySource});l(`[Grok] Calling model=${s}, messages=${y.length}, tools=${S.length}`);let E=p(await T.chat.completions.create({model:s,messages:y,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...u.temperatureOverride!==void 0&&{temperature:u.temperatureOverride}},{signal:c}),s),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:i([t],r,u.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&o(d(s,k),k,u.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Grok] Error: ${t}`,{level:`error`}),yield s({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{y(),S(),h(),n(),c(),u(),r(),f()}))();export{w as queryModelGrok};
@@ -1,7 +0,0 @@
1
- import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{$d as i,Zd as a}from"./loadAgentsDir-DaNpxaO-.js";import{c as o,i as s}from"./debug-D58GQBDG.js";import{c,h as l,y as u}from"./config-DRy1I12M.js";import{a as d,n as f}from"./process-gEbdy6uY.js";import{d as p,f as m,o as h,s as g}from"./log-CZ7ploQm.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{l as y,u as b}from"./oauth-D38aRTUb.js";import{Bt as x,Pt as S,Tt as C,Xn as w,Yn as T,Zn as E,qn as D}from"./model-Do0f476p.js";import{n as O,t as k}from"./userAgent-i-oGzf40.js";r(),t(),_(),S(),s(),i(),p(),f(),b(),l(),w(),h(),O();var A=1440*60*1e3,j=e(async()=>{if(m())return{success:!1};try{return{success:!0,data:(await E(()=>{let e=D();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.get(`${y().BASE_API_URL}/api/oauth/account/settings`,{headers:{...e.headers,"User-Agent":k()}})})).data}}catch(e){return g(e),j.cache.clear?.(),{success:!1}}});async function M(){try{await E(()=>{let e=D();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.post(`${y().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...e.headers,"User-Agent":k()}})}),j.cache.clear?.()}catch(e){g(e)}}async function N(e){try{await E(()=>{let t=D();if(t.error)throw Error(`Failed to get auth headers: ${t.error}`);return n.patch(`${y().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:e},{headers:{...t.headers,"User-Agent":k()}})}),j.cache.clear?.()}catch(e){g(e)}}async function P(){if(!x())return!1;let e=C()?.accountUuid;if(!e)return!1;let t=c().groveConfigCache?.[e];return t?Date.now()-t.timestamp>A?(o(`Grove: Cache stale, returning cached data and refreshing in background`),F(e),t.grove_enabled):(o(`Grove: Using fresh cached config`),t.grove_enabled):(o(`Grove: No cache, fetching config in background (dialog skipped this session)`),F(e),!1)}async function F(e){try{let t=await I();if(!t.success)return;let n=t.data.grove_enabled,r=c().groveConfigCache?.[e];if(r?.grove_enabled===n&&Date.now()-r.timestamp<=A)return;u(t=>({...t,groveConfigCache:{...t.groveConfigCache,[e]:{grove_enabled:n,timestamp:Date.now()}}}))}catch(e){o(`Grove: Failed to fetch and store config: ${e}`)}}var I=e(async()=>{if(m())return{success:!1};try{let{grove_enabled:e,domain_excluded:t,notice_is_grace_period:r,notice_reminder_frequency:i}=(await E(()=>{let e=D();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return n.get(`${y().BASE_API_URL}/api/claude_code_grove`,{headers:{...e.headers,"User-Agent":T()},timeout:3e3})})).data;return{success:!0,data:{grove_enabled:e,domain_excluded:t??!1,notice_is_grace_period:r??!0,notice_reminder_frequency:i}}}catch(e){return o(`Failed to fetch Grove notice config: ${e}`),{success:!1}}});function L(e,t,n){if(!e.success||!t.success)return!1;let r=e.data,i=t.data;if(r.grove_enabled!==null)return!1;if(n||!i.notice_is_grace_period)return!0;let a=i.notice_reminder_frequency;return a!==null&&r.grove_notice_viewed_at?Math.floor((Date.now()-new Date(r.grove_notice_viewed_at).getTime())/(1e3*60*60*24))>=a:r.grove_notice_viewed_at==null}async function R(){let[e,t]=await Promise.all([j(),I()]);if(L(e,t,!1)){let e=t.success?t.data:null;v(`tengu_grove_print_viewed`,{dismissable:e?.notice_is_grace_period}),e===null||e.notice_is_grace_period?(d(`
2
- An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms.
3
-
4
- `),await M()):(d(`
5
- [ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run \`claude\` to review the updated terms.
6
-
7
- `),await a(1))}}export{P as a,j as i,R as n,M as o,I as r,N as s,L as t};
@@ -1 +0,0 @@
1
- import{i as e,n as t}from"./rolldown-runtime-DaDcL9Zw.js";function n(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}function r(t){return typeof Bun<`u`?Bun.hash(t).toString():e(`crypto`).createHash(`sha256`).update(t).digest(`hex`)}function i(t,n){return typeof Bun<`u`?Bun.hash(n,Bun.hash(t)).toString():e(`crypto`).createHash(`sha256`).update(t).update(`\0`).update(n).digest(`hex`)}var a=t((()=>{}));export{a as i,r as n,i as r,n as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$u as n,Ai as r,Li as i,Qu as a,Ti as o,dC as s,fC as c,gC as l,uC as u}from"./loadAgentsDir-DaNpxaO-.js";import{I as d,Lt as f,P as p,Wt as m,a as h,ai as g,n as _,ot as v,r as y,t as b,x}from"./src-DL3w8VPk2.js";import{t as S}from"./jsx-runtime-Bb4Xn-E0.js";import{b as C,y as w}from"./startupProfiler-CbzxVmbv.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-Bw0mlTT9.js";import{n as D,r as O}from"./modalContext-wY9CeN4G.js";import{n as k,t as A}from"./PromptInputHelpMenu-DG2lRqis.js";function j({commands:e,maxHeight:t,columns:n,title:i,onCancel:o,emptyMessage:s}){let{headerFocused:c,focusHeader:l}=h(),u=Math.max(1,n-10),f=Math.max(1,Math.floor((t-10)/2)),m=(0,M.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:C(r(e),u,!0)}))},[e,u]);return(0,N.jsx)(d,{flexDirection:`column`,paddingY:1,children:e.length===0&&s?(0,N.jsx)(p,{dimColor:!0,children:s}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(p,{children:i}),(0,N.jsx)(d,{marginTop:1,children:(0,N.jsx)(a,{options:m,visibleOptionCount:f,onCancel:o,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:l,isDisabled:c})})]})})}var M,N,P=e((()=>{M=t(g(),1),i(),w(),b(),n(),N=S()}));function F(){return(0,I.jsxs)(d,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(p,{bold:!0,children:`Getting started`}),(0,I.jsxs)(d,{flexDirection:`column`,children:[(0,I.jsxs)(p,{children:[(0,I.jsx)(p,{bold:!0,children:`1. `}),(0,I.jsx)(p,{children:`Ask a question or describe a task — Work Mate will explore your code and respond.`})]}),(0,I.jsxs)(p,{children:[(0,I.jsx)(p,{bold:!0,children:`2. `}),(0,I.jsx)(p,{children:`When Work Mate wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(p,{children:[(0,I.jsx)(p,{bold:!0,children:`3. `}),(0,I.jsx)(p,{children:`Type `}),(0,I.jsx)(p,{bold:!0,children:`/help`}),(0,I.jsx)(p,{children:` for commands, or `}),(0,I.jsx)(p,{bold:!0,children:`?`}),(0,I.jsx)(p,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(d,{flexDirection:`column`,children:[(0,I.jsx)(d,{children:(0,I.jsx)(p,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{b(),k(),I=S()}));function R({onClose:e,commands:t}){let{rows:n,columns:r}=v(),i=Math.floor(n/2),a=O(),s=()=>e(`Help dialog dismissed`,{display:`system`});m(`help:dismiss`,s,{context:`Help`});let l=T(s),u=c(`help:dismiss`,`Help`,`esc`),h=o(),g=t.filter(e=>h.has(e.name)&&!e.isHidden),b=t.filter(e=>!h.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(_,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(_,{title:`commands`,children:(0,z.jsx)(j,{commands:g,maxHeight:i,columns:r,title:`Browse default commands:`,onCancel:s})},`commands`)),S.push((0,z.jsx)(_,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:b,maxHeight:i,columns:r,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:s})},`custom`)),(0,z.jsx)(d,{flexDirection:`column`,height:a?void 0:i,children:(0,z.jsxs)(x,{color:`professionalBlue`,children:[(0,z.jsx)(y,{title:`Work Mate v0.0.20`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(d,{marginTop:1,children:(0,z.jsxs)(p,{children:[`For more help: `,(0,z.jsx)(f,{url:`https://code.workmate.com/docs/en/overview`})]})}),(0,z.jsx)(d,{marginTop:1,children:(0,z.jsx)(p,{dimColor:!0,children:l.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,l.keyName,` again to exit`]}):(0,z.jsxs)(p,{italic:!0,children:[u,` to cancel`]})})})]})})}var z,B=e((()=>{E(),s(),i(),D(),l(),b(),u(),P(),L(),z=S()})),V,H;e((()=>{B(),V=S(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
@@ -1 +0,0 @@
1
- import{hn as e,mn as t,qt as n,sn as r}from"./loadAgentsDir-DaNpxaO-.js";e();export{n as executeSessionEndHooks,r as getSessionEndHookTimeoutMs,t as hasWorktreeCreateHook};