@qitqode/qitqode-android-arm64 0.2.6 → 0.2.7
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-ztyy3ga3.js → chunk-01e3v1xz.js} +2 -2
- package/bundle/{chunk-p54bzjtv.js → chunk-060wbpz4.js} +1 -1
- package/bundle/{chunk-ypdt9mmr.js → chunk-0am156m5.js} +2 -2
- package/bundle/{chunk-gjd3wf8b.js → chunk-0bgssfvq.js} +1 -1
- package/bundle/{chunk-dnnkq5y4.js → chunk-0crgymtr.js} +2 -2
- package/bundle/chunk-0dzpjk7x.js +2 -0
- package/bundle/{chunk-bwbqkfv0.js → chunk-0ffmwhw7.js} +1 -1
- package/bundle/{chunk-h62chdmw.js → chunk-0g0jpw0z.js} +1 -1
- package/bundle/{chunk-mn9end71.js → chunk-0ggvqmnm.js} +1 -1
- package/bundle/{chunk-y7hgevfv.js → chunk-0gsw04hw.js} +2 -2
- package/bundle/{chunk-tkrwcjkr.js → chunk-0qpqd7nz.js} +2 -2
- package/bundle/{chunk-nty5z2cj.js → chunk-0tqmm8b8.js} +1 -1
- package/bundle/chunk-12fwmmcp.js +2 -0
- package/bundle/{chunk-8yvx3pgy.js → chunk-14d301ze.js} +1 -1
- package/bundle/{chunk-ngfxxfem.js → chunk-16srrzjr.js} +1 -1
- package/bundle/{chunk-45a4n21f.js → chunk-19pspc1p.js} +1 -1
- package/bundle/chunk-1a95ysv3.js +2 -0
- package/bundle/chunk-1akh8pk2.js +2 -0
- package/bundle/{chunk-5tky3csh.js → chunk-1ay97v74.js} +1 -1
- package/bundle/{chunk-6ar91jvd.js → chunk-1c0yp2gv.js} +1 -1
- package/bundle/{chunk-2md6sx8d.js → chunk-1rgt2vmt.js} +1 -1
- package/bundle/{chunk-3kpse7zy.js → chunk-1vpx7szf.js} +1 -1
- package/bundle/chunk-22qetqnp.js +2 -0
- package/bundle/{chunk-tm34qp8j.js → chunk-2bjfz4fb.js} +1 -1
- package/bundle/{chunk-a7rp46yt.js → chunk-2c26kxp4.js} +5 -5
- package/bundle/{chunk-xe69cnsk.js → chunk-2c41dncf.js} +1 -1
- package/bundle/{chunk-fyhqp4pb.js → chunk-2cjfezfr.js} +1 -1
- package/bundle/chunk-2d2a92kj.js +2 -0
- package/bundle/{chunk-m5dm7a1t.js → chunk-2pex3ak9.js} +1 -1
- package/bundle/chunk-2qrvkef8.js +2 -0
- package/bundle/chunk-2tppw8j9.js +2 -0
- package/bundle/chunk-2y87m7pe.js +2 -0
- package/bundle/{chunk-sfw5qddj.js → chunk-33jcxsbe.js} +1 -1
- package/bundle/{chunk-d0x5pbkm.js → chunk-3623jvcm.js} +1 -1
- package/bundle/{chunk-953pqp3w.js → chunk-368jx5dp.js} +1 -1
- package/bundle/chunk-3ft1dn9j.js +2 -0
- package/bundle/{chunk-rn83r0js.js → chunk-3k7016c2.js} +1 -1
- package/bundle/chunk-3rgct4bd.js +11 -0
- package/bundle/{chunk-68v3b6ns.js → chunk-3xdmxm5t.js} +2 -2
- package/bundle/{chunk-xwdxgg16.js → chunk-42q8vj0w.js} +1 -1
- package/bundle/{chunk-yhj01dz9.js → chunk-438faz6b.js} +2 -2
- package/bundle/chunk-4656qm05.js +2 -0
- package/bundle/chunk-46knch5z.js +2 -0
- package/bundle/{chunk-n23d0q00.js → chunk-4bewbvvr.js} +1 -1
- package/bundle/{chunk-pmg53fdd.js → chunk-4byvnx78.js} +1 -1
- package/bundle/chunk-4ftjx7ss.js +2 -0
- package/bundle/{chunk-jqk3v8d6.js → chunk-4fvbexr8.js} +1 -1
- package/bundle/{chunk-k1nh5sd2.js → chunk-4fy08jcj.js} +1 -1
- package/bundle/{chunk-0smnwqk6.js → chunk-4j76bf4j.js} +2 -2
- package/bundle/{chunk-5nrc5rhh.js → chunk-4jpab7ag.js} +1 -1
- package/bundle/{chunk-43ttzy29.js → chunk-4ngmjk8j.js} +2 -2
- package/bundle/{chunk-vnrjk2be.js → chunk-4rpgwgx9.js} +1 -1
- package/bundle/chunk-4sgy87h5.js +2 -0
- package/bundle/{chunk-65bmsp2t.js → chunk-4vzjdmts.js} +1 -1
- package/bundle/{chunk-zc0cdvcv.js → chunk-4zhrg3rv.js} +2 -2
- package/bundle/{chunk-5pzs51sp.js → chunk-52rdms56.js} +1 -1
- package/bundle/chunk-54hktc8h.js +2 -0
- package/bundle/{chunk-smznrv7k.js → chunk-55way0em.js} +1 -1
- package/bundle/{chunk-k4gsktts.js → chunk-59kk0mce.js} +1 -1
- package/bundle/chunk-59m55866.js +2 -0
- package/bundle/{chunk-q3h42a94.js → chunk-5b3v1x2c.js} +2 -2
- package/bundle/chunk-5js5nw7r.js +2 -0
- package/bundle/{chunk-f3zmdfqa.js → chunk-5nhwqg7c.js} +1 -1
- package/bundle/{chunk-tzb26ntq.js → chunk-5r05d901.js} +3 -3
- package/bundle/{chunk-avefgbjg.js → chunk-5zh91zk2.js} +2 -2
- package/bundle/chunk-61jn7908.js +2 -0
- package/bundle/chunk-61txdqz1.js +2 -0
- package/bundle/chunk-668g9wkg.js +2 -0
- package/bundle/chunk-6frhjpmt.js +2 -0
- package/bundle/{chunk-920z7g7j.js → chunk-6gqs1k7m.js} +1 -1
- package/bundle/chunk-6k14c8x1.js +5 -0
- package/bundle/{chunk-g42krp0z.js → chunk-6nxebcf8.js} +1 -1
- package/bundle/chunk-6r1jpj0h.js +2 -0
- package/bundle/{chunk-7bcm7gg1.js → chunk-6r48fje7.js} +1 -1
- package/bundle/{chunk-bqn6bqws.js → chunk-6ychs4wx.js} +1 -1
- package/bundle/{chunk-21rq4592.js → chunk-705xnxbc.js} +2 -2
- package/bundle/chunk-73fn4dqd.js +2 -0
- package/bundle/{chunk-q3nvzhyh.js → chunk-73xryfgn.js} +2 -2
- package/bundle/{chunk-q9tgdghx.js → chunk-76h0f86f.js} +1 -1
- package/bundle/{chunk-d51908mv.js → chunk-77h8tytk.js} +1 -1
- package/bundle/chunk-78j2c2je.js +2 -0
- package/bundle/chunk-78jt24ht.js +2 -0
- package/bundle/chunk-7j2vpavd.js +2 -0
- package/bundle/chunk-7nkxgm72.js +2 -0
- package/bundle/{chunk-f31yvp20.js → chunk-7p6mxch0.js} +1 -1
- package/bundle/{chunk-mhhtf0v3.js → chunk-7sq5dyv1.js} +1 -1
- package/bundle/{chunk-804vmbcd.js → chunk-7x2q1w0f.js} +1 -1
- package/bundle/{chunk-ac7482n2.js → chunk-7z96r2px.js} +2 -2
- package/bundle/chunk-84pjdenq.js +2 -0
- package/bundle/chunk-859pkecc.js +2 -0
- package/bundle/{chunk-y0527cg0.js → chunk-8hmt3avx.js} +1 -1
- package/bundle/{chunk-cng61dby.js → chunk-8jvfqh3b.js} +1 -1
- package/bundle/{chunk-8wwdrwf2.js → chunk-8p0t8qah.js} +1 -1
- package/bundle/chunk-8p249svd.js +2 -0
- package/bundle/{chunk-z1932c3f.js → chunk-8rfqv5he.js} +1 -1
- package/bundle/chunk-8rqbx4jw.js +2 -0
- package/bundle/chunk-8s3krfsm.js +2 -0
- package/bundle/{chunk-pb30kkbs.js → chunk-93pmbdz7.js} +6 -6
- package/bundle/{chunk-vcygx6hs.js → chunk-95am490c.js} +2 -2
- package/bundle/{chunk-k3dacdp5.js → chunk-9a6p1gdn.js} +8 -8
- package/bundle/chunk-9aafddkw.js +3 -0
- package/bundle/{chunk-0xrb12s8.js → chunk-9g9katgy.js} +2 -2
- package/bundle/{chunk-24rkf2gk.js → chunk-9qzwmt76.js} +1 -1
- package/bundle/chunk-9sv53kb4.js +2 -0
- package/bundle/chunk-9wbe0dkx.js +2 -0
- package/bundle/{chunk-bne5w117.js → chunk-9xxnwb33.js} +4 -4
- package/bundle/{chunk-fjbv3jht.js → chunk-a610qd3x.js} +1 -1
- package/bundle/{chunk-5c2438af.js → chunk-a76w2jwm.js} +1 -1
- package/bundle/{chunk-at22twxx.js → chunk-aa2n02qk.js} +2 -2
- package/bundle/{chunk-4pshnq6g.js → chunk-abv0fskc.js} +1 -1
- package/bundle/{chunk-7g66qc1v.js → chunk-acd72413.js} +2 -2
- package/bundle/{chunk-wkg3c643.js → chunk-ae7b11np.js} +2 -2
- package/bundle/{chunk-gy21fw82.js → chunk-agqss9ga.js} +2 -2
- package/bundle/chunk-aj5z8qd5.js +2 -0
- package/bundle/{chunk-8e4s6nc2.js → chunk-ajp53ksp.js} +1 -1
- package/bundle/{chunk-j164q40b.js → chunk-amp6mvbp.js} +2 -2
- package/bundle/{chunk-97q2t1yz.js → chunk-aqcpk2vg.js} +1 -1
- package/bundle/chunk-b0c2mvc0.js +2 -0
- package/bundle/{chunk-kth84vdn.js → chunk-b6eypnbj.js} +1 -1
- package/bundle/chunk-b79z8f94.js +2 -0
- package/bundle/chunk-bbwcsdy9.js +2 -0
- package/bundle/chunk-bbzjdbb9.js +2 -0
- package/bundle/{chunk-6evh2ke8.js → chunk-bd505nsd.js} +1 -1
- package/bundle/{chunk-p4027t94.js → chunk-bd84t3fb.js} +1 -1
- package/bundle/chunk-bh4s1yct.js +2 -0
- package/bundle/{chunk-rrv0n73b.js → chunk-bk7f59fn.js} +1 -1
- package/bundle/{chunk-venprxdp.js → chunk-bn71wqqf.js} +1 -1
- package/bundle/{chunk-j9h1sp4g.js → chunk-c3szabpf.js} +2 -2
- package/bundle/{chunk-z6sbjvtv.js → chunk-c6cajbyj.js} +1 -1
- package/bundle/{chunk-p6crzjtf.js → chunk-c8prg3jx.js} +2 -2
- package/bundle/chunk-crqcppwq.js +2 -0
- package/bundle/{chunk-t239rvej.js → chunk-cth373se.js} +2 -2
- package/bundle/chunk-d09zpgj1.js +2 -0
- package/bundle/{chunk-t5r3w9e1.js → chunk-d1tb1jd0.js} +1 -1
- package/bundle/{chunk-mmjgf680.js → chunk-dbpkq7ba.js} +2 -2
- package/bundle/{chunk-pe2xdkez.js → chunk-dd4qnh8s.js} +2 -2
- package/bundle/{chunk-p169ee92.js → chunk-defj5zs6.js} +1 -1
- package/bundle/chunk-dexcptaz.js +3 -0
- package/bundle/chunk-dgqkak21.js +2 -0
- package/bundle/{chunk-jww55nk9.js → chunk-dgva3y5v.js} +1 -1
- package/bundle/chunk-dhgvh7c3.js +2 -0
- package/bundle/{chunk-mhtxp66q.js → chunk-djqxbnwc.js} +2 -2
- package/bundle/chunk-dmd101ja.js +2 -0
- package/bundle/{chunk-vygkwwjd.js → chunk-drnj1a14.js} +2 -2
- package/bundle/{chunk-g3wvtyw3.js → chunk-dt1wwt7m.js} +1 -1
- package/bundle/{chunk-cz5vta94.js → chunk-dw70wds9.js} +1 -1
- package/bundle/{chunk-xdd3553a.js → chunk-dw7yrk1g.js} +1 -1
- package/bundle/chunk-dwb39jdf.js +2 -0
- package/bundle/chunk-dx4zxex7.js +2 -0
- package/bundle/{chunk-ph8hn1wt.js → chunk-dy2k5rdx.js} +2 -2
- package/bundle/{chunk-wwdpw27v.js → chunk-dz3bec8g.js} +1 -1
- package/bundle/{chunk-t0761rhq.js → chunk-e0zb6sw6.js} +2 -2
- package/bundle/chunk-e2pqvscp.js +2 -0
- package/bundle/{chunk-vsz4s6zt.js → chunk-e4g4mvak.js} +1 -1
- package/bundle/{chunk-fhqfqd5v.js → chunk-eeq0krp7.js} +2 -2
- package/bundle/chunk-efe6kj3d.js +2 -0
- package/bundle/{chunk-qp1n7kwe.js → chunk-egkhynj5.js} +1 -1
- package/bundle/chunk-emac0dss.js +2 -0
- package/bundle/chunk-encfnt6w.js +2 -0
- package/bundle/{chunk-y29ejqg2.js → chunk-etv6c77a.js} +1 -1
- package/bundle/{chunk-32j0q58h.js → chunk-eyr5ymt8.js} +1 -1
- package/bundle/{chunk-r9w0thdk.js → chunk-f2pv705d.js} +1 -1
- package/bundle/{chunk-5w76kdjr.js → chunk-f4mnp6xd.js} +1 -1
- package/bundle/{chunk-xdteq9bd.js → chunk-f84hw65n.js} +1 -1
- package/bundle/chunk-fg2nyz2x.js +2 -0
- package/bundle/chunk-ga6wc979.js +2 -0
- package/bundle/{chunk-hqbbs9dm.js → chunk-gbxf6e5d.js} +3 -3
- package/bundle/chunk-gdew7bwm.js +2 -0
- package/bundle/{chunk-w9gzfsy7.js → chunk-gdj7mqrd.js} +2 -2
- package/bundle/chunk-ge19ff9d.js +2 -0
- package/bundle/{chunk-bzebyyfr.js → chunk-ghap1n1m.js} +4 -4
- package/bundle/chunk-gt0q07xq.js +2 -0
- package/bundle/{chunk-7mppvhv9.js → chunk-gwrnxcdn.js} +2 -2
- package/bundle/{chunk-e8p92vz4.js → chunk-gww0skmn.js} +2 -2
- package/bundle/chunk-h4dnjfr2.js +2 -0
- package/bundle/{chunk-has2rz35.js → chunk-h7658zxy.js} +1 -1
- package/bundle/chunk-h8fx619t.js +2 -0
- package/bundle/{chunk-313zqzc1.js → chunk-hfefq104.js} +1 -1
- package/bundle/{chunk-ff548b0j.js → chunk-hhk2sp5n.js} +2 -2
- package/bundle/{chunk-47k5jy1p.js → chunk-hqjc4wgg.js} +2 -2
- package/bundle/{chunk-48r70n4s.js → chunk-hrtze4c5.js} +1 -1
- package/bundle/{chunk-r5zy4za0.js → chunk-hwsqqkrv.js} +2 -2
- package/bundle/{chunk-ehb4hd9c.js → chunk-j6xmgn63.js} +1 -1
- package/bundle/chunk-jnvb3s7f.js +2 -0
- package/bundle/chunk-jrq2xw6e.js +2 -0
- package/bundle/chunk-jwckmhjm.js +2 -0
- package/bundle/{chunk-99s035f0.js → chunk-jxkrhrp0.js} +2 -2
- package/bundle/chunk-jz27ypm5.js +2 -0
- package/bundle/chunk-jzrs878d.js +2 -0
- package/bundle/chunk-jzx700tb.js +2 -0
- package/bundle/chunk-k1x8469r.js +3 -0
- package/bundle/{chunk-bkct64rs.js → chunk-k3g28tbw.js} +1 -1
- package/bundle/{chunk-wy3a4cab.js → chunk-k6zwfstj.js} +1 -1
- package/bundle/{chunk-0qd3567w.js → chunk-kfj37631.js} +1 -1
- package/bundle/{chunk-khzzmyk2.js → chunk-kmzpeq8k.js} +1 -1
- package/bundle/{chunk-bd21p9zz.js → chunk-kre93a89.js} +2 -2
- package/bundle/{chunk-j8fcfhr2.js → chunk-kry4vcrf.js} +2 -2
- package/bundle/chunk-ktp2b4t4.js +2 -0
- package/bundle/chunk-m483jvn8.js +2 -0
- package/bundle/chunk-makecdh6.js +8 -0
- package/bundle/{chunk-tr6rdr6h.js → chunk-mbbxedsq.js} +2 -2
- package/bundle/chunk-menbcmkq.js +2 -0
- package/bundle/{chunk-hwrrrbqd.js → chunk-mghnkwp8.js} +1 -1
- package/bundle/{chunk-pr7z5dj8.js → chunk-mhxyv9c8.js} +1 -1
- package/bundle/{chunk-k5q9px67.js → chunk-mjrqhbp2.js} +1 -1
- package/bundle/{chunk-9zm6r55d.js → chunk-msh249db.js} +2 -2
- package/bundle/{chunk-nmzrrqgb.js → chunk-n0g4983e.js} +1 -1
- package/bundle/{chunk-dnsh1v42.js → chunk-n4qxj391.js} +2 -2
- package/bundle/{chunk-ptqk1j2r.js → chunk-n5p7cn4w.js} +1 -1
- package/bundle/{chunk-5zkj5xv9.js → chunk-n9twhc5d.js} +2 -2
- package/bundle/{chunk-p5be5ddp.js → chunk-na1wr2qf.js} +1 -1
- package/bundle/{chunk-4agaj51z.js → chunk-nbckdba0.js} +1 -1
- package/bundle/{chunk-ezrqhqkp.js → chunk-nftbj8g9.js} +1 -1
- package/bundle/{chunk-d7nsd979.js → chunk-nfzpegqx.js} +1 -1
- package/bundle/chunk-np8h66t0.js +2 -0
- package/bundle/{chunk-v6v9xn81.js → chunk-npzx3yd5.js} +1 -1
- package/bundle/chunk-nr2j8ytn.js +3 -0
- package/bundle/{chunk-w46g7kdq.js → chunk-nrk29616.js} +2 -2
- package/bundle/{chunk-fsqses4g.js → chunk-ns8xnkjb.js} +2 -2
- package/bundle/{chunk-7vmx8bg9.js → chunk-ntpn0w9m.js} +2 -2
- package/bundle/chunk-nwwmns3w.js +2 -0
- package/bundle/{chunk-ksme3gj1.js → chunk-p40z6510.js} +1 -1
- package/bundle/{chunk-3ktzxj69.js → chunk-p847g35y.js} +1 -1
- package/bundle/{chunk-vf492zs6.js → chunk-p8ak162p.js} +1 -1
- package/bundle/chunk-pe5dpzec.js +2 -0
- package/bundle/{chunk-bbng1cea.js → chunk-pf3nqf00.js} +1 -1
- package/bundle/{chunk-9hz56z6a.js → chunk-ppy0jy6j.js} +1 -1
- package/bundle/{chunk-et3804wr.js → chunk-prbxhnza.js} +1 -1
- package/bundle/{chunk-nrat6ncm.js → chunk-ptwex14s.js} +1 -1
- package/bundle/{chunk-qey1efpx.js → chunk-q3pt4p9f.js} +1 -1
- package/bundle/{chunk-pt0xphq9.js → chunk-q6mcnq9p.js} +1 -1
- package/bundle/{chunk-kengqzja.js → chunk-q6p92zyn.js} +2 -2
- package/bundle/{chunk-ycvwpmd9.js → chunk-q87fw8dk.js} +2 -2
- package/bundle/chunk-q8f6a074.js +2 -0
- package/bundle/{chunk-cj7r8w1e.js → chunk-qbrj9wzd.js} +1 -1
- package/bundle/{chunk-j0bwa5dk.js → chunk-qdvnscxm.js} +2 -2
- package/bundle/{chunk-d6jhs818.js → chunk-qp3hxqg5.js} +2 -2
- package/bundle/{chunk-jg1ccs3j.js → chunk-qph2c2v7.js} +1 -1
- package/bundle/{chunk-3vvd7j14.js → chunk-qprbef09.js} +1 -1
- package/bundle/chunk-qqaevt32.js +2 -0
- package/bundle/chunk-qzpvz708.js +2 -0
- package/bundle/{chunk-cbnkx933.js → chunk-r4kg0z96.js} +2 -2
- package/bundle/{chunk-faee8zgc.js → chunk-r73e8gsp.js} +1 -1
- package/bundle/chunk-reyjr2e0.js +2 -0
- package/bundle/{chunk-dxdggn90.js → chunk-rfzra502.js} +1 -1
- package/bundle/{chunk-tg226j37.js → chunk-rhrcgvb8.js} +1 -1
- package/bundle/{chunk-wyj8cpx5.js → chunk-rk0fnvp5.js} +1 -1
- package/bundle/{chunk-t8c4cs6z.js → chunk-rqedtjz9.js} +1 -1
- package/bundle/{chunk-eg3syjtv.js → chunk-s06t769q.js} +2 -2
- package/bundle/{chunk-m80v76m9.js → chunk-skxg3s8z.js} +1 -1
- package/bundle/{chunk-7x6yrtzn.js → chunk-spzd8rev.js} +1 -1
- package/bundle/chunk-t178njgb.js +2 -0
- package/bundle/{chunk-3jf3jhrs.js → chunk-t4b2fm7z.js} +1 -1
- package/bundle/{chunk-55fcmswd.js → chunk-t8sy5sgx.js} +2 -2
- package/bundle/{chunk-s4vx9x1v.js → chunk-t9qyzzsz.js} +1 -1
- package/bundle/{chunk-6scf311w.js → chunk-tc9xbn1t.js} +1 -1
- package/bundle/{chunk-qnvsqnz5.js → chunk-tezrgfc6.js} +2 -2
- package/bundle/chunk-tjpev5t6.js +2 -0
- package/bundle/{chunk-vkaa7k3e.js → chunk-tkzctbxq.js} +2 -2
- package/bundle/{chunk-xy0gnpen.js → chunk-ts2k13g0.js} +1 -1
- package/bundle/{chunk-gszvgz76.js → chunk-twd6r7nf.js} +2 -2
- package/bundle/{chunk-qxcyz5hc.js → chunk-twfvrafb.js} +2 -2
- package/bundle/{chunk-70q8qcb2.js → chunk-twvmjsxf.js} +1 -1
- package/bundle/{chunk-ggxzf22k.js → chunk-tz3s8dvy.js} +1 -1
- package/bundle/chunk-tzq7wjgv.js +3 -0
- package/bundle/{chunk-n78f8hfk.js → chunk-v0c3k797.js} +1 -1
- package/bundle/chunk-v1s16wwd.js +2 -0
- package/bundle/{chunk-fr34mnyg.js → chunk-v3nmnm57.js} +2 -2
- package/bundle/chunk-v6b29nx4.js +2 -0
- package/bundle/chunk-v6rgd1j5.js +2 -0
- package/bundle/chunk-v9dnetq8.js +2 -0
- package/bundle/{chunk-450fef7h.js → chunk-v9w88wpy.js} +2 -2
- package/bundle/{chunk-7hvf9dgx.js → chunk-va2qfh0x.js} +1 -1
- package/bundle/chunk-vd5mpvcc.js +2 -0
- package/bundle/{chunk-w4synhfg.js → chunk-vfb72vdy.js} +1 -1
- package/bundle/{chunk-3cr2p4mp.js → chunk-vhzx5bxd.js} +1 -1
- package/bundle/{chunk-cmb62jkt.js → chunk-vjn54xj5.js} +2 -2
- package/bundle/{chunk-ybane1en.js → chunk-vp3yf46q.js} +1 -1
- package/bundle/{chunk-p4b0s5td.js → chunk-vzrc2fmt.js} +1 -1
- package/bundle/{chunk-ejqzcdcx.js → chunk-w3zhy5vq.js} +1 -1
- package/bundle/{chunk-hjt94wce.js → chunk-w43kmnm9.js} +641 -635
- package/bundle/{chunk-w4brava0.js → chunk-wb1d3mqw.js} +1 -1
- package/bundle/{chunk-6m9jb0s9.js → chunk-wd8hbven.js} +2 -2
- package/bundle/{chunk-vshycswk.js → chunk-wgt1tqw9.js} +1 -1
- package/bundle/{chunk-0428v6mw.js → chunk-whw18cn9.js} +1 -1
- package/bundle/{chunk-pxm4qvqk.js → chunk-wjz42325.js} +2 -2
- package/bundle/{chunk-y67kaj0b.js → chunk-wvb17w0z.js} +1 -1
- package/bundle/chunk-wwct4z7j.js +2 -0
- package/bundle/{chunk-55ykn8nz.js → chunk-x55h5qdc.js} +4 -4
- package/bundle/{chunk-05ck7acg.js → chunk-x80d0zh7.js} +1 -1
- package/bundle/{chunk-mjjaezwq.js → chunk-x9fyt3vx.js} +2 -2
- package/bundle/{chunk-g22e4gw7.js → chunk-xb3sxa6f.js} +1 -1
- package/bundle/{chunk-yz25607t.js → chunk-xcxqt8ag.js} +1 -1
- package/bundle/{chunk-c36p881g.js → chunk-xhh70g8j.js} +3 -3
- package/bundle/chunk-xr9wz961.js +2 -0
- package/bundle/{chunk-0cnwsf8p.js → chunk-y0h3jfkj.js} +1 -1
- package/bundle/{chunk-m7ganre7.js → chunk-y2t5pmqw.js} +1 -1
- package/bundle/{chunk-qkvqvgcx.js → chunk-y5q9v80n.js} +1 -1
- package/bundle/{chunk-5asx1706.js → chunk-yd94wz5v.js} +2 -2
- package/bundle/{chunk-5df5aja0.js → chunk-yjqww6ag.js} +2 -2
- package/bundle/{chunk-2drzgtv3.js → chunk-yxttz5z5.js} +2 -2
- package/bundle/{chunk-da6kggv7.js → chunk-yy7r3t3w.js} +2 -2
- package/bundle/{chunk-5pwv2p3s.js → chunk-yzpc5kj2.js} +1 -1
- package/bundle/{chunk-73r8bjjz.js → chunk-z6kcnpsj.js} +2 -2
- package/bundle/{chunk-nj1ntakd.js → chunk-z744mz4w.js} +2 -2
- package/bundle/{chunk-39z96pc6.js → chunk-z7kswv9r.js} +3 -3
- package/bundle/chunk-zfegnt1e.js +2 -0
- package/bundle/chunk-zg7kesbp.js +2 -0
- package/bundle/{chunk-jnrnncqc.js → chunk-znmbfx70.js} +1 -1
- package/bundle/{chunk-24ygjbpf.js → chunk-zp5sr5nx.js} +2 -2
- package/bundle/{chunk-ha1w0xzh.js → chunk-zrhw1szj.js} +1 -1
- package/bundle/chunk-zy06fe4r.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 +1 -1
- package/bundle/chunk-0ppnq3a4.js +0 -2
- package/bundle/chunk-0te0vcdn.js +0 -2
- package/bundle/chunk-11h06z17.js +0 -2
- package/bundle/chunk-28yv4fqe.js +0 -2
- package/bundle/chunk-34a52hyr.js +0 -2
- package/bundle/chunk-3d73kfea.js +0 -2
- package/bundle/chunk-3n3gb3vd.js +0 -2
- package/bundle/chunk-3sq60y9f.js +0 -2
- package/bundle/chunk-49mbnqvc.js +0 -2
- package/bundle/chunk-4fr6kae9.js +0 -2
- package/bundle/chunk-516w1nc4.js +0 -2
- package/bundle/chunk-535nm66j.js +0 -2
- package/bundle/chunk-5kpxpm8e.js +0 -2
- package/bundle/chunk-5nm5s0h2.js +0 -2
- package/bundle/chunk-5ysbwr4x.js +0 -3
- package/bundle/chunk-6dvmyeg7.js +0 -2
- package/bundle/chunk-6ex981t8.js +0 -2
- package/bundle/chunk-6gpf2bjs.js +0 -2
- package/bundle/chunk-6jeg2r5j.js +0 -2
- package/bundle/chunk-6nry7tah.js +0 -2
- package/bundle/chunk-7bgzcpdw.js +0 -2
- package/bundle/chunk-7kjvcbwa.js +0 -2
- package/bundle/chunk-7x30x94y.js +0 -2
- package/bundle/chunk-86hsh44c.js +0 -3
- package/bundle/chunk-8jma2btf.js +0 -2
- package/bundle/chunk-8sbb95a4.js +0 -2
- package/bundle/chunk-93e0w75z.js +0 -2
- package/bundle/chunk-97gp818s.js +0 -2
- package/bundle/chunk-9epf2zbh.js +0 -2
- package/bundle/chunk-agv04nt7.js +0 -2
- package/bundle/chunk-be7smmar.js +0 -2
- package/bundle/chunk-bg1t0kke.js +0 -2
- package/bundle/chunk-bryx5cx9.js +0 -2
- package/bundle/chunk-c13rrw41.js +0 -2
- package/bundle/chunk-c2kkv619.js +0 -2
- package/bundle/chunk-c3zge8cg.js +0 -3
- package/bundle/chunk-c5xj1y5v.js +0 -2
- package/bundle/chunk-cfhfc86j.js +0 -8
- package/bundle/chunk-ckpm4dvv.js +0 -2
- package/bundle/chunk-cqkaamvn.js +0 -2
- package/bundle/chunk-ct8twng1.js +0 -2
- package/bundle/chunk-d38y7bvh.js +0 -2
- package/bundle/chunk-d6hxsfm6.js +0 -2
- package/bundle/chunk-descb9jz.js +0 -2
- package/bundle/chunk-dvr2b9r1.js +0 -2
- package/bundle/chunk-ea5fktnn.js +0 -2
- package/bundle/chunk-f0t7rryn.js +0 -3
- package/bundle/chunk-f4mf6tpp.js +0 -2
- package/bundle/chunk-f97k17t8.js +0 -2
- package/bundle/chunk-g4ehhdzp.js +0 -2
- package/bundle/chunk-gd6qpdjw.js +0 -2
- package/bundle/chunk-gdn91t9j.js +0 -2
- package/bundle/chunk-gehn9fd9.js +0 -2
- package/bundle/chunk-h9wh48d0.js +0 -5
- package/bundle/chunk-hhax4mxw.js +0 -2
- package/bundle/chunk-hjb1etf8.js +0 -2
- package/bundle/chunk-jvkzdap1.js +0 -2
- package/bundle/chunk-kg8fcv91.js +0 -2
- package/bundle/chunk-kgptyf7n.js +0 -3
- package/bundle/chunk-kjjjrjnb.js +0 -2
- package/bundle/chunk-ky88ba80.js +0 -2
- package/bundle/chunk-m5cfmhwh.js +0 -2
- package/bundle/chunk-m7qxxbns.js +0 -2
- package/bundle/chunk-mh19kwzw.js +0 -10
- package/bundle/chunk-n8wg5h5p.js +0 -2
- package/bundle/chunk-nvs0d8jg.js +0 -2
- package/bundle/chunk-p6hcj3kv.js +0 -2
- package/bundle/chunk-pexmns0j.js +0 -2
- package/bundle/chunk-pt603np4.js +0 -2
- package/bundle/chunk-pz1avwyt.js +0 -2
- package/bundle/chunk-qk5bfcv8.js +0 -2
- package/bundle/chunk-qr06byhp.js +0 -2
- package/bundle/chunk-r7sq3maz.js +0 -2
- package/bundle/chunk-rcrjbhaz.js +0 -2
- package/bundle/chunk-rmgs9nmj.js +0 -2
- package/bundle/chunk-rytavefg.js +0 -2
- package/bundle/chunk-sh9vjnsh.js +0 -2
- package/bundle/chunk-st0c5wwc.js +0 -2
- package/bundle/chunk-teb3k2sf.js +0 -2
- package/bundle/chunk-ts798jvf.js +0 -2
- package/bundle/chunk-tx5aj02v.js +0 -2
- package/bundle/chunk-v1t51rrq.js +0 -2
- package/bundle/chunk-vdrz2t9c.js +0 -2
- package/bundle/chunk-vh9ptqn0.js +0 -2
- package/bundle/chunk-vj4x8hvz.js +0 -2
- package/bundle/chunk-w72rctxz.js +0 -2
- package/bundle/chunk-wbw9zv3h.js +0 -2
- package/bundle/chunk-x6mw98c2.js +0 -2
- package/bundle/chunk-y6p57wgh.js +0 -2
- package/bundle/chunk-y6xs8v17.js +0 -2
- package/bundle/chunk-z3xsfpc6.js +0 -2
- package/bundle/chunk-zkm3yyyf.js +0 -2
- package/bundle/chunk-zn5pw733.js +0 -2
- package/bundle/chunk-zxwvnmea.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{zf as qH}from"./chunk-w9gzfsy7.js";import{bo as QH,fo as KH,xo as SH}from"./chunk-cfhfc86j.js";import"./chunk-ph8hn1wt.js";import"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import"./chunk-xy0gnpen.js";import"./chunk-ztyy3ga3.js";import"./chunk-mmjgf680.js";import{cs as Q}from"./chunk-vdrz2t9c.js";import"./chunk-fr34mnyg.js";import{Gs as OH}from"./chunk-r5zy4za0.js";import{Ns as t,Vs as FH}from"./chunk-tr6rdr6h.js";import{ht as PH,kt as _H}from"./chunk-at22twxx.js";import"./chunk-kgptyf7n.js";import"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-55fcmswd.js";import"./chunk-qnvsqnz5.js";import"./chunk-r9w0thdk.js";var vH=0.9,fH=256,XH="[Earlier tool result removed to fit the request size limit]",m;function v(H){return Buffer.byteLength(JSON.stringify(H),"utf8")}function DH(){return t.QITQODE_QLEX_MAX_REQUEST_BYTES??m}function e(H){let J=t.QITQODE_QLEX_MAX_REQUEST_BYTES;if(J!==void 0)return J;let K=Math.max(1,Math.min(Math.floor(H*vH),Math.floor(H)-1));return m=m===void 0?K:Math.min(m,K),m}function l(H,J){return!!H&&typeof H==="object"&&H.role===J}function YH(H){let J=[],K=0;while(K<H.length){let Z=K,$=H[K];if(K++,l($,"assistant")&&Array.isArray($?.tool_calls)&&$.tool_calls.length>0)while(K<H.length&&l(H[K],"tool"))K++;J.push({start:Z,end:K})}return J}function VH(H,J){if(J.length===0)return[];let K=-1;for(let Z=J.length-1;Z>=0;Z--){let $=J[Z],z=!1;for(let X=$.start;X<$.end;X++)if(l(H[X],"user"))z=!0;if(z){K=Z;break}}return J.filter((Z,$)=>{if($===J.length-1)return!1;if($===K)return!1;if(Z.start===0&&l(H[0],"system"))return!1;return!0})}function HH(H,J){let K=v(H),Z={toolResultsElided:0,unitsDropped:0},$=()=>({body:H,bytes:K,originalBytes:K,reduced:!1,actions:Z});if(!H||typeof H!=="object")return $();let z=H.messages;if(!Array.isArray(z))return $();let X=z.map((U)=>U&&typeof U==="object"?{...U}:U),Y=()=>({...H,messages:X}),V=()=>v(Y())<=J;{let U=X;for(let P of VH(U,YH(U))){let S=!1;for(let L=P.start;L<P.end;L++){let E=U[L];if(!l(E,"tool"))continue;let w=E?.content;if(typeof w!=="string"||w.length<fH)continue;if(w===XH)continue;U[L]={...E,content:XH},Z.toolResultsElided++,S=!0}if(S&&V())break}}if(!V())for(;;){let U=X,S=VH(U,YH(U))[0];if(!S)break;if(X=[...U.slice(0,S.start),...U.slice(S.end)],Z.unitsDropped++,V())break}let W=Y(),G=v(W);return{body:W,bytes:G,originalBytes:K,reduced:G<K&&G<=J,actions:Z}}import y from"fs/promises";import LH from"path";import{randomUUID as yH}from"crypto";var k=FH({service:"provider.qlex"}),pH=Q.streamUrl(),uH=Q.omniqueryBaseUrl()+"/runOrchestrated";function b(H,J){let K=H;if(J.status!==void 0)K.status=J.status;if(J.upstreamCode!==void 0)K.upstreamCode=J.upstreamCode;if(J.requestId!==void 0)K.requestId=J.requestId;if(K.category=J.category,K.retryable=J.retryable,J.outputBudgetRecoveryAvailable!==void 0)K.outputBudgetRecoveryAvailable=J.outputBudgetRecoveryAvailable;if(J.outputBudgetRecoveryTokens!==void 0)K.outputBudgetRecoveryTokens=J.outputBudgetRecoveryTokens}function x(H,J){return{...H,...J}}class MH extends Error{name="QlexNotLoggedInError";constructor(H){super(Q.copy().notLoggedIn);b(this,x({category:"invalid_credentials",retryable:!1},H))}}class kH extends Error{name="QlexInsufficientBalanceError";constructor(H,J){super(Q.copy().insufficientBalance(H));b(this,x({status:402,category:"billing",retryable:!1},J))}}class EH extends Error{name="QlexRateLimitError";constructor(H){super(Q.copy().rateLimit);b(this,x({status:429,category:"rate_limited",retryable:!0},H))}}class wH extends Error{name="QlexInvalidCredentialsError";constructor(H,J){super(Q.copy().invalidCredentials(H));b(this,x({status:401,category:"invalid_credentials",retryable:!1},J))}}class RH extends Error{name="QlexRequestRejectedError";constructor(H,J,K){super(Q.copy().requestRejected(H,J));b(this,x({status:400,category:"request_rejected",retryable:!1},K))}}class a extends Error{name="QlexRequestTooLargeError";stage;constructor(H="irreducible",J,K){super(H==="after-reduction"?Q.copy().requestTooLargeAfterReduction(J):Q.copy().requestTooLargeIrreducible(J));this.stage=H,b(this,x({status:413,category:"request_too_large",retryable:!1},K))}}class CH extends Error{name="QlexRequestNotSentError";constructor(H,J){super(Q.copy().requestNotSent(H));b(this,x({category:"request_rejected",retryable:!1},J))}}class u extends Error{name="QlexGatewayError";constructor(H,J){super(Q.copy().gatewayUnavailable(H));b(this,x({category:"gateway_routing",retryable:!1},J))}}var cH=60000,mH=180000;function lJ(H){return Q.sanitizeUpstreamError(H)}class g extends Error{name="QlexStreamError";constructor(H,J,K){let Z=x({category:"unknown",retryable:!1},J);super(Z.category==="output_budget_exhausted"?Q.copy().outputBudgetExhausted():Z.category==="empty_output"?Q.copy().emptyOutput():Z.category==="stream_truncated"?Q.copy().streamCutOff(K):Z.category==="stream_failed"?Q.copy().streamFailedAfterRetries(K):Q.copy().streamFailed(H));b(this,Z),OH(this)}}var lH=[{match:/\b(unauthori[sz]ed|forbidden|invalid[ _-]?(api[ _-]?key|token|credential)|expired[ _-]?token|authentication[ _-]?(failed|error)|401|403)\b/i,category:"invalid_credentials",retryable:!1},{match:/(output (?:token )?budget|maximum output tokens|max_tokens|finish[_ -]?reason.{0,20}(length|budget)|reasoning.{0,20}(budget|tokens))/i,category:"output_budget_exhausted",retryable:!1},{match:/\b(no visible output|empty output|produced no (?:visible )?(?:text|output)|nothing to display)\b/i,category:"empty_output",retryable:!1},{match:/\b(insufficient[ _-]?(credits?|qredits?|balance|funds)|payment[ _-]?required|quota[ _-]?exceeded|out[ _-]?of[ _-]?(credits?|qredits?)|402)\b/i,category:"billing",retryable:!1},{match:/\b(rate[ _-]?limit(ed|s)?|too[ _-]?many[ _-]?requests|429)\b/i,category:"rate_limited",retryable:!0},{match:/(unexpected end of (json|input|stream|data)|premature (close|end)|socket hang ?up|incomplete (response|output|json|message)|truncated|stream (ended|closed|terminated) (early|unexpectedly|prematurely)|\bECONNRESET\b|\bEPIPE\b)/i,category:"stream_truncated",retryable:!0},{match:/\b(overloaded|at capacity|service[ _-]?unavailable|temporarily[ _-]?unavailable|bad[ _-]?gateway|gateway[ _-]?time(d[ _-]?out|out)|timed[ _-]?out|502|503|504)\b/i,category:"transient",retryable:!0}],dH={ERR_EMPTY_RESULT:{category:"empty_output",retryable:!1},ERR_TRUNCATED_OUTPUT:{category:"stream_truncated",retryable:!0},ERR_STREAM:{category:"stream_failed",retryable:!0}},nH=/^\s*(ERR_[A-Z0-9_]+)\b(?:\s*(?:[\u2014\u2013:-]\s*)?)?/i,iH=/\b(req_[A-Za-z0-9][A-Za-z0-9_-]*)\b/;function rH(H){let J=H??"",K=nH.exec(J),Z=K?.[1]?.toUpperCase(),$=iH.exec(J)?.[1],z=K?J.slice(K[0].length):J;if(Z!==void 0){let X=dH[Z];if(X!==void 0)return{...X,upstreamCode:Z,...$?{requestId:$}:{}}}for(let X of lH)if(X.match.test(z))return{category:X.category,retryable:X.retryable,...Z?{upstreamCode:Z}:{},...$?{requestId:$}:{}};return{category:"unknown",retryable:!1,...Z?{upstreamCode:Z}:{},...$?{requestId:$}:{}}}function oH(H){return QH(H)}function AH(H,J){let K,Z,$,z=!1;try{let W=JSON.parse(J);if(W&&typeof W==="object"){let G=W.error&&typeof W.error==="object"?W.error:void 0;if(typeof G?.code==="string")K=G.code;else if(typeof W.code==="string")K=W.code;if(typeof G?.message==="string")Z=G.message;else if(typeof W.message==="string")Z=W.message;if(typeof W.details?.field==="string")$=W.details.field}}catch(W){z=/^\s*[\[{]/.test(J)&&(sH(J)||/unexpected end|end of json|unterminated string/i.test(String(W)))}let X=K?.toUpperCase()??"",Y=(()=>{if(z)return"stream_truncated";if(H===402)return"billing";if(H===413)return"request_too_large";if(H===429)return"rate_limited";if(H===401||H===403)return X==="ERR_GATEWAY_REQUIRED"||oH(J)?"gateway_routing":"invalid_credentials";if(X.includes("CONFIG"))return"configuration";if(H>=500)return"transient";if(H>=400)return"request_rejected";return"unknown"})(),V={status:H,category:Y,retryable:Y==="transient"||Y==="rate_limited"||Y==="stream_truncated"};if(K!==void 0)V.upstreamCode=K;if(Z!==void 0)V.upstreamMessage=Z;if($!==void 0)V.field=$;return V}function sH(H){let J=0,K=!1,Z=!1;for(let $ of H){if(K){if(Z)Z=!1;else if($==="\\")Z=!0;else if($==='"')K=!1;continue}if($==='"')K=!0;else if($==="{"||$==="[")J++;else if($==="}"||$==="]")J--;if(J<0)return!1}return K||J>0}function aH(H){let J=Q.tierBudgetFacts(H.tier),K=H.advisory,Z=K?.tierOutputLimit??J?.output;if(H.requestedTotal!==void 0)return{total:Z===void 0?H.requestedTotal:Math.min(H.requestedTotal,Z)};if(!K&&!J)return{};let $=K?.reasoningReserveTokens??J?.reasoningReserve??0,z=K?.visibleOutputFloorTokens??J?.visibleOutputFloor??0,X=K?.recommendedTotalTokens??K?.tierRecommendedStepTokens??J?.recommendedTotal??J?.recommendedStep??Z,Y=K?.viableTotalFloorTokens??J?.viableTotalFloor??$+z,V=X===void 0?Y:Math.max(X,Y),W=K?.reasoningReported??J?.reasoning;return{total:Z===void 0?V:Math.min(V,Z),reasoningBudget:W&&$>0?Math.min($,V):void 0}}var tH=new Set(["coding","agent","research","review","chat"]);function eH(H){if(H===void 0)return;if(typeof H==="string"&&tH.has(H))return H;throw Error(`invalid Qortex posture: ${String(H)}`)}function HJ(H){if(H===void 0)return;let J=Array.isArray(H)?H:[H];if(J.every((K)=>typeof K==="string"&&/^[^/\s]+\/[^/\s]+$/.test(K)))return Array.isArray(H)?J:H;throw Error(`invalid Qortex directive registry key: ${String(H)}`)}function s(H){if(typeof H==="string")return H;if(Array.isArray(H))return H.map((J)=>{if(typeof J==="string")return J;if(J&&typeof J==="object"){let K=J;if(typeof K.text==="string")return K.text;if(typeof K.content==="string")return K.content}return""}).join("");if(H===void 0||H===null)return"";return String(H)}var JJ="[Tool call]",KJ="[Tool returned no output]";function TH(H){if(!Array.isArray(H))return{messages:H,dropped:[]};let J=[];return{messages:H.flatMap((Z,$)=>{if(!Z||typeof Z!=="object")return J.push({index:$,role:typeof Z,reason:"not-an-object"}),[];let z=Z,X=s(z.content);if(X.trim().length>0)return[{...z,content:X}];if(z.role==="assistant"&&Array.isArray(z.tool_calls)&&z.tool_calls.length>0)return[{...z,content:JJ}];if(z.role==="tool"&&typeof z.tool_call_id==="string"&&z.tool_call_id.trim().length>0)return[{...z,content:KJ}];return J.push({index:$,role:typeof z.role==="string"?z.role:"unknown",reason:"empty-content"}),[]}),dropped:J}}function ZJ(H){return TH(H).messages}function $J(H){if(!Array.isArray(H))return!1;return H.some((J)=>!!J&&typeof J==="object"&&J.role==="user")}function zJ(H){if(!Array.isArray(H))return!1;return H.some((J)=>{if(!J||typeof J!=="object")return!1;let K=J;if(K.role!=="user")return!1;return s(K.content).trim().length>0})}function XJ(H){if(!Array.isArray(H))return H;let J=(z)=>!!z&&typeof z==="object"&&z.role==="system",K=0;while(K<H.length&&J(H[K]))K++;if(K<=1)return H;let Z=H.slice(0,K),$=Z.map((z)=>typeof z.content==="string"?z.content:String(z.content??"")).filter((z)=>z.length>0).join(`
|
|
2
|
+
import{Af as qH}from"./chunk-gdj7mqrd.js";import{Bp as QH,Fp as KH,Xp as SH}from"./chunk-makecdh6.js";import"./chunk-dy2k5rdx.js";import"./chunk-n5p7cn4w.js";import"./chunk-cqtkxwd8.js";import"./chunk-mhxyv9c8.js";import"./chunk-ts2k13g0.js";import"./chunk-01e3v1xz.js";import"./chunk-dbpkq7ba.js";import{Ct as Q}from"./chunk-gdew7bwm.js";import"./chunk-v3nmnm57.js";import{eu as OH}from"./chunk-hwsqqkrv.js";import{lu as t,tu as FH}from"./chunk-mbbxedsq.js";import{Hu as PH,Ku as _H}from"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import"./chunk-tezrgfc6.js";import"./chunk-f2pv705d.js";var vH=0.9,fH=256,XH="[Earlier tool result removed to fit the request size limit]",m;function v(H){return Buffer.byteLength(JSON.stringify(H),"utf8")}function DH(){return t.QITQODE_QLEX_MAX_REQUEST_BYTES??m}function e(H){let J=t.QITQODE_QLEX_MAX_REQUEST_BYTES;if(J!==void 0)return J;let K=Math.max(1,Math.min(Math.floor(H*vH),Math.floor(H)-1));return m=m===void 0?K:Math.min(m,K),m}function l(H,J){return!!H&&typeof H==="object"&&H.role===J}function YH(H){let J=[],K=0;while(K<H.length){let Z=K,$=H[K];if(K++,l($,"assistant")&&Array.isArray($?.tool_calls)&&$.tool_calls.length>0)while(K<H.length&&l(H[K],"tool"))K++;J.push({start:Z,end:K})}return J}function VH(H,J){if(J.length===0)return[];let K=-1;for(let Z=J.length-1;Z>=0;Z--){let $=J[Z],z=!1;for(let X=$.start;X<$.end;X++)if(l(H[X],"user"))z=!0;if(z){K=Z;break}}return J.filter((Z,$)=>{if($===J.length-1)return!1;if($===K)return!1;if(Z.start===0&&l(H[0],"system"))return!1;return!0})}function HH(H,J){let K=v(H),Z={toolResultsElided:0,unitsDropped:0},$=()=>({body:H,bytes:K,originalBytes:K,reduced:!1,actions:Z});if(!H||typeof H!=="object")return $();let z=H.messages;if(!Array.isArray(z))return $();let X=z.map((U)=>U&&typeof U==="object"?{...U}:U),Y=()=>({...H,messages:X}),V=()=>v(Y())<=J;{let U=X;for(let P of VH(U,YH(U))){let S=!1;for(let L=P.start;L<P.end;L++){let E=U[L];if(!l(E,"tool"))continue;let w=E?.content;if(typeof w!=="string"||w.length<fH)continue;if(w===XH)continue;U[L]={...E,content:XH},Z.toolResultsElided++,S=!0}if(S&&V())break}}if(!V())for(;;){let U=X,S=VH(U,YH(U))[0];if(!S)break;if(X=[...U.slice(0,S.start),...U.slice(S.end)],Z.unitsDropped++,V())break}let W=Y(),G=v(W);return{body:W,bytes:G,originalBytes:K,reduced:G<K&&G<=J,actions:Z}}import y from"fs/promises";import LH from"path";import{randomUUID as yH}from"crypto";var k=FH({service:"provider.qlex"}),pH=Q.streamUrl(),uH=Q.omniqueryBaseUrl()+"/runOrchestrated";function b(H,J){let K=H;if(J.status!==void 0)K.status=J.status;if(J.upstreamCode!==void 0)K.upstreamCode=J.upstreamCode;if(J.requestId!==void 0)K.requestId=J.requestId;if(K.category=J.category,K.retryable=J.retryable,J.outputBudgetRecoveryAvailable!==void 0)K.outputBudgetRecoveryAvailable=J.outputBudgetRecoveryAvailable;if(J.outputBudgetRecoveryTokens!==void 0)K.outputBudgetRecoveryTokens=J.outputBudgetRecoveryTokens}function x(H,J){return{...H,...J}}class MH extends Error{name="QlexNotLoggedInError";constructor(H){super(Q.copy().notLoggedIn);b(this,x({category:"invalid_credentials",retryable:!1},H))}}class kH extends Error{name="QlexInsufficientBalanceError";constructor(H,J){super(Q.copy().insufficientBalance(H));b(this,x({status:402,category:"billing",retryable:!1},J))}}class EH extends Error{name="QlexRateLimitError";constructor(H){super(Q.copy().rateLimit);b(this,x({status:429,category:"rate_limited",retryable:!0},H))}}class wH extends Error{name="QlexInvalidCredentialsError";constructor(H,J){super(Q.copy().invalidCredentials(H));b(this,x({status:401,category:"invalid_credentials",retryable:!1},J))}}class RH extends Error{name="QlexRequestRejectedError";constructor(H,J,K){super(Q.copy().requestRejected(H,J));b(this,x({status:400,category:"request_rejected",retryable:!1},K))}}class a extends Error{name="QlexRequestTooLargeError";stage;constructor(H="irreducible",J,K){super(H==="after-reduction"?Q.copy().requestTooLargeAfterReduction(J):Q.copy().requestTooLargeIrreducible(J));this.stage=H,b(this,x({status:413,category:"request_too_large",retryable:!1},K))}}class CH extends Error{name="QlexRequestNotSentError";constructor(H,J){super(Q.copy().requestNotSent(H));b(this,x({category:"request_rejected",retryable:!1},J))}}class u extends Error{name="QlexGatewayError";constructor(H,J){super(Q.copy().gatewayUnavailable(H));b(this,x({category:"gateway_routing",retryable:!1},J))}}var cH=60000,mH=180000;function lJ(H){return Q.sanitizeUpstreamError(H)}class g extends Error{name="QlexStreamError";constructor(H,J,K){let Z=x({category:"unknown",retryable:!1},J);super(Z.category==="output_budget_exhausted"?Q.copy().outputBudgetExhausted():Z.category==="empty_output"?Q.copy().emptyOutput():Z.category==="stream_truncated"?Q.copy().streamCutOff(K):Z.category==="stream_failed"?Q.copy().streamFailedAfterRetries(K):Q.copy().streamFailed(H));b(this,Z),OH(this)}}var lH=[{match:/\b(unauthori[sz]ed|forbidden|invalid[ _-]?(api[ _-]?key|token|credential)|expired[ _-]?token|authentication[ _-]?(failed|error)|401|403)\b/i,category:"invalid_credentials",retryable:!1},{match:/(output (?:token )?budget|maximum output tokens|max_tokens|finish[_ -]?reason.{0,20}(length|budget)|reasoning.{0,20}(budget|tokens))/i,category:"output_budget_exhausted",retryable:!1},{match:/\b(no visible output|empty output|produced no (?:visible )?(?:text|output)|nothing to display)\b/i,category:"empty_output",retryable:!1},{match:/\b(insufficient[ _-]?(credits?|qredits?|balance|funds)|payment[ _-]?required|quota[ _-]?exceeded|out[ _-]?of[ _-]?(credits?|qredits?)|402)\b/i,category:"billing",retryable:!1},{match:/\b(rate[ _-]?limit(ed|s)?|too[ _-]?many[ _-]?requests|429)\b/i,category:"rate_limited",retryable:!0},{match:/(unexpected end of (json|input|stream|data)|premature (close|end)|socket hang ?up|incomplete (response|output|json|message)|truncated|stream (ended|closed|terminated) (early|unexpectedly|prematurely)|\bECONNRESET\b|\bEPIPE\b)/i,category:"stream_truncated",retryable:!0},{match:/\b(overloaded|at capacity|service[ _-]?unavailable|temporarily[ _-]?unavailable|bad[ _-]?gateway|gateway[ _-]?time(d[ _-]?out|out)|timed[ _-]?out|502|503|504)\b/i,category:"transient",retryable:!0}],dH={ERR_EMPTY_RESULT:{category:"empty_output",retryable:!1},ERR_TRUNCATED_OUTPUT:{category:"stream_truncated",retryable:!0},ERR_STREAM:{category:"stream_failed",retryable:!0}},nH=/^\s*(ERR_[A-Z0-9_]+)\b(?:\s*(?:[\u2014\u2013:-]\s*)?)?/i,iH=/\b(req_[A-Za-z0-9][A-Za-z0-9_-]*)\b/;function rH(H){let J=H??"",K=nH.exec(J),Z=K?.[1]?.toUpperCase(),$=iH.exec(J)?.[1],z=K?J.slice(K[0].length):J;if(Z!==void 0){let X=dH[Z];if(X!==void 0)return{...X,upstreamCode:Z,...$?{requestId:$}:{}}}for(let X of lH)if(X.match.test(z))return{category:X.category,retryable:X.retryable,...Z?{upstreamCode:Z}:{},...$?{requestId:$}:{}};return{category:"unknown",retryable:!1,...Z?{upstreamCode:Z}:{},...$?{requestId:$}:{}}}function oH(H){return QH(H)}function AH(H,J){let K,Z,$,z=!1;try{let W=JSON.parse(J);if(W&&typeof W==="object"){let G=W.error&&typeof W.error==="object"?W.error:void 0;if(typeof G?.code==="string")K=G.code;else if(typeof W.code==="string")K=W.code;if(typeof G?.message==="string")Z=G.message;else if(typeof W.message==="string")Z=W.message;if(typeof W.details?.field==="string")$=W.details.field}}catch(W){z=/^\s*[\[{]/.test(J)&&(sH(J)||/unexpected end|end of json|unterminated string/i.test(String(W)))}let X=K?.toUpperCase()??"",Y=(()=>{if(z)return"stream_truncated";if(H===402)return"billing";if(H===413)return"request_too_large";if(H===429)return"rate_limited";if(H===401||H===403)return X==="ERR_GATEWAY_REQUIRED"||oH(J)?"gateway_routing":"invalid_credentials";if(X.includes("CONFIG"))return"configuration";if(H>=500)return"transient";if(H>=400)return"request_rejected";return"unknown"})(),V={status:H,category:Y,retryable:Y==="transient"||Y==="rate_limited"||Y==="stream_truncated"};if(K!==void 0)V.upstreamCode=K;if(Z!==void 0)V.upstreamMessage=Z;if($!==void 0)V.field=$;return V}function sH(H){let J=0,K=!1,Z=!1;for(let $ of H){if(K){if(Z)Z=!1;else if($==="\\")Z=!0;else if($==='"')K=!1;continue}if($==='"')K=!0;else if($==="{"||$==="[")J++;else if($==="}"||$==="]")J--;if(J<0)return!1}return K||J>0}function aH(H){let J=Q.tierBudgetFacts(H.tier),K=H.advisory,Z=K?.tierOutputLimit??J?.output;if(H.requestedTotal!==void 0)return{total:Z===void 0?H.requestedTotal:Math.min(H.requestedTotal,Z)};if(!K&&!J)return{};let $=K?.reasoningReserveTokens??J?.reasoningReserve??0,z=K?.visibleOutputFloorTokens??J?.visibleOutputFloor??0,X=K?.recommendedTotalTokens??K?.tierRecommendedStepTokens??J?.recommendedTotal??J?.recommendedStep??Z,Y=K?.viableTotalFloorTokens??J?.viableTotalFloor??$+z,V=X===void 0?Y:Math.max(X,Y),W=K?.reasoningReported??J?.reasoning;return{total:Z===void 0?V:Math.min(V,Z),reasoningBudget:W&&$>0?Math.min($,V):void 0}}var tH=new Set(["coding","agent","research","review","chat"]);function eH(H){if(H===void 0)return;if(typeof H==="string"&&tH.has(H))return H;throw Error(`invalid Qortex posture: ${String(H)}`)}function HJ(H){if(H===void 0)return;let J=Array.isArray(H)?H:[H];if(J.every((K)=>typeof K==="string"&&/^[^/\s]+\/[^/\s]+$/.test(K)))return Array.isArray(H)?J:H;throw Error(`invalid Qortex directive registry key: ${String(H)}`)}function s(H){if(typeof H==="string")return H;if(Array.isArray(H))return H.map((J)=>{if(typeof J==="string")return J;if(J&&typeof J==="object"){let K=J;if(typeof K.text==="string")return K.text;if(typeof K.content==="string")return K.content}return""}).join("");if(H===void 0||H===null)return"";return String(H)}var JJ="[Tool call]",KJ="[Tool returned no output]";function TH(H){if(!Array.isArray(H))return{messages:H,dropped:[]};let J=[];return{messages:H.flatMap((Z,$)=>{if(!Z||typeof Z!=="object")return J.push({index:$,role:typeof Z,reason:"not-an-object"}),[];let z=Z,X=s(z.content);if(X.trim().length>0)return[{...z,content:X}];if(z.role==="assistant"&&Array.isArray(z.tool_calls)&&z.tool_calls.length>0)return[{...z,content:JJ}];if(z.role==="tool"&&typeof z.tool_call_id==="string"&&z.tool_call_id.trim().length>0)return[{...z,content:KJ}];return J.push({index:$,role:typeof z.role==="string"?z.role:"unknown",reason:"empty-content"}),[]}),dropped:J}}function ZJ(H){return TH(H).messages}function $J(H){if(!Array.isArray(H))return!1;return H.some((J)=>!!J&&typeof J==="object"&&J.role==="user")}function zJ(H){if(!Array.isArray(H))return!1;return H.some((J)=>{if(!J||typeof J!=="object")return!1;let K=J;if(K.role!=="user")return!1;return s(K.content).trim().length>0})}function XJ(H){if(!Array.isArray(H))return H;let J=(z)=>!!z&&typeof z==="object"&&z.role==="system",K=0;while(K<H.length&&J(H[K]))K++;if(K<=1)return H;let Z=H.slice(0,K),$=Z.map((z)=>typeof z.content==="string"?z.content:String(z.content??"")).filter((z)=>z.length>0).join(`
|
|
3
3
|
|
|
4
4
|
`);return[{...Z[0],role:"system",content:$},...H.slice(K)]}var d="<tool_call>",r="</tool_call>";function YJ(H){if(!Array.isArray(H)||H.length===0)return;let J=H.map((K)=>{try{return JSON.stringify(K)}catch{return}}).filter((K)=>K!==void 0);if(J.length===0)return;return["# Tools","","You may call one or more functions to assist with the user query.","","You are provided with function signatures within <tools></tools> XML tags:","<tools>",...J,"</tools>","","For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:","<tool_call>",'{"name": <function-name>, "arguments": <args-json-object>}',"</tool_call>","","Function results will be provided within <tool_response></tool_response> XML tags. Do not write <tool_response> blocks yourself.","Only use the functions declared above. Never invent function names, and never write out a function-call-like block in any other format."].join(`
|
|
5
5
|
`)}var VJ=3;function $H(H){let J=H;for(let K=0;K<VJ;K++){if(J!==null&&typeof J==="object")return J;if(typeof J!=="string")return;try{J=JSON.parse(J)}catch{return}}return}function DJ(H){let J=H?.tool_calls;if(!Array.isArray(J))return;for(let K of J){let Z=K?.function;if(!Z)continue;k.debug("tool call ingress",{tool:typeof Z.name==="string"?Z.name:"?",source:"native",args:zH(Z.arguments)})}}function zH(H,J=300){let K;try{K=typeof H==="string"?H:JSON.stringify(H)??String(H)}catch{K="<unrenderable>"}return K.length<=J?K:`${K.slice(0,J)}\u2026 (${K.length} chars total)`}function WJ(H){let J=H.function??{},K=typeof J.name==="string"?J.name:"",Z=J.arguments===void 0?{}:$H(J.arguments);if(Z===void 0)k.warn("dropping unrecoverable tool-call arguments while re-encoding history",{tool:K,raw:zH(J.arguments)});return`${d}
|
|
@@ -8,21 +8,21 @@ ${r}`}function IH(H,J){if(!Array.isArray(H))return H;let K=H.map(($)=>{if(!$||ty
|
|
|
8
8
|
`),Y=s(z.content),{tool_calls:V,...W}=z;return{...W,content:Y.length>0?`${Y}
|
|
9
9
|
${X}`:X}}if(z.role==="tool"){let{tool_call_id:X,name:Y,...V}=z;return{...V,role:"user",content:`<tool_response>
|
|
10
10
|
${s(z.content)}
|
|
11
|
-
</tool_response>`}}return $}),Z=YJ(J);if(Z){let $=0;while($<K.length&&!!K[$]&&typeof K[$]==="object"&&K[$].role==="system")$++;K.splice($,0,{role:"system",content:Z})}return K}function NJ(){return process.env.QITQODE_TOOL_PROTOCOL==="text"?"text":"native"}function GJ(H){if(Array.isArray(H.tools)&&H.tools.length>0)return!0;let J=H.messages;if(!Array.isArray(J))return!1;return J.some((K)=>{if(!K||typeof K!=="object")return!1;let Z=K;return Z.role==="tool"||Z.role==="assistant"&&Array.isArray(Z.tool_calls)})}function WH(H,J){let K=J?.toolMode??"native",Z=H.model??"
|
|
11
|
+
</tool_response>`}}return $}),Z=YJ(J);if(Z){let $=0;while($<K.length&&!!K[$]&&typeof K[$]==="object"&&K[$].role==="system")$++;K.splice($,0,{role:"system",content:Z})}return K}function NJ(){return process.env.QITQODE_TOOL_PROTOCOL==="text"?"text":"native"}function GJ(H){if(Array.isArray(H.tools)&&H.tools.length>0)return!0;let J=H.messages;if(!Array.isArray(J))return!1;return J.some((K)=>{if(!K||typeof K!=="object")return!1;let Z=K;return Z.role==="tool"||Z.role==="assistant"&&Array.isArray(Z.tool_calls)})}function WH(H,J){let K=J?.toolMode??"native",Z=H.model??"adaptive",$={stream:H.stream??!0};if(H.temperature!==void 0)$.temperature=H.temperature;if(H.max_tokens!==void 0)$.max_tokens=H.max_tokens;let z=aH({tier:Z,advisory:J?.outputAdvisory,requestedTotal:$.max_tokens});if(z.total!==void 0)$.max_tokens=z.total;if(z.reasoningBudget!==void 0)$.thinking={budget_tokens:z.reasoningBudget};if(J?.outputBudgetRecoveryTokens!==void 0){let G=typeof $.max_tokens==="number"?$.max_tokens:0,U=J.outputAdvisory?.tierOutputLimit??Q.tierBudgetFacts(Z)?.output,P=Math.min(J.outputBudgetRecoveryTokens,U??J.outputBudgetRecoveryTokens);if(P>G)$.max_tokens=P}if(H.tools!==void 0)$.tools=H.tools;if(H.tool_choice!==void 0)$.tool_choice=H.tool_choice;if(H.stream_options!==void 0)$.stream_options=H.stream_options;let X=K==="text"?IH(H.messages,H.tools):H.messages,Y={},V=eH(H.posture);if(V!==void 0)Y.posture=V;let W=HJ(H.directive);if(W!==void 0)Y.directive=W;if(H.modelPersona!==void 0)Y.modelPersona=H.modelPersona;return{tier:Z,messages:XJ(ZJ(X)),opts:$,...Y}}var n=new Map,p=LH.join(_H.Path.data,"qlex-tier-advisories.json"),jJ="qlex-tier-advisories",UJ=2592000000,NH=!1,PJ;function BH(H,J){if(!H||typeof H!=="object")return;let K=H;if(typeof K.capturedAt!=="number"||J-K.capturedAt>UJ)return;if(!K.advisory)return;return{advisory:K.advisory,capturedAt:K.capturedAt}}async function _J(){if(NH)return;try{let H=JSON.parse(await y.readFile(p,"utf8")),J=Date.now();for(let[K,Z]of Object.entries(H)){let $=BH(Z,J);if($)bH(K,$.advisory,$.capturedAt)}}catch{}NH=!0}function FJ(){return PJ??=_J()}function bH(H,J,K=Date.now()){n.set(H,{advisory:J,capturedAt:K})}async function OJ(H){await PH.withLock(jJ,async()=>{let J={};try{let Z=JSON.parse(await y.readFile(p,"utf8")),$=Date.now();for(let[z,X]of Object.entries(Z)){let Y=BH(X,$);if(Y)J[z]=Y}}catch{}for(let[Z,$]of H){let z=J[Z];if(!z||z.capturedAt<=$.capturedAt)J[Z]=$}await y.mkdir(LH.dirname(p),{recursive:!0});let K=`${p}.${process.pid}.${yH()}.tmp`;try{await y.writeFile(K,JSON.stringify(J)),await y.rename(K,p)}catch(Z){throw await y.rm(K,{force:!0}).catch(()=>{}),Z}})}function QJ(){if(i)return;i=!0,ZH=ZH.then(()=>{return i=!1,OJ([...n].map(([H,J])=>[H,J]))}).catch((H)=>{i=!1,k.warn("failed to persist tier output advisories",{file:p,error:H instanceof Error?H.message:String(H)})})}function f(H){return typeof H==="number"&&Number.isFinite(H)&&H>0?H:void 0}function SJ(H,J){let K={},Z=f(J.tierOutputLimit),$=f(J.tierRecommendedStepTokens),z=f(J.reasoningReserveTokens),X=f(J.visibleOutputFloorTokens),Y=f(J.recommendedTotalTokens),V=f(J.viableTotalFloorTokens),W=f(J.budgetPolicyVersion);if(Z!==void 0)K.tierOutputLimit=Z;if($!==void 0)K.tierRecommendedStepTokens=$;if(z!==void 0)K.reasoningReserveTokens=z;if(X!==void 0)K.visibleOutputFloorTokens=X;if(Y!==void 0)K.recommendedTotalTokens=Y;if(V!==void 0)K.viableTotalFloorTokens=V;if(typeof J.reasoningReported==="boolean")K.reasoningReported=J.reasoningReported;if(W!==void 0)K.budgetPolicyVersion=W;if(Object.keys(K).length===0)return;bH(H,K),QJ()}function qJ(H){return n.get(H)?.advisory}function dJ(){n.clear()}function nJ(){return ZH}function LJ(H){let J=(K)=>typeof K==="string"&&(K.startsWith("qlex")||K.startsWith("qortex"));return J(H.id)||J(H.object)}function MJ(H){let J=[],K=H.indexOf(`
|
|
12
12
|
`)===-1?[H]:H.split(`
|
|
13
13
|
`);for(let X of K){let Y=X.endsWith("\r")?X.slice(0,-1):X;if(!Y.startsWith("data:"))continue;let V=Y.slice(5);if(V.startsWith(" "))V=V.slice(1);J.push(V)}if(J.length===0)return{kind:"skip"};let Z=J.length===1?J[0]:J.join(`
|
|
14
14
|
`);if(Z==="")return{kind:"skip"};if(Z==="[DONE]")return{kind:"done"};if(Z.startsWith("[ERROR]"))return{kind:"error",message:Z.slice(7).trim()||"qlex stream error"};let $=Z.charCodeAt(0),z=$===123||$===91||$===32||$===9||$===10||$===13;try{if(!z)return{kind:"token",content:Z};let X=JSON.parse(Z);if(X&&typeof X==="object"){let Y=X.id;if(Y==="qlex-cost"||Y==="qortex-cost")return{kind:"cost",cost:X};if(Y==="qlex-stream"&&X.usage&&typeof X.usage==="object"){let G=X.choices,U;if(Array.isArray(G)&&G[0]&&typeof G[0]==="object"){let P=G[0].finish_reason;if(typeof P==="string")U=P}return{kind:"usage",usage:X.usage,finishReason:U}}if(Array.isArray(X.choices))return{kind:"passthrough",chunk:X};let V=X,W=typeof V.content==="string"?V.content:typeof V.text==="string"?V.text:typeof V.delta==="string"?V.delta:void 0;if(W!==void 0)return{kind:"token",content:W};if(LJ(X)){let G=X.object;return{kind:"control",control:typeof G==="string"&&G.endsWith(".tier.outputLimits")?"tier-output-limits":"unknown",chunk:X}}}}catch{}return{kind:"token",content:Z}}function kJ(H,J){let K=Math.min(H.length,J.length-1);for(let Z=K;Z>=1;Z--)if(J.startsWith(H.slice(H.length-Z)))return Z;return 0}function EJ(H){if(typeof H==="string"){try{let K=JSON.parse(H);if(K!==null&&typeof K==="object")return H}catch{}let J=$H(H);return JSON.stringify(J??H)}return JSON.stringify(H??{})}class xH{onText;onToolCall;pending="";inBlock=!1;constructor(H,J){this.onText=H;this.onToolCall=J}feed(H){this.pending+=H,this.drain(!1)}flush(){if(this.drain(!0),this.inBlock)this.emitBlock(this.pending,!0),this.inBlock=!1;else if(this.pending.length>0)this.onText(this.pending);this.pending=""}drain(H){while(!0)if(!this.inBlock){let J=this.pending.indexOf(d);if(J===-1){let K=H?0:kJ(this.pending,d),Z=this.pending.length-K;if(Z>0)this.onText(this.pending.slice(0,Z)),this.pending=K>0?this.pending.slice(Z):"";return}if(J>0)this.onText(this.pending.slice(0,J));this.pending=this.pending.slice(J+d.length),this.inBlock=!0}else{let J=this.pending.indexOf(r);if(J===-1)return;if(this.emitBlock(this.pending.slice(0,J),!1),this.pending=this.pending.slice(J+r.length),this.pending.startsWith(`\r
|
|
15
15
|
`))this.pending=this.pending.slice(2);else if(this.pending.startsWith(`
|
|
16
16
|
`))this.pending=this.pending.slice(1);this.inBlock=!1}}emitBlock(H,J){try{let K=JSON.parse(H.trim());if(K&&typeof K==="object"&&typeof K.name==="string"){this.onToolCall({name:K.name,arguments:EJ(K.arguments)});return}}catch{}this.onText(`${d}${H}${J?"":r}`)}}function JH(H,J,K){let Z={id:"qlex-stream",object:"chat.completion.chunk",created:Math.floor(Date.now()/1000),model:"qlex",choices:[{index:0,delta:H,finish_reason:J}]};if(K)Z.usage=K;return`data: ${JSON.stringify(Z)}
|
|
17
17
|
|
|
18
|
-
`}function wJ(H,J){let K=J?.toolProtocolEnabled===!0,Z=J?.tier,$=J?.requestedOutputBudget,z=J?.idleTimeoutMs??mH,X=H.getReader(),Y=new TextDecoder,V=new TextEncoder,W="",G=!1,U=!1,P,S,L,E,w=!1,C=!1,h=0,A=0;return new ReadableStream({async start(_){let I=(D)=>{if(D.length>0)w=!0;A+=D.length;let N=G?{content:D}:{role:"assistant",content:D};G=!0,_.enqueue(V.encode(JH(N,null)))},c=0,F=K?new xH(I,(D)=>{k.debug("tool call ingress",{tool:D.name,source:"text-shim",args:zH(D.arguments),objectShaped:$H(D.arguments)!==void 0});let N={...G?{}:{role:"assistant"},tool_calls:[{index:c,id:`qlexcall_${Date.now().toString(36)}_${c}`,type:"function",function:{name:D.name,arguments:D.arguments}}]};G=!0,C=!0,c++,_.enqueue(V.encode(JH(N,null)))}):void 0,q=(D)=>F?F.feed(D):I(D),R=()=>{F?.flush();let N=P||S!==void 0||L!==void 0?{prompt_tokens:P?.tokens.prompt??L?.prompt??0,completion_tokens:P?.tokens.completion??L?.completion??0,total_tokens:P?.tokens.total??(P?.tokens.prompt??L?.prompt??0)+(P?.tokens.completion??L?.completion??0),cost_usd:P?.cost_usd,cost_credits:P?.cost_credits??P?.cost_qredits,context_window:S}:void 0;if(N&&(N.cost_usd??0)>0&&N.prompt_tokens===0)k.warn("qlex billed turn reported zero prompt tokens",{tier:Z,completionTokens:N.completion_tokens,costUsd:N.cost_usd,source:P?"cost.summary":"usage frame"});let j=c>0?"tool_calls":E??"stop";if(j==="length"||j==="max_tokens"){let O=o(Z??"
|
|
18
|
+
`}function wJ(H,J){let K=J?.toolProtocolEnabled===!0,Z=J?.tier,$=J?.requestedOutputBudget,z=J?.idleTimeoutMs??mH,X=H.getReader(),Y=new TextDecoder,V=new TextEncoder,W="",G=!1,U=!1,P,S,L,E,w=!1,C=!1,h=0,A=0;return new ReadableStream({async start(_){let I=(D)=>{if(D.length>0)w=!0;A+=D.length;let N=G?{content:D}:{role:"assistant",content:D};G=!0,_.enqueue(V.encode(JH(N,null)))},c=0,F=K?new xH(I,(D)=>{k.debug("tool call ingress",{tool:D.name,source:"text-shim",args:zH(D.arguments),objectShaped:$H(D.arguments)!==void 0});let N={...G?{}:{role:"assistant"},tool_calls:[{index:c,id:`qlexcall_${Date.now().toString(36)}_${c}`,type:"function",function:{name:D.name,arguments:D.arguments}}]};G=!0,C=!0,c++,_.enqueue(V.encode(JH(N,null)))}):void 0,q=(D)=>F?F.feed(D):I(D),R=()=>{F?.flush();let N=P||S!==void 0||L!==void 0?{prompt_tokens:P?.tokens.prompt??L?.prompt??0,completion_tokens:P?.tokens.completion??L?.completion??0,total_tokens:P?.tokens.total??(P?.tokens.prompt??L?.prompt??0)+(P?.tokens.completion??L?.completion??0),cost_usd:P?.cost_usd,cost_credits:P?.cost_credits??P?.cost_qredits,context_window:S}:void 0;if(N&&(N.cost_usd??0)>0&&N.prompt_tokens===0)k.warn("qlex billed turn reported zero prompt tokens",{tier:Z,completionTokens:N.completion_tokens,costUsd:N.cost_usd,source:P?"cost.summary":"usage frame"});let j=c>0?"tool_calls":E??"stop";if(j==="length"||j==="max_tokens"){let O=o(Z??"adaptive",$),T=O!==void 0;k.debug("qlex output budget exhausted",{tier:Z,contentStreamed:w,outputBudgetRecoveryAvailable:T}),_.error(new g("output budget exhausted",{category:"output_budget_exhausted",retryable:!1,outputBudgetRecoveryAvailable:T,outputBudgetRecoveryTokens:O})),U=!0;return}if(!w&&!C&&E!=="tool_calls"){let O=o(Z??"adaptive",$),T=O!==void 0;k.debug("qlex completed without visible output",{tier:Z,outputBudgetRecoveryAvailable:T}),_.error(new g("empty output",{category:"empty_output",retryable:!1,outputBudgetRecoveryAvailable:T,outputBudgetRecoveryTokens:O})),U=!0;return}if(_.enqueue(V.encode(JH({},j,N))),_.enqueue(V.encode(`data: [DONE]
|
|
19
19
|
|
|
20
20
|
`)),!P&&Z!==void 0)k.info("qlex cost frame absent on stream finish",{tier:Z});_.close(),U=!0},M=(D)=>{let N=MJ(D);switch(h++,N.kind){case"skip":return!1;case"token":return q(N.content),!1;case"passthrough":{let j=N.chunk.choices;if(Array.isArray(j)&&j[0]&&typeof j[0]==="object"){let O=j[0].finish_reason;if(typeof O==="string")E=O;let T=j[0].delta;if(typeof T?.content==="string"&&T.content.length>0)w=!0;if(Array.isArray(T?.tool_calls))C=!0;DJ(j[0].delta)}G=!0;{let O=N.chunk.choices?.[0]?.delta?.content;if(typeof O==="string")A+=O.length}return _.enqueue(V.encode(`data: ${JSON.stringify(N.chunk)}
|
|
21
21
|
|
|
22
|
-
`)),!1}case"cost":if(N.cost.final)P=N.cost;return!1;case"usage":if(N.usage.context_window!==void 0)S=N.usage.context_window;if(N.usage.prompt_tokens!==void 0&&N.usage.completion_tokens!==void 0)L={prompt:N.usage.prompt_tokens,completion:N.usage.completion_tokens};if(N.finishReason!==void 0)E=N.finishReason;return!1;case"control":{if(N.control==="tier-output-limits"){let j=N.chunk;if(Z!==void 0)SJ(Z,j);k.debug("qlex tier output limits",{tierOutputLimit:j.tierOutputLimit,tierRecommendedStepTokens:j.tierRecommendedStepTokens,tierStepGuidance:j.tierStepGuidance,reasoningReserveTokens:j.reasoningReserveTokens,visibleOutputFloorTokens:j.visibleOutputFloorTokens,recommendedTotalTokens:j.recommendedTotalTokens,viableTotalFloorTokens:j.viableTotalFloorTokens,reasoningReported:j.reasoningReported,budgetPolicyVersion:j.budgetPolicyVersion})}else k.debug("qlex control frame dropped",{id:N.chunk.id,object:N.chunk.object});return!1}case"done":return R(),!0;case"error":{let j=rH(N.message);k.warn("qlex stream error frame",{tier:Z,raw:N.message,frameIndex:h,streamedContentChars:A,contentStreamed:G,upstreamCode:j.upstreamCode,requestId:j.requestId,category:j.category,retryable:j.retryable});let O=j.category==="output_budget_exhausted"||j.category==="empty_output"?o(Z??"
|
|
22
|
+
`)),!1}case"cost":if(N.cost.final)P=N.cost;return!1;case"usage":if(N.usage.context_window!==void 0)S=N.usage.context_window;if(N.usage.prompt_tokens!==void 0&&N.usage.completion_tokens!==void 0)L={prompt:N.usage.prompt_tokens,completion:N.usage.completion_tokens};if(N.finishReason!==void 0)E=N.finishReason;return!1;case"control":{if(N.control==="tier-output-limits"){let j=N.chunk;if(Z!==void 0)SJ(Z,j);k.debug("qlex tier output limits",{tierOutputLimit:j.tierOutputLimit,tierRecommendedStepTokens:j.tierRecommendedStepTokens,tierStepGuidance:j.tierStepGuidance,reasoningReserveTokens:j.reasoningReserveTokens,visibleOutputFloorTokens:j.visibleOutputFloorTokens,recommendedTotalTokens:j.recommendedTotalTokens,viableTotalFloorTokens:j.viableTotalFloorTokens,reasoningReported:j.reasoningReported,budgetPolicyVersion:j.budgetPolicyVersion})}else k.debug("qlex control frame dropped",{id:N.chunk.id,object:N.chunk.object});return!1}case"done":return R(),!0;case"error":{let j=rH(N.message);k.warn("qlex stream error frame",{tier:Z,raw:N.message,frameIndex:h,streamedContentChars:A,contentStreamed:G,upstreamCode:j.upstreamCode,requestId:j.requestId,category:j.category,retryable:j.retryable});let O=j.category==="output_budget_exhausted"||j.category==="empty_output"?o(Z??"adaptive",$):void 0;if(j.retryable===!1&&O!==void 0)j.outputBudgetRecoveryAvailable=!0,j.outputBudgetRecoveryTokens=O;return _.error(new g(N.message,j,{textKept:w})),U=!0,!0}}},B=async()=>{if(!(z>0))return X.read();let D;try{return await Promise.race([X.read(),new Promise((N,j)=>{D=setTimeout(()=>{let O=Math.round(z/1000);k.warn("qlex stream idle timeout",{tier:Z,idleTimeoutMs:z,frameIndex:h,streamedContentChars:A,contentStreamed:G}),j(new g(`the gateway sent nothing for ${O}s`,{category:"transient",retryable:!0})),X.cancel(Error(`qlex stream idle for ${O}s`)).catch(()=>{})},z)})])}finally{if(D!==void 0)clearTimeout(D)}};try{while(!0){let{done:N,value:j}=await B();if(N)break;W+=Y.decode(j,{stream:!0});let O;while((O=W.indexOf(`
|
|
23
23
|
|
|
24
24
|
`))!==-1){let T=W.slice(0,O);if(W=W.slice(O+2),M(T))return}}W+=Y.decode();let D=W.replace(/\r?\n$/,"");if(D.length>0&&M(D))return;if(!U)R()}catch(D){if(!U)_.error(D instanceof g?D:new g(D instanceof Error?D.message:String(D)))}finally{X.releaseLock()}},cancel(_){X.cancel(_).catch(()=>{})}})}function hH(H){return{content:typeof H.content==="string"?H.content:H.choices?.[0]?.message?.content??"",finishReason:H.choices?.[0]?.finish_reason??"stop"}}function RJ(H){let J=H??{},{content:K,finishReason:Z}=hH(J),$=J.usage??{},z=$.prompt_tokens??0,X=$.completion_tokens??0,Y="orch-"+Date.now().toString(36),V=Math.floor(Date.now()/1000),W=(L,E,w)=>{let C={id:Y,object:"chat.completion.chunk",created:V,model:"orchestrated",choices:[{index:0,delta:L,finish_reason:E}]};if(w)C.usage=w;return`data: ${JSON.stringify(C)}
|
|
25
25
|
|
|
26
26
|
`},G={prompt_tokens:z,completion_tokens:X,total_tokens:$.total_tokens??z+X};if(typeof $.cost_usd==="number")G.cost_usd=$.cost_usd;if(typeof $.cost_credits==="number")G.cost_credits=$.cost_credits;if(typeof $.context_window==="number")G.context_window=$.context_window;let U=[W({role:"assistant",content:""},null),W({content:K},null),W({},Z,G),`data: [DONE]
|
|
27
27
|
|
|
28
|
-
`],P=new TextEncoder,S=new ReadableStream({start(L){for(let E of U)L.enqueue(P.encode(E));L.close()}});return new Response(S,{status:200,headers:{"content-type":"text/event-stream"}})}function iJ(H){let J=H??{},{content:K,finishReason:Z}=hH(J),$=J.usage??{},z=$.prompt_tokens??0,X=$.completion_tokens??0,Y={id:"orch-"+Date.now(),object:"chat.completion",created:Math.floor(Date.now()/1000),model:"orchestrated",choices:[{index:0,message:{role:"assistant",content:K},finish_reason:Z}],usage:{prompt_tokens:z,completion_tokens:X,total_tokens:$.total_tokens??z+X,...typeof $.cost_usd==="number"?{cost_usd:$.cost_usd}:{},...typeof $.context_window==="number"?{context_window:$.context_window}:{}}};return new Response(JSON.stringify(Y),{status:200,headers:{"content-type":"application/json"}})}async function CJ(H,J,K){let Z=AH(H,J),$=J?`HTTP ${H}: ${J}`:`HTTP ${H}`;switch(k.error("gateway rejected request",{tier:K.tier,status:H,category:Z.category,upstreamCode:Z.upstreamCode,field:Z.field,retryable:Z.retryable}),Z.category){case"billing":return new kH(J||void 0,Z);case"rate_limited":return new EH(Z);case"gateway_routing":return new u(`HTTP ${H}`,Z);case"invalid_credentials":return await K.onInvalidCredentials?.().catch(()=>{}),new wH($,Z);case"request_too_large":return new a("irreducible",Z.upstreamMessage??J??void 0,Z);case"request_rejected":case"tool_protocol":return new RH(Z.upstreamMessage??J??void 0,Z.field,Z);case"configuration":case"transient":case"unknown":default:return new u($,Z)}}function GH(H){let J=DH();if(J===void 0)return H;let K=v(H);if(K<=J)return H;let Z=HH(H,J);return k.warn("request over known size ceiling, reducing before send",{tier:H.tier,bytes:K,ceiling:J,reducedBytes:Z.bytes,fits:Z.reduced,...Z.actions}),Z.bytes<K?Z.body:H}function jH(H){let J=v(H),K=e(J),Z=HH(H,K);if(!Z.reduced)throw k.error("request too large and cannot be reduced further",{tier:H.tier,rejectedBytes:J,ceiling:K,reducedBytes:Z.bytes,...Z.actions}),new a("irreducible");return k.warn("request too large, retrying once with reduced history",{tier:H.tier,rejectedBytes:J,ceiling:K,reducedBytes:Z.bytes,...Z.actions,notice:Q.copy().requestTooLargeRecovering()}),Z.body}function UH(H){let J=v(H);throw e(J),k.error("reduced request still too large",{tier:H.tier,rejectedBytes:J}),new a("after-reduction")}function AJ(H,J=globalThis.fetch,K,Z){let $=Z?.responseTimeoutMs??cH;return async(z,X)=>{if(X?.method==="POST"&&typeof X?.body==="string"){let Y;try{Y=JSON.parse(X.body)}catch{return J(z,X)}let V=NJ();await FJ();let W=qJ(Y.model??"
|
|
28
|
+
`],P=new TextEncoder,S=new ReadableStream({start(L){for(let E of U)L.enqueue(P.encode(E));L.close()}});return new Response(S,{status:200,headers:{"content-type":"text/event-stream"}})}function iJ(H){let J=H??{},{content:K,finishReason:Z}=hH(J),$=J.usage??{},z=$.prompt_tokens??0,X=$.completion_tokens??0,Y={id:"orch-"+Date.now(),object:"chat.completion",created:Math.floor(Date.now()/1000),model:"orchestrated",choices:[{index:0,message:{role:"assistant",content:K},finish_reason:Z}],usage:{prompt_tokens:z,completion_tokens:X,total_tokens:$.total_tokens??z+X,...typeof $.cost_usd==="number"?{cost_usd:$.cost_usd}:{},...typeof $.context_window==="number"?{context_window:$.context_window}:{}}};return new Response(JSON.stringify(Y),{status:200,headers:{"content-type":"application/json"}})}async function CJ(H,J,K){let Z=AH(H,J),$=J?`HTTP ${H}: ${J}`:`HTTP ${H}`;switch(k.error("gateway rejected request",{tier:K.tier,status:H,category:Z.category,upstreamCode:Z.upstreamCode,field:Z.field,retryable:Z.retryable}),Z.category){case"billing":return new kH(J||void 0,Z);case"rate_limited":return new EH(Z);case"gateway_routing":return new u(`HTTP ${H}`,Z);case"invalid_credentials":return await K.onInvalidCredentials?.().catch(()=>{}),new wH($,Z);case"request_too_large":return new a("irreducible",Z.upstreamMessage??J??void 0,Z);case"request_rejected":case"tool_protocol":return new RH(Z.upstreamMessage??J??void 0,Z.field,Z);case"configuration":case"transient":case"unknown":default:return new u($,Z)}}function GH(H){let J=DH();if(J===void 0)return H;let K=v(H);if(K<=J)return H;let Z=HH(H,J);return k.warn("request over known size ceiling, reducing before send",{tier:H.tier,bytes:K,ceiling:J,reducedBytes:Z.bytes,fits:Z.reduced,...Z.actions}),Z.bytes<K?Z.body:H}function jH(H){let J=v(H),K=e(J),Z=HH(H,K);if(!Z.reduced)throw k.error("request too large and cannot be reduced further",{tier:H.tier,rejectedBytes:J,ceiling:K,reducedBytes:Z.bytes,...Z.actions}),new a("irreducible");return k.warn("request too large, retrying once with reduced history",{tier:H.tier,rejectedBytes:J,ceiling:K,reducedBytes:Z.bytes,...Z.actions,notice:Q.copy().requestTooLargeRecovering()}),Z.body}function UH(H){let J=v(H);throw e(J),k.error("reduced request still too large",{tier:H.tier,rejectedBytes:J}),new a("after-reduction")}function AJ(H,J=globalThis.fetch,K,Z){let $=Z?.responseTimeoutMs??cH;return async(z,X)=>{if(X?.method==="POST"&&typeof X?.body==="string"){let Y;try{Y=JSON.parse(X.body)}catch{return J(z,X)}let V=NJ();await FJ();let W=qJ(Y.model??"adaptive"),G=WH(Y,{toolMode:V,outputAdvisory:W});if($J(Y.messages)&&!zJ(G.messages)){let{dropped:F}=TH(V==="text"?IH(Y.messages,Y.tools):Y.messages);throw k.error("refusing to send: user message lost in normalization",{tier:G.tier,toolMode:V,inputRoles:Array.isArray(Y.messages)?Y.messages.map((q)=>q&&typeof q==="object"?String(q.role):"?"):"not-an-array",droppedCount:F.length,dropped:F}),new CH("your message could not be turned into sendable content")}let U=await H(),P=typeof U==="string"?{key:U,method:"sso"}:U;if(!P?.key)throw new MH;let S=new Headers(X.headers),L=()=>{if(P.method==="api-key")S.delete("Authorization"),S.set("x-api-key",P.key);else S.delete("x-api-key"),S.set("Authorization",`Bearer ${P.key}`)};L(),S.set("Content-Type","application/json");let E=!1,w=async(F,q)=>{let R=AH(F,q),M=async()=>({retry:!1,error:await CJ(F,q,{onInvalidCredentials:K,tier:G.tier})});if(R.category!=="invalid_credentials"||E)return M();E=!0;let B=KH(P),D=await SH(P);if(D.kind==="recovered"&&KH(D.credential)!==B)return P=D.credential,L(),{retry:!0};if(D.kind==="inconclusive")return{retry:!1,error:new u(`HTTP ${F}: ${D.reason}`,R)};return M()};if(G.tier==="orchestrated"){let F=X.signal,q=async(B)=>{let D=new AbortController,N=()=>D.abort(F?.reason);if(F)if(F.aborted)D.abort(F.reason);else F.addEventListener("abort",N,{once:!0});let j=!1,O=setTimeout(()=>{j=!0,D.abort()},$);try{return await J(uH,{method:"POST",headers:S,body:JSON.stringify(B),signal:D.signal})}catch(T){if(j)throw new u(`no response within ${Math.round($/1000)}s`);throw T}finally{clearTimeout(O),F?.removeEventListener("abort",N)}},R=GH(G),M=await q(R);if(M.status===413){if(await M.body?.cancel().catch(()=>{}),R=jH(R),M=await q(R),M.status===413)await M.body?.cancel().catch(()=>{}),UH(R)}while(!M.ok){let B=await M.text().catch(()=>""),D=await w(M.status,B);if(!D.retry)throw D.error;M=await q(R)}return RJ(await M.json())}let C=X.signal,h=async(F)=>{let q=new AbortController,R=()=>q.abort(C?.reason);if(C)if(C.aborted)q.abort(C.reason);else C.addEventListener("abort",R,{once:!0});let M=()=>C?.removeEventListener("abort",R),B=!1,D=setTimeout(()=>{B=!0,q.abort()},$);try{return{res:await J(pH,{method:"POST",headers:S,body:JSON.stringify(F),signal:q.signal}),detach:M}}catch(N){if(M(),B)throw new u(`no response within ${Math.round($/1000)}s`);throw N}finally{clearTimeout(D)}},A=GH(G),{res:_,detach:I}=await h(A);if(_.status===400&&V==="native"&&GJ(Y))I(),await _.body?.cancel().catch(()=>{}),A=WH(Y,{toolMode:"text",outputAdvisory:W}),{res:_,detach:I}=await h(A);if(_.status===413){if(I(),await _.body?.cancel().catch(()=>{}),A=jH(A),{res:_,detach:I}=await h(A),_.status===413)I(),await _.body?.cancel().catch(()=>{}),UH(A)}try{while(!_.ok){let F=await _.text().catch(()=>""),q=await w(_.status,F);if(I(),!q.retry)throw q.error;({res:_,detach:I}=await h(A))}}catch(F){throw I(),F}if(Y.stream!==!1&&_.body){let F=Array.isArray(Y.tools)&&Y.tools.length>0;return new Response(wJ(_.body,{toolProtocolEnabled:F,tier:G.tier,requestedOutputBudget:G.opts.max_tokens}),{status:_.status,statusText:_.statusText,headers:{"content-type":"text/event-stream"}})}return _}return J(z,X)}}function rJ(H){let J=H.getToken??(async()=>H.bearerToken),K=AJ(J,globalThis.fetch,H.onInvalidCredentials);return qH({name:H.name??"qlex",baseURL:Q.streamBaseUrl(),fetch:K})}function oJ(H,J){return o(H,J)!==void 0}var TJ=2;function o(H,J){let K=n.get(H)?.advisory,Z=Q.tierBudgetFacts(H),$=K?.tierOutputLimit??Z?.output;if(!$)return;let z=J??K?.recommendedTotalTokens??K?.tierRecommendedStepTokens??Z?.recommendedTotal??Z?.recommendedStep;if(!z||z>=$)return;let X=K?.recommendedTotalTokens??K?.tierRecommendedStepTokens??Z?.recommendedTotal??Z?.recommendedStep??z,Y=Math.min($,Math.max(z+1,z*TJ,X));return Y>z?Y:void 0}var i=!1,ZH=Promise.resolve();export{wJ as transformQlexStream,RJ as toOrchestratedSSEStream,iJ as toOpenAICompletion,lJ as sanitizeUpstreamProviderError,NJ as resolveToolMode,YJ as renderToolProtocolPrompt,SJ as recordTierOutputAdvisory,aH as planTierBudget,kJ as partialTagSuffixLength,MJ as parseQlexFrame,AH as parseQlexError,TH as normalizeQlexMessagesWithReport,ZJ as normalizeQlexMessages,XJ as mergeLeadingSystemMessages,oH as isGatewayRequiredError,$J as hasUserRoleMessage,zJ as hasUsableUserMessage,GJ as hasToolContext,o as getTierOutputBudgetRecovery,qJ as getTierOutputAdvisory,nJ as flushTierOutputAdvisoryWrites,s as flattenMessageContent,IH as encodeToolProtocolMessages,EJ as encodeExtractedArguments,$H as decodeToolArgumentsToObject,rJ as createQlexProvider,AJ as createCustomFetch,dJ as clearTierOutputAdvisories,rH as classifyQlexStreamError,oJ as canIncreaseTierOutputBudget,WH as buildQlexBody,xH as ToolCallExtractor,d as TOOL_CALL_OPEN,r as TOOL_CALL_CLOSE,g as QlexStreamError,a as QlexRequestTooLargeError,RH as QlexRequestRejectedError,CH as QlexRequestNotSentError,EH as QlexRateLimitError,MH as QlexNotLoggedInError,wH as QlexInvalidCredentialsError,kH as QlexInsufficientBalanceError,u as QlexGatewayError,pH as QLEX_STREAM_URL,mH as QLEX_STREAM_IDLE_TIMEOUT_MS,cH as QLEX_RESPONSE_TIMEOUT_MS,uH as QLEX_ORCHESTRATED_URL};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Pe as u,Qe as S,Re as v}from"./chunk-e0zb6sw6.js";import{$e as k,Se as q,Xe as U,cf as y,ff as $,gf as D,kf as N,lf as A,pf as E,rf as H,tf as O}from"./chunk-gwrnxcdn.js";import"./chunk-n5p7cn4w.js";import"./chunk-cqtkxwd8.js";import"./chunk-mhxyv9c8.js";import{hv as j}from"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-f2pv705d.js";var C=$(()=>D(j.object({error:j.object({message:j.string()})}))),f=$(()=>D(j.object({id:j.string().nullish(),model:j.string().nullish(),results:j.array(j.object({index:j.number(),relevance_score:j.number()})),usage:j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()})}))),M=$(()=>D(j.object({rankFields:j.array(j.string()).optional()}))),h=class{constructor(F,G){this.specificationVersion="v3",this.modelId=F,this.config=G}get provider(){return this.config.provider}async doRerank({documents:F,headers:G,query:K,topN:V,abortSignal:W,providerOptions:Y}){var J,P;let Z=await N({provider:"togetherai",providerOptions:Y,schema:M}),{responseHeaders:X,value:B,rawValue:x}=await A({url:`${this.config.baseURL}/rerank`,headers:q(this.config.headers(),G),body:{model:this.modelId,documents:F.values,query:K,top_n:V,rank_fields:Z==null?void 0:Z.rankFields,return_documents:!1},failedResponseHandler:E({errorSchema:C,errorToMessage:(Q)=>Q.error.message}),successfulResponseHandler:H(f),abortSignal:W,fetch:this.config.fetch});return{ranking:B.results.map((Q)=>({index:Q.index,relevanceScore:Q.relevance_score})),response:{id:(J=B.id)!=null?J:void 0,modelId:(P=B.model)!=null?P:void 0,headers:X,body:x}}}},I=class{constructor(F,G){this.modelId=F,this.config=G,this.specificationVersion="v3",this.maxImagesPerCall=1}get provider(){return this.config.provider}async doGenerate({prompt:F,n:G,size:K,seed:V,providerOptions:W,headers:Y,abortSignal:J,files:P,mask:Z}){var X,B,x;let Q=[];if(Z!=null)throw Error("Together AI does not support mask-based image editing. Use FLUX Kontext models (e.g., black-forest-labs/FLUX.1-kontext-pro) with a reference image and descriptive prompt instead.");if(K!=null)Q.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support the `aspectRatio` option. Use `size` instead."});let _=(x=(B=(X=this.config._internal)==null?void 0:X.currentDate)==null?void 0:B.call(X))!=null?x:new Date,R=await N({provider:"togetherai",providerOptions:W,schema:m}),w;if(P!=null&&P.length>0){if(w=U(P[0]),P.length>1)Q.push({type:"other",message:"Together AI only supports a single input image. Additional images are ignored."})}let T=K==null?void 0:K.split("x"),{value:b,responseHeaders:z}=await A({url:`${this.config.baseURL}/images/generations`,headers:q(this.config.headers(),Y),body:{model:this.modelId,prompt:F,seed:V,...G>1?{n:G}:{},...T&&{width:parseInt(T[0]),height:parseInt(T[1])},...w!=null?{image_url:w}:{},response_format:"base64",...R!=null?R:{}},failedResponseHandler:E({errorSchema:g,errorToMessage:(L)=>L.error.message}),successfulResponseHandler:H(c),abortSignal:J,fetch:this.config.fetch});return{images:b.data.map((L)=>L.b64_json),warnings:Q,response:{timestamp:_,modelId:this.modelId,headers:z}}}},c=j.object({data:j.array(j.object({b64_json:j.string()}))}),g=j.object({error:j.object({message:j.string()})}),m=$(()=>D(j.object({steps:j.number().nullish(),guidance:j.number().nullish(),negative_prompt:j.string().nullish(),disable_safety_checker:j.boolean().nullish()}).passthrough())),p="2.0.41";function l(){if(typeof process>"u")return;if(typeof process.env.TOGETHER_API_KEY==="string")return;let F=process.env.TOGETHER_AI_API_KEY;if(typeof F==="string")console.warn("TOGETHER_AI_API_KEY is deprecated and will be removed in a future release. Please use TOGETHER_API_KEY instead.");return F}function n(F={}){var G;let K=O((G=F.baseURL)!=null?G:"https://api.together.xyz/v1/"),V=()=>{var x;return k({Authorization:`Bearer ${y({apiKey:(x=F.apiKey)!=null?x:l(),environmentVariableName:"TOGETHER_API_KEY",description:"TogetherAI"})}`,...F.headers},`ai-sdk/togetherai/${p}`)},W=(x)=>({provider:`togetherai.${x}`,url:({path:Q})=>`${K}${Q}`,headers:V,fetch:F.fetch}),Y=(x)=>{return new u(x,W("chat"))},J=(x)=>new S(x,W("completion")),P=(x)=>new v(x,W("embedding")),Z=(x)=>new I(x,{...W("image"),baseURL:K!=null?K:"https://api.together.xyz/v1/"}),X=(x)=>new h(x,{...W("reranking"),baseURL:K!=null?K:"https://api.together.xyz/v1/"}),B=(x)=>Y(x);return B.specificationVersion="v3",B.completionModel=J,B.languageModel=Y,B.chatModel=Y,B.embeddingModel=P,B.textEmbeddingModel=P,B.image=Z,B.imageModel=Z,B.reranking=X,B.rerankingModel=X,B}var xj=n();export{xj as togetherai,n as createTogetherAI,p as VERSION};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{be as a}from"./chunk-f4mnp6xd.js";import{bg as d}from"./chunk-r4kg0z96.js";import{eg as i}from"./chunk-s06t769q.js";import{Cl as p,El as n}from"./chunk-6k14c8x1.js";import"./chunk-5r05d901.js";import{Do as f}from"./chunk-3rgct4bd.js";import"./chunk-95am490c.js";import"./chunk-kmzpeq8k.js";import"./chunk-0gsw04hw.js";import"./chunk-73xryfgn.js";import"./chunk-yjqww6ag.js";import"./chunk-z6kcnpsj.js";import"./chunk-ts2k13g0.js";import"./chunk-01e3v1xz.js";import"./chunk-dbpkq7ba.js";import"./chunk-vjn54xj5.js";import"./chunk-0qpqd7nz.js";import"./chunk-v3nmnm57.js";import{fu as m}from"./chunk-hwsqqkrv.js";import"./chunk-mbbxedsq.js";import"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import"./chunk-tezrgfc6.js";import"./chunk-f2pv705d.js";import{spawn as y}from"child_process";import{Database as g}from"bun:sqlite";import{EOL as l}from"os";var b=a({command:"$0 [query]",describe:"open an interactive sqlite3 shell or run a query",builder:(t)=>{return t.positional("query",{type:"string",describe:"SQL query to execute"}).option("format",{type:"string",choices:["json","tsv"],default:"tsv",describe:"Output format"})},handler:async(t)=>{let o=t.query;if(o){let r=new g(n.Path,{readonly:!0});try{let e=r.query(o).all();if(t.format==="json")console.log(JSON.stringify(e,null,2));else if(e.length>0){let s=Object.keys(e[0]);console.log(s.join("\t"));for(let u of e)console.log(s.map((h)=>u[h]).join("\t"))}}catch(e){i.error(m(e)),process.exit(1)}r.close();return}let c=y("sqlite3",[n.Path],{stdio:"inherit"});await new Promise((r)=>c.on("close",r))}}),w=a({command:"path",describe:"print the database path",handler:()=>{console.log(n.Path)}}),q=a({command:"migrate",describe:"migrate JSON data to SQLite (merges with existing data)",handler:async()=>{let t=new g(n.Path),o=process.stderr.isTTY,c=-1;if(o)process.stderr.write("\x1B[?25l");try{let r=await p.run(f({client:t}),{progress:(e)=>{let s=Math.floor(e.current/e.total*100);if(s===c)return;if(c=s,o)process.stderr.write(d(s,`${e.current}/${e.total}`)+" ");else process.stderr.write(`sqlite-migration:${s}${l}`)}});if(o)process.stderr.write(`
|
|
3
3
|
`);if(o)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${l}`);if(i.println(`Migration complete: ${r.projects} projects, ${r.sessions} sessions, ${r.messages} messages`),r.errors.length>0)i.println(`${r.errors.length} errors occurred during migration`)}catch(r){if(o)process.stderr.write("\x1B[?25h");i.error(`Migration failed: ${m(r)}`),process.exit(1)}finally{t.close()}}}),v=a({command:"db",describe:"database tools",builder:(t)=>{return t.command(b).command(w).command(q).demandCommand()},handler:()=>{}});export{v as DbCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{QP as E}from"./chunk-agqss9ga.js";import{RP as D}from"./chunk-kry4vcrf.js";import{TP as B,WP as C}from"./chunk-f2pv705d.js";var J=B((v)=>{Object.defineProperty(v,"__esModule",{value:!0});v.getMachineId=void 0;var q=C("process"),F=E(),G=D();async function H(){let b="%windir%\\System32\\REG.exe";if(q.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in q.env)b="%windir%\\sysnative\\cmd.exe /c "+b;try{let k=(await(0,F.execAsync)(`${b} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split("REG_SZ");if(k.length===2)return k[1].trim()}catch(f){G.diag.debug(`error reading machine id: ${f}`)}return}v.getMachineId=H});export default J();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hg as a,ig as b,jg as c,kg as d,lg as e}from"./chunk-q6p92zyn.js";import"./chunk-yd94wz5v.js";import"./chunk-4ngmjk8j.js";import"./chunk-dd4qnh8s.js";import"./chunk-tzq7wjgv.js";import"./chunk-nfg7nt13.js";import"./chunk-v9w88wpy.js";import"./chunk-q87fw8dk.js";import"./chunk-w43kmnm9.js";import"./chunk-nrk29616.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-wd8hbven.js";import"./chunk-drnj1a14.js";import"./chunk-9a6p1gdn.js";import"./chunk-jxkrhrp0.js";import"./chunk-6k14c8x1.js";import"./chunk-5r05d901.js";import"./chunk-3rgct4bd.js";import"./chunk-5b3v1x2c.js";import"./chunk-gbxf6e5d.js";import"./chunk-msh249db.js";import"./chunk-95am490c.js";import"./chunk-kmzpeq8k.js";import"./chunk-0gsw04hw.js";import"./chunk-hqjc4wgg.js";import"./chunk-makecdh6.js";import"./chunk-dy2k5rdx.js";import"./chunk-n5p7cn4w.js";import"./chunk-cqtkxwd8.js";import"./chunk-mhxyv9c8.js";import"./chunk-0crgymtr.js";import"./chunk-cth373se.js";import"./chunk-xcxqt8ag.js";import"./chunk-va2qfh0x.js";import"./chunk-ae7b11np.js";import"./chunk-eeq0krp7.js";import"./chunk-73xryfgn.js";import"./chunk-yjqww6ag.js";import"./chunk-z6kcnpsj.js";import"./chunk-ts2k13g0.js";import"./chunk-01e3v1xz.js";import"./chunk-dbpkq7ba.js";import"./chunk-z744mz4w.js";import"./chunk-vjn54xj5.js";import"./chunk-0qpqd7nz.js";import"./chunk-gdew7bwm.js";import"./chunk-v3nmnm57.js";import"./chunk-hwsqqkrv.js";import"./chunk-mbbxedsq.js";import"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import"./chunk-tezrgfc6.js";import"./chunk-wjz42325.js";import"./chunk-kry4vcrf.js";import"./chunk-f2pv705d.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{me as a,ne as b,oe as c,pe as d,qe as e,re as f,se as g,te as h,ue as i,ve as j,we as k}from"./chunk-0am156m5.js";import"./chunk-qdvnscxm.js";import"./chunk-yxttz5z5.js";import"./chunk-f2pv705d.js";export{c as providerConfigFromInit,d as httpRequest,j as getInstanceMetadataEndpoint,k as fromInstanceMetadata,h as fromContainerMetadata,i as Endpoint,f as ENV_CMDS_RELATIVE_URI,e as ENV_CMDS_FULL_URI,g as ENV_CMDS_AUTH_TOKEN,a as DEFAULT_TIMEOUT,b as DEFAULT_MAX_RETRIES};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-8p0t8qah.js";import"./chunk-f2pv705d.js";var e={"ui.sessionReview.title":"\u4F1A\u8BDD\u53D8\u66F4","ui.sessionReview.title.lastTurn":"\u4E0A\u4E00\u8F6E\u53D8\u66F4","ui.sessionReview.diffStyle.unified":"\u7EDF\u4E00","ui.sessionReview.diffStyle.split":"\u62C6\u5206","ui.sessionReview.openFile":"\u6253\u5F00\u6587\u4EF6","ui.sessionReview.selection.line":"\u7B2C {{line}} \u884C","ui.sessionReview.selection.lines":"\u7B2C {{start}}-{{end}} \u884C","ui.sessionReview.expandAll":"\u5168\u90E8\u5C55\u5F00","ui.sessionReview.collapseAll":"\u5168\u90E8\u6536\u8D77","ui.sessionReview.change.added":"\u5DF2\u6DFB\u52A0","ui.sessionReview.change.removed":"\u5DF2\u79FB\u9664","ui.sessionReview.change.modified":"\u5DF2\u4FEE\u6539","ui.sessionReview.image.loading":"\u52A0\u8F7D\u4E2D...","ui.sessionReview.image.placeholder":"\u56FE\u7247","ui.sessionReview.largeDiff.title":"\u5DEE\u5F02\u8FC7\u5927\uFF0C\u65E0\u6CD5\u6E32\u67D3","ui.sessionReview.largeDiff.meta":"\u9650\u5236\uFF1A{{limit}} \u884C\u53D8\u66F4\u3002\u5F53\u524D\uFF1A{{current}} \u884C\u53D8\u66F4\u3002","ui.sessionReview.largeDiff.renderAnyway":"\u4ECD\u7136\u6E32\u67D3","ui.fileMedia.kind.image":"\u56FE\u7247","ui.fileMedia.kind.audio":"\u97F3\u9891","ui.fileMedia.state.removed":"{{kind}}\u5DF2\u79FB\u9664","ui.fileMedia.state.loading":"\u6B63\u5728\u52A0\u8F7D{{kind}}...","ui.fileMedia.state.error":"\u52A0\u8F7D{{kind}}\u5931\u8D25","ui.fileMedia.state.unavailable":"{{kind}}\u4E0D\u53EF\u9884\u89C8","ui.fileMedia.binary.title":"\u4E8C\u8FDB\u5236\u6587\u4EF6","ui.fileMedia.binary.description.path":"\u65E0\u6CD5\u663E\u793A {{path}}\uFF0C\u56E0\u4E3A\u5B83\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u3002","ui.fileMedia.binary.description.default":"\u65E0\u6CD5\u663E\u793A\u6B64\u6587\u4EF6\uFF0C\u56E0\u4E3A\u5B83\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u3002","ui.lineComment.label.prefix":"\u8BC4\u8BBA ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"\u6B63\u5728\u8BC4\u8BBA ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"\u6DFB\u52A0\u8BC4\u8BBA","ui.lineComment.submit":"\u8BC4\u8BBA","ui.sessionTurn.steps.show":"\u663E\u793A\u6B65\u9AA4","ui.sessionTurn.steps.hide":"\u9690\u85CF\u6B65\u9AA4","ui.sessionTurn.summary.response":"\u56DE\u590D","ui.sessionTurn.diff.showMore":"\u663E\u793A\u66F4\u591A\u66F4\u6539\uFF08{{count}}\uFF09","ui.sessionTurn.retry.retrying":"\u91CD\u8BD5\u4E2D","ui.sessionTurn.retry.inSeconds":"{{seconds}} \u79D2\u540E","ui.sessionTurn.retry.attempt":"\u7B2C {{attempt}} \u6B21","ui.sessionTurn.retry.attemptLine":"{{line}} - \u7B2C {{attempt}} \u6B21","ui.sessionTurn.retry.geminiHot":"gemini \u5F53\u524D\u8FC7\u8F7D","ui.sessionTurn.error.freeUsageExceeded":"\u514D\u8D39\u4F7F\u7528\u989D\u5EA6\u5DF2\u7528\u5B8C","ui.sessionTurn.error.addQredits":"\u6DFB\u52A0\u79EF\u5206","ui.sessionTurn.status.delegating":"\u6B63\u5728\u59D4\u6D3E\u5DE5\u4F5C","ui.sessionTurn.status.planning":"\u6B63\u5728\u89C4\u5212\u4E0B\u4E00\u6B65","ui.sessionTurn.status.gatheringContext":"\u6B63\u5728\u63A2\u7D22","ui.sessionTurn.status.gatheredContext":"\u5DF2\u63A2\u7D22","ui.sessionTurn.status.searchingCodebase":"\u6B63\u5728\u641C\u7D22\u4EE3\u7801\u5E93","ui.sessionTurn.status.searchingWeb":"\u6B63\u5728\u641C\u7D22\u7F51\u9875","ui.sessionTurn.status.makingEdits":"\u6B63\u5728\u4FEE\u6539","ui.sessionTurn.status.runningCommands":"\u6B63\u5728\u8FD0\u884C\u547D\u4EE4","ui.sessionTurn.status.thinking":"\u601D\u8003\u4E2D","ui.sessionTurn.status.thinkingWithTopic":"\u601D\u8003\uFF1A{{topic}}","ui.sessionTurn.status.gatheringThoughts":"\u6B63\u5728\u6574\u7406\u601D\u8DEF","ui.sessionTurn.status.consideringNextSteps":"\u6B63\u5728\u8003\u8651\u4E0B\u4E00\u6B65","ui.messagePart.questions.dismissed":"\u95EE\u9898\u5DF2\u5FFD\u7565","ui.messagePart.compaction":"\u4F1A\u8BDD\u5DF2\u538B\u7F29","ui.messagePart.context.read.one":"{{count}} \u6B21\u8BFB\u53D6","ui.messagePart.context.read.other":"{{count}} \u6B21\u8BFB\u53D6","ui.messagePart.context.search.one":"{{count}} \u6B21\u641C\u7D22","ui.messagePart.context.search.other":"{{count}} \u6B21\u641C\u7D22","ui.messagePart.context.list.one":"{{count}} \u4E2A\u5217\u8868","ui.messagePart.context.list.other":"{{count}} \u4E2A\u5217\u8868","ui.messagePart.diagnostic.error":"\u9519\u8BEF","ui.messagePart.title.edit":"\u7F16\u8F91","ui.messagePart.title.write":"\u5199\u5165","ui.messagePart.option.typeOwnAnswer":"\u8F93\u5165\u81EA\u5DF1\u7684\u7B54\u6848","ui.messagePart.review.title":"\u68C0\u67E5\u4F60\u7684\u7B54\u6848","ui.list.loading":"\u52A0\u8F7D\u4E2D","ui.list.empty":"\u65E0\u7ED3\u679C","ui.list.clearFilter":"\u6E05\u9664\u7B5B\u9009","ui.list.emptyWithFilter.prefix":"\u6CA1\u6709\u5173\u4E8E","ui.list.emptyWithFilter.suffix":"\u7684\u7ED3\u679C","ui.messageNav.newMessage":"\u65B0\u6D88\u606F","ui.textField.copyToClipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","ui.textField.copyLink":"\u590D\u5236\u94FE\u63A5","ui.textField.copied":"\u5DF2\u590D\u5236","ui.imagePreview.alt":"\u56FE\u7247\u9884\u89C8","ui.scrollView.ariaLabel":"\u53EF\u6EDA\u52A8\u5185\u5BB9","ui.tool.read":"\u8BFB\u53D6","ui.tool.loaded":"\u5DF2\u52A0\u8F7D","ui.tool.list":"\u5217\u8868","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"\u7F51\u7EDC\u641C\u7D22","ui.tool.codesearch":"\u4EE3\u7801\u641C\u7D22","ui.tool.shell":"Shell","ui.tool.patch":"\u8865\u4E01","ui.tool.todos":"\u5F85\u529E","ui.tool.todos.read":"\u8BFB\u53D6\u5F85\u529E","ui.tool.questions":"\u95EE\u9898","ui.tool.agent":"{{type}} \u667A\u80FD\u4F53","ui.tool.agent.default":"\u667A\u80FD\u4F53","ui.common.file.one":"\u4E2A\u6587\u4EF6","ui.common.file.other":"\u4E2A\u6587\u4EF6","ui.common.question.one":"\u4E2A\u95EE\u9898","ui.common.question.other":"\u4E2A\u95EE\u9898","ui.common.add":"\u6DFB\u52A0","ui.common.back":"\u8FD4\u56DE","ui.common.cancel":"\u53D6\u6D88","ui.common.confirm":"\u786E\u8BA4","ui.common.dismiss":"\u5FFD\u7565","ui.common.close":"\u5173\u95ED","ui.common.next":"\u4E0B\u4E00\u6B65","ui.common.submit":"\u63D0\u4EA4","ui.permission.deny":"\u62D2\u7EDD","ui.permission.allowAlways":"\u59CB\u7EC8\u5141\u8BB8","ui.permission.allowOnce":"\u5141\u8BB8\u4E00\u6B21","ui.message.expand":"\u5C55\u5F00\u6D88\u606F","ui.message.collapse":"\u6536\u8D77\u6D88\u606F","ui.message.copy":"\u590D\u5236","ui.message.copyMessage":"\u590D\u5236\u6D88\u606F","ui.message.forkMessage":"\u5206\u53C9\u5230\u65B0\u4F1A\u8BDD","ui.message.revertMessage":"\u91CD\u7F6E\u5230\u6B64\u70B9","ui.message.copyResponse":"\u590D\u5236\u56DE\u590D","ui.message.copied":"\u5DF2\u590D\u5236\uFF01","ui.message.interrupted":"\u5DF2\u4E2D\u65AD","ui.message.queued":"\u6392\u961F\u4E2D","ui.message.attachment.alt":"\u9644\u4EF6","ui.patch.action.deleted":"\u5DF2\u5220\u9664","ui.patch.action.created":"\u5DF2\u521B\u5EFA","ui.patch.action.moved":"\u5DF2\u79FB\u52A8","ui.patch.action.patched":"\u5DF2\u5E94\u7528\u8865\u4E01","ui.question.subtitle.answered":"{{count}} \u5DF2\u56DE\u7B54","ui.question.answer.none":"(\u65E0\u7B54\u6848)","ui.question.review.notAnswered":"(\u672A\u56DE\u7B54)","ui.question.multiHint":"\u53EF\u591A\u9009","ui.question.singleHint":"\u9009\u62E9\u4E00\u4E2A\u7B54\u6848","ui.question.custom.placeholder":"\u8F93\u5165\u4F60\u7684\u7B54\u6848...","ui.fileSearch.placeholder":"\u67E5\u627E","ui.fileSearch.previousMatch":"\u4E0A\u4E00\u4E2A","ui.fileSearch.nextMatch":"\u4E0B\u4E00\u4E2A","ui.fileSearch.close":"\u5173\u95ED\u641C\u7D22","ui.tool.task":"\u4EFB\u52A1","ui.tool.skill":"\u6280\u80FD","ui.basicTool.called":"\u8C03\u7528\u4E86 `{{tool}}`","ui.toolErrorCard.failed":"\u5931\u8D25","ui.toolErrorCard.copyError":"\u590D\u5236\u9519\u8BEF","ui.message.duration.seconds":"{{count}}\u79D2","ui.message.duration.minutesSeconds":"{{minutes}}\u5206 {{seconds}}\u79D2"};export{e as dict};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-f2pv705d.js";var ln=Object.defineProperty,br=(t)=>{throw TypeError(t)},we=(t,e)=>{for(var r in e)ln(t,r,{get:e[r],enumerable:!0})},Ar=(t,e,r)=>e.has(t)||br("Cannot "+r),$=(t,e,r)=>(Ar(t,e,"read from private field"),r?r.call(t):e.get(t)),Kt=(t,e,r)=>e.has(t)?br("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Y=(t,e,r,n)=>(Ar(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Dr={};we(Dr,{languages:()=>ya,parsers:()=>zr,printers:()=>Du});var cn=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},vr=cn,Er="string",Cr="array",Sr="cursor",Be="indent",xe="align",kr="trim",Te="group",Ne="fill",Fe="if-break",wr="indent-if-break",Br="line-suffix",xr="line-suffix-boundary",wt="line",Tr="label",Pe="break-parent",Nr=new Set([Sr,Be,xe,kr,Te,Ne,Fe,wr,Br,xr,wt,Tr,Pe]),hn=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},ht=hn;function pn(t){if(typeof t=="string")return Er;if(Array.isArray(t))return Cr;if(!t)return;let{type:e}=t;if(Nr.has(e))return e}var Fr=pn,dn=(t)=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function mn(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
|
|
3
3
|
Expected it to be 'string' or 'object'.`;if(Fr(t))throw Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=dn([...Nr].map((a)=>`'${a}'`));return`Unexpected doc.type '${t.type}'.
|
|
4
4
|
Expected it to be ${n}.`}var fn=class extends Error{name="InvalidDocError";constructor(t){super(mn(t)),this.doc=t}},gn=fn;function yn(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(u){if(r.has(u))return r.get(u);let i=a(u);return r.set(u,i),i}function a(u){switch(Fr(u)){case Cr:return e(u.map(n));case Ne:return e({...u,parts:u.parts.map(n)});case Fe:return e({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case Te:{let{expandedStates:i,contents:o}=u;return i?(i=i.map(n),o=i[0]):o=n(o),e({...u,contents:o,expandedStates:i})}case xe:case Be:case wr:case Tr:case Br:return e({...u,contents:n(u.contents)});case Er:case Sr:case kr:case xr:case wt:case Pe:return e(u);default:throw new gn(u)}}}function bn(t,e=Cn){return yn(t,(r)=>typeof r=="string"?It(e,r.split(`
|
|
5
5
|
`)):r)}var Le=()=>{},St=Le,Pr=Le,An=Le;function q(t){return St(t),{type:Be,contents:t}}function Dn(t,e){return St(e),{type:xe,contents:e,n:t}}function O(t,e={}){return St(t),Pr(e.expandedStates,!0),{type:Te,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function ye(t){return Dn(-1,t)}function Ke(t){return An(t),{type:Ne,parts:t}}function Qe(t,e="",r={}){return St(t),e!==""&&St(e),{type:Fe,breakContents:t,flatContents:e,groupId:r.groupId}}var Lr={type:Pe},vn={type:wt,hard:!0},En={type:wt,hard:!0,literal:!0},N={type:wt},H={type:wt,soft:!0},mt=[vn,Lr],Cn=[En,Lr];function It(t,e){St(t),Pr(e);let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);return r}var Ht="'",Je='"';function Sn(t,e){let r=e===!0||e===Ht?Ht:Je,n=r===Ht?Je:Ht,a=0,u=0;for(let i of t)i===r?a++:i===n&&u++;return a>u?n:r}var be=Sn;function kn(t){if(typeof t!="string")throw TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var R,wn=class{constructor(t){Kt(this,R),Y(this,R,new Set(t))}getLeadingWhitespaceCount(t){let e=$(this,R),r=0;for(let n=0;n<t.length&&e.has(t.charAt(n));n++)r++;return r}getTrailingWhitespaceCount(t){let e=$(this,R),r=0;for(let n=t.length-1;n>=0&&e.has(t.charAt(n));n--)r++;return r}getLeadingWhitespace(t){let e=this.getLeadingWhitespaceCount(t);return t.slice(0,e)}getTrailingWhitespace(t){let e=this.getTrailingWhitespaceCount(t);return t.slice(t.length-e)}hasLeadingWhitespace(t){return $(this,R).has(t.charAt(0))}hasTrailingWhitespace(t){return $(this,R).has(ht(!1,t,-1))}trimStart(t){let e=this.getLeadingWhitespaceCount(t);return t.slice(e)}trimEnd(t){let e=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-e)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,e=!1){let r=`[${kn([...$(this,R)].join(""))}]+`,n=new RegExp(e?`(${r})`:r,"u");return t.split(n)}hasWhitespaceCharacter(t){let e=$(this,R);return Array.prototype.some.call(t,(r)=>e.has(r))}hasNonWhitespaceCharacter(t){let e=$(this,R);return Array.prototype.some.call(t,(r)=>!e.has(r))}isWhitespaceOnly(t){let e=$(this,R);return Array.prototype.every.call(t,(r)=>e.has(r))}};R=new WeakMap;var Bn=wn,xn=["\t",`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-r9w0thdk.js";function K(Q,Z,H){return typeof Q.default==="function"?Q.default(Z,H):Q.default}function J(Q,Z){if(Q)return Q.push(Z),Q;return[Z]}var q=/[.*+?^${}()|[\]\\]/g;function X(Q){return Q.replace(q,"\\$&")}function T(Q,Z){switch(Z?.errorMode){case"ignore":break;case"warn":console.warn(Q);break;default:throw Error(Q)}}function V(Q){return typeof Q==="boolean"||typeof Q==="number"&&Number.isFinite(Q)||typeof Q==="string"}function w(Q){return Q.every(V)}function x(Q,Z,H){if(H?.ignoreActions?.includes(Z.type))return Q;let Y;switch(Z.type){case"base64":Q.contentEncoding="base64";break;case"bic":case"cuid2":case"decimal":case"digits":case"domain":case"emoji":case"hash":case"hexadecimal":case"hex_color":case"isrc":case"iso_time_second":case"iso_week":case"mac":case"mac48":case"mac64":case"nanoid":case"octal":case"slug":case"ulid":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=Z.requirement.source;break;case"description":Q.description=Z.description;break;case"email":case"rfc_email":Q.format="email";break;case"ends_with":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=`${X(Z.requirement)}$`;break;case"empty":if(Q.type==="array")Q.maxItems=0;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.maxLength=0}break;case"entries":Q.minProperties=Z.requirement,Q.maxProperties=Z.requirement;break;case"examples":if(Array.isArray(Q.examples))Q.examples=[...Q.examples,...Z.examples];else Q.examples=Z.examples;break;case"gt_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "gt_value" action is not supported on type "${Q.type}".`);if(H?.target==="openapi-3.0"){Y=J(Y,'The "gt_value" action is not supported for OpenAPI 3.0.');break}Q.exclusiveMinimum=Z.requirement;break;case"includes":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=X(Z.requirement);break;case"integer":Q.type="integer";break;case"ipv4":Q.format="ipv4";break;case"ipv6":Q.format="ipv6";break;case"iso_date":Q.format="date";break;case"iso_date_time":case"iso_timestamp":Q.format="date-time";break;case"iso_time":Q.format="time";break;case"jws_compact":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=Z.requirement.source;break;case"length":if(Q.type==="array")Q.minItems=Z.requirement,Q.maxItems=Z.requirement;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.minLength=Z.requirement,Q.maxLength=Z.requirement}break;case"lt_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "lt_value" action is not supported on type "${Q.type}".`);if(H?.target==="openapi-3.0"){Y=J(Y,'The "lt_value" action is not supported for OpenAPI 3.0.');break}Q.exclusiveMaximum=Z.requirement;break;case"max_entries":Q.maxProperties=Z.requirement;break;case"max_length":if(Q.type==="array")Q.maxItems=Z.requirement;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.maxLength=Z.requirement}break;case"max_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "max_value" action is not supported on type "${Q.type}".`);Q.maximum=Z.requirement;break;case"metadata":if(typeof Z.metadata.title==="string")Q.title=Z.metadata.title;if(typeof Z.metadata.description==="string")Q.description=Z.metadata.description;if(Array.isArray(Z.metadata.examples))if(Array.isArray(Q.examples))Q.examples=[...Q.examples,...Z.metadata.examples];else Q.examples=Z.metadata.examples;break;case"min_entries":Q.minProperties=Z.requirement;break;case"min_length":if(Q.type==="array")Q.minItems=Z.requirement;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.minLength=Z.requirement}break;case"min_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "min_value" action is not supported on type "${Q.type}".`);Q.minimum=Z.requirement;break;case"multiple_of":Q.multipleOf=Z.requirement;break;case"non_empty":if(Q.type==="array")Q.minItems=1;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.minLength=1}break;case"not_value":if(!V(Z.requirement)){Y=J(Y,'The requirement of the "not_value" action is not JSON compatible.');break}if(H?.target==="openapi-3.0")Q.not={enum:[Z.requirement]};else Q.not={const:Z.requirement};break;case"not_values":if(!w(Z.requirement)){Y=J(Y,'A requirement of the "not_values" action is not JSON compatible.');break}Q.not={enum:Z.requirement};break;case"regex":if(Z.requirement.flags)Y=J(Y,"RegExp flags are not supported by JSON Schema.");if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=Z.requirement.source;break;case"safe_integer":if(Q.type="integer",typeof Q.minimum!=="number"||Q.minimum<Number.MIN_SAFE_INTEGER)Q.minimum=Number.MIN_SAFE_INTEGER;if(typeof Q.maximum!=="number"||Q.maximum>Number.MAX_SAFE_INTEGER)Q.maximum=Number.MAX_SAFE_INTEGER;break;case"starts_with":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=`^${X(Z.requirement)}`;break;case"title":Q.title=Z.title;break;case"url":Q.format="uri";break;case"uuid":Q.format="uuid";break;case"value":if(!V(Z.requirement)){Y=J(Y,'The requirement of the "value" action is not JSON compatible.');break}if(H?.target==="openapi-3.0")Q.enum=[Z.requirement];else Q.const=Z.requirement;break;case"values":if(!w(Z.requirement)){Y=J(Y,'A requirement of the "values" action is not JSON compatible.');break}Q.enum=Z.requirement;break;default:Y=J(Y,`The "${Z.type}" action cannot be converted to JSON Schema.`)}if(H?.overrideAction){let F=H.overrideAction({valibotAction:Z,jsonSchema:Q,errors:Y});if(F)return{...F}}if(Y)for(let F of Y)T(F,H);return Q}function R(Q){return Q.flatMap((Z)=>("pipe"in Z)?R(Z.pipe):Z)}var A=0;function B(Q,Z,H,Y,F=!1){if(!F){let U=Y.referenceMap.get(Z);if(U){if(Q.$ref=`#/$defs/${U}`,H?.overrideRef){let z=H.overrideRef({...Y,referenceId:U,valibotSchema:Z,jsonSchema:Q});if(z)Q.$ref=z}return Q}}if("pipe"in Z){let U=R(Z.pipe),z=0,M=U.length-1;if(H?.typeMode==="input"){let L=U.slice(1).findIndex((W)=>W.kind==="schema"||W.kind==="transformation"&&(W.type==="find_item"||W.type==="parse_json"||W.type==="raw_transform"||W.type==="reduce_items"||W.type==="stringify_json"||W.type==="to_bigint"||W.type==="to_boolean"||W.type==="to_date"||W.type==="to_number"||W.type==="to_string"||W.type==="transform"));if(L!==-1)M=L}else if(H?.typeMode==="output"){let L=U.findLastIndex((W)=>W.kind==="schema");if(L!==-1)z=L}for(let L=z;L<=M;L++){let W=U[L];if(W.kind==="schema"){if(L>z)T('Set the "typeMode" config to "input" or "output" to convert pipelines with multiple schemas.',H);Q=B(Q,W,H,Y,!0)}else Q=x(Q,W,H)}return Q}let N;switch(Z.type){case"boolean":Q.type="boolean";break;case"null":if(H?.target==="openapi-3.0")Q.enum=[null];else Q.type="null";break;case"number":Q.type="number";break;case"string":Q.type="string";break;case"array":Q.type="array",Q.items=B({},Z.item,H,Y);break;case"tuple":case"tuple_with_rest":case"loose_tuple":case"strict_tuple":if(Q.type="array",H?.target==="openapi-3.0"){Q.items={anyOf:[]},Q.minItems=Z.items.length;for(let U of Z.items)Q.items.anyOf.push(B({},U,H,Y));if(Z.type==="tuple_with_rest")Q.items.anyOf.push(B({},Z.rest,H,Y));else if(Z.type==="strict_tuple"||Z.type==="tuple")Q.maxItems=Z.items.length}else if(H?.target==="draft-2020-12"){Q.prefixItems=[],Q.minItems=Z.items.length;for(let U of Z.items)Q.prefixItems.push(B({},U,H,Y));if(Z.type==="tuple_with_rest")Q.items=B({},Z.rest,H,Y);else if(Z.type==="strict_tuple")Q.items=!1}else{Q.items=[],Q.minItems=Z.items.length;for(let U of Z.items)Q.items.push(B({},U,H,Y));if(Z.type==="tuple_with_rest")Q.additionalItems=B({},Z.rest,H,Y);else if(Z.type==="strict_tuple")Q.additionalItems=!1}break;case"object":case"object_with_rest":case"loose_object":case"strict_object":Q.type="object",Q.properties={},Q.required=[];for(let U in Z.entries){let z=Z.entries[U];if(Q.properties[U]=B({},z,H,Y),z.type!=="exact_optional"&&z.type!=="nullish"&&z.type!=="optional")Q.required.push(U)}if(Z.type==="object_with_rest")Q.additionalProperties=B({},Z.rest,H,Y);else if(Z.type==="strict_object")Q.additionalProperties=!1;break;case"record":if(H?.target==="openapi-3.0"&&"pipe"in Z.key)N=J(N,'The "record" schema with a schema for the key that contains a "pipe" cannot be converted to JSON Schema.');if(Z.key.type!=="string")N=J(N,`The "record" schema with the "${Z.key.type}" schema for the key cannot be converted to JSON Schema.`);if(Q.type="object",H?.target!=="openapi-3.0")Q.propertyNames=B({},Z.key,H,Y);Q.additionalProperties=B({},Z.value,H,Y);break;case"any":case"unknown":break;case"never":Q.not={};break;case"nullable":case"nullish":if(H?.target==="openapi-3.0"){let U=B({},Z.wrapped,H,Y);Object.assign(Q,U),Q.nullable=!0}else Q.anyOf=[B({},Z.wrapped,H,Y),{type:"null"}];if(Z.default!==void 0)Q.default=K(Z);break;case"exact_optional":case"optional":case"undefinedable":if(Q=B(Q,Z.wrapped,H,Y),Z.default!==void 0)Q.default=K(Z);break;case"literal":if(typeof Z.literal!=="boolean"&&typeof Z.literal!=="number"&&typeof Z.literal!=="string")N=J(N,'The value of the "literal" schema is not JSON compatible.');if(H?.target==="openapi-3.0")Q.enum=[Z.literal];else Q.const=Z.literal;break;case"enum":if(Q.enum=Z.options,Z.options.every((U)=>typeof U==="string"))Q.type="string";else if(Z.options.every((U)=>typeof U==="number"))Q.type="number";else if(H?.target!=="openapi-3.0")Q.type=["string","number"];break;case"picklist":{let U=Z.options.some((z)=>typeof z!=="number"&&typeof z!=="string");if(U)N=J(N,'An option of the "picklist" schema is not JSON compatible.');if(Q.enum=Z.options,Z.options.every((z)=>typeof z==="string"))Q.type="string";else if(Z.options.every((z)=>typeof z==="number"))Q.type="number";else if(!U&&H?.target!=="openapi-3.0")Q.type=["string","number"];break}case"union":Q.anyOf=Z.options.map((U)=>B({},U,H,Y));break;case"variant":Q.oneOf=Z.options.map((U)=>B({},U,H,Y));break;case"intersect":Q.allOf=Z.options.map((U)=>B({},U,H,Y));break;case"lazy":{let U=Y.getterMap.get(Z.getter);if(!U)U=Z.getter(void 0),Y.getterMap.set(Z.getter,U);let z=Y.referenceMap.get(U);if(!z)z=`${A++}`,Y.referenceMap.set(U,z),Y.definitions[z]=B({},U,H,Y,!0);if(Q.$ref=`#/$defs/${z}`,H?.overrideRef){let M=H.overrideRef({...Y,referenceId:z,valibotSchema:U,jsonSchema:Q});if(M)Q.$ref=M}break}default:N=J(N,`The "${Z.type}" schema cannot be converted to JSON Schema.`)}if(H?.overrideSchema){let U=H.overrideSchema({...Y,referenceId:Y.referenceMap.get(Z),valibotSchema:Z,jsonSchema:Q,errors:N});if(U)return{...U}}if(N)for(let U of N)T(U,H);return Q}var O;function b(Q){O={...O??{},...Q}}function E(){return O}function G(Q,Z){let H={definitions:{},referenceMap:new Map,getterMap:new Map},Y=Z?.definitions??E();if(Y){for(let U in Y)H.referenceMap.set(Y[U],U);for(let U in Y)H.definitions[U]=B({},Y[U],Z,H,!0)}let F=B({},Q,Z,H),N=Z?.target??"draft-07";if(N==="draft-2020-12")F.$schema="https://json-schema.org/draft/2020-12/schema";else if(N==="draft-07")F.$schema="http://json-schema.org/draft-07/schema#";if(H.referenceMap.size)F.$defs=H.definitions;return F}function I(Q,Z){let H={definitions:{},referenceMap:new Map,getterMap:new Map};for(let Y in Q)H.referenceMap.set(Q[Y],Y);for(let Y in Q)H.definitions[Y]=B({},Q[Y],Z,H,!0);return H.definitions}var C=["draft-07","draft-2020-12","openapi-3.0"];function j(Q){return{"~standard":{...Q["~standard"],jsonSchema:{input(Z){if(C.includes(Z.target))return G(Q,{typeMode:"input",target:Z.target,...Z.libraryOptions});throw Error(`Unsupported target: ${Z.target}`)},output(Z){if(C.includes(Z.target))return G(Q,{typeMode:"output",target:Z.target,...Z.libraryOptions});throw Error(`Unsupported target: ${Z.target}`)}}}}}export{j as toStandardJsonSchema,I as toJsonSchemaDefs,G as toJsonSchema,E as getGlobalDefs,b as addGlobalDefs};
|
|
2
|
+
import"./chunk-f2pv705d.js";function K(Q,Z,H){return typeof Q.default==="function"?Q.default(Z,H):Q.default}function J(Q,Z){if(Q)return Q.push(Z),Q;return[Z]}var q=/[.*+?^${}()|[\]\\]/g;function X(Q){return Q.replace(q,"\\$&")}function T(Q,Z){switch(Z?.errorMode){case"ignore":break;case"warn":console.warn(Q);break;default:throw Error(Q)}}function V(Q){return typeof Q==="boolean"||typeof Q==="number"&&Number.isFinite(Q)||typeof Q==="string"}function w(Q){return Q.every(V)}function x(Q,Z,H){if(H?.ignoreActions?.includes(Z.type))return Q;let Y;switch(Z.type){case"base64":Q.contentEncoding="base64";break;case"bic":case"cuid2":case"decimal":case"digits":case"domain":case"emoji":case"hash":case"hexadecimal":case"hex_color":case"isrc":case"iso_time_second":case"iso_week":case"mac":case"mac48":case"mac64":case"nanoid":case"octal":case"slug":case"ulid":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=Z.requirement.source;break;case"description":Q.description=Z.description;break;case"email":case"rfc_email":Q.format="email";break;case"ends_with":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=`${X(Z.requirement)}$`;break;case"empty":if(Q.type==="array")Q.maxItems=0;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.maxLength=0}break;case"entries":Q.minProperties=Z.requirement,Q.maxProperties=Z.requirement;break;case"examples":if(Array.isArray(Q.examples))Q.examples=[...Q.examples,...Z.examples];else Q.examples=Z.examples;break;case"gt_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "gt_value" action is not supported on type "${Q.type}".`);if(H?.target==="openapi-3.0"){Y=J(Y,'The "gt_value" action is not supported for OpenAPI 3.0.');break}Q.exclusiveMinimum=Z.requirement;break;case"includes":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=X(Z.requirement);break;case"integer":Q.type="integer";break;case"ipv4":Q.format="ipv4";break;case"ipv6":Q.format="ipv6";break;case"iso_date":Q.format="date";break;case"iso_date_time":case"iso_timestamp":Q.format="date-time";break;case"iso_time":Q.format="time";break;case"jws_compact":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=Z.requirement.source;break;case"length":if(Q.type==="array")Q.minItems=Z.requirement,Q.maxItems=Z.requirement;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.minLength=Z.requirement,Q.maxLength=Z.requirement}break;case"lt_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "lt_value" action is not supported on type "${Q.type}".`);if(H?.target==="openapi-3.0"){Y=J(Y,'The "lt_value" action is not supported for OpenAPI 3.0.');break}Q.exclusiveMaximum=Z.requirement;break;case"max_entries":Q.maxProperties=Z.requirement;break;case"max_length":if(Q.type==="array")Q.maxItems=Z.requirement;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.maxLength=Z.requirement}break;case"max_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "max_value" action is not supported on type "${Q.type}".`);Q.maximum=Z.requirement;break;case"metadata":if(typeof Z.metadata.title==="string")Q.title=Z.metadata.title;if(typeof Z.metadata.description==="string")Q.description=Z.metadata.description;if(Array.isArray(Z.metadata.examples))if(Array.isArray(Q.examples))Q.examples=[...Q.examples,...Z.metadata.examples];else Q.examples=Z.metadata.examples;break;case"min_entries":Q.minProperties=Z.requirement;break;case"min_length":if(Q.type==="array")Q.minItems=Z.requirement;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.minLength=Z.requirement}break;case"min_value":if(Q.type!=="number"&&Q.type!=="integer")Y=J(Y,`The "min_value" action is not supported on type "${Q.type}".`);Q.minimum=Z.requirement;break;case"multiple_of":Q.multipleOf=Z.requirement;break;case"non_empty":if(Q.type==="array")Q.minItems=1;else{if(Q.type!=="string")Y=J(Y,`The "${Z.type}" action is not supported on type "${Q.type}".`);Q.minLength=1}break;case"not_value":if(!V(Z.requirement)){Y=J(Y,'The requirement of the "not_value" action is not JSON compatible.');break}if(H?.target==="openapi-3.0")Q.not={enum:[Z.requirement]};else Q.not={const:Z.requirement};break;case"not_values":if(!w(Z.requirement)){Y=J(Y,'A requirement of the "not_values" action is not JSON compatible.');break}Q.not={enum:Z.requirement};break;case"regex":if(Z.requirement.flags)Y=J(Y,"RegExp flags are not supported by JSON Schema.");if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=Z.requirement.source;break;case"safe_integer":if(Q.type="integer",typeof Q.minimum!=="number"||Q.minimum<Number.MIN_SAFE_INTEGER)Q.minimum=Number.MIN_SAFE_INTEGER;if(typeof Q.maximum!=="number"||Q.maximum>Number.MAX_SAFE_INTEGER)Q.maximum=Number.MAX_SAFE_INTEGER;break;case"starts_with":if(Q.pattern)Y=J(Y,`The "${Z.type}" action is not supported in combination with another regex action.`);else Q.pattern=`^${X(Z.requirement)}`;break;case"title":Q.title=Z.title;break;case"url":Q.format="uri";break;case"uuid":Q.format="uuid";break;case"value":if(!V(Z.requirement)){Y=J(Y,'The requirement of the "value" action is not JSON compatible.');break}if(H?.target==="openapi-3.0")Q.enum=[Z.requirement];else Q.const=Z.requirement;break;case"values":if(!w(Z.requirement)){Y=J(Y,'A requirement of the "values" action is not JSON compatible.');break}Q.enum=Z.requirement;break;default:Y=J(Y,`The "${Z.type}" action cannot be converted to JSON Schema.`)}if(H?.overrideAction){let F=H.overrideAction({valibotAction:Z,jsonSchema:Q,errors:Y});if(F)return{...F}}if(Y)for(let F of Y)T(F,H);return Q}function R(Q){return Q.flatMap((Z)=>("pipe"in Z)?R(Z.pipe):Z)}var A=0;function B(Q,Z,H,Y,F=!1){if(!F){let U=Y.referenceMap.get(Z);if(U){if(Q.$ref=`#/$defs/${U}`,H?.overrideRef){let z=H.overrideRef({...Y,referenceId:U,valibotSchema:Z,jsonSchema:Q});if(z)Q.$ref=z}return Q}}if("pipe"in Z){let U=R(Z.pipe),z=0,M=U.length-1;if(H?.typeMode==="input"){let L=U.slice(1).findIndex((W)=>W.kind==="schema"||W.kind==="transformation"&&(W.type==="find_item"||W.type==="parse_json"||W.type==="raw_transform"||W.type==="reduce_items"||W.type==="stringify_json"||W.type==="to_bigint"||W.type==="to_boolean"||W.type==="to_date"||W.type==="to_number"||W.type==="to_string"||W.type==="transform"));if(L!==-1)M=L}else if(H?.typeMode==="output"){let L=U.findLastIndex((W)=>W.kind==="schema");if(L!==-1)z=L}for(let L=z;L<=M;L++){let W=U[L];if(W.kind==="schema"){if(L>z)T('Set the "typeMode" config to "input" or "output" to convert pipelines with multiple schemas.',H);Q=B(Q,W,H,Y,!0)}else Q=x(Q,W,H)}return Q}let N;switch(Z.type){case"boolean":Q.type="boolean";break;case"null":if(H?.target==="openapi-3.0")Q.enum=[null];else Q.type="null";break;case"number":Q.type="number";break;case"string":Q.type="string";break;case"array":Q.type="array",Q.items=B({},Z.item,H,Y);break;case"tuple":case"tuple_with_rest":case"loose_tuple":case"strict_tuple":if(Q.type="array",H?.target==="openapi-3.0"){Q.items={anyOf:[]},Q.minItems=Z.items.length;for(let U of Z.items)Q.items.anyOf.push(B({},U,H,Y));if(Z.type==="tuple_with_rest")Q.items.anyOf.push(B({},Z.rest,H,Y));else if(Z.type==="strict_tuple"||Z.type==="tuple")Q.maxItems=Z.items.length}else if(H?.target==="draft-2020-12"){Q.prefixItems=[],Q.minItems=Z.items.length;for(let U of Z.items)Q.prefixItems.push(B({},U,H,Y));if(Z.type==="tuple_with_rest")Q.items=B({},Z.rest,H,Y);else if(Z.type==="strict_tuple")Q.items=!1}else{Q.items=[],Q.minItems=Z.items.length;for(let U of Z.items)Q.items.push(B({},U,H,Y));if(Z.type==="tuple_with_rest")Q.additionalItems=B({},Z.rest,H,Y);else if(Z.type==="strict_tuple")Q.additionalItems=!1}break;case"object":case"object_with_rest":case"loose_object":case"strict_object":Q.type="object",Q.properties={},Q.required=[];for(let U in Z.entries){let z=Z.entries[U];if(Q.properties[U]=B({},z,H,Y),z.type!=="exact_optional"&&z.type!=="nullish"&&z.type!=="optional")Q.required.push(U)}if(Z.type==="object_with_rest")Q.additionalProperties=B({},Z.rest,H,Y);else if(Z.type==="strict_object")Q.additionalProperties=!1;break;case"record":if(H?.target==="openapi-3.0"&&"pipe"in Z.key)N=J(N,'The "record" schema with a schema for the key that contains a "pipe" cannot be converted to JSON Schema.');if(Z.key.type!=="string")N=J(N,`The "record" schema with the "${Z.key.type}" schema for the key cannot be converted to JSON Schema.`);if(Q.type="object",H?.target!=="openapi-3.0")Q.propertyNames=B({},Z.key,H,Y);Q.additionalProperties=B({},Z.value,H,Y);break;case"any":case"unknown":break;case"never":Q.not={};break;case"nullable":case"nullish":if(H?.target==="openapi-3.0"){let U=B({},Z.wrapped,H,Y);Object.assign(Q,U),Q.nullable=!0}else Q.anyOf=[B({},Z.wrapped,H,Y),{type:"null"}];if(Z.default!==void 0)Q.default=K(Z);break;case"exact_optional":case"optional":case"undefinedable":if(Q=B(Q,Z.wrapped,H,Y),Z.default!==void 0)Q.default=K(Z);break;case"literal":if(typeof Z.literal!=="boolean"&&typeof Z.literal!=="number"&&typeof Z.literal!=="string")N=J(N,'The value of the "literal" schema is not JSON compatible.');if(H?.target==="openapi-3.0")Q.enum=[Z.literal];else Q.const=Z.literal;break;case"enum":if(Q.enum=Z.options,Z.options.every((U)=>typeof U==="string"))Q.type="string";else if(Z.options.every((U)=>typeof U==="number"))Q.type="number";else if(H?.target!=="openapi-3.0")Q.type=["string","number"];break;case"picklist":{let U=Z.options.some((z)=>typeof z!=="number"&&typeof z!=="string");if(U)N=J(N,'An option of the "picklist" schema is not JSON compatible.');if(Q.enum=Z.options,Z.options.every((z)=>typeof z==="string"))Q.type="string";else if(Z.options.every((z)=>typeof z==="number"))Q.type="number";else if(!U&&H?.target!=="openapi-3.0")Q.type=["string","number"];break}case"union":Q.anyOf=Z.options.map((U)=>B({},U,H,Y));break;case"variant":Q.oneOf=Z.options.map((U)=>B({},U,H,Y));break;case"intersect":Q.allOf=Z.options.map((U)=>B({},U,H,Y));break;case"lazy":{let U=Y.getterMap.get(Z.getter);if(!U)U=Z.getter(void 0),Y.getterMap.set(Z.getter,U);let z=Y.referenceMap.get(U);if(!z)z=`${A++}`,Y.referenceMap.set(U,z),Y.definitions[z]=B({},U,H,Y,!0);if(Q.$ref=`#/$defs/${z}`,H?.overrideRef){let M=H.overrideRef({...Y,referenceId:z,valibotSchema:U,jsonSchema:Q});if(M)Q.$ref=M}break}default:N=J(N,`The "${Z.type}" schema cannot be converted to JSON Schema.`)}if(H?.overrideSchema){let U=H.overrideSchema({...Y,referenceId:Y.referenceMap.get(Z),valibotSchema:Z,jsonSchema:Q,errors:N});if(U)return{...U}}if(N)for(let U of N)T(U,H);return Q}var O;function b(Q){O={...O??{},...Q}}function E(){return O}function G(Q,Z){let H={definitions:{},referenceMap:new Map,getterMap:new Map},Y=Z?.definitions??E();if(Y){for(let U in Y)H.referenceMap.set(Y[U],U);for(let U in Y)H.definitions[U]=B({},Y[U],Z,H,!0)}let F=B({},Q,Z,H),N=Z?.target??"draft-07";if(N==="draft-2020-12")F.$schema="https://json-schema.org/draft/2020-12/schema";else if(N==="draft-07")F.$schema="http://json-schema.org/draft-07/schema#";if(H.referenceMap.size)F.$defs=H.definitions;return F}function I(Q,Z){let H={definitions:{},referenceMap:new Map,getterMap:new Map};for(let Y in Q)H.referenceMap.set(Q[Y],Y);for(let Y in Q)H.definitions[Y]=B({},Q[Y],Z,H,!0);return H.definitions}var C=["draft-07","draft-2020-12","openapi-3.0"];function j(Q){return{"~standard":{...Q["~standard"],jsonSchema:{input(Z){if(C.includes(Z.target))return G(Q,{typeMode:"input",target:Z.target,...Z.libraryOptions});throw Error(`Unsupported target: ${Z.target}`)},output(Z){if(C.includes(Z.target))return G(Q,{typeMode:"output",target:Z.target,...Z.libraryOptions});throw Error(`Unsupported target: ${Z.target}`)}}}}}export{j as toStandardJsonSchema,I as toJsonSchemaDefs,G as toJsonSchema,E as getGlobalDefs,b as addGlobalDefs};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hl as a,il as b,jl as c,kl as d,ll as e,ml as f,nl as g,ol as h,pl as i}from"./chunk-jxkrhrp0.js";import"./chunk-5r05d901.js";import"./chunk-msh249db.js";import"./chunk-kmzpeq8k.js";import"./chunk-z6kcnpsj.js";import"./chunk-ts2k13g0.js";import"./chunk-01e3v1xz.js";import"./chunk-dbpkq7ba.js";import"./chunk-v3nmnm57.js";import"./chunk-hwsqqkrv.js";import"./chunk-mbbxedsq.js";import"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import"./chunk-tezrgfc6.js";import"./chunk-f2pv705d.js";export{i as stopRefresh,h as startRefresh,g as refresh,d as readModelCatalogResponse,f as get,c as Provider,b as Model,a as MODEL_CATALOG_MAX_BYTES,e as Data};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$e as u,Re as P,Ve as C,Ze as h,_e as g,bf as m,jf as d,kf as S,of as c,pf as i,qf as M,sf as p}from"./chunk-7mppvhv9.js";import{Sp as T,Tp as v,Vp as w}from"./chunk-ptqk1j2r.js";import"./chunk-cqtkxwd8.js";import"./chunk-pr7z5dj8.js";import{Jt as j}from"./chunk-j9h1sp4g.js";import"./chunk-p6crzjtf.js";import"./chunk-r9w0thdk.js";function y(B){if(B==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let{prompt_tokens:Q,completion_tokens:X}=B;return{inputTokens:{total:Q,noCache:Q,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:X,reasoning:void 0},raw:B}}function R({data:B,mediaType:Q}){return B instanceof URL?B.toString():`data:${Q};base64,${C(B)}`}function n(B){var Q;let X=[];for(let D=0;D<B.length;D++){let{role:K,content:$}=B[D],N=D===B.length-1;switch(K){case"system":{X.push({role:"system",content:$});break}case"user":{X.push({role:"user",content:$.map((G)=>{switch(G.type){case"text":return{type:"text",text:G.text};case"file":if(G.mediaType.startsWith("image/")){let Z=G.mediaType==="image/*"?"image/jpeg":G.mediaType;return{type:"image_url",image_url:R({data:G.data,mediaType:Z})}}else if(G.mediaType==="application/pdf")return{type:"document_url",document_url:R({data:G.data,mediaType:"application/pdf"})};else throw new w({functionality:"Only images and PDF file parts are supported"})}})});break}case"assistant":{let G="",Z=[];for(let Y of $)switch(Y.type){case"text":{G+=Y.text;break}case"tool-call":{Z.push({id:Y.toolCallId,type:"function",function:{name:Y.toolName,arguments:JSON.stringify(Y.input)}});break}case"reasoning":{G+=Y.text;break}default:throw Error(`Unsupported content type in assistant message: ${Y.type}`)}X.push({role:"assistant",content:G,prefix:N?!0:void 0,tool_calls:Z.length>0?Z:void 0});break}case"tool":{for(let G of $){if(G.type==="tool-approval-response")continue;let Z=G.output,Y;switch(Z.type){case"text":case"error-text":Y=Z.value;break;case"execution-denied":Y=(Q=Z.reason)!=null?Q:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(Z.value);break}X.push({role:"tool",name:G.toolName,tool_call_id:G.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${K}`)}}return X}function k({id:B,model:Q,created:X}){return{id:B!=null?B:void 0,modelId:Q!=null?Q:void 0,timestamp:X!=null?new Date(X*1000):void 0}}function x(B){switch(B){case"stop":return"stop";case"length":case"model_length":return"length";case"tool_calls":return"tool-calls";default:return"other"}}var t=j.object({safePrompt:j.boolean().optional(),documentImageLimit:j.number().optional(),documentPageLimit:j.number().optional(),structuredOutputs:j.boolean().optional(),strictJsonSchema:j.boolean().optional(),parallelToolCalls:j.boolean().optional(),reasoningEffort:j.enum(["high","none"]).optional()}),e=j.object({object:j.literal("error"),message:j.string(),type:j.string(),param:j.string().nullable(),code:j.string().nullable()}),b=c({errorSchema:e,errorToMessage:(B)=>B.message});function o({tools:B,toolChoice:Q}){B=(B==null?void 0:B.length)?B:void 0;let X=[];if(B==null)return{tools:void 0,toolChoice:void 0,toolWarnings:X};let D=[];for(let $ of B)if($.type==="provider")X.push({type:"unsupported",feature:`provider-defined tool ${$.id}`});else D.push({type:"function",function:{name:$.name,description:$.description,parameters:$.inputSchema,...$.strict!=null?{strict:$.strict}:{}}});if(Q==null)return{tools:D,toolChoice:void 0,toolWarnings:X};let K=Q.type;switch(K){case"auto":case"none":return{tools:D,toolChoice:K,toolWarnings:X};case"required":return{tools:D,toolChoice:"any",toolWarnings:X};case"tool":return{tools:D.filter(($)=>$.function.name===Q.toolName),toolChoice:"any",toolWarnings:X};default:throw new w({functionality:`tool choice type: ${K}`})}}var jj=class{constructor(B,Q){this.specificationVersion="v3",this.supportedUrls={"application/pdf":[/^https:\/\/.*$/]};var X;this.modelId=B,this.config=Q,this.generateId=(X=Q.generateId)!=null?X:h}get provider(){return this.config.provider}async getArgs({prompt:B,maxOutputTokens:Q,temperature:X,topP:D,topK:K,frequencyPenalty:$,presencePenalty:N,stopSequences:G,responseFormat:Z,seed:Y,providerOptions:J,tools:f,toolChoice:L}){var U,O,V,q;let E=[],A=(U=await d({provider:"mistral",providerOptions:J,schema:t}))!=null?U:{};if(K!=null)E.push({type:"unsupported",feature:"topK"});if($!=null)E.push({type:"unsupported",feature:"frequencyPenalty"});if(N!=null)E.push({type:"unsupported",feature:"presencePenalty"});if(G!=null)E.push({type:"unsupported",feature:"stopSequences"});let H=(O=A.structuredOutputs)!=null?O:!0,z=(V=A.strictJsonSchema)!=null?V:!1;if((Z==null?void 0:Z.type)==="json"&&!(Z==null?void 0:Z.schema))B=u({messages:B,schema:Z.schema});let W={model:this.modelId,safe_prompt:A.safePrompt,max_tokens:Q,temperature:X,top_p:D,random_seed:Y,reasoning_effort:A.reasoningEffort,response_format:(Z==null?void 0:Z.type)==="json"?H&&(Z==null?void 0:Z.schema)!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:z,name:(q=Z.name)!=null?q:"response",description:Z.description}}:{type:"json_object"}:void 0,document_image_limit:A.documentImageLimit,document_page_limit:A.documentPageLimit,messages:n(B)},{tools:_,toolChoice:s,toolWarnings:r}=o({tools:f,toolChoice:L});return{args:{...W,tools:_,tool_choice:s,..._!=null&&A.parallelToolCalls!==void 0?{parallel_tool_calls:A.parallelToolCalls}:{}},warnings:[...E,...r]}}async doGenerate(B){var Q;let{args:X,warnings:D}=await this.getArgs(B),{responseHeaders:K,value:$,rawValue:N}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:X,failedResponseHandler:b,successfulResponseHandler:M(Bj),abortSignal:B.abortSignal,fetch:this.config.fetch}),G=$.choices[0],Z=[];if(G.message.content!=null&&Array.isArray(G.message.content)){for(let Y of G.message.content)if(Y.type==="thinking"){let J=F(Y.thinking);if(J.length>0)Z.push({type:"reasoning",text:J})}else if(Y.type==="text"){if(Y.text.length>0)Z.push({type:"text",text:Y.text})}}else{let Y=I(G.message.content);if(Y!=null&&Y.length>0)Z.push({type:"text",text:Y})}if(G.message.tool_calls!=null)for(let Y of G.message.tool_calls)Z.push({type:"tool-call",toolCallId:Y.id,toolName:Y.function.name,input:Y.function.arguments});return{content:Z,finishReason:{unified:x(G.finish_reason),raw:(Q=G.finish_reason)!=null?Q:void 0},usage:y($.usage),request:{body:X},response:{...k($),headers:K,body:N},warnings:D}}async doStream(B){let{args:Q,warnings:X}=await this.getArgs(B),D={...Q,stream:!0},{responseHeaders:K,value:$}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:D,failedResponseHandler:b,successfulResponseHandler:i(Gj),abortSignal:B.abortSignal,fetch:this.config.fetch}),N={unified:"other",raw:void 0},G=void 0,Z=!0,Y=!1,J=null,f=this.generateId;return{stream:$.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:X})},transform(L,U){if(B.includeRawChunks)U.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){U.enqueue({type:"error",error:L.error});return}let O=L.value;if(Z)Z=!1,U.enqueue({type:"response-metadata",...k(O)});if(O.usage!=null)G=O.usage;let V=O.choices[0],q=V.delta,E=I(q.content);if(q.content!=null&&Array.isArray(q.content)){for(let A of q.content)if(A.type==="thinking"){let H=F(A.thinking);if(H.length>0){if(J==null){if(Y)U.enqueue({type:"text-end",id:"0"}),Y=!1;J=f(),U.enqueue({type:"reasoning-start",id:J})}U.enqueue({type:"reasoning-delta",id:J,delta:H})}}}if(E!=null&&E.length>0){if(!Y){if(J!=null)U.enqueue({type:"reasoning-end",id:J}),J=null;U.enqueue({type:"text-start",id:"0"}),Y=!0}U.enqueue({type:"text-delta",id:"0",delta:E})}if((q==null?void 0:q.tool_calls)!=null)for(let A of q.tool_calls){let H=A.id,z=A.function.name,W=A.function.arguments;U.enqueue({type:"tool-input-start",id:H,toolName:z}),U.enqueue({type:"tool-input-delta",id:H,delta:W}),U.enqueue({type:"tool-input-end",id:H}),U.enqueue({type:"tool-call",toolCallId:H,toolName:z,input:W})}if(V.finish_reason!=null)N={unified:x(V.finish_reason),raw:V.finish_reason}},flush(L){if(J!=null)L.enqueue({type:"reasoning-end",id:J});if(Y)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:N,usage:y(G)})}})),request:{body:D},response:{headers:K}}}};function F(B){return B.filter((Q)=>Q.type==="text").map((Q)=>Q.text).join("")}function I(B){if(typeof B==="string")return B;if(B==null)return;let Q=[];for(let X of B){let{type:D}=X;switch(D){case"text":Q.push(X.text);break;case"thinking":case"image_url":case"reference":break;default:throw Error(`Unsupported type: ${D}`)}}return Q.length?Q.join(""):void 0}var l=j.union([j.string(),j.array(j.discriminatedUnion("type",[j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("image_url"),image_url:j.union([j.string(),j.object({url:j.string(),detail:j.string().nullable()})])}),j.object({type:j.literal("reference"),reference_ids:j.array(j.union([j.string(),j.number()]))}),j.object({type:j.literal("thinking"),thinking:j.array(j.object({type:j.literal("text"),text:j.string()}))})]))]).nullish(),a=j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()}),Bj=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"),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),index:j.number(),finish_reason:j.string().nullish()})),object:j.literal("chat.completion"),usage:a}),Gj=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"]).optional(),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish(),index:j.number()})),usage:a.nullish()}),Qj=class{constructor(B,Q){this.specificationVersion="v3",this.maxEmbeddingsPerCall=32,this.supportsParallelCalls=!1,this.modelId=B,this.config=Q}get provider(){return this.config.provider}async doEmbed({values:B,abortSignal:Q,headers:X}){if(B.length>this.maxEmbeddingsPerCall)throw new v({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:B});let{responseHeaders:D,value:K,rawValue:$}=await S({url:`${this.config.baseURL}/embeddings`,headers:P(this.config.headers(),X),body:{model:this.modelId,input:B,encoding_format:"float"},failedResponseHandler:b,successfulResponseHandler:M(Xj),abortSignal:Q,fetch:this.config.fetch});return{warnings:[],embeddings:K.data.map((N)=>N.embedding),usage:K.usage?{tokens:K.usage.prompt_tokens}:void 0,response:{headers:D,body:$}}}},Xj=j.object({data:j.array(j.object({embedding:j.array(j.number())})),usage:j.object({prompt_tokens:j.number()}).nullish()}),Yj="3.0.27";function Zj(B={}){var Q;let X=(Q=p(B.baseURL))!=null?Q:"https://api.mistral.ai/v1",D=()=>g({Authorization:`Bearer ${m({apiKey:B.apiKey,environmentVariableName:"MISTRAL_API_KEY",description:"Mistral"})}`,...B.headers},`ai-sdk/mistral/${Yj}`),K=(G)=>new jj(G,{provider:"mistral.chat",baseURL:X,headers:D,fetch:B.fetch,generateId:B.generateId}),$=(G)=>new Qj(G,{provider:"mistral.embedding",baseURL:X,headers:D,fetch:B.fetch}),N=function(G){if(new.target)throw Error("The Mistral model function cannot be called with the new keyword.");return K(G)};return N.specificationVersion="v3",N.languageModel=K,N.chat=K,N.embedding=$,N.embeddingModel=$,N.textEmbedding=$,N.textEmbeddingModel=$,N.imageModel=(G)=>{throw new T({modelId:G,modelType:"imageModel"})},N}var Pj=Zj();export{Pj as mistral,Zj as createMistral,Yj as VERSION};
|
|
2
|
+
import{$e as g,Se as P,We as C,_e as h,af as u,cf as m,kf as d,lf as S,pf as c,qf as i,rf as M,tf as p}from"./chunk-gwrnxcdn.js";import{qr as T,rr as v,tr as w}from"./chunk-n5p7cn4w.js";import"./chunk-cqtkxwd8.js";import"./chunk-mhxyv9c8.js";import{hv as j}from"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-f2pv705d.js";function y(B){if(B==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let{prompt_tokens:Q,completion_tokens:X}=B;return{inputTokens:{total:Q,noCache:Q,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:X,reasoning:void 0},raw:B}}function R({data:B,mediaType:Q}){return B instanceof URL?B.toString():`data:${Q};base64,${C(B)}`}function n(B){var Q;let X=[];for(let D=0;D<B.length;D++){let{role:K,content:$}=B[D],N=D===B.length-1;switch(K){case"system":{X.push({role:"system",content:$});break}case"user":{X.push({role:"user",content:$.map((G)=>{switch(G.type){case"text":return{type:"text",text:G.text};case"file":if(G.mediaType.startsWith("image/")){let Z=G.mediaType==="image/*"?"image/jpeg":G.mediaType;return{type:"image_url",image_url:R({data:G.data,mediaType:Z})}}else if(G.mediaType==="application/pdf")return{type:"document_url",document_url:R({data:G.data,mediaType:"application/pdf"})};else throw new w({functionality:"Only images and PDF file parts are supported"})}})});break}case"assistant":{let G="",Z=[];for(let Y of $)switch(Y.type){case"text":{G+=Y.text;break}case"tool-call":{Z.push({id:Y.toolCallId,type:"function",function:{name:Y.toolName,arguments:JSON.stringify(Y.input)}});break}case"reasoning":{G+=Y.text;break}default:throw Error(`Unsupported content type in assistant message: ${Y.type}`)}X.push({role:"assistant",content:G,prefix:N?!0:void 0,tool_calls:Z.length>0?Z:void 0});break}case"tool":{for(let G of $){if(G.type==="tool-approval-response")continue;let Z=G.output,Y;switch(Z.type){case"text":case"error-text":Y=Z.value;break;case"execution-denied":Y=(Q=Z.reason)!=null?Q:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(Z.value);break}X.push({role:"tool",name:G.toolName,tool_call_id:G.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${K}`)}}return X}function k({id:B,model:Q,created:X}){return{id:B!=null?B:void 0,modelId:Q!=null?Q:void 0,timestamp:X!=null?new Date(X*1000):void 0}}function x(B){switch(B){case"stop":return"stop";case"length":case"model_length":return"length";case"tool_calls":return"tool-calls";default:return"other"}}var t=j.object({safePrompt:j.boolean().optional(),documentImageLimit:j.number().optional(),documentPageLimit:j.number().optional(),structuredOutputs:j.boolean().optional(),strictJsonSchema:j.boolean().optional(),parallelToolCalls:j.boolean().optional(),reasoningEffort:j.enum(["high","none"]).optional()}),e=j.object({object:j.literal("error"),message:j.string(),type:j.string(),param:j.string().nullable(),code:j.string().nullable()}),b=c({errorSchema:e,errorToMessage:(B)=>B.message});function o({tools:B,toolChoice:Q}){B=(B==null?void 0:B.length)?B:void 0;let X=[];if(B==null)return{tools:void 0,toolChoice:void 0,toolWarnings:X};let D=[];for(let $ of B)if($.type==="provider")X.push({type:"unsupported",feature:`provider-defined tool ${$.id}`});else D.push({type:"function",function:{name:$.name,description:$.description,parameters:$.inputSchema,...$.strict!=null?{strict:$.strict}:{}}});if(Q==null)return{tools:D,toolChoice:void 0,toolWarnings:X};let K=Q.type;switch(K){case"auto":case"none":return{tools:D,toolChoice:K,toolWarnings:X};case"required":return{tools:D,toolChoice:"any",toolWarnings:X};case"tool":return{tools:D.filter(($)=>$.function.name===Q.toolName),toolChoice:"any",toolWarnings:X};default:throw new w({functionality:`tool choice type: ${K}`})}}var jj=class{constructor(B,Q){this.specificationVersion="v3",this.supportedUrls={"application/pdf":[/^https:\/\/.*$/]};var X;this.modelId=B,this.config=Q,this.generateId=(X=Q.generateId)!=null?X:h}get provider(){return this.config.provider}async getArgs({prompt:B,maxOutputTokens:Q,temperature:X,topP:D,topK:K,frequencyPenalty:$,presencePenalty:N,stopSequences:G,responseFormat:Z,seed:Y,providerOptions:J,tools:f,toolChoice:L}){var U,O,V,q;let E=[],A=(U=await d({provider:"mistral",providerOptions:J,schema:t}))!=null?U:{};if(K!=null)E.push({type:"unsupported",feature:"topK"});if($!=null)E.push({type:"unsupported",feature:"frequencyPenalty"});if(N!=null)E.push({type:"unsupported",feature:"presencePenalty"});if(G!=null)E.push({type:"unsupported",feature:"stopSequences"});let H=(O=A.structuredOutputs)!=null?O:!0,z=(V=A.strictJsonSchema)!=null?V:!1;if((Z==null?void 0:Z.type)==="json"&&!(Z==null?void 0:Z.schema))B=u({messages:B,schema:Z.schema});let W={model:this.modelId,safe_prompt:A.safePrompt,max_tokens:Q,temperature:X,top_p:D,random_seed:Y,reasoning_effort:A.reasoningEffort,response_format:(Z==null?void 0:Z.type)==="json"?H&&(Z==null?void 0:Z.schema)!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:z,name:(q=Z.name)!=null?q:"response",description:Z.description}}:{type:"json_object"}:void 0,document_image_limit:A.documentImageLimit,document_page_limit:A.documentPageLimit,messages:n(B)},{tools:_,toolChoice:s,toolWarnings:r}=o({tools:f,toolChoice:L});return{args:{...W,tools:_,tool_choice:s,..._!=null&&A.parallelToolCalls!==void 0?{parallel_tool_calls:A.parallelToolCalls}:{}},warnings:[...E,...r]}}async doGenerate(B){var Q;let{args:X,warnings:D}=await this.getArgs(B),{responseHeaders:K,value:$,rawValue:N}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:X,failedResponseHandler:b,successfulResponseHandler:M(Bj),abortSignal:B.abortSignal,fetch:this.config.fetch}),G=$.choices[0],Z=[];if(G.message.content!=null&&Array.isArray(G.message.content)){for(let Y of G.message.content)if(Y.type==="thinking"){let J=F(Y.thinking);if(J.length>0)Z.push({type:"reasoning",text:J})}else if(Y.type==="text"){if(Y.text.length>0)Z.push({type:"text",text:Y.text})}}else{let Y=I(G.message.content);if(Y!=null&&Y.length>0)Z.push({type:"text",text:Y})}if(G.message.tool_calls!=null)for(let Y of G.message.tool_calls)Z.push({type:"tool-call",toolCallId:Y.id,toolName:Y.function.name,input:Y.function.arguments});return{content:Z,finishReason:{unified:x(G.finish_reason),raw:(Q=G.finish_reason)!=null?Q:void 0},usage:y($.usage),request:{body:X},response:{...k($),headers:K,body:N},warnings:D}}async doStream(B){let{args:Q,warnings:X}=await this.getArgs(B),D={...Q,stream:!0},{responseHeaders:K,value:$}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:D,failedResponseHandler:b,successfulResponseHandler:i(Gj),abortSignal:B.abortSignal,fetch:this.config.fetch}),N={unified:"other",raw:void 0},G=void 0,Z=!0,Y=!1,J=null,f=this.generateId;return{stream:$.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:X})},transform(L,U){if(B.includeRawChunks)U.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){U.enqueue({type:"error",error:L.error});return}let O=L.value;if(Z)Z=!1,U.enqueue({type:"response-metadata",...k(O)});if(O.usage!=null)G=O.usage;let V=O.choices[0],q=V.delta,E=I(q.content);if(q.content!=null&&Array.isArray(q.content)){for(let A of q.content)if(A.type==="thinking"){let H=F(A.thinking);if(H.length>0){if(J==null){if(Y)U.enqueue({type:"text-end",id:"0"}),Y=!1;J=f(),U.enqueue({type:"reasoning-start",id:J})}U.enqueue({type:"reasoning-delta",id:J,delta:H})}}}if(E!=null&&E.length>0){if(!Y){if(J!=null)U.enqueue({type:"reasoning-end",id:J}),J=null;U.enqueue({type:"text-start",id:"0"}),Y=!0}U.enqueue({type:"text-delta",id:"0",delta:E})}if((q==null?void 0:q.tool_calls)!=null)for(let A of q.tool_calls){let H=A.id,z=A.function.name,W=A.function.arguments;U.enqueue({type:"tool-input-start",id:H,toolName:z}),U.enqueue({type:"tool-input-delta",id:H,delta:W}),U.enqueue({type:"tool-input-end",id:H}),U.enqueue({type:"tool-call",toolCallId:H,toolName:z,input:W})}if(V.finish_reason!=null)N={unified:x(V.finish_reason),raw:V.finish_reason}},flush(L){if(J!=null)L.enqueue({type:"reasoning-end",id:J});if(Y)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:N,usage:y(G)})}})),request:{body:D},response:{headers:K}}}};function F(B){return B.filter((Q)=>Q.type==="text").map((Q)=>Q.text).join("")}function I(B){if(typeof B==="string")return B;if(B==null)return;let Q=[];for(let X of B){let{type:D}=X;switch(D){case"text":Q.push(X.text);break;case"thinking":case"image_url":case"reference":break;default:throw Error(`Unsupported type: ${D}`)}}return Q.length?Q.join(""):void 0}var l=j.union([j.string(),j.array(j.discriminatedUnion("type",[j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("image_url"),image_url:j.union([j.string(),j.object({url:j.string(),detail:j.string().nullable()})])}),j.object({type:j.literal("reference"),reference_ids:j.array(j.union([j.string(),j.number()]))}),j.object({type:j.literal("thinking"),thinking:j.array(j.object({type:j.literal("text"),text:j.string()}))})]))]).nullish(),a=j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()}),Bj=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"),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),index:j.number(),finish_reason:j.string().nullish()})),object:j.literal("chat.completion"),usage:a}),Gj=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"]).optional(),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish(),index:j.number()})),usage:a.nullish()}),Qj=class{constructor(B,Q){this.specificationVersion="v3",this.maxEmbeddingsPerCall=32,this.supportsParallelCalls=!1,this.modelId=B,this.config=Q}get provider(){return this.config.provider}async doEmbed({values:B,abortSignal:Q,headers:X}){if(B.length>this.maxEmbeddingsPerCall)throw new v({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:B});let{responseHeaders:D,value:K,rawValue:$}=await S({url:`${this.config.baseURL}/embeddings`,headers:P(this.config.headers(),X),body:{model:this.modelId,input:B,encoding_format:"float"},failedResponseHandler:b,successfulResponseHandler:M(Xj),abortSignal:Q,fetch:this.config.fetch});return{warnings:[],embeddings:K.data.map((N)=>N.embedding),usage:K.usage?{tokens:K.usage.prompt_tokens}:void 0,response:{headers:D,body:$}}}},Xj=j.object({data:j.array(j.object({embedding:j.array(j.number())})),usage:j.object({prompt_tokens:j.number()}).nullish()}),Yj="3.0.27";function Zj(B={}){var Q;let X=(Q=p(B.baseURL))!=null?Q:"https://api.mistral.ai/v1",D=()=>g({Authorization:`Bearer ${m({apiKey:B.apiKey,environmentVariableName:"MISTRAL_API_KEY",description:"Mistral"})}`,...B.headers},`ai-sdk/mistral/${Yj}`),K=(G)=>new jj(G,{provider:"mistral.chat",baseURL:X,headers:D,fetch:B.fetch,generateId:B.generateId}),$=(G)=>new Qj(G,{provider:"mistral.embedding",baseURL:X,headers:D,fetch:B.fetch}),N=function(G){if(new.target)throw Error("The Mistral model function cannot be called with the new keyword.");return K(G)};return N.specificationVersion="v3",N.languageModel=K,N.chat=K,N.embedding=$,N.embeddingModel=$,N.textEmbedding=$,N.textEmbeddingModel=$,N.imageModel=(G)=>{throw new T({modelId:G,modelType:"imageModel"})},N}var Pj=Zj();export{Pj as mistral,Zj as createMistral,Yj as VERSION};
|