@claudiolabs/claudin 0.5.7

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 (413) hide show
  1. package/LICENSE +207 -0
  2. package/README.md +91 -0
  3. package/bin/claudin +152 -0
  4. package/dist/chunks/AgentTool-0.5.7-0krqsszm.mjs +1 -0
  5. package/dist/chunks/App-0.5.7-k8c6xsbz.mjs +1 -0
  6. package/dist/chunks/ApproveApiKey-0.5.7-djmd358f.mjs +1 -0
  7. package/dist/chunks/AssistantSessionChooser-0.5.7-40f5p134.mjs +1 -0
  8. package/dist/chunks/AutoModeOptInDialog-0.5.7-dgpfkf7n.mjs +1 -0
  9. package/dist/chunks/BypassPermissionsModeDialog-0.5.7-m2n3zekg.mjs +1 -0
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-0.5.7-8p2b9258.mjs +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-0.5.7-e11rkgsy.mjs +1 -0
  12. package/dist/chunks/DiffDialog-0.5.7-df3q0dyx.mjs +3 -0
  13. package/dist/chunks/Doctor-0.5.7-996gqph8.mjs +1 -0
  14. package/dist/chunks/Grove-0.5.7-7xphv8qp.mjs +1 -0
  15. package/dist/chunks/ITermBackend-0.5.7-rv5t26my.mjs +1 -0
  16. package/dist/chunks/InvalidConfigDialog-0.5.7-76awdeqe.mjs +1 -0
  17. package/dist/chunks/InvalidSettingsDialog-0.5.7-d59ky2sv.mjs +1 -0
  18. package/dist/chunks/MigrationDialog-0.5.7-nkkcryn5.mjs +1 -0
  19. package/dist/chunks/Onboarding-0.5.7-v3jtvbkn.mjs +1 -0
  20. package/dist/chunks/ProviderManager-0.5.7-92navbez.mjs +1 -0
  21. package/dist/chunks/REPL-0.5.7-6zag11mg.mjs +1 -0
  22. package/dist/chunks/ResumeConversation-0.5.7-hpgm4f1s.mjs +1 -0
  23. package/dist/chunks/SnapshotUpdateDialog-0.5.7-xrverbhp.mjs +1 -0
  24. package/dist/chunks/TeleportProgress-0.5.7-xn5z7dt4.mjs +1 -0
  25. package/dist/chunks/TeleportRepoMismatchDialog-0.5.7-s29rrsak.mjs +1 -0
  26. package/dist/chunks/TeleportResumeWrapper-0.5.7-3r5mn1za.mjs +1 -0
  27. package/dist/chunks/TmuxBackend-0.5.7-k3c0537z.mjs +9 -0
  28. package/dist/chunks/ToolSearchTool-0.5.7-mybq3qz5.mjs +1 -0
  29. package/dist/chunks/TrustDialog-0.5.7-r4dhznyf.mjs +1 -0
  30. package/dist/chunks/activeProvider-0.5.7-8emdm8j8.mjs +1 -0
  31. package/dist/chunks/add-dir-0.5.7-jwaavdc7.mjs +1 -0
  32. package/dist/chunks/agents-0.5.7-e7dajmrs.mjs +110 -0
  33. package/dist/chunks/agents-0.5.7-q2vtj7pt.mjs +3 -0
  34. package/dist/chunks/api-0.5.7-j8bn129y.mjs +1 -0
  35. package/dist/chunks/asciicast-0.5.7-rp1h8swq.mjs +1 -0
  36. package/dist/chunks/assistant-0.5.7-sfk22b3z.mjs +1 -0
  37. package/dist/chunks/auth-0.5.7-ez3n1qpx.mjs +1 -0
  38. package/dist/chunks/auth-0.5.7-khssh83t.mjs +1 -0
  39. package/dist/chunks/autoMode-0.5.7-ezn856pd.mjs +48 -0
  40. package/dist/chunks/autoUpdater-0.5.7-dkw2aw1e.mjs +1 -0
  41. package/dist/chunks/backgroundHousekeeping-0.5.7-9ejvx75r.mjs +1 -0
  42. package/dist/chunks/branch-0.5.7-cjbtbwg1.mjs +4 -0
  43. package/dist/chunks/bridgePointer-0.5.7-5z0vqchx.mjs +1 -0
  44. package/dist/chunks/btw-0.5.7-p3kbd1wf.mjs +1 -0
  45. package/dist/chunks/buddy-0.5.7-pa55rfb4.mjs +3 -0
  46. package/dist/chunks/cacache-0.5.7-anq54jwq.mjs +1 -0
  47. package/dist/chunks/cache-probe-0.5.7-6j5hzxc4.mjs +21 -0
  48. package/dist/chunks/cacheStats-0.5.7-e1byp2n2.mjs +4 -0
  49. package/dist/chunks/caches-0.5.7-w8n6wxaj.mjs +1 -0
  50. package/dist/chunks/claudeDesktop-0.5.7-5kkyx4pz.mjs +1 -0
  51. package/dist/chunks/claudemd-0.5.7-jb7byep9.mjs +1 -0
  52. package/dist/chunks/clear-0.5.7-tkh04z2c.mjs +1 -0
  53. package/dist/chunks/clearTerminal-0.5.7-mbqev32s.mjs +1 -0
  54. package/dist/chunks/cli-0.5.7-023jpnwm.mjs +2 -0
  55. package/dist/chunks/cli-0.5.7-08mn1pmc.mjs +5 -0
  56. package/dist/chunks/cli-0.5.7-0bv1xcbe.mjs +21 -0
  57. package/dist/chunks/cli-0.5.7-0df5m6td.mjs +2 -0
  58. package/dist/chunks/cli-0.5.7-0rvzfmhb.mjs +2 -0
  59. package/dist/chunks/cli-0.5.7-0s7wtvbz.mjs +2 -0
  60. package/dist/chunks/cli-0.5.7-1fmgwk5c.mjs +2 -0
  61. package/dist/chunks/cli-0.5.7-1kmeaqmc.mjs +2 -0
  62. package/dist/chunks/cli-0.5.7-20cz322w.mjs +2 -0
  63. package/dist/chunks/cli-0.5.7-23hg3t0h.mjs +2 -0
  64. package/dist/chunks/cli-0.5.7-258ytmbr.mjs +2 -0
  65. package/dist/chunks/cli-0.5.7-26pwg6gg.mjs +2 -0
  66. package/dist/chunks/cli-0.5.7-2h4rgwc9.mjs +2 -0
  67. package/dist/chunks/cli-0.5.7-2qxsy7jq.mjs +12 -0
  68. package/dist/chunks/cli-0.5.7-2tnvc3ka.mjs +2 -0
  69. package/dist/chunks/cli-0.5.7-2xm61gkr.mjs +5 -0
  70. package/dist/chunks/cli-0.5.7-2ytftsg5.mjs +2 -0
  71. package/dist/chunks/cli-0.5.7-31969syr.mjs +2 -0
  72. package/dist/chunks/cli-0.5.7-31hdc2nc.mjs +2 -0
  73. package/dist/chunks/cli-0.5.7-35yf0b84.mjs +2 -0
  74. package/dist/chunks/cli-0.5.7-3jrq7w6x.mjs +2 -0
  75. package/dist/chunks/cli-0.5.7-3xssm25z.mjs +2 -0
  76. package/dist/chunks/cli-0.5.7-469r2a5r.mjs +193 -0
  77. package/dist/chunks/cli-0.5.7-4eg4pktt.mjs +2 -0
  78. package/dist/chunks/cli-0.5.7-4gmpny6k.mjs +133 -0
  79. package/dist/chunks/cli-0.5.7-4zv4np07.mjs +2 -0
  80. package/dist/chunks/cli-0.5.7-500c5b8m.mjs +4 -0
  81. package/dist/chunks/cli-0.5.7-52mwnwy6.mjs +58 -0
  82. package/dist/chunks/cli-0.5.7-55zn2cct.mjs +4 -0
  83. package/dist/chunks/cli-0.5.7-5736yt36.mjs +2 -0
  84. package/dist/chunks/cli-0.5.7-5aghfr8k.mjs +3 -0
  85. package/dist/chunks/cli-0.5.7-5by4fby4.mjs +2 -0
  86. package/dist/chunks/cli-0.5.7-5e5xfeq6.mjs +2 -0
  87. package/dist/chunks/cli-0.5.7-5jaayymr.mjs +17 -0
  88. package/dist/chunks/cli-0.5.7-5jms2g5g.mjs +2 -0
  89. package/dist/chunks/cli-0.5.7-5kv9dgvn.mjs +2 -0
  90. package/dist/chunks/cli-0.5.7-5mrw857q.mjs +4 -0
  91. package/dist/chunks/cli-0.5.7-5q6tfz39.mjs +2 -0
  92. package/dist/chunks/cli-0.5.7-650e2qk4.mjs +18 -0
  93. package/dist/chunks/cli-0.5.7-67xxeffj.mjs +2 -0
  94. package/dist/chunks/cli-0.5.7-6d26vvaa.mjs +2 -0
  95. package/dist/chunks/cli-0.5.7-6g3w68ks.mjs +2 -0
  96. package/dist/chunks/cli-0.5.7-6gfay8ap.mjs +2 -0
  97. package/dist/chunks/cli-0.5.7-6gkpb0vw.mjs +2 -0
  98. package/dist/chunks/cli-0.5.7-6pssgqdn.mjs +2 -0
  99. package/dist/chunks/cli-0.5.7-6thqe6p4.mjs +3 -0
  100. package/dist/chunks/cli-0.5.7-73er78b7.mjs +15 -0
  101. package/dist/chunks/cli-0.5.7-7a9gq9ff.mjs +2 -0
  102. package/dist/chunks/cli-0.5.7-7hm7dxyp.mjs +2 -0
  103. package/dist/chunks/cli-0.5.7-7k456xwn.mjs +3 -0
  104. package/dist/chunks/cli-0.5.7-7mmyazqh.mjs +34 -0
  105. package/dist/chunks/cli-0.5.7-7rgsmfw7.mjs +3 -0
  106. package/dist/chunks/cli-0.5.7-7wyhqw17.mjs +2 -0
  107. package/dist/chunks/cli-0.5.7-82x8qaxx.mjs +2 -0
  108. package/dist/chunks/cli-0.5.7-89fcvfy0.mjs +2 -0
  109. package/dist/chunks/cli-0.5.7-8ac9d7r6.mjs +2 -0
  110. package/dist/chunks/cli-0.5.7-8ap24w7a.mjs +2 -0
  111. package/dist/chunks/cli-0.5.7-8e61g5bq.mjs +10 -0
  112. package/dist/chunks/cli-0.5.7-8sbq2qed.mjs +2 -0
  113. package/dist/chunks/cli-0.5.7-8sqyymdb.mjs +2 -0
  114. package/dist/chunks/cli-0.5.7-8ychjqct.mjs +16 -0
  115. package/dist/chunks/cli-0.5.7-93eaxn9a.mjs +2 -0
  116. package/dist/chunks/cli-0.5.7-93k1z52y.mjs +2 -0
  117. package/dist/chunks/cli-0.5.7-9acdh8nc.mjs +2 -0
  118. package/dist/chunks/cli-0.5.7-9jck3vts.mjs +15 -0
  119. package/dist/chunks/cli-0.5.7-9rbmn26q.mjs +24 -0
  120. package/dist/chunks/cli-0.5.7-9sysdak3.mjs +2 -0
  121. package/dist/chunks/cli-0.5.7-9ysat94v.mjs +2 -0
  122. package/dist/chunks/cli-0.5.7-9z55nm22.mjs +3 -0
  123. package/dist/chunks/cli-0.5.7-9zwbnq8g.mjs +2 -0
  124. package/dist/chunks/cli-0.5.7-a47hzz3r.mjs +2 -0
  125. package/dist/chunks/cli-0.5.7-aq7a3646.mjs +2 -0
  126. package/dist/chunks/cli-0.5.7-ayjrdmrk.mjs +2 -0
  127. package/dist/chunks/cli-0.5.7-b51h487f.mjs +2 -0
  128. package/dist/chunks/cli-0.5.7-bkptgahs.mjs +4 -0
  129. package/dist/chunks/cli-0.5.7-bnapjxz4.mjs +2 -0
  130. package/dist/chunks/cli-0.5.7-bzrvdrq4.mjs +2 -0
  131. package/dist/chunks/cli-0.5.7-c1mv1399.mjs +2 -0
  132. package/dist/chunks/cli-0.5.7-c9dtw94k.mjs +2 -0
  133. package/dist/chunks/cli-0.5.7-cakvh73p.mjs +2 -0
  134. package/dist/chunks/cli-0.5.7-d19d4v07.mjs +2 -0
  135. package/dist/chunks/cli-0.5.7-d4gtv7f7.mjs +2 -0
  136. package/dist/chunks/cli-0.5.7-de90yre1.mjs +2 -0
  137. package/dist/chunks/cli-0.5.7-dntg9qbj.mjs +133 -0
  138. package/dist/chunks/cli-0.5.7-dp3z7wkh.mjs +2 -0
  139. package/dist/chunks/cli-0.5.7-dr7n1fyv.mjs +20 -0
  140. package/dist/chunks/cli-0.5.7-e8eqdfnf.mjs +2 -0
  141. package/dist/chunks/cli-0.5.7-eer6xagb.mjs +2 -0
  142. package/dist/chunks/cli-0.5.7-esx85d2g.mjs +2 -0
  143. package/dist/chunks/cli-0.5.7-eyemfxtz.mjs +2 -0
  144. package/dist/chunks/cli-0.5.7-fx3gesdm.mjs +2 -0
  145. package/dist/chunks/cli-0.5.7-g2dd5t6j.mjs +2 -0
  146. package/dist/chunks/cli-0.5.7-g4n7dg2d.mjs +9 -0
  147. package/dist/chunks/cli-0.5.7-g7k0r0ea.mjs +5 -0
  148. package/dist/chunks/cli-0.5.7-g8dqk0se.mjs +2 -0
  149. package/dist/chunks/cli-0.5.7-gcnk0vke.mjs +6 -0
  150. package/dist/chunks/cli-0.5.7-gnq8vh0c.mjs +2 -0
  151. package/dist/chunks/cli-0.5.7-gy4csxb5.mjs +2 -0
  152. package/dist/chunks/cli-0.5.7-h9v4tqbs.mjs +24 -0
  153. package/dist/chunks/cli-0.5.7-hdcnw5y4.mjs +2 -0
  154. package/dist/chunks/cli-0.5.7-hhre0h51.mjs +2 -0
  155. package/dist/chunks/cli-0.5.7-hp25yk8y.mjs +2 -0
  156. package/dist/chunks/cli-0.5.7-hq4wbper.mjs +11 -0
  157. package/dist/chunks/cli-0.5.7-hw11qa05.mjs +3 -0
  158. package/dist/chunks/cli-0.5.7-hw3pyj8g.mjs +2 -0
  159. package/dist/chunks/cli-0.5.7-j7h72bgz.mjs +2 -0
  160. package/dist/chunks/cli-0.5.7-j8q5bja8.mjs +2 -0
  161. package/dist/chunks/cli-0.5.7-jf3f8gen.mjs +2 -0
  162. package/dist/chunks/cli-0.5.7-jga8kgpr.mjs +2 -0
  163. package/dist/chunks/cli-0.5.7-jptzskw1.mjs +2 -0
  164. package/dist/chunks/cli-0.5.7-jw2te6th.mjs +2 -0
  165. package/dist/chunks/cli-0.5.7-k11mzgcb.mjs +2 -0
  166. package/dist/chunks/cli-0.5.7-kctf48t4.mjs +7 -0
  167. package/dist/chunks/cli-0.5.7-knkzkqbw.mjs +2 -0
  168. package/dist/chunks/cli-0.5.7-kp9pg4sr.mjs +2 -0
  169. package/dist/chunks/cli-0.5.7-kvazvrra.mjs +2 -0
  170. package/dist/chunks/cli-0.5.7-ky5khwx2.mjs +2 -0
  171. package/dist/chunks/cli-0.5.7-m0841vt9.mjs +2 -0
  172. package/dist/chunks/cli-0.5.7-m4ekdyhj.mjs +2 -0
  173. package/dist/chunks/cli-0.5.7-m4wwfa6q.mjs +2 -0
  174. package/dist/chunks/cli-0.5.7-m5q27x96.mjs +2 -0
  175. package/dist/chunks/cli-0.5.7-m82d23hf.mjs +2 -0
  176. package/dist/chunks/cli-0.5.7-mdcw5fyw.mjs +4 -0
  177. package/dist/chunks/cli-0.5.7-mz4njeb9.mjs +39 -0
  178. package/dist/chunks/cli-0.5.7-mzfr99sc.mjs +67 -0
  179. package/dist/chunks/cli-0.5.7-p381d4sx.mjs +3 -0
  180. package/dist/chunks/cli-0.5.7-p4mv49ab.mjs +25 -0
  181. package/dist/chunks/cli-0.5.7-pse9qff7.mjs +2 -0
  182. package/dist/chunks/cli-0.5.7-pzjz115k.mjs +2 -0
  183. package/dist/chunks/cli-0.5.7-q0pq4367.mjs +9 -0
  184. package/dist/chunks/cli-0.5.7-q2e6xpch.mjs +5281 -0
  185. package/dist/chunks/cli-0.5.7-q6sgd9ng.mjs +12 -0
  186. package/dist/chunks/cli-0.5.7-q8v8naf8.mjs +2 -0
  187. package/dist/chunks/cli-0.5.7-qdcp748z.mjs +2 -0
  188. package/dist/chunks/cli-0.5.7-qdqrgv1q.mjs +2 -0
  189. package/dist/chunks/cli-0.5.7-qk0n5hqa.mjs +9 -0
  190. package/dist/chunks/cli-0.5.7-r4cdt1b9.mjs +50 -0
  191. package/dist/chunks/cli-0.5.7-ra5kv4tw.mjs +2 -0
  192. package/dist/chunks/cli-0.5.7-rb75eq83.mjs +2 -0
  193. package/dist/chunks/cli-0.5.7-rggstqv6.mjs +2 -0
  194. package/dist/chunks/cli-0.5.7-rr1yd8f3.mjs +4 -0
  195. package/dist/chunks/cli-0.5.7-rzts2ke3.mjs +2 -0
  196. package/dist/chunks/cli-0.5.7-s09knvta.mjs +3 -0
  197. package/dist/chunks/cli-0.5.7-s5nd54ga.mjs +3 -0
  198. package/dist/chunks/cli-0.5.7-sb3fjts4.mjs +2 -0
  199. package/dist/chunks/cli-0.5.7-sjd6g3n6.mjs +15 -0
  200. package/dist/chunks/cli-0.5.7-sjx0wm99.mjs +2 -0
  201. package/dist/chunks/cli-0.5.7-skfm51ta.mjs +44 -0
  202. package/dist/chunks/cli-0.5.7-sx7pr75m.mjs +2 -0
  203. package/dist/chunks/cli-0.5.7-t6mtpr04.mjs +2 -0
  204. package/dist/chunks/cli-0.5.7-t8z48kc2.mjs +4 -0
  205. package/dist/chunks/cli-0.5.7-tbga87q3.mjs +2 -0
  206. package/dist/chunks/cli-0.5.7-tc3vm4ra.mjs +2 -0
  207. package/dist/chunks/cli-0.5.7-tgq7dtyz.mjs +2 -0
  208. package/dist/chunks/cli-0.5.7-tpjjm1z2.mjs +45 -0
  209. package/dist/chunks/cli-0.5.7-tqn2ged5.mjs +2 -0
  210. package/dist/chunks/cli-0.5.7-twqt7rxq.mjs +6 -0
  211. package/dist/chunks/cli-0.5.7-vgc7nzef.mjs +2 -0
  212. package/dist/chunks/cli-0.5.7-vk8p3n59.mjs +2 -0
  213. package/dist/chunks/cli-0.5.7-vn5aht50.mjs +2 -0
  214. package/dist/chunks/cli-0.5.7-vvrg78m6.mjs +2 -0
  215. package/dist/chunks/cli-0.5.7-vy4r02pg.mjs +4 -0
  216. package/dist/chunks/cli-0.5.7-vyxaeh82.mjs +2 -0
  217. package/dist/chunks/cli-0.5.7-w024nwsf.mjs +2 -0
  218. package/dist/chunks/cli-0.5.7-w16wj21h.mjs +2 -0
  219. package/dist/chunks/cli-0.5.7-w1bf9y93.mjs +3 -0
  220. package/dist/chunks/cli-0.5.7-w2fb8g6y.mjs +2 -0
  221. package/dist/chunks/cli-0.5.7-w50j12vv.mjs +2 -0
  222. package/dist/chunks/cli-0.5.7-w6nex68w.mjs +2 -0
  223. package/dist/chunks/cli-0.5.7-wz2cbwxt.mjs +4 -0
  224. package/dist/chunks/cli-0.5.7-x0n9mq65.mjs +2 -0
  225. package/dist/chunks/cli-0.5.7-x1azmh1g.mjs +2 -0
  226. package/dist/chunks/cli-0.5.7-x1w96j6d.mjs +59 -0
  227. package/dist/chunks/cli-0.5.7-x7dabprd.mjs +2 -0
  228. package/dist/chunks/cli-0.5.7-x8t1aeey.mjs +2 -0
  229. package/dist/chunks/cli-0.5.7-xepvraxn.mjs +2 -0
  230. package/dist/chunks/cli-0.5.7-xn6deh04.mjs +6 -0
  231. package/dist/chunks/cli-0.5.7-y2vc4xb6.mjs +12 -0
  232. package/dist/chunks/cli-0.5.7-y3pa8ttm.mjs +2 -0
  233. package/dist/chunks/cli-0.5.7-yaywev87.mjs +2 -0
  234. package/dist/chunks/cli-0.5.7-ycj2xr53.mjs +3 -0
  235. package/dist/chunks/cli-0.5.7-yzncgfs4.mjs +18 -0
  236. package/dist/chunks/cli-0.5.7-z1n09m4p.mjs +2 -0
  237. package/dist/chunks/cli-0.5.7-z97pranc.mjs +2 -0
  238. package/dist/chunks/cli-0.5.7-za19q18c.mjs +2 -0
  239. package/dist/chunks/cli-0.5.7-zb8ztx8p.mjs +2 -0
  240. package/dist/chunks/cli-0.5.7-zkw2fx86.mjs +2 -0
  241. package/dist/chunks/client-0.5.7-bqw74z29.mjs +1 -0
  242. package/dist/chunks/color-0.5.7-v1s3bvcj.mjs +1 -0
  243. package/dist/chunks/compact-0.5.7-7kxsprp5.mjs +3 -0
  244. package/dist/chunks/config-0.5.7-e41nnxnm.mjs +1 -0
  245. package/dist/chunks/config-0.5.7-q40ykcbb.mjs +1 -0
  246. package/dist/chunks/context-0.5.7-qvcehmj5.mjs +1 -0
  247. package/dist/chunks/context-noninteractive-0.5.7-02tkje0w.mjs +1 -0
  248. package/dist/chunks/conversation-0.5.7-h7r20gzw.mjs +1 -0
  249. package/dist/chunks/copy-0.5.7-p3xxq9b3.mjs +9 -0
  250. package/dist/chunks/cost-0.5.7-s3rzm0vd.mjs +1 -0
  251. package/dist/chunks/createSSHSession-0.5.7-s9fc5f1h.mjs +1 -0
  252. package/dist/chunks/createSession-0.5.7-4e64teqm.mjs +1 -0
  253. package/dist/chunks/debug-0.5.7-v8bqkmzm.mjs +1 -0
  254. package/dist/chunks/desktop-0.5.7-tna0yskx.mjs +1 -0
  255. package/dist/chunks/detectRepository-0.5.7-3dy7yz89.mjs +1 -0
  256. package/dist/chunks/detection-0.5.7-39zsjy8t.mjs +1 -0
  257. package/dist/chunks/diff-0.5.7-9ywmnxmx.mjs +1 -0
  258. package/dist/chunks/doctor-0.5.7-ty5zxpem.mjs +1 -0
  259. package/dist/chunks/doctorDiagnostic-0.5.7-g458bh9g.mjs +1 -0
  260. package/dist/chunks/earlyInput-0.5.7-x73yj3dn.mjs +1 -0
  261. package/dist/chunks/effort-0.5.7-h76k43fj.mjs +10 -0
  262. package/dist/chunks/envUtils-0.5.7-w1t7akfc.mjs +1 -0
  263. package/dist/chunks/environmentSelection-0.5.7-5dsnr0sv.mjs +1 -0
  264. package/dist/chunks/environments-0.5.7-pqh2gnjb.mjs +1 -0
  265. package/dist/chunks/errors-0.5.7-pa0hz043.mjs +1 -0
  266. package/dist/chunks/exampleCommands-0.5.7-3dtjxdad.mjs +1 -0
  267. package/dist/chunks/exit-0.5.7-0wrw77gk.mjs +1 -0
  268. package/dist/chunks/export-0.5.7-zw9rbf4j.mjs +2 -0
  269. package/dist/chunks/extra-usage-0.5.7-rfya84j0.mjs +1 -0
  270. package/dist/chunks/extra-usage-noninteractive-0.5.7-a1b9ndnm.mjs +1 -0
  271. package/dist/chunks/fast-0.5.7-2p6srbep.mjs +1 -0
  272. package/dist/chunks/feedback-0.5.7-181z18rn.mjs +14 -0
  273. package/dist/chunks/firstPartyEventLogger-0.5.7-xndd9dd0.mjs +1 -0
  274. package/dist/chunks/git-0.5.7-7gyptyxn.mjs +1 -0
  275. package/dist/chunks/githubModelsCredentials-0.5.7-9zhn44n6.mjs +1 -0
  276. package/dist/chunks/growthbook-0.5.7-1mynkk8j.mjs +1 -0
  277. package/dist/chunks/headless-0.5.7-9f87m6f5.mjs +2 -0
  278. package/dist/chunks/heapdump-0.5.7-ns6mqawv.mjs +6 -0
  279. package/dist/chunks/help-0.5.7-px56h6fs.mjs +1 -0
  280. package/dist/chunks/hookChains-0.5.7-1a6qvexe.mjs +3 -0
  281. package/dist/chunks/hooks-0.5.7-azm2m6rs.mjs +79 -0
  282. package/dist/chunks/hooks-0.5.7-fyp8e3f5.mjs +1 -0
  283. package/dist/chunks/ide-0.5.7-v9hbn8cp.mjs +3 -0
  284. package/dist/chunks/image-processor-napi-0.5.7-e41p58ef.mjs +1 -0
  285. package/dist/chunks/index-0.5.7-0tncgnn3.mjs +1 -0
  286. package/dist/chunks/index-0.5.7-30mrmtkn.mjs +1 -0
  287. package/dist/chunks/index-0.5.7-62s7cp1b.mjs +1 -0
  288. package/dist/chunks/index-0.5.7-69akvbm4.mjs +1 -0
  289. package/dist/chunks/index-0.5.7-6y6f5cws.mjs +1 -0
  290. package/dist/chunks/index-0.5.7-7w3agvzm.mjs +10 -0
  291. package/dist/chunks/index-0.5.7-8jwymzr6.mjs +1 -0
  292. package/dist/chunks/index-0.5.7-8m53gyr6.mjs +9 -0
  293. package/dist/chunks/index-0.5.7-ct6jw15p.mjs +2 -0
  294. package/dist/chunks/index-0.5.7-dr470b86.mjs +1 -0
  295. package/dist/chunks/index-0.5.7-e4rvp0fn.mjs +1 -0
  296. package/dist/chunks/index-0.5.7-fkw6rn8z.mjs +1 -0
  297. package/dist/chunks/index-0.5.7-h1xjcbtb.mjs +1 -0
  298. package/dist/chunks/index-0.5.7-ma3xmxv3.mjs +2 -0
  299. package/dist/chunks/index-0.5.7-qn7zmh31.mjs +9 -0
  300. package/dist/chunks/index-0.5.7-rd44m0e6.mjs +30 -0
  301. package/dist/chunks/index-0.5.7-te1s21zz.mjs +5 -0
  302. package/dist/chunks/index-0.5.7-vm9zmzmr.mjs +1 -0
  303. package/dist/chunks/index-0.5.7-wpffxvtn.mjs +1 -0
  304. package/dist/chunks/index-0.5.7-wwfn7x53.mjs +1 -0
  305. package/dist/chunks/index-0.5.7-ybcvbcjt.mjs +1 -0
  306. package/dist/chunks/index-0.5.7-yw3tp60c.mjs +1 -0
  307. package/dist/chunks/initReplBridge-0.5.7-xpy8ap8n.mjs +1 -0
  308. package/dist/chunks/ink-0.5.7-dwmx157s.mjs +1 -0
  309. package/dist/chunks/insights-0.5.7-5fpd27dr.mjs +870 -0
  310. package/dist/chunks/install-0.5.7-6sc73ew8.mjs +1 -0
  311. package/dist/chunks/install-github-app-0.5.7-jcyktynf.mjs +149 -0
  312. package/dist/chunks/install-slack-app-0.5.7-mk4a14ww.mjs +1 -0
  313. package/dist/chunks/instrumentation-0.5.7-116w6tf4.mjs +1 -0
  314. package/dist/chunks/interactiveHelpers-0.5.7-zbfkwcsb.mjs +1 -0
  315. package/dist/chunks/keybindings-0.5.7-k2s0bryc.mjs +2 -0
  316. package/dist/chunks/knowledge-0.5.7-55b2ckth.mjs +2 -0
  317. package/dist/chunks/latestVersionCache-0.5.7-k9pyxzrk.mjs +1 -0
  318. package/dist/chunks/loadAgentsDir-0.5.7-9bmbg04z.mjs +1 -0
  319. package/dist/chunks/loadPluginHooks-0.5.7-bcdwwerp.mjs +1 -0
  320. package/dist/chunks/loadPluginHooks-0.5.7-mdt3yvfc.mjs +1 -0
  321. package/dist/chunks/log-0.5.7-wcft0eyv.mjs +1 -0
  322. package/dist/chunks/main-0.5.7-9sxhszx9.mjs +1236 -0
  323. package/dist/chunks/managedEnv-0.5.7-k4gyyt60.mjs +1 -0
  324. package/dist/chunks/mcp-0.5.7-9z74evcf.mjs +1 -0
  325. package/dist/chunks/mcp-0.5.7-djz3mjw4.mjs +4 -0
  326. package/dist/chunks/mcp-0.5.7-n62qd49c.mjs +17 -0
  327. package/dist/chunks/mcpb-0.5.7-bqt73vjr.mjs +1 -0
  328. package/dist/chunks/memory-0.5.7-chxjrvf2.mjs +3 -0
  329. package/dist/chunks/mobile-0.5.7-y0cn32br.mjs +2 -0
  330. package/dist/chunks/model-0.5.7-7mt2xn7w.mjs +1 -0
  331. package/dist/chunks/model-0.5.7-fdhr0cwa.mjs +2 -0
  332. package/dist/chunks/oauth-0.5.7-xf0qbv6v.mjs +1 -0
  333. package/dist/chunks/openaiShim-0.5.7-0cejk3sb.mjs +14 -0
  334. package/dist/chunks/output-style-0.5.7-t5qc5jxe.mjs +1 -0
  335. package/dist/chunks/package-APBHZ5F3-0.5.7-7bp8s9sg.mjs +1 -0
  336. package/dist/chunks/parseConnectUrl-0.5.7-903apk0t.mjs +1 -0
  337. package/dist/chunks/parser-0.5.7-jnq01hth.mjs +1 -0
  338. package/dist/chunks/passes-0.5.7-nk3fgxyh.mjs +1 -0
  339. package/dist/chunks/permissions-0.5.7-q7whkp76.mjs +3 -0
  340. package/dist/chunks/plan-0.5.7-w5hgy3s7.mjs +1 -0
  341. package/dist/chunks/plist-0.5.7-jwz5qjtz.mjs +1 -0
  342. package/dist/chunks/plugin-0.5.7-x7xcey6d.mjs +29 -0
  343. package/dist/chunks/pluginStartupCheck-0.5.7-gy2e0dge.mjs +1 -0
  344. package/dist/chunks/plugins-0.5.7-2ehzph1a.mjs +9 -0
  345. package/dist/chunks/print-0.5.7-mjx6j0dk.mjs +57 -0
  346. package/dist/chunks/privacy-settings-0.5.7-rkmc34t8.mjs +1 -0
  347. package/dist/chunks/process-0.5.7-8c0qwpv6.mjs +1 -0
  348. package/dist/chunks/processBashCommand-0.5.7-czwzjsj9.mjs +1 -0
  349. package/dist/chunks/processSlashCommand-0.5.7-512rz16m.mjs +9 -0
  350. package/dist/chunks/prompt-0.5.7-r8ewyzer.mjs +1 -0
  351. package/dist/chunks/prompt-0.5.7-z98k679g.mjs +1 -0
  352. package/dist/chunks/prompts-0.5.7-g8mh8as5.mjs +1 -0
  353. package/dist/chunks/protocolHandler-0.5.7-p86as7s6.mjs +13 -0
  354. package/dist/chunks/provider-0.5.7-x4t1g0nh.mjs +2 -0
  355. package/dist/chunks/providerProfiles-0.5.7-dz70g8ys.mjs +1 -0
  356. package/dist/chunks/rate-limit-options-0.5.7-n282sweb.mjs +1 -0
  357. package/dist/chunks/registry-0.5.7-h8q8eay6.mjs +1 -0
  358. package/dist/chunks/release-notes-0.5.7-2h20frk0.mjs +5 -0
  359. package/dist/chunks/reload-plugins-0.5.7-z50apk74.mjs +2 -0
  360. package/dist/chunks/remote-env-0.5.7-08abe77m.mjs +1 -0
  361. package/dist/chunks/remoteBridgeCore-0.5.7-jdasqn18.mjs +1 -0
  362. package/dist/chunks/remoteSession-0.5.7-nq05jhdv.mjs +1 -0
  363. package/dist/chunks/rename-0.5.7-812j1w4d.mjs +1 -0
  364. package/dist/chunks/replBridgeHandle-0.5.7-aa3cp3ea.mjs +1 -0
  365. package/dist/chunks/resume-0.5.7-weq0rn3m.mjs +2 -0
  366. package/dist/chunks/rewind-0.5.7-y54y78kx.mjs +1 -0
  367. package/dist/chunks/sandbox-adapter-0.5.7-tb5qenm4.mjs +1 -0
  368. package/dist/chunks/sandbox-toggle-0.5.7-nxcpekeq.mjs +1 -0
  369. package/dist/chunks/session-0.5.7-ky2s0856.mjs +2 -0
  370. package/dist/chunks/sessionDiscovery-0.5.7-wr82xcxs.mjs +1 -0
  371. package/dist/chunks/sessionFileAccessHooks-0.5.7-0j8f4we0.mjs +1 -0
  372. package/dist/chunks/sessionStorage-0.5.7-qghsxmr2.mjs +1 -0
  373. package/dist/chunks/settings-0.5.7-xa4hccmb.mjs +1 -0
  374. package/dist/chunks/setup-0.5.7-s4yfpbyd.mjs +5 -0
  375. package/dist/chunks/sinks-0.5.7-feq030bq.mjs +1 -0
  376. package/dist/chunks/skills-0.5.7-h2r9d209.mjs +1 -0
  377. package/dist/chunks/startupProfiler-0.5.7-f44bsnqn.mjs +1 -0
  378. package/dist/chunks/startupUpdateCheck-0.5.7-7ff14fag.mjs +1 -0
  379. package/dist/chunks/state-0.5.7-cwk8b4cx.mjs +1 -0
  380. package/dist/chunks/stats-0.5.7-wd077xj7.mjs +6 -0
  381. package/dist/chunks/status-0.5.7-5qy7pnk9.mjs +1 -0
  382. package/dist/chunks/stickers-0.5.7-7s145w6d.mjs +1 -0
  383. package/dist/chunks/subprocessEnv-0.5.7-5dv3w3xn.mjs +1 -0
  384. package/dist/chunks/tasks-0.5.7-q79z0h3e.mjs +1 -0
  385. package/dist/chunks/teamHelpers-0.5.7-b8qf5f0d.mjs +1 -0
  386. package/dist/chunks/teammateModeSnapshot-0.5.7-kvmjwag8.mjs +1 -0
  387. package/dist/chunks/teleport-0.5.7-x740q45r.mjs +1 -0
  388. package/dist/chunks/terminalSetup-0.5.7-z8ytqt6q.mjs +1 -0
  389. package/dist/chunks/theme-0.5.7-9asaqpc9.mjs +1 -0
  390. package/dist/chunks/thinkback-0.5.7-6bzqdm8h.mjs +1 -0
  391. package/dist/chunks/thinkback-play-0.5.7-5m54zaez.mjs +1 -0
  392. package/dist/chunks/toolPool-0.5.7-5rd6jp71.mjs +1 -0
  393. package/dist/chunks/toolSearch-0.5.7-wgqasfmq.mjs +1 -0
  394. package/dist/chunks/trustedDevice-0.5.7-5qbzragc.mjs +1 -0
  395. package/dist/chunks/turndown.cjs-0.5.7-3fjybn8j.mjs +69 -0
  396. package/dist/chunks/ultrareviewCommand-0.5.7-98p7mn4r.mjs +4 -0
  397. package/dist/chunks/update-0.5.7-2jgnt5gj.mjs +86 -0
  398. package/dist/chunks/upgrade-0.5.7-1fa84f4g.mjs +1 -0
  399. package/dist/chunks/upstreamproxy-0.5.7-1p7vn612.mjs +14 -0
  400. package/dist/chunks/url-handler-napi-0.5.7-312p1719.mjs +1 -0
  401. package/dist/chunks/usage-0.5.7-qrsabcka.mjs +1 -0
  402. package/dist/chunks/util-0.5.7-tpzcah5j.mjs +1 -0
  403. package/dist/chunks/utils-0.5.7-8a2ekyr5.mjs +1 -0
  404. package/dist/chunks/vim-0.5.7-w4e8vpjf.mjs +1 -0
  405. package/dist/chunks/watcher-0.5.7-cj50b60x.mjs +1 -0
  406. package/dist/chunks/wiki-0.5.7-ccjdtg8v.mjs +132 -0
  407. package/dist/chunks/worktree-0.5.7-g8wrf9zf.mjs +1 -0
  408. package/dist/chunks/worktreeModeEnabled-0.5.7-w4jdaq8p.mjs +1 -0
  409. package/dist/chunks/wrapper-0.5.7-8k82xd0n.mjs +7 -0
  410. package/dist/claudin-vscode.vsix +0 -0
  411. package/dist/cli.mjs +7 -0
  412. package/package.json +141 -0
  413. package/scripts/v8cache-gc.mjs +84 -0
