@qitqode/qitqode-android-arm64 0.2.1 → 0.2.3
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/bun +0 -0
- package/bundle/{chunk-2hv2c8d5.js → chunk-0428v6mw.js} +1 -1
- package/bundle/{chunk-0f3ft9dh.js → chunk-05ck7acg.js} +1 -1
- package/bundle/{chunk-p5mes2sh.js → chunk-083wpv6r.js} +1 -1
- package/bundle/{chunk-j5ymkhry.js → chunk-0cnwsf8p.js} +1 -1
- package/bundle/{chunk-6y4mwmn4.js → chunk-0nbteyb0.js} +2 -2
- package/bundle/chunk-0nqf1k20.js +2 -0
- package/bundle/chunk-0ppnq3a4.js +2 -0
- package/bundle/{chunk-6kf4vw2g.js → chunk-0qd3567w.js} +1 -1
- package/bundle/{chunk-jw114bbt.js → chunk-0smnwqk6.js} +2 -2
- package/bundle/chunk-0te0vcdn.js +2 -0
- package/bundle/{chunk-sh76e256.js → chunk-0vakk88p.js} +2 -2
- package/bundle/{chunk-wp3dpt6d.js → chunk-0vxnkstz.js} +2 -2
- package/bundle/{chunk-q4fn41ex.js → chunk-0xrb12s8.js} +2 -2
- package/bundle/chunk-11h06z17.js +2 -0
- package/bundle/chunk-16w710kf.js +3 -0
- package/bundle/{chunk-6dfjtzqb.js → chunk-21rq4592.js} +2 -2
- package/bundle/{chunk-y3dfk6n5.js → chunk-24rkf2gk.js} +1 -1
- package/bundle/{chunk-rdwma0de.js → chunk-24ygjbpf.js} +2 -2
- package/bundle/chunk-262s2yz2.js +2 -0
- package/bundle/chunk-28yv4fqe.js +2 -0
- package/bundle/{chunk-3tmq81kq.js → chunk-2drzgtv3.js} +2 -2
- package/bundle/{chunk-xd3xc1vv.js → chunk-2md6sx8d.js} +1 -1
- package/bundle/{chunk-v9rg0a8g.js → chunk-313zqzc1.js} +1 -1
- package/bundle/{chunk-zfd70p01.js → chunk-32j0q58h.js} +1 -1
- package/bundle/chunk-34a52hyr.js +2 -0
- package/bundle/{chunk-86jsqc7d.js → chunk-39z96pc6.js} +3 -3
- package/bundle/{chunk-g9end129.js → chunk-3atcc483.js} +1 -1
- package/bundle/{chunk-e6wp96vm.js → chunk-3jf3jhrs.js} +1 -1
- package/bundle/{chunk-4sxg9cgr.js → chunk-3kpse7zy.js} +1 -1
- package/bundle/chunk-3n3gb3vd.js +2 -0
- package/bundle/chunk-3sq60y9f.js +2 -0
- package/bundle/{chunk-2qwmrp16.js → chunk-3vvd7j14.js} +1 -1
- package/bundle/chunk-4086z5ys.js +2 -0
- package/bundle/{chunk-rcyzqa3g.js → chunk-450fef7h.js} +2 -2
- package/bundle/{chunk-kxjrrdj0.js → chunk-45a4n21f.js} +1 -1
- package/bundle/{chunk-xny5ecn0.js → chunk-47k5jy1p.js} +2 -2
- package/bundle/{chunk-dj3525nn.js → chunk-47z3x3dp.js} +189 -228
- package/bundle/{chunk-0gab4v98.js → chunk-48r70n4s.js} +1 -1
- package/bundle/chunk-49mbnqvc.js +2 -0
- package/bundle/{chunk-yerfyz4w.js → chunk-49xhybc2.js} +1 -1
- package/bundle/{chunk-t9zbp2qw.js → chunk-4agaj51z.js} +1 -1
- package/bundle/{chunk-faa0zxey.js → chunk-4dnntf9k.js} +2 -2
- package/bundle/chunk-4fr6kae9.js +2 -0
- package/bundle/chunk-4websxrs.js +2 -0
- package/bundle/chunk-516w1nc4.js +2 -0
- package/bundle/chunk-52w60e1f.js +2 -0
- package/bundle/chunk-535nm66j.js +2 -0
- package/bundle/{chunk-1p6jjrea.js → chunk-55fcmswd.js} +2 -2
- package/bundle/{chunk-n7kqdqkh.js → chunk-55ykn8nz.js} +4 -4
- package/bundle/chunk-565855py.js +2 -0
- package/bundle/chunk-56v352f8.js +2 -0
- package/bundle/chunk-5bjtq8t2.js +2 -0
- package/bundle/{chunk-as845ya4.js → chunk-5c2438af.js} +1 -1
- package/bundle/chunk-5kpxpm8e.js +2 -0
- package/bundle/chunk-5nm5s0h2.js +2 -0
- package/bundle/{chunk-07s30fpb.js → chunk-5nrc5rhh.js} +1 -1
- package/bundle/{chunk-jwph7tpc.js → chunk-5pwv2p3s.js} +1 -1
- package/bundle/{chunk-q5abwn50.js → chunk-5pzs51sp.js} +1 -1
- package/bundle/{chunk-r0s28gnb.js → chunk-5tky3csh.js} +1 -1
- package/bundle/{chunk-yajd975f.js → chunk-5w76kdjr.js} +1 -1
- package/bundle/{chunk-wcqfr8vr.js → chunk-5ysbwr4x.js} +1 -1
- package/bundle/{chunk-g5cgpvef.js → chunk-5zkj5xv9.js} +2 -2
- package/bundle/{chunk-fgn83bs7.js → chunk-65bmsp2t.js} +1 -1
- package/bundle/chunk-65t9b9eq.js +3 -0
- package/bundle/{chunk-9jrxrjzt.js → chunk-68v3b6ns.js} +2 -2
- package/bundle/{chunk-7ntw4rrn.js → chunk-6ar91jvd.js} +1 -1
- package/bundle/{chunk-bbbh69ys.js → chunk-6evh2ke8.js} +1 -1
- package/bundle/chunk-6gpf2bjs.js +2 -0
- package/bundle/{chunk-a2dz9nqh.js → chunk-6m9jb0s9.js} +2 -2
- package/bundle/{chunk-yvjke593.js → chunk-6scf311w.js} +1 -1
- package/bundle/{chunk-jjjs8p0t.js → chunk-6tstcwxp.js} +2 -2
- package/bundle/{chunk-5wwd40t3.js → chunk-70q8qcb2.js} +1 -1
- package/bundle/{chunk-pfkm3j8g.js → chunk-73r8bjjz.js} +2 -2
- package/bundle/{chunk-bzs2ep7s.js → chunk-78pt314g.js} +1 -1
- package/bundle/{chunk-hs3vfhar.js → chunk-7bcm7gg1.js} +1 -1
- package/bundle/chunk-7bgzcpdw.js +2 -0
- package/bundle/{chunk-ezfzb8qc.js → chunk-7g66qc1v.js} +2 -2
- package/bundle/{chunk-fd7fmvyw.js → chunk-7hvf9dgx.js} +1 -1
- package/bundle/chunk-7kjvcbwa.js +2 -0
- package/bundle/chunk-7knnz5f1.js +2 -0
- package/bundle/{chunk-6j339s7a.js → chunk-7mppvhv9.js} +2 -2
- package/bundle/{chunk-yqb6cfed.js → chunk-7vmx8bg9.js} +2 -2
- package/bundle/{chunk-7njz51r4.js → chunk-7x6yrtzn.js} +1 -1
- package/bundle/{chunk-skv9ww0s.js → chunk-804vmbcd.js} +1 -1
- package/bundle/{chunk-qeg0jnxq.js → chunk-88q0mtgp.js} +2 -2
- package/bundle/chunk-8jma2btf.js +2 -0
- package/bundle/{chunk-jgtcfw96.js → chunk-8mm92zn2.js} +2 -2
- package/bundle/{chunk-kdcnder5.js → chunk-8wwdrwf2.js} +1 -1
- package/bundle/{chunk-4fk46ngj.js → chunk-920z7g7j.js} +1 -1
- package/bundle/chunk-93e0w75z.js +2 -0
- package/bundle/{chunk-pzefsndd.js → chunk-953pqp3w.js} +1 -1
- package/bundle/chunk-96wwns35.js +2 -0
- package/bundle/chunk-97gp818s.js +2 -0
- package/bundle/chunk-9epf2zbh.js +2 -0
- package/bundle/chunk-9fyz4sxa.js +2 -0
- package/bundle/{chunk-4hd3v58j.js → chunk-9hz56z6a.js} +1 -1
- package/bundle/{chunk-rk2bk4s7.js → chunk-9zm6r55d.js} +2 -2
- package/bundle/chunk-a7wmadf1.js +2 -0
- package/bundle/{chunk-w7em72p8.js → chunk-ac7482n2.js} +2 -2
- package/bundle/chunk-agv04nt7.js +2 -0
- package/bundle/{chunk-cbmwhvxw.js → chunk-at22twxx.js} +2 -2
- package/bundle/{chunk-ahyqfbmq.js → chunk-avefgbjg.js} +2 -2
- package/bundle/chunk-azpnrnv9.js +8251 -0
- package/bundle/{chunk-z2h1gxyx.js → chunk-bbng1cea.js} +1 -1
- package/bundle/{chunk-5az84brc.js → chunk-bd21p9zz.js} +2 -2
- package/bundle/chunk-be7smmar.js +2 -0
- package/bundle/{chunk-y4e7e42x.js → chunk-bne5w117.js} +4 -4
- package/bundle/{chunk-j3jqk62r.js → chunk-bqn6bqws.js} +1 -1
- package/bundle/{chunk-f4zfk5ye.js → chunk-brws2aht.js} +1 -1
- package/bundle/chunk-bryx5cx9.js +2 -0
- package/bundle/{chunk-9eg2ytjd.js → chunk-bvf2dcq4.js} +3 -3
- package/bundle/{chunk-tge53d52.js → chunk-bwbqkfv0.js} +1 -1
- package/bundle/chunk-c13rrw41.js +2 -0
- package/bundle/chunk-c2kkv619.js +2 -0
- package/bundle/{chunk-64c8q9zg.js → chunk-c36p881g.js} +3 -3
- package/bundle/chunk-c5xj1y5v.js +2 -0
- package/bundle/chunk-c74cxhjb.js +2 -0
- package/bundle/chunk-cejyed1j.js +2 -0
- package/bundle/chunk-ckpm4dvv.js +2 -0
- package/bundle/{chunk-732yr6qq.js → chunk-cmb62jkt.js} +2 -2
- package/bundle/chunk-ct8twng1.js +2 -0
- package/bundle/{chunk-1q1cddy4.js → chunk-cz5vta94.js} +1 -1
- package/bundle/{chunk-fpm2vgz6.js → chunk-d0x5pbkm.js} +1 -1
- package/bundle/chunk-d38y7bvh.js +2 -0
- package/bundle/chunk-d6hxsfm6.js +2 -0
- package/bundle/{chunk-29zm623f.js → chunk-d6jhs818.js} +2 -2
- package/bundle/chunk-descb9jz.js +2 -0
- package/bundle/{chunk-mswx4k75.js → chunk-dnnkq5y4.js} +2 -2
- package/bundle/{chunk-6pcmv8vs.js → chunk-dnsh1v42.js} +2 -2
- package/bundle/{chunk-f7rj6fck.js → chunk-dqp4nmxs.js} +1 -1
- package/bundle/chunk-dvr2b9r1.js +2 -0
- package/bundle/{chunk-s0ty36qg.js → chunk-dxdggn90.js} +1 -1
- package/bundle/{chunk-vjx0064q.js → chunk-e8p92vz4.js} +2 -2
- package/bundle/chunk-ea5fktnn.js +2 -0
- package/bundle/{chunk-t1jgx17a.js → chunk-eg3syjtv.js} +2 -2
- package/bundle/{chunk-2a9rzgk6.js → chunk-ehb4hd9c.js} +1 -1
- package/bundle/{chunk-9jsgs71h.js → chunk-ejqzcdcx.js} +1 -1
- package/bundle/chunk-enmsp09e.js +3 -0
- package/bundle/chunk-epgcsjfp.js +2 -0
- package/bundle/{chunk-5t0w9ecw.js → chunk-et3804wr.js} +1 -1
- package/bundle/{chunk-yd8bzhv6.js → chunk-ezrqhqkp.js} +1 -1
- package/bundle/chunk-f0t7rryn.js +3 -0
- package/bundle/{chunk-p635phfw.js → chunk-f31yvp20.js} +1 -1
- package/bundle/chunk-f4mf6tpp.js +2 -0
- package/bundle/chunk-f97k17t8.js +2 -0
- package/bundle/{chunk-yx1h0b5v.js → chunk-faee8zgc.js} +1 -1
- package/bundle/{chunk-p9mj4zyk.js → chunk-ff548b0j.js} +2 -2
- package/bundle/{chunk-bgng3rdj.js → chunk-fhqfqd5v.js} +2 -2
- package/bundle/{chunk-zek5c15t.js → chunk-fjbv3jht.js} +1 -1
- package/bundle/{chunk-hpa7e9va.js → chunk-fsahzvd5.js} +3 -3
- package/bundle/chunk-g06a4chw.js +2 -0
- package/bundle/{chunk-hq9bgnqb.js → chunk-g22e4gw7.js} +1 -1
- package/bundle/{chunk-s0ptrw0z.js → chunk-g3wvtyw3.js} +1 -1
- package/bundle/{chunk-x4pdpka8.js → chunk-g42krp0z.js} +1 -1
- package/bundle/chunk-g4ehhdzp.js +2 -0
- package/bundle/{chunk-a9y27zd2.js → chunk-gbkz04ke.js} +1 -1
- package/bundle/chunk-gd6qpdjw.js +2 -0
- package/bundle/chunk-gehn9fd9.js +2 -0
- package/bundle/{chunk-0zxwjsvz.js → chunk-ggxzf22k.js} +1 -1
- package/bundle/{chunk-kzvvvj79.js → chunk-gszvgz76.js} +2 -2
- package/bundle/{chunk-g3kd4957.js → chunk-gy21fw82.js} +2 -2
- package/bundle/{chunk-cbf1y12x.js → chunk-h62chdmw.js} +1 -1
- package/bundle/{chunk-knh01n2r.js → chunk-h823m51m.js} +2 -2
- package/bundle/{chunk-zqkv8796.js → chunk-h99tj1e4.js} +1 -1
- package/bundle/{chunk-c1g8n10t.js → chunk-ha1w0xzh.js} +1 -1
- package/bundle/chunk-ha8b2n4x.js +2 -0
- package/bundle/{chunk-rpfhgncs.js → chunk-has2rz35.js} +1 -1
- package/bundle/chunk-hbyrwmne.js +2 -0
- package/bundle/chunk-hhax4mxw.js +2 -0
- package/bundle/{chunk-087tnr8a.js → chunk-hwrrrbqd.js} +1 -1
- package/bundle/chunk-hzrxmdqm.js +2 -0
- package/bundle/{chunk-yd2emszh.js → chunk-j0bwa5dk.js} +2 -2
- package/bundle/{chunk-9b4aqcde.js → chunk-j164q40b.js} +2 -2
- package/bundle/{chunk-qhnpq5gb.js → chunk-j8fcfhr2.js} +2 -2
- package/bundle/{chunk-9ea1n338.js → chunk-j9h1sp4g.js} +2 -2
- package/bundle/{chunk-yrfq22a5.js → chunk-jg1ccs3j.js} +1 -1
- package/bundle/{chunk-d307vb2d.js → chunk-jqk3v8d6.js} +1 -1
- package/bundle/chunk-jrwnz64e.js +3 -0
- package/bundle/chunk-jvkzdap1.js +2 -0
- package/bundle/chunk-jvybgsz5.js +5 -0
- package/bundle/{chunk-pp9neaaz.js → chunk-jww55nk9.js} +1 -1
- package/bundle/{chunk-fvy24yhq.js → chunk-k1nh5sd2.js} +1 -1
- package/bundle/{chunk-wfggztm4.js → chunk-k4gsktts.js} +1 -1
- package/bundle/{chunk-qaz100ht.js → chunk-k5q9px67.js} +1 -1
- package/bundle/chunk-kg8fcv91.js +2 -0
- package/bundle/chunk-kgptyf7n.js +3 -0
- package/bundle/{chunk-b50t4jc5.js → chunk-khzzmyk2.js} +1 -1
- package/bundle/chunk-kjjjrjnb.js +2 -0
- package/bundle/{chunk-jvjq554f.js → chunk-ksme3gj1.js} +1 -1
- package/bundle/chunk-m5cfmhwh.js +2 -0
- package/bundle/{chunk-4v61ysex.js → chunk-m5dm7a1t.js} +1 -1
- package/bundle/{chunk-yr35q7q1.js → chunk-m7ganre7.js} +1 -1
- package/bundle/chunk-m7qxxbns.js +2 -0
- package/bundle/{chunk-y287zwkr.js → chunk-mh19kwzw.js} +1 -1
- package/bundle/{chunk-7my2231h.js → chunk-mhhtf0v3.js} +1 -1
- package/bundle/{chunk-grw4gg9j.js → chunk-mjjaezwq.js} +2 -2
- package/bundle/{chunk-03mbn7nj.js → chunk-mmjgf680.js} +2 -2
- package/bundle/{chunk-jv4th87b.js → chunk-mn9end71.js} +1 -1
- package/bundle/{chunk-dknemkw2.js → chunk-msdypt5f.js} +2 -2
- package/bundle/chunk-n0b0dfqk.js +2 -0
- package/bundle/{chunk-3h49k2ck.js → chunk-n23d0q00.js} +1 -1
- package/bundle/{chunk-mpe8zxc0.js → chunk-n78f8hfk.js} +1 -1
- package/bundle/chunk-n8wg5h5p.js +2 -0
- package/bundle/chunk-nbd13scz.js +28 -0
- package/bundle/{chunk-r2qns6yc.js → chunk-nftgx6bz.js} +1 -1
- package/bundle/{chunk-gr4bctqj.js → chunk-nj1ntakd.js} +2 -2
- package/bundle/{chunk-wdaf713t.js → chunk-nrat6ncm.js} +1 -1
- package/bundle/{chunk-rm5ntsvn.js → chunk-nty5z2cj.js} +1 -1
- package/bundle/chunk-nvwzam7a.js +2 -0
- package/bundle/{chunk-rp8asmq7.js → chunk-p169ee92.js} +1 -1
- package/bundle/chunk-p27a88vp.js +7 -0
- package/bundle/{chunk-xjpvv3vp.js → chunk-p3rd2q47.js} +2 -2
- package/bundle/{chunk-fbm6qczy.js → chunk-p4027t94.js} +1 -1
- package/bundle/{chunk-94qhpkfx.js → chunk-p54bzjtv.js} +1 -1
- package/bundle/{chunk-cp39f96a.js → chunk-p5be5ddp.js} +1 -1
- package/bundle/{chunk-ngvp6zc2.js → chunk-p6crzjtf.js} +2 -2
- package/bundle/chunk-p6hcj3kv.js +2 -0
- package/bundle/{chunk-p4ewy9xh.js → chunk-pb30kkbs.js} +6 -6
- package/bundle/chunk-pexmns0j.js +2 -0
- package/bundle/{chunk-my3cswnp.js → chunk-ph8hn1wt.js} +2 -2
- package/bundle/{chunk-99148b1k.js → chunk-pmg53fdd.js} +1 -1
- package/bundle/{chunk-wf4x5cjc.js → chunk-pr7z5dj8.js} +1 -1
- package/bundle/chunk-pt603np4.js +2 -0
- package/bundle/{chunk-4mvg7jt1.js → chunk-ptqk1j2r.js} +1 -1
- package/bundle/{chunk-a92hh67a.js → chunk-pxm4qvqk.js} +2 -2
- package/bundle/{chunk-3qfpw8f6.js → chunk-qey1efpx.js} +1 -1
- package/bundle/chunk-qk5bfcv8.js +2 -0
- package/bundle/{chunk-mx3jd1p9.js → chunk-qktzz0sy.js} +1 -1
- package/bundle/{chunk-ks1cs80p.js → chunk-qnvsqnz5.js} +2 -2
- package/bundle/{chunk-bcx2vkv4.js → chunk-qp1n7kwe.js} +1 -1
- package/bundle/{chunk-xnhvt98g.js → chunk-qqrc1h5b.js} +2 -2
- package/bundle/{chunk-q148vndn.js → chunk-qqxrvyx0.js} +2 -2
- package/bundle/chunk-qr06byhp.js +2 -0
- package/bundle/{chunk-qg9bt0kx.js → chunk-qrxqfp59.js} +2 -2
- package/bundle/{chunk-gtjn3yc4.js → chunk-qxcyz5hc.js} +2 -2
- package/bundle/{chunk-kc1xmcc9.js → chunk-qznr1emx.js} +41 -39
- package/bundle/{chunk-0z1cxvk1.js → chunk-r5zy4za0.js} +2 -2
- package/bundle/chunk-r7sq3maz.js +2 -0
- package/bundle/{chunk-f83wv08n.js → chunk-r9w0thdk.js} +1 -1
- package/bundle/chunk-rmgs9nmj.js +2 -0
- package/bundle/{chunk-p887g1xj.js → chunk-rn83r0js.js} +1 -1
- package/bundle/{chunk-7myg8076.js → chunk-rp9r3cvt.js} +2 -2
- package/bundle/{chunk-n90eh3e7.js → chunk-rrv0n73b.js} +1 -1
- package/bundle/chunk-rscfes01.js +2 -0
- package/bundle/chunk-rytavefg.js +2 -0
- package/bundle/{chunk-ztn2jv26.js → chunk-s2gg38y0.js} +1 -1
- package/bundle/{chunk-yz0pwv2m.js → chunk-s4vx9x1v.js} +1 -1
- package/bundle/{chunk-x2cavpa9.js → chunk-sfw5qddj.js} +1 -1
- package/bundle/chunk-sh9vjnsh.js +2 -0
- package/bundle/{chunk-6avjq7my.js → chunk-smznrv7k.js} +1 -1
- package/bundle/chunk-snbw69t6.js +2 -0
- package/bundle/chunk-st0c5wwc.js +2 -0
- package/bundle/{chunk-vqss3e48.js → chunk-t0761rhq.js} +2 -2
- package/bundle/{chunk-vqpfpmha.js → chunk-t239rvej.js} +2 -2
- package/bundle/{chunk-bggybm9k.js → chunk-t8c4cs6z.js} +1 -1
- package/bundle/chunk-tdyvps17.js +35 -0
- package/bundle/chunk-teb3k2sf.js +2 -0
- package/bundle/{chunk-ve3np791.js → chunk-tg226j37.js} +1 -1
- package/bundle/{chunk-73fz0cf4.js → chunk-tkrwcjkr.js} +2 -2
- package/bundle/{chunk-v5z6sx6j.js → chunk-tm34qp8j.js} +1 -1
- package/bundle/chunk-tr6rdr6h.js +4 -0
- package/bundle/chunk-ts798jvf.js +2 -0
- package/bundle/chunk-tx5aj02v.js +2 -0
- package/bundle/{chunk-3aq70t26.js → chunk-tza09w2q.js} +1 -1
- package/bundle/chunk-v1t51rrq.js +2 -0
- package/bundle/{chunk-q9ft590w.js → chunk-v6h3nes1.js} +2 -2
- package/bundle/{chunk-e586sjb0.js → chunk-vcygx6hs.js} +2 -2
- package/bundle/{chunk-hmznf0ax.js → chunk-vdxar0ct.js} +1 -1
- package/bundle/{chunk-86yk21g4.js → chunk-venprxdp.js} +1 -1
- package/bundle/{chunk-ywkvq7zb.js → chunk-vf492zs6.js} +1 -1
- package/bundle/chunk-vh9ptqn0.js +2 -0
- package/bundle/{chunk-w79jzf8w.js → chunk-vnrjk2be.js} +1 -1
- package/bundle/{chunk-8q5ns61h.js → chunk-vshycswk.js} +1 -1
- package/bundle/{chunk-8e6gx3gg.js → chunk-vsz4s6zt.js} +1 -1
- package/bundle/{chunk-vhe92p7a.js → chunk-vygkwwjd.js} +2 -2
- package/bundle/{chunk-9rxyq6f9.js → chunk-w46g7kdq.js} +2 -2
- package/bundle/{chunk-q128vfc6.js → chunk-w4brava0.js} +1 -1
- package/bundle/{chunk-drwqag0f.js → chunk-w4synhfg.js} +1 -1
- package/bundle/chunk-w72rctxz.js +2 -0
- package/bundle/{chunk-mxhb5adq.js → chunk-w9gzfsy7.js} +2 -2
- package/bundle/chunk-wbw9zv3h.js +2 -0
- package/bundle/chunk-wg55bwqh.js +8 -0
- package/bundle/{chunk-1sfcxdbw.js → chunk-wkg3c643.js} +2 -2
- package/bundle/{chunk-2bgqy6z7.js → chunk-wwdpw27v.js} +1 -1
- package/bundle/{chunk-km1n4ttr.js → chunk-wy3a4cab.js} +1 -1
- package/bundle/{chunk-tczbhj0e.js → chunk-wyj8cpx5.js} +1 -1
- package/bundle/chunk-x6mw98c2.js +2 -0
- package/bundle/chunk-x9ptmxt7.js +2 -0
- package/bundle/{chunk-8rh0femq.js → chunk-xdd3553a.js} +1 -1
- package/bundle/{chunk-2jpmxt4v.js → chunk-xdteq9bd.js} +1 -1
- package/bundle/{chunk-9y15zjxa.js → chunk-xe69cnsk.js} +1 -1
- package/bundle/{chunk-qkh8697x.js → chunk-xq2kcar4.js} +2 -2
- package/bundle/{chunk-bk3z400e.js → chunk-y0527cg0.js} +1 -1
- package/bundle/{chunk-hrw5rmj1.js → chunk-y29ejqg2.js} +1 -1
- package/bundle/{chunk-42r7z6sq.js → chunk-y67kaj0b.js} +1 -1
- package/bundle/chunk-y6p57wgh.js +2 -0
- package/bundle/chunk-y6xs8v17.js +2 -0
- package/bundle/{chunk-zdzxsyxs.js → chunk-y7hgevfv.js} +2 -2
- package/bundle/{chunk-k1gddnkm.js → chunk-ybane1en.js} +1 -1
- package/bundle/{chunk-k6cbfrzc.js → chunk-yhj01dz9.js} +2 -2
- package/bundle/{chunk-2xqqkf86.js → chunk-ypdt9mmr.js} +2 -2
- package/bundle/chunk-yvn8dmah.js +2 -0
- package/bundle/{chunk-vm1ek7yf.js → chunk-yz25607t.js} +1 -1
- package/bundle/{chunk-ypcc3cnb.js → chunk-z1932c3f.js} +1 -1
- package/bundle/chunk-z3xsfpc6.js +2 -0
- package/bundle/chunk-z4kjxtjq.js +2 -0
- package/bundle/{chunk-6ypafpg8.js → chunk-z6sbjvtv.js} +1 -1
- package/bundle/chunk-z8mj4z6e.js +2 -0
- package/bundle/{chunk-ta7mfkms.js → chunk-zc0cdvcv.js} +2 -2
- package/bundle/chunk-zgv1e250.js +2 -0
- package/bundle/chunk-zn5pw733.js +2 -0
- package/bundle/{chunk-qf1dqzra.js → chunk-ztyy3ga3.js} +2 -2
- package/bundle/chunk-zxwvnmea.js +2 -0
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/qffi-compat.so +0 -0
- package/bundle/qffi.node +0 -0
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-073ydjmk.js +0 -2
- package/bundle/chunk-0xrr0k94.js +0 -2
- package/bundle/chunk-0yagj4ss.js +0 -2
- package/bundle/chunk-0ych0f5w.js +0 -2
- package/bundle/chunk-22hr3ndh.js +0 -2
- package/bundle/chunk-23tyxyyj.js +0 -2
- package/bundle/chunk-28g1ndpx.js +0 -2
- package/bundle/chunk-29v1v357.js +0 -2
- package/bundle/chunk-2avxtbv3.js +0 -2
- package/bundle/chunk-2qk0k2eb.js +0 -2
- package/bundle/chunk-3kn57y8d.js +0 -619
- package/bundle/chunk-3ktj87g4.js +0 -2
- package/bundle/chunk-3wxvpvg4.js +0 -3
- package/bundle/chunk-42wdfks8.js +0 -2
- package/bundle/chunk-4f19vqxf.js +0 -2
- package/bundle/chunk-4jq25vbc.js +0 -2
- package/bundle/chunk-4m3k1atq.js +0 -2
- package/bundle/chunk-4n2ytddp.js +0 -2
- package/bundle/chunk-4yg42p6y.js +0 -2
- package/bundle/chunk-4zx3ze68.js +0 -2
- package/bundle/chunk-57xbwzdn.js +0 -3
- package/bundle/chunk-637sjdzq.js +0 -2
- package/bundle/chunk-6bghztra.js +0 -2
- package/bundle/chunk-6h8f89tt.js +0 -2
- package/bundle/chunk-6sjj203r.js +0 -2
- package/bundle/chunk-79aka9xe.js +0 -2
- package/bundle/chunk-7nqdhe7x.js +0 -2
- package/bundle/chunk-7rhry8nv.js +0 -2
- package/bundle/chunk-7x88b2n2.js +0 -2
- package/bundle/chunk-7zvawpe1.js +0 -7
- package/bundle/chunk-8mthftwc.js +0 -2
- package/bundle/chunk-8wdara3b.js +0 -2
- package/bundle/chunk-8xhzpnph.js +0 -2
- package/bundle/chunk-9akz8w0d.js +0 -2
- package/bundle/chunk-9etpppyv.js +0 -3
- package/bundle/chunk-9nn4jpb7.js +0 -2
- package/bundle/chunk-9tk4wsn4.js +0 -2
- package/bundle/chunk-a0rjp24v.js +0 -2
- package/bundle/chunk-a7p0x4sw.js +0 -2
- package/bundle/chunk-ae0a496j.js +0 -2
- package/bundle/chunk-aq1j9y18.js +0 -2
- package/bundle/chunk-aq8nz9hp.js +0 -2
- package/bundle/chunk-b4zy78be.js +0 -2
- package/bundle/chunk-basjzwqp.js +0 -2
- package/bundle/chunk-bhetpmgq.js +0 -3
- package/bundle/chunk-bm7xpjh6.js +0 -2
- package/bundle/chunk-c2k556rk.js +0 -2
- package/bundle/chunk-d41mg7at.js +0 -2
- package/bundle/chunk-d50kpss6.js +0 -2
- package/bundle/chunk-day0rb5p.js +0 -2
- package/bundle/chunk-dp7cww4v.js +0 -2
- package/bundle/chunk-e89zjjmj.js +0 -2
- package/bundle/chunk-egae7vvg.js +0 -2
- package/bundle/chunk-erdjd9w3.js +0 -2
- package/bundle/chunk-ex93y6dw.js +0 -2
- package/bundle/chunk-eyr0vf92.js +0 -2
- package/bundle/chunk-f1bcz9yz.js +0 -2
- package/bundle/chunk-fghqr4x8.js +0 -8
- package/bundle/chunk-fvkwcx35.js +0 -2
- package/bundle/chunk-fymt1rym.js +0 -5
- package/bundle/chunk-gbmmbhy4.js +0 -2
- package/bundle/chunk-gp877cq5.js +0 -2
- package/bundle/chunk-hk8vvc10.js +0 -2
- package/bundle/chunk-hwavzxdm.js +0 -2
- package/bundle/chunk-hwnc2sa5.js +0 -2
- package/bundle/chunk-j2gvpa15.js +0 -2
- package/bundle/chunk-j7n8khk7.js +0 -2
- package/bundle/chunk-jkh98wby.js +0 -2
- package/bundle/chunk-k5a652s4.js +0 -2
- package/bundle/chunk-k6w32q2p.js +0 -2
- package/bundle/chunk-ke5rqv5b.js +0 -2
- package/bundle/chunk-kghwk0yh.js +0 -2
- package/bundle/chunk-mgadsp7r.js +0 -2
- package/bundle/chunk-mk2s9py8.js +0 -2
- package/bundle/chunk-mxf9p0p9.js +0 -2
- package/bundle/chunk-n0k0pp4k.js +0 -2
- package/bundle/chunk-n393nnh5.js +0 -2
- package/bundle/chunk-n5vyed7w.js +0 -2
- package/bundle/chunk-nb86kh94.js +0 -7612
- package/bundle/chunk-nh044sjn.js +0 -2
- package/bundle/chunk-nm6wnne9.js +0 -3
- package/bundle/chunk-pasm65wq.js +0 -2
- package/bundle/chunk-pfh34atn.js +0 -2
- package/bundle/chunk-phpmxjf8.js +0 -2
- package/bundle/chunk-qvzvxsjw.js +0 -2
- package/bundle/chunk-qzszrd0s.js +0 -2
- package/bundle/chunk-rnq5ezrt.js +0 -2
- package/bundle/chunk-s7yza695.js +0 -2
- package/bundle/chunk-s99cvvc9.js +0 -2
- package/bundle/chunk-skpkjnyy.js +0 -2
- package/bundle/chunk-snt4kwab.js +0 -2
- package/bundle/chunk-sq47t8f1.js +0 -2
- package/bundle/chunk-sqhgnvvs.js +0 -2
- package/bundle/chunk-t114r59h.js +0 -2
- package/bundle/chunk-t1f56k0j.js +0 -2
- package/bundle/chunk-t69jx6fz.js +0 -2
- package/bundle/chunk-tce12v85.js +0 -3
- package/bundle/chunk-tq1dqhes.js +0 -2
- package/bundle/chunk-tsb3jsx4.js +0 -2
- package/bundle/chunk-ttpbpzbh.js +0 -2
- package/bundle/chunk-v667egp5.js +0 -2
- package/bundle/chunk-v7mg632n.js +0 -3
- package/bundle/chunk-x3afqfww.js +0 -4
- package/bundle/chunk-xwgc2pw7.js +0 -28
- package/bundle/chunk-xxrtr6sd.js +0 -2
- package/bundle/chunk-y8eggnrr.js +0 -2
- package/bundle/chunk-yck5h49c.js +0 -2
- package/bundle/chunk-yg0pfngv.js +0 -2
- package/bundle/chunk-yxeja9kg.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Cp as J,Dp as GG,Jp as LG,Kp as WG,Op as d,Pp as i,Qp as jG,Rp as TG,Sp as OG,Tp as kG,Yo as wG,Zo as NG,bp as MG,dp as JG,mp as CG,tp as bG,zp as D}from"./chunk-my3cswnp.js";import{_p as BG,kq as HG}from"./chunk-4mvg7jt1.js";import{au as G}from"./chunk-9ea1n338.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{Ap as TG,Bp as OG,Cp as kG,Ho as wG,Io as NG,Mo as MG,Oo as JG,Xo as CG,cp as bG,ip as D,lp as J,mp as GG,sp as LG,tp as WG,xp as d,yp as i,zp as jG}from"./chunk-ph8hn1wt.js";import{Jp as BG,Vp as HG}from"./chunk-ptqk1j2r.js";import{Jt as G}from"./chunk-j9h1sp4g.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 Kf,TX as Lf,GY as Mf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{d0 as
|
|
2
|
+
import{tO as I,wO as Z}from"./chunk-r9w0thdk.js";var x=I((r0,u)=>{u.exports=v;v.sync=K0;var N=Z("fs");function T0(q,L){var $=L.pathExt!==void 0?L.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var G=0;G<$.length;G++){var H=$[G].toLowerCase();if(H&&q.substr(-H.length).toLowerCase()===H)return!0}return!1}function R(q,L,$){if(!q.isSymbolicLink()&&!q.isFile())return!1;return T0(L,$)}function v(q,L,$){N.stat(q,function(G,H){$(G,G?!1:R(H,q,L))})}function K0(q,L){return R(N.statSync(q),q,L)}});var g=I((o0,E)=>{E.exports=b;b.sync=f0;var C=Z("fs");function b(q,L,$){C.stat(q,function(G,H){$(G,G?!1:w(H,L))})}function f0(q,L){return w(C.statSync(q),L)}function w(q,L){return q.isFile()&&A0(q,L)}function A0(q,L){var{mode:$,uid:G,gid:H}=q,X=L.uid!==void 0?L.uid:process.getuid&&process.getuid(),k=L.gid!==void 0?L.gid:process.getgid&&process.getgid(),J=parseInt("100",8),Y=parseInt("010",8),B=parseInt("001",8),V=J|Y,Q=$&B||$&Y&&H===k||$&J&&G===X||$&V&&X===0;return Q}});var h=I((s0,c)=>{var p0=Z("fs"),K;if(process.platform==="win32"||global.TESTING_WINDOWS)K=x();else K=g();c.exports=A;A.sync=D0;function A(q,L,$){if(typeof L==="function")$=L,L={};if(!$){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(G,H){A(q,L||{},function(X,k){if(X)H(X);else G(k)})})}K(q,L||{},function(G,H){if(G){if(G.code==="EACCES"||L&&L.ignoreErrors)G=null,H=!1}$(G,H)})}function D0(q,L){try{return K.sync(q,L||{})}catch($){if(L&&L.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var r=I((a0,d)=>{var _=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",l=Z("path"),F0=_?";":":",m=h(),n=(q)=>Object.assign(Error(`not found: ${q}`),{code:"ENOENT"}),i=(q,L)=>{let $=L.colon||F0,G=q.match(/\//)||_&&q.match(/\\/)?[""]:[..._?[process.cwd()]:[],...(L.path||process.env.PATH||"").split($)],H=_?L.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=_?H.split($):[""];if(_){if(q.indexOf(".")!==-1&&X[0]!=="")X.unshift("")}return{pathEnv:G,pathExt:X,pathExtExe:H}},t=(q,L,$)=>{if(typeof L==="function")$=L,L={};if(!L)L={};let{pathEnv:G,pathExt:H,pathExtExe:X}=i(q,L),k=[],J=(B)=>new Promise((V,Q)=>{if(B===G.length)return L.all&&k.length?V(k):Q(n(q));let U=G[B],T=/^".*"$/.test(U)?U.slice(1,-1):U,z=l.join(T,q),f=!T&&/^\.[\\\/]/.test(q)?q.slice(0,2)+z:z;V(Y(f,B,0))}),Y=(B,V,Q)=>new Promise((U,T)=>{if(Q===H.length)return U(J(V+1));let z=H[Q];m(B+z,{pathExt:X},(f,M0)=>{if(!f&&M0)if(L.all)k.push(B+z);else return U(B+z);return U(Y(B,V,Q+1))})});return $?J(0).then((B)=>$(null,B),$):J(0)},O0=(q,L)=>{L=L||{};let{pathEnv:$,pathExt:G,pathExtExe:H}=i(q,L),X=[];for(let k=0;k<$.length;k++){let J=$[k],Y=/^".*"$/.test(J)?J.slice(1,-1):J,B=l.join(Y,q),V=!Y&&/^\.[\\\/]/.test(q)?q.slice(0,2)+B:B;for(let Q=0;Q<G.length;Q++){let U=V+G[Q];try{if(m.sync(U,{pathExt:H}))if(L.all)X.push(U);else return U}catch(T){}}}if(L.all&&X.length)return X;if(L.nothrow)return null;throw n(q)};d.exports=t;t.sync=O0});var p=I((e0,D)=>{var o=(q={})=>{let L=q.env||process.env;if((q.platform||process.platform)!=="win32")return"PATH";return Object.keys(L).reverse().find((G)=>G.toUpperCase()==="PATH")||"Path"};D.exports=o;D.exports.default=o});var q0=I((qq,e)=>{var s=Z("path"),P0=r(),S0=p();function a(q,L){let $=q.options.env||process.env,G=process.cwd(),H=q.options.cwd!=null,X=H&&process.chdir!==void 0&&!process.chdir.disabled;if(X)try{process.chdir(q.options.cwd)}catch(J){}let k;try{k=P0.sync(q.command,{path:$[S0({env:$})],pathExt:L?s.delimiter:void 0})}catch(J){}finally{if(X)process.chdir(G)}if(k)k=s.resolve(H?q.options.cwd:"",k);return k}function j0(q){return a(q)||a(q,!0)}e.exports=j0});var L0=I((N0,O)=>{var F=/([()\][%!^"`<>&|;, *?])/g;function W0(q){return q=q.replace(F,"^$1"),q}function y0(q,L){if(q=`${q}`,q=q.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),q=q.replace(/(?=(\\+?)?)\1$/,"$1$1"),q=`"${q}"`,q=q.replace(F,"^$1"),L)q=q.replace(F,"^$1");return q}N0.command=W0;N0.argument=y0});var G0=I((Lq,$0)=>{$0.exports=/^#!(.*)/});var X0=I(($q,H0)=>{var u0=G0();H0.exports=(q="")=>{let L=q.match(u0);if(!L)return null;let[$,G]=L[0].replace(/#! ?/,"").split(" "),H=$.split("/").pop();if(H==="env")return G;return G?`${H} ${G}`:H}});var B0=I((Gq,k0)=>{var P=Z("fs"),x0=X0();function C0(q){let $=Buffer.alloc(150),G;try{G=P.openSync(q,"r"),P.readSync(G,$,0,150,0),P.closeSync(G)}catch(H){}return x0($.toString())}k0.exports=C0});var U0=I((Hq,Q0)=>{var b0=Z("path"),I0=q0(),J0=L0(),w0=B0(),E0=process.platform==="win32",g0=/\.(?:com|exe)$/i,c0=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h0(q){q.file=I0(q);let L=q.file&&w0(q.file);if(L)return q.args.unshift(q.file),q.command=L,I0(q);return q.file}function l0(q){if(!E0)return q;let L=h0(q),$=!g0.test(L);if(q.options.forceShell||$){let G=c0.test(L);q.command=b0.normalize(q.command),q.command=J0.command(q.command),q.args=q.args.map((X)=>J0.argument(X,G));let H=[q.command].concat(q.args).join(" ");q.args=["/d","/s","/c",`"${H}"`],q.command=process.env.comspec||"cmd.exe",q.options.windowsVerbatimArguments=!0}return q}function m0(q,L,$){if(L&&!Array.isArray(L))$=L,L=null;L=L?L.slice(0):[],$=Object.assign({},$);let G={command:q,args:L,options:$,file:void 0,original:{command:q,args:L}};return $.shell?G:l0(G)}Q0.exports=m0});var Z0=I((Xq,Y0)=>{var S=process.platform==="win32";function j(q,L){return Object.assign(Error(`${L} ${q.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${L} ${q.command}`,path:q.command,spawnargs:q.args})}function n0(q,L){if(!S)return;let $=q.emit;q.emit=function(G,H){if(G==="exit"){let X=V0(H,L);if(X)return $.call(q,"error",X)}return $.apply(q,arguments)}}function V0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawn");return null}function i0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawnSync");return null}Y0.exports={hookChildProcess:n0,verifyENOENT:V0,verifyENOENTSync:i0,notFoundError:j}});var d0=I((kq,M)=>{var z0=Z("child_process"),W=U0(),y=Z0();function _0(q,L,$){let G=W(q,L,$),H=z0.spawn(G.command,G.args,G.options);return y.hookChildProcess(H,G),H}function t0(q,L,$){let G=W(q,L,$),H=z0.spawnSync(G.command,G.args,G.options);return H.error=H.error||y.verifyENOENTSync(H.status,G),H}M.exports=_0;M.exports.spawn=_0;M.exports.sync=t0;M.exports._parse=W;M.exports._enoent=y});
|
|
3
|
+
export{d0 as Or};
|