@qitqode/qitqode-android-arm64 0.1.23 → 0.1.24
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-9zg3y89v.js → chunk-02txthqv.js} +2 -2
- package/bundle/{chunk-q1472d56.js → chunk-0ae5q6ck.js} +2 -2
- package/bundle/chunk-0bvde0cx.js +2 -0
- package/bundle/chunk-0kbxnazj.js +2 -0
- package/bundle/{chunk-ax9yyznf.js → chunk-0pbt75ev.js} +1 -1
- package/bundle/{chunk-8hh5ejmr.js → chunk-0pvbk8ks.js} +2 -2
- package/bundle/{chunk-9jjjzmvn.js → chunk-0rtshz2r.js} +1 -1
- package/bundle/{chunk-8e2wwdgb.js → chunk-0w0jfzb4.js} +1 -1
- package/bundle/{chunk-9y65kbcf.js → chunk-0w4v0fbs.js} +2 -2
- package/bundle/{chunk-fzzze6zd.js → chunk-0z3z0gk1.js} +2 -2
- package/bundle/{chunk-ypff4a5n.js → chunk-17ggas8k.js} +1 -1
- package/bundle/chunk-19z5q33z.js +2 -0
- package/bundle/chunk-1a0wnwna.js +2 -0
- package/bundle/{chunk-3cpqdake.js → chunk-1d64dywx.js} +2 -2
- package/bundle/chunk-1ddm2wxv.js +2 -0
- package/bundle/chunk-1fk4vsmc.js +2 -0
- package/bundle/{chunk-m8tfv36b.js → chunk-1fnmkm0z.js} +2 -2
- package/bundle/chunk-1j2f9nd5.js +2 -0
- package/bundle/{chunk-b2k9yafd.js → chunk-1jh5p5qw.js} +2 -2
- package/bundle/{chunk-0136n3jt.js → chunk-1jsywey3.js} +1 -1
- package/bundle/{chunk-29hmwttd.js → chunk-1p34bx7c.js} +2 -2
- package/bundle/{chunk-m34zrf70.js → chunk-1xyn0sp2.js} +2 -2
- package/bundle/{chunk-g6gs7cc6.js → chunk-1y9t7nxn.js} +1 -1
- package/bundle/{chunk-zx90w4mt.js → chunk-21ejqv4v.js} +1 -1
- package/bundle/chunk-23geekk5.js +3 -0
- package/bundle/chunk-27s736an.js +2 -0
- package/bundle/{chunk-y68fp4kt.js → chunk-2eardzxs.js} +1 -1
- package/bundle/{chunk-jvkqvgae.js → chunk-2gxjjqfx.js} +1 -1
- package/bundle/chunk-2j17xrzj.js +2 -0
- package/bundle/{chunk-dq1wprmb.js → chunk-2mmspnr3.js} +1 -1
- package/bundle/{chunk-m8njvpb8.js → chunk-2qcndbxv.js} +1 -1
- package/bundle/{chunk-z65snfyw.js → chunk-2wp1w8cy.js} +1 -1
- package/bundle/{chunk-agx5m1ev.js → chunk-2y8qz8te.js} +1 -1
- package/bundle/{chunk-9n6f9n1c.js → chunk-2z6fzwyc.js} +2 -2
- package/bundle/chunk-2zca3nak.js +2 -0
- package/bundle/chunk-2zcvcfq4.js +2 -0
- package/bundle/chunk-38hwkfj5.js +2 -0
- package/bundle/chunk-3afqxvsn.js +2 -0
- package/bundle/chunk-3avc1ppg.js +7 -0
- package/bundle/{chunk-yccm7cfm.js → chunk-3nhqd8wg.js} +3 -3
- package/bundle/{chunk-hqv0s6sw.js → chunk-3tdqsm5c.js} +1 -1
- package/bundle/{chunk-0vhsc0yh.js → chunk-3tkp27x7.js} +2 -2
- package/bundle/chunk-3v4vtah1.js +2 -0
- package/bundle/{chunk-cwkdc1cc.js → chunk-3vbtra1j.js} +1 -1
- package/bundle/{chunk-b54t7ycj.js → chunk-3wzqs241.js} +1 -1
- package/bundle/chunk-3ypk0j2f.js +2 -0
- package/bundle/{chunk-jazpapb9.js → chunk-3z1y040p.js} +2 -2
- package/bundle/{chunk-3w60y2x5.js → chunk-453wpzg6.js} +1 -1
- package/bundle/chunk-4aykrj51.js +9 -0
- package/bundle/{chunk-ejy5404v.js → chunk-4d1a547n.js} +1 -1
- package/bundle/chunk-4dtbmqmq.js +2 -0
- package/bundle/{chunk-7pr4jxkn.js → chunk-4k149ews.js} +1 -1
- package/bundle/{chunk-hyr049cr.js → chunk-4kse3awh.js} +1 -1
- package/bundle/chunk-4q9w2yve.js +5 -0
- package/bundle/{chunk-1gg4c0pq.js → chunk-4tn69nqs.js} +1 -1
- package/bundle/chunk-4zjb6rps.js +2 -0
- package/bundle/{chunk-px15ev1g.js → chunk-58enbars.js} +2 -2
- package/bundle/{chunk-07szgr15.js → chunk-5h2hcp46.js} +1 -1
- package/bundle/chunk-5hkcjgwh.js +2 -0
- package/bundle/{chunk-7b69jj5g.js → chunk-5kmfnkzv.js} +1 -1
- package/bundle/{chunk-hvcdemxe.js → chunk-5rkmhzq0.js} +2 -2
- package/bundle/chunk-5snrz263.js +2 -0
- package/bundle/{chunk-erh9y0sx.js → chunk-5y8efy5b.js} +1 -1
- package/bundle/chunk-653c0mxr.js +11 -0
- package/bundle/chunk-6av7hrrk.js +7 -0
- package/bundle/chunk-6bswn7w5.js +2 -0
- package/bundle/{chunk-sgq94p3x.js → chunk-6dxaty1v.js} +1 -1
- package/bundle/chunk-6epghftw.js +2 -0
- package/bundle/{chunk-a3te67a5.js → chunk-6g3m7yxf.js} +2 -2
- package/bundle/{chunk-5x19yah0.js → chunk-6j0365q3.js} +2 -2
- package/bundle/chunk-6jjhxh8p.js +2 -0
- package/bundle/{chunk-101y7ce2.js → chunk-6mscvf6y.js} +1 -1
- package/bundle/{chunk-mj7rk4xs.js → chunk-6nhje520.js} +1 -1
- package/bundle/{chunk-5wr5gpaa.js → chunk-6sdh1q7g.js} +1 -1
- package/bundle/{chunk-bwvjft74.js → chunk-6szvs3k9.js} +1 -1
- package/bundle/chunk-6ws7xyc5.js +2 -0
- package/bundle/{chunk-n889mwgv.js → chunk-78bajmqm.js} +1 -1
- package/bundle/{chunk-3wzpdvpg.js → chunk-7a6p7dfx.js} +1 -1
- package/bundle/{chunk-kfdqfha0.js → chunk-7dckfame.js} +1 -1
- package/bundle/chunk-7g28zhar.js +2 -0
- package/bundle/{chunk-w6t1qmeg.js → chunk-7gczzccz.js} +1 -1
- package/bundle/{chunk-2wcwbp3t.js → chunk-7mhffm9f.js} +199 -198
- package/bundle/{chunk-7bxe5s20.js → chunk-7tgm8wp5.js} +1 -1
- package/bundle/chunk-7v02b2ms.js +2 -0
- package/bundle/chunk-7vmp2034.js +2 -0
- package/bundle/chunk-7wxrypkr.js +2 -0
- package/bundle/{chunk-576zfh1s.js → chunk-7y3y3j51.js} +2 -2
- package/bundle/{chunk-vay29sqp.js → chunk-7yf15a3a.js} +1 -1
- package/bundle/{chunk-qzd0q1jg.js → chunk-82gs5cmn.js} +1 -1
- package/bundle/{chunk-wf2mj6de.js → chunk-84gnbzky.js} +1 -1
- package/bundle/{chunk-3xf7q4ww.js → chunk-8651hq0k.js} +1 -1
- package/bundle/{chunk-g8zrn0at.js → chunk-8717htya.js} +1 -1
- package/bundle/{chunk-b8z4hgq0.js → chunk-8ace31r2.js} +1 -1
- package/bundle/{chunk-2e9a9brg.js → chunk-8cr7ks31.js} +1 -1
- package/bundle/{chunk-3ne6j2h5.js → chunk-8h9r6c8g.js} +2 -2
- package/bundle/chunk-8kk9gvdy.js +2 -0
- package/bundle/{chunk-haw1jzwb.js → chunk-8pe047p0.js} +1 -1
- package/bundle/{chunk-22tf95dw.js → chunk-8r79zf3y.js} +2 -2
- package/bundle/chunk-8ygpp4y3.js +2 -0
- package/bundle/chunk-95q60g1p.js +2 -0
- package/bundle/{chunk-5d18fd4p.js → chunk-9798jffg.js} +1 -1
- package/bundle/{chunk-r0sjwtfc.js → chunk-99n6czag.js} +2 -2
- package/bundle/{chunk-bwgnmy92.js → chunk-9easaxy7.js} +1 -1
- package/bundle/{chunk-wk11xsdh.js → chunk-9f7y0dj0.js} +1 -1
- package/bundle/{chunk-799c17nk.js → chunk-9jf67xb0.js} +2 -2
- package/bundle/chunk-9mjbenja.js +2 -0
- package/bundle/{chunk-381j1hqf.js → chunk-9nx8hm57.js} +1 -1
- package/bundle/{chunk-bqeyh2gx.js → chunk-9pe4agdz.js} +2 -2
- package/bundle/{chunk-k0v37hc6.js → chunk-9rqrm9y8.js} +1 -1
- package/bundle/{chunk-qx9j6nz1.js → chunk-9sy9ws1w.js} +1 -1
- package/bundle/{chunk-62yja34m.js → chunk-9vcw33dv.js} +1 -1
- package/bundle/chunk-9vn1gy8h.js +2 -0
- package/bundle/{chunk-wmmck56g.js → chunk-9xvctnjr.js} +1 -1
- package/bundle/{chunk-apv1v4tk.js → chunk-a5zjrwqy.js} +2 -2
- package/bundle/{chunk-jj7wrfty.js → chunk-a9y27zd2.js} +1 -1
- package/bundle/{chunk-m3gsrb1x.js → chunk-ac202abt.js} +1 -1
- package/bundle/{chunk-brrtcqrc.js → chunk-agdfqncf.js} +2 -2
- package/bundle/chunk-ajp3f08k.js +2 -0
- package/bundle/{chunk-y0qaz8db.js → chunk-am73j1bt.js} +1 -1
- package/bundle/{chunk-2es79khv.js → chunk-apq38bt4.js} +3 -3
- package/bundle/chunk-aptkpdkc.js +2 -0
- package/bundle/{chunk-7n994qss.js → chunk-b643cra9.js} +211 -211
- package/bundle/{chunk-2e76kpa6.js → chunk-b6m4yyww.js} +1 -1
- package/bundle/{chunk-v1hvnq7y.js → chunk-b8ag61vj.js} +1 -1
- package/bundle/{chunk-k0arcqnt.js → chunk-bas6x25m.js} +2 -2
- package/bundle/{chunk-q6x5bmc3.js → chunk-bd21p9zz.js} +2 -2
- package/bundle/{chunk-fp5mvrrx.js → chunk-bf146hz2.js} +2 -2
- package/bundle/{chunk-s7sksztt.js → chunk-bky5a42k.js} +2 -2
- package/bundle/chunk-bry94ar5.js +2 -0
- package/bundle/chunk-btzyvqkf.js +2 -0
- package/bundle/{chunk-hs8qwx4n.js → chunk-c31k8yh0.js} +1 -1
- package/bundle/chunk-c94pjdfh.js +2 -0
- package/bundle/chunk-cct9ds5c.js +2 -0
- package/bundle/{chunk-3j6nrrva.js → chunk-cesrhm09.js} +1 -1
- package/bundle/{chunk-mwjhyj53.js → chunk-cvchztkc.js} +1 -1
- package/bundle/{chunk-12cd1yj9.js → chunk-cy2586rv.js} +1 -1
- package/bundle/chunk-czn535v0.js +2 -0
- package/bundle/chunk-d56zc21w.js +3 -0
- package/bundle/chunk-d7wd5hz1.js +2 -0
- package/bundle/chunk-d86cmjrp.js +2 -0
- package/bundle/{chunk-t86vj45b.js → chunk-dann9gfq.js} +1 -1
- package/bundle/{chunk-nb0gc3sx.js → chunk-dcx8hjbs.js} +1 -1
- package/bundle/{chunk-p33fchnf.js → chunk-dgzyn27r.js} +1 -1
- package/bundle/{chunk-shav33fq.js → chunk-dkm7x8rj.js} +2 -2
- package/bundle/chunk-dkv2mg97.js +3 -0
- package/bundle/chunk-dnq65xvn.js +2 -0
- package/bundle/chunk-dpqv8rtn.js +2 -0
- package/bundle/chunk-e346x00p.js +10 -0
- package/bundle/chunk-e9mh7s3z.js +2 -0
- package/bundle/{chunk-26m5yn5d.js → chunk-ebjhggdw.js} +1 -1
- package/bundle/{chunk-ntfh16rj.js → chunk-ecwz9nhs.js} +2 -2
- package/bundle/{chunk-jge74hh4.js → chunk-edvcz2gd.js} +1 -1
- package/bundle/chunk-ek2y5f6g.js +2 -0
- package/bundle/{chunk-dsny9dh8.js → chunk-ep8zn49w.js} +2 -2
- package/bundle/chunk-epdsay73.js +2 -0
- package/bundle/{chunk-y3qf1kg9.js → chunk-evqxvhdb.js} +1 -1
- package/bundle/{chunk-58w4dhb6.js → chunk-ewyk4py6.js} +1 -1
- package/bundle/{chunk-scb48j07.js → chunk-f3kjp838.js} +2 -2
- package/bundle/{chunk-3w9k7yxx.js → chunk-f819a7ec.js} +1 -1
- package/bundle/chunk-f89gntcy.js +3 -0
- package/bundle/{chunk-eqed7tvt.js → chunk-fdezde1z.js} +1 -1
- package/bundle/chunk-ffnsn7tv.js +2 -0
- package/bundle/{chunk-7tb9fjvq.js → chunk-fhng5her.js} +2 -2
- package/bundle/chunk-fkezc7ew.js +2 -0
- package/bundle/{chunk-88kt6qmd.js → chunk-fkvccmgk.js} +2 -2
- package/bundle/{chunk-k5294ajv.js → chunk-fm4xa6yx.js} +2 -2
- package/bundle/{chunk-fhjpfzjc.js → chunk-frdc3ysq.js} +1 -1
- package/bundle/chunk-fsxddgj0.js +2 -0
- package/bundle/{chunk-kbhby60s.js → chunk-ftk58wxe.js} +1 -1
- package/bundle/{chunk-shxny9x9.js → chunk-g0v9g37f.js} +1 -1
- package/bundle/{chunk-afpwjn78.js → chunk-g7vkkmsk.js} +3 -3
- package/bundle/chunk-gbcsfg6v.js +2 -0
- package/bundle/{chunk-y2h0adg5.js → chunk-gc9q0x8z.js} +3 -3
- package/bundle/{chunk-s75chpxq.js → chunk-gen6f3dn.js} +2 -2
- package/bundle/{chunk-1eg8mr1q.js → chunk-gf4ek7rv.js} +1 -1
- package/bundle/{chunk-1w8b88y5.js → chunk-gff87y4n.js} +1 -1
- package/bundle/chunk-gfmz85hp.js +2 -0
- package/bundle/chunk-gk63k4t6.js +2 -0
- package/bundle/{chunk-g7742sqm.js → chunk-gn7xgd4c.js} +1 -1
- package/bundle/{chunk-6j07cgna.js → chunk-gn9p1d50.js} +1 -1
- package/bundle/{chunk-yyarzhw3.js → chunk-gvzfffr4.js} +1 -1
- package/bundle/{chunk-zeh3mjgp.js → chunk-ha1w0xzh.js} +1 -1
- package/bundle/{chunk-vxc5q0wk.js → chunk-hbnr0j7h.js} +2 -2
- package/bundle/chunk-hg563h5r.js +3 -0
- package/bundle/{chunk-8k4mkrdw.js → chunk-hg9nk090.js} +1 -1
- package/bundle/{chunk-gjsaw7wm.js → chunk-hh3w51wp.js} +2 -2
- package/bundle/{chunk-naq602da.js → chunk-hh4c02fh.js} +1 -1
- package/bundle/{chunk-k1ht1sjr.js → chunk-hh9a709t.js} +1 -1
- package/bundle/{chunk-7tthc48p.js → chunk-hjbks7r9.js} +1 -1
- package/bundle/{chunk-ky840wjj.js → chunk-hqg5qbxk.js} +1 -1
- package/bundle/{chunk-0svy8w30.js → chunk-hv4nhx6q.js} +2 -2
- package/bundle/{chunk-26mt118z.js → chunk-hxgb0y1w.js} +1 -1
- package/bundle/chunk-j0vf8s12.js +2 -0
- package/bundle/chunk-j1a64ade.js +3 -0
- package/bundle/chunk-j1bxt69x.js +2 -0
- package/bundle/{chunk-t42kh492.js → chunk-j1veq3zr.js} +2 -2
- package/bundle/{chunk-c38ppnm8.js → chunk-jbd9k041.js} +2 -2
- package/bundle/chunk-jcem8s30.js +2 -0
- package/bundle/{chunk-z1hd38wp.js → chunk-jegn6jc3.js} +2 -2
- package/bundle/chunk-jjwjb9w0.js +3 -0
- package/bundle/{chunk-87pzwjjj.js → chunk-jmjg8d8a.js} +4 -4
- package/bundle/chunk-jpham2a3.js +2 -0
- package/bundle/{chunk-jq6y56m5.js → chunk-jpygkh1c.js} +1 -1
- package/bundle/{chunk-rwanncah.js → chunk-jr8qcf99.js} +2 -2
- package/bundle/{chunk-rmmyjyr9.js → chunk-jr9xnvjq.js} +1 -1
- package/bundle/{chunk-t66hycva.js → chunk-jz3aav8a.js} +2 -2
- package/bundle/chunk-jzkymnr5.js +2 -0
- package/bundle/chunk-k0qtwnhb.js +2 -0
- package/bundle/{chunk-bkaprkf6.js → chunk-k16hzy2q.js} +1 -1
- package/bundle/chunk-k2rsky7z.js +2 -0
- package/bundle/{chunk-an5sr6gw.js → chunk-k9d927xe.js} +1 -1
- package/bundle/{chunk-cz8nnm2a.js → chunk-k9g77a02.js} +1 -1
- package/bundle/{chunk-sjqgmp12.js → chunk-kaeyhw2n.js} +2 -2
- package/bundle/{chunk-kpkbyek5.js → chunk-kc3hpmr2.js} +2 -2
- package/bundle/chunk-kcetcysa.js +2 -0
- package/bundle/chunk-kjfc5v3s.js +2 -0
- package/bundle/chunk-kkvb2c2z.js +8 -0
- package/bundle/chunk-km2ayfyf.js +2 -0
- package/bundle/chunk-knrh89eb.js +2 -0
- package/bundle/{chunk-g0vzdt58.js → chunk-kr0fsqas.js} +1 -1
- package/bundle/chunk-ksqfjawv.js +2 -0
- package/bundle/{chunk-863s0tqa.js → chunk-ktmazmas.js} +2 -2
- package/bundle/{chunk-c4x99ayd.js → chunk-m8djypsy.js} +1 -1
- package/bundle/{chunk-qr2ave8f.js → chunk-mj24ntn9.js} +1 -1
- package/bundle/chunk-mjhb1q0n.js +3 -0
- package/bundle/{chunk-c546xxjk.js → chunk-ms1fd6h4.js} +1 -1
- package/bundle/chunk-mxcger73.js +2 -0
- package/bundle/{chunk-tfpwfczs.js → chunk-n1chdwrs.js} +1 -1
- package/bundle/{chunk-mt8btwrv.js → chunk-najzfhb2.js} +1 -1
- package/bundle/chunk-nazkrkeb.js +2 -0
- package/bundle/chunk-nk01s49e.js +2 -0
- package/bundle/{chunk-9tq5yt3t.js → chunk-ns0pswww.js} +1 -1
- package/bundle/chunk-ns8b7rx1.js +2 -0
- package/bundle/chunk-ny6vpkx2.js +2 -0
- package/bundle/{chunk-qkn4039t.js → chunk-p4hpr8d7.js} +1 -1
- package/bundle/{chunk-n1m5qdf5.js → chunk-p54bzjtv.js} +1 -1
- package/bundle/{chunk-q1nvfmrm.js → chunk-pb7rnkke.js} +1 -1
- package/bundle/{chunk-70gfpkxv.js → chunk-pfhp78cr.js} +1 -1
- package/bundle/{chunk-y2r3zker.js → chunk-ps543k72.js} +1 -1
- package/bundle/{chunk-w9vv1whr.js → chunk-pv8jcpnf.js} +1 -1
- package/bundle/{chunk-9yaw0hbp.js → chunk-pyq01301.js} +1 -1
- package/bundle/chunk-q0dd3ak6.js +3 -0
- package/bundle/chunk-q2s057bm.js +2 -0
- package/bundle/{chunk-2qy760rf.js → chunk-q3x4x2tq.js} +1 -1
- package/bundle/chunk-q5cqg2c0.js +28 -0
- package/bundle/{chunk-kktcccep.js → chunk-q6fbyvpq.js} +1 -1
- package/bundle/chunk-qk2wnp2x.js +2 -0
- package/bundle/{chunk-05badzhy.js → chunk-qw2hgs5b.js} +2 -2
- package/bundle/{chunk-5dpev64z.js → chunk-qywwj58s.js} +2 -2
- package/bundle/chunk-r012q335.js +3 -0
- package/bundle/{chunk-5vyper2h.js → chunk-r3yqe7x0.js} +1 -1
- package/bundle/{chunk-xqzbcs8x.js → chunk-r48g0kaq.js} +2 -2
- package/bundle/{chunk-22vvjp4g.js → chunk-r7xp0xcn.js} +2 -2
- package/bundle/chunk-rbdjbgkb.js +2 -0
- package/bundle/{chunk-m81z3zgm.js → chunk-rvvfs9ps.js} +2 -2
- package/bundle/chunk-rxjprhgh.js +2 -0
- package/bundle/chunk-s3w9bmze.js +2 -0
- package/bundle/chunk-s3zste1a.js +2 -0
- package/bundle/{chunk-f958hsha.js → chunk-s9amvacw.js} +2 -2
- package/bundle/chunk-sbt7qmwm.js +3 -0
- package/bundle/chunk-sf6h44pb.js +2 -0
- package/bundle/{chunk-kn9skc0g.js → chunk-sgtgvzv6.js} +1 -1
- package/bundle/chunk-sgvzxs7m.js +2 -0
- package/bundle/{chunk-ac69b9tm.js → chunk-sjrmhd3e.js} +1 -1
- package/bundle/chunk-sp9bndyh.js +2 -0
- package/bundle/{chunk-7m4camry.js → chunk-spm1yy6w.js} +1 -1
- package/bundle/{chunk-xtj5qqsw.js → chunk-srf73nm4.js} +1 -1
- package/bundle/{chunk-fnect0ny.js → chunk-sswbfqcq.js} +1 -1
- package/bundle/{chunk-zzdbrxkh.js → chunk-t488d66k.js} +1 -1
- package/bundle/{chunk-w6zgm4vn.js → chunk-t6w96xq2.js} +1 -1
- package/bundle/{chunk-xjr0xy58.js → chunk-te1zfpzv.js} +1 -1
- package/bundle/{chunk-mwbcmvmh.js → chunk-tk3bve0x.js} +2 -2
- package/bundle/chunk-tsn1jkr7.js +2 -0
- package/bundle/{chunk-dn1jryxz.js → chunk-tzc4jkzg.js} +1 -1
- package/bundle/{chunk-kdr6nxmk.js → chunk-v2kyarwz.js} +2 -2
- package/bundle/{chunk-mg03szpz.js → chunk-v7r9np94.js} +1 -1
- package/bundle/{chunk-my0kzcby.js → chunk-va4davgy.js} +317 -297
- package/bundle/{chunk-febbrhev.js → chunk-vavrczqm.js} +1 -1
- package/bundle/{chunk-hk1ha5fj.js → chunk-ve5gb789.js} +2 -2
- package/bundle/{chunk-ar1by07g.js → chunk-vf1r5ckp.js} +1 -1
- package/bundle/{chunk-hnzs3ywg.js → chunk-vftqwdpg.js} +1 -1
- package/bundle/chunk-vg4styg5.js +2 -0
- package/bundle/chunk-vh09hhcs.js +2 -0
- package/bundle/chunk-vhktpm0n.js +2 -0
- package/bundle/{chunk-36c2avm4.js → chunk-vvypb02q.js} +1 -1
- package/bundle/{chunk-g6tw5dvr.js → chunk-vzjcmwry.js} +2 -2
- package/bundle/{chunk-fvwys8ej.js → chunk-w1atxyz0.js} +1 -1
- package/bundle/{chunk-44amvtcs.js → chunk-w7p2x973.js} +2 -2
- package/bundle/{chunk-ecczet3b.js → chunk-wa2ce2sg.js} +2 -2
- package/bundle/{chunk-24r5h0fx.js → chunk-wf09j72q.js} +2 -2
- package/bundle/{chunk-w8r4gjea.js → chunk-wfnk2vsd.js} +1 -1
- package/bundle/{chunk-1vx26nt2.js → chunk-wj6aq50n.js} +1 -1
- package/bundle/{chunk-39h565hz.js → chunk-wmrq9qqf.js} +1 -1
- package/bundle/{chunk-cbfjjbfd.js → chunk-wmw2gne9.js} +2 -2
- package/bundle/chunk-wtp0yvqw.js +2 -0
- package/bundle/{chunk-g7g3zm4v.js → chunk-x6z2b63w.js} +1 -1
- package/bundle/{chunk-g5g9r3v5.js → chunk-xccs5c50.js} +1 -1
- package/bundle/{chunk-2adsn1ca.js → chunk-xj73j10a.js} +1 -1
- package/bundle/chunk-xmzs7q66.js +2 -0
- package/bundle/chunk-xv80476w.js +2 -0
- package/bundle/{chunk-gz8x3915.js → chunk-xv8gnkh5.js} +1 -1
- package/bundle/{chunk-g2ec45xj.js → chunk-y1srca0c.js} +2 -2
- package/bundle/{chunk-gzse9pab.js → chunk-y2jmtfdh.js} +2 -2
- package/bundle/{chunk-c7dt464m.js → chunk-y3n31nnx.js} +2 -2
- package/bundle/{chunk-2qj66wf5.js → chunk-ygj1cy0n.js} +1 -1
- package/bundle/{chunk-k3pvgwgc.js → chunk-yh174jhg.js} +2 -2
- package/bundle/chunk-yjvr0et1.js +2 -0
- package/bundle/{chunk-63pvqy8n.js → chunk-yz7rqzby.js} +3 -3
- package/bundle/{chunk-w32tj884.js → chunk-yzdty5t9.js} +2 -2
- package/bundle/{chunk-yffkcska.js → chunk-zavtsfxz.js} +1 -1
- package/bundle/{chunk-y62tnk9q.js → chunk-zeh481tm.js} +2 -2
- package/bundle/{chunk-cn7nnjsf.js → chunk-zfnbk5gy.js} +1 -1
- package/bundle/{chunk-tydvpy1s.js → chunk-zk8n8hnh.js} +2 -2
- package/bundle/{chunk-agyxa9nj.js → chunk-zp2ffbc2.js} +2 -2
- package/bundle/chunk-zx3kcfkj.js +2 -0
- package/bundle/index.js +4 -4
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-1by6y9tm.js +0 -2
- package/bundle/chunk-1gjh45v5.js +0 -9
- package/bundle/chunk-1p7wqmxp.js +0 -2
- package/bundle/chunk-1v47v7vm.js +0 -3
- package/bundle/chunk-21hnx8rx.js +0 -24
- package/bundle/chunk-22pvftx8.js +0 -2
- package/bundle/chunk-2bce1njy.js +0 -2
- package/bundle/chunk-338hbnza.js +0 -11
- package/bundle/chunk-3gsvbfqz.js +0 -2
- package/bundle/chunk-3sem578c.js +0 -3
- package/bundle/chunk-3vgnqaem.js +0 -2
- package/bundle/chunk-3xrhxyz9.js +0 -2
- package/bundle/chunk-3zdyrnvp.js +0 -2
- package/bundle/chunk-4nhbgva1.js +0 -2
- package/bundle/chunk-5ch23jj3.js +0 -2
- package/bundle/chunk-5hzkd9te.js +0 -2
- package/bundle/chunk-5vwhfa42.js +0 -2
- package/bundle/chunk-662x3gq6.js +0 -2
- package/bundle/chunk-6an0pk19.js +0 -2
- package/bundle/chunk-6ybqwnp7.js +0 -2
- package/bundle/chunk-7365jzj1.js +0 -2
- package/bundle/chunk-7amvpgng.js +0 -2
- package/bundle/chunk-7dcz5ytp.js +0 -2
- package/bundle/chunk-7h7bwjmm.js +0 -2
- package/bundle/chunk-7vk5fhhv.js +0 -2
- package/bundle/chunk-7vqw9wge.js +0 -2
- package/bundle/chunk-7vxk5t11.js +0 -2
- package/bundle/chunk-83fm5xcn.js +0 -2
- package/bundle/chunk-8b644ae2.js +0 -2
- package/bundle/chunk-av2q0ffj.js +0 -2
- package/bundle/chunk-avk3wfch.js +0 -7
- package/bundle/chunk-azna4wdf.js +0 -2
- package/bundle/chunk-b192q4m0.js +0 -2
- package/bundle/chunk-bh46627y.js +0 -2
- package/bundle/chunk-c267ggx2.js +0 -2
- package/bundle/chunk-c6kxegws.js +0 -2
- package/bundle/chunk-cek3cfz4.js +0 -2
- package/bundle/chunk-ete0y35c.js +0 -2
- package/bundle/chunk-f1mmzzsn.js +0 -2
- package/bundle/chunk-f66cvq2q.js +0 -2
- package/bundle/chunk-fd1vbz1f.js +0 -3
- package/bundle/chunk-fq4v97xn.js +0 -2
- package/bundle/chunk-fw1f6br4.js +0 -2
- package/bundle/chunk-g3pb8rad.js +0 -2
- package/bundle/chunk-gc1yetqd.js +0 -2
- package/bundle/chunk-gtckkn15.js +0 -2
- package/bundle/chunk-gtzreftf.js +0 -2
- package/bundle/chunk-hg7kfd0t.js +0 -3
- package/bundle/chunk-j5vahbw1.js +0 -2
- package/bundle/chunk-jek1cnfk.js +0 -3
- package/bundle/chunk-jevrajsx.js +0 -2
- package/bundle/chunk-jzdks7bv.js +0 -2
- package/bundle/chunk-k1e7w7w5.js +0 -2
- package/bundle/chunk-k33xx2z9.js +0 -2
- package/bundle/chunk-k6vf6vq6.js +0 -2
- package/bundle/chunk-kn391hb2.js +0 -2
- package/bundle/chunk-knmba0q6.js +0 -2
- package/bundle/chunk-knnemqfm.js +0 -3
- package/bundle/chunk-kx4b39v6.js +0 -2
- package/bundle/chunk-mah572rs.js +0 -2
- package/bundle/chunk-mg6nwfw3.js +0 -2
- package/bundle/chunk-pdgrang4.js +0 -2
- package/bundle/chunk-r3q82hz3.js +0 -2
- package/bundle/chunk-r4ygs0jv.js +0 -2
- package/bundle/chunk-r6xhxvjv.js +0 -2
- package/bundle/chunk-r79mz5kd.js +0 -5
- package/bundle/chunk-r99pnfra.js +0 -2
- package/bundle/chunk-rjjgnvdk.js +0 -2
- package/bundle/chunk-rq4xdyst.js +0 -2
- package/bundle/chunk-rsd3v7cg.js +0 -2
- package/bundle/chunk-rxsgbdv0.js +0 -2
- package/bundle/chunk-s4x1jhj3.js +0 -2
- package/bundle/chunk-sx760d9d.js +0 -2
- package/bundle/chunk-tmjd3evp.js +0 -8
- package/bundle/chunk-tp1d856p.js +0 -2
- package/bundle/chunk-tpxs00p5.js +0 -2
- package/bundle/chunk-tqk12r89.js +0 -2
- package/bundle/chunk-tycgrqgq.js +0 -2
- package/bundle/chunk-tz8qhbk9.js +0 -3
- package/bundle/chunk-v1y3pbfv.js +0 -2
- package/bundle/chunk-v32cyrg2.js +0 -2
- package/bundle/chunk-v7pypmvk.js +0 -2
- package/bundle/chunk-vbqyddy8.js +0 -2
- package/bundle/chunk-vgx86f2r.js +0 -2
- package/bundle/chunk-w0jvqdez.js +0 -2
- package/bundle/chunk-w79yek40.js +0 -2
- package/bundle/chunk-w7nxsfbd.js +0 -3
- package/bundle/chunk-wcea06cr.js +0 -2
- package/bundle/chunk-wcx4bbvn.js +0 -2
- package/bundle/chunk-wdw183vh.js +0 -2
- package/bundle/chunk-wqd3svh6.js +0 -2
- package/bundle/chunk-wqe5spdq.js +0 -2
- package/bundle/chunk-wqww2byk.js +0 -2
- package/bundle/chunk-wybd806z.js +0 -2
- package/bundle/chunk-x1vb00hr.js +0 -2
- package/bundle/chunk-xafh07r3.js +0 -2
- package/bundle/chunk-xgzjcsad.js +0 -2
- package/bundle/chunk-xn0xhd0w.js +0 -3
- package/bundle/chunk-xnbfy5jy.js +0 -2
- package/bundle/chunk-xxed39zx.js +0 -3
- package/bundle/chunk-y6pzag4n.js +0 -2
- package/bundle/chunk-y7w6fjwt.js +0 -2
- package/bundle/chunk-yr4evt94.js +0 -7
- package/bundle/chunk-z195gv71.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Dq as I3,Ep as T,Lp as m,Up as A,Zp as O3,nq as l,pq as k,qq as O,uq as s,vq as S,xq as c,yq as u,zq as i}from"./chunk-fp5mvrrx.js";import{Gq as q3,Lq as v,Sq as y}from"./chunk-zzdbrxkh.js";import"./chunk-cqtkxwd8.js";import"./chunk-xtj5qqsw.js";import{Eu as j}from"./chunk-22vvjp4g.js";import"./chunk-a3te67a5.js";import"./chunk-naq602da.js";function h(Q){switch(Q.type){case"text":case"error-text":return Q.value;case"execution-denied":return Q.reason??"Tool execution denied.";case"content":case"json":case"error-json":return JSON.stringify(Q.value)}}function C(Q){return Q?.providerOptions?.copilot??{}}function Z3(Q){let G=[];for(let{role:W,content:N,...q}of Q){let L=C({...q});switch(W){case"system":{G.push({role:"system",content:N,...L});break}case"user":{if(N.length===1&&N[0].type==="text"){G.push({role:"user",content:N[0].text,...C(N[0])});break}G.push({role:"user",content:N.map((Z)=>{let Y=C(Z);switch(Z.type){case"text":return{type:"text",text:Z.text,...Y};case"file":if(Z.mediaType.startsWith("image/")){let $=Z.mediaType==="image/*"?"image/jpeg":Z.mediaType;return{type:"image_url",image_url:{url:Z.data instanceof URL?Z.data.toString():`data:${$};base64,${m(Z.data)}`},...Y}}else throw new y({functionality:`file part media type ${Z.mediaType}`})}}),...L});break}case"assistant":{let Z="",Y,$,J=[];for(let E of N){let _=C(E),X=E.providerOptions?.copilot?.reasoningOpaque;if(X&&!$)$=X;switch(E.type){case"text":{Z+=E.text;break}case"reasoning":{if(E.text)Y=E.text;break}case"tool-call":{J.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)},..._});break}}}G.push({role:"assistant",content:Z||null,tool_calls:J.length>0?J:void 0,reasoning_text:$?Y:void 0,reasoning_opaque:$,...L});break}case"tool":{for(let Z of N){if(Z.type==="tool-approval-response")continue;let Y=Z.output,$=C(Z);G.push({role:"tool",tool_call_id:Z.toolCallId,content:h(Y),...$})}break}default:throw Error(`Unsupported role: ${W}`)}}return G}function n({id:Q,model:G,created:W}){return{id:Q??void 0,modelId:G??void 0,timestamp:W!=null?new Date(W*1000):void 0}}function r(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var g=j.object({user:j.string().optional(),reasoningEffort:j.string().optional(),textVerbosity:j.string().optional(),thinking_budget:j.number().optional()});var t=j.object({error:j.object({message:j.string(),type:j.string().nullish(),param:j.any().nullish(),code:j.union([j.string(),j.number()]).nullish()})}),$3={errorSchema:t,errorToMessage:(Q)=>Q.error.message};function d(Q){return new TransformStream({start(G){G.enqueue({type:"stream-start",warnings:Q.warnings})},transform(G,W){if(Q.includeRawChunks)W.enqueue({type:"raw",rawValue:G.rawValue});if(!G.success){Q.onParseError(),W.enqueue({type:"error",error:G.error});return}Q.transformValue(G.value,W,G.rawValue)},flush:Q.flush})}function E3({tools:Q,toolChoice:G}){Q=Q?.length?Q:void 0;let W=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:W};let N=[];for(let L of Q)if(L.type==="provider")W.push({type:"unsupported",feature:`tool type: ${L.type}`});else N.push({type:"function",function:{name:L.name,description:L.description,parameters:L.inputSchema}});if(G==null)return{tools:N,toolChoice:void 0,toolWarnings:W};let q=G.type;switch(q){case"auto":case"none":case"required":return{tools:N,toolChoice:q,toolWarnings:W};case"tool":return{tools:N,toolChoice:{type:"function",function:{name:G.toolName}},toolWarnings:W};default:throw new y({functionality:`tool choice type: ${q}`})}}class a{specificationVersion="v3";supportsStructuredOutputs;modelId;config;failedResponseHandler;chunkSchema;constructor(Q,G){this.modelId=Q,this.config=G;let W=G.errorStructure??$3;this.chunkSchema=h3(W.errorSchema),this.failedResponseHandler=c(W),this.supportsStructuredOutputs=G.supportsStructuredOutputs??!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){return this.config.supportedUrls?.()??{}}async getArgs({prompt:Q,maxOutputTokens:G,temperature:W,topP:N,topK:q,frequencyPenalty:L,presencePenalty:Z,providerOptions:Y,stopSequences:$,responseFormat:J,seed:E,toolChoice:_,tools:X}){let K=[],B=Object.assign(await k({provider:"copilot",providerOptions:Y,schema:g})??{},await k({provider:this.providerOptionsName,providerOptions:Y,schema:g})??{});if(q!=null)K.push({type:"unsupported",feature:"topK"});if(J?.type==="json"&&J.schema!=null&&!this.supportsStructuredOutputs)K.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:U,toolChoice:M,toolWarnings:V}=E3({tools:X,toolChoice:_});return{args:{model:this.modelId,user:B.user,max_tokens:G,temperature:W,top_p:N,frequency_penalty:L,presence_penalty:Z,response_format:J?.type==="json"?this.supportsStructuredOutputs===!0&&J.schema!=null?{type:"json_schema",json_schema:{schema:J.schema,name:J.name??"response",description:J.description}}:{type:"json_object"}:void 0,stop:$,seed:E,...Object.fromEntries(Object.entries(Y?.[this.providerOptionsName]??{}).filter(([H])=>!Object.keys(g.shape).includes(H))),reasoning_effort:B.reasoningEffort,verbosity:B.textVerbosity,messages:Z3(Q),tools:U,tool_choice:M,thinking_budget:B.thinking_budget},warnings:[...K,...V]}}async doGenerate(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N=JSON.stringify(G),{responseHeaders:q,value:L,rawValue:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(m3),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=L.choices[0],$=[],J=Y.message.content;if(J!=null&&J.length>0)$.push({type:"text",text:J,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let E=Y.message.reasoning_text;if(E!=null&&E.length>0)$.push({type:"reasoning",text:E,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});if(Y.message.tool_calls!=null)for(let K of Y.message.tool_calls)$.push({type:"tool-call",toolCallId:K.id??A(),toolName:K.function.name,input:K.function.arguments,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let _={[this.providerOptionsName]:{},...await this.config.metadataExtractor?.extractMetadata?.({parsedBody:Z})},X=L.usage?.completion_tokens_details;if(X?.accepted_prediction_tokens!=null)_[this.providerOptionsName].acceptedPredictionTokens=X?.accepted_prediction_tokens;if(X?.rejected_prediction_tokens!=null)_[this.providerOptionsName].rejectedPredictionTokens=X?.rejected_prediction_tokens;return{content:$,finishReason:{unified:r(Y.finish_reason),raw:Y.finish_reason??void 0},usage:{inputTokens:{total:L.usage?.prompt_tokens??void 0,noCache:void 0,cacheRead:L.usage?.prompt_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:L.usage?.completion_tokens??void 0,text:void 0,reasoning:L.usage?.completion_tokens_details?.reasoning_tokens??void 0},raw:L.usage??void 0},providerMetadata:_,request:{body:N},response:{...n(L),headers:q,body:Z},warnings:W}}async doStream(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N={...G,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},q=this.config.metadataExtractor?.createStreamExtractor(),{responseHeaders:L,value:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:N,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:u(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=[],$={unified:"other",raw:void 0},J={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0},totalTokens:void 0},E=!0,_=this.providerOptionsName,X=!1,K=!1,B,U=(M,V)=>{V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:M.id??A(),toolName:M.function.name,input:M.function.arguments,providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),M.hasFinished=!0};return{stream:Z.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{$={unified:"error",raw:void 0}},transformValue:(M,V,H)=>{if(q?.processChunk(H),"error"in M){$={unified:"error",raw:void 0},V.enqueue({type:"error",error:M.error.message});return}if(E)E=!1,V.enqueue({type:"response-metadata",...n(M)});if(M.usage!=null){let{prompt_tokens:P,completion_tokens:b,total_tokens:f,prompt_tokens_details:R,completion_tokens_details:w}=M.usage;if(J.promptTokens=P??void 0,J.completionTokens=b??void 0,J.totalTokens=f??void 0,w?.reasoning_tokens!=null)J.completionTokensDetails.reasoningTokens=w?.reasoning_tokens;if(w?.accepted_prediction_tokens!=null)J.completionTokensDetails.acceptedPredictionTokens=w?.accepted_prediction_tokens;if(w?.rejected_prediction_tokens!=null)J.completionTokensDetails.rejectedPredictionTokens=w?.rejected_prediction_tokens;if(R?.cached_tokens!=null)J.promptTokensDetails.cachedTokens=R?.cached_tokens}let D=M.choices[0];if(D?.finish_reason!=null)$={unified:r(D.finish_reason),raw:D.finish_reason??void 0};if(D?.delta==null)return;let x=D.delta;if(x.reasoning_opaque){if(B!=null)throw new v({data:x,message:"Multiple reasoning_opaque values received in a single response. Only one thinking part per response is supported."});B=x.reasoning_opaque}let z=x.reasoning_text;if(z){if(!X)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),X=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:z})}if(x.content){if(X&&!K)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;if(!K)V.enqueue({type:"text-start",id:"txt-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),K=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:x.content})}if(x.tool_calls!=null){if(X)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;for(let P of x.tool_calls){let b=P.index;if(Y[b]==null){if(P.id==null)throw new v({data:P,message:"Expected 'id' to be a string."});if(P.function?.name==null)throw new v({data:P,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:P.id,toolName:P.function.name}),Y[b]={id:P.id,type:"function",function:{name:P.function.name,arguments:P.function.arguments??""},hasFinished:!1};let R=Y[b];if(R.function?.name!=null&&R.function?.arguments!=null){if(R.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:R.id,delta:R.function.arguments});if(l(R.function.arguments))U(R,V)}continue}let f=Y[b];if(f.hasFinished)continue;if(P.function?.arguments!=null)f.function.arguments+=P.function?.arguments??"";if(V.enqueue({type:"tool-input-delta",id:f.id,delta:P.function.arguments??""}),f.function?.name!=null&&f.function?.arguments!=null&&l(f.function.arguments))U(f,V)}}},flush:(M)=>{if(X)M.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0});if(K)M.enqueue({type:"text-end",id:"txt-0"});for(let H of Y.filter((D)=>!D.hasFinished))M.enqueue({type:"tool-input-end",id:H.id}),M.enqueue({type:"tool-call",toolCallId:H.id??A(),toolName:H.function.name,input:H.function.arguments});let V={[_]:{},...B?{copilot:{reasoningOpaque:B}}:{},...q?.buildMetadata()};if(J.completionTokensDetails.acceptedPredictionTokens!=null)V[_].acceptedPredictionTokens=J.completionTokensDetails.acceptedPredictionTokens;if(J.completionTokensDetails.rejectedPredictionTokens!=null)V[_].rejectedPredictionTokens=J.completionTokensDetails.rejectedPredictionTokens;M.enqueue({type:"finish",finishReason:$,usage:{inputTokens:{total:J.promptTokens,noCache:J.promptTokens!=null&&J.promptTokensDetails.cachedTokens!=null?J.promptTokens-J.promptTokensDetails.cachedTokens:void 0,cacheRead:J.promptTokensDetails.cachedTokens,cacheWrite:void 0},outputTokens:{total:J.completionTokens,text:void 0,reasoning:J.completionTokensDetails.reasoningTokens},raw:{prompt_tokens:J.promptTokens??null,completion_tokens:J.completionTokens??null,total_tokens:J.totalTokens??null}},providerMetadata:V})}})),request:{body:N},response:{headers:L}}}}var G3=j.object({prompt_tokens:j.number().nullish(),completion_tokens:j.number().nullish(),total_tokens:j.number().nullish(),prompt_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),completion_tokens_details:j.object({reasoning_tokens:j.number().nullish(),accepted_prediction_tokens:j.number().nullish(),rejected_prediction_tokens:j.number().nullish()}).nullish()}).nullish(),m3=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant").nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({id:j.string().nullish(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish()})),usage:G3}),h3=(Q)=>j.union([j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({index:j.number(),id:j.string().nullish(),function:j.object({name:j.string().nullish(),arguments:j.string().nullish()})})).nullish()}).nullish(),finish_reason:j.string().nullish()})),usage:G3}),Q]);var g3=t,e=c({errorSchema:g3,errorToMessage:(Q)=>Q.error.message});var o=j.object({action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeoutMs:j.number().optional(),user:j.string().optional(),workingDirectory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),j3=j.object({output:j.string()}),o0=S({id:"openai.local_shell",inputSchema:o,outputSchema:j3});function J3(Q,G){if(!G)return!1;return G.some((W)=>Q.startsWith(W))}async function K3({prompt:Q,systemMessageMode:G,fileIdPrefixes:W,store:N,hasLocalShellTool:q=!1}){let L=[],Z=[],Y=new Set;for(let{role:$,content:J}of Q)switch($){case"system":{switch(G){case"system":{L.push({role:"system",content:J});break}case"developer":{L.push({role:"developer",content:J});break}case"remove":{Z.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${G}`)}break}case"user":{L.push({role:"user",content:J.map((E,_)=>{switch(E.type){case"text":return{type:"input_text",text:E.text};case"file":if(E.mediaType.startsWith("image/")){let X=E.mediaType==="image/*"?"image/jpeg":E.mediaType;return{type:"input_image",...E.data instanceof URL?{image_url:E.data.toString()}:typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{image_url:`data:${X};base64,${m(E.data)}`},detail:E.providerOptions?.openai?.imageDetail}}else if(E.mediaType==="application/pdf"){if(E.data instanceof URL)return{type:"input_file",file_url:E.data.toString()};return{type:"input_file",...typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{filename:E.filename??`part-${_}.pdf`,file_data:`data:application/pdf;base64,${m(E.data)}`}}}else throw new y({functionality:`file part media type ${E.mediaType}`})}})});break}case"assistant":{let E={},_={};for(let X of J)switch(X.type){case"text":{L.push({role:"assistant",content:[{type:"output_text",text:X.text}],id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-call":{if(_[X.toolCallId]=X,X.providerExecuted)break;if(q&&X.toolName==="local_shell"){let K=o.parse(X.input);L.push({type:"local_shell_call",call_id:X.toolCallId,id:X.providerOptions?.openai?.itemId??void 0,action:{type:"exec",command:K.action.command,timeout_ms:K.action.timeoutMs,user:K.action.user,working_directory:K.action.workingDirectory,env:K.action.env}});break}L.push({type:"function_call",call_id:X.toolCallId,name:X.toolName,arguments:JSON.stringify(X.input),id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-result":{if(N)L.push({type:"item_reference",id:X.toolCallId});else Z.push({type:"other",message:`Results for OpenAI tool ${X.toolName} are not sent to the API when store is false`});break}case"reasoning":{let K=await k({provider:"copilot",providerOptions:X.providerOptions,schema:d3}),B=K?.itemId;if(B!=null){let U=E[B];if(N){if(U===void 0)L.push({type:"item_reference",id:B}),E[B]={type:"reasoning",id:B,summary:[]}}else{let M=[];if(X.text.length>0)M.push({type:"summary_text",text:X.text});else if(U!==void 0)Z.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(X)}.`});if(U===void 0)E[B]={type:"reasoning",id:B,encrypted_content:K?.reasoningEncryptedContent,summary:M},L.push(E[B]);else U.summary.push(...M)}}else Z.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(X)}.`});break}}break}case"tool":{for(let E of J){if(E.type==="tool-approval-response"){if(Y.has(E.approvalId))continue;if(Y.add(E.approvalId),N)L.push({type:"item_reference",id:E.approvalId});L.push({type:"mcp_approval_response",approval_request_id:E.approvalId,approve:E.approved});continue}let _=E.output;if(_.type==="execution-denied"){if(_.providerOptions?.openai?.approvalId)continue}if(q&&E.toolName==="local_shell"&&_.type==="json"){L.push({type:"local_shell_call_output",call_id:E.toolCallId,output:j3.parse(_.value).output});break}L.push({type:"function_call_output",call_id:E.toolCallId,output:h(_)})}break}default:throw Error(`Unsupported role: ${$}`)}return{input:L,warnings:Z}}var d3=j.object({itemId:j.string().nullish(),reasoningEncryptedContent:j.string().nullish()});function V3({finishReason:Q,hasFunctionCall:G}){switch(Q){case void 0:case null:return G?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return G?"tool-calls":"other"}}var v3=j.object({code:j.string().nullish(),containerId:j.string()}),c3=j.object({outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullish()}),H3=j.object({container:j.union([j.string(),j.object({fileIds:j.array(j.string()).optional()})]).optional()}),Kj=S({id:"openai.code_interpreter",inputSchema:v3,outputSchema:c3});var B3=j.object({key:j.string(),type:j.enum(["eq","ne","gt","gte","lt","lte"]),value:j.union([j.string(),j.number(),j.boolean()])}),L3=j.object({type:j.enum(["and","or"]),filters:j.array(j.union([B3,j.lazy(()=>L3)]))}),U3=j.object({vectorStoreIds:j.array(j.string()),maxNumResults:j.number().optional(),ranking:j.object({ranker:j.string().optional(),scoreThreshold:j.number().optional()}).optional(),filters:j.union([B3,L3]).optional()}),u3=j.object({queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),fileId:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullable()}),Uj=S({id:"openai.file_search",inputSchema:j.object({}),outputSchema:u3});var I=j.discriminatedUnion("type",[j.object({type:j.literal("search"),query:j.string().nullish()}),j.object({type:j.literal("open_page"),url:j.string()}),j.object({type:j.literal("find"),url:j.string(),pattern:j.string()})]),p=j.object({type:j.literal("approximate"),country:j.string().optional(),city:j.string().optional(),region:j.string().optional(),timezone:j.string().optional()});var N3=j.object({filters:j.object({allowedDomains:j.array(j.string()).optional()}).optional(),searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Pj=s({id:"openai.web_search",inputSchema:j.object({action:I.nullish()})});var D3=j.object({searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Aj=s({id:"openai.web_search_preview",inputSchema:j.object({action:I.nullish()})});var W3=j.object({background:j.enum(["auto","opaque","transparent"]).optional(),inputFidelity:j.enum(["low","high"]).optional(),inputImageMask:j.object({fileId:j.string().optional(),imageUrl:j.string().optional()}).optional(),model:j.string().optional(),moderation:j.enum(["auto"]).optional(),outputCompression:j.number().int().min(0).max(100).optional(),outputFormat:j.enum(["png","jpeg","webp"]).optional(),partialImages:j.number().int().min(0).max(3).optional(),quality:j.enum(["auto","low","medium","high"]).optional(),size:j.enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict(),i3=j.object({result:j.string()}),Sj=S({id:"openai.image_generation",inputSchema:j.object({}),outputSchema:i3});function _3({tools:Q,toolChoice:G,strictJsonSchema:W}){Q=Q?.length?Q:void 0;let N=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:N};let q=[];for(let Z of Q)switch(Z.type){case"function":q.push({type:"function",name:Z.name,description:Z.description,parameters:Z.inputSchema,strict:W});break;case"provider":{switch(Z.id){case"openai.file_search":{let Y=U3.parse(Z.args);q.push({type:"file_search",vector_store_ids:Y.vectorStoreIds,max_num_results:Y.maxNumResults,ranking_options:Y.ranking?{ranker:Y.ranking.ranker,score_threshold:Y.ranking.scoreThreshold}:void 0,filters:Y.filters});break}case"openai.local_shell":{q.push({type:"local_shell"});break}case"openai.web_search_preview":{let Y=D3.parse(Z.args);q.push({type:"web_search_preview",search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.web_search":{let Y=N3.parse(Z.args);q.push({type:"web_search",filters:Y.filters!=null?{allowed_domains:Y.filters.allowedDomains}:void 0,search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.code_interpreter":{let Y=H3.parse(Z.args);q.push({type:"code_interpreter",container:Y.container==null?{type:"auto",file_ids:void 0}:typeof Y.container==="string"?Y.container:{type:"auto",file_ids:Y.container.fileIds}});break}case"openai.image_generation":{let Y=W3.parse(Z.args);q.push({type:"image_generation",background:Y.background,input_fidelity:Y.inputFidelity,input_image_mask:Y.inputImageMask?{file_id:Y.inputImageMask.fileId,image_url:Y.inputImageMask.imageUrl}:void 0,model:Y.model,moderation:Y.moderation,partial_images:Y.partialImages,quality:Y.quality,output_compression:Y.outputCompression,output_format:Y.outputFormat,size:Y.size});break}}break}default:N.push({type:"unsupported",feature:"tool type"});break}if(G==null)return{tools:q,toolChoice:void 0,toolWarnings:N};let L=G.type;switch(L){case"auto":case"none":case"required":return{tools:q,toolChoice:L,toolWarnings:N};case"tool":return{tools:q,toolChoice:G.toolName==="code_interpreter"||G.toolName==="file_search"||G.toolName==="image_generation"||G.toolName==="web_search_preview"||G.toolName==="web_search"?{type:G.toolName}:{type:"function",name:G.toolName},toolWarnings:N};default:throw new y({functionality:`tool choice type: ${L}`})}}var M3=j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:I.nullish()}),P3=j.object({type:j.literal("file_search_call"),id:j.string(),queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),file_id:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullish()}),Q3=j.object({type:j.literal("code_interpreter_call"),id:j.string(),code:j.string().nullable(),container_id:j.string(),outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullable()}),f3=j.object({type:j.literal("local_shell_call"),id:j.string(),call_id:j.string(),action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeout_ms:j.number().optional(),user:j.string().optional(),working_directory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),x3=j.object({type:j.literal("image_generation_call"),id:j.string(),result:j.string()}),R3=j.object({type:j.literal("file_citation"),file_id:j.string(),filename:j.string().nullish(),index:j.number().nullish(),start_index:j.number().nullish(),end_index:j.number().nullish(),quote:j.string().nullish()}),b3=j.object({type:j.literal("message"),id:j.string()}),A3=j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish()}),w3=j.object({type:j.literal("function_call"),id:j.string(),call_id:j.string(),name:j.string(),arguments:j.string()}),F3=20,y3=j.array(j.object({token:j.string(),logprob:j.number(),top_logprobs:j.array(j.object({token:j.string(),logprob:j.number()}))}));class X3{specificationVersion="v3";modelId;config;constructor(Q,G){this.modelId=Q,this.config=G}supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]};get provider(){return this.config.provider}async getArgs({maxOutputTokens:Q,temperature:G,stopSequences:W,topP:N,topK:q,presencePenalty:L,frequencyPenalty:Z,seed:Y,prompt:$,providerOptions:J,tools:E,toolChoice:_,responseFormat:X}){let K=[],B=_0(this.modelId);if(q!=null)K.push({type:"unsupported",feature:"topK"});if(Y!=null)K.push({type:"unsupported",feature:"seed"});if(L!=null)K.push({type:"unsupported",feature:"presencePenalty"});if(Z!=null)K.push({type:"unsupported",feature:"frequencyPenalty"});if(W!=null)K.push({type:"unsupported",feature:"stopSequences"});let U=await k({provider:"copilot",providerOptions:J,schema:q0}),{input:M,warnings:V}=await K3({prompt:$,systemMessageMode:B.systemMessageMode,fileIdPrefixes:this.config.fileIdPrefixes,store:U?.store??!0,hasLocalShellTool:z("openai.local_shell")});K.push(...V);let H=U?.strictJsonSchema??!1,D=U?.include;function x(F){D=D!=null?[...D,F]:[F]}function z(F){return E?.find((Y3)=>Y3.type==="provider"&&Y3.id===F)!=null}let P=typeof U?.logprobs==="number"?U?.logprobs:U?.logprobs===!0?F3:void 0;if(P)x("message.output_text.logprobs");let b=E?.find((F)=>F.type==="provider"&&(F.id==="openai.web_search"||F.id==="openai.web_search_preview"))?.name;if(b)x("web_search_call.action.sources");if(z("openai.code_interpreter"))x("code_interpreter_call.outputs");let f={model:this.modelId,input:M,temperature:G,top_p:N,max_output_tokens:Q,...(X?.type==="json"||U?.textVerbosity)&&{text:{...X?.type==="json"&&{format:X.schema!=null?{type:"json_schema",strict:H,name:X.name??"response",description:X.description,schema:X.schema}:{type:"json_object"}},...U?.textVerbosity&&{verbosity:U.textVerbosity}}},max_tool_calls:U?.maxToolCalls,metadata:U?.metadata,parallel_tool_calls:U?.parallelToolCalls,previous_response_id:U?.previousResponseId,store:U?.store,user:U?.user,instructions:U?.instructions,service_tier:U?.serviceTier,include:D,prompt_cache_key:U?.promptCacheKey,safety_identifier:U?.safetyIdentifier,top_logprobs:P,...B.isReasoningModel&&(U?.reasoningEffort!=null||U?.reasoningSummary!=null)&&{reasoning:{...U?.reasoningEffort!=null&&{effort:U.reasoningEffort},...U?.reasoningSummary!=null&&{summary:U.reasoningSummary}}},...B.requiredAutoTruncation&&{truncation:"auto"}};if(B.isReasoningModel){if(f.temperature!=null)f.temperature=void 0,K.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(f.top_p!=null)f.top_p=void 0,K.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})}else{if(U?.reasoningEffort!=null)K.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"});if(U?.reasoningSummary!=null)K.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})}if(U?.serviceTier==="flex"&&!B.supportsFlexProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),f.service_tier=void 0;if(U?.serviceTier==="priority"&&!B.supportsPriorityProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),f.service_tier=void 0;let{tools:R,toolChoice:w,toolWarnings:C3}=_3({tools:E,toolChoice:_,strictJsonSchema:H});return{webSearchToolName:b,args:{...f,tools:R,tool_choice:w},warnings:[...K,...C3]}}async doGenerate(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),q=this.config.url({path:"/responses",modelId:this.modelId}),{responseHeaders:L,value:Z,rawValue:Y}=await O({url:q,headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:e,successfulResponseHandler:i(j.object({id:j.string(),created_at:j.number(),error:j.object({code:j.string(),message:j.string()}).nullish(),model:j.string(),output:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("message"),role:j.literal("assistant"),id:j.string(),content:j.array(j.object({type:j.literal("output_text"),text:j.string(),logprobs:y3.nullish(),annotations:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),start_index:j.number(),end_index:j.number(),url:j.string(),title:j.string()}),R3,j.object({type:j.literal("container_file_citation")})]))}))}),M3,P3,Q3,x3,f3,j.object({type:j.literal("function_call"),call_id:j.string(),name:j.string(),arguments:j.string(),id:j.string()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string().optional()}),j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish(),summary:j.array(j.object({type:j.literal("summary_text"),text:j.string()}))})])),service_tier:j.string().nullish(),incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3})),abortSignal:Q.abortSignal,fetch:this.config.fetch});if(Z.error)throw new q3({message:Z.error.message,url:q,requestBodyValues:G,statusCode:400,responseHeaders:L,responseBody:Y,isRetryable:!1});let $=[],J=[],E=!1;for(let X of Z.output)switch(X.type){case"reasoning":{if(X.summary.length===0)X.summary.push({type:"summary_text",text:""});for(let K of X.summary)$.push({type:"reasoning",text:K.text,providerMetadata:{openai:{itemId:X.id,reasoningEncryptedContent:X.encrypted_content??null}}});break}case"image_generation_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"image_generation",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"image_generation",result:{result:X.result}});break}case"local_shell_call":{$.push({type:"tool-call",toolCallId:X.call_id,toolName:"local_shell",input:JSON.stringify({action:X.action}),providerMetadata:{openai:{itemId:X.id}}});break}case"message":{for(let K of X.content){if(Q.providerOptions?.openai?.logprobs&&K.logprobs)J.push(K.logprobs);$.push({type:"text",text:K.text,providerMetadata:{openai:{itemId:X.id}}});for(let B of K.annotations)if(B.type==="url_citation")$.push({type:"source",sourceType:"url",id:this.config.generateId?.()??A(),url:B.url,title:B.title});else if(B.type==="file_citation")$.push({type:"source",sourceType:"document",id:this.config.generateId?.()??A(),mediaType:"text/plain",title:B.quote??B.filename??"Document",filename:B.filename??B.file_id})}break}case"function_call":{E=!0,$.push({type:"tool-call",toolCallId:X.call_id,toolName:X.name,input:X.arguments,providerMetadata:{openai:{itemId:X.id}}});break}case"web_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:N??"web_search",input:JSON.stringify({action:X.action}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:N??"web_search",result:{status:X.status}});break}case"computer_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"computer_use",input:"",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:X.status||"completed"}});break}case"file_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"file_search",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"file_search",result:{queries:X.queries,results:X.results?.map((K)=>({attributes:K.attributes,fileId:K.file_id,filename:K.filename,score:K.score,text:K.text}))??null}});break}case"code_interpreter_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"code_interpreter",input:JSON.stringify({code:X.code,containerId:X.container_id}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"code_interpreter",result:{outputs:X.outputs}});break}}let _={openai:{responseId:Z.id}};if(J.length>0)_.openai.logprobs=J;if(typeof Z.service_tier==="string")_.openai.serviceTier=Z.service_tier;return{content:$,finishReason:{unified:V3({finishReason:Z.incomplete_details?.reason,hasFunctionCall:E}),raw:Z.incomplete_details?.reason},usage:{inputTokens:{total:Z.usage.input_tokens,noCache:Z.usage.input_tokens_details?.cached_tokens!=null?Z.usage.input_tokens-Z.usage.input_tokens_details.cached_tokens:void 0,cacheRead:Z.usage.input_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:Z.usage.output_tokens,text:void 0,reasoning:Z.usage.output_tokens_details?.reasoning_tokens??void 0},raw:Z.usage},request:{body:G},response:{id:Z.id,timestamp:new Date(Z.created_at*1000),modelId:Z.model,headers:L,body:Y},providerMetadata:_,warnings:W}}async doStream(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),{responseHeaders:q,value:L}=await O({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:{...G,stream:!0},failedResponseHandler:e,successfulResponseHandler:u(Y0),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Z=this,Y={unified:"other",raw:void 0},$={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0},J=[],E=null,_={},X=!1,K={},B=null,U=null,M;return{stream:L.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{Y={unified:"error",raw:void 0}},transformValue:(V,H)=>{if(T3(V)){if(V.item.type==="function_call")_[V.output_index]={toolName:V.item.name,toolCallId:V.item.call_id},H.enqueue({type:"tool-input-start",id:V.item.call_id,toolName:V.item.name});else if(V.item.type==="web_search_call")_[V.output_index]={toolName:N??"web_search",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:N??"web_search"});else if(V.item.type==="computer_call")_[V.output_index]={toolName:"computer_use",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"computer_use"});else if(V.item.type==="code_interpreter_call")_[V.output_index]={toolName:"code_interpreter",toolCallId:V.item.id,codeInterpreter:{containerId:V.item.container_id}},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"code_interpreter"}),H.enqueue({type:"tool-input-delta",id:V.item.id,delta:`{"containerId":"${V.item.container_id}","code":"`});else if(V.item.type==="file_search_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"file_search",input:"{}",providerExecuted:!0});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"image_generation",input:"{}",providerExecuted:!0});else if(V.item.type==="message")U=V.item.id,H.enqueue({type:"text-start",id:V.item.id,providerMetadata:{openai:{itemId:V.item.id}}});else if(L0(V))K[V.output_index]={canonicalId:V.item.id,encryptedContent:V.item.encrypted_content,summaryParts:[0]},B=V.output_index,H.enqueue({type:"reasoning-start",id:`${V.item.id}:0`,providerMetadata:{openai:{itemId:V.item.id,reasoningEncryptedContent:V.item.encrypted_content??null}}})}else if(k3(V)){if(V.item.type==="function_call")_[V.output_index]=void 0,X=!0,H.enqueue({type:"tool-input-end",id:V.item.call_id}),H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:V.item.name,input:V.item.arguments,providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="web_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"web_search",input:JSON.stringify({action:V.item.action}),providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"web_search",result:{status:V.item.status}});else if(V.item.type==="computer_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"computer_use",input:"",providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:V.item.status||"completed"}});else if(V.item.type==="file_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"file_search",result:{queries:V.item.queries,results:V.item.results?.map((D)=>({attributes:D.attributes,fileId:D.file_id,filename:D.filename,score:D.score,text:D.text}))??null}});else if(V.item.type==="code_interpreter_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"code_interpreter",result:{outputs:V.item.outputs}});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"image_generation",result:{result:V.item.result}});else if(V.item.type==="local_shell_call")_[V.output_index]=void 0,H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:"local_shell",input:JSON.stringify({action:{type:"exec",command:V.item.action.command,timeoutMs:V.item.action.timeout_ms,user:V.item.action.user,workingDirectory:V.item.action.working_directory,env:V.item.action.env}}),providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="message"){if(U)H.enqueue({type:"text-end",id:U}),U=null}else if($0(V)){let D=K[V.output_index];if(D){for(let x of D.summaryParts)H.enqueue({type:"reasoning-end",id:`${D.canonicalId}:${x}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:V.item.encrypted_content??null}}});if(delete K[V.output_index],B===V.output_index)B=null}}}else if(J0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:V.delta})}else if(K0(V))H.enqueue({type:"tool-result",toolCallId:V.item_id,toolName:"image_generation",result:{result:V.partial_image_b64}});else if(H0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:JSON.stringify(V.delta).slice(1,-1)})}else if(B0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:'"}'}),H.enqueue({type:"tool-input-end",id:D.toolCallId}),H.enqueue({type:"tool-call",toolCallId:D.toolCallId,toolName:"code_interpreter",input:JSON.stringify({code:V.code,containerId:D.codeInterpreter.containerId}),providerExecuted:!0})}else if(G0(V))E=V.response.id,H.enqueue({type:"response-metadata",id:V.response.id,timestamp:new Date(V.response.created_at*1000),modelId:V.response.model});else if(Z0(V)){if(!U)U=V.item_id,H.enqueue({type:"text-start",id:U,providerMetadata:{openai:{itemId:V.item_id}}});if(H.enqueue({type:"text-delta",id:U,delta:V.delta}),Q.providerOptions?.openai?.logprobs&&V.logprobs)J.push(V.logprobs)}else if(N0(V)){let D=B!==null?K[B]:null;if(D&&V.summary_index>0)D.summaryParts.push(V.summary_index),H.enqueue({type:"reasoning-start",id:`${D.canonicalId}:${V.summary_index}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:D.encryptedContent??null}}})}else if(D0(V)){let D=B!==null?K[B]:null;if(D)H.enqueue({type:"reasoning-delta",id:`${D.canonicalId}:${V.summary_index}`,delta:V.delta,providerMetadata:{openai:{itemId:D.canonicalId}}})}else if(E0(V)){if(Y={unified:V3({finishReason:V.response.incomplete_details?.reason,hasFunctionCall:X}),raw:V.response.incomplete_details?.reason??void 0},$.inputTokens=V.response.usage.input_tokens,$.outputTokens=V.response.usage.output_tokens,$.totalTokens=V.response.usage.input_tokens+V.response.usage.output_tokens,$.reasoningTokens=V.response.usage.output_tokens_details?.reasoning_tokens??void 0,$.cachedInputTokens=V.response.usage.input_tokens_details?.cached_tokens??void 0,typeof V.response.service_tier==="string")M=V.response.service_tier}else if(U0(V)){if(V.annotation.type==="url_citation")H.enqueue({type:"source",sourceType:"url",id:Z.config.generateId?.()??A(),url:V.annotation.url,title:V.annotation.title});else if(V.annotation.type==="file_citation")H.enqueue({type:"source",sourceType:"document",id:Z.config.generateId?.()??A(),mediaType:"text/plain",title:V.annotation.quote??V.annotation.filename??"Document",filename:V.annotation.filename??V.annotation.file_id})}else if(W0(V))H.enqueue({type:"error",error:V})},flush:(V)=>{if(U)V.enqueue({type:"text-end",id:U}),U=null;let H={openai:{responseId:E}};if(J.length>0)H.openai.logprobs=J;if(M!==void 0)H.openai.serviceTier=M;V.enqueue({type:"finish",finishReason:Y,usage:{inputTokens:{total:$.inputTokens,noCache:$.inputTokens!=null&&$.cachedInputTokens!=null?$.inputTokens-$.cachedInputTokens:void 0,cacheRead:$.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:$.outputTokens,text:void 0,reasoning:$.reasoningTokens},raw:{input_tokens:$.inputTokens,output_tokens:$.outputTokens,total_tokens:$.totalTokens}},providerMetadata:H})}})),request:{body:G},response:{headers:q}}}}var S3=j.object({input_tokens:j.number(),input_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),output_tokens:j.number(),output_tokens_details:j.object({reasoning_tokens:j.number().nullish()}).nullish()}),p3=j.object({type:j.literal("response.output_text.delta"),item_id:j.string(),delta:j.string(),logprobs:y3.nullish()}),s3=j.object({type:j.literal("error"),code:j.string(),message:j.string(),param:j.string().nullish(),sequence_number:j.number()}),n3=j.object({type:j.enum(["response.completed","response.incomplete"]),response:j.object({incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3,service_tier:j.string().nullish()})}),r3=j.object({type:j.literal("response.created"),response:j.object({id:j.string(),created_at:j.number(),model:j.string(),service_tier:j.string().nullish()})}),t3=j.object({type:j.literal("response.output_item.added"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3,j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:j.object({type:j.literal("search"),query:j.string().optional()}).nullish()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string()}),j.object({type:j.literal("file_search_call"),id:j.string()}),j.object({type:j.literal("image_generation_call"),id:j.string()}),Q3.extend({status:j.string()})])}),l3=j.object({type:j.literal("response.output_item.done"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3.extend({status:j.literal("completed")}),Q3,x3,M3,P3,f3,j.object({type:j.literal("computer_call"),id:j.string(),status:j.literal("completed")})])}),a3=j.object({type:j.literal("response.function_call_arguments.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),e3=j.object({type:j.literal("response.image_generation_call.partial_image"),item_id:j.string(),output_index:j.number(),partial_image_b64:j.string()}),o3=j.object({type:j.literal("response.code_interpreter_call_code.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),j0=j.object({type:j.literal("response.code_interpreter_call_code.done"),item_id:j.string(),output_index:j.number(),code:j.string()}),V0=j.object({type:j.literal("response.output_text.annotation.added"),annotation:j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),url:j.string(),title:j.string()}),R3])}),Q0=j.object({type:j.literal("response.reasoning_summary_part.added"),item_id:j.string(),summary_index:j.number()}),X0=j.object({type:j.literal("response.reasoning_summary_text.delta"),item_id:j.string(),summary_index:j.number(),delta:j.string()}),Y0=j.union([p3,n3,r3,t3,l3,a3,e3,o3,j0,V0,Q0,X0,s3,j.object({type:j.string()}).loose()]);function Z0(Q){return Q.type==="response.output_text.delta"}function k3(Q){return Q.type==="response.output_item.done"}function $0(Q){return k3(Q)&&Q.item.type==="reasoning"}function E0(Q){return Q.type==="response.completed"||Q.type==="response.incomplete"}function G0(Q){return Q.type==="response.created"}function J0(Q){return Q.type==="response.function_call_arguments.delta"}function K0(Q){return Q.type==="response.image_generation_call.partial_image"}function H0(Q){return Q.type==="response.code_interpreter_call_code.delta"}function B0(Q){return Q.type==="response.code_interpreter_call_code.done"}function T3(Q){return Q.type==="response.output_item.added"}function L0(Q){return T3(Q)&&Q.item.type==="reasoning"}function U0(Q){return Q.type==="response.output_text.annotation.added"}function N0(Q){return Q.type==="response.reasoning_summary_part.added"}function D0(Q){return Q.type==="response.reasoning_summary_text.delta"}function W0(Q){return Q.type==="error"}function _0(Q){let G=Q.startsWith("o3")||Q.startsWith("o4-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-chat"),W=Q.startsWith("gpt-4")||Q.startsWith("gpt-5-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-nano")&&!Q.startsWith("gpt-5-chat")||Q.startsWith("o3")||Q.startsWith("o4-mini"),N={requiredAutoTruncation:!1,systemMessageMode:"system",supportsFlexProcessing:G,supportsPriorityProcessing:W};if(Q.startsWith("gpt-5-chat"))return{...N,isReasoningModel:!1};if(Q.startsWith("o")||Q.startsWith("gpt-5")||Q.startsWith("codex-")||Q.startsWith("computer-use")){if(Q.startsWith("o1-mini")||Q.startsWith("o1-preview"))return{...N,isReasoningModel:!0,systemMessageMode:"remove"};return{...N,isReasoningModel:!0,systemMessageMode:"developer"}}return{...N,isReasoningModel:!1}}var q0=j.object({include:j.array(j.enum(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:j.string().nullish(),logprobs:j.union([j.boolean(),j.number().min(1).max(F3)]).optional(),maxToolCalls:j.number().nullish(),metadata:j.any().nullish(),parallelToolCalls:j.boolean().nullish(),previousResponseId:j.string().nullish(),promptCacheKey:j.string().nullish(),reasoningEffort:j.string().nullish(),reasoningSummary:j.string().nullish(),safetyIdentifier:j.string().nullish(),serviceTier:j.enum(["auto","flex","priority"]).nullish(),store:j.boolean().nullish(),strictJsonSchema:j.boolean().nullish(),textVerbosity:j.enum(["low","medium","high"]).nullish(),user:j.string().nullish()});var M0="0.1.0";function z3(Q={}){let G=I3(Q.baseURL??"https://api.openai.com/v1");if(!G)throw Error("baseURL is required");let W={...Q.apiKey&&{Authorization:`Bearer ${Q.apiKey}`},...Q.headers},N=()=>O3(W,`ai-sdk/openai-compatible/${M0}`),q=($)=>{return new a($,{provider:`${Q.name??"openai-compatible"}.chat`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},L=($)=>{return new X3($,{provider:`${Q.name??"openai-compatible"}.responses`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},Z=($)=>q($),Y=function($){return q($)};return Y.languageModel=Z,Y.chat=q,Y.responses=L,Y}var P0=z3();export{P0 as openaiCompatible,z3 as createOpenaiCompatible};
|
|
2
|
+
import{Aq as k,Bq as O,Fq as s,Gq as S,Iq as c,Jq as u,Kq as i,Oq as I3,Pp as T,Wp as m,dq as A,iq as O3,yq as l}from"./chunk-bf146hz2.js";import{Rq as q3,Wq as v,br as y}from"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import{Pu as j}from"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-hh4c02fh.js";function h(Q){switch(Q.type){case"text":case"error-text":return Q.value;case"execution-denied":return Q.reason??"Tool execution denied.";case"content":case"json":case"error-json":return JSON.stringify(Q.value)}}function C(Q){return Q?.providerOptions?.copilot??{}}function Z3(Q){let G=[];for(let{role:W,content:N,...q}of Q){let L=C({...q});switch(W){case"system":{G.push({role:"system",content:N,...L});break}case"user":{if(N.length===1&&N[0].type==="text"){G.push({role:"user",content:N[0].text,...C(N[0])});break}G.push({role:"user",content:N.map((Z)=>{let Y=C(Z);switch(Z.type){case"text":return{type:"text",text:Z.text,...Y};case"file":if(Z.mediaType.startsWith("image/")){let $=Z.mediaType==="image/*"?"image/jpeg":Z.mediaType;return{type:"image_url",image_url:{url:Z.data instanceof URL?Z.data.toString():`data:${$};base64,${m(Z.data)}`},...Y}}else throw new y({functionality:`file part media type ${Z.mediaType}`})}}),...L});break}case"assistant":{let Z="",Y,$,J=[];for(let E of N){let _=C(E),X=E.providerOptions?.copilot?.reasoningOpaque;if(X&&!$)$=X;switch(E.type){case"text":{Z+=E.text;break}case"reasoning":{if(E.text)Y=E.text;break}case"tool-call":{J.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)},..._});break}}}G.push({role:"assistant",content:Z||null,tool_calls:J.length>0?J:void 0,reasoning_text:$?Y:void 0,reasoning_opaque:$,...L});break}case"tool":{for(let Z of N){if(Z.type==="tool-approval-response")continue;let Y=Z.output,$=C(Z);G.push({role:"tool",tool_call_id:Z.toolCallId,content:h(Y),...$})}break}default:throw Error(`Unsupported role: ${W}`)}}return G}function n({id:Q,model:G,created:W}){return{id:Q??void 0,modelId:G??void 0,timestamp:W!=null?new Date(W*1000):void 0}}function r(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var g=j.object({user:j.string().optional(),reasoningEffort:j.string().optional(),textVerbosity:j.string().optional(),thinking_budget:j.number().optional()});var t=j.object({error:j.object({message:j.string(),type:j.string().nullish(),param:j.any().nullish(),code:j.union([j.string(),j.number()]).nullish()})}),$3={errorSchema:t,errorToMessage:(Q)=>Q.error.message};function d(Q){return new TransformStream({start(G){G.enqueue({type:"stream-start",warnings:Q.warnings})},transform(G,W){if(Q.includeRawChunks)W.enqueue({type:"raw",rawValue:G.rawValue});if(!G.success){Q.onParseError(),W.enqueue({type:"error",error:G.error});return}Q.transformValue(G.value,W,G.rawValue)},flush:Q.flush})}function E3({tools:Q,toolChoice:G}){Q=Q?.length?Q:void 0;let W=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:W};let N=[];for(let L of Q)if(L.type==="provider")W.push({type:"unsupported",feature:`tool type: ${L.type}`});else N.push({type:"function",function:{name:L.name,description:L.description,parameters:L.inputSchema}});if(G==null)return{tools:N,toolChoice:void 0,toolWarnings:W};let q=G.type;switch(q){case"auto":case"none":case"required":return{tools:N,toolChoice:q,toolWarnings:W};case"tool":return{tools:N,toolChoice:{type:"function",function:{name:G.toolName}},toolWarnings:W};default:throw new y({functionality:`tool choice type: ${q}`})}}class a{specificationVersion="v3";supportsStructuredOutputs;modelId;config;failedResponseHandler;chunkSchema;constructor(Q,G){this.modelId=Q,this.config=G;let W=G.errorStructure??$3;this.chunkSchema=h3(W.errorSchema),this.failedResponseHandler=c(W),this.supportsStructuredOutputs=G.supportsStructuredOutputs??!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){return this.config.supportedUrls?.()??{}}async getArgs({prompt:Q,maxOutputTokens:G,temperature:W,topP:N,topK:q,frequencyPenalty:L,presencePenalty:Z,providerOptions:Y,stopSequences:$,responseFormat:J,seed:E,toolChoice:_,tools:X}){let K=[],B=Object.assign(await k({provider:"copilot",providerOptions:Y,schema:g})??{},await k({provider:this.providerOptionsName,providerOptions:Y,schema:g})??{});if(q!=null)K.push({type:"unsupported",feature:"topK"});if(J?.type==="json"&&J.schema!=null&&!this.supportsStructuredOutputs)K.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:U,toolChoice:M,toolWarnings:V}=E3({tools:X,toolChoice:_});return{args:{model:this.modelId,user:B.user,max_tokens:G,temperature:W,top_p:N,frequency_penalty:L,presence_penalty:Z,response_format:J?.type==="json"?this.supportsStructuredOutputs===!0&&J.schema!=null?{type:"json_schema",json_schema:{schema:J.schema,name:J.name??"response",description:J.description}}:{type:"json_object"}:void 0,stop:$,seed:E,...Object.fromEntries(Object.entries(Y?.[this.providerOptionsName]??{}).filter(([H])=>!Object.keys(g.shape).includes(H))),reasoning_effort:B.reasoningEffort,verbosity:B.textVerbosity,messages:Z3(Q),tools:U,tool_choice:M,thinking_budget:B.thinking_budget},warnings:[...K,...V]}}async doGenerate(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N=JSON.stringify(G),{responseHeaders:q,value:L,rawValue:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(m3),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=L.choices[0],$=[],J=Y.message.content;if(J!=null&&J.length>0)$.push({type:"text",text:J,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let E=Y.message.reasoning_text;if(E!=null&&E.length>0)$.push({type:"reasoning",text:E,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});if(Y.message.tool_calls!=null)for(let K of Y.message.tool_calls)$.push({type:"tool-call",toolCallId:K.id??A(),toolName:K.function.name,input:K.function.arguments,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let _={[this.providerOptionsName]:{},...await this.config.metadataExtractor?.extractMetadata?.({parsedBody:Z})},X=L.usage?.completion_tokens_details;if(X?.accepted_prediction_tokens!=null)_[this.providerOptionsName].acceptedPredictionTokens=X?.accepted_prediction_tokens;if(X?.rejected_prediction_tokens!=null)_[this.providerOptionsName].rejectedPredictionTokens=X?.rejected_prediction_tokens;return{content:$,finishReason:{unified:r(Y.finish_reason),raw:Y.finish_reason??void 0},usage:{inputTokens:{total:L.usage?.prompt_tokens??void 0,noCache:void 0,cacheRead:L.usage?.prompt_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:L.usage?.completion_tokens??void 0,text:void 0,reasoning:L.usage?.completion_tokens_details?.reasoning_tokens??void 0},raw:L.usage??void 0},providerMetadata:_,request:{body:N},response:{...n(L),headers:q,body:Z},warnings:W}}async doStream(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N={...G,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},q=this.config.metadataExtractor?.createStreamExtractor(),{responseHeaders:L,value:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:N,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:u(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=[],$={unified:"other",raw:void 0},J={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0},totalTokens:void 0},E=!0,_=this.providerOptionsName,X=!1,K=!1,B,U=(M,V)=>{V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:M.id??A(),toolName:M.function.name,input:M.function.arguments,providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),M.hasFinished=!0};return{stream:Z.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{$={unified:"error",raw:void 0}},transformValue:(M,V,H)=>{if(q?.processChunk(H),"error"in M){$={unified:"error",raw:void 0},V.enqueue({type:"error",error:M.error.message});return}if(E)E=!1,V.enqueue({type:"response-metadata",...n(M)});if(M.usage!=null){let{prompt_tokens:P,completion_tokens:b,total_tokens:f,prompt_tokens_details:R,completion_tokens_details:w}=M.usage;if(J.promptTokens=P??void 0,J.completionTokens=b??void 0,J.totalTokens=f??void 0,w?.reasoning_tokens!=null)J.completionTokensDetails.reasoningTokens=w?.reasoning_tokens;if(w?.accepted_prediction_tokens!=null)J.completionTokensDetails.acceptedPredictionTokens=w?.accepted_prediction_tokens;if(w?.rejected_prediction_tokens!=null)J.completionTokensDetails.rejectedPredictionTokens=w?.rejected_prediction_tokens;if(R?.cached_tokens!=null)J.promptTokensDetails.cachedTokens=R?.cached_tokens}let D=M.choices[0];if(D?.finish_reason!=null)$={unified:r(D.finish_reason),raw:D.finish_reason??void 0};if(D?.delta==null)return;let x=D.delta;if(x.reasoning_opaque){if(B!=null)throw new v({data:x,message:"Multiple reasoning_opaque values received in a single response. Only one thinking part per response is supported."});B=x.reasoning_opaque}let z=x.reasoning_text;if(z){if(!X)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),X=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:z})}if(x.content){if(X&&!K)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;if(!K)V.enqueue({type:"text-start",id:"txt-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),K=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:x.content})}if(x.tool_calls!=null){if(X)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;for(let P of x.tool_calls){let b=P.index;if(Y[b]==null){if(P.id==null)throw new v({data:P,message:"Expected 'id' to be a string."});if(P.function?.name==null)throw new v({data:P,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:P.id,toolName:P.function.name}),Y[b]={id:P.id,type:"function",function:{name:P.function.name,arguments:P.function.arguments??""},hasFinished:!1};let R=Y[b];if(R.function?.name!=null&&R.function?.arguments!=null){if(R.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:R.id,delta:R.function.arguments});if(l(R.function.arguments))U(R,V)}continue}let f=Y[b];if(f.hasFinished)continue;if(P.function?.arguments!=null)f.function.arguments+=P.function?.arguments??"";if(V.enqueue({type:"tool-input-delta",id:f.id,delta:P.function.arguments??""}),f.function?.name!=null&&f.function?.arguments!=null&&l(f.function.arguments))U(f,V)}}},flush:(M)=>{if(X)M.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0});if(K)M.enqueue({type:"text-end",id:"txt-0"});for(let H of Y.filter((D)=>!D.hasFinished))M.enqueue({type:"tool-input-end",id:H.id}),M.enqueue({type:"tool-call",toolCallId:H.id??A(),toolName:H.function.name,input:H.function.arguments});let V={[_]:{},...B?{copilot:{reasoningOpaque:B}}:{},...q?.buildMetadata()};if(J.completionTokensDetails.acceptedPredictionTokens!=null)V[_].acceptedPredictionTokens=J.completionTokensDetails.acceptedPredictionTokens;if(J.completionTokensDetails.rejectedPredictionTokens!=null)V[_].rejectedPredictionTokens=J.completionTokensDetails.rejectedPredictionTokens;M.enqueue({type:"finish",finishReason:$,usage:{inputTokens:{total:J.promptTokens,noCache:J.promptTokens!=null&&J.promptTokensDetails.cachedTokens!=null?J.promptTokens-J.promptTokensDetails.cachedTokens:void 0,cacheRead:J.promptTokensDetails.cachedTokens,cacheWrite:void 0},outputTokens:{total:J.completionTokens,text:void 0,reasoning:J.completionTokensDetails.reasoningTokens},raw:{prompt_tokens:J.promptTokens??null,completion_tokens:J.completionTokens??null,total_tokens:J.totalTokens??null}},providerMetadata:V})}})),request:{body:N},response:{headers:L}}}}var G3=j.object({prompt_tokens:j.number().nullish(),completion_tokens:j.number().nullish(),total_tokens:j.number().nullish(),prompt_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),completion_tokens_details:j.object({reasoning_tokens:j.number().nullish(),accepted_prediction_tokens:j.number().nullish(),rejected_prediction_tokens:j.number().nullish()}).nullish()}).nullish(),m3=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant").nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({id:j.string().nullish(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish()})),usage:G3}),h3=(Q)=>j.union([j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({index:j.number(),id:j.string().nullish(),function:j.object({name:j.string().nullish(),arguments:j.string().nullish()})})).nullish()}).nullish(),finish_reason:j.string().nullish()})),usage:G3}),Q]);var g3=t,e=c({errorSchema:g3,errorToMessage:(Q)=>Q.error.message});var o=j.object({action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeoutMs:j.number().optional(),user:j.string().optional(),workingDirectory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),j3=j.object({output:j.string()}),o0=S({id:"openai.local_shell",inputSchema:o,outputSchema:j3});function J3(Q,G){if(!G)return!1;return G.some((W)=>Q.startsWith(W))}async function K3({prompt:Q,systemMessageMode:G,fileIdPrefixes:W,store:N,hasLocalShellTool:q=!1}){let L=[],Z=[],Y=new Set;for(let{role:$,content:J}of Q)switch($){case"system":{switch(G){case"system":{L.push({role:"system",content:J});break}case"developer":{L.push({role:"developer",content:J});break}case"remove":{Z.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${G}`)}break}case"user":{L.push({role:"user",content:J.map((E,_)=>{switch(E.type){case"text":return{type:"input_text",text:E.text};case"file":if(E.mediaType.startsWith("image/")){let X=E.mediaType==="image/*"?"image/jpeg":E.mediaType;return{type:"input_image",...E.data instanceof URL?{image_url:E.data.toString()}:typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{image_url:`data:${X};base64,${m(E.data)}`},detail:E.providerOptions?.openai?.imageDetail}}else if(E.mediaType==="application/pdf"){if(E.data instanceof URL)return{type:"input_file",file_url:E.data.toString()};return{type:"input_file",...typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{filename:E.filename??`part-${_}.pdf`,file_data:`data:application/pdf;base64,${m(E.data)}`}}}else throw new y({functionality:`file part media type ${E.mediaType}`})}})});break}case"assistant":{let E={},_={};for(let X of J)switch(X.type){case"text":{L.push({role:"assistant",content:[{type:"output_text",text:X.text}],id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-call":{if(_[X.toolCallId]=X,X.providerExecuted)break;if(q&&X.toolName==="local_shell"){let K=o.parse(X.input);L.push({type:"local_shell_call",call_id:X.toolCallId,id:X.providerOptions?.openai?.itemId??void 0,action:{type:"exec",command:K.action.command,timeout_ms:K.action.timeoutMs,user:K.action.user,working_directory:K.action.workingDirectory,env:K.action.env}});break}L.push({type:"function_call",call_id:X.toolCallId,name:X.toolName,arguments:JSON.stringify(X.input),id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-result":{if(N)L.push({type:"item_reference",id:X.toolCallId});else Z.push({type:"other",message:`Results for OpenAI tool ${X.toolName} are not sent to the API when store is false`});break}case"reasoning":{let K=await k({provider:"copilot",providerOptions:X.providerOptions,schema:d3}),B=K?.itemId;if(B!=null){let U=E[B];if(N){if(U===void 0)L.push({type:"item_reference",id:B}),E[B]={type:"reasoning",id:B,summary:[]}}else{let M=[];if(X.text.length>0)M.push({type:"summary_text",text:X.text});else if(U!==void 0)Z.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(X)}.`});if(U===void 0)E[B]={type:"reasoning",id:B,encrypted_content:K?.reasoningEncryptedContent,summary:M},L.push(E[B]);else U.summary.push(...M)}}else Z.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(X)}.`});break}}break}case"tool":{for(let E of J){if(E.type==="tool-approval-response"){if(Y.has(E.approvalId))continue;if(Y.add(E.approvalId),N)L.push({type:"item_reference",id:E.approvalId});L.push({type:"mcp_approval_response",approval_request_id:E.approvalId,approve:E.approved});continue}let _=E.output;if(_.type==="execution-denied"){if(_.providerOptions?.openai?.approvalId)continue}if(q&&E.toolName==="local_shell"&&_.type==="json"){L.push({type:"local_shell_call_output",call_id:E.toolCallId,output:j3.parse(_.value).output});break}L.push({type:"function_call_output",call_id:E.toolCallId,output:h(_)})}break}default:throw Error(`Unsupported role: ${$}`)}return{input:L,warnings:Z}}var d3=j.object({itemId:j.string().nullish(),reasoningEncryptedContent:j.string().nullish()});function V3({finishReason:Q,hasFunctionCall:G}){switch(Q){case void 0:case null:return G?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return G?"tool-calls":"other"}}var v3=j.object({code:j.string().nullish(),containerId:j.string()}),c3=j.object({outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullish()}),H3=j.object({container:j.union([j.string(),j.object({fileIds:j.array(j.string()).optional()})]).optional()}),Kj=S({id:"openai.code_interpreter",inputSchema:v3,outputSchema:c3});var B3=j.object({key:j.string(),type:j.enum(["eq","ne","gt","gte","lt","lte"]),value:j.union([j.string(),j.number(),j.boolean()])}),L3=j.object({type:j.enum(["and","or"]),filters:j.array(j.union([B3,j.lazy(()=>L3)]))}),U3=j.object({vectorStoreIds:j.array(j.string()),maxNumResults:j.number().optional(),ranking:j.object({ranker:j.string().optional(),scoreThreshold:j.number().optional()}).optional(),filters:j.union([B3,L3]).optional()}),u3=j.object({queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),fileId:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullable()}),Uj=S({id:"openai.file_search",inputSchema:j.object({}),outputSchema:u3});var I=j.discriminatedUnion("type",[j.object({type:j.literal("search"),query:j.string().nullish()}),j.object({type:j.literal("open_page"),url:j.string()}),j.object({type:j.literal("find"),url:j.string(),pattern:j.string()})]),p=j.object({type:j.literal("approximate"),country:j.string().optional(),city:j.string().optional(),region:j.string().optional(),timezone:j.string().optional()});var N3=j.object({filters:j.object({allowedDomains:j.array(j.string()).optional()}).optional(),searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Pj=s({id:"openai.web_search",inputSchema:j.object({action:I.nullish()})});var D3=j.object({searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Aj=s({id:"openai.web_search_preview",inputSchema:j.object({action:I.nullish()})});var W3=j.object({background:j.enum(["auto","opaque","transparent"]).optional(),inputFidelity:j.enum(["low","high"]).optional(),inputImageMask:j.object({fileId:j.string().optional(),imageUrl:j.string().optional()}).optional(),model:j.string().optional(),moderation:j.enum(["auto"]).optional(),outputCompression:j.number().int().min(0).max(100).optional(),outputFormat:j.enum(["png","jpeg","webp"]).optional(),partialImages:j.number().int().min(0).max(3).optional(),quality:j.enum(["auto","low","medium","high"]).optional(),size:j.enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict(),i3=j.object({result:j.string()}),Sj=S({id:"openai.image_generation",inputSchema:j.object({}),outputSchema:i3});function _3({tools:Q,toolChoice:G,strictJsonSchema:W}){Q=Q?.length?Q:void 0;let N=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:N};let q=[];for(let Z of Q)switch(Z.type){case"function":q.push({type:"function",name:Z.name,description:Z.description,parameters:Z.inputSchema,strict:W});break;case"provider":{switch(Z.id){case"openai.file_search":{let Y=U3.parse(Z.args);q.push({type:"file_search",vector_store_ids:Y.vectorStoreIds,max_num_results:Y.maxNumResults,ranking_options:Y.ranking?{ranker:Y.ranking.ranker,score_threshold:Y.ranking.scoreThreshold}:void 0,filters:Y.filters});break}case"openai.local_shell":{q.push({type:"local_shell"});break}case"openai.web_search_preview":{let Y=D3.parse(Z.args);q.push({type:"web_search_preview",search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.web_search":{let Y=N3.parse(Z.args);q.push({type:"web_search",filters:Y.filters!=null?{allowed_domains:Y.filters.allowedDomains}:void 0,search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.code_interpreter":{let Y=H3.parse(Z.args);q.push({type:"code_interpreter",container:Y.container==null?{type:"auto",file_ids:void 0}:typeof Y.container==="string"?Y.container:{type:"auto",file_ids:Y.container.fileIds}});break}case"openai.image_generation":{let Y=W3.parse(Z.args);q.push({type:"image_generation",background:Y.background,input_fidelity:Y.inputFidelity,input_image_mask:Y.inputImageMask?{file_id:Y.inputImageMask.fileId,image_url:Y.inputImageMask.imageUrl}:void 0,model:Y.model,moderation:Y.moderation,partial_images:Y.partialImages,quality:Y.quality,output_compression:Y.outputCompression,output_format:Y.outputFormat,size:Y.size});break}}break}default:N.push({type:"unsupported",feature:"tool type"});break}if(G==null)return{tools:q,toolChoice:void 0,toolWarnings:N};let L=G.type;switch(L){case"auto":case"none":case"required":return{tools:q,toolChoice:L,toolWarnings:N};case"tool":return{tools:q,toolChoice:G.toolName==="code_interpreter"||G.toolName==="file_search"||G.toolName==="image_generation"||G.toolName==="web_search_preview"||G.toolName==="web_search"?{type:G.toolName}:{type:"function",name:G.toolName},toolWarnings:N};default:throw new y({functionality:`tool choice type: ${L}`})}}var M3=j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:I.nullish()}),P3=j.object({type:j.literal("file_search_call"),id:j.string(),queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),file_id:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullish()}),Q3=j.object({type:j.literal("code_interpreter_call"),id:j.string(),code:j.string().nullable(),container_id:j.string(),outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullable()}),f3=j.object({type:j.literal("local_shell_call"),id:j.string(),call_id:j.string(),action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeout_ms:j.number().optional(),user:j.string().optional(),working_directory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),x3=j.object({type:j.literal("image_generation_call"),id:j.string(),result:j.string()}),R3=j.object({type:j.literal("file_citation"),file_id:j.string(),filename:j.string().nullish(),index:j.number().nullish(),start_index:j.number().nullish(),end_index:j.number().nullish(),quote:j.string().nullish()}),b3=j.object({type:j.literal("message"),id:j.string()}),A3=j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish()}),w3=j.object({type:j.literal("function_call"),id:j.string(),call_id:j.string(),name:j.string(),arguments:j.string()}),F3=20,y3=j.array(j.object({token:j.string(),logprob:j.number(),top_logprobs:j.array(j.object({token:j.string(),logprob:j.number()}))}));class X3{specificationVersion="v3";modelId;config;constructor(Q,G){this.modelId=Q,this.config=G}supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]};get provider(){return this.config.provider}async getArgs({maxOutputTokens:Q,temperature:G,stopSequences:W,topP:N,topK:q,presencePenalty:L,frequencyPenalty:Z,seed:Y,prompt:$,providerOptions:J,tools:E,toolChoice:_,responseFormat:X}){let K=[],B=_0(this.modelId);if(q!=null)K.push({type:"unsupported",feature:"topK"});if(Y!=null)K.push({type:"unsupported",feature:"seed"});if(L!=null)K.push({type:"unsupported",feature:"presencePenalty"});if(Z!=null)K.push({type:"unsupported",feature:"frequencyPenalty"});if(W!=null)K.push({type:"unsupported",feature:"stopSequences"});let U=await k({provider:"copilot",providerOptions:J,schema:q0}),{input:M,warnings:V}=await K3({prompt:$,systemMessageMode:B.systemMessageMode,fileIdPrefixes:this.config.fileIdPrefixes,store:U?.store??!0,hasLocalShellTool:z("openai.local_shell")});K.push(...V);let H=U?.strictJsonSchema??!1,D=U?.include;function x(F){D=D!=null?[...D,F]:[F]}function z(F){return E?.find((Y3)=>Y3.type==="provider"&&Y3.id===F)!=null}let P=typeof U?.logprobs==="number"?U?.logprobs:U?.logprobs===!0?F3:void 0;if(P)x("message.output_text.logprobs");let b=E?.find((F)=>F.type==="provider"&&(F.id==="openai.web_search"||F.id==="openai.web_search_preview"))?.name;if(b)x("web_search_call.action.sources");if(z("openai.code_interpreter"))x("code_interpreter_call.outputs");let f={model:this.modelId,input:M,temperature:G,top_p:N,max_output_tokens:Q,...(X?.type==="json"||U?.textVerbosity)&&{text:{...X?.type==="json"&&{format:X.schema!=null?{type:"json_schema",strict:H,name:X.name??"response",description:X.description,schema:X.schema}:{type:"json_object"}},...U?.textVerbosity&&{verbosity:U.textVerbosity}}},max_tool_calls:U?.maxToolCalls,metadata:U?.metadata,parallel_tool_calls:U?.parallelToolCalls,previous_response_id:U?.previousResponseId,store:U?.store,user:U?.user,instructions:U?.instructions,service_tier:U?.serviceTier,include:D,prompt_cache_key:U?.promptCacheKey,safety_identifier:U?.safetyIdentifier,top_logprobs:P,...B.isReasoningModel&&(U?.reasoningEffort!=null||U?.reasoningSummary!=null)&&{reasoning:{...U?.reasoningEffort!=null&&{effort:U.reasoningEffort},...U?.reasoningSummary!=null&&{summary:U.reasoningSummary}}},...B.requiredAutoTruncation&&{truncation:"auto"}};if(B.isReasoningModel){if(f.temperature!=null)f.temperature=void 0,K.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(f.top_p!=null)f.top_p=void 0,K.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})}else{if(U?.reasoningEffort!=null)K.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"});if(U?.reasoningSummary!=null)K.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})}if(U?.serviceTier==="flex"&&!B.supportsFlexProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),f.service_tier=void 0;if(U?.serviceTier==="priority"&&!B.supportsPriorityProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),f.service_tier=void 0;let{tools:R,toolChoice:w,toolWarnings:C3}=_3({tools:E,toolChoice:_,strictJsonSchema:H});return{webSearchToolName:b,args:{...f,tools:R,tool_choice:w},warnings:[...K,...C3]}}async doGenerate(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),q=this.config.url({path:"/responses",modelId:this.modelId}),{responseHeaders:L,value:Z,rawValue:Y}=await O({url:q,headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:e,successfulResponseHandler:i(j.object({id:j.string(),created_at:j.number(),error:j.object({code:j.string(),message:j.string()}).nullish(),model:j.string(),output:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("message"),role:j.literal("assistant"),id:j.string(),content:j.array(j.object({type:j.literal("output_text"),text:j.string(),logprobs:y3.nullish(),annotations:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),start_index:j.number(),end_index:j.number(),url:j.string(),title:j.string()}),R3,j.object({type:j.literal("container_file_citation")})]))}))}),M3,P3,Q3,x3,f3,j.object({type:j.literal("function_call"),call_id:j.string(),name:j.string(),arguments:j.string(),id:j.string()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string().optional()}),j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish(),summary:j.array(j.object({type:j.literal("summary_text"),text:j.string()}))})])),service_tier:j.string().nullish(),incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3})),abortSignal:Q.abortSignal,fetch:this.config.fetch});if(Z.error)throw new q3({message:Z.error.message,url:q,requestBodyValues:G,statusCode:400,responseHeaders:L,responseBody:Y,isRetryable:!1});let $=[],J=[],E=!1;for(let X of Z.output)switch(X.type){case"reasoning":{if(X.summary.length===0)X.summary.push({type:"summary_text",text:""});for(let K of X.summary)$.push({type:"reasoning",text:K.text,providerMetadata:{openai:{itemId:X.id,reasoningEncryptedContent:X.encrypted_content??null}}});break}case"image_generation_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"image_generation",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"image_generation",result:{result:X.result}});break}case"local_shell_call":{$.push({type:"tool-call",toolCallId:X.call_id,toolName:"local_shell",input:JSON.stringify({action:X.action}),providerMetadata:{openai:{itemId:X.id}}});break}case"message":{for(let K of X.content){if(Q.providerOptions?.openai?.logprobs&&K.logprobs)J.push(K.logprobs);$.push({type:"text",text:K.text,providerMetadata:{openai:{itemId:X.id}}});for(let B of K.annotations)if(B.type==="url_citation")$.push({type:"source",sourceType:"url",id:this.config.generateId?.()??A(),url:B.url,title:B.title});else if(B.type==="file_citation")$.push({type:"source",sourceType:"document",id:this.config.generateId?.()??A(),mediaType:"text/plain",title:B.quote??B.filename??"Document",filename:B.filename??B.file_id})}break}case"function_call":{E=!0,$.push({type:"tool-call",toolCallId:X.call_id,toolName:X.name,input:X.arguments,providerMetadata:{openai:{itemId:X.id}}});break}case"web_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:N??"web_search",input:JSON.stringify({action:X.action}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:N??"web_search",result:{status:X.status}});break}case"computer_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"computer_use",input:"",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:X.status||"completed"}});break}case"file_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"file_search",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"file_search",result:{queries:X.queries,results:X.results?.map((K)=>({attributes:K.attributes,fileId:K.file_id,filename:K.filename,score:K.score,text:K.text}))??null}});break}case"code_interpreter_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"code_interpreter",input:JSON.stringify({code:X.code,containerId:X.container_id}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"code_interpreter",result:{outputs:X.outputs}});break}}let _={openai:{responseId:Z.id}};if(J.length>0)_.openai.logprobs=J;if(typeof Z.service_tier==="string")_.openai.serviceTier=Z.service_tier;return{content:$,finishReason:{unified:V3({finishReason:Z.incomplete_details?.reason,hasFunctionCall:E}),raw:Z.incomplete_details?.reason},usage:{inputTokens:{total:Z.usage.input_tokens,noCache:Z.usage.input_tokens_details?.cached_tokens!=null?Z.usage.input_tokens-Z.usage.input_tokens_details.cached_tokens:void 0,cacheRead:Z.usage.input_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:Z.usage.output_tokens,text:void 0,reasoning:Z.usage.output_tokens_details?.reasoning_tokens??void 0},raw:Z.usage},request:{body:G},response:{id:Z.id,timestamp:new Date(Z.created_at*1000),modelId:Z.model,headers:L,body:Y},providerMetadata:_,warnings:W}}async doStream(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),{responseHeaders:q,value:L}=await O({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:{...G,stream:!0},failedResponseHandler:e,successfulResponseHandler:u(Y0),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Z=this,Y={unified:"other",raw:void 0},$={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0},J=[],E=null,_={},X=!1,K={},B=null,U=null,M;return{stream:L.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{Y={unified:"error",raw:void 0}},transformValue:(V,H)=>{if(T3(V)){if(V.item.type==="function_call")_[V.output_index]={toolName:V.item.name,toolCallId:V.item.call_id},H.enqueue({type:"tool-input-start",id:V.item.call_id,toolName:V.item.name});else if(V.item.type==="web_search_call")_[V.output_index]={toolName:N??"web_search",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:N??"web_search"});else if(V.item.type==="computer_call")_[V.output_index]={toolName:"computer_use",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"computer_use"});else if(V.item.type==="code_interpreter_call")_[V.output_index]={toolName:"code_interpreter",toolCallId:V.item.id,codeInterpreter:{containerId:V.item.container_id}},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"code_interpreter"}),H.enqueue({type:"tool-input-delta",id:V.item.id,delta:`{"containerId":"${V.item.container_id}","code":"`});else if(V.item.type==="file_search_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"file_search",input:"{}",providerExecuted:!0});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"image_generation",input:"{}",providerExecuted:!0});else if(V.item.type==="message")U=V.item.id,H.enqueue({type:"text-start",id:V.item.id,providerMetadata:{openai:{itemId:V.item.id}}});else if(L0(V))K[V.output_index]={canonicalId:V.item.id,encryptedContent:V.item.encrypted_content,summaryParts:[0]},B=V.output_index,H.enqueue({type:"reasoning-start",id:`${V.item.id}:0`,providerMetadata:{openai:{itemId:V.item.id,reasoningEncryptedContent:V.item.encrypted_content??null}}})}else if(k3(V)){if(V.item.type==="function_call")_[V.output_index]=void 0,X=!0,H.enqueue({type:"tool-input-end",id:V.item.call_id}),H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:V.item.name,input:V.item.arguments,providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="web_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"web_search",input:JSON.stringify({action:V.item.action}),providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"web_search",result:{status:V.item.status}});else if(V.item.type==="computer_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"computer_use",input:"",providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:V.item.status||"completed"}});else if(V.item.type==="file_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"file_search",result:{queries:V.item.queries,results:V.item.results?.map((D)=>({attributes:D.attributes,fileId:D.file_id,filename:D.filename,score:D.score,text:D.text}))??null}});else if(V.item.type==="code_interpreter_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"code_interpreter",result:{outputs:V.item.outputs}});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"image_generation",result:{result:V.item.result}});else if(V.item.type==="local_shell_call")_[V.output_index]=void 0,H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:"local_shell",input:JSON.stringify({action:{type:"exec",command:V.item.action.command,timeoutMs:V.item.action.timeout_ms,user:V.item.action.user,workingDirectory:V.item.action.working_directory,env:V.item.action.env}}),providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="message"){if(U)H.enqueue({type:"text-end",id:U}),U=null}else if($0(V)){let D=K[V.output_index];if(D){for(let x of D.summaryParts)H.enqueue({type:"reasoning-end",id:`${D.canonicalId}:${x}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:V.item.encrypted_content??null}}});if(delete K[V.output_index],B===V.output_index)B=null}}}else if(J0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:V.delta})}else if(K0(V))H.enqueue({type:"tool-result",toolCallId:V.item_id,toolName:"image_generation",result:{result:V.partial_image_b64}});else if(H0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:JSON.stringify(V.delta).slice(1,-1)})}else if(B0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:'"}'}),H.enqueue({type:"tool-input-end",id:D.toolCallId}),H.enqueue({type:"tool-call",toolCallId:D.toolCallId,toolName:"code_interpreter",input:JSON.stringify({code:V.code,containerId:D.codeInterpreter.containerId}),providerExecuted:!0})}else if(G0(V))E=V.response.id,H.enqueue({type:"response-metadata",id:V.response.id,timestamp:new Date(V.response.created_at*1000),modelId:V.response.model});else if(Z0(V)){if(!U)U=V.item_id,H.enqueue({type:"text-start",id:U,providerMetadata:{openai:{itemId:V.item_id}}});if(H.enqueue({type:"text-delta",id:U,delta:V.delta}),Q.providerOptions?.openai?.logprobs&&V.logprobs)J.push(V.logprobs)}else if(N0(V)){let D=B!==null?K[B]:null;if(D&&V.summary_index>0)D.summaryParts.push(V.summary_index),H.enqueue({type:"reasoning-start",id:`${D.canonicalId}:${V.summary_index}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:D.encryptedContent??null}}})}else if(D0(V)){let D=B!==null?K[B]:null;if(D)H.enqueue({type:"reasoning-delta",id:`${D.canonicalId}:${V.summary_index}`,delta:V.delta,providerMetadata:{openai:{itemId:D.canonicalId}}})}else if(E0(V)){if(Y={unified:V3({finishReason:V.response.incomplete_details?.reason,hasFunctionCall:X}),raw:V.response.incomplete_details?.reason??void 0},$.inputTokens=V.response.usage.input_tokens,$.outputTokens=V.response.usage.output_tokens,$.totalTokens=V.response.usage.input_tokens+V.response.usage.output_tokens,$.reasoningTokens=V.response.usage.output_tokens_details?.reasoning_tokens??void 0,$.cachedInputTokens=V.response.usage.input_tokens_details?.cached_tokens??void 0,typeof V.response.service_tier==="string")M=V.response.service_tier}else if(U0(V)){if(V.annotation.type==="url_citation")H.enqueue({type:"source",sourceType:"url",id:Z.config.generateId?.()??A(),url:V.annotation.url,title:V.annotation.title});else if(V.annotation.type==="file_citation")H.enqueue({type:"source",sourceType:"document",id:Z.config.generateId?.()??A(),mediaType:"text/plain",title:V.annotation.quote??V.annotation.filename??"Document",filename:V.annotation.filename??V.annotation.file_id})}else if(W0(V))H.enqueue({type:"error",error:V})},flush:(V)=>{if(U)V.enqueue({type:"text-end",id:U}),U=null;let H={openai:{responseId:E}};if(J.length>0)H.openai.logprobs=J;if(M!==void 0)H.openai.serviceTier=M;V.enqueue({type:"finish",finishReason:Y,usage:{inputTokens:{total:$.inputTokens,noCache:$.inputTokens!=null&&$.cachedInputTokens!=null?$.inputTokens-$.cachedInputTokens:void 0,cacheRead:$.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:$.outputTokens,text:void 0,reasoning:$.reasoningTokens},raw:{input_tokens:$.inputTokens,output_tokens:$.outputTokens,total_tokens:$.totalTokens}},providerMetadata:H})}})),request:{body:G},response:{headers:q}}}}var S3=j.object({input_tokens:j.number(),input_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),output_tokens:j.number(),output_tokens_details:j.object({reasoning_tokens:j.number().nullish()}).nullish()}),p3=j.object({type:j.literal("response.output_text.delta"),item_id:j.string(),delta:j.string(),logprobs:y3.nullish()}),s3=j.object({type:j.literal("error"),code:j.string(),message:j.string(),param:j.string().nullish(),sequence_number:j.number()}),n3=j.object({type:j.enum(["response.completed","response.incomplete"]),response:j.object({incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3,service_tier:j.string().nullish()})}),r3=j.object({type:j.literal("response.created"),response:j.object({id:j.string(),created_at:j.number(),model:j.string(),service_tier:j.string().nullish()})}),t3=j.object({type:j.literal("response.output_item.added"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3,j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:j.object({type:j.literal("search"),query:j.string().optional()}).nullish()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string()}),j.object({type:j.literal("file_search_call"),id:j.string()}),j.object({type:j.literal("image_generation_call"),id:j.string()}),Q3.extend({status:j.string()})])}),l3=j.object({type:j.literal("response.output_item.done"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3.extend({status:j.literal("completed")}),Q3,x3,M3,P3,f3,j.object({type:j.literal("computer_call"),id:j.string(),status:j.literal("completed")})])}),a3=j.object({type:j.literal("response.function_call_arguments.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),e3=j.object({type:j.literal("response.image_generation_call.partial_image"),item_id:j.string(),output_index:j.number(),partial_image_b64:j.string()}),o3=j.object({type:j.literal("response.code_interpreter_call_code.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),j0=j.object({type:j.literal("response.code_interpreter_call_code.done"),item_id:j.string(),output_index:j.number(),code:j.string()}),V0=j.object({type:j.literal("response.output_text.annotation.added"),annotation:j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),url:j.string(),title:j.string()}),R3])}),Q0=j.object({type:j.literal("response.reasoning_summary_part.added"),item_id:j.string(),summary_index:j.number()}),X0=j.object({type:j.literal("response.reasoning_summary_text.delta"),item_id:j.string(),summary_index:j.number(),delta:j.string()}),Y0=j.union([p3,n3,r3,t3,l3,a3,e3,o3,j0,V0,Q0,X0,s3,j.object({type:j.string()}).loose()]);function Z0(Q){return Q.type==="response.output_text.delta"}function k3(Q){return Q.type==="response.output_item.done"}function $0(Q){return k3(Q)&&Q.item.type==="reasoning"}function E0(Q){return Q.type==="response.completed"||Q.type==="response.incomplete"}function G0(Q){return Q.type==="response.created"}function J0(Q){return Q.type==="response.function_call_arguments.delta"}function K0(Q){return Q.type==="response.image_generation_call.partial_image"}function H0(Q){return Q.type==="response.code_interpreter_call_code.delta"}function B0(Q){return Q.type==="response.code_interpreter_call_code.done"}function T3(Q){return Q.type==="response.output_item.added"}function L0(Q){return T3(Q)&&Q.item.type==="reasoning"}function U0(Q){return Q.type==="response.output_text.annotation.added"}function N0(Q){return Q.type==="response.reasoning_summary_part.added"}function D0(Q){return Q.type==="response.reasoning_summary_text.delta"}function W0(Q){return Q.type==="error"}function _0(Q){let G=Q.startsWith("o3")||Q.startsWith("o4-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-chat"),W=Q.startsWith("gpt-4")||Q.startsWith("gpt-5-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-nano")&&!Q.startsWith("gpt-5-chat")||Q.startsWith("o3")||Q.startsWith("o4-mini"),N={requiredAutoTruncation:!1,systemMessageMode:"system",supportsFlexProcessing:G,supportsPriorityProcessing:W};if(Q.startsWith("gpt-5-chat"))return{...N,isReasoningModel:!1};if(Q.startsWith("o")||Q.startsWith("gpt-5")||Q.startsWith("codex-")||Q.startsWith("computer-use")){if(Q.startsWith("o1-mini")||Q.startsWith("o1-preview"))return{...N,isReasoningModel:!0,systemMessageMode:"remove"};return{...N,isReasoningModel:!0,systemMessageMode:"developer"}}return{...N,isReasoningModel:!1}}var q0=j.object({include:j.array(j.enum(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:j.string().nullish(),logprobs:j.union([j.boolean(),j.number().min(1).max(F3)]).optional(),maxToolCalls:j.number().nullish(),metadata:j.any().nullish(),parallelToolCalls:j.boolean().nullish(),previousResponseId:j.string().nullish(),promptCacheKey:j.string().nullish(),reasoningEffort:j.string().nullish(),reasoningSummary:j.string().nullish(),safetyIdentifier:j.string().nullish(),serviceTier:j.enum(["auto","flex","priority"]).nullish(),store:j.boolean().nullish(),strictJsonSchema:j.boolean().nullish(),textVerbosity:j.enum(["low","medium","high"]).nullish(),user:j.string().nullish()});var M0="0.1.0";function z3(Q={}){let G=I3(Q.baseURL??"https://api.openai.com/v1");if(!G)throw Error("baseURL is required");let W={...Q.apiKey&&{Authorization:`Bearer ${Q.apiKey}`},...Q.headers},N=()=>O3(W,`ai-sdk/openai-compatible/${M0}`),q=($)=>{return new a($,{provider:`${Q.name??"openai-compatible"}.chat`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},L=($)=>{return new X3($,{provider:`${Q.name??"openai-compatible"}.responses`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},Z=($)=>q($),Y=function($){return q($)};return Y.languageModel=Z,Y.chat=q,Y.responses=L,Y}var P0=z3();export{P0 as openaiCompatible,z3 as createOpenaiCompatible};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{a as
|
|
2
|
+
import{Of as r}from"./chunk-02txthqv.js";import{sh as n}from"./chunk-va4davgy.js";import{dl as e}from"./chunk-7mhffm9f.js";async function a(o){let t=await n.runPromise(e.Service.use((i)=>i.getGlobal()));return r(o,t)}function s(o){return o==="127.0.0.1"||o==="localhost"||o==="::1"}function c(o,t){return!s(o.hostname)&&!t&&!o.noAuth}
|
|
3
|
+
export{a as Ad,c as Bd};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$v as z$,$w as Qc,$x as Cc,Aw as v$,Ax as fA,Ay as B,Bw as g$,Bx as mA,By as I,Cw as y$,Cx as rA,Cy as o,Dw as Z$,Dx as pA,Dy as u,Ew as o$,Ex as eA,Ey as l,Fu as TW,Fw as u$,Fx as dA,Fy as f,Gu as W,Gw as l$,Gx as aA,Gy as m,Hu as vW,Hx as nA,Hy as r,Iw as f$,Ix as iA,Iy as nx,Ju as q$,Jw as m$,Jx as tA,Jy as p,Kw as r$,Kx as sA,Ky as e,Lu as E,Lw as p$,Lx as Ax,Ly as d,Mu as MA,Mw as e$,Mx as xx,My as a,Nu as b,Nw as d$,Nx as mW,Ny as n,Ou as q,Ow as a$,Ox as x$,Oy as i,Pu as jx,Pw as n$,Px as $$,Py as gc,Qw as i$,Qx as c$,Ru as g,Rv as UA,Rw as t$,Rx as W$,Su as y,Sv as TA,Sw as s$,Sx as Bc,Tu as gW,Tv as Q$,Tw as Ac,Tx as FW,Uv as Y$,Uw as xc,Ux as Pc,Vu as yW,Vv as O$,Vw as $c,Vx as Lc,Wu as Ux,Wv as J$,Ww as cc,Wx as Ec,Xv as X$,Xw as Wc,Xx as Dc,Yu as Tx,Yv as G$,Yw as _c,Yx as Nc,Zv as M$,Zw as qc,Zx as Sc,_u as vx,_v as w$,_w as Hc,_x as jW,_y as yc,av as gx,aw as K$,ax as Yc,ay as hW,bw as B$,bx as Oc,by as Vc,cv as yx,cw as P$,cx as Jc,cy as Rc,dw as ix,dx as Xc,dy as Ic,ev as Zx,ew as tx,ex as Gc,ey as kc,fw as sx,fx as Mc,fy as bc,gv as ox,gw as A$,gx as wc,gy as Fc,hw as L$,hx as zc,hy as jc,iv as ux,iw as E$,ix as ZW,iy as hc,jw as D$,jx as oW,jy as Uc,kv as lx,kw as N$,kx as uW,ky as Tc,lx as lW,ly as UW,lz as Zc,mv as fx,mw as S$,my as vc,mz as oc,nx as fW,ny as z,nz as uc,ov as mx,ow as C$,ox as P,oy as G,pw as V$,px as Kc,py as K,pz as lc,qv as rx,qx as bW,qy as X,qz as F,rw as R$,rx as vA,ry as px,sv as L,sw as I$,sx as cA,sy as ex,sz as rW,tv as H$,tw as k$,tx as gA,ty as dx,uw as b$,ux as yA,uy as ax,uz as w,vw as F$,vx as ZA,vy as D,ww as j$,wx as oA,wy as V,xw as h$,xx as QA,xy as N,yw as U$,yx as uA,yy as Z,zw as T$,zx as lA,zy as R}from"./chunk-a3te67a5.js";import{pP as RA}from"./chunk-naq602da.js";var hx=(A,x)=>{jx.init(A,x),A.name="ZodError",Object.defineProperties(A,{format:{value:($)=>y(A,$)},flatten:{value:($)=>g(A,$)},addIssue:{value:($)=>{A.issues.push($),A.message=JSON.stringify(A.issues,MA,2)}},addIssues:{value:($)=>{A.issues.push(...$),A.message=JSON.stringify(A.issues,MA,2)}},isEmpty:{get(){return A.issues.length===0}}})},pW=W("ZodError",hx),O=W("ZodError",hx,{Parent:Error});var wA=Ux(O),zA=Tx(O),KA=vx(O),BA=gx(O),PA=yx(O),LA=Zx(O),EA=ox(O),DA=ux(O),NA=lx(O),SA=fx(O),CA=mx(O),VA=rx(O);var Xq={};RA(Xq,{xid:()=>Q_,void:()=>j_,uuidv7:()=>A_,uuidv6:()=>sW,uuidv4:()=>tW,uuid:()=>iW,util:()=>q,url:()=>x_,uppercase:()=>l,unknown:()=>S,union:()=>Dx,undefined:()=>b_,ulid:()=>H_,uint64:()=>I_,uint32:()=>C_,tuple:()=>WW,trim:()=>a,treeifyError:()=>gW,transform:()=>Cx,toUpperCase:()=>i,toLowerCase:()=>n,toJSONSchema:()=>rW,templateLiteral:()=>a_,symbol:()=>k_,superRefine:()=>kW,success:()=>p_,stringbool:()=>xq,stringFormat:()=>B_,string:()=>jA,strictObject:()=>v_,startsWith:()=>m,size:()=>Z,setErrorMap:()=>_q,set:()=>u_,safeParseAsync:()=>BA,safeParse:()=>KA,safeEncodeAsync:()=>CA,safeEncode:()=>NA,safeDecodeAsync:()=>VA,safeDecode:()=>SA,registry:()=>fW,regexes:()=>L,regex:()=>o,refine:()=>IW,record:()=>_W,readonly:()=>DW,property:()=>nx,promise:()=>n_,prettifyError:()=>yW,preprocess:()=>cq,prefault:()=>wW,positive:()=>px,pipe:()=>HA,partialRecord:()=>Z_,parseAsync:()=>zA,parse:()=>wA,overwrite:()=>e,optional:()=>_A,object:()=>T_,number:()=>fc,nullish:()=>r_,nullable:()=>qA,null:()=>dc,normalize:()=>d,nonpositive:()=>dx,nonoptional:()=>zW,nonnegative:()=>ax,never:()=>Lx,negative:()=>ex,nativeEnum:()=>l_,nanoid:()=>W_,nan:()=>e_,multipleOf:()=>D,minSize:()=>N,minLength:()=>B,mime:()=>p,maxSize:()=>V,maxLength:()=>R,map:()=>o_,lte:()=>G,lt:()=>z,lowercase:()=>u,looseObject:()=>g_,locales:()=>oW,literal:()=>f_,length:()=>I,lazy:()=>CW,ksuid:()=>Y_,keyof:()=>U_,jwt:()=>K_,json:()=>$q,iso:()=>$A,ipv6:()=>J_,ipv4:()=>O_,intersection:()=>$W,int64:()=>R_,int32:()=>S_,int:()=>hA,instanceof:()=>Aq,includes:()=>f,httpUrl:()=>$_,hostname:()=>P_,hex:()=>L_,hash:()=>E_,guid:()=>nW,gte:()=>X,gt:()=>K,globalRegistry:()=>P,getErrorMap:()=>qq,function:()=>i_,formatError:()=>y,float64:()=>N_,float32:()=>D_,flattenError:()=>g,file:()=>m_,enum:()=>Sx,endsWith:()=>r,encodeAsync:()=>EA,encode:()=>PA,emoji:()=>c_,email:()=>aW,e164:()=>z_,discriminatedUnion:()=>y_,decodeAsync:()=>DA,decode:()=>LA,date:()=>h_,custom:()=>s_,cuid2:()=>q_,cuid:()=>__,core:()=>w,config:()=>E,coerce:()=>Fx,codec:()=>d_,clone:()=>b,cidrv6:()=>G_,cidrv4:()=>X_,check:()=>t_,catch:()=>PW,boolean:()=>mc,bigint:()=>V_,base64url:()=>w_,base64:()=>M_,array:()=>JA,any:()=>F_,_function:()=>i_,_default:()=>GW,_ZodString:()=>$x,ZodXID:()=>Yx,ZodVoid:()=>tc,ZodUnknown:()=>nc,ZodUnion:()=>Ex,ZodUndefined:()=>pc,ZodUUID:()=>M,ZodURL:()=>YA,ZodULID:()=>Qx,ZodType:()=>H,ZodTuple:()=>cW,ZodTransform:()=>OW,ZodTemplateLiteral:()=>NW,ZodSymbol:()=>rc,ZodSuccess:()=>KW,ZodStringFormat:()=>Q,ZodString:()=>j,ZodSet:()=>HW,ZodRecord:()=>Nx,ZodRealError:()=>O,ZodReadonly:()=>EW,ZodPromise:()=>VW,ZodPrefault:()=>MW,ZodPipe:()=>Ix,ZodOptional:()=>Vx,ZodObject:()=>XA,ZodNumberFormat:()=>C,ZodNumber:()=>U,ZodNullable:()=>JW,ZodNull:()=>ec,ZodNonOptional:()=>Rx,ZodNever:()=>ic,ZodNanoID:()=>_x,ZodNaN:()=>LW,ZodMap:()=>qW,ZodLiteral:()=>QW,ZodLazy:()=>SW,ZodKSUID:()=>Ox,ZodJWT:()=>Bx,ZodIssueCode:()=>Wq,ZodIntersection:()=>xW,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s,ZodIPv6:()=>Xx,ZodIPv4:()=>Jx,ZodGUID:()=>WA,ZodFunction:()=>RW,ZodFirstPartyTypeKind:()=>bx,ZodFile:()=>YW,ZodError:()=>pW,ZodEnum:()=>k,ZodEmoji:()=>Wx,ZodEmail:()=>cx,ZodE164:()=>Kx,ZodDiscriminatedUnion:()=>AW,ZodDefault:()=>XW,ZodDate:()=>OA,ZodCustomStringFormat:()=>h,ZodCustom:()=>GA,ZodCodec:()=>kx,ZodCatch:()=>BW,ZodCUID2:()=>Hx,ZodCUID:()=>qx,ZodCIDRv6:()=>Mx,ZodCIDRv4:()=>Gx,ZodBoolean:()=>T,ZodBigIntFormat:()=>Px,ZodBigInt:()=>v,ZodBase64URL:()=>zx,ZodBase64:()=>wx,ZodArray:()=>sc,ZodAny:()=>ac,TimePrecision:()=>mW,NEVER:()=>TW,$output:()=>uW,$input:()=>lW,$brand:()=>vW});var $A={};RA($A,{time:()=>bA,duration:()=>FA,datetime:()=>IA,date:()=>kA,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s});var t=W("ZodISODateTime",(A,x)=>{ix.init(A,x),Q.init(A,x)});function IA(A){return x$(t,A)}var s=W("ZodISODate",(A,x)=>{tx.init(A,x),Q.init(A,x)});function kA(A){return $$(s,A)}var AA=W("ZodISOTime",(A,x)=>{sx.init(A,x),Q.init(A,x)});function bA(A){return c$(AA,A)}var xA=W("ZodISODuration",(A,x)=>{A$.init(A,x),Q.init(A,x)});function FA(A){return W$(xA,A)}var H=W("ZodType",(A,x)=>{return UA.init(A,x),A.def=x,A.type=x.type,Object.defineProperty(A,"_def",{value:x}),A.check=(...$)=>{return A.clone({...x,checks:[...x.checks??[],...$.map((c)=>typeof c==="function"?{_zod:{check:c,def:{check:"custom"},onattach:[]}}:c)]})},A.clone=($,c)=>b(A,$,c),A.brand=()=>A,A.register=($,c)=>{return $.add(A,c),A},A.parse=($,c)=>wA(A,$,c,{callee:A.parse}),A.safeParse=($,c)=>KA(A,$,c),A.parseAsync=async($,c)=>zA(A,$,c,{callee:A.parseAsync}),A.safeParseAsync=async($,c)=>BA(A,$,c),A.spa=A.safeParseAsync,A.encode=($,c)=>PA(A,$,c),A.decode=($,c)=>LA(A,$,c),A.encodeAsync=async($,c)=>EA(A,$,c),A.decodeAsync=async($,c)=>DA(A,$,c),A.safeEncode=($,c)=>NA(A,$,c),A.safeDecode=($,c)=>SA(A,$,c),A.safeEncodeAsync=async($,c)=>CA(A,$,c),A.safeDecodeAsync=async($,c)=>VA(A,$,c),A.refine=($,c)=>A.check(IW($,c)),A.superRefine=($)=>A.check(kW($)),A.overwrite=($)=>A.check(e($)),A.optional=()=>_A(A),A.nullable=()=>qA(A),A.nullish=()=>_A(qA(A)),A.nonoptional=($)=>zW(A,$),A.array=()=>JA(A),A.or=($)=>Dx([A,$]),A.and=($)=>$W(A,$),A.transform=($)=>HA(A,Cx($)),A.default=($)=>GW(A,$),A.prefault=($)=>wW(A,$),A.catch=($)=>PW(A,$),A.pipe=($)=>HA(A,$),A.readonly=()=>DW(A),A.describe=($)=>{let c=A.clone();return P.add(c,{description:$}),c},Object.defineProperty(A,"description",{get(){return P.get(A)?.description},configurable:!0}),A.meta=(...$)=>{if($.length===0)return P.get(A);let c=A.clone();return P.add(c,$[0]),c},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A}),$x=W("_ZodString",(A,x)=>{TA.init(A,x),H.init(A,x);let $=A._zod.bag;A.format=$.format??null,A.minLength=$.minimum??null,A.maxLength=$.maximum??null,A.regex=(...c)=>A.check(o(...c)),A.includes=(...c)=>A.check(f(...c)),A.startsWith=(...c)=>A.check(m(...c)),A.endsWith=(...c)=>A.check(r(...c)),A.min=(...c)=>A.check(B(...c)),A.max=(...c)=>A.check(R(...c)),A.length=(...c)=>A.check(I(...c)),A.nonempty=(...c)=>A.check(B(1,...c)),A.lowercase=(c)=>A.check(u(c)),A.uppercase=(c)=>A.check(l(c)),A.trim=()=>A.check(a()),A.normalize=(...c)=>A.check(d(...c)),A.toLowerCase=()=>A.check(n()),A.toUpperCase=()=>A.check(i())}),j=W("ZodString",(A,x)=>{TA.init(A,x),$x.init(A,x),A.email=($)=>A.check(vA(cx,$)),A.url=($)=>A.check(QA(YA,$)),A.jwt=($)=>A.check(xx(Bx,$)),A.emoji=($)=>A.check(uA(Wx,$)),A.guid=($)=>A.check(cA(WA,$)),A.uuid=($)=>A.check(gA(M,$)),A.uuidv4=($)=>A.check(yA(M,$)),A.uuidv6=($)=>A.check(ZA(M,$)),A.uuidv7=($)=>A.check(oA(M,$)),A.nanoid=($)=>A.check(lA(_x,$)),A.guid=($)=>A.check(cA(WA,$)),A.cuid=($)=>A.check(fA(qx,$)),A.cuid2=($)=>A.check(mA(Hx,$)),A.ulid=($)=>A.check(rA(Qx,$)),A.base64=($)=>A.check(tA(wx,$)),A.base64url=($)=>A.check(sA(zx,$)),A.xid=($)=>A.check(pA(Yx,$)),A.ksuid=($)=>A.check(eA(Ox,$)),A.ipv4=($)=>A.check(dA(Jx,$)),A.ipv6=($)=>A.check(aA(Xx,$)),A.cidrv4=($)=>A.check(nA(Gx,$)),A.cidrv6=($)=>A.check(iA(Mx,$)),A.e164=($)=>A.check(Ax(Kx,$)),A.datetime=($)=>A.check(IA($)),A.date=($)=>A.check(kA($)),A.time=($)=>A.check(bA($)),A.duration=($)=>A.check(FA($))});function jA(A){return Kc(j,A)}var Q=W("ZodStringFormat",(A,x)=>{Q$.init(A,x),$x.init(A,x)}),cx=W("ZodEmail",(A,x)=>{J$.init(A,x),Q.init(A,x)});function aW(A){return vA(cx,A)}var WA=W("ZodGUID",(A,x)=>{Y$.init(A,x),Q.init(A,x)});function nW(A){return cA(WA,A)}var M=W("ZodUUID",(A,x)=>{O$.init(A,x),Q.init(A,x)});function iW(A){return gA(M,A)}function tW(A){return yA(M,A)}function sW(A){return ZA(M,A)}function A_(A){return oA(M,A)}var YA=W("ZodURL",(A,x)=>{X$.init(A,x),Q.init(A,x)});function x_(A){return QA(YA,A)}function $_(A){return QA(YA,{protocol:/^https?$/,hostname:L.domain,...q.normalizeParams(A)})}var Wx=W("ZodEmoji",(A,x)=>{G$.init(A,x),Q.init(A,x)});function c_(A){return uA(Wx,A)}var _x=W("ZodNanoID",(A,x)=>{M$.init(A,x),Q.init(A,x)});function W_(A){return lA(_x,A)}var qx=W("ZodCUID",(A,x)=>{w$.init(A,x),Q.init(A,x)});function __(A){return fA(qx,A)}var Hx=W("ZodCUID2",(A,x)=>{z$.init(A,x),Q.init(A,x)});function q_(A){return mA(Hx,A)}var Qx=W("ZodULID",(A,x)=>{K$.init(A,x),Q.init(A,x)});function H_(A){return rA(Qx,A)}var Yx=W("ZodXID",(A,x)=>{B$.init(A,x),Q.init(A,x)});function Q_(A){return pA(Yx,A)}var Ox=W("ZodKSUID",(A,x)=>{P$.init(A,x),Q.init(A,x)});function Y_(A){return eA(Ox,A)}var Jx=W("ZodIPv4",(A,x)=>{L$.init(A,x),Q.init(A,x)});function O_(A){return dA(Jx,A)}var Xx=W("ZodIPv6",(A,x)=>{E$.init(A,x),Q.init(A,x)});function J_(A){return aA(Xx,A)}var Gx=W("ZodCIDRv4",(A,x)=>{D$.init(A,x),Q.init(A,x)});function X_(A){return nA(Gx,A)}var Mx=W("ZodCIDRv6",(A,x)=>{N$.init(A,x),Q.init(A,x)});function G_(A){return iA(Mx,A)}var wx=W("ZodBase64",(A,x)=>{S$.init(A,x),Q.init(A,x)});function M_(A){return tA(wx,A)}var zx=W("ZodBase64URL",(A,x)=>{C$.init(A,x),Q.init(A,x)});function w_(A){return sA(zx,A)}var Kx=W("ZodE164",(A,x)=>{V$.init(A,x),Q.init(A,x)});function z_(A){return Ax(Kx,A)}var Bx=W("ZodJWT",(A,x)=>{R$.init(A,x),Q.init(A,x)});function K_(A){return xx(Bx,A)}var h=W("ZodCustomStringFormat",(A,x)=>{I$.init(A,x),Q.init(A,x)});function B_(A,x,$={}){return F(h,A,x,$)}function P_(A){return F(h,"hostname",L.hostname,A)}function L_(A){return F(h,"hex",L.hex,A)}function E_(A,x){let $=x?.enc??"hex",c=`${A}_${$}`,_=L[c];if(!_)throw Error(`Unrecognized hash format: ${c}`);return F(h,c,_,x)}var U=W("ZodNumber",(A,x)=>{k$.init(A,x),H.init(A,x),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.int=(c)=>A.check(hA(c)),A.safe=(c)=>A.check(hA(c)),A.positive=(c)=>A.check(K(0,c)),A.nonnegative=(c)=>A.check(X(0,c)),A.negative=(c)=>A.check(z(0,c)),A.nonpositive=(c)=>A.check(G(0,c)),A.multipleOf=(c,_)=>A.check(D(c,_)),A.step=(c,_)=>A.check(D(c,_)),A.finite=()=>A;let $=A._zod.bag;A.minValue=Math.max($.minimum??Number.NEGATIVE_INFINITY,$.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min($.maximum??Number.POSITIVE_INFINITY,$.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=($.format??"").includes("int")||Number.isSafeInteger($.multipleOf??0.5),A.isFinite=!0,A.format=$.format??null});function fc(A){return Bc(U,A)}var C=W("ZodNumberFormat",(A,x)=>{b$.init(A,x),U.init(A,x)});function hA(A){return Pc(C,A)}function D_(A){return Lc(C,A)}function N_(A){return Ec(C,A)}function S_(A){return Dc(C,A)}function C_(A){return Nc(C,A)}var T=W("ZodBoolean",(A,x)=>{F$.init(A,x),H.init(A,x)});function mc(A){return Sc(T,A)}var v=W("ZodBigInt",(A,x)=>{j$.init(A,x),H.init(A,x),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.positive=(c)=>A.check(K(BigInt(0),c)),A.negative=(c)=>A.check(z(BigInt(0),c)),A.nonpositive=(c)=>A.check(G(BigInt(0),c)),A.nonnegative=(c)=>A.check(X(BigInt(0),c)),A.multipleOf=(c,_)=>A.check(D(c,_));let $=A._zod.bag;A.minValue=$.minimum??null,A.maxValue=$.maximum??null,A.format=$.format??null});function V_(A){return Cc(v,A)}var Px=W("ZodBigIntFormat",(A,x)=>{h$.init(A,x),v.init(A,x)});function R_(A){return Vc(Px,A)}function I_(A){return Rc(Px,A)}var rc=W("ZodSymbol",(A,x)=>{U$.init(A,x),H.init(A,x)});function k_(A){return Ic(rc,A)}var pc=W("ZodUndefined",(A,x)=>{T$.init(A,x),H.init(A,x)});function b_(A){return kc(pc,A)}var ec=W("ZodNull",(A,x)=>{v$.init(A,x),H.init(A,x)});function dc(A){return bc(ec,A)}var ac=W("ZodAny",(A,x)=>{g$.init(A,x),H.init(A,x)});function F_(){return Fc(ac)}var nc=W("ZodUnknown",(A,x)=>{y$.init(A,x),H.init(A,x)});function S(){return jc(nc)}var ic=W("ZodNever",(A,x)=>{Z$.init(A,x),H.init(A,x)});function Lx(A){return hc(ic,A)}var tc=W("ZodVoid",(A,x)=>{o$.init(A,x),H.init(A,x)});function j_(A){return Uc(tc,A)}var OA=W("ZodDate",(A,x)=>{u$.init(A,x),H.init(A,x),A.min=(c,_)=>A.check(X(c,_)),A.max=(c,_)=>A.check(G(c,_));let $=A._zod.bag;A.minDate=$.minimum?new Date($.minimum):null,A.maxDate=$.maximum?new Date($.maximum):null});function h_(A){return Tc(OA,A)}var sc=W("ZodArray",(A,x)=>{l$.init(A,x),H.init(A,x),A.element=x.element,A.min=($,c)=>A.check(B($,c)),A.nonempty=($)=>A.check(B(1,$)),A.max=($,c)=>A.check(R($,c)),A.length=($,c)=>A.check(I($,c)),A.unwrap=()=>A.element});function JA(A,x){return gc(sc,A,x)}function U_(A){let x=A._zod.def.shape;return Sx(Object.keys(x))}var XA=W("ZodObject",(A,x)=>{f$.init(A,x),H.init(A,x),q.defineLazy(A,"shape",()=>x.shape),A.keyof=()=>Sx(Object.keys(A._zod.def.shape)),A.catchall=($)=>A.clone({...A._zod.def,catchall:$}),A.passthrough=()=>A.clone({...A._zod.def,catchall:S()}),A.loose=()=>A.clone({...A._zod.def,catchall:S()}),A.strict=()=>A.clone({...A._zod.def,catchall:Lx()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=($)=>{return q.extend(A,$)},A.safeExtend=($)=>{return q.safeExtend(A,$)},A.merge=($)=>q.merge(A,$),A.pick=($)=>q.pick(A,$),A.omit=($)=>q.omit(A,$),A.partial=(...$)=>q.partial(Vx,A,$[0]),A.required=(...$)=>q.required(Rx,A,$[0])});function T_(A,x){let $={type:"object",get shape(){return q.assignProp(this,"shape",A?q.objectClone(A):{}),this.shape},...q.normalizeParams(x)};return new XA($)}function v_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:Lx(),...q.normalizeParams(x)})}function g_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:S(),...q.normalizeParams(x)})}var Ex=W("ZodUnion",(A,x)=>{m$.init(A,x),H.init(A,x),A.options=x.options});function Dx(A,x){return new Ex({type:"union",options:A,...q.normalizeParams(x)})}var AW=W("ZodDiscriminatedUnion",(A,x)=>{Ex.init(A,x),r$.init(A,x)});function y_(A,x,$){return new AW({type:"union",options:x,discriminator:A,...q.normalizeParams($)})}var xW=W("ZodIntersection",(A,x)=>{p$.init(A,x),H.init(A,x)});function $W(A,x){return new xW({type:"intersection",left:A,right:x})}var cW=W("ZodTuple",(A,x)=>{e$.init(A,x),H.init(A,x),A.rest=($)=>A.clone({...A._zod.def,rest:$})});function WW(A,x,$){let c=x instanceof UA,_=c?$:x;return new cW({type:"tuple",items:A,rest:c?x:null,...q.normalizeParams(_)})}var Nx=W("ZodRecord",(A,x)=>{d$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function _W(A,x,$){return new Nx({type:"record",keyType:A,valueType:x,...q.normalizeParams($)})}function Z_(A,x,$){let c=b(A);return c._zod.values=void 0,new Nx({type:"record",keyType:c,valueType:x,...q.normalizeParams($)})}var qW=W("ZodMap",(A,x)=>{a$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function o_(A,x,$){return new qW({type:"map",keyType:A,valueType:x,...q.normalizeParams($)})}var HW=W("ZodSet",(A,x)=>{n$.init(A,x),H.init(A,x),A.min=(...$)=>A.check(N(...$)),A.nonempty=($)=>A.check(N(1,$)),A.max=(...$)=>A.check(V(...$)),A.size=(...$)=>A.check(Z(...$))});function u_(A,x){return new HW({type:"set",valueType:A,...q.normalizeParams(x)})}var k=W("ZodEnum",(A,x)=>{i$.init(A,x),H.init(A,x),A.enum=x.entries,A.options=Object.values(x.entries);let $=new Set(Object.keys(x.entries));A.extract=(c,_)=>{let J={};for(let Y of c)if($.has(Y))J[Y]=x.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})},A.exclude=(c,_)=>{let J={...x.entries};for(let Y of c)if($.has(Y))delete J[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})}});function Sx(A,x){let $=Array.isArray(A)?Object.fromEntries(A.map((c)=>[c,c])):A;return new k({type:"enum",entries:$,...q.normalizeParams(x)})}function l_(A,x){return new k({type:"enum",entries:A,...q.normalizeParams(x)})}var QW=W("ZodLiteral",(A,x)=>{t$.init(A,x),H.init(A,x),A.values=new Set(x.values),Object.defineProperty(A,"value",{get(){if(x.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return x.values[0]}})});function f_(A,x){return new QW({type:"literal",values:Array.isArray(A)?A:[A],...q.normalizeParams(x)})}var YW=W("ZodFile",(A,x)=>{s$.init(A,x),H.init(A,x),A.min=($,c)=>A.check(N($,c)),A.max=($,c)=>A.check(V($,c)),A.mime=($,c)=>A.check(p(Array.isArray($)?$:[$],c))});function m_(A){return yc(YW,A)}var OW=W("ZodTransform",(A,x)=>{Ac.init(A,x),H.init(A,x),A._zod.parse=($,c)=>{if(c.direction==="backward")throw new q$(A.constructor.name);$.addIssue=(J)=>{if(typeof J==="string")$.issues.push(q.issue(J,$.value,x));else{let Y=J;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=$.value),Y.inst??(Y.inst=A),$.issues.push(q.issue(Y))}};let _=x.transform($.value,$);if(_ instanceof Promise)return _.then((J)=>{return $.value=J,$});return $.value=_,$}});function Cx(A){return new OW({type:"transform",transform:A})}var Vx=W("ZodOptional",(A,x)=>{xc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function _A(A){return new Vx({type:"optional",innerType:A})}var JW=W("ZodNullable",(A,x)=>{$c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function qA(A){return new JW({type:"nullable",innerType:A})}function r_(A){return _A(qA(A))}var XW=W("ZodDefault",(A,x)=>{cc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});function GW(A,x){return new XW({type:"default",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var MW=W("ZodPrefault",(A,x)=>{Wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function wW(A,x){return new MW({type:"prefault",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var Rx=W("ZodNonOptional",(A,x)=>{_c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function zW(A,x){return new Rx({type:"nonoptional",innerType:A,...q.normalizeParams(x)})}var KW=W("ZodSuccess",(A,x)=>{qc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function p_(A){return new KW({type:"success",innerType:A})}var BW=W("ZodCatch",(A,x)=>{Hc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});function PW(A,x){return new BW({type:"catch",innerType:A,catchValue:typeof x==="function"?x:()=>x})}var LW=W("ZodNaN",(A,x)=>{Qc.init(A,x),H.init(A,x)});function e_(A){return vc(LW,A)}var Ix=W("ZodPipe",(A,x)=>{Yc.init(A,x),H.init(A,x),A.in=x.in,A.out=x.out});function HA(A,x){return new Ix({type:"pipe",in:A,out:x})}var kx=W("ZodCodec",(A,x)=>{Ix.init(A,x),Oc.init(A,x)});function d_(A,x,$){return new kx({type:"pipe",in:A,out:x,transform:$.decode,reverseTransform:$.encode})}var EW=W("ZodReadonly",(A,x)=>{Jc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function DW(A){return new EW({type:"readonly",innerType:A})}var NW=W("ZodTemplateLiteral",(A,x)=>{Xc.init(A,x),H.init(A,x)});function a_(A,x){return new NW({type:"template_literal",parts:A,...q.normalizeParams(x)})}var SW=W("ZodLazy",(A,x)=>{wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.getter()});function CW(A){return new SW({type:"lazy",getter:A})}var VW=W("ZodPromise",(A,x)=>{Mc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function n_(A){return new VW({type:"promise",innerType:A})}var RW=W("ZodFunction",(A,x)=>{Gc.init(A,x),H.init(A,x)});function i_(A){return new RW({type:"function",input:Array.isArray(A?.input)?WW(A?.input):A?.input??JA(S()),output:A?.output??S()})}var GA=W("ZodCustom",(A,x)=>{zc.init(A,x),H.init(A,x)});function t_(A){let x=new H$({check:"custom"});return x._zod.check=A,x}function s_(A,x){return Zc(GA,A??(()=>!0),x)}function IW(A,x={}){return oc(GA,A,x)}function kW(A){return uc(A)}function Aq(A,x={error:`Input not instance of ${A.name}`}){let $=new GA({type:"custom",check:"custom",fn:(c)=>c instanceof A,abort:!0,...q.normalizeParams(x)});return $._zod.bag.Class=A,$}var xq=(...A)=>lc({Codec:kx,Boolean:T,String:j},...A);function $q(A){let x=CW(()=>{return Dx([jA(A),fc(),mc(),dc(),JA(x),_W(jA(),x)])});return x}function cq(A,x){return HA(Cx(A),x)}var Wq={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function _q(A){E({customError:A})}function qq(){return E().customError}var bx;(function(A){})(bx||(bx={}));var Fx={};RA(Fx,{string:()=>Hq,number:()=>Qq,date:()=>Jq,boolean:()=>Yq,bigint:()=>Oq});function Hq(A){return bW(j,A)}function Qq(A){return FW(U,A)}function Yq(A){return jW(T,A)}function Oq(A){return hW(v,A)}function Jq(A){return UW(OA,A)}E(ZW());
|
|
3
|
-
export{$A as
|
|
2
|
+
import{$w as i$,$x as c$,Aw as V$,Ax as Kc,Ay as K,Az as lc,Bv as rx,Bx as bW,By as X,Bz as F,Cw as R$,Cx as vA,Cy as px,Dv as L,Dw as I$,Dx as cA,Dy as ex,Dz as rW,Ev as H$,Ew as k$,Ex as gA,Ey as dx,Fw as b$,Fx as yA,Fy as ax,Fz as w,Gw as F$,Gx as ZA,Gy as D,Hw as j$,Hx as oA,Hy as V,Iw as h$,Ix as QA,Iy as N,Jw as U$,Jx as uA,Jy as Z,Kw as T$,Kx as lA,Ky as R,Lw as v$,Lx as fA,Ly as B,Mw as g$,Mx as mA,My as I,Nw as y$,Nx as rA,Ny as o,Ow as Z$,Ox as pA,Oy as u,Pw as o$,Px as eA,Py as l,Qu as TW,Qw as u$,Qx as dA,Qy as f,Ru as W,Rw as l$,Rx as aA,Ry as m,Su as vW,Sx as nA,Sy as r,Tw as f$,Tx as iA,Ty as nx,Uu as q$,Uw as m$,Ux as tA,Uy as p,Vw as r$,Vx as sA,Vy as e,Wu as E,Ww as p$,Wx as Ax,Wy as d,Xu as MA,Xw as e$,Xx as xx,Xy as a,Yu as b,Yw as d$,Yx as mW,Yy as n,Zu as q,Zw as a$,Zx as x$,Zy as i,_u as jx,_w as n$,_x as $$,_y as gc,av as g,aw as UA,ax as t$,ay as W$,bv as y,bw as TA,bx as s$,by as Bc,cv as gW,cw as Q$,cx as Ac,cy as FW,dw as Y$,dx as xc,dy as Pc,ev as yW,ew as O$,ex as $c,ey as Lc,fv as Ux,fw as J$,fx as cc,fy as Ec,gw as X$,gx as Wc,gy as Dc,hv as Tx,hw as G$,hx as _c,hy as Nc,iw as M$,ix as qc,iy as Sc,jv as vx,jw as w$,jx as Hc,jy as jW,jz as yc,kw as z$,kx as Qc,ky as Cc,lv as gx,lw as K$,lx as Yc,ly as hW,mw as B$,mx as Oc,my as Vc,nv as yx,nw as P$,nx as Jc,ny as Rc,ow as ix,ox as Xc,oy as Ic,pv as Zx,pw as tx,px as Gc,py as kc,qw as sx,qx as Mc,qy as bc,rv as ox,rw as A$,rx as wc,ry as Fc,sw as L$,sx as zc,sy as jc,tv as ux,tw as E$,tx as ZW,ty as hc,uw as D$,ux as oW,uy as Uc,vv as lx,vw as N$,vx as uW,vy as Tc,wx as lW,wy as UW,wz as Zc,xv as fx,xw as S$,xy as vc,xz as oc,yx as fW,yy as z,yz as uc,zv as mx,zw as C$,zx as P,zy as G}from"./chunk-6g3m7yxf.js";import{AP as RA}from"./chunk-hh4c02fh.js";var hx=(A,x)=>{jx.init(A,x),A.name="ZodError",Object.defineProperties(A,{format:{value:($)=>y(A,$)},flatten:{value:($)=>g(A,$)},addIssue:{value:($)=>{A.issues.push($),A.message=JSON.stringify(A.issues,MA,2)}},addIssues:{value:($)=>{A.issues.push(...$),A.message=JSON.stringify(A.issues,MA,2)}},isEmpty:{get(){return A.issues.length===0}}})},pW=W("ZodError",hx),O=W("ZodError",hx,{Parent:Error});var wA=Ux(O),zA=Tx(O),KA=vx(O),BA=gx(O),PA=yx(O),LA=Zx(O),EA=ox(O),DA=ux(O),NA=lx(O),SA=fx(O),CA=mx(O),VA=rx(O);var Xq={};RA(Xq,{xid:()=>Q_,void:()=>j_,uuidv7:()=>A_,uuidv6:()=>sW,uuidv4:()=>tW,uuid:()=>iW,util:()=>q,url:()=>x_,uppercase:()=>l,unknown:()=>S,union:()=>Dx,undefined:()=>b_,ulid:()=>H_,uint64:()=>I_,uint32:()=>C_,tuple:()=>WW,trim:()=>a,treeifyError:()=>gW,transform:()=>Cx,toUpperCase:()=>i,toLowerCase:()=>n,toJSONSchema:()=>rW,templateLiteral:()=>a_,symbol:()=>k_,superRefine:()=>kW,success:()=>p_,stringbool:()=>xq,stringFormat:()=>B_,string:()=>jA,strictObject:()=>v_,startsWith:()=>m,size:()=>Z,setErrorMap:()=>_q,set:()=>u_,safeParseAsync:()=>BA,safeParse:()=>KA,safeEncodeAsync:()=>CA,safeEncode:()=>NA,safeDecodeAsync:()=>VA,safeDecode:()=>SA,registry:()=>fW,regexes:()=>L,regex:()=>o,refine:()=>IW,record:()=>_W,readonly:()=>DW,property:()=>nx,promise:()=>n_,prettifyError:()=>yW,preprocess:()=>cq,prefault:()=>wW,positive:()=>px,pipe:()=>HA,partialRecord:()=>Z_,parseAsync:()=>zA,parse:()=>wA,overwrite:()=>e,optional:()=>_A,object:()=>T_,number:()=>fc,nullish:()=>r_,nullable:()=>qA,null:()=>dc,normalize:()=>d,nonpositive:()=>dx,nonoptional:()=>zW,nonnegative:()=>ax,never:()=>Lx,negative:()=>ex,nativeEnum:()=>l_,nanoid:()=>W_,nan:()=>e_,multipleOf:()=>D,minSize:()=>N,minLength:()=>B,mime:()=>p,maxSize:()=>V,maxLength:()=>R,map:()=>o_,lte:()=>G,lt:()=>z,lowercase:()=>u,looseObject:()=>g_,locales:()=>oW,literal:()=>f_,length:()=>I,lazy:()=>CW,ksuid:()=>Y_,keyof:()=>U_,jwt:()=>K_,json:()=>$q,iso:()=>$A,ipv6:()=>J_,ipv4:()=>O_,intersection:()=>$W,int64:()=>R_,int32:()=>S_,int:()=>hA,instanceof:()=>Aq,includes:()=>f,httpUrl:()=>$_,hostname:()=>P_,hex:()=>L_,hash:()=>E_,guid:()=>nW,gte:()=>X,gt:()=>K,globalRegistry:()=>P,getErrorMap:()=>qq,function:()=>i_,formatError:()=>y,float64:()=>N_,float32:()=>D_,flattenError:()=>g,file:()=>m_,enum:()=>Sx,endsWith:()=>r,encodeAsync:()=>EA,encode:()=>PA,emoji:()=>c_,email:()=>aW,e164:()=>z_,discriminatedUnion:()=>y_,decodeAsync:()=>DA,decode:()=>LA,date:()=>h_,custom:()=>s_,cuid2:()=>q_,cuid:()=>__,core:()=>w,config:()=>E,coerce:()=>Fx,codec:()=>d_,clone:()=>b,cidrv6:()=>G_,cidrv4:()=>X_,check:()=>t_,catch:()=>PW,boolean:()=>mc,bigint:()=>V_,base64url:()=>w_,base64:()=>M_,array:()=>JA,any:()=>F_,_function:()=>i_,_default:()=>GW,_ZodString:()=>$x,ZodXID:()=>Yx,ZodVoid:()=>tc,ZodUnknown:()=>nc,ZodUnion:()=>Ex,ZodUndefined:()=>pc,ZodUUID:()=>M,ZodURL:()=>YA,ZodULID:()=>Qx,ZodType:()=>H,ZodTuple:()=>cW,ZodTransform:()=>OW,ZodTemplateLiteral:()=>NW,ZodSymbol:()=>rc,ZodSuccess:()=>KW,ZodStringFormat:()=>Q,ZodString:()=>j,ZodSet:()=>HW,ZodRecord:()=>Nx,ZodRealError:()=>O,ZodReadonly:()=>EW,ZodPromise:()=>VW,ZodPrefault:()=>MW,ZodPipe:()=>Ix,ZodOptional:()=>Vx,ZodObject:()=>XA,ZodNumberFormat:()=>C,ZodNumber:()=>U,ZodNullable:()=>JW,ZodNull:()=>ec,ZodNonOptional:()=>Rx,ZodNever:()=>ic,ZodNanoID:()=>_x,ZodNaN:()=>LW,ZodMap:()=>qW,ZodLiteral:()=>QW,ZodLazy:()=>SW,ZodKSUID:()=>Ox,ZodJWT:()=>Bx,ZodIssueCode:()=>Wq,ZodIntersection:()=>xW,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s,ZodIPv6:()=>Xx,ZodIPv4:()=>Jx,ZodGUID:()=>WA,ZodFunction:()=>RW,ZodFirstPartyTypeKind:()=>bx,ZodFile:()=>YW,ZodError:()=>pW,ZodEnum:()=>k,ZodEmoji:()=>Wx,ZodEmail:()=>cx,ZodE164:()=>Kx,ZodDiscriminatedUnion:()=>AW,ZodDefault:()=>XW,ZodDate:()=>OA,ZodCustomStringFormat:()=>h,ZodCustom:()=>GA,ZodCodec:()=>kx,ZodCatch:()=>BW,ZodCUID2:()=>Hx,ZodCUID:()=>qx,ZodCIDRv6:()=>Mx,ZodCIDRv4:()=>Gx,ZodBoolean:()=>T,ZodBigIntFormat:()=>Px,ZodBigInt:()=>v,ZodBase64URL:()=>zx,ZodBase64:()=>wx,ZodArray:()=>sc,ZodAny:()=>ac,TimePrecision:()=>mW,NEVER:()=>TW,$output:()=>uW,$input:()=>lW,$brand:()=>vW});var $A={};RA($A,{time:()=>bA,duration:()=>FA,datetime:()=>IA,date:()=>kA,ZodISOTime:()=>AA,ZodISODuration:()=>xA,ZodISODateTime:()=>t,ZodISODate:()=>s});var t=W("ZodISODateTime",(A,x)=>{ix.init(A,x),Q.init(A,x)});function IA(A){return x$(t,A)}var s=W("ZodISODate",(A,x)=>{tx.init(A,x),Q.init(A,x)});function kA(A){return $$(s,A)}var AA=W("ZodISOTime",(A,x)=>{sx.init(A,x),Q.init(A,x)});function bA(A){return c$(AA,A)}var xA=W("ZodISODuration",(A,x)=>{A$.init(A,x),Q.init(A,x)});function FA(A){return W$(xA,A)}var H=W("ZodType",(A,x)=>{return UA.init(A,x),A.def=x,A.type=x.type,Object.defineProperty(A,"_def",{value:x}),A.check=(...$)=>{return A.clone({...x,checks:[...x.checks??[],...$.map((c)=>typeof c==="function"?{_zod:{check:c,def:{check:"custom"},onattach:[]}}:c)]})},A.clone=($,c)=>b(A,$,c),A.brand=()=>A,A.register=($,c)=>{return $.add(A,c),A},A.parse=($,c)=>wA(A,$,c,{callee:A.parse}),A.safeParse=($,c)=>KA(A,$,c),A.parseAsync=async($,c)=>zA(A,$,c,{callee:A.parseAsync}),A.safeParseAsync=async($,c)=>BA(A,$,c),A.spa=A.safeParseAsync,A.encode=($,c)=>PA(A,$,c),A.decode=($,c)=>LA(A,$,c),A.encodeAsync=async($,c)=>EA(A,$,c),A.decodeAsync=async($,c)=>DA(A,$,c),A.safeEncode=($,c)=>NA(A,$,c),A.safeDecode=($,c)=>SA(A,$,c),A.safeEncodeAsync=async($,c)=>CA(A,$,c),A.safeDecodeAsync=async($,c)=>VA(A,$,c),A.refine=($,c)=>A.check(IW($,c)),A.superRefine=($)=>A.check(kW($)),A.overwrite=($)=>A.check(e($)),A.optional=()=>_A(A),A.nullable=()=>qA(A),A.nullish=()=>_A(qA(A)),A.nonoptional=($)=>zW(A,$),A.array=()=>JA(A),A.or=($)=>Dx([A,$]),A.and=($)=>$W(A,$),A.transform=($)=>HA(A,Cx($)),A.default=($)=>GW(A,$),A.prefault=($)=>wW(A,$),A.catch=($)=>PW(A,$),A.pipe=($)=>HA(A,$),A.readonly=()=>DW(A),A.describe=($)=>{let c=A.clone();return P.add(c,{description:$}),c},Object.defineProperty(A,"description",{get(){return P.get(A)?.description},configurable:!0}),A.meta=(...$)=>{if($.length===0)return P.get(A);let c=A.clone();return P.add(c,$[0]),c},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A}),$x=W("_ZodString",(A,x)=>{TA.init(A,x),H.init(A,x);let $=A._zod.bag;A.format=$.format??null,A.minLength=$.minimum??null,A.maxLength=$.maximum??null,A.regex=(...c)=>A.check(o(...c)),A.includes=(...c)=>A.check(f(...c)),A.startsWith=(...c)=>A.check(m(...c)),A.endsWith=(...c)=>A.check(r(...c)),A.min=(...c)=>A.check(B(...c)),A.max=(...c)=>A.check(R(...c)),A.length=(...c)=>A.check(I(...c)),A.nonempty=(...c)=>A.check(B(1,...c)),A.lowercase=(c)=>A.check(u(c)),A.uppercase=(c)=>A.check(l(c)),A.trim=()=>A.check(a()),A.normalize=(...c)=>A.check(d(...c)),A.toLowerCase=()=>A.check(n()),A.toUpperCase=()=>A.check(i())}),j=W("ZodString",(A,x)=>{TA.init(A,x),$x.init(A,x),A.email=($)=>A.check(vA(cx,$)),A.url=($)=>A.check(QA(YA,$)),A.jwt=($)=>A.check(xx(Bx,$)),A.emoji=($)=>A.check(uA(Wx,$)),A.guid=($)=>A.check(cA(WA,$)),A.uuid=($)=>A.check(gA(M,$)),A.uuidv4=($)=>A.check(yA(M,$)),A.uuidv6=($)=>A.check(ZA(M,$)),A.uuidv7=($)=>A.check(oA(M,$)),A.nanoid=($)=>A.check(lA(_x,$)),A.guid=($)=>A.check(cA(WA,$)),A.cuid=($)=>A.check(fA(qx,$)),A.cuid2=($)=>A.check(mA(Hx,$)),A.ulid=($)=>A.check(rA(Qx,$)),A.base64=($)=>A.check(tA(wx,$)),A.base64url=($)=>A.check(sA(zx,$)),A.xid=($)=>A.check(pA(Yx,$)),A.ksuid=($)=>A.check(eA(Ox,$)),A.ipv4=($)=>A.check(dA(Jx,$)),A.ipv6=($)=>A.check(aA(Xx,$)),A.cidrv4=($)=>A.check(nA(Gx,$)),A.cidrv6=($)=>A.check(iA(Mx,$)),A.e164=($)=>A.check(Ax(Kx,$)),A.datetime=($)=>A.check(IA($)),A.date=($)=>A.check(kA($)),A.time=($)=>A.check(bA($)),A.duration=($)=>A.check(FA($))});function jA(A){return Kc(j,A)}var Q=W("ZodStringFormat",(A,x)=>{Q$.init(A,x),$x.init(A,x)}),cx=W("ZodEmail",(A,x)=>{J$.init(A,x),Q.init(A,x)});function aW(A){return vA(cx,A)}var WA=W("ZodGUID",(A,x)=>{Y$.init(A,x),Q.init(A,x)});function nW(A){return cA(WA,A)}var M=W("ZodUUID",(A,x)=>{O$.init(A,x),Q.init(A,x)});function iW(A){return gA(M,A)}function tW(A){return yA(M,A)}function sW(A){return ZA(M,A)}function A_(A){return oA(M,A)}var YA=W("ZodURL",(A,x)=>{X$.init(A,x),Q.init(A,x)});function x_(A){return QA(YA,A)}function $_(A){return QA(YA,{protocol:/^https?$/,hostname:L.domain,...q.normalizeParams(A)})}var Wx=W("ZodEmoji",(A,x)=>{G$.init(A,x),Q.init(A,x)});function c_(A){return uA(Wx,A)}var _x=W("ZodNanoID",(A,x)=>{M$.init(A,x),Q.init(A,x)});function W_(A){return lA(_x,A)}var qx=W("ZodCUID",(A,x)=>{w$.init(A,x),Q.init(A,x)});function __(A){return fA(qx,A)}var Hx=W("ZodCUID2",(A,x)=>{z$.init(A,x),Q.init(A,x)});function q_(A){return mA(Hx,A)}var Qx=W("ZodULID",(A,x)=>{K$.init(A,x),Q.init(A,x)});function H_(A){return rA(Qx,A)}var Yx=W("ZodXID",(A,x)=>{B$.init(A,x),Q.init(A,x)});function Q_(A){return pA(Yx,A)}var Ox=W("ZodKSUID",(A,x)=>{P$.init(A,x),Q.init(A,x)});function Y_(A){return eA(Ox,A)}var Jx=W("ZodIPv4",(A,x)=>{L$.init(A,x),Q.init(A,x)});function O_(A){return dA(Jx,A)}var Xx=W("ZodIPv6",(A,x)=>{E$.init(A,x),Q.init(A,x)});function J_(A){return aA(Xx,A)}var Gx=W("ZodCIDRv4",(A,x)=>{D$.init(A,x),Q.init(A,x)});function X_(A){return nA(Gx,A)}var Mx=W("ZodCIDRv6",(A,x)=>{N$.init(A,x),Q.init(A,x)});function G_(A){return iA(Mx,A)}var wx=W("ZodBase64",(A,x)=>{S$.init(A,x),Q.init(A,x)});function M_(A){return tA(wx,A)}var zx=W("ZodBase64URL",(A,x)=>{C$.init(A,x),Q.init(A,x)});function w_(A){return sA(zx,A)}var Kx=W("ZodE164",(A,x)=>{V$.init(A,x),Q.init(A,x)});function z_(A){return Ax(Kx,A)}var Bx=W("ZodJWT",(A,x)=>{R$.init(A,x),Q.init(A,x)});function K_(A){return xx(Bx,A)}var h=W("ZodCustomStringFormat",(A,x)=>{I$.init(A,x),Q.init(A,x)});function B_(A,x,$={}){return F(h,A,x,$)}function P_(A){return F(h,"hostname",L.hostname,A)}function L_(A){return F(h,"hex",L.hex,A)}function E_(A,x){let $=x?.enc??"hex",c=`${A}_${$}`,_=L[c];if(!_)throw Error(`Unrecognized hash format: ${c}`);return F(h,c,_,x)}var U=W("ZodNumber",(A,x)=>{k$.init(A,x),H.init(A,x),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.int=(c)=>A.check(hA(c)),A.safe=(c)=>A.check(hA(c)),A.positive=(c)=>A.check(K(0,c)),A.nonnegative=(c)=>A.check(X(0,c)),A.negative=(c)=>A.check(z(0,c)),A.nonpositive=(c)=>A.check(G(0,c)),A.multipleOf=(c,_)=>A.check(D(c,_)),A.step=(c,_)=>A.check(D(c,_)),A.finite=()=>A;let $=A._zod.bag;A.minValue=Math.max($.minimum??Number.NEGATIVE_INFINITY,$.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min($.maximum??Number.POSITIVE_INFINITY,$.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=($.format??"").includes("int")||Number.isSafeInteger($.multipleOf??0.5),A.isFinite=!0,A.format=$.format??null});function fc(A){return Bc(U,A)}var C=W("ZodNumberFormat",(A,x)=>{b$.init(A,x),U.init(A,x)});function hA(A){return Pc(C,A)}function D_(A){return Lc(C,A)}function N_(A){return Ec(C,A)}function S_(A){return Dc(C,A)}function C_(A){return Nc(C,A)}var T=W("ZodBoolean",(A,x)=>{F$.init(A,x),H.init(A,x)});function mc(A){return Sc(T,A)}var v=W("ZodBigInt",(A,x)=>{j$.init(A,x),H.init(A,x),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.gt=(c,_)=>A.check(K(c,_)),A.gte=(c,_)=>A.check(X(c,_)),A.min=(c,_)=>A.check(X(c,_)),A.lt=(c,_)=>A.check(z(c,_)),A.lte=(c,_)=>A.check(G(c,_)),A.max=(c,_)=>A.check(G(c,_)),A.positive=(c)=>A.check(K(BigInt(0),c)),A.negative=(c)=>A.check(z(BigInt(0),c)),A.nonpositive=(c)=>A.check(G(BigInt(0),c)),A.nonnegative=(c)=>A.check(X(BigInt(0),c)),A.multipleOf=(c,_)=>A.check(D(c,_));let $=A._zod.bag;A.minValue=$.minimum??null,A.maxValue=$.maximum??null,A.format=$.format??null});function V_(A){return Cc(v,A)}var Px=W("ZodBigIntFormat",(A,x)=>{h$.init(A,x),v.init(A,x)});function R_(A){return Vc(Px,A)}function I_(A){return Rc(Px,A)}var rc=W("ZodSymbol",(A,x)=>{U$.init(A,x),H.init(A,x)});function k_(A){return Ic(rc,A)}var pc=W("ZodUndefined",(A,x)=>{T$.init(A,x),H.init(A,x)});function b_(A){return kc(pc,A)}var ec=W("ZodNull",(A,x)=>{v$.init(A,x),H.init(A,x)});function dc(A){return bc(ec,A)}var ac=W("ZodAny",(A,x)=>{g$.init(A,x),H.init(A,x)});function F_(){return Fc(ac)}var nc=W("ZodUnknown",(A,x)=>{y$.init(A,x),H.init(A,x)});function S(){return jc(nc)}var ic=W("ZodNever",(A,x)=>{Z$.init(A,x),H.init(A,x)});function Lx(A){return hc(ic,A)}var tc=W("ZodVoid",(A,x)=>{o$.init(A,x),H.init(A,x)});function j_(A){return Uc(tc,A)}var OA=W("ZodDate",(A,x)=>{u$.init(A,x),H.init(A,x),A.min=(c,_)=>A.check(X(c,_)),A.max=(c,_)=>A.check(G(c,_));let $=A._zod.bag;A.minDate=$.minimum?new Date($.minimum):null,A.maxDate=$.maximum?new Date($.maximum):null});function h_(A){return Tc(OA,A)}var sc=W("ZodArray",(A,x)=>{l$.init(A,x),H.init(A,x),A.element=x.element,A.min=($,c)=>A.check(B($,c)),A.nonempty=($)=>A.check(B(1,$)),A.max=($,c)=>A.check(R($,c)),A.length=($,c)=>A.check(I($,c)),A.unwrap=()=>A.element});function JA(A,x){return gc(sc,A,x)}function U_(A){let x=A._zod.def.shape;return Sx(Object.keys(x))}var XA=W("ZodObject",(A,x)=>{f$.init(A,x),H.init(A,x),q.defineLazy(A,"shape",()=>x.shape),A.keyof=()=>Sx(Object.keys(A._zod.def.shape)),A.catchall=($)=>A.clone({...A._zod.def,catchall:$}),A.passthrough=()=>A.clone({...A._zod.def,catchall:S()}),A.loose=()=>A.clone({...A._zod.def,catchall:S()}),A.strict=()=>A.clone({...A._zod.def,catchall:Lx()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=($)=>{return q.extend(A,$)},A.safeExtend=($)=>{return q.safeExtend(A,$)},A.merge=($)=>q.merge(A,$),A.pick=($)=>q.pick(A,$),A.omit=($)=>q.omit(A,$),A.partial=(...$)=>q.partial(Vx,A,$[0]),A.required=(...$)=>q.required(Rx,A,$[0])});function T_(A,x){let $={type:"object",get shape(){return q.assignProp(this,"shape",A?q.objectClone(A):{}),this.shape},...q.normalizeParams(x)};return new XA($)}function v_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:Lx(),...q.normalizeParams(x)})}function g_(A,x){return new XA({type:"object",get shape(){return q.assignProp(this,"shape",q.objectClone(A)),this.shape},catchall:S(),...q.normalizeParams(x)})}var Ex=W("ZodUnion",(A,x)=>{m$.init(A,x),H.init(A,x),A.options=x.options});function Dx(A,x){return new Ex({type:"union",options:A,...q.normalizeParams(x)})}var AW=W("ZodDiscriminatedUnion",(A,x)=>{Ex.init(A,x),r$.init(A,x)});function y_(A,x,$){return new AW({type:"union",options:x,discriminator:A,...q.normalizeParams($)})}var xW=W("ZodIntersection",(A,x)=>{p$.init(A,x),H.init(A,x)});function $W(A,x){return new xW({type:"intersection",left:A,right:x})}var cW=W("ZodTuple",(A,x)=>{e$.init(A,x),H.init(A,x),A.rest=($)=>A.clone({...A._zod.def,rest:$})});function WW(A,x,$){let c=x instanceof UA,_=c?$:x;return new cW({type:"tuple",items:A,rest:c?x:null,...q.normalizeParams(_)})}var Nx=W("ZodRecord",(A,x)=>{d$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function _W(A,x,$){return new Nx({type:"record",keyType:A,valueType:x,...q.normalizeParams($)})}function Z_(A,x,$){let c=b(A);return c._zod.values=void 0,new Nx({type:"record",keyType:c,valueType:x,...q.normalizeParams($)})}var qW=W("ZodMap",(A,x)=>{a$.init(A,x),H.init(A,x),A.keyType=x.keyType,A.valueType=x.valueType});function o_(A,x,$){return new qW({type:"map",keyType:A,valueType:x,...q.normalizeParams($)})}var HW=W("ZodSet",(A,x)=>{n$.init(A,x),H.init(A,x),A.min=(...$)=>A.check(N(...$)),A.nonempty=($)=>A.check(N(1,$)),A.max=(...$)=>A.check(V(...$)),A.size=(...$)=>A.check(Z(...$))});function u_(A,x){return new HW({type:"set",valueType:A,...q.normalizeParams(x)})}var k=W("ZodEnum",(A,x)=>{i$.init(A,x),H.init(A,x),A.enum=x.entries,A.options=Object.values(x.entries);let $=new Set(Object.keys(x.entries));A.extract=(c,_)=>{let J={};for(let Y of c)if($.has(Y))J[Y]=x.entries[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})},A.exclude=(c,_)=>{let J={...x.entries};for(let Y of c)if($.has(Y))delete J[Y];else throw Error(`Key ${Y} not found in enum`);return new k({...x,checks:[],...q.normalizeParams(_),entries:J})}});function Sx(A,x){let $=Array.isArray(A)?Object.fromEntries(A.map((c)=>[c,c])):A;return new k({type:"enum",entries:$,...q.normalizeParams(x)})}function l_(A,x){return new k({type:"enum",entries:A,...q.normalizeParams(x)})}var QW=W("ZodLiteral",(A,x)=>{t$.init(A,x),H.init(A,x),A.values=new Set(x.values),Object.defineProperty(A,"value",{get(){if(x.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return x.values[0]}})});function f_(A,x){return new QW({type:"literal",values:Array.isArray(A)?A:[A],...q.normalizeParams(x)})}var YW=W("ZodFile",(A,x)=>{s$.init(A,x),H.init(A,x),A.min=($,c)=>A.check(N($,c)),A.max=($,c)=>A.check(V($,c)),A.mime=($,c)=>A.check(p(Array.isArray($)?$:[$],c))});function m_(A){return yc(YW,A)}var OW=W("ZodTransform",(A,x)=>{Ac.init(A,x),H.init(A,x),A._zod.parse=($,c)=>{if(c.direction==="backward")throw new q$(A.constructor.name);$.addIssue=(J)=>{if(typeof J==="string")$.issues.push(q.issue(J,$.value,x));else{let Y=J;if(Y.fatal)Y.continue=!1;Y.code??(Y.code="custom"),Y.input??(Y.input=$.value),Y.inst??(Y.inst=A),$.issues.push(q.issue(Y))}};let _=x.transform($.value,$);if(_ instanceof Promise)return _.then((J)=>{return $.value=J,$});return $.value=_,$}});function Cx(A){return new OW({type:"transform",transform:A})}var Vx=W("ZodOptional",(A,x)=>{xc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function _A(A){return new Vx({type:"optional",innerType:A})}var JW=W("ZodNullable",(A,x)=>{$c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function qA(A){return new JW({type:"nullable",innerType:A})}function r_(A){return _A(qA(A))}var XW=W("ZodDefault",(A,x)=>{cc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});function GW(A,x){return new XW({type:"default",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var MW=W("ZodPrefault",(A,x)=>{Wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function wW(A,x){return new MW({type:"prefault",innerType:A,get defaultValue(){return typeof x==="function"?x():q.shallowClone(x)}})}var Rx=W("ZodNonOptional",(A,x)=>{_c.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function zW(A,x){return new Rx({type:"nonoptional",innerType:A,...q.normalizeParams(x)})}var KW=W("ZodSuccess",(A,x)=>{qc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function p_(A){return new KW({type:"success",innerType:A})}var BW=W("ZodCatch",(A,x)=>{Hc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});function PW(A,x){return new BW({type:"catch",innerType:A,catchValue:typeof x==="function"?x:()=>x})}var LW=W("ZodNaN",(A,x)=>{Qc.init(A,x),H.init(A,x)});function e_(A){return vc(LW,A)}var Ix=W("ZodPipe",(A,x)=>{Yc.init(A,x),H.init(A,x),A.in=x.in,A.out=x.out});function HA(A,x){return new Ix({type:"pipe",in:A,out:x})}var kx=W("ZodCodec",(A,x)=>{Ix.init(A,x),Oc.init(A,x)});function d_(A,x,$){return new kx({type:"pipe",in:A,out:x,transform:$.decode,reverseTransform:$.encode})}var EW=W("ZodReadonly",(A,x)=>{Jc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function DW(A){return new EW({type:"readonly",innerType:A})}var NW=W("ZodTemplateLiteral",(A,x)=>{Xc.init(A,x),H.init(A,x)});function a_(A,x){return new NW({type:"template_literal",parts:A,...q.normalizeParams(x)})}var SW=W("ZodLazy",(A,x)=>{wc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.getter()});function CW(A){return new SW({type:"lazy",getter:A})}var VW=W("ZodPromise",(A,x)=>{Mc.init(A,x),H.init(A,x),A.unwrap=()=>A._zod.def.innerType});function n_(A){return new VW({type:"promise",innerType:A})}var RW=W("ZodFunction",(A,x)=>{Gc.init(A,x),H.init(A,x)});function i_(A){return new RW({type:"function",input:Array.isArray(A?.input)?WW(A?.input):A?.input??JA(S()),output:A?.output??S()})}var GA=W("ZodCustom",(A,x)=>{zc.init(A,x),H.init(A,x)});function t_(A){let x=new H$({check:"custom"});return x._zod.check=A,x}function s_(A,x){return Zc(GA,A??(()=>!0),x)}function IW(A,x={}){return oc(GA,A,x)}function kW(A){return uc(A)}function Aq(A,x={error:`Input not instance of ${A.name}`}){let $=new GA({type:"custom",check:"custom",fn:(c)=>c instanceof A,abort:!0,...q.normalizeParams(x)});return $._zod.bag.Class=A,$}var xq=(...A)=>lc({Codec:kx,Boolean:T,String:j},...A);function $q(A){let x=CW(()=>{return Dx([jA(A),fc(),mc(),dc(),JA(x),_W(jA(),x)])});return x}function cq(A,x){return HA(Cx(A),x)}var Wq={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function _q(A){E({customError:A})}function qq(){return E().customError}var bx;(function(A){})(bx||(bx={}));var Fx={};RA(Fx,{string:()=>Hq,number:()=>Qq,date:()=>Jq,boolean:()=>Yq,bigint:()=>Oq});function Hq(A){return bW(j,A)}function Qq(A){return FW(U,A)}function Yq(A){return jW(T,A)}function Oq(A){return hW(v,A)}function Jq(A){return UW(OA,A)}E(ZW());
|
|
3
|
+
export{$A as su,BA as tu,jA as uu,x_ as vu,fc as wu,mc as xu,dc as yu,F_ as zu,S as Au,JA as Bu,T_ as Cu,g_ as Du,Dx as Eu,y_ as Fu,$W as Gu,_W as Hu,Sx as Iu,f_ as Ju,_A as Ku,s_ as Lu,cq as Mu,Wq as Nu,Fx as Ou,Xq as Pu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Wf as a,Xf as b,Yf as c,Zf as d,_f as e}from"./chunk-vzjcmwry.js";import"./chunk-6j0365q3.js";import"./chunk-7y3y3j51.js";import"./chunk-4aykrj51.js";import"./chunk-sbt7qmwm.js";import"./chunk-nfg7nt13.js";import"./chunk-ktmazmas.js";import"./chunk-qywwj58s.js";import"./chunk-va4davgy.js";import"./chunk-hg563h5r.js";import"./chunk-j1a64ade.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-ecwz9nhs.js";import"./chunk-5rkmhzq0.js";import"./chunk-7mhffm9f.js";import"./chunk-r012q335.js";import"./chunk-0z3z0gk1.js";import"./chunk-g7vkkmsk.js";import"./chunk-m8djypsy.js";import"./chunk-w7p2x973.js";import"./chunk-wmw2gne9.js";import"./chunk-y3n31nnx.js";import"./chunk-3z1y040p.js";import"./chunk-kkvb2c2z.js";import"./chunk-3tdqsm5c.js";import"./chunk-a5zjrwqy.js";import"./chunk-fhng5her.js";import"./chunk-dkv2mg97.js";import"./chunk-bf146hz2.js";import"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import"./chunk-yzdty5t9.js";import"./chunk-1p34bx7c.js";import"./chunk-q3x4x2tq.js";import"./chunk-7dckfame.js";import"./chunk-j1veq3zr.js";import"./chunk-0pvbk8ks.js";import"./chunk-tk3bve0x.js";import"./chunk-0w4v0fbs.js";import"./chunk-wf09j72q.js";import"./chunk-hbnr0j7h.js";import"./chunk-ep8zn49w.js";import"./chunk-f3kjp838.js";import"./chunk-tsn1jkr7.js";import"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-9pe4agdz.js";import"./chunk-kc3hpmr2.js";import"./chunk-hh4c02fh.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ho as j,Io as R,Jo as O,Ko as A,Qo as y,Vo as q,Wo as M,Yo as C,cp as K}from"./chunk-wmw2gne9.js";import{mt as v,pt as D}from"./chunk-zk8n8hnh.js";import{At as m,Ct as b,It as I,Tt as d}from"./chunk-1jh5p5qw.js";import{DP as T,EP as _}from"./chunk-hh4c02fh.js";import P from"path";function pt(t){let e=t&&typeof t==="object"&&"cause"in t?t.cause??t:t;if(!(e instanceof I.RunFailedError))return{error:e,detail:b(e),missing:!1};let r=e.stderr.toString().split(/\r?\n/).map((o)=>o.trim()).filter(Boolean),n=r.filter((o)=>o.startsWith("error:")).map((o)=>o.replace(/^error:\s*/,""));return{error:e,detail:n[0]??r.at(-1),missing:r.some((o)=>o.includes("No version matching"))}}var $={resolve:(t)=>q(t)},z={readText:(t)=>d.readText(t),write:async(t,e)=>{await d.write(t,e)},exists:(t)=>d.exists(t),files:(t,e)=>K(t,e)},G=z;function V(t){if(typeof t==="string")return t;if(!Array.isArray(t))return;if(typeof t[0]!=="string")return;return t[0]}function H(t){if(!t||typeof t!=="object"||Array.isArray(t))return;let e=t;if(!Array.isArray(e.plugin))return;return e.plugin}function Q(t){if(typeof t==="string"){let e=t.trim();if(e)return e;return}if(!m(t))return;for(let e of["import","default"]){let r=t[e];if(typeof r!=="string")continue;let n=r.trim();if(!n)continue;return n}}function U(t){if(!m(t))return;let e=t.config;if(!m(e))return;return e}function E(t,e){let r=t.exports;if(!m(r))return;let n=r[`./${e}`];if(!Q(n))return;return{opts:U(n)}}function X(t){let e=t.main;if(typeof e!=="string")return!1;return Boolean(e.trim())}function Y(t){let e=typeof t.json.name==="string"&&t.json.name.trim().length>0?t.json.name.trim():P.basename(t.dir),r=[],n=E(t.json,"server");if(n)r.push({kind:"server",opts:n.opts});else if(X(t.json))r.push({kind:"server"});let o=E(t.json,"tui");if(o)r.push({kind:"tui",opts:o.opts});if(!r.some((c)=>c.kind==="tui")&&C(e,t).length)r.push({kind:"tui"});return r}function g(t,e,r,n=!1){return A(t,O(t,e,r,{formattingOptions:{tabSize:2,insertSpaces:!0},isArrayInsertion:n}))}function Z(t,e,r,n,o=!1){let c=y(r).pkg,u=(e??[]).map((i,p)=>({item:i,i:p,spec:V(i)})).filter((i)=>{if(!i.spec)return!1;if(i.spec===r)return!0;if(i.spec.startsWith("file://"))return!1;return y(i.spec).pkg===c});if(!u.length){if(!e)return{mode:"add",text:g(t,["plugin"],[n])};return{mode:"add",text:g(t,["plugin",e.length],n,!0)}}if(!o)return{mode:"noop",text:t};let s=u[0];if(!s)return{mode:"noop",text:t};if(u.length===1&&s.spec===r)return{mode:"noop",text:t};let a=t;if(typeof s.item==="string")a=g(a,["plugin",s.i],n);if(Array.isArray(s.item)&&typeof s.item[0]==="string")a=g(a,["plugin",s.i,0],r);let l=u.map((i)=>i.i).filter((i)=>i!==s.i).sort((i,p)=>p-i);for(let i of l)a=g(a,["plugin",i],void 0);return{mode:"replace",text:a}}async function gt(t,e=$){let r=await e.resolve(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"install_failed",error:r.error};return{ok:!0,target:r.item}}async function dt(t){let e=await M(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!e.ok)return{ok:!1,code:"manifest_read_failed",file:t,error:e.error};let r=await Promise.resolve().then(()=>Y(e.item)).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"manifest_read_failed",file:e.item.pkg,error:r.error};if(!r.item.length)return{ok:!1,code:"manifest_no_targets",file:e.item.pkg};return{ok:!0,targets:r.item}}function tt(t){if(t.global)return t.config??D.Path.config;let r=t.vcs==="git"&&t.worktree!=="/"?t.worktree:t.directory;return P.join(r,".qitqode")}function et(t){if(t==="server")return"qitqode";return"tui"}async function rt(t,e,r,n,o){let x=[];try{let c=et(e.kind);const S=T(x,await v.acquire(`plug-config:${d.resolve(P.join(t,c))}`),1);let u=o.files(t,c);let s=u[0];for(let f of u){if(!await o.exists(f))continue;s=f;break}let a=await o.readText(s).catch((f)=>{if(f.code==="ENOENT")return"{}";return f});if(a instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:a};let l=a.trim()?a:"{}";let i=[];let p=j(l,i,{allowTrailingComma:!0});if(i.length){let f=i[0],h=l.substring(0,f.offset).split(`
|
|
3
3
|
`);return{ok:!1,code:"invalid_json",kind:e.kind,file:s,line:h.length,col:h[h.length-1].length+1,parse:R(f.error)}}let N=H(p);let F=e.opts?[r,e.opts]:r;let k=Z(l,N,r,F,n);if(k.mode==="noop")return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}};let w=await o.write(s,k.text).catch((f)=>f);if(w instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:w};return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}}}catch(J){var B=J,L=1}finally{var W=_(x,B,L);W&&await W}}async function mt(t,e=G){let r=tt(t),n=[];for(let o of t.targets){let c=await rt(r,o,t.spec,Boolean(t.force),e);if(!c.ok)return{...c,dir:r};n.push(c.item)}return{ok:!0,dir:r,items:n}}
|
|
4
|
-
export{pt as
|
|
4
|
+
export{pt as o,z as p,gt as q,dt as r,mt as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rt as a,st as b,tt as c,ut as d,vt as e,wt as f,xt as g,yt as h}from"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-hh4c02fh.js";export{g as redactValue,e as init,f as flush,d as file,b as enabled,h as create,a as Level,c as Default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Gg as r}from"./chunk-ktmazmas.js";import{CP as o}from"./chunk-hh4c02fh.js";var c=new r("zod v4");async function m(){return async(n,e)=>{let t;if("_zod"in n)try{t=(await import("./chunk-w1atxyz0.js")).toJSONSchema}catch{throw c}else try{t=(await import("./chunk-edvcz2gd.js")).zodToJsonSchema}catch{throw new r("zod-to-json-schema")}return t(n,e)}}export{m as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{WB as
|
|
2
|
+
import{se as u}from"./chunk-0ae5q6ck.js";import{ye as m,ze as S}from"./chunk-3nhqd8wg.js";import{Ae as C}from"./chunk-fkvccmgk.js";import{uf as h}from"./chunk-jbd9k041.js";import{zP as R}from"./chunk-hh4c02fh.js";var WB=R((s)=>{var H=C(),K=m(),V=h(),v=S(),q=u(),b=(B)=>H.HttpResponse.isInstance(B)?B.headers?.date??B.headers?.Date:void 0,I=(B)=>new Date(Date.now()+B),P=(B,J)=>Math.abs(I(J).getTime()-B)>=300000,A=(B,J)=>{let Q=Date.parse(B);if(P(Q,J))return Q-Date.now();return J},M=(B,J)=>{if(!J)throw Error(`Property \`${B}\` is not resolved for AWS SDK SigV4Auth`);return J},w=async(B)=>{let J=M("context",B.context),Q=M("config",B.config),L=J.endpointV2?.properties?.authSchemes?.[0],z=await M("signer",Q.signer)(L),j=B?.signingRegion,Z=B?.signingRegionSet,Y=B?.signingName;return{config:Q,signer:z,signingRegion:j,signingRegionSet:Z,signingName:Y}};class D{async sign(B,J,Q){if(!H.HttpRequest.isInstance(B))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let L=await w(Q),{config:$,signer:z}=L,{signingRegion:j,signingName:Z}=L,Y=Q.context;if(Y?.authSchemes?.length??!1){let[G,X]=Y.authSchemes;if(G?.name==="sigv4a"&&X?.name==="sigv4")j=X?.signingRegion??j,Z=X?.signingName??Z}return await z.sign(B,{signingDate:I($.systemClockOffset),signingRegion:j,signingService:Z})}errorHandler(B){return(J)=>{let Q=J.ServerTime??b(J.$response);if(Q){let L=M("config",B.config),$=L.systemClockOffset;if(L.systemClockOffset=A(Q,L.systemClockOffset),L.systemClockOffset!==$&&J.$metadata)J.$metadata.clockSkewCorrected=!0}throw J}}successHandler(B,J){let Q=b(B);if(Q){let L=M("config",J.config);L.systemClockOffset=A(Q,L.systemClockOffset)}}}var p=D;class _ extends D{async sign(B,J,Q){if(!H.HttpRequest.isInstance(B))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:L,signer:$,signingRegion:z,signingRegionSet:j,signingName:Z}=await w(Q),W=(await L.sigv4aSigningRegionSet?.()??j??[z]).join(",");return await $.sign(B,{signingDate:I(L.systemClockOffset),signingRegion:W,signingService:Z})}}var T=(B)=>typeof B==="string"&&B.length>0?B.split(",").map((J)=>J.trim()):[],O=(B)=>`AWS_BEARER_TOKEN_${B.replace(/[\s-]/g,"_").toUpperCase()}`,N="AWS_AUTH_SCHEME_PREFERENCE",y="auth_scheme_preference",l={environmentVariableSelector:(B,J)=>{if(J?.signingName){if(O(J.signingName)in B)return["httpBearerAuth"]}if(!(N in B))return;return T(B[N])},configFileSelector:(B)=>{if(!(y in B))return;return T(B[y])},default:[]},a=(B)=>{return B.sigv4aSigningRegionSet=K.normalizeProvider(B.sigv4aSigningRegionSet),B},d={environmentVariableSelector(B){if(B.AWS_SIGV4A_SIGNING_REGION_SET)return B.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((J)=>J.trim());throw new V.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(B){if(B.sigv4a_signing_region_set)return(B.sigv4a_signing_region_set??"").split(",").map((J)=>J.trim());throw new V.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},E=(B)=>{let J=B.credentials,Q=!!B.credentials,L=void 0;Object.defineProperty(B,"credentials",{set(W){if(W&&W!==J&&W!==L)Q=!0;J=W;let G=c(B,{credentials:J,credentialDefaultProvider:B.credentialDefaultProvider}),X=t(B,G);if(Q&&!X.attributed){let F=typeof J==="object"&&J!==null;L=async(U)=>{let x=await X(U);if(F&&(!x.$source||Object.keys(x.$source).length===0))return v.setCredentialFeature(x,"CREDENTIALS_CODE","e");return x},L.memoized=X.memoized,L.configBound=X.configBound,L.attributed=!0}else L=X},get(){return L},enumerable:!0,configurable:!0}),B.credentials=J;let{signingEscapePath:$=!0,systemClockOffset:z=B.systemClockOffset||0,sha256:j}=B,Z;if(B.signer)Z=K.normalizeProvider(B.signer);else if(B.regionInfoProvider)Z=()=>K.normalizeProvider(B.region)().then(async(W)=>[await B.regionInfoProvider(W,{useFipsEndpoint:await B.useFipsEndpoint(),useDualstackEndpoint:await B.useDualstackEndpoint()})||{},W]).then(([W,G])=>{let{signingRegion:X,signingService:F}=W;B.signingRegion=B.signingRegion||X||G,B.signingName=B.signingName||F||B.serviceId;let U={...B,credentials:B.credentials,region:B.signingRegion,service:B.signingName,sha256:j,uriEscapePath:$};return new(B.signerConstructor||q.SignatureV4)(U)});else Z=async(W)=>{W=Object.assign({},{name:"sigv4",signingName:B.signingName||B.defaultSigningName,signingRegion:await K.normalizeProvider(B.region)(),properties:{}},W);let{signingRegion:G,signingName:X}=W;B.signingRegion=B.signingRegion||G,B.signingName=B.signingName||X||B.serviceId;let F={...B,credentials:B.credentials,region:B.signingRegion,service:B.signingName,sha256:j,uriEscapePath:$};return new(B.signerConstructor||q.SignatureV4)(F)};return Object.assign(B,{systemClockOffset:z,signingEscapePath:$,signer:Z})},f=E;function c(B,{credentials:J,credentialDefaultProvider:Q}){let L;if(J)if(!J?.memoized)L=K.memoizeIdentityProvider(J,K.isIdentityExpired,K.doesIdentityRequireRefresh);else L=J;else if(Q)L=K.normalizeProvider(Q(Object.assign({},B,{parentClientConfig:B})));else L=async()=>{throw Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return L.memoized=!0,L}function t(B,J){if(J.configBound)return J;let Q=async(L)=>J({...L,callerClientConfig:B});return Q.memoized=J.memoized,Q.configBound=!0,Q}s.AWSSDKSigV4Signer=p;s.AwsSdkSigV4ASigner=_;s.AwsSdkSigV4Signer=D;s.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS=l;s.NODE_SIGV4A_CONFIG_OPTIONS=d;s.getBearerTokenEnvKey=O;s.resolveAWSSDKSigV4Config=f;s.resolveAwsSdkSigV4AConfig=a;s.resolveAwsSdkSigV4Config=E;s.validateSigningProperties=w});
|
|
3
|
+
export{WB as re};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{CP as o}from"./chunk-hh4c02fh.js";var i=(t)=>`standard-openapi: ${t}`,s=new Map,r=async(t)=>{let e=s.get(t);if(e)return e;let a;switch(t){case"valibot":a=(await import("./chunk-ms1fd6h4.js")).default();break;case"zod":a=(await import("./chunk-0kbxnazj.js")).default();break;default:a=(await import("./chunk-vhktpm0n.js")).default()}return s.set(t,a),a},d=async(t,e={})=>{let a=await r(t["~standard"].vendor),{components:n={},options:c}=e;return{schema:await a(t,{components:n,options:c}),components:Object.keys(n).length>0?n:void 0}};
|
|
3
|
+
export{i as Eg,d as Fg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{je as a,ke as b,le as c,me as d,ne as e,oe as f,pe as g}from"./chunk-vf1r5ckp.js";import"./chunk-3nhqd8wg.js";import"./chunk-fkvccmgk.js";import"./chunk-jbd9k041.js";import"./chunk-hh4c02fh.js";export{g as fromEnv,c as ENV_SESSION,b as ENV_SECRET,a as ENV_KEY,d as ENV_EXPIRATION,e as ENV_CREDENTIAL_SCOPE,f as ENV_ACCOUNT_ID};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{gf as j}from"./chunk-gc9q0x8z.js";import{yf as w,zf as D}from"./chunk-3tkp27x7.js";import{Hq as Z,Oq as $,nq as Q}from"./chunk-bf146hz2.js";import{_q as P}from"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import{yP as G}from"./chunk-hh4c02fh.js";var y=G(j(),1);var K=null,Y=null;function E(f){if(!K||f!==Y)K=new y.GoogleAuth({scopes:["https://www.googleapis.com/auth/cloud-platform"],...f}),Y=f;return K}async function N(f){let q=await(await E(f||{}).getClient()).getAccessToken();return(q==null?void 0:q.token)||null}var b={bash_20241022:D.bash_20241022,bash_20250124:D.bash_20250124,textEditor_20241022:D.textEditor_20241022,textEditor_20250124:D.textEditor_20250124,textEditor_20250429:D.textEditor_20250429,textEditor_20250728:D.textEditor_20250728,computer_20241022:D.computer_20241022,webSearch_20250305:D.webSearch_20250305,toolSearchRegex_20251119:D.toolSearchRegex_20251119,toolSearchBm25_20251119:D.toolSearchBm25_20251119};function V(f={}){let W=()=>{var z;let F=Q({settingValue:f.location,environmentVariableName:"GOOGLE_VERTEX_LOCATION"}),J=Q({settingValue:f.project,environmentVariableName:"GOOGLE_VERTEX_PROJECT"});return(z=$(f.baseURL))!=null?z:`https://${F==="global"?"":F+"-"}aiplatform.googleapis.com/v1/projects/${J}/locations/${F}/publishers/anthropic/models`},H=(z)=>{var F;return new w(z,{provider:"vertex.anthropic.messages",baseURL:W(),headers:(F=f.headers)!=null?F:{},fetch:f.fetch,buildRequestUrl:(J,X)=>`${J}/${z}:${X?"streamRawPredict":"rawPredict"}`,transformRequestBody:(J)=>{let{model:X,...B}=J;return{...B,anthropic_version:"vertex-2023-10-16"}},supportedUrls:()=>({}),supportsNativeStructuredOutput:!1,supportsStrictTools:!1})},q=function(z){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return H(z)};return q.specificationVersion="v3",q.languageModel=H,q.chat=H,q.messages=H,q.embeddingModel=(z)=>{throw new P({modelId:z,modelType:"embeddingModel"})},q.textEmbeddingModel=q.embeddingModel,q.imageModel=(z)=>{throw new P({modelId:z,modelType:"imageModel"})},q.tools=b,q}function C(f={}){return V({...f,headers:async()=>({Authorization:`Bearer ${await N(f.googleAuthOptions)}`,...await Z(f.headers)})})}var L=C();export{L as vertexAnthropic,C as createVertexAnthropic};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hf as a,if as b,jf as c,kf as d,lf as e,mf as f}from"./chunk-y2jmtfdh.js";import"./chunk-bf146hz2.js";import"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-hh4c02fh.js";export{f as createOpenAICompatible,e as VERSION,d as OpenAICompatibleImageModel,c as OpenAICompatibleEmbeddingModel,b as OpenAICompatibleCompletionLanguageModel,a as OpenAICompatibleChatLanguageModel};
|