claude-code-best 2.5.0 → 2.6.5

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 (614) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-BYyM_V0q.js +1 -0
  2. package/dist/chunks/App-BboadKdn.js +1 -0
  3. package/dist/chunks/ApproveApiKey-BLp4742y.js +1 -0
  4. package/dist/chunks/ApproveApiKey-DiEe4eui.js +1 -0
  5. package/dist/chunks/AssistantSessionChooser-B88DM0Oq.js +1 -0
  6. package/dist/chunks/BackgroundTasksDialog-ByraVuXh.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-BDvmz12S.js +1 -0
  8. package/dist/chunks/ClaudeInChromeOnboarding-B6XNhFqq.js +1 -0
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-B4ocUjev.js +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-BNhlq7_K.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-BvaB9b0y.js +1 -0
  12. package/dist/chunks/DesktopHandoff-S-w4bs5T.js +1 -0
  13. package/dist/chunks/DevChannelsDialog-BljR0X9X.js +1 -0
  14. package/dist/chunks/Dialog-DYFGqyDs.js +1 -0
  15. package/dist/chunks/DiffDialog-BhQ2QaLW.js +3 -0
  16. package/dist/chunks/Doctor-BXb0qv6n.js +3 -0
  17. package/dist/chunks/Doctor-C5DYPEGl.js +1 -0
  18. package/dist/chunks/ExitFlow-CSBDxw9H.js +2 -0
  19. package/dist/chunks/Feedback-DwHzc4UT.js +2 -0
  20. package/dist/chunks/Grove-DSXRnXKv.js +11 -0
  21. package/dist/chunks/Grove-DnTo982-.js +1 -0
  22. package/dist/chunks/HybridTransport-CuT3KI5e.js +4 -0
  23. package/dist/chunks/ITermBackend-mokGZVH_.js +1 -0
  24. package/dist/chunks/InProcessTransport-DB52dh4f.js +1 -0
  25. package/dist/chunks/InvalidConfigDialog-Bi4RKYlk.js +1 -0
  26. package/dist/chunks/InvalidSettingsDialog-0zKo4-so.js +1 -0
  27. package/dist/chunks/ListItem-OFARanN7.js +1 -0
  28. package/dist/chunks/MCPConnectionManager-DYGoS1Ht.js +1 -0
  29. package/dist/chunks/McpParsingWarnings-EzgsOoHw.js +1 -0
  30. package/dist/chunks/MessageSelector-DTmUuEKJ.js +3 -0
  31. package/dist/chunks/Messages-DWiKTx5o.js +11 -0
  32. package/dist/chunks/Onboarding-odmthwzz.js +1 -0
  33. package/dist/chunks/OverageCreditUpsell-Cpk_5Lv0.js +1 -0
  34. package/dist/chunks/PermissionDialog-5MlJf7ew.js +1 -0
  35. package/dist/chunks/PluginSettings-eYcWehI8.js +17 -0
  36. package/dist/chunks/PressEnterToContinue-BdA9zDGs.js +1 -0
  37. package/dist/chunks/PromptInputFooterSuggestions-DrrkNOuS.js +1 -0
  38. package/dist/chunks/PromptInputHelpMenu-DMsF4D6d.js +1 -0
  39. package/dist/chunks/QueryEngine-C_KZts4y.js +1 -0
  40. package/dist/chunks/REPL-C6YR0VKU.js +1 -0
  41. package/dist/chunks/REPL-DzHz-LOY.js +97 -0
  42. package/dist/chunks/RemoteCallout-CnpCWRPk.js +1 -0
  43. package/dist/chunks/RemoteSessionManager-OWg_Yccq.js +2 -0
  44. package/dist/chunks/ResumeConversation-BktSnsCm.js +1 -0
  45. package/dist/chunks/SSETransport-BpnapvlK.js +4 -0
  46. package/dist/chunks/SearchBox-DfOmUoaI.js +1 -0
  47. package/dist/chunks/SearchExtraToolsTool-CqFD8vVS.js +1 -0
  48. package/dist/chunks/SentryErrorBoundary-BUirJRWU.js +1 -0
  49. package/dist/chunks/SentryErrorBoundary-C-NlfQZw.js +2 -0
  50. package/dist/chunks/Settings-vfFvcweR.js +2 -0
  51. package/dist/chunks/TeleportProgress-CYXay2ZL.js +1 -0
  52. package/dist/chunks/TeleportRepoMismatchDialog-_zbZTvcJ.js +1 -0
  53. package/dist/chunks/TeleportResumeWrapper-DiHQeZIM.js +1 -0
  54. package/dist/chunks/ThemePicker-BRh027fA.js +1 -0
  55. package/dist/chunks/TmuxBackend-BaX2U7iZ.js +9 -0
  56. package/dist/chunks/TrustDialog-CVbzrv6g.js +1 -0
  57. package/dist/chunks/TungstenTool-C5IqKVr0.js +1 -0
  58. package/dist/chunks/TungstenTool-V-Bwqlx3.js +1 -0
  59. package/dist/chunks/ValidationErrorsList-CdCUgfIl.js +2 -0
  60. package/dist/chunks/WelcomeV2-DCXcYd2x.js +1 -0
  61. package/dist/chunks/WindowsTerminalBackend-BE9NX5IH.js +2 -0
  62. package/dist/chunks/add-dir-ldGd3Ppz.js +1 -0
  63. package/dist/chunks/agentDisplay-CVnAeURF.js +1 -0
  64. package/dist/chunks/agents-C08NzRZx.js +2 -0
  65. package/dist/chunks/agents-DH5fmbVw.js +103 -0
  66. package/dist/chunks/ajv-B_OpU_Uh.js +8 -0
  67. package/dist/chunks/analytics-DqMQntaB.js +1 -0
  68. package/dist/chunks/ant-DJren1Aa.js +1 -0
  69. package/dist/chunks/api-6tcwJlf_.js +1 -0
  70. package/dist/chunks/api-CGOR_Xfl.js +1 -0
  71. package/dist/chunks/asciicast-aoKFhc7C.js +1 -0
  72. package/dist/chunks/asciicast-o5Zg4dJt.js +4 -0
  73. package/dist/chunks/assistant-BlzrMSkM.js +1 -0
  74. package/dist/chunks/assistant-CwbhlCM-.js +1 -0
  75. package/dist/chunks/assistant-aWkDcurV.js +1 -0
  76. package/dist/chunks/attributionHooks-PygdohOh.js +1 -0
  77. package/dist/chunks/attributionTrailer-BpvhXgRP.js +1 -0
  78. package/dist/chunks/auth-CSB2RDKF.js +1 -0
  79. package/dist/chunks/auth-GxZhOvQ1.js +1 -0
  80. package/dist/chunks/autoMode-CWvZs1jO.js +45 -0
  81. package/dist/chunks/autoModeDenials-Cp6VFdsm.js +1 -0
  82. package/dist/chunks/autonomy-BkVcSMCZ.js +19 -0
  83. package/dist/chunks/autonomy-DK42aJYt.js +1 -0
  84. package/dist/chunks/autonomyPanel-Cn4IhXgE.js +1 -0
  85. package/dist/chunks/axios-DLnc2dVy.js +1 -0
  86. package/dist/chunks/axios-DhfaybwJ.js +12 -0
  87. package/dist/chunks/backgroundHousekeeping-BIZTAYho.js +17 -0
  88. package/dist/chunks/backgroundHousekeeping-Csh58CxV.js +1 -0
  89. package/dist/chunks/banner-CVXH2xts.js +2 -0
  90. package/dist/chunks/base64-js-DIVSFswY.js +1 -0
  91. package/dist/chunks/bedrockClient-qi1-JCOK.js +15 -0
  92. package/dist/chunks/bg-DK0E4ZtW.js +9 -0
  93. package/dist/chunks/bg-Dbh5z3Y8.js +1 -0
  94. package/dist/chunks/branch-juox_fko.js +3 -0
  95. package/dist/chunks/break-cache-ByJ7U2Ts.js +8 -0
  96. package/dist/chunks/bridge-DudsCZkh.js +2 -0
  97. package/dist/chunks/bridgeConfig-D4tpc568.js +1 -0
  98. package/dist/chunks/bridgeConfig-lRZfQqmA.js +1 -0
  99. package/dist/chunks/bridgeEnabled-B8_c_Ppq.js +1 -0
  100. package/dist/chunks/bridgeEnabled-D2IykaHE.js +1 -0
  101. package/dist/chunks/bridgeMain-C5RDihlX.js +68 -0
  102. package/dist/chunks/bridgeMain-D7_lg2iJ.js +1 -0
  103. package/dist/chunks/bridgeMessaging-CqNURC4-.js +1 -0
  104. package/dist/chunks/bridgePointer-FvAMj3re.js +1 -0
  105. package/dist/chunks/browser-fLRXxIsQ.js +1 -0
  106. package/dist/chunks/btw-DKlE3Dea.js +1 -0
  107. package/dist/chunks/buddy-DQYgHR63.js +3 -0
  108. package/dist/chunks/bundledMode-kSQejuY4.js +1 -0
  109. package/dist/chunks/bypassPermissionsKillswitch-Bof-UtM-.js +1 -0
  110. package/dist/chunks/caches-B5QZDncQ.js +3 -0
  111. package/dist/chunks/caches-dGk7xsDu.js +1 -0
  112. package/dist/chunks/capacityWake-BXlUpptF.js +1 -0
  113. package/dist/chunks/ccrClient-BaWg4E9-.js +1 -0
  114. package/dist/chunks/ccshareResume-DWLjTF22.js +1 -0
  115. package/dist/chunks/changeDetector-DoLfg8a6.js +1 -0
  116. package/dist/chunks/channelNotification-B7A-9DIl.js +1 -0
  117. package/dist/chunks/channelNotification-DDErroWn.js +1 -0
  118. package/dist/chunks/chokidar-BcI3rIKm.js +1 -0
  119. package/dist/chunks/chokidar-SzksMqYp.js +1 -0
  120. package/dist/chunks/chrome-jMAks7-w.js +1 -0
  121. package/dist/chunks/chromeNativeHost-4U39yLtd.js +1 -0
  122. package/dist/chunks/chunk-DR8-3Aex.js +1 -0
  123. package/dist/chunks/classPrivateFieldSet2-EAQNhHs8.js +1 -0
  124. package/dist/chunks/claudeDesktop-D0S1eq1F.js +1 -0
  125. package/dist/chunks/cleanup-Bg_gFgcj.js +1 -0
  126. package/dist/chunks/clear-OudnCGa7.js +1 -0
  127. package/dist/chunks/cliLaunch-BQa48gsr.js +1 -0
  128. package/dist/chunks/client-CPn1wQyc.js +7 -0
  129. package/dist/chunks/client-DxDmXXTh.js +1 -0
  130. package/dist/chunks/client-_sjL0I7A.js +35 -0
  131. package/dist/chunks/color-DG_R5-hl.js +1 -0
  132. package/dist/chunks/color-convert-ULbeSgNC.js +1 -0
  133. package/dist/chunks/commands-BWIOEBPs.js +1 -0
  134. package/dist/chunks/commitAttribution-BA4fcbHf.js +1 -0
  135. package/dist/chunks/commitAttribution-C22a3OCi.js +2 -0
  136. package/dist/chunks/common-B379wT22.js +1 -0
  137. package/dist/chunks/common-B_BC3eMY.js +1 -0
  138. package/dist/chunks/common-CMCv4N_v.js +1 -0
  139. package/dist/chunks/compact-BWvnb4or.js +3 -0
  140. package/dist/chunks/companion-Bkn2lSLj.js +1 -0
  141. package/dist/chunks/completionCache-DHfUBBMH.js +1 -0
  142. package/dist/chunks/completionCache-DORrtxkS.js +4 -0
  143. package/dist/chunks/computerUseLock-BjoDJH2h.js +1 -0
  144. package/dist/chunks/config-BvpTbJ5p.js +1 -0
  145. package/dist/chunks/config-D-dzD6n-.js +1 -0
  146. package/dist/chunks/connectHeadless-CwsFt-Mh.js +1 -0
  147. package/dist/chunks/constants-41VpZw2G.js +1 -0
  148. package/dist/chunks/context-DzNahdyP.js +1 -0
  149. package/dist/chunks/context-noninteractive-CM1-lUSe.js +1 -0
  150. package/dist/chunks/context-noninteractive-yiyJriiw.js +54 -0
  151. package/dist/chunks/controlMessageCompat-BJhFiS7u.js +1 -0
  152. package/dist/chunks/conversation-DKlz47xf.js +1 -0
  153. package/dist/chunks/conversation-cUxdb8MN.js +1 -0
  154. package/dist/chunks/copy-9k9JPRqW.js +7 -0
  155. package/dist/chunks/createSSHSession-BZf-Loo5.js +6 -0
  156. package/dist/chunks/createSession-BuJcoBAj.js +1 -0
  157. package/dist/chunks/createSession-kiTHYXSL.js +1 -0
  158. package/dist/chunks/cron-DiW7eIPP.js +1 -0
  159. package/dist/chunks/cronJitterConfig-CYP7yrQu.js +6 -0
  160. package/dist/chunks/crossProjectResume-BJisir9Z.js +40 -0
  161. package/dist/chunks/cwd--iizewsn.js +1 -0
  162. package/dist/chunks/cwd-BgpSJxd7.js +1 -0
  163. package/dist/chunks/daemon-VYRit6Aq.js +2 -0
  164. package/dist/chunks/dangerousBackend-BU_PHGR2.js +1 -0
  165. package/dist/chunks/datadog-Bg-zL-i7.js +1 -0
  166. package/dist/chunks/datadog-CVeFkaQu.js +1 -0
  167. package/dist/chunks/debug-DM5ezCBS.js +1 -0
  168. package/dist/chunks/debug-UI3T040K.js +5 -0
  169. package/dist/chunks/debugUtils-BBMFODKH.js +1 -0
  170. package/dist/chunks/defineProperty-80gRi2ZW.js +1 -0
  171. package/dist/chunks/desktop-DpaStjc-.js +1 -0
  172. package/dist/chunks/detached-D300jlhj.js +5 -0
  173. package/dist/chunks/detect-libc-DNuQfUvI.js +1 -0
  174. package/dist/chunks/detectRepository-CBk3S2zv.js +1 -0
  175. package/dist/chunks/detectRepository-DCTvg4p0.js +1 -0
  176. package/dist/chunks/detection-CQsNad64.js +1 -0
  177. package/dist/chunks/detection-DJ-vTbBf.js +1 -0
  178. package/dist/chunks/diff-N_VSBo3Z.js +1 -0
  179. package/dist/chunks/directoryCompletion-DP_4B1GL.js +1 -0
  180. package/dist/chunks/dist-CanSxOZ1.js +5 -0
  181. package/dist/chunks/dist-Cg1a1Exw.js +29 -0
  182. package/dist/chunks/dist-Q7YNoZ0H.js +20 -0
  183. package/dist/chunks/dist-es-4z5T3Jzm.js +1 -0
  184. package/dist/chunks/dist-es-B2jg52tM2.js +1 -0
  185. package/dist/chunks/dist-es-B6OXHQ1S.js +1 -0
  186. package/dist/chunks/dist-es-B8NEy5hc.js +1 -0
  187. package/dist/chunks/dist-es-BVGppqE4.js +1 -0
  188. package/dist/chunks/dist-es-Bcw5GZko.js +1 -0
  189. package/dist/chunks/dist-es-BoIJpncb.js +9 -0
  190. package/dist/chunks/dist-es-Bu_Fshi1.js +1 -0
  191. package/dist/chunks/dist-es-C-1vn4OP2.js +1 -0
  192. package/dist/chunks/dist-es-C41b_0B5.js +1 -0
  193. package/dist/chunks/dist-es-CCZYybbG2.js +1 -0
  194. package/dist/chunks/dist-es-CLK1mey-.js +1 -0
  195. package/dist/chunks/dist-es-CQz2aNf72.js +1 -0
  196. package/dist/chunks/dist-es-CSfI8B8l.js +1 -0
  197. package/dist/chunks/dist-es-CUZBYppo.js +1 -0
  198. package/dist/chunks/dist-es-CZkzHpjF.js +1 -0
  199. package/dist/chunks/dist-es-Cbf0_D8d.js +5 -0
  200. package/dist/chunks/dist-es-ChHe-SVL.js +1 -0
  201. package/dist/chunks/dist-es-ClYOf0My.js +1 -0
  202. package/dist/chunks/dist-es-D-kJbj4A2.js +1 -0
  203. package/dist/chunks/dist-es-D1LN6CJd.js +1 -0
  204. package/dist/chunks/dist-es-DC1sC3ph.js +1 -0
  205. package/dist/chunks/dist-es-DGn8uOwQ2.js +1 -0
  206. package/dist/chunks/dist-es-DK5fTeKM2.js +1 -0
  207. package/dist/chunks/dist-es-DN7otr6F.js +1 -0
  208. package/dist/chunks/dist-es-DPM0mPK5.js +1 -0
  209. package/dist/chunks/dist-es-DqZAh3nG.js +1 -0
  210. package/dist/chunks/dist-es-DuAZyxJ02.js +5 -0
  211. package/dist/chunks/dist-es-HVQrM0oE.js +1 -0
  212. package/dist/chunks/dist-es-OVleIB54.js +1 -0
  213. package/dist/chunks/dist-es-UAs0rdXg.js +1 -0
  214. package/dist/chunks/dist-es-WvMMuHmx2.js +1 -0
  215. package/dist/chunks/dist-es-fjXft-jH.js +1 -0
  216. package/dist/chunks/dist-es-hdN_ShpZ.js +3 -0
  217. package/dist/chunks/dist-es-neiUvMJb.js +1 -0
  218. package/dist/chunks/dist-es-yMYpDtui2.js +1 -0
  219. package/dist/chunks/dist-es-zjcbuB72.js +1 -0
  220. package/dist/chunks/distRoot-CcxmnzqQ.js +1 -0
  221. package/dist/chunks/doctor-CUWjbh1X.js +1 -0
  222. package/dist/chunks/earlyInput-JGJo1zcC.js +1 -0
  223. package/dist/chunks/earlyInput-tRkbxFv2.js +2 -0
  224. package/dist/chunks/effort-loH1TUvE.js +9 -0
  225. package/dist/chunks/entry-D58E-E6Y.js +14 -0
  226. package/dist/chunks/env-chR0gV31.js +1 -0
  227. package/dist/chunks/envLessBridgeConfig-CT8sdmFu.js +1 -0
  228. package/dist/chunks/envLessBridgeConfig-SPEr9oqO.js +1 -0
  229. package/dist/chunks/envUtils-BWeoiL4Y.js +1 -0
  230. package/dist/chunks/escHotkey-Cyz0yyh1.js +259 -0
  231. package/dist/chunks/esm--xjzB1hI.js +1 -0
  232. package/dist/chunks/esm-B2HIF0XY.js +1 -0
  233. package/dist/chunks/esm-BGQPWnJy.js +1 -0
  234. package/dist/chunks/esm-C-1qL9Mn.js +1 -0
  235. package/dist/chunks/esm-C3jcs1DH.js +1 -0
  236. package/dist/chunks/esm-C97WL9nC.js +1 -0
  237. package/dist/chunks/esm-CIL-SKM8.js +1 -0
  238. package/dist/chunks/esm-CJlBxjtx.js +1 -0
  239. package/dist/chunks/esm-CsGLyWmS.js +56 -0
  240. package/dist/chunks/esm-DQHmDm-H.js +1 -0
  241. package/dist/chunks/esm-DcdOXSzi.js +1 -0
  242. package/dist/chunks/esm-DhNYgGTV.js +1 -0
  243. package/dist/chunks/esm-DxPW7qPs.js +1 -0
  244. package/dist/chunks/esm-FBUWr3vI.js +1 -0
  245. package/dist/chunks/esm-QgL6y---.js +10 -0
  246. package/dist/chunks/esm-v0kPjgVS.js +1 -0
  247. package/dist/chunks/esm-vIn-YV_h.js +1 -0
  248. package/dist/chunks/event-streams-BV7ngMXu.js +1 -0
  249. package/dist/chunks/eventLoopStallDetector-Dnh1fc31.js +1 -0
  250. package/dist/chunks/execAsync-BkA6ogic.js +1 -0
  251. package/dist/chunks/execFileNoThrow-CuQN1sz8.js +1 -0
  252. package/dist/chunks/execSyncWrapper-C2XQnFVo.js +1 -0
  253. package/dist/chunks/execa-CGue6Z3n.js +34 -0
  254. package/dist/chunks/executor-4EeD8GNm.js +1561 -0
  255. package/dist/chunks/executor-BHEuNh5F.js +1 -0
  256. package/dist/chunks/exit-D-tuPpbx.js +1 -0
  257. package/dist/chunks/exit-_obETqBv.js +2 -0
  258. package/dist/chunks/export-BIZ_SPXJ.js +2 -0
  259. package/dist/chunks/exportRenderer-CWPSMaqM.js +1 -0
  260. package/dist/chunks/extra-usage-CCMwIa85.js +1 -0
  261. package/dist/chunks/extra-usage-core-BNW4VT7o.js +1 -0
  262. package/dist/chunks/extra-usage-noninteractive-B_WjXO1E.js +1 -0
  263. package/dist/chunks/extra-usage-rdJ7ecEb.js +1 -0
  264. package/dist/chunks/extraUsage-CNMMTNJi.js +1 -0
  265. package/dist/chunks/extractMemories-BrvZVsmM.js +1 -0
  266. package/dist/chunks/fast-CG1v3fRr.js +1 -0
  267. package/dist/chunks/fast-CLKKsx2H.js +1 -0
  268. package/dist/chunks/featureCheck-Cm0YNDXO.js +1 -0
  269. package/dist/chunks/featureCheck-p7OeCYzj.js +1 -0
  270. package/dist/chunks/feedback-CG4mS_-B.js +1 -0
  271. package/dist/chunks/figures-gfT9mM8P.js +1 -0
  272. package/dist/chunks/fileStateCache-C7-TxF8G.js +1 -0
  273. package/dist/chunks/files-DYvAZGxp.js +2 -0
  274. package/dist/chunks/firstPartyEventLogger-Y_jAnHoR.js +1 -0
  275. package/dist/chunks/flushGate-COPcye5f.js +1 -0
  276. package/dist/chunks/foundry-sdk-BFN5VDFQ.js +1 -0
  277. package/dist/chunks/fpsMetrics-DeezdcwV.js +1 -0
  278. package/dist/chunks/fuse-Ch_OAlm3.js +1 -0
  279. package/dist/chunks/gates-CSHuXnUx.js +1 -0
  280. package/dist/chunks/gates-CSKxLmMJ.js +1 -0
  281. package/dist/chunks/gemini-B3uSLiNp.js +1 -0
  282. package/dist/chunks/generateRecap-D7rG3jIm.js +1 -0
  283. package/dist/chunks/generateSessionName-zbqanivg.js +1 -0
  284. package/dist/chunks/genericProcessUtils-BGvcwuPt.js +23 -0
  285. package/dist/chunks/getMachineId-bsd-BMtYGBUL.js +1 -0
  286. package/dist/chunks/getMachineId-darwin-CiLdFH7z.js +2 -0
  287. package/dist/chunks/getMachineId-linux-Cr27rIeY.js +1 -0
  288. package/dist/chunks/getMachineId-unsupported-ceiBLwAN.js +1 -0
  289. package/dist/chunks/getMachineId-win-DFTmsQHq.js +1 -0
  290. package/dist/chunks/git-CN3qtTb_.js +6 -0
  291. package/dist/chunks/git-D23Mzu_K.js +1 -0
  292. package/dist/chunks/githubRepoPathMapping-B04nEUDG.js +1 -0
  293. package/dist/chunks/graceful-fs-Cgc0rjGF.js +2 -0
  294. package/dist/chunks/grok-CDOpos8E.js +1 -0
  295. package/dist/chunks/growthbook-C_EY78Sn.js +1 -0
  296. package/dist/chunks/hash-BRmOQc3c.js +1 -0
  297. package/dist/chunks/heapdump-CpmhJ55b.js +5 -0
  298. package/dist/chunks/help-EHn2neTv.js +1 -0
  299. package/dist/chunks/hooks-BFdX17Za.js +1 -0
  300. package/dist/chunks/hooks-BV6HqbU4.js +79 -0
  301. package/dist/chunks/hostAdapter-_SmFAVNf.js +1 -0
  302. package/dist/chunks/hostGuard-zim_4F9V.js +1 -0
  303. package/dist/chunks/httpAuthSchemes-Wq4XWeLL.js +13 -0
  304. package/dist/chunks/ide-DkN0KdTR.js +2 -0
  305. package/dist/chunks/inboundAttachments-BVUunfAX.js +1 -0
  306. package/dist/chunks/inboundAttachments-DnGQw7Pf.js +1 -0
  307. package/dist/chunks/index.min-BJnb9GQI.js +1 -0
  308. package/dist/chunks/initReplBridge-tPRGPBq7.js +1 -0
  309. package/dist/chunks/insights-Bs9kJDG6.js +822 -0
  310. package/dist/chunks/install-CFX_ph9z.js +1 -0
  311. package/dist/chunks/install-github-app-CvRjY1Wi.js +147 -0
  312. package/dist/chunks/install-slack-app-DjhnVSe0.js +1 -0
  313. package/dist/chunks/instinctParser-DHMa8xa0.js +1 -0
  314. package/dist/chunks/instrumentation-c5zlOWom.js +12 -0
  315. package/dist/chunks/intl-Pse97ORk.js +1 -0
  316. package/dist/chunks/isObject-DaxDnPKm.js +1 -0
  317. package/dist/chunks/isSymbol-Dp3irZaY.js +1 -0
  318. package/dist/chunks/job-3QwLq609.js +2 -0
  319. package/dist/chunks/json-bigint-OxRwRvup.js +8 -0
  320. package/dist/chunks/jsx-runtime-D-D469L8.js +1 -0
  321. package/dist/chunks/jws-2vqRyZtR.js +3 -0
  322. package/dist/chunks/jwtUtils-CpXwh_du.js +1 -0
  323. package/dist/chunks/keybindings-7mDm3UKD.js +2 -0
  324. package/dist/chunks/lang-DyyjY20G.js +1 -0
  325. package/dist/chunks/language-CPRGmY8Q.js +1 -0
  326. package/dist/chunks/language-Cf6bMI4N.js +1 -0
  327. package/dist/chunks/launchAgentsPlatform-CpsMsTqQ.js +1 -0
  328. package/dist/chunks/launchAutofixPr-D9h6YAZY.js +2 -0
  329. package/dist/chunks/launchCommand-Du91jxMC.js +1 -0
  330. package/dist/chunks/launchLocalMemory-DlYQcEQJ.js +3 -0
  331. package/dist/chunks/launchLocalVault-CP0AyPjj.js +3 -0
  332. package/dist/chunks/launchMemoryStores-BHoDFkJ5.js +1 -0
  333. package/dist/chunks/launchOnboarding-CFTNXcnc.js +8 -0
  334. package/dist/chunks/launchSchedule-5KQr6x_A.js +1 -0
  335. package/dist/chunks/launchSkillStore-D0yGuE68.js +1 -0
  336. package/dist/chunks/launchTeleport-DRKnXOwY.js +3 -0
  337. package/dist/chunks/launchVault-XA-zAswX.js +1 -0
  338. package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
  339. package/dist/chunks/lib-B4Q0Nrpb.js +14 -0
  340. package/dist/chunks/lib-Ca3QWJjN.js +2 -0
  341. package/dist/chunks/lib-inCisXen.js +8 -0
  342. package/dist/chunks/loadAgentsDir-DCyiY0MN.js +1 -0
  343. package/dist/chunks/loadAgentsDir-DI1a76pd.js +4601 -0
  344. package/dist/chunks/loadPluginHooks-C0Ei-0E2.js +1 -0
  345. package/dist/chunks/loadSso-sDs471GC.js +1 -0
  346. package/dist/chunks/localSearch-CDOJNc_E.js +1 -0
  347. package/dist/chunks/localSearch-MBx7KzC2.js +1 -0
  348. package/dist/chunks/lockfile-DBwdlC3K.js +1 -0
  349. package/dist/chunks/log-CzsijfHZ.js +1 -0
  350. package/dist/chunks/login-D8UKKaud.js +1 -0
  351. package/dist/chunks/login-nwTOoyxv.js +1 -0
  352. package/dist/chunks/logoV2Utils-DDUoPClc.js +1 -0
  353. package/dist/chunks/logout-B0BjqlGi.js +1 -0
  354. package/dist/chunks/magicDocs-CmUlOWjI.js +57 -0
  355. package/dist/chunks/main-C6be1KFk.js +31 -0
  356. package/dist/chunks/main-CeG_nUsC.js +1108 -0
  357. package/dist/chunks/mappers-CJ8IO1o1.js +1 -0
  358. package/dist/chunks/mcp-CanCqnch.js +2 -0
  359. package/dist/chunks/mcp-Dq0kxZFx.js +6 -0
  360. package/dist/chunks/mcp-zbxZM9BP.js +1 -0
  361. package/dist/chunks/mcpServer-DPHQVYdC.js +1 -0
  362. package/dist/chunks/mcpServer-lIneUZ5p.js +1 -0
  363. package/dist/chunks/memoize-DNnuA2aU.js +1 -0
  364. package/dist/chunks/memoize-DxwLawI2.js +1 -0
  365. package/dist/chunks/memory-BcWBkKV8.js +1 -0
  366. package/dist/chunks/mobile-umu5P0cM.js +2 -0
  367. package/dist/chunks/modalContext-CmSKRyea.js +1 -0
  368. package/dist/chunks/model-DJLzVvcF.js +1 -0
  369. package/dist/chunks/model-H3rtl6eR.js +1 -0
  370. package/dist/chunks/normalization-Cox8C0dP.js +1 -0
  371. package/dist/chunks/oauth-CdZEzMww.js +1 -0
  372. package/dist/chunks/oauth-CmensepG.js +1 -0
  373. package/dist/chunks/observationStore-tvkldXUo.js +4 -0
  374. package/dist/chunks/onChangeAppState-Dxbl8fvk.js +1 -0
  375. package/dist/chunks/open-CDditBQ-.js +1 -0
  376. package/dist/chunks/openai-DkYK4THc.js +10 -0
  377. package/dist/chunks/openaiShared-D5lOejS1.js +16 -0
  378. package/dist/chunks/output-style-XDb9-2Kk.js +1 -0
  379. package/dist/chunks/overageCreditGrant-DLKadMYU.js +1 -0
  380. package/dist/chunks/p-map-9Ud1LOrJ.js +1 -0
  381. package/dist/chunks/p-map-D7WEmnBE.js +1 -0
  382. package/dist/chunks/package-BhL7chzt.js +1 -0
  383. package/dist/chunks/panel-ByW1omJn.js +1 -0
  384. package/dist/chunks/panel-Bz_8td5D.js +1 -0
  385. package/dist/chunks/parseConnectUrl-BS6i9JPo.js +1 -0
  386. package/dist/chunks/parser-CmngCwjB.js +1 -0
  387. package/dist/chunks/parser-SWIZo39J.js +1 -0
  388. package/dist/chunks/passes-BIfuerjL.js +1 -0
  389. package/dist/chunks/path-C4kbwvSH.js +1 -0
  390. package/dist/chunks/paths-BBvuDQl9.js +39 -0
  391. package/dist/chunks/permissions-DXLfdE7b.js +1 -0
  392. package/dist/chunks/permissions-Ps_D01ZB.js +1 -0
  393. package/dist/chunks/permissions-S2EvIRKj.js +3 -0
  394. package/dist/chunks/pipeTransport-DVoIA1uN.js +1 -0
  395. package/dist/chunks/plan--lnWxB3Q.js +1 -0
  396. package/dist/chunks/platform-CuyedWpe.js +2 -0
  397. package/dist/chunks/plist-BO4ZqMZc.js +6 -0
  398. package/dist/chunks/plugin-DWLyrLw4.js +1 -0
  399. package/dist/chunks/pluginAutoupdate-CGXIWBrb.js +1 -0
  400. package/dist/chunks/pluginBlocklist-DJrMdzT0.js +1 -0
  401. package/dist/chunks/pluginCliCommands-C08q9dHk.js +1 -0
  402. package/dist/chunks/pluginFlagging-Dggxke70.js +1 -0
  403. package/dist/chunks/pluginOperations-CNCImIe8.js +2 -0
  404. package/dist/chunks/pluginStartupCheck-BW2fjg2P.js +1 -0
  405. package/dist/chunks/pluginStartupCheck-DpxQPXJE.js +1 -0
  406. package/dist/chunks/plugins-DQ3CRWWO.js +4 -0
  407. package/dist/chunks/policyLimits-BotYrS-v.js +1 -0
  408. package/dist/chunks/pollConfig-DAQ-ives.js +1 -0
  409. package/dist/chunks/poller-Ds0Y6Cir.js +1 -0
  410. package/dist/chunks/poor-DqfrQT61.js +1 -0
  411. package/dist/chunks/poorMode-DEAe3hiK.js +1 -0
  412. package/dist/chunks/poorMode-DzYT47KW.js +1 -0
  413. package/dist/chunks/postCommitAttribution-Ehmwzzuq.js +1 -0
  414. package/dist/chunks/print-GGVp62vj.js +39 -0
  415. package/dist/chunks/privacy-settings-agwqjYJo.js +1 -0
  416. package/dist/chunks/process-CWupreF6.js +1 -0
  417. package/dist/chunks/process-DMKLUQIO.js +1 -0
  418. package/dist/chunks/processBashCommand-DHHN8Ca4.js +1 -0
  419. package/dist/chunks/processSlashCommand-COtIO6Jy.js +6 -0
  420. package/dist/chunks/projectContext-0fpRKUeH.js +1 -0
  421. package/dist/chunks/projectContext-eXMSfgdZ.js +1 -0
  422. package/dist/chunks/prompt-4tea6NJQ.js +54 -0
  423. package/dist/chunks/prompt-CO160cIr.js +1 -0
  424. package/dist/chunks/prompt-CjFAtm3w.js +222 -0
  425. package/dist/chunks/prompt-GY9hlRvI.js +1 -0
  426. package/dist/chunks/promptEditor-EgosPsy-.js +4 -0
  427. package/dist/chunks/protocolHandler-mtPUT9U0.js +13 -0
  428. package/dist/chunks/protocols-CAyQOlkr.js +7 -0
  429. package/dist/chunks/proxy-CfZp-wce.js +99 -0
  430. package/dist/chunks/rate-limit-options-C6SFOHue.js +1 -0
  431. package/dist/chunks/rcDebugLog-CPKZCtR8.js +11 -0
  432. package/dist/chunks/referral-DeDr9zAE.js +1 -0
  433. package/dist/chunks/refresh-D7pdoY_X.js +1 -0
  434. package/dist/chunks/registerProtocol-BZBH8Zgl.js +36 -0
  435. package/dist/chunks/registry-Dz6AbiYP.js +1 -0
  436. package/dist/chunks/release-notes-DiUNOrg9.js +4 -0
  437. package/dist/chunks/releaseNotes-CnhQit0y.js +2 -0
  438. package/dist/chunks/reload-plugins-Dx52GcaG.js +1 -0
  439. package/dist/chunks/remote-env-B67Oo3sI.js +1 -0
  440. package/dist/chunks/remoteBridgeCore-BzSUgPbt.js +1 -0
  441. package/dist/chunks/remoteControlServer-L8smP7Zu.js +3 -0
  442. package/dist/chunks/rename-C4PauyTZ.js +1 -0
  443. package/dist/chunks/renderOptions-BiyC2rj1.js +1 -0
  444. package/dist/chunks/resume-CrSn26xq.js +2 -0
  445. package/dist/chunks/rewind-CXplHgh_.js +1 -0
  446. package/dist/chunks/rollback-DbSpxmJE.js +11 -0
  447. package/dist/chunks/runtimeObserver-YNy3mIb7.js +1 -0
  448. package/dist/chunks/runtimeObserver-nAhH4Wca.js +10 -0
  449. package/dist/chunks/sandbox-adapter-CzwHes1i.js +1 -0
  450. package/dist/chunks/sandbox-toggle-BYqbcI5d.js +1 -0
  451. package/dist/chunks/sanitization-CYp-9DbE.js +1 -0
  452. package/dist/chunks/satisfies-BaHgd_ie.js +1 -0
  453. package/dist/chunks/schemas-BGAvj1T4.js +40 -0
  454. package/dist/chunks/sdk-DEtgRZvI.js +1 -0
  455. package/dist/chunks/sdkHeapDumpMonitor--fevrC5z.js +1 -0
  456. package/dist/chunks/searchExtraTools-CcpdCO6l.js +1 -0
  457. package/dist/chunks/semver-Cq33BYay.js +1 -0
  458. package/dist/chunks/semver-Tw0AFar5.js +1 -0
  459. package/dist/chunks/sentry-BNVxoVLS.js +13 -0
  460. package/dist/chunks/server-C5XZSlto.js +1 -0
  461. package/dist/chunks/server-DzOdtq8A.js +1 -0
  462. package/dist/chunks/serverBanner-WlSYP-f8.js +1 -0
  463. package/dist/chunks/serverLog-DtsUvDiY.js +1 -0
  464. package/dist/chunks/session-BuEmHrqM.js +2 -0
  465. package/dist/chunks/sessionDataUploader-Ctjo1bgR.js +1 -0
  466. package/dist/chunks/sessionDiscovery-Mcsfa0g-.js +1 -0
  467. package/dist/chunks/sessionFileAccessHooks-qnNiGMnE.js +1 -0
  468. package/dist/chunks/sessionManager-Dw72ZUTg.js +1 -0
  469. package/dist/chunks/sessionMemory-CMahwDdW.js +1 -0
  470. package/dist/chunks/sessionMemory-pFSn4HSN.js +1 -0
  471. package/dist/chunks/sessionMemoryUtils-Du5jUl7M.js +1 -0
  472. package/dist/chunks/sessionObserver-DG2zQgfi.js +20 -0
  473. package/dist/chunks/sessionObserver-Je868MC9.js +1 -0
  474. package/dist/chunks/sessionStorage-D3FhAADV.js +1 -0
  475. package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +3 -0
  476. package/dist/chunks/sessionTitle-zUVSAHO7.js +14 -0
  477. package/dist/chunks/sessionTracing-DoRJ4nSa.js +11 -0
  478. package/dist/chunks/settingsSync-B9bz77E1.js +1 -0
  479. package/dist/chunks/setup-B1JbPepL.js +9 -0
  480. package/dist/chunks/setup-CCOLlRtP.js +1 -0
  481. package/dist/chunks/setup-DWkSjA49.js +2 -0
  482. package/dist/chunks/shadowedRuleDetection-BBR3uEgx.js +1 -0
  483. package/dist/chunks/shellQuote-DgjT8KBA.js +1 -0
  484. package/dist/chunks/sideQuestion-DHW5rgKz.js +20 -0
  485. package/dist/chunks/signin-QEeYpJZw.js +1 -0
  486. package/dist/chunks/sink-DxDOsLa2.js +1 -0
  487. package/dist/chunks/sink-cQOgsnw3.js +1 -0
  488. package/dist/chunks/sinks-BrrTUxkC.js +2 -0
  489. package/dist/chunks/sinks-Djiz_5-Z.js +1 -0
  490. package/dist/chunks/skill-learning-C0nOKZfg.js +5 -0
  491. package/dist/chunks/skillChangeDetector-D8C-uQSQ.js +1 -0
  492. package/dist/chunks/skillGapStore-Czi5jKjJ.js +1 -0
  493. package/dist/chunks/skillGapStore-_YuJP5KI.js +5 -0
  494. package/dist/chunks/skillGenerator-kbaRbpqJ.js +8 -0
  495. package/dist/chunks/skillLearning-3KWrBczS.js +1 -0
  496. package/dist/chunks/skillLearning-DBbdGbk-.js +1 -0
  497. package/dist/chunks/skillPanel-BxDvlPzd.js +28 -0
  498. package/dist/chunks/skillSearchPanel-D-MX6Qgt.js +21 -0
  499. package/dist/chunks/skills-NpEgFkFZ.js +1 -0
  500. package/dist/chunks/slashCommandParsing-Cari0pNg.js +1 -0
  501. package/dist/chunks/sleep-8Eb9j_Ly.js +1 -0
  502. package/dist/chunks/sprites-DD4eIkN7.js +1 -0
  503. package/dist/chunks/src-BIPP3_mo.js +26 -0
  504. package/dist/chunks/src-BJz1KAd_.js +6 -0
  505. package/dist/chunks/src-BRAdBA8A.js +1 -0
  506. package/dist/chunks/src-BRC_BuUP.js +1 -0
  507. package/dist/chunks/src-BaB-bpCj.js +5 -0
  508. package/dist/chunks/src-BlLavFUS.js +7 -0
  509. package/dist/chunks/src-C5yhFG0C.js +19 -0
  510. package/dist/chunks/src-CI_jaaBj.js +2 -0
  511. package/dist/chunks/src-CRsA-Z4y.js +1 -0
  512. package/dist/chunks/src-CYLfL70h.js +1 -0
  513. package/dist/chunks/src-DJXCzwyJ.js +1 -0
  514. package/dist/chunks/src-DJXKJavk.js +1 -0
  515. package/dist/chunks/src-Di342QoJ.js +53 -0
  516. package/dist/chunks/src-DsMd9Q9e.js +2 -0
  517. package/dist/chunks/src-DzH9IdOo.js +1 -0
  518. package/dist/chunks/src-hdbPEvzO.js +9 -0
  519. package/dist/chunks/src-poaoYkuc.js +1 -0
  520. package/dist/chunks/src-x7u_sB6m.js +1 -0
  521. package/dist/chunks/sso-oidc-BX1MlBX0.js +1 -0
  522. package/dist/chunks/startupProfiler-DnXZaX4A.js +3 -0
  523. package/dist/chunks/startupProfiler-SOE--nM9.js +1 -0
  524. package/dist/chunks/state-B2GIOsTB.js +1 -0
  525. package/dist/chunks/state-Ce1HlR-H.js +1 -0
  526. package/dist/chunks/state-sIHsFpDu.js +1 -0
  527. package/dist/chunks/staticRender-Br64h1E1.js +1 -0
  528. package/dist/chunks/stats-xL3NHwhp.js +1 -0
  529. package/dist/chunks/status-B5E70xRv.js +1 -0
  530. package/dist/chunks/statusNoticeHelpers-DcssRhLw.js +1 -0
  531. package/dist/chunks/stdio-BEEzuxaZ.js +1 -0
  532. package/dist/chunks/stdio-D4cT86R0.js +3 -0
  533. package/dist/chunks/stickers-2K05wjSp.js +1 -0
  534. package/dist/chunks/store-DhI7Lcan.js +1 -0
  535. package/dist/chunks/sts-BDFJ-6QE.js +1 -0
  536. package/dist/chunks/subprocessEnv-CggQWZCx.js +1 -0
  537. package/dist/chunks/subprocessEnv-DV6q6o6w.js +1 -0
  538. package/dist/chunks/supports-color-lkzOMQ6u.js +1 -0
  539. package/dist/chunks/systemPromptSections-BcN_XBTx.js +1 -0
  540. package/dist/chunks/systemPromptSections-DB93ZNWP.js +1 -0
  541. package/dist/chunks/systemTheme-dDbitcxB.js +1 -0
  542. package/dist/chunks/tag-BELr-qIa.js +11 -0
  543. package/dist/chunks/tasks-CrdWcSt-.js +1 -0
  544. package/dist/chunks/teamHelpers--3ZyNDlv.js +1 -0
  545. package/dist/chunks/teamHelpers-CUAiXng3.js +1 -0
  546. package/dist/chunks/teammate-DMYOtLTK.js +1 -0
  547. package/dist/chunks/teammateModeSnapshot-C6EWhR0X.js +1 -0
  548. package/dist/chunks/teammateModeSnapshot-DOQMTKbQ.js +1 -0
  549. package/dist/chunks/teleport-LXFOan9C.js +1 -0
  550. package/dist/chunks/templateJobs-8IY2Cgig.js +12 -0
  551. package/dist/chunks/terminalSetup-C4psrmpb.js +1 -0
  552. package/dist/chunks/terminalSetup-Lyg4NbGA.js +33 -0
  553. package/dist/chunks/theme-B8GNnJ_q.js +1 -0
  554. package/dist/chunks/thinkback-DPXwEK3B.js +1 -0
  555. package/dist/chunks/thinkback-DZW3Mcx_.js +1 -0
  556. package/dist/chunks/thinkback-play-BMOE-ceh.js +1 -0
  557. package/dist/chunks/tmux-CvbhsfwG.js +1 -0
  558. package/dist/chunks/toolEventObserver-D0TSHm01.js +1 -0
  559. package/dist/chunks/toolEventObserver-DzLd0MSn.js +1 -0
  560. package/dist/chunks/toolPool-DVOfpjDz.js +1 -0
  561. package/dist/chunks/toolPool-Dq-Vtvrj.js +1 -0
  562. package/dist/chunks/trustedDevice-1iTu4LEm.js +1 -0
  563. package/dist/chunks/trustedDevice-BvYYXfd8.js +1 -0
  564. package/dist/chunks/tui-BVc2q4Xv.js +6 -0
  565. package/dist/chunks/turndown.es-Bv06VjMb.js +69 -0
  566. package/dist/chunks/types-CQ1wrnQ0.js +1 -0
  567. package/dist/chunks/types-Csi32ZXh.js +17 -0
  568. package/dist/chunks/types-RJTEOuIt.js +3 -0
  569. package/dist/chunks/udsClient-BvG_Jip0.js +1 -0
  570. package/dist/chunks/ultrareviewCommand-BTXAN2wP.js +3 -0
  571. package/dist/chunks/undercover-C_44e3oN.js +1 -0
  572. package/dist/chunks/undercover-DvvnEmsX.js +31 -0
  573. package/dist/chunks/up-D-U4wUCe.js +12 -0
  574. package/dist/chunks/updateCCB-C-qfLi0j.js +11 -0
  575. package/dist/chunks/upgrade-CGXa5Dwy.js +1 -0
  576. package/dist/chunks/upgrade-DTBZSxwv.js +1 -0
  577. package/dist/chunks/upload-BF8tf_Eo.js +1 -0
  578. package/dist/chunks/upstreamproxy-DcLeL2XX.js +11 -0
  579. package/dist/chunks/usage-BRYRRgNt.js +1 -0
  580. package/dist/chunks/usage-DvSTXEYY.js +1 -0
  581. package/dist/chunks/useKeybinding-FsOnjW6T.js +1 -0
  582. package/dist/chunks/useMainLoopModel-CwvuTRXn.js +1 -0
  583. package/dist/chunks/useManagePlugins-GmnI9K53.js +1 -0
  584. package/dist/chunks/useMergedTools-Dah5KDMi.js +1 -0
  585. package/dist/chunks/useSearchInput-BV_azHiA.js +1 -0
  586. package/dist/chunks/useSettingsErrors-C-j_Zt7g.js +1 -0
  587. package/dist/chunks/useVoice-DR69NLxp.js +1 -0
  588. package/dist/chunks/util-BpyJ4Bom.js +1 -0
  589. package/dist/chunks/utils-CrZcpypC.js +1 -0
  590. package/dist/chunks/v4-f1i_CNUT.js +1 -0
  591. package/dist/chunks/validatePlugin-vptAYuYu.js +1 -0
  592. package/dist/chunks/vertex-sdk-CSGw3fvU.js +9 -0
  593. package/dist/chunks/vim-DvOw8dfR.js +1 -0
  594. package/dist/chunks/voice-B3BZs53f.js +2 -0
  595. package/dist/chunks/voice-DXiiy8HX.js +8 -0
  596. package/dist/chunks/voiceModeEnabled-DA76xN1Q.js +1 -0
  597. package/dist/chunks/voiceModeEnabled-DIveLYGb.js +1 -0
  598. package/dist/chunks/voiceStreamSTT-_w1VjIOs.js +1 -0
  599. package/dist/chunks/voiceStreamSTT-hpzWd_zl.js +1 -0
  600. package/dist/chunks/which-DqSAIvp2.js +1 -0
  601. package/dist/chunks/windowsPaths-C9CigqoF.js +1 -0
  602. package/dist/chunks/windowsPaths-swxCp7bX.js +2 -0
  603. package/dist/chunks/workSecret-mS2OrpxF.js +1 -0
  604. package/dist/chunks/workerRegistry-2_MZVih1.js +1 -0
  605. package/dist/chunks/worktree-CCuDwRmS.js +1 -0
  606. package/dist/chunks/worktreeModeEnabled-Db6b_Iy_.js +1 -0
  607. package/dist/chunks/worktreeModeEnabled-THQb19xR.js +1 -0
  608. package/dist/chunks/wrapper-BSK0MCQH.js +1 -0
  609. package/dist/chunks/wrapper-D5qL1aQL.js +6 -0
  610. package/dist/chunks/xdg-CBxMmQux.js +1 -0
  611. package/dist/chunks/xml-Dx--sNE1.js +1 -0
  612. package/dist/chunks/zod-DT6hytkp.js +1 -0
  613. package/dist/cli.js +1 -10978
  614. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{At as n,jt as r}from"./paths-BBvuDQl9.js";import{E as i,L as a,R as o,V as s,d as c,s as l,w as u}from"./debug-UI3T040K.js";import{F as d,P as f}from"./git-CN3qtTb_.js";import{r as p,u as m}from"./proxy-CfZp-wce.js";import{n as h,t as g}from"./sleep-8Eb9j_Ly.js";import{D as _,E as v,O as y,a as b,l as x,r as S}from"./rcDebugLog-CPKZCtR8.js";import{n as C}from"./jwtUtils-CpXwh_du.js";import{randomUUID as w}from"crypto";s(),l(),f(),m(),g(),r(),y(),S(),u(),e();var T=class extends Error{constructor(e,t){super(e),this.retryAfterMs=t}},E=class{constructor(e){t(this,`pending`,[]),t(this,`pendingAtClose`,0),t(this,`draining`,!1),t(this,`closed`,!1),t(this,`backpressureResolvers`,[]),t(this,`sleepResolve`,null),t(this,`flushResolvers`,[]),t(this,`droppedBatches`,0),t(this,`config`,void 0),this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length!==0){for(;this.pending.length+t.length>this.config.maxQueueSize&&!this.closed;)await new Promise(e=>{this.backpressureResolvers.push(e)});this.closed||(this.pending.push(...t),this.drain())}}flush(){return this.pending.length===0&&!this.draining?Promise.resolve():(this.drain(),new Promise(e=>{this.flushResolvers.push(e)}))}close(){if(!this.closed){this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{for(;this.pending.length>0&&!this.closed;){let t=this.takeBatch();if(t.length!==0){try{await this.config.send(t),e=0}catch(n){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let r=n instanceof T?n.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,r));continue}this.releaseBackpressure()}}}finally{if(this.draining=!1,this.pending.length===0){for(let e of this.flushResolvers)e();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let n=0,r=0;for(;r<this.pending.length&&r<e;){let e;try{e=Buffer.byteLength(i(this.pending[r]))}catch{this.pending.splice(r,1);continue}if(r>0&&n+e>t)break;n+=e,r++}return this.pending.splice(0,r)}retryDelay(e,t){let n=Math.random()*this.config.jitterMs;return t===void 0?Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+n:Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+n}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise(t=>{this.sleepResolve=t,setTimeout((e,t)=>{e.sleepResolve=null,t()},e,this,t)})}};e();var D=class{constructor(e){t(this,`inflight`,null),t(this,`pending`,null),t(this,`closed`,!1),t(this,`config`,void 0),this.config=e}enqueue(e){this.closed||(this.pending=this.pending?O(this.pending,e):e,this.drain())}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed||!this.pending)return;let e=this.pending;this.pending=null,this.inflight=this.sendWithRetry(e).then(()=>{this.inflight=null,this.pending&&!this.closed&&this.drain()})}async sendWithRetry(e){let t=e,n=0;for(;!this.closed;){if(await this.config.send(t))return;n++,await h(this.retryDelay(n)),this.pending&&!this.closed&&(t=O(t,this.pending),this.pending=null)}}retryDelay(e){return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+Math.random()*this.config.jitterMs}};function O(e,t){let n={...e};for(let[e,r]of Object.entries(t))(e===`external_metadata`||e===`internal_metadata`)&&n[e]&&typeof n[e]==`object`&&typeof r==`object`&&r?n[e]={...n[e],...r}:n[e]=r;return n}g(),e();var k=2e4,A=100;function j(){return!0}var M=class extends Error{constructor(e){super(`CCRClient init failed: ${e}`),this.reason=e}},N=10;function P(){return{byMessage:new Map,scopeToMessage:new Map}}function F(e){return`${e.session_id}:${e.parent_tool_use_id??``}`}function I(e,t){let n=[],r=new Map;for(let i of e){let e=i.event;switch(e.type){case`message_start`:{let r=e.message.id,a=t.scopeToMessage.get(F(i));a&&t.byMessage.delete(a),t.scopeToMessage.set(F(i),r),t.byMessage.set(r,[]),n.push(i);break}case`content_block_delta`:{let a=e.delta;if(a.type!==`text_delta`){n.push(i);break}let o=t.scopeToMessage.get(F(i)),s=o?t.byMessage.get(o):void 0;if(!s){n.push(i);break}let c=e.index,l=s[c]??(s[c]=[]);l.push(a.text);let u=r.get(l);if(u){u.event.delta={type:`text_delta`,text:l.join(``)};break}let d={type:`stream_event`,uuid:i.uuid,session_id:i.session_id,parent_tool_use_id:i.parent_tool_use_id,event:{type:`content_block_delta`,index:c,delta:{type:`text_delta`,text:l.join(``)}}};r.set(l,d),n.push(d);break}default:n.push(i)}}return n}function L(e,t){e.byMessage.delete(t.message.id);let n=F(t);e.scopeToMessage.get(n)===t.message.id&&e.scopeToMessage.delete(n)}var R=class{constructor(e,n,r){if(t(this,`workerEpoch`,0),t(this,`heartbeatIntervalMs`,void 0),t(this,`heartbeatJitterFraction`,void 0),t(this,`heartbeatTimer`,null),t(this,`heartbeatInFlight`,!1),t(this,`closed`,!1),t(this,`consecutiveAuthFailures`,0),t(this,`currentState`,null),t(this,`sessionBaseUrl`,void 0),t(this,`sessionId`,void 0),t(this,`http`,p({keepAlive:!0})),t(this,`streamEventBuffer`,[]),t(this,`streamEventTimer`,null),t(this,`streamTextAccumulator`,P()),t(this,`workerState`,void 0),t(this,`eventUploader`,void 0),t(this,`internalEventUploader`,void 0),t(this,`deliveryUploader`,void 0),t(this,`onEpochMismatch`,void 0),t(this,`getAuthHeaders`,void 0),this.onEpochMismatch=r?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=r?.heartbeatIntervalMs??k,this.heartbeatJitterFraction=r?.heartbeatJitterFraction??0,this.getAuthHeaders=r?.getAuthHeaders??v,n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`CCRClient: Expected http(s) URL, got ${n.protocol}`);let i=n.pathname.replace(/\/$/,``);this.sessionBaseUrl=`${n.protocol}//${n.host}${i}`,this.sessionId=i.split(`/`).pop()||``,this.workerState=new D({send:e=>this.request(`put`,`/worker`,{worker_epoch:this.workerEpoch,...e},`PUT worker`).then(e=>e.ok),baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.eventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:1e5,send:async e=>{let t=await this.request(`post`,`/worker/events`,{worker_epoch:this.workerEpoch,events:e},`client events`);if(!t.ok)throw new T(`client event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.internalEventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:200,send:async e=>{let t=await this.request(`post`,`/worker/internal-events`,{worker_epoch:this.workerEpoch,events:e},`internal events`);if(!t.ok)throw new T(`internal event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.deliveryUploader=new E({maxBatchSize:64,maxQueueSize:64,send:async e=>{let t=await this.request(`post`,`/worker/events/delivery`,{worker_epoch:this.workerEpoch,updates:e.map(e=>({event_id:e.eventId,status:e.status}))},`delivery batch`);if(!t.ok)throw new T(`delivery POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),e.setOnEvent(e=>{this.reportDelivery(e.event_id,`received`)})}async initialize(e){let t=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M(`no_auth_headers`);if(e===void 0){let t=process.env.CLAUDE_CODE_WORKER_EPOCH;e=t?parseInt(t,10):NaN}if(isNaN(e))throw new M(`missing_epoch`);this.workerEpoch=e;let n=this.getWorkerState();if(!(await this.request(`put`,`/worker`,{worker_status:`idle`,worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null,automation_state:null}},`PUT worker (init)`)).ok)throw new M(`worker_register_failed`);this.currentState=`idle`,this.startHeartbeat(),b(()=>{this.writeEvent({type:`keep_alive`})}),c(`CCRClient: initialized, epoch=${this.workerEpoch}`),d(`info`,`cli_worker_lifecycle_initialized`,{epoch:this.workerEpoch,duration_ms:Date.now()-t});let{metadata:r,durationMs:i}=await n;return this.closed||d(`info`,`cli_worker_state_restored`,{duration_ms:i,had_state:r!==null}),r}async getWorkerState(){let e=Date.now(),t=this.getAuthHeaders();return Object.keys(t).length===0?{metadata:null,durationMs:0}:{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,t,`worker_state`))?.worker?.external_metadata??null,durationMs:Date.now()-e}}async request(e,t,r,i,{timeout:s=1e4}={}){let l=this.getAuthHeaders();if(Object.keys(l).length===0)return{ok:!1};try{let a=await this.http[e](`${this.sessionBaseUrl}${t}`,r,{headers:{...l,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":n()},validateStatus:j,timeout:s});if(a.status>=200&&a.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(a.status===409&&this.handleEpochMismatch(),a.status===401||a.status===403){let e=_(),t=e?C(e):null;t!==null&&t*1e3<Date.now()&&(c(`CCRClient: session_token expired (exp=${new Date(t*1e3).toISOString()}) — no refresh was delivered, exiting`,{level:`error`}),d(`error`,`cli_worker_token_expired_no_refresh`),this.onEpochMismatch()),this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=N&&(c(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:`error`}),d(`error`,`cli_worker_auth_failures_exhausted`),this.onEpochMismatch())}if(c(`CCRClient: ${i} returned ${a.status}`,{level:`warn`}),d(`warn`,`cli_worker_request_failed`,{method:e,path:t,status:a.status}),a.status===429){let e=a.headers?.[`retry-after`],t=typeof e==`string`?parseInt(e,10):NaN;if(!isNaN(t)&&t>=0)return{ok:!1,retryAfterMs:t*1e3}}return{ok:!1}}catch(n){return c(`CCRClient: ${i} failed: ${a(n)}`,{level:`warn`}),d(`warn`,`cli_worker_request_error`,{method:e,path:t,error_code:o(n)}),{ok:!1}}}reportState(e,t){e===this.currentState&&!t||(this.currentState=e,this.workerState.enqueue({worker_status:e,requires_action_details:t?{tool_name:t.tool_name,action_description:t.action_description,request_id:t.request_id}:null}))}reportMetadata(e){this.workerState.enqueue({external_metadata:e})}handleEpochMismatch(){c(`CCRClient: Epoch mismatch (409), shutting down`,{level:`error`}),d(`error`,`cli_worker_epoch_mismatch`),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let e=()=>{let e=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(t,this.heartbeatIntervalMs+e)},t=()=>{this.sendHeartbeat(),this.heartbeatTimer!==null&&e()};e()}stopHeartbeat(){this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)}async sendHeartbeat(){if(!this.heartbeatInFlight){this.heartbeatInFlight=!0;try{(await this.request(`post`,`/worker/heartbeat`,{session_id:this.sessionId,worker_epoch:this.workerEpoch},`Heartbeat`,{timeout:5e3})).ok&&c(`CCRClient: Heartbeat sent`)}finally{this.heartbeatInFlight=!1}}}async writeEvent(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),A));return}await this.flushStreamEventBuffer(),e.type===`assistant`&&L(this.streamTextAccumulator,e),await this.eventUploader.enqueue(this.toClientEvent(e))}toClientEvent(e){let t=e;return{payload:{...t,uuid:typeof t.uuid==`string`?t.uuid:w()}}}async flushStreamEventBuffer(){if(this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer.length===0)return;let e=this.streamEventBuffer;this.streamEventBuffer=[];let t=I(e,this.streamTextAccumulator);await this.eventUploader.enqueue(t.map(e=>({payload:e,ephemeral:!0})))}async writeInternalEvent(e,t,{isCompaction:n=!1,agentId:r}={}){let i={payload:{type:e,...t,uuid:typeof t.uuid==`string`?t.uuid:w()},...n&&{is_compaction:!0},...r&&{agent_id:r}};await this.internalEventUploader.enqueue(i)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{},`internal_events`)}async readSubagentInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{subagents:`true`},`subagent_events`)}async paginatedGet(e,t,n){let r=this.getAuthHeaders();if(Object.keys(r).length===0)return null;let i=[],a;do{let o=new URL(`${this.sessionBaseUrl}${e}`);for(let[e,n]of Object.entries(t))o.searchParams.set(e,n);a&&o.searchParams.set(`cursor`,a);let s=await this.getWithRetry(o.toString(),r,n);if(!s)return null;i.push(...s.data??[]),a=s.next_cursor}while(a);return c(`CCRClient: Read ${i.length} internal events from ${e}${t.subagents?` (subagents)`:``}`),i}async getWithRetry(e,t,r){for(let r=1;r<=10;r++){let i;try{i=await this.http.get(e,{headers:{...t,"anthropic-version":`2023-06-01`,"User-Agent":n()},validateStatus:j,timeout:3e4})}catch(t){c(`CCRClient: GET ${e} failed (attempt ${r}/10): ${a(t)}`,{level:`warn`}),r<10&&await h(Math.min(500*2**(r-1),3e4)+Math.random()*500);continue}if(i.status>=200&&i.status<300)return i.data;i.status===409&&this.handleEpochMismatch(),c(`CCRClient: GET ${e} returned ${i.status} (attempt ${r}/10)`,{level:`warn`}),r<10&&await h(Math.min(500*2**(r-1),3e4)+Math.random()*500)}return c(`CCRClient: GET retries exhausted`,{level:`error`}),d(`error`,`cli_worker_get_retries_exhausted`,{context:r}),null}reportDelivery(e,t){this.deliveryUploader.enqueue({eventId:e,status:t})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){this.closed=!0,this.stopHeartbeat(),x(),this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}};export{M as n,E as r,R as t};
@@ -0,0 +1 @@
1
+ var e=()=>null,t=async()=>{throw Error(`ccshare not implemented`)};export{t as loadCcshare,e as parseCcshareId};
@@ -0,0 +1 @@
1
+ import{fA as e,gA as t}from"./loadAgentsDir-DI1a76pd.js";e();export{t as settingsChangeDetector};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ln as t,Mn as n,Tt as r,un as i,vt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{cn as c,y as l}from"./state-sIHsFpDu.js";import{S as u,_ as d}from"./paths-BBvuDQl9.js";import{E as f,et as p}from"./log-CzsijfHZ.js";import{n as m,t as h}from"./lazySchema-2sOku3cX.js";import{i as g,n as _,o as v,p as y,r as b}from"./xml-Dx--sNE1.js";function x(){let e=d(`tengu_harbor_ledger`,[]),t=w().safeParse(e);return t.success?t.data:[]}function S(){return!0}function C(e){if(!e)return!1;let{name:t,marketplace:n}=v(e);return n?n===`builtin`&&t===`weixin`?!0:x().some(e=>e.plugin===t&&e.marketplace===n):!1}var w,T=e((()=>{s(),y(),h(),g(),u(),w=m(()=>r(o({marketplace:t(),plugin:t()})))}));function E(e,t,n){let r=Object.entries(n??{}).filter(([e])=>P.test(e)).map(([e,t])=>` ${e}="${_(t)}"`).join(``);return`<${f} source="${_(e)}"${r}>\n${t}\n</${f}>`}function D(e,t){let n=e.split(`:`);return t.find(t=>t.kind===`server`?e===t.name:n[0]===`plugin`&&n[1]===t.name)}function O(e,t,n){if(!t?.experimental?.[`claude/channel`])return{action:`skip`,kind:`capability`,reason:`server did not declare claude/channel capability`};let r=D(e,l());if(!r)return{action:`skip`,kind:`session`,reason:`server ${e} not in --channels list for this session`};if(r.kind===`plugin`){let e=n?v(n).marketplace:void 0;if(e!==r.marketplace)return{action:`skip`,kind:`marketplace`,reason:`you asked for plugin:${r.name}@${r.marketplace} but the installed ${r.name} plugin is from ${e??`an unknown source`}`}}return{action:`register`}}var k,A,j,M,N,P,F=e((()=>{s(),c(),p(),h(),g(),b(),T(),k=m(()=>o({method:i(`notifications/claude/channel`),params:o({content:t(),meta:n(t(),t()).optional()})})),A=`notifications/claude/channel/permission`,j=m(()=>o({method:i(A),params:o({request_id:t(),behavior:a([`allow`,`deny`])})})),M=`notifications/claude/channel/permission_request`,N=m(()=>o({method:i(M),params:o({request_id:t(),tool_name:t(),description:t(),input_preview:t(),channel_context:o({source_server:t().optional(),chat_id:t().optional()}).optional()})})),P=/^[a-zA-Z_][a-zA-Z0-9_]*$/}));export{N as a,F as c,C as d,S as f,j as i,E as l,M as n,D as o,k as r,O as s,A as t,T as u};
@@ -0,0 +1 @@
1
+ import{a as e,c as t}from"./channelNotification-B7A-9DIl.js";t();export{e as ChannelPermissionRequestNotificationSchema};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./chokidar-SzksMqYp.js";e();export{t as default};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-80gRi2ZW.js";import*as r from"node:path";import{join as i,relative as a,resolve as o,sep as s}from"node:path";import{stat as c,unwatchFile as l,watch as u,watchFile as d}from"node:fs";import{type as f}from"node:os";import{EventEmitter as ee}from"node:events";import{Readable as te}from"node:stream";import{lstat as p,open as ne,readdir as re,realpath as m,stat as h}from"node:fs/promises";function ie(e,t={}){let n=t.entryType||t.type;if(n===`both`&&(n=g.FILE_DIR_TYPE),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!y.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${y.join(`, `)}`);return t.root=e,new S(t)}var g,_,v,ae,y,oe,se,ce,le,b,x,S,ue=e((()=>{t(),g={FILE_TYPE:`files`,DIR_TYPE:`directories`,FILE_DIR_TYPE:`files_directories`,EVERYTHING_TYPE:`all`},_={root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:g.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096},Object.freeze(_),v=`READDIRP_RECURSIVE_ERROR`,ae=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,v]),y=[g.DIR_TYPE,g.EVERYTHING_TYPE,g.FILE_DIR_TYPE,g.FILE_TYPE],oe=new Set([g.DIR_TYPE,g.EVERYTHING_TYPE,g.FILE_DIR_TYPE]),se=new Set([g.EVERYTHING_TYPE,g.FILE_DIR_TYPE,g.FILE_TYPE]),ce=e=>ae.has(e.code),le=process.platform===`win32`,b=e=>!0,x=e=>{if(e===void 0)return b;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return b},S=class extends te{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark}),n(this,`parents`,void 0),n(this,`reading`,void 0),n(this,`parent`,void 0),n(this,`_stat`,void 0),n(this,`_maxDepth`,void 0),n(this,`_wantsDir`,void 0),n(this,`_wantsFile`,void 0),n(this,`_wantsEverything`,void 0),n(this,`_root`,void 0),n(this,`_isDirent`,void 0),n(this,`_statsProp`,void 0),n(this,`_rdOptions`,void 0),n(this,`_fileFilter`,void 0),n(this,`_directoryFilter`,void 0);let t={..._,...e},{root:r,type:i}=t;this._fileFilter=x(t.fileFilter),this._directoryFilter=x(t.directoryFilter);let a=t.lstat?p:h;le?this._stat=e=>a(e,{bigint:!0}):this._stat=a,this._maxDepth=t.depth!=null&&Number.isSafeInteger(t.depth)?t.depth:_.depth,this._wantsDir=i?oe.has(i):!1,this._wantsFile=i?se.has(i):!1,this._wantsEverything=i===g.EVERYTHING_TYPE,this._root=o(r),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r)),o=await Promise.all(a);for(let t of o){if(!t)continue;if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await re(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n,r=this._isDirent?e.name:e;try{let s=o(i(t,r));n={path:a(this._root,s),fullPath:s,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(e){this._onError(e);return}return n}_onError(e){ce(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await m(t),n=await p(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===s){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=v,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}}));function de(e,t,n,i,a){let o=(t,i)=>{n(e),a(t,i,{watchedPath:e}),i&&e!==i&&B(r.resolve(e,i),O,r.join(e,i))};try{return u(e,{persistent:t.persistent},o)}catch(e){i(e);return}}var fe,pe,C,w,T,me,he,ge,_e,E,D,ve,ye,O,k,A,j,M,N,P,F,I,L,R,z,B,be,V,xe,Se,Ce=e((()=>{t(),fe=`data`,pe=`close`,C=()=>{},w=process.platform,T=w===`win32`,me=w===`darwin`,he=w===`linux`,ge=w===`freebsd`,_e=f()===`OS400`,E={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},D=E,ve=`watch`,ye={lstat:p,stat:h},O=`listeners`,k=`errHandlers`,A=`rawEmitters`,j=[O,k,A],M=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),N=e=>M.has(r.extname(e).slice(1).toLowerCase()),P=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},F=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},I=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},L=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},R=e=>e instanceof Set?e.size===0:!e,z=new Map,B=(e,t,n,r,i)=>{let a=z.get(e);a&&P(a[t],e=>{e(n,r,i)})},be=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=z.get(t),c;if(!n.persistent)return c=de(e,n,i,a,o),c?c.close.bind(c):void 0;if(s)F(s,O,i),F(s,k,a),F(s,A,o);else{if(c=de(e,n,B.bind(null,t,O),a,B.bind(null,t,A)),!c)return;c.on(D.ERROR,async n=>{let r=B.bind(null,t,k);if(s&&(s.watcherUnusable=!0),T&&n.code===`EPERM`)try{await(await ne(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:c},z.set(t,s)}return()=>{L(s,O,i),L(s,k,a),L(s,A,o),R(s.listeners)&&(s.watcher.close(),z.delete(t),j.forEach(I(s)),s.watcher=void 0,Object.freeze(s))}},V=new Map,xe=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=V.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&(l(t),o=void 0),o?(F(o,O,i),F(o,A,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:d(t,n,(n,r)=>{P(o.rawEmitters,e=>{e(D.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&P(o.listeners,t=>t(e,n))})},V.set(t,o)),()=>{L(o,O,i),L(o,A,a),R(o.listeners)&&(V.delete(t),l(t),o.options=o.watcher=void 0,Object.freeze(o))}},Se=class{constructor(e){n(this,`fsw`,void 0),n(this,`_boundHandleError`,void 0),this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=r.dirname(e),a=r.basename(e);this.fsw._getWatchedDir(i).add(a);let o=r.resolve(e),s={persistent:n.persistent};t||(t=C);let c;return n.usePolling?(s.interval=n.interval!==n.binaryInterval&&N(a)?n.binaryInterval:n.interval,c=xe(e,o,s,{listener:t,rawEmitter:this.fsw._emitRaw})):c=be(e,o,s,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),c}_handleFile(e,t,n){if(this.fsw.closed)return;let i=r.dirname(e),a=r.basename(e),o=this.fsw._getWatchedDir(i),s=t;if(o.has(a))return;let c=async(t,n)=>{if(this.fsw._throttle(ve,e,5)){if(!n||n.mtimeMs===0)try{let n=await h(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==s.mtimeMs)&&this.fsw._emit(D.CHANGE,e,n),(me||he||ge)&&s.ino!==n.ino){this.fsw._closeFile(t),s=n;let r=this._watchWithNodeFs(e,c);r&&this.fsw._addPathCloser(t,r)}else s=n}catch{this.fsw._remove(i,a)}else if(o.has(a)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==s.mtimeMs)&&this.fsw._emit(D.CHANGE,e,n),s=n}}},l=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(D.ADD,e,0))return;this.fsw._emit(D.ADD,e,t)}return l}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await m(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(D.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(D.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,i,a,o,s){e=r.join(e,``);let c=i?`${e}:${i}`:e;if(s=this.fsw._throttle(`readdir`,c,1e3),!s)return;let l=this.fsw._getWatchedDir(n.path),u=new Set,d=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e)});if(d)return d.on(fe,async s=>{if(this.fsw.closed){d=void 0;return}let c=s.path,f=r.join(e,c);if(u.add(c),!(s.stats.isSymbolicLink()&&await this._handleSymlink(s,e,f,c))){if(this.fsw.closed){d=void 0;return}(c===i||!i&&!l.has(c))&&(this.fsw._incrReadyCount(),f=r.join(a,r.relative(a,f)),this._addToNodeFs(f,t,n,o+1))}}).on(D.ERROR,this._boundHandleError),new Promise((t,r)=>{if(!d)return r();d.once(`end`,()=>{if(this.fsw.closed){d=void 0;return}let r=s?s.clear():!1;t(void 0),l.getChildren().filter(t=>t!==e&&!u.has(t)).forEach(t=>{this.fsw._remove(e,t)}),d=void 0,r&&this._handleRead(e,!1,n,i,a,o,s)})})}async _handleDir(e,t,n,i,a,o,s){let c=this.fsw._getWatchedDir(r.dirname(e)),l=c.has(r.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!a&&!l&&this.fsw._emit(D.ADD_DIR,e,t),c.add(r.basename(e)),this.fsw._getWatchedDir(e);let u,d=this.fsw.options.depth;if((d==null||i<=d)&&!this.fsw._symlinkPaths.has(s)){if(!a&&(await this._handleRead(e,n,o,a,e,i,void 0),this.fsw.closed))return;u=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,o,a,e,i,void 0)})}return u}async _addToNodeFs(e,t,n,i,a){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let s=this.fsw._getWatchHelpers(e);n&&(s.filterPath=e=>n.filterPath(e),s.filterDir=e=>n.filterDir(e));try{let n=await ye[s.statMethod](s.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(s.watchPath,n))return o(),!1;let c=this.fsw.options.followSymlinks,l;if(n.isDirectory()){let o=r.resolve(e),u=c?await m(e):e;if(this.fsw.closed||(l=await this._handleDir(s.watchPath,n,t,i,a,s,u),this.fsw.closed))return;o!==u&&u!==void 0&&this.fsw._symlinkPaths.set(o,u)}else if(n.isSymbolicLink()){let a=c?await m(e):e;if(this.fsw.closed)return;let o=r.dirname(s.watchPath);if(this.fsw._getWatchedDir(o).add(s.watchPath),this.fsw._emit(D.ADD,s.watchPath,n),l=await this._handleDir(o,n,t,i,e,s,a),this.fsw.closed)return;a!==void 0&&this.fsw._symlinkPaths.set(r.resolve(e),a)}else l=this._handleFile(s.watchPath,n,t);return o(),l&&this.fsw._addPathCloser(e,l),!1}catch(t){if(this.fsw._handleError(t))return o(),e}}}}));function H(e){return Array.isArray(e)?e:[e]}function we(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?t=>{if(e.path===t)return!0;if(e.recursive){let n=r.relative(e.path,t);return n?!n.startsWith(`..`)&&!r.isAbsolute(n):!1}return!1}:()=>!1}function Te(e){if(typeof e!=`string`)throw Error(`string expected`);e=r.normalize(e),e=e.replace(/\\/g,`/`);let t=!1;return e.startsWith(`//`)&&(t=!0),e=e.replace(G,`/`),t&&(e=`/`+e),e}function Ee(e,t,n){let r=Te(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function De(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=H(e).map(e=>we(e));return t==null?(e,t)=>Ee(n,e,t):Ee(n,t)}function Oe(e,t={}){let n=new Q(t);return n.add(e),n}var U,ke,W,Ae,je,Me,G,Ne,Pe,K,q,J,Y,X,Fe,Ie,Le,Re,ze,Z,Q,$,Be=e((()=>{ue(),Ce(),t(),U=`/`,ke=`//`,W=`.`,Ae=`..`,je=`string`,Me=/\\/g,G=/\/\//g,Ne=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Pe=/^\.[/\\]/,K=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp),q=e=>{let t=H(e).flat();if(!t.every(e=>typeof e===je))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(Y)},J=e=>{let t=e.replace(Me,U),n=!1;return t.startsWith(ke)&&(n=!0),t=t.replace(G,U),n&&(t=U+t),t},Y=e=>J(r.normalize(J(e))),X=(e=``)=>t=>typeof t==`string`?Y(r.isAbsolute(t)?t:r.join(e,t)):t,Fe=(e,t)=>r.isAbsolute(e)?e:r.join(t,e),Ie=Object.freeze(new Set),Le=class{constructor(e,t){n(this,`path`,void 0),n(this,`_removeWatcher`,void 0),n(this,`items`,void 0),this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==W&&e!==Ae&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await re(n)}catch{this._removeWatcher&&this._removeWatcher(r.dirname(n),r.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=C,this.items=Ie,Object.freeze(this)}},Re=`stat`,ze=`lstat`,Z=class{constructor(e,t,i){n(this,`fsw`,void 0),n(this,`path`,void 0),n(this,`watchPath`,void 0),n(this,`fullWatchPath`,void 0),n(this,`dirParts`,void 0),n(this,`followSymlinks`,void 0),n(this,`statMethod`,void 0),this.fsw=i;let a=e;this.path=e=e.replace(Pe,``),this.watchPath=a,this.fullWatchPath=r.resolve(a),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?Re:ze}entryPath(e){return r.join(this.watchPath,r.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Q=class extends ee{constructor(e={}){super(),n(this,`closed`,void 0),n(this,`options`,void 0),n(this,`_closers`,void 0),n(this,`_ignoredPaths`,void 0),n(this,`_throttled`,void 0),n(this,`_streams`,void 0),n(this,`_symlinkPaths`,void 0),n(this,`_watched`,void 0),n(this,`_pendingWrites`,void 0),n(this,`_pendingUnlinks`,void 0),n(this,`_readyCount`,void 0),n(this,`_emitReady`,void 0),n(this,`_closePromise`,void 0),n(this,`_userIgnored`,void 0),n(this,`_readyEmitted`,void 0),n(this,`_emitRaw`,void 0),n(this,`_boundRemove`,void 0),n(this,`_nodeFsHandler`,void 0),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,r={stabilityThreshold:2e3,pollInterval:100},i={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?H(e.ignored):H([]),awaitWriteFinish:t===!0?r:typeof t==`object`?{...r,...t}:!1};_e&&(i.usePolling=!0),i.atomic===void 0&&(i.atomic=!i.usePolling);let a=process.env.CHOKIDAR_USEPOLLING;if(a!==void 0){let e=a.toLowerCase();e===`false`||e===`0`?i.usePolling=!1:e===`true`||e===`1`?i.usePolling=!0:i.usePolling=!!e}let o=process.env.CHOKIDAR_INTERVAL;o&&(i.interval=Number.parseInt(o,10));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=C,this._readyEmitted=!0,process.nextTick(()=>this.emit(E.READY)))},this._emitRaw=(...e)=>this.emit(E.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=i,this._nodeFsHandler=new Se(this),Object.freeze(i)}_addIgnoredPath(e){if(K(e)){for(let t of this._ignoredPaths)if(K(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)K(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,n){let{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let a=q(e);return i&&(a=a.map(e=>Fe(e,i))),a.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=a.length,Promise.all(a.map(async e=>{let r=await this._nodeFsHandler._addToNodeFs(e,!n,void 0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(r.dirname(e),r.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=q(e),{cwd:n}=this.options;return t.forEach(e=>{!r.isAbsolute(e)&&!this._closers.has(e)&&(n&&(e=r.join(n,e)),e=r.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=(this.options.cwd?r.relative(this.options.cwd,n):n)||W;e[i]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==E.ERROR&&this.emit(E.ALL,e,...t)}async _emit(e,t,n){if(this.closed)return;let i=this.options;T&&(t=r.normalize(t)),i.cwd&&(t=r.relative(i.cwd,t));let a=[t];n!=null&&a.push(n);let o=i.awaitWriteFinish,s;if(o&&(s=this._pendingWrites.get(t)))return s.lastChange=new Date,this;if(i.atomic){if(e===E.UNLINK)return this._pendingUnlinks.set(t,[e,...a]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(E.ALL,...e),this._pendingUnlinks.delete(t)})},typeof i.atomic==`number`?i.atomic:100),this;e===E.ADD&&this._pendingUnlinks.has(t)&&(e=E.CHANGE,this._pendingUnlinks.delete(t))}if(o&&(e===E.ADD||e===E.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,o.stabilityThreshold,e,(t,n)=>{t?(e=E.ERROR,a[0]=t,this.emitWithAll(e,a)):n&&(a.length>1?a[1]=n:a.push(n),this.emitWithAll(e,a))}),this;if(e===E.CHANGE&&!this._throttle(E.CHANGE,t,50))return this;if(i.alwaysStat&&n===void 0&&(e===E.ADD||e===E.ADD_DIR||e===E.CHANGE)){let e=i.cwd?r.join(i.cwd,t):t,n;try{n=await h(e)}catch{}if(!n||this.closed)return;a.push(n)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(E.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,o=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(o,n);let s={timeoutObject:a,clear:o,count:0};return r.set(t,s),s}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let a=this.options.awaitWriteFinish;if(typeof a!=`object`)return;let o=a.pollInterval,s,l=e;this.options.cwd&&!r.isAbsolute(e)&&(l=r.join(this.options.cwd,e));let u=new Date,d=this._pendingWrites;function f(n){c(l,(r,a)=>{if(r||!d.has(e)){r&&r.code!==`ENOENT`&&i(r);return}let c=Number(new Date);n&&a.size!==n.size&&(d.get(e).lastChange=c),c-d.get(e).lastChange>=t?(d.delete(e),i(void 0,a)):s=setTimeout(f,o,a)})}d.has(e)||(d.set(e,{lastChange:u,cancelWait:()=>(d.delete(e),clearTimeout(s),n)}),s=setTimeout(f,o))}_isIgnored(e,t){if(this.options.atomic&&Ne.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(X(e));this._userIgnored=De([...[...this._ignoredPaths].map(X(e)),...t],void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new Z(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=r.resolve(e);return this._watched.has(t)||this._watched.set(t,new Le(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,n){let i=r.join(e,t),a=r.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(a)),!this._throttle(`remove`,i,100))return;!n&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(e=>this._remove(i,e));let o=this._getWatchedDir(e),s=o.has(t);o.remove(t),this._symlinkPaths.has(a)&&this._symlinkPaths.delete(a);let c=i;if(this.options.cwd&&(c=r.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===E.ADD)return;this._watched.delete(i),this._watched.delete(a);let l=n?E.UNLINK_DIR:E.UNLINK;s&&!this._isIgnored(i)&&this._emit(l,i),this._closePath(i)}_closePath(e){this._closeFile(e);let t=r.dirname(e);this._getWatchedDir(t).remove(r.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=ie(e,{type:E.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(pe,()=>{n=void 0}),n.once(`end`,()=>{n&&(this._streams.delete(n),n=void 0)}),n}},$={watch:Oe,FSWatcher:Q}}));export{Oe as a,Be as i,Z as n,$ as r,Q as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{f as n,s as r}from"./envUtils-BWeoiL4Y.js";import{Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Ac as u,Pc as d,Sc as f,dn as p,on as m}from"./paths-BBvuDQl9.js";import{a as h,n as g}from"./env-chR0gV31.js";import{Dx as _,MS as v,Ox as y,jS as b}from"./loadAgentsDir-DI1a76pd.js";import{n as x,t as S}from"./browser-fLRXxIsQ.js";import{c as C,d as w,t as T}from"./common-CMCv4N_v.js";import{n as E,t as D}from"./setup-B1JbPepL.js";function O({onDone:e,isExtensionInstalled:t,configEnabled:r,isClaudeAISubscriber:i,isWSL:s}){let l=v(e=>e.mcp.clients),[u,f]=(0,k.useState)(0),[p,m]=(0,k.useState)(r??!1),[h,g]=(0,k.useState)(!1),[y,b]=(0,k.useState)(t),S=process.env.USER_TYPE===`ant`&&n(),C=l.find(e=>e.name===T)?.type===`connected`;function D(e){S?x(e):w(e)}function O(e){switch(e){case`install-extension`:f(e=>e+1),g(!0),D(j);break;case`reconnect`:f(e=>e+1),E().then(e=>{b(e),e&&g(!1)}),D(N);break;case`manage-permissions`:f(e=>e+1),D(M);break;case`toggle-default`:{let e=!p;d(t=>({...t,claudeInChromeDefaultEnabled:e})),m(e);break}}}let P=[],F=y?``:` (requires extension)`;!y&&!S&&P.push({label:`Install Chrome extension`,value:`install-extension`}),P.push({label:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{children:`Manage permissions`}),(0,A.jsx)(a,{dimColor:!0,children:F})]}),value:`manage-permissions`},{label:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{children:`Reconnect extension`}),(0,A.jsx)(a,{dimColor:!0,children:F})]}),value:`reconnect`},{label:`Enabled by default: ${p?`Yes`:`No`}`,value:`toggle-default`});let I=s||process.env.USER_TYPE!==`ant`&&!i;return(0,A.jsx)(o,{title:`Claude in Chrome (Beta)`,onCancel:()=>e(),color:`chromeYellow`,children:(0,A.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,A.jsx)(a,{children:`Claude in Chrome works with the Chrome extension to let you control your browser directly from Claude Code. Navigate websites, fill forms, capture screenshots, record GIFs, and debug with console logs and network requests.`}),s&&(0,A.jsx)(a,{color:`error`,children:`Claude in Chrome is not supported in WSL at this time.`}),process.env.USER_TYPE!==`ant`&&!i&&(0,A.jsx)(a,{color:`error`,children:`Claude in Chrome requires a claude.ai subscription.`}),!I&&(0,A.jsxs)(A.Fragment,{children:[!S&&(0,A.jsxs)(c,{flexDirection:`column`,children:[(0,A.jsxs)(a,{children:[`Status: `,C?(0,A.jsx)(a,{color:`success`,children:`Enabled`}):(0,A.jsx)(a,{color:`inactive`,children:`Disabled`})]}),(0,A.jsxs)(a,{children:[`Extension:`,` `,y?(0,A.jsx)(a,{color:`success`,children:`Installed`}):(0,A.jsx)(a,{color:`warning`,children:`Not detected`})]})]}),(0,A.jsx)(_,{options:P,onChange:O,hideIndexes:!0},u),h&&(0,A.jsxs)(a,{color:`warning`,children:[`Once installed, select `,`"Reconnect extension"`,` to connect.`]}),(0,A.jsxs)(a,{children:[(0,A.jsx)(a,{dimColor:!0,children:`Usage: `}),(0,A.jsx)(a,{children:`claude --chrome`}),(0,A.jsx)(a,{dimColor:!0,children:` or `}),(0,A.jsx)(a,{children:`claude --no-chrome`})]}),(0,A.jsx)(a,{dimColor:!0,children:`Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on.`})]}),(0,A.jsx)(a,{dimColor:!0,children:`Learn more: https://code.claude.com/docs/en/chrome`})]})})}var k,A,j,M,N,P;e((()=>{k=t(i(),1),y(),s(),b(),m(),S(),C(),D(),u(),h(),r(),A=l(),j=`https://claude.ai/chrome`,M=`https://clau.de/chrome/permissions`,N=`https://clau.de/chrome/reconnect`,P=async function(e){let t=await E(),n=f(),r=p(),i=g.isWslEnvironment();return(0,A.jsx)(O,{onDone:e,isExtensionInstalled:t,configEnabled:n.claudeInChromeDefaultEnabled,isClaudeAISubscriber:r,isWSL:i})}}))();export{P as call};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./defineProperty-80gRi2ZW.js";import{Ln as n,wn as r}from"./schemas-BGAvj1T4.js";import{E as i,T as a,w as o}from"./debug-UI3T040K.js";import{n as s,t as c}from"./lazySchema-2sOku3cX.js";import{c as l,o as u,s as d}from"./common-CMCv4N_v.js";import{homedir as f,platform as p}from"os";import{join as m}from"path";import{appendFile as h,chmod as g,mkdir as _,readdir as v,rmdir as y,stat as b,unlink as x}from"fs/promises";import{createServer as S}from"net";c(),o(),l(),e();var C=`1.0.0`,w=1024*1024,T=process.env.USER_TYPE===`ant`?m(f(),`.claude`,`debug`,`chrome-native-host.txt`):void 0;function E(e,...t){T&&h(T,`[${new Date().toISOString()}] [Claude Chrome Native Host] ${e}${t.length>0?` `+i(t):``}\n`).catch(()=>{}),console.error(`[Claude Chrome Native Host] ${e}`,...t)}function D(e){let t=Buffer.from(e,`utf-8`),n=Buffer.alloc(4);n.writeUInt32LE(t.length,0),process.stdout.write(n),process.stdout.write(t)}async function O(){E(`Initializing...`);let e=new A,t=new j;for(await e.start();;){let n=await t.read();if(n===null)break;await e.handleMessage(n)}await e.stop()}var k=s(()=>r({type:n()}).passthrough()),A=class{constructor(){t(this,`mcpClients`,new Map),t(this,`nextClientId`,1),t(this,`server`,null),t(this,`running`,!1),t(this,`socketPath`,null)}async start(){if(!this.running){if(this.socketPath=u(),p()!==`win32`){let e=d();try{(await b(e)).isDirectory()||await x(e)}catch{}await _(e,{recursive:!0,mode:448}),await g(e,448).catch(()=>{});try{let t=await v(e);for(let n of t){if(!n.endsWith(`.sock`))continue;let t=parseInt(n.replace(`.sock`,``),10);if(!isNaN(t))try{process.kill(t,0)}catch{await x(m(e,n)).catch(()=>{}),E(`Removed stale socket for PID ${t}`)}}}catch{}}if(E(`Creating socket listener: ${this.socketPath}`),this.server=S(e=>this.handleMcpClient(e)),await new Promise((e,t)=>{this.server.listen(this.socketPath,()=>{E(`Socket server listening for connections`),this.running=!0,e()}),this.server.on(`error`,e=>{E(`Socket server error:`,e),t(e)})}),p()!==`win32`)try{await g(this.socketPath,384),E(`Socket permissions set to 0600`)}catch(e){E(`Failed to set socket permissions:`,e)}}}async stop(){if(this.running){for(let[,e]of this.mcpClients)e.socket.destroy();if(this.mcpClients.clear(),this.server&&(await new Promise(e=>{this.server.close(()=>e())}),this.server=null),p()!==`win32`&&this.socketPath){try{await x(this.socketPath),E(`Cleaned up socket file`)}catch{}try{let e=d();(await v(e)).length===0&&(await y(e),E(`Removed empty socket directory`))}catch{}}this.running=!1}}async isRunning(){return this.running}async getClientCount(){return this.mcpClients.size}async handleMessage(e){let t;try{t=a(e)}catch(e){E(`Invalid JSON from Chrome:`,e.message),D(i({type:`error`,error:`Invalid message format`}));return}let n=k().safeParse(t);if(!n.success){E(`Invalid message from Chrome:`,n.error.message),D(i({type:`error`,error:`Invalid message format`}));return}let r=n.data;switch(E(`Handling Chrome message type: ${r.type}`),r.type){case`ping`:E(`Responding to ping`),D(i({type:`pong`,timestamp:Date.now()}));break;case`get_status`:D(i({type:`status_response`,native_host_version:C}));break;case`tool_response`:if(this.mcpClients.size>0){E(`Forwarding tool response to ${this.mcpClients.size} MCP clients`);let{type:e,...t}=r,n=Buffer.from(i(t),`utf-8`),a=Buffer.alloc(4);a.writeUInt32LE(n.length,0);let o=Buffer.concat([a,n]);for(let[e,t]of this.mcpClients)try{t.socket.write(o)}catch(t){E(`Failed to send to MCP client ${e}:`,t)}}break;case`notification`:if(this.mcpClients.size>0){E(`Forwarding notification to ${this.mcpClients.size} MCP clients`);let{type:e,...t}=r,n=Buffer.from(i(t),`utf-8`),a=Buffer.alloc(4);a.writeUInt32LE(n.length,0);let o=Buffer.concat([a,n]);for(let[e,t]of this.mcpClients)try{t.socket.write(o)}catch(t){E(`Failed to send notification to MCP client ${e}:`,t)}}break;default:E(`Unknown message type: ${r.type}`),D(i({type:`error`,error:`Unknown message type: ${r.type}`}))}}handleMcpClient(e){let t=this.nextClientId++,n={id:t,socket:e,buffer:Buffer.alloc(0)};this.mcpClients.set(t,n),E(`MCP client ${t} connected. Total clients: ${this.mcpClients.size}`),D(i({type:`mcp_connected`})),e.on(`data`,r=>{for(n.buffer=Buffer.concat([n.buffer,r]);n.buffer.length>=4;){let r=n.buffer.readUInt32LE(0);if(r===0||r>w){E(`Invalid message length from MCP client ${t}: ${r}`),e.destroy();return}if(n.buffer.length<4+r)break;let o=n.buffer.slice(4,4+r);n.buffer=n.buffer.slice(4+r);try{let e=a(o.toString(`utf-8`));E(`Forwarding tool request from MCP client ${t}: ${e.method}`),D(i({type:`tool_request`,method:e.method,params:e.params}))}catch(e){E(`Failed to parse tool request from MCP client ${t}:`,e)}}}),e.on(`error`,e=>{E(`MCP client ${t} error: ${e}`)}),e.on(`close`,()=>{E(`MCP client ${t} disconnected. Remaining clients: ${this.mcpClients.size-1}`),this.mcpClients.delete(t),D(i({type:`mcp_disconnected`}))})}},j=class{constructor(){t(this,`buffer`,Buffer.alloc(0)),t(this,`pendingResolve`,null),t(this,`closed`,!1),process.stdin.on(`data`,e=>{this.buffer=Buffer.concat([this.buffer,e]),this.tryProcessMessage()}),process.stdin.on(`end`,()=>{this.closed=!0,this.pendingResolve&&(this.pendingResolve(null),this.pendingResolve=null)}),process.stdin.on(`error`,()=>{this.closed=!0,this.pendingResolve&&(this.pendingResolve(null),this.pendingResolve=null)})}tryProcessMessage(){if(!this.pendingResolve||this.buffer.length<4)return;let e=this.buffer.readUInt32LE(0);if(e===0||e>w){E(`Invalid message length: ${e}`),this.pendingResolve(null),this.pendingResolve=null;return}if(this.buffer.length<4+e)return;let t=this.buffer.subarray(4,4+e);this.buffer=this.buffer.subarray(4+e);let n=t.toString(`utf-8`);this.pendingResolve(n),this.pendingResolve=null}async read(){if(this.closed)return null;if(this.buffer.length>=4){let e=this.buffer.readUInt32LE(0);if(e>0&&e<=w&&this.buffer.length>=4+e){let t=this.buffer.subarray(4,4+e);return this.buffer=this.buffer.subarray(4+e),t.toString(`utf-8`)}}return new Promise(e=>{this.pendingResolve=e,this.tryProcessMessage()})}};export{O as runChromeNativeHost};
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>o.call(e,`module.exports`)?e[`module.exports`]:u(n({},`__esModule`,{value:!0}),e),p=e(import.meta.url);export{f as a,p as i,s as n,d as o,l as r,c as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";function t(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}var n=e((()=>{}));function r(e,n){t(e,n),n.add(e)}var i=e((()=>{n()}));function a(e,n,r){t(e,n),n.set(e,r)}var o=e((()=>{n()}));function s(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}var c=e((()=>{}));function l(e,t){return e.get(s(e,t))}var u=e((()=>{c()}));function d(e,t,n){return e.set(s(e,t),n),n}var f=e((()=>{c()}));export{s as a,o as c,u as i,r as l,f as n,c as o,l as r,a as s,d as t,i as u};
@@ -0,0 +1 @@
1
+ import{R as e,V as t}from"./debug-UI3T040K.js";import{o as n,s as r}from"./log-CzsijfHZ.js";import{i,o as a,t as o}from"./platform-CuyedWpe.js";import{a as s,i as c,s as l,u}from"./types-Csi32ZXh.js";import{homedir as d}from"os";import{join as f}from"path";import{readFile as p,readdir as m,stat as h}from"fs/promises";s(),t(),l(),n(),a();async function g(){let e=i();if(!o.includes(e))throw Error(`Unsupported platform: ${e} - Claude Desktop integration only works on macOS and WSL.`);if(e===`macos`)return f(d(),`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);let t=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,`/`):null;if(t){let e=`/mnt/c${t.replace(/^[A-Z]:/,``)}/AppData/Roaming/Claude/claude_desktop_config.json`;try{return await h(e),e}catch{}}try{let e=`/mnt/c/Users`;try{let t=await m(e,{withFileTypes:!0});for(let n of t){if(n.name===`Public`||n.name===`Default`||n.name===`Default User`||n.name===`All Users`)continue;let t=f(e,n.name,`AppData`,`Roaming`,`Claude`,`claude_desktop_config.json`);try{return await h(t),t}catch{}}}catch{}}catch(e){r(e)}throw Error(`Could not find Claude Desktop config file in Windows. Make sure Claude Desktop is installed on Windows.`)}async function _(){if(!o.includes(i()))throw Error(`Unsupported platform - Claude Desktop integration only works on macOS and WSL.`);try{let t=await g(),n;try{n=await p(t,{encoding:`utf8`})}catch(t){if(e(t)===`ENOENT`)return{};throw t}let r=u(n);if(!r||typeof r!=`object`)return{};let i=r.mcpServers;if(!i||typeof i!=`object`)return{};let a={};for(let[e,t]of Object.entries(i)){if(!t||typeof t!=`object`)continue;let n=c().safeParse(t);n.success&&(a[e]=n.data)}return a}catch(e){return r(e),{}}}export{_ as readClaudeDesktopMcpServers};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{L as t,V as n,d as r,s as i}from"./debug-UI3T040K.js";import{i as a,n as o,r as s}from"./computerUseLock-BjoDJH2h.js";import{f as c,i as l,p as u,t as d}from"./escHotkey-Cyz0yyh1.js";async function f(e){let n=e.getAppState().computerUseMcpState?.hiddenDuringTurn;if(n&&n.size>0){let{unhideComputerUseApps:i}=await import(`./executor-BHEuNh5F.js`),a=i([...n]).catch(e=>r(`[Computer Use MCP] auto-unhide failed: ${t(e)}`)),o=u(),s=setTimeout(o.resolve,p);await Promise.race([a,o.promise]).finally(()=>clearTimeout(s)),e.setAppState(e=>e.computerUseMcpState?.hiddenDuringTurn===void 0?e:{...e,computerUseMcpState:{...e.computerUseMcpState,hiddenDuringTurn:void 0}})}if(s()){try{l()}catch(e){r(`[Computer Use MCP] unregisterEscHotkey failed: ${t(e)}`)}await a()&&e.sendOSNotification?.({message:`Claude is done using your computer`,notificationType:`computer_use_exit`})}}var p;e((()=>{i(),n(),c(),o(),d(),p=5e3}))();export{f as cleanupComputerUseAfterTurn};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./conversation-DKlz47xf.js";var r;e((()=>{t(),r=async(e,t)=>(await n(t),{type:`text`,value:``})}))();export{r as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./bundledMode-kSQejuY4.js";import{i as r,r as i}from"./shellQuote-DgjT8KBA.js";import{spawn as a}from"child_process";function o(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`-d`||i.startsWith(`-d `)||i.startsWith(`-d `)){n.push(i),i===`-d`&&r+1<e.length&&n.push(e[++r]);continue}if(i.startsWith(`-d`)&&i.includes(`:`)){n.push(i);continue}if(i===`--feature`){n.push(i),r+1<e.length&&n.push(e[++r]);continue}if(/^--inspect(-brk)?(=|$)/.test(i)){n.push(i);continue}if(i.startsWith(`--`)&&!i.includes(`=`)&&r+1<e.length){if(t())continue;n.push(i),n.push(e[++r]);continue}i.startsWith(`-`)&&!t()&&n.push(i)}return n}function s(e,n){let r=n?.env??process.env,i=t()||!p?[...f,...e]:[...f,p,...e],a={...r};return h&&(process.env.CLAUDE_CODE_GIT_BASH_PATH&&!a.CLAUDE_CODE_GIT_BASH_PATH&&(a.CLAUDE_CODE_GIT_BASH_PATH=process.env.CLAUDE_CODE_GIT_BASH_PATH),process.env.SHELL&&!a.SHELL&&(a.SHELL=process.env.SHELL)),{execPath:m,args:i,env:a,windowsHide:h}}function c(e,t){return a(e.execPath,e.args,{...t,env:{...e.env,...t.env},windowsHide:e.windowsHide})}function l(e){return r([e.execPath,...e.args])}function u(){return f}function d(){return p}var f,p,m,h,g=e((()=>{n(),i(),f=Object.freeze(o(process.execArgv)),p=process.argv[1],m=process.execPath,h=process.platform===`win32`}));export{l as a,g as i,u as n,c as o,d as r,s as t};
@@ -0,0 +1,7 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-80gRi2ZW.js";var r,i,a=e((()=>{r={warningEmitted:!1},i=e=>{e&&!r.warningEmitted&&parseInt(e.substring(1,e.indexOf(`.`)))<20&&(r.warningEmitted=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
2
+ no longer support Node.js ${e} in January 2026.
3
+
4
+ To continue receiving updates to AWS services, bug fixes, and security
5
+ updates please upgrade to a supported Node.js LTS version.
6
+
7
+ More information can be found at: https://a.co/c895JFp`))}}));function o(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}var s=e((()=>{})),c,l,u=e((()=>{(function(e){e.STANDARD=`standard`,e.ADAPTIVE=`adaptive`})(c||(c={})),l=c.STANDARD})),d,f,p,m,h,g=e((()=>{d=[`BandwidthLimitExceeded`,`EC2ThrottledException`,`LimitExceededException`,`PriorRequestNotComplete`,`ProvisionedThroughputExceededException`,`RequestLimitExceeded`,`RequestThrottled`,`RequestThrottledException`,`SlowDown`,`ThrottledException`,`Throttling`,`ThrottlingException`,`TooManyRequestsException`,`TransactionInProgressException`],f=[`TimeoutError`,`RequestTimeout`,`RequestTimeoutException`],p=[500,502,503,504],m=[`ECONNRESET`,`ECONNREFUSED`,`EPIPE`,`ETIMEDOUT`],h=[`EHOSTUNREACH`,`ENETUNREACH`,`ENOTFOUND`]}));function _(e){return e.code===`ERR_HTTP2_STREAM_ERROR`&&e.message.includes(`NGHTTP2_REFUSED_STREAM`)}var v,y,b,x,S,C,w=e((()=>{g(),v=e=>e?.$retryable!==void 0,y=e=>e.$metadata?.clockSkewCorrected,b=e=>{let t=new Set([`Failed to fetch`,`NetworkError when attempting to fetch resource`,`The Internet connection appears to be offline`,`Load failed`,`Network request failed`]);return e&&e instanceof TypeError?t.has(e.message):!1},x=e=>e.$metadata?.httpStatusCode===429||d.includes(e.name)||e.$retryable?.throttling==1,S=(e,t=0)=>v(e)||y(e)||f.includes(e.name)||m.includes(e?.code||``)||h.includes(e?.code||``)||p.includes(e.$metadata?.httpStatusCode||0)||b(e)||_(e)||e.cause!==void 0&&t<=10&&S(e.cause,t+1),C=e=>{if(e.$metadata?.httpStatusCode!==void 0){let t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!S(e)}return!1}})),T,E=e((()=>{w(),t(),T=class e{constructor(e){n(this,`beta`,void 0),n(this,`minCapacity`,void 0),n(this,`minFillRate`,void 0),n(this,`scaleConstant`,void 0),n(this,`smooth`,void 0),n(this,`enabled`,!1),n(this,`availableTokens`,0),n(this,`lastMaxRate`,0),n(this,`measuredTxRate`,0),n(this,`requestCount`,0),n(this,`fillRate`,void 0),n(this,`lastThrottleTime`,void 0),n(this,`lastTimestamp`,0),n(this,`lastTxRateBucket`,void 0),n(this,`maxCapacity`,void 0),n(this,`timeWindow`,0),this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();let n=e;if(n?.errorType===`THROTTLING`||x(n?.error??e)){let e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());let r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.availableTokens){let n=(t-this.availableTokens)/this.fillRate*1e3;await new Promise(t=>e.setTimeoutFn(t,n))}this.availableTokens-=t}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise((this.lastMaxRate*(1-this.beta)/this.scaleConstant)**(1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*(e-this.lastThrottleTime-this.timeWindow)**3+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){let e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}},n(T,`setTimeoutFn`,setTimeout)})),D,O,k,A=e((()=>{D=20*1e3,O=`amz-sdk-invocation-id`,k=`amz-sdk-request`})),j,M=e((()=>{t(),j=class e{static delay(){return e.v2026?50:100}static throttlingDelay(){return e.v2026?1e3:500}static cost(){return e.v2026?14:5}static throttlingCost(){return e.v2026?5:10}static modifiedCostType(){return e.v2026?`THROTTLING`:`TRANSIENT`}},n(j,`v2026`,typeof process<`u`&&process.env?.SMITHY_NEW_RETRIES_2026===`true`)})),N,P=e((()=>{A(),M(),t(),N=class{constructor(){n(this,`x`,j.delay())}computeNextBackoffDelay(e){let t=Math.random()*Math.min(this.x*2**e,D);return Math.floor(t)}setDelayBase(e){this.x=e}}})),F,I=e((()=>{A(),t(),F=class{constructor(e,t,r,i){n(this,`delay`,void 0),n(this,`count`,void 0),n(this,`cost`,void 0),n(this,`longPoll`,void 0),this.delay=e,this.count=t,this.cost=r,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(D,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}})),L,R,z=e((()=>{u(),A(),P(),I(),M(),t(),L={incompatible:1,attempts:2,capacity:3},R=class{constructor(e){n(this,`mode`,c.STANDARD),n(this,`capacity`,500),n(this,`retryBackoffStrategy`,void 0),n(this,`maxAttemptsProvider`,void 0),n(this,`baseDelay`,void 0),typeof e==`number`?this.maxAttemptsProvider=async()=>e:typeof e==`function`?this.maxAttemptsProvider=e:e&&typeof e==`object`&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??(this.maxAttemptsProvider=async()=>3),this.baseDelay??(this.baseDelay=j.delay()),this.retryBackoffStrategy??(this.retryBackoffStrategy=new N)}async acquireInitialRetryToken(e){return new F(j.delay(),0,void 0,j.v2026&&e.includes(`:longpoll`))}async refreshRetryTokenForRetry(e,t){let n=await this.getMaxAttempts(),r=this.retryCode(e,t,n),i=r===0,a=e.isLongPoll?.();if(i||a){let n=t.errorType;this.retryBackoffStrategy.setDelayBase(n===`THROTTLING`?j.throttlingDelay():this.baseDelay);let o=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),s=o;if(t.retryAfterHint instanceof Date&&(s=Math.max(o,Math.min(t.retryAfterHint.getTime()-Date.now(),o+5e3))),i){let t=this.getCapacityCost(n);return this.capacity-=t,new F(s,e.getRetryCount()+1,t,e.isLongPoll?.()??!1)}else throw Object.assign(Error(`No retry token available`),{$backoff:j.v2026&&r===L.capacity&&a?s:0})}throw Error(`No retry token available`)}recordSuccess(e){this.capacity=Math.min(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of 3`),3}}retryCode(e,t,n){let r=e.getRetryCount()+1,i=this.isRetryableError(t.errorType)?0:L.incompatible,a=r<n?0:L.attempts,o=this.capacity>=this.getCapacityCost(t.errorType)?0:L.capacity;return i||a||o}getCapacityCost(e){return e===j.modifiedCostType()?j.throttlingCost():j.cost()}isRetryableError(e){return e===`THROTTLING`||e===`TRANSIENT`}}})),B,V=e((()=>{u(),E(),z(),t(),B=class{constructor(e,t){n(this,`mode`,c.ADAPTIVE),n(this,`rateLimiter`,void 0),n(this,`standardRetryStrategy`,void 0);let{rateLimiter:r}=t??{};this.rateLimiter=r??new T,this.standardRetryStrategy=t?new R({maxAttempts:typeof e==`number`?e:3,...t}):new R(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}})),H=e((()=>{})),U=e((()=>{})),W=e((()=>{V(),H(),E(),z(),u(),A(),U(),M()}));function G(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}var K=e((()=>{W(),j.v2026||(j.v2026=typeof process==`object`&&process.env?.AWS_NEW_RETRIES_2026===`true`)}));function q(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}var J=e((()=>{})),Y=e((()=>{a(),s(),K(),J()}));export{B as a,k as c,x as d,S as f,i as g,o as h,W as i,w as l,c as m,q as n,R as o,l as p,G as r,O as s,Y as t,C as u};
@@ -0,0 +1 @@
1
+ import{la as e,ua as t}from"./paths-BBvuDQl9.js";t();export{e as getOrganizationUUID};
@@ -0,0 +1,35 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";function t(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var n,r=e((()=>{n=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)}})),i,a,o,s,c,l,u,d,ee,f,te,p,ne,m=e((()=>{r(),i=class extends Error{},a=class e extends i{constructor(t,n,r,i,a){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`request-id`),this.error=n,this.type=a??null}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,r,i,a){if(!t||!a)return new s({message:i,cause:n(r)});let o=r,c=o?.error?.type;return t===400?new l(t,o,i,a,c):t===401?new u(t,o,i,a,c):t===403?new d(t,o,i,a,c):t===404?new ee(t,o,i,a,c):t===409?new f(t,o,i,a,c):t===422?new te(t,o,i,a,c):t===429?new p(t,o,i,a,c):t>=500?new ne(t,o,i,a,c):new e(t,o,i,a,c)}},o=class extends a{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},s=class extends a{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},c=class extends s{constructor({message:e}={}){super({message:e??`Request timed out.`})}},l=class extends a{},u=class extends a{},d=class extends a{},ee=class extends a{},f=class extends a{},te=class extends a{},p=class extends a{},ne=class extends a{}}));function h(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function g(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var _=e((()=>{})),re,ie=e((()=>{re=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return re=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^n()&15>>e/4).toString(16))}}));function ae(e){return typeof e==`object`?e??{}:{}}function oe(e){if(!e)return!0;for(let t in e)return!1;return!0}function se(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ce,le,ue,de,fe,pe,me=e((()=>{m(),ce=/^[a-z][a-z0-9+.-]*:/i,le=e=>ce.test(e),ue=e=>(ue=Array.isArray,ue(e)),de=ue,fe=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new i(`${e} must be an integer`);if(t<0)throw new i(`${e} must be a positive integer`);return t},pe=e=>{try{return JSON.parse(e)}catch{return}}})),he,ge=e((()=>{he=e=>new Promise(t=>setTimeout(t,e))})),v,_e=e((()=>{v=`0.81.0`}));function ve(){return typeof Deno<`u`&&Deno.build!=null?`deno`:typeof EdgeRuntime<`u`?`edge`:Object.prototype.toString.call(globalThis.process===void 0?0:globalThis.process)===`[object process]`?`node`:`unknown`}function ye(){if(typeof navigator>`u`||!navigator)return null;for(let{key:e,pattern:t}of[{key:`edge`,pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`chrome`,pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`firefox`,pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`safari`,pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n)return{browser:e,version:`${n[1]||0}.${n[2]||0}.${n[3]||0}`}}return null}var be,xe,Se,Ce,we,Te,Ee=e((()=>{_e(),be=()=>typeof window<`u`&&window.document!==void 0&&typeof navigator<`u`,xe=()=>{let e=ve();if(e===`deno`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":v,"X-Stainless-OS":Ce(Deno.build.os),"X-Stainless-Arch":Se(Deno.build.arch),"X-Stainless-Runtime":`deno`,"X-Stainless-Runtime-Version":typeof Deno.version==`string`?Deno.version:Deno.version?.deno??`unknown`};if(typeof EdgeRuntime<`u`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":v,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":`edge`,"X-Stainless-Runtime-Version":globalThis.process.version};if(e===`node`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":v,"X-Stainless-OS":Ce(globalThis.process.platform??`unknown`),"X-Stainless-Arch":Se(globalThis.process.arch??`unknown`),"X-Stainless-Runtime":`node`,"X-Stainless-Runtime-Version":globalThis.process.version??`unknown`};let t=ye();return t?{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":v,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":v,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`unknown`,"X-Stainless-Runtime-Version":`unknown`}},Se=e=>e===`x32`?`x32`:e===`x86_64`||e===`x64`?`x64`:e===`arm`?`arm`:e===`aarch64`||e===`arm64`?`arm64`:e?`other:${e}`:`unknown`,Ce=e=>(e=e.toLowerCase(),e.includes(`ios`)?`iOS`:e===`android`?`Android`:e===`darwin`?`MacOS`:e===`win32`?`Windows`:e===`freebsd`?`FreeBSD`:e===`openbsd`?`OpenBSD`:e===`linux`?`Linux`:e?`Other:${e}`:`Unknown`),Te=()=>we??(we=xe())}));function De(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Oe(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ke(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Oe({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function Ae(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function je(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Me=e((()=>{})),Ne,Pe=e((()=>{Ne=({headers:e,body:t})=>({bodyHeaders:{"content-type":`application/json`},body:JSON.stringify(t)})}));function Fe(e){return Object.entries(e).filter(([e,t])=>t!==void 0).map(([e,t])=>{if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(t===null)return`${encodeURIComponent(e)}=`;throw new i(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join(`&`)}var Ie=e((()=>{m()}));function Le(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Re(e){let t;return(Be??(t=new globalThis.TextEncoder,Be=t.encode.bind(t)))(e)}function ze(e){let t;return(Ve??(t=new globalThis.TextDecoder,Ve=t.decode.bind(t)))(e)}var Be,Ve,He=e((()=>{}));function Ue(e,t){for(let n=t??0;n<e.length;n++){if(e[n]===10)return{preceding:n,index:n+1,carriage:!1};if(e[n]===13)return{preceding:n,index:n+1,carriage:!0}}return null}function We(e){for(let t=0;t<e.length-1;t++){if(e[t]===10&&e[t+1]===10||e[t]===13&&e[t+1]===13)return t+2;if(e[t]===13&&e[t+1]===10&&t+3<e.length&&e[t+2]===13&&e[t+3]===10)return t+4}return-1}var y,b,x,Ge=e((()=>{_(),He(),x=class{constructor(){y.set(this,void 0),b.set(this,void 0),h(this,y,new Uint8Array,`f`),h(this,b,null,`f`)}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?Re(e):e;h(this,y,Le([g(this,y,`f`),t]),`f`);let n=[],r;for(;(r=Ue(g(this,y,`f`),g(this,b,`f`)))!=null;){if(r.carriage&&g(this,b,`f`)==null){h(this,b,r.index,`f`);continue}if(g(this,b,`f`)!=null&&(r.index!==g(this,b,`f`)+1||r.carriage)){n.push(ze(g(this,y,`f`).subarray(0,g(this,b,`f`)-1))),h(this,y,g(this,y,`f`).subarray(g(this,b,`f`)),`f`),h(this,b,null,`f`);continue}let e=g(this,b,`f`)===null?r.preceding:r.preceding-1,t=ze(g(this,y,`f`).subarray(0,e));n.push(t),h(this,y,g(this,y,`f`).subarray(r.index),`f`),h(this,b,null,`f`)}return n}flush(){return g(this,y,`f`).length?this.decode(`
2
+ `):[]}},y=new WeakMap,b=new WeakMap,x.NEWLINE_CHARS=new Set([`
3
+ `,`\r`]),x.NEWLINE_REGEXP=/\r\n|[\n\r]/g}));function Ke(){}function qe(e,t,n){return!t||Je[e]>Je[n]?Ke:t[e].bind(t)}function S(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return Xe;let r=Ze.get(t);if(r&&r[0]===n)return r[1];let i={error:qe(`error`,t,n),warn:qe(`warn`,t,n),info:qe(`info`,t,n),debug:qe(`debug`,t,n)};return Ze.set(t,[n,i]),i}var Je,Ye,Xe,Ze,C,Qe=e((()=>{me(),Je={off:0,error:200,warn:300,info:400,debug:500},Ye=(e,t,n)=>{if(e){if(se(Je,e))return e;S(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Je))}`)}},Xe={error:Ke,warn:Ke,info:Ke,debug:Ke},Ze=new WeakMap,C=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`x-api-key`||e.toLowerCase()===`authorization`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t]))),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)}));async function*$e(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new i(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new i(`Attempted to iterate over a response with no body`);let n=new rt,r=new x,a=Ae(e.body);for await(let e of et(a))for(let t of r.decode(e)){let e=n.decode(t);e&&(yield e)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*et(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let e=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==`string`?Re(n):n,r=new Uint8Array(t.length+e.length);r.set(t),r.set(e,t.length),t=r;let i;for(;(i=We(t))!==-1;)yield t.slice(0,i),t=t.slice(i)}t.length>0&&(yield t)}function tt(e,t){let n=e.indexOf(t);return n===-1?[e,``,``]:[e.substring(0,n),t,e.substring(n+t.length)]}var nt,w,rt,it=e((()=>{_(),m(),Me(),Ge(),r(),me(),He(),Qe(),w=class e{constructor(e,t,n){this.iterator=e,nt.set(this,void 0),this.controller=t,h(this,nt,n,`f`)}static fromSSEResponse(n,r,o){let s=!1,c=o?S(o):console;async function*l(){if(s)throw new i("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let e=!1;try{for await(let e of $e(n,r)){if(e.event===`completion`)try{yield JSON.parse(e.data)}catch(t){throw c.error(`Could not parse message into JSON:`,e.data),c.error(`From chunk:`,e.raw),t}if(e.event===`message_start`||e.event===`message_delta`||e.event===`message_stop`||e.event===`content_block_start`||e.event===`content_block_delta`||e.event===`content_block_stop`)try{yield JSON.parse(e.data)}catch(t){throw c.error(`Could not parse message into JSON:`,e.data),c.error(`From chunk:`,e.raw),t}if(e.event!==`ping`&&e.event===`error`){let t=pe(e.data)??e.data,r=t?.error?.type;throw new a(void 0,t,void 0,n.headers,r)}}e=!0}catch(e){if(t(e))return;throw e}finally{e||r.abort()}}return new e(l,r,o)}static fromReadableStream(n,r,a){let o=!1;async function*s(){let e=new x,t=Ae(n);for await(let n of t)for(let t of e.decode(n))yield t;for(let t of e.flush())yield t}async function*c(){if(o)throw new i("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let e=!1;try{for await(let t of s())e||t&&(yield JSON.parse(t));e=!0}catch(e){if(t(e))return;throw e}finally{e||r.abort()}}return new e(c,r,a)}[(nt=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],r=this.iterator(),i=e=>({next:()=>{if(e.length===0){let e=r.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>i(t),this.controller,g(this,nt,`f`)),new e(()=>i(n),this.controller,g(this,nt,`f`))]}toReadableStream(){let e=this,t;return Oe({async start(){t=e[Symbol.asyncIterator]()},async pull(e){try{let{value:n,done:r}=await t.next();if(r)return e.close();let i=Re(JSON.stringify(n)+`
4
+ `);e.enqueue(i)}catch(t){e.error(t)}},async cancel(){await t.return?.()}})}},rt=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
5
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(`:`))return null;let[t,n,r]=tt(e,`:`);return r.startsWith(` `)&&(r=r.substring(1)),t===`event`?this.event=r:t===`data`&&this.data.push(r),null}}}));async function at(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:a}=t,o=await(async()=>{if(t.options.stream)return S(e).debug(`response`,n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller):w.fromSSEResponse(n,t.controller);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get(`content-type`)?.split(`;`)[0]?.trim();return r?.includes(`application/json`)||r?.endsWith(`+json`)?n.headers.get(`content-length`)===`0`?void 0:ot(await n.json(),n):await n.text()})();return S(e).debug(`[${r}] response parsed`,C({retryOfRequestLogID:i,url:n.url,status:n.status,body:o,durationMs:Date.now()-a})),o}function ot(e,t){return!e||typeof e!=`object`||Array.isArray(e)?e:Object.defineProperty(e,`_request_id`,{value:t.headers.get(`request-id`),enumerable:!1})}var st=e((()=>{it(),Qe()})),ct,lt,ut=e((()=>{_(),st(),lt=class e extends Promise{constructor(e,t,n=at){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,ct.set(this,void 0),h(this,ct,e,`f`)}_thenUnwrap(t){return new e(g(this,ct,`f`),this.responsePromise,async(e,n)=>ot(t(await this.parseResponse(e,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get(`request-id`)}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(g(this,ct,`f`),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}},ct=new WeakMap})),dt,ft,pt,T,mt,E=e((()=>{_(),m(),st(),ut(),me(),ft=class{constructor(e,t,n,r){dt.set(this,void 0),h(this,dt,e,`f`),this.options=r,this.response=t,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new i("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await g(this,dt,`f`).requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(dt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}},pt=class extends lt{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await at(e,t),t.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let t of e)yield t}},T=class extends ft{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;return e?{...this.options,query:{...ae(this.options.query),before_id:e}}:null}let e=this.last_id;return e?{...this.options,query:{...ae(this.options.query),after_id:e}}:null}},mt=class extends ft{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...ae(this.options.query),page:e}}:null}}}));function D(e,t,n){return _t(),new File(e,t??`unknown_file`,n)}function ht(e,t){let n=typeof e==`object`&&!!e&&(`name`in e&&e.name&&String(e.name)||`url`in e&&e.url&&String(e.url)||`filename`in e&&e.filename&&String(e.filename)||`path`in e&&e.path&&String(e.path))||``;return t?n.split(/[\\/]/).pop()||void 0:n}function gt(e){let t=typeof e==`function`?e:e.fetch,n=bt.get(t);if(n)return n;let r=(async()=>{try{let e=`Response`in t?t.Response:(await t(`data:,`)).constructor,n=new FormData;return n.toString()!==await new e(n).text()}catch{return!0}})();return bt.set(t,r),r}var _t,vt,yt,bt,xt,St,Ct,wt=e((()=>{Me(),_t=()=>{if(typeof File>`u`){let{process:e}=globalThis,t=typeof e?.versions?.node==`string`&&parseInt(e.versions.node.split(`.`))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":``))}},vt=e=>typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`,yt=async(e,t,n=!0)=>({...e,body:await xt(e.body,t,n)}),bt=new WeakMap,xt=async(e,t,n=!0)=>{if(!await gt(t))throw TypeError(`The provided fetch function does not support file uploads with the current global FormData class.`);let r=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>Ct(r,e,t,n))),r},St=e=>e instanceof Blob&&`name`in e,Ct=async(e,t,n,r)=>{if(n!==void 0){if(n==null)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n==`string`||typeof n==`number`||typeof n==`boolean`)e.append(t,String(n));else if(n instanceof Response){let i={},a=n.headers.get(`Content-Type`);a&&(i={type:a}),e.append(t,D([await n.blob()],ht(n,r),i))}else if(vt(n))e.append(t,D([await new Response(ke(n)).blob()],ht(n,r)));else if(St(n))e.append(t,D([n],ht(n,r),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(n=>Ct(e,t+`[]`,n,r)));else if(typeof n==`object`)await Promise.all(Object.entries(n).map(([n,i])=>Ct(e,`${t}[${n}]`,i,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}));async function Tt(e,t,n){if(_t(),e=await e,t||(t=ht(e,!0)),kt(e))return e instanceof File&&t==null&&n==null?e:D([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(At(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),D(await Et(r),t,n)}let r=await Et(e);if(!n?.type){let e=r.find(e=>typeof e==`object`&&`type`in e&&e.type);typeof e==`string`&&(n={...n,type:e})}return D(r,t,n)}async function Et(e){let t=[];if(typeof e==`string`||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(Ot(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(vt(e))for await(let n of e)t.push(...await Et(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:``}${Dt(e)}`)}return t}function Dt(e){return typeof e!=`object`||!e?``:`; props: [${Object.getOwnPropertyNames(e).map(e=>`"${e}"`).join(`, `)}]`}var Ot,kt,At,jt=e((()=>{wt(),Ot=e=>typeof e==`object`&&!!e&&typeof e.size==`number`&&typeof e.type==`string`&&typeof e.text==`function`&&typeof e.slice==`function`&&typeof e.arrayBuffer==`function`,kt=e=>typeof e==`object`&&!!e&&typeof e.name==`string`&&typeof e.lastModified==`number`&&Ot(e),At=e=>typeof e==`object`&&!!e&&typeof e.url==`string`&&typeof e.blob==`function`})),Mt=e((()=>{jt()})),Nt=e((()=>{})),O,k=e((()=>{O=class{constructor(e){this._client=e}}}));function*Pt(e){if(!e)return;if(Ft in e){let{values:t,nulls:n}=e;yield*t.entries();for(let e of n)yield[e,null];return}let t=!1,n;e instanceof Headers?n=e.entries():de(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let e of n){let n=e[0];if(typeof n!=`string`)throw TypeError(`expected header name to be a string`);let r=de(e[1])?e[1]:[e[1]],i=!1;for(let e of r)e!==void 0&&(t&&!i&&(i=!0,yield[n,null]),yield[n,e])}}var Ft,A,j=e((()=>{me(),Ft=Symbol.for(`brand.privateNullableHeaders`),A=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[i,a]of Pt(r)){let r=i.toLowerCase();e.has(r)||(t.delete(i),e.add(r)),a===null?(t.delete(i),n.add(r)):(t.append(i,a),n.delete(r))}}return{[Ft]:!0,values:t,nulls:n}}}));function It(e){return typeof e==`object`&&!!e&&M in e}function Lt(e,t){let n=new Set;if(e)for(let t of e)It(t)&&n.add(t[M]);if(t){for(let e of t)if(It(e)&&n.add(e[M]),Array.isArray(e.content))for(let t of e.content)It(t)&&n.add(t[M])}return Array.from(n)}function Rt(e,t){let n=Lt(e,t);return n.length===0?{}:{"x-stainless-helper":n.join(`, `)}}function zt(e){return It(e)?{"x-stainless-helper":e[M]}:{}}var M,Bt=e((()=>{M=Symbol(`anthropic.sdk.stainlessHelper`)}));function Vt(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Ht,Ut,N,P=e((()=>{m(),Ht=Object.freeze(Object.create(null)),Ut=(e=Vt)=>function(t,...n){if(t.length===1)return t[0];let r=!1,a=[],o=t.reduce((t,i,o)=>{/[?#]/.test(i)&&(r=!0);let s=n[o],c=(r?encodeURIComponent:e)(``+s);return o!==n.length&&(s==null||typeof s==`object`&&s.toString===Object.getPrototypeOf(Object.getPrototypeOf(s.hasOwnProperty??Ht)??Ht)?.toString)&&(c=s+``,a.push({start:t.length+i.length,length:c.length,error:`Value of type ${Object.prototype.toString.call(s).slice(8,-1)} is not a valid path parameter`})),t+i+(o===n.length?``:c)},``),s=o.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(s))!==null;)a.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can\'t be safely passed as a path parameter`});if(a.sort((e,t)=>e.start-t.start),a.length>0){let e=0,t=a.reduce((t,n)=>{let r=` `.repeat(n.start-e),i=`^`.repeat(n.length);return e=n.start+n.length,t+r+i},``);throw new i(`Path parameters result in path with invalid segments:\n${a.map(e=>e.error).join(`
6
+ `)}\n${o}\n${t}`)}return o},N=Ut(Vt)})),Wt,Gt=e((()=>{k(),E(),j(),Bt(),wt(),P(),Wt=class extends O{list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList(`/v1/files`,T,{query:r,...t,headers:A([{"anthropic-beta":[...n??[],`files-api-2025-04-14`].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/files/${e}`,{...n,headers:A([{"anthropic-beta":[...r??[],`files-api-2025-04-14`].toString()},n?.headers])})}download(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/files/${e}/content`,{...n,headers:A([{"anthropic-beta":[...r??[],`files-api-2025-04-14`].toString(),Accept:`application/binary`},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/files/${e}`,{...n,headers:A([{"anthropic-beta":[...r??[],`files-api-2025-04-14`].toString()},n?.headers])})}upload(e,t){let{betas:n,...r}=e;return this._client.post(`/v1/files`,yt({body:r,...t,headers:A([{"anthropic-beta":[...n??[],`files-api-2025-04-14`].toString()},zt(r.file),t?.headers])},this._client))}}})),Kt,qt=e((()=>{k(),E(),j(),P(),Kt=class extends O{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/models/${e}?beta=true`,{...n,headers:A([{...r?.toString()==null?void 0:{"anthropic-beta":r?.toString()}},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList(`/v1/models?beta=true`,T,{query:r,...t,headers:A([{...n?.toString()==null?void 0:{"anthropic-beta":n?.toString()}},t?.headers])})}}})),Jt=e((()=>{m()})),Yt,Xt=e((()=>{Yt={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}}));function Zt(e){return e?.output_format??e?.output_config?.format}function Qt(e,t,n){let r=Zt(t);return!t||!(`parse`in(r??{}))?{...e,content:e.content.map(e=>{if(e.type===`text`){let t=Object.defineProperty({...e},`parsed_output`,{value:null,enumerable:!1});return Object.defineProperty(t,`parsed`,{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return e}),parsed_output:null}:$t(e,t,n)}function $t(e,t,n){let r=null,i=e.content.map(e=>{if(e.type===`text`){let i=en(t,e.text);r===null&&(r=i);let a=Object.defineProperty({...e},`parsed_output`,{value:i,enumerable:!1});return Object.defineProperty(a,`parsed`,{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),i},enumerable:!1})}return e});return{...e,content:i,parsed_output:r}}function en(e,t){let n=Zt(e);if(n?.type!==`json_schema`)return null;try{return`parse`in n?n.parse(t):JSON.parse(t)}catch(e){throw new i(`Failed to parse structured output: ${e}`)}}var tn=e((()=>{m()})),nn,F,rn,an,on,sn=e((()=>{nn=e=>{let t=0,n=[];for(;t<e.length;){let r=e[t];if(r===`\\`){t++;continue}if(r===`{`){n.push({type:`brace`,value:`{`}),t++;continue}if(r===`}`){n.push({type:`brace`,value:`}`}),t++;continue}if(r===`[`){n.push({type:`paren`,value:`[`}),t++;continue}if(r===`]`){n.push({type:`paren`,value:`]`}),t++;continue}if(r===`:`){n.push({type:`separator`,value:`:`}),t++;continue}if(r===`,`){n.push({type:`delimiter`,value:`,`}),t++;continue}if(r===`"`){let i=``,a=!1;for(r=e[++t];r!==`"`;){if(t===e.length){a=!0;break}if(r===`\\`){if(t++,t===e.length){a=!0;break}i+=r+e[t],r=e[++t]}else i+=r,r=e[++t]}r=e[++t],a||n.push({type:`string`,value:i});continue}if(r&&/\s/.test(r)){t++;continue}let i=/[0-9]/;if(r&&i.test(r)||r===`-`||r===`.`){let a=``;for(r===`-`&&(a+=r,r=e[++t]);r&&i.test(r)||r===`.`;)a+=r,r=e[++t];n.push({type:`number`,value:a});continue}let a=/[a-z]/i;if(r&&a.test(r)){let i=``;for(;r&&a.test(r)&&t!==e.length;)i+=r,r=e[++t];if(i==`true`||i==`false`||i===`null`)n.push({type:`name`,value:i});else{t++;continue}continue}t++}return n},F=e=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case`separator`:return e=e.slice(0,e.length-1),F(e);case`number`:let n=t.value[t.value.length-1];if(n===`.`||n===`-`)return e=e.slice(0,e.length-1),F(e);case`string`:let r=e[e.length-2];if(r?.type===`delimiter`||r?.type===`brace`&&r.value===`{`)return e=e.slice(0,e.length-1),F(e);break;case`delimiter`:return e=e.slice(0,e.length-1),F(e)}return e},rn=e=>{let t=[];return e.map(e=>{e.type===`brace`&&(e.value===`{`?t.push(`}`):t.splice(t.lastIndexOf(`}`),1)),e.type===`paren`&&(e.value===`[`?t.push(`]`):t.splice(t.lastIndexOf(`]`),1))}),t.length>0&&t.reverse().map(t=>{t===`}`?e.push({type:`brace`,value:`}`}):t===`]`&&e.push({type:`paren`,value:`]`})}),e},an=e=>{let t=``;return e.map(e=>{switch(e.type){case`string`:t+=`"`+e.value+`"`;break;default:t+=e.value;break}}),t},on=e=>JSON.parse(an(rn(F(nn(e)))))})),cn=e((()=>{it()}));function ln(e){return e.type===`tool_use`||e.type===`server_tool_use`||e.type===`mcp_tool_use`}var I,L,R,un,dn,fn,pn,mn,hn,z,gn,_n,vn,B,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn=e((()=>{_(),sn(),Jt(),r(),cn(),tn(),kn=`__json_buf`,An=class e{constructor(e,n){I.add(this),this.messages=[],this.receivedMessages=[],L.set(this,void 0),R.set(this,null),this.controller=new AbortController,un.set(this,void 0),dn.set(this,()=>{}),fn.set(this,()=>{}),pn.set(this,void 0),mn.set(this,()=>{}),hn.set(this,()=>{}),z.set(this,{}),gn.set(this,!1),_n.set(this,!1),vn.set(this,!1),B.set(this,!1),yn.set(this,void 0),bn.set(this,void 0),xn.set(this,void 0),wn.set(this,e=>{if(h(this,_n,!0,`f`),t(e)&&(e=new o),e instanceof o)return h(this,vn,!0,`f`),this._emit(`abort`,e);if(e instanceof i)return this._emit(`error`,e);if(e instanceof Error){let t=new i(e.message);return t.cause=e,this._emit(`error`,t)}return this._emit(`error`,new i(String(e)))}),h(this,un,new Promise((e,t)=>{h(this,dn,e,`f`),h(this,fn,t,`f`)}),`f`),h(this,pn,new Promise((e,t)=>{h(this,mn,e,`f`),h(this,hn,t,`f`)}),`f`),g(this,un,`f`).catch(()=>{}),g(this,pn,`f`).catch(()=>{}),h(this,R,e,`f`),h(this,xn,n?.logger??console,`f`)}get response(){return g(this,yn,`f`)}get request_id(){return g(this,bn,`f`)}async withResponse(){h(this,B,!0,`f`);let e=await g(this,un,`f`);if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get(`request-id`)}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r,{logger:i}={}){let a=new e(n,{logger:i});for(let e of n.messages)a._addMessageParam(e);return h(a,R,{...n,stream:!0},`f`),a._run(()=>a._createMessage(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":`stream`}})),a}_run(e){e().then(()=>{this._emitFinal(),this._emit(`end`)},g(this,wn,`f`))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit(`message`,e)}async _createMessage(e,t,n){let r=n?.signal,i;r&&(r.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),r.addEventListener(`abort`,i));try{g(this,I,`m`,Tn).call(this);let{response:r,data:i}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(r);for await(let e of i)g(this,I,`m`,En).call(this,e);if(i.controller.signal?.aborted)throw new o;g(this,I,`m`,Dn).call(this)}finally{r&&i&&r.removeEventListener(`abort`,i)}}_connected(e){this.ended||(h(this,yn,e,`f`),h(this,bn,e?.headers.get(`request-id`),`f`),g(this,dn,`f`).call(this,e),this._emit(`connect`))}get ended(){return g(this,gn,`f`)}get errored(){return g(this,_n,`f`)}get aborted(){return g(this,vn,`f`)}abort(){this.controller.abort()}on(e,t){return(g(this,z,`f`)[e]||(g(this,z,`f`)[e]=[])).push({listener:t}),this}off(e,t){let n=g(this,z,`f`)[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(g(this,z,`f`)[e]||(g(this,z,`f`)[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{h(this,B,!0,`f`),e!==`error`&&this.once(`error`,n),this.once(e,t)})}async done(){h(this,B,!0,`f`),await g(this,pn,`f`)}get currentMessage(){return g(this,L,`f`)}async finalMessage(){return await this.done(),g(this,I,`m`,Sn).call(this)}async finalText(){return await this.done(),g(this,I,`m`,Cn).call(this)}_emit(e,...t){if(g(this,gn,`f`))return;e===`end`&&(h(this,gn,!0,`f`),g(this,mn,`f`).call(this));let n=g(this,z,`f`)[e];if(n&&(g(this,z,`f`)[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),e===`abort`){let e=t[0];!g(this,B,`f`)&&!n?.length&&Promise.reject(e),g(this,fn,`f`).call(this,e),g(this,hn,`f`).call(this,e),this._emit(`end`);return}if(e===`error`){let e=t[0];!g(this,B,`f`)&&!n?.length&&Promise.reject(e),g(this,fn,`f`).call(this,e),g(this,hn,`f`).call(this,e),this._emit(`end`)}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit(`finalMessage`,g(this,I,`m`,Sn).call(this))}async _fromReadableStream(e,t){let n=t?.signal,r;n&&(n.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),n.addEventListener(`abort`,r));try{g(this,I,`m`,Tn).call(this),this._connected(null);let t=w.fromReadableStream(e,this.controller);for await(let e of t)g(this,I,`m`,En).call(this,e);if(t.controller.signal?.aborted)throw new o;g(this,I,`m`,Dn).call(this)}finally{n&&r&&n.removeEventListener(`abort`,r)}}[(L=new WeakMap,R=new WeakMap,un=new WeakMap,dn=new WeakMap,fn=new WeakMap,pn=new WeakMap,mn=new WeakMap,hn=new WeakMap,z=new WeakMap,gn=new WeakMap,_n=new WeakMap,vn=new WeakMap,B=new WeakMap,yn=new WeakMap,bn=new WeakMap,xn=new WeakMap,wn=new WeakMap,I=new WeakSet,Sn=function(){if(this.receivedMessages.length===0)throw new i(`stream ended without producing a Message with role=assistant`);return this.receivedMessages.at(-1)},Cn=function(){if(this.receivedMessages.length===0)throw new i(`stream ended without producing a Message with role=assistant`);let e=this.receivedMessages.at(-1).content.filter(e=>e.type===`text`).map(e=>e.text);if(e.length===0)throw new i(`stream ended without producing a content block with type=text`);return e.join(` `)},Tn=function(){this.ended||h(this,L,void 0,`f`)},En=function(e){if(this.ended)return;let t=g(this,I,`m`,On).call(this,e);switch(this._emit(`streamEvent`,e,t),e.type){case`content_block_delta`:{let n=t.content.at(-1);switch(e.delta.type){case`text_delta`:n.type===`text`&&this._emit(`text`,e.delta.text,n.text||``);break;case`citations_delta`:n.type===`text`&&this._emit(`citation`,e.delta.citation,n.citations??[]);break;case`input_json_delta`:ln(n)&&n.input&&this._emit(`inputJson`,e.delta.partial_json,n.input);break;case`thinking_delta`:n.type===`thinking`&&this._emit(`thinking`,e.delta.thinking,n.thinking);break;case`signature_delta`:n.type===`thinking`&&this._emit(`signature`,n.signature);break;case`compaction_delta`:n.type===`compaction`&&n.content&&this._emit(`compaction`,n.content);break;default:e.delta}break}case`message_stop`:this._addMessageParam(t),this._addMessage(Qt(t,g(this,R,`f`),{logger:g(this,xn,`f`)}),!0);break;case`content_block_stop`:this._emit(`contentBlock`,t.content.at(-1));break;case`message_start`:h(this,L,t,`f`);break;case`content_block_start`:case`message_delta`:break}},Dn=function(){if(this.ended)throw new i(`stream has ended, this shouldn't happen`);let e=g(this,L,`f`);if(!e)throw new i(`request ended without sending any chunks`);return h(this,L,void 0,`f`),Qt(e,g(this,R,`f`),{logger:g(this,xn,`f`)})},On=function(e){let t=g(this,L,`f`);if(e.type===`message_start`){if(t)throw new i(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new i(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case`message_stop`:return t;case`message_delta`:return t.container=e.delta.container,t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,t.context_management=e.context_management,e.usage.input_tokens!=null&&(t.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(t.usage.server_tool_use=e.usage.server_tool_use),e.usage.iterations!=null&&(t.usage.iterations=e.usage.iterations),t;case`content_block_start`:return t.content.push(e.content_block),t;case`content_block_delta`:{let n=t.content.at(e.index);switch(e.delta.type){case`text_delta`:n?.type===`text`&&(t.content[e.index]={...n,text:(n.text||``)+e.delta.text});break;case`citations_delta`:n?.type===`text`&&(t.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break;case`input_json_delta`:if(n&&ln(n)){let r=n[kn]||``;r+=e.delta.partial_json;let a={...n};if(Object.defineProperty(a,kn,{value:r,enumerable:!1,writable:!0}),r)try{a.input=on(r)}catch(e){let t=new i(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${e}. JSON: ${r}`);g(this,wn,`f`).call(this,t)}t.content[e.index]=a}break;case`thinking_delta`:n?.type===`thinking`&&(t.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break;case`signature_delta`:n?.type===`thinking`&&(t.content[e.index]={...n,signature:e.delta.signature});break;case`compaction_delta`:n?.type===`compaction`&&(t.content[e.index]={...n,content:(n.content||``)+e.delta.content});break;default:e.delta}return t}case`content_block_stop`:return t}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on(`streamEvent`,n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on(`end`,()=>{n=!0;for(let e of t)e.resolve(void 0);t.length=0}),this.on(`abort`,e=>{n=!0;for(let n of t)n.reject(e);t.length=0}),this.on(`error`,e=>{n=!0;for(let n of t)n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new w(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}})),Mn,Nn=e((()=>{Mn=class extends Error{constructor(e){let t=typeof e==`string`?e:e.map(e=>e.type===`text`?e.text:`[${e.type}]`).join(` `);super(t),this.name=`ToolError`,this.content=e}}})),Pn,Fn=e((()=>{Pn=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
7
+ 1. Task Overview
8
+ The user's core request and success criteria
9
+ Any clarifications or constraints they specified
10
+ 2. Current State
11
+ What has been completed so far
12
+ Files created, modified, or analyzed (with paths if relevant)
13
+ Key outputs or artifacts produced
14
+ 3. Important Discoveries
15
+ Technical constraints or requirements uncovered
16
+ Decisions made and their rationale
17
+ Errors encountered and how they were resolved
18
+ What approaches were tried that didn't work (and why)
19
+ 4. Next Steps
20
+ Specific actions needed to complete the task
21
+ Any blockers or open questions to resolve
22
+ Priority order if multiple steps remain
23
+ 5. Context to Preserve
24
+ User preferences or style requirements
25
+ Domain-specific details that aren't obvious
26
+ Any promises made to the user
27
+ Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
28
+ Wrap your summary in <summary></summary> tags.`}));function In(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Ln(e,t=e.messages.at(-1)){if(!t||t.role!==`assistant`||!t.content||typeof t.content==`string`)return null;let n=t.content.filter(e=>e.type===`tool_use`);return n.length===0?null:{role:`user`,content:await Promise.all(n.map(async t=>{let n=e.tools.find(e=>(`name`in e?e.name:e.mcp_server_name)===t.name);if(!n||!(`run`in n))return{type:`tool_result`,tool_use_id:t.id,content:`Error: Tool '${t.name}' not found`,is_error:!0};try{let e=t.input;`parse`in n&&n.parse&&(e=n.parse(e));let r=await n.run(e);return{type:`tool_result`,tool_use_id:t.id,content:r}}catch(e){return{type:`tool_result`,tool_use_id:t.id,content:e instanceof Mn?e.content:`Error: ${e instanceof Error?e.message:String(e)}`,is_error:!0}}}))}}var Rn,V,H,U,zn,W,G,K,Bn,Vn,Hn,Un,Wn=e((()=>{_(),Nn(),m(),j(),Fn(),Bt(),Un=class{constructor(e,t,n){Rn.add(this),this.client=e,V.set(this,!1),H.set(this,!1),U.set(this,void 0),zn.set(this,void 0),W.set(this,void 0),G.set(this,void 0),K.set(this,void 0),Bn.set(this,0),h(this,U,{params:{...t,messages:structuredClone(t.messages)}},`f`);let r=[`BetaToolRunner`,...Lt(t.tools,t.messages)].join(`, `);h(this,zn,{...n,headers:A([{"x-stainless-helper":r},n?.headers])},`f`),h(this,K,In(),`f`)}async*[(V=new WeakMap,H=new WeakMap,U=new WeakMap,zn=new WeakMap,W=new WeakMap,G=new WeakMap,K=new WeakMap,Bn=new WeakMap,Rn=new WeakSet,Vn=async function(){let e=g(this,U,`f`).params.compactionControl;if(!e||!e.enabled)return!1;let t=0;if(g(this,W,`f`)!==void 0)try{let e=await g(this,W,`f`);t=e.usage.input_tokens+(e.usage.cache_creation_input_tokens??0)+(e.usage.cache_read_input_tokens??0)+e.usage.output_tokens}catch{return!1}let n=e.contextTokenThreshold??1e5;if(t<n)return!1;let r=e.model??g(this,U,`f`).params.model,a=e.summaryPrompt??Pn,o=g(this,U,`f`).params.messages;if(o[o.length-1].role===`assistant`){let e=o[o.length-1];if(Array.isArray(e.content)){let t=e.content.filter(e=>e.type!==`tool_use`);t.length===0?o.pop():e.content=t}}let s=await this.client.beta.messages.create({model:r,messages:[...o,{role:`user`,content:[{type:`text`,text:a}]}],max_tokens:g(this,U,`f`).params.max_tokens},{headers:{"x-stainless-helper":`compaction`}});if(s.content[0]?.type!==`text`)throw new i(`Expected text response for compaction`);return g(this,U,`f`).params.messages=[{role:`user`,content:s.content}],!0},Symbol.asyncIterator)](){var e;if(g(this,V,`f`))throw new i(`Cannot iterate over a consumed stream`);h(this,V,!0,`f`),h(this,H,!0,`f`),h(this,G,void 0,`f`);try{for(;;){let t;try{if(g(this,U,`f`).params.max_iterations&&g(this,Bn,`f`)>=g(this,U,`f`).params.max_iterations)break;h(this,H,!1,`f`),h(this,G,void 0,`f`),h(this,Bn,(e=g(this,Bn,`f`),e++,e),`f`),h(this,W,void 0,`f`);let{max_iterations:n,compactionControl:r,...i}=g(this,U,`f`).params;if(i.stream?(t=this.client.beta.messages.stream({...i},g(this,zn,`f`)),h(this,W,t.finalMessage(),`f`),g(this,W,`f`).catch(()=>{}),yield t):(h(this,W,this.client.beta.messages.create({...i,stream:!1},g(this,zn,`f`)),`f`),yield g(this,W,`f`)),!await g(this,Rn,`m`,Vn).call(this)){if(!g(this,H,`f`)){let{role:e,content:t}=await g(this,W,`f`);g(this,U,`f`).params.messages.push({role:e,content:t})}let e=await g(this,Rn,`m`,Hn).call(this,g(this,U,`f`).params.messages.at(-1));if(e)g(this,U,`f`).params.messages.push(e);else if(!g(this,H,`f`))break}}finally{t&&t.abort()}}if(!g(this,W,`f`))throw new i(`ToolRunner concluded without a message from the server`);g(this,K,`f`).resolve(await g(this,W,`f`))}catch(e){throw h(this,V,!1,`f`),g(this,K,`f`).promise.catch(()=>{}),g(this,K,`f`).reject(e),h(this,K,In(),`f`),e}}setMessagesParams(e){typeof e==`function`?g(this,U,`f`).params=e(g(this,U,`f`).params):g(this,U,`f`).params=e,h(this,H,!0,`f`),h(this,G,void 0,`f`)}async generateToolResponse(){let e=await g(this,W,`f`)??this.params.messages.at(-1);return e?g(this,Rn,`m`,Hn).call(this,e):null}done(){return g(this,K,`f`).promise}async runUntilDone(){if(!g(this,V,`f`))for await(let e of this);return this.done()}get params(){return g(this,U,`f`).params}pushMessages(...e){this.setMessagesParams(t=>({...t,messages:[...t.messages,...e]}))}then(e,t){return this.runUntilDone().then(e,t)}},Hn=async function(e){return g(this,G,`f`)===void 0&&h(this,G,Ln(g(this,U,`f`).params,e),`f`),g(this,G,`f`)}})),Gn,Kn=e((()=>{m(),Me(),Ge(),Gn=class e{constructor(e,t){this.iterator=e,this.controller=t}async*decoder(){let e=new x;for await(let t of this.iterator)for(let n of e.decode(t))yield JSON.parse(n);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new i(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new i(`Attempted to iterate over a response with no body`);return new e(Ae(t.body),n)}}})),qn,Jn=e((()=>{k(),E(),j(),Kn(),Jt(),P(),qn=class extends O{create(e,t){let{betas:n,...r}=e;return this._client.post(`/v1/messages/batches?beta=true`,{body:r,...t,headers:A([{"anthropic-beta":[...n??[],`message-batches-2024-09-24`].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/messages/batches/${e}?beta=true`,{...n,headers:A([{"anthropic-beta":[...r??[],`message-batches-2024-09-24`].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList(`/v1/messages/batches?beta=true`,T,{query:r,...t,headers:A([{"anthropic-beta":[...n??[],`message-batches-2024-09-24`].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/messages/batches/${e}?beta=true`,{...n,headers:A([{"anthropic-beta":[...r??[],`message-batches-2024-09-24`].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:A([{"anthropic-beta":[...r??[],`message-batches-2024-09-24`].toString()},n?.headers])})}async results(e,t={},n){let r=await this.retrieve(e);if(!r.results_url)throw new i(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:a}=t??{};return this._client.get(r.results_url,{...n,headers:A([{"anthropic-beta":[...a??[],`message-batches-2024-09-24`].toString(),Accept:`application/binary`},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>Gn.fromResponse(t.response,t.controller))}}}));function Yn(e){if(!e.output_format)return e;if(e.output_config?.format)throw new i(`Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).`);let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var Xn,Zn,q,Qn=e((()=>{Jt(),k(),Xt(),j(),Bt(),tn(),jn(),Wn(),Nn(),Jn(),Xn={"claude-1.3":`November 6th, 2024`,"claude-1.3-100k":`November 6th, 2024`,"claude-instant-1.1":`November 6th, 2024`,"claude-instant-1.1-100k":`November 6th, 2024`,"claude-instant-1.2":`November 6th, 2024`,"claude-3-sonnet-20240229":`July 21st, 2025`,"claude-3-opus-20240229":`January 5th, 2026`,"claude-2.1":`July 21st, 2025`,"claude-2.0":`July 21st, 2025`,"claude-3-7-sonnet-latest":`February 19th, 2026`,"claude-3-7-sonnet-20250219":`February 19th, 2026`},Zn=[`claude-opus-4-6`],q=class extends O{constructor(){super(...arguments),this.batches=new qn(this._client)}create(e,t){let n=Yn(e),{betas:r,...i}=n;i.model in Xn&&console.warn(`The model '${i.model}' is deprecated and will reach end-of-life on ${Xn[i.model]}\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),i.model in Zn&&i.thinking&&i.thinking.type===`enabled`&&console.warn(`Using Claude with ${i.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let a=this._client._options.timeout;if(!i.stream&&a==null){let e=Yt[i.model]??void 0;a=this._client.calculateNonstreamingTimeout(i.max_tokens,e)}let o=Rt(i.tools,i.messages);return this._client.post(`/v1/messages?beta=true`,{body:i,timeout:a??6e5,...t,headers:A([{...r?.toString()==null?void 0:{"anthropic-beta":r?.toString()}},o,t?.headers]),stream:n.stream??!1})}parse(e,t){return t={...t,headers:A([{"anthropic-beta":[...e.betas??[],`structured-outputs-2025-12-15`].toString()},t?.headers])},this.create(e,t).then(t=>$t(t,e,{logger:this._client.logger??console}))}stream(e,t){return An.createMessage(this,e,t)}countTokens(e,t){let{betas:n,...r}=Yn(e);return this._client.post(`/v1/messages/count_tokens?beta=true`,{body:r,...t,headers:A([{"anthropic-beta":[...n??[],`token-counting-2024-11-01`].toString()},t?.headers])})}toolRunner(e,t){return new Un(this._client,e,t)}},q.Batches=qn,q.BetaToolRunner=Un,q.ToolError=Mn})),$n,er=e((()=>{k(),E(),j(),wt(),P(),$n=class extends O{create(e,t={},n){let{betas:r,...i}=t??{};return this._client.post(N`/v1/skills/${e}/versions?beta=true`,yt({body:i,...n,headers:A([{"anthropic-beta":[...r??[],`skills-2025-10-02`].toString()},n?.headers])},this._client))}retrieve(e,t,n){let{skill_id:r,betas:i}=t;return this._client.get(N`/v1/skills/${r}/versions/${e}?beta=true`,{...n,headers:A([{"anthropic-beta":[...i??[],`skills-2025-10-02`].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...i}=t??{};return this._client.getAPIList(N`/v1/skills/${e}/versions?beta=true`,mt,{query:i,...n,headers:A([{"anthropic-beta":[...r??[],`skills-2025-10-02`].toString()},n?.headers])})}delete(e,t,n){let{skill_id:r,betas:i}=t;return this._client.delete(N`/v1/skills/${r}/versions/${e}?beta=true`,{...n,headers:A([{"anthropic-beta":[...i??[],`skills-2025-10-02`].toString()},n?.headers])})}}})),tr,nr=e((()=>{k(),er(),E(),j(),wt(),P(),tr=class extends O{constructor(){super(...arguments),this.versions=new $n(this._client)}create(e={},t){let{betas:n,...r}=e??{};return this._client.post(`/v1/skills?beta=true`,yt({body:r,...t,headers:A([{"anthropic-beta":[...n??[],`skills-2025-10-02`].toString()},t?.headers])},this._client,!1))}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/skills/${e}?beta=true`,{...n,headers:A([{"anthropic-beta":[...r??[],`skills-2025-10-02`].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList(`/v1/skills?beta=true`,mt,{query:r,...t,headers:A([{"anthropic-beta":[...n??[],`skills-2025-10-02`].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/skills/${e}?beta=true`,{...n,headers:A([{"anthropic-beta":[...r??[],`skills-2025-10-02`].toString()},n?.headers])})}},tr.Versions=$n})),J,rr=e((()=>{k(),Gt(),qt(),Qn(),nr(),J=class extends O{constructor(){super(...arguments),this.models=new Kt(this._client),this.messages=new q(this._client),this.files=new Wt(this._client),this.skills=new tr(this._client)}},J.Models=Kt,J.Messages=q,J.Files=Wt,J.Skills=tr})),ir,ar=e((()=>{k(),j(),ir=class extends O{create(e,t){let{betas:n,...r}=e;return this._client.post(`/v1/complete`,{body:r,timeout:this._client._options.timeout??6e5,...t,headers:A([{...n?.toString()==null?void 0:{"anthropic-beta":n?.toString()}},t?.headers]),stream:e.stream??!1})}}}));function or(e){return e?.output_config?.format}function sr(e,t,n){let r=or(t);return!t||!(`parse`in(r??{}))?{...e,content:e.content.map(e=>e.type===`text`?Object.defineProperty({...e},`parsed_output`,{value:null,enumerable:!1}):e),parsed_output:null}:cr(e,t,n)}function cr(e,t,n){let r=null,i=e.content.map(e=>{if(e.type===`text`){let n=lr(t,e.text);return r===null&&(r=n),Object.defineProperty({...e},`parsed_output`,{value:n,enumerable:!1})}return e});return{...e,content:i,parsed_output:r}}function lr(e,t){let n=or(e);if(n?.type!==`json_schema`)return null;try{return`parse`in n?n.parse(t):JSON.parse(t)}catch(e){throw new i(`Failed to parse structured output: ${e}`)}}var ur=e((()=>{m()}));function dr(e){return e.type===`tool_use`||e.type===`server_tool_use`}var Y,X,fr,pr,mr,hr,gr,_r,vr,Z,yr,br,xr,Q,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr=e((()=>{_(),r(),Jt(),cn(),sn(),ur(),Mr=`__json_buf`,Nr=class e{constructor(e,n){Y.add(this),this.messages=[],this.receivedMessages=[],X.set(this,void 0),fr.set(this,null),this.controller=new AbortController,pr.set(this,void 0),mr.set(this,()=>{}),hr.set(this,()=>{}),gr.set(this,void 0),_r.set(this,()=>{}),vr.set(this,()=>{}),Z.set(this,{}),yr.set(this,!1),br.set(this,!1),xr.set(this,!1),Q.set(this,!1),Sr.set(this,void 0),Cr.set(this,void 0),wr.set(this,void 0),Dr.set(this,e=>{if(h(this,br,!0,`f`),t(e)&&(e=new o),e instanceof o)return h(this,xr,!0,`f`),this._emit(`abort`,e);if(e instanceof i)return this._emit(`error`,e);if(e instanceof Error){let t=new i(e.message);return t.cause=e,this._emit(`error`,t)}return this._emit(`error`,new i(String(e)))}),h(this,pr,new Promise((e,t)=>{h(this,mr,e,`f`),h(this,hr,t,`f`)}),`f`),h(this,gr,new Promise((e,t)=>{h(this,_r,e,`f`),h(this,vr,t,`f`)}),`f`),g(this,pr,`f`).catch(()=>{}),g(this,gr,`f`).catch(()=>{}),h(this,fr,e,`f`),h(this,wr,n?.logger??console,`f`)}get response(){return g(this,Sr,`f`)}get request_id(){return g(this,Cr,`f`)}async withResponse(){h(this,Q,!0,`f`);let e=await g(this,pr,`f`);if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get(`request-id`)}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r,{logger:i}={}){let a=new e(n,{logger:i});for(let e of n.messages)a._addMessageParam(e);return h(a,fr,{...n,stream:!0},`f`),a._run(()=>a._createMessage(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":`stream`}})),a}_run(e){e().then(()=>{this._emitFinal(),this._emit(`end`)},g(this,Dr,`f`))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit(`message`,e)}async _createMessage(e,t,n){let r=n?.signal,i;r&&(r.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),r.addEventListener(`abort`,i));try{g(this,Y,`m`,Or).call(this);let{response:r,data:i}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(r);for await(let e of i)g(this,Y,`m`,kr).call(this,e);if(i.controller.signal?.aborted)throw new o;g(this,Y,`m`,Ar).call(this)}finally{r&&i&&r.removeEventListener(`abort`,i)}}_connected(e){this.ended||(h(this,Sr,e,`f`),h(this,Cr,e?.headers.get(`request-id`),`f`),g(this,mr,`f`).call(this,e),this._emit(`connect`))}get ended(){return g(this,yr,`f`)}get errored(){return g(this,br,`f`)}get aborted(){return g(this,xr,`f`)}abort(){this.controller.abort()}on(e,t){return(g(this,Z,`f`)[e]||(g(this,Z,`f`)[e]=[])).push({listener:t}),this}off(e,t){let n=g(this,Z,`f`)[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(g(this,Z,`f`)[e]||(g(this,Z,`f`)[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{h(this,Q,!0,`f`),e!==`error`&&this.once(`error`,n),this.once(e,t)})}async done(){h(this,Q,!0,`f`),await g(this,gr,`f`)}get currentMessage(){return g(this,X,`f`)}async finalMessage(){return await this.done(),g(this,Y,`m`,Tr).call(this)}async finalText(){return await this.done(),g(this,Y,`m`,Er).call(this)}_emit(e,...t){if(g(this,yr,`f`))return;e===`end`&&(h(this,yr,!0,`f`),g(this,_r,`f`).call(this));let n=g(this,Z,`f`)[e];if(n&&(g(this,Z,`f`)[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),e===`abort`){let e=t[0];!g(this,Q,`f`)&&!n?.length&&Promise.reject(e),g(this,hr,`f`).call(this,e),g(this,vr,`f`).call(this,e),this._emit(`end`);return}if(e===`error`){let e=t[0];!g(this,Q,`f`)&&!n?.length&&Promise.reject(e),g(this,hr,`f`).call(this,e),g(this,vr,`f`).call(this,e),this._emit(`end`)}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit(`finalMessage`,g(this,Y,`m`,Tr).call(this))}async _fromReadableStream(e,t){let n=t?.signal,r;n&&(n.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),n.addEventListener(`abort`,r));try{g(this,Y,`m`,Or).call(this),this._connected(null);let t=w.fromReadableStream(e,this.controller);for await(let e of t)g(this,Y,`m`,kr).call(this,e);if(t.controller.signal?.aborted)throw new o;g(this,Y,`m`,Ar).call(this)}finally{n&&r&&n.removeEventListener(`abort`,r)}}[(X=new WeakMap,fr=new WeakMap,pr=new WeakMap,mr=new WeakMap,hr=new WeakMap,gr=new WeakMap,_r=new WeakMap,vr=new WeakMap,Z=new WeakMap,yr=new WeakMap,br=new WeakMap,xr=new WeakMap,Q=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,wr=new WeakMap,Dr=new WeakMap,Y=new WeakSet,Tr=function(){if(this.receivedMessages.length===0)throw new i(`stream ended without producing a Message with role=assistant`);return this.receivedMessages.at(-1)},Er=function(){if(this.receivedMessages.length===0)throw new i(`stream ended without producing a Message with role=assistant`);let e=this.receivedMessages.at(-1).content.filter(e=>e.type===`text`).map(e=>e.text);if(e.length===0)throw new i(`stream ended without producing a content block with type=text`);return e.join(` `)},Or=function(){this.ended||h(this,X,void 0,`f`)},kr=function(e){if(this.ended)return;let t=g(this,Y,`m`,jr).call(this,e);switch(this._emit(`streamEvent`,e,t),e.type){case`content_block_delta`:{let n=t.content.at(-1);switch(e.delta.type){case`text_delta`:n.type===`text`&&this._emit(`text`,e.delta.text,n.text||``);break;case`citations_delta`:n.type===`text`&&this._emit(`citation`,e.delta.citation,n.citations??[]);break;case`input_json_delta`:dr(n)&&n.input&&this._emit(`inputJson`,e.delta.partial_json,n.input);break;case`thinking_delta`:n.type===`thinking`&&this._emit(`thinking`,e.delta.thinking,n.thinking);break;case`signature_delta`:n.type===`thinking`&&this._emit(`signature`,n.signature);break;default:e.delta}break}case`message_stop`:this._addMessageParam(t),this._addMessage(sr(t,g(this,fr,`f`),{logger:g(this,wr,`f`)}),!0);break;case`content_block_stop`:this._emit(`contentBlock`,t.content.at(-1));break;case`message_start`:h(this,X,t,`f`);break;case`content_block_start`:case`message_delta`:break}},Ar=function(){if(this.ended)throw new i(`stream has ended, this shouldn't happen`);let e=g(this,X,`f`);if(!e)throw new i(`request ended without sending any chunks`);return h(this,X,void 0,`f`),sr(e,g(this,fr,`f`),{logger:g(this,wr,`f`)})},jr=function(e){let t=g(this,X,`f`);if(e.type===`message_start`){if(t)throw new i(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new i(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case`message_stop`:return t;case`message_delta`:return t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,e.usage.input_tokens!=null&&(t.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(t.usage.server_tool_use=e.usage.server_tool_use),t;case`content_block_start`:return t.content.push({...e.content_block}),t;case`content_block_delta`:{let n=t.content.at(e.index);switch(e.delta.type){case`text_delta`:n?.type===`text`&&(t.content[e.index]={...n,text:(n.text||``)+e.delta.text});break;case`citations_delta`:n?.type===`text`&&(t.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break;case`input_json_delta`:if(n&&dr(n)){let r=n[Mr]||``;r+=e.delta.partial_json;let i={...n};Object.defineProperty(i,Mr,{value:r,enumerable:!1,writable:!0}),r&&(i.input=on(r)),t.content[e.index]=i}break;case`thinking_delta`:n?.type===`thinking`&&(t.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break;case`signature_delta`:n?.type===`thinking`&&(t.content[e.index]={...n,signature:e.delta.signature});break;default:e.delta}return t}case`content_block_stop`:return t}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on(`streamEvent`,n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on(`end`,()=>{n=!0;for(let e of t)e.resolve(void 0);t.length=0}),this.on(`abort`,e=>{n=!0;for(let n of t)n.reject(e);t.length=0}),this.on(`error`,e=>{n=!0;for(let n of t)n.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new w(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}})),Fr,Ir=e((()=>{k(),E(),j(),Kn(),Jt(),P(),Fr=class extends O{create(e,t){return this._client.post(`/v1/messages/batches`,{body:e,...t})}retrieve(e,t){return this._client.get(N`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList(`/v1/messages/batches`,T,{query:e,...t})}delete(e,t){return this._client.delete(N`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(N`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let n=await this.retrieve(e);if(!n.results_url)throw new i(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...t,headers:A([{Accept:`application/binary`},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>Gn.fromResponse(t.response,t.controller))}}})),Lr,Rr,zr,Br=e((()=>{k(),j(),Bt(),Pr(),ur(),Ir(),Xt(),Lr=class extends O{constructor(){super(...arguments),this.batches=new Fr(this._client)}create(e,t){e.model in Rr&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${Rr[e.model]}\nPlease migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),e.model in zr&&e.thinking&&e.thinking.type===`enabled`&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let t=Yt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,t)}let r=Rt(e.tools,e.messages);return this._client.post(`/v1/messages`,{body:e,timeout:n??6e5,...t,headers:A([r,t?.headers]),stream:e.stream??!1})}parse(e,t){return this.create(e,t).then(t=>cr(t,e,{logger:this._client.logger??console}))}stream(e,t){return Nr.createMessage(this,e,t,{logger:this._client.logger??console})}countTokens(e,t){return this._client.post(`/v1/messages/count_tokens`,{body:e,...t})}},Rr={"claude-1.3":`November 6th, 2024`,"claude-1.3-100k":`November 6th, 2024`,"claude-instant-1.1":`November 6th, 2024`,"claude-instant-1.1-100k":`November 6th, 2024`,"claude-instant-1.2":`November 6th, 2024`,"claude-3-sonnet-20240229":`July 21st, 2025`,"claude-3-opus-20240229":`January 5th, 2026`,"claude-2.1":`July 21st, 2025`,"claude-2.0":`July 21st, 2025`,"claude-3-7-sonnet-latest":`February 19th, 2026`,"claude-3-7-sonnet-20250219":`February 19th, 2026`,"claude-3-5-haiku-latest":`February 19th, 2026`,"claude-3-5-haiku-20241022":`February 19th, 2026`},zr=[`claude-opus-4-6`],Lr.Batches=Fr})),Vr,Hr=e((()=>{k(),E(),j(),P(),Vr=class extends O{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/models/${e}`,{...n,headers:A([{...r?.toString()==null?void 0:{"anthropic-beta":r?.toString()}},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList(`/v1/models`,T,{query:r,...t,headers:A([{...n?.toString()==null?void 0:{"anthropic-beta":n?.toString()}},t?.headers])})}}})),Ur=e((()=>{Nt(),rr(),ar(),Br(),Hr()})),Wr,Gr=e((()=>{Wr=e=>{if(globalThis.process!==void 0)return globalThis.process.env?.[e]?.trim()??void 0;if(globalThis.Deno!==void 0)return globalThis.Deno.env?.get?.(e)?.trim()}})),Kr,qr,Jr,Yr,Xr,Zr,$,Qr,$r=e((()=>{_(),ie(),me(),ge(),r(),Ee(),Me(),Pe(),Ie(),_e(),m(),E(),Mt(),Ur(),ut(),ar(),Hr(),rr(),Br(),j(),Gr(),Qe(),Xr=`\\n\\nHuman:`,Zr=`\\n\\nAssistant:`,$=class{constructor({baseURL:e=Wr(`ANTHROPIC_BASE_URL`),apiKey:t=Wr(`ANTHROPIC_API_KEY`)??null,authToken:n=Wr(`ANTHROPIC_AUTH_TOKEN`)??null,...r}={}){Kr.add(this),Jr.set(this,void 0);let a={apiKey:t,authToken:n,...r,baseURL:e||`https://api.anthropic.com`};if(!a.dangerouslyAllowBrowser&&be())throw new i(`It looks like you're running in a browser-like environment.
29
+
30
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
31
+ If you understand the risks and have appropriate mitigations in place,
32
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
33
+
34
+ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
35
+ `);this.baseURL=a.baseURL,this.timeout=a.timeout??qr.DEFAULT_TIMEOUT,this.logger=a.logger??console;let o=`warn`;this.logLevel=o,this.logLevel=Ye(a.logLevel,`ClientOptions.logLevel`,this)??Ye(Wr(`ANTHROPIC_LOG`),`process.env['ANTHROPIC_LOG']`,this)??o,this.fetchOptions=a.fetchOptions,this.maxRetries=a.maxRetries??2,this.fetch=a.fetch??De(),h(this,Jr,Ne,`f`),this._options=a,this.apiKey=typeof t==`string`?t:null,this.authToken=n}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(e.get(`x-api-key`)||e.get(`authorization`))&&!(this.apiKey&&e.get(`x-api-key`))&&!t.has(`x-api-key`)&&!(this.authToken&&e.get(`authorization`))&&!t.has(`authorization`))throw Error(`Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted`)}async authHeaders(e){return A([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey!=null)return A([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return A([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Fe(e)}getUserAgent(){return`${this.constructor.name}/JS ${v}`}defaultIdempotencyKey(){return`stainless-node-retry-${re()}`}makeStatusError(e,t,n,r){return a.generate(e,t,n,r)}buildURL(e,t,n){let r=!g(this,Kr,`m`,Yr).call(this)&&n||this.baseURL,i=le(e)?new URL(e):new URL(r+(r.endsWith(`/`)&&e.startsWith(`/`)?e.slice(1):e)),a=this.defaultQuery(),o=Object.fromEntries(i.searchParams);return(!oe(a)||!oe(o))&&(t={...o,...a,...t}),typeof t==`object`&&t&&!Array.isArray(t)&&(i.search=this.stringifyQuery(t)),i.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new i(`Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details`);return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}get(e,t){return this.methodRequest(`get`,e,t)}post(e,t){return this.methodRequest(`post`,e,t)}patch(e,t){return this.methodRequest(`patch`,e,t)}put(e,t){return this.methodRequest(`put`,e,t)}delete(e,t){return this.methodRequest(`delete`,e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new lt(this,this.makeRequest(e,t,void 0))}async makeRequest(e,r,i){let a=await e,l=a.maxRetries??this.maxRetries;r??(r=l),await this.prepareOptions(a);let{req:u,url:d,timeout:ee}=await this.buildRequest(a,{retryCount:l-r});await this.prepareRequest(u,{url:d,options:a});let f=`log_`+(Math.random()*(1<<24)|0).toString(16).padStart(6,`0`),te=i===void 0?``:`, retryOf: ${i}`,p=Date.now();if(S(this).debug(`[${f}] sending request`,C({retryOfRequestLogID:i,method:a.method,url:d,options:a,headers:u.headers})),a.signal?.aborted)throw new o;let ne=new AbortController,m=await this.fetchWithTimeout(d,u,ee,ne).catch(n),h=Date.now();if(m instanceof globalThis.Error){let e=`retrying, ${r} attempts remaining`;if(a.signal?.aborted)throw new o;let n=t(m)||/timed? ?out/i.test(String(m)+(`cause`in m?String(m.cause):``));if(r)return S(this).info(`[${f}] connection ${n?`timed out`:`failed`} - ${e}`),S(this).debug(`[${f}] connection ${n?`timed out`:`failed`} (${e})`,C({retryOfRequestLogID:i,url:d,durationMs:h-p,message:m.message})),this.retryRequest(a,r,i??f);throw S(this).info(`[${f}] connection ${n?`timed out`:`failed`} - error; no more retries left`),S(this).debug(`[${f}] connection ${n?`timed out`:`failed`} (error; no more retries left)`,C({retryOfRequestLogID:i,url:d,durationMs:h-p,message:m.message})),n?new c:new s({cause:m})}let g=`[${f}${te}${[...m.headers.entries()].filter(([e])=>e===`request-id`).map(([e,t])=>`, `+e+`: `+JSON.stringify(t)).join(``)}] ${u.method} ${d} ${m.ok?`succeeded`:`failed`} with status ${m.status} in ${h-p}ms`;if(!m.ok){let e=await this.shouldRetry(m);if(r&&e){let e=`retrying, ${r} attempts remaining`;return await je(m.body),S(this).info(`${g} - ${e}`),S(this).debug(`[${f}] response error (${e})`,C({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:h-p})),this.retryRequest(a,r,i??f,m.headers)}let t=e?`error; no more retries left`:`error; not retryable`;S(this).info(`${g} - ${t}`);let o=await m.text().catch(e=>n(e).message),s=pe(o),c=s?void 0:o;throw S(this).debug(`[${f}] response error (${t})`,C({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,message:c,durationMs:Date.now()-p})),this.makeStatusError(m.status,s,c,m.headers)}return S(this).info(g),S(this).debug(`[${f}] response start`,C({retryOfRequestLogID:i,url:m.url,status:m.status,headers:m.headers,durationMs:h-p})),{response:m,options:a,controller:ne,requestLogID:f,retryOfRequestLogID:i,startTime:p}}getAPIList(e,t,n){return this.requestAPIList(t,n&&`then`in n?n.then(t=>({method:`get`,path:e,...t})):{method:`get`,path:e,...n})}requestAPIList(e,t){let n=this.makeRequest(t,null,void 0);return new pt(this,n,e)}async fetchWithTimeout(e,t,n,r){let{signal:i,method:a,...o}=t||{},s=this._makeAbort(r);i&&i.addEventListener(`abort`,s,{once:!0});let c=setTimeout(s,n),l=globalThis.ReadableStream&&o.body instanceof globalThis.ReadableStream||typeof o.body==`object`&&o.body!==null&&Symbol.asyncIterator in o.body,u={signal:r.signal,...l?{duplex:`half`}:{},method:`GET`,...o};a&&(u.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,u)}finally{clearTimeout(c)}}async shouldRetry(e){let t=e.headers.get(`x-should-retry`);return t===`true`?!0:t===`false`?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,t,n,r){let i,a=r?.get(`retry-after-ms`);if(a){let e=parseFloat(a);Number.isNaN(e)||(i=e)}let o=r?.get(`retry-after`);if(o&&!i){let e=parseFloat(o);i=Number.isNaN(e)?Date.parse(o)-Date.now():e*1e3}if(i===void 0){let n=e.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(t,n)}return await he(i),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){let n=t-e;return Math.min(.5*2**n,8)*(1-Math.random()*.25)*1e3}calculateNonstreamingTimeout(e,t){let n=600*1e3;if(36e5*e/128e3>n||t!=null&&e>t)throw new i(`Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details`);return n}async buildRequest(e,{retryCount:t=0}={}){let n={...e},{method:r,path:i,query:a,defaultBaseURL:o}=n,s=this.buildURL(i,a,o);`timeout`in n&&fe(`timeout`,n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:c,body:l}=this.buildBody({options:n});return{req:{method:r,headers:await this.buildHeaders({options:e,method:r,bodyHeaders:c,retryCount:t}),...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:`half`},...l&&{body:l},...this.fetchOptions??{},...n.fetchOptions??{}},url:s,timeout:n.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let i={};this.idempotencyHeader&&t!==`get`&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let a=A([i,{Accept:`application/json`,"User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...Te(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":`true`}:void 0,"anthropic-version":`2023-06-01`},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(a),a.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=A([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e==`string`&&n.values.has(`content-type`)||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e==`object`&&(Symbol.asyncIterator in e||Symbol.iterator in e&&`next`in e&&typeof e.next==`function`)?{bodyHeaders:void 0,body:ke(e)}:typeof e==`object`&&n.values.get(`content-type`)===`application/x-www-form-urlencoded`?{bodyHeaders:{"content-type":`application/x-www-form-urlencoded`},body:this.stringifyQuery(e)}:g(this,Jr,`f`).call(this,{body:e,headers:n})}},qr=$,Jr=new WeakMap,Kr=new WeakSet,Yr=function(){return this.baseURL!==`https://api.anthropic.com`},$.Anthropic=qr,$.HUMAN_PROMPT=Xr,$.AI_PROMPT=Zr,$.DEFAULT_TIMEOUT=6e5,$.AnthropicError=i,$.APIError=a,$.APIConnectionError=s,$.APIConnectionTimeoutError=c,$.APIUserAbortError=o,$.NotFoundError=ee,$.ConflictError=f,$.RateLimitError=p,$.BadRequestError=l,$.AuthenticationError=u,$.InternalServerError=ne,$.PermissionDeniedError=d,$.UnprocessableEntityError=te,$.toFile=Tt,Qr=class extends ${constructor(){super(...arguments),this.completions=new ir(this),this.messages=new Lr(this),this.models=new Vr(this),this.beta=new J(this)}},Qr.Completions=ir,Qr.Messages=Lr,Qr.Models=Vr,Qr.Beta=J}));export{i as _,Lr as a,m as b,cn as c,ut as d,w as f,o as g,a as h,Ur as i,Jt as l,c as m,$ as n,ir as o,s as p,$r as r,J as s,Qr as t,E as u,u as v,ee as y};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n}from"./state-sIHsFpDu.js";import{f as r,l as i}from"./teammate-DMYOtLTK.js";import{Ar as a,Tr as o,Xy as s,pi as c,qy as l}from"./loadAgentsDir-DI1a76pd.js";async function u(e,n,i){if(r())return e(`Cannot set color: This session is a swarm teammate. Teammate colors are assigned by the team leader.`,{display:`system`}),null;if(!i||i.trim()===``)return e(`Please provide a color. Available colors: ${l.join(`, `)}, default`,{display:`system`}),null;let a=i.trim().toLowerCase();return d.includes(a)?(await c(t(),`default`,o()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:void 0}})),e(`Session color reset to default`,{display:`system`}),null):l.includes(a)?(await c(t(),a,o()),n.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:a}})),e(`Session color set to: ${a}`,{display:`system`}),null):(e(`Invalid color "${a}". Available colors: ${l.join(`, `)}, default`,{display:`system`}),null)}var d;e((()=>{n(),s(),a(),i(),d=[`default`,`reset`,`none`,`gray`,`grey`]}))();export{u as call};
@@ -0,0 +1 @@
1
+ import{t as e}from"./chunk-DR8-3Aex.js";var t=e(((e,t)=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})),n=e(((e,n)=>{var r=t(),i={};for(let e of Object.keys(r))i[r[e]]=e;var a={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};n.exports=a;for(let e of Object.keys(a)){if(!(`channels`in a[e]))throw Error(`missing channels property: `+e);if(!(`labels`in a[e]))throw Error(`missing channel labels property: `+e);if(a[e].labels.length!==a[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=a[e];delete a[e].channels,delete a[e].labels,Object.defineProperty(a[e],`channels`,{value:t}),Object.defineProperty(a[e],`labels`,{value:n})}a.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},a.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},a.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=a.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,o*100,r*100]},a.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function o(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}a.rgb.keyword=function(e){let t=i[e];if(t)return t;let n=1/0,a;for(let t of Object.keys(r)){let i=r[t],s=o(e,i);s<n&&(n=s,a=t)}return a},a.keyword.rgb=function(e){return r[e]},a.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},a.rgb.lab=function(e){let t=a.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},a.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},a.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},a.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},a.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a=a||0,o/=2,[t,a*100,o*100]},a.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},a.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},a.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},a.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},a.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},a.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},a.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},a.rgb.ansi16=function(e,t=null){let[n,r,i]=e,o=t===null?a.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},a.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},a.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},a.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},a.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},a.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},a.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},a.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},a.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},a.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},a.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},a.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=function(e){return[0,0,e[0]]},a.gray.hsv=a.gray.hsl,a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}})),r=e(((e,t)=>{var r=n();function i(){let e={},t=Object.keys(r);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function a(e){let t=i(),n=[e];for(t[e].distance=0;n.length;){let e=n.pop(),i=Object.keys(r[e]);for(let r=i.length,a=0;a<r;a++){let r=i[a],o=t[r];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(r))}}return t}function o(e,t){return function(n){return t(e(n))}}function s(e,t){let n=[t[e].parent,e],i=r[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)n.unshift(t[a].parent),i=o(r[t[a].parent][a],i),a=t[a].parent;return i.conversion=n,i}t.exports=function(e){let t=a(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=s(e,t))}return n}})),i=e(((e,t)=>{var i=n(),a=r(),o={},s=Object.keys(i);function c(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function l(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}s.forEach(e=>{o[e]={},Object.defineProperty(o[e],`channels`,{value:i[e].channels}),Object.defineProperty(o[e],`labels`,{value:i[e].labels});let t=a(e);Object.keys(t).forEach(n=>{let r=t[n];o[e][n]=l(r),o[e][n].raw=c(r)})}),t.exports=o}));export{t as n,i as t};
@@ -0,0 +1 @@
1
+ import{Gi as e,Xi as t,zi as n}from"./loadAgentsDir-DI1a76pd.js";t();export{n as clearCommandsCache,e as getCommands};
@@ -0,0 +1 @@
1
+ import{d as e,l as t}from"./commitAttribution-C22a3OCi.js";t();export{e as isInternalModelRepo};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ct as t,cn as n,ot as r}from"./state-sIHsFpDu.js";import{Pr as i,mc as a,pc as o}from"./paths-BBvuDQl9.js";import{h as s,s as c}from"./debug-UI3T040K.js";import{n as l,t as u}from"./cwd--iizewsn.js";import{E as d,T as f,_ as p,r as m,v as h}from"./git-CN3qtTb_.js";import{o as g}from"./log-CzsijfHZ.js";import{n as _,r as v}from"./execFileNoThrow-CuQN1sz8.js";import{basename as y,extname as b,join as x,posix as S,sep as C}from"path";import{randomUUID as w}from"crypto";import{stat as T}from"fs/promises";function E(e){let t=S.sep+e.split(C).join(S.sep).replace(/^\/+/,``),n=y(e).toLowerCase(),r=b(e).toLowerCase();if(D.has(n)||O.has(r))return!0;let i=n.split(`.`);if(i.length>2){let e=`.`+i.slice(-2).join(`.`);if(O.has(e))return!0}for(let e of k)if(t.includes(e))return!0;for(let e of A)if(e.test(n))return!0;return!1}var D,O,k,A,j=e((()=>{D=new Set([`package-lock.json`,`yarn.lock`,`pnpm-lock.yaml`,`bun.lockb`,`bun.lock`,`composer.lock`,`gemfile.lock`,`cargo.lock`,`poetry.lock`,`pipfile.lock`,`shrinkwrap.json`,`npm-shrinkwrap.json`]),O=new Set([`.lock`,`.min.js`,`.min.css`,`.min.html`,`.bundle.js`,`.bundle.css`,`.generated.ts`,`.generated.js`,`.d.ts`]),k=[`/dist/`,`/build/`,`/out/`,`/output/`,`/node_modules/`,`/vendor/`,`/vendored/`,`/third_party/`,`/third-party/`,`/external/`,`/.next/`,`/.nuxt/`,`/.svelte-kit/`,`/coverage/`,`/__pycache__/`,`/.tox/`,`/venv/`,`/.venv/`,`/target/release/`,`/target/debug/`],A=[/^.*\.min\.[a-z]+$/i,/^.*-min\.[a-z]+$/i,/^.*\.bundle\.[a-z]+$/i,/^.*\.generated\.[a-z]+$/i,/^.*\.gen\.[a-z]+$/i,/^.*\.auto\.[a-z]+$/i,/^.*_generated\.[a-z]+$/i,/^.*_gen\.[a-z]+$/i,/^.*\.pb\.(go|js|ts|py|rb)$/i,/^.*_pb2?\.py$/i,/^.*\.pb\.h$/i,/^.*\.grpc\.[a-z]+$/i,/^.*\.swagger\.[a-z]+$/i,/^.*\.openapi\.[a-z]+$/i]}));function M(){return m(u())??r()}function N(){return W}function P(){return process.env.CLAUDE_CODE_ENTRYPOINT??`cli`}function F(){return{fileStates:new Map,sessionBaselines:new Map,surface:P(),startingHeadSha:null,promptCount:0,promptCountAtLastCommit:0,permissionPromptCount:0,permissionPromptCountAtLastCommit:0,escapeCount:0,escapeCountAtLastCommit:0}}async function I(e,n){let r=M(),i=t(),a={},o=[],s=new Set,c={},l=0,u=0,d=new Map,f=new Map;for(let t of e){s.add(t.surface);let e=t.sessionBaselines instanceof Map?t.sessionBaselines:new Map(Object.entries(t.sessionBaselines??{}));for(let[t,n]of e)f.has(t)||f.set(t,n);let n=t.fileStates instanceof Map?t.fileStates:new Map(Object.entries(t.fileStates??{}));for(let[e,t]of n){let n=d.get(e);n?d.set(e,{...t,claudeContribution:n.claudeContribution+t.claudeContribution}):d.set(e,t)}}let p=await Promise.all(n.map(async t=>{if(E(t))return{type:`generated`,file:t};let n=x(r,t),i=d.get(t),a=f.get(t),o=e[0].surface,s=0,c=0;if(await R(t))if(i)s=i.claudeContribution,c=0;else{let e=await L(t);c=e>0?e:100}else try{let e=await T(n);if(i)s=i.claudeContribution,c=0;else if(a){let n=await L(t);c=n>0?n:e.size}else c=e.size}catch{return null}s=Math.max(0,s),c=Math.max(0,c);let l=s+c,u=l>0?Math.round(s/l*100):0;return{type:`file`,file:t,claudeChars:s,humanChars:c,percent:u,surface:o}}));for(let e of p)if(e){if(e.type===`generated`){o.push(e.file);continue}a[e.file]={claudeChars:e.claudeChars,humanChars:e.humanChars,percent:e.percent,surface:e.surface},l+=e.claudeChars,u+=e.humanChars,c[e.surface]=(c[e.surface]??0)+e.claudeChars}let m=l+u,h=m>0?Math.round(l/m*100):0,g={};for(let[e,t]of Object.entries(c))g[e]={claudeChars:t,percent:m>0?Math.round(t/m*100):0};return{version:1,summary:{claudePercent:h,claudeChars:l,humanChars:u,surfaces:Array.from(s)},files:a,surfaceBreakdown:g,excludedGenerated:o,sessions:[i]}}async function L(e){let t=M();try{let n=await _(p(),[`diff`,`--cached`,`--stat`,`--`,e],{cwd:t,timeout:5e3});if(n.code!==0||!n.stdout)return 0;let r=n.stdout.split(`
2
+ `).filter(Boolean),i=0;for(let e of r)if(e.includes(`file changed`)||e.includes(`files changed`)){let t=e.match(/(\d+) insertions?/),n=e.match(/(\d+) deletions?/),r=t?parseInt(t[1],10):0,a=n?parseInt(n[1],10):0;i+=(r+a)*40}return i}catch{return 0}}async function R(e){let t=M();try{let n=await _(p(),[`diff`,`--cached`,`--name-status`,`--`,e],{cwd:t,timeout:5e3});if(n.code===0&&n.stdout)return n.stdout.trim().startsWith(`D `)}catch{}return!1}function z(e,t){let n={};for(let[t,r]of e.fileStates)n[t]=r;return{type:`attribution-snapshot`,messageId:t,surface:e.surface,fileStates:n,promptCount:e.promptCount,promptCountAtLastCommit:e.promptCountAtLastCommit,permissionPromptCount:e.permissionPromptCount,permissionPromptCountAtLastCommit:e.permissionPromptCountAtLastCommit,escapeCount:e.escapeCount,escapeCountAtLastCommit:e.escapeCountAtLastCommit}}function B(e){let t=F(),n=e[e.length-1];if(!n)return t;t.surface=n.surface;for(let[e,r]of Object.entries(n.fileStates))t.fileStates.set(e,r);return t.promptCount=n.promptCount??0,t.promptCountAtLastCommit=n.promptCountAtLastCommit??0,t.permissionPromptCount=n.permissionPromptCount??0,t.permissionPromptCountAtLastCommit=n.permissionPromptCountAtLastCommit??0,t.escapeCount=n.escapeCount??0,t.escapeCountAtLastCommit=n.escapeCountAtLastCommit??0,t}function V(e,t){t(B(e))}function H(e,t){let n={...e,promptCount:e.promptCount+1};return t(z(n,w())),n}var U,W,G,K=e((()=>{n(),l(),c(),v(),s(),j(),d(),h(),g(),i(),o(),U=`github.com:anthropics/claude-cli-internal,github.com/anthropics/claude-cli-internal,github.com:anthropics/anthropic,github.com/anthropics/anthropic,github.com:anthropics/apps,github.com/anthropics/apps,github.com:anthropics/casino,github.com/anthropics/casino,github.com:anthropics/dbt,github.com/anthropics/dbt,github.com:anthropics/dotfiles,github.com/anthropics/dotfiles,github.com:anthropics/terraform-config,github.com/anthropics/terraform-config,github.com:anthropics/hex-export,github.com/anthropics/hex-export,github.com:anthropics/feedback-v2,github.com/anthropics/feedback-v2,github.com:anthropics/labs,github.com/anthropics/labs,github.com:anthropics/argo-rollouts,github.com/anthropics/argo-rollouts,github.com:anthropics/starling-configs,github.com/anthropics/starling-configs,github.com:anthropics/ts-tools,github.com/anthropics/ts-tools,github.com:anthropics/ts-capsules,github.com/anthropics/ts-capsules,github.com:anthropics/feldspar-testing,github.com/anthropics/feldspar-testing,github.com:anthropics/trellis,github.com/anthropics/trellis,github.com:anthropics/claude-for-hiring,github.com/anthropics/claude-for-hiring,github.com:anthropics/forge-web,github.com/anthropics/forge-web,github.com:anthropics/infra-manifests,github.com/anthropics/infra-manifests,github.com:anthropics/mycro_manifests,github.com/anthropics/mycro_manifests,github.com:anthropics/mycro_configs,github.com/anthropics/mycro_configs,github.com:anthropics/mobile-apps,github.com/anthropics/mobile-apps`.split(`,`),W=null,G=a(async()=>{if(W!==null)return W===`internal`;let e=await f(M());if(!e)return W=`none`,!1;let t=U.some(t=>e.includes(t));return W=t?`internal`:`external`,t})}));export{P as a,H as c,G as d,B as f,M as i,K as l,I as n,L as o,z as p,F as r,N as s,V as t,R as u};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{a as n,n as r}from"./env-chR0gV31.js";import{n as i,t as a}from"./normalization-Cox8C0dP.js";var o=t({CLI_CU_CAPABILITIES:()=>f,CLI_HOST_BUNDLE_ID:()=>u,COMPUTER_USE_MCP_SERVER_NAME:()=>l,getTerminalBundleId:()=>s,isComputerUseMCPServer:()=>c});function s(){return process.env.__CFBundleIdentifier||(d[r.terminal??``]??null)}function c(e){return i(e)===l}var l,u,d,f,p=e((()=>{a(),n(),l=`computer-use`,u=`com.anthropic.claude-code.cli-no-window`,d={"iTerm.app":`com.googlecode.iterm2`,Apple_Terminal:`com.apple.Terminal`,ghostty:`com.mitchellh.ghostty`,kitty:`net.kovidgoyal.kitty`,WarpTerminal:`dev.warp.Warp-Stable`,vscode:`com.microsoft.VSCode`},f={screenshotFiltering:process.platform===`darwin`?`native`:`none`,platform:process.platform===`win32`?`win32`:process.platform===`linux`?`linux`:`darwin`}}));export{s as a,o as i,u as n,p as o,l as r,c as s,f as t};
@@ -0,0 +1 @@
1
+ import{o as e,r as t,s as n}from"./common-B379wT22.js";e();export{t as COMPUTER_USE_MCP_SERVER_NAME,n as isComputerUseMCPServer};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{V as t,W as n,d as r,s as i}from"./debug-UI3T040K.js";import{n as a,t as o}from"./which-DqSAIvp2.js";import{i as s,o as c}from"./platform-CuyedWpe.js";import{r as l,t as u}from"./execFileNoThrow-CuQN1sz8.js";import{n as d,t as f}from"./normalization-Cox8C0dP.js";import{homedir as p,platform as m,tmpdir as h,userInfo as g}from"os";import{join as _}from"path";import{readdirSync as v}from"fs";import{stat as y}from"fs/promises";function b(){let e=s(),t=p(),n=[];for(let r of F){let i=P[r],a;switch(e){case`macos`:a=i.macos.dataPath;break;case`linux`:case`wsl`:a=i.linux.dataPath;break;case`windows`:if(i.windows.dataPath.length>0){let e=i.windows.useRoaming?_(t,`AppData`,`Roaming`):_(t,`AppData`,`Local`);n.push({browser:r,path:_(e,...i.windows.dataPath)})}continue}a&&a.length>0&&n.push({browser:r,path:_(t,...a)})}return n}function x(){let e=s(),t=p(),n=[];for(let r of F){let i=P[r];switch(e){case`macos`:i.macos.nativeMessagingPath.length>0&&n.push({browser:r,path:_(t,...i.macos.nativeMessagingPath)});break;case`linux`:case`wsl`:i.linux.nativeMessagingPath.length>0&&n.push({browser:r,path:_(t,...i.linux.nativeMessagingPath)});break;case`windows`:break}}return n}function S(){let e=[];for(let t of F){let n=P[t];n.windows.registryKey&&e.push({browser:t,key:n.windows.registryKey})}return e}async function C(){let e=s();for(let t of F){let i=P[t];switch(e){case`macos`:{let e=`/Applications/${i.macos.appName}.app`;try{if((await y(e)).isDirectory())return r(`[Claude in Chrome] Detected browser: ${i.name}`),t}catch(e){if(!n(e))throw e}break}case`wsl`:case`linux`:for(let e of i.linux.binaries)if(await a(e).catch(()=>null))return r(`[Claude in Chrome] Detected browser: ${i.name}`),t;break;case`windows`:{let e=p();if(i.windows.dataPath.length>0){let a=_(i.windows.useRoaming?_(e,`AppData`,`Roaming`):_(e,`AppData`,`Local`),...i.windows.dataPath);try{if((await y(a)).isDirectory())return r(`[Claude in Chrome] Detected browser: ${i.name}`),t}catch(e){if(!n(e))throw e}}break}}}return null}function w(e){return d(e)===N}function T(e){L.size>=I&&!L.has(e)&&L.clear(),L.add(e)}function E(e){return L.has(e)}async function D(e){let t=s(),n=await C();if(!n)return r(`[Claude in Chrome] No compatible browser found`),!1;let i=P[n];switch(t){case`macos`:{let{code:t}=await u(`open`,[`-a`,i.macos.appName,e]);return t===0}case`windows`:{let{code:t}=await u(`rundll32`,[`url,OpenURL`,e]);return t===0}case`wsl`:case`linux`:for(let t of i.linux.binaries){let{code:n}=await u(t,[e]);if(n===0)return!0}return!1;default:return!1}}function O(){return`/tmp/claude-mcp-browser-bridge-${M()}`}function k(){return m()===`win32`?`\\\\.\\pipe\\${j()}`:_(O(),`${process.pid}.sock`)}function A(){if(m()===`win32`)return[`\\\\.\\pipe\\${j()}`];let e=[],t=O();try{let n=v(t);for(let r of n)r.endsWith(`.sock`)&&e.push(_(t,r))}catch{}let n=`claude-mcp-browser-bridge-${M()}`,r=_(h(),n),i=`/tmp/${n}`;return e.includes(r)||e.push(r),r!==i&&!e.includes(i)&&e.push(i),e}function j(){return`claude-mcp-browser-bridge-${M()}`}function M(){try{return g().username||`default`}catch{return process.env.USER||process.env.USERNAME||`default`}}var N,P,F,I,L,R=e((()=>{f(),i(),t(),l(),c(),o(),N=`claude-in-chrome`,P={chrome:{name:`Google Chrome`,macos:{appName:`Google Chrome`,dataPath:[`Library`,`Application Support`,`Google`,`Chrome`],nativeMessagingPath:[`Library`,`Application Support`,`Google`,`Chrome`,`NativeMessagingHosts`]},linux:{binaries:[`google-chrome`,`google-chrome-stable`],dataPath:[`.config`,`google-chrome`],nativeMessagingPath:[`.config`,`google-chrome`,`NativeMessagingHosts`]},windows:{dataPath:[`Google`,`Chrome`,`User Data`],registryKey:`HKCU\\Software\\Google\\Chrome\\NativeMessagingHosts`}},brave:{name:`Brave`,macos:{appName:`Brave Browser`,dataPath:[`Library`,`Application Support`,`BraveSoftware`,`Brave-Browser`],nativeMessagingPath:[`Library`,`Application Support`,`BraveSoftware`,`Brave-Browser`,`NativeMessagingHosts`]},linux:{binaries:[`brave-browser`,`brave`],dataPath:[`.config`,`BraveSoftware`,`Brave-Browser`],nativeMessagingPath:[`.config`,`BraveSoftware`,`Brave-Browser`,`NativeMessagingHosts`]},windows:{dataPath:[`BraveSoftware`,`Brave-Browser`,`User Data`],registryKey:`HKCU\\Software\\BraveSoftware\\Brave-Browser\\NativeMessagingHosts`}},arc:{name:`Arc`,macos:{appName:`Arc`,dataPath:[`Library`,`Application Support`,`Arc`,`User Data`],nativeMessagingPath:[`Library`,`Application Support`,`Arc`,`User Data`,`NativeMessagingHosts`]},linux:{binaries:[],dataPath:[],nativeMessagingPath:[]},windows:{dataPath:[`Arc`,`User Data`],registryKey:`HKCU\\Software\\ArcBrowser\\Arc\\NativeMessagingHosts`}},chromium:{name:`Chromium`,macos:{appName:`Chromium`,dataPath:[`Library`,`Application Support`,`Chromium`],nativeMessagingPath:[`Library`,`Application Support`,`Chromium`,`NativeMessagingHosts`]},linux:{binaries:[`chromium`,`chromium-browser`],dataPath:[`.config`,`chromium`],nativeMessagingPath:[`.config`,`chromium`,`NativeMessagingHosts`]},windows:{dataPath:[`Chromium`,`User Data`],registryKey:`HKCU\\Software\\Chromium\\NativeMessagingHosts`}},edge:{name:`Microsoft Edge`,macos:{appName:`Microsoft Edge`,dataPath:[`Library`,`Application Support`,`Microsoft Edge`],nativeMessagingPath:[`Library`,`Application Support`,`Microsoft Edge`,`NativeMessagingHosts`]},linux:{binaries:[`microsoft-edge`,`microsoft-edge-stable`],dataPath:[`.config`,`microsoft-edge`],nativeMessagingPath:[`.config`,`microsoft-edge`,`NativeMessagingHosts`]},windows:{dataPath:[`Microsoft`,`Edge`,`User Data`],registryKey:`HKCU\\Software\\Microsoft\\Edge\\NativeMessagingHosts`}},vivaldi:{name:`Vivaldi`,macos:{appName:`Vivaldi`,dataPath:[`Library`,`Application Support`,`Vivaldi`],nativeMessagingPath:[`Library`,`Application Support`,`Vivaldi`,`NativeMessagingHosts`]},linux:{binaries:[`vivaldi`,`vivaldi-stable`],dataPath:[`.config`,`vivaldi`],nativeMessagingPath:[`.config`,`vivaldi`,`NativeMessagingHosts`]},windows:{dataPath:[`Vivaldi`,`User Data`],registryKey:`HKCU\\Software\\Vivaldi\\NativeMessagingHosts`}},opera:{name:`Opera`,macos:{appName:`Opera`,dataPath:[`Library`,`Application Support`,`com.operasoftware.Opera`],nativeMessagingPath:[`Library`,`Application Support`,`com.operasoftware.Opera`,`NativeMessagingHosts`]},linux:{binaries:[`opera`],dataPath:[`.config`,`opera`],nativeMessagingPath:[`.config`,`opera`,`NativeMessagingHosts`]},windows:{dataPath:[`Opera Software`,`Opera Stable`],registryKey:`HKCU\\Software\\Opera Software\\Opera Stable\\NativeMessagingHosts`,useRoaming:!0}}},F=[`chrome`,`brave`,`arc`,`edge`,`chromium`,`vivaldi`,`opera`],I=200,L=new Set}));export{S as a,R as c,D as d,T as f,A as i,w as l,b as n,k as o,x as r,O as s,N as t,E as u};
@@ -0,0 +1,3 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{In as t,Ln as n}from"./src-Di342QoJ.js";import{cn as r,dn as i}from"./state-sIHsFpDu.js";import{B as a,V as o}from"./debug-UI3T040K.js";import{o as s,s as c}from"./log-CzsijfHZ.js";import{$w as l,Ak as u,Cl as d,Dk as f,Ek as p,Fk as m,Gg as h,JO as g,Kg as _,Lo as v,Oo as y,Pk as b,Sl as x,_l as S,bl as C,dk as w,dl as T,dt as E,eT as D,ed as O,ek as k,fk as A,ft as j,hl as M,jk as N,ll as P,pk as F,qt as I,td as L,vl as R,wl as z,yl as B,yn as V}from"./loadAgentsDir-DI1a76pd.js";async function H(e,t,n,r){t.onCompactProgress?.({type:`hooks_start`,hookType:`pre_compact`}),t.setSDKStatus?.(`compacting`);try{let[i,a]=await Promise.all([I({trigger:`manual`,customInstructions:n||null},t.abortController.signal),W(t,e)]),o=z(n,i.newCustomInstructions);t.setStreamMode?.(`requesting`),t.setResponseLength?.(()=>0),t.onCompactProgress?.({type:`compact_start`});let s=await r.reactiveCompactOnPromptTooLong(e,a,{customInstructions:o,trigger:`manual`});if(!s.ok)switch(s.reason){case`too_few_groups`:throw Error(B);case`aborted`:throw Error(C);case`exhausted`:case`error`:case`media_unstrippable`:throw Error(R)}k(void 0),S(),N(),A.cache.clear?.();let c=[i.userDisplayMessage,s.result.userDisplayMessage].filter(Boolean).join(`
2
+ `)||void 0;return{type:`compact`,compactionResult:{...s.result,userDisplayMessage:c},displayText:U(t,c)}}finally{t.setStreamMode?.(`requesting`),t.setResponseLength?.(()=>0),t.onCompactProgress?.({type:`compact_end`}),t.setSDKStatus?.(``)}}function U(e,n){let r=h(`tip`),i=l(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${i} to see full summary)`],...n?[n]:[],...r?[r]:[]];return t.dim(`Compacted `+a.join(`
3
+ `))}async function W(e,t){let n=e.getAppState(),r=await E(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=O({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[a,o]=await Promise.all([A(),w()]);return{systemPrompt:i,userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}var G,K;e((()=>{n(),r(),j(),F(),D(),b(),d(),u(),p(),M(),P(),g(),o(),V(),s(),v(),_(),L(),G=null,K=async(e,t)=>{let{abortController:n}=t,{messages:r}=t;if(r=y(r),r.length===0)throw Error(`No messages to compact`);let o=e.trim();try{if(!o){let e=await T(r,t.agentId);if(e)return A.cache.clear?.(),S(),m(t.options.querySource??`compact`,t.agentId),i(),N(),{type:`compact`,compactionResult:e,displayText:U(t)}}if(G?.isReactiveOnlyMode())return await H(r,t,o,G);let e=(await f(r,t)).messages,n=await x(e,t,await W(t,e),!1,o,!1);return k(void 0),N(),A.cache.clear?.(),S(),{type:`compact`,compactionResult:n,displayText:U(t,n.userDisplayMessage)}}catch(e){throw n.signal.aborted?Error(`Compaction canceled.`):a(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(B):a(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(R):(c(e),Error(`Error during compaction: ${e}`))}}}))();export{K as call};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Sc as n}from"./paths-BBvuDQl9.js";var r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A=e((()=>{r=[`common`,`uncommon`,`rare`,`epic`,`legendary`],i=String.fromCharCode,a=i(100,117,99,107),o=i(103,111,111,115,101),s=i(98,108,111,98),c=i(99,97,116),l=i(100,114,97,103,111,110),u=i(111,99,116,111,112,117,115),d=i(111,119,108),f=i(112,101,110,103,117,105,110),p=i(116,117,114,116,108,101),m=i(115,110,97,105,108),h=i(103,104,111,115,116),g=i(97,120,111,108,111,116,108),_=i(99,97,112,121,98,97,114,97),v=i(99,97,99,116,117,115),y=i(114,111,98,111,116),b=i(114,97,98,98,105,116),x=i(109,117,115,104,114,111,111,109),S=i(99,104,111,110,107),C=[a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S],w=[`·`,`✦`,`×`,`◉`,`@`,`°`],T=[`none`,`crown`,`tophat`,`propeller`,`halo`,`wizard`,`beanie`,`tinyduck`],E=[`DEBUGGING`,`PATIENCE`,`CHAOS`,`WISDOM`,`SNARK`],D={common:60,uncommon:25,rare:10,epic:4,legendary:1},O={common:`★`,uncommon:`★★`,rare:`★★★`,epic:`★★★★`,legendary:`★★★★★`},k={common:`inactive`,uncommon:`success`,rare:`permission`,epic:`autoAccept`,legendary:`warning`}}));function j(e){let t=e>>>0;return function(){t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function M(e){if(typeof Bun<`u`)return Number(BigInt(Bun.hash(e))&4294967295n);let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function N(e,t){return t[Math.floor(e()*t.length)]}function P(e){let t=Object.values(D).reduce((e,t)=>e+t,0),n=e()*t;for(let e of r)if(n-=D[e],n<0)return e;return`common`}function F(e,t){let n=U[t],r=N(e,E),i=N(e,E);for(;i===r;)i=N(e,E);let a={};for(let t of E)t===r?a[t]=Math.min(100,n+50+Math.floor(e()*30)):t===i?a[t]=Math.max(1,n-10+Math.floor(e()*15)):a[t]=n+Math.floor(e()*40);return a}function I(e){let t=P(e);return{bones:{rarity:t,species:N(e,C),eye:N(e,w),hat:t===`common`?`none`:N(e,T),shiny:e()<.01,stats:F(e,t)},inspirationSeed:Math.floor(e()*1e9)}}function L(e){return I(j(M(e)))}function R(){return`rehatch-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function z(){let e=n();return e.oauthAccount?.accountUuid??e.userID??`anon`}function B(e,t){return RegExp(`(^|${W})${t}($|${W})`).test(e)}function V(e){if(e.seed)return{};let t=`${e.name} ${e.personality}`.toLowerCase(),n={},i=C.find(e=>B(t,e)),a=r.find(e=>B(t,e));return i&&(n.species=i),a&&(n.rarity=a),n}function H(){let e=n().companion;if(!e)return;let{bones:t}=L(e.seed??z()),r=V(e);return{...e,...t,...r}}var U,W,G=e((()=>{t(),A(),U={common:5,uncommon:15,rare:25,epic:35,legendary:50},W=`[^a-z0-9]+`}));export{b as C,p as E,f as S,m as T,o as _,k as a,u as b,g as c,_ as d,c as f,h as g,a as h,L as i,s as l,l as m,H as n,O as o,S as p,G as r,E as s,R as t,v as u,A as v,y as w,d as x,x as y};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./completionCache-DORrtxkS.js";t();export{e as regenerateCompletionCache};
@@ -0,0 +1,4 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{$ as t,In as n,Ln as r,t as i,v as a}from"./src-Di342QoJ.js";import{U as o,V as s,d as c,s as l}from"./debug-UI3T040K.js";import{o as u,s as d}from"./log-CzsijfHZ.js";import{r as f,t as p}from"./execFileNoThrow-CuQN1sz8.js";import{homedir as m}from"os";import{dirname as h,join as g}from"path";import{mkdir as _,readFile as v,writeFile as y}from"fs/promises";import{pathToFileURL as b}from"url";function x(){let e=process.env.SHELL||``,t=m(),n=g(t,`.claude`);if(e.endsWith(`/zsh`)||e.endsWith(`/zsh.exe`)){let e=g(n,`completion.zsh`);return{name:`zsh`,rcFile:g(t,`.zshrc`),cacheFile:e,completionLine:`[[ -f "${e}" ]] && source "${e}"`,shellFlag:`zsh`}}if(e.endsWith(`/bash`)||e.endsWith(`/bash.exe`)){let e=g(n,`completion.bash`);return{name:`bash`,rcFile:g(t,`.bashrc`),cacheFile:e,completionLine:`[ -f "${e}" ] && source "${e}"`,shellFlag:`bash`}}if(e.endsWith(`/fish`)||e.endsWith(`/fish.exe`)){let e=process.env.XDG_CONFIG_HOME||g(t,`.config`),r=g(n,`completion.fish`);return{name:`fish`,rcFile:g(e,`fish`,`config.fish`),cacheFile:r,completionLine:`[ -f "${r}" ] && source "${r}"`,shellFlag:`fish`}}return null}function S(e){return t()?`\x1b]8;;${b(e).href}\x07${e}\x1b]8;;\x07`:e}async function C(e){let t=x();if(!t)return``;try{await _(h(t.cacheFile),{recursive:!0})}catch(r){return d(r),`${T}${a(`warning`,e)(`Could not write ${t.name} completion cache`)}${T}${n.dim(`Run manually: claude completion ${t.shellFlag} > ${t.cacheFile}`)}${T}`}if((await p(process.argv[1]||`claude`,[`completion`,t.shellFlag,`--output`,t.cacheFile])).code!==0)return`${T}${a(`warning`,e)(`Could not generate ${t.name} shell completions`)}${T}${n.dim(`Run manually: claude completion ${t.shellFlag} > ${t.cacheFile}`)}${T}`;let r=``;try{if(r=await v(t.rcFile,{encoding:`utf-8`}),r.includes(`claude completion`)||r.includes(t.cacheFile))return`${T}${a(`success`,e)(`Shell completions updated for ${t.name}`)}${T}${n.dim(`See ${S(t.rcFile)}`)}${T}`}catch(r){if(!o(r))return d(r),`${T}${a(`warning`,e)(`Could not install ${t.name} shell completions`)}${T}${n.dim(`Add this to ${S(t.rcFile)}:`)}${T}${n.dim(t.completionLine)}${T}`}try{await _(h(t.rcFile),{recursive:!0});let i=r&&!r.endsWith(`
2
+ `)?`
3
+ `:``,o=`${r}${i}\n# Claude Code shell completions\n${t.completionLine}\n`;return await y(t.rcFile,o,{encoding:`utf-8`}),`${T}${a(`success`,e)(`Installed ${t.name} shell completions`)}${T}${n.dim(`Added to ${S(t.rcFile)}`)}${T}${n.dim(`Run: source ${t.rcFile}`)}${T}`}catch(r){return d(r),`${T}${a(`warning`,e)(`Could not install ${t.name} shell completions`)}${T}${n.dim(`Add this to ${S(t.rcFile)}:`)}${T}${n.dim(t.completionLine)}${T}`}}async function w(){let e=x();if(e){if(c(`update: Regenerating ${e.name} completion cache`),(await p(process.argv[1]||`claude`,[`completion`,e.shellFlag,`--output`,e.cacheFile])).code!==0){c(`update: Failed to regenerate ${e.name} completion cache`);return}c(`update: Regenerated ${e.name} completion cache at ${e.cacheFile}`)}}var T,E=e((()=>{r(),i(),l(),s(),f(),u(),T=`
4
+ `}));export{w as n,C as r,E as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{Ct as r,cn as i}from"./state-sIHsFpDu.js";import{E as a,R as o,T as s,V as c,X as l,Y as u,d,s as f,w as p}from"./debug-UI3T040K.js";import{join as m}from"path";import{mkdir as h,readFile as g,unlink as _,writeFile as v}from"fs/promises";function y(e){return typeof e!=`object`||!e?!1:`sessionId`in e&&typeof e.sessionId==`string`&&`pid`in e&&typeof e.pid==`number`}function b(){return m(t(),k)}async function x(){try{let e=s(await g(b(),`utf8`));return y(e)?e:void 0}catch{return}}function S(e){try{return process.kill(e,0),!0}catch{return!1}}async function C(e){try{return await v(b(),a(e),{flag:`wx`}),!0}catch(e){if(o(e)===`EEXIST`)return!1;throw e}}function w(){A?.(),A=l(async()=>{await O()})}async function T(){let e=await x();return e?e.sessionId===r()?{kind:`held_by_self`}:S(e.pid)?{kind:`blocked`,by:e.sessionId}:(d(`Recovering stale computer-use lock from session ${e.sessionId} (PID ${e.pid})`),await _(b()).catch(()=>{}),{kind:`free`}):{kind:`free`}}function E(){return A!==void 0}async function D(){let e=r(),n={sessionId:e,pid:process.pid,acquiredAt:Date.now()};if(await h(t(),{recursive:!0}),await C(n))return w(),j;let i=await x();return i?i.sessionId===e?M:S(i.pid)?{kind:`blocked`,by:i.sessionId}:(d(`Recovering stale computer-use lock from session ${i.sessionId} (PID ${i.pid})`),await _(b()).catch(()=>{}),await C(n)?(w(),j):{kind:`blocked`,by:(await x())?.sessionId??`unknown`}):(await _(b()).catch(()=>{}),await C(n)?(w(),j):{kind:`blocked`,by:(await x())?.sessionId??`unknown`})}async function O(){A?.(),A=void 0;let e=await x();if(!e||e.sessionId!==r())return!1;try{return await _(b()),d(`Released computer-use lock`),!0}catch{return!1}}var k,A,j,M,N=e((()=>{i(),u(),f(),n(),p(),c(),k=`computer-use.lock`,j={kind:`acquired`,fresh:!0},M={kind:`acquired`,fresh:!1}}));export{D as a,O as i,N as n,E as r,T as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Settings-vfFvcweR.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};
@@ -0,0 +1 @@
1
+ import{Ac as e,Nc as t,Pc as n,Sc as r,_c as i,bc as a,gc as o}from"./paths-BBvuDQl9.js";e();export{o as checkHasTrustDialogAccepted,i as enableConfigs,a as getCurrentProjectConfig,r as getGlobalConfig,t as saveCurrentProjectConfig,n as saveGlobalConfig};
@@ -0,0 +1 @@
1
+ var e=()=>Promise.resolve();export{e as runConnectHeadless};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";function t(){return`claude-swarm-${process.pid}`}var n,r,i,a,o,s,c=e((()=>{n=`team-lead`,r=`claude-swarm`,i=`swarm-view`,a=`tmux`,o=`claude-hidden`,s=`CLAUDE_CODE_TEAMMATE_COMMAND`}));export{n as a,c,s as i,r as n,a as o,i as r,t as s,o as t};