claude-code-zanii 2.8.4

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 (669) hide show
  1. package/README.md +146 -0
  2. package/dist/chunks/AddWorkspaceDirectory-y_rd6sRl.js +1 -0
  3. package/dist/chunks/App-DgWSavG1.js +1 -0
  4. package/dist/chunks/ApproveApiKey-CJKWha-a.js +1 -0
  5. package/dist/chunks/ApproveApiKey-DTs2ExZH.js +1 -0
  6. package/dist/chunks/AssistantSessionChooser-BAhVk4id.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-XU_JPh7R.js +2 -0
  8. package/dist/chunks/BypassPermissionsModeDialog-DV0Pi7ys.js +1 -0
  9. package/dist/chunks/ClaudeInChromeOnboarding-6erm_8Fn.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-CjBvzB5s.js +1 -0
  11. package/dist/chunks/ClaudeMdExternalIncludesDialog-ts0XnWwl.js +1 -0
  12. package/dist/chunks/ConsoleOAuthFlow-DySPdSqQ.js +1 -0
  13. package/dist/chunks/CustomSelect-DqZxzBZP.js +1 -0
  14. package/dist/chunks/DesktopHandoff-5c90JK88.js +1 -0
  15. package/dist/chunks/DevChannelsDialog-DCMderzu.js +1 -0
  16. package/dist/chunks/Dialog-Dgg8bqcG.js +1 -0
  17. package/dist/chunks/DiffDialog-BU765aqh.js +6 -0
  18. package/dist/chunks/Doctor-B73iDB-d.js +3 -0
  19. package/dist/chunks/Doctor-CLZDdNRo.js +1 -0
  20. package/dist/chunks/ExitFlow-DBqn2mUf.js +2 -0
  21. package/dist/chunks/Feedback-D-JHabwi.js +2 -0
  22. package/dist/chunks/Grove-D-uQNMMo.js +11 -0
  23. package/dist/chunks/HybridTransport-B-G4QJcy.js +4 -0
  24. package/dist/chunks/ITermBackend-KP1vKsRN.js +1 -0
  25. package/dist/chunks/InProcessTransport-ByBEKxrQ.js +1 -0
  26. package/dist/chunks/InvalidConfigDialog-CMqiZ5nG.js +1 -0
  27. package/dist/chunks/InvalidSettingsDialog-CjPCKzVZ.js +1 -0
  28. package/dist/chunks/ListItem-B6MyhHvM.js +1 -0
  29. package/dist/chunks/MCPConnectionManager-BJ8PcYPe.js +1 -0
  30. package/dist/chunks/Message-DNxJ_tMS.js +1 -0
  31. package/dist/chunks/MessageSelector-D79Ug71B.js +3 -0
  32. package/dist/chunks/Messages-CtIbkB2M.js +11 -0
  33. package/dist/chunks/Onboarding-DVrgKrI9.js +1 -0
  34. package/dist/chunks/OverageCreditUpsell-D_td1ss4.js +1 -0
  35. package/dist/chunks/PermissionDialog-BCS22yEO.js +1 -0
  36. package/dist/chunks/PermissionDialog-C5O1fL53.js +1 -0
  37. package/dist/chunks/PermissionRequestTitle-CtlbBU9t.js +1 -0
  38. package/dist/chunks/PluginSettings-OPrg-_3N.js +17 -0
  39. package/dist/chunks/PressEnterToContinue-DmzxIgbZ.js +1 -0
  40. package/dist/chunks/PromptInputFooterSuggestions-CcsKj5DK.js +1 -0
  41. package/dist/chunks/PromptInputHelpMenu-JedFdsxU.js +1 -0
  42. package/dist/chunks/REPL-ByhyIRnf.js +1 -0
  43. package/dist/chunks/REPL-Clve-8zC.js +157 -0
  44. package/dist/chunks/RemoteCallout-BZcabEKb.js +1 -0
  45. package/dist/chunks/RemoteSessionManager-C2PIFDHt.js +1 -0
  46. package/dist/chunks/ResumeConversation-D3ZRTFcF.js +1 -0
  47. package/dist/chunks/SSETransport-DmZWnH0k.js +4 -0
  48. package/dist/chunks/SearchBox-DQg2Ph0V.js +1 -0
  49. package/dist/chunks/SearchExtraToolsTool-CLO4nt6N.js +1 -0
  50. package/dist/chunks/SentryErrorBoundary-BVfBaOOU.js +2 -0
  51. package/dist/chunks/SentryErrorBoundary-DIaVFad-.js +1 -0
  52. package/dist/chunks/Settings-rOCxQdS8.js +2 -0
  53. package/dist/chunks/TeleportProgress-CP8IY6bz.js +1 -0
  54. package/dist/chunks/TeleportRepoMismatchDialog-DMmHgBqo.js +1 -0
  55. package/dist/chunks/TeleportResumeWrapper-D5wEAW1-.js +1 -0
  56. package/dist/chunks/ThemePicker-Bgr7yOQB.js +1 -0
  57. package/dist/chunks/TmuxBackend-BzbtUtP1.js +9 -0
  58. package/dist/chunks/TrustDialog-BI5U3BQ0.js +1 -0
  59. package/dist/chunks/TungstenTool-CiQclNwj.js +1 -0
  60. package/dist/chunks/TungstenTool-kMqy-ifa.js +1 -0
  61. package/dist/chunks/ValidationErrorsList-DprGtB2w.js +2 -0
  62. package/dist/chunks/WelcomeV2-C4vfBnIy.js +1 -0
  63. package/dist/chunks/WindowsTerminalBackend-BSoezOCE.js +2 -0
  64. package/dist/chunks/add-dir-DpOmv6kv.js +1 -0
  65. package/dist/chunks/agentDisplay-DuYEwOwO.js +1 -0
  66. package/dist/chunks/agents-BlurXZrF.js +2 -0
  67. package/dist/chunks/agents-DhZf7ftU.js +103 -0
  68. package/dist/chunks/ajv-CDrSAj3O.js +8 -0
  69. package/dist/chunks/analytics-i6X1et4O.js +1 -0
  70. package/dist/chunks/ant-D9hd_iYy.js +1 -0
  71. package/dist/chunks/api-CoaOHwDQ.js +4 -0
  72. package/dist/chunks/api-DvyGR-L7.js +1 -0
  73. package/dist/chunks/api-YHYC4Zdk.js +1 -0
  74. package/dist/chunks/artifacts-BMAYdaqh.js +1 -0
  75. package/dist/chunks/asciicast-DpHRoebc.js +1 -0
  76. package/dist/chunks/asciicast-HG1EoAQe.js +4 -0
  77. package/dist/chunks/assistant-D4-qcNT1.js +1 -0
  78. package/dist/chunks/assistant-DO2ZmZn1.js +1 -0
  79. package/dist/chunks/assistant-Dd86NmJM.js +1 -0
  80. package/dist/chunks/attributionHooks-BUmHrLhB.js +1 -0
  81. package/dist/chunks/attributionTrailer-r2Pbpu2N.js +1 -0
  82. package/dist/chunks/auth-CF3BGNYT.js +1 -0
  83. package/dist/chunks/auth-DwWwG43F.js +1 -0
  84. package/dist/chunks/auth-V_Xk2iea.js +1 -0
  85. package/dist/chunks/autoMode-DUksX5_i.js +45 -0
  86. package/dist/chunks/autoModeDenials-0CPO-Jbu.js +1 -0
  87. package/dist/chunks/autonomy-C5mNhAdz.js +21 -0
  88. package/dist/chunks/autonomy-CLt1dWaC.js +1 -0
  89. package/dist/chunks/autonomyPanel-rioFnrQO.js +1 -0
  90. package/dist/chunks/axios-DPuSPBlH.js +1 -0
  91. package/dist/chunks/axios-Zh7qGPze.js +12 -0
  92. package/dist/chunks/backgroundHousekeeping-BGtfqu-J.js +1 -0
  93. package/dist/chunks/backgroundHousekeeping-BqKZEvy0.js +17 -0
  94. package/dist/chunks/banner-BGLr3KYQ.js +2 -0
  95. package/dist/chunks/base64-js-B1tFNiG0.js +1 -0
  96. package/dist/chunks/bedrockClient-BFzWuhQK.js +15 -0
  97. package/dist/chunks/bg-B-YgGwLj.js +9 -0
  98. package/dist/chunks/bg-IU4gG3jc.js +1 -0
  99. package/dist/chunks/branch-BWY5W7hf.js +3 -0
  100. package/dist/chunks/break-cache-CY-O23fJ.js +8 -0
  101. package/dist/chunks/bridge-CqWd70vK.js +2 -0
  102. package/dist/chunks/bridgeConfig-CWO8AmCY.js +1 -0
  103. package/dist/chunks/bridgeConfig-D38y9eXn.js +1 -0
  104. package/dist/chunks/bridgeConfig-EwUq__ct.js +1 -0
  105. package/dist/chunks/bridgeConfig-GYR-LUiu.js +1 -0
  106. package/dist/chunks/bridgeEnabled-DKqmLnKO.js +1 -0
  107. package/dist/chunks/bridgeEnabled-DZIGDtfY.js +1 -0
  108. package/dist/chunks/bridgeMain-CXVks2ND.js +1 -0
  109. package/dist/chunks/bridgeMain-D4nsECwJ.js +68 -0
  110. package/dist/chunks/bridgeMessaging-BUOZU_ba.js +1 -0
  111. package/dist/chunks/bridgePointer-BpzIEsD_.js +1 -0
  112. package/dist/chunks/browser-D1vC3BNd.js +1 -0
  113. package/dist/chunks/btw-CVXJwoXo.js +1 -0
  114. package/dist/chunks/buddy-BLcvL8lP.js +3 -0
  115. package/dist/chunks/bundledMode-DQNSSQbt.js +1 -0
  116. package/dist/chunks/caches-BrfvzKn5.js +1 -0
  117. package/dist/chunks/caches-CkSv3MfC.js +3 -0
  118. package/dist/chunks/capacityWake-BWCSatN6.js +1 -0
  119. package/dist/chunks/changeDetector-DEZU6tum.js +1 -0
  120. package/dist/chunks/changeDetector-Df7c6U3d.js +1 -0
  121. package/dist/chunks/channelAllowlist-BApjAS0V.js +1 -0
  122. package/dist/chunks/channelNotification-BjWwF85R.js +1 -0
  123. package/dist/chunks/channelNotification-D01YVwNj.js +1 -0
  124. package/dist/chunks/chokidar-DPwMBcWI.js +1 -0
  125. package/dist/chunks/chokidar-DkDXNCTz.js +1 -0
  126. package/dist/chunks/chrome-D7coxEOI.js +1 -0
  127. package/dist/chunks/chromeNativeHost-CPj9M_4-.js +1 -0
  128. package/dist/chunks/chunk-DR8-3Aex.js +1 -0
  129. package/dist/chunks/classPrivateFieldSet2-DZkxcFPS.js +1 -0
  130. package/dist/chunks/claudeAiLimitsHook-ATshVrOH.js +1 -0
  131. package/dist/chunks/claudeDesktop-PVa9tWsM.js +1 -0
  132. package/dist/chunks/cleanup-C-PGmKpV.js +1 -0
  133. package/dist/chunks/clear-CxGE9Ntr.js +1 -0
  134. package/dist/chunks/cliLaunch-CMXoY_LO.js +1 -0
  135. package/dist/chunks/client-BWED8Tbu.js +35 -0
  136. package/dist/chunks/client-CinDjeSq.js +7 -0
  137. package/dist/chunks/client-CpXGg9e0.js +1 -0
  138. package/dist/chunks/color-B3w_VQTn.js +1 -0
  139. package/dist/chunks/color-convert-BQZnVz_5.js +1 -0
  140. package/dist/chunks/commands-DFp48zwy.js +1 -0
  141. package/dist/chunks/commitAttribution-B0cXmbvv.js +2 -0
  142. package/dist/chunks/commitAttribution-DRSKRoH6.js +1 -0
  143. package/dist/chunks/common-BX7bn3hg.js +1 -0
  144. package/dist/chunks/common-Ce3LanTX.js +1 -0
  145. package/dist/chunks/common-DdLQuE2_.js +1 -0
  146. package/dist/chunks/common-HfKcqOYK.js +1 -0
  147. package/dist/chunks/compact-C8ljGMdo.js +3 -0
  148. package/dist/chunks/companion-mD1jw6xX.js +1 -0
  149. package/dist/chunks/completionCache-BqQXVTa9.js +1 -0
  150. package/dist/chunks/completionCache-BtP4vfAi.js +4 -0
  151. package/dist/chunks/computerUseLock-ADE_PhIK.js +1 -0
  152. package/dist/chunks/config-CmyaIIOY.js +1 -0
  153. package/dist/chunks/config-Rl1Y_Dtq.js +1 -0
  154. package/dist/chunks/connectHeadless-MFABhXpz.js +1 -0
  155. package/dist/chunks/constants-BM62Vf_X.js +1 -0
  156. package/dist/chunks/constants-BfXy-5cI.js +1 -0
  157. package/dist/chunks/context-BeiZkUNq.js +1 -0
  158. package/dist/chunks/context-noninteractive-CRdF3iv8.js +54 -0
  159. package/dist/chunks/controlMessageCompat-591iGHUK.js +1 -0
  160. package/dist/chunks/conversation-BoguXZEI.js +1 -0
  161. package/dist/chunks/conversation-yhs7tT-g.js +1 -0
  162. package/dist/chunks/copy-BpeUcqku.js +7 -0
  163. package/dist/chunks/createSSHSession-B3JOB4TE.js +6 -0
  164. package/dist/chunks/createSession-BJSnFBGt.js +1 -0
  165. package/dist/chunks/createSession-CnRHI3RU.js +1 -0
  166. package/dist/chunks/cron-iqTFGIos.js +1 -0
  167. package/dist/chunks/cronScheduler-zRXhgEEU.js +6 -0
  168. package/dist/chunks/cronTasks-CMJldfoP.js +2 -0
  169. package/dist/chunks/crossProjectResume-DxO6TX30.js +40 -0
  170. package/dist/chunks/cwd-B2guYBbl.js +1 -0
  171. package/dist/chunks/cwd-B5bbyUwz.js +1 -0
  172. package/dist/chunks/cwd-BXiaJzLh.js +1 -0
  173. package/dist/chunks/daemon-B3v4OoOu.js +2 -0
  174. package/dist/chunks/dangerousBackend-OmCzoW35.js +1 -0
  175. package/dist/chunks/datadog-3-Vvz0yz.js +1 -0
  176. package/dist/chunks/datadog-BQlp3bTs.js +1 -0
  177. package/dist/chunks/debug-BDBIipC1.js +2 -0
  178. package/dist/chunks/debug-C7tW7DFW.js +1 -0
  179. package/dist/chunks/debug-CjIaNjpK.js +5 -0
  180. package/dist/chunks/debugUtils-Dsg-UHeg.js +1 -0
  181. package/dist/chunks/defineProperty-CaCI0a5T.js +1 -0
  182. package/dist/chunks/desktop-C_SS0068.js +1 -0
  183. package/dist/chunks/detached-B7RNZeyl.js +5 -0
  184. package/dist/chunks/detect-libc-DFFGDzPC.js +1 -0
  185. package/dist/chunks/detectRepository-BnTCJAXR.js +1 -0
  186. package/dist/chunks/detectRepository-Gobn9eFt.js +1 -0
  187. package/dist/chunks/detection-CN_uLGU2.js +1 -0
  188. package/dist/chunks/detection-DW6grIlc.js +1 -0
  189. package/dist/chunks/diff-B8YmRG5T.js +1 -0
  190. package/dist/chunks/directoryCompletion-J560aATd.js +1 -0
  191. package/dist/chunks/dist-B1wOprSs.js +29 -0
  192. package/dist/chunks/dist-DZQOarNX.js +5 -0
  193. package/dist/chunks/dist-HZfkKiUF.js +20 -0
  194. package/dist/chunks/dist-es-4xyrZoNc2.js +1 -0
  195. package/dist/chunks/dist-es-6kjvVbJd.js +1 -0
  196. package/dist/chunks/dist-es-BJldFHbt.js +3 -0
  197. package/dist/chunks/dist-es-BM013UFT.js +1 -0
  198. package/dist/chunks/dist-es-BPPewn1A.js +1 -0
  199. package/dist/chunks/dist-es-BZGG3Hnm.js +1 -0
  200. package/dist/chunks/dist-es-BZjJL64k2.js +1 -0
  201. package/dist/chunks/dist-es-BctcPxLN.js +1 -0
  202. package/dist/chunks/dist-es-Bf2jR30y.js +1 -0
  203. package/dist/chunks/dist-es-BgLoR-hQ.js +1 -0
  204. package/dist/chunks/dist-es-BismPcTW.js +1 -0
  205. package/dist/chunks/dist-es-BrPzXmSP.js +1 -0
  206. package/dist/chunks/dist-es-Bu21Wvhs.js +1 -0
  207. package/dist/chunks/dist-es-BuWNNAXW.js +1 -0
  208. package/dist/chunks/dist-es-Bz11sFiK2.js +1 -0
  209. package/dist/chunks/dist-es-C5VplyPL2.js +5 -0
  210. package/dist/chunks/dist-es-C66BuLgn.js +1 -0
  211. package/dist/chunks/dist-es-CCIzgNln2.js +1 -0
  212. package/dist/chunks/dist-es-CLyx7Kge2.js +1 -0
  213. package/dist/chunks/dist-es-CUbatGdn.js +1 -0
  214. package/dist/chunks/dist-es-CYe_-TbD.js +1 -0
  215. package/dist/chunks/dist-es-C_IHUdzL.js +1 -0
  216. package/dist/chunks/dist-es-Ci_rKlMr.js +1 -0
  217. package/dist/chunks/dist-es-ClDZBAj7.js +1 -0
  218. package/dist/chunks/dist-es-Cp--qjOi.js +1 -0
  219. package/dist/chunks/dist-es-CzE4kW1L.js +9 -0
  220. package/dist/chunks/dist-es-DUg5w7-v.js +1 -0
  221. package/dist/chunks/dist-es-Dl0ZRczY.js +1 -0
  222. package/dist/chunks/dist-es-Do_155z5.js +1 -0
  223. package/dist/chunks/dist-es-DxIM0jd82.js +1 -0
  224. package/dist/chunks/dist-es-Fav2oBDs.js +1 -0
  225. package/dist/chunks/dist-es-TZjwPaGn.js +1 -0
  226. package/dist/chunks/dist-es-W22ud2el2.js +1 -0
  227. package/dist/chunks/dist-es-aU8-02YH.js +1 -0
  228. package/dist/chunks/dist-es-b3yZSGx82.js +1 -0
  229. package/dist/chunks/dist-es-dIP5JtXz.js +5 -0
  230. package/dist/chunks/dist-es-mQ4HvnYs2.js +1 -0
  231. package/dist/chunks/distRoot-CJaacAHy.js +1 -0
  232. package/dist/chunks/doctor-DLZPF4iY.js +1 -0
  233. package/dist/chunks/earlyInput-BTI1CSNt.js +2 -0
  234. package/dist/chunks/earlyInput-BwGtzhhP.js +1 -0
  235. package/dist/chunks/effort-BaHvpBWr.js +9 -0
  236. package/dist/chunks/entry-_e-lyRwv.js +14 -0
  237. package/dist/chunks/env-CesrOJJq.js +1 -0
  238. package/dist/chunks/envLessBridgeConfig-4oys0_9A.js +1 -0
  239. package/dist/chunks/envLessBridgeConfig-DJ1Sts3F.js +1 -0
  240. package/dist/chunks/envUtils-CFG7IQID.js +1 -0
  241. package/dist/chunks/errorLogSink-Ti4Suoz6.js +2 -0
  242. package/dist/chunks/escHotkey-CVn_80xM.js +259 -0
  243. package/dist/chunks/esm-BFnjHW38.js +1 -0
  244. package/dist/chunks/esm-BQg_LX3V.js +1 -0
  245. package/dist/chunks/esm-BtC6CMmM.js +1 -0
  246. package/dist/chunks/esm-BwzC0MQp.js +1 -0
  247. package/dist/chunks/esm-CFybeQ_Q.js +1 -0
  248. package/dist/chunks/esm-CK-5CT5X.js +1 -0
  249. package/dist/chunks/esm-CL1OwlZB.js +1 -0
  250. package/dist/chunks/esm-CMzgSTAl.js +1 -0
  251. package/dist/chunks/esm-CPE_H2Lx.js +1 -0
  252. package/dist/chunks/esm-CcWquv5a.js +10 -0
  253. package/dist/chunks/esm-CeNEpRZt.js +1 -0
  254. package/dist/chunks/esm-D7hykoRB.js +1 -0
  255. package/dist/chunks/esm-DUtcefEV.js +1 -0
  256. package/dist/chunks/esm-DhrUwJBp.js +1 -0
  257. package/dist/chunks/esm-Duu1fRQ8.js +1 -0
  258. package/dist/chunks/esm-Ght2BaU2.js +1 -0
  259. package/dist/chunks/esm-Q6Yz2GMx.js +56 -0
  260. package/dist/chunks/esm-WONEiurY.js +13 -0
  261. package/dist/chunks/event-streams-BumpU1aB.js +1 -0
  262. package/dist/chunks/eventLoopStallDetector-DxyFdg1h.js +1 -0
  263. package/dist/chunks/execAsync-ChKxDZ8C.js +1 -0
  264. package/dist/chunks/execFileNoThrow-DdmR1mBS.js +1 -0
  265. package/dist/chunks/execSyncWrapper-Ch4TNj8u.js +1 -0
  266. package/dist/chunks/execa-BMaINL7N.js +34 -0
  267. package/dist/chunks/executor-C7INr19-.js +1 -0
  268. package/dist/chunks/executor-Dnf3YYma.js +1604 -0
  269. package/dist/chunks/exit-BakzsOD0.js +1 -0
  270. package/dist/chunks/exit-CiDn2tN9.js +2 -0
  271. package/dist/chunks/export-b-6pqMqz.js +2 -0
  272. package/dist/chunks/exportRenderer-RxtEIyTm.js +1 -0
  273. package/dist/chunks/extra-usage-7EPJNjNW.js +1 -0
  274. package/dist/chunks/extra-usage-ChvuewCq.js +1 -0
  275. package/dist/chunks/extra-usage-core-BVhLtoDF.js +1 -0
  276. package/dist/chunks/extra-usage-noninteractive-_Njh6q-q.js +1 -0
  277. package/dist/chunks/extraUsage-qOBMQB6g.js +1 -0
  278. package/dist/chunks/extractMemories-CRBVNiG1.js +1 -0
  279. package/dist/chunks/fast-C4uw_g7o.js +1 -0
  280. package/dist/chunks/fast-CEaIzaPl.js +1 -0
  281. package/dist/chunks/featureCheck-B1GSTyhh.js +1 -0
  282. package/dist/chunks/featureCheck-DKigAPal.js +1 -0
  283. package/dist/chunks/feedback-Bf3TjjuD.js +1 -0
  284. package/dist/chunks/figures-fES5sASd.js +1 -0
  285. package/dist/chunks/fileStateCache-DAsLEZau.js +1 -0
  286. package/dist/chunks/files-B-m_4X8b.js +2 -0
  287. package/dist/chunks/findExecutable-D8vJrFnO.js +1 -0
  288. package/dist/chunks/firstPartyEventLogger-BtrGagNa.js +1 -0
  289. package/dist/chunks/flushGate-2zqab-Pp.js +1 -0
  290. package/dist/chunks/foundry-sdk-CtX8C0x3.js +1 -0
  291. package/dist/chunks/fpsMetrics-ts_jaF3g.js +1 -0
  292. package/dist/chunks/fuse-ivQ_eRwF.js +1 -0
  293. package/dist/chunks/gates-CmKoQ0O-.js +1 -0
  294. package/dist/chunks/gates-_wbPDQ3M.js +1 -0
  295. package/dist/chunks/gemini-DRx495gn.js +3 -0
  296. package/dist/chunks/generateRecap-Cv8gd_QF.js +1 -0
  297. package/dist/chunks/generateSessionName-Dpjg-u_x.js +1 -0
  298. package/dist/chunks/genericProcessUtils-BFJMxLqn.js +23 -0
  299. package/dist/chunks/getMachineId-bsd-C9pL9Ajr.js +1 -0
  300. package/dist/chunks/getMachineId-darwin-Ma4F9rJg.js +2 -0
  301. package/dist/chunks/getMachineId-linux-C0lXMqsj.js +1 -0
  302. package/dist/chunks/getMachineId-unsupported-ByHQTXat.js +1 -0
  303. package/dist/chunks/getMachineId-win-DZsXZmTz.js +1 -0
  304. package/dist/chunks/git-Bj8Ow4pJ.js +6 -0
  305. package/dist/chunks/git-Q_b4oZ17.js +1 -0
  306. package/dist/chunks/githubRepoPathMapping-DGivBX9h.js +1 -0
  307. package/dist/chunks/goal-BrHEJv8o.js +3 -0
  308. package/dist/chunks/goalStorage-CsuPOQbk.js +1 -0
  309. package/dist/chunks/graceful-fs-BuPWC-vB.js +2 -0
  310. package/dist/chunks/grok-CDkDDaY_.js +1 -0
  311. package/dist/chunks/growthbook-D3_Cr9n-.js +1 -0
  312. package/dist/chunks/growthbook-p4aJ_UMv.js +32 -0
  313. package/dist/chunks/hash-KW-tVnPp.js +1 -0
  314. package/dist/chunks/heapdump-CloylIZ9.js +5 -0
  315. package/dist/chunks/help-DpSJlHIc.js +1 -0
  316. package/dist/chunks/hooks-2pogt8nv.js +79 -0
  317. package/dist/chunks/hooks-BBODdwnE.js +1 -0
  318. package/dist/chunks/hostAdapter-B5KTUqhv.js +1 -0
  319. package/dist/chunks/hostGuard-DyWr2TwE.js +1 -0
  320. package/dist/chunks/httpAuthSchemes-CgPbtGos.js +13 -0
  321. package/dist/chunks/ide-CJEcfBZq.js +2 -0
  322. package/dist/chunks/inboundAttachments-RNpYpRTO.js +1 -0
  323. package/dist/chunks/index.min-DCDiLq-j.js +1 -0
  324. package/dist/chunks/initReplBridge-D2E6IM2B.js +1 -0
  325. package/dist/chunks/initReplBridge-p2uwDBPx.js +1 -0
  326. package/dist/chunks/insights-DnpZScKs.js +822 -0
  327. package/dist/chunks/install-D_vTxUlG.js +1 -0
  328. package/dist/chunks/install-github-app-BK8A7g3i.js +147 -0
  329. package/dist/chunks/install-slack-app-C47R9VoI.js +1 -0
  330. package/dist/chunks/instinctParser-DxKdI3JC.js +1 -0
  331. package/dist/chunks/instrumentation-DkdAJFrZ.js +12 -0
  332. package/dist/chunks/intl-Pse97ORk.js +1 -0
  333. package/dist/chunks/isObject-DaxDnPKm.js +1 -0
  334. package/dist/chunks/isSymbol-D7QeUnS5.js +1 -0
  335. package/dist/chunks/job-opl00C4l.js +2 -0
  336. package/dist/chunks/json-bigint-BRRVs1dv.js +8 -0
  337. package/dist/chunks/jsx-runtime-BTgGEFjL.js +1 -0
  338. package/dist/chunks/jws-B_ieuaZg.js +3 -0
  339. package/dist/chunks/jwtUtils-D-tJzoJY.js +1 -0
  340. package/dist/chunks/keybindings-mRf9VSe8.js +2 -0
  341. package/dist/chunks/lang-eH4EJErj.js +1 -0
  342. package/dist/chunks/language-DD9ar6RA.js +1 -0
  343. package/dist/chunks/language-EZLNdETg.js +1 -0
  344. package/dist/chunks/launchAgentsPlatform-Cq0_7-IM.js +1 -0
  345. package/dist/chunks/launchAutofixPr-Bw7aUHUs.js +18 -0
  346. package/dist/chunks/launchCommand-Bk1Fn-qZ.js +1 -0
  347. package/dist/chunks/launchLocalMemory-CLBCUgwd.js +3 -0
  348. package/dist/chunks/launchLocalVault-BfWJWrBg.js +3 -0
  349. package/dist/chunks/launchMemoryStores-DdnSVSDZ.js +1 -0
  350. package/dist/chunks/launchOnboarding-ziCEX3GI.js +8 -0
  351. package/dist/chunks/launchSchedule-G_c7sgmy.js +1 -0
  352. package/dist/chunks/launchSkillStore-Z1Kd7nCg.js +1 -0
  353. package/dist/chunks/launchTeleport-Dp9AFbPx.js +3 -0
  354. package/dist/chunks/launchVault-hwK-Ljek.js +1 -0
  355. package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
  356. package/dist/chunks/lib-BHRYgENJ.js +8 -0
  357. package/dist/chunks/lib-DRyNc7xD.js +2 -0
  358. package/dist/chunks/lib-Ddq71jM5.js +14 -0
  359. package/dist/chunks/loadAgentsDir-Bz0FfcVt.js +5620 -0
  360. package/dist/chunks/loadAgentsDir-CLM0ws7u.js +1 -0
  361. package/dist/chunks/loadPluginHooks-B5SIS2uo.js +1 -0
  362. package/dist/chunks/loadSso-RY87rrJO.js +1 -0
  363. package/dist/chunks/localSearch-BLF6PSv2.js +1 -0
  364. package/dist/chunks/localSearch-CTycGe3E.js +1 -0
  365. package/dist/chunks/localSearch-inDahM8I.js +1 -0
  366. package/dist/chunks/lockfile--gk1HDM6.js +1 -0
  367. package/dist/chunks/log-B-Nj3Yed.js +1 -0
  368. package/dist/chunks/log-DVv8YiNo.js +1 -0
  369. package/dist/chunks/login-BeLvLowc.js +1 -0
  370. package/dist/chunks/login-DUUOeNoz.js +1 -0
  371. package/dist/chunks/logoV2Utils-D5SpeZ3C.js +1 -0
  372. package/dist/chunks/logout-C2QuTBdS.js +1 -0
  373. package/dist/chunks/magicDocs-CUXKi-Wv.js +57 -0
  374. package/dist/chunks/main-CFhpWtpC.js +1420 -0
  375. package/dist/chunks/main-sboa5RKc.js +31 -0
  376. package/dist/chunks/mappers-DLkk0PZz.js +1 -0
  377. package/dist/chunks/mcp-C2f6IgAp.js +2 -0
  378. package/dist/chunks/mcp-Djui9m3_.js +6 -0
  379. package/dist/chunks/mcp-DvTSxrJ4.js +1 -0
  380. package/dist/chunks/mcpServer-DMA0bdFC.js +1 -0
  381. package/dist/chunks/mcpServer-DxEHfW2v.js +1 -0
  382. package/dist/chunks/memoize-Bg2dXTzV.js +1 -0
  383. package/dist/chunks/memoize-DNnuA2aU.js +1 -0
  384. package/dist/chunks/memory-B9io9Zcv.js +1 -0
  385. package/dist/chunks/mobile-CPnnvkQV.js +2 -0
  386. package/dist/chunks/modalContext-B1b0Gsro.js +1 -0
  387. package/dist/chunks/mode-BDgwh_Xb.js +2 -0
  388. package/dist/chunks/model-B6cpEh-s.js +1 -0
  389. package/dist/chunks/model-BcunOCC9.js +1 -0
  390. package/dist/chunks/modelOptions-CHUHQ9WG.js +1 -0
  391. package/dist/chunks/normalization-cjPqid31.js +1 -0
  392. package/dist/chunks/oauth-CnBLewrU.js +1 -0
  393. package/dist/chunks/oauth-DMPGYAoZ.js +1 -0
  394. package/dist/chunks/observationStore-DVBxrSdI.js +4 -0
  395. package/dist/chunks/onChangeAppState-M61XDN6V.js +1 -0
  396. package/dist/chunks/open-CsUNPSNx.js +1 -0
  397. package/dist/chunks/openai-BHvlYW3m.js +2 -0
  398. package/dist/chunks/output-style-BtKuBrs4.js +1 -0
  399. package/dist/chunks/outputStyles-hHuIBkRB.js +84 -0
  400. package/dist/chunks/overageCreditGrant-BLFT-rF3.js +1 -0
  401. package/dist/chunks/p-map-C-WNcN6g.js +1 -0
  402. package/dist/chunks/p-map-CQ2NythB.js +1 -0
  403. package/dist/chunks/package-9IAs5Qf0.js +1 -0
  404. package/dist/chunks/panel-27xLZI7c.js +1 -0
  405. package/dist/chunks/panel-NoDfShEZ.js +1 -0
  406. package/dist/chunks/panelCall-CEOWVNCM.js +1 -0
  407. package/dist/chunks/parseConnectUrl-CxU4IX9o.js +1 -0
  408. package/dist/chunks/parser-DGlAnaNj.js +1 -0
  409. package/dist/chunks/parser-DGoLe2RS.js +1 -0
  410. package/dist/chunks/passes-CExcqu66.js +1 -0
  411. package/dist/chunks/path-uaxlnhva.js +1 -0
  412. package/dist/chunks/permissions-B3PceQul.js +1 -0
  413. package/dist/chunks/permissions-DezIL2xF.js +3 -0
  414. package/dist/chunks/permissions-DnpI8Whh.js +1 -0
  415. package/dist/chunks/pipeTransport-CB_Wq_Kx.js +1 -0
  416. package/dist/chunks/plan-cfZBclh9.js +1 -0
  417. package/dist/chunks/platform-BXz_rgpy.js +2 -0
  418. package/dist/chunks/plist-DLGDWBD6.js +6 -0
  419. package/dist/chunks/plugin-CuhENLRs.js +1 -0
  420. package/dist/chunks/pluginAutoupdate-wTeOXfQe.js +1 -0
  421. package/dist/chunks/pluginBlocklist-D6pkKfXr.js +1 -0
  422. package/dist/chunks/pluginCliCommands-DqxdCwsq.js +1 -0
  423. package/dist/chunks/pluginFlagging-CjH48f-K.js +1 -0
  424. package/dist/chunks/pluginOperations-DMFYB3pK.js +2 -0
  425. package/dist/chunks/pluginStartupCheck-BW3_KfZz.js +1 -0
  426. package/dist/chunks/pluginStartupCheck-Cj2BMjVw.js +1 -0
  427. package/dist/chunks/plugins-CarsG2v8.js +4 -0
  428. package/dist/chunks/policyLimits-DFn1vHkN.js +1 -0
  429. package/dist/chunks/pollConfig-C8nODJY1.js +1 -0
  430. package/dist/chunks/poller-DXZJ-dUP.js +1 -0
  431. package/dist/chunks/poor-C7GQ4a5X.js +1 -0
  432. package/dist/chunks/poorMode-CBe0rfxB.js +1 -0
  433. package/dist/chunks/poorMode-CbZTudtw.js +1 -0
  434. package/dist/chunks/postCommitAttribution--vvAWIqD.js +1 -0
  435. package/dist/chunks/print-CwwtGSbK.js +114 -0
  436. package/dist/chunks/privacy-settings-Bz8cAVp5.js +11 -0
  437. package/dist/chunks/privacyLevel-CRCHhztk.js +1 -0
  438. package/dist/chunks/process-CnhUplBr.js +1 -0
  439. package/dist/chunks/process-X4vCP9x0.js +1 -0
  440. package/dist/chunks/processBashCommand-NL0YEUqW.js +3 -0
  441. package/dist/chunks/processSlashCommand-FPMWElsI.js +6 -0
  442. package/dist/chunks/processSlashCommand-_oJs6_w8.js +6 -0
  443. package/dist/chunks/processUserInput-QAJK0XSn.js +1 -0
  444. package/dist/chunks/projectContext-B21hXj9q.js +1 -0
  445. package/dist/chunks/projectContext-DbTQHQS3.js +1 -0
  446. package/dist/chunks/prompt-C6eleu4x.js +1 -0
  447. package/dist/chunks/prompt-CUdoQXyN.js +1 -0
  448. package/dist/chunks/prompt-CsBCtw4l.js +228 -0
  449. package/dist/chunks/prompt-hnIDYhP4.js +54 -0
  450. package/dist/chunks/promptEditor-CrlVcc17.js +4 -0
  451. package/dist/chunks/protectedNamespace-Cn4901XG.js +1 -0
  452. package/dist/chunks/protocolHandler-DM_w7sJ5.js +13 -0
  453. package/dist/chunks/protocols-CpoQzjyI.js +7 -0
  454. package/dist/chunks/proxy-9WvtUy8E.js +99 -0
  455. package/dist/chunks/rate-limit-options-BehQ3MoX.js +1 -0
  456. package/dist/chunks/rcDebugLog-BbHlIxCm.js +11 -0
  457. package/dist/chunks/referral-BfAZEIZL.js +1 -0
  458. package/dist/chunks/refresh-Bl3Miver.js +1 -0
  459. package/dist/chunks/registerProtocol-BHZ3vZED.js +36 -0
  460. package/dist/chunks/registerSkillHooks-BR7v5qDA.js +1 -0
  461. package/dist/chunks/registry-C2igpRd-.js +1 -0
  462. package/dist/chunks/release-notes-C_Cou6ye.js +4 -0
  463. package/dist/chunks/releaseNotes-DveQShyB.js +2 -0
  464. package/dist/chunks/reload-plugins-D-pAUoB5.js +1 -0
  465. package/dist/chunks/remote-env-C_dBgbgo.js +1 -0
  466. package/dist/chunks/remoteBridgeCore-BxWhTy1u.js +1 -0
  467. package/dist/chunks/remoteControlServer-D3OjUlB-.js +3 -0
  468. package/dist/chunks/rename-f3m0ETSt.js +1 -0
  469. package/dist/chunks/renderOptions-QZLxGnh_.js +1 -0
  470. package/dist/chunks/replBridge-qeVmCJOb.js +1 -0
  471. package/dist/chunks/resume-CM_8p9Iu.js +2 -0
  472. package/dist/chunks/rewind-0cB7o6fx.js +1 -0
  473. package/dist/chunks/ripgrep-BEWqxrpl.js +5 -0
  474. package/dist/chunks/ripgrep-G82m12Ng.js +1 -0
  475. package/dist/chunks/rollback-CVo2gqgR.js +11 -0
  476. package/dist/chunks/runtimeObserver-1EdvvoYw.js +1 -0
  477. package/dist/chunks/runtimeObserver-CX6vepq9.js +10 -0
  478. package/dist/chunks/sandbox-adapter-DzHfW2tH.js +1 -0
  479. package/dist/chunks/sandbox-toggle-N6KgmH2T.js +1 -0
  480. package/dist/chunks/sanitization-CIBpY9KT.js +1 -0
  481. package/dist/chunks/satisfies-B7ZvBUQP.js +1 -0
  482. package/dist/chunks/schemas-Bwt-7U5W.js +40 -0
  483. package/dist/chunks/sdk-Drp69kIx.js +1 -0
  484. package/dist/chunks/sdkHeapDumpMonitor-B9GVkISU.js +1 -0
  485. package/dist/chunks/searchExtraTools-BphNJsl8.js +1 -0
  486. package/dist/chunks/semver-BsItM2Z4.js +1 -0
  487. package/dist/chunks/semver-D3lOjiBN.js +1 -0
  488. package/dist/chunks/sentry-ySzRCXGd.js +1 -0
  489. package/dist/chunks/server-C8nMDji6.js +1 -0
  490. package/dist/chunks/server-XZG51Slr.js +1 -0
  491. package/dist/chunks/serverBanner-D68EBGzH.js +1 -0
  492. package/dist/chunks/serverLog-hv2hc5US.js +1 -0
  493. package/dist/chunks/session-CVoGFb8a.js +2 -0
  494. package/dist/chunks/sessionDataUploader-BaD1Q7v3.js +1 -0
  495. package/dist/chunks/sessionDiscovery-D7g66TX6.js +1 -0
  496. package/dist/chunks/sessionFileAccessHooks-9lPjspRX.js +1 -0
  497. package/dist/chunks/sessionManager-BhOjMNAP.js +1 -0
  498. package/dist/chunks/sessionMemory-BA6cdxqP.js +1 -0
  499. package/dist/chunks/sessionMemory-CtEhIRGF.js +1 -0
  500. package/dist/chunks/sessionMemoryUtils-D_B92ypa.js +1 -0
  501. package/dist/chunks/sessionObserver-CESI-uVZ.js +1 -0
  502. package/dist/chunks/sessionObserver-SpE_eglb.js +20 -0
  503. package/dist/chunks/sessionRestore-DqsqYK4K.js +1 -0
  504. package/dist/chunks/sessionState-Dgky34M4.js +1 -0
  505. package/dist/chunks/sessionStorage-DJb5HKhQ.js +1 -0
  506. package/dist/chunks/sessionStorage-DSMfHTcg.js +1 -0
  507. package/dist/chunks/sessionStoragePortable-DyM_hZnp.js +3 -0
  508. package/dist/chunks/sessionTitle-Bzxk_EW9.js +14 -0
  509. package/dist/chunks/sessionTracing-DR8O0686.js +12 -0
  510. package/dist/chunks/setup-BHNS9sBS.js +9 -0
  511. package/dist/chunks/setup-BafJxZ0F.js +4 -0
  512. package/dist/chunks/setup-MLNNYLi6.js +1 -0
  513. package/dist/chunks/shadowedRuleDetection-Ch9gTxfD.js +1 -0
  514. package/dist/chunks/shellQuote-3s6tV-hK.js +1 -0
  515. package/dist/chunks/sideQuestion-BBn6XIOD.js +20 -0
  516. package/dist/chunks/signal-BTxmab6r.js +1 -0
  517. package/dist/chunks/signin-ChbUAEGq.js +1 -0
  518. package/dist/chunks/sink-B1qICbRh.js +1 -0
  519. package/dist/chunks/sink-yBIcxQf1.js +1 -0
  520. package/dist/chunks/sinks-C7weduDR.js +1 -0
  521. package/dist/chunks/skill-learning-08nEdOJ2.js +5 -0
  522. package/dist/chunks/skillGapStore-CuvWGqFb.js +5 -0
  523. package/dist/chunks/skillGapStore-DmMuDXKO.js +1 -0
  524. package/dist/chunks/skillGenerator-mEMjcmmm.js +8 -0
  525. package/dist/chunks/skillLearning-B3a-8Ys3.js +1 -0
  526. package/dist/chunks/skillLearning-q5T6o0mH.js +1 -0
  527. package/dist/chunks/skillPanel-BuUMhONI.js +28 -0
  528. package/dist/chunks/skillSearchPanel-BUEv7Sm9.js +21 -0
  529. package/dist/chunks/skillUsageTracking-BBTiWOKB.js +1 -0
  530. package/dist/chunks/skills-DvQuQfDW.js +1 -0
  531. package/dist/chunks/slashCommandParsing-BkTC3GRb.js +1 -0
  532. package/dist/chunks/sleep-CC8jykQd.js +1 -0
  533. package/dist/chunks/slowOperations-niPqC54V.js +1 -0
  534. package/dist/chunks/sprites-C5X62Vyh.js +1 -0
  535. package/dist/chunks/src-58uAJYF_.js +6 -0
  536. package/dist/chunks/src-7Y8fx6gl.js +2 -0
  537. package/dist/chunks/src-BuserDTl.js +1 -0
  538. package/dist/chunks/src-CMY4XoRy.js +1 -0
  539. package/dist/chunks/src-CfeAM1FB.js +1 -0
  540. package/dist/chunks/src-CxT2FDXy.js +1 -0
  541. package/dist/chunks/src-CyQf7rVu.js +26 -0
  542. package/dist/chunks/src-DJLbU8sT.js +1 -0
  543. package/dist/chunks/src-DJQlyVK6.js +5 -0
  544. package/dist/chunks/src-DNHWYkls.js +53 -0
  545. package/dist/chunks/src-DU_g0n_Q.js +1 -0
  546. package/dist/chunks/src-DhqzQjMg.js +19 -0
  547. package/dist/chunks/src-Duzv1Znh.js +1 -0
  548. package/dist/chunks/src-OBx6GAig.js +1 -0
  549. package/dist/chunks/src-WjnK2Dbo.js +1 -0
  550. package/dist/chunks/src-hjAMxWFj.js +7 -0
  551. package/dist/chunks/src-lLwoqdC0.js +9 -0
  552. package/dist/chunks/src-yRsWbJp_.js +2 -0
  553. package/dist/chunks/sso-oidc-yfC-A2A2.js +1 -0
  554. package/dist/chunks/startupProfiler-4P7GdVw6.js +3 -0
  555. package/dist/chunks/startupProfiler-CipS0otN.js +1 -0
  556. package/dist/chunks/state-9wSimHaL.js +1 -0
  557. package/dist/chunks/state-BQkyHx88.js +1 -0
  558. package/dist/chunks/state-CEAUTY3A.js +1 -0
  559. package/dist/chunks/state-CUZTq6r0.js +1 -0
  560. package/dist/chunks/state-U0HNbTx8.js +1 -0
  561. package/dist/chunks/staticRender-BB3CisKd.js +1 -0
  562. package/dist/chunks/stats-Dyi2U_mq.js +1 -0
  563. package/dist/chunks/status-CSL-GMou.js +1 -0
  564. package/dist/chunks/statusNoticeHelpers-BaXE951d.js +1 -0
  565. package/dist/chunks/stdio-BuUJYJFs.js +3 -0
  566. package/dist/chunks/stdio-iX0TTmbp.js +1 -0
  567. package/dist/chunks/stickers-2CRSckfH.js +1 -0
  568. package/dist/chunks/store-DdfsZvtr.js +1 -0
  569. package/dist/chunks/stringUtils-U7kMYMJq.js +4 -0
  570. package/dist/chunks/sts-CJmdeT7s.js +1 -0
  571. package/dist/chunks/subprocessEnv-DKTILev5.js +1 -0
  572. package/dist/chunks/subprocessEnv-WjRguKWf.js +1 -0
  573. package/dist/chunks/supports-color-DaytqqjM.js +1 -0
  574. package/dist/chunks/systemPromptSections-BnrxBWdc.js +1 -0
  575. package/dist/chunks/systemPromptSections-Dk6azdAb.js +1 -0
  576. package/dist/chunks/systemTheme-C1GNqIfy.js +1 -0
  577. package/dist/chunks/tag-C4cH016L.js +11 -0
  578. package/dist/chunks/tasks-CEdUW3RQ.js +1 -0
  579. package/dist/chunks/teamHelpers-CTA_CtTT.js +1 -0
  580. package/dist/chunks/teamHelpers-D65qZInv.js +1 -0
  581. package/dist/chunks/teammate-C-FiRloZ.js +1 -0
  582. package/dist/chunks/teammateModeSnapshot-DWRG5-Us.js +1 -0
  583. package/dist/chunks/teammateModeSnapshot-DtgsNj1G.js +1 -0
  584. package/dist/chunks/teleport-C_UgMy0V.js +1 -0
  585. package/dist/chunks/templateJobs-CMbS0tuk.js +12 -0
  586. package/dist/chunks/terminalSetup--jwGVap8.js +33 -0
  587. package/dist/chunks/terminalSetup-zID-wokH.js +1 -0
  588. package/dist/chunks/theme-C6XwTpVy.js +1 -0
  589. package/dist/chunks/thinkback-CVLnmLAT.js +1 -0
  590. package/dist/chunks/thinkback-MeOOO7gf.js +1 -0
  591. package/dist/chunks/thinkback-play-D7G260F4.js +1 -0
  592. package/dist/chunks/tmux-DtYJuTWh.js +1 -0
  593. package/dist/chunks/toolEventObserver-BtC9xDYY.js +1 -0
  594. package/dist/chunks/toolEventObserver-MfsHAt8h.js +1 -0
  595. package/dist/chunks/toolPool-CEi_2xIH.js +1 -0
  596. package/dist/chunks/toolPool-CdYJcCnc.js +1 -0
  597. package/dist/chunks/trustedDevice-CjQTGAa4.js +1 -0
  598. package/dist/chunks/trustedDevice-DADcxAAs.js +1 -0
  599. package/dist/chunks/tui-B8Ijq4Pk.js +6 -0
  600. package/dist/chunks/turndown.es-T-Xe93nc.js +69 -0
  601. package/dist/chunks/types-BVelRhgb.js +17 -0
  602. package/dist/chunks/types-Bqp3meR4.js +1 -0
  603. package/dist/chunks/types-CNmINIu3.js +1 -0
  604. package/dist/chunks/types-DgzOOCDl.js +3 -0
  605. package/dist/chunks/udsClient-ClY_0CKr.js +1 -0
  606. package/dist/chunks/ultrareviewCommand-CqvHj9Io.js +3 -0
  607. package/dist/chunks/undercover-CVCVOSrs.js +1 -0
  608. package/dist/chunks/undercover-CbxiJO2b.js +31 -0
  609. package/dist/chunks/up-CBJhVVbd.js +12 -0
  610. package/dist/chunks/updateCCB-DPPpquAw.js +11 -0
  611. package/dist/chunks/upgrade-DaaHOvft.js +1 -0
  612. package/dist/chunks/upgrade-k7ZvAWZ0.js +1 -0
  613. package/dist/chunks/upload-CEDxwMa1.js +1 -0
  614. package/dist/chunks/upstreamproxy-BtGJ2LRi.js +11 -0
  615. package/dist/chunks/usage-CsUSu4fb.js +1 -0
  616. package/dist/chunks/usage-oABvixCs.js +1 -0
  617. package/dist/chunks/useExitOnCtrlCDWithKeybindings-CBce_-hb.js +1 -0
  618. package/dist/chunks/useExitOnCtrlCDWithKeybindings-CLYjTZXb.js +1 -0
  619. package/dist/chunks/useKeybinding-DAQL_dB_.js +1 -0
  620. package/dist/chunks/useMainLoopModel-QC_H3esG.js +1 -0
  621. package/dist/chunks/useManageMCPConnections-bf-VfJGD.js +1 -0
  622. package/dist/chunks/useManagePlugins-CXdYUpit.js +1 -0
  623. package/dist/chunks/useMergedTools-DERzhQOJ.js +1 -0
  624. package/dist/chunks/useSearchInput-nqhdILI2.js +1 -0
  625. package/dist/chunks/useTerminalSize-DzV4aaTi.js +1 -0
  626. package/dist/chunks/useVoice-CO69xtWC.js +1 -0
  627. package/dist/chunks/util-C8wqPqv0.js +1 -0
  628. package/dist/chunks/utils-CDFsSXHr.js +1 -0
  629. package/dist/chunks/utils-ZO5TryVH.js +1 -0
  630. package/dist/chunks/v4-DLhvDPkt.js +1 -0
  631. package/dist/chunks/validatePlugin-C4cd71Yz.js +1 -0
  632. package/dist/chunks/vertex-sdk-CC3U26o7.js +9 -0
  633. package/dist/chunks/vim-BNiQx5Vf.js +1 -0
  634. package/dist/chunks/voice-BCbnJzYL.js +8 -0
  635. package/dist/chunks/voice-BJyz9KZO.js +8 -0
  636. package/dist/chunks/voice-CP2ULpju.js +2 -0
  637. package/dist/chunks/voiceModeEnabled-C-pa8B3Q.js +1 -0
  638. package/dist/chunks/voiceModeEnabled-CMtRN2pa.js +1 -0
  639. package/dist/chunks/voiceStreamSTT-31b2u0rj.js +1 -0
  640. package/dist/chunks/voiceStreamSTT-Fkhm6Ftg.js +1 -0
  641. package/dist/chunks/voiceStreamSTT-sI-hg-aP.js +1 -0
  642. package/dist/chunks/web-tools-CLmlPgLk.js +1 -0
  643. package/dist/chunks/which-C0ex-06E.js +1 -0
  644. package/dist/chunks/windowsPaths-C5TNvKYu.js +1 -0
  645. package/dist/chunks/windowsPaths-Kue_7s52.js +1 -0
  646. package/dist/chunks/workSecret-Dh5Ayceu.js +1 -0
  647. package/dist/chunks/workerRegistry-B5iWYqpK.js +1 -0
  648. package/dist/chunks/worktree-BypJA0GB.js +1 -0
  649. package/dist/chunks/worktreeModeEnabled-DPTdK3JV.js +1 -0
  650. package/dist/chunks/worktreeModeEnabled-Dtrcn7eD.js +1 -0
  651. package/dist/chunks/wrapper-BDPb4PTV.js +6 -0
  652. package/dist/chunks/wrapper-DRTs77RK.js +1 -0
  653. package/dist/chunks/xdg-BaVL-FHd.js +1 -0
  654. package/dist/chunks/xml-E8VMPwdJ.js +1 -0
  655. package/dist/chunks/zod-B_P2Eo_D.js +1 -0
  656. package/dist/cli-bun.js +2 -0
  657. package/dist/cli-node.js +2 -0
  658. package/dist/cli.js +2 -0
  659. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  660. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  661. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  662. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  663. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  664. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  665. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  666. package/package.json +233 -0
  667. package/scripts/postinstall.cjs +389 -0
  668. package/scripts/run-parallel.mjs +10 -0
  669. package/scripts/setup-chrome-mcp.mjs +70 -0
