@readmagic/workmate 0.0.1

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 (552) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-BSLHrjbt.js +1 -0
  2. package/dist/chunks/App-DY5O6IKw.js +1 -0
  3. package/dist/chunks/ApproveApiKey-BEzfC6r3.js +1 -0
  4. package/dist/chunks/ApproveApiKey-DfAPwDix.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-Ce3PraaD.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-Dvhcgahe.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-B68V1bCq.js +1 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-CTWhpIm8.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +1 -0
  11. package/dist/chunks/DesktopHandoff-BRbU4is4.js +1 -0
  12. package/dist/chunks/Dialog-vfLXEPed.js +1 -0
  13. package/dist/chunks/DiffDialog-CBluIK-x.js +6 -0
  14. package/dist/chunks/Doctor-B0CRtxi2.js +1 -0
  15. package/dist/chunks/Doctor-WxNv49HC.js +3 -0
  16. package/dist/chunks/ExitFlow-CRPgptCN.js +2 -0
  17. package/dist/chunks/Feedback-CEtzaLr3.js +2 -0
  18. package/dist/chunks/Grove--kttLxvs.js +11 -0
  19. package/dist/chunks/Grove-CelgLWH4.js +1 -0
  20. package/dist/chunks/HybridTransport-BgV5_7Az.js +4 -0
  21. package/dist/chunks/InvalidConfigDialog-DCGwXW_p.js +1 -0
  22. package/dist/chunks/InvalidSettingsDialog-jTwsdXWr.js +1 -0
  23. package/dist/chunks/ListItem-vfLXEPed.js +1 -0
  24. package/dist/chunks/MCPConnectionManager-BX0LMz9J.js +1 -0
  25. package/dist/chunks/McpParsingWarnings-WQrWJeWP.js +1 -0
  26. package/dist/chunks/MessageSelector-_UZB8cGb.js +3 -0
  27. package/dist/chunks/Messages-jCoW_1Rr.js +11 -0
  28. package/dist/chunks/Onboarding-BoIVNCgc.js +1 -0
  29. package/dist/chunks/OverageCreditUpsell-1FCN8bH3.js +1 -0
  30. package/dist/chunks/PermissionDialog-0ya1CU5k.js +1 -0
  31. package/dist/chunks/PluginSettings-BD9JLV9-.js +17 -0
  32. package/dist/chunks/PressEnterToContinue-Dl9Hg9Mf.js +1 -0
  33. package/dist/chunks/PromptInputFooterSuggestions-CrGST0Cq.js +1 -0
  34. package/dist/chunks/PromptInputHelpMenu-B2TDpbpw.js +1 -0
  35. package/dist/chunks/QueryEngine-D2HUnwmU.js +1 -0
  36. package/dist/chunks/REPL-BV4WyYMg.js +142 -0
  37. package/dist/chunks/REPL-DcpN3MRC.js +1 -0
  38. package/dist/chunks/RemoteCallout-DS_EV6Fh.js +1 -0
  39. package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +2 -0
  40. package/dist/chunks/ResumeConversation-Cw3vP4G8.js +1 -0
  41. package/dist/chunks/SSETransport-BXiEBMpb.js +4 -0
  42. package/dist/chunks/SearchBox-vfLXEPed.js +1 -0
  43. package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +1 -0
  44. package/dist/chunks/Settings-ns6mRsDc.js +2 -0
  45. package/dist/chunks/TeleportProgress-CcDzMC5L.js +1 -0
  46. package/dist/chunks/TeleportRepoMismatchDialog-DZbxl4sD.js +1 -0
  47. package/dist/chunks/TeleportResumeWrapper-EowJO5nm.js +1 -0
  48. package/dist/chunks/ThemePicker-BYbChJpu.js +1 -0
  49. package/dist/chunks/TrustDialog-DA3YTk_k.js +1 -0
  50. package/dist/chunks/TungstenTool-Cb7gJvq4.js +1 -0
  51. package/dist/chunks/TungstenTool-CxMQVCuF.js +1 -0
  52. package/dist/chunks/ValidationErrorsList-Cx-hoRwG.js +2 -0
  53. package/dist/chunks/WelcomeV2-BTfttGcv.js +1 -0
  54. package/dist/chunks/add-dir-CWt69NAZ.js +1 -0
  55. package/dist/chunks/agentDisplay-CQ4mZWFH.js +1 -0
  56. package/dist/chunks/agents-C6jzKOit.js +2 -0
  57. package/dist/chunks/agents-D4clhuCl.js +103 -0
  58. package/dist/chunks/ajv-5vMo9UcX.js +8 -0
  59. package/dist/chunks/allErrors-HMPqE0jK.js +1 -0
  60. package/dist/chunks/analytics-BotDBGh0.js +1 -0
  61. package/dist/chunks/ant-9Z5bppVC.js +1 -0
  62. package/dist/chunks/api-L2IgleTV.js +1 -0
  63. package/dist/chunks/api-TgV7fl9V.js +1 -0
  64. package/dist/chunks/asciicast-DYbkzGCN.js +1 -0
  65. package/dist/chunks/asciicast-n-BBfgDq.js +4 -0
  66. package/dist/chunks/assistant-BA9_Mo9U.js +1 -0
  67. package/dist/chunks/assistant-BiNOSla3.js +1 -0
  68. package/dist/chunks/assistant-YvbVKjVh.js +1 -0
  69. package/dist/chunks/attributionHooks-CUAoGkU6.js +1 -0
  70. package/dist/chunks/attributionTrailer-oKKrF3z8.js +1 -0
  71. package/dist/chunks/auth-CEig4Gxp.js +1 -0
  72. package/dist/chunks/auth-CbGDlhyO.js +1 -0
  73. package/dist/chunks/auth-DHyCIxCk.js +15 -0
  74. package/dist/chunks/autoMode-Db4QrgFr.js +45 -0
  75. package/dist/chunks/autoModeDenials-BxNzGJdR.js +1 -0
  76. package/dist/chunks/autonomy-BkAMA7du.js +1 -0
  77. package/dist/chunks/autonomy-D4Vy-RPQ.js +15 -0
  78. package/dist/chunks/autonomyPanel-EjfO8jvg.js +1 -0
  79. package/dist/chunks/axios-BHBm_hhU.js +1 -0
  80. package/dist/chunks/axios-DaWTGg7G.js +16 -0
  81. package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +1 -0
  82. package/dist/chunks/backgroundHousekeeping-hDDE8mJC.js +17 -0
  83. package/dist/chunks/banner-hD6wZygx.js +2 -0
  84. package/dist/chunks/base64-js-0wLHn8zB.js +1 -0
  85. package/dist/chunks/bedrockClient-DxE_mHFI.js +15 -0
  86. package/dist/chunks/bg-BzG63WOm.js +1 -0
  87. package/dist/chunks/bg-DQ0Q3Qv-.js +9 -0
  88. package/dist/chunks/branch-CeQ9IyZk.js +3 -0
  89. package/dist/chunks/break-cache-Bd0clV2N.js +8 -0
  90. package/dist/chunks/bridge-yerAiaK2.js +2 -0
  91. package/dist/chunks/bridgeConfig-CCtXe8ak.js +1 -0
  92. package/dist/chunks/bridgeConfig-D5dB38xD.js +1 -0
  93. package/dist/chunks/bridgeEnabled--F-6TUi4.js +1 -0
  94. package/dist/chunks/bridgeEnabled-DKX8-T_H.js +1 -0
  95. package/dist/chunks/bridgeMain--R1HFbOv.js +68 -0
  96. package/dist/chunks/bridgeMain-d06JByZn.js +1 -0
  97. package/dist/chunks/bridgeMessaging-CqbLTDcx.js +1 -0
  98. package/dist/chunks/bridgePointer-W_jdQ8zf.js +1 -0
  99. package/dist/chunks/browser-Bd7GeBH1.js +1 -0
  100. package/dist/chunks/btw-CVGRmL9a.js +1 -0
  101. package/dist/chunks/bundledMode--fG1S62b.js +1 -0
  102. package/dist/chunks/caches-BtmAri4e.js +3 -0
  103. package/dist/chunks/caches-BuTIAOtY.js +1 -0
  104. package/dist/chunks/capacityWake-CV_x9H8j.js +1 -0
  105. package/dist/chunks/ccrClient-HqMi5Kfu.js +1 -0
  106. package/dist/chunks/checksum-DgbnMdM-.js +1 -0
  107. package/dist/chunks/classPrivateFieldSet2-D4U5K-I3.js +1 -0
  108. package/dist/chunks/classPrivateMethodInitSpec-BXQD0Vh4.js +1 -0
  109. package/dist/chunks/claudeDesktop-aUMx06RK.js +1 -0
  110. package/dist/chunks/clear-C6nRzIQE.js +1 -0
  111. package/dist/chunks/cliLaunch-2AUoMnqx.js +1 -0
  112. package/dist/chunks/client-BeET1hnC.js +1 -0
  113. package/dist/chunks/client-DchQnIJD.js +36 -0
  114. package/dist/chunks/client-DvAL7lY8.js +8 -0
  115. package/dist/chunks/color-DXI_4ibU.js +1 -0
  116. package/dist/chunks/color-convert-p91EwGT7.js +1 -0
  117. package/dist/chunks/commands-VjcG4qFq.js +1 -0
  118. package/dist/chunks/commitAttribution-Cm40fdNU.js +2 -0
  119. package/dist/chunks/commitAttribution-Lb3qUlAR.js +1 -0
  120. package/dist/chunks/compact-DPTVpJ4D.js +2 -0
  121. package/dist/chunks/completionCache-BQaLkB4d.js +4 -0
  122. package/dist/chunks/completionCache-CW8lKIgy.js +1 -0
  123. package/dist/chunks/config-0cRberzR.js +1 -0
  124. package/dist/chunks/config-BSXLgwpD.js +1 -0
  125. package/dist/chunks/config-BrxKpHpR.js +1 -0
  126. package/dist/chunks/config-C7YHKCPV.js +3 -0
  127. package/dist/chunks/config-CLmFk-5V.js +1 -0
  128. package/dist/chunks/connectHeadless-CqRoEtrg.js +1 -0
  129. package/dist/chunks/context-C_cKrBUn.js +1 -0
  130. package/dist/chunks/context-noninteractive-DnH6Q9Lu.js +54 -0
  131. package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +1 -0
  132. package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +1 -0
  133. package/dist/chunks/conversation-GJxfkr6M.js +1 -0
  134. package/dist/chunks/conversation-oK3aFzqO.js +1 -0
  135. package/dist/chunks/createSSHSession--bWmmIk9.js +6 -0
  136. package/dist/chunks/createSession-DIr4sUp6.js +1 -0
  137. package/dist/chunks/createSession-DM4acqaC.js +1 -0
  138. package/dist/chunks/cron-3LntnnhJ.js +1 -0
  139. package/dist/chunks/crossProjectResume-DKrtjTpm.js +40 -0
  140. package/dist/chunks/cwd-BuJhkTrc.js +1 -0
  141. package/dist/chunks/cwd-D-tY2NKc.js +1 -0
  142. package/dist/chunks/daemon-B9lBPdBJ.js +2 -0
  143. package/dist/chunks/dangerousBackend-DwcP0P08.js +1 -0
  144. package/dist/chunks/datadog-ByS7LGGa.js +1 -0
  145. package/dist/chunks/datadog-DNCsyfSO.js +1 -0
  146. package/dist/chunks/debug-DzZUT2Wv.js +1 -0
  147. package/dist/chunks/debug-IKW-jE7K.js +39 -0
  148. package/dist/chunks/debugUtils-D2981c0Z.js +1 -0
  149. package/dist/chunks/defineProperty-C-QyHrDq.js +1 -0
  150. package/dist/chunks/desktop-B5cvrcOQ.js +1 -0
  151. package/dist/chunks/detached-rfIUyc-B.js +5 -0
  152. package/dist/chunks/detect-libc-CxbBtWJu.js +1 -0
  153. package/dist/chunks/detectRepository-6nw-Aw3v.js +1 -0
  154. package/dist/chunks/detectRepository-ReZ0Fz8Z.js +1 -0
  155. package/dist/chunks/diff-cXAp9cNN.js +1 -0
  156. package/dist/chunks/directoryCompletion-DBM2o5kx.js +1 -0
  157. package/dist/chunks/dist-CXlEpGqr.js +20 -0
  158. package/dist/chunks/dist-DESLAofA.js +1 -0
  159. package/dist/chunks/dist-DIee4wq1.js +29 -0
  160. package/dist/chunks/dist-Dopnn8wS.js +5 -0
  161. package/dist/chunks/dist-es-5t7v8oaj.js +1 -0
  162. package/dist/chunks/dist-es-BF6bR-Ik.js +2 -0
  163. package/dist/chunks/dist-es-BIjDeceU.js +1 -0
  164. package/dist/chunks/dist-es-BOPBJQo3.js +1 -0
  165. package/dist/chunks/dist-es-Bfr4TzQe.js +3 -0
  166. package/dist/chunks/dist-es-Byxccz_-.js +1 -0
  167. package/dist/chunks/dist-es-C-OjW2Ao.js +1 -0
  168. package/dist/chunks/dist-es-C3reqy7X.js +1 -0
  169. package/dist/chunks/dist-es-C7vygWzp.js +1 -0
  170. package/dist/chunks/dist-es-CEk66gUu.js +1 -0
  171. package/dist/chunks/dist-es-CIULjvtA2.js +1 -0
  172. package/dist/chunks/dist-es-CMtO44xC.js +1 -0
  173. package/dist/chunks/dist-es-CQMt6zRM.js +1 -0
  174. package/dist/chunks/dist-es-CYPVg66r.js +9 -0
  175. package/dist/chunks/dist-es-Cd_AeqMK.js +6 -0
  176. package/dist/chunks/dist-es-Cgsa8pb82.js +1 -0
  177. package/dist/chunks/dist-es-Cwru7c2B2.js +1 -0
  178. package/dist/chunks/dist-es-D1Y8zSMI.js +1 -0
  179. package/dist/chunks/dist-es-D1wHe_zh.js +1 -0
  180. package/dist/chunks/dist-es-DKFm0FJ7.js +1 -0
  181. package/dist/chunks/dist-es-DKIwwJME.js +1 -0
  182. package/dist/chunks/dist-es-DNFTCbrP.js +1 -0
  183. package/dist/chunks/dist-es-DXIR5NLi2.js +1 -0
  184. package/dist/chunks/dist-es-DelBIxNM.js +1 -0
  185. package/dist/chunks/dist-es-DmdZmEJ-.js +1 -0
  186. package/dist/chunks/dist-es-Gt_DpXlP.js +1 -0
  187. package/dist/chunks/dist-es-gUzZ_7Vf.js +1 -0
  188. package/dist/chunks/dist-es-kj-F5A132.js +1 -0
  189. package/dist/chunks/dist-es-yHGBqhBe.js +1 -0
  190. package/dist/chunks/doctor-CTMHXZvQ.js +1 -0
  191. package/dist/chunks/earlyInput-BTC_Wucv.js +2 -0
  192. package/dist/chunks/earlyInput-xcoTbKQn.js +1 -0
  193. package/dist/chunks/effort-Br8KKHdx.js +9 -0
  194. package/dist/chunks/entry-4lIRMrLI.js +14 -0
  195. package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +1 -0
  196. package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +1 -0
  197. package/dist/chunks/envUtils-DSxRz_kt.js +1 -0
  198. package/dist/chunks/esm-BYnFh4pG.js +1 -0
  199. package/dist/chunks/esm-Bx6rTxIs.js +1 -0
  200. package/dist/chunks/esm-C367Cyo-.js +1 -0
  201. package/dist/chunks/esm-C8Zkk1Ux.js +1 -0
  202. package/dist/chunks/esm-CGx9qY3q.js +56 -0
  203. package/dist/chunks/esm-CXM9jqO_.js +1 -0
  204. package/dist/chunks/esm-CXczu_-W.js +1 -0
  205. package/dist/chunks/esm-CXt5K8Xt.js +1 -0
  206. package/dist/chunks/esm-Cb-L4oAk.js +1 -0
  207. package/dist/chunks/esm-D6ZZCdtk.js +1 -0
  208. package/dist/chunks/esm-DhRjocaU.js +1 -0
  209. package/dist/chunks/esm-DklLYEuz.js +1 -0
  210. package/dist/chunks/esm-IYgGg4wR.js +1 -0
  211. package/dist/chunks/esm-lWlUmoUA.js +1 -0
  212. package/dist/chunks/esm-lyfry1WB.js +10 -0
  213. package/dist/chunks/esm-wGnzjq4Z.js +1 -0
  214. package/dist/chunks/event-streams-C0Zy0Uqv.js +1 -0
  215. package/dist/chunks/event-streams-DoqJmjFN.js +1 -0
  216. package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +1 -0
  217. package/dist/chunks/execAsync-Bv2yxuGe.js +1 -0
  218. package/dist/chunks/execFileNoThrow-COKYqVQj.js +34 -0
  219. package/dist/chunks/execSyncWrapper-DZJ3tNWF.js +1 -0
  220. package/dist/chunks/exit-BOhGfSlm.js +2 -0
  221. package/dist/chunks/exit-Z9oWrqE4.js +1 -0
  222. package/dist/chunks/extra-usage-BS4aVOt5.js +1 -0
  223. package/dist/chunks/extra-usage-DtAIhW74.js +1 -0
  224. package/dist/chunks/extra-usage-core-CdL1ltqq.js +1 -0
  225. package/dist/chunks/extra-usage-noninteractive-DxxRI0Yx.js +1 -0
  226. package/dist/chunks/extraUsage-BYZdi44Y.js +1 -0
  227. package/dist/chunks/extractMemories-C4f9JWuI.js +1 -0
  228. package/dist/chunks/fast-B0OB4x7K.js +1 -0
  229. package/dist/chunks/fast-DKqiojzf.js +1 -0
  230. package/dist/chunks/featureCheck-CrJeuheQ.js +1 -0
  231. package/dist/chunks/featureCheck-HslM03dr.js +1 -0
  232. package/dist/chunks/feedback-yB19xph5.js +1 -0
  233. package/dist/chunks/figures-5ThXQEtq.js +1 -0
  234. package/dist/chunks/file-D1cN3LMK.js +12 -0
  235. package/dist/chunks/fileStateCache-DDW5toIs.js +1 -0
  236. package/dist/chunks/files-DAzGtmzz.js +2 -0
  237. package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +1 -0
  238. package/dist/chunks/firstPartyEventLogger-hU-LPkje.js +5 -0
  239. package/dist/chunks/flushGate-ZFr8yv7F.js +1 -0
  240. package/dist/chunks/foundry-sdk-BdeF2aBu.js +1 -0
  241. package/dist/chunks/fpsMetrics-Cf_hdtiJ.js +1 -0
  242. package/dist/chunks/from-CgDRRLiX.js +4 -0
  243. package/dist/chunks/gemini-DqAv8_GY.js +1 -0
  244. package/dist/chunks/generateRecap-lO2PDlx8.js +1 -0
  245. package/dist/chunks/generateSessionName-48veu5dv.js +1 -0
  246. package/dist/chunks/genericProcessUtils-F1Qcb1sO.js +23 -0
  247. package/dist/chunks/getMachineId-bsd-Cut1kHoA.js +1 -0
  248. package/dist/chunks/getMachineId-darwin-CsRhaP3y.js +2 -0
  249. package/dist/chunks/getMachineId-linux-Bd7UBNRQ.js +1 -0
  250. package/dist/chunks/getMachineId-unsupported-vFGP8E_8.js +1 -0
  251. package/dist/chunks/getMachineId-win-DamF2CH_.js +1 -0
  252. package/dist/chunks/git-BE_FiJZp.js +1 -0
  253. package/dist/chunks/git-tyaWOgRL.js +6 -0
  254. package/dist/chunks/githubRepoPathMapping-BlR0BphY.js +1 -0
  255. package/dist/chunks/goal-Bn8Kz2Dp.js +3 -0
  256. package/dist/chunks/graceful-fs-DDVg0cja.js +2 -0
  257. package/dist/chunks/grok-DhnO_KDC.js +1 -0
  258. package/dist/chunks/grove-DotW04-v.js +7 -0
  259. package/dist/chunks/hash-Tu-My5Vp.js +1 -0
  260. package/dist/chunks/heapdump-DkZSKNbp.js +5 -0
  261. package/dist/chunks/help-DU_BcZtU.js +1 -0
  262. package/dist/chunks/hooks-BTMWE5Qx.js +79 -0
  263. package/dist/chunks/hooks-DONAb_nq.js +1 -0
  264. package/dist/chunks/hostGuard-Dh296c6q.js +1 -0
  265. package/dist/chunks/inboundAttachments-BcEgi49j.js +1 -0
  266. package/dist/chunks/inboundAttachments-DVs3_m48.js +1 -0
  267. package/dist/chunks/index.min-D75yiGLN.js +1 -0
  268. package/dist/chunks/initReplBridge-D0Xec8S-.js +1 -0
  269. package/dist/chunks/install-BkfXeXpv.js +1 -0
  270. package/dist/chunks/instinctParser-Dt-lqnDe.js +1 -0
  271. package/dist/chunks/instrumentation-H0XRS1yG.js +21 -0
  272. package/dist/chunks/intl-cKc-V6Mq.js +1 -0
  273. package/dist/chunks/isObject-C6qM3WEW.js +1 -0
  274. package/dist/chunks/isSymbol-BO6cdPI7.js +1 -0
  275. package/dist/chunks/job-DKtLkF8V.js +2 -0
  276. package/dist/chunks/json-bigint-bonnP-Hz.js +8 -0
  277. package/dist/chunks/jsx-runtime-Bb4Xn-E0.js +1 -0
  278. package/dist/chunks/jws-BscXOT9I.js +3 -0
  279. package/dist/chunks/jwtUtils-C-ojmb8W.js +1 -0
  280. package/dist/chunks/keybindings-ez51eHHp.js +2 -0
  281. package/dist/chunks/language-BuRSO2sR.js +1 -0
  282. package/dist/chunks/language-Da4KNbjm.js +1 -0
  283. package/dist/chunks/launchAgentsPlatform-BQyPdrHp.js +1 -0
  284. package/dist/chunks/launchCommand-1qkTCKpf.js +1 -0
  285. package/dist/chunks/launchLocalMemory-CWHAj7CX.js +3 -0
  286. package/dist/chunks/launchLocalVault-D8iJdtsP.js +3 -0
  287. package/dist/chunks/launchMemoryStores-W7jWG2uH.js +1 -0
  288. package/dist/chunks/launchOnboarding-q__LaLy1.js +8 -0
  289. package/dist/chunks/launchSchedule-BWi9F5vh.js +1 -0
  290. package/dist/chunks/launchSkillStore-4wd4MQBc.js +1 -0
  291. package/dist/chunks/launchTeleport-BlCf2QM_.js +3 -0
  292. package/dist/chunks/launchVault-C7u7LZV7.js +1 -0
  293. package/dist/chunks/lazySchema-uxlVVNM1.js +1 -0
  294. package/dist/chunks/lib-BSzUGQb_.js +2 -0
  295. package/dist/chunks/lib-BlVGipXx.js +14 -0
  296. package/dist/chunks/lib-rQZENxQg.js +8 -0
  297. package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +1 -0
  298. package/dist/chunks/loadAgentsDir-nzr38hai.js +3990 -0
  299. package/dist/chunks/loadPluginHooks-z1-zvBLw.js +1 -0
  300. package/dist/chunks/loadSso-DSxfVpgX.js +1 -0
  301. package/dist/chunks/localSearch-B-L_ldos.js +1 -0
  302. package/dist/chunks/localSearch-D-FprOMr.js +1 -0
  303. package/dist/chunks/lockfile-D5-j7HOZ.js +1 -0
  304. package/dist/chunks/log-B3eB4EFv.js +1 -0
  305. package/dist/chunks/logoV2Utils-RQ160dI2.js +1 -0
  306. package/dist/chunks/magicDocs-BqZ0GewA.js +57 -0
  307. package/dist/chunks/main-DeFMhaFE.js +31 -0
  308. package/dist/chunks/main-y7LJ5qUc.js +1243 -0
  309. package/dist/chunks/mappers-CWykjGfP.js +1 -0
  310. package/dist/chunks/mcp-CSFPAfaW.js +2 -0
  311. package/dist/chunks/mcp-DBwT4pa9.js +6 -0
  312. package/dist/chunks/mcp-DvZTaHZE.js +1 -0
  313. package/dist/chunks/memoize-BK3gG5ob.js +1 -0
  314. package/dist/chunks/memoize-BO31Ws9Q.js +1 -0
  315. package/dist/chunks/memory-DcpPpYN0.js +1 -0
  316. package/dist/chunks/metadata-BRLJvh61.js +1 -0
  317. package/dist/chunks/modalContext-DFjKLCB6.js +1 -0
  318. package/dist/chunks/mode-BkViT_0o.js +2 -0
  319. package/dist/chunks/model--z4Di9QO.js +1 -0
  320. package/dist/chunks/model-CZktWw6o.js +1 -0
  321. package/dist/chunks/model-DfFA3qMO.js +1 -0
  322. package/dist/chunks/multipart-parser-DDLYsngd.js +2 -0
  323. package/dist/chunks/nativeInstaller-GcIk7G2Y.js +1 -0
  324. package/dist/chunks/oauth-BqJqV-2M.js +1 -0
  325. package/dist/chunks/oauth-C8X_p8Gc.js +1 -0
  326. package/dist/chunks/observationStore-DzCdXq8U.js +4 -0
  327. package/dist/chunks/onChangeAppState-DwGVi-BC.js +1 -0
  328. package/dist/chunks/open-BtQHzzL9.js +1 -0
  329. package/dist/chunks/openai-B2wxZDQx.js +10 -0
  330. package/dist/chunks/openaiShared-G2-w4gJt.js +1 -0
  331. package/dist/chunks/output-style-BM3qAHLA.js +1 -0
  332. package/dist/chunks/overageCreditGrant-CjK49axw.js +1 -0
  333. package/dist/chunks/p-map-B1EeBuI8.js +1 -0
  334. package/dist/chunks/p-map-HKDr3iDo.js +1 -0
  335. package/dist/chunks/package-BC0bllK8.js +1 -0
  336. package/dist/chunks/panel-B-nrcHpm.js +1 -0
  337. package/dist/chunks/panel-R4ue6pSW.js +1 -0
  338. package/dist/chunks/panelCall-I_fbgub5.js +1 -0
  339. package/dist/chunks/parseConnectUrl-BiyKR5-x.js +1 -0
  340. package/dist/chunks/parser-BlM_Fk4J.js +1 -0
  341. package/dist/chunks/parser-CQrasoUB.js +1 -0
  342. package/dist/chunks/partition-CxRF7T-f.js +1 -0
  343. package/dist/chunks/passes-U_h-hNu-.js +1 -0
  344. package/dist/chunks/path-BCSE0S-c.js +1 -0
  345. package/dist/chunks/permissions-B8epy16o.js +3 -0
  346. package/dist/chunks/permissions-CeYKbtSC.js +1 -0
  347. package/dist/chunks/permissions-Cn_6f8CB.js +1 -0
  348. package/dist/chunks/pidLock-CBJDnBG_.js +3 -0
  349. package/dist/chunks/pipeTransport-D3Qx9v1V.js +1 -0
  350. package/dist/chunks/plan-BAhStVci.js +1 -0
  351. package/dist/chunks/platform-EtecGacO.js +2 -0
  352. package/dist/chunks/plist-Bzo2VMe9.js +6 -0
  353. package/dist/chunks/plugin-D9huNnv6.js +1 -0
  354. package/dist/chunks/pluginAutoupdate-BfmyxR5g.js +1 -0
  355. package/dist/chunks/pluginBlocklist-03sZaZa6.js +1 -0
  356. package/dist/chunks/pluginCliCommands-P2Ndi1r1.js +1 -0
  357. package/dist/chunks/pluginFlagging-BVy7Xv_0.js +1 -0
  358. package/dist/chunks/pluginOperations-Cz37qcjF.js +2 -0
  359. package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +1 -0
  360. package/dist/chunks/pluginStartupCheck-w24D-wwk.js +1 -0
  361. package/dist/chunks/plugins-B0hiIN4q.js +4 -0
  362. package/dist/chunks/policyLimits-Dem-XJ_h.js +1 -0
  363. package/dist/chunks/pollConfig-C2Ac8WMU.js +1 -0
  364. package/dist/chunks/poller-CpLBoB-N.js +1 -0
  365. package/dist/chunks/poor-CfbMKZNJ.js +1 -0
  366. package/dist/chunks/poorMode-Bsw2V-V_.js +1 -0
  367. package/dist/chunks/poorMode-jvImnkty.js +1 -0
  368. package/dist/chunks/postCommitAttribution-DoSP9wZD.js +1 -0
  369. package/dist/chunks/print-ozjC0Mhg.js +23 -0
  370. package/dist/chunks/privacy-settings-DeGoBRrZ.js +1 -0
  371. package/dist/chunks/process-CNfq37LF.js +1 -0
  372. package/dist/chunks/process-gEbdy6uY.js +1 -0
  373. package/dist/chunks/processBashCommand-loWZ8MSE.js +1 -0
  374. package/dist/chunks/processSlashCommand-BdouajZb.js +5 -0
  375. package/dist/chunks/projectContext-BaDZBAoK.js +1 -0
  376. package/dist/chunks/projectContext-D9MDwJUF.js +1 -0
  377. package/dist/chunks/prompt-Bef63FhB.js +132 -0
  378. package/dist/chunks/prompt-C7wd1H_i.js +1 -0
  379. package/dist/chunks/prompt-DIoNqZvO.js +1 -0
  380. package/dist/chunks/promptEditor-foiayhdY.js +4 -0
  381. package/dist/chunks/protocolHandler-BsiB1oW_.js +13 -0
  382. package/dist/chunks/protocols-CCsohXid.js +18 -0
  383. package/dist/chunks/protocols-CnYQjBlj.js +2 -0
  384. package/dist/chunks/proxy-Cn2YwITp.js +99 -0
  385. package/dist/chunks/rate-limit-options-DTJPDcTr.js +1 -0
  386. package/dist/chunks/rcDebugLog-BUuD-X1D.js +11 -0
  387. package/dist/chunks/reconciler-DqXTmV3J.js +4 -0
  388. package/dist/chunks/referral-DP_GshTS.js +1 -0
  389. package/dist/chunks/refresh-CNzXPAFw.js +1 -0
  390. package/dist/chunks/registerProtocol-CjxlFsKw.js +36 -0
  391. package/dist/chunks/release-notes-BxgK8zWO.js +4 -0
  392. package/dist/chunks/releaseNotes-CbSktIJW.js +2 -0
  393. package/dist/chunks/reload-plugins-CDu6yU5-.js +1 -0
  394. package/dist/chunks/remote-env-B4HnhISc.js +1 -0
  395. package/dist/chunks/remoteBridgeCore-D-wG5jau.js +1 -0
  396. package/dist/chunks/remoteManagedSettings-B7gt0VAX.js +1 -0
  397. package/dist/chunks/rename-DlbMb24l.js +1 -0
  398. package/dist/chunks/renderOptions-5kWQpVr2.js +1 -0
  399. package/dist/chunks/resume-BB5iBogS.js +2 -0
  400. package/dist/chunks/rewind-D12hCfZD.js +1 -0
  401. package/dist/chunks/ripgrep-BQgJ02F9.js +1 -0
  402. package/dist/chunks/ripgrep-BvDwiKJ3.js +5 -0
  403. package/dist/chunks/rollback-BPWRKlIZ.js +11 -0
  404. package/dist/chunks/rolldown-runtime-DaDcL9Zw.js +1 -0
  405. package/dist/chunks/runtimeObserver-BNH2WGE3.js +1 -0
  406. package/dist/chunks/runtimeObserver-Ci-5gvYg.js +10 -0
  407. package/dist/chunks/sandbox-adapter-Coe1GDAE.js +1 -0
  408. package/dist/chunks/sandbox-toggle-B2Yk4y2V.js +1 -0
  409. package/dist/chunks/sanitization-DV-94a9Z.js +1 -0
  410. package/dist/chunks/satisfies-DQJHNtpQ.js +1 -0
  411. package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +1 -0
  412. package/dist/chunks/searchExtraTools-BnWZ9roi.js +1 -0
  413. package/dist/chunks/semver-BMRJYn3q.js +1 -0
  414. package/dist/chunks/semver-DQo45qGo.js +1 -0
  415. package/dist/chunks/serde-f76bObzR.js +4 -0
  416. package/dist/chunks/server-LdbAb0sV.js +1 -0
  417. package/dist/chunks/serverBanner-BdExKFHT.js +1 -0
  418. package/dist/chunks/serverLog-BFmvyJ93.js +1 -0
  419. package/dist/chunks/session-Bmx7L3Mt.js +2 -0
  420. package/dist/chunks/sessionDataUploader-CaCjwsA2.js +1 -0
  421. package/dist/chunks/sessionDiscovery-DcEAr5vJ.js +1 -0
  422. package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +1 -0
  423. package/dist/chunks/sessionManager-CPa049BO.js +1 -0
  424. package/dist/chunks/sessionMemory-Bsg2unYX.js +1 -0
  425. package/dist/chunks/sessionMemory-CIbCojm-.js +1 -0
  426. package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +1 -0
  427. package/dist/chunks/sessionObserver-CRU1qWnP.js +1 -0
  428. package/dist/chunks/sessionObserver-DQwHsDrM.js +20 -0
  429. package/dist/chunks/sessionStorage-BxDN8qRc.js +1 -0
  430. package/dist/chunks/sessionStoragePortable-Cx6JQ5Ye.js +3 -0
  431. package/dist/chunks/sessionTitle-B8jcexkQ.js +14 -0
  432. package/dist/chunks/sessionTracing-BuLsL6qA.js +11 -0
  433. package/dist/chunks/settings-5PQdphqC.js +19 -0
  434. package/dist/chunks/settingsSync-BDeuErb5.js +1 -0
  435. package/dist/chunks/setup-BKEnSLR9.js +3 -0
  436. package/dist/chunks/shadowedRuleDetection-7Z8ezTKF.js +1 -0
  437. package/dist/chunks/shellQuote-fB02N16J.js +4 -0
  438. package/dist/chunks/sideQuestion-CYdNATPW.js +20 -0
  439. package/dist/chunks/signin-CPaEtsnK.js +1 -0
  440. package/dist/chunks/sink-DjKoYMsA.js +1 -0
  441. package/dist/chunks/sink-iYxWapbU.js +1 -0
  442. package/dist/chunks/sinks-GryGVRT8.js +2 -0
  443. package/dist/chunks/sinks-jfaIjsRJ.js +1 -0
  444. package/dist/chunks/skill-learning-E8tQed-Q.js +5 -0
  445. package/dist/chunks/skillChangeDetector-A8SAuyo9.js +1 -0
  446. package/dist/chunks/skillGapStore-B5rl12bV.js +1 -0
  447. package/dist/chunks/skillGapStore-CjJrxxjk.js +5 -0
  448. package/dist/chunks/skillGenerator-BDR_z3-X.js +8 -0
  449. package/dist/chunks/skillLearning-BQtfFE0g.js +1 -0
  450. package/dist/chunks/skillLearning-C8ihdryM.js +1 -0
  451. package/dist/chunks/skillPanel-yR8Oi-mO.js +28 -0
  452. package/dist/chunks/skillSearchPanel-DUQQUCUS.js +21 -0
  453. package/dist/chunks/skills-NAZQ3j-t.js +1 -0
  454. package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +1 -0
  455. package/dist/chunks/src-CDCSSo0U2.js +53 -0
  456. package/dist/chunks/src-CHw1lvBc.js +3 -0
  457. package/dist/chunks/src-CST_jFnT.js +1 -0
  458. package/dist/chunks/src-CgZmCiiH.js +2 -0
  459. package/dist/chunks/src-CiJCsqUl.js +9 -0
  460. package/dist/chunks/src-D06Xyj4g.js +2 -0
  461. package/dist/chunks/src-DCUgdrYl.js +5 -0
  462. package/dist/chunks/src-DLz3FZm1.js +1 -0
  463. package/dist/chunks/src-DPUAq5Ty.js +1 -0
  464. package/dist/chunks/src-DQOX_xI1.js +1 -0
  465. package/dist/chunks/src-Dt5IJd3C.js +1 -0
  466. package/dist/chunks/src-Dvp6-vB7.js +19 -0
  467. package/dist/chunks/src-PM8NIIu_.js +1 -0
  468. package/dist/chunks/src-l6_O0K-a.js +1 -0
  469. package/dist/chunks/src-xRRBgNzF.js +25 -0
  470. package/dist/chunks/sso-oidc-DFJ7SBvI.js +1 -0
  471. package/dist/chunks/startupProfiler-B0m6crkd.js +1 -0
  472. package/dist/chunks/startupProfiler-DxRQteII.js +3 -0
  473. package/dist/chunks/state-4KQ3kaqz.js +1 -0
  474. package/dist/chunks/state-53JDbNQM.js +1 -0
  475. package/dist/chunks/state-Cn_m2NOf.js +1 -0
  476. package/dist/chunks/staticRender-BIxpgNUq.js +1 -0
  477. package/dist/chunks/stats-h4yu84Q-.js +1 -0
  478. package/dist/chunks/status-BbdeubJG.js +1 -0
  479. package/dist/chunks/status-is_Bg_IB.js +2 -0
  480. package/dist/chunks/statusNoticeHelpers-CQ7CUugR.js +1 -0
  481. package/dist/chunks/stdio-4S7b8Uhx.js +1 -0
  482. package/dist/chunks/stdio-W_Kokrkh.js +3 -0
  483. package/dist/chunks/stickers-qJoNhPk4.js +1 -0
  484. package/dist/chunks/store-Z8rTjDHe.js +1 -0
  485. package/dist/chunks/stringUtils-CvXbHQRH.js +4 -0
  486. package/dist/chunks/sts-C2Gf2WYN.js +1 -0
  487. package/dist/chunks/subprocessEnv-BSQSomcK.js +1 -0
  488. package/dist/chunks/subprocessEnv-vrwzMgKn.js +1 -0
  489. package/dist/chunks/supports-color-uJ1LqA-P.js +1 -0
  490. package/dist/chunks/systemPromptSections-CgpggIYX.js +1 -0
  491. package/dist/chunks/systemPromptSections-IePG5K8r.js +1 -0
  492. package/dist/chunks/systemTheme-Ceakddth.js +1 -0
  493. package/dist/chunks/tag-i3HZ4lhj.js +11 -0
  494. package/dist/chunks/tasks-HzsYNTZ1.js +1 -0
  495. package/dist/chunks/teleport-hN3cAbYC.js +1 -0
  496. package/dist/chunks/templateJobs-CIv_ysje.js +12 -0
  497. package/dist/chunks/terminalSetup-C0PF87iu.js +33 -0
  498. package/dist/chunks/terminalSetup-CxniwSF-.js +1 -0
  499. package/dist/chunks/theme-BKIHX_Dx.js +1 -0
  500. package/dist/chunks/thinkback-BA4cMz4D.js +1 -0
  501. package/dist/chunks/thinkback-mT-8FIT-.js +1 -0
  502. package/dist/chunks/thinkback-play-Cfk49mvF.js +1 -0
  503. package/dist/chunks/tmux-CbsW-VDJ.js +1 -0
  504. package/dist/chunks/toolEventObserver-8FQtxeVv.js +1 -0
  505. package/dist/chunks/toolEventObserver-B1xvyKdE.js +1 -0
  506. package/dist/chunks/toolPool-CHVDZqh7.js +1 -0
  507. package/dist/chunks/trustedDevice-BYCh1ff7.js +1 -0
  508. package/dist/chunks/trustedDevice-DnIWErCt.js +1 -0
  509. package/dist/chunks/tui-fTa_pzdA.js +6 -0
  510. package/dist/chunks/types-BUyOCzUt.js +1 -0
  511. package/dist/chunks/types-Czs-_G1S.js +3 -0
  512. package/dist/chunks/types-a7X-tJpJ.js +17 -0
  513. package/dist/chunks/udsClient-Cg9bBD0p.js +1 -0
  514. package/dist/chunks/ultrareviewCommand-DCFRZsKp.js +3 -0
  515. package/dist/chunks/undercover-B-kKUWtK.js +1 -0
  516. package/dist/chunks/undercover-CsLPQb-a.js +31 -0
  517. package/dist/chunks/up-dO5BcPaq.js +12 -0
  518. package/dist/chunks/updateCCB-CfUnkOLT.js +11 -0
  519. package/dist/chunks/upgrade-CngUwvY4.js +1 -0
  520. package/dist/chunks/upgrade-kpttjebY.js +1 -0
  521. package/dist/chunks/upload-DDhQqV8n.js +1 -0
  522. package/dist/chunks/upstreamproxy-CvcjNY7J.js +11 -0
  523. package/dist/chunks/usage-CJ5w0907.js +1 -0
  524. package/dist/chunks/usage-eZRwLa77.js +1 -0
  525. package/dist/chunks/useExitOnCtrlCDWithKeybindings-yAroCqu4.js +1 -0
  526. package/dist/chunks/useMainLoopModel-BNFW-g8E.js +1 -0
  527. package/dist/chunks/useManagePlugins-CTtPaQRP.js +1 -0
  528. package/dist/chunks/useMergedTools-CZJffsmf.js +1 -0
  529. package/dist/chunks/useSearchInput-C-CqUK6w.js +1 -0
  530. package/dist/chunks/useSettingsErrors-BWlJCgYF.js +1 -0
  531. package/dist/chunks/util-DJV0joAW.js +1 -0
  532. package/dist/chunks/v4-jw6qOKwQ.js +65 -0
  533. package/dist/chunks/validatePlugin-CRmpIGLV.js +1 -0
  534. package/dist/chunks/vertex-sdk-DjXcZ2J7.js +9 -0
  535. package/dist/chunks/vim-n8-UT5w-.js +1 -0
  536. package/dist/chunks/which-BBCjXfI2.js +1 -0
  537. package/dist/chunks/windowsPaths-D6T_3XaU.js +1 -0
  538. package/dist/chunks/windowsPaths-DUKTzBck.js +1 -0
  539. package/dist/chunks/workSecret-C_lv0dRh.js +1 -0
  540. package/dist/chunks/workerRegistry-BdHi7_sN.js +1 -0
  541. package/dist/chunks/worktree-YDeHMlHZ.js +1 -0
  542. package/dist/chunks/worktreeModeEnabled-BFOYTTTr.js +1 -0
  543. package/dist/chunks/worktreeModeEnabled-D68iEHpC.js +1 -0
  544. package/dist/chunks/wrapper-K8ZapJVu.js +6 -0
  545. package/dist/chunks/xdg-DcF9ejUM.js +1 -0
  546. package/dist/chunks/zod-CuNujUwx.js +1 -0
  547. package/dist/cli-bun.js +2 -0
  548. package/dist/cli-node.js +2 -0
  549. package/dist/cli.js +2 -0
  550. package/dist/vendor/ripgrep/x64-linux/rg +0 -0
  551. package/package.json +218 -0
  552. package/scripts/postinstall.cjs +389 -0
