@qitqode/qitqode-android-arm64 0.2.1 → 0.2.3
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/bun +0 -0
- package/bundle/{chunk-2hv2c8d5.js → chunk-0428v6mw.js} +1 -1
- package/bundle/{chunk-0f3ft9dh.js → chunk-05ck7acg.js} +1 -1
- package/bundle/{chunk-p5mes2sh.js → chunk-083wpv6r.js} +1 -1
- package/bundle/{chunk-j5ymkhry.js → chunk-0cnwsf8p.js} +1 -1
- package/bundle/{chunk-6y4mwmn4.js → chunk-0nbteyb0.js} +2 -2
- package/bundle/chunk-0nqf1k20.js +2 -0
- package/bundle/chunk-0ppnq3a4.js +2 -0
- package/bundle/{chunk-6kf4vw2g.js → chunk-0qd3567w.js} +1 -1
- package/bundle/{chunk-jw114bbt.js → chunk-0smnwqk6.js} +2 -2
- package/bundle/chunk-0te0vcdn.js +2 -0
- package/bundle/{chunk-sh76e256.js → chunk-0vakk88p.js} +2 -2
- package/bundle/{chunk-wp3dpt6d.js → chunk-0vxnkstz.js} +2 -2
- package/bundle/{chunk-q4fn41ex.js → chunk-0xrb12s8.js} +2 -2
- package/bundle/chunk-11h06z17.js +2 -0
- package/bundle/chunk-16w710kf.js +3 -0
- package/bundle/{chunk-6dfjtzqb.js → chunk-21rq4592.js} +2 -2
- package/bundle/{chunk-y3dfk6n5.js → chunk-24rkf2gk.js} +1 -1
- package/bundle/{chunk-rdwma0de.js → chunk-24ygjbpf.js} +2 -2
- package/bundle/chunk-262s2yz2.js +2 -0
- package/bundle/chunk-28yv4fqe.js +2 -0
- package/bundle/{chunk-3tmq81kq.js → chunk-2drzgtv3.js} +2 -2
- package/bundle/{chunk-xd3xc1vv.js → chunk-2md6sx8d.js} +1 -1
- package/bundle/{chunk-v9rg0a8g.js → chunk-313zqzc1.js} +1 -1
- package/bundle/{chunk-zfd70p01.js → chunk-32j0q58h.js} +1 -1
- package/bundle/chunk-34a52hyr.js +2 -0
- package/bundle/{chunk-86jsqc7d.js → chunk-39z96pc6.js} +3 -3
- package/bundle/{chunk-g9end129.js → chunk-3atcc483.js} +1 -1
- package/bundle/{chunk-e6wp96vm.js → chunk-3jf3jhrs.js} +1 -1
- package/bundle/{chunk-4sxg9cgr.js → chunk-3kpse7zy.js} +1 -1
- package/bundle/chunk-3n3gb3vd.js +2 -0
- package/bundle/chunk-3sq60y9f.js +2 -0
- package/bundle/{chunk-2qwmrp16.js → chunk-3vvd7j14.js} +1 -1
- package/bundle/chunk-4086z5ys.js +2 -0
- package/bundle/{chunk-rcyzqa3g.js → chunk-450fef7h.js} +2 -2
- package/bundle/{chunk-kxjrrdj0.js → chunk-45a4n21f.js} +1 -1
- package/bundle/{chunk-xny5ecn0.js → chunk-47k5jy1p.js} +2 -2
- package/bundle/{chunk-dj3525nn.js → chunk-47z3x3dp.js} +189 -228
- package/bundle/{chunk-0gab4v98.js → chunk-48r70n4s.js} +1 -1
- package/bundle/chunk-49mbnqvc.js +2 -0
- package/bundle/{chunk-yerfyz4w.js → chunk-49xhybc2.js} +1 -1
- package/bundle/{chunk-t9zbp2qw.js → chunk-4agaj51z.js} +1 -1
- package/bundle/{chunk-faa0zxey.js → chunk-4dnntf9k.js} +2 -2
- package/bundle/chunk-4fr6kae9.js +2 -0
- package/bundle/chunk-4websxrs.js +2 -0
- package/bundle/chunk-516w1nc4.js +2 -0
- package/bundle/chunk-52w60e1f.js +2 -0
- package/bundle/chunk-535nm66j.js +2 -0
- package/bundle/{chunk-1p6jjrea.js → chunk-55fcmswd.js} +2 -2
- package/bundle/{chunk-n7kqdqkh.js → chunk-55ykn8nz.js} +4 -4
- package/bundle/chunk-565855py.js +2 -0
- package/bundle/chunk-56v352f8.js +2 -0
- package/bundle/chunk-5bjtq8t2.js +2 -0
- package/bundle/{chunk-as845ya4.js → chunk-5c2438af.js} +1 -1
- package/bundle/chunk-5kpxpm8e.js +2 -0
- package/bundle/chunk-5nm5s0h2.js +2 -0
- package/bundle/{chunk-07s30fpb.js → chunk-5nrc5rhh.js} +1 -1
- package/bundle/{chunk-jwph7tpc.js → chunk-5pwv2p3s.js} +1 -1
- package/bundle/{chunk-q5abwn50.js → chunk-5pzs51sp.js} +1 -1
- package/bundle/{chunk-r0s28gnb.js → chunk-5tky3csh.js} +1 -1
- package/bundle/{chunk-yajd975f.js → chunk-5w76kdjr.js} +1 -1
- package/bundle/{chunk-wcqfr8vr.js → chunk-5ysbwr4x.js} +1 -1
- package/bundle/{chunk-g5cgpvef.js → chunk-5zkj5xv9.js} +2 -2
- package/bundle/{chunk-fgn83bs7.js → chunk-65bmsp2t.js} +1 -1
- package/bundle/chunk-65t9b9eq.js +3 -0
- package/bundle/{chunk-9jrxrjzt.js → chunk-68v3b6ns.js} +2 -2
- package/bundle/{chunk-7ntw4rrn.js → chunk-6ar91jvd.js} +1 -1
- package/bundle/{chunk-bbbh69ys.js → chunk-6evh2ke8.js} +1 -1
- package/bundle/chunk-6gpf2bjs.js +2 -0
- package/bundle/{chunk-a2dz9nqh.js → chunk-6m9jb0s9.js} +2 -2
- package/bundle/{chunk-yvjke593.js → chunk-6scf311w.js} +1 -1
- package/bundle/{chunk-jjjs8p0t.js → chunk-6tstcwxp.js} +2 -2
- package/bundle/{chunk-5wwd40t3.js → chunk-70q8qcb2.js} +1 -1
- package/bundle/{chunk-pfkm3j8g.js → chunk-73r8bjjz.js} +2 -2
- package/bundle/{chunk-bzs2ep7s.js → chunk-78pt314g.js} +1 -1
- package/bundle/{chunk-hs3vfhar.js → chunk-7bcm7gg1.js} +1 -1
- package/bundle/chunk-7bgzcpdw.js +2 -0
- package/bundle/{chunk-ezfzb8qc.js → chunk-7g66qc1v.js} +2 -2
- package/bundle/{chunk-fd7fmvyw.js → chunk-7hvf9dgx.js} +1 -1
- package/bundle/chunk-7kjvcbwa.js +2 -0
- package/bundle/chunk-7knnz5f1.js +2 -0
- package/bundle/{chunk-6j339s7a.js → chunk-7mppvhv9.js} +2 -2
- package/bundle/{chunk-yqb6cfed.js → chunk-7vmx8bg9.js} +2 -2
- package/bundle/{chunk-7njz51r4.js → chunk-7x6yrtzn.js} +1 -1
- package/bundle/{chunk-skv9ww0s.js → chunk-804vmbcd.js} +1 -1
- package/bundle/{chunk-qeg0jnxq.js → chunk-88q0mtgp.js} +2 -2
- package/bundle/chunk-8jma2btf.js +2 -0
- package/bundle/{chunk-jgtcfw96.js → chunk-8mm92zn2.js} +2 -2
- package/bundle/{chunk-kdcnder5.js → chunk-8wwdrwf2.js} +1 -1
- package/bundle/{chunk-4fk46ngj.js → chunk-920z7g7j.js} +1 -1
- package/bundle/chunk-93e0w75z.js +2 -0
- package/bundle/{chunk-pzefsndd.js → chunk-953pqp3w.js} +1 -1
- package/bundle/chunk-96wwns35.js +2 -0
- package/bundle/chunk-97gp818s.js +2 -0
- package/bundle/chunk-9epf2zbh.js +2 -0
- package/bundle/chunk-9fyz4sxa.js +2 -0
- package/bundle/{chunk-4hd3v58j.js → chunk-9hz56z6a.js} +1 -1
- package/bundle/{chunk-rk2bk4s7.js → chunk-9zm6r55d.js} +2 -2
- package/bundle/chunk-a7wmadf1.js +2 -0
- package/bundle/{chunk-w7em72p8.js → chunk-ac7482n2.js} +2 -2
- package/bundle/chunk-agv04nt7.js +2 -0
- package/bundle/{chunk-cbmwhvxw.js → chunk-at22twxx.js} +2 -2
- package/bundle/{chunk-ahyqfbmq.js → chunk-avefgbjg.js} +2 -2
- package/bundle/chunk-azpnrnv9.js +8251 -0
- package/bundle/{chunk-z2h1gxyx.js → chunk-bbng1cea.js} +1 -1
- package/bundle/{chunk-5az84brc.js → chunk-bd21p9zz.js} +2 -2
- package/bundle/chunk-be7smmar.js +2 -0
- package/bundle/{chunk-y4e7e42x.js → chunk-bne5w117.js} +4 -4
- package/bundle/{chunk-j3jqk62r.js → chunk-bqn6bqws.js} +1 -1
- package/bundle/{chunk-f4zfk5ye.js → chunk-brws2aht.js} +1 -1
- package/bundle/chunk-bryx5cx9.js +2 -0
- package/bundle/{chunk-9eg2ytjd.js → chunk-bvf2dcq4.js} +3 -3
- package/bundle/{chunk-tge53d52.js → chunk-bwbqkfv0.js} +1 -1
- package/bundle/chunk-c13rrw41.js +2 -0
- package/bundle/chunk-c2kkv619.js +2 -0
- package/bundle/{chunk-64c8q9zg.js → chunk-c36p881g.js} +3 -3
- package/bundle/chunk-c5xj1y5v.js +2 -0
- package/bundle/chunk-c74cxhjb.js +2 -0
- package/bundle/chunk-cejyed1j.js +2 -0
- package/bundle/chunk-ckpm4dvv.js +2 -0
- package/bundle/{chunk-732yr6qq.js → chunk-cmb62jkt.js} +2 -2
- package/bundle/chunk-ct8twng1.js +2 -0
- package/bundle/{chunk-1q1cddy4.js → chunk-cz5vta94.js} +1 -1
- package/bundle/{chunk-fpm2vgz6.js → chunk-d0x5pbkm.js} +1 -1
- package/bundle/chunk-d38y7bvh.js +2 -0
- package/bundle/chunk-d6hxsfm6.js +2 -0
- package/bundle/{chunk-29zm623f.js → chunk-d6jhs818.js} +2 -2
- package/bundle/chunk-descb9jz.js +2 -0
- package/bundle/{chunk-mswx4k75.js → chunk-dnnkq5y4.js} +2 -2
- package/bundle/{chunk-6pcmv8vs.js → chunk-dnsh1v42.js} +2 -2
- package/bundle/{chunk-f7rj6fck.js → chunk-dqp4nmxs.js} +1 -1
- package/bundle/chunk-dvr2b9r1.js +2 -0
- package/bundle/{chunk-s0ty36qg.js → chunk-dxdggn90.js} +1 -1
- package/bundle/{chunk-vjx0064q.js → chunk-e8p92vz4.js} +2 -2
- package/bundle/chunk-ea5fktnn.js +2 -0
- package/bundle/{chunk-t1jgx17a.js → chunk-eg3syjtv.js} +2 -2
- package/bundle/{chunk-2a9rzgk6.js → chunk-ehb4hd9c.js} +1 -1
- package/bundle/{chunk-9jsgs71h.js → chunk-ejqzcdcx.js} +1 -1
- package/bundle/chunk-enmsp09e.js +3 -0
- package/bundle/chunk-epgcsjfp.js +2 -0
- package/bundle/{chunk-5t0w9ecw.js → chunk-et3804wr.js} +1 -1
- package/bundle/{chunk-yd8bzhv6.js → chunk-ezrqhqkp.js} +1 -1
- package/bundle/chunk-f0t7rryn.js +3 -0
- package/bundle/{chunk-p635phfw.js → chunk-f31yvp20.js} +1 -1
- package/bundle/chunk-f4mf6tpp.js +2 -0
- package/bundle/chunk-f97k17t8.js +2 -0
- package/bundle/{chunk-yx1h0b5v.js → chunk-faee8zgc.js} +1 -1
- package/bundle/{chunk-p9mj4zyk.js → chunk-ff548b0j.js} +2 -2
- package/bundle/{chunk-bgng3rdj.js → chunk-fhqfqd5v.js} +2 -2
- package/bundle/{chunk-zek5c15t.js → chunk-fjbv3jht.js} +1 -1
- package/bundle/{chunk-hpa7e9va.js → chunk-fsahzvd5.js} +3 -3
- package/bundle/chunk-g06a4chw.js +2 -0
- package/bundle/{chunk-hq9bgnqb.js → chunk-g22e4gw7.js} +1 -1
- package/bundle/{chunk-s0ptrw0z.js → chunk-g3wvtyw3.js} +1 -1
- package/bundle/{chunk-x4pdpka8.js → chunk-g42krp0z.js} +1 -1
- package/bundle/chunk-g4ehhdzp.js +2 -0
- package/bundle/{chunk-a9y27zd2.js → chunk-gbkz04ke.js} +1 -1
- package/bundle/chunk-gd6qpdjw.js +2 -0
- package/bundle/chunk-gehn9fd9.js +2 -0
- package/bundle/{chunk-0zxwjsvz.js → chunk-ggxzf22k.js} +1 -1
- package/bundle/{chunk-kzvvvj79.js → chunk-gszvgz76.js} +2 -2
- package/bundle/{chunk-g3kd4957.js → chunk-gy21fw82.js} +2 -2
- package/bundle/{chunk-cbf1y12x.js → chunk-h62chdmw.js} +1 -1
- package/bundle/{chunk-knh01n2r.js → chunk-h823m51m.js} +2 -2
- package/bundle/{chunk-zqkv8796.js → chunk-h99tj1e4.js} +1 -1
- package/bundle/{chunk-c1g8n10t.js → chunk-ha1w0xzh.js} +1 -1
- package/bundle/chunk-ha8b2n4x.js +2 -0
- package/bundle/{chunk-rpfhgncs.js → chunk-has2rz35.js} +1 -1
- package/bundle/chunk-hbyrwmne.js +2 -0
- package/bundle/chunk-hhax4mxw.js +2 -0
- package/bundle/{chunk-087tnr8a.js → chunk-hwrrrbqd.js} +1 -1
- package/bundle/chunk-hzrxmdqm.js +2 -0
- package/bundle/{chunk-yd2emszh.js → chunk-j0bwa5dk.js} +2 -2
- package/bundle/{chunk-9b4aqcde.js → chunk-j164q40b.js} +2 -2
- package/bundle/{chunk-qhnpq5gb.js → chunk-j8fcfhr2.js} +2 -2
- package/bundle/{chunk-9ea1n338.js → chunk-j9h1sp4g.js} +2 -2
- package/bundle/{chunk-yrfq22a5.js → chunk-jg1ccs3j.js} +1 -1
- package/bundle/{chunk-d307vb2d.js → chunk-jqk3v8d6.js} +1 -1
- package/bundle/chunk-jrwnz64e.js +3 -0
- package/bundle/chunk-jvkzdap1.js +2 -0
- package/bundle/chunk-jvybgsz5.js +5 -0
- package/bundle/{chunk-pp9neaaz.js → chunk-jww55nk9.js} +1 -1
- package/bundle/{chunk-fvy24yhq.js → chunk-k1nh5sd2.js} +1 -1
- package/bundle/{chunk-wfggztm4.js → chunk-k4gsktts.js} +1 -1
- package/bundle/{chunk-qaz100ht.js → chunk-k5q9px67.js} +1 -1
- package/bundle/chunk-kg8fcv91.js +2 -0
- package/bundle/chunk-kgptyf7n.js +3 -0
- package/bundle/{chunk-b50t4jc5.js → chunk-khzzmyk2.js} +1 -1
- package/bundle/chunk-kjjjrjnb.js +2 -0
- package/bundle/{chunk-jvjq554f.js → chunk-ksme3gj1.js} +1 -1
- package/bundle/chunk-m5cfmhwh.js +2 -0
- package/bundle/{chunk-4v61ysex.js → chunk-m5dm7a1t.js} +1 -1
- package/bundle/{chunk-yr35q7q1.js → chunk-m7ganre7.js} +1 -1
- package/bundle/chunk-m7qxxbns.js +2 -0
- package/bundle/{chunk-y287zwkr.js → chunk-mh19kwzw.js} +1 -1
- package/bundle/{chunk-7my2231h.js → chunk-mhhtf0v3.js} +1 -1
- package/bundle/{chunk-grw4gg9j.js → chunk-mjjaezwq.js} +2 -2
- package/bundle/{chunk-03mbn7nj.js → chunk-mmjgf680.js} +2 -2
- package/bundle/{chunk-jv4th87b.js → chunk-mn9end71.js} +1 -1
- package/bundle/{chunk-dknemkw2.js → chunk-msdypt5f.js} +2 -2
- package/bundle/chunk-n0b0dfqk.js +2 -0
- package/bundle/{chunk-3h49k2ck.js → chunk-n23d0q00.js} +1 -1
- package/bundle/{chunk-mpe8zxc0.js → chunk-n78f8hfk.js} +1 -1
- package/bundle/chunk-n8wg5h5p.js +2 -0
- package/bundle/chunk-nbd13scz.js +28 -0
- package/bundle/{chunk-r2qns6yc.js → chunk-nftgx6bz.js} +1 -1
- package/bundle/{chunk-gr4bctqj.js → chunk-nj1ntakd.js} +2 -2
- package/bundle/{chunk-wdaf713t.js → chunk-nrat6ncm.js} +1 -1
- package/bundle/{chunk-rm5ntsvn.js → chunk-nty5z2cj.js} +1 -1
- package/bundle/chunk-nvwzam7a.js +2 -0
- package/bundle/{chunk-rp8asmq7.js → chunk-p169ee92.js} +1 -1
- package/bundle/chunk-p27a88vp.js +7 -0
- package/bundle/{chunk-xjpvv3vp.js → chunk-p3rd2q47.js} +2 -2
- package/bundle/{chunk-fbm6qczy.js → chunk-p4027t94.js} +1 -1
- package/bundle/{chunk-94qhpkfx.js → chunk-p54bzjtv.js} +1 -1
- package/bundle/{chunk-cp39f96a.js → chunk-p5be5ddp.js} +1 -1
- package/bundle/{chunk-ngvp6zc2.js → chunk-p6crzjtf.js} +2 -2
- package/bundle/chunk-p6hcj3kv.js +2 -0
- package/bundle/{chunk-p4ewy9xh.js → chunk-pb30kkbs.js} +6 -6
- package/bundle/chunk-pexmns0j.js +2 -0
- package/bundle/{chunk-my3cswnp.js → chunk-ph8hn1wt.js} +2 -2
- package/bundle/{chunk-99148b1k.js → chunk-pmg53fdd.js} +1 -1
- package/bundle/{chunk-wf4x5cjc.js → chunk-pr7z5dj8.js} +1 -1
- package/bundle/chunk-pt603np4.js +2 -0
- package/bundle/{chunk-4mvg7jt1.js → chunk-ptqk1j2r.js} +1 -1
- package/bundle/{chunk-a92hh67a.js → chunk-pxm4qvqk.js} +2 -2
- package/bundle/{chunk-3qfpw8f6.js → chunk-qey1efpx.js} +1 -1
- package/bundle/chunk-qk5bfcv8.js +2 -0
- package/bundle/{chunk-mx3jd1p9.js → chunk-qktzz0sy.js} +1 -1
- package/bundle/{chunk-ks1cs80p.js → chunk-qnvsqnz5.js} +2 -2
- package/bundle/{chunk-bcx2vkv4.js → chunk-qp1n7kwe.js} +1 -1
- package/bundle/{chunk-xnhvt98g.js → chunk-qqrc1h5b.js} +2 -2
- package/bundle/{chunk-q148vndn.js → chunk-qqxrvyx0.js} +2 -2
- package/bundle/chunk-qr06byhp.js +2 -0
- package/bundle/{chunk-qg9bt0kx.js → chunk-qrxqfp59.js} +2 -2
- package/bundle/{chunk-gtjn3yc4.js → chunk-qxcyz5hc.js} +2 -2
- package/bundle/{chunk-kc1xmcc9.js → chunk-qznr1emx.js} +41 -39
- package/bundle/{chunk-0z1cxvk1.js → chunk-r5zy4za0.js} +2 -2
- package/bundle/chunk-r7sq3maz.js +2 -0
- package/bundle/{chunk-f83wv08n.js → chunk-r9w0thdk.js} +1 -1
- package/bundle/chunk-rmgs9nmj.js +2 -0
- package/bundle/{chunk-p887g1xj.js → chunk-rn83r0js.js} +1 -1
- package/bundle/{chunk-7myg8076.js → chunk-rp9r3cvt.js} +2 -2
- package/bundle/{chunk-n90eh3e7.js → chunk-rrv0n73b.js} +1 -1
- package/bundle/chunk-rscfes01.js +2 -0
- package/bundle/chunk-rytavefg.js +2 -0
- package/bundle/{chunk-ztn2jv26.js → chunk-s2gg38y0.js} +1 -1
- package/bundle/{chunk-yz0pwv2m.js → chunk-s4vx9x1v.js} +1 -1
- package/bundle/{chunk-x2cavpa9.js → chunk-sfw5qddj.js} +1 -1
- package/bundle/chunk-sh9vjnsh.js +2 -0
- package/bundle/{chunk-6avjq7my.js → chunk-smznrv7k.js} +1 -1
- package/bundle/chunk-snbw69t6.js +2 -0
- package/bundle/chunk-st0c5wwc.js +2 -0
- package/bundle/{chunk-vqss3e48.js → chunk-t0761rhq.js} +2 -2
- package/bundle/{chunk-vqpfpmha.js → chunk-t239rvej.js} +2 -2
- package/bundle/{chunk-bggybm9k.js → chunk-t8c4cs6z.js} +1 -1
- package/bundle/chunk-tdyvps17.js +35 -0
- package/bundle/chunk-teb3k2sf.js +2 -0
- package/bundle/{chunk-ve3np791.js → chunk-tg226j37.js} +1 -1
- package/bundle/{chunk-73fz0cf4.js → chunk-tkrwcjkr.js} +2 -2
- package/bundle/{chunk-v5z6sx6j.js → chunk-tm34qp8j.js} +1 -1
- package/bundle/chunk-tr6rdr6h.js +4 -0
- package/bundle/chunk-ts798jvf.js +2 -0
- package/bundle/chunk-tx5aj02v.js +2 -0
- package/bundle/{chunk-3aq70t26.js → chunk-tza09w2q.js} +1 -1
- package/bundle/chunk-v1t51rrq.js +2 -0
- package/bundle/{chunk-q9ft590w.js → chunk-v6h3nes1.js} +2 -2
- package/bundle/{chunk-e586sjb0.js → chunk-vcygx6hs.js} +2 -2
- package/bundle/{chunk-hmznf0ax.js → chunk-vdxar0ct.js} +1 -1
- package/bundle/{chunk-86yk21g4.js → chunk-venprxdp.js} +1 -1
- package/bundle/{chunk-ywkvq7zb.js → chunk-vf492zs6.js} +1 -1
- package/bundle/chunk-vh9ptqn0.js +2 -0
- package/bundle/{chunk-w79jzf8w.js → chunk-vnrjk2be.js} +1 -1
- package/bundle/{chunk-8q5ns61h.js → chunk-vshycswk.js} +1 -1
- package/bundle/{chunk-8e6gx3gg.js → chunk-vsz4s6zt.js} +1 -1
- package/bundle/{chunk-vhe92p7a.js → chunk-vygkwwjd.js} +2 -2
- package/bundle/{chunk-9rxyq6f9.js → chunk-w46g7kdq.js} +2 -2
- package/bundle/{chunk-q128vfc6.js → chunk-w4brava0.js} +1 -1
- package/bundle/{chunk-drwqag0f.js → chunk-w4synhfg.js} +1 -1
- package/bundle/chunk-w72rctxz.js +2 -0
- package/bundle/{chunk-mxhb5adq.js → chunk-w9gzfsy7.js} +2 -2
- package/bundle/chunk-wbw9zv3h.js +2 -0
- package/bundle/chunk-wg55bwqh.js +8 -0
- package/bundle/{chunk-1sfcxdbw.js → chunk-wkg3c643.js} +2 -2
- package/bundle/{chunk-2bgqy6z7.js → chunk-wwdpw27v.js} +1 -1
- package/bundle/{chunk-km1n4ttr.js → chunk-wy3a4cab.js} +1 -1
- package/bundle/{chunk-tczbhj0e.js → chunk-wyj8cpx5.js} +1 -1
- package/bundle/chunk-x6mw98c2.js +2 -0
- package/bundle/chunk-x9ptmxt7.js +2 -0
- package/bundle/{chunk-8rh0femq.js → chunk-xdd3553a.js} +1 -1
- package/bundle/{chunk-2jpmxt4v.js → chunk-xdteq9bd.js} +1 -1
- package/bundle/{chunk-9y15zjxa.js → chunk-xe69cnsk.js} +1 -1
- package/bundle/{chunk-qkh8697x.js → chunk-xq2kcar4.js} +2 -2
- package/bundle/{chunk-bk3z400e.js → chunk-y0527cg0.js} +1 -1
- package/bundle/{chunk-hrw5rmj1.js → chunk-y29ejqg2.js} +1 -1
- package/bundle/{chunk-42r7z6sq.js → chunk-y67kaj0b.js} +1 -1
- package/bundle/chunk-y6p57wgh.js +2 -0
- package/bundle/chunk-y6xs8v17.js +2 -0
- package/bundle/{chunk-zdzxsyxs.js → chunk-y7hgevfv.js} +2 -2
- package/bundle/{chunk-k1gddnkm.js → chunk-ybane1en.js} +1 -1
- package/bundle/{chunk-k6cbfrzc.js → chunk-yhj01dz9.js} +2 -2
- package/bundle/{chunk-2xqqkf86.js → chunk-ypdt9mmr.js} +2 -2
- package/bundle/chunk-yvn8dmah.js +2 -0
- package/bundle/{chunk-vm1ek7yf.js → chunk-yz25607t.js} +1 -1
- package/bundle/{chunk-ypcc3cnb.js → chunk-z1932c3f.js} +1 -1
- package/bundle/chunk-z3xsfpc6.js +2 -0
- package/bundle/chunk-z4kjxtjq.js +2 -0
- package/bundle/{chunk-6ypafpg8.js → chunk-z6sbjvtv.js} +1 -1
- package/bundle/chunk-z8mj4z6e.js +2 -0
- package/bundle/{chunk-ta7mfkms.js → chunk-zc0cdvcv.js} +2 -2
- package/bundle/chunk-zgv1e250.js +2 -0
- package/bundle/chunk-zn5pw733.js +2 -0
- package/bundle/{chunk-qf1dqzra.js → chunk-ztyy3ga3.js} +2 -2
- package/bundle/chunk-zxwvnmea.js +2 -0
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/qffi-compat.so +0 -0
- package/bundle/qffi.node +0 -0
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-073ydjmk.js +0 -2
- package/bundle/chunk-0xrr0k94.js +0 -2
- package/bundle/chunk-0yagj4ss.js +0 -2
- package/bundle/chunk-0ych0f5w.js +0 -2
- package/bundle/chunk-22hr3ndh.js +0 -2
- package/bundle/chunk-23tyxyyj.js +0 -2
- package/bundle/chunk-28g1ndpx.js +0 -2
- package/bundle/chunk-29v1v357.js +0 -2
- package/bundle/chunk-2avxtbv3.js +0 -2
- package/bundle/chunk-2qk0k2eb.js +0 -2
- package/bundle/chunk-3kn57y8d.js +0 -619
- package/bundle/chunk-3ktj87g4.js +0 -2
- package/bundle/chunk-3wxvpvg4.js +0 -3
- package/bundle/chunk-42wdfks8.js +0 -2
- package/bundle/chunk-4f19vqxf.js +0 -2
- package/bundle/chunk-4jq25vbc.js +0 -2
- package/bundle/chunk-4m3k1atq.js +0 -2
- package/bundle/chunk-4n2ytddp.js +0 -2
- package/bundle/chunk-4yg42p6y.js +0 -2
- package/bundle/chunk-4zx3ze68.js +0 -2
- package/bundle/chunk-57xbwzdn.js +0 -3
- package/bundle/chunk-637sjdzq.js +0 -2
- package/bundle/chunk-6bghztra.js +0 -2
- package/bundle/chunk-6h8f89tt.js +0 -2
- package/bundle/chunk-6sjj203r.js +0 -2
- package/bundle/chunk-79aka9xe.js +0 -2
- package/bundle/chunk-7nqdhe7x.js +0 -2
- package/bundle/chunk-7rhry8nv.js +0 -2
- package/bundle/chunk-7x88b2n2.js +0 -2
- package/bundle/chunk-7zvawpe1.js +0 -7
- package/bundle/chunk-8mthftwc.js +0 -2
- package/bundle/chunk-8wdara3b.js +0 -2
- package/bundle/chunk-8xhzpnph.js +0 -2
- package/bundle/chunk-9akz8w0d.js +0 -2
- package/bundle/chunk-9etpppyv.js +0 -3
- package/bundle/chunk-9nn4jpb7.js +0 -2
- package/bundle/chunk-9tk4wsn4.js +0 -2
- package/bundle/chunk-a0rjp24v.js +0 -2
- package/bundle/chunk-a7p0x4sw.js +0 -2
- package/bundle/chunk-ae0a496j.js +0 -2
- package/bundle/chunk-aq1j9y18.js +0 -2
- package/bundle/chunk-aq8nz9hp.js +0 -2
- package/bundle/chunk-b4zy78be.js +0 -2
- package/bundle/chunk-basjzwqp.js +0 -2
- package/bundle/chunk-bhetpmgq.js +0 -3
- package/bundle/chunk-bm7xpjh6.js +0 -2
- package/bundle/chunk-c2k556rk.js +0 -2
- package/bundle/chunk-d41mg7at.js +0 -2
- package/bundle/chunk-d50kpss6.js +0 -2
- package/bundle/chunk-day0rb5p.js +0 -2
- package/bundle/chunk-dp7cww4v.js +0 -2
- package/bundle/chunk-e89zjjmj.js +0 -2
- package/bundle/chunk-egae7vvg.js +0 -2
- package/bundle/chunk-erdjd9w3.js +0 -2
- package/bundle/chunk-ex93y6dw.js +0 -2
- package/bundle/chunk-eyr0vf92.js +0 -2
- package/bundle/chunk-f1bcz9yz.js +0 -2
- package/bundle/chunk-fghqr4x8.js +0 -8
- package/bundle/chunk-fvkwcx35.js +0 -2
- package/bundle/chunk-fymt1rym.js +0 -5
- package/bundle/chunk-gbmmbhy4.js +0 -2
- package/bundle/chunk-gp877cq5.js +0 -2
- package/bundle/chunk-hk8vvc10.js +0 -2
- package/bundle/chunk-hwavzxdm.js +0 -2
- package/bundle/chunk-hwnc2sa5.js +0 -2
- package/bundle/chunk-j2gvpa15.js +0 -2
- package/bundle/chunk-j7n8khk7.js +0 -2
- package/bundle/chunk-jkh98wby.js +0 -2
- package/bundle/chunk-k5a652s4.js +0 -2
- package/bundle/chunk-k6w32q2p.js +0 -2
- package/bundle/chunk-ke5rqv5b.js +0 -2
- package/bundle/chunk-kghwk0yh.js +0 -2
- package/bundle/chunk-mgadsp7r.js +0 -2
- package/bundle/chunk-mk2s9py8.js +0 -2
- package/bundle/chunk-mxf9p0p9.js +0 -2
- package/bundle/chunk-n0k0pp4k.js +0 -2
- package/bundle/chunk-n393nnh5.js +0 -2
- package/bundle/chunk-n5vyed7w.js +0 -2
- package/bundle/chunk-nb86kh94.js +0 -7612
- package/bundle/chunk-nh044sjn.js +0 -2
- package/bundle/chunk-nm6wnne9.js +0 -3
- package/bundle/chunk-pasm65wq.js +0 -2
- package/bundle/chunk-pfh34atn.js +0 -2
- package/bundle/chunk-phpmxjf8.js +0 -2
- package/bundle/chunk-qvzvxsjw.js +0 -2
- package/bundle/chunk-qzszrd0s.js +0 -2
- package/bundle/chunk-rnq5ezrt.js +0 -2
- package/bundle/chunk-s7yza695.js +0 -2
- package/bundle/chunk-s99cvvc9.js +0 -2
- package/bundle/chunk-skpkjnyy.js +0 -2
- package/bundle/chunk-snt4kwab.js +0 -2
- package/bundle/chunk-sq47t8f1.js +0 -2
- package/bundle/chunk-sqhgnvvs.js +0 -2
- package/bundle/chunk-t114r59h.js +0 -2
- package/bundle/chunk-t1f56k0j.js +0 -2
- package/bundle/chunk-t69jx6fz.js +0 -2
- package/bundle/chunk-tce12v85.js +0 -3
- package/bundle/chunk-tq1dqhes.js +0 -2
- package/bundle/chunk-tsb3jsx4.js +0 -2
- package/bundle/chunk-ttpbpzbh.js +0 -2
- package/bundle/chunk-v667egp5.js +0 -2
- package/bundle/chunk-v7mg632n.js +0 -3
- package/bundle/chunk-x3afqfww.js +0 -4
- package/bundle/chunk-xwgc2pw7.js +0 -28
- package/bundle/chunk-xxrtr6sd.js +0 -2
- package/bundle/chunk-y8eggnrr.js +0 -2
- package/bundle/chunk-yck5h49c.js +0 -2
- package/bundle/chunk-yg0pfngv.js +0 -2
- package/bundle/chunk-yxeja9kg.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{uO as d3,wO as P5}from"./chunk-r9w0thdk.js";function R($,X,Y,J,Q){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!Q)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!Q:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?Q.call($,Y):Q?Q.value=Y:X.set($,Y),Y}function M($,X,Y,J){if(Y==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!J:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Y==="m"?J:Y==="a"?J.call($):J?J.value:X.get($)}var t4=function(){let{crypto:$}=globalThis;if($?.randomUUID)return t4=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),Y=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(J)=>(+J^Y()&15>>+J/4).toString(16))};function e$($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var M8=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};class f extends Error{}class X$ extends f{constructor($,X,Y,J){super(`${X$.makeMessage($,X,Y)}`);this.status=$,this.headers=J,this.requestID=J?.get("request-id"),this.error=X}static makeMessage($,X,Y){let J=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):Y;if($&&J)return`${$} ${J}`;if($)return`${$} status code (no body)`;if(J)return J;return"(no status code or body)"}static generate($,X,Y,J){if(!$||!J)return new f0({message:Y,cause:M8(X)});let Q=X;if($===400)return new E8($,Q,Y,J);if($===401)return new L8($,Q,Y,J);if($===403)return new Z8($,Q,Y,J);if($===404)return new S8($,Q,Y,J);if($===409)return new A8($,Q,Y,J);if($===422)return new C8($,Q,Y,J);if($===429)return new D8($,Q,Y,J);if($>=500)return new R8($,Q,Y,J);return new X$($,Q,Y,J)}}class q$ extends X${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class f0 extends X${constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}}class O8 extends f0{constructor({message:$}={}){super({message:$??"Request timed out."})}}class E8 extends X${}class L8 extends X${}class Z8 extends X${}class S8 extends X${}class A8 extends X${}class C8 extends X${}class D8 extends X${}class R8 extends X${}var o5=/^[a-z][a-z0-9+.-]*:/i,E7=($)=>{return o5.test($)},o4=($)=>(o4=Array.isArray,o4($)),e4=o4;function c6($){if(typeof $!=="object")return{};return $??{}}function L7($){if(!$)return!0;for(let X in $)return!1;return!0}function Z7($,X){return Object.prototype.hasOwnProperty.call($,X)}var S7=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new f(`${$} must be an integer`);if(X<0)throw new f(`${$} must be a positive integer`);return X};var l6=($)=>{try{return JSON.parse($)}catch(X){return}};var A7=($)=>new Promise((X)=>setTimeout(X,$));var w0="0.71.2";var T7=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"};function e5(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var $Y=()=>{let $=e5();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":w0,"X-Stainless-OS":D7(Deno.build.os),"X-Stainless-Arch":C7(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":w0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":w0,"X-Stainless-OS":D7(globalThis.process.platform??"unknown"),"X-Stainless-Arch":C7(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=XY();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":w0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":w0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function XY(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:X,pattern:Y}of $){let J=Y.exec(navigator.userAgent);if(J){let Q=J[1]||0,W=J[2]||0,z=J[3]||0;return{browser:X,version:`${Q}.${W}.${z}`}}}return null}var C7=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},D7=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},R7,_7=()=>{return R7??(R7=$Y())};function P7(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function $X(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function p6($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return $X({start(){},async pull(Y){let{done:J,value:Q}=await X.next();if(J)Y.close();else Y.enqueue(Q)},async cancel(){await X.return?.()}})}function T8($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let Y=await X.read();if(Y?.done)X.releaseLock();return Y}catch(Y){throw X.releaseLock(),Y}},async return(){let Y=X.cancel();return X.releaseLock(),await Y,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function j7($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),Y=X.cancel();X.releaseLock(),await Y}var k7=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function b7($){let X=0;for(let Q of $)X+=Q.length;let Y=new Uint8Array(X),J=0;for(let Q of $)Y.set(Q,J),J+=Q.length;return Y}var x7;function _8($){let X;return(x7??(X=new globalThis.TextEncoder,x7=X.encode.bind(X)))($)}var f7;function XX($){let X;return(f7??(X=new globalThis.TextDecoder,f7=X.decode.bind(X)))($)}var Z$,S$;class N0{constructor(){Z$.set(this,void 0),S$.set(this,void 0),R(this,Z$,new Uint8Array,"f"),R(this,S$,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?_8($):$;R(this,Z$,b7([M(this,Z$,"f"),X]),"f");let Y=[],J;while((J=QY(M(this,Z$,"f"),M(this,S$,"f")))!=null){if(J.carriage&&M(this,S$,"f")==null){R(this,S$,J.index,"f");continue}if(M(this,S$,"f")!=null&&(J.index!==M(this,S$,"f")+1||J.carriage)){Y.push(XX(M(this,Z$,"f").subarray(0,M(this,S$,"f")-1))),R(this,Z$,M(this,Z$,"f").subarray(M(this,S$,"f")),"f"),R(this,S$,null,"f");continue}let Q=M(this,S$,"f")!==null?J.preceding-1:J.preceding,W=XX(M(this,Z$,"f").subarray(0,Q));Y.push(W),R(this,Z$,M(this,Z$,"f").subarray(J.index),"f"),R(this,S$,null,"f")}return Y}flush(){if(!M(this,Z$,"f").length)return[];return this.decode(`
|
|
3
3
|
`)}}Z$=new WeakMap,S$=new WeakMap;N0.NEWLINE_CHARS=new Set([`
|
|
4
4
|
`,"\r"]);N0.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function QY($,X){for(let Q=X??0;Q<$.length;Q++){if($[Q]===10)return{preceding:Q,index:Q+1,carriage:!1};if($[Q]===13)return{preceding:Q,index:Q+1,carriage:!0}}return null}function I7($){for(let J=0;J<$.length-1;J++){if($[J]===10&&$[J+1]===10)return J+2;if($[J]===13&&$[J+1]===13)return J+2;if($[J]===13&&$[J+1]===10&&J+3<$.length&&$[J+2]===13&&$[J+3]===10)return J+4}return-1}var n6={off:0,error:200,warn:300,info:400,debug:500},YX=($,X,Y)=>{if(!$)return;if(Z7(n6,$))return $;G$(Y).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(n6))}`);return};function P8(){}function i6($,X,Y){if(!X||n6[$]>n6[Y])return P8;else return X[$].bind(X)}var WY={error:P8,warn:P8,info:P8,debug:P8},v7=new WeakMap;function G$($){let X=$.logger,Y=$.logLevel??"off";if(!X)return WY;let J=v7.get(X);if(J&&J[0]===Y)return J[1];let Q={error:i6("error",X,Y),warn:i6("warn",X,Y),info:i6("info",X,Y),debug:i6("debug",X,Y)};return v7.set(X,[Y,Q]),Q}var $0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,Y])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":Y]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var j8;class A${constructor($,X,Y){this.iterator=$,j8.set(this,void 0),this.controller=X,R(this,j8,Y,"f")}static fromSSEResponse($,X,Y){let J=!1,Q=Y?G$(Y):console;async function*W(){if(J)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");J=!0;let z=!1;try{for await(let G of zY($,X)){if(G.event==="completion")try{yield JSON.parse(G.data)}catch(V){throw Q.error("Could not parse message into JSON:",G.data),Q.error("From chunk:",G.raw),V}if(G.event==="message_start"||G.event==="message_delta"||G.event==="message_stop"||G.event==="content_block_start"||G.event==="content_block_delta"||G.event==="content_block_stop")try{yield JSON.parse(G.data)}catch(V){throw Q.error("Could not parse message into JSON:",G.data),Q.error("From chunk:",G.raw),V}if(G.event==="ping")continue;if(G.event==="error")throw new X$(void 0,l6(G.data)??G.data,void 0,$.headers)}z=!0}catch(G){if(e$(G))return;throw G}finally{if(!z)X.abort()}}return new A$(W,X,Y)}static fromReadableStream($,X,Y){let J=!1;async function*Q(){let z=new N0,G=T8($);for await(let V of G)for(let H of z.decode(V))yield H;for(let V of z.flush())yield V}async function*W(){if(J)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");J=!0;let z=!1;try{for await(let G of Q()){if(z)continue;if(G)yield JSON.parse(G)}z=!0}catch(G){if(e$(G))return;throw G}finally{if(!z)X.abort()}}return new A$(W,X,Y)}[(j8=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],X=[],Y=this.iterator(),J=(Q)=>{return{next:()=>{if(Q.length===0){let W=Y.next();$.push(W),X.push(W)}return Q.shift()}}};return[new A$(()=>J($),this.controller,M(this,j8,"f")),new A$(()=>J(X),this.controller,M(this,j8,"f"))]}toReadableStream(){let $=this,X;return $X({async start(){X=$[Symbol.asyncIterator]()},async pull(Y){try{let{value:J,done:Q}=await X.next();if(Q)return Y.close();let W=_8(JSON.stringify(J)+`
|
|
5
5
|
`);Y.enqueue(W)}catch(J){Y.error(J)}},async cancel(){await X.return?.()}})}}async function*zY($,X){if(!$.body){if(X.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new f("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new f("Attempted to iterate over a response with no body")}let Y=new y7,J=new N0,Q=T8($.body);for await(let W of GY(Q))for(let z of J.decode(W)){let G=Y.decode(z);if(G)yield G}for(let W of J.flush()){let z=Y.decode(W);if(z)yield z}}async function*GY($){let X=new Uint8Array;for await(let Y of $){if(Y==null)continue;let J=Y instanceof ArrayBuffer?new Uint8Array(Y):typeof Y==="string"?_8(Y):Y,Q=new Uint8Array(X.length+J.length);Q.set(X),Q.set(J,X.length),X=Q;let W;while((W=I7(X))!==-1)yield X.slice(0,W),X=X.slice(W)}if(X.length>0)yield X}class y7{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let Q={event:this.event,data:this.data.join(`
|
|
@@ -99,4 +99,4 @@ ${Q.content}`:Q.content;continue}if(Q.role==="user"){let W=[];for(let z of Q.con
|
|
|
99
99
|
`,wW=600000,d5=class{config;fetchFn;cache=new Map;constructor($){this.config=$,this.fetchFn=$.fetch??fetch}async discover($){let X=this.cache.get($);if(X&&X.expiresAt>Date.now())return X.data;let Y=`${this.config.instanceUrl}/api/graphql`;try{let J=await this.fetchFn(Y,{method:"POST",headers:{...this.config.getHeaders(),"Content-Type":"application/json"},body:JSON.stringify({query:qW,variables:{rootNamespaceId:$}})});if(!J.ok){let H=await J.text();throw new x({message:`Model discovery GraphQL request failed: ${J.status} ${J.statusText} - ${H}`,statusCode:J.status,responseBody:H})}let Q=await J.json();if(Q.errors&&Q.errors.length>0)throw new x({message:`Model discovery GraphQL errors: ${Q.errors.map((H)=>H.message).join(", ")}`});let W=Q.data?.aiChatAvailableModels,z=Q.data?.metadata,G=z?.featureFlags?.find((H)=>H.name==="ai_user_model_switching")?.enabled??!1,V={defaultModel:W?.defaultModel??null,selectableModels:W?.selectableModels??[],pinnedModel:W?.pinnedModel??null,modelSwitchingEnabled:G,instanceVersion:z?.version??null};return this.cache.set($,{data:V,expiresAt:Date.now()+wW}),V}catch(J){if(J instanceof x)throw J;throw new x({message:`Model discovery failed: ${J}`,cause:J})}}async getEffectiveModelRef($,X){let Y=await this.discover($);if(Y.pinnedModel)return Y.pinnedModel.ref;if(X&&Y.modelSwitchingEnabled){if(Y.selectableModels.some((Q)=>Q.ref===X))return X}return Y.defaultModel?.ref??null}invalidateCache(){this.cache.clear()}},NW=600000;function UW(){let $=process.env.XDG_CACHE_HOME||h6.join(c5.homedir(),".cache");return h6.join($,"opencode","gitlab-workflow-model-cache.json")}function FW($,X){let Y=(X||"https://gitlab.com").replace(/\/$/,"");return l5.createHash("sha256").update(`${$}\x00${Y}`).digest("hex").slice(0,12)}var p5=class{filePath;key;constructor($,X){this.filePath=UW(),this.key=FW($,X)}readAll(){try{if(!u$.existsSync(this.filePath))return{};let $=u$.readFileSync(this.filePath,"utf-8");return JSON.parse($)}catch{return{}}}writeAll($){try{let X=h6.dirname(this.filePath);u$.mkdirSync(X,{recursive:!0,mode:448}),u$.writeFileSync(this.filePath,JSON.stringify($,null,2),{mode:384})}catch{}}load(){return this.readAll()[this.key]??null}save($){let X=this.readAll();X[this.key]=$,this.writeAll(X)}isDiscoveryExpired(){let $=this.load();if(!$?.discovery||!$.updatedAt)return!0;return Date.now()-new Date($.updatedAt).getTime()>NW}saveDiscovery($,X){let Y=this.load();this.save({discovery:$,project:X!==void 0?X:Y?.project??null,selectedModelRef:Y?.selectedModelRef??null,selectedModelName:Y?.selectedModelName??null,updatedAt:new Date().toISOString()})}saveSelection($,X){let Y=this.load(),J=X;if(!J&&$&&Y?.discovery){let Q=Y.discovery;J=(Q.pinnedModel?.ref===$?Q.pinnedModel:Q.selectableModels.find((z)=>z.ref===$)??(Q.defaultModel?.ref===$?Q.defaultModel:null))?.name??null}this.save({discovery:Y?.discovery??null,project:Y?.project??null,selectedModelRef:$,selectedModelName:J,updatedAt:new Date().toISOString()})}clear(){let $=this.readAll();if(delete $[this.key],Object.keys($).length===0)try{if(u$.existsSync(this.filePath))u$.unlinkSync(this.filePath)}catch{}else this.writeAll($)}getSelectedModelRef(){return this.load()?.selectedModelRef??null}getSelectedModelName(){return this.load()?.selectedModelName??null}getDiscovery(){return this.load()?.discovery??null}};function B7($){if(!$||typeof $!=="object")return $;let X={};for(let[Y,J]of Object.entries($)){if(Y==="description"||Y==="examples"||Y==="default")continue;if(Y==="properties"&&typeof J==="object"&&J!==null){let Q={};for(let[W,z]of Object.entries(J))if(typeof z==="object"&&z!==null)Q[W]=B7(z);else Q[W]=z;X[Y]=Q}else if(Y==="items"&&typeof J==="object"&&J!==null)X[Y]=B7(J);else X[Y]=J}return X}function MW($){try{return JSON.stringify(B7(JSON.parse($)))}catch{return $}}function OW($){if(!$||typeof $!=="object")return $;let X={type:$.type||"object"};if($.required)X.required=$.required;if($.properties&&typeof $.properties==="object"){let Y={};for(let[J,Q]of Object.entries($.properties))if(typeof Q==="object"&&Q!==null){let W=Q;Y[J]={type:W.type||"string"}}else Y[J]={type:"string"};X.properties=Y}return X}function EW($){try{return JSON.stringify(OW(JSON.parse($)))}catch{return $}}var LW=class ${specificationVersion="v3";modelId;supportedUrls={};config;workflowOptions;tokenClient;projectDetector;modelDiscovery;modelCache;detectedProjectPath=null;sessionWorkflows=new Map;currentWorkflowId=null;currentWorkflowDefinition=null;persistedAgentEmitted=new Map;activeClients=new Set;_selectedModelRef;_selectedModelName;_rootNamespaceId;_discoveryPromise;get selectedModelRef(){return this._selectedModelRef??null}set selectedModelRef(X){this._selectedModelRef=X??void 0,this._selectedModelName=void 0,this.modelCache.saveSelection(X,null)}get selectedModelName(){return this._selectedModelName??null}set selectedModelName(X){this._selectedModelName=X??void 0,this.modelCache.saveSelection(this._selectedModelRef??null,X)}_toolExecutor=null;onUsageUpdate=null;sessionPreapprovedTools=[];sessionID="";set approvalHandler(X){this.workflowOptions.approvalHandler=X??void 0}get approvalHandler(){return this.workflowOptions.approvalHandler??null}onSelectModel=null;set systemPrompt(X){this.workflowOptions.systemPrompt=X??void 0}get systemPrompt(){return this.workflowOptions.systemPrompt??null}get toolExecutor(){return this._toolExecutor}set toolExecutor(X){if(X)try{let{AsyncResource:Y}=N7("async_hooks");this._toolExecutor=Y.bind(X)}catch{this._toolExecutor=X}else this._toolExecutor=null}constructor(X,Y,J={}){this.modelId=X,this.config=Y,this.workflowOptions=J;let Q=J.workingDirectory??process.cwd();this.modelCache=new p5(Q,Y.instanceUrl);let W=this.modelCache.load();if(W?.selectedModelRef)this._selectedModelRef=W.selectedModelRef;if(W?.selectedModelName)this._selectedModelName=W.selectedModelName;this.tokenClient=new HW({instanceUrl:Y.instanceUrl,getHeaders:Y.getHeaders,refreshApiKey:Y.refreshApiKey,fetch:Y.fetch,featureFlags:Y.featureFlags}),this.projectDetector=new u5({instanceUrl:Y.instanceUrl,getHeaders:Y.getHeaders,fetch:Y.fetch}),this.modelDiscovery=new d5({instanceUrl:Y.instanceUrl,getHeaders:Y.getHeaders,fetch:Y.fetch})}get provider(){return this.config.provider}async resolveProjectId(){if(this.workflowOptions.projectId)return this.workflowOptions.projectId;if(this.detectedProjectPath)return this.detectedProjectPath;let X=this.workflowOptions.workingDirectory??process.cwd(),Y=await this.projectDetector.detectProject(X);if(Y)return this.detectedProjectPath=Y.pathWithNamespace,Y.pathWithNamespace;return}async resolveRootNamespaceId(){if(this.workflowOptions.rootNamespaceId)return this.workflowOptions.rootNamespaceId;if(this._rootNamespaceId!==void 0)return this._rootNamespaceId;let X=this.workflowOptions.workingDirectory??process.cwd(),Y=await this.projectDetector.detectProject(X);if(Y?.namespaceId){let J=`gid://gitlab/Group/${Y.namespaceId}`;return this._rootNamespaceId=J,J}return this._rootNamespaceId=null,null}async resolveModelRef(){let X=sQ(this.modelId);if(this.modelId!=="duo-workflow")return X??"default";if(this._selectedModelRef)return this._selectedModelRef;if(!this._discoveryPromise)this._discoveryPromise=this.doResolveModelRef(),this._discoveryPromise.finally(()=>{this._discoveryPromise=void 0});return this._discoveryPromise}async doResolveModelRef(){let X=await this.resolveRootNamespaceId();if(!X)return this._selectedModelRef="default","default";try{let Y=await this.modelDiscovery.discover(X);if(this.modelCache.saveDiscovery(Y),Y.pinnedModel)return this._selectedModelRef=Y.pinnedModel.ref,this._selectedModelName=Y.pinnedModel.name,this.modelCache.saveSelection(Y.pinnedModel.ref,Y.pinnedModel.name),Y.pinnedModel.ref;let J=this.onSelectModel??this.workflowOptions.onSelectModel;if(Y.selectableModels.length>0&&J){let Q=await J(Y.selectableModels);if(Q){let W=Y.selectableModels.find((z)=>z.ref===Q);if(W)return this._selectedModelRef=W.ref,this._selectedModelName=W.name,this.modelCache.saveSelection(W.ref,W.name),W.ref}}if(Y.defaultModel)return this._selectedModelRef=Y.defaultModel.ref,this._selectedModelName=Y.defaultModel.name,this.modelCache.saveSelection(Y.defaultModel.ref,Y.defaultModel.name),Y.defaultModel.ref}catch{let Y=this.modelCache.load();if(Y?.selectedModelRef)return this._selectedModelRef=Y.selectedModelRef,this._selectedModelName=Y.selectedModelName??void 0,Y.selectedModelRef}return this._selectedModelRef="default","default"}async discoverModels(X){let Y=await this.modelDiscovery.discover(X);return this.modelCache.saveDiscovery(Y),Y}getModelCache(){return this.modelCache}stopWorkflow(){for(let X of this.activeClients)if(X.isConnected)X.stop()}resetWorkflow(X){if(X)this.sessionWorkflows.delete(X);else this.sessionWorkflows.clear(),this.currentWorkflowId=null,this.persistedAgentEmitted.clear()}get workflowId(){return this.currentWorkflowId}createUsage(X){return{inputTokens:{total:X?.inputTotal,noCache:X?.inputTotal,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X?.outputTotal,text:X?.outputTotal,reasoning:void 0}}}createFinishReason(X,Y){return{unified:X,raw:Y}}async doGenerate(X){let{stream:Y}=await this.doStream(X),J=Y.getReader(),Q=[],W=[],z={unified:"other",raw:void 0},G=this.createUsage();try{while(!0){let{done:q,value:w}=await J.read();if(q)break;switch(w.type){case"text-delta":Q.push(w.delta);break;case"tool-call":W.push({type:"tool-call",toolCallId:w.toolCallId,toolName:w.toolName,input:w.input});break;case"finish":if(z=w.finishReason,w.usage)G=w.usage;break;case"error":throw w.error}}}finally{J.releaseLock()}let V=[],H=Q.join("");if(H)V.push({type:"text",text:H});return V.push(...W),{content:V,finishReason:z,usage:G,warnings:[]}}async doStream(X){let Y=this.extractGoalFromPrompt(X.prompt),J=await this.resolveModelRef(),Q=this.extractMcpTools(X),W=[...this.workflowOptions.preapprovedTools??Q.map((a)=>a.name),...this.sessionPreapprovedTools],z=this.buildAdditionalContext(X.prompt),G=this.toolExecutor??null,V=new Set(X.tools?.map((a)=>a.name)??[]),H=X.providerOptions?.gitlab,q=H?.workflowDefinition??this.workflowOptions.workflowDefinition,w=H?.flowConfig??void 0,B=H?.flowConfigSchemaVersion??void 0,U=H?.aiCatalogItemVersionId??void 0;await this.tokenClient.getToken(q??y6,this.workflowOptions.rootNamespaceId);let O=await this.resolveProjectId(),P=w??q??y6,j=this.sessionID,L=this.sessionWorkflows.get(j);if(L&&L.workflowDefinition!==P)this.sessionWorkflows.delete(j),L=void 0;let A=j==="";if(A&&this.currentWorkflowId&&this.currentWorkflowDefinition!==P)this.currentWorkflowId=null,this.currentWorkflowDefinition=null;let E;if(L)E=L.workflowId;else if(A&&this.currentWorkflowId)E=this.currentWorkflowId;else if(E=await this.tokenClient.createWorkflow(Y,{projectId:O,namespaceId:this.workflowOptions.namespaceId,workflowDefinition:q,agentPrivileges:this.workflowOptions.agentPrivileges,aiCatalogItemVersionId:U}),A)this.currentWorkflowId=E,this.currentWorkflowDefinition=P;else this.sessionWorkflows.set(j,{workflowId:E,workflowDefinition:P,agentEmitted:new Map,toolEntries:new Set}),L=this.sessionWorkflows.get(j);let _=new x5;this.activeClients.add(_);let c=0,n={streamClosed:!1,streamedInputChars:0,streamedOutputChars:0,pendingToolCount:0,approvalPending:!1,deferredClose:null,activeTextBlockId:null,agentMessageEmitted:new Map(L?.agentEmitted??this.persistedAgentEmitted),currentAgentMessageId:"",activeClient:_,processedRequestIDs:new Set,emittedToolEntries:new Set(L?.toolEntries),emittedToolKeys:new Set,sessionKey:j};for(let a of X.prompt)if(a.role==="system")n.streamedInputChars+=a.content.length;else if(a.role==="user"){for(let u of a.content)if(u.type==="text")n.streamedInputChars+=u.text.length}let p;return{stream:new ReadableStream({start:async(a)=>{try{await _.connect({instanceUrl:this.config.instanceUrl,modelRef:J,headers:this.config.getHeaders(),projectId:this.workflowOptions.projectId,namespaceId:this.workflowOptions.namespaceId,rootNamespaceId:this.workflowOptions.rootNamespaceId,aiCatalogItemVersionId:U,workflowDefinition:q??this.workflowOptions.workflowDefinition},(s4)=>{this.handleWorkflowEvent(n,s4,a,_,G,()=>`text-${c++}`,V,p,{aiCatalogItemVersionId:U,workflowDefinition:q??this.workflowOptions.workflowDefinition})});let u=q??y6,x$=this.workflowOptions.clientCapabilities??$W,u6=await this.buildWorkflowMetadata(),w2=JSON.stringify(u6),d6=JSON.stringify({workflowID:E,clientVersion:K7,workflowDefinition:u,goal:Y,workflowMetadata:w2,clientCapabilities:x$,preapproved_tools:W}).length+100,r4=this.trimPayload(Q,z,d6),r5=W.filter((s4)=>r4.mcpTools.some((s5)=>s5.name===s4));p={workflowID:E,clientVersion:K7,workflowDefinition:u,goal:Y,workflowMetadata:w2,additional_context:r4.additionalContext,clientCapabilities:x$,mcpTools:r4.mcpTools,preapproved_tools:r5};let M7=w??this.workflowOptions.flowConfig,O7=B??this.workflowOptions.flowConfigSchemaVersion;if(M7)p.flowConfig=M7;if(O7)p.flowConfigSchemaVersion=O7;else if(p.flowConfig)p.flowConfigSchemaVersion="v1";_.sendStartRequest(p),a.enqueue({type:"stream-start",warnings:[]}),a.enqueue({type:"response-metadata",id:E,modelId:J})}catch(u){if(!n.streamClosed)a.enqueue({type:"error",error:u instanceof x?u:new x({message:`Workflow connection failed: ${u}`,cause:u})}),n.streamClosed=!0,a.close()}},cancel:(a)=>{if(_.stop(),_.close(),this.activeClients.delete(_),n.activeClient=null,!n.streamClosed)if(n.sessionKey)this.sessionWorkflows.delete(n.sessionKey);else this.currentWorkflowId=null}}),request:{body:{workflowId:E,modelRef:J,goal:Y}}}}handleWorkflowEvent(X,Y,J,Q,W,z,G,V,H){if(X.streamClosed)return;switch(Y.type){case"checkpoint":{this.processCheckpoint(X,Y.data,J,z);break}case"tool-request":{let{requestID:q,data:w}=Y;if(X.processedRequestIDs.has(q))break;X.processedRequestIDs.add(q),X.emittedToolKeys.add(w.name);let B;try{JSON.parse(w.args),B=w.args}catch{B=w.args||"{}"}if(X.activeTextBlockId)J.enqueue({type:"text-end",id:X.activeTextBlockId}),X.activeTextBlockId=null;J.enqueue({type:"tool-input-start",id:q,toolName:w.name,providerExecuted:!0}),J.enqueue({type:"tool-input-delta",id:q,delta:B}),J.enqueue({type:"tool-input-end",id:q}),J.enqueue({type:"tool-call",toolCallId:q,toolName:w.name,input:B,providerExecuted:!0}),this.executeToolAndRespond(X,Q,J,q,w.name,B,W).catch(()=>{});break}case"builtin-tool-request":{if(X.processedRequestIDs.has(Y.requestID))break;X.processedRequestIDs.add(Y.requestID);let q=WW(Y.toolName,Y.data,G);X.emittedToolKeys.add(q.toolName);let w=JSON.stringify(q.args);if(X.activeTextBlockId)J.enqueue({type:"text-end",id:X.activeTextBlockId}),X.activeTextBlockId=null;J.enqueue({type:"tool-input-start",id:Y.requestID,toolName:q.toolName,providerExecuted:!0}),J.enqueue({type:"tool-input-delta",id:Y.requestID,delta:w}),J.enqueue({type:"tool-input-end",id:Y.requestID}),J.enqueue({type:"tool-call",toolCallId:Y.requestID,toolName:q.toolName,input:w,providerExecuted:!0}),this.executeToolAndRespond(X,Q,J,Y.requestID,q.toolName,w,W).catch(()=>{});break}case"approval-required":{X.approvalPending=!0,this.approveAndResume(X,Y.tools,V,J,W,z,G,H).catch((q)=>{if(X.approvalPending=!1,X.deferredClose){let w=X.deferredClose;X.deferredClose=null,w()}});break}case"completed":{if(X.activeTextBlockId)J.enqueue({type:"text-end",id:X.activeTextBlockId}),X.activeTextBlockId=null;let q=()=>{if(X.streamClosed)return;let w=Math.ceil(X.streamedInputChars/4),B=Math.ceil(X.streamedOutputChars/4);J.enqueue({type:"finish",finishReason:this.createFinishReason("stop","completed"),usage:this.createUsage({inputTotal:w,outputTotal:B})}),X.streamClosed=!0,J.close(),this.cleanupClient(X,!1)};if(X.pendingToolCount>0||X.approvalPending)X.deferredClose=q;else X.deferredClose=null,q();break}case"failed":{if(X.activeTextBlockId)J.enqueue({type:"text-end",id:X.activeTextBlockId}),X.activeTextBlockId=null;J.enqueue({type:"error",error:new x({message:`Workflow failed: ${g6(Y.error.message)}`,cause:Y.error})}),X.streamClosed=!0,J.close(),this.cleanupClient(X,!0);break}case"closed":{if(X.streamClosed)break;if(X.activeTextBlockId)J.enqueue({type:"text-end",id:X.activeTextBlockId}),X.activeTextBlockId=null;let q=()=>{if(X.streamClosed)return;if(Y.code!==1000)J.enqueue({type:"error",error:new x({message:`WebSocket closed unexpectedly: code=${Y.code} reason=${g6(Y.reason)}`,statusCode:Y.code})}),X.streamClosed=!0,J.close(),this.cleanupClient(X,!0);else{let w=Math.ceil(X.streamedInputChars/4),B=Math.ceil(X.streamedOutputChars/4);J.enqueue({type:"finish",finishReason:this.createFinishReason("stop","closed"),usage:this.createUsage({inputTotal:w,outputTotal:B})}),X.streamClosed=!0,J.close(),this.cleanupClient(X,!1)}};if(X.pendingToolCount>0||X.approvalPending)X.deferredClose=q;else X.deferredClose=null,q();break}}}processCheckpoint(X,Y,J,Q){if(!Y.checkpoint){if(Y.content){if(!X.activeTextBlockId)X.activeTextBlockId=Q(),J.enqueue({type:"text-start",id:X.activeTextBlockId});J.enqueue({type:"text-delta",id:X.activeTextBlockId,delta:Y.content}),X.streamedOutputChars+=Y.content.length}return}let W;try{W=JSON.parse(Y.checkpoint)}catch(G){return}let z=W.channel_values?.ui_chat_log;if(!z||!Array.isArray(z)||z.length===0)return;if(Y.status!=="RUNNING"&&Y.status!=="INPUT_REQUIRED"&&Y.status!=="FINISHED"&&Y.status!=="COMPLETED"&&Y.status!=="TOOL_CALL_APPROVAL_REQUIRED")return;for(let G=0;G<z.length;G++){let V=z[G];if(V.message_type==="tool"&&V.tool_info){let P=V.message_id||V.correlation_id||`tool-${G}`;if(X.emittedToolEntries.has(P))continue;let j=V.tool_info.name,L=JSON.stringify(V.tool_info.args??{});if(X.emittedToolKeys.has(j)){X.emittedToolEntries.add(P);let c=this.sessionWorkflows.get(X.sessionKey);if(c)c.toolEntries.add(P);continue}if(X.activeTextBlockId)J.enqueue({type:"text-end",id:X.activeTextBlockId}),X.activeTextBlockId=null;J.enqueue({type:"tool-input-start",id:P,toolName:j,providerExecuted:!0}),J.enqueue({type:"tool-input-delta",id:P,delta:L}),J.enqueue({type:"tool-input-end",id:P}),J.enqueue({type:"tool-call",toolCallId:P,toolName:j,input:L,providerExecuted:!0,dynamic:!0});let A=V.tool_info.tool_response,E=typeof A==="string"?A:A?A.content:V.content||"";J.enqueue({type:"tool-result",toolCallId:P,toolName:j,result:{output:E,title:j,metadata:{}},isError:!1}),X.emittedToolEntries.add(P);let _=this.sessionWorkflows.get(X.sessionKey);if(_)_.toolEntries.add(P);continue}if(V.message_type!=="agent")continue;let H=V.content||"",q=V.message_id||`idx-${G}`,w=X.agentMessageEmitted.get(q)??0;if(H.length<=w)continue;let B=H.slice(w);if(q!==X.currentAgentMessageId&&X.activeTextBlockId)J.enqueue({type:"text-end",id:X.activeTextBlockId}),X.activeTextBlockId=null;if(!X.activeTextBlockId)X.activeTextBlockId=Q(),J.enqueue({type:"text-start",id:X.activeTextBlockId});J.enqueue({type:"text-delta",id:X.activeTextBlockId,delta:B}),X.streamedOutputChars+=B.length,X.agentMessageEmitted.set(q,H.length),(this.sessionWorkflows.get(X.sessionKey)?.agentEmitted??this.persistedAgentEmitted).set(q,H.length),X.currentAgentMessageId=q}}async executeToolAndRespond(X,Y,J,Q,W,z,G){X.pendingToolCount++;let V=(H)=>{if(X.streamClosed)return;try{J.enqueue(H)}catch{}};try{if(G){let H=await G(W,z,Q);if(H.error&&/^Unknown tool:/.test(H.error)){let U=zW(W,z);if(U)H=U}Y.sendActionResponse(Q,H.result,H.error),X.streamedInputChars+=z.length,X.streamedOutputChars+=H.result.length;let q=H.result,w=H.title??`${W} result`,B=H.metadata??{output:H.result};if(H.error){let U;if(typeof H.error==="string")U=H.error;else if(H.error&&typeof H.error==="object")U=JSON.stringify(H.error);else U=String(H.error);V({type:"tool-result",toolCallId:Q,toolName:W,result:U,isError:!0})}else V({type:"tool-result",toolCallId:Q,toolName:W,result:{output:q,title:w,metadata:B},isError:!1})}else{let H=`Tool executor not configured for tool: ${W}`;Y.sendActionResponse(Q,"",H),V({type:"tool-result",toolCallId:Q,toolName:W,result:H,isError:!0})}}catch(H){let q=H instanceof Error?H.message:String(H),w=g6(q);Y.sendActionResponse(Q,"",w),V({type:"tool-result",toolCallId:Q,toolName:W,result:w,isError:!0})}finally{if(X.pendingToolCount--,this.onUsageUpdate)try{this.onUsageUpdate({inputTokens:Math.ceil(X.streamedInputChars/4),outputTokens:Math.ceil(X.streamedOutputChars/4)})}catch{}if(X.pendingToolCount<=0&&X.deferredClose){let H=X.deferredClose;X.deferredClose=null,H()}}}cleanupClient(X,Y=!1){if(X.activeClient)X.activeClient.close(),this.activeClients.delete(X.activeClient),X.activeClient=null;if(Y)if(X.sessionKey)this.sessionWorkflows.delete(X.sessionKey);else this.currentWorkflowId=null,this.persistedAgentEmitted.clear()}async approveAndResume(X,Y,J,Q,W,z,G,V){let H=this.workflowOptions.approvalHandler;if(!H||!J){if(X.approvalPending=!1,X.deferredClose){let P=X.deferredClose;X.deferredClose=null,P()}return}let q;try{q=await H(Y)}catch(P){if(X.approvalPending=!1,!X.streamClosed)Q.error(P);return}X.approvalPending=!1,X.deferredClose=null,this.cleanupClient(X,!1);let w=q.approved?{approval:{tool_name:Y[0]?.name,tool_args_json:Y[0]?.args}}:{rejection:{message:q.message??"User rejected"}},B={...J,approval:w,preapproved_tools:q.approved?[...J.preapproved_tools??[],...Y.map((P)=>P.name)]:J.preapproved_tools??[]},U=new x5;this.activeClients.add(U),X.activeClient=U;let O=await this.resolveModelRef();try{await U.connect({instanceUrl:this.config.instanceUrl,modelRef:O,headers:this.config.getHeaders(),projectId:this.workflowOptions.projectId,namespaceId:this.workflowOptions.namespaceId,rootNamespaceId:this.workflowOptions.rootNamespaceId,aiCatalogItemVersionId:V?.aiCatalogItemVersionId,workflowDefinition:V?.workflowDefinition},(P)=>this.handleWorkflowEvent(X,P,Q,U,W,z,G,B,V)),U.sendStartRequest(B)}catch(P){if(this.cleanupClient(X,!0),!X.streamClosed)Q.error(P)}}async buildWorkflowMetadata(){let X={extended_logging:!1,tool_approval_for_session_enabled:!0};try{let Y=this.workflowOptions.workingDirectory??process.cwd(),J=await this.getGitInfo(Y);if(J.url)X.git_url=J.url;if(J.sha)X.git_sha=J.sha;if(J.branch)X.git_branch=J.branch}catch{}return X}async getGitInfo(X){let{execFile:Y}=await import("child_process"),{promisify:J}=await import("util"),Q=J(Y),W={cwd:X,timeout:3000},z=async(q,w)=>{try{let{stdout:B}=await Q(q,w,W);return B.trim()||void 0}catch{return}},[G,V,H]=await Promise.all([z("git",["remote","get-url","origin"]),z("git",["rev-parse","HEAD"]),z("git",["rev-parse","--abbrev-ref","HEAD"])]);return{url:G,sha:V,branch:H}}static SYSTEM_REMINDER_RE=/<system-reminder>([\s\S]*?)<\/system-reminder>/g;extractGoalFromPrompt(X){for(let Y=X.length-1;Y>=0;Y--){let J=X[Y];if(J.role==="user"){let Q=J.content.filter((W)=>W.type==="text").map((W)=>W.text);if(Q.length>0){let W=Q.join(`
|
|
100
100
|
`);return W.replace($.SYSTEM_REMINDER_RE,"").trim()||W}}}return""}extractMcpTools(X){if(this.workflowOptions.mcpTools&&this.workflowOptions.mcpTools.length>0)return this.workflowOptions.mcpTools;if(!X.tools||X.tools.length===0)return[];return X.tools.filter((Y)=>Y.type==="function").map((Y)=>({name:Y.name,description:Y.description||"",inputSchema:JSON.stringify(Y.inputSchema||{type:"object",properties:{}})}))}static MAX_START_REQUEST_BYTES=4194304;trimPayload(X,Y,J){let Q=$.MAX_START_REQUEST_BYTES-J,W=JSON.stringify(Y);if(JSON.stringify(X).length+W.length<=Q)return{mcpTools:X,additionalContext:Y};let V=X.map((U)=>({name:U.name,description:U.description,inputSchema:MW(U.inputSchema)}));if(JSON.stringify(V).length+W.length<=Q)return{mcpTools:V,additionalContext:Y};let q=V.map((U)=>({name:U.name,description:U.description,inputSchema:EW(U.inputSchema)}));if(JSON.stringify(q).length+W.length<=Q)return{mcpTools:q,additionalContext:Y};let B=[...q];while(B.length>0){if(JSON.stringify(B).length+W.length<=Q)break;B.pop()}return{mcpTools:B,additionalContext:Y}}buildAdditionalContext(X){let Y=[];if(this.workflowOptions.additionalContext)Y.push(...this.workflowOptions.additionalContext);for(let J of X)if(J.role==="system")Y.push({category:"system_prompt",content:J.content,metadata:JSON.stringify({role:"system"})});else if(J.role==="assistant"){let Q=J.content.filter((W)=>W.type==="text").map((W)=>W.text).join(`
|
|
101
101
|
`);if(Q)Y.push({category:"conversation",content:Q,metadata:JSON.stringify({role:"assistant"})})}else if(J.role==="user"){for(let Q of J.content)if(Q.type==="text"){let z=Q.text.matchAll($.SYSTEM_REMINDER_RE);for(let G of z){let V=G[1].trim();if(V)Y.push({category:"agent_context",content:V,metadata:JSON.stringify({source:"system-reminder"})})}}}return Y}},ZW="1d89f9fdb23ee96d4e603201f6861dab6e143c5c3c00469a018a2d94bdc03d4e",vE="36f2a70cddeb5a0889d4fd8295c241b7e9848e89cf9e599d0eed2d8e5350fbf5",SW="https://gitlab.com",AW=300000,yE=["api"],CW=class{fetch;constructor($=fetch){this.fetch=$}isTokenExpired($){return Date.now()>=$}needsRefresh($){return Date.now()>=$-AW}async refreshIfNeeded($,X){if(!this.needsRefresh($.expiresAt))return $;if(this.isTokenExpired($.expiresAt))throw new x({message:"OAuth token has expired and cannot be used"});return this.exchangeRefreshToken({instanceUrl:$.instanceUrl,refreshToken:$.refreshToken,clientId:X})}async exchangeAuthorizationCode($){let{instanceUrl:X,code:Y,codeVerifier:J,clientId:Q,redirectUri:W}=$,z=await this.exchangeToken({instanceUrl:X,grantType:"authorization_code",code:Y,codeVerifier:J,clientId:Q||this.getClientId(X),redirectUri:W});return this.createTokensFromResponse(z,X)}async exchangeRefreshToken($){let{instanceUrl:X,refreshToken:Y,clientId:J}=$,Q=await this.exchangeToken({instanceUrl:X,grantType:"refresh_token",refreshToken:Y,clientId:J||this.getClientId(X)});return this.createTokensFromResponse(Q,X)}getClientId($){let X=process.env.GITLAB_OAUTH_CLIENT_ID;if(X)return X;if($===SW)return ZW;throw new x({message:`No OAuth client ID configured for instance ${$}. Please provide a clientId parameter or set GITLAB_OAUTH_CLIENT_ID environment variable.`})}async exchangeToken($){let{instanceUrl:X,grantType:Y,code:J,codeVerifier:Q,refreshToken:W,clientId:z,redirectUri:G}=$,V={client_id:z,grant_type:Y};if(Y==="authorization_code"){if(!J||!Q||!G)throw new x({message:"Authorization code, code verifier, and redirect URI are required for authorization_code grant"});V.code=J,V.code_verifier=Q,V.redirect_uri=G}else if(Y==="refresh_token"){if(!W)throw new x({message:"Refresh token is required for refresh_token grant"});V.refresh_token=W}let H=`${X}/oauth/token`;try{let q=await this.fetch(H,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(V).toString()});if(!q.ok){let B=await q.text();throw new x({message:`OAuth token exchange failed: ${q.status} ${q.statusText}`,cause:Error(B)})}return await q.json()}catch(q){if(q instanceof x)throw q;throw new x({message:`Failed to exchange OAuth token: ${q instanceof Error?q.message:String(q)}`,cause:q instanceof Error?q:void 0})}}createTokensFromResponse($,X){let Y=this.createExpiresTimestamp($);return{accessToken:$.access_token,refreshToken:$.refresh_token||"",expiresAt:Y,instanceUrl:X}}createExpiresTimestamp($){let X=$.created_at*1000,Y=$.expires_in*1000;return X+Y}};function n5(){let $=i5.homedir(),X=process.env.XDG_DATA_HOME;if(X)return a4.join(X,"opencode","auth.json");if(process.platform!=="win32")return a4.join($,".local","share","opencode","auth.json");return a4.join($,".opencode","auth.json")}async function DW($){try{let X=n5();if(!q2.existsSync(X))return;let Y=JSON.parse(q2.readFileSync(X,"utf-8"));if(Y.gitlab?.type==="oauth"){let W=Y.gitlab;if(W.enterpriseUrl===$||W.enterpriseUrl===$.replace(/\/$/,""))return W}let J=$.replace(/\/$/,"");return Y[J]||Y[`${J}/`]}catch(X){throw Error(`Failed to load auth.json: ${X instanceof Error?X.message:X}`)}}async function v5($,X,Y){if($.apiKey)return $.apiKey;let J=await DW(X);if(J?.type==="oauth"){let W=new CW;if(W.needsRefresh(J.expires))try{let z=await W.exchangeRefreshToken({instanceUrl:X,refreshToken:J.refresh,clientId:Y}),G=n5(),V=JSON.parse(q2.readFileSync(G,"utf-8"));return V.gitlab={type:"oauth",refresh:z.refreshToken,access:z.accessToken,expires:z.expiresAt,enterpriseUrl:X},q2.writeFileSync(G,JSON.stringify(V,null,2),{mode:384}),z.accessToken}catch(z){let G=z instanceof Error?z.message:String(z),V=process.env[$.environmentVariableName];if(V)return V;throw new x({message:`OAuth token refresh failed and no fallback ${$.environmentVariableName} environment variable is set. Refresh error: ${G}. Re-authenticate with 'opencode auth login gitlab' or set ${$.environmentVariableName}.`})}else return J.access}let Q=process.env[$.environmentVariableName];if(!Q)throw new x({message:`${$.description} API key is missing. Pass it as the 'apiKey' parameter, set the ${$.environmentVariableName} environment variable, or authenticate with 'opencode auth login gitlab'.`});return Q}function RW($,X){let Y=$["User-Agent"];return{...$,"User-Agent":Y?`${Y} ${X}`:X}}function TW($={}){let X=$.instanceUrl??process.env.GITLAB_INSTANCE_URL??"https://gitlab.com",Y=$.name??"gitlab",J,Q,W=async()=>{if(J)return J;if(Q)return Q;return Q=v5({apiKey:$.apiKey,environmentVariableName:"GITLAB_TOKEN",description:"GitLab"},X,$.clientId),J=await Q,Q=void 0,J},z=async()=>{J=void 0,Q=void 0,J=await v5({apiKey:void 0,environmentVariableName:"GITLAB_TOKEN",description:"GitLab"},X,$.clientId)},G=()=>{let B=J||$.apiKey||process.env.GITLAB_TOKEN||"";if(!B)throw new x({message:"GitLab API key is missing. Pass it as the 'apiKey' parameter, set the GITLAB_TOKEN environment variable, or authenticate with 'opencode auth login gitlab'."});return RW({Authorization:`Bearer ${B}`,"Content-Type":"application/json",...$.headers},`ai-sdk-gitlab/${H7}`)};W().catch(()=>{});let V=(B,U)=>{let O=j5(B);if(!O)throw new x({message:`Unknown model ID: ${B}. Model must be registered in MODEL_MAPPINGS.`});if(U?.providerModel){let E=iQ(O.provider);if(!E.includes(U.providerModel))throw new x({message:`Invalid providerModel '${U.providerModel}' for provider '${O.provider}'. Valid models: ${E.join(", ")}`})}let P={DuoAgentPlatformNext:!0,...$.featureFlags,...U?.featureFlags},L={...{"User-Agent":`gitlab-ai-provider/${H7}`},...$.aiGatewayHeaders,...U?.aiGatewayHeaders},A={provider:`${Y}.agentic`,instanceUrl:X,getHeaders:G,refreshApiKey:z,fetch:$.fetch,maxTokens:U?.maxTokens,featureFlags:P,aiGatewayUrl:$.aiGatewayUrl,aiGatewayHeaders:L};if(O.provider==="openai")return new tQ(B,{...A,openaiModel:U?.providerModel??O.model});return new pQ(B,{...A,anthropicModel:U?.providerModel??O.model})},H=(B,U)=>{let O=j5(B);if(!O||O.provider!=="workflow")throw new x({message:`Unknown workflow model ID: ${B}. Use 'duo-workflow' or a 'duo-workflow-*' model ID.`});return new LW(B,{provider:`${Y}.workflow`,instanceUrl:X,getHeaders:G,refreshApiKey:z,fetch:$.fetch,featureFlags:{...$.featureFlags,...U?.featureFlags},aiGatewayUrl:$.aiGatewayUrl},U)},q=(B)=>{if(rQ(B))return H(B);return V(B)},w=Object.assign((B)=>q(B),{specificationVersion:"v3",languageModel:q,chat:q,agenticChat:V,workflowChat:H});return w.embeddingModel=(B)=>{throw new x({message:`GitLab provider does not support text embedding models. Model ID: ${B}`})},w.imageModel=(B)=>{throw new x({message:`GitLab provider does not support image models. Model ID: ${B}`})},w}var gE=TW(),_W="https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/raw/main/ai_gateway/model_selection/models.yml",PW=86400000,q7=200000,w7=64000;function U7(){let $=process.env.XDG_CACHE_HOME||m6.join(a5.homedir(),".cache");return m6.join($,"opencode","gitlab-model-configs.json")}function jW(){try{let $=U7();if(!d$.existsSync($))return null;let X=d$.readFileSync($,"utf-8");return JSON.parse(X)}catch{return null}}function kW($){try{let X=U7(),Y=m6.dirname(X);d$.mkdirSync(Y,{recursive:!0,mode:448});let J={configs:Object.fromEntries($),updatedAt:new Date().toISOString()};d$.writeFileSync(X,JSON.stringify(J,null,2),{mode:384})}catch{}}function y5($){let X=jW();if(!X)return null;let Y=new Date(X.updatedAt).getTime();if(Date.now()-Y>$)return null;return{configs:new Map(Object.entries(X.configs)),writtenAt:Y}}var xW=class{url;ttlMs;fetchFn;memCache=null;memExpiresAt=0;pending=null;constructor($){this.url=$?.url??_W,this.ttlMs=$?.ttlMs??PW,this.fetchFn=$?.fetch??fetch}async getConfigs(){if(this.memCache&&Date.now()<this.memExpiresAt)return this.memCache;let $=y5(this.ttlMs);if($)return this.memCache=$.configs,this.memExpiresAt=$.writtenAt+this.ttlMs,$.configs;if(this.pending)return this.pending;this.pending=this.fetchConfigs();try{return await this.pending}finally{this.pending=null}}async getConfig($){return(await this.getConfigs()).get($)??{context:q7,output:w7}}invalidateCache(){this.memCache=null,this.memExpiresAt=0;try{let $=U7();if(d$.existsSync($))d$.unlinkSync($)}catch{}}async fetchConfigs(){try{let $=await this.fetchFn(this.url);if(!$.ok)throw Error(`HTTP ${$.status}`);let X=await $.text(),Y=fW(X);return this.memCache=Y,this.memExpiresAt=Date.now()+this.ttlMs,kW(Y),Y}catch{return this.memCache??y5(1/0)?.configs??new Map}}};function fW($){let X=new Map,Y=null,J=0,Q=0,W=!1,z=-1;for(let G of $.split(`
|
|
102
|
-
`)){let V=G.match(/^\s*gitlab_identifier:\s*"?([^"#\s]+)"?/);if(V){if(Y)X.set(Y,{context:J||q7,output:Q||w7});Y=V[1],J=0,Q=0,W=!1,z=-1}let H=G.match(/^\s*max_context_tokens:\s*([0-9_]+)/);if(H&&Y)J=parseInt(H[1].replace(/_/g,""),10);if(/^\s*params:\s*$/.test(G))W=!0,z=G.match(/^(\s*)/)?.[1].length??0;else if(W&&/^\s*\S+:/.test(G)){if((G.match(/^(\s*)/)?.[1].length??0)<=z)W=!1,z=-1}if(W){let q=G.match(/^\s*max_tokens:\s*([0-9_]+)/);if(q&&Y)Q=parseInt(q[1].replace(/_/g,""),10)}}if(Y)X.set(Y,{context:J||q7,output:Q||w7});return X}var bW=new xW;async function g5($,X){let Y=await bW.getConfigs(),J=new Map;for(let[G,V]of Object.entries(o$))if(V.provider==="workflow"&&G!=="duo-workflow"&&G!=="duo-workflow-default")J.set(V.model,G);let Q=$.pinnedModel?[$.pinnedModel]:[...$.selectableModels??[],...$.defaultModel?[$.defaultModel]:[]],W=new Set,z=[];for(let G of Q){if(!G.ref||W.has(G.ref))continue;W.add(G.ref);let V=J.get(G.ref)??`duo-workflow-${G.ref.replace(/[/_]/g,"-")}`,H=Y.get(G.ref);z.push({id:V,ref:G.ref,name:G.name,context:H?.context??200000,output:H?.output??64000,pinned:!!$.pinnedModel&&$.pinnedModel.ref===G.ref})}return{models:z,project:X}}async function hE($,X){let Y=new p5(X.workingDirectory,$.instanceUrl);if(!Y.isDiscoveryExpired()){let V=Y.load();return g5(V.discovery,V.project)}let J=new u5({instanceUrl:$.instanceUrl,getHeaders:$.getHeaders,fetch:$.fetch}),Q=null;try{Q=await J.detectProject(X.workingDirectory)}catch{return{models:[],project:null}}let W=Q?.namespaceId;if(!W)return{models:[],project:Q};let G=await new d5({instanceUrl:$.instanceUrl,getHeaders:$.getHeaders,fetch:$.fetch}).discover(`gid://gitlab/Group/${W}`);if(Y.saveDiscovery(G,Q),!Y.getSelectedModelRef()){let V=G.pinnedModel??G.defaultModel;if(V)Y.saveSelection(V.ref,V.name)}return g5(G,Q)}export{x as
|
|
102
|
+
`)){let V=G.match(/^\s*gitlab_identifier:\s*"?([^"#\s]+)"?/);if(V){if(Y)X.set(Y,{context:J||q7,output:Q||w7});Y=V[1],J=0,Q=0,W=!1,z=-1}let H=G.match(/^\s*max_context_tokens:\s*([0-9_]+)/);if(H&&Y)J=parseInt(H[1].replace(/_/g,""),10);if(/^\s*params:\s*$/.test(G))W=!0,z=G.match(/^(\s*)/)?.[1].length??0;else if(W&&/^\s*\S+:/.test(G)){if((G.match(/^(\s*)/)?.[1].length??0)<=z)W=!1,z=-1}if(W){let q=G.match(/^\s*max_tokens:\s*([0-9_]+)/);if(q&&Y)Q=parseInt(q[1].replace(/_/g,""),10)}}if(Y)X.set(Y,{context:J||q7,output:Q||w7});return X}var bW=new xW;async function g5($,X){let Y=await bW.getConfigs(),J=new Map;for(let[G,V]of Object.entries(o$))if(V.provider==="workflow"&&G!=="duo-workflow"&&G!=="duo-workflow-default")J.set(V.model,G);let Q=$.pinnedModel?[$.pinnedModel]:[...$.selectableModels??[],...$.defaultModel?[$.defaultModel]:[]],W=new Set,z=[];for(let G of Q){if(!G.ref||W.has(G.ref))continue;W.add(G.ref);let V=J.get(G.ref)??`duo-workflow-${G.ref.replace(/[/_]/g,"-")}`,H=Y.get(G.ref);z.push({id:V,ref:G.ref,name:G.name,context:H?.context??200000,output:H?.output??64000,pinned:!!$.pinnedModel&&$.pinnedModel.ref===G.ref})}return{models:z,project:X}}async function hE($,X){let Y=new p5(X.workingDirectory,$.instanceUrl);if(!Y.isDiscoveryExpired()){let V=Y.load();return g5(V.discovery,V.project)}let J=new u5({instanceUrl:$.instanceUrl,getHeaders:$.getHeaders,fetch:$.fetch}),Q=null;try{Q=await J.detectProject(X.workingDirectory)}catch{return{models:[],project:null}}let W=Q?.namespaceId;if(!W)return{models:[],project:Q};let G=await new d5({instanceUrl:$.instanceUrl,getHeaders:$.getHeaders,fetch:$.fetch}).discover(`gid://gitlab/Group/${W}`);if(Y.saveDiscovery(G,Q),!Y.getSelectedModelRef()){let V=G.pinnedModel??G.defaultModel;if(V)Y.saveSelection(V.ref,V.name)}return g5(G,Q)}export{x as Qh,lQ as Rh,h5 as Sh,pQ as Th,o$ as Uh,j5 as Vh,jE as Wh,iQ as Xh,kE as Yh,xE as Zh,nQ as _h,aQ as $h,rQ as ai,sQ as bi,fE as ci,tQ as di,H7 as ei,oQ as fi,eQ as gi,k5 as hi,y6 as ii,$W as ji,K7 as ki,U8 as li,YW as mi,JW as ni,x5 as oi,HW as pi,BW as qi,u5 as ri,d5 as si,p5 as ti,LW as ui,ZW as vi,vE as wi,SW as xi,AW as yi,yE as zi,CW as Ai,TW as Bi,gE as Ci,xW as Di,fW as Ei,hE as Fi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Be as w}from"./chunk-y4e7e42x.js";import{Ce as oe}from"./chunk-yd2emszh.js";import{wf as l}from"./chunk-3tmq81kq.js";import{LO as i,PO as f}from"./chunk-f83wv08n.js";var g=i(l(),1);var ce=i(l(),1);var O=i(w(),1),S=i(l(),1);var q=i(w(),1),b=i(l(),1),j=(e,s,t)=>{let n={EcsContainer:async(r)=>{let{fromHttp:a}=await import("./chunk-n393nnh5.js"),{fromContainerMetadata:c}=await import("./chunk-n0k0pp4k.js");return t?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>b.chain(a(r??{}),c(r))().then(L)},Ec2InstanceMetadata:async(r)=>{t?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:a}=await import("./chunk-n0k0pp4k.js");return async()=>a(r)().then(L)},Environment:async(r)=>{t?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:a}=await import("./chunk-4yg42p6y.js");return async()=>a(r)().then(L)}};if(e in n)return n[e];else throw new b.CredentialsProviderError(`Unsupported credential source in profile ${s}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:t})},L=(e)=>q.setCredentialFeature(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p");var G=(e,{profile:s="default",logger:t}={})=>{return Boolean(e)&&typeof e==="object"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(re(e,{profile:s,logger:t})||ae(e,{profile:s,logger:t}))},re=(e,{profile:s,logger:t})=>{let n=typeof e.source_profile==="string"&&typeof e.credential_source>"u";if(n)t?.debug?.(` ${s} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`);return n},ae=(e,{profile:s,logger:t})=>{let n=typeof e.credential_source==="string"&&typeof e.source_profile>"u";if(n)t?.debug?.(` ${s} isCredentialSourceProfile credential_source=${e.credential_source}`);return n},J=async(e,s,t,n,r={},a)=>{t.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let c=s[e],{source_profile:h,region:I}=c;if(!t.roleAssumer){let{getDefaultRoleAssumer:o}=await import("./chunk-rpfhgncs.js");t.roleAssumer=o({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...n,...t?.parentClientConfig,region:I??t?.parentClientConfig?.region??n?.region}},t.clientPlugins)}if(h&&h in r)throw new S.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${S.getProfileName(t)}. Profiles visited: `+Object.keys(r).join(", "),{logger:t.logger});t.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${h?`source_profile=[${h}]`:`profile=[${e}]`}`);let T=h?a(h,s,t,n,{...r,[h]:!0},U(s[h]??{})):(await j(c.credential_source,e,t.logger)(t))();if(U(c))return T.then((o)=>O.setCredentialFeature(o,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{let o={RoleArn:c.role_arn,RoleSessionName:c.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:c.external_id,DurationSeconds:parseInt(c.duration_seconds||"3600",10)},{mfa_serial:u}=c;if(u){if(!t.mfaCodeProvider)throw new S.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:t.logger,tryNextLink:!1});o.SerialNumber=u,o.TokenCode=await t.mfaCodeProvider(u)}let y=await T;return t.roleAssumer(y,o).then((k)=>O.setCredentialFeature(k,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},U=(e)=>{return!e.role_arn&&!!e.credential_source};var z=i(w(),1);var Y=i(w(),1),x=i(l(),1);var d=i(l(),1),v=i(oe(),1);import{createHash as ie,createPrivateKey as he,createPublicKey as ye,sign as ue}from"crypto";import{promises as R}from"fs";import{homedir as de}from"os";import{dirname as we,join as N}from"path";class K{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(e,s,t){this.profileData=e,this.init=s,this.callerClientConfig=t}async loadCredentials(){let e=await this.loadToken();if(!e)throw new d.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let s=e.accessToken,t=Date.now();if(new Date(s.expiresAt).getTime()-t<=K.REFRESH_THRESHOLD)return this.refresh(e);return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,sessionToken:s.sessionToken,accountId:s.accountId,expiration:new Date(s.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){let{SigninClient:s,CreateOAuth2TokenCommand:t}=await import("./chunk-8rh0femq.js"),{logger:n,userAgentAppId:r}=this.callerClientConfig??{},c=((o)=>{return o?.metadata?.handlerProtocol==="h2"})(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,h=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,I=new s({credentials:{accessKeyId:"",secretAccessKey:""},region:h,requestHandler:c,logger:n,userAgentAppId:r,...this.init?.clientConfig});this.createDPoPInterceptor(I.middlewareStack);let T={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:"refresh_token"}};try{let o=await I.send(new t(T)),{accessKeyId:u,secretAccessKey:y,sessionToken:k}=o.tokenOutput?.accessToken??{},{refreshToken:E,expiresIn:B}=o.tokenOutput??{};if(!u||!y||!k||!E)throw new d.CredentialsProviderError("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let A=(B??900)*1000,m=new Date(Date.now()+A),H={...e,accessToken:{...e.accessToken,accessKeyId:u,secretAccessKey:y,sessionToken:k,expiresAt:m.toISOString()},refreshToken:E};await this.saveToken(H);let _=H.accessToken;return{accessKeyId:_.accessKeyId,secretAccessKey:_.secretAccessKey,sessionToken:_.sessionToken,accountId:_.accountId,expiration:m}}catch(o){if(o.name==="AccessDeniedException"){let u=o.error,y;switch(u){case"TOKEN_EXPIRED":y="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":y="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":y="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:y=`Failed to refresh token: ${String(o)}. Please re-authenticate using \`aws login\``}throw new d.CredentialsProviderError(y,{logger:this.logger,tryNextLink:!1})}throw new d.CredentialsProviderError(`Failed to refresh token: ${String(o)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let s;try{s=await d.readFile(e,{ignoreCache:this.init?.ignoreCache})}catch{s=await R.readFile(e,"utf8")}let t=JSON.parse(s),n=["accessToken","clientId","refreshToken","dpopKey"].filter((r)=>!t[r]);if(!t.accessToken?.accountId)n.push("accountId");if(n.length>0)throw new d.CredentialsProviderError(`Token validation failed, missing fields: ${n.join(", ")}`,{logger:this.logger,tryNextLink:!1});return t}catch(s){throw new d.CredentialsProviderError(`Failed to load token from ${e}: ${String(s)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let s=this.getTokenFilePath(),t=we(s);try{await R.mkdir(t,{recursive:!0})}catch(n){}await R.writeFile(s,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??N(de(),".aws","login","cache"),s=Buffer.from(this.loginSession,"utf8"),t=ie("sha256").update(s).digest("hex");return N(e,`${t}.json`)}derToRawSignature(e){let s=2;if(e[s]!==2)throw Error("Invalid DER signature");s++;let t=e[s++],n=e.subarray(s,s+t);if(s+=t,e[s]!==2)throw Error("Invalid DER signature");s++;let r=e[s++],a=e.subarray(s,s+r);n=n[0]===0?n.subarray(1):n,a=a[0]===0?a.subarray(1):a;let c=Buffer.concat([Buffer.alloc(32-n.length),n]),h=Buffer.concat([Buffer.alloc(32-a.length),a]);return Buffer.concat([c,h])}createDPoPInterceptor(e){e.add((s)=>async(t)=>{if(v.HttpRequest.isInstance(t.request)){let n=t.request,r=`${n.protocol}//${n.hostname}${n.port?`:${n.port}`:""}${n.path}`,a=await this.generateDpop(n.method,r);n.headers={...n.headers,DPoP:a}}return s(t)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",s){let t=await this.loadToken();try{let n=he({key:t.dpopKey,format:"pem",type:"sec1"}),a=ye(n).export({format:"der",type:"spki"}),c=-1;for(let m=0;m<a.length;m++)if(a[m]===4){c=m;break}let h=a.slice(c+1,c+33),I=a.slice(c+33,c+65),T={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:h.toString("base64url"),y:I.toString("base64url")}},o={jti:crypto.randomUUID(),htm:e,htu:s,iat:Math.floor(Date.now()/1000)},u=Buffer.from(JSON.stringify(T)).toString("base64url"),y=Buffer.from(JSON.stringify(o)).toString("base64url"),k=`${u}.${y}`,E=ue("sha256",Buffer.from(k),n),A=this.derToRawSignature(E).toString("base64url");return`${k}.${A}`}catch(n){throw new d.CredentialsProviderError(`Failed to generate Dpop proof: ${n instanceof Error?n.message:String(n)}`,{logger:this.logger,tryNextLink:!1})}}}var W=(e)=>async({callerClientConfig:s}={})=>{e?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let t=await x.parseKnownFiles(e||{}),n=x.getProfileName({profile:e?.profile??s?.profile}),r=t[n];if(!r?.login_session)throw new x.CredentialsProviderError(`Profile ${n} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let c=await new K(r,e,s).loadCredentials();return Y.setCredentialFeature(c,"CREDENTIALS_LOGIN","AD")};var C=(e)=>{return Boolean(e&&e.login_session)},X=async(e,s,t)=>{let n=await W({...s,profile:e})({callerClientConfig:t});return z.setCredentialFeature(n,"CREDENTIALS_PROFILE_LOGIN","AC")};var Q=i(w(),1),V=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.credential_process==="string",Z=async(e,s)=>import("./chunk-t69jx6fz.js").then(({fromProcess:t})=>t({...e,profile:s})().then((n)=>Q.setCredentialFeature(n,"CREDENTIALS_PROFILE_PROCESS","v")));var D=i(w(),1),M=async(e,s,t={},n)=>{let{fromSSO:r}=await import("./chunk-skpkjnyy.js");return r({profile:e,logger:t.logger,parentClientConfig:t.parentClientConfig,clientConfig:t.clientConfig})({callerClientConfig:n}).then((a)=>{if(s.sso_session)return D.setCredentialFeature(a,"CREDENTIALS_PROFILE_SSO","r");else return D.setCredentialFeature(a,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},p=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var ee=i(w(),1),$=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.aws_access_key_id==="string"&&typeof e.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,P=async(e,s)=>{s?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let t={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return ee.setCredentialFeature(t,"CREDENTIALS_PROFILE","n")};var te=i(w(),1),se=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.web_identity_token_file==="string"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,ne=async(e,s,t)=>import("./chunk-mgadsp7r.js").then(({fromTokenFile:n})=>n({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:s.roleAssumerWithWebIdentity,logger:s.logger,parentClientConfig:s.parentClientConfig})({callerClientConfig:t}).then((r)=>te.setCredentialFeature(r,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")));var F=async(e,s,t,n,r={},a=!1)=>{let c=s[e];if(Object.keys(r).length>0&&$(c))return P(c,t);if(a||G(c,{profile:e,logger:t.logger}))return J(e,s,t,n,r,F);if($(c))return P(c,t);if(se(c))return ne(c,t,n);if(V(c))return Z(t,e);if(p(c))return await M(e,c,t,n);if(C(c))return X(e,t,n);throw new ce.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:t.logger})};var je=(e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let t=await g.parseKnownFiles(e);return F(g.getProfileName({profile:e.profile??s?.profile}),t,e,s)};export{W as Xd,je as Yd};
|
|
2
|
+
import{Me as w}from"./chunk-bne5w117.js";import{Ne as oe}from"./chunk-j0bwa5dk.js";import{Hf as l}from"./chunk-2drzgtv3.js";import{sO as i,wO as f}from"./chunk-r9w0thdk.js";var g=i(l(),1);var ce=i(l(),1);var O=i(w(),1),S=i(l(),1);var q=i(w(),1),b=i(l(),1),j=(e,s,t)=>{let n={EcsContainer:async(r)=>{let{fromHttp:a}=await import("./chunk-x6mw98c2.js"),{fromContainerMetadata:c}=await import("./chunk-516w1nc4.js");return t?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>b.chain(a(r??{}),c(r))().then(L)},Ec2InstanceMetadata:async(r)=>{t?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:a}=await import("./chunk-516w1nc4.js");return async()=>a(r)().then(L)},Environment:async(r)=>{t?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:a}=await import("./chunk-6gpf2bjs.js");return async()=>a(r)().then(L)}};if(e in n)return n[e];else throw new b.CredentialsProviderError(`Unsupported credential source in profile ${s}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:t})},L=(e)=>q.setCredentialFeature(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p");var G=(e,{profile:s="default",logger:t}={})=>{return Boolean(e)&&typeof e==="object"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(re(e,{profile:s,logger:t})||ae(e,{profile:s,logger:t}))},re=(e,{profile:s,logger:t})=>{let n=typeof e.source_profile==="string"&&typeof e.credential_source>"u";if(n)t?.debug?.(` ${s} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`);return n},ae=(e,{profile:s,logger:t})=>{let n=typeof e.credential_source==="string"&&typeof e.source_profile>"u";if(n)t?.debug?.(` ${s} isCredentialSourceProfile credential_source=${e.credential_source}`);return n},J=async(e,s,t,n,r={},a)=>{t.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let c=s[e],{source_profile:h,region:I}=c;if(!t.roleAssumer){let{getDefaultRoleAssumer:o}=await import("./chunk-has2rz35.js");t.roleAssumer=o({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...n,...t?.parentClientConfig,region:I??t?.parentClientConfig?.region??n?.region}},t.clientPlugins)}if(h&&h in r)throw new S.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${S.getProfileName(t)}. Profiles visited: `+Object.keys(r).join(", "),{logger:t.logger});t.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${h?`source_profile=[${h}]`:`profile=[${e}]`}`);let T=h?a(h,s,t,n,{...r,[h]:!0},U(s[h]??{})):(await j(c.credential_source,e,t.logger)(t))();if(U(c))return T.then((o)=>O.setCredentialFeature(o,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{let o={RoleArn:c.role_arn,RoleSessionName:c.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:c.external_id,DurationSeconds:parseInt(c.duration_seconds||"3600",10)},{mfa_serial:u}=c;if(u){if(!t.mfaCodeProvider)throw new S.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:t.logger,tryNextLink:!1});o.SerialNumber=u,o.TokenCode=await t.mfaCodeProvider(u)}let y=await T;return t.roleAssumer(y,o).then((k)=>O.setCredentialFeature(k,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},U=(e)=>{return!e.role_arn&&!!e.credential_source};var z=i(w(),1);var Y=i(w(),1),x=i(l(),1);var d=i(l(),1),v=i(oe(),1);import{createHash as ie,createPrivateKey as he,createPublicKey as ye,sign as ue}from"crypto";import{promises as R}from"fs";import{homedir as de}from"os";import{dirname as we,join as N}from"path";class K{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(e,s,t){this.profileData=e,this.init=s,this.callerClientConfig=t}async loadCredentials(){let e=await this.loadToken();if(!e)throw new d.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let s=e.accessToken,t=Date.now();if(new Date(s.expiresAt).getTime()-t<=K.REFRESH_THRESHOLD)return this.refresh(e);return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,sessionToken:s.sessionToken,accountId:s.accountId,expiration:new Date(s.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){let{SigninClient:s,CreateOAuth2TokenCommand:t}=await import("./chunk-xdd3553a.js"),{logger:n,userAgentAppId:r}=this.callerClientConfig??{},c=((o)=>{return o?.metadata?.handlerProtocol==="h2"})(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,h=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,I=new s({credentials:{accessKeyId:"",secretAccessKey:""},region:h,requestHandler:c,logger:n,userAgentAppId:r,...this.init?.clientConfig});this.createDPoPInterceptor(I.middlewareStack);let T={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:"refresh_token"}};try{let o=await I.send(new t(T)),{accessKeyId:u,secretAccessKey:y,sessionToken:k}=o.tokenOutput?.accessToken??{},{refreshToken:E,expiresIn:B}=o.tokenOutput??{};if(!u||!y||!k||!E)throw new d.CredentialsProviderError("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let A=(B??900)*1000,m=new Date(Date.now()+A),H={...e,accessToken:{...e.accessToken,accessKeyId:u,secretAccessKey:y,sessionToken:k,expiresAt:m.toISOString()},refreshToken:E};await this.saveToken(H);let _=H.accessToken;return{accessKeyId:_.accessKeyId,secretAccessKey:_.secretAccessKey,sessionToken:_.sessionToken,accountId:_.accountId,expiration:m}}catch(o){if(o.name==="AccessDeniedException"){let u=o.error,y;switch(u){case"TOKEN_EXPIRED":y="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":y="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":y="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:y=`Failed to refresh token: ${String(o)}. Please re-authenticate using \`aws login\``}throw new d.CredentialsProviderError(y,{logger:this.logger,tryNextLink:!1})}throw new d.CredentialsProviderError(`Failed to refresh token: ${String(o)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let s;try{s=await d.readFile(e,{ignoreCache:this.init?.ignoreCache})}catch{s=await R.readFile(e,"utf8")}let t=JSON.parse(s),n=["accessToken","clientId","refreshToken","dpopKey"].filter((r)=>!t[r]);if(!t.accessToken?.accountId)n.push("accountId");if(n.length>0)throw new d.CredentialsProviderError(`Token validation failed, missing fields: ${n.join(", ")}`,{logger:this.logger,tryNextLink:!1});return t}catch(s){throw new d.CredentialsProviderError(`Failed to load token from ${e}: ${String(s)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let s=this.getTokenFilePath(),t=we(s);try{await R.mkdir(t,{recursive:!0})}catch(n){}await R.writeFile(s,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??N(de(),".aws","login","cache"),s=Buffer.from(this.loginSession,"utf8"),t=ie("sha256").update(s).digest("hex");return N(e,`${t}.json`)}derToRawSignature(e){let s=2;if(e[s]!==2)throw Error("Invalid DER signature");s++;let t=e[s++],n=e.subarray(s,s+t);if(s+=t,e[s]!==2)throw Error("Invalid DER signature");s++;let r=e[s++],a=e.subarray(s,s+r);n=n[0]===0?n.subarray(1):n,a=a[0]===0?a.subarray(1):a;let c=Buffer.concat([Buffer.alloc(32-n.length),n]),h=Buffer.concat([Buffer.alloc(32-a.length),a]);return Buffer.concat([c,h])}createDPoPInterceptor(e){e.add((s)=>async(t)=>{if(v.HttpRequest.isInstance(t.request)){let n=t.request,r=`${n.protocol}//${n.hostname}${n.port?`:${n.port}`:""}${n.path}`,a=await this.generateDpop(n.method,r);n.headers={...n.headers,DPoP:a}}return s(t)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",s){let t=await this.loadToken();try{let n=he({key:t.dpopKey,format:"pem",type:"sec1"}),a=ye(n).export({format:"der",type:"spki"}),c=-1;for(let m=0;m<a.length;m++)if(a[m]===4){c=m;break}let h=a.slice(c+1,c+33),I=a.slice(c+33,c+65),T={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:h.toString("base64url"),y:I.toString("base64url")}},o={jti:crypto.randomUUID(),htm:e,htu:s,iat:Math.floor(Date.now()/1000)},u=Buffer.from(JSON.stringify(T)).toString("base64url"),y=Buffer.from(JSON.stringify(o)).toString("base64url"),k=`${u}.${y}`,E=ue("sha256",Buffer.from(k),n),A=this.derToRawSignature(E).toString("base64url");return`${k}.${A}`}catch(n){throw new d.CredentialsProviderError(`Failed to generate Dpop proof: ${n instanceof Error?n.message:String(n)}`,{logger:this.logger,tryNextLink:!1})}}}var W=(e)=>async({callerClientConfig:s}={})=>{e?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let t=await x.parseKnownFiles(e||{}),n=x.getProfileName({profile:e?.profile??s?.profile}),r=t[n];if(!r?.login_session)throw new x.CredentialsProviderError(`Profile ${n} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let c=await new K(r,e,s).loadCredentials();return Y.setCredentialFeature(c,"CREDENTIALS_LOGIN","AD")};var C=(e)=>{return Boolean(e&&e.login_session)},X=async(e,s,t)=>{let n=await W({...s,profile:e})({callerClientConfig:t});return z.setCredentialFeature(n,"CREDENTIALS_PROFILE_LOGIN","AC")};var Q=i(w(),1),V=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.credential_process==="string",Z=async(e,s)=>import("./chunk-0te0vcdn.js").then(({fromProcess:t})=>t({...e,profile:s})().then((n)=>Q.setCredentialFeature(n,"CREDENTIALS_PROFILE_PROCESS","v")));var D=i(w(),1),M=async(e,s,t={},n)=>{let{fromSSO:r}=await import("./chunk-r7sq3maz.js");return r({profile:e,logger:t.logger,parentClientConfig:t.parentClientConfig,clientConfig:t.clientConfig})({callerClientConfig:n}).then((a)=>{if(s.sso_session)return D.setCredentialFeature(a,"CREDENTIALS_PROFILE_SSO","r");else return D.setCredentialFeature(a,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},p=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var ee=i(w(),1),$=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.aws_access_key_id==="string"&&typeof e.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,P=async(e,s)=>{s?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let t={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return ee.setCredentialFeature(t,"CREDENTIALS_PROFILE","n")};var te=i(w(),1),se=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.web_identity_token_file==="string"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,ne=async(e,s,t)=>import("./chunk-f4mf6tpp.js").then(({fromTokenFile:n})=>n({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:s.roleAssumerWithWebIdentity,logger:s.logger,parentClientConfig:s.parentClientConfig})({callerClientConfig:t}).then((r)=>te.setCredentialFeature(r,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")));var F=async(e,s,t,n,r={},a=!1)=>{let c=s[e];if(Object.keys(r).length>0&&$(c))return P(c,t);if(a||G(c,{profile:e,logger:t.logger}))return J(e,s,t,n,r,F);if($(c))return P(c,t);if(se(c))return ne(c,t,n);if(V(c))return Z(t,e);if(p(c))return await M(e,c,t,n);if(C(c))return X(e,t,n);throw new ce.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:t.logger})};var je=(e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let t=await g.parseKnownFiles(e);return F(g.getProfileName({profile:e.profile??s?.profile}),t,e,s)};export{W as ge,je as he};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{im as f,jm as Gj,km as Rj,lm as Hj,om as s}from"./chunk-hpa7e9va.js";import{_n as xj}from"./chunk-rk2bk4s7.js";import{eo as vj}from"./chunk-b50t4jc5.js";import{ir as P,jr as wj,pr as k,qr as Kj}from"./chunk-pfkm3j8g.js";import{us as a,vs as y}from"./chunk-sh76e256.js";import{et as I,nt as h}from"./chunk-x3afqfww.js";import{At as Jj,Dt as Nj,yt as i,zt as Ij}from"./chunk-cbmwhvxw.js";import{Et as j}from"./chunk-9etpppyv.js";import{SB as Wj,WE as o,kO as C,oK as l,pF as d,xH as Q}from"./chunk-ks1cs80p.js";import{LO as Mj,NO as Oj,PO as Ej}from"./chunk-f83wv08n.js";var tj={};Oj(tj,{stopRefresh:()=>aj,startRefresh:()=>sj,refresh:()=>jj,readModelCatalogResponse:()=>Pj,get:()=>fj,Provider:()=>cj,Model:()=>pj,MODEL_CATALOG_MAX_BYTES:()=>Aj,Data:()=>S});import hj from"path";var U={};Oj(U,{layer:()=>Bj,isPreview:()=>ij,isNewerVersion:()=>qj,isLocal:()=>mj,getReleaseType:()=>yj,defaultLayer:()=>uj,UpgradeFailedError:()=>x,USER_AGENT:()=>Sj,Service:()=>E,Installation:()=>U,Info:()=>Uj,Event:()=>Cj});var _j=(J)=>J.pipe(k.retryTransient({retryOn:"errors-and-responses",times:2,schedule:d.exponential(200).pipe(d.jittered)}));import Yj from"path";var z=Mj(xj(),1);import n from"crypto";import v from"fs";import Zj from"path";class H extends Error{constructor(J){super(J);this.name="SelfUpdateError"}}function $j(J){let V=J?.platform??process.platform,_=J?.arch??process.arch,$=J?.libc??"bionic",W=["qitqode",V==="win32"?"windows":V,_];if(_==="x64")W.push("baseline");if(V==="linux"&&$==="musl")W.push("musl");return`@qitqode/${W.join("-")}`}function kj(J,V){if(V.integrity){let _=V.integrity.match(/^(sha512|sha384|sha256)-([A-Za-z0-9+/=]+)$/);if(!_)throw new H(`registry returned an unrecognized integrity string: ${V.integrity}`);if(n.createHash(_[1]).update(J).digest("base64")!==_[2])throw new H(`checksum mismatch: downloaded tarball does not match the registry ${_[1]} integrity value; refusing to install`);return}if(V.shasum){if(n.createHash("sha1").update(J).digest("hex")!==V.shasum.toLowerCase())throw new H("checksum mismatch: downloaded tarball does not match the registry shasum; refusing to install");return}throw new H("registry provided no integrity metadata for the tarball; refusing to install")}function Qj(J,V){let _=(w,R)=>{let G=w,q=w+R;while(G<q&&J[G]!==0)G++;return new TextDecoder().decode(J.subarray(w,G))},$=0,W;while($+512<=J.length){if(J.subarray($,$+512).every((Z)=>Z===0))break;let R=_($+124,12).trim(),G=R?parseInt(R,8):0;if(!Number.isFinite(G)||G<0)throw new H("downloaded tarball is corrupt (bad tar header)");let q=String.fromCharCode(J[$+156]),B=_($,100),N=_($+345,155);if(N)B=`${N}/${B}`;if(W)B=W,W=void 0;let b=$+512,X=b+G;if(q==="L")W=new TextDecoder().decode(J.subarray(b,X)).replace(/\0+$/,"");else if((q==="0"||q==="\x00"||q==="")&&B===V)return J.slice(b,X);$=b+Math.ceil(G/512)*512}return}var A=(J)=>String(J instanceof Error?J.message:J),u=(J)=>Q.fail(new H(J)),p=(J,V)=>Q.try({try:J,catch:(_)=>new H(V(_))}),Xj=Q.fnUntraced(function*(J){let{target:V,execPath:_,packageName:$,registry:W}=J,w=J.gunzip??((K)=>Bun.gunzipSync(K)),R=Zj.dirname(_);yield*p(()=>v.accessSync(R,v.constants.W_OK),()=>`no write permission for ${R}; cannot replace ${_}. Fix the directory permissions or re-run with sufficient privileges.`);let G=`${W}/${$}/${encodeURIComponent(V)}`,B=(yield*J.fetchJson(G).pipe(Q.mapError((K)=>new H(`download failed: could not fetch ${$}@${V} from ${W} (${A(K)}). Check your network connection and that version ${V} exists.`))))?.dist;if(!B?.tarball)return yield*u(`registry response for ${$}@${V} has no tarball URL; cannot self-update`);let N=B.tarball,b=yield*J.fetchBytes(N).pipe(Q.mapError((K)=>new H(`download failed: could not download ${N} (${A(K)}). Check your network connection and try again.`)));yield*Q.try({try:()=>kj(b,B),catch:(K)=>K instanceof H?K:new H(A(K))});let X=yield*Q.try({try:()=>w(b),catch:()=>new H("downloaded tarball is corrupt (gunzip failed); try again")}),Z=Qj(X,"package/bin/qitqode")??Qj(X,"package/bin/qitqode.exe");if(!Z||Z.length===0)return yield*u(`tarball for ${$}@${V} does not contain the expected binary at bin/qitqode`);let O=Zj.join(R,`.qitqode-upgrade-${process.pid}`),Y=`${_}.backup-${process.pid}`,D=(K)=>{try{v.rmSync(K,{force:!0})}catch{}};yield*p(()=>v.writeFileSync(O,Z,{mode:493}),(K)=>{return D(O),`no write permission: could not write ${O} (${A(K)})`});let L=yield*J.runVersion(O).pipe(Q.mapError((K)=>{return D(O),new H(`downloaded binary failed its --version check (${A(K)}); keeping the current installation`)}));if(L.code!==0)return D(O),yield*u(`downloaded binary failed its --version check (exit ${L.code}); keeping the current installation`);let m=L.stdout.trim();if(m&&!m.includes(V))return D(O),yield*u(`downloaded binary reports version "${m}" instead of ${V}; keeping the current installation`);yield*p(()=>v.renameSync(_,Y),(K)=>{return D(O),`could not move the current binary aside (${A(K)}); check permissions on ${_}`}),yield*Q.try({try:()=>v.renameSync(O,_),catch:(K)=>{try{v.renameSync(Y,_)}catch{return new H(`failed to install the new binary AND failed to restore the old one; your previous binary is preserved at ${Y} \u2014 move it back to ${_} manually`)}return D(O),new H(`could not install the new binary (${A(K)}); the previous version was restored`)}}),D(Y)});var c=h.create({service:"installation"}),M="@qitqode/cli";function qj(J,V){if(!z.default.valid(J)||!z.default.valid(V))return!1;return z.default.gt(V,J)}var Cj={Updated:s.define("installation.updated",j.object({version:j.string()})),UpdateAvailable:s.define("installation.update-available",j.object({version:j.string()}))};function yj(J,V){if(!qj(J,V))throw Error(`Version ${V} is not newer than ${J}`);let _=z.default.major(J),$=z.default.minor(J),W=z.default.major(V),w=z.default.minor(V);if(W>_)return"major";if(w>$)return"minor";return"patch"}var Uj=j.object({version:j.string(),latest:j.string()}).meta({ref:"InstallationInfo"}),Sj=`qitqode/${y}/${a}/${I.QITQODE_CLIENT}`;function ij(){return y!=="latest"}function mj(){return y==="local"}class x extends C.TaggedErrorClass()("UpgradeFailedError",{stderr:C.String}){}var nj=C.Struct({version:C.String});class E extends Wj.Service()("@qitqode/Installation"){}var Bj=o.effect(E,Q.gen(function*(){let J=yield*k.HttpClient,V=k.filterStatusOk(_j(J)),_=yield*f.ChildProcessSpawner,$=(X,Z)=>Gj.make(X[0],X.slice(1),{cwd:Z?.cwd,env:Z?.env,extendEnv:!0}),W=Q.fnUntraced(function*(X){let Z=yield*Hj(_,X);return{code:Z.code,stdout:Z.text,stderr:Z.stderr}},Q.scoped),w=Q.fnUntraced(function*(X,Z){let O=yield*_.spawn($(X,Z)),Y=yield*l.mkString(l.decodeText(O.stdout));return yield*O.exitCode,Y},Q.scoped,Q.catch(()=>Q.succeed(""))),R=Q.fnUntraced(function*(X,Z){return yield*W($(X,Z))},Q.catch(()=>Q.succeed({code:f.ExitCode(1),stdout:"",stderr:""}))),G=Q.fn("Installation.method")(function*(){if(process.execPath.includes(Yj.join(".qitqode","bin")))return"curl";if(process.execPath.includes(Yj.join(".local","bin")))return"curl";let X=process.execPath.toLowerCase(),Z=[{name:"npm",command:()=>w(["npm","list","-g","--depth=0"])},{name:"pnpm",command:()=>w(["pnpm","list","-g","--depth=0"])},{name:"bun",command:()=>w(["bun","pm","ls","-g"])}];Z.sort((O,Y)=>{let D=X.includes(O.name),L=X.includes(Y.name);if(D&&!L)return-1;if(!D&&L)return 1;return 0});for(let O of Z)if((yield*O.command()).includes(M))return O.name;return"unknown"}),q=Q.fn("Installation.latest")(function*(X){let Z=X||(yield*G());if(Z==="curl"){let Y=(yield*w(["curl","-sI","https://github.com/qitqode/qitqode/releases/latest"])).match(/^location:.*\/tag\/v([0-9][^\s/]*)/im);if(Y)return Y[1];return yield*Q.die(Error("failed to resolve latest version from GitHub releases redirect"))}if(Z==="npm"||Z==="bun"||Z==="pnpm"){let Y=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org",D=Y.endsWith("/")?Y.slice(0,-1):Y,L=yield*V.execute(P.get(`${D}/${encodeURIComponent(M)}/${y}`).pipe(P.acceptJson));return(yield*wj.schemaBodyJson(nj)(L)).version}return c.warn("unsupported update channel, skipping",{method:Z}),yield*Q.die(Error(`unsupported update channel: ${Z}`))},Q.orDie),B=Q.fnUntraced(function*(){let Z=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org";return Z.endsWith("/")?Z.slice(0,-1):Z}),N=Q.fnUntraced(function*(X){let Z=yield*B();yield*Xj({target:X,execPath:process.env.QITQODE_SELF_UPDATE_TARGET_BINARY||process.execPath,packageName:$j(),registry:Z,fetchJson:(O)=>V.execute(P.get(O).pipe(P.acceptJson)).pipe(Q.flatMap((Y)=>Y.json)),fetchBytes:(O)=>V.execute(P.get(O)).pipe(Q.flatMap((Y)=>Y.arrayBuffer),Q.map((Y)=>new Uint8Array(Y))),runVersion:(O)=>R([O,"--version"]).pipe(Q.map((Y)=>({code:Y.code,stdout:Y.stdout})))}).pipe(Q.mapError((O)=>new x({stderr:O.message})))}),b=Q.fn("Installation.upgrade")(function*(X,Z){if(X==="curl"){yield*N(Z),c.info("upgraded",{method:X,target:Z});return}let Y=yield*(()=>{if(X==="npm")return R(["npm","install","-g",`${M}@${Z}`]);if(X==="pnpm")return R(["pnpm","install","-g",`${M}@${Z}`]);if(X==="bun")return R(["bun","install","-g",`${M}@${Z}`]);return new x({stderr:`Unknown method: ${X}`})})();if(Y.code!==0){let D=Y.stderr||"";return yield*new x({stderr:D})}c.info("upgraded",{method:X,target:Z,stdout:Y.stdout,stderr:Y.stderr}),yield*w([process.execPath,"--version"])});return E.of({info:Q.fn("Installation.info")(function*(){return{version:a,latest:yield*q()}}),method:G,latest:q,upgrade:b})})),uj=Bj.pipe(o.provide(Kj.layer),o.provide(Rj));var t=j.lazy(()=>j.union([j.string(),j.number(),j.boolean(),j.null(),j.array(t),j.record(j.string(),t)])),Dj=j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional(),context_over_200k:j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional()}).optional()}),r=j.object({id:j.string(),name:j.string(),family:j.string().optional(),release_date:j.string(),attachment:j.boolean(),reasoning:j.boolean(),temperature:j.boolean().optional(),tool_call:j.boolean(),interleaved:j.union([j.literal(!0),j.object({field:j.enum(["reasoning_content","reasoning_details"])}).strict()]).optional(),cost:Dj.optional(),limit:j.object({context:j.number(),input:j.number().optional(),output:j.number()}),modalities:j.object({input:j.array(j.enum(["text","audio","image","video","pdf"])),output:j.array(j.enum(["text","audio","image","video","pdf"]))}).optional(),experimental:j.object({modes:j.record(j.string(),j.object({cost:Dj.optional(),provider:j.object({body:j.record(j.string(),t).optional(),headers:j.record(j.string(),j.string()).optional()}).optional()})).optional()}).optional(),status:j.enum(["alpha","beta","deprecated"]).optional(),provider:j.object({npm:j.string().optional(),api:j.string().optional()}).optional()}),e=j.object({api:j.string().optional(),name:j.string(),env:j.array(j.string()),id:j.string(),npm:j.string().optional(),models:j.record(j.string(),r)});var Vj=h.create({service:"models.dev"}),bj=Fj(),F=hj.join(Nj.Path.cache,bj==="https://models.dev"?"models.json":`models-${Ij.fast(bj)}.json`),gj=300000,Aj=8388608,T,dj=j.record(j.string(),e),pj=r,cj=e;function Fj(){return I.QITQODE_MODELS_URL||"https://models.dev"}function lj(){return Date.now()-Number(i.stat(F)?.mtimeMs??0)<gj}function Lj(J){return!J&&lj()}function g(J){let V=dj.parse(typeof J==="string"?JSON.parse(J):J);for(let[_,$]of Object.entries(V))if($.id!==_)throw Error(`Invalid model provider: ${_}`);return V}async function zj(J){let V=await i.readJson(J).catch(()=>{return});if(!V)return;try{return g(V)}catch(_){Vj.warn("Ignoring invalid model catalog cache",{file:J,error:_});return}}async function Pj(J,V,_=Aj){let $=J.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase();if($!=="application/json"&&!$?.endsWith("+json"))throw Error(`Invalid model catalog content type: ${$||"missing"}`);let W=Number(J.headers.get("content-length"));if(Number.isFinite(W)&&W>_)throw Error("Model catalog response is too large");if(!J.body)return"";let w=J.body.getReader(),R=()=>void w.cancel(V.reason);V.addEventListener("abort",R,{once:!0});let G=new Uint8Array(_),q=0;try{for(;;){let B=await w.read();if(B.done)break;if(q+=B.value.byteLength,q>_)throw await w.cancel(),Error("Model catalog response is too large");G.set(B.value,q-B.value.byteLength)}}finally{V.removeEventListener("abort",R)}return new TextDecoder().decode(G.subarray(0,q))}var Tj=async()=>{let J=AbortSignal.timeout(1e4),V=await fetch(`${Fj()}/api.json`,{headers:{"User-Agent":U.USER_AGENT},signal:J});if(!V.ok)return;let _=g(await Pj(V,J));return JSON.stringify(_)},S=vj(async()=>{let J=await zj(I.QITQODE_MODELS_PATH??F);if(J)return J;let V=await import("./chunk-087tnr8a.js").then((_)=>g(_.snapshot)).catch(()=>{return});if(V)return V;if(I.QITQODE_DISABLE_MODELS_FETCH)return{};return Jj.withLock(`models-dev:${F}`,async()=>{let _=await zj(I.QITQODE_MODELS_PATH??F);if(_)return _;let $=await Tj();if($)return await i.write(F,$).catch((W)=>{Vj.error("Failed to write models cache",{error:W})}),g($);return{}})});async function fj(){return S()}async function jj(J=!1){if(Lj(J))return S.reset();await Jj.withLock(`models-dev:${F}`,async()=>{if(Lj(J))return S.reset();let V=await Tj();if(!V)return;await i.write(F,V),S.reset()}).catch((V)=>{Vj.error("Failed to fetch models.dev",{error:V})})}function sj(){if(T||I.QITQODE_DISABLE_MODELS_FETCH||process.argv.includes("--get-yargs-completions"))return;jj(),T=setInterval(async()=>{await jj()},3600000),T.unref()}function aj(){if(!T)return;clearInterval(T),T=void 0}
|
|
3
|
-
export{_j as
|
|
2
|
+
import{Tl as f,Ul as Gj,Vl as Rj,Wl as Hj,Zl as s}from"./chunk-fsahzvd5.js";import{Jn as xj}from"./chunk-9zm6r55d.js";import{Pn as vj}from"./chunk-khzzmyk2.js";import{$q as Kj,Tq as P,Uq as wj,_q as k}from"./chunk-73r8bjjz.js";import{ds as a,es as y}from"./chunk-0vakk88p.js";import{Ns as I,Ws as h}from"./chunk-tr6rdr6h.js";import{ft as i,gt as Ij,ht as Jj,kt as Nj}from"./chunk-at22twxx.js";import{lt as j}from"./chunk-kgptyf7n.js";import{DE as o,TN as C,XJ as l,YE as d,eH as Q,zB as Wj}from"./chunk-qnvsqnz5.js";import{sO as Mj,uO as Oj,wO as Ej}from"./chunk-r9w0thdk.js";var tj={};Oj(tj,{stopRefresh:()=>aj,startRefresh:()=>sj,refresh:()=>jj,readModelCatalogResponse:()=>Pj,get:()=>fj,Provider:()=>cj,Model:()=>pj,MODEL_CATALOG_MAX_BYTES:()=>Aj,Data:()=>S});import hj from"path";var U={};Oj(U,{layer:()=>Bj,isPreview:()=>ij,isNewerVersion:()=>qj,isLocal:()=>mj,getReleaseType:()=>yj,defaultLayer:()=>uj,UpgradeFailedError:()=>x,USER_AGENT:()=>Sj,Service:()=>E,Installation:()=>U,Info:()=>Uj,Event:()=>Cj});var _j=(J)=>J.pipe(k.retryTransient({retryOn:"errors-and-responses",times:2,schedule:d.exponential(200).pipe(d.jittered)}));import Yj from"path";var z=Mj(xj(),1);import n from"crypto";import v from"fs";import Zj from"path";class H extends Error{constructor(J){super(J);this.name="SelfUpdateError"}}function $j(J){let V=J?.platform??process.platform,_=J?.arch??process.arch,$=J?.libc??"bionic",W=["qitqode",V==="win32"?"windows":V,_];if(_==="x64")W.push("baseline");if(V==="linux"&&$==="musl")W.push("musl");return`@qitqode/${W.join("-")}`}function kj(J,V){if(V.integrity){let _=V.integrity.match(/^(sha512|sha384|sha256)-([A-Za-z0-9+/=]+)$/);if(!_)throw new H(`registry returned an unrecognized integrity string: ${V.integrity}`);if(n.createHash(_[1]).update(J).digest("base64")!==_[2])throw new H(`checksum mismatch: downloaded tarball does not match the registry ${_[1]} integrity value; refusing to install`);return}if(V.shasum){if(n.createHash("sha1").update(J).digest("hex")!==V.shasum.toLowerCase())throw new H("checksum mismatch: downloaded tarball does not match the registry shasum; refusing to install");return}throw new H("registry provided no integrity metadata for the tarball; refusing to install")}function Qj(J,V){let _=(w,R)=>{let G=w,q=w+R;while(G<q&&J[G]!==0)G++;return new TextDecoder().decode(J.subarray(w,G))},$=0,W;while($+512<=J.length){if(J.subarray($,$+512).every((Z)=>Z===0))break;let R=_($+124,12).trim(),G=R?parseInt(R,8):0;if(!Number.isFinite(G)||G<0)throw new H("downloaded tarball is corrupt (bad tar header)");let q=String.fromCharCode(J[$+156]),B=_($,100),N=_($+345,155);if(N)B=`${N}/${B}`;if(W)B=W,W=void 0;let b=$+512,X=b+G;if(q==="L")W=new TextDecoder().decode(J.subarray(b,X)).replace(/\0+$/,"");else if((q==="0"||q==="\x00"||q==="")&&B===V)return J.slice(b,X);$=b+Math.ceil(G/512)*512}return}var A=(J)=>String(J instanceof Error?J.message:J),u=(J)=>Q.fail(new H(J)),p=(J,V)=>Q.try({try:J,catch:(_)=>new H(V(_))}),Xj=Q.fnUntraced(function*(J){let{target:V,execPath:_,packageName:$,registry:W}=J,w=J.gunzip??((K)=>Bun.gunzipSync(K)),R=Zj.dirname(_);yield*p(()=>v.accessSync(R,v.constants.W_OK),()=>`no write permission for ${R}; cannot replace ${_}. Fix the directory permissions or re-run with sufficient privileges.`);let G=`${W}/${$}/${encodeURIComponent(V)}`,B=(yield*J.fetchJson(G).pipe(Q.mapError((K)=>new H(`download failed: could not fetch ${$}@${V} from ${W} (${A(K)}). Check your network connection and that version ${V} exists.`))))?.dist;if(!B?.tarball)return yield*u(`registry response for ${$}@${V} has no tarball URL; cannot self-update`);let N=B.tarball,b=yield*J.fetchBytes(N).pipe(Q.mapError((K)=>new H(`download failed: could not download ${N} (${A(K)}). Check your network connection and try again.`)));yield*Q.try({try:()=>kj(b,B),catch:(K)=>K instanceof H?K:new H(A(K))});let X=yield*Q.try({try:()=>w(b),catch:()=>new H("downloaded tarball is corrupt (gunzip failed); try again")}),Z=Qj(X,"package/bin/qitqode")??Qj(X,"package/bin/qitqode.exe");if(!Z||Z.length===0)return yield*u(`tarball for ${$}@${V} does not contain the expected binary at bin/qitqode`);let O=Zj.join(R,`.qitqode-upgrade-${process.pid}`),Y=`${_}.backup-${process.pid}`,D=(K)=>{try{v.rmSync(K,{force:!0})}catch{}};yield*p(()=>v.writeFileSync(O,Z,{mode:493}),(K)=>{return D(O),`no write permission: could not write ${O} (${A(K)})`});let L=yield*J.runVersion(O).pipe(Q.mapError((K)=>{return D(O),new H(`downloaded binary failed its --version check (${A(K)}); keeping the current installation`)}));if(L.code!==0)return D(O),yield*u(`downloaded binary failed its --version check (exit ${L.code}); keeping the current installation`);let m=L.stdout.trim();if(m&&!m.includes(V))return D(O),yield*u(`downloaded binary reports version "${m}" instead of ${V}; keeping the current installation`);yield*p(()=>v.renameSync(_,Y),(K)=>{return D(O),`could not move the current binary aside (${A(K)}); check permissions on ${_}`}),yield*Q.try({try:()=>v.renameSync(O,_),catch:(K)=>{try{v.renameSync(Y,_)}catch{return new H(`failed to install the new binary AND failed to restore the old one; your previous binary is preserved at ${Y} \u2014 move it back to ${_} manually`)}return D(O),new H(`could not install the new binary (${A(K)}); the previous version was restored`)}}),D(Y)});var c=h.create({service:"installation"}),M="@qitqode/cli";function qj(J,V){if(!z.default.valid(J)||!z.default.valid(V))return!1;return z.default.gt(V,J)}var Cj={Updated:s.define("installation.updated",j.object({version:j.string()})),UpdateAvailable:s.define("installation.update-available",j.object({version:j.string()}))};function yj(J,V){if(!qj(J,V))throw Error(`Version ${V} is not newer than ${J}`);let _=z.default.major(J),$=z.default.minor(J),W=z.default.major(V),w=z.default.minor(V);if(W>_)return"major";if(w>$)return"minor";return"patch"}var Uj=j.object({version:j.string(),latest:j.string()}).meta({ref:"InstallationInfo"}),Sj=`qitqode/${y}/${a}/${I.QITQODE_CLIENT}`;function ij(){return y!=="latest"}function mj(){return y==="local"}class x extends C.TaggedErrorClass()("UpgradeFailedError",{stderr:C.String}){}var nj=C.Struct({version:C.String});class E extends Wj.Service()("@qitqode/Installation"){}var Bj=o.effect(E,Q.gen(function*(){let J=yield*k.HttpClient,V=k.filterStatusOk(_j(J)),_=yield*f.ChildProcessSpawner,$=(X,Z)=>Gj.make(X[0],X.slice(1),{cwd:Z?.cwd,env:Z?.env,extendEnv:!0}),W=Q.fnUntraced(function*(X){let Z=yield*Hj(_,X);return{code:Z.code,stdout:Z.text,stderr:Z.stderr}},Q.scoped),w=Q.fnUntraced(function*(X,Z){let O=yield*_.spawn($(X,Z)),Y=yield*l.mkString(l.decodeText(O.stdout));return yield*O.exitCode,Y},Q.scoped,Q.catch(()=>Q.succeed(""))),R=Q.fnUntraced(function*(X,Z){return yield*W($(X,Z))},Q.catch(()=>Q.succeed({code:f.ExitCode(1),stdout:"",stderr:""}))),G=Q.fn("Installation.method")(function*(){if(process.execPath.includes(Yj.join(".qitqode","bin")))return"curl";if(process.execPath.includes(Yj.join(".local","bin")))return"curl";let X=process.execPath.toLowerCase(),Z=[{name:"npm",command:()=>w(["npm","list","-g","--depth=0"])},{name:"pnpm",command:()=>w(["pnpm","list","-g","--depth=0"])},{name:"bun",command:()=>w(["bun","pm","ls","-g"])}];Z.sort((O,Y)=>{let D=X.includes(O.name),L=X.includes(Y.name);if(D&&!L)return-1;if(!D&&L)return 1;return 0});for(let O of Z)if((yield*O.command()).includes(M))return O.name;return"unknown"}),q=Q.fn("Installation.latest")(function*(X){let Z=X||(yield*G());if(Z==="curl"){let Y=(yield*w(["curl","-sI","https://github.com/qitqode/qitqode/releases/latest"])).match(/^location:.*\/tag\/v([0-9][^\s/]*)/im);if(Y)return Y[1];return yield*Q.die(Error("failed to resolve latest version from GitHub releases redirect"))}if(Z==="npm"||Z==="bun"||Z==="pnpm"){let Y=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org",D=Y.endsWith("/")?Y.slice(0,-1):Y,L=yield*V.execute(P.get(`${D}/${encodeURIComponent(M)}/${y}`).pipe(P.acceptJson));return(yield*wj.schemaBodyJson(nj)(L)).version}return c.warn("unsupported update channel, skipping",{method:Z}),yield*Q.die(Error(`unsupported update channel: ${Z}`))},Q.orDie),B=Q.fnUntraced(function*(){let Z=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org";return Z.endsWith("/")?Z.slice(0,-1):Z}),N=Q.fnUntraced(function*(X){let Z=yield*B();yield*Xj({target:X,execPath:process.env.QITQODE_SELF_UPDATE_TARGET_BINARY||process.execPath,packageName:$j(),registry:Z,fetchJson:(O)=>V.execute(P.get(O).pipe(P.acceptJson)).pipe(Q.flatMap((Y)=>Y.json)),fetchBytes:(O)=>V.execute(P.get(O)).pipe(Q.flatMap((Y)=>Y.arrayBuffer),Q.map((Y)=>new Uint8Array(Y))),runVersion:(O)=>R([O,"--version"]).pipe(Q.map((Y)=>({code:Y.code,stdout:Y.stdout})))}).pipe(Q.mapError((O)=>new x({stderr:O.message})))}),b=Q.fn("Installation.upgrade")(function*(X,Z){if(X==="curl"){yield*N(Z),c.info("upgraded",{method:X,target:Z});return}let Y=yield*(()=>{if(X==="npm")return R(["npm","install","-g",`${M}@${Z}`]);if(X==="pnpm")return R(["pnpm","install","-g",`${M}@${Z}`]);if(X==="bun")return R(["bun","install","-g",`${M}@${Z}`]);return new x({stderr:`Unknown method: ${X}`})})();if(Y.code!==0){let D=Y.stderr||"";return yield*new x({stderr:D})}c.info("upgraded",{method:X,target:Z,stdout:Y.stdout,stderr:Y.stderr}),yield*w([process.execPath,"--version"])});return E.of({info:Q.fn("Installation.info")(function*(){return{version:a,latest:yield*q()}}),method:G,latest:q,upgrade:b})})),uj=Bj.pipe(o.provide(Kj.layer),o.provide(Rj));var t=j.lazy(()=>j.union([j.string(),j.number(),j.boolean(),j.null(),j.array(t),j.record(j.string(),t)])),Dj=j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional(),context_over_200k:j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional()}).optional()}),r=j.object({id:j.string(),name:j.string(),family:j.string().optional(),release_date:j.string(),attachment:j.boolean(),reasoning:j.boolean(),temperature:j.boolean().optional(),tool_call:j.boolean(),interleaved:j.union([j.literal(!0),j.object({field:j.enum(["reasoning_content","reasoning_details"])}).strict()]).optional(),cost:Dj.optional(),limit:j.object({context:j.number(),input:j.number().optional(),output:j.number()}),modalities:j.object({input:j.array(j.enum(["text","audio","image","video","pdf"])),output:j.array(j.enum(["text","audio","image","video","pdf"]))}).optional(),experimental:j.object({modes:j.record(j.string(),j.object({cost:Dj.optional(),provider:j.object({body:j.record(j.string(),t).optional(),headers:j.record(j.string(),j.string()).optional()}).optional()})).optional()}).optional(),status:j.enum(["alpha","beta","deprecated"]).optional(),provider:j.object({npm:j.string().optional(),api:j.string().optional()}).optional()}),e=j.object({api:j.string().optional(),name:j.string(),env:j.array(j.string()),id:j.string(),npm:j.string().optional(),models:j.record(j.string(),r)});var Vj=h.create({service:"models.dev"}),bj=Fj(),F=hj.join(Nj.Path.cache,bj==="https://models.dev"?"models.json":`models-${Ij.fast(bj)}.json`),gj=300000,Aj=8388608,T,dj=j.record(j.string(),e),pj=r,cj=e;function Fj(){return I.QITQODE_MODELS_URL||"https://models.dev"}function lj(){return Date.now()-Number(i.stat(F)?.mtimeMs??0)<gj}function Lj(J){return!J&&lj()}function g(J){let V=dj.parse(typeof J==="string"?JSON.parse(J):J);for(let[_,$]of Object.entries(V))if($.id!==_)throw Error(`Invalid model provider: ${_}`);return V}async function zj(J){let V=await i.readJson(J).catch(()=>{return});if(!V)return;try{return g(V)}catch(_){Vj.warn("Ignoring invalid model catalog cache",{file:J,error:_});return}}async function Pj(J,V,_=Aj){let $=J.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase();if($!=="application/json"&&!$?.endsWith("+json"))throw Error(`Invalid model catalog content type: ${$||"missing"}`);let W=Number(J.headers.get("content-length"));if(Number.isFinite(W)&&W>_)throw Error("Model catalog response is too large");if(!J.body)return"";let w=J.body.getReader(),R=()=>void w.cancel(V.reason);V.addEventListener("abort",R,{once:!0});let G=new Uint8Array(_),q=0;try{for(;;){let B=await w.read();if(B.done)break;if(q+=B.value.byteLength,q>_)throw await w.cancel(),Error("Model catalog response is too large");G.set(B.value,q-B.value.byteLength)}}finally{V.removeEventListener("abort",R)}return new TextDecoder().decode(G.subarray(0,q))}var Tj=async()=>{let J=AbortSignal.timeout(1e4),V=await fetch(`${Fj()}/api.json`,{headers:{"User-Agent":U.USER_AGENT},signal:J});if(!V.ok)return;let _=g(await Pj(V,J));return JSON.stringify(_)},S=vj(async()=>{let J=await zj(I.QITQODE_MODELS_PATH??F);if(J)return J;let V=await import("./chunk-hwrrrbqd.js").then((_)=>g(_.snapshot)).catch(()=>{return});if(V)return V;if(I.QITQODE_DISABLE_MODELS_FETCH)return{};return Jj.withLock(`models-dev:${F}`,async()=>{let _=await zj(I.QITQODE_MODELS_PATH??F);if(_)return _;let $=await Tj();if($)return await i.write(F,$).catch((W)=>{Vj.error("Failed to write models cache",{error:W})}),g($);return{}})});async function fj(){return S()}async function jj(J=!1){if(Lj(J))return S.reset();await Jj.withLock(`models-dev:${F}`,async()=>{if(Lj(J))return S.reset();let V=await Tj();if(!V)return;await i.write(F,V),S.reset()}).catch((V)=>{Vj.error("Failed to fetch models.dev",{error:V})})}function sj(){if(T||I.QITQODE_DISABLE_MODELS_FETCH||process.argv.includes("--get-yargs-completions"))return;jj(),T=setInterval(async()=>{await jj()},3600000),T.unref()}function aj(){if(!T)return;clearInterval(T),T=void 0}
|
|
3
|
+
export{_j as el,U as fl,Aj as gl,pj as hl,cj as il,Pj as jl,S as kl,fj as ll,jj as ml,sj as nl,aj as ol,tj as pl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-8wwdrwf2.js";import"./chunk-r9w0thdk.js";var e={"ui.sessionReview.title":"\u5DE5\u4F5C\u968E\u6BB5\u8B8A\u66F4","ui.sessionReview.title.lastTurn":"\u4E0A\u4E00\u8F2A\u8B8A\u66F4","ui.sessionReview.diffStyle.unified":"\u6574\u5408","ui.sessionReview.diffStyle.split":"\u62C6\u5206","ui.sessionReview.openFile":"\u958B\u555F\u6A94\u6848","ui.sessionReview.selection.line":"\u7B2C {{line}} \u884C","ui.sessionReview.selection.lines":"\u7B2C {{start}}-{{end}} \u884C","ui.sessionReview.expandAll":"\u5168\u90E8\u5C55\u958B","ui.sessionReview.collapseAll":"\u5168\u90E8\u6536\u5408","ui.sessionReview.change.added":"\u5DF2\u65B0\u589E","ui.sessionReview.change.removed":"\u5DF2\u79FB\u9664","ui.sessionReview.change.modified":"\u5DF2\u4FEE\u6539","ui.sessionReview.image.loading":"\u8F09\u5165\u4E2D...","ui.sessionReview.image.placeholder":"\u5716\u7247","ui.sessionReview.largeDiff.title":"\u5DEE\u7570\u904E\u5927\uFF0C\u7121\u6CD5\u6E32\u67D3","ui.sessionReview.largeDiff.meta":"\u9650\u5236\uFF1A{{limit}} \u884C\u8B8A\u66F4\u3002\u76EE\u524D\uFF1A{{current}} \u884C\u8B8A\u66F4\u3002","ui.sessionReview.largeDiff.renderAnyway":"\u4ECD\u7136\u6E32\u67D3","ui.fileMedia.kind.image":"\u5716\u7247","ui.fileMedia.kind.audio":"\u97F3\u8A0A","ui.fileMedia.state.removed":"{{kind}}\u5DF2\u79FB\u9664","ui.fileMedia.state.loading":"\u6B63\u5728\u8F09\u5165{{kind}}...","ui.fileMedia.state.error":"\u8F09\u5165{{kind}}\u5931\u6557","ui.fileMedia.state.unavailable":"{{kind}}\u7121\u6CD5\u9810\u89BD","ui.fileMedia.binary.title":"\u4E8C\u9032\u4F4D\u6A94\u6848","ui.fileMedia.binary.description.path":"\u7121\u6CD5\u986F\u793A {{path}}\uFF0C\u56E0\u70BA\u5B83\u662F\u4E8C\u9032\u4F4D\u6A94\u6848\u3002","ui.fileMedia.binary.description.default":"\u7121\u6CD5\u986F\u793A\u6B64\u6A94\u6848\uFF0C\u56E0\u70BA\u5B83\u662F\u4E8C\u9032\u4F4D\u6A94\u6848\u3002","ui.lineComment.label.prefix":"\u8A55\u8AD6 ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"\u6B63\u5728\u8A55\u8AD6 ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"\u65B0\u589E\u8A55\u8AD6","ui.lineComment.submit":"\u8A55\u8AD6","ui.sessionTurn.steps.show":"\u986F\u793A\u6B65\u9A5F","ui.sessionTurn.steps.hide":"\u96B1\u85CF\u6B65\u9A5F","ui.sessionTurn.summary.response":"\u56DE\u8986","ui.sessionTurn.diff.showMore":"\u986F\u793A\u66F4\u591A\u8B8A\u66F4 ({{count}})","ui.sessionTurn.retry.retrying":"\u91CD\u8A66\u4E2D","ui.sessionTurn.retry.inSeconds":"{{seconds}} \u79D2\u5F8C","ui.sessionTurn.retry.attempt":"\u7B2C {{attempt}} \u6B21","ui.sessionTurn.retry.attemptLine":"{{line}} - \u7B2C {{attempt}} \u6B21","ui.sessionTurn.retry.geminiHot":"gemini \u76EE\u524D\u904E\u8F09","ui.sessionTurn.error.freeUsageExceeded":"\u514D\u8CBB\u4F7F\u7528\u984D\u5EA6\u5DF2\u7528\u5B8C","ui.sessionTurn.error.addQredits":"\u65B0\u589E\u9EDE\u6578","ui.sessionTurn.status.delegating":"\u6B63\u5728\u59D4\u6D3E\u5DE5\u4F5C","ui.sessionTurn.status.planning":"\u6B63\u5728\u898F\u5283\u4E0B\u4E00\u6B65","ui.sessionTurn.status.gatheringContext":"\u6B63\u5728\u63A2\u7D22","ui.sessionTurn.status.gatheredContext":"\u5DF2\u63A2\u7D22","ui.sessionTurn.status.searchingCodebase":"\u6B63\u5728\u641C\u5C0B\u7A0B\u5F0F\u78BC\u5EAB","ui.sessionTurn.status.searchingWeb":"\u6B63\u5728\u641C\u5C0B\u7DB2\u9801","ui.sessionTurn.status.makingEdits":"\u6B63\u5728\u4FEE\u6539","ui.sessionTurn.status.runningCommands":"\u6B63\u5728\u57F7\u884C\u547D\u4EE4","ui.sessionTurn.status.thinking":"\u601D\u8003\u4E2D","ui.sessionTurn.status.thinkingWithTopic":"\u601D\u8003 - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"\u6B63\u5728\u6574\u7406\u601D\u7DD2","ui.sessionTurn.status.consideringNextSteps":"\u6B63\u5728\u8003\u616E\u4E0B\u4E00\u6B65","ui.messagePart.questions.dismissed":"\u554F\u984C\u5DF2\u7565\u904E","ui.messagePart.compaction":"\u5DE5\u4F5C\u968E\u6BB5\u5DF2\u58D3\u7E2E","ui.messagePart.context.read.one":"{{count}} \u6B21\u8B80\u53D6","ui.messagePart.context.read.other":"{{count}} \u6B21\u8B80\u53D6","ui.messagePart.context.search.one":"{{count}} \u6B21\u641C\u5C0B","ui.messagePart.context.search.other":"{{count}} \u6B21\u641C\u5C0B","ui.messagePart.context.list.one":"{{count}} \u500B\u6E05\u55AE","ui.messagePart.context.list.other":"{{count}} \u500B\u6E05\u55AE","ui.messagePart.diagnostic.error":"\u932F\u8AA4","ui.messagePart.title.edit":"\u7DE8\u8F2F","ui.messagePart.title.write":"\u5BEB\u5165","ui.messagePart.option.typeOwnAnswer":"\u8F38\u5165\u81EA\u5DF1\u7684\u7B54\u6848","ui.messagePart.review.title":"\u6AA2\u67E5\u4F60\u7684\u7B54\u6848","ui.list.loading":"\u8F09\u5165\u4E2D","ui.list.empty":"\u7121\u7D50\u679C","ui.list.clearFilter":"\u6E05\u9664\u7BE9\u9078","ui.list.emptyWithFilter.prefix":"\u6C92\u6709\u95DC\u65BC","ui.list.emptyWithFilter.suffix":"\u7684\u7D50\u679C","ui.messageNav.newMessage":"\u65B0\u8A0A\u606F","ui.textField.copyToClipboard":"\u8907\u88FD\u5230\u526A\u8CBC\u7C3F","ui.textField.copyLink":"\u8907\u88FD\u9023\u7D50","ui.textField.copied":"\u5DF2\u8907\u88FD","ui.imagePreview.alt":"\u5716\u7247\u9810\u89BD","ui.scrollView.ariaLabel":"\u53EF\u6372\u52D5\u5167\u5BB9","ui.tool.read":"\u8B80\u53D6","ui.tool.loaded":"\u5DF2\u8F09\u5165","ui.tool.list":"\u6E05\u55AE","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"\u7DB2\u9801\u641C\u5C0B","ui.tool.codesearch":"\u7A0B\u5F0F\u78BC\u641C\u5C0B","ui.tool.shell":"Shell","ui.tool.patch":"\u4FEE\u88DC","ui.tool.todos":"\u5F85\u8FA6","ui.tool.todos.read":"\u8B80\u53D6\u5F85\u8FA6","ui.tool.questions":"\u554F\u984C","ui.tool.agent":"{{type}} \u4EE3\u7406\u7A0B\u5F0F","ui.tool.agent.default":"\u4EE3\u7406\u7A0B\u5F0F","ui.common.file.one":"\u500B\u6A94\u6848","ui.common.file.other":"\u500B\u6A94\u6848","ui.common.question.one":"\u500B\u554F\u984C","ui.common.question.other":"\u500B\u554F\u984C","ui.common.add":"\u65B0\u589E","ui.common.back":"\u8FD4\u56DE","ui.common.cancel":"\u53D6\u6D88","ui.common.confirm":"\u78BA\u8A8D","ui.common.dismiss":"\u5FFD\u7565","ui.common.close":"\u95DC\u9589","ui.common.next":"\u4E0B\u4E00\u6B65","ui.common.submit":"\u63D0\u4EA4","ui.permission.deny":"\u62D2\u7D55","ui.permission.allowAlways":"\u6C38\u9060\u5141\u8A31","ui.permission.allowOnce":"\u5141\u8A31\u4E00\u6B21","ui.message.expand":"\u5C55\u958B\u8A0A\u606F","ui.message.collapse":"\u6536\u5408\u8A0A\u606F","ui.message.copy":"\u8907\u88FD","ui.message.copyMessage":"\u8907\u88FD\u8A0A\u606F","ui.message.forkMessage":"\u5206\u652F\u5230\u65B0\u5DE5\u4F5C\u968E\u6BB5","ui.message.revertMessage":"\u91CD\u8A2D\u81F3\u6B64\u9EDE","ui.message.copyResponse":"\u8907\u88FD\u56DE\u8986","ui.message.copied":"\u5DF2\u8907\u88FD\uFF01","ui.message.interrupted":"\u5DF2\u4E2D\u65B7","ui.message.queued":"\u6392\u968A\u4E2D","ui.message.attachment.alt":"\u9644\u4EF6","ui.patch.action.deleted":"\u5DF2\u522A\u9664","ui.patch.action.created":"\u5DF2\u5EFA\u7ACB","ui.patch.action.moved":"\u5DF2\u79FB\u52D5","ui.patch.action.patched":"\u5DF2\u5957\u7528\u4FEE\u88DC","ui.question.subtitle.answered":"{{count}} \u5DF2\u56DE\u7B54","ui.question.answer.none":"(\u7121\u7B54\u6848)","ui.question.review.notAnswered":"(\u672A\u56DE\u7B54)","ui.question.multiHint":"\u53EF\u591A\u9078","ui.question.singleHint":"\u9078\u64C7\u4E00\u500B\u7B54\u6848","ui.question.custom.placeholder":"\u8F38\u5165\u4F60\u7684\u7B54\u6848...","ui.fileSearch.placeholder":"\u641C\u5C0B","ui.fileSearch.previousMatch":"\u4E0A\u4E00\u500B","ui.fileSearch.nextMatch":"\u4E0B\u4E00\u500B","ui.fileSearch.close":"\u95DC\u9589\u641C\u5C0B","ui.tool.task":"\u4EFB\u52D9","ui.tool.skill":"\u6280\u80FD","ui.basicTool.called":"\u547C\u53EB\u4E86 `{{tool}}`","ui.toolErrorCard.failed":"\u5931\u6557","ui.toolErrorCard.copyError":"\u8907\u88FD\u932F\u8AA4","ui.message.duration.seconds":"{{count}}\u79D2","ui.message.duration.minutesSeconds":"{{minutes}}\u5206 {{seconds}}\u79D2"};export{e as dict};
|