@@ -0,0 +1,5 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-CaCI0a5T.js";import{n as r,r as i,t as a}from"./dist-es-Cp--qjOi.js";import{f as o,x as s,y as c}from"./httpAuthSchemes-CgPbtGos.js";import{n as l,r as u,t as d}from"./dist-es-BctcPxLN.js";import{a as f,n as p,o as m,r as h,s as ee,t as g}from"./dist-es-6kjvVbJd.js";import{C as te,L as ne,R as re,S as ie,_ as ae,a as oe,b as _,c as v,d as se,f as ce,g as le,i as ue,l as y,m as de,n as fe,o as pe,p as me,r as he,s as ge,t as b,u as _e,v as x,w as ve,y as ye,z as be}from"./protocols-CpoQzjyI.js";import{n as xe,t as Se}from"./dist-es-C66BuLgn.js";import{c as Ce,f as we,i as Te,l as Ee,m as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./dist-es-Bu21Wvhs.js";import{a as Ne,c as Pe,d as Fe,f as Ie,i as Le,l as Re,m as ze,o as Be,p as Ve,r as S,s as He,t as Ue,u as We}from"./client-CinDjeSq.js";import{n as Ge,t as Ke}from"./dist-es-BPPewn1A.js";import{n as C,t as qe}from"./dist-es-BismPcTW.js";import{t as Je}from"./dist-es-Do_155z5.js";import{l as Ye,n as Xe,r as Ze,t as w}from"./dist-es-C_IHUdzL.js";import{env as Qe,versions as $e}from"node:process";import{Readable as et}from"stream";import{join as tt,normalize as nt,sep as rt}from"node:path";import{ReadStream as it,fstatSync as at,lstatSync as ot}from"node:fs";import{platform as st,release as ct}from"node:os";import{Buffer as lt}from"buffer";import{createHash as ut,createHmac as dt}from"crypto";import{readFile as ft}from"node:fs/promises";function pt(e){return e}var mt,ht,gt,_t=e((()=>{a(),mt=e=>t=>async n=>{if(!i.isInstance(n.request))return t(n);let{request:r}=n,{handlerProtocol:a=``}=e.requestHandler.metadata||{};if(a.indexOf(`h2`)>=0&&!r.headers[`:authority`])delete r.headers.host,r.headers[`:authority`]=r.hostname+(r.port?`:`+r.port:``);else if(!r.headers.host){let e=r.hostname;r.port!=null&&(e+=`:${r.port}`),r.headers.host=e}return t(n)},ht={name:`hostHeaderMiddleware`,step:`build`,priority:`low`,tags:[`HOST`],override:!0},gt=e=>({applyToStack:t=>{t.add(mt(e),ht)}})})),vt,yt,bt,xt=e((()=>{vt=()=>(e,t)=>async n=>{try{let r=await e(n),{clientName:i,commandName:a,logger:o,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:l}=s,u=c??t.inputFilterSensitiveLog,d=l??t.outputFilterSensitiveLog,{$metadata:f,...p}=r.output;return o?.info?.({clientName:i,commandName:a,input:u(n.input),output:d(p),metadata:f}),r}catch(e){let{clientName:r,commandName:i,logger:a,dynamoDbDocumentClientOptions:o={}}=t,{overrideInputFilterSensitiveLog:s}=o,c=s??t.inputFilterSensitiveLog;throw a?.error?.({clientName:r,commandName:i,input:c(n.input),error:e,metadata:e.$metadata}),e}},yt={name:`loggerMiddleware`,tags:[`LOGGER`],step:`initialize`,override:!0},bt=e=>({applyToStack:e=>{e.add(vt(),yt)}})})),St=e((()=>{xt()})),Ct,wt=e((()=>{Ct={step:`build`,tags:[`RECURSION_DETECTION`],name:`recursionDetectionMiddleware`,override:!0,priority:`low`}})),T,E,D,Tt,Et,Dt,Ot=e((()=>{t(),T={REQUEST_ID:Symbol.for(`_AWS_LAMBDA_REQUEST_ID`),X_RAY_TRACE_ID:Symbol.for(`_AWS_LAMBDA_X_RAY_TRACE_ID`),TENANT_ID:Symbol.for(`_AWS_LAMBDA_TENANT_ID`)},E=[`true`,`1`].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??``),E||(globalThis.awslambda=globalThis.awslambda||{}),D=class{isProtectedKey(e){return Object.values(T).includes(e)}getRequestId(){return this.get(T.REQUEST_ID)??`-`}getXRayTraceId(){return this.get(T.X_RAY_TRACE_ID)}getTenantId(){return this.get(T.TENANT_ID)}},n(D,`PROTECTED_KEYS`,T),Tt=class extends D{constructor(...e){super(...e),n(this,`currentContext`,void 0)}getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(e){return this.currentContext?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);this.currentContext=this.currentContext||{},this.currentContext[e]=t}run(e,t){return this.currentContext=e,t()}},Et=class e extends D{constructor(...e){super(...e),n(this,`als`,void 0)}static async create(){let t=new e;return t.als=new(await(import(`node:async_hooks`))).AsyncLocalStorage,t}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(e){return this.als.getStore()?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);let n=this.als.getStore();if(!n)throw Error(`No context available`);n[e]=t}run(e,t){return this.als.run(e,t)}},(function(e){let t=null;async function n(e){return t||(t=(async()=>{let t=e===!0||`AWS_LAMBDA_MAX_CONCURRENCY`in process.env?await Et.create():new Tt;return!E&&globalThis.awslambda?.InvokeStore?globalThis.awslambda.InvokeStore:(!E&&globalThis.awslambda&&(globalThis.awslambda.InvokeStore=t),t)})()),t}e.getInstanceAsync=n,e._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE===`1`?{reset:()=>{t=null,globalThis.awslambda?.InvokeStore&&delete globalThis.awslambda.InvokeStore,globalThis.awslambda={InvokeStore:void 0}}}:void 0})(Dt||(Dt={}))})),O,kt,At,jt,Mt=e((()=>{Ot(),a(),O=`X-Amzn-Trace-Id`,kt=`AWS_LAMBDA_FUNCTION_NAME`,At=`_X_AMZN_TRACE_ID`,jt=()=>e=>async t=>{let{request:n}=t;if(!i.isInstance(n))return e(t);let r=Object.keys(n.headers??{}).find(e=>e.toLowerCase()===O.toLowerCase())??O;if(n.headers.hasOwnProperty(r))return e(t);let a=process.env[kt],o=process.env[At],s=(await Dt.getInstanceAsync())?.getXRayTraceId()??o,c=e=>typeof e==`string`&&e.length>0;return c(a)&&c(s)&&(n.headers[O]=s),e({...t,request:n})}})),Nt,Pt=e((()=>{wt(),Mt(),Nt=e=>({applyToStack:e=>{e.add(jt(),Ct)}})})),Ft=e((()=>{Pt(),Mt()}));function It(e){return e===void 0?!0:typeof e==`string`&&e.length<=50}function Lt(e){let t=s(e.userAgentAppId??void 0),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:typeof n==`string`?[[n]]:n,userAgentAppId:async()=>{let n=await t();if(!It(n)){let t=e.logger?.constructor?.name===`NoOpLogger`||!e.logger?console:e.logger;typeof n==`string`?n.length>50&&t?.warn(`The provided userAgentAppId exceeds the maximum length of 50 characters.`):t?.warn(`userAgentAppId must be a string or undefined.`)}return n}})}var Rt=e((()=>{o()})),zt=e((()=>{Me()})),Bt,Vt=e((()=>{Me(),zt(),Bt=(e,t=!1)=>{if(t){for(let t of e.split(`.`))if(!Bt(t))return!1;return!0}return!(!Oe(e)||e.length<3||e.length>63||e!==e.toLowerCase()||we(e))}})),Ht,Ut,Wt,Gt=e((()=>{Ht=`:`,Ut=`/`,Wt=e=>{let t=e.split(Ht);if(t.length<6)return null;let[n,r,i,a,o,...s]=t;return n!==`arn`||r===``||i===``||s.join(Ht)===``?null:{partition:r,service:i,region:a,accountId:o,resourceId:s.map(e=>e.split(Ut)).flat()}}})),Kt,qt,Jt=e((()=>{Kt=[{id:`aws`,outputs:{dnsSuffix:`amazonaws.com`,dualStackDnsSuffix:`api.aws`,implicitGlobalRegion:`us-east-1`,name:`aws`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$`,regions:{"af-south-1":{description:`Africa (Cape Town)`},"ap-east-1":{description:`Asia Pacific (Hong Kong)`},"ap-east-2":{description:`Asia Pacific (Taipei)`},"ap-northeast-1":{description:`Asia Pacific (Tokyo)`},"ap-northeast-2":{description:`Asia Pacific (Seoul)`},"ap-northeast-3":{description:`Asia Pacific (Osaka)`},"ap-south-1":{description:`Asia Pacific (Mumbai)`},"ap-south-2":{description:`Asia Pacific (Hyderabad)`},"ap-southeast-1":{description:`Asia Pacific (Singapore)`},"ap-southeast-2":{description:`Asia Pacific (Sydney)`},"ap-southeast-3":{description:`Asia Pacific (Jakarta)`},"ap-southeast-4":{description:`Asia Pacific (Melbourne)`},"ap-southeast-5":{description:`Asia Pacific (Malaysia)`},"ap-southeast-6":{description:`Asia Pacific (New Zealand)`},"ap-southeast-7":{description:`Asia Pacific (Thailand)`},"aws-global":{description:`aws global region`},"ca-central-1":{description:`Canada (Central)`},"ca-west-1":{description:`Canada West (Calgary)`},"eu-central-1":{description:`Europe (Frankfurt)`},"eu-central-2":{description:`Europe (Zurich)`},"eu-north-1":{description:`Europe (Stockholm)`},"eu-south-1":{description:`Europe (Milan)`},"eu-south-2":{description:`Europe (Spain)`},"eu-west-1":{description:`Europe (Ireland)`},"eu-west-2":{description:`Europe (London)`},"eu-west-3":{description:`Europe (Paris)`},"il-central-1":{description:`Israel (Tel Aviv)`},"me-central-1":{description:`Middle East (UAE)`},"me-south-1":{description:`Middle East (Bahrain)`},"mx-central-1":{description:`Mexico (Central)`},"sa-east-1":{description:`South America (Sao Paulo)`},"us-east-1":{description:`US East (N. Virginia)`},"us-east-2":{description:`US East (Ohio)`},"us-west-1":{description:`US West (N. California)`},"us-west-2":{description:`US West (Oregon)`}}},{id:`aws-cn`,outputs:{dnsSuffix:`amazonaws.com.cn`,dualStackDnsSuffix:`api.amazonwebservices.com.cn`,implicitGlobalRegion:`cn-northwest-1`,name:`aws-cn`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^cn\\-\\w+\\-\\d+$`,regions:{"aws-cn-global":{description:`aws-cn global region`},"cn-north-1":{description:`China (Beijing)`},"cn-northwest-1":{description:`China (Ningxia)`}}},{id:`aws-eusc`,outputs:{dnsSuffix:`amazonaws.eu`,dualStackDnsSuffix:`api.amazonwebservices.eu`,implicitGlobalRegion:`eusc-de-east-1`,name:`aws-eusc`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^eusc\\-(de)\\-\\w+\\-\\d+$`,regions:{"eusc-de-east-1":{description:`AWS European Sovereign Cloud (Germany)`}}},{id:`aws-iso`,outputs:{dnsSuffix:`c2s.ic.gov`,dualStackDnsSuffix:`api.aws.ic.gov`,implicitGlobalRegion:`us-iso-east-1`,name:`aws-iso`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-iso\\-\\w+\\-\\d+$`,regions:{"aws-iso-global":{description:`aws-iso global region`},"us-iso-east-1":{description:`US ISO East`},"us-iso-west-1":{description:`US ISO WEST`}}},{id:`aws-iso-b`,outputs:{dnsSuffix:`sc2s.sgov.gov`,dualStackDnsSuffix:`api.aws.scloud`,implicitGlobalRegion:`us-isob-east-1`,name:`aws-iso-b`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-isob\\-\\w+\\-\\d+$`,regions:{"aws-iso-b-global":{description:`aws-iso-b global region`},"us-isob-east-1":{description:`US ISOB East (Ohio)`},"us-isob-west-1":{description:`US ISOB West`}}},{id:`aws-iso-e`,outputs:{dnsSuffix:`cloud.adc-e.uk`,dualStackDnsSuffix:`api.cloud-aws.adc-e.uk`,implicitGlobalRegion:`eu-isoe-west-1`,name:`aws-iso-e`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^eu\\-isoe\\-\\w+\\-\\d+$`,regions:{"aws-iso-e-global":{description:`aws-iso-e global region`},"eu-isoe-west-1":{description:`EU ISOE West`}}},{id:`aws-iso-f`,outputs:{dnsSuffix:`csp.hci.ic.gov`,dualStackDnsSuffix:`api.aws.hci.ic.gov`,implicitGlobalRegion:`us-isof-south-1`,name:`aws-iso-f`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-isof\\-\\w+\\-\\d+$`,regions:{"aws-iso-f-global":{description:`aws-iso-f global region`},"us-isof-east-1":{description:`US ISOF EAST`},"us-isof-south-1":{description:`US ISOF SOUTH`}}},{id:`aws-us-gov`,outputs:{dnsSuffix:`amazonaws.com`,dualStackDnsSuffix:`api.aws`,implicitGlobalRegion:`us-gov-west-1`,name:`aws-us-gov`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-gov\\-\\w+\\-\\d+$`,regions:{"aws-us-gov-global":{description:`aws-us-gov global region`},"us-gov-east-1":{description:`AWS GovCloud (US-East)`},"us-gov-west-1":{description:`AWS GovCloud (US-West)`}}}],qt={partitions:Kt,version:`1.1`}})),Yt,Xt,Zt,Qt,$t=e((()=>{Jt(),Yt=qt,Xt=``,Zt=e=>{let{partitions:t}=Yt;for(let n of t){let{regions:t,outputs:r}=n;for(let[n,i]of Object.entries(t))if(n===e)return{...r,...i}}for(let n of t){let{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}let n=t.find(e=>e.id===`aws`);if(!n)throw Error(`Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.`);return{...n.outputs}},Qt=()=>Xt})),en,tn=e((()=>{Me(),Vt(),Gt(),$t(),en={isVirtualHostableS3Bucket:Bt,parseArn:Wt,partition:Zt},De.aws=en})),nn=e((()=>{})),rn=e((()=>{})),an=e((()=>{})),on=e((()=>{})),sn=e((()=>{})),cn=e((()=>{})),ln=e((()=>{})),un=e((()=>{})),dn=e((()=>{an(),on(),sn(),cn(),ln(),un()})),fn=e((()=>{tn(),$t(),zt(),nn(),rn(),dn()}));async function pn(e,t,n){if(n.request?.headers?.[`smithy-protocol`]===`rpc-v2-cbor`&&S(e,`PROTOCOL_RPC_V2_CBOR`,`M`),typeof t.retryStrategy==`function`){let n=await t.retryStrategy();if(typeof n.mode==`string`)switch(n.mode){case ze.ADAPTIVE:S(e,`RETRY_MODE_ADAPTIVE`,`F`);break;case ze.STANDARD:S(e,`RETRY_MODE_STANDARD`,`E`);break}}if(typeof t.accountIdEndpointMode==`function`){let n=e.endpointV2;switch(String(n?.url?.hostname).match(mn)&&S(e,`ACCOUNT_ID_ENDPOINT`,`O`),await t.accountIdEndpointMode?.()){case`disabled`:S(e,`ACCOUNT_ID_MODE_DISABLED`,`Q`);break;case`preferred`:S(e,`ACCOUNT_ID_MODE_PREFERRED`,`P`);break;case`required`:S(e,`ACCOUNT_ID_MODE_REQUIRED`,`R`);break}}let r=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(r?.$source){let t=r;t.accountId&&S(e,`RESOLVED_ACCOUNT_ID`,`T`);for(let[n,r]of Object.entries(t.$source??{}))S(e,n,r)}}var mn,hn=e((()=>{Ue(),Le(),mn=/\d{12}\.ddb/})),gn,_n,vn,yn,bn=e((()=>{gn=`user-agent`,_n=`x-amz-user-agent`,vn=/[^!$%&'*+\-.^_`|~\w]/g,yn=/[^!$%&'*+\-.^_`|~\w#]/g}));function xn(e){let t=``;for(let n in e){let r=e[n];if(t.length+r.length+1<=Sn){t.length?t+=`,`+r:t+=r;continue}break}return t}var Sn,Cn=e((()=>{Sn=1024})),wn,k,Tn,En,Dn=e((()=>{fn(),a(),hn(),bn(),Cn(),wn=e=>(t,n)=>async r=>{let{request:a}=r;if(!i.isInstance(a))return t(r);let{headers:o}=a,s=n?.userAgent?.map(k)||[],c=(await e.defaultUserAgentProvider()).map(k);await pn(n,e,r);let l=n;c.push(`m/${xn(Object.assign({},n.__smithy_context?.features,l.__aws_sdk_context?.features))}`);let u=e?.customUserAgent?.map(k)||[],d=await e.userAgentAppId();d&&c.push(k([`app`,`${d}`]));let f=Qt(),p=(f?[f]:[]).concat([...c,...s,...u]).join(` `),m=[...c.filter(e=>e.startsWith(`aws-sdk-`)),...u].join(` `);return e.runtime===`browser`?o[_n]=p:(m&&(o[_n]=o[`x-amz-user-agent`]?`${o[gn]} ${m}`:m),o[gn]=p),t({...r,request:a})},k=e=>{let t=e[0].split(`/`).map(e=>e.replace(vn,`-`)).join(`/`),n=e[1]?.replace(yn,`-`),r=t.indexOf(`/`),i=t.substring(0,r),a=t.substring(r+1);return i===`api`&&(a=a.toLowerCase()),[i,a,n].filter(e=>e&&e.length>0).reduce((e,t,n)=>{switch(n){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}},``)},Tn={name:`getUserAgentMiddleware`,step:`build`,priority:`low`,tags:[`SET_USER_AGENT`,`USER_AGENT`],override:!0},En=e=>({applyToStack:t=>{t.add(wn(e),Tn)}})})),On=e((()=>{Rt(),Dn()}));function kn(e){return t=>async n=>{let r=n.request;if(i.isInstance(r)){let{body:t,headers:n}=r;if(t&&Object.keys(n).map(e=>e.toLowerCase()).indexOf(An)===-1)try{let n=e(t);r.headers={...r.headers,[An]:String(n)}}catch{}}return t({...n,request:r})}}var An,jn,Mn,Nn=e((()=>{a(),An=`content-length`,jn={step:`build`,tags:[`SET_CONTENT_LENGTH`,`CONTENT_LENGTH`],name:`contentLengthMiddleware`,override:!0},Mn=e=>({applyToStack:t=>{t.add(kn(e.bodyLengthChecker),jn)}})})),Pn,Fn,In,Ln,Rn,zn,Bn=e((()=>{Pn=async e=>{let t=e?.Bucket||``;if(typeof e.Bucket==`string`&&(e.Bucket=t.replace(/#/g,`%23`).replace(/\?/g,`%3F`)),zn(t)){if(e.ForcePathStyle===!0)throw Error(`Path-style addressing cannot be used with ARN buckets`)}else (!Rn(t)||t.indexOf(`.`)!==-1&&!String(e.Endpoint).startsWith(`http:`)||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},Fn=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,In=/(\d+\.){3}\d+/,Ln=/\.\./,Rn=e=>Fn.test(e)&&!In.test(e)&&!Ln.test(e),zn=e=>{let[t,n,r,,,i]=e.split(`:`),a=t===`arn`&&e.split(`:`).length>=6,o=!!(a&&n&&r&&i);if(a&&!o)throw Error(`Invalid ARN: ${e} was an invalid ARN.`);return o}})),Vn=e((()=>{Bn()})),Hn,Un=e((()=>{Hn=(e,t,n,r=!1)=>{let i=async()=>{let i;return i=r?n.clientContextParams?.[e]??n[e]??n[t]:n[e]??n[t],typeof i==`function`?i():i};return e===`credentialScope`||t===`CredentialScope`?async()=>{let e=typeof n.credentials==`function`?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:e===`accountId`||t===`AccountId`?async()=>{let e=typeof n.credentials==`function`?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:e===`endpoint`||t===`endpoint`?async()=>{if(n.isCustomEndpoint===!1)return;let e=await i();if(e&&typeof e==`object`){if(`url`in e)return e.url.href;if(`hostname`in e){let{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?`:`+r:``}${i}`}}return e}:i}})),Wn,Gn,Kn,qn=e((()=>{Je(),Wn=`AWS_ENDPOINT_URL`,Gn=`endpoint_url`,Kn=e=>({environmentVariableSelector:t=>{let n=t[[Wn,...e.split(` `).map(e=>e.toUpperCase())].join(`_`)];if(n)return n;let r=t[Wn];if(r)return r},configFileSelector:(t,n)=>{if(n&&t.services){let r=n[[`services`,t.services].join(`.`)];if(r){let t=r[[e.split(` `).map(e=>e.toLowerCase()).join(`_`),Gn].join(`.`)];if(t)return t}}let r=t[Gn];if(r)return r},default:void 0})})),Jn,Yn=e((()=>{qe(),qn(),Jn=async e=>C(Kn(e??``))()})),Xn,Zn=e((()=>{Se(),Xn=e=>{if(typeof e==`object`){if(`url`in e){let t=xe(e.url);if(e.headers){t.headers={};for(let[n,r]of Object.entries(e.headers))t.headers[n.toLowerCase()]=r.join(`, `)}return t}return e}return xe(e)}})),Qn,A,$n=e((()=>{Vn(),Un(),Yn(),Zn(),Qn=async(e,t,n,r)=>{if(!n.isCustomEndpoint){let e;e=n.serviceConfiguredEndpoint?await n.serviceConfiguredEndpoint():await Jn(n.serviceId),e&&(n.endpoint=()=>Promise.resolve(Xn(e)),n.isCustomEndpoint=!0)}let i=await A(e,t,n);if(typeof n.endpointProvider!=`function`)throw Error(`config.endpointProvider is not set.`);let a=n.endpointProvider(i,r);if(n.isCustomEndpoint&&n.endpoint){let e=await n.endpoint();if(e?.headers){a.headers??(a.headers={});for(let[t,n]of Object.entries(e.headers))a.headers[t]=Array.isArray(n)?n:[n]}}return a},A=async(e,t,n)=>{let r={},i=t?.getEndpointParameterInstructions?.()||{};for(let[t,a]of Object.entries(i))switch(a.type){case`staticContextParams`:r[t]=a.value;break;case`contextParams`:r[t]=e[a.name];break;case`clientContextParams`:case`builtInParams`:r[t]=await Hn(a.name,t,n,a.type!==`builtInParams`)();break;case`operationContextParams`:r[t]=a.get(e);break;default:throw Error(`Unrecognized endpoint parameter instruction: `+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(r,n),String(n.serviceId).toLowerCase()===`s3`&&await Pn(r),r}})),er=e((()=>{$n(),Zn()})),tr,nr=e((()=>{o(),d(),$n(),tr=({config:e,instructions:t})=>(n,r)=>async i=>{e.isCustomEndpoint&&c(r,`ENDPOINT_OVERRIDE`,`N`);let a=await Qn(i.input,{getEndpointParameterInstructions(){return t}},{...e},r);r.endpointV2=a,r.authSchemes=a.properties?.authSchemes;let o=r.authSchemes?.[0];if(o){r.signing_region=o.signingRegion,r.signing_service=o.signingName;let e=u(r)?.selectedHttpAuthScheme?.httpAuthOption;e&&(e.signingProperties=Object.assign(e.signingProperties||{},{signing_region:o.signingRegion,signingRegion:o.signingRegion,signing_service:o.signingName,signingName:o.signingName,signingRegionSet:o.signingRegionSet},o.properties))}return n({...i})}})),rr=e((()=>{})),ir=e((()=>{})),ar,or=e((()=>{ar={name:`serializerMiddleware`,step:`serialize`,tags:[`SERIALIZER`],override:!0}})),sr=e((()=>{rr(),or(),ir()})),cr,lr,ur=e((()=>{sr(),nr(),cr={step:`serialize`,tags:[`ENDPOINT_PARAMETERS`,`ENDPOINT_V2`,`ENDPOINT`],name:`endpointV2Middleware`,override:!0,relation:`before`,toMiddleware:ar.name},lr=(e,t)=>({applyToStack:n=>{n.addRelativeTo(tr({config:e,instructions:t}),cr)}})})),dr,fr=e((()=>{d(),Yn(),Zn(),dr=e=>{let t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,a=Object.assign(e,{endpoint:n==null?void 0:async()=>Xn(await l(n)()),tls:t,isCustomEndpoint:!!n,useDualstackEndpoint:l(r??!1),useFipsEndpoint:l(i??!1)}),o;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!o&&(o=Jn(e.serviceId)),o),a}})),pr=e((()=>{})),mr=e((()=>{})),hr=e((()=>{er(),nr(),ur(),fr(),pr(),mr()})),gr,_r=e((()=>{gr=e=>e instanceof Error?e:e instanceof Object?Object.assign(Error(),e):Error(typeof e==`string`?e:`AWS SDK error wrapper for ${e}`)})),vr=e((()=>{})),yr=e((()=>{})),br=e((()=>{})),xr=e((()=>{})),j,M,Sr,Cr,wr,Tr,Er,Dr=e((()=>{d(),Le(),j=`AWS_MAX_ATTEMPTS`,M=`max_attempts`,Sr={environmentVariableSelector:e=>{let t=e[j];if(!t)return;let n=parseInt(t);if(Number.isNaN(n))throw Error(`Environment variable ${j} mast be a number, got "${t}"`);return n},configFileSelector:e=>{let t=e[M];if(!t)return;let n=parseInt(t);if(Number.isNaN(n))throw Error(`Shared config file entry ${M} mast be a number, got "${t}"`);return n},default:3},Cr=e=>{let{retryStrategy:t,retryMode:n}=e,r=l(e.maxAttempts??3),i=t?Promise.resolve(t):void 0,a=async()=>await l(n)()===ze.ADAPTIVE?new Ne(r):new Be(r);return Object.assign(e,{maxAttempts:r,retryStrategy:()=>i??(i=a())})},wr=`AWS_RETRY_MODE`,Tr=`retry_mode`,Er={environmentVariableSelector:e=>e[wr],configFileSelector:e=>e[Tr],default:Ve}})),Or=e((()=>{})),kr,Ar=e((()=>{kr=e=>e?.body instanceof et||typeof ReadableStream<`u`&&e?.body instanceof ReadableStream}));function jr(e,t){if(r.isInstance(e))for(let n of Object.keys(e.headers)){let r=n.toLowerCase();if(r===`retry-after`){let r=e.headers[n],i=NaN;if(r.endsWith(`GMT`))try{i=(ae(r).getTime()-Date.now())/1e3}catch(e){t?.trace?.(`Failed to parse retry-after header`),t?.trace?.(e)}else r.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?i=Number(r.match(/ GMT, ([\d.]+)$/)?.[1]):r.match(/^((\d+)|(\d+\.\d+))$/)?i=Number(r):Date.parse(r)>=Date.now()&&(i=(Date.parse(r)-Date.now())/1e3);return isNaN(i)?void 0:new Date(Date.now()+i*1e3)}else if(r===`x-amz-retry-after`){let r=e.headers[n],i=Number(r);if(isNaN(i)){t?.trace?.(`Failed to parse x-amz-retry-after=${r}`);return}return new Date(Date.now()+i)}}}var Mr=e((()=>{v(),a()})),Nr,Pr,Fr,Ir,Lr,Rr,zr,Br=e((()=>{a(),Re(),w(),Le(),se(),Ar(),Mr(),_r(),Nr=e=>(t,n)=>async r=>{let a=await e.retryStrategy(),o=await e.maxAttempts();if(Fr(a)){a=a;let s=await a.acquireInitialRetryToken((n.partition_id??``)+(n.__retryLongPoll?`:longpoll`:``)),c=Error(),l=0,u=0,{request:d}=r,f=i.isInstance(d);for(f&&(d.headers[He]=ce());;)try{f&&(d.headers[Pe]=`attempt=${l+1}; max=${o}`);let{response:e,output:n}=await t(r);return a.recordSuccess(s),n.$metadata.attempts=l+1,n.$metadata.totalRetryDelay=u,{response:e,output:n}}catch(t){let r=Ir(t,e.logger);if(c=gr(t),f&&kr(d))throw(n.logger instanceof Xe?console:n.logger)?.warn(`An error was encountered in a non-retryable streaming request.`),c;try{s=await a.refreshRetryTokenForRetry(s,r)}catch(e){throw typeof e.$backoff==`number`&&await Pr(e.$backoff),c.$metadata||(c.$metadata={}),c.$metadata.attempts=l+1,c.$metadata.totalRetryDelay=u,c}l=s.getRetryCount();let i=s.getRetryDelay();u+=i,await Pr(i)}}else return a=a,a?.mode&&(n.userAgent=[...n.userAgent||[],[`cfg/retry-mode`,a.mode]]),a.retry(t,r)},Pr=e=>new Promise(t=>setTimeout(t,e)),Fr=e=>e.acquireInitialRetryToken!==void 0&&e.refreshRetryTokenForRetry!==void 0&&e.recordSuccess!==void 0,Ir=(e,t)=>{let n={error:e,errorType:Lr(e)},r=jr(e.$response,t);return r&&(n.retryAfterHint=r),n},Lr=e=>Fe(e)?`THROTTLING`:Ie(e)?`TRANSIENT`:We(e)?`SERVER_ERROR`:`CLIENT_ERROR`,Rr={name:`retryMiddleware`,tags:[`RETRY`],step:`finalizeRequest`,priority:`high`,override:!0},zr=e=>({applyToStack:t=>{t.add(Nr(e),Rr)}})})),Vr=e((()=>{xr(),br(),vr(),yr(),Dr(),Or(),Br(),Mr()})),Hr,Ur=e((()=>{Hr=()=>{for(let e of[`deno`,`bun`,`llrt`])if($e[e])return[`md/${e}`,$e[e]];return[`md/nodejs`,$e.node]}})),Wr,Gr=e((()=>{Wr=e=>{let t=process.cwd();if(!e)return[t];let n=nt(e),r=n.split(rt),i=r.indexOf(`node_modules`),a=i===-1?n:r.slice(0,i).join(rt);return t===a?[t]:[a,t]}})),Kr,qr,Jr=e((()=>{Kr=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/,qr=(e=``)=>{let t=e.match(Kr);if(!t)return;let[n,r,i,a]=[t[1],t[2],t[3],t[4]];return a?`${n}.${r}.${i}-${a}`:`${n}.${r}.${i}`}})),Yr,Xr,Zr,Qr=e((()=>{Jr(),Yr=[`^`,`~`,`>=`,`<=`,`>`,`<`],Xr=[`latest`,`beta`,`dev`,`rc`,`insiders`,`next`],Zr=(e=``)=>{if(Xr.includes(e))return e;let t=Yr.find(t=>e.startsWith(t))??``,n=qr(e.slice(t.length));if(n)return`${t}${n}`}})),N,$r,ei,ti=e((()=>{Ae(),Gr(),Qr(),Jr(),$r=tt(`node_modules`,`typescript`,`package.json`),ei=async()=>{if(N===null)return;if(typeof N==`string`)return[`md/tsc`,N];let e=!1;try{e=Ee(process.env,`AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED`,Ce.ENV)||!1}catch{}if(e){N=null;return}let t=Wr(typeof __dirname<`u`?__dirname:void 0),n;for(let e of t)try{let t=await ft(tt(e,`package.json`),`utf-8`),{dependencies:r,devDependencies:i}=JSON.parse(t),a=i?.typescript??r?.typescript;if(typeof a!=`string`)continue;n=a;break}catch{}if(!n){N=null;return}let r;for(let e of t)try{let t=await ft(tt(e,$r),`utf-8`),{version:n}=JSON.parse(t),i=qr(n);if(typeof i!=`string`)continue;r=i;break}catch{}if(r)return N=r,[`md/tsc`,N];let i=Zr(n);if(typeof i!=`string`){N=null;return}return N=`dev_${i}`,[`md/tsc`,N]}})),ni,ri=e((()=>{ni={isCrtAvailable:!1}})),ii,ai=e((()=>{ri(),ii=()=>ni.isCrtAvailable?[`md/crt-avail`]:null})),oi,si=e((()=>{Ur(),ti(),ai(),ri(),oi=({serviceId:e,clientVersion:t})=>{let n=Hr();return async r=>{let i=[[`aws-sdk-js`,t],[`ua`,`2.1`],[`os/${st()}`,ct()],[`lang/js`],n],a=await ei();a&&i.push(a);let o=ii();o&&i.push(o),e&&i.push([`api/${e}`,t]),Qe.AWS_EXECUTION_ENV&&i.push([`exec-env/${Qe.AWS_EXECUTION_ENV}`]);let s=await r?.userAgentAppId?.();return s?[...i,[`app/${s}`]]:[...i]}}})),ci,li,ui,di=e((()=>{On(),ci=`AWS_SDK_UA_APP_ID`,li=`sdk-ua-app-id`,ui={environmentVariableSelector:e=>e[ci],configFileSelector:e=>e.sdk_ua_app_id??e[li],default:void 0}})),fi=e((()=>{si(),di()}));function pi(e,t){return lt.isBuffer(e)?e:typeof e==`string`?m(e,t):ArrayBuffer.isView(e)?f(e.buffer,e.byteOffset,e.byteLength):f(e)}var mi,hi=e((()=>{ee(),g(),t(),mi=class{constructor(e,t){n(this,`algorithmIdentifier`,void 0),n(this,`secret`,void 0),n(this,`hash`,void 0),this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(h(pi(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?dt(this.algorithmIdentifier,pi(this.secret)):ut(this.algorithmIdentifier)}}})),gi,_i=e((()=>{gi=e=>{if(!e)return 0;if(typeof e==`string`)return Buffer.byteLength(e);if(typeof e.byteLength==`number`)return e.byteLength;if(typeof e.size==`number`)return e.size;if(typeof e.start==`number`&&typeof e.end==`number`)return e.end+1-e.start;if(e instanceof it){if(e.path!=null)return ot(e.path).size;if(typeof e.fd==`number`)return at(e.fd).size}throw Error(`Body Length computation failed for ${e}`)}})),vi=e((()=>{_i()})),yi,bi,xi=e((()=>{yi=[`in-region`,`cross-region`,`mobile`,`standard`,`legacy`],bi=`/latest/meta-data/placement/region`})),Si,Ci,wi,Ti=e((()=>{Si=`AWS_DEFAULTS_MODE`,Ci=`defaults_mode`,wi={environmentVariableSelector:e=>e[Si],configFileSelector:e=>e[Ci],default:`legacy`}})),Ei,Di,Oi,ki=e((()=>{je(),qe(),Ke(),xi(),Ti(),Ei=({region:e=C(Te),defaultsMode:t=C(wi)}={})=>Ge(async()=>{let n=typeof t==`function`?await t():t;switch(n?.toLowerCase()){case`auto`:return Di(e);case`in-region`:case`cross-region`:case`mobile`:case`standard`:case`legacy`:return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve(`legacy`);default:throw Error(`Invalid parameter for "defaultsMode", expect ${yi.join(`, `)}, got ${n}`)}}),Di=async e=>{if(e){let t=typeof e==`function`?await e():e,n=await Oi();return n?t===n?`in-region`:`cross-region`:`standard`}return`standard`},Oi=async()=>{if(process.env.AWS_EXECUTION_ENV&&(process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION))return process.env.AWS_REGION??process.env.AWS_DEFAULT_REGION;if(!process.env.AWS_EC2_METADATA_DISABLED)try{let{getInstanceMetadataEndpoint:e,httpRequest:t}=await import(`./dist-es-W22ud2el2.js`);return(await t({...await e(),path:bi})).toString()}catch{}}})),Ai=e((()=>{ki()})),ji,Mi=e((()=>{x(),w(),t(),ji=class{constructor(e=!1){n(this,`queryCompat`,void 0),n(this,`errorRegistry`,void 0),this.queryCompat=e}resolveRestContentType(e,t){let n=t.getMemberSchemas(),r=Object.values(n).find(e=>!!e.getMergedTraits().httpPayload);if(r)return r.getMergedTraits().mediaType||(r.isStringSchema()?`text/plain`:r.isBlobSchema()?`application/octet-stream`:e);if(!t.isUnitSchema()&&Object.values(n).find(e=>{let{httpQuery:t,httpQueryParams:n,httpHeader:r,httpLabel:i,httpPrefixHeaders:a}=e.getMergedTraits();return!t&&!n&&!r&&!i&&a===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,n,r,i,a){let o=e;e.includes(`#`)&&([,o]=e.split(`#`));let s={$metadata:i,$fault:n.statusCode<500?`client`:`server`};if(!this.errorRegistry)throw Error(`@aws-sdk/core/protocols - error handler not initialized.`);try{return{errorSchema:a?.(this.errorRegistry,o)??this.errorRegistry.getSchema(e),errorMetadata:s}}catch{r.message=r.message??r.Message??`UnknownError`;let e=this.errorRegistry,t=e.getBaseException();if(t){let n=e.getErrorCtor(t)??Error;throw this.decorateServiceException(Object.assign(new n({name:o}),s),r)}let n=r,i=n?.message??n?.Message??n?.Error?.Message??n?.Error?.message;throw this.decorateServiceException(Object.assign(Error(i),{name:o},s),r)}}compose(e,t,n){let r=n;t.includes(`#`)&&([r]=t.split(`#`));let i=ye.for(r),a=ye.for(`smithy.ts.sdk.synthetic.`+n);e.copyFrom(i),e.copyFrom(a),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){let n=e.Message??t.Message,r=Ye(e,t);n&&(r.message=n);let i=r.Error??{};i.Type=r.Error?.Type,i.Code=r.Error?.Code,i.Message=r.Error?.message??r.Error?.Message??n,r.Error=i;let a=r.$metadata.requestId;return a&&(r.RequestId=a),r}return Ye(e,t)}setQueryCompatError(e,t){let n=t.headers?.[`x-amzn-query-error`];if(e!==void 0&&n!=null){let[t,r]=n.split(`;`),i=Object.keys(e),a={Code:t,Type:r};e.Code=t,e.Type=r;for(let t=0;t<i.length;t++){let n=i[t];a[n===`message`?`Message`:n]=e[n]}delete a.__type,e.Error=a}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(e=>_.of(e).getMergedTraits().awsQueryError?.[0]===t)}}}})),Ni=e((()=>{})),Pi=e((()=>{})),P,F=e((()=>{t(),P=class{constructor(){n(this,`serdeContext`,void 0)}setSerdeContext(e){this.serdeContext=e}}})),Fi,Ii=e((()=>{t(),Fi=class{constructor(e,t){n(this,`from`,void 0),n(this,`to`,void 0),n(this,`keys`,void 0),this.from=e,this.to=t;let r=Object.keys(this.from),i=new Set(r);i.delete(`__type`),this.keys=i}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}}));function Li(e,t,n){if(n?.source){let e=n.source;if(typeof t==`number`&&(t>2**53-1||t<-(2**53-1)||e!==String(t)))return e.includes(`.`)?new y(e,`bigDecimal`):BigInt(e)}return t}var Ri=e((()=>{v()})),zi,Bi=e((()=>{w(),g(),zi=(e,t)=>ve(e,t).then(e=>(t?.utf8Encoder??p)(e))})),Vi,Hi,I,Ui,Wi=e((()=>{Bi(),Vi=(e,t)=>zi(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw t?.name===`SyntaxError`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}return{}}),Hi=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),I=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t},Ui=(e,t)=>{let n=Hi(e.headers,`x-amzn-errortype`);if(n!==void 0)return I(e.headers[n]);if(t&&typeof t==`object`){let e=Hi(t,`code`);if(e&&t[e]!==void 0)return I(t[e]);if(t.__type!==void 0)return I(t.__type)}}})),Gi,Ki=e((()=>{b(),x(),v(),ne(),F(),Ii(),Ri(),Wi(),t(),Gi=class extends P{constructor(e){super(),n(this,`settings`,void 0),this.settings=e}async read(e,t){return this._read(e,typeof t==`string`?JSON.parse(t,Li):await Vi(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){let n=typeof t==`object`&&!!t,r=_.of(e);if(n){if(r.isStructSchema()){let e=t,n=r.isUnionSchema(),i={},a,{jsonName:o}=this.settings;o&&(a={});let s;n&&(s=new Fi(e,i));for(let[t,c]of r.structIterator()){let r=t;o&&(r=c.getMergedTraits().jsonName??r,a[r]=t),n&&s.mark(r),e[r]!=null&&(i[t]=this._read(c,e[r]))}if(n)s.writeUnknown();else if(typeof e.__type==`string`)for(let t in e){let n=e[t],r=o?a[t]??t:t;r in i||(i[r]=n)}return i}if(Array.isArray(t)&&r.isListSchema()){let e=r.getValueSchema(),n=[];for(let r of t)n.push(this._read(e,r));return n}if(r.isMapSchema()){let e=r.getValueSchema(),n={};for(let r in t)n[r]=this._read(e,t[r]);return n}}if(r.isBlobSchema()&&typeof t==`string`)return be(t);let i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&typeof t==`string`&&i)return i===`application/json`||i.endsWith(`+json`)?_e.from(t):t;if(r.isTimestampSchema()&&t!=null)switch(oe(r,this.settings)){case 5:return le(t);case 6:return ae(t);case 7:return de(t);default:return console.warn(`Missing timestamp format, parsing value with Date constructor:`,t),new Date(t)}if(r.isBigIntegerSchema()&&(typeof t==`number`||typeof t==`string`))return BigInt(t);if(r.isBigDecimalSchema()&&t!=null){if(t instanceof y)return t;let e=t;return e.type===`bigDecimal`&&`string`in e?new y(e.string,e.type):new y(String(t),`bigDecimal`)}if(r.isNumericSchema()&&typeof t==`string`){switch(t){case`Infinity`:return 1/0;case`-Infinity`:return-1/0;case`NaN`:return NaN}return t}if(r.isDocumentSchema())if(n){let e=Array.isArray(t)?[]:{};for(let n in t){let i=t[n];i instanceof y?e[n]=i:e[n]=this._read(r,i)}return e}else return structuredClone(t);return t}}})),qi,Ji,Yi=e((()=>{v(),t(),qi=`Ν`,Ji=class{constructor(){n(this,`values`,new Map),n(this,`counter`,0),n(this,`stage`,0)}createReplacer(){if(this.stage===1)throw Error(`@aws-sdk/core/protocols - JsonReplacer already created.`);if(this.stage===2)throw Error(`@aws-sdk/core/protocols - JsonReplacer exhausted.`);return this.stage=1,(e,t)=>{if(t instanceof y){let e=`${qi+`nv`+ this.counter++}_`+t.string;return this.values.set(`"${e}"`,t.string),e}if(typeof t==`bigint`){let e=t.toString(),n=`${qi+`b`+ this.counter++}_`+e;return this.values.set(`"${n}"`,e),n}return t}}replaceInJson(e){if(this.stage===0)throw Error(`@aws-sdk/core/protocols - JsonReplacer not created yet.`);if(this.stage===2)throw Error(`@aws-sdk/core/protocols - JsonReplacer exhausted.`);if(this.stage=2,this.counter===0)return e;for(let[t,n]of this.values)e=e.replace(t,n);return e}}})),Xi,Zi=e((()=>{b(),x(),v(),ne(),F(),Yi(),t(),Xi=class extends P{constructor(e){super(),n(this,`settings`,void 0),n(this,`buffer`,void 0),n(this,`useReplacer`,!1),n(this,`rootSchema`,void 0),this.settings=e}write(e,t){this.rootSchema=_.of(e),this.buffer=this._write(this.rootSchema,t)}flush(){let{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);let e=new Ji;return e.replaceInJson(JSON.stringify(this.buffer,e.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer==`object`&&(this.buffer.__type=_.of(e).getName(!0))}_write(e,t,n){let r=typeof t==`object`&&!!t,i=_.of(e);if(r){if(i.isStructSchema()){let e=t,n={},{jsonName:r}=this.settings,a;r&&(a={});let o=0;for(let[t,s]of i.structIterator()){let c=this._write(s,e[t],i);if(c!==void 0){let e=t;r&&(e=s.getMergedTraits().jsonName??t,a[t]=e),n[e]=c,o++}}if(i.isUnionSchema()&&o===0){let{$unknown:t}=e;if(Array.isArray(t)){let[e,r]=t;n[e]=this._write(15,r)}}else if(typeof e.__type==`string`)for(let t in e){let i=e[t],o=r?a[t]??t:t;o in n||(n[o]=this._write(15,i))}return n}if(Array.isArray(t)&&i.isListSchema()){let e=i.getValueSchema(),n=[],r=!!i.getMergedTraits().sparse;for(let i of t)(r||i!=null)&&n.push(this._write(e,i));return n}if(i.isMapSchema()){let e=i.getValueSchema(),n={},r=!!i.getMergedTraits().sparse;for(let i in t){let a=t[i];(r||a!=null)&&(n[i]=this._write(e,a))}return n}if(t instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??re)(t);if(t instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema()))switch(oe(i,this.settings)){case 5:return t.toISOString().replace(`.000Z`,`Z`);case 6:return me(t);case 7:return t.getTime()/1e3;default:return console.warn(`Missing timestamp format, using epoch seconds`,t),t.getTime()/1e3}t instanceof y&&(this.useReplacer=!0)}if(!(t===null&&n?.isStructSchema())){if(i.isStringSchema()){if(t===void 0&&i.isIdempotencyToken())return ce();let e=i.getMergedTraits().mediaType;return t!=null&&e&&(e===`application/json`||e.endsWith(`+json`))?_e.from(t):t}if(typeof t==`number`&&i.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t==`string`&&i.isBlobSchema())return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??re)(t);if(typeof t==`bigint`&&(this.useReplacer=!0),i.isDocumentSchema())if(r){let e=Array.isArray(t)?[]:{};for(let n in t){let r=t[n];r instanceof y?(this.useReplacer=!0,e[n]=r):e[n]=this._write(i,r)}return e}else return structuredClone(t);return t}}}})),Qi,$i=e((()=>{F(),Ki(),Zi(),t(),Qi=class extends P{constructor(e){super(),n(this,`settings`,void 0),this.settings=e}createSerializer(){let e=new Xi(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Gi(this.settings);return e.setSerdeContext(this.serdeContext),e}}})),ea=e((()=>{})),ta=e((()=>{})),na=e((()=>{})),ra,ia=e((()=>{b(),x(),Mi(),$i(),Wi(),t(),ra=class extends ge{constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t}),n(this,`serializer`,void 0),n(this,`deserializer`,void 0),n(this,`codec`,void 0),n(this,`mixin`,new ji);let r={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new Qi(r),this.serializer=new fe(this.codec.createSerializer(),r),this.deserializer=new he(this.codec.createDeserializer(),r)}getShapeId(){return`aws.protocols#restJson1`}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n),i=_.of(e.input);if(!r.headers[`content-type`]){let e=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);e&&(r.headers[`content-type`]=e)}return r.body==null&&r.headers[`content-type`]===this.getDefaultContentType()&&(r.body=`{}`),r}async deserializeResponse(e,t,n){let r=await super.deserializeResponse(e,t,n),i=_.of(e.output);for(let[e,t]of i.structIterator())t.getMemberTraits().httpPayload&&!(e in r)&&(r[e]=null);return r}async handleError(e,t,n,r,i){let a=Ui(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i),c=_.of(o),l=r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l);await this.deserializeHttpMessage(o,t,n,r);let d={},f=this.codec.createDeserializer();for(let[e,t]of c.structIterator()){let n=t.getMergedTraits().jsonName??e;d[e]=f.readObject(t,r[n])}throw this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}getDefaultContentType(){return`application/json`}}})),aa=e((()=>{})),oa=e((()=>{})),sa=e((()=>{}));function ca(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}function la(e){return e!==void 0}var ua,da,fa,L,R,pa,z=e((()=>{ua=`:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD`,ua+``,da=`[`+ua+`][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*`,fa=RegExp(`^`+da+`$`),L=function(e){return fa.exec(e)!=null},R=[`hasOwnProperty`,`toString`,`valueOf`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`],pa=[`__proto__`,`constructor`,`prototype`]}));function ma(e,t){t=Object.assign({},wa,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=ga(e,a),a.err)return a}else if(e[a]===`<`){let o=a;if(a++,e[a]===`!`){a=_a(e,a);continue}else{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
2
+ `&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!Ca(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,B(`InvalidTag`,t,V(e,a))}let l=va(e,a);if(l===!1)return B(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,V(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=ya(u,t);if(i===!0)r=!0;else return B(i.err.code,i.err.msg,V(e,n+i.err.line))}else if(s){if(!l.tagClosed)return B(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,V(e,a));if(u.trim().length>0)return B(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,V(e,o));if(n.length===0)return B(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,V(e,o));{let t=n.pop();if(c!==t.tagName){let n=V(e,t.tagStartPos);return B(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,V(e,o))}n.length==0&&(i=!0)}}else{let s=ya(u,t);if(s!==!0)return B(s.err.code,s.err.msg,V(e,a-u.length+s.err.line));if(i===!0)return B(`InvalidXml`,`Multiple possible root nodes found.`,V(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`!`){a++,a=_a(e,a);continue}else if(e[a+1]===`?`){if(a=ga(e,++a),a.err)return a}else break;else if(e[a]===`&`){let t=xa(e,a);if(t==-1)return B(`InvalidChar`,`char '&' is not expected.`,V(e,a));a=t}else if(i===!0&&!ha(e[a]))return B(`InvalidXml`,`Extra text at the end`,V(e,a));e[a]===`<`&&a--}}else{if(ha(e[a]))continue;return B(`InvalidChar`,`char '`+e[a]+`' is not expected.`,V(e,a))}return r?n.length==1?B(`InvalidTag`,`Unclosed tag '`+n[0].tagName+`'.`,V(e,n[0].tagStartPos)):n.length>0?B(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):!0:B(`InvalidXml`,`Start tag expected.`,1)}function ha(e){return e===` `||e===` `||e===`
3
+ `||e===`\r`}function ga(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return B(`InvalidXml`,`XML declaration allowed only at the start of the document.`,V(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function _a(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}function va(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===Ta||e[t]===Ea)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}function ya(e,t){let n=ca(e,Da),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return B(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,H(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return B(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,H(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return B(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,H(n[e]));let i=n[e][2];if(!Sa(i))return B(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,H(n[e]));if(!Object.prototype.hasOwnProperty.call(r,i))r[i]=1;else return B(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,H(n[e]))}return!0}function ba(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function xa(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,ba(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function B(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function Sa(e){return L(e)}function Ca(e){return L(e)}function V(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function H(e){return e.startIndex+e[1].length}var wa,Ta,Ea,Da,Oa=e((()=>{z(),wa={allowBooleanAttributes:!1,unpairedTags:[]},Ta=`"`,Ea=`'`,Da=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`)})),ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa=e((()=>{ka={amp:`&`,AMP:`&`,lt:`<`,LT:`<`,gt:`>`,GT:`>`,quot:`"`,QUOT:`"`,apos:`'`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,lsquor:`‚`,rsquor:`’`,ldquor:`„`,bdquo:`„`,comma:`,`,period:`.`,colon:`:`,semi:`;`,excl:`!`,quest:`?`,num:`#`,dollar:`$`,percent:`%`,amp:`&`,ast:`*`,commat:`@`,lowbar:`_`,verbar:`|`,vert:`|`,sol:`/`,bsol:`\\`,lbrace:`{`,rbrace:`}`,lbrack:`[`,rbrack:`]`,lpar:`(`,rpar:`)`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,COPY:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,REG:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,half:`½`,frac34:`¾`,iquest:`¿`,times:`×`,div:`÷`,divide:`÷`},Aa={Agrave:`À`,agrave:`à`,Aacute:`Á`,aacute:`á`,Acirc:`Â`,acirc:`â`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,Aring:`Å`,aring:`å`,AElig:`Æ`,aelig:`æ`,Ccedil:`Ç`,ccedil:`ç`,Egrave:`È`,egrave:`è`,Eacute:`É`,eacute:`é`,Ecirc:`Ê`,ecirc:`ê`,Euml:`Ë`,euml:`ë`,Igrave:`Ì`,igrave:`ì`,Iacute:`Í`,iacute:`í`,Icirc:`Î`,icirc:`î`,Iuml:`Ï`,iuml:`ï`,ETH:`Ð`,eth:`ð`,Ntilde:`Ñ`,ntilde:`ñ`,Ograve:`Ò`,ograve:`ò`,Oacute:`Ó`,oacute:`ó`,Ocirc:`Ô`,ocirc:`ô`,Otilde:`Õ`,otilde:`õ`,Ouml:`Ö`,ouml:`ö`,Oslash:`Ø`,oslash:`ø`,Ugrave:`Ù`,ugrave:`ù`,Uacute:`Ú`,uacute:`ú`,Ucirc:`Û`,ucirc:`û`,Uuml:`Ü`,uuml:`ü`,Yacute:`Ý`,yacute:`ý`,THORN:`Þ`,thorn:`þ`,szlig:`ß`,yuml:`ÿ`,Yuml:`Ÿ`},ja={Amacr:`Ā`,amacr:`ā`,Abreve:`Ă`,abreve:`ă`,Aogon:`Ą`,aogon:`ą`,Cacute:`Ć`,cacute:`ć`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cdot:`Ċ`,cdot:`ċ`,Ccaron:`Č`,ccaron:`č`,Dcaron:`Ď`,dcaron:`ď`,Dstrok:`Đ`,dstrok:`đ`,Emacr:`Ē`,emacr:`ē`,Ecaron:`Ě`,ecaron:`ě`,Edot:`Ė`,edot:`ė`,Eogon:`Ę`,eogon:`ę`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gbreve:`Ğ`,gbreve:`ğ`,Gdot:`Ġ`,gdot:`ġ`,Gcedil:`Ģ`,Hcirc:`Ĥ`,hcirc:`ĥ`,Hstrok:`Ħ`,hstrok:`ħ`,Itilde:`Ĩ`,itilde:`ĩ`,Imacr:`Ī`,imacr:`ī`,Iogon:`Į`,iogon:`į`,Idot:`İ`,IJlig:`IJ`,ijlig:`ij`,Jcirc:`Ĵ`,jcirc:`ĵ`,Kcedil:`Ķ`,kcedil:`ķ`,kgreen:`ĸ`,Lacute:`Ĺ`,lacute:`ĺ`,Lcedil:`Ļ`,lcedil:`ļ`,Lcaron:`Ľ`,lcaron:`ľ`,Lmidot:`Ŀ`,lmidot:`ŀ`,Lstrok:`Ł`,lstrok:`ł`,Nacute:`Ń`,nacute:`ń`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ENG:`Ŋ`,eng:`ŋ`,Omacr:`Ō`,omacr:`ō`,Odblac:`Ő`,odblac:`ő`,OElig:`Œ`,oelig:`œ`,Racute:`Ŕ`,racute:`ŕ`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,Sacute:`Ś`,sacute:`ś`,Scirc:`Ŝ`,scirc:`ŝ`,Scedil:`Ş`,scedil:`ş`,Scaron:`Š`,scaron:`š`,Tcedil:`Ţ`,tcedil:`ţ`,Tcaron:`Ť`,tcaron:`ť`,Tstrok:`Ŧ`,tstrok:`ŧ`,Utilde:`Ũ`,utilde:`ũ`,Umacr:`Ū`,umacr:`ū`,Ubreve:`Ŭ`,ubreve:`ŭ`,Uring:`Ů`,uring:`ů`,Udblac:`Ű`,udblac:`ű`,Uogon:`Ų`,uogon:`ų`,Wcirc:`Ŵ`,wcirc:`ŵ`,Ycirc:`Ŷ`,ycirc:`ŷ`,Zacute:`Ź`,zacute:`ź`,Zdot:`Ż`,zdot:`ż`,Zcaron:`Ž`,zcaron:`ž`},Ma={Alpha:`Α`,alpha:`α`,Beta:`Β`,beta:`β`,Gamma:`Γ`,gamma:`γ`,Delta:`Δ`,delta:`δ`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,varepsilon:`ϵ`,Zeta:`Ζ`,zeta:`ζ`,Eta:`Η`,eta:`η`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,vartheta:`ϑ`,Iota:`Ι`,iota:`ι`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,varkappa:`ϰ`,Lambda:`Λ`,lambda:`λ`,Mu:`Μ`,mu:`μ`,Nu:`Ν`,nu:`ν`,Xi:`Ξ`,xi:`ξ`,Omicron:`Ο`,omicron:`ο`,Pi:`Π`,pi:`π`,piv:`ϖ`,varpi:`ϖ`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,varrho:`ϱ`,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,varsigma:`ς`,Tau:`Τ`,tau:`τ`,Upsilon:`Υ`,upsilon:`υ`,upsi:`υ`,Upsi:`ϒ`,upsih:`ϒ`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,varphi:`ϕ`,Chi:`Χ`,chi:`χ`,Psi:`Ψ`,psi:`ψ`,Omega:`Ω`,omega:`ω`,ohm:`Ω`,Gammad:`Ϝ`,gammad:`ϝ`,digamma:`ϝ`},Na={Afr:`𝔄`,afr:`𝔞`,Acy:`А`,acy:`а`,Bcy:`Б`,bcy:`б`,Vcy:`В`,vcy:`в`,Gcy:`Г`,gcy:`г`,Dcy:`Д`,dcy:`д`,IEcy:`Е`,iecy:`е`,IOcy:`Ё`,iocy:`ё`,ZHcy:`Ж`,zhcy:`ж`,Zcy:`З`,zcy:`з`,Icy:`И`,icy:`и`,Jcy:`Й`,jcy:`й`,Kcy:`К`,kcy:`к`,Lcy:`Л`,lcy:`л`,Mcy:`М`,mcy:`м`,Ncy:`Н`,ncy:`н`,Ocy:`О`,ocy:`о`,Pcy:`П`,pcy:`п`,Rcy:`Р`,rcy:`р`,Scy:`С`,scy:`с`,Tcy:`Т`,tcy:`т`,Ucy:`У`,ucy:`у`,Fcy:`Ф`,fcy:`ф`,KHcy:`Х`,khcy:`х`,TScy:`Ц`,tscy:`ц`,CHcy:`Ч`,chcy:`ч`,SHcy:`Ш`,shcy:`ш`,SHCHcy:`Щ`,shchcy:`щ`,HARDcy:`Ъ`,hardcy:`ъ`,Ycy:`Ы`,ycy:`ы`,SOFTcy:`Ь`,softcy:`ь`,Ecy:`Э`,ecy:`э`,YUcy:`Ю`,yucy:`ю`,YAcy:`Я`,yacy:`я`,DJcy:`Ђ`,djcy:`ђ`,GJcy:`Ѓ`,gjcy:`ѓ`,Jukcy:`Є`,jukcy:`є`,DScy:`Ѕ`,dscy:`ѕ`,Iukcy:`І`,iukcy:`і`,YIcy:`Ї`,yicy:`ї`,Jsercy:`Ј`,jsercy:`ј`,LJcy:`Љ`,ljcy:`љ`,NJcy:`Њ`,njcy:`њ`,TSHcy:`Ћ`,tshcy:`ћ`,KJcy:`Ќ`,kjcy:`ќ`,Ubrcy:`Ў`,ubrcy:`ў`,DZcy:`Џ`,dzcy:`џ`},Pa={plus:`+`,minus:`−`,mnplus:`∓`,mp:`∓`,pm:`±`,times:`×`,div:`÷`,divide:`÷`,sdot:`⋅`,star:`☆`,starf:`★`,bigstar:`★`,lowast:`∗`,ast:`*`,midast:`*`,compfn:`∘`,smallcircle:`∘`,bullet:`•`,bull:`•`,nbsp:`\xA0`,hellip:`…`,mldr:`…`,prime:`′`,Prime:`″`,tprime:`‴`,bprime:`‵`,backprime:`‵`,minus:`−`,minusd:`∸`,dotminus:`∸`,plusdo:`∔`,dotplus:`∔`,plusmn:`±`,minusplus:`∓`,mnplus:`∓`,mp:`∓`,setminus:`∖`,smallsetminus:`∖`,Backslash:`∖`,setmn:`∖`,ssetmn:`∖`,lowbar:`_`,verbar:`|`,vert:`|`,VerticalLine:`|`,colon:`:`,Colon:`∷`,Proportion:`∷`,ratio:`∶`,equals:`=`,ne:`≠`,nequiv:`≢`,equiv:`≡`,Congruent:`≡`,sim:`∼`,thicksim:`∼`,thksim:`∼`,sime:`≃`,simeq:`≃`,TildeEqual:`≃`,asymp:`≈`,approx:`≈`,thickapprox:`≈`,thkap:`≈`,TildeTilde:`≈`,ncong:`≇`,cong:`≅`,TildeFullEqual:`≅`,asympeq:`≍`,CupCap:`≍`,bump:`≎`,Bumpeq:`≎`,HumpDownHump:`≎`,bumpe:`≏`,bumpeq:`≏`,HumpEqual:`≏`,dotminus:`∸`,minusd:`∸`,plusdo:`∔`,dotplus:`∔`,le:`≤`,LessEqual:`≤`,ge:`≥`,GreaterEqual:`≥`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,greater:`>`,less:`<`},Fa={alefsym:`ℵ`,aleph:`ℵ`,beth:`ℶ`,gimel:`ℷ`,daleth:`ℸ`,forall:`∀`,ForAll:`∀`,part:`∂`,PartialD:`∂`,exist:`∃`,Exists:`∃`,nexist:`∄`,nexists:`∄`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,varnothing:`∅`,nabla:`∇`,Del:`∇`,isin:`∈`,isinv:`∈`,in:`∈`,Element:`∈`,notin:`∉`,notinva:`∉`,ni:`∋`,niv:`∋`,SuchThat:`∋`,ReverseElement:`∋`,notni:`∌`,notniva:`∌`,prod:`∏`,Product:`∏`,coprod:`∐`,Coproduct:`∐`,sum:`∑`,Sum:`∑`,minus:`−`,mp:`∓`,plusdo:`∔`,dotplus:`∔`,setminus:`∖`,lowast:`∗`,radic:`√`,Sqrt:`√`,prop:`∝`,propto:`∝`,Proportional:`∝`,varpropto:`∝`,infin:`∞`,infintie:`⧝`,ang:`∠`,angle:`∠`,angmsd:`∡`,measuredangle:`∡`,angsph:`∢`,mid:`∣`,VerticalBar:`∣`,nmid:`∤`,nsmid:`∤`,npar:`∦`,parallel:`∥`,spar:`∥`,nparallel:`∦`,nspar:`∦`,and:`∧`,wedge:`∧`,or:`∨`,vee:`∨`,cap:`∩`,cup:`∪`,int:`∫`,Integral:`∫`,conint:`∮`,ContourIntegral:`∮`,Conint:`∯`,DoubleContourIntegral:`∯`,Cconint:`∰`,there4:`∴`,therefore:`∴`,Therefore:`∴`,becaus:`∵`,because:`∵`,Because:`∵`,ratio:`∶`,Proportion:`∷`,minusd:`∸`,dotminus:`∸`,mDDot:`∺`,homtht:`∻`,sim:`∼`,bsimg:`∽`,backsim:`∽`,ac:`∾`,mstpos:`∾`,acd:`∿`,VerticalTilde:`≀`,wr:`≀`,wreath:`≀`,nsime:`≄`,nsimeq:`≄`,nsimeq:`≄`,ncong:`≇`,simne:`≆`,ncongdot:`⩭̸`,ngsim:`≵`,nsim:`≁`,napprox:`≉`,nap:`≉`,ngeq:`≱`,nge:`≱`,nleq:`≰`,nle:`≰`,ngtr:`≯`,ngt:`≯`,nless:`≮`,nlt:`≮`,nprec:`⊀`,npr:`⊀`,nsucc:`⊁`,nsc:`⊁`},Ia={larr:`←`,leftarrow:`←`,LeftArrow:`←`,uarr:`↑`,uparrow:`↑`,UpArrow:`↑`,rarr:`→`,rightarrow:`→`,RightArrow:`→`,darr:`↓`,downarrow:`↓`,DownArrow:`↓`,harr:`↔`,leftrightarrow:`↔`,LeftRightArrow:`↔`,varr:`↕`,updownarrow:`↕`,UpDownArrow:`↕`,nwarr:`↖`,nwarrow:`↖`,UpperLeftArrow:`↖`,nearr:`↗`,nearrow:`↗`,UpperRightArrow:`↗`,searr:`↘`,searrow:`↘`,LowerRightArrow:`↘`,swarr:`↙`,swarrow:`↙`,LowerLeftArrow:`↙`,lArr:`⇐`,Leftarrow:`⇐`,uArr:`⇑`,Uparrow:`⇑`,rArr:`⇒`,Rightarrow:`⇒`,dArr:`⇓`,Downarrow:`⇓`,hArr:`⇔`,Leftrightarrow:`⇔`,iff:`⇔`,vArr:`⇕`,Updownarrow:`⇕`,lAarr:`⇚`,Lleftarrow:`⇚`,rAarr:`⇛`,Rrightarrow:`⇛`,lrarr:`⇆`,leftrightarrows:`⇆`,rlarr:`⇄`,rightleftarrows:`⇄`,lrhar:`⇋`,leftrightharpoons:`⇋`,ReverseEquilibrium:`⇋`,rlhar:`⇌`,rightleftharpoons:`⇌`,Equilibrium:`⇌`,udarr:`⇅`,UpArrowDownArrow:`⇅`,duarr:`⇵`,DownArrowUpArrow:`⇵`,llarr:`⇇`,leftleftarrows:`⇇`,rrarr:`⇉`,rightrightarrows:`⇉`,ddarr:`⇊`,downdownarrows:`⇊`,har:`↽`,lhard:`↽`,leftharpoondown:`↽`,lharu:`↼`,leftharpoonup:`↼`,rhard:`⇁`,rightharpoondown:`⇁`,rharu:`⇀`,rightharpoonup:`⇀`,lsh:`↰`,Lsh:`↰`,rsh:`↱`,Rsh:`↱`,ldsh:`↲`,rdsh:`↳`,hookleftarrow:`↩`,hookrightarrow:`↪`,mapstoleft:`↤`,mapstoup:`↥`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,crarr:`↵`,nwarrow:`↖`,nearrow:`↗`,searrow:`↘`,swarrow:`↙`,nleftarrow:`↚`,nleftrightarrow:`↮`,nrightarrow:`↛`,nrarr:`↛`,larrtl:`↢`,rarrtl:`↣`,leftarrowtail:`↢`,rightarrowtail:`↣`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Larr:`↞`,Rarr:`↠`,larrhk:`↩`,rarrhk:`↪`,larrlp:`↫`,looparrowleft:`↫`,rarrlp:`↬`,looparrowright:`↬`,harrw:`↭`,leftrightsquigarrow:`↭`,nrarrw:`↝̸`,rarrw:`↝`,rightsquigarrow:`↝`,larrbfs:`⤟`,rarrbfs:`⤠`,nvHarr:`⤄`,nvlArr:`⤂`,nvrArr:`⤃`,larrfs:`⤝`,rarrfs:`⤞`,Map:`⤅`,larrsim:`⥳`,rarrsim:`⥴`,harrcir:`⥈`,Uarrocir:`⥉`,lurdshar:`⥊`,ldrdhar:`⥧`,ldrushar:`⥋`,rdldhar:`⥩`,lrhard:`⥭`,rlhar:`⇌`,uharr:`↾`,uharl:`↿`,dharr:`⇂`,dharl:`⇃`,Uarr:`↟`,Darr:`↡`,zigrarr:`⇝`,nwArr:`⇖`,neArr:`⇗`,seArr:`⇘`,swArr:`⇙`,nharr:`↮`,nhArr:`⇎`,nlarr:`↚`,nlArr:`⇍`,nrarr:`↛`,nrArr:`⇏`,larrb:`⇤`,LeftArrowBar:`⇤`,rarrb:`⇥`,RightArrowBar:`⇥`},La={square:`□`,Square:`□`,squ:`□`,squf:`▪`,squarf:`▪`,blacksquar:`▪`,blacksquare:`▪`,FilledVerySmallSquare:`▪`,blk34:`▓`,blk12:`▒`,blk14:`░`,block:`█`,srect:`▭`,rect:`▭`,sdot:`⋅`,sdotb:`⊡`,dotsquare:`⊡`,triangle:`▵`,tri:`▵`,trine:`▵`,utri:`▵`,triangledown:`▿`,dtri:`▿`,tridown:`▿`,triangleleft:`◃`,ltri:`◃`,triangleright:`▹`,rtri:`▹`,blacktriangle:`▴`,utrif:`▴`,blacktriangledown:`▾`,dtrif:`▾`,blacktriangleleft:`◂`,ltrif:`◂`,blacktriangleright:`▸`,rtrif:`▸`,loz:`◊`,lozenge:`◊`,blacklozenge:`⧫`,lozf:`⧫`,bigcirc:`◯`,xcirc:`◯`,circ:`ˆ`,Circle:`○`,cir:`○`,o:`○`,bullet:`•`,bull:`•`,hellip:`…`,mldr:`…`,nldr:`‥`,boxh:`─`,HorizontalLine:`─`,boxv:`│`,boxdr:`┌`,boxdl:`┐`,boxur:`└`,boxul:`┘`,boxvr:`├`,boxvl:`┤`,boxhd:`┬`,boxhu:`┴`,boxvh:`┼`,boxH:`═`,boxV:`║`,boxdR:`╒`,boxDr:`╓`,boxDR:`╔`,boxDl:`╕`,boxdL:`╖`,boxDL:`╗`,boxuR:`╘`,boxUr:`╙`,boxUR:`╚`,boxUl:`╜`,boxuL:`╛`,boxUL:`╝`,boxvR:`╞`,boxVr:`╟`,boxVR:`╠`,boxVl:`╢`,boxvL:`╡`,boxVL:`╣`,boxHd:`╤`,boxhD:`╥`,boxHD:`╦`,boxHu:`╧`,boxhU:`╨`,boxHU:`╩`,boxvH:`╪`,boxVh:`╫`,boxVH:`╬`},Ra={excl:`!`,iexcl:`¡`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,nbsp:`\xA0`,comma:`,`,period:`.`,colon:`:`,semi:`;`,vert:`|`,Verbar:`‖`,verbar:`|`,dblac:`˝`,circ:`ˆ`,caron:`ˇ`,breve:`˘`,dot:`˙`,ring:`˚`,ogon:`˛`,tilde:`˜`,DiacriticalGrave:"`",DiacriticalAcute:`´`,DiacriticalTilde:`˜`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,grave:"`",acute:`´`},za={cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,euro:`€`,dollar:`$`,euro:`€`,fnof:`ƒ`,inr:`₹`,af:`؋`,birr:`ብር`,peso:`₱`,rub:`₽`,won:`₩`,yuan:`¥`,cedil:`¸`},Ba={frac12:`½`,half:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`},Va={trade:`™`,TRADE:`™`,telrec:`⌕`,target:`⌖`,ulcorn:`⌜`,ulcorner:`⌜`,urcorn:`⌝`,urcorner:`⌝`,dlcorn:`⌞`,llcorner:`⌞`,drcorn:`⌟`,lrcorner:`⌟`,intercal:`⊺`,intcal:`⊺`,oplus:`⊕`,CirclePlus:`⊕`,ominus:`⊖`,CircleMinus:`⊖`,otimes:`⊗`,CircleTimes:`⊗`,osol:`⊘`,odot:`⊙`,CircleDot:`⊙`,oast:`⊛`,circledast:`⊛`,odash:`⊝`,circleddash:`⊝`,ocirc:`⊚`,circledcirc:`⊚`,boxplus:`⊞`,plusb:`⊞`,boxminus:`⊟`,minusb:`⊟`,boxtimes:`⊠`,timesb:`⊠`,boxdot:`⊡`,sdotb:`⊡`,veebar:`⊻`,vee:`∨`,barvee:`⊽`,and:`∧`,wedge:`∧`,Cap:`⋒`,Cup:`⋓`,Fork:`⋔`,pitchfork:`⋔`,epar:`⋕`,ltlarr:`⥶`,nvap:`≍⃒`,nvsim:`∼⃒`,nvge:`≥⃒`,nvle:`≤⃒`,nvlt:`<⃒`,nvgt:`>⃒`,nvltrie:`⊴⃒`,nvrtrie:`⊵⃒`,Vdash:`⊩`,dashv:`⊣`,vDash:`⊨`,Vdash:`⊩`,Vvdash:`⊪`,nvdash:`⊬`,nvDash:`⊭`,nVdash:`⊮`,nVDash:`⊯`},{...ka,...Aa,...ja,...Ma,...Na,...Pa,...Fa,...Ia,...La,...Ra,...za,...Ba,...Va},Ha={amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`},Ua={nbsp:`\xA0`,copy:`©`,reg:`®`,trade:`™`,mdash:`—`,ndash:`–`,hellip:`…`,laquo:`«`,raquo:`»`,lsquo:`‘`,rsquo:`’`,ldquo:`“`,rdquo:`”`,bull:`•`,para:`¶`,sect:`§`,deg:`°`,frac12:`½`,frac14:`¼`,frac34:`¾`}}));function Ga(e){if(e[0]===`#`)throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);for(let t of e)if(Ya.has(t))throw Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);return e}function Ka(...e){let t=Object.create(null);for(let n of e)if(n)for(let e of Object.keys(n)){let r=n[e];if(typeof r==`string`)t[e]=r;else if(r&&typeof r==`object`&&r.val!==void 0){let n=r.val;typeof n==`string`&&(t[e]=n)}}return t}function qa(e){return!e||e===U?new Set([U]):e===G?new Set([G]):e===W?new Set([W]):Array.isArray(e)?new Set(e):new Set([U])}function Ja(e){if(!e)return{xmlVersion:1,onLevel:K.allow,nullLevel:K.remove};let t=e.xmlVersion===1.1?1.1:1,n=K[e.onNCR]??K.allow,r=K[e.nullNCR]??K.remove;return{xmlVersion:t,onLevel:n,nullLevel:Math.max(r,K.remove)}}var Ya,U,W,G,K,Xa,Za,Qa=e((()=>{Wa(),Ya=new Set(`!?\\\\/[]$%{}^&*()<>|+`),U=`external`,W=`base`,G=`all`,K=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Xa=new Set([9,10,13]),Za=class{constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck==`function`?e.postCheck:e=>e,this._limitTiers=qa(this._limit.applyLimitsTo??U),this._numericAllowed=e.numericAllowed??!0,this._baseMap=Ka(Ha,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let t=Ja(e.ncr);this._ncrXmlVersion=t.xmlVersion,this._ncrOnLevel=t.onLevel,this._ncrNullLevel=t.nullLevel}setExternalEntities(e){if(e)for(let t of Object.keys(e))Ga(t);this._externalMap=Ka(e)}addExternalEntity(e,t){Ga(e),typeof t==`string`&&t.indexOf(`&`)===-1&&(this._externalMap[e]=t)}addInputEntities(e){this._totalExpansions=0,this._expandedLength=0,this._inputMap=Ka(e)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!=`string`||e.length===0)return e;let t=e,n=[],r=e.length,i=0,a=0,o=this._maxTotalExpansions>0,s=this._maxExpandedLength>0,c=o||s;for(;a<r;){if(e.charCodeAt(a)!==38){a++;continue}let t=a+1;for(;t<r&&e.charCodeAt(t)!==59&&t-a<=32;)t++;if(t>=r||e.charCodeAt(t)!==59){a++;continue}let l=e.slice(a+1,t);if(l.length===0){a++;continue}let u,d;if(this._removeSet.has(l))u=``,d===void 0&&(d=U);else if(this._leaveSet.has(l)){a++;continue}else if(l.charCodeAt(0)===35){let e=this._resolveNCR(l);if(e===void 0){a++;continue}u=e,d=W}else{let e=this._resolveName(l);u=e?.value,d=e?.tier}if(u===void 0){a++;continue}if(a>i&&n.push(e.slice(i,a)),n.push(u),i=t+1,a=i,c&&this._tierCounts(d)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(s){let e=u.length-(l.length+2);if(e>0&&(this._expandedLength+=e,this._expandedLength>this._maxExpandedLength))throw Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}i<r&&n.push(e.slice(i));let l=n.length===0?e:n.join(``);return this._postCheck(l,t)}_tierCounts(e){return this._limitTiers.has(G)?!0:this._limitTiers.has(e)}_resolveName(e){if(e in this._inputMap)return{value:this._inputMap[e],tier:U};if(e in this._externalMap)return{value:this._externalMap[e],tier:U};if(e in this._baseMap)return{value:this._baseMap[e],tier:W}}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!Xa.has(e)?K.remove:-1}_applyNCRAction(e,t,n){switch(e){case K.allow:return String.fromCodePoint(n);case K.remove:return``;case K.leave:return;case K.throw:throw Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${n.toString(16).toUpperCase().padStart(4,`0`)})`);default:return String.fromCodePoint(n)}}_resolveNCR(e){let t=e.charCodeAt(1),n;if(n=t===120||t===88?parseInt(e.slice(2),16):parseInt(e.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;let r=this._classifyNCR(n);if(!this._numericAllowed&&r<K.remove)return;let i=r===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,r);return this._applyNCRAction(i,e,n)}}})),$a=e((()=>{Qa(),Wa()}));function eo(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(R.some(e=>n===e.toLowerCase())||pa.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function to(e,t){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:`all`}:typeof e==`object`&&e?{enabled:e.enabled!==!1,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??1e3),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null,appliesTo:e.appliesTo??`all`}:to(!0)}var no,ro,io,ao=e((()=>{z(),no=e=>R.includes(e)?`__`+e:e,ro={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:no},io=function(e){let t=Object.assign({},ro,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&eo(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=no),t.processEntities=to(t.processEntities,t.htmlEntities),t.unpairedTagsSet=new Set(t.unpairedTags),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t}})),oo,q,J=e((()=>{oo=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`,q=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][oo]={startIndex:t})}static getMetaDataSymbol(){return oo}}}));function Y(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function X(e){if(L(e))return e;throw Error(`Invalid entity name ${e}`)}var so,Z,co=e((()=>{z(),so=class{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let i=1,a=!1,o=!1,s=``;for(;t<e.length;t++)if(e[t]===`<`&&!o){if(a&&Y(e,`!ENTITY`,t)){t+=7;let i,a;if([i,a,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),a.indexOf(`&`)===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[i]=a,r++}}else if(a&&Y(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&Y(e,`!ATTLIST`,t))t+=8;else if(a&&Y(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else if(Y(e,`!--`,t))o=!0;else throw Error(`Invalid DOCTYPE`);i++,s=``}else if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];if(i!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}readEntityExp(e,t){t=Z(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)t++;let r=e.substring(n,t);if(X(r),t=Z(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`)}let i=``;if([t,i]=this.readIdentifierVal(e,t,`entity`),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&i.length>this.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,i,t]}readNotationExp(e,t){t=Z(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);!this.suppressValidationErr&&X(r),t=Z(e,t);let i=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&i!==`SYSTEM`&&i!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);t+=i.length,t=Z(e,t);let a=null,o=null;if(i===`PUBLIC`)[t,a]=this.readIdentifierVal(e,t,`publicIdentifier`),t=Z(e,t),(e[t]===`"`||e[t]===`'`)&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`));else if(i===`SYSTEM`&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`),!this.suppressValidationErr&&!o))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:r,publicIdentifier:a,systemIdentifier:o,index:--t}}readIdentifierVal(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);t++;let a=t;for(;t<e.length&&e[t]!==i;)t++;if(r=e.substring(a,t),e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}readElementExp(e,t){t=Z(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);if(!this.suppressValidationErr&&!L(r))throw Error(`Invalid element name: "${r}"`);t=Z(e,t);let i=``;if(e[t]===`E`&&Y(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&Y(e,`NY`,t))t+=2;else if(e[t]===`(`){t++;let n=t;for(;t<e.length&&e[t]!==`)`;)t++;if(i=e.substring(n,t),e[t]!==`)`)throw Error(`Unterminated content model`)}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:i.trim(),index:t}}readAttlistExp(e,t){t=Z(e,t);let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);for(X(r),t=Z(e,t),n=t;t<e.length&&!/\s/.test(e[t]);)t++;let i=e.substring(n,t);if(!X(i))throw Error(`Invalid attribute name: "${i}"`);t=Z(e,t);let a=``;if(e.substring(t,t+8).toUpperCase()===`NOTATION`){if(a=`NOTATION`,t+=8,t=Z(e,t),e[t]!==`(`)throw Error(`Expected '(', found "${e[t]}"`);t++;let n=[];for(;t<e.length&&e[t]!==`)`;){let r=t;for(;t<e.length&&e[t]!==`|`&&e[t]!==`)`;)t++;let i=e.substring(r,t);if(i=i.trim(),!X(i))throw Error(`Invalid notation name: "${i}"`);n.push(i),e[t]===`|`&&(t++,t=Z(e,t))}if(e[t]!==`)`)throw Error(`Unterminated list of notations`);t++,a+=` (`+n.join(`|`)+`)`}else{let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;if(a+=e.substring(n,t),!this.suppressValidationErr&&![`CDATA`,`ID`,`IDREF`,`IDREFS`,`ENTITY`,`ENTITIES`,`NMTOKEN`,`NMTOKENS`].includes(a.toUpperCase()))throw Error(`Invalid attribute type: "${a}"`)}t=Z(e,t);let o=``;return e.substring(t,t+8).toUpperCase()===`#REQUIRED`?(o=`#REQUIRED`,t+=8):e.substring(t,t+7).toUpperCase()===`#IMPLIED`?(o=`#IMPLIED`,t+=7):[t,o]=this.readIdentifierVal(e,t,`ATTLIST`),{elementName:r,attributeName:i,attributeType:a,defaultValue:o,index:t}}},Z=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t}}));function lo(e,t={}){if(t=Object.assign({},_o,t),!e||typeof e!=`string`)return e;let n=e.trim();if(n.length===0||t.skipLike!==void 0&&t.skipLike.test(n))return e;if(n===`0`)return 0;if(t.hex&&ho.test(n))return po(n,16);if(!isFinite(n))return mo(e,Number(n),t);if(n.includes(`e`)||n.includes(`E`))return uo(e,n,t);{let r=go.exec(n);if(r){let i=r[1]||``,a=r[2],o=fo(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}function uo(e,t,n){if(!n.eNotation)return e;let r=t.match(vo);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):o.length>0?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}else return e}function fo(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function po(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function mo(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}var ho,go,_o,vo,yo=e((()=>{ho=/^[-+]?0x[a-fA-F0-9]+$/,go=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,_o={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0,infinity:`original`},vo=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/}));function bo(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var xo=e((()=>{})),So,Co=e((()=>{So=class{constructor(e,t={},n){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this.data=n,this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n<e.length;)e[n]===this.separator?n+1<e.length&&e[n+1]===this.separator?(r.trim()&&(t.push(this._parseSegment(r.trim())),r=``),t.push({type:`deep-wildcard`}),n+=2):(r.trim()&&t.push(this._parseSegment(r.trim())),r=``,n++):(r+=e[n],n++);return r.trim()&&t.push(this._parseSegment(r.trim())),t}_parseSegment(e){let t={type:`tag`},n=null,r=e,i=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(r=i[1]+i[3],i[2])){let e=i[2].slice(1,-1);e&&(n=e)}let a,o=r;if(r.includes(`::`)){let t=r.indexOf(`::`);if(a=r.substring(0,t).trim(),o=r.substring(t+2).trim(),!a)throw Error(`Invalid namespace in pattern: ${e}`)}let s,c=null;if(o.includes(`:`)){let e=o.lastIndexOf(`:`),t=o.substring(0,e).trim(),n=o.substring(e+1).trim();[`first`,`last`,`odd`,`even`].includes(n)||/^nth\(\d+\)$/.test(n)?(s=t,c=n):s=o}else s=o;if(!s)throw Error(`Invalid segment pattern: ${e}`);if(t.tag=s,a&&(t.namespace=a),n)if(n.includes(`=`)){let e=n.indexOf(`=`);t.attrName=n.substring(0,e).trim(),t.attrValue=n.substring(e+1).trim()}else t.attrName=n.trim();if(c){let e=c.match(/^nth\((\d+)\)$/);e?(t.position=`nth`,t.positionValue=parseInt(e[1],10)):t.position=c}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}})),wo,To=e((()=>{wo=class{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(e){if(this._sealed)throw TypeError(`ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.`);if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard())return this._deepWildcards.push(e),this;let t=e.length,n=e.segments[e.segments.length-1]?.tag;if(!n||n===`*`)this._wildcardByDepth.has(t)||this._wildcardByDepth.set(t,[]),this._wildcardByDepth.get(t).push(e);else{let r=`${t}:${n}`;this._byDepthAndTag.has(r)||this._byDepthAndTag.set(r,[]),this._byDepthAndTag.get(r).push(e)}return this}addAll(e){for(let t of e)this.add(t);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){let t=e.getDepth(),n=`${t}:${e.getCurrentTag()}`,r=this._byDepthAndTag.get(n);if(r){for(let t=0;t<r.length;t++)if(e.matches(r[t]))return r[t]}let i=this._wildcardByDepth.get(t);if(i){for(let t=0;t<i.length;t++)if(e.matches(i[t]))return i[t]}for(let t=0;t<this._deepWildcards.length;t++)if(e.matches(this._deepWildcards[t]))return this._deepWildcards[t];return null}}})),Eo,Do,Oo=e((()=>{Eo=class{constructor(e){this._matcher=e}get separator(){return this._matcher.separator}getCurrentTag(){let e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let t=this._matcher.path;if(t.length!==0)return t[t.length-1].values?.[e]}hasAttr(e){let t=this._matcher.path;if(t.length===0)return!1;let n=t[t.length-1];return n.values!==void 0&&e in n.values}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,t=!0){return this._matcher.toString(e,t)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},Do=class{constructor(e={}){this.separator=e.separator||`.`,this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new Eo(this)}push(e,t=null,n=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;if(n===this.separator&&t===!0){if(this._pathStringCache!==null)return this._pathStringCache;let e=this.path.map(e=>e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n);return this._pathStringCache=e,e}return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(!this._matchSegment(e[t],this.path[t],t===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,n=e.length-1;for(;n>=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--)if(this._matchSegment(r,this.path[e],e===this.path.length-1)){t=e-1,n--,i=!0;break}if(!i)return!1}else{if(!this._matchSegment(r,this.path[t],t===this.path.length-1))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace||e.attrName!==void 0&&(!n||!t.values||!(e.attrName in t.values)||e.attrValue!==void 0&&String(t.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this._pathStringCache=null,this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return this._view}}})),ko=e((()=>{Co(),Oo(),To()}));function Ao(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)if(e.startsWith(t.attributeNamePrefix)){let i=e.substring(t.attributeNamePrefix.length);r[i]=n[e]}else r[e]=n[e];return r}function jo(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}function Mo(e,t,n,r,i,a,o){let s=this.options;if(e!==void 0&&(s.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=s.jPath?n.toString():n,c=s.tagValueProcessor(t,e,r,i,a);return c==null?e:typeof c!=typeof e||c!==e?c:s.trimValues||e.trim()===e?Uo(e,s.parseTagValue,s.numberParseOptions):e}}function No(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}function Po(e,t,n,r=!1){let i=this.options;if(r===!0||i.ignoreAttributes!==!0&&typeof e==`string`){let r=ca(e,qo),a=r.length,o={},s=Array(a),c=!1,l={};for(let e=0;e<a;e++){let t=this.resolveNameSpace(r[e][1]),a=r[e][4];if(t.length&&a!==void 0){let r=a;i.trimValues&&(r=r.trim()),r=this.replaceEntitiesValue(r,n,this.readonlyMatcher),s[e]=r,l[t]=r,c=!0}}c&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(l);let u=i.jPath?t.toString():this.readonlyMatcher,d=!1;for(let e=0;e<a;e++){let t=this.resolveNameSpace(r[e][1]);if(this.ignoreAttributesFn(t,u))continue;let n=i.attributeNamePrefix+t;if(t.length)if(i.transformAttributeName&&(n=i.transformAttributeName(n)),n=Go(n,i),r[e][4]!==void 0){let r=s[e],a=i.attributeValueProcessor(t,r,u);a==null?o[n]=r:typeof a!=typeof r||a!==r?o[n]=a:o[n]=Uo(r,i.parseAttributeValue,i.numberParseOptions),d=!0}else i.allowBooleanAttributes&&(o[n]=!0,d=!0)}if(!d)return;if(i.attributesGroupName){let e={};return e[i.attributesGroupName]=o,e}return o}}function Fo(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);a===!1||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Io(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}return this.entityDecoder.decode(e)}function Lo(e,t,n,r){return e&&(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),e=``),e}function Ro(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}function zo(e,t,n=`>`){let r=0,i=[],a=e.length,o=n.charCodeAt(0),s=n.length>1?n.charCodeAt(1):-1;for(let n=t;n<a;n++){let t=e.charCodeAt(n);if(r)t===r&&(r=0);else if(t===34||t===39)r=t;else if(t===o)if(s!==-1){if(e.charCodeAt(n+1)===s)return{data:String.fromCharCode(...i),index:n}}else return{data:String.fromCharCode(...i),index:n};else if(t===9){i.push(32);continue}i.push(t)}}function Q(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function Bo(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i}function Vo(e,t,n,r=`>`){let i=zo(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function Ho(e,t,n){let r=n,i=1,a=e.length;for(;n<a;n++)if(e[n]===`<`){let a=e.charCodeAt(n+1);if(a===47){let a=Bo(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(a===63)n=Q(e,`?>`,n+1,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===45&&e.charCodeAt(n+3)===45)n=Q(e,`-->`,n+3,`StopNode is not closed.`);else if(a===33&&e.charCodeAt(n+2)===91)n=Q(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=Vo(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}}function Uo(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:lo(e,n)}else if(la(e))return e;else return``}function Wo(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return t=Go(t,r),{tagName:t,tagExp:n}}function Go(e,t){if(pa.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return R.includes(e)?t.onDangerousProperty(e):e}var Ko,qo,Jo,Yo=e((()=>{z(),J(),co(),yo(),xo(),ko(),$a(),Ko=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Jo,this.parseTextData=Mo,this.resolveNameSpace=No,this.buildAttributesMap=Po,this.isItStopNode=Ro,this.replaceEntitiesValue=Io,this.readStopNodeData=Ho,this.saveTextToParentTag=Lo,this.addChild=Fo,this.ignoreAttributesFn=bo(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0;let t={...Ha};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities==`object`?t=this.options.htmlEntities:this.options.htmlEntities===!0&&(t={...Ua,...za}),this.entityDecoder=new Za({namedEntities:t,numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new Do,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new wo;let n=this.options.stopNodes;if(n&&n.length>0){for(let e=0;e<n.length;e++){let t=n[e];typeof t==`string`?this.stopNodeExpressionsSet.add(new So(t)):t instanceof So&&this.stopNodeExpressionsSet.add(t)}this.stopNodeExpressionsSet.seal()}}},qo=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`),Jo=function(e){e=e.replace(/\r\n?/g,`
4
+ `);let t=new q(`!xml`),n=t,r=``;this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let i=this.options,a=new so(i.processEntities),o=e.length;for(let s=0;s<o;s++)if(e[s]===`<`){let c=e.charCodeAt(s+1);if(c===47){let t=Q(e,`>`,s,`Closing Tag is not closed.`),a=e.substring(s+2,t).trim();if(i.removeNSPrefix){let e=a.indexOf(`:`);e!==-1&&(a=a.substr(e+1))}a=Wo(i.transformTagName,a,``,i).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(a&&i.unpairedTagsSet.has(a))throw Error(`Unpaired tag can not be used as closing tag: </${a}>`);o&&i.unpairedTagsSet.has(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,s=t}else if(c===63){let t=Vo(e,s,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let a=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName,!0);if(a){let e=a[this.options.attributeNamePrefix+`version`];this.entityDecoder.setXmlVersion(Number(e)||1)}if(!(i.ignoreDeclaration&&t.tagName===`?xml`||i.ignorePiTags)){let e=new q(t.tagName);e.add(i.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&i.ignoreAttributes!==!0&&(e[`:@`]=a),this.addChild(n,e,this.readonlyMatcher,s)}s=t.closeIndex+1}else if(c===33&&e.charCodeAt(s+2)===45&&e.charCodeAt(s+3)===45){let t=Q(e,`-->`,s+4,`Comment is not closed.`);if(i.commentPropName){let a=e.substring(s+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(i.commentPropName,[{[i.textNodeName]:a}])}s=t}else if(c===33&&e.charCodeAt(s+2)===68){let t=a.readDocType(e,s);this.entityDecoder.addInputEntities(t.entities),s=t.i}else if(c===33&&e.charCodeAt(s+2)===91){let t=Q(e,`]]>`,s,`CDATA is not closed.`)-2,a=e.substring(s+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(a,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??(o=``),i.cdataPropName?n.add(i.cdataPropName,[{[i.textNodeName]:a}]):n.add(i.textNodeName,o),s=t+2}else{let a=Vo(e,s,i.removeNSPrefix);if(!a){let t=e.substring(Math.max(0,s-50),Math.min(o,s+50));throw Error(`readTagExp returned undefined at position ${s}. Context: "${t}"`)}let c=a.tagName,l=a.rawTagName,u=a.tagExp,d=a.attrExpPresent,f=a.closeIndex;if({tagName:c,tagExp:u}=Wo(i.transformTagName,c,u,i),i.strictReservedNames&&(c===i.commentPropName||c===i.cdataPropName||c===i.textNodeName||c===i.attributesGroupName))throw Error(`Invalid tag name: ${c}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let p=n;p&&i.unpairedTagsSet.has(p.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let m=!1;u.length>0&&u.lastIndexOf(`/`)===u.length-1&&(m=!0,c[c.length-1]===`/`?(c=c.substr(0,c.length-1),u=c):u=u.substr(0,u.length-1),d=c!==u);let h=null,ee;ee=jo(l),c!==t.tagname&&this.matcher.push(c,{},ee),c!==u&&d&&(h=this.buildAttributesMap(u,this.matcher,c),h&&Ao(h,i)),c!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let g=s;if(this.isCurrentNodeStopNode){let t=``;if(m)s=a.closeIndex;else if(i.unpairedTagsSet.has(c))s=a.closeIndex;else{let n=this.readStopNodeData(e,l,f+1);if(!n)throw Error(`Unexpected end of ${l}`);s=n.i,t=n.tagContent}let r=new q(c);h&&(r[`:@`]=h),r.add(i.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,g)}else{if(m){({tagName:c,tagExp:u}=Wo(i.transformTagName,c,u,i));let e=new q(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,g),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(i.unpairedTagsSet.has(c)){let e=new q(c);h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,g),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=a.closeIndex;continue}else{let e=new q(c);if(this.tagsNodeStack.length>i.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),h&&(e[`:@`]=h),this.addChild(n,e,this.readonlyMatcher,g),n=e}r=``,s=f}}}else r+=e[s];return t.child}}));function Xo(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)if(r.startsWith(t)){let i=r.substring(t.length);n[i]=e[r]}else n[r]=e[r];return n}function Zo(e,t,n,r){return Qo(e,t,n,r)}function Qo(e,t,n,r){let i,a={};for(let o=0;o<e.length;o++){let s=e[o],c=$o(s);if(c!==void 0&&c!==t.textNodeName){let e=Xo(s[`:@`]||{},t.attributeNamePrefix);n.push(c,e)}if(c===t.textNodeName)i===void 0?i=s[c]:i+=``+s[c];else if(c===void 0)continue;else if(s[c]){let e=Qo(s[c],t,n,r),i=ts(e,t);if(s[`:@`]?es(e,s[`:@`],r,t):Object.keys(e).length===1&&e[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?e=e[t.textNodeName]:Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``),s[$]!==void 0&&typeof e==`object`&&e&&(e[$]=s[$]),a[c]!==void 0&&Object.prototype.hasOwnProperty.call(a,c))Array.isArray(a[c])||(a[c]=[a[c]]),a[c].push(e);else{let n=t.jPath?r.toString():r;t.isArray(c,n,i)?a[c]=[e]:a[c]=e}c!==void 0&&c!==t.textNodeName&&n.pop()}}return typeof i==`string`?i.length>0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function $o(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function es(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o],s=a.startsWith(r.attributeNamePrefix)?a.substring(r.attributeNamePrefix.length):a,c=r.jPath?n.toString()+`.`+s:n;r.isArray(a,c,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function ts(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]==`boolean`||e[n]===0))}var $,ns=e((()=>{J(),$=q.getMetaDataSymbol()})),rs,is=e((()=>{ao(),Yo(),ns(),Oa(),J(),rs=class{constructor(e){this.externalEntities={},this.options=io(e)}parse(e,t){if(typeof e!=`string`&&e.toString)e=e.toString();else if(typeof e!=`string`)throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){t===!0&&(t={});let n=ma(e,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Ko(this.options);n.entityDecoder.setExternalEntities(this.externalEntities);let r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:Zo(r,this.options,n.matcher,n.readonlyMatcher)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return q.getMetaDataSymbol()}}})),as=e((()=>{is()}));function os(e){return ss.parse(e,!0)}var ss,cs=e((()=>{as(),ss=new rs({attributeNamePrefix:``,processEntities:{enabled:!0,maxTotalExpansions:1/0},htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>t.trim()===``&&t.includes(`
5
+ `)?``:void 0,maxNestedTags:1/0})})),ls=e((()=>{sa(),oa(),cs()})),us,ds=e((()=>{ls(),b(),x(),w(),g(),F(),Ii(),t(),us=class extends P{constructor(e){super(),n(this,`settings`,void 0),n(this,`stringDeserializer`,void 0),this.settings=e,this.stringDeserializer=new ue(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,n){let r=_.of(e),i=r.getMemberSchemas();if(r.isStructSchema()&&r.isMemberSchema()&&Object.values(i).find(e=>!!e.getMemberTraits().eventPayload)){let e={},n=Object.keys(i)[0];return i[n].isBlobSchema()?e[n]=t:e[n]=this.read(i[n],t),e}let a=(this.serdeContext?.utf8Encoder??p)(t),o=this.parseXml(a);return this.readSchema(e,n?o[n]:o)}readSchema(e,t){let n=_.of(e);if(n.isUnitSchema())return;let r=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(t))return this.readSchema(n,[t]);if(t==null)return t;if(typeof t==`object`){let e=!!r.xmlFlattened;if(n.isListSchema()){let r=n.getValueSchema(),i=[],a=r.getMergedTraits().xmlName??`member`,o=e?t:(t[0]??t)[a];if(o==null)return i;let s=Array.isArray(o)?o:[o];for(let e of s)i.push(this.readSchema(r,e));return i}let i={};if(n.isMapSchema()){let r=n.getKeySchema(),a=n.getValueSchema(),o;o=e?Array.isArray(t)?t:[t]:Array.isArray(t.entry)?t.entry:[t.entry];let s=r.getMergedTraits().xmlName??`key`,c=a.getMergedTraits().xmlName??`value`;for(let e of o){let t=e[s],n=e[c];i[t]=this.readSchema(a,n)}return i}if(n.isStructSchema()){let e=n.isUnionSchema(),r;e&&(r=new Fi(t,i));for(let[a,o]of n.structIterator()){let n=o.getMergedTraits(),s=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??a;e&&r.mark(s),t[s]!=null&&(i[a]=this.readSchema(o,t[s]))}return e&&r.writeUnknown(),i}if(n.isDocumentSchema())return t;throw Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,t)}parseXml(e){if(e.length){let t;try{t=os(e)}catch(t){throw t&&typeof t==`object`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}let n=`#text`,r=Object.keys(t)[0],i=t[r];return i[n]&&(i[r]=i[n],delete i[n]),Ze(i)}return{}}}})),fs,ps=e((()=>{b(),x(),v(),w(),ne(),F(),t(),fs=class extends P{constructor(e){super(),n(this,`settings`,void 0),n(this,`buffer`,void 0),this.settings=e}write(e,t,n=``){this.buffer===void 0&&(this.buffer=``);let r=_.of(e);if(n&&!n.endsWith(`.`)&&(n+=`.`),r.isBlobSchema())(typeof t==`string`||t instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??re)(t)));else if(r.isBooleanSchema()||r.isNumericSchema()||r.isStringSchema())t==null?r.isIdempotencyToken()&&(this.writeKey(n),this.writeValue(ce())):(this.writeKey(n),this.writeValue(String(t)));else if(r.isBigIntegerSchema())t!=null&&(this.writeKey(n),this.writeValue(String(t)));else if(r.isBigDecimalSchema())t!=null&&(this.writeKey(n),this.writeValue(t instanceof y?t.string:String(t)));else if(r.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(n),oe(r,this.settings)){case 5:this.writeValue(t.toISOString().replace(`.000Z`,`Z`));break;case 6:this.writeValue(me(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(r.isDocumentSchema())Array.isArray(t)?this.write(79,t,n):t instanceof Date?this.write(4,t,n):t instanceof Uint8Array?this.write(21,t,n):t&&typeof t==`object`?this.write(143,t,n):(this.writeKey(n),this.writeValue(String(t)));else if(r.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(``));else{let e=r.getValueSchema(),i=this.settings.flattenLists||r.getMergedTraits().xmlFlattened,a=1;for(let r of t){if(r==null)continue;let t=e.getMergedTraits(),o=this.getKey(`member`,t.xmlName,t.ec2QueryName),s=i?`${n}${a}`:`${n}${o}.${a}`;this.write(e,r,s),++a}}}else if(r.isMapSchema()){if(t&&typeof t==`object`){let e=r.getKeySchema(),i=r.getValueSchema(),a=r.getMergedTraits().xmlFlattened,o=1;for(let r in t){let s=t[r];if(s==null)continue;let c=e.getMergedTraits(),l=this.getKey(`key`,c.xmlName,c.ec2QueryName),u=a?`${n}${o}.${l}`:`${n}entry.${o}.${l}`,d=i.getMergedTraits(),f=this.getKey(`value`,d.xmlName,d.ec2QueryName),p=a?`${n}${o}.${f}`:`${n}entry.${o}.${f}`;this.write(e,r,u),this.write(i,s,p),++o}}}else if(r.isStructSchema()){if(t&&typeof t==`object`){let e=!1;for(let[i,a]of r.structIterator()){if(t[i]==null&&!a.isIdempotencyToken())continue;let r=a.getMergedTraits(),o=this.getKey(i,r.xmlName,r.ec2QueryName,`struct`),s=`${n}${o}`;this.write(a,t[i],s),e=!0}if(!e&&r.isUnionSchema()){let{$unknown:e}=t;if(Array.isArray(e)){let[t,r]=e,i=`${n}${t}`;this.write(15,r,i)}}}}else if(!r.isUnitSchema())throw Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${r.getName(!0)}`)}flush(){if(this.buffer===void 0)throw Error(`@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.`);let e=this.buffer;return delete this.buffer,e}getKey(e,t,n,r){let{ec2:i,capitalizeKeys:a}=this.settings;if(i&&n)return n;let o=t??e;return a&&r===`struct`?o[0].toUpperCase()+o.slice(1):o}writeKey(e){e.endsWith(`.`)&&(e=e.slice(0,e.length-1)),this.buffer+=`&${te(e)}=`}writeValue(e){this.buffer+=te(e)}}})),ms,hs=e((()=>{b(),x(),Mi(),ds(),ps(),t(),ms=class extends pe{constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),n(this,`options`,void 0),n(this,`serializer`,void 0),n(this,`deserializer`,void 0),n(this,`mixin`,new ji),this.options=e;let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new fs(t),this.deserializer=new us(t)}getShapeId(){return`aws.protocols#awsQuery`}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw Error(`AWSQuery protocol has no payload codec.`)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);return r.path.endsWith(`/`)||(r.path+=`/`),r.headers[`content-type`]=`application/x-www-form-urlencoded`,(ie(e.input)===`unit`||!r.body)&&(r.body=``),r.body=`Action=${e.name.split(`#`)[1]??e.name}&Version=${this.options.version}`+r.body,r.body.endsWith(`&`)&&(r.body=r.body.slice(-1)),r}async deserializeResponse(e,t,n){let r=this.deserializer,i=_.of(e.output),a={};if(n.statusCode>=300){let i=await ve(n.body,t);i.byteLength>0&&Object.assign(a,await r.read(15,i)),await this.handleError(e,t,n,a,this.deserializeMetadata(n))}for(let e in n.headers){let t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}let o=e.name.split(`#`)[1]??e.name,s=i.isStructSchema()&&this.useNestedResult()?o+`Result`:void 0,c=await ve(n.body,t);return c.byteLength>0&&Object.assign(a,await r.read(i,c,s)),a.$metadata=this.deserializeMetadata(n),a}useNestedResult(){return!0}async handleError(e,t,n,r,i){let a=this.loadQueryErrorCode(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let o=this.loadQueryError(r)??{},s=this.loadQueryErrorMessage(r);o.message=s,o.Error={Type:o.Type,Code:o.Code,Message:s};let{errorSchema:c,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,o,i,this.mixin.findQueryCompatibleError),u=_.of(c),d=new((this.compositeErrorRegistry.getErrorCtor(c))??Error)(s),f={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(let[e,t]of u.structIterator()){let n=t.getMergedTraits().xmlName??e,i=o[n]??r[n];f[e]=this.deserializer.readSchema(t,i)}throw this.mixin.decorateServiceException(Object.assign(d,l,{$fault:u.getMergedTraits().error,message:s},f),r)}loadQueryErrorCode(e,t){let n=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(n!==void 0)return n;if(e.statusCode==404)return`NotFound`}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??`Unknown`}getDefaultContentType(){return`application/x-www-form-urlencoded`}}})),gs=e((()=>{})),_s=e((()=>{})),vs=e((()=>{})),ys=e((()=>{})),bs=e((()=>{})),xs=e((()=>{})),Ss=e((()=>{Ni(),Pi(),ta(),na(),ea(),ia(),$i(),Ki(),Zi(),aa(),Wi(),gs(),hs(),_s(),ps(),xs(),bs(),ds(),ys(),vs()})),Cs,ws,Ts=e((()=>{Cs=e=>({setRegion(t){e.region=t},region(){return e.region}}),ws=e=>({region:e.region()})})),Es=e((()=>{}));function Ds(e={}){return C({...Te,async default(){return Os.silence||console.warn(`@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.`),`us-east-1`}},{...ke,...e})}var Os,ks=e((()=>{je(),qe(),Os={silence:!1}})),As=e((()=>{Ts(),Es(),ks()}));export{fn as A,dr as C,Nn as D,Mn as E,St as F,bt as I,gt as L,Lt as M,Ft as N,On as O,Nt as P,_t as R,hr as S,A as T,Vr as _,Ss as a,Er as b,Ai as c,gi as d,mi as f,oi as g,ui as h,ws as i,en as j,En as k,Ei as l,fi as m,Ds as n,ms as o,hi as p,Cs as r,ra as s,As as t,vi as u,zr as v,lr as w,Cr as x,Sr as y,pt as z};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./dist-es-C5VplyPL2.js";t();export{e as fromHttp};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import*as t from"path";import{fileURLToPath as n}from"url";var r,i,a,o=e((()=>{r=n(import.meta.url),i=t.dirname(r),a=(()=>{let e=i.split(t.sep),n=e.lastIndexOf(`dist`);if(n!==-1)return e.slice(0,n+1).join(t.sep);let r=e.lastIndexOf(`src`);return r===-1?i:e.slice(0,r).join(t.sep)})()}));export{o as n,a as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-BTgGEFjL.js";import{n,t as r}from"./Doctor-B73iDB-d.js";var i,a;e((()=>{n(),i=t(),a=(e,t,n)=>Promise.resolve((0,i.jsx)(r,{onDone:e}))}))();export{a as call};
@@ -0,0 +1,2 @@
1
+ import{c as e,s as t}from"./intl-Pse97ORk.js";t();var n=``,r=!1,i=null,a=null;function o(){if(!(!process.stdin.isTTY||r||process.argv.includes(`-p`)||process.argv.includes(`--print`))){r=!0,n=``;try{process.stdin.setEncoding(`utf8`),process.stdin.setRawMode(!0),process.stdin.ref(),i=()=>{let e=process.stdin.read();for(;e!==null;)typeof e==`string`&&s(e),e=process.stdin.read()},process.stdin.on(`readable`,i),a=setTimeout(()=>{r&&c()},1e4),a&&typeof a==`object`&&`unref`in a&&a.unref()}catch{r=!1}}}function s(t){let r=0;for(;r<t.length;){let i=t[r],a=i.charCodeAt(0);if(a===3){c(),process.exit(130);return}if(a===4){c();return}if(a===127||a===8){if(n.length>0){let t=e(n);n=n.slice(0,-(t.length||1))}r++;continue}if(a===27){if(r++,r>=t.length)continue;let e=t.charCodeAt(r);if(e===91){for(r++;r<t.length&&t.charCodeAt(r)>=32&&t.charCodeAt(r)<=63;)r++;r<t.length&&t.charCodeAt(r)>=64&&t.charCodeAt(r)<=126&&r++;continue}if(e===80||e===93||e===88||e===94){for(r++;r<t.length;){if(t.charCodeAt(r)===7){r++;break}if(t.charCodeAt(r)===27&&r+1<t.length&&t.charCodeAt(r+1)===92){r+=2;break}r++}continue}r<t.length&&r++;continue}if(a<32&&a!==9&&a!==10&&a!==13){r++;continue}if(a===13){n+=`
2
+ `,r++;continue}n+=i,r++}}function c(){if(r){r=!1,a&&(clearTimeout(a),a=null),i&&(process.stdin.removeListener(`readable`,i),i=null);try{process.stdin.unref()}catch{}}}function l(){c();let e=n.trim();return n=``,e}function u(e){n=e}export{c as i,u as n,o as r,l as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./earlyInput-BTI1CSNt.js";export{e as startCapturingEarlyInput};
@@ -0,0 +1,9 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{B as n,F as r,Rn as i,Vt as a,b as o,nt as s,t as c,x as l}from"./src-DNHWYkls.js";import{t as u}from"./jsx-runtime-BTgGEFjL.js";import{Gs as d,Js as f}from"./growthbook-p4aJ_UMv.js";import{n as p,r as m}from"./analytics-i6X1et4O.js";import{BE as h,Bw as g,Fw as _,HE as v,Lw as y,Pw as b,Vw as x,qw as S,zE as C}from"./loadAgentsDir-Bz0FfcVt.js";import{t as w}from"./useKeybinding-DAQL_dB_.js";import{n as T,t as E}from"./useMainLoopModel-QC_H3esG.js";function D(e){return typeof e==`string`&&e!==`ultracode`&&A.includes(e)}function O(e){if(e!=null&&typeof e!=`number`&&D(e))return e}function ee(e){let t=A.indexOf(e);return t<=0?A[0]:A[t-1]}function te(e){let t=A.indexOf(e);return t===-1||t>=A.length-1?A[A.length-1]:A[t+1]}function k(e){return e===`ultracode`}function ne(e){let t=O(e.envOverride);return t===void 0?e.displayed:t}function re(e,t){if(k(e))return{kind:`ultracode-hint`,message:j};let n=t(e);return{kind:`apply`,message:n.message,effortUpdate:n.effortUpdate}}var A,j,M,ie=e((()=>{A=[`low`,`medium`,`high`,`xhigh`,`max`,`ultracode`],j=`ultracode is not an effort level. Use /ultracode <context> to start a multi-agent workflow.`,M=`Effort unchanged.`}));function ae(e){let[t,r]=n(e?N:null);return[t,e?r:0]}var N,oe=e((()=>{c(),N=60}));function se(e){if(!/^#[0-9a-fA-F]{6}$/.test(e))return{h:0,s:0,l:0};let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return{h:0,s:0,l:o};let c=s/(1-Math.abs(2*o-1)),l;return l=i===t?60*((n-r)/s%6):i===n?60*((r-t)/s+2):60*((t-n)/s+4),l<0&&(l+=360),{h:l,s:c,l:o}}function ce(e,t,n){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=r/60,o=i*(1-Math.abs(a%2-1)),s=0,c=0,l=0;a<1?(s=i,c=o):a<2?(s=o,c=i):a<3?(c=i,l=o):a<4?(c=o,l=i):a<5?(s=o,l=i):(s=i,l=o);let u=n-i/2,d=e=>Math.round((e+u)*255).toString(16).padStart(2,`0`);return`#${d(s)}${d(c)}${d(l)}`}function P(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e)||t===0)return e;let{h:n,s:r,l:i}=se(e);return ce(n+t,r,i)}function F(e){return e*L%360}function le(e,t=0){let n=e<0?0:e>1?1:e,r=I[Math.min(I.length-1,Math.floor(n*I.length))];return t===0?r:P(r,t)}function ue(e){let{y:t,width:n,time:r,sourceX:i,sourceY:a}=e;if(n<=0)return[];let o=F(r),s=Array(n);for(let e=0;e<n;e++){let n=e-i,c=(t-a)*1.5,l=Math.sqrt(n*n+c*c),u=l*.35-r*.004;s[e]={char:z,color:le((Math.sin(u)+1)/2*Math.max(0,1-l/90),o)}}return s}function de(e,t){let n=e.map(e=>({...e}));for(let e of t){let t=e.x;if(!(t>=n.length))for(let r=0;r<e.text.length;r++){let i=t+r;if(!(i<0)){if(i>=n.length)break;n[i]={char:e.text[r],color:e.color??n[i].color}}}}return n}function fe(e){if(e.length===0)return[];let t=[],n={text:e[0].char,color:e[0].color};for(let r=1;r<e.length;r++){let i=e[r];i.color===n.color?n.text+=i.char:(t.push(n),n={text:i.char,color:i.color})}return t.push(n),t}function pe(e,t){if(e===`transparent`)return R;let n=t<0?0:t>1?1:t;if(n<=.01)return R;if(!/^#[0-9a-fA-F]{6}$/.test(e))return e;let r=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return`#${Math.round(r*n).toString(16).padStart(2,`0`)}${Math.round(i*n).toString(16).padStart(2,`0`)}${Math.round(a*n).toString(16).padStart(2,`0`)}`}function me(e,t){return e.map(e=>({char:e.char,color:pe(e.color,t)}))}var I,L,R,z,he=e((()=>{I=[`#1a1f3a`,`#1f2543`,`#252c55`,`#2e3870`,`#3a4582`,`#4a5bb0`,`#5769F7`],L=.03,R=`transparent`,z=` `}));function ge(e){let t=e-2;return t<=W*A.length?W:Math.floor(t/A.length)}function _e(e){let t=Math.max(0,Math.floor((e-9)/2));return e*(A.length-1)+t+4}function B(e,t,n){return n*e+Math.max(0,Math.floor((n-t)/2))}function ve({appStateEffort:e,onDone:t}){let n=v(),i=T(),{columns:a}=r(),c=H.useMemo(()=>ge(a),[a]),u=c*A.length,d=H.useMemo(()=>_e(c),[c]),f=_(),p=ne({envOverride:f,appStateEffort:e,displayed:b(i,e)}),[m,h]=H.useState(p),[g,y]=H.useState(!1),x=m===`ultracode`,[S,C]=H.useState(0),w=x||S>.001,[E,D]=ae(w);H.useEffect(()=>{if(!w)return;let e=+!!x;C(t=>{if(t===e)return t;let n=e>t?t+Y:t-Y;return e>t?Math.min(e,n):Math.max(e,n)})},[D,x,w]),s({"effortPanel:decrease":()=>h(e=>ee(e)),"effortPanel:increase":()=>h(e=>te(e)),"effortPanel:home":()=>h(`low`),"effortPanel:end":()=>h(`ultracode`),"effortPanel:confirm":H.useCallback(()=>{if(g)return;y(!0);let e=re(m,Q);e.kind===`apply`&&e.effortUpdate&&n(t=>({...t,effortValue:e.effortUpdate.value})),t(e.message)},[m,g,t,n]),"effortPanel:cancel":H.useCallback(()=>{g||(y(!0),t(M))},[g,t])},{context:`EffortPanel`});let O=f!=null,k=process.env.CLAUDE_CODE_EFFORT_LEVEL,j=H.useCallback((e,t)=>fe(me(de(ue({y:e+X,width:u,time:D,sourceX:d,sourceY:X}),t),S)),[D,S,u,d]);return(0,U.jsxs)(l,{ref:E,flexDirection:`column`,paddingX:1,width:u+2,children:[(0,U.jsx)(o,{bold:!0,color:`suggestion`,children:`Effort`}),O&&(0,U.jsx)(o,{color:`warning`,children:`⚠ CLAUDE_CODE_EFFORT_LEVEL=${k} overrides this session`}),w?(0,U.jsx)(be,{renderRow:j,cursor:m,fade:S,segment:c,panelWidth:u,time:D}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ye,{cursor:m,segment:c,panelWidth:u}),(0,U.jsx)(l,{marginTop:1,children:(0,U.jsx)(o,{color:`subtle`,children:`←/→ adjust · Enter confirm · Esc cancel`})})]})]})}function ye({cursor:e,segment:t,panelWidth:n}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(l,{marginTop:1,flexDirection:`row`,justifyContent:`space-between`,children:[(0,U.jsx)(o,{color:`suggestion`,children:`Faster`}),(0,U.jsx)(o,{color:`suggestion`,children:`Smarter`})]}),(0,U.jsx)(o,{color:`subtle`,children:`─`.repeat(n)}),(0,U.jsx)(l,{flexDirection:`row`,children:A.map(n=>(0,U.jsx)(l,{width:t,justifyContent:`center`,children:(0,U.jsx)(o,{bold:!0,color:e===n?`suggestion`:`subtle`,children:e===n?`▲`:` `})},`cursor-${n}`))}),(0,U.jsx)(l,{flexDirection:`row`,children:A.map(n=>(0,U.jsx)(l,{width:t,justifyContent:`center`,children:(0,U.jsx)(o,{bold:e===n,color:e===n?`suggestion`:`subtle`,children:n})},`label-${n}`))}),(0,U.jsxs)(l,{flexDirection:`row`,children:[(0,U.jsx)(l,{width:t*(A.length-1)}),(0,U.jsx)(l,{width:t,justifyContent:`center`,children:(0,U.jsx)(o,{color:`subtle`,children:G})})]})]})}function be({renderRow:e,cursor:t,segment:n,panelWidth:r,time:i}){let a=A.indexOf(t),s=A.length-1,c=F(i),l=P(J,c),u=P(K,c),d=P(q,c),f={text:`Faster`,x:0,color:l},p={text:`Smarter`,x:r-7,color:l},m={text:`─`.repeat(r),x:0,color:d},h={text:`▲`,x:B(a,1,n),color:l},g=A.map((e,r)=>({text:e,x:B(r,e.length,n),color:e===t?u:d})),_={text:G,x:B(s,17,n),color:d};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(V,{segments:e(-4,[])}),(0,U.jsx)(V,{segments:e(-3,[f,p])}),(0,U.jsx)(V,{segments:e(-2,[m])}),(0,U.jsx)(V,{segments:e(-1,[h])}),(0,U.jsx)(V,{segments:e(0,g)}),(0,U.jsx)(V,{segments:e(1,[_])}),(0,U.jsx)(V,{segments:e(2,[])}),(0,U.jsx)(o,{color:q,children:`←/→ adjust · Enter confirm · Esc cancel`})]})}function V({segments:e}){let t=[];for(let n of e){let e=``,r=null,i=()=>{e===``||r===null||(t.push({text:e,kind:r?`space`:`text`,color:n.color}),e=``,r=null)};for(let t of n.text){let n=t===` `;r===null?(e=t,r=n):n===r?e+=t:(i(),e=t,r=n)}i()}return(0,U.jsx)(l,{flexDirection:`row`,children:t.map((e,t)=>e.kind===`space`?e.color===`transparent`?(0,U.jsx)(a,{children:e.text},t):(0,U.jsx)(a,{backgroundColor:e.color,children:e.text},t):(0,U.jsx)(o,{color:e.color,bold:!0,children:e.text},t))})}var H,U,W,G,K,q,J,Y,X,xe=e((()=>{H=t(i(),1),c(),w(),g(),ie(),Ae(),E(),C(),oe(),he(),U=u(),W=12,G=`xhigh + workflows`,K=`#5769F7`,q=`#7a8eff`,J=`#5769F7`,Y=.2,X=0}));function Se(e){let t=S(e);if(t!==void 0){let e=f(`userSettings`,{effortLevel:t});if(e.error)return{message:`Failed to set effort level: ${e.error.message}`}}m(`tengu_effort_command`,{effort:e});let n=_();if(n!==void 0&&n!==e){let n=process.env.CLAUDE_CODE_EFFORT_LEVEL;return t===void 0?{message:`Not applied: CLAUDE_CODE_EFFORT_LEVEL=${n} overrides effort this session, and ${e} is session-only (nothing saved)`,effortUpdate:{value:e}}:{message:`CLAUDE_CODE_EFFORT_LEVEL=${n} overrides this session — clear it and ${e} takes over`,effortUpdate:{value:e}}}let r=y(e);return{message:`Set effort level to ${e}${t===void 0?` (this session only)`:``}: ${r}`,effortUpdate:{value:e}}}function Z(e,t){let n=_(),r=n===null?void 0:n??e;return r===void 0?{message:`Effort level: auto (currently ${b(t,e)})`}:{message:`Current effort level: ${r} (${y(r)})`}}function Ce(){let e=f(`userSettings`,{effortLevel:void 0});return e.error?{message:`Failed to set effort level: ${e.error.message}`}:(m(`tengu_effort_command`,{effort:`auto`}),_()==null?{message:`Effort level set to auto`,effortUpdate:{value:void 0}}:{message:`Cleared effort from settings, but CLAUDE_CODE_EFFORT_LEVEL=${process.env.CLAUDE_CODE_EFFORT_LEVEL} still controls this session`,effortUpdate:{value:void 0}})}function Q(e){let t=e.toLowerCase();return t===`auto`||t===`unset`?Ce():x(t)?Se(t):{message:`Invalid argument: ${e}. Valid options are: low, medium, high, max, auto`}}function we({onDone:e}){let{message:t}=Z(h(e=>e.effortValue),T());return e(t),null}function Te({result:e,onDone:t}){let n=v(),{effortUpdate:r,message:i}=e;return Oe.useEffect(()=>{r&&n(e=>({...e,effortValue:r.value})),t(i)},[n,r,i,t]),null}async function Ee(e,t,n){if(n=n?.trim()||``,ke.includes(n)){e(`Usage: /effort [low|medium|high|xhigh|max|auto]
2
+
3
+ Effort levels:
4
+ - low: Quick, straightforward implementation
5
+ - medium: Balanced approach with standard testing
6
+ - high: Comprehensive implementation with extensive testing
7
+ - xhigh: Extended reasoning beyond high, short of max; including ChatGPT Codex models
8
+ - max: Maximum capability with deepest reasoning
9
+ - auto: Use the default effort level for your model`);return}return!n||n===`current`||n===`status`?n===`current`||n===`status`?(0,$.jsx)(we,{onDone:e}):(0,$.jsx)(De,{onDone:e}):(0,$.jsx)(Te,{result:Q(n),onDone:e})}function De({onDone:e}){return(0,$.jsx)(ve,{appStateEffort:h(e=>e.effortValue),onDone:e})}var Oe,$,ke,Ae=e((()=>{Oe=t(i(),1),xe(),E(),p(),C(),g(),d(),$=u(),ke=[`help`,`-h`,`--help`]}));Ae();export{Ee as call,Q as executeEffort,Z as showCurrentEffort};
@@ -0,0 +1,14 @@
1
+ import{a as e}from"./chunk-DR8-3Aex.js";import{c as t,s as n,u as r}from"./envUtils-CFG7IQID.js";import{n as i,t as a}from"./defineProperty-CaCI0a5T.js";import{a as o,c as s,i as c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./classPrivateFieldSet2-DZkxcFPS.js";import{Cn as g,Ln as _,Mn as v,Tt as y,Xn as b,Yn as x,_r as ee,kt as S,nn as C,un as w,vt as T,wn as E}from"./schemas-Bwt-7U5W.js";import{t as te}from"./v4-DLhvDPkt.js";import{Tn as ne,wn as D}from"./src-DNHWYkls.js";import{Ht as O,K as re,Mn as k,W as ie,Yn as ae,mt as oe,st as se,vt as A}from"./state-CUZTq6r0.js";import{$u as ce,Ds as le,Es as ue,Gs as de,Jr as fe,Qu as pe,Vr as me,Vs as he,Yi as j,_s as M,bu as N,ea as ge,ei as _e,is as ve,ls as ye,xu as be}from"./growthbook-p4aJ_UMv.js";import{n as xe,t as Se}from"./cwd-B2guYBbl.js";import{L as P,R as Ce,j as F}from"./state-BQkyHx88.js";import{G as we}from"./privacyLevel-CRCHhztk.js";import{i as Te,o as Ee}from"./log-DVv8YiNo.js";import{l as De,p as I,r as Oe}from"./sessionStoragePortable-DyM_hZnp.js";import{$I as ke,$S as L,BC as R,BF as Ae,CA as je,Cb as Me,Cn as Ne,Dn as Pe,En as z,Gd as Fe,H as Ie,Lf as Le,Li as Re,MA as B,Ms as ze,NA as Be,Ns as Ve,Pi as He,QI as Ue,Qn as We,Rf as Ge,SA as Ke,TA as qe,U as Je,VC as Ye,VF as Xe,Wd as Ze,Xr as V,Zc as Qe,_L as $e,_c as et,ar as tt,ba as nt,br as rt,cw as it,dN as at,dp as ot,dw as st,eC as ct,eL as lt,fp as ut,fs as dt,fv as ft,hL as pt,i as mt,iP as ht,lM as gt,lv as _t,mc as vt,nM as yt,nS as bt,o as xt,ow as St,ps as Ct,rM as wt,rP as Tt,uM as Et,uv as Dt,va as Ot,wA as kt,wb as At,zi as jt}from"./loadAgentsDir-Bz0FfcVt.js";import{Ot as Mt,jt as Nt}from"./prompt-CsBCtw4l.js";import{H as Pt,T as Ft,U as It}from"./rcDebugLog-BbHlIxCm.js";import{o as Lt,t as Rt}from"./fileStateCache-DAsLEZau.js";import{a as zt,n as Bt,r as Vt}from"./mappers-DLkk0PZz.js";import{n as Ht,t as Ut}from"./modelOptions-CHUHQ9WG.js";import{n as Wt,t as Gt}from"./systemTheme-C1GNqIfy.js";import{a as Kt,o as qt,t as Jt}from"./processUserInput-QAJK0XSn.js";import{n as Yt,r as Xt,t as Zt}from"./MessageSelector-D79Ug71B.js";import{dirname as Qt}from"node:path";import{randomUUID as $t}from"node:crypto";import{randomUUID as H}from"crypto";import{Readable as en,Writable as tn}from"node:stream";import{unlink as nn}from"node:fs/promises";import*as rn from"node:path/posix";import{isAbsolute as an,resolve as on}from"node:path/posix";te();var U={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},W={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},sn=E({_meta:v(_(),b()).nullish(),terminal:S().optional().default(!1)}),cn=E({_meta:v(_(),b()).nullish(),label:_().nullish(),name:_(),optional:S().optional().default(!1),secret:S().optional().default(!0)}),ln=E({_meta:v(_(),b()).nullish(),description:_().nullish(),id:_(),name:_()}),un=E({_meta:v(_(),b()).nullish(),description:_().nullish(),id:_(),link:_().nullish(),name:_(),vars:y(cn)}),dn=E({_meta:v(_(),b()).nullish(),args:y(_()).optional(),description:_().nullish(),env:v(_(),_()).optional(),id:_(),name:_()}),fn=x([un.and(E({type:w(`env_var`)})),dn.and(E({type:w(`terminal`)})),ln]),pn=E({_meta:v(_(),b()).nullish(),methodId:_()}),mn=E({_meta:v(_(),b()).nullish()}),hn=E({_meta:v(_(),b()).nullish(),blob:_(),mimeType:_().nullish(),uri:_()}),gn=E({default:S().nullish(),description:_().nullish(),title:_().nullish()}),_n=E({_meta:v(_(),b()).nullish()}),vn=E({_meta:v(_(),b()).nullish()}),yn=E({amount:g(),currency:_()}),bn=E({_meta:v(_(),b()).nullish(),terminalId:_()}),xn=E({_meta:v(_(),b()).nullish(),newText:_(),oldText:_().nullish(),path:_()}),Sn=x([_(),g(),g(),S(),y(_())]),Cn=C(x([E({content:v(_(),Sn).nullish()}).and(E({action:w(`accept`)})),E({action:w(`decline`)}),E({action:w(`cancel`)})]),E({_meta:v(_(),b()).nullish()})),wn=E({_meta:v(_(),b()).nullish()}),Tn=_(),En=E({_meta:v(_(),b()).nullish(),elicitationId:Tn}),Dn=w(`object`),On=w(`string`),kn=E({_meta:v(_(),b()).nullish()}),An=E({_meta:v(_(),b()).nullish(),form:wn.nullish(),url:kn.nullish()}),jn=E({const:_(),title:_()}),Mn=E({_meta:v(_(),b()).nullish(),name:_(),value:_()}),Nn=E({code:x([w(-32700),w(-32600),w(-32601),w(-32602),w(-32603),w(-32800),w(-32e3),w(-32002),w(-32042),g().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:b().optional(),message:_()}),Pn=b(),Fn=b(),In=b(),Ln=E({_meta:v(_(),b()).nullish(),readTextFile:S().optional().default(!1),writeTextFile:S().optional().default(!1)}),Rn=E({_meta:v(_(),b()).nullish(),name:_(),value:_()}),zn=E({_meta:v(_(),b()).nullish(),name:_(),title:_().nullish(),version:_()}),Bn=E({default:g().nullish(),description:_().nullish(),maximum:g().nullish(),minimum:g().nullish(),title:_().nullish()}),Vn=E({_meta:v(_(),b()).nullish()}),Hn=E({_meta:v(_(),b()).nullish(),additionalDirectories:y(_()).optional(),cursor:_().nullish(),cwd:_().nullish()}),Un=E({_meta:v(_(),b()).nullish()}),Wn=E({_meta:v(_(),b()).nullish(),logout:Un.nullish()}),Gn=E({_meta:v(_(),b()).nullish()}),Kn=E({_meta:v(_(),b()).nullish()}),qn=E({_meta:v(_(),b()).nullish(),http:S().optional().default(!1),sse:S().optional().default(!1)}),Jn=E({_meta:v(_(),b()).nullish(),headers:y(Rn),name:_(),url:_()}),Yn=E({_meta:v(_(),b()).nullish(),headers:y(Rn),name:_(),url:_()}),Xn=E({_meta:v(_(),b()).nullish(),args:y(_()),command:_(),env:y(Mn),name:_()}),Zn=x([Jn.and(E({type:w(`http`)})),Yn.and(E({type:w(`sse`)})),Xn]),Qn=_(),$n=E({_meta:v(_(),b()).nullish(),description:_().nullish(),modelId:Qn,name:_()}),er=x([w(`error`),w(`warning`),w(`information`),w(`hint`)]),tr=E({_meta:v(_(),b()).nullish()}),nr=E({_meta:v(_(),b()).nullish()}),rr=E({_meta:v(_(),b()).nullish()}),ir=E({_meta:v(_(),b()).nullish()}),ar=E({_meta:v(_(),b()).nullish()}),or=E({_meta:v(_(),b()).nullish(),maxCount:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),sr=E({diff:_(),uri:_()}),cr=E({endLine:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:_()}),lr=E({_meta:v(_(),b()).nullish()}),ur=E({_meta:v(_(),b()).nullish()}),dr=E({languageId:_(),text:_(),uri:_()}),fr=E({_meta:v(_(),b()).nullish(),maxCount:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),pr=x([w(`rejected`),w(`ignored`),w(`replaced`),w(`cancelled`)]),mr=E({excerpts:y(cr),uri:_()}),hr=E({_meta:v(_(),b()).nullish()}),gr=E({_meta:v(_(),b()).nullish()}),_r=E({name:_(),owner:_(),remoteUrl:_()}),vr=E({_meta:v(_(),b()).nullish()}),yr=E({_meta:v(_(),b()).nullish(),jump:lr.nullish(),rename:gr.nullish(),searchAndReplace:vr.nullish()}),br=E({id:_(),isRegex:S().nullish(),replace:_(),search:_(),uri:_()}),xr=x([w(`automatic`),w(`diagnostic`),w(`manual`)]),Sr=E({_meta:v(_(),b()).nullish(),maxCount:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Cr=E({_meta:v(_(),b()).nullish(),diagnostics:tr.nullish(),editHistory:or.nullish(),openFiles:ur.nullish(),recentFiles:fr.nullish(),relatedSnippets:hr.nullish(),userActions:Sr.nullish()}),wr=E({_meta:v(_(),b()).nullish(),additionalDirectories:y(_()).optional(),cwd:_(),mcpServers:y(Zn)}),Tr=E({default:g().nullish(),description:_().nullish(),maximum:g().nullish(),minimum:g().nullish(),title:_().nullish()}),Er=_(),Dr=x([w(`allow_once`),w(`allow_always`),w(`reject_once`),w(`reject_always`)]),Or=E({_meta:v(_(),b()).nullish(),kind:Dr,name:_(),optionId:Er}),kr=x([w(`high`),w(`medium`),w(`low`)]),Ar=x([w(`pending`),w(`in_progress`),w(`completed`)]),jr=E({_meta:v(_(),b()).nullish(),content:_(),priority:kr,status:Ar}),Mr=E({_meta:v(_(),b()).nullish(),entries:y(jr)}),G=E({character:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),Nr=E({id:_(),position:G,uri:_()}),Pr=E({id:_(),newName:_(),position:G,uri:_()}),Fr=E({action:_(),position:G,timestampMs:g(),uri:_()}),Ir=x([w(`utf-16`),w(`utf-32`),w(`utf-8`)]),Lr=E({_meta:v(_(),b()).nullish(),auth:sn.optional().default({terminal:!1}),elicitation:An.nullish(),fs:Ln.optional().default({readTextFile:!1,writeTextFile:!1}),nes:yr.nullish(),positionEncodings:y(Ir).optional(),terminal:S().optional().default(!1)}),Rr=E({_meta:v(_(),b()).nullish(),audio:S().optional().default(!1),embeddedContext:S().optional().default(!1),image:S().optional().default(!1)}),zr=g().int().gte(0).lte(65535),Br=E({_meta:v(_(),b()).nullish(),clientCapabilities:Lr.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:zn.nullish(),protocolVersion:zr}),K=E({end:G,start:G}),Vr=E({message:_(),range:K,severity:er,uri:_()}),Hr=E({languageId:_(),lastFocusedMs:g().nullish(),uri:_(),visibleRange:K.nullish()}),Ur=E({_meta:v(_(),b()).nullish(),diagnostics:y(Vr).nullish(),editHistory:y(sr).nullish(),openFiles:y(Hr).nullish(),recentFiles:y(dr).nullish(),relatedSnippets:y(mr).nullish(),userActions:y(Fr).nullish()}),Wr=E({newText:_(),range:K}),Gr=x([E({cursorPosition:G.nullish(),edits:y(Wr),id:_(),uri:_()}).and(E({kind:w(`edit`)})),Nr.and(E({kind:w(`jump`)})),Pr.and(E({kind:w(`rename`)})),br.and(E({kind:w(`searchAndReplace`)}))]),Kr=E({_meta:v(_(),b()).nullish(),content:_()}),qr=E({_meta:v(_(),b()).nullish()}),q=x([g(),_()]).nullable();E({_meta:v(_(),b()).nullish(),requestId:q});var Jr=E({requestId:q}),Yr=T([`assistant`,`user`]),Xr=E({_meta:v(_(),b()).nullish(),audience:y(Yr).nullish(),lastModified:_().nullish(),priority:g().nullish()}),Zr=E({_meta:v(_(),b()).nullish(),annotations:Xr.nullish(),data:_(),mimeType:_()}),Qr=E({_meta:v(_(),b()).nullish(),annotations:Xr.nullish(),data:_(),mimeType:_(),uri:_().nullish()}),$r=E({_meta:v(_(),b()).nullish(),annotations:Xr.nullish(),description:_().nullish(),mimeType:_().nullish(),name:_(),size:g().nullish(),title:_().nullish(),uri:_()}),ei=E({_meta:v(_(),b()).nullish(),optionId:Er}),ti=x([E({outcome:w(`cancelled`)}),ei.and(E({outcome:w(`selected`)}))]),ni=E({_meta:v(_(),b()).nullish(),outcome:ti}),ri=E({_meta:v(_(),b()).nullish()}),ii=E({_meta:v(_(),b()).nullish()}),ai=E({currentValue:S()}),oi=_(),si=_(),ci=x([w(`mode`),w(`model`),w(`thought_level`),_()]),li=_(),ui=E({_meta:v(_(),b()).nullish(),description:_().nullish(),name:_(),value:li}),di=E({_meta:v(_(),b()).nullish(),group:oi,name:_(),options:y(ui)}),J=C(x([E({currentValue:li,options:x([y(ui),y(di)])}).and(E({type:w(`select`)})),ai.and(E({type:w(`boolean`)}))]),E({_meta:v(_(),b()).nullish(),category:ci.nullish(),description:_().nullish(),id:si,name:_()})),fi=E({_meta:v(_(),b()).nullish(),configOptions:y(J)}),pi=E({_meta:v(_(),b()).nullish()}),Y=_(),mi=E({_meta:v(_(),b()).nullish(),id:_(),sessionId:Y}),hi=E({_meta:v(_(),b()).nullish(),sessionId:Y}),gi=E({_meta:v(_(),b()).nullish(),sessionId:Y}),_i=E({_meta:v(_(),b()).nullish(),sessionId:Y}),vi=E({_meta:v(_(),b()).nullish(),args:y(_()).optional(),command:_(),cwd:_().nullish(),env:y(Mn).optional(),outputByteLimit:g().nullish(),sessionId:Y}),yi=E({_meta:v(_(),b()).nullish(),sessionId:Y,uri:_()}),bi=E({_meta:v(_(),b()).nullish(),position:G,sessionId:Y,uri:_(),version:g(),visibleRange:K}),xi=E({_meta:v(_(),b()).nullish(),languageId:_(),sessionId:Y,text:_(),uri:_(),version:g()}),Si=E({_meta:v(_(),b()).nullish(),sessionId:Y,uri:_()}),Ci=E({_meta:v(_(),b()).nullish(),additionalDirectories:y(_()).optional(),cwd:_(),mcpServers:y(Zn).optional(),sessionId:Y}),wi=E({_meta:v(_(),b()).nullish(),sessionId:Y,terminalId:_()}),Ti=E({_meta:v(_(),b()).nullish(),additionalDirectories:y(_()).optional(),cwd:_(),mcpServers:y(Zn),sessionId:Y}),Ei=E({_meta:v(_(),b()).nullish(),limit:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:_(),sessionId:Y}),Di=E({_meta:v(_(),b()).nullish(),id:_(),reason:pr.nullish(),sessionId:Y}),Oi=E({_meta:v(_(),b()).nullish(),sessionId:Y,terminalId:_()}),ki=E({_meta:v(_(),b()).nullish(),additionalDirectories:y(_()).optional(),cwd:_(),mcpServers:y(Zn).optional(),sessionId:Y}),Ai=E({_meta:v(_(),b()).nullish(),additionalDirectories:y(_()).optional(),cwd:_(),sessionId:Y,title:_().nullish(),updatedAt:_().nullish()}),ji=E({_meta:v(_(),b()).nullish(),nextCursor:_().nullish(),sessions:y(Ai)}),Mi=E({_meta:v(_(),b()).nullish(),title:_().nullish(),updatedAt:_().nullish()}),Ni=E({_meta:v(_(),b()).nullish()}),Pi=_(),Fi=E({_meta:v(_(),b()).nullish(),currentModeId:Pi}),Ii=E({_meta:v(_(),b()).nullish(),description:_().nullish(),id:Pi,name:_()}),Li=E({_meta:v(_(),b()).nullish(),availableModes:y(Ii),currentModeId:Pi}),Ri=E({_meta:v(_(),b()).nullish(),availableModels:y($n),currentModelId:Qn}),zi=E({_meta:v(_(),b()).nullish(),configOptions:y(J).nullish(),models:Ri.nullish(),modes:Li.nullish(),sessionId:Y}),Bi=E({_meta:v(_(),b()).nullish(),configOptions:y(J).nullish(),models:Ri.nullish(),modes:Li.nullish()}),Vi=E({_meta:v(_(),b()).nullish(),configOptions:y(J).nullish(),models:Ri.nullish(),modes:Li.nullish(),sessionId:Y}),Hi=E({_meta:v(_(),b()).nullish(),configOptions:y(J).nullish(),models:Ri.nullish(),modes:Li.nullish()}),Ui=E({_meta:v(_(),b()).nullish()}),Wi=E({_meta:v(_(),b()).nullish(),additionalDirectories:ri.nullish(),close:ii.nullish(),fork:pi.nullish(),list:Ni.nullish(),resume:Ui.nullish()}),Gi=C(x([E({type:w(`boolean`),value:S()}),E({value:li})]),E({_meta:v(_(),b()).nullish(),configId:si,sessionId:Y})),Ki=E({_meta:v(_(),b()).nullish(),configOptions:y(J)}),qi=E({_meta:v(_(),b()).nullish(),modeId:Pi,sessionId:Y}),Ji=E({_meta:v(_(),b()).nullish()}),Yi=E({_meta:v(_(),b()).nullish(),modelId:Qn,sessionId:Y}),Xi=E({_meta:v(_(),b()).nullish()}),Zi=E({_meta:v(_(),b()).nullish(),sessionId:Y}),Qi=x([w(`end_turn`),w(`max_tokens`),w(`max_turn_requests`),w(`refusal`),w(`cancelled`)]),$i=x([w(`email`),w(`uri`),w(`date`),w(`date-time`)]),ea=E({default:_().nullish(),description:_().nullish(),enum:y(_()).nullish(),format:$i.nullish(),maxLength:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:y(jn).nullish(),pattern:_().nullish(),title:_().nullish()}),ta=E({_meta:v(_(),b()).nullish(),context:Ur.nullish(),position:G,selection:K.nullish(),sessionId:Y,triggerKind:xr,uri:_(),version:g()}),na=E({_meta:v(_(),b()).nullish(),suggestions:y(Gr)}),ra=E({_meta:v(_(),b()).nullish(),terminalId:_()}),ia=E({_meta:v(_(),b()).nullish(),exitCode:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:_().nullish()}),aa=E({_meta:v(_(),b()).nullish(),sessionId:Y,terminalId:_()}),oa=E({_meta:v(_(),b()).nullish(),exitStatus:ia.nullish(),output:_(),truncated:S()}),sa=E({_meta:v(_(),b()).nullish(),annotations:Xr.nullish(),text:_()}),ca=E({range:K.nullish(),text:_()}),la=E({_meta:v(_(),b()).nullish(),contentChanges:y(ca),sessionId:Y,uri:_(),version:g()});E({method:_(),params:x([hi,xi,la,yi,Si,bi,mi,Di,Pn]).nullish()});var ua=x([w(`full`),w(`incremental`)]),da=E({_meta:v(_(),b()).nullish(),syncKind:ua}),fa=E({_meta:v(_(),b()).nullish(),didChange:da.nullish(),didClose:nr.nullish(),didFocus:rr.nullish(),didOpen:ir.nullish(),didSave:ar.nullish()}),pa=E({_meta:v(_(),b()).nullish(),document:fa.nullish()}),ma=E({_meta:v(_(),b()).nullish(),context:Cr.nullish(),events:pa.nullish()}),ha=E({_meta:v(_(),b()).nullish(),auth:Wn.optional().default({}),loadSession:S().optional().default(!1),mcpCapabilities:qn.optional().default({http:!1,sse:!1}),nes:ma.nullish(),positionEncoding:Ir.nullish(),promptCapabilities:Rr.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:Wi.optional().default({})}),ga=E({_meta:v(_(),b()).nullish(),agentCapabilities:ha.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:zn.nullish(),authMethods:y(fn).optional().default([]),protocolVersion:zr}),_a=x([E({_meta:v(_(),b()).nullish(),mimeType:_().nullish(),text:_(),uri:_()}),hn]),va=E({_meta:v(_(),b()).nullish(),annotations:Xr.nullish(),resource:_a}),ya=x([sa.and(E({type:w(`text`)})),Qr.and(E({type:w(`image`)})),Zr.and(E({type:w(`audio`)})),$r.and(E({type:w(`resource_link`)})),va.and(E({type:w(`resource`)}))]),ba=E({_meta:v(_(),b()).nullish(),content:ya}),xa=E({_meta:v(_(),b()).nullish(),content:ya,messageId:_().nullish()}),Sa=E({_meta:v(_(),b()).nullish(),messageId:_().nullish(),prompt:y(ya),sessionId:Y}),Ca=E({anyOf:y(jn)}),wa=x([ba.and(E({type:w(`content`)})),xn.and(E({type:w(`diff`)})),ra.and(E({type:w(`terminal`)}))]),Ta=_(),Ea=E({sessionId:Y,toolCallId:Ta.nullish()}),Da=C(x([Ea,Jr]),E({elicitationId:Tn,url:_().url()})),Oa=E({_meta:v(_(),b()).nullish(),line:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:_()}),ka=x([w(`pending`),w(`in_progress`),w(`completed`),w(`failed`)]),Aa=x([w(`read`),w(`edit`),w(`delete`),w(`move`),w(`search`),w(`execute`),w(`think`),w(`fetch`),w(`switch_mode`),w(`other`)]),ja=E({_meta:v(_(),b()).nullish(),content:y(wa).optional(),kind:Aa.optional(),locations:y(Oa).optional(),rawInput:b().optional(),rawOutput:b().optional(),status:ka.optional(),title:_(),toolCallId:Ta}),Ma=E({_meta:v(_(),b()).nullish(),content:y(wa).nullish(),kind:Aa.nullish(),locations:y(Oa).nullish(),rawInput:b().optional(),rawOutput:b().optional(),status:ka.nullish(),title:_().nullish(),toolCallId:Ta}),Na=E({_meta:v(_(),b()).nullish(),options:y(Or),sessionId:Y,toolCall:Ma}),Pa=E({_meta:v(_(),b()).nullish(),hint:_()}),Fa=E({_meta:v(_(),b()).nullish(),description:_(),input:Pa.nullish(),name:_()}),Ia=E({_meta:v(_(),b()).nullish(),availableCommands:y(Fa)}),La=x([E({enum:y(_()),type:On}),Ca]),Ra=E({default:y(_()).nullish(),description:_().nullish(),items:La,maxItems:g().nullish(),minItems:g().nullish(),title:_().nullish()}),za=x([ea.and(E({type:w(`string`)})),Tr.and(E({type:w(`number`)})),Bn.and(E({type:w(`integer`)})),gn.and(E({type:w(`boolean`)})),Ra.and(E({type:w(`array`)}))]),Ba=E({description:_().nullish(),properties:v(_(),za).optional().default({}),required:y(_()).nullish(),title:_().nullish(),type:Dn.optional().default(`object`)}),Va=C(x([C(x([Ea,Jr]),E({requestedSchema:Ba})).and(E({mode:w(`form`)})),Da.and(E({mode:w(`url`)}))]),E({_meta:v(_(),b()).nullish(),message:_()})),Ha=E({cachedReadTokens:g().nullish(),cachedWriteTokens:g().nullish(),inputTokens:g(),outputTokens:g(),thoughtTokens:g().nullish(),totalTokens:g()});x([E({id:q,result:x([ga,mn,Kn,Vi,Bi,ji,zi,Hi,vn,Ji,Ki,E({_meta:v(_(),b()).nullish(),stopReason:Qi,usage:Ha.nullish(),userMessageId:_().nullish()}),Xi,Zi,na,_n,In])}),E({error:Nn,id:q})]);var Ua=E({_meta:v(_(),b()).nullish(),cost:yn.nullish(),size:g(),used:g()}),Wa=x([xa.and(E({sessionUpdate:w(`user_message_chunk`)})),xa.and(E({sessionUpdate:w(`agent_message_chunk`)})),xa.and(E({sessionUpdate:w(`agent_thought_chunk`)})),ja.and(E({sessionUpdate:w(`tool_call`)})),Ma.and(E({sessionUpdate:w(`tool_call_update`)})),Mr.and(E({sessionUpdate:w(`plan`)})),Ia.and(E({sessionUpdate:w(`available_commands_update`)})),Fi.and(E({sessionUpdate:w(`current_mode_update`)})),fi.and(E({sessionUpdate:w(`config_option_update`)})),Mi.and(E({sessionUpdate:w(`session_info_update`)})),Ua.and(E({sessionUpdate:w(`usage_update`)}))]),Ga=E({_meta:v(_(),b()).nullish(),sessionId:Y,update:Wa});E({method:_(),params:x([Ga,En,Pn]).nullish()});var Ka=E({_meta:v(_(),b()).nullish(),sessionId:Y,terminalId:_()}),qa=E({_meta:v(_(),b()).nullish(),exitCode:g().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:_().nullish()}),Ja=E({name:_(),uri:_()}),Ya=E({_meta:v(_(),b()).nullish(),repository:_r.nullish(),workspaceFolders:y(Ja).nullish(),workspaceUri:_().nullish()});E({id:q,method:_(),params:x([Br,pn,Gn,wr,Ti,Hn,Ci,ki,_i,qi,Gi,Sa,Yi,Ya,ta,gi,Fn]).nullish()});var Xa=E({_meta:v(_(),b()).nullish(),content:_(),path:_(),sessionId:Y});E({id:q,method:_(),params:x([Xa,Ei,Na,vi,aa,Oi,Ka,wi,Va,Fn]).nullish()}),x([E({id:q,result:x([E({_meta:v(_(),b()).nullish()}),Kr,ni,bn,oa,qr,qa,Vn,Cn,In])}),E({error:Nn,id:q})]),i(),h(),s(),d(),c(),u();function Za(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
2
+ `);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
3
+ `,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}te();var Qa,X=new WeakMap,$a=class{constructor(e,t){p(this,X,void 0);let n=e(this);m(X,this,new uo(async(e,t)=>{switch(e){case U.initialize:{let e=Br.parse(t);return n.initialize(e)}case U.session_new:{let e=wr.parse(t);return n.newSession(e)}case U.session_load:{if(!n.loadSession)throw $.methodNotFound(e);let r=Ti.parse(t);return n.loadSession(r)}case U.session_list:{if(!n.listSessions)throw $.methodNotFound(e);let r=Hn.parse(t);return n.listSessions(r)}case U.session_fork:{if(!n.unstable_forkSession)throw $.methodNotFound(e);let r=Ci.parse(t);return n.unstable_forkSession(r)}case U.session_resume:{if(!n.unstable_resumeSession)throw $.methodNotFound(e);let r=ki.parse(t);return n.unstable_resumeSession(r)}case U.session_close:{if(!n.unstable_closeSession)throw $.methodNotFound(e);let r=_i.parse(t);return n.unstable_closeSession(r)}case U.session_set_mode:{if(!n.setSessionMode)throw $.methodNotFound(e);let r=qi.parse(t);return await n.setSessionMode(r)??{}}case U.authenticate:{let e=pn.parse(t);return await n.authenticate(e)??{}}case U.logout:{if(!n.unstable_logout)throw $.methodNotFound(e);let r=Gn.parse(t);return await n.unstable_logout(r)??{}}case U.session_prompt:{let e=Sa.parse(t);return n.prompt(e)}case U.session_set_model:{if(!n.unstable_setSessionModel)throw $.methodNotFound(e);let r=Yi.parse(t);return await n.unstable_setSessionModel(r)??{}}case U.session_set_config_option:{if(!n.setSessionConfigOption)throw $.methodNotFound(e);let r=Gi.parse(t);return n.setSessionConfigOption(r)}case U.nes_start:{if(!n.unstable_startNes)throw $.methodNotFound(e);let r=Ya.parse(t);return n.unstable_startNes(r)}case U.nes_suggest:{if(!n.unstable_suggestNes)throw $.methodNotFound(e);let r=ta.parse(t);return n.unstable_suggestNes(r)}case U.nes_close:{if(!n.unstable_closeNes)throw $.methodNotFound(e);let r=gi.parse(t);return await n.unstable_closeNes(r)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw $.methodNotFound(e)}},async(e,t)=>{switch(e){case U.session_cancel:{let e=hi.parse(t);return n.cancel(e)}case U.document_did_open:{if(!n.unstable_didOpenDocument)return;let e=xi.parse(t);return n.unstable_didOpenDocument(e)}case U.document_did_change:{if(!n.unstable_didChangeDocument)return;let e=la.parse(t);return n.unstable_didChangeDocument(e)}case U.document_did_close:{if(!n.unstable_didCloseDocument)return;let e=yi.parse(t);return n.unstable_didCloseDocument(e)}case U.document_did_save:{if(!n.unstable_didSaveDocument)return;let e=Si.parse(t);return n.unstable_didSaveDocument(e)}case U.document_did_focus:{if(!n.unstable_didFocusDocument)return;let e=bi.parse(t);return n.unstable_didFocusDocument(e)}case U.nes_accept:{if(!n.unstable_acceptNes)return;let e=mi.parse(t);return n.unstable_acceptNes(e)}case U.nes_reject:{if(!n.unstable_rejectNes)return;let e=Di.parse(t);return n.unstable_rejectNes(e)}default:if(n.extNotification)return n.extNotification(e,t);throw $.methodNotFound(e)}},t))}async sessionUpdate(e){return await f(X,this).sendNotification(W.session_update,e)}async requestPermission(e){return await f(X,this).sendRequest(W.session_request_permission,e)}async readTextFile(e){return await f(X,this).sendRequest(W.fs_read_text_file,e)}async writeTextFile(e){return await f(X,this).sendRequest(W.fs_write_text_file,e)??{}}async createTerminal(e){return new no((await f(X,this).sendRequest(W.terminal_create,e)).terminalId,e.sessionId,f(X,this))}async unstable_createElicitation(e){return await f(X,this).sendRequest(W.elicitation_create,e)}async unstable_completeElicitation(e){return await f(X,this).sendNotification(W.elicitation_complete,e)}async extMethod(e,t){return await f(X,this).sendRequest(e,t)}async extNotification(e,t){return await f(X,this).sendNotification(e,t)}get signal(){return f(X,this).signal}get closed(){return f(X,this).closed}},eo=new WeakMap,to=new WeakMap;Qa=Symbol.asyncDispose;var no=class{constructor(e,t,n){a(this,`id`,void 0),p(this,eo,void 0),p(this,to,void 0),this.id=e,m(eo,this,t),m(to,this,n)}async currentOutput(){return await f(to,this).sendRequest(W.terminal_output,{sessionId:f(eo,this),terminalId:this.id})}async waitForExit(){return await f(to,this).sendRequest(W.terminal_wait_for_exit,{sessionId:f(eo,this),terminalId:this.id})}async kill(){return await f(to,this).sendRequest(W.terminal_kill,{sessionId:f(eo,this),terminalId:this.id})??{}}async release(){return await f(to,this).sendRequest(W.terminal_release,{sessionId:f(eo,this),terminalId:this.id})??{}}async[Qa](){await this.release()}},ro=new WeakMap,io=new WeakMap,ao=new WeakMap,oo=new WeakMap,so=new WeakMap,co=new WeakMap,Z=new WeakMap,lo=new WeakMap,Q=new WeakSet,uo=class{constructor(e,t,n){l(this,Q),p(this,ro,new Map),p(this,io,0),p(this,ao,void 0),p(this,oo,void 0),p(this,so,void 0),p(this,co,Promise.resolve()),p(this,Z,new AbortController),p(this,lo,void 0),m(ao,this,e),m(oo,this,t),m(so,this,n),m(lo,this,new Promise(e=>{f(Z,this).signal.addEventListener(`abort`,()=>e())})),o(Q,this,fo).call(this)}get signal(){return f(Z,this).signal}get closed(){return f(lo,this)}async sendRequest(e,t){var n,r;o(Q,this,vo).call(this);let i=(m(io,this,(n=f(io,this),r=n++,n)),r),a=new Promise((e,t)=>{f(ro,this).set(i,{resolve:e,reject:t})});return await o(Q,this,yo).call(this,{jsonrpc:`2.0`,id:i,method:e,params:t}),a}async sendNotification(e,t){o(Q,this,vo).call(this),await o(Q,this,yo).call(this,{jsonrpc:`2.0`,method:e,params:t})}};async function fo(){let e;try{let e=f(so,this).readable.getReader();try{for(;!f(Z,this).signal.aborted;){let{value:t,done:n}=await e.read();if(n)break;if(t)try{o(Q,this,mo).call(this,t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&o(Q,this,yo).call(this,{jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{o(Q,this,po).call(this,e)}}function po(e){if(f(Z,this).signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of f(ro,this).values())e.reject(t);f(ro,this).clear(),f(Z,this).abort(t)}async function mo(e){if(`method`in e&&`id`in e){let t=await o(Q,this,ho).call(this,e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await o(Q,this,yo).call(this,{jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await o(Q,this,go).call(this,e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?o(Q,this,_o).call(this,e):console.error(`Invalid message`,{message:e})}async function ho(e,t){try{return{result:await f(ao,this).call(this,e,t)??null}}catch(e){if(e instanceof $)return e.toResult();if(e instanceof ee)return $.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return $.internalError(t?JSON.parse(t):{}).toResult()}catch{return $.internalError({details:t}).toResult()}}}async function go(e,t){try{return await f(oo,this).call(this,e,t),{result:null}}catch(e){if(e instanceof $)return e.toResult();if(e instanceof ee)return $.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return $.internalError(t?JSON.parse(t):{}).toResult()}catch{return $.internalError({details:t}).toResult()}}}function _o(e){let t=f(ro,this).get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new $(n,r,i))}f(ro,this).delete(e.id)}else console.error(`Got response to unknown request`,e.id)}function vo(){if(f(Z,this).signal.aborted)throw f(Z,this).signal.reason??Error(`ACP connection closed`)}async function yo(e){return m(co,this,f(co,this).then(async()=>{let t=f(so,this).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{o(Q,this,po).call(this,e)})),f(co,this)}var $=class e extends Error{constructor(e,t,n){super(t),a(this,`code`,void 0),a(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=n}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};pe(),P(),Dt(),Ft(),D(),jt(),we(),bt(),Tt(),le(),Ze(),Xe(),ke(),Nt(),wt(),M(),xe(),n(),ge(),st(),Et(),Me(),Ee(),Qe(),fe(),Ot(),dt(),rt(),at(),Gt(),pt(),i(),Bt(),z(),je();var bo=()=>{try{return Yt(),e(Zt)}catch{return null}},xo=(ut(),e(ot)).getCoordinatorUserContext,So=class{constructor(e){a(this,`config`,void 0),a(this,`mutableMessages`,void 0),a(this,`abortController`,void 0),a(this,`permissionDenials`,void 0),a(this,`totalUsage`,void 0),a(this,`hasHandledOrphanedPermission`,!1),a(this,`readFileState`,void 0),a(this,`discoveredSkillNames`,new Set),a(this,`loadedNestedMemoryPaths`,new Set),this.config=e,this.mutableMessages=e.initialMessages??[],this.abortController=e.abortController??yt(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=It}async*submitMessage(e,n){let{cwd:i,commands:a,tools:o,mcpClients:s,verbose:c=!1,thinkingConfig:l,maxTurns:u,maxBudgetUsd:d,taskBudget:f,canUseTool:p,customSystemPrompt:m,appendSystemPrompt:h,userSpecifiedModel:g,fallbackModel:_,jsonSchema:v,getAppState:y,setAppState:b,replayUserMessages:x=!1,includePartialMessages:ee=!1,agents:S=[],setSDKStatus:C,orphanedPermission:w}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],Ct(i);let T=!Ce(),E=Date.now(),te=async(e,t,n,r,i,a)=>{let o=await p(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:qt(e.name),tool_use_id:i,tool_input:t}),o},D=y(),O=g?_e(g):me(),re=l||($e()===!1?{type:`disabled`}:{type:`adaptive`});gt(`before_getSystemPrompt`);let k=typeof m==`string`?m:void 0,{defaultSystemPrompt:ae,userContext:se,systemContext:le}=await Xt({tools:o,mainLoopModel:O,additionalWorkingDirectories:Array.from(D.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:s,customSystemPrompt:k});gt(`after_getSystemPrompt`);let de={...se,...xo(s,Pe()?Ne():void 0)},fe=k!==void 0&&ue()?await ht():null,pe=Pt([...k===void 0?ae:[k],...fe?[fe]:[],...h?[h]:[]]),he=o.some(e=>lt(e,Mt));v&&he&&At(b,F());let M={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:c,mainLoopModel:O,thinkingConfig:re,mcpClients:s,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:m,appendSystemPrompt:h,agentDefinitions:{activeAgents:S,allAgents:[]},theme:Wt(ye().theme),maxBudgetUsd:d},getAppState:y,setAppState:b,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{b(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{b(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:C};if(w&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of Ke(w,o,this.mutableMessages,M))yield e}let{messages:N,shouldQuery:ge,allowedTools:ve,model:be,resultText:xe}=await Jt({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...M,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...N);let P=[...this.mutableMessages];if(T&&N.length>0){let e=V(P);t()||(await e,(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await We())}let we=bo(),Ee=N.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(we?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),De=x?Ee:[];b(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:ve}}}));let I=be??O;M={messages:P,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:c,mainLoopModel:I,thinkingConfig:re,mcpClients:s,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:m,appendSystemPrompt:h,theme:Wt(ye().theme),agentDefinitions:{activeAgents:S,allAgents:[]},maxBudgetUsd:d},getAppState:y,setAppState:b,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:M.updateFileHistoryState,updateAttributionState:M.updateAttributionState,setSDKStatus:C},gt(`before_skills_plugins`);let[Oe,{enabled:ke}]=await Promise.all([Re(Se()),nt()]);if(gt(`after_skills_plugins`),yield Kt({tools:o,mcpClients:s,model:I,permissionMode:D.toolPermissionContext.mode,commands:a,agents:S,skills:Oe,plugins:ke,fastMode:D.fastMode}),gt(`system_message_yielded`),!ge){for(let e of N)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:ne(e.message.content)},session_id:F(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!e.isCompactSummary,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly}),e.type===`system`&&e.subtype===`local_command`&&typeof e.content==`string`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))&&(yield Vt(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:F(),uuid:e.uuid,compact_metadata:zt(t.compactMetadata)}}T&&(await V(P),(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await We()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-E,duration_api_ms:oe(),num_turns:P.length-1,result:xe??``,stop_reason:null,session_id:F(),total_cost_usd:A(),usage:this.totalUsage,modelUsage:ie(),permission_denials:this.permissionDenials,fast_mode_state:j(I,D.fastMode),uuid:H()};return}if(St()&&T){let e=bo()?.selectableUserMessagesFilter??(e=>!0);N.filter(e).forEach(e=>{it(e=>{b(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let L=It,R=1,je=!1,Me,z=null,Ie=Te().at(-1),Le=v?et(this.mutableMessages,Mt):0;for await(let e of Fe({messages:P,systemPrompt:pe,userContext:de,systemContext:le,canUseTool:te,toolUseContext:M,fallbackModel:_,querySource:`sdk`,maxTurns:u,taskBudget:f})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(T&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await V(this.mutableMessages.slice(0,e+1))}}if(P.push(e),T&&(e.type===`assistant`?V(P):await V(P)),!je&&De.length>0){je=!0;for(let e of De)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:F(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&R++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(z=n),this.mutableMessages.push(t),yield*qe(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),T&&(P.push(t),V(P)),yield*qe(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*qe(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){L=It;let e=t.message;L=ft(L,e.usage)}if(t.type===`message_delta`){L=ft(L,t.usage);let e=t.delta;e.stop_reason!=null&&(z=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=_t(this.totalUsage,L)),ee&&(yield{type:`stream_event`,event:t,session_id:F(),parent_tool_use_id:null,uuid:H()});break}case`attachment`:{let t=e;this.mutableMessages.push(t),T&&(P.push(t),V(P));let n=t.attachment;if(n.type===`structured_output`)Me=n.data;else if(n.type===`max_turns_reached`){T&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await We(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-E,duration_api_ms:oe(),is_error:!0,num_turns:n.turnCount,stop_reason:z,session_id:F(),total_cost_usd:A(),usage:this.totalUsage,modelUsage:ie(),permission_denials:this.permissionDenials,fast_mode_state:j(I,D.fastMode),uuid:H(),errors:[`Reached maximum number of turns (${n.maxTurns})`]};return}else x&&n.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:n.prompt},session_id:F(),parent_tool_use_id:null,uuid:n.source_uuid||t.uuid,timestamp:t.timestamp,isReplay:!0});break}case`stream_request_start`:break;case`system`:{let t=e,n=this.config.snipReplay?.(t,this.mutableMessages);if(n!==void 0){n.executed&&(this.mutableMessages.length=0,this.mutableMessages.push(...n.messages));break}if(this.mutableMessages.push(t),t.subtype===`compact_boundary`&&t.compactMetadata){let e=t,n=this.mutableMessages.length-1;n>0&&this.mutableMessages.splice(0,n);let r=P.length-1;r>0&&P.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:F(),uuid:t.uuid,compact_metadata:zt(e.compactMetadata)}}if(t.subtype===`api_error`){let e=t;yield{type:`system`,subtype:`api_retry`,attempt:e.retryAttempt,max_retries:e.maxRetries,retry_delay_ms:e.retryInMs,error_status:e.error.status??null,error:Ae(e.error),session_id:F(),uuid:t.uuid}}break}case`tool_use_summary`:{let t=e;yield{type:`tool_use_summary`,summary:t.summary,preceding_tool_use_ids:t.precedingToolUseIds,session_id:F(),uuid:t.uuid};break}}if(d!==void 0&&A()>=d){T&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await We(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-E,duration_api_ms:oe(),is_error:!0,num_turns:R,stop_reason:z,session_id:F(),total_cost_usd:A(),usage:this.totalUsage,modelUsage:ie(),permission_denials:this.permissionDenials,fast_mode_state:j(I,D.fastMode),uuid:H(),errors:[`Reached maximum budget ($${d}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&v){let e=et(this.mutableMessages,Mt)-Le,t=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=t){T&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await We(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-E,duration_api_ms:oe(),is_error:!0,num_turns:R,stop_reason:z,session_id:F(),total_cost_usd:A(),usage:this.totalUsage,modelUsage:ie(),permission_denials:this.permissionDenials,fast_mode_state:j(I,D.fastMode),uuid:H(),errors:[`Failed to provide valid structured output after ${t} attempts`]};return}}}let B=P.findLast(e=>e.type===`assistant`||e.type===`user`),ze=B?.type??`undefined`,Be=B?.type===`assistant`?ce(B.message.content)?.type??`none`:`n/a`;if(T&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await We(),!kt(B,z)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-E,duration_api_ms:oe(),is_error:!0,num_turns:R,stop_reason:z,session_id:F(),total_cost_usd:A(),usage:this.totalUsage,modelUsage:ie(),permission_denials:this.permissionDenials,fast_mode_state:j(I,D.fastMode),uuid:H(),errors:(()=>{let e=Te(),t=Ie?e.lastIndexOf(Ie)+1:0;return[`[ede_diagnostic] result_type=${ze} last_content_type=${Be} stop_reason=${z}`,...e.slice(t).map(e=>e.error)]})()};return}let Ve=``,He=!1;if(B.type===`assistant`){let e=ce(B.message.content);e?.type===`text`&&!vt.has(e.text)&&(Ve=e.text),He=!!B.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:He,duration_ms:Date.now()-E,duration_api_ms:oe(),num_turns:R,result:Ve,stop_reason:z,session_id:F(),total_cost_usd:A(),usage:this.totalUsage,modelUsage:ie(),permission_denials:this.permissionDenials,structured_output:Me,fast_mode_state:j(I,D.fastMode),uuid:H()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=yt()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return F()}setModel(e){this.config.userSpecifiedModel=e}};O(),De(),N(),de(),Be(),Ge(),Ve(),Je(),xt();function Co(e,t){if(e)return t?an(e)?e:on(t,e):e}var wo=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,To={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function Eo(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=To[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!wo)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Do(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Oo=256;function ko(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Oo?t:t.slice(0,Oo-1)+`…`}function Ao(e,t){if(!t)return e;let n=rn.resolve(t),r=rn.resolve(e);return r.startsWith(n+rn.sep)||r===n?rn.relative(n,r):e}function jo(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return t+`
4
+ `+e+(e.endsWith(`
5
+ `)?``:`
6
+ `)+t}function Mo(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let e=i?.command??`Terminal`,t=i?.description;return{title:e,kind:`execute`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Read`:{let e=i?.file_path,t=e??`File`,r=i?.offset,a=i?.limit,o=``;a&&a>0?o=` (${r??1} - ${(r??1)+a-1})`:r&&(o=` (from line ${r})`);let s=t?Ao(t,n):`File`,c=Co(e,n);return{title:`Read ${s}${o}`,kind:`read`,locations:c?[{path:c,line:r??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Ao(e,n):void 0,a=Co(e,n);return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:a?[{type:`diff`,path:a,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:a?[{path:a}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Ao(e,n):void 0,o=Co(e,n);return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:o?[{type:`diff`,path:o,oldText:t||null,newText:r}]:[],locations:o?[{path:o}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,r=Co(e,n),a=`Find`;return e&&(a+=` \`${e}\``),t&&(a+=` \`${t}\``),{title:a,kind:`search`,content:[],locations:r?[{path:r}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`WebFetch`:{let e=i?.url??``,t=i?.prompt;return{title:e?`Fetch ${e}`:`Fetch`,kind:`fetch`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`WebSearch`:{let e=`"${i?.query??`Web search`}"`,t=i?.allowed_domains,n=i?.blocked_domains;return t&&t.length>0&&(e+=` (allowed: ${t.join(`, `)})`),n&&n.length>0&&(e+=` (blocked: ${n.join(`, `)})`),{title:e,kind:`fetch`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function No(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Po(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Po(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`resource_link`:{let t=e.uri;return{type:`resource_link`,uri:t,name:e.name??t,mimeType:e.mimeType}}case`resource`:{let t=e.resource;return{type:`resource`,resource:{uri:t?.uri??``,mimeType:t?.mimeType,...typeof t?.text==`string`?{text:t.text}:{},...typeof t?.blob==`string`?{blob:t.blob}:{}}}}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_search_result`:return n(`${e.title} (${e.url})`);case`web_search_tool_result_error`:return n(`Error: ${e.error_code}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
7
+ `)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function Fo(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return No(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:jo(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:jo(e.text)}:Po(e,!1)}))}:{};case`Bash`:{let e=``;if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
8
+ `)}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
9
+ `));return e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return No(i??``,r)}}function Io(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}function Lo(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:{let e=i.thinking??``;a={sessionUpdate:`agent_thought_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:Io(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,status:`in_progress`,rawInput:e,...Mo({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Mo({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=Fo(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function Ro(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,...i?.messageId?{messageId:i.messageId}:{},content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:Lo(s,`assistant`,t,n,r,void 0,i)}function zo(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?Lo([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`content_block_delta`:{let o=a.delta;return o?Lo([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function Bo(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function Vo(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=Bo(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}var Ho=console;function Uo(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Wo(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5,p=!1,m=null;try{for(;!r.aborted;){let s=await Uo(t,r);if(s.done||r.aborted)break;let h=s.value;if(h==null)continue;let g=h;switch(g.type){case`system`:g.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
10
+
11
+ Compacting completed.`}}}));break;case`result`:{let t=g.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=g.modelUsage;if(i&&d){let e=Vo(i,d);e?.contextWindow&&(f=e.contextWindow)}u!==null&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:u,size:f}});let a=g.subtype,o=g.is_error;if(r.aborted){c=`cancelled`;break}switch(a){case`success`:{let e=g.stop_reason;c=e===`max_tokens`?`max_tokens`:e===`refusal`?`refusal`:`end_turn`,o&&(c=`end_turn`);break}case`error_during_execution`:c=g.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=g.parent_tool_use_id;t===null&&m===null&&(m=$t());let r=zo(g,e,i,n,{clientCapabilities:a,cwd:o,messageId:t===null?m??void 0:void 0});for(let e of r)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=g.message,r=g.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s;r===null&&(m===null&&(m=$t()),s=m);let c=Ro(g,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p,messageId:s});for(let e of c)await n.sessionUpdate(e);r===null&&(m=null);break}case`user`:break;case`progress`:{let t=g.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
12
+
13
+ Compacting completed.`}}});break;default:Ho.debug(`Ignoring unknown SDK message type`);break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}async function Go(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){Ho.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;let t=$t();await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,...t?{messageId:t}:{},content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=Lo(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a,messageId:$t()});for(let e of t)await n.sessionUpdate(e)}}}function Ko(e,t,n,r,i,a,o,s){return async(n,c,l,u,d,f)=>{let p=Jo(r);if(n.name===`ExitPlanMode`)return qo(e,t,d,c,p,i,a,o,s);if(f!==void 0)return f;try{let e=await Ie(n,c,l,u,d);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:d}}let m=Mo({name:n.name,id:d,input:c},p,i),h={toolCallId:d,title:m.title,kind:m.kind,status:`pending`,rawInput:c},g=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`},{kind:`reject_always`,name:`Always Reject`,optionId:`reject_always`}];try{let n=await e.requestPermission({sessionId:t,toolCall:h,options:g});if(n.outcome.outcome===`cancelled`)return s?.(),{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`},toolUseID:d};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:c}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function qo(e,t,n,r,i,a,o,s,c){let l=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&l.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let u=Mo({name:`ExitPlanMode`,id:n,input:r},i,a),d={toolCallId:n,title:u.title,kind:u.kind,status:`pending`,rawInput:r},f=await e.requestPermission({sessionId:t,toolCall:d,options:l});if(f.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(f.outcome.outcome===`selected`&&`optionId`in f.outcome&&f.outcome.optionId!==void 0){let n=f.outcome.optionId;if(l.some(e=>e.optionId===n)&&(n===`default`||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function Jo(e){if(!e)return!1;if(e.terminal===!0)return!0;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}Ht(),L(),i(),Ye(),rt();var Yo=class{constructor(e){a(this,`conn`,void 0),a(this,`sessions`,new Map),a(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,authMethods:[],agentInfo:{name:`claude-code`,title:`Claude Code`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0,forkSession:!0}},promptCapabilities:{image:!1,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{list:{},resume:{},close:{},delete:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession({...e,replay:!1});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){if(e.cursor!==void 0&&e.cursor!==null)throw Error(`Pagination cursor not supported: listSessions returns all results in a single page.`);let t=e.cwd||re(),n=await Oe(t),r=await ct({dir:t}),i=[];for(let e of r){if(!e.cwd||await Oe(e.cwd)!==n)continue;let t=ko(e.summary??``);i.push({sessionId:e.sessionId,cwd:e.cwd,...t?{title:t}:{},updatedAt:new Date(e.lastModified).toISOString()})}return{sessions:i}}async unstable_forkSession(e){let{initialMessages:t}=await Xo(e.sessionId),n=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{initialMessages:t});return this.scheduleAvailableCommandsUpdate(n.sessionId),n}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async unstable_deleteSession(e){let t=await I(e.sessionId);if(t)try{await nn(t.filePath)}catch(e){if(e.code!==`ENOENT`)throw e}return this.sessions.has(e.sessionId)&&await this.teardownSession(e.sessionId),{}}async extMethod(e,t){if(e===`session/delete`){let e=t.sessionId;if(typeof e!=`string`||e.length===0)throw Error(`session/delete requires a non-empty sessionId`);return this.unstable_deleteSession({sessionId:e})}throw $.methodNotFound(e)}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:e.modeId}}),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}};async function Xo(e){let t;try{let n=await tt(e);n&&n.messages.length>0&&(t=R(n.messages))}catch(e){console.error(`[ACP] fork source load failed:`,e)}return{initialMessages:t}}var Zo=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function Qo(e){return Zo.includes(e)}function $o(e,t,n){if(t){let t=es(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!rs())throw Error(`Mode not available: bypassPermissions cannot run as root (start the agent as a non-root user, or set IS_SANDBOX=1).`);return t}return ts(n)??`default`}function es(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return Eo(e,t)}function ts(e){if(e!=null)try{return Eo(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function ns(e,t){return!!e&&Object.hasOwn(e,t)}function rs(){return is()}function is(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid==`function`?process.getuid()!==0:!0}function as(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}function os(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(Array.isArray(e.options))for(let n of e.options)n&&typeof n==`object`&&typeof n.value==`string`&&t.push(n.value);else typeof n.value==`string`&&t.push(n.value)}return t}function ss(e){return e.conn}function cs(e){return e.clientCapabilities}function ls(e,t,n,r){n===`mode`?t.modes={...t.modes,currentModeId:r}:n===`model`&&(t.models={...t.models,currentModelId:r})}ke(),jt(),O(),M(),Lt(),fe();function us(){return he().permissions?.defaultMode}async function ds(e,t={}){ve();let n=t.sessionId??$t(),r=e.cwd;ae(n,se()),k(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}be(),ze();try{let i=Ue(),a=Le(i),o=e._meta,s=ns(o,`permissionMode`),c=$o(s?o?.permissionMode:void 0,s,us()),l=cs(this),u=this.conn,d=Ko(u,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,l,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),f=rs(),p={...B(),toolPermissionContext:{...i,mode:c,isBypassPermissionsModeAvailable:f}},[m,h]=await Promise.all([He(r),mt(r)]);p.agentDefinitions=h;let g=new So({cwd:r,tools:a,commands:m,mcpClients:[],agents:h.activeAgents,canUseTool:d,getAppState:()=>p,setAppState:e=>{let t=e(p);Object.assign(p,t)},readFileCache:new Rt(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),_={currentModeId:c,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},...f?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},v=Ut(),y=me(),b={availableModels:v.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:y};g.setModel(y);let x=as(_,b),ee={queryEngine:g,cancelled:!1,cancelGeneration:0,cwd:r,modes:_,models:b,configOptions:x,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:l,appState:p,commands:m,sessionFingerprint:Do({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,ee),{sessionId:n,modes:_,models:b,configOptions:x}}finally{a&&process.chdir(i)}}Object.assign(Yo.prototype,{createSession:ds}),Ye(),rt(),O(),De();async function fs(e){let t=e.replay!==!1,n=this.sessions.get(e.sessionId);if(n){if(Do({cwd:e.cwd,mcpServers:e.mcpServers})===n.sessionFingerprint){let r=await I(e.sessionId,e.cwd);return ae(e.sessionId,r?Qt(r.filePath):null),k(e.cwd),t&&await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:n.modes,models:n.models,configOptions:n.configOptions}}await this.teardownSession(e.sessionId)}let r=await I(e.sessionId,e.cwd),i=r?Qt(r.filePath):null;ae(e.sessionId,i),k(e.cwd);let a;if(r)try{let t=await tt(e.sessionId);t&&t.messages.length>0&&(a=R(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let o=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:a});if(t&&a&&a.length>0){let t=this.sessions.get(e.sessionId);t&&await Go(e.sessionId,a,ss(this),t.toolUseCache,cs(this),t.cwd)}return{sessionId:o.sessionId,modes:o.modes,models:o.models,configOptions:o.configOptions}}async function ps(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async function ms(e){try{let t=await tt(e.sessionId);if(!t||t.messages.length===0)return;let n=R(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await Go(e.sessionId,n,ss(this),r.toolUseCache,cs(this),r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}function hs(e,t){if(!Qo(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async function gs(e,t,n){let r=this.sessions.get(e);r&&(ls(this,r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await ss(this).sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}Object.assign(Yo.prototype,{getOrCreateSession:fs,teardownSession:ps,replaySessionHistory:ms,applySessionMode:hs,updateConfigOption:gs});function _s(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(vs(n,r))}else if(e.type===`resource`){let n=e.resource;if(n&&typeof n.text==`string`)t.push(n.text);else if(n&&typeof n.blob==`string`){let e=typeof n.mimeType==`string`?n.mimeType:`application/octet-stream`,r=typeof n.uri==`string`?n.uri:`(unknown uri)`;t.push(`Embedded resource: ${r} (${e}, base64 blob, ${n.blob.length} chars)`)}}}return t.filter(e=>e.length>0).join(`
14
+ `)}function vs(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}function ys(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),bs(e),n}bs(e)}function bs(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}O();async function xs(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=e.messageId??void 0,r=_s(e.prompt);if(!r.trim())throw Error(`Prompt content is empty`);let i=t.cancelGeneration;if(t.promptRunning){let e=$t();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==i)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),ae(e.sessionId,se());let i=t.queryEngine.submitMessage(r),{stopReason:a,usage:o}=await Wo(e.sessionId,i,ss(this),t.queryEngine.getAbortSignal(),t.toolUseCache,cs(this),t.cwd,()=>t.cancelled);if(t.cancelled)return{stopReason:`cancelled`};if(await Cs(this,e.sessionId,r),o){let e={inputTokens:o.inputTokens,outputTokens:o.outputTokens,cachedReadTokens:o.cachedReadTokens,cachedWriteTokens:o.cachedWriteTokens,thoughtTokens:0,totalTokens:o.inputTokens+o.outputTokens+o.cachedReadTokens+o.cachedWriteTokens+0};return{stopReason:a,usage:e,...n?{userMessageId:n}:{},_meta:{claudeCode:{usage:e}}}}return{stopReason:a,...n?{userMessageId:n}:{}}}catch(n){let r=n instanceof Error&&(n.name===`AbortError`||/abort|cancelled|interrupt/i.test(n.message));if(t.cancelled||r)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(await this.teardownSession(e.sessionId),Error(`The Claude Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=ys(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async function Ss(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);let n=t.configOptions.find(t=>t.id===e.configId);if(!n)throw Error(`Unknown config option: ${e.configId}`);if(n.type===`select`){let t=os(n.options);if(!t.includes(e.value))throw Error(`Invalid value '${e.value}' for config option ${e.configId}; must be one of: ${t.join(`, `)}`)}let r=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,r),await ss(this).sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:r}})):e.configId===`model`&&t.queryEngine.setModel(r),ls(this,t,e.configId,r),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:r}:t),{configOptions:t.configOptions}}async function Cs(e,t,n){let r=e.sessions.get(t);if(!r)return;let i=r.toolUseCache;if(i.__sessionInfoTitleSent)return;i.__sessionInfoTitleSent=!0;let a=ko(n).slice(0,100);try{await ss(e).sessionUpdate({sessionId:t,update:{sessionUpdate:`session_info_update`,...a?{title:a}:{},updatedAt:new Date().toISOString()}})}catch(e){console.error(`[ACP] Failed to send session_info_update:`,e)}}Object.assign(Yo.prototype,{prompt:xs,setSessionConfigOption:Ss}),M(),Ve();function ws(e,t){let n=en.toWeb(e);return Za(tn.toWeb(t),n)}async function Ts(){ve(),ze();let e=ws(process.stdin,process.stdout),t,n=new $a(e=>(t=new Yo(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{Ts as runAcpAgent};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{n as r,s as i,u as a}from"./envUtils-CFG7IQID.js";import{_ as o,h as s}from"./debug-CjIaNjpK.js";import{n as c,t as l}from"./which-C0ex-06E.js";import{c as u,u as d}from"./oauth-DMPGYAoZ.js";import{r as f,t as p}from"./bundledMode-DQNSSQbt.js";import{n as m,t as h}from"./findExecutable-D8vJrFnO.js";import{homedir as g}from"os";import{join as _}from"path";async function v(e){try{return!!await c(e)}catch{return!1}}function y(){return process.env.__CFBundleIdentifier===`com.conductor.app`}function b(){if(process.env.CURSOR_TRACE_ID||process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`cursor`))return`cursor`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`windsurf`))return`windsurf`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`antigravity`))return`antigravity`;let e=process.env.__CFBundleIdentifier?.toLowerCase();if(e?.includes(`vscodium`))return`codium`;if(e?.includes(`windsurf`))return`windsurf`;if(e?.includes(`com.google.android.studio`))return`androidstudio`;if(e){for(let t of k)if(e.includes(t))return t}if(process.env.VisualStudioVersion)return`visualstudio`;if(process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`)return process.platform,`pycharm`;if(process.env.TERM===`xterm-ghostty`)return`ghostty`;if(process.env.TERM?.includes(`kitty`))return`kitty`;if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return`tmux`;if(process.env.STY)return`screen`;if(process.env.KONSOLE_VERSION)return`konsole`;if(process.env.GNOME_TERMINAL_SERVICE)return`gnome-terminal`;if(process.env.XTERM_VERSION)return`xterm`;if(process.env.VTE_VERSION)return`vte-based`;if(process.env.TERMINATOR_UUID)return`terminator`;if(process.env.KITTY_WINDOW_ID)return`kitty`;if(process.env.ALACRITTY_LOG)return`alacritty`;if(process.env.TILIX_ID)return`tilix`;if(process.env.WT_SESSION)return`windows-terminal`;if(process.env.SESSIONNAME&&process.env.TERM===`cygwin`)return`cygwin`;if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return`conemu`;if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(x())return`ssh-session`;if(process.env.TERM){let e=process.env.TERM;return e.includes(`alacritty`)?`alacritty`:e.includes(`rxvt`)?`rxvt`:e.includes(`termite`)?`termite`:process.env.TERM}return process.stdout.isTTY?null:`non-interactive`}function x(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function S(){let e=process.env.CLAUDE_CODE_HOST_PLATFORM;return e===`win32`||e===`darwin`||e===`linux`?e:j.platform}var C,w,T,E,D,O,k,A,j,M=e((()=>{n(),d(),p(),i(),m(),o(),l(),C=t(()=>{if(s().existsSync(_(r(),`.config.json`)))return _(r(),`.config.json`);let e=`.zaniicode${u()}.json`;return _(process.env.CLAUDE_CONFIG_DIR||g(),e)}),w=t(async()=>{try{let{default:e}=await import(`./axios-DPuSPBlH.js`);return await e.head(`http://1.1.1.1`,{signal:AbortSignal.timeout(1e3)}),!0}catch{return!1}}),T=t(async()=>{let e=[];return await v(`npm`)&&e.push(`npm`),await v(`yarn`)&&e.push(`yarn`),await v(`pnpm`)&&e.push(`pnpm`),e}),E=t(async()=>{let e=[];return await v(`bun`)&&e.push(`bun`),await v(`deno`)&&e.push(`deno`),await v(`node`)&&e.push(`node`),e}),D=t(()=>{try{return s().existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)}catch{return!1}}),O=t(()=>{try{if(!D())return!1;let{cmd:e}=h(`npm`,[]);return e.startsWith(`/mnt/c/`)}catch{return!1}}),k=[`pycharm`,`intellij`,`webstorm`,`phpstorm`,`rubymine`,`clion`,`goland`,`rider`,`datagrip`,`appcode`,`dataspell`,`aqua`,`gateway`,`fleet`,`jetbrains`,`androidstudio`],A=t(()=>{if(a(process.env.CODESPACES))return`codespaces`;if(process.env.GITPOD_WORKSPACE_ID)return`gitpod`;if(process.env.REPL_ID||process.env.REPL_SLUG)return`replit`;if(process.env.PROJECT_DOMAIN)return`glitch`;if(a(process.env.VERCEL))return`vercel`;if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return`railway`;if(a(process.env.RENDER))return`render`;if(a(process.env.NETLIFY))return`netlify`;if(process.env.DYNO)return`heroku`;if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return`fly.io`;if(a(process.env.CF_PAGES))return`cloudflare-pages`;if(process.env.DENO_DEPLOYMENT_ID)return`deno-deploy`;if(process.env.AWS_LAMBDA_FUNCTION_NAME)return`aws-lambda`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_FARGATE`)return`aws-fargate`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_EC2`)return`aws-ecs`;try{if(s().readFileSync(`/sys/hypervisor/uuid`,{encoding:`utf8`}).trim().toLowerCase().startsWith(`ec2`))return`aws-ec2`}catch{}if(process.env.K_SERVICE)return`gcp-cloud-run`;if(process.env.GOOGLE_CLOUD_PROJECT)return`gcp`;if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return`azure-app-service`;if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return`azure-functions`;if(process.env.APP_URL?.includes(`ondigitalocean.app`))return`digitalocean-app-platform`;if(process.env.SPACE_CREATOR_USER_ID)return`huggingface-spaces`;if(a(process.env.GITHUB_ACTIONS))return`github-actions`;if(a(process.env.GITLAB_CI))return`gitlab-ci`;if(process.env.CIRCLECI)return`circleci`;if(process.env.BUILDKITE)return`buildkite`;if(a(process.env.CI))return`ci`;if(process.env.KUBERNETES_SERVICE_HOST)return`kubernetes`;try{if(s().existsSync(`/.dockerenv`))return`docker`}catch{}return j.platform===`darwin`?`unknown-darwin`:j.platform===`linux`?`unknown-linux`:j.platform===`win32`?`unknown-win32`:`unknown`}),j={hasInternetAccess:w,isCI:a(process.env.CI),platform:[`win32`,`darwin`].includes(process.platform)?process.platform:`linux`,arch:process.arch,nodeVersion:process.version,terminal:b(),isSSH:x,getPackageManagers:T,getRuntimes:E,isRunningWithBun:t(f),isWslEnvironment:D,isNpmFromWindowsPath:O,isConductor:y,detectDeploymentEnvironment:A}}));export{M as a,S as i,j as n,C as r,k as t};
@@ -0,0 +1 @@
1
+ import{a as e,i as t}from"./envLessBridgeConfig-DJ1Sts3F.js";t();export{e as shouldShowAppUpgradeMessage};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,kt as r,wn as i}from"./schemas-Bwt-7U5W.js";import{t as a}from"./v4-DLhvDPkt.js";import{d as o,m as s}from"./growthbook-p4aJ_UMv.js";import{n as c,t as l}from"./lazySchema-2sOku3cX.js";import{i as u,r as d}from"./semver-D3lOjiBN.js";import{r as f,s as p}from"./bridgeEnabled-DKqmLnKO.js";async function m(){let e=await o(`tengu_bridge_repl_v2_config`,_),t=v().safeParse(e);return t.success?t.data:_}async function h(){let e=await m();return e.min_version&&u(`2.8.4`,e.min_version)?`Your version of Claude Code (2.8.4) is too old for Remote Control.\nVersion ${e.min_version} or higher is required. Run \`claude update\` to update.`:null}async function g(){return p()?(await m()).should_show_app_upgrade_message:!1}var _,v,y=e((()=>{a(),s(),l(),d(),f(),_={init_retry_max_attempts:3,init_retry_base_delay_ms:500,init_retry_jitter_fraction:.25,init_retry_max_delay_ms:4e3,http_timeout_ms:1e4,uuid_dedup_buffer_size:2e3,heartbeat_interval_ms:2e4,heartbeat_jitter_fraction:.1,token_refresh_buffer_ms:3e5,teardown_archive_timeout_ms:1500,connect_timeout_ms:15e3,min_version:`0.0.0`,should_show_app_upgrade_message:!1},v=c(()=>i({init_retry_max_attempts:t().int().min(1).max(10).default(3),init_retry_base_delay_ms:t().int().min(100).default(500),init_retry_jitter_fraction:t().min(0).max(1).default(.25),init_retry_max_delay_ms:t().int().min(500).default(4e3),http_timeout_ms:t().int().min(2e3).default(1e4),uuid_dedup_buffer_size:t().int().min(100).max(5e4).default(2e3),heartbeat_interval_ms:t().int().min(5e3).max(3e4).default(2e4),heartbeat_jitter_fraction:t().min(0).max(.5).default(.1),token_refresh_buffer_ms:t().int().min(3e4).max(18e5).default(3e5),teardown_archive_timeout_ms:t().int().min(500).max(2e3).default(1500),connect_timeout_ms:t().int().min(5e3).max(6e4).default(15e3),min_version:n().refine(e=>{try{return u(e,`0.0.0`),!0}catch{return!1}}).default(`0.0.0`),should_show_app_upgrade_message:r().default(!1)}))}));export{g as a,y as i,h as n,m as r,_ as t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,t as a}from"./protectedNamespace-Cn4901XG.js";import{homedir as o}from"os";import{join as s}from"path";function c(){return s(y(),`teams`)}function l(e){let t=process.env.NODE_OPTIONS;return t?t.split(/\s+/).includes(e):!1}function u(e){if(!e)return!1;if(typeof e==`boolean`)return e;let t=e.toLowerCase().trim();return[`1`,`true`,`yes`,`on`].includes(t)}function d(e){if(e===void 0)return!1;if(typeof e==`boolean`)return!e;if(!e)return!1;let t=e.toLowerCase().trim();return[`0`,`false`,`no`,`off`].includes(t)}function f(){return u(process.env.CLAUDE_CODE_SIMPLE)||process.argv.includes(`--bare`)}function p(e){let t={};if(e)for(let n of e){let[e,...r]=n.split(`=`);if(!e||r.length===0)throw Error(`Invalid environment variable format: ${n}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);t[e]=r.join(`=`)}return t}function m(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||`us-east-1`}function h(){return process.env.CLOUD_ML_REGION||`us-east5`}function g(){return process.env.USER_TYPE===`ant`&&u(process.env.COO_RUNNING_ON_HOMESPACE)}function _(){return process.env.USER_TYPE===`ant`?(a(),e(i)).checkProtectedNamespace():!1}function v(e){if(e){let t=b.find(([t])=>e.startsWith(t));if(t)return process.env[t[1]]||h()}return h()}var y,b,x=t((()=>{r(),y=n(()=>(process.env.CLAUDE_CONFIG_DIR??s(o(),`.zaniicode`)).normalize(`NFC`),()=>process.env.CLAUDE_CONFIG_DIR),b=[[`claude-haiku-4-5`,`VERTEX_REGION_CLAUDE_HAIKU_4_5`],[`claude-3-5-haiku`,`VERTEX_REGION_CLAUDE_3_5_HAIKU`],[`claude-3-5-sonnet`,`VERTEX_REGION_CLAUDE_3_5_SONNET`],[`claude-3-7-sonnet`,`VERTEX_REGION_CLAUDE_3_7_SONNET`],[`claude-opus-4-1`,`VERTEX_REGION_CLAUDE_4_1_OPUS`],[`claude-opus-4`,`VERTEX_REGION_CLAUDE_4_0_OPUS`],[`claude-sonnet-4-6`,`VERTEX_REGION_CLAUDE_4_6_SONNET`],[`claude-sonnet-4-5`,`VERTEX_REGION_CLAUDE_4_5_SONNET`],[`claude-sonnet-4`,`VERTEX_REGION_CLAUDE_4_0_SONNET`]]}));export{v as a,f as c,_ as d,g as f,c as i,d as l,y as n,l as o,p,h as r,x as s,m as t,u};
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./axios-Zh7qGPze.js";import{Ht as n,at as r}from"./state-CUZTq6r0.js";import{$ as i,E as a,O as o,Q as s,_ as c,h as l,l as u,nt as d,p as f,tt as p}from"./debug-CjIaNjpK.js";import{l as m,u as h}from"./privacyLevel-CRCHhztk.js";import{o as g,r as _,t as v}from"./log-DVv8YiNo.js";import{i as y,t as b}from"./sentry-ySzRCXGd.js";import{dirname as x,join as S}from"path";t(),n(),d(),h(),s(),u(),c(),g(),a(),y();var C=_(new Date);function w(){return S(m.errors(),C+`.jsonl`)}function T(e){return S(m.mcpLogs(e),C+`.jsonl`)}function E(e){let t=p(e);return{write(e){t.write(o(e)+`
2
+ `)},flush:t.flush,dispose:t.dispose}}var D=new Map;function O(e){let t=D.get(e);if(!t){let n=x(e);t=E({writeFn:t=>{try{l().appendFileSync(e,t)}catch{l().mkdirSync(n),l().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),D.set(e,t),i(async()=>t?.dispose())}return t}function k(e,t){if(process.env.USER_TYPE!==`ant`)return;let n={timestamp:new Date().toISOString(),...t,cwd:l().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`2.8.4`};O(e).write(n)}function A(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function j(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=A(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}f(`${t.name}: ${r}${n}`,{level:`error`}),k(w(),{error:`${r}${n}`}),b(t)}function M(e,t){f(`MCP server "${e}" ${t}`,{level:`error`});let n=T(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:l().cwd()};O(n).write(i)}function N(e,t){f(`MCP server "${e}": ${t}`);let n=T(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:l().cwd()};O(n).write(i)}function P(){v({logError:j,logMCPError:M,logMCPDebug:N,getErrorsPath:w,getMCPLogsPath:T}),f(`Error log sink initialized`)}export{P as t};