@caspian2026/agent-sdk 0.0.8 → 0.0.9

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 (312) hide show
  1. package/dist/chunk-04h360ha.js +57 -0
  2. package/dist/{chunk-jmkn11my.js → chunk-04pw5akr.js} +20 -20
  3. package/dist/{chunk-veap97he.js → chunk-0gpem3pk.js} +46 -45
  4. package/dist/{chunk-0mej3p7q.js → chunk-0txtpamh.js} +14 -14
  5. package/dist/{chunk-4m9df5ef.js → chunk-0v89r445.js} +17 -21
  6. package/dist/chunk-0vp3wfab.js +12 -0
  7. package/dist/{chunk-268jd0rc.js → chunk-1486qzk5.js} +6 -4
  8. package/dist/chunk-1efrnkxx.js +468 -0
  9. package/dist/chunk-1gaw18rz.js +93 -0
  10. package/dist/{chunk-69r3hm9b.js → chunk-1hqb50ne.js} +13 -19
  11. package/dist/chunk-1hqvvvrt.js +96 -0
  12. package/dist/{chunk-qjyg1dv7.js → chunk-1hx5g6qy.js} +6 -10
  13. package/dist/{chunk-3g1vqhyx.js → chunk-1kmwf4vn.js} +17 -21
  14. package/dist/{chunk-naybw0p0.js → chunk-1nhnn2rg.js} +8 -8
  15. package/dist/{chunk-jjh7m5sg.js → chunk-1nvcmzj1.js} +66 -77
  16. package/dist/{chunk-2f21meep.js → chunk-1v01c96r.js} +1 -1
  17. package/dist/{chunk-7n51wk9k.js → chunk-1vp22nex.js} +2 -2
  18. package/dist/{chunk-jcwkgtbp.js → chunk-1yfc1d48.js} +52 -90
  19. package/dist/{chunk-83e71kz6.js → chunk-2072dpbx.js} +2 -2
  20. package/dist/{chunk-7rnqsng2.js → chunk-22mfb6bp.js} +19 -19
  21. package/dist/{chunk-d7886r6a.js → chunk-26wtxbdc.js} +7774 -7774
  22. package/dist/{chunk-x94btg29.js → chunk-2m32xn94.js} +17 -21
  23. package/dist/{chunk-mw1kpeg9.js → chunk-2nrarbza.js} +1909 -1377
  24. package/dist/chunk-2vbash3m.js +331 -0
  25. package/dist/{chunk-c11swzas.js → chunk-2vteceqh.js} +5 -5
  26. package/dist/{chunk-3zxswxtg.js → chunk-2y8x7xt7.js} +2 -2
  27. package/dist/{chunk-s7q42kp2.js → chunk-2yxqz99n.js} +9 -9
  28. package/dist/{chunk-qyqpb15f.js → chunk-35nft36d.js} +205 -261
  29. package/dist/{chunk-88xc4d7f.js → chunk-35z2vxep.js} +49 -48
  30. package/dist/{chunk-15m49c67.js → chunk-3e28fvn0.js} +2 -2
  31. package/dist/{chunk-2xvc97x4.js → chunk-3e4r5pmc.js} +3 -3
  32. package/dist/{chunk-a3ws4gae.js → chunk-3fn3ysvs.js} +47 -46
  33. package/dist/{chunk-4hv90qcz.js → chunk-3mgywd32.js} +1 -1
  34. package/dist/{chunk-pwqm47kn.js → chunk-3npsy4c4.js} +46 -45
  35. package/dist/{chunk-xz655xxa.js → chunk-3pzwd6qq.js} +2 -2
  36. package/dist/{chunk-70eey1nh.js → chunk-40s88wdg.js} +2 -2
  37. package/dist/{chunk-w0gmf6bv.js → chunk-42a0nyrq.js} +47 -46
  38. package/dist/{chunk-jvmybb06.js → chunk-44t1xk05.js} +46 -45
  39. package/dist/{chunk-0awwmrwr.js → chunk-4ayjwyqj.js} +2 -2
  40. package/dist/{chunk-a4npwxvb.js → chunk-4myad919.js} +46 -45
  41. package/dist/{chunk-8g747a8x.js → chunk-4pbx3g7s.js} +1 -1
  42. package/dist/chunk-4vtvwg7e.js +99 -0
  43. package/dist/{chunk-qcnhb4cd.js → chunk-54wn2jdr.js} +3 -3
  44. package/dist/{chunk-1nk93fqz.js → chunk-5cxjxxx8.js} +2 -7
  45. package/dist/chunk-5m3m7hr5.js +108 -0
  46. package/dist/{chunk-a3wczqrp.js → chunk-5mrc0ps5.js} +37 -41
  47. package/dist/{chunk-zmra45az.js → chunk-5tw3gj5z.js} +47 -46
  48. package/dist/{chunk-87e209aj.js → chunk-5zcygjb2.js} +46 -45
  49. package/dist/{chunk-mk1y74w7.js → chunk-65q3hqkw.js} +17 -21
  50. package/dist/{chunk-vajwapkf.js → chunk-67wms97m.js} +17 -23
  51. package/dist/chunk-6cfcqjty.js +441 -0
  52. package/dist/{chunk-rc9x0raa.js → chunk-6hs0cptm.js} +56 -55
  53. package/dist/{chunk-bmbq6nt1.js → chunk-6wzg2hpc.js} +2 -2
  54. package/dist/chunk-72qa16xm.js +91 -0
  55. package/dist/chunk-7cdy4aj6.js +150 -0
  56. package/dist/chunk-7cje7scj.js +1534 -0
  57. package/dist/{chunk-e7h4qxgw.js → chunk-7etkb4pr.js} +4 -4
  58. package/dist/{chunk-1ax1znzj.js → chunk-7hrmxpha.js} +6 -6
  59. package/dist/{chunk-wha6v7za.js → chunk-7krg0dkt.js} +2 -2
  60. package/dist/{chunk-vvsbvz2b.js → chunk-7skyagc2.js} +2 -2
  61. package/dist/{chunk-hzknr99c.js → chunk-83b2frat.js} +4 -4
  62. package/dist/{chunk-qvd3hbqs.js → chunk-84cdy41j.js} +5 -5
  63. package/dist/{chunk-bxcfz5gy.js → chunk-87xg6yb4.js} +1 -1
  64. package/dist/{chunk-nrtksr2p.js → chunk-8b2y3x7a.js} +1 -1
  65. package/dist/{chunk-c9dmpdss.js → chunk-8ckwc9k8.js} +46 -45
  66. package/dist/{chunk-67a4147x.js → chunk-8jy18nx9.js} +1 -1
  67. package/dist/{chunk-f2hbn5rk.js → chunk-93vwm44t.js} +100420 -57118
  68. package/dist/{chunk-cfgha78n.js → chunk-9957ffjc.js} +2 -2
  69. package/dist/{chunk-cdj51xbj.js → chunk-9byfzaeq.js} +46 -45
  70. package/dist/chunk-9ewnsd7f.js +31 -0
  71. package/dist/{chunk-xwg327ys.js → chunk-9w114071.js} +6 -6
  72. package/dist/chunk-9wf3fc4t.js +29 -0
  73. package/dist/chunk-9z9teq7p.js +87 -0
  74. package/dist/{chunk-6p4cyhb3.js → chunk-a6d2q415.js} +2 -2
  75. package/dist/{chunk-jgzxmtpf.js → chunk-ay5fvc2r.js} +52 -52
  76. package/dist/{chunk-1ybvj5df.js → chunk-ayx9aq2k.js} +47 -46
  77. package/dist/{chunk-23fkapww.js → chunk-azv68vk1.js} +2 -2
  78. package/dist/chunk-b547q41s.js +92 -0
  79. package/dist/{chunk-jgjqa49s.js → chunk-b56smerd.js} +3 -3
  80. package/dist/{chunk-enkdxqas.js → chunk-b5asw4tj.js} +6 -6
  81. package/dist/{chunk-nk82j7r2.js → chunk-b6prbsae.js} +7 -7
  82. package/dist/{chunk-ya40p6vj.js → chunk-b89ese8r.js} +46 -45
  83. package/dist/{chunk-byb2mn1c.js → chunk-be77bcs8.js} +118 -450
  84. package/dist/{chunk-m46xyqr6.js → chunk-bf03a1w7.js} +48 -47
  85. package/dist/{chunk-dmqeqxfz.js → chunk-bjdknxqn.js} +46 -45
  86. package/dist/{chunk-m87bhhqv.js → chunk-bzatg35k.js} +1 -1
  87. package/dist/{chunk-8ybw2s0h.js → chunk-c4d52460.js} +4 -4
  88. package/dist/{chunk-6g5qbbxk.js → chunk-c5zkrd7r.js} +47 -46
  89. package/dist/{chunk-4140c8xy.js → chunk-c6hsz5ey.js} +20 -24
  90. package/dist/{chunk-wqvr37xp.js → chunk-cay13mxk.js} +15 -31
  91. package/dist/{chunk-s3hsqf80.js → chunk-cexw1jmv.js} +30 -81
  92. package/dist/{chunk-cvm2tmwg.js → chunk-ckh4f9ry.js} +20 -24
  93. package/dist/{chunk-qn8z4r79.js → chunk-cr1dv2js.js} +50 -48
  94. package/dist/{chunk-88cekjja.js → chunk-d8z7pyrb.js} +47 -46
  95. package/dist/chunk-dexkgxt4.js +211 -0
  96. package/dist/{chunk-xxw9a0bq.js → chunk-dhwr4fz4.js} +2 -2
  97. package/dist/{chunk-0ym2z0c7.js → chunk-dj7d67ya.js} +1 -1
  98. package/dist/chunk-djfq8ws0.js +124 -0
  99. package/dist/{chunk-x2pvw7xw.js → chunk-dmyedkpw.js} +8 -8
  100. package/dist/{chunk-v0bykh19.js → chunk-dngfdsm9.js} +108 -102
  101. package/dist/{chunk-8nfn89nz.js → chunk-dt3epnwj.js} +9 -9
  102. package/dist/{chunk-4r50c14n.js → chunk-dz6zxh89.js} +46 -45
  103. package/dist/{chunk-jh965sa0.js → chunk-e7ag583m.js} +47 -46
  104. package/dist/{chunk-th4y838y.js → chunk-ec6ga5ey.js} +51 -50
  105. package/dist/{chunk-4g0nj78p.js → chunk-ecbh4n6q.js} +46 -45
  106. package/dist/{chunk-ydcsbj4t.js → chunk-ecv9kbtk.js} +11 -9
  107. package/dist/{chunk-nvwwtq1w.js → chunk-ecvy1ng2.js} +49 -48
  108. package/dist/{chunk-s4zb3f1b.js → chunk-ef2m4xyz.js} +46 -45
  109. package/dist/{chunk-psnsve7m.js → chunk-etbb3dss.js} +49 -48
  110. package/dist/{chunk-jgpmpgx6.js → chunk-etdt1xz3.js} +1 -1
  111. package/dist/{chunk-jxfp3g9b.js → chunk-ev7h351p.js} +4 -4
  112. package/dist/{chunk-njxgct8f.js → chunk-ey0n4emm.js} +46 -45
  113. package/dist/{chunk-af868wet.js → chunk-f4tdn7yr.js} +46 -45
  114. package/dist/{chunk-bd5sqj86.js → chunk-f4v7t54y.js} +11 -11
  115. package/dist/{chunk-8ywngxqt.js → chunk-fesvrjhd.js} +10 -10
  116. package/dist/{chunk-j4m8fd76.js → chunk-frm7mphm.js} +7 -11
  117. package/dist/{chunk-kek5v6ef.js → chunk-frwznxnf.js} +3 -3
  118. package/dist/{chunk-030rqd3a.js → chunk-ftsdm7y7.js} +54 -53
  119. package/dist/{chunk-vdcm8hz6.js → chunk-g597bz1j.js} +47 -46
  120. package/dist/chunk-g5pe8dew.js +25 -0
  121. package/dist/{chunk-tvzr9c8a.js → chunk-g78fetxa.js} +46 -45
  122. package/dist/{chunk-ga86yjm1.js → chunk-gdwdqewd.js} +3 -3
  123. package/dist/{chunk-dvcwahst.js → chunk-ghwvqhx9.js} +51 -50
  124. package/dist/chunk-gkn3jgqn.js +123 -0
  125. package/dist/{chunk-23q4jpn2.js → chunk-grqhgr2b.js} +3 -3
  126. package/dist/chunk-grqkx44z.js +90 -0
  127. package/dist/{chunk-21jsjcfa.js → chunk-gzj94jgg.js} +46 -45
  128. package/dist/{chunk-g5pgham9.js → chunk-h3vyya5n.js} +20 -14
  129. package/dist/{chunk-15edybe0.js → chunk-h4xfadhf.js} +1 -1
  130. package/dist/chunk-h61d4awv.js +95 -0
  131. package/dist/{chunk-w05jpkkr.js → chunk-hae34yd0.js} +5 -9
  132. package/dist/{chunk-rtmh0v4c.js → chunk-hb1gr101.js} +6 -6
  133. package/dist/{chunk-5a5w0ygx.js → chunk-hg45r671.js} +2 -2
  134. package/dist/{chunk-d9yghsfg.js → chunk-hg6fwhj1.js} +1 -1
  135. package/dist/{chunk-1cq2vrzq.js → chunk-hgmhngje.js} +4 -4
  136. package/dist/{chunk-vvjgdzhn.js → chunk-hparkfvt.js} +55 -51
  137. package/dist/{chunk-ahrhwpm9.js → chunk-hqjdgc6c.js} +2 -2
  138. package/dist/{chunk-37p5p94r.js → chunk-hrhp26d7.js} +55 -54
  139. package/dist/{chunk-xrpstt41.js → chunk-hzbr9543.js} +4 -4
  140. package/dist/{chunk-1dwvgrfc.js → chunk-j0gke393.js} +46 -45
  141. package/dist/{chunk-yyf72f78.js → chunk-j35mw64g.js} +4 -2
  142. package/dist/{chunk-425w66ka.js → chunk-j99ms5ep.js} +4 -4
  143. package/dist/{chunk-dtgh4te6.js → chunk-jgvmjwnx.js} +46 -45
  144. package/dist/{chunk-87scz097.js → chunk-jj4zs4gr.js} +46 -45
  145. package/dist/{chunk-am3qcgzp.js → chunk-jjz3hs34.js} +56 -55
  146. package/dist/{chunk-1a6ez1mg.js → chunk-jksf0ax9.js} +51 -49
  147. package/dist/{chunk-gdhz1652.js → chunk-jqfrz5g9.js} +27 -30
  148. package/dist/{chunk-q7jnesv8.js → chunk-jsj3fx0g.js} +5 -5
  149. package/dist/{chunk-vawgyev5.js → chunk-jtgyzqbq.js} +3 -3
  150. package/dist/{chunk-xfkfh5sd.js → chunk-jwpp2bq2.js} +1808 -1643
  151. package/dist/{chunk-zq6ezxh2.js → chunk-jwwpfq76.js} +49 -45
  152. package/dist/{chunk-qq5d2s0d.js → chunk-jxp2j9t5.js} +46 -45
  153. package/dist/{chunk-zctfbr1v.js → chunk-k7cw1a8a.js} +1 -1
  154. package/dist/chunk-k8jpbz31.js +62 -0
  155. package/dist/{chunk-tdbz9gbm.js → chunk-kjqyhxz7.js} +6 -6
  156. package/dist/{chunk-yc23zxmj.js → chunk-kxrrtr3p.js} +1 -1
  157. package/dist/chunk-m70n19dz.js +93 -0
  158. package/dist/{chunk-4nspekjp.js → chunk-mcws22k3.js} +1 -28
  159. package/dist/{chunk-a1bf2kh4.js → chunk-mewywsar.js} +46 -45
  160. package/dist/{chunk-k7g9gcr9.js → chunk-mmhkcj7c.js} +64 -58
  161. package/dist/{chunk-rm2vtv77.js → chunk-msxggy37.js} +22 -25
  162. package/dist/{chunk-s1tg295x.js → chunk-njw0haha.js} +10 -8
  163. package/dist/{chunk-5rv9c8yd.js → chunk-nrjtxhyr.js} +1 -1
  164. package/dist/{chunk-nqn45znr.js → chunk-ns7x6xam.js} +9 -9
  165. package/dist/{chunk-jaaxk89e.js → chunk-nsc89h0n.js} +2 -22
  166. package/dist/{chunk-z19sd3bt.js → chunk-p4196wzm.js} +5 -5
  167. package/dist/{chunk-1dgdjrm1.js → chunk-p791ydbm.js} +4 -4
  168. package/dist/{chunk-1zhy5cbc.js → chunk-p9ny0p2a.js} +13 -13
  169. package/dist/{chunk-phd1qfpc.js → chunk-pd2vy8hx.js} +5 -5
  170. package/dist/{chunk-gnj7tyj6.js → chunk-pddf0719.js} +49 -48
  171. package/dist/{chunk-6t5zvnrg.js → chunk-pfarypfq.js} +48 -46
  172. package/dist/{chunk-w4yn8cq7.js → chunk-psm26hv7.js} +8 -8
  173. package/dist/{chunk-hwn8vetn.js → chunk-pwpk3gm6.js} +10 -10
  174. package/dist/{chunk-va8drjmv.js → chunk-q14wrksq.js} +48 -47
  175. package/dist/{chunk-twqzmqsn.js → chunk-q4f1g9y6.js} +31 -27
  176. package/dist/{chunk-23jzrwsw.js → chunk-q6tdxy8v.js} +5 -5
  177. package/dist/chunk-q8hxwh48.js +445 -0
  178. package/dist/{chunk-eenq3avg.js → chunk-qcrpqjya.js} +1 -1
  179. package/dist/{chunk-e7efcp3k.js → chunk-qctsv1d7.js} +257 -2857
  180. package/dist/{chunk-ck0ap688.js → chunk-qkczt8cr.js} +4 -4
  181. package/dist/{chunk-2fxpd35d.js → chunk-qkp4ygnk.js} +2 -2
  182. package/dist/{chunk-c3d2cnz5.js → chunk-qqs58ywv.js} +7 -7
  183. package/dist/{chunk-qdnxk7d7.js → chunk-qxjhw1dt.js} +29 -30
  184. package/dist/{chunk-rkg741k3.js → chunk-qz0xdht6.js} +14 -14
  185. package/dist/chunk-r3ehjkj5.js +123 -0
  186. package/dist/{chunk-wbbykfdd.js → chunk-r5nd93kc.js} +1 -1
  187. package/dist/{chunk-yzcjz0gg.js → chunk-r6nnp8mj.js} +46 -45
  188. package/dist/{chunk-bm5rc541.js → chunk-r7684mmh.js} +5 -5
  189. package/dist/chunk-ratnrv9v.js +517 -0
  190. package/dist/{chunk-nx7c354z.js → chunk-rfbbcx5s.js} +46 -45
  191. package/dist/{chunk-z9n0183s.js → chunk-rfq9kmsy.js} +9 -9
  192. package/dist/{chunk-qsc98gbe.js → chunk-rhvn1rqs.js} +2 -2
  193. package/dist/{chunk-gvrjgq1n.js → chunk-rjq5nf1c.js} +16 -20
  194. package/dist/{chunk-xp61y5ba.js → chunk-rkv8bdtr.js} +2 -2
  195. package/dist/{chunk-tff58196.js → chunk-rmpaj37q.js} +48 -47
  196. package/dist/{chunk-k1crm94z.js → chunk-rn1s097c.js} +46 -45
  197. package/dist/{chunk-c42pqnxx.js → chunk-rnxpvm3m.js} +1 -1
  198. package/dist/{chunk-k0v0cz71.js → chunk-rpsqtvkx.js} +46 -45
  199. package/dist/{chunk-t5vbqd9d.js → chunk-rx4mcfg1.js} +55 -54
  200. package/dist/{chunk-30smv00b.js → chunk-rygxwjtc.js} +47 -46
  201. package/dist/{chunk-jpc9zwsk.js → chunk-rz94yg8c.js} +3 -3
  202. package/dist/{chunk-0m9w9esf.js → chunk-s19b0bc7.js} +46 -45
  203. package/dist/{chunk-wayfjcwt.js → chunk-sdfvr9ps.js} +4 -4
  204. package/dist/{chunk-fkhs3myp.js → chunk-sh2v9ywv.js} +5 -3
  205. package/dist/{chunk-1avzakfd.js → chunk-sjpqw47t.js} +3 -3
  206. package/dist/{chunk-7mqab3z7.js → chunk-skp5w8bq.js} +1 -1
  207. package/dist/{chunk-76j2e9vy.js → chunk-snxp8mxj.js} +2 -2
  208. package/dist/{chunk-vsqwd13w.js → chunk-ssb4wba6.js} +17 -19
  209. package/dist/{chunk-kva79cra.js → chunk-szzff973.js} +7 -5
  210. package/dist/{chunk-st73prx0.js → chunk-t1pygy19.js} +47 -46
  211. package/dist/{chunk-q1ah9nbq.js → chunk-t1s91wrk.js} +1 -1
  212. package/dist/{chunk-3skj4gfg.js → chunk-t3gmfcy7.js} +47 -46
  213. package/dist/{chunk-xw8pjerk.js → chunk-t9eeyrkn.js} +48 -47
  214. package/dist/{chunk-0jtbeesf.js → chunk-tf859h88.js} +16 -20
  215. package/dist/{chunk-denyma1s.js → chunk-thenr6b3.js} +14 -12
  216. package/dist/{chunk-234668cb.js → chunk-thmtkfgj.js} +5 -5
  217. package/dist/chunk-tj7v47cp.js +20 -0
  218. package/dist/{chunk-12k745vf.js → chunk-tpk67mjc.js} +3 -3
  219. package/dist/chunk-trvc6jh7.js +92 -0
  220. package/dist/{chunk-9v13f3gm.js → chunk-ttyfhx12.js} +524 -195
  221. package/dist/{chunk-q87kegxh.js → chunk-txgbs4hp.js} +49 -48
  222. package/dist/{chunk-25bwa70y.js → chunk-ty1cyqr7.js} +49 -48
  223. package/dist/{chunk-r6kaak61.js → chunk-v0tgjdx0.js} +16 -20
  224. package/dist/chunk-v3s93bzd.js +34 -0
  225. package/dist/{chunk-4cp6193g.js → chunk-v4t6dyyh.js} +2 -2
  226. package/dist/{chunk-fape0yfp.js → chunk-v4wba09w.js} +46 -45
  227. package/dist/{chunk-h02gcdx5.js → chunk-v5g8nf5h.js} +8 -8
  228. package/dist/{chunk-jtztm8f5.js → chunk-v6hbqcmr.js} +44 -43
  229. package/dist/{chunk-21gmrwhs.js → chunk-vajsk9ya.js} +17 -21
  230. package/dist/{chunk-8hpq2659.js → chunk-vbtm9g57.js} +1 -1
  231. package/dist/{chunk-q7e0106d.js → chunk-vk3nb2xe.js} +51 -56
  232. package/dist/{chunk-ad3v6mzw.js → chunk-vmbht6ec.js} +12 -12
  233. package/dist/{chunk-as5rvw4n.js → chunk-vmp5rk8q.js} +17 -21
  234. package/dist/{chunk-1x0y4426.js → chunk-vtmxgm1m.js} +4 -4
  235. package/dist/{chunk-pb92bj1h.js → chunk-vw5jzpcm.js} +6 -6
  236. package/dist/{chunk-5cem2v7n.js → chunk-vyz3v0qx.js} +5 -5
  237. package/dist/{chunk-hxzt3r84.js → chunk-w3782jck.js} +51 -50
  238. package/dist/{chunk-1vnd9s2j.js → chunk-w3gnkyfc.js} +57 -66
  239. package/dist/chunk-w6mcmmt5.js +1457 -0
  240. package/dist/chunk-wa0xgm6m.js +988 -0
  241. package/dist/{chunk-vrjbc8ap.js → chunk-wa8yn2p0.js} +1 -1
  242. package/dist/{chunk-hya4c599.js → chunk-wg47eg7y.js} +46 -45
  243. package/dist/{chunk-y7we499r.js → chunk-wgd4n1q7.js} +8 -8
  244. package/dist/{chunk-0g5cy3wj.js → chunk-wgk9sxk7.js} +4 -4
  245. package/dist/{chunk-wr3pd88n.js → chunk-wkt2q02c.js} +40 -9
  246. package/dist/{chunk-gbte7d7h.js → chunk-wm1zm5xj.js} +4 -2
  247. package/dist/{chunk-3hwa20vg.js → chunk-wtpgjmjd.js} +49 -46
  248. package/dist/{chunk-dbwmzvfj.js → chunk-wxkrq9eb.js} +46 -45
  249. package/dist/{chunk-d00mfc1e.js → chunk-x2bnzvd6.js} +46 -45
  250. package/dist/{chunk-2xbyb015.js → chunk-x3jthbjq.js} +47 -46
  251. package/dist/chunk-x7fdwq3d.js +33 -0
  252. package/dist/{chunk-zhk465tg.js → chunk-xcrzgyce.js} +46 -45
  253. package/dist/{chunk-chsyvavm.js → chunk-xeb6075z.js} +1 -1
  254. package/dist/{chunk-6ksdp40n.js → chunk-xffb3dsw.js} +1 -1
  255. package/dist/{chunk-2j3v2dgk.js → chunk-xgbd6ec5.js} +47 -46
  256. package/dist/{chunk-n7pnyq43.js → chunk-xhfmdq1y.js} +16 -0
  257. package/dist/{chunk-2v4x8kaq.js → chunk-xhn4ptjn.js} +51 -50
  258. package/dist/{chunk-w1sv7j01.js → chunk-xs7zsmzk.js} +46 -45
  259. package/dist/chunk-xswyz2es.js +118 -0
  260. package/dist/{chunk-ky39hkg1.js → chunk-xtdm6ejq.js} +9 -7
  261. package/dist/{chunk-hh3k5s1s.js → chunk-xvk90wpt.js} +3 -3
  262. package/dist/{chunk-5awgsvrw.js → chunk-xw99fqv1.js} +14 -6
  263. package/dist/{chunk-xnv6kb39.js → chunk-y32em34x.js} +22 -23
  264. package/dist/chunk-y5wfy524.js +94 -0
  265. package/dist/{chunk-fk8crdnk.js → chunk-ya9dxex0.js} +48 -46
  266. package/dist/{chunk-97wgdsab.js → chunk-z16txqz0.js} +3 -3
  267. package/dist/{chunk-yvtzznds.js → chunk-z6wm96eh.js} +2 -2
  268. package/dist/{chunk-nqrc7pc4.js → chunk-zcgprbyy.js} +29 -27
  269. package/dist/chunk-zqbnw3n2.js +197 -0
  270. package/dist/{chunk-d6rypdxt.js → chunk-zxywawr7.js} +1 -1
  271. package/dist/{chunk-jj5wj46b.js → chunk-zyjkg76f.js} +7 -7
  272. package/dist/cli.js +8 -8
  273. package/dist/gateway/index.js +326 -0
  274. package/dist/gateway/worker.js +482241 -0
  275. package/package.json +1 -1
  276. package/dist/chunk-11cz07kz.js +0 -93
  277. package/dist/chunk-1pbtp2z2.js +0 -92
  278. package/dist/chunk-25y2dtzf.js +0 -91
  279. package/dist/chunk-3hyj0zpy.js +0 -95
  280. package/dist/chunk-4kqjjakw.js +0 -73
  281. package/dist/chunk-4zwqbg7s.js +0 -87
  282. package/dist/chunk-5be33wja.js +0 -120
  283. package/dist/chunk-70mgxhkz.js +0 -369
  284. package/dist/chunk-7gmk09cq.js +0 -116
  285. package/dist/chunk-8dprcdra.js +0 -92
  286. package/dist/chunk-8xwx1xtg.js +0 -120
  287. package/dist/chunk-a579wjd2.js +0 -436
  288. package/dist/chunk-axqk3mxk.js +0 -116
  289. package/dist/chunk-c0ckmxr1.js +0 -86
  290. package/dist/chunk-c6t24y8q.js +0 -94
  291. package/dist/chunk-cfv996bs.js +0 -22
  292. package/dist/chunk-e5t5eefc.js +0 -62
  293. package/dist/chunk-eyph0250.js +0 -88
  294. package/dist/chunk-f825x57v.js +0 -91
  295. package/dist/chunk-h9xx5bj6.js +0 -91
  296. package/dist/chunk-j1dg659r.js +0 -89
  297. package/dist/chunk-jk8seqkk.js +0 -90
  298. package/dist/chunk-jzg4nddc.js +0 -92
  299. package/dist/chunk-k5vy0s3c.js +0 -93
  300. package/dist/chunk-ke820fjw.js +0 -91
  301. package/dist/chunk-kyzd4p8z.js +0 -111
  302. package/dist/chunk-njrt3tac.js +0 -640
  303. package/dist/chunk-pavb6a7w.js +0 -516
  304. package/dist/chunk-q268gpa0.js +0 -145
  305. package/dist/chunk-qvh1w3t7.js +0 -157
  306. package/dist/chunk-qy1es4jj.js +0 -95
  307. package/dist/chunk-qz2x630m.js +0 -49145
  308. package/dist/chunk-tw48evtr.js +0 -40
  309. package/dist/chunk-w0gfctyc.js +0 -117
  310. package/dist/chunk-y0fhjxef.js +0 -276
  311. package/dist/chunk-y275vgmw.js +0 -654
  312. package/dist/chunk-zq7pmdas.js +0 -1003