@@ -0,0 +1,44 @@
1
+ import{Vma as W6,Xma as L$,Zma as M,_ma as KZ}from"./cli-0.5.7-258ytmbr.mjs";function F(Z,$,X,J,z){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof $==="function"?Z!==$||!z:!$.has(Z))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?z.call(Z,X):z?z.value=X:$.set(Z,X),X}function G(Z,$,X,J){if(X==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof $==="function"?Z!==$||!J:!$.has(Z))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?J:X==="a"?J.call(Z):J?J.value:$.get(Z)}var UZ=()=>{};var i$=function(){let{crypto:Z}=globalThis;if(Z?.randomUUID)return i$=Z.randomUUID.bind(Z),Z.randomUUID();let $=new Uint8Array(1),X=Z?()=>Z.getRandomValues($)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(J)=>(+J^X()&15>>+J/4).toString(16))};var n$=()=>{};function qZ(Z){return typeof Z==="object"&&Z!==null&&(("name"in Z)&&Z.name==="AbortError"||("message"in Z)&&String(Z.message).includes("FetchRequestCanceledException"))}var J8=(Z)=>{if(Z instanceof Error)return Z;if(typeof Z==="object"&&Z!==null){try{if(Object.prototype.toString.call(Z)==="[object Error]"){let $=Error(Z.message,Z.cause?{cause:Z.cause}:{});if(Z.stack)$.stack=Z.stack;if(Z.cause&&!$.cause)$.cause=Z.cause;if(Z.name)$.name=Z.name;return $}}catch{}try{return Error(JSON.stringify(Z))}catch{}}return Error(Z)};var hZ=()=>{};var x,l,n,EZ,z8,Q8,K8,Y8,G8,w8,W8,V8,N8;var r=M(()=>{hZ();x=class x extends Error{};l=class l extends x{constructor(Z,$,X,J,z){super(`${l.makeMessage(Z,$,X)}`);this.status=Z,this.headers=J,this.requestID=J?.get("request-id"),this.error=$,this.type=z??null}static makeMessage(Z,$,X){let J=$?.message?typeof $.message==="string"?$.message:JSON.stringify($.message):$?JSON.stringify($):X;if(Z&&J)return`${Z} ${J}`;if(Z)return`${Z} status code (no body)`;if(J)return J;return"(no status code or body)"}static generate(Z,$,X,J){if(!Z||!J)return new EZ({message:X,cause:J8($)});let z=$,Q=z?.error?.type;if(Z===400)return new Q8(Z,z,X,J,Q);if(Z===401)return new K8(Z,z,X,J,Q);if(Z===403)return new Y8(Z,z,X,J,Q);if(Z===404)return new G8(Z,z,X,J,Q);if(Z===409)return new w8(Z,z,X,J,Q);if(Z===422)return new W8(Z,z,X,J,Q);if(Z===429)return new V8(Z,z,X,J,Q);if(Z>=500)return new N8(Z,z,X,J,Q);return new l(Z,z,X,J,Q)}};n=class n extends l{constructor({message:Z}={}){super(void 0,void 0,Z||"Request was aborted.",void 0)}};EZ=class EZ extends l{constructor({message:Z,cause:$}){super(void 0,void 0,Z||"Connection error.",void 0);if($)this.cause=$}};z8=class z8 extends EZ{constructor({message:Z}={}){super({message:Z??"Request timed out."})}};Q8=class Q8 extends l{};K8=class K8 extends l{};Y8=class Y8 extends l{};G8=class G8 extends l{};w8=class w8 extends l{};W8=class W8 extends l{};V8=class V8 extends l{};N8=class N8 extends l{}});function z$(Z){if(typeof Z!=="object")return{};return Z??{}}function r$(Z){if(!Z)return!0;for(let $ in Z)return!1;return!0}function DX(Z,$){return Object.prototype.hasOwnProperty.call(Z,$)}var H1,AX=(Z)=>{return H1.test(Z)},o=(Z)=>(o=Array.isArray,o(Z)),a$,LX=(Z,$)=>{if(typeof $!=="number"||!Number.isInteger($))throw new x(`${Z} must be an integer`);if($<0)throw new x(`${Z} must be a positive integer`);return $},Q$=(Z)=>{try{return JSON.parse(Z)}catch($){return}};var VZ=M(()=>{r();H1=/^[a-z][a-z0-9+.-]*:/i,a$=o});var EX=(Z)=>new Promise(($)=>setTimeout($,Z));var o$=()=>{};var QZ="0.96.0";var U8=()=>{};function T1(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function S1(){if(typeof navigator>"u"||!navigator)return null;let Z=[{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/}];for(let{key:$,pattern:X}of Z){let J=X.exec(navigator.userAgent);if(J){let z=J[1]||0,Q=J[2]||0,Y=J[3]||0;return{browser:$,version:`${z}.${Q}.${Y}`}}}return null}var IX=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},B1=()=>{let Z=T1();if(Z==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":QZ,"X-Stainless-OS":PX(Deno.build.os),"X-Stainless-Arch":jX(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":QZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(Z==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":QZ,"X-Stainless-OS":PX(globalThis.process.platform??"unknown"),"X-Stainless-Arch":jX(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let $=S1();if($)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":QZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${$.browser}`,"X-Stainless-Runtime-Version":$.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":QZ,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},jX=(Z)=>{if(Z==="x32")return"x32";if(Z==="x86_64"||Z==="x64")return"x64";if(Z==="arm")return"arm";if(Z==="aarch64"||Z==="arm64")return"arm64";if(Z)return`other:${Z}`;return"unknown"},PX=(Z)=>{if(Z=Z.toLowerCase(),Z.includes("ios"))return"iOS";if(Z==="android")return"Android";if(Z==="darwin")return"MacOS";if(Z==="win32")return"Windows";if(Z==="freebsd")return"FreeBSD";if(Z==="openbsd")return"OpenBSD";if(Z==="linux")return"Linux";if(Z)return`Other:${Z}`;return"Unknown"},RX,q8=()=>{return RX??(RX=B1())};var K$=M(()=>{U8()});function kX(){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 t$(...Z){let $=globalThis.ReadableStream;if(typeof $>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new $(...Z)}function Y$(Z){let $=Symbol.asyncIterator in Z?Z[Symbol.asyncIterator]():Z[Symbol.iterator]();return t$({start(){},async pull(X){let{done:J,value:z}=await $.next();if(J)X.close();else X.enqueue(z)},async cancel(){await $.return?.()}})}function O8(Z){if(Z[Symbol.asyncIterator])return Z;let $=Z.getReader();return{async next(){try{let X=await $.read();if(X?.done)$.releaseLock();return X}catch(X){throw $.releaseLock(),X}},async return(){let X=$.cancel();return $.releaseLock(),await X,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function yX(Z){if(Z===null||typeof Z!=="object")return;if(Z[Symbol.asyncIterator]){await Z[Symbol.asyncIterator]().return?.();return}let $=Z.getReader(),X=$.cancel();$.releaseLock(),await X}var vZ=()=>{};var _X=({headers:Z,body:$})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify($)}};var fX=()=>{};var s$="RFC3986",e$=(Z)=>String(Z),Z0,bX="RFC1738";var $0=M(()=>{Z0={RFC1738:(Z)=>String(Z).replace(/%20/g,"+"),RFC3986:e$}});function vX(Z){if(!Z||typeof Z!=="object")return!1;return!!(Z.constructor&&Z.constructor.isBuffer&&Z.constructor.isBuffer(Z))}function J0(Z,$){if(o(Z)){let X=[];for(let J=0;J<Z.length;J+=1)X.push($(Z[J]));return X}return $(Z)}var G$=(Z,$)=>(G$=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),G$(Z,$)),NZ,X0=1024,hX=(Z,$,X,J,z)=>{if(Z.length===0)return Z;let Q=Z;if(typeof Z==="symbol")Q=Symbol.prototype.toString.call(Z);else if(typeof Z!=="string")Q=String(Z);if(X==="iso-8859-1")return escape(Q).replace(/%u[0-9a-f]{4}/gi,function(K){return"%26%23"+parseInt(K.slice(2),16)+"%3B"});let Y="";for(let K=0;K<Q.length;K+=X0){let N=Q.length>=X0?Q.slice(K,K+X0):Q,q=[];for(let C=0;C<N.length;++C){let V=N.charCodeAt(C);if(V===45||V===46||V===95||V===126||V>=48&&V<=57||V>=65&&V<=90||V>=97&&V<=122||z===bX&&(V===40||V===41)){q[q.length]=N.charAt(C);continue}if(V<128){q[q.length]=NZ[V];continue}if(V<2048){q[q.length]=NZ[192|V>>6]+NZ[128|V&63];continue}if(V<55296||V>=57344){q[q.length]=NZ[224|V>>12]+NZ[128|V>>6&63]+NZ[128|V&63];continue}C+=1,V=65536+((V&1023)<<10|N.charCodeAt(C)&1023),q[q.length]=NZ[240|V>>18]+NZ[128|V>>12&63]+NZ[128|V>>6&63]+NZ[128|V&63]}Y+=q.join("")}return Y};var gX=M(()=>{$0();VZ();NZ=(()=>{let Z=[];for(let $=0;$<256;++$)Z.push("%"+(($<16?"0":"")+$.toString(16)).toUpperCase());return Z})()});function L1(Z){return typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean"||typeof Z==="symbol"||typeof Z==="bigint"}function uX(Z,$,X,J,z,Q,Y,K,N,q,C,V,w,O,H,D,B,A){let T=Z,f=A,k=0,P=!1;while((f=f.get(z0))!==void 0&&!P){let g=f.get(Z);if(k+=1,typeof g<"u")if(g===k)throw RangeError("Cyclic object value");else P=!0;if(typeof f.get(z0)>"u")k=0}if(typeof q==="function")T=q($,T);else if(T instanceof Date)T=w?.(T);else if(X==="comma"&&o(T))T=J0(T,function(g){if(g instanceof Date)return w?.(g);return g});if(T===null){if(Q)return N&&!D?N($,p.encoder,B,"key",O):$;T=""}if(L1(T)||vX(T)){if(N){let g=D?$:N($,p.encoder,B,"key",O);return[H?.(g)+"="+H?.(N(T,p.encoder,B,"value",O))]}return[H?.($)+"="+H?.(String(T))]}let u=[];if(typeof T>"u")return u;let y;if(X==="comma"&&o(T)){if(D&&N)T=J0(T,N);y=[{value:T.length>0?T.join(",")||null:void 0}]}else if(o(q))y=q;else{let g=Object.keys(T);y=C?g.sort(C):g}let c=K?String($).replace(/\./g,"%2E"):String($),b=J&&o(T)&&T.length===1?c+"[]":c;if(z&&o(T)&&T.length===0)return b+"[]";for(let g=0;g<y.length;++g){let zZ=y[g],LZ=typeof zZ==="object"&&typeof zZ.value<"u"?zZ.value:T[zZ];if(Y&&LZ===null)continue;let p$=V&&K?zZ.replace(/\./g,"%2E"):zZ,F1=o(T)?typeof X==="function"?X(b,p$):b:b+(V?"."+p$:"["+p$+"]");A.set(Z,k);let SX=new WeakMap;SX.set(z0,A),dX(u,uX(LZ,F1,X,J,z,Q,Y,K,X==="comma"&&D&&o(T)?null:N,q,C,V,w,O,H,D,B,SX))}return u}function E1(Z=p){if(typeof Z.allowEmptyArrays<"u"&&typeof Z.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof Z.encodeDotInKeys<"u"&&typeof Z.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(Z.encoder!==null&&typeof Z.encoder<"u"&&typeof Z.encoder!=="function")throw TypeError("Encoder has to be a function.");let $=Z.charset||p.charset;if(typeof Z.charset<"u"&&Z.charset!=="utf-8"&&Z.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let X=s$;if(typeof Z.format<"u"){if(!G$(Z0,Z.format))throw TypeError("Unknown format option provided.");X=Z.format}let J=Z0[X],z=p.filter;if(typeof Z.filter==="function"||o(Z.filter))z=Z.filter;let Q;if(Z.arrayFormat&&Z.arrayFormat in cX)Q=Z.arrayFormat;else if("indices"in Z)Q=Z.indices?"indices":"repeat";else Q=p.arrayFormat;if("commaRoundTrip"in Z&&typeof Z.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let Y=typeof Z.allowDots>"u"?!!Z.encodeDotInKeys===!0?!0:p.allowDots:!!Z.allowDots;return{addQueryPrefix:typeof Z.addQueryPrefix==="boolean"?Z.addQueryPrefix:p.addQueryPrefix,allowDots:Y,allowEmptyArrays:typeof Z.allowEmptyArrays==="boolean"?!!Z.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:Q,charset:$,charsetSentinel:typeof Z.charsetSentinel==="boolean"?Z.charsetSentinel:p.charsetSentinel,commaRoundTrip:!!Z.commaRoundTrip,delimiter:typeof Z.delimiter>"u"?p.delimiter:Z.delimiter,encode:typeof Z.encode==="boolean"?Z.encode:p.encode,encodeDotInKeys:typeof Z.encodeDotInKeys==="boolean"?Z.encodeDotInKeys:p.encodeDotInKeys,encoder:typeof Z.encoder==="function"?Z.encoder:p.encoder,encodeValuesOnly:typeof Z.encodeValuesOnly==="boolean"?Z.encodeValuesOnly:p.encodeValuesOnly,filter:z,format:X,formatter:J,serializeDate:typeof Z.serializeDate==="function"?Z.serializeDate:p.serializeDate,skipNulls:typeof Z.skipNulls==="boolean"?Z.skipNulls:p.skipNulls,sort:typeof Z.sort==="function"?Z.sort:null,strictNullHandling:typeof Z.strictNullHandling==="boolean"?Z.strictNullHandling:p.strictNullHandling}}function lX(Z,$={}){let X=Z,J=E1($),z,Q;if(typeof J.filter==="function")Q=J.filter,X=Q("",X);else if(o(J.filter))Q=J.filter,z=Q;let Y=[];if(typeof X!=="object"||X===null)return"";let K=cX[J.arrayFormat],N=K==="comma"&&J.commaRoundTrip;if(!z)z=Object.keys(X);if(J.sort)z.sort(J.sort);let q=new WeakMap;for(let w=0;w<z.length;++w){let O=z[w];if(J.skipNulls&&X[O]===null)continue;dX(Y,uX(X[O],O,K,N,J.allowEmptyArrays,J.strictNullHandling,J.skipNulls,J.encodeDotInKeys,J.encode?J.encoder:null,J.filter,J.sort,J.allowDots,J.serializeDate,J.format,J.formatter,J.encodeValuesOnly,J.charset,q))}let C=Y.join(J.delimiter),V=J.addQueryPrefix===!0?"?":"";if(J.charsetSentinel)if(J.charset==="iso-8859-1")V+="utf8=%26%2310003%3B&";else V+="utf8=%E2%9C%93&";return C.length>0?V+C:""}var cX,dX=function(Z,$){Array.prototype.push.apply(Z,o($)?$:[$])},mX,p,z0;var pX=M(()=>{gX();$0();VZ();cX={brackets(Z){return String(Z)+"[]"},comma:"comma",indices(Z,$){return String(Z)+"["+$+"]"},repeat(Z){return String(Z)}},p={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:hX,encodeValuesOnly:!1,format:s$,formatter:e$,indices:!1,serializeDate(Z){return(mX??(mX=Function.prototype.call.bind(Date.prototype.toISOString)))(Z)},skipNulls:!1,strictNullHandling:!1};z0={}});function iX(Z){return lX(Z,{arrayFormat:"brackets"})}var Q0=M(()=>{pX()});function W$(Z){if(!Z)return;let $;try{$=new URL(Z)}catch(J){throw new j(`Invalid token endpoint base URL "${Z}": ${J}`)}if($.protocol==="https:")return;let X=$.hostname.toLowerCase().replace(/^\[|\]$/g,"");if($.protocol==="http:"&&(X==="localhost"||X==="127.0.0.1"||X==="::1"))return;throw new j(`Refusing to send credential over non-https token endpoint "${Z}"`)}async function V$(Z,$){let X=await R1(Z),J;try{J=JSON.parse(X)}catch{throw new j(`Token endpoint returned non-JSON response (status ${Z.status})`,Z.status,t(X),$)}if(!J.access_token)throw new j(`Token endpoint response missing access_token: ${JSON.stringify(t(J))}`,Z.status,t(J),$);if(J.token_type&&J.token_type.toLowerCase()!=="bearer")throw new j(`Token endpoint response: unsupported token_type "${J.token_type}" (want Bearer)`,Z.status,t(J),$);return J}function t(Z){if(Z==null)return Z;if(typeof Z==="string"){let $;try{$=JSON.parse(Z)}catch{if(Z.length<=K0)return Z;return Z.slice(0,K0)+`... <${Z.length-K0} more chars>`}return JSON.stringify(t($))}if(typeof Z==="object"&&!Array.isArray(Z)){let $={};for(let[X,J]of Object.entries(Z))if(P1.has(X))$[X]=J;return $}return null}async function N$(Z,$=(X)=>console.warn(`anthropic-sdk: ${X}`)){if(typeof process>"u"||process.platform==="win32")return;let X=await import("node:fs"),J=Z,z;try{J=await X.promises.realpath(Z),z=await X.promises.stat(J)}catch{return}let Q=z.mode&511;if(Q&18)throw new j(`Credentials file at ${J} is group/world-writable (mode 0o${Q.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${J}\`.`);if(Q&36)throw new j(`Credentials file at ${J} is group/world-readable (mode 0o${Q.toString(8)}); run \`chmod 600 ${J}\` before retrying.`);if(typeof process.getuid==="function"&&z.uid!==process.getuid())$(`credentials file at ${J} is owned by uid ${z.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function U$(Z,$){let X=await import("node:fs"),z=(await import("node:path")).dirname(Z);await X.promises.mkdir(z,{recursive:!0,mode:448});let Q=`${Z}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let Y=await X.promises.open(Q,"w",384);try{await Y.writeFile(JSON.stringify($,null,2)),await Y.sync()}finally{await Y.close()}await X.promises.rename(Q,Z)}catch(Y){throw await X.promises.unlink(Q).catch(()=>{}),Y}try{let Y=await X.promises.open(z,"r");try{await Y.sync()}finally{await Y.close()}}catch{}}async function R1(Z){if(!Z.body)return"";let $=Z.body.getReader(),X=[],J=0;for(;;){let{done:Q,value:Y}=await $.read();if(Q)break;if(J+Y.length>nX){let K=nX-J;if(K>0)X.push(Y.subarray(0,K));await $.cancel();break}X.push(Y),J+=Y.length}let z;if(X.length===1)z=X[0];else{z=new Uint8Array(X.reduce((Y,K)=>Y+K.length,0));let Q=0;for(let Y of X)z.set(Y,Q),Q+=Y.length}return new TextDecoder("utf-8").decode(z)}var aX="urn:ietf:params:oauth:grant-type:jwt-bearer",rX="refresh_token",w$="/v1/oauth/token",jZ="oauth-2025-04-20",oX="oidc-federation-2026-04-01",tX=120,gZ=30,sX=5,nX=1048576,K0=2000,P1,j;var mZ=M(()=>{r();P1=new Set(["error","error_description","error_uri"]);j=class j extends x{constructor(Z,$=null,X=null,J=null){super(Z);this.statusCode=$,this.body=X,this.requestId=J}}});function wZ(){return Math.floor(Date.now()/1000)}var M8=()=>{};class Y0{constructor(Z,$){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=Z,this.onAdvisoryRefreshError=$}async getToken(){let Z=this.nextForce;this.nextForce=!1;let $=this.cached;if(Z||$==null)return(await this.refresh(Z)).token;if($.expiresAt==null)return $.token;let X=$.expiresAt-wZ();if(X>tX)return $.token;if(X>gZ)return this.backgroundRefresh(),$.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(Z=!1){if(this.pendingRefresh&&!Z)return this.pendingRefresh;return this.doRefresh(Z)}backgroundRefresh(){if(this.pendingRefresh)return;if(wZ()-this.lastAdvisoryError<sX)return;this.doRefresh().catch((Z)=>{this.lastAdvisoryError=wZ(),this.onAdvisoryRefreshError?.(Z)})}doRefresh(Z=!1){return this.pendingRefresh=this.provider(Z?{forceRefresh:!0}:void 0).then(($)=>{return this.cached=$,this.pendingRefresh=null,$},($)=>{throw this.pendingRefresh=null,$}),this.pendingRefresh}}var eX=M(()=>{mZ();M8()});var E=(Z)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[Z]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(Z)?.trim()||void 0;return};var q$=()=>{};function X5(Z){let $=0;for(let z of Z)$+=z.length;let X=new Uint8Array($),J=0;for(let z of Z)X.set(z,J),J+=z.length;return X}function cZ(Z){let $;return(Z5??($=new globalThis.TextEncoder,Z5=$.encode.bind($)))(Z)}function G0(Z){let $;return($5??($=new globalThis.TextDecoder,$5=$.decode.bind($)))(Z)}var Z5,$5;var O$=()=>{};var J5=M(()=>{r();O$()});function C8(){}function M$(Z,$,X){if(!$||C$[Z]>C$[X])return C8;else return $[Z].bind($)}function m(Z){let $=Z.logger,X=Z.logLevel??"off";if(!$)return I1;let J=z5.get($);if(J&&J[0]===X)return J[1];let z={error:M$("error",$,X),warn:M$("warn",$,X),info:M$("info",$,X),debug:M$("debug",$,X)};return z5.set($,[X,z]),z}var C$,w0=(Z,$,X)=>{if(!Z)return;if(DX(C$,Z))return Z;m(X).warn(`${$} was set to ${JSON.stringify(Z)}, expected one of ${JSON.stringify(Object.keys(C$))}`);return},I1,z5,OZ=(Z)=>{if(Z.options)Z.options={...Z.options},delete Z.options.headers;if(Z.headers)Z.headers=Object.fromEntries((Z.headers instanceof Headers?[...Z.headers]:Object.entries(Z.headers)).map(([$,X])=>[$,$.toLowerCase()==="authorization"||$.toLowerCase()==="api-key"||$.toLowerCase()==="x-api-key"||$.toLowerCase()==="cookie"||$.toLowerCase()==="set-cookie"?"***":X]));if("retryOfRequestLogID"in Z){if(Z.retryOfRequestLogID)Z.retryOf=Z.retryOfRequestLogID;delete Z.retryOfRequestLogID}return Z};var F8=M(()=>{VZ();C$={off:0,error:200,warn:300,info:400,debug:500};I1={error:C8,warn:C8,info:C8,debug:C8},z5=new WeakMap});var Q5=M(()=>{VZ();J5();q$();F8();n$();o$();Q0()});function K5(Z){if(!Z)throw Error("profile name is empty");if(Z==="."||Z==="..")throw Error(`profile name "${Z}" is not allowed`);if(Z.includes("/")||Z.includes("\\"))throw Error(`profile name "${Z}" must not contain path separators`);if(!k1.test(Z))throw Error(`profile name "${Z}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var F$="1.0",k1,Y5=async(Z)=>{var $,X;let J=await W0();if(J===null)return null;let z=Z??await w5();if(z===null)return null;K5(z);let Q=await import("node:fs"),K=(await import("node:path")).join(J,"configs",`${z}.json`),N;try{N=await Q.promises.readFile(K,"utf-8")}catch(V){if(V?.code!=="ENOENT")throw Error(`failed to read config file ${K}: ${V}`);N=null}if(N===null){let V=E("ANTHROPIC_ORGANIZATION_ID"),w=E("ANTHROPIC_IDENTITY_TOKEN_FILE"),O=E("ANTHROPIC_FEDERATION_RULE_ID");if(O&&V)return{fromFile:!1,config:{organization_id:V,workspace_id:E("ANTHROPIC_WORKSPACE_ID"),base_url:E("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:O,service_account_id:E("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:w?{source:"file",path:w}:void 0,scope:E("ANTHROPIC_SCOPE")}}};return null}let q;try{q=JSON.parse(N)}catch(V){throw Error(`failed to parse config file ${K}: ${V}`)}if(!q.authentication)throw Error(`config file ${K} is missing "authentication"`);let C=q.authentication.type;if(C!=="oidc_federation"&&C!=="user_oauth")throw Error(`authentication.type "${C}" is not a known authentication type`);if(q.organization_id??(q.organization_id=E("ANTHROPIC_ORGANIZATION_ID")),q.workspace_id??(q.workspace_id=E("ANTHROPIC_WORKSPACE_ID")),q.base_url??(q.base_url=E("ANTHROPIC_BASE_URL")),($=q.authentication).scope??($.scope=E("ANTHROPIC_SCOPE")),q.authentication.type==="oidc_federation"){if(!q.authentication.identity_token){let V=E("ANTHROPIC_IDENTITY_TOKEN_FILE");if(V)q.authentication.identity_token={source:"file",path:V}}if(!q.authentication.federation_rule_id)q.authentication.federation_rule_id=E("ANTHROPIC_FEDERATION_RULE_ID")??"";(X=q.authentication).service_account_id??(X.service_account_id=E("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:q,fromFile:!0}},G5=async(Z,$)=>{if(Z?.authentication.credentials_path)return Z.authentication.credentials_path;let X=await W0();if(!X)return null;let J=$??await w5();if(!J)return null;return K5(J),(await import("node:path")).join(X,"credentials",`${J}.json`)},W0=async()=>{if(!y1())return null;let Z=await import("node:path"),$=E("ANTHROPIC_CONFIG_DIR");if($)return $;if(q8()["X-Stainless-OS"]==="Windows"){let Q=E("APPDATA");if(Q)return Z.join(Q,"Anthropic");let Y=E("USERPROFILE");if(Y)return Z.join(Y,"AppData","Roaming","Anthropic");return null}let J=E("XDG_CONFIG_HOME");if(J)return Z.join(J,"anthropic");let z=E("HOME");if(z)return Z.join(z,".config","anthropic");return null},y1=()=>{let Z=q8()["X-Stainless-Runtime"];return Z==="node"||Z==="deno"},w5=async()=>{let Z=await W0();if(!Z)return null;let $=E("ANTHROPIC_PROFILE");if($)return $;let X=await import("node:fs"),z=(await import("node:path")).join(Z,"active_config");try{return(await X.promises.readFile(z,"utf-8")).trim()||"default"}catch(Q){if(Q?.code!=="ENOENT")throw Error(`failed to read ${z}: ${Q}`);return"default"}};var V0=M(()=>{K$();Q5();k1=/^[A-Za-z0-9_.-]+$/});function N0(Z){if(!Z)throw new x("Identity token file path is empty");return async()=>{let $=await import("node:fs"),X;try{X=await $.promises.readFile(Z,"utf-8")}catch(z){throw new x(`Failed to read identity token file at ${Z}: ${z}`)}let J=X.trim();if(!J)throw new x(`Identity token file at ${Z} is empty`);return J}}function W5(Z){if(!Z)throw new x("Identity token value is empty");return()=>Z}var V5=M(()=>{r()});function N5(Z){return async()=>{W$(Z.baseURL);let $=await Z.identityTokenProvider();if($.length>16384)throw new j(`Identity token is ${Math.ceil($.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let X={grant_type:aX,assertion:$,federation_rule_id:Z.federationRuleId,organization_id:Z.organizationId};if(Z.serviceAccountId)X.service_account_id=Z.serviceAccountId;if(Z.workspaceId)X.workspace_id=Z.workspaceId;let J=`${Z.baseURL}${w$}`,z;try{z=await Z.fetch(J,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${jZ},${oX}`,"User-Agent":Z.userAgent||`anthropic-sdk-typescript/${QZ} oidcFederationProvider`},body:JSON.stringify(X)})}catch(N){throw new j(`Failed to reach token endpoint ${J}: ${N}`)}let Q=z.headers.get("Request-Id");if(!z.ok){let N=await z.text().catch(()=>""),q=t(N),C="";if(z.status===401)C=` Ensure your federation rule matches your identity token. ${Z.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new j(`Token exchange failed with status ${z.status}${Q?` (request-id ${Q})`:""}: ${q}${C}`,z.status,q,Q)}let Y=await V$(z,Q),K=Number(Y.expires_in);if(!Number.isFinite(K))throw new j(`Token endpoint response missing required fields: ${JSON.stringify(t(Y))}`,z.status,t(Y),Q);return{token:Y.access_token,expiresAt:wZ()+K}}}var U5=M(()=>{mZ();M8();U8()});function q5(Z){return async($)=>{let X=await import("node:fs");await N$(Z.credentialsPath,Z.onSafetyWarning);let J;try{J=await X.promises.readFile(Z.credentialsPath,"utf-8")}catch(B){throw new j(`Credentials file not found at ${Z.credentialsPath}: ${B}`)}let z;try{z=JSON.parse(J)}catch(B){throw new j(`Credentials file at ${Z.credentialsPath} is not valid JSON: ${B}`)}let Q=z.access_token;if(!Q)throw new j(`Credentials file at ${Z.credentialsPath} must include 'access_token'`);let Y=z.expires_at;if(!$?.forceRefresh&&(Y==null||wZ()<Y-gZ))return{token:Q,expiresAt:Y??null};let K=z.refresh_token;if(!Z.clientId||!K)throw new j(`Access token at ${Z.credentialsPath} has expired and no refresh is available (client_id ${Z.clientId?"set":"empty"}, refresh_token ${K?"set":"empty"})`);W$(Z.baseURL);let N={grant_type:rX,refresh_token:K,client_id:Z.clientId},q=`${Z.baseURL}${w$}`,C;try{C=await Z.fetch(q,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":jZ,"User-Agent":Z.userAgent||`anthropic-sdk-typescript/${QZ} userOAuthProvider`},body:JSON.stringify(N)})}catch(B){throw new j(`User OAuth refresh failed to reach token endpoint: ${B}`)}let V=C.headers.get("Request-Id");if(!C.ok){let B=await C.text().catch(()=>"");throw new j(`User OAuth refresh failed (HTTP ${C.status}): ${t(B)}`,C.status,t(B),V)}let w=await V$(C,V),O=Number(w.expires_in);if(!Number.isFinite(O))throw new j(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(t(w))}`,C.status,t(w),V);let H=wZ()+O,D=w.refresh_token||K;return await U$(Z.credentialsPath,{...z,version:F$,type:"oauth_token",access_token:w.access_token,expires_at:H,refresh_token:D}),{token:w.access_token,expiresAt:H}}}var O5=M(()=>{V0();mZ();M8();U8()});function U0(Z,$){let X=Z.authentication.credentials_path??null,J=(Z.base_url||$.baseURL).replace(/\/+$/,""),z=_1(Z,X,J,$),Q={};if(Z.workspace_id&&Z.authentication.type==="user_oauth")Q["anthropic-workspace-id"]=Z.workspace_id;return{provider:z,extraHeaders:Q,baseURL:Z.base_url||void 0}}async function M5(Z,$){let X=await Y5($);if(!X)return null;let{config:J,fromFile:z}=X,Q=J.authentication.credentials_path||!z?J:{...J,authentication:{...J.authentication,credentials_path:await G5(J,$)??void 0}};return U0(Q,Z)}function _1(Z,$,X,J){switch(Z.authentication.type){case"oidc_federation":{let z=Z.authentication,Q=f1(z);if(!Q)throw new j("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!z.federation_rule_id)throw new j("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!Z.organization_id)throw new j("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let Y=N5({identityTokenProvider:Q,federationRuleId:z.federation_rule_id,organizationId:Z.organization_id,serviceAccountId:z.service_account_id,workspaceId:Z.workspace_id,baseURL:X,fetch:J.fetch,userAgent:J.userAgent});if($)return b1(Y,$,J.onCacheWriteError,J.onSafetyWarning);return Y}case"user_oauth":{if(!$)throw new j("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return q5({credentialsPath:$,clientId:Z.authentication.client_id,baseURL:X,fetch:J.fetch,userAgent:J.userAgent,onSafetyWarning:J.onSafetyWarning})}default:{let z=Z.authentication.type;throw new j(`authentication.type "${z}" is not a known authentication type`)}}}function f1(Z){if(Z.identity_token){let J=Z.identity_token.source;if(J!=="file")throw new j(`identity_token.source "${J}" is not supported by this SDK version (only "file")`);if(!Z.identity_token.path)throw new j('identity_token.source "file" requires a non-empty path');return N0(Z.identity_token.path)}let $=E("ANTHROPIC_IDENTITY_TOKEN_FILE");if($)return N0($);let X=E("ANTHROPIC_IDENTITY_TOKEN");if(X)return W5(X);return null}function b1(Z,$,X,J){return async(z)=>{let Q=await import("node:fs");await N$($,J);let Y;try{let N=await Q.promises.readFile($,"utf-8");Y=JSON.parse(N);let q=Y?.access_token;if(q&&!z?.forceRefresh){let C=Y?.expires_at;if(C==null||wZ()<C-gZ)return{token:q,expiresAt:C??null}}}catch(N){if(N?.code!=="ENOENT"&&!(N instanceof SyntaxError))X?.(N)}let K=await Z(z);try{await U$($,{...Y??{},version:F$,type:"oauth_token",access_token:K.token,expires_at:K.expiresAt})}catch(N){X?.(N)}return K}}var C5=M(()=>{q$();V0();mZ();M8();V5();U5();O5()});class xZ{constructor(){e.set(this,void 0),ZZ.set(this,void 0),F(this,e,new Uint8Array,"f"),F(this,ZZ,null,"f")}decode(Z){if(Z==null)return[];let $=Z instanceof ArrayBuffer?new Uint8Array(Z):typeof Z==="string"?cZ(Z):Z;F(this,e,X5([G(this,e,"f"),$]),"f");let X=[],J;while((J=h1(G(this,e,"f"),G(this,ZZ,"f")))!=null){if(J.carriage&&G(this,ZZ,"f")==null){F(this,ZZ,J.index,"f");continue}if(G(this,ZZ,"f")!=null&&(J.index!==G(this,ZZ,"f")+1||J.carriage)){X.push(G0(G(this,e,"f").subarray(0,G(this,ZZ,"f")-1))),F(this,e,G(this,e,"f").subarray(G(this,ZZ,"f")),"f"),F(this,ZZ,null,"f");continue}let z=G(this,ZZ,"f")!==null?J.preceding-1:J.preceding,Q=G0(G(this,e,"f").subarray(0,z));X.push(Q),F(this,e,G(this,e,"f").subarray(J.index),"f"),F(this,ZZ,null,"f")}return X}flush(){if(!G(this,e,"f").length)return[];return this.decode(`
2
+ `)}}function h1(Z,$){for(let z=$??0;z<Z.length;z++){if(Z[z]===10)return{preceding:z,index:z+1,carriage:!1};if(Z[z]===13)return{preceding:z,index:z+1,carriage:!0}}return null}function F5(Z){for(let J=0;J<Z.length-1;J++){if(Z[J]===10&&Z[J+1]===10)return J+2;if(Z[J]===13&&Z[J+1]===13)return J+2;if(Z[J]===13&&Z[J+1]===10&&J+3<Z.length&&Z[J+2]===13&&Z[J+3]===10)return J+4}return-1}var e,ZZ;var q0=M(()=>{UZ();O$();e=new WeakMap,ZZ=new WeakMap;xZ.NEWLINE_CHARS=new Set([`
3
+ `,"\r"]);xZ.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*v1(Z,$){if(!Z.body){if($.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new x("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new x("Attempted to iterate over a response with no body")}let X=new x5,J=new xZ,z=O8(Z.body);for await(let Q of g1(z))for(let Y of J.decode(Q)){let K=X.decode(Y);if(K)yield K}for(let Q of J.flush()){let Y=X.decode(Q);if(Y)yield Y}}async function*g1(Z){let $=new Uint8Array;for await(let X of Z){if(X==null)continue;let J=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?cZ(X):X,z=new Uint8Array($.length+J.length);z.set($),z.set(J,$.length),$=z;let Q;while((Q=F5($))!==-1)yield $.slice(0,Q),$=$.slice(Q)}if($.length>0)yield $}class x5{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(Z){if(Z.endsWith("\r"))Z=Z.substring(0,Z.length-1);if(!Z){if(!this.event&&!this.data.length)return null;let z={event:this.event,data:this.data.join(`
4
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],z}if(this.chunks.push(Z),Z.startsWith(":"))return null;let[$,X,J]=m1(Z,":");if(J.startsWith(" "))J=J.substring(1);if($==="event")this.event=J;else if($==="data")this.data.push(J);return null}}function m1(Z,$){let X=Z.indexOf($);if(X!==-1)return[Z.substring(0,X),$,Z.substring(X+$.length)];return[Z,"",""]}var x8,$Z;var O0=M(()=>{UZ();r();vZ();q0();vZ();hZ();VZ();O$();F8();r();$Z=class $Z{constructor(Z,$,X){this.iterator=Z,x8.set(this,void 0),this.controller=$,F(this,x8,X,"f")}static fromSSEResponse(Z,$,X){let J=!1,z=X?m(X):console;async function*Q(){if(J)throw new x("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");J=!0;let Y=!1;try{for await(let K of v1(Z,$)){if(K.event==="completion")try{yield JSON.parse(K.data)}catch(N){throw z.error("Could not parse message into JSON:",K.data),z.error("From chunk:",K.raw),N}if(K.event==="message_start"||K.event==="message_delta"||K.event==="message_stop"||K.event==="content_block_start"||K.event==="content_block_delta"||K.event==="content_block_stop"||K.event==="message"||K.event==="user.message"||K.event==="user.interrupt"||K.event==="user.tool_confirmation"||K.event==="user.custom_tool_result"||K.event==="agent.message"||K.event==="agent.thinking"||K.event==="agent.tool_use"||K.event==="agent.tool_result"||K.event==="agent.mcp_tool_use"||K.event==="agent.mcp_tool_result"||K.event==="agent.custom_tool_use"||K.event==="agent.thread_context_compacted"||K.event==="session.status_running"||K.event==="session.status_idle"||K.event==="session.status_rescheduled"||K.event==="session.status_terminated"||K.event==="session.error"||K.event==="session.deleted"||K.event==="span.model_request_start"||K.event==="span.model_request_end"||K.event==="span.outcome_evaluation_start"||K.event==="span.outcome_evaluation_ongoing"||K.event==="span.outcome_evaluation_end"||K.event==="user.define_outcome"||K.event==="agent.thread_message_received"||K.event==="agent.thread_message_sent"||K.event==="agent.session_thread_message_received"||K.event==="agent.session_thread_message_sent"||K.event==="session.thread_created"||K.event==="session.thread_status_created"||K.event==="session.thread_status_running"||K.event==="session.thread_status_idle"||K.event==="session.thread_status_rescheduled"||K.event==="session.thread_status_terminated")try{yield JSON.parse(K.data)}catch(N){throw z.error("Could not parse message into JSON:",K.data),z.error("From chunk:",K.raw),N}if(K.event==="ping")continue;if(K.event==="error"){let N=Q$(K.data)??K.data,q=N?.error?.type;throw new l(void 0,N,void 0,Z.headers,q)}}Y=!0}catch(K){if(qZ(K))return;throw K}finally{if(!Y)$.abort()}}return new $Z(Q,$,X)}static fromReadableStream(Z,$,X){let J=!1;async function*z(){let Y=new xZ,K=O8(Z);for await(let N of K)for(let q of Y.decode(N))yield q;for(let N of Y.flush())yield N}async function*Q(){if(J)throw new x("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");J=!0;let Y=!1;try{for await(let K of z()){if(Y)continue;if(K)yield JSON.parse(K)}Y=!0}catch(K){if(qZ(K))return;throw K}finally{if(!Y)$.abort()}}return new $Z(Q,$,X)}[(x8=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let Z=[],$=[],X=this.iterator(),J=(z)=>{return{next:()=>{if(z.length===0){let Q=X.next();Z.push(Q),$.push(Q)}return z.shift()}}};return[new $Z(()=>J(Z),this.controller,G(this,x8,"f")),new $Z(()=>J($),this.controller,G(this,x8,"f"))]}toReadableStream(){let Z=this,$;return t$({async start(){$=Z[Symbol.asyncIterator]()},async pull(X){try{let{value:J,done:z}=await $.next();if(z)return X.close();let Q=cZ(JSON.stringify(J)+`
5
+ `);X.enqueue(Q)}catch(J){X.error(J)}},async cancel(){await $.return?.()}})}}});async function x$(Z,$){let{response:X,requestLogID:J,retryOfRequestLogID:z,startTime:Q}=$,Y=await(async()=>{if($.options.stream){if(m(Z).debug("response",X.status,X.url,X.headers,X.body),$.options.__streamClass)return $.options.__streamClass.fromSSEResponse(X,$.controller);return $Z.fromSSEResponse(X,$.controller)}if(X.status===204)return null;if($.options.__binaryResponse)return X;let N=X.headers.get("content-type")?.split(";")[0]?.trim();if(N?.includes("application/json")||N?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let w=await X.json();return M0(w,X)}return await X.text()})();return m(Z).debug(`[${J}] response parsed`,OZ({retryOfRequestLogID:z,url:X.url,status:X.status,body:Y,durationMs:Date.now()-Q})),Y}function M0(Z,$){if(!Z||typeof Z!=="object"||Array.isArray(Z))return Z;return Object.defineProperty(Z,"_request_id",{value:$.headers.get("request-id"),enumerable:!1})}var C0=M(()=>{O0();F8()});var H8,PZ;var H$=M(()=>{UZ();C0();PZ=class PZ extends Promise{constructor(Z,$,X=x$){super((J)=>{J(null)});this.responsePromise=$,this.parseResponse=X,H8.set(this,void 0),F(this,H8,Z,"f")}_thenUnwrap(Z){return new PZ(G(this,H8,"f"),this.responsePromise,async($,X)=>M0(Z(await this.parseResponse($,X),X),X.response))}asResponse(){return this.responsePromise.then((Z)=>Z.response)}async withResponse(){let[Z,$]=await Promise.all([this.parse(),this.asResponse()]);return{data:Z,response:$,request_id:$.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((Z)=>this.parseResponse(G(this,H8,"f"),Z));return this.parsedPromise}then(Z,$){return this.parse().then(Z,$)}catch(Z){return this.parse().catch(Z)}finally(Z){return this.parse().finally(Z)}};H8=new WeakMap});var T$,F0,B$,WZ,L;var _=M(()=>{UZ();r();C0();H$();VZ();F0=class F0{constructor(Z,$,X,J){T$.set(this,void 0),F(this,T$,Z,"f"),this.options=J,this.response=$,this.body=X}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let Z=this.nextPageRequestOptions();if(!Z)throw new x("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await G(this,T$,"f").requestAPIList(this.constructor,Z)}async*iterPages(){let Z=this;yield Z;while(Z.hasNextPage())Z=await Z.getNextPage(),yield Z}async*[(T$=new WeakMap,Symbol.asyncIterator)](){for await(let Z of this.iterPages())for(let $ of Z.getPaginatedItems())yield $}};B$=class B$ extends PZ{constructor(Z,$,X){super(Z,$,async(J,z)=>new X(J,z.response,await x$(J,z),z.options))}async*[Symbol.asyncIterator](){let Z=await this;for await(let $ of Z)yield $}};WZ=class WZ extends F0{constructor(Z,$,X,J){super(Z,$,X,J);this.data=X.data||[],this.has_more=X.has_more||!1,this.first_id=X.first_id||null,this.last_id=X.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let $=this.first_id;if(!$)return null;return{...this.options,query:{...z$(this.options.query),before_id:$}}}let Z=this.last_id;if(!Z)return null;return{...this.options,query:{...z$(this.options.query),after_id:Z}}}};L=class L extends F0{constructor(Z,$,X,J){super(Z,$,X,J);this.data=X.data||[],this.next_page=X.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let Z=this.next_page;if(!Z)return null;return{...this.options,query:{...z$(this.options.query),page:Z}}}}});function RZ(Z,$,X){return H0(),new File(Z,$??"unknown_file",X)}function T8(Z,$){let X=typeof Z==="object"&&Z!==null&&(("name"in Z)&&Z.name&&String(Z.name)||("url"in Z)&&Z.url&&String(Z.url)||("filename"in Z)&&Z.filename&&String(Z.filename)||("path"in Z)&&Z.path&&String(Z.path))||"";return $?X.split(/[\\/]/).pop()||void 0:X}function d1(Z){let $=typeof Z==="function"?Z:Z.fetch,X=H5.get($);if(X)return X;let J=(async()=>{try{let z="Response"in $?$.Response:(await $("data:,")).constructor,Q=new FormData;if(Q.toString()===await new z(Q).text())return!1;return!0}catch{return!0}})();return H5.set($,J),J}var H0=()=>{if(typeof File>"u"){let{process:Z}=globalThis,$=typeof Z?.versions?.node==="string"&&parseInt(Z.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+($?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},T0=(Z)=>Z!=null&&typeof Z==="object"&&typeof Z[Symbol.asyncIterator]==="function",dZ=async(Z,$,X=!0)=>{return{...Z,body:await u1(Z.body,$,X)}},H5,u1=async(Z,$,X=!0)=>{if(!await d1($))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let J=new FormData;return await Promise.all(Object.entries(Z||{}).map(([z,Q])=>x0(J,z,Q,X))),J},l1=(Z)=>Z instanceof Blob&&("name"in Z),x0=async(Z,$,X,J)=>{if(X===void 0)return;if(X==null)throw TypeError(`Received null for "${$}"; to pass null in FormData, you must use the string 'null'`);if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")Z.append($,String(X));else if(X instanceof Response){let z={},Q=X.headers.get("Content-Type");if(Q)z={type:Q};Z.append($,RZ([await X.blob()],T8(X,J),z))}else if(T0(X))Z.append($,RZ([await new Response(Y$(X)).blob()],T8(X,J)));else if(l1(X))Z.append($,RZ([X],T8(X,J),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((z)=>x0(Z,$+"[]",z,J)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([z,Q])=>x0(Z,`${$}[${z}]`,Q,J)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${X} instead`)};var uZ=M(()=>{vZ();H5=new WeakMap});async function S$(Z,$,X){if(H0(),Z=await Z,$||($=T8(Z,!0)),p1(Z)){if(Z instanceof File&&$==null&&X==null)return Z;return RZ([await Z.arrayBuffer()],$??Z.name,{type:Z.type,lastModified:Z.lastModified,...X})}if(i1(Z)){let z=await Z.blob();return $||($=new URL(Z.url).pathname.split(/[\\/]/).pop()),RZ(await B0(z),$,X)}let J=await B0(Z);if(!X?.type){let z=J.find((Q)=>typeof Q==="object"&&("type"in Q)&&Q.type);if(typeof z==="string")X={...X,type:z}}return RZ(J,$,X)}async function B0(Z){let $=[];if(typeof Z==="string"||ArrayBuffer.isView(Z)||Z instanceof ArrayBuffer)$.push(Z);else if(T5(Z))$.push(Z instanceof Blob?Z:await Z.arrayBuffer());else if(T0(Z))for await(let X of Z)$.push(...await B0(X));else{let X=Z?.constructor?.name;throw Error(`Unexpected data type: ${typeof Z}${X?`; constructor: ${X}`:""}${n1(Z)}`)}return $}function n1(Z){if(typeof Z!=="object"||Z===null)return"";return`; props: [${Object.getOwnPropertyNames(Z).map((X)=>`"${X}"`).join(", ")}]`}var T5=(Z)=>Z!=null&&typeof Z==="object"&&typeof Z.size==="number"&&typeof Z.type==="string"&&typeof Z.text==="function"&&typeof Z.slice==="function"&&typeof Z.arrayBuffer==="function",p1=(Z)=>Z!=null&&typeof Z==="object"&&typeof Z.name==="string"&&typeof Z.lastModified==="number"&&T5(Z),i1=(Z)=>Z!=null&&typeof Z==="object"&&typeof Z.url==="string"&&typeof Z.blob==="function";var B5=M(()=>{uZ();uZ()});var S0=M(()=>{B5()});var S5=()=>{};class S{constructor(Z){this._client=Z}}var R=()=>{};function*r1(Z){if(!Z)return;if(A5 in Z){let{values:J,nulls:z}=Z;yield*J.entries();for(let Q of z)yield[Q,null];return}let $=!1,X;if(Z instanceof Headers)X=Z.entries();else if(a$(Z))X=Z;else $=!0,X=Object.entries(Z??{});for(let J of X){let z=J[0];if(typeof z!=="string")throw TypeError("expected header name to be a string");let Q=a$(J[1])?J[1]:[J[1]],Y=!1;for(let K of Q){if(K===void 0)continue;if($&&!Y)Y=!0,yield[z,null];yield[z,K]}}}var A5,W=(Z)=>{let $=new Headers,X=new Set;for(let J of Z){let z=new Set;for(let[Q,Y]of r1(J)){let K=Q.toLowerCase();if(!z.has(K))$.delete(Q),z.add(K);if(Y===null)$.delete(Q),X.add(K);else $.append(Q,Y),X.delete(K)}}return{[A5]:!0,values:$,nulls:X}};var I=M(()=>{VZ();A5=Symbol.for("brand.privateNullableHeaders")});function L5(Z){return Z.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var D5,o1=(Z=L5)=>function(X,...J){if(X.length===1)return X[0];let z=!1,Q=[],Y=X.reduce((C,V,w)=>{if(/[?#]/.test(V))z=!0;let O=J[w],H=(z?encodeURIComponent:Z)(""+O);if(w!==J.length&&(O==null||typeof O==="object"&&O.toString===Object.getPrototypeOf(Object.getPrototypeOf(O.hasOwnProperty??D5)??D5)?.toString))H=O+"",Q.push({start:C.length+V.length,length:H.length,error:`Value of type ${Object.prototype.toString.call(O).slice(8,-1)} is not a valid path parameter`});return C+V+(w===J.length?"":H)},""),K=Y.split(/[?#]/,1)[0],N=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,q;while((q=N.exec(K))!==null)Q.push({start:q.index,length:q[0].length,error:`Value "${q[0]}" can't be safely passed as a path parameter`});if(Q.sort((C,V)=>C.start-V.start),Q.length>0){let C=0,V=Q.reduce((w,O)=>{let H=" ".repeat(O.start-C),D="^".repeat(O.length);return C=O.start+O.length,w+H+D},"");throw new x(`Path parameters result in path with invalid segments:
6
+ ${Q.map((w)=>w.error).join(`
7
+ `)}
8
+ ${Y}
9
+ ${V}`)}return Y},U;var h=M(()=>{r();D5=Object.freeze(Object.create(null)),U=o1(L5)});var B8;var A0=M(()=>{R();_();I();h();B8=class B8 extends S{create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/environments?beta=true",{body:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/environments/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/environments/${Z}?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/environments?beta=true",L,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}delete(Z,$={},X){let{betas:J}=$??{};return this._client.delete(U`/v1/environments/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive(Z,$={},X){let{betas:J}=$??{};return this._client.post(U`/v1/environments/${Z}/archive?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});function A$(Z){return typeof Z==="object"&&Z!==null&&S8 in Z}function D0(Z,$){let X=new Set;if(Z){for(let J of Z)if(A$(J))X.add(J[S8])}if($)for(let J of $){if(A$(J))X.add(J[S8]);if(Array.isArray(J.content)){for(let z of J.content)if(A$(z))X.add(z[S8])}}return Array.from(X)}function D$(Z,$){let X=D0(Z,$);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function E5(Z){if(A$(Z))return{"x-stainless-helper":Z[S8]};return{}}var S8;var A8=M(()=>{S8=Symbol("anthropic.sdk.stainlessHelper")});var D8;var L0=M(()=>{R();_();I();A8();uZ();h();D8=class D8 extends S{list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/files?beta=true",WZ,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},$?.headers])})}delete(Z,$={},X){let{betas:J}=$??{};return this._client.delete(U`/v1/files/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"files-api-2025-04-14"].toString()},X?.headers])})}download(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/files/${Z}/content?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},X?.headers]),__binaryResponse:!0})}retrieveMetadata(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/files/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"files-api-2025-04-14"].toString()},X?.headers])})}upload(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/files?beta=true",dZ({body:J,...$,headers:W([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},E5(J.file),$?.headers])},this._client))}}});var L8;var E0=M(()=>{R();_();I();h();L8=class L8 extends S{retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/models/${Z}?beta=true`,{...X,headers:W([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/models?beta=true",WZ,{query:J,...$,headers:W([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},$?.headers])})}}});var E8;var j0=M(()=>{R();_();I();h();E8=class E8 extends S{create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/user_profiles?beta=true",{body:J,...$,headers:W([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},$?.headers])})}retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/user_profiles/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}update(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/user_profiles/${Z}?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/user_profiles?beta=true",L,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"user-profiles-2026-03-24"].toString()},$?.headers])})}createEnrollmentURL(Z,$={},X){let{betas:J}=$??{};return this._client.post(U`/v1/user_profiles/${Z}/enrollment_url?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"user-profiles-2026-03-24"].toString()},X?.headers])})}}});var I5=L$((P5)=>{Object.defineProperty(P5,"__esModule",{value:!0});P5.timingSafeEqual=void 0;function j5(Z,$=""){if(!Z)throw Error($)}function $6(Z,$){if(Z.byteLength!==$.byteLength)return!1;if(!(Z instanceof DataView))Z=new DataView(ArrayBuffer.isView(Z)?Z.buffer:Z);if(!($ instanceof DataView))$=new DataView(ArrayBuffer.isView($)?$.buffer:$);j5(Z instanceof DataView),j5($ instanceof DataView);let X=Z.byteLength,J=0,z=-1;while(++z<X)J|=Z.getUint8(z)^$.getUint8(z);return J===0}P5.timingSafeEqual=$6});var _5=L$((XZ)=>{var X6=XZ&&XZ.__extends||function(){var Z=function($,X){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,z){J.__proto__=z}||function(J,z){for(var Q in z)if(z.hasOwnProperty(Q))J[Q]=z[Q]},Z($,X)};return function($,X){Z($,X);function J(){this.constructor=$}$.prototype=X===null?Object.create(X):(J.prototype=X.prototype,new J)}}();Object.defineProperty(XZ,"__esModule",{value:!0});var d=256,P0=function(){function Z($){if($===void 0)$="=";this._paddingCharacter=$}return Z.prototype.encodedLength=function($){if(!this._paddingCharacter)return($*8+5)/6|0;return($+2)/3*4|0},Z.prototype.encode=function($){var X="",J=0;for(;J<$.length-2;J+=3){var z=$[J]<<16|$[J+1]<<8|$[J+2];X+=this._encodeByte(z>>>18&63),X+=this._encodeByte(z>>>12&63),X+=this._encodeByte(z>>>6&63),X+=this._encodeByte(z>>>0&63)}var Q=$.length-J;if(Q>0){var z=$[J]<<16|(Q===2?$[J+1]<<8:0);if(X+=this._encodeByte(z>>>18&63),X+=this._encodeByte(z>>>12&63),Q===2)X+=this._encodeByte(z>>>6&63);else X+=this._paddingCharacter||"";X+=this._paddingCharacter||""}return X},Z.prototype.maxDecodedLength=function($){if(!this._paddingCharacter)return($*6+7)/8|0;return $/4*3|0},Z.prototype.decodedLength=function($){return this.maxDecodedLength($.length-this._getPaddingLength($))},Z.prototype.decode=function($){if($.length===0)return new Uint8Array(0);var X=this._getPaddingLength($),J=$.length-X,z=new Uint8Array(this.maxDecodedLength(J)),Q=0,Y=0,K=0,N=0,q=0,C=0,V=0;for(;Y<J-4;Y+=4)N=this._decodeChar($.charCodeAt(Y+0)),q=this._decodeChar($.charCodeAt(Y+1)),C=this._decodeChar($.charCodeAt(Y+2)),V=this._decodeChar($.charCodeAt(Y+3)),z[Q++]=N<<2|q>>>4,z[Q++]=q<<4|C>>>2,z[Q++]=C<<6|V,K|=N&d,K|=q&d,K|=C&d,K|=V&d;if(Y<J-1)N=this._decodeChar($.charCodeAt(Y)),q=this._decodeChar($.charCodeAt(Y+1)),z[Q++]=N<<2|q>>>4,K|=N&d,K|=q&d;if(Y<J-2)C=this._decodeChar($.charCodeAt(Y+2)),z[Q++]=q<<4|C>>>2,K|=C&d;if(Y<J-3)V=this._decodeChar($.charCodeAt(Y+3)),z[Q++]=C<<6|V,K|=V&d;if(K!==0)throw Error("Base64Coder: incorrect characters for decoding");return z},Z.prototype._encodeByte=function($){var X=$;return X+=65,X+=25-$>>>8&6,X+=51-$>>>8&-75,X+=61-$>>>8&-15,X+=62-$>>>8&3,String.fromCharCode(X)},Z.prototype._decodeChar=function($){var X=d;return X+=(42-$&$-44)>>>8&-d+$-43+62,X+=(46-$&$-48)>>>8&-d+$-47+63,X+=(47-$&$-58)>>>8&-d+$-48+52,X+=(64-$&$-91)>>>8&-d+$-65+0,X+=(96-$&$-123)>>>8&-d+$-97+26,X},Z.prototype._getPaddingLength=function($){var X=0;if(this._paddingCharacter){for(var J=$.length-1;J>=0;J--){if($[J]!==this._paddingCharacter)break;X++}if($.length<4||X>2)throw Error("Base64Coder: incorrect padding")}return X},Z}();XZ.Coder=P0;var j8=new P0;function J6(Z){return j8.encode(Z)}XZ.encode=J6;function z6(Z){return j8.decode(Z)}XZ.decode=z6;var k5=function(Z){X6($,Z);function $(){return Z!==null&&Z.apply(this,arguments)||this}return $.prototype._encodeByte=function(X){var J=X;return J+=65,J+=25-X>>>8&6,J+=51-X>>>8&-75,J+=61-X>>>8&-13,J+=62-X>>>8&49,String.fromCharCode(J)},$.prototype._decodeChar=function(X){var J=d;return J+=(44-X&X-46)>>>8&-d+X-45+62,J+=(94-X&X-96)>>>8&-d+X-95+63,J+=(47-X&X-58)>>>8&-d+X-48+52,J+=(64-X&X-91)>>>8&-d+X-65+0,J+=(96-X&X-123)>>>8&-d+X-97+26,J},$}(P0);XZ.URLSafeCoder=k5;var y5=new k5;function Q6(Z){return y5.encode(Z)}XZ.encodeURLSafe=Q6;function K6(Z){return y5.decode(Z)}XZ.decodeURLSafe=K6;XZ.encodedLength=function(Z){return j8.encodedLength(Z)};XZ.maxDecodedLength=function(Z){return j8.maxDecodedLength(Z)};XZ.decodedLength=function(Z){return j8.decodedLength(Z)}});var b5=L$((f5,E$)=>{(function(Z,$){var X={};$(X);var J=X.default;for(var z in X)J[z]=X[z];if(typeof E$==="object"&&typeof E$.exports==="object")E$.exports=J;else if(typeof define==="function"&&define.amd)define(function(){return J});else Z.sha256=J})(f5,function(Z){Z.__esModule=!0,Z.digestLength=32,Z.blockSize=64;var $=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function X(V,w,O,H,D){var B,A,T,f,k,P,u,y,c,b,g,zZ,LZ;while(D>=64){B=w[0],A=w[1],T=w[2],f=w[3],k=w[4],P=w[5],u=w[6],y=w[7];for(b=0;b<16;b++)g=H+b*4,V[b]=(O[g]&255)<<24|(O[g+1]&255)<<16|(O[g+2]&255)<<8|O[g+3]&255;for(b=16;b<64;b++)c=V[b-2],zZ=(c>>>17|c<<15)^(c>>>19|c<<13)^c>>>10,c=V[b-15],LZ=(c>>>7|c<<25)^(c>>>18|c<<14)^c>>>3,V[b]=(zZ+V[b-7]|0)+(LZ+V[b-16]|0);for(b=0;b<64;b++)zZ=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&P^~k&u)|0)+(y+($[b]+V[b]|0)|0)|0,LZ=((B>>>2|B<<30)^(B>>>13|B<<19)^(B>>>22|B<<10))+(B&A^B&T^A&T)|0,y=u,u=P,P=k,k=f+zZ|0,f=T,T=A,A=B,B=zZ+LZ|0;w[0]+=B,w[1]+=A,w[2]+=T,w[3]+=f,w[4]+=k,w[5]+=P,w[6]+=u,w[7]+=y,H+=64,D-=64}return H}var J=function(){function V(){this.digestLength=Z.digestLength,this.blockSize=Z.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return V.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},V.prototype.clean=function(){for(var w=0;w<this.buffer.length;w++)this.buffer[w]=0;for(var w=0;w<this.temp.length;w++)this.temp[w]=0;this.reset()},V.prototype.update=function(w,O){if(O===void 0)O=w.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var H=0;if(this.bytesHashed+=O,this.bufferLength>0){while(this.bufferLength<64&&O>0)this.buffer[this.bufferLength++]=w[H++],O--;if(this.bufferLength===64)X(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(O>=64)H=X(this.temp,this.state,w,H,O),O%=64;while(O>0)this.buffer[this.bufferLength++]=w[H++],O--;return this},V.prototype.finish=function(w){if(!this.finished){var O=this.bytesHashed,H=this.bufferLength,D=O/536870912|0,B=O<<3,A=O%64<56?64:128;this.buffer[H]=128;for(var T=H+1;T<A-8;T++)this.buffer[T]=0;this.buffer[A-8]=D>>>24&255,this.buffer[A-7]=D>>>16&255,this.buffer[A-6]=D>>>8&255,this.buffer[A-5]=D>>>0&255,this.buffer[A-4]=B>>>24&255,this.buffer[A-3]=B>>>16&255,this.buffer[A-2]=B>>>8&255,this.buffer[A-1]=B>>>0&255,X(this.temp,this.state,this.buffer,0,A),this.finished=!0}for(var T=0;T<8;T++)w[T*4+0]=this.state[T]>>>24&255,w[T*4+1]=this.state[T]>>>16&255,w[T*4+2]=this.state[T]>>>8&255,w[T*4+3]=this.state[T]>>>0&255;return this},V.prototype.digest=function(){var w=new Uint8Array(this.digestLength);return this.finish(w),w},V.prototype._saveState=function(w){for(var O=0;O<this.state.length;O++)w[O]=this.state[O]},V.prototype._restoreState=function(w,O){for(var H=0;H<this.state.length;H++)this.state[H]=w[H];this.bytesHashed=O,this.finished=!1,this.bufferLength=0},V}();Z.Hash=J;var z=function(){function V(w){this.inner=new J,this.outer=new J,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var O=new Uint8Array(this.blockSize);if(w.length>this.blockSize)new J().update(w).finish(O).clean();else for(var H=0;H<w.length;H++)O[H]=w[H];for(var H=0;H<O.length;H++)O[H]^=54;this.inner.update(O);for(var H=0;H<O.length;H++)O[H]^=106;this.outer.update(O),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var H=0;H<O.length;H++)O[H]=0}return V.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},V.prototype.clean=function(){for(var w=0;w<this.istate.length;w++)this.ostate[w]=this.istate[w]=0;this.inner.clean(),this.outer.clean()},V.prototype.update=function(w){return this.inner.update(w),this},V.prototype.finish=function(w){if(this.outer.finished)this.outer.finish(w);else this.inner.finish(w),this.outer.update(w,this.digestLength).finish(w);return this},V.prototype.digest=function(){var w=new Uint8Array(this.digestLength);return this.finish(w),w},V}();Z.HMAC=z;function Q(V){var w=new J().update(V),O=w.digest();return w.clean(),O}Z.hash=Q,Z.default=Q;function Y(V,w){var O=new z(V).update(w),H=O.digest();return O.clean(),H}Z.hmac=Y;function K(V,w,O,H){var D=H[0];if(D===0)throw Error("hkdf: cannot expand more");if(w.reset(),D>1)w.update(V);if(O)w.update(O);w.update(H),w.finish(V),H[0]++}var N=new Uint8Array(Z.digestLength);function q(V,w,O,H){if(w===void 0)w=N;if(H===void 0)H=32;var D=new Uint8Array([1]),B=Y(w,V),A=new z(B),T=new Uint8Array(A.digestLength),f=T.length,k=new Uint8Array(H);for(var P=0;P<H;P++){if(f===T.length)K(T,A,O,D),f=0;k[P]=T[f++]}return A.clean(),T.fill(0),D.fill(0),k}Z.hkdf=q;function C(V,w,O,H){var D=new z(V),B=D.digestLength,A=new Uint8Array(4),T=new Uint8Array(B),f=new Uint8Array(B),k=new Uint8Array(H);for(var P=0;P*B<H;P++){var u=P+1;A[0]=u>>>24&255,A[1]=u>>>16&255,A[2]=u>>>8&255,A[3]=u>>>0&255,D.reset(),D.update(w),D.update(A),D.finish(f);for(var y=0;y<B;y++)T[y]=f[y];for(var y=2;y<=O;y++){D.reset(),D.update(f).finish(f);for(var c=0;c<B;c++)T[c]^=f[c]}for(var y=0;y<B&&P*B+y<H;y++)k[P*B+y]=T[y]}for(var P=0;P<B;P++)T[P]=f[P]=0;for(var P=0;P<4;P++)A[P]=0;return D.clean(),k}Z.pbkdf2=C})});var c5=L$((g5)=>{Object.defineProperty(g5,"__esModule",{value:!0});g5.Webhook=g5.WebhookVerificationError=void 0;var Y6=I5(),h5=_5(),G6=b5(),v5=300;class R0 extends Error{constructor(Z){super(Z);Object.setPrototypeOf(this,R0.prototype),this.name="ExtendableError",this.stack=Error(Z).stack}}class HZ extends R0{constructor(Z){super(Z);Object.setPrototypeOf(this,HZ.prototype),this.name="WebhookVerificationError"}}g5.WebhookVerificationError=HZ;class P8{constructor(Z,$){if(!Z)throw Error("Secret can't be empty.");if(($===null||$===void 0?void 0:$.format)==="raw")if(Z instanceof Uint8Array)this.key=Z;else this.key=Uint8Array.from(Z,(X)=>X.charCodeAt(0));else{if(typeof Z!=="string")throw Error("Expected secret to be of type string");if(Z.startsWith(P8.prefix))Z=Z.substring(P8.prefix.length);this.key=h5.decode(Z)}}verify(Z,$){let X={};for(let V of Object.keys($))X[V.toLowerCase()]=$[V];let J=X["webhook-id"],z=X["webhook-signature"],Q=X["webhook-timestamp"];if(!z||!J||!Q)throw new HZ("Missing required headers");let Y=this.verifyTimestamp(Q),N=this.sign(J,Y,Z).split(",")[1],q=z.split(" "),C=new globalThis.TextEncoder;for(let V of q){let[w,O]=V.split(",");if(w!=="v1")continue;if((0,Y6.timingSafeEqual)(C.encode(O),C.encode(N)))return JSON.parse(Z.toString())}throw new HZ("No matching signature found")}sign(Z,$,X){if(typeof X==="string");else if(X.constructor.name==="Buffer")X=X.toString();else throw Error("Expected payload to be of type string or Buffer.");let J=new TextEncoder,z=Math.floor($.getTime()/1000),Q=J.encode(`${Z}.${z}.${X}`);return`v1,${h5.encode(G6.hmac(this.key,Q))}`}verifyTimestamp(Z){let $=Math.floor(Date.now()/1000),X=parseInt(Z,10);if(isNaN(X))throw new HZ("Invalid Signature Headers");if($-X>v5)throw new HZ("Message timestamp too old");if(X>$+v5)throw new HZ("Message timestamp too new");return new Date(X*1000)}}g5.Webhook=P8;P8.prefix="whsec_"});var d5,R8;var I0=M(()=>{R();d5=W6(c5(),1);R8=class R8 extends S{unwrap(Z,{headers:$,key:X}){if($!==void 0){let J=X===void 0?this._client.webhookKey:X;if(J===null)throw Error("Webhook key must not be null in order to unwrap");new d5.Webhook(J).verify(Z,$)}return JSON.parse(Z)}}});var I8;var k0=M(()=>{R();_();I();h();I8=class I8 extends S{list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/agents/${Z}/versions?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var lZ;var y0=M(()=>{R();k0();k0();_();I();h();lZ=class lZ extends S{constructor(){super(...arguments);this.versions=new I8(this._client)}create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/agents?beta=true",{body:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}retrieve(Z,$={},X){let{betas:J,...z}=$??{};return this._client.get(U`/v1/agents/${Z}?beta=true`,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/agents/${Z}?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/agents?beta=true",L,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}archive(Z,$={},X){let{betas:J}=$??{};return this._client.post(U`/v1/agents/${Z}/archive?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};lZ.Versions=I8});var k8;var _0=M(()=>{R();_();I();h();k8=class k8 extends S{create(Z,$,X){let{view:J,betas:z,...Q}=$;return this._client.post(U`/v1/memory_stores/${Z}/memories?beta=true`,{query:{view:J},body:Q,...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve(Z,$,X){let{memory_store_id:J,betas:z,...Q}=$;return this._client.get(U`/v1/memory_stores/${J}/memories/${Z}?beta=true`,{query:Q,...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{memory_store_id:J,view:z,betas:Q,...Y}=$;return this._client.post(U`/v1/memory_stores/${J}/memories/${Z}?beta=true`,{query:{view:z},body:Y,...X,headers:W([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/memory_stores/${Z}/memories?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete(Z,$,X){let{memory_store_id:J,expected_content_sha256:z,betas:Q}=$;return this._client.delete(U`/v1/memory_stores/${J}/memories/${Z}?beta=true`,{query:{expected_content_sha256:z},...X,headers:W([{"anthropic-beta":[...Q??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var y8;var f0=M(()=>{R();_();I();h();y8=class y8 extends S{retrieve(Z,$,X){let{memory_store_id:J,betas:z,...Q}=$;return this._client.get(U`/v1/memory_stores/${J}/memory_versions/${Z}?beta=true`,{query:Q,...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/memory_stores/${Z}/memory_versions?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}redact(Z,$,X){let{memory_store_id:J,betas:z}=$;return this._client.post(U`/v1/memory_stores/${J}/memory_versions/${Z}/redact?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var IZ;var b0=M(()=>{R();_0();_0();f0();f0();_();I();h();IZ=class IZ extends S{constructor(){super(...arguments);this.memories=new k8(this._client),this.memoryVersions=new y8(this._client)}create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/memory_stores?beta=true",{body:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/memory_stores/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/memory_stores/${Z}?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/memory_stores?beta=true",L,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}delete(Z,$={},X){let{betas:J}=$??{};return this._client.delete(U`/v1/memory_stores/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive(Z,$={},X){let{betas:J}=$??{};return this._client.post(U`/v1/memory_stores/${Z}/archive?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};IZ.Memories=k8;IZ.MemoryVersions=y8});var pZ=M(()=>{r()});var iZ;var h0=M(()=>{r();vZ();q0();iZ=class iZ{constructor(Z,$){this.iterator=Z,this.controller=$}async*decoder(){let Z=new xZ;for await(let $ of this.iterator)for(let X of Z.decode($))yield JSON.parse(X);for(let $ of Z.flush())yield JSON.parse($)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(Z,$){if(!Z.body){if($.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new x("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new x("Attempted to iterate over a response with no body")}return new iZ(O8(Z.body),$)}}});var _8;var v0=M(()=>{R();_();I();h0();pZ();h();_8=class _8 extends S{create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/messages/batches?beta=true",{body:J,...$,headers:W([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},$?.headers])})}retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/messages/batches/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/messages/batches?beta=true",WZ,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},$?.headers])})}delete(Z,$={},X){let{betas:J}=$??{};return this._client.delete(U`/v1/messages/batches/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel(Z,$={},X){let{betas:J}=$??{};return this._client.post(U`/v1/messages/batches/${Z}/cancel?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString()},X?.headers])})}async results(Z,$={},X){let J=await this.retrieve(Z);if(!J.results_url)throw new x(`No batch \`results_url\`; Has it finished processing? ${J.processing_status} - ${J.id}`);let{betas:z}=$??{};return this._client.get(J.results_url,{...X,headers:W([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,Y)=>iZ.fromResponse(Y.response,Y.controller))}}});var j$;var g0=M(()=>{j$={"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 u5(Z){return Z?.output_format??Z?.output_config?.format}function m0(Z,$,X){let J=u5($);if(!$||!("parse"in(J??{})))return{...Z,content:Z.content.map((z)=>{if(z.type==="text"){let Q=Object.defineProperty({...z},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(Q,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return z}),parsed_output:null};return c0(Z,$,X)}function c0(Z,$,X){let J=null,z=Z.content.map((Q)=>{if(Q.type==="text"){let Y=F6($,Q.text);if(J===null)J=Y;let K=Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1});return Object.defineProperty(K,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),Y},enumerable:!1})}return Q});return{...Z,content:z,parsed_output:J}}function F6(Z,$){let X=u5(Z);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse($);return JSON.parse($)}catch(J){throw new x(`Failed to parse structured output: ${J}`)}}var d0=M(()=>{r()});var x6=(Z)=>{let $=0,X=[];while($<Z.length){let J=Z[$];if(J==="\\"){$++;continue}if(J==="{"){X.push({type:"brace",value:"{"}),$++;continue}if(J==="}"){X.push({type:"brace",value:"}"}),$++;continue}if(J==="["){X.push({type:"paren",value:"["}),$++;continue}if(J==="]"){X.push({type:"paren",value:"]"}),$++;continue}if(J===":"){X.push({type:"separator",value:":"}),$++;continue}if(J===","){X.push({type:"delimiter",value:","}),$++;continue}if(J==='"'){let K="",N=!1;J=Z[++$];while(J!=='"'){if($===Z.length){N=!0;break}if(J==="\\"){if($++,$===Z.length){N=!0;break}K+=J+Z[$],J=Z[++$]}else K+=J,J=Z[++$]}if(J=Z[++$],!N)X.push({type:"string",value:K});continue}if(J&&/\s/.test(J)){$++;continue}let Q=/[0-9]/;if(J&&Q.test(J)||J==="-"||J==="."){let K="";if(J==="-")K+=J,J=Z[++$];while(J&&Q.test(J)||J===".")K+=J,J=Z[++$];X.push({type:"number",value:K});continue}let Y=/[a-z]/i;if(J&&Y.test(J)){let K="";while(J&&Y.test(J)){if($===Z.length)break;K+=J,J=Z[++$]}if(K=="true"||K=="false"||K==="null")X.push({type:"name",value:K});else{$++;continue}continue}$++}return X},nZ=(Z)=>{if(Z.length===0)return Z;let $=Z[Z.length-1];switch($.type){case"separator":return Z=Z.slice(0,Z.length-1),nZ(Z);break;case"number":let X=$.value[$.value.length-1];if(X==="."||X==="-")return Z=Z.slice(0,Z.length-1),nZ(Z);case"string":let J=Z[Z.length-2];if(J?.type==="delimiter")return Z=Z.slice(0,Z.length-1),nZ(Z);else if(J?.type==="brace"&&J.value==="{")return Z=Z.slice(0,Z.length-1),nZ(Z);break;case"delimiter":return Z=Z.slice(0,Z.length-1),nZ(Z);break}return Z},H6=(Z)=>{let $=[];if(Z.map((X)=>{if(X.type==="brace")if(X.value==="{")$.push("}");else $.splice($.lastIndexOf("}"),1);if(X.type==="paren")if(X.value==="[")$.push("]");else $.splice($.lastIndexOf("]"),1)}),$.length>0)$.reverse().map((X)=>{if(X==="}")Z.push({type:"brace",value:"}"});else if(X==="]")Z.push({type:"paren",value:"]"})});return Z},T6=(Z)=>{let $="";return Z.map((X)=>{switch(X.type){case"string":$+='"'+X.value+'"';break;default:$+=X.value;break}}),$},P$=(Z)=>JSON.parse(T6(H6(nZ(x6(Z)))));var u0=()=>{};var l0=M(()=>{O0()});function n5(Z){return Z.type==="tool_use"||Z.type==="server_tool_use"||Z.type==="mcp_tool_use"}function a5(Z){}var YZ,TZ,aZ,f8,R$,b8,h8,I$,v8,MZ,g8,k$,y$,kZ,_$,f$,m8,p0,l5,b$,i0,n0,a0,p5,i5="__json_buf",c8;var r5=M(()=>{UZ();u0();pZ();hZ();l0();d0();c8=class c8{constructor(Z,$){YZ.add(this),this.messages=[],this.receivedMessages=[],TZ.set(this,void 0),aZ.set(this,null),this.controller=new AbortController,f8.set(this,void 0),R$.set(this,()=>{}),b8.set(this,()=>{}),h8.set(this,void 0),I$.set(this,()=>{}),v8.set(this,()=>{}),MZ.set(this,{}),g8.set(this,!1),k$.set(this,!1),y$.set(this,!1),kZ.set(this,!1),_$.set(this,void 0),f$.set(this,void 0),m8.set(this,void 0),b$.set(this,(X)=>{if(F(this,k$,!0,"f"),qZ(X))X=new n;if(X instanceof n)return F(this,y$,!0,"f"),this._emit("abort",X);if(X instanceof x)return this._emit("error",X);if(X instanceof Error){let J=new x(X.message);return J.cause=X,this._emit("error",J)}return this._emit("error",new x(String(X)))}),F(this,f8,new Promise((X,J)=>{F(this,R$,X,"f"),F(this,b8,J,"f")}),"f"),F(this,h8,new Promise((X,J)=>{F(this,I$,X,"f"),F(this,v8,J,"f")}),"f"),G(this,f8,"f").catch(()=>{}),G(this,h8,"f").catch(()=>{}),F(this,aZ,Z,"f"),F(this,m8,$?.logger??console,"f")}get response(){return G(this,_$,"f")}get request_id(){return G(this,f$,"f")}async withResponse(){F(this,kZ,!0,"f");let Z=await G(this,f8,"f");if(!Z)throw Error("Could not resolve a `Response` object");return{data:this,response:Z,request_id:Z.headers.get("request-id")}}static fromReadableStream(Z){let $=new c8(null);return $._run(()=>$._fromReadableStream(Z)),$}static createMessage(Z,$,X,{logger:J}={}){let z=new c8($,{logger:J});for(let Q of $.messages)z._addMessageParam(Q);return F(z,aZ,{...$,stream:!0},"f"),z._run(()=>z._createMessage(Z,{...$,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),z}_run(Z){Z().then(()=>{this._emitFinal(),this._emit("end")},G(this,b$,"f"))}_addMessageParam(Z){this.messages.push(Z)}_addMessage(Z,$=!0){if(this.receivedMessages.push(Z),$)this._emit("message",Z)}async _createMessage(Z,$,X){let J=X?.signal,z;if(J){if(J.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),J.addEventListener("abort",z)}try{G(this,YZ,"m",i0).call(this);let{response:Q,data:Y}=await Z.create({...$,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let K of Y)G(this,YZ,"m",n0).call(this,K);if(Y.controller.signal?.aborted)throw new n;G(this,YZ,"m",a0).call(this)}finally{if(J&&z)J.removeEventListener("abort",z)}}_connected(Z){if(this.ended)return;F(this,_$,Z,"f"),F(this,f$,Z?.headers.get("request-id"),"f"),G(this,R$,"f").call(this,Z),this._emit("connect")}get ended(){return G(this,g8,"f")}get errored(){return G(this,k$,"f")}get aborted(){return G(this,y$,"f")}abort(){this.controller.abort()}on(Z,$){return(G(this,MZ,"f")[Z]||(G(this,MZ,"f")[Z]=[])).push({listener:$}),this}off(Z,$){let X=G(this,MZ,"f")[Z];if(!X)return this;let J=X.findIndex((z)=>z.listener===$);if(J>=0)X.splice(J,1);return this}once(Z,$){return(G(this,MZ,"f")[Z]||(G(this,MZ,"f")[Z]=[])).push({listener:$,once:!0}),this}emitted(Z){return new Promise(($,X)=>{if(F(this,kZ,!0,"f"),Z!=="error")this.once("error",X);this.once(Z,$)})}async done(){F(this,kZ,!0,"f"),await G(this,h8,"f")}get currentMessage(){return G(this,TZ,"f")}async finalMessage(){return await this.done(),G(this,YZ,"m",p0).call(this)}async finalText(){return await this.done(),G(this,YZ,"m",l5).call(this)}_emit(Z,...$){if(G(this,g8,"f"))return;if(Z==="end")F(this,g8,!0,"f"),G(this,I$,"f").call(this);let X=G(this,MZ,"f")[Z];if(X)G(this,MZ,"f")[Z]=X.filter((J)=>!J.once),X.forEach(({listener:J})=>J(...$));if(Z==="abort"){let J=$[0];if(!G(this,kZ,"f")&&!X?.length)Promise.reject(J);G(this,b8,"f").call(this,J),G(this,v8,"f").call(this,J),this._emit("end");return}if(Z==="error"){let J=$[0];if(!G(this,kZ,"f")&&!X?.length)Promise.reject(J);G(this,b8,"f").call(this,J),G(this,v8,"f").call(this,J),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",G(this,YZ,"m",p0).call(this))}async _fromReadableStream(Z,$){let X=$?.signal,J;if(X){if(X.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),X.addEventListener("abort",J)}try{G(this,YZ,"m",i0).call(this),this._connected(null);let z=$Z.fromReadableStream(Z,this.controller);for await(let Q of z)G(this,YZ,"m",n0).call(this,Q);if(z.controller.signal?.aborted)throw new n;G(this,YZ,"m",a0).call(this)}finally{if(X&&J)X.removeEventListener("abort",J)}}[(TZ=new WeakMap,aZ=new WeakMap,f8=new WeakMap,R$=new WeakMap,b8=new WeakMap,h8=new WeakMap,I$=new WeakMap,v8=new WeakMap,MZ=new WeakMap,g8=new WeakMap,k$=new WeakMap,y$=new WeakMap,kZ=new WeakMap,_$=new WeakMap,f$=new WeakMap,m8=new WeakMap,b$=new WeakMap,YZ=new WeakSet,p0=function(){if(this.receivedMessages.length===0)throw new x("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},l5=function(){if(this.receivedMessages.length===0)throw new x("stream ended without producing a Message with role=assistant");let $=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if($.length===0)throw new x("stream ended without producing a content block with type=text");return $.join(" ")},i0=function(){if(this.ended)return;F(this,TZ,void 0,"f")},n0=function($){if(this.ended)return;let X=G(this,YZ,"m",p5).call(this,$);switch(this._emit("streamEvent",$,X),$.type){case"content_block_delta":{let J=X.content.at(-1);switch($.delta.type){case"text_delta":{if(J.type==="text")this._emit("text",$.delta.text,J.text||"");break}case"citations_delta":{if(J.type==="text")this._emit("citation",$.delta.citation,J.citations??[]);break}case"input_json_delta":{if(n5(J)&&J.input)this._emit("inputJson",$.delta.partial_json,J.input);break}case"thinking_delta":{if(J.type==="thinking")this._emit("thinking",$.delta.thinking,J.thinking);break}case"signature_delta":{if(J.type==="thinking")this._emit("signature",J.signature);break}case"compaction_delta":{if(J.type==="compaction"&&J.content)this._emit("compaction",J.content);break}default:a5($.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(m0(X,G(this,aZ,"f"),{logger:G(this,m8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{F(this,TZ,X,"f");break}case"content_block_start":case"message_delta":break}},a0=function(){if(this.ended)throw new x("stream has ended, this shouldn't happen");let $=G(this,TZ,"f");if(!$)throw new x("request ended without sending any chunks");return F(this,TZ,void 0,"f"),m0($,G(this,aZ,"f"),{logger:G(this,m8,"f")})},p5=function($){let X=G(this,TZ,"f");if($.type==="message_start"){if(X)throw new x(`Unexpected event order, got ${$.type} before receiving "message_stop"`);return $.message}if(!X)throw new x(`Unexpected event order, got ${$.type} before "message_start"`);switch($.type){case"message_stop":return X;case"message_delta":if(X.container=$.delta.container,X.stop_reason=$.delta.stop_reason,X.stop_sequence=$.delta.stop_sequence,X.usage.output_tokens=$.usage.output_tokens,X.context_management=$.context_management,$.usage.input_tokens!=null)X.usage.input_tokens=$.usage.input_tokens;if($.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=$.usage.cache_creation_input_tokens;if($.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.server_tool_use!=null)X.usage.server_tool_use=$.usage.server_tool_use;if($.usage.iterations!=null)X.usage.iterations=$.usage.iterations;return X;case"content_block_start":return X.content.push($.content_block),X;case"content_block_delta":{let J=X.content.at($.index);switch($.delta.type){case"text_delta":{if(J?.type==="text")X.content[$.index]={...J,text:(J.text||"")+$.delta.text};break}case"citations_delta":{if(J?.type==="text")X.content[$.index]={...J,citations:[...J.citations??[],$.delta.citation]};break}case"input_json_delta":{if(J&&n5(J)){let z=J[i5]||"";z+=$.delta.partial_json;let Q={...J};if(Object.defineProperty(Q,i5,{value:z,enumerable:!1,writable:!0}),z)try{Q.input=P$(z)}catch(Y){let K=new x(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Y}. JSON: ${z}`);G(this,b$,"f").call(this,K)}X.content[$.index]=Q}break}case"thinking_delta":{if(J?.type==="thinking")X.content[$.index]={...J,thinking:J.thinking+$.delta.thinking};break}case"signature_delta":{if(J?.type==="thinking")X.content[$.index]={...J,signature:$.delta.signature};break}case"compaction_delta":{if(J?.type==="compaction")X.content[$.index]={...J,content:(J.content||"")+$.delta.content};break}default:a5($.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let Z=[],$=[],X=!1;return this.on("streamEvent",(J)=>{let z=$.shift();if(z)z.resolve(J);else Z.push(J)}),this.on("end",()=>{X=!0;for(let J of $)J.resolve(void 0);$.length=0}),this.on("abort",(J)=>{X=!0;for(let z of $)z.reject(J);$.length=0}),this.on("error",(J)=>{X=!0;for(let z of $)z.reject(J);$.length=0}),{next:async()=>{if(!Z.length){if(X)return{value:void 0,done:!0};return new Promise((z,Q)=>$.push({resolve:z,reject:Q})).then((z)=>z?{value:z,done:!1}:{value:void 0,done:!0})}return{value:Z.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new $Z(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var rZ;var h$=M(()=>{rZ=class rZ extends Error{constructor(Z){let $=typeof Z==="string"?Z:Z.map((X)=>{if(X.type==="text")return X.text;return`[${X.type}]`}).join(" ");super($);this.name="ToolError",this.content=Z}}});var o5=1e5,t5=`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:
10
+ 1. Task Overview
11
+ The user's core request and success criteria
12
+ Any clarifications or constraints they specified
13
+ 2. Current State
14
+ What has been completed so far
15
+ Files created, modified, or analyzed (with paths if relevant)
16
+ Key outputs or artifacts produced
17
+ 3. Important Discoveries
18
+ Technical constraints or requirements uncovered
19
+ Decisions made and their rationale
20
+ Errors encountered and how they were resolved
21
+ What approaches were tried that didn't work (and why)
22
+ 4. Next Steps
23
+ Specific actions needed to complete the task
24
+ Any blockers or open questions to resolve
25
+ Priority order if multiple steps remain
26
+ 5. Context to Preserve
27
+ User preferences or style requirements
28
+ Domain-specific details that aren't obvious
29
+ Any promises made to the user
30
+ 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.
31
+ Wrap your summary in <summary></summary> tags.`;var s5=()=>{};function Z1(){let Z,$;return{promise:new Promise((J,z)=>{Z=J,$=z}),resolve:Z,reject:$}}async function B6(Z,$=Z.messages.at(-1),X){if(!$||$.role!=="assistant"||!$.content||typeof $.content==="string")return null;let J=$.content.filter((Q)=>Q.type==="tool_use");if(J.length===0)return null;return{role:"user",content:await Promise.all(J.map(async(Q)=>{let Y=Z.tools.find((K)=>("name"in K?K.name:K.mcp_server_name)===Q.name);if(!Y||!("run"in Y))return{type:"tool_result",tool_use_id:Q.id,content:`Error: Tool '${Q.name}' not found`,is_error:!0};try{let K=Q.input;if("parse"in Y&&Y.parse)K=Y.parse(K);let N=await Y.run(K,{toolUseBlock:Q,signal:X?.signal});return{type:"tool_result",tool_use_id:Q.id,content:N}}catch(K){return{type:"tool_result",tool_use_id:Q.id,content:K instanceof rZ?K.content:`Error: ${K instanceof Error?K.message:String(K)}`,is_error:!0}}}))}}var d8,oZ,yZ,i,s,JZ,CZ,BZ,u8,e5,r0,l8;var o0=M(()=>{UZ();h$();r();I();s5();A8();l8=class l8{constructor(Z,$,X){d8.add(this),this.client=Z,oZ.set(this,!1),yZ.set(this,!1),i.set(this,void 0),s.set(this,void 0),JZ.set(this,void 0),CZ.set(this,void 0),BZ.set(this,void 0),u8.set(this,0),F(this,i,{params:{...$,messages:structuredClone($.messages)}},"f");let z=["BetaToolRunner",...D0($.tools,$.messages)].join(", ");if(F(this,s,{...X,headers:W([{"x-stainless-helper":z},X?.headers])},"f"),F(this,BZ,Z1(),"f"),$.compactionControl?.enabled)console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(oZ=new WeakMap,yZ=new WeakMap,i=new WeakMap,s=new WeakMap,JZ=new WeakMap,CZ=new WeakMap,BZ=new WeakMap,u8=new WeakMap,d8=new WeakSet,e5=async function(){let $=G(this,i,"f").params.compactionControl;if(!$||!$.enabled)return!1;let X=0;if(G(this,JZ,"f")!==void 0)try{let N=await G(this,JZ,"f");X=N.usage.input_tokens+(N.usage.cache_creation_input_tokens??0)+(N.usage.cache_read_input_tokens??0)+N.usage.output_tokens}catch{return!1}let J=$.contextTokenThreshold??o5;if(X<J)return!1;let z=$.model??G(this,i,"f").params.model,Q=$.summaryPrompt??t5,Y=G(this,i,"f").params.messages;if(Y[Y.length-1].role==="assistant"){let N=Y[Y.length-1];if(Array.isArray(N.content)){let q=N.content.filter((C)=>C.type!=="tool_use");if(q.length===0)Y.pop();else N.content=q}}let K=await this.client.beta.messages.create({model:z,messages:[...Y,{role:"user",content:[{type:"text",text:Q}]}],max_tokens:G(this,i,"f").params.max_tokens},{signal:G(this,s,"f").signal,headers:W([G(this,s,"f").headers,{"x-stainless-helper":"compaction"}])});if(K.content[0]?.type!=="text")throw new x("Expected text response for compaction");return G(this,i,"f").params.messages=[{role:"user",content:K.content}],!0},Symbol.asyncIterator)](){var Z;if(G(this,oZ,"f"))throw new x("Cannot iterate over a consumed stream");F(this,oZ,!0,"f"),F(this,yZ,!0,"f"),F(this,CZ,void 0,"f");try{while(!0){let $;try{if(G(this,i,"f").params.max_iterations&&G(this,u8,"f")>=G(this,i,"f").params.max_iterations)break;F(this,yZ,!1,"f"),F(this,CZ,void 0,"f"),F(this,u8,(Z=G(this,u8,"f"),Z++,Z),"f"),F(this,JZ,void 0,"f");let{max_iterations:X,compactionControl:J,...z}=G(this,i,"f").params;if(z.stream)$=this.client.beta.messages.stream({...z},G(this,s,"f")),F(this,JZ,$.finalMessage(),"f"),G(this,JZ,"f").catch(()=>{}),yield $;else F(this,JZ,this.client.beta.messages.create({...z,stream:!1},G(this,s,"f")),"f"),yield G(this,JZ,"f");if(!await G(this,d8,"m",e5).call(this)){if(!G(this,yZ,"f")){let{role:K,content:N}=await G(this,JZ,"f");G(this,i,"f").params.messages.push({role:K,content:N})}let Y=await G(this,d8,"m",r0).call(this,G(this,i,"f").params.messages.at(-1));if(Y)G(this,i,"f").params.messages.push(Y);else if(!G(this,yZ,"f"))break}}finally{if($)$.abort()}}if(!G(this,JZ,"f"))throw new x("ToolRunner concluded without a message from the server");G(this,BZ,"f").resolve(await G(this,JZ,"f"))}catch($){throw F(this,oZ,!1,"f"),G(this,BZ,"f").promise.catch(()=>{}),G(this,BZ,"f").reject($),F(this,BZ,Z1(),"f"),$}}setMessagesParams(Z){if(typeof Z==="function")G(this,i,"f").params=Z(G(this,i,"f").params);else G(this,i,"f").params=Z;F(this,yZ,!0,"f"),F(this,CZ,void 0,"f")}setRequestOptions(Z){if(typeof Z==="function")F(this,s,Z(G(this,s,"f")),"f");else F(this,s,{...G(this,s,"f"),...Z},"f")}async generateToolResponse(Z=G(this,s,"f").signal){let $=await G(this,JZ,"f")??this.params.messages.at(-1);if(!$)return null;return G(this,d8,"m",r0).call(this,$,Z)}done(){return G(this,BZ,"f").promise}async runUntilDone(){if(!G(this,oZ,"f"))for await(let Z of this);return this.done()}get params(){return G(this,i,"f").params}pushMessages(...Z){this.setMessagesParams(($)=>({...$,messages:[...$.messages,...Z]}))}then(Z,$){return this.runUntilDone().then(Z,$)}};r0=async function($,X=G(this,s,"f").signal){if(G(this,CZ,"f")!==void 0)return G(this,CZ,"f");return F(this,CZ,B6(G(this,i,"f").params,$,{...G(this,s,"f"),signal:X}),"f"),G(this,CZ,"f")}});function X1(Z){if(!Z.output_format)return Z;if(Z.output_config?.format)throw new x("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:$,...X}=Z;return{...X,output_config:{...Z.output_config,format:$}}}var $1,S6,SZ;var t0=M(()=>{pZ();v0();R();g0();I();A8();d0();r5();o0();h$();v0();o0();h$();$1={"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"},S6=["claude-mythos-preview","claude-opus-4-6"];SZ=class SZ extends S{constructor(){super(...arguments);this.batches=new _8(this._client)}create(Z,$){let X=X1(Z),{betas:J,...z}=X;if(z.model in $1)console.warn(`The model '${z.model}' is deprecated and will reach end-of-life on ${$1[z.model]}
32
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(S6.includes(z.model)&&z.thinking&&z.thinking.type==="enabled")console.warn(`Using Claude with ${z.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 Q=this._client._options.timeout;if(!z.stream&&Q==null){let K=j$[z.model]??void 0;Q=this._client.calculateNonstreamingTimeout(z.max_tokens,K)}let Y=D$(z.tools,z.messages);return this._client.post("/v1/messages?beta=true",{body:z,timeout:Q??600000,...$,headers:W([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},Y,$?.headers]),stream:X.stream??!1})}parse(Z,$){return $={...$,headers:W([{"anthropic-beta":[...Z.betas??[],"structured-outputs-2025-12-15"].toString()},$?.headers])},this.create(Z,$).then((X)=>c0(X,Z,{logger:this._client.logger??console}))}stream(Z,$){return c8.createMessage(this,Z,$)}countTokens(Z,$){let X=X1(Z),{betas:J,...z}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:z,...$,headers:W([{"anthropic-beta":[...J??[],"token-counting-2024-11-01"].toString()},$?.headers])})}toolRunner(Z,$){return new l8(this._client,Z,$)}};SZ.Batches=_8;SZ.BetaToolRunner=l8;SZ.ToolError=rZ});var p8;var s0=M(()=>{R();_();I();h();p8=class p8 extends S{list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/sessions/${Z}/events?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}send(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/sessions/${Z}/events?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/sessions/${Z}/events/stream?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var i8;var e0=M(()=>{R();_();I();h();i8=class i8 extends S{retrieve(Z,$,X){let{session_id:J,betas:z}=$;return this._client.get(U`/v1/sessions/${J}/resources/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{session_id:J,betas:z,...Q}=$;return this._client.post(U`/v1/sessions/${J}/resources/${Z}?beta=true`,{body:Q,...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/sessions/${Z}/resources?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete(Z,$,X){let{session_id:J,betas:z}=$;return this._client.delete(U`/v1/sessions/${J}/resources/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}add(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/sessions/${Z}/resources?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var n8;var ZX=M(()=>{R();_();I();h();n8=class n8 extends S{list(Z,$,X){let{session_id:J,betas:z,...Q}=$;return this._client.getAPIList(U`/v1/sessions/${J}/threads/${Z}/events?beta=true`,L,{query:Q,...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}stream(Z,$,X){let{session_id:J,betas:z}=$;return this._client.get(U`/v1/sessions/${J}/threads/${Z}/stream?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers]),stream:!0})}}});var tZ;var $X=M(()=>{R();ZX();ZX();_();I();h();tZ=class tZ extends S{constructor(){super(...arguments);this.events=new n8(this._client)}retrieve(Z,$,X){let{session_id:J,betas:z}=$;return this._client.get(U`/v1/sessions/${J}/threads/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/sessions/${Z}/threads?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive(Z,$,X){let{session_id:J,betas:z}=$;return this._client.post(U`/v1/sessions/${J}/threads/${Z}/archive?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};tZ.Events=n8});var AZ;var XX=M(()=>{R();s0();s0();e0();e0();$X();$X();_();I();h();AZ=class AZ extends S{constructor(){super(...arguments);this.events=new p8(this._client),this.resources=new i8(this._client),this.threads=new tZ(this._client)}create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/sessions?beta=true",{body:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/sessions/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/sessions/${Z}?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/sessions?beta=true",L,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}delete(Z,$={},X){let{betas:J}=$??{};return this._client.delete(U`/v1/sessions/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive(Z,$={},X){let{betas:J}=$??{};return this._client.post(U`/v1/sessions/${Z}/archive?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};AZ.Events=p8;AZ.Resources=i8;AZ.Threads=tZ});var a8;var JX=M(()=>{R();_();I();uZ();h();a8=class a8 extends S{create(Z,$={},X){let{betas:J,...z}=$??{};return this._client.post(U`/v1/skills/${Z}/versions?beta=true`,dZ({body:z,...X,headers:W([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])},this._client))}retrieve(Z,$,X){let{skill_id:J,betas:z}=$;return this._client.get(U`/v1/skills/${J}/versions/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/skills/${Z}/versions?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}delete(Z,$,X){let{skill_id:J,betas:z}=$;return this._client.delete(U`/v1/skills/${J}/versions/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var sZ;var zX=M(()=>{R();JX();JX();_();I();uZ();h();sZ=class sZ extends S{constructor(){super(...arguments);this.versions=new a8(this._client)}create(Z={},$){let{betas:X,...J}=Z??{};return this._client.post("/v1/skills?beta=true",dZ({body:J,...$,headers:W([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},$?.headers])},this._client,!1))}retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/skills/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/skills?beta=true",L,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},$?.headers])})}delete(Z,$={},X){let{betas:J}=$??{};return this._client.delete(U`/v1/skills/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}};sZ.Versions=a8});var r8;var QX=M(()=>{R();_();I();h();r8=class r8 extends S{create(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/vaults/${Z}/credentials?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}retrieve(Z,$,X){let{vault_id:J,betas:z}=$;return this._client.get(U`/v1/vaults/${J}/credentials/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{vault_id:J,betas:z,...Q}=$;return this._client.post(U`/v1/vaults/${J}/credentials/${Z}?beta=true`,{body:Q,...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z,$={},X){let{betas:J,...z}=$??{};return this._client.getAPIList(U`/v1/vaults/${Z}/credentials?beta=true`,L,{query:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}delete(Z,$,X){let{vault_id:J,betas:z}=$;return this._client.delete(U`/v1/vaults/${J}/credentials/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive(Z,$,X){let{vault_id:J,betas:z}=$;return this._client.post(U`/v1/vaults/${J}/credentials/${Z}/archive?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}mcpOAuthValidate(Z,$,X){let{vault_id:J,betas:z}=$;return this._client.post(U`/v1/vaults/${J}/credentials/${Z}/mcp_oauth_validate?beta=true`,{...X,headers:W([{"anthropic-beta":[...z??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}}});var eZ;var KX=M(()=>{R();QX();QX();_();I();h();eZ=class eZ extends S{constructor(){super(...arguments);this.credentials=new r8(this._client)}create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/vaults?beta=true",{body:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/vaults/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}update(Z,$,X){let{betas:J,...z}=$;return this._client.post(U`/v1/vaults/${Z}?beta=true`,{body:z,...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/vaults?beta=true",L,{query:J,...$,headers:W([{"anthropic-beta":[...X??[],"managed-agents-2026-04-01"].toString()},$?.headers])})}delete(Z,$={},X){let{betas:J}=$??{};return this._client.delete(U`/v1/vaults/${Z}?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}archive(Z,$={},X){let{betas:J}=$??{};return this._client.post(U`/v1/vaults/${Z}/archive?beta=true`,{...X,headers:W([{"anthropic-beta":[...J??[],"managed-agents-2026-04-01"].toString()},X?.headers])})}};eZ.Credentials=r8});var a;var YX=M(()=>{R();A0();A0();L0();L0();E0();E0();j0();j0();I0();I0();y0();y0();b0();b0();t0();t0();XX();XX();zX();zX();KX();KX();a=class a extends S{constructor(){super(...arguments);this.models=new L8(this._client),this.messages=new SZ(this._client),this.agents=new lZ(this._client),this.environments=new B8(this._client),this.sessions=new AZ(this._client),this.vaults=new eZ(this._client),this.memoryStores=new IZ(this._client),this.files=new D8(this._client),this.skills=new sZ(this._client),this.webhooks=new R8(this._client),this.userProfiles=new E8(this._client)}};a.Models=L8;a.Messages=SZ;a.Agents=lZ;a.Environments=B8;a.Sessions=AZ;a.Vaults=eZ;a.MemoryStores=IZ;a.Files=D8;a.Skills=sZ;a.Webhooks=R8;a.UserProfiles=E8});var Z8;var GX=M(()=>{R();I();Z8=class Z8 extends S{create(Z,$){let{betas:X,...J}=Z;return this._client.post("/v1/complete",{body:J,timeout:this._client._options.timeout??600000,...$,headers:W([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},$?.headers]),stream:Z.stream??!1})}}});function J1(Z){return Z?.output_config?.format}function wX(Z,$,X){let J=J1($);if(!$||!("parse"in(J??{})))return{...Z,content:Z.content.map((z)=>{if(z.type==="text")return Object.defineProperty({...z},"parsed_output",{value:null,enumerable:!1});return z}),parsed_output:null};return WX(Z,$,X)}function WX(Z,$,X){let J=null,z=Z.content.map((Q)=>{if(Q.type==="text"){let Y=_6($,Q.text);if(J===null)J=Y;return Object.defineProperty({...Q},"parsed_output",{value:Y,enumerable:!1})}return Q});return{...Z,content:z,parsed_output:J}}function _6(Z,$){let X=J1(Z);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse($);return JSON.parse($)}catch(J){throw new x(`Failed to parse structured output: ${J}`)}}var VX=M(()=>{r()});function Y1(Z){return Z.type==="tool_use"||Z.type==="server_tool_use"}function G1(Z){}var GZ,DZ,$8,o8,v$,t8,s8,g$,e8,FZ,Z$,m$,c$,_Z,d$,u$,$$,NX,z1,UX,qX,OX,MX,Q1,K1="__json_buf",X$;var w1=M(()=>{UZ();hZ();pZ();l0();u0();VX();X$=class X${constructor(Z,$){GZ.add(this),this.messages=[],this.receivedMessages=[],DZ.set(this,void 0),$8.set(this,null),this.controller=new AbortController,o8.set(this,void 0),v$.set(this,()=>{}),t8.set(this,()=>{}),s8.set(this,void 0),g$.set(this,()=>{}),e8.set(this,()=>{}),FZ.set(this,{}),Z$.set(this,!1),m$.set(this,!1),c$.set(this,!1),_Z.set(this,!1),d$.set(this,void 0),u$.set(this,void 0),$$.set(this,void 0),UX.set(this,(X)=>{if(F(this,m$,!0,"f"),qZ(X))X=new n;if(X instanceof n)return F(this,c$,!0,"f"),this._emit("abort",X);if(X instanceof x)return this._emit("error",X);if(X instanceof Error){let J=new x(X.message);return J.cause=X,this._emit("error",J)}return this._emit("error",new x(String(X)))}),F(this,o8,new Promise((X,J)=>{F(this,v$,X,"f"),F(this,t8,J,"f")}),"f"),F(this,s8,new Promise((X,J)=>{F(this,g$,X,"f"),F(this,e8,J,"f")}),"f"),G(this,o8,"f").catch(()=>{}),G(this,s8,"f").catch(()=>{}),F(this,$8,Z,"f"),F(this,$$,$?.logger??console,"f")}get response(){return G(this,d$,"f")}get request_id(){return G(this,u$,"f")}async withResponse(){F(this,_Z,!0,"f");let Z=await G(this,o8,"f");if(!Z)throw Error("Could not resolve a `Response` object");return{data:this,response:Z,request_id:Z.headers.get("request-id")}}static fromReadableStream(Z){let $=new X$(null);return $._run(()=>$._fromReadableStream(Z)),$}static createMessage(Z,$,X,{logger:J}={}){let z=new X$($,{logger:J});for(let Q of $.messages)z._addMessageParam(Q);return F(z,$8,{...$,stream:!0},"f"),z._run(()=>z._createMessage(Z,{...$,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),z}_run(Z){Z().then(()=>{this._emitFinal(),this._emit("end")},G(this,UX,"f"))}_addMessageParam(Z){this.messages.push(Z)}_addMessage(Z,$=!0){if(this.receivedMessages.push(Z),$)this._emit("message",Z)}async _createMessage(Z,$,X){let J=X?.signal,z;if(J){if(J.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),J.addEventListener("abort",z)}try{G(this,GZ,"m",qX).call(this);let{response:Q,data:Y}=await Z.create({...$,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(Q);for await(let K of Y)G(this,GZ,"m",OX).call(this,K);if(Y.controller.signal?.aborted)throw new n;G(this,GZ,"m",MX).call(this)}finally{if(J&&z)J.removeEventListener("abort",z)}}_connected(Z){if(this.ended)return;F(this,d$,Z,"f"),F(this,u$,Z?.headers.get("request-id"),"f"),G(this,v$,"f").call(this,Z),this._emit("connect")}get ended(){return G(this,Z$,"f")}get errored(){return G(this,m$,"f")}get aborted(){return G(this,c$,"f")}abort(){this.controller.abort()}on(Z,$){return(G(this,FZ,"f")[Z]||(G(this,FZ,"f")[Z]=[])).push({listener:$}),this}off(Z,$){let X=G(this,FZ,"f")[Z];if(!X)return this;let J=X.findIndex((z)=>z.listener===$);if(J>=0)X.splice(J,1);return this}once(Z,$){return(G(this,FZ,"f")[Z]||(G(this,FZ,"f")[Z]=[])).push({listener:$,once:!0}),this}emitted(Z){return new Promise(($,X)=>{if(F(this,_Z,!0,"f"),Z!=="error")this.once("error",X);this.once(Z,$)})}async done(){F(this,_Z,!0,"f"),await G(this,s8,"f")}get currentMessage(){return G(this,DZ,"f")}async finalMessage(){return await this.done(),G(this,GZ,"m",NX).call(this)}async finalText(){return await this.done(),G(this,GZ,"m",z1).call(this)}_emit(Z,...$){if(G(this,Z$,"f"))return;if(Z==="end")F(this,Z$,!0,"f"),G(this,g$,"f").call(this);let X=G(this,FZ,"f")[Z];if(X)G(this,FZ,"f")[Z]=X.filter((J)=>!J.once),X.forEach(({listener:J})=>J(...$));if(Z==="abort"){let J=$[0];if(!G(this,_Z,"f")&&!X?.length)Promise.reject(J);G(this,t8,"f").call(this,J),G(this,e8,"f").call(this,J),this._emit("end");return}if(Z==="error"){let J=$[0];if(!G(this,_Z,"f")&&!X?.length)Promise.reject(J);G(this,t8,"f").call(this,J),G(this,e8,"f").call(this,J),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",G(this,GZ,"m",NX).call(this))}async _fromReadableStream(Z,$){let X=$?.signal,J;if(X){if(X.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),X.addEventListener("abort",J)}try{G(this,GZ,"m",qX).call(this),this._connected(null);let z=$Z.fromReadableStream(Z,this.controller);for await(let Q of z)G(this,GZ,"m",OX).call(this,Q);if(z.controller.signal?.aborted)throw new n;G(this,GZ,"m",MX).call(this)}finally{if(X&&J)X.removeEventListener("abort",J)}}[(DZ=new WeakMap,$8=new WeakMap,o8=new WeakMap,v$=new WeakMap,t8=new WeakMap,s8=new WeakMap,g$=new WeakMap,e8=new WeakMap,FZ=new WeakMap,Z$=new WeakMap,m$=new WeakMap,c$=new WeakMap,_Z=new WeakMap,d$=new WeakMap,u$=new WeakMap,$$=new WeakMap,UX=new WeakMap,GZ=new WeakSet,NX=function(){if(this.receivedMessages.length===0)throw new x("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},z1=function(){if(this.receivedMessages.length===0)throw new x("stream ended without producing a Message with role=assistant");let $=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if($.length===0)throw new x("stream ended without producing a content block with type=text");return $.join(" ")},qX=function(){if(this.ended)return;F(this,DZ,void 0,"f")},OX=function($){if(this.ended)return;let X=G(this,GZ,"m",Q1).call(this,$);switch(this._emit("streamEvent",$,X),$.type){case"content_block_delta":{let J=X.content.at(-1);switch($.delta.type){case"text_delta":{if(J.type==="text")this._emit("text",$.delta.text,J.text||"");break}case"citations_delta":{if(J.type==="text")this._emit("citation",$.delta.citation,J.citations??[]);break}case"input_json_delta":{if(Y1(J)&&J.input)this._emit("inputJson",$.delta.partial_json,J.input);break}case"thinking_delta":{if(J.type==="thinking")this._emit("thinking",$.delta.thinking,J.thinking);break}case"signature_delta":{if(J.type==="thinking")this._emit("signature",J.signature);break}default:G1($.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(wX(X,G(this,$8,"f"),{logger:G(this,$$,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{F(this,DZ,X,"f");break}case"content_block_start":case"message_delta":break}},MX=function(){if(this.ended)throw new x("stream has ended, this shouldn't happen");let $=G(this,DZ,"f");if(!$)throw new x("request ended without sending any chunks");return F(this,DZ,void 0,"f"),wX($,G(this,$8,"f"),{logger:G(this,$$,"f")})},Q1=function($){let X=G(this,DZ,"f");if($.type==="message_start"){if(X)throw new x(`Unexpected event order, got ${$.type} before receiving "message_stop"`);return $.message}if(!X)throw new x(`Unexpected event order, got ${$.type} before "message_start"`);switch($.type){case"message_stop":return X;case"message_delta":if(X.stop_reason=$.delta.stop_reason,X.stop_sequence=$.delta.stop_sequence,X.usage.output_tokens=$.usage.output_tokens,$.usage.input_tokens!=null)X.usage.input_tokens=$.usage.input_tokens;if($.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=$.usage.cache_creation_input_tokens;if($.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.server_tool_use!=null)X.usage.server_tool_use=$.usage.server_tool_use;return X;case"content_block_start":return X.content.push({...$.content_block}),X;case"content_block_delta":{let J=X.content.at($.index);switch($.delta.type){case"text_delta":{if(J?.type==="text")X.content[$.index]={...J,text:(J.text||"")+$.delta.text};break}case"citations_delta":{if(J?.type==="text")X.content[$.index]={...J,citations:[...J.citations??[],$.delta.citation]};break}case"input_json_delta":{if(J&&Y1(J)){let z=J[K1]||"";z+=$.delta.partial_json;let Q={...J};if(Object.defineProperty(Q,K1,{value:z,enumerable:!1,writable:!0}),z)Q.input=P$(z);X.content[$.index]=Q}break}case"thinking_delta":{if(J?.type==="thinking")X.content[$.index]={...J,thinking:J.thinking+$.delta.thinking};break}case"signature_delta":{if(J?.type==="thinking")X.content[$.index]={...J,signature:$.delta.signature};break}default:G1($.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let Z=[],$=[],X=!1;return this.on("streamEvent",(J)=>{let z=$.shift();if(z)z.resolve(J);else Z.push(J)}),this.on("end",()=>{X=!0;for(let J of $)J.resolve(void 0);$.length=0}),this.on("abort",(J)=>{X=!0;for(let z of $)z.reject(J);$.length=0}),this.on("error",(J)=>{X=!0;for(let z of $)z.reject(J);$.length=0}),{next:async()=>{if(!Z.length){if(X)return{value:void 0,done:!0};return new Promise((z,Q)=>$.push({resolve:z,reject:Q})).then((z)=>z?{value:z,done:!1}:{value:void 0,done:!0})}return{value:Z.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new $Z(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var J$;var CX=M(()=>{R();_();I();h0();pZ();h();J$=class J$ extends S{create(Z,$){return this._client.post("/v1/messages/batches",{body:Z,...$})}retrieve(Z,$){return this._client.get(U`/v1/messages/batches/${Z}`,$)}list(Z={},$){return this._client.getAPIList("/v1/messages/batches",WZ,{query:Z,...$})}delete(Z,$){return this._client.delete(U`/v1/messages/batches/${Z}`,$)}cancel(Z,$){return this._client.post(U`/v1/messages/batches/${Z}/cancel`,$)}async results(Z,$){let X=await this.retrieve(Z);if(!X.results_url)throw new x(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...$,headers:W([{Accept:"application/binary"},$?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((J,z)=>iZ.fromResponse(z.response,z.controller))}}});var fZ,W1,b6;var FX=M(()=>{R();I();A8();w1();VX();CX();CX();g0();fZ=class fZ extends S{constructor(){super(...arguments);this.batches=new J$(this._client)}create(Z,$){if(Z.model in W1)console.warn(`The model '${Z.model}' is deprecated and will reach end-of-life on ${W1[Z.model]}
33
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(b6.includes(Z.model)&&Z.thinking&&Z.thinking.type==="enabled")console.warn(`Using Claude with ${Z.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 X=this._client._options.timeout;if(!Z.stream&&X==null){let z=j$[Z.model]??void 0;X=this._client.calculateNonstreamingTimeout(Z.max_tokens,z)}let J=D$(Z.tools,Z.messages);return this._client.post("/v1/messages",{body:Z,timeout:X??600000,...$,headers:W([J,$?.headers]),stream:Z.stream??!1})}parse(Z,$){return this.create(Z,$).then((X)=>WX(X,Z,{logger:this._client.logger??console}))}stream(Z,$){return X$.createMessage(this,Z,$,{logger:this._client.logger??console})}countTokens(Z,$){return this._client.post("/v1/messages/count_tokens",{body:Z,...$})}};W1={"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","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},b6=["claude-mythos-preview","claude-opus-4-6"];fZ.Batches=J$});var X8;var xX=M(()=>{R();_();I();h();X8=class X8 extends S{retrieve(Z,$={},X){let{betas:J}=$??{};return this._client.get(U`/v1/models/${Z}`,{...X,headers:W([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers])})}list(Z={},$){let{betas:X,...J}=Z??{};return this._client.getAPIList("/v1/models",WZ,{query:J,...$,headers:W([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},$?.headers])})}}});var V1=M(()=>{YX();GX();FX();xX();S5()});class v{get credentials(){return this._authState.provider}constructor({baseURL:Z=E("ANTHROPIC_BASE_URL"),apiKey:$,authToken:X,webhookKey:J=E("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...z}={}){if(HX.add(this),this._requestAuthFlags=new WeakMap,l$.set(this,void 0),$===void 0)$=z.profile!=null?null:E("ANTHROPIC_API_KEY")??null;if(X===void 0)X=z.profile!=null?null:E("ANTHROPIC_AUTH_TOKEN")??null;if(z.profile!=null&&(z.credentials!=null||z.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let Q={apiKey:$,authToken:X,webhookKey:J,...z,baseURL:Z||"https://api.anthropic.com"};if(!Q.dangerouslyAllowBrowser&&IX())throw new x(`It looks like you're running in a browser-like environment.
34
+
35
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
36
+ If you understand the risks and have appropriate mitigations in place,
37
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
38
+
39
+ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
40
+ `);this.baseURL=Q.baseURL,this._baseURLIsExplicit=z.__baseURLIsExplicit??!!Z,this.timeout=Q.timeout??TX.DEFAULT_TIMEOUT,this.logger=Q.logger??console;let Y="warn";this.logLevel=Y,this.logLevel=w0(Q.logLevel,"ClientOptions.logLevel",this)??w0(E("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Y,this.fetchOptions=Q.fetchOptions,this.maxRetries=Q.maxRetries??2,this.fetch=Q.fetch??kX(),F(this,l$,_X,"f");let K=E("ANTHROPIC_CUSTOM_HEADERS");if(K){let q={};for(let C of K.split(`
41
+ `)){let V=C.indexOf(":");if(V>=0)q[C.substring(0,V).trim()]=C.substring(V+1).trim()}Q.defaultHeaders={...q,...Q.defaultHeaders}}let N=z.__auth;if(delete Q.__auth,delete Q.__baseURLIsExplicit,this._options=Q,this.apiKey=typeof $==="string"?$:null,this.authToken=X,this.webhookKey=J,N){if(this._authState=N,!this._baseURLIsExplicit&&N.baseURL)this.baseURL=N.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let q=Q.credentials??null;if(q)this._authState.provider=q,this._authState.tokenCache=this._makeTokenCache(q);else if(Q.config!=null){let C=U0(Q.config,this._credentialResolverOptions());this._authState.provider=C.provider,this._authState.tokenCache=this._makeTokenCache(C.provider),this._authState.extraHeaders=C.extraHeaders,this._applyCredentialBaseURL(C.baseURL)}else if(Q.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(Q.profile);else this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(Z){if(!Z)return;let $=Z.replace(/\/+$/,"");if(this._authState.baseURL=$,!this._baseURLIsExplicit)this.baseURL=$}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:(Z)=>{m(this).debug("credential cache write failed (best-effort)",Z)},onSafetyWarning:(Z)=>{m(this).warn(Z)}}}_makeTokenCache(Z){return new Y0(Z,($)=>{m(this).debug("advisory token refresh failed; serving cached token",$)})}withOptions(Z){let $="credentials"in Z||"config"in Z||"profile"in Z,X="apiKey"in Z||"authToken"in Z||$,J={...this._options,...this._baseURLIsExplicit?{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,webhookKey:this.webhookKey,credentials:this.credentials,...$?{credentials:void 0,config:void 0,profile:void 0}:{},...Z,__auth:X?void 0:this._authState,__baseURLIsExplicit:"baseURL"in Z?!0:this._baseURLIsExplicit};return new this.constructor(J)}async _resolveDefaultCredentials(Z){try{let $=await M5(this._credentialResolverOptions(),Z);if($)this._authState.provider=$.provider,this._authState.tokenCache=this._makeTokenCache($.provider),this._authState.extraHeaders=$.extraHeaders,this._applyCredentialBaseURL($.baseURL);else if(Z!=null)throw new x(`Profile "${Z}" could not be resolved (no <config_dir>/configs/${Z}.json found).`)}catch($){this._authState.error=$}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:Z,nulls:$}){if(Z.get("x-api-key")||Z.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&Z.get("x-api-key"))return;if($.has("x-api-key"))return;if(this.authToken&&Z.get("authorization"))return;if($.has("authorization"))return;throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}_authFlags(Z){let $=this._requestAuthFlags.get(Z);if(!$)$={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(Z,$);return $}async authHeaders(Z){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let $=await this._authState.tokenCache.getToken();return this._authFlags(Z).usedTokenCache=!0,W([{Authorization:`Bearer ${$}`}])}return W([await this.apiKeyAuth(Z),await this.bearerAuth(Z)])}async apiKeyAuth(Z){if(this.apiKey==null)return;return W([{"X-Api-Key":this.apiKey}])}async bearerAuth(Z){if(this.authToken==null)return;return W([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(Z){return iX(Z)}getUserAgent(){return`${this.constructor.name}/JS ${QZ}`}defaultIdempotencyKey(){return`stainless-node-retry-${i$()}`}makeStatusError(Z,$,X,J){return l.generate(Z,$,X,J)}buildURL(Z,$,X){let J=!G(this,HX,"m",N1).call(this)&&X||this.baseURL,z=AX(Z)?new URL(Z):new URL(J+(J.endsWith("/")&&Z.startsWith("/")?Z.slice(1):Z)),Q=this.defaultQuery(),Y=Object.fromEntries(z.searchParams);if(!r$(Q)||!r$(Y))$={...Y,...Q,...$};if(typeof $==="object"&&$&&!Array.isArray($))z.search=this.stringifyQuery($);return z.toString()}_calculateNonstreamingTimeout(Z){if(3600*Z/128000>600)throw new x("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 600000}async prepareOptions(Z){}async prepareRequest(Z,{url:$,options:X}){if(this._authState.tokenCache&&this.apiKey==null){let J=Z.headers instanceof Headers?Z.headers:new Headers(Z.headers);for(let[Q,Y]of Object.entries(this._authState.extraHeaders))if(!J.has(Q))J.set(Q,Y);if(!J.get("anthropic-beta")?.split(",").map((Q)=>Q.trim())?.includes(jZ))J.append("anthropic-beta",jZ);Z.headers=J}}get(Z,$){return this.methodRequest("get",Z,$)}post(Z,$){return this.methodRequest("post",Z,$)}patch(Z,$){return this.methodRequest("patch",Z,$)}put(Z,$){return this.methodRequest("put",Z,$)}delete(Z,$){return this.methodRequest("delete",Z,$)}methodRequest(Z,$,X){return this.request(Promise.resolve(X).then((J)=>{return{method:Z,path:$,...J}}))}request(Z,$=null){return new PZ(this,this.makeRequest(Z,$,void 0))}async makeRequest(Z,$,X){let J=await Z,z=J.maxRetries??this.maxRetries;if($==null)$=z,this._requestAuthFlags.delete(J);await this.prepareOptions(J);let{req:Q,url:Y,timeout:K}=await this.buildRequest(J,{retryCount:z-$});await this.prepareRequest(Q,{url:Y,options:J});let N="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),q=X===void 0?"":`, retryOf: ${X}`,C=Date.now();if(m(this).debug(`[${N}] sending request`,OZ({retryOfRequestLogID:X,method:J.method,url:Y,options:J,headers:Q.headers})),J.signal?.aborted)throw new n;let V=new AbortController,w=await this.fetchWithTimeout(Y,Q,K,V).catch(J8),O=Date.now();if(w instanceof globalThis.Error){let B=`retrying, ${$} attempts remaining`;if(J.signal?.aborted)throw new n;let A=qZ(w)||/timed? ?out/i.test(String(w)+("cause"in w?String(w.cause):""));if($)return m(this).info(`[${N}] connection ${A?"timed out":"failed"} - ${B}`),m(this).debug(`[${N}] connection ${A?"timed out":"failed"} (${B})`,OZ({retryOfRequestLogID:X,url:Y,durationMs:O-C,message:w.message})),this.retryRequest(J,$,X??N);if(m(this).info(`[${N}] connection ${A?"timed out":"failed"} - error; no more retries left`),m(this).debug(`[${N}] connection ${A?"timed out":"failed"} (error; no more retries left)`,OZ({retryOfRequestLogID:X,url:Y,durationMs:O-C,message:w.message})),A)throw new z8;throw new EZ({cause:w})}let H=[...w.headers.entries()].filter(([B])=>B==="request-id").map(([B,A])=>", "+B+": "+JSON.stringify(A)).join(""),D=`[${N}${q}${H}] ${Q.method} ${Y} ${w.ok?"succeeded":"failed"} with status ${w.status} in ${O-C}ms`;if(!w.ok){let B=await this.shouldRetry(w,J);if($&&B){let u=`retrying, ${$} attempts remaining`;return await yX(w.body),m(this).info(`${D} - ${u}`),m(this).debug(`[${N}] response error (${u})`,OZ({retryOfRequestLogID:X,url:w.url,status:w.status,headers:w.headers,durationMs:O-C})),this.retryRequest(J,$,X??N,w.headers)}let A=B?"error; no more retries left":"error; not retryable";m(this).info(`${D} - ${A}`);let T=await w.text().catch((u)=>J8(u).message),f=Q$(T),k=f?void 0:T;throw m(this).debug(`[${N}] response error (${A})`,OZ({retryOfRequestLogID:X,url:w.url,status:w.status,headers:w.headers,message:k,durationMs:Date.now()-C})),this.makeStatusError(w.status,f,k,w.headers)}return m(this).info(D),m(this).debug(`[${N}] response start`,OZ({retryOfRequestLogID:X,url:w.url,status:w.status,headers:w.headers,durationMs:O-C})),{response:w,options:J,controller:V,requestLogID:N,retryOfRequestLogID:X,startTime:C}}getAPIList(Z,$,X){return this.requestAPIList($,X&&"then"in X?X.then((J)=>({method:"get",path:Z,...J})):{method:"get",path:Z,...X})}requestAPIList(Z,$){let X=this.makeRequest($,null,void 0);return new B$(this,X,Z)}async fetchWithTimeout(Z,$,X,J){let{signal:z,method:Q,...Y}=$||{},K=this._makeAbort(J);if(z)z.addEventListener("abort",K,{once:!0});let N=setTimeout(K,X),q=globalThis.ReadableStream&&Y.body instanceof globalThis.ReadableStream||typeof Y.body==="object"&&Y.body!==null&&Symbol.asyncIterator in Y.body,C={signal:J.signal,...q?{duplex:"half"}:{},method:"GET",...Y};if(Q)C.method=Q.toUpperCase();try{return await this.fetch.call(void 0,Z,C)}finally{clearTimeout(N)}}async shouldRetry(Z,$){let X=this._authFlags($);if(Z.status===401&&this._authState.tokenCache&&X.usedTokenCache&&!X.didRefreshFor401)return X.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let J=Z.headers.get("x-should-retry");if(J==="true")return!0;if(J==="false")return!1;if(Z.status===408)return!0;if(Z.status===409)return!0;if(Z.status===429)return!0;if(Z.status>=500)return!0;return!1}async retryRequest(Z,$,X,J){let z,Q=J?.get("retry-after-ms");if(Q){let K=parseFloat(Q);if(!Number.isNaN(K))z=K}let Y=J?.get("retry-after");if(Y&&!z){let K=parseFloat(Y);if(!Number.isNaN(K))z=K*1000;else z=Date.parse(Y)-Date.now()}if(z===void 0){let K=Z.maxRetries??this.maxRetries;z=this.calculateDefaultRetryTimeoutMillis($,K)}return await EX(z),this.makeRequest(Z,$-1,X)}calculateDefaultRetryTimeoutMillis(Z,$){let z=$-Z,Q=Math.min(0.5*Math.pow(2,z),8),Y=1-Math.random()*0.25;return Q*Y*1000}calculateNonstreamingTimeout(Z,$){if(3600000*Z/128000>600000||$!=null&&Z>$)throw new x("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 600000}async buildRequest(Z,{retryCount:$=0}={}){let X={...Z},{method:J,path:z,query:Q,defaultBaseURL:Y}=X;if(this._authState.resolution)await this._authState.resolution;if(!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL)this.baseURL=this._authState.baseURL;let K=this.buildURL(z,Q,Y);if("timeout"in X)LX("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:N,body:q}=this.buildBody({options:X}),C=await this.buildHeaders({options:Z,method:J,bodyHeaders:N,retryCount:$});return{req:{method:J,headers:C,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&q instanceof globalThis.ReadableStream&&{duplex:"half"},...q&&{body:q},...this.fetchOptions??{},...X.fetchOptions??{}},url:K,timeout:X.timeout}}async buildHeaders({options:Z,method:$,bodyHeaders:X,retryCount:J}){let z={};if(this.idempotencyHeader&&$!=="get"){if(!Z.idempotencyKey)Z.idempotencyKey=this.defaultIdempotencyKey();z[this.idempotencyHeader]=Z.idempotencyKey}let Q=W([z,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(J),...Z.timeout?{"X-Stainless-Timeout":String(Math.trunc(Z.timeout/1000))}:{},...q8(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(Z),this._options.defaultHeaders,X,Z.headers]);return this.validateHeaders(Q),Q.values}_makeAbort(Z){return()=>Z.abort()}buildBody({options:{body:Z,headers:$}}){if(!Z)return{bodyHeaders:void 0,body:void 0};let X=W([$]);if(ArrayBuffer.isView(Z)||Z instanceof ArrayBuffer||Z instanceof DataView||typeof Z==="string"&&X.values.has("content-type")||globalThis.Blob&&Z instanceof globalThis.Blob||Z instanceof FormData||Z instanceof URLSearchParams||globalThis.ReadableStream&&Z instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:Z};else if(typeof Z==="object"&&((Symbol.asyncIterator in Z)||(Symbol.iterator in Z)&&("next"in Z)&&typeof Z.next==="function"))return{bodyHeaders:void 0,body:Y$(Z)};else if(typeof Z==="object"&&X.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(Z)};else return G(this,l$,"f").call(this,{body:Z,headers:X})}}var HX,TX,l$,N1,U1="\\n\\nHuman:",q1="\\n\\nAssistant:",bZ;var BX=M(()=>{UZ();n$();VZ();o$();hZ();K$();vZ();fX();Q0();U8();r();mZ();eX();C5();_();S0();V1();H$();GX();xX();YX();FX();K$();I();q$();F8();VZ();TX=v,l$=new WeakMap,HX=new WeakSet,N1=function(){return this.baseURL!=="https://api.anthropic.com"};v.Anthropic=TX;v.HUMAN_PROMPT=U1;v.AI_PROMPT=q1;v.DEFAULT_TIMEOUT=600000;v.AnthropicError=x;v.APIError=l;v.APIConnectionError=EZ;v.APIConnectionTimeoutError=z8;v.APIUserAbortError=n;v.NotFoundError=G8;v.ConflictError=w8;v.RateLimitError=V8;v.BadRequestError=Q8;v.AuthenticationError=K8;v.InternalServerError=N8;v.PermissionDeniedError=Y8;v.UnprocessableEntityError=W8;v.toFile=S$;bZ=class bZ extends v{constructor(){super(...arguments);this.completions=new Z8(this),this.messages=new fZ(this),this.models=new X8(this),this.beta=new a(this)}};bZ.Completions=Z8;bZ.Messages=fZ;bZ.Models=X8;bZ.Beta=a});var O1=M(()=>{BX();S0();H$();BX();_();r()});function _2(Z){return Z instanceof M1||Z instanceof n||Z instanceof Error&&Z.name==="AbortError"}function f2(Z,$){return Z instanceof Error&&Z.message===$}function b2(Z){return Z instanceof Error?Z:Error(String(Z))}function l6(Z){return Z instanceof Error?Z.message:String(Z)}function C1(Z){if(Z&&typeof Z==="object"&&"code"in Z&&typeof Z.code==="string")return Z.code;return}function h2(Z){return C1(Z)==="ENOENT"}function v2(Z){if(Z&&typeof Z==="object"&&"path"in Z&&typeof Z.path==="string")return Z.path;return}function g2(Z,$=5){if(!(Z instanceof Error))return String(Z);if(!Z.stack)return Z.message;let X=Z.stack.split(`
42
+ `),J=X[0]??Z.message,z=X.slice(1).filter((Q)=>Q.trim().startsWith("at "));if(z.length<=$)return Z.stack;return[J,...z.slice(0,$)].join(`
43
+ `)}function m2(Z){let $=C1(Z);return $==="ENOENT"||$==="EACCES"||$==="EPERM"||$==="ENOTDIR"||$==="ELOOP"}function c2(Z){let $=l6(Z);if(!Z||typeof Z!=="object"||!("isAxiosError"in Z)||!Z.isAxiosError)return{kind:"other",message:$};let X=Z,J=X.response?.status;if(J===401||J===403)return{kind:"auth",status:J,message:$};if(X.code==="ECONNABORTED")return{kind:"timeout",status:J,message:$};if(X.code==="ECONNREFUSED"||X.code==="ENOTFOUND")return{kind:"network",status:J,message:$};return{kind:"http",status:J,message:$}}var v6,g6,M1,m6,c6,d6,u6;var p6=M(()=>{O1();v6=class v6 extends Error{constructor(Z,$){super(Z,$);this.name=this.constructor.name}};g6=class g6 extends Error{};M1=class M1 extends Error{constructor(Z){super(Z);this.name="AbortError"}};m6=class m6 extends Error{filePath;defaultConfig;constructor(Z,$,X){super(Z);this.name="ConfigParseError",this.filePath=$,this.defaultConfig=X}};c6=class c6 extends Error{stdout;stderr;code;interrupted;constructor(Z,$,X,J){super("Shell command failed");this.stdout=Z;this.stderr=$;this.code=X;this.interrupted=J;this.name="ShellError"}};d6=class d6 extends Error{formattedMessage;constructor(Z,$){super(Z);this.formattedMessage=$;this.name="TeleportOperationError"}};u6=class u6 extends Error{telemetryMessage;constructor(Z,$){super(Z);this.name="TelemetrySafeError",this.telemetryMessage=$??Z}}});
44
+ export{l as nga,n as oga,EZ as pga,z8 as qga,K8 as rga,G8 as sga,pZ as tga,bZ as uga,O1 as vga,v6 as wga,g6 as xga,M1 as yga,_2 as zga,m6 as Aga,c6 as Bga,d6 as Cga,u6 as Dga,f2 as Ega,b2 as Fga,l6 as Gga,C1 as Hga,h2 as Iga,v2 as Jga,g2 as Kga,m2 as Lga,c2 as Mga,p6 as Nga};
@@ -0,0 +1,2 @@
1
+ import{Zma as q}from"./cli-0.5.7-258ytmbr.mjs";function x(k){j=[k,...j.slice(0,v-1)]}function y(){return j}var j,v=20;var w=q(()=>{j=[]});
2
+ export{x as Uc,y as Vc,w as Wc};
@@ -0,0 +1,2 @@
1
+ import{Vt as C,Yt as X}from"./cli-0.5.7-q2e6xpch.mjs";import{SY as W}from"./cli-0.5.7-8sbq2qed.mjs";import{K1 as J,R1 as V,y1 as I}from"./cli-0.5.7-8ychjqct.mjs";import{Bda as H,Wda as T}from"./cli-0.5.7-35yf0b84.mjs";import{Vma as P,Zma as Q}from"./cli-0.5.7-258ytmbr.mjs";function v(){let K=C((q)=>q.mainLoopModel),N=C((q)=>q.mainLoopModelForSession),[,O]=z.useReducer((q)=>q+1,0);return z.useEffect(()=>H(O),[]),J(N??K??I())}var z;var Y=Q(()=>{T();X();V();z=P(W(),1)});
2
+ export{v as Yb,Y as Zb};
@@ -0,0 +1,4 @@
1
+ import{FP as jJ,GP as ZV,cj as cJ,hH as IJ,hP as TJ,iH as BJ,jH as pJ,vh as DJ,xh as dJ}from"./cli-0.5.7-q2e6xpch.mjs";import{B6 as L,Haa as NJ,J$ as WJ,J6 as kJ,M7 as fJ,S6 as c,T$ as uJ,T6 as PJ,V7 as qJ,Z7 as mJ,_aa as hJ,m7 as VJ,o7 as p}from"./cli-0.5.7-469r2a5r.mjs";import{Zda as j,_da as zJ}from"./cli-0.5.7-sjx0wm99.mjs";import{Nea as f,Pea as gJ}from"./cli-0.5.7-26pwg6gg.mjs";import{Bfa as JJ,Ffa as bJ,Pfa as Q,Sfa as yJ}from"./cli-0.5.7-twqt7rxq.mjs";import{Gga as e,Nga as SJ}from"./cli-0.5.7-skfm51ta.mjs";import{nia as AJ,oia as wJ}from"./cli-0.5.7-hp25yk8y.mjs";import{Vma as LJ,Zma as XJ}from"./cli-0.5.7-258ytmbr.mjs";class d{paths=[];lowerPaths=[];charBits=new Int32Array(0);pathLens=new Uint16Array(0);topLevelCache=null;readyCount=0;loadFromFileList(J){let W=new Set,Z=[];for(let V of J)if(V.length>0&&!W.has(V))W.add(V),Z.push(V);this.buildIndex(Z)}loadFromFileListAsync(J){let W=()=>{},Z=new Promise((Y)=>{W=Y}),V=this.buildAsync(J,W);return{queryable:Z,done:V}}async buildAsync(J,W){let Z=new Set,V=[],Y=performance.now();for(let $=0;$<J.length;$++){let _=J[$];if(_.length>0&&!Z.has(_))Z.add(_),V.push(_);if(($&255)===255&&performance.now()-Y>4)await y(),Y=performance.now()}this.resetArrays(V),Y=performance.now();let H=!0;for(let $=0;$<V.length;$++)if(this.indexPath($),($&255)===255&&performance.now()-Y>4){if(this.readyCount=$+1,H)W(),H=!1;await y(),Y=performance.now()}this.readyCount=V.length,W()}buildIndex(J){this.resetArrays(J);for(let W=0;W<J.length;W++)this.indexPath(W);this.readyCount=J.length}resetArrays(J){let W=J.length;this.paths=J,this.lowerPaths=Array(W),this.charBits=new Int32Array(W),this.pathLens=new Uint16Array(W),this.readyCount=0,this.topLevelCache=CJ(J,100)}indexPath(J){let W=this.paths[J].toLowerCase();this.lowerPaths[J]=W;let Z=W.length;this.pathLens[J]=Z;let V=0;for(let Y=0;Y<Z;Y++){let H=W.charCodeAt(Y);if(H>=97&&H<=122)V|=1<<H-97}this.charBits[J]=V}search(J,W){if(W<=0)return[];if(J.length===0){if(this.topLevelCache)return this.topLevelCache.slice(0,W);return[]}let Z=J!==J.toLowerCase(),V=Z?J:J.toLowerCase(),Y=Math.min(V.length,64),H=Array(Y),$=0;for(let M=0;M<Y;M++){let B=V.charAt(M);H[M]=B;let E=B.charCodeAt(0);if(E>=97&&E<=122)$|=1<<E-97}let _=Y*24+8+32,X=[],N=-1/0,{paths:D,lowerPaths:q,charBits:x,pathLens:U,readyCount:m}=this;J:for(let M=0;M<m;M++){if((x[M]&$)!==$)continue;let B=Z?D[M]:q[M],E=B.indexOf(H[0]);if(E===-1)continue;b[0]=E;let R=0,g=0,u=E;for(let A=1;A<Y;A++){if(E=B.indexOf(H[A],u+1),E===-1)continue J;b[A]=E;let F=E-u-1;if(F===0)g+=4;else R+=3+F*1;u=E}if(X.length===W&&_+g-R<=N)continue;let S=D[M],UJ=U[M],T=Y*16+g-R;T+=HJ(S,b[0],!0);for(let A=1;A<Y;A++)T+=HJ(S,b[A],!1);if(T+=Math.max(0,32-(UJ>>2)),X.length<W){if(X.push({path:S,fuzzScore:T}),X.length===W)X.sort((A,F)=>A.fuzzScore-F.fuzzScore),N=X[0].fuzzScore}else if(T>N){let A=0,F=X.length;while(A<F){let h=A+F>>1;if(X[h].fuzzScore<T)A=h+1;else F=h}X.splice(A,0,{path:S,fuzzScore:T}),X.shift(),N=X[0].fuzzScore}}X.sort((M,B)=>B.fuzzScore-M.fuzzScore);let I=X.length,w=Math.max(I,1),z=Array(I);for(let M=0;M<I;M++){let B=X[M].path,E=M/w,R=B.includes("test")?Math.min(E*1.05,1):E;z[M]={path:B,score:R}}return z}}function HJ(J,W,Z){if(W===0)return Z?8:0;let V=J.charCodeAt(W-1);if(vJ(V))return 8;if(GJ(V)&&RJ(J.charCodeAt(W)))return 6;return 0}function vJ(J){return J===47||J===92||J===45||J===95||J===46||J===32}function GJ(J){return J>=97&&J<=122}function RJ(J){return J>=65&&J<=90}function y(){return new Promise((J)=>setImmediate(J))}function CJ(J,W){let Z=new Set;for(let Y of J){let H=Y.length;for(let _=0;_<Y.length;_++){let X=Y.charCodeAt(_);if(X===47||X===92){H=_;break}}let $=Y.slice(0,H);if($.length>0){if(Z.add($),Z.size>=W)break}}let V=Array.from(Z);return V.sort((Y,H)=>{let $=Y.length-H.length;if($!==0)return $;return Y<H?-1:Y>H?1:0}),V.slice(0,W).map((Y)=>({path:Y,score:0}))}var _J=4,b;var QJ=XJ(()=>{b=new Int32Array(64)});import{statSync as lJ}from"fs";import*as O from"path";function l(){if(!K)K=new d;return K}function UV(){K=null,v=null,G++,k=null,C=[],ZJ=[],$J=[],YJ.clear(),n=null,s=null,o=0,a=null,i=null,P=null}function xJ(J){let W=J.length,Z=Math.max(1,Math.floor(W/500)),V=-2128831035;for(let Y=0;Y<W;Y+=Z){let H=J[Y];for(let $=0;$<H.length;$++)V=(V^H.charCodeAt($))*16777619|0;V=V*16777619|0}if(W>0){let Y=J[W-1];for(let H=0;H<Y.length;H++)V=(V^Y.charCodeAt(H))*16777619|0}return`${W}:${(V>>>0).toString(16)}`}function nJ(){let J=VJ(j());if(!J)return null;try{return lJ(O.join(J,".git","index")).mtimeMs}catch{return null}}function MJ(J,W,Z){if(Z===W)return J;return J.map((V)=>{let Y=O.join(W,V);return O.relative(Z,Y)})}async function sJ(J){if(J.length===0)return;if(!K||C.length===0)return;let W=await FJ(J),Z=[...C,...ZJ,...$J,...J,...W],V=xJ(Z);if(V===P){Q("[FileIndex] skipped index rebuild — merged paths unchanged");return}await K.loadFromFileListAsync(Z).done,P=V,Q(`[FileIndex] rebuilt index with ${C.length} tracked + ${J.length} untracked files`)}async function OJ(J,W){let Z=`${J}:${W}`;if(s===Z)return n;let V=JJ(),Y=[".ignore",".rgignore"],H=[...new Set([J,W])],$=KJ.default(),_=!1,X=H.flatMap((q)=>Y.map((x)=>O.join(q,x))),N=await Promise.all(X.map((q)=>V.readFile(q,{encoding:"utf8"}).catch(()=>null)));for(let[q,x]of N.entries()){if(x===null)continue;$.add(x),_=!0,Q(`[FileIndex] loaded ignore patterns from ${X[q]}`)}let D=_?$:null;return n=D,s=Z,D}async function oJ(J,W){let Z=Date.now();Q("[FileIndex] getFilesUsingGit called");let V=VJ(j());if(!V)return Q("[FileIndex] not a git repo, returning null"),null;try{let Y=j(),H=Date.now(),$=await c(p(),["-c","core.quotepath=false","ls-files","--recurse-submodules"],{timeout:5000,abortSignal:J,cwd:V});if(Q(`[FileIndex] git ls-files (tracked) took ${Date.now()-H}ms`),$.code!==0)return Q(`[FileIndex] git ls-files failed (code=${$.code}, stderr=${$.stderr}), falling back to ripgrep`),null;let _=$.stdout.trim().split(`
2
+ `).filter(Boolean),X=MJ(_,V,Y),N=await OJ(V,Y);if(N){let q=X.length;X=N.filter(X),Q(`[FileIndex] applied ignore patterns: ${q} -> ${X.length} files`)}C=X;let D=Date.now()-Z;if(Q(`[FileIndex] git ls-files: ${X.length} tracked files in ${D}ms`),f("tengu_file_suggestions_git_ls_files",{file_count:X.length,tracked_count:X.length,untracked_count:0,duration_ms:D}),!k){let q=W?["-c","core.quotepath=false","ls-files","--others","--exclude-standard"]:["-c","core.quotepath=false","ls-files","--others"],x=G;k=c(p(),q,{timeout:1e4,cwd:V}).then(async(U)=>{if(x!==G)return;if(U.code===0){let m=U.stdout.trim().split(`
3
+ `).filter(Boolean),I=MJ(m,V,Y),w=await OJ(V,Y);if(w&&I.length>0){let z=I.length;I=w.filter(I),Q(`[FileIndex] applied ignore patterns to untracked: ${z} -> ${I.length} files`)}Q(`[FileIndex] background untracked fetch: ${I.length} files`),sJ(I)}}).catch((U)=>{Q(`[FileIndex] background untracked fetch failed: ${U}`)}).finally(()=>{k=null})}return X}catch(Y){return Q(`[FileIndex] git ls-files error: ${e(Y)}`),null}}async function FJ(J){let W=new Set,Z=performance.now();for(let V=0;V<J.length;V++)if(aJ(J,V,V+1,W),(V&255)===255&&performance.now()-Z>_J)await y(),Z=performance.now();return[...W].map((V)=>V+O.sep)}function aJ(J,W,Z,V){for(let Y=W;Y<Z;Y++){let H=O.dirname(J[Y]);while(H!=="."&&!V.has(H)){let $=O.dirname(H);if($===H)break;V.add(H),H=$}}}async function iJ(J){return(await Promise.all(IJ.map((Z)=>BJ(Z,J)))).flatMap((Z)=>Z.map((V)=>V.filePath))}async function rJ(J,W){Q(`[FileIndex] getProjectFiles called, respectGitignore=${W}`);let Z=await oJ(J,W);if(Z!==null)return Q(`[FileIndex] using git ls-files result (${Z.length} files)`),Z;Q("[FileIndex] git ls-files returned null, falling back to ripgrep");let V=Date.now(),Y=["--files","--follow","--hidden","--glob","!.git/","--glob","!.svn/","--glob","!.hg/","--glob","!.bzr/","--glob","!.jj/","--glob","!.sl/"];if(!W)Y.push("--no-ignore-vcs");let $=(await DJ(Y,".",J)).map((X)=>O.relative(j(),X)),_=Date.now()-V;return Q(`[FileIndex] ripgrep: ${$.length} files in ${_}ms`),f("tengu_file_suggestions_ripgrep",{file_count:$.length,duration_ms:_}),$}async function tJ(){let J=AbortSignal.timeout(1e4),W=l();try{let Z=WJ(),V=NJ(),Y=Z.respectGitignore??V.respectGitignore??!0,H=j(),[$,_]=await Promise.all([rJ(J,Y),iJ(H)]);ZJ=_;let X=[...$,..._],N=await FJ(X);$J=N;let D=[...N,...X],q=xJ(D);if(q!==i)await W.loadFromFileListAsync(D).done,i=q,P=null;else Q("[FileIndex] skipped index rebuild — tracked paths unchanged")}catch(Z){L(Z)}return W}function eJ(J,W){let Z=Math.min(J.length,W.length),V=0;while(V<Z&&J[V]===W[V])V++;return J.substring(0,V)}function vV(J){if(J.length===0)return"";let W=J.map((V)=>V.displayText),Z=W[0];for(let V=1;V<W.length;V++){let Y=W[V];if(Z=eJ(Z,Y),Z==="")return""}return Z}function r(J,W){return{id:`file-${J}`,displayText:J,metadata:W!==void 0?{score:W}:void 0}}function JV(J,W){return J.search(W,t).map((V)=>r(V.path,V.score))}function EJ(){if(v)return;let J=nJ();if(K){if(!(J!==null&&J!==a)&&Date.now()-o<VV)return}let W=G,Z=Date.now();l(),v=tJ().then((V)=>{if(W!==G)return V;return v=null,YJ.emit(),a=J,o=Date.now(),Q(`[FileIndex] cache refresh completed in ${Date.now()-Z}ms`),V}).catch((V)=>{if(Q(`[FileIndex] Cache refresh failed: ${e(V)}`),L(V),W===G)v=null;return l()})}async function WV(){let J=JJ(),W=j();try{return(await J.readdir(W)).map((V)=>{let Y=O.join(W,V.name),H=O.relative(W,Y);return V.isDirectory()?H+O.sep:H})}catch(Z){return L(Z),[]}}async function GV(J,W=!1){if(!J&&!W)return[];if(WJ().fileSuggestion?.type==="command"){let V={...TJ(),query:J};return(await jJ(V)).slice(0,t).map(r)}if(J===""||J==="."||J==="./"){let V=await WV();return EJ(),V.slice(0,t).map(r)}let Z=Date.now();try{let V=v!==null;EJ();let Y=J,H="."+O.sep;if(J.startsWith(H))Y=J.substring(2);if(Y.startsWith("~"))Y=qJ(Y);let $=K?JV(K,Y):[],_=Date.now()-Z;return Q(`[FileIndex] generateFileSuggestions: ${$.length} results in ${_}ms (${V?"partial":"full"} index)`),f("tengu_file_suggestions_query",{duration_ms:_,cache_hit:!V,result_count:$.length,query_length:J.length}),$}catch(V){return L(V),[]}}function RV(J,W,Z,V,Y,H){let $=typeof J==="string"?J:J.displayText,_=W.substring(0,V)+$+W.substring(V+Z.length);Y(_);let X=V+$.length;H(X)}var KJ,K=null,v=null,YJ,jV,G=0,k=null,C,ZJ,$J,n=null,s=null,o=0,a=null,i=null,P=null,t=15,VV=5000;var YV=XJ(()=>{pJ();QJ();gJ();hJ();zJ();yJ();SJ();PJ();bJ();fJ();ZV();kJ();mJ();dJ();uJ();wJ();KJ=LJ(cJ(),1);YJ=AJ(),jV=YJ.subscribe,C=[],ZJ=[],$J=[]});
4
+ export{jV as Dg,UV as Eg,vV as Fg,EJ as Gg,GV as Hg,RV as Ig,YV as Jg};
@@ -0,0 +1,2 @@
1
+ import{Zma as f}from"./cli-0.5.7-258ytmbr.mjs";function j(q){return typeof q==="number"&&Number.isFinite(q)?q:0}function V(q,z){let B=q;for(let K of z){if(B==null||typeof B!=="object")return;B=B[K]}return B}function k(q){if(!q)return!1;let z="";try{z=new URL(q).hostname.toLowerCase()}catch{}if(!z){let W=q.toLowerCase();return W.includes("localhost")||W.includes("127.0.0.1")||W.includes("::1")}let B=z.startsWith("[")&&z.endsWith("]")?z.slice(1,-1):z;if(B==="localhost"||B.endsWith(".localhost")||B.endsWith(".local")||B.endsWith(".lan")||B.endsWith(".internal")||B.endsWith(".intranet")||B.endsWith(".home.arpa"))return!0;let K=B.match(x);if(K){let W=Number(K[1]),$=Number(K[2]);if(W===10)return!0;if(W===172&&$>=16&&$<=31)return!0;if(W===192&&$===168)return!0;if(W===127)return!0;if(W===169&&$===254)return!0;if(W===100&&$>=64&&$<=127)return!0}if(B==="::1"||B==="::")return!0;if(B.startsWith("fe80:")||L.test(B)||Y.test(B))return!0;return!1}function C(q,z){if(q==="github")return z?.githubNativeAnthropic?"copilot-claude":"copilot";if(q==="firstParty"||q==="bedrock"||q==="vertex"||q==="foundry")return"anthropic";if(q==="gemini")return"gemini";if(q==="codex")return"codex";if(q==="openai"){let B=z?.openAiBaseUrl??"";if(k(B))return"self-hosted";let K=B.toLowerCase();if(K.includes(":11434"))return"ollama";if(K.includes("moonshot")||K.includes("kimi"))return"kimi";if(K.includes("deepseek"))return"deepseek";return"openai"}return"openai"}function A(q){if(!q||typeof q!=="object")return 0;let z=q,B=j(z.cache_read_input_tokens);if(B>0)return B;let K=j(V(q,["input_tokens_details","cached_tokens"]))||j(V(q,["prompt_tokens_details","cached_tokens"]));if(K>0)return K;let W=j(z.cached_tokens);if(W>0)return W;let $=j(z.prompt_cache_hit_tokens);if($>0)return $;let Q=j(z.cached_content_token_count);if(Q>0)return Q;return 0}function M(q){let z=A(q),B=q??{},K=j(B.input_tokens)||j(B.prompt_tokens),W=K>=z?K-z:K,$=j(B.output_tokens)||j(B.completion_tokens);return{input_tokens:W,output_tokens:$,cache_creation_input_tokens:0,cache_read_input_tokens:z}}function U(q,z){if(!q||typeof q!=="object")return G;let B=q,K=j(B.cache_read_input_tokens),W=j(B.cache_creation_input_tokens),$=j(B.input_tokens);if(z==="copilot"||z==="ollama")return G;if(z==="self-hosted"&&K===0&&W===0)return G;let Q=K+W+$;return{read:K,created:W,total:Q,hitRate:Q>0?Math.min(1,K/Q):null,supported:!0}}function w(q){if(!q)return"[Cache: N/A]";if(!q.supported)return"[Cache: N/A]";if(q.read===0&&q.created===0)return"[Cache: cold]";let z=[`${H(q.read)} read`];if(q.hitRate!==null)z.push(`hit ${Math.round(q.hitRate*100)}%`);return`[Cache: ${z.join(" • ")}]`}function I(q){if(!q)return"[Cache: N/A]";if(!q.supported)return"[Cache: N/A]";let z=[`read=${H(q.read)}`,`created=${H(q.created)}`];if(q.hitRate!==null)z.push(`hit=${Math.round(q.hitRate*100)}%`);else z.push("hit=n/a");return`[Cache: ${z.join(" ")}]`}function H(q){if(q<1000)return String(q);if(q<1e6)return`${(q/1000).toFixed(1).replace(F,"")}k`;return`${(q/1e6).toFixed(1).replace(F,"")}m`}function Z(q,z){if(!q.supported&&!z.supported)return G;if(!q.supported)return z;if(!z.supported)return q;let B=q.read+z.read,K=q.created+z.created,W=q.total+z.total;return{read:B,created:K,total:W,hitRate:W>0?B/W:null,supported:!0}}var G,x,L,Y,F;var y=f(()=>{G={read:0,created:0,total:0,hitRate:null,supported:!1};x=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,L=/^fc[0-9a-f]{0,2}:/,Y=/^fd[0-9a-f]{0,2}:/,F=/\.0$/});function O(q){return{currentTurn:X,session:X,history:Array(q),historyWriteIdx:0,historySize:0,historyMax:q}}function _(q,z){J.currentTurn=Z(J.currentTurn,q),J.session=Z(J.session,q);let B={timestamp:Date.now(),label:z,metrics:q};if(J.history[J.historyWriteIdx]=B,J.historyWriteIdx=(J.historyWriteIdx+1)%J.historyMax,J.historySize<J.historyMax)J.historySize++}function E(){J.currentTurn=X}function g(){J.currentTurn=X,J.session=X,J.history=Array(J.historyMax),J.historyWriteIdx=0,J.historySize=0}function N(){return J.currentTurn}function R(){return J.session}function b(){if(J.historySize<J.historyMax)return J.history.slice(0,J.historySize);let q=J.history.slice(J.historyWriteIdx),z=J.history.slice(0,J.historyWriteIdx);return q.concat(z)}var D=500,X,J;var S=f(()=>{y();X={read:0,created:0,total:0,hitRate:null,supported:!1};J=O(D)});
2
+ export{C as mU,M as nU,U as oU,w as pU,I as qU,y as rU,_ as sU,E as tU,g as uU,N as vU,R as wU,b as xU,S as yU};
@@ -0,0 +1,2 @@
1
+ import{A3 as v,B3 as C}from"./cli-0.5.7-8ychjqct.mjs";import{F5 as Z,X5 as V}from"./cli-0.5.7-yzncgfs4.mjs";import{Eba as x,Fba as Y,w6 as W,x6 as O}from"./cli-0.5.7-469r2a5r.mjs";import{Kda as P,Oda as Q,Wda as H}from"./cli-0.5.7-35yf0b84.mjs";import{Lea as X,Mea as U}from"./cli-0.5.7-xepvraxn.mjs";import{Pfa as f,Sfa as M,sfa as R,xfa as L}from"./cli-0.5.7-twqt7rxq.mjs";import{Gga as w,Nga as I}from"./cli-0.5.7-skfm51ta.mjs";import{Hma as N,Ima as F}from"./cli-0.5.7-m4wwfa6q.mjs";import{Wma as h,Zma as B}from"./cli-0.5.7-258ytmbr.mjs";import{hostname as E}from"os";function $(){return P(G,!1)}function u(){if(!$())return;return y()}function n(){y.cache?.clear?.()}function o(){if(!$())return;let i=x();try{let q=i.read();if(q?.trustedDeviceToken)delete q.trustedDeviceToken,i.update(q)}catch{}y.cache?.clear?.()}async function t(){try{if(!await Q(G)){f(`[trusted-device] Gate ${G} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){f("[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)");return}let{getClaudeAIOAuthTokens:i}=(C(),h(v)),q=i()?.accessToken;if(!q){f("[trusted-device] No OAuth token, skipping enrollment");return}let J=x();if(W()){f("[trusted-device] Essential traffic only, skipping enrollment");return}let b=X().BASE_API_URL,m;try{m=await Z.post(`${b}/api/auth/trusted_devices`,{display_name:`Claude Code on ${E()} · ${process.platform}`},{headers:{Authorization:`Bearer ${q}`,"Content-Type":"application/json"},timeout:1e4,validateStatus:(j)=>j<500})}catch(j){f(`[trusted-device] Enrollment request failed: ${w(j)}`);return}if(m.status!==200&&m.status!==201){f(`[trusted-device] Enrollment failed ${m.status}: ${R(m.data).slice(0,200)}`);return}let z=m.data?.device_token;if(!z||typeof z!=="string"){f("[trusted-device] Enrollment response missing device_token field");return}try{let j=J.read();if(!j){f("[trusted-device] Cannot read storage, skipping token persist");return}j.trustedDeviceToken=z;let K=J.update(j);if(!K.success){f(`[trusted-device] Failed to persist token: ${K.warning??"unknown"}`);return}y.cache?.clear?.(),f(`[trusted-device] Enrolled device_id=${m.data.device_id??"unknown"}`)}catch(j){f(`[trusted-device] Storage write failed: ${w(j)}`)}}catch(i){f(`[trusted-device] Enrollment error: ${w(i)}`)}}var G="tengu_sessions_elevated_auth_enforcement",y;var d=B(()=>{V();F();U();H();M();I();O();Y();L();y=N(()=>{let i=process.env.CLAUDE_TRUSTED_DEVICE_TOKEN;if(i)return i;return x().read()?.trustedDeviceToken})});
2
+ export{u as gQ,n as hQ,o as iQ,t as jQ,d as kQ};
@@ -0,0 +1,2 @@
1
+ import{$fa as z,mga as W}from"./cli-0.5.7-tqn2ged5.mjs";import{Iga as G,Nga as X}from"./cli-0.5.7-skfm51ta.mjs";W();X();import{readFileSync as Y}from"node:fs";import{mkdir as Z,writeFile as Q}from"node:fs/promises";import{join as $}from"node:path";var k="latest-version.json";function R(){return $(z(),k)}function B(x){if(!x||typeof x!=="object")return!1;let q=x;return typeof q.latest==="string"&&q.latest.length>0&&typeof q.current==="string"&&q.current.length>0&&typeof q.checkedAt==="number"&&Number.isFinite(q.checkedAt)}function V(){try{let x=Y(R(),"utf8"),q=JSON.parse(x);return B(q)?q:null}catch(x){if(G(x))return null;return null}}async function _(x){let q=R(),J=JSON.stringify(x);try{await Q(q,J,"utf8")}catch(K){if(G(K)){await Z(z(),{recursive:!0}),await Q(q,J,"utf8");return}throw K}}
2
+ export{V as yb,_ as zb};
@@ -0,0 +1,45 @@
1
+ import{De as BY,Ee as Bz}from"./cli-0.5.7-q6sgd9ng.mjs";import{Jf as qY,Kf as qz}from"./cli-0.5.7-jf3f8gen.mjs";import{gg as $Y,hg as yz,ig as cY,jg as mz}from"./cli-0.5.7-31hdc2nc.mjs";import{$l as NJ,DN as lY,HD as B0,ID as MY,KG as GY,LO as nY,OG as Gz,OO as XJ,PO as GZ,QO as X0,Sr as eY,Tr as JK,Xl as UJ,Yl as UY,Zl as AJ,_l as XY,am as VY,eP as V0,kF as hY,lF as Tz,nO as dY,up as Zz,vp as KK,xD as uY,yD as wz,yL as gY,zL as Lz}from"./cli-0.5.7-q2e6xpch.mjs";import{AT as jz,zT as SY}from"./cli-0.5.7-yaywev87.mjs";import{AU as Az,NU as $J,PU as KY,VU as pY,WU as Fz,zU as _Y}from"./cli-0.5.7-7a9gq9ff.mjs";import{AV as LY,FW as fY,GV as IY,HV as Rz,HW as Ez,KW as b,MW as N,eX as xY,oW as bY,pX as U0,rV as f0}from"./cli-0.5.7-x1w96j6d.mjs";import{PY as U,QY as m,RY as bJ}from"./cli-0.5.7-vgc7nzef.mjs";import{SY as b0}from"./cli-0.5.7-8sbq2qed.mjs";import{R1 as ez,p1 as tY}from"./cli-0.5.7-8ychjqct.mjs";import{X3 as $0,Y3 as Mz}from"./cli-0.5.7-xn6deh04.mjs";import{B6 as r0,J6 as yY,M7 as Nz,r8 as l0,t8 as tz,u7 as mY,y6 as fJ}from"./cli-0.5.7-469r2a5r.mjs";import{Pca as S0,Qca as Hz,Sca as G0,bda as zY,cda as c0,fda as I0}from"./cli-0.5.7-5mrw857q.mjs";import{Nea as $,Pea as Cz}from"./cli-0.5.7-26pwg6gg.mjs";import{Pfa as CJ,Sfa as oz,tfa as oY,xfa as sz}from"./cli-0.5.7-twqt7rxq.mjs";import{ima as TY,ria as wY,xia as H0}from"./cli-0.5.7-hp25yk8y.mjs";import{Vma as UZ,Zma as XZ}from"./cli-0.5.7-258ytmbr.mjs";function QY(Z){let J=HY.c(33),{log:K,onExit:B,onSelect:G}=Z,[Q,v]=L0.default.useState(null),F,T;if(J[0]!==K)F=()=>{if(v(null),GZ(K))X0(K).then(v)},T=[K],J[0]=K,J[1]=F,J[2]=T;else F=J[1],T=J[2];L0.default.useEffect(F,T);let i=GZ(K)&&Q===null,X=Q??K,W;if(J[3]!==X)W=XJ(X)||"",J[3]=X,J[4]=W;else W=J[4];let O=W,S;if(J[5]===Symbol.for("react.memo_cache_sentinel"))S=GY(),J[5]=S;else S=J[5];let C=S,JJ;if(J[6]===Symbol.for("react.memo_cache_sentinel"))JJ={context:"Confirmation"},J[6]=JJ;else JJ=J[6];$J("confirm:no",B,JJ);let L;if(J[7]!==Q||J[8]!==K||J[9]!==G)L=()=>{G(Q??K)},J[7]=Q,J[8]=K,J[9]=G,J[10]=L;else L=J[10];let f=L,E;if(J[11]===Symbol.for("react.memo_cache_sentinel"))E={context:"Confirmation"},J[11]=E;else E=J[11];if($J("confirm:yes",f,E),i){let c;if(J[12]===Symbol.for("react.memo_cache_sentinel"))c=U(qY,{message:"Loading session…"}),J[12]=c;else c=J[12];let BJ;if(J[13]===Symbol.for("react.memo_cache_sentinel"))BJ=m(b,{flexDirection:"column",padding:1,children:[c,U(N,{dimColor:!0,children:U(NJ,{children:U(AJ,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})})})]}),J[13]=BJ;else BJ=J[13];return BJ}let y;if(J[14]===Symbol.for("react.memo_cache_sentinel"))y=[],J[14]=y;else y=J[14];let w,r;if(J[15]===Symbol.for("react.memo_cache_sentinel"))r=[],w=new Set,J[15]=w,J[16]=r;else w=J[15],r=J[16];let p;if(J[17]===Symbol.for("react.memo_cache_sentinel"))p=[],J[17]=p;else p=J[17];let l;if(J[18]!==O||J[19]!==X.messages)l=U(BY,{messages:X.messages,tools:C,commands:y,verbose:!0,toolJSX:null,toolUseConfirmQueue:r,inProgressToolUseIDs:w,isMessageSelectorVisible:!1,conversationId:O,screen:"transcript",streamingToolUses:p,showAllInTranscript:!0,isLoading:!1}),J[18]=O,J[19]=X.messages,J[20]=l;else l=J[20];let s;if(J[21]!==X.modified)s=zY(X.modified),J[21]=X.modified,J[22]=s;else s=J[22];let o=X.gitBranch?` · ${X.gitBranch}`:"",_;if(J[23]!==X.messageCount||J[24]!==s||J[25]!==o)_=m(N,{children:[s," ·"," ",X.messageCount," messages",o]}),J[23]=X.messageCount,J[24]=s,J[25]=o,J[26]=_;else _=J[26];let VJ;if(J[27]===Symbol.for("react.memo_cache_sentinel"))VJ=U(N,{dimColor:!0,children:m(NJ,{children:[U(UJ,{shortcut:"Enter",action:"resume"}),U(AJ,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}),J[27]=VJ;else VJ=J[27];let M;if(J[28]!==_)M=m(b,{flexShrink:0,flexDirection:"column",borderTopDimColor:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,borderStyle:"single",paddingLeft:2,children:[_,VJ]}),J[28]=_,J[29]=M;else M=J[29];let jJ;if(J[30]!==l||J[31]!==M)jJ=m(b,{flexDirection:"column",children:[l,M]}),J[30]=l,J[31]=M,J[32]=jJ;else jJ=J[32];return jJ}var HY,L0;var OY=XZ(()=>{U0();KY();Gz();I0();V0();XY();VY();UY();qz();Bz();bJ();HY=UZ(f0(),1),L0=UZ(b0(),1)});function Dz(Z,J){if(Z===x0)return x0.length+qZ;let K=S0(Z),B=J?Math.min(K,J-qZ-_0):K;return Math.max(0,B)+qZ+_0}function kz(Z,J){let K=J-qZ-_0;if(S0(Z)<=K)return Z;if(K<=1)return Z.charAt(0);return G0(Z,K)}function NY({tabs:Z,selectedIndex:J,availableWidth:K,showAllProjects:B=!1}){let G=B?"Resume (All Projects)":"Resume",Q=G.length+1,v=Math.max(Oz,Pz),F=K-Q-v-2,T=Math.max(0,Math.min(J,Z.length-1)),i=Math.max(20,Math.floor(F/2)),X=Z.map((E)=>Dz(E,i)),W=0,O=Z.length;if(X.reduce((E,y,w)=>E+y+(w<X.length-1?1:0),0)>F){let E=F-Qz,y=X[T]??0;W=T,O=T+1;while(W>0||O<Z.length){let w=W>0,r=O<Z.length;if(w){let p=(X[W-1]??0)+1;if(y+p<=E){W--,y+=p;continue}}if(r){let p=(X[O]??0)+1;if(y+p<=E){O++,y+=p;continue}}break}}let C=W,JJ=Z.length-O,L=Z.slice(W,O),f=L.map((E,y)=>W+y);return m(b,{flexDirection:"row",gap:1,children:[U(N,{color:"suggestion",children:G}),C>0&&m(N,{dimColor:!0,children:[PY,C]}),L.map((E,y)=>{let r=f[y]===T,p=E===x0?E:`#${kz(E,i-qZ)}`;return m(N,{backgroundColor:r?"suggestion":void 0,color:r?"inverseText":void 0,bold:r,children:[" ",p," "]},E)}),JJ>0?m(N,{dimColor:!0,children:[DY,JJ,kY]}):U(N,{dimColor:!0,children:WY})]})}var x0="All",qZ=2,_0=1,PY="← ",DY="→",kY=" (tab to cycle)",WY="(tab to cycle)",vY=2,Qz,Oz,Pz;var CY=XZ(()=>{Hz();U0();I0();bJ();Qz=PY.length+vY+1,Oz=DY.length+vY+kY.length,Pz=WY.length});function EY(Z){let J=RY.c(48),{nodes:K,onSelect:B,onCancel:G,onFocus:Q,focusNodeId:v,visibleOptionCount:F,layout:T,isDisabled:i,hideIndexes:X,isNodeExpanded:W,onExpand:O,onCollapse:S,getParentPrefix:C,getChildPrefix:JJ,onUpFromFirstItem:L}=Z,f=T===void 0?"expanded":T,E=i===void 0?!1:i,y=X===void 0?!1:X,w;if(J[0]===Symbol.for("react.memo_cache_sentinel"))w=new Set,J[0]=w;else w=J[0];let[r,p]=q0.default.useState(w),l=q0.default.useRef(!1),s=q0.default.useRef(null),o;if(J[1]!==r||J[2]!==W)o=(H)=>{if(W)return W(H);return r.has(H)},J[1]=r,J[2]=W,J[3]=o;else o=J[3];let _=o,VJ;if(J[4]!==_||J[5]!==K){let H=function(k,qJ,TJ){let xJ=!!k.children&&k.children.length>0,_J=_(k.id);if(VJ.push({node:k,depth:qJ,isExpanded:_J,hasChildren:xJ,parentId:TJ}),xJ&&_J&&k.children)for(let V of k.children)H(V,qJ+1,k.id)};VJ=[];for(let k of K)H(k,0);J[4]=_,J[5]=K,J[6]=VJ}else VJ=J[6];let M=VJ,jJ=vz,c=Wz,BJ=C??jJ,d=JJ??c,cJ;if(J[7]!==d||J[8]!==BJ)cJ=(H)=>{let k="";if(H.hasChildren)k=BJ(H.isExpanded);else if(H.depth>0)k=d(H.depth);return k+H.node.label},J[7]=d,J[8]=BJ,J[9]=cJ;else cJ=J[9];let n=cJ,gJ;if(J[10]!==n||J[11]!==M)gJ=M.map((H)=>({label:n(H),description:H.node.description,dimDescription:H.node.dimDescription??!0,value:H.node.id})),J[10]=n,J[11]=M,J[12]=gJ;else gJ=J[12];let FJ=gJ,MJ;if(J[13]!==M)MJ=new Map,M.forEach((H)=>MJ.set(H.node.id,H.node)),J[13]=M,J[14]=MJ;else MJ=J[14];let g=MJ,HJ;if(J[15]!==M)HJ=(H)=>M.find((k)=>k.node.id===H),J[15]=M,J[16]=HJ;else HJ=J[16];let QJ=HJ,iJ;if(J[17]!==QJ||J[18]!==S||J[19]!==O)iJ=(H,k)=>{let qJ=QJ(H);if(!qJ||!qJ.hasChildren)return;if(k)if(O)O(H);else p((TJ)=>new Set(TJ).add(H));else if(S)S(H);else p((TJ)=>{let xJ=new Set(TJ);return xJ.delete(H),xJ})},J[17]=QJ,J[18]=S,J[19]=O,J[20]=iJ;else iJ=J[20];let OJ=iJ,GJ;if(J[21]!==QJ||J[22]!==v||J[23]!==E||J[24]!==g||J[25]!==Q||J[26]!==OJ)GJ=(H)=>{if(!v||E)return;let k=QJ(v);if(!k)return;if(H.key==="right"&&k.hasChildren)H.preventDefault(),OJ(v,!0);else if(H.key==="left"){if(k.hasChildren&&k.isExpanded)H.preventDefault(),OJ(v,!1);else if(k.parentId!==void 0){if(H.preventDefault(),l.current=!0,OJ(k.parentId,!1),Q){let qJ=g.get(k.parentId);if(qJ)Q(qJ)}}}},J[21]=QJ,J[22]=v,J[23]=E,J[24]=g,J[25]=Q,J[26]=OJ,J[27]=GJ;else GJ=J[27];let rJ=GJ,PJ;if(J[28]!==g||J[29]!==B)PJ=(H)=>{let k=g.get(H);if(!k)return;B(k)},J[28]=g,J[29]=B,J[30]=PJ;else PJ=J[30];let wJ=PJ,ZJ;if(J[31]!==g||J[32]!==Q)ZJ=(H)=>{if(l.current){l.current=!1;return}if(s.current===H)return;if(s.current=H,Q){let k=g.get(H);if(k)Q(k)}},J[31]=g,J[32]=Q,J[33]=ZJ;else ZJ=J[33];let lJ=ZJ,P;if(J[34]!==v||J[35]!==wJ||J[36]!==lJ||J[37]!==y||J[38]!==E||J[39]!==f||J[40]!==G||J[41]!==L||J[42]!==FJ||J[43]!==F)P=U(B0,{options:FJ,onChange:wJ,onFocus:lJ,onCancel:G,defaultFocusValue:v,visibleOptionCount:F,layout:f,isDisabled:E,hideIndexes:y,onUpFromFirstItem:L}),J[34]=v,J[35]=wJ,J[36]=lJ,J[37]=y,J[38]=E,J[39]=f,J[40]=G,J[41]=L,J[42]=FJ,J[43]=F,J[44]=P;else P=J[44];let h;if(J[45]!==rJ||J[46]!==P)h=U(b,{tabIndex:0,autoFocus:!0,onKeyDown:rJ,children:P}),J[45]=rJ,J[46]=P,J[47]=h;else h=J[47];return h}function Wz(Z){return" ▸ "}function vz(Z){return Z?"▼ ":"▶ "}var RY,q0;var AY=XZ(()=>{U0();MY();bJ();RY=UZ(f0(),1),q0=UZ(b0(),1)});function rY(Z,J){let K=Z.replace(/\s+/g," ").trim();return G0(K,J)}function p0({before:Z,match:J,after:K},B){return $0.dim(Z)+B(J)+$0.dim(K)}function Sz(Z,J,K){let B=Z.toLowerCase().indexOf(J.toLowerCase());if(B===-1)return null;let G=B+J.length,Q=Math.max(0,B-K),v=Math.min(Z.length,G+K),F=Z.slice(Q,B),T=Z.slice(B,G),i=Z.slice(G,v);return{before:(Q>0?"…":"")+F.replace(/\s+/g," ").trimStart(),match:T.trim(),after:i.replace(/\s+/g," ").trimEnd()+(v<Z.length?"…":"")}}function u0(Z,J,K){let{isGroupHeader:B=!1,isChild:G=!1,forkCount:Q=0}=K||{},v=B&&Q>0?Iz:G?bz:0,F=B&&Q>0?` (+${Q} other ${Q===1?"session":"sessions"})`:"",T=Z.isSidechain?" (sidechain)":"",i=J-v-T.length-F.length;return`${rY(fJ(Z),i)}${T}${F}`}function h0(Z,J){let{isChild:K=!1,showProjectPath:B=!1}=J||{},G=K?" ":"",Q=c0(Z),v=B&&Z.projectPath?` · ${Z.projectPath}`:"";return G+Q+v}function YU(Z){let J=iY.c(247),{logs:K,maxHeight:B,forceWidth:G,onCancel:Q,onSelect:v,onLogsChanged:F,onLoadMore:T,initialSearchQuery:i,showAllProjects:X,onToggleAllProjects:W,onAgenticSearch:O}=Z,S=B===void 0?1/0:B,C=X===void 0?!1:X,JJ=_Y(),L=G===void 0?JJ.columns:G,f=SY(Q),E=bY(),y;if(J[0]===Symbol.for("react.memo_cache_sentinel"))y=nY(),J[0]=y;else y=J[0];let w=y,r=!1,[p]=LY(),l;if(J[1]!==p)l=fY(p),J[1]=p,J[2]=l;else l=J[2];let s=l,o;if(J[3]!==s.warning)o=(Y)=>IY(Y,s.warning),J[3]=s.warning,J[4]=o;else o=J[4];let _=o,VJ=!1,[M,jJ]=R.default.useState(null),[c,BJ]=R.default.useState(!1),[d,cJ]=R.default.useState(!1),[n,gJ]=R.default.useState(!1),FJ;if(J[5]===Symbol.for("react.memo_cache_sentinel"))FJ=H0(),J[5]=FJ;else FJ=J[5];let MJ=FJ,[g,HJ]=R.default.useState(""),[QJ,iJ]=R.default.useState(0),OJ;if(J[6]===Symbol.for("react.memo_cache_sentinel"))OJ=new Set,J[6]=OJ;else OJ=J[6];let[GJ,rJ]=R.default.useState(OJ),[PJ,wJ]=R.default.useState(null),[ZJ,lJ]=R.default.useState(1),[P,h]=R.default.useState("list"),[H,k]=R.default.useState(null),qJ=R.default.useRef(null),[TJ,xJ]=R.default.useState(0),_J;if(J[7]===Symbol.for("react.memo_cache_sentinel"))_J={status:"idle"},J[7]=_J;else _J=J[7];let[V,VZ]=R.default.useState(_J),[t,BZ]=R.default.useState(!1),HZ=R.default.useRef(null),Q0=P==="search"&&V.status!=="searching",QZ,OZ,PZ;if(J[8]===Symbol.for("react.memo_cache_sentinel"))QZ=()=>{h("list"),$("tengu_session_search_toggled",{enabled:!1})},OZ=()=>{h("list"),$("tengu_session_search_toggled",{enabled:!1})},PZ=["n"],J[8]=QZ,J[9]=OZ,J[10]=PZ;else QZ=J[8],OZ=J[9],PZ=J[10];let O0=i||"",DZ;if(J[11]!==O0||J[12]!==Q0)DZ={isActive:Q0,onExit:QZ,onExitUp:OZ,passthroughCtrlKeys:PZ,initialQuery:O0},J[11]=O0,J[12]=Q0,J[13]=DZ;else DZ=J[13];let{query:A,setQuery:dJ,cursorOffset:P0}=cY(DZ),yJ=R.default.useDeferredValue(A),[YJ,d0]=R.default.useState(""),kZ,WZ;if(J[14]!==yJ)kZ=()=>{if(!yJ){d0("");return}let Y=setTimeout(d0,300,yJ);return()=>clearTimeout(Y)},WZ=[yJ],J[14]=yJ,J[15]=kZ,J[16]=WZ;else kZ=J[15],WZ=J[16];R.default.useEffect(kZ,WZ);let[mJ,n0]=R.default.useState(null),[D0,a0]=R.default.useState(!1),vZ,NZ;if(J[17]===Symbol.for("react.memo_cache_sentinel"))vZ=()=>{mY().then((Y)=>jJ(Y)),gY(MJ).then((Y)=>{gJ(Y.length>1)})},NZ=[MJ],J[17]=vZ,J[18]=NZ;else vZ=J[17],NZ=J[18];R.default.useEffect(vZ,NZ);let XK=new Map(K.map(iz)),Yz;Yz=null;let CZ;if(J[19]!==K)CZ=nz(K),J[19]=K,J[20]=CZ;else CZ=J[20];let SJ=CZ,DJ=SJ.length>0,MZ;if(J[21]!==DJ||J[22]!==SJ)MZ=DJ?["All",...SJ]:[],J[21]=DJ,J[22]=SJ,J[23]=MZ;else MZ=J[23];let zJ=MZ,RZ=zJ.length>0&&TJ<zJ.length?TJ:0,s0=zJ[RZ],nJ=s0==="All"?void 0:s0,zz=DJ?1:0,a=K;if(w){let Y;if(J[24]!==K)Y=K.filter(gz),J[24]=K,J[25]=Y;else Y=J[25];a=Y}if(nJ!==void 0){let Y;if(J[26]!==a||J[27]!==nJ){let z;if(J[29]!==nJ)z=(q)=>q.tag===nJ,J[29]=nJ,J[30]=z;else z=J[30];Y=a.filter(z),J[26]=a,J[27]=nJ,J[28]=Y}else Y=J[28];a=Y}if(c&&M){let Y;if(J[31]!==M||J[32]!==a){let z;if(J[34]!==M)z=(q)=>q.gitBranch===M,J[34]=M,J[35]=z;else z=J[35];Y=a.filter(z),J[31]=M,J[32]=a,J[33]=Y}else Y=J[33];a=Y}if(n&&!d){let Y;if(J[36]!==a){let z;if(J[38]===Symbol.for("react.memo_cache_sentinel"))z=(q)=>q.projectPath===MJ,J[38]=z;else z=J[38];Y=a.filter(z),J[36]=a,J[37]=Y}else Y=J[37];a=Y}let EZ=a,k0;J:{if(!A){k0=EZ;break J}let Y;if(J[39]!==EZ||J[40]!==A){let z=A.toLowerCase();Y=EZ.filter((q)=>{let j=fJ(q).toLowerCase(),x=(q.gitBranch||"").toLowerCase(),u=(q.tag||"").toLowerCase(),hJ=q.prNumber?`pr #${q.prNumber} ${q.prRepository||""}`.toLowerCase():"";return j.includes(z)||x.includes(z)||u.includes(z)||hJ.includes(z)}),J[39]=EZ,J[40]=A,J[41]=Y}else Y=J[41];k0=Y}let W0=k0,AZ,jZ;if(J[42]!==YJ||J[43]!==yJ)AZ=()=>{},jZ=[yJ,YJ,!1],J[42]=YJ,J[43]=yJ,J[44]=AZ,J[45]=jZ;else AZ=J[44],jZ=J[45];R.default.useEffect(AZ,jZ);let FZ,wZ;if(J[46]!==YJ)FZ=()=>{n0(null),a0(!1);return},wZ=[YJ,null,!1],J[46]=YJ,J[47]=FZ,J[48]=wZ;else FZ=J[47],wZ=J[48];R.default.useEffect(FZ,wZ);let e,pJ;if(J[49]!==YJ||J[50]!==mJ||J[51]!==W0){if(pJ=new Map,e=W0,mJ&&YJ&&mJ.query===YJ){for(let j of mJ.results)if(j.searchableText){let x=Sz(j.searchableText,YJ,_z);if(x)pJ.set(j.log,x)}let Y;if(J[54]!==e)Y=new Set(e.map(uz)),J[54]=e,J[55]=Y;else Y=J[55];let z=Y,q;if(J[56]!==mJ.results||J[57]!==e||J[58]!==z){let j;if(J[60]!==z)j=(u)=>!z.has(u.messages[0]?.uuid),J[60]=z,J[61]=j;else j=J[61];let x=mJ.results.map(pz).filter(j);q=[...e,...x],J[56]=mJ.results,J[57]=e,J[58]=z,J[59]=q}else q=J[59];e=q}J[49]=YJ,J[50]=mJ,J[51]=W0,J[52]=e,J[53]=pJ}else e=J[52],pJ=J[53];let TZ;if(J[62]!==e||J[63]!==pJ)TZ={filteredLogs:e,snippets:pJ},J[62]=e,J[63]=pJ,J[64]=TZ;else TZ=J[64];let{filteredLogs:uJ,snippets:RJ}=TZ,v0;J:{if(V.status==="results"&&V.results.length>0){v0=V.results;break J}v0=uJ}let D=v0,kJ=Math.max(30,L-4),N0;J:{if(!w){let z;if(J[65]===Symbol.for("react.memo_cache_sentinel"))z=[],J[65]=z;else z=J[65];N0=z;break J}let Y;if(J[66]!==D||J[67]!==_||J[68]!==kJ||J[69]!==C||J[70]!==RJ){let z=dz(D);Y=Array.from(z.entries()).map((q)=>{let[j,x]=q,u=x[0],hJ=D.indexOf(u),LJ=RJ.get(u),EJ=LJ?p0(LJ,_):null;if(x.length===1){let IJ=h0(u,{showProjectPath:C});return{id:`log:${j}:0`,value:{log:u,indexInFiltered:hJ},label:u0(u,kJ),description:EJ?`${IJ}
2
+ ${EJ}`:IJ,dimDescription:!0}}let z0=x.length-1,K0=x.slice(1).map((IJ,Xz)=>{let Vz=D.indexOf(IJ),JY=RJ.get(IJ),ZY=JY?p0(JY,_):null,YY=h0(IJ,{isChild:!0,showProjectPath:C});return{id:`log:${j}:${Xz+1}`,value:{log:IJ,indexInFiltered:Vz},label:u0(IJ,kJ,{isChild:!0}),description:ZY?`${YY}
3
+ ${ZY}`:YY,dimDescription:!0}}),e0=h0(u,{showProjectPath:C});return{id:`group:${j}`,value:{log:u,indexInFiltered:hJ},label:u0(u,kJ,{isGroupHeader:!0,forkCount:z0}),description:EJ?`${e0}
4
+ ${EJ}`:e0,dimDescription:!0,children:K0}}),J[66]=D,J[67]=_,J[68]=kJ,J[69]=C,J[70]=RJ,J[71]=Y}else Y=J[71];N0=Y}let WJ=N0,C0;J:{if(w){let z;if(J[72]===Symbol.for("react.memo_cache_sentinel"))z=[],J[72]=z;else z=J[72];C0=z;break J}let Y;if(J[73]!==D||J[74]!==_||J[75]!==kJ||J[76]!==C||J[77]!==RJ){let z;if(J[79]!==_||J[80]!==kJ||J[81]!==C||J[82]!==RJ)z=(q,j)=>{let u=fJ(q)+(q.isSidechain?" (sidechain)":""),hJ=rY(u,kJ),LJ=c0(q),EJ=C&&q.projectPath?` · ${q.projectPath}`:"",z0=RJ.get(q),K0=z0?p0(z0,_):null;return{label:hJ,description:K0?`${LJ}${EJ}
5
+ ${K0}`:LJ+EJ,dimDescription:!0,value:j.toString()}},J[79]=_,J[80]=kJ,J[81]=C,J[82]=RJ,J[83]=z;else z=J[83];Y=D.map(z),J[73]=D,J[74]=_,J[75]=kJ,J[76]=C,J[77]=RJ,J[78]=Y}else Y=J[78];C0=Y}let M0=C0,I=PJ?.value.log??null,yZ;if(J[84]!==D||J[85]!==GJ||J[86]!==I)yZ=()=>{if(!w||!I)return"";let Y=XJ(I);if(!Y)return"";let z=D.filter((u)=>XJ(u)===Y);if(!(z.length>1))return"";let j=GJ.has(Y);if(z.indexOf(I)>0)return"← to collapse";return j?"← to collapse":"→ to expand"},J[84]=D,J[85]=GJ,J[86]=I,J[87]=yZ;else yZ=J[87];let mZ=yZ,LZ;if(J[88]!==I||J[89]!==F||J[90]!==g)LZ=async()=>{let Y=I?XJ(I):void 0;if(!I||!Y){h("list"),HJ("");return}if(g.trim()){if(await dY(Y,g.trim(),I.fullPath),w&&F)F()}h("list"),HJ("")},J[88]=I,J[89]=F,J[90]=g,J[91]=LZ;else LZ=J[91];let R0=LZ,IZ;if(J[92]===Symbol.for("react.memo_cache_sentinel"))IZ=()=>{h("list"),$("tengu_session_search_toggled",{enabled:!1})},J[92]=IZ;else IZ=J[92];let Kz=IZ,bZ;if(J[93]===Symbol.for("react.memo_cache_sentinel"))bZ=()=>{h("search"),$("tengu_session_search_toggled",{enabled:!0})},J[93]=bZ;else bZ=J[93];let o0=bZ,fZ;if(J[94]!==K||J[95]!==O||J[96]!==A)fZ=async()=>{A.trim();return},J[94]=K,J[95]=O,J[96]=A,J[97]=fZ;else fZ=J[97];let E0=fZ,xZ;if(J[98]!==V.query||J[99]!==V.status||J[100]!==A)xZ=()=>{if(V.status!=="idle"&&V.status!=="searching"){if(V.status==="results"&&V.query!==A||V.status==="error")VZ({status:"idle"})}},J[98]=V.query,J[99]=V.status,J[100]=A,J[101]=xZ;else xZ=J[101];let _Z;if(J[102]!==V||J[103]!==A)_Z=[A,V],J[102]=V,J[103]=A,J[104]=_Z;else _Z=J[104];R.default.useEffect(xZ,_Z);let SZ,pZ;if(J[105]===Symbol.for("react.memo_cache_sentinel"))SZ=()=>()=>{HZ.current?.abort()},pZ=[],J[105]=SZ,J[106]=pZ;else SZ=J[105],pZ=J[106];R.default.useEffect(SZ,pZ);let t0=R.default.useRef(V.status),uZ;if(J[107]!==V.status||J[108]!==D[0]||J[109]!==D.length||J[110]!==WJ)uZ=()=>{let Y=t0.current;if(t0.current=V.status,Y==="searching"&&V.status==="results"){if(w&&WJ.length>0)wJ(WJ[0]);else if(!w&&D.length>0){let z=D[0];wJ({id:"0",value:{log:z,indexInFiltered:0},label:""})}}},J[107]=V.status,J[108]=D[0],J[109]=D.length,J[110]=WJ,J[111]=uZ;else uZ=J[111];let hZ;if(J[112]!==V.status||J[113]!==D||J[114]!==WJ)hZ=[V.status,w,WJ,D],J[112]=V.status,J[113]=D,J[114]=WJ,J[115]=hZ;else hZ=J[115];R.default.useEffect(uZ,hZ);let $Z;if(J[116]!==D)$Z=(Y)=>{let z=parseInt(Y,10),q=D[z];if(!q||qJ.current===z.toString())return;qJ.current=z.toString(),wJ({id:z.toString(),value:{log:q,indexInFiltered:z},label:""}),lJ(z+1)},J[116]=D,J[117]=$Z;else $Z=J[117];let A0=$Z,cZ;if(J[118]!==D)cZ=(Y)=>{wJ(Y);let z=D.findIndex((q)=>XJ(q)===XJ(Y.value.log));if(z>=0)lJ(z+1)},J[118]=D,J[119]=cZ;else cZ=J[119];let j0=cZ,gZ;if(J[120]===Symbol.for("react.memo_cache_sentinel"))gZ=()=>{HZ.current?.abort(),VZ({status:"idle"}),$("tengu_agentic_search_cancelled",{})},J[120]=gZ;else gZ=J[120];let F0=P!=="preview"&&V.status==="searching",iZ;if(J[121]!==F0)iZ={context:"Confirmation",isActive:F0},J[121]=F0,J[122]=iZ;else iZ=J[122];$J("confirm:no",gZ,iZ);let rZ;if(J[123]===Symbol.for("react.memo_cache_sentinel"))rZ=()=>{h("list"),HJ("")},J[123]=rZ;else rZ=J[123];let w0=P==="rename"&&V.status!=="searching",lZ;if(J[124]!==w0)lZ={context:"Settings",isActive:w0},J[124]=w0,J[125]=lZ;else lZ=J[125];$J("confirm:no",rZ,lZ);let dZ;if(J[126]!==Q||J[127]!==dJ)dZ=()=>{dJ(""),BZ(!1),Q?.()},J[126]=Q,J[127]=dJ,J[128]=dZ;else dZ=J[128];let T0=P!=="preview"&&P!=="rename"&&P!=="search"&&t&&V.status!=="searching",nZ;if(J[129]!==T0)nZ={context:"Confirmation",isActive:T0},J[129]=T0,J[130]=nZ;else nZ=J[130];$J("confirm:no",dZ,nZ);let aZ;if(J[131]!==V.status||J[132]!==c||J[133]!==I||J[134]!==E0||J[135]!==n||J[136]!==DJ||J[137]!==t||J[138]!==O||J[139]!==W||J[140]!==A||J[141]!==dJ||J[142]!==C||J[143]!==d||J[144]!==zJ||J[145]!==SJ||J[146]!==P)aZ=(Y,z)=>{if(P==="preview")return;if(V.status==="searching")return;if(P==="rename");else if(P==="search"){if(Y.toLowerCase()==="n"&&z.ctrl)Kz();else if(z.return||z.downArrow)A.trim()}else{if(t){if(z.return){E0(),BZ(!1);return}else if(z.downArrow){BZ(!1);return}else if(z.upArrow){h("search"),BZ(!1);return}}if(DJ&&z.tab){let x=z.shift?-1:1;xJ((u)=>{let LJ=((u<zJ.length?u:0)+zJ.length+x)%zJ.length,EJ=zJ[LJ];return $("tengu_session_tag_filter_changed",{is_all:EJ==="All",tag_count:SJ.length}),LJ});return}let q=!z.ctrl&&!z.meta,j=Y.toLowerCase();if(j==="a"&&z.ctrl&&W)W(),$("tengu_session_all_projects_toggled",{enabled:!C});else if(j==="b"&&z.ctrl){let x=!c;BJ(x),$("tengu_session_branch_filter_toggled",{enabled:x})}else if(j==="w"&&z.ctrl&&n){let x=!d;cJ(x),$("tengu_session_worktree_filter_toggled",{enabled:x})}else if(j==="/"&&q)h("search"),$("tengu_session_search_toggled",{enabled:!0});else if(j==="r"&&z.ctrl&&I)h("rename"),HJ(""),$("tengu_session_rename_started",{});else if(j==="v"&&z.ctrl&&I)k(I),h("preview"),$("tengu_session_preview_opened",{messageCount:I.messageCount});else if(I&&q&&Y.length>0&&!/^\s+$/.test(Y))h("search"),dJ(Y),$("tengu_session_search_toggled",{enabled:!0})}},J[131]=V.status,J[132]=c,J[133]=I,J[134]=E0,J[135]=n,J[136]=DJ,J[137]=t,J[138]=O,J[139]=W,J[140]=A,J[141]=dJ,J[142]=C,J[143]=d,J[144]=zJ,J[145]=SJ,J[146]=P,J[147]=aZ;else aZ=J[147];let sZ;if(J[148]===Symbol.for("react.memo_cache_sentinel"))sZ={isActive:!0},J[148]=sZ;else sZ=J[148];xY(aZ,sZ);let vJ;if(J[149]!==c||J[150]!==M||J[151]!==n||J[152]!==d){if(vJ=[],c&&M)vJ.push(M);if(n&&!d)vJ.push("current worktree");J[149]=c,J[150]=M,J[151]=n,J[152]=d,J[153]=vJ}else vJ=J[153];let Uz=8+(vJ.length>0&&P!=="search"?1:0)+zz,KJ=Math.max(1,Math.floor((S-Uz-2)/3)),oZ,tZ;if(J[154]!==D.length||J[155]!==ZJ||J[156]!==T||J[157]!==KJ)oZ=()=>{if(!T)return;let Y=KJ*2;if(ZJ+Y>=D.length)T(KJ*3)},tZ=[ZJ,KJ,D.length,T],J[154]=D.length,J[155]=ZJ,J[156]=T,J[157]=KJ,J[158]=oZ,J[159]=tZ;else oZ=J[158],tZ=J[159];if(R.default.useEffect(oZ,tZ),K.length===0)return null;if(P==="preview"&&H&&w){let Y;if(J[160]===Symbol.for("react.memo_cache_sentinel"))Y=()=>{h("list"),k(null)},J[160]=Y;else Y=J[160];let z;if(J[161]!==v||J[162]!==H)z=U(QY,{log:H,onExit:Y,onSelect:v}),J[161]=v,J[162]=H,J[163]=z;else z=J[163];return z}let y0=S-1,eZ;if(J[164]===Symbol.for("react.memo_cache_sentinel"))eZ=U(b,{flexShrink:0,children:U(pY,{color:"suggestion"})}),J[164]=eZ;else eZ=J[164];let J0;if(J[165]===Symbol.for("react.memo_cache_sentinel"))J0=U(b,{flexShrink:0,children:U(N,{children:" "})}),J[165]=J0;else J0=J[165];let aJ;if(J[166]!==L||J[167]!==D.length||J[168]!==RZ||J[169]!==ZJ||J[170]!==DJ||J[171]!==C||J[172]!==zJ||J[173]!==P||J[174]!==KJ)aJ=DJ?U(NY,{tabs:zJ,selectedIndex:RZ,availableWidth:L,showAllProjects:C}):U(b,{flexShrink:0,children:m(N,{bold:!0,color:"suggestion",children:["Resume Session",P==="list"&&D.length>KJ&&m(N,{dimColor:!0,children:[" ","(",ZJ," of ",D.length,")"]})]})}),J[166]=L,J[167]=D.length,J[168]=RZ,J[169]=ZJ,J[170]=DJ,J[171]=C,J[172]=zJ,J[173]=P,J[174]=KJ,J[175]=aJ;else aJ=J[175];let m0=P==="search",sJ;if(J[176]!==E||J[177]!==P0||J[178]!==A||J[179]!==m0)sJ=U($Y,{query:A,isFocused:m0,isTerminalFocused:E,cursorOffset:P0}),J[176]=E,J[177]=P0,J[178]=A,J[179]=m0,J[180]=sJ;else sJ=J[180];let oJ;if(J[181]!==vJ||J[182]!==P)oJ=vJ.length>0&&P!=="search"&&U(b,{flexShrink:0,paddingLeft:2,children:U(N,{dimColor:!0,children:U(NJ,{children:vJ})})}),J[181]=vJ,J[182]=P,J[183]=oJ;else oJ=J[183];let Z0;if(J[184]===Symbol.for("react.memo_cache_sentinel"))Z0=U(b,{flexShrink:0,children:U(N,{children:" "})}),J[184]=Z0;else Z0=J[184];let tJ;if(J[185]!==V.status)tJ=V.status==="searching"&&m(b,{paddingLeft:1,flexShrink:0,children:[U(hY,{}),U(N,{children:" Searching…"})]}),J[185]=V.status,J[186]=tJ;else tJ=J[186];let eJ;if(J[187]!==V.results||J[188]!==V.status)eJ=V.status==="results"&&V.results.length>0&&U(b,{paddingLeft:1,marginBottom:1,flexShrink:0,children:U(N,{dimColor:!0,italic:!0,children:"Claude found these results:"})}),J[187]=V.results,J[188]=V.status,J[189]=eJ;else eJ=J[189];let JZ;if(J[190]!==V.results||J[191]!==V.status||J[192]!==uJ)JZ=V.status==="results"&&V.results.length===0&&uJ.length===0&&U(b,{paddingLeft:1,marginBottom:1,flexShrink:0,children:U(N,{dimColor:!0,italic:!0,children:"No matching sessions found."})}),J[190]=V.results,J[191]=V.status,J[192]=uJ,J[193]=JZ;else JZ=J[193];let ZZ;if(J[194]!==V.status||J[195]!==uJ)ZZ=V.status==="error"&&uJ.length===0&&U(b,{paddingLeft:1,marginBottom:1,flexShrink:0,children:U(N,{dimColor:!0,italic:!0,children:"No matching sessions found."})}),J[194]=V.status,J[195]=uJ,J[196]=ZZ;else ZZ=J[196];let YZ;if(J[197]!==V.status||J[198]!==t||J[199]!==O||J[200]!==A)YZ=Boolean(A.trim())&&O&&!1,J[197]=V.status,J[198]=t,J[199]=O,J[200]=A,J[201]=YZ;else YZ=J[201];let zZ;if(J[202]!==V.status||J[203]!==c||J[204]!==L||J[205]!==D||J[206]!==GJ||J[207]!==M0||J[208]!==I||J[209]!==PJ?.id||J[210]!==A0||J[211]!==R0||J[212]!==j0||J[213]!==t||J[214]!==Q||J[215]!==v||J[216]!==QJ||J[217]!==g||J[218]!==WJ||J[219]!==P||J[220]!==KJ)zZ=V.status==="searching"?null:P==="rename"&&I?m(b,{paddingLeft:2,flexDirection:"column",children:[U(N,{bold:!0,children:"Rename session:"}),U(b,{paddingTop:1,children:U(uY,{value:g,onChange:HJ,onSubmit:R0,placeholder:fJ(I,"Enter new session name"),columns:L,cursorOffset:QJ,onChangeCursorOffset:iJ,showCursor:!0})})]}):w?U(EY,{nodes:WJ,onSelect:(Y)=>{v(Y.value.log)},onFocus:j0,onCancel:Q,focusNodeId:PJ?.id,visibleOptionCount:KJ,layout:"expanded",isDisabled:P==="search"||t,hideIndexes:!1,isNodeExpanded:(Y)=>{if(P==="search"||c)return!0;let z=typeof Y==="string"&&Y.startsWith("group:")?Y.substring(6):null;return z?GJ.has(z):!1},onExpand:(Y)=>{let z=typeof Y==="string"&&Y.startsWith("group:")?Y.substring(6):null;if(z)rJ((q)=>new Set(q).add(z)),$("tengu_session_group_expanded",{})},onCollapse:(Y)=>{let z=typeof Y==="string"&&Y.startsWith("group:")?Y.substring(6):null;if(z)rJ((q)=>{let j=new Set(q);return j.delete(z),j})},onUpFromFirstItem:o0}):U(B0,{options:M0,onChange:(Y)=>{let z=parseInt(Y,10),q=D[z];if(q)v(q)},visibleOptionCount:KJ,onCancel:Q,onFocus:A0,defaultFocusValue:PJ?.id.toString(),layout:"expanded",isDisabled:P==="search"||t,onUpFromFirstItem:o0}),J[202]=V.status,J[203]=c,J[204]=L,J[205]=D,J[206]=GJ,J[207]=M0,J[208]=I,J[209]=PJ?.id,J[210]=A0,J[211]=R0,J[212]=j0,J[213]=t,J[214]=Q,J[215]=v,J[216]=QJ,J[217]=g,J[218]=WJ,J[219]=P,J[220]=KJ,J[221]=zZ;else zZ=J[221];let KZ;if(J[222]!==V.status||J[223]!==M||J[224]!==f.keyName||J[225]!==f.pending||J[226]!==mZ||J[227]!==n||J[228]!==t||J[229]!==D0||J[230]!==W||J[231]!==C||J[232]!==d||J[233]!==P)KZ=U(b,{paddingLeft:2,children:f.pending?m(N,{dimColor:!0,children:["Press ",f.keyName," again to exit"]}):P==="rename"?U(N,{dimColor:!0,children:m(NJ,{children:[U(UJ,{shortcut:"Enter",action:"save"}),U(AJ,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}):V.status==="searching"?U(N,{dimColor:!0,children:m(NJ,{children:[U(N,{children:"Searching with Claude…"}),U(AJ,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}):t?U(N,{dimColor:!0,children:m(NJ,{children:[U(UJ,{shortcut:"Enter",action:"search"}),U(UJ,{shortcut:"↓",action:"skip"}),U(AJ,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}):P==="search"?U(N,{dimColor:!0,children:m(NJ,{children:[U(N,{children:"Type to Search"}),U(UJ,{shortcut:"Enter",action:"select"}),U(AJ,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"clear"})]})}):U(N,{dimColor:!0,children:m(NJ,{children:[W&&U(UJ,{shortcut:"Ctrl+A",action:`show ${C?"current dir":"all projects"}`}),M&&U(UJ,{shortcut:"Ctrl+B",action:"toggle branch"}),n&&U(UJ,{shortcut:"Ctrl+W",action:`show ${d?"current worktree":"all worktrees"}`}),U(UJ,{shortcut:"Ctrl+V",action:"preview"}),U(UJ,{shortcut:"Ctrl+R",action:"rename"}),U(N,{children:"Type to search"}),U(AJ,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}),mZ()&&U(N,{children:mZ()})]})})}),J[222]=V.status,J[223]=M,J[224]=f.keyName,J[225]=f.pending,J[226]=mZ,J[227]=n,J[228]=t,J[229]=D0,J[230]=W,J[231]=C,J[232]=d,J[233]=P,J[234]=KZ;else KZ=J[234];let Y0;if(J[235]!==y0||J[236]!==aJ||J[237]!==sJ||J[238]!==oJ||J[239]!==tJ||J[240]!==eJ||J[241]!==JZ||J[242]!==ZZ||J[243]!==YZ||J[244]!==zZ||J[245]!==KZ)Y0=m(b,{flexDirection:"column",height:y0,children:[eZ,J0,aJ,sJ,oJ,Z0,tJ,eJ,JZ,ZZ,YZ,zZ,KZ]}),J[235]=y0,J[236]=aJ,J[237]=sJ,J[238]=oJ,J[239]=tJ,J[240]=eJ,J[241]=JZ,J[242]=ZZ,J[243]=YZ,J[244]=zZ,J[245]=KZ,J[246]=Y0;else Y0=J[246];return Y0}function pz(Z){return Z.log}function uz(Z){return Z.messages[0]?.uuid}function hz(Z,J,K,B){let G=Z.search(J);G.sort(cz),K({results:G.map($z),query:J}),B(!1)}function $z(Z){return{log:Z.item.log,score:Z.score,searchableText:Z.item.searchableText}}function cz(Z,J){let K=new Date(Z.item.log.modified).getTime(),G=new Date(J.item.log.modified).getTime()-K;if(Math.abs(G)>xz)return G;return(Z.score??1)-(J.score??1)}function gz(Z){let J=wY(),K=XJ(Z);if(J&&K===J)return!0;if(Z.customTitle)return!0;if(lY(Z.messages))return!0;if(Z.firstPrompt||Z.customTitle)return!0;return!1}function iz(Z){return[Z,lz(Z)]}function rz(Z){if(Z.type!=="user"&&Z.type!=="assistant")return"";let J="message"in Z?Z.message?.content:void 0;if(!J)return"";if(typeof J==="string")return J;if(Array.isArray(J))return J.map((K)=>{if(typeof K==="string")return K;if("text"in K&&typeof K.text==="string")return K.text;return""}).filter(Boolean).join(" ");return""}function lz(Z){let K=(Z.messages.length<=fz?Z.messages:[...Z.messages.slice(0,jY),...Z.messages.slice(-jY)]).map(rz).filter(Boolean).join(" "),G=`${[Z.customTitle,Z.summary,Z.firstPrompt,Z.gitBranch,Z.tag,Z.prNumber?`PR #${Z.prNumber}`:void 0,Z.prRepository].filter(Boolean).join(" ")} ${K}`.trim();return G.length>FY?G.slice(0,FY):G}function dz(Z){let J=new Map;for(let K of Z){let B=XJ(K);if(B){let G=J.get(B);if(G)G.push(K);else J.set(B,[K])}}return J.forEach((K)=>K.sort((B,G)=>new Date(G.modified).getTime()-new Date(B.modified).getTime())),J}function nz(Z){let J=new Set;for(let K of Z)if(K.tag)J.add(K.tag);return Array.from(J).sort((K,B)=>K.localeCompare(B))}var iY,R,Iz=2,bz=4,fz=2000,jY=1000,FY=50000,xz=60000,_z=50;var az=XZ(()=>{Mz();TY();jz();mz();Az();Rz();U0();KY();Cz();I0();Lz();Nz();yY();V0();Ez();XY();MY();VY();Fz();UY();yz();OY();Tz();CY();wz();AY();bJ();iY=UZ(f0(),1),R=UZ(b0(),1)});function YK(Z){if(Z.type!=="user"&&Z.type!=="assistant")return"";let J="message"in Z?Z.message?.content:void 0;if(!J)return"";if(typeof J==="string")return J;if(Array.isArray(J))return J.map((K)=>{if(typeof K==="string")return K;if("text"in K&&typeof K.text==="string")return K.text;return""}).filter(Boolean).join(" ");return""}function Jz(Z){if(Z.length===0)return"";let K=(Z.length<=g0?Z:[...Z.slice(0,g0/2),...Z.slice(-g0/2)]).map(YK).filter(Boolean).join(" ").replace(/\s+/g," ").trim();return K.length>aY?K.slice(0,aY)+"…":K}function sY(Z,J){if(fJ(Z).toLowerCase().includes(J))return!0;if(Z.customTitle?.toLowerCase().includes(J))return!0;if(Z.tag?.toLowerCase().includes(J))return!0;if(Z.gitBranch?.toLowerCase().includes(J))return!0;if(Z.summary?.toLowerCase().includes(J))return!0;if(Z.firstPrompt?.toLowerCase().includes(J))return!0;if(Z.messages&&Z.messages.length>0){if(Jz(Z.messages).toLowerCase().includes(J))return!0}return!1}async function QU(Z,J,K){if(!Z.trim()||J.length===0)return[];let B=Z.toLowerCase(),G=J.filter((X)=>sY(X,B)),Q;if(G.length>=i0)Q=G.slice(0,i0);else{let X=J.filter((O)=>!sY(O,B)),W=i0-G.length;Q=[...G,...X.slice(0,W)]}CJ(`Agentic search: ${Q.length}/${J.length} logs, query="${Z}", matching: ${G.length}, with messages: ${l0(Q,(X)=>X.messages?.length>0)}`);let v=Q.map(async(X)=>{if(GZ(X))try{return await X0(X)}catch(W){return r0(W),X}return X}),F=await Promise.all(v);CJ(`Agentic search: loaded ${l0(F,(X)=>X.messages?.length>0)}/${Q.length} logs with transcripts`);let i=`Sessions:
6
+ ${F.map((X,W)=>{let O=[`${W}:`],S=fJ(X);if(O.push(S),X.customTitle&&X.customTitle!==S)O.push(`[custom title: ${X.customTitle}]`);if(X.tag)O.push(`[tag: ${X.tag}]`);if(X.gitBranch)O.push(`[branch: ${X.gitBranch}]`);if(X.summary)O.push(`- Summary: ${X.summary}`);if(X.firstPrompt&&X.firstPrompt!=="No prompt")O.push(`- First message: ${X.firstPrompt.slice(0,300)}`);if(X.messages&&X.messages.length>0){let C=Jz(X.messages);if(C)O.push(`- Transcript: ${C}`)}return O.join(" ")}).join(`
7
+ `)}
8
+
9
+ Search query: "${Z}"
10
+
11
+ Find the sessions that are most relevant to this query.`;CJ(`Agentic search prompt (first 500 chars): ${i.slice(0,500)}...`);try{let X=tY();CJ(`Agentic search using model: ${X}`);let O=(await eY({model:X,system:ZK,messages:[{role:"user",content:i}],signal:K,querySource:"session_search"})).content.find((f)=>f.type==="text");if(!O||O.type!=="text")return CJ("No text content in agentic search response"),[];CJ(`Agentic search response: ${O.text}`);let S=O.text.match(/\{[\s\S]*\}/);if(!S)return CJ("Could not find JSON in agentic search response"),[];let L=(oY(S[0]).relevant_indices||[]).filter((f)=>f>=0&&f<F.length).map((f)=>F[f]);return CJ(`Agentic search found ${L.length} relevant sessions`),L}catch(X){return r0(X),CJ(`Agentic search error: ${X}`),[]}}var aY=2000,g0=100,i0=100,ZK=`Your goal is to find relevant sessions based on a user's search query.
12
+
13
+ You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
14
+
15
+ Each session may include:
16
+ - Title (display name or custom title)
17
+ - Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
18
+ - Branch (git branch name, shown as [branch: name])
19
+ - Summary (AI-generated summary)
20
+ - First message (beginning of the conversation)
21
+ - Transcript (excerpt of conversation content)
22
+
23
+ IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
24
+
25
+ For each session, consider (in order of priority):
26
+ 1. Exact tag matches (highest priority - user explicitly categorized this session)
27
+ 2. Partial tag matches or tag-related terms
28
+ 3. Title matches (custom titles or first message content)
29
+ 4. Branch name matches
30
+ 5. Summary and transcript content matches
31
+ 6. Semantic similarity and related concepts
32
+
33
+ CRITICAL: Be VERY inclusive in your matching. Include sessions that:
34
+ - Contain the query term anywhere in any field
35
+ - Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
36
+ - Discuss topics that could be related to the query
37
+ - Have transcripts that mention the concept even in passing
38
+
39
+ When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
40
+
41
+ Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
42
+
43
+ Respond with ONLY the JSON object, no markdown formatting:
44
+ {"relevant_indices": [2, 5, 0]}`;var zK=XZ(()=>{tz();oz();yY();ez();V0();JK();sz()});function WU(Z,J,K){let B=H0();if(!J||!Z.projectPath||Z.projectPath===B)return{isCrossProject:!1};let G=XJ(Z);return{isCrossProject:!0,isSameRepoWorktree:!1,command:`cd ${Zz([Z.projectPath])} && claude --resume ${G}`,projectPath:Z.projectPath}}var UK=XZ(()=>{TY();KK();V0()});
45
+ export{YU as qe,az as re,QU as se,zK as te,WU as ue,UK as ve};
@@ -0,0 +1,2 @@
1
+ import{Hma as M,Ima as Y}from"./cli-0.5.7-m4wwfa6q.mjs";import{Zma as W}from"./cli-0.5.7-258ytmbr.mjs";import{homedir as Z}from"os";import{join as Q}from"path";function $(q){if(q?.configDirEnv)return q.configDirEnv.normalize("NFC");let B=q?.homeDir??Z();return Q(B,".claudin").normalize("NFC")}function N(){return process.env.CLAUDIN_CONFIG_DIR}function _(){return Q(X(),"teams")}function j(q){let B=process.env.NODE_OPTIONS;if(!B)return!1;return B.split(/\s+/).includes(q)}function U(q){if(!q)return!1;if(typeof q==="boolean")return q;let B=q.toLowerCase().trim();return["1","true","yes","on"].includes(B)}function I(q){if(q===void 0)return!1;if(typeof q==="boolean")return!q;if(!q)return!1;let B=q.toLowerCase().trim();return["0","false","no","off"].includes(B)}function S(){return U(process.env.CLAUDE_CODE_SIMPLE)||process.argv.includes("--bare")}function T(q){let B={};if(q)for(let F of q){let[J,...K]=F.split("=");if(!J||K.length===0)throw Error(`Invalid environment variable format: ${F}, environment variables should be added as: -e KEY1=value1 -e KEY2=value2`);B[J]=K.join("=")}return B}function c(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||"us-east-1"}function L(){return process.env.CLOUD_ML_REGION||"us-east5"}function w(){return U(process.env.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR)}function z(){return!1}function O(){return!1}function x(q){if(q){let B=b.find(([F])=>q.startsWith(F));if(B)return process.env[B[1]]||L()}return L()}var X,b;var k=W(()=>{Y();X=M(()=>$({configDirEnv:N()}),()=>process.env.CLAUDIN_CONFIG_DIR??"");b=[["claude-haiku-4-5","VERTEX_REGION_CLAUDE_HAIKU_4_5"],["claude-3-5-haiku","VERTEX_REGION_CLAUDE_3_5_HAIKU"],["claude-3-5-sonnet","VERTEX_REGION_CLAUDE_3_5_SONNET"],["claude-3-7-sonnet","VERTEX_REGION_CLAUDE_3_7_SONNET"],["claude-opus-4-7","VERTEX_REGION_CLAUDE_4_7_OPUS"],["claude-opus-4-6","VERTEX_REGION_CLAUDE_4_6_OPUS"],["claude-opus-4-1","VERTEX_REGION_CLAUDE_4_1_OPUS"],["claude-opus-4","VERTEX_REGION_CLAUDE_4_0_OPUS"],["claude-sonnet-4-6","VERTEX_REGION_CLAUDE_4_6_SONNET"],["claude-sonnet-4-5","VERTEX_REGION_CLAUDE_4_5_SONNET"],["claude-sonnet-4","VERTEX_REGION_CLAUDE_4_0_SONNET"]]});
2
+ export{$ as Zfa,N as _fa,X as $fa,_ as aga,j as bga,U as cga,I as dga,S as ega,T as fga,c as gga,L as hga,w as iga,z as jga,O as kga,x as lga,k as mga};