@qitqode/qitqode-android-arm64 0.2.10 → 0.2.13
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-x308f9j4.js → chunk-00krzh3y.js} +2 -2
- package/bundle/{chunk-q0xgxygw.js → chunk-04x4b2yy.js} +1 -1
- package/bundle/{chunk-1q10jyka.js → chunk-08mgb5tt.js} +2 -2
- package/bundle/{chunk-yexzxx6f.js → chunk-094m66q5.js} +1 -1
- package/bundle/{chunk-c3ey896z.js → chunk-0cjp9088.js} +1 -1
- package/bundle/{chunk-7a3txs9f.js → chunk-0mdmqtfr.js} +2 -2
- package/bundle/chunk-0nves64y.js +2 -0
- package/bundle/chunk-0v7knkt5.js +2 -0
- package/bundle/{chunk-wbt31xap.js → chunk-0w77vhg4.js} +2 -2
- package/bundle/{chunk-dnjyepb2.js → chunk-0ware2sh.js} +2 -2
- package/bundle/{chunk-djfrkbd5.js → chunk-0xf12tf3.js} +1 -1
- package/bundle/{chunk-qbewhcsz.js → chunk-139qfnsq.js} +1 -1
- package/bundle/{chunk-xgf4k9q7.js → chunk-1851skhm.js} +1 -1
- package/bundle/{chunk-f17se3hh.js → chunk-1bbx1da7.js} +1 -1
- package/bundle/{chunk-vk35g121.js → chunk-1bhcg889.js} +2 -2
- package/bundle/{chunk-xnxw5zz9.js → chunk-1exjy880.js} +2 -2
- package/bundle/{chunk-atacnspd.js → chunk-1f9qcrn6.js} +2 -2
- package/bundle/{chunk-5fcyb122.js → chunk-1gt6ppza.js} +1 -1
- package/bundle/chunk-1h5jdsgx.js +2 -0
- package/bundle/{chunk-brk1jca3.js → chunk-1q5h95hc.js} +1 -1
- package/bundle/chunk-1r5e1jsb.js +2 -0
- package/bundle/{chunk-vy93mn7d.js → chunk-1rafe6f5.js} +2 -2
- package/bundle/{chunk-62y6zk9x.js → chunk-1rw4srd1.js} +1 -1
- package/bundle/{chunk-h2p984qb.js → chunk-1sejtx9a.js} +2 -2
- package/bundle/{chunk-3zzrdpsx.js → chunk-1wy8wmah.js} +1 -1
- package/bundle/chunk-1wyy3c48.js +2 -0
- package/bundle/chunk-1z299xq6.js +2 -0
- package/bundle/chunk-21aqt31s.js +2 -0
- package/bundle/chunk-22aq9ymg.js +2 -0
- package/bundle/chunk-26a17c9z.js +2 -0
- package/bundle/chunk-2a154mr0.js +2 -0
- package/bundle/{chunk-acsqvgdw.js → chunk-2b80n6nx.js} +1 -1
- package/bundle/{chunk-nnkfdhh9.js → chunk-2bfq0mtx.js} +1 -1
- package/bundle/{chunk-wecs14rz.js → chunk-2d0vympj.js} +1 -1
- package/bundle/{chunk-dz3kcsb6.js → chunk-2h8b0csf.js} +2 -2
- package/bundle/{chunk-xqwk2zsx.js → chunk-2md5fz4f.js} +2 -2
- package/bundle/chunk-2nbce486.js +2 -0
- package/bundle/chunk-2npxatq9.js +2 -0
- package/bundle/{chunk-gx4v8z64.js → chunk-2p1qaqv3.js} +2 -2
- package/bundle/{chunk-ge7csm6m.js → chunk-2ts2s8b4.js} +2 -2
- package/bundle/{chunk-d1xfv4d3.js → chunk-374js0y6.js} +1 -1
- package/bundle/{chunk-g52wmt1v.js → chunk-3be70hxy.js} +1 -1
- package/bundle/{chunk-c8yc8qcd.js → chunk-3fx3eghq.js} +1 -1
- package/bundle/chunk-3gryj9r9.js +2 -0
- package/bundle/chunk-3jnanbjr.js +2 -0
- package/bundle/chunk-3meh1cbc.js +2 -0
- package/bundle/{chunk-t2r51r6v.js → chunk-3rcfy8te.js} +1 -1
- package/bundle/chunk-3t71xfr6.js +2 -0
- package/bundle/chunk-4045jzv5.js +2 -0
- package/bundle/{chunk-qdh2dm62.js → chunk-404ew3d3.js} +1 -1
- package/bundle/{chunk-ecz4h0a2.js → chunk-45dtsre6.js} +1 -1
- package/bundle/{chunk-v03xq38e.js → chunk-47pxz6cb.js} +2 -2
- package/bundle/{chunk-v8bxj01h.js → chunk-4ar8hey8.js} +1 -1
- package/bundle/chunk-4b2vv484.js +2 -0
- package/bundle/{chunk-9tz18e54.js → chunk-4d9s7cgr.js} +1 -1
- package/bundle/chunk-4ene1ymj.js +2 -0
- package/bundle/{chunk-yydqavgh.js → chunk-4enhsmq1.js} +2 -2
- package/bundle/{chunk-dm447tgc.js → chunk-4krmja97.js} +2 -2
- package/bundle/{chunk-pwsajn96.js → chunk-4q14whpc.js} +1 -1
- package/bundle/{chunk-z023h7t8.js → chunk-4s9d2zte.js} +1 -1
- package/bundle/{chunk-9zy5tsry.js → chunk-4wzv2v36.js} +3 -3
- package/bundle/{chunk-4sa9t0vx.js → chunk-53n3tfwn.js} +2 -2
- package/bundle/{chunk-3sj0jv91.js → chunk-5828bcp8.js} +1 -1
- package/bundle/chunk-58r5etg8.js +2 -0
- package/bundle/{chunk-waa781eh.js → chunk-5a4zt1b7.js} +1 -1
- package/bundle/chunk-5c2zw4h0.js +2 -0
- package/bundle/chunk-5e0vejcb.js +8 -0
- package/bundle/{chunk-nq4x6792.js → chunk-5es19n1m.js} +2 -2
- package/bundle/{chunk-32xd626h.js → chunk-5fbzvy6q.js} +2 -2
- package/bundle/{chunk-e1x1mp9m.js → chunk-5gv6r7v8.js} +1 -1
- package/bundle/{chunk-v8rqgt7h.js → chunk-5psekq9f.js} +1 -1
- package/bundle/{chunk-te91d271.js → chunk-5rtsnnjk.js} +1 -1
- package/bundle/{chunk-p6jf1fyt.js → chunk-5wjwzbk8.js} +1 -1
- package/bundle/chunk-608f83n0.js +2 -0
- package/bundle/{chunk-asxmkyz2.js → chunk-610mqqqa.js} +1 -1
- package/bundle/chunk-671r50ry.js +2 -0
- package/bundle/chunk-6bfnhr3d.js +2 -0
- package/bundle/chunk-6cv6d8rw.js +2 -0
- package/bundle/{chunk-psqtptrs.js → chunk-6dmk2eyt.js} +1 -1
- package/bundle/{chunk-7s0nq2aa.js → chunk-6g3bzap8.js} +2 -2
- package/bundle/{chunk-ccdjzn2m.js → chunk-6jb4mnvq.js} +3 -3
- package/bundle/{chunk-m01h6kk1.js → chunk-6kpk6pr3.js} +1 -1
- package/bundle/{chunk-gbkz04ke.js → chunk-6p848y99.js} +1 -1
- package/bundle/chunk-6qm6f88j.js +2 -0
- package/bundle/{chunk-wh2qqhep.js → chunk-6wt8g6mc.js} +2 -2
- package/bundle/{chunk-mn0pshpv.js → chunk-71naz1qp.js} +1 -1
- package/bundle/{chunk-by1kwg4r.js → chunk-72qx43fq.js} +2 -2
- package/bundle/chunk-78bfwwmc.js +2 -0
- package/bundle/{chunk-0sfc21qe.js → chunk-78rfz0ex.js} +2 -2
- package/bundle/{chunk-1r81q7m3.js → chunk-7bvh48s2.js} +1 -1
- package/bundle/{chunk-mmqyter3.js → chunk-7h0regqs.js} +1 -1
- package/bundle/{chunk-d0dsgxk4.js → chunk-7k1q26yn.js} +2 -2
- package/bundle/{chunk-kec1xw1n.js → chunk-7nh8vjx4.js} +1 -1
- package/bundle/{chunk-5w7ebtcd.js → chunk-7p8f8xav.js} +1 -1
- package/bundle/chunk-7wwtgxxf.js +2 -0
- package/bundle/{chunk-gksbv613.js → chunk-81mwbcy3.js} +2 -2
- package/bundle/{chunk-fvv1cret.js → chunk-821zkh5v.js} +1 -1
- package/bundle/{chunk-pf2vq6t1.js → chunk-84712kbe.js} +2 -2
- package/bundle/{chunk-eabbrt1p.js → chunk-8hrt4d0v.js} +1 -1
- package/bundle/{chunk-gmq1kwn0.js → chunk-8psfgg8y.js} +1 -1
- package/bundle/{chunk-at4dge22.js → chunk-8rbbt1s8.js} +1 -1
- package/bundle/{chunk-cdenq7jb.js → chunk-8t17w67q.js} +1 -1
- package/bundle/{chunk-9fjcgdea.js → chunk-8xbd0ra5.js} +1 -1
- package/bundle/{chunk-nh4zk07t.js → chunk-95ga21eq.js} +1 -1
- package/bundle/{chunk-e10c0crf.js → chunk-962hspr0.js} +1 -1
- package/bundle/chunk-98sb49dz.js +2 -0
- package/bundle/{chunk-9d0exvey.js → chunk-9a9qcvtz.js} +2 -2
- package/bundle/{chunk-x0hhw46n.js → chunk-9c0f79mt.js} +1 -1
- package/bundle/{chunk-kcqeh1e5.js → chunk-9h2fms7x.js} +1 -1
- package/bundle/chunk-9kbtpq9m.js +2 -0
- package/bundle/{chunk-eqpep2m2.js → chunk-9r6wk75s.js} +1 -1
- package/bundle/chunk-9szp9b4m.js +2 -0
- package/bundle/{chunk-tg1f56s3.js → chunk-9xbc558j.js} +1 -1
- package/bundle/chunk-9xqszq0c.js +2 -0
- package/bundle/chunk-a32kjs9e.js +2 -0
- package/bundle/{chunk-c8080519.js → chunk-a4242cn4.js} +1 -1
- package/bundle/{chunk-c8k32724.js → chunk-ajyfms68.js} +1 -1
- package/bundle/{chunk-8peby2d1.js → chunk-ajykvcas.js} +1 -1
- package/bundle/{chunk-tm79yrf3.js → chunk-anm5g0m4.js} +2 -2
- package/bundle/chunk-apym02ct.js +2 -0
- package/bundle/{chunk-dx7rexx3.js → chunk-aq75kv5f.js} +3 -3
- package/bundle/chunk-armv2rv5.js +2 -0
- package/bundle/chunk-as215v64.js +2 -0
- package/bundle/{chunk-rk21wv4k.js → chunk-b274mb6v.js} +1 -1
- package/bundle/{chunk-zfqgh9h7.js → chunk-b46t2315.js} +1 -1
- package/bundle/{chunk-yzd6cyep.js → chunk-ba2hn77m.js} +1 -1
- package/bundle/{chunk-pyf649pz.js → chunk-bd4krah7.js} +1 -1
- package/bundle/chunk-bnmpgpyf.js +2 -0
- package/bundle/{chunk-5nm5egq0.js → chunk-bpv378bm.js} +2 -2
- package/bundle/chunk-bq3zt1x1.js +2 -0
- package/bundle/chunk-bx8fgjam.js +2 -0
- package/bundle/{chunk-fsndgr9a.js → chunk-bydaqb08.js} +1 -1
- package/bundle/{chunk-819qr675.js → chunk-c1srcpfk.js} +1 -1
- package/bundle/{chunk-9bbwxp5d.js → chunk-c99npyz9.js} +1 -1
- package/bundle/chunk-ckcnb59t.js +2 -0
- package/bundle/{chunk-qdbx1qkr.js → chunk-csbndz33.js} +1 -1
- package/bundle/{chunk-c1c8ch3g.js → chunk-cv3xdp8q.js} +8 -8
- package/bundle/{chunk-xvvt886p.js → chunk-d2049chz.js} +2 -2
- package/bundle/{chunk-je8fcsa9.js → chunk-d4ys15w3.js} +1 -1
- package/bundle/chunk-d79xaj6s.js +3 -0
- package/bundle/chunk-dah2d37s.js +2 -0
- package/bundle/chunk-dhgjv1n2.js +2 -0
- package/bundle/chunk-dk9k8ff5.js +2 -0
- package/bundle/{chunk-b9f78x5g.js → chunk-dmgdwvn1.js} +1 -1
- package/bundle/{chunk-azss4acq.js → chunk-dpm5x19e.js} +2 -2
- package/bundle/{chunk-rpdgn9z3.js → chunk-dwjv3m5s.js} +2 -2
- package/bundle/chunk-dymysn4h.js +2 -0
- package/bundle/{chunk-7rbg6mg9.js → chunk-dzy3ezht.js} +2 -2
- package/bundle/{chunk-8rkszwxq.js → chunk-e0w082wt.js} +4 -4
- package/bundle/{chunk-0mwzxqt5.js → chunk-e4658j15.js} +3 -3
- package/bundle/{chunk-pbanj1gk.js → chunk-e6s8ep9m.js} +2 -2
- package/bundle/{chunk-dp6ms01y.js → chunk-ec1bwa7f.js} +2 -2
- package/bundle/{chunk-ff8q10gk.js → chunk-eefzbdbk.js} +2 -2
- package/bundle/{chunk-j5z95b6f.js → chunk-eftk07r3.js} +1 -1
- package/bundle/{chunk-qjw2zcq5.js → chunk-eh73j82b.js} +1 -1
- package/bundle/{chunk-h91zmzs5.js → chunk-es6vbsjg.js} +1 -1
- package/bundle/{chunk-k10rtgsk.js → chunk-etvwxwn3.js} +1 -1
- package/bundle/chunk-ev4gw5k6.js +2 -0
- package/bundle/chunk-ew2dxm43.js +2 -0
- package/bundle/{chunk-nk5vrenn.js → chunk-ewde5bss.js} +2 -2
- package/bundle/{chunk-8gpjmj42.js → chunk-fbd971t7.js} +3 -3
- package/bundle/{chunk-gbnf7zf9.js → chunk-ff031crt.js} +1 -1
- package/bundle/chunk-ffp4wg27.js +2 -0
- package/bundle/{chunk-6y58jzak.js → chunk-fj87htwn.js} +1 -1
- package/bundle/{chunk-rxnd79h7.js → chunk-fmvmp278.js} +1 -1
- package/bundle/{chunk-6mnk5sg3.js → chunk-fqzfytjk.js} +1 -1
- package/bundle/{chunk-c2ns2csn.js → chunk-g0x6q2ks.js} +1 -1
- package/bundle/{chunk-mp1x10t5.js → chunk-g3y5kvg6.js} +2 -2
- package/bundle/{chunk-3vae1s42.js → chunk-g6ffx794.js} +1 -1
- package/bundle/{chunk-d1fv2c7s.js → chunk-gcpwm7b5.js} +2 -2
- package/bundle/{chunk-pxm0x3e0.js → chunk-gdawpkxs.js} +2 -2
- package/bundle/{chunk-jbcqhw3x.js → chunk-gjmxrz0v.js} +2 -2
- package/bundle/{chunk-vbb1jg02.js → chunk-gtmtvjwc.js} +1 -1
- package/bundle/{chunk-7hdb1fhq.js → chunk-gvc1mqrs.js} +2 -2
- package/bundle/{chunk-56yp5v0w.js → chunk-gw2fz5ry.js} +1 -1
- package/bundle/{chunk-g08qj9z3.js → chunk-h1p3xcfp.js} +2 -2
- package/bundle/{chunk-c9cngded.js → chunk-h2vtypa5.js} +1 -1
- package/bundle/{chunk-m4j6t713.js → chunk-h9tcpbr7.js} +1 -1
- package/bundle/{chunk-2fbkw84y.js → chunk-hcd0k14e.js} +2 -2
- package/bundle/{chunk-s05hqtx1.js → chunk-hd6sd912.js} +1 -1
- package/bundle/{chunk-6wjdhvdf.js → chunk-hgcnzsd5.js} +1 -1
- package/bundle/chunk-hjy90gt2.js +2 -0
- package/bundle/{chunk-2zjet9tx.js → chunk-hk8m8vax.js} +2 -2
- package/bundle/chunk-hmden934.js +2 -0
- package/bundle/{chunk-0tkznq75.js → chunk-hnbtfpb7.js} +1 -1
- package/bundle/{chunk-ngyv4fhn.js → chunk-hp9q7vvq.js} +2 -2
- package/bundle/{chunk-kc8n5cgb.js → chunk-hrfdrz36.js} +1 -1
- package/bundle/chunk-hsm8fbb1.js +2 -0
- package/bundle/{chunk-yce8ph5b.js → chunk-hsmtjb4d.js} +2 -2
- package/bundle/chunk-hz1xfedb.js +2 -0
- package/bundle/{chunk-qq9yc2tp.js → chunk-hzzvmr41.js} +2 -2
- package/bundle/chunk-ja9y478k.js +2 -0
- package/bundle/chunk-jam7xyjf.js +2 -0
- package/bundle/{chunk-4a9jqe5s.js → chunk-jcn8bg31.js} +1 -1
- package/bundle/{chunk-2dmcpqak.js → chunk-jf4zyy7r.js} +1 -1
- package/bundle/{chunk-yspstxkq.js → chunk-jmrqp50k.js} +1 -1
- package/bundle/{chunk-qm9fm5ja.js → chunk-jrh028na.js} +2 -2
- package/bundle/{chunk-r81w6skn.js → chunk-jt94rhev.js} +1 -1
- package/bundle/{chunk-cs825mxr.js → chunk-k3x6z5q1.js} +1 -1
- package/bundle/chunk-k51qphrk.js +2 -0
- package/bundle/chunk-kee7xpe3.js +2 -0
- package/bundle/{chunk-61t4g8bh.js → chunk-m18pxkdg.js} +4 -4
- package/bundle/{chunk-npdgfqaw.js → chunk-map852em.js} +1 -1
- package/bundle/{chunk-wd2xmkdp.js → chunk-mbma071k.js} +2 -2
- package/bundle/{chunk-qyan69nb.js → chunk-mchf2bcc.js} +2 -2
- package/bundle/{chunk-x50adh71.js → chunk-mfg4stzn.js} +1 -1
- package/bundle/{chunk-snf6ahg7.js → chunk-mgff8bcx.js} +1 -1
- package/bundle/{chunk-81dvy370.js → chunk-mhn0a828.js} +1 -1
- package/bundle/{chunk-yh1t6jrj.js → chunk-mp5m0acf.js} +1 -1
- package/bundle/{chunk-1m78yy4k.js → chunk-mqtj38j9.js} +1 -1
- package/bundle/{chunk-cxtwavyf.js → chunk-mrh5q4s6.js} +2 -2
- package/bundle/{chunk-xcmbxny8.js → chunk-msbe5rb7.js} +1 -1
- package/bundle/{chunk-b8rzn48q.js → chunk-n73ckwr7.js} +1 -1
- package/bundle/{chunk-gqgjybjc.js → chunk-nn2hbew8.js} +1 -1
- package/bundle/{chunk-9nf5650d.js → chunk-npryn3en.js} +1 -1
- package/bundle/chunk-p13eeqe4.js +2 -0
- package/bundle/{chunk-a70m6kyn.js → chunk-p3tcw42f.js} +1 -1
- package/bundle/chunk-p45f2nyb.js +2 -0
- package/bundle/{chunk-q26s0wb5.js → chunk-p863r97y.js} +1 -1
- package/bundle/{chunk-tjfer79w.js → chunk-paqy0c2v.js} +1 -1
- package/bundle/{chunk-vsfj16v9.js → chunk-pfen4ekj.js} +2 -2
- package/bundle/{chunk-5p2r8bxx.js → chunk-pzn7cade.js} +1 -1
- package/bundle/{chunk-jt6bvxtr.js → chunk-q65qzc9w.js} +1 -1
- package/bundle/{chunk-h0pvxre5.js → chunk-q7wc3frq.js} +1 -1
- package/bundle/{chunk-141p12c4.js → chunk-qa38xchd.js} +1 -1
- package/bundle/{chunk-f0ab2f28.js → chunk-qqftaqza.js} +1 -1
- package/bundle/{chunk-d9w2bn2e.js → chunk-qvwx32p9.js} +2 -2
- package/bundle/chunk-qw9whsy2.js +2 -0
- package/bundle/{chunk-8nnajdwf.js → chunk-r65zw08x.js} +3 -3
- package/bundle/chunk-r77kpzdv.js +2 -0
- package/bundle/{chunk-e3mrw0k7.js → chunk-r9hsd9pw.js} +1 -1
- package/bundle/chunk-rc95tp19.js +2 -0
- package/bundle/{chunk-xv03hbgj.js → chunk-rf9pjbg3.js} +1 -1
- package/bundle/chunk-rmh2fhqy.js +2 -0
- package/bundle/{chunk-t9pq363q.js → chunk-rqdfmbns.js} +2 -2
- package/bundle/{chunk-ev6jwt7q.js → chunk-rr94dpe9.js} +1 -1
- package/bundle/chunk-rrn86a8w.js +2 -0
- package/bundle/{chunk-kk850sdw.js → chunk-rwt0rwvn.js} +2 -2
- package/bundle/{chunk-f6btedtt.js → chunk-s7ypkpg2.js} +1 -1
- package/bundle/{chunk-hgm8yfcb.js → chunk-s81ck6bw.js} +1 -1
- package/bundle/chunk-s8v0h63x.js +2 -0
- package/bundle/chunk-sh4mngre.js +2 -0
- package/bundle/chunk-shqqngm8.js +2 -0
- package/bundle/chunk-sjfcwykr.js +2 -0
- package/bundle/{chunk-q7s6z0nz.js → chunk-sn15skh8.js} +1 -1
- package/bundle/chunk-sv01v0n0.js +2 -0
- package/bundle/{chunk-dzma8zvf.js → chunk-sv27ep93.js} +2 -2
- package/bundle/{chunk-q8fjktv4.js → chunk-t1e52h0k.js} +1 -1
- package/bundle/{chunk-zskdxbbh.js → chunk-t1hw67x4.js} +1 -1
- package/bundle/{chunk-9pj10pgd.js → chunk-t4kma6mq.js} +2 -2
- package/bundle/{chunk-8v60bqm0.js → chunk-t66gerft.js} +1 -1
- package/bundle/{chunk-z69tt390.js → chunk-t7gp6mjm.js} +1 -1
- package/bundle/{chunk-dd461rg3.js → chunk-tks3qzsw.js} +1 -1
- package/bundle/{chunk-1h96bk6p.js → chunk-tn0sfsks.js} +2 -2
- package/bundle/chunk-tn8hsd2c.js +2 -0
- package/bundle/chunk-tqsx7w8z.js +2 -0
- package/bundle/{chunk-tdevq564.js → chunk-trg0zg0q.js} +1 -1
- package/bundle/chunk-tyt1negg.js +2 -0
- package/bundle/chunk-tz1sv9kt.js +3 -0
- package/bundle/{chunk-p506eydh.js → chunk-tzw56029.js} +1 -1
- package/bundle/{chunk-t5wdstzv.js → chunk-v30fmrz0.js} +1 -1
- package/bundle/chunk-v580zwpf.js +3 -0
- package/bundle/{chunk-6gbdvz6p.js → chunk-v6djkm35.js} +1 -1
- package/bundle/{chunk-h6z86aay.js → chunk-v9yxkbz7.js} +1 -1
- package/bundle/chunk-vdv6cyh0.js +2 -0
- package/bundle/{chunk-z0m1qm7j.js → chunk-vqxyk6as.js} +2 -2
- package/bundle/{chunk-se8d5xg9.js → chunk-vr7525pa.js} +1 -1
- package/bundle/chunk-vsk8yfxp.js +2 -0
- package/bundle/{chunk-vjt6mh10.js → chunk-vvcyvdnk.js} +2 -2
- package/bundle/chunk-vvgmkjym.js +2 -0
- package/bundle/{chunk-0bhzhh7s.js → chunk-vvmvryh1.js} +2 -2
- package/bundle/{chunk-eme9xmh3.js → chunk-vzf04vad.js} +1 -1
- package/bundle/{chunk-xstxdw7v.js → chunk-vzj91hg8.js} +1 -1
- package/bundle/chunk-w0zyex7f.js +2 -0
- package/bundle/{chunk-e72jwbfc.js → chunk-w264gs2c.js} +1 -1
- package/bundle/chunk-w623r5kb.js +3 -0
- package/bundle/{chunk-5rqjze1g.js → chunk-wac35a6p.js} +1 -1
- package/bundle/chunk-wkxt9v7s.js +2 -0
- package/bundle/{chunk-gb51fn3r.js → chunk-wqm1vawg.js} +1 -1
- package/bundle/{chunk-pchv413c.js → chunk-wrkt670m.js} +2 -2
- package/bundle/{chunk-2y5bthrp.js → chunk-wspm2k19.js} +1 -1
- package/bundle/chunk-wwf6zacw.js +2 -0
- package/bundle/{chunk-nqk8d62j.js → chunk-wwtyrgga.js} +1 -1
- package/bundle/{chunk-ajnzv5jt.js → chunk-x0wy15q9.js} +2 -2
- package/bundle/chunk-x9c8eddk.js +2 -0
- package/bundle/{chunk-ztvkzex1.js → chunk-xaewye8w.js} +1 -1
- package/bundle/{chunk-gq3zb4wv.js → chunk-xgdst5n5.js} +2 -2
- package/bundle/{chunk-3yfjgks3.js → chunk-xgphhnpk.js} +1 -1
- package/bundle/chunk-xjed8t2h.js +2 -0
- package/bundle/{chunk-qtyapmy7.js → chunk-xn6mwsc9.js} +1 -1
- package/bundle/{chunk-v0hnn7nb.js → chunk-xpz5mnwz.js} +1 -1
- package/bundle/{chunk-6axm2qtj.js → chunk-xrb46v1e.js} +1 -1
- package/bundle/chunk-xxhta1tm.js +2 -0
- package/bundle/{chunk-532fnfmw.js → chunk-y5m9c5ek.js} +2 -2
- package/bundle/{chunk-9s5h0f1y.js → chunk-y9kjt2jj.js} +2 -2
- package/bundle/{chunk-vbfc0wgv.js → chunk-y9mxwwz7.js} +2 -2
- package/bundle/{chunk-td9hm9be.js → chunk-ycth54ja.js} +1 -1
- package/bundle/{chunk-pky8h8rh.js → chunk-ydz7387e.js} +1 -1
- package/bundle/{chunk-f3y5kr76.js → chunk-yg5azmxb.js} +2 -2
- package/bundle/{chunk-j7637cwg.js → chunk-yhe5qz48.js} +2 -2
- package/bundle/chunk-yhj6858v.js +2 -0
- package/bundle/chunk-yq3byrpv.js +2 -0
- package/bundle/{chunk-3mtjxmw1.js → chunk-yqvqzg7b.js} +1 -1
- package/bundle/chunk-ys8ajwys.js +2 -0
- package/bundle/chunk-yzt7p956.js +2 -0
- package/bundle/{chunk-2cvwrabw.js → chunk-yzxcjr6y.js} +2 -2
- package/bundle/{chunk-f6vy70p6.js → chunk-z1psybn1.js} +2 -2
- package/bundle/{chunk-xj0zc9za.js → chunk-z2cnd2cp.js} +1 -1
- package/bundle/{chunk-s27cz24e.js → chunk-z4gczap3.js} +52 -52
- package/bundle/chunk-z56cb3fs.js +2 -0
- package/bundle/{chunk-qdafm7qg.js → chunk-z66xdxkg.js} +2 -2
- package/bundle/{chunk-v16n1fep.js → chunk-z6f54x4k.js} +2 -2
- package/bundle/{chunk-kds2g7r2.js → chunk-z6qb4gt5.js} +1 -1
- package/bundle/{chunk-q4mtwv1w.js → chunk-zgj7jx8k.js} +2 -2
- package/bundle/{chunk-mn5cacf6.js → chunk-zhddj91f.js} +2 -2
- package/bundle/chunk-zhypknyg.js +2 -0
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +3 -3
- package/bundle/chunk-062chtrq.js +0 -2
- package/bundle/chunk-062vs7bp.js +0 -2
- package/bundle/chunk-08g14hmz.js +0 -2
- package/bundle/chunk-0w2v8dfy.js +0 -2
- package/bundle/chunk-10fr7a2y.js +0 -2
- package/bundle/chunk-15bjhfav.js +0 -3
- package/bundle/chunk-1hv61m11.js +0 -2
- package/bundle/chunk-2mkvx8b2.js +0 -2
- package/bundle/chunk-2rykfc3a.js +0 -2
- package/bundle/chunk-2w5hx4fs.js +0 -2
- package/bundle/chunk-2yy63sxz.js +0 -2
- package/bundle/chunk-2z3fe4qw.js +0 -2
- package/bundle/chunk-361cmmrp.js +0 -2
- package/bundle/chunk-3r6dq1h3.js +0 -2
- package/bundle/chunk-4a12wv2m.js +0 -2
- package/bundle/chunk-547a55ba.js +0 -2
- package/bundle/chunk-5ztmc770.js +0 -2
- package/bundle/chunk-62x3r2q8.js +0 -2
- package/bundle/chunk-6th7vpwm.js +0 -2
- package/bundle/chunk-6ybh5smv.js +0 -2
- package/bundle/chunk-73kprndw.js +0 -2
- package/bundle/chunk-79fr19xf.js +0 -2
- package/bundle/chunk-7ezr478e.js +0 -2
- package/bundle/chunk-7gj1vqyj.js +0 -2
- package/bundle/chunk-7ywfkwb4.js +0 -2
- package/bundle/chunk-85fnnwm2.js +0 -2
- package/bundle/chunk-89fwh84w.js +0 -2
- package/bundle/chunk-8e724g3k.js +0 -2
- package/bundle/chunk-9894a2yn.js +0 -2
- package/bundle/chunk-98ye2nwt.js +0 -2
- package/bundle/chunk-9s4excg8.js +0 -2
- package/bundle/chunk-aetgcegz.js +0 -2
- package/bundle/chunk-agas0nay.js +0 -2
- package/bundle/chunk-ayknzc4m.js +0 -2
- package/bundle/chunk-b2ybst88.js +0 -2
- package/bundle/chunk-bd5vtjd7.js +0 -2
- package/bundle/chunk-bjqqk6jt.js +0 -2
- package/bundle/chunk-cpkcdykz.js +0 -2
- package/bundle/chunk-cyafm8d6.js +0 -2
- package/bundle/chunk-d4316r53.js +0 -2
- package/bundle/chunk-d8ym7mcg.js +0 -2
- package/bundle/chunk-dnpjxjkp.js +0 -2
- package/bundle/chunk-e5gjqtby.js +0 -2
- package/bundle/chunk-ee3mqzms.js +0 -2
- package/bundle/chunk-er5f61s5.js +0 -2
- package/bundle/chunk-er716522.js +0 -2
- package/bundle/chunk-ez3gacqe.js +0 -2
- package/bundle/chunk-fkc7wf1p.js +0 -2
- package/bundle/chunk-fm6z8nqb.js +0 -2
- package/bundle/chunk-g0qwm23d.js +0 -2
- package/bundle/chunk-g4yn8cj8.js +0 -2
- package/bundle/chunk-gsez13bg.js +0 -3
- package/bundle/chunk-h1spsy3y.js +0 -2
- package/bundle/chunk-h8gkv40j.js +0 -2
- package/bundle/chunk-j59kmb49.js +0 -2
- package/bundle/chunk-jv37ghev.js +0 -2
- package/bundle/chunk-k3hcb6qf.js +0 -2
- package/bundle/chunk-k5d822n2.js +0 -3
- package/bundle/chunk-m8ytbq04.js +0 -2
- package/bundle/chunk-mf9nc4xz.js +0 -2
- package/bundle/chunk-mxby91bj.js +0 -2
- package/bundle/chunk-mzv1gh6f.js +0 -2
- package/bundle/chunk-n0hsvvw8.js +0 -2
- package/bundle/chunk-nm1v9z14.js +0 -2
- package/bundle/chunk-p7nstcxa.js +0 -2
- package/bundle/chunk-pfwkvv7g.js +0 -2
- package/bundle/chunk-pn1jz8qj.js +0 -2
- package/bundle/chunk-pqvmtfk7.js +0 -2
- package/bundle/chunk-prgw26g3.js +0 -2
- package/bundle/chunk-pv9ty6v7.js +0 -2
- package/bundle/chunk-q4rstre7.js +0 -2
- package/bundle/chunk-q6jk2v6g.js +0 -2
- package/bundle/chunk-qd43npx3.js +0 -2
- package/bundle/chunk-qdb21y83.js +0 -2
- package/bundle/chunk-qeksaefy.js +0 -2
- package/bundle/chunk-r7t9yb9d.js +0 -2
- package/bundle/chunk-sdv3a4w3.js +0 -2
- package/bundle/chunk-sk89becn.js +0 -2
- package/bundle/chunk-tc0996xz.js +0 -2
- package/bundle/chunk-tfs50mgj.js +0 -2
- package/bundle/chunk-thecq33z.js +0 -3
- package/bundle/chunk-tjvtp9d9.js +0 -2
- package/bundle/chunk-tkm9m3n0.js +0 -2
- package/bundle/chunk-v1s1rcqx.js +0 -2
- package/bundle/chunk-v4dt4062.js +0 -2
- package/bundle/chunk-wgrq86kd.js +0 -2
- package/bundle/chunk-x8ks2bn7.js +0 -2
- package/bundle/chunk-xy2ty5h5.js +0 -8
- package/bundle/chunk-z0383stv.js +0 -2
- package/bundle/chunk-zewrmk8x.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Aq as i,Eq as I3,Fp as T,Mp as m,Vp as A,_p as O3,oq as l,qq as k,rq as O,vq as s,wq as S,yq as c,zq as u}from"./chunk-yce8ph5b.js";import{Hq as q3,Mq as v,Tq as y}from"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import{Hu as j}from"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-djfrkbd5.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{$p as O3,Aq as u,Bq as i,Fq as I3,Gp as T,Np as m,Wp as A,pq as l,rq as k,sq as O,wq as s,xq as S,zq as c}from"./chunk-hsmtjb4d.js";import{Iq as q3,Nq as v,Uq as y}from"./chunk-7nh8vjx4.js";import"./chunk-cqtkxwd8.js";import"./chunk-mfg4stzn.js";import{Iu as j}from"./chunk-zgj7jx8k.js";import"./chunk-0mdmqtfr.js";import"./chunk-0xf12tf3.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,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ns as Q}from"./chunk-1sejtx9a.js";import{Gt as K}from"./chunk-vvmvryh1.js";import{rP as F,tP as N}from"./chunk-0xf12tf3.js";var V={};N(V,{text:()=>P,stop:()=>S,spawn:()=>M,run:()=>Z,lines:()=>T,RunFailedError:()=>Y});var L=F(Q(),1);import{buffer as I}from"stream/consumers";var A=["QITQODE_AUTH_CONTENT","QITQODE_SERVER_PASSWORD","QITQODE_KEY"];function C(B){let z={...B};for(let G of A)delete z[G];return z}function D(){return C(process.env)}class Y extends Error{cmd;code;stdout;stderr;constructor(B,z,G,H){let J=H.toString().trim();super(J?`Command failed with code ${z}: ${B.join(" ")}
|
|
3
3
|
${J}`:`Command failed with code ${z}: ${B.join(" ")}`);this.name="ProcessRunFailedError",this.cmd=[...B],this.code=z,this.stdout=G,this.stderr=H}}function M(B,z={}){if(B.length===0)throw Error("Command is required");z.abort?.throwIfAborted();let G=L.default(B[0],B.slice(1),{cwd:z.cwd,shell:z.shell,env:z.env===null?{}:{...D(),...z.env},stdio:[z.stdin??"ignore",z.stdout??"ignore",z.stderr??"ignore"],windowsHide:process.platform==="win32"}),H=!1,J,O=()=>{if(H)return;if(G.exitCode!==null||G.signalCode!==null)return;H=!0,G.kill(z.kill??"SIGTERM");let W=z.timeout??5000;if(W<=0)return;J=setTimeout(()=>G.kill("SIGKILL"),W)},U=new Promise((W,j)=>{let k=()=>{if(z.abort?.removeEventListener("abort",O),J)clearTimeout(J)};G.once("exit",(X,q)=>{k(),W(X??(q?1:0))}),G.once("error",(X)=>{k(),j(X)})});if(U.catch(()=>{return}),z.abort){if(z.abort.addEventListener("abort",O,{once:!0}),z.abort.aborted)O()}let $=G;return $.exited=U,$}async function Z(B,z={}){let G=M(B,{cwd:z.cwd,env:z.env,stdin:z.stdin,shell:z.shell,abort:z.abort,kill:z.kill,timeout:z.timeout,stdout:"pipe",stderr:"pipe"});if(!G.stdout||!G.stderr)throw Error("Process output not available");let H=await Promise.all([G.exited,I(G.stdout),I(G.stderr)]).then(([J,O,U])=>({code:J,stdout:O,stderr:U})).catch((J)=>{if(!z.nothrow)throw J;return{code:1,stdout:Buffer.alloc(0),stderr:Buffer.from(K(J))}});if(H.code===0||z.nothrow)return H;throw new Y(B,H.code,H.stdout,H.stderr)}async function S(B){if(B.exitCode!==null||B.signalCode!==null)return;if(process.platform!=="win32"||!B.pid){B.kill();return}if((await Z(["taskkill","/pid",String(B.pid),"/T","/F"],{nothrow:!0})).code===0)return;B.kill()}async function P(B,z={}){let G=await Z(B,z);return{...G,text:G.stdout.toString()}}async function T(B,z={}){return(await P(B,z)).text.split(/\r?\n/).filter(Boolean)}
|
|
4
|
-
export{D as
|
|
4
|
+
export{D as Is,M as Js,Z as Ks,P as Ls,V as Ms};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ge as Qb}from"./chunk-pbanj1gk.js";import{Ke as Sb}from"./chunk-xqwk2zsx.js";import{Le as Rb}from"./chunk-g08qj9z3.js";import{Me as Nb,Ne as Ob,Oe as Pb}from"./chunk-ccdjzn2m.js";import{Pe as Mb}from"./chunk-dp6ms01y.js";import{Bf as Eb,Cf as Hb,Df as Jb,Ef as Kb,Ff as Lb}from"./chunk-2fbkw84y.js";import"./chunk-djfrkbd5.js";var x=Pb(),U=Ob(),u=Hb(),v=Jb(),L=Kb(),V=Mb(),P=Nb(),Z=Eb(),_=Qb(),M=Lb(),i=Rb(),Tb=Sb(),Ub=async(b,h,j)=>{return{operation:u.getSmithyContext(h).operation,region:await u.normalizeProvider(b.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function Vb(b){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:b.region},propertiesExtractor:(h,j)=>({signingProperties:{config:h,context:j}})}}function e(b){return{schemeId:"smithy.api#noAuth"}}var Wb=(b)=>{let h=[];switch(b.operation){case"GetCredentialsForIdentity":{h.push(e());break}case"GetId":{h.push(e());break}default:h.push(Vb(b))}return h},Xb=(b)=>{let h=_.resolveAwsSdkSigV4Config(b);return Object.assign(h,{authSchemePreference:u.normalizeProvider(b.authSchemePreference??[])})},Yb=(b)=>{return Object.assign(b,{useDualstackEndpoint:b.useDualstackEndpoint??!1,useFipsEndpoint:b.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"})},n={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Zb="3.997.14",_b={version:Zb},Q="ref",K=-1,S=!0,m="isSet",bb="PartitionResult",T="booleanEquals",X="getAttr",N="stringEquals",d={[Q]:"Endpoint"},Y={[Q]:bb},O={[Q]:"Region"},A={},o=[O],t={conditions:[[m,[d]],[m,o],["aws.partition",o,bb],[T,[{[Q]:"UseFIPS"},S]],[T,[{fn:X,argv:[Y,"supportsFIPS"]},S]],[T,[{[Q]:"UseDualStack"},S]],[T,[{fn:X,argv:[Y,"supportsDualStack"]},S]],[N,[{fn:X,argv:[Y,"name"]},"aws"]],[N,[O,"us-east-1"]],[N,[O,"us-east-2"]],[N,[O,"us-west-1"]],[N,[O,"us-west-2"]]],results:[[K],[K,"Invalid Configuration: FIPS and custom endpoint are not supported"],[K,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[d,A],["https://cognito-identity-fips.us-east-1.amazonaws.com",A],["https://cognito-identity-fips.us-east-2.amazonaws.com",A],["https://cognito-identity-fips.us-west-1.amazonaws.com",A],["https://cognito-identity-fips.us-west-2.amazonaws.com",A],["https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",A],[K,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",A],[K,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-identity.{Region}.amazonaws.com",A],["https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",A],[K,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",A],[K,"Invalid Configuration: Missing Region"]]},$b=2,p=1e8,sb=new Int32Array([-1,1,-1,0,17,3,1,4,p+16,2,5,p+16,3,9,6,5,7,p+15,6,8,p+14,7,p+12,p+13,4,11,10,5,p+9,p+11,5,12,p+10,6,13,p+9,8,p+4,14,9,p+5,15,10,p+6,16,11,p+7,p+8,3,p+1,18,5,p+2,p+3]),Fb=L.BinaryDecisionDiagram.from(sb,$b,t.conditions,t.results),cb=new L.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),fb=(b,h={})=>{return cb.get(b,()=>L.decideEndpoint(Fb,{endpointParams:b,logger:h.logger}))};L.customEndpointFunctions.aws=x.awsEndpointFunctions;class z extends u.ServiceException{constructor(b){super(b);Object.setPrototypeOf(this,z.prototype)}}class $ extends z{name="ExternalServiceException";$fault="client";constructor(b){super({name:"ExternalServiceException",$fault:"client",...b});Object.setPrototypeOf(this,$.prototype)}}class s extends z{name="InternalErrorException";$fault="server";constructor(b){super({name:"InternalErrorException",$fault:"server",...b});Object.setPrototypeOf(this,s.prototype)}}class F extends z{name="InvalidIdentityPoolConfigurationException";$fault="client";constructor(b){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...b});Object.setPrototypeOf(this,F.prototype)}}class c extends z{name="InvalidParameterException";$fault="client";constructor(b){super({name:"InvalidParameterException",$fault:"client",...b});Object.setPrototypeOf(this,c.prototype)}}class f extends z{name="NotAuthorizedException";$fault="client";constructor(b){super({name:"NotAuthorizedException",$fault:"client",...b});Object.setPrototypeOf(this,f.prototype)}}class l extends z{name="ResourceConflictException";$fault="client";constructor(b){super({name:"ResourceConflictException",$fault:"client",...b});Object.setPrototypeOf(this,l.prototype)}}class G extends z{name="ResourceNotFoundException";$fault="client";constructor(b){super({name:"ResourceNotFoundException",$fault:"client",...b});Object.setPrototypeOf(this,G.prototype)}}class r extends z{name="TooManyRequestsException";$fault="client";constructor(b){super({name:"TooManyRequestsException",$fault:"client",...b});Object.setPrototypeOf(this,r.prototype)}}class y extends z{name="LimitExceededException";$fault="client";constructor(b){super({name:"LimitExceededException",$fault:"client",...b});Object.setPrototypeOf(this,y.prototype)}}var lb="AccountId",Gb="AccessKeyId",hb="Credentials",rb="CustomRoleArn",yb="Expiration",gb="ExternalServiceException",Ib="GetCredentialsForIdentity",ab="GetCredentialsForIdentityInput",Cb="GetCredentialsForIdentityResponse",ib="GetId",eb="GetIdInput",mb="GetIdResponse",db="InternalErrorException",g="IdentityId",ob="InvalidIdentityPoolConfigurationException",tb="InvalidParameterException",nb="IdentityPoolId",bh="IdentityProviderToken",jb="Logins",hh="LimitExceededException",jh="LoginsMap",kh="NotAuthorizedException",ph="ResourceConflictException",qh="ResourceNotFoundException",uh="SecretKey",vh="SecretKeyString",wh="SessionToken",xh="TooManyRequestsException",H="client",D="error",J="httpError",E="message",kb="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity",zh="server",k="com.amazonaws.cognitoidentity",pb=Z.TypeRegistry.for(kb),Ah=[-3,kb,"CognitoIdentityServiceException",0,[],[]];pb.registerError(Ah,z);var B=Z.TypeRegistry.for(k),Bh=[-3,k,gb,{[D]:H,[J]:400},[E],[0]];B.registerError(Bh,$);var Dh=[-3,k,db,{[D]:zh},[E],[0]];B.registerError(Dh,s);var Eh=[-3,k,ob,{[D]:H,[J]:400},[E],[0]];B.registerError(Eh,F);var Hh=[-3,k,tb,{[D]:H,[J]:400},[E],[0]];B.registerError(Hh,c);var Jh=[-3,k,hh,{[D]:H,[J]:400},[E],[0]];B.registerError(Jh,y);var Kh=[-3,k,kh,{[D]:H,[J]:403},[E],[0]];B.registerError(Kh,f);var Lh=[-3,k,ph,{[D]:H,[J]:409},[E],[0]];B.registerError(Lh,l);var Mh=[-3,k,qh,{[D]:H,[J]:404},[E],[0]];B.registerError(Mh,G);var Nh=[-3,k,xh,{[D]:H,[J]:429},[E],[0]];B.registerError(Nh,r);var Oh=[pb,B],Ph=[0,k,bh,8,0],Qh=[0,k,vh,8,0],Rh=[3,k,hb,0,[Gb,uh,wh,yb],[0,[()=>Qh,0],0,4]],Sh=[3,k,ab,0,[g,jb,rb],[0,[()=>qb,0],0],1],Th=[3,k,Cb,0,[g,hb],[0,[()=>Rh,0]]],Uh=[3,k,eb,0,[nb,lb,jb],[0,0,[()=>qb,0]],1],Vh=[3,k,mb,0,[g],[0]],qb=[2,k,jh,0,[0,0],[()=>Ph,0]],Wh=[9,k,Ib,0,()=>Sh,()=>Th],Xh=[9,k,ib,0,()=>Uh,()=>Vh],Yh=(b)=>{return{apiVersion:"2014-06-30",base64Decoder:b?.base64Decoder??M.fromBase64,base64Encoder:b?.base64Encoder??M.toBase64,disableHostPrefix:b?.disableHostPrefix??!1,endpointProvider:b?.endpointProvider??fb,extensions:b?.extensions??[],httpAuthSchemeProvider:b?.httpAuthSchemeProvider??Wb,httpAuthSchemes:b?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(h)=>h.getIdentityProvider("aws.auth#sigv4"),signer:new _.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(h)=>h.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new U.NoAuthSigner}],logger:b?.logger??new u.NoOpLogger,protocol:b?.protocol??Tb.AwsJson1_1Protocol,protocolSettings:b?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentity",errorTypeRegistries:Oh,xmlNamespace:"http://cognito-identity.amazonaws.com/doc/2014-06-30/",version:"2014-06-30",serviceTarget:"AWSCognitoIdentityService"},serviceId:b?.serviceId??"Cognito Identity",urlParser:b?.urlParser??V.parseUrl,utf8Decoder:b?.utf8Decoder??M.fromUtf8,utf8Encoder:b?.utf8Encoder??M.toUtf8}},Zh=(b)=>{u.emitWarningIfUnsupportedVersion(process.version);let h=v.resolveDefaultsModeConfig(b),j=()=>h().then(u.loadConfigsForDefaultMode),w=Yh(b);x.emitWarningIfUnsupportedVersion(process.version);let q={profile:b?.profile,logger:w.logger};return{...w,...b,runtime:"node",defaultsMode:h,authSchemePreference:b?.authSchemePreference??v.loadConfig(_.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,q),bodyLengthChecker:b?.bodyLengthChecker??M.calculateBodyLength,defaultUserAgentProvider:b?.defaultUserAgentProvider??x.createDefaultUserAgentProvider({serviceId:w.serviceId,clientVersion:_b.version}),maxAttempts:b?.maxAttempts??v.loadConfig(P.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,b),region:b?.region??v.loadConfig(v.NODE_REGION_CONFIG_OPTIONS,{...v.NODE_REGION_CONFIG_FILE_OPTIONS,...q}),requestHandler:i.NodeHttpHandler.create(b?.requestHandler??j),retryMode:b?.retryMode??v.loadConfig({...P.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await j()).retryMode||P.DEFAULT_RETRY_MODE},b),sha256:b?.sha256??M.Hash.bind(null,"sha256"),streamCollector:b?.streamCollector??i.streamCollector,useDualstackEndpoint:b?.useDualstackEndpoint??v.loadConfig(v.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,q),useFipsEndpoint:b?.useFipsEndpoint??v.loadConfig(v.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,q),userAgentAppId:b?.userAgentAppId??v.loadConfig(x.NODE_APP_ID_CONFIG_OPTIONS,q)}},_h=(b)=>{let{httpAuthSchemes:h,httpAuthSchemeProvider:j,credentials:w}=b;return{setHttpAuthScheme(q){let R=h.findIndex((W)=>W.schemeId===q.schemeId);if(R===-1)h.push(q);else h.splice(R,1,q)},httpAuthSchemes(){return h},setHttpAuthSchemeProvider(q){j=q},httpAuthSchemeProvider(){return j},setCredentials(q){w=q},credentials(){return w}}},$h=(b)=>{return{httpAuthSchemes:b.httpAuthSchemes(),httpAuthSchemeProvider:b.httpAuthSchemeProvider(),credentials:b.credentials()}},sh=(b,h)=>{let j=Object.assign(x.getAwsRegionExtensionConfiguration(b),u.getDefaultExtensionConfiguration(b),V.getHttpHandlerExtensionConfiguration(b),_h(b));return h.forEach((w)=>w.configure(j)),Object.assign(b,x.resolveAwsRegionExtensionConfiguration(j),u.resolveDefaultRuntimeConfig(j),V.resolveHttpHandlerRuntimeConfig(j),$h(j))};class I extends u.Client{config;constructor(...[b]){let h=Zh(b||{});super(h);this.initConfig=h;let j=Yb(h),w=x.resolveUserAgentConfig(j),q=P.resolveRetryConfig(w),R=v.resolveRegionConfig(q),W=x.resolveHostHeaderConfig(R),zb=L.resolveEndpointConfig(W),Ab=Xb(zb),Bb=sh(Ab,b?.extensions||[]);this.config=Bb,this.middlewareStack.use(Z.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(x.getUserAgentPlugin(this.config)),this.middlewareStack.use(P.getRetryPlugin(this.config)),this.middlewareStack.use(V.getContentLengthPlugin(this.config)),this.middlewareStack.use(x.getHostHeaderPlugin(this.config)),this.middlewareStack.use(x.getLoggerPlugin(this.config)),this.middlewareStack.use(x.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(U.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ub,identityProviderConfigProvider:async(Db)=>new U.DefaultIdentityProviderConfig({"aws.auth#sigv4":Db.credentials})})),this.middlewareStack.use(U.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class a extends u.Command.classBuilder().ep(n).m(function(b,h,j,w){return[L.getEndpointPlugin(j,b.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").sc(Wh).build(){}class C extends u.Command.classBuilder().ep(n).m(function(b,h,j,w){return[L.getEndpointPlugin(j,b.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").sc(Xh).build(){}var Fh={GetCredentialsForIdentityCommand:a,GetIdCommand:C};class ub extends I{}u.createAggregatedClient(Fh,ub);var{Command:ch,Client:fh}=u;var vb=I;var wb=a;var xb=C;export{xb as GetIdCommand,wb as GetCredentialsForIdentityCommand,vb as CognitoIdentityClient};
|
|
2
|
+
import{He as Qb}from"./chunk-e6s8ep9m.js";import{Le as Sb}from"./chunk-2md5fz4f.js";import{Me as Rb}from"./chunk-h1p3xcfp.js";import{Ne as Nb,Oe as Ob,Pe as Pb}from"./chunk-6jb4mnvq.js";import{Qe as Mb}from"./chunk-ec1bwa7f.js";import{Cf as Eb,Df as Hb,Ef as Jb,Ff as Kb,Gf as Lb}from"./chunk-hcd0k14e.js";import"./chunk-0xf12tf3.js";var x=Pb(),U=Ob(),u=Hb(),v=Jb(),L=Kb(),V=Mb(),P=Nb(),Z=Eb(),_=Qb(),M=Lb(),i=Rb(),Tb=Sb(),Ub=async(b,h,j)=>{return{operation:u.getSmithyContext(h).operation,region:await u.normalizeProvider(b.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};function Vb(b){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:b.region},propertiesExtractor:(h,j)=>({signingProperties:{config:h,context:j}})}}function e(b){return{schemeId:"smithy.api#noAuth"}}var Wb=(b)=>{let h=[];switch(b.operation){case"GetCredentialsForIdentity":{h.push(e());break}case"GetId":{h.push(e());break}default:h.push(Vb(b))}return h},Xb=(b)=>{let h=_.resolveAwsSdkSigV4Config(b);return Object.assign(h,{authSchemePreference:u.normalizeProvider(b.authSchemePreference??[])})},Yb=(b)=>{return Object.assign(b,{useDualstackEndpoint:b.useDualstackEndpoint??!1,useFipsEndpoint:b.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"})},n={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Zb="3.997.14",_b={version:Zb},Q="ref",K=-1,S=!0,m="isSet",bb="PartitionResult",T="booleanEquals",X="getAttr",N="stringEquals",d={[Q]:"Endpoint"},Y={[Q]:bb},O={[Q]:"Region"},A={},o=[O],t={conditions:[[m,[d]],[m,o],["aws.partition",o,bb],[T,[{[Q]:"UseFIPS"},S]],[T,[{fn:X,argv:[Y,"supportsFIPS"]},S]],[T,[{[Q]:"UseDualStack"},S]],[T,[{fn:X,argv:[Y,"supportsDualStack"]},S]],[N,[{fn:X,argv:[Y,"name"]},"aws"]],[N,[O,"us-east-1"]],[N,[O,"us-east-2"]],[N,[O,"us-west-1"]],[N,[O,"us-west-2"]]],results:[[K],[K,"Invalid Configuration: FIPS and custom endpoint are not supported"],[K,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[d,A],["https://cognito-identity-fips.us-east-1.amazonaws.com",A],["https://cognito-identity-fips.us-east-2.amazonaws.com",A],["https://cognito-identity-fips.us-west-1.amazonaws.com",A],["https://cognito-identity-fips.us-west-2.amazonaws.com",A],["https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",A],[K,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",A],[K,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-identity.{Region}.amazonaws.com",A],["https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",A],[K,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",A],[K,"Invalid Configuration: Missing Region"]]},$b=2,p=1e8,sb=new Int32Array([-1,1,-1,0,17,3,1,4,p+16,2,5,p+16,3,9,6,5,7,p+15,6,8,p+14,7,p+12,p+13,4,11,10,5,p+9,p+11,5,12,p+10,6,13,p+9,8,p+4,14,9,p+5,15,10,p+6,16,11,p+7,p+8,3,p+1,18,5,p+2,p+3]),Fb=L.BinaryDecisionDiagram.from(sb,$b,t.conditions,t.results),cb=new L.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),fb=(b,h={})=>{return cb.get(b,()=>L.decideEndpoint(Fb,{endpointParams:b,logger:h.logger}))};L.customEndpointFunctions.aws=x.awsEndpointFunctions;class z extends u.ServiceException{constructor(b){super(b);Object.setPrototypeOf(this,z.prototype)}}class $ extends z{name="ExternalServiceException";$fault="client";constructor(b){super({name:"ExternalServiceException",$fault:"client",...b});Object.setPrototypeOf(this,$.prototype)}}class s extends z{name="InternalErrorException";$fault="server";constructor(b){super({name:"InternalErrorException",$fault:"server",...b});Object.setPrototypeOf(this,s.prototype)}}class F extends z{name="InvalidIdentityPoolConfigurationException";$fault="client";constructor(b){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...b});Object.setPrototypeOf(this,F.prototype)}}class c extends z{name="InvalidParameterException";$fault="client";constructor(b){super({name:"InvalidParameterException",$fault:"client",...b});Object.setPrototypeOf(this,c.prototype)}}class f extends z{name="NotAuthorizedException";$fault="client";constructor(b){super({name:"NotAuthorizedException",$fault:"client",...b});Object.setPrototypeOf(this,f.prototype)}}class l extends z{name="ResourceConflictException";$fault="client";constructor(b){super({name:"ResourceConflictException",$fault:"client",...b});Object.setPrototypeOf(this,l.prototype)}}class G extends z{name="ResourceNotFoundException";$fault="client";constructor(b){super({name:"ResourceNotFoundException",$fault:"client",...b});Object.setPrototypeOf(this,G.prototype)}}class r extends z{name="TooManyRequestsException";$fault="client";constructor(b){super({name:"TooManyRequestsException",$fault:"client",...b});Object.setPrototypeOf(this,r.prototype)}}class y extends z{name="LimitExceededException";$fault="client";constructor(b){super({name:"LimitExceededException",$fault:"client",...b});Object.setPrototypeOf(this,y.prototype)}}var lb="AccountId",Gb="AccessKeyId",hb="Credentials",rb="CustomRoleArn",yb="Expiration",gb="ExternalServiceException",Ib="GetCredentialsForIdentity",ab="GetCredentialsForIdentityInput",Cb="GetCredentialsForIdentityResponse",ib="GetId",eb="GetIdInput",mb="GetIdResponse",db="InternalErrorException",g="IdentityId",ob="InvalidIdentityPoolConfigurationException",tb="InvalidParameterException",nb="IdentityPoolId",bh="IdentityProviderToken",jb="Logins",hh="LimitExceededException",jh="LoginsMap",kh="NotAuthorizedException",ph="ResourceConflictException",qh="ResourceNotFoundException",uh="SecretKey",vh="SecretKeyString",wh="SessionToken",xh="TooManyRequestsException",H="client",D="error",J="httpError",E="message",kb="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity",zh="server",k="com.amazonaws.cognitoidentity",pb=Z.TypeRegistry.for(kb),Ah=[-3,kb,"CognitoIdentityServiceException",0,[],[]];pb.registerError(Ah,z);var B=Z.TypeRegistry.for(k),Bh=[-3,k,gb,{[D]:H,[J]:400},[E],[0]];B.registerError(Bh,$);var Dh=[-3,k,db,{[D]:zh},[E],[0]];B.registerError(Dh,s);var Eh=[-3,k,ob,{[D]:H,[J]:400},[E],[0]];B.registerError(Eh,F);var Hh=[-3,k,tb,{[D]:H,[J]:400},[E],[0]];B.registerError(Hh,c);var Jh=[-3,k,hh,{[D]:H,[J]:400},[E],[0]];B.registerError(Jh,y);var Kh=[-3,k,kh,{[D]:H,[J]:403},[E],[0]];B.registerError(Kh,f);var Lh=[-3,k,ph,{[D]:H,[J]:409},[E],[0]];B.registerError(Lh,l);var Mh=[-3,k,qh,{[D]:H,[J]:404},[E],[0]];B.registerError(Mh,G);var Nh=[-3,k,xh,{[D]:H,[J]:429},[E],[0]];B.registerError(Nh,r);var Oh=[pb,B],Ph=[0,k,bh,8,0],Qh=[0,k,vh,8,0],Rh=[3,k,hb,0,[Gb,uh,wh,yb],[0,[()=>Qh,0],0,4]],Sh=[3,k,ab,0,[g,jb,rb],[0,[()=>qb,0],0],1],Th=[3,k,Cb,0,[g,hb],[0,[()=>Rh,0]]],Uh=[3,k,eb,0,[nb,lb,jb],[0,0,[()=>qb,0]],1],Vh=[3,k,mb,0,[g],[0]],qb=[2,k,jh,0,[0,0],[()=>Ph,0]],Wh=[9,k,Ib,0,()=>Sh,()=>Th],Xh=[9,k,ib,0,()=>Uh,()=>Vh],Yh=(b)=>{return{apiVersion:"2014-06-30",base64Decoder:b?.base64Decoder??M.fromBase64,base64Encoder:b?.base64Encoder??M.toBase64,disableHostPrefix:b?.disableHostPrefix??!1,endpointProvider:b?.endpointProvider??fb,extensions:b?.extensions??[],httpAuthSchemeProvider:b?.httpAuthSchemeProvider??Wb,httpAuthSchemes:b?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(h)=>h.getIdentityProvider("aws.auth#sigv4"),signer:new _.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(h)=>h.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new U.NoAuthSigner}],logger:b?.logger??new u.NoOpLogger,protocol:b?.protocol??Tb.AwsJson1_1Protocol,protocolSettings:b?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentity",errorTypeRegistries:Oh,xmlNamespace:"http://cognito-identity.amazonaws.com/doc/2014-06-30/",version:"2014-06-30",serviceTarget:"AWSCognitoIdentityService"},serviceId:b?.serviceId??"Cognito Identity",urlParser:b?.urlParser??V.parseUrl,utf8Decoder:b?.utf8Decoder??M.fromUtf8,utf8Encoder:b?.utf8Encoder??M.toUtf8}},Zh=(b)=>{u.emitWarningIfUnsupportedVersion(process.version);let h=v.resolveDefaultsModeConfig(b),j=()=>h().then(u.loadConfigsForDefaultMode),w=Yh(b);x.emitWarningIfUnsupportedVersion(process.version);let q={profile:b?.profile,logger:w.logger};return{...w,...b,runtime:"node",defaultsMode:h,authSchemePreference:b?.authSchemePreference??v.loadConfig(_.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,q),bodyLengthChecker:b?.bodyLengthChecker??M.calculateBodyLength,defaultUserAgentProvider:b?.defaultUserAgentProvider??x.createDefaultUserAgentProvider({serviceId:w.serviceId,clientVersion:_b.version}),maxAttempts:b?.maxAttempts??v.loadConfig(P.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,b),region:b?.region??v.loadConfig(v.NODE_REGION_CONFIG_OPTIONS,{...v.NODE_REGION_CONFIG_FILE_OPTIONS,...q}),requestHandler:i.NodeHttpHandler.create(b?.requestHandler??j),retryMode:b?.retryMode??v.loadConfig({...P.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await j()).retryMode||P.DEFAULT_RETRY_MODE},b),sha256:b?.sha256??M.Hash.bind(null,"sha256"),streamCollector:b?.streamCollector??i.streamCollector,useDualstackEndpoint:b?.useDualstackEndpoint??v.loadConfig(v.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,q),useFipsEndpoint:b?.useFipsEndpoint??v.loadConfig(v.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,q),userAgentAppId:b?.userAgentAppId??v.loadConfig(x.NODE_APP_ID_CONFIG_OPTIONS,q)}},_h=(b)=>{let{httpAuthSchemes:h,httpAuthSchemeProvider:j,credentials:w}=b;return{setHttpAuthScheme(q){let R=h.findIndex((W)=>W.schemeId===q.schemeId);if(R===-1)h.push(q);else h.splice(R,1,q)},httpAuthSchemes(){return h},setHttpAuthSchemeProvider(q){j=q},httpAuthSchemeProvider(){return j},setCredentials(q){w=q},credentials(){return w}}},$h=(b)=>{return{httpAuthSchemes:b.httpAuthSchemes(),httpAuthSchemeProvider:b.httpAuthSchemeProvider(),credentials:b.credentials()}},sh=(b,h)=>{let j=Object.assign(x.getAwsRegionExtensionConfiguration(b),u.getDefaultExtensionConfiguration(b),V.getHttpHandlerExtensionConfiguration(b),_h(b));return h.forEach((w)=>w.configure(j)),Object.assign(b,x.resolveAwsRegionExtensionConfiguration(j),u.resolveDefaultRuntimeConfig(j),V.resolveHttpHandlerRuntimeConfig(j),$h(j))};class I extends u.Client{config;constructor(...[b]){let h=Zh(b||{});super(h);this.initConfig=h;let j=Yb(h),w=x.resolveUserAgentConfig(j),q=P.resolveRetryConfig(w),R=v.resolveRegionConfig(q),W=x.resolveHostHeaderConfig(R),zb=L.resolveEndpointConfig(W),Ab=Xb(zb),Bb=sh(Ab,b?.extensions||[]);this.config=Bb,this.middlewareStack.use(Z.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(x.getUserAgentPlugin(this.config)),this.middlewareStack.use(P.getRetryPlugin(this.config)),this.middlewareStack.use(V.getContentLengthPlugin(this.config)),this.middlewareStack.use(x.getHostHeaderPlugin(this.config)),this.middlewareStack.use(x.getLoggerPlugin(this.config)),this.middlewareStack.use(x.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(U.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ub,identityProviderConfigProvider:async(Db)=>new U.DefaultIdentityProviderConfig({"aws.auth#sigv4":Db.credentials})})),this.middlewareStack.use(U.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class a extends u.Command.classBuilder().ep(n).m(function(b,h,j,w){return[L.getEndpointPlugin(j,b.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").sc(Wh).build(){}class C extends u.Command.classBuilder().ep(n).m(function(b,h,j,w){return[L.getEndpointPlugin(j,b.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").sc(Xh).build(){}var Fh={GetCredentialsForIdentityCommand:a,GetIdCommand:C};class ub extends I{}u.createAggregatedClient(Fh,ub);var{Command:ch,Client:fh}=u;var vb=I;var wb=a;var xb=C;export{xb as GetIdCommand,wb as GetCredentialsForIdentityCommand,vb as CognitoIdentityClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{i as P,j as g,k as b,l as h,m as O}from"./chunk-
|
|
2
|
+
import{i as P,j as g,k as b,l as h,m as O}from"./chunk-mqtj38j9.js";import"./chunk-y9mxwwz7.js";import"./chunk-yhe5qz48.js";import{de as u}from"./chunk-b274mb6v.js";import{ag as s}from"./chunk-d2049chz.js";import{yh as f}from"./chunk-cv3xdp8q.js";import{zh as E}from"./chunk-x0wy15q9.js";import"./chunk-2h8b0csf.js";import"./chunk-4q14whpc.js";import"./chunk-s81ck6bw.js";import"./chunk-dzy3ezht.js";import"./chunk-g3y5kvg6.js";import{xj as S,yj as p}from"./chunk-z4gczap3.js";import"./chunk-2p1qaqv3.js";import"./chunk-47pxz6cb.js";import"./chunk-aq75kv5f.js";import"./chunk-1851skhm.js";import"./chunk-0ware2sh.js";import"./chunk-fbd971t7.js";import"./chunk-1f9qcrn6.js";import"./chunk-z66xdxkg.js";import"./chunk-jt94rhev.js";import"./chunk-2ts2s8b4.js";import"./chunk-7k1q26yn.js";import"./chunk-08mgb5tt.js";import"./chunk-6wt8g6mc.js";import"./chunk-1rafe6f5.js";import"./chunk-hsmtjb4d.js";import"./chunk-7nh8vjx4.js";import"./chunk-cqtkxwd8.js";import"./chunk-mfg4stzn.js";import"./chunk-hp9q7vvq.js";import"./chunk-5es19n1m.js";import"./chunk-1bbx1da7.js";import"./chunk-wspm2k19.js";import"./chunk-gvc1mqrs.js";import"./chunk-1exjy880.js";import"./chunk-xgdst5n5.js";import"./chunk-yzxcjr6y.js";import"./chunk-53n3tfwn.js";import"./chunk-3be70hxy.js";import"./chunk-9a9qcvtz.js";import"./chunk-1sejtx9a.js";import"./chunk-jrh028na.js";import"./chunk-vqxyk6as.js";import"./chunk-mbma071k.js";import"./chunk-ajykvcas.js";import"./chunk-dpm5x19e.js";import"./chunk-vvmvryh1.js";import"./chunk-6g3bzap8.js";import"./chunk-mrh5q4s6.js";import"./chunk-w623r5kb.js";import"./chunk-zgj7jx8k.js";import"./chunk-0mdmqtfr.js";import{Pz as I}from"./chunk-00krzh3y.js";import{dI as l,kC as d,zD as D}from"./chunk-hk8m8vax.js";import"./chunk-zhddj91f.js";import"./chunk-t4kma6mq.js";import"./chunk-0xf12tf3.js";var A=(o)=>l.promise(()=>E(o)),m=(o)=>l.sync(()=>s.println(o)),v=(o)=>s.Style.TEXT_DIM+o+s.Style.TEXT_NORMAL,L=(o)=>o?v(" (active)"):"",w=(o,e)=>`${o.email} ${v(o.url)}${L(e)}`,x=(o,e,t)=>`${e.name} (${o.email})${L(t)}`,C=(o,e,t)=>{let n=t?s.Style.TEXT_SUCCESS+"\u25CF"+s.Style.TEXT_NORMAL:" ",c=t?s.Style.TEXT_HIGHLIGHT_BOLD+e.name+s.Style.TEXT_NORMAL:e.name;return` ${n} ${c} ${v(o.email)} ${v(o.url)} ${v(e.id)}`},T=(o,e)=>d.isSome(o)&&o.value.id===e.accountID&&o.value.active_org_id===e.orgID,_=l.fn("login")(function*(o){let e=yield*p.Service;yield*P("Log in");let t=yield*e.login(o);yield*b.info("Go to: "+t.url),yield*b.info("Enter code: "+t.user),yield*A(t.url);let n=O();yield*n.start("Waiting for authorization...");let c=(r)=>l.gen(function*(){yield*l.sleep(r);let i=yield*e.poll(t);if(i._tag==="PollPending")return yield*c(r);if(i._tag==="PollSlow")return yield*c(D.sum(r,D.seconds(5)));return i}),a=yield*c(t.interval).pipe(l.timeout(t.expiry),l.catchTag("TimeoutError",()=>l.succeed(new S)));yield*I.valueTags(a,{PollSuccess:(r)=>l.gen(function*(){yield*n.stop("Logged in as "+r.email),yield*g("Done")}),PollExpired:()=>n.stop("Device code expired",1),PollDenied:()=>n.stop("Authorization denied",1),PollError:(r)=>n.stop("Error: "+String(r.cause),1),PollPending:()=>n.stop("Unexpected state",1),PollSlow:()=>n.stop("Unexpected state",1)})}),N=l.fn("logout")(function*(o){let e=yield*p.Service,t=yield*e.list();if(t.length===0)return yield*m("Not logged in");if(o){let i=t.find((y)=>y.email===o);if(!i)return yield*m("Account not found: "+o);yield*e.remove(i.id),yield*g("Logged out from "+o);return}let n=yield*e.active(),c=d.map(n,(i)=>i.id);yield*P("Log out");let a=t.map((i)=>{let y=d.isSome(c)&&c.value===i.id;return{value:i,label:w(i,y)}}),r=yield*h({message:"Select account to log out",options:a});if(d.isNone(r))return;yield*e.remove(r.value.id),yield*g("Logged out from "+r.value.email)}),$=l.fn("switch")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("Not logged in");let t=yield*o.active(),n=e.flatMap((r)=>r.orgs.map((i)=>{let y=T(t,{accountID:r.account.id,orgID:i.id});return{value:{orgID:i.id,accountID:r.account.id,label:i.name},label:x(r.account,i,y)}}));if(n.length===0)return yield*m("No orgs found");yield*P("Switch org");let c=yield*h({message:"Select org",options:n});if(d.isNone(c))return;let a=c.value;yield*o.use(a.accountID,d.some(a.orgID)),yield*g("Switched to "+a.label)}),R=l.fn("orgs")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("No accounts found");if(!e.some((n)=>n.orgs.length>0))return yield*m("No orgs found");let t=yield*o.active();for(let n of e)for(let c of n.orgs){let a=T(t,{accountID:n.account.id,orgID:c.id});yield*m(C(n.account,c,a))}}),M=l.fn("open")(function*(){let e=yield*(yield*p.Service).active();if(d.isNone(e))return yield*m("No active account");let t=e.value.url;yield*A(t),yield*g("Opened "+t)}),X=u({command:"login <url>",describe:!1,builder:(o)=>o.positional("url",{describe:"server URL",type:"string",demandOption:!0}),async handler(o){s.empty(),await f.runPromise(_(o.url))}}),B=u({command:"logout [email]",describe:!1,builder:(o)=>o.positional("email",{describe:"account email to log out from",type:"string"}),async handler(o){s.empty(),await f.runPromise(N(o.email))}}),U=u({command:"switch",describe:!1,async handler(){s.empty(),await f.runPromise($())}}),G=u({command:"orgs",describe:!1,async handler(){s.empty(),await f.runPromise(R())}}),H=u({command:"open",describe:!1,async handler(){s.empty(),await f.runPromise(M())}}),Y=u({command:"console",describe:!1,builder:(o)=>o.command({...X,describe:"log in to console"}).command({...B,describe:"log out from console"}).command({...U,describe:"switch active org"}).command({...G,describe:"list orgs"}).command({...H,describe:"open active console account"}).demandCommand(),async handler(){}});export{C as formatOrgLine,w as formatAccountLabel,U as SwitchCommand,G as OrgsCommand,H as OpenCommand,B as LogoutCommand,X as LoginCommand,Y as ConsoleCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-0xf12tf3.js";var ve=Object.defineProperty,W=(e,t)=>{for(var n in t)ve(e,n,{get:t[n],enumerable:!0})},Z={};W(Z,{languages:()=>lt,options:()=>pt,parsers:()=>ue,printers:()=>zt});var Ie=(e,t,n,r)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},K=Ie,ye="indent",Ae="group",Oe="if-break",q="line",xe="break-parent",ee=()=>{},w=ee,te=ee;function I(e){return w(e),{type:ye,contents:e}}function y(e,t={}){return w(e),te(t.expandedStates,!0),{type:Ae,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function O(e,t="",n={}){return w(e),t!==""&&w(t),{type:Oe,breakContents:e,flatContents:t,groupId:n.groupId}}var De={type:xe},ge={type:q,hard:!0},C={type:q},p={type:q,soft:!0},h=[ge,De];function E(e,t){w(e),te(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}function V(e){return(t,n,r)=>{let i=!!(r!=null&&r.backwards);if(n===!1)return!1;let{length:s}=t,o=n;for(;o>=0&&o<s;){let c=t.charAt(o);if(e instanceof RegExp){if(!e.test(c))return o}else if(!e.includes(c))return o;i?o--:o++}return o===-1||o===s?o:!1}}var Ht=V(/\s/u),ne=V(" \t"),_e=V(",; \t"),ke=V(/[^\n\r]/u);function Se(e,t,n){let r=!!(n!=null&&n.backwards);if(t===!1)return!1;let i=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&i===`
|
|
3
3
|
`)return t-2;if(i===`
|
|
4
4
|
`||i==="\r"||i==="\u2028"||i==="\u2029")return t-1}else{if(i==="\r"&&e.charAt(t+1)===`
|
|
5
5
|
`)return t+2;if(i===`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fp as h}from"./chunk-1rafe6f5.js";import"./chunk-hsmtjb4d.js";import"./chunk-7nh8vjx4.js";import"./chunk-cqtkxwd8.js";import"./chunk-mfg4stzn.js";import"./chunk-zgj7jx8k.js";import"./chunk-0mdmqtfr.js";import"./chunk-0xf12tf3.js";var v=(q)=>{return h({baseURL:"https://gateway.ai.cloudflare.com/v1/compat",name:"Unified",...q||{}})},x=v();export{x as unified,v as createUnified};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-0xf12tf3.js";var e={"ui.sessionReview.title":"Cambios de la sesi\xF3n","ui.sessionReview.title.lastTurn":"Cambios del \xFAltimo turno","ui.sessionReview.diffStyle.unified":"Unificado","ui.sessionReview.diffStyle.split":"Dividido","ui.sessionReview.openFile":"Abrir archivo","ui.sessionReview.selection.line":"l\xEDnea {{line}}","ui.sessionReview.selection.lines":"l\xEDneas {{start}}-{{end}}","ui.sessionReview.expandAll":"Expandir todo","ui.sessionReview.collapseAll":"Colapsar todo","ui.sessionReview.change.added":"A\xF1adido","ui.sessionReview.change.removed":"Eliminado","ui.sessionReview.change.modified":"Modificado","ui.sessionReview.image.loading":"Cargando...","ui.sessionReview.image.placeholder":"Imagen","ui.sessionReview.largeDiff.title":"Diff demasiado grande para renderizar","ui.sessionReview.largeDiff.meta":"L\xEDmite: {{limit}} l\xEDneas modificadas. Actual: {{current}} l\xEDneas modificadas.","ui.sessionReview.largeDiff.renderAnyway":"Renderizar de todos modos","ui.fileMedia.kind.image":"imagen","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Archivo de {{kind}} eliminado","ui.fileMedia.state.loading":"Cargando archivo de {{kind}}","ui.fileMedia.state.error":"Error en el archivo de {{kind}}","ui.fileMedia.state.unavailable":"Archivo de {{kind}} no disponible","ui.fileMedia.binary.title":"Archivo binario","ui.fileMedia.binary.description.path":"No se puede mostrar {{path}} porque es un archivo binario.","ui.fileMedia.binary.description.default":"No se puede mostrar este archivo porque es un archivo binario.","ui.lineComment.label.prefix":"Comentar en ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Comentando en ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"A\xF1adir comentario","ui.lineComment.submit":"Comentar","ui.sessionTurn.steps.show":"Mostrar pasos","ui.sessionTurn.steps.hide":"Ocultar pasos","ui.sessionTurn.summary.response":"Respuesta","ui.sessionTurn.diff.showMore":"Mostrar m\xE1s cambios ({{count}})","ui.sessionTurn.retry.retrying":"reintentando","ui.sessionTurn.retry.inSeconds":"en {{seconds}}s","ui.sessionTurn.retry.attempt":"intento #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - intento #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini est\xE1 demasiado saturado","ui.sessionTurn.error.freeUsageExceeded":"L\xEDmite de uso gratuito excedido","ui.sessionTurn.error.addQredits":"A\xF1adir cr\xE9ditos","ui.sessionTurn.status.delegating":"Delegando trabajo","ui.sessionTurn.status.planning":"Planificando siguientes pasos","ui.sessionTurn.status.gatheringContext":"Explorando","ui.sessionTurn.status.gatheredContext":"Explorado","ui.sessionTurn.status.searchingCodebase":"Buscando en la base de c\xF3digo","ui.sessionTurn.status.searchingWeb":"Buscando en la web","ui.sessionTurn.status.makingEdits":"Realizando ediciones","ui.sessionTurn.status.runningCommands":"Ejecutando comandos","ui.sessionTurn.status.thinking":"Pensando","ui.sessionTurn.status.thinkingWithTopic":"Pensando - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Recopilando pensamientos","ui.sessionTurn.status.consideringNextSteps":"Considerando siguientes pasos","ui.messagePart.questions.dismissed":"Preguntas descartadas","ui.messagePart.compaction":"Sesi\xF3n compactada","ui.messagePart.context.read.one":"{{count}} lectura","ui.messagePart.context.read.other":"{{count}} lecturas","ui.messagePart.context.search.one":"{{count}} b\xFAsqueda","ui.messagePart.context.search.other":"{{count}} b\xFAsquedas","ui.messagePart.context.list.one":"{{count}} lista","ui.messagePart.context.list.other":"{{count}} listas","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Editar","ui.messagePart.title.write":"Escribir","ui.messagePart.option.typeOwnAnswer":"Escribe tu propia respuesta","ui.messagePart.review.title":"Revisa tus respuestas","ui.list.loading":"Cargando","ui.list.empty":"Sin resultados","ui.list.clearFilter":"Borrar filtro","ui.list.emptyWithFilter.prefix":"Sin resultados para","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Nuevo mensaje","ui.textField.copyToClipboard":"Copiar al portapapeles","ui.textField.copyLink":"Copiar enlace","ui.textField.copied":"Copiado","ui.imagePreview.alt":"Vista previa de imagen","ui.scrollView.ariaLabel":"contenido desplazable","ui.tool.read":"Leer","ui.tool.loaded":"Cargado","ui.tool.list":"Listar","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"B\xFAsqueda web","ui.tool.codesearch":"B\xFAsqueda de c\xF3digo","ui.tool.shell":"Shell","ui.tool.patch":"Parche","ui.tool.todos":"Tareas","ui.tool.todos.read":"Leer tareas","ui.tool.questions":"Preguntas","ui.tool.agent":"Agente {{type}}","ui.tool.agent.default":"Agente","ui.common.file.one":"archivo","ui.common.file.other":"archivos","ui.common.question.one":"pregunta","ui.common.question.other":"preguntas","ui.common.add":"A\xF1adir","ui.common.back":"Atr\xE1s","ui.common.cancel":"Cancelar","ui.common.confirm":"Confirmar","ui.common.dismiss":"Descartar","ui.common.close":"Cerrar","ui.common.next":"Siguiente","ui.common.submit":"Enviar","ui.permission.deny":"Denegar","ui.permission.allowAlways":"Permitir siempre","ui.permission.allowOnce":"Permitir una vez","ui.message.expand":"Expandir mensaje","ui.message.collapse":"Colapsar mensaje","ui.message.copy":"Copiar","ui.message.copyMessage":"Copiar mensaje","ui.message.forkMessage":"Bifurcar a nueva sesi\xF3n","ui.message.revertMessage":"Restablecer a este punto","ui.message.copyResponse":"Copiar respuesta","ui.message.copied":"\xA1Copiado!","ui.message.interrupted":"Interrumpido","ui.message.queued":"En cola","ui.message.attachment.alt":"adjunto","ui.patch.action.deleted":"Eliminado","ui.patch.action.created":"Creado","ui.patch.action.moved":"Movido","ui.patch.action.patched":"Parcheado","ui.question.subtitle.answered":"{{count}} respondidas","ui.question.answer.none":"(sin respuesta)","ui.question.review.notAnswered":"(no respondida)","ui.question.multiHint":"Selecciona todas las que correspondan","ui.question.singleHint":"Selecciona una respuesta","ui.question.custom.placeholder":"Escribe tu respuesta...","ui.fileSearch.placeholder":"Buscar","ui.fileSearch.previousMatch":"Anterior","ui.fileSearch.nextMatch":"Siguiente","ui.fileSearch.close":"Cerrar b\xFAsqueda","ui.tool.task":"Tarea","ui.tool.skill":"Habilidad","ui.basicTool.called":"Llamado `{{tool}}`","ui.toolErrorCard.failed":"Fall\xF3","ui.toolErrorCard.copyError":"Copiar error","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s"};export{e as dict};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{As as h,Bs as i,Cs as j,Ds as k,Es as l,Gs as m,Hs as n,ws as e,xs as f,ys as g}from"./chunk-3be70hxy.js";import{Ms as d}from"./chunk-9a9qcvtz.js";import"./chunk-1sejtx9a.js";import{xt as c}from"./chunk-dpm5x19e.js";import"./chunk-vvmvryh1.js";import{Vt as b}from"./chunk-6g3bzap8.js";import{eu as a}from"./chunk-mrh5q4s6.js";import"./chunk-w623r5kb.js";import"./chunk-zgj7jx8k.js";import"./chunk-0mdmqtfr.js";import"./chunk-00krzh3y.js";import"./chunk-hk8m8vax.js";import"./chunk-0xf12tf3.js";export{h as getEnvInfo,c as Wildcard,n as Token,m as Rpc,d as Process,b as Log,l as Lock,k as Locale,j as LocalContext,i as Keybind,a as Filesystem,g as EffectUtil,f as Color,e as Archive};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{wf as j}from"./chunk-4wzv2v36.js";import{If as w,Jf as D}from"./chunk-vvcyvdnk.js";import{Fq as $,eq as Q,yq as Z}from"./chunk-hsmtjb4d.js";import{Rq as P}from"./chunk-7nh8vjx4.js";import"./chunk-cqtkxwd8.js";import"./chunk-mfg4stzn.js";import"./chunk-zgj7jx8k.js";import"./chunk-0mdmqtfr.js";import{rP as G}from"./chunk-0xf12tf3.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};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{dlopen as H,ptr as V}from"bun:ffi";var W=-10,M=1,g=()=>H("kernel32.dll",{GetStdHandle:{args:["i32"],returns:"ptr"},GetConsoleMode:{args:["ptr","ptr"],returns:"i32"},SetConsoleMode:{args:["ptr","u32"],returns:"i32"},FlushConsoleInputBuffer:{args:["ptr"],returns:"i32"}}),j;function X(){if(process.platform!=="win32")return!1;try{return j??=g(),!0}catch{return!1}}function B(){if(process.platform!=="win32")return;if(!process.stdin.isTTY)return;if(!X())return;let q=j.symbols.GetStdHandle(W),z=new Uint32Array(1);if(j.symbols.GetConsoleMode(q,V(z))===0)return;let x=z[0];if((x&M)===0)return;j.symbols.SetConsoleMode(q,x&~M)}function C(){if(process.platform!=="win32")return;if(!process.stdin.isTTY)return;if(!X())return;let q=j.symbols.GetStdHandle(W);j.symbols.FlushConsoleInputBuffer(q)}var F;function O(){if(process.platform!=="win32")return;if(!process.stdin.isTTY)return;if(!X())return;if(F)return F;let q=process.stdin,z=q.setRawMode,x=j.symbols.GetStdHandle(W),G=new Uint32Array(1);if(j.symbols.GetConsoleMode(x,V(G))===0)return;let y=G[0],Q=()=>{if(j.symbols.GetConsoleMode(x,V(G))===0)return;let K=G[0];if((K&M)===0)return;j.symbols.SetConsoleMode(x,K&~M)},Y=()=>{Q(),setImmediate(Q)},J;if(typeof z==="function")J=(K)=>{let v=z.call(q,K);return Y(),v},q.setRawMode=J;Y();let Z=setInterval(Q,100);Z.unref();let $=!1;return F=()=>{if($)return;if($=!0,clearInterval(Z),J&&q.setRawMode===J)q.setRawMode=z;j.symbols.SetConsoleMode(x,y),F=void 0},F}
|
|
3
|
-
export{B as
|
|
3
|
+
export{B as D,C as E,O as F};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{wt as Y}from"./chunk-dpm5x19e.js";import{It as p,Jt as B,Kt as O,Lt as G}from"./chunk-6g3bzap8.js";import{tP as N}from"./chunk-0xf12tf3.js";var $={free:{providerID:"qlex",modelID:"free"},adaptive:{providerID:"qlex",modelID:"adaptive"},fast:{providerID:"qlex",modelID:"fast"},economical:{providerID:"qlex",modelID:"economical"},planner:{providerID:"qlex",modelID:"planner"},repair:{providerID:"qlex",modelID:"repair"},"max-int":{providerID:"qlex",modelID:"max-int"},orchestrated:{providerID:"qlex",modelID:"orchestrated"}},X=["free","fast","economical","adaptive","planner","repair","max-int","orchestrated"],Q=new Set(["decisions","quick-decisions"]);function u(x){let J=x?.split("/").at(-1);return J!==void 0&&Q.has(J)}var V={free:"Free (no cost)",adaptive:"Adaptive",fast:"Fast",economical:"Economy",planner:"Planner",repair:"Repair","max-int":"Max intelligence",orchestrated:"Orchestrated"},M={free:{output:128000,recommendedStep:32000,context:262144,reasoning:!0,reasoningReserve:8192,visibleOutputFloor:512,recommendedTotal:9600,viableTotalFloor:9600},fast:{output:65536,recommendedStep:50000,context:1048576,reasoning:!1,reasoningReserve:0,visibleOutputFloor:2048,recommendedTotal:50000,viableTotalFloor:2048},economical:{output:209715,recommendedStep:32000,context:1048576,reasoning:!0,reasoningReserve:8192,visibleOutputFloor:512,recommendedTotal:9600,viableTotalFloor:9600},adaptive:{output:128000,recommendedStep:32000,context:1050000,reasoning:!0,reasoningReserve:8192,visibleOutputFloor:2048,recommendedTotal:32000,viableTotalFloor:2048},planner:{output:128000,recommendedStep:32000,context:1050000,reasoning:!1,reasoningReserve:0,visibleOutputFloor:2048,recommendedTotal:32000,viableTotalFloor:2048},repair:{output:128000,recommendedStep:32000,context:1050000,reasoning:!1,reasoningReserve:0,visibleOutputFloor:2048,recommendedTotal:32000,viableTotalFloor:2048},"max-int":{output:128000,recommendedStep:32000,context:1e6,reasoning:!0,reasoningReserve:8192,visibleOutputFloor:2048,recommendedTotal:32000,viableTotalFloor:2048},orchestrated:{output:128000,recommendedStep:32000,context:200000,reasoning:!1,reasoningReserve:0,visibleOutputFloor:2048,recommendedTotal:32000,viableTotalFloor:2048}},H={},F="pending",P=new Set;function h(){return F}function b(){F="pending",w()}function y(x){return P.add(x),()=>P.delete(x)}function w(){for(let x of[...P])try{x()}catch{}}function q(){for(let x of Object.keys(H))delete H[x];F="unavailable",w()}function f(x){return typeof x==="number"&&Number.isFinite(x)&&x>=0&&x<=10}function c(x){if(x===void 0){q();return}let J=x!==null&&typeof x==="object"&&!Array.isArray(x)?x:void 0;if(J?.success===!1){q();return}let j=J?.success===!0&&Object.prototype.hasOwnProperty.call(J,"data")?J.data:x,W={};if(j===null||typeof j!=="object"||Array.isArray(j)){q();return}for(let[K,Z]of Object.entries(j)){if(!Z||typeof Z!=="object"||Array.isArray(Z)){q();return}let z=Z;if(!f(z.intelligence)||!f(z.speed)||!f(z.cost)){q();return}W[K]={intelligence:z.intelligence,speed:z.speed,cost:z.cost}}for(let K of Object.keys(H))delete H[K];Object.assign(H,W),F="live",w()}function C(x){if(!Array.isArray(x)||x.length===0)return;let J=x.filter((K)=>!Q.has(K.id));if(J.length===0){for(let K of Q)delete $[K],delete V[K];return}let j={},W={};for(let K of J){let Z=$[K.id],z=K.modelID??Z?.modelID??K.id;j[K.id]={providerID:K.providerID??Z?.providerID??"qlex",modelID:u(z)?Z?.modelID??K.id:z},W[K.id]=K.label??V[K.id]??K.id}for(let K of Object.keys($))delete $[K];Object.assign($,j);for(let K of Object.keys(V))delete V[K];Object.assign(V,W)}var D={};N(D,{tiers:()=>d,tierRatingsState:()=>h,tierRatings:()=>E,tierBudgetFacts:()=>v,streamUrl:()=>m,streamBaseUrl:()=>R,sanitizeUpstreamError:()=>s,qlexProviderMeta:()=>n,onTierRatingsChange:()=>y,omniqueryBaseUrl:()=>l,mergeLiveTiers:()=>o,mergeLiveTierRatings:()=>_,markTierRatingsUnavailable:()=>q,loadLiveRatings:()=>S,isDecisionTier:()=>k,evaluatePermission:()=>I,copy:()=>r,beginTierRatingsLoad:()=>b,bashPrefixWith:()=>T,assertChatTierSupported:()=>g,TIER_RATINGS:()=>H,AGENT_PROMPT_NAMES:()=>a});var U=3,L=[250,750];async function S(x){for(let J=0;J<U;J++){let j=await x();if(j!==void 0)return j;let W=L[J];if(W!==void 0)await new Promise((K)=>setTimeout(K,W))}return}function o(x){C(x)}function _(x){c(x)}function d(){let x=new Set(X);return[...X.filter((j)=>$[j]!==void 0),...Object.keys($).filter((j)=>!x.has(j))].flatMap((j)=>{if(Q.has(j))return[];let W=$[j];if(!W)return[];return[{id:j,label:V[j]??j,providerID:W.providerID,modelID:W.modelID}]})}function v(x){return M[x]}function E(){return H}function k(x){let J=x.startsWith("qlex/")?x.slice(5):x;return Q.has(J)}function g(x){if(k(x))throw Error(`Tier "${x}" is not available for chat. QitQode does not use decision-only models. Use one of the available chat tiers: ${X.join(", ")}.`);if(!$[x])throw Error(`Tier "${x}" is not a recognized chat tier. Available chat tiers: ${X.join(", ")}.`)}function I(x,J,...j){return j.flat().findLast((Z)=>Y(x,Z.permission)&&Y(J,Z.pattern))??{action:"ask",permission:x,pattern:"*"}}function T(x,J){for(let j=J.length;j>0;j--){let W=J.slice(0,j).join(" "),K=x[W];if(K!==void 0)return J.slice(0,K)}if(J.length===0)return[];return J.slice(0,1)}function A(){return(process.env.QITQODE_BACKEND_URL?.trim()||p).replace(/\/+$/,"")}function m(){return`${A()}/streamTier`}function R(){return new URL(m()).origin}function l(){return A()}function n(){return B}function s(x){return O(x)}function r(){return G}var a=["generate","explore","dream","distill","summary","compaction","title"];export{$ as at,D as bt};
|