@@ -0,0 +1,4 @@
1
+ import{i as e,n as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{c as r,i,n as a,r as o,s,t as c}from"./classPrivateFieldSet2-D4U5K-I3.js";import"node:path";import{promises as l}from"node:fs";var u=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.WebStreamsPolyfill={}))})(e,(function(e){function t(){}function n(e){return typeof e==`object`&&!!e||typeof e==`function`}let r=t;function i(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch{}}let a=Promise,o=Promise.prototype.then,s=Promise.reject.bind(a);function c(e){return new a(e)}function l(e){return c(t=>t(e))}function u(e){return s(e)}function d(e,t,n){return o.call(e,t,n)}function f(e,t,n){d(d(e,t,n),void 0,r)}function p(e,t){f(e,t)}function m(e,t){f(e,void 0,t)}function h(e,t,n){return d(e,t,n)}function g(e){d(e,void 0,r)}let _=e=>{if(typeof queueMicrotask==`function`)_=queueMicrotask;else{let e=l(void 0);_=t=>d(e,t)}return _(e)};function v(e,t,n){if(typeof e!=`function`)throw TypeError(`Argument is not a function`);return Function.prototype.apply.call(e,t,n)}function y(e,t,n){try{return l(v(e,t,n))}catch(e){return u(e)}}let b=16384;class x{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let t=this._back,n=t;t._elements.length===b-1&&(n={_elements:[],_next:void 0}),t._elements.push(e),n!==t&&(this._back=n,t._next=n),++this._size}shift(){let e=this._front,t=e,n=this._cursor,r=n+1,i=e._elements,a=i[n];return r===b&&(t=e._next,r=0),--this._size,this._cursor=r,e!==t&&(this._front=t),i[n]=void 0,a}forEach(e){let t=this._cursor,n=this._front,r=n._elements;for(;(t!==r.length||n._next!==void 0)&&!(t===r.length&&(n=n._next,r=n._elements,t=0,r.length===0));)e(r[t]),++t}peek(){let e=this._front,t=this._cursor;return e._elements[t]}}let S=Symbol(`[[AbortSteps]]`),C=Symbol(`[[ErrorSteps]]`),w=Symbol(`[[CancelSteps]]`),ee=Symbol(`[[PullSteps]]`),T=Symbol(`[[ReleaseSteps]]`);function E(e,t){e._ownerReadableStream=t,t._reader=e,t._state===`readable`?k(e):t._state===`closed`?ne(e):A(e,t._storedError)}function D(e,t){let n=e._ownerReadableStream;return Q(n,t)}function O(e){let t=e._ownerReadableStream;t._state===`readable`?re(e,TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)):ie(e,TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)),t._readableStreamController[T](),t._reader=void 0,e._ownerReadableStream=void 0}function te(e){return TypeError(`Cannot `+e+` a stream using a released reader`)}function k(e){e._closedPromise=c((t,n)=>{e._closedPromise_resolve=t,e._closedPromise_reject=n})}function A(e,t){k(e),re(e,t)}function ne(e){k(e),ae(e)}function re(e,t){e._closedPromise_reject!==void 0&&(g(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function ie(e,t){A(e,t)}function ae(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}let oe=Number.isFinite||function(e){return typeof e==`number`&&isFinite(e)},se=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function j(e){return typeof e==`object`||typeof e==`function`}function M(e,t){if(e!==void 0&&!j(e))throw TypeError(`${t} is not an object.`)}function N(e,t){if(typeof e!=`function`)throw TypeError(`${t} is not a function.`)}function ce(e){return typeof e==`object`&&!!e||typeof e==`function`}function le(e,t){if(!ce(e))throw TypeError(`${t} is not an object.`)}function P(e,t,n){if(e===void 0)throw TypeError(`Parameter ${t} is required in '${n}'.`)}function ue(e,t,n){if(e===void 0)throw TypeError(`${t} is required in '${n}'.`)}function de(e){return Number(e)}function fe(e){return e===0?0:e}function pe(e){return fe(se(e))}function me(e,t){let n=2**53-1,r=Number(e);if(r=fe(r),!oe(r))throw TypeError(`${t} is not a finite number`);if(r=pe(r),r<0||r>n)throw TypeError(`${t} is outside the accepted range of 0 to ${n}, inclusive`);return!oe(r)||r===0?0:r}function he(e,t){if(!X(e))throw TypeError(`${t} is not a ReadableStream.`)}function ge(e){return new F(e)}function _e(e,t){e._reader._readRequests.push(t)}function ve(e,t,n){let r=e._reader._readRequests.shift();n?r._closeSteps():r._chunkSteps(t)}function ye(e){return e._reader._readRequests.length}function be(e){let t=e._reader;return!(t===void 0||!I(t))}class F{constructor(e){if(P(e,1,`ReadableStreamDefaultReader`),he(e,`First parameter`),Z(e))throw TypeError(`This stream has already been locked for exclusive reading by another reader`);E(this,e),this._readRequests=new x}get closed(){return I(this)?this._closedPromise:u(we(`closed`))}cancel(e=void 0){return I(this)?this._ownerReadableStream===void 0?u(te(`cancel`)):D(this,e):u(we(`cancel`))}read(){if(!I(this))return u(we(`read`));if(this._ownerReadableStream===void 0)return u(te(`read from`));let e,t,n=c((n,r)=>{e=n,t=r});return xe(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),n}releaseLock(){if(!I(this))throw we(`releaseLock`);this._ownerReadableStream!==void 0&&Se(this)}}Object.defineProperties(F.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(F.prototype.cancel,`cancel`),i(F.prototype.read,`read`),i(F.prototype.releaseLock,`releaseLock`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(F.prototype,Symbol.toStringTag,{value:`ReadableStreamDefaultReader`,configurable:!0});function I(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_readRequests`)?!1:e instanceof F}function xe(e,t){let n=e._ownerReadableStream;n._disturbed=!0,n._state===`closed`?t._closeSteps():n._state===`errored`?t._errorSteps(n._storedError):n._readableStreamController[ee](t)}function Se(e){O(e),Ce(e,TypeError(`Reader was released`))}function Ce(e,t){let n=e._readRequests;e._readRequests=new x,n.forEach(e=>{e._errorSteps(t)})}function we(e){return TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}let Te=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ee{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?h(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let t=()=>this._returnSteps(e);return this._ongoingPromise?h(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader,t,n,r=c((e,r)=>{t=e,n=r});return xe(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,_(()=>t({value:e,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,O(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,O(e),n(t)}}),r}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let t=this._reader;if(!this._preventCancel){let n=D(t,e);return O(t),h(n,()=>({value:e,done:!0}))}return O(t),l({value:e,done:!0})}}let De={next(){return ke(this)?this._asyncIteratorImpl.next():u(Ae(`next`))},return(e){return ke(this)?this._asyncIteratorImpl.return(e):u(Ae(`return`))}};Object.setPrototypeOf(De,Te);function Oe(e,t){let n=ge(e),r=new Ee(n,t),i=Object.create(De);return i._asyncIteratorImpl=r,i}function ke(e){if(!n(e)||!Object.prototype.hasOwnProperty.call(e,`_asyncIteratorImpl`))return!1;try{return e._asyncIteratorImpl instanceof Ee}catch{return!1}}function Ae(e){return TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}let je=Number.isNaN||function(e){return e!==e};function Me(e){return e.slice()}function Ne(e,t,n,r,i){new Uint8Array(e).set(new Uint8Array(n,r,i),t)}let Pe=e=>(Pe=typeof e.transfer==`function`?e=>e.transfer():typeof structuredClone==`function`?e=>structuredClone(e,{transfer:[e]}):e=>e,Pe(e)),Fe=e=>(Fe=typeof e.detached==`boolean`?e=>e.detached:e=>e.byteLength===0,Fe(e));function Ie(e,t,n){if(e.slice)return e.slice(t,n);let r=n-t,i=new ArrayBuffer(r);return Ne(i,0,e,t,r),i}function Le(e,t){let n=e[t];if(n!=null){if(typeof n!=`function`)throw TypeError(`${String(t)} is not a function`);return n}}function Re(e){let t={[Symbol.iterator]:()=>e.iterator},n=async function*(){return yield*t}();return{iterator:n,nextMethod:n.next,done:!1}}let ze=Symbol.asyncIterator??Symbol.for?.call(Symbol,`Symbol.asyncIterator`)??`@@asyncIterator`;function Be(e,t=`sync`,r){if(r===void 0)if(t===`async`){if(r=Le(e,ze),r===void 0)return Re(Be(e,`sync`,Le(e,Symbol.iterator)))}else r=Le(e,Symbol.iterator);if(r===void 0)throw TypeError(`The object is not iterable`);let i=v(r,e,[]);if(!n(i))throw TypeError(`The iterator method must return an object`);return{iterator:i,nextMethod:i.next,done:!1}}function Ve(e){let t=v(e.nextMethod,e.iterator,[]);if(!n(t))throw TypeError(`The iterator.next() method must return an object`);return t}function He(e){return!!e.done}function Ue(e){return e.value}function We(e){return!(typeof e!=`number`||je(e)||e<0)}function Ge(e){let t=Ie(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function Ke(e){let t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function qe(e,t,n){if(!We(n)||n===1/0)throw RangeError(`Size must be a finite, non-NaN, non-negative number.`);e._queue.push({value:t,size:n}),e._queueTotalSize+=n}function Je(e){return e._queue.peek().value}function L(e){e._queue=new x,e._queueTotalSize=0}function Ye(e){return e===DataView}function Xe(e){return Ye(e.constructor)}function Ze(e){return Ye(e)?1:e.BYTES_PER_ELEMENT}class Qe{constructor(){throw TypeError(`Illegal constructor`)}get view(){if(!$e(this))throw kt(`view`);return this._view}respond(e){if(!$e(this))throw kt(`respond`);if(P(e,1,`respond`),e=me(e,`First parameter`),this._associatedReadableByteStreamController===void 0)throw TypeError(`This BYOB request has been invalidated`);if(Fe(this._view.buffer))throw TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`);wt(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!$e(this))throw kt(`respondWithNewView`);if(P(e,1,`respondWithNewView`),!ArrayBuffer.isView(e))throw TypeError(`You can only respond with array buffer views`);if(this._associatedReadableByteStreamController===void 0)throw TypeError(`This BYOB request has been invalidated`);if(Fe(e.buffer))throw TypeError(`The given view's buffer has been detached and so cannot be used as a response`);Tt(this._associatedReadableByteStreamController,e)}}Object.defineProperties(Qe.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Qe.prototype.respond,`respond`),i(Qe.prototype.respondWithNewView,`respondWithNewView`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Qe.prototype,Symbol.toStringTag,{value:`ReadableStreamBYOBRequest`,configurable:!0});class R{constructor(){throw TypeError(`Illegal constructor`)}get byobRequest(){if(!z(this))throw At(`byobRequest`);return St(this)}get desiredSize(){if(!z(this))throw At(`desiredSize`);return Ct(this)}close(){if(!z(this))throw At(`close`);if(this._closeRequested)throw TypeError(`The stream has already been closed; do not close it again!`);let e=this._controlledReadableByteStream._state;if(e!==`readable`)throw TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);yt(this)}enqueue(e){if(!z(this))throw At(`enqueue`);if(P(e,1,`enqueue`),!ArrayBuffer.isView(e))throw TypeError(`chunk must be an array buffer view`);if(e.byteLength===0)throw TypeError(`chunk must have non-zero byteLength`);if(e.buffer.byteLength===0)throw TypeError(`chunk's buffer must have non-zero byteLength`);if(this._closeRequested)throw TypeError(`stream is closed or draining`);let t=this._controlledReadableByteStream._state;if(t!==`readable`)throw TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);bt(this,e)}error(e=void 0){if(!z(this))throw At(`error`);V(this,e)}[w](e){et(this),L(this);let t=this._cancelAlgorithm(e);return vt(this),t}[ee](e){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0){xt(this,e);return}let n=this._autoAllocateChunkSize;if(n!==void 0){let t;try{t=new ArrayBuffer(n)}catch(t){e._errorSteps(t);return}let r={buffer:t,bufferByteLength:n,byteOffset:0,byteLength:n,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:`default`};this._pendingPullIntos.push(r)}_e(t,e),B(this)}[T](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType=`none`,this._pendingPullIntos=new x,this._pendingPullIntos.push(e)}}}Object.defineProperties(R.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(R.prototype.close,`close`),i(R.prototype.enqueue,`enqueue`),i(R.prototype.error,`error`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(R.prototype,Symbol.toStringTag,{value:`ReadableByteStreamController`,configurable:!0});function z(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_controlledReadableByteStream`)?!1:e instanceof R}function $e(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_associatedReadableByteStreamController`)?!1:e instanceof Qe}function B(e){if(_t(e)){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0,f(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,B(e)),null),t=>(V(e,t),null))}}function et(e){lt(e),e._pendingPullIntos=new x}function tt(e,t){let n=!1;e._state===`closed`&&(n=!0);let r=nt(t);t.readerType==="default"?ve(e,r,n):It(e,r,n)}function nt(e){let t=e.bytesFilled,n=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/n)}function rt(e,t,n,r){e._queue.push({buffer:t,byteOffset:n,byteLength:r}),e._queueTotalSize+=r}function it(e,t,n,r){let i;try{i=Ie(t,n,n+r)}catch(t){throw V(e,t),t}rt(e,i,0,r)}function at(e,t){t.bytesFilled>0&&it(e,t.buffer,t.byteOffset,t.bytesFilled),gt(e)}function ot(e,t){let n=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),r=t.bytesFilled+n,i=n,a=!1,o=r-r%t.elementSize;o>=t.minimumFill&&(i=o-t.bytesFilled,a=!0);let s=e._queue;for(;i>0;){let n=s.peek(),r=Math.min(i,n.byteLength),a=t.byteOffset+t.bytesFilled;Ne(t.buffer,a,n.buffer,n.byteOffset,r),n.byteLength===r?s.shift():(n.byteOffset+=r,n.byteLength-=r),e._queueTotalSize-=r,st(e,r,t),i-=r}return a}function st(e,t,n){n.bytesFilled+=t}function ct(e){e._queueTotalSize===0&&e._closeRequested?(vt(e),Yr(e._controlledReadableByteStream)):B(e)}function lt(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function ut(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let t=e._pendingPullIntos.peek();ot(e,t)&&(gt(e),tt(e._controlledReadableByteStream,t))}}function dt(e){let t=e._controlledReadableByteStream._reader;for(;t._readRequests.length>0;){if(e._queueTotalSize===0)return;xt(e,t._readRequests.shift())}}function ft(e,t,n,r){let i=e._controlledReadableByteStream,a=t.constructor,o=Ze(a),{byteOffset:s,byteLength:c}=t,l=n*o,u;try{u=Pe(t.buffer)}catch(e){r._errorSteps(e);return}let d={buffer:u,bufferByteLength:u.byteLength,byteOffset:s,byteLength:c,bytesFilled:0,minimumFill:l,elementSize:o,viewConstructor:a,readerType:`byob`};if(e._pendingPullIntos.length>0){e._pendingPullIntos.push(d),Ft(i,r);return}if(i._state===`closed`){let e=new a(d.buffer,d.byteOffset,0);r._closeSteps(e);return}if(e._queueTotalSize>0){if(ot(e,d)){let t=nt(d);ct(e),r._chunkSteps(t);return}if(e._closeRequested){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);V(e,t),r._errorSteps(t);return}}e._pendingPullIntos.push(d),Ft(i,r),B(e)}function pt(e,t){t.readerType===`none`&&gt(e);let n=e._controlledReadableByteStream;if(Rt(n))for(;Lt(n)>0;)tt(n,gt(e))}function mt(e,t,n){if(st(e,t,n),n.readerType===`none`){at(e,n),ut(e);return}if(n.bytesFilled<n.minimumFill)return;gt(e);let r=n.bytesFilled%n.elementSize;if(r>0){let t=n.byteOffset+n.bytesFilled;it(e,n.buffer,t-r,r)}n.bytesFilled-=r,tt(e._controlledReadableByteStream,n),ut(e)}function ht(e,t){let n=e._pendingPullIntos.peek();lt(e),e._controlledReadableByteStream._state===`closed`?pt(e,n):mt(e,t,n),B(e)}function gt(e){return e._pendingPullIntos.shift()}function _t(e){let t=e._controlledReadableByteStream;return t._state!==`readable`||e._closeRequested||!e._started?!1:!!(be(t)&&ye(t)>0||Rt(t)&&Lt(t)>0||Ct(e)>0)}function vt(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function yt(e){let t=e._controlledReadableByteStream;if(!(e._closeRequested||t._state!==`readable`)){if(e._queueTotalSize>0){e._closeRequested=!0;return}if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!==0){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);throw V(e,t),t}}vt(e),Yr(t)}}function bt(e,t){let n=e._controlledReadableByteStream;if(e._closeRequested||n._state!==`readable`)return;let{buffer:r,byteOffset:i,byteLength:a}=t;if(Fe(r))throw TypeError(`chunk's buffer is detached and so cannot be enqueued`);let o=Pe(r);if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(Fe(t.buffer))throw TypeError(`The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk`);lt(e),t.buffer=Pe(t.buffer),t.readerType===`none`&&at(e,t)}be(n)?(dt(e),ye(n)===0?rt(e,o,i,a):(e._pendingPullIntos.length>0&&gt(e),ve(n,new Uint8Array(o,i,a),!1))):Rt(n)?(rt(e,o,i,a),ut(e)):rt(e,o,i,a),B(e)}function V(e,t){let n=e._controlledReadableByteStream;n._state===`readable`&&(et(e),L(e),vt(e),Xr(n,t))}function xt(e,t){let n=e._queue.shift();e._queueTotalSize-=n.byteLength,ct(e);let r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);t._chunkSteps(r)}function St(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek(),n=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),r=Object.create(Qe.prototype);Ot(r,e,n),e._byobRequest=r}return e._byobRequest}function Ct(e){let t=e._controlledReadableByteStream._state;return t===`errored`?null:t===`closed`?0:e._strategyHWM-e._queueTotalSize}function wt(e,t){let n=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state===`closed`){if(t!==0)throw TypeError(`bytesWritten must be 0 when calling respond() on a closed stream`)}else{if(t===0)throw TypeError(`bytesWritten must be greater than 0 when calling respond() on a readable stream`);if(n.bytesFilled+t>n.byteLength)throw RangeError(`bytesWritten out of range`)}n.buffer=Pe(n.buffer),ht(e,t)}function Tt(e,t){let n=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state===`closed`){if(t.byteLength!==0)throw TypeError(`The view's length must be 0 when calling respondWithNewView() on a closed stream`)}else if(t.byteLength===0)throw TypeError(`The view's length must be greater than 0 when calling respondWithNewView() on a readable stream`);if(n.byteOffset+n.bytesFilled!==t.byteOffset)throw RangeError(`The region specified by view does not match byobRequest`);if(n.bufferByteLength!==t.buffer.byteLength)throw RangeError(`The buffer of view has different capacity than byobRequest`);if(n.bytesFilled+t.byteLength>n.byteLength)throw RangeError(`The region specified by view is larger than byobRequest`);let r=t.byteLength;n.buffer=Pe(t.buffer),ht(e,r)}function Et(e,t,n,r,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,L(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=r,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new x,e._readableStreamController=t,f(l(n()),()=>(t._started=!0,B(t),null),e=>(V(t,e),null))}function Dt(e,t,n){let r=Object.create(R.prototype),i,a,o;i=t.start===void 0?()=>void 0:()=>t.start(r),a=t.pull===void 0?()=>l(void 0):()=>t.pull(r),o=t.cancel===void 0?()=>l(void 0):e=>t.cancel(e);let s=t.autoAllocateChunkSize;if(s===0)throw TypeError(`autoAllocateChunkSize must be greater than 0`);Et(e,r,i,a,o,n,s)}function Ot(e,t,n){e._associatedReadableByteStreamController=t,e._view=n}function kt(e){return TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function At(e){return TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function jt(e,t){M(e,t);let n=e?.mode;return{mode:n===void 0?void 0:Mt(n,`${t} has member 'mode' that`)}}function Mt(e,t){if(e=`${e}`,e!==`byob`)throw TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Nt(e,t){return M(e,t),{min:me(e?.min??1,`${t} has member 'min' that`)}}function Pt(e){return new H(e)}function Ft(e,t){e._reader._readIntoRequests.push(t)}function It(e,t,n){let r=e._reader._readIntoRequests.shift();n?r._closeSteps(t):r._chunkSteps(t)}function Lt(e){return e._reader._readIntoRequests.length}function Rt(e){let t=e._reader;return!(t===void 0||!U(t))}class H{constructor(e){if(P(e,1,`ReadableStreamBYOBReader`),he(e,`First parameter`),Z(e))throw TypeError(`This stream has already been locked for exclusive reading by another reader`);if(!z(e._readableStreamController))throw TypeError(`Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source`);E(this,e),this._readIntoRequests=new x}get closed(){return U(this)?this._closedPromise:u(Ht(`closed`))}cancel(e=void 0){return U(this)?this._ownerReadableStream===void 0?u(te(`cancel`)):D(this,e):u(Ht(`cancel`))}read(e,t={}){if(!U(this))return u(Ht(`read`));if(!ArrayBuffer.isView(e))return u(TypeError(`view must be an array buffer view`));if(e.byteLength===0)return u(TypeError(`view must have non-zero byteLength`));if(e.buffer.byteLength===0)return u(TypeError(`view's buffer must have non-zero byteLength`));if(Fe(e.buffer))return u(TypeError(`view's buffer has been detached`));let n;try{n=Nt(t,`options`)}catch(e){return u(e)}let r=n.min;if(r===0)return u(TypeError(`options.min must be greater than 0`));if(!Xe(e)){if(r>e.length)return u(RangeError(`options.min must be less than or equal to view's length`))}else if(r>e.byteLength)return u(RangeError(`options.min must be less than or equal to view's byteLength`));if(this._ownerReadableStream===void 0)return u(te(`read from`));let i,a,o=c((e,t)=>{i=e,a=t});return zt(this,e,r,{_chunkSteps:e=>i({value:e,done:!1}),_closeSteps:e=>i({value:e,done:!0}),_errorSteps:e=>a(e)}),o}releaseLock(){if(!U(this))throw Ht(`releaseLock`);this._ownerReadableStream!==void 0&&Bt(this)}}Object.defineProperties(H.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(H.prototype.cancel,`cancel`),i(H.prototype.read,`read`),i(H.prototype.releaseLock,`releaseLock`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(H.prototype,Symbol.toStringTag,{value:`ReadableStreamBYOBReader`,configurable:!0});function U(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_readIntoRequests`)?!1:e instanceof H}function zt(e,t,n,r){let i=e._ownerReadableStream;i._disturbed=!0,i._state===`errored`?r._errorSteps(i._storedError):ft(i._readableStreamController,t,n,r)}function Bt(e){O(e),Vt(e,TypeError(`Reader was released`))}function Vt(e,t){let n=e._readIntoRequests;e._readIntoRequests=new x,n.forEach(e=>{e._errorSteps(t)})}function Ht(e){return TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Ut(e,t){let{highWaterMark:n}=e;if(n===void 0)return t;if(je(n)||n<0)throw RangeError(`Invalid highWaterMark`);return n}function Wt(e){let{size:t}=e;return t||(()=>1)}function Gt(e,t){M(e,t);let n=e?.highWaterMark,r=e?.size;return{highWaterMark:n===void 0?void 0:de(n),size:r===void 0?void 0:Kt(r,`${t} has member 'size' that`)}}function Kt(e,t){return N(e,t),t=>de(e(t))}function qt(e,t){M(e,t);let n=e?.abort,r=e?.close,i=e?.start,a=e?.type,o=e?.write;return{abort:n===void 0?void 0:Jt(n,e,`${t} has member 'abort' that`),close:r===void 0?void 0:Yt(r,e,`${t} has member 'close' that`),start:i===void 0?void 0:Xt(i,e,`${t} has member 'start' that`),write:o===void 0?void 0:Zt(o,e,`${t} has member 'write' that`),type:a}}function Jt(e,t,n){return N(e,n),n=>y(e,t,[n])}function Yt(e,t,n){return N(e,n),()=>y(e,t,[])}function Xt(e,t,n){return N(e,n),n=>v(e,t,[n])}function Zt(e,t,n){return N(e,n),(n,r)=>y(e,t,[n,r])}function Qt(e,t){if(!on(e))throw TypeError(`${t} is not a WritableStream.`)}function $t(e){if(typeof e!=`object`||!e)return!1;try{return typeof e.aborted==`boolean`}catch{return!1}}let en=typeof AbortController==`function`;function tn(){if(en)return new AbortController}class W{constructor(e={},t={}){e===void 0?e=null:le(e,`First parameter`);let n=Gt(t,`Second parameter`),r=qt(e,`First parameter`);if(an(this),r.type!==void 0)throw RangeError(`Invalid type is specified`);let i=Wt(n),a=Ut(n,1);In(this,r,a,i)}get locked(){if(!on(this))throw Jn(`locked`);return sn(this)}abort(e=void 0){return on(this)?sn(this)?u(TypeError(`Cannot abort a stream that already has a writer`)):cn(this,e):u(Jn(`abort`))}close(){return on(this)?sn(this)?u(TypeError(`Cannot close a stream that already has a writer`)):G(this)?u(TypeError(`Cannot close an already-closing stream`)):ln(this):u(Jn(`close`))}getWriter(){if(!on(this))throw Jn(`getWriter`);return nn(this)}}Object.defineProperties(W.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(W.prototype.abort,`abort`),i(W.prototype.close,`close`),i(W.prototype.getWriter,`getWriter`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(W.prototype,Symbol.toStringTag,{value:`WritableStream`,configurable:!0});function nn(e){return new K(e)}function rn(e,t,n,r,i=1,a=()=>1){let o=Object.create(W.prototype);return an(o),Fn(o,Object.create(Nn.prototype),e,t,n,r,i,a),o}function an(e){e._state=`writable`,e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new x,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function on(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_writableStreamController`)?!1:e instanceof W}function sn(e){return e._writer!==void 0}function cn(e,t){var n;if(e._state===`closed`||e._state===`errored`)return l(void 0);e._writableStreamController._abortReason=t,(n=e._writableStreamController._abortController)==null||n.abort(t);let r=e._state;if(r===`closed`||r===`errored`)return l(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let i=!1;r===`erroring`&&(i=!0,t=void 0);let a=c((n,r)=>{e._pendingAbortRequest={_promise:void 0,_resolve:n,_reject:r,_reason:t,_wasAlreadyErroring:i}});return e._pendingAbortRequest._promise=a,i||fn(e,t),a}function ln(e){let t=e._state;if(t===`closed`||t===`errored`)return u(TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));let n=c((t,n)=>{e._closeRequest={_resolve:t,_reject:n}}),r=e._writer;return r!==void 0&&e._backpressure&&t===`writable`&&ur(r),Rn(e._writableStreamController),n}function un(e){return c((t,n)=>{let r={_resolve:t,_reject:n};e._writeRequests.push(r)})}function dn(e,t){if(e._state===`writable`){fn(e,t);return}pn(e)}function fn(e,t){let n=e._writableStreamController;e._state=`erroring`,e._storedError=t;let r=e._writer;r!==void 0&&On(r,t),!vn(e)&&n._started&&pn(e)}function pn(e){e._state=`errored`,e._writableStreamController[C]();let t=e._storedError;if(e._writeRequests.forEach(e=>{e._reject(t)}),e._writeRequests=new x,e._pendingAbortRequest===void 0){xn(e);return}let n=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,n._wasAlreadyErroring){n._reject(t),xn(e);return}f(e._writableStreamController[S](n._reason),()=>(n._resolve(),xn(e),null),t=>(n._reject(t),xn(e),null))}function mn(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function hn(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,dn(e,t)}function gn(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,e._state===`erroring`&&(e._storedError=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state=`closed`;let t=e._writer;t!==void 0&&rr(t)}function _n(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),dn(e,t)}function G(e){return!(e._closeRequest===void 0&&e._inFlightCloseRequest===void 0)}function vn(e){return!(e._inFlightWriteRequest===void 0&&e._inFlightCloseRequest===void 0)}function yn(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function bn(e){e._inFlightWriteRequest=e._writeRequests.shift()}function xn(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let t=e._writer;t!==void 0&&tr(t,e._storedError)}function Sn(e,t){let n=e._writer;n!==void 0&&t!==e._backpressure&&(t?cr(n):ur(n)),e._backpressure=t}class K{constructor(e){if(P(e,1,`WritableStreamDefaultWriter`),Qt(e,`First parameter`),sn(e))throw TypeError(`This stream has already been locked for exclusive writing by another writer`);this._ownerWritableStream=e,e._writer=this;let t=e._state;if(t===`writable`)!G(e)&&e._backpressure?ir(this):or(this),Qn(this);else if(t===`erroring`)ar(this,e._storedError),Qn(this);else if(t===`closed`)or(this),er(this);else{let t=e._storedError;ar(this,t),$n(this,t)}}get closed(){return Cn(this)?this._closedPromise:u(Xn(`closed`))}get desiredSize(){if(!Cn(this))throw Xn(`desiredSize`);if(this._ownerWritableStream===void 0)throw Zn(`desiredSize`);return kn(this)}get ready(){return Cn(this)?this._readyPromise:u(Xn(`ready`))}abort(e=void 0){return Cn(this)?this._ownerWritableStream===void 0?u(Zn(`abort`)):wn(this,e):u(Xn(`abort`))}close(){if(!Cn(this))return u(Xn(`close`));let e=this._ownerWritableStream;return e===void 0?u(Zn(`close`)):G(e)?u(TypeError(`Cannot close an already-closing stream`)):Tn(this)}releaseLock(){if(!Cn(this))throw Xn(`releaseLock`);this._ownerWritableStream!==void 0&&An(this)}write(e=void 0){return Cn(this)?this._ownerWritableStream===void 0?u(Zn(`write to`)):jn(this,e):u(Xn(`write`))}}Object.defineProperties(K.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(K.prototype.abort,`abort`),i(K.prototype.close,`close`),i(K.prototype.releaseLock,`releaseLock`),i(K.prototype.write,`write`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(K.prototype,Symbol.toStringTag,{value:`WritableStreamDefaultWriter`,configurable:!0});function Cn(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_ownerWritableStream`)?!1:e instanceof K}function wn(e,t){let n=e._ownerWritableStream;return cn(n,t)}function Tn(e){let t=e._ownerWritableStream;return ln(t)}function En(e){let t=e._ownerWritableStream,n=t._state;return G(t)||n===`closed`?l(void 0):n===`errored`?u(t._storedError):Tn(e)}function Dn(e,t){e._closedPromiseState===`pending`?tr(e,t):nr(e,t)}function On(e,t){e._readyPromiseState===`pending`?sr(e,t):lr(e,t)}function kn(e){let t=e._ownerWritableStream,n=t._state;return n===`errored`||n===`erroring`?null:n===`closed`?0:Bn(t._writableStreamController)}function An(e){let t=e._ownerWritableStream,n=TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`);On(e,n),Dn(e,n),t._writer=void 0,e._ownerWritableStream=void 0}function jn(e,t){let n=e._ownerWritableStream,r=n._writableStreamController,i=zn(r,t);if(n!==e._ownerWritableStream)return u(Zn(`write to`));let a=n._state;if(a===`errored`)return u(n._storedError);if(G(n)||a===`closed`)return u(TypeError(`The stream is closing or closed and cannot be written to`));if(a===`erroring`)return u(n._storedError);let o=un(n);return Vn(r,t,i),o}let Mn={};class Nn{constructor(){throw TypeError(`Illegal constructor`)}get abortReason(){if(!Pn(this))throw Yn(`abortReason`);return this._abortReason}get signal(){if(!Pn(this))throw Yn(`signal`);if(this._abortController===void 0)throw TypeError(`WritableStreamDefaultController.prototype.signal is not supported`);return this._abortController.signal}error(e=void 0){if(!Pn(this))throw Yn(`error`);this._controlledWritableStream._state===`writable`&&qn(this,e)}[S](e){let t=this._abortAlgorithm(e);return Ln(this),t}[C](){L(this)}}Object.defineProperties(Nn.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Nn.prototype,Symbol.toStringTag,{value:`WritableStreamDefaultController`,configurable:!0});function Pn(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_controlledWritableStream`)?!1:e instanceof Nn}function Fn(e,t,n,r,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,L(t),t._abortReason=void 0,t._abortController=tn(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=r,t._closeAlgorithm=i,t._abortAlgorithm=a,Sn(e,Kn(t)),f(l(n()),()=>(t._started=!0,Hn(t),null),n=>(t._started=!0,dn(e,n),null))}function In(e,t,n,r){let i=Object.create(Nn.prototype),a,o,s,c;a=t.start===void 0?()=>void 0:()=>t.start(i),o=t.write===void 0?()=>l(void 0):e=>t.write(e,i),s=t.close===void 0?()=>l(void 0):()=>t.close(),c=t.abort===void 0?()=>l(void 0):e=>t.abort(e),Fn(e,i,a,o,s,c,n,r)}function Ln(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Rn(e){qe(e,Mn,0),Hn(e)}function zn(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return Un(e,t),1}}function Bn(e){return e._strategyHWM-e._queueTotalSize}function Vn(e,t,n){try{qe(e,t,n)}catch(t){Un(e,t);return}let r=e._controlledWritableStream;!G(r)&&r._state===`writable`&&Sn(r,Kn(e)),Hn(e)}function Hn(e){let t=e._controlledWritableStream;if(!e._started||t._inFlightWriteRequest!==void 0)return;if(t._state===`erroring`){pn(t);return}if(e._queue.length===0)return;let n=Je(e);n===Mn?Wn(e):Gn(e,n)}function Un(e,t){e._controlledWritableStream._state===`writable`&&qn(e,t)}function Wn(e){let t=e._controlledWritableStream;yn(t),Ke(e);let n=e._closeAlgorithm();Ln(e),f(n,()=>(gn(t),null),e=>(_n(t,e),null))}function Gn(e,t){let n=e._controlledWritableStream;bn(n),f(e._writeAlgorithm(t),()=>{mn(n);let t=n._state;if(Ke(e),!G(n)&&t===`writable`){let t=Kn(e);Sn(n,t)}return Hn(e),null},t=>(n._state===`writable`&&Ln(e),hn(n,t),null))}function Kn(e){return Bn(e)<=0}function qn(e,t){let n=e._controlledWritableStream;Ln(e),fn(n,t)}function Jn(e){return TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Yn(e){return TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Xn(e){return TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Zn(e){return TypeError(`Cannot `+e+` a stream using a released writer`)}function Qn(e){e._closedPromise=c((t,n)=>{e._closedPromise_resolve=t,e._closedPromise_reject=n,e._closedPromiseState=`pending`})}function $n(e,t){Qn(e),tr(e,t)}function er(e){Qn(e),rr(e)}function tr(e,t){e._closedPromise_reject!==void 0&&(g(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState=`rejected`)}function nr(e,t){$n(e,t)}function rr(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState=`resolved`)}function ir(e){e._readyPromise=c((t,n)=>{e._readyPromise_resolve=t,e._readyPromise_reject=n}),e._readyPromiseState=`pending`}function ar(e,t){ir(e),sr(e,t)}function or(e){ir(e),ur(e)}function sr(e,t){e._readyPromise_reject!==void 0&&(g(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState=`rejected`)}function cr(e){ir(e)}function lr(e,t){ar(e,t)}function ur(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState=`fulfilled`)}function dr(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof global<`u`)return global}let fr=dr();function pr(e){if(!(typeof e==`function`||typeof e==`object`)||e.name!==`DOMException`)return!1;try{return new e,!0}catch{return!1}}function mr(){let e=fr?.DOMException;return pr(e)?e:void 0}function hr(){let e=function(e,t){this.message=e||``,this.name=t||`Error`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return i(e,`DOMException`),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}let gr=mr()||hr();function _r(e,n,r,i,a,o){let s=ge(e),u=nn(n);e._disturbed=!0;let h=!1,_=l(void 0);return c((v,y)=>{let b;if(o!==void 0){if(b=()=>{let t=o.reason===void 0?new gr(`Aborted`,`AbortError`):o.reason,r=[];i||r.push(()=>n._state===`writable`?cn(n,t):l(void 0)),a||r.push(()=>e._state===`readable`?Q(e,t):l(void 0)),T(()=>Promise.all(r.map(e=>e())),!0,t)},o.aborted){b();return}o.addEventListener(`abort`,b)}function x(){return c((e,t)=>{function n(r){r?e():d(S(),n,t)}n(!1)})}function S(){return h?l(!0):d(u._readyPromise,()=>c((e,n)=>{xe(s,{_chunkSteps:n=>{_=d(jn(u,n),void 0,t),e(!1)},_closeSteps:()=>e(!0),_errorSteps:n})}))}if(w(e,s._closedPromise,e=>(i?E(!0,e):T(()=>cn(n,e),!0,e),null)),w(n,u._closedPromise,t=>(a?E(!0,t):T(()=>Q(e,t),!0,t),null)),ee(e,s._closedPromise,()=>(r?E():T(()=>En(u)),null)),G(n)||n._state===`closed`){let t=TypeError(`the destination writable stream closed before all data could be piped to it`);a?E(!0,t):T(()=>Q(e,t),!0,t)}g(x());function C(){let e=_;return d(_,()=>e===_?void 0:C())}function w(e,t,n){e._state===`errored`?n(e._storedError):m(t,n)}function ee(e,t,n){e._state===`closed`?n():p(t,n)}function T(e,t,r){if(h)return;h=!0,n._state===`writable`&&!G(n)?p(C(),i):i();function i(){return f(e(),()=>D(t,r),e=>D(!0,e)),null}}function E(e,t){h||(h=!0,n._state===`writable`&&!G(n)?p(C(),()=>D(e,t)):D(e,t))}function D(e,t){return An(u),O(s),o!==void 0&&o.removeEventListener(`abort`,b),e?y(t):v(void 0),null}})}class q{constructor(){throw TypeError(`Illegal constructor`)}get desiredSize(){if(!vr(this))throw kr(`desiredSize`);return wr(this)}close(){if(!vr(this))throw kr(`close`);if(!Er(this))throw TypeError(`The stream is not in a state that permits close`);Sr(this)}enqueue(e=void 0){if(!vr(this))throw kr(`enqueue`);if(!Er(this))throw TypeError(`The stream is not in a state that permits enqueue`);return Cr(this,e)}error(e=void 0){if(!vr(this))throw kr(`error`);J(this,e)}[w](e){L(this);let t=this._cancelAlgorithm(e);return xr(this),t}[ee](e){let t=this._controlledReadableStream;if(this._queue.length>0){let n=Ke(this);this._closeRequested&&this._queue.length===0?(xr(this),Yr(t)):yr(this),e._chunkSteps(n)}else _e(t,e),yr(this)}[T](){}}Object.defineProperties(q.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(q.prototype.close,`close`),i(q.prototype.enqueue,`enqueue`),i(q.prototype.error,`error`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(q.prototype,Symbol.toStringTag,{value:`ReadableStreamDefaultController`,configurable:!0});function vr(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_controlledReadableStream`)?!1:e instanceof q}function yr(e){if(br(e)){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0,f(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,yr(e)),null),t=>(J(e,t),null))}}function br(e){let t=e._controlledReadableStream;return!Er(e)||!e._started?!1:!!(Z(t)&&ye(t)>0||wr(e)>0)}function xr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Sr(e){if(!Er(e))return;let t=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(xr(e),Yr(t))}function Cr(e,t){if(!Er(e))return;let n=e._controlledReadableStream;if(Z(n)&&ye(n)>0)ve(n,t,!1);else{let n;try{n=e._strategySizeAlgorithm(t)}catch(t){throw J(e,t),t}try{qe(e,t,n)}catch(t){throw J(e,t),t}}yr(e)}function J(e,t){let n=e._controlledReadableStream;n._state===`readable`&&(L(e),xr(e),Xr(n,t))}function wr(e){let t=e._controlledReadableStream._state;return t===`errored`?null:t===`closed`?0:e._strategyHWM-e._queueTotalSize}function Tr(e){return!br(e)}function Er(e){let t=e._controlledReadableStream._state;return!e._closeRequested&&t===`readable`}function Dr(e,t,n,r,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,L(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=r,t._cancelAlgorithm=i,e._readableStreamController=t,f(l(n()),()=>(t._started=!0,yr(t),null),e=>(J(t,e),null))}function Or(e,t,n,r){let i=Object.create(q.prototype),a,o,s;a=t.start===void 0?()=>void 0:()=>t.start(i),o=t.pull===void 0?()=>l(void 0):()=>t.pull(i),s=t.cancel===void 0?()=>l(void 0):e=>t.cancel(e),Dr(e,i,a,o,s,n,r)}function kr(e){return TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function Ar(e,t){return z(e._readableStreamController)?Mr(e):jr(e)}function jr(e,t){let n=ge(e),r=!1,i=!1,a=!1,o=!1,s,u,d,f,p,h=c(e=>{p=e});function g(){return r?(i=!0,l(void 0)):(r=!0,xe(n,{_chunkSteps:e=>{_(()=>{i=!1;let t=e,n=e;a||Cr(d._readableStreamController,t),o||Cr(f._readableStreamController,n),r=!1,i&&g()})},_closeSteps:()=>{r=!1,a||Sr(d._readableStreamController),o||Sr(f._readableStreamController),(!a||!o)&&p(void 0)},_errorSteps:()=>{r=!1}}),l(void 0))}function v(t){if(a=!0,s=t,o){let t=Q(e,Me([s,u]));p(t)}return h}function y(t){if(o=!0,u=t,a){let t=Q(e,Me([s,u]));p(t)}return h}function b(){}return d=Kr(b,g,v),f=Kr(b,g,y),m(n._closedPromise,e=>(J(d._readableStreamController,e),J(f._readableStreamController,e),(!a||!o)&&p(void 0),null)),[d,f]}function Mr(e){let t=ge(e),n=!1,r=!1,i=!1,a=!1,o=!1,s,u,d,f,p,h=c(e=>{p=e});function g(e){m(e._closedPromise,n=>e===t?(V(d._readableStreamController,n),V(f._readableStreamController,n),(!a||!o)&&p(void 0),null):null)}function v(){U(t)&&(O(t),t=ge(e),g(t)),xe(t,{_chunkSteps:t=>{_(()=>{r=!1,i=!1;let s=t,c=t;if(!a&&!o)try{c=Ge(t)}catch(t){V(d._readableStreamController,t),V(f._readableStreamController,t),p(Q(e,t));return}a||bt(d._readableStreamController,s),o||bt(f._readableStreamController,c),n=!1,r?b():i&&x()})},_closeSteps:()=>{n=!1,a||yt(d._readableStreamController),o||yt(f._readableStreamController),d._readableStreamController._pendingPullIntos.length>0&&wt(d._readableStreamController,0),f._readableStreamController._pendingPullIntos.length>0&&wt(f._readableStreamController,0),(!a||!o)&&p(void 0)},_errorSteps:()=>{n=!1}})}function y(s,c){I(t)&&(O(t),t=Pt(e),g(t));let l=c?f:d,u=c?d:f;zt(t,s,1,{_chunkSteps:t=>{_(()=>{r=!1,i=!1;let s=c?o:a;if(c?a:o)s||Tt(l._readableStreamController,t);else{let n;try{n=Ge(t)}catch(t){V(l._readableStreamController,t),V(u._readableStreamController,t),p(Q(e,t));return}s||Tt(l._readableStreamController,t),bt(u._readableStreamController,n)}n=!1,r?b():i&&x()})},_closeSteps:e=>{n=!1;let t=c?o:a,r=c?a:o;t||yt(l._readableStreamController),r||yt(u._readableStreamController),e!==void 0&&(t||Tt(l._readableStreamController,e),!r&&u._readableStreamController._pendingPullIntos.length>0&&wt(u._readableStreamController,0)),(!t||!r)&&p(void 0)},_errorSteps:()=>{n=!1}})}function b(){if(n)return r=!0,l(void 0);n=!0;let e=St(d._readableStreamController);return e===null?v():y(e._view,!1),l(void 0)}function x(){if(n)return i=!0,l(void 0);n=!0;let e=St(f._readableStreamController);return e===null?v():y(e._view,!0),l(void 0)}function S(t){if(a=!0,s=t,o){let t=Q(e,Me([s,u]));p(t)}return h}function C(t){if(o=!0,u=t,a){let t=Q(e,Me([s,u]));p(t)}return h}function w(){}return d=qr(w,b,S),f=qr(w,x,C),g(t),[d,f]}function Nr(e){return n(e)&&e.getReader!==void 0}function Pr(e){return Nr(e)?Ir(e.getReader()):Fr(e)}function Fr(e){let r,i=Be(e,`async`),a=t;function o(){let e;try{e=Ve(i)}catch(e){return u(e)}return h(l(e),e=>{if(!n(e))throw TypeError(`The promise returned by the iterator.next() method must fulfill with an object`);if(He(e))Sr(r._readableStreamController);else{let t=Ue(e);Cr(r._readableStreamController,t)}})}function s(e){let t=i.iterator,r;try{r=Le(t,`return`)}catch(e){return u(e)}if(r===void 0)return l(void 0);let a;try{a=v(r,t,[e])}catch(e){return u(e)}return h(l(a),e=>{if(!n(e))throw TypeError(`The promise returned by the iterator.return() method must fulfill with an object`)})}return r=Kr(a,o,s,0),r}function Ir(e){let r,i=t;function a(){let t;try{t=e.read()}catch(e){return u(e)}return h(t,e=>{if(!n(e))throw TypeError(`The promise returned by the reader.read() method must fulfill with an object`);if(e.done)Sr(r._readableStreamController);else{let t=e.value;Cr(r._readableStreamController,t)}})}function o(t){try{return l(e.cancel(t))}catch(e){return u(e)}}return r=Kr(i,a,o,0),r}function Lr(e,t){M(e,t);let n=e,r=n?.autoAllocateChunkSize,i=n?.cancel,a=n?.pull,o=n?.start,s=n?.type;return{autoAllocateChunkSize:r===void 0?void 0:me(r,`${t} has member 'autoAllocateChunkSize' that`),cancel:i===void 0?void 0:Rr(i,n,`${t} has member 'cancel' that`),pull:a===void 0?void 0:zr(a,n,`${t} has member 'pull' that`),start:o===void 0?void 0:Br(o,n,`${t} has member 'start' that`),type:s===void 0?void 0:Vr(s,`${t} has member 'type' that`)}}function Rr(e,t,n){return N(e,n),n=>y(e,t,[n])}function zr(e,t,n){return N(e,n),n=>y(e,t,[n])}function Br(e,t,n){return N(e,n),n=>v(e,t,[n])}function Vr(e,t){if(e=`${e}`,e!==`bytes`)throw TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function Hr(e,t){return M(e,t),{preventCancel:!!e?.preventCancel}}function Ur(e,t){M(e,t);let n=e?.preventAbort,r=e?.preventCancel,i=e?.preventClose,a=e?.signal;return a!==void 0&&Wr(a,`${t} has member 'signal' that`),{preventAbort:!!n,preventCancel:!!r,preventClose:!!i,signal:a}}function Wr(e,t){if(!$t(e))throw TypeError(`${t} is not an AbortSignal.`)}function Gr(e,t){M(e,t);let n=e?.readable;ue(n,`readable`,`ReadableWritablePair`),he(n,`${t} has member 'readable' that`);let r=e?.writable;return ue(r,`writable`,`ReadableWritablePair`),Qt(r,`${t} has member 'writable' that`),{readable:n,writable:r}}class Y{constructor(e={},t={}){e===void 0?e=null:le(e,`First parameter`);let n=Gt(t,`Second parameter`),r=Lr(e,`First parameter`);if(Jr(this),r.type===`bytes`){if(n.size!==void 0)throw RangeError(`The strategy for a byte stream cannot have a size function`);let e=Ut(n,0);Dt(this,r,e)}else{let e=Wt(n),t=Ut(n,1);Or(this,r,t,e)}}get locked(){if(!X(this))throw Zr(`locked`);return Z(this)}cancel(e=void 0){return X(this)?Z(this)?u(TypeError(`Cannot cancel a stream that already has a reader`)):Q(this,e):u(Zr(`cancel`))}getReader(e=void 0){if(!X(this))throw Zr(`getReader`);return jt(e,`First parameter`).mode===void 0?ge(this):Pt(this)}pipeThrough(e,t={}){if(!X(this))throw Zr(`pipeThrough`);P(e,1,`pipeThrough`);let n=Gr(e,`First parameter`),r=Ur(t,`Second parameter`);if(Z(this))throw TypeError(`ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream`);if(sn(n.writable))throw TypeError(`ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream`);return g(_r(this,n.writable,r.preventClose,r.preventAbort,r.preventCancel,r.signal)),n.readable}pipeTo(e,t={}){if(!X(this))return u(Zr(`pipeTo`));if(e===void 0)return u(`Parameter 1 is required in 'pipeTo'.`);if(!on(e))return u(TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`));let n;try{n=Ur(t,`Second parameter`)}catch(e){return u(e)}return Z(this)?u(TypeError(`ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream`)):sn(e)?u(TypeError(`ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream`)):_r(this,e,n.preventClose,n.preventAbort,n.preventCancel,n.signal)}tee(){if(!X(this))throw Zr(`tee`);return Me(Ar(this))}values(e=void 0){if(!X(this))throw Zr(`values`);let t=Hr(e,`First parameter`);return Oe(this,t.preventCancel)}[ze](e){return this.values(e)}static from(e){return Pr(e)}}Object.defineProperties(Y,{from:{enumerable:!0}}),Object.defineProperties(Y.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(Y.from,`from`),i(Y.prototype.cancel,`cancel`),i(Y.prototype.getReader,`getReader`),i(Y.prototype.pipeThrough,`pipeThrough`),i(Y.prototype.pipeTo,`pipeTo`),i(Y.prototype.tee,`tee`),i(Y.prototype.values,`values`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Y.prototype,Symbol.toStringTag,{value:`ReadableStream`,configurable:!0}),Object.defineProperty(Y.prototype,ze,{value:Y.prototype.values,writable:!0,configurable:!0});function Kr(e,t,n,r=1,i=()=>1){let a=Object.create(Y.prototype);return Jr(a),Dr(a,Object.create(q.prototype),e,t,n,r,i),a}function qr(e,t,n){let r=Object.create(Y.prototype);return Jr(r),Et(r,Object.create(R.prototype),e,t,n,0,void 0),r}function Jr(e){e._state=`readable`,e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function X(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_readableStreamController`)?!1:e instanceof Y}function Z(e){return e._reader!==void 0}function Q(e,n){if(e._disturbed=!0,e._state===`closed`)return l(void 0);if(e._state===`errored`)return u(e._storedError);Yr(e);let r=e._reader;if(r!==void 0&&U(r)){let e=r._readIntoRequests;r._readIntoRequests=new x,e.forEach(e=>{e._closeSteps(void 0)})}return h(e._readableStreamController[w](n),t)}function Yr(e){e._state=`closed`;let t=e._reader;if(t!==void 0&&(ae(t),I(t))){let e=t._readRequests;t._readRequests=new x,e.forEach(e=>{e._closeSteps()})}}function Xr(e,t){e._state=`errored`,e._storedError=t;let n=e._reader;n!==void 0&&(re(n,t),I(n)?Ce(n,t):Vt(n,t))}function Zr(e){return TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Qr(e,t){M(e,t);let n=e?.highWaterMark;return ue(n,`highWaterMark`,`QueuingStrategyInit`),{highWaterMark:de(n)}}let $r=e=>e.byteLength;i($r,`size`);class ei{constructor(e){P(e,1,`ByteLengthQueuingStrategy`),e=Qr(e,`First parameter`),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!ni(this))throw ti(`highWaterMark`);return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!ni(this))throw ti(`size`);return $r}}Object.defineProperties(ei.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(ei.prototype,Symbol.toStringTag,{value:`ByteLengthQueuingStrategy`,configurable:!0});function ti(e){return TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function ni(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_byteLengthQueuingStrategyHighWaterMark`)?!1:e instanceof ei}let ri=()=>1;i(ri,`size`);class ii{constructor(e){P(e,1,`CountQueuingStrategy`),e=Qr(e,`First parameter`),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!oi(this))throw ai(`highWaterMark`);return this._countQueuingStrategyHighWaterMark}get size(){if(!oi(this))throw ai(`size`);return ri}}Object.defineProperties(ii.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(ii.prototype,Symbol.toStringTag,{value:`CountQueuingStrategy`,configurable:!0});function ai(e){return TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function oi(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_countQueuingStrategyHighWaterMark`)?!1:e instanceof ii}function si(e,t){M(e,t);let n=e?.cancel,r=e?.flush,i=e?.readableType,a=e?.start,o=e?.transform,s=e?.writableType;return{cancel:n===void 0?void 0:di(n,e,`${t} has member 'cancel' that`),flush:r===void 0?void 0:ci(r,e,`${t} has member 'flush' that`),readableType:i,start:a===void 0?void 0:li(a,e,`${t} has member 'start' that`),transform:o===void 0?void 0:ui(o,e,`${t} has member 'transform' that`),writableType:s}}function ci(e,t,n){return N(e,n),n=>y(e,t,[n])}function li(e,t,n){return N(e,n),n=>v(e,t,[n])}function ui(e,t,n){return N(e,n),(n,r)=>y(e,t,[n,r])}function di(e,t,n){return N(e,n),n=>y(e,t,[n])}class fi{constructor(e={},t={},n={}){e===void 0&&(e=null);let r=Gt(t,`Second parameter`),i=Gt(n,`Third parameter`),a=si(e,`First parameter`);if(a.readableType!==void 0)throw RangeError(`Invalid readableType specified`);if(a.writableType!==void 0)throw RangeError(`Invalid writableType specified`);let o=Ut(i,0),s=Wt(i),l=Ut(r,1),u=Wt(r),d,f=c(e=>{d=e});pi(this,f,l,u,o,s),xi(this,a),a.start===void 0?d(void 0):d(a.start(this._transformStreamController))}get readable(){if(!mi(this))throw Fi(`readable`);return this._readable}get writable(){if(!mi(this))throw Fi(`writable`);return this._writable}}Object.defineProperties(fi.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(fi.prototype,Symbol.toStringTag,{value:`TransformStream`,configurable:!0});function pi(e,t,n,r,i,a){function o(){return t}function s(t){return Di(e,t)}function c(t){return Oi(e,t)}function l(){return ki(e)}e._writable=rn(o,s,l,c,n,r);function u(){return Ai(e)}function d(t){return ji(e,t)}e._readable=Kr(o,u,d,i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,vi(e,!0),e._transformStreamController=void 0}function mi(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_transformStreamController`)?!1:e instanceof fi}function hi(e,t){J(e._readable._readableStreamController,t),gi(e,t)}function gi(e,t){Si(e._transformStreamController),Un(e._writable._writableStreamController,t),_i(e)}function _i(e){e._backpressure&&vi(e,!1)}function vi(e,t){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=c(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=t}class ${constructor(){throw TypeError(`Illegal constructor`)}get desiredSize(){if(!yi(this))throw Mi(`desiredSize`);let e=this._controlledTransformStream._readable._readableStreamController;return wr(e)}enqueue(e=void 0){if(!yi(this))throw Mi(`enqueue`);Ci(this,e)}error(e=void 0){if(!yi(this))throw Mi(`error`);wi(this,e)}terminate(){if(!yi(this))throw Mi(`terminate`);Ei(this)}}Object.defineProperties($.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i($.prototype.enqueue,`enqueue`),i($.prototype.error,`error`),i($.prototype.terminate,`terminate`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty($.prototype,Symbol.toStringTag,{value:`TransformStreamDefaultController`,configurable:!0});function yi(e){return!n(e)||!Object.prototype.hasOwnProperty.call(e,`_controlledTransformStream`)?!1:e instanceof $}function bi(e,t,n,r,i){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=n,t._flushAlgorithm=r,t._cancelAlgorithm=i,t._finishPromise=void 0,t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0}function xi(e,t){let n=Object.create($.prototype),r,i,a;r=t.transform===void 0?e=>{try{return Ci(n,e),l(void 0)}catch(e){return u(e)}}:e=>t.transform(e,n),i=t.flush===void 0?()=>l(void 0):()=>t.flush(n),a=t.cancel===void 0?()=>l(void 0):e=>t.cancel(e),bi(e,n,r,i,a)}function Si(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function Ci(e,t){let n=e._controlledTransformStream,r=n._readable._readableStreamController;if(!Er(r))throw TypeError(`Readable side is not in a state that permits enqueue`);try{Cr(r,t)}catch(e){throw gi(n,e),n._readable._storedError}Tr(r)!==n._backpressure&&vi(n,!0)}function wi(e,t){hi(e._controlledTransformStream,t)}function Ti(e,t){return h(e._transformAlgorithm(t),void 0,t=>{throw hi(e._controlledTransformStream,t),t})}function Ei(e){let t=e._controlledTransformStream,n=t._readable._readableStreamController;Sr(n),gi(t,TypeError(`TransformStream terminated`))}function Di(e,t){let n=e._transformStreamController;if(e._backpressure){let r=e._backpressureChangePromise;return h(r,()=>{let r=e._writable;if(r._state===`erroring`)throw r._storedError;return Ti(n,t)})}return Ti(n,t)}function Oi(e,t){let n=e._transformStreamController;if(n._finishPromise!==void 0)return n._finishPromise;let r=e._readable;n._finishPromise=c((e,t)=>{n._finishPromise_resolve=e,n._finishPromise_reject=t});let i=n._cancelAlgorithm(t);return Si(n),f(i,()=>(r._state===`errored`?Pi(n,r._storedError):(J(r._readableStreamController,t),Ni(n)),null),e=>(J(r._readableStreamController,e),Pi(n,e),null)),n._finishPromise}function ki(e){let t=e._transformStreamController;if(t._finishPromise!==void 0)return t._finishPromise;let n=e._readable;t._finishPromise=c((e,n)=>{t._finishPromise_resolve=e,t._finishPromise_reject=n});let r=t._flushAlgorithm();return Si(t),f(r,()=>(n._state===`errored`?Pi(t,n._storedError):(Sr(n._readableStreamController),Ni(t)),null),e=>(J(n._readableStreamController,e),Pi(t,e),null)),t._finishPromise}function Ai(e){return vi(e,!1),e._backpressureChangePromise}function ji(e,t){let n=e._transformStreamController;if(n._finishPromise!==void 0)return n._finishPromise;let r=e._writable;n._finishPromise=c((e,t)=>{n._finishPromise_resolve=e,n._finishPromise_reject=t});let i=n._cancelAlgorithm(t);return Si(n),f(i,()=>(r._state===`errored`?Pi(n,r._storedError):(Un(r._writableStreamController,t),_i(e),Ni(n)),null),t=>(Un(r._writableStreamController,t),_i(e),Pi(n,t),null)),n._finishPromise}function Mi(e){return TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Ni(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Pi(e,t){e._finishPromise_reject!==void 0&&(g(e._finishPromise),e._finishPromise_reject(t),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function Fi(e){return TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}e.ByteLengthQueuingStrategy=ei,e.CountQueuingStrategy=ii,e.ReadableByteStreamController=R,e.ReadableStream=Y,e.ReadableStreamBYOBReader=H,e.ReadableStreamBYOBRequest=Qe,e.ReadableStreamDefaultController=q,e.ReadableStreamDefaultReader=F,e.TransformStream=fi,e.TransformStreamDefaultController=$,e.WritableStream=W,e.WritableStreamDefaultController=Nn,e.WritableStreamDefaultWriter=K}))})),d=n((()=>{if(!globalThis.ReadableStream)try{let t=e(`node:process`),{emitWarning:n}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,e(`node:stream/web`)),t.emitWarning=n}catch(e){throw t.emitWarning=n,e}}catch{Object.assign(globalThis,u())}try{let{Blob:t}=e(`buffer`);t&&!t.prototype.stream&&(t.prototype.stream=function(e){let t=0,n=this;return new ReadableStream({type:`bytes`,async pull(e){let r=await n.slice(t,Math.min(n.size,t+65536)).arrayBuffer();t+=r.byteLength,e.enqueue(new Uint8Array(r)),t===n.size&&e.close()}})})}catch{}}));async function*f(e,t=!0){for(let n of e)if(`stream`in n)yield*n.stream();else if(ArrayBuffer.isView(n))if(t){let e=n.byteOffset,t=n.byteOffset+n.byteLength;for(;e!==t;){let r=Math.min(t-e,y),i=n.buffer.slice(e,e+r);e+=i.byteLength,yield new Uint8Array(i)}}else yield n;else{let e=0,t=n;for(;e!==t.size;){let n=await t.slice(e,Math.min(t.size,e+y)).arrayBuffer();e+=n.byteLength,yield new Uint8Array(n)}}}var p,m,h,g,_,v,y,b,x,S=t((()=>{d(),r(),i(),a(),y=65536,b=(p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=Symbol.toStringTag,v=Symbol.hasInstance,class e{constructor(t=[],n={}){if(s(this,p,[]),s(this,m,``),s(this,h,0),s(this,g,`transparent`),typeof t!=`object`||!t)throw TypeError(`Failed to construct 'Blob': The provided value cannot be converted to a sequence.`);if(typeof t[Symbol.iterator]!=`function`)throw TypeError(`Failed to construct 'Blob': The object must have a callable @@iterator property.`);if(typeof n!=`object`&&typeof n!=`function`)throw TypeError(`Failed to construct 'Blob': parameter 2 cannot convert to dictionary.`);n===null&&(n={});let r=new TextEncoder;for(let n of t){let t;t=ArrayBuffer.isView(n)?new Uint8Array(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)):n instanceof ArrayBuffer?new Uint8Array(n.slice(0)):n instanceof e?n:r.encode(`${n}`),c(h,this,o(h,this)+(ArrayBuffer.isView(t)?t.byteLength:t.size)),o(p,this).push(t)}c(g,this,`${n.endings===void 0?`transparent`:n.endings}`);let i=n.type===void 0?``:String(n.type);c(m,this,/^[\x20-\x7E]*$/.test(i)?i:``)}get size(){return o(h,this)}get type(){return o(m,this)}async text(){let e=new TextDecoder,t=``;for await(let n of f(o(p,this),!1))t+=e.decode(n,{stream:!0});return t+=e.decode(),t}async arrayBuffer(){let e=new Uint8Array(this.size),t=0;for await(let n of f(o(p,this),!1))e.set(n,t),t+=n.length;return e.buffer}stream(){let e=f(o(p,this),!0);return new globalThis.ReadableStream({type:`bytes`,async pull(t){let n=await e.next();n.done?t.close():t.enqueue(n.value)},async cancel(){await e.return()}})}slice(t=0,n=this.size,r=``){let{size:i}=this,a=t<0?Math.max(i+t,0):Math.min(t,i),s=n<0?Math.max(i+n,0):Math.min(n,i),l=Math.max(s-a,0),u=o(p,this),d=[],f=0;for(let e of u){if(f>=l)break;let t=ArrayBuffer.isView(e)?e.byteLength:e.size;if(a&&t<=a)a-=t,s-=t;else{let n;ArrayBuffer.isView(e)?(n=e.subarray(a,Math.min(t,s)),f+=n.byteLength):(n=e.slice(a,Math.min(t,s)),f+=n.size),s-=t,d.push(n),a=0}}let m=new e([],{type:String(r).toLowerCase()});return c(h,m,l),c(p,m,d),m}get[_](){return`Blob`}static[v](e){return e&&typeof e==`object`&&typeof e.constructor==`function`&&(typeof e.stream==`function`||typeof e.arrayBuffer==`function`)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}}),Object.defineProperties(b.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),x=b})),C,w,ee,T,E,D,O=t((()=>{S(),r(),a(),i(),E=(C=new WeakMap,w=new WeakMap,ee=Symbol.toStringTag,T=Symbol.hasInstance,class extends x{constructor(e,t,n={}){if(arguments.length<2)throw TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,n),s(this,C,0),s(this,w,``),n===null&&(n={});let r=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(r)||c(C,this,r),c(w,this,String(t))}get name(){return o(w,this)}get lastModified(){return o(C,this)}get[ee](){return`File`}static[T](e){return!!e&&e instanceof x&&/^(File)$/.test(e[Symbol.toStringTag])}}),D=E}));function te(e,t=x){var n=`${ie()}${ie()}`.replace(/\./g,``).slice(-28).padStart(32,`-`),r=[],i=`--${n}\r\nContent-Disposition: form-data; name="`;return e.forEach((e,t)=>typeof e==`string`?r.push(i+se(t)+`"\r\n\r\n${e.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
2
+ `)}\r\n`):r.push(i+se(t)+`"; filename="${se(e.name,1)}"\r\nContent-Type: ${e.type||`application/octet-stream`}\r\n\r\n`,e,`\r
3
+ `)),r.push(`--${n}--`),new t(r,{type:`multipart/form-data; boundary=`+n})}var k,A,ne,re,ie,ae,oe,se,j,M,N=t((()=>{S(),O(),r(),i(),a(),{toStringTag:A,iterator:ne,hasInstance:re}=Symbol,ie=Math.random,ae=`append,set,get,getAll,delete,keys,values,entries,forEach,constructor`.split(`,`),oe=(e,t,n)=>(e+=``,/^(Blob|File)$/.test(t&&t[A])?[(n=n===void 0?t[A]==`File`?t.name:`blob`:n+``,e),t.name!==n||t[A]==`blob`?new D([t],n,t):t]:[e,t+``]),se=(e,t)=>(t?e:e.replace(/\r?\n|\r/g,`\r
4
+ `)).replace(/\n/g,`%0A`).replace(/\r/g,`%0D`).replace(/"/g,`%22`),j=(e,t,n)=>{if(t.length<n)throw TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${t.length} present.`)},M=(k=new WeakMap,class{constructor(...e){if(s(this,k,[]),e.length)throw TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`)}get[A](){return`FormData`}[ne](){return this.entries()}static[re](e){return e&&typeof e==`object`&&e[A]===`FormData`&&!ae.some(t=>typeof e[t]!=`function`)}append(...e){j(`append`,arguments,2),o(k,this).push(oe(...e))}delete(e){j(`delete`,arguments,1),e+=``,c(k,this,o(k,this).filter(([t])=>t!==e))}get(e){j(`get`,arguments,1),e+=``;for(var t=o(k,this),n=t.length,r=0;r<n;r++)if(t[r][0]===e)return t[r][1];return null}getAll(e,t){return j(`getAll`,arguments,1),t=[],e+=``,o(k,this).forEach(n=>n[0]===e&&t.push(n[1])),t}has(e){return j(`has`,arguments,1),e+=``,o(k,this).some(t=>t[0]===e)}forEach(e,t){j(`forEach`,arguments,1);for(var[n,r]of this)e.call(t,r,n,this)}set(...e){j(`set`,arguments,2);var t=[],n=!0;e=oe(...e),o(k,this).forEach(r=>{r[0]===e[0]?n&&(n=!t.push(e)):t.push(r)}),n&&t.push(e),c(k,this,t)}*entries(){yield*o(k,this)}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}})})),ce=n(((t,n)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=e(`worker_threads`),n=new t().port1,r=new ArrayBuffer;n.postMessage(r,[r,r])}catch(e){e.constructor.name===`DOMException`&&(globalThis.DOMException=e.constructor)}n.exports=globalThis.DOMException})),le,P=t((()=>{ce(),O(),S(),{stat:le}=l}));export{D as a,S as c,N as i,M as n,O as o,te as r,x as s,P as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Jo as t,Ko as n,at as r,ct as i,fo as a,zo as o}from"./loadAgentsDir-nzr38hai.js";import{U as s,l as c,p as l,z as u}from"./debug-IKW-jE7K.js";import{a as d,l as f}from"./proxy-Cn2YwITp.js";import{$ as p,J as m,K as h,P as g,Y as _,Z as v,nt as y}from"./rcDebugLog-BUuD-X1D.js";import{n as b,r as x}from"./SSETransport-BXiEBMpb.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: ${u(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: ${u(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),s(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,r,o,s,c,u){try{let a=y(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}=v(d,r),x=_(f),C=m(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[p]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:n([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((()=>{r(),c(),o(),O(),g()}))();export{k as queryModelGemini};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Al as t,Do as n,Ml as r,So as i,kl as a,zo as o}from"./loadAgentsDir-nzr38hai.js";import{Y as s,l as c,nt as l,p as u}from"./debug-IKW-jE7K.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-Da4KNbjm.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let t=a();if(!t)return u(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let o=new AbortController;e.addEventListener(`abort`,()=>o.abort(),{once:!0});try{let{messages:a}=await r({promptMessages:[i({content:await d()})],cacheSafeParams:t,canUseTool:async()=>({behavior:`deny`,message:`Recap cannot use tools`,decisionReason:{type:`other`,reason:`away_summary`}}),overrides:{abortController:o},querySource:`away_summary`,forkLabel:`away_summary`,maxTurns:1,skipCacheWrite:!0,skipTranscript:!0});if(e.aborted)return{kind:`aborted`};let s=a.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(s)return{kind:`api-error`,text:n(s)??``};let c=a.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!c)return{kind:`failed`};let l=n(c);return!l||l.trim().length===0?{kind:`failed`}:{kind:`ok`,text:l.trim()}}catch(t){return t instanceof l||e.aborted||o.signal.aborted?{kind:`aborted`}:(u(`[recap] generation failed: ${t}`),{kind:`failed`})}}var p,m;e((()=>{s(),c(),t(),o(),p=`The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences, no markdown. Lead with the overall goal and current task, then the one next action. Skip root-cause narrative, fix internals, secondary to-dos, and em-dash tangents.`,m=`用户离开后回来了。用中文写 1-2 句话,不超过 60 字,无 markdown。先说明高层目标和当前任务,再说明下一步操作。跳过根因分析和次要待办。`}))();export{f as generateRecap};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{To as t,dT as n,et as r,tt as i,zo as a}from"./loadAgentsDir-nzr38hai.js";import{U as o,l as s,p as c,z as l}from"./debug-IKW-jE7K.js";import{s as u,u as d}from"./types-a7X-tJpJ.js";import{st as f}from"./rcDebugLog-BUuD-X1D.js";import{r as p,t as m}from"./sessionTitle-B8jcexkQ.js";async function h(e,n){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:n,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),a=d(Array.isArray(e.message.content)?t(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: ${l(e)}`,{level:`error`}),null}}var g=e((()=>{r(),s(),o(),u(),a(),p(),n()}));export{g as n,h as t};
@@ -0,0 +1,23 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,n,r}from"./execFileNoThrow-COKYqVQj.js";function i(e){if(e<=1)return!1;try{return process.kill(e,0),!0}catch{return!1}}async function a(e,t=10){if(process.platform===`win32`){let r=await n(`powershell.exe`,[`-NoProfile`,`-Command`,`
2
+ $pid = ${String(e)}
3
+ $ancestors = @()
4
+ for ($i = 0; $i -lt ${t}; $i++) {
5
+ $proc = Get-CimInstance Win32_Process -Filter "ProcessId=$pid" -ErrorAction SilentlyContinue
6
+ if (-not $proc -or -not $proc.ParentProcessId -or $proc.ParentProcessId -eq 0) { break }
7
+ $pid = $proc.ParentProcessId
8
+ $ancestors += $pid
9
+ }
10
+ $ancestors -join ','
11
+ `.trim()],{timeout:3e3});return r.code!==0||!r.stdout?.trim()?[]:r.stdout.trim().split(`,`).filter(Boolean).map(e=>parseInt(e,10)).filter(e=>!isNaN(e))}let r=await n(`sh`,[`-c`,`pid=${String(e)}; for i in $(seq 1 ${t}); do ppid=$(ps -o ppid= -p $pid 2>/dev/null | tr -d ' '); if [ -z "$ppid" ] || [ "$ppid" = "0" ] || [ "$ppid" = "1" ]; then break; fi; echo $ppid; pid=$ppid; done`],{timeout:3e3});return r.code!==0||!r.stdout?.trim()?[]:r.stdout.trim().split(`
12
+ `).filter(Boolean).map(e=>parseInt(e,10)).filter(e=>!isNaN(e))}function o(e){try{let n=String(e),r=t(process.platform===`win32`?`powershell.exe -NoProfile -Command "(Get-CimInstance Win32_Process -Filter \\"ProcessId=${n}\\").CommandLine"`:`ps -o command= -p ${n}`,{timeout:1e3});return r?r.trim():null}catch{return null}}async function s(e,t=10){if(process.platform===`win32`){let r=await n(`powershell.exe`,[`-NoProfile`,`-Command`,`
13
+ $currentPid = ${String(e)}
14
+ $commands = @()
15
+ for ($i = 0; $i -lt ${t}; $i++) {
16
+ $proc = Get-CimInstance Win32_Process -Filter "ProcessId=$currentPid" -ErrorAction SilentlyContinue
17
+ if (-not $proc) { break }
18
+ if ($proc.CommandLine) { $commands += $proc.CommandLine }
19
+ if (-not $proc.ParentProcessId -or $proc.ParentProcessId -eq 0) { break }
20
+ $currentPid = $proc.ParentProcessId
21
+ }
22
+ $commands -join [char]0
23
+ `.trim()],{timeout:3e3});return r.code!==0||!r.stdout?.trim()?[]:r.stdout.split(`\0`).filter(Boolean)}let r=await n(`sh`,[`-c`,`currentpid=${String(e)}; for i in $(seq 1 ${t}); do cmd=$(ps -o command= -p $currentpid 2>/dev/null); if [ -n "$cmd" ]; then printf '%s\\0' "$cmd"; fi; ppid=$(ps -o ppid= -p $currentpid 2>/dev/null | tr -d ' '); if [ -z "$ppid" ] || [ "$ppid" = "0" ] || [ "$ppid" = "1" ]; then break; fi; currentpid=$ppid; done`],{timeout:3e3});return r.code!==0||!r.stdout?.trim()?[]:r.stdout.split(`\0`).filter(Boolean)}var c=e((()=>{r()}));export{i as a,c as i,a as n,o as r,s as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{n as r,t as i}from"./execAsync-Bv2yxuGe.js";import{promises as a}from"fs";async function o(){try{return(await a.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){n.debug(`error reading machine id: ${e}`)}try{return(await i(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{r(),t()}))();export{o as getMachineId};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{n as r,t as i}from"./execAsync-Bv2yxuGe.js";async function a(){try{let e=(await i(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
2
+ `).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{r(),t()}))();export{a as getMachineId};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{promises as r}from"fs";async function i(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await r.readFile(e,{encoding:`utf8`})).trim()}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{t()}))();export{i as getMachineId};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";async function r(){n.debug(`could not read machine-id: unsupported platform`)}e((()=>{t()}))();export{r as getMachineId};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{n as r,t as i}from"./execAsync-Bv2yxuGe.js";import*as a from"process";async function o(){let e=`%windir%\\System32\\REG.exe`;a.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in a.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await i(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{r(),t()}))();export{o as getMachineId};
@@ -0,0 +1 @@
1
+ import{_ as e,a as t,i as n,p as r,r as i}from"./git-tyaWOgRL.js";e();export{i as findGitRoot,n as getBranch,t as getDefaultBranch,r as getRemoteUrl};
@@ -0,0 +1,6 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{br as a,en as o}from"./state-4KQ3kaqz.js";import{n as s,t as c}from"./cwd-BuJhkTrc.js";import{E as ee,O as te,_ as l,h as u,l as ne,ot as re,st as ie}from"./debug-IKW-jE7K.js";import{r as ae,t as d}from"./execFileNoThrow-COKYqVQj.js";import{o as oe}from"./log-B3eB4EFv.js";import{n as f,t as se}from"./memoize-BO31Ws9Q.js";import{r as ce,t as le}from"./which-BBCjXfI2.js";import{basename as ue,dirname as p,join as m,resolve as h,sep as de}from"path";import{readFileSync as g,realpathSync as _,statSync as v,unwatchFile as y,watchFile as fe}from"fs";import{createHash as pe}from"crypto";import{readFile as b,readdir as me,stat as he}from"fs/promises";function x(e,t,n){let r=ge();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=u(),o=te(i)+`
2
+ `;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(p(r)),a.appendFileSync(r,o)}catch{}}}function ge(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function _e(e,t,n){let r=Date.now();x(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return x(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw x(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var S=e((()=>{l(),ee()}));async function C(e,t,n,r){try{return ve(await b(m(e,`config`),`utf-8`),t,n,r)}catch{return null}}function ve(e,t,n,r){let i=e.split(`
3
+ `),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=Se(t,a,n);continue}if(!s)continue;let r=ye(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function ye(e){let t=0;for(;t<e.length&&Ce(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:be(e,t)}}function be(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
4
+ `;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=xe(n)),n}function xe(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function Se(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 Ce(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var w=e((()=>{}));function we(){M.clear()}async function T(e){let t=h(e??c()),n=M.get(t);if(n!==void 0)return n;let r=B(t);if(!r)return M.set(t,null),null;let i=m(r,`.git`);try{if((await he(i)).isFile()){let e=(await b(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=h(r,e.slice(7).trim());return M.set(t,n),n}}return M.set(t,i),i}catch{return M.set(t,null),null}}function E(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function D(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function O(e){try{let t=(await b(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 E(e)?{type:`branch`,name:e}:null}if(!E(n))return null;let r=await k(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return D(t)?{type:`detached`,sha:t}:null}catch{return null}}async function k(e,t){let n=await A(e,t);if(n)return n;let r=await j(e);return r&&r!==e?A(r,t):null}async function A(e,t){try{let n=(await b(m(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return E(t)?k(e,t):null}return D(n)?n:null}catch{}try{let n=await b(m(e,`packed-refs`),`utf-8`);for(let e of n.split(`
5
+ `)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return D(t)?t:null}}}catch{}return null}async function j(e){try{return h(e,(await b(m(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function Te(e,t,n){try{let r=(await b(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 E(t)?t:null}}}catch{}return null}async function Ee(){let e=await T();if(!e)return`HEAD`;let t=await O(e);return t&&t.type===`branch`?t.name:`HEAD`}async function De(){let e=await T();if(!e)return``;let t=await O(e);return t?t.type===`branch`?await k(e,`refs/heads/${t.name}`)??``:t.sha:``}async function Oe(){let e=await T();if(!e)return null;let t=await C(e,`remote`,`origin`,`url`);if(t)return t;let n=await j(e);return n&&n!==e?C(n,`remote`,`origin`,`url`):null}async function ke(){let e=await T();if(!e)return`main`;let t=await j(e)??e,n=await Te(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await k(t,`refs/remotes/origin/${e}`))return e;return`main`}function Ae(){return F.get(`branch`,Ee)}function je(){return F.get(`head`,De)}function Me(){return F.get(`remoteUrl`,Oe)}function Ne(){return F.get(`defaultBranch`,ke)}async function Pe(e){let t=await T(e);if(!t)return null;let n=await O(t);return n?n.type===`branch`?k(t,`refs/heads/${n.name}`):n.sha:null}async function Fe(e){let t;try{let n=(await b(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 O(t);return n?n.type===`branch`?k(t,`refs/heads/${n.name}`):n.sha:null}async function Ie(e){let t=await T(e);if(!t)return null;let n=await C(t,`remote`,`origin`,`url`);if(n)return n;let r=await j(t);return r&&r!==t?C(r,`remote`,`origin`,`url`):null}async function Le(){try{let e=await T();return e?(await me(m(await j(e)??e,`worktrees`))).length+1:0}catch{return 1}}var M,N,P,F,I=e((()=>{o(),re(),s(),$(),w(),r(),M=new Map,N=1e3,P=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 T(),this.initialized=!0,this.gitDir&&(this.commonDir=await j(this.gitDir),this.watchPath(m(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(m(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),ie(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),fe(e,{interval:N},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await O(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?m(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(y(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 a(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)y(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}},F=new P}));function Re(){function e(e){let t=z(e);return t===R?null:t}return e.cache=z.cache,e}function ze(){function e(e){let t=B(e);return t?V(t):null}return e.cache=V.cache,e}function Be(e){return T(e)}function L(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n&&n[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r&&r[1]&&r[2]){let e=r[1],t=r[2];if(Ue(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 Ve(){let e=await J();if(!e)return null;let t=L(e);return t?pe(`sha256`).update(t).digest(`hex`).substring(0,16):null}async function He(){try{let[e,t,n,r,i,a]=await Promise.all([K(),q(),J(),Y(),X(),Q()]);return{commitHash:e,branchName:t,remoteUrl:n,isHeadOnRemote:r,isClean:i,worktreeCount:a}}catch{return null}}function Ue(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function We(){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 R,z,B,V,H,U,W,G,K,q,Ge,J,Y,X,Z,Q,Ke,$=e((()=>{n(),s(),ne(),S(),ae(),l(),I(),oe(),se(),le(),R=Symbol(`git-root-not-found`),z=f(e=>{let t=Date.now();x(`info`,`find_git_root_started`);let n=h(e),r=n.substring(0,n.indexOf(de)+1)||de,i=0;for(;n!==r;){try{let e=m(n,`.git`);i++;let r=v(e);if(r.isDirectory()||r.isFile())return x(`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=v(e);if(n.isDirectory()||n.isFile())return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return x(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),R},e=>e,50),B=Re(),V=f(e=>{try{let t=g(m(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=h(e,t.slice(7).trim()),r=h(n,g(m(n,`commondir`),`utf-8`).trim());return h(p(n))!==m(r,`worktrees`)||_(g(m(n,`gitdir`),`utf-8`).trim())!==m(_(e),`.git`)?e:ue(r)===`.git`?p(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),H=ze(),U=t(()=>ce(`git`)||`git`),W=t(async()=>{let e=Date.now();x(`info`,`is_git_check_started`);let t=B(c())!==null;return x(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),G=async e=>B(e)!==null,K=async()=>je(),q=async()=>Ae(),Ge=async()=>Ne(),J=async()=>Me(),Y=async()=>{let{code:e}=await d(U(),[`rev-parse`,`@{u}`],{preserveOutputOnError:!1});return e===0},X=async e=>{let t=[`--no-optional-locks`,`status`,`--porcelain`];e?.ignoreUntracked&&t.push(`-uno`);let{stdout:n}=await d(U(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await d(U(),[`--no-optional-locks`,`status`,`--porcelain`],{preserveOutputOnError:!1}),t=[],n=[];return e.trim().split(`
6
+ `).filter(e=>e.length>0).forEach(e=>{let r=e.substring(0,2),i=e.substring(2).trim();r===`??`?n.push(i):i&&t.push(i)}),{tracked:t,untracked:n}},Q=async()=>Le(),Ke=async e=>{try{let t=e||`Claude Code auto-stash - ${new Date().toISOString()}`,{untracked:n}=await Z();if(n.length>0){let{code:e}=await d(U(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await d(U(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{C as A,Pe as C,T as D,Fe as E,x as M,_e as N,k as O,j as S,I as T,$ as _,Ge as a,Ke as b,He as c,W as d,Y as f,U as g,Q as h,q as i,S as j,w as k,K as l,Ve as m,H as n,Z as o,J as p,B as r,Be as s,G as t,X as u,We as v,Ie as w,we as x,L as y};
@@ -0,0 +1 @@
1
+ import{en as e,nt as t}from"./state-4KQ3kaqz.js";import{l as n,p as r}from"./debug-IKW-jE7K.js";import{b as i,c as a,g as o}from"./config-C7YHKCPV.js";import{T as s,_ as c,r as l,w as u}from"./git-tyaWOgRL.js";import{_ as d,f}from"./file-D1cN3LMK.js";import{a as p,i as m,n as h}from"./detectRepository-ReZ0Fz8Z.js";import{realpath as g}from"fs/promises";e(),o(),n(),m(),f(),s(),c();async function _(){try{let e=await h();if(!e){r(`Not in a GitHub repository, skipping path mapping update`);return}let n=t(),o=l(n)??n,s;try{s=(await g(o)).normalize(`NFC`)}catch{s=o}let c=e.toLowerCase(),u=a().githubRepoPaths?.[c]??[];if(u[0]===s){r(`Path ${s} already tracked for repo ${c}`);return}let d=u.filter(e=>e!==s),f=[s,...d];i(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[c]:f}})),r(`Added ${s} to tracked paths for repo ${c}`)}catch(e){r(`Error updating repo path mapping: ${e}`)}}function v(e){let t=a(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(d));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await u(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let n=a(),o=e.toLowerCase(),s=n.githubRepoPaths?.[o]??[],c=s.filter(e=>e!==t);if(c.length===s.length)return;let l={...n.githubRepoPaths};c.length===0?delete l[o]:l[o]=c,i(e=>({...e,githubRepoPaths:l})),r(`Removed ${t} from tracked paths for repo ${o}`)}export{b as a,_ as i,v as n,x as r,y as t};
@@ -0,0 +1,3 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{$w as o,Jw as s,Mb as c,Nb as l,_p as u,ad as d,bp as f,dp as p,fp as m,gp as h,id as g,lp as _,mp as v,pp as y,rd as b,up as x,xp as S,yp as C}from"./loadAgentsDir-nzr38hai.js";import{n as w,t as T}from"./PermissionDialog-0ya1CU5k.js";function E({currentGoal:e,newObjective:r,onConfirm:i,onCancel:a}){function o(e){e===`yes`?i():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(t,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Status: `}),y(e.status)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Time: `}),m(e)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(n,{children:r})]}),(0,D.jsx)(t,{marginTop:1,children:(0,D.jsx)(l,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var D,O=e((()=>{r(),i(),c(),w(),u(),D=a()}));function k(e){let t=e.split(`
2
+ `)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){o(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=v();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${y(e.status)}`,`Time: ${m(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 M(e){return S(e),h(),g(),`Goal set.`}async function N(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=_();return t&&(d(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=C();return t&&(g(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(v()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=f();return t&&g(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=p();return t&&g(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=x();return t&&(g(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>F)return e(`Goal objective is too long (${r.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=v();return a&&a.status!==`complete`?(0,P.jsx)(E,{currentGoal:a,newObjective:r,onConfirm:()=>{A(),e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{r(),u(),b(),s(),O(),P=a(),F=4e3,I=80}))();export{N as call};
@@ -0,0 +1,2 @@
1
+ import{i as e,t}from"./rolldown-runtime-DaDcL9Zw.js";var n=t(((t,n)=>{var r=e(`constants`),i=process.cwd,a=null,o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return a||(a=i.call(process)),a};try{process.cwd()}catch{}if(typeof process.chdir==`function`){var s=process.chdir;process.chdir=function(e){a=null,s.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}n.exports=c;function c(e){r.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=a(e.chmodSync),e.fchmodSync=a(e.fchmodSync),e.lchmodSync=a(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),o===`win32`&&(e.rename=typeof e.rename==`function`?(function(t){function n(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`||c.code===`EBUSY`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.rename):e.rename),e.read=typeof e.read==`function`?(function(t){function n(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.read):e.read,e.readSync=typeof e.readSync==`function`?(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync):e.readSync;function t(e){e.lchmod=function(t,n,i){e.open(t,r.O_WRONLY|r.O_SYMLINK,n,function(t,r){if(t){i&&i(t);return}e.fchmod(r,n,function(t){e.close(r,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,n){var i=e.openSync(t,r.O_WRONLY|r.O_SYMLINK,n),a=!0,o;try{o=e.fchmodSync(i,n),a=!1}finally{if(a)try{e.closeSync(i)}catch{}else e.closeSync(i)}return o}}function n(e){r.hasOwnProperty(`O_SYMLINK`)&&e.futimes?(e.lutimes=function(t,n,i,a){e.open(t,r.O_SYMLINK,function(t,r){if(t){a&&a(t);return}e.futimes(r,n,i,function(t){e.close(r,function(e){a&&a(t||e)})})})},e.lutimesSync=function(t,n,i){var a=e.openSync(t,r.O_SYMLINK),o,s=!0;try{o=e.futimesSync(a,n,i),s=!1}finally{if(s)try{e.closeSync(a)}catch{}else e.closeSync(a)}return o}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function i(t){return t&&function(n,r,i){return t.call(e,n,r,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}}function a(t){return t&&function(n,r){try{return t.call(e,n,r)}catch(e){if(!d(e))throw e}}}function s(t){return t&&function(n,r,i,a){return t.call(e,n,r,i,function(e){d(e)&&(e=null),a&&a.apply(this,arguments)})}}function c(t){return t&&function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!d(e))throw e}}}function l(t){return t&&function(n,r,i){typeof r==`function`&&(i=r,r=null);function a(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return r?t.call(e,n,r,a):t.call(e,n,a)}}function u(t){return t&&function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}}function d(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}}})),r=t(((t,n)=>{var r=e(`stream`).Stream;n.exports=i;function i(e){return{ReadStream:t,WriteStream:n};function t(n,i){if(!(this instanceof t))return new t(n,i);r.call(this);var a=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags=`r`,this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),s=0,c=o.length;s<c;s++){var l=o[s];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.end===void 0)this.end=1/0;else if(typeof this.end!=`number`)throw TypeError(`end must be a Number`);if(this.start>this.end)throw Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){a.emit(`error`,e),a.readable=!1;return}a.fd=t,a.emit(`open`,t),a._read()})}function n(t,i){if(!(this instanceof n))return new n(t,i);r.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var c=a[o];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!=`number`)throw TypeError(`start must be a Number`);if(this.start<0)throw Error(`start must be >= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),i=t(((e,t)=>{t.exports=r;var n=Object.getPrototypeOf||function(e){return e.__proto__};function r(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}})),a=t(((t,a)=>{var o=e(`fs`),s=n(),c=r(),l=i(),u=e(`util`),d,f;typeof Symbol==`function`&&typeof Symbol.for==`function`?(d=Symbol.for(`graceful-fs.queue`),f=Symbol.for(`graceful-fs.previous`)):(d=`___graceful-fs.queue`,f=`___graceful-fs.previous`);function p(){}function m(e,t){Object.defineProperty(e,d,{get:function(){return t}})}var h=p;u.debuglog?h=u.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(h=function(){var e=u.format.apply(u,arguments);e=`GFS4: `+e.split(/\n/).join(`
2
+ GFS4: `),console.error(e)}),o[d]||(m(o,global[d]||[]),o.close=(function(e){function t(t,n){return e.call(o,t,function(e){e||y(),typeof n==`function`&&n.apply(this,arguments)})}return Object.defineProperty(t,f,{value:e}),t})(o.close),o.closeSync=(function(e){function t(t){e.apply(o,arguments),y()}return Object.defineProperty(t,f,{value:e}),t})(o.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){h(o[d]),e(`assert`).equal(o[d].length,0)})),global[d]||m(global,o[d]),a.exports=g(l(o)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched&&(a.exports=g(o),o.__patched=!0);function g(e){s(e),e.gracefulify=g,e.createReadStream=T,e.createWriteStream=E;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?_([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=i;function i(e,t,n,i){return typeof n==`function`&&(i=n,n=null),a(e,t,n,i);function a(e,t,n,i,o){return r(e,t,n,function(r){r&&(r.code===`EMFILE`||r.code===`ENFILE`)?_([a,[e,t,n,i],r,o||Date.now(),Date.now()]):typeof i==`function`&&i.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,o){return a(e,t,n,function(a){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?_([i,[e,t,n,r],a,o||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?_([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=p;var f=/^v[0-5]\./;function p(e,t,n){typeof t==`function`&&(n=t,t=null);var r=f.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?_([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var m=c(e);x=m.ReadStream,C=m.WriteStream}var h=e.ReadStream;h&&(x.prototype=Object.create(h.prototype),x.prototype.open=S);var v=e.WriteStream;v&&(C.prototype=Object.create(v.prototype),C.prototype.open=w),Object.defineProperty(e,"ReadStream",{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return C},set:function(e){C=e},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var b=C;Object.defineProperty(e,"FileWriteStream",{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});function x(e,t){return this instanceof x?(h.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function S(){var e=this;O(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function C(e,t){return this instanceof C?(v.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function w(){var e=this;O(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function T(t,n){return new e.ReadStream(t,n)}function E(t,n){return new e.WriteStream(t,n)}var D=e.open;e.open=O;function O(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return D(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?_([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function _(e){h(`ENQUEUE`,e[0].name,e[1]),o[d].push(e),b()}var v;function y(){for(var e=Date.now(),t=0;t<o[d].length;++t)o[d][t].length>2&&(o[d][t][3]=e,o[d][t][4]=e);b()}function b(){if(clearTimeout(v),v=void 0,o[d].length!==0){var e=o[d].shift(),t=e[0],n=e[1],r=e[2],i=e[3],a=e[4];if(i===void 0)h(`RETRY`,t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){h(`TIMEOUT`,t.name,n);var s=n.pop();typeof s==`function`&&s.call(null,r)}else{var c=Date.now()-a,l=Math.max(a-i,1);c>=Math.min(l*1.2,100)?(h(`RETRY`,t.name,n),t.apply(null,n.concat([i]))):o[d].push(e)}v===void 0&&(v=setTimeout(b,0))}}}));export{a as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ih as t,Jo as n,Ko as r,Lh as i,at as a,ct as o,fo as s,np as c,op as l,zo as u}from"./loadAgentsDir-nzr38hai.js";import{l as d,p as f}from"./debug-IKW-jE7K.js";import{G as p,H as m}from"./model-DfFA3qMO.js";import{B as h,F as g,L as _,P as v,R as y,it as b}from"./rcDebugLog-BUuD-X1D.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,i,a,l,u){try{let s=b(u.model),d=n(e,a),p=(await Promise.all(a.map(e=>o(e,{getToolPermissionContext:u.getToolPermissionContext,tools:a,agents:u.agents,allowedAgentTypes:u.allowedAgentTypes,model:u.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),v=h(d,i),S=y(p),w=_(u.toolChoice),T=t({maxRetries:0,fetchOverride:u.fetchOverride,source:u.querySource});f(`[Grok] Calling model=${s}, messages=${v.length}, tools=${S.length}`);let E=g(await T.chat.completions.create({model:s,messages:v,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...u.temperatureOverride!==void 0&&{temperature:u.temperatureOverride}},{signal:l}),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:r([t],a,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&&c(m(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);f(`[Grok] Error: ${t}`,{level:`error`}),yield s({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{i(),S(),v(),u(),a(),d(),l(),p()}))();export{w as queryModelGrok};
@@ -0,0 +1,7 @@
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"./axios-DaWTGg7G.js";import{ES as a,OS as o}from"./loadAgentsDir-nzr38hai.js";import{l as s,p as c}from"./debug-IKW-jE7K.js";import{b as l,c as u,g as d}from"./config-C7YHKCPV.js";import{a as f,n as p}from"./process-gEbdy6uY.js";import{d as m,f as h,o as g,s as _}from"./log-B3eB4EFv.js";import{n as v,r as y}from"./analytics-BotDBGh0.js";import{l as b,u as x}from"./oauth-BqJqV-2M.js";import{Mt as S,Vt as C,ar as w,er as T,ir as E,lr as D,nr as O,qt as k,ur as A}from"./model-DfFA3qMO.js";async function j(){try{await w(()=>{let e=T();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.post(`${b().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...e.headers,"User-Agent":D()}})}),R.cache.clear?.()}catch(e){_(e)}}async function M(e){try{await w(()=>{let t=T();if(t.error)throw Error(`Failed to get auth headers: ${t.error}`);return r.patch(`${b().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:e},{headers:{...t.headers,"User-Agent":D()}})}),R.cache.clear?.()}catch(e){_(e)}}async function N(){if(!k())return!1;let e=S()?.accountUuid;if(!e)return!1;let t=u().groveConfigCache?.[e];return t?Date.now()-t.timestamp>L?(c(`Grove: Cache stale, returning cached data and refreshing in background`),P(e),t.grove_enabled):(c(`Grove: Using fresh cached config`),t.grove_enabled):(c(`Grove: No cache, fetching config in background (dialog skipped this session)`),P(e),!1)}async function P(e){try{let t=await z();if(!t.success)return;let n=t.data.grove_enabled,r=u().groveConfigCache?.[e];if(r?.grove_enabled===n&&Date.now()-r.timestamp<=L)return;l(t=>({...t,groveConfigCache:{...t.groveConfigCache,[e]:{grove_enabled:n,timestamp:Date.now()}}}))}catch(e){c(`Grove: Failed to fetch and store config: ${e}`)}}function F(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 I(){let[e,t]=await Promise.all([R(),z()]);if(F(e,t,!1)){let e=t.success?t.data:null;y(`tengu_grove_print_viewed`,{dismissable:e?.notice_is_grace_period}),e===null||e.notice_is_grace_period?(f(`
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 j()):(f(`
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))}}var L,R,z,B=e((()=>{i(),n(),v(),C(),s(),o(),m(),p(),x(),d(),E(),g(),A(),L=1440*60*1e3,R=t(async()=>{if(h())return{success:!1};try{return{success:!0,data:(await w(()=>{let e=T();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.get(`${b().BASE_API_URL}/api/oauth/account/settings`,{headers:{...e.headers,"User-Agent":D()}})})).data}}catch(e){return _(e),R.cache.clear?.(),{success:!1}}}),z=t(async()=>{if(h())return{success:!1};try{let{grove_enabled:e,domain_excluded:t,notice_is_grace_period:n,notice_reminder_frequency:i}=(await w(()=>{let e=T();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.get(`${b().BASE_API_URL}/api/claude_code_grove`,{headers:{...e.headers,"User-Agent":O()},timeout:3e3})})).data;return{success:!0,data:{grove_enabled:e,domain_excluded:t??!1,notice_is_grace_period:n??!0,notice_reminder_frequency:i}}}catch(e){return c(`Failed to fetch Grove notice config: ${e}`),{success:!1}}})}));export{B as a,M as c,R as i,I as n,N as o,z as r,j as s,F as t};
@@ -0,0 +1 @@
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};
@@ -0,0 +1,5 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{en as t,ht as n}from"./state-4KQ3kaqz.js";import{E as r,J as i,O as a,U as o,_ as s,h as c,l,p as u}from"./debug-IKW-jE7K.js";import{o as d,s as f}from"./log-B3eB4EFv.js";import{c as p,f as m}from"./file-D1cN3LMK.js";import{n as h,r as g}from"./analytics-BotDBGh0.js";import{join as _}from"path";import{createWriteStream as v,writeFileSync as y}from"fs";import{readFile as b,readdir as x,writeFile as S}from"fs/promises";import{pipeline as C}from"stream/promises";import{getHeapSnapshot as w,getHeapSpaceStatistics as T,getHeapStatistics as E}from"v8";async function D(e,t=0){let r=process.memoryUsage(),i=E(),a=process.resourceUsage(),o=process.uptime(),s;try{s=T()}catch{}let c=process._getActiveHandles().length,l=process._getActiveRequests().length,u;try{u=(await x(`/proc/self/fd`)).length}catch{}let d;try{d=await b(`/proc/self/smaps_rollup`,`utf8`)}catch{}let f=r.rss-r.heapUsed,p=o>0?r.rss/o:0,m=p*3600/(1024*1024),h=[];return i.number_of_detached_contexts>0&&h.push(`${i.number_of_detached_contexts} detached context(s) - possible iframe/context leak`),c>100&&h.push(`${c} active handles - possible timer/socket leak`),f>r.heapUsed&&h.push(`Native memory > heap - leak may be in native addons (node-pty, sharp, etc.)`),m>100&&h.push(`High memory growth rate: ${m.toFixed(1)} MB/hour`),u&&u>500&&h.push(`${u} open file descriptors - possible file/socket leak`),{timestamp:new Date().toISOString(),sessionId:n(),trigger:e,dumpNumber:t,uptimeSeconds:o,memoryUsage:{heapUsed:r.heapUsed,heapTotal:r.heapTotal,external:r.external,arrayBuffers:r.arrayBuffers,rss:r.rss},memoryGrowthRate:{bytesPerSecond:p,mbPerHour:m},v8HeapStats:{heapSizeLimit:i.heap_size_limit,mallocedMemory:i.malloced_memory,peakMallocedMemory:i.peak_malloced_memory,detachedContexts:i.number_of_detached_contexts,nativeContexts:i.number_of_native_contexts},v8HeapSpaces:s?.map(e=>({name:e.space_name,size:e.space_size,used:e.space_used_size,available:e.space_available_size})),resourceUsage:{maxRSS:a.maxRSS*1024,userCPUTime:a.userCPUTime,systemCPUTime:a.systemCPUTime},activeHandles:c,activeRequests:l,openFileDescriptors:u,analysis:{potentialLeaks:h,recommendation:h.length>0?`WARNING: ${h.length} potential leak indicator(s) found. See potentialLeaks array.`:`No obvious leak indicators. Check heap snapshot for retained objects.`},smapsRollup:d,platform:process.platform,nodeVersion:process.version,ccVersion:`0.0.1`}}async function O(e=`manual`,t=0){try{let r=n(),i=await D(e,t),o=e=>(e/1024/1024/1024).toFixed(3);u(`[HeapDump] Memory state:
2
+ heapUsed: ${o(i.memoryUsage.heapUsed)} GB (in snapshot)
3
+ external: ${o(i.memoryUsage.external)} GB (NOT in snapshot)
4
+ rss: ${o(i.memoryUsage.rss)} GB (total process)
5
+ ${i.analysis.recommendation}`);let s=p();await c().mkdir(s);let l=t>0?`-dump${t}`:``,d=`${r}${l}.heapsnapshot`,f=`${r}${l}-diagnostics.json`,m=_(s,d),h=_(s,f);return await S(h,a(i,null,2),{mode:384}),u(`[HeapDump] Diagnostics written to ${h}`),await k(m),u(`[HeapDump] Heap dump written to ${m}`),g(`tengu_heap_dump`,{triggerManual:e===`manual`,triggerAuto15GB:e===`auto-1.5GB`,dumpNumber:t,success:!0}),{success:!0,heapPath:m,diagPath:h}}catch(n){let r=i(n);return f(r),g(`tengu_heap_dump`,{triggerManual:e===`manual`,triggerAuto15GB:e===`auto-1.5GB`,dumpNumber:t,success:!1}),{success:!1,error:r.message}}}async function k(e){if(typeof Bun<`u`){y(e,Bun.generateHeapSnapshot(`v8`,`arraybuffer`),{mode:384}),Bun.gc(!0);return}let t=v(e,{mode:384});await C(w(),t)}var A=e((()=>{t(),h(),l(),o(),m(),s(),d(),r()}));async function j(){let e=await O();return e.success?{type:`text`,value:`${e.heapPath}\n${e.diagPath}`}:{type:`text`,value:`Failed to create heap dump: ${e.error}`}}e((()=>{A()}))();export{j as call};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,fi as s,n as c,ot as l,r as u,t as d,x as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Li as m,Nb as h,Pb as g,Qi as _,TS as v,Ub as y,Wb as b,Wi as x,zi as S}from"./loadAgentsDir-nzr38hai.js";import{S as C,x as w}from"./startupProfiler-DxRQteII.js";import{u as T}from"./referral-DP_GshTS.js";import{n as E,t as D}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";import{n as O,r as k}from"./modalContext-DFjKLCB6.js";import{n as A,t as j}from"./PromptInputHelpMenu-B2TDpbpw.js";function M({commands:e,maxHeight:t,columns:r,title:a,onCancel:s,emptyMessage:c}){let{headerFocused:l,focusHeader:u}=o(),d=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),p=(0,N.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(x(e),d,!0)}))},[e,d]);return(0,P.jsx)(n,{flexDirection:`column`,paddingY:1,children:e.length===0&&c?(0,P.jsx)(i,{dimColor:!0,children:c}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(i,{children:a}),(0,P.jsx)(n,{marginTop:1,children:(0,P.jsx)(h,{options:p,visibleOptionCount:f,onCancel:s,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:u,isDisabled:l})})]})})}var N,P,F=e((()=>{s(),N=t(s(),1),_(),w(),d(),g(),P=p()}));function I(){return(0,L.jsxs)(n,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,L.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,L.jsx)(i,{bold:!0,children:`Getting started`}),(0,L.jsxs)(n,{flexDirection:`column`,children:[(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`1. `}),(0,L.jsx)(i,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`2. `}),(0,L.jsx)(i,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`3. `}),(0,L.jsx)(i,{children:`Type `}),(0,L.jsx)(i,{bold:!0,children:`/commit`}),(0,L.jsx)(i,{children:` to commit changes, `}),(0,L.jsx)(i,{bold:!0,children:`/help`}),(0,L.jsx)(i,{children:` for commands, or `}),(0,L.jsx)(i,{bold:!0,children:`?`}),(0,L.jsx)(i,{children:` for shortcuts.`})]})]})]}),(0,L.jsxs)(n,{flexDirection:`column`,children:[(0,L.jsx)(n,{children:(0,L.jsx)(i,{bold:!0,children:`Shortcuts`})}),(0,L.jsx)(j,{gap:2,fixedWidth:!0})]})]})}var L,R=e((()=>{s(),d(),A(),L=p()}));function z({onClose:e,commands:t}){let{rows:o,columns:s}=l(),d=Math.floor(o/2),p=k(),h=()=>e(`Help dialog dismissed`,{display:`system`});a(`help:dismiss`,h,{context:`Help`});let g=E(h),_=b(`help:dismiss`,`Help`,`esc`),v=S(),y=t.filter(e=>v.has(e.name)&&!e.isHidden),x=[];if(process.env.USER_TYPE===`ant`){let e=new Set(m.map(e=>e.name));y=y.filter(t=>!e.has(t.name)),x=t.filter(t=>e.has(t.name)&&!t.isHidden)}let C=t.filter(e=>!v.has(e.name)&&!e.isHidden),w=[(0,B.jsx)(c,{title:`general`,children:(0,B.jsx)(I,{})},`general`)];return w.push((0,B.jsx)(c,{title:`commands`,children:(0,B.jsx)(M,{commands:y,maxHeight:d,columns:s,title:`Browse default commands:`,onCancel:h})},`commands`)),w.push((0,B.jsx)(c,{title:`custom-commands`,children:(0,B.jsx)(M,{commands:C,maxHeight:d,columns:s,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:h})},`custom`)),process.env.USER_TYPE===`ant`&&x.length>0&&w.push((0,B.jsx)(c,{title:`[ant-only]`,children:(0,B.jsx)(M,{commands:x,maxHeight:d,columns:s,title:`Browse ant-only commands:`,onCancel:h})},`ant-only`)),(0,B.jsx)(n,{flexDirection:`column`,height:p?void 0:d,children:(0,B.jsxs)(f,{color:`professionalBlue`,children:[(0,B.jsx)(u,{title:process.env.USER_TYPE===`ant`?`/help`:`Claude Code v0.0.1`,color:`professionalBlue`,defaultTab:`general`,children:w}),(0,B.jsx)(n,{marginTop:1,children:(0,B.jsxs)(i,{children:[`For more help: `,(0,B.jsx)(r,{url:`https://code.claude.com/docs/en/overview`})]})}),(0,B.jsx)(n,{marginTop:1,children:(0,B.jsx)(i,{dimColor:!0,children:g.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,g.keyName,` again to exit`]}):(0,B.jsxs)(i,{italic:!0,children:[_,` to cancel`]})})})]})})}var B,V=e((()=>{s(),D(),y(),_(),O(),v(),d(),T(),F(),R(),B=p()})),H,U;e((()=>{V(),H=p(),U=async(e,{options:{commands:t}})=>(0,H.jsx)(z,{commands:t,onClose:e})}))();export{U as call};
@@ -0,0 +1,79 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./memoize-BK3gG5ob.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{I as o,Lt as s,P as c,Wt as l,fi as u,t as d,y as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{dt as m,en as h}from"./state-4KQ3kaqz.js";import{$h as g,Jh as _,Nb as v,Pb as y,Qh as b,SS as x,Xh as S,Xu as C,Yh as w,Yu as T,Zh as E,dS as D,lS as ee,qh as te,uS as O,xS as k}from"./loadAgentsDir-nzr38hai.js";import{c as A,f as j,g as M}from"./settings-5PQdphqC.js";import{n as ne,r as re}from"./analytics-BotDBGh0.js";import{l as N,o as P}from"./stringUtils-CvXbHQRH.js";import{u as ie}from"./referral-DP_GshTS.js";function ae(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);te(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=m();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}else if(process.env.USER_TYPE===`ant`){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:{type:`command`,command:`[ANT-ONLY] Built-in Hook`},matcher:e.matcher,source:`builtinHook`})}}}return n}function oe(e,t){return g(Object.keys(e[t]||{}),e,t)}function F(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),h(),b(),L=n(function(e){return{PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
2
+ Exit code 0 - stdout/stderr not shown
3
+ Exit code 2 - show stderr to model and block tool call
4
+ Other exit codes - show stderr to user only but continue with tool call`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUse:{summary:`After tool execution`,description:`Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
5
+ Exit code 0 - stdout shown in transcript mode (ctrl+o)
6
+ Exit code 2 - show stderr to model immediately
7
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUseFailure:{summary:`After tool execution fails`,description:`Input to command is JSON with tool_name, tool_input, tool_use_id, error, error_type, is_interrupt, and is_timeout.
8
+ Exit code 0 - stdout shown in transcript mode (ctrl+o)
9
+ Exit code 2 - show stderr to model immediately
10
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PermissionDenied:{summary:`After auto mode classifier denies a tool call`,description:`Input to command is JSON with tool_name, tool_input, tool_use_id, and reason.
11
+ Return {"hookSpecificOutput":{"hookEventName":"PermissionDenied","retry":true}} to tell the model it may retry.
12
+ Exit code 0 - stdout shown in transcript mode (ctrl+o)
13
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},Notification:{summary:`When notifications are sent`,description:`Input to command is JSON with notification message and type.
14
+ Exit code 0 - stdout/stderr not shown
15
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`notification_type`,values:[`permission_prompt`,`idle_prompt`,`auth_success`,`elicitation_dialog`,`elicitation_complete`,`elicitation_response`]}},UserPromptSubmit:{summary:`When the user submits a prompt`,description:`Input to command is JSON with original user prompt text.
16
+ Exit code 0 - stdout shown to Claude
17
+ Exit code 2 - block processing, erase original prompt, and show stderr to user only
18
+ Other exit codes - show stderr to user only`},SessionStart:{summary:`When a new session is started`,description:`Input to command is JSON with session start source.
19
+ Exit code 0 - stdout shown to Claude
20
+ Blocking errors are ignored
21
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`source`,values:[`startup`,`resume`,`clear`,`compact`]}},Stop:{summary:`Right before Claude concludes its response`,description:`Exit code 0 - stdout/stderr not shown
22
+ Exit code 2 - show stderr to model and continue conversation
23
+ Other exit codes - show stderr to user only`},StopFailure:{summary:`When the turn ends due to an API error`,description:`Fires instead of Stop when an API error (rate limit, auth failure, etc.) ended the turn. Fire-and-forget — hook output and exit codes are ignored.`,matcherMetadata:{fieldToMatch:`error`,values:[`rate_limit`,`authentication_failed`,`billing_error`,`invalid_request`,`server_error`,`max_output_tokens`,`unknown`]}},SubagentStart:{summary:`When a subagent (Agent tool call) is started`,description:`Input to command is JSON with agent_id and agent_type.
24
+ Exit code 0 - stdout shown to subagent
25
+ Blocking errors are ignored
26
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`agent_type`,values:[]}},SubagentStop:{summary:`Right before a subagent (Agent tool call) concludes its response`,description:`Input to command is JSON with agent_id, agent_type, and agent_transcript_path.
27
+ Exit code 0 - stdout/stderr not shown
28
+ Exit code 2 - show stderr to subagent and continue having it run
29
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`agent_type`,values:[]}},PreCompact:{summary:`Before conversation compaction`,description:`Input to command is JSON with compaction details.
30
+ Exit code 0 - stdout appended as custom compact instructions
31
+ Exit code 2 - block compaction
32
+ Other exit codes - show stderr to user only but continue with compaction`,matcherMetadata:{fieldToMatch:`trigger`,values:[`manual`,`auto`]}},PostCompact:{summary:`After conversation compaction`,description:`Input to command is JSON with compaction details and the summary.
33
+ Exit code 0 - stdout shown to user
34
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`trigger`,values:[`manual`,`auto`]}},SessionEnd:{summary:`When a session is ending`,description:`Input to command is JSON with session end reason.
35
+ Exit code 0 - command completes successfully
36
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`reason`,values:[`clear`,`logout`,`prompt_input_exit`,`other`]}},PermissionRequest:{summary:`When a permission dialog is displayed`,description:`Input to command is JSON with tool_name, tool_input, and tool_use_id.
37
+ Output JSON with hookSpecificOutput containing decision to allow or deny.
38
+ Exit code 0 - use hook decision if provided
39
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},Setup:{summary:`Repo setup hooks for init and maintenance`,description:`Input to command is JSON with trigger (init or maintenance).
40
+ Exit code 0 - stdout shown to Claude
41
+ Blocking errors are ignored
42
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`trigger`,values:[`init`,`maintenance`]}},TeammateIdle:{summary:`When a teammate is about to go idle`,description:`Input to command is JSON with teammate_name and team_name.
43
+ Exit code 0 - stdout/stderr not shown
44
+ Exit code 2 - show stderr to teammate and prevent idle (teammate continues working)
45
+ Other exit codes - show stderr to user only`},TaskCreated:{summary:`When a task is being created`,description:`Input to command is JSON with task_id, task_subject, task_description, teammate_name, and team_name.
46
+ Exit code 0 - stdout/stderr not shown
47
+ Exit code 2 - show stderr to model and prevent task creation
48
+ Other exit codes - show stderr to user only`},TaskCompleted:{summary:`When a task is being marked as completed`,description:`Input to command is JSON with task_id, task_subject, task_description, teammate_name, and team_name.
49
+ Exit code 0 - stdout/stderr not shown
50
+ Exit code 2 - show stderr to model and prevent task completion
51
+ Other exit codes - show stderr to user only`},Elicitation:{summary:`When an MCP server requests user input (elicitation)`,description:`Input to command is JSON with mcp_server_name, message, and requested_schema.
52
+ Output JSON with hookSpecificOutput containing action (accept/decline/cancel) and optional content.
53
+ Exit code 0 - use hook response if provided
54
+ Exit code 2 - deny the elicitation
55
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`mcp_server_name`,values:[]}},ElicitationResult:{summary:`After a user responds to an MCP elicitation`,description:`Input to command is JSON with mcp_server_name, action, content, mode, and elicitation_id.
56
+ Output JSON with hookSpecificOutput containing optional action and content to override the response.
57
+ Exit code 0 - use hook response if provided
58
+ Exit code 2 - block the response (action becomes decline)
59
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`mcp_server_name`,values:[]}},ConfigChange:{summary:`When configuration files change during a session`,description:`Input to command is JSON with source (user_settings, project_settings, local_settings, policy_settings, skills) and file_path.
60
+ Exit code 0 - allow the change
61
+ Exit code 2 - block the change from being applied to the session
62
+ Other exit codes - show stderr to user only`,matcherMetadata:{fieldToMatch:`source`,values:[`user_settings`,`project_settings`,`local_settings`,`policy_settings`,`skills`]}},InstructionsLoaded:{summary:`When an instruction file (CLAUDE.md or rule) is loaded`,description:`Input to command is JSON with file_path, memory_type (User, Project, Local, Managed), load_reason (session_start, nested_traversal, path_glob_match, include, compact), globs (optional — the paths: frontmatter patterns that matched), trigger_file_path (optional — the file Claude touched that caused the load), and parent_file_path (optional — the file that @-included this one).
63
+ Exit code 0 - command completes successfully
64
+ Other exit codes - show stderr to user only
65
+ This hook is observability-only and does not support blocking.`,matcherMetadata:{fieldToMatch:`load_reason`,values:[`session_start`,`nested_traversal`,`path_glob_match`,`include`,`compact`]}},WorktreeCreate:{summary:`Create an isolated worktree for VCS-agnostic isolation`,description:`Input to command is JSON with name (suggested worktree slug).
66
+ Stdout should contain the absolute path to the created worktree directory.
67
+ Exit code 0 - worktree created successfully
68
+ Other exit codes - worktree creation failed`},WorktreeRemove:{summary:`Remove a previously created worktree`,description:`Input to command is JSON with worktree_path (absolute path to worktree).
69
+ Exit code 0 - worktree removed successfully
70
+ Other exit codes - show stderr to user only`},CwdChanged:{summary:`After the working directory changes`,description:`Input to command is JSON with old_cwd and new_cwd.
71
+ CLAUDE_ENV_FILE is set — write bash exports there to apply env to subsequent BashTool commands.
72
+ Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to register with the FileChanged watcher.
73
+ Exit code 0 - command completes successfully
74
+ Other exit codes - show stderr to user only`},FileChanged:{summary:`When a watched file changes`,description:`Input to command is JSON with file_path and event (change, add, unlink).
75
+ CLAUDE_ENV_FILE is set — write bash exports there to apply env to subsequent BashTool commands.
76
+ The matcher field specifies filenames to watch in the current directory (e.g. ".envrc|.env").
77
+ Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to dynamically update the watch list.
78
+ Exit code 0 - command completes successfully
79
+ Other exit codes - show stderr to user only`}}},e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:l}){return(0,B.jsx)(f,{title:`Hooks`,subtitle:`${n} ${N(n,`hook`)} configured`,onCancel:l,children:(0,B.jsxs)(o,{flexDirection:`column`,gap:1,children:[r&&(0,B.jsxs)(o,{flexDirection:`column`,children:[(0,B.jsxs)(c,{color:`suggestion`,children:[a.info,` Hooks Restricted by Policy`]}),(0,B.jsx)(c,{dimColor:!0,children:`Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked.`})]}),(0,B.jsx)(o,{flexDirection:`column`,children:(0,B.jsxs)(c,{dimColor:!0,children:[a.info,` This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.`,` `,(0,B.jsx)(s,{url:`https://code.claude.com/docs/en/hooks`,children:`Learn more`})]})}),(0,B.jsx)(o,{flexDirection:`column`,children:(0,B.jsx)(v,{onChange:e=>{i(e)},onCancel:l,options:Object.entries(e).map(([e,n])=>{let r=t[e]||0;return{label:r>0?(0,B.jsxs)(c,{children:[e,` `,(0,B.jsxs)(c,{color:`suggestion`,children:[`(`,r,`)`]})]}):e,value:e,description:n.summary}})})})]})})}var B,V=e((()=>{i(),u(),d(),P(),y(),B=p()}));function H({selectedEvent:e,selectedMatcher:t,hooksForSelectedMatcher:n,hookEventMetadata:r,onSelect:i,onCancel:a}){let s=r.matcherMetadata===void 0?e:`${e} - Matcher: ${t||`(all)`}`;return n.length===0?(0,U.jsx)(f,{title:s,subtitle:r.description,onCancel:a,inputGuide:()=>(0,U.jsx)(c,{children:`Esc to go back`}),children:(0,U.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,U.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,U.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,U.jsx)(f,{title:s,subtitle:r.description,onCancel:a,children:(0,U.jsx)(o,{flexDirection:`column`,children:(0,U.jsx)(v,{options:n.map((e,t)=>({label:`[${e.config.type}] ${_(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${S(e.source)} (${e.pluginName})`:S(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{u(),d(),b(),y(),U=p()}));function G({selectedEvent:e,matchersForSelectedEvent:t,hooksByEventAndMatcher:n,eventDescription:r,onSelect:i,onCancel:a}){let s=K.useMemo(()=>t.map(t=>{let r=n[e]?.[t]||[];return{matcher:t,sources:Array.from(new Set(r.map(e=>e.source))),hookCount:r.length}}),[t,n,e]);return t.length===0?(0,q.jsx)(f,{title:`${e} - Matchers`,subtitle:r,onCancel:a,inputGuide:()=>(0,q.jsx)(c,{children:`Esc to go back`}),children:(0,q.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,q.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,q.jsx)(f,{title:`${e} - Matchers`,subtitle:r,onCancel:a,children:(0,q.jsx)(o,{flexDirection:`column`,children:(0,q.jsx)(v,{options:s.map(e=>({label:`[${e.sources.map(E).join(`, `)}] ${e.matcher||`(all)`}`,value:e.matcher,description:`${e.hookCount} ${N(e.hookCount,`hook`)}`})),onChange:e=>{i(e)},onCancel:a})})})}var K,q,se=e((()=>{K=t(u(),1),d(),b(),P(),y(),q=p()}));function ce({selectedHook:e,eventSupportsMatcher:t,onCancel:n}){return(0,J.jsx)(f,{title:`Hook details`,onCancel:n,inputGuide:()=>(0,J.jsx)(c,{children:`Esc to go back`}),children:(0,J.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(c,{children:[`Event: `,(0,J.jsx)(c,{bold:!0,children:e.event})]}),t&&(0,J.jsxs)(c,{children:[`Matcher: `,(0,J.jsx)(c,{bold:!0,children:e.matcher||`(all)`})]}),(0,J.jsxs)(c,{children:[`Type: `,(0,J.jsx)(c,{bold:!0,children:e.config.type})]}),(0,J.jsxs)(c,{children:[`Source: `,(0,J.jsx)(c,{dimColor:!0,children:w(e.source)})]}),e.pluginName&&(0,J.jsxs)(c,{children:[`Plugin: `,(0,J.jsx)(c,{dimColor:!0,children:e.pluginName})]})]}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(c,{dimColor:!0,children:[le(e.config),`:`]}),(0,J.jsx)(o,{borderStyle:`round`,borderDimColor:!0,paddingLeft:1,paddingRight:1,children:(0,J.jsx)(c,{children:ue(e.config)})})]}),`statusMessage`in e.config&&e.config.statusMessage&&(0,J.jsxs)(c,{children:[`Status message: `,(0,J.jsx)(c,{dimColor:!0,children:e.config.statusMessage})]}),(0,J.jsx)(c,{dimColor:!0,children:`To modify or remove this hook, edit settings.json directly or ask Claude to help.`})]})})}function le(e){switch(e.type){case`command`:return`Command`;case`prompt`:return`Prompt`;case`agent`:return`Prompt`;case`http`:return`URL`}}function ue(e){switch(e.type){case`command`:return e.command;case`prompt`:return e.prompt;case`agent`:return e.prompt;case`http`:return e.url}}var J,Y=e((()=>{u(),d(),b(),J=p()}));function de({toolNames:e,onExit:t}){let[n,r]=(0,X.useState)({mode:`select-event`}),[i,a]=(0,X.useState)(()=>j()?.disableAllHooks===!0&&A(`policySettings`)?.disableAllHooks===!0),[s,u]=(0,X.useState)(()=>A(`policySettings`)?.allowManagedHooksOnly===!0);x(e=>{if(e===`policySettings`){let e=j()?.disableAllHooks===!0;a(e&&A(`policySettings`)?.disableAllHooks===!0),u(A(`policySettings`)?.allowManagedHooksOnly===!0)}});let d=n.mode,p=`event`in n?n.event:`PreToolUse`,m=`matcher`in n?n.matcher:null,h=O(e=>e.mcp),g=D(),_=(0,X.useMemo)(()=>[...e,...h.tools.map(e=>e.name)],[e,h.tools]),v=(0,X.useMemo)(()=>ae(g.getState(),_),[_,g]),y=(0,X.useMemo)(()=>oe(v,p),[v,p]),b=(0,X.useMemo)(()=>F(v,p,m),[v,p,m]),S=(0,X.useCallback)(()=>{t(`Hooks dialog dismissed`,{display:`system`})},[t]);l(`confirm:no`,S,{context:`Confirmation`,isActive:d===`select-event`}),l(`confirm:no`,()=>{r({mode:`select-event`})},{context:`Confirmation`,isActive:d===`select-matcher`}),l(`confirm:no`,()=>{`event`in n&&(I(n.event,_)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event}))},{context:`Confirmation`,isActive:d===`select-hook`}),l(`confirm:no`,()=>{if(n.mode===`view-hook`){let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}},{context:`Confirmation`,isActive:d===`view-hook`});let C=L(_),w=j()?.disableAllHooks===!0,{hooksByEvent:T,totalHooksCount:E}=(0,X.useMemo)(()=>{let e={},t=0;for(let[n,r]of Object.entries(v)){let i=Object.values(r).reduce((e,t)=>e+t.length,0);e[n]=i,t+=i}return{hooksByEvent:e,totalHooksCount:t}},[v]);if(w)return(0,Z.jsx)(f,{title:`Hook Configuration - Disabled`,onCancel:S,inputGuide:()=>(0,Z.jsx)(c,{children:`Esc to close`}),children:(0,Z.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,Z.jsxs)(o,{flexDirection:`column`,children:[(0,Z.jsxs)(c,{children:[`All hooks are currently `,(0,Z.jsx)(c,{bold:!0,children:`disabled`}),i&&` by a managed settings file`,`. You have `,(0,Z.jsx)(c,{bold:!0,children:E}),` `,`configured `,N(E,`hook`),` that `,N(E,`is`,`are`),` not running.`]}),(0,Z.jsx)(o,{marginTop:1,children:(0,Z.jsx)(c,{dimColor:!0,children:`When hooks are disabled:`})}),(0,Z.jsx)(c,{dimColor:!0,children:`· No hook commands will execute`}),(0,Z.jsx)(c,{dimColor:!0,children:`· StatusLine will not be displayed`}),(0,Z.jsx)(c,{dimColor:!0,children:`· Tool operations will proceed without hook validation`})]}),!i&&(0,Z.jsx)(c,{dimColor:!0,children:`To re-enable hooks, remove "disableAllHooks" from settings.json or ask Claude.`})]})});switch(n.mode){case`select-event`:return(0,Z.jsx)(z,{hookEventMetadata:C,hooksByEvent:T,totalHooksCount:E,restrictedByPolicy:s,onSelectEvent:e=>{I(e,_)===void 0?r({mode:`select-hook`,event:e,matcher:``}):r({mode:`select-matcher`,event:e})},onCancel:S});case`select-matcher`:return(0,Z.jsx)(G,{selectedEvent:n.event,matchersForSelectedEvent:y,hooksByEventAndMatcher:v,eventDescription:C[n.event].description,onSelect:e=>{r({mode:`select-hook`,event:n.event,matcher:e})},onCancel:()=>{r({mode:`select-event`})}});case`select-hook`:return(0,Z.jsx)(H,{selectedEvent:n.event,selectedMatcher:n.matcher,hooksForSelectedMatcher:b,hookEventMetadata:C[n.event],onSelect:e=>{r({mode:`view-hook`,event:n.event,hook:e})},onCancel:()=>{I(n.event,_)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event})}});case`view-hook`:return(0,Z.jsx)(ce,{selectedHook:n.hook,eventSupportsMatcher:I(n.event,_)!==void 0,onCancel:()=>{let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}})}}var X,Z,fe=e((()=>{u(),X=t(u(),1),ee(),k(),d(),ie(),R(),M(),P(),V(),W(),se(),Y(),Z=p()})),Q,$;e((()=>{fe(),ne(),C(),Q=p(),$=async(e,t)=>{re(`tengu_hooks_command`,{});let n=t.getAppState().toolPermissionContext;return(0,Q.jsx)(de,{toolNames:T(n).map(e=>e.name),onExit:e})}}))();export{$ as call};
@@ -0,0 +1 @@
1
+ import{Zt as e,dn as t,vn as n,yn as r}from"./loadAgentsDir-nzr38hai.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{o as t}from"./log-B3eB4EFv.js";function n(e){let t;try{t=new URL(e).hostname}catch{throw Error(`assertWorkspaceHost: invalid URL "${e}". Workspace API key requests must target ${i}.`)}if(t!==i)throw Error(`assertWorkspaceHost: refusing to send workspace API key to non-Anthropic host "${t}". Workspace API key requests must target ${i}. If you are using a custom base URL, workspace endpoints are only available on the Anthropic API.`)}function r(e){let t;try{t=new URL(e).hostname}catch{throw Error(`assertSubscriptionBaseUrl: invalid URL "${e}". Subscription OAuth requests must target ${i}.`)}if(t!==i)throw Error(`assertSubscriptionBaseUrl: refusing subscription OAuth request to non-Anthropic host "${t}". Subscription OAuth requests must target ${i}.`)}var i,a=e((()=>{t(),i=`api.anthropic.com`}));export{n,a as r,r as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./inboundAttachments-DVs3_m48.js";export{e as resolveAndPrepend};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{A as i,p as a,t as o,w as s}from"./v4-jw6qOKwQ.js";import{en as c,ht as l}from"./state-4KQ3kaqz.js";import{l as u,p as d}from"./debug-IKW-jE7K.js";import{n as f,t as p}from"./lazySchema-uxlVVNM1.js";import{a as m,n as h,t as g}from"./bridgeConfig-CCtXe8ak.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),o(),c(),u(),t(),p(),m();var S=3e4;function C(e){d(`[bridge:inbound-attach] ${e}`)}var w=f(()=>s({file_uuid:i(),file_name:i()})),T=f(()=>a(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,l())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as d,t as f}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{channel as p,tracingChannel as m}from"node:diagnostics_channel";function h(){let e=new ke(c(w,this)),t=new ke(c(w,this));u(U,this,e),u(H,this,t);let n=this.ttlAutopurge?Array.from({length:c(w,this)}):void 0;u(W,this,n),u(he,this,(n,r,a=c(k,this).now())=>{t[n]=r===0?0:a,e[n]=r,i(n,r)}),u(Y,this,n=>{t[n]=e[n]===0?0:c(k,this).now(),i(n,e[n])});let i=this.ttlAutopurge?(e,t)=>{if(n?.[e]&&(clearTimeout(n[e]),n[e]=void 0),t&&t!==0&&n){let a=setTimeout(()=>{c(Z,this).call(this,e)?(r(J,this,S).call(this,c(N,this)[e],`expire`),n[e]=void 0):i(e,s(e))},t+1);a.unref&&a.unref(),n[e]=a}}:()=>{};u(X,this,(n,r)=>{if(e[r]){let i=e[r],s=t[r];if(!i||!s)return;n.ttl=i,n.start=s,n.now=a||o(),n.remainingTTL=i-(n.now-s)}});let a=0,o=()=>{let e=c(k,this).now();if(this.ttlResolution>0){a=e;let t=setTimeout(()=>a=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=c(M,this).get(e);return t===void 0?0:s(t)};let s=n=>{let r=e[n],i=t[n];return!r||!i?1/0:r-((a||o())-i)};u(Z,this,n=>{let r=t[n],i=e[n];return!!i&&!!r&&(a||o())-r>i})}function g(){let e=new ke(c(w,this));u(j,this,0),u(V,this,e),u(ge,this,t=>{u(j,this,c(j,this)-e[t]),e[t]=0}),u(ve,this,(e,t,n,i)=>{if(!$(n)){if(r(J,this,x).call(this,t))return this.backgroundFetchSize;if(i){if(typeof i!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=i(t,e),!$(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`)}return n}),u(_e,this,(t,n,i)=>{if(e[t]=n,c(T,this)){let n=c(T,this)-e[t];for(;c(j,this)>n;)r(J,this,b).call(this,!0)}u(j,this,c(j,this)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=c(j,this))})}function*_({allowStale:e=this.allowStale}={}){if(c(A,this))for(let t=c(R,this);r(J,this,ee).call(this,t)&&((e||!c(Z,this).call(this,t))&&(yield t),t!==c(L,this));)t=c(I,this)[t]}function*v({allowStale:e=this.allowStale}={}){if(c(A,this))for(let t=c(L,this);r(J,this,ee).call(this,t)&&((e||!c(Z,this).call(this,t))&&(yield t),t!==c(R,this));)t=c(F,this)[t]}function ee(e){return e!==void 0&&c(M,this).get(c(N,this)[e])===e}function y(e,t,n,i){var a;let{ttl:o=this.ttl,start:s,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:f}=n,p=r(J,this,x).call(this,t);if(t===void 0)return f&&(f.set=`deleted`),this.delete(e),this;let{noUpdateTTL:m=this.noUpdateTTL}=n;f&&!p&&(f.value=t);let g=c(ve,this).call(this,e,t,n.size||0,d,f);if(this.maxEntrySize&&g>this.maxEntrySize)return r(J,this,S).call(this,e,`set`),f&&(f.set=`miss`,f.maxEntrySizeExceeded=!0),this;let _=c(A,this)===0?void 0:c(M,this).get(e);if(_===void 0)_=c(A,this)===0?c(R,this):c(z,this).length===0?c(A,this)===c(w,this)?r(J,this,b).call(this,!1):c(A,this):c(z,this).pop(),c(N,this)[_]=e,c(P,this)[_]=t,c(M,this).set(e,_),c(F,this)[c(R,this)]=_,c(I,this)[_]=c(R,this),u(R,this,_),u(A,this,(a=c(A,this),a++,a)),c(_e,this).call(this,_,g,f),f&&(f.set=`add`),m=!1,c(q,this)&&!p&&c(D,this)?.call(this,t,e,`add`);else{r(J,this,le).call(this,_);let n=c(P,this)[_];if(t!==n){if(!l)if(r(J,this,x).call(this,n)){n!==i&&n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:r}=n;r!==void 0&&r!==t&&(c(G,this)&&c(E,this)?.call(this,r,e,`set`),c(K,this)&&c(B,this)?.push([r,e,`set`]))}else c(G,this)&&c(E,this)?.call(this,n,e,`set`),c(K,this)&&c(B,this)?.push([n,e,`set`]);if(c(ge,this).call(this,_),c(_e,this).call(this,_,g,f),c(P,this)[_]=t,!p){let i=n&&r(J,this,x).call(this,n)?n.__staleWhileFetching:n,a=i===void 0?`add`:t===i?`update`:`replace`;f&&(f.set=a,i!==void 0&&(f.oldValue=i)),c(q,this)&&this.onInsert?.(t,e,a)}}else p||(f&&(f.set=`update`),c(q,this)&&this.onInsert?.(t,e,`update`))}if(o!==0&&!c(U,this)&&r(J,this,h).call(this),c(U,this)&&(m||c(he,this).call(this,_,o,s),f&&c(X,this).call(this,f,_)),!l&&c(K,this)&&c(B,this)){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}return this}function b(e){var t;let n=c(L,this),i=c(N,this)[n],a=c(P,this)[n],o=r(J,this,x).call(this,a);o&&a.__abortController.abort(Error(`evicted`));let s=o?a.__staleWhileFetching:a;return(c(G,this)||c(K,this))&&s!==void 0&&(c(G,this)&&c(E,this)?.call(this,s,i,`evict`),c(K,this)&&c(B,this)?.push([s,i,`evict`])),c(ge,this).call(this,n),c(W,this)?.[n]&&(clearTimeout(c(W,this)[n]),c(W,this)[n]=void 0),e&&(c(N,this)[n]=void 0,c(P,this)[n]=void 0,c(z,this).push(n)),c(A,this)===1?(u(L,this,u(R,this,0)),c(z,this).length=0):u(L,this,c(F,this)[n]),c(M,this).delete(i),u(A,this,(t=c(A,this),t--,t)),n}function te(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,a=c(M,this).get(e);if(a!==void 0){let e=c(P,this)[a];if(r(J,this,x).call(this,e)&&e.__staleWhileFetching===void 0)return!1;if(c(Z,this).call(this,a))i&&(i.has=`stale`,c(X,this).call(this,i,a));else return n&&c(Y,this).call(this,a),i&&(i.has=`hit`,c(X,this).call(this,i,a)),!0}else i&&(i.has=`miss`);return!1}function ne(e,t){let{status:n,allowStale:i=this.allowStale}=t,a=c(M,this).get(e);if(a===void 0||!i&&c(Z,this).call(this,a)){n&&(n.peek=a===void 0?`miss`:`stale`);return}let o=c(P,this)[a],s=r(J,this,x).call(this,o)?o.__staleWhileFetching:o;return n&&(s===void 0?n.peek=`miss`:(n.peek=`hit`,n.value=s)),s}function re(e,t,n,i){let a=t===void 0?void 0:c(P,this)[t];if(r(J,this,x).call(this,a))return a;let o=new AbortController,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=(i,a=!1)=>{let{aborted:s}=o.signal,u=n.ignoreFetchAbort&&i!==void 0,d=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&i!==void 0);if(n.status&&(s&&!a?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,u&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!u&&!a)return f(o.signal.reason,d);let p=m,h=c(P,this)[t];return(h===m||h===void 0&&u&&a)&&(i===void 0?p.__staleWhileFetching===void 0?r(J,this,S).call(this,e,`fetch`):c(P,this)[t]=p.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),r(J,this,y).call(this,e,i,l.options,p))),i},d=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),f(e,!1)),f=(i,a)=>{let{aborted:s}=o.signal,l=s&&n.allowStaleOnFetchAbort,u=l||n.allowStaleOnFetchRejection,d=u||n.noDeleteOnFetchRejection,f=m;if(c(P,this)[t]===m&&(!d||!a&&f.__staleWhileFetching===void 0?r(J,this,S).call(this,e,`fetch`):l||(c(P,this)[t]=f.__staleWhileFetching)),u)return n.status&&f.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw i},p=(t,r)=>{let i=c(fe,this)?.call(this,e,a,l);o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))}),i&&i instanceof Promise?i.then(e=>t(e===void 0?void 0:e),r):i!==void 0&&t(i)};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(p).then(u,d),h=Object.assign(m,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return t===void 0?(r(J,this,y).call(this,e,h,{...l.options,status:void 0}),t=c(M,this).get(e)):c(P,this)[t]=h,h}function x(e){if(!c(me,this))return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof AbortController}async function ie(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:g,forceRefresh:_=!1,status:v,signal:ee}=t;if(v&&(v.op=`fetch`,v.key=e,_&&(v.forceRefresh=!0),v.cache=this),!c(me,this))return v&&(v.fetch=`get`),r(J,this,se).call(this,e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:v});let y={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:s,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:h,ignoreFetchAbort:m,status:v,signal:ee},b=c(M,this).get(e);if(b===void 0){v&&(v.fetch=`miss`);let t=r(J,this,re).call(this,e,b,y,g);return t.__returned=t}else{let t=c(P,this)[b];if(r(J,this,x).call(this,t)){let e=n&&t.__staleWhileFetching!==void 0;return v&&(v.fetch=`inflight`,e&&(v.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let a=c(Z,this).call(this,b);if(!_&&!a)return v&&(v.fetch=`hit`),r(J,this,le).call(this,b),i&&c(Y,this).call(this,b),v&&c(X,this).call(this,v,b),t;let o=r(J,this,re).call(this,e,b,y,g),s=o.__staleWhileFetching!==void 0&&n;return v&&(v.fetch=a?`stale`:`refresh`,s&&a&&(v.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async function ae(e,t={}){let n=await r(J,this,ie).call(this,e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}function oe(e,t={}){let n=c(pe,this);if(!n)throw Error(`no memoMethod provided to constructor`);let{context:i,status:a,forceRefresh:o,...s}=t;a&&o&&(a.forceRefresh=!0);let l=r(J,this,se).call(this,e,s),u=o||l===void 0;if(a&&(a.memo=u?`miss`:`hit`,u||(a.value=l)),!u)return l;let d=n(e,l,{options:s,context:i});return a&&(a.value=d),r(J,this,y).call(this,e,d,s),d}function se(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=t,s=c(M,this).get(e);if(s===void 0){o&&(o.get=`miss`);return}let l=c(P,this)[s],u=r(J,this,x).call(this,l);return o&&c(X,this).call(this,o,s),c(Z,this).call(this,s)?u?(o&&(o.get=`stale-fetching`),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(a||r(J,this,S).call(this,e,`expire`),o&&(o.get=`stale`),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?`fetching`:`hit`),r(J,this,le).call(this,s),i&&c(Y,this).call(this,s),u?l.__staleWhileFetching:l)}function ce(e,t){c(I,this)[t]=e,c(F,this)[e]=t}function le(e){e!==c(R,this)&&(e===c(L,this)?u(L,this,c(F,this)[e]):r(J,this,ce).call(this,c(I,this)[e],c(F,this)[e]),r(J,this,ce).call(this,c(R,this),e),u(R,this,e))}function S(e,t){Q.hasSubscribers&&Q.publish({op:`delete`,delete:t,key:e,cache:this});let n=!1;if(c(A,this)!==0){let a=c(M,this).get(e);if(a!==void 0)if(c(W,this)?.[a]&&(clearTimeout(c(W,this)[a]),c(W,this)[a]=void 0),n=!0,c(A,this)===1)r(J,this,ue).call(this,t);else{var i;c(ge,this).call(this,a);let n=c(P,this)[a];if(r(J,this,x).call(this,n)?n.__abortController.abort(Error(`deleted`)):(c(G,this)||c(K,this))&&(c(G,this)&&c(E,this)?.call(this,n,e,t),c(K,this)&&c(B,this)?.push([n,e,t])),c(M,this).delete(e),c(N,this)[a]=void 0,c(P,this)[a]=void 0,a===c(R,this))u(R,this,c(I,this)[a]);else if(a===c(L,this))u(L,this,c(F,this)[a]);else{let e=c(I,this)[a];c(F,this)[e]=c(F,this)[a];let t=c(F,this)[a];c(I,this)[t]=c(I,this)[a]}u(A,this,(i=c(A,this),i--,i)),c(z,this).push(a)}}if(c(K,this)&&c(B,this)?.length){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}return n}function ue(e){for(let t of r(J,this,v).call(this,{allowStale:!0})){let n=c(P,this)[t];if(r(J,this,x).call(this,n))n.__abortController.abort(Error(`deleted`));else{let r=c(N,this)[t];c(G,this)&&c(E,this)?.call(this,n,r,e),c(K,this)&&c(B,this)?.push([n,r,e])}}if(c(M,this).clear(),c(P,this).fill(void 0),c(N,this).fill(void 0),c(U,this)&&c(H,this)){c(U,this).fill(0),c(H,this).fill(0);for(let e of c(W,this)??[])e!==void 0&&clearTimeout(e);c(W,this)?.fill(void 0)}if(c(V,this)&&c(V,this).fill(0),u(L,this,0),u(R,this,0),c(z,this).length=0,u(j,this,0),u(A,this,0),c(K,this)&&c(B,this)){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}}var C,de,w,T,E,D,O,fe,pe,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,me,K,q,J,Y,X,he,Z,ge,_e,ve,ye,be,Q,xe,Se,Ce,we,Te,Ee,De,$,Oe,ke,Ae,je,Me=e((()=>{t(),s(),d(),i(),a(),o(),Q=p(`lru-cache:metrics`),xe=m(`lru-cache`),Se=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Ce=()=>Q.hasSubscribers||xe.hasSubscribers,we=new Set,Te=typeof process==`object`&&process?process:{},Ee=(e,t,n,r)=>{typeof Te.emitWarning==`function`?Te.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},De=e=>!we.has(e),$=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),Oe=e=>$(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?ke:null:null,ke=class extends Array{constructor(e){super(e),this.fill(0)}},Ae=(C=class e{static create(t){let n=Oe(t);if(!n)return[];de._=r(C,e,!0);let i=new e(t,n);return de._=r(C,e,!1),i}constructor(t,i){if(n(this,`heap`,void 0),n(this,`length`,void 0),!r(C,e,de)._)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new i(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},de={_:!1},C),je=(w=new WeakMap,T=new WeakMap,E=new WeakMap,D=new WeakMap,O=new WeakMap,fe=new WeakMap,pe=new WeakMap,k=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,F=new WeakMap,I=new WeakMap,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,me=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakSet,Y=new WeakMap,X=new WeakMap,he=new WeakMap,Z=new WeakMap,ge=new WeakMap,_e=new WeakMap,ve=new WeakMap,be=Symbol.iterator,ye=Symbol.toStringTag,class e{get perf(){return c(k,this)}static unsafeExposeInternals(e){return{starts:c(H,e),ttls:c(U,e),autopurgeTimers:c(W,e),sizes:c(V,e),keyMap:c(M,e),keyList:c(N,e),valList:c(P,e),next:c(F,e),prev:c(I,e),get head(){return c(L,e)},get tail(){return c(R,e)},free:c(z,e),isBackgroundFetch:t=>r(J,e,x).call(e,t),backgroundFetch:(t,n,i,a)=>r(J,e,re).call(e,t,n,i,a),moveToTail:t=>r(J,e,le).call(e,t),indexes:t=>r(J,e,_).call(e,t),rindexes:t=>r(J,e,v).call(e,t),isStale:t=>c(Z,e).call(e,t)}}get max(){return c(w,this)}get maxSize(){return c(T,this)}get calculatedSize(){return c(j,this)}get size(){return c(A,this)}get fetchMethod(){return c(fe,this)}get memoMethod(){return c(pe,this)}get dispose(){return c(E,this)}get onInsert(){return c(D,this)}get disposeAfter(){return c(O,this)}constructor(t){f(this,J),l(this,w,void 0),l(this,T,void 0),l(this,E,void 0),l(this,D,void 0),l(this,O,void 0),l(this,fe,void 0),l(this,pe,void 0),l(this,k,void 0),n(this,`ttl`,void 0),n(this,`ttlResolution`,void 0),n(this,`ttlAutopurge`,void 0),n(this,`updateAgeOnGet`,void 0),n(this,`updateAgeOnHas`,void 0),n(this,`allowStale`,void 0),n(this,`noDisposeOnSet`,void 0),n(this,`noUpdateTTL`,void 0),n(this,`maxEntrySize`,void 0),n(this,`sizeCalculation`,void 0),n(this,`noDeleteOnFetchRejection`,void 0),n(this,`noDeleteOnStaleGet`,void 0),n(this,`allowStaleOnFetchAbort`,void 0),n(this,`allowStaleOnFetchRejection`,void 0),n(this,`ignoreFetchAbort`,void 0),n(this,`backgroundFetchSize`,void 0),l(this,A,void 0),l(this,j,void 0),l(this,M,void 0),l(this,N,void 0),l(this,P,void 0),l(this,F,void 0),l(this,I,void 0),l(this,L,void 0),l(this,R,void 0),l(this,z,void 0),l(this,B,void 0),l(this,V,void 0),l(this,H,void 0),l(this,U,void 0),l(this,W,void 0),l(this,G,void 0),l(this,me,void 0),l(this,K,void 0),l(this,q,void 0),l(this,Y,()=>{}),l(this,X,()=>{}),l(this,he,()=>{}),l(this,Z,()=>!1),l(this,ge,e=>{}),l(this,_e,(e,t,n)=>{}),l(this,ve,(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0}),n(this,ye,`LRUCache`);let{max:i=0,ttl:a,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:d,updateAgeOnHas:p,allowStale:m,dispose:_,onInsert:v,disposeAfter:ee,noDisposeOnSet:y,noUpdateTTL:b,maxSize:te=0,maxEntrySize:ne=0,sizeCalculation:re,fetchMethod:x,memoMethod:ie,noDeleteOnFetchRejection:ae,noDeleteOnStaleGet:oe,allowStaleOnFetchRejection:se,allowStaleOnFetchAbort:ce,ignoreFetchAbort:le,backgroundFetchSize:S=1,perf:ue}=t;if(this.backgroundFetchSize=S,ue!==void 0&&typeof ue?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(u(k,this,ue??Se),i!==0&&!$(i))throw TypeError(`max option must be a nonnegative integer`);let C=i?Oe(i):Array;if(!C)throw Error(`invalid max value: `+i);if(u(w,this,i),u(T,this,te),this.maxEntrySize=ne||c(T,this),this.sizeCalculation=re,this.sizeCalculation){if(!c(T,this)&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(ie!==void 0&&typeof ie!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(u(pe,this,ie),x!==void 0&&typeof x!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(u(fe,this,x),u(me,this,!!x),u(M,this,new Map),u(N,this,Array.from({length:i}).fill(void 0)),u(P,this,Array.from({length:i}).fill(void 0)),u(F,this,new C(i)),u(I,this,new C(i)),u(L,this,0),u(R,this,0),u(z,this,Ae.create(i)),u(A,this,0),u(j,this,0),typeof _==`function`&&u(E,this,_),typeof v==`function`&&u(D,this,v),typeof ee==`function`?(u(O,this,ee),u(B,this,[])):(u(O,this,void 0),u(B,this,void 0)),u(G,this,!!c(E,this)),u(q,this,!!c(D,this)),u(K,this,!!c(O,this)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!ae,this.allowStaleOnFetchRejection=!!se,this.allowStaleOnFetchAbort=!!ce,this.ignoreFetchAbort=!!le,this.maxEntrySize!==0){if(c(T,this)!==0&&!$(c(T,this)))throw TypeError(`maxSize must be a positive integer if specified`);if(!$(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);r(J,this,g).call(this)}if(this.allowStale=!!m,this.noDeleteOnStaleGet=!!oe,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!p,this.ttlResolution=$(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=a||0,this.ttl){if(!$(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);r(J,this,h).call(this)}if(c(w,this)===0&&this.ttl===0&&c(T,this)===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!c(w,this)&&!c(T,this)){let t=`LRU_CACHE_UNBOUNDED`;De(t)&&(we.add(t),Ee(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return c(M,this).has(e)?1/0:0}*entries(){for(let e of r(J,this,_).call(this))c(P,this)[e]!==void 0&&c(N,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield[c(N,this)[e],c(P,this)[e]])}*rentries(){for(let e of r(J,this,v).call(this))c(P,this)[e]!==void 0&&c(N,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield[c(N,this)[e],c(P,this)[e]])}*keys(){for(let e of r(J,this,_).call(this)){let t=c(N,this)[e];t!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield t)}}*rkeys(){for(let e of r(J,this,v).call(this)){let t=c(N,this)[e];t!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield t)}}*values(){for(let e of r(J,this,_).call(this))c(P,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield c(P,this)[e])}*rvalues(){for(let e of r(J,this,v).call(this))c(P,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield c(P,this)[e])}[be](){return this.entries()}find(e,t={}){for(let n of r(J,this,_).call(this)){let i=c(P,this)[n],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,c(N,this)[n],this))return r(J,this,se).call(this,c(N,this)[n],t)}}forEach(e,t=this){for(let n of r(J,this,_).call(this)){let i=c(P,this)[n],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,c(N,this)[n],this)}}rforEach(e,t=this){for(let n of r(J,this,v).call(this)){let i=c(P,this)[n],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,c(N,this)[n],this)}}purgeStale(){let e=!1;for(let t of r(J,this,v).call(this,{allowStale:!0}))c(Z,this).call(this,t)&&(r(J,this,S).call(this,c(N,this)[t],`expire`),e=!0);return e}info(e){let t=c(M,this).get(e);if(t===void 0)return;let n=c(P,this)[t],i=r(J,this,x).call(this,n)?n.__staleWhileFetching:n;if(i===void 0)return;let a={value:i};if(c(U,this)&&c(H,this)){let e=c(U,this)[t],n=c(H,this)[t];e&&n&&(a.ttl=e-(c(k,this).now()-n),a.start=Date.now())}return c(V,this)&&(a.size=c(V,this)[t]),a}dump(){let e=[];for(let t of r(J,this,_).call(this,{allowStale:!0})){let n=c(N,this)[t],i=c(P,this)[t],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;let o={value:a};if(c(U,this)&&c(H,this)){o.ttl=c(U,this)[t];let e=c(k,this).now()-c(H,this)[t];o.start=Math.floor(Date.now()-e)}c(V,this)&&(o.size=c(V,this)[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=c(k,this).now()-e}r(J,this,y).call(this,t,n.value,n)}}set(e,t,n={}){let{status:i=Q.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op=`set`,i.key=e,t!==void 0&&(i.value=t),i.cache=this);let a=r(J,this,y).call(this,e,t,n);return i&&Q.hasSubscribers&&Q.publish(i),a}pop(){try{for(;c(A,this);){let e=c(P,this)[c(L,this)];if(r(J,this,b).call(this,!0),r(J,this,x).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(c(K,this)&&c(B,this)){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}}}has(e,t={}){let{status:n=Q.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`has`,n.key=e,n.cache=this);let i=r(J,this,te).call(this,e,t);return Q.hasSubscribers&&Q.publish(n),i}peek(e,t={}){let{status:n=Ce()?{}:void 0}=t;n&&(n.op=`peek`,n.key=e,n.cache=this),t.status=n;let i=r(J,this,ne).call(this,e,t);return Q.hasSubscribers&&Q.publish(n),i}fetch(e,t={}){let n=xe.hasSubscribers,{status:i=Ce()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let a=r(J,this,ie).call(this,e,t);return i&&n&&(i.trace=!0,xe.tracePromise(()=>a,i).catch(()=>{})),a}forceFetch(e,t={}){let n=xe.hasSubscribers,{status:i=Ce()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let a=r(J,this,ae).call(this,e,t);return i&&n&&(i.trace=!0,xe.tracePromise(()=>a,i).catch(()=>{})),a}memo(e,t={}){let{status:n=Q.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`memo`,n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=r(J,this,oe).call(this,e,t);return n&&(n.value=i),Q.hasSubscribers&&Q.publish(n),i}get(e,t={}){let{status:n=Q.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`get`,n.key=e,n.cache=this);let i=r(J,this,se).call(this,e,t);return n&&(i!==void 0&&(n.value=i),Q.hasSubscribers&&Q.publish(n)),i}delete(e){return r(J,this,S).call(this,e,`delete`)}clear(){return r(J,this,ue).call(this,`delete`)}})}));export{Me as n,je as t};