@@ -0,0 +1,1534 @@
1
+ // @bun
2
+ import {
3
+ getProxyFetchOptions,
4
+ init_proxy
5
+ } from "./chunk-7krg0dkt.js";
6
+ import {
7
+ LIGHTNING_BOLT,
8
+ capitalize,
9
+ getAnthropicApiKey,
10
+ getApiKeyFromApiKeyHelper,
11
+ getFeatureValue_CACHED_MAY_BE_STALE,
12
+ getGlobalConfig,
13
+ getInitialSettings,
14
+ getSettingsForSource,
15
+ getSettings_DEPRECATED,
16
+ getUserAgent,
17
+ init_auth,
18
+ init_config,
19
+ init_figures,
20
+ init_growthbook,
21
+ init_http,
22
+ init_isEqual,
23
+ init_settings1 as init_settings,
24
+ init_stringUtils,
25
+ isEqual_default,
26
+ saveGlobalConfig,
27
+ updateSettingsForSource
28
+ } from "./chunk-qctsv1d7.js";
29
+ import {
30
+ init_json,
31
+ safeParseJSON
32
+ } from "./chunk-p4196wzm.js";
33
+ import {
34
+ init_lazySchema,
35
+ lazySchema
36
+ } from "./chunk-64c1avct.js";
37
+ import {
38
+ init_v4
39
+ } from "./chunk-4pbx3g7s.js";
40
+ import {
41
+ exports_external
42
+ } from "./chunk-26wtxbdc.js";
43
+ import {
44
+ getApiConfig,
45
+ init_apiConfig,
46
+ init_bundledMode,
47
+ isInBundledMode
48
+ } from "./chunk-cexw1jmv.js";
49
+ import {
50
+ init_analytics,
51
+ logEvent
52
+ } from "./chunk-x8d2ehd7.js";
53
+ import {
54
+ init_privacyLevel,
55
+ isEssentialTrafficOnly
56
+ } from "./chunk-5cxjxxx8.js";
57
+ import {
58
+ Anthropic,
59
+ init_debug,
60
+ init_sdk,
61
+ init_slowOperations,
62
+ isDebugToStdErr,
63
+ jsonStringify,
64
+ logForDebugging
65
+ } from "./chunk-pd2vy8hx.js";
66
+ import {
67
+ getClaudeConfigHomeDir,
68
+ init_envUtils,
69
+ isEnvTruthy
70
+ } from "./chunk-nsc89h0n.js";
71
+ import {
72
+ createSignal,
73
+ getIsNonInteractiveSession,
74
+ getKairosActive,
75
+ getMainLoopModelOverride,
76
+ getModelStrings,
77
+ getSessionId,
78
+ init_signal,
79
+ init_state,
80
+ preferThirdPartyAuthentication,
81
+ setHasUnknownModelCost,
82
+ setModelStrings
83
+ } from "./chunk-k8vp0atq.js";
84
+ import {
85
+ init_memoize,
86
+ memoize_default
87
+ } from "./chunk-vf612n57.js";
88
+ import {
89
+ axios_default,
90
+ init_axios
91
+ } from "./chunk-55raexh7.js";
92
+ import {
93
+ __esm
94
+ } from "./chunk-qp2qdcda.js";
95
+
96
+ // src/utils/model/providers.ts
97
+ function getAPIProvider() {
98
+ const modelType = getInitialSettings().modelType;
99
+ if (modelType === "openai")
100
+ return "openai";
101
+ if (isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI))
102
+ return "openai";
103
+ return "firstParty";
104
+ }
105
+ function getAPIProviderForStatsig() {
106
+ return getAPIProvider();
107
+ }
108
+ function isFirstPartyAnthropicBaseUrl() {
109
+ const baseUrl = process.env.ANTHROPIC_BASE_URL;
110
+ if (!baseUrl) {
111
+ return true;
112
+ }
113
+ try {
114
+ const host = new URL(baseUrl).host;
115
+ const allowedHosts = ["api.anthropic.com"];
116
+ if (process.env.USER_TYPE === "ant") {
117
+ allowedHosts.push("api-staging.anthropic.com");
118
+ }
119
+ return allowedHosts.includes(host);
120
+ } catch {
121
+ return false;
122
+ }
123
+ }
124
+ var init_providers = __esm(() => {
125
+ init_settings();
126
+ init_envUtils();
127
+ });
128
+
129
+ // src/services/api/client.ts
130
+ import { randomUUID } from "crypto";
131
+ function createStderrLogger() {
132
+ return {
133
+ error: (msg, ...args) => console.error("[Anthropic SDK ERROR]", msg, ...args),
134
+ warn: (msg, ...args) => console.error("[Anthropic SDK WARN]", msg, ...args),
135
+ info: (msg, ...args) => console.error("[Anthropic SDK INFO]", msg, ...args),
136
+ debug: (msg, ...args) => console.error("[Anthropic SDK DEBUG]", msg, ...args)
137
+ };
138
+ }
139
+ async function getAnthropicClient({
140
+ apiKey,
141
+ maxRetries,
142
+ model,
143
+ fetchOverride,
144
+ source
145
+ }) {
146
+ const containerId = process.env.CLAUDE_CODE_CONTAINER_ID;
147
+ const remoteSessionId = process.env.CLAUDE_CODE_REMOTE_SESSION_ID;
148
+ const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP;
149
+ const customHeaders = getCustomHeaders();
150
+ const defaultHeaders = {
151
+ "x-app": "cli",
152
+ "User-Agent": getUserAgent(),
153
+ "X-Claude-Code-Session-Id": getSessionId(),
154
+ ...customHeaders,
155
+ ...containerId ? { "x-claude-remote-container-id": containerId } : {},
156
+ ...remoteSessionId ? { "x-claude-remote-session-id": remoteSessionId } : {},
157
+ ...clientApp ? { "x-client-app": clientApp } : {}
158
+ };
159
+ logForDebugging(`[API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: ${!!process.env.ANTHROPIC_CUSTOM_HEADERS}, has Authorization header: ${!!customHeaders["Authorization"]}`);
160
+ const additionalProtectionEnabled = isEnvTruthy(process.env.CLAUDE_CODE_ADDITIONAL_PROTECTION);
161
+ if (additionalProtectionEnabled) {
162
+ defaultHeaders["x-anthropic-additional-protection"] = "true";
163
+ }
164
+ logForDebugging("[API:auth] Configuring API key headers");
165
+ await configureApiKeyHeaders(defaultHeaders, getIsNonInteractiveSession());
166
+ const resolvedFetch = buildFetch(fetchOverride, source);
167
+ const ARGS = {
168
+ defaultHeaders,
169
+ maxRetries,
170
+ timeout: parseInt(process.env.API_TIMEOUT_MS || String(600 * 1000), 10),
171
+ dangerouslyAllowBrowser: true,
172
+ fetchOptions: getProxyFetchOptions({
173
+ forAnthropicAPI: true
174
+ }),
175
+ ...resolvedFetch && {
176
+ fetch: resolvedFetch
177
+ }
178
+ };
179
+ const clientConfig = {
180
+ apiKey: apiKey || getAnthropicApiKey(),
181
+ ...ARGS,
182
+ ...isDebugToStdErr() && { logger: createStderrLogger() }
183
+ };
184
+ return new Anthropic(clientConfig);
185
+ }
186
+ async function configureApiKeyHeaders(headers, isNonInteractiveSession) {
187
+ const token = process.env.ANTHROPIC_AUTH_TOKEN || await getApiKeyFromApiKeyHelper(isNonInteractiveSession);
188
+ if (token) {
189
+ headers["Authorization"] = `Bearer ${token}`;
190
+ }
191
+ }
192
+ function getCustomHeaders() {
193
+ const customHeaders = {};
194
+ const customHeadersEnv = process.env.ANTHROPIC_CUSTOM_HEADERS;
195
+ if (!customHeadersEnv)
196
+ return customHeaders;
197
+ const headerStrings = customHeadersEnv.split(/\n|\r\n/);
198
+ for (const headerString of headerStrings) {
199
+ if (!headerString.trim())
200
+ continue;
201
+ const colonIdx = headerString.indexOf(":");
202
+ if (colonIdx === -1)
203
+ continue;
204
+ const name = headerString.slice(0, colonIdx).trim();
205
+ const value = headerString.slice(colonIdx + 1).trim();
206
+ if (name) {
207
+ customHeaders[name] = value;
208
+ }
209
+ }
210
+ return customHeaders;
211
+ }
212
+ function buildFetch(fetchOverride, source) {
213
+ const inner = fetchOverride ?? globalThis.fetch;
214
+ const injectClientRequestId = getAPIProvider() === "firstParty" && isFirstPartyAnthropicBaseUrl();
215
+ return (input, init) => {
216
+ const headers = new Headers(init?.headers);
217
+ if (injectClientRequestId && !headers.has(CLIENT_REQUEST_ID_HEADER)) {
218
+ headers.set(CLIENT_REQUEST_ID_HEADER, randomUUID());
219
+ }
220
+ try {
221
+ const url = input instanceof Request ? input.url : String(input);
222
+ const id = headers.get(CLIENT_REQUEST_ID_HEADER);
223
+ logForDebugging(`[API REQUEST] ${new URL(url).pathname}${id ? ` ${CLIENT_REQUEST_ID_HEADER}=${id}` : ""} source=${source ?? "unknown"}`);
224
+ } catch {}
225
+ return inner(input, { ...init, headers });
226
+ };
227
+ }
228
+ var CLIENT_REQUEST_ID_HEADER = "x-client-request-id";
229
+ var init_client = __esm(() => {
230
+ init_sdk();
231
+ init_auth();
232
+ init_http();
233
+ init_providers();
234
+ init_proxy();
235
+ init_state();
236
+ init_debug();
237
+ init_envUtils();
238
+ });
239
+
240
+ // src/utils/model/modelCapabilities.ts
241
+ import { readFileSync } from "fs";
242
+ import { mkdir, writeFile } from "fs/promises";
243
+ import { join } from "path";
244
+ function getCacheDir() {
245
+ return join(getClaudeConfigHomeDir(), "cache");
246
+ }
247
+ function getCachePath() {
248
+ return join(getCacheDir(), "model-capabilities.json");
249
+ }
250
+ function isModelCapabilitiesEligible() {
251
+ if (process.env.USER_TYPE !== "ant")
252
+ return false;
253
+ if (getAPIProvider() !== "firstParty")
254
+ return false;
255
+ if (!isFirstPartyAnthropicBaseUrl())
256
+ return false;
257
+ return true;
258
+ }
259
+ function sortForMatching(models) {
260
+ return [...models].sort((a, b) => b.id.length - a.id.length || a.id.localeCompare(b.id));
261
+ }
262
+ function getModelCapability(model) {
263
+ if (!isModelCapabilitiesEligible())
264
+ return;
265
+ const cached = loadCache(getCachePath());
266
+ if (!cached || cached.length === 0)
267
+ return;
268
+ const m = model.toLowerCase();
269
+ const exact = cached.find((c) => c.id.toLowerCase() === m);
270
+ if (exact)
271
+ return exact;
272
+ return cached.find((c) => m.includes(c.id.toLowerCase()));
273
+ }
274
+ async function refreshModelCapabilities() {
275
+ if (!isModelCapabilitiesEligible())
276
+ return;
277
+ if (isEssentialTrafficOnly())
278
+ return;
279
+ try {
280
+ const anthropic = await getAnthropicClient({ maxRetries: 1 });
281
+ const betas = undefined;
282
+ const parsed = [];
283
+ for await (const entry of anthropic.models.list({ betas })) {
284
+ const result = ModelCapabilitySchema().safeParse(entry);
285
+ if (result.success)
286
+ parsed.push(result.data);
287
+ }
288
+ if (parsed.length === 0)
289
+ return;
290
+ const path = getCachePath();
291
+ const models = sortForMatching(parsed);
292
+ if (isEqual_default(loadCache(path), models)) {
293
+ logForDebugging("[modelCapabilities] cache unchanged, skipping write");
294
+ return;
295
+ }
296
+ await mkdir(getCacheDir(), { recursive: true });
297
+ await writeFile(path, jsonStringify({ models, timestamp: Date.now() }), {
298
+ encoding: "utf-8",
299
+ mode: 384
300
+ });
301
+ loadCache.cache.delete(path);
302
+ logForDebugging(`[modelCapabilities] cached ${models.length} models`);
303
+ } catch (error) {
304
+ logForDebugging(`[modelCapabilities] fetch failed: ${error instanceof Error ? error.message : "unknown"}`);
305
+ }
306
+ }
307
+ var ModelCapabilitySchema, CacheFileSchema, loadCache;
308
+ var init_modelCapabilities = __esm(() => {
309
+ init_isEqual();
310
+ init_memoize();
311
+ init_v4();
312
+ init_client();
313
+ init_debug();
314
+ init_envUtils();
315
+ init_json();
316
+ init_lazySchema();
317
+ init_privacyLevel();
318
+ init_slowOperations();
319
+ init_providers();
320
+ ModelCapabilitySchema = lazySchema(() => exports_external.object({
321
+ id: exports_external.string(),
322
+ max_input_tokens: exports_external.number().optional(),
323
+ max_tokens: exports_external.number().optional()
324
+ }).strip());
325
+ CacheFileSchema = lazySchema(() => exports_external.object({
326
+ models: exports_external.array(ModelCapabilitySchema()),
327
+ timestamp: exports_external.number()
328
+ }));
329
+ loadCache = memoize_default((path) => {
330
+ try {
331
+ const raw = readFileSync(path, "utf-8");
332
+ const parsed = CacheFileSchema().safeParse(safeParseJSON(raw, false));
333
+ return parsed.success ? parsed.data.models : null;
334
+ } catch {
335
+ return null;
336
+ }
337
+ }, (path) => path);
338
+ });
339
+
340
+ // src/constants/betas.ts
341
+ var CLAUDE_CODE_20250219_BETA_HEADER = "claude-code-20250219", INTERLEAVED_THINKING_BETA_HEADER = "interleaved-thinking-2025-05-14", CONTEXT_1M_BETA_HEADER = "context-1m-2025-08-07", CONTEXT_MANAGEMENT_BETA_HEADER = "context-management-2025-06-27", STRUCTURED_OUTPUTS_BETA_HEADER = "structured-outputs-2025-12-15", TOOL_SEARCH_BETA_HEADER_1P = "advanced-tool-use-2025-11-20", EFFORT_BETA_HEADER = "effort-2025-11-24", TASK_BUDGETS_BETA_HEADER = "task-budgets-2026-03-13", PROMPT_CACHING_SCOPE_BETA_HEADER = "prompt-caching-scope-2026-01-05", FAST_MODE_BETA_HEADER = "fast-mode-2026-02-01", REDACT_THINKING_BETA_HEADER = "redact-thinking-2026-02-12", TOKEN_EFFICIENT_TOOLS_BETA_HEADER = "token-efficient-tools-2026-03-28", AFK_MODE_BETA_HEADER = "", CLI_INTERNAL_BETA_HEADER, ADVISOR_BETA_HEADER = "advisor-tool-2026-03-01";
342
+ var init_betas = __esm(() => {
343
+ CLI_INTERNAL_BETA_HEADER = process.env.USER_TYPE === "ant" ? "cli-internal-2026-02-09" : "";
344
+ });
345
+
346
+ // src/utils/model/antModels.ts
347
+ function getAntModelOverrideConfig() {
348
+ if (process.env.USER_TYPE !== "ant") {
349
+ return null;
350
+ }
351
+ return getFeatureValue_CACHED_MAY_BE_STALE("tengu_ant_model_override", null);
352
+ }
353
+ function getAntModels() {
354
+ if (process.env.USER_TYPE !== "ant") {
355
+ return [];
356
+ }
357
+ return getAntModelOverrideConfig()?.antModels ?? [];
358
+ }
359
+ function resolveAntModel(model) {
360
+ if (process.env.USER_TYPE !== "ant") {
361
+ return;
362
+ }
363
+ if (model === undefined) {
364
+ return;
365
+ }
366
+ const lower = model.toLowerCase();
367
+ return getAntModels().find((m) => m.alias === model || lower.includes(m.model.toLowerCase()));
368
+ }
369
+ var init_antModels = __esm(() => {
370
+ init_growthbook();
371
+ });
372
+
373
+ // src/utils/model/configs.ts
374
+ var CLAUDE_3_7_SONNET_CONFIG, CLAUDE_3_5_V2_SONNET_CONFIG, CLAUDE_3_5_HAIKU_CONFIG, CLAUDE_HAIKU_4_5_CONFIG, CLAUDE_SONNET_4_CONFIG, CLAUDE_SONNET_4_5_CONFIG, CLAUDE_OPUS_4_CONFIG, CLAUDE_OPUS_4_1_CONFIG, CLAUDE_OPUS_4_5_CONFIG, CLAUDE_OPUS_4_6_CONFIG, CLAUDE_SONNET_4_6_CONFIG, ALL_MODEL_CONFIGS, CANONICAL_MODEL_IDS, CANONICAL_ID_TO_KEY;
375
+ var init_configs = __esm(() => {
376
+ CLAUDE_3_7_SONNET_CONFIG = {
377
+ firstParty: "claude-3-7-sonnet-20250219",
378
+ openai: "claude-3-7-sonnet-20250219"
379
+ };
380
+ CLAUDE_3_5_V2_SONNET_CONFIG = {
381
+ firstParty: "claude-3-5-sonnet-20241022",
382
+ openai: "claude-3-5-sonnet-20241022"
383
+ };
384
+ CLAUDE_3_5_HAIKU_CONFIG = {
385
+ firstParty: "claude-3-5-haiku-20241022",
386
+ openai: "claude-3-5-haiku-20241022"
387
+ };
388
+ CLAUDE_HAIKU_4_5_CONFIG = {
389
+ firstParty: "claude-haiku-4-5-20251001",
390
+ openai: "claude-haiku-4-5-20251001"
391
+ };
392
+ CLAUDE_SONNET_4_CONFIG = {
393
+ firstParty: "claude-sonnet-4-20250514",
394
+ openai: "claude-sonnet-4-20250514"
395
+ };
396
+ CLAUDE_SONNET_4_5_CONFIG = {
397
+ firstParty: "claude-sonnet-4-5-20250929",
398
+ openai: "claude-sonnet-4-5-20250929"
399
+ };
400
+ CLAUDE_OPUS_4_CONFIG = {
401
+ firstParty: "claude-opus-4-20250514",
402
+ openai: "claude-opus-4-20250514"
403
+ };
404
+ CLAUDE_OPUS_4_1_CONFIG = {
405
+ firstParty: "claude-opus-4-1-20250805",
406
+ openai: "claude-opus-4-1-20250805"
407
+ };
408
+ CLAUDE_OPUS_4_5_CONFIG = {
409
+ firstParty: "claude-opus-4-5-20251101",
410
+ openai: "claude-opus-4-5-20251101"
411
+ };
412
+ CLAUDE_OPUS_4_6_CONFIG = {
413
+ firstParty: "claude-opus-4-6",
414
+ openai: "claude-opus-4-6"
415
+ };
416
+ CLAUDE_SONNET_4_6_CONFIG = {
417
+ firstParty: "claude-sonnet-4-6",
418
+ openai: "claude-sonnet-4-6"
419
+ };
420
+ ALL_MODEL_CONFIGS = {
421
+ haiku35: CLAUDE_3_5_HAIKU_CONFIG,
422
+ haiku45: CLAUDE_HAIKU_4_5_CONFIG,
423
+ sonnet35: CLAUDE_3_5_V2_SONNET_CONFIG,
424
+ sonnet37: CLAUDE_3_7_SONNET_CONFIG,
425
+ sonnet40: CLAUDE_SONNET_4_CONFIG,
426
+ sonnet45: CLAUDE_SONNET_4_5_CONFIG,
427
+ sonnet46: CLAUDE_SONNET_4_6_CONFIG,
428
+ opus40: CLAUDE_OPUS_4_CONFIG,
429
+ opus41: CLAUDE_OPUS_4_1_CONFIG,
430
+ opus45: CLAUDE_OPUS_4_5_CONFIG,
431
+ opus46: CLAUDE_OPUS_4_6_CONFIG
432
+ };
433
+ CANONICAL_MODEL_IDS = Object.values(ALL_MODEL_CONFIGS).map((c) => c.firstParty);
434
+ CANONICAL_ID_TO_KEY = Object.fromEntries(Object.entries(ALL_MODEL_CONFIGS).map(([key, cfg]) => [cfg.firstParty, key]));
435
+ });
436
+
437
+ // src/utils/model/modelStrings.ts
438
+ function getBuiltinModelStrings(provider) {
439
+ const out = {};
440
+ for (const key of MODEL_KEYS) {
441
+ out[key] = ALL_MODEL_CONFIGS[key][provider];
442
+ }
443
+ return out;
444
+ }
445
+ function applyModelOverrides(ms) {
446
+ const overrides = getInitialSettings().modelOverrides;
447
+ if (!overrides) {
448
+ return ms;
449
+ }
450
+ const out = { ...ms };
451
+ for (const [canonicalId, override] of Object.entries(overrides)) {
452
+ const key = CANONICAL_ID_TO_KEY[canonicalId];
453
+ if (key && override) {
454
+ out[key] = override;
455
+ }
456
+ }
457
+ return out;
458
+ }
459
+ function resolveOverriddenModel(modelId) {
460
+ let overrides;
461
+ try {
462
+ overrides = getInitialSettings().modelOverrides;
463
+ } catch {
464
+ return modelId;
465
+ }
466
+ if (!overrides) {
467
+ return modelId;
468
+ }
469
+ for (const [canonicalId, override] of Object.entries(overrides)) {
470
+ if (override === modelId) {
471
+ return canonicalId;
472
+ }
473
+ }
474
+ return modelId;
475
+ }
476
+ function initModelStrings() {
477
+ const ms = getModelStrings();
478
+ if (ms !== null) {
479
+ return;
480
+ }
481
+ setModelStrings(getBuiltinModelStrings(getAPIProvider()));
482
+ }
483
+ function getModelStrings2() {
484
+ const ms = getModelStrings();
485
+ if (ms === null) {
486
+ initModelStrings();
487
+ return applyModelOverrides(getBuiltinModelStrings(getAPIProvider()));
488
+ }
489
+ return applyModelOverrides(ms);
490
+ }
491
+ async function ensureModelStringsInitialized() {
492
+ const ms = getModelStrings();
493
+ if (ms !== null) {
494
+ return;
495
+ }
496
+ setModelStrings(getBuiltinModelStrings(getAPIProvider()));
497
+ }
498
+ var MODEL_KEYS;
499
+ var init_modelStrings = __esm(() => {
500
+ init_state();
501
+ init_settings();
502
+ init_configs();
503
+ init_providers();
504
+ MODEL_KEYS = Object.keys(ALL_MODEL_CONFIGS);
505
+ });
506
+
507
+ // src/utils/fastMode.ts
508
+ function isFastModeEnabled() {
509
+ return !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_FAST_MODE);
510
+ }
511
+ function isFastModeAvailable() {
512
+ if (!isFastModeEnabled()) {
513
+ return false;
514
+ }
515
+ return getFastModeUnavailableReason() === null;
516
+ }
517
+ function getDisabledReasonMessage(disabledReason) {
518
+ switch (disabledReason) {
519
+ case "free":
520
+ return "Fast mode unavailable during evaluation. Please purchase credits.";
521
+ case "preference":
522
+ return "Fast mode has been disabled by your organization";
523
+ case "extra_usage_disabled":
524
+ return "Fast mode requires extra usage billing \xB7 /extra-usage to enable";
525
+ case "network_error":
526
+ return "Fast mode unavailable due to network connectivity issues";
527
+ case "unknown":
528
+ return "Fast mode is currently unavailable";
529
+ }
530
+ }
531
+ function getFastModeUnavailableReason() {
532
+ if (!isFastModeEnabled()) {
533
+ return "Fast mode is not available";
534
+ }
535
+ const statigReason = getFeatureValue_CACHED_MAY_BE_STALE("tengu_penguins_off", null);
536
+ if (statigReason !== null) {
537
+ logForDebugging(`Fast mode unavailable: ${statigReason}`);
538
+ return statigReason;
539
+ }
540
+ if (!isInBundledMode() && getFeatureValue_CACHED_MAY_BE_STALE("tengu_marble_sandcastle", false)) {
541
+ return "Fast mode requires the native binary \xB7 Install from: https://claude.com/product/claude-code";
542
+ }
543
+ if (getIsNonInteractiveSession() && preferThirdPartyAuthentication() && !getKairosActive()) {
544
+ const flagFastMode = getSettingsForSource("flagSettings")?.fastMode;
545
+ if (!flagFastMode) {
546
+ const reason = "Fast mode is not available in the Agent SDK";
547
+ logForDebugging(`Fast mode unavailable: ${reason}`);
548
+ return reason;
549
+ }
550
+ }
551
+ if (getAPIProvider() !== "firstParty") {
552
+ const reason = "Fast mode is not available on Bedrock, Vertex, or Foundry";
553
+ logForDebugging(`Fast mode unavailable: ${reason}`);
554
+ return reason;
555
+ }
556
+ if (orgStatus.status === "disabled") {
557
+ if (orgStatus.reason === "network_error" || orgStatus.reason === "unknown") {
558
+ if (isEnvTruthy(process.env.CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS)) {
559
+ return null;
560
+ }
561
+ }
562
+ const reason = getDisabledReasonMessage(orgStatus.reason);
563
+ logForDebugging(`Fast mode unavailable: ${reason}`);
564
+ return reason;
565
+ }
566
+ return null;
567
+ }
568
+ function getFastModeModel() {
569
+ return "opus" + (isOpus1mMergeEnabled() ? "[1m]" : "");
570
+ }
571
+ function getInitialFastModeSetting(model) {
572
+ if (!isFastModeEnabled()) {
573
+ return false;
574
+ }
575
+ if (!isFastModeAvailable()) {
576
+ return false;
577
+ }
578
+ if (!isFastModeSupportedByModel(model)) {
579
+ return false;
580
+ }
581
+ const settings = getInitialSettings();
582
+ if (settings.fastModePerSessionOptIn) {
583
+ return false;
584
+ }
585
+ return settings.fastMode === true;
586
+ }
587
+ function isFastModeSupportedByModel(modelSetting) {
588
+ if (!isFastModeEnabled()) {
589
+ return false;
590
+ }
591
+ const model = modelSetting ?? getDefaultMainLoopModelSetting();
592
+ const parsedModel = parseUserSpecifiedModel(model);
593
+ return parsedModel.toLowerCase().includes("opus-4-6");
594
+ }
595
+ function getFastModeRuntimeState() {
596
+ if (runtimeState.status === "cooldown" && Date.now() >= runtimeState.resetAt) {
597
+ if (isFastModeEnabled() && !hasLoggedCooldownExpiry) {
598
+ logForDebugging("Fast mode cooldown expired, re-enabling fast mode");
599
+ hasLoggedCooldownExpiry = true;
600
+ cooldownExpired.emit();
601
+ }
602
+ runtimeState = { status: "active" };
603
+ }
604
+ return runtimeState;
605
+ }
606
+ function triggerFastModeCooldown(resetTimestamp, reason) {
607
+ if (!isFastModeEnabled()) {
608
+ return;
609
+ }
610
+ runtimeState = { status: "cooldown", resetAt: resetTimestamp, reason };
611
+ hasLoggedCooldownExpiry = false;
612
+ const cooldownDurationMs = resetTimestamp - Date.now();
613
+ logForDebugging(`Fast mode cooldown triggered (${reason}), duration ${Math.round(cooldownDurationMs / 1000)}s`);
614
+ logEvent("tengu_fast_mode_fallback_triggered", {
615
+ cooldown_duration_ms: cooldownDurationMs,
616
+ cooldown_reason: reason
617
+ });
618
+ cooldownTriggered.emit(resetTimestamp, reason);
619
+ }
620
+ function clearFastModeCooldown() {
621
+ runtimeState = { status: "active" };
622
+ }
623
+ function handleFastModeRejectedByAPI() {
624
+ if (orgStatus.status === "disabled") {
625
+ return;
626
+ }
627
+ orgStatus = { status: "disabled", reason: "preference" };
628
+ updateSettingsForSource("userSettings", { fastMode: undefined });
629
+ saveGlobalConfig((current) => ({
630
+ ...current,
631
+ penguinModeOrgEnabled: false
632
+ }));
633
+ orgFastModeChange.emit(false);
634
+ }
635
+ function getOverageDisabledMessage(reason) {
636
+ switch (reason) {
637
+ case "out_of_credits":
638
+ return "Fast mode disabled \xB7 extra usage credits exhausted";
639
+ case "org_level_disabled":
640
+ case "org_service_level_disabled":
641
+ return "Fast mode disabled \xB7 extra usage disabled by your organization";
642
+ case "org_level_disabled_until":
643
+ return "Fast mode disabled \xB7 extra usage spending cap reached";
644
+ case "member_level_disabled":
645
+ return "Fast mode disabled \xB7 extra usage disabled for your account";
646
+ case "seat_tier_level_disabled":
647
+ case "seat_tier_zero_credit_limit":
648
+ case "member_zero_credit_limit":
649
+ return "Fast mode disabled \xB7 extra usage not available for your plan";
650
+ case "overage_not_provisioned":
651
+ case "no_limits_configured":
652
+ return "Fast mode requires extra usage billing \xB7 /extra-usage to enable";
653
+ default:
654
+ return "Fast mode disabled \xB7 extra usage not available";
655
+ }
656
+ }
657
+ function isOutOfCreditsReason(reason) {
658
+ return reason === "org_level_disabled_until" || reason === "out_of_credits";
659
+ }
660
+ function handleFastModeOverageRejection(reason) {
661
+ const message = getOverageDisabledMessage(reason);
662
+ logForDebugging(`Fast mode overage rejection: ${reason ?? "unknown"} \u2014 ${message}`);
663
+ logEvent("tengu_fast_mode_overage_rejected", {
664
+ overage_disabled_reason: reason ?? "unknown"
665
+ });
666
+ if (!isOutOfCreditsReason(reason)) {
667
+ updateSettingsForSource("userSettings", { fastMode: undefined });
668
+ saveGlobalConfig((current) => ({
669
+ ...current,
670
+ penguinModeOrgEnabled: false
671
+ }));
672
+ }
673
+ overageRejection.emit(message);
674
+ }
675
+ function isFastModeCooldown() {
676
+ return getFastModeRuntimeState().status === "cooldown";
677
+ }
678
+ function getFastModeState(model, fastModeUserEnabled) {
679
+ const enabled = isFastModeEnabled() && isFastModeAvailable() && !!fastModeUserEnabled && isFastModeSupportedByModel(model);
680
+ if (enabled && isFastModeCooldown()) {
681
+ return "cooldown";
682
+ }
683
+ if (enabled) {
684
+ return "on";
685
+ }
686
+ return "off";
687
+ }
688
+ async function fetchFastModeStatus(auth) {
689
+ const endpoint = `${getApiConfig().BASE_API_URL}/api/claude_code_penguin_mode`;
690
+ const headers = { "x-api-key": auth.apiKey };
691
+ const response = await axios_default.get(endpoint, { headers });
692
+ return response.data;
693
+ }
694
+ function resolveFastModeStatusFromCache() {
695
+ if (!isFastModeEnabled()) {
696
+ return;
697
+ }
698
+ if (orgStatus.status !== "pending") {
699
+ return;
700
+ }
701
+ const isAnt = process.env.USER_TYPE === "ant";
702
+ const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
703
+ orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "unknown" };
704
+ }
705
+ async function prefetchFastModeStatus() {
706
+ if (isEssentialTrafficOnly()) {
707
+ return;
708
+ }
709
+ if (!isFastModeEnabled()) {
710
+ return;
711
+ }
712
+ if (inflightPrefetch) {
713
+ logForDebugging("Fast mode prefetch in progress, returning in-flight promise");
714
+ return inflightPrefetch;
715
+ }
716
+ const apiKey = getAnthropicApiKey();
717
+ if (!apiKey) {
718
+ const isAnt = process.env.USER_TYPE === "ant";
719
+ const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
720
+ orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "preference" };
721
+ return;
722
+ }
723
+ const now = Date.now();
724
+ if (now - lastPrefetchAt < PREFETCH_MIN_INTERVAL_MS) {
725
+ logForDebugging("Skipping fast mode prefetch, fetched recently");
726
+ return;
727
+ }
728
+ lastPrefetchAt = now;
729
+ const fetchWithCurrentAuth = async () => {
730
+ if (!apiKey) {
731
+ throw new Error("No auth available");
732
+ }
733
+ return fetchFastModeStatus({ apiKey });
734
+ };
735
+ async function doFetch() {
736
+ try {
737
+ const status = await fetchWithCurrentAuth();
738
+ const previousEnabled = orgStatus.status !== "pending" ? orgStatus.status === "enabled" : getGlobalConfig().penguinModeOrgEnabled;
739
+ orgStatus = status.enabled ? { status: "enabled" } : {
740
+ status: "disabled",
741
+ reason: status.disabled_reason ?? "preference"
742
+ };
743
+ if (previousEnabled !== status.enabled) {
744
+ if (!status.enabled) {
745
+ updateSettingsForSource("userSettings", { fastMode: undefined });
746
+ }
747
+ saveGlobalConfig((current) => ({
748
+ ...current,
749
+ penguinModeOrgEnabled: status.enabled
750
+ }));
751
+ orgFastModeChange.emit(status.enabled);
752
+ }
753
+ logForDebugging(`Org fast mode: ${status.enabled ? "enabled" : `disabled (${status.disabled_reason ?? "preference"})`}`);
754
+ } catch (err) {
755
+ const isAnt = process.env.USER_TYPE === "ant";
756
+ const cachedEnabled = getGlobalConfig().penguinModeOrgEnabled === true;
757
+ orgStatus = isAnt || cachedEnabled ? { status: "enabled" } : { status: "disabled", reason: "network_error" };
758
+ logForDebugging(`Failed to fetch org fast mode status, defaulting to ${orgStatus.status === "enabled" ? "enabled (cached)" : "disabled (network_error)"}: ${err}`, { level: "error" });
759
+ logEvent("tengu_org_penguin_mode_fetch_failed", {});
760
+ } finally {
761
+ inflightPrefetch = null;
762
+ }
763
+ }
764
+ inflightPrefetch = doFetch();
765
+ return inflightPrefetch;
766
+ }
767
+ var FAST_MODE_MODEL_DISPLAY = "Opus 4.6", runtimeState, hasLoggedCooldownExpiry = false, cooldownTriggered, cooldownExpired, onCooldownTriggered, onCooldownExpired, overageRejection, onFastModeOverageRejection, orgStatus, orgFastModeChange, onOrgFastModeChanged, PREFETCH_MIN_INTERVAL_MS = 30000, lastPrefetchAt = 0, inflightPrefetch = null;
768
+ var init_fastMode = __esm(() => {
769
+ init_axios();
770
+ init_apiConfig();
771
+ init_growthbook();
772
+ init_state();
773
+ init_analytics();
774
+ init_auth();
775
+ init_bundledMode();
776
+ init_config();
777
+ init_debug();
778
+ init_envUtils();
779
+ init_model();
780
+ init_providers();
781
+ init_privacyLevel();
782
+ init_settings();
783
+ init_signal();
784
+ runtimeState = { status: "active" };
785
+ cooldownTriggered = createSignal();
786
+ cooldownExpired = createSignal();
787
+ onCooldownTriggered = cooldownTriggered.subscribe;
788
+ onCooldownExpired = cooldownExpired.subscribe;
789
+ overageRejection = createSignal();
790
+ onFastModeOverageRejection = overageRejection.subscribe;
791
+ orgStatus = { status: "pending" };
792
+ orgFastModeChange = createSignal();
793
+ onOrgFastModeChanged = orgFastModeChange.subscribe;
794
+ });
795
+
796
+ // src/utils/modelCost.ts
797
+ function getOpus46CostTier(fastMode) {
798
+ if (isFastModeEnabled() && fastMode) {
799
+ return COST_TIER_30_150;
800
+ }
801
+ return COST_TIER_5_25;
802
+ }
803
+ function tokensToUSDCost(modelCosts, usage) {
804
+ return usage.input_tokens / 1e6 * modelCosts.inputTokens + usage.output_tokens / 1e6 * modelCosts.outputTokens + (usage.cache_read_input_tokens ?? 0) / 1e6 * modelCosts.promptCacheReadTokens + (usage.cache_creation_input_tokens ?? 0) / 1e6 * modelCosts.promptCacheWriteTokens + (usage.server_tool_use?.web_search_requests ?? 0) * modelCosts.webSearchRequests;
805
+ }
806
+ function getModelCosts(model, usage) {
807
+ const shortName = getCanonicalName(model);
808
+ if (shortName === firstPartyNameToCanonical(CLAUDE_OPUS_4_6_CONFIG.firstParty)) {
809
+ const isFastMode = usage.speed === "fast";
810
+ return getOpus46CostTier(isFastMode);
811
+ }
812
+ const costs = MODEL_COSTS[shortName];
813
+ if (!costs) {
814
+ trackUnknownModelCost(model, shortName);
815
+ return MODEL_COSTS[getCanonicalName(getDefaultMainLoopModelSetting())] ?? DEFAULT_UNKNOWN_MODEL_COST;
816
+ }
817
+ return costs;
818
+ }
819
+ function trackUnknownModelCost(model, shortName) {
820
+ logEvent("tengu_unknown_model_cost", {
821
+ model,
822
+ shortName
823
+ });
824
+ setHasUnknownModelCost();
825
+ }
826
+ function calculateUSDCost(resolvedModel, usage) {
827
+ const modelCosts = getModelCosts(resolvedModel, usage);
828
+ return tokensToUSDCost(modelCosts, usage);
829
+ }
830
+ function formatPrice(price) {
831
+ if (Number.isInteger(price)) {
832
+ return `$${price}`;
833
+ }
834
+ return `$${price.toFixed(2)}`;
835
+ }
836
+ function formatModelPricing(costs) {
837
+ return `${formatPrice(costs.inputTokens)}/${formatPrice(costs.outputTokens)} per Mtok`;
838
+ }
839
+ var COST_TIER_3_15, COST_TIER_15_75, COST_TIER_5_25, COST_TIER_30_150, COST_HAIKU_35, COST_HAIKU_45, DEFAULT_UNKNOWN_MODEL_COST, MODEL_COSTS;
840
+ var init_modelCost = __esm(() => {
841
+ init_analytics();
842
+ init_state();
843
+ init_fastMode();
844
+ init_configs();
845
+ init_model();
846
+ COST_TIER_3_15 = {
847
+ inputTokens: 3,
848
+ outputTokens: 15,
849
+ promptCacheWriteTokens: 3.75,
850
+ promptCacheReadTokens: 0.3,
851
+ webSearchRequests: 0.01
852
+ };
853
+ COST_TIER_15_75 = {
854
+ inputTokens: 15,
855
+ outputTokens: 75,
856
+ promptCacheWriteTokens: 18.75,
857
+ promptCacheReadTokens: 1.5,
858
+ webSearchRequests: 0.01
859
+ };
860
+ COST_TIER_5_25 = {
861
+ inputTokens: 5,
862
+ outputTokens: 25,
863
+ promptCacheWriteTokens: 6.25,
864
+ promptCacheReadTokens: 0.5,
865
+ webSearchRequests: 0.01
866
+ };
867
+ COST_TIER_30_150 = {
868
+ inputTokens: 30,
869
+ outputTokens: 150,
870
+ promptCacheWriteTokens: 37.5,
871
+ promptCacheReadTokens: 3,
872
+ webSearchRequests: 0.01
873
+ };
874
+ COST_HAIKU_35 = {
875
+ inputTokens: 0.8,
876
+ outputTokens: 4,
877
+ promptCacheWriteTokens: 1,
878
+ promptCacheReadTokens: 0.08,
879
+ webSearchRequests: 0.01
880
+ };
881
+ COST_HAIKU_45 = {
882
+ inputTokens: 1,
883
+ outputTokens: 5,
884
+ promptCacheWriteTokens: 1.25,
885
+ promptCacheReadTokens: 0.1,
886
+ webSearchRequests: 0.01
887
+ };
888
+ DEFAULT_UNKNOWN_MODEL_COST = COST_TIER_5_25;
889
+ MODEL_COSTS = {
890
+ [firstPartyNameToCanonical(CLAUDE_3_5_HAIKU_CONFIG.firstParty)]: COST_HAIKU_35,
891
+ [firstPartyNameToCanonical(CLAUDE_HAIKU_4_5_CONFIG.firstParty)]: COST_HAIKU_45,
892
+ [firstPartyNameToCanonical(CLAUDE_3_5_V2_SONNET_CONFIG.firstParty)]: COST_TIER_3_15,
893
+ [firstPartyNameToCanonical(CLAUDE_3_7_SONNET_CONFIG.firstParty)]: COST_TIER_3_15,
894
+ [firstPartyNameToCanonical(CLAUDE_SONNET_4_CONFIG.firstParty)]: COST_TIER_3_15,
895
+ [firstPartyNameToCanonical(CLAUDE_SONNET_4_5_CONFIG.firstParty)]: COST_TIER_3_15,
896
+ [firstPartyNameToCanonical(CLAUDE_SONNET_4_6_CONFIG.firstParty)]: COST_TIER_3_15,
897
+ [firstPartyNameToCanonical(CLAUDE_OPUS_4_CONFIG.firstParty)]: COST_TIER_15_75,
898
+ [firstPartyNameToCanonical(CLAUDE_OPUS_4_1_CONFIG.firstParty)]: COST_TIER_15_75,
899
+ [firstPartyNameToCanonical(CLAUDE_OPUS_4_5_CONFIG.firstParty)]: COST_TIER_5_25,
900
+ [firstPartyNameToCanonical(CLAUDE_OPUS_4_6_CONFIG.firstParty)]: COST_TIER_5_25
901
+ };
902
+ });
903
+
904
+ // src/utils/model/aliases.ts
905
+ function isModelAlias(modelInput) {
906
+ return MODEL_ALIASES.includes(modelInput);
907
+ }
908
+ function isModelFamilyAlias(model) {
909
+ return MODEL_FAMILY_ALIASES.includes(model);
910
+ }
911
+ var MODEL_ALIASES, MODEL_FAMILY_ALIASES;
912
+ var init_aliases = __esm(() => {
913
+ MODEL_ALIASES = [
914
+ "sonnet",
915
+ "opus",
916
+ "haiku",
917
+ "best",
918
+ "sonnet[1m]",
919
+ "opus[1m]",
920
+ "opusplan"
921
+ ];
922
+ MODEL_FAMILY_ALIASES = ["sonnet", "opus", "haiku"];
923
+ });
924
+
925
+ // src/utils/model/modelAllowlist.ts
926
+ function modelBelongsToFamily(model, family) {
927
+ if (model.includes(family)) {
928
+ return true;
929
+ }
930
+ if (isModelAlias(model)) {
931
+ const resolved = parseUserSpecifiedModel(model).toLowerCase();
932
+ return resolved.includes(family);
933
+ }
934
+ return false;
935
+ }
936
+ function prefixMatchesModel(modelName, prefix) {
937
+ if (!modelName.startsWith(prefix)) {
938
+ return false;
939
+ }
940
+ return modelName.length === prefix.length || modelName[prefix.length] === "-";
941
+ }
942
+ function modelMatchesVersionPrefix(model, entry) {
943
+ const resolvedModel = isModelAlias(model) ? parseUserSpecifiedModel(model).toLowerCase() : model;
944
+ if (prefixMatchesModel(resolvedModel, entry)) {
945
+ return true;
946
+ }
947
+ if (!entry.startsWith("claude-") && prefixMatchesModel(resolvedModel, `claude-${entry}`)) {
948
+ return true;
949
+ }
950
+ return false;
951
+ }
952
+ function familyHasSpecificEntries(family, allowlist) {
953
+ for (const entry of allowlist) {
954
+ if (isModelFamilyAlias(entry)) {
955
+ continue;
956
+ }
957
+ const idx = entry.indexOf(family);
958
+ if (idx === -1) {
959
+ continue;
960
+ }
961
+ const afterFamily = idx + family.length;
962
+ if (afterFamily === entry.length || entry[afterFamily] === "-") {
963
+ return true;
964
+ }
965
+ }
966
+ return false;
967
+ }
968
+ function isModelAllowed(model) {
969
+ const settings = getSettings_DEPRECATED() || {};
970
+ const { availableModels } = settings;
971
+ if (!availableModels) {
972
+ return true;
973
+ }
974
+ if (availableModels.length === 0) {
975
+ return false;
976
+ }
977
+ const resolvedModel = resolveOverriddenModel(model);
978
+ const normalizedModel = resolvedModel.trim().toLowerCase();
979
+ const normalizedAllowlist = availableModels.map((m) => m.trim().toLowerCase());
980
+ if (normalizedAllowlist.includes(normalizedModel)) {
981
+ if (!isModelFamilyAlias(normalizedModel) || !familyHasSpecificEntries(normalizedModel, normalizedAllowlist)) {
982
+ return true;
983
+ }
984
+ }
985
+ for (const entry of normalizedAllowlist) {
986
+ if (isModelFamilyAlias(entry) && !familyHasSpecificEntries(entry, normalizedAllowlist) && modelBelongsToFamily(normalizedModel, entry)) {
987
+ return true;
988
+ }
989
+ }
990
+ if (isModelAlias(normalizedModel)) {
991
+ const resolved = parseUserSpecifiedModel(normalizedModel).toLowerCase();
992
+ if (normalizedAllowlist.includes(resolved)) {
993
+ return true;
994
+ }
995
+ }
996
+ for (const entry of normalizedAllowlist) {
997
+ if (!isModelFamilyAlias(entry) && isModelAlias(entry)) {
998
+ const resolved = parseUserSpecifiedModel(entry).toLowerCase();
999
+ if (resolved === normalizedModel) {
1000
+ return true;
1001
+ }
1002
+ }
1003
+ }
1004
+ for (const entry of normalizedAllowlist) {
1005
+ if (!isModelFamilyAlias(entry) && !isModelAlias(entry)) {
1006
+ if (modelMatchesVersionPrefix(normalizedModel, entry)) {
1007
+ return true;
1008
+ }
1009
+ }
1010
+ }
1011
+ return false;
1012
+ }
1013
+ var init_modelAllowlist = __esm(() => {
1014
+ init_settings();
1015
+ init_aliases();
1016
+ init_model();
1017
+ init_modelStrings();
1018
+ });
1019
+
1020
+ // src/utils/model/model.ts
1021
+ function getSmallFastModel() {
1022
+ const provider = getAPIProvider();
1023
+ if (provider === "openai" && process.env.OPENAI_SMALL_FAST_MODEL) {
1024
+ return process.env.OPENAI_SMALL_FAST_MODEL;
1025
+ }
1026
+ return process.env.ANTHROPIC_SMALL_FAST_MODEL || getDefaultHaikuModel();
1027
+ }
1028
+ function isNonCustomOpusModel(model) {
1029
+ return model === getModelStrings2().opus40 || model === getModelStrings2().opus41 || model === getModelStrings2().opus45 || model === getModelStrings2().opus46;
1030
+ }
1031
+ function getUserSpecifiedModelSetting() {
1032
+ let specifiedModel;
1033
+ const modelOverride = getMainLoopModelOverride();
1034
+ if (modelOverride !== undefined) {
1035
+ specifiedModel = modelOverride;
1036
+ } else {
1037
+ const settings = getSettings_DEPRECATED() || {};
1038
+ specifiedModel = process.env.ANTHROPIC_MODEL || settings.model || undefined;
1039
+ }
1040
+ if (specifiedModel && !isModelAllowed(specifiedModel)) {
1041
+ return;
1042
+ }
1043
+ return specifiedModel;
1044
+ }
1045
+ function getMainLoopModel() {
1046
+ const model = getUserSpecifiedModelSetting();
1047
+ if (model !== undefined && model !== null) {
1048
+ return parseUserSpecifiedModel(model);
1049
+ }
1050
+ return getDefaultMainLoopModel();
1051
+ }
1052
+ function getBestModel() {
1053
+ return getDefaultOpusModel();
1054
+ }
1055
+ function getDefaultOpusModel() {
1056
+ const provider = getAPIProvider();
1057
+ if (provider === "openai" && process.env.OPENAI_DEFAULT_OPUS_MODEL) {
1058
+ return process.env.OPENAI_DEFAULT_OPUS_MODEL;
1059
+ }
1060
+ if (process.env.ANTHROPIC_DEFAULT_OPUS_MODEL) {
1061
+ return process.env.ANTHROPIC_DEFAULT_OPUS_MODEL;
1062
+ }
1063
+ return getModelStrings2().opus46;
1064
+ }
1065
+ function getDefaultSonnetModel() {
1066
+ const provider = getAPIProvider();
1067
+ if (provider === "openai" && process.env.OPENAI_DEFAULT_SONNET_MODEL) {
1068
+ return process.env.OPENAI_DEFAULT_SONNET_MODEL;
1069
+ }
1070
+ if (process.env.ANTHROPIC_DEFAULT_SONNET_MODEL) {
1071
+ return process.env.ANTHROPIC_DEFAULT_SONNET_MODEL;
1072
+ }
1073
+ return getModelStrings2().sonnet46;
1074
+ }
1075
+ function getDefaultHaikuModel() {
1076
+ const provider = getAPIProvider();
1077
+ if (provider === "openai" && process.env.OPENAI_DEFAULT_HAIKU_MODEL) {
1078
+ return process.env.OPENAI_DEFAULT_HAIKU_MODEL;
1079
+ }
1080
+ if (process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL) {
1081
+ return process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL;
1082
+ }
1083
+ return getModelStrings2().haiku45;
1084
+ }
1085
+ function getRuntimeMainLoopModel(params) {
1086
+ const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params;
1087
+ if (getUserSpecifiedModelSetting() === "opusplan" && permissionMode === "plan" && !exceeds200kTokens) {
1088
+ return getDefaultOpusModel();
1089
+ }
1090
+ if (getUserSpecifiedModelSetting() === "haiku" && permissionMode === "plan") {
1091
+ return getDefaultSonnetModel();
1092
+ }
1093
+ return mainLoopModel;
1094
+ }
1095
+ function getDefaultMainLoopModelSetting() {
1096
+ if (process.env.USER_TYPE === "ant") {
1097
+ return getAntModelOverrideConfig()?.defaultModel ?? getDefaultOpusModel() + "[1m]";
1098
+ }
1099
+ if (isMaxSubscriber()) {
1100
+ return getDefaultOpusModel() + (isOpus1mMergeEnabled() ? "[1m]" : "");
1101
+ }
1102
+ if (isTeamPremiumSubscriber()) {
1103
+ return getDefaultOpusModel() + (isOpus1mMergeEnabled() ? "[1m]" : "");
1104
+ }
1105
+ return getDefaultSonnetModel();
1106
+ }
1107
+ function getDefaultMainLoopModel() {
1108
+ return parseUserSpecifiedModel(getDefaultMainLoopModelSetting());
1109
+ }
1110
+ function firstPartyNameToCanonical(name) {
1111
+ name = name.toLowerCase();
1112
+ if (name.includes("claude-opus-4-6")) {
1113
+ return "claude-opus-4-6";
1114
+ }
1115
+ if (name.includes("claude-opus-4-5")) {
1116
+ return "claude-opus-4-5";
1117
+ }
1118
+ if (name.includes("claude-opus-4-1")) {
1119
+ return "claude-opus-4-1";
1120
+ }
1121
+ if (name.includes("claude-opus-4")) {
1122
+ return "claude-opus-4";
1123
+ }
1124
+ if (name.includes("claude-sonnet-4-6")) {
1125
+ return "claude-sonnet-4-6";
1126
+ }
1127
+ if (name.includes("claude-sonnet-4-5")) {
1128
+ return "claude-sonnet-4-5";
1129
+ }
1130
+ if (name.includes("claude-sonnet-4")) {
1131
+ return "claude-sonnet-4";
1132
+ }
1133
+ if (name.includes("claude-haiku-4-5")) {
1134
+ return "claude-haiku-4-5";
1135
+ }
1136
+ if (name.includes("claude-3-7-sonnet")) {
1137
+ return "claude-3-7-sonnet";
1138
+ }
1139
+ if (name.includes("claude-3-5-sonnet")) {
1140
+ return "claude-3-5-sonnet";
1141
+ }
1142
+ if (name.includes("claude-3-5-haiku")) {
1143
+ return "claude-3-5-haiku";
1144
+ }
1145
+ if (name.includes("claude-3-opus")) {
1146
+ return "claude-3-opus";
1147
+ }
1148
+ if (name.includes("claude-3-sonnet")) {
1149
+ return "claude-3-sonnet";
1150
+ }
1151
+ if (name.includes("claude-3-haiku")) {
1152
+ return "claude-3-haiku";
1153
+ }
1154
+ const match = name.match(/(claude-(\d+-\d+-)?\w+)/);
1155
+ if (match && match[1]) {
1156
+ return match[1];
1157
+ }
1158
+ return name;
1159
+ }
1160
+ function getCanonicalName(fullModelName) {
1161
+ return firstPartyNameToCanonical(resolveOverriddenModel(fullModelName));
1162
+ }
1163
+ function getClaudeAiUserDefaultModelDescription(fastMode = false) {
1164
+ if (isMaxSubscriber() || isTeamPremiumSubscriber()) {
1165
+ if (isOpus1mMergeEnabled()) {
1166
+ return `Opus 4.6 with 1M context \xB7 Most capable for complex work${fastMode ? getOpus46PricingSuffix(true) : ""}`;
1167
+ }
1168
+ return `Opus 4.6 \xB7 Most capable for complex work${fastMode ? getOpus46PricingSuffix(true) : ""}`;
1169
+ }
1170
+ return "Sonnet 4.6 \xB7 Best for everyday tasks";
1171
+ }
1172
+ function renderDefaultModelSetting(setting) {
1173
+ if (setting === "opusplan") {
1174
+ return "Opus 4.6 in plan mode, else Sonnet 4.6";
1175
+ }
1176
+ return renderModelName(parseUserSpecifiedModel(setting));
1177
+ }
1178
+ function getOpus46PricingSuffix(fastMode) {
1179
+ if (getAPIProvider() !== "firstParty")
1180
+ return "";
1181
+ const pricing = formatModelPricing(getOpus46CostTier(fastMode));
1182
+ const fastModeIndicator = fastMode ? ` (${LIGHTNING_BOLT})` : "";
1183
+ return ` \xB7${fastModeIndicator} ${pricing}`;
1184
+ }
1185
+ function isOpus1mMergeEnabled() {
1186
+ if (is1mContextDisabled() || isProSubscriber() || getAPIProvider() !== "firstParty") {
1187
+ return false;
1188
+ }
1189
+ if (isClaudeAISubscriber() && getSubscriptionType() === null) {
1190
+ return false;
1191
+ }
1192
+ return true;
1193
+ }
1194
+ function renderModelSetting(setting) {
1195
+ if (setting === "opusplan") {
1196
+ return "Opus Plan";
1197
+ }
1198
+ if (isModelAlias(setting)) {
1199
+ return capitalize(setting);
1200
+ }
1201
+ return renderModelName(setting);
1202
+ }
1203
+ function getPublicModelDisplayName(model) {
1204
+ switch (model) {
1205
+ case getModelStrings2().opus46:
1206
+ return "Opus 4.6";
1207
+ case getModelStrings2().opus46 + "[1m]":
1208
+ return "Opus 4.6 (1M context)";
1209
+ case getModelStrings2().opus45:
1210
+ return "Opus 4.5";
1211
+ case getModelStrings2().opus41:
1212
+ return "Opus 4.1";
1213
+ case getModelStrings2().opus40:
1214
+ return "Opus 4";
1215
+ case getModelStrings2().sonnet46 + "[1m]":
1216
+ return "Sonnet 4.6 (1M context)";
1217
+ case getModelStrings2().sonnet46:
1218
+ return "Sonnet 4.6";
1219
+ case getModelStrings2().sonnet45 + "[1m]":
1220
+ return "Sonnet 4.5 (1M context)";
1221
+ case getModelStrings2().sonnet45:
1222
+ return "Sonnet 4.5";
1223
+ case getModelStrings2().sonnet40:
1224
+ return "Sonnet 4";
1225
+ case getModelStrings2().sonnet40 + "[1m]":
1226
+ return "Sonnet 4 (1M context)";
1227
+ case getModelStrings2().sonnet37:
1228
+ return "Sonnet 3.7";
1229
+ case getModelStrings2().sonnet35:
1230
+ return "Sonnet 3.5";
1231
+ case getModelStrings2().haiku45:
1232
+ return "Haiku 4.5";
1233
+ case getModelStrings2().haiku35:
1234
+ return "Haiku 3.5";
1235
+ default:
1236
+ return null;
1237
+ }
1238
+ }
1239
+ function maskModelCodename(baseName) {
1240
+ const [codename = "", ...rest] = baseName.split("-");
1241
+ const masked = codename.slice(0, 3) + "*".repeat(Math.max(0, codename.length - 3));
1242
+ return [masked, ...rest].join("-");
1243
+ }
1244
+ function renderModelName(model) {
1245
+ const publicName = getPublicModelDisplayName(model);
1246
+ if (publicName) {
1247
+ return publicName;
1248
+ }
1249
+ if (process.env.USER_TYPE === "ant") {
1250
+ const resolved = parseUserSpecifiedModel(model);
1251
+ const antModel = resolveAntModel(model);
1252
+ if (antModel) {
1253
+ const baseName = antModel.model.replace(/\[1m\]$/i, "");
1254
+ const masked = maskModelCodename(baseName);
1255
+ const suffix = has1mContext(resolved) ? "[1m]" : "";
1256
+ return masked + suffix;
1257
+ }
1258
+ if (resolved !== model) {
1259
+ return `${model} (${resolved})`;
1260
+ }
1261
+ return resolved;
1262
+ }
1263
+ return model;
1264
+ }
1265
+ function getPublicModelName(model) {
1266
+ const publicName = getPublicModelDisplayName(model);
1267
+ if (publicName) {
1268
+ return `${publicName}`;
1269
+ }
1270
+ return `${model}`;
1271
+ }
1272
+ function parseUserSpecifiedModel(modelInput) {
1273
+ const modelInputTrimmed = modelInput.trim();
1274
+ const normalizedModel = modelInputTrimmed.toLowerCase();
1275
+ const has1mTag = has1mContext(normalizedModel);
1276
+ const modelString = has1mTag ? normalizedModel.replace(/\[1m]$/i, "").trim() : normalizedModel;
1277
+ if (isModelAlias(modelString)) {
1278
+ switch (modelString) {
1279
+ case "opusplan":
1280
+ return getDefaultSonnetModel() + (has1mTag ? "[1m]" : "");
1281
+ case "sonnet":
1282
+ return getDefaultSonnetModel() + (has1mTag ? "[1m]" : "");
1283
+ case "haiku":
1284
+ return getDefaultHaikuModel() + (has1mTag ? "[1m]" : "");
1285
+ case "opus":
1286
+ return getDefaultOpusModel() + (has1mTag ? "[1m]" : "");
1287
+ case "best":
1288
+ return getBestModel();
1289
+ default:
1290
+ }
1291
+ }
1292
+ if (getAPIProvider() === "firstParty" && isLegacyOpusFirstParty(modelString) && isLegacyModelRemapEnabled()) {
1293
+ return getDefaultOpusModel() + (has1mTag ? "[1m]" : "");
1294
+ }
1295
+ if (process.env.USER_TYPE === "ant") {
1296
+ const has1mAntTag = has1mContext(normalizedModel);
1297
+ const baseAntModel = normalizedModel.replace(/\[1m]$/i, "").trim();
1298
+ const antModel = resolveAntModel(baseAntModel);
1299
+ if (antModel) {
1300
+ const suffix = has1mAntTag ? "[1m]" : "";
1301
+ return antModel.model + suffix;
1302
+ }
1303
+ }
1304
+ if (has1mTag) {
1305
+ return modelInputTrimmed.replace(/\[1m\]$/i, "").trim() + "[1m]";
1306
+ }
1307
+ return modelInputTrimmed;
1308
+ }
1309
+ function resolveSkillModelOverride(skillModel, currentModel) {
1310
+ if (has1mContext(skillModel) || !has1mContext(currentModel)) {
1311
+ return skillModel;
1312
+ }
1313
+ if (modelSupports1M(parseUserSpecifiedModel(skillModel))) {
1314
+ return skillModel + "[1m]";
1315
+ }
1316
+ return skillModel;
1317
+ }
1318
+ function isLegacyOpusFirstParty(model) {
1319
+ return LEGACY_OPUS_FIRSTPARTY.includes(model);
1320
+ }
1321
+ function isLegacyModelRemapEnabled() {
1322
+ return !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP);
1323
+ }
1324
+ function modelDisplayString(model) {
1325
+ if (model === null) {
1326
+ if (process.env.USER_TYPE === "ant") {
1327
+ return `Default for Ants (${renderDefaultModelSetting(getDefaultMainLoopModelSetting())})`;
1328
+ } else if (isClaudeAISubscriber()) {
1329
+ return `Default (${getClaudeAiUserDefaultModelDescription()})`;
1330
+ }
1331
+ return `Default (${getDefaultMainLoopModel()})`;
1332
+ }
1333
+ const resolvedModel = parseUserSpecifiedModel(model);
1334
+ return model === resolvedModel ? resolvedModel : `${model} (${resolvedModel})`;
1335
+ }
1336
+ function getMarketingNameForModel(modelId) {
1337
+ const has1m = modelId.toLowerCase().includes("[1m]");
1338
+ const canonical = getCanonicalName(modelId);
1339
+ if (canonical.includes("claude-opus-4-6")) {
1340
+ return has1m ? "Opus 4.6 (with 1M context)" : "Opus 4.6";
1341
+ }
1342
+ if (canonical.includes("claude-opus-4-5")) {
1343
+ return "Opus 4.5";
1344
+ }
1345
+ if (canonical.includes("claude-opus-4-1")) {
1346
+ return "Opus 4.1";
1347
+ }
1348
+ if (canonical.includes("claude-opus-4")) {
1349
+ return "Opus 4";
1350
+ }
1351
+ if (canonical.includes("claude-sonnet-4-6")) {
1352
+ return has1m ? "Sonnet 4.6 (with 1M context)" : "Sonnet 4.6";
1353
+ }
1354
+ if (canonical.includes("claude-sonnet-4-5")) {
1355
+ return has1m ? "Sonnet 4.5 (with 1M context)" : "Sonnet 4.5";
1356
+ }
1357
+ if (canonical.includes("claude-sonnet-4")) {
1358
+ return has1m ? "Sonnet 4 (with 1M context)" : "Sonnet 4";
1359
+ }
1360
+ if (canonical.includes("claude-3-7-sonnet")) {
1361
+ return "3.7 Sonnet";
1362
+ }
1363
+ if (canonical.includes("claude-3-5-sonnet")) {
1364
+ return "3.5 Sonnet";
1365
+ }
1366
+ if (canonical.includes("claude-haiku-4-5")) {
1367
+ return "Haiku 4.5";
1368
+ }
1369
+ if (canonical.includes("claude-3-5-haiku")) {
1370
+ return "3.5 Haiku";
1371
+ }
1372
+ return;
1373
+ }
1374
+ function normalizeModelStringForAPI(model) {
1375
+ return model.replace(/\[(1|2)m\]/gi, "");
1376
+ }
1377
+ var getSubscriptionType = () => null, isClaudeAISubscriber = () => false, isMaxSubscriber = () => false, isProSubscriber = () => false, isTeamPremiumSubscriber = () => false, LEGACY_OPUS_FIRSTPARTY;
1378
+ var init_model = __esm(() => {
1379
+ init_state();
1380
+ init_antModels();
1381
+ init_context();
1382
+ init_envUtils();
1383
+ init_modelStrings();
1384
+ init_modelCost();
1385
+ init_settings();
1386
+ init_providers();
1387
+ init_figures();
1388
+ init_modelAllowlist();
1389
+ init_aliases();
1390
+ init_stringUtils();
1391
+ LEGACY_OPUS_FIRSTPARTY = [
1392
+ "claude-opus-4-20250514",
1393
+ "claude-opus-4-1-20250805",
1394
+ "claude-opus-4-0",
1395
+ "claude-opus-4-1"
1396
+ ];
1397
+ });
1398
+
1399
+ // src/utils/context.ts
1400
+ function is1mContextDisabled() {
1401
+ return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_1M_CONTEXT);
1402
+ }
1403
+ function has1mContext(model) {
1404
+ if (is1mContextDisabled()) {
1405
+ return false;
1406
+ }
1407
+ return /\[1m\]/i.test(model);
1408
+ }
1409
+ function modelSupports1M(model) {
1410
+ if (is1mContextDisabled()) {
1411
+ return false;
1412
+ }
1413
+ const canonical = getCanonicalName(model);
1414
+ return canonical.includes("claude-sonnet-4") || canonical.includes("opus-4-6");
1415
+ }
1416
+ function getContextWindowForModel(model, betas) {
1417
+ if (process.env.USER_TYPE === "ant" && process.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS) {
1418
+ const override = parseInt(process.env.CLAUDE_CODE_MAX_CONTEXT_TOKENS, 10);
1419
+ if (!isNaN(override) && override > 0) {
1420
+ return override;
1421
+ }
1422
+ }
1423
+ if (has1mContext(model)) {
1424
+ return 1e6;
1425
+ }
1426
+ const cap = getModelCapability(model);
1427
+ if (cap?.max_input_tokens && cap.max_input_tokens >= 1e5) {
1428
+ if (cap.max_input_tokens > MODEL_CONTEXT_WINDOW_DEFAULT && is1mContextDisabled()) {
1429
+ return MODEL_CONTEXT_WINDOW_DEFAULT;
1430
+ }
1431
+ return cap.max_input_tokens;
1432
+ }
1433
+ if (betas?.includes(CONTEXT_1M_BETA_HEADER) && modelSupports1M(model)) {
1434
+ return 1e6;
1435
+ }
1436
+ if (getSonnet1mExpTreatmentEnabled(model)) {
1437
+ return 1e6;
1438
+ }
1439
+ if (process.env.USER_TYPE === "ant") {
1440
+ const antModel = resolveAntModel(model);
1441
+ if (antModel?.contextWindow) {
1442
+ return antModel.contextWindow;
1443
+ }
1444
+ }
1445
+ return MODEL_CONTEXT_WINDOW_DEFAULT;
1446
+ }
1447
+ function getSonnet1mExpTreatmentEnabled(model) {
1448
+ if (is1mContextDisabled()) {
1449
+ return false;
1450
+ }
1451
+ if (has1mContext(model)) {
1452
+ return false;
1453
+ }
1454
+ if (!getCanonicalName(model).includes("sonnet-4-6")) {
1455
+ return false;
1456
+ }
1457
+ return getGlobalConfig().clientDataCache?.["coral_reef_sonnet"] === "true";
1458
+ }
1459
+ function calculateContextPercentages(currentUsage, contextWindowSize) {
1460
+ if (!currentUsage) {
1461
+ return { used: null, remaining: null };
1462
+ }
1463
+ const totalInputTokens = currentUsage.input_tokens + currentUsage.cache_creation_input_tokens + currentUsage.cache_read_input_tokens;
1464
+ const usedPercentage = Math.round(totalInputTokens / contextWindowSize * 100);
1465
+ const clampedUsed = Math.min(100, Math.max(0, usedPercentage));
1466
+ return {
1467
+ used: clampedUsed,
1468
+ remaining: 100 - clampedUsed
1469
+ };
1470
+ }
1471
+ function getModelMaxOutputTokens(model) {
1472
+ let defaultTokens;
1473
+ let upperLimit;
1474
+ if (process.env.USER_TYPE === "ant") {
1475
+ const antModel = resolveAntModel(model.toLowerCase());
1476
+ if (antModel) {
1477
+ defaultTokens = antModel.defaultMaxTokens ?? MAX_OUTPUT_TOKENS_DEFAULT;
1478
+ upperLimit = antModel.upperMaxTokensLimit ?? MAX_OUTPUT_TOKENS_UPPER_LIMIT;
1479
+ return { default: defaultTokens, upperLimit };
1480
+ }
1481
+ }
1482
+ const m = getCanonicalName(model);
1483
+ if (m.includes("opus-4-6")) {
1484
+ defaultTokens = 64000;
1485
+ upperLimit = 128000;
1486
+ } else if (m.includes("sonnet-4-6")) {
1487
+ defaultTokens = 32000;
1488
+ upperLimit = 128000;
1489
+ } else if (m.includes("opus-4-5") || m.includes("sonnet-4") || m.includes("haiku-4")) {
1490
+ defaultTokens = 32000;
1491
+ upperLimit = 64000;
1492
+ } else if (m.includes("opus-4-1") || m.includes("opus-4")) {
1493
+ defaultTokens = 32000;
1494
+ upperLimit = 32000;
1495
+ } else if (m.includes("claude-3-opus")) {
1496
+ defaultTokens = 4096;
1497
+ upperLimit = 4096;
1498
+ } else if (m.includes("claude-3-sonnet")) {
1499
+ defaultTokens = 8192;
1500
+ upperLimit = 8192;
1501
+ } else if (m.includes("claude-3-haiku")) {
1502
+ defaultTokens = 4096;
1503
+ upperLimit = 4096;
1504
+ } else if (m.includes("3-5-sonnet") || m.includes("3-5-haiku")) {
1505
+ defaultTokens = 8192;
1506
+ upperLimit = 8192;
1507
+ } else if (m.includes("3-7-sonnet")) {
1508
+ defaultTokens = 32000;
1509
+ upperLimit = 64000;
1510
+ } else {
1511
+ defaultTokens = MAX_OUTPUT_TOKENS_DEFAULT;
1512
+ upperLimit = MAX_OUTPUT_TOKENS_UPPER_LIMIT;
1513
+ }
1514
+ const cap = getModelCapability(model);
1515
+ if (cap?.max_tokens && cap.max_tokens >= 4096) {
1516
+ upperLimit = cap.max_tokens;
1517
+ defaultTokens = Math.min(defaultTokens, upperLimit);
1518
+ }
1519
+ return { default: defaultTokens, upperLimit };
1520
+ }
1521
+ function getMaxThinkingTokensForModel(model) {
1522
+ return getModelMaxOutputTokens(model).upperLimit - 1;
1523
+ }
1524
+ var MODEL_CONTEXT_WINDOW_DEFAULT = 200000, COMPACT_MAX_OUTPUT_TOKENS = 20000, MAX_OUTPUT_TOKENS_DEFAULT = 32000, MAX_OUTPUT_TOKENS_UPPER_LIMIT = 64000, CAPPED_DEFAULT_MAX_TOKENS = 8000, ESCALATED_MAX_TOKENS = 64000;
1525
+ var init_context = __esm(() => {
1526
+ init_betas();
1527
+ init_config();
1528
+ init_envUtils();
1529
+ init_model();
1530
+ init_antModels();
1531
+ init_modelCapabilities();
1532
+ });
1533
+
1534
+ export { CLAUDE_CODE_20250219_BETA_HEADER, INTERLEAVED_THINKING_BETA_HEADER, CONTEXT_1M_BETA_HEADER, CONTEXT_MANAGEMENT_BETA_HEADER, STRUCTURED_OUTPUTS_BETA_HEADER, TOOL_SEARCH_BETA_HEADER_1P, EFFORT_BETA_HEADER, TASK_BUDGETS_BETA_HEADER, PROMPT_CACHING_SCOPE_BETA_HEADER, FAST_MODE_BETA_HEADER, REDACT_THINKING_BETA_HEADER, TOKEN_EFFICIENT_TOOLS_BETA_HEADER, AFK_MODE_BETA_HEADER, CLI_INTERNAL_BETA_HEADER, ADVISOR_BETA_HEADER, init_betas, getAPIProvider, getAPIProviderForStatsig, isFirstPartyAnthropicBaseUrl, init_providers, getAntModelOverrideConfig, getAntModels, resolveAntModel, init_antModels, getAnthropicClient, CLIENT_REQUEST_ID_HEADER, init_client, refreshModelCapabilities, init_modelCapabilities, COMPACT_MAX_OUTPUT_TOKENS, CAPPED_DEFAULT_MAX_TOKENS, ESCALATED_MAX_TOKENS, is1mContextDisabled, has1mContext, getContextWindowForModel, getSonnet1mExpTreatmentEnabled, calculateContextPercentages, getModelMaxOutputTokens, getMaxThinkingTokensForModel, init_context, CLAUDE_OPUS_4_6_CONFIG, ALL_MODEL_CONFIGS, init_configs, getModelStrings2 as getModelStrings, ensureModelStringsInitialized, init_modelStrings, isFastModeEnabled, isFastModeAvailable, getFastModeUnavailableReason, FAST_MODE_MODEL_DISPLAY, getFastModeModel, getInitialFastModeSetting, isFastModeSupportedByModel, onCooldownTriggered, onCooldownExpired, getFastModeRuntimeState, triggerFastModeCooldown, clearFastModeCooldown, handleFastModeRejectedByAPI, onFastModeOverageRejection, handleFastModeOverageRejection, isFastModeCooldown, getFastModeState, onOrgFastModeChanged, resolveFastModeStatusFromCache, prefetchFastModeStatus, init_fastMode, COST_TIER_3_15, COST_HAIKU_35, COST_HAIKU_45, getOpus46CostTier, calculateUSDCost, formatModelPricing, init_modelCost, MODEL_ALIASES, init_aliases, isModelAllowed, init_modelAllowlist, getSmallFastModel, isNonCustomOpusModel, getUserSpecifiedModelSetting, getMainLoopModel, getDefaultOpusModel, getDefaultSonnetModel, getDefaultHaikuModel, getRuntimeMainLoopModel, getDefaultMainLoopModelSetting, getDefaultMainLoopModel, getCanonicalName, renderDefaultModelSetting, getOpus46PricingSuffix, isOpus1mMergeEnabled, renderModelSetting, getPublicModelDisplayName, renderModelName, getPublicModelName, parseUserSpecifiedModel, resolveSkillModelOverride, isLegacyModelRemapEnabled, modelDisplayString, getMarketingNameForModel, normalizeModelStringForAPI, init_model };