@qitqode/qitqode-android-arm64 0.1.33 → 0.1.35
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-x4sp99g6.js → chunk-03xppy47.js} +1 -1
- package/bundle/chunk-0442cmw2.js +2 -0
- package/bundle/{chunk-2vn41ecx.js → chunk-04hvaaje.js} +1 -1
- package/bundle/{chunk-6phh70sp.js → chunk-06k6egt2.js} +1 -1
- package/bundle/{chunk-x5trw1f5.js → chunk-085pvqr4.js} +1 -1
- package/bundle/{chunk-8n20thvd.js → chunk-08f4khsw.js} +2 -2
- package/bundle/{chunk-mk1bfzg5.js → chunk-08m0hkdz.js} +1 -1
- package/bundle/{chunk-kfxv5rfg.js → chunk-09pkckr1.js} +1 -1
- package/bundle/{chunk-6kp07m7p.js → chunk-0c6ep9mc.js} +1 -1
- package/bundle/{chunk-0v0vqbn5.js → chunk-0h8wdch6.js} +1 -1
- package/bundle/{chunk-t56r99hp.js → chunk-0msqaywp.js} +1 -1
- package/bundle/chunk-0x5jn813.js +2 -0
- package/bundle/{chunk-yphsjp71.js → chunk-11g2rpv8.js} +1 -1
- package/bundle/{chunk-vhe0tth1.js → chunk-11v7vz3y.js} +1 -1
- package/bundle/{chunk-1sgahe1s.js → chunk-1byd3wma.js} +1 -1
- package/bundle/{chunk-x3y2xzhn.js → chunk-1dtzxt2w.js} +1 -1
- package/bundle/{chunk-31qrzrwy.js → chunk-1gf116rg.js} +1 -1
- package/bundle/{chunk-05mce0j3.js → chunk-1me21qdc.js} +1 -1
- package/bundle/{chunk-rvkrgkeq.js → chunk-1pg6pv0m.js} +1 -1
- package/bundle/{chunk-0bbs01f0.js → chunk-1yt5rsew.js} +1 -1
- package/bundle/chunk-28t9akfn.js +2 -0
- package/bundle/{chunk-52bam8g7.js → chunk-2h1fcqvf.js} +1 -1
- package/bundle/{chunk-vykgpaqt.js → chunk-2kens6wh.js} +1 -1
- package/bundle/chunk-2scyp9ns.js +2 -0
- package/bundle/{chunk-hbbsbyyq.js → chunk-2swch6mx.js} +1 -1
- package/bundle/chunk-2tw58kwb.js +2 -0
- package/bundle/chunk-2vxx0tax.js +2 -0
- package/bundle/chunk-2ybt3p5z.js +2 -0
- package/bundle/chunk-2zpkw3ge.js +2 -0
- package/bundle/{chunk-zzv0yayn.js → chunk-31g86yn6.js} +1 -1
- package/bundle/{chunk-xthkjax9.js → chunk-34p46th6.js} +1 -1
- package/bundle/chunk-397be2x0.js +2 -0
- package/bundle/chunk-3c78nkgn.js +2 -0
- package/bundle/{chunk-g453xy7p.js → chunk-3d91q2qd.js} +1 -1
- package/bundle/{chunk-7xm75w1e.js → chunk-3k2b05fv.js} +1 -1
- package/bundle/{chunk-tvdmnee6.js → chunk-3mzcr3fw.js} +1 -1
- package/bundle/{chunk-enpzvmtc.js → chunk-41v0x1jk.js} +1 -1
- package/bundle/chunk-43yv7tz1.js +2 -0
- package/bundle/chunk-496ajawz.js +2 -0
- package/bundle/{chunk-78ymd20x.js → chunk-499gp5g5.js} +1 -1
- package/bundle/{chunk-ea5ph627.js → chunk-4hzm14xt.js} +1 -1
- package/bundle/{chunk-rzhdkkpz.js → chunk-4ttf9rjd.js} +1 -1
- package/bundle/{chunk-vywnd5sf.js → chunk-4wxxyrxn.js} +1 -1
- package/bundle/chunk-4xw14sed.js +2 -0
- package/bundle/chunk-536naqqv.js +2 -0
- package/bundle/{chunk-0h6rn479.js → chunk-54wh8b12.js} +1 -1
- package/bundle/chunk-57nvmhjq.js +2 -0
- package/bundle/{chunk-60v5jvgt.js → chunk-5a7fs1hg.js} +1 -1
- package/bundle/{chunk-tc18nbmn.js → chunk-5e4fxy99.js} +44 -44
- package/bundle/chunk-5he3d7cy.js +2 -0
- package/bundle/{chunk-r1zf109g.js → chunk-5qr286w8.js} +1 -1
- package/bundle/{chunk-srt5peec.js → chunk-606vpgc4.js} +1 -1
- package/bundle/{chunk-gwp17r03.js → chunk-67d5d8mr.js} +1 -1
- package/bundle/{chunk-gxq9vh1z.js → chunk-6a1skxcj.js} +1 -1
- package/bundle/{chunk-ftnadrks.js → chunk-6a77w77q.js} +1 -1
- package/bundle/{chunk-yek0sk2q.js → chunk-6a7c7wnf.js} +1 -1
- package/bundle/chunk-6cj7cn5x.js +2 -0
- package/bundle/{chunk-fgg9txzb.js → chunk-6gb65bv1.js} +1 -1
- package/bundle/{chunk-rh9vnpgr.js → chunk-6ged58yw.js} +1 -1
- package/bundle/chunk-6hybp2mt.js +2 -0
- package/bundle/{chunk-d6ry9418.js → chunk-6p94fpbn.js} +2 -2
- package/bundle/{chunk-xcmgkc57.js → chunk-6styp5dn.js} +1 -1
- package/bundle/chunk-6y423jax.js +3 -0
- package/bundle/{chunk-ejrhvy38.js → chunk-6ynxf3q7.js} +1 -1
- package/bundle/{chunk-cfgvm15x.js → chunk-71zw0qhf.js} +1 -1
- package/bundle/chunk-72ghkgcn.js +2 -0
- package/bundle/{chunk-bh53dz71.js → chunk-7311jry1.js} +1 -1
- package/bundle/{chunk-d07p6fpk.js → chunk-73myw3bj.js} +2 -2
- package/bundle/chunk-741teh8k.js +2 -0
- package/bundle/{chunk-10bjs581.js → chunk-79agp7v3.js} +2 -2
- package/bundle/chunk-7b3wx6kn.js +2 -0
- package/bundle/{chunk-40efytmk.js → chunk-7eexey82.js} +1 -1
- package/bundle/{chunk-33e9y2aw.js → chunk-7mxt5b0h.js} +1 -1
- package/bundle/{chunk-yjf3kyej.js → chunk-7vd91wsd.js} +1 -1
- package/bundle/{chunk-nv3eyyaj.js → chunk-81trveht.js} +1 -1
- package/bundle/{chunk-dnwefyhv.js → chunk-8762ty72.js} +1 -1
- package/bundle/{chunk-qc8rsn4v.js → chunk-891yevv2.js} +1 -1
- package/bundle/{chunk-ctpy42xe.js → chunk-8c1ypgw5.js} +1 -1
- package/bundle/{chunk-8qswepp2.js → chunk-8ktgy41r.js} +1 -1
- package/bundle/{chunk-w18xs2h5.js → chunk-8q73cjyj.js} +1 -1
- package/bundle/chunk-8rt63jbm.js +2 -0
- package/bundle/{chunk-481k3dag.js → chunk-8vg4fmg2.js} +20 -20
- package/bundle/chunk-8y623qdx.js +2 -0
- package/bundle/chunk-921vn745.js +2 -0
- package/bundle/chunk-945ebhte.js +2 -0
- package/bundle/{chunk-4jtxtkj7.js → chunk-94pcpztx.js} +2 -2
- package/bundle/chunk-9548cc0c.js +2 -0
- package/bundle/{chunk-ff8nb7b3.js → chunk-9ayxg9mq.js} +1 -1
- package/bundle/{chunk-a7amey9s.js → chunk-9fxkh84w.js} +1 -1
- package/bundle/{chunk-8hytwgwf.js → chunk-9qdr9t8c.js} +1 -1
- package/bundle/{chunk-gt31468k.js → chunk-9x25d115.js} +1 -1
- package/bundle/{chunk-s08qccxa.js → chunk-9yrypq1r.js} +1 -1
- package/bundle/{chunk-zs8kqdsf.js → chunk-a0rp7gh4.js} +2 -2
- package/bundle/chunk-a1hzeejj.js +5 -0
- package/bundle/{chunk-tq0239xp.js → chunk-a3a1trap.js} +1 -1
- package/bundle/{chunk-n9xns8by.js → chunk-a48t0g95.js} +2 -2
- package/bundle/{chunk-d8dsdcb3.js → chunk-a949at1c.js} +1 -1
- package/bundle/{chunk-n1600mnf.js → chunk-aa8hymcv.js} +1 -1
- package/bundle/chunk-akk84fnc.js +2 -0
- package/bundle/chunk-aw7j7brm.js +2 -0
- package/bundle/{chunk-e1w70zdn.js → chunk-axdzm75h.js} +2 -2
- package/bundle/{chunk-js1n8tgv.js → chunk-azhw650z.js} +1 -1
- package/bundle/{chunk-t8m74g39.js → chunk-b4knxpqh.js} +1 -1
- package/bundle/{chunk-a1kazz9r.js → chunk-b6cybdj3.js} +1 -1
- package/bundle/{chunk-jef04wyf.js → chunk-ba3h1pzs.js} +1 -1
- package/bundle/{chunk-71xz70r9.js → chunk-bbzztav6.js} +1 -1
- package/bundle/{chunk-dactgryw.js → chunk-bj00xk8k.js} +1 -1
- package/bundle/{chunk-cxnfy6qk.js → chunk-bk4phk66.js} +1 -1
- package/bundle/{chunk-e01wnqvc.js → chunk-bnss5dkk.js} +1 -1
- package/bundle/{chunk-fvzwbjh8.js → chunk-bv29k2pf.js} +1 -1
- package/bundle/{chunk-v1xjc3s8.js → chunk-by855es0.js} +1 -1
- package/bundle/{chunk-zy9w1vkc.js → chunk-c5fa8cb1.js} +1 -1
- package/bundle/{chunk-x9rbv6p6.js → chunk-c5pb87yf.js} +1 -1
- package/bundle/{chunk-ck2gfaba.js → chunk-c6vfwjg4.js} +1 -1
- package/bundle/{chunk-2et3wkjy.js → chunk-ca4r31we.js} +1 -1
- package/bundle/chunk-ckbwdrm3.js +2 -0
- package/bundle/{chunk-a3aqmm3x.js → chunk-cqj21rfj.js} +1 -1
- package/bundle/{chunk-3632wgg1.js → chunk-cs38g1bx.js} +1 -1
- package/bundle/{chunk-53bqcctj.js → chunk-cz3h5n1v.js} +1 -1
- package/bundle/{chunk-rg0mrprz.js → chunk-d00c1k9w.js} +1 -1
- package/bundle/{chunk-p18axz0m.js → chunk-dcndy4sr.js} +1 -1
- package/bundle/{chunk-e7ny0b3x.js → chunk-dctj3c22.js} +1 -1
- package/bundle/{chunk-vvxmwyrw.js → chunk-df2aswz3.js} +1 -1
- package/bundle/{chunk-skqbaadf.js → chunk-dffhkd30.js} +1 -1
- package/bundle/chunk-dhc6e1t7.js +2 -0
- package/bundle/{chunk-pe29yy6s.js → chunk-dhqaqeq6.js} +1 -1
- package/bundle/chunk-dk6rbqvp.js +2 -0
- package/bundle/{chunk-te47zdxd.js → chunk-dk975etf.js} +2 -2
- package/bundle/chunk-dwajajaq.js +2 -0
- package/bundle/{chunk-dryzt12j.js → chunk-dxcrggvq.js} +1 -1
- package/bundle/chunk-dyt3n3fe.js +2 -0
- package/bundle/{chunk-fn9h4ync.js → chunk-dyv2hqvc.js} +1 -1
- package/bundle/{chunk-93p131d5.js → chunk-e6xnynaz.js} +1 -1
- package/bundle/{chunk-wefez1gt.js → chunk-e74efvj2.js} +6 -6
- package/bundle/chunk-e7ah0e61.js +2 -0
- package/bundle/{chunk-tqj69nh6.js → chunk-e7v9trve.js} +2 -2
- package/bundle/chunk-e8ws454m.js +2 -0
- package/bundle/{chunk-chpr8ekb.js → chunk-ebcdxmdd.js} +1 -1
- package/bundle/{chunk-zw815d68.js → chunk-ee23d2nz.js} +2 -2
- package/bundle/chunk-efndtzby.js +2 -0
- package/bundle/{chunk-gb00fh4z.js → chunk-egn55fa2.js} +3 -3
- package/bundle/chunk-eq2pepce.js +2 -0
- package/bundle/{chunk-rryytkmg.js → chunk-er38zew1.js} +2 -2
- package/bundle/{chunk-mpkvpn2y.js → chunk-eva3nqqb.js} +2 -2
- package/bundle/{chunk-s2x0rqj4.js → chunk-exmw8jfa.js} +1 -1
- package/bundle/{chunk-famryv52.js → chunk-f3bnn9rf.js} +2 -2
- package/bundle/chunk-f693s9vn.js +2 -0
- package/bundle/{chunk-0dt0bxz6.js → chunk-fg35hwa0.js} +2 -2
- package/bundle/{chunk-ktzq4ha1.js → chunk-fmq0m4k5.js} +1 -1
- package/bundle/chunk-ftepqwyq.js +2 -0
- package/bundle/chunk-g18ax6yp.js +2 -0
- package/bundle/{chunk-jh0bw59r.js → chunk-g4gjz7sq.js} +1 -1
- package/bundle/{chunk-g5rabwre.js → chunk-g6cyhxwg.js} +2 -2
- package/bundle/chunk-gadyp6mb.js +2 -0
- package/bundle/{chunk-q6pn67ps.js → chunk-gckgaqqr.js} +1 -1
- package/bundle/{chunk-fgzk49cr.js → chunk-ge8315te.js} +1 -1
- package/bundle/{chunk-a1wdeapb.js → chunk-ggydr1ze.js} +1 -1
- package/bundle/chunk-gk28ffhg.js +2 -0
- package/bundle/{chunk-c11d28qn.js → chunk-gmzrvxnv.js} +2 -2
- package/bundle/chunk-gpfc4z4v.js +2 -0
- package/bundle/chunk-gqvg02zp.js +2 -0
- package/bundle/chunk-gsyt2sv7.js +2 -0
- package/bundle/{chunk-3c6p8tm3.js → chunk-gws1rn1v.js} +1 -1
- package/bundle/{chunk-hnzegjgv.js → chunk-gy0wm7e1.js} +1 -1
- package/bundle/{chunk-pp2eqkse.js → chunk-h3k1dk9m.js} +1 -1
- package/bundle/chunk-h8c3dcqt.js +2 -0
- package/bundle/chunk-hfq11w4h.js +2 -0
- package/bundle/{chunk-01my2y0c.js → chunk-hj3ddt53.js} +1 -1
- package/bundle/{chunk-rzt0ge3t.js → chunk-hv6eccx1.js} +4 -4
- package/bundle/{chunk-ay8emwym.js → chunk-hw5qyht3.js} +1 -1
- package/bundle/chunk-hwf58w1k.js +2 -0
- package/bundle/{chunk-kq6b222y.js → chunk-jgjnz82k.js} +1 -1
- package/bundle/{chunk-wfb608qf.js → chunk-jkh6eg7d.js} +3 -3
- package/bundle/{chunk-5gmjtmc4.js → chunk-jyczz3yh.js} +2 -2
- package/bundle/{chunk-np50azpb.js → chunk-k8k8z6b7.js} +2 -2
- package/bundle/{chunk-6hpgb8h4.js → chunk-ke7n9t5p.js} +3 -3
- package/bundle/{chunk-vcw00k0n.js → chunk-keveg5gx.js} +2 -2
- package/bundle/{chunk-dxpj0cxh.js → chunk-kfmz2p27.js} +2 -2
- package/bundle/{chunk-xm7wascx.js → chunk-kjyw00jp.js} +1 -1
- package/bundle/chunk-kk3ve911.js +2 -0
- package/bundle/{chunk-gsar6xda.js → chunk-kmcsz8yv.js} +1 -1
- package/bundle/{chunk-4cnwn1rh.js → chunk-kv72hxkp.js} +2 -2
- package/bundle/{chunk-kj20f048.js → chunk-kwx9ewe0.js} +1 -1
- package/bundle/chunk-m4j7jyrd.js +3 -0
- package/bundle/{chunk-5hw6xa49.js → chunk-md8161zd.js} +1 -1
- package/bundle/{chunk-xzrb857v.js → chunk-mex0fe9s.js} +1 -1
- package/bundle/{chunk-ctaze2hn.js → chunk-mf3sm0pk.js} +1 -1
- package/bundle/chunk-mkng9ykt.js +2 -0
- package/bundle/{chunk-mzs2pjyc.js → chunk-mpygdb5a.js} +2 -2
- package/bundle/{chunk-81qwdg5s.js → chunk-mq6jn47r.js} +1 -1
- package/bundle/{chunk-yp8wyzzm.js → chunk-mr8j7rc6.js} +1 -1
- package/bundle/{chunk-48nm6v8b.js → chunk-mxvypy3s.js} +1 -1
- package/bundle/chunk-n5ypgxrn.js +28 -0
- package/bundle/{chunk-h4j5xzc8.js → chunk-n6gtdx5h.js} +1 -1
- package/bundle/{chunk-h2afsbm1.js → chunk-n6msxne8.js} +1 -1
- package/bundle/{chunk-jbx3s7nw.js → chunk-n96tvjgj.js} +2 -2
- package/bundle/{chunk-ftas05da.js → chunk-n9xw9kqc.js} +1 -1
- package/bundle/{chunk-v7w4nfn7.js → chunk-nc4wbc89.js} +1 -1
- package/bundle/{chunk-9f1z9xce.js → chunk-ngccf7ga.js} +1 -1
- package/bundle/{chunk-2bn2b29j.js → chunk-ngk67rt3.js} +1 -1
- package/bundle/{chunk-0t4324w5.js → chunk-nj2bbtmx.js} +1 -1
- package/bundle/chunk-nj4d554m.js +11 -0
- package/bundle/{chunk-dynv30gm.js → chunk-nj61v4n7.js} +1 -1
- package/bundle/{chunk-12vef2pr.js → chunk-nkk4fyqf.js} +1 -1
- package/bundle/{chunk-gbpvs0fx.js → chunk-nmehsm3w.js} +1 -1
- package/bundle/chunk-nr1g57b2.js +2 -0
- package/bundle/chunk-p0ahbpxv.js +2 -0
- package/bundle/{chunk-73e409hd.js → chunk-p3qkexpk.js} +1 -1
- package/bundle/chunk-p7y8z5rd.js +2 -0
- package/bundle/{chunk-yhbcbjfk.js → chunk-p825vsjy.js} +1 -1
- package/bundle/{chunk-rbk8seme.js → chunk-p9cnzxb8.js} +1 -1
- package/bundle/{chunk-15hw2z9t.js → chunk-pkc4ddw1.js} +1 -1
- package/bundle/{chunk-1gx18dm5.js → chunk-prh3c44x.js} +1 -1
- package/bundle/chunk-pt26gerr.js +2 -0
- package/bundle/{chunk-zscer8rc.js → chunk-pxmhe36r.js} +1 -1
- package/bundle/{chunk-g7ccdh7r.js → chunk-q8hd01j7.js} +1 -1
- package/bundle/{chunk-e10py6yr.js → chunk-qa2j0qmy.js} +1 -1
- package/bundle/{chunk-g10d6x57.js → chunk-qddt2gcs.js} +1 -1
- package/bundle/{chunk-y3b4k38p.js → chunk-qg2vk5fw.js} +1 -1
- package/bundle/{chunk-7z5jh4ra.js → chunk-qkjdr337.js} +1 -1
- package/bundle/chunk-qkk1as5n.js +2 -0
- package/bundle/{chunk-5q4harvc.js → chunk-qrtc3etn.js} +2 -2
- package/bundle/chunk-qsm9xw87.js +2 -0
- package/bundle/chunk-qw980y8h.js +2 -0
- package/bundle/{chunk-7avcnwv8.js → chunk-qzj6027k.js} +1 -1
- package/bundle/{chunk-70ck4v3t.js → chunk-r0k21apr.js} +1 -1
- package/bundle/chunk-r2w3gr8d.js +2 -0
- package/bundle/chunk-r5bqcpkz.js +2 -0
- package/bundle/chunk-r67c858b.js +2 -0
- package/bundle/chunk-r9fvfkee.js +2 -0
- package/bundle/chunk-rcn0dhbj.js +2 -0
- package/bundle/{chunk-69nzndk7.js → chunk-rkwrjphh.js} +1 -1
- package/bundle/{chunk-0mx2psfc.js → chunk-rmve21dh.js} +1 -1
- package/bundle/chunk-rq47pn3r.js +2 -0
- package/bundle/{chunk-b8gjz6bk.js → chunk-rq4w0by4.js} +1 -1
- package/bundle/{chunk-jrqb0jwy.js → chunk-rsszcqxd.js} +1 -1
- package/bundle/{chunk-xvwvd4kq.js → chunk-rv1stdvb.js} +1 -1
- package/bundle/chunk-rvt1tdy8.js +2 -0
- package/bundle/{chunk-3bxg5bta.js → chunk-ry7q8xn6.js} +1 -1
- package/bundle/{chunk-rjd8gbs5.js → chunk-ryfqwsft.js} +1 -1
- package/bundle/chunk-s27xvrft.js +2 -0
- package/bundle/{chunk-p9qfbr02.js → chunk-s4qtphwx.js} +1 -1
- package/bundle/{chunk-4fgzp2zd.js → chunk-s5nde2kd.js} +1 -1
- package/bundle/{chunk-qrsveve6.js → chunk-s8hq6trz.js} +1 -1
- package/bundle/chunk-scy39p6q.js +2 -0
- package/bundle/{chunk-71sjjjr8.js → chunk-seghf5fc.js} +1 -1
- package/bundle/{chunk-2zq4k837.js → chunk-sfes6pp1.js} +1 -1
- package/bundle/{chunk-qn6gdhns.js → chunk-sjw56r2n.js} +2 -2
- package/bundle/{chunk-htz93dsd.js → chunk-snr44en9.js} +2 -2
- package/bundle/{chunk-pfyhg0m7.js → chunk-srpe3v8e.js} +1 -1
- package/bundle/{chunk-cphrgyp6.js → chunk-ssk8tkwd.js} +1 -1
- package/bundle/{chunk-ccmbckek.js → chunk-st5jaszz.js} +1 -1
- package/bundle/{chunk-mrt1z4m8.js → chunk-t2vm08v6.js} +1 -1
- package/bundle/{chunk-vrc0h1q7.js → chunk-t3eymzg1.js} +1 -1
- package/bundle/{chunk-yv0xrnn9.js → chunk-t5qamf96.js} +1 -1
- package/bundle/{chunk-xn70ep9n.js → chunk-tbgczapt.js} +1 -1
- package/bundle/chunk-tns5x4w0.js +3 -0
- package/bundle/chunk-ttevj0pj.js +2 -0
- package/bundle/{chunk-rvfvk2ty.js → chunk-txbwmwxj.js} +1 -1
- package/bundle/chunk-v7c54cyj.js +2 -0
- package/bundle/chunk-vgefaens.js +2 -0
- package/bundle/{chunk-24jg9d61.js → chunk-vsr8mnj6.js} +1 -1
- package/bundle/{chunk-6d5rrre9.js → chunk-vszbqv24.js} +1 -1
- package/bundle/chunk-vv59b4re.js +2 -0
- package/bundle/chunk-vwqy7n3g.js +2 -0
- package/bundle/{chunk-n6wt9m2k.js → chunk-vysa9hp4.js} +1 -1
- package/bundle/{chunk-a1g7jr3r.js → chunk-w1n4rf6n.js} +1 -1
- package/bundle/{chunk-gagtmjmp.js → chunk-wfd5h6ax.js} +2 -2
- package/bundle/{chunk-ht5w06x7.js → chunk-wgk7ynt3.js} +2 -2
- package/bundle/chunk-wn076jwj.js +2 -0
- package/bundle/{chunk-35xk4g91.js → chunk-wvf5q2hz.js} +1 -1
- package/bundle/chunk-x0m1qye9.js +2 -0
- package/bundle/{chunk-p62gb4wj.js → chunk-x66ycpfs.js} +1 -1
- package/bundle/{chunk-48ge2ryx.js → chunk-xgr6jnd6.js} +1 -1
- package/bundle/{chunk-2hc5z7b5.js → chunk-xqdrr7xg.js} +1 -1
- package/bundle/{chunk-bnap670d.js → chunk-xvntsbb1.js} +1 -1
- package/bundle/{chunk-ss2ms1r3.js → chunk-y437vyza.js} +1 -1
- package/bundle/chunk-y70aachh.js +2 -0
- package/bundle/{chunk-db405hjg.js → chunk-y9zstzed.js} +1 -1
- package/bundle/{chunk-pp6vhqrr.js → chunk-yjk6zv2z.js} +1 -1
- package/bundle/{chunk-326p5b10.js → chunk-yk97q51d.js} +1 -1
- package/bundle/{chunk-kf167jw7.js → chunk-ynwkr3yh.js} +1 -1
- package/bundle/{chunk-9bzhxenb.js → chunk-yprmd5b7.js} +2 -2
- package/bundle/{chunk-y9q0hb7b.js → chunk-yqk58hf6.js} +2 -2
- package/bundle/chunk-ysgxt83y.js +2 -0
- package/bundle/{chunk-tt30dybd.js → chunk-yz6898wy.js} +1 -1
- package/bundle/{chunk-x562b0xk.js → chunk-z1ay3qd0.js} +1 -1
- package/bundle/{chunk-9emq67vc.js → chunk-z7430qxg.js} +1 -1
- package/bundle/{chunk-2maqde7w.js → chunk-z8gdmvgg.js} +2 -2
- package/bundle/{chunk-3bssxmtg.js → chunk-zddknkw7.js} +1 -1
- package/bundle/chunk-ze9e6nt3.js +3 -0
- package/bundle/{chunk-vxyy2dp3.js → chunk-zfcp509b.js} +1 -1
- package/bundle/{chunk-x7k5yeey.js → chunk-zfn0z4sh.js} +1 -1
- package/bundle/{chunk-ag8kz1e7.js → chunk-zh3fny3z.js} +2 -2
- package/bundle/{chunk-9k6hz80e.js → chunk-znzan00b.js} +1 -1
- package/bundle/chunk-zrp55k47.js +2 -0
- package/bundle/chunk-zwdnh860.js +2 -0
- package/bundle/{chunk-1vb79bw1.js → chunk-zwnhf4z1.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-0e1vkdze.js +0 -2
- package/bundle/chunk-0p27fvfr.js +0 -2
- package/bundle/chunk-0qs1vx97.js +0 -2
- package/bundle/chunk-18bj8z8m.js +0 -28
- package/bundle/chunk-19g6dhva.js +0 -2
- package/bundle/chunk-1ap7sh2c.js +0 -2
- package/bundle/chunk-1rhhhm88.js +0 -2
- package/bundle/chunk-1wbjh23g.js +0 -2
- package/bundle/chunk-3dadmgxa.js +0 -2
- package/bundle/chunk-42p59wm4.js +0 -2
- package/bundle/chunk-43xt69m8.js +0 -2
- package/bundle/chunk-4512pvca.js +0 -2
- package/bundle/chunk-456bmaww.js +0 -2
- package/bundle/chunk-48pajrnt.js +0 -2
- package/bundle/chunk-4fy9c54h.js +0 -2
- package/bundle/chunk-4m5yesw8.js +0 -2
- package/bundle/chunk-59y8q9m5.js +0 -2
- package/bundle/chunk-5tray1fw.js +0 -3
- package/bundle/chunk-5v6b8mr6.js +0 -2
- package/bundle/chunk-64ezpbwt.js +0 -2
- package/bundle/chunk-6r7z94e6.js +0 -3
- package/bundle/chunk-711dc303.js +0 -5
- package/bundle/chunk-7mke41x0.js +0 -2
- package/bundle/chunk-7ry9cvby.js +0 -2
- package/bundle/chunk-7wczs9mx.js +0 -2
- package/bundle/chunk-8v96pmqn.js +0 -2
- package/bundle/chunk-8y2scz6z.js +0 -2
- package/bundle/chunk-8zx7vnx6.js +0 -2
- package/bundle/chunk-94a76f8w.js +0 -2
- package/bundle/chunk-9ng7jjp7.js +0 -2
- package/bundle/chunk-9tpgnjy8.js +0 -2
- package/bundle/chunk-a7ym9f0v.js +0 -2
- package/bundle/chunk-a8f2xvy3.js +0 -2
- package/bundle/chunk-a99cvwta.js +0 -2
- package/bundle/chunk-aecc391x.js +0 -2
- package/bundle/chunk-avys5mnz.js +0 -2
- package/bundle/chunk-axvjd10y.js +0 -2
- package/bundle/chunk-b4pphqab.js +0 -2
- package/bundle/chunk-b6087ak4.js +0 -2
- package/bundle/chunk-bdd97g5y.js +0 -2
- package/bundle/chunk-bn0h9dny.js +0 -10
- package/bundle/chunk-bnmz683j.js +0 -2
- package/bundle/chunk-brkqxbjy.js +0 -2
- package/bundle/chunk-c26qxt5g.js +0 -2
- package/bundle/chunk-c6zscb38.js +0 -2
- package/bundle/chunk-cjww2jmv.js +0 -3
- package/bundle/chunk-d2ttw3wf.js +0 -2
- package/bundle/chunk-dafmkrhn.js +0 -2
- package/bundle/chunk-dgprdym0.js +0 -2
- package/bundle/chunk-dsamees2.js +0 -2
- package/bundle/chunk-dxje3azs.js +0 -2
- package/bundle/chunk-dyqpxx3b.js +0 -2
- package/bundle/chunk-etvs6a6y.js +0 -2
- package/bundle/chunk-ftn49yn1.js +0 -2
- package/bundle/chunk-gwzw92jt.js +0 -2
- package/bundle/chunk-hdrbyarv.js +0 -3
- package/bundle/chunk-hkqnqw3x.js +0 -2
- package/bundle/chunk-hp7tssgv.js +0 -2
- package/bundle/chunk-ht0hbdmx.js +0 -2
- package/bundle/chunk-m1s19p9n.js +0 -2
- package/bundle/chunk-ngm6pqyt.js +0 -2
- package/bundle/chunk-ngtavamt.js +0 -2
- package/bundle/chunk-nkhc32s3.js +0 -2
- package/bundle/chunk-npse2xrd.js +0 -2
- package/bundle/chunk-p3pemdns.js +0 -2
- package/bundle/chunk-p6e4vqy7.js +0 -2
- package/bundle/chunk-pqkjhn8h.js +0 -2
- package/bundle/chunk-qd8w2gkd.js +0 -2
- package/bundle/chunk-rbbw7bs0.js +0 -2
- package/bundle/chunk-rf12t4n5.js +0 -2
- package/bundle/chunk-rpgne7xh.js +0 -2
- package/bundle/chunk-rvgj1vky.js +0 -2
- package/bundle/chunk-ss2jvqrg.js +0 -2
- package/bundle/chunk-tt9smgmg.js +0 -2
- package/bundle/chunk-tvwwq4b3.js +0 -2
- package/bundle/chunk-v2n26eg4.js +0 -2
- package/bundle/chunk-v7ezt8k3.js +0 -2
- package/bundle/chunk-vqg5q96v.js +0 -2
- package/bundle/chunk-x24y7qyd.js +0 -2
- package/bundle/chunk-y2d0w09y.js +0 -2
- package/bundle/chunk-yb79f79m.js +0 -2
- package/bundle/chunk-yjnyzpmt.js +0 -2
- package/bundle/chunk-yqbcnsa1.js +0 -2
- package/bundle/chunk-z3mra3nm.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Cp as LG,Dp as VG,Hp as u,Ip as l,Jp as UG,Kp as hG,Lp as gG,Mp as mG,Qp as dG,Ro as CG,So as bG,Wo as TG,Yo as jG,fp as AG,kp as OG,mp as kG,op as vG,pp as _G,sp as J,vp as W,wp as GG}from"./chunk-2maqde7w.js";import{Tp as NG,Wp as MG,aq as WG,dq as HG}from"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import{St as G}from"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-7xm75w1e.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{$q as LG,Eq as AG,Jq as OG,Lq as kG,Nq as vG,Oq as _G,Rq as J,Uq as W,Vq as GG,ar as VG,er as u,fr as l,gr as UG,hr as hG,ir as gG,jr as mG,nr as dG,oq as CG,pq as bG,tq as TG,vq as jG}from"./chunk-z8gdmvgg.js";import{Cr as HG,qr as NG,tr as MG,zr as WG}from"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import{pv as G}from"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-3k2b05fv.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,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yp as q}from"./chunk-f3bnn9rf.js";class z extends Error{cause;constructor(j,x){super(j);this.name="QreditChargeError",this.cause=x}}async function B(j){return q(j)}function C(j){return Number.isInteger(j)?String(j):j.toFixed(2)}
|
|
3
3
|
export{z as F,B as G,C as H};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{te as Sw}from"./chunk-yek0sk2q.js";import{xe as $w}from"./chunk-01my2y0c.js";import{ye as dw}from"./chunk-70ck4v3t.js";import{Ae as xw,Be as Cw,ze as Aw}from"./chunk-ht5w06x7.js";import{Ce as Ew}from"./chunk-enpzvmtc.js";import{uf as yw,vf as Rw,wf as Pw,xf as vw,yf as Tw}from"./chunk-tq0239xp.js";import"./chunk-7xm75w1e.js";var W=Cw(),j=xw(),L=Rw(),Q=Pw(),b=vw(),N=Ew(),H=Aw(),$=yw(),l=Sw(),D=Tw(),a=dw(),lw=$w(),mw=async(w,z,F)=>{return{operation:L.getSmithyContext(z).operation,region:await L.normalizeProvider(w.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function uw(w){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:w.region},propertiesExtractor:(z,F)=>({signingProperties:{config:z,context:F}})}}function hw(w){return{schemeId:"smithy.api#noAuth"}}var _w=(w)=>{let z=[];switch(w.operation){case"CreateOAuth2Token":{z.push(hw());break}default:z.push(uw(w))}return z},pw=(w)=>{let z=l.resolveAwsSdkSigV4Config(w);return Object.assign(z,{authSchemePreference:L.normalizeProvider(w.authSchemePreference??[])})},aw=(w)=>{return Object.assign(w,{useDualstackEndpoint:w.useDualstackEndpoint??!1,useFipsEndpoint:w.useFipsEndpoint??!1,defaultSigningName:"signin"})},sw={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},fw="3.997.14",rw={version:fw},M="ref",B=-1,I=!0,s="isSet",Lw="PartitionResult",O="booleanEquals",S="getAttr",x="stringEquals",f={[M]:"Endpoint"},d={[M]:Lw},C={fn:S,argv:[d,"name"]},Z={},r=[{[M]:"Region"}],g={conditions:[[s,[f]],[s,r],["aws.partition",r,Lw],[O,[{[M]:"UseFIPS"},I]],[O,[{[M]:"UseDualStack"},I]],[O,[{fn:S,argv:[d,"supportsDualStack"]},I]],[O,[{fn:S,argv:[d,"supportsFIPS"]},I]],[x,[C,"aws"]],[x,[C,"aws-cn"]],[x,[C,"aws-us-gov"]]],results:[[B],[B,"Invalid Configuration: FIPS and custom endpoint are not supported"],[B,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[f,Z],["https://{Region}.signin.aws.amazon.com",Z],["https://{Region}.signin.amazonaws.cn",Z],["https://{Region}.signin.amazonaws-us-gov.com",Z],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Z],[B,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",Z],[B,"FIPS is enabled but this partition does not support FIPS"],["https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",Z],[B,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",Z],[B,"Invalid Configuration: Missing Region"]]},gw=2,G=1e8,cw=new Int32Array([-1,1,-1,0,15,3,1,4,G+14,2,5,G+14,3,11,6,4,10,7,7,G+4,8,8,G+5,9,9,G+6,G+13,5,G+11,G+12,4,13,12,6,G+9,G+10,5,14,G+8,6,G+7,G+8,3,G+1,16,4,G+2,G+3]),tw=b.BinaryDecisionDiagram.from(cw,gw,g.conditions,g.results),ew=new b.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),ow=(w,z={})=>{return ew.get(w,()=>b.decideEndpoint(tw,{endpointParams:w,logger:z.logger}))};b.customEndpointFunctions.aws=W.awsEndpointFunctions;class q extends L.ServiceException{constructor(w){super(w);Object.setPrototypeOf(this,q.prototype)}}class R extends q{name="AccessDeniedException";$fault="client";error;constructor(w){super({name:"AccessDeniedException",$fault:"client",...w});Object.setPrototypeOf(this,R.prototype),this.error=w.error}}class P extends q{name="InternalServerException";$fault="server";error;constructor(w){super({name:"InternalServerException",$fault:"server",...w});Object.setPrototypeOf(this,P.prototype),this.error=w.error}}class v extends q{name="TooManyRequestsError";$fault="client";error;constructor(w){super({name:"TooManyRequestsError",$fault:"client",...w});Object.setPrototypeOf(this,v.prototype),this.error=w.error}}class T extends q{name="ValidationException";$fault="client";error;constructor(w){super({name:"ValidationException",$fault:"client",...w});Object.setPrototypeOf(this,T.prototype),this.error=w.error}}var iw="AccessDeniedException",nw="AccessToken",wz="CreateOAuth2Token",zz="CreateOAuth2TokenRequest",Fz="CreateOAuth2TokenRequestBody",Gz="CreateOAuth2TokenResponseBody",Jz="CreateOAuth2TokenResponse",Lz="InternalServerException",Qz="RefreshToken",Uz="TooManyRequestsError",Wz="ValidationException",c="accessKeyId",t="accessToken",m="client",e="clientId",o="codeVerifier",Xz="code",K="error",i="expiresIn",n="grantType",Yz="http",u="httpError",ww="idToken",U="jsonName",E="message",y="refreshToken",zw="redirectUri",Qw="smithy.ts.sdk.synthetic.com.amazonaws.signin",Fw="secretAccessKey",Gw="sessionToken",Zz="server",Kz="tokenInput",qz="tokenOutput",Jw="tokenType",X="com.amazonaws.signin",Uw=$.TypeRegistry.for(Qw),Ww=[-3,Qw,"SigninServiceException",0,[],[]];Uw.registerError(Ww,q);var k=$.TypeRegistry.for(X),Xw=[-3,X,iw,{[K]:m},[K,E],[0,0],2];k.registerError(Xw,R);var Yw=[-3,X,Lz,{[K]:Zz,[u]:500},[K,E],[0,0],2];k.registerError(Yw,P);var Zw=[-3,X,Uz,{[K]:m,[u]:429},[K,E],[0,0],2];k.registerError(Zw,v);var Kw=[-3,X,Wz,{[K]:m,[u]:400},[K,E],[0,0],2];k.registerError(Kw,T);var qw=[Uw,k],Bw=[0,X,Qz,8,0],Dw=[3,X,nw,8,[c,Fw,Gw],[[0,{[U]:c}],[0,{[U]:Fw}],[0,{[U]:Gw}]],3],bw=[3,X,zz,0,[Kz],[[()=>Hw,16]],1],Hw=[3,X,Fz,0,[e,n,Xz,zw,o,y],[[0,{[U]:e}],[0,{[U]:n}],0,[0,{[U]:zw}],[0,{[U]:o}],[()=>Bw,{[U]:y}]],2],Mw=[3,X,Jz,0,[qz],[[()=>kw,16]],1],kw=[3,X,Gz,0,[t,Jw,i,y,ww],[[()=>Dw,{[U]:t}],[0,{[U]:Jw}],[1,{[U]:i}],[()=>Bw,{[U]:y}],[0,{[U]:ww}]],4],Vw=[9,X,wz,{[Yz]:["POST","/v1/token",200]},()=>bw,()=>Mw],Bz=(w)=>{return{apiVersion:"2023-01-01",base64Decoder:w?.base64Decoder??D.fromBase64,base64Encoder:w?.base64Encoder??D.toBase64,disableHostPrefix:w?.disableHostPrefix??!1,endpointProvider:w?.endpointProvider??ow,extensions:w?.extensions??[],httpAuthSchemeProvider:w?.httpAuthSchemeProvider??_w,httpAuthSchemes:w?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(z)=>z.getIdentityProvider("aws.auth#sigv4"),signer:new l.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(z)=>z.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new j.NoAuthSigner}],logger:w?.logger??new L.NoOpLogger,protocol:w?.protocol??lw.AwsRestJsonProtocol,protocolSettings:w?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:qw,version:"2023-01-01",serviceTarget:"Signin"},serviceId:w?.serviceId??"Signin",urlParser:w?.urlParser??N.parseUrl,utf8Decoder:w?.utf8Decoder??D.fromUtf8,utf8Encoder:w?.utf8Encoder??D.toUtf8}},Dz=(w)=>{L.emitWarningIfUnsupportedVersion(process.version);let z=Q.resolveDefaultsModeConfig(w),F=()=>z().then(L.loadConfigsForDefaultMode),Y=Bz(w);W.emitWarningIfUnsupportedVersion(process.version);let J={profile:w?.profile,logger:Y.logger};return{...Y,...w,runtime:"node",defaultsMode:z,authSchemePreference:w?.authSchemePreference??Q.loadConfig(l.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,J),bodyLengthChecker:w?.bodyLengthChecker??D.calculateBodyLength,defaultUserAgentProvider:w?.defaultUserAgentProvider??W.createDefaultUserAgentProvider({serviceId:Y.serviceId,clientVersion:rw.version}),maxAttempts:w?.maxAttempts??Q.loadConfig(H.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,w),region:w?.region??Q.loadConfig(Q.NODE_REGION_CONFIG_OPTIONS,{...Q.NODE_REGION_CONFIG_FILE_OPTIONS,...J}),requestHandler:a.NodeHttpHandler.create(w?.requestHandler??F),retryMode:w?.retryMode??Q.loadConfig({...H.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await F()).retryMode||H.DEFAULT_RETRY_MODE},w),sha256:w?.sha256??D.Hash.bind(null,"sha256"),streamCollector:w?.streamCollector??a.streamCollector,useDualstackEndpoint:w?.useDualstackEndpoint??Q.loadConfig(Q.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,J),useFipsEndpoint:w?.useFipsEndpoint??Q.loadConfig(Q.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,J),userAgentAppId:w?.userAgentAppId??Q.loadConfig(W.NODE_APP_ID_CONFIG_OPTIONS,J)}},bz=(w)=>{let{httpAuthSchemes:z,httpAuthSchemeProvider:F,credentials:Y}=w;return{setHttpAuthScheme(J){let V=z.findIndex((A)=>A.schemeId===J.schemeId);if(V===-1)z.push(J);else z.splice(V,1,J)},httpAuthSchemes(){return z},setHttpAuthSchemeProvider(J){F=J},httpAuthSchemeProvider(){return F},setCredentials(J){Y=J},credentials(){return Y}}},Hz=(w)=>{return{httpAuthSchemes:w.httpAuthSchemes(),httpAuthSchemeProvider:w.httpAuthSchemeProvider(),credentials:w.credentials()}},Mz=(w,z)=>{let F=Object.assign(W.getAwsRegionExtensionConfiguration(w),L.getDefaultExtensionConfiguration(w),N.getHttpHandlerExtensionConfiguration(w),bz(w));return z.forEach((Y)=>Y.configure(F)),Object.assign(w,W.resolveAwsRegionExtensionConfiguration(F),L.resolveDefaultRuntimeConfig(F),N.resolveHttpHandlerRuntimeConfig(F),Hz(F))};class h extends L.Client{config;constructor(...[w]){let z=Dz(w||{});super(z);this.initConfig=z;let F=aw(z),Y=W.resolveUserAgentConfig(F),J=H.resolveRetryConfig(Y),V=Q.resolveRegionConfig(J),A=W.resolveHostHeaderConfig(V),Iw=b.resolveEndpointConfig(A),Ow=pw(Iw),jw=Mz(Ow,w?.extensions||[]);this.config=jw,this.middlewareStack.use($.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(W.getUserAgentPlugin(this.config)),this.middlewareStack.use(H.getRetryPlugin(this.config)),this.middlewareStack.use(N.getContentLengthPlugin(this.config)),this.middlewareStack.use(W.getHostHeaderPlugin(this.config)),this.middlewareStack.use(W.getLoggerPlugin(this.config)),this.middlewareStack.use(W.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(j.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:mw,identityProviderConfigProvider:async(Nw)=>new j.DefaultIdentityProviderConfig({"aws.auth#sigv4":Nw.credentials})})),this.middlewareStack.use(j.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class _ extends L.Command.classBuilder().ep(sw).m(function(w,z,F,Y){return[b.getEndpointPlugin(F,w.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(Vw).build(){}var kz={CreateOAuth2TokenCommand:_};class p extends h{}L.createAggregatedClient(kz,p);var Vz={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",SERVER_ERROR:"server_error",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var{Command:Iz,Client:Oz}=L,jz=R,Nz=Xw,yz=Dw,Rz=Vw,Pz=_,vz=bw,Tz=Hw,Ez=Mw,Az=kw,xz=P,Cz=Yw,Sz=Vz,dz=p,$z=h,lz=q,mz=Ww,uz=v,hz=Zw,_z=T,pz=Kw,az=qw;export{az as errorTypeRegistries,Oz as __Client,pz as ValidationException$,_z as ValidationException,hz as TooManyRequestsError$,uz as TooManyRequestsError,mz as SigninServiceException$,lz as SigninServiceException,$z as SigninClient,dz as Signin,Sz as OAuth2ErrorCode,Cz as InternalServerException$,xz as InternalServerException,Az as CreateOAuth2TokenResponseBody$,Ez as CreateOAuth2TokenResponse$,Tz as CreateOAuth2TokenRequestBody$,vz as CreateOAuth2TokenRequest$,Pz as CreateOAuth2TokenCommand,Rz as CreateOAuth2Token$,yz as AccessToken$,Nz as AccessDeniedException$,jz as AccessDeniedException,Iz as $Command};export default {get errorTypeRegistries(){return az},get __Client(){return Oz},get ValidationException$(){return pz},get ValidationException(){return _z},get TooManyRequestsError$(){return hz},get TooManyRequestsError(){return uz},get SigninServiceException$(){return mz},get SigninServiceException(){return lz},get SigninClient(){return $z},get Signin(){return dz},get OAuth2ErrorCode(){return Sz},get InternalServerException$(){return Cz},get InternalServerException(){return xz},get CreateOAuth2TokenResponseBody$(){return Az},get CreateOAuth2TokenResponse$(){return Ez},get CreateOAuth2TokenRequestBody$(){return Tz},get CreateOAuth2TokenRequest$(){return vz},get CreateOAuth2TokenCommand(){return Pz},get CreateOAuth2Token$(){return Rz},get AccessToken$(){return yz},get AccessDeniedException$(){return Nz},get AccessDeniedException(){return jz},get $Command(){return Iz}};
|
|
2
|
+
import{te as Sw}from"./chunk-6a7c7wnf.js";import{xe as $w}from"./chunk-hj3ddt53.js";import{ye as dw}from"./chunk-r0k21apr.js";import{Ae as xw,Be as Cw,ze as Aw}from"./chunk-wgk7ynt3.js";import{Ce as Ew}from"./chunk-41v0x1jk.js";import{uf as yw,vf as Rw,wf as Pw,xf as vw,yf as Tw}from"./chunk-a3a1trap.js";import"./chunk-3k2b05fv.js";var W=Cw(),j=xw(),L=Rw(),Q=Pw(),b=vw(),N=Ew(),H=Aw(),$=yw(),l=Sw(),D=Tw(),a=dw(),lw=$w(),mw=async(w,z,F)=>{return{operation:L.getSmithyContext(z).operation,region:await L.normalizeProvider(w.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function uw(w){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:w.region},propertiesExtractor:(z,F)=>({signingProperties:{config:z,context:F}})}}function hw(w){return{schemeId:"smithy.api#noAuth"}}var _w=(w)=>{let z=[];switch(w.operation){case"CreateOAuth2Token":{z.push(hw());break}default:z.push(uw(w))}return z},pw=(w)=>{let z=l.resolveAwsSdkSigV4Config(w);return Object.assign(z,{authSchemePreference:L.normalizeProvider(w.authSchemePreference??[])})},aw=(w)=>{return Object.assign(w,{useDualstackEndpoint:w.useDualstackEndpoint??!1,useFipsEndpoint:w.useFipsEndpoint??!1,defaultSigningName:"signin"})},sw={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},fw="3.997.14",rw={version:fw},M="ref",B=-1,I=!0,s="isSet",Lw="PartitionResult",O="booleanEquals",S="getAttr",x="stringEquals",f={[M]:"Endpoint"},d={[M]:Lw},C={fn:S,argv:[d,"name"]},Z={},r=[{[M]:"Region"}],g={conditions:[[s,[f]],[s,r],["aws.partition",r,Lw],[O,[{[M]:"UseFIPS"},I]],[O,[{[M]:"UseDualStack"},I]],[O,[{fn:S,argv:[d,"supportsDualStack"]},I]],[O,[{fn:S,argv:[d,"supportsFIPS"]},I]],[x,[C,"aws"]],[x,[C,"aws-cn"]],[x,[C,"aws-us-gov"]]],results:[[B],[B,"Invalid Configuration: FIPS and custom endpoint are not supported"],[B,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[f,Z],["https://{Region}.signin.aws.amazon.com",Z],["https://{Region}.signin.amazonaws.cn",Z],["https://{Region}.signin.amazonaws-us-gov.com",Z],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Z],[B,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",Z],[B,"FIPS is enabled but this partition does not support FIPS"],["https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",Z],[B,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",Z],[B,"Invalid Configuration: Missing Region"]]},gw=2,G=1e8,cw=new Int32Array([-1,1,-1,0,15,3,1,4,G+14,2,5,G+14,3,11,6,4,10,7,7,G+4,8,8,G+5,9,9,G+6,G+13,5,G+11,G+12,4,13,12,6,G+9,G+10,5,14,G+8,6,G+7,G+8,3,G+1,16,4,G+2,G+3]),tw=b.BinaryDecisionDiagram.from(cw,gw,g.conditions,g.results),ew=new b.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),ow=(w,z={})=>{return ew.get(w,()=>b.decideEndpoint(tw,{endpointParams:w,logger:z.logger}))};b.customEndpointFunctions.aws=W.awsEndpointFunctions;class q extends L.ServiceException{constructor(w){super(w);Object.setPrototypeOf(this,q.prototype)}}class R extends q{name="AccessDeniedException";$fault="client";error;constructor(w){super({name:"AccessDeniedException",$fault:"client",...w});Object.setPrototypeOf(this,R.prototype),this.error=w.error}}class P extends q{name="InternalServerException";$fault="server";error;constructor(w){super({name:"InternalServerException",$fault:"server",...w});Object.setPrototypeOf(this,P.prototype),this.error=w.error}}class v extends q{name="TooManyRequestsError";$fault="client";error;constructor(w){super({name:"TooManyRequestsError",$fault:"client",...w});Object.setPrototypeOf(this,v.prototype),this.error=w.error}}class T extends q{name="ValidationException";$fault="client";error;constructor(w){super({name:"ValidationException",$fault:"client",...w});Object.setPrototypeOf(this,T.prototype),this.error=w.error}}var iw="AccessDeniedException",nw="AccessToken",wz="CreateOAuth2Token",zz="CreateOAuth2TokenRequest",Fz="CreateOAuth2TokenRequestBody",Gz="CreateOAuth2TokenResponseBody",Jz="CreateOAuth2TokenResponse",Lz="InternalServerException",Qz="RefreshToken",Uz="TooManyRequestsError",Wz="ValidationException",c="accessKeyId",t="accessToken",m="client",e="clientId",o="codeVerifier",Xz="code",K="error",i="expiresIn",n="grantType",Yz="http",u="httpError",ww="idToken",U="jsonName",E="message",y="refreshToken",zw="redirectUri",Qw="smithy.ts.sdk.synthetic.com.amazonaws.signin",Fw="secretAccessKey",Gw="sessionToken",Zz="server",Kz="tokenInput",qz="tokenOutput",Jw="tokenType",X="com.amazonaws.signin",Uw=$.TypeRegistry.for(Qw),Ww=[-3,Qw,"SigninServiceException",0,[],[]];Uw.registerError(Ww,q);var k=$.TypeRegistry.for(X),Xw=[-3,X,iw,{[K]:m},[K,E],[0,0],2];k.registerError(Xw,R);var Yw=[-3,X,Lz,{[K]:Zz,[u]:500},[K,E],[0,0],2];k.registerError(Yw,P);var Zw=[-3,X,Uz,{[K]:m,[u]:429},[K,E],[0,0],2];k.registerError(Zw,v);var Kw=[-3,X,Wz,{[K]:m,[u]:400},[K,E],[0,0],2];k.registerError(Kw,T);var qw=[Uw,k],Bw=[0,X,Qz,8,0],Dw=[3,X,nw,8,[c,Fw,Gw],[[0,{[U]:c}],[0,{[U]:Fw}],[0,{[U]:Gw}]],3],bw=[3,X,zz,0,[Kz],[[()=>Hw,16]],1],Hw=[3,X,Fz,0,[e,n,Xz,zw,o,y],[[0,{[U]:e}],[0,{[U]:n}],0,[0,{[U]:zw}],[0,{[U]:o}],[()=>Bw,{[U]:y}]],2],Mw=[3,X,Jz,0,[qz],[[()=>kw,16]],1],kw=[3,X,Gz,0,[t,Jw,i,y,ww],[[()=>Dw,{[U]:t}],[0,{[U]:Jw}],[1,{[U]:i}],[()=>Bw,{[U]:y}],[0,{[U]:ww}]],4],Vw=[9,X,wz,{[Yz]:["POST","/v1/token",200]},()=>bw,()=>Mw],Bz=(w)=>{return{apiVersion:"2023-01-01",base64Decoder:w?.base64Decoder??D.fromBase64,base64Encoder:w?.base64Encoder??D.toBase64,disableHostPrefix:w?.disableHostPrefix??!1,endpointProvider:w?.endpointProvider??ow,extensions:w?.extensions??[],httpAuthSchemeProvider:w?.httpAuthSchemeProvider??_w,httpAuthSchemes:w?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(z)=>z.getIdentityProvider("aws.auth#sigv4"),signer:new l.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(z)=>z.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new j.NoAuthSigner}],logger:w?.logger??new L.NoOpLogger,protocol:w?.protocol??lw.AwsRestJsonProtocol,protocolSettings:w?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:qw,version:"2023-01-01",serviceTarget:"Signin"},serviceId:w?.serviceId??"Signin",urlParser:w?.urlParser??N.parseUrl,utf8Decoder:w?.utf8Decoder??D.fromUtf8,utf8Encoder:w?.utf8Encoder??D.toUtf8}},Dz=(w)=>{L.emitWarningIfUnsupportedVersion(process.version);let z=Q.resolveDefaultsModeConfig(w),F=()=>z().then(L.loadConfigsForDefaultMode),Y=Bz(w);W.emitWarningIfUnsupportedVersion(process.version);let J={profile:w?.profile,logger:Y.logger};return{...Y,...w,runtime:"node",defaultsMode:z,authSchemePreference:w?.authSchemePreference??Q.loadConfig(l.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,J),bodyLengthChecker:w?.bodyLengthChecker??D.calculateBodyLength,defaultUserAgentProvider:w?.defaultUserAgentProvider??W.createDefaultUserAgentProvider({serviceId:Y.serviceId,clientVersion:rw.version}),maxAttempts:w?.maxAttempts??Q.loadConfig(H.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,w),region:w?.region??Q.loadConfig(Q.NODE_REGION_CONFIG_OPTIONS,{...Q.NODE_REGION_CONFIG_FILE_OPTIONS,...J}),requestHandler:a.NodeHttpHandler.create(w?.requestHandler??F),retryMode:w?.retryMode??Q.loadConfig({...H.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await F()).retryMode||H.DEFAULT_RETRY_MODE},w),sha256:w?.sha256??D.Hash.bind(null,"sha256"),streamCollector:w?.streamCollector??a.streamCollector,useDualstackEndpoint:w?.useDualstackEndpoint??Q.loadConfig(Q.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,J),useFipsEndpoint:w?.useFipsEndpoint??Q.loadConfig(Q.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,J),userAgentAppId:w?.userAgentAppId??Q.loadConfig(W.NODE_APP_ID_CONFIG_OPTIONS,J)}},bz=(w)=>{let{httpAuthSchemes:z,httpAuthSchemeProvider:F,credentials:Y}=w;return{setHttpAuthScheme(J){let V=z.findIndex((A)=>A.schemeId===J.schemeId);if(V===-1)z.push(J);else z.splice(V,1,J)},httpAuthSchemes(){return z},setHttpAuthSchemeProvider(J){F=J},httpAuthSchemeProvider(){return F},setCredentials(J){Y=J},credentials(){return Y}}},Hz=(w)=>{return{httpAuthSchemes:w.httpAuthSchemes(),httpAuthSchemeProvider:w.httpAuthSchemeProvider(),credentials:w.credentials()}},Mz=(w,z)=>{let F=Object.assign(W.getAwsRegionExtensionConfiguration(w),L.getDefaultExtensionConfiguration(w),N.getHttpHandlerExtensionConfiguration(w),bz(w));return z.forEach((Y)=>Y.configure(F)),Object.assign(w,W.resolveAwsRegionExtensionConfiguration(F),L.resolveDefaultRuntimeConfig(F),N.resolveHttpHandlerRuntimeConfig(F),Hz(F))};class h extends L.Client{config;constructor(...[w]){let z=Dz(w||{});super(z);this.initConfig=z;let F=aw(z),Y=W.resolveUserAgentConfig(F),J=H.resolveRetryConfig(Y),V=Q.resolveRegionConfig(J),A=W.resolveHostHeaderConfig(V),Iw=b.resolveEndpointConfig(A),Ow=pw(Iw),jw=Mz(Ow,w?.extensions||[]);this.config=jw,this.middlewareStack.use($.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(W.getUserAgentPlugin(this.config)),this.middlewareStack.use(H.getRetryPlugin(this.config)),this.middlewareStack.use(N.getContentLengthPlugin(this.config)),this.middlewareStack.use(W.getHostHeaderPlugin(this.config)),this.middlewareStack.use(W.getLoggerPlugin(this.config)),this.middlewareStack.use(W.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(j.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:mw,identityProviderConfigProvider:async(Nw)=>new j.DefaultIdentityProviderConfig({"aws.auth#sigv4":Nw.credentials})})),this.middlewareStack.use(j.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class _ extends L.Command.classBuilder().ep(sw).m(function(w,z,F,Y){return[b.getEndpointPlugin(F,w.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(Vw).build(){}var kz={CreateOAuth2TokenCommand:_};class p extends h{}L.createAggregatedClient(kz,p);var Vz={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",SERVER_ERROR:"server_error",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var{Command:Iz,Client:Oz}=L,jz=R,Nz=Xw,yz=Dw,Rz=Vw,Pz=_,vz=bw,Tz=Hw,Ez=Mw,Az=kw,xz=P,Cz=Yw,Sz=Vz,dz=p,$z=h,lz=q,mz=Ww,uz=v,hz=Zw,_z=T,pz=Kw,az=qw;export{az as errorTypeRegistries,Oz as __Client,pz as ValidationException$,_z as ValidationException,hz as TooManyRequestsError$,uz as TooManyRequestsError,mz as SigninServiceException$,lz as SigninServiceException,$z as SigninClient,dz as Signin,Sz as OAuth2ErrorCode,Cz as InternalServerException$,xz as InternalServerException,Az as CreateOAuth2TokenResponseBody$,Ez as CreateOAuth2TokenResponse$,Tz as CreateOAuth2TokenRequestBody$,vz as CreateOAuth2TokenRequest$,Pz as CreateOAuth2TokenCommand,Rz as CreateOAuth2Token$,yz as AccessToken$,Nz as AccessDeniedException$,jz as AccessDeniedException,Iz as $Command};export default {get errorTypeRegistries(){return az},get __Client(){return Oz},get ValidationException$(){return pz},get ValidationException(){return _z},get TooManyRequestsError$(){return hz},get TooManyRequestsError(){return uz},get SigninServiceException$(){return mz},get SigninServiceException(){return lz},get SigninClient(){return $z},get Signin(){return dz},get OAuth2ErrorCode(){return Sz},get InternalServerException$(){return Cz},get InternalServerException(){return xz},get CreateOAuth2TokenResponseBody$(){return Az},get CreateOAuth2TokenResponse$(){return Ez},get CreateOAuth2TokenRequestBody$(){return Tz},get CreateOAuth2TokenRequest$(){return vz},get CreateOAuth2TokenCommand(){return Pz},get CreateOAuth2Token$(){return Rz},get AccessToken$(){return yz},get AccessDeniedException$(){return Nz},get AccessDeniedException(){return jz},get $Command(){return Iz}};
|