@qitqode/qitqode-android-arm64 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/chunk-03zpnwk2.js +2 -0
- package/bundle/{chunk-p54bzjtv.js → chunk-060wbpz4.js} +1 -1
- package/bundle/{chunk-j0bwa5dk.js → chunk-0a4pmkc9.js} +2 -2
- package/bundle/chunk-0aqdzyar.js +2 -0
- package/bundle/{chunk-vygkwwjd.js → chunk-0egrckx0.js} +2 -2
- package/bundle/{chunk-bwbqkfv0.js → chunk-0ffmwhw7.js} +1 -1
- package/bundle/{chunk-953pqp3w.js → chunk-0tcggtwv.js} +1 -1
- package/bundle/{chunk-tkrwcjkr.js → chunk-0tm6589k.js} +2 -2
- package/bundle/{chunk-y7hgevfv.js → chunk-0w19vmd7.js} +2 -2
- package/bundle/{chunk-ehb4hd9c.js → chunk-0z1keh2w.js} +1 -1
- package/bundle/{chunk-at22twxx.js → chunk-1bxfzd6r.js} +2 -2
- package/bundle/{chunk-48r70n4s.js → chunk-1har4t9a.js} +1 -1
- package/bundle/{chunk-sfw5qddj.js → chunk-1p9s5jj1.js} +1 -1
- package/bundle/{chunk-2md6sx8d.js → chunk-1rgt2vmt.js} +1 -1
- package/bundle/{chunk-ksme3gj1.js → chunk-1v0khv7p.js} +1 -1
- package/bundle/{chunk-a7rp46yt.js → chunk-26cr51wa.js} +5 -5
- package/bundle/{chunk-fhqfqd5v.js → chunk-27saej0r.js} +2 -2
- package/bundle/{chunk-9hz56z6a.js → chunk-29gwtcey.js} +1 -1
- package/bundle/chunk-2a5gjgvp.js +2 -0
- package/bundle/{chunk-venprxdp.js → chunk-2caaqmec.js} +1 -1
- package/bundle/{chunk-ff548b0j.js → chunk-2kh0tg92.js} +2 -2
- package/bundle/{chunk-6evh2ke8.js → chunk-2nheahmq.js} +1 -1
- package/bundle/chunk-2pkfphgb.js +2 -0
- package/bundle/{chunk-99s035f0.js → chunk-2qm46qvn.js} +2 -2
- package/bundle/{chunk-8e4s6nc2.js → chunk-2t5yh25f.js} +1 -1
- package/bundle/{chunk-k1nh5sd2.js → chunk-2vaphpz0.js} +1 -1
- package/bundle/{chunk-f3zmdfqa.js → chunk-33ebjca6.js} +1 -1
- package/bundle/{chunk-2drzgtv3.js → chunk-35fj1sfm.js} +2 -2
- package/bundle/chunk-37cbrnke.js +8 -0
- package/bundle/{chunk-3kpse7zy.js → chunk-3bb4aqh9.js} +1 -1
- package/bundle/chunk-3cx4p07h.js +2 -0
- package/bundle/chunk-3f2cjzb4.js +2 -0
- package/bundle/chunk-3qvap1kv.js +2 -0
- package/bundle/{chunk-p6crzjtf.js → chunk-3va85mbe.js} +2 -2
- package/bundle/{chunk-y67kaj0b.js → chunk-3z2zn8rj.js} +1 -1
- package/bundle/{chunk-bzebyyfr.js → chunk-3zwma68w.js} +4 -4
- package/bundle/{chunk-4pshnq6g.js → chunk-4064rbtp.js} +1 -1
- package/bundle/chunk-42hvspe7.js +2 -0
- package/bundle/chunk-452tk6v3.js +2 -0
- package/bundle/{chunk-ejqzcdcx.js → chunk-48gap82w.js} +1 -1
- package/bundle/{chunk-ycvwpmd9.js → chunk-4aajzxm9.js} +2 -2
- package/bundle/chunk-4gqb1hps.js +2 -0
- package/bundle/{chunk-e8p92vz4.js → chunk-4pmvxnkj.js} +2 -2
- package/bundle/chunk-50qgz5ka.js +2 -0
- package/bundle/{chunk-zc0cdvcv.js → chunk-52xvhxek.js} +2 -2
- package/bundle/{chunk-y0527cg0.js → chunk-56wq8cqj.js} +1 -1
- package/bundle/{chunk-tzb26ntq.js → chunk-58f4y4b7.js} +3 -3
- package/bundle/{chunk-tr6rdr6h.js → chunk-59csnjc3.js} +2 -2
- package/bundle/chunk-5b0xyq5z.js +2 -0
- package/bundle/{chunk-mn9end71.js → chunk-5bv63rqj.js} +1 -1
- package/bundle/{chunk-w4synhfg.js → chunk-5cw8235e.js} +1 -1
- package/bundle/{chunk-5asx1706.js → chunk-5f0nhthe.js} +2 -2
- package/bundle/chunk-5j4nxpdy.js +2 -0
- package/bundle/{chunk-cbnkx933.js → chunk-5nmm1kvx.js} +2 -2
- package/bundle/chunk-5nxgk6hw.js +2 -0
- package/bundle/chunk-5qkvhr6y.js +2 -0
- package/bundle/{chunk-avefgbjg.js → chunk-5r7c6vvx.js} +2 -2
- package/bundle/{chunk-z6sbjvtv.js → chunk-5wx962mw.js} +1 -1
- package/bundle/{chunk-mhhtf0v3.js → chunk-5xkp27b1.js} +1 -1
- package/bundle/chunk-66qmmmdp.js +2 -0
- package/bundle/{chunk-3cr2p4mp.js → chunk-66wv82vf.js} +1 -1
- package/bundle/chunk-6dpdkzrk.js +2 -0
- package/bundle/chunk-6p6m5956.js +3 -0
- package/bundle/{chunk-dnsh1v42.js → chunk-6ps30qax.js} +2 -2
- package/bundle/{chunk-hqbbs9dm.js → chunk-6qwk6z87.js} +3 -3
- package/bundle/{chunk-khzzmyk2.js → chunk-6tqbnxar.js} +1 -1
- package/bundle/chunk-6yhn9syz.js +2 -0
- package/bundle/{chunk-m5dm7a1t.js → chunk-72crs18f.js} +1 -1
- package/bundle/{chunk-hwrrrbqd.js → chunk-7adsab4h.js} +1 -1
- package/bundle/{chunk-97q2t1yz.js → chunk-7b60whxm.js} +1 -1
- package/bundle/chunk-7g59hc61.js +2 -0
- package/bundle/{chunk-5pzs51sp.js → chunk-7jy53zqy.js} +1 -1
- package/bundle/chunk-7p88j56s.js +2 -0
- package/bundle/{chunk-3jf3jhrs.js → chunk-7thhd7ds.js} +1 -1
- package/bundle/chunk-7trngc9g.js +2 -0
- package/bundle/{chunk-5df5aja0.js → chunk-82xrfk5x.js} +2 -2
- package/bundle/{chunk-jqk3v8d6.js → chunk-85wh85pk.js} +1 -1
- package/bundle/chunk-8cebbmtf.js +2 -0
- package/bundle/chunk-8csas2jc.js +2 -0
- package/bundle/chunk-8g4jdqq1.js +2 -0
- package/bundle/chunk-8j1xcdmd.js +2 -0
- package/bundle/{chunk-7vmx8bg9.js → chunk-8jmb5bd4.js} +2 -2
- package/bundle/{chunk-8wwdrwf2.js → chunk-8p0t8qah.js} +1 -1
- package/bundle/{chunk-bbng1cea.js → chunk-8ysp6vf8.js} +1 -1
- package/bundle/{chunk-rn83r0js.js → chunk-8yzghzjq.js} +1 -1
- package/bundle/{chunk-q3nvzhyh.js → chunk-9009v4d0.js} +2 -2
- package/bundle/chunk-90r2z49k.js +2 -0
- package/bundle/{chunk-j164q40b.js → chunk-92r1gw2j.js} +2 -2
- package/bundle/chunk-94mjwy22.js +2 -0
- package/bundle/{chunk-xdteq9bd.js → chunk-9cf2ktyh.js} +1 -1
- package/bundle/{chunk-ngfxxfem.js → chunk-9cn8cmt0.js} +1 -1
- package/bundle/{chunk-55ykn8nz.js → chunk-a1z8rnq7.js} +4 -4
- package/bundle/{chunk-j9h1sp4g.js → chunk-a48mx917.js} +2 -2
- package/bundle/{chunk-et3804wr.js → chunk-a8bjcvda.js} +1 -1
- package/bundle/chunk-aenrd7dk.js +2 -0
- package/bundle/{chunk-cz5vta94.js → chunk-afr8m0q1.js} +1 -1
- package/bundle/{chunk-f31yvp20.js → chunk-ag8wxwwz.js} +1 -1
- package/bundle/chunk-ahmy80vb.js +2 -0
- package/bundle/chunk-avn12jkt.js +2 -0
- package/bundle/{chunk-6scf311w.js → chunk-ax64ngf2.js} +1 -1
- package/bundle/{chunk-43ttzy29.js → chunk-ayb3bdb7.js} +2 -2
- package/bundle/{chunk-dnnkq5y4.js → chunk-az3nss5m.js} +2 -2
- package/bundle/chunk-b7ncyat6.js +2 -0
- package/bundle/{chunk-g3wvtyw3.js → chunk-b7sr9rn3.js} +1 -1
- package/bundle/{chunk-24rkf2gk.js → chunk-bc2krtaf.js} +1 -1
- package/bundle/{chunk-gjd3wf8b.js → chunk-bjv1h2dq.js} +1 -1
- package/bundle/{chunk-cng61dby.js → chunk-bnaj2hh3.js} +1 -1
- package/bundle/{chunk-70q8qcb2.js → chunk-bpfq8fz4.js} +1 -1
- package/bundle/chunk-brk6bge4.js +3 -0
- package/bundle/{chunk-eg3syjtv.js → chunk-bwadggys.js} +2 -2
- package/bundle/chunk-c2a74stf.js +2 -0
- package/bundle/{chunk-q9tgdghx.js → chunk-c3yjbent.js} +1 -1
- package/bundle/{chunk-7x6yrtzn.js → chunk-c76cjhn0.js} +1 -1
- package/bundle/{chunk-21rq4592.js → chunk-ccf4pgkr.js} +2 -2
- package/bundle/chunk-ce5e7j62.js +2 -0
- package/bundle/{chunk-tm34qp8j.js → chunk-cf9m9m9q.js} +1 -1
- package/bundle/{chunk-39z96pc6.js → chunk-cfwz1hgr.js} +3 -3
- package/bundle/{chunk-jww55nk9.js → chunk-cghz0855.js} +1 -1
- package/bundle/{chunk-5c2438af.js → chunk-cr5tknvb.js} +1 -1
- package/bundle/chunk-cw1gwjx9.js +2 -0
- package/bundle/chunk-czw30fjs.js +2 -0
- package/bundle/{chunk-05ck7acg.js → chunk-d30k7dpf.js} +1 -1
- package/bundle/{chunk-mjjaezwq.js → chunk-d839fr0w.js} +2 -2
- package/bundle/{chunk-nmzrrqgb.js → chunk-ddx2pcr4.js} +1 -1
- package/bundle/{chunk-pmg53fdd.js → chunk-dgcannw0.js} +1 -1
- package/bundle/{chunk-vnrjk2be.js → chunk-dhvx9p54.js} +1 -1
- package/bundle/chunk-dmkgjf1v.js +3 -0
- package/bundle/{chunk-nj1ntakd.js → chunk-dt3bsmfe.js} +2 -2
- package/bundle/chunk-dwhsvpag.js +2 -0
- package/bundle/{chunk-0smnwqk6.js → chunk-dwkrqtbc.js} +2 -2
- package/bundle/chunk-e01jgnnm.js +2 -0
- package/bundle/chunk-e0hfpdje.js +2 -0
- package/bundle/{chunk-r9w0thdk.js → chunk-e0vrxetq.js} +1 -1
- package/bundle/{chunk-k4gsktts.js → chunk-e2wfj86b.js} +1 -1
- package/bundle/chunk-e5jk67xh.js +2 -0
- package/bundle/{chunk-wkg3c643.js → chunk-eacpc64g.js} +2 -2
- package/bundle/{chunk-47k5jy1p.js → chunk-eewe7tx1.js} +2 -2
- package/bundle/{chunk-y29ejqg2.js → chunk-eg1m81ax.js} +1 -1
- package/bundle/chunk-eg4pq4hv.js +2 -0
- package/bundle/{chunk-bne5w117.js → chunk-ejhhrece.js} +3 -3
- package/bundle/{chunk-d7nsd979.js → chunk-epmc4aht.js} +1 -1
- package/bundle/chunk-ew3yz97p.js +2 -0
- package/bundle/{chunk-32j0q58h.js → chunk-eyr5ymt8.js} +1 -1
- package/bundle/chunk-ezgfhy4e.js +2 -0
- package/bundle/{chunk-45a4n21f.js → chunk-f2v4g7t1.js} +1 -1
- package/bundle/chunk-f2yfyhh8.js +2 -0
- package/bundle/chunk-f30em1wx.js +2 -0
- package/bundle/{chunk-5w76kdjr.js → chunk-f4mnp6xd.js} +1 -1
- package/bundle/{chunk-bkct64rs.js → chunk-f81kk8ra.js} +1 -1
- package/bundle/{chunk-3ktzxj69.js → chunk-f8cae1ap.js} +1 -1
- package/bundle/{chunk-ybane1en.js → chunk-fa8pwdwv.js} +1 -1
- package/bundle/{chunk-wwdpw27v.js → chunk-fej5x648.js} +1 -1
- package/bundle/{chunk-8yvx3pgy.js → chunk-fge37dke.js} +1 -1
- package/bundle/{chunk-nty5z2cj.js → chunk-fh3d0wce.js} +1 -1
- package/bundle/{chunk-gszvgz76.js → chunk-fjftb2sz.js} +2 -2
- package/bundle/{chunk-c36p881g.js → chunk-fs1vb39f.js} +3 -3
- package/bundle/{chunk-0xrb12s8.js → chunk-ftvvm4r5.js} +2 -2
- package/bundle/{chunk-nrat6ncm.js → chunk-fw1f47de.js} +1 -1
- package/bundle/{chunk-m7ganre7.js → chunk-g26redah.js} +1 -1
- package/bundle/{chunk-7g66qc1v.js → chunk-g3n465ee.js} +2 -2
- package/bundle/{chunk-313zqzc1.js → chunk-g4tyaj0m.js} +1 -1
- package/bundle/{chunk-fjbv3jht.js → chunk-g6y2c5az.js} +1 -1
- package/bundle/{chunk-qnvsqnz5.js → chunk-g7v6sp3c.js} +2 -2
- package/bundle/{chunk-n23d0q00.js → chunk-g878zd6e.js} +1 -1
- package/bundle/{chunk-p5be5ddp.js → chunk-g9nwqwqp.js} +1 -1
- package/bundle/chunk-gbvm6dpv.js +2 -0
- package/bundle/{chunk-fsqses4g.js → chunk-gc5rhnht.js} +2 -2
- package/bundle/{chunk-kengqzja.js → chunk-gefx3n08.js} +2 -2
- package/bundle/{chunk-yz25607t.js → chunk-ggncq8w8.js} +1 -1
- package/bundle/{chunk-7mppvhv9.js → chunk-gsg6zn7e.js} +2 -2
- package/bundle/{chunk-5nrc5rhh.js → chunk-gznt3dv8.js} +1 -1
- package/bundle/{chunk-p169ee92.js → chunk-h1bvqstw.js} +1 -1
- package/bundle/{chunk-pe2xdkez.js → chunk-h4hs2rhf.js} +2 -2
- package/bundle/chunk-h5w91zr4.js +2 -0
- package/bundle/{chunk-d6jhs818.js → chunk-h8mfbbjh.js} +2 -2
- package/bundle/{chunk-hjt94wce.js → chunk-he9kpk9r.js} +282 -276
- package/bundle/chunk-hmpb3c21.js +2 -0
- package/bundle/{chunk-920z7g7j.js → chunk-hz02vrqs.js} +1 -1
- package/bundle/{chunk-68v3b6ns.js → chunk-j10a984e.js} +2 -2
- package/bundle/chunk-j32rr7rt.js +2 -0
- package/bundle/chunk-j871xzr7.js +2 -0
- package/bundle/{chunk-0qd3567w.js → chunk-jmmtcr2r.js} +1 -1
- package/bundle/{chunk-has2rz35.js → chunk-jpn9zfj5.js} +1 -1
- package/bundle/{chunk-vshycswk.js → chunk-jqj1ay7x.js} +1 -1
- package/bundle/{chunk-vsz4s6zt.js → chunk-jr80q31w.js} +1 -1
- package/bundle/chunk-k3hgwszx.js +2 -0
- package/bundle/{chunk-wy3a4cab.js → chunk-kckr30tf.js} +1 -1
- package/bundle/{chunk-z1932c3f.js → chunk-kgv68cpb.js} +1 -1
- package/bundle/{chunk-vkaa7k3e.js → chunk-khpfseej.js} +2 -2
- package/bundle/{chunk-bd21p9zz.js → chunk-kre93a89.js} +2 -2
- package/bundle/{chunk-smznrv7k.js → chunk-kveztc6k.js} +1 -1
- package/bundle/{chunk-jnrnncqc.js → chunk-kwfe4em6.js} +1 -1
- package/bundle/chunk-kx88qekb.js +2 -0
- package/bundle/{chunk-4agaj51z.js → chunk-m4r8sepw.js} +1 -1
- package/bundle/{chunk-bqn6bqws.js → chunk-m7tmgvh6.js} +1 -1
- package/bundle/{chunk-qp1n7kwe.js → chunk-makegrxs.js} +1 -1
- package/bundle/{chunk-yhj01dz9.js → chunk-mr17tppa.js} +2 -2
- package/bundle/{chunk-5pwv2p3s.js → chunk-mv7q6ach.js} +1 -1
- package/bundle/chunk-n61e0znt.js +2 -0
- package/bundle/{chunk-j8fcfhr2.js → chunk-n6tqtk6h.js} +2 -2
- package/bundle/chunk-n6v36np0.js +2 -0
- package/bundle/chunk-ndd4cn3z.js +2 -0
- package/bundle/{chunk-t5r3w9e1.js → chunk-nfafk3ts.js} +1 -1
- package/bundle/{chunk-kth84vdn.js → chunk-nga216dm.js} +1 -1
- package/bundle/{chunk-cj7r8w1e.js → chunk-njsmma3a.js} +1 -1
- package/bundle/chunk-nr2j8ytn.js +3 -0
- package/bundle/{chunk-rrv0n73b.js → chunk-ntr0ezf2.js} +1 -1
- package/bundle/chunk-nwj6mcxz.js +2 -0
- package/bundle/{chunk-t239rvej.js → chunk-p2fte9vz.js} +2 -2
- package/bundle/chunk-p5b5ekhh.js +2 -0
- package/bundle/{chunk-vf492zs6.js → chunk-p8ak162p.js} +1 -1
- package/bundle/chunk-pf23nw4z.js +2 -0
- package/bundle/{chunk-0428v6mw.js → chunk-phf37x1c.js} +1 -1
- package/bundle/{chunk-faee8zgc.js → chunk-phpxxd48.js} +1 -1
- package/bundle/{chunk-5tky3csh.js → chunk-pqg1wjb5.js} +1 -1
- package/bundle/chunk-pw3cv89g.js +2 -0
- package/bundle/{chunk-d51908mv.js → chunk-q3c8mfbq.js} +1 -1
- package/bundle/{chunk-ypdt9mmr.js → chunk-qbnt4ynd.js} +2 -2
- package/bundle/chunk-qc89yj61.js +2 -0
- package/bundle/{chunk-k5q9px67.js → chunk-qgek59e6.js} +1 -1
- package/bundle/{chunk-v6v9xn81.js → chunk-qgfbsmsx.js} +1 -1
- package/bundle/{chunk-450fef7h.js → chunk-qgkb6n8k.js} +2 -2
- package/bundle/{chunk-xe69cnsk.js → chunk-qk1jkc0n.js} +1 -1
- package/bundle/{chunk-w4brava0.js → chunk-qk5vy2pr.js} +1 -1
- package/bundle/chunk-qn8tz704.js +2 -0
- package/bundle/{chunk-k3dacdp5.js → chunk-qq9m8fxv.js} +7 -7
- package/bundle/{chunk-q3h42a94.js → chunk-qxdpgdfk.js} +2 -2
- package/bundle/chunk-qxre2gqn.js +2 -0
- package/bundle/chunk-rdk62809.js +2 -0
- package/bundle/chunk-rew6r516.js +2 -0
- package/bundle/chunk-rjhvdfn5.js +2 -0
- package/bundle/{chunk-wyj8cpx5.js → chunk-rk0fnvp5.js} +1 -1
- package/bundle/{chunk-mh19kwzw.js → chunk-rmsqb6r4.js} +1 -1
- package/bundle/{chunk-jg1ccs3j.js → chunk-rva2ekrt.js} +1 -1
- package/bundle/{chunk-ac7482n2.js → chunk-rwnwjm82.js} +2 -2
- package/bundle/{chunk-ggxzf22k.js → chunk-rye1yjnr.js} +1 -1
- package/bundle/{chunk-s4vx9x1v.js → chunk-ryrxgn6d.js} +1 -1
- package/bundle/{chunk-pxm4qvqk.js → chunk-s2tc3qs0.js} +2 -2
- package/bundle/{chunk-mhtxp66q.js → chunk-s8z7v1me.js} +2 -2
- package/bundle/{chunk-9zm6r55d.js → chunk-sa0rrreh.js} +2 -2
- package/bundle/{chunk-mmjgf680.js → chunk-sbjymf20.js} +2 -2
- package/bundle/{chunk-ptqk1j2r.js → chunk-scnbt714.js} +1 -1
- package/bundle/chunk-skgr9ypq.js +2 -0
- package/bundle/{chunk-tg226j37.js → chunk-sm1g81cv.js} +1 -1
- package/bundle/chunk-sv40pwe2.js +2 -0
- package/bundle/{chunk-3vvd7j14.js → chunk-sy9w1t2y.js} +1 -1
- package/bundle/{chunk-p4027t94.js → chunk-sz0favtz.js} +1 -1
- package/bundle/{chunk-g22e4gw7.js → chunk-t18ka1e7.js} +1 -1
- package/bundle/{chunk-7hvf9dgx.js → chunk-t3w43rft.js} +1 -1
- package/bundle/{chunk-5zkj5xv9.js → chunk-t6zz47zk.js} +2 -2
- package/bundle/{chunk-6m9jb0s9.js → chunk-t8fjgkp8.js} +2 -2
- package/bundle/{chunk-7bcm7gg1.js → chunk-tbx741en.js} +1 -1
- package/bundle/chunk-tfhpjmny.js +2 -0
- package/bundle/chunk-tnete6ye.js +2 -0
- package/bundle/chunk-tpyq7ycb.js +2 -0
- package/bundle/{chunk-ezrqhqkp.js → chunk-trstb8ee.js} +1 -1
- package/bundle/{chunk-h9wh48d0.js → chunk-tsmj98yf.js} +2 -2
- package/bundle/{chunk-m80v76m9.js → chunk-txkdt4ep.js} +1 -1
- package/bundle/chunk-v5h5wxw5.js +2 -0
- package/bundle/chunk-v6141yq1.js +2 -0
- package/bundle/{chunk-cmb62jkt.js → chunk-vbfej8ds.js} +2 -2
- package/bundle/chunk-vfd3azkp.js +3 -0
- package/bundle/chunk-vjs69r6x.js +2 -0
- package/bundle/{chunk-xy0gnpen.js → chunk-vkjqy92f.js} +1 -1
- package/bundle/chunk-vmhar83s.js +2 -0
- package/bundle/{chunk-24ygjbpf.js → chunk-vph4w4yy.js} +2 -2
- package/bundle/chunk-vqvnw12p.js +2 -0
- package/bundle/{chunk-h62chdmw.js → chunk-vr8nwzp0.js} +1 -1
- package/bundle/{chunk-w46g7kdq.js → chunk-vs3s49jw.js} +2 -2
- package/bundle/{chunk-n78f8hfk.js → chunk-vsqvnxbz.js} +1 -1
- package/bundle/{chunk-t8c4cs6z.js → chunk-w0nc0gcx.js} +1 -1
- package/bundle/{chunk-qkvqvgcx.js → chunk-w0sng8a9.js} +1 -1
- package/bundle/chunk-w0sztk4y.js +2 -0
- package/bundle/chunk-w6bb320d.js +2 -0
- package/bundle/{chunk-55fcmswd.js → chunk-w7a33cwa.js} +2 -2
- package/bundle/{chunk-fyhqp4pb.js → chunk-w9qh2479.js} +1 -1
- package/bundle/{chunk-xwdxgg16.js → chunk-waa1ggtj.js} +1 -1
- package/bundle/{chunk-fr34mnyg.js → chunk-wb05bp10.js} +2 -2
- package/bundle/{chunk-gy21fw82.js → chunk-wb47k8ah.js} +2 -2
- package/bundle/{chunk-dxdggn90.js → chunk-wd8f9r4k.js} +1 -1
- package/bundle/chunk-wf41m019.js +2 -0
- package/bundle/{chunk-r5zy4za0.js → chunk-wgkcyqn1.js} +2 -2
- package/bundle/{chunk-ph8hn1wt.js → chunk-wm9nh9nb.js} +2 -2
- package/bundle/{chunk-g42krp0z.js → chunk-wn63q3xp.js} +1 -1
- package/bundle/{chunk-73r8bjjz.js → chunk-wqk1v8t0.js} +2 -2
- package/bundle/chunk-wqw6yjrg.js +2 -0
- package/bundle/{chunk-qey1efpx.js → chunk-wr6rnxr5.js} +1 -1
- package/bundle/chunk-ws08rxge.js +2 -0
- package/bundle/{chunk-xdd3553a.js → chunk-wtt5wms9.js} +1 -1
- package/bundle/{chunk-pb30kkbs.js → chunk-wtxh5m6j.js} +3 -3
- package/bundle/chunk-wz3dvc3g.js +2 -0
- package/bundle/{chunk-p4b0s5td.js → chunk-x00hwy3x.js} +1 -1
- package/bundle/chunk-x2pmqvdc.js +2 -0
- package/bundle/chunk-x4wfq39v.js +2 -0
- package/bundle/{chunk-pt0xphq9.js → chunk-xs6v0r9m.js} +1 -1
- package/bundle/{chunk-d0x5pbkm.js → chunk-xy8arehp.js} +1 -1
- package/bundle/{chunk-0cnwsf8p.js → chunk-y0h3jfkj.js} +1 -1
- package/bundle/{chunk-pr7z5dj8.js → chunk-y3gy62q5.js} +1 -1
- package/bundle/chunk-yb6m08zj.js +2 -0
- package/bundle/chunk-ybcqkgs7.js +2 -0
- package/bundle/{chunk-vcygx6hs.js → chunk-ydgst3h8.js} +2 -2
- package/bundle/{chunk-qxcyz5hc.js → chunk-ykpj10nz.js} +2 -2
- package/bundle/{chunk-t0761rhq.js → chunk-ynf17943.js} +2 -2
- package/bundle/{chunk-da6kggv7.js → chunk-ytyzrqev.js} +2 -2
- package/bundle/{chunk-ztyy3ga3.js → chunk-z0kbyr00.js} +2 -2
- package/bundle/{chunk-65bmsp2t.js → chunk-zfrftgcy.js} +1 -1
- package/bundle/chunk-zj1jc1xt.js +2 -0
- package/bundle/chunk-zm0m0504.js +2 -0
- package/bundle/{chunk-w9gzfsy7.js → chunk-zqdjk4rf.js} +2 -2
- package/bundle/{chunk-ha1w0xzh.js → chunk-zrhw1szj.js} +1 -1
- package/bundle/{chunk-804vmbcd.js → chunk-zsg29gba.js} +1 -1
- package/bundle/{chunk-6ar91jvd.js → chunk-zwhmg9dj.js} +1 -1
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-0ppnq3a4.js +0 -2
- package/bundle/chunk-0te0vcdn.js +0 -2
- package/bundle/chunk-11h06z17.js +0 -2
- package/bundle/chunk-28yv4fqe.js +0 -2
- package/bundle/chunk-34a52hyr.js +0 -2
- package/bundle/chunk-3d73kfea.js +0 -2
- package/bundle/chunk-3n3gb3vd.js +0 -2
- package/bundle/chunk-3sq60y9f.js +0 -2
- package/bundle/chunk-49mbnqvc.js +0 -2
- package/bundle/chunk-4fr6kae9.js +0 -2
- package/bundle/chunk-516w1nc4.js +0 -2
- package/bundle/chunk-535nm66j.js +0 -2
- package/bundle/chunk-5kpxpm8e.js +0 -2
- package/bundle/chunk-5nm5s0h2.js +0 -2
- package/bundle/chunk-5ysbwr4x.js +0 -3
- package/bundle/chunk-6dvmyeg7.js +0 -2
- package/bundle/chunk-6ex981t8.js +0 -2
- package/bundle/chunk-6gpf2bjs.js +0 -2
- package/bundle/chunk-6jeg2r5j.js +0 -2
- package/bundle/chunk-6nry7tah.js +0 -2
- package/bundle/chunk-7bgzcpdw.js +0 -2
- package/bundle/chunk-7kjvcbwa.js +0 -2
- package/bundle/chunk-7x30x94y.js +0 -2
- package/bundle/chunk-86hsh44c.js +0 -3
- package/bundle/chunk-8jma2btf.js +0 -2
- package/bundle/chunk-8sbb95a4.js +0 -2
- package/bundle/chunk-93e0w75z.js +0 -2
- package/bundle/chunk-97gp818s.js +0 -2
- package/bundle/chunk-9epf2zbh.js +0 -2
- package/bundle/chunk-agv04nt7.js +0 -2
- package/bundle/chunk-be7smmar.js +0 -2
- package/bundle/chunk-bg1t0kke.js +0 -2
- package/bundle/chunk-bryx5cx9.js +0 -2
- package/bundle/chunk-c13rrw41.js +0 -2
- package/bundle/chunk-c2kkv619.js +0 -2
- package/bundle/chunk-c3zge8cg.js +0 -3
- package/bundle/chunk-c5xj1y5v.js +0 -2
- package/bundle/chunk-cfhfc86j.js +0 -8
- package/bundle/chunk-ckpm4dvv.js +0 -2
- package/bundle/chunk-cqkaamvn.js +0 -2
- package/bundle/chunk-ct8twng1.js +0 -2
- package/bundle/chunk-d38y7bvh.js +0 -2
- package/bundle/chunk-d6hxsfm6.js +0 -2
- package/bundle/chunk-descb9jz.js +0 -2
- package/bundle/chunk-dvr2b9r1.js +0 -2
- package/bundle/chunk-ea5fktnn.js +0 -2
- package/bundle/chunk-f0t7rryn.js +0 -3
- package/bundle/chunk-f4mf6tpp.js +0 -2
- package/bundle/chunk-f97k17t8.js +0 -2
- package/bundle/chunk-g4ehhdzp.js +0 -2
- package/bundle/chunk-gd6qpdjw.js +0 -2
- package/bundle/chunk-gdn91t9j.js +0 -2
- package/bundle/chunk-gehn9fd9.js +0 -2
- package/bundle/chunk-hhax4mxw.js +0 -2
- package/bundle/chunk-hjb1etf8.js +0 -2
- package/bundle/chunk-jvkzdap1.js +0 -2
- package/bundle/chunk-kg8fcv91.js +0 -2
- package/bundle/chunk-kgptyf7n.js +0 -3
- package/bundle/chunk-kjjjrjnb.js +0 -2
- package/bundle/chunk-ky88ba80.js +0 -2
- package/bundle/chunk-m5cfmhwh.js +0 -2
- package/bundle/chunk-m7qxxbns.js +0 -2
- package/bundle/chunk-n8wg5h5p.js +0 -2
- package/bundle/chunk-nvs0d8jg.js +0 -2
- package/bundle/chunk-p6hcj3kv.js +0 -2
- package/bundle/chunk-pexmns0j.js +0 -2
- package/bundle/chunk-pt603np4.js +0 -2
- package/bundle/chunk-pz1avwyt.js +0 -2
- package/bundle/chunk-qk5bfcv8.js +0 -2
- package/bundle/chunk-qr06byhp.js +0 -2
- package/bundle/chunk-r7sq3maz.js +0 -2
- package/bundle/chunk-rcrjbhaz.js +0 -2
- package/bundle/chunk-rmgs9nmj.js +0 -2
- package/bundle/chunk-rytavefg.js +0 -2
- package/bundle/chunk-sh9vjnsh.js +0 -2
- package/bundle/chunk-st0c5wwc.js +0 -2
- package/bundle/chunk-teb3k2sf.js +0 -2
- package/bundle/chunk-ts798jvf.js +0 -2
- package/bundle/chunk-tx5aj02v.js +0 -2
- package/bundle/chunk-v1t51rrq.js +0 -2
- package/bundle/chunk-vdrz2t9c.js +0 -2
- package/bundle/chunk-vh9ptqn0.js +0 -2
- package/bundle/chunk-vj4x8hvz.js +0 -2
- package/bundle/chunk-w72rctxz.js +0 -2
- package/bundle/chunk-wbw9zv3h.js +0 -2
- package/bundle/chunk-x6mw98c2.js +0 -2
- package/bundle/chunk-y6p57wgh.js +0 -2
- package/bundle/chunk-y6xs8v17.js +0 -2
- package/bundle/chunk-z3xsfpc6.js +0 -2
- package/bundle/chunk-zkm3yyyf.js +0 -2
- package/bundle/chunk-zn5pw733.js +0 -2
- package/bundle/chunk-zxwvnmea.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ap as hG,Bp as gG,Cp as mG,Gp as dG,Ho as CG,Io as bG,Mo as TG,Oo as jG,Xo as AG,ap as OG,cp as kG,ep as vG,fp as _G,ip as J,lp as W,mp as GG,sp as LG,tp as VG,xp as u,yp as l,zp as UG}from"./chunk-ph8hn1wt.js";import{Jp as NG,Mp as MG,Sp as WG,Vp as HG}from"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import{Jt as G}from"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-r9w0thdk.js";var aG="3.0.71",eG=J(()=>W(G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}))),yG=hG({errorSchema:eG,errorToMessage:(Q)=>Q.error.message}),oG=J(()=>W(G.object({type:G.literal("message"),id:G.string().nullish(),model:G.string().nullish(),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string(),citations:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])).optional()}),G.object({type:G.literal("thinking"),thinking:G.string(),signature:G.string()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])),stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish(),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}))),tG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("message_start"),message:G.object({id:G.string().nullish(),model:G.string().nullish(),role:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish()}),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()})])).nullish(),stop_reason:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string()}).nullish()})}),G.object({type:G.literal("content_block_start"),index:G.number(),content_block:G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string()}),G.object({type:G.literal("thinking"),thinking:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).optional(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string().nullish()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])}),G.object({type:G.literal("content_block_delta"),index:G.number(),delta:G.discriminatedUnion("type",[G.object({type:G.literal("input_json_delta"),partial_json:G.string()}),G.object({type:G.literal("text_delta"),text:G.string()}),G.object({type:G.literal("thinking_delta"),thinking:G.string()}),G.object({type:G.literal("signature_delta"),signature:G.string()}),G.object({type:G.literal("compaction_delta"),content:G.string().nullish()}),G.object({type:G.literal("citations_delta"),citation:G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])})])}),G.object({type:G.literal("content_block_stop"),index:G.number()}),G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}),G.object({type:G.literal("message_delta"),delta:G.object({stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish()}),usage:G.looseObject({input_tokens:G.number().nullish(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}),G.object({type:G.literal("message_stop")}),G.object({type:G.literal("ping")})]))),GQ=J(()=>W(G.object({signature:G.string().optional(),redactedData:G.string().optional()}))),FG=G.object({citations:G.object({enabled:G.boolean()}).optional(),title:G.string().optional(),context:G.string().optional()}),xG=G.object({sendReasoning:G.boolean().optional(),structuredOutputMode:G.enum(["outputFormat","jsonTool","auto"]).optional(),thinking:G.discriminatedUnion("type",[G.object({type:G.literal("adaptive"),display:G.enum(["omitted","summarized"]).optional()}),G.object({type:G.literal("enabled"),budgetTokens:G.number().optional()}),G.object({type:G.literal("disabled")})]).optional(),disableParallelToolUse:G.boolean().optional(),cacheControl:G.object({type:G.literal("ephemeral"),ttl:G.union([G.literal("5m"),G.literal("1h")]).optional()}).optional(),metadata:G.object({userId:G.string().optional()}).optional(),mcpServers:G.array(G.object({type:G.literal("url"),name:G.string(),url:G.string(),authorizationToken:G.string().nullish(),toolConfiguration:G.object({enabled:G.boolean().nullish(),allowedTools:G.array(G.string()).nullish()}).nullish()})).optional(),container:G.object({id:G.string().optional(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skillId:G.string(),version:G.string().optional()})).optional()}).optional(),toolStreaming:G.boolean().optional(),effort:G.enum(["low","medium","high","xhigh","max"]).optional(),taskBudget:G.object({type:G.literal("tokens"),total:G.number().int().min(20000),remaining:G.number().int().min(0).optional()}).optional(),speed:G.enum(["fast","standard"]).optional(),inferenceGeo:G.enum(["us","global"]).optional(),anthropicBeta:G.array(G.string()).optional(),contextManagement:G.object({edits:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("clear_tool_uses_20250919"),trigger:G.discriminatedUnion("type",[G.object({type:G.literal("input_tokens"),value:G.number()}),G.object({type:G.literal("tool_uses"),value:G.number()})]).optional(),keep:G.object({type:G.literal("tool_uses"),value:G.number()}).optional(),clearAtLeast:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),clearToolInputs:G.boolean().optional(),excludeTools:G.array(G.string()).optional()}),G.object({type:G.literal("clear_thinking_20251015"),keep:G.union([G.literal("all"),G.object({type:G.literal("thinking_turns"),value:G.number()})]).optional()}),G.object({type:G.literal("compact_20260112"),trigger:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),pauseAfterCompaction:G.boolean().optional(),instructions:G.string().optional()})]))}).optional()}),PG=4;function QQ(Q){var H;let Z=Q==null?void 0:Q.anthropic;return(H=Z==null?void 0:Z.cacheControl)!=null?H:Z==null?void 0:Z.cache_control}var RG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(Q,H){let Z=QQ(Q);if(!Z)return;if(!H.canCache){this.warnings.push({type:"unsupported",feature:"cache_control on non-cacheable context",details:`cache_control cannot be set on ${H.type}. It will be ignored.`});return}if(this.breakpointCount++,this.breakpointCount>PG){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:`Maximum ${PG} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`});return}return Z}getWarnings(){return this.warnings}},XQ=J(()=>W(G.object({maxCharacters:G.number().optional()}))),YQ=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZQ=u({id:"anthropic.text_editor_20250728",inputSchema:YQ}),$Q=(Q={})=>{return ZQ(Q)},zQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),LQ=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),HQ=J(()=>W(G.object({query:G.string()}))),qQ=l({id:"anthropic.web_search_20260209",inputSchema:HQ,outputSchema:LQ,supportsDeferredResults:!0}),AQ=(Q={})=>{return qQ(Q)},KQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),uG=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),DQ=J(()=>W(G.object({query:G.string()}))),JQ=l({id:"anthropic.web_search_20250305",inputSchema:DQ,outputSchema:uG,supportsDeferredResults:!0}),WQ=(Q={})=>{return JQ(Q)},jQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),VQ=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),UQ=J(()=>W(G.object({url:G.string()}))),RQ=l({id:"anthropic.web_fetch_20260209",inputSchema:UQ,outputSchema:VQ,supportsDeferredResults:!0}),EQ=(Q={})=>{return RQ(Q)},SQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),cG=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),yQ=J(()=>W(G.object({url:G.string()}))),FQ=l({id:"anthropic.web_fetch_20250910",inputSchema:yQ,outputSchema:cG,supportsDeferredResults:!0}),xQ=(Q={})=>{return FQ(Q)};async function PQ({tools:Q,toolChoice:H,disableParallelToolUse:Z,cacheControlValidator:q,supportsStructuredOutput:E,supportsStrictTools:T,defaultEagerInputStreaming:b=!1}){var F,h;Q=(Q==null?void 0:Q.length)?Q:void 0;let w=[],N=new Set,c=q||new RG;if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};let R=[];for(let S of Q)switch(S.type){case"function":{let B=c.getCacheControl(S.providerOptions,{type:"tool definition",canCache:!0}),g=(F=S.providerOptions)==null?void 0:F.anthropic,m=(h=g==null?void 0:g.eagerInputStreaming)!=null?h:b,O=g==null?void 0:g.deferLoading,e=g==null?void 0:g.allowedCallers;if(!T&&S.strict!=null)w.push({type:"unsupported",feature:"strict",details:`Tool '${S.name}' has strict: ${S.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`});if(R.push({name:S.name,description:S.description,input_schema:S.inputSchema,cache_control:B,...m?{eager_input_streaming:!0}:{},...T===!0&&S.strict!=null?{strict:S.strict}:{},...O!=null?{defer_loading:O}:{},...e!=null?{allowed_callers:e}:{},...S.inputExamples!=null?{input_examples:S.inputExamples.map((C)=>C.input)}:{}}),E===!0)N.add("structured-outputs-2025-11-13");if(S.inputExamples!=null||e!=null)N.add("advanced-tool-use-2025-11-20");break}case"provider":{switch(S.id){case"anthropic.code_execution_20250522":{N.add("code-execution-2025-05-22"),R.push({type:"code_execution_20250522",name:"code_execution",cache_control:void 0});break}case"anthropic.code_execution_20250825":{N.add("code-execution-2025-08-25"),R.push({type:"code_execution_20250825",name:"code_execution"});break}case"anthropic.code_execution_20260120":{R.push({type:"code_execution_20260120",name:"code_execution"});break}case"anthropic.computer_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"computer",type:"computer_20250124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.computer_20251124":{N.add("computer-use-2025-11-24"),R.push({name:"computer",type:"computer_20251124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,enable_zoom:S.args.enableZoom,cache_control:void 0});break}case"anthropic.computer_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"computer",type:"computer_20241022",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.text_editor_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_editor",type:"text_editor_20250124",cache_control:void 0});break}case"anthropic.text_editor_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"str_replace_editor",type:"text_editor_20241022",cache_control:void 0});break}case"anthropic.text_editor_20250429":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429",cache_control:void 0});break}case"anthropic.text_editor_20250728":{let B=await GG({value:S.args,schema:XQ});R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:B.maxCharacters,cache_control:void 0});break}case"anthropic.bash_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"bash",type:"bash_20250124",cache_control:void 0});break}case"anthropic.bash_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"bash",type:"bash_20241022",cache_control:void 0});break}case"anthropic.memory_20250818":{N.add("context-management-2025-06-27"),R.push({name:"memory",type:"memory_20250818"});break}case"anthropic.web_fetch_20250910":{N.add("web-fetch-2025-09-10");let B=await GG({value:S.args,schema:SQ});R.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:jQ});R.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_search_20250305":{let B=await GG({value:S.args,schema:KQ});R.push({type:"web_search_20250305",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:zQ});R.push({type:"web_search_20260209",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.tool_search_regex_20251119":{R.push({type:"tool_search_tool_regex_20251119",name:"tool_search_tool_regex"});break}case"anthropic.tool_search_bm25_20251119":{R.push({type:"tool_search_tool_bm25_20251119",name:"tool_search_tool_bm25"});break}default:{w.push({type:"unsupported",feature:`provider-defined tool ${S.id}`});break}}break}default:{w.push({type:"unsupported",feature:`tool ${S}`});break}}if(H==null)return{tools:R,toolChoice:Z?{type:"auto",disable_parallel_tool_use:Z}:void 0,toolWarnings:w,betas:N};let a=H.type;switch(a){case"auto":return{tools:R,toolChoice:{type:"auto",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"required":return{tools:R,toolChoice:{type:"any",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};case"tool":return{tools:R,toolChoice:{type:"tool",name:H.toolName,disable_parallel_tool_use:Z},toolWarnings:w,betas:N};default:throw new HG({functionality:`tool choice type: ${a}`})}}function fG({usage:Q,rawUsage:H}){var Z,q;let E=(Z=Q.cache_creation_input_tokens)!=null?Z:0,T=(q=Q.cache_read_input_tokens)!=null?q:0,b,F;if(Q.iterations&&Q.iterations.length>0){let h=Q.iterations.reduce((w,N)=>({input:w.input+N.input_tokens,output:w.output+N.output_tokens}),{input:0,output:0});b=h.input,F=h.output}else b=Q.input_tokens,F=Q.output_tokens;return{inputTokens:{total:b+E+T,noCache:b,cacheRead:T,cacheWrite:E},outputTokens:{total:F,text:void 0,reasoning:void 0},raw:H!=null?H:Q}}var iG=J(()=>W(G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}))),fQ=J(()=>W(G.object({code:G.string()}))),BQ=l({id:"anthropic.code_execution_20250522",inputSchema:fQ,outputSchema:iG}),IQ=(Q={})=>{return BQ(Q)},lG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),wQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),NQ=l({id:"anthropic.code_execution_20250825",inputSchema:wQ,outputSchema:lG,supportsDeferredResults:!0}),MQ=(Q={})=>{return NQ(Q)},sG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),CQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),bQ=l({id:"anthropic.code_execution_20260120",inputSchema:CQ,outputSchema:sG,supportsDeferredResults:!0}),TQ=(Q={})=>{return bQ(Q)},pG=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),OQ=J(()=>W(G.object({pattern:G.string(),limit:G.number().optional()}))),kQ=l({id:"anthropic.tool_search_regex_20251119",inputSchema:OQ,outputSchema:pG,supportsDeferredResults:!0}),vQ=(Q={})=>{return kQ(Q)};function _Q(Q){if(typeof Q==="string")return new TextDecoder().decode(TG(Q));if(Q instanceof Uint8Array)return new TextDecoder().decode(Q);if(Q instanceof URL)throw new HG({functionality:"URL-based text documents are not supported for citations"});throw new HG({functionality:`unsupported data type for text documents: ${typeof Q}`})}function KG(Q){return Q instanceof URL||hQ(Q)}function hQ(Q){return typeof Q==="string"&&/^https?:\/\//i.test(Q)}function DG(Q){return Q instanceof URL?Q.toString():Q}async function gQ({prompt:Q,sendReasoning:H,warnings:Z,cacheControlValidator:q,toolNameMapping:E}){var T,b,F,h,w,N,c,R,a,S,B,g,m,O,e,C,s,QG,YG;let Y=new Set,j=mQ(Q),M=q||new RG,p=void 0,XG=[];async function zG(v){var k,V;let ZG=await LG({provider:"anthropic",providerOptions:v,schema:FG});return(V=(k=ZG==null?void 0:ZG.citations)==null?void 0:k.enabled)!=null?V:!1}async function L(v){let k=await LG({provider:"anthropic",providerOptions:v,schema:FG});return{title:k==null?void 0:k.title,context:k==null?void 0:k.context}}for(let v=0;v<j.length;v++){let k=j[v],V=v===j.length-1,ZG=k.type;switch(ZG){case"system":{if(p!=null)throw new HG({functionality:"Multiple system messages that are separated by user/assistant messages"});p=k.messages.map(({content:I,providerOptions:o})=>({type:"text",text:I,cache_control:M.getCacheControl(o,{type:"system message",canCache:!0})}));break}case"user":{let I=[];for(let o of k.messages){let{role:t,content:r}=o;switch(t){case"user":{for(let i=0;i<r.length;i++){let x=r[i],n=i===r.length-1,z=(T=M.getCacheControl(x.providerOptions,{type:"user message part",canCache:!0}))!=null?T:n?M.getCacheControl(o.providerOptions,{type:"user message",canCache:!0}):void 0;switch(x.type){case"text":{I.push({type:"text",text:x.text,cache_control:z});break}case"file":{if(x.mediaType.startsWith("image/"))I.push({type:"image",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:x.mediaType==="image/*"?"image/jpeg":x.mediaType,data:jG(x.data)},cache_control:z});else if(x.mediaType==="application/pdf"){Y.add("pdfs-2024-09-25");let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:"application/pdf",data:jG(x.data)},title:(b=P.title)!=null?b:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else if(x.mediaType==="text/plain"){let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"text",media_type:"text/plain",data:_Q(x.data)},title:(F=P.title)!=null?F:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else throw new HG({functionality:`media type: ${x.mediaType}`});break}}}break}case"tool":{for(let i=0;i<r.length;i++){let x=r[i];if(x.type==="tool-approval-response")continue;let n=i===r.length-1,z=(h=M.getCacheControl(x.providerOptions,{type:"tool result part",canCache:!0}))!=null?h:n?M.getCacheControl(o.providerOptions,{type:"tool result message",canCache:!0}):void 0,d=x.output,P;switch(d.type){case"content":P=d.value.map((U)=>{var D;switch(U.type){case"text":return{type:"text",text:U.text};case"image-data":return{type:"image",source:{type:"base64",media_type:U.mediaType,data:U.data}};case"image-url":return{type:"image",source:{type:"url",url:U.url}};case"file-url":return{type:"document",source:{type:"url",url:U.url}};case"file-data":{if(U.mediaType==="application/pdf")return Y.add("pdfs-2024-09-25"),{type:"document",source:{type:"base64",media_type:U.mediaType,data:U.data}};Z.push({type:"other",message:`unsupported tool content part type: ${U.type} with media type: ${U.mediaType}`});return}case"custom":{let A=(D=U.providerOptions)==null?void 0:D.anthropic;if((A==null?void 0:A.type)==="tool-reference")return{type:"tool_reference",tool_name:A.toolName};Z.push({type:"other",message:"unsupported custom tool content part"});return}default:{Z.push({type:"other",message:`unsupported tool content part type: ${U.type}`});return}}}).filter(kG);break;case"text":case"error-text":P=d.value;break;case"execution-denied":P=(w=d.reason)!=null?w:"Tool execution denied.";break;case"json":case"error-json":default:P=JSON.stringify(d.value);break}I.push({type:"tool_result",tool_use_id:x.toolCallId,content:P,is_error:d.type==="error-text"||d.type==="error-json"?!0:void 0,cache_control:z})}break}default:throw Error(`Unsupported role: ${t}`)}}XG.push({role:"user",content:I});break}case"assistant":{let I=[],o=new Set;for(let t=0;t<k.messages.length;t++){let r=k.messages[t],i=t===k.messages.length-1,{content:x}=r;for(let n=0;n<x.length;n++){let z=x[n],d=n===x.length-1,P=(N=M.getCacheControl(z.providerOptions,{type:"assistant message part",canCache:!0}))!=null?N:d?M.getCacheControl(r.providerOptions,{type:"assistant message",canCache:!0}):void 0;switch(z.type){case"text":{let U=(c=z.providerOptions)==null?void 0:c.anthropic;if((U==null?void 0:U.type)==="compaction")I.push({type:"compaction",content:z.text,cache_control:P});else I.push({type:"text",text:V&&i&&d?z.text.trim():z.text,cache_control:P});break}case"reasoning":{if(H){let U=await LG({provider:"anthropic",providerOptions:z.providerOptions,schema:GQ});if(U!=null)if(U.signature!=null)M.getCacheControl(z.providerOptions,{type:"thinking block",canCache:!1}),I.push({type:"thinking",thinking:z.text,signature:U.signature});else if(U.redactedData!=null)M.getCacheControl(z.providerOptions,{type:"redacted thinking block",canCache:!1}),I.push({type:"redacted_thinking",data:U.redactedData});else Z.push({type:"other",message:"unsupported reasoning metadata"});else Z.push({type:"other",message:"unsupported reasoning metadata"})}else Z.push({type:"other",message:"sending reasoning content is disabled for this model"});break}case"tool-call":{if(z.providerExecuted){let A=E.toProviderToolName(z.toolName);if(((a=(R=z.providerOptions)==null?void 0:R.anthropic)==null?void 0:a.type)==="mcp-tool-use"){o.add(z.toolCallId);let X=(B=(S=z.providerOptions)==null?void 0:S.anthropic)==null?void 0:B.serverName;if(X==null||typeof X!=="string"){Z.push({type:"other",message:"mcp tool use server name is required and must be a string"});break}I.push({type:"mcp_tool_use",id:z.toolCallId,name:z.toolName,input:z.input,server_name:X,cache_control:P})}else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&typeof z.input.type==="string"&&(z.input.type==="bash_code_execution"||z.input.type==="text_editor_code_execution"))I.push({type:"server_tool_use",id:z.toolCallId,name:z.input.type,input:z.input,cache_control:P});else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&z.input.type==="programmatic-tool-call"){let{type:X,...f}=z.input;I.push({type:"server_tool_use",id:z.toolCallId,name:"code_execution",input:f,cache_control:P})}else if(A==="code_execution"||A==="web_fetch"||A==="web_search")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else if(A==="tool_search_tool_regex"||A==="tool_search_tool_bm25")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else Z.push({type:"other",message:`provider executed tool call for tool ${z.toolName} is not supported`});break}let U=(g=z.providerOptions)==null?void 0:g.anthropic,D=(U==null?void 0:U.caller)?(U.caller.type==="code_execution_20250825"||U.caller.type==="code_execution_20260120")&&U.caller.toolId?{type:U.caller.type,tool_id:U.caller.toolId}:U.caller.type==="direct"?{type:"direct"}:void 0:void 0;I.push({type:"tool_use",id:z.toolCallId,name:z.toolName,input:z.input,...D&&{caller:D},cache_control:P});break}case"tool-result":{let U=E.toProviderToolName(z.toolName);if(o.has(z.toolCallId)){let D=z.output;if(D.type!=="json"&&D.type!=="error-json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}I.push({type:"mcp_tool_result",tool_use_id:z.toolCallId,is_error:D.type==="error-json",content:D.value,cache_control:P})}else if(U==="code_execution"){let D=z.output;if(D.type==="error-text"||D.type==="error-json"){let A={};try{if(typeof D.value==="string")A=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)A=D.value}catch($){}if(A.type==="code_execution_tool_result_error")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:"code_execution_tool_result_error",error_code:(m=A.errorCode)!=null?m:"unknown"},cache_control:P});else I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:{type:"bash_code_execution_tool_result_error",error_code:(O=A.errorCode)!=null?O:"unknown"}});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}if(D.value==null||typeof D.value!=="object"||!("type"in D.value)||typeof D.value.type!=="string"){Z.push({type:"other",message:`provider executed tool result output value is not a valid code execution result for tool ${z.toolName}`});break}if(D.value.type==="code_execution_result"){let A=await GG({value:D.value,schema:iG});I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(e=A.content)!=null?e:[]},cache_control:P})}else if(D.value.type==="encrypted_code_execution_result"){let A=await GG({value:D.value,schema:sG});if(A.type==="encrypted_code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,encrypted_stdout:A.encrypted_stdout,stderr:A.stderr,return_code:A.return_code,content:(C=A.content)!=null?C:[]},cache_control:P})}else{let A=await GG({value:D.value,schema:lG});if(A.type==="code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(s=A.content)!=null?s:[]},cache_control:P});else if(A.type==="bash_code_execution_result"||A.type==="bash_code_execution_tool_result_error")I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A});else I.push({type:"text_editor_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A})}break}if(U==="web_fetch"){let D=z.output;if(D.type==="error-json"){let $={};try{if(typeof D.value==="string")$=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)$=D.value}catch(X){let f=(QG=D.value)==null?void 0:QG.errorCode;$={errorCode:typeof f==="string"?f:"unavailable"}}I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_tool_result_error",error_code:(YG=$.errorCode)!=null?YG:"unavailable"},cache_control:P});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:cG});I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_result",url:A.url,retrieved_at:A.retrievedAt,content:{type:"document",title:A.content.title,citations:A.content.citations,source:{type:A.content.source.type,media_type:A.content.source.mediaType,data:A.content.source.data}}},cache_control:P});break}if(U==="web_search"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:uG});I.push({type:"web_search_tool_result",tool_use_id:z.toolCallId,content:A.map(($)=>({url:$.url,title:$.title,page_age:$.pageAge,encrypted_content:$.encryptedContent,type:$.type})),cache_control:P});break}if(U==="tool_search_tool_regex"||U==="tool_search_tool_bm25"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let $=(await GG({value:D.value,schema:pG})).map((X)=>({type:"tool_reference",tool_name:X.toolName}));I.push({type:"tool_search_tool_result",tool_use_id:z.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:$},cache_control:P});break}Z.push({type:"other",message:`provider executed tool result for tool ${z.toolName} is not supported`});break}}}}XG.push({role:"assistant",content:I});break}default:throw Error(`content type: ${ZG}`)}}return{prompt:{system:p,messages:XG},betas:Y}}function mQ(Q){let H=[],Z=void 0;for(let q of Q){let{role:E}=q;switch(E){case"system":{if((Z==null?void 0:Z.type)!=="system")Z={type:"system",messages:[]},H.push(Z);Z.messages.push(q);break}case"assistant":{if((Z==null?void 0:Z.type)!=="assistant")Z={type:"assistant",messages:[]},H.push(Z);Z.messages.push(q);break}case"user":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}case"tool":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}default:throw Error(`Unsupported role: ${E}`)}}return H}function JG({finishReason:Q,isJsonResponseFromTool:H}){switch(Q){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return H?"stop":"tool-calls";case"max_tokens":case"model_context_window_exceeded":return"length";case"compaction":return"other";default:return"other"}}function BG(Q,H,Z){var q;if(Q.type==="web_search_result_location")return{type:"source",sourceType:"url",id:Z(),url:Q.url,title:Q.title,providerMetadata:{anthropic:{citedText:Q.cited_text,encryptedIndex:Q.encrypted_index}}};if(Q.type!=="page_location"&&Q.type!=="char_location")return;let E=H[Q.document_index];if(!E)return;return{type:"source",sourceType:"document",id:Z(),mediaType:E.mediaType,title:(q=Q.document_title)!=null?q:E.title,filename:E.filename,providerMetadata:{anthropic:Q.type==="page_location"?{citedText:Q.cited_text,startPageNumber:Q.start_page_number,endPageNumber:Q.end_page_number}:{citedText:Q.cited_text,startCharIndex:Q.start_char_index,endCharIndex:Q.end_char_index}}}}var dQ=class{constructor(Q,H){this.specificationVersion="v3";var Z;this.modelId=Q,this.config=H,this.generateId=(Z=H.generateId)!=null?Z:AG}supportsUrl(Q){return Q.protocol==="https:"}get provider(){return this.config.provider}get providerOptionsName(){let Q=this.config.provider,H=Q.indexOf(".");return H===-1?Q:Q.substring(0,H)}get supportedUrls(){var Q,H,Z;return(Z=(H=(Q=this.config).supportedUrls)==null?void 0:H.call(Q))!=null?Z:{}}async getArgs({userSuppliedBetas:Q,prompt:H,maxOutputTokens:Z,temperature:q,topP:E,topK:T,frequencyPenalty:b,presencePenalty:F,stopSequences:h,responseFormat:w,seed:N,tools:c,toolChoice:R,providerOptions:a,stream:S}){var B,g,m,O,e,C,s,QG,YG,Y;let j=[];if(b!=null)j.push({type:"unsupported",feature:"frequencyPenalty"});if(F!=null)j.push({type:"unsupported",feature:"presencePenalty"});if(N!=null)j.push({type:"unsupported",feature:"seed"});if(q!=null&&q>1)j.push({type:"unsupported",feature:"temperature",details:`${q} exceeds anthropic maximum of 1.0. clamped to 1.0`}),q=1;else if(q!=null&&q<0)j.push({type:"unsupported",feature:"temperature",details:`${q} is below anthropic minimum of 0. clamped to 0`}),q=0;if((w==null?void 0:w.type)==="json"){if(w.schema==null)j.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."})}let M=this.providerOptionsName,p=await LG({provider:"anthropic",providerOptions:a,schema:xG}),XG=M!=="anthropic"?await LG({provider:M,providerOptions:a,schema:xG}):null,zG=XG!=null,L=Object.assign({},p!=null?p:{},XG!=null?XG:{}),{maxOutputTokens:v,supportsStructuredOutput:k,rejectsSamplingParameters:V,isKnownModel:ZG}=uQ(this.modelId);if(V){if(q!=null)j.push({type:"unsupported",feature:"temperature",details:`temperature is not supported by ${this.modelId} and will be ignored`}),q=void 0;if(T!=null)j.push({type:"unsupported",feature:"topK",details:`topK is not supported by ${this.modelId} and will be ignored`}),T=void 0;if(E!=null)j.push({type:"unsupported",feature:"topP",details:`topP is not supported by ${this.modelId} and will be ignored`}),E=void 0}let I=ZG||this.modelId.startsWith("claude-"),o=((B=this.config.supportsNativeStructuredOutput)!=null?B:!0)&&k,t=((g=this.config.supportsStrictTools)!=null?g:!0)&&k,r=(m=L==null?void 0:L.structuredOutputMode)!=null?m:"auto",i=r==="outputFormat"||r==="auto"&&o,x=(w==null?void 0:w.type)==="json"&&w.schema!=null&&!i?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:w.schema}:void 0,n=L==null?void 0:L.contextManagement,z=new RG,d=bG({tools:c,providerToolNames:{"anthropic.code_execution_20250522":"code_execution","anthropic.code_execution_20250825":"code_execution","anthropic.code_execution_20260120":"code_execution","anthropic.computer_20241022":"computer","anthropic.computer_20250124":"computer","anthropic.text_editor_20241022":"str_replace_editor","anthropic.text_editor_20250124":"str_replace_editor","anthropic.text_editor_20250429":"str_replace_based_edit_tool","anthropic.text_editor_20250728":"str_replace_based_edit_tool","anthropic.bash_20241022":"bash","anthropic.bash_20250124":"bash","anthropic.memory_20250818":"memory","anthropic.web_search_20250305":"web_search","anthropic.web_search_20260209":"web_search","anthropic.web_fetch_20250910":"web_fetch","anthropic.web_fetch_20260209":"web_fetch","anthropic.tool_search_regex_20251119":"tool_search_tool_regex","anthropic.tool_search_bm25_20251119":"tool_search_tool_bm25"}}),{prompt:P,betas:U}=await gQ({prompt:H,sendReasoning:(O=L==null?void 0:L.sendReasoning)!=null?O:!0,warnings:j,cacheControlValidator:z,toolNameMapping:d}),D=(e=L==null?void 0:L.thinking)==null?void 0:e.type,A=D==="enabled"||D==="adaptive",$=D==="enabled"?(C=L==null?void 0:L.thinking)==null?void 0:C.budgetTokens:void 0,X=D==="adaptive"?(s=L==null?void 0:L.thinking)==null?void 0:s.display:void 0,f=Z!=null?Z:v,K={model:this.modelId,max_tokens:f,temperature:q,top_k:T,top_p:E,stop_sequences:h,...A&&{thinking:{type:D,...$!=null&&{budget_tokens:$},...X!=null&&{display:X}}},...((L==null?void 0:L.effort)||(L==null?void 0:L.taskBudget)||i&&(w==null?void 0:w.type)==="json"&&w.schema!=null)&&{output_config:{...(L==null?void 0:L.effort)&&{effort:L.effort},...(L==null?void 0:L.taskBudget)&&{task_budget:{type:L.taskBudget.type,total:L.taskBudget.total,...L.taskBudget.remaining!=null&&{remaining:L.taskBudget.remaining}}},...i&&(w==null?void 0:w.type)==="json"&&w.schema!=null&&{format:{type:"json_schema",schema:w.schema}}}},...(L==null?void 0:L.speed)&&{speed:L.speed},...(L==null?void 0:L.inferenceGeo)&&{inference_geo:L.inferenceGeo},...(L==null?void 0:L.cacheControl)&&{cache_control:L.cacheControl},...((QG=L==null?void 0:L.metadata)==null?void 0:QG.userId)!=null&&{metadata:{user_id:L.metadata.userId}},...(L==null?void 0:L.mcpServers)&&L.mcpServers.length>0&&{mcp_servers:L.mcpServers.map((y)=>({type:y.type,name:y.name,url:y.url,authorization_token:y.authorizationToken,tool_configuration:y.toolConfiguration?{allowed_tools:y.toolConfiguration.allowedTools,enabled:y.toolConfiguration.enabled}:void 0}))},...(L==null?void 0:L.container)&&{container:L.container.skills&&L.container.skills.length>0?{id:L.container.id,skills:L.container.skills.map((y)=>({type:y.type,skill_id:y.skillId,version:y.version}))}:L.container.id},system:P.system,messages:P.messages,...n&&{context_management:{edits:n.edits.map((y)=>{let SG=y.type;switch(SG){case"clear_tool_uses_20250919":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.keep!==void 0&&{keep:y.keep},...y.clearAtLeast!==void 0&&{clear_at_least:y.clearAtLeast},...y.clearToolInputs!==void 0&&{clear_tool_inputs:y.clearToolInputs},...y.excludeTools!==void 0&&{exclude_tools:y.excludeTools}};case"clear_thinking_20251015":return{type:y.type,...y.keep!==void 0&&{keep:y.keep}};case"compact_20260112":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.pauseAfterCompaction!==void 0&&{pause_after_compaction:y.pauseAfterCompaction},...y.instructions!==void 0&&{instructions:y.instructions}};default:j.push({type:"other",message:`Unknown context management strategy: ${SG}`});return}}).filter((y)=>y!==void 0)}}};if(A){if(D==="enabled"&&$==null)j.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),K.thinking={type:"enabled",budget_tokens:1024},$=1024;if(K.temperature!=null)K.temperature=void 0,j.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"});if(T!=null)K.top_k=void 0,j.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"});if(E!=null)K.top_p=void 0,j.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"});K.max_tokens=f+($!=null?$:0)}else if(I&&E!=null&&q!=null)j.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),K.top_p=void 0;if(ZG&&K.max_tokens>v){if(Z!=null)j.push({type:"unsupported",feature:"maxOutputTokens",details:`${K.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${v} max output tokens. The max output tokens have been limited to ${v}.`});K.max_tokens=v}if((L==null?void 0:L.mcpServers)&&L.mcpServers.length>0)U.add("mcp-client-2025-04-04");if(n){if(U.add("context-management-2025-06-27"),n.edits.some((y)=>y.type==="compact_20260112"))U.add("compact-2026-01-12")}if((L==null?void 0:L.container)&&L.container.skills&&L.container.skills.length>0){if(U.add("code-execution-2025-08-25"),U.add("skills-2025-10-02"),U.add("files-api-2025-04-14"),!(c==null?void 0:c.some((y)=>y.type==="provider"&&(y.id==="anthropic.code_execution_20250825"||y.id==="anthropic.code_execution_20260120"))))j.push({type:"other",message:"code execution tool is required when using skills"})}if(L==null?void 0:L.effort)U.add("effort-2025-11-24");if(L==null?void 0:L.taskBudget)U.add("task-budgets-2026-03-13");if((L==null?void 0:L.speed)==="fast")U.add("fast-mode-2026-02-01");let _=S&&((YG=L==null?void 0:L.toolStreaming)!=null?YG:!0),{tools:$G,toolChoice:EG,toolWarnings:qG,betas:nG}=await PQ(x!=null?{tools:[...c!=null?c:[],x],toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:z,supportsStructuredOutput:!1,supportsStrictTools:t,defaultEagerInputStreaming:_}:{tools:c!=null?c:[],toolChoice:R,disableParallelToolUse:L==null?void 0:L.disableParallelToolUse,cacheControlValidator:z,supportsStructuredOutput:o,supportsStrictTools:t,defaultEagerInputStreaming:_}),rG=z.getWarnings();return{args:{...K,tools:$G,tool_choice:EG,stream:S===!0?!0:void 0},warnings:[...j,...qG,...rG],betas:new Set([...U,...nG,...Q,...(Y=L==null?void 0:L.anthropicBeta)!=null?Y:[]]),usesJsonResponseTool:x!=null,toolNameMapping:d,providerOptionsName:M,usedCustomProviderKey:zG}}async getHeaders({betas:Q,headers:H}){return CG(await UG(this.config.headers),H,Q.size>0?{"anthropic-beta":Array.from(Q).join(",")}:{})}async getBetasFromHeaders(Q){var H,Z;let E=(H=(await UG(this.config.headers))["anthropic-beta"])!=null?H:"",T=(Z=Q==null?void 0:Q["anthropic-beta"])!=null?Z:"";return new Set([...E.toLowerCase().split(","),...T.toLowerCase().split(",")].map((b)=>b.trim()).filter((b)=>b!==""))}buildRequestUrl(Q){var H,Z,q;return(q=(Z=(H=this.config).buildRequestUrl)==null?void 0:Z.call(H,this.config.baseURL,Q))!=null?q:`${this.config.baseURL}/messages`}transformRequestBody(Q,H){var Z,q,E;return(E=(q=(Z=this.config).transformRequestBody)==null?void 0:q.call(Z,Q,H))!=null?E:Q}extractCitationDocuments(Q){let H=(Z)=>{var q,E;if(Z.type!=="file")return!1;if(Z.mediaType!=="application/pdf"&&Z.mediaType!=="text/plain")return!1;let T=(q=Z.providerOptions)==null?void 0:q.anthropic,b=T==null?void 0:T.citations;return(E=b==null?void 0:b.enabled)!=null?E:!1};return Q.filter((Z)=>Z.role==="user").flatMap((Z)=>Z.content).filter(H).map((Z)=>{var q;let E=Z;return{title:(q=E.filename)!=null?q:"Untitled Document",filename:E.filename,mediaType:E.mediaType}})}async doGenerate(Q){var H,Z,q,E,T,b,F;let{args:h,warnings:w,betas:N,usesJsonResponseTool:c,toolNameMapping:R,providerOptionsName:a,usedCustomProviderKey:S}=await this.getArgs({...Q,stream:!1,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),B=[...this.extractCitationDocuments(Q.prompt)],g=IG(h.tools),{responseHeaders:m,value:O,rawValue:e}=await VG({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:N,headers:Q.headers}),body:this.transformRequestBody(h,N),failedResponseHandler:yG,successfulResponseHandler:mG(oG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),C=[],s={},QG={},YG=!1;for(let Y of O.content)switch(Y.type){case"text":{if(!c){if(C.push({type:"text",text:Y.text}),Y.citations)for(let j of Y.citations){let M=BG(j,B,this.generateId);if(M)C.push(M)}}break}case"thinking":{C.push({type:"reasoning",text:Y.thinking,providerMetadata:{anthropic:{signature:Y.signature}}});break}case"redacted_thinking":{C.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:Y.data}}});break}case"compaction":{C.push({type:"text",text:Y.content,providerMetadata:{anthropic:{type:"compaction"}}});break}case"tool_use":{if(c&&Y.name==="json")YG=!0,C.push({type:"text",text:JSON.stringify(Y.input)});else{let M=Y.caller,p=M?{type:M.type,toolId:"tool_id"in M?M.tool_id:void 0}:void 0;C.push({type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),...p&&{providerMetadata:{anthropic:{caller:p}}}})}break}case"server_tool_use":{if(Y.name==="text_editor_code_execution"||Y.name==="bash_code_execution")C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName("code_execution"),input:JSON.stringify({type:Y.name,...Y.input}),providerExecuted:!0});else if(Y.name==="web_search"||Y.name==="code_execution"||Y.name==="web_fetch"){let j=Y.name==="code_execution"&&Y.input!=null&&typeof Y.input==="object"&&"code"in Y.input&&!("type"in Y.input)?{type:"programmatic-tool-call",...Y.input}:Y.input;C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(j),providerExecuted:!0,...g&&Y.name==="code_execution"?{dynamic:!0}:{}})}else if(Y.name==="tool_search_tool_regex"||Y.name==="tool_search_tool_bm25")QG[Y.id]=Y.name,C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(Y.input),providerExecuted:!0});break}case"mcp_tool_use":{s[Y.id]={type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:Y.server_name}}},C.push(s[Y.id]);break}case"mcp_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:s[Y.tool_use_id].toolName,isError:Y.is_error,result:Y.content,dynamic:!0,providerMetadata:s[Y.tool_use_id].providerMetadata});break}case"web_fetch_tool_result":{if(Y.content.type==="web_fetch_result")B.push({title:(H=Y.content.content.title)!=null?H:Y.content.url,mediaType:Y.content.content.source.media_type}),C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:Y.content.url,retrievedAt:Y.content.retrieved_at,content:{type:Y.content.content.type,title:Y.content.content.title,citations:Y.content.content.citations,source:{type:Y.content.content.source.type,mediaType:Y.content.content.source.media_type,data:Y.content.content.source.data}}}});else if(Y.content.type==="web_fetch_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:Y.content.error_code}});break}case"web_search_tool_result":{if(Array.isArray(Y.content)){C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),result:Y.content.map((j)=>{var M;return{url:j.url,title:j.title,pageAge:(M=j.page_age)!=null?M:null,encryptedContent:j.encrypted_content,type:j.type}})});for(let j of Y.content)C.push({type:"source",sourceType:"url",id:this.generateId(),url:j.url,title:j.title,providerMetadata:{anthropic:{pageAge:(Z=j.page_age)!=null?Z:null}}})}else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:Y.content.error_code}});break}case"code_execution_tool_result":{if(Y.content.type==="code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,stdout:Y.content.stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(q=Y.content.content)!=null?q:[]}});else if(Y.content.type==="encrypted_code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,encrypted_stdout:Y.content.encrypted_stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(E=Y.content.content)!=null?E:[]}});else if(Y.content.type==="code_execution_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:Y.content.error_code}});break}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:Y.content});break}case"tool_search_tool_result":{let j=QG[Y.tool_use_id];if(j==null){let M=R.toCustomToolName("tool_search_tool_bm25"),p=R.toCustomToolName("tool_search_tool_regex");if(M!=="tool_search_tool_bm25")j="tool_search_tool_bm25";else if(p!=="tool_search_tool_regex")j="tool_search_tool_regex";else j="tool_search_tool_regex"}if(Y.content.type==="tool_search_tool_search_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),result:Y.content.tool_references.map((M)=>({type:M.type,toolName:M.tool_name}))});else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:Y.content.error_code}});break}}return{content:C,finishReason:{unified:JG({finishReason:O.stop_reason,isJsonResponseFromTool:YG}),raw:(T=O.stop_reason)!=null?T:void 0},usage:fG({usage:O.usage}),request:{body:h},response:{id:(b=O.id)!=null?b:void 0,modelId:(F=O.model)!=null?F:void 0,headers:m,body:e},warnings:w,providerMetadata:(()=>{var Y,j,M,p,XG;let zG={usage:O.usage,cacheCreationInputTokens:(Y=O.usage.cache_creation_input_tokens)!=null?Y:null,stopSequence:(j=O.stop_sequence)!=null?j:null,iterations:O.usage.iterations?O.usage.iterations.map((v)=>({type:v.type,inputTokens:v.input_tokens,outputTokens:v.output_tokens})):null,container:O.container?{expiresAt:O.container.expires_at,id:O.container.id,skills:(p=(M=O.container.skills)==null?void 0:M.map((v)=>({type:v.type,skillId:v.skill_id,version:v.version})))!=null?p:null}:null,contextManagement:(XG=wG(O.context_management))!=null?XG:null},L={anthropic:zG};if(S&&a!=="anthropic")L[a]=zG;return L})()}}async doStream(Q){var H,Z;let{args:q,warnings:E,betas:T,usesJsonResponseTool:b,toolNameMapping:F,providerOptionsName:h,usedCustomProviderKey:w}=await this.getArgs({...Q,stream:!0,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),N=[...this.extractCitationDocuments(Q.prompt)],c=IG(q.tools),R=this.buildRequestUrl(!0),{responseHeaders:a,value:S}=await VG({url:R,headers:await this.getHeaders({betas:T,headers:Q.headers}),body:this.transformRequestBody(q,T),failedResponseHandler:yG,successfulResponseHandler:gG(tG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),B={unified:"other",raw:void 0},g={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},m={},O={},e={},C=null,s=void 0,QG=null,YG=null,Y=null,j=!1,M=void 0,p=this.generateId,XG=S.pipeThrough(new TransformStream({start(k){k.enqueue({type:"stream-start",warnings:E})},transform(k,V){var ZG,I,o,t,r,i,x,n,z,d,P,U,D,A;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:k.rawValue});if(!k.success){V.enqueue({type:"error",error:k.error});return}let $=k.value;switch($.type){case"ping":return;case"content_block_start":{let X=$.content_block,f=X.type;switch(M=f,f){case"text":{if(b)return;m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});return}case"thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index)});return}case"redacted_thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index),providerMetadata:{anthropic:{redactedData:X.data}}});return}case"compaction":{m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index),providerMetadata:{anthropic:{type:"compaction"}}});return}case"tool_use":{if(b&&X.name==="json")j=!0,m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});else{let _=X.caller,$G=_?{type:_.type,toolId:"tool_id"in _?_.tool_id:void 0}:void 0,qG=X.input&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:qG,firstDelta:qG.length===0,...$G&&{caller:$G}},V.enqueue({type:"tool-input-start",id:X.id,toolName:X.name})}return}case"server_tool_use":{if(["web_fetch","web_search","code_execution","text_editor_code_execution","bash_code_execution"].includes(X.name)){let K=X.name==="text_editor_code_execution"||X.name==="bash_code_execution"?"code_execution":X.name,_=F.toCustomToolName(K),$G=X.input!=null&&typeof X.input==="object"&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:_,input:$G,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{},firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:_,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{}})}else if(X.name==="tool_search_tool_regex"||X.name==="tool_search_tool_bm25"){e[X.id]=X.name;let K=F.toCustomToolName(X.name);m[$.index]={type:"tool-call",toolCallId:X.id,toolName:K,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:K,providerExecuted:!0})}return}case"web_fetch_tool_result":{if(X.content.type==="web_fetch_result")N.push({title:(ZG=X.content.content.title)!=null?ZG:X.content.url,mediaType:X.content.content.source.media_type}),V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:X.content.url,retrievedAt:X.content.retrieved_at,content:{type:X.content.content.type,title:X.content.content.title,citations:X.content.content.citations,source:{type:X.content.content.source.type,mediaType:X.content.content.source.media_type,data:X.content.content.source.data}}}});else if(X.content.type==="web_fetch_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:X.content.error_code}});return}case"web_search_tool_result":{if(Array.isArray(X.content)){V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),result:X.content.map((K)=>{var _;return{url:K.url,title:K.title,pageAge:(_=K.page_age)!=null?_:null,encryptedContent:K.encrypted_content,type:K.type}})});for(let K of X.content)V.enqueue({type:"source",sourceType:"url",id:p(),url:K.url,title:K.title,providerMetadata:{anthropic:{pageAge:(I=K.page_age)!=null?I:null}}})}else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:X.content.error_code}});return}case"code_execution_tool_result":{if(X.content.type==="code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,stdout:X.content.stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(o=X.content.content)!=null?o:[]}});else if(X.content.type==="encrypted_code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,encrypted_stdout:X.content.encrypted_stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(t=X.content.content)!=null?t:[]}});else if(X.content.type==="code_execution_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:X.content.error_code}});return}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:X.content});return}case"tool_search_tool_result":{let K=e[X.tool_use_id];if(K==null){let _=F.toCustomToolName("tool_search_tool_bm25"),$G=F.toCustomToolName("tool_search_tool_regex");if(_!=="tool_search_tool_bm25")K="tool_search_tool_bm25";else if($G!=="tool_search_tool_regex")K="tool_search_tool_regex";else K="tool_search_tool_regex"}if(X.content.type==="tool_search_tool_search_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),result:X.content.tool_references.map((_)=>({type:_.type,toolName:_.tool_name}))});else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:X.content.error_code}});return}case"mcp_tool_use":{O[X.id]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:JSON.stringify(X.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:X.server_name}}},V.enqueue(O[X.id]);return}case"mcp_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:O[X.tool_use_id].toolName,isError:X.is_error,result:X.content,dynamic:!0,providerMetadata:O[X.tool_use_id].providerMetadata});return}default:throw Error(`Unsupported content block type: ${f}`)}}case"content_block_stop":{if(m[$.index]!=null){let X=m[$.index];switch(X.type){case"text":{V.enqueue({type:"text-end",id:String($.index)});break}case"reasoning":{V.enqueue({type:"reasoning-end",id:String($.index)});break}case"tool-call":if(!(b&&X.toolName==="json")){V.enqueue({type:"tool-input-end",id:X.toolCallId});let K=X.input===""?"{}":X.input;if(X.providerToolName==="code_execution")try{let _=JSON.parse(K);if(_!=null&&typeof _==="object"&&"code"in _&&!("type"in _))K=JSON.stringify({type:"programmatic-tool-call",..._})}catch(_){}V.enqueue({type:"tool-call",toolCallId:X.toolCallId,toolName:X.toolName,input:K,providerExecuted:X.providerExecuted,...c&&X.providerToolName==="code_execution"?{dynamic:!0}:{},...X.caller&&{providerMetadata:{anthropic:{caller:X.caller}}}})}break}delete m[$.index]}M=void 0;return}case"content_block_delta":{let X=$.delta.type;switch(X){case"text_delta":{if(b)return;V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.text});return}case"thinking_delta":{V.enqueue({type:"reasoning-delta",id:String($.index),delta:$.delta.thinking});return}case"signature_delta":{if(M==="thinking")V.enqueue({type:"reasoning-delta",id:String($.index),delta:"",providerMetadata:{anthropic:{signature:$.delta.signature}}});return}case"compaction_delta":{if($.delta.content!=null)V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.content});return}case"input_json_delta":{let f=m[$.index],K=$.delta.partial_json;if(K.length===0)return;if(j){if((f==null?void 0:f.type)!=="text")return;V.enqueue({type:"text-delta",id:String($.index),delta:K})}else{if((f==null?void 0:f.type)!=="tool-call")return;if(f.firstDelta&&(f.providerToolName==="bash_code_execution"||f.providerToolName==="text_editor_code_execution"))K=`{"type": "${f.providerToolName}",${K.substring(1)}`;V.enqueue({type:"tool-input-delta",id:f.toolCallId,delta:K}),f.input+=K,f.firstDelta=!1}return}case"citations_delta":{let f=$.delta.citation,K=BG(f,N,p);if(K)V.enqueue(K);return}default:throw Error(`Unsupported delta type: ${X}`)}}case"message_start":{if(g.input_tokens=$.message.usage.input_tokens,g.cache_read_input_tokens=(r=$.message.usage.cache_read_input_tokens)!=null?r:0,g.cache_creation_input_tokens=(i=$.message.usage.cache_creation_input_tokens)!=null?i:0,s={...$.message.usage},QG=(x=$.message.usage.cache_creation_input_tokens)!=null?x:null,$.message.container!=null)Y={expiresAt:$.message.container.expires_at,id:$.message.container.id,skills:null};if($.message.stop_reason!=null)B={unified:JG({finishReason:$.message.stop_reason,isJsonResponseFromTool:j}),raw:$.message.stop_reason};if(V.enqueue({type:"response-metadata",id:(n=$.message.id)!=null?n:void 0,modelId:(z=$.message.model)!=null?z:void 0}),$.message.content!=null)for(let X=0;X<$.message.content.length;X++){let f=$.message.content[X];if(f.type==="tool_use"){let K=f.caller,_=K?{type:K.type,toolId:"tool_id"in K?K.tool_id:void 0}:void 0;V.enqueue({type:"tool-input-start",id:f.id,toolName:f.name});let $G=JSON.stringify((d=f.input)!=null?d:{});V.enqueue({type:"tool-input-delta",id:f.id,delta:$G}),V.enqueue({type:"tool-input-end",id:f.id}),V.enqueue({type:"tool-call",toolCallId:f.id,toolName:f.name,input:$G,..._&&{providerMetadata:{anthropic:{caller:_}}}})}}return}case"message_delta":{if($.usage.input_tokens!=null&&g.input_tokens!==$.usage.input_tokens)g.input_tokens=$.usage.input_tokens;if(g.output_tokens=$.usage.output_tokens,$.usage.cache_read_input_tokens!=null)g.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.cache_creation_input_tokens!=null)g.cache_creation_input_tokens=$.usage.cache_creation_input_tokens,QG=$.usage.cache_creation_input_tokens;if($.usage.iterations!=null)g.iterations=$.usage.iterations;if(B={unified:JG({finishReason:$.delta.stop_reason,isJsonResponseFromTool:j}),raw:(P=$.delta.stop_reason)!=null?P:void 0},YG=(U=$.delta.stop_sequence)!=null?U:null,Y=$.delta.container!=null?{expiresAt:$.delta.container.expires_at,id:$.delta.container.id,skills:(A=(D=$.delta.container.skills)==null?void 0:D.map((X)=>({type:X.type,skillId:X.skill_id,version:X.version})))!=null?A:null}:null,$.context_management)C=wG($.context_management);s={...s,...$.usage};return}case"message_stop":{let X={usage:s!=null?s:null,cacheCreationInputTokens:QG,stopSequence:YG,iterations:g.iterations?g.iterations.map((K)=>({type:K.type,inputTokens:K.input_tokens,outputTokens:K.output_tokens})):null,container:Y,contextManagement:C},f={anthropic:X};if(w&&h!=="anthropic")f[h]=X;V.enqueue({type:"finish",finishReason:B,usage:fG({usage:g,rawUsage:s}),providerMetadata:f});return}case"error":{V.enqueue({type:"error",error:$.error});return}default:throw Error(`Unsupported chunk type: ${$}`)}}})),[zG,L]=XG.tee(),v=zG.getReader();try{await v.read();let k=await v.read();if(((H=k.value)==null?void 0:H.type)==="raw")k=await v.read();if(((Z=k.value)==null?void 0:Z.type)==="error"){let V=k.value.error;throw new NG({message:V.message,url:R,requestBodyValues:q,statusCode:V.type==="overloaded_error"?529:500,responseHeaders:a,responseBody:JSON.stringify(V),isRetryable:V.type==="overloaded_error"})}}finally{v.cancel().catch(()=>{}),v.releaseLock()}return{stream:L,request:{body:q},response:{headers:a}}}};function uQ(Q){if(Q.includes("claude-opus-4-7"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!0,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-6")||Q.includes("claude-opus-4-6"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-5")||Q.includes("claude-opus-4-5")||Q.includes("claude-haiku-4-5"))return{maxOutputTokens:64000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-1"))return{maxOutputTokens:32000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-"))return{maxOutputTokens:64000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-"))return{maxOutputTokens:32000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-3-haiku"))return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!1}}function IG(Q){if(!Q)return!1;let H=!1,Z=!1;for(let q of Q){if("type"in q&&(q.type==="web_fetch_20260209"||q.type==="web_search_20260209")){H=!0;continue}if(q.name==="code_execution"){Z=!0;break}}return H&&!Z}function wG(Q){return Q?{appliedEdits:Q.applied_edits.map((H)=>{switch(H.type){case"clear_tool_uses_20250919":return{type:H.type,clearedToolUses:H.cleared_tool_uses,clearedInputTokens:H.cleared_input_tokens};case"clear_thinking_20251015":return{type:H.type,clearedThinkingTurns:H.cleared_thinking_turns,clearedInputTokens:H.cleared_input_tokens};case"compact_20260112":return{type:H.type}}}).filter((H)=>H!==void 0)}:null}var cQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),iQ=u({id:"anthropic.bash_20241022",inputSchema:cQ}),lQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),sQ=u({id:"anthropic.bash_20250124",inputSchema:lQ}),pQ=J(()=>W(G.object({action:G.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:G.array(G.number().int()).optional(),text:G.string().optional()}))),nQ=u({id:"anthropic.computer_20241022",inputSchema:pQ}),rQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),aQ=u({id:"anthropic.computer_20250124",inputSchema:rQ}),eQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot","zoom"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),region:G.tuple([G.number().int(),G.number().int(),G.number().int(),G.number().int()]).optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),oQ=u({id:"anthropic.computer_20251124",inputSchema:eQ}),tQ=J(()=>W(G.discriminatedUnion("command",[G.object({command:G.literal("view"),path:G.string(),view_range:G.tuple([G.number(),G.number()]).optional()}),G.object({command:G.literal("create"),path:G.string(),file_text:G.string()}),G.object({command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()}),G.object({command:G.literal("insert"),path:G.string(),insert_line:G.number(),insert_text:G.string()}),G.object({command:G.literal("delete"),path:G.string()}),G.object({command:G.literal("rename"),old_path:G.string(),new_path:G.string()})]))),GX=u({id:"anthropic.memory_20250818",inputSchema:tQ}),QX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),XX=u({id:"anthropic.text_editor_20241022",inputSchema:QX}),YX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZX=u({id:"anthropic.text_editor_20250124",inputSchema:YX}),$X=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),zX=u({id:"anthropic.text_editor_20250429",inputSchema:$X}),LX=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),HX=J(()=>W(G.object({query:G.string(),limit:G.number().optional()}))),qX=l({id:"anthropic.tool_search_bm25_20251119",inputSchema:HX,outputSchema:LX,supportsDeferredResults:!0}),AX=(Q={})=>{return qX(Q)},KX={bash_20241022:iQ,bash_20250124:sQ,codeExecution_20250522:IQ,codeExecution_20250825:MQ,codeExecution_20260120:TQ,computer_20241022:nQ,computer_20250124:aQ,computer_20251124:oQ,memory_20250818:GX,textEditor_20241022:XX,textEditor_20250124:ZX,textEditor_20250429:zX,textEditor_20250728:$Q,webFetch_20250910:xQ,webFetch_20260209:EQ,webSearch_20250305:WQ,webSearch_20260209:AQ,toolSearchRegex_20251119:vQ,toolSearchBm25_20251119:AX};function DX(Q={}){var H,Z;let q=(H=dG(_G({settingValue:Q.baseURL,environmentVariableName:"ANTHROPIC_BASE_URL"})))!=null?H:"https://api.anthropic.com/v1",E=(Z=Q.name)!=null?Z:"anthropic.messages";if(Q.apiKey&&Q.authToken)throw new MG({argument:"apiKey/authToken",message:"Both apiKey and authToken were provided. Please use only one authentication method."});let T=()=>{let h=Q.authToken?{Authorization:`Bearer ${Q.authToken}`}:{"x-api-key":vG({apiKey:Q.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"})};return OG({"anthropic-version":"2023-06-01",...h,...Q.headers},`ai-sdk/anthropic/${aG}`)},b=(h)=>{var w;return new dQ(h,{provider:E,baseURL:q,headers:T,fetch:Q.fetch,generateId:(w=Q.generateId)!=null?w:AG,supportedUrls:()=>({"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]})})},F=function(h){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return b(h)};return F.specificationVersion="v3",F.languageModel=b,F.chat=b,F.messages=b,F.embeddingModel=(h)=>{throw new WG({modelId:h,modelType:"embeddingModel"})},F.textEmbeddingModel=F.embeddingModel,F.imageModel=(h)=>{throw new WG({modelId:h,modelType:"imageModel"})},F.tools=KX,F}var KY=DX();function DY({steps:Q}){var H,Z,q;for(let E=Q.length-1;E>=0;E--){let T=(q=(Z=(H=Q[E].providerMetadata)==null?void 0:H.anthropic)==null?void 0:Z.container)==null?void 0:q.id;if(T)return{providerOptions:{anthropic:{container:{id:T}}}}}return}export{DY as forwardAnthropicContainerIdFromLastStep,DX as createAnthropic,KY as anthropic,aG as VERSION};
|
|
2
|
+
import{Ap as UG,Bp as hG,Cp as gG,Dp as mG,Hp as dG,Io as CG,Jo as bG,No as TG,Po as jG,Yo as AG,bp as OG,dp as kG,fp as vG,gp as _G,jp as J,mp as W,np as GG,tp as LG,up as VG,yp as u,zp as l}from"./chunk-wm9nh9nb.js";import{Kp as NG,Np as MG,Tp as WG,Wp as HG}from"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import{Kt as G}from"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-e0vrxetq.js";var aG="3.0.71",eG=J(()=>W(G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}))),yG=hG({errorSchema:eG,errorToMessage:(Q)=>Q.error.message}),oG=J(()=>W(G.object({type:G.literal("message"),id:G.string().nullish(),model:G.string().nullish(),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string(),citations:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])).optional()}),G.object({type:G.literal("thinking"),thinking:G.string(),signature:G.string()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])),stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish(),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}))),tG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("message_start"),message:G.object({id:G.string().nullish(),model:G.string().nullish(),role:G.string().nullish(),usage:G.looseObject({input_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish()}),content:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.unknown(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()})])).nullish(),stop_reason:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string()}).nullish()})}),G.object({type:G.literal("content_block_start"),index:G.number(),content_block:G.discriminatedUnion("type",[G.object({type:G.literal("text"),text:G.string()}),G.object({type:G.literal("thinking"),thinking:G.string()}),G.object({type:G.literal("tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).optional(),caller:G.union([G.object({type:G.literal("code_execution_20250825"),tool_id:G.string()}),G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("redacted_thinking"),data:G.string()}),G.object({type:G.literal("compaction"),content:G.string().nullish()}),G.object({type:G.literal("server_tool_use"),id:G.string(),name:G.string(),input:G.record(G.string(),G.unknown()).nullish(),caller:G.union([G.object({type:G.literal("code_execution_20260120"),tool_id:G.string()}),G.object({type:G.literal("direct")})]).optional()}),G.object({type:G.literal("mcp_tool_use"),id:G.string(),name:G.string(),input:G.unknown(),server_name:G.string()}),G.object({type:G.literal("mcp_tool_result"),tool_use_id:G.string(),is_error:G.boolean(),content:G.array(G.union([G.string(),G.object({type:G.literal("text"),text:G.string()})]))}),G.object({type:G.literal("web_fetch_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("web_fetch_result"),url:G.string(),retrieved_at:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),media_type:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),media_type:G.literal("text/plain"),data:G.string()})])})}),G.object({type:G.literal("web_fetch_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("web_search_tool_result"),tool_use_id:G.string(),content:G.union([G.array(G.object({type:G.literal("web_search_result"),url:G.string(),title:G.string(),encrypted_content:G.string(),page_age:G.string().nullish()})),G.object({type:G.literal("web_search_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("code_execution_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("bash_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()})])}),G.object({type:G.literal("text_editor_code_execution_tool_result"),tool_use_id:G.string(),content:G.discriminatedUnion("type",[G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})])}),G.object({type:G.literal("tool_search_tool_result"),tool_use_id:G.string(),content:G.union([G.object({type:G.literal("tool_search_tool_search_result"),tool_references:G.array(G.object({type:G.literal("tool_reference"),tool_name:G.string()}))}),G.object({type:G.literal("tool_search_tool_result_error"),error_code:G.string()})])})])}),G.object({type:G.literal("content_block_delta"),index:G.number(),delta:G.discriminatedUnion("type",[G.object({type:G.literal("input_json_delta"),partial_json:G.string()}),G.object({type:G.literal("text_delta"),text:G.string()}),G.object({type:G.literal("thinking_delta"),thinking:G.string()}),G.object({type:G.literal("signature_delta"),signature:G.string()}),G.object({type:G.literal("compaction_delta"),content:G.string().nullish()}),G.object({type:G.literal("citations_delta"),citation:G.discriminatedUnion("type",[G.object({type:G.literal("web_search_result_location"),cited_text:G.string(),url:G.string(),title:G.string(),encrypted_index:G.string()}),G.object({type:G.literal("page_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_page_number:G.number(),end_page_number:G.number()}),G.object({type:G.literal("char_location"),cited_text:G.string(),document_index:G.number(),document_title:G.string().nullable(),start_char_index:G.number(),end_char_index:G.number()})])})])}),G.object({type:G.literal("content_block_stop"),index:G.number()}),G.object({type:G.literal("error"),error:G.object({type:G.string(),message:G.string()})}),G.object({type:G.literal("message_delta"),delta:G.object({stop_reason:G.string().nullish(),stop_sequence:G.string().nullish(),container:G.object({expires_at:G.string(),id:G.string(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skill_id:G.string(),version:G.string()})).nullish()}).nullish()}),usage:G.looseObject({input_tokens:G.number().nullish(),output_tokens:G.number(),cache_creation_input_tokens:G.number().nullish(),cache_read_input_tokens:G.number().nullish(),iterations:G.array(G.object({type:G.union([G.literal("compaction"),G.literal("message")]),input_tokens:G.number(),output_tokens:G.number()})).nullish()}),context_management:G.object({applied_edits:G.array(G.union([G.object({type:G.literal("clear_tool_uses_20250919"),cleared_tool_uses:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("clear_thinking_20251015"),cleared_thinking_turns:G.number(),cleared_input_tokens:G.number()}),G.object({type:G.literal("compact_20260112")})]))}).nullish()}),G.object({type:G.literal("message_stop")}),G.object({type:G.literal("ping")})]))),GQ=J(()=>W(G.object({signature:G.string().optional(),redactedData:G.string().optional()}))),FG=G.object({citations:G.object({enabled:G.boolean()}).optional(),title:G.string().optional(),context:G.string().optional()}),xG=G.object({sendReasoning:G.boolean().optional(),structuredOutputMode:G.enum(["outputFormat","jsonTool","auto"]).optional(),thinking:G.discriminatedUnion("type",[G.object({type:G.literal("adaptive"),display:G.enum(["omitted","summarized"]).optional()}),G.object({type:G.literal("enabled"),budgetTokens:G.number().optional()}),G.object({type:G.literal("disabled")})]).optional(),disableParallelToolUse:G.boolean().optional(),cacheControl:G.object({type:G.literal("ephemeral"),ttl:G.union([G.literal("5m"),G.literal("1h")]).optional()}).optional(),metadata:G.object({userId:G.string().optional()}).optional(),mcpServers:G.array(G.object({type:G.literal("url"),name:G.string(),url:G.string(),authorizationToken:G.string().nullish(),toolConfiguration:G.object({enabled:G.boolean().nullish(),allowedTools:G.array(G.string()).nullish()}).nullish()})).optional(),container:G.object({id:G.string().optional(),skills:G.array(G.object({type:G.union([G.literal("anthropic"),G.literal("custom")]),skillId:G.string(),version:G.string().optional()})).optional()}).optional(),toolStreaming:G.boolean().optional(),effort:G.enum(["low","medium","high","xhigh","max"]).optional(),taskBudget:G.object({type:G.literal("tokens"),total:G.number().int().min(20000),remaining:G.number().int().min(0).optional()}).optional(),speed:G.enum(["fast","standard"]).optional(),inferenceGeo:G.enum(["us","global"]).optional(),anthropicBeta:G.array(G.string()).optional(),contextManagement:G.object({edits:G.array(G.discriminatedUnion("type",[G.object({type:G.literal("clear_tool_uses_20250919"),trigger:G.discriminatedUnion("type",[G.object({type:G.literal("input_tokens"),value:G.number()}),G.object({type:G.literal("tool_uses"),value:G.number()})]).optional(),keep:G.object({type:G.literal("tool_uses"),value:G.number()}).optional(),clearAtLeast:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),clearToolInputs:G.boolean().optional(),excludeTools:G.array(G.string()).optional()}),G.object({type:G.literal("clear_thinking_20251015"),keep:G.union([G.literal("all"),G.object({type:G.literal("thinking_turns"),value:G.number()})]).optional()}),G.object({type:G.literal("compact_20260112"),trigger:G.object({type:G.literal("input_tokens"),value:G.number()}).optional(),pauseAfterCompaction:G.boolean().optional(),instructions:G.string().optional()})]))}).optional()}),PG=4;function QQ(Q){var H;let Z=Q==null?void 0:Q.anthropic;return(H=Z==null?void 0:Z.cacheControl)!=null?H:Z==null?void 0:Z.cache_control}var RG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(Q,H){let Z=QQ(Q);if(!Z)return;if(!H.canCache){this.warnings.push({type:"unsupported",feature:"cache_control on non-cacheable context",details:`cache_control cannot be set on ${H.type}. It will be ignored.`});return}if(this.breakpointCount++,this.breakpointCount>PG){this.warnings.push({type:"unsupported",feature:"cacheControl breakpoint limit",details:`Maximum ${PG} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`});return}return Z}getWarnings(){return this.warnings}},XQ=J(()=>W(G.object({maxCharacters:G.number().optional()}))),YQ=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZQ=u({id:"anthropic.text_editor_20250728",inputSchema:YQ}),$Q=(Q={})=>{return ZQ(Q)},zQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),LQ=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),HQ=J(()=>W(G.object({query:G.string()}))),qQ=l({id:"anthropic.web_search_20260209",inputSchema:HQ,outputSchema:LQ,supportsDeferredResults:!0}),AQ=(Q={})=>{return qQ(Q)},KQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),userLocation:G.object({type:G.literal("approximate"),city:G.string().optional(),region:G.string().optional(),country:G.string().optional(),timezone:G.string().optional()}).optional()}))),uG=J(()=>W(G.array(G.object({url:G.string(),title:G.string().nullable(),pageAge:G.string().nullable(),encryptedContent:G.string(),type:G.literal("web_search_result")})))),DQ=J(()=>W(G.object({query:G.string()}))),JQ=l({id:"anthropic.web_search_20250305",inputSchema:DQ,outputSchema:uG,supportsDeferredResults:!0}),WQ=(Q={})=>{return JQ(Q)},jQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),VQ=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),UQ=J(()=>W(G.object({url:G.string()}))),RQ=l({id:"anthropic.web_fetch_20260209",inputSchema:UQ,outputSchema:VQ,supportsDeferredResults:!0}),EQ=(Q={})=>{return RQ(Q)},SQ=J(()=>W(G.object({maxUses:G.number().optional(),allowedDomains:G.array(G.string()).optional(),blockedDomains:G.array(G.string()).optional(),citations:G.object({enabled:G.boolean()}).optional(),maxContentTokens:G.number().optional()}))),cG=J(()=>W(G.object({type:G.literal("web_fetch_result"),url:G.string(),content:G.object({type:G.literal("document"),title:G.string().nullable(),citations:G.object({enabled:G.boolean()}).optional(),source:G.union([G.object({type:G.literal("base64"),mediaType:G.literal("application/pdf"),data:G.string()}),G.object({type:G.literal("text"),mediaType:G.literal("text/plain"),data:G.string()})])}),retrievedAt:G.string().nullable()}))),yQ=J(()=>W(G.object({url:G.string()}))),FQ=l({id:"anthropic.web_fetch_20250910",inputSchema:yQ,outputSchema:cG,supportsDeferredResults:!0}),xQ=(Q={})=>{return FQ(Q)};async function PQ({tools:Q,toolChoice:H,disableParallelToolUse:Z,cacheControlValidator:q,supportsStructuredOutput:E,supportsStrictTools:T,defaultEagerInputStreaming:b=!1}){var F,h;Q=(Q==null?void 0:Q.length)?Q:void 0;let w=[],N=new Set,c=q||new RG;if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};let R=[];for(let S of Q)switch(S.type){case"function":{let B=c.getCacheControl(S.providerOptions,{type:"tool definition",canCache:!0}),g=(F=S.providerOptions)==null?void 0:F.anthropic,m=(h=g==null?void 0:g.eagerInputStreaming)!=null?h:b,O=g==null?void 0:g.deferLoading,e=g==null?void 0:g.allowedCallers;if(!T&&S.strict!=null)w.push({type:"unsupported",feature:"strict",details:`Tool '${S.name}' has strict: ${S.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`});if(R.push({name:S.name,description:S.description,input_schema:S.inputSchema,cache_control:B,...m?{eager_input_streaming:!0}:{},...T===!0&&S.strict!=null?{strict:S.strict}:{},...O!=null?{defer_loading:O}:{},...e!=null?{allowed_callers:e}:{},...S.inputExamples!=null?{input_examples:S.inputExamples.map((C)=>C.input)}:{}}),E===!0)N.add("structured-outputs-2025-11-13");if(S.inputExamples!=null||e!=null)N.add("advanced-tool-use-2025-11-20");break}case"provider":{switch(S.id){case"anthropic.code_execution_20250522":{N.add("code-execution-2025-05-22"),R.push({type:"code_execution_20250522",name:"code_execution",cache_control:void 0});break}case"anthropic.code_execution_20250825":{N.add("code-execution-2025-08-25"),R.push({type:"code_execution_20250825",name:"code_execution"});break}case"anthropic.code_execution_20260120":{R.push({type:"code_execution_20260120",name:"code_execution"});break}case"anthropic.computer_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"computer",type:"computer_20250124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.computer_20251124":{N.add("computer-use-2025-11-24"),R.push({name:"computer",type:"computer_20251124",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,enable_zoom:S.args.enableZoom,cache_control:void 0});break}case"anthropic.computer_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"computer",type:"computer_20241022",display_width_px:S.args.displayWidthPx,display_height_px:S.args.displayHeightPx,display_number:S.args.displayNumber,cache_control:void 0});break}case"anthropic.text_editor_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_editor",type:"text_editor_20250124",cache_control:void 0});break}case"anthropic.text_editor_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"str_replace_editor",type:"text_editor_20241022",cache_control:void 0});break}case"anthropic.text_editor_20250429":{N.add("computer-use-2025-01-24"),R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429",cache_control:void 0});break}case"anthropic.text_editor_20250728":{let B=await GG({value:S.args,schema:XQ});R.push({name:"str_replace_based_edit_tool",type:"text_editor_20250728",max_characters:B.maxCharacters,cache_control:void 0});break}case"anthropic.bash_20250124":{N.add("computer-use-2025-01-24"),R.push({name:"bash",type:"bash_20250124",cache_control:void 0});break}case"anthropic.bash_20241022":{N.add("computer-use-2024-10-22"),R.push({name:"bash",type:"bash_20241022",cache_control:void 0});break}case"anthropic.memory_20250818":{N.add("context-management-2025-06-27"),R.push({name:"memory",type:"memory_20250818"});break}case"anthropic.web_fetch_20250910":{N.add("web-fetch-2025-09-10");let B=await GG({value:S.args,schema:SQ});R.push({type:"web_fetch_20250910",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_fetch_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:jQ});R.push({type:"web_fetch_20260209",name:"web_fetch",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,citations:B.citations,max_content_tokens:B.maxContentTokens,cache_control:void 0});break}case"anthropic.web_search_20250305":{let B=await GG({value:S.args,schema:KQ});R.push({type:"web_search_20250305",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.web_search_20260209":{N.add("code-execution-web-tools-2026-02-09");let B=await GG({value:S.args,schema:zQ});R.push({type:"web_search_20260209",name:"web_search",max_uses:B.maxUses,allowed_domains:B.allowedDomains,blocked_domains:B.blockedDomains,user_location:B.userLocation,cache_control:void 0});break}case"anthropic.tool_search_regex_20251119":{R.push({type:"tool_search_tool_regex_20251119",name:"tool_search_tool_regex"});break}case"anthropic.tool_search_bm25_20251119":{R.push({type:"tool_search_tool_bm25_20251119",name:"tool_search_tool_bm25"});break}default:{w.push({type:"unsupported",feature:`provider-defined tool ${S.id}`});break}}break}default:{w.push({type:"unsupported",feature:`tool ${S}`});break}}if(H==null)return{tools:R,toolChoice:Z?{type:"auto",disable_parallel_tool_use:Z}:void 0,toolWarnings:w,betas:N};let a=H.type;switch(a){case"auto":return{tools:R,toolChoice:{type:"auto",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"required":return{tools:R,toolChoice:{type:"any",disable_parallel_tool_use:Z},toolWarnings:w,betas:N};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:w,betas:N};case"tool":return{tools:R,toolChoice:{type:"tool",name:H.toolName,disable_parallel_tool_use:Z},toolWarnings:w,betas:N};default:throw new HG({functionality:`tool choice type: ${a}`})}}function fG({usage:Q,rawUsage:H}){var Z,q;let E=(Z=Q.cache_creation_input_tokens)!=null?Z:0,T=(q=Q.cache_read_input_tokens)!=null?q:0,b,F;if(Q.iterations&&Q.iterations.length>0){let h=Q.iterations.reduce((w,N)=>({input:w.input+N.input_tokens,output:w.output+N.output_tokens}),{input:0,output:0});b=h.input,F=h.output}else b=Q.input_tokens,F=Q.output_tokens;return{inputTokens:{total:b+E+T,noCache:b,cacheRead:T,cacheWrite:E},outputTokens:{total:F,text:void 0,reasoning:void 0},raw:H!=null?H:Q}}var iG=J(()=>W(G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}))),fQ=J(()=>W(G.object({code:G.string()}))),BQ=l({id:"anthropic.code_execution_20250522",inputSchema:fQ,outputSchema:iG}),IQ=(Q={})=>{return BQ(Q)},lG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),wQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),NQ=l({id:"anthropic.code_execution_20250825",inputSchema:wQ,outputSchema:lG,supportsDeferredResults:!0}),MQ=(Q={})=>{return NQ(Q)},sG=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("code_execution_result"),stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("encrypted_code_execution_result"),encrypted_stdout:G.string(),stderr:G.string(),return_code:G.number(),content:G.array(G.object({type:G.literal("code_execution_output"),file_id:G.string()})).optional().default([])}),G.object({type:G.literal("bash_code_execution_result"),content:G.array(G.object({type:G.literal("bash_code_execution_output"),file_id:G.string()})),stdout:G.string(),stderr:G.string(),return_code:G.number()}),G.object({type:G.literal("bash_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_tool_result_error"),error_code:G.string()}),G.object({type:G.literal("text_editor_code_execution_view_result"),content:G.string(),file_type:G.string(),num_lines:G.number().nullable(),start_line:G.number().nullable(),total_lines:G.number().nullable()}),G.object({type:G.literal("text_editor_code_execution_create_result"),is_file_update:G.boolean()}),G.object({type:G.literal("text_editor_code_execution_str_replace_result"),lines:G.array(G.string()).nullable(),new_lines:G.number().nullable(),new_start:G.number().nullable(),old_lines:G.number().nullable(),old_start:G.number().nullable()})]))),CQ=J(()=>W(G.discriminatedUnion("type",[G.object({type:G.literal("programmatic-tool-call"),code:G.string()}),G.object({type:G.literal("bash_code_execution"),command:G.string()}),G.discriminatedUnion("command",[G.object({type:G.literal("text_editor_code_execution"),command:G.literal("view"),path:G.string()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("create"),path:G.string(),file_text:G.string().nullish()}),G.object({type:G.literal("text_editor_code_execution"),command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()})])]))),bQ=l({id:"anthropic.code_execution_20260120",inputSchema:CQ,outputSchema:sG,supportsDeferredResults:!0}),TQ=(Q={})=>{return bQ(Q)},pG=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),OQ=J(()=>W(G.object({pattern:G.string(),limit:G.number().optional()}))),kQ=l({id:"anthropic.tool_search_regex_20251119",inputSchema:OQ,outputSchema:pG,supportsDeferredResults:!0}),vQ=(Q={})=>{return kQ(Q)};function _Q(Q){if(typeof Q==="string")return new TextDecoder().decode(TG(Q));if(Q instanceof Uint8Array)return new TextDecoder().decode(Q);if(Q instanceof URL)throw new HG({functionality:"URL-based text documents are not supported for citations"});throw new HG({functionality:`unsupported data type for text documents: ${typeof Q}`})}function KG(Q){return Q instanceof URL||hQ(Q)}function hQ(Q){return typeof Q==="string"&&/^https?:\/\//i.test(Q)}function DG(Q){return Q instanceof URL?Q.toString():Q}async function gQ({prompt:Q,sendReasoning:H,warnings:Z,cacheControlValidator:q,toolNameMapping:E}){var T,b,F,h,w,N,c,R,a,S,B,g,m,O,e,C,s,QG,YG;let Y=new Set,j=mQ(Q),M=q||new RG,p=void 0,XG=[];async function zG(v){var k,V;let ZG=await LG({provider:"anthropic",providerOptions:v,schema:FG});return(V=(k=ZG==null?void 0:ZG.citations)==null?void 0:k.enabled)!=null?V:!1}async function L(v){let k=await LG({provider:"anthropic",providerOptions:v,schema:FG});return{title:k==null?void 0:k.title,context:k==null?void 0:k.context}}for(let v=0;v<j.length;v++){let k=j[v],V=v===j.length-1,ZG=k.type;switch(ZG){case"system":{if(p!=null)throw new HG({functionality:"Multiple system messages that are separated by user/assistant messages"});p=k.messages.map(({content:I,providerOptions:o})=>({type:"text",text:I,cache_control:M.getCacheControl(o,{type:"system message",canCache:!0})}));break}case"user":{let I=[];for(let o of k.messages){let{role:t,content:r}=o;switch(t){case"user":{for(let i=0;i<r.length;i++){let x=r[i],n=i===r.length-1,z=(T=M.getCacheControl(x.providerOptions,{type:"user message part",canCache:!0}))!=null?T:n?M.getCacheControl(o.providerOptions,{type:"user message",canCache:!0}):void 0;switch(x.type){case"text":{I.push({type:"text",text:x.text,cache_control:z});break}case"file":{if(x.mediaType.startsWith("image/"))I.push({type:"image",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:x.mediaType==="image/*"?"image/jpeg":x.mediaType,data:jG(x.data)},cache_control:z});else if(x.mediaType==="application/pdf"){Y.add("pdfs-2024-09-25");let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"base64",media_type:"application/pdf",data:jG(x.data)},title:(b=P.title)!=null?b:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else if(x.mediaType==="text/plain"){let d=await zG(x.providerOptions),P=await L(x.providerOptions);I.push({type:"document",source:KG(x.data)?{type:"url",url:DG(x.data)}:{type:"text",media_type:"text/plain",data:_Q(x.data)},title:(F=P.title)!=null?F:x.filename,...P.context&&{context:P.context},...d&&{citations:{enabled:!0}},cache_control:z})}else throw new HG({functionality:`media type: ${x.mediaType}`});break}}}break}case"tool":{for(let i=0;i<r.length;i++){let x=r[i];if(x.type==="tool-approval-response")continue;let n=i===r.length-1,z=(h=M.getCacheControl(x.providerOptions,{type:"tool result part",canCache:!0}))!=null?h:n?M.getCacheControl(o.providerOptions,{type:"tool result message",canCache:!0}):void 0,d=x.output,P;switch(d.type){case"content":P=d.value.map((U)=>{var D;switch(U.type){case"text":return{type:"text",text:U.text};case"image-data":return{type:"image",source:{type:"base64",media_type:U.mediaType,data:U.data}};case"image-url":return{type:"image",source:{type:"url",url:U.url}};case"file-url":return{type:"document",source:{type:"url",url:U.url}};case"file-data":{if(U.mediaType==="application/pdf")return Y.add("pdfs-2024-09-25"),{type:"document",source:{type:"base64",media_type:U.mediaType,data:U.data}};Z.push({type:"other",message:`unsupported tool content part type: ${U.type} with media type: ${U.mediaType}`});return}case"custom":{let A=(D=U.providerOptions)==null?void 0:D.anthropic;if((A==null?void 0:A.type)==="tool-reference")return{type:"tool_reference",tool_name:A.toolName};Z.push({type:"other",message:"unsupported custom tool content part"});return}default:{Z.push({type:"other",message:`unsupported tool content part type: ${U.type}`});return}}}).filter(kG);break;case"text":case"error-text":P=d.value;break;case"execution-denied":P=(w=d.reason)!=null?w:"Tool execution denied.";break;case"json":case"error-json":default:P=JSON.stringify(d.value);break}I.push({type:"tool_result",tool_use_id:x.toolCallId,content:P,is_error:d.type==="error-text"||d.type==="error-json"?!0:void 0,cache_control:z})}break}default:throw Error(`Unsupported role: ${t}`)}}XG.push({role:"user",content:I});break}case"assistant":{let I=[],o=new Set;for(let t=0;t<k.messages.length;t++){let r=k.messages[t],i=t===k.messages.length-1,{content:x}=r;for(let n=0;n<x.length;n++){let z=x[n],d=n===x.length-1,P=(N=M.getCacheControl(z.providerOptions,{type:"assistant message part",canCache:!0}))!=null?N:d?M.getCacheControl(r.providerOptions,{type:"assistant message",canCache:!0}):void 0;switch(z.type){case"text":{let U=(c=z.providerOptions)==null?void 0:c.anthropic;if((U==null?void 0:U.type)==="compaction")I.push({type:"compaction",content:z.text,cache_control:P});else I.push({type:"text",text:V&&i&&d?z.text.trim():z.text,cache_control:P});break}case"reasoning":{if(H){let U=await LG({provider:"anthropic",providerOptions:z.providerOptions,schema:GQ});if(U!=null)if(U.signature!=null)M.getCacheControl(z.providerOptions,{type:"thinking block",canCache:!1}),I.push({type:"thinking",thinking:z.text,signature:U.signature});else if(U.redactedData!=null)M.getCacheControl(z.providerOptions,{type:"redacted thinking block",canCache:!1}),I.push({type:"redacted_thinking",data:U.redactedData});else Z.push({type:"other",message:"unsupported reasoning metadata"});else Z.push({type:"other",message:"unsupported reasoning metadata"})}else Z.push({type:"other",message:"sending reasoning content is disabled for this model"});break}case"tool-call":{if(z.providerExecuted){let A=E.toProviderToolName(z.toolName);if(((a=(R=z.providerOptions)==null?void 0:R.anthropic)==null?void 0:a.type)==="mcp-tool-use"){o.add(z.toolCallId);let X=(B=(S=z.providerOptions)==null?void 0:S.anthropic)==null?void 0:B.serverName;if(X==null||typeof X!=="string"){Z.push({type:"other",message:"mcp tool use server name is required and must be a string"});break}I.push({type:"mcp_tool_use",id:z.toolCallId,name:z.toolName,input:z.input,server_name:X,cache_control:P})}else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&typeof z.input.type==="string"&&(z.input.type==="bash_code_execution"||z.input.type==="text_editor_code_execution"))I.push({type:"server_tool_use",id:z.toolCallId,name:z.input.type,input:z.input,cache_control:P});else if(A==="code_execution"&&z.input!=null&&typeof z.input==="object"&&"type"in z.input&&z.input.type==="programmatic-tool-call"){let{type:X,...f}=z.input;I.push({type:"server_tool_use",id:z.toolCallId,name:"code_execution",input:f,cache_control:P})}else if(A==="code_execution"||A==="web_fetch"||A==="web_search")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else if(A==="tool_search_tool_regex"||A==="tool_search_tool_bm25")I.push({type:"server_tool_use",id:z.toolCallId,name:A,input:z.input,cache_control:P});else Z.push({type:"other",message:`provider executed tool call for tool ${z.toolName} is not supported`});break}let U=(g=z.providerOptions)==null?void 0:g.anthropic,D=(U==null?void 0:U.caller)?(U.caller.type==="code_execution_20250825"||U.caller.type==="code_execution_20260120")&&U.caller.toolId?{type:U.caller.type,tool_id:U.caller.toolId}:U.caller.type==="direct"?{type:"direct"}:void 0:void 0;I.push({type:"tool_use",id:z.toolCallId,name:z.toolName,input:z.input,...D&&{caller:D},cache_control:P});break}case"tool-result":{let U=E.toProviderToolName(z.toolName);if(o.has(z.toolCallId)){let D=z.output;if(D.type!=="json"&&D.type!=="error-json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}I.push({type:"mcp_tool_result",tool_use_id:z.toolCallId,is_error:D.type==="error-json",content:D.value,cache_control:P})}else if(U==="code_execution"){let D=z.output;if(D.type==="error-text"||D.type==="error-json"){let A={};try{if(typeof D.value==="string")A=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)A=D.value}catch($){}if(A.type==="code_execution_tool_result_error")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:"code_execution_tool_result_error",error_code:(m=A.errorCode)!=null?m:"unknown"},cache_control:P});else I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:{type:"bash_code_execution_tool_result_error",error_code:(O=A.errorCode)!=null?O:"unknown"}});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}if(D.value==null||typeof D.value!=="object"||!("type"in D.value)||typeof D.value.type!=="string"){Z.push({type:"other",message:`provider executed tool result output value is not a valid code execution result for tool ${z.toolName}`});break}if(D.value.type==="code_execution_result"){let A=await GG({value:D.value,schema:iG});I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(e=A.content)!=null?e:[]},cache_control:P})}else if(D.value.type==="encrypted_code_execution_result"){let A=await GG({value:D.value,schema:sG});if(A.type==="encrypted_code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,encrypted_stdout:A.encrypted_stdout,stderr:A.stderr,return_code:A.return_code,content:(C=A.content)!=null?C:[]},cache_control:P})}else{let A=await GG({value:D.value,schema:lG});if(A.type==="code_execution_result")I.push({type:"code_execution_tool_result",tool_use_id:z.toolCallId,content:{type:A.type,stdout:A.stdout,stderr:A.stderr,return_code:A.return_code,content:(s=A.content)!=null?s:[]},cache_control:P});else if(A.type==="bash_code_execution_result"||A.type==="bash_code_execution_tool_result_error")I.push({type:"bash_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A});else I.push({type:"text_editor_code_execution_tool_result",tool_use_id:z.toolCallId,cache_control:P,content:A})}break}if(U==="web_fetch"){let D=z.output;if(D.type==="error-json"){let $={};try{if(typeof D.value==="string")$=JSON.parse(D.value);else if(typeof D.value==="object"&&D.value!==null)$=D.value}catch(X){let f=(QG=D.value)==null?void 0:QG.errorCode;$={errorCode:typeof f==="string"?f:"unavailable"}}I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_tool_result_error",error_code:(YG=$.errorCode)!=null?YG:"unavailable"},cache_control:P});break}if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:cG});I.push({type:"web_fetch_tool_result",tool_use_id:z.toolCallId,content:{type:"web_fetch_result",url:A.url,retrieved_at:A.retrievedAt,content:{type:"document",title:A.content.title,citations:A.content.citations,source:{type:A.content.source.type,media_type:A.content.source.mediaType,data:A.content.source.data}}},cache_control:P});break}if(U==="web_search"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let A=await GG({value:D.value,schema:uG});I.push({type:"web_search_tool_result",tool_use_id:z.toolCallId,content:A.map(($)=>({url:$.url,title:$.title,page_age:$.pageAge,encrypted_content:$.encryptedContent,type:$.type})),cache_control:P});break}if(U==="tool_search_tool_regex"||U==="tool_search_tool_bm25"){let D=z.output;if(D.type!=="json"){Z.push({type:"other",message:`provider executed tool result output type ${D.type} for tool ${z.toolName} is not supported`});break}let $=(await GG({value:D.value,schema:pG})).map((X)=>({type:"tool_reference",tool_name:X.toolName}));I.push({type:"tool_search_tool_result",tool_use_id:z.toolCallId,content:{type:"tool_search_tool_search_result",tool_references:$},cache_control:P});break}Z.push({type:"other",message:`provider executed tool result for tool ${z.toolName} is not supported`});break}}}}XG.push({role:"assistant",content:I});break}default:throw Error(`content type: ${ZG}`)}}return{prompt:{system:p,messages:XG},betas:Y}}function mQ(Q){let H=[],Z=void 0;for(let q of Q){let{role:E}=q;switch(E){case"system":{if((Z==null?void 0:Z.type)!=="system")Z={type:"system",messages:[]},H.push(Z);Z.messages.push(q);break}case"assistant":{if((Z==null?void 0:Z.type)!=="assistant")Z={type:"assistant",messages:[]},H.push(Z);Z.messages.push(q);break}case"user":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}case"tool":{if((Z==null?void 0:Z.type)!=="user")Z={type:"user",messages:[]},H.push(Z);Z.messages.push(q);break}default:throw Error(`Unsupported role: ${E}`)}}return H}function JG({finishReason:Q,isJsonResponseFromTool:H}){switch(Q){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return H?"stop":"tool-calls";case"max_tokens":case"model_context_window_exceeded":return"length";case"compaction":return"other";default:return"other"}}function BG(Q,H,Z){var q;if(Q.type==="web_search_result_location")return{type:"source",sourceType:"url",id:Z(),url:Q.url,title:Q.title,providerMetadata:{anthropic:{citedText:Q.cited_text,encryptedIndex:Q.encrypted_index}}};if(Q.type!=="page_location"&&Q.type!=="char_location")return;let E=H[Q.document_index];if(!E)return;return{type:"source",sourceType:"document",id:Z(),mediaType:E.mediaType,title:(q=Q.document_title)!=null?q:E.title,filename:E.filename,providerMetadata:{anthropic:Q.type==="page_location"?{citedText:Q.cited_text,startPageNumber:Q.start_page_number,endPageNumber:Q.end_page_number}:{citedText:Q.cited_text,startCharIndex:Q.start_char_index,endCharIndex:Q.end_char_index}}}}var dQ=class{constructor(Q,H){this.specificationVersion="v3";var Z;this.modelId=Q,this.config=H,this.generateId=(Z=H.generateId)!=null?Z:AG}supportsUrl(Q){return Q.protocol==="https:"}get provider(){return this.config.provider}get providerOptionsName(){let Q=this.config.provider,H=Q.indexOf(".");return H===-1?Q:Q.substring(0,H)}get supportedUrls(){var Q,H,Z;return(Z=(H=(Q=this.config).supportedUrls)==null?void 0:H.call(Q))!=null?Z:{}}async getArgs({userSuppliedBetas:Q,prompt:H,maxOutputTokens:Z,temperature:q,topP:E,topK:T,frequencyPenalty:b,presencePenalty:F,stopSequences:h,responseFormat:w,seed:N,tools:c,toolChoice:R,providerOptions:a,stream:S}){var B,g,m,O,e,C,s,QG,YG,Y;let j=[];if(b!=null)j.push({type:"unsupported",feature:"frequencyPenalty"});if(F!=null)j.push({type:"unsupported",feature:"presencePenalty"});if(N!=null)j.push({type:"unsupported",feature:"seed"});if(q!=null&&q>1)j.push({type:"unsupported",feature:"temperature",details:`${q} exceeds anthropic maximum of 1.0. clamped to 1.0`}),q=1;else if(q!=null&&q<0)j.push({type:"unsupported",feature:"temperature",details:`${q} is below anthropic minimum of 0. clamped to 0`}),q=0;if((w==null?void 0:w.type)==="json"){if(w.schema==null)j.push({type:"unsupported",feature:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."})}let M=this.providerOptionsName,p=await LG({provider:"anthropic",providerOptions:a,schema:xG}),XG=M!=="anthropic"?await LG({provider:M,providerOptions:a,schema:xG}):null,zG=XG!=null,L=Object.assign({},p!=null?p:{},XG!=null?XG:{}),{maxOutputTokens:v,supportsStructuredOutput:k,rejectsSamplingParameters:V,isKnownModel:ZG}=uQ(this.modelId);if(V){if(q!=null)j.push({type:"unsupported",feature:"temperature",details:`temperature is not supported by ${this.modelId} and will be ignored`}),q=void 0;if(T!=null)j.push({type:"unsupported",feature:"topK",details:`topK is not supported by ${this.modelId} and will be ignored`}),T=void 0;if(E!=null)j.push({type:"unsupported",feature:"topP",details:`topP is not supported by ${this.modelId} and will be ignored`}),E=void 0}let I=ZG||this.modelId.startsWith("claude-"),o=((B=this.config.supportsNativeStructuredOutput)!=null?B:!0)&&k,t=((g=this.config.supportsStrictTools)!=null?g:!0)&&k,r=(m=L==null?void 0:L.structuredOutputMode)!=null?m:"auto",i=r==="outputFormat"||r==="auto"&&o,x=(w==null?void 0:w.type)==="json"&&w.schema!=null&&!i?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:w.schema}:void 0,n=L==null?void 0:L.contextManagement,z=new RG,d=bG({tools:c,providerToolNames:{"anthropic.code_execution_20250522":"code_execution","anthropic.code_execution_20250825":"code_execution","anthropic.code_execution_20260120":"code_execution","anthropic.computer_20241022":"computer","anthropic.computer_20250124":"computer","anthropic.text_editor_20241022":"str_replace_editor","anthropic.text_editor_20250124":"str_replace_editor","anthropic.text_editor_20250429":"str_replace_based_edit_tool","anthropic.text_editor_20250728":"str_replace_based_edit_tool","anthropic.bash_20241022":"bash","anthropic.bash_20250124":"bash","anthropic.memory_20250818":"memory","anthropic.web_search_20250305":"web_search","anthropic.web_search_20260209":"web_search","anthropic.web_fetch_20250910":"web_fetch","anthropic.web_fetch_20260209":"web_fetch","anthropic.tool_search_regex_20251119":"tool_search_tool_regex","anthropic.tool_search_bm25_20251119":"tool_search_tool_bm25"}}),{prompt:P,betas:U}=await gQ({prompt:H,sendReasoning:(O=L==null?void 0:L.sendReasoning)!=null?O:!0,warnings:j,cacheControlValidator:z,toolNameMapping:d}),D=(e=L==null?void 0:L.thinking)==null?void 0:e.type,A=D==="enabled"||D==="adaptive",$=D==="enabled"?(C=L==null?void 0:L.thinking)==null?void 0:C.budgetTokens:void 0,X=D==="adaptive"?(s=L==null?void 0:L.thinking)==null?void 0:s.display:void 0,f=Z!=null?Z:v,K={model:this.modelId,max_tokens:f,temperature:q,top_k:T,top_p:E,stop_sequences:h,...A&&{thinking:{type:D,...$!=null&&{budget_tokens:$},...X!=null&&{display:X}}},...((L==null?void 0:L.effort)||(L==null?void 0:L.taskBudget)||i&&(w==null?void 0:w.type)==="json"&&w.schema!=null)&&{output_config:{...(L==null?void 0:L.effort)&&{effort:L.effort},...(L==null?void 0:L.taskBudget)&&{task_budget:{type:L.taskBudget.type,total:L.taskBudget.total,...L.taskBudget.remaining!=null&&{remaining:L.taskBudget.remaining}}},...i&&(w==null?void 0:w.type)==="json"&&w.schema!=null&&{format:{type:"json_schema",schema:w.schema}}}},...(L==null?void 0:L.speed)&&{speed:L.speed},...(L==null?void 0:L.inferenceGeo)&&{inference_geo:L.inferenceGeo},...(L==null?void 0:L.cacheControl)&&{cache_control:L.cacheControl},...((QG=L==null?void 0:L.metadata)==null?void 0:QG.userId)!=null&&{metadata:{user_id:L.metadata.userId}},...(L==null?void 0:L.mcpServers)&&L.mcpServers.length>0&&{mcp_servers:L.mcpServers.map((y)=>({type:y.type,name:y.name,url:y.url,authorization_token:y.authorizationToken,tool_configuration:y.toolConfiguration?{allowed_tools:y.toolConfiguration.allowedTools,enabled:y.toolConfiguration.enabled}:void 0}))},...(L==null?void 0:L.container)&&{container:L.container.skills&&L.container.skills.length>0?{id:L.container.id,skills:L.container.skills.map((y)=>({type:y.type,skill_id:y.skillId,version:y.version}))}:L.container.id},system:P.system,messages:P.messages,...n&&{context_management:{edits:n.edits.map((y)=>{let SG=y.type;switch(SG){case"clear_tool_uses_20250919":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.keep!==void 0&&{keep:y.keep},...y.clearAtLeast!==void 0&&{clear_at_least:y.clearAtLeast},...y.clearToolInputs!==void 0&&{clear_tool_inputs:y.clearToolInputs},...y.excludeTools!==void 0&&{exclude_tools:y.excludeTools}};case"clear_thinking_20251015":return{type:y.type,...y.keep!==void 0&&{keep:y.keep}};case"compact_20260112":return{type:y.type,...y.trigger!==void 0&&{trigger:y.trigger},...y.pauseAfterCompaction!==void 0&&{pause_after_compaction:y.pauseAfterCompaction},...y.instructions!==void 0&&{instructions:y.instructions}};default:j.push({type:"other",message:`Unknown context management strategy: ${SG}`});return}}).filter((y)=>y!==void 0)}}};if(A){if(D==="enabled"&&$==null)j.push({type:"compatibility",feature:"extended thinking",details:"thinking budget is required when thinking is enabled. using default budget of 1024 tokens."}),K.thinking={type:"enabled",budget_tokens:1024},$=1024;if(K.temperature!=null)K.temperature=void 0,j.push({type:"unsupported",feature:"temperature",details:"temperature is not supported when thinking is enabled"});if(T!=null)K.top_k=void 0,j.push({type:"unsupported",feature:"topK",details:"topK is not supported when thinking is enabled"});if(E!=null)K.top_p=void 0,j.push({type:"unsupported",feature:"topP",details:"topP is not supported when thinking is enabled"});K.max_tokens=f+($!=null?$:0)}else if(I&&E!=null&&q!=null)j.push({type:"unsupported",feature:"topP",details:"topP is not supported when temperature is set. topP is ignored."}),K.top_p=void 0;if(ZG&&K.max_tokens>v){if(Z!=null)j.push({type:"unsupported",feature:"maxOutputTokens",details:`${K.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${v} max output tokens. The max output tokens have been limited to ${v}.`});K.max_tokens=v}if((L==null?void 0:L.mcpServers)&&L.mcpServers.length>0)U.add("mcp-client-2025-04-04");if(n){if(U.add("context-management-2025-06-27"),n.edits.some((y)=>y.type==="compact_20260112"))U.add("compact-2026-01-12")}if((L==null?void 0:L.container)&&L.container.skills&&L.container.skills.length>0){if(U.add("code-execution-2025-08-25"),U.add("skills-2025-10-02"),U.add("files-api-2025-04-14"),!(c==null?void 0:c.some((y)=>y.type==="provider"&&(y.id==="anthropic.code_execution_20250825"||y.id==="anthropic.code_execution_20260120"))))j.push({type:"other",message:"code execution tool is required when using skills"})}if(L==null?void 0:L.effort)U.add("effort-2025-11-24");if(L==null?void 0:L.taskBudget)U.add("task-budgets-2026-03-13");if((L==null?void 0:L.speed)==="fast")U.add("fast-mode-2026-02-01");let _=S&&((YG=L==null?void 0:L.toolStreaming)!=null?YG:!0),{tools:$G,toolChoice:EG,toolWarnings:qG,betas:nG}=await PQ(x!=null?{tools:[...c!=null?c:[],x],toolChoice:{type:"required"},disableParallelToolUse:!0,cacheControlValidator:z,supportsStructuredOutput:!1,supportsStrictTools:t,defaultEagerInputStreaming:_}:{tools:c!=null?c:[],toolChoice:R,disableParallelToolUse:L==null?void 0:L.disableParallelToolUse,cacheControlValidator:z,supportsStructuredOutput:o,supportsStrictTools:t,defaultEagerInputStreaming:_}),rG=z.getWarnings();return{args:{...K,tools:$G,tool_choice:EG,stream:S===!0?!0:void 0},warnings:[...j,...qG,...rG],betas:new Set([...U,...nG,...Q,...(Y=L==null?void 0:L.anthropicBeta)!=null?Y:[]]),usesJsonResponseTool:x!=null,toolNameMapping:d,providerOptionsName:M,usedCustomProviderKey:zG}}async getHeaders({betas:Q,headers:H}){return CG(await UG(this.config.headers),H,Q.size>0?{"anthropic-beta":Array.from(Q).join(",")}:{})}async getBetasFromHeaders(Q){var H,Z;let E=(H=(await UG(this.config.headers))["anthropic-beta"])!=null?H:"",T=(Z=Q==null?void 0:Q["anthropic-beta"])!=null?Z:"";return new Set([...E.toLowerCase().split(","),...T.toLowerCase().split(",")].map((b)=>b.trim()).filter((b)=>b!==""))}buildRequestUrl(Q){var H,Z,q;return(q=(Z=(H=this.config).buildRequestUrl)==null?void 0:Z.call(H,this.config.baseURL,Q))!=null?q:`${this.config.baseURL}/messages`}transformRequestBody(Q,H){var Z,q,E;return(E=(q=(Z=this.config).transformRequestBody)==null?void 0:q.call(Z,Q,H))!=null?E:Q}extractCitationDocuments(Q){let H=(Z)=>{var q,E;if(Z.type!=="file")return!1;if(Z.mediaType!=="application/pdf"&&Z.mediaType!=="text/plain")return!1;let T=(q=Z.providerOptions)==null?void 0:q.anthropic,b=T==null?void 0:T.citations;return(E=b==null?void 0:b.enabled)!=null?E:!1};return Q.filter((Z)=>Z.role==="user").flatMap((Z)=>Z.content).filter(H).map((Z)=>{var q;let E=Z;return{title:(q=E.filename)!=null?q:"Untitled Document",filename:E.filename,mediaType:E.mediaType}})}async doGenerate(Q){var H,Z,q,E,T,b,F;let{args:h,warnings:w,betas:N,usesJsonResponseTool:c,toolNameMapping:R,providerOptionsName:a,usedCustomProviderKey:S}=await this.getArgs({...Q,stream:!1,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),B=[...this.extractCitationDocuments(Q.prompt)],g=IG(h.tools),{responseHeaders:m,value:O,rawValue:e}=await VG({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:N,headers:Q.headers}),body:this.transformRequestBody(h,N),failedResponseHandler:yG,successfulResponseHandler:mG(oG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),C=[],s={},QG={},YG=!1;for(let Y of O.content)switch(Y.type){case"text":{if(!c){if(C.push({type:"text",text:Y.text}),Y.citations)for(let j of Y.citations){let M=BG(j,B,this.generateId);if(M)C.push(M)}}break}case"thinking":{C.push({type:"reasoning",text:Y.thinking,providerMetadata:{anthropic:{signature:Y.signature}}});break}case"redacted_thinking":{C.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:Y.data}}});break}case"compaction":{C.push({type:"text",text:Y.content,providerMetadata:{anthropic:{type:"compaction"}}});break}case"tool_use":{if(c&&Y.name==="json")YG=!0,C.push({type:"text",text:JSON.stringify(Y.input)});else{let M=Y.caller,p=M?{type:M.type,toolId:"tool_id"in M?M.tool_id:void 0}:void 0;C.push({type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),...p&&{providerMetadata:{anthropic:{caller:p}}}})}break}case"server_tool_use":{if(Y.name==="text_editor_code_execution"||Y.name==="bash_code_execution")C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName("code_execution"),input:JSON.stringify({type:Y.name,...Y.input}),providerExecuted:!0});else if(Y.name==="web_search"||Y.name==="code_execution"||Y.name==="web_fetch"){let j=Y.name==="code_execution"&&Y.input!=null&&typeof Y.input==="object"&&"code"in Y.input&&!("type"in Y.input)?{type:"programmatic-tool-call",...Y.input}:Y.input;C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(j),providerExecuted:!0,...g&&Y.name==="code_execution"?{dynamic:!0}:{}})}else if(Y.name==="tool_search_tool_regex"||Y.name==="tool_search_tool_bm25")QG[Y.id]=Y.name,C.push({type:"tool-call",toolCallId:Y.id,toolName:R.toCustomToolName(Y.name),input:JSON.stringify(Y.input),providerExecuted:!0});break}case"mcp_tool_use":{s[Y.id]={type:"tool-call",toolCallId:Y.id,toolName:Y.name,input:JSON.stringify(Y.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:Y.server_name}}},C.push(s[Y.id]);break}case"mcp_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:s[Y.tool_use_id].toolName,isError:Y.is_error,result:Y.content,dynamic:!0,providerMetadata:s[Y.tool_use_id].providerMetadata});break}case"web_fetch_tool_result":{if(Y.content.type==="web_fetch_result")B.push({title:(H=Y.content.content.title)!=null?H:Y.content.url,mediaType:Y.content.content.source.media_type}),C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:Y.content.url,retrievedAt:Y.content.retrieved_at,content:{type:Y.content.content.type,title:Y.content.content.title,citations:Y.content.content.citations,source:{type:Y.content.content.source.type,mediaType:Y.content.content.source.media_type,data:Y.content.content.source.data}}}});else if(Y.content.type==="web_fetch_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:Y.content.error_code}});break}case"web_search_tool_result":{if(Array.isArray(Y.content)){C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),result:Y.content.map((j)=>{var M;return{url:j.url,title:j.title,pageAge:(M=j.page_age)!=null?M:null,encryptedContent:j.encrypted_content,type:j.type}})});for(let j of Y.content)C.push({type:"source",sourceType:"url",id:this.generateId(),url:j.url,title:j.title,providerMetadata:{anthropic:{pageAge:(Z=j.page_age)!=null?Z:null}}})}else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:Y.content.error_code}});break}case"code_execution_tool_result":{if(Y.content.type==="code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,stdout:Y.content.stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(q=Y.content.content)!=null?q:[]}});else if(Y.content.type==="encrypted_code_execution_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:{type:Y.content.type,encrypted_stdout:Y.content.encrypted_stdout,stderr:Y.content.stderr,return_code:Y.content.return_code,content:(E=Y.content.content)!=null?E:[]}});else if(Y.content.type==="code_execution_tool_result_error")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:Y.content.error_code}});break}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName("code_execution"),result:Y.content});break}case"tool_search_tool_result":{let j=QG[Y.tool_use_id];if(j==null){let M=R.toCustomToolName("tool_search_tool_bm25"),p=R.toCustomToolName("tool_search_tool_regex");if(M!=="tool_search_tool_bm25")j="tool_search_tool_bm25";else if(p!=="tool_search_tool_regex")j="tool_search_tool_regex";else j="tool_search_tool_regex"}if(Y.content.type==="tool_search_tool_search_result")C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),result:Y.content.tool_references.map((M)=>({type:M.type,toolName:M.tool_name}))});else C.push({type:"tool-result",toolCallId:Y.tool_use_id,toolName:R.toCustomToolName(j),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:Y.content.error_code}});break}}return{content:C,finishReason:{unified:JG({finishReason:O.stop_reason,isJsonResponseFromTool:YG}),raw:(T=O.stop_reason)!=null?T:void 0},usage:fG({usage:O.usage}),request:{body:h},response:{id:(b=O.id)!=null?b:void 0,modelId:(F=O.model)!=null?F:void 0,headers:m,body:e},warnings:w,providerMetadata:(()=>{var Y,j,M,p,XG;let zG={usage:O.usage,cacheCreationInputTokens:(Y=O.usage.cache_creation_input_tokens)!=null?Y:null,stopSequence:(j=O.stop_sequence)!=null?j:null,iterations:O.usage.iterations?O.usage.iterations.map((v)=>({type:v.type,inputTokens:v.input_tokens,outputTokens:v.output_tokens})):null,container:O.container?{expiresAt:O.container.expires_at,id:O.container.id,skills:(p=(M=O.container.skills)==null?void 0:M.map((v)=>({type:v.type,skillId:v.skill_id,version:v.version})))!=null?p:null}:null,contextManagement:(XG=wG(O.context_management))!=null?XG:null},L={anthropic:zG};if(S&&a!=="anthropic")L[a]=zG;return L})()}}async doStream(Q){var H,Z;let{args:q,warnings:E,betas:T,usesJsonResponseTool:b,toolNameMapping:F,providerOptionsName:h,usedCustomProviderKey:w}=await this.getArgs({...Q,stream:!0,userSuppliedBetas:await this.getBetasFromHeaders(Q.headers)}),N=[...this.extractCitationDocuments(Q.prompt)],c=IG(q.tools),R=this.buildRequestUrl(!0),{responseHeaders:a,value:S}=await VG({url:R,headers:await this.getHeaders({betas:T,headers:Q.headers}),body:this.transformRequestBody(q,T),failedResponseHandler:yG,successfulResponseHandler:gG(tG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),B={unified:"other",raw:void 0},g={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,iterations:null},m={},O={},e={},C=null,s=void 0,QG=null,YG=null,Y=null,j=!1,M=void 0,p=this.generateId,XG=S.pipeThrough(new TransformStream({start(k){k.enqueue({type:"stream-start",warnings:E})},transform(k,V){var ZG,I,o,t,r,i,x,n,z,d,P,U,D,A;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:k.rawValue});if(!k.success){V.enqueue({type:"error",error:k.error});return}let $=k.value;switch($.type){case"ping":return;case"content_block_start":{let X=$.content_block,f=X.type;switch(M=f,f){case"text":{if(b)return;m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});return}case"thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index)});return}case"redacted_thinking":{m[$.index]={type:"reasoning"},V.enqueue({type:"reasoning-start",id:String($.index),providerMetadata:{anthropic:{redactedData:X.data}}});return}case"compaction":{m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index),providerMetadata:{anthropic:{type:"compaction"}}});return}case"tool_use":{if(b&&X.name==="json")j=!0,m[$.index]={type:"text"},V.enqueue({type:"text-start",id:String($.index)});else{let _=X.caller,$G=_?{type:_.type,toolId:"tool_id"in _?_.tool_id:void 0}:void 0,qG=X.input&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:qG,firstDelta:qG.length===0,...$G&&{caller:$G}},V.enqueue({type:"tool-input-start",id:X.id,toolName:X.name})}return}case"server_tool_use":{if(["web_fetch","web_search","code_execution","text_editor_code_execution","bash_code_execution"].includes(X.name)){let K=X.name==="text_editor_code_execution"||X.name==="bash_code_execution"?"code_execution":X.name,_=F.toCustomToolName(K),$G=X.input!=null&&typeof X.input==="object"&&Object.keys(X.input).length>0?JSON.stringify(X.input):"";m[$.index]={type:"tool-call",toolCallId:X.id,toolName:_,input:$G,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{},firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:_,providerExecuted:!0,...c&&K==="code_execution"?{dynamic:!0}:{}})}else if(X.name==="tool_search_tool_regex"||X.name==="tool_search_tool_bm25"){e[X.id]=X.name;let K=F.toCustomToolName(X.name);m[$.index]={type:"tool-call",toolCallId:X.id,toolName:K,input:"",providerExecuted:!0,firstDelta:!0,providerToolName:X.name},V.enqueue({type:"tool-input-start",id:X.id,toolName:K,providerExecuted:!0})}return}case"web_fetch_tool_result":{if(X.content.type==="web_fetch_result")N.push({title:(ZG=X.content.content.title)!=null?ZG:X.content.url,mediaType:X.content.content.source.media_type}),V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),result:{type:"web_fetch_result",url:X.content.url,retrievedAt:X.content.retrieved_at,content:{type:X.content.content.type,title:X.content.content.title,citations:X.content.content.citations,source:{type:X.content.content.source.type,mediaType:X.content.content.source.media_type,data:X.content.content.source.data}}}});else if(X.content.type==="web_fetch_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_fetch"),isError:!0,result:{type:"web_fetch_tool_result_error",errorCode:X.content.error_code}});return}case"web_search_tool_result":{if(Array.isArray(X.content)){V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),result:X.content.map((K)=>{var _;return{url:K.url,title:K.title,pageAge:(_=K.page_age)!=null?_:null,encryptedContent:K.encrypted_content,type:K.type}})});for(let K of X.content)V.enqueue({type:"source",sourceType:"url",id:p(),url:K.url,title:K.title,providerMetadata:{anthropic:{pageAge:(I=K.page_age)!=null?I:null}}})}else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("web_search"),isError:!0,result:{type:"web_search_tool_result_error",errorCode:X.content.error_code}});return}case"code_execution_tool_result":{if(X.content.type==="code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,stdout:X.content.stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(o=X.content.content)!=null?o:[]}});else if(X.content.type==="encrypted_code_execution_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:{type:X.content.type,encrypted_stdout:X.content.encrypted_stdout,stderr:X.content.stderr,return_code:X.content.return_code,content:(t=X.content.content)!=null?t:[]}});else if(X.content.type==="code_execution_tool_result_error")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),isError:!0,result:{type:"code_execution_tool_result_error",errorCode:X.content.error_code}});return}case"bash_code_execution_tool_result":case"text_editor_code_execution_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName("code_execution"),result:X.content});return}case"tool_search_tool_result":{let K=e[X.tool_use_id];if(K==null){let _=F.toCustomToolName("tool_search_tool_bm25"),$G=F.toCustomToolName("tool_search_tool_regex");if(_!=="tool_search_tool_bm25")K="tool_search_tool_bm25";else if($G!=="tool_search_tool_regex")K="tool_search_tool_regex";else K="tool_search_tool_regex"}if(X.content.type==="tool_search_tool_search_result")V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),result:X.content.tool_references.map((_)=>({type:_.type,toolName:_.tool_name}))});else V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:F.toCustomToolName(K),isError:!0,result:{type:"tool_search_tool_result_error",errorCode:X.content.error_code}});return}case"mcp_tool_use":{O[X.id]={type:"tool-call",toolCallId:X.id,toolName:X.name,input:JSON.stringify(X.input),providerExecuted:!0,dynamic:!0,providerMetadata:{anthropic:{type:"mcp-tool-use",serverName:X.server_name}}},V.enqueue(O[X.id]);return}case"mcp_tool_result":{V.enqueue({type:"tool-result",toolCallId:X.tool_use_id,toolName:O[X.tool_use_id].toolName,isError:X.is_error,result:X.content,dynamic:!0,providerMetadata:O[X.tool_use_id].providerMetadata});return}default:throw Error(`Unsupported content block type: ${f}`)}}case"content_block_stop":{if(m[$.index]!=null){let X=m[$.index];switch(X.type){case"text":{V.enqueue({type:"text-end",id:String($.index)});break}case"reasoning":{V.enqueue({type:"reasoning-end",id:String($.index)});break}case"tool-call":if(!(b&&X.toolName==="json")){V.enqueue({type:"tool-input-end",id:X.toolCallId});let K=X.input===""?"{}":X.input;if(X.providerToolName==="code_execution")try{let _=JSON.parse(K);if(_!=null&&typeof _==="object"&&"code"in _&&!("type"in _))K=JSON.stringify({type:"programmatic-tool-call",..._})}catch(_){}V.enqueue({type:"tool-call",toolCallId:X.toolCallId,toolName:X.toolName,input:K,providerExecuted:X.providerExecuted,...c&&X.providerToolName==="code_execution"?{dynamic:!0}:{},...X.caller&&{providerMetadata:{anthropic:{caller:X.caller}}}})}break}delete m[$.index]}M=void 0;return}case"content_block_delta":{let X=$.delta.type;switch(X){case"text_delta":{if(b)return;V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.text});return}case"thinking_delta":{V.enqueue({type:"reasoning-delta",id:String($.index),delta:$.delta.thinking});return}case"signature_delta":{if(M==="thinking")V.enqueue({type:"reasoning-delta",id:String($.index),delta:"",providerMetadata:{anthropic:{signature:$.delta.signature}}});return}case"compaction_delta":{if($.delta.content!=null)V.enqueue({type:"text-delta",id:String($.index),delta:$.delta.content});return}case"input_json_delta":{let f=m[$.index],K=$.delta.partial_json;if(K.length===0)return;if(j){if((f==null?void 0:f.type)!=="text")return;V.enqueue({type:"text-delta",id:String($.index),delta:K})}else{if((f==null?void 0:f.type)!=="tool-call")return;if(f.firstDelta&&(f.providerToolName==="bash_code_execution"||f.providerToolName==="text_editor_code_execution"))K=`{"type": "${f.providerToolName}",${K.substring(1)}`;V.enqueue({type:"tool-input-delta",id:f.toolCallId,delta:K}),f.input+=K,f.firstDelta=!1}return}case"citations_delta":{let f=$.delta.citation,K=BG(f,N,p);if(K)V.enqueue(K);return}default:throw Error(`Unsupported delta type: ${X}`)}}case"message_start":{if(g.input_tokens=$.message.usage.input_tokens,g.cache_read_input_tokens=(r=$.message.usage.cache_read_input_tokens)!=null?r:0,g.cache_creation_input_tokens=(i=$.message.usage.cache_creation_input_tokens)!=null?i:0,s={...$.message.usage},QG=(x=$.message.usage.cache_creation_input_tokens)!=null?x:null,$.message.container!=null)Y={expiresAt:$.message.container.expires_at,id:$.message.container.id,skills:null};if($.message.stop_reason!=null)B={unified:JG({finishReason:$.message.stop_reason,isJsonResponseFromTool:j}),raw:$.message.stop_reason};if(V.enqueue({type:"response-metadata",id:(n=$.message.id)!=null?n:void 0,modelId:(z=$.message.model)!=null?z:void 0}),$.message.content!=null)for(let X=0;X<$.message.content.length;X++){let f=$.message.content[X];if(f.type==="tool_use"){let K=f.caller,_=K?{type:K.type,toolId:"tool_id"in K?K.tool_id:void 0}:void 0;V.enqueue({type:"tool-input-start",id:f.id,toolName:f.name});let $G=JSON.stringify((d=f.input)!=null?d:{});V.enqueue({type:"tool-input-delta",id:f.id,delta:$G}),V.enqueue({type:"tool-input-end",id:f.id}),V.enqueue({type:"tool-call",toolCallId:f.id,toolName:f.name,input:$G,..._&&{providerMetadata:{anthropic:{caller:_}}}})}}return}case"message_delta":{if($.usage.input_tokens!=null&&g.input_tokens!==$.usage.input_tokens)g.input_tokens=$.usage.input_tokens;if(g.output_tokens=$.usage.output_tokens,$.usage.cache_read_input_tokens!=null)g.cache_read_input_tokens=$.usage.cache_read_input_tokens;if($.usage.cache_creation_input_tokens!=null)g.cache_creation_input_tokens=$.usage.cache_creation_input_tokens,QG=$.usage.cache_creation_input_tokens;if($.usage.iterations!=null)g.iterations=$.usage.iterations;if(B={unified:JG({finishReason:$.delta.stop_reason,isJsonResponseFromTool:j}),raw:(P=$.delta.stop_reason)!=null?P:void 0},YG=(U=$.delta.stop_sequence)!=null?U:null,Y=$.delta.container!=null?{expiresAt:$.delta.container.expires_at,id:$.delta.container.id,skills:(A=(D=$.delta.container.skills)==null?void 0:D.map((X)=>({type:X.type,skillId:X.skill_id,version:X.version})))!=null?A:null}:null,$.context_management)C=wG($.context_management);s={...s,...$.usage};return}case"message_stop":{let X={usage:s!=null?s:null,cacheCreationInputTokens:QG,stopSequence:YG,iterations:g.iterations?g.iterations.map((K)=>({type:K.type,inputTokens:K.input_tokens,outputTokens:K.output_tokens})):null,container:Y,contextManagement:C},f={anthropic:X};if(w&&h!=="anthropic")f[h]=X;V.enqueue({type:"finish",finishReason:B,usage:fG({usage:g,rawUsage:s}),providerMetadata:f});return}case"error":{V.enqueue({type:"error",error:$.error});return}default:throw Error(`Unsupported chunk type: ${$}`)}}})),[zG,L]=XG.tee(),v=zG.getReader();try{await v.read();let k=await v.read();if(((H=k.value)==null?void 0:H.type)==="raw")k=await v.read();if(((Z=k.value)==null?void 0:Z.type)==="error"){let V=k.value.error;throw new NG({message:V.message,url:R,requestBodyValues:q,statusCode:V.type==="overloaded_error"?529:500,responseHeaders:a,responseBody:JSON.stringify(V),isRetryable:V.type==="overloaded_error"})}}finally{v.cancel().catch(()=>{}),v.releaseLock()}return{stream:L,request:{body:q},response:{headers:a}}}};function uQ(Q){if(Q.includes("claude-opus-4-7"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!0,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-6")||Q.includes("claude-opus-4-6"))return{maxOutputTokens:128000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-5")||Q.includes("claude-opus-4-5")||Q.includes("claude-haiku-4-5"))return{maxOutputTokens:64000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-1"))return{maxOutputTokens:32000,supportsStructuredOutput:!0,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-sonnet-4-"))return{maxOutputTokens:64000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-opus-4-"))return{maxOutputTokens:32000,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else if(Q.includes("claude-3-haiku"))return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!0};else return{maxOutputTokens:4096,supportsStructuredOutput:!1,rejectsSamplingParameters:!1,isKnownModel:!1}}function IG(Q){if(!Q)return!1;let H=!1,Z=!1;for(let q of Q){if("type"in q&&(q.type==="web_fetch_20260209"||q.type==="web_search_20260209")){H=!0;continue}if(q.name==="code_execution"){Z=!0;break}}return H&&!Z}function wG(Q){return Q?{appliedEdits:Q.applied_edits.map((H)=>{switch(H.type){case"clear_tool_uses_20250919":return{type:H.type,clearedToolUses:H.cleared_tool_uses,clearedInputTokens:H.cleared_input_tokens};case"clear_thinking_20251015":return{type:H.type,clearedThinkingTurns:H.cleared_thinking_turns,clearedInputTokens:H.cleared_input_tokens};case"compact_20260112":return{type:H.type}}}).filter((H)=>H!==void 0)}:null}var cQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),iQ=u({id:"anthropic.bash_20241022",inputSchema:cQ}),lQ=J(()=>W(G.object({command:G.string(),restart:G.boolean().optional()}))),sQ=u({id:"anthropic.bash_20250124",inputSchema:lQ}),pQ=J(()=>W(G.object({action:G.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:G.array(G.number().int()).optional(),text:G.string().optional()}))),nQ=u({id:"anthropic.computer_20241022",inputSchema:pQ}),rQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),aQ=u({id:"anthropic.computer_20250124",inputSchema:rQ}),eQ=J(()=>W(G.object({action:G.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot","zoom"]),coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),duration:G.number().optional(),region:G.tuple([G.number().int(),G.number().int(),G.number().int(),G.number().int()]).optional(),scroll_amount:G.number().optional(),scroll_direction:G.enum(["up","down","left","right"]).optional(),start_coordinate:G.tuple([G.number().int(),G.number().int()]).optional(),text:G.string().optional()}))),oQ=u({id:"anthropic.computer_20251124",inputSchema:eQ}),tQ=J(()=>W(G.discriminatedUnion("command",[G.object({command:G.literal("view"),path:G.string(),view_range:G.tuple([G.number(),G.number()]).optional()}),G.object({command:G.literal("create"),path:G.string(),file_text:G.string()}),G.object({command:G.literal("str_replace"),path:G.string(),old_str:G.string(),new_str:G.string()}),G.object({command:G.literal("insert"),path:G.string(),insert_line:G.number(),insert_text:G.string()}),G.object({command:G.literal("delete"),path:G.string()}),G.object({command:G.literal("rename"),old_path:G.string(),new_path:G.string()})]))),GX=u({id:"anthropic.memory_20250818",inputSchema:tQ}),QX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),XX=u({id:"anthropic.text_editor_20241022",inputSchema:QX}),YX=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert","undo_edit"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),ZX=u({id:"anthropic.text_editor_20250124",inputSchema:YX}),$X=J(()=>W(G.object({command:G.enum(["view","create","str_replace","insert"]),path:G.string(),file_text:G.string().optional(),insert_line:G.number().int().optional(),new_str:G.string().optional(),insert_text:G.string().optional(),old_str:G.string().optional(),view_range:G.array(G.number().int()).optional()}))),zX=u({id:"anthropic.text_editor_20250429",inputSchema:$X}),LX=J(()=>W(G.array(G.object({type:G.literal("tool_reference"),toolName:G.string()})))),HX=J(()=>W(G.object({query:G.string(),limit:G.number().optional()}))),qX=l({id:"anthropic.tool_search_bm25_20251119",inputSchema:HX,outputSchema:LX,supportsDeferredResults:!0}),AX=(Q={})=>{return qX(Q)},KX={bash_20241022:iQ,bash_20250124:sQ,codeExecution_20250522:IQ,codeExecution_20250825:MQ,codeExecution_20260120:TQ,computer_20241022:nQ,computer_20250124:aQ,computer_20251124:oQ,memory_20250818:GX,textEditor_20241022:XX,textEditor_20250124:ZX,textEditor_20250429:zX,textEditor_20250728:$Q,webFetch_20250910:xQ,webFetch_20260209:EQ,webSearch_20250305:WQ,webSearch_20260209:AQ,toolSearchRegex_20251119:vQ,toolSearchBm25_20251119:AX};function DX(Q={}){var H,Z;let q=(H=dG(_G({settingValue:Q.baseURL,environmentVariableName:"ANTHROPIC_BASE_URL"})))!=null?H:"https://api.anthropic.com/v1",E=(Z=Q.name)!=null?Z:"anthropic.messages";if(Q.apiKey&&Q.authToken)throw new MG({argument:"apiKey/authToken",message:"Both apiKey and authToken were provided. Please use only one authentication method."});let T=()=>{let h=Q.authToken?{Authorization:`Bearer ${Q.authToken}`}:{"x-api-key":vG({apiKey:Q.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"})};return OG({"anthropic-version":"2023-06-01",...h,...Q.headers},`ai-sdk/anthropic/${aG}`)},b=(h)=>{var w;return new dQ(h,{provider:E,baseURL:q,headers:T,fetch:Q.fetch,generateId:(w=Q.generateId)!=null?w:AG,supportedUrls:()=>({"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]})})},F=function(h){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return b(h)};return F.specificationVersion="v3",F.languageModel=b,F.chat=b,F.messages=b,F.embeddingModel=(h)=>{throw new WG({modelId:h,modelType:"embeddingModel"})},F.textEmbeddingModel=F.embeddingModel,F.imageModel=(h)=>{throw new WG({modelId:h,modelType:"imageModel"})},F.tools=KX,F}var KY=DX();function DY({steps:Q}){var H,Z,q;for(let E=Q.length-1;E>=0;E--){let T=(q=(Z=(H=Q[E].providerMetadata)==null?void 0:H.anthropic)==null?void 0:Z.container)==null?void 0:q.id;if(T)return{providerOptions:{anthropic:{container:{id:T}}}}}return}export{DY as forwardAnthropicContainerIdFromLastStep,DX as createAnthropic,KY as anthropic,aG as VERSION};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-e0vrxetq.js";var e={"ui.sessionReview.title":"Cambios de la sesi\xF3n","ui.sessionReview.title.lastTurn":"Cambios del \xFAltimo turno","ui.sessionReview.diffStyle.unified":"Unificado","ui.sessionReview.diffStyle.split":"Dividido","ui.sessionReview.openFile":"Abrir archivo","ui.sessionReview.selection.line":"l\xEDnea {{line}}","ui.sessionReview.selection.lines":"l\xEDneas {{start}}-{{end}}","ui.sessionReview.expandAll":"Expandir todo","ui.sessionReview.collapseAll":"Colapsar todo","ui.sessionReview.change.added":"A\xF1adido","ui.sessionReview.change.removed":"Eliminado","ui.sessionReview.change.modified":"Modificado","ui.sessionReview.image.loading":"Cargando...","ui.sessionReview.image.placeholder":"Imagen","ui.sessionReview.largeDiff.title":"Diff demasiado grande para renderizar","ui.sessionReview.largeDiff.meta":"L\xEDmite: {{limit}} l\xEDneas modificadas. Actual: {{current}} l\xEDneas modificadas.","ui.sessionReview.largeDiff.renderAnyway":"Renderizar de todos modos","ui.fileMedia.kind.image":"imagen","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Archivo de {{kind}} eliminado","ui.fileMedia.state.loading":"Cargando archivo de {{kind}}","ui.fileMedia.state.error":"Error en el archivo de {{kind}}","ui.fileMedia.state.unavailable":"Archivo de {{kind}} no disponible","ui.fileMedia.binary.title":"Archivo binario","ui.fileMedia.binary.description.path":"No se puede mostrar {{path}} porque es un archivo binario.","ui.fileMedia.binary.description.default":"No se puede mostrar este archivo porque es un archivo binario.","ui.lineComment.label.prefix":"Comentar en ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Comentando en ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"A\xF1adir comentario","ui.lineComment.submit":"Comentar","ui.sessionTurn.steps.show":"Mostrar pasos","ui.sessionTurn.steps.hide":"Ocultar pasos","ui.sessionTurn.summary.response":"Respuesta","ui.sessionTurn.diff.showMore":"Mostrar m\xE1s cambios ({{count}})","ui.sessionTurn.retry.retrying":"reintentando","ui.sessionTurn.retry.inSeconds":"en {{seconds}}s","ui.sessionTurn.retry.attempt":"intento #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - intento #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini est\xE1 demasiado saturado","ui.sessionTurn.error.freeUsageExceeded":"L\xEDmite de uso gratuito excedido","ui.sessionTurn.error.addQredits":"A\xF1adir cr\xE9ditos","ui.sessionTurn.status.delegating":"Delegando trabajo","ui.sessionTurn.status.planning":"Planificando siguientes pasos","ui.sessionTurn.status.gatheringContext":"Explorando","ui.sessionTurn.status.gatheredContext":"Explorado","ui.sessionTurn.status.searchingCodebase":"Buscando en la base de c\xF3digo","ui.sessionTurn.status.searchingWeb":"Buscando en la web","ui.sessionTurn.status.makingEdits":"Realizando ediciones","ui.sessionTurn.status.runningCommands":"Ejecutando comandos","ui.sessionTurn.status.thinking":"Pensando","ui.sessionTurn.status.thinkingWithTopic":"Pensando - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Recopilando pensamientos","ui.sessionTurn.status.consideringNextSteps":"Considerando siguientes pasos","ui.messagePart.questions.dismissed":"Preguntas descartadas","ui.messagePart.compaction":"Sesi\xF3n compactada","ui.messagePart.context.read.one":"{{count}} lectura","ui.messagePart.context.read.other":"{{count}} lecturas","ui.messagePart.context.search.one":"{{count}} b\xFAsqueda","ui.messagePart.context.search.other":"{{count}} b\xFAsquedas","ui.messagePart.context.list.one":"{{count}} lista","ui.messagePart.context.list.other":"{{count}} listas","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Editar","ui.messagePart.title.write":"Escribir","ui.messagePart.option.typeOwnAnswer":"Escribe tu propia respuesta","ui.messagePart.review.title":"Revisa tus respuestas","ui.list.loading":"Cargando","ui.list.empty":"Sin resultados","ui.list.clearFilter":"Borrar filtro","ui.list.emptyWithFilter.prefix":"Sin resultados para","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Nuevo mensaje","ui.textField.copyToClipboard":"Copiar al portapapeles","ui.textField.copyLink":"Copiar enlace","ui.textField.copied":"Copiado","ui.imagePreview.alt":"Vista previa de imagen","ui.scrollView.ariaLabel":"contenido desplazable","ui.tool.read":"Leer","ui.tool.loaded":"Cargado","ui.tool.list":"Listar","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"B\xFAsqueda web","ui.tool.codesearch":"B\xFAsqueda de c\xF3digo","ui.tool.shell":"Shell","ui.tool.patch":"Parche","ui.tool.todos":"Tareas","ui.tool.todos.read":"Leer tareas","ui.tool.questions":"Preguntas","ui.tool.agent":"Agente {{type}}","ui.tool.agent.default":"Agente","ui.common.file.one":"archivo","ui.common.file.other":"archivos","ui.common.question.one":"pregunta","ui.common.question.other":"preguntas","ui.common.add":"A\xF1adir","ui.common.back":"Atr\xE1s","ui.common.cancel":"Cancelar","ui.common.confirm":"Confirmar","ui.common.dismiss":"Descartar","ui.common.close":"Cerrar","ui.common.next":"Siguiente","ui.common.submit":"Enviar","ui.permission.deny":"Denegar","ui.permission.allowAlways":"Permitir siempre","ui.permission.allowOnce":"Permitir una vez","ui.message.expand":"Expandir mensaje","ui.message.collapse":"Colapsar mensaje","ui.message.copy":"Copiar","ui.message.copyMessage":"Copiar mensaje","ui.message.forkMessage":"Bifurcar a nueva sesi\xF3n","ui.message.revertMessage":"Restablecer a este punto","ui.message.copyResponse":"Copiar respuesta","ui.message.copied":"\xA1Copiado!","ui.message.interrupted":"Interrumpido","ui.message.queued":"En cola","ui.message.attachment.alt":"adjunto","ui.patch.action.deleted":"Eliminado","ui.patch.action.created":"Creado","ui.patch.action.moved":"Movido","ui.patch.action.patched":"Parcheado","ui.question.subtitle.answered":"{{count}} respondidas","ui.question.answer.none":"(sin respuesta)","ui.question.review.notAnswered":"(no respondida)","ui.question.multiHint":"Selecciona todas las que correspondan","ui.question.singleHint":"Selecciona una respuesta","ui.question.custom.placeholder":"Escribe tu respuesta...","ui.fileSearch.placeholder":"Buscar","ui.fileSearch.previousMatch":"Anterior","ui.fileSearch.nextMatch":"Siguiente","ui.fileSearch.close":"Cerrar b\xFAsqueda","ui.tool.task":"Tarea","ui.tool.skill":"Habilidad","ui.basicTool.called":"Llamado `{{tool}}`","ui.toolErrorCard.failed":"Fall\xF3","ui.toolErrorCard.copyError":"Copiar error","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s"};export{e as dict};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$j as
|
|
2
|
+
import{$j as u,Ij as s,Nj as e,Oj as j,Pj as v,ak as f}from"./chunk-qq9m8fxv.js";import{El as D,Il as b,Jl as a,Kl as t,vl as r,wl as C,xl as k,yl as m}from"./chunk-tsmj98yf.js";import{Bm as K,Dm as c,Km as i,vm as x,wm as q,ym as n,zm as o}from"./chunk-rmsqb6r4.js";import{Xs as Q_}from"./chunk-59csnjc3.js";import{bt as d,gt as g,lt as O_}from"./chunk-1bxfzd6r.js";import{vO as S_}from"./chunk-e0vrxetq.js";var l={};S_(l,{run:()=>h_,encodeDir:()=>k_,ClaudeImport:()=>l});import E_ from"path";import W_ from"path";import{access as X_,readFile as Y_}from"fs/promises";var G=n("external_import",{source:q().$type().notNull(),source_key:q().notNull(),session_id:q().$type().notNull(),source_path:q().notNull(),source_mtime:x().notNull(),time_imported:x().notNull(),message_ids:q({mode:"json"}).$type()},(N)=>[o({columns:[N.source,N.source_key]})]);function Z_(){return{scanned:0,imported:0,resynced:0,skipped:0,errors:[]}}async function L_(N){if(!N||!await g.exists(N))return{id:b.global,worktree:N||"/",vcs:null};if(!await a(N))return{id:b.global,worktree:N,vcs:null};return{id:await t(N),worktree:N,vcs:"git"}}function __(N){return N.split(`
|
|
3
3
|
`).map((_)=>_.trim()).filter(Boolean).flatMap((_)=>{try{return[JSON.parse(_)]}catch{return[]}})}function N_(N){let _=N.find((H)=>H.trim()&&!H.trim().startsWith("<"));if(!_)return;return _.trim().replace(/\s+/g," ").slice(0,100)}function R_(N,_){return D.use((H)=>H.select().from(G).where(c(K(G.source,N),K(G.source_key,_))).get())}function G_(N,_){if(!_)return{existing:void 0,existingUpdated:void 0};let H=_,O=D.use((Z)=>Z.select({updated:C.time_updated}).from(C).where(K(C.id,H.session_id)).get());if(!O)return D.use((Z)=>Z.delete(G).where(c(K(G.source,N),K(G.source_key,H.source_key))).run()),{existing:void 0,existingUpdated:void 0};return{existing:_,existingUpdated:O.updated}}function J_(N,_,H,O){N.insert(r).values({id:_.id,worktree:_.worktree,vcs:_.vcs,sandboxes:[],time_created:H,time_updated:O}).onConflictDoNothing().run()}function K_(N,_,H){if(_.message_ids?.length)for(let O=0;O<_.message_ids.length;O+=500)N.delete(k).where(i(k.id,_.message_ids.slice(O,O+500))).run();else N.delete(k).where(K(k.session_id,H)).run()}function A_(N,_,H){N.update(C).set({project_id:H.projectId,directory:H.directory,version:H.version,time_updated:Math.max(H.existingUpdated??0,H.timeUpdated)}).where(K(C.id,_)).run()}function $_(N){return async(_)=>F_({...N,force:_?.force})}async function F_(N){let _=Z_();if(!await X_(N.root).then(()=>!0).catch(()=>!1))return _;let H=await d.scan(N.pattern,{cwd:N.root,absolute:!0});for(let O of H){_.scanned++;try{let Z=W_.basename(O,".jsonl"),A=await g.statAsync(O);if(!A){_.skipped++;continue}let F=Math.floor(Number(A.mtimeMs)),Y=R_(N.source,Z);if(Y&&Y.source_mtime===F&&!N.force){_.skipped++;continue}let S=G_(N.source,Y);Y=S.existing;let T=S.existingUpdated,Q=Y?Y.session_id:e.descending(),V=N.parse(await Y_(O,"utf-8"),Q);if(!V||V.messages.length===0){_.skipped++;continue}let E=await L_(V.cwd),U=Date.now(),X=V.messages.map(($)=>$.info.id);if(D.transaction(($)=>{if(J_($,E,V.timeCreated,V.timeUpdated),Y)K_($,Y,Q),A_($,Q,{projectId:E.id,directory:V.cwd,version:V.version,existingUpdated:T,timeUpdated:V.timeUpdated});else $.insert(C).values({id:Q,project_id:E.id,slug:s.create(),directory:V.cwd,title:V.title,version:V.version,time_created:V.timeCreated,time_updated:V.timeUpdated}).run();for(let L of V.messages){let{id:B,sessionID:I,agentID:w,...z}=L.info;$.insert(k).values({id:B,session_id:Q,agent_id:"main",time_created:L.info.time.created,data:z}).onConflictDoUpdate({target:k.id,set:{data:z}}).run();for(let J of L.parts){let{id:y,sessionID:p,messageID:P,...h}=J.part;$.insert(m).values({id:y,message_id:L.info.id,session_id:Q,time_created:J.time,data:h}).onConflictDoUpdate({target:m.id,set:{data:h}}).run()}}$.insert(G).values({source:N.source,source_key:Z,session_id:Q,source_path:O,source_mtime:F,time_imported:U,message_ids:X}).onConflictDoUpdate({target:[G.source,G.source_key],set:{session_id:Q,source_path:O,source_mtime:F,time_imported:U,message_ids:X}}).run()}),Y)_.resynced++;else _.imported++}catch(Z){_.errors.push(`${O}: ${Z}`)}}if(_.imported+_.resynced>0||_.errors.length>0)N.log.info(N.logMessage,{..._,errors:_.errors.length});return _}var B_=Q_.create({service:"claude-import"});function k_(N){return N.replace(/[^a-zA-Z0-9]/g,"-")}function z_(N){if(!N)return{providerID:u.anthropic,modelID:f.make("unknown")};let _=N.indexOf("/");if(_===-1)return{providerID:u.anthropic,modelID:f.make(N)};return{providerID:u.make(N.slice(0,_)),modelID:f.make(N.slice(_+1))}}function H_(N){let _=N??{};return{input:_.input_tokens??0,output:_.output_tokens??0,reasoning:0,cache:{read:_.cache_read_input_tokens??0,write:_.cache_creation_input_tokens??0}}}function C_(N){if(typeof N==="string")return N;if(Array.isArray(N))return N.map((_)=>_&&typeof _==="object"&&("type"in _)&&_.type==="text"?_.text:JSON.stringify(_)).join(`
|
|
4
4
|
`);return N==null?"":JSON.stringify(N)}function U_(N,_){let H=__(N);if(H.length===0)return;let O,Z,A,F=0,Y,S=[],T=new Map,Q=null,V=null,E=z_(void 0),U=()=>{if(Q)S.push(Q);Q=null};for(let X of H){if(X.type!=="user"&&X.type!=="assistant")continue;let $=X.timestamp?Date.parse(X.timestamp):Date.now();if(!O&&X.cwd)O=X.cwd;if(!Z&&X.version)Z=X.version;if(A===void 0)A=$;F=Math.max(F,$);let L=X.message;if(!L)continue;if(X.type==="user"){let z=L.content,J=typeof z==="string"?[]:Array.isArray(z)?z:[];for(let W of J.filter((R)=>R?.type==="tool_result")){let R=T.get(W.tool_use_id);if(!R)continue;let M=C_(W.content);R.part.state=W.is_error?{status:"error",input:R.part.state.input??{},error:M,time:{start:R.start,end:$}}:{status:"completed",input:R.part.state.input??{},output:M,title:R.part.tool,metadata:{},time:{start:R.start,end:$}}}let y=typeof z==="string"?z.trim()?[z]:[]:J.filter((W)=>W?.type==="text"&&typeof W.text==="string"&&W.text.trim()).map((W)=>W.text),p=J.filter((W)=>W?.type==="image"&&W.source);if(y.length===0&&p.length===0)continue;U();let P=j.ascending(),h=[];for(let W of y)h.push({part:{id:v.ascending(),sessionID:_,messageID:P,type:"text",text:W},time:$});for(let W of p){let R=W.source.media_type??"image/png",M=W.source.type==="base64"?`data:${R};base64,${W.source.data}`:W.source.url??"";if(M)h.push({part:{id:v.ascending(),sessionID:_,messageID:P,type:"file",mime:R,url:M},time:$})}let V_={id:P,sessionID:_,role:"user",agent:"main",time:{created:$},model:{providerID:E.providerID,modelID:E.modelID}};if(S.push({info:V_,parts:h}),V=P,!Y)Y=N_(y);continue}let B=z_(L.model);if(E=B,!V){let z=j.ascending();S.push({info:{id:z,sessionID:_,role:"user",agent:"main",time:{created:$},model:{providerID:B.providerID,modelID:B.modelID}},parts:[]}),V=z}if(!Q||Q.info.role!=="assistant"||Q.info.parentID!==V)U(),Q={info:{id:j.ascending(),sessionID:_,role:"assistant",time:{created:$,completed:$},parentID:V,modelID:B.modelID,providerID:B.providerID,mode:"build",agent:"main",path:{cwd:O??X.cwd??"",root:O??X.cwd??""},cost:0,tokens:H_(L.usage)},parts:[]};let I=Q.info;I.time.completed=$,I.tokens=H_(L.usage);let w=Q.info.id;for(let z of Array.isArray(L.content)?L.content:[])if(z?.type==="thinking"||z?.type==="reasoning")Q.parts.push({part:{id:v.ascending(),sessionID:_,messageID:w,type:"reasoning",text:z.thinking??z.text??"",time:{start:$,end:$}},time:$});else if(z?.type==="text"&&typeof z.text==="string")Q.parts.push({part:{id:v.ascending(),sessionID:_,messageID:w,type:"text",text:z.text},time:$});else if(z?.type==="tool_use"){let J={id:v.ascending(),sessionID:_,messageID:w,type:"tool",callID:z.id,tool:z.name,state:{status:"pending",input:z.input??{},raw:JSON.stringify(z.input??{})}};Q.parts.push({part:J,time:$}),T.set(z.id,{part:J,start:$})}}return U(),{cwd:O??"",version:Z??"claude-code",title:Y??"Claude Code session",timeCreated:A??Date.now(),timeUpdated:F||A||Date.now(),messages:S}}var h_=$_({source:"cc",root:E_.join(O_.Path.home,".claude","projects"),pattern:"*/*.jsonl",log:B_,logMessage:"claude import",parse:U_});
|
|
5
|
-
export{G as
|
|
5
|
+
export{G as mg,Z_ as ng,L_ as og,__ as pg,N_ as qg,R_ as rg,G_ as sg,J_ as tg,K_ as ug,A_ as vg,$_ as wg,k_ as xg,h_ as yg,l as zg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Of as l}from"./chunk-ahmy80vb.js";import"./chunk-p8ak162p.js";import{Jg as q}from"./chunk-brk6bge4.js";import"./chunk-nfg7nt13.js";import"./chunk-qgkb6n8k.js";import{xO as C}from"./chunk-e0vrxetq.js";function J(){return async(f,b)=>{if("_zod"in f)return l()(f,{components:b.components,options:{io:"input",...b.options}});try{let{createSchema:w}=await import("./chunk-9cf2ktyh.js"),{schema:B,components:k}=w(f,{schemaType:"input",...b.options});if(k)b.components.schemas={...b.components.schemas,...k};return B}catch{throw Error(q('Missing dependencies "zod-openapi v4".'))}}}export{J as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{D as
|
|
2
|
+
import{es as X}from"./chunk-wb05bp10.js";function D(j){return j.parserConfiguration({"populate--":!0}).scriptName("qitqode").wrap(100).help("help","show help").alias("help","h").version("version","show version number",X).alias("version","v").option("print-logs",{describe:"print logs to stderr",type:"boolean"}).option("log-level",{describe:"log level",type:"string",choices:["DEBUG","INFO","WARN","ERROR"]}).option("pure",{describe:"run without external plugins",type:"boolean"})}var H={port:{type:"number",describe:"port to listen on",default:0},hostname:{type:"string",describe:"hostname to listen on",default:"127.0.0.1"},mdns:{type:"boolean",describe:"enable mDNS service discovery (defaults hostname to 0.0.0.0)",default:!1},"mdns-domain":{type:"string",describe:"custom domain name for mDNS service (default: qitqode.local)",default:"qitqode.local"},cors:{type:"string",array:!0,describe:"additional domains to allow for CORS",default:[]},"no-auth":{type:"boolean",describe:"allow starting without authentication on non-loopback addresses (DANGEROUS)",default:!1}};function u(j){return j.options(H)}function F(j,z=process.argv){return z.some((B)=>B===j||B.startsWith(`${j}=`))}function P(j,z=process.argv){return F("--port",z)||F("--hostname",z)||F("--mdns",z)||!!j.mdns||j.port!==0||j.hostname!=="127.0.0.1"}function _(j,z,B=process.argv){let J=F("--port",B),Z=F("--hostname",B),$=F("--mdns",B),q=F("--mdns-domain",B),K=$?j.mdns:z?.server?.mdns??j.mdns,M=q?j["mdns-domain"]:z?.server?.mdnsDomain??j["mdns-domain"],N=J?j.port:z?.server?.port??j.port,U=Z?j.hostname:K&&!z?.server?.hostname?"0.0.0.0":z?.server?.hostname??j.hostname,V=z?.server?.cors??[],Y=Array.isArray(j.cors)?j.cors:j.cors?[j.cors]:[],b=[...V,...Y],A=j["no-auth"];return{hostname:U,port:N,mdns:K,mdnsDomain:M,cors:b,noAuth:A}}var k={model:{type:"string",alias:["m"],describe:"model to use in the format of provider/model"},continue:{alias:["c"],describe:"continue the last session",type:"boolean"},session:{alias:["s"],type:"string",describe:"session id to continue"},fork:{type:"boolean",describe:"fork the session when continuing (use with --continue or --session)"},prompt:{type:"string",describe:"prompt to use"},agent:{type:"string",describe:"agent to use"},dark:{type:"boolean",describe:"start in dark theme (overrides saved theme preference for this launch)"},light:{type:"boolean",describe:"start in light theme (overrides saved theme preference for this launch)"},monochrome:{type:"boolean",describe:"start in monochrome accessible rendering \u2014 no color, plain terminal, screen-reader friendly"},headless:{type:"boolean",describe:"headless permissionless mode for AI subagent use \u2014 auto-approves all tool permissions, implies --never-ask"},fullauto:{type:"boolean",describe:"full-auto mode for the interactive TUI \u2014 never asks: starts in build mode, auto-decides questions and auto-approves every tool permission that is not explicitly denied by your config (dangerous!)"},"api-key":{type:"string",describe:"Qortex API key for non-interactive authentication in headless mode (can also be set via $QLEX_API_KEY)"},sso:{type:"boolean",describe:"sign in via SSO device-code flow before starting a headless session \u2014 prints a URL and code, waits for browser approval (requires --headless)"},free:{type:"boolean",describe:"start in Free tier (no cost) \u2014 shorthand for the Free model tier"},adaptive:{type:"boolean",describe:"start in Adaptive tier \u2014 shorthand for the Adaptive model tier"},fast:{type:"boolean",describe:"start in Fast tier \u2014 shorthand for the Fast model tier"},economical:{type:"boolean",describe:"start in Economical tier \u2014 shorthand for the Economical model tier"},maxInt:{type:"boolean",describe:"start in Max intelligence tier \u2014 shorthand for the Max intelligence model tier"},orchestrated:{type:"boolean",describe:"start in Orchestrated tier \u2014 shorthand for the Orchestrated model tier"}},L=36,W="\x1B[38;5;214m",I="\x1B[0;2m",Q="\x1B[0m";function G(j,z){let B=Math.round(j/100*L),J=`${"\u25A0".repeat(B)}${"\uFF65".repeat(L-B)}`;return`\r${W}${J} ${j.toString().padStart(3)}%${Q} ${I}${z}${Q}`}
|
|
3
|
+
export{D as Xf,H as Yf,u as Zf,P as _f,_ as $f,k as ag,G as bg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Sn as a,Tn as b,Un as c,Vn as d,Wn as e,Xn as f,Yn as g,Zn as h,_n as i}from"./chunk-eewe7tx1.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-e0vrxetq.js";export{i as gateway,h as createGatewayProvider,h as createGateway,g as GatewayResponseError,d as GatewayRateLimitError,e as GatewayModelNotFoundError,c as GatewayInvalidRequestError,f as GatewayInternalServerError,a as GatewayError,b as GatewayAuthenticationError};
|