@qitqode/qitqode-android-arm64 0.2.15 → 0.2.16
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-wrzn87w0.js → chunk-098mr0zz.js} +1 -1
- package/bundle/{chunk-j15wejz0.js → chunk-0catm9vq.js} +1 -1
- package/bundle/{chunk-q896qkhe.js → chunk-0cqs1qkh.js} +1 -1
- package/bundle/{chunk-d10qre1b.js → chunk-0f3ncvfe.js} +1 -1
- package/bundle/{chunk-yhpwceqg.js → chunk-0gqwvt8w.js} +2 -2
- package/bundle/chunk-0mb55ytc.js +2 -0
- package/bundle/{chunk-dpbm03yh.js → chunk-0n2ncnwz.js} +1 -1
- package/bundle/chunk-0y0hm0m5.js +2 -0
- package/bundle/chunk-120e8yr1.js +2 -0
- package/bundle/{chunk-spcdwmy4.js → chunk-1aneepm5.js} +1 -1
- package/bundle/chunk-1dxm8yev.js +2 -0
- package/bundle/{chunk-96sra8g8.js → chunk-1jg7cybp.js} +1 -1
- package/bundle/{chunk-qk6jh32z.js → chunk-1k5nfw7g.js} +1 -1
- package/bundle/{chunk-fmcg649e.js → chunk-1kksj8cn.js} +1 -1
- package/bundle/chunk-1pgpv979.js +2 -0
- package/bundle/{chunk-szfqmkj6.js → chunk-1xsjkf4c.js} +1 -1
- package/bundle/{chunk-zx63mepv.js → chunk-1yetxft4.js} +1 -1
- package/bundle/chunk-23zh9s18.js +2 -0
- package/bundle/{chunk-8qpfphdz.js → chunk-24pf9s68.js} +1 -1
- package/bundle/chunk-2a0zf12g.js +2 -0
- package/bundle/chunk-2b8x31p3.js +2 -0
- package/bundle/chunk-2cvmdss3.js +2 -0
- package/bundle/{chunk-zhhcfqhh.js → chunk-2kvghwar.js} +1 -1
- package/bundle/{chunk-ch7s512a.js → chunk-2nkjwqpm.js} +1 -1
- package/bundle/chunk-2qbsg6dp.js +2 -0
- package/bundle/{chunk-9ttebtcf.js → chunk-2rvs18fx.js} +1 -1
- package/bundle/{chunk-rxt6gktt.js → chunk-2thbax1j.js} +1 -1
- package/bundle/{chunk-zbt53cb5.js → chunk-2zxygnx4.js} +1 -1
- package/bundle/{chunk-zgwasq3p.js → chunk-36kg3v3k.js} +1 -1
- package/bundle/{chunk-b6m5tr80.js → chunk-37hh7eee.js} +1 -1
- package/bundle/chunk-39mwv068.js +2 -0
- package/bundle/{chunk-set1f1wr.js → chunk-39z0qxkt.js} +1 -1
- package/bundle/{chunk-p0852vfn.js → chunk-3dfy9k0t.js} +2 -2
- package/bundle/{chunk-et3tgx7t.js → chunk-3e26pryk.js} +1 -1
- package/bundle/{chunk-w0t1ajhg.js → chunk-3eddms0g.js} +1 -1
- package/bundle/chunk-3re79hkf.js +2 -0
- package/bundle/{chunk-sy76e7nr.js → chunk-3vjs8aht.js} +1 -1
- package/bundle/{chunk-k769v1ds.js → chunk-3z7r4c0p.js} +1 -1
- package/bundle/chunk-40pe0tde.js +11 -0
- package/bundle/{chunk-0ejx0yqx.js → chunk-47nber5v.js} +1 -1
- package/bundle/{chunk-estc7tzt.js → chunk-491f4ab9.js} +2 -2
- package/bundle/{chunk-3152y1q9.js → chunk-4bp91rza.js} +1 -1
- package/bundle/{chunk-pdcxmr6x.js → chunk-4dy64hgp.js} +1 -1
- package/bundle/{chunk-0mztgsxp.js → chunk-4fqwg54p.js} +1 -1
- package/bundle/{chunk-2w3n0q9m.js → chunk-4gv7nsdd.js} +2 -2
- package/bundle/{chunk-csy1v12x.js → chunk-4nw19yab.js} +1 -1
- package/bundle/chunk-51fyaa6r.js +2 -0
- package/bundle/{chunk-kegvr7wt.js → chunk-52f62kr0.js} +2 -2
- package/bundle/chunk-52n4tdeh.js +5 -0
- package/bundle/{chunk-x4jnyj09.js → chunk-543jma8r.js} +1 -1
- package/bundle/chunk-58q03ah1.js +2 -0
- package/bundle/{chunk-hrcqbadm.js → chunk-5fhy0wb0.js} +1 -1
- package/bundle/{chunk-8zpsgfb6.js → chunk-5fym1zr2.js} +1 -1
- package/bundle/{chunk-a3g8de96.js → chunk-5k5jdayv.js} +1 -1
- package/bundle/chunk-5nmqgqj2.js +2 -0
- package/bundle/{chunk-psmwrvqs.js → chunk-5t69v8jg.js} +2 -2
- package/bundle/{chunk-7w571q26.js → chunk-5vtbg7pj.js} +1 -1
- package/bundle/{chunk-y4cz5s3h.js → chunk-5xmtzs15.js} +2 -2
- package/bundle/chunk-5ydg5ny1.js +2 -0
- package/bundle/{chunk-v5me0cj9.js → chunk-5z5rk3ng.js} +1 -1
- package/bundle/{chunk-5dvy83ms.js → chunk-62mb6wxm.js} +2 -2
- package/bundle/chunk-62mytrwv.js +2 -0
- package/bundle/{chunk-edvfqxfr.js → chunk-6396bg4p.js} +1 -1
- package/bundle/chunk-63bccmze.js +2 -0
- package/bundle/{chunk-1ypzf18e.js → chunk-64x1vtdq.js} +1 -1
- package/bundle/{chunk-9mabvb06.js → chunk-6kx4atkt.js} +1 -1
- package/bundle/{chunk-dmb0ez0m.js → chunk-6r7vm4xc.js} +3 -3
- package/bundle/{chunk-tcyzj3rz.js → chunk-6rggm6tm.js} +1 -1
- package/bundle/{chunk-fp2xgnjn.js → chunk-6vpc1y3w.js} +2 -2
- package/bundle/{chunk-71jmhvef.js → chunk-6vxddv5w.js} +2 -2
- package/bundle/chunk-6ynaebaw.js +2 -0
- package/bundle/{chunk-ep4drmt9.js → chunk-700jhn67.js} +1 -1
- package/bundle/{chunk-fdmz0502.js → chunk-76jbys6j.js} +2 -2
- package/bundle/chunk-782y3dm8.js +2 -0
- package/bundle/{chunk-d7h1dp0h.js → chunk-89g9wzc2.js} +1 -1
- package/bundle/chunk-8q50bha4.js +2 -0
- package/bundle/chunk-8v6qbhm1.js +2 -0
- package/bundle/chunk-955jtenj.js +2 -0
- package/bundle/chunk-95yzwxpf.js +2 -0
- package/bundle/{chunk-76wm7tw8.js → chunk-96281xfb.js} +2 -2
- package/bundle/{chunk-bdcd2mcb.js → chunk-96657nrr.js} +2 -2
- package/bundle/chunk-99ansgsj.js +2 -0
- package/bundle/{chunk-3c73rngn.js → chunk-9dd2krfn.js} +1 -1
- package/bundle/chunk-9exxjnxc.js +2 -0
- package/bundle/{chunk-eqsank84.js → chunk-9ge1mkfs.js} +1 -1
- package/bundle/{chunk-4r7fbkcm.js → chunk-9mmaja9n.js} +1 -1
- package/bundle/{chunk-mjkwd1sz.js → chunk-9rd7q5e9.js} +1 -1
- package/bundle/{chunk-6cztstry.js → chunk-9skj2w9e.js} +2 -2
- package/bundle/{chunk-nb4xtk1n.js → chunk-9tdbts1r.js} +1 -1
- package/bundle/{chunk-sg9enzsp.js → chunk-9tfm1dk2.js} +2 -2
- package/bundle/{chunk-z6qyx227.js → chunk-9xaea8h1.js} +1 -1
- package/bundle/{chunk-meehnnv9.js → chunk-a0c6w901.js} +2 -2
- package/bundle/chunk-a2tp2f6s.js +2 -0
- package/bundle/{chunk-69htq8kq.js → chunk-a3ynq3h7.js} +1 -1
- package/bundle/chunk-a4y0wjtq.js +3 -0
- package/bundle/{chunk-6dd2dx69.js → chunk-afagt413.js} +2 -2
- package/bundle/{chunk-px69995t.js → chunk-afzx47y2.js} +1 -1
- package/bundle/chunk-ag3s3t7x.js +2 -0
- package/bundle/{chunk-n7zd97hy.js → chunk-ajdn1n77.js} +2 -2
- package/bundle/chunk-arwm1qxm.js +2 -0
- package/bundle/{chunk-adws0hhk.js → chunk-awt3q88j.js} +2 -2
- package/bundle/{chunk-qn1fhqyw.js → chunk-az2pxgx6.js} +2 -2
- package/bundle/chunk-b0gq0s8a.js +2 -0
- package/bundle/{chunk-48rg4yhk.js → chunk-b2zfr7jz.js} +2 -2
- package/bundle/{chunk-mbmaeq0a.js → chunk-b63733cw.js} +1 -1
- package/bundle/chunk-b7430vg8.js +2 -0
- package/bundle/{chunk-4b56k59w.js → chunk-b7dw5ged.js} +1 -1
- package/bundle/{chunk-prz2fkn9.js → chunk-b83qf145.js} +1 -1
- package/bundle/{chunk-veptx3fk.js → chunk-b8w33ck9.js} +1 -1
- package/bundle/{chunk-674pexjx.js → chunk-bd21p9zz.js} +2 -2
- package/bundle/chunk-be2z0tr4.js +2 -0
- package/bundle/{chunk-x0de4z05.js → chunk-bkqemdv8.js} +2 -2
- package/bundle/chunk-bq585t67.js +2 -0
- package/bundle/chunk-bts3gw8w.js +2 -0
- package/bundle/{chunk-yvtkx4x4.js → chunk-c0sr83np.js} +1 -1
- package/bundle/{chunk-zh7e6kqs.js → chunk-c4tdfar1.js} +1 -1
- package/bundle/chunk-c6ege2yp.js +2 -0
- package/bundle/{chunk-00ft63qn.js → chunk-chs4bkgh.js} +1 -1
- package/bundle/{chunk-hmmn62jg.js → chunk-cm426ssg.js} +1 -1
- package/bundle/{chunk-crqycrs4.js → chunk-d4y5hyjg.js} +2 -2
- package/bundle/chunk-de0edzjs.js +2 -0
- package/bundle/{chunk-4xcwnwd6.js → chunk-der5kj1b.js} +1 -1
- package/bundle/{chunk-rk4c0zat.js → chunk-dhykktcp.js} +1 -1
- package/bundle/{chunk-mnjz8nqs.js → chunk-dm7hfb7f.js} +2 -2
- package/bundle/chunk-dntnvfdz.js +2 -0
- package/bundle/{chunk-q1dmxn63.js → chunk-dptvy1zn.js} +2 -2
- package/bundle/{chunk-2k2szpze.js → chunk-dqt8rrey.js} +1 -1
- package/bundle/{chunk-ky3fhz9z.js → chunk-dr003xka.js} +1 -1
- package/bundle/chunk-dtyzk0j7.js +2 -0
- package/bundle/{chunk-qrztx1b4.js → chunk-dwza14dk.js} +2 -2
- package/bundle/chunk-e3tmbywr.js +2 -0
- package/bundle/{chunk-ej0yzstw.js → chunk-e4nap6v9.js} +2 -2
- package/bundle/{chunk-5h1s0akp.js → chunk-e7x8v549.js} +1 -1
- package/bundle/{chunk-1e75j4m1.js → chunk-e826jvr2.js} +2 -2
- package/bundle/{chunk-djdfpezf.js → chunk-edm4c812.js} +1 -1
- package/bundle/{chunk-ws720v4j.js → chunk-eearwfay.js} +1 -1
- package/bundle/{chunk-knqpyc7s.js → chunk-ekavngf7.js} +1 -1
- package/bundle/chunk-em637k9q.js +2 -0
- package/bundle/{chunk-8gkz5550.js → chunk-epncmz5t.js} +1 -1
- package/bundle/{chunk-mdxtt9wv.js → chunk-eytpz91c.js} +2 -2
- package/bundle/chunk-f4qcwbx0.js +2 -0
- package/bundle/{chunk-a8askx4y.js → chunk-f6gd8809.js} +1 -1
- package/bundle/{chunk-878sb0es.js → chunk-fcbmedh3.js} +2 -2
- package/bundle/{chunk-4ycg2c6f.js → chunk-fg5f3a8a.js} +2 -2
- package/bundle/chunk-fj7jcv7m.js +2 -0
- package/bundle/{chunk-4gzggzc0.js → chunk-ft4msj4z.js} +3 -3
- package/bundle/chunk-fyntc5hj.js +2 -0
- package/bundle/chunk-fyt4yaq7.js +2 -0
- package/bundle/chunk-g4hcxhfs.js +2 -0
- package/bundle/{chunk-c5cyt23k.js → chunk-g7twcprm.js} +2 -2
- package/bundle/{chunk-9amnqaeq.js → chunk-g8844pb4.js} +1 -1
- package/bundle/{chunk-w136zswr.js → chunk-ganwjd6s.js} +3 -3
- package/bundle/chunk-gdew108b.js +2 -0
- package/bundle/chunk-gdy74wte.js +2 -0
- package/bundle/{chunk-e37gd3p2.js → chunk-gse0cgqc.js} +1 -1
- package/bundle/{chunk-z0dj15g9.js → chunk-gsjgbm0d.js} +1 -1
- package/bundle/{chunk-a1mbach4.js → chunk-gt10s0ks.js} +1 -1
- package/bundle/{chunk-qpk7jp6t.js → chunk-gxpx2nd8.js} +1 -1
- package/bundle/{chunk-8mqcar7f.js → chunk-gxq2fwnc.js} +1 -1
- package/bundle/chunk-gz90qgcn.js +2 -0
- package/bundle/chunk-gzz78dnm.js +2 -0
- package/bundle/{chunk-840mmmzz.js → chunk-h3yazfmh.js} +4 -4
- package/bundle/{chunk-d4faz5xa.js → chunk-h429rzqp.js} +1 -1
- package/bundle/{chunk-f0dp1tf9.js → chunk-h5y0pwwc.js} +1 -1
- package/bundle/{chunk-62gefpwn.js → chunk-h6b6acrv.js} +2 -2
- package/bundle/{chunk-19rs84t8.js → chunk-h8bq75er.js} +1 -1
- package/bundle/{chunk-99df6wvm.js → chunk-ha147mdc.js} +1 -1
- package/bundle/{chunk-xdcwx384.js → chunk-ha1w0xzh.js} +1 -1
- package/bundle/{chunk-5341jv20.js → chunk-ha294vpj.js} +1 -1
- package/bundle/chunk-hfrjkgyk.js +2 -0
- package/bundle/chunk-hjpt1n6g.js +2 -0
- package/bundle/{chunk-bzh71a92.js → chunk-hvdre0mb.js} +1 -1
- package/bundle/{chunk-86sfzgnf.js → chunk-hxf2a10r.js} +1 -1
- package/bundle/{chunk-4ppw719f.js → chunk-j09qf4zh.js} +1 -1
- package/bundle/chunk-j0jayfyn.js +35 -0
- package/bundle/{chunk-c1wc4b5q.js → chunk-j5b0yc0f.js} +1 -1
- package/bundle/{chunk-k8dbc1p5.js → chunk-j767byd1.js} +1 -1
- package/bundle/chunk-j794z99k.js +2 -0
- package/bundle/{chunk-5asf8f41.js → chunk-j95mkzwg.js} +114 -114
- package/bundle/{chunk-rn3je2hv.js → chunk-jcznttek.js} +1 -1
- package/bundle/{chunk-4v29ayke.js → chunk-jgw20mxx.js} +1 -1
- package/bundle/{chunk-175720ws.js → chunk-jhdpwndc.js} +2 -2
- package/bundle/{chunk-f0x3q5dj.js → chunk-jkqa49xc.js} +2 -2
- package/bundle/{chunk-sb3cgb4v.js → chunk-jmg64erz.js} +1 -1
- package/bundle/chunk-jpw7z507.js +2 -0
- package/bundle/{chunk-3cs1qf8x.js → chunk-jr622341.js} +1 -1
- package/bundle/{chunk-fswt9qc0.js → chunk-jv69hdp0.js} +2 -2
- package/bundle/chunk-jx9c90ft.js +2 -0
- package/bundle/{chunk-4jfnhghx.js → chunk-kevhkmn2.js} +2 -2
- package/bundle/{chunk-bxnsrggq.js → chunk-khpjjjsb.js} +1 -1
- package/bundle/chunk-kkfrys0w.js +2 -0
- package/bundle/chunk-kkq2vwm6.js +2 -0
- package/bundle/{chunk-h6b5966p.js → chunk-km1tyeyy.js} +1 -1
- package/bundle/chunk-kp0w1p79.js +2 -0
- package/bundle/chunk-kr7t73tg.js +3 -0
- package/bundle/chunk-kt7q9620.js +2 -0
- package/bundle/{chunk-8a9sj8gp.js → chunk-kzcb1pt4.js} +1 -1
- package/bundle/{chunk-ywj77e0m.js → chunk-m0f6cf9n.js} +2 -2
- package/bundle/chunk-m30bgt2t.js +2 -0
- package/bundle/chunk-m318f9es.js +2 -0
- package/bundle/{chunk-4yd2vvh6.js → chunk-m5r6zq6v.js} +1 -1
- package/bundle/chunk-m6g6za7b.js +2 -0
- package/bundle/chunk-m8djypsy.js +11 -0
- package/bundle/chunk-ma0vvbvy.js +2 -0
- package/bundle/chunk-mha4n5md.js +2 -0
- package/bundle/{chunk-s9epttpy.js → chunk-mhq2a5ms.js} +1 -1
- package/bundle/chunk-mp9qhnxg.js +2 -0
- package/bundle/{chunk-gd0j16gn.js → chunk-mqdvthkm.js} +1 -1
- package/bundle/{chunk-69k7cdtv.js → chunk-mqe1qa6t.js} +2 -2
- package/bundle/{chunk-j45p2v4a.js → chunk-mz6swd88.js} +3 -3
- package/bundle/{chunk-0m4gvjcv.js → chunk-n25t4j9w.js} +2 -2
- package/bundle/{chunk-83n11xym.js → chunk-n7ewvphw.js} +3 -3
- package/bundle/chunk-n9wre9wx.js +2 -0
- package/bundle/chunk-ncbj74tk.js +3 -0
- package/bundle/{chunk-06tgmvh6.js → chunk-ne3z7yye.js} +2 -2
- package/bundle/chunk-nnyvn2pm.js +2 -0
- package/bundle/chunk-nyhx3822.js +2 -0
- package/bundle/{chunk-zjyaze0d.js → chunk-p54bzjtv.js} +1 -1
- package/bundle/{chunk-dvp0r93q.js → chunk-p5d5qyzq.js} +1 -1
- package/bundle/{chunk-m8kjtp60.js → chunk-p6mxxem5.js} +1 -1
- package/bundle/{chunk-6zdzbmzs.js → chunk-p76c9s6g.js} +264 -264
- package/bundle/chunk-p8etcskm.js +2 -0
- package/bundle/{chunk-b350g18y.js → chunk-pf4gwr34.js} +2 -2
- package/bundle/{chunk-wf0n1cs9.js → chunk-pf61zhms.js} +1 -1
- package/bundle/{chunk-sh03ka27.js → chunk-pfx8ts02.js} +1 -1
- package/bundle/{chunk-e611m0p4.js → chunk-phvp9h7w.js} +1 -1
- package/bundle/chunk-pv71d7f3.js +2 -0
- package/bundle/{chunk-2fged9vy.js → chunk-pwcmc8j7.js} +1 -1
- package/bundle/{chunk-g77kddrs.js → chunk-pyt4xpze.js} +2 -2
- package/bundle/{chunk-1bq15kf0.js → chunk-q0pd8bac.js} +2 -2
- package/bundle/{chunk-yg9n2a2d.js → chunk-q12dtxep.js} +1 -1
- package/bundle/{chunk-v1axkp21.js → chunk-q2j2dm96.js} +2 -2
- package/bundle/{chunk-rx9eh3db.js → chunk-qf1hh45g.js} +3 -3
- package/bundle/{chunk-p4xqfkbh.js → chunk-qqjspfqw.js} +1 -1
- package/bundle/{chunk-9kc2th5c.js → chunk-qvnsgyfk.js} +2 -2
- package/bundle/{chunk-rqap90xh.js → chunk-qz35c4xy.js} +2 -2
- package/bundle/{chunk-bemyyen3.js → chunk-r3z77rjn.js} +1 -1
- package/bundle/{chunk-vsv4p060.js → chunk-r7mcn9ey.js} +1 -1
- package/bundle/{chunk-nzz7gzg2.js → chunk-rmpgmjtd.js} +1 -1
- package/bundle/{chunk-k0chq88p.js → chunk-rpt3rm31.js} +1 -1
- package/bundle/chunk-rteaec1s.js +2 -0
- package/bundle/chunk-rxwcah73.js +2 -0
- package/bundle/{chunk-s0gmxpxm.js → chunk-s1gy4hnw.js} +2 -2
- package/bundle/{chunk-4s1n38ds.js → chunk-s2ma1nz3.js} +2 -2
- package/bundle/chunk-s3gjc4m0.js +2 -0
- package/bundle/{chunk-6yshpz0z.js → chunk-s5taq9jy.js} +2 -2
- package/bundle/{chunk-5mf4qrye.js → chunk-s7017cak.js} +2 -2
- package/bundle/{chunk-6pt6nqwk.js → chunk-s9bn800b.js} +1 -1
- package/bundle/{chunk-73a7ts8r.js → chunk-sa3rjs2s.js} +1 -1
- package/bundle/{chunk-wfpnv00c.js → chunk-sprbs7aj.js} +2 -2
- package/bundle/{chunk-10q04xh5.js → chunk-sq2z7keb.js} +1 -1
- package/bundle/{chunk-w8nj5ph5.js → chunk-sqrx9csx.js} +1 -1
- package/bundle/{chunk-art8gejd.js → chunk-srf4jqcj.js} +1 -1
- package/bundle/{chunk-ffyj5nsg.js → chunk-ssp3nw24.js} +2 -2
- package/bundle/{chunk-2tkgtasa.js → chunk-svnhycdw.js} +2 -2
- package/bundle/chunk-swm990q6.js +2 -0
- package/bundle/chunk-sy42ayp2.js +2 -0
- package/bundle/{chunk-5rvvfgfy.js → chunk-t3kxce69.js} +2 -2
- package/bundle/chunk-t7mvej98.js +2 -0
- package/bundle/{chunk-6j53vtzd.js → chunk-t8pmy758.js} +1 -1
- package/bundle/{chunk-v7v0krrj.js → chunk-t9srpmte.js} +1 -1
- package/bundle/{chunk-2pw56zpj.js → chunk-tatecas7.js} +2 -2
- package/bundle/chunk-teagh4hx.js +2 -0
- package/bundle/{chunk-avksqxan.js → chunk-tf40p520.js} +1 -1
- package/bundle/{chunk-yms3bsm7.js → chunk-tpgksx59.js} +1 -1
- package/bundle/{chunk-02tmc2st.js → chunk-tr4cze2c.js} +1 -1
- package/bundle/chunk-tv4cp6f9.js +2 -0
- package/bundle/chunk-tw618904.js +2 -0
- package/bundle/{chunk-mq3w4z8k.js → chunk-v1bqh3m6.js} +176 -176
- package/bundle/{chunk-j46bxb1b.js → chunk-v3bfzxxg.js} +1 -1
- package/bundle/{chunk-vr13f6b5.js → chunk-v5gf0wx6.js} +2 -2
- package/bundle/{chunk-d385e2qt.js → chunk-v6mnbwtz.js} +1 -1
- package/bundle/{chunk-bq6cvf16.js → chunk-v93gr6n9.js} +2 -2
- package/bundle/chunk-vdpffam0.js +2 -0
- package/bundle/chunk-ve5w7nkb.js +2 -0
- package/bundle/chunk-vey57h4x.js +30 -0
- package/bundle/{chunk-pwq2f75j.js → chunk-vf492zs6.js} +1 -1
- package/bundle/{chunk-fkq0v5qv.js → chunk-vg9ec44m.js} +2 -2
- package/bundle/{chunk-61b81z2h.js → chunk-vh3n53qq.js} +1 -1
- package/bundle/{chunk-bmdqb48f.js → chunk-vk8gxf4y.js} +1 -1
- package/bundle/{chunk-rd08wx37.js → chunk-vr222v2n.js} +2 -2
- package/bundle/chunk-vrpca62q.js +2 -0
- package/bundle/{chunk-x3dzzq0t.js → chunk-w5fx69cw.js} +1 -1
- package/bundle/{chunk-k4wfq9cn.js → chunk-w9w59zjv.js} +2 -2
- package/bundle/{chunk-xmf59618.js → chunk-wbz79hns.js} +1 -1
- package/bundle/{chunk-gfvq78gy.js → chunk-wdrfzx4m.js} +1 -1
- package/bundle/{chunk-j3agzs13.js → chunk-wf18y499.js} +2 -2
- package/bundle/chunk-wvvygzz2.js +2 -0
- package/bundle/{chunk-wne3v1fk.js → chunk-wyxc99aa.js} +2 -2
- package/bundle/{chunk-5q98z8ck.js → chunk-x2mbre12.js} +2 -2
- package/bundle/{chunk-2d61z24r.js → chunk-x8rr2f15.js} +1 -1
- package/bundle/{chunk-vgmgg994.js → chunk-xpmgqa5n.js} +1 -1
- package/bundle/{chunk-rws2tsdv.js → chunk-xrwsttb7.js} +1 -1
- package/bundle/{chunk-ytfq6rn9.js → chunk-xz6psr05.js} +1 -1
- package/bundle/{chunk-4xqwt6dr.js → chunk-xzshjp04.js} +2 -2
- package/bundle/chunk-y27gwnx9.js +2 -0
- package/bundle/chunk-y2ms7q84.js +2 -0
- package/bundle/{chunk-1pft3sar.js → chunk-y8bjb32m.js} +1 -1
- package/bundle/{chunk-h036zy9e.js → chunk-ya7wrt5f.js} +2 -2
- package/bundle/{chunk-ahgb3r1c.js → chunk-ycjz7y1x.js} +2 -2
- package/bundle/{chunk-10kj86va.js → chunk-ykqx1z0b.js} +1 -1
- package/bundle/chunk-yq4vck53.js +2 -0
- package/bundle/{chunk-j2snkw45.js → chunk-yxsc90ba.js} +2 -2
- package/bundle/{chunk-5cwy8y78.js → chunk-yy5qqab3.js} +2 -2
- package/bundle/{chunk-86reb44c.js → chunk-z38am71w.js} +1 -1
- package/bundle/{chunk-pwrwb7mn.js → chunk-z6mqdbj1.js} +1 -1
- package/bundle/{chunk-nyxn7npc.js → chunk-z87ew6d3.js} +1 -1
- package/bundle/{chunk-m6967jtv.js → chunk-z9k4506p.js} +2 -2
- package/bundle/{chunk-hf39qx6t.js → chunk-zezz8xfw.js} +2 -2
- package/bundle/{chunk-ffx0cr44.js → chunk-zg72kz2k.js} +2 -2
- package/bundle/chunk-zkxc41ek.js +2 -0
- package/bundle/{chunk-tz1bzrnh.js → chunk-zssy3srh.js} +1 -1
- package/bundle/{chunk-xxck1man.js → chunk-zyz4na64.js} +1 -1
- package/bundle/{chunk-e18hshcg.js → chunk-zzsetq5f.js} +1 -1
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-1r7anzk5.js +0 -2
- package/bundle/chunk-2jzay8a9.js +0 -2
- package/bundle/chunk-30rghawe.js +0 -2
- package/bundle/chunk-31a47ptm.js +0 -10
- package/bundle/chunk-33mzqyyb.js +0 -3
- package/bundle/chunk-3dajnr1w.js +0 -2
- package/bundle/chunk-3ege6krg.js +0 -2
- package/bundle/chunk-43vpxggb.js +0 -2
- package/bundle/chunk-49y7zg15.js +0 -2
- package/bundle/chunk-5qhsfjzq.js +0 -3
- package/bundle/chunk-5re7995e.js +0 -2
- package/bundle/chunk-5xxn06g0.js +0 -2
- package/bundle/chunk-6k0y2332.js +0 -2
- package/bundle/chunk-6qwnty59.js +0 -8
- package/bundle/chunk-7cp30q0t.js +0 -2
- package/bundle/chunk-7t63wz2f.js +0 -2
- package/bundle/chunk-8gz8fk6r.js +0 -2
- package/bundle/chunk-8ht7cq3h.js +0 -2
- package/bundle/chunk-8qv0119d.js +0 -2
- package/bundle/chunk-9m0eawt5.js +0 -2
- package/bundle/chunk-a32y70fe.js +0 -2
- package/bundle/chunk-ae1b15bd.js +0 -31
- package/bundle/chunk-apneazwv.js +0 -2
- package/bundle/chunk-aw5yv01t.js +0 -2
- package/bundle/chunk-az12tp53.js +0 -2
- package/bundle/chunk-b5dpzcc7.js +0 -2
- package/bundle/chunk-baq0wk3q.js +0 -2
- package/bundle/chunk-bcgtqx3g.js +0 -2
- package/bundle/chunk-bde5d507.js +0 -2
- package/bundle/chunk-bzzggc3s.js +0 -2
- package/bundle/chunk-c8qx439t.js +0 -2
- package/bundle/chunk-ckw51fn6.js +0 -2
- package/bundle/chunk-denp0wrq.js +0 -2
- package/bundle/chunk-depxzjer.js +0 -2
- package/bundle/chunk-dhvqpcf3.js +0 -2
- package/bundle/chunk-dkqqswbv.js +0 -2
- package/bundle/chunk-e5t7jsxa.js +0 -2
- package/bundle/chunk-eb811dt2.js +0 -2
- package/bundle/chunk-fbz2xv2w.js +0 -2
- package/bundle/chunk-ffynh19k.js +0 -2
- package/bundle/chunk-fgr9xshx.js +0 -2
- package/bundle/chunk-gbvcb4k1.js +0 -2
- package/bundle/chunk-gdtnqzbp.js +0 -2
- package/bundle/chunk-gkfvhh28.js +0 -2
- package/bundle/chunk-gvx5hmhk.js +0 -2
- package/bundle/chunk-gww6abk3.js +0 -2
- package/bundle/chunk-hham7r33.js +0 -2
- package/bundle/chunk-hmm0gj34.js +0 -3
- package/bundle/chunk-hsjbe5zy.js +0 -2
- package/bundle/chunk-j89sv999.js +0 -2
- package/bundle/chunk-k9b4005p.js +0 -2
- package/bundle/chunk-kht2kwam.js +0 -2
- package/bundle/chunk-kzkb4648.js +0 -2
- package/bundle/chunk-m2540waa.js +0 -2
- package/bundle/chunk-mreacz8r.js +0 -2
- package/bundle/chunk-mscvm1rm.js +0 -2
- package/bundle/chunk-mw3hh526.js +0 -2
- package/bundle/chunk-n3nsrk5n.js +0 -2
- package/bundle/chunk-n4qbnecw.js +0 -35
- package/bundle/chunk-n9nmc4q4.js +0 -2
- package/bundle/chunk-nj4as8vy.js +0 -2
- package/bundle/chunk-nxm6gpyv.js +0 -2
- package/bundle/chunk-pqzx9ha6.js +0 -2
- package/bundle/chunk-qbjqkezn.js +0 -2
- package/bundle/chunk-qhtp1xvx.js +0 -2
- package/bundle/chunk-qkztgpay.js +0 -2
- package/bundle/chunk-rnf3dy0y.js +0 -2
- package/bundle/chunk-rry4kq85.js +0 -2
- package/bundle/chunk-rt49c6js.js +0 -5
- package/bundle/chunk-ryfj80q6.js +0 -2
- package/bundle/chunk-snx49w8h.js +0 -2
- package/bundle/chunk-t21mdqbb.js +0 -2
- package/bundle/chunk-tkbjcznz.js +0 -2
- package/bundle/chunk-tn2yyqeb.js +0 -2
- package/bundle/chunk-ttebf3nt.js +0 -2
- package/bundle/chunk-twpfh0mx.js +0 -2
- package/bundle/chunk-tzf6d5qy.js +0 -2
- package/bundle/chunk-v2mq09wx.js +0 -2
- package/bundle/chunk-v59a02aj.js +0 -2
- package/bundle/chunk-vxr4rzt0.js +0 -2
- package/bundle/chunk-w0h9rczg.js +0 -2
- package/bundle/chunk-w8344et5.js +0 -2
- package/bundle/chunk-weyg78et.js +0 -2
- package/bundle/chunk-wyavgt96.js +0 -2
- package/bundle/chunk-xchj8gna.js +0 -2
- package/bundle/chunk-yvjecrjy.js +0 -2
- package/bundle/chunk-yw2x6by6.js +0 -2
- package/bundle/chunk-z0r4syk8.js +0 -2
- package/bundle/chunk-z7c00g63.js +0 -2
- package/bundle/chunk-z93n3cbm.js +0 -2
- package/bundle/chunk-znr0saas.js +0 -2
- package/bundle/chunk-zqqt7v17.js +0 -2
- package/bundle/chunk-zwrgh1hc.js +0 -2
- package/bundle/chunk-zwxp07yc.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$d as l,Wd as y,Yd as T,Zd as t,_d as O,be as v,ce as Q,de as X,ee as J}from"./chunk-3dfy9k0t.js";import"./chunk-e4nap6v9.js";import{ge as w}from"./chunk-sqrx9csx.js";import{dg as f}from"./chunk-5t69v8jg.js";import{Bh as q,Rg as Y,Sg as mt,Tg as pt,Ug as st,Vg as et,Wg as ft,Xg as E,jh as Mt}from"./chunk-p76c9s6g.js";import"./chunk-az2pxgx6.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-vr222v2n.js";import"./chunk-6vpc1y3w.js";import{Dj as L,dl as F,wj as nt}from"./chunk-j95mkzwg.js";import"./chunk-tatecas7.js";import{Nl as $}from"./chunk-52n4tdeh.js";import"./chunk-ft4msj4z.js";import"./chunk-m8djypsy.js";import"./chunk-m0f6cf9n.js";import{Ko as P,Lo as h}from"./chunk-n7ewvphw.js";import"./chunk-ya7wrt5f.js";import"./chunk-wf18y499.js";import"./chunk-4bp91rza.js";import"./chunk-6vxddv5w.js";import"./chunk-dwza14dk.js";import"./chunk-vey57h4x.js";import"./chunk-40pe0tde.js";import"./chunk-d4y5hyjg.js";import"./chunk-q0pd8bac.js";import"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import"./chunk-z9k4506p.js";import"./chunk-yxsc90ba.js";import"./chunk-vk8gxf4y.js";import"./chunk-jr622341.js";import"./chunk-xzshjp04.js";import"./chunk-pyt4xpze.js";import"./chunk-52f62kr0.js";import"./chunk-svnhycdw.js";import"./chunk-9skj2w9e.js";import"./chunk-m5r6zq6v.js";import"./chunk-vg9ec44m.js";import"./chunk-e826jvr2.js";import"./chunk-4gv7nsdd.js";import"./chunk-afagt413.js";import"./chunk-76jbys6j.js";import"./chunk-9exxjnxc.js";import{Lu as g}from"./chunk-dm7hfb7f.js";import"./chunk-s5taq9jy.js";import"./chunk-62mb6wxm.js";import{Nv as D,Sv as A}from"./chunk-zg72kz2k.js";import"./chunk-kr7t73tg.js";import"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-sprbs7aj.js";import{MJ as a}from"./chunk-qvnsgyfk.js";import"./chunk-zezz8xfw.js";import"./chunk-bkqemdv8.js";import{_Q as ut}from"./chunk-pfx8ts02.js";import W from"path";function G(o){switch(o){case"authenticated":return"\u2713";case"expired":return"\u26A0";case"not_authenticated":return"\u2717"}}function H(o){switch(o){case"authenticated":return"authenticated";case"expired":return"expired";case"not_authenticated":return"not authenticated"}}function N(o){return typeof o==="object"&&o!==null&&"type"in o}function k(o){return N(o)&&o.type==="remote"}function B(o){return Object.entries(o.mcp??{}).filter((e)=>N(e[1]))}function U(o,e){let r=o.mcp_origins?.[e];if(!r)return"qitqode";let i=A.Path.home,m=r.source===i?"~":r.source.startsWith(i+W.sep)?"~"+r.source.slice(i.length):r.source;return`${r.type}:${m}`}function C(o){return B(o).filter((e)=>k(e[1])&&e[1].oauth!==!1)}async function I(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*e.status(),m=yield*a.all(Object.fromEntries(B(r).map(([p])=>[p,e.hasStoredTokens(p)])),{concurrency:"unbounded"});return{config:r,statuses:i,stored:m}}))}async function S(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*a.all(Object.fromEntries(C(r).map(([m])=>[m,e.getAuthStatus(m)])),{concurrency:"unbounded"});return{config:r,auth:i}}))}async function V(o,e=!1){let r=[W.join(o,"qitqode.json"),W.join(o,"qitqode.jsonc")];if(!e)r.push(W.join(o,".qitqode","qitqode.json"),W.join(o,".qitqode","qitqode.jsonc"));for(let i of r)if(await D.exists(i))return i;return r[0]}async function R(o,e,r){let i="{}";if(await D.exists(r))i=await D.readText(r);let m=P(i,["mcp",o],e,{formattingOptions:{tabSize:2,insertSpaces:!0}});return await D.write(r,h(i,m)),r}var tt=ut(Mt(),1);function yt(o){let e=tt.parse(o);if(!e.every((r)=>typeof r==="string"))throw Error("Shell operators are not supported; enter only the command and its arguments");if(e.length===0)throw Error("Command is required");return e}var ot=w({command:"add",describe:"add an MCP server",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("Add MCP server");let o=$.project,[e,r]=await Promise.all([V($.worktree),V(A.Path.config,!0)]),i=r;if(o.vcs==="git"){let c=await X({message:"Location",options:[{label:"Current project",value:e,hint:e},{label:"Global",value:r,hint:r}]});if(y(c))throw new f.CancelledError;i=c}let m=await J({message:"Enter MCP server name",validate:(c)=>c&&c.length>0?void 0:"Required"});if(y(m))throw new f.CancelledError;let p=await X({message:"Select MCP server type",options:[{label:"Local",value:"local",hint:"Run a local command"},{label:"Remote",value:"remote",hint:"Connect to a remote URL"}]});if(y(p))throw new f.CancelledError;if(p==="local"){let c=await J({message:"Enter command to run",placeholder:"e.g., qitqode x @modelcontextprotocol/server-filesystem",validate:(s)=>s&&s.length>0?void 0:"Required"});if(y(c))throw new f.CancelledError;let u;try{u=yt(c)}catch(s){t.error(s instanceof Error?s.message:"Invalid command"),l("MCP server was not added");return}await R(m,{type:"local",command:u},i),t.success(`MCP server "${m}" added to ${i}`),l("MCP server added successfully");return}if(p==="remote"){let c=await J({message:"Enter MCP server URL",placeholder:"e.g., https://example.com/mcp",validate:(s)=>{if(!s)return"Required";if(s.length===0)return"Required";return URL.canParse(s)?void 0:"Invalid URL"}});if(y(c))throw new f.CancelledError;let u=await T({message:"Does this server require OAuth authentication?",initialValue:!1});if(y(u))throw new f.CancelledError;let n;if(u){let s=await T({message:"Do you have a pre-registered client ID?",initialValue:!1});if(y(s))throw new f.CancelledError;if(s){let d=await J({message:"Enter client ID",validate:(j)=>j&&j.length>0?void 0:"Required"});if(y(d))throw new f.CancelledError;let M=await T({message:"Do you have a client secret?",initialValue:!1});if(y(M))throw new f.CancelledError;let _;if(M){let j=await v({message:"Enter client secret"});if(y(j))throw new f.CancelledError;_=j}n={type:"remote",url:c,oauth:{clientId:d,..._&&{clientSecret:_}}}}else n={type:"remote",url:c,oauth:{}}}else n={type:"remote",url:c,oauth:!1};await R(m,n,i),t.success(`MCP server "${m}" added to ${i}`)}l("MCP server added successfully")}})}});var it=w({command:"list",aliases:["ls"],describe:"list MCP servers and their status",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP Servers");let{config:o,statuses:e,stored:r}=await I(),i=B(o);if(i.length===0){t.warn("No MCP servers configured"),l("Add servers with: qitqode mcp add");return}for(let[m,p]of i){let c=e[m],u=k(p)&&p.oauth!==!1,n=r[m],s,d,M="";if(!c)s="\u25CB",d="not initialized";else if(c.status==="connected"){if(s="\u2713",d="connected",u&&n)M=" (OAuth)"}else if(c.status==="disabled")s="\u25CB",d="disabled";else if(c.status==="pending")s="\u25CB",d="pending approval";else if(c.status==="needs_auth")s="\u26A0",d="needs authentication";else if(c.status==="needs_client_registration")s="\u2717",d="needs client registration",M=`
|
|
3
3
|
`+c.error;else s="\u2717",d="failed",M=`
|
|
4
4
|
`+c.error;let _=p.type==="remote"?L.redactString(p.url):L.redactCommand(p.command).join(" ");t.info(`${s} ${m} ${f.Style.TEXT_DIM}${d} ${U(o,m)}${M}
|
|
5
5
|
${f.Style.TEXT_DIM}${_}`)}l(`${i.length} server(s)`)}})}});var dt=w({command:"auth [name]",describe:"authenticate with an OAuth-enabled MCP server",builder:(o)=>o.positional("name",{describe:"name of the MCP server",type:"string"}).command(ct),async handler(o){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP OAuth Authentication");let{config:e,auth:r}=await S(),i=e.mcp??{},m=C(e);if(m.length===0){t.warn("No OAuth-capable MCP servers configured"),t.info("Remote MCP servers support OAuth by default. Add a remote server in qitqode.json:"),t.info(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-dhykktcp.js";import"./chunk-2zxygnx4.js";import"./chunk-jcznttek.js";import"./chunk-edm4c812.js";import"./chunk-3dfy9k0t.js";import"./chunk-e4nap6v9.js";import"./chunk-sqrx9csx.js";import"./chunk-5t69v8jg.js";import"./chunk-jkqa49xc.js";import"./chunk-p76c9s6g.js";import"./chunk-az2pxgx6.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-vr222v2n.js";import"./chunk-6vpc1y3w.js";import"./chunk-j95mkzwg.js";import"./chunk-tatecas7.js";import"./chunk-52n4tdeh.js";import"./chunk-ft4msj4z.js";import"./chunk-m8djypsy.js";import"./chunk-m0f6cf9n.js";import"./chunk-n7ewvphw.js";import"./chunk-ya7wrt5f.js";import"./chunk-wf18y499.js";import"./chunk-4bp91rza.js";import"./chunk-6vxddv5w.js";import"./chunk-dwza14dk.js";import"./chunk-vey57h4x.js";import"./chunk-40pe0tde.js";import"./chunk-d4y5hyjg.js";import"./chunk-q0pd8bac.js";import"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import"./chunk-z9k4506p.js";import"./chunk-yxsc90ba.js";import"./chunk-vk8gxf4y.js";import"./chunk-jr622341.js";import"./chunk-xzshjp04.js";import"./chunk-pyt4xpze.js";import"./chunk-52f62kr0.js";import"./chunk-svnhycdw.js";import"./chunk-9skj2w9e.js";import"./chunk-m5r6zq6v.js";import"./chunk-vg9ec44m.js";import"./chunk-e826jvr2.js";import"./chunk-4gv7nsdd.js";import"./chunk-afagt413.js";import"./chunk-76jbys6j.js";import"./chunk-9exxjnxc.js";import"./chunk-dm7hfb7f.js";import"./chunk-s5taq9jy.js";import"./chunk-62mb6wxm.js";import"./chunk-zg72kz2k.js";import"./chunk-kr7t73tg.js";import"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-sprbs7aj.js";import"./chunk-qvnsgyfk.js";import"./chunk-zezz8xfw.js";import"./chunk-bkqemdv8.js";import"./chunk-pfx8ts02.js";export{f as statusEffect,a as resolveApiKeyFlag,e as logoutEffect,d as loginEffect,c as interactiveLogin,b as apiKeyLoginEffect,g as AuthCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{We as I,Ye as r,_e as l,cf as O,df as t,gf as e,if as o,jf as NN,kf as QN,nf as _,of as h,pf as m,qf as XN,rf as YN,tf as ZN,uf as $N,vf as C,xf as JN}from"./chunk-4ycg2c6f.js";import{Qq as q,Uq as u,Xq as v}from"./chunk-pdcxmr6x.js";import"./chunk-cqtkxwd8.js";import"./chunk-a1mbach4.js";import{Lu as N}from"./chunk-sg9enzsp.js";import"./chunk-5q98z8ck.js";import"./chunk-sh03ka27.js";function s(Q){var J,z,B,j;if(Q==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 $=(J=Q.prompt_tokens)!=null?J:0,X=(z=Q.completion_tokens)!=null?z:0,Y=(j=(B=Q.completion_tokens_details)==null?void 0:B.reasoning_tokens)!=null?j:void 0,Z=Y!=null?X-Y:X;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:Z,reasoning:Y},raw:Q}}function BN(Q){var J;let z=[];for(let{role:B,content:j}of Q)switch(B){case"system":{z.push({role:"system",content:j});break}case"user":{if(j.length===1&&j[0].type==="text"){z.push({role:"user",content:j[0].text});break}z.push({role:"user",content:j.map(($)=>{switch($.type){case"text":return{type:"text",text:$.text};case"file":{if(!$.mediaType.startsWith("image/"))throw new v({functionality:"Non-image file content parts"});let X=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${X};base64,${l($.data)}`}}}}})});break}case"assistant":{let $="",X="",Y=[];for(let Z of j)switch(Z.type){case"reasoning":{X+=Z.text;break}case"text":{$+=Z.text;break}case"tool-call":{Y.push({id:Z.toolCallId,type:"function",function:{name:Z.toolName,arguments:JSON.stringify(Z.input)}});break}}z.push({role:"assistant",content:$,...X.length>0?{reasoning:X}:null,...Y.length>0?{tool_calls:Y}:null});break}case"tool":{for(let $ of j){if($.type==="tool-approval-response")continue;let X=$.output,Y;switch(X.type){case"text":case"error-text":Y=X.value;break;case"execution-denied":Y=(J=X.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(X.value);break}z.push({role:"tool",tool_call_id:$.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${B}`)}return z}function a({id:Q,model:J,created:z}){return{id:Q!=null?Q:void 0,modelId:J!=null?J:void 0,timestamp:z!=null?new Date(z*1000):void 0}}var GN=N.object({reasoningFormat:N.enum(["parsed","raw","hidden"]).optional(),reasoningEffort:N.enum(["none","default","low","medium","high"]).optional(),parallelToolCalls:N.boolean().optional(),user:N.string().optional(),structuredOutputs:N.boolean().optional(),strictJsonSchema:N.boolean().optional(),serviceTier:N.enum(["on_demand","flex","auto"]).optional()}),jN=N.object({error:N.object({message:N.string(),type:N.string()})}),g=ZN({errorSchema:jN,errorToMessage:(Q)=>Q.error.message}),zN=["openai/gpt-oss-20b","openai/gpt-oss-120b"];function KN(Q){return zN.includes(Q)}function UN(){return zN.join(", ")}function VN({tools:Q,toolChoice:J,modelId:z}){Q=(Q==null?void 0:Q.length)?Q:void 0;let B=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:B};let j=[];for(let X of Q)if(X.type==="provider")if(X.id==="groq.browser_search")if(!KN(z))B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`,details:`Browser search is only supported on the following models: ${UN()}. Current model: ${z}`});else j.push({type:"browser_search"});else B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`});else j.push({type:"function",function:{name:X.name,description:X.description,parameters:X.inputSchema,...X.strict!=null?{strict:X.strict}:{}}});if(J==null)return{tools:j,toolChoice:void 0,toolWarnings:B};let $=J.type;switch($){case"auto":case"none":case"required":return{tools:j,toolChoice:$,toolWarnings:B};case"tool":return{tools:j,toolChoice:{type:"function",function:{name:J.toolName}},toolWarnings:B};default:throw new v({functionality:`tool choice type: ${$}`})}}function n(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var LN=class{constructor(Q,J){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=Q,this.config=J}get provider(){return this.config.provider}async getArgs({prompt:Q,maxOutputTokens:J,temperature:z,topP:B,topK:j,frequencyPenalty:$,presencePenalty:X,stopSequences:Y,responseFormat:Z,seed:K,stream:L,tools:V,toolChoice:W,providerOptions:U}){var G,E,S;let b=[],H=await h({provider:"groq",providerOptions:U,schema:GN}),F=(G=H==null?void 0:H.structuredOutputs)!=null?G:!0,f=(E=H==null?void 0:H.strictJsonSchema)!=null?E:!0;if(j!=null)b.push({type:"unsupported",feature:"topK"});if((Z==null?void 0:Z.type)==="json"&&Z.schema!=null&&!F)b.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:k,toolChoice:D,toolWarnings:R}=VN({tools:V,toolChoice:W,modelId:this.modelId});return{args:{model:this.modelId,user:H==null?void 0:H.user,parallel_tool_calls:H==null?void 0:H.parallelToolCalls,max_tokens:J,temperature:z,top_p:B,frequency_penalty:$,presence_penalty:X,stop:Y,seed:K,response_format:(Z==null?void 0:Z.type)==="json"?F&&Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:f,name:(S=Z.name)!=null?S:"response",description:Z.description}}:{type:"json_object"}:void 0,reasoning_format:H==null?void 0:H.reasoningFormat,reasoning_effort:H==null?void 0:H.reasoningEffort,service_tier:H==null?void 0:H.serviceTier,messages:BN(Q),tools:k,tool_choice:D},warnings:[...b,...R]}}async doGenerate(Q){var J,z;let{args:B,warnings:j}=await this.getArgs({...Q,stream:!1}),$=JSON.stringify(B),{responseHeaders:X,value:Y,rawValue:Z}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:B,failedResponseHandler:g,successfulResponseHandler:C(HN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),K=Y.choices[0],L=[],V=K.message.content;if(V!=null&&V.length>0)L.push({type:"text",text:V});let W=K.message.reasoning;if(W!=null&&W.length>0)L.push({type:"reasoning",text:W});if(K.message.tool_calls!=null)for(let U of K.message.tool_calls)L.push({type:"tool-call",toolCallId:(J=U.id)!=null?J:O(),toolName:U.function.name,input:U.function.arguments});return{content:L,finishReason:{unified:n(K.finish_reason),raw:(z=K.finish_reason)!=null?z:void 0},usage:s(Y.usage),response:{...a(Y),headers:X,body:Z},warnings:j,request:{body:$}}}async doStream(Q){let{args:J,warnings:z}=await this.getArgs({...Q,stream:!0}),B=JSON.stringify({...J,stream:!0}),{responseHeaders:j,value:$}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:{...J,stream:!0},failedResponseHandler:g,successfulResponseHandler:$N(wN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),X=[],Y={unified:"other",raw:void 0},Z=void 0,K=!0,L=!1,V=!1,W;return{stream:$.pipeThrough(new TransformStream({start(U){U.enqueue({type:"stream-start",warnings:z})},transform(U,G){var E,S,b,H,F,f,k,D,R,d,c,p,i;if(Q.includeRawChunks)G.enqueue({type:"raw",rawValue:U.rawValue});if(!U.success){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:U.error});return}let y=U.value;if("error"in y){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:y.error});return}if(K)K=!1,G.enqueue({type:"response-metadata",...a(y)});if(((E=y.x_groq)==null?void 0:E.usage)!=null)Z=y.x_groq.usage;let x=y.choices[0];if((x==null?void 0:x.finish_reason)!=null)Y={unified:n(x.finish_reason),raw:x.finish_reason};if((x==null?void 0:x.delta)==null)return;let M=x.delta;if(M.reasoning!=null&&M.reasoning.length>0){if(!V)G.enqueue({type:"reasoning-start",id:"reasoning-0"}),V=!0;G.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:M.reasoning})}if(M.content!=null&&M.content.length>0){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;if(!L)G.enqueue({type:"text-start",id:"txt-0"}),L=!0;G.enqueue({type:"text-delta",id:"txt-0",delta:M.content})}if(M.tool_calls!=null){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;for(let w of M.tool_calls){let T=w.index;if(X[T]==null){if(w.type!=="function")throw new q({data:w,message:"Expected 'function' type."});if(w.id==null)throw new q({data:w,message:"Expected 'id' to be a string."});if(((S=w.function)==null?void 0:S.name)==null)throw new q({data:w,message:"Expected 'function.name' to be a string."});G.enqueue({type:"tool-input-start",id:w.id,toolName:w.function.name}),X[T]={id:w.id,type:"function",function:{name:w.function.name,arguments:(b=w.function.arguments)!=null?b:""},hasFinished:!1};let A=X[T];if(((H=A.function)==null?void 0:H.name)!=null&&((F=A.function)==null?void 0:F.arguments)!=null){if(A.function.arguments.length>0)G.enqueue({type:"tool-input-delta",id:A.id,delta:A.function.arguments});if(_(A.function.arguments))G.enqueue({type:"tool-input-end",id:A.id}),G.enqueue({type:"tool-call",toolCallId:(f=A.id)!=null?f:O(),toolName:A.function.name,input:A.function.arguments}),A.hasFinished=!0}continue}let P=X[T];if(P.hasFinished)continue;if(((k=w.function)==null?void 0:k.arguments)!=null)P.function.arguments+=(R=(D=w.function)==null?void 0:D.arguments)!=null?R:"";if(G.enqueue({type:"tool-input-delta",id:P.id,delta:(d=w.function.arguments)!=null?d:""}),((c=P.function)==null?void 0:c.name)!=null&&((p=P.function)==null?void 0:p.arguments)!=null&&_(P.function.arguments))G.enqueue({type:"tool-input-end",id:P.id}),G.enqueue({type:"tool-call",toolCallId:(i=P.id)!=null?i:O(),toolName:P.function.name,input:P.function.arguments}),P.hasFinished=!0}}},flush(U){if(V)U.enqueue({type:"reasoning-end",id:"reasoning-0"});if(L)U.enqueue({type:"text-end",id:"txt-0"});U.enqueue({type:"finish",finishReason:Y,usage:s(Z),...W!=null?{providerMetadata:W}:{}})}})),request:{body:B},response:{headers:j}}}},HN=N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({message:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({id:N.string().nullish(),type:N.literal("function"),function:N.object({name:N.string(),arguments:N.string()})})).nullish()}),index:N.number(),finish_reason:N.string().nullish()})),usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}),wN=N.union([N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({delta:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({index:N.number(),id:N.string().nullish(),type:N.literal("function").optional(),function:N.object({name:N.string().nullish(),arguments:N.string().nullish()})})).nullish()}).nullish(),finish_reason:N.string().nullable().optional(),index:N.number()})),x_groq:N.object({usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}).nullish()}),jN]),WN=NN(()=>QN(N.object({language:N.string().nullish(),prompt:N.string().nullish(),responseFormat:N.string().nullish(),temperature:N.number().min(0).max(1).nullish(),timestampGranularities:N.array(N.string()).nullish()}))),PN=class{constructor(Q,J){this.modelId=Q,this.config=J,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:Q,mediaType:J,providerOptions:z}){var B,j,$,X,Y;let Z=[],K=await h({provider:"groq",providerOptions:z,schema:WN}),L=new FormData,V=Q instanceof Uint8Array?new Blob([Q]):new Blob([r(Q)]);L.append("model",this.modelId);let W=o(J);if(L.append("file",new File([V],"audio",{type:J}),`audio.${W}`),K){let U={language:(B=K.language)!=null?B:void 0,prompt:(j=K.prompt)!=null?j:void 0,response_format:($=K.responseFormat)!=null?$:void 0,temperature:(X=K.temperature)!=null?X:void 0,timestamp_granularities:(Y=K.timestampGranularities)!=null?Y:void 0};for(let G in U){let E=U[G];if(E!==void 0)if(Array.isArray(E))for(let S of E)L.append(`${G}[]`,String(S));else L.append(G,String(E))}}return{formData:L,warnings:Z}}async doGenerate(Q){var J,z,B,j,$,X,Y;let Z=(B=(z=(J=this.config._internal)==null?void 0:J.currentDate)==null?void 0:z.call(J))!=null?B:new Date,{formData:K,warnings:L}=await this.getArgs(Q),{value:V,responseHeaders:W,rawValue:U}=await XN({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),formData:K,failedResponseHandler:g,successfulResponseHandler:C(AN),abortSignal:Q.abortSignal,fetch:this.config.fetch});return{text:V.text,segments:($=(j=V.segments)==null?void 0:j.map((G)=>({text:G.text,startSecond:G.start,endSecond:G.end})))!=null?$:[],language:(X=V.language)!=null?X:void 0,durationInSeconds:(Y=V.duration)!=null?Y:void 0,warnings:L,response:{timestamp:Z,modelId:this.modelId,headers:W,body:U}}}},AN=N.object({text:N.string(),x_groq:N.object({id:N.string()}),task:N.string().nullish(),language:N.string().nullish(),duration:N.number().nullish(),segments:N.array(N.object({id:N.number(),seek:N.number(),start:N.number(),end:N.number(),text:N.string(),tokens:N.array(N.number()),temperature:N.number(),avg_logprob:N.number(),compression_ratio:N.number(),no_speech_prob:N.number()})).nullish()}),EN=YN({id:"groq.browser_search",inputSchema:N.object({})}),MN={browserSearch:EN},SN="3.0.31";function xN(Q={}){var J;let z=(J=JN(Q.baseURL))!=null?J:"https://api.groq.com/openai/v1",B=()=>t({Authorization:`Bearer ${e({apiKey:Q.apiKey,environmentVariableName:"GROQ_API_KEY",description:"Groq"})}`,...Q.headers},`ai-sdk/groq/${SN}`),j=(Z)=>new LN(Z,{provider:"groq.chat",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch}),$=(Z)=>{if(new.target)throw Error("The Groq model function cannot be called with the new keyword.");return j(Z)},X=(Z)=>{return new PN(Z,{provider:"groq.transcription",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch})},Y=function(Z){return $(Z)};return Y.specificationVersion="v3",Y.languageModel=$,Y.chat=j,Y.embeddingModel=(Z)=>{throw new u({modelId:Z,modelType:"embeddingModel"})},Y.textEmbeddingModel=Y.embeddingModel,Y.imageModel=(Z)=>{throw new u({modelId:Z,modelType:"imageModel"})},Y.transcription=X,Y.transcriptionModel=X,Y.tools=MN,Y}var gN=xN();export{gN as groq,xN as createGroq,EN as browserSearch,SN as VERSION};
|
|
2
|
+
import{$e as l,Xe as I,Ze as r,df as O,ef as t,hf as e,jf as o,kf as NN,lf as QN,of as _,pf as h,qf as m,rf as XN,sf as YN,uf as ZN,vf as $N,wf as C,yf as JN}from"./chunk-fg5f3a8a.js";import{Bs as v,us as q,ys as u}from"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import{pw as N}from"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-pfx8ts02.js";function s(Q){var J,z,B,j;if(Q==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 $=(J=Q.prompt_tokens)!=null?J:0,X=(z=Q.completion_tokens)!=null?z:0,Y=(j=(B=Q.completion_tokens_details)==null?void 0:B.reasoning_tokens)!=null?j:void 0,Z=Y!=null?X-Y:X;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:Z,reasoning:Y},raw:Q}}function BN(Q){var J;let z=[];for(let{role:B,content:j}of Q)switch(B){case"system":{z.push({role:"system",content:j});break}case"user":{if(j.length===1&&j[0].type==="text"){z.push({role:"user",content:j[0].text});break}z.push({role:"user",content:j.map(($)=>{switch($.type){case"text":return{type:"text",text:$.text};case"file":{if(!$.mediaType.startsWith("image/"))throw new v({functionality:"Non-image file content parts"});let X=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${X};base64,${l($.data)}`}}}}})});break}case"assistant":{let $="",X="",Y=[];for(let Z of j)switch(Z.type){case"reasoning":{X+=Z.text;break}case"text":{$+=Z.text;break}case"tool-call":{Y.push({id:Z.toolCallId,type:"function",function:{name:Z.toolName,arguments:JSON.stringify(Z.input)}});break}}z.push({role:"assistant",content:$,...X.length>0?{reasoning:X}:null,...Y.length>0?{tool_calls:Y}:null});break}case"tool":{for(let $ of j){if($.type==="tool-approval-response")continue;let X=$.output,Y;switch(X.type){case"text":case"error-text":Y=X.value;break;case"execution-denied":Y=(J=X.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(X.value);break}z.push({role:"tool",tool_call_id:$.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${B}`)}return z}function a({id:Q,model:J,created:z}){return{id:Q!=null?Q:void 0,modelId:J!=null?J:void 0,timestamp:z!=null?new Date(z*1000):void 0}}var GN=N.object({reasoningFormat:N.enum(["parsed","raw","hidden"]).optional(),reasoningEffort:N.enum(["none","default","low","medium","high"]).optional(),parallelToolCalls:N.boolean().optional(),user:N.string().optional(),structuredOutputs:N.boolean().optional(),strictJsonSchema:N.boolean().optional(),serviceTier:N.enum(["on_demand","flex","auto"]).optional()}),jN=N.object({error:N.object({message:N.string(),type:N.string()})}),g=ZN({errorSchema:jN,errorToMessage:(Q)=>Q.error.message}),zN=["openai/gpt-oss-20b","openai/gpt-oss-120b"];function KN(Q){return zN.includes(Q)}function UN(){return zN.join(", ")}function VN({tools:Q,toolChoice:J,modelId:z}){Q=(Q==null?void 0:Q.length)?Q:void 0;let B=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:B};let j=[];for(let X of Q)if(X.type==="provider")if(X.id==="groq.browser_search")if(!KN(z))B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`,details:`Browser search is only supported on the following models: ${UN()}. Current model: ${z}`});else j.push({type:"browser_search"});else B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`});else j.push({type:"function",function:{name:X.name,description:X.description,parameters:X.inputSchema,...X.strict!=null?{strict:X.strict}:{}}});if(J==null)return{tools:j,toolChoice:void 0,toolWarnings:B};let $=J.type;switch($){case"auto":case"none":case"required":return{tools:j,toolChoice:$,toolWarnings:B};case"tool":return{tools:j,toolChoice:{type:"function",function:{name:J.toolName}},toolWarnings:B};default:throw new v({functionality:`tool choice type: ${$}`})}}function n(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var LN=class{constructor(Q,J){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=Q,this.config=J}get provider(){return this.config.provider}async getArgs({prompt:Q,maxOutputTokens:J,temperature:z,topP:B,topK:j,frequencyPenalty:$,presencePenalty:X,stopSequences:Y,responseFormat:Z,seed:K,stream:L,tools:V,toolChoice:W,providerOptions:U}){var G,E,S;let b=[],H=await h({provider:"groq",providerOptions:U,schema:GN}),F=(G=H==null?void 0:H.structuredOutputs)!=null?G:!0,f=(E=H==null?void 0:H.strictJsonSchema)!=null?E:!0;if(j!=null)b.push({type:"unsupported",feature:"topK"});if((Z==null?void 0:Z.type)==="json"&&Z.schema!=null&&!F)b.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:k,toolChoice:D,toolWarnings:R}=VN({tools:V,toolChoice:W,modelId:this.modelId});return{args:{model:this.modelId,user:H==null?void 0:H.user,parallel_tool_calls:H==null?void 0:H.parallelToolCalls,max_tokens:J,temperature:z,top_p:B,frequency_penalty:$,presence_penalty:X,stop:Y,seed:K,response_format:(Z==null?void 0:Z.type)==="json"?F&&Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:f,name:(S=Z.name)!=null?S:"response",description:Z.description}}:{type:"json_object"}:void 0,reasoning_format:H==null?void 0:H.reasoningFormat,reasoning_effort:H==null?void 0:H.reasoningEffort,service_tier:H==null?void 0:H.serviceTier,messages:BN(Q),tools:k,tool_choice:D},warnings:[...b,...R]}}async doGenerate(Q){var J,z;let{args:B,warnings:j}=await this.getArgs({...Q,stream:!1}),$=JSON.stringify(B),{responseHeaders:X,value:Y,rawValue:Z}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:B,failedResponseHandler:g,successfulResponseHandler:C(HN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),K=Y.choices[0],L=[],V=K.message.content;if(V!=null&&V.length>0)L.push({type:"text",text:V});let W=K.message.reasoning;if(W!=null&&W.length>0)L.push({type:"reasoning",text:W});if(K.message.tool_calls!=null)for(let U of K.message.tool_calls)L.push({type:"tool-call",toolCallId:(J=U.id)!=null?J:O(),toolName:U.function.name,input:U.function.arguments});return{content:L,finishReason:{unified:n(K.finish_reason),raw:(z=K.finish_reason)!=null?z:void 0},usage:s(Y.usage),response:{...a(Y),headers:X,body:Z},warnings:j,request:{body:$}}}async doStream(Q){let{args:J,warnings:z}=await this.getArgs({...Q,stream:!0}),B=JSON.stringify({...J,stream:!0}),{responseHeaders:j,value:$}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:{...J,stream:!0},failedResponseHandler:g,successfulResponseHandler:$N(wN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),X=[],Y={unified:"other",raw:void 0},Z=void 0,K=!0,L=!1,V=!1,W;return{stream:$.pipeThrough(new TransformStream({start(U){U.enqueue({type:"stream-start",warnings:z})},transform(U,G){var E,S,b,H,F,f,k,D,R,d,c,p,i;if(Q.includeRawChunks)G.enqueue({type:"raw",rawValue:U.rawValue});if(!U.success){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:U.error});return}let y=U.value;if("error"in y){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:y.error});return}if(K)K=!1,G.enqueue({type:"response-metadata",...a(y)});if(((E=y.x_groq)==null?void 0:E.usage)!=null)Z=y.x_groq.usage;let x=y.choices[0];if((x==null?void 0:x.finish_reason)!=null)Y={unified:n(x.finish_reason),raw:x.finish_reason};if((x==null?void 0:x.delta)==null)return;let M=x.delta;if(M.reasoning!=null&&M.reasoning.length>0){if(!V)G.enqueue({type:"reasoning-start",id:"reasoning-0"}),V=!0;G.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:M.reasoning})}if(M.content!=null&&M.content.length>0){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;if(!L)G.enqueue({type:"text-start",id:"txt-0"}),L=!0;G.enqueue({type:"text-delta",id:"txt-0",delta:M.content})}if(M.tool_calls!=null){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;for(let w of M.tool_calls){let T=w.index;if(X[T]==null){if(w.type!=="function")throw new q({data:w,message:"Expected 'function' type."});if(w.id==null)throw new q({data:w,message:"Expected 'id' to be a string."});if(((S=w.function)==null?void 0:S.name)==null)throw new q({data:w,message:"Expected 'function.name' to be a string."});G.enqueue({type:"tool-input-start",id:w.id,toolName:w.function.name}),X[T]={id:w.id,type:"function",function:{name:w.function.name,arguments:(b=w.function.arguments)!=null?b:""},hasFinished:!1};let A=X[T];if(((H=A.function)==null?void 0:H.name)!=null&&((F=A.function)==null?void 0:F.arguments)!=null){if(A.function.arguments.length>0)G.enqueue({type:"tool-input-delta",id:A.id,delta:A.function.arguments});if(_(A.function.arguments))G.enqueue({type:"tool-input-end",id:A.id}),G.enqueue({type:"tool-call",toolCallId:(f=A.id)!=null?f:O(),toolName:A.function.name,input:A.function.arguments}),A.hasFinished=!0}continue}let P=X[T];if(P.hasFinished)continue;if(((k=w.function)==null?void 0:k.arguments)!=null)P.function.arguments+=(R=(D=w.function)==null?void 0:D.arguments)!=null?R:"";if(G.enqueue({type:"tool-input-delta",id:P.id,delta:(d=w.function.arguments)!=null?d:""}),((c=P.function)==null?void 0:c.name)!=null&&((p=P.function)==null?void 0:p.arguments)!=null&&_(P.function.arguments))G.enqueue({type:"tool-input-end",id:P.id}),G.enqueue({type:"tool-call",toolCallId:(i=P.id)!=null?i:O(),toolName:P.function.name,input:P.function.arguments}),P.hasFinished=!0}}},flush(U){if(V)U.enqueue({type:"reasoning-end",id:"reasoning-0"});if(L)U.enqueue({type:"text-end",id:"txt-0"});U.enqueue({type:"finish",finishReason:Y,usage:s(Z),...W!=null?{providerMetadata:W}:{}})}})),request:{body:B},response:{headers:j}}}},HN=N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({message:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({id:N.string().nullish(),type:N.literal("function"),function:N.object({name:N.string(),arguments:N.string()})})).nullish()}),index:N.number(),finish_reason:N.string().nullish()})),usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}),wN=N.union([N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({delta:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({index:N.number(),id:N.string().nullish(),type:N.literal("function").optional(),function:N.object({name:N.string().nullish(),arguments:N.string().nullish()})})).nullish()}).nullish(),finish_reason:N.string().nullable().optional(),index:N.number()})),x_groq:N.object({usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}).nullish()}),jN]),WN=NN(()=>QN(N.object({language:N.string().nullish(),prompt:N.string().nullish(),responseFormat:N.string().nullish(),temperature:N.number().min(0).max(1).nullish(),timestampGranularities:N.array(N.string()).nullish()}))),PN=class{constructor(Q,J){this.modelId=Q,this.config=J,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:Q,mediaType:J,providerOptions:z}){var B,j,$,X,Y;let Z=[],K=await h({provider:"groq",providerOptions:z,schema:WN}),L=new FormData,V=Q instanceof Uint8Array?new Blob([Q]):new Blob([r(Q)]);L.append("model",this.modelId);let W=o(J);if(L.append("file",new File([V],"audio",{type:J}),`audio.${W}`),K){let U={language:(B=K.language)!=null?B:void 0,prompt:(j=K.prompt)!=null?j:void 0,response_format:($=K.responseFormat)!=null?$:void 0,temperature:(X=K.temperature)!=null?X:void 0,timestamp_granularities:(Y=K.timestampGranularities)!=null?Y:void 0};for(let G in U){let E=U[G];if(E!==void 0)if(Array.isArray(E))for(let S of E)L.append(`${G}[]`,String(S));else L.append(G,String(E))}}return{formData:L,warnings:Z}}async doGenerate(Q){var J,z,B,j,$,X,Y;let Z=(B=(z=(J=this.config._internal)==null?void 0:J.currentDate)==null?void 0:z.call(J))!=null?B:new Date,{formData:K,warnings:L}=await this.getArgs(Q),{value:V,responseHeaders:W,rawValue:U}=await XN({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),formData:K,failedResponseHandler:g,successfulResponseHandler:C(AN),abortSignal:Q.abortSignal,fetch:this.config.fetch});return{text:V.text,segments:($=(j=V.segments)==null?void 0:j.map((G)=>({text:G.text,startSecond:G.start,endSecond:G.end})))!=null?$:[],language:(X=V.language)!=null?X:void 0,durationInSeconds:(Y=V.duration)!=null?Y:void 0,warnings:L,response:{timestamp:Z,modelId:this.modelId,headers:W,body:U}}}},AN=N.object({text:N.string(),x_groq:N.object({id:N.string()}),task:N.string().nullish(),language:N.string().nullish(),duration:N.number().nullish(),segments:N.array(N.object({id:N.number(),seek:N.number(),start:N.number(),end:N.number(),text:N.string(),tokens:N.array(N.number()),temperature:N.number(),avg_logprob:N.number(),compression_ratio:N.number(),no_speech_prob:N.number()})).nullish()}),EN=YN({id:"groq.browser_search",inputSchema:N.object({})}),MN={browserSearch:EN},SN="3.0.31";function xN(Q={}){var J;let z=(J=JN(Q.baseURL))!=null?J:"https://api.groq.com/openai/v1",B=()=>t({Authorization:`Bearer ${e({apiKey:Q.apiKey,environmentVariableName:"GROQ_API_KEY",description:"Groq"})}`,...Q.headers},`ai-sdk/groq/${SN}`),j=(Z)=>new LN(Z,{provider:"groq.chat",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch}),$=(Z)=>{if(new.target)throw Error("The Groq model function cannot be called with the new keyword.");return j(Z)},X=(Z)=>{return new PN(Z,{provider:"groq.transcription",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch})},Y=function(Z){return $(Z)};return Y.specificationVersion="v3",Y.languageModel=$,Y.chat=j,Y.embeddingModel=(Z)=>{throw new u({modelId:Z,modelType:"embeddingModel"})},Y.textEmbeddingModel=Y.embeddingModel,Y.imageModel=(Z)=>{throw new u({modelId:Z,modelType:"imageModel"})},Y.transcription=X,Y.transcriptionModel=X,Y.tools=MN,Y}var gN=xN();export{gN as groq,xN as createGroq,EN as browserSearch,SN as VERSION};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as zB,b as HB}from"./chunk-
|
|
3
|
-
`+B}async function d(B){let V=o({baseUrl:B.url,fetch:B.fetch,directory:B.directory}),Y=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}],X=await YB(V.session,B)??(await V.session.create({permission:Y})).data?.id;if(!X){K.error("headless: failed to create session");return}let Z=ZB({sessionID:X,query:async()=>{return(await V.session.status()).data?.[X]}}),H=B.model?e.parseModel(B.model):void 0,M=()=>V.session.prompt({sessionID:X,agent:B.agent,model:H,parts:[{type:"text",text:B.prompt}]}),D=async(z)=>{let W=z;Z.onEvent(W);let J=W.properties;if(W.type==="message.part.updated"){let $=J?.part;if(!$||$.sessionID!==X)return;if($.type==="text"&&$.time?.end){let Q=String($.text??"").trim();if(Q)process.stdout.write(Q+G)}}if(W.type==="permission.asked"){if(!J||J.sessionID!==X)return;await V.permission.reply({requestID:String(J.id),reply:"once"})}if(W.type==="session.error"){if(!J||J.sessionID!==X||!J.error)return;let $=J.error,Q=$?.data!==null&&typeof $?.data==="object"&&"message"in $.data?String($.data.message):String($?.name??$);K.error(Q)}};if(B.events){let z=Promise.resolve(),W=await B.events.subscribe((J)=>{z=z.then(()=>D(J)),z.catch(($)=>{console.error($),process.exit(1)})});try{await M(),Z.markStarted(),await Z.completion,await z}finally{Z.stop(),W()}return}let U=(await V.event.subscribe()).stream[Symbol.asyncIterator](),N=Z.completion.then(()=>"DONE"),P=(async()=>{try{while(!0){let z=await Promise.race([U.next(),N]);if(z==="DONE")break;let W=z;if(W.done)break;await D(W.value)}}finally{Z.stop(),await U.return?.(void 0).catch(()=>{})}})();P.catch((z)=>{console.error(z),process.exit(1)}),await M(),Z.markStarted(),await Z.completion,await P}var sB=BB({command:"$0 [project]",describe:"start qitqode tui",builder:(B)=>g(B).positional("project",{type:"string",describe:"path to start qitqode in"}).options(i).option("never-ask",{type:"boolean",describe:"start in never-ask mode \u2014 auto-decide without asking (permissions excluded), toggle at runtime with /never-ask",default:!1}).check((V)=>{if(V.dark&&V.light)throw Error("--dark and --light are mutually exclusive");if(V.sso&&!V.headless)throw Error("--sso requires --headless");if(V.sso&&V["api-key"]!==void 0)throw Error("--sso and --api-key are mutually exclusive");let Y=Object.keys(KB).filter((X)=>V[X]);if(Y.length>1)throw Error(`${Y.map((X)=>`--${X}`).join(" and ")} are mutually exclusive \u2014 choose one tier flag`);if(Y.length===1&&V.model)throw Error(`--${Y[0]} and --model are mutually exclusive \u2014 use one or the other`);return!0}),handler:async(B)=>{if(B.monochrome)process.env.QITQODE_TUI_ACCESSIBLE="1",process.env.NO_COLOR="1";let V=VB();try{JB();let Y=XB(B);if(Y){K.error(Y),process.exitCode=1;return}let X=bB(B)??B.model,Z=y(process.env.PWD??process.cwd()),H=B.project?y(h.isAbsolute(B.project)?B.project:h.join(Z,B.project)):y(process.cwd());if(B.project&&!await I(H)){let J=jB(B.project,H);if(K.error(J.error),J.hint)K.println(J.hint);process.exitCode=1;return}let M=m(H);if(M){if(B.project){K.error("Cannot start in "+H+": "+M),process.exitCode=1;return}let J=y(QB.homedir());if(m(J)){K.error("Cannot start in "+H+": "+M),process.exitCode=1;return}S.warn("unsafe start directory, falling back to home",{requested:H,home:J}),H=J}let D=await qB();try{process.chdir(H)}catch{K.error("Failed to change directory to "+H);return}let C=y(process.cwd()),U=p({[u]:"worker",[c]:l()}),N=new Worker(D,{env:U});N.onerror=(J)=>{S.error("thread error",{message:J.message,filename:J.filename,lineno:J.lineno,colno:J.colno,error:J.error})};let b=n(N),P=()=>{b.call("reload",void 0).catch((J)=>{S.warn("worker reload failed",{error:L(J)})})};process.on("SIGUSR2",P);let z=!1,W=async()=>{if(z)return;z=!0,process.off("SIGUSR2",P),await a(b.call("shutdown",void 0),5000).catch((J)=>{S.warn("worker shutdown failed",{error:L(J)})}),N.terminate()};try{let J=import("./chunk-
|
|
2
|
+
import{a as zB,b as HB}from"./chunk-dhykktcp.js";import"./chunk-2zxygnx4.js";import"./chunk-jcznttek.js";import{B as XB,C as YB}from"./chunk-tz1sv9kt.js";import{D as JB,F as VB}from"./chunk-ajyfms68.js";import"./chunk-edm4c812.js";import{ba as ZB,ca as $B}from"./chunk-t8pmy758.js";import"./chunk-3dfy9k0t.js";import"./chunk-e4nap6v9.js";import{ge as BB}from"./chunk-sqrx9csx.js";import{$f as i,Yf as g,Zf as O,_f as T}from"./chunk-491f4ab9.js";import{dg as K}from"./chunk-5t69v8jg.js";import{Fg as r}from"./chunk-jkqa49xc.js";import{Bh as A}from"./chunk-p76c9s6g.js";import"./chunk-az2pxgx6.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-vr222v2n.js";import"./chunk-6vpc1y3w.js";import{Qj as a,Tk as e,xj as R}from"./chunk-j95mkzwg.js";import"./chunk-tatecas7.js";import{Ml as m}from"./chunk-52n4tdeh.js";import"./chunk-ft4msj4z.js";import"./chunk-m8djypsy.js";import"./chunk-m0f6cf9n.js";import"./chunk-n7ewvphw.js";import"./chunk-ya7wrt5f.js";import"./chunk-wf18y499.js";import"./chunk-4bp91rza.js";import"./chunk-6vxddv5w.js";import"./chunk-dwza14dk.js";import"./chunk-vey57h4x.js";import{Aq as o,Gq as s,Vq as t}from"./chunk-40pe0tde.js";import"./chunk-d4y5hyjg.js";import"./chunk-q0pd8bac.js";import"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import"./chunk-z9k4506p.js";import"./chunk-yxsc90ba.js";import"./chunk-vk8gxf4y.js";import"./chunk-jr622341.js";import"./chunk-xzshjp04.js";import"./chunk-pyt4xpze.js";import"./chunk-52f62kr0.js";import"./chunk-svnhycdw.js";import"./chunk-9skj2w9e.js";import{mu as n}from"./chunk-m5r6zq6v.js";import"./chunk-vg9ec44m.js";import"./chunk-e826jvr2.js";import"./chunk-4gv7nsdd.js";import"./chunk-afagt413.js";import"./chunk-76jbys6j.js";import{Ju as v}from"./chunk-9exxjnxc.js";import{fv as c,gv as u,hv as l,jv as p}from"./chunk-dm7hfb7f.js";import{nv as L}from"./chunk-s5taq9jy.js";import{wv as S}from"./chunk-62mb6wxm.js";import{Kv as I,Mv as y}from"./chunk-zg72kz2k.js";import"./chunk-kr7t73tg.js";import"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-sprbs7aj.js";import{MJ as x}from"./chunk-qvnsgyfk.js";import"./chunk-zezz8xfw.js";import"./chunk-bkqemdv8.js";import{cR as f}from"./chunk-pfx8ts02.js";import h from"path";import{fileURLToPath as MB}from"url";import{writeHeapSnapshot as GB}from"v8";import QB,{EOL as G}from"os";var KB={free:"free",adaptive:"adaptive",fast:"fast",economical:"economical",maxInt:"max-int",orchestrated:"orchestrated"},E=$B;function w(B){if(B.agent)return B.agent;return E}function jB(B,V){if(h.isAbsolute(B)||B.includes("/")||B.includes("\\")||B.startsWith(".")||B.startsWith("~"))return{error:"Directory not found: "+V};return{error:`Unknown command "${B}"`,hint:"Run `qitqode --help` to see the available commands, or pass an existing directory to start the TUI there."}}function bB(B){for(let[V,Y]of Object.entries(KB))if(B[V]){let X=v[Y];if(X)return`${X.providerID}/${X.modelID}`}return}function FB(B){return async(Y,X)=>{let Z=new Request(Y,X),H=Z.body?await Z.text():void 0,M=await B.call("fetch",{url:Z.url,method:Z.method,headers:Object.fromEntries(Z.headers.entries()),body:H});return new Response(M.body,{status:M.status,headers:M.headers})}}function _B(B){return{subscribe:async(V)=>{return B.on("global.event",(Y)=>{V(Y)})}}}async function qB(){if(typeof globalThis.QITQODE_WORKER_PATH<"u")return globalThis.QITQODE_WORKER_PATH;let B=new URL("./cli/cmd/tui/worker.js",import.meta.url);if(await I(MB(B)))return B;return new URL("./worker.ts",import.meta.url)}async function yB(B){let V=process.stdin.isTTY?void 0:await Bun.stdin.text();if(!B)return V;if(!V)return B;return V+`
|
|
3
|
+
`+B}async function d(B){let V=o({baseUrl:B.url,fetch:B.fetch,directory:B.directory}),Y=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}],X=await YB(V.session,B)??(await V.session.create({permission:Y})).data?.id;if(!X){K.error("headless: failed to create session");return}let Z=ZB({sessionID:X,query:async()=>{return(await V.session.status()).data?.[X]}}),H=B.model?e.parseModel(B.model):void 0,M=()=>V.session.prompt({sessionID:X,agent:B.agent,model:H,parts:[{type:"text",text:B.prompt}]}),D=async(z)=>{let W=z;Z.onEvent(W);let J=W.properties;if(W.type==="message.part.updated"){let $=J?.part;if(!$||$.sessionID!==X)return;if($.type==="text"&&$.time?.end){let Q=String($.text??"").trim();if(Q)process.stdout.write(Q+G)}}if(W.type==="permission.asked"){if(!J||J.sessionID!==X)return;await V.permission.reply({requestID:String(J.id),reply:"once"})}if(W.type==="session.error"){if(!J||J.sessionID!==X||!J.error)return;let $=J.error,Q=$?.data!==null&&typeof $?.data==="object"&&"message"in $.data?String($.data.message):String($?.name??$);K.error(Q)}};if(B.events){let z=Promise.resolve(),W=await B.events.subscribe((J)=>{z=z.then(()=>D(J)),z.catch(($)=>{console.error($),process.exit(1)})});try{await M(),Z.markStarted(),await Z.completion,await z}finally{Z.stop(),W()}return}let U=(await V.event.subscribe()).stream[Symbol.asyncIterator](),N=Z.completion.then(()=>"DONE"),P=(async()=>{try{while(!0){let z=await Promise.race([U.next(),N]);if(z==="DONE")break;let W=z;if(W.done)break;await D(W.value)}}finally{Z.stop(),await U.return?.(void 0).catch(()=>{})}})();P.catch((z)=>{console.error(z),process.exit(1)}),await M(),Z.markStarted(),await Z.completion,await P}var sB=BB({command:"$0 [project]",describe:"start qitqode tui",builder:(B)=>g(B).positional("project",{type:"string",describe:"path to start qitqode in"}).options(i).option("never-ask",{type:"boolean",describe:"start in never-ask mode \u2014 auto-decide without asking (permissions excluded), toggle at runtime with /never-ask",default:!1}).check((V)=>{if(V.dark&&V.light)throw Error("--dark and --light are mutually exclusive");if(V.sso&&!V.headless)throw Error("--sso requires --headless");if(V.sso&&V["api-key"]!==void 0)throw Error("--sso and --api-key are mutually exclusive");let Y=Object.keys(KB).filter((X)=>V[X]);if(Y.length>1)throw Error(`${Y.map((X)=>`--${X}`).join(" and ")} are mutually exclusive \u2014 choose one tier flag`);if(Y.length===1&&V.model)throw Error(`--${Y[0]} and --model are mutually exclusive \u2014 use one or the other`);return!0}),handler:async(B)=>{if(B.monochrome)process.env.QITQODE_TUI_ACCESSIBLE="1",process.env.NO_COLOR="1";let V=VB();try{JB();let Y=XB(B);if(Y){K.error(Y),process.exitCode=1;return}let X=bB(B)??B.model,Z=y(process.env.PWD??process.cwd()),H=B.project?y(h.isAbsolute(B.project)?B.project:h.join(Z,B.project)):y(process.cwd());if(B.project&&!await I(H)){let J=jB(B.project,H);if(K.error(J.error),J.hint)K.println(J.hint);process.exitCode=1;return}let M=m(H);if(M){if(B.project){K.error("Cannot start in "+H+": "+M),process.exitCode=1;return}let J=y(QB.homedir());if(m(J)){K.error("Cannot start in "+H+": "+M),process.exitCode=1;return}S.warn("unsafe start directory, falling back to home",{requested:H,home:J}),H=J}let D=await qB();try{process.chdir(H)}catch{K.error("Failed to change directory to "+H);return}let C=y(process.cwd()),U=p({[u]:"worker",[c]:l()}),N=new Worker(D,{env:U});N.onerror=(J)=>{S.error("thread error",{message:J.message,filename:J.filename,lineno:J.lineno,colno:J.colno,error:J.error})};let b=n(N),P=()=>{b.call("reload",void 0).catch((J)=>{S.warn("worker reload failed",{error:L(J)})})};process.on("SIGUSR2",P);let z=!1,W=async()=>{if(z)return;z=!0,process.off("SIGUSR2",P),await a(b.call("shutdown",void 0),5000).catch((J)=>{S.warn("worker shutdown failed",{error:L(J)})}),N.terminate()};try{let J=import("./chunk-8q50bha4.js"),$=import("./chunk-0mb55ytc.js").then(({TuiConfig:q})=>q.get()),Q=await yB(B.prompt),WB=await $;if(B.headless&&O(T(B))){K.error("--headless cannot be combined with network-listener flags (--port, --hostname, --mdns)"),process.exitCode=1;return}let k=T(B),j=O(k)?{url:(await b.call("server",k)).url,fetch:void 0,events:void 0}:{url:"http://qitqode.internal",fetch:FB(b),events:_B(b)};if(setTimeout(()=>{b.call("checkUpgrade",{directory:C}).catch(()=>{})},1000).unref?.(),B.headless){if(!Q){K.error("--headless requires a prompt: pass --prompt or pipe input via stdin"),process.exitCode=1;return}if(B.sso){try{let F=await r({tryOpen:!1,onCode:(_)=>{if(process.stdout.write(G),process.stdout.write(" To sign in, open: "+_.verificationUri+G),process.stdout.write(" and enter code: "+_.userCode+G),_.verificationUriComplete)process.stdout.write(G+" Or open this link directly:"+G+" "+_.verificationUriComplete+G);process.stdout.write(G+" Waiting for approval... (ctrl+c to cancel)"+G)}});await A.runPromise(x.gen(function*(){yield*(yield*R.Service).set("forgewise",t(F,{rotateRefreshToken:!0}))})),process.stdout.write(" Signed in as "+(F.name||F.email)+G)}catch(F){K.error("SSO sign-in failed: "+L(F)),process.exitCode=1;return}await d({url:j.url,fetch:j.fetch,events:j.events,prompt:Q,model:X,agent:w(B)??E,directory:C,continue:B.continue,sessionID:B.session,fork:B.fork});return}let q=zB(typeof B["api-key"]==="string"?String(B["api-key"]):"");if(q)await A.runPromise(HB(q));else if(!await A.runPromise(x.gen(function*(){if(yield*x.promise(()=>s()))return!0;return!!(yield*(yield*R.Service).get("forgewise"))}))){K.error(`Not signed in. Use one of:
|
|
4
4
|
qitqode auth login (browser / device-code flow)
|
|
5
5
|
qitqode auth login --api-key (paste a Qortex API key)
|
|
6
6
|
--api-key <key> (inline for this run)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ad as
|
|
2
|
+
import{Ad as b,Bd as c,Cd as d,Dd as e,Ed as f,Fd as g,Gd as h,Hd as i,Id as j,Jd as k,Kd as l,zd as a}from"./chunk-h3yazfmh.js";import"./chunk-pfx8ts02.js";export{i as setRendererCapabilities,a as pasteBytes,f as createTestRenderer,h as createTerminalCapabilities,j as createSpy,e as createMockMouse,c as createMockKeys,l as TestRecorder,d as MouseButtons,g as MockTreeSitterClient,k as ManualClock,b as KeyCodes};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{S as
|
|
2
|
+
import{dh as r}from"./chunk-p76c9s6g.js";import{Mj as e}from"./chunk-j95mkzwg.js";import{Zl as t}from"./chunk-ft4msj4z.js";import{lp as l}from"./chunk-wf18y499.js";import{Tv as a}from"./chunk-kr7t73tg.js";import{zQ as o}from"./chunk-qvnsgyfk.js";var S={PromptAppend:t.define("tui.prompt.append",a.object({text:a.string()})),CommandExecute:t.define("tui.command.execute",a.object({command:a.union([a.enum(["session.list","session.new","session.share","session.interrupt","session.compact","session.page.up","session.page.down","session.line.up","session.line.down","session.half.page.up","session.half.page.down","session.first","session.last","prompt.clear","prompt.submit","agent.cycle"]),a.string()])})),ToastShow:t.define("tui.toast.show",a.object({title:a.string().optional(),message:a.string(),variant:a.enum(["info","success","warning","error"]),duration:a.number().default(5000).optional().describe("Duration in milliseconds")})),SessionSelect:t.define("tui.session.select",a.object({sessionID:e.zod.describe("Session ID to navigate to")})),InstructionsLoaded:r};class m extends o.Class("ConsoleState")({consoleManagedProviders:o.mutable(o.Array(o.String)),activeOrgName:o.optional(o.String),switchableOrgCount:o.Number}){static zod=l(this)}var f=m.make({consoleManagedProviders:[],activeOrgName:void 0,switchableOrgCount:0});
|
|
3
|
+
export{S as zg,m as Ag,f as Bg};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{As as I,Fs as t,os as j,ps as M,qs as f,ss as N,vs as H,ws as z,xs as A}from"./chunk-4dy64hgp.js";import{Gs as U}from"./chunk-gt10s0ks.js";import{Vv as n}from"./chunk-9tfm1dk2.js";import{dB as d}from"./chunk-x2mbre12.js";function NJ(...F){return F.reduce((J,Q)=>({...J,...Q!=null?Q:{}}),{})}function VJ({tools:F=[],providerToolNames:J,resolveProviderToolName:Q}){var W;let X={},Y={};for(let Z of F)if(Z.type==="provider"){let $=(W=Q==null?void 0:Q(Z))!=null?W:(Z.id in J)?J[Z.id]:void 0;if($==null)continue;X[Z.name]=$,Y[$]=Z.name}return{toProviderToolName:(Z)=>{var $;return($=X[Z])!=null?$:Z},toCustomToolName:(Z)=>{var $;return($=Y[Z])!=null?$:Z}}}function B(F){return Object.fromEntries([...F.headers])}var{btoa:$F,atob:LF}=globalThis;function TJ(F){let J=F.replace(/-/g,"+").replace(/_/g,"/"),Q=LF(J);return Uint8Array.from(Q,(W)=>W.codePointAt(0))}function o(F){let J="";for(let Q=0;Q<F.length;Q++)J+=String.fromCodePoint(F[Q]);return $F(J)}function _J(F){return F instanceof Uint8Array?o(F):F}function jJ(F){if(F.type==="url")return F.url;return`data:${F.mediaType};base64,${typeof F.data==="string"?F.data:o(F.data)}`}function kJ(F,J={}){let{useArrayBrackets:Q=!0}=J,W=new FormData;for(let[X,Y]of Object.entries(F)){if(Y==null)continue;if(Array.isArray(Y)){if(Y.length===1){W.append(X,Y[0]);continue}let Z=Q?`${X}[]`:X;for(let $ of Y)W.append(Z,$);continue}W.append(X,Y)}return W}var a="AI_DownloadError",s=`vercel.ai.error.${a}`,UF=Symbol.for(s),m,u,O=class extends(u=j,m=UF,u){constructor({url:F,statusCode:J,statusText:Q,cause:W,message:X=W==null?`Failed to download ${F}: ${J} ${Q}`:`Failed to download ${F}: ${W}`}){super({name:a,message:X,cause:W});this[m]=!0,this.url=F,this.statusCode=J,this.statusText=Q}static isInstance(F){return j.hasMarker(F,s)}},r=2147483648;async function wF({response:F,url:J,maxBytes:Q=r}){let W=F.headers.get("content-length");if(W!=null){let G=parseInt(W,10);if(!isNaN(G)&&G>Q)throw new O({url:J,message:`Download of ${J} exceeded maximum size of ${Q} bytes (Content-Length: ${G}).`})}let X=F.body;if(X==null)return new Uint8Array(0);let Y=X.getReader(),Z=[],$=0;try{while(!0){let{done:G,value:R}=await Y.read();if(G)break;if($+=R.length,$>Q)throw new O({url:J,message:`Download of ${J} exceeded maximum size of ${Q} bytes.`});Z.push(R)}}finally{try{await Y.cancel()}finally{Y.releaseLock()}}let w=new Uint8Array($),L=0;for(let G of Z)w.set(G,L),L+=G.length;return w}function i(F){let J;try{J=new URL(F)}catch(W){throw new O({url:F,message:`Invalid URL: ${F}`})}if(J.protocol!=="http:"&&J.protocol!=="https:")throw new O({url:F,message:`URL scheme must be http or https, got ${J.protocol}`});let Q=J.hostname;if(!Q)throw new O({url:F,message:"URL must have a hostname"});if(Q==="localhost"||Q.endsWith(".local")||Q.endsWith(".localhost"))throw new O({url:F,message:`URL with hostname ${Q} is not allowed`});if(Q.startsWith("[")&&Q.endsWith("]")){let W=Q.slice(1,-1);if(EF(W))throw new O({url:F,message:`URL with IPv6 address ${Q} is not allowed`});return}if(e(Q)){if(k(Q))throw new O({url:F,message:`URL with IP address ${Q} is not allowed`});return}}function e(F){let J=F.split(".");if(J.length!==4)return!1;return J.every((Q)=>{let W=Number(Q);return Number.isInteger(W)&&W>=0&&W<=255&&String(W)===Q})}function k(F){let J=F.split(".").map(Number),[Q,W]=J;if(Q===0)return!0;if(Q===10)return!0;if(Q===127)return!0;if(Q===169&&W===254)return!0;if(Q===172&&W>=16&&W<=31)return!0;if(Q===192&&W===168)return!0;return!1}function EF(F){let J=F.toLowerCase();if(J==="::1")return!0;if(J==="::")return!0;if(J.startsWith("::ffff:")){let Q=J.slice(7);if(e(Q))return k(Q);let W=Q.split(":");if(W.length===2){let X=parseInt(W[0],16),Y=parseInt(W[1],16);if(!isNaN(X)&&!isNaN(Y)){let Z=X>>8&255,$=X&255,w=Y>>8&255,L=Y&255;return k(`${Z}.${$}.${w}.${L}`)}}}if(J.startsWith("fc")||J.startsWith("fd"))return!0;if(J.startsWith("fe80"))return!0;return!1}async function SJ(F,J){var Q,W;i(F);try{let X=await fetch(F,{signal:J==null?void 0:J.abortSignal});if(X.redirected)i(X.url);if(!X.ok)throw new O({url:F,statusCode:X.status,statusText:X.statusText});let Y=await wF({response:X,url:F,maxBytes:(Q=J==null?void 0:J.maxBytes)!=null?Q:r}),Z=(W=X.headers.get("content-type"))!=null?W:void 0;return new Blob([Y],Z?{type:Z}:void 0)}catch(X){if(O.isInstance(X))throw X;throw new O({url:F,cause:X})}}var GF=({prefix:F,size:J=16,alphabet:Q="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:W="-"}={})=>{let X=()=>{let Y=Q.length,Z=Array(J);for(let $=0;$<J;$++)Z[$]=Q[Math.random()*Y|0];return Z.join("")};if(F==null)return X;if(Q.includes(W))throw new N({argument:"separator",message:`The separator "${W}" must not be part of the alphabet "${Q}".`});return()=>`${F}${W}${X()}`},xJ=GF();function b(F){return(F instanceof Error||F instanceof DOMException)&&(F.name==="AbortError"||F.name==="ResponseAborted"||F.name==="TimeoutError")}var CF=["fetch failed","failed to fetch"],MF=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function KF(F){if(!(F instanceof Error))return!1;let J=F.code;if(typeof J==="string"&&MF.includes(J))return!0;return!1}function qF({error:F,url:J,requestBodyValues:Q}){if(b(F))return F;if(F instanceof TypeError&&CF.includes(F.message.toLowerCase())){let W=F.cause;if(W!=null)return new M({message:`Cannot connect to API: ${W.message}`,cause:W,url:J,requestBodyValues:Q,isRetryable:!0})}if(KF(F))return new M({message:`Cannot connect to API: ${F.message}`,cause:F,url:J,requestBodyValues:Q,isRetryable:!0});return F}function DF(F=globalThis){var J,Q,W;if(F.window)return"runtime/browser";if((J=F.navigator)==null?void 0:J.userAgent)return`runtime/${F.navigator.userAgent.toLowerCase()}`;if((W=(Q=F.process)==null?void 0:Q.versions)==null?void 0:W.node)return`runtime/node.js/${F.process.version.substring(0)}`;if(F.EdgeRuntime)return"runtime/vercel-edge";return"runtime/unknown"}function OF(F){if(F==null)return{};let J={};if(F instanceof Headers)F.forEach((Q,W)=>{J[W.toLowerCase()]=Q});else{if(!Array.isArray(F))F=Object.entries(F);for(let[Q,W]of F)if(W!=null)J[Q.toLowerCase()]=W}return J}function IF(F,...J){let Q=new Headers(OF(F)),W=Q.get("user-agent")||"";return Q.set("user-agent",[W,...J].filter(Boolean).join(" ")),Object.fromEntries(Q.entries())}var PF="4.0.21";var zF="JSON schema:",AF="You MUST answer with a JSON object that matches the JSON schema above.",HF="You MUST answer with JSON.";function BF({prompt:F,schema:J,schemaPrefix:Q=J!=null?zF:void 0,schemaSuffix:W=J!=null?AF:HF}){return[F!=null&&F.length>0?F:void 0,F!=null&&F.length>0?"":void 0,Q,J!=null?JSON.stringify(J):void 0,W].filter((X)=>X!=null).join(`
|
|
3
3
|
`)}function yJ({messages:F,schema:J,schemaPrefix:Q,schemaSuffix:W}){var X,Y;let Z=((X=F[0])==null?void 0:X.role)==="system"?{...F[0]}:{role:"system",content:""};return Z.content=BF({prompt:Z.content,schema:J,schemaPrefix:Q,schemaSuffix:W}),[Z,...((Y=F[0])==null?void 0:Y.role)==="system"?F.slice(1):F]}function hJ(F){return F!=null}function uJ({apiKey:F,environmentVariableName:J,apiKeyParameterName:Q="apiKey",description:W}){if(typeof F==="string")return F;if(F!=null)throw new z({message:`${W} API key must be a string.`});if(typeof process>"u")throw new z({message:`${W} API key is missing. Pass it using the '${Q}' parameter. Environment variables is not supported in this environment.`});if(F=process.env[J],F==null)throw new z({message:`${W} API key is missing. Pass it using the '${Q}' parameter or the ${J} environment variable.`});if(typeof F!=="string")throw new z({message:`${W} API key must be a string. The value of the ${J} environment variable is not a string.`});return F}function pJ({settingValue:F,environmentVariableName:J,settingName:Q,description:W}){if(typeof F==="string")return F;if(F!=null)throw new A({message:`${W} setting must be a string.`});if(typeof process>"u")throw new A({message:`${W} setting is missing. Pass it using the '${Q}' parameter. Environment variables is not supported in this environment.`});if(F=process.env[J],F==null)throw new A({message:`${W} setting is missing. Pass it using the '${Q}' parameter or the ${J} environment variable.`});if(typeof F!=="string")throw new A({message:`${W} setting must be a string. The value of the ${J} environment variable is not a string.`});return F}function lJ(F){var J;let[Q,W=""]=F.toLowerCase().split("/");return(J={mpeg:"mp3","x-wav":"wav",opus:"ogg",mp4:"m4a","x-m4a":"m4a"}[W])!=null?J:W}var RF=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,NF=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function p(F){let J=JSON.parse(F);if(J===null||typeof J!=="object")return J;if(RF.test(F)===!1&&NF.test(F)===!1)return J;return VF(J)}function VF(F){let J=[F];while(J.length){let Q=J;J=[];for(let W of Q){if(Object.prototype.hasOwnProperty.call(W,"__proto__"))throw SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(W,"constructor")&&W.constructor!==null&&typeof W.constructor==="object"&&Object.prototype.hasOwnProperty.call(W.constructor,"prototype"))throw SyntaxError("Object contains forbidden prototype property");for(let X in W){let Y=W[X];if(Y&&typeof Y==="object")J.push(Y)}}}return F}function x(F){let{stackTraceLimit:J}=Error;try{Error.stackTraceLimit=0}catch(Q){return p(F)}try{return p(F)}finally{Error.stackTraceLimit=J}}function v(F){if(F.type==="object"||Array.isArray(F.type)&&F.type.includes("object")){F.additionalProperties=!1;let{properties:Q}=F;if(Q!=null)for(let W of Object.keys(Q))Q[W]=P(Q[W])}if(F.items!=null)F.items=Array.isArray(F.items)?F.items.map(P):P(F.items);if(F.anyOf!=null)F.anyOf=F.anyOf.map(P);if(F.allOf!=null)F.allOf=F.allOf.map(P);if(F.oneOf!=null)F.oneOf=F.oneOf.map(P);let{definitions:J}=F;if(J!=null)for(let Q of Object.keys(J))J[Q]=P(J[Q]);return F}function P(F){if(typeof F==="boolean")return F;return v(F)}var TF=Symbol("Let zodToJsonSchema decide on which parser to use"),l={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},_F=(F)=>typeof F==="string"?{...l,name:F}:{...l,...F};function K(){return{}}function jF(F,J){var Q,W,X;let Y={type:"array"};if(((Q=F.type)==null?void 0:Q._def)&&((X=(W=F.type)==null?void 0:W._def)==null?void 0:X.typeName)!==U.ZodAny)Y.items=E(F.type._def,{...J,currentPath:[...J.currentPath,"items"]});if(F.minLength)Y.minItems=F.minLength.value;if(F.maxLength)Y.maxItems=F.maxLength.value;if(F.exactLength)Y.minItems=F.exactLength.value,Y.maxItems=F.exactLength.value;return Y}function kF(F){let J={type:"integer",format:"int64"};if(!F.checks)return J;for(let Q of F.checks)switch(Q.kind){case"min":if(Q.inclusive)J.minimum=Q.value;else J.exclusiveMinimum=Q.value;break;case"max":if(Q.inclusive)J.maximum=Q.value;else J.exclusiveMaximum=Q.value;break;case"multipleOf":J.multipleOf=Q.value;break}return J}function bF(){return{type:"boolean"}}function FF(F,J){return E(F.type._def,J)}var SF=(F,J)=>{return E(F.innerType._def,J)};function JF(F,J,Q){let W=Q!=null?Q:J.dateStrategy;if(Array.isArray(W))return{anyOf:W.map((X,Y)=>JF(F,J,X))};switch(W){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return gF(F)}}var gF=(F)=>{let J={type:"integer",format:"unix-time"};for(let Q of F.checks)switch(Q.kind){case"min":J.minimum=Q.value;break;case"max":J.maximum=Q.value;break}return J};function xF(F,J){return{...E(F.innerType._def,J),default:F.defaultValue()}}function vF(F,J){return J.effectStrategy==="input"?E(F.schema._def,J):K()}function yF(F){return{type:"string",enum:Array.from(F.values)}}var hF=(F)=>{if("type"in F&&F.type==="string")return!1;return"allOf"in F};function mF(F,J){let Q=[E(F.left._def,{...J,currentPath:[...J.currentPath,"allOf","0"]}),E(F.right._def,{...J,currentPath:[...J.currentPath,"allOf","1"]})].filter((X)=>!!X),W=[];return Q.forEach((X)=>{if(hF(X))W.push(...X.allOf);else{let Y=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:Z,...$}=X;Y=$}W.push(Y)}}),W.length?{allOf:W}:void 0}function uF(F){let J=typeof F.value;if(J!=="bigint"&&J!=="number"&&J!=="boolean"&&J!=="string")return{type:Array.isArray(F.value)?"array":"object"};return{type:J==="bigint"?"integer":J,const:F.value}}var T=void 0,q={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(T===void 0)T=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return T},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function QF(F,J){let Q={type:"string"};if(F.checks)for(let W of F.checks)switch(W.kind){case"min":Q.minLength=typeof Q.minLength==="number"?Math.max(Q.minLength,W.value):W.value;break;case"max":Q.maxLength=typeof Q.maxLength==="number"?Math.min(Q.maxLength,W.value):W.value;break;case"email":switch(J.emailStrategy){case"format:email":D(Q,"email",W.message,J);break;case"format:idn-email":D(Q,"idn-email",W.message,J);break;case"pattern:zod":C(Q,q.email,W.message,J);break}break;case"url":D(Q,"uri",W.message,J);break;case"uuid":D(Q,"uuid",W.message,J);break;case"regex":C(Q,W.regex,W.message,J);break;case"cuid":C(Q,q.cuid,W.message,J);break;case"cuid2":C(Q,q.cuid2,W.message,J);break;case"startsWith":C(Q,RegExp(`^${_(W.value,J)}`),W.message,J);break;case"endsWith":C(Q,RegExp(`${_(W.value,J)}$`),W.message,J);break;case"datetime":D(Q,"date-time",W.message,J);break;case"date":D(Q,"date",W.message,J);break;case"time":D(Q,"time",W.message,J);break;case"duration":D(Q,"duration",W.message,J);break;case"length":Q.minLength=typeof Q.minLength==="number"?Math.max(Q.minLength,W.value):W.value,Q.maxLength=typeof Q.maxLength==="number"?Math.min(Q.maxLength,W.value):W.value;break;case"includes":{C(Q,RegExp(_(W.value,J)),W.message,J);break}case"ip":{if(W.version!=="v6")D(Q,"ipv4",W.message,J);if(W.version!=="v4")D(Q,"ipv6",W.message,J);break}case"base64url":C(Q,q.base64url,W.message,J);break;case"jwt":C(Q,q.jwt,W.message,J);break;case"cidr":{if(W.version!=="v6")C(Q,q.ipv4Cidr,W.message,J);if(W.version!=="v4")C(Q,q.ipv6Cidr,W.message,J);break}case"emoji":C(Q,q.emoji(),W.message,J);break;case"ulid":{C(Q,q.ulid,W.message,J);break}case"base64":{switch(J.base64Strategy){case"format:binary":{D(Q,"binary",W.message,J);break}case"contentEncoding:base64":{Q.contentEncoding="base64";break}case"pattern:zod":{C(Q,q.base64,W.message,J);break}}break}case"nanoid":C(Q,q.nanoid,W.message,J);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return Q}function _(F,J){return J.patternStrategy==="escape"?pF(F):F}var iF=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function pF(F){let J="";for(let Q=0;Q<F.length;Q++){if(!iF.has(F[Q]))J+="\\";J+=F[Q]}return J}function D(F,J,Q,W){var X;if(F.format||((X=F.anyOf)==null?void 0:X.some((Y)=>Y.format))){if(!F.anyOf)F.anyOf=[];if(F.format)F.anyOf.push({format:F.format}),delete F.format;F.anyOf.push({format:J,...Q&&W.errorMessages&&{errorMessage:{format:Q}}})}else F.format=J}function C(F,J,Q,W){var X;if(F.pattern||((X=F.allOf)==null?void 0:X.some((Y)=>Y.pattern))){if(!F.allOf)F.allOf=[];if(F.pattern)F.allOf.push({pattern:F.pattern}),delete F.pattern;F.allOf.push({pattern:c(J,W),...Q&&W.errorMessages&&{errorMessage:{pattern:Q}}})}else F.pattern=c(J,W)}function c(F,J){var Q;if(!J.applyRegexFlags||!F.flags)return F.source;let W={i:F.flags.includes("i"),m:F.flags.includes("m"),s:F.flags.includes("s")},X=W.i?F.source.toLowerCase():F.source,Y="",Z=!1,$=!1,w=!1;for(let L=0;L<X.length;L++){if(Z){Y+=X[L],Z=!1;continue}if(W.i){if($){if(X[L].match(/[a-z]/)){if(w)Y+=X[L],Y+=`${X[L-2]}-${X[L]}`.toUpperCase(),w=!1;else if(X[L+1]==="-"&&((Q=X[L+2])==null?void 0:Q.match(/[a-z]/)))Y+=X[L],w=!0;else Y+=`${X[L]}${X[L].toUpperCase()}`;continue}}else if(X[L].match(/[a-z]/)){Y+=`[${X[L]}${X[L].toUpperCase()}]`;continue}}if(W.m){if(X[L]==="^"){Y+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(X[L]==="$"){Y+=`($|(?=[\r
|
|
5
5
|
]))`;continue}}if(W.s&&X[L]==="."){Y+=$?`${X[L]}\r
|
|
6
6
|
`:`[${X[L]}\r
|
|
7
7
|
]`;continue}if(Y+=X[L],X[L]==="\\")Z=!0;else if($&&X[L]==="]")$=!1;else if(!$&&X[L]==="[")$=!0}try{new RegExp(Y)}catch(L){return console.warn(`Could not convert regex pattern at ${J.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),F.source}return Y}function WF(F,J){var Q,W,X,Y,Z,$;let w={type:"object",additionalProperties:(Q=E(F.valueType._def,{...J,currentPath:[...J.currentPath,"additionalProperties"]}))!=null?Q:J.allowedAdditionalProperties};if(((W=F.keyType)==null?void 0:W._def.typeName)===U.ZodString&&((X=F.keyType._def.checks)==null?void 0:X.length)){let{type:L,...G}=QF(F.keyType._def,J);return{...w,propertyNames:G}}else if(((Y=F.keyType)==null?void 0:Y._def.typeName)===U.ZodEnum)return{...w,propertyNames:{enum:F.keyType._def.values}};else if(((Z=F.keyType)==null?void 0:Z._def.typeName)===U.ZodBranded&&F.keyType._def.type._def.typeName===U.ZodString&&(($=F.keyType._def.type._def.checks)==null?void 0:$.length)){let{type:L,...G}=FF(F.keyType._def,J);return{...w,propertyNames:G}}return w}function lF(F,J){if(J.mapStrategy==="record")return WF(F,J);let Q=E(F.keyType._def,{...J,currentPath:[...J.currentPath,"items","items","0"]})||K(),W=E(F.valueType._def,{...J,currentPath:[...J.currentPath,"items","items","1"]})||K();return{type:"array",maxItems:125,items:{type:"array",items:[Q,W],minItems:2,maxItems:2}}}function cF(F){let J=F.values,W=Object.keys(F.values).filter((Y)=>{return typeof J[J[Y]]!=="number"}).map((Y)=>J[Y]),X=Array.from(new Set(W.map((Y)=>typeof Y)));return{type:X.length===1?X[0]==="string"?"string":"number":["string","number"],enum:W}}function dF(){return{not:K()}}function nF(){return{type:"null"}}var S={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function fF(F,J){let Q=F.options instanceof Map?Array.from(F.options.values()):F.options;if(Q.every((W)=>(W._def.typeName in S)&&(!W._def.checks||!W._def.checks.length))){let W=Q.reduce((X,Y)=>{let Z=S[Y._def.typeName];return Z&&!X.includes(Z)?[...X,Z]:X},[]);return{type:W.length>1?W:W[0]}}else if(Q.every((W)=>W._def.typeName==="ZodLiteral"&&!W.description)){let W=Q.reduce((X,Y)=>{let Z=typeof Y._def.value;switch(Z){case"string":case"number":case"boolean":return[...X,Z];case"bigint":return[...X,"integer"];case"object":if(Y._def.value===null)return[...X,"null"];case"symbol":case"undefined":case"function":default:return X}},[]);if(W.length===Q.length){let X=W.filter((Y,Z,$)=>$.indexOf(Y)===Z);return{type:X.length>1?X:X[0],enum:Q.reduce((Y,Z)=>{return Y.includes(Z._def.value)?Y:[...Y,Z._def.value]},[])}}}else if(Q.every((W)=>W._def.typeName==="ZodEnum"))return{type:"string",enum:Q.reduce((W,X)=>[...W,...X._def.values.filter((Y)=>!W.includes(Y))],[])};return tF(F,J)}var tF=(F,J)=>{let Q=(F.options instanceof Map?Array.from(F.options.values()):F.options).map((W,X)=>E(W._def,{...J,currentPath:[...J.currentPath,"anyOf",`${X}`]})).filter((W)=>!!W&&(!J.strictUnions||typeof W==="object"&&Object.keys(W).length>0));return Q.length?{anyOf:Q}:void 0};function oF(F,J){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(F.innerType._def.typeName)&&(!F.innerType._def.checks||!F.innerType._def.checks.length))return{type:[S[F.innerType._def.typeName],"null"]};let Q=E(F.innerType._def,{...J,currentPath:[...J.currentPath,"anyOf","0"]});return Q&&{anyOf:[Q,{type:"null"}]}}function aF(F){let J={type:"number"};if(!F.checks)return J;for(let Q of F.checks)switch(Q.kind){case"int":J.type="integer";break;case"min":if(Q.inclusive)J.minimum=Q.value;else J.exclusiveMinimum=Q.value;break;case"max":if(Q.inclusive)J.maximum=Q.value;else J.exclusiveMaximum=Q.value;break;case"multipleOf":J.multipleOf=Q.value;break}return J}function sF(F,J){let Q={type:"object",properties:{}},W=[],X=F.shape();for(let Z in X){let $=X[Z];if($===void 0||$._def===void 0)continue;let w=eF($),L=E($._def,{...J,currentPath:[...J.currentPath,"properties",Z],propertyPath:[...J.currentPath,"properties",Z]});if(L===void 0)continue;if(Q.properties[Z]=L,!w)W.push(Z)}if(W.length)Q.required=W;let Y=rF(F,J);if(Y!==void 0)Q.additionalProperties=Y;return Q}function rF(F,J){if(F.catchall._def.typeName!=="ZodNever")return E(F.catchall._def,{...J,currentPath:[...J.currentPath,"additionalProperties"]});switch(F.unknownKeys){case"passthrough":return J.allowedAdditionalProperties;case"strict":return J.rejectedAdditionalProperties;case"strip":return J.removeAdditionalStrategy==="strict"?J.allowedAdditionalProperties:J.rejectedAdditionalProperties}}function eF(F){try{return F.isOptional()}catch(J){return!0}}var FJ=(F,J)=>{var Q;if(J.currentPath.toString()===((Q=J.propertyPath)==null?void 0:Q.toString()))return E(F.innerType._def,J);let W=E(F.innerType._def,{...J,currentPath:[...J.currentPath,"anyOf","1"]});return W?{anyOf:[{not:K()},W]}:K()},JJ=(F,J)=>{if(J.pipeStrategy==="input")return E(F.in._def,J);else if(J.pipeStrategy==="output")return E(F.out._def,J);let Q=E(F.in._def,{...J,currentPath:[...J.currentPath,"allOf","0"]}),W=E(F.out._def,{...J,currentPath:[...J.currentPath,"allOf",Q?"1":"0"]});return{allOf:[Q,W].filter((X)=>X!==void 0)}};function QJ(F,J){return E(F.type._def,J)}function WJ(F,J){let W={type:"array",uniqueItems:!0,items:E(F.valueType._def,{...J,currentPath:[...J.currentPath,"items"]})};if(F.minSize)W.minItems=F.minSize.value;if(F.maxSize)W.maxItems=F.maxSize.value;return W}function XJ(F,J){if(F.rest)return{type:"array",minItems:F.items.length,items:F.items.map((Q,W)=>E(Q._def,{...J,currentPath:[...J.currentPath,"items",`${W}`]})).reduce((Q,W)=>W===void 0?Q:[...Q,W],[]),additionalItems:E(F.rest._def,{...J,currentPath:[...J.currentPath,"additionalItems"]})};else return{type:"array",minItems:F.items.length,maxItems:F.items.length,items:F.items.map((Q,W)=>E(Q._def,{...J,currentPath:[...J.currentPath,"items",`${W}`]})).reduce((Q,W)=>W===void 0?Q:[...Q,W],[])}}function YJ(){return{not:K()}}function ZJ(){return K()}var $J=(F,J)=>{return E(F.innerType._def,J)},LJ=(F,J,Q)=>{switch(J){case U.ZodString:return QF(F,Q);case U.ZodNumber:return aF(F);case U.ZodObject:return sF(F,Q);case U.ZodBigInt:return kF(F);case U.ZodBoolean:return bF();case U.ZodDate:return JF(F,Q);case U.ZodUndefined:return YJ();case U.ZodNull:return nF();case U.ZodArray:return jF(F,Q);case U.ZodUnion:case U.ZodDiscriminatedUnion:return fF(F,Q);case U.ZodIntersection:return mF(F,Q);case U.ZodTuple:return XJ(F,Q);case U.ZodRecord:return WF(F,Q);case U.ZodLiteral:return uF(F);case U.ZodEnum:return yF(F);case U.ZodNativeEnum:return cF(F);case U.ZodNullable:return oF(F,Q);case U.ZodOptional:return FJ(F,Q);case U.ZodMap:return lF(F,Q);case U.ZodSet:return WJ(F,Q);case U.ZodLazy:return()=>F.getter()._def;case U.ZodPromise:return QJ(F,Q);case U.ZodNaN:case U.ZodNever:return dF();case U.ZodEffects:return vF(F,Q);case U.ZodAny:return K();case U.ZodUnknown:return ZJ();case U.ZodDefault:return xF(F,Q);case U.ZodBranded:return FF(F,Q);case U.ZodReadonly:return $J(F,Q);case U.ZodCatch:return SF(F,Q);case U.ZodPipeline:return JJ(F,Q);case U.ZodFunction:case U.ZodVoid:case U.ZodSymbol:return;default:return((W)=>{return})(J)}},UJ=(F,J)=>{let Q=0;for(;Q<F.length&&Q<J.length;Q++)if(F[Q]!==J[Q])break;return[(F.length-Q).toString(),...J.slice(Q)].join("/")};function E(F,J,Q=!1){var W;let X=J.seen.get(F);if(J.override){let w=(W=J.override)==null?void 0:W.call(J,F,J,X,Q);if(w!==TF)return w}if(X&&!Q){let w=wJ(X,J);if(w!==void 0)return w}let Y={def:F,path:J.currentPath,jsonSchema:void 0};J.seen.set(F,Y);let Z=LJ(F,F.typeName,J),$=typeof Z==="function"?E(Z(),J):Z;if($)EJ(F,J,$);if(J.postProcess){let w=J.postProcess($,F,J);return Y.jsonSchema=$,w}return Y.jsonSchema=$,$}var wJ=(F,J)=>{switch(J.$refStrategy){case"root":return{$ref:F.path.join("/")};case"relative":return{$ref:UJ(J.currentPath,F.path)};case"none":case"seen":{if(F.path.length<J.currentPath.length&&F.path.every((Q,W)=>J.currentPath[W]===Q))return console.warn(`Recursive reference detected at ${J.currentPath.join("/")}! Defaulting to any`),K();return J.$refStrategy==="seen"?K():void 0}}},EJ=(F,J,Q)=>{if(F.description)Q.description=F.description;return Q},GJ=(F)=>{let J=_F(F),Q=J.name!==void 0?[...J.basePath,J.definitionPath,J.name]:J.basePath;return{...J,currentPath:Q,propertyPath:void 0,seen:new Map(Object.entries(J.definitions).map(([W,X])=>[X._def,{def:X._def,path:[...J.basePath,J.definitionPath,W],jsonSchema:void 0}]))}},CJ=(F,J)=>{var Q;let W=GJ(J),X=typeof J==="object"&&J.definitions?Object.entries(J.definitions).reduce((L,[G,R])=>{var h;return{...L,[G]:(h=E(R._def,{...W,currentPath:[...W.basePath,W.definitionPath,G]},!0))!=null?h:K()}},{}):void 0,Y=typeof J==="string"?J:(J==null?void 0:J.nameStrategy)==="title"?void 0:J==null?void 0:J.name,Z=(Q=E(F._def,Y===void 0?W:{...W,currentPath:[...W.basePath,W.definitionPath,Y]},!1))!=null?Q:K(),$=typeof J==="object"&&J.name!==void 0&&J.nameStrategy==="title"?J.name:void 0;if($!==void 0)Z.title=$;let w=Y===void 0?X?{...Z,[W.definitionPath]:X}:Z:{$ref:[...W.$refStrategy==="relative"?[]:W.basePath,W.definitionPath,Y].join("/"),[W.definitionPath]:{...X,[Y]:Z}};return w.$schema="http://json-schema.org/draft-07/schema#",w},g=Symbol.for("vercel.ai.schema");function aJ(F){let J;return()=>{if(J==null)J=F();return J}}function V(F,{validate:J}={}){return{[g]:!0,_type:void 0,get jsonSchema(){if(typeof F==="function")F=F();return F},validate:J}}function MJ(F){return typeof F==="object"&&F!==null&&g in F&&F[g]===!0&&"jsonSchema"in F&&"validate"in F}function KJ(F){return F==null?V({properties:{},additionalProperties:!1}):MJ(F)?F:("~standard"in F)?F["~standard"].vendor==="zod"?PJ(F):qJ(F):F()}function qJ(F){return V(()=>v(F["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async(J)=>{let Q=await F["~standard"].validate(J);return"value"in Q?{success:!0,value:Q.value}:{success:!1,error:new I({value:J,cause:Q.issues})}}})}function DJ(F,J){var Q;let W=(Q=J==null?void 0:J.useReferences)!=null?Q:!1;return V(()=>CJ(F,{$refStrategy:W?"root":"none"}),{validate:async(X)=>{let Y=await F.safeParseAsync(X);return Y.success?{success:!0,value:Y.data}:{success:!1,error:Y.error}}})}function OJ(F,J){var Q;let W=(Q=J==null?void 0:J.useReferences)!=null?Q:!1;return V(()=>v(d(F,{target:"draft-7",io:"input",reused:W?"ref":"inline"})),{validate:async(X)=>{let Y=await n(F,X);return Y.success?{success:!0,value:Y.data}:{success:!1,error:Y.error}}})}function IJ(F){return"_zod"in F}function PJ(F,J){if(IJ(F))return OJ(F,J);else return DJ(F,J)}async function zJ({value:F,schema:J,context:Q}){let W=await y({value:F,schema:J,context:Q});if(!W.success)throw I.wrap({value:F,cause:W.error,context:Q});return W.value}async function y({value:F,schema:J,context:Q}){let W=KJ(J);try{if(W.validate==null)return{success:!0,value:F,rawValue:F};let X=await W.validate(F);if(X.success)return{success:!0,value:X.value,rawValue:F};return{success:!1,error:I.wrap({value:F,cause:X.error,context:Q}),rawValue:F}}catch(X){return{success:!1,error:I.wrap({value:F,cause:X,context:Q}),rawValue:F}}}async function AJ({text:F,schema:J}){try{let Q=x(F);if(J==null)return Q;return zJ({value:Q,schema:J})}catch(Q){if(H.isInstance(Q)||I.isInstance(Q))throw Q;throw new H({text:F,cause:Q})}}async function XF({text:F,schema:J}){try{let Q=x(F);if(J==null)return{success:!0,value:Q,rawValue:Q};return await y({value:Q,schema:J})}catch(Q){return{success:!1,error:H.isInstance(Q)?Q:new H({text:F,cause:Q}),rawValue:void 0}}}function sJ(F){try{return x(F),!0}catch(J){return!1}}function HJ({stream:F,schema:J}){return F.pipeThrough(new TextDecoderStream).pipeThrough(new t).pipeThrough(new TransformStream({async transform({data:Q},W){if(Q==="[DONE]")return;W.enqueue(await XF({text:Q,schema:J}))}}))}async function FQ({provider:F,providerOptions:J,schema:Q}){if((J==null?void 0:J[F])==null)return;let W=await y({value:J[F],schema:Q});if(!W.success)throw new N({argument:"providerOptions",message:`invalid ${F} provider options`,cause:W.error});return W.value}var BJ=()=>globalThis.fetch,QQ=async({url:F,headers:J,body:Q,failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z})=>YF({url:F,headers:{"Content-Type":"application/json",...J},body:{content:JSON.stringify(Q),values:Q},failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z}),WQ=async({url:F,headers:J,formData:Q,failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z})=>YF({url:F,headers:J,body:{content:Q,values:Object.fromEntries(Q.entries())},failedResponseHandler:W,successfulResponseHandler:X,abortSignal:Y,fetch:Z}),YF=async({url:F,headers:J={},body:Q,successfulResponseHandler:W,failedResponseHandler:X,abortSignal:Y,fetch:Z=BJ()})=>{try{let $=await Z(F,{method:"POST",headers:IF(J,`ai-sdk/provider-utils/${PF}`,DF()),body:Q.content,signal:Y}),w=B($);if(!$.ok){let L;try{L=await X({response:$,url:F,requestBodyValues:Q.values})}catch(G){if(b(G)||M.isInstance(G))throw G;throw new M({message:"Failed to process error response",cause:G,statusCode:$.status,url:F,responseHeaders:w,requestBodyValues:Q.values})}throw L.value}try{return await W({response:$,url:F,requestBodyValues:Q.values})}catch(L){if(L instanceof Error){if(b(L)||M.isInstance(L))throw L}throw new M({message:"Failed to process successful response",cause:L,statusCode:$.status,url:F,responseHeaders:w,requestBodyValues:Q.values})}}catch($){throw qF({error:$,url:F,requestBodyValues:Q.values})}};function ZF(F){return F}function XQ({id:F,inputSchema:J}){return({execute:Q,outputSchema:W,needsApproval:X,toModelOutput:Y,onInputStart:Z,onInputDelta:$,onInputAvailable:w,...L})=>ZF({type:"provider",id:F,args:L,inputSchema:J,outputSchema:W,execute:Q,needsApproval:X,toModelOutput:Y,onInputStart:Z,onInputDelta:$,onInputAvailable:w})}function YQ({id:F,inputSchema:J,outputSchema:Q,supportsDeferredResults:W}){return({execute:X,needsApproval:Y,toModelOutput:Z,onInputStart:$,onInputDelta:w,onInputAvailable:L,...G})=>ZF({type:"provider",id:F,args:G,inputSchema:J,outputSchema:Q,execute:X,needsApproval:Y,toModelOutput:Z,onInputStart:$,onInputDelta:w,onInputAvailable:L,supportsDeferredResults:W})}var $Q=({errorSchema:F,errorToMessage:J,isRetryable:Q})=>async({response:W,url:X,requestBodyValues:Y})=>{let Z=await W.text(),$=B(W);if(Z.trim()==="")return{responseHeaders:$,value:new M({message:W.statusText,url:X,requestBodyValues:Y,statusCode:W.status,responseHeaders:$,responseBody:Z,isRetryable:Q==null?void 0:Q(W)})};try{let w=await AJ({text:Z,schema:F});return{responseHeaders:$,value:new M({message:J(w),url:X,requestBodyValues:Y,statusCode:W.status,responseHeaders:$,responseBody:Z,data:w,isRetryable:Q==null?void 0:Q(W,w)})}}catch(w){return{responseHeaders:$,value:new M({message:W.statusText,url:X,requestBodyValues:Y,statusCode:W.status,responseHeaders:$,responseBody:Z,isRetryable:Q==null?void 0:Q(W)})}}},LQ=(F)=>async({response:J})=>{let Q=B(J);if(J.body==null)throw new f({});return{responseHeaders:Q,value:HJ({stream:J.body,schema:F})}},UQ=(F)=>async({response:J,url:Q,requestBodyValues:W})=>{let X=await J.text(),Y=await XF({text:X,schema:F}),Z=B(J);if(!Y.success)throw new M({message:"Invalid JSON response",cause:Y.error,statusCode:J.status,responseHeaders:Z,responseBody:X,url:Q,requestBodyValues:W});return{responseHeaders:Z,value:Y.value,rawValue:Y.rawValue}},wQ=()=>async({response:F,url:J,requestBodyValues:Q})=>{let W=B(F);if(!F.body)throw new M({message:"Response body is empty",url:J,requestBodyValues:Q,statusCode:F.status,responseHeaders:W,responseBody:void 0});try{let X=await F.arrayBuffer();return{responseHeaders:W,value:new Uint8Array(X)}}catch(X){throw new M({message:"Failed to read response as array buffer",url:J,requestBodyValues:Q,statusCode:F.status,responseHeaders:W,responseBody:void 0,cause:X})}};function EQ(F){return F==null?void 0:F.replace(/\/$/,"")}
|
|
8
|
-
export{NJ as
|
|
8
|
+
export{NJ as Xe,VJ as Ye,TJ as Ze,o as _e,_J as $e,jJ as af,kJ as bf,SJ as cf,xJ as df,IF as ef,yJ as ff,hJ as gf,uJ as hf,pJ as if,lJ as jf,aJ as kf,PJ as lf,zJ as mf,AJ as nf,sJ as of,FQ as pf,QQ as qf,WQ as rf,XQ as sf,YQ as tf,$Q as uf,LQ as vf,UQ as wf,wQ as xf,EQ as yf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{mp as G$}from"./chunk-4bp91rza.js";import{pu as A$}from"./chunk-vg9ec44m.js";import{uu as k$}from"./chunk-e826jvr2.js";import{Dv as Y$,Ev as U$,Gv as CZ,Hv as KZ}from"./chunk-zg72kz2k.js";import{Tv as SZ}from"./chunk-kr7t73tg.js";import{AG as E,CC as L,CG as WZ,DC as eZ,DG as q$,DM as v,FC as ZZ,FM as B$,HC as oZ,MJ as P,NM as F$,PH as $Z,QH as LZ,RH as qZ,RI as xZ,SH as f,SI as Q$,SL as DZ,UD as gZ,UH as jZ,WH as D$,WL as C,XH as i,_H as J$,bI as o,cH as z$,cM as r,dD as kZ,dI as l,hD as rZ,hH as RZ,hI as h,hM as X$,iD as sZ,iI as K$,jC as a,kI as c,kJ as EZ,lI as vZ,mM as JZ,pM as fZ,qM as iZ,rK as YZ,sG as Z$,uK as V$,uM as PZ,vI as IZ,vM as lZ,xL as d,yI as zZ,yJ as p,zG as $$,zL as m,zM as cZ}from"./chunk-qvnsgyfk.js";import{_Q as u$,aR as BZ,cR as h$}from"./chunk-pfx8ts02.js";var pZ={};BZ(pZ,{makeHandle:()=>AZ,make:()=>GZ,ProcessId:()=>UZ,ExitCode:()=>FZ,ChildProcessSpawner:()=>W});var FZ=YZ(),UZ=YZ(),hZ="~effect/ChildProcessSpawner/ChildProcessHandle",j$={[hZ]:hZ,...kZ,toJSON(){return{_id:"ChildProcessHandle",pid:this.pid}}},AZ=(Z)=>Object.assign(Object.create(j$),Z),GZ=(Z)=>{let q=(B,Q)=>Z(B).pipe(h((U)=>fZ(Q?.includeStderr===!0?U.all:U.stdout)),r),z=(B,Q)=>iZ(q(B,Q));return W.of({spawn:Z,exitCode:(B)=>xZ(o(Z(B),(Q)=>Q.exitCode)),streamString:q,streamLines:z,lines:(B,Q)=>lZ(z(B,Q)),string:(B,Q)=>cZ(q(B,Q))})};class W extends gZ()("effect/process/ChildProcessSpawner"){}var x={};BZ(x,{setEnv:()=>HZ,setCwd:()=>yZ,prefix:()=>C$,pipeTo:()=>P$,parseFdName:()=>g,make:()=>k,isStandardCommand:()=>I$,isPipedCommand:()=>E$,isCommand:()=>s,fdName:()=>NZ});var MZ="~effect/unstable/process/ChildProcess",aZ={...rZ,...sZ,[MZ]:MZ,asEffect(){return W.use((Z)=>Z.spawn(this))}},s=(Z)=>oZ(Z,MZ),I$=(Z)=>Z._tag==="StandardCommand",E$=(Z)=>Z._tag==="PipedCommand",I=(Z,q,z)=>Object.assign(Object.create(aZ),{_tag:"StandardCommand",command:Z,args:q,options:z}),e=(Z,q,z={})=>Object.assign(Object.create(aZ),{_tag:"PipedCommand",left:Z,right:q,options:z}),k=function(...q){if(OZ(q[0])){let[U,...A]=q,G=bZ(U,A);return I(G[0]??"",G.slice(1),{})}if(typeof q[0]==="object"&&!Array.isArray(q[0])&&!OZ(q[0])){let U=q[0];return function(A,...G){let b=bZ(A,G);return I(b[0]??"",b.slice(1),U)}}if(typeof q[0]==="string"&&!Array.isArray(q[1])){let[U,A={}]=q;return I(U,[],A)}let[z,B=[],Q={}]=q;return I(z,B,Q)},P$=a((Z)=>s(Z[0])&&s(Z[1]),(Z,q,z)=>e(Z,q,z??{})),C$=function(...q){if(s(q[0])&&q.length>1){let[B,...Q]=q,U=dZ(Q);return _Z(B,U)}let z=dZ(q);return(B)=>_Z(B,z)},dZ=(Z)=>{if(OZ(Z[0])){let[B,...Q]=Z,U=bZ(B,Q);return{command:U[0]??"",args:U.slice(1)}}let[q,z=[]]=Z;return{command:q,args:z}},_Z=(Z,q)=>{switch(Z._tag){case"StandardCommand":return I(q.command,[...q.args,Z.command,...Z.args],Z.options);case"PipedCommand":return e(_Z(Z.left,q),Z.right,Z.options)}},yZ=a(2,(Z,q)=>{switch(Z._tag){case"StandardCommand":return I(Z.command,Z.args,{...Z.options,cwd:q});case"PipedCommand":return e(yZ(Z.left,q),yZ(Z.right,q),Z.options)}}),HZ=a(2,(Z,q)=>{switch(Z._tag){case"StandardCommand":{let z=Z.options.env===void 0?q:{...Z.options.env,...q};return I(Z.command,Z.args,{...Z.options,env:z})}case"PipedCommand":return e(HZ(Z.left,q),HZ(Z.right,q),Z.options)}}),OZ=(Z)=>Array.isArray(Z)&&("raw"in Z)&&Array.isArray(Z.raw),g=(Z)=>{let q=/^fd(\d+)$/.exec(Z);if(q===null)return;let z=parseInt(q[1],10);return z>=3?z:void 0},NZ=(Z)=>`fd${Z}`,bZ=(Z,q)=>{let z=[];for(let[B,Q]of Z.entries())z=S$(Z,q,z,Q,B);return z},S$=(Z,q,z,B,Q)=>{let U=Z.raw[Q];if(U===void 0)throw Error(`Invalid backslash sequence: ${Z.raw[Q]}`);let{hasLeadingWhitespace:A,hasTrailingWhitespace:G,tokens:b}=w$(B,U),N=nZ(z,b,A);if(Q===q.length)return N;let S=q[Q],QZ=Array.isArray(S)?S.map((VZ)=>mZ(VZ)):[mZ(S)];return nZ(N,QZ,G)},mZ=(Z)=>{if(typeof Z==="string")return Z;return String(Z)},tZ=new Set([" ","\t","\r",`
|
|
3
3
|
`]),T$={x:3,u:5},w$=(Z,q)=>{if(q.length===0)return{tokens:[],hasLeadingWhitespace:!1,hasTrailingWhitespace:!1};let z=tZ.has(q[0]),B=[],Q=0;for(let A=0,G=0;A<Z.length;A+=1,G+=1){let b=q[G];if(tZ.has(b)){if(Q!==A)B.push(Z.slice(Q,A));Q=A+1}else if(b==="\\"){let N=q[G+1];if(N===`
|
|
4
|
-
`)A-=1,G+=1;else if(N==="u"&&q[G+2]==="{")G=q.indexOf("}",G+3);else G+=T$[N]??1}}let U=Q===Z.length;if(!U)B.push(Z.slice(Q));return{tokens:B,hasLeadingWhitespace:z,hasTrailingWhitespace:U}},nZ=(Z,q,z)=>z||Z.length===0||q.length===0?[...Z,...q]:[...Z.slice(0,-1),`${Z.at(-1)}${q.at(0)}`,...q.slice(1)];var _$=u$(k$(),1);import*as M$ from"child_process";import{PassThrough as g$}from"stream";var R=(Z)=>Z instanceof globalThis.Error?Z:new globalThis.Error(String(Z)),x$=(Z)=>{switch(Z.code){case"ENOENT":return"NotFound";case"EACCES":return"PermissionDenied";case"EEXIST":return"AlreadyExists";case"EISDIR":return"BadResource";case"ENOTDIR":return"BadResource";case"EBUSY":return"Busy";case"ELOOP":return"BadResource";default:return"Unknown"}},y$=(Z)=>{let q=[],z=[],B=(A)=>{switch(A._tag){case"StandardCommand":q.push(A);return;case"PipedCommand":B(A.left),z.push(A.options),B(A.right);return}};if(B(Z),q.length===0)throw Error("flatten produced empty commands array");let[Q,...U]=q;return{commands:[Q,...U],opts:z}},O=(Z,q,z)=>{let B=y$(z).commands.map((Q)=>`${Q.command} ${Q.args.join(" ")}`).join(" | ");return V$({_tag:x$(q),module:"ChildProcess",method:Z,pathOrDescriptor:B,syscall:q.syscall,cause:q})},f$=D$(function*(){let Z=yield*B$,q=yield*F$,z=p(function*($){if(L($.cwd))return;return yield*Z.access($.cwd),q.resolve($.cwd)}),B=($)=>$.extendEnv?{...A$(),...$.env}:$.env,Q=($)=>DZ($)?"pipe":$,U=($)=>d($)?"pipe":$,A=($)=>{let D={stream:"pipe",encoding:"utf-8",endOnDone:!0};if(L($.stdin))return D;if(typeof $.stdin==="string")return{...D,stream:$.stdin};if(DZ($.stdin))return{...D,stream:$.stdin};return{stream:$.stdin.stream,encoding:$.stdin.encoding??D.encoding,endOnDone:$.stdin.endOnDone??D.endOnDone}},G=($,D)=>{let J=$[D];if(L(J))return{stream:"pipe"};if(typeof J==="string")return{stream:J};if(d(J))return{stream:J};return{stream:J.stream}},b=($)=>{if(L($.additionalFds))return[];return Object.entries($.additionalFds).flatMap(([D,J])=>{let K=g(D);return L(K)?[]:[{fd:K,config:J}]}).toSorted((D,J)=>D.fd-J.fd)},N=($,D,J,K)=>{let X=(F)=>process.platform==="win32"&&F==="pipe"?"overlapped":F,Y=[X(Q($.stream)),X(U(D.stream)),X(U(J.stream))];if(K.length===0)return Y;let V=K.reduce((F,_)=>Math.max(F,_.fd),2);for(let F=3;F<=V;F++)Y[F]="ignore";for(let F of K)Y[F.fd]=X("pipe");return Y},S=p(function*($,D,J){if(J.length===0)return{getInputFd:()=>m,getOutputFd:()=>C};let K=new Map,X=new Map;for(let Y of J){let V=D.stdio[Y.fd];switch(Y.config.type){case"input":{let F=m;if(V&&"write"in V)F=CZ.fromWritable({evaluate:()=>V,onError:(_)=>O(`fromWritable(fd${Y.fd})`,R(_),$),endOnDone:!0});if(Y.config.stream)yield*EZ(PZ(Y.config.stream,F));K.set(Y.fd,F);break}case"output":{let F=C;if(V&&"read"in V){let _=new g$;V.on("error",(y)=>_.destroy(R(y))),V.pipe(_),F=KZ.fromReadable({evaluate:()=>_,onError:(y)=>O(`fromReadable(fd${Y.fd})`,R(y),$)})}if(Y.config.sink)F=JZ(F,Y.config.sink);X.set(Y.fd,F);break}}}return{getInputFd:(Y)=>K.get(Y)??m,getOutputFd:(Y)=>X.get(Y)??C}}),QZ=($,D,J)=>LZ(()=>{let K=m;if(ZZ(D.stdin))K=CZ.fromWritable({evaluate:()=>D.stdin,onError:(X)=>O("fromWritable(stdin)",R(X),$),endOnDone:J.endOnDone,encoding:J.encoding});if(DZ(J.stream))return K$(EZ(PZ(J.stream,K)),K);return $Z(K)}),VZ=($,D,J,K)=>{let X=D.stdout?KZ.fromReadable({evaluate:()=>D.stdout,onError:(V)=>O("fromReadable(stdout)",R(V),$)}):C,Y=D.stderr?KZ.fromReadable({evaluate:()=>D.stderr,onError:(V)=>O("fromReadable(stderr)",R(V),$)}):C;if(d(J.stream))X=JZ(X,J.stream);if(d(K.stream))Y=JZ(Y,K.stream);return{stdout:X,stderr:Y,all:X$(X,Y)}},b$=($,D)=>jZ((J)=>{let K=$$(),X=_$.default($.command,$.args,D),Y=!1,V;return X.on("error",(F)=>{J(i(O("spawn",F,$)))}),X.on("exit",(...F)=>{V=F}),X.on("close",(...F)=>{if(Y)return;Y=!0,q$(K,Z$(V??F))}),X.on("spawn",()=>{J($Z([X,K]))}),qZ(()=>{X.kill("SIGTERM")})}),XZ=($,D,J)=>{if(globalThis.process.platform==="win32")return jZ((K)=>{M$.exec(`taskkill /pid ${D.pid} /T /F`,{windowsHide:!0},(X)=>{if(X)return K(i(O("kill",R(X),$)));K(f)})});return J$({try:()=>{globalThis.process.kill(-D.pid,J)},catch:(K)=>O("kill",R(K),$)})},wZ=($,D,J)=>LZ(()=>{if(D.kill(J))return f;return i(O("kill",Error("Failed to kill child process"),$))}),N$=($,D,J)=>(K)=>{let X=J?.killSignal??"SIGTERM";if(L(J?.forceKillAfter))return K(D,$,X);return zZ(K(D,$,X),{duration:J.forceKillAfter,orElse:()=>K(D,$,"SIGKILL")})},W$=($,D)=>{let J=D??"stdout";switch(J){case"stdout":return $.stdout;case"stderr":return $.stderr;case"all":return $.all;default:{let K=g(J);return eZ(K)?$.getOutputFd(K):$.stdout}}},T=p(function*($){switch($._tag){case"StandardCommand":{let D=A($.options),J=G($.options,"stdout"),K=G($.options,"stderr"),X=b($.options),Y=yield*z($.options),[V,F]=yield*Q$(b$($,{cwd:Y,env:B($.options),stdio:N(D,J,K,X),detached:$.options.detached??process.platform!=="win32",shell:$.options.shell,windowsHide:process.platform==="win32"}),p(function*([M,H]){let t=yield*WZ(H),n=N$(M,$,$.options);if(t){let[u]=yield*E(H);if(process.platform==="win32")return yield*f;if(u!==0&&ZZ(u))return yield*IZ(n(XZ));return yield*f}let w=(u)=>vZ(XZ($,M,u),()=>wZ($,M,u)),R$=$.options.killSignal??"SIGTERM",uZ=w(R$).pipe(l(E(H)),c),L$=$.options.forceKillAfter?zZ(uZ,{duration:$.options.forceKillAfter,orElse:()=>w("SIGKILL").pipe(l(E(H)),c)}):uZ;return yield*IZ(L$)})),_=yield*S($,V,X),y=VZ($,V,J,K),j=!0;return AZ({pid:UZ(V.pid),stdin:yield*QZ($,V,D),stdout:y.stdout,stderr:y.stderr,all:y.all,getInputFd:_.getInputFd,getOutputFd:_.getOutputFd,isRunning:h(WZ(F),(M)=>!M),exitCode:o(E(F),([M,H])=>{if(ZZ(M))return $Z(FZ(M));return i(O("exitCode",Error(`Process interrupted due to receipt of signal: '${H}'`),$))}),kill:(M)=>{let H=M?.killSignal??"SIGTERM",t=(w)=>vZ(XZ($,V,w),()=>wZ($,V,w)),n=t(H).pipe(l(E(F)),c);if(!M?.forceKillAfter)return n;return zZ(n,{duration:M.forceKillAfter,orElse:()=>t("SIGKILL").pipe(l(E(F)),c)})},unref:qZ(()=>{if(j)V.unref(),j=!1;return qZ(()=>{if(!j)V.ref(),j=!0})})})}case"PipedCommand":{let D=y$($),[J,...K]=D.commands,X=T(J);for(let Y=0;Y<K.length;Y++){let V=K[Y],F=D.opts[Y]??{},_=A(V.options),y=r(h(X,(H)=>W$(H,F.from))),j=F.to??"stdin";if(j==="stdin"){X=T(k(V.command,V.args,{...V.options,stdin:{..._,stream:y}}));continue}let M=g(j);if(L(M)){X=T(k(V.command,V.args,{...V.options,stdin:{..._,stream:y}}));continue}X=T(k(V.command,V.args,{...V.options,additionalFds:{...V.options.additionalFds,[NZ(M)]:{type:"input",stream:y}}}))}return yield*X}}});return GZ(T)}),i$=z$(W,f$),l$=i$.pipe(RZ(Y$.layer),RZ(U$)),Bq=G$(async()=>{let{makeRuntime:Z}=await import("./chunk-
|
|
5
|
-
export{W as
|
|
4
|
+
`)A-=1,G+=1;else if(N==="u"&&q[G+2]==="{")G=q.indexOf("}",G+3);else G+=T$[N]??1}}let U=Q===Z.length;if(!U)B.push(Z.slice(Q));return{tokens:B,hasLeadingWhitespace:z,hasTrailingWhitespace:U}},nZ=(Z,q,z)=>z||Z.length===0||q.length===0?[...Z,...q]:[...Z.slice(0,-1),`${Z.at(-1)}${q.at(0)}`,...q.slice(1)];var _$=u$(k$(),1);import*as M$ from"child_process";import{PassThrough as g$}from"stream";var R=(Z)=>Z instanceof globalThis.Error?Z:new globalThis.Error(String(Z)),x$=(Z)=>{switch(Z.code){case"ENOENT":return"NotFound";case"EACCES":return"PermissionDenied";case"EEXIST":return"AlreadyExists";case"EISDIR":return"BadResource";case"ENOTDIR":return"BadResource";case"EBUSY":return"Busy";case"ELOOP":return"BadResource";default:return"Unknown"}},y$=(Z)=>{let q=[],z=[],B=(A)=>{switch(A._tag){case"StandardCommand":q.push(A);return;case"PipedCommand":B(A.left),z.push(A.options),B(A.right);return}};if(B(Z),q.length===0)throw Error("flatten produced empty commands array");let[Q,...U]=q;return{commands:[Q,...U],opts:z}},O=(Z,q,z)=>{let B=y$(z).commands.map((Q)=>`${Q.command} ${Q.args.join(" ")}`).join(" | ");return V$({_tag:x$(q),module:"ChildProcess",method:Z,pathOrDescriptor:B,syscall:q.syscall,cause:q})},f$=D$(function*(){let Z=yield*B$,q=yield*F$,z=p(function*($){if(L($.cwd))return;return yield*Z.access($.cwd),q.resolve($.cwd)}),B=($)=>$.extendEnv?{...A$(),...$.env}:$.env,Q=($)=>DZ($)?"pipe":$,U=($)=>d($)?"pipe":$,A=($)=>{let D={stream:"pipe",encoding:"utf-8",endOnDone:!0};if(L($.stdin))return D;if(typeof $.stdin==="string")return{...D,stream:$.stdin};if(DZ($.stdin))return{...D,stream:$.stdin};return{stream:$.stdin.stream,encoding:$.stdin.encoding??D.encoding,endOnDone:$.stdin.endOnDone??D.endOnDone}},G=($,D)=>{let J=$[D];if(L(J))return{stream:"pipe"};if(typeof J==="string")return{stream:J};if(d(J))return{stream:J};return{stream:J.stream}},b=($)=>{if(L($.additionalFds))return[];return Object.entries($.additionalFds).flatMap(([D,J])=>{let K=g(D);return L(K)?[]:[{fd:K,config:J}]}).toSorted((D,J)=>D.fd-J.fd)},N=($,D,J,K)=>{let X=(F)=>process.platform==="win32"&&F==="pipe"?"overlapped":F,Y=[X(Q($.stream)),X(U(D.stream)),X(U(J.stream))];if(K.length===0)return Y;let V=K.reduce((F,_)=>Math.max(F,_.fd),2);for(let F=3;F<=V;F++)Y[F]="ignore";for(let F of K)Y[F.fd]=X("pipe");return Y},S=p(function*($,D,J){if(J.length===0)return{getInputFd:()=>m,getOutputFd:()=>C};let K=new Map,X=new Map;for(let Y of J){let V=D.stdio[Y.fd];switch(Y.config.type){case"input":{let F=m;if(V&&"write"in V)F=CZ.fromWritable({evaluate:()=>V,onError:(_)=>O(`fromWritable(fd${Y.fd})`,R(_),$),endOnDone:!0});if(Y.config.stream)yield*EZ(PZ(Y.config.stream,F));K.set(Y.fd,F);break}case"output":{let F=C;if(V&&"read"in V){let _=new g$;V.on("error",(y)=>_.destroy(R(y))),V.pipe(_),F=KZ.fromReadable({evaluate:()=>_,onError:(y)=>O(`fromReadable(fd${Y.fd})`,R(y),$)})}if(Y.config.sink)F=JZ(F,Y.config.sink);X.set(Y.fd,F);break}}}return{getInputFd:(Y)=>K.get(Y)??m,getOutputFd:(Y)=>X.get(Y)??C}}),QZ=($,D,J)=>LZ(()=>{let K=m;if(ZZ(D.stdin))K=CZ.fromWritable({evaluate:()=>D.stdin,onError:(X)=>O("fromWritable(stdin)",R(X),$),endOnDone:J.endOnDone,encoding:J.encoding});if(DZ(J.stream))return K$(EZ(PZ(J.stream,K)),K);return $Z(K)}),VZ=($,D,J,K)=>{let X=D.stdout?KZ.fromReadable({evaluate:()=>D.stdout,onError:(V)=>O("fromReadable(stdout)",R(V),$)}):C,Y=D.stderr?KZ.fromReadable({evaluate:()=>D.stderr,onError:(V)=>O("fromReadable(stderr)",R(V),$)}):C;if(d(J.stream))X=JZ(X,J.stream);if(d(K.stream))Y=JZ(Y,K.stream);return{stdout:X,stderr:Y,all:X$(X,Y)}},b$=($,D)=>jZ((J)=>{let K=$$(),X=_$.default($.command,$.args,D),Y=!1,V;return X.on("error",(F)=>{J(i(O("spawn",F,$)))}),X.on("exit",(...F)=>{V=F}),X.on("close",(...F)=>{if(Y)return;Y=!0,q$(K,Z$(V??F))}),X.on("spawn",()=>{J($Z([X,K]))}),qZ(()=>{X.kill("SIGTERM")})}),XZ=($,D,J)=>{if(globalThis.process.platform==="win32")return jZ((K)=>{M$.exec(`taskkill /pid ${D.pid} /T /F`,{windowsHide:!0},(X)=>{if(X)return K(i(O("kill",R(X),$)));K(f)})});return J$({try:()=>{globalThis.process.kill(-D.pid,J)},catch:(K)=>O("kill",R(K),$)})},wZ=($,D,J)=>LZ(()=>{if(D.kill(J))return f;return i(O("kill",Error("Failed to kill child process"),$))}),N$=($,D,J)=>(K)=>{let X=J?.killSignal??"SIGTERM";if(L(J?.forceKillAfter))return K(D,$,X);return zZ(K(D,$,X),{duration:J.forceKillAfter,orElse:()=>K(D,$,"SIGKILL")})},W$=($,D)=>{let J=D??"stdout";switch(J){case"stdout":return $.stdout;case"stderr":return $.stderr;case"all":return $.all;default:{let K=g(J);return eZ(K)?$.getOutputFd(K):$.stdout}}},T=p(function*($){switch($._tag){case"StandardCommand":{let D=A($.options),J=G($.options,"stdout"),K=G($.options,"stderr"),X=b($.options),Y=yield*z($.options),[V,F]=yield*Q$(b$($,{cwd:Y,env:B($.options),stdio:N(D,J,K,X),detached:$.options.detached??process.platform!=="win32",shell:$.options.shell,windowsHide:process.platform==="win32"}),p(function*([M,H]){let t=yield*WZ(H),n=N$(M,$,$.options);if(t){let[u]=yield*E(H);if(process.platform==="win32")return yield*f;if(u!==0&&ZZ(u))return yield*IZ(n(XZ));return yield*f}let w=(u)=>vZ(XZ($,M,u),()=>wZ($,M,u)),R$=$.options.killSignal??"SIGTERM",uZ=w(R$).pipe(l(E(H)),c),L$=$.options.forceKillAfter?zZ(uZ,{duration:$.options.forceKillAfter,orElse:()=>w("SIGKILL").pipe(l(E(H)),c)}):uZ;return yield*IZ(L$)})),_=yield*S($,V,X),y=VZ($,V,J,K),j=!0;return AZ({pid:UZ(V.pid),stdin:yield*QZ($,V,D),stdout:y.stdout,stderr:y.stderr,all:y.all,getInputFd:_.getInputFd,getOutputFd:_.getOutputFd,isRunning:h(WZ(F),(M)=>!M),exitCode:o(E(F),([M,H])=>{if(ZZ(M))return $Z(FZ(M));return i(O("exitCode",Error(`Process interrupted due to receipt of signal: '${H}'`),$))}),kill:(M)=>{let H=M?.killSignal??"SIGTERM",t=(w)=>vZ(XZ($,V,w),()=>wZ($,V,w)),n=t(H).pipe(l(E(F)),c);if(!M?.forceKillAfter)return n;return zZ(n,{duration:M.forceKillAfter,orElse:()=>t("SIGKILL").pipe(l(E(F)),c)})},unref:qZ(()=>{if(j)V.unref(),j=!1;return qZ(()=>{if(!j)V.ref(),j=!0})})})}case"PipedCommand":{let D=y$($),[J,...K]=D.commands,X=T(J);for(let Y=0;Y<K.length;Y++){let V=K[Y],F=D.opts[Y]??{},_=A(V.options),y=r(h(X,(H)=>W$(H,F.from))),j=F.to??"stdin";if(j==="stdin"){X=T(k(V.command,V.args,{...V.options,stdin:{..._,stream:y}}));continue}let M=g(j);if(L(M)){X=T(k(V.command,V.args,{...V.options,stdin:{..._,stream:y}}));continue}X=T(k(V.command,V.args,{...V.options,additionalFds:{...V.options.additionalFds,[NZ(M)]:{type:"input",stream:y}}}))}return yield*X}}});return GZ(T)}),i$=z$(W,f$),l$=i$.pipe(RZ(Y$.layer),RZ(U$)),Bq=G$(async()=>{let{makeRuntime:Z}=await import("./chunk-swm990q6.js");return Z(W,l$)});var H$=(Z,q)=>P.gen(function*(){let z=yield*Z.spawn(q),[B,Q]=yield*P.all([v.mkString(v.decodeText(z.stdout)),v.mkString(v.decodeText(z.stderr))],{concurrency:2});return{code:yield*z.exitCode,text:B,stderr:Q}}).pipe(P.scoped),Mq=H$,_q=(Z,q,z)=>H$(Z,x.make("git",q,{cwd:z?.cwd,extendEnv:!0,stdin:"ignore"}));var TZ={};BZ(TZ,{payloads:()=>p$,define:()=>c$,BusEvent:()=>TZ});var O$=new Map;function c$(Z,q){let z={type:Z,properties:q};return O$.set(Z,z),z}function p$(){return O$.entries().map(([Z,q])=>{return SZ.object({type:SZ.literal(Z),properties:q.properties}).meta({ref:`Event.${q.type}`})}).toArray()}
|
|
5
|
+
export{W as Sl,pZ as Tl,x as Ul,l$ as Vl,H$ as Wl,Mq as Xl,_q as Yl,TZ as Zl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bl as s,Cl as t,Dl as u,Fl as v,Gl as w}from"./chunk-52n4tdeh.js";import"./chunk-ft4msj4z.js";import{En as q,Fn as r,Gm as a,gn as b,hn as c,in as d,jn as e,kn as f,ln as g,mn as h,nn as i,on as j,pn as k,rn as l,sn as m,tn as n,vn as o,xn as p}from"./chunk-m8djypsy.js";import"./chunk-wf18y499.js";import"./chunk-4bp91rza.js";import"./chunk-6vxddv5w.js";import"./chunk-52f62kr0.js";import"./chunk-svnhycdw.js";import"./chunk-9skj2w9e.js";import"./chunk-m5r6zq6v.js";import"./chunk-vg9ec44m.js";import"./chunk-e826jvr2.js";import"./chunk-afagt413.js";import"./chunk-76jbys6j.js";import"./chunk-dm7hfb7f.js";import"./chunk-s5taq9jy.js";import"./chunk-62mb6wxm.js";import"./chunk-zg72kz2k.js";import"./chunk-kr7t73tg.js";import"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-sprbs7aj.js";import"./chunk-qvnsgyfk.js";import"./chunk-pfx8ts02.js";export{a as sql,e as or,f as not,c as ne,j as lte,i as lt,p as like,l as isNull,m as isNotNull,k as inArray,h as gte,g as gt,n as exists,b as eq,r as desc,t as count,o as between,q as asc,d as and,w as Storage,v as NotFoundError,s as JsonMigration,u as Database};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{vP as e,yP as d}from"./chunk-sh03ka27.js";var jq=e((j)=>{var E=j&&j.__importDefault||function(q){return q&&q.__esModule?q:{default:q}};Object.defineProperty(j,"__esModule",{value:!0});j.Minipass=j.isWritable=j.isReadable=j.isStream=void 0;var T=typeof process==="object"&&process?process:{stdout:null,stderr:null},O=d("events"),s=E(d("stream")),qq=d("string_decoder"),zq=(q)=>!!q&&typeof q==="object"&&(q instanceof r||q instanceof s.default||(0,j.isReadable)(q)||(0,j.isWritable)(q));j.isStream=zq;var Qq=(q)=>!!q&&typeof q==="object"&&q instanceof O.EventEmitter&&typeof q.pipe==="function"&&q.pipe!==s.default.Writable.prototype.pipe;j.isReadable=Qq;var Xq=(q)=>!!q&&typeof q==="object"&&q instanceof O.EventEmitter&&typeof q.write==="function"&&typeof q.end==="function";j.isWritable=Xq;var f=Symbol("EOF"),l=Symbol("maybeEmitEnd"),H=Symbol("emittedEnd"),M=Symbol("emittingEnd"),_=Symbol("emittedError"),i=Symbol("closed"),c=Symbol("read"),v=Symbol("flush"),t=Symbol("flushChunk"),x=Symbol("encoding"),Y=Symbol("decoder"),Z=Symbol("flowing"),G=Symbol("paused"),P=Symbol("resume"),$=Symbol("buffer"),y=Symbol("pipes"),V=Symbol("bufferLength"),u=Symbol("bufferPush"),A=Symbol("bufferShift"),w=Symbol("objectMode"),X=Symbol("destroyed"),p=Symbol("error"),S=Symbol("emitData"),o=Symbol("emitEnd"),I=Symbol("emitEnd2"),W=Symbol("async"),N=Symbol("abort"),a=Symbol("aborted"),L=Symbol("signal"),g=Symbol("dataListeners"),m=Symbol("discarded"),C=(q)=>Promise.resolve().then(q),Zq=(q)=>q(),$q=(q)=>q==="end"||q==="finish"||q==="prefinish",Vq=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,Kq=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class F{src;dest;opts;ondrain;constructor(q,z,Q){this.src=q,this.dest=z,this.opts=Q,this.ondrain=()=>q[P](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class D extends F{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,z,Q){super(q,z,Q);this.proxyErrors=(K)=>this.dest.emit("error",K),q.on("error",this.proxyErrors)}}var wq=(q)=>!!q.objectMode,yq=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class r extends O.EventEmitter{[Z]=!1;[G]=!1;[y]=[];[$]=[];[w];[x];[W];[Y];[f]=!1;[H]=!1;[M]=!1;[i]=!1;[_]=null;[V]=0;[X]=!1;[L];[a]=!1;[g]=0;[m]=!1;writable=!0;readable=!0;constructor(...q){let z=q[0]||{};super();if(z.objectMode&&typeof z.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(wq(z))this[w]=!0,this[x]=null;else if(yq(z))this[x]=z.encoding,this[w]=!1;else this[w]=!1,this[x]=null;if(this[W]=!!z.async,this[Y]=this[x]?new qq.StringDecoder(this[x]):null,z&&z.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[$]});if(z&&z.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[y]});let{signal:Q}=z;if(Q)if(this[L]=Q,Q.aborted)this[N]();else Q.addEventListener("abort",()=>this[N]())}get bufferLength(){return this[V]}get encoding(){return this[x]}set encoding(q){throw Error("Encoding must be set at instantiation time")}setEncoding(q){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[w]}set objectMode(q){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[W]}set["async"](q){this[W]=this[W]||!!q}[N](){this[a]=!0,this.emit("abort",this[L]?.reason),this.destroy(this[L]?.reason)}get aborted(){return this[a]}set aborted(q){}write(q,z,Q){if(this[a])return!1;if(this[f])throw Error("write after end");if(this[X])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof z==="function")Q=z,z="utf8";if(!z)z="utf8";let K=this[W]?C:Zq;if(!this[w]&&!Buffer.isBuffer(q)){if(Kq(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(Vq(q))q=Buffer.from(q);else if(typeof q!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[w]){if(this[Z]&&this[V]!==0)this[v](!0);if(this[Z])this.emit("data",q);else this[u](q);if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}if(!q.length){if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}if(typeof q==="string"&&!(z===this[x]&&!this[Y]?.lastNeed))q=Buffer.from(q,z);if(Buffer.isBuffer(q)&&this[x])q=this[Y].write(q);if(this[Z]&&this[V]!==0)this[v](!0);if(this[Z])this.emit("data",q);else this[u](q);if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}read(q){if(this[X])return null;if(this[m]=!1,this[V]===0||q===0||q&&q>this[V])return this[l](),null;if(this[w])q=null;if(this[$].length>1&&!this[w])this[$]=[this[x]?this[$].join(""):Buffer.concat(this[$],this[V])];let z=this[c](q||null,this[$][0]);return this[l](),z}[c](q,z){if(this[w])this[A]();else{let Q=z;if(q===Q.length||q===null)this[A]();else if(typeof Q==="string")this[$][0]=Q.slice(q),z=Q.slice(0,q),this[V]-=q;else this[$][0]=Q.subarray(q),z=Q.subarray(0,q),this[V]-=q}if(this.emit("data",z),!this[$].length&&!this[f])this.emit("drain");return z}end(q,z,Q){if(typeof q==="function")Q=q,q=void 0;if(typeof z==="function")Q=z,z="utf8";if(q!==void 0)this.write(q,z);if(Q)this.once("end",Q);if(this[f]=!0,this.writable=!1,this[Z]||!this[G])this[l]();return this}[P](){if(this[X])return;if(!this[g]&&!this[y].length)this[m]=!0;if(this[G]=!1,this[Z]=!0,this.emit("resume"),this[$].length)this[v]();else if(this[f])this[l]();else this.emit("drain")}resume(){return this[P]()}pause(){this[Z]=!1,this[G]=!0,this[m]=!1}get destroyed(){return this[X]}get flowing(){return this[Z]}get paused(){return this[G]}[u](q){if(this[w])this[V]+=1;else this[V]+=q.length;this[$].push(q)}[A](){if(this[w])this[V]-=1;else this[V]-=this[$][0].length;return this[$].shift()}[v](q=!1){do;while(this[t](this[A]())&&this[$].length);if(!q&&!this[$].length&&!this[f])this.emit("drain")}[t](q){return this.emit("data",q),this[Z]}pipe(q,z){if(this[X])return q;this[m]=!1;let Q=this[H];if(z=z||{},q===T.stdout||q===T.stderr)z.end=!1;else z.end=z.end!==!1;if(z.proxyErrors=!!z.proxyErrors,Q){if(z.end)q.end()}else if(this[y].push(!z.proxyErrors?new F(this,q,z):new D(this,q,z)),this[W])C(()=>this[P]());else this[P]();return q}unpipe(q){let z=this[y].find((Q)=>Q.dest===q);if(z){if(this[y].length===1){if(this[Z]&&this[g]===0)this[Z]=!1;this[y]=[]}else this[y].splice(this[y].indexOf(z),1);z.unpipe()}}addListener(q,z){return this.on(q,z)}on(q,z){let Q=super.on(q,z);if(q==="data"){if(this[m]=!1,this[g]++,!this[y].length&&!this[Z])this[P]()}else if(q==="readable"&&this[V]!==0)super.emit("readable");else if($q(q)&&this[H])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[_]){let K=z;if(this[W])C(()=>K.call(this,this[_]));else K.call(this,this[_])}return Q}removeListener(q,z){return this.off(q,z)}off(q,z){let Q=super.off(q,z);if(q==="data"){if(this[g]=this.listeners("data").length,this[g]===0&&!this[m]&&!this[y].length)this[Z]=!1}return Q}removeAllListeners(q){let z=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[g]=0,!this[m]&&!this[y].length)this[Z]=!1}return z}get emittedEnd(){return this[H]}[l](){if(!this[M]&&!this[H]&&!this[X]&&this[$].length===0&&this[f]){if(this[M]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[i])this.emit("close");this[M]=!1}}emit(q,...z){let Q=z[0];if(q!=="error"&&q!=="close"&&q!==X&&this[X])return!1;else if(q==="data")return!this[w]&&!Q?!1:this[W]?(C(()=>this[S](Q)),!0):this[S](Q);else if(q==="end")return this[o]();else if(q==="close"){if(this[i]=!0,!this[H]&&!this[X])return!1;let J=super.emit("close");return this.removeAllListeners("close"),J}else if(q==="error"){this[_]=Q,super.emit(p,Q);let J=!this[L]||this.listeners("error").length?super.emit("error",Q):!1;return this[l](),J}else if(q==="resume"){let J=super.emit("resume");return this[l](),J}else if(q==="finish"||q==="prefinish"){let J=super.emit(q);return this.removeAllListeners(q),J}let K=super.emit(q,...z);return this[l](),K}[S](q){for(let Q of this[y])if(Q.dest.write(q)===!1)this.pause();let z=this[m]?!1:super.emit("data",q);return this[l](),z}[o](){if(this[H])return!1;return this[H]=!0,this.readable=!1,this[W]?(C(()=>this[I]()),!0):this[I]()}[I](){if(this[Y]){let z=this[Y].end();if(z){for(let Q of this[y])Q.dest.write(z);if(!this[m])super.emit("data",z)}}for(let z of this[y])z.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[w])q.dataLength=0;let z=this.promise();return this.on("data",(Q)=>{if(q.push(Q),!this[w])q.dataLength+=Q.length}),await z,q}async concat(){if(this[w])throw Error("cannot concat in objectMode");let q=await this.collect();return this[x]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,z)=>{this.on(X,()=>z(Error("stream destroyed"))),this.on("error",(Q)=>z(Q)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[m]=!1;let q=!1,z=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return z();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[f])return z();let J,R,U=(b)=>{this.off("data",B),this.off("end",h),this.off(X,k),z(),R(b)},B=(b)=>{this.off("error",U),this.off("end",h),this.off(X,k),this.pause(),J({value:b,done:!!this[f]})},h=()=>{this.off("error",U),this.off("data",B),this.off(X,k),z(),J({done:!0,value:void 0})},k=()=>U(Error("stream destroyed"));return new Promise((b,n)=>{R=n,J=b,this.once(X,k),this.once("error",U),this.once("end",h),this.once("data",B)})},throw:z,return:z,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[m]=!1;let q=!1,z=()=>{return this.pause(),this.off(p,z),this.off(X,z),this.off("end",z),q=!0,{done:!0,value:void 0}},Q=()=>{if(q)return z();let K=this.read();return K===null?z():{done:!1,value:K}};return this.once("end",z),this.once(p,z),this.once(X,z),{next:Q,throw:z,return:z,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(q){if(this[X]){if(q)this.emit("error",q);else this.emit(X);return this}this[X]=!0,this[m]=!0,this[$].length=0,this[V]=0;let z=this;if(typeof z.close==="function"&&!this[i])z.close();if(q)this.emit("error",q);else this.emit(X);return this}static get isStream(){return j.isStream}}j.Minipass=r});
|
|
3
|
-
export{jq as
|
|
2
|
+
import{$Q as e,cR as d}from"./chunk-pfx8ts02.js";var jq=e((j)=>{var E=j&&j.__importDefault||function(q){return q&&q.__esModule?q:{default:q}};Object.defineProperty(j,"__esModule",{value:!0});j.Minipass=j.isWritable=j.isReadable=j.isStream=void 0;var T=typeof process==="object"&&process?process:{stdout:null,stderr:null},O=d("events"),s=E(d("stream")),qq=d("string_decoder"),zq=(q)=>!!q&&typeof q==="object"&&(q instanceof r||q instanceof s.default||(0,j.isReadable)(q)||(0,j.isWritable)(q));j.isStream=zq;var Qq=(q)=>!!q&&typeof q==="object"&&q instanceof O.EventEmitter&&typeof q.pipe==="function"&&q.pipe!==s.default.Writable.prototype.pipe;j.isReadable=Qq;var Xq=(q)=>!!q&&typeof q==="object"&&q instanceof O.EventEmitter&&typeof q.write==="function"&&typeof q.end==="function";j.isWritable=Xq;var f=Symbol("EOF"),l=Symbol("maybeEmitEnd"),H=Symbol("emittedEnd"),M=Symbol("emittingEnd"),_=Symbol("emittedError"),i=Symbol("closed"),c=Symbol("read"),v=Symbol("flush"),t=Symbol("flushChunk"),x=Symbol("encoding"),Y=Symbol("decoder"),Z=Symbol("flowing"),G=Symbol("paused"),P=Symbol("resume"),$=Symbol("buffer"),y=Symbol("pipes"),V=Symbol("bufferLength"),u=Symbol("bufferPush"),A=Symbol("bufferShift"),w=Symbol("objectMode"),X=Symbol("destroyed"),p=Symbol("error"),S=Symbol("emitData"),o=Symbol("emitEnd"),I=Symbol("emitEnd2"),W=Symbol("async"),N=Symbol("abort"),a=Symbol("aborted"),L=Symbol("signal"),g=Symbol("dataListeners"),m=Symbol("discarded"),C=(q)=>Promise.resolve().then(q),Zq=(q)=>q(),$q=(q)=>q==="end"||q==="finish"||q==="prefinish",Vq=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,Kq=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class F{src;dest;opts;ondrain;constructor(q,z,Q){this.src=q,this.dest=z,this.opts=Q,this.ondrain=()=>q[P](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class D extends F{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,z,Q){super(q,z,Q);this.proxyErrors=(K)=>this.dest.emit("error",K),q.on("error",this.proxyErrors)}}var wq=(q)=>!!q.objectMode,yq=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class r extends O.EventEmitter{[Z]=!1;[G]=!1;[y]=[];[$]=[];[w];[x];[W];[Y];[f]=!1;[H]=!1;[M]=!1;[i]=!1;[_]=null;[V]=0;[X]=!1;[L];[a]=!1;[g]=0;[m]=!1;writable=!0;readable=!0;constructor(...q){let z=q[0]||{};super();if(z.objectMode&&typeof z.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(wq(z))this[w]=!0,this[x]=null;else if(yq(z))this[x]=z.encoding,this[w]=!1;else this[w]=!1,this[x]=null;if(this[W]=!!z.async,this[Y]=this[x]?new qq.StringDecoder(this[x]):null,z&&z.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[$]});if(z&&z.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[y]});let{signal:Q}=z;if(Q)if(this[L]=Q,Q.aborted)this[N]();else Q.addEventListener("abort",()=>this[N]())}get bufferLength(){return this[V]}get encoding(){return this[x]}set encoding(q){throw Error("Encoding must be set at instantiation time")}setEncoding(q){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[w]}set objectMode(q){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[W]}set["async"](q){this[W]=this[W]||!!q}[N](){this[a]=!0,this.emit("abort",this[L]?.reason),this.destroy(this[L]?.reason)}get aborted(){return this[a]}set aborted(q){}write(q,z,Q){if(this[a])return!1;if(this[f])throw Error("write after end");if(this[X])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof z==="function")Q=z,z="utf8";if(!z)z="utf8";let K=this[W]?C:Zq;if(!this[w]&&!Buffer.isBuffer(q)){if(Kq(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(Vq(q))q=Buffer.from(q);else if(typeof q!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[w]){if(this[Z]&&this[V]!==0)this[v](!0);if(this[Z])this.emit("data",q);else this[u](q);if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}if(!q.length){if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}if(typeof q==="string"&&!(z===this[x]&&!this[Y]?.lastNeed))q=Buffer.from(q,z);if(Buffer.isBuffer(q)&&this[x])q=this[Y].write(q);if(this[Z]&&this[V]!==0)this[v](!0);if(this[Z])this.emit("data",q);else this[u](q);if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}read(q){if(this[X])return null;if(this[m]=!1,this[V]===0||q===0||q&&q>this[V])return this[l](),null;if(this[w])q=null;if(this[$].length>1&&!this[w])this[$]=[this[x]?this[$].join(""):Buffer.concat(this[$],this[V])];let z=this[c](q||null,this[$][0]);return this[l](),z}[c](q,z){if(this[w])this[A]();else{let Q=z;if(q===Q.length||q===null)this[A]();else if(typeof Q==="string")this[$][0]=Q.slice(q),z=Q.slice(0,q),this[V]-=q;else this[$][0]=Q.subarray(q),z=Q.subarray(0,q),this[V]-=q}if(this.emit("data",z),!this[$].length&&!this[f])this.emit("drain");return z}end(q,z,Q){if(typeof q==="function")Q=q,q=void 0;if(typeof z==="function")Q=z,z="utf8";if(q!==void 0)this.write(q,z);if(Q)this.once("end",Q);if(this[f]=!0,this.writable=!1,this[Z]||!this[G])this[l]();return this}[P](){if(this[X])return;if(!this[g]&&!this[y].length)this[m]=!0;if(this[G]=!1,this[Z]=!0,this.emit("resume"),this[$].length)this[v]();else if(this[f])this[l]();else this.emit("drain")}resume(){return this[P]()}pause(){this[Z]=!1,this[G]=!0,this[m]=!1}get destroyed(){return this[X]}get flowing(){return this[Z]}get paused(){return this[G]}[u](q){if(this[w])this[V]+=1;else this[V]+=q.length;this[$].push(q)}[A](){if(this[w])this[V]-=1;else this[V]-=this[$][0].length;return this[$].shift()}[v](q=!1){do;while(this[t](this[A]())&&this[$].length);if(!q&&!this[$].length&&!this[f])this.emit("drain")}[t](q){return this.emit("data",q),this[Z]}pipe(q,z){if(this[X])return q;this[m]=!1;let Q=this[H];if(z=z||{},q===T.stdout||q===T.stderr)z.end=!1;else z.end=z.end!==!1;if(z.proxyErrors=!!z.proxyErrors,Q){if(z.end)q.end()}else if(this[y].push(!z.proxyErrors?new F(this,q,z):new D(this,q,z)),this[W])C(()=>this[P]());else this[P]();return q}unpipe(q){let z=this[y].find((Q)=>Q.dest===q);if(z){if(this[y].length===1){if(this[Z]&&this[g]===0)this[Z]=!1;this[y]=[]}else this[y].splice(this[y].indexOf(z),1);z.unpipe()}}addListener(q,z){return this.on(q,z)}on(q,z){let Q=super.on(q,z);if(q==="data"){if(this[m]=!1,this[g]++,!this[y].length&&!this[Z])this[P]()}else if(q==="readable"&&this[V]!==0)super.emit("readable");else if($q(q)&&this[H])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[_]){let K=z;if(this[W])C(()=>K.call(this,this[_]));else K.call(this,this[_])}return Q}removeListener(q,z){return this.off(q,z)}off(q,z){let Q=super.off(q,z);if(q==="data"){if(this[g]=this.listeners("data").length,this[g]===0&&!this[m]&&!this[y].length)this[Z]=!1}return Q}removeAllListeners(q){let z=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[g]=0,!this[m]&&!this[y].length)this[Z]=!1}return z}get emittedEnd(){return this[H]}[l](){if(!this[M]&&!this[H]&&!this[X]&&this[$].length===0&&this[f]){if(this[M]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[i])this.emit("close");this[M]=!1}}emit(q,...z){let Q=z[0];if(q!=="error"&&q!=="close"&&q!==X&&this[X])return!1;else if(q==="data")return!this[w]&&!Q?!1:this[W]?(C(()=>this[S](Q)),!0):this[S](Q);else if(q==="end")return this[o]();else if(q==="close"){if(this[i]=!0,!this[H]&&!this[X])return!1;let J=super.emit("close");return this.removeAllListeners("close"),J}else if(q==="error"){this[_]=Q,super.emit(p,Q);let J=!this[L]||this.listeners("error").length?super.emit("error",Q):!1;return this[l](),J}else if(q==="resume"){let J=super.emit("resume");return this[l](),J}else if(q==="finish"||q==="prefinish"){let J=super.emit(q);return this.removeAllListeners(q),J}let K=super.emit(q,...z);return this[l](),K}[S](q){for(let Q of this[y])if(Q.dest.write(q)===!1)this.pause();let z=this[m]?!1:super.emit("data",q);return this[l](),z}[o](){if(this[H])return!1;return this[H]=!0,this.readable=!1,this[W]?(C(()=>this[I]()),!0):this[I]()}[I](){if(this[Y]){let z=this[Y].end();if(z){for(let Q of this[y])Q.dest.write(z);if(!this[m])super.emit("data",z)}}for(let z of this[y])z.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[w])q.dataLength=0;let z=this.promise();return this.on("data",(Q)=>{if(q.push(Q),!this[w])q.dataLength+=Q.length}),await z,q}async concat(){if(this[w])throw Error("cannot concat in objectMode");let q=await this.collect();return this[x]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,z)=>{this.on(X,()=>z(Error("stream destroyed"))),this.on("error",(Q)=>z(Q)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[m]=!1;let q=!1,z=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return z();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[f])return z();let J,R,U=(b)=>{this.off("data",B),this.off("end",h),this.off(X,k),z(),R(b)},B=(b)=>{this.off("error",U),this.off("end",h),this.off(X,k),this.pause(),J({value:b,done:!!this[f]})},h=()=>{this.off("error",U),this.off("data",B),this.off(X,k),z(),J({done:!0,value:void 0})},k=()=>U(Error("stream destroyed"));return new Promise((b,n)=>{R=n,J=b,this.once(X,k),this.once("error",U),this.once("end",h),this.once("data",B)})},throw:z,return:z,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[m]=!1;let q=!1,z=()=>{return this.pause(),this.off(p,z),this.off(X,z),this.off("end",z),q=!0,{done:!0,value:void 0}},Q=()=>{if(q)return z();let K=this.read();return K===null?z():{done:!1,value:K}};return this.once("end",z),this.once(p,z),this.once(X,z),{next:Q,throw:z,return:z,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(q){if(this[X]){if(q)this.emit("error",q);else this.emit(X);return this}this[X]=!0,this[m]=!0,this[$].length=0,this[V]=0;let z=this;if(typeof z.close==="function"&&!this[i])z.close();if(q)this.emit("error",q);else this.emit(X);return this}static get isStream(){return j.isStream}}j.Minipass=r});
|
|
3
|
+
export{jq as Pf};
|