@qitqode/qitqode-android-arm64 0.1.24 → 0.1.25
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-4kse3awh.js → chunk-0304b7xg.js} +1 -1
- package/bundle/{chunk-hqg5qbxk.js → chunk-08ba67f4.js} +1 -1
- package/bundle/chunk-0eneddjj.js +2 -0
- package/bundle/{chunk-6nhje520.js → chunk-0hsb4knd.js} +1 -1
- package/bundle/{chunk-bas6x25m.js → chunk-0jaxgrq0.js} +2 -2
- package/bundle/chunk-0ke6x10y.js +5 -0
- package/bundle/{chunk-hh4c02fh.js → chunk-0rmmg3g4.js} +1 -1
- package/bundle/chunk-0vqrakhw.js +3 -0
- package/bundle/{chunk-sgtgvzv6.js → chunk-0x7dbj5e.js} +1 -1
- package/bundle/{chunk-7yf15a3a.js → chunk-0xmx2zfg.js} +1 -1
- package/bundle/chunk-0yb4pxjv.js +2 -0
- package/bundle/chunk-129kq1w7.js +2 -0
- package/bundle/{chunk-8cr7ks31.js → chunk-14qvaxtp.js} +1 -1
- package/bundle/chunk-1a5hq7d5.js +2 -0
- package/bundle/{chunk-k16hzy2q.js → chunk-1ce5jpdc.js} +1 -1
- package/bundle/{chunk-xv8gnkh5.js → chunk-1e8mja6v.js} +1 -1
- package/bundle/{chunk-cy2586rv.js → chunk-1n1dh6zj.js} +1 -1
- package/bundle/{chunk-pb7rnkke.js → chunk-1txkz6dt.js} +1 -1
- package/bundle/chunk-1w3y1dkk.js +2 -0
- package/bundle/{chunk-v7r9np94.js → chunk-23f6rc7a.js} +1 -1
- package/bundle/chunk-26qt44f1.js +3 -0
- package/bundle/{chunk-6mscvf6y.js → chunk-2armxd20.js} +1 -1
- package/bundle/{chunk-21ejqv4v.js → chunk-2je5tp0x.js} +1 -1
- package/bundle/{chunk-0rtshz2r.js → chunk-2k2axg73.js} +1 -1
- package/bundle/chunk-2pkake0h.js +2 -0
- package/bundle/{chunk-7y3y3j51.js → chunk-2rxt1s22.js} +2 -2
- package/bundle/{chunk-te1zfpzv.js → chunk-2s28fdbp.js} +1 -1
- package/bundle/{chunk-8pe047p0.js → chunk-2sy1wx99.js} +1 -1
- package/bundle/{chunk-9easaxy7.js → chunk-2z35ewwc.js} +1 -1
- package/bundle/{chunk-zeh481tm.js → chunk-2zj3h3xj.js} +2 -2
- package/bundle/chunk-32188rww.js +2 -0
- package/bundle/chunk-334tc1rh.js +2 -0
- package/bundle/{chunk-tzc4jkzg.js → chunk-3dvyfmgc.js} +1 -1
- package/bundle/{chunk-q3x4x2tq.js → chunk-3e8p4a3y.js} +1 -1
- package/bundle/{chunk-7mhffm9f.js → chunk-3f054f69.js} +183 -183
- package/bundle/chunk-3ff94m8r.js +2 -0
- package/bundle/{chunk-7a6p7dfx.js → chunk-3fy57jcy.js} +1 -1
- package/bundle/{chunk-ve5gb789.js → chunk-3h08jdq8.js} +2 -2
- package/bundle/{chunk-w7p2x973.js → chunk-3j7skhxg.js} +2 -2
- package/bundle/{chunk-p4hpr8d7.js → chunk-3jhx8g5d.js} +1 -1
- package/bundle/{chunk-jr9xnvjq.js → chunk-3nhth7c2.js} +1 -1
- package/bundle/{chunk-8ace31r2.js → chunk-3tnek022.js} +1 -1
- package/bundle/{chunk-rvvfs9ps.js → chunk-3xna2rk5.js} +1 -1
- package/bundle/{chunk-k9d927xe.js → chunk-42t25nkb.js} +1 -1
- package/bundle/chunk-4aqd2bty.js +2 -0
- package/bundle/{chunk-am73j1bt.js → chunk-4kb2efq3.js} +1 -1
- package/bundle/{chunk-wmw2gne9.js → chunk-4pssh5d3.js} +2 -2
- package/bundle/{chunk-pyq01301.js → chunk-4stgw33j.js} +1 -1
- package/bundle/{chunk-k9g77a02.js → chunk-4w5t515p.js} +1 -1
- package/bundle/chunk-4wa0gf8y.js +28 -0
- package/bundle/{chunk-jegn6jc3.js → chunk-4wgb80jm.js} +2 -2
- package/bundle/{chunk-jbd9k041.js → chunk-4wyjapes.js} +2 -2
- package/bundle/chunk-4xg5ptk9.js +2 -0
- package/bundle/{chunk-23geekk5.js → chunk-54pk7nna.js} +1 -1
- package/bundle/chunk-58680z2j.js +3 -0
- package/bundle/{chunk-ygj1cy0n.js → chunk-5mdsrv0a.js} +1 -1
- package/bundle/{chunk-xj73j10a.js → chunk-5mp82az0.js} +1 -1
- package/bundle/chunk-5nm36wxa.js +2 -0
- package/bundle/{chunk-7tgm8wp5.js → chunk-5zw7knvd.js} +1 -1
- package/bundle/{chunk-yz7rqzby.js → chunk-61ks7c71.js} +3 -3
- package/bundle/chunk-64jet8nc.js +2 -0
- package/bundle/chunk-6584d9m8.js +2 -0
- package/bundle/chunk-66hv9bbw.js +2 -0
- package/bundle/{chunk-mj24ntn9.js → chunk-692vn48b.js} +1 -1
- package/bundle/chunk-6a1g6jzn.js +2 -0
- package/bundle/chunk-6be8p915.js +2 -0
- package/bundle/{chunk-8651hq0k.js → chunk-6ddp36ar.js} +1 -1
- package/bundle/chunk-6f03158n.js +2 -0
- package/bundle/{chunk-zavtsfxz.js → chunk-6gbaw2pk.js} +1 -1
- package/bundle/{chunk-5h2hcp46.js → chunk-6rrmjrm2.js} +1 -1
- package/bundle/{chunk-ps543k72.js → chunk-6s2f5sv4.js} +1 -1
- package/bundle/{chunk-9jf67xb0.js → chunk-754varfr.js} +2 -2
- package/bundle/{chunk-wa2ce2sg.js → chunk-78h5dd4t.js} +2 -2
- package/bundle/{chunk-4d1a547n.js → chunk-7d6jhzng.js} +1 -1
- package/bundle/{chunk-kc3hpmr2.js → chunk-7fx6x8x9.js} +2 -2
- package/bundle/chunk-7jnjttqx.js +2 -0
- package/bundle/{chunk-jz3aav8a.js → chunk-7q5srx7q.js} +2 -2
- package/bundle/chunk-7q8pa6s8.js +2 -0
- package/bundle/{chunk-vvypb02q.js → chunk-7qvkyjjg.js} +1 -1
- package/bundle/{chunk-8r79zf3y.js → chunk-7rjf9b8n.js} +2 -2
- package/bundle/{chunk-t488d66k.js → chunk-7v4fzkbb.js} +1 -1
- package/bundle/chunk-7w84hfxs.js +3 -0
- package/bundle/{chunk-8717htya.js → chunk-7ws3gdjq.js} +1 -1
- package/bundle/{chunk-va4davgy.js → chunk-87x607rz.js} +259 -253
- package/bundle/{chunk-vftqwdpg.js → chunk-8ahpk8td.js} +1 -1
- package/bundle/{chunk-9vcw33dv.js → chunk-8atry88r.js} +1 -1
- package/bundle/chunk-8casywce.js +2 -0
- package/bundle/{chunk-tsn1jkr7.js → chunk-8cty50g7.js} +1 -1
- package/bundle/{chunk-qywwj58s.js → chunk-8gy99gfb.js} +2 -2
- package/bundle/chunk-8hxwxt5p.js +2 -0
- package/bundle/{chunk-58enbars.js → chunk-8jcx4tep.js} +2 -2
- package/bundle/chunk-8y8140dm.js +2 -0
- package/bundle/{chunk-frdc3ysq.js → chunk-8za87zkr.js} +1 -1
- package/bundle/{chunk-2qcndbxv.js → chunk-99p5m2f1.js} +1 -1
- package/bundle/{chunk-y3n31nnx.js → chunk-9dpn4792.js} +2 -2
- package/bundle/chunk-9dqcyt6x.js +2 -0
- package/bundle/{chunk-7gczzccz.js → chunk-9f6pqped.js} +1 -1
- package/bundle/chunk-9he248a8.js +2 -0
- package/bundle/{chunk-8h9r6c8g.js → chunk-9jncnqbj.js} +2 -2
- package/bundle/{chunk-cvchztkc.js → chunk-9jvnc14g.js} +1 -1
- package/bundle/chunk-9qmmse2n.js +2 -0
- package/bundle/chunk-9r6bvkp4.js +8 -0
- package/bundle/{chunk-dkv2mg97.js → chunk-9va5eh9s.js} +1 -1
- package/bundle/{chunk-hg563h5r.js → chunk-9w5rx0fb.js} +2 -2
- package/bundle/{chunk-xccs5c50.js → chunk-a27yjp71.js} +1 -1
- package/bundle/chunk-aabrsxrq.js +2 -0
- package/bundle/{chunk-dkm7x8rj.js → chunk-ag9thqkv.js} +2 -2
- package/bundle/chunk-amx3x4kd.js +3 -0
- package/bundle/{chunk-ktmazmas.js → chunk-aqm597px.js} +2 -2
- package/bundle/chunk-atd0q4v8.js +3 -0
- package/bundle/{chunk-ewyk4py6.js → chunk-av290sja.js} +1 -1
- package/bundle/chunk-avaba4sr.js +2 -0
- package/bundle/{chunk-dgzyn27r.js → chunk-aw0q4y3s.js} +1 -1
- package/bundle/{chunk-4k149ews.js → chunk-b2xya6pq.js} +1 -1
- package/bundle/{chunk-3tdqsm5c.js → chunk-b50t4jc5.js} +1 -1
- package/bundle/chunk-bdy1etja.js +2 -0
- package/bundle/{chunk-6szvs3k9.js → chunk-bnc4626b.js} +1 -1
- package/bundle/{chunk-fm4xa6yx.js → chunk-bpnpxdyv.js} +2 -2
- package/bundle/chunk-bqdvqmjc.js +2 -0
- package/bundle/chunk-bqs6a1ts.js +14 -0
- package/bundle/{chunk-78bajmqm.js → chunk-bsqcfqya.js} +1 -1
- package/bundle/{chunk-ecwz9nhs.js → chunk-c1ypbbka.js} +2 -2
- package/bundle/{chunk-1jsywey3.js → chunk-c27rpvdz.js} +1 -1
- package/bundle/chunk-cdws8ggq.js +2 -0
- package/bundle/{chunk-6j0365q3.js → chunk-cjxp72dv.js} +2 -2
- package/bundle/chunk-cqs9a2cs.js +2 -0
- package/bundle/{chunk-3wzqs241.js → chunk-crap29f6.js} +1 -1
- package/bundle/{chunk-1jh5p5qw.js → chunk-d0m7nbbx.js} +2 -2
- package/bundle/chunk-d0rjst58.js +2 -0
- package/bundle/{chunk-2eardzxs.js → chunk-d1bsxz2t.js} +1 -1
- package/bundle/{chunk-b6m4yyww.js → chunk-d5b0bqbr.js} +1 -1
- package/bundle/chunk-d833a2fj.js +2 -0
- package/bundle/{chunk-tk3bve0x.js → chunk-dd11kryy.js} +2 -2
- package/bundle/chunk-dday4nm2.js +2 -0
- package/bundle/{chunk-qw2hgs5b.js → chunk-ddxjc803.js} +2 -2
- package/bundle/{chunk-3tkp27x7.js → chunk-dee1a3yk.js} +2 -2
- package/bundle/{chunk-q6fbyvpq.js → chunk-dgggvses.js} +1 -1
- package/bundle/{chunk-apq38bt4.js → chunk-dk3z4k46.js} +3 -3
- package/bundle/{chunk-wf09j72q.js → chunk-e075v4e9.js} +2 -2
- package/bundle/{chunk-1xyn0sp2.js → chunk-e1pwnf0b.js} +2 -2
- package/bundle/chunk-e2sj30hk.js +2 -0
- package/bundle/{chunk-dann9gfq.js → chunk-eaatrmcg.js} +1 -1
- package/bundle/{chunk-1y9t7nxn.js → chunk-eg7drzzt.js} +1 -1
- package/bundle/chunk-enc0fykg.js +2 -0
- package/bundle/chunk-evan93av.js +2 -0
- package/bundle/{chunk-9f7y0dj0.js → chunk-evmfntm3.js} +1 -1
- package/bundle/{chunk-2gxjjqfx.js → chunk-ey4ktbyb.js} +1 -1
- package/bundle/{chunk-sswbfqcq.js → chunk-f55txcsa.js} +1 -1
- package/bundle/chunk-f600dzsr.js +2 -0
- package/bundle/chunk-f6jzwydk.js +2 -0
- package/bundle/{chunk-s9amvacw.js → chunk-f84cd0a1.js} +2 -2
- package/bundle/{chunk-6sdh1q7g.js → chunk-fgw420gb.js} +1 -1
- package/bundle/chunk-fv67ng8z.js +2 -0
- package/bundle/{chunk-x6z2b63w.js → chunk-g3s2z5xa.js} +1 -1
- package/bundle/{chunk-9xvctnjr.js → chunk-g4qwkcdv.js} +1 -1
- package/bundle/{chunk-3nhqd8wg.js → chunk-g73drh98.js} +3 -3
- package/bundle/{chunk-0pvbk8ks.js → chunk-gaen9ya4.js} +2 -2
- package/bundle/{chunk-ac202abt.js → chunk-gefh32jb.js} +1 -1
- package/bundle/chunk-gevazsx3.js +2 -0
- package/bundle/{chunk-n1chdwrs.js → chunk-gfmfrkxc.js} +1 -1
- package/bundle/{chunk-sjrmhd3e.js → chunk-ggeena9t.js} +1 -1
- package/bundle/chunk-gh18pzkx.js +2 -0
- package/bundle/chunk-gnvvgr4y.js +2 -0
- package/bundle/{chunk-4q9w2yve.js → chunk-grkkzrg1.js} +2 -2
- package/bundle/chunk-gsbjs2ws.js +2 -0
- package/bundle/{chunk-gff87y4n.js → chunk-gsz1wqy6.js} +1 -1
- package/bundle/{chunk-vf1r5ckp.js → chunk-gvtw9c44.js} +1 -1
- package/bundle/chunk-gw0j8hr9.js +3 -0
- package/bundle/{chunk-cesrhm09.js → chunk-h19ty95q.js} +1 -1
- package/bundle/{chunk-9nx8hm57.js → chunk-h2fh1g8g.js} +1 -1
- package/bundle/{chunk-p54bzjtv.js → chunk-h56jxxvj.js} +1 -1
- package/bundle/{chunk-jmjg8d8a.js → chunk-hmfefq0d.js} +4 -4
- package/bundle/{chunk-gn7xgd4c.js → chunk-hvpe07pt.js} +1 -1
- package/bundle/{chunk-gvzfffr4.js → chunk-hwbxehhf.js} +1 -1
- package/bundle/{chunk-zp2ffbc2.js → chunk-hznsed5n.js} +2 -2
- package/bundle/{chunk-w1atxyz0.js → chunk-j5b5h08g.js} +1 -1
- package/bundle/chunk-j7pdz979.js +2 -0
- package/bundle/{chunk-02txthqv.js → chunk-j9s62g01.js} +2 -2
- package/bundle/chunk-jfe2qbv8.js +2 -0
- package/bundle/{chunk-wj6aq50n.js → chunk-jgs6ngte.js} +1 -1
- package/bundle/{chunk-ep8zn49w.js → chunk-jhq5bvhs.js} +2 -2
- package/bundle/{chunk-2z6fzwyc.js → chunk-jq81hb32.js} +2 -2
- package/bundle/{chunk-dcx8hjbs.js → chunk-jqzejny3.js} +1 -1
- package/bundle/{chunk-j1veq3zr.js → chunk-jtrcnpm7.js} +2 -2
- package/bundle/{chunk-hbnr0j7h.js → chunk-jv98gw88.js} +2 -2
- package/bundle/{chunk-e346x00p.js → chunk-jvaffe5d.js} +1 -1
- package/bundle/chunk-k6zvb8xm.js +2 -0
- package/bundle/{chunk-5y8efy5b.js → chunk-k8bp3jjv.js} +1 -1
- package/bundle/{chunk-0ae5q6ck.js → chunk-kb14wxcs.js} +2 -2
- package/bundle/chunk-kcht9kvx.js +2 -0
- package/bundle/{chunk-edvcz2gd.js → chunk-kdcspxvq.js} +1 -1
- package/bundle/{chunk-t6w96xq2.js → chunk-kdct3e8s.js} +1 -1
- package/bundle/{chunk-1fnmkm0z.js → chunk-kgsq240v.js} +2 -2
- package/bundle/chunk-knvsa1d4.js +2 -0
- package/bundle/chunk-kp6d68hd.js +2 -0
- package/bundle/{chunk-jpygkh1c.js → chunk-kwm87f18.js} +1 -1
- package/bundle/{chunk-1p34bx7c.js → chunk-kyny0t2g.js} +2 -2
- package/bundle/{chunk-b8ag61vj.js → chunk-m2ang7yb.js} +1 -1
- package/bundle/{chunk-99n6czag.js → chunk-mbh1pdv9.js} +2 -2
- package/bundle/{chunk-y1srca0c.js → chunk-mczw8e3s.js} +2 -2
- package/bundle/chunk-me78p9x4.js +2 -0
- package/bundle/{chunk-g7vkkmsk.js → chunk-meaybtcc.js} +3 -3
- package/bundle/{chunk-9rqrm9y8.js → chunk-mkdyknbz.js} +1 -1
- package/bundle/{chunk-bf146hz2.js → chunk-mkyrg7gt.js} +2 -2
- package/bundle/{chunk-0pbt75ev.js → chunk-mr7agwgn.js} +1 -1
- package/bundle/{chunk-0w4v0fbs.js → chunk-msm3r7ny.js} +2 -2
- package/bundle/chunk-mv1d7wyt.js +2 -0
- package/bundle/{chunk-hh3w51wp.js → chunk-mybpgrjj.js} +2 -2
- package/bundle/{chunk-gf4ek7rv.js → chunk-n8dcmjph.js} +1 -1
- package/bundle/chunk-n8xmmxh5.js +2 -0
- package/bundle/chunk-n90219q9.js +2 -0
- package/bundle/chunk-nckg3ydx.js +2 -0
- package/bundle/{chunk-a5zjrwqy.js → chunk-nf8gkxbk.js} +2 -2
- package/bundle/chunk-nhaenjw3.js +2 -0
- package/bundle/chunk-nhtrt5ec.js +2 -0
- package/bundle/{chunk-6dxaty1v.js → chunk-nhx2xp2x.js} +1 -1
- package/bundle/{chunk-najzfhb2.js → chunk-nmnsf3fc.js} +1 -1
- package/bundle/{chunk-84gnbzky.js → chunk-nqefvn28.js} +1 -1
- package/bundle/{chunk-v2kyarwz.js → chunk-p409grvp.js} +2 -2
- package/bundle/chunk-p72n0tfq.js +2 -0
- package/bundle/{chunk-jr8qcf99.js → chunk-p80dc6kt.js} +2 -2
- package/bundle/{chunk-2wp1w8cy.js → chunk-p883sz67.js} +1 -1
- package/bundle/{chunk-fdezde1z.js → chunk-p8enedkf.js} +1 -1
- package/bundle/chunk-pd33qvr0.js +2 -0
- package/bundle/{chunk-d56zc21w.js → chunk-pepn5jp4.js} +1 -1
- package/bundle/chunk-pf7cj4jd.js +3 -0
- package/bundle/{chunk-bd21p9zz.js → chunk-pfn1db1m.js} +2 -2
- package/bundle/{chunk-srf73nm4.js → chunk-pk0tytcm.js} +1 -1
- package/bundle/chunk-pq3622ae.js +2 -0
- package/bundle/{chunk-ebjhggdw.js → chunk-psveqqv2.js} +1 -1
- package/bundle/{chunk-wfnk2vsd.js → chunk-pvee151a.js} +1 -1
- package/bundle/chunk-qatj4h6b.js +2 -0
- package/bundle/{chunk-3vbtra1j.js → chunk-qdnxv55k.js} +1 -1
- package/bundle/{chunk-gen6f3dn.js → chunk-qe0sfafy.js} +2 -2
- package/bundle/chunk-qfz0a58d.js +2 -0
- package/bundle/chunk-qjwfj51e.js +2 -0
- package/bundle/chunk-qkg73rs9.js +2 -0
- package/bundle/{chunk-5kmfnkzv.js → chunk-qm9ezq93.js} +1 -1
- package/bundle/{chunk-5rkmhzq0.js → chunk-qnqqrvvs.js} +2 -2
- package/bundle/{chunk-9pe4agdz.js → chunk-qnv2v02g.js} +2 -2
- package/bundle/{chunk-7dckfame.js → chunk-qpm5afdz.js} +1 -1
- package/bundle/chunk-qvcfst7n.js +11 -0
- package/bundle/{chunk-r48g0kaq.js → chunk-rgecc41f.js} +2 -2
- package/bundle/chunk-rjcptzem.js +8 -0
- package/bundle/{chunk-hh9a709t.js → chunk-rjf21v5c.js} +1 -1
- package/bundle/chunk-rmsqb6r4.js +10 -0
- package/bundle/{chunk-2mmspnr3.js → chunk-rq4hqwjy.js} +1 -1
- package/bundle/chunk-rqrpbcm6.js +2 -0
- package/bundle/{chunk-ftk58wxe.js → chunk-rs1mm5ef.js} +1 -1
- package/bundle/{chunk-a9y27zd2.js → chunk-rze20q68.js} +1 -1
- package/bundle/chunk-s76hdgw6.js +2 -0
- package/bundle/chunk-s7vhjg9e.js +2 -0
- package/bundle/{chunk-fkvccmgk.js → chunk-se79ke63.js} +2 -2
- package/bundle/chunk-sec3a60m.js +2 -0
- package/bundle/chunk-sjnt5e6w.js +2 -0
- package/bundle/chunk-sntb757q.js +2 -0
- package/bundle/chunk-svscftd7.js +2 -0
- package/bundle/chunk-sx0cabcs.js +2 -0
- package/bundle/{chunk-gn9p1d50.js → chunk-sx5m81em.js} +1 -1
- package/bundle/chunk-syhay5ye.js +7 -0
- package/bundle/{chunk-9798jffg.js → chunk-t07a5431.js} +1 -1
- package/bundle/{chunk-c31k8yh0.js → chunk-t0amhhsk.js} +1 -1
- package/bundle/{chunk-pfhp78cr.js → chunk-t2tsyazc.js} +1 -1
- package/bundle/{chunk-spm1yy6w.js → chunk-tdmaxc6n.js} +1 -1
- package/bundle/{chunk-gc9q0x8z.js → chunk-tf1me2r4.js} +3 -3
- package/bundle/{chunk-zfnbk5gy.js → chunk-tfggzzqw.js} +1 -1
- package/bundle/chunk-tmdm6vm6.js +2 -0
- package/bundle/{chunk-9sy9ws1w.js → chunk-v4xgceeq.js} +1 -1
- package/bundle/chunk-v6g0ksks.js +2 -0
- package/bundle/chunk-v7ah9gg0.js +3 -0
- package/bundle/{chunk-kr0fsqas.js → chunk-vb4e7y4d.js} +1 -1
- package/bundle/chunk-vbf73c7z.js +2 -0
- package/bundle/chunk-vbf9jpas.js +2 -0
- package/bundle/{chunk-r3yqe7x0.js → chunk-veev25yg.js} +1 -1
- package/bundle/{chunk-kaeyhw2n.js → chunk-vfj5nwab.js} +2 -2
- package/bundle/{chunk-6g3m7yxf.js → chunk-vmgknvxs.js} +2 -2
- package/bundle/{chunk-2y8qz8te.js → chunk-vq6bh2z9.js} +1 -1
- package/bundle/{chunk-b643cra9.js → chunk-vqq5vmh1.js} +195 -195
- package/bundle/chunk-vrcf5q4s.js +2 -0
- package/bundle/chunk-vxrsp6n7.js +2 -0
- package/bundle/chunk-w8ax3pvh.js +2 -0
- package/bundle/chunk-w98r39gd.js +9 -0
- package/bundle/{chunk-j1a64ade.js → chunk-wb69d52j.js} +2 -2
- package/bundle/{chunk-hg9nk090.js → chunk-wrgg270f.js} +1 -1
- package/bundle/{chunk-yzdty5t9.js → chunk-ww8ear80.js} +2 -2
- package/bundle/{chunk-ha1w0xzh.js → chunk-x36jhtex.js} +1 -1
- package/bundle/{chunk-hjbks7r9.js → chunk-x6b99nt3.js} +1 -1
- package/bundle/{chunk-yh174jhg.js → chunk-xdde80rf.js} +2 -2
- package/bundle/{chunk-17ggas8k.js → chunk-xjrt0dta.js} +1 -1
- package/bundle/chunk-xk2cmh49.js +2 -0
- package/bundle/{chunk-f819a7ec.js → chunk-xqa6qkx2.js} +1 -1
- package/bundle/{chunk-f3kjp838.js → chunk-xw283h2r.js} +2 -2
- package/bundle/{chunk-82gs5cmn.js → chunk-xy4t5qf8.js} +1 -1
- package/bundle/{chunk-0w0jfzb4.js → chunk-xyn3xxfs.js} +1 -1
- package/bundle/chunk-xzhkfctf.js +2 -0
- package/bundle/chunk-y0xt5a6g.js +2 -0
- package/bundle/{chunk-hxgb0y1w.js → chunk-ybn8tb09.js} +1 -1
- package/bundle/chunk-ydmrvx7q.js +2 -0
- package/bundle/{chunk-ns0pswww.js → chunk-ydsen7w0.js} +1 -1
- package/bundle/{chunk-hv4nhx6q.js → chunk-yhqk8bzk.js} +2 -2
- package/bundle/{chunk-g0v9g37f.js → chunk-ykfq8bem.js} +1 -1
- package/bundle/{chunk-r7xp0xcn.js → chunk-ym4ydwrz.js} +2 -2
- package/bundle/{chunk-4tn69nqs.js → chunk-yzchwmb4.js} +1 -1
- package/bundle/{chunk-1d64dywx.js → chunk-z015twaq.js} +2 -2
- package/bundle/chunk-z2rtcgad.js +3 -0
- package/bundle/{chunk-ms1fd6h4.js → chunk-z3zx6g09.js} +1 -1
- package/bundle/chunk-z9b3t2jm.js +2 -0
- package/bundle/{chunk-agdfqncf.js → chunk-zbdbsagd.js} +2 -2
- package/bundle/{chunk-evqxvhdb.js → chunk-zh808d4t.js} +1 -1
- package/bundle/{chunk-fhng5her.js → chunk-zny2qaqa.js} +2 -2
- package/bundle/{chunk-y2jmtfdh.js → chunk-zsnbxsdx.js} +2 -2
- package/bundle/{chunk-pv8jcpnf.js → chunk-zss93r48.js} +1 -1
- package/bundle/chunk-zzr8smtm.js +2 -0
- package/bundle/index.js +16 -16
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-0bvde0cx.js +0 -2
- package/bundle/chunk-0kbxnazj.js +0 -2
- package/bundle/chunk-0z3z0gk1.js +0 -5
- package/bundle/chunk-19z5q33z.js +0 -2
- package/bundle/chunk-1a0wnwna.js +0 -2
- package/bundle/chunk-1ddm2wxv.js +0 -2
- package/bundle/chunk-1fk4vsmc.js +0 -2
- package/bundle/chunk-1j2f9nd5.js +0 -2
- package/bundle/chunk-27s736an.js +0 -2
- package/bundle/chunk-2j17xrzj.js +0 -2
- package/bundle/chunk-2zca3nak.js +0 -2
- package/bundle/chunk-2zcvcfq4.js +0 -2
- package/bundle/chunk-38hwkfj5.js +0 -2
- package/bundle/chunk-3afqxvsn.js +0 -2
- package/bundle/chunk-3avc1ppg.js +0 -7
- package/bundle/chunk-3v4vtah1.js +0 -2
- package/bundle/chunk-3ypk0j2f.js +0 -2
- package/bundle/chunk-3z1y040p.js +0 -3
- package/bundle/chunk-4aykrj51.js +0 -9
- package/bundle/chunk-4dtbmqmq.js +0 -2
- package/bundle/chunk-4zjb6rps.js +0 -2
- package/bundle/chunk-5hkcjgwh.js +0 -2
- package/bundle/chunk-5snrz263.js +0 -2
- package/bundle/chunk-653c0mxr.js +0 -11
- package/bundle/chunk-6av7hrrk.js +0 -7
- package/bundle/chunk-6bswn7w5.js +0 -2
- package/bundle/chunk-6epghftw.js +0 -2
- package/bundle/chunk-6jjhxh8p.js +0 -2
- package/bundle/chunk-6ws7xyc5.js +0 -2
- package/bundle/chunk-7g28zhar.js +0 -2
- package/bundle/chunk-7v02b2ms.js +0 -2
- package/bundle/chunk-7vmp2034.js +0 -2
- package/bundle/chunk-7wxrypkr.js +0 -2
- package/bundle/chunk-8kk9gvdy.js +0 -2
- package/bundle/chunk-8ygpp4y3.js +0 -2
- package/bundle/chunk-95q60g1p.js +0 -2
- package/bundle/chunk-9mjbenja.js +0 -2
- package/bundle/chunk-9vn1gy8h.js +0 -2
- package/bundle/chunk-ajp3f08k.js +0 -2
- package/bundle/chunk-aptkpdkc.js +0 -2
- package/bundle/chunk-bky5a42k.js +0 -3
- package/bundle/chunk-bry94ar5.js +0 -2
- package/bundle/chunk-btzyvqkf.js +0 -2
- package/bundle/chunk-c94pjdfh.js +0 -2
- package/bundle/chunk-cct9ds5c.js +0 -2
- package/bundle/chunk-czn535v0.js +0 -2
- package/bundle/chunk-d7wd5hz1.js +0 -2
- package/bundle/chunk-d86cmjrp.js +0 -2
- package/bundle/chunk-dnq65xvn.js +0 -2
- package/bundle/chunk-dpqv8rtn.js +0 -2
- package/bundle/chunk-e9mh7s3z.js +0 -2
- package/bundle/chunk-ek2y5f6g.js +0 -2
- package/bundle/chunk-epdsay73.js +0 -2
- package/bundle/chunk-f89gntcy.js +0 -3
- package/bundle/chunk-ffnsn7tv.js +0 -2
- package/bundle/chunk-fkezc7ew.js +0 -2
- package/bundle/chunk-fsxddgj0.js +0 -2
- package/bundle/chunk-gbcsfg6v.js +0 -2
- package/bundle/chunk-gfmz85hp.js +0 -2
- package/bundle/chunk-gk63k4t6.js +0 -2
- package/bundle/chunk-j0vf8s12.js +0 -2
- package/bundle/chunk-j1bxt69x.js +0 -2
- package/bundle/chunk-jcem8s30.js +0 -2
- package/bundle/chunk-jjwjb9w0.js +0 -3
- package/bundle/chunk-jpham2a3.js +0 -2
- package/bundle/chunk-jzkymnr5.js +0 -2
- package/bundle/chunk-k0qtwnhb.js +0 -2
- package/bundle/chunk-k2rsky7z.js +0 -2
- package/bundle/chunk-kcetcysa.js +0 -2
- package/bundle/chunk-kjfc5v3s.js +0 -2
- package/bundle/chunk-kkvb2c2z.js +0 -8
- package/bundle/chunk-km2ayfyf.js +0 -2
- package/bundle/chunk-knrh89eb.js +0 -2
- package/bundle/chunk-ksqfjawv.js +0 -2
- package/bundle/chunk-m8djypsy.js +0 -11
- package/bundle/chunk-mjhb1q0n.js +0 -3
- package/bundle/chunk-mxcger73.js +0 -2
- package/bundle/chunk-nazkrkeb.js +0 -2
- package/bundle/chunk-nk01s49e.js +0 -2
- package/bundle/chunk-ns8b7rx1.js +0 -2
- package/bundle/chunk-ny6vpkx2.js +0 -2
- package/bundle/chunk-q0dd3ak6.js +0 -3
- package/bundle/chunk-q2s057bm.js +0 -2
- package/bundle/chunk-q5cqg2c0.js +0 -28
- package/bundle/chunk-qk2wnp2x.js +0 -2
- package/bundle/chunk-r012q335.js +0 -3
- package/bundle/chunk-rbdjbgkb.js +0 -2
- package/bundle/chunk-rxjprhgh.js +0 -2
- package/bundle/chunk-s3w9bmze.js +0 -2
- package/bundle/chunk-s3zste1a.js +0 -2
- package/bundle/chunk-sbt7qmwm.js +0 -3
- package/bundle/chunk-sf6h44pb.js +0 -2
- package/bundle/chunk-sgvzxs7m.js +0 -2
- package/bundle/chunk-sp9bndyh.js +0 -2
- package/bundle/chunk-vavrczqm.js +0 -3
- package/bundle/chunk-vg4styg5.js +0 -2
- package/bundle/chunk-vh09hhcs.js +0 -2
- package/bundle/chunk-vhktpm0n.js +0 -2
- package/bundle/chunk-vzjcmwry.js +0 -14
- package/bundle/chunk-wtp0yvqw.js +0 -2
- package/bundle/chunk-xmzs7q66.js +0 -2
- package/bundle/chunk-xv80476w.js +0 -2
- package/bundle/chunk-yjvr0et1.js +0 -2
- package/bundle/chunk-zk8n8hnh.js +0 -3
- package/bundle/chunk-zx3kcfkj.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Aq as LG,Bq as WG,Fq as d,Gq as i,Hq as jG,Iq as TG,Jq as OG,Kq as kG,Pp as wG,Qp as NG,Up as MG,Wp as JG,dq as CG,kq as bG,qq as D,tq as J,uq as GG}from"./chunk-bf146hz2.js";import{Rq as BG,br as HG}from"./chunk-t488d66k.js";import{Pu as G}from"./chunk-r7xp0xcn.js";var iG=D(()=>J(G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}))),EG=TG({errorSchema:iG,errorToMessage:(Q)=>Q.error.message}),lG=D(()=>J(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()}))),sG=D(()=>J(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")})]))),pG=D(()=>J(G.object({signature:G.string().optional(),redactedData:G.string().optional()}))),SG=G.object({citations:G.object({enabled:G.boolean()}).optional(),title:G.string().optional(),context:G.string().optional()}),yG=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()}),FG=4;function nG(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 VG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(Q,H){let Z=nG(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>FG){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:`Maximum ${FG} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`});return}return Z}getWarnings(){return this.warnings}},rG=D(()=>J(G.object({maxCharacters:G.number().optional()}))),aG=D(()=>J(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()}))),eG=d({id:"anthropic.text_editor_20250728",inputSchema:aG}),oG=(Q={})=>{return eG(Q)},tG=D(()=>J(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()}))),GQ=D(()=>J(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),QQ=D(()=>J(G.object({query:G.string()}))),XQ=i({id:"anthropic.web_search_20260209",inputSchema:QQ,outputSchema:GQ,supportsDeferredResults:!0}),YQ=(Q={})=>{return XQ(Q)},ZQ=D(()=>J(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()}))),vG=D(()=>J(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),$Q=D(()=>J(G.object({query:G.string()}))),zQ=i({id:"anthropic.web_search_20250305",inputSchema:$Q,outputSchema:vG,supportsDeferredResults:!0}),LQ=(Q={})=>{return zQ(Q)},HQ=D(()=>J(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()}))),AQ=D(()=>J(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()}))),qQ=D(()=>J(G.object({url:G.string()}))),KQ=i({id:"anthropic.web_fetch_20260209",inputSchema:qQ,outputSchema:AQ,supportsDeferredResults:!0}),DQ=(Q={})=>{return KQ(Q)},JQ=D(()=>J(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()}))),_G=D(()=>J(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()}))),WQ=D(()=>J(G.object({url:G.string()}))),jQ=i({id:"anthropic.web_fetch_20250910",inputSchema:WQ,outputSchema:_G,supportsDeferredResults:!0}),VQ=(Q={})=>{return jQ(Q)};async function UQ({tools:Q,toolChoice:H,disableParallelToolUse:Z,cacheControlValidator:W,supportsStructuredOutput:f,supportsStrictTools:h,defaultEagerInputStreaming:_=!1}){var b,l;Q=(Q==null?void 0:Q.length)?Q:void 0;let M=[],B=new Set,u=W||new VG;if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:M,betas:B};let R=[];for(let E of Q)switch(E.type){case"function":{let P=u.getCacheControl(E.providerOptions,{type:"tool definition",canCache:!0}),v=(b=E.providerOptions)==null?void 0:b.anthropic,g=(l=v==null?void 0:v.eagerInputStreaming)!=null?l:_,C=v==null?void 0:v.deferLoading,e=v==null?void 0:v.allowedCallers;if(!h&&E.strict!=null)M.push({type:"unsupported",feature:"strict",details:`Tool '${E.name}' has strict: ${E.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`});if(R.push({name:E.name,description:E.description,input_schema:E.inputSchema,cache_control:P,...g?{eager_input_streaming:!0}:{},...h===!0&&E.strict!=null?{strict:E.strict}:{},...C!=null?{defer_loading:C}:{},...e!=null?{allowed_callers:e}:{},...E.inputExamples!=null?{input_examples:E.inputExamples.map((N)=>N.input)}:{}}),f===!0)B.add("structured-outputs-2025-11-13");if(E.inputExamples!=null||e!=null)B.add("advanced-tool-use-2025-11-20");break}case"provider":{switch(E.id){case"anthropic.code_execution_20250522":{B.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":{B.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":{B.add("computer-use-2025-01-24"),R.push({name:"computer",type:"computer_20250124",display_width_px:E.args.displayWidthPx,display_height_px:E.args.displayHeightPx,display_number:E.args.displayNumber,cache_control:void 0});break}case"anthropic.computer_20251124":{B.add("computer-use-2025-11-24"),R.push({name:"computer",type:"computer_20251124",display_width_px:E.args.displayWidthPx,display_height_px:E.args.displayHeightPx,display_number:E.args.displayNumber,enable_zoom:E.args.enableZoom,cache_control:void 0});break}case"anthropic.computer_20241022":{B.add("computer-use-2024-10-22"),R.push({name:"computer",type:"computer_20241022",display_width_px:E.args.displayWidthPx,display_height_px:E.args.displayHeightPx,display_number:E.args.displayNumber,cache_control:void 0});break}case"anthropic.text_editor_20250124":{B.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":{B.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":{B.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 P=await GG({value:E.args,schema:rG});R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:P.maxCharacters,cache_control:void 0});break}case"anthropic.bash_20250124":{B.add("computer-use-2025-01-24"),R.push({name:"bash",type:"bash_20250124",cache_control:void 0});break}case"anthropic.bash_20241022":{B.add("computer-use-2024-10-22"),R.push({name:"bash",type:"bash_20241022",cache_control:void 0});break}case"anthropic.memory_20250818":{B.add("context-management-2025-06-27"),R.push({name:"memory",type:"memory_20250818"});break}case"anthropic.web_fetch_20250910":{B.add("web-fetch-2025-09-10");let P=await GG({value:E.args,schema:JQ});R.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,citations:P.citations,max_content_tokens:P.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260209":{B.add("code-execution-web-tools-2026-02-09");let P=await GG({value:E.args,schema:HQ});R.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,citations:P.citations,max_content_tokens:P.maxContentTokens,cache_control:void 0});break}case"anthropic.web_search_20250305":{let P=await GG({value:E.args,schema:ZQ});R.push({type:"web_search_20250305",name:"web_search",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,user_location:P.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260209":{B.add("code-execution-web-tools-2026-02-09");let P=await GG({value:E.args,schema:tG});R.push({type:"web_search_20260209",name:"web_search",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,user_location:P.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:{M.push({type:"unsupported",feature:`provider-defined tool ${E.id}`});break}}break}default:{M.push({type:"unsupported",feature:`tool ${E}`});break}}if(H==null)return{tools:R,toolChoice:Z?{type:"auto",disable_parallel_tool_use:Z}:void 0,toolWarnings:M,betas:B};let a=H.type;switch(a){case"auto":return{tools:R,toolChoice:{type:"auto",disable_parallel_tool_use:Z},toolWarnings:M,betas:B};case"required":return{tools:R,toolChoice:{type:"any",disable_parallel_tool_use:Z},toolWarnings:M,betas:B};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:M,betas:B};case"tool":return{tools:R,toolChoice:{type:"tool",name:H.toolName,disable_parallel_tool_use:Z},toolWarnings:M,betas:B};default:throw new HG({functionality:`tool choice type: ${a}`})}}function IG({usage:Q,rawUsage:H}){var Z,W;let f=(Z=Q.cache_creation_input_tokens)!=null?Z:0,h=(W=Q.cache_read_input_tokens)!=null?W:0,_,b;if(Q.iterations&&Q.iterations.length>0){let l=Q.iterations.reduce((M,B)=>({input:M.input+B.input_tokens,output:M.output+B.output_tokens}),{input:0,output:0});_=l.input,b=l.output}else _=Q.input_tokens,b=Q.output_tokens;return{inputTokens:{total:_+f+h,noCache:_,cacheRead:h,cacheWrite:f},outputTokens:{total:b,text:void 0,reasoning:void 0},raw:H!=null?H:Q}}var hG=D(()=>J(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([])}))),RQ=D(()=>J(G.object({code:G.string()}))),EQ=i({id:"anthropic.code_execution_20250522",inputSchema:RQ,outputSchema:hG}),SQ=(Q={})=>{return EQ(Q)},gG=D(()=>J(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()})]))),yQ=D(()=>J(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()})])]))),FQ=i({id:"anthropic.code_execution_20250825",inputSchema:yQ,outputSchema:gG,supportsDeferredResults:!0}),IQ=(Q={})=>{return FQ(Q)},mG=D(()=>J(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()})]))),fQ=D(()=>J(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()})])]))),PQ=i({id:"anthropic.code_execution_20260120",inputSchema:fQ,outputSchema:mG,supportsDeferredResults:!0}),xQ=(Q={})=>{return PQ(Q)},dG=D(()=>J(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),BQ=D(()=>J(G.object({pattern:G.string(),limit:G.number().optional()}))),wQ=i({id:"anthropic.tool_search_regex_20251119",inputSchema:BQ,outputSchema:dG,supportsDeferredResults:!0}),NQ=(Q={})=>{return wQ(Q)};function MQ(Q){if(typeof Q==="string")return new TextDecoder().decode(MG(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 qG(Q){return Q instanceof URL||CQ(Q)}function CQ(Q){return typeof Q==="string"&&/^https?:\/\//i.test(Q)}function KG(Q){return Q instanceof URL?Q.toString():Q}async function bQ({prompt:Q,sendReasoning:H,warnings:Z,cacheControlValidator:W,toolNameMapping:f}){var h,_,b,l,M,B,u,R,a,E,P,v,g,C,e,N,s,QG,YG;let Y=new Set,j=TQ(Q),w=W||new VG,p=void 0,XG=[];async function zG(O){var T,V;let ZG=await LG({provider:"anthropic",providerOptions:O,schema:SG});return(V=(T=ZG==null?void 0:ZG.citations)==null?void 0:T.enabled)!=null?V:!1}async function L(O){let T=await LG({provider:"anthropic",providerOptions:O,schema:SG});return{title:T==null?void 0:T.title,context:T==null?void 0:T.context}}for(let O=0;O<j.length;O++){let T=j[O],V=O===j.length-1,ZG=T.type;switch(ZG){case"system":{if(p!=null)throw new HG({functionality:"Multiple system messages that are separated by user/assistant messages"});p=T.messages.map(({content:x,providerOptions:o})=>({type:"text",text:x,cache_control:w.getCacheControl(o,{type:"system message",canCache:!0})}));break}case"user":{let x=[];for(let o of T.messages){let{role:t,content:r}=o;switch(t){case"user":{for(let c=0;c<r.length;c++){let y=r[c],n=c===r.length-1,z=(h=w.getCacheControl(y.providerOptions,{type:"user message part",canCache:!0}))!=null?h:n?w.getCacheControl(o.providerOptions,{type:"user message",canCache:!0}):void 0;switch(y.type){case"text":{x.push({type:"text",text:y.text,cache_control:z});break}case"file":{if(y.mediaType.startsWith("image/"))x.push({type:"image",source:qG(y.data)?{type:"url",url:KG(y.data)}:{type:"base64",media_type:y.mediaType==="image/*"?"image/jpeg":y.mediaType,data:JG(y.data)},cache_control:z});else if(y.mediaType==="application/pdf"){Y.add("pdfs-2024-09-25");let m=await zG(y.providerOptions),F=await L(y.providerOptions);x.push({type:"document",source:qG(y.data)?{type:"url",url:KG(y.data)}:{type:"base64",media_type:"application/pdf",data:JG(y.data)},title:(_=F.title)!=null?_:y.filename,...F.context&&{context:F.context},...m&&{citations:{enabled:!0}},cache_control:z})}else if(y.mediaType==="text/plain"){let m=await zG(y.providerOptions),F=await L(y.providerOptions);x.push({type:"document",source:qG(y.data)?{type:"url",url:KG(y.data)}:{type:"text",media_type:"text/plain",data:MQ(y.data)},title:(b=F.title)!=null?b:y.filename,...F.context&&{context:F.context},...m&&{citations:{enabled:!0}},cache_control:z})}else throw new HG({functionality:`media type: ${y.mediaType}`});break}}}break}case"tool":{for(let c=0;c<r.length;c++){let y=r[c];if(y.type==="tool-approval-response")continue;let n=c===r.length-1,z=(l=w.getCacheControl(y.providerOptions,{type:"tool result part",canCache:!0}))!=null?l:n?w.getCacheControl(o.providerOptions,{type:"tool result message",canCache:!0}):void 0,m=y.output,F;switch(m.type){case"content":F=m.value.map((U)=>{var K;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=(K=U.providerOptions)==null?void 0:K.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(bG);break;case"text":case"error-text":F=m.value;break;case"execution-denied":F=(M=m.reason)!=null?M:"Tool execution denied.";break;case"json":case"error-json":default:F=JSON.stringify(m.value);break}x.push({type:"tool_result",tool_use_id:y.toolCallId,content:F,is_error:m.type==="error-text"||m.type==="error-json"?!0:void 0,cache_control:z})}break}default:throw Error(`Unsupported role: ${t}`)}}XG.push({role:"user",content:x});break}case"assistant":{let x=[],o=new Set;for(let t=0;t<T.messages.length;t++){let r=T.messages[t],c=t===T.messages.length-1,{content:y}=r;for(let n=0;n<y.length;n++){let z=y[n],m=n===y.length-1,F=(B=w.getCacheControl(z.providerOptions,{type:"assistant message part",canCache:!0}))!=null?B:m?w.getCacheControl(r.providerOptions,{type:"assistant message",canCache:!0}):void 0;switch(z.type){case"text":{let U=(u=z.providerOptions)==null?void 0:u.anthropic;if((U==null?void 0:U.type)==="compaction")x.push({type:"compaction",content:z.text,cache_control:F});else x.push({type:"text",text:V&&c&&m?z.text.trim():z.text,cache_control:F});break}case"reasoning":{if(H){let U=await LG({provider:"anthropic",providerOptions:z.providerOptions,schema:pG});if(U!=null)if(U.signature!=null)w.getCacheControl(z.providerOptions,{type:"thinking block",canCache:!1}),x.push({type:"thinking",thinking:z.text,signature:U.signature});else if(U.redactedData!=null)w.getCacheControl(z.providerOptions,{type:"redacted thinking block",canCache:!1}),x.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=f.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=(P=(E=z.providerOptions)==null?void 0:E.anthropic)==null?void 0:P.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}x.push({type:"mcp_tool_use",id:z.toolCallId,name:z.toolName,input:z.input,server_name:X,cache_control:F})}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"))x.push({type:"server_tool_use",id:z.toolCallId,name:z.input.type,input:z.input,cache_control:F});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,...I}=z.input;x.push({type:"server_tool_use",id:z.toolCallId,name:"code_execution",input:I,cache_control:F})}else if(A==="code_execution"||A==="web_fetch"||A==="web_search")x.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:F});else if(A==="tool_search_tool_regex"||A==="tool_search_tool_bm25")x.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:F});else Z.push({type:"other",message:`provider executed tool call for tool ${z.toolName} is not supported`});break}let U=(v=z.providerOptions)==null?void 0:v.anthropic,K=(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;x.push({type:"tool_use",id:z.toolCallId,name:z.toolName,input:z.input,...K&&{caller:K},cache_control:F});break}case"tool-result":{let U=f.toProviderToolName(z.toolName);if(o.has(z.toolCallId)){let K=z.output;if(K.type!=="json"&&K.type!=="error-json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}x.push({type:"mcp_tool_result",tool_use_id:z.toolCallId,is_error:K.type==="error-json",content:K.value,cache_control:F})}else if(U==="code_execution"){let K=z.output;if(K.type==="error-text"||K.type==="error-json"){let A={};try{if(typeof K.value==="string")A=JSON.parse(K.value);else if(typeof K.value==="object"&&K.value!==null)A=K.value}catch($){}if(A.type==="code_execution_tool_result_error")x.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:"code_execution_tool_result_error",error_code:(g=A.errorCode)!=null?g:"unknown"},cache_control:F});else x.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:F,content:{type:"bash_code_execution_tool_result_error",error_code:(C=A.errorCode)!=null?C:"unknown"}});break}if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}if(K.value==null||typeof K.value!=="object"||!("type"in K.value)||typeof K.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(K.value.type==="code_execution_result"){let A=await GG({value:K.value,schema:hG});x.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:F})}else if(K.value.type==="encrypted_code_execution_result"){let A=await GG({value:K.value,schema:mG});if(A.type==="encrypted_code_execution_result")x.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:(N=A.content)!=null?N:[]},cache_control:F})}else{let A=await GG({value:K.value,schema:gG});if(A.type==="code_execution_result")x.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:F});else if(A.type==="bash_code_execution_result"||A.type==="bash_code_execution_tool_result_error")x.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:F,content:A});else x.push({type:"text_editor_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:F,content:A})}break}if(U==="web_fetch"){let K=z.output;if(K.type==="error-json"){let $={};try{if(typeof K.value==="string")$=JSON.parse(K.value);else if(typeof K.value==="object"&&K.value!==null)$=K.value}catch(X){let I=(QG=K.value)==null?void 0:QG.errorCode;$={errorCode:typeof I==="string"?I:"unavailable"}}x.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:F});break}if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:K.value,schema:_G});x.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:F});break}if(U==="web_search"){let K=z.output;if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:K.value,schema:vG});x.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:F});break}if(U==="tool_search_tool_regex"||U==="tool_search_tool_bm25"){let K=z.output;if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}let $=(await GG({value:K.value,schema:dG})).map((X)=>({type:"tool_reference",tool_name:X.toolName}));x.push({type:"tool_search_tool_result",tool_use_id:z.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:$},cache_control:F});break}Z.push({type:"other",message:`provider executed tool result for tool ${z.toolName} is not supported`});break}}}}XG.push({role:"assistant",content:x});break}default:throw Error(`content type: ${ZG}`)}}return{prompt:{system:p,messages:XG},betas:Y}}function TQ(Q){let H=[],Z=void 0;for(let W of Q){let{role:f}=W;switch(f){case"system":{if((Z==null?void 0:Z.type)!=="system")Z={type:"system",messages:[]},H.push(Z);Z.messages.push(W);break}case"assistant":{if((Z==null?void 0:Z.type)!=="assistant")Z={type:"assistant",messages:[]},H.push(Z);Z.messages.push(W);break}case"user":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(W);break}case"tool":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(W);break}default:throw Error(`Unsupported role: ${f}`)}}return H}function DG({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 fG(Q,H,Z){var W;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 f=H[Q.document_index];if(!f)return;return{type:"source",sourceType:"document",id:Z(),mediaType:f.mediaType,title:(W=Q.document_title)!=null?W:f.title,filename:f.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 TX=class{constructor(Q,H){this.specificationVersion="v3";var Z;this.modelId=Q,this.config=H,this.generateId=(Z=H.generateId)!=null?Z:CG}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:W,topP:f,topK:h,frequencyPenalty:_,presencePenalty:b,stopSequences:l,responseFormat:M,seed:B,tools:u,toolChoice:R,providerOptions:a,stream:E}){var P,v,g,C,e,N,s,QG,YG,Y;let j=[];if(_!=null)j.push({type:"unsupported",feature:"frequencyPenalty"});if(b!=null)j.push({type:"unsupported",feature:"presencePenalty"});if(B!=null)j.push({type:"unsupported",feature:"seed"});if(W!=null&&W>1)j.push({type:"unsupported",feature:"temperature",details:`${W} exceeds anthropic maximum of 1.0. clamped to 1.0`}),W=1;else if(W!=null&&W<0)j.push({type:"unsupported",feature:"temperature",details:`${W} is below anthropic minimum of 0. clamped to 0`}),W=0;if((M==null?void 0:M.type)==="json"){if(M.schema==null)j.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."})}let w=this.providerOptionsName,p=await LG({provider:"anthropic",providerOptions:a,schema:yG}),XG=w!=="anthropic"?await LG({provider:w,providerOptions:a,schema:yG}):null,zG=XG!=null,L=Object.assign({},p!=null?p:{},XG!=null?XG:{}),{maxOutputTokens:O,supportsStructuredOutput:T,rejectsSamplingParameters:V,isKnownModel:ZG}=OQ(this.modelId);if(V){if(W!=null)j.push({type:"unsupported",feature:"temperature",details:`temperature is not supported by ${this.modelId} and will be ignored`}),W=void 0;if(h!=null)j.push({type:"unsupported",feature:"topK",details:`topK is not supported by ${this.modelId} and will be ignored`}),h=void 0;if(f!=null)j.push({type:"unsupported",feature:"topP",details:`topP is not supported by ${this.modelId} and will be ignored`}),f=void 0}let x=ZG||this.modelId.startsWith("claude-"),o=((P=this.config.supportsNativeStructuredOutput)!=null?P:!0)&&T,t=((v=this.config.supportsStrictTools)!=null?v:!0)&&T,r=(g=L==null?void 0:L.structuredOutputMode)!=null?g:"auto",c=r==="outputFormat"||r==="auto"&&o,y=(M==null?void 0:M.type)==="json"&&M.schema!=null&&!c?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:M.schema}:void 0,n=L==null?void 0:L.contextManagement,z=new VG,m=NG({tools:u,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:F,betas:U}=await bQ({prompt:H,sendReasoning:(C=L==null?void 0:L.sendReasoning)!=null?C:!0,warnings:j,cacheControlValidator:z,toolNameMapping:m}),K=(e=L==null?void 0:L.thinking)==null?void 0:e.type,A=K==="enabled"||K==="adaptive",$=K==="enabled"?(N=L==null?void 0:L.thinking)==null?void 0:N.budgetTokens:void 0,X=K==="adaptive"?(s=L==null?void 0:L.thinking)==null?void 0:s.display:void 0,I=Z!=null?Z:O,q={model:this.modelId,max_tokens:I,temperature:W,top_k:h,top_p:f,stop_sequences:l,...A&&{thinking:{type:K,...$!=null&&{budget_tokens:$},...X!=null&&{display:X}}},...((L==null?void 0:L.effort)||(L==null?void 0:L.taskBudget)||c&&(M==null?void 0:M.type)==="json"&&M.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}}},...c&&(M==null?void 0:M.type)==="json"&&M.schema!=null&&{format:{type:"json_schema",schema:M.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((S)=>({type:S.type,name:S.name,url:S.url,authorization_token:S.authorizationToken,tool_configuration:S.toolConfiguration?{allowed_tools:S.toolConfiguration.allowedTools,enabled:S.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((S)=>({type:S.type,skill_id:S.skillId,version:S.version}))}:L.container.id},system:F.system,messages:F.messages,...n&&{context_management:{edits:n.edits.map((S)=>{let RG=S.type;switch(RG){case"clear_tool_uses_20250919":return{type:S.type,...S.trigger!==void 0&&{trigger:S.trigger},...S.keep!==void 0&&{keep:S.keep},...S.clearAtLeast!==void 0&&{clear_at_least:S.clearAtLeast},...S.clearToolInputs!==void 0&&{clear_tool_inputs:S.clearToolInputs},...S.excludeTools!==void 0&&{exclude_tools:S.excludeTools}};case"clear_thinking_20251015":return{type:S.type,...S.keep!==void 0&&{keep:S.keep}};case"compact_20260112":return{type:S.type,...S.trigger!==void 0&&{trigger:S.trigger},...S.pauseAfterCompaction!==void 0&&{pause_after_compaction:S.pauseAfterCompaction},...S.instructions!==void 0&&{instructions:S.instructions}};default:j.push({type:"other",message:`Unknown context management strategy: ${RG}`});return}}).filter((S)=>S!==void 0)}}};if(A){if(K==="enabled"&&$==null)j.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),q.thinking={type:"enabled",budget_tokens:1024},$=1024;if(q.temperature!=null)q.temperature=void 0,j.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"});if(h!=null)q.top_k=void 0,j.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"});if(f!=null)q.top_p=void 0,j.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"});q.max_tokens=I+($!=null?$:0)}else if(x&&f!=null&&W!=null)j.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),q.top_p=void 0;if(ZG&&q.max_tokens>O){if(Z!=null)j.push({type:"unsupported",feature:"maxOutputTokens",details:`${q.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${O} max output tokens. The max output tokens have been limited to ${O}.`});q.max_tokens=O}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((S)=>S.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"),!(u==null?void 0:u.some((S)=>S.type==="provider"&&(S.id==="anthropic.code_execution_20250825"||S.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 k=E&&((YG=L==null?void 0:L.toolStreaming)!=null?YG:!0),{tools:$G,toolChoice:UG,toolWarnings:AG,betas:uG}=await UQ(y!=null?{tools:[...u!=null?u:[],y],toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:z,supportsStructuredOutput:!1,supportsStrictTools:t,defaultEagerInputStreaming:k}:{tools:u!=null?u:[],toolChoice:R,disableParallelToolUse:L==null?void 0:L.disableParallelToolUse,cacheControlValidator:z,supportsStructuredOutput:o,supportsStrictTools:t,defaultEagerInputStreaming:k}),cG=z.getWarnings();return{args:{...q,tools:$G,tool_choice:UG,stream:E===!0?!0:void 0},warnings:[...j,...AG,...cG],betas:new Set([...U,...uG,...Q,...(Y=L==null?void 0:L.anthropicBeta)!=null?Y:[]]),usesJsonResponseTool:y!=null,toolNameMapping:m,providerOptionsName:w,usedCustomProviderKey:zG}}async getHeaders({betas:Q,headers:H}){return wG(await jG(this.config.headers),H,Q.size>0?{"anthropic-beta":Array.from(Q).join(",")}:{})}async getBetasFromHeaders(Q){var H,Z;let f=(H=(await jG(this.config.headers))["anthropic-beta"])!=null?H:"",h=(Z=Q==null?void 0:Q["anthropic-beta"])!=null?Z:"";return new Set([...f.toLowerCase().split(","),...h.toLowerCase().split(",")].map((_)=>_.trim()).filter((_)=>_!==""))}buildRequestUrl(Q){var H,Z,W;return(W=(Z=(H=this.config).buildRequestUrl)==null?void 0:Z.call(H,this.config.baseURL,Q))!=null?W:`${this.config.baseURL}/messages`}transformRequestBody(Q,H){var Z,W,f;return(f=(W=(Z=this.config).transformRequestBody)==null?void 0:W.call(Z,Q,H))!=null?f:Q}extractCitationDocuments(Q){let H=(Z)=>{var W,f;if(Z.type!=="file")return!1;if(Z.mediaType!=="application/pdf"&&Z.mediaType!=="text/plain")return!1;let h=(W=Z.providerOptions)==null?void 0:W.anthropic,_=h==null?void 0:h.citations;return(f=_==null?void 0:_.enabled)!=null?f:!1};return Q.filter((Z)=>Z.role==="user").flatMap((Z)=>Z.content).filter(H).map((Z)=>{var W;let f=Z;return{title:(W=f.filename)!=null?W:"Untitled Document",filename:f.filename,mediaType:f.mediaType}})}async doGenerate(Q){var H,Z,W,f,h,_,b;let{args:l,warnings:M,betas:B,usesJsonResponseTool:u,toolNameMapping:R,providerOptionsName:a,usedCustomProviderKey:E}=await this.getArgs({...Q,stream:!1,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),P=[...this.extractCitationDocuments(Q.prompt)],v=PG(l.tools),{responseHeaders:g,value:C,rawValue:e}=await WG({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:B,headers:Q.headers}),body:this.transformRequestBody(l,B),failedResponseHandler:EG,successfulResponseHandler:kG(lG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),N=[],s={},QG={},YG=!1;for(let Y of C.content)switch(Y.type){case"text":{if(!u){if(N.push({type:"text",text:Y.text}),Y.citations)for(let j of Y.citations){let w=fG(j,P,this.generateId);if(w)N.push(w)}}break}case"thinking":{N.push({type:"reasoning",text:Y.thinking,providerMetadata:{anthropic:{signature:Y.signature}}});break}case"redacted_thinking":{N.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:Y.data}}});break}case"compaction":{N.push({type:"text",text:Y.content,providerMetadata:{anthropic:{type:"compaction"}}});break}case"tool_use":{if(u&&Y.name==="json")YG=!0,N.push({type:"text",text:JSON.stringify(Y.input)});else{let w=Y.caller,p=w?{type:w.type,toolId:"tool_id"in w?w.tool_id:void 0}:void 0;N.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")N.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;N.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(j),providerExecuted:!0,...v&&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,N.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}}},N.push(s[Y.id]);break}case"mcp_tool_result":{N.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")P.push({title:(H=Y.content.content.title)!=null?H:Y.content.url,mediaType:Y.content.content.source.media_type}),N.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")N.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)){N.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),result:Y.content.map((j)=>{var w;return{url:j.url,title:j.title,pageAge:(w=j.page_age)!=null?w:null,encryptedContent:j.encrypted_content,type:j.type}})});for(let j of Y.content)N.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 N.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")N.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:(W=Y.content.content)!=null?W:[]}});else if(Y.content.type==="encrypted_code_execution_result")N.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:(f=Y.content.content)!=null?f:[]}});else if(Y.content.type==="code_execution_tool_result_error")N.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":{N.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 w=R.toCustomToolName("tool_search_tool_bm25"),p=R.toCustomToolName("tool_search_tool_regex");if(w!=="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")N.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),result:Y.content.tool_references.map((w)=>({type:w.type,toolName:w.tool_name}))});else N.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:N,finishReason:{unified:DG({finishReason:C.stop_reason,isJsonResponseFromTool:YG}),raw:(h=C.stop_reason)!=null?h:void 0},usage:IG({usage:C.usage}),request:{body:l},response:{id:(_=C.id)!=null?_:void 0,modelId:(b=C.model)!=null?b:void 0,headers:g,body:e},warnings:M,providerMetadata:(()=>{var Y,j,w,p,XG;let zG={usage:C.usage,cacheCreationInputTokens:(Y=C.usage.cache_creation_input_tokens)!=null?Y:null,stopSequence:(j=C.stop_sequence)!=null?j:null,iterations:C.usage.iterations?C.usage.iterations.map((O)=>({type:O.type,inputTokens:O.input_tokens,outputTokens:O.output_tokens})):null,container:C.container?{expiresAt:C.container.expires_at,id:C.container.id,skills:(p=(w=C.container.skills)==null?void 0:w.map((O)=>({type:O.type,skillId:O.skill_id,version:O.version})))!=null?p:null}:null,contextManagement:(XG=xG(C.context_management))!=null?XG:null},L={anthropic:zG};if(E&&a!=="anthropic")L[a]=zG;return L})()}}async doStream(Q){var H,Z;let{args:W,warnings:f,betas:h,usesJsonResponseTool:_,toolNameMapping:b,providerOptionsName:l,usedCustomProviderKey:M}=await this.getArgs({...Q,stream:!0,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),B=[...this.extractCitationDocuments(Q.prompt)],u=PG(W.tools),R=this.buildRequestUrl(!0),{responseHeaders:a,value:E}=await WG({url:R,headers:await this.getHeaders({betas:h,headers:Q.headers}),body:this.transformRequestBody(W,h),failedResponseHandler:EG,successfulResponseHandler:OG(sG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),P={unified:"other",raw:void 0},v={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},g={},C={},e={},N=null,s=void 0,QG=null,YG=null,Y=null,j=!1,w=void 0,p=this.generateId,XG=E.pipeThrough(new TransformStream({start(T){T.enqueue({type:"stream-start",warnings:f})},transform(T,V){var ZG,x,o,t,r,c,y,n,z,m,F,U,K,A;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:T.rawValue});if(!T.success){V.enqueue({type:"error",error:T.error});return}let $=T.value;switch($.type){case"ping":return;case"content_block_start":{let X=$.content_block,I=X.type;switch(w=I,I){case"text":{if(_)return;g[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});return}case"thinking":{g[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index)});return}case"redacted_thinking":{g[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index),providerMetadata:{anthropic:{redactedData:X.data}}});return}case"compaction":{g[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index),providerMetadata:{anthropic:{type:"compaction"}}});return}case"tool_use":{if(_&&X.name==="json")j=!0,g[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});else{let k=X.caller,$G=k?{type:k.type,toolId:"tool_id"in k?k.tool_id:void 0}:void 0,AG=X.input&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";g[$.index]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:AG,firstDelta:AG.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 q=X.name==="text_editor_code_execution"||X.name==="bash_code_execution"?"code_execution":X.name,k=b.toCustomToolName(q),$G=X.input!=null&&typeof X.input==="object"&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";g[$.index]={type:"tool-call",toolCallId:X.id,toolName:k,input:$G,providerExecuted:!0,...u&&q==="code_execution"?{dynamic:!0}:{},firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:k,providerExecuted:!0,...u&&q==="code_execution"?{dynamic:!0}:{}})}else if(X.name==="tool_search_tool_regex"||X.name==="tool_search_tool_bm25"){e[X.id]=X.name;let q=b.toCustomToolName(X.name);g[$.index]={type:"tool-call",toolCallId:X.id,toolName:q,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:q,providerExecuted:!0})}return}case"web_fetch_tool_result":{if(X.content.type==="web_fetch_result")B.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:b.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:b.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:b.toCustomToolName("web_search"),result:X.content.map((q)=>{var k;return{url:q.url,title:q.title,pageAge:(k=q.page_age)!=null?k:null,encryptedContent:q.encrypted_content,type:q.type}})});for(let q of X.content)V.enqueue({type:"source",sourceType:"url",id:p(),url:q.url,title:q.title,providerMetadata:{anthropic:{pageAge:(x=q.page_age)!=null?x:null}}})}else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:b.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:b.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:b.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:b.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:b.toCustomToolName("code_execution"),result:X.content});return}case"tool_search_tool_result":{let q=e[X.tool_use_id];if(q==null){let k=b.toCustomToolName("tool_search_tool_bm25"),$G=b.toCustomToolName("tool_search_tool_regex");if(k!=="tool_search_tool_bm25")q="tool_search_tool_bm25";else if($G!=="tool_search_tool_regex")q="tool_search_tool_regex";else q="tool_search_tool_regex"}if(X.content.type==="tool_search_tool_search_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:b.toCustomToolName(q),result:X.content.tool_references.map((k)=>({type:k.type,toolName:k.tool_name}))});else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:b.toCustomToolName(q),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:X.content.error_code}});return}case"mcp_tool_use":{C[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(C[X.id]);return}case"mcp_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:C[X.tool_use_id].toolName,isError:X.is_error,result:X.content,dynamic:!0,providerMetadata:C[X.tool_use_id].providerMetadata});return}default:throw Error(`Unsupported content block type: ${I}`)}}case"content_block_stop":{if(g[$.index]!=null){let X=g[$.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(!(_&&X.toolName==="json")){V.enqueue({type:"tool-input-end",id:X.toolCallId});let q=X.input===""?"{}":X.input;if(X.providerToolName==="code_execution")try{let k=JSON.parse(q);if(k!=null&&typeof k==="object"&&"code"in k&&!("type"in k))q=JSON.stringify({type:"programmatic-tool-call",...k})}catch(k){}V.enqueue({type:"tool-call",toolCallId:X.toolCallId,toolName:X.toolName,input:q,providerExecuted:X.providerExecuted,...u&&X.providerToolName==="code_execution"?{dynamic:!0}:{},...X.caller&&{providerMetadata:{anthropic:{caller:X.caller}}}})}break}delete g[$.index]}w=void 0;return}case"content_block_delta":{let X=$.delta.type;switch(X){case"text_delta":{if(_)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(w==="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 I=g[$.index],q=$.delta.partial_json;if(q.length===0)return;if(j){if((I==null?void 0:I.type)!=="text")return;V.enqueue({type:"text-delta",id:String($.index),delta:q})}else{if((I==null?void 0:I.type)!=="tool-call")return;if(I.firstDelta&&(I.providerToolName==="bash_code_execution"||I.providerToolName==="text_editor_code_execution"))q=`{"type": "${I.providerToolName}",${q.substring(1)}`;V.enqueue({type:"tool-input-delta",id:I.toolCallId,delta:q}),I.input+=q,I.firstDelta=!1}return}case"citations_delta":{let I=$.delta.citation,q=fG(I,B,p);if(q)V.enqueue(q);return}default:throw Error(`Unsupported delta type: ${X}`)}}case"message_start":{if(v.input_tokens=$.message.usage.input_tokens,v.cache_read_input_tokens=(r=$.message.usage.cache_read_input_tokens)!=null?r:0,v.cache_creation_input_tokens=(c=$.message.usage.cache_creation_input_tokens)!=null?c:0,s={...$.message.usage},QG=(y=$.message.usage.cache_creation_input_tokens)!=null?y:null,$.message.container!=null)Y={expiresAt:$.message.container.expires_at,id:$.message.container.id,skills:null};if($.message.stop_reason!=null)P={unified:DG({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 I=$.message.content[X];if(I.type==="tool_use"){let q=I.caller,k=q?{type:q.type,toolId:"tool_id"in q?q.tool_id:void 0}:void 0;V.enqueue({type:"tool-input-start",id:I.id,toolName:I.name});let $G=JSON.stringify((m=I.input)!=null?m:{});V.enqueue({type:"tool-input-delta",id:I.id,delta:$G}),V.enqueue({type:"tool-input-end",id:I.id}),V.enqueue({type:"tool-call",toolCallId:I.id,toolName:I.name,input:$G,...k&&{providerMetadata:{anthropic:{caller:k}}}})}}return}case"message_delta":{if($.usage.input_tokens!=null&&v.input_tokens!==$.usage.input_tokens)v.input_tokens=$.usage.input_tokens;if(v.output_tokens=$.usage.output_tokens,$.usage.cache_read_input_tokens!=null)v.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.cache_creation_input_tokens!=null)v.cache_creation_input_tokens=$.usage.cache_creation_input_tokens,QG=$.usage.cache_creation_input_tokens;if($.usage.iterations!=null)v.iterations=$.usage.iterations;if(P={unified:DG({finishReason:$.delta.stop_reason,isJsonResponseFromTool:j}),raw:(F=$.delta.stop_reason)!=null?F: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=(K=$.delta.container.skills)==null?void 0:K.map((X)=>({type:X.type,skillId:X.skill_id,version:X.version})))!=null?A:null}:null,$.context_management)N=xG($.context_management);s={...s,...$.usage};return}case"message_stop":{let X={usage:s!=null?s:null,cacheCreationInputTokens:QG,stopSequence:YG,iterations:v.iterations?v.iterations.map((q)=>({type:q.type,inputTokens:q.input_tokens,outputTokens:q.output_tokens})):null,container:Y,contextManagement:N},I={anthropic:X};if(M&&l!=="anthropic")I[l]=X;V.enqueue({type:"finish",finishReason:P,usage:IG({usage:v,rawUsage:s}),providerMetadata:I});return}case"error":{V.enqueue({type:"error",error:$.error});return}default:throw Error(`Unsupported chunk type: ${$}`)}}})),[zG,L]=XG.tee(),O=zG.getReader();try{await O.read();let T=await O.read();if(((H=T.value)==null?void 0:H.type)==="raw")T=await O.read();if(((Z=T.value)==null?void 0:Z.type)==="error"){let V=T.value.error;throw new BG({message:V.message,url:R,requestBodyValues:W,statusCode:V.type==="overloaded_error"?529:500,responseHeaders:a,responseBody:JSON.stringify(V),isRetryable:V.type==="overloaded_error"})}}finally{O.cancel().catch(()=>{}),O.releaseLock()}return{stream:L,request:{body:W},response:{headers:a}}}};function OQ(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 PG(Q){if(!Q)return!1;let H=!1,Z=!1;for(let W of Q){if("type"in W&&(W.type==="web_fetch_20260209"||W.type==="web_search_20260209")){H=!0;continue}if(W.name==="code_execution"){Z=!0;break}}return H&&!Z}function xG(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 kQ=D(()=>J(G.object({command:G.string(),restart:G.boolean().optional()}))),vQ=d({id:"anthropic.bash_20241022",inputSchema:kQ}),_Q=D(()=>J(G.object({command:G.string(),restart:G.boolean().optional()}))),hQ=d({id:"anthropic.bash_20250124",inputSchema:_Q}),gQ=D(()=>J(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()}))),mQ=d({id:"anthropic.computer_20241022",inputSchema:gQ}),dQ=D(()=>J(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()}))),uQ=d({id:"anthropic.computer_20250124",inputSchema:dQ}),cQ=D(()=>J(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()}))),iQ=d({id:"anthropic.computer_20251124",inputSchema:cQ}),lQ=D(()=>J(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()})]))),sQ=d({id:"anthropic.memory_20250818",inputSchema:lQ}),pQ=D(()=>J(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()}))),nQ=d({id:"anthropic.text_editor_20241022",inputSchema:pQ}),rQ=D(()=>J(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()}))),aQ=d({id:"anthropic.text_editor_20250124",inputSchema:rQ}),eQ=D(()=>J(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()}))),oQ=d({id:"anthropic.text_editor_20250429",inputSchema:eQ}),tQ=D(()=>J(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),GX=D(()=>J(G.object({query:G.string(),limit:G.number().optional()}))),QX=i({id:"anthropic.tool_search_bm25_20251119",inputSchema:GX,outputSchema:tQ,supportsDeferredResults:!0}),XX=(Q={})=>{return QX(Q)},GY={bash_20241022:vQ,bash_20250124:hQ,codeExecution_20250522:SQ,codeExecution_20250825:IQ,codeExecution_20260120:xQ,computer_20241022:mQ,computer_20250124:uQ,computer_20251124:iQ,memory_20250818:sQ,textEditor_20241022:nQ,textEditor_20250124:aQ,textEditor_20250429:oQ,textEditor_20250728:oG,webFetch_20250910:VQ,webFetch_20260209:DQ,webSearch_20250305:LQ,webSearch_20260209:YQ,toolSearchRegex_20251119:NQ,toolSearchBm25_20251119:XX};
|
|
3
|
-
export{UQ as
|
|
2
|
+
import{Ao as JG,Jo as CG,Qo as bG,Wo as D,Zo as J,_o as GG,ep as LG,fp as WG,jp as d,kp as i,lp as jG,mp as TG,np as OG,op as kG,to as wG,uo as NG,yo as MG}from"./chunk-mkyrg7gt.js";import{Hp as HG,vp as BG}from"./chunk-7v4fzkbb.js";import{ut as G}from"./chunk-ym4ydwrz.js";var iG=D(()=>J(G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}))),EG=TG({errorSchema:iG,errorToMessage:(Q)=>Q.error.message}),lG=D(()=>J(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()}))),sG=D(()=>J(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")})]))),pG=D(()=>J(G.object({signature:G.string().optional(),redactedData:G.string().optional()}))),SG=G.object({citations:G.object({enabled:G.boolean()}).optional(),title:G.string().optional(),context:G.string().optional()}),yG=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()}),FG=4;function nG(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 VG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(Q,H){let Z=nG(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>FG){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:`Maximum ${FG} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`});return}return Z}getWarnings(){return this.warnings}},rG=D(()=>J(G.object({maxCharacters:G.number().optional()}))),aG=D(()=>J(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()}))),eG=d({id:"anthropic.text_editor_20250728",inputSchema:aG}),oG=(Q={})=>{return eG(Q)},tG=D(()=>J(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()}))),GQ=D(()=>J(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),QQ=D(()=>J(G.object({query:G.string()}))),XQ=i({id:"anthropic.web_search_20260209",inputSchema:QQ,outputSchema:GQ,supportsDeferredResults:!0}),YQ=(Q={})=>{return XQ(Q)},ZQ=D(()=>J(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()}))),vG=D(()=>J(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),$Q=D(()=>J(G.object({query:G.string()}))),zQ=i({id:"anthropic.web_search_20250305",inputSchema:$Q,outputSchema:vG,supportsDeferredResults:!0}),LQ=(Q={})=>{return zQ(Q)},HQ=D(()=>J(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()}))),AQ=D(()=>J(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()}))),qQ=D(()=>J(G.object({url:G.string()}))),KQ=i({id:"anthropic.web_fetch_20260209",inputSchema:qQ,outputSchema:AQ,supportsDeferredResults:!0}),DQ=(Q={})=>{return KQ(Q)},JQ=D(()=>J(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()}))),_G=D(()=>J(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()}))),WQ=D(()=>J(G.object({url:G.string()}))),jQ=i({id:"anthropic.web_fetch_20250910",inputSchema:WQ,outputSchema:_G,supportsDeferredResults:!0}),VQ=(Q={})=>{return jQ(Q)};async function UQ({tools:Q,toolChoice:H,disableParallelToolUse:Z,cacheControlValidator:W,supportsStructuredOutput:f,supportsStrictTools:h,defaultEagerInputStreaming:_=!1}){var b,l;Q=(Q==null?void 0:Q.length)?Q:void 0;let M=[],B=new Set,u=W||new VG;if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:M,betas:B};let R=[];for(let E of Q)switch(E.type){case"function":{let P=u.getCacheControl(E.providerOptions,{type:"tool definition",canCache:!0}),v=(b=E.providerOptions)==null?void 0:b.anthropic,g=(l=v==null?void 0:v.eagerInputStreaming)!=null?l:_,C=v==null?void 0:v.deferLoading,e=v==null?void 0:v.allowedCallers;if(!h&&E.strict!=null)M.push({type:"unsupported",feature:"strict",details:`Tool '${E.name}' has strict: ${E.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`});if(R.push({name:E.name,description:E.description,input_schema:E.inputSchema,cache_control:P,...g?{eager_input_streaming:!0}:{},...h===!0&&E.strict!=null?{strict:E.strict}:{},...C!=null?{defer_loading:C}:{},...e!=null?{allowed_callers:e}:{},...E.inputExamples!=null?{input_examples:E.inputExamples.map((N)=>N.input)}:{}}),f===!0)B.add("structured-outputs-2025-11-13");if(E.inputExamples!=null||e!=null)B.add("advanced-tool-use-2025-11-20");break}case"provider":{switch(E.id){case"anthropic.code_execution_20250522":{B.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":{B.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":{B.add("computer-use-2025-01-24"),R.push({name:"computer",type:"computer_20250124",display_width_px:E.args.displayWidthPx,display_height_px:E.args.displayHeightPx,display_number:E.args.displayNumber,cache_control:void 0});break}case"anthropic.computer_20251124":{B.add("computer-use-2025-11-24"),R.push({name:"computer",type:"computer_20251124",display_width_px:E.args.displayWidthPx,display_height_px:E.args.displayHeightPx,display_number:E.args.displayNumber,enable_zoom:E.args.enableZoom,cache_control:void 0});break}case"anthropic.computer_20241022":{B.add("computer-use-2024-10-22"),R.push({name:"computer",type:"computer_20241022",display_width_px:E.args.displayWidthPx,display_height_px:E.args.displayHeightPx,display_number:E.args.displayNumber,cache_control:void 0});break}case"anthropic.text_editor_20250124":{B.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":{B.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":{B.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 P=await GG({value:E.args,schema:rG});R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:P.maxCharacters,cache_control:void 0});break}case"anthropic.bash_20250124":{B.add("computer-use-2025-01-24"),R.push({name:"bash",type:"bash_20250124",cache_control:void 0});break}case"anthropic.bash_20241022":{B.add("computer-use-2024-10-22"),R.push({name:"bash",type:"bash_20241022",cache_control:void 0});break}case"anthropic.memory_20250818":{B.add("context-management-2025-06-27"),R.push({name:"memory",type:"memory_20250818"});break}case"anthropic.web_fetch_20250910":{B.add("web-fetch-2025-09-10");let P=await GG({value:E.args,schema:JQ});R.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,citations:P.citations,max_content_tokens:P.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260209":{B.add("code-execution-web-tools-2026-02-09");let P=await GG({value:E.args,schema:HQ});R.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,citations:P.citations,max_content_tokens:P.maxContentTokens,cache_control:void 0});break}case"anthropic.web_search_20250305":{let P=await GG({value:E.args,schema:ZQ});R.push({type:"web_search_20250305",name:"web_search",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,user_location:P.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260209":{B.add("code-execution-web-tools-2026-02-09");let P=await GG({value:E.args,schema:tG});R.push({type:"web_search_20260209",name:"web_search",max_uses:P.maxUses,allowed_domains:P.allowedDomains,blocked_domains:P.blockedDomains,user_location:P.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:{M.push({type:"unsupported",feature:`provider-defined tool ${E.id}`});break}}break}default:{M.push({type:"unsupported",feature:`tool ${E}`});break}}if(H==null)return{tools:R,toolChoice:Z?{type:"auto",disable_parallel_tool_use:Z}:void 0,toolWarnings:M,betas:B};let a=H.type;switch(a){case"auto":return{tools:R,toolChoice:{type:"auto",disable_parallel_tool_use:Z},toolWarnings:M,betas:B};case"required":return{tools:R,toolChoice:{type:"any",disable_parallel_tool_use:Z},toolWarnings:M,betas:B};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:M,betas:B};case"tool":return{tools:R,toolChoice:{type:"tool",name:H.toolName,disable_parallel_tool_use:Z},toolWarnings:M,betas:B};default:throw new HG({functionality:`tool choice type: ${a}`})}}function IG({usage:Q,rawUsage:H}){var Z,W;let f=(Z=Q.cache_creation_input_tokens)!=null?Z:0,h=(W=Q.cache_read_input_tokens)!=null?W:0,_,b;if(Q.iterations&&Q.iterations.length>0){let l=Q.iterations.reduce((M,B)=>({input:M.input+B.input_tokens,output:M.output+B.output_tokens}),{input:0,output:0});_=l.input,b=l.output}else _=Q.input_tokens,b=Q.output_tokens;return{inputTokens:{total:_+f+h,noCache:_,cacheRead:h,cacheWrite:f},outputTokens:{total:b,text:void 0,reasoning:void 0},raw:H!=null?H:Q}}var hG=D(()=>J(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([])}))),RQ=D(()=>J(G.object({code:G.string()}))),EQ=i({id:"anthropic.code_execution_20250522",inputSchema:RQ,outputSchema:hG}),SQ=(Q={})=>{return EQ(Q)},gG=D(()=>J(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()})]))),yQ=D(()=>J(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()})])]))),FQ=i({id:"anthropic.code_execution_20250825",inputSchema:yQ,outputSchema:gG,supportsDeferredResults:!0}),IQ=(Q={})=>{return FQ(Q)},mG=D(()=>J(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()})]))),fQ=D(()=>J(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()})])]))),PQ=i({id:"anthropic.code_execution_20260120",inputSchema:fQ,outputSchema:mG,supportsDeferredResults:!0}),xQ=(Q={})=>{return PQ(Q)},dG=D(()=>J(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),BQ=D(()=>J(G.object({pattern:G.string(),limit:G.number().optional()}))),wQ=i({id:"anthropic.tool_search_regex_20251119",inputSchema:BQ,outputSchema:dG,supportsDeferredResults:!0}),NQ=(Q={})=>{return wQ(Q)};function MQ(Q){if(typeof Q==="string")return new TextDecoder().decode(MG(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 qG(Q){return Q instanceof URL||CQ(Q)}function CQ(Q){return typeof Q==="string"&&/^https?:\/\//i.test(Q)}function KG(Q){return Q instanceof URL?Q.toString():Q}async function bQ({prompt:Q,sendReasoning:H,warnings:Z,cacheControlValidator:W,toolNameMapping:f}){var h,_,b,l,M,B,u,R,a,E,P,v,g,C,e,N,s,QG,YG;let Y=new Set,j=TQ(Q),w=W||new VG,p=void 0,XG=[];async function zG(O){var T,V;let ZG=await LG({provider:"anthropic",providerOptions:O,schema:SG});return(V=(T=ZG==null?void 0:ZG.citations)==null?void 0:T.enabled)!=null?V:!1}async function L(O){let T=await LG({provider:"anthropic",providerOptions:O,schema:SG});return{title:T==null?void 0:T.title,context:T==null?void 0:T.context}}for(let O=0;O<j.length;O++){let T=j[O],V=O===j.length-1,ZG=T.type;switch(ZG){case"system":{if(p!=null)throw new HG({functionality:"Multiple system messages that are separated by user/assistant messages"});p=T.messages.map(({content:x,providerOptions:o})=>({type:"text",text:x,cache_control:w.getCacheControl(o,{type:"system message",canCache:!0})}));break}case"user":{let x=[];for(let o of T.messages){let{role:t,content:r}=o;switch(t){case"user":{for(let c=0;c<r.length;c++){let y=r[c],n=c===r.length-1,z=(h=w.getCacheControl(y.providerOptions,{type:"user message part",canCache:!0}))!=null?h:n?w.getCacheControl(o.providerOptions,{type:"user message",canCache:!0}):void 0;switch(y.type){case"text":{x.push({type:"text",text:y.text,cache_control:z});break}case"file":{if(y.mediaType.startsWith("image/"))x.push({type:"image",source:qG(y.data)?{type:"url",url:KG(y.data)}:{type:"base64",media_type:y.mediaType==="image/*"?"image/jpeg":y.mediaType,data:JG(y.data)},cache_control:z});else if(y.mediaType==="application/pdf"){Y.add("pdfs-2024-09-25");let m=await zG(y.providerOptions),F=await L(y.providerOptions);x.push({type:"document",source:qG(y.data)?{type:"url",url:KG(y.data)}:{type:"base64",media_type:"application/pdf",data:JG(y.data)},title:(_=F.title)!=null?_:y.filename,...F.context&&{context:F.context},...m&&{citations:{enabled:!0}},cache_control:z})}else if(y.mediaType==="text/plain"){let m=await zG(y.providerOptions),F=await L(y.providerOptions);x.push({type:"document",source:qG(y.data)?{type:"url",url:KG(y.data)}:{type:"text",media_type:"text/plain",data:MQ(y.data)},title:(b=F.title)!=null?b:y.filename,...F.context&&{context:F.context},...m&&{citations:{enabled:!0}},cache_control:z})}else throw new HG({functionality:`media type: ${y.mediaType}`});break}}}break}case"tool":{for(let c=0;c<r.length;c++){let y=r[c];if(y.type==="tool-approval-response")continue;let n=c===r.length-1,z=(l=w.getCacheControl(y.providerOptions,{type:"tool result part",canCache:!0}))!=null?l:n?w.getCacheControl(o.providerOptions,{type:"tool result message",canCache:!0}):void 0,m=y.output,F;switch(m.type){case"content":F=m.value.map((U)=>{var K;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=(K=U.providerOptions)==null?void 0:K.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(bG);break;case"text":case"error-text":F=m.value;break;case"execution-denied":F=(M=m.reason)!=null?M:"Tool execution denied.";break;case"json":case"error-json":default:F=JSON.stringify(m.value);break}x.push({type:"tool_result",tool_use_id:y.toolCallId,content:F,is_error:m.type==="error-text"||m.type==="error-json"?!0:void 0,cache_control:z})}break}default:throw Error(`Unsupported role: ${t}`)}}XG.push({role:"user",content:x});break}case"assistant":{let x=[],o=new Set;for(let t=0;t<T.messages.length;t++){let r=T.messages[t],c=t===T.messages.length-1,{content:y}=r;for(let n=0;n<y.length;n++){let z=y[n],m=n===y.length-1,F=(B=w.getCacheControl(z.providerOptions,{type:"assistant message part",canCache:!0}))!=null?B:m?w.getCacheControl(r.providerOptions,{type:"assistant message",canCache:!0}):void 0;switch(z.type){case"text":{let U=(u=z.providerOptions)==null?void 0:u.anthropic;if((U==null?void 0:U.type)==="compaction")x.push({type:"compaction",content:z.text,cache_control:F});else x.push({type:"text",text:V&&c&&m?z.text.trim():z.text,cache_control:F});break}case"reasoning":{if(H){let U=await LG({provider:"anthropic",providerOptions:z.providerOptions,schema:pG});if(U!=null)if(U.signature!=null)w.getCacheControl(z.providerOptions,{type:"thinking block",canCache:!1}),x.push({type:"thinking",thinking:z.text,signature:U.signature});else if(U.redactedData!=null)w.getCacheControl(z.providerOptions,{type:"redacted thinking block",canCache:!1}),x.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=f.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=(P=(E=z.providerOptions)==null?void 0:E.anthropic)==null?void 0:P.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}x.push({type:"mcp_tool_use",id:z.toolCallId,name:z.toolName,input:z.input,server_name:X,cache_control:F})}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"))x.push({type:"server_tool_use",id:z.toolCallId,name:z.input.type,input:z.input,cache_control:F});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,...I}=z.input;x.push({type:"server_tool_use",id:z.toolCallId,name:"code_execution",input:I,cache_control:F})}else if(A==="code_execution"||A==="web_fetch"||A==="web_search")x.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:F});else if(A==="tool_search_tool_regex"||A==="tool_search_tool_bm25")x.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:F});else Z.push({type:"other",message:`provider executed tool call for tool ${z.toolName} is not supported`});break}let U=(v=z.providerOptions)==null?void 0:v.anthropic,K=(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;x.push({type:"tool_use",id:z.toolCallId,name:z.toolName,input:z.input,...K&&{caller:K},cache_control:F});break}case"tool-result":{let U=f.toProviderToolName(z.toolName);if(o.has(z.toolCallId)){let K=z.output;if(K.type!=="json"&&K.type!=="error-json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}x.push({type:"mcp_tool_result",tool_use_id:z.toolCallId,is_error:K.type==="error-json",content:K.value,cache_control:F})}else if(U==="code_execution"){let K=z.output;if(K.type==="error-text"||K.type==="error-json"){let A={};try{if(typeof K.value==="string")A=JSON.parse(K.value);else if(typeof K.value==="object"&&K.value!==null)A=K.value}catch($){}if(A.type==="code_execution_tool_result_error")x.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:"code_execution_tool_result_error",error_code:(g=A.errorCode)!=null?g:"unknown"},cache_control:F});else x.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:F,content:{type:"bash_code_execution_tool_result_error",error_code:(C=A.errorCode)!=null?C:"unknown"}});break}if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}if(K.value==null||typeof K.value!=="object"||!("type"in K.value)||typeof K.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(K.value.type==="code_execution_result"){let A=await GG({value:K.value,schema:hG});x.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:F})}else if(K.value.type==="encrypted_code_execution_result"){let A=await GG({value:K.value,schema:mG});if(A.type==="encrypted_code_execution_result")x.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:(N=A.content)!=null?N:[]},cache_control:F})}else{let A=await GG({value:K.value,schema:gG});if(A.type==="code_execution_result")x.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:F});else if(A.type==="bash_code_execution_result"||A.type==="bash_code_execution_tool_result_error")x.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:F,content:A});else x.push({type:"text_editor_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:F,content:A})}break}if(U==="web_fetch"){let K=z.output;if(K.type==="error-json"){let $={};try{if(typeof K.value==="string")$=JSON.parse(K.value);else if(typeof K.value==="object"&&K.value!==null)$=K.value}catch(X){let I=(QG=K.value)==null?void 0:QG.errorCode;$={errorCode:typeof I==="string"?I:"unavailable"}}x.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:F});break}if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:K.value,schema:_G});x.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:F});break}if(U==="web_search"){let K=z.output;if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:K.value,schema:vG});x.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:F});break}if(U==="tool_search_tool_regex"||U==="tool_search_tool_bm25"){let K=z.output;if(K.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${K.type} for tool ${z.toolName} is not supported`});break}let $=(await GG({value:K.value,schema:dG})).map((X)=>({type:"tool_reference",tool_name:X.toolName}));x.push({type:"tool_search_tool_result",tool_use_id:z.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:$},cache_control:F});break}Z.push({type:"other",message:`provider executed tool result for tool ${z.toolName} is not supported`});break}}}}XG.push({role:"assistant",content:x});break}default:throw Error(`content type: ${ZG}`)}}return{prompt:{system:p,messages:XG},betas:Y}}function TQ(Q){let H=[],Z=void 0;for(let W of Q){let{role:f}=W;switch(f){case"system":{if((Z==null?void 0:Z.type)!=="system")Z={type:"system",messages:[]},H.push(Z);Z.messages.push(W);break}case"assistant":{if((Z==null?void 0:Z.type)!=="assistant")Z={type:"assistant",messages:[]},H.push(Z);Z.messages.push(W);break}case"user":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(W);break}case"tool":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(W);break}default:throw Error(`Unsupported role: ${f}`)}}return H}function DG({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 fG(Q,H,Z){var W;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 f=H[Q.document_index];if(!f)return;return{type:"source",sourceType:"document",id:Z(),mediaType:f.mediaType,title:(W=Q.document_title)!=null?W:f.title,filename:f.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 TX=class{constructor(Q,H){this.specificationVersion="v3";var Z;this.modelId=Q,this.config=H,this.generateId=(Z=H.generateId)!=null?Z:CG}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:W,topP:f,topK:h,frequencyPenalty:_,presencePenalty:b,stopSequences:l,responseFormat:M,seed:B,tools:u,toolChoice:R,providerOptions:a,stream:E}){var P,v,g,C,e,N,s,QG,YG,Y;let j=[];if(_!=null)j.push({type:"unsupported",feature:"frequencyPenalty"});if(b!=null)j.push({type:"unsupported",feature:"presencePenalty"});if(B!=null)j.push({type:"unsupported",feature:"seed"});if(W!=null&&W>1)j.push({type:"unsupported",feature:"temperature",details:`${W} exceeds anthropic maximum of 1.0. clamped to 1.0`}),W=1;else if(W!=null&&W<0)j.push({type:"unsupported",feature:"temperature",details:`${W} is below anthropic minimum of 0. clamped to 0`}),W=0;if((M==null?void 0:M.type)==="json"){if(M.schema==null)j.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."})}let w=this.providerOptionsName,p=await LG({provider:"anthropic",providerOptions:a,schema:yG}),XG=w!=="anthropic"?await LG({provider:w,providerOptions:a,schema:yG}):null,zG=XG!=null,L=Object.assign({},p!=null?p:{},XG!=null?XG:{}),{maxOutputTokens:O,supportsStructuredOutput:T,rejectsSamplingParameters:V,isKnownModel:ZG}=OQ(this.modelId);if(V){if(W!=null)j.push({type:"unsupported",feature:"temperature",details:`temperature is not supported by ${this.modelId} and will be ignored`}),W=void 0;if(h!=null)j.push({type:"unsupported",feature:"topK",details:`topK is not supported by ${this.modelId} and will be ignored`}),h=void 0;if(f!=null)j.push({type:"unsupported",feature:"topP",details:`topP is not supported by ${this.modelId} and will be ignored`}),f=void 0}let x=ZG||this.modelId.startsWith("claude-"),o=((P=this.config.supportsNativeStructuredOutput)!=null?P:!0)&&T,t=((v=this.config.supportsStrictTools)!=null?v:!0)&&T,r=(g=L==null?void 0:L.structuredOutputMode)!=null?g:"auto",c=r==="outputFormat"||r==="auto"&&o,y=(M==null?void 0:M.type)==="json"&&M.schema!=null&&!c?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:M.schema}:void 0,n=L==null?void 0:L.contextManagement,z=new VG,m=NG({tools:u,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:F,betas:U}=await bQ({prompt:H,sendReasoning:(C=L==null?void 0:L.sendReasoning)!=null?C:!0,warnings:j,cacheControlValidator:z,toolNameMapping:m}),K=(e=L==null?void 0:L.thinking)==null?void 0:e.type,A=K==="enabled"||K==="adaptive",$=K==="enabled"?(N=L==null?void 0:L.thinking)==null?void 0:N.budgetTokens:void 0,X=K==="adaptive"?(s=L==null?void 0:L.thinking)==null?void 0:s.display:void 0,I=Z!=null?Z:O,q={model:this.modelId,max_tokens:I,temperature:W,top_k:h,top_p:f,stop_sequences:l,...A&&{thinking:{type:K,...$!=null&&{budget_tokens:$},...X!=null&&{display:X}}},...((L==null?void 0:L.effort)||(L==null?void 0:L.taskBudget)||c&&(M==null?void 0:M.type)==="json"&&M.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}}},...c&&(M==null?void 0:M.type)==="json"&&M.schema!=null&&{format:{type:"json_schema",schema:M.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((S)=>({type:S.type,name:S.name,url:S.url,authorization_token:S.authorizationToken,tool_configuration:S.toolConfiguration?{allowed_tools:S.toolConfiguration.allowedTools,enabled:S.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((S)=>({type:S.type,skill_id:S.skillId,version:S.version}))}:L.container.id},system:F.system,messages:F.messages,...n&&{context_management:{edits:n.edits.map((S)=>{let RG=S.type;switch(RG){case"clear_tool_uses_20250919":return{type:S.type,...S.trigger!==void 0&&{trigger:S.trigger},...S.keep!==void 0&&{keep:S.keep},...S.clearAtLeast!==void 0&&{clear_at_least:S.clearAtLeast},...S.clearToolInputs!==void 0&&{clear_tool_inputs:S.clearToolInputs},...S.excludeTools!==void 0&&{exclude_tools:S.excludeTools}};case"clear_thinking_20251015":return{type:S.type,...S.keep!==void 0&&{keep:S.keep}};case"compact_20260112":return{type:S.type,...S.trigger!==void 0&&{trigger:S.trigger},...S.pauseAfterCompaction!==void 0&&{pause_after_compaction:S.pauseAfterCompaction},...S.instructions!==void 0&&{instructions:S.instructions}};default:j.push({type:"other",message:`Unknown context management strategy: ${RG}`});return}}).filter((S)=>S!==void 0)}}};if(A){if(K==="enabled"&&$==null)j.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),q.thinking={type:"enabled",budget_tokens:1024},$=1024;if(q.temperature!=null)q.temperature=void 0,j.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"});if(h!=null)q.top_k=void 0,j.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"});if(f!=null)q.top_p=void 0,j.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"});q.max_tokens=I+($!=null?$:0)}else if(x&&f!=null&&W!=null)j.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),q.top_p=void 0;if(ZG&&q.max_tokens>O){if(Z!=null)j.push({type:"unsupported",feature:"maxOutputTokens",details:`${q.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${O} max output tokens. The max output tokens have been limited to ${O}.`});q.max_tokens=O}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((S)=>S.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"),!(u==null?void 0:u.some((S)=>S.type==="provider"&&(S.id==="anthropic.code_execution_20250825"||S.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 k=E&&((YG=L==null?void 0:L.toolStreaming)!=null?YG:!0),{tools:$G,toolChoice:UG,toolWarnings:AG,betas:uG}=await UQ(y!=null?{tools:[...u!=null?u:[],y],toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:z,supportsStructuredOutput:!1,supportsStrictTools:t,defaultEagerInputStreaming:k}:{tools:u!=null?u:[],toolChoice:R,disableParallelToolUse:L==null?void 0:L.disableParallelToolUse,cacheControlValidator:z,supportsStructuredOutput:o,supportsStrictTools:t,defaultEagerInputStreaming:k}),cG=z.getWarnings();return{args:{...q,tools:$G,tool_choice:UG,stream:E===!0?!0:void 0},warnings:[...j,...AG,...cG],betas:new Set([...U,...uG,...Q,...(Y=L==null?void 0:L.anthropicBeta)!=null?Y:[]]),usesJsonResponseTool:y!=null,toolNameMapping:m,providerOptionsName:w,usedCustomProviderKey:zG}}async getHeaders({betas:Q,headers:H}){return wG(await jG(this.config.headers),H,Q.size>0?{"anthropic-beta":Array.from(Q).join(",")}:{})}async getBetasFromHeaders(Q){var H,Z;let f=(H=(await jG(this.config.headers))["anthropic-beta"])!=null?H:"",h=(Z=Q==null?void 0:Q["anthropic-beta"])!=null?Z:"";return new Set([...f.toLowerCase().split(","),...h.toLowerCase().split(",")].map((_)=>_.trim()).filter((_)=>_!==""))}buildRequestUrl(Q){var H,Z,W;return(W=(Z=(H=this.config).buildRequestUrl)==null?void 0:Z.call(H,this.config.baseURL,Q))!=null?W:`${this.config.baseURL}/messages`}transformRequestBody(Q,H){var Z,W,f;return(f=(W=(Z=this.config).transformRequestBody)==null?void 0:W.call(Z,Q,H))!=null?f:Q}extractCitationDocuments(Q){let H=(Z)=>{var W,f;if(Z.type!=="file")return!1;if(Z.mediaType!=="application/pdf"&&Z.mediaType!=="text/plain")return!1;let h=(W=Z.providerOptions)==null?void 0:W.anthropic,_=h==null?void 0:h.citations;return(f=_==null?void 0:_.enabled)!=null?f:!1};return Q.filter((Z)=>Z.role==="user").flatMap((Z)=>Z.content).filter(H).map((Z)=>{var W;let f=Z;return{title:(W=f.filename)!=null?W:"Untitled Document",filename:f.filename,mediaType:f.mediaType}})}async doGenerate(Q){var H,Z,W,f,h,_,b;let{args:l,warnings:M,betas:B,usesJsonResponseTool:u,toolNameMapping:R,providerOptionsName:a,usedCustomProviderKey:E}=await this.getArgs({...Q,stream:!1,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),P=[...this.extractCitationDocuments(Q.prompt)],v=PG(l.tools),{responseHeaders:g,value:C,rawValue:e}=await WG({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:B,headers:Q.headers}),body:this.transformRequestBody(l,B),failedResponseHandler:EG,successfulResponseHandler:kG(lG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),N=[],s={},QG={},YG=!1;for(let Y of C.content)switch(Y.type){case"text":{if(!u){if(N.push({type:"text",text:Y.text}),Y.citations)for(let j of Y.citations){let w=fG(j,P,this.generateId);if(w)N.push(w)}}break}case"thinking":{N.push({type:"reasoning",text:Y.thinking,providerMetadata:{anthropic:{signature:Y.signature}}});break}case"redacted_thinking":{N.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:Y.data}}});break}case"compaction":{N.push({type:"text",text:Y.content,providerMetadata:{anthropic:{type:"compaction"}}});break}case"tool_use":{if(u&&Y.name==="json")YG=!0,N.push({type:"text",text:JSON.stringify(Y.input)});else{let w=Y.caller,p=w?{type:w.type,toolId:"tool_id"in w?w.tool_id:void 0}:void 0;N.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")N.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;N.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(j),providerExecuted:!0,...v&&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,N.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}}},N.push(s[Y.id]);break}case"mcp_tool_result":{N.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")P.push({title:(H=Y.content.content.title)!=null?H:Y.content.url,mediaType:Y.content.content.source.media_type}),N.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")N.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)){N.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),result:Y.content.map((j)=>{var w;return{url:j.url,title:j.title,pageAge:(w=j.page_age)!=null?w:null,encryptedContent:j.encrypted_content,type:j.type}})});for(let j of Y.content)N.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 N.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")N.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:(W=Y.content.content)!=null?W:[]}});else if(Y.content.type==="encrypted_code_execution_result")N.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:(f=Y.content.content)!=null?f:[]}});else if(Y.content.type==="code_execution_tool_result_error")N.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":{N.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 w=R.toCustomToolName("tool_search_tool_bm25"),p=R.toCustomToolName("tool_search_tool_regex");if(w!=="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")N.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),result:Y.content.tool_references.map((w)=>({type:w.type,toolName:w.tool_name}))});else N.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:N,finishReason:{unified:DG({finishReason:C.stop_reason,isJsonResponseFromTool:YG}),raw:(h=C.stop_reason)!=null?h:void 0},usage:IG({usage:C.usage}),request:{body:l},response:{id:(_=C.id)!=null?_:void 0,modelId:(b=C.model)!=null?b:void 0,headers:g,body:e},warnings:M,providerMetadata:(()=>{var Y,j,w,p,XG;let zG={usage:C.usage,cacheCreationInputTokens:(Y=C.usage.cache_creation_input_tokens)!=null?Y:null,stopSequence:(j=C.stop_sequence)!=null?j:null,iterations:C.usage.iterations?C.usage.iterations.map((O)=>({type:O.type,inputTokens:O.input_tokens,outputTokens:O.output_tokens})):null,container:C.container?{expiresAt:C.container.expires_at,id:C.container.id,skills:(p=(w=C.container.skills)==null?void 0:w.map((O)=>({type:O.type,skillId:O.skill_id,version:O.version})))!=null?p:null}:null,contextManagement:(XG=xG(C.context_management))!=null?XG:null},L={anthropic:zG};if(E&&a!=="anthropic")L[a]=zG;return L})()}}async doStream(Q){var H,Z;let{args:W,warnings:f,betas:h,usesJsonResponseTool:_,toolNameMapping:b,providerOptionsName:l,usedCustomProviderKey:M}=await this.getArgs({...Q,stream:!0,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),B=[...this.extractCitationDocuments(Q.prompt)],u=PG(W.tools),R=this.buildRequestUrl(!0),{responseHeaders:a,value:E}=await WG({url:R,headers:await this.getHeaders({betas:h,headers:Q.headers}),body:this.transformRequestBody(W,h),failedResponseHandler:EG,successfulResponseHandler:OG(sG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),P={unified:"other",raw:void 0},v={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},g={},C={},e={},N=null,s=void 0,QG=null,YG=null,Y=null,j=!1,w=void 0,p=this.generateId,XG=E.pipeThrough(new TransformStream({start(T){T.enqueue({type:"stream-start",warnings:f})},transform(T,V){var ZG,x,o,t,r,c,y,n,z,m,F,U,K,A;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:T.rawValue});if(!T.success){V.enqueue({type:"error",error:T.error});return}let $=T.value;switch($.type){case"ping":return;case"content_block_start":{let X=$.content_block,I=X.type;switch(w=I,I){case"text":{if(_)return;g[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});return}case"thinking":{g[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index)});return}case"redacted_thinking":{g[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index),providerMetadata:{anthropic:{redactedData:X.data}}});return}case"compaction":{g[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index),providerMetadata:{anthropic:{type:"compaction"}}});return}case"tool_use":{if(_&&X.name==="json")j=!0,g[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});else{let k=X.caller,$G=k?{type:k.type,toolId:"tool_id"in k?k.tool_id:void 0}:void 0,AG=X.input&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";g[$.index]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:AG,firstDelta:AG.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 q=X.name==="text_editor_code_execution"||X.name==="bash_code_execution"?"code_execution":X.name,k=b.toCustomToolName(q),$G=X.input!=null&&typeof X.input==="object"&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";g[$.index]={type:"tool-call",toolCallId:X.id,toolName:k,input:$G,providerExecuted:!0,...u&&q==="code_execution"?{dynamic:!0}:{},firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:k,providerExecuted:!0,...u&&q==="code_execution"?{dynamic:!0}:{}})}else if(X.name==="tool_search_tool_regex"||X.name==="tool_search_tool_bm25"){e[X.id]=X.name;let q=b.toCustomToolName(X.name);g[$.index]={type:"tool-call",toolCallId:X.id,toolName:q,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:q,providerExecuted:!0})}return}case"web_fetch_tool_result":{if(X.content.type==="web_fetch_result")B.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:b.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:b.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:b.toCustomToolName("web_search"),result:X.content.map((q)=>{var k;return{url:q.url,title:q.title,pageAge:(k=q.page_age)!=null?k:null,encryptedContent:q.encrypted_content,type:q.type}})});for(let q of X.content)V.enqueue({type:"source",sourceType:"url",id:p(),url:q.url,title:q.title,providerMetadata:{anthropic:{pageAge:(x=q.page_age)!=null?x:null}}})}else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:b.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:b.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:b.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:b.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:b.toCustomToolName("code_execution"),result:X.content});return}case"tool_search_tool_result":{let q=e[X.tool_use_id];if(q==null){let k=b.toCustomToolName("tool_search_tool_bm25"),$G=b.toCustomToolName("tool_search_tool_regex");if(k!=="tool_search_tool_bm25")q="tool_search_tool_bm25";else if($G!=="tool_search_tool_regex")q="tool_search_tool_regex";else q="tool_search_tool_regex"}if(X.content.type==="tool_search_tool_search_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:b.toCustomToolName(q),result:X.content.tool_references.map((k)=>({type:k.type,toolName:k.tool_name}))});else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:b.toCustomToolName(q),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:X.content.error_code}});return}case"mcp_tool_use":{C[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(C[X.id]);return}case"mcp_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:C[X.tool_use_id].toolName,isError:X.is_error,result:X.content,dynamic:!0,providerMetadata:C[X.tool_use_id].providerMetadata});return}default:throw Error(`Unsupported content block type: ${I}`)}}case"content_block_stop":{if(g[$.index]!=null){let X=g[$.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(!(_&&X.toolName==="json")){V.enqueue({type:"tool-input-end",id:X.toolCallId});let q=X.input===""?"{}":X.input;if(X.providerToolName==="code_execution")try{let k=JSON.parse(q);if(k!=null&&typeof k==="object"&&"code"in k&&!("type"in k))q=JSON.stringify({type:"programmatic-tool-call",...k})}catch(k){}V.enqueue({type:"tool-call",toolCallId:X.toolCallId,toolName:X.toolName,input:q,providerExecuted:X.providerExecuted,...u&&X.providerToolName==="code_execution"?{dynamic:!0}:{},...X.caller&&{providerMetadata:{anthropic:{caller:X.caller}}}})}break}delete g[$.index]}w=void 0;return}case"content_block_delta":{let X=$.delta.type;switch(X){case"text_delta":{if(_)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(w==="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 I=g[$.index],q=$.delta.partial_json;if(q.length===0)return;if(j){if((I==null?void 0:I.type)!=="text")return;V.enqueue({type:"text-delta",id:String($.index),delta:q})}else{if((I==null?void 0:I.type)!=="tool-call")return;if(I.firstDelta&&(I.providerToolName==="bash_code_execution"||I.providerToolName==="text_editor_code_execution"))q=`{"type": "${I.providerToolName}",${q.substring(1)}`;V.enqueue({type:"tool-input-delta",id:I.toolCallId,delta:q}),I.input+=q,I.firstDelta=!1}return}case"citations_delta":{let I=$.delta.citation,q=fG(I,B,p);if(q)V.enqueue(q);return}default:throw Error(`Unsupported delta type: ${X}`)}}case"message_start":{if(v.input_tokens=$.message.usage.input_tokens,v.cache_read_input_tokens=(r=$.message.usage.cache_read_input_tokens)!=null?r:0,v.cache_creation_input_tokens=(c=$.message.usage.cache_creation_input_tokens)!=null?c:0,s={...$.message.usage},QG=(y=$.message.usage.cache_creation_input_tokens)!=null?y:null,$.message.container!=null)Y={expiresAt:$.message.container.expires_at,id:$.message.container.id,skills:null};if($.message.stop_reason!=null)P={unified:DG({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 I=$.message.content[X];if(I.type==="tool_use"){let q=I.caller,k=q?{type:q.type,toolId:"tool_id"in q?q.tool_id:void 0}:void 0;V.enqueue({type:"tool-input-start",id:I.id,toolName:I.name});let $G=JSON.stringify((m=I.input)!=null?m:{});V.enqueue({type:"tool-input-delta",id:I.id,delta:$G}),V.enqueue({type:"tool-input-end",id:I.id}),V.enqueue({type:"tool-call",toolCallId:I.id,toolName:I.name,input:$G,...k&&{providerMetadata:{anthropic:{caller:k}}}})}}return}case"message_delta":{if($.usage.input_tokens!=null&&v.input_tokens!==$.usage.input_tokens)v.input_tokens=$.usage.input_tokens;if(v.output_tokens=$.usage.output_tokens,$.usage.cache_read_input_tokens!=null)v.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.cache_creation_input_tokens!=null)v.cache_creation_input_tokens=$.usage.cache_creation_input_tokens,QG=$.usage.cache_creation_input_tokens;if($.usage.iterations!=null)v.iterations=$.usage.iterations;if(P={unified:DG({finishReason:$.delta.stop_reason,isJsonResponseFromTool:j}),raw:(F=$.delta.stop_reason)!=null?F: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=(K=$.delta.container.skills)==null?void 0:K.map((X)=>({type:X.type,skillId:X.skill_id,version:X.version})))!=null?A:null}:null,$.context_management)N=xG($.context_management);s={...s,...$.usage};return}case"message_stop":{let X={usage:s!=null?s:null,cacheCreationInputTokens:QG,stopSequence:YG,iterations:v.iterations?v.iterations.map((q)=>({type:q.type,inputTokens:q.input_tokens,outputTokens:q.output_tokens})):null,container:Y,contextManagement:N},I={anthropic:X};if(M&&l!=="anthropic")I[l]=X;V.enqueue({type:"finish",finishReason:P,usage:IG({usage:v,rawUsage:s}),providerMetadata:I});return}case"error":{V.enqueue({type:"error",error:$.error});return}default:throw Error(`Unsupported chunk type: ${$}`)}}})),[zG,L]=XG.tee(),O=zG.getReader();try{await O.read();let T=await O.read();if(((H=T.value)==null?void 0:H.type)==="raw")T=await O.read();if(((Z=T.value)==null?void 0:Z.type)==="error"){let V=T.value.error;throw new BG({message:V.message,url:R,requestBodyValues:W,statusCode:V.type==="overloaded_error"?529:500,responseHeaders:a,responseBody:JSON.stringify(V),isRetryable:V.type==="overloaded_error"})}}finally{O.cancel().catch(()=>{}),O.releaseLock()}return{stream:L,request:{body:W},response:{headers:a}}}};function OQ(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 PG(Q){if(!Q)return!1;let H=!1,Z=!1;for(let W of Q){if("type"in W&&(W.type==="web_fetch_20260209"||W.type==="web_search_20260209")){H=!0;continue}if(W.name==="code_execution"){Z=!0;break}}return H&&!Z}function xG(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 kQ=D(()=>J(G.object({command:G.string(),restart:G.boolean().optional()}))),vQ=d({id:"anthropic.bash_20241022",inputSchema:kQ}),_Q=D(()=>J(G.object({command:G.string(),restart:G.boolean().optional()}))),hQ=d({id:"anthropic.bash_20250124",inputSchema:_Q}),gQ=D(()=>J(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()}))),mQ=d({id:"anthropic.computer_20241022",inputSchema:gQ}),dQ=D(()=>J(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()}))),uQ=d({id:"anthropic.computer_20250124",inputSchema:dQ}),cQ=D(()=>J(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()}))),iQ=d({id:"anthropic.computer_20251124",inputSchema:cQ}),lQ=D(()=>J(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()})]))),sQ=d({id:"anthropic.memory_20250818",inputSchema:lQ}),pQ=D(()=>J(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()}))),nQ=d({id:"anthropic.text_editor_20241022",inputSchema:pQ}),rQ=D(()=>J(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()}))),aQ=d({id:"anthropic.text_editor_20250124",inputSchema:rQ}),eQ=D(()=>J(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()}))),oQ=d({id:"anthropic.text_editor_20250429",inputSchema:eQ}),tQ=D(()=>J(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),GX=D(()=>J(G.object({query:G.string(),limit:G.number().optional()}))),QX=i({id:"anthropic.tool_search_bm25_20251119",inputSchema:GX,outputSchema:tQ,supportsDeferredResults:!0}),XX=(Q={})=>{return QX(Q)},GY={bash_20241022:vQ,bash_20250124:hQ,codeExecution_20250522:SQ,codeExecution_20250825:IQ,codeExecution_20260120:xQ,computer_20241022:mQ,computer_20250124:uQ,computer_20251124:iQ,memory_20250818:sQ,textEditor_20241022:nQ,textEditor_20250124:aQ,textEditor_20250429:oQ,textEditor_20250728:oG,webFetch_20250910:VQ,webFetch_20260209:DQ,webSearch_20250305:LQ,webSearch_20260209:YQ,toolSearchRegex_20251119:NQ,toolSearchBm25_20251119:XX};
|
|
3
|
+
export{UQ as yf,TX as zf,GY as Af};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{o as w,p as h,q as I,r as C,s as D}from"./chunk-
|
|
2
|
+
import{o as w,p as h,q as I,r as C,s as D}from"./chunk-3xna2rk5.js";import{Hd as c,Id as k,Jd as $,Md as x}from"./chunk-9jncnqbj.js";import"./chunk-754varfr.js";import{Qd as P}from"./chunk-g4qwkcdv.js";import{Uf as d}from"./chunk-qe0sfafy.js";import{Ol as l}from"./chunk-0ke6x10y.js";import"./chunk-meaybtcc.js";import"./chunk-rmsqb6r4.js";import{xn as v}from"./chunk-4pssh5d3.js";import"./chunk-9dpn4792.js";import"./chunk-pf7cj4jd.js";import"./chunk-amx3x4kd.js";import"./chunk-b50t4jc5.js";import"./chunk-nf8gkxbk.js";import"./chunk-dd11kryy.js";import"./chunk-msm3r7ny.js";import"./chunk-e075v4e9.js";import"./chunk-jv98gw88.js";import"./chunk-jhq5bvhs.js";import"./chunk-xw283h2r.js";import{ss as b}from"./chunk-v7ah9gg0.js";import{Fs as m}from"./chunk-d0m7nbbx.js";import"./chunk-vfj5nwab.js";import"./chunk-7w84hfxs.js";import"./chunk-ym4ydwrz.js";import"./chunk-vmgknvxs.js";import"./chunk-p409grvp.js";import"./chunk-ag9thqkv.js";import"./chunk-0rmmg3g4.js";var j={spinner:()=>x(),log:{error:(o)=>c.error(o),info:(o)=>c.info(o),success:(o)=>c.success(o)},resolve:(o)=>v(o),...h,global:b.Path.config};function S(o){if(!o||typeof o!=="object")return;if(!("cause"in o))return;return o.cause}function _(o,e=j){let n=o.mod,a=Boolean(o.force),y=Boolean(o.global);return async(f)=>{let u=e.spinner();u.start("Installing plugin package...");let p=await I(n,e);if(!p.ok){u.stop("Install failed",1),e.log.error(`Could not install "${n}"`);let t=w(p.error);if(t.detail)e.log.error(t.detail);if(t.missing)e.log.info("This package depends on a version that is not available in your npm registry."),e.log.info("Check npm registry/auth settings and try again.");return!1}u.stop("Plugin package ready");let s=e.spinner();s.start("Reading plugin manifest...");let i=await C(p.target);if(!i.ok){if(i.code==="manifest_read_failed")return s.stop("Manifest read failed",1),e.log.error(`Installed "${n}" but failed to read ${i.file}`),e.log.error(m(S(i.error)??i.error)),!1;if(i.code==="manifest_no_targets")return s.stop("No plugin targets found",1),e.log.error(`"${n}" does not expose plugin entrypoints in package.json`),e.log.info('Expected one of: exports["./tui"], exports["./server"], package.json main for server, or package.json["oc-themes"] for tui themes.'),!1;return s.stop("Manifest read failed",1),!1}s.stop(`Detected ${i.targets.map((t)=>t.kind).join(" + ")} target${i.targets.length===1?"":"s"}`);let g=e.spinner();g.start("Updating plugin config...");let r=await D({spec:n,targets:i.targets,force:a,global:y,vcs:f.vcs,worktree:f.worktree,directory:f.directory,config:e.global},e);if(!r.ok){if(r.code==="invalid_json")return g.stop(`Failed updating ${r.kind} config`,1),e.log.error(`Invalid JSON in ${r.file} (${r.parse} at line ${r.line}, column ${r.col})`),e.log.info("Fix the config file and run the command again."),!1;return g.stop("Failed updating plugin config",1),e.log.error(m(r.error)),!1}g.stop("Plugin config updated");for(let t of r.items){if(t.mode==="noop"){e.log.info(`Already configured in ${t.file}`);continue}if(t.mode==="replace"){e.log.info(`Replaced in ${t.file}`);continue}e.log.info(`Added to ${t.file}`)}return e.log.success(`Installed ${n}`),e.log.info(y?`Scope: global (${r.dir})`:`Scope: local (${r.dir})`),!0}}var R=P({command:"plugin <module>",aliases:["plug"],describe:"install plugin and update config",builder:(o)=>{return o.positional("module",{type:"string",describe:"npm module name"}).option("global",{alias:["g"],type:"boolean",default:!1,describe:"install in global config"}).option("force",{alias:["f"],type:"boolean",default:!1,describe:"replace existing plugin version"})},handler:async(o)=>{let e=String(o.module??"").trim();if(!e){d.error("module is required"),process.exitCode=1;return}d.empty(),k(`Install plugin ${e}`);let n=_({mod:e,global:Boolean(o.global),force:Boolean(o.force)}),a=!0;if(await l.provide({directory:process.cwd(),fn:async()=>{a=await n({vcs:l.project.vcs,worktree:l.worktree,directory:l.directory})}}),$("Done"),!a)process.exitCode=1}});export{_ as createPlugTask,R as PluginCommand};
|