@qitqode/qitqode-android-arm64 0.1.29 → 0.1.30
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.
- package/bundle/{chunk-fj7kd4gc.js → chunk-04tw0r4s.js} +1 -1
- package/bundle/{chunk-sbx9z70j.js → chunk-07g7cybt.js} +1 -1
- package/bundle/chunk-07ws99b1.js +2 -0
- package/bundle/chunk-09c4ngag.js +2 -0
- package/bundle/{chunk-j2zay4da.js → chunk-09kba1hg.js} +2 -2
- package/bundle/{chunk-dd3m74rc.js → chunk-0ch32p4c.js} +1 -1
- package/bundle/{chunk-2p2ch1k2.js → chunk-0df4kede.js} +1 -1
- package/bundle/{chunk-f29n7826.js → chunk-0fmbz83g.js} +1 -1
- package/bundle/{chunk-gd5stg49.js → chunk-0jgsp4c2.js} +1 -1
- package/bundle/chunk-0jgst767.js +2 -0
- package/bundle/chunk-0psrr9vp.js +2 -0
- package/bundle/{chunk-hn1f6rne.js → chunk-12bssxd4.js} +2 -2
- package/bundle/{chunk-a2qerqgd.js → chunk-1bhvt33f.js} +1 -1
- package/bundle/{chunk-3rt2k5sc.js → chunk-1dwcga8g.js} +1 -1
- package/bundle/{chunk-xn5v8wgh.js → chunk-1fbeendk.js} +1 -1
- package/bundle/chunk-1j73cnvz.js +2 -0
- package/bundle/{chunk-tqsx2m1j.js → chunk-1ngtxja9.js} +1 -1
- package/bundle/{chunk-p7h2qd7z.js → chunk-1qshjfzm.js} +1 -1
- package/bundle/{chunk-0626rvy2.js → chunk-1rp1cvmc.js} +1 -1
- package/bundle/{chunk-csdm3n24.js → chunk-1sgby720.js} +1 -1
- package/bundle/{chunk-6hmj972a.js → chunk-1t9jne14.js} +1 -1
- package/bundle/chunk-1yddn03z.js +2 -0
- package/bundle/{chunk-74zgcxeg.js → chunk-26nfphsg.js} +1 -1
- package/bundle/{chunk-71pmrpkc.js → chunk-27dgtm8r.js} +1 -1
- package/bundle/{chunk-n3t52cz2.js → chunk-27yxgy03.js} +1 -1
- package/bundle/{chunk-2hw0jzv4.js → chunk-2ahqhh4z.js} +1 -1
- package/bundle/{chunk-z5yrvg40.js → chunk-2bn4b42t.js} +1 -1
- package/bundle/{chunk-9kjj44cr.js → chunk-2dzk5txw.js} +1 -1
- package/bundle/chunk-2ec6ps8r.js +5 -0
- package/bundle/{chunk-q5363rr9.js → chunk-2gerf08b.js} +2 -2
- package/bundle/{chunk-2mjc44ev.js → chunk-2jmxt3fb.js} +1 -1
- package/bundle/{chunk-7926bzm7.js → chunk-2km50rd3.js} +1 -1
- package/bundle/{chunk-rptvpa1v.js → chunk-2q96x1t5.js} +1 -1
- package/bundle/{chunk-pg8dz1rq.js → chunk-2rs39vj2.js} +1 -1
- package/bundle/{chunk-3n49y4kh.js → chunk-2tnarng3.js} +1 -1
- package/bundle/{chunk-z160s5p5.js → chunk-2vepzgek.js} +1 -1
- package/bundle/{chunk-b9hstp7h.js → chunk-2y90ad1v.js} +1 -1
- package/bundle/{chunk-ed723mw1.js → chunk-371r2111.js} +1 -1
- package/bundle/{chunk-g06rv5fq.js → chunk-37n34pzd.js} +1 -1
- package/bundle/chunk-38g8yzw0.js +2 -0
- package/bundle/chunk-3bkd0ar3.js +2 -0
- package/bundle/{chunk-9atkgkaq.js → chunk-3bmzjznz.js} +1 -1
- package/bundle/chunk-3f4zht9e.js +2 -0
- package/bundle/{chunk-0yqbyres.js → chunk-3g1yz39h.js} +1 -1
- package/bundle/{chunk-k095hd3c.js → chunk-3n1324bt.js} +1 -1
- package/bundle/{chunk-ef2b07fm.js → chunk-3nwve06r.js} +1 -1
- package/bundle/{chunk-cev2qj7w.js → chunk-3nyqh1d6.js} +1 -1
- package/bundle/{chunk-p5360c2q.js → chunk-3pxnp6jb.js} +1 -1
- package/bundle/{chunk-94qmhz2p.js → chunk-3szwfy7w.js} +2 -2
- package/bundle/chunk-426dt7be.js +2 -0
- package/bundle/{chunk-6jewfaqa.js → chunk-42f7p0hq.js} +2 -2
- package/bundle/chunk-4amgp4yd.js +3 -0
- package/bundle/{chunk-3vmh2ge6.js → chunk-4p5e5tsz.js} +1 -1
- package/bundle/{chunk-nfzmvy30.js → chunk-4pjm21a5.js} +1 -1
- package/bundle/{chunk-6hdjkvr1.js → chunk-4qqkqrn9.js} +2 -2
- package/bundle/chunk-4sz3jbc5.js +2 -0
- package/bundle/{chunk-bsf6n350.js → chunk-4tbwha3m.js} +2 -2
- package/bundle/{chunk-qtsmgjk7.js → chunk-4xh1qm90.js} +1 -1
- package/bundle/{chunk-t3q7qakr.js → chunk-58x5seqn.js} +1 -1
- package/bundle/{chunk-thk93j3e.js → chunk-5a5t01ka.js} +1 -1
- package/bundle/{chunk-hhgjbag9.js → chunk-5fgx6fa4.js} +1 -1
- package/bundle/{chunk-n86s4fw4.js → chunk-5fz8tph5.js} +1 -1
- package/bundle/{chunk-n5sh2790.js → chunk-5qam3c8r.js} +1 -1
- package/bundle/{chunk-45jqjyk9.js → chunk-5v4py9p2.js} +1 -1
- package/bundle/{chunk-z44m19vm.js → chunk-5xe6x2rt.js} +1 -1
- package/bundle/chunk-618tmyx9.js +2 -0
- package/bundle/{chunk-zasd8cz8.js → chunk-61c62e5s.js} +1 -1
- package/bundle/chunk-6d9wsjxm.js +2 -0
- package/bundle/{chunk-zqxmr01r.js → chunk-6fp8a9ek.js} +1 -1
- package/bundle/{chunk-ndmrg80b.js → chunk-6hv59ere.js} +1 -1
- package/bundle/{chunk-yaj9ywvz.js → chunk-6nbzdb0r.js} +1 -1
- package/bundle/{chunk-k7dcfqjs.js → chunk-6qy1ghrx.js} +1 -1
- package/bundle/chunk-730a2d1k.js +2 -0
- package/bundle/{chunk-gf5pwww1.js → chunk-76wrw0cs.js} +1 -1
- package/bundle/chunk-7bd0x9vf.js +2 -0
- package/bundle/chunk-7czkntef.js +2 -0
- package/bundle/chunk-7ex57nyh.js +2 -0
- package/bundle/chunk-7gpczxbh.js +2 -0
- package/bundle/chunk-7j0bgeh2.js +2 -0
- package/bundle/{chunk-cfxjwfn4.js → chunk-7jbz3dgt.js} +1 -1
- package/bundle/{chunk-cjfgs1x8.js → chunk-7ppd2phw.js} +1 -1
- package/bundle/chunk-7py443fe.js +2 -0
- package/bundle/{chunk-v7deh7aj.js → chunk-7yrhe3xq.js} +1 -1
- package/bundle/{chunk-xhncwg5v.js → chunk-89q1y7tc.js} +1 -1
- package/bundle/{chunk-yn576pje.js → chunk-89v6dgpp.js} +2 -2
- package/bundle/chunk-8qkhddq3.js +8 -0
- package/bundle/chunk-90q5sae0.js +2 -0
- package/bundle/chunk-9amwe0ed.js +2 -0
- package/bundle/chunk-9grvepmd.js +2 -0
- package/bundle/chunk-9hrh15p2.js +2 -0
- package/bundle/{chunk-azx0zxnx.js → chunk-9j1qqdr2.js} +1 -1
- package/bundle/{chunk-s2za1n7h.js → chunk-a0v55ywn.js} +2 -2
- package/bundle/{chunk-a8p9aggx.js → chunk-a1p2f16h.js} +2 -2
- package/bundle/{chunk-8f0g7d7k.js → chunk-a1pw9r6f.js} +1 -1
- package/bundle/{chunk-95qs7wnz.js → chunk-a2qz9m10.js} +1 -1
- package/bundle/{chunk-az9hsk6z.js → chunk-ab6cabxh.js} +1 -1
- package/bundle/chunk-av6ezvxm.js +2 -0
- package/bundle/{chunk-yjj4cvqg.js → chunk-aztre27e.js} +1 -1
- package/bundle/{chunk-b4qd109w.js → chunk-b0syck9r.js} +1 -1
- package/bundle/{chunk-hevb7k95.js → chunk-b3dqcbsc.js} +1 -1
- package/bundle/{chunk-pq2prhb2.js → chunk-b3rpzkcb.js} +1 -1
- package/bundle/{chunk-tsb9g1nz.js → chunk-b8bytvka.js} +1 -1
- package/bundle/{chunk-awav98j0.js → chunk-b8tw709r.js} +1 -1
- package/bundle/{chunk-6528bthc.js → chunk-b9za12y1.js} +1 -1
- package/bundle/{chunk-fsy279s5.js → chunk-be216spx.js} +2 -2
- package/bundle/chunk-beksar7w.js +2 -0
- package/bundle/chunk-bg66rqrx.js +2 -0
- package/bundle/{chunk-a94s0jks.js → chunk-bn15mzd7.js} +1 -1
- package/bundle/{chunk-z29fwg61.js → chunk-bpbptx89.js} +1 -1
- package/bundle/{chunk-qzjpea91.js → chunk-bss414qz.js} +1 -1
- package/bundle/chunk-bt6yw07v.js +2 -0
- package/bundle/{chunk-d0qqgxs4.js → chunk-btz9jvec.js} +1 -1
- package/bundle/{chunk-ypthfv6d.js → chunk-bvkq0a5q.js} +1 -1
- package/bundle/{chunk-bx6kyvg7.js → chunk-c01z3cvg.js} +1 -1
- package/bundle/{chunk-s6me101a.js → chunk-c5e6sk9c.js} +1 -1
- package/bundle/{chunk-yn05n0az.js → chunk-cafzcmrg.js} +2 -2
- package/bundle/{chunk-2xxefrps.js → chunk-cdhmc0t0.js} +1 -1
- package/bundle/{chunk-qredfmch.js → chunk-chmrvbbj.js} +1 -1
- package/bundle/{chunk-b1ntb3dh.js → chunk-ct48575c.js} +1 -1
- package/bundle/{chunk-yp3dj4wh.js → chunk-cvdxgsq1.js} +1 -1
- package/bundle/chunk-cy9s1ma5.js +2 -0
- package/bundle/chunk-d0nkvp57.js +2 -0
- package/bundle/{chunk-abtn6nec.js → chunk-d5bxan80.js} +1 -1
- package/bundle/{chunk-5n4hpc4f.js → chunk-d6r4xwtg.js} +3 -3
- package/bundle/{chunk-xk1nh1ay.js → chunk-dcvatax2.js} +2 -2
- package/bundle/{chunk-m2ny1en7.js → chunk-ddnpx1yx.js} +4 -4
- package/bundle/{chunk-qzcfjz9g.js → chunk-dfnv7vkn.js} +1 -1
- package/bundle/{chunk-18vygvnc.js → chunk-dhjp0zx2.js} +1 -1
- package/bundle/{chunk-sv48x9h8.js → chunk-dq9kpj4a.js} +1 -1
- package/bundle/{chunk-88dhcv37.js → chunk-drs1gv2b.js} +1 -1
- package/bundle/{chunk-geccvf9d.js → chunk-ds69qc8b.js} +1 -1
- package/bundle/chunk-dvk2wwjj.js +2 -0
- package/bundle/chunk-dxe29jj6.js +2 -0
- package/bundle/chunk-e0jy9qxd.js +2 -0
- package/bundle/{chunk-fhdpp77n.js → chunk-eb9mytjq.js} +1 -1
- package/bundle/{chunk-c19t7e8s.js → chunk-ecn8gbtz.js} +1 -1
- package/bundle/chunk-eercqt72.js +2 -0
- package/bundle/{chunk-8jzjvmaz.js → chunk-efxd6b2k.js} +1 -1
- package/bundle/{chunk-hd2kb05a.js → chunk-ejjea8hh.js} +1 -1
- package/bundle/chunk-eneawsj8.js +2 -0
- package/bundle/{chunk-v9xnk9pz.js → chunk-ezja6njs.js} +1 -1
- package/bundle/{chunk-8kz3n8ye.js → chunk-f45tp3e3.js} +1 -1
- package/bundle/chunk-f72pppr7.js +2 -0
- package/bundle/chunk-feyphhxd.js +2 -0
- package/bundle/{chunk-2w20mhch.js → chunk-fjgyrsbw.js} +1 -1
- package/bundle/{chunk-v00cptj6.js → chunk-fkgv2hqd.js} +1 -1
- package/bundle/{chunk-8d2ddmf0.js → chunk-fnbpap62.js} +1 -1
- package/bundle/chunk-fnnch1e9.js +2 -0
- package/bundle/{chunk-7wthn44y.js → chunk-fqw4y7x0.js} +2 -2
- package/bundle/{chunk-yk8kk25c.js → chunk-ft93f33g.js} +1 -1
- package/bundle/{chunk-3q6650we.js → chunk-g1dwbvkg.js} +1 -1
- package/bundle/{chunk-mb4wvwfw.js → chunk-g3dhsmbt.js} +3 -3
- package/bundle/{chunk-1xw68zak.js → chunk-g7rjtehn.js} +1 -1
- package/bundle/{chunk-q0xzbad1.js → chunk-gf0pdgjs.js} +1 -1
- package/bundle/{chunk-gd45tjbd.js → chunk-ggqst87g.js} +1 -1
- package/bundle/{chunk-n34y5gp6.js → chunk-gj3hzx3d.js} +2 -2
- package/bundle/chunk-gk34kh8p.js +2 -0
- package/bundle/{chunk-pycjksh4.js → chunk-gm85xefs.js} +1 -1
- package/bundle/chunk-gn50xqbd.js +2 -0
- package/bundle/{chunk-89f8v2y8.js → chunk-h0rpmne5.js} +1 -1
- package/bundle/chunk-h6rv626m.js +2 -0
- package/bundle/chunk-h7s2w1e2.js +2 -0
- package/bundle/{chunk-yyqrbv2f.js → chunk-h9pvnp5c.js} +1 -1
- package/bundle/{chunk-hpfqnjfz.js → chunk-hj5y7fvk.js} +1 -1
- package/bundle/chunk-hmv2cdnz.js +2 -0
- package/bundle/chunk-ht81ensf.js +2 -0
- package/bundle/{chunk-44jpsp97.js → chunk-hw1dmx28.js} +1 -1
- package/bundle/{chunk-43ae3chd.js → chunk-hwbyqezq.js} +2 -2
- package/bundle/{chunk-97h0jx8y.js → chunk-hxpgs78j.js} +1 -1
- package/bundle/{chunk-yj73ehjd.js → chunk-hxz2rdjq.js} +1 -1
- package/bundle/chunk-j59ktwny.js +2 -0
- package/bundle/{chunk-cd867geb.js → chunk-j5kb0y1m.js} +1 -1
- package/bundle/{chunk-1rn0vmvv.js → chunk-j6emx6jn.js} +2 -2
- package/bundle/{chunk-ekndhwnn.js → chunk-j9pcnkkq.js} +2 -2
- package/bundle/{chunk-2p9py4rw.js → chunk-jje0srjq.js} +1 -1
- package/bundle/{chunk-kkae8ead.js → chunk-jm1ptn8n.js} +1 -1
- package/bundle/chunk-jmz2mq3t.js +2 -0
- package/bundle/{chunk-11d987sj.js → chunk-jvqbvgjy.js} +1 -1
- package/bundle/chunk-k309zez0.js +3 -0
- package/bundle/chunk-k3fn3yed.js +2 -0
- package/bundle/{chunk-1fz0383p.js → chunk-k7gq9bra.js} +1 -1
- package/bundle/{chunk-eqcd9k9p.js → chunk-k8ss3135.js} +130 -130
- package/bundle/{chunk-4fk4se02.js → chunk-kfsb2stm.js} +1 -1
- package/bundle/{chunk-b73s2h43.js → chunk-knpt9n8f.js} +1 -1
- package/bundle/chunk-kpw6nghv.js +2 -0
- package/bundle/{chunk-81h5f8ev.js → chunk-kqn9h2gk.js} +1 -1
- package/bundle/{chunk-jwtev7b7.js → chunk-m02zt1a3.js} +2 -2
- package/bundle/{chunk-ktqrbbkh.js → chunk-m1h5a4vg.js} +1 -1
- package/bundle/chunk-m5ghbt5y.js +2 -0
- package/bundle/{chunk-4vze3djr.js → chunk-m612agnk.js} +1 -1
- package/bundle/{chunk-hbtd620x.js → chunk-m67tcnk4.js} +1 -1
- package/bundle/{chunk-6bsgrr5h.js → chunk-mgk9sh16.js} +1 -1
- package/bundle/{chunk-wnwesaap.js → chunk-mj4bepvj.js} +1 -1
- package/bundle/{chunk-t3tkp1em.js → chunk-mk6cddvd.js} +1 -1
- package/bundle/chunk-mn41f9qv.js +2 -0
- package/bundle/chunk-mqjf9sbm.js +2 -0
- package/bundle/{chunk-r4mnbhe1.js → chunk-mrw279k3.js} +1 -1
- package/bundle/{chunk-qje3683x.js → chunk-msegx0t7.js} +1 -1
- package/bundle/{chunk-x6nbck7p.js → chunk-mskwkcgj.js} +1 -1
- package/bundle/{chunk-ce5t444d.js → chunk-my6sz5d6.js} +1 -1
- package/bundle/{chunk-scqxmv8k.js → chunk-n26yf3he.js} +1 -1
- package/bundle/chunk-n5gwrrbb.js +2 -0
- package/bundle/{chunk-6scqd8fh.js → chunk-n8h6x2en.js} +1 -1
- package/bundle/chunk-nfjhem1c.js +2 -0
- package/bundle/{chunk-h8chkene.js → chunk-ngchsw2g.js} +1 -1
- package/bundle/{chunk-rf524gez.js → chunk-ngytjdg2.js} +1 -1
- package/bundle/chunk-nj4d554m.js +11 -0
- package/bundle/chunk-nrc3bj9p.js +2 -0
- package/bundle/{chunk-0xm85ayc.js → chunk-nt4e3em9.js} +1 -1
- package/bundle/chunk-nxyyn2ra.js +2 -0
- package/bundle/{chunk-t35n89t9.js → chunk-nzehfpxp.js} +1 -1
- package/bundle/chunk-p5tceb4k.js +2 -0
- package/bundle/{chunk-js9wdh67.js → chunk-p68rwmhc.js} +1 -1
- package/bundle/{chunk-g0mbbysk.js → chunk-pekm54ce.js} +1 -1
- package/bundle/{chunk-yvqbewmc.js → chunk-phxrg7aw.js} +2 -2
- package/bundle/{chunk-3h4y7n1a.js → chunk-ppfjf7qx.js} +1 -1
- package/bundle/{chunk-d7t0bcvk.js → chunk-pvpy9kq1.js} +6 -6
- package/bundle/{chunk-k16s2dnx.js → chunk-q1v2pytx.js} +1 -1
- package/bundle/{chunk-svrxk3vf.js → chunk-q6ztpfcs.js} +2 -2
- package/bundle/{chunk-8k55xz7z.js → chunk-qhc90p4a.js} +1 -1
- package/bundle/chunk-qjgm3e2p.js +2 -0
- package/bundle/{chunk-4mrz9b6d.js → chunk-qjjch1zt.js} +2 -2
- package/bundle/{chunk-b20xjnpw.js → chunk-qjn86fc0.js} +1 -1
- package/bundle/{chunk-9epjgend.js → chunk-qrey2gwb.js} +2 -2
- package/bundle/chunk-qt80mhdn.js +2 -0
- package/bundle/chunk-qtw5nrr4.js +2 -0
- package/bundle/{chunk-xk7je9y8.js → chunk-qv2s39dv.js} +1 -1
- package/bundle/chunk-rc9ex3vt.js +2 -0
- package/bundle/{chunk-xn61fgrh.js → chunk-s07j8hfy.js} +1 -1
- package/bundle/{chunk-y212x7ws.js → chunk-s3yna2wm.js} +1 -1
- package/bundle/chunk-s9672vvv.js +2 -0
- package/bundle/chunk-sbyey0qb.js +2 -0
- package/bundle/{chunk-ps6jk326.js → chunk-scnz207s.js} +1 -1
- package/bundle/{chunk-k20nrwbg.js → chunk-sermjas1.js} +1 -1
- package/bundle/chunk-shpq6es1.js +3 -0
- package/bundle/chunk-sj5v361q.js +2 -0
- package/bundle/{chunk-qsszerj7.js → chunk-sn4nez18.js} +2 -2
- package/bundle/{chunk-t299e2aw.js → chunk-snm5q21k.js} +2 -2
- package/bundle/{chunk-yt2k9ga8.js → chunk-srh4xvsj.js} +1 -1
- package/bundle/{chunk-a2g69pv6.js → chunk-svvgv1s0.js} +1 -1
- package/bundle/{chunk-n4gjpgnk.js → chunk-szr0f7k2.js} +1 -1
- package/bundle/{chunk-4vemws1t.js → chunk-t12xrrfr.js} +2 -2
- package/bundle/chunk-ta3k9syc.js +2 -0
- package/bundle/{chunk-d86ma6zk.js → chunk-tj78jsp9.js} +1 -1
- package/bundle/chunk-tk5afan4.js +2 -0
- package/bundle/chunk-tpndnprb.js +2 -0
- package/bundle/{chunk-jkm54mha.js → chunk-tr8sf0dk.js} +1 -1
- package/bundle/{chunk-hgbkg85g.js → chunk-v2zp22r3.js} +1 -1
- package/bundle/{chunk-jntqzhxr.js → chunk-v4xcysh0.js} +1 -1
- package/bundle/{chunk-19sa03c1.js → chunk-v965rsr8.js} +2 -2
- package/bundle/{chunk-2ztdqtnk.js → chunk-vcmrrt8b.js} +1 -1
- package/bundle/chunk-vcrn3v70.js +2 -0
- package/bundle/{chunk-b9nwaaqs.js → chunk-vg2fmyje.js} +2 -2
- package/bundle/{chunk-98vfbn0h.js → chunk-vj62pc0h.js} +1 -1
- package/bundle/{chunk-g3ch14a1.js → chunk-vn7nkrqb.js} +1 -1
- package/bundle/chunk-vwxfgea7.js +2 -0
- package/bundle/chunk-w0kgcz1t.js +2 -0
- package/bundle/{chunk-50w28xj1.js → chunk-w87a3mzm.js} +1 -1
- package/bundle/{chunk-09j71kp6.js → chunk-wfs4pcwa.js} +3 -3
- package/bundle/{chunk-zqjp7jdd.js → chunk-wgpsmxqx.js} +1 -1
- package/bundle/{chunk-kw09hbrb.js → chunk-whcg14sc.js} +1 -1
- package/bundle/{chunk-20d0cd1j.js → chunk-whxjkz9a.js} +2 -2
- package/bundle/chunk-wksczmes.js +2 -0
- package/bundle/{chunk-m6wceqay.js → chunk-wnqwb6fd.js} +1 -1
- package/bundle/{chunk-7mc8nxve.js → chunk-wpajh5s5.js} +1 -1
- package/bundle/chunk-wsxta33r.js +2 -0
- package/bundle/{chunk-byc7ev8p.js → chunk-wsy0m70r.js} +1 -1
- package/bundle/{chunk-csyw14fj.js → chunk-wy46mbwt.js} +1 -1
- package/bundle/{chunk-0wdtbn59.js → chunk-wz0zcddf.js} +2 -2
- package/bundle/{chunk-gjvymdhp.js → chunk-x067eetw.js} +1 -1
- package/bundle/{chunk-s1sepxdp.js → chunk-xc5044tm.js} +1 -1
- package/bundle/{chunk-tj00kzk4.js → chunk-xck0sq3k.js} +1 -1
- package/bundle/chunk-xjyhtm8r.js +2 -0
- package/bundle/{chunk-rs1698xs.js → chunk-xm08fc2q.js} +1 -1
- package/bundle/{chunk-bv8pf0m1.js → chunk-xpc2zgj7.js} +2 -2
- package/bundle/{chunk-nxn4arcf.js → chunk-xs3xtz6x.js} +1 -1
- package/bundle/{chunk-6saj1dhz.js → chunk-y062spw2.js} +1 -1
- package/bundle/{chunk-qk9vccja.js → chunk-y2v09y71.js} +1 -1
- package/bundle/{chunk-61yatzp8.js → chunk-ydp0q1hk.js} +1 -1
- package/bundle/{chunk-z4nay2ef.js → chunk-yfkvjphe.js} +1 -1
- package/bundle/chunk-ygc5qegv.js +2 -0
- package/bundle/chunk-yjqmzm51.js +2 -0
- package/bundle/{chunk-nv2r4cns.js → chunk-yjtdgcq5.js} +1 -1
- package/bundle/{chunk-5z7mjwwa.js → chunk-yn6sbycg.js} +1 -1
- package/bundle/{chunk-4fspp5fg.js → chunk-yp0a8q29.js} +3 -3
- package/bundle/{chunk-bzrsnv2k.js → chunk-yq3m8190.js} +2 -2
- package/bundle/{chunk-7m8fdp5p.js → chunk-yy526n9c.js} +1 -1
- package/bundle/chunk-yzc53n88.js +2 -0
- package/bundle/{chunk-j0znryc6.js → chunk-yzjc15vp.js} +1 -1
- package/bundle/chunk-z7y9pdj7.js +2 -0
- package/bundle/{chunk-rqgcz2zr.js → chunk-z8g819cz.js} +1 -1
- package/bundle/{chunk-4kpvceap.js → chunk-z8r65yw3.js} +1 -1
- package/bundle/{chunk-31wxbws4.js → chunk-zb0me4kk.js} +1 -1
- package/bundle/{chunk-asmfntjm.js → chunk-zcm2jdr5.js} +1 -1
- package/bundle/chunk-zt1nbwmm.js +2 -0
- package/bundle/{chunk-zbq60sw6.js → chunk-ztc3gm8y.js} +1 -1
- package/bundle/{chunk-v9bmpndq.js → chunk-zv6pjtz1.js} +1 -1
- package/bundle/{chunk-1d9f53sk.js → chunk-zyhdxggp.js} +2 -2
- package/bundle/{chunk-ma0m6kpj.js → chunk-zz36xg2n.js} +1 -1
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-07c1mvy1.js +0 -2
- package/bundle/chunk-0p7qcm51.js +0 -2
- package/bundle/chunk-0pmb7zzh.js +0 -2
- package/bundle/chunk-1s9ctg0d.js +0 -2
- package/bundle/chunk-2f9fn9xr.js +0 -2
- package/bundle/chunk-2fhcvfyg.js +0 -2
- package/bundle/chunk-3mfj0x4p.js +0 -2
- package/bundle/chunk-3shnje9k.js +0 -2
- package/bundle/chunk-3tz1qhpt.js +0 -2
- package/bundle/chunk-4dtbdycg.js +0 -2
- package/bundle/chunk-4pz8av2y.js +0 -2
- package/bundle/chunk-4r4xh8a6.js +0 -2
- package/bundle/chunk-5hpq59t1.js +0 -2
- package/bundle/chunk-5s90ehww.js +0 -2
- package/bundle/chunk-63kcg127.js +0 -2
- package/bundle/chunk-6fejrpht.js +0 -2
- package/bundle/chunk-6zzdw7q1.js +0 -2
- package/bundle/chunk-78m8rayq.js +0 -2
- package/bundle/chunk-7j6p5j2g.js +0 -2
- package/bundle/chunk-7tjd6ba1.js +0 -2
- package/bundle/chunk-8d8efdry.js +0 -2
- package/bundle/chunk-93jxndr8.js +0 -2
- package/bundle/chunk-99ve54r6.js +0 -2
- package/bundle/chunk-9ksaqyb2.js +0 -2
- package/bundle/chunk-9p7t748e.js +0 -2
- package/bundle/chunk-a69jgepp.js +0 -2
- package/bundle/chunk-ar310tc3.js +0 -2
- package/bundle/chunk-at03h9eq.js +0 -2
- package/bundle/chunk-ay9p70xx.js +0 -2
- package/bundle/chunk-b6dsv601.js +0 -3
- package/bundle/chunk-bajtytm5.js +0 -2
- package/bundle/chunk-bh8v3mfg.js +0 -2
- package/bundle/chunk-bn0h9dny.js +0 -10
- package/bundle/chunk-bp8sxnrm.js +0 -2
- package/bundle/chunk-bw5e8thn.js +0 -2
- package/bundle/chunk-c8ajbhv3.js +0 -2
- package/bundle/chunk-c8n72r2k.js +0 -8
- package/bundle/chunk-ccddzk10.js +0 -2
- package/bundle/chunk-ch8cx9jn.js +0 -2
- package/bundle/chunk-cm4jtnkg.js +0 -2
- package/bundle/chunk-cq7j5tv5.js +0 -2
- package/bundle/chunk-cttqh20d.js +0 -2
- package/bundle/chunk-cvvfa1jf.js +0 -2
- package/bundle/chunk-dfja6dj6.js +0 -5
- package/bundle/chunk-e3qtndrt.js +0 -2
- package/bundle/chunk-e8cac405.js +0 -2
- package/bundle/chunk-ez92ah9y.js +0 -2
- package/bundle/chunk-fazvedgy.js +0 -2
- package/bundle/chunk-gtzcm5sb.js +0 -2
- package/bundle/chunk-kfgn4apg.js +0 -2
- package/bundle/chunk-kzrw6h8t.js +0 -2
- package/bundle/chunk-mjrvj2cg.js +0 -2
- package/bundle/chunk-mpebdv59.js +0 -2
- package/bundle/chunk-n20v44zr.js +0 -2
- package/bundle/chunk-nksathh4.js +0 -2
- package/bundle/chunk-q14890p6.js +0 -2
- package/bundle/chunk-q4n02cwv.js +0 -2
- package/bundle/chunk-q7s17j1b.js +0 -2
- package/bundle/chunk-qm07wesh.js +0 -2
- package/bundle/chunk-qrrg9v3d.js +0 -2
- package/bundle/chunk-rdqgss38.js +0 -2
- package/bundle/chunk-rzc528ym.js +0 -2
- package/bundle/chunk-sbv96mj0.js +0 -3
- package/bundle/chunk-th78zcds.js +0 -2
- package/bundle/chunk-tv26mwx5.js +0 -2
- package/bundle/chunk-v69n6mef.js +0 -2
- package/bundle/chunk-vegwb3t0.js +0 -2
- package/bundle/chunk-w9seyn69.js +0 -2
- package/bundle/chunk-wanf4se3.js +0 -2
- package/bundle/chunk-wdhzmk1b.js +0 -2
- package/bundle/chunk-wxqtda70.js +0 -2
- package/bundle/chunk-wzb6s9rk.js +0 -2
- package/bundle/chunk-x0dg9rg6.js +0 -2
- package/bundle/chunk-xmnzrzbs.js +0 -2
- package/bundle/chunk-xzf62kc6.js +0 -2
- package/bundle/chunk-yned6vmd.js +0 -3
- package/bundle/chunk-yra49yga.js +0 -2
- package/bundle/chunk-ytye0p7f.js +0 -2
- package/bundle/chunk-yv2mxxbq.js +0 -2
- package/bundle/chunk-z2fqqer0.js +0 -2
- package/bundle/chunk-z3qanc8m.js +0 -2
- package/bundle/chunk-zcagdtab.js +0 -2
- package/bundle/chunk-zervk6c5.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ye as M}from"./chunk-
|
|
2
|
+
import{ye as M}from"./chunk-v2zp22r3.js";import{Be as D}from"./chunk-j9pcnkkq.js";import{Ce as B}from"./chunk-dq9kpj4a.js";import{wf as d,yf as w}from"./chunk-cvdxgsq1.js";import{$P as n}from"./chunk-aztre27e.js";var R=n(D(),1),i=n(d(),1),A=n(M(),1);import N from"fs/promises";var S=n(d(),1);var _="169.254.170.2",p="169.254.170.23",u="[fd00:ec2::23]",g=(e,c)=>{if(e.protocol==="https:")return;if(e.hostname===_||e.hostname===p||e.hostname===u)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;let a=e.hostname.split("."),r=(t)=>{let s=parseInt(t,10);return 0<=s&&s<=255};if(a[0]==="127"&&r(a[1])&&r(a[2])&&r(a[3])&&a.length===4)return}throw new S.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
3
3
|
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
4
4
|
- ECS container host 169.254.170.2
|
|
5
5
|
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:c})};var f=n(d(),1),I=n(B(),1),P=n(w(),1),K=n(w(),1);function x(e){return new I.HttpRequest({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((c,[a,r])=>{return c[a]=r,c},{}),fragment:e.hash})}async function E(e,c){let r=await K.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){let t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new f.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:c});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:P.parseRfc3339DateTime(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new f.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c}),{Code:t.Code,Message:t.Message})}throw new f.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c})}var T=(e,c,a)=>{return async()=>{for(let r=0;r<c;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,a))}return await e()}};var j="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",J="http://169.254.170.2",$="AWS_CONTAINER_CREDENTIALS_FULL_URI",G="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",H="AWS_CONTAINER_AUTHORIZATION_TOKEN",k=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let c,a=e.awsContainerCredentialsRelativeUri??process.env[j],r=e.awsContainerCredentialsFullUri??process.env[$],t=e.awsContainerAuthorizationToken??process.env[H],s=e.awsContainerAuthorizationTokenFile??process.env[G],m=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?.warn?console.warn:e.logger.warn.bind(e.logger);if(a&&r)m("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),m("awsContainerCredentialsFullUri will take precedence.");if(t&&s)m("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),m("awsContainerAuthorizationToken will take precedence.");if(r)c=r;else if(a)c=`${J}${a}`;else throw new i.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Dp as LG,Ep as VG,Ip as u,Jp as l,Kp as UG,Lp as hG,Mp as gG,Np as mG,Rp as dG,So as CG,To as bG,Xo as TG,Zo as jG,gp as AG,lp as OG,np as kG,pp as vG,qp as _G,tp as J,wp as W,xp as GG}from"./chunk-bzrsnv2k.js";import{Up as NG,Xp as MG,bq as WG,eq as HG}from"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import{Tt as G}from"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yjj4cvqg.js";var aG="3.0.71",eG=J(()=>W(G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}))),yG=hG({errorSchema:eG,errorToMessage:(Q)=>Q.error.message}),oG=J(()=>W(G.object({type:G.literal("message"),id:G.string().nullish(),model:G.string().nullish(),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string(),citations:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])).optional()}),G.object({type:G.literal("thinking"),thinking:G.string(),signature:G.string()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])),stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish(),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}))),tG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("message_start"),message:G.object({id:G.string().nullish(),model:G.string().nullish(),role:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish()}),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()})])).nullish(),stop_reason:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string()}).nullish()})}),G.object({type:G.literal("content_block_start"),index:G.number(),content_block:G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string()}),G.object({type:G.literal("thinking"),thinking:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).optional(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string().nullish()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])}),G.object({type:G.literal("content_block_delta"),index:G.number(),delta:G.discriminatedUnion("type",[G.object({type:G.literal("input_json_delta"),partial_json:G.string()}),G.object({type:G.literal("text_delta"),text:G.string()}),G.object({type:G.literal("thinking_delta"),thinking:G.string()}),G.object({type:G.literal("signature_delta"),signature:G.string()}),G.object({type:G.literal("compaction_delta"),content:G.string().nullish()}),G.object({type:G.literal("citations_delta"),citation:G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])})])}),G.object({type:G.literal("content_block_stop"),index:G.number()}),G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}),G.object({type:G.literal("message_delta"),delta:G.object({stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish()}),usage:G.looseObject({input_tokens:G.number().nullish(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}),G.object({type:G.literal("message_stop")}),G.object({type:G.literal("ping")})]))),GQ=J(()=>W(G.object({signature:G.string().optional(),redactedData:G.string().optional()}))),FG=G.object({citations:G.object({enabled:G.boolean()}).optional(),title:G.string().optional(),context:G.string().optional()}),xG=G.object({sendReasoning:G.boolean().optional(),structuredOutputMode:G.enum(["outputFormat","jsonTool","auto"]).optional(),thinking:G.discriminatedUnion("type",[G.object({type:G.literal("adaptive"),display:G.enum(["omitted","summarized"]).optional()}),G.object({type:G.literal("enabled"),budgetTokens:G.number().optional()}),G.object({type:G.literal("disabled")})]).optional(),disableParallelToolUse:G.boolean().optional(),cacheControl:G.object({type:G.literal("ephemeral"),ttl:G.union([G.literal("5m"),G.literal("1h")]).optional()}).optional(),metadata:G.object({userId:G.string().optional()}).optional(),mcpServers:G.array(G.object({type:G.literal("url"),name:G.string(),url:G.string(),authorizationToken:G.string().nullish(),toolConfiguration:G.object({enabled:G.boolean().nullish(),allowedTools:G.array(G.string()).nullish()}).nullish()})).optional(),container:G.object({id:G.string().optional(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skillId:G.string(),version:G.string().optional()})).optional()}).optional(),toolStreaming:G.boolean().optional(),effort:G.enum(["low","medium","high","xhigh","max"]).optional(),taskBudget:G.object({type:G.literal("tokens"),total:G.number().int().min(20000),remaining:G.number().int().min(0).optional()}).optional(),speed:G.enum(["fast","standard"]).optional(),inferenceGeo:G.enum(["us","global"]).optional(),anthropicBeta:G.array(G.string()).optional(),contextManagement:G.object({edits:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("clear_tool_uses_20250919"),trigger:G.discriminatedUnion("type",[G.object({type:G.literal("input_tokens"),value:G.number()}),G.object({type:G.literal("tool_uses"),value:G.number()})]).optional(),keep:G.object({type:G.literal("tool_uses"),value:G.number()}).optional(),clearAtLeast:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),clearToolInputs:G.boolean().optional(),excludeTools:G.array(G.string()).optional()}),G.object({type:G.literal("clear_thinking_20251015"),keep:G.union([G.literal("all"),G.object({type:G.literal("thinking_turns"),value:G.number()})]).optional()}),G.object({type:G.literal("compact_20260112"),trigger:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),pauseAfterCompaction:G.boolean().optional(),instructions:G.string().optional()})]))}).optional()}),PG=4;function QQ(Q){var H;let Z=Q==null?void 0:Q.anthropic;return(H=Z==null?void 0:Z.cacheControl)!=null?H:Z==null?void 0:Z.cache_control}var RG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(Q,H){let Z=QQ(Q);if(!Z)return;if(!H.canCache){this.warnings.push({type:"unsupported",feature:"cache_control on non-cacheable context",details:`cache_control cannot be set on ${H.type}. It will be ignored.`});return}if(this.breakpointCount++,this.breakpointCount>PG){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:`Maximum ${PG} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`});return}return Z}getWarnings(){return this.warnings}},XQ=J(()=>W(G.object({maxCharacters:G.number().optional()}))),YQ=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZQ=u({id:"anthropic.text_editor_20250728",inputSchema:YQ}),$Q=(Q={})=>{return ZQ(Q)},zQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),LQ=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),HQ=J(()=>W(G.object({query:G.string()}))),qQ=l({id:"anthropic.web_search_20260209",inputSchema:HQ,outputSchema:LQ,supportsDeferredResults:!0}),AQ=(Q={})=>{return qQ(Q)},KQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),uG=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),DQ=J(()=>W(G.object({query:G.string()}))),JQ=l({id:"anthropic.web_search_20250305",inputSchema:DQ,outputSchema:uG,supportsDeferredResults:!0}),WQ=(Q={})=>{return JQ(Q)},jQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),VQ=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),UQ=J(()=>W(G.object({url:G.string()}))),RQ=l({id:"anthropic.web_fetch_20260209",inputSchema:UQ,outputSchema:VQ,supportsDeferredResults:!0}),EQ=(Q={})=>{return RQ(Q)},SQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),cG=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),yQ=J(()=>W(G.object({url:G.string()}))),FQ=l({id:"anthropic.web_fetch_20250910",inputSchema:yQ,outputSchema:cG,supportsDeferredResults:!0}),xQ=(Q={})=>{return FQ(Q)};async function PQ({tools:Q,toolChoice:H,disableParallelToolUse:Z,cacheControlValidator:q,supportsStructuredOutput:E,supportsStrictTools:T,defaultEagerInputStreaming:b=!1}){var F,h;Q=(Q==null?void 0:Q.length)?Q:void 0;let w=[],N=new Set,c=q||new RG;if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};let R=[];for(let S of Q)switch(S.type){case"function":{let B=c.getCacheControl(S.providerOptions,{type:"tool definition",canCache:!0}),g=(F=S.providerOptions)==null?void 0:F.anthropic,m=(h=g==null?void 0:g.eagerInputStreaming)!=null?h:b,O=g==null?void 0:g.deferLoading,e=g==null?void 0:g.allowedCallers;if(!T&&S.strict!=null)w.push({type:"unsupported",feature:"strict",details:`Tool '${S.name}' has strict: ${S.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`});if(R.push({name:S.name,description:S.description,input_schema:S.inputSchema,cache_control:B,...m?{eager_input_streaming:!0}:{},...T===!0&&S.strict!=null?{strict:S.strict}:{},...O!=null?{defer_loading:O}:{},...e!=null?{allowed_callers:e}:{},...S.inputExamples!=null?{input_examples:S.inputExamples.map((C)=>C.input)}:{}}),E===!0)N.add("structured-outputs-2025-11-13");if(S.inputExamples!=null||e!=null)N.add("advanced-tool-use-2025-11-20");break}case"provider":{switch(S.id){case"anthropic.code_execution_20250522":{N.add("code-execution-2025-05-22"),R.push({type:"code_execution_20250522",name:"code_execution",cache_control:void 0});break}case"anthropic.code_execution_20250825":{N.add("code-execution-2025-08-25"),R.push({type:"code_execution_20250825",name:"code_execution"});break}case"anthropic.code_execution_20260120":{R.push({type:"code_execution_20260120",name:"code_execution"});break}case"anthropic.computer_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"computer",type:"computer_20250124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.computer_20251124":{N.add("computer-use-2025-11-24"),R.push({name:"computer",type:"computer_20251124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,enable_zoom:S.args.enableZoom,cache_control:void 0});break}case"anthropic.computer_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"computer",type:"computer_20241022",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.text_editor_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_editor",type:"text_editor_20250124",cache_control:void 0});break}case"anthropic.text_editor_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"str_replace_editor",type:"text_editor_20241022",cache_control:void 0});break}case"anthropic.text_editor_20250429":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429",cache_control:void 0});break}case"anthropic.text_editor_20250728":{let B=await GG({value:S.args,schema:XQ});R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:B.maxCharacters,cache_control:void 0});break}case"anthropic.bash_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"bash",type:"bash_20250124",cache_control:void 0});break}case"anthropic.bash_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"bash",type:"bash_20241022",cache_control:void 0});break}case"anthropic.memory_20250818":{N.add("context-management-2025-06-27"),R.push({name:"memory",type:"memory_20250818"});break}case"anthropic.web_fetch_20250910":{N.add("web-fetch-2025-09-10");let B=await GG({value:S.args,schema:SQ});R.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:jQ});R.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_search_20250305":{let B=await GG({value:S.args,schema:KQ});R.push({type:"web_search_20250305",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:zQ});R.push({type:"web_search_20260209",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.tool_search_regex_20251119":{R.push({type:"tool_search_tool_regex_20251119",name:"tool_search_tool_regex"});break}case"anthropic.tool_search_bm25_20251119":{R.push({type:"tool_search_tool_bm25_20251119",name:"tool_search_tool_bm25"});break}default:{w.push({type:"unsupported",feature:`provider-defined tool ${S.id}`});break}}break}default:{w.push({type:"unsupported",feature:`tool ${S}`});break}}if(H==null)return{tools:R,toolChoice:Z?{type:"auto",disable_parallel_tool_use:Z}:void 0,toolWarnings:w,betas:N};let a=H.type;switch(a){case"auto":return{tools:R,toolChoice:{type:"auto",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"required":return{tools:R,toolChoice:{type:"any",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};case"tool":return{tools:R,toolChoice:{type:"tool",name:H.toolName,disable_parallel_tool_use:Z},toolWarnings:w,betas:N};default:throw new HG({functionality:`tool choice type: ${a}`})}}function fG({usage:Q,rawUsage:H}){var Z,q;let E=(Z=Q.cache_creation_input_tokens)!=null?Z:0,T=(q=Q.cache_read_input_tokens)!=null?q:0,b,F;if(Q.iterations&&Q.iterations.length>0){let h=Q.iterations.reduce((w,N)=>({input:w.input+N.input_tokens,output:w.output+N.output_tokens}),{input:0,output:0});b=h.input,F=h.output}else b=Q.input_tokens,F=Q.output_tokens;return{inputTokens:{total:b+E+T,noCache:b,cacheRead:T,cacheWrite:E},outputTokens:{total:F,text:void 0,reasoning:void 0},raw:H!=null?H:Q}}var iG=J(()=>W(G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}))),fQ=J(()=>W(G.object({code:G.string()}))),BQ=l({id:"anthropic.code_execution_20250522",inputSchema:fQ,outputSchema:iG}),IQ=(Q={})=>{return BQ(Q)},lG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),wQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),NQ=l({id:"anthropic.code_execution_20250825",inputSchema:wQ,outputSchema:lG,supportsDeferredResults:!0}),MQ=(Q={})=>{return NQ(Q)},sG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),CQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),bQ=l({id:"anthropic.code_execution_20260120",inputSchema:CQ,outputSchema:sG,supportsDeferredResults:!0}),TQ=(Q={})=>{return bQ(Q)},pG=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),OQ=J(()=>W(G.object({pattern:G.string(),limit:G.number().optional()}))),kQ=l({id:"anthropic.tool_search_regex_20251119",inputSchema:OQ,outputSchema:pG,supportsDeferredResults:!0}),vQ=(Q={})=>{return kQ(Q)};function _Q(Q){if(typeof Q==="string")return new TextDecoder().decode(TG(Q));if(Q instanceof Uint8Array)return new TextDecoder().decode(Q);if(Q instanceof URL)throw new HG({functionality:"URL-based text documents are not supported for citations"});throw new HG({functionality:`unsupported data type for text documents: ${typeof Q}`})}function KG(Q){return Q instanceof URL||hQ(Q)}function hQ(Q){return typeof Q==="string"&&/^https?:\/\//i.test(Q)}function DG(Q){return Q instanceof URL?Q.toString():Q}async function gQ({prompt:Q,sendReasoning:H,warnings:Z,cacheControlValidator:q,toolNameMapping:E}){var T,b,F,h,w,N,c,R,a,S,B,g,m,O,e,C,s,QG,YG;let Y=new Set,j=mQ(Q),M=q||new RG,p=void 0,XG=[];async function zG(v){var k,V;let ZG=await LG({provider:"anthropic",providerOptions:v,schema:FG});return(V=(k=ZG==null?void 0:ZG.citations)==null?void 0:k.enabled)!=null?V:!1}async function L(v){let k=await LG({provider:"anthropic",providerOptions:v,schema:FG});return{title:k==null?void 0:k.title,context:k==null?void 0:k.context}}for(let v=0;v<j.length;v++){let k=j[v],V=v===j.length-1,ZG=k.type;switch(ZG){case"system":{if(p!=null)throw new HG({functionality:"Multiple system messages that are separated by user/assistant messages"});p=k.messages.map(({content:I,providerOptions:o})=>({type:"text",text:I,cache_control:M.getCacheControl(o,{type:"system message",canCache:!0})}));break}case"user":{let I=[];for(let o of k.messages){let{role:t,content:r}=o;switch(t){case"user":{for(let i=0;i<r.length;i++){let x=r[i],n=i===r.length-1,z=(T=M.getCacheControl(x.providerOptions,{type:"user message part",canCache:!0}))!=null?T:n?M.getCacheControl(o.providerOptions,{type:"user message",canCache:!0}):void 0;switch(x.type){case"text":{I.push({type:"text",text:x.text,cache_control:z});break}case"file":{if(x.mediaType.startsWith("image/"))I.push({type:"image",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:x.mediaType==="image/*"?"image/jpeg":x.mediaType,data:jG(x.data)},cache_control:z});else if(x.mediaType==="application/pdf"){Y.add("pdfs-2024-09-25");let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:"application/pdf",data:jG(x.data)},title:(b=P.title)!=null?b:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else if(x.mediaType==="text/plain"){let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"text",media_type:"text/plain",data:_Q(x.data)},title:(F=P.title)!=null?F:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else throw new HG({functionality:`media type: ${x.mediaType}`});break}}}break}case"tool":{for(let i=0;i<r.length;i++){let x=r[i];if(x.type==="tool-approval-response")continue;let n=i===r.length-1,z=(h=M.getCacheControl(x.providerOptions,{type:"tool result part",canCache:!0}))!=null?h:n?M.getCacheControl(o.providerOptions,{type:"tool result message",canCache:!0}):void 0,d=x.output,P;switch(d.type){case"content":P=d.value.map((U)=>{var D;switch(U.type){case"text":return{type:"text",text:U.text};case"image-data":return{type:"image",source:{type:"base64",media_type:U.mediaType,data:U.data}};case"image-url":return{type:"image",source:{type:"url",url:U.url}};case"file-url":return{type:"document",source:{type:"url",url:U.url}};case"file-data":{if(U.mediaType==="application/pdf")return Y.add("pdfs-2024-09-25"),{type:"document",source:{type:"base64",media_type:U.mediaType,data:U.data}};Z.push({type:"other",message:`unsupported tool content part type: ${U.type} with media type: ${U.mediaType}`});return}case"custom":{let A=(D=U.providerOptions)==null?void 0:D.anthropic;if((A==null?void 0:A.type)==="tool-reference")return{type:"tool_reference",tool_name:A.toolName};Z.push({type:"other",message:"unsupported custom tool content part"});return}default:{Z.push({type:"other",message:`unsupported tool content part type: ${U.type}`});return}}}).filter(kG);break;case"text":case"error-text":P=d.value;break;case"execution-denied":P=(w=d.reason)!=null?w:"Tool execution denied.";break;case"json":case"error-json":default:P=JSON.stringify(d.value);break}I.push({type:"tool_result",tool_use_id:x.toolCallId,content:P,is_error:d.type==="error-text"||d.type==="error-json"?!0:void 0,cache_control:z})}break}default:throw Error(`Unsupported role: ${t}`)}}XG.push({role:"user",content:I});break}case"assistant":{let I=[],o=new Set;for(let t=0;t<k.messages.length;t++){let r=k.messages[t],i=t===k.messages.length-1,{content:x}=r;for(let n=0;n<x.length;n++){let z=x[n],d=n===x.length-1,P=(N=M.getCacheControl(z.providerOptions,{type:"assistant message part",canCache:!0}))!=null?N:d?M.getCacheControl(r.providerOptions,{type:"assistant message",canCache:!0}):void 0;switch(z.type){case"text":{let U=(c=z.providerOptions)==null?void 0:c.anthropic;if((U==null?void 0:U.type)==="compaction")I.push({type:"compaction",content:z.text,cache_control:P});else I.push({type:"text",text:V&&i&&d?z.text.trim():z.text,cache_control:P});break}case"reasoning":{if(H){let U=await LG({provider:"anthropic",providerOptions:z.providerOptions,schema:GQ});if(U!=null)if(U.signature!=null)M.getCacheControl(z.providerOptions,{type:"thinking block",canCache:!1}),I.push({type:"thinking",thinking:z.text,signature:U.signature});else if(U.redactedData!=null)M.getCacheControl(z.providerOptions,{type:"redacted thinking block",canCache:!1}),I.push({type:"redacted_thinking",data:U.redactedData});else Z.push({type:"other",message:"unsupported reasoning metadata"});else Z.push({type:"other",message:"unsupported reasoning metadata"})}else Z.push({type:"other",message:"sending reasoning content is disabled for this model"});break}case"tool-call":{if(z.providerExecuted){let A=E.toProviderToolName(z.toolName);if(((a=(R=z.providerOptions)==null?void 0:R.anthropic)==null?void 0:a.type)==="mcp-tool-use"){o.add(z.toolCallId);let X=(B=(S=z.providerOptions)==null?void 0:S.anthropic)==null?void 0:B.serverName;if(X==null||typeof X!=="string"){Z.push({type:"other",message:"mcp tool use server name is required and must be a string"});break}I.push({type:"mcp_tool_use",id:z.toolCallId,name:z.toolName,input:z.input,server_name:X,cache_control:P})}else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&typeof z.input.type==="string"&&(z.input.type==="bash_code_execution"||z.input.type==="text_editor_code_execution"))I.push({type:"server_tool_use",id:z.toolCallId,name:z.input.type,input:z.input,cache_control:P});else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&z.input.type==="programmatic-tool-call"){let{type:X,...f}=z.input;I.push({type:"server_tool_use",id:z.toolCallId,name:"code_execution",input:f,cache_control:P})}else if(A==="code_execution"||A==="web_fetch"||A==="web_search")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else if(A==="tool_search_tool_regex"||A==="tool_search_tool_bm25")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else Z.push({type:"other",message:`provider executed tool call for tool ${z.toolName} is not supported`});break}let U=(g=z.providerOptions)==null?void 0:g.anthropic,D=(U==null?void 0:U.caller)?(U.caller.type==="code_execution_20250825"||U.caller.type==="code_execution_20260120")&&U.caller.toolId?{type:U.caller.type,tool_id:U.caller.toolId}:U.caller.type==="direct"?{type:"direct"}:void 0:void 0;I.push({type:"tool_use",id:z.toolCallId,name:z.toolName,input:z.input,...D&&{caller:D},cache_control:P});break}case"tool-result":{let U=E.toProviderToolName(z.toolName);if(o.has(z.toolCallId)){let D=z.output;if(D.type!=="json"&&D.type!=="error-json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}I.push({type:"mcp_tool_result",tool_use_id:z.toolCallId,is_error:D.type==="error-json",content:D.value,cache_control:P})}else if(U==="code_execution"){let D=z.output;if(D.type==="error-text"||D.type==="error-json"){let A={};try{if(typeof D.value==="string")A=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)A=D.value}catch($){}if(A.type==="code_execution_tool_result_error")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:"code_execution_tool_result_error",error_code:(m=A.errorCode)!=null?m:"unknown"},cache_control:P});else I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:{type:"bash_code_execution_tool_result_error",error_code:(O=A.errorCode)!=null?O:"unknown"}});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}if(D.value==null||typeof D.value!=="object"||!("type"in D.value)||typeof D.value.type!=="string"){Z.push({type:"other",message:`provider executed tool result output value is not a valid code execution result for tool ${z.toolName}`});break}if(D.value.type==="code_execution_result"){let A=await GG({value:D.value,schema:iG});I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(e=A.content)!=null?e:[]},cache_control:P})}else if(D.value.type==="encrypted_code_execution_result"){let A=await GG({value:D.value,schema:sG});if(A.type==="encrypted_code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,encrypted_stdout:A.encrypted_stdout,stderr:A.stderr,return_code:A.return_code,content:(C=A.content)!=null?C:[]},cache_control:P})}else{let A=await GG({value:D.value,schema:lG});if(A.type==="code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(s=A.content)!=null?s:[]},cache_control:P});else if(A.type==="bash_code_execution_result"||A.type==="bash_code_execution_tool_result_error")I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A});else I.push({type:"text_editor_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A})}break}if(U==="web_fetch"){let D=z.output;if(D.type==="error-json"){let $={};try{if(typeof D.value==="string")$=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)$=D.value}catch(X){let f=(QG=D.value)==null?void 0:QG.errorCode;$={errorCode:typeof f==="string"?f:"unavailable"}}I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_tool_result_error",error_code:(YG=$.errorCode)!=null?YG:"unavailable"},cache_control:P});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:cG});I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_result",url:A.url,retrieved_at:A.retrievedAt,content:{type:"document",title:A.content.title,citations:A.content.citations,source:{type:A.content.source.type,media_type:A.content.source.mediaType,data:A.content.source.data}}},cache_control:P});break}if(U==="web_search"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:uG});I.push({type:"web_search_tool_result",tool_use_id:z.toolCallId,content:A.map(($)=>({url:$.url,title:$.title,page_age:$.pageAge,encrypted_content:$.encryptedContent,type:$.type})),cache_control:P});break}if(U==="tool_search_tool_regex"||U==="tool_search_tool_bm25"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let $=(await GG({value:D.value,schema:pG})).map((X)=>({type:"tool_reference",tool_name:X.toolName}));I.push({type:"tool_search_tool_result",tool_use_id:z.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:$},cache_control:P});break}Z.push({type:"other",message:`provider executed tool result for tool ${z.toolName} is not supported`});break}}}}XG.push({role:"assistant",content:I});break}default:throw Error(`content type: ${ZG}`)}}return{prompt:{system:p,messages:XG},betas:Y}}function mQ(Q){let H=[],Z=void 0;for(let q of Q){let{role:E}=q;switch(E){case"system":{if((Z==null?void 0:Z.type)!=="system")Z={type:"system",messages:[]},H.push(Z);Z.messages.push(q);break}case"assistant":{if((Z==null?void 0:Z.type)!=="assistant")Z={type:"assistant",messages:[]},H.push(Z);Z.messages.push(q);break}case"user":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}case"tool":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}default:throw Error(`Unsupported role: ${E}`)}}return H}function JG({finishReason:Q,isJsonResponseFromTool:H}){switch(Q){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return H?"stop":"tool-calls";case"max_tokens":case"model_context_window_exceeded":return"length";case"compaction":return"other";default:return"other"}}function BG(Q,H,Z){var q;if(Q.type==="web_search_result_location")return{type:"source",sourceType:"url",id:Z(),url:Q.url,title:Q.title,providerMetadata:{anthropic:{citedText:Q.cited_text,encryptedIndex:Q.encrypted_index}}};if(Q.type!=="page_location"&&Q.type!=="char_location")return;let E=H[Q.document_index];if(!E)return;return{type:"source",sourceType:"document",id:Z(),mediaType:E.mediaType,title:(q=Q.document_title)!=null?q:E.title,filename:E.filename,providerMetadata:{anthropic:Q.type==="page_location"?{citedText:Q.cited_text,startPageNumber:Q.start_page_number,endPageNumber:Q.end_page_number}:{citedText:Q.cited_text,startCharIndex:Q.start_char_index,endCharIndex:Q.end_char_index}}}}var dQ=class{constructor(Q,H){this.specificationVersion="v3";var Z;this.modelId=Q,this.config=H,this.generateId=(Z=H.generateId)!=null?Z:AG}supportsUrl(Q){return Q.protocol==="https:"}get provider(){return this.config.provider}get providerOptionsName(){let Q=this.config.provider,H=Q.indexOf(".");return H===-1?Q:Q.substring(0,H)}get supportedUrls(){var Q,H,Z;return(Z=(H=(Q=this.config).supportedUrls)==null?void 0:H.call(Q))!=null?Z:{}}async getArgs({userSuppliedBetas:Q,prompt:H,maxOutputTokens:Z,temperature:q,topP:E,topK:T,frequencyPenalty:b,presencePenalty:F,stopSequences:h,responseFormat:w,seed:N,tools:c,toolChoice:R,providerOptions:a,stream:S}){var B,g,m,O,e,C,s,QG,YG,Y;let j=[];if(b!=null)j.push({type:"unsupported",feature:"frequencyPenalty"});if(F!=null)j.push({type:"unsupported",feature:"presencePenalty"});if(N!=null)j.push({type:"unsupported",feature:"seed"});if(q!=null&&q>1)j.push({type:"unsupported",feature:"temperature",details:`${q} exceeds anthropic maximum of 1.0. clamped to 1.0`}),q=1;else if(q!=null&&q<0)j.push({type:"unsupported",feature:"temperature",details:`${q} is below anthropic minimum of 0. clamped to 0`}),q=0;if((w==null?void 0:w.type)==="json"){if(w.schema==null)j.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."})}let M=this.providerOptionsName,p=await LG({provider:"anthropic",providerOptions:a,schema:xG}),XG=M!=="anthropic"?await LG({provider:M,providerOptions:a,schema:xG}):null,zG=XG!=null,L=Object.assign({},p!=null?p:{},XG!=null?XG:{}),{maxOutputTokens:v,supportsStructuredOutput:k,rejectsSamplingParameters:V,isKnownModel:ZG}=uQ(this.modelId);if(V){if(q!=null)j.push({type:"unsupported",feature:"temperature",details:`temperature is not supported by ${this.modelId} and will be ignored`}),q=void 0;if(T!=null)j.push({type:"unsupported",feature:"topK",details:`topK is not supported by ${this.modelId} and will be ignored`}),T=void 0;if(E!=null)j.push({type:"unsupported",feature:"topP",details:`topP is not supported by ${this.modelId} and will be ignored`}),E=void 0}let I=ZG||this.modelId.startsWith("claude-"),o=((B=this.config.supportsNativeStructuredOutput)!=null?B:!0)&&k,t=((g=this.config.supportsStrictTools)!=null?g:!0)&&k,r=(m=L==null?void 0:L.structuredOutputMode)!=null?m:"auto",i=r==="outputFormat"||r==="auto"&&o,x=(w==null?void 0:w.type)==="json"&&w.schema!=null&&!i?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:w.schema}:void 0,n=L==null?void 0:L.contextManagement,z=new RG,d=bG({tools:c,providerToolNames:{"anthropic.code_execution_20250522":"code_execution","anthropic.code_execution_20250825":"code_execution","anthropic.code_execution_20260120":"code_execution","anthropic.computer_20241022":"computer","anthropic.computer_20250124":"computer","anthropic.text_editor_20241022":"str_replace_editor","anthropic.text_editor_20250124":"str_replace_editor","anthropic.text_editor_20250429":"str_replace_based_edit_tool","anthropic.text_editor_20250728":"str_replace_based_edit_tool","anthropic.bash_20241022":"bash","anthropic.bash_20250124":"bash","anthropic.memory_20250818":"memory","anthropic.web_search_20250305":"web_search","anthropic.web_search_20260209":"web_search","anthropic.web_fetch_20250910":"web_fetch","anthropic.web_fetch_20260209":"web_fetch","anthropic.tool_search_regex_20251119":"tool_search_tool_regex","anthropic.tool_search_bm25_20251119":"tool_search_tool_bm25"}}),{prompt:P,betas:U}=await gQ({prompt:H,sendReasoning:(O=L==null?void 0:L.sendReasoning)!=null?O:!0,warnings:j,cacheControlValidator:z,toolNameMapping:d}),D=(e=L==null?void 0:L.thinking)==null?void 0:e.type,A=D==="enabled"||D==="adaptive",$=D==="enabled"?(C=L==null?void 0:L.thinking)==null?void 0:C.budgetTokens:void 0,X=D==="adaptive"?(s=L==null?void 0:L.thinking)==null?void 0:s.display:void 0,f=Z!=null?Z:v,K={model:this.modelId,max_tokens:f,temperature:q,top_k:T,top_p:E,stop_sequences:h,...A&&{thinking:{type:D,...$!=null&&{budget_tokens:$},...X!=null&&{display:X}}},...((L==null?void 0:L.effort)||(L==null?void 0:L.taskBudget)||i&&(w==null?void 0:w.type)==="json"&&w.schema!=null)&&{output_config:{...(L==null?void 0:L.effort)&&{effort:L.effort},...(L==null?void 0:L.taskBudget)&&{task_budget:{type:L.taskBudget.type,total:L.taskBudget.total,...L.taskBudget.remaining!=null&&{remaining:L.taskBudget.remaining}}},...i&&(w==null?void 0:w.type)==="json"&&w.schema!=null&&{format:{type:"json_schema",schema:w.schema}}}},...(L==null?void 0:L.speed)&&{speed:L.speed},...(L==null?void 0:L.inferenceGeo)&&{inference_geo:L.inferenceGeo},...(L==null?void 0:L.cacheControl)&&{cache_control:L.cacheControl},...((QG=L==null?void 0:L.metadata)==null?void 0:QG.userId)!=null&&{metadata:{user_id:L.metadata.userId}},...(L==null?void 0:L.mcpServers)&&L.mcpServers.length>0&&{mcp_servers:L.mcpServers.map((y)=>({type:y.type,name:y.name,url:y.url,authorization_token:y.authorizationToken,tool_configuration:y.toolConfiguration?{allowed_tools:y.toolConfiguration.allowedTools,enabled:y.toolConfiguration.enabled}:void 0}))},...(L==null?void 0:L.container)&&{container:L.container.skills&&L.container.skills.length>0?{id:L.container.id,skills:L.container.skills.map((y)=>({type:y.type,skill_id:y.skillId,version:y.version}))}:L.container.id},system:P.system,messages:P.messages,...n&&{context_management:{edits:n.edits.map((y)=>{let SG=y.type;switch(SG){case"clear_tool_uses_20250919":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.keep!==void 0&&{keep:y.keep},...y.clearAtLeast!==void 0&&{clear_at_least:y.clearAtLeast},...y.clearToolInputs!==void 0&&{clear_tool_inputs:y.clearToolInputs},...y.excludeTools!==void 0&&{exclude_tools:y.excludeTools}};case"clear_thinking_20251015":return{type:y.type,...y.keep!==void 0&&{keep:y.keep}};case"compact_20260112":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.pauseAfterCompaction!==void 0&&{pause_after_compaction:y.pauseAfterCompaction},...y.instructions!==void 0&&{instructions:y.instructions}};default:j.push({type:"other",message:`Unknown context management strategy: ${SG}`});return}}).filter((y)=>y!==void 0)}}};if(A){if(D==="enabled"&&$==null)j.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),K.thinking={type:"enabled",budget_tokens:1024},$=1024;if(K.temperature!=null)K.temperature=void 0,j.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"});if(T!=null)K.top_k=void 0,j.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"});if(E!=null)K.top_p=void 0,j.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"});K.max_tokens=f+($!=null?$:0)}else if(I&&E!=null&&q!=null)j.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),K.top_p=void 0;if(ZG&&K.max_tokens>v){if(Z!=null)j.push({type:"unsupported",feature:"maxOutputTokens",details:`${K.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${v} max output tokens. The max output tokens have been limited to ${v}.`});K.max_tokens=v}if((L==null?void 0:L.mcpServers)&&L.mcpServers.length>0)U.add("mcp-client-2025-04-04");if(n){if(U.add("context-management-2025-06-27"),n.edits.some((y)=>y.type==="compact_20260112"))U.add("compact-2026-01-12")}if((L==null?void 0:L.container)&&L.container.skills&&L.container.skills.length>0){if(U.add("code-execution-2025-08-25"),U.add("skills-2025-10-02"),U.add("files-api-2025-04-14"),!(c==null?void 0:c.some((y)=>y.type==="provider"&&(y.id==="anthropic.code_execution_20250825"||y.id==="anthropic.code_execution_20260120"))))j.push({type:"other",message:"code execution tool is required when using skills"})}if(L==null?void 0:L.effort)U.add("effort-2025-11-24");if(L==null?void 0:L.taskBudget)U.add("task-budgets-2026-03-13");if((L==null?void 0:L.speed)==="fast")U.add("fast-mode-2026-02-01");let _=S&&((YG=L==null?void 0:L.toolStreaming)!=null?YG:!0),{tools:$G,toolChoice:EG,toolWarnings:qG,betas:nG}=await PQ(x!=null?{tools:[...c!=null?c:[],x],toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:z,supportsStructuredOutput:!1,supportsStrictTools:t,defaultEagerInputStreaming:_}:{tools:c!=null?c:[],toolChoice:R,disableParallelToolUse:L==null?void 0:L.disableParallelToolUse,cacheControlValidator:z,supportsStructuredOutput:o,supportsStrictTools:t,defaultEagerInputStreaming:_}),rG=z.getWarnings();return{args:{...K,tools:$G,tool_choice:EG,stream:S===!0?!0:void 0},warnings:[...j,...qG,...rG],betas:new Set([...U,...nG,...Q,...(Y=L==null?void 0:L.anthropicBeta)!=null?Y:[]]),usesJsonResponseTool:x!=null,toolNameMapping:d,providerOptionsName:M,usedCustomProviderKey:zG}}async getHeaders({betas:Q,headers:H}){return CG(await UG(this.config.headers),H,Q.size>0?{"anthropic-beta":Array.from(Q).join(",")}:{})}async getBetasFromHeaders(Q){var H,Z;let E=(H=(await UG(this.config.headers))["anthropic-beta"])!=null?H:"",T=(Z=Q==null?void 0:Q["anthropic-beta"])!=null?Z:"";return new Set([...E.toLowerCase().split(","),...T.toLowerCase().split(",")].map((b)=>b.trim()).filter((b)=>b!==""))}buildRequestUrl(Q){var H,Z,q;return(q=(Z=(H=this.config).buildRequestUrl)==null?void 0:Z.call(H,this.config.baseURL,Q))!=null?q:`${this.config.baseURL}/messages`}transformRequestBody(Q,H){var Z,q,E;return(E=(q=(Z=this.config).transformRequestBody)==null?void 0:q.call(Z,Q,H))!=null?E:Q}extractCitationDocuments(Q){let H=(Z)=>{var q,E;if(Z.type!=="file")return!1;if(Z.mediaType!=="application/pdf"&&Z.mediaType!=="text/plain")return!1;let T=(q=Z.providerOptions)==null?void 0:q.anthropic,b=T==null?void 0:T.citations;return(E=b==null?void 0:b.enabled)!=null?E:!1};return Q.filter((Z)=>Z.role==="user").flatMap((Z)=>Z.content).filter(H).map((Z)=>{var q;let E=Z;return{title:(q=E.filename)!=null?q:"Untitled Document",filename:E.filename,mediaType:E.mediaType}})}async doGenerate(Q){var H,Z,q,E,T,b,F;let{args:h,warnings:w,betas:N,usesJsonResponseTool:c,toolNameMapping:R,providerOptionsName:a,usedCustomProviderKey:S}=await this.getArgs({...Q,stream:!1,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),B=[...this.extractCitationDocuments(Q.prompt)],g=IG(h.tools),{responseHeaders:m,value:O,rawValue:e}=await VG({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:N,headers:Q.headers}),body:this.transformRequestBody(h,N),failedResponseHandler:yG,successfulResponseHandler:mG(oG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),C=[],s={},QG={},YG=!1;for(let Y of O.content)switch(Y.type){case"text":{if(!c){if(C.push({type:"text",text:Y.text}),Y.citations)for(let j of Y.citations){let M=BG(j,B,this.generateId);if(M)C.push(M)}}break}case"thinking":{C.push({type:"reasoning",text:Y.thinking,providerMetadata:{anthropic:{signature:Y.signature}}});break}case"redacted_thinking":{C.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:Y.data}}});break}case"compaction":{C.push({type:"text",text:Y.content,providerMetadata:{anthropic:{type:"compaction"}}});break}case"tool_use":{if(c&&Y.name==="json")YG=!0,C.push({type:"text",text:JSON.stringify(Y.input)});else{let M=Y.caller,p=M?{type:M.type,toolId:"tool_id"in M?M.tool_id:void 0}:void 0;C.push({type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),...p&&{providerMetadata:{anthropic:{caller:p}}}})}break}case"server_tool_use":{if(Y.name==="text_editor_code_execution"||Y.name==="bash_code_execution")C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName("code_execution"),input:JSON.stringify({type:Y.name,...Y.input}),providerExecuted:!0});else if(Y.name==="web_search"||Y.name==="code_execution"||Y.name==="web_fetch"){let j=Y.name==="code_execution"&&Y.input!=null&&typeof Y.input==="object"&&"code"in Y.input&&!("type"in Y.input)?{type:"programmatic-tool-call",...Y.input}:Y.input;C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(j),providerExecuted:!0,...g&&Y.name==="code_execution"?{dynamic:!0}:{}})}else if(Y.name==="tool_search_tool_regex"||Y.name==="tool_search_tool_bm25")QG[Y.id]=Y.name,C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(Y.input),providerExecuted:!0});break}case"mcp_tool_use":{s[Y.id]={type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:Y.server_name}}},C.push(s[Y.id]);break}case"mcp_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:s[Y.tool_use_id].toolName,isError:Y.is_error,result:Y.content,dynamic:!0,providerMetadata:s[Y.tool_use_id].providerMetadata});break}case"web_fetch_tool_result":{if(Y.content.type==="web_fetch_result")B.push({title:(H=Y.content.content.title)!=null?H:Y.content.url,mediaType:Y.content.content.source.media_type}),C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:Y.content.url,retrievedAt:Y.content.retrieved_at,content:{type:Y.content.content.type,title:Y.content.content.title,citations:Y.content.content.citations,source:{type:Y.content.content.source.type,mediaType:Y.content.content.source.media_type,data:Y.content.content.source.data}}}});else if(Y.content.type==="web_fetch_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:Y.content.error_code}});break}case"web_search_tool_result":{if(Array.isArray(Y.content)){C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),result:Y.content.map((j)=>{var M;return{url:j.url,title:j.title,pageAge:(M=j.page_age)!=null?M:null,encryptedContent:j.encrypted_content,type:j.type}})});for(let j of Y.content)C.push({type:"source",sourceType:"url",id:this.generateId(),url:j.url,title:j.title,providerMetadata:{anthropic:{pageAge:(Z=j.page_age)!=null?Z:null}}})}else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:Y.content.error_code}});break}case"code_execution_tool_result":{if(Y.content.type==="code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,stdout:Y.content.stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(q=Y.content.content)!=null?q:[]}});else if(Y.content.type==="encrypted_code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,encrypted_stdout:Y.content.encrypted_stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(E=Y.content.content)!=null?E:[]}});else if(Y.content.type==="code_execution_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:Y.content.error_code}});break}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:Y.content});break}case"tool_search_tool_result":{let j=QG[Y.tool_use_id];if(j==null){let M=R.toCustomToolName("tool_search_tool_bm25"),p=R.toCustomToolName("tool_search_tool_regex");if(M!=="tool_search_tool_bm25")j="tool_search_tool_bm25";else if(p!=="tool_search_tool_regex")j="tool_search_tool_regex";else j="tool_search_tool_regex"}if(Y.content.type==="tool_search_tool_search_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),result:Y.content.tool_references.map((M)=>({type:M.type,toolName:M.tool_name}))});else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:Y.content.error_code}});break}}return{content:C,finishReason:{unified:JG({finishReason:O.stop_reason,isJsonResponseFromTool:YG}),raw:(T=O.stop_reason)!=null?T:void 0},usage:fG({usage:O.usage}),request:{body:h},response:{id:(b=O.id)!=null?b:void 0,modelId:(F=O.model)!=null?F:void 0,headers:m,body:e},warnings:w,providerMetadata:(()=>{var Y,j,M,p,XG;let zG={usage:O.usage,cacheCreationInputTokens:(Y=O.usage.cache_creation_input_tokens)!=null?Y:null,stopSequence:(j=O.stop_sequence)!=null?j:null,iterations:O.usage.iterations?O.usage.iterations.map((v)=>({type:v.type,inputTokens:v.input_tokens,outputTokens:v.output_tokens})):null,container:O.container?{expiresAt:O.container.expires_at,id:O.container.id,skills:(p=(M=O.container.skills)==null?void 0:M.map((v)=>({type:v.type,skillId:v.skill_id,version:v.version})))!=null?p:null}:null,contextManagement:(XG=wG(O.context_management))!=null?XG:null},L={anthropic:zG};if(S&&a!=="anthropic")L[a]=zG;return L})()}}async doStream(Q){var H,Z;let{args:q,warnings:E,betas:T,usesJsonResponseTool:b,toolNameMapping:F,providerOptionsName:h,usedCustomProviderKey:w}=await this.getArgs({...Q,stream:!0,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),N=[...this.extractCitationDocuments(Q.prompt)],c=IG(q.tools),R=this.buildRequestUrl(!0),{responseHeaders:a,value:S}=await VG({url:R,headers:await this.getHeaders({betas:T,headers:Q.headers}),body:this.transformRequestBody(q,T),failedResponseHandler:yG,successfulResponseHandler:gG(tG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),B={unified:"other",raw:void 0},g={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},m={},O={},e={},C=null,s=void 0,QG=null,YG=null,Y=null,j=!1,M=void 0,p=this.generateId,XG=S.pipeThrough(new TransformStream({start(k){k.enqueue({type:"stream-start",warnings:E})},transform(k,V){var ZG,I,o,t,r,i,x,n,z,d,P,U,D,A;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:k.rawValue});if(!k.success){V.enqueue({type:"error",error:k.error});return}let $=k.value;switch($.type){case"ping":return;case"content_block_start":{let X=$.content_block,f=X.type;switch(M=f,f){case"text":{if(b)return;m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});return}case"thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index)});return}case"redacted_thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index),providerMetadata:{anthropic:{redactedData:X.data}}});return}case"compaction":{m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index),providerMetadata:{anthropic:{type:"compaction"}}});return}case"tool_use":{if(b&&X.name==="json")j=!0,m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});else{let _=X.caller,$G=_?{type:_.type,toolId:"tool_id"in _?_.tool_id:void 0}:void 0,qG=X.input&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:qG,firstDelta:qG.length===0,...$G&&{caller:$G}},V.enqueue({type:"tool-input-start",id:X.id,toolName:X.name})}return}case"server_tool_use":{if(["web_fetch","web_search","code_execution","text_editor_code_execution","bash_code_execution"].includes(X.name)){let K=X.name==="text_editor_code_execution"||X.name==="bash_code_execution"?"code_execution":X.name,_=F.toCustomToolName(K),$G=X.input!=null&&typeof X.input==="object"&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:_,input:$G,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{},firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:_,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{}})}else if(X.name==="tool_search_tool_regex"||X.name==="tool_search_tool_bm25"){e[X.id]=X.name;let K=F.toCustomToolName(X.name);m[$.index]={type:"tool-call",toolCallId:X.id,toolName:K,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:K,providerExecuted:!0})}return}case"web_fetch_tool_result":{if(X.content.type==="web_fetch_result")N.push({title:(ZG=X.content.content.title)!=null?ZG:X.content.url,mediaType:X.content.content.source.media_type}),V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:X.content.url,retrievedAt:X.content.retrieved_at,content:{type:X.content.content.type,title:X.content.content.title,citations:X.content.content.citations,source:{type:X.content.content.source.type,mediaType:X.content.content.source.media_type,data:X.content.content.source.data}}}});else if(X.content.type==="web_fetch_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:X.content.error_code}});return}case"web_search_tool_result":{if(Array.isArray(X.content)){V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),result:X.content.map((K)=>{var _;return{url:K.url,title:K.title,pageAge:(_=K.page_age)!=null?_:null,encryptedContent:K.encrypted_content,type:K.type}})});for(let K of X.content)V.enqueue({type:"source",sourceType:"url",id:p(),url:K.url,title:K.title,providerMetadata:{anthropic:{pageAge:(I=K.page_age)!=null?I:null}}})}else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:X.content.error_code}});return}case"code_execution_tool_result":{if(X.content.type==="code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,stdout:X.content.stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(o=X.content.content)!=null?o:[]}});else if(X.content.type==="encrypted_code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,encrypted_stdout:X.content.encrypted_stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(t=X.content.content)!=null?t:[]}});else if(X.content.type==="code_execution_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:X.content.error_code}});return}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:X.content});return}case"tool_search_tool_result":{let K=e[X.tool_use_id];if(K==null){let _=F.toCustomToolName("tool_search_tool_bm25"),$G=F.toCustomToolName("tool_search_tool_regex");if(_!=="tool_search_tool_bm25")K="tool_search_tool_bm25";else if($G!=="tool_search_tool_regex")K="tool_search_tool_regex";else K="tool_search_tool_regex"}if(X.content.type==="tool_search_tool_search_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),result:X.content.tool_references.map((_)=>({type:_.type,toolName:_.tool_name}))});else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:X.content.error_code}});return}case"mcp_tool_use":{O[X.id]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:JSON.stringify(X.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:X.server_name}}},V.enqueue(O[X.id]);return}case"mcp_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:O[X.tool_use_id].toolName,isError:X.is_error,result:X.content,dynamic:!0,providerMetadata:O[X.tool_use_id].providerMetadata});return}default:throw Error(`Unsupported content block type: ${f}`)}}case"content_block_stop":{if(m[$.index]!=null){let X=m[$.index];switch(X.type){case"text":{V.enqueue({type:"text-end",id:String($.index)});break}case"reasoning":{V.enqueue({type:"reasoning-end",id:String($.index)});break}case"tool-call":if(!(b&&X.toolName==="json")){V.enqueue({type:"tool-input-end",id:X.toolCallId});let K=X.input===""?"{}":X.input;if(X.providerToolName==="code_execution")try{let _=JSON.parse(K);if(_!=null&&typeof _==="object"&&"code"in _&&!("type"in _))K=JSON.stringify({type:"programmatic-tool-call",..._})}catch(_){}V.enqueue({type:"tool-call",toolCallId:X.toolCallId,toolName:X.toolName,input:K,providerExecuted:X.providerExecuted,...c&&X.providerToolName==="code_execution"?{dynamic:!0}:{},...X.caller&&{providerMetadata:{anthropic:{caller:X.caller}}}})}break}delete m[$.index]}M=void 0;return}case"content_block_delta":{let X=$.delta.type;switch(X){case"text_delta":{if(b)return;V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.text});return}case"thinking_delta":{V.enqueue({type:"reasoning-delta",id:String($.index),delta:$.delta.thinking});return}case"signature_delta":{if(M==="thinking")V.enqueue({type:"reasoning-delta",id:String($.index),delta:"",providerMetadata:{anthropic:{signature:$.delta.signature}}});return}case"compaction_delta":{if($.delta.content!=null)V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.content});return}case"input_json_delta":{let f=m[$.index],K=$.delta.partial_json;if(K.length===0)return;if(j){if((f==null?void 0:f.type)!=="text")return;V.enqueue({type:"text-delta",id:String($.index),delta:K})}else{if((f==null?void 0:f.type)!=="tool-call")return;if(f.firstDelta&&(f.providerToolName==="bash_code_execution"||f.providerToolName==="text_editor_code_execution"))K=`{"type": "${f.providerToolName}",${K.substring(1)}`;V.enqueue({type:"tool-input-delta",id:f.toolCallId,delta:K}),f.input+=K,f.firstDelta=!1}return}case"citations_delta":{let f=$.delta.citation,K=BG(f,N,p);if(K)V.enqueue(K);return}default:throw Error(`Unsupported delta type: ${X}`)}}case"message_start":{if(g.input_tokens=$.message.usage.input_tokens,g.cache_read_input_tokens=(r=$.message.usage.cache_read_input_tokens)!=null?r:0,g.cache_creation_input_tokens=(i=$.message.usage.cache_creation_input_tokens)!=null?i:0,s={...$.message.usage},QG=(x=$.message.usage.cache_creation_input_tokens)!=null?x:null,$.message.container!=null)Y={expiresAt:$.message.container.expires_at,id:$.message.container.id,skills:null};if($.message.stop_reason!=null)B={unified:JG({finishReason:$.message.stop_reason,isJsonResponseFromTool:j}),raw:$.message.stop_reason};if(V.enqueue({type:"response-metadata",id:(n=$.message.id)!=null?n:void 0,modelId:(z=$.message.model)!=null?z:void 0}),$.message.content!=null)for(let X=0;X<$.message.content.length;X++){let f=$.message.content[X];if(f.type==="tool_use"){let K=f.caller,_=K?{type:K.type,toolId:"tool_id"in K?K.tool_id:void 0}:void 0;V.enqueue({type:"tool-input-start",id:f.id,toolName:f.name});let $G=JSON.stringify((d=f.input)!=null?d:{});V.enqueue({type:"tool-input-delta",id:f.id,delta:$G}),V.enqueue({type:"tool-input-end",id:f.id}),V.enqueue({type:"tool-call",toolCallId:f.id,toolName:f.name,input:$G,..._&&{providerMetadata:{anthropic:{caller:_}}}})}}return}case"message_delta":{if($.usage.input_tokens!=null&&g.input_tokens!==$.usage.input_tokens)g.input_tokens=$.usage.input_tokens;if(g.output_tokens=$.usage.output_tokens,$.usage.cache_read_input_tokens!=null)g.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.cache_creation_input_tokens!=null)g.cache_creation_input_tokens=$.usage.cache_creation_input_tokens,QG=$.usage.cache_creation_input_tokens;if($.usage.iterations!=null)g.iterations=$.usage.iterations;if(B={unified:JG({finishReason:$.delta.stop_reason,isJsonResponseFromTool:j}),raw:(P=$.delta.stop_reason)!=null?P:void 0},YG=(U=$.delta.stop_sequence)!=null?U:null,Y=$.delta.container!=null?{expiresAt:$.delta.container.expires_at,id:$.delta.container.id,skills:(A=(D=$.delta.container.skills)==null?void 0:D.map((X)=>({type:X.type,skillId:X.skill_id,version:X.version})))!=null?A:null}:null,$.context_management)C=wG($.context_management);s={...s,...$.usage};return}case"message_stop":{let X={usage:s!=null?s:null,cacheCreationInputTokens:QG,stopSequence:YG,iterations:g.iterations?g.iterations.map((K)=>({type:K.type,inputTokens:K.input_tokens,outputTokens:K.output_tokens})):null,container:Y,contextManagement:C},f={anthropic:X};if(w&&h!=="anthropic")f[h]=X;V.enqueue({type:"finish",finishReason:B,usage:fG({usage:g,rawUsage:s}),providerMetadata:f});return}case"error":{V.enqueue({type:"error",error:$.error});return}default:throw Error(`Unsupported chunk type: ${$}`)}}})),[zG,L]=XG.tee(),v=zG.getReader();try{await v.read();let k=await v.read();if(((H=k.value)==null?void 0:H.type)==="raw")k=await v.read();if(((Z=k.value)==null?void 0:Z.type)==="error"){let V=k.value.error;throw new NG({message:V.message,url:R,requestBodyValues:q,statusCode:V.type==="overloaded_error"?529:500,responseHeaders:a,responseBody:JSON.stringify(V),isRetryable:V.type==="overloaded_error"})}}finally{v.cancel().catch(()=>{}),v.releaseLock()}return{stream:L,request:{body:q},response:{headers:a}}}};function uQ(Q){if(Q.includes("claude-opus-4-7"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!0,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-6")||Q.includes("claude-opus-4-6"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-5")||Q.includes("claude-opus-4-5")||Q.includes("claude-haiku-4-5"))return{maxOutputTokens:64000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-1"))return{maxOutputTokens:32000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-"))return{maxOutputTokens:64000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-"))return{maxOutputTokens:32000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-3-haiku"))return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!1}}function IG(Q){if(!Q)return!1;let H=!1,Z=!1;for(let q of Q){if("type"in q&&(q.type==="web_fetch_20260209"||q.type==="web_search_20260209")){H=!0;continue}if(q.name==="code_execution"){Z=!0;break}}return H&&!Z}function wG(Q){return Q?{appliedEdits:Q.applied_edits.map((H)=>{switch(H.type){case"clear_tool_uses_20250919":return{type:H.type,clearedToolUses:H.cleared_tool_uses,clearedInputTokens:H.cleared_input_tokens};case"clear_thinking_20251015":return{type:H.type,clearedThinkingTurns:H.cleared_thinking_turns,clearedInputTokens:H.cleared_input_tokens};case"compact_20260112":return{type:H.type}}}).filter((H)=>H!==void 0)}:null}var cQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),iQ=u({id:"anthropic.bash_20241022",inputSchema:cQ}),lQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),sQ=u({id:"anthropic.bash_20250124",inputSchema:lQ}),pQ=J(()=>W(G.object({action:G.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:G.array(G.number().int()).optional(),text:G.string().optional()}))),nQ=u({id:"anthropic.computer_20241022",inputSchema:pQ}),rQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),aQ=u({id:"anthropic.computer_20250124",inputSchema:rQ}),eQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot","zoom"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),region:G.tuple([G.number().int(),G.number().int(),G.number().int(),G.number().int()]).optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),oQ=u({id:"anthropic.computer_20251124",inputSchema:eQ}),tQ=J(()=>W(G.discriminatedUnion("command",[G.object({command:G.literal("view"),path:G.string(),view_range:G.tuple([G.number(),G.number()]).optional()}),G.object({command:G.literal("create"),path:G.string(),file_text:G.string()}),G.object({command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()}),G.object({command:G.literal("insert"),path:G.string(),insert_line:G.number(),insert_text:G.string()}),G.object({command:G.literal("delete"),path:G.string()}),G.object({command:G.literal("rename"),old_path:G.string(),new_path:G.string()})]))),GX=u({id:"anthropic.memory_20250818",inputSchema:tQ}),QX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),XX=u({id:"anthropic.text_editor_20241022",inputSchema:QX}),YX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZX=u({id:"anthropic.text_editor_20250124",inputSchema:YX}),$X=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),zX=u({id:"anthropic.text_editor_20250429",inputSchema:$X}),LX=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),HX=J(()=>W(G.object({query:G.string(),limit:G.number().optional()}))),qX=l({id:"anthropic.tool_search_bm25_20251119",inputSchema:HX,outputSchema:LX,supportsDeferredResults:!0}),AX=(Q={})=>{return qX(Q)},KX={bash_20241022:iQ,bash_20250124:sQ,codeExecution_20250522:IQ,codeExecution_20250825:MQ,codeExecution_20260120:TQ,computer_20241022:nQ,computer_20250124:aQ,computer_20251124:oQ,memory_20250818:GX,textEditor_20241022:XX,textEditor_20250124:ZX,textEditor_20250429:zX,textEditor_20250728:$Q,webFetch_20250910:xQ,webFetch_20260209:EQ,webSearch_20250305:WQ,webSearch_20260209:AQ,toolSearchRegex_20251119:vQ,toolSearchBm25_20251119:AX};function DX(Q={}){var H,Z;let q=(H=dG(_G({settingValue:Q.baseURL,environmentVariableName:"ANTHROPIC_BASE_URL"})))!=null?H:"https://api.anthropic.com/v1",E=(Z=Q.name)!=null?Z:"anthropic.messages";if(Q.apiKey&&Q.authToken)throw new MG({argument:"apiKey/authToken",message:"Both apiKey and authToken were provided. Please use only one authentication method."});let T=()=>{let h=Q.authToken?{Authorization:`Bearer ${Q.authToken}`}:{"x-api-key":vG({apiKey:Q.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"})};return OG({"anthropic-version":"2023-06-01",...h,...Q.headers},`ai-sdk/anthropic/${aG}`)},b=(h)=>{var w;return new dQ(h,{provider:E,baseURL:q,headers:T,fetch:Q.fetch,generateId:(w=Q.generateId)!=null?w:AG,supportedUrls:()=>({"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]})})},F=function(h){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return b(h)};return F.specificationVersion="v3",F.languageModel=b,F.chat=b,F.messages=b,F.embeddingModel=(h)=>{throw new WG({modelId:h,modelType:"embeddingModel"})},F.textEmbeddingModel=F.embeddingModel,F.imageModel=(h)=>{throw new WG({modelId:h,modelType:"imageModel"})},F.tools=KX,F}var KY=DX();function DY({steps:Q}){var H,Z,q;for(let E=Q.length-1;E>=0;E--){let T=(q=(Z=(H=Q[E].providerMetadata)==null?void 0:H.anthropic)==null?void 0:Z.container)==null?void 0:q.id;if(T)return{providerOptions:{anthropic:{container:{id:T}}}}}return}export{DY as forwardAnthropicContainerIdFromLastStep,DX as createAnthropic,KY as anthropic,aG as VERSION};
|
|
2
|
+
import{Fq as AG,Kq as OG,Mq as kG,Oq as vG,Pq as _G,Sq as J,Vq as W,Wq as GG,ar as LG,br as VG,fr as u,gr as l,hr as UG,ir as hG,jr as gG,kr as mG,or as dG,pq as CG,qq as bG,uq as TG,wq as jG}from"./chunk-yq3m8190.js";import{Ar as WG,Dr as HG,rr as NG,ur as MG}from"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import{qv as G}from"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-aztre27e.js";var aG="3.0.71",eG=J(()=>W(G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}))),yG=hG({errorSchema:eG,errorToMessage:(Q)=>Q.error.message}),oG=J(()=>W(G.object({type:G.literal("message"),id:G.string().nullish(),model:G.string().nullish(),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string(),citations:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])).optional()}),G.object({type:G.literal("thinking"),thinking:G.string(),signature:G.string()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])),stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish(),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}))),tG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("message_start"),message:G.object({id:G.string().nullish(),model:G.string().nullish(),role:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish()}),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()})])).nullish(),stop_reason:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string()}).nullish()})}),G.object({type:G.literal("content_block_start"),index:G.number(),content_block:G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string()}),G.object({type:G.literal("thinking"),thinking:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).optional(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string().nullish()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])}),G.object({type:G.literal("content_block_delta"),index:G.number(),delta:G.discriminatedUnion("type",[G.object({type:G.literal("input_json_delta"),partial_json:G.string()}),G.object({type:G.literal("text_delta"),text:G.string()}),G.object({type:G.literal("thinking_delta"),thinking:G.string()}),G.object({type:G.literal("signature_delta"),signature:G.string()}),G.object({type:G.literal("compaction_delta"),content:G.string().nullish()}),G.object({type:G.literal("citations_delta"),citation:G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])})])}),G.object({type:G.literal("content_block_stop"),index:G.number()}),G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}),G.object({type:G.literal("message_delta"),delta:G.object({stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish()}),usage:G.looseObject({input_tokens:G.number().nullish(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}),G.object({type:G.literal("message_stop")}),G.object({type:G.literal("ping")})]))),GQ=J(()=>W(G.object({signature:G.string().optional(),redactedData:G.string().optional()}))),FG=G.object({citations:G.object({enabled:G.boolean()}).optional(),title:G.string().optional(),context:G.string().optional()}),xG=G.object({sendReasoning:G.boolean().optional(),structuredOutputMode:G.enum(["outputFormat","jsonTool","auto"]).optional(),thinking:G.discriminatedUnion("type",[G.object({type:G.literal("adaptive"),display:G.enum(["omitted","summarized"]).optional()}),G.object({type:G.literal("enabled"),budgetTokens:G.number().optional()}),G.object({type:G.literal("disabled")})]).optional(),disableParallelToolUse:G.boolean().optional(),cacheControl:G.object({type:G.literal("ephemeral"),ttl:G.union([G.literal("5m"),G.literal("1h")]).optional()}).optional(),metadata:G.object({userId:G.string().optional()}).optional(),mcpServers:G.array(G.object({type:G.literal("url"),name:G.string(),url:G.string(),authorizationToken:G.string().nullish(),toolConfiguration:G.object({enabled:G.boolean().nullish(),allowedTools:G.array(G.string()).nullish()}).nullish()})).optional(),container:G.object({id:G.string().optional(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skillId:G.string(),version:G.string().optional()})).optional()}).optional(),toolStreaming:G.boolean().optional(),effort:G.enum(["low","medium","high","xhigh","max"]).optional(),taskBudget:G.object({type:G.literal("tokens"),total:G.number().int().min(20000),remaining:G.number().int().min(0).optional()}).optional(),speed:G.enum(["fast","standard"]).optional(),inferenceGeo:G.enum(["us","global"]).optional(),anthropicBeta:G.array(G.string()).optional(),contextManagement:G.object({edits:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("clear_tool_uses_20250919"),trigger:G.discriminatedUnion("type",[G.object({type:G.literal("input_tokens"),value:G.number()}),G.object({type:G.literal("tool_uses"),value:G.number()})]).optional(),keep:G.object({type:G.literal("tool_uses"),value:G.number()}).optional(),clearAtLeast:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),clearToolInputs:G.boolean().optional(),excludeTools:G.array(G.string()).optional()}),G.object({type:G.literal("clear_thinking_20251015"),keep:G.union([G.literal("all"),G.object({type:G.literal("thinking_turns"),value:G.number()})]).optional()}),G.object({type:G.literal("compact_20260112"),trigger:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),pauseAfterCompaction:G.boolean().optional(),instructions:G.string().optional()})]))}).optional()}),PG=4;function QQ(Q){var H;let Z=Q==null?void 0:Q.anthropic;return(H=Z==null?void 0:Z.cacheControl)!=null?H:Z==null?void 0:Z.cache_control}var RG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(Q,H){let Z=QQ(Q);if(!Z)return;if(!H.canCache){this.warnings.push({type:"unsupported",feature:"cache_control on non-cacheable context",details:`cache_control cannot be set on ${H.type}. It will be ignored.`});return}if(this.breakpointCount++,this.breakpointCount>PG){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:`Maximum ${PG} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`});return}return Z}getWarnings(){return this.warnings}},XQ=J(()=>W(G.object({maxCharacters:G.number().optional()}))),YQ=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZQ=u({id:"anthropic.text_editor_20250728",inputSchema:YQ}),$Q=(Q={})=>{return ZQ(Q)},zQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),LQ=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),HQ=J(()=>W(G.object({query:G.string()}))),qQ=l({id:"anthropic.web_search_20260209",inputSchema:HQ,outputSchema:LQ,supportsDeferredResults:!0}),AQ=(Q={})=>{return qQ(Q)},KQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),uG=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),DQ=J(()=>W(G.object({query:G.string()}))),JQ=l({id:"anthropic.web_search_20250305",inputSchema:DQ,outputSchema:uG,supportsDeferredResults:!0}),WQ=(Q={})=>{return JQ(Q)},jQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),VQ=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),UQ=J(()=>W(G.object({url:G.string()}))),RQ=l({id:"anthropic.web_fetch_20260209",inputSchema:UQ,outputSchema:VQ,supportsDeferredResults:!0}),EQ=(Q={})=>{return RQ(Q)},SQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),cG=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),yQ=J(()=>W(G.object({url:G.string()}))),FQ=l({id:"anthropic.web_fetch_20250910",inputSchema:yQ,outputSchema:cG,supportsDeferredResults:!0}),xQ=(Q={})=>{return FQ(Q)};async function PQ({tools:Q,toolChoice:H,disableParallelToolUse:Z,cacheControlValidator:q,supportsStructuredOutput:E,supportsStrictTools:T,defaultEagerInputStreaming:b=!1}){var F,h;Q=(Q==null?void 0:Q.length)?Q:void 0;let w=[],N=new Set,c=q||new RG;if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};let R=[];for(let S of Q)switch(S.type){case"function":{let B=c.getCacheControl(S.providerOptions,{type:"tool definition",canCache:!0}),g=(F=S.providerOptions)==null?void 0:F.anthropic,m=(h=g==null?void 0:g.eagerInputStreaming)!=null?h:b,O=g==null?void 0:g.deferLoading,e=g==null?void 0:g.allowedCallers;if(!T&&S.strict!=null)w.push({type:"unsupported",feature:"strict",details:`Tool '${S.name}' has strict: ${S.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`});if(R.push({name:S.name,description:S.description,input_schema:S.inputSchema,cache_control:B,...m?{eager_input_streaming:!0}:{},...T===!0&&S.strict!=null?{strict:S.strict}:{},...O!=null?{defer_loading:O}:{},...e!=null?{allowed_callers:e}:{},...S.inputExamples!=null?{input_examples:S.inputExamples.map((C)=>C.input)}:{}}),E===!0)N.add("structured-outputs-2025-11-13");if(S.inputExamples!=null||e!=null)N.add("advanced-tool-use-2025-11-20");break}case"provider":{switch(S.id){case"anthropic.code_execution_20250522":{N.add("code-execution-2025-05-22"),R.push({type:"code_execution_20250522",name:"code_execution",cache_control:void 0});break}case"anthropic.code_execution_20250825":{N.add("code-execution-2025-08-25"),R.push({type:"code_execution_20250825",name:"code_execution"});break}case"anthropic.code_execution_20260120":{R.push({type:"code_execution_20260120",name:"code_execution"});break}case"anthropic.computer_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"computer",type:"computer_20250124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.computer_20251124":{N.add("computer-use-2025-11-24"),R.push({name:"computer",type:"computer_20251124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,enable_zoom:S.args.enableZoom,cache_control:void 0});break}case"anthropic.computer_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"computer",type:"computer_20241022",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.text_editor_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_editor",type:"text_editor_20250124",cache_control:void 0});break}case"anthropic.text_editor_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"str_replace_editor",type:"text_editor_20241022",cache_control:void 0});break}case"anthropic.text_editor_20250429":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429",cache_control:void 0});break}case"anthropic.text_editor_20250728":{let B=await GG({value:S.args,schema:XQ});R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:B.maxCharacters,cache_control:void 0});break}case"anthropic.bash_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"bash",type:"bash_20250124",cache_control:void 0});break}case"anthropic.bash_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"bash",type:"bash_20241022",cache_control:void 0});break}case"anthropic.memory_20250818":{N.add("context-management-2025-06-27"),R.push({name:"memory",type:"memory_20250818"});break}case"anthropic.web_fetch_20250910":{N.add("web-fetch-2025-09-10");let B=await GG({value:S.args,schema:SQ});R.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:jQ});R.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_search_20250305":{let B=await GG({value:S.args,schema:KQ});R.push({type:"web_search_20250305",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:zQ});R.push({type:"web_search_20260209",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.tool_search_regex_20251119":{R.push({type:"tool_search_tool_regex_20251119",name:"tool_search_tool_regex"});break}case"anthropic.tool_search_bm25_20251119":{R.push({type:"tool_search_tool_bm25_20251119",name:"tool_search_tool_bm25"});break}default:{w.push({type:"unsupported",feature:`provider-defined tool ${S.id}`});break}}break}default:{w.push({type:"unsupported",feature:`tool ${S}`});break}}if(H==null)return{tools:R,toolChoice:Z?{type:"auto",disable_parallel_tool_use:Z}:void 0,toolWarnings:w,betas:N};let a=H.type;switch(a){case"auto":return{tools:R,toolChoice:{type:"auto",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"required":return{tools:R,toolChoice:{type:"any",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};case"tool":return{tools:R,toolChoice:{type:"tool",name:H.toolName,disable_parallel_tool_use:Z},toolWarnings:w,betas:N};default:throw new HG({functionality:`tool choice type: ${a}`})}}function fG({usage:Q,rawUsage:H}){var Z,q;let E=(Z=Q.cache_creation_input_tokens)!=null?Z:0,T=(q=Q.cache_read_input_tokens)!=null?q:0,b,F;if(Q.iterations&&Q.iterations.length>0){let h=Q.iterations.reduce((w,N)=>({input:w.input+N.input_tokens,output:w.output+N.output_tokens}),{input:0,output:0});b=h.input,F=h.output}else b=Q.input_tokens,F=Q.output_tokens;return{inputTokens:{total:b+E+T,noCache:b,cacheRead:T,cacheWrite:E},outputTokens:{total:F,text:void 0,reasoning:void 0},raw:H!=null?H:Q}}var iG=J(()=>W(G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}))),fQ=J(()=>W(G.object({code:G.string()}))),BQ=l({id:"anthropic.code_execution_20250522",inputSchema:fQ,outputSchema:iG}),IQ=(Q={})=>{return BQ(Q)},lG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),wQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),NQ=l({id:"anthropic.code_execution_20250825",inputSchema:wQ,outputSchema:lG,supportsDeferredResults:!0}),MQ=(Q={})=>{return NQ(Q)},sG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),CQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),bQ=l({id:"anthropic.code_execution_20260120",inputSchema:CQ,outputSchema:sG,supportsDeferredResults:!0}),TQ=(Q={})=>{return bQ(Q)},pG=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),OQ=J(()=>W(G.object({pattern:G.string(),limit:G.number().optional()}))),kQ=l({id:"anthropic.tool_search_regex_20251119",inputSchema:OQ,outputSchema:pG,supportsDeferredResults:!0}),vQ=(Q={})=>{return kQ(Q)};function _Q(Q){if(typeof Q==="string")return new TextDecoder().decode(TG(Q));if(Q instanceof Uint8Array)return new TextDecoder().decode(Q);if(Q instanceof URL)throw new HG({functionality:"URL-based text documents are not supported for citations"});throw new HG({functionality:`unsupported data type for text documents: ${typeof Q}`})}function KG(Q){return Q instanceof URL||hQ(Q)}function hQ(Q){return typeof Q==="string"&&/^https?:\/\//i.test(Q)}function DG(Q){return Q instanceof URL?Q.toString():Q}async function gQ({prompt:Q,sendReasoning:H,warnings:Z,cacheControlValidator:q,toolNameMapping:E}){var T,b,F,h,w,N,c,R,a,S,B,g,m,O,e,C,s,QG,YG;let Y=new Set,j=mQ(Q),M=q||new RG,p=void 0,XG=[];async function zG(v){var k,V;let ZG=await LG({provider:"anthropic",providerOptions:v,schema:FG});return(V=(k=ZG==null?void 0:ZG.citations)==null?void 0:k.enabled)!=null?V:!1}async function L(v){let k=await LG({provider:"anthropic",providerOptions:v,schema:FG});return{title:k==null?void 0:k.title,context:k==null?void 0:k.context}}for(let v=0;v<j.length;v++){let k=j[v],V=v===j.length-1,ZG=k.type;switch(ZG){case"system":{if(p!=null)throw new HG({functionality:"Multiple system messages that are separated by user/assistant messages"});p=k.messages.map(({content:I,providerOptions:o})=>({type:"text",text:I,cache_control:M.getCacheControl(o,{type:"system message",canCache:!0})}));break}case"user":{let I=[];for(let o of k.messages){let{role:t,content:r}=o;switch(t){case"user":{for(let i=0;i<r.length;i++){let x=r[i],n=i===r.length-1,z=(T=M.getCacheControl(x.providerOptions,{type:"user message part",canCache:!0}))!=null?T:n?M.getCacheControl(o.providerOptions,{type:"user message",canCache:!0}):void 0;switch(x.type){case"text":{I.push({type:"text",text:x.text,cache_control:z});break}case"file":{if(x.mediaType.startsWith("image/"))I.push({type:"image",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:x.mediaType==="image/*"?"image/jpeg":x.mediaType,data:jG(x.data)},cache_control:z});else if(x.mediaType==="application/pdf"){Y.add("pdfs-2024-09-25");let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:"application/pdf",data:jG(x.data)},title:(b=P.title)!=null?b:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else if(x.mediaType==="text/plain"){let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"text",media_type:"text/plain",data:_Q(x.data)},title:(F=P.title)!=null?F:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else throw new HG({functionality:`media type: ${x.mediaType}`});break}}}break}case"tool":{for(let i=0;i<r.length;i++){let x=r[i];if(x.type==="tool-approval-response")continue;let n=i===r.length-1,z=(h=M.getCacheControl(x.providerOptions,{type:"tool result part",canCache:!0}))!=null?h:n?M.getCacheControl(o.providerOptions,{type:"tool result message",canCache:!0}):void 0,d=x.output,P;switch(d.type){case"content":P=d.value.map((U)=>{var D;switch(U.type){case"text":return{type:"text",text:U.text};case"image-data":return{type:"image",source:{type:"base64",media_type:U.mediaType,data:U.data}};case"image-url":return{type:"image",source:{type:"url",url:U.url}};case"file-url":return{type:"document",source:{type:"url",url:U.url}};case"file-data":{if(U.mediaType==="application/pdf")return Y.add("pdfs-2024-09-25"),{type:"document",source:{type:"base64",media_type:U.mediaType,data:U.data}};Z.push({type:"other",message:`unsupported tool content part type: ${U.type} with media type: ${U.mediaType}`});return}case"custom":{let A=(D=U.providerOptions)==null?void 0:D.anthropic;if((A==null?void 0:A.type)==="tool-reference")return{type:"tool_reference",tool_name:A.toolName};Z.push({type:"other",message:"unsupported custom tool content part"});return}default:{Z.push({type:"other",message:`unsupported tool content part type: ${U.type}`});return}}}).filter(kG);break;case"text":case"error-text":P=d.value;break;case"execution-denied":P=(w=d.reason)!=null?w:"Tool execution denied.";break;case"json":case"error-json":default:P=JSON.stringify(d.value);break}I.push({type:"tool_result",tool_use_id:x.toolCallId,content:P,is_error:d.type==="error-text"||d.type==="error-json"?!0:void 0,cache_control:z})}break}default:throw Error(`Unsupported role: ${t}`)}}XG.push({role:"user",content:I});break}case"assistant":{let I=[],o=new Set;for(let t=0;t<k.messages.length;t++){let r=k.messages[t],i=t===k.messages.length-1,{content:x}=r;for(let n=0;n<x.length;n++){let z=x[n],d=n===x.length-1,P=(N=M.getCacheControl(z.providerOptions,{type:"assistant message part",canCache:!0}))!=null?N:d?M.getCacheControl(r.providerOptions,{type:"assistant message",canCache:!0}):void 0;switch(z.type){case"text":{let U=(c=z.providerOptions)==null?void 0:c.anthropic;if((U==null?void 0:U.type)==="compaction")I.push({type:"compaction",content:z.text,cache_control:P});else I.push({type:"text",text:V&&i&&d?z.text.trim():z.text,cache_control:P});break}case"reasoning":{if(H){let U=await LG({provider:"anthropic",providerOptions:z.providerOptions,schema:GQ});if(U!=null)if(U.signature!=null)M.getCacheControl(z.providerOptions,{type:"thinking block",canCache:!1}),I.push({type:"thinking",thinking:z.text,signature:U.signature});else if(U.redactedData!=null)M.getCacheControl(z.providerOptions,{type:"redacted thinking block",canCache:!1}),I.push({type:"redacted_thinking",data:U.redactedData});else Z.push({type:"other",message:"unsupported reasoning metadata"});else Z.push({type:"other",message:"unsupported reasoning metadata"})}else Z.push({type:"other",message:"sending reasoning content is disabled for this model"});break}case"tool-call":{if(z.providerExecuted){let A=E.toProviderToolName(z.toolName);if(((a=(R=z.providerOptions)==null?void 0:R.anthropic)==null?void 0:a.type)==="mcp-tool-use"){o.add(z.toolCallId);let X=(B=(S=z.providerOptions)==null?void 0:S.anthropic)==null?void 0:B.serverName;if(X==null||typeof X!=="string"){Z.push({type:"other",message:"mcp tool use server name is required and must be a string"});break}I.push({type:"mcp_tool_use",id:z.toolCallId,name:z.toolName,input:z.input,server_name:X,cache_control:P})}else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&typeof z.input.type==="string"&&(z.input.type==="bash_code_execution"||z.input.type==="text_editor_code_execution"))I.push({type:"server_tool_use",id:z.toolCallId,name:z.input.type,input:z.input,cache_control:P});else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&z.input.type==="programmatic-tool-call"){let{type:X,...f}=z.input;I.push({type:"server_tool_use",id:z.toolCallId,name:"code_execution",input:f,cache_control:P})}else if(A==="code_execution"||A==="web_fetch"||A==="web_search")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else if(A==="tool_search_tool_regex"||A==="tool_search_tool_bm25")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else Z.push({type:"other",message:`provider executed tool call for tool ${z.toolName} is not supported`});break}let U=(g=z.providerOptions)==null?void 0:g.anthropic,D=(U==null?void 0:U.caller)?(U.caller.type==="code_execution_20250825"||U.caller.type==="code_execution_20260120")&&U.caller.toolId?{type:U.caller.type,tool_id:U.caller.toolId}:U.caller.type==="direct"?{type:"direct"}:void 0:void 0;I.push({type:"tool_use",id:z.toolCallId,name:z.toolName,input:z.input,...D&&{caller:D},cache_control:P});break}case"tool-result":{let U=E.toProviderToolName(z.toolName);if(o.has(z.toolCallId)){let D=z.output;if(D.type!=="json"&&D.type!=="error-json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}I.push({type:"mcp_tool_result",tool_use_id:z.toolCallId,is_error:D.type==="error-json",content:D.value,cache_control:P})}else if(U==="code_execution"){let D=z.output;if(D.type==="error-text"||D.type==="error-json"){let A={};try{if(typeof D.value==="string")A=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)A=D.value}catch($){}if(A.type==="code_execution_tool_result_error")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:"code_execution_tool_result_error",error_code:(m=A.errorCode)!=null?m:"unknown"},cache_control:P});else I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:{type:"bash_code_execution_tool_result_error",error_code:(O=A.errorCode)!=null?O:"unknown"}});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}if(D.value==null||typeof D.value!=="object"||!("type"in D.value)||typeof D.value.type!=="string"){Z.push({type:"other",message:`provider executed tool result output value is not a valid code execution result for tool ${z.toolName}`});break}if(D.value.type==="code_execution_result"){let A=await GG({value:D.value,schema:iG});I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(e=A.content)!=null?e:[]},cache_control:P})}else if(D.value.type==="encrypted_code_execution_result"){let A=await GG({value:D.value,schema:sG});if(A.type==="encrypted_code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,encrypted_stdout:A.encrypted_stdout,stderr:A.stderr,return_code:A.return_code,content:(C=A.content)!=null?C:[]},cache_control:P})}else{let A=await GG({value:D.value,schema:lG});if(A.type==="code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(s=A.content)!=null?s:[]},cache_control:P});else if(A.type==="bash_code_execution_result"||A.type==="bash_code_execution_tool_result_error")I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A});else I.push({type:"text_editor_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A})}break}if(U==="web_fetch"){let D=z.output;if(D.type==="error-json"){let $={};try{if(typeof D.value==="string")$=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)$=D.value}catch(X){let f=(QG=D.value)==null?void 0:QG.errorCode;$={errorCode:typeof f==="string"?f:"unavailable"}}I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_tool_result_error",error_code:(YG=$.errorCode)!=null?YG:"unavailable"},cache_control:P});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:cG});I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_result",url:A.url,retrieved_at:A.retrievedAt,content:{type:"document",title:A.content.title,citations:A.content.citations,source:{type:A.content.source.type,media_type:A.content.source.mediaType,data:A.content.source.data}}},cache_control:P});break}if(U==="web_search"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:uG});I.push({type:"web_search_tool_result",tool_use_id:z.toolCallId,content:A.map(($)=>({url:$.url,title:$.title,page_age:$.pageAge,encrypted_content:$.encryptedContent,type:$.type})),cache_control:P});break}if(U==="tool_search_tool_regex"||U==="tool_search_tool_bm25"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let $=(await GG({value:D.value,schema:pG})).map((X)=>({type:"tool_reference",tool_name:X.toolName}));I.push({type:"tool_search_tool_result",tool_use_id:z.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:$},cache_control:P});break}Z.push({type:"other",message:`provider executed tool result for tool ${z.toolName} is not supported`});break}}}}XG.push({role:"assistant",content:I});break}default:throw Error(`content type: ${ZG}`)}}return{prompt:{system:p,messages:XG},betas:Y}}function mQ(Q){let H=[],Z=void 0;for(let q of Q){let{role:E}=q;switch(E){case"system":{if((Z==null?void 0:Z.type)!=="system")Z={type:"system",messages:[]},H.push(Z);Z.messages.push(q);break}case"assistant":{if((Z==null?void 0:Z.type)!=="assistant")Z={type:"assistant",messages:[]},H.push(Z);Z.messages.push(q);break}case"user":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}case"tool":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}default:throw Error(`Unsupported role: ${E}`)}}return H}function JG({finishReason:Q,isJsonResponseFromTool:H}){switch(Q){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return H?"stop":"tool-calls";case"max_tokens":case"model_context_window_exceeded":return"length";case"compaction":return"other";default:return"other"}}function BG(Q,H,Z){var q;if(Q.type==="web_search_result_location")return{type:"source",sourceType:"url",id:Z(),url:Q.url,title:Q.title,providerMetadata:{anthropic:{citedText:Q.cited_text,encryptedIndex:Q.encrypted_index}}};if(Q.type!=="page_location"&&Q.type!=="char_location")return;let E=H[Q.document_index];if(!E)return;return{type:"source",sourceType:"document",id:Z(),mediaType:E.mediaType,title:(q=Q.document_title)!=null?q:E.title,filename:E.filename,providerMetadata:{anthropic:Q.type==="page_location"?{citedText:Q.cited_text,startPageNumber:Q.start_page_number,endPageNumber:Q.end_page_number}:{citedText:Q.cited_text,startCharIndex:Q.start_char_index,endCharIndex:Q.end_char_index}}}}var dQ=class{constructor(Q,H){this.specificationVersion="v3";var Z;this.modelId=Q,this.config=H,this.generateId=(Z=H.generateId)!=null?Z:AG}supportsUrl(Q){return Q.protocol==="https:"}get provider(){return this.config.provider}get providerOptionsName(){let Q=this.config.provider,H=Q.indexOf(".");return H===-1?Q:Q.substring(0,H)}get supportedUrls(){var Q,H,Z;return(Z=(H=(Q=this.config).supportedUrls)==null?void 0:H.call(Q))!=null?Z:{}}async getArgs({userSuppliedBetas:Q,prompt:H,maxOutputTokens:Z,temperature:q,topP:E,topK:T,frequencyPenalty:b,presencePenalty:F,stopSequences:h,responseFormat:w,seed:N,tools:c,toolChoice:R,providerOptions:a,stream:S}){var B,g,m,O,e,C,s,QG,YG,Y;let j=[];if(b!=null)j.push({type:"unsupported",feature:"frequencyPenalty"});if(F!=null)j.push({type:"unsupported",feature:"presencePenalty"});if(N!=null)j.push({type:"unsupported",feature:"seed"});if(q!=null&&q>1)j.push({type:"unsupported",feature:"temperature",details:`${q} exceeds anthropic maximum of 1.0. clamped to 1.0`}),q=1;else if(q!=null&&q<0)j.push({type:"unsupported",feature:"temperature",details:`${q} is below anthropic minimum of 0. clamped to 0`}),q=0;if((w==null?void 0:w.type)==="json"){if(w.schema==null)j.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."})}let M=this.providerOptionsName,p=await LG({provider:"anthropic",providerOptions:a,schema:xG}),XG=M!=="anthropic"?await LG({provider:M,providerOptions:a,schema:xG}):null,zG=XG!=null,L=Object.assign({},p!=null?p:{},XG!=null?XG:{}),{maxOutputTokens:v,supportsStructuredOutput:k,rejectsSamplingParameters:V,isKnownModel:ZG}=uQ(this.modelId);if(V){if(q!=null)j.push({type:"unsupported",feature:"temperature",details:`temperature is not supported by ${this.modelId} and will be ignored`}),q=void 0;if(T!=null)j.push({type:"unsupported",feature:"topK",details:`topK is not supported by ${this.modelId} and will be ignored`}),T=void 0;if(E!=null)j.push({type:"unsupported",feature:"topP",details:`topP is not supported by ${this.modelId} and will be ignored`}),E=void 0}let I=ZG||this.modelId.startsWith("claude-"),o=((B=this.config.supportsNativeStructuredOutput)!=null?B:!0)&&k,t=((g=this.config.supportsStrictTools)!=null?g:!0)&&k,r=(m=L==null?void 0:L.structuredOutputMode)!=null?m:"auto",i=r==="outputFormat"||r==="auto"&&o,x=(w==null?void 0:w.type)==="json"&&w.schema!=null&&!i?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:w.schema}:void 0,n=L==null?void 0:L.contextManagement,z=new RG,d=bG({tools:c,providerToolNames:{"anthropic.code_execution_20250522":"code_execution","anthropic.code_execution_20250825":"code_execution","anthropic.code_execution_20260120":"code_execution","anthropic.computer_20241022":"computer","anthropic.computer_20250124":"computer","anthropic.text_editor_20241022":"str_replace_editor","anthropic.text_editor_20250124":"str_replace_editor","anthropic.text_editor_20250429":"str_replace_based_edit_tool","anthropic.text_editor_20250728":"str_replace_based_edit_tool","anthropic.bash_20241022":"bash","anthropic.bash_20250124":"bash","anthropic.memory_20250818":"memory","anthropic.web_search_20250305":"web_search","anthropic.web_search_20260209":"web_search","anthropic.web_fetch_20250910":"web_fetch","anthropic.web_fetch_20260209":"web_fetch","anthropic.tool_search_regex_20251119":"tool_search_tool_regex","anthropic.tool_search_bm25_20251119":"tool_search_tool_bm25"}}),{prompt:P,betas:U}=await gQ({prompt:H,sendReasoning:(O=L==null?void 0:L.sendReasoning)!=null?O:!0,warnings:j,cacheControlValidator:z,toolNameMapping:d}),D=(e=L==null?void 0:L.thinking)==null?void 0:e.type,A=D==="enabled"||D==="adaptive",$=D==="enabled"?(C=L==null?void 0:L.thinking)==null?void 0:C.budgetTokens:void 0,X=D==="adaptive"?(s=L==null?void 0:L.thinking)==null?void 0:s.display:void 0,f=Z!=null?Z:v,K={model:this.modelId,max_tokens:f,temperature:q,top_k:T,top_p:E,stop_sequences:h,...A&&{thinking:{type:D,...$!=null&&{budget_tokens:$},...X!=null&&{display:X}}},...((L==null?void 0:L.effort)||(L==null?void 0:L.taskBudget)||i&&(w==null?void 0:w.type)==="json"&&w.schema!=null)&&{output_config:{...(L==null?void 0:L.effort)&&{effort:L.effort},...(L==null?void 0:L.taskBudget)&&{task_budget:{type:L.taskBudget.type,total:L.taskBudget.total,...L.taskBudget.remaining!=null&&{remaining:L.taskBudget.remaining}}},...i&&(w==null?void 0:w.type)==="json"&&w.schema!=null&&{format:{type:"json_schema",schema:w.schema}}}},...(L==null?void 0:L.speed)&&{speed:L.speed},...(L==null?void 0:L.inferenceGeo)&&{inference_geo:L.inferenceGeo},...(L==null?void 0:L.cacheControl)&&{cache_control:L.cacheControl},...((QG=L==null?void 0:L.metadata)==null?void 0:QG.userId)!=null&&{metadata:{user_id:L.metadata.userId}},...(L==null?void 0:L.mcpServers)&&L.mcpServers.length>0&&{mcp_servers:L.mcpServers.map((y)=>({type:y.type,name:y.name,url:y.url,authorization_token:y.authorizationToken,tool_configuration:y.toolConfiguration?{allowed_tools:y.toolConfiguration.allowedTools,enabled:y.toolConfiguration.enabled}:void 0}))},...(L==null?void 0:L.container)&&{container:L.container.skills&&L.container.skills.length>0?{id:L.container.id,skills:L.container.skills.map((y)=>({type:y.type,skill_id:y.skillId,version:y.version}))}:L.container.id},system:P.system,messages:P.messages,...n&&{context_management:{edits:n.edits.map((y)=>{let SG=y.type;switch(SG){case"clear_tool_uses_20250919":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.keep!==void 0&&{keep:y.keep},...y.clearAtLeast!==void 0&&{clear_at_least:y.clearAtLeast},...y.clearToolInputs!==void 0&&{clear_tool_inputs:y.clearToolInputs},...y.excludeTools!==void 0&&{exclude_tools:y.excludeTools}};case"clear_thinking_20251015":return{type:y.type,...y.keep!==void 0&&{keep:y.keep}};case"compact_20260112":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.pauseAfterCompaction!==void 0&&{pause_after_compaction:y.pauseAfterCompaction},...y.instructions!==void 0&&{instructions:y.instructions}};default:j.push({type:"other",message:`Unknown context management strategy: ${SG}`});return}}).filter((y)=>y!==void 0)}}};if(A){if(D==="enabled"&&$==null)j.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),K.thinking={type:"enabled",budget_tokens:1024},$=1024;if(K.temperature!=null)K.temperature=void 0,j.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"});if(T!=null)K.top_k=void 0,j.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"});if(E!=null)K.top_p=void 0,j.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"});K.max_tokens=f+($!=null?$:0)}else if(I&&E!=null&&q!=null)j.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),K.top_p=void 0;if(ZG&&K.max_tokens>v){if(Z!=null)j.push({type:"unsupported",feature:"maxOutputTokens",details:`${K.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${v} max output tokens. The max output tokens have been limited to ${v}.`});K.max_tokens=v}if((L==null?void 0:L.mcpServers)&&L.mcpServers.length>0)U.add("mcp-client-2025-04-04");if(n){if(U.add("context-management-2025-06-27"),n.edits.some((y)=>y.type==="compact_20260112"))U.add("compact-2026-01-12")}if((L==null?void 0:L.container)&&L.container.skills&&L.container.skills.length>0){if(U.add("code-execution-2025-08-25"),U.add("skills-2025-10-02"),U.add("files-api-2025-04-14"),!(c==null?void 0:c.some((y)=>y.type==="provider"&&(y.id==="anthropic.code_execution_20250825"||y.id==="anthropic.code_execution_20260120"))))j.push({type:"other",message:"code execution tool is required when using skills"})}if(L==null?void 0:L.effort)U.add("effort-2025-11-24");if(L==null?void 0:L.taskBudget)U.add("task-budgets-2026-03-13");if((L==null?void 0:L.speed)==="fast")U.add("fast-mode-2026-02-01");let _=S&&((YG=L==null?void 0:L.toolStreaming)!=null?YG:!0),{tools:$G,toolChoice:EG,toolWarnings:qG,betas:nG}=await PQ(x!=null?{tools:[...c!=null?c:[],x],toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:z,supportsStructuredOutput:!1,supportsStrictTools:t,defaultEagerInputStreaming:_}:{tools:c!=null?c:[],toolChoice:R,disableParallelToolUse:L==null?void 0:L.disableParallelToolUse,cacheControlValidator:z,supportsStructuredOutput:o,supportsStrictTools:t,defaultEagerInputStreaming:_}),rG=z.getWarnings();return{args:{...K,tools:$G,tool_choice:EG,stream:S===!0?!0:void 0},warnings:[...j,...qG,...rG],betas:new Set([...U,...nG,...Q,...(Y=L==null?void 0:L.anthropicBeta)!=null?Y:[]]),usesJsonResponseTool:x!=null,toolNameMapping:d,providerOptionsName:M,usedCustomProviderKey:zG}}async getHeaders({betas:Q,headers:H}){return CG(await UG(this.config.headers),H,Q.size>0?{"anthropic-beta":Array.from(Q).join(",")}:{})}async getBetasFromHeaders(Q){var H,Z;let E=(H=(await UG(this.config.headers))["anthropic-beta"])!=null?H:"",T=(Z=Q==null?void 0:Q["anthropic-beta"])!=null?Z:"";return new Set([...E.toLowerCase().split(","),...T.toLowerCase().split(",")].map((b)=>b.trim()).filter((b)=>b!==""))}buildRequestUrl(Q){var H,Z,q;return(q=(Z=(H=this.config).buildRequestUrl)==null?void 0:Z.call(H,this.config.baseURL,Q))!=null?q:`${this.config.baseURL}/messages`}transformRequestBody(Q,H){var Z,q,E;return(E=(q=(Z=this.config).transformRequestBody)==null?void 0:q.call(Z,Q,H))!=null?E:Q}extractCitationDocuments(Q){let H=(Z)=>{var q,E;if(Z.type!=="file")return!1;if(Z.mediaType!=="application/pdf"&&Z.mediaType!=="text/plain")return!1;let T=(q=Z.providerOptions)==null?void 0:q.anthropic,b=T==null?void 0:T.citations;return(E=b==null?void 0:b.enabled)!=null?E:!1};return Q.filter((Z)=>Z.role==="user").flatMap((Z)=>Z.content).filter(H).map((Z)=>{var q;let E=Z;return{title:(q=E.filename)!=null?q:"Untitled Document",filename:E.filename,mediaType:E.mediaType}})}async doGenerate(Q){var H,Z,q,E,T,b,F;let{args:h,warnings:w,betas:N,usesJsonResponseTool:c,toolNameMapping:R,providerOptionsName:a,usedCustomProviderKey:S}=await this.getArgs({...Q,stream:!1,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),B=[...this.extractCitationDocuments(Q.prompt)],g=IG(h.tools),{responseHeaders:m,value:O,rawValue:e}=await VG({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:N,headers:Q.headers}),body:this.transformRequestBody(h,N),failedResponseHandler:yG,successfulResponseHandler:mG(oG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),C=[],s={},QG={},YG=!1;for(let Y of O.content)switch(Y.type){case"text":{if(!c){if(C.push({type:"text",text:Y.text}),Y.citations)for(let j of Y.citations){let M=BG(j,B,this.generateId);if(M)C.push(M)}}break}case"thinking":{C.push({type:"reasoning",text:Y.thinking,providerMetadata:{anthropic:{signature:Y.signature}}});break}case"redacted_thinking":{C.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:Y.data}}});break}case"compaction":{C.push({type:"text",text:Y.content,providerMetadata:{anthropic:{type:"compaction"}}});break}case"tool_use":{if(c&&Y.name==="json")YG=!0,C.push({type:"text",text:JSON.stringify(Y.input)});else{let M=Y.caller,p=M?{type:M.type,toolId:"tool_id"in M?M.tool_id:void 0}:void 0;C.push({type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),...p&&{providerMetadata:{anthropic:{caller:p}}}})}break}case"server_tool_use":{if(Y.name==="text_editor_code_execution"||Y.name==="bash_code_execution")C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName("code_execution"),input:JSON.stringify({type:Y.name,...Y.input}),providerExecuted:!0});else if(Y.name==="web_search"||Y.name==="code_execution"||Y.name==="web_fetch"){let j=Y.name==="code_execution"&&Y.input!=null&&typeof Y.input==="object"&&"code"in Y.input&&!("type"in Y.input)?{type:"programmatic-tool-call",...Y.input}:Y.input;C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(j),providerExecuted:!0,...g&&Y.name==="code_execution"?{dynamic:!0}:{}})}else if(Y.name==="tool_search_tool_regex"||Y.name==="tool_search_tool_bm25")QG[Y.id]=Y.name,C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(Y.input),providerExecuted:!0});break}case"mcp_tool_use":{s[Y.id]={type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:Y.server_name}}},C.push(s[Y.id]);break}case"mcp_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:s[Y.tool_use_id].toolName,isError:Y.is_error,result:Y.content,dynamic:!0,providerMetadata:s[Y.tool_use_id].providerMetadata});break}case"web_fetch_tool_result":{if(Y.content.type==="web_fetch_result")B.push({title:(H=Y.content.content.title)!=null?H:Y.content.url,mediaType:Y.content.content.source.media_type}),C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:Y.content.url,retrievedAt:Y.content.retrieved_at,content:{type:Y.content.content.type,title:Y.content.content.title,citations:Y.content.content.citations,source:{type:Y.content.content.source.type,mediaType:Y.content.content.source.media_type,data:Y.content.content.source.data}}}});else if(Y.content.type==="web_fetch_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:Y.content.error_code}});break}case"web_search_tool_result":{if(Array.isArray(Y.content)){C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),result:Y.content.map((j)=>{var M;return{url:j.url,title:j.title,pageAge:(M=j.page_age)!=null?M:null,encryptedContent:j.encrypted_content,type:j.type}})});for(let j of Y.content)C.push({type:"source",sourceType:"url",id:this.generateId(),url:j.url,title:j.title,providerMetadata:{anthropic:{pageAge:(Z=j.page_age)!=null?Z:null}}})}else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:Y.content.error_code}});break}case"code_execution_tool_result":{if(Y.content.type==="code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,stdout:Y.content.stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(q=Y.content.content)!=null?q:[]}});else if(Y.content.type==="encrypted_code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,encrypted_stdout:Y.content.encrypted_stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(E=Y.content.content)!=null?E:[]}});else if(Y.content.type==="code_execution_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:Y.content.error_code}});break}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:Y.content});break}case"tool_search_tool_result":{let j=QG[Y.tool_use_id];if(j==null){let M=R.toCustomToolName("tool_search_tool_bm25"),p=R.toCustomToolName("tool_search_tool_regex");if(M!=="tool_search_tool_bm25")j="tool_search_tool_bm25";else if(p!=="tool_search_tool_regex")j="tool_search_tool_regex";else j="tool_search_tool_regex"}if(Y.content.type==="tool_search_tool_search_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),result:Y.content.tool_references.map((M)=>({type:M.type,toolName:M.tool_name}))});else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:Y.content.error_code}});break}}return{content:C,finishReason:{unified:JG({finishReason:O.stop_reason,isJsonResponseFromTool:YG}),raw:(T=O.stop_reason)!=null?T:void 0},usage:fG({usage:O.usage}),request:{body:h},response:{id:(b=O.id)!=null?b:void 0,modelId:(F=O.model)!=null?F:void 0,headers:m,body:e},warnings:w,providerMetadata:(()=>{var Y,j,M,p,XG;let zG={usage:O.usage,cacheCreationInputTokens:(Y=O.usage.cache_creation_input_tokens)!=null?Y:null,stopSequence:(j=O.stop_sequence)!=null?j:null,iterations:O.usage.iterations?O.usage.iterations.map((v)=>({type:v.type,inputTokens:v.input_tokens,outputTokens:v.output_tokens})):null,container:O.container?{expiresAt:O.container.expires_at,id:O.container.id,skills:(p=(M=O.container.skills)==null?void 0:M.map((v)=>({type:v.type,skillId:v.skill_id,version:v.version})))!=null?p:null}:null,contextManagement:(XG=wG(O.context_management))!=null?XG:null},L={anthropic:zG};if(S&&a!=="anthropic")L[a]=zG;return L})()}}async doStream(Q){var H,Z;let{args:q,warnings:E,betas:T,usesJsonResponseTool:b,toolNameMapping:F,providerOptionsName:h,usedCustomProviderKey:w}=await this.getArgs({...Q,stream:!0,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),N=[...this.extractCitationDocuments(Q.prompt)],c=IG(q.tools),R=this.buildRequestUrl(!0),{responseHeaders:a,value:S}=await VG({url:R,headers:await this.getHeaders({betas:T,headers:Q.headers}),body:this.transformRequestBody(q,T),failedResponseHandler:yG,successfulResponseHandler:gG(tG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),B={unified:"other",raw:void 0},g={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},m={},O={},e={},C=null,s=void 0,QG=null,YG=null,Y=null,j=!1,M=void 0,p=this.generateId,XG=S.pipeThrough(new TransformStream({start(k){k.enqueue({type:"stream-start",warnings:E})},transform(k,V){var ZG,I,o,t,r,i,x,n,z,d,P,U,D,A;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:k.rawValue});if(!k.success){V.enqueue({type:"error",error:k.error});return}let $=k.value;switch($.type){case"ping":return;case"content_block_start":{let X=$.content_block,f=X.type;switch(M=f,f){case"text":{if(b)return;m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});return}case"thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index)});return}case"redacted_thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index),providerMetadata:{anthropic:{redactedData:X.data}}});return}case"compaction":{m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index),providerMetadata:{anthropic:{type:"compaction"}}});return}case"tool_use":{if(b&&X.name==="json")j=!0,m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});else{let _=X.caller,$G=_?{type:_.type,toolId:"tool_id"in _?_.tool_id:void 0}:void 0,qG=X.input&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:qG,firstDelta:qG.length===0,...$G&&{caller:$G}},V.enqueue({type:"tool-input-start",id:X.id,toolName:X.name})}return}case"server_tool_use":{if(["web_fetch","web_search","code_execution","text_editor_code_execution","bash_code_execution"].includes(X.name)){let K=X.name==="text_editor_code_execution"||X.name==="bash_code_execution"?"code_execution":X.name,_=F.toCustomToolName(K),$G=X.input!=null&&typeof X.input==="object"&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:_,input:$G,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{},firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:_,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{}})}else if(X.name==="tool_search_tool_regex"||X.name==="tool_search_tool_bm25"){e[X.id]=X.name;let K=F.toCustomToolName(X.name);m[$.index]={type:"tool-call",toolCallId:X.id,toolName:K,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:K,providerExecuted:!0})}return}case"web_fetch_tool_result":{if(X.content.type==="web_fetch_result")N.push({title:(ZG=X.content.content.title)!=null?ZG:X.content.url,mediaType:X.content.content.source.media_type}),V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:X.content.url,retrievedAt:X.content.retrieved_at,content:{type:X.content.content.type,title:X.content.content.title,citations:X.content.content.citations,source:{type:X.content.content.source.type,mediaType:X.content.content.source.media_type,data:X.content.content.source.data}}}});else if(X.content.type==="web_fetch_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:X.content.error_code}});return}case"web_search_tool_result":{if(Array.isArray(X.content)){V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),result:X.content.map((K)=>{var _;return{url:K.url,title:K.title,pageAge:(_=K.page_age)!=null?_:null,encryptedContent:K.encrypted_content,type:K.type}})});for(let K of X.content)V.enqueue({type:"source",sourceType:"url",id:p(),url:K.url,title:K.title,providerMetadata:{anthropic:{pageAge:(I=K.page_age)!=null?I:null}}})}else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:X.content.error_code}});return}case"code_execution_tool_result":{if(X.content.type==="code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,stdout:X.content.stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(o=X.content.content)!=null?o:[]}});else if(X.content.type==="encrypted_code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,encrypted_stdout:X.content.encrypted_stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(t=X.content.content)!=null?t:[]}});else if(X.content.type==="code_execution_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:X.content.error_code}});return}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:X.content});return}case"tool_search_tool_result":{let K=e[X.tool_use_id];if(K==null){let _=F.toCustomToolName("tool_search_tool_bm25"),$G=F.toCustomToolName("tool_search_tool_regex");if(_!=="tool_search_tool_bm25")K="tool_search_tool_bm25";else if($G!=="tool_search_tool_regex")K="tool_search_tool_regex";else K="tool_search_tool_regex"}if(X.content.type==="tool_search_tool_search_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),result:X.content.tool_references.map((_)=>({type:_.type,toolName:_.tool_name}))});else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:X.content.error_code}});return}case"mcp_tool_use":{O[X.id]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:JSON.stringify(X.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:X.server_name}}},V.enqueue(O[X.id]);return}case"mcp_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:O[X.tool_use_id].toolName,isError:X.is_error,result:X.content,dynamic:!0,providerMetadata:O[X.tool_use_id].providerMetadata});return}default:throw Error(`Unsupported content block type: ${f}`)}}case"content_block_stop":{if(m[$.index]!=null){let X=m[$.index];switch(X.type){case"text":{V.enqueue({type:"text-end",id:String($.index)});break}case"reasoning":{V.enqueue({type:"reasoning-end",id:String($.index)});break}case"tool-call":if(!(b&&X.toolName==="json")){V.enqueue({type:"tool-input-end",id:X.toolCallId});let K=X.input===""?"{}":X.input;if(X.providerToolName==="code_execution")try{let _=JSON.parse(K);if(_!=null&&typeof _==="object"&&"code"in _&&!("type"in _))K=JSON.stringify({type:"programmatic-tool-call",..._})}catch(_){}V.enqueue({type:"tool-call",toolCallId:X.toolCallId,toolName:X.toolName,input:K,providerExecuted:X.providerExecuted,...c&&X.providerToolName==="code_execution"?{dynamic:!0}:{},...X.caller&&{providerMetadata:{anthropic:{caller:X.caller}}}})}break}delete m[$.index]}M=void 0;return}case"content_block_delta":{let X=$.delta.type;switch(X){case"text_delta":{if(b)return;V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.text});return}case"thinking_delta":{V.enqueue({type:"reasoning-delta",id:String($.index),delta:$.delta.thinking});return}case"signature_delta":{if(M==="thinking")V.enqueue({type:"reasoning-delta",id:String($.index),delta:"",providerMetadata:{anthropic:{signature:$.delta.signature}}});return}case"compaction_delta":{if($.delta.content!=null)V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.content});return}case"input_json_delta":{let f=m[$.index],K=$.delta.partial_json;if(K.length===0)return;if(j){if((f==null?void 0:f.type)!=="text")return;V.enqueue({type:"text-delta",id:String($.index),delta:K})}else{if((f==null?void 0:f.type)!=="tool-call")return;if(f.firstDelta&&(f.providerToolName==="bash_code_execution"||f.providerToolName==="text_editor_code_execution"))K=`{"type": "${f.providerToolName}",${K.substring(1)}`;V.enqueue({type:"tool-input-delta",id:f.toolCallId,delta:K}),f.input+=K,f.firstDelta=!1}return}case"citations_delta":{let f=$.delta.citation,K=BG(f,N,p);if(K)V.enqueue(K);return}default:throw Error(`Unsupported delta type: ${X}`)}}case"message_start":{if(g.input_tokens=$.message.usage.input_tokens,g.cache_read_input_tokens=(r=$.message.usage.cache_read_input_tokens)!=null?r:0,g.cache_creation_input_tokens=(i=$.message.usage.cache_creation_input_tokens)!=null?i:0,s={...$.message.usage},QG=(x=$.message.usage.cache_creation_input_tokens)!=null?x:null,$.message.container!=null)Y={expiresAt:$.message.container.expires_at,id:$.message.container.id,skills:null};if($.message.stop_reason!=null)B={unified:JG({finishReason:$.message.stop_reason,isJsonResponseFromTool:j}),raw:$.message.stop_reason};if(V.enqueue({type:"response-metadata",id:(n=$.message.id)!=null?n:void 0,modelId:(z=$.message.model)!=null?z:void 0}),$.message.content!=null)for(let X=0;X<$.message.content.length;X++){let f=$.message.content[X];if(f.type==="tool_use"){let K=f.caller,_=K?{type:K.type,toolId:"tool_id"in K?K.tool_id:void 0}:void 0;V.enqueue({type:"tool-input-start",id:f.id,toolName:f.name});let $G=JSON.stringify((d=f.input)!=null?d:{});V.enqueue({type:"tool-input-delta",id:f.id,delta:$G}),V.enqueue({type:"tool-input-end",id:f.id}),V.enqueue({type:"tool-call",toolCallId:f.id,toolName:f.name,input:$G,..._&&{providerMetadata:{anthropic:{caller:_}}}})}}return}case"message_delta":{if($.usage.input_tokens!=null&&g.input_tokens!==$.usage.input_tokens)g.input_tokens=$.usage.input_tokens;if(g.output_tokens=$.usage.output_tokens,$.usage.cache_read_input_tokens!=null)g.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.cache_creation_input_tokens!=null)g.cache_creation_input_tokens=$.usage.cache_creation_input_tokens,QG=$.usage.cache_creation_input_tokens;if($.usage.iterations!=null)g.iterations=$.usage.iterations;if(B={unified:JG({finishReason:$.delta.stop_reason,isJsonResponseFromTool:j}),raw:(P=$.delta.stop_reason)!=null?P:void 0},YG=(U=$.delta.stop_sequence)!=null?U:null,Y=$.delta.container!=null?{expiresAt:$.delta.container.expires_at,id:$.delta.container.id,skills:(A=(D=$.delta.container.skills)==null?void 0:D.map((X)=>({type:X.type,skillId:X.skill_id,version:X.version})))!=null?A:null}:null,$.context_management)C=wG($.context_management);s={...s,...$.usage};return}case"message_stop":{let X={usage:s!=null?s:null,cacheCreationInputTokens:QG,stopSequence:YG,iterations:g.iterations?g.iterations.map((K)=>({type:K.type,inputTokens:K.input_tokens,outputTokens:K.output_tokens})):null,container:Y,contextManagement:C},f={anthropic:X};if(w&&h!=="anthropic")f[h]=X;V.enqueue({type:"finish",finishReason:B,usage:fG({usage:g,rawUsage:s}),providerMetadata:f});return}case"error":{V.enqueue({type:"error",error:$.error});return}default:throw Error(`Unsupported chunk type: ${$}`)}}})),[zG,L]=XG.tee(),v=zG.getReader();try{await v.read();let k=await v.read();if(((H=k.value)==null?void 0:H.type)==="raw")k=await v.read();if(((Z=k.value)==null?void 0:Z.type)==="error"){let V=k.value.error;throw new NG({message:V.message,url:R,requestBodyValues:q,statusCode:V.type==="overloaded_error"?529:500,responseHeaders:a,responseBody:JSON.stringify(V),isRetryable:V.type==="overloaded_error"})}}finally{v.cancel().catch(()=>{}),v.releaseLock()}return{stream:L,request:{body:q},response:{headers:a}}}};function uQ(Q){if(Q.includes("claude-opus-4-7"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!0,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-6")||Q.includes("claude-opus-4-6"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-5")||Q.includes("claude-opus-4-5")||Q.includes("claude-haiku-4-5"))return{maxOutputTokens:64000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-1"))return{maxOutputTokens:32000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-"))return{maxOutputTokens:64000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-"))return{maxOutputTokens:32000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-3-haiku"))return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!1}}function IG(Q){if(!Q)return!1;let H=!1,Z=!1;for(let q of Q){if("type"in q&&(q.type==="web_fetch_20260209"||q.type==="web_search_20260209")){H=!0;continue}if(q.name==="code_execution"){Z=!0;break}}return H&&!Z}function wG(Q){return Q?{appliedEdits:Q.applied_edits.map((H)=>{switch(H.type){case"clear_tool_uses_20250919":return{type:H.type,clearedToolUses:H.cleared_tool_uses,clearedInputTokens:H.cleared_input_tokens};case"clear_thinking_20251015":return{type:H.type,clearedThinkingTurns:H.cleared_thinking_turns,clearedInputTokens:H.cleared_input_tokens};case"compact_20260112":return{type:H.type}}}).filter((H)=>H!==void 0)}:null}var cQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),iQ=u({id:"anthropic.bash_20241022",inputSchema:cQ}),lQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),sQ=u({id:"anthropic.bash_20250124",inputSchema:lQ}),pQ=J(()=>W(G.object({action:G.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:G.array(G.number().int()).optional(),text:G.string().optional()}))),nQ=u({id:"anthropic.computer_20241022",inputSchema:pQ}),rQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),aQ=u({id:"anthropic.computer_20250124",inputSchema:rQ}),eQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot","zoom"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),region:G.tuple([G.number().int(),G.number().int(),G.number().int(),G.number().int()]).optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),oQ=u({id:"anthropic.computer_20251124",inputSchema:eQ}),tQ=J(()=>W(G.discriminatedUnion("command",[G.object({command:G.literal("view"),path:G.string(),view_range:G.tuple([G.number(),G.number()]).optional()}),G.object({command:G.literal("create"),path:G.string(),file_text:G.string()}),G.object({command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()}),G.object({command:G.literal("insert"),path:G.string(),insert_line:G.number(),insert_text:G.string()}),G.object({command:G.literal("delete"),path:G.string()}),G.object({command:G.literal("rename"),old_path:G.string(),new_path:G.string()})]))),GX=u({id:"anthropic.memory_20250818",inputSchema:tQ}),QX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),XX=u({id:"anthropic.text_editor_20241022",inputSchema:QX}),YX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZX=u({id:"anthropic.text_editor_20250124",inputSchema:YX}),$X=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),zX=u({id:"anthropic.text_editor_20250429",inputSchema:$X}),LX=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),HX=J(()=>W(G.object({query:G.string(),limit:G.number().optional()}))),qX=l({id:"anthropic.tool_search_bm25_20251119",inputSchema:HX,outputSchema:LX,supportsDeferredResults:!0}),AX=(Q={})=>{return qX(Q)},KX={bash_20241022:iQ,bash_20250124:sQ,codeExecution_20250522:IQ,codeExecution_20250825:MQ,codeExecution_20260120:TQ,computer_20241022:nQ,computer_20250124:aQ,computer_20251124:oQ,memory_20250818:GX,textEditor_20241022:XX,textEditor_20250124:ZX,textEditor_20250429:zX,textEditor_20250728:$Q,webFetch_20250910:xQ,webFetch_20260209:EQ,webSearch_20250305:WQ,webSearch_20260209:AQ,toolSearchRegex_20251119:vQ,toolSearchBm25_20251119:AX};function DX(Q={}){var H,Z;let q=(H=dG(_G({settingValue:Q.baseURL,environmentVariableName:"ANTHROPIC_BASE_URL"})))!=null?H:"https://api.anthropic.com/v1",E=(Z=Q.name)!=null?Z:"anthropic.messages";if(Q.apiKey&&Q.authToken)throw new MG({argument:"apiKey/authToken",message:"Both apiKey and authToken were provided. Please use only one authentication method."});let T=()=>{let h=Q.authToken?{Authorization:`Bearer ${Q.authToken}`}:{"x-api-key":vG({apiKey:Q.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"})};return OG({"anthropic-version":"2023-06-01",...h,...Q.headers},`ai-sdk/anthropic/${aG}`)},b=(h)=>{var w;return new dQ(h,{provider:E,baseURL:q,headers:T,fetch:Q.fetch,generateId:(w=Q.generateId)!=null?w:AG,supportedUrls:()=>({"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]})})},F=function(h){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return b(h)};return F.specificationVersion="v3",F.languageModel=b,F.chat=b,F.messages=b,F.embeddingModel=(h)=>{throw new WG({modelId:h,modelType:"embeddingModel"})},F.textEmbeddingModel=F.embeddingModel,F.imageModel=(h)=>{throw new WG({modelId:h,modelType:"imageModel"})},F.tools=KX,F}var KY=DX();function DY({steps:Q}){var H,Z,q;for(let E=Q.length-1;E>=0;E--){let T=(q=(Z=(H=Q[E].providerMetadata)==null?void 0:H.anthropic)==null?void 0:Z.container)==null?void 0:q.id;if(T)return{providerOptions:{anthropic:{container:{id:T}}}}}return}export{DY as forwardAnthropicContainerIdFromLastStep,DX as createAnthropic,KY as anthropic,aG as VERSION};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{xd as a}from"./chunk-zfd70p01.js";import"./chunk-bzgj60w4.js";import"./chunk-
|
|
2
|
+
import{xd as a}from"./chunk-zfd70p01.js";import"./chunk-bzgj60w4.js";import"./chunk-aztre27e.js";export{a as dict};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-yjj4cvqg.js";var e={"ui.sessionReview.title":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0438","ui.sessionReview.title.lastTurn":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0445\u043E\u0434\u0430","ui.sessionReview.diffStyle.unified":"\u041E\u0431\u044A\u0435\u0434\u0438\u043D\u0451\u043D\u043D\u044B\u0439","ui.sessionReview.diffStyle.split":"\u0420\u0430\u0437\u0434\u0435\u043B\u0451\u043D\u043D\u044B\u0439","ui.sessionReview.openFile":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0444\u0430\u0439\u043B","ui.sessionReview.selection.line":"\u0441\u0442\u0440\u043E\u043A\u0430 {{line}}","ui.sessionReview.selection.lines":"\u0441\u0442\u0440\u043E\u043A\u0438 {{start}}-{{end}}","ui.sessionReview.expandAll":"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0451","ui.sessionReview.collapseAll":"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0451","ui.sessionReview.change.added":"\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E","ui.sessionReview.change.removed":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E","ui.sessionReview.change.modified":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u043E","ui.sessionReview.image.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...","ui.sessionReview.image.placeholder":"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435","ui.sessionReview.largeDiff.title":"Diff \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439 \u0434\u043B\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","ui.sessionReview.largeDiff.meta":"\u041B\u0438\u043C\u0438\u0442: {{limit}} \u0438\u0437\u043C\u0435\u043D\u0451\u043D\u043D\u044B\u0445 \u0441\u0442\u0440\u043E\u043A. \u0422\u0435\u043A\u0443\u0449\u0438\u0439: {{current}} \u0438\u0437\u043C\u0435\u043D\u0451\u043D\u043D\u044B\u0445 \u0441\u0442\u0440\u043E\u043A.","ui.sessionReview.largeDiff.renderAnyway":"\u041E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E","ui.fileMedia.kind.image":"\u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435","ui.fileMedia.kind.audio":"\u0430\u0443\u0434\u0438\u043E","ui.fileMedia.state.removed":"{{kind}} \u0443\u0434\u0430\u043B\u0435\u043D\u043E","ui.fileMedia.state.loading":"\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F {{kind}}...","ui.fileMedia.state.error":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C {{kind}}","ui.fileMedia.state.unavailable":"{{kind}} \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E","ui.fileMedia.binary.title":"\u0411\u0438\u043D\u0430\u0440\u043D\u044B\u0439 \u0444\u0430\u0439\u043B","ui.fileMedia.binary.description.path":"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C {{path}}, \u0442\u0430\u043A \u043A\u0430\u043A \u044D\u0442\u043E \u0431\u0438\u043D\u0430\u0440\u043D\u044B\u0439 \u0444\u0430\u0439\u043B.","ui.fileMedia.binary.description.default":"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C \u044D\u0442\u043E\u0442 \u0444\u0430\u0439\u043B, \u0442\u0430\u043A \u043A\u0430\u043A \u043E\u043D \u0431\u0438\u043D\u0430\u0440\u043D\u044B\u0439.","ui.lineComment.label.prefix":"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435: ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439","ui.lineComment.submit":"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C","ui.sessionTurn.steps.show":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0448\u0430\u0433\u0438","ui.sessionTurn.steps.hide":"\u0421\u043A\u0440\u044B\u0442\u044C \u0448\u0430\u0433\u0438","ui.sessionTurn.summary.response":"\u041E\u0442\u0432\u0435\u0442","ui.sessionTurn.diff.showMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439 ({{count}})","ui.sessionTurn.retry.retrying":"\u043F\u043E\u0432\u0442\u043E\u0440","ui.sessionTurn.retry.inSeconds":"\u0447\u0435\u0440\u0435\u0437 {{seconds}}\u0441","ui.sessionTurn.retry.attempt":"\u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u2116{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u2116{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini \u0441\u0435\u0439\u0447\u0430\u0441 \u043F\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043D","ui.sessionTurn.error.freeUsageExceeded":"\u041B\u0438\u043C\u0438\u0442 \u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u0440\u0435\u0432\u044B\u0448\u0435\u043D","ui.sessionTurn.error.addQredits":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u044B","ui.sessionTurn.status.delegating":"\u0414\u0435\u043B\u0435\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0442\u044B","ui.sessionTurn.status.planning":"\u041F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0445 \u0448\u0430\u0433\u043E\u0432","ui.sessionTurn.status.gatheringContext":"\u0418\u0441\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u0435","ui.sessionTurn.status.gatheredContext":"\u0418\u0441\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u043E","ui.sessionTurn.status.searchingCodebase":"\u041F\u043E\u0438\u0441\u043A \u0432 \u043A\u043E\u0434\u043E\u0432\u043E\u0439 \u0431\u0430\u0437\u0435","ui.sessionTurn.status.searchingWeb":"\u041F\u043E\u0438\u0441\u043A \u0432 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0435","ui.sessionTurn.status.makingEdits":"\u0412\u043D\u0435\u0441\u0435\u043D\u0438\u0435 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439","ui.sessionTurn.status.runningCommands":"\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u043A\u043E\u043C\u0430\u043D\u0434","ui.sessionTurn.status.thinking":"\u0420\u0430\u0437\u043C\u044B\u0448\u043B\u0435\u043D\u0438\u0435","ui.sessionTurn.status.thinkingWithTopic":"\u0420\u0430\u0437\u043C\u044B\u0448\u043B\u0435\u043D\u0438\u0435 - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"\u0421\u0431\u043E\u0440 \u043C\u044B\u0441\u043B\u0435\u0439","ui.sessionTurn.status.consideringNextSteps":"\u0420\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u0435 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0445 \u0448\u0430\u0433\u043E\u0432","ui.messagePart.questions.dismissed":"\u0412\u043E\u043F\u0440\u043E\u0441\u044B \u043E\u0442\u043A\u043B\u043E\u043D\u0435\u043D\u044B","ui.messagePart.compaction":"\u0421\u0435\u0441\u0441\u0438\u044F \u0441\u0436\u0430\u0442\u0430","ui.messagePart.context.read.one":"{{count}} \u0447\u0442\u0435\u043D\u0438\u0435","ui.messagePart.context.read.other":"{{count}} \u0447\u0442\u0435\u043D\u0438\u0439","ui.messagePart.context.search.one":"{{count}} \u043F\u043E\u0438\u0441\u043A","ui.messagePart.context.search.other":"{{count}} \u043F\u043E\u0438\u0441\u043A\u043E\u0432","ui.messagePart.context.list.one":"{{count}} \u0441\u043F\u0438\u0441\u043E\u043A","ui.messagePart.context.list.other":"{{count}} \u0441\u043F\u0438\u0441\u043A\u043E\u0432","ui.messagePart.diagnostic.error":"\u041E\u0448\u0438\u0431\u043A\u0430","ui.messagePart.title.edit":"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C","ui.messagePart.title.write":"\u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C","ui.messagePart.option.typeOwnAnswer":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0432\u043E\u0439 \u043E\u0442\u0432\u0435\u0442","ui.messagePart.review.title":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0432\u0430\u0448\u0438 \u043E\u0442\u0432\u0435\u0442\u044B","ui.list.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430","ui.list.empty":"\u041D\u0435\u0442 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432","ui.list.clearFilter":"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440","ui.list.emptyWithFilter.prefix":"\u041D\u0435\u0442 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432 \u0434\u043B\u044F","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"\u041D\u043E\u0432\u043E\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.textField.copyToClipboard":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430","ui.textField.copyLink":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443","ui.textField.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","ui.imagePreview.alt":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","ui.scrollView.ariaLabel":"\u043F\u0440\u043E\u043A\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442","ui.tool.read":"\u0427\u0442\u0435\u043D\u0438\u0435","ui.tool.loaded":"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043E","ui.tool.list":"\u0421\u043F\u0438\u0441\u043E\u043A","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"\u0412\u0435\u0431-\u043F\u043E\u0438\u0441\u043A","ui.tool.codesearch":"\u041F\u043E\u0438\u0441\u043A \u043A\u043E\u0434\u0430","ui.tool.shell":"\u041E\u0431\u043E\u043B\u043E\u0447\u043A\u0430","ui.tool.patch":"\u041F\u0430\u0442\u0447","ui.tool.todos":"\u0417\u0430\u0434\u0430\u0447\u0438","ui.tool.todos.read":"\u0427\u0438\u0442\u0430\u0442\u044C \u0437\u0430\u0434\u0430\u0447\u0438","ui.tool.questions":"\u0412\u043E\u043F\u0440\u043E\u0441\u044B","ui.tool.agent":"\u0410\u0433\u0435\u043D\u0442 {{type}}","ui.tool.agent.default":"\u0410\u0433\u0435\u043D\u0442","ui.common.file.one":"\u0444\u0430\u0439\u043B","ui.common.file.other":"\u0444\u0430\u0439\u043B\u043E\u0432","ui.common.question.one":"\u0432\u043E\u043F\u0440\u043E\u0441","ui.common.question.other":"\u0432\u043E\u043F\u0440\u043E\u0441\u043E\u0432","ui.common.add":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C","ui.common.back":"\u041D\u0430\u0437\u0430\u0434","ui.common.cancel":"\u041E\u0442\u043C\u0435\u043D\u0430","ui.common.confirm":"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C","ui.common.dismiss":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","ui.common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","ui.common.next":"\u0414\u0430\u043B\u0435\u0435","ui.common.submit":"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C","ui.permission.deny":"\u0417\u0430\u043F\u0440\u0435\u0442\u0438\u0442\u044C","ui.permission.allowAlways":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u0432\u0441\u0435\u0433\u0434\u0430","ui.permission.allowOnce":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043E\u0434\u0438\u043D \u0440\u0430\u0437","ui.message.expand":"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.message.collapse":"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.message.copy":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","ui.message.copyMessage":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.message.forkMessage":"\u041E\u0442\u0432\u0435\u0442\u0432\u0438\u0442\u044C \u0432 \u043D\u043E\u0432\u0443\u044E \u0441\u0435\u0441\u0441\u0438\u044E","ui.message.revertMessage":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u043E \u044D\u0442\u043E\u0433\u043E \u043C\u043E\u043C\u0435\u043D\u0442\u0430","ui.message.copyResponse":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043E\u0442\u0432\u0435\u0442","ui.message.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E!","ui.message.interrupted":"\u041F\u0440\u0435\u0440\u0432\u0430\u043D\u043E","ui.message.queued":"\u0412 \u043E\u0447\u0435\u0440\u0435\u0434\u0438","ui.message.attachment.alt":"\u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0435","ui.patch.action.deleted":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E","ui.patch.action.created":"\u0421\u043E\u0437\u0434\u0430\u043D\u043E","ui.patch.action.moved":"\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u043E","ui.patch.action.patched":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u043E","ui.question.subtitle.answered":"{{count}} \u043E\u0442\u0432\u0435\u0447\u0435\u043D\u043E","ui.question.answer.none":"(\u043D\u0435\u0442 \u043E\u0442\u0432\u0435\u0442\u0430)","ui.question.review.notAnswered":"(\u043D\u0435 \u043E\u0442\u0432\u0435\u0447\u0435\u043D\u043E)","ui.question.multiHint":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0441\u0435 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0435","ui.question.singleHint":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0434\u0438\u043D \u043E\u0442\u0432\u0435\u0442","ui.question.custom.placeholder":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u0430\u0448 \u043E\u0442\u0432\u0435\u0442...","ui.fileSearch.placeholder":"\u041D\u0430\u0439\u0442\u0438","ui.fileSearch.previousMatch":"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435","ui.fileSearch.nextMatch":"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435","ui.fileSearch.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u0438\u0441\u043A","ui.tool.task":"\u0417\u0430\u0434\u0430\u0447\u0430","ui.tool.skill":"\u041D\u0430\u0432\u044B\u043A","ui.basicTool.called":"\u0412\u044B\u0437\u0432\u0430\u043D `{{tool}}`","ui.toolErrorCard.failed":"\u041E\u0448\u0438\u0431\u043A\u0430","ui.toolErrorCard.copyError":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443","ui.message.duration.seconds":"{{count}}\u0441","ui.message.duration.minutesSeconds":"{{minutes}}\u043C {{seconds}}\u0441"};export{e as dict};
|
|
2
|
+
import"./chunk-aztre27e.js";var e={"ui.sessionReview.title":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0438","ui.sessionReview.title.lastTurn":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0445\u043E\u0434\u0430","ui.sessionReview.diffStyle.unified":"\u041E\u0431\u044A\u0435\u0434\u0438\u043D\u0451\u043D\u043D\u044B\u0439","ui.sessionReview.diffStyle.split":"\u0420\u0430\u0437\u0434\u0435\u043B\u0451\u043D\u043D\u044B\u0439","ui.sessionReview.openFile":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0444\u0430\u0439\u043B","ui.sessionReview.selection.line":"\u0441\u0442\u0440\u043E\u043A\u0430 {{line}}","ui.sessionReview.selection.lines":"\u0441\u0442\u0440\u043E\u043A\u0438 {{start}}-{{end}}","ui.sessionReview.expandAll":"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0451","ui.sessionReview.collapseAll":"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0451","ui.sessionReview.change.added":"\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E","ui.sessionReview.change.removed":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E","ui.sessionReview.change.modified":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u043E","ui.sessionReview.image.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...","ui.sessionReview.image.placeholder":"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435","ui.sessionReview.largeDiff.title":"Diff \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439 \u0434\u043B\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","ui.sessionReview.largeDiff.meta":"\u041B\u0438\u043C\u0438\u0442: {{limit}} \u0438\u0437\u043C\u0435\u043D\u0451\u043D\u043D\u044B\u0445 \u0441\u0442\u0440\u043E\u043A. \u0422\u0435\u043A\u0443\u0449\u0438\u0439: {{current}} \u0438\u0437\u043C\u0435\u043D\u0451\u043D\u043D\u044B\u0445 \u0441\u0442\u0440\u043E\u043A.","ui.sessionReview.largeDiff.renderAnyway":"\u041E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E","ui.fileMedia.kind.image":"\u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435","ui.fileMedia.kind.audio":"\u0430\u0443\u0434\u0438\u043E","ui.fileMedia.state.removed":"{{kind}} \u0443\u0434\u0430\u043B\u0435\u043D\u043E","ui.fileMedia.state.loading":"\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F {{kind}}...","ui.fileMedia.state.error":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C {{kind}}","ui.fileMedia.state.unavailable":"{{kind}} \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E","ui.fileMedia.binary.title":"\u0411\u0438\u043D\u0430\u0440\u043D\u044B\u0439 \u0444\u0430\u0439\u043B","ui.fileMedia.binary.description.path":"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C {{path}}, \u0442\u0430\u043A \u043A\u0430\u043A \u044D\u0442\u043E \u0431\u0438\u043D\u0430\u0440\u043D\u044B\u0439 \u0444\u0430\u0439\u043B.","ui.fileMedia.binary.description.default":"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C \u044D\u0442\u043E\u0442 \u0444\u0430\u0439\u043B, \u0442\u0430\u043A \u043A\u0430\u043A \u043E\u043D \u0431\u0438\u043D\u0430\u0440\u043D\u044B\u0439.","ui.lineComment.label.prefix":"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435: ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439","ui.lineComment.submit":"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C","ui.sessionTurn.steps.show":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0448\u0430\u0433\u0438","ui.sessionTurn.steps.hide":"\u0421\u043A\u0440\u044B\u0442\u044C \u0448\u0430\u0433\u0438","ui.sessionTurn.summary.response":"\u041E\u0442\u0432\u0435\u0442","ui.sessionTurn.diff.showMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439 ({{count}})","ui.sessionTurn.retry.retrying":"\u043F\u043E\u0432\u0442\u043E\u0440","ui.sessionTurn.retry.inSeconds":"\u0447\u0435\u0440\u0435\u0437 {{seconds}}\u0441","ui.sessionTurn.retry.attempt":"\u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u2116{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u2116{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini \u0441\u0435\u0439\u0447\u0430\u0441 \u043F\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043D","ui.sessionTurn.error.freeUsageExceeded":"\u041B\u0438\u043C\u0438\u0442 \u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u0440\u0435\u0432\u044B\u0448\u0435\u043D","ui.sessionTurn.error.addQredits":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u044B","ui.sessionTurn.status.delegating":"\u0414\u0435\u043B\u0435\u0433\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0442\u044B","ui.sessionTurn.status.planning":"\u041F\u043B\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0445 \u0448\u0430\u0433\u043E\u0432","ui.sessionTurn.status.gatheringContext":"\u0418\u0441\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u0435","ui.sessionTurn.status.gatheredContext":"\u0418\u0441\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u043E","ui.sessionTurn.status.searchingCodebase":"\u041F\u043E\u0438\u0441\u043A \u0432 \u043A\u043E\u0434\u043E\u0432\u043E\u0439 \u0431\u0430\u0437\u0435","ui.sessionTurn.status.searchingWeb":"\u041F\u043E\u0438\u0441\u043A \u0432 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442\u0435","ui.sessionTurn.status.makingEdits":"\u0412\u043D\u0435\u0441\u0435\u043D\u0438\u0435 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439","ui.sessionTurn.status.runningCommands":"\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u043A\u043E\u043C\u0430\u043D\u0434","ui.sessionTurn.status.thinking":"\u0420\u0430\u0437\u043C\u044B\u0448\u043B\u0435\u043D\u0438\u0435","ui.sessionTurn.status.thinkingWithTopic":"\u0420\u0430\u0437\u043C\u044B\u0448\u043B\u0435\u043D\u0438\u0435 - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"\u0421\u0431\u043E\u0440 \u043C\u044B\u0441\u043B\u0435\u0439","ui.sessionTurn.status.consideringNextSteps":"\u0420\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u0435 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0445 \u0448\u0430\u0433\u043E\u0432","ui.messagePart.questions.dismissed":"\u0412\u043E\u043F\u0440\u043E\u0441\u044B \u043E\u0442\u043A\u043B\u043E\u043D\u0435\u043D\u044B","ui.messagePart.compaction":"\u0421\u0435\u0441\u0441\u0438\u044F \u0441\u0436\u0430\u0442\u0430","ui.messagePart.context.read.one":"{{count}} \u0447\u0442\u0435\u043D\u0438\u0435","ui.messagePart.context.read.other":"{{count}} \u0447\u0442\u0435\u043D\u0438\u0439","ui.messagePart.context.search.one":"{{count}} \u043F\u043E\u0438\u0441\u043A","ui.messagePart.context.search.other":"{{count}} \u043F\u043E\u0438\u0441\u043A\u043E\u0432","ui.messagePart.context.list.one":"{{count}} \u0441\u043F\u0438\u0441\u043E\u043A","ui.messagePart.context.list.other":"{{count}} \u0441\u043F\u0438\u0441\u043A\u043E\u0432","ui.messagePart.diagnostic.error":"\u041E\u0448\u0438\u0431\u043A\u0430","ui.messagePart.title.edit":"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C","ui.messagePart.title.write":"\u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C","ui.messagePart.option.typeOwnAnswer":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0432\u043E\u0439 \u043E\u0442\u0432\u0435\u0442","ui.messagePart.review.title":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0432\u0430\u0448\u0438 \u043E\u0442\u0432\u0435\u0442\u044B","ui.list.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430","ui.list.empty":"\u041D\u0435\u0442 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432","ui.list.clearFilter":"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440","ui.list.emptyWithFilter.prefix":"\u041D\u0435\u0442 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432 \u0434\u043B\u044F","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"\u041D\u043E\u0432\u043E\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.textField.copyToClipboard":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430","ui.textField.copyLink":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443","ui.textField.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","ui.imagePreview.alt":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","ui.scrollView.ariaLabel":"\u043F\u0440\u043E\u043A\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442","ui.tool.read":"\u0427\u0442\u0435\u043D\u0438\u0435","ui.tool.loaded":"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043E","ui.tool.list":"\u0421\u043F\u0438\u0441\u043E\u043A","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"\u0412\u0435\u0431-\u043F\u043E\u0438\u0441\u043A","ui.tool.codesearch":"\u041F\u043E\u0438\u0441\u043A \u043A\u043E\u0434\u0430","ui.tool.shell":"\u041E\u0431\u043E\u043B\u043E\u0447\u043A\u0430","ui.tool.patch":"\u041F\u0430\u0442\u0447","ui.tool.todos":"\u0417\u0430\u0434\u0430\u0447\u0438","ui.tool.todos.read":"\u0427\u0438\u0442\u0430\u0442\u044C \u0437\u0430\u0434\u0430\u0447\u0438","ui.tool.questions":"\u0412\u043E\u043F\u0440\u043E\u0441\u044B","ui.tool.agent":"\u0410\u0433\u0435\u043D\u0442 {{type}}","ui.tool.agent.default":"\u0410\u0433\u0435\u043D\u0442","ui.common.file.one":"\u0444\u0430\u0439\u043B","ui.common.file.other":"\u0444\u0430\u0439\u043B\u043E\u0432","ui.common.question.one":"\u0432\u043E\u043F\u0440\u043E\u0441","ui.common.question.other":"\u0432\u043E\u043F\u0440\u043E\u0441\u043E\u0432","ui.common.add":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C","ui.common.back":"\u041D\u0430\u0437\u0430\u0434","ui.common.cancel":"\u041E\u0442\u043C\u0435\u043D\u0430","ui.common.confirm":"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C","ui.common.dismiss":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","ui.common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","ui.common.next":"\u0414\u0430\u043B\u0435\u0435","ui.common.submit":"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C","ui.permission.deny":"\u0417\u0430\u043F\u0440\u0435\u0442\u0438\u0442\u044C","ui.permission.allowAlways":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u0432\u0441\u0435\u0433\u0434\u0430","ui.permission.allowOnce":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043E\u0434\u0438\u043D \u0440\u0430\u0437","ui.message.expand":"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.message.collapse":"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.message.copy":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","ui.message.copyMessage":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","ui.message.forkMessage":"\u041E\u0442\u0432\u0435\u0442\u0432\u0438\u0442\u044C \u0432 \u043D\u043E\u0432\u0443\u044E \u0441\u0435\u0441\u0441\u0438\u044E","ui.message.revertMessage":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u043E \u044D\u0442\u043E\u0433\u043E \u043C\u043E\u043C\u0435\u043D\u0442\u0430","ui.message.copyResponse":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043E\u0442\u0432\u0435\u0442","ui.message.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E!","ui.message.interrupted":"\u041F\u0440\u0435\u0440\u0432\u0430\u043D\u043E","ui.message.queued":"\u0412 \u043E\u0447\u0435\u0440\u0435\u0434\u0438","ui.message.attachment.alt":"\u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0435","ui.patch.action.deleted":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E","ui.patch.action.created":"\u0421\u043E\u0437\u0434\u0430\u043D\u043E","ui.patch.action.moved":"\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u043E","ui.patch.action.patched":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u043E","ui.question.subtitle.answered":"{{count}} \u043E\u0442\u0432\u0435\u0447\u0435\u043D\u043E","ui.question.answer.none":"(\u043D\u0435\u0442 \u043E\u0442\u0432\u0435\u0442\u0430)","ui.question.review.notAnswered":"(\u043D\u0435 \u043E\u0442\u0432\u0435\u0447\u0435\u043D\u043E)","ui.question.multiHint":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0441\u0435 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0435","ui.question.singleHint":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0434\u0438\u043D \u043E\u0442\u0432\u0435\u0442","ui.question.custom.placeholder":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u0430\u0448 \u043E\u0442\u0432\u0435\u0442...","ui.fileSearch.placeholder":"\u041D\u0430\u0439\u0442\u0438","ui.fileSearch.previousMatch":"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435","ui.fileSearch.nextMatch":"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435","ui.fileSearch.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u0438\u0441\u043A","ui.tool.task":"\u0417\u0430\u0434\u0430\u0447\u0430","ui.tool.skill":"\u041D\u0430\u0432\u044B\u043A","ui.basicTool.called":"\u0412\u044B\u0437\u0432\u0430\u043D `{{tool}}`","ui.toolErrorCard.failed":"\u041E\u0448\u0438\u0431\u043A\u0430","ui.toolErrorCard.copyError":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443","ui.message.duration.seconds":"{{count}}\u0441","ui.message.duration.minutesSeconds":"{{minutes}}\u043C {{seconds}}\u0441"};export{e as dict};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Be as oe}from"./chunk-
|
|
2
|
+
import{Be as oe}from"./chunk-j9pcnkkq.js";import{wf as _}from"./chunk-cvdxgsq1.js";import{$P as m,dQ as ee}from"./chunk-aztre27e.js";var p=m(_(),1);var K=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var R=m(oe(),1);var c=m(_(),1);var b=300000,k="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var H=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-chmrvbbj.js"),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var U=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-chmrvbbj.js");return(await H(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var q=m(_(),1);var C=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new q.TokenProviderError(`Token is expired. ${k}`,!1)};var W=m(_(),1);var w=(e,o,r=!1)=>{if(typeof o>"u")throw new W.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${k}`,!1)};var j=m(_(),1);import{promises as Q}from"fs";var{writeFile:Z}=Q,X=(e,o)=>{let r=j.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return Z(r,t)};var z=new Date(0),J=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await c.parseKnownFiles(e),t=c.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new c.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new c.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,S=(await c.loadSsoSessionData(e))[a];if(!S)throw new c.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!S[i])throw new c.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:g,sso_region:O}=S,s;try{s=await c.getSSOTokenFromFile(a)}catch(i){throw new c.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${k}`,!1)}w("accessToken",s.accessToken),w("expiresAt",s.expiresAt);let{accessToken:x,expiresAt:T}=s,l={token:x,expiration:new Date(T)};if(l.expiration.getTime()-Date.now()>b)return l;if(Date.now()-z.getTime()<30000)return C(l),l;w("clientId",s.clientId,!0),w("clientSecret",s.clientSecret,!0),w("refreshToken",s.refreshToken,!0);try{z.setTime(Date.now());let i=await U(s,O,e,o);w("accessToken",i.accessToken),w("expiresIn",i.expiresIn);let y=new Date(Date.now()+i.expiresIn*1000);try{await X(a,{...s,accessToken:i.accessToken,expiresAt:y.toISOString(),refreshToken:i.refreshToken})}catch(I){}return{token:i.accessToken,expiration:y}}catch(i){return C(l),l}};var d=m(_(),1),E=!1,v=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:S,callerClientConfig:g,profile:O,filepath:s,configFilepath:x,ignoreCache:T,logger:l})=>{let i,y="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let h=await J({profile:O,filepath:s,configFilepath:x,ignoreCache:T})();i={accessToken:h.token,expiresAt:new Date(h.expiration).toISOString()}}catch(h){throw new d.CredentialsProviderError(h.message,{tryNextLink:E,logger:l})}else try{i=await d.getSSOTokenFromFile(e)}catch(h){throw new d.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new d.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:l});let{accessToken:I}=i,{SSOClient:u,GetRoleCredentialsCommand:A}=await import("./chunk-cdhmc0t0.js"),B=a||new u(Object.assign({},f??{},{logger:f?.logger??g?.logger??S?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??g?.userAgentAppId??S?.userAgentAppId})),F;try{F=await B.send(new A({accountId:r,roleName:n,accessToken:I}))}catch(h){throw new d.CredentialsProviderError(h,{tryNextLink:E,logger:l})}let{roleCredentials:{accessKeyId:P,secretAccessKey:D,sessionToken:$,expiration:L,credentialScope:M,accountId:G}={}}=F;if(!P||!D||!$||!L)throw new d.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:E,logger:l});let N={accessKeyId:P,secretAccessKey:D,sessionToken:$,expiration:new Date(L),...M&&{credentialScope:M},...G&&{accountId:G}};if(o)R.setCredentialFeature(N,"CREDENTIALS_SSO","s");else R.setCredentialFeature(N,"CREDENTIALS_SSO_LEGACY","u");return N};var V=m(_(),1),Y=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new V.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
|
|
3
3
|
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var Oe=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:f}=e,{ssoClient:S}=e,g=p.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!f){let s=(await p.parseKnownFiles(e))[g];if(!s)throw new p.CredentialsProviderError(`Profile ${g} was not found.`,{logger:e.logger});if(!K(s))throw new p.CredentialsProviderError(`Profile ${g} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let u=(await p.loadSsoSessionData(e))[s.sso_session],A=` configurations in profile ${g} and sso-session ${s.sso_session}`;if(n&&n!==u.sso_region)throw new p.CredentialsProviderError("Conflicting SSO region"+A,{tryNextLink:!1,logger:e.logger});if(r&&r!==u.sso_start_url)throw new p.CredentialsProviderError("Conflicting SSO start_url"+A,{tryNextLink:!1,logger:e.logger});s.sso_region=u.sso_region,s.sso_start_url=u.sso_start_url}let{sso_start_url:x,sso_account_id:T,sso_region:l,sso_role_name:i,sso_session:y}=Y(s,e.logger);return v({ssoStartUrl:x,ssoSession:y,ssoAccountId:T,ssoRegion:l,ssoRoleName:i,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:g,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!r||!t||!n||!a)throw new p.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return v({ssoStartUrl:r,ssoSession:f,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:g,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})};export{K as Sd,Y as Td,Oe as Ud};
|