@qitqode/qitqode-android-arm64 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/{chunk-cshsqavb.js → chunk-00krzh3y.js} +2 -2
- package/bundle/{chunk-42gd2vx4.js → chunk-04x4b2yy.js} +1 -1
- package/bundle/{chunk-vyf77kq1.js → chunk-08mgb5tt.js} +2 -2
- package/bundle/{chunk-7jvx29js.js → chunk-094m66q5.js} +1 -1
- package/bundle/{chunk-9d8meavf.js → chunk-0cjp9088.js} +1 -1
- package/bundle/{chunk-hav9pgf3.js → chunk-0mdmqtfr.js} +2 -2
- package/bundle/chunk-0nves64y.js +2 -0
- package/bundle/chunk-0v7knkt5.js +2 -0
- package/bundle/{chunk-y565z8n2.js → chunk-0w77vhg4.js} +2 -2
- package/bundle/{chunk-ex47pb9n.js → chunk-0ware2sh.js} +2 -2
- package/bundle/{chunk-9svh74gt.js → chunk-0xf12tf3.js} +1 -1
- package/bundle/{chunk-1rsabv4p.js → chunk-139qfnsq.js} +1 -1
- package/bundle/chunk-1851skhm.js +10 -0
- package/bundle/{chunk-92xxg12q.js → chunk-1bbx1da7.js} +1 -1
- package/bundle/{chunk-89b6ttzs.js → chunk-1bhcg889.js} +1 -1
- package/bundle/{chunk-g83d3a0t.js → chunk-1exjy880.js} +2 -2
- package/bundle/{chunk-s3zmxfz2.js → chunk-1f9qcrn6.js} +2 -2
- package/bundle/{chunk-5mgmq6yz.js → chunk-1gt6ppza.js} +1 -1
- package/bundle/chunk-1h5jdsgx.js +2 -0
- package/bundle/{chunk-k4d8gwxe.js → chunk-1q5h95hc.js} +1 -1
- package/bundle/chunk-1r5e1jsb.js +2 -0
- package/bundle/{chunk-7wshaze9.js → chunk-1rafe6f5.js} +2 -2
- package/bundle/{chunk-22wa8zty.js → chunk-1rw4srd1.js} +1 -1
- package/bundle/{chunk-rvev3cy6.js → chunk-1sejtx9a.js} +2 -2
- package/bundle/{chunk-1yh1f9yj.js → chunk-1wy8wmah.js} +1 -1
- package/bundle/chunk-1wyy3c48.js +2 -0
- package/bundle/chunk-1z299xq6.js +2 -0
- package/bundle/{chunk-f78yth0b.js → chunk-21aqt31s.js} +1 -1
- package/bundle/chunk-22aq9ymg.js +2 -0
- package/bundle/chunk-26a17c9z.js +2 -0
- package/bundle/chunk-2a154mr0.js +2 -0
- package/bundle/{chunk-n2ytaxyn.js → chunk-2b80n6nx.js} +1 -1
- package/bundle/{chunk-fqvrxy41.js → chunk-2bfq0mtx.js} +1 -1
- package/bundle/{chunk-tqnf1p88.js → chunk-2d0vympj.js} +1 -1
- package/bundle/{chunk-wdy0fsp8.js → chunk-2md5fz4f.js} +1 -1
- package/bundle/chunk-2nbce486.js +2 -0
- package/bundle/chunk-2npxatq9.js +2 -0
- package/bundle/{chunk-xf1y0sc6.js → chunk-2p1qaqv3.js} +1 -1
- package/bundle/{chunk-3hawwbw6.js → chunk-2ts2s8b4.js} +2 -2
- package/bundle/{chunk-43x9n8rp.js → chunk-374js0y6.js} +1 -1
- package/bundle/{chunk-wp0xd7at.js → chunk-3be70hxy.js} +1 -1
- package/bundle/{chunk-kr975sx0.js → chunk-3fx3eghq.js} +1 -1
- package/bundle/{chunk-cs3cbfm8.js → chunk-3gryj9r9.js} +1 -1
- package/bundle/{chunk-9wzxnwv7.js → chunk-3jnanbjr.js} +1 -1
- package/bundle/chunk-3meh1cbc.js +2 -0
- package/bundle/{chunk-pfd8gzy4.js → chunk-3rcfy8te.js} +1 -1
- package/bundle/{chunk-cgxzmkkf.js → chunk-3t71xfr6.js} +1 -1
- package/bundle/chunk-4045jzv5.js +2 -0
- package/bundle/{chunk-wzfb19t6.js → chunk-404ew3d3.js} +1 -1
- package/bundle/{chunk-zskjqrmc.js → chunk-45dtsre6.js} +1 -1
- package/bundle/chunk-47pxz6cb.js +5 -0
- package/bundle/{chunk-4805mxf7.js → chunk-4ar8hey8.js} +1 -1
- package/bundle/chunk-4b2vv484.js +2 -0
- package/bundle/chunk-4ene1ymj.js +2 -0
- package/bundle/{chunk-y24yxs9g.js → chunk-4enhsmq1.js} +1 -1
- package/bundle/{chunk-zj5snrsa.js → chunk-4krmja97.js} +1 -1
- package/bundle/{chunk-46ewdxgh.js → chunk-4s9d2zte.js} +1 -1
- package/bundle/{chunk-51vn4f06.js → chunk-4wzv2v36.js} +2 -2
- package/bundle/{chunk-vhh80d5j.js → chunk-53n3tfwn.js} +2 -2
- package/bundle/{chunk-fqvsxg00.js → chunk-5828bcp8.js} +1 -1
- package/bundle/chunk-58r5etg8.js +2 -0
- package/bundle/{chunk-rx29zmw2.js → chunk-5a4zt1b7.js} +1 -1
- package/bundle/chunk-5c2zw4h0.js +2 -0
- package/bundle/{chunk-e9vh8d52.js → chunk-5e0vejcb.js} +2 -2
- package/bundle/{chunk-y7cqyeve.js → chunk-5es19n1m.js} +2 -2
- package/bundle/{chunk-r4qpsa4e.js → chunk-5fbzvy6q.js} +1 -1
- package/bundle/{chunk-pcmsxhrb.js → chunk-5gv6r7v8.js} +1 -1
- package/bundle/{chunk-hama2v6a.js → chunk-5psekq9f.js} +1 -1
- package/bundle/{chunk-vf75j9wd.js → chunk-5rtsnnjk.js} +1 -1
- package/bundle/{chunk-t3e19wdp.js → chunk-5wjwzbk8.js} +1 -1
- package/bundle/chunk-608f83n0.js +2 -0
- package/bundle/{chunk-zjfdptdj.js → chunk-610mqqqa.js} +1 -1
- package/bundle/chunk-671r50ry.js +2 -0
- package/bundle/chunk-6bfnhr3d.js +2 -0
- package/bundle/chunk-6cv6d8rw.js +2 -0
- package/bundle/{chunk-mazakqr7.js → chunk-6dmk2eyt.js} +1 -1
- package/bundle/{chunk-x28chfpz.js → chunk-6g3bzap8.js} +2 -2
- package/bundle/{chunk-qtdxy2q1.js → chunk-6jb4mnvq.js} +2 -2
- package/bundle/{chunk-8z65v9c9.js → chunk-6kpk6pr3.js} +1 -1
- package/bundle/chunk-6qm6f88j.js +2 -0
- package/bundle/{chunk-bxc3z38f.js → chunk-6wt8g6mc.js} +2 -2
- package/bundle/{chunk-nvvja3ch.js → chunk-71naz1qp.js} +1 -1
- package/bundle/{chunk-3amgvg81.js → chunk-72qx43fq.js} +1 -1
- package/bundle/chunk-78bfwwmc.js +2 -0
- package/bundle/{chunk-hts68y73.js → chunk-78rfz0ex.js} +1 -1
- package/bundle/{chunk-075gkea2.js → chunk-7bvh48s2.js} +1 -1
- package/bundle/{chunk-71h3pmnn.js → chunk-7h0regqs.js} +1 -1
- package/bundle/{chunk-4c6d1wy1.js → chunk-7k1q26yn.js} +2 -2
- package/bundle/{chunk-4ngvj758.js → chunk-7nh8vjx4.js} +1 -1
- package/bundle/{chunk-fsagyvkz.js → chunk-7p8f8xav.js} +1 -1
- package/bundle/chunk-7wwtgxxf.js +2 -0
- package/bundle/{chunk-k8zbhj2p.js → chunk-81mwbcy3.js} +1 -1
- package/bundle/{chunk-8gn7r4kb.js → chunk-821zkh5v.js} +1 -1
- package/bundle/{chunk-xmt17jd4.js → chunk-84712kbe.js} +1 -1
- package/bundle/{chunk-k56zj08h.js → chunk-8hrt4d0v.js} +1 -1
- package/bundle/{chunk-vrt8wd3r.js → chunk-8psfgg8y.js} +1 -1
- package/bundle/{chunk-09n24ztn.js → chunk-8xbd0ra5.js} +1 -1
- package/bundle/{chunk-50knjq36.js → chunk-95ga21eq.js} +1 -1
- package/bundle/{chunk-8qbhnwej.js → chunk-962hspr0.js} +1 -1
- package/bundle/chunk-98sb49dz.js +2 -0
- package/bundle/{chunk-dzw0j790.js → chunk-9a9qcvtz.js} +2 -2
- package/bundle/{chunk-p5p4jh9s.js → chunk-9c0f79mt.js} +1 -1
- package/bundle/{chunk-1h9sc0gy.js → chunk-9h2fms7x.js} +1 -1
- package/bundle/chunk-9kbtpq9m.js +2 -0
- package/bundle/{chunk-96nmxprr.js → chunk-9r6wk75s.js} +1 -1
- package/bundle/chunk-9szp9b4m.js +2 -0
- package/bundle/{chunk-1pd943m9.js → chunk-9xbc558j.js} +1 -1
- package/bundle/chunk-9xqszq0c.js +2 -0
- package/bundle/chunk-a32kjs9e.js +2 -0
- package/bundle/{chunk-fnmq42y5.js → chunk-a4242cn4.js} +1 -1
- package/bundle/{chunk-bwzbcwff.js → chunk-ajykvcas.js} +1 -1
- package/bundle/{chunk-sjtq9bbb.js → chunk-anm5g0m4.js} +1 -1
- package/bundle/chunk-apym02ct.js +2 -0
- package/bundle/{chunk-5qydhr42.js → chunk-aq75kv5f.js} +2 -2
- package/bundle/chunk-armv2rv5.js +2 -0
- package/bundle/chunk-as215v64.js +2 -0
- package/bundle/{chunk-y8tx9x5b.js → chunk-b46t2315.js} +1 -1
- package/bundle/{chunk-78e76m4h.js → chunk-ba2hn77m.js} +1 -1
- package/bundle/{chunk-tyk97q7c.js → chunk-bd4krah7.js} +1 -1
- package/bundle/chunk-bnmpgpyf.js +2 -0
- package/bundle/{chunk-rxh160jr.js → chunk-bpv378bm.js} +1 -1
- package/bundle/chunk-bq3zt1x1.js +2 -0
- package/bundle/{chunk-sz75fx13.js → chunk-bx8fgjam.js} +1 -1
- package/bundle/{chunk-9gs4en9v.js → chunk-bydaqb08.js} +1 -1
- package/bundle/{chunk-n4fwztya.js → chunk-c1srcpfk.js} +1 -1
- package/bundle/{chunk-tpw1ewqn.js → chunk-c99npyz9.js} +1 -1
- package/bundle/chunk-ckcnb59t.js +2 -0
- package/bundle/{chunk-bffm0wv9.js → chunk-csbndz33.js} +1 -1
- package/bundle/{chunk-88hmeyf5.js → chunk-cv3xdp8q.js} +6 -6
- package/bundle/{chunk-h6kmpgak.js → chunk-d2049chz.js} +1 -1
- package/bundle/{chunk-611wfdn3.js → chunk-d4ys15w3.js} +1 -1
- package/bundle/chunk-d79xaj6s.js +3 -0
- package/bundle/chunk-dah2d37s.js +2 -0
- package/bundle/chunk-dhgjv1n2.js +2 -0
- package/bundle/chunk-dk9k8ff5.js +2 -0
- package/bundle/{chunk-eya9c81t.js → chunk-dmgdwvn1.js} +1 -1
- package/bundle/{chunk-r6055kk0.js → chunk-dpm5x19e.js} +2 -2
- package/bundle/{chunk-pdcj2rfz.js → chunk-dwjv3m5s.js} +1 -1
- package/bundle/chunk-dymysn4h.js +2 -0
- package/bundle/{chunk-jt7g0r2j.js → chunk-dzy3ezht.js} +1 -1
- package/bundle/{chunk-43eqr0ds.js → chunk-e0w082wt.js} +6 -6
- package/bundle/{chunk-2vsqsxe1.js → chunk-e4658j15.js} +3 -3
- package/bundle/{chunk-t076hwsv.js → chunk-e6s8ep9m.js} +1 -1
- package/bundle/{chunk-gfer8ch3.js → chunk-ec1bwa7f.js} +1 -1
- package/bundle/{chunk-1dnvdeat.js → chunk-eefzbdbk.js} +1 -1
- package/bundle/{chunk-q8qx38kz.js → chunk-eh73j82b.js} +1 -1
- package/bundle/{chunk-xfsccqsm.js → chunk-es6vbsjg.js} +1 -1
- package/bundle/{chunk-s3hbwksw.js → chunk-etvwxwn3.js} +1 -1
- package/bundle/chunk-ev4gw5k6.js +2 -0
- package/bundle/chunk-ew2dxm43.js +2 -0
- package/bundle/{chunk-wspbjh74.js → chunk-ewde5bss.js} +2 -2
- package/bundle/{chunk-jh2za7y4.js → chunk-fbd971t7.js} +3 -3
- package/bundle/{chunk-fd6qxjtf.js → chunk-ff031crt.js} +1 -1
- package/bundle/chunk-ffp4wg27.js +2 -0
- package/bundle/{chunk-ph46s66y.js → chunk-fj87htwn.js} +1 -1
- package/bundle/{chunk-m8phqgxp.js → chunk-fmvmp278.js} +1 -1
- package/bundle/{chunk-zr89enb8.js → chunk-fqzfytjk.js} +1 -1
- package/bundle/{chunk-ghdegwnr.js → chunk-g0x6q2ks.js} +1 -1
- package/bundle/{chunk-84qx54nf.js → chunk-g3y5kvg6.js} +1 -1
- package/bundle/{chunk-sbj816s8.js → chunk-g6ffx794.js} +1 -1
- package/bundle/{chunk-y8bxvp3c.js → chunk-gcpwm7b5.js} +1 -1
- package/bundle/{chunk-ncvr75f6.js → chunk-gdawpkxs.js} +1 -1
- package/bundle/{chunk-yhr7s8qm.js → chunk-gjmxrz0v.js} +1 -1
- package/bundle/{chunk-95tec4gm.js → chunk-gtmtvjwc.js} +1 -1
- package/bundle/{chunk-yvtbt12y.js → chunk-gvc1mqrs.js} +2 -2
- package/bundle/{chunk-49brdmgp.js → chunk-gw2fz5ry.js} +1 -1
- package/bundle/{chunk-2ts74cgq.js → chunk-h1p3xcfp.js} +1 -1
- package/bundle/{chunk-hntsg7q4.js → chunk-h2vtypa5.js} +1 -1
- package/bundle/{chunk-ccghr6pm.js → chunk-h9tcpbr7.js} +1 -1
- package/bundle/{chunk-wqkvsj5y.js → chunk-hcd0k14e.js} +1 -1
- package/bundle/{chunk-pkm3w0ks.js → chunk-hd6sd912.js} +1 -1
- package/bundle/{chunk-32x2901e.js → chunk-hgcnzsd5.js} +1 -1
- package/bundle/chunk-hjy90gt2.js +2 -0
- package/bundle/{chunk-tz60e15h.js → chunk-hk8m8vax.js} +2 -2
- package/bundle/chunk-hmden934.js +2 -0
- package/bundle/{chunk-48y4n9ne.js → chunk-hnbtfpb7.js} +1 -1
- package/bundle/{chunk-49we3vy1.js → chunk-hp9q7vvq.js} +2 -2
- package/bundle/{chunk-j5dnzqjy.js → chunk-hrfdrz36.js} +1 -1
- package/bundle/chunk-hsm8fbb1.js +2 -0
- package/bundle/{chunk-vbcekkw2.js → chunk-hsmtjb4d.js} +2 -2
- package/bundle/chunk-hz1xfedb.js +2 -0
- package/bundle/{chunk-8y03p2md.js → chunk-hzzvmr41.js} +1 -1
- package/bundle/chunk-ja9y478k.js +2 -0
- package/bundle/chunk-jam7xyjf.js +2 -0
- package/bundle/{chunk-a2pd7nt5.js → chunk-jmrqp50k.js} +1 -1
- package/bundle/{chunk-c53ev0da.js → chunk-jrh028na.js} +2 -2
- package/bundle/{chunk-j7d3v0x2.js → chunk-jt94rhev.js} +1 -1
- package/bundle/{chunk-vnz9n9z0.js → chunk-k3x6z5q1.js} +1 -1
- package/bundle/chunk-k51qphrk.js +2 -0
- package/bundle/{chunk-z1xeqrgd.js → chunk-kee7xpe3.js} +1 -1
- package/bundle/{chunk-k5swnh8m.js → chunk-m18pxkdg.js} +3 -3
- package/bundle/{chunk-wpx2vmf5.js → chunk-map852em.js} +1 -1
- package/bundle/{chunk-c5n49vrd.js → chunk-mbma071k.js} +2 -2
- package/bundle/{chunk-s6vhscvd.js → chunk-mchf2bcc.js} +1 -1
- package/bundle/{chunk-wpkr3vzf.js → chunk-mfg4stzn.js} +1 -1
- package/bundle/{chunk-d39e4fa8.js → chunk-mgff8bcx.js} +1 -1
- package/bundle/{chunk-k232ny9m.js → chunk-mhn0a828.js} +1 -1
- package/bundle/{chunk-cm7yp259.js → chunk-mqtj38j9.js} +1 -1
- package/bundle/{chunk-mnxcykeq.js → chunk-mrh5q4s6.js} +2 -2
- package/bundle/{chunk-9d2mtevw.js → chunk-msbe5rb7.js} +1 -1
- package/bundle/{chunk-sxtfssjv.js → chunk-n73ckwr7.js} +1 -1
- package/bundle/{chunk-wkepvmgt.js → chunk-nn2hbew8.js} +1 -1
- package/bundle/{chunk-98z5pfvj.js → chunk-npryn3en.js} +1 -1
- package/bundle/chunk-p13eeqe4.js +2 -0
- package/bundle/{chunk-d1j8frtq.js → chunk-p3tcw42f.js} +1 -1
- package/bundle/chunk-p45f2nyb.js +2 -0
- package/bundle/{chunk-7x4g7h04.js → chunk-p863r97y.js} +1 -1
- package/bundle/{chunk-6xx66mr1.js → chunk-paqy0c2v.js} +1 -1
- package/bundle/{chunk-1tdy73ha.js → chunk-pfen4ekj.js} +1 -1
- package/bundle/{chunk-b79bb2g3.js → chunk-pzn7cade.js} +1 -1
- package/bundle/{chunk-jfe9f2wv.js → chunk-q7wc3frq.js} +1 -1
- package/bundle/{chunk-e5cds19n.js → chunk-qa38xchd.js} +1 -1
- package/bundle/{chunk-d6qs2pbx.js → chunk-qqftaqza.js} +1 -1
- package/bundle/{chunk-nwygsfhk.js → chunk-qvwx32p9.js} +1 -1
- package/bundle/chunk-qw9whsy2.js +2 -0
- package/bundle/{chunk-bd66q24j.js → chunk-r65zw08x.js} +3 -3
- package/bundle/chunk-r77kpzdv.js +2 -0
- package/bundle/{chunk-rkmg0gbq.js → chunk-r9hsd9pw.js} +1 -1
- package/bundle/chunk-rc95tp19.js +2 -0
- package/bundle/{chunk-n9969djm.js → chunk-rf9pjbg3.js} +1 -1
- package/bundle/chunk-rmh2fhqy.js +2 -0
- package/bundle/{chunk-k4ajben7.js → chunk-rqdfmbns.js} +1 -1
- package/bundle/{chunk-zr1cvkpb.js → chunk-rr94dpe9.js} +1 -1
- package/bundle/chunk-rrn86a8w.js +2 -0
- package/bundle/{chunk-44685nzw.js → chunk-rwt0rwvn.js} +1 -1
- package/bundle/{chunk-czfjmrrq.js → chunk-s7ypkpg2.js} +1 -1
- package/bundle/chunk-s8v0h63x.js +2 -0
- package/bundle/chunk-sh4mngre.js +2 -0
- package/bundle/chunk-shqqngm8.js +2 -0
- package/bundle/chunk-sjfcwykr.js +2 -0
- package/bundle/{chunk-akrcbxfa.js → chunk-sn15skh8.js} +1 -1
- package/bundle/chunk-sv01v0n0.js +2 -0
- package/bundle/{chunk-seda5sfd.js → chunk-sv27ep93.js} +1 -1
- package/bundle/{chunk-v5j3ypfv.js → chunk-t1e52h0k.js} +1 -1
- package/bundle/{chunk-k558fr15.js → chunk-t1hw67x4.js} +1 -1
- package/bundle/{chunk-63t0rhc9.js → chunk-t4kma6mq.js} +2 -2
- package/bundle/{chunk-cydpdkx7.js → chunk-t66gerft.js} +1 -1
- package/bundle/{chunk-n5dxwryh.js → chunk-t7gp6mjm.js} +1 -1
- package/bundle/{chunk-pnmadk2h.js → chunk-tks3qzsw.js} +1 -1
- package/bundle/{chunk-ztjrm8m0.js → chunk-tn0sfsks.js} +1 -1
- package/bundle/chunk-tn8hsd2c.js +2 -0
- package/bundle/chunk-tqsx7w8z.js +2 -0
- package/bundle/{chunk-vamwvx0x.js → chunk-trg0zg0q.js} +1 -1
- package/bundle/chunk-tyt1negg.js +2 -0
- package/bundle/{chunk-g7jwp73v.js → chunk-tzw56029.js} +1 -1
- package/bundle/{chunk-r9ng8xx5.js → chunk-v30fmrz0.js} +1 -1
- package/bundle/chunk-v580zwpf.js +3 -0
- package/bundle/{chunk-8rc7cvex.js → chunk-v6djkm35.js} +1 -1
- package/bundle/{chunk-bw0951fs.js → chunk-v9yxkbz7.js} +1 -1
- package/bundle/chunk-vdv6cyh0.js +2 -0
- package/bundle/{chunk-78yvbv9b.js → chunk-vqxyk6as.js} +2 -2
- package/bundle/{chunk-bh1zbz62.js → chunk-vr7525pa.js} +1 -1
- package/bundle/chunk-vsk8yfxp.js +2 -0
- package/bundle/{chunk-kxdw2vtq.js → chunk-vvcyvdnk.js} +1 -1
- package/bundle/chunk-vvgmkjym.js +2 -0
- package/bundle/{chunk-datctfgt.js → chunk-vvmvryh1.js} +2 -2
- package/bundle/{chunk-7b5vney6.js → chunk-vzf04vad.js} +1 -1
- package/bundle/{chunk-tzwm08yc.js → chunk-vzj91hg8.js} +1 -1
- package/bundle/chunk-w0zyex7f.js +2 -0
- package/bundle/{chunk-gz8k40ty.js → chunk-w264gs2c.js} +1 -1
- package/bundle/chunk-w623r5kb.js +3 -0
- package/bundle/{chunk-vm8htc6d.js → chunk-wac35a6p.js} +1 -1
- package/bundle/chunk-wkxt9v7s.js +2 -0
- package/bundle/{chunk-fzxqn4j0.js → chunk-wqm1vawg.js} +1 -1
- package/bundle/{chunk-w32xhz0x.js → chunk-wrkt670m.js} +1 -1
- package/bundle/{chunk-h8yf5e2e.js → chunk-wspm2k19.js} +1 -1
- package/bundle/chunk-wwf6zacw.js +2 -0
- package/bundle/{chunk-e6ckxkj8.js → chunk-wwtyrgga.js} +1 -1
- package/bundle/{chunk-aykvrqrp.js → chunk-x0wy15q9.js} +1 -1
- package/bundle/chunk-x9c8eddk.js +2 -0
- package/bundle/{chunk-bzz2expb.js → chunk-xaewye8w.js} +1 -1
- package/bundle/{chunk-1p39y33b.js → chunk-xgdst5n5.js} +2 -2
- package/bundle/{chunk-r1936yb5.js → chunk-xgphhnpk.js} +1 -1
- package/bundle/chunk-xjed8t2h.js +2 -0
- package/bundle/{chunk-n230jbn9.js → chunk-xn6mwsc9.js} +1 -1
- package/bundle/{chunk-e7a50j2w.js → chunk-xpz5mnwz.js} +1 -1
- package/bundle/{chunk-nwkp2f8e.js → chunk-xrb46v1e.js} +1 -1
- package/bundle/chunk-xxhta1tm.js +2 -0
- package/bundle/{chunk-ajgwyrcf.js → chunk-y5m9c5ek.js} +1 -1
- package/bundle/{chunk-rpc0he6b.js → chunk-y9kjt2jj.js} +1 -1
- package/bundle/{chunk-csmdhh7r.js → chunk-y9mxwwz7.js} +1 -1
- package/bundle/{chunk-zqzh5hp3.js → chunk-ycth54ja.js} +1 -1
- package/bundle/{chunk-a4cmpa56.js → chunk-ydz7387e.js} +1 -1
- package/bundle/{chunk-bqqxvagz.js → chunk-yg5azmxb.js} +1 -1
- package/bundle/{chunk-cg7zeppb.js → chunk-yhe5qz48.js} +1 -1
- package/bundle/chunk-yhj6858v.js +2 -0
- package/bundle/{chunk-hqtex91e.js → chunk-yq3byrpv.js} +1 -1
- package/bundle/{chunk-kt982884.js → chunk-yqvqzg7b.js} +1 -1
- package/bundle/{chunk-dfkcp43a.js → chunk-ys8ajwys.js} +1 -1
- package/bundle/chunk-yzt7p956.js +2 -0
- package/bundle/{chunk-yg0rs4g1.js → chunk-yzxcjr6y.js} +2 -2
- package/bundle/{chunk-3tf7xfw5.js → chunk-z1psybn1.js} +1 -1
- package/bundle/{chunk-qsgpbt4t.js → chunk-z2cnd2cp.js} +1 -1
- package/bundle/{chunk-ep92grvg.js → chunk-z4gczap3.js} +7 -7
- package/bundle/chunk-z56cb3fs.js +2 -0
- package/bundle/{chunk-krk24aqm.js → chunk-z66xdxkg.js} +2 -2
- package/bundle/{chunk-t7s475b2.js → chunk-z6f54x4k.js} +2 -2
- package/bundle/{chunk-ya6r72ng.js → chunk-z6qb4gt5.js} +1 -1
- package/bundle/{chunk-xphzr4wg.js → chunk-zgj7jx8k.js} +2 -2
- package/bundle/{chunk-0tya4pqb.js → chunk-zhddj91f.js} +2 -2
- package/bundle/chunk-zhypknyg.js +2 -0
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +3 -3
- package/bundle/chunk-06j0gaen.js +0 -2
- package/bundle/chunk-0bn86djg.js +0 -3
- package/bundle/chunk-0mm40z8g.js +0 -2
- package/bundle/chunk-1mqfhw0f.js +0 -2
- package/bundle/chunk-28kte9rt.js +0 -2
- package/bundle/chunk-2dhjehxe.js +0 -2
- package/bundle/chunk-2nnfxbd2.js +0 -2
- package/bundle/chunk-2w5zmgpb.js +0 -2
- package/bundle/chunk-34qt3fqj.js +0 -2
- package/bundle/chunk-3p0xvt47.js +0 -2
- package/bundle/chunk-3pzx5ret.js +0 -2
- package/bundle/chunk-3y4rmqmm.js +0 -2
- package/bundle/chunk-486874bd.js +0 -2
- package/bundle/chunk-4bcbvfsw.js +0 -2
- package/bundle/chunk-4t1ysdag.js +0 -2
- package/bundle/chunk-5q7a4h2w.js +0 -2
- package/bundle/chunk-63vamhf7.js +0 -2
- package/bundle/chunk-6hhv3n7c.js +0 -2
- package/bundle/chunk-7a9kfb2n.js +0 -2
- package/bundle/chunk-7x9m1smk.js +0 -2
- package/bundle/chunk-82mnr6sf.js +0 -2
- package/bundle/chunk-8bea2r6p.js +0 -2
- package/bundle/chunk-8h6mhzhg.js +0 -2
- package/bundle/chunk-8n1cmvr7.js +0 -2
- package/bundle/chunk-955zj1y6.js +0 -2
- package/bundle/chunk-95vp9bvk.js +0 -2
- package/bundle/chunk-9zve998d.js +0 -2
- package/bundle/chunk-a9bkr9x4.js +0 -2
- package/bundle/chunk-ac5vzpzt.js +0 -2
- package/bundle/chunk-c1exgasy.js +0 -2
- package/bundle/chunk-d29te4c1.js +0 -2
- package/bundle/chunk-d6q42p18.js +0 -2
- package/bundle/chunk-dfbexagg.js +0 -2
- package/bundle/chunk-dps1p1g1.js +0 -2
- package/bundle/chunk-e1fzgez5.js +0 -2
- package/bundle/chunk-egcvm4x2.js +0 -3
- package/bundle/chunk-ek3b08ed.js +0 -2
- package/bundle/chunk-gamnnfna.js +0 -2
- package/bundle/chunk-gjxhz1a6.js +0 -2
- package/bundle/chunk-gpm39v12.js +0 -2
- package/bundle/chunk-gr8emzzx.js +0 -2
- package/bundle/chunk-gt6h68pk.js +0 -2
- package/bundle/chunk-hj588j4f.js +0 -2
- package/bundle/chunk-jmgpr5th.js +0 -2
- package/bundle/chunk-jt79yt0t.js +0 -2
- package/bundle/chunk-jtz5re73.js +0 -2
- package/bundle/chunk-k4bj677f.js +0 -3
- package/bundle/chunk-kw5z5awx.js +0 -2
- package/bundle/chunk-mp42gb6q.js +0 -2
- package/bundle/chunk-mq0733qh.js +0 -2
- package/bundle/chunk-mrcsatmn.js +0 -2
- package/bundle/chunk-n24yx79r.js +0 -5
- package/bundle/chunk-ng2g9kkk.js +0 -2
- package/bundle/chunk-ngfhfyjs.js +0 -2
- package/bundle/chunk-p0dnmrqp.js +0 -2
- package/bundle/chunk-p6h2ydcp.js +0 -2
- package/bundle/chunk-qhakedgs.js +0 -2
- package/bundle/chunk-r18zetwf.js +0 -2
- package/bundle/chunk-r6rgrz25.js +0 -2
- package/bundle/chunk-rk4vp09j.js +0 -2
- package/bundle/chunk-s4jp4zce.js +0 -2
- package/bundle/chunk-sec9y622.js +0 -2
- package/bundle/chunk-sn7q178t.js +0 -2
- package/bundle/chunk-st0h54dm.js +0 -2
- package/bundle/chunk-tefh2cgk.js +0 -2
- package/bundle/chunk-tfez99qv.js +0 -2
- package/bundle/chunk-tjk1hymv.js +0 -2
- package/bundle/chunk-v1098rqc.js +0 -2
- package/bundle/chunk-v30ezr68.js +0 -11
- package/bundle/chunk-v5wn741w.js +0 -2
- package/bundle/chunk-vp6ttkct.js +0 -2
- package/bundle/chunk-vpcsmwsb.js +0 -2
- package/bundle/chunk-x23s1s8k.js +0 -2
- package/bundle/chunk-xr6js4ek.js +0 -2
- package/bundle/chunk-y078gb3n.js +0 -2
- package/bundle/chunk-yewjnqee.js +0 -2
- package/bundle/chunk-ykk9e9as.js +0 -2
- package/bundle/chunk-yqn88gjf.js +0 -2
- package/bundle/chunk-yrxg3dex.js +0 -2
- package/bundle/chunk-z5j46dem.js +0 -2
- package/bundle/chunk-zq0hpja9.js +0 -2
- package/bundle/chunk-zv89qwjc.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rs as e,Ss as V}from"./chunk-g83d3a0t.js";import{PQ as N}from"./chunk-63t0rhc9.js";import{QQ as z}from"./chunk-9svh74gt.js";var gJ=z(V(),1);var t=z(N(),1),D=z(V(),1);var RJ=z(N(),1);var A=z(N(),1),p=z(V(),1),M=z(e(),1);var c;function VJ(){if(c===void 0)try{let J=globalThis.process.argv0;c=J?`unknown_service:${J}`:"unknown_service"}catch{c="unknown_service"}return c}var x=(J)=>{return J!==null&&typeof J==="object"&&typeof J.then==="function"};class i{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(J,$){let W=new i({},$);return W._rawAttributes=jJ(J),W._asyncAttributesPending=J.filter(([Z,Q])=>x(Q)).length>0,W}constructor(J,$){let W=J.attributes??{};this._rawAttributes=Object.entries(W).map(([Z,Q])=>{if(x(Q))this._asyncAttributesPending=!0;return[Z,Q]}),this._rawAttributes=jJ(this._rawAttributes),this._schemaUrl=iJ($?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(!this.asyncAttributesPending)return;for(let J=0;J<this._rawAttributes.length;J++){let[$,W]=this._rawAttributes[J];this._rawAttributes[J]=[$,x(W)?await W:W]}this._asyncAttributesPending=!1}get attributes(){if(this.asyncAttributesPending)A.diag.error("Accessing resource attributes before async attributes settled");if(this._memoizedAttributes)return this._memoizedAttributes;let J={};for(let[$,W]of this._rawAttributes){if(x(W)){A.diag.debug(`Unsettled resource attribute ${$} skipped`);continue}if(W!=null)J[$]??=W}if(!this._asyncAttributesPending)this._memoizedAttributes=J;return J}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(J){if(J==null)return this;let $=oJ(this,J),W=$?{schemaUrl:$}:void 0;return i.FromAttributeList([...J.getRawAttributes(),...this.getRawAttributes()],W)}}function DJ(J,$){return i.FromAttributeList(Object.entries(J),$)}function JJ(){return DJ({[M.ATTR_SERVICE_NAME]:VJ(),[M.ATTR_TELEMETRY_SDK_LANGUAGE]:p.SDK_INFO[M.ATTR_TELEMETRY_SDK_LANGUAGE],[M.ATTR_TELEMETRY_SDK_NAME]:p.SDK_INFO[M.ATTR_TELEMETRY_SDK_NAME],[M.ATTR_TELEMETRY_SDK_VERSION]:p.SDK_INFO[M.ATTR_TELEMETRY_SDK_VERSION]})}function jJ(J){return J.map(([$,W])=>{if(x(W))return[$,W.catch((Z)=>{A.diag.debug("promise rejection for resource attribute: %s - %s",$,Z);return})];return[$,W]})}function iJ(J){if(typeof J==="string"||J===void 0)return J;A.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",J);return}function oJ(J,$){let W=J?.schemaUrl,Z=$?.schemaUrl,Q=W===void 0||W==="",q=Z===void 0||Z==="";if(Q)return Z;if(q)return W;if(W===Z)return W;A.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',W,Z);return}var H=z(N(),1),E=z(V(),1);var G=z(N(),1),Y=z(V(),1),h=z(e(),1);var MJ="exception";var C=Symbol.for("nodejs.util.inspect.custom");function R(J){let $={};for(let[W,Z]of J.getRawAttributes()){if(typeof Z?.then==="function")continue;if(Z!=null)$[W]??=Z}return $}function b(J,$,W,Z,Q){if(typeof W==="number"&&W<0){let X=`[${J}]`;return Z?.stylize?Z.stylize(X,"special"):X}if(typeof Q!=="function"||!Z)return $;let q={...Z,depth:Z.depth==null?Z.depth:Z.depth-1};return`${J} ${Q($,q)}`}class $J{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:G.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(J){let $=Date.now();if(this._spanContext=J.spanContext,this._performanceStartTime=Y.otperformance.now(),this._performanceOffset=$-(this._performanceStartTime+Y.otperformance.timeOrigin),this._startTimeProvided=J.startTime!=null,this._spanLimits=J.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=J.spanProcessor,this.name=J.name,this.parentSpanContext=J.parentSpanContext,this.kind=J.kind,J.links)for(let W of J.links)this.addLink(W);if(this.startTime=this._getTime(J.startTime??$),this.resource=J.resource,this.instrumentationScope=J.scope,this._recordEndMetrics=J.recordEndMetrics,J.attributes!=null)this.setAttributes(J.attributes);this._spanProcessor.onStart(this,J.context)}spanContext(){return this._spanContext}setAttribute(J,$){if($==null||this._isSpanEnded())return this;if(J.length===0)return G.diag.warn(`Invalid attribute key: ${J}`),this;if(!Y.isAttributeValue($))return G.diag.warn(`Invalid attribute value set for key: ${J}`),this;let{attributeCountLimit:W}=this._spanLimits,Z=!Object.prototype.hasOwnProperty.call(this.attributes,J);if(W!==void 0&&this._attributesCount>=W&&Z)return this._droppedAttributesCount++,this;if(this.attributes[J]=this._truncateToSize($),Z)this._attributesCount++;return this}setAttributes(J){for(let $ in J)if(Object.prototype.hasOwnProperty.call(J,$))this.setAttribute($,J[$]);return this}addEvent(J,$,W){if(this._isSpanEnded())return this;let{eventCountLimit:Z}=this._spanLimits;if(Z===0)return G.diag.warn("No events allowed."),this._droppedEventsCount++,this;if(Z!==void 0&&this.events.length>=Z){if(this._droppedEventsCount===0)G.diag.debug("Dropping extra events.");this.events.shift(),this._droppedEventsCount++}if(Y.isTimeInput($)){if(!Y.isTimeInput(W))W=$;$=void 0}let Q=Y.sanitizeAttributes($),{attributePerEventCountLimit:q}=this._spanLimits,X={},w=0,K=0;for(let U in Q){if(!Object.prototype.hasOwnProperty.call(Q,U))continue;let m=Q[U];if(q!==void 0&&K>=q){w++;continue}X[U]=this._truncateToSize(m),K++}return this.events.push({name:J,attributes:X,time:this._getTime(W),droppedAttributesCount:w}),this}addLink(J){if(this._isSpanEnded())return this;let{linkCountLimit:$}=this._spanLimits;if($===0)return this._droppedLinksCount++,this;if($!==void 0&&this.links.length>=$){if(this._droppedLinksCount===0)G.diag.debug("Dropping extra links.");this.links.shift(),this._droppedLinksCount++}let{attributePerLinkCountLimit:W}=this._spanLimits,Z=Y.sanitizeAttributes(J.attributes),Q={},q=0,X=0;for(let K in Z){if(!Object.prototype.hasOwnProperty.call(Z,K))continue;let U=Z[K];if(W!==void 0&&X>=W){q++;continue}Q[K]=this._truncateToSize(U),X++}let w={context:J.context};if(X>0)w.attributes=Q;if(q>0)w.droppedAttributesCount=q;return this.links.push(w),this}addLinks(J){for(let $ of J)this.addLink($);return this}setStatus(J){if(this._isSpanEnded())return this;if(J.code===G.SpanStatusCode.UNSET)return this;if(this.status.code===G.SpanStatusCode.OK)return this;let $={code:J.code};if(J.code===G.SpanStatusCode.ERROR){if(typeof J.message==="string")$.message=J.message;else if(J.message!=null)G.diag.warn(`Dropping invalid status.message of type '${typeof J.message}', expected 'string'`)}return this.status=$,this}updateName(J){if(this._isSpanEnded())return this;return this.name=J,this}end(J){if(this._isSpanEnded()){G.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}if(this.endTime=this._getTime(J),this._duration=Y.hrTimeDuration(this.startTime,this.endTime),this._duration[0]<0)G.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0];if(this._droppedEventsCount>0)G.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);if(this._droppedLinksCount>0)G.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);if(this._spanProcessor.onEnding)this._spanProcessor.onEnding(this);this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(J){if(typeof J==="number"&&J<=Y.otperformance.now())return Y.hrTime(J+this._performanceOffset);if(typeof J==="number")return Y.millisToHrTime(J);if(J instanceof Date)return Y.millisToHrTime(J.getTime());if(Y.isTimeInputHrTime(J))return J;if(this._startTimeProvided)return Y.millisToHrTime(Date.now());let $=Y.otperformance.now()-this._performanceStartTime;return Y.addHrTimes(this.startTime,Y.millisToHrTime($))}isRecording(){return this._ended===!1}recordException(J,$){let W={};if(typeof J==="string")W[h.ATTR_EXCEPTION_MESSAGE]=J;else if(J){if(J.code)W[h.ATTR_EXCEPTION_TYPE]=J.code.toString();else if(J.name)W[h.ATTR_EXCEPTION_TYPE]=J.name;if(J.message)W[h.ATTR_EXCEPTION_MESSAGE]=J.message;if(J.stack)W[h.ATTR_EXCEPTION_STACKTRACE]=J.stack}if(W[h.ATTR_EXCEPTION_TYPE]||W[h.ATTR_EXCEPTION_MESSAGE])this.addEvent(MJ,W,$);else G.diag.warn(`Failed to record an exception ${J}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let J=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);G.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,J)}return this._ended}_truncateToLimitUtil(J,$){if(J.length<=$)return J;return J.substring(0,$)}_truncateToSize(J){let $=this._attributeValueLengthLimit;if($<=0)return G.diag.warn(`Attribute value limit must be positive, got ${$}`),J;if(typeof J==="string")return this._truncateToLimitUtil(J,$);if(Array.isArray(J))return J.map((W)=>typeof W==="string"?this._truncateToLimitUtil(W,$):W);return J}[C](J,$,W){let Z={name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:R(this.resource)}};return b("SpanImpl",Z,J,$,W)}}var B;(function(J){J[J.NOT_RECORD=0]="NOT_RECORD",J[J.RECORD=1]="RECORD",J[J.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(B||(B={}));var OJ="otel.component.name",UJ="otel.component.type",hJ="otel.span.parent.origin",WJ="otel.span.sampling_result",PJ="otel.sdk.processor.span.processed",fJ="otel.sdk.processor.span.queue.capacity",NJ="otel.sdk.processor.span.queue.size",kJ="otel.sdk.span.live",IJ="otel.sdk.span.started",LJ="batching_span_processor",_J="simple_span_processor";class ZJ{startedSpans;liveSpans;constructor(J){this.startedSpans=J.createCounter(IJ,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=J.createUpDownCounter(kJ,{unit:"{span}",description:"The number of currently live spans."})}startSpan(J,$){let W=rJ($);if(this.startedSpans.add(1,{[hJ]:nJ(J),[WJ]:W}),$===B.NOT_RECORD)return()=>{};let Z={[WJ]:W};return this.liveSpans.add(1,Z),()=>{this.liveSpans.add(-1,Z)}}}function nJ(J){if(!J)return"none";if(J.isRemote)return"remote";return"local"}function rJ(J){switch(J){case B.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case B.RECORD:return"RECORD_ONLY";case B.NOT_RECORD:return"DROP"}}var FJ="2.9.0";class QJ{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(J,$){this.instrumentationScope=J,this._sampler=$.sampler,this._spanLimits=$.spanLimits,this._resource=$.resource,this._idGenerator=$.idGenerator,this._spanProcessor=$.spanProcessor;let W=$.meterProvider.getMeter("@opentelemetry/sdk-trace",FJ);this._tracerMetrics=new ZJ(W)}startSpan(J,$={},W=H.context.active()){if($.root)W=H.trace.deleteSpan(W);let Z=H.trace.getSpan(W);if(E.isTracingSuppressed(W))return H.diag.debug("Instrumentation suppressed, returning Noop Span"),H.trace.wrapSpanContext(H.INVALID_SPAN_CONTEXT);let Q=Z?.spanContext(),q=this._idGenerator.generateSpanId(),X,w,K;if(!Q||!H.trace.isSpanContextValid(Q))w=this._idGenerator.generateTraceId();else w=Q.traceId,K=Q.traceState,X=Q;let U=$.kind??H.SpanKind.INTERNAL,m=($.links??[]).map((l)=>{return{context:l.context,attributes:E.sanitizeAttributes(l.attributes)}}),KJ=E.sanitizeAttributes($.attributes),g=this._sampler.shouldSample(W,w,J,U,KJ,m),lJ=this._tracerMetrics.startSpan(Q,g.decision);K=g.traceState??K;let cJ=g.decision===H.SamplingDecision.RECORD_AND_SAMPLED?H.TraceFlags.SAMPLED:H.TraceFlags.NONE,BJ={traceId:w,spanId:q,traceFlags:cJ,traceState:K};if(g.decision===H.SamplingDecision.NOT_RECORD)return H.diag.debug("Recording is off, propagating context in a non-recording span"),H.trace.wrapSpanContext(BJ);let pJ=E.sanitizeAttributes(Object.assign(KJ,g.attributes));return new $J({resource:this._resource,scope:this.instrumentationScope,context:W,spanContext:BJ,name:J,kind:U,links:m,parentSpanContext:X,attributes:pJ,startTime:$.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:lJ})}startActiveSpan(J,$,W,Z){let Q,q,X;if(arguments.length<2)return;else if(arguments.length===2)X=$;else if(arguments.length===3)Q=$,X=W;else Q=$,q=W,X=Z;let w=q??H.context.active(),K=this.startSpan(J,Q,w),U=H.trace.setSpan(w,K);return H.context.with(U,X,void 0,K)}[C](J,$,W){let Z={instrumentationScope:this.instrumentationScope,resource:{attributes:R(this._resource)},spanLimits:this._spanLimits};return b("Tracer",Z,J,$,W)}}var yJ=z(V(),1);class qJ{_spanProcessors;constructor(J){this._spanProcessors=J}forceFlush(){let J=[];for(let $ of this._spanProcessors)J.push($.forceFlush());return new Promise(($)=>{Promise.all(J).then(()=>{$()}).catch((W)=>{yJ.globalErrorHandler(W||Error("MultiSpanProcessor: forceFlush failed")),$()})})}onStart(J,$){for(let W of this._spanProcessors)W.onStart(J,$)}onEnding(J){for(let $ of this._spanProcessors)if($.onEnding)$.onEnding(J)}onEnd(J){for(let $ of this._spanProcessors)$.onEnd(J)}shutdown(){let J=[];for(let $ of this._spanProcessors)J.push($.shutdown());return new Promise(($,W)=>{Promise.all(J).then(()=>{$()},W)})}}var _=z(N(),1),xJ=z(V(),1);class k{shouldSample(){return{decision:B.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class j{shouldSample(){return{decision:B.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class P{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(J){if(this._root=J.root,!this._root)xJ.globalErrorHandler(Error("ParentBasedSampler must have a root sampler configured")),this._root=new j;this._remoteParentSampled=J.remoteParentSampled??new j,this._remoteParentNotSampled=J.remoteParentNotSampled??new k,this._localParentSampled=J.localParentSampled??new j,this._localParentNotSampled=J.localParentNotSampled??new k}shouldSample(J,$,W,Z,Q,q){let X=_.trace.getSpanContext(J);if(!X||!_.isSpanContextValid(X))return this._root.shouldSample(J,$,W,Z,Q,q);if(X.isRemote){if(X.traceFlags&_.TraceFlags.SAMPLED)return this._remoteParentSampled.shouldSample(J,$,W,Z,Q,q);return this._remoteParentNotSampled.shouldSample(J,$,W,Z,Q,q)}if(X.traceFlags&_.TraceFlags.SAMPLED)return this._localParentSampled.shouldSample(J,$,W,Z,Q,q);return this._localParentNotSampled.shouldSample(J,$,W,Z,Q,q)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}var O=z(N(),1),I=z(V(),1);var XJ=z(e(),1);var AJ=new Map;class d{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(J,$,W){let Z=AJ.get(J)??0;if(AJ.set(J,Z+1),this.standardAttrs={[UJ]:J,[OJ]:`${J}/${Z}`},this.droppedAttrs={...this.standardAttrs,[XJ.ATTR_ERROR_TYPE]:"queue_full"},this.processedSpans=$.createCounter(PJ,{unit:"{span}",description:"The number of spans for which the processing has finished, either successful or failed."}),W){let{capacity:Q,getQueueSize:q}=W;$.createUpDownCounter(fJ,{unit:"{span}",description:"The maximum number of spans the queue of a given instance of an SDK span processor can hold."}).add(Q,this.standardAttrs),this.queueSize=$.createObservableUpDownCounter(NJ,{unit:"{span}",description:"The number of spans in the queue of a given instance of an SDK span processor."}),this.queueSizeCallback=(w)=>w.observe(q(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(J){this.processedSpans.add(J,this.droppedAttrs)}finishSpans(J,$){if(!$){this.processedSpans.add(J,this.standardAttrs);return}let W={...this.standardAttrs,[XJ.ATTR_ERROR_TYPE]:$.name};this.processedSpans.add(J,W)}shutdown(){if(this.queueSize&&this.queueSizeCallback)this.queueSize.removeCallback(this.queueSizeCallback)}}class YJ{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(J){if(this._exporter=J.exporter,this._maxExportBatchSize=J.maxExportBatchSize??512,this._maxQueueSize=J.maxQueueSize??2048,this._scheduledDelayMillis=J.scheduledDelayMillis??5000,this._exportTimeoutMillis=J.exportTimeoutMillis??30000,this._shutdownOnce=new I.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)O.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize;let $=J.selfObsMeterProvider?J.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):O.createNoopMeter();this._metrics=new d(LJ,$,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}onStart(J,$){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&O.TraceFlags.SAMPLED)===0)return;this._addToBuffer(J)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>{return this.onShutdown()}).then(()=>{return this._flushAll()}).then(()=>{return this._metrics.shutdown(),this._exporter.shutdown()})}_addToBuffer(J){if(this._finishedSpans.length>=this._maxQueueSize){if(this._droppedSpansCount===0)O.diag.debug("maxQueueSize reached, dropping spans");this._droppedSpansCount++,this._metrics.dropSpans(1);return}if(this._droppedSpansCount>0)O.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0;this._finishedSpans.push(J),this._maybeStartTimer()}_flushAll(){return new Promise((J,$)=>{let W=[],Z=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let Q=0,q=Z;Q<q;Q++)W.push(this._flushOneBatch());Promise.all(W).then(()=>{J()}).catch($)})}_flushOneBatch(){if(this._clearTimer(),this._finishedSpans.length===0)return Promise.resolve();return new Promise((J,$)=>{let W=setTimeout(()=>{$(Error("Timeout"))},this._exportTimeoutMillis);O.context.with(I.suppressTracing(O.context.active()),()=>{let Z;if(this._finishedSpans.length<=this._maxExportBatchSize)Z=this._finishedSpans,this._finishedSpans=[];else Z=this._finishedSpans.splice(0,this._maxExportBatchSize);let Q=()=>this._exporter.export(Z,(X)=>{if(clearTimeout(W),this._metrics.finishSpans(Z.length,X.error),X.code===I.ExportResultCode.SUCCESS)J();else $(X.error??Error("BatchSpanProcessor: span export failed"))}),q=null;for(let X=0,w=Z.length;X<w;X++){let K=Z[X];if(K.resource.asyncAttributesPending&&K.resource.waitForAsyncAttributes)q??=[],q.push(K.resource.waitForAsyncAttributes())}if(q===null)Q();else Promise.all(q).then(Q,(X)=>{I.globalErrorHandler(X),$(X)})})})}_maybeStartTimer(){if(this._isExporting)return;let J=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{if(this._isExporting=!1,this._finishedSpans.length>0)this._clearTimer(),this._maybeStartTimer()}).catch(($)=>{this._isExporting=!1,I.globalErrorHandler($)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return J();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>J(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}}class v extends YJ{onShutdown(){}}class F{generateTraceId=CJ(16);generateSpanId=CJ(8)}var o=Buffer.allocUnsafe(16);function CJ(J){return function(){for(let W=0;W<J/4;W++)o.writeUInt32BE(Math.random()*4294967296>>>0,W*4);for(let W=0;W<J;W++)if(o[W]>0)break;else if(W===J-1)o[J-1]=1;return o.toString("hex",0,J)}}var y;(function(J){J[J.resolved=0]="resolved",J[J.timeout=1]="timeout",J[J.error=2]="error",J[J.unresolved=3]="unresolved"})(y||(y={}));class n{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(J={}){this._forceFlushTimeoutMillis=J.forceFlushTimeoutMillis??30000,this._resource=J.resource??JJ();let $=J.spanProcessors??[];this._activeSpanProcessor=new qJ($),this._tracerOptions={resource:this._resource,sampler:J.sampler??new P({root:new j}),spanLimits:{attributeCountLimit:J.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:J.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:J.spanLimits?.eventCountLimit??128,linkCountLimit:J.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:J.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:J.spanLimits?.attributePerLinkCountLimit??128},idGenerator:J.idGenerator||new F,spanProcessor:this._activeSpanProcessor,meterProvider:J.meterProvider??{getMeter(){return RJ.createNoopMeter()}}}}getTracer(J,$,W){let Z=`${J}@${$||""}:${W?.schemaUrl||""}`;if(!this._tracers.has(Z))this._tracers.set(Z,new QJ({name:J,version:$,schemaUrl:W?.schemaUrl},this._tracerOptions));return this._tracers.get(Z)}forceFlush(){let J=this._forceFlushTimeoutMillis,$=this._activeSpanProcessor._spanProcessors.map((W)=>{return new Promise((Z)=>{let Q,q=setTimeout(()=>{Z(Error(`Span processor did not completed within timeout period of ${J} ms`)),Q=y.timeout},J);W.forceFlush().then(()=>{if(clearTimeout(q),Q!==y.timeout)Q=y.resolved,Z(Q)}).catch((X)=>{clearTimeout(q),Q=y.error,Z(X)})})});return new Promise((W,Z)=>{Promise.all($).then((Q)=>{let q=Q.filter((X)=>X!==y.resolved);if(q.length>0)Z(q);else W()}).catch((Q)=>Z([Q]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[C](J,$,W){let Z=this._activeSpanProcessor._spanProcessors,Q={resource:{attributes:R(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:Z.map((q)=>q.constructor?.name??"SpanProcessor")};return b("TracerProvider",Q,J,$,W)}}var S=z(V(),1);class zJ{export(J,$){return this._sendSpans(J,$)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(J){return{resource:{attributes:J.resource.attributes},instrumentationScope:J.instrumentationScope,traceId:J.spanContext().traceId,parentSpanContext:J.parentSpanContext,traceState:J.spanContext().traceState?.serialize(),name:J.name,id:J.spanContext().spanId,kind:J.kind,timestamp:S.hrTimeToMicroseconds(J.startTime),duration:S.hrTimeToMicroseconds(J.duration),attributes:J.attributes,status:J.status,events:J.events,links:J.links}}_sendSpans(J,$){for(let W of J)console.dir(this._exportInfo(W),{depth:3});if($)return $({code:S.ExportResultCode.SUCCESS})}}var HJ=z(V(),1);class GJ{_finishedSpans=[];_stopped=!1;export(J,$){if(this._stopped)return $({code:HJ.ExportResultCode.FAILED,error:Error("Exporter has been stopped")});this._finishedSpans.push(...J),setTimeout(()=>$({code:HJ.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}var r=z(N(),1),L=z(V(),1);class a{_exporter;_metrics;_shutdownOnce;_pendingExports;constructor(J){this._exporter=J.exporter,this._shutdownOnce=new L.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set;let $=J.selfObsMeterProvider?J.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):r.createNoopMeter();this._metrics=new d(_J,$)}async forceFlush(){if(await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush)await this._exporter.forceFlush()}onStart(J,$){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&r.TraceFlags.SAMPLED)===0)return;let $=this._doExport(J).catch((W)=>L.globalErrorHandler(W));this._pendingExports.add($),$.finally(()=>this._pendingExports.delete($))}async _doExport(J){if(J.resource.asyncAttributesPending)await J.resource.waitForAsyncAttributes?.();let $=await L.internal._export(this._exporter,[J]);if(this._metrics.finishSpans(1,$.error),$.code!==L.ExportResultCode.SUCCESS)throw $.error??Error(`SimpleSpanProcessor: span export failed (status ${$})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._metrics.shutdown(),this._exporter.shutdown()}}class wJ{onStart(J,$){}onEnd(J){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}var bJ=z(N(),1);class T{_ratio;_upperBound;constructor(J=0){this._ratio=this._normalize(J),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(J,$){return{decision:bJ.isValidTraceId($)&&this._accumulate($)<this._upperBound?B.RECORD_AND_SAMPLED:B.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(J){if(typeof J!=="number"||isNaN(J))return 0;return J>=1?1:J<=0?0:J}_accumulate(J){let $=0;for(let W=0;W<32;W+=8){let Z=0;for(let Q=0;Q<8;Q++){let q=J.charCodeAt(W+Q),X=q<58?q-48:q<71?q-55:q-87;Z=Z<<4|X}$=($^Z)>>>0}return $}}var f;(function(J){J.AlwaysOff="always_off",J.AlwaysOn="always_on",J.ParentBasedAlwaysOff="parentbased_always_off",J.ParentBasedAlwaysOn="parentbased_always_on",J.ParentBasedTraceIdRatio="parentbased_traceidratio",J.TraceIdRatio="traceidratio"})(f||(f={}));var s=1;function vJ(){return{sampler:aJ(),forceFlushTimeoutMillis:30000,generalLimits:{attributeValueLengthLimit:D.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:D.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:D.getNumberFromEnv("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:D.getNumberFromEnv("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function aJ(){let J=D.getStringFromEnv("OTEL_TRACES_SAMPLER")??f.ParentBasedAlwaysOn;switch(J){case f.AlwaysOn:return new j;case f.AlwaysOff:return new k;case f.ParentBasedAlwaysOn:return new P({root:new j});case f.ParentBasedAlwaysOff:return new P({root:new k});case f.TraceIdRatio:return new T(EJ());case f.ParentBasedTraceIdRatio:return new P({root:new T(EJ())});default:return t.diag.error(`OTEL_TRACES_SAMPLER value "${J}" invalid, defaulting to "${f.ParentBasedAlwaysOn}".`),new P({root:new j})}}function EJ(){let J=D.getNumberFromEnv("OTEL_TRACES_SAMPLER_ARG");if(J==null)return t.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${s}.`),s;if(J<0||J>1)return t.diag.error(`OTEL_TRACES_SAMPLER_ARG=${J} was given, but it is out of range ([0..1]), defaulting to ${s}.`),s;return J}var u=z(V(),1),sJ=128,tJ=1/0;function TJ(J){let $=Object.assign({},J.spanLimits);return $.attributeCountLimit=J.spanLimits?.attributeCountLimit??J.generalLimits?.attributeCountLimit??u.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??u.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??sJ,$.attributeValueLengthLimit=J.spanLimits?.attributeValueLengthLimit??J.generalLimits?.attributeValueLengthLimit??u.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??u.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??tJ,Object.assign({},J,{spanLimits:$})}class dJ extends n{constructor(J={}){let $=gJ.merge({},vJ(),TJ(J));delete $.generalLimits;super($)}}var SJ=z(V(),1);class uJ extends v{constructor(J,$){if(!$)$={};let W=[["maxExportBatchSize","OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],["maxQueueSize","OTEL_BSP_MAX_QUEUE_SIZE"],["scheduledDelayMillis","OTEL_BSP_SCHEDULE_DELAY"],["exportTimeoutMillis","OTEL_BSP_EXPORT_TIMEOUT"]];for(let[Z,Q]of W)if($[Z]===void 0){let q=SJ.getNumberFromEnv(Q);if(q!==void 0)$[Z]=q}super({exporter:J,...$})}}class mJ extends a{constructor(J){super({exporter:J})}}export{T as TraceIdRatioBasedSampler,mJ as SimpleSpanProcessor,B as SamplingDecision,F as RandomIdGenerator,P as ParentBasedSampler,wJ as NoopSpanProcessor,GJ as InMemorySpanExporter,zJ as ConsoleSpanExporter,uJ as BatchSpanProcessor,dJ as BasicTracerProvider,j as AlwaysOnSampler,k as AlwaysOffSampler};
|
|
2
|
+
import{sr as e,tr as V}from"./chunk-1exjy880.js";import{qP as N}from"./chunk-t4kma6mq.js";import{rP as z}from"./chunk-0xf12tf3.js";var gJ=z(V(),1);var t=z(N(),1),D=z(V(),1);var RJ=z(N(),1);var A=z(N(),1),p=z(V(),1),M=z(e(),1);var c;function VJ(){if(c===void 0)try{let J=globalThis.process.argv0;c=J?`unknown_service:${J}`:"unknown_service"}catch{c="unknown_service"}return c}var x=(J)=>{return J!==null&&typeof J==="object"&&typeof J.then==="function"};class i{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(J,$){let W=new i({},$);return W._rawAttributes=jJ(J),W._asyncAttributesPending=J.filter(([Z,Q])=>x(Q)).length>0,W}constructor(J,$){let W=J.attributes??{};this._rawAttributes=Object.entries(W).map(([Z,Q])=>{if(x(Q))this._asyncAttributesPending=!0;return[Z,Q]}),this._rawAttributes=jJ(this._rawAttributes),this._schemaUrl=iJ($?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(!this.asyncAttributesPending)return;for(let J=0;J<this._rawAttributes.length;J++){let[$,W]=this._rawAttributes[J];this._rawAttributes[J]=[$,x(W)?await W:W]}this._asyncAttributesPending=!1}get attributes(){if(this.asyncAttributesPending)A.diag.error("Accessing resource attributes before async attributes settled");if(this._memoizedAttributes)return this._memoizedAttributes;let J={};for(let[$,W]of this._rawAttributes){if(x(W)){A.diag.debug(`Unsettled resource attribute ${$} skipped`);continue}if(W!=null)J[$]??=W}if(!this._asyncAttributesPending)this._memoizedAttributes=J;return J}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(J){if(J==null)return this;let $=oJ(this,J),W=$?{schemaUrl:$}:void 0;return i.FromAttributeList([...J.getRawAttributes(),...this.getRawAttributes()],W)}}function DJ(J,$){return i.FromAttributeList(Object.entries(J),$)}function JJ(){return DJ({[M.ATTR_SERVICE_NAME]:VJ(),[M.ATTR_TELEMETRY_SDK_LANGUAGE]:p.SDK_INFO[M.ATTR_TELEMETRY_SDK_LANGUAGE],[M.ATTR_TELEMETRY_SDK_NAME]:p.SDK_INFO[M.ATTR_TELEMETRY_SDK_NAME],[M.ATTR_TELEMETRY_SDK_VERSION]:p.SDK_INFO[M.ATTR_TELEMETRY_SDK_VERSION]})}function jJ(J){return J.map(([$,W])=>{if(x(W))return[$,W.catch((Z)=>{A.diag.debug("promise rejection for resource attribute: %s - %s",$,Z);return})];return[$,W]})}function iJ(J){if(typeof J==="string"||J===void 0)return J;A.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",J);return}function oJ(J,$){let W=J?.schemaUrl,Z=$?.schemaUrl,Q=W===void 0||W==="",q=Z===void 0||Z==="";if(Q)return Z;if(q)return W;if(W===Z)return W;A.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',W,Z);return}var H=z(N(),1),E=z(V(),1);var G=z(N(),1),Y=z(V(),1),h=z(e(),1);var MJ="exception";var C=Symbol.for("nodejs.util.inspect.custom");function R(J){let $={};for(let[W,Z]of J.getRawAttributes()){if(typeof Z?.then==="function")continue;if(Z!=null)$[W]??=Z}return $}function b(J,$,W,Z,Q){if(typeof W==="number"&&W<0){let X=`[${J}]`;return Z?.stylize?Z.stylize(X,"special"):X}if(typeof Q!=="function"||!Z)return $;let q={...Z,depth:Z.depth==null?Z.depth:Z.depth-1};return`${J} ${Q($,q)}`}class $J{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:G.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(J){let $=Date.now();if(this._spanContext=J.spanContext,this._performanceStartTime=Y.otperformance.now(),this._performanceOffset=$-(this._performanceStartTime+Y.otperformance.timeOrigin),this._startTimeProvided=J.startTime!=null,this._spanLimits=J.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=J.spanProcessor,this.name=J.name,this.parentSpanContext=J.parentSpanContext,this.kind=J.kind,J.links)for(let W of J.links)this.addLink(W);if(this.startTime=this._getTime(J.startTime??$),this.resource=J.resource,this.instrumentationScope=J.scope,this._recordEndMetrics=J.recordEndMetrics,J.attributes!=null)this.setAttributes(J.attributes);this._spanProcessor.onStart(this,J.context)}spanContext(){return this._spanContext}setAttribute(J,$){if($==null||this._isSpanEnded())return this;if(J.length===0)return G.diag.warn(`Invalid attribute key: ${J}`),this;if(!Y.isAttributeValue($))return G.diag.warn(`Invalid attribute value set for key: ${J}`),this;let{attributeCountLimit:W}=this._spanLimits,Z=!Object.prototype.hasOwnProperty.call(this.attributes,J);if(W!==void 0&&this._attributesCount>=W&&Z)return this._droppedAttributesCount++,this;if(this.attributes[J]=this._truncateToSize($),Z)this._attributesCount++;return this}setAttributes(J){for(let $ in J)if(Object.prototype.hasOwnProperty.call(J,$))this.setAttribute($,J[$]);return this}addEvent(J,$,W){if(this._isSpanEnded())return this;let{eventCountLimit:Z}=this._spanLimits;if(Z===0)return G.diag.warn("No events allowed."),this._droppedEventsCount++,this;if(Z!==void 0&&this.events.length>=Z){if(this._droppedEventsCount===0)G.diag.debug("Dropping extra events.");this.events.shift(),this._droppedEventsCount++}if(Y.isTimeInput($)){if(!Y.isTimeInput(W))W=$;$=void 0}let Q=Y.sanitizeAttributes($),{attributePerEventCountLimit:q}=this._spanLimits,X={},w=0,K=0;for(let U in Q){if(!Object.prototype.hasOwnProperty.call(Q,U))continue;let m=Q[U];if(q!==void 0&&K>=q){w++;continue}X[U]=this._truncateToSize(m),K++}return this.events.push({name:J,attributes:X,time:this._getTime(W),droppedAttributesCount:w}),this}addLink(J){if(this._isSpanEnded())return this;let{linkCountLimit:$}=this._spanLimits;if($===0)return this._droppedLinksCount++,this;if($!==void 0&&this.links.length>=$){if(this._droppedLinksCount===0)G.diag.debug("Dropping extra links.");this.links.shift(),this._droppedLinksCount++}let{attributePerLinkCountLimit:W}=this._spanLimits,Z=Y.sanitizeAttributes(J.attributes),Q={},q=0,X=0;for(let K in Z){if(!Object.prototype.hasOwnProperty.call(Z,K))continue;let U=Z[K];if(W!==void 0&&X>=W){q++;continue}Q[K]=this._truncateToSize(U),X++}let w={context:J.context};if(X>0)w.attributes=Q;if(q>0)w.droppedAttributesCount=q;return this.links.push(w),this}addLinks(J){for(let $ of J)this.addLink($);return this}setStatus(J){if(this._isSpanEnded())return this;if(J.code===G.SpanStatusCode.UNSET)return this;if(this.status.code===G.SpanStatusCode.OK)return this;let $={code:J.code};if(J.code===G.SpanStatusCode.ERROR){if(typeof J.message==="string")$.message=J.message;else if(J.message!=null)G.diag.warn(`Dropping invalid status.message of type '${typeof J.message}', expected 'string'`)}return this.status=$,this}updateName(J){if(this._isSpanEnded())return this;return this.name=J,this}end(J){if(this._isSpanEnded()){G.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}if(this.endTime=this._getTime(J),this._duration=Y.hrTimeDuration(this.startTime,this.endTime),this._duration[0]<0)G.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0];if(this._droppedEventsCount>0)G.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);if(this._droppedLinksCount>0)G.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);if(this._spanProcessor.onEnding)this._spanProcessor.onEnding(this);this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(J){if(typeof J==="number"&&J<=Y.otperformance.now())return Y.hrTime(J+this._performanceOffset);if(typeof J==="number")return Y.millisToHrTime(J);if(J instanceof Date)return Y.millisToHrTime(J.getTime());if(Y.isTimeInputHrTime(J))return J;if(this._startTimeProvided)return Y.millisToHrTime(Date.now());let $=Y.otperformance.now()-this._performanceStartTime;return Y.addHrTimes(this.startTime,Y.millisToHrTime($))}isRecording(){return this._ended===!1}recordException(J,$){let W={};if(typeof J==="string")W[h.ATTR_EXCEPTION_MESSAGE]=J;else if(J){if(J.code)W[h.ATTR_EXCEPTION_TYPE]=J.code.toString();else if(J.name)W[h.ATTR_EXCEPTION_TYPE]=J.name;if(J.message)W[h.ATTR_EXCEPTION_MESSAGE]=J.message;if(J.stack)W[h.ATTR_EXCEPTION_STACKTRACE]=J.stack}if(W[h.ATTR_EXCEPTION_TYPE]||W[h.ATTR_EXCEPTION_MESSAGE])this.addEvent(MJ,W,$);else G.diag.warn(`Failed to record an exception ${J}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let J=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);G.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,J)}return this._ended}_truncateToLimitUtil(J,$){if(J.length<=$)return J;return J.substring(0,$)}_truncateToSize(J){let $=this._attributeValueLengthLimit;if($<=0)return G.diag.warn(`Attribute value limit must be positive, got ${$}`),J;if(typeof J==="string")return this._truncateToLimitUtil(J,$);if(Array.isArray(J))return J.map((W)=>typeof W==="string"?this._truncateToLimitUtil(W,$):W);return J}[C](J,$,W){let Z={name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:R(this.resource)}};return b("SpanImpl",Z,J,$,W)}}var B;(function(J){J[J.NOT_RECORD=0]="NOT_RECORD",J[J.RECORD=1]="RECORD",J[J.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(B||(B={}));var OJ="otel.component.name",UJ="otel.component.type",hJ="otel.span.parent.origin",WJ="otel.span.sampling_result",PJ="otel.sdk.processor.span.processed",fJ="otel.sdk.processor.span.queue.capacity",NJ="otel.sdk.processor.span.queue.size",kJ="otel.sdk.span.live",IJ="otel.sdk.span.started",LJ="batching_span_processor",_J="simple_span_processor";class ZJ{startedSpans;liveSpans;constructor(J){this.startedSpans=J.createCounter(IJ,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=J.createUpDownCounter(kJ,{unit:"{span}",description:"The number of currently live spans."})}startSpan(J,$){let W=rJ($);if(this.startedSpans.add(1,{[hJ]:nJ(J),[WJ]:W}),$===B.NOT_RECORD)return()=>{};let Z={[WJ]:W};return this.liveSpans.add(1,Z),()=>{this.liveSpans.add(-1,Z)}}}function nJ(J){if(!J)return"none";if(J.isRemote)return"remote";return"local"}function rJ(J){switch(J){case B.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case B.RECORD:return"RECORD_ONLY";case B.NOT_RECORD:return"DROP"}}var FJ="2.9.0";class QJ{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(J,$){this.instrumentationScope=J,this._sampler=$.sampler,this._spanLimits=$.spanLimits,this._resource=$.resource,this._idGenerator=$.idGenerator,this._spanProcessor=$.spanProcessor;let W=$.meterProvider.getMeter("@opentelemetry/sdk-trace",FJ);this._tracerMetrics=new ZJ(W)}startSpan(J,$={},W=H.context.active()){if($.root)W=H.trace.deleteSpan(W);let Z=H.trace.getSpan(W);if(E.isTracingSuppressed(W))return H.diag.debug("Instrumentation suppressed, returning Noop Span"),H.trace.wrapSpanContext(H.INVALID_SPAN_CONTEXT);let Q=Z?.spanContext(),q=this._idGenerator.generateSpanId(),X,w,K;if(!Q||!H.trace.isSpanContextValid(Q))w=this._idGenerator.generateTraceId();else w=Q.traceId,K=Q.traceState,X=Q;let U=$.kind??H.SpanKind.INTERNAL,m=($.links??[]).map((l)=>{return{context:l.context,attributes:E.sanitizeAttributes(l.attributes)}}),KJ=E.sanitizeAttributes($.attributes),g=this._sampler.shouldSample(W,w,J,U,KJ,m),lJ=this._tracerMetrics.startSpan(Q,g.decision);K=g.traceState??K;let cJ=g.decision===H.SamplingDecision.RECORD_AND_SAMPLED?H.TraceFlags.SAMPLED:H.TraceFlags.NONE,BJ={traceId:w,spanId:q,traceFlags:cJ,traceState:K};if(g.decision===H.SamplingDecision.NOT_RECORD)return H.diag.debug("Recording is off, propagating context in a non-recording span"),H.trace.wrapSpanContext(BJ);let pJ=E.sanitizeAttributes(Object.assign(KJ,g.attributes));return new $J({resource:this._resource,scope:this.instrumentationScope,context:W,spanContext:BJ,name:J,kind:U,links:m,parentSpanContext:X,attributes:pJ,startTime:$.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:lJ})}startActiveSpan(J,$,W,Z){let Q,q,X;if(arguments.length<2)return;else if(arguments.length===2)X=$;else if(arguments.length===3)Q=$,X=W;else Q=$,q=W,X=Z;let w=q??H.context.active(),K=this.startSpan(J,Q,w),U=H.trace.setSpan(w,K);return H.context.with(U,X,void 0,K)}[C](J,$,W){let Z={instrumentationScope:this.instrumentationScope,resource:{attributes:R(this._resource)},spanLimits:this._spanLimits};return b("Tracer",Z,J,$,W)}}var yJ=z(V(),1);class qJ{_spanProcessors;constructor(J){this._spanProcessors=J}forceFlush(){let J=[];for(let $ of this._spanProcessors)J.push($.forceFlush());return new Promise(($)=>{Promise.all(J).then(()=>{$()}).catch((W)=>{yJ.globalErrorHandler(W||Error("MultiSpanProcessor: forceFlush failed")),$()})})}onStart(J,$){for(let W of this._spanProcessors)W.onStart(J,$)}onEnding(J){for(let $ of this._spanProcessors)if($.onEnding)$.onEnding(J)}onEnd(J){for(let $ of this._spanProcessors)$.onEnd(J)}shutdown(){let J=[];for(let $ of this._spanProcessors)J.push($.shutdown());return new Promise(($,W)=>{Promise.all(J).then(()=>{$()},W)})}}var _=z(N(),1),xJ=z(V(),1);class k{shouldSample(){return{decision:B.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class j{shouldSample(){return{decision:B.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class P{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(J){if(this._root=J.root,!this._root)xJ.globalErrorHandler(Error("ParentBasedSampler must have a root sampler configured")),this._root=new j;this._remoteParentSampled=J.remoteParentSampled??new j,this._remoteParentNotSampled=J.remoteParentNotSampled??new k,this._localParentSampled=J.localParentSampled??new j,this._localParentNotSampled=J.localParentNotSampled??new k}shouldSample(J,$,W,Z,Q,q){let X=_.trace.getSpanContext(J);if(!X||!_.isSpanContextValid(X))return this._root.shouldSample(J,$,W,Z,Q,q);if(X.isRemote){if(X.traceFlags&_.TraceFlags.SAMPLED)return this._remoteParentSampled.shouldSample(J,$,W,Z,Q,q);return this._remoteParentNotSampled.shouldSample(J,$,W,Z,Q,q)}if(X.traceFlags&_.TraceFlags.SAMPLED)return this._localParentSampled.shouldSample(J,$,W,Z,Q,q);return this._localParentNotSampled.shouldSample(J,$,W,Z,Q,q)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}var O=z(N(),1),I=z(V(),1);var XJ=z(e(),1);var AJ=new Map;class d{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(J,$,W){let Z=AJ.get(J)??0;if(AJ.set(J,Z+1),this.standardAttrs={[UJ]:J,[OJ]:`${J}/${Z}`},this.droppedAttrs={...this.standardAttrs,[XJ.ATTR_ERROR_TYPE]:"queue_full"},this.processedSpans=$.createCounter(PJ,{unit:"{span}",description:"The number of spans for which the processing has finished, either successful or failed."}),W){let{capacity:Q,getQueueSize:q}=W;$.createUpDownCounter(fJ,{unit:"{span}",description:"The maximum number of spans the queue of a given instance of an SDK span processor can hold."}).add(Q,this.standardAttrs),this.queueSize=$.createObservableUpDownCounter(NJ,{unit:"{span}",description:"The number of spans in the queue of a given instance of an SDK span processor."}),this.queueSizeCallback=(w)=>w.observe(q(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(J){this.processedSpans.add(J,this.droppedAttrs)}finishSpans(J,$){if(!$){this.processedSpans.add(J,this.standardAttrs);return}let W={...this.standardAttrs,[XJ.ATTR_ERROR_TYPE]:$.name};this.processedSpans.add(J,W)}shutdown(){if(this.queueSize&&this.queueSizeCallback)this.queueSize.removeCallback(this.queueSizeCallback)}}class YJ{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(J){if(this._exporter=J.exporter,this._maxExportBatchSize=J.maxExportBatchSize??512,this._maxQueueSize=J.maxQueueSize??2048,this._scheduledDelayMillis=J.scheduledDelayMillis??5000,this._exportTimeoutMillis=J.exportTimeoutMillis??30000,this._shutdownOnce=new I.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)O.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize;let $=J.selfObsMeterProvider?J.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):O.createNoopMeter();this._metrics=new d(LJ,$,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}onStart(J,$){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&O.TraceFlags.SAMPLED)===0)return;this._addToBuffer(J)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>{return this.onShutdown()}).then(()=>{return this._flushAll()}).then(()=>{return this._metrics.shutdown(),this._exporter.shutdown()})}_addToBuffer(J){if(this._finishedSpans.length>=this._maxQueueSize){if(this._droppedSpansCount===0)O.diag.debug("maxQueueSize reached, dropping spans");this._droppedSpansCount++,this._metrics.dropSpans(1);return}if(this._droppedSpansCount>0)O.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0;this._finishedSpans.push(J),this._maybeStartTimer()}_flushAll(){return new Promise((J,$)=>{let W=[],Z=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let Q=0,q=Z;Q<q;Q++)W.push(this._flushOneBatch());Promise.all(W).then(()=>{J()}).catch($)})}_flushOneBatch(){if(this._clearTimer(),this._finishedSpans.length===0)return Promise.resolve();return new Promise((J,$)=>{let W=setTimeout(()=>{$(Error("Timeout"))},this._exportTimeoutMillis);O.context.with(I.suppressTracing(O.context.active()),()=>{let Z;if(this._finishedSpans.length<=this._maxExportBatchSize)Z=this._finishedSpans,this._finishedSpans=[];else Z=this._finishedSpans.splice(0,this._maxExportBatchSize);let Q=()=>this._exporter.export(Z,(X)=>{if(clearTimeout(W),this._metrics.finishSpans(Z.length,X.error),X.code===I.ExportResultCode.SUCCESS)J();else $(X.error??Error("BatchSpanProcessor: span export failed"))}),q=null;for(let X=0,w=Z.length;X<w;X++){let K=Z[X];if(K.resource.asyncAttributesPending&&K.resource.waitForAsyncAttributes)q??=[],q.push(K.resource.waitForAsyncAttributes())}if(q===null)Q();else Promise.all(q).then(Q,(X)=>{I.globalErrorHandler(X),$(X)})})})}_maybeStartTimer(){if(this._isExporting)return;let J=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{if(this._isExporting=!1,this._finishedSpans.length>0)this._clearTimer(),this._maybeStartTimer()}).catch(($)=>{this._isExporting=!1,I.globalErrorHandler($)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return J();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>J(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}}class v extends YJ{onShutdown(){}}class F{generateTraceId=CJ(16);generateSpanId=CJ(8)}var o=Buffer.allocUnsafe(16);function CJ(J){return function(){for(let W=0;W<J/4;W++)o.writeUInt32BE(Math.random()*4294967296>>>0,W*4);for(let W=0;W<J;W++)if(o[W]>0)break;else if(W===J-1)o[J-1]=1;return o.toString("hex",0,J)}}var y;(function(J){J[J.resolved=0]="resolved",J[J.timeout=1]="timeout",J[J.error=2]="error",J[J.unresolved=3]="unresolved"})(y||(y={}));class n{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(J={}){this._forceFlushTimeoutMillis=J.forceFlushTimeoutMillis??30000,this._resource=J.resource??JJ();let $=J.spanProcessors??[];this._activeSpanProcessor=new qJ($),this._tracerOptions={resource:this._resource,sampler:J.sampler??new P({root:new j}),spanLimits:{attributeCountLimit:J.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:J.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:J.spanLimits?.eventCountLimit??128,linkCountLimit:J.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:J.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:J.spanLimits?.attributePerLinkCountLimit??128},idGenerator:J.idGenerator||new F,spanProcessor:this._activeSpanProcessor,meterProvider:J.meterProvider??{getMeter(){return RJ.createNoopMeter()}}}}getTracer(J,$,W){let Z=`${J}@${$||""}:${W?.schemaUrl||""}`;if(!this._tracers.has(Z))this._tracers.set(Z,new QJ({name:J,version:$,schemaUrl:W?.schemaUrl},this._tracerOptions));return this._tracers.get(Z)}forceFlush(){let J=this._forceFlushTimeoutMillis,$=this._activeSpanProcessor._spanProcessors.map((W)=>{return new Promise((Z)=>{let Q,q=setTimeout(()=>{Z(Error(`Span processor did not completed within timeout period of ${J} ms`)),Q=y.timeout},J);W.forceFlush().then(()=>{if(clearTimeout(q),Q!==y.timeout)Q=y.resolved,Z(Q)}).catch((X)=>{clearTimeout(q),Q=y.error,Z(X)})})});return new Promise((W,Z)=>{Promise.all($).then((Q)=>{let q=Q.filter((X)=>X!==y.resolved);if(q.length>0)Z(q);else W()}).catch((Q)=>Z([Q]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[C](J,$,W){let Z=this._activeSpanProcessor._spanProcessors,Q={resource:{attributes:R(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:Z.map((q)=>q.constructor?.name??"SpanProcessor")};return b("TracerProvider",Q,J,$,W)}}var S=z(V(),1);class zJ{export(J,$){return this._sendSpans(J,$)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(J){return{resource:{attributes:J.resource.attributes},instrumentationScope:J.instrumentationScope,traceId:J.spanContext().traceId,parentSpanContext:J.parentSpanContext,traceState:J.spanContext().traceState?.serialize(),name:J.name,id:J.spanContext().spanId,kind:J.kind,timestamp:S.hrTimeToMicroseconds(J.startTime),duration:S.hrTimeToMicroseconds(J.duration),attributes:J.attributes,status:J.status,events:J.events,links:J.links}}_sendSpans(J,$){for(let W of J)console.dir(this._exportInfo(W),{depth:3});if($)return $({code:S.ExportResultCode.SUCCESS})}}var HJ=z(V(),1);class GJ{_finishedSpans=[];_stopped=!1;export(J,$){if(this._stopped)return $({code:HJ.ExportResultCode.FAILED,error:Error("Exporter has been stopped")});this._finishedSpans.push(...J),setTimeout(()=>$({code:HJ.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}var r=z(N(),1),L=z(V(),1);class a{_exporter;_metrics;_shutdownOnce;_pendingExports;constructor(J){this._exporter=J.exporter,this._shutdownOnce=new L.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set;let $=J.selfObsMeterProvider?J.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):r.createNoopMeter();this._metrics=new d(_J,$)}async forceFlush(){if(await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush)await this._exporter.forceFlush()}onStart(J,$){}onEnd(J){if(this._shutdownOnce.isCalled)return;if((J.spanContext().traceFlags&r.TraceFlags.SAMPLED)===0)return;let $=this._doExport(J).catch((W)=>L.globalErrorHandler(W));this._pendingExports.add($),$.finally(()=>this._pendingExports.delete($))}async _doExport(J){if(J.resource.asyncAttributesPending)await J.resource.waitForAsyncAttributes?.();let $=await L.internal._export(this._exporter,[J]);if(this._metrics.finishSpans(1,$.error),$.code!==L.ExportResultCode.SUCCESS)throw $.error??Error(`SimpleSpanProcessor: span export failed (status ${$})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._metrics.shutdown(),this._exporter.shutdown()}}class wJ{onStart(J,$){}onEnd(J){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}var bJ=z(N(),1);class T{_ratio;_upperBound;constructor(J=0){this._ratio=this._normalize(J),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(J,$){return{decision:bJ.isValidTraceId($)&&this._accumulate($)<this._upperBound?B.RECORD_AND_SAMPLED:B.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(J){if(typeof J!=="number"||isNaN(J))return 0;return J>=1?1:J<=0?0:J}_accumulate(J){let $=0;for(let W=0;W<32;W+=8){let Z=0;for(let Q=0;Q<8;Q++){let q=J.charCodeAt(W+Q),X=q<58?q-48:q<71?q-55:q-87;Z=Z<<4|X}$=($^Z)>>>0}return $}}var f;(function(J){J.AlwaysOff="always_off",J.AlwaysOn="always_on",J.ParentBasedAlwaysOff="parentbased_always_off",J.ParentBasedAlwaysOn="parentbased_always_on",J.ParentBasedTraceIdRatio="parentbased_traceidratio",J.TraceIdRatio="traceidratio"})(f||(f={}));var s=1;function vJ(){return{sampler:aJ(),forceFlushTimeoutMillis:30000,generalLimits:{attributeValueLengthLimit:D.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:D.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:D.getNumberFromEnv("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:D.getNumberFromEnv("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:D.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function aJ(){let J=D.getStringFromEnv("OTEL_TRACES_SAMPLER")??f.ParentBasedAlwaysOn;switch(J){case f.AlwaysOn:return new j;case f.AlwaysOff:return new k;case f.ParentBasedAlwaysOn:return new P({root:new j});case f.ParentBasedAlwaysOff:return new P({root:new k});case f.TraceIdRatio:return new T(EJ());case f.ParentBasedTraceIdRatio:return new P({root:new T(EJ())});default:return t.diag.error(`OTEL_TRACES_SAMPLER value "${J}" invalid, defaulting to "${f.ParentBasedAlwaysOn}".`),new P({root:new j})}}function EJ(){let J=D.getNumberFromEnv("OTEL_TRACES_SAMPLER_ARG");if(J==null)return t.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${s}.`),s;if(J<0||J>1)return t.diag.error(`OTEL_TRACES_SAMPLER_ARG=${J} was given, but it is out of range ([0..1]), defaulting to ${s}.`),s;return J}var u=z(V(),1),sJ=128,tJ=1/0;function TJ(J){let $=Object.assign({},J.spanLimits);return $.attributeCountLimit=J.spanLimits?.attributeCountLimit??J.generalLimits?.attributeCountLimit??u.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??u.getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT")??sJ,$.attributeValueLengthLimit=J.spanLimits?.attributeValueLengthLimit??J.generalLimits?.attributeValueLengthLimit??u.getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??u.getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??tJ,Object.assign({},J,{spanLimits:$})}class dJ extends n{constructor(J={}){let $=gJ.merge({},vJ(),TJ(J));delete $.generalLimits;super($)}}var SJ=z(V(),1);class uJ extends v{constructor(J,$){if(!$)$={};let W=[["maxExportBatchSize","OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],["maxQueueSize","OTEL_BSP_MAX_QUEUE_SIZE"],["scheduledDelayMillis","OTEL_BSP_SCHEDULE_DELAY"],["exportTimeoutMillis","OTEL_BSP_EXPORT_TIMEOUT"]];for(let[Z,Q]of W)if($[Z]===void 0){let q=SJ.getNumberFromEnv(Q);if(q!==void 0)$[Z]=q}super({exporter:J,...$})}}class mJ extends a{constructor(J){super({exporter:J})}}export{T as TraceIdRatioBasedSampler,mJ as SimpleSpanProcessor,B as SamplingDecision,F as RandomIdGenerator,P as ParentBasedSampler,wJ as NoopSpanProcessor,GJ as InMemorySpanExporter,zJ as ConsoleSpanExporter,uJ as BatchSpanProcessor,dJ as BasicTracerProvider,j as AlwaysOnSampler,k as AlwaysOffSampler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{pP as E}from"./chunk-0w77vhg4.js";import{qP as D}from"./chunk-t4kma6mq.js";import{sP as B,vP as C}from"./chunk-0xf12tf3.js";var J=B((v)=>{Object.defineProperty(v,"__esModule",{value:!0});v.getMachineId=void 0;var q=C("process"),F=E(),G=D();async function H(){let b="%windir%\\System32\\REG.exe";if(q.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in q.env)b="%windir%\\sysnative\\cmd.exe /c "+b;try{let k=(await(0,F.execAsync)(`${b} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split("REG_SZ");if(k.length===2)return k[1].trim()}catch(f){G.diag.debug(`error reading machine id: ${f}`)}return}v.getMachineId=H});export default J();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{zh as ww}from"./chunk-
|
|
2
|
+
import{zh as ww}from"./chunk-x0wy15q9.js";import{ri as LG}from"./chunk-dzy3ezht.js";import{$j as sX,$k as k0,Aj as EB,Ak as PF,Bj as rg,Bk as MF,Cj as jD,Dj as L9,Dk as Zy,Ej as H4,Hj as L2,Hk as sU,Ij as QZ,Ik as wF,Jj as v0,Jk as ow,Kj as B$,Kk as q3,Lj as d0,Lk as G$,Mk as zY,Nj as v3,Nk as s0,Oj as R$,Ok as G2,Pj as YJ,Qk as o0,Rk as vA,Sj as nY,Sk as K0,Tj as sY,Tk as hC,Uj as T8,Vj as bj,Vk as A$,Wj as j1,Wk as nB,Xj as F8,Xk as F3,Yj as h1,Yk as BG,Zj as hP,Zk as f$,_j as nX,_k as D1,ak as gP,al as H0,bk as kQ,ck as bQ,dk as kU,ek as hd,fk as gd,gk as cQ,hk as n1,ik as VJ,jk as DW,kk as T7,lk as lQ,mk as XF,nk as HF,ok as jF,pk as OF,qk as UF,rk as jO,sk as Ej,tj as e,tk as vP,uj as E1,uk as M0,vk as aD,wk as x9,xk as fP,yj as HY,yk as K$,zk as DF}from"./chunk-z4gczap3.js";import{bl as xQ,cl as gA}from"./chunk-2p1qaqv3.js";import{Al as w0,Bl as q1,Cl as vJ,Dl as x6,El as S8,Hl as vN,Il as j6,Kl as q0,Ll as c,Ml as _A,Nl as T$,Ol as ZP,nl as kK,ol as LO,pl as LP,ql as KA,rl as B4,sl as W$,tl as v$,ul as i1,vl as y9,xl as s9}from"./chunk-47pxz6cb.js";import{Pl as cY,Ql as o8,Rl as p2,Sl as p1,Vl as dN,Wl as y0}from"./chunk-aq75kv5f.js";import{Am as I7,Cm as IQ,Fm as lw,Gm as pw,Im as KJ,Vm as H8,Wm as x8,Zl as aU,km as n8,rm as F2,sm as i0,tm as I2,um as B8,vm as tU,xm as D0,zm as a$}from"./chunk-1851skhm.js";import{nn as ZJ}from"./chunk-fbd971t7.js";import{Hn as B7,In as gj,Jn as H7,Ln as W8}from"./chunk-z66xdxkg.js";import{Mn as K9}from"./chunk-jt94rhev.js";import{Nn as O$}from"./chunk-2ts2s8b4.js";import{zp as V0}from"./chunk-6wt8g6mc.js";import{iq as g8,jq as aw,uq as b9,vq as uM}from"./chunk-hsmtjb4d.js";import{Xq as Iw,Yq as zw}from"./chunk-7nh8vjx4.js";import{pr as r7}from"./chunk-gvc1mqrs.js";import{Ar as F7,ur as L1,zr as hA}from"./chunk-xgdst5n5.js";import{Cr as T1,Dr as TK,Gr as xK}from"./chunk-yzxcjr6y.js";import{Sr as A2,Tr as TX,Zr as l1,_r as I8}from"./chunk-53n3tfwn.js";import{Es as IA,Hs as K2,ys as jQ,zs as Q3}from"./chunk-3be70hxy.js";import{Is as q7,Ms as z7}from"./chunk-9a9qcvtz.js";import{Ns as Md}from"./chunk-1sejtx9a.js";import{$s as q$}from"./chunk-mbma071k.js";import{bt as G9}from"./chunk-ajykvcas.js";import{Ct as l4,ct as k1,ft as EX,gt as iX,jt as nD,kt as sD,mt as P6,xt as EP}from"./chunk-dpm5x19e.js";import{Dt as KQ,Gt as Q6}from"./chunk-vvmvryh1.js";import{Mt as c0,Vt as J0}from"./chunk-6g3bzap8.js";import{$t as c8,Yt as j7,au as W0,eu as D$,iu as TJ,ju as e0}from"./chunk-mrh5q4s6.js";import{ku as z}from"./chunk-w623r5kb.js";import{Au as u$,Bu as g1,Cu as A0,Du as H2,Eu as qM,Fu as kG,Gu as Jw,Hu as Yw,Iu as H$,lu as FM,nu as m,ou as $w,pu as z$,qu as L$,ru as SG,su as Zw,tu as B2,uu as B0,vu as j0,wu as _2,xu as E$,yu as TG,zu as xG}from"./chunk-zgj7jx8k.js";import{Ju as eM,dv as GB}from"./chunk-0mdmqtfr.js";import{Oz as SK,Zz as AG}from"./chunk-00krzh3y.js";import{AH as W4,BK as R6,CF as k,DK as wQ,EG as gN,EH as G4,EK as eP,FJ as d8,HJ as P7,JF as AP,KE as x0,OK as K7,PK as uB,RE as O2,RK as $M,SK as RZ,SO as I0,WK as f0,XF as k9,YE as p0,ZC as TP,bG as bN,dI as K,gL as SX,hC as oX,iG as EN,kC as S$,lJ as y8,mF as N$,nG as hN,uK as xP,vK as kP,wK as bP,xK as I6,yC as X0,yK as WU,zD as V8,zK as tP}from"./chunk-hk8m8vax.js";import{lP as rV}from"./chunk-zhddj91f.js";import{rP as J9,sP as U0,tP as R0,vP as o$,wP as Q7,xP as X7}from"./chunk-0xf12tf3.js";var KH=U0((Cp,oY)=>{function a4($){return Array.isArray($)?$:[$]}var SL=void 0,GV="",s4=" ",WV="\\",TL=/^\s+$/,xL=/(?:[^\\]|^)\\$/,kL=/^\\!/,bL=/^\\#/,EL=/\r?\n/g,hL=/^\.{0,2}\/|^\.{1,2}$/,gL=/\/$/,J7="/",t4="node-ignore";if(typeof Symbol<"u")t4=Symbol.for("node-ignore");var e4=t4,Y7=($,Z,J)=>{return Object.defineProperty($,Z,{value:J}),J},vL=/([0-z])-([0-z])/g,$H=()=>!1,fL=($)=>$.replace(vL,(Z,J,Y)=>J.charCodeAt(0)<=Y.charCodeAt(0)?Z:GV),mL=($)=>{let{length:Z}=$;return $.slice(0,Z-Z%2)},dL=[[/^\uFEFF/,()=>GV],[/((?:\\\\)*?)(\\?\s+)$/,($,Z,J)=>Z+(J.indexOf("\\")===0?s4:GV)],[/(\\+?)\s/g,($,Z)=>{let{length:J}=Z;return Z.slice(0,J-J%2)+s4}],[/[\\$.|*+(){^]/g,($)=>`\\${$}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,($,Z,J)=>Z+6<J.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,($,Z,J)=>{let Y=J.replace(/\\\*/g,"[^\\/]*");return Z+Y}],[/\\\\\\(?=[$.|*+(){^])/g,()=>WV],[/\\\\/g,()=>WV],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,($,Z,J,Y,Q)=>Z===WV?`\\[${J}${mL(Y)}${Q}`:Q==="]"?Y.length%2===0?`[${fL(J)}${Y}]`:"[]":"[]"],[/(?:[^*])$/,($)=>/\/$/.test($)?`${$}$`:`${$}(?=$|\\/$)`]],uL=/(^|\\\/)?\\\*$/,uZ="regex",lY="checkRegex",r4="_",cL={[uZ]($,Z){return`${Z?`${Z}[^/]+`:"[^/]*"}(?=$|\\/$)`},[lY]($,Z){return`${Z?`${Z}[^/]*`:"[^/]*"}(?=$|\\/$)`}},lL=($)=>dL.reduce((Z,[J,Y])=>Z.replace(J,Y.bind($)),$),pY=($)=>typeof $==="string",pL=($)=>$&&pY($)&&!TL.test($)&&!xL.test($)&&$.indexOf("#")!==0,oL=($)=>$.split(EL).filter(Boolean);class ZH{constructor($,Z,J,Y,Q,X){this.pattern=$,this.mark=Z,this.negative=Q,Y7(this,"body",J),Y7(this,"ignoreCase",Y),Y7(this,"regexPrefix",X)}get regex(){let $=r4+uZ;if(this[$])return this[$];return this._make(uZ,$)}get checkRegex(){let $=r4+lY;if(this[$])return this[$];return this._make(lY,$)}_make($,Z){let J=this.regexPrefix.replace(uL,cL[$]),Y=this.ignoreCase?new RegExp(J,"i"):new RegExp(J);return Y7(this,Z,Y)}}var iL=({pattern:$,mark:Z},J)=>{let Y=!1,Q=$;if(Q.indexOf("!")===0)Y=!0,Q=Q.substr(1);Q=Q.replace(kL,"!").replace(bL,"#");let X=lL(Q);return new ZH($,Z,Q,J,Y,X)};class JH{constructor($){this._ignoreCase=$,this._rules=[]}_add($){if($&&$[e4]){this._rules=this._rules.concat($._rules._rules),this._added=!0;return}if(pY($))$={pattern:$};if(pL($.pattern)){let Z=iL($,this._ignoreCase);this._added=!0,this._rules.push(Z)}}add($){return this._added=!1,a4(pY($)?oL($):$).forEach(this._add,this),this._added}test($,Z,J){let Y=!1,Q=!1,X;this._rules.forEach((W)=>{let{negative:G}=W;if(Q===G&&Y!==Q||G&&!Y&&!Q&&!Z)return;if(!W[J].test($))return;Y=!G,Q=G,X=G?SL:W});let V={ignored:Y,unignored:Q};if(X)V.rule=X;return V}}var nL=($,Z)=>{throw new Z($)},u8=($,Z,J)=>{if(!pY($))return J(`path must be a string, but got \`${Z}\``,TypeError);if(!$)return J("path must not be empty",TypeError);if(u8.isNotRelative($))return J(`path should be a \`path.relative()\`d string, but got "${Z}"`,RangeError);return!0},YH=($)=>hL.test($);u8.isNotRelative=YH;u8.convert=($)=>$;class QH{constructor({ignorecase:$=!0,ignoreCase:Z=$,allowRelativePaths:J=!1}={}){Y7(this,e4,!0),this._rules=new JH(Z),this._strictPathCheck=!J,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add($){if(this._rules.add($))this._initCache();return this}addPattern($){return this.add($)}_test($,Z,J,Y){let Q=$&&u8.convert($);return u8(Q,$,this._strictPathCheck?nL:$H),this._t(Q,Z,J,Y)}checkIgnore($){if(!gL.test($))return this.test($);let Z=$.split(J7).filter(Boolean);if(Z.pop(),Z.length){let J=this._t(Z.join(J7)+J7,this._testCache,!0,Z);if(J.ignored)return J}return this._rules.test($,!1,lY)}_t($,Z,J,Y){if($ in Z)return Z[$];if(!Y)Y=$.split(J7).filter(Boolean);if(Y.pop(),!Y.length)return Z[$]=this._rules.test($,J,uZ);let Q=this._t(Y.join(J7)+J7,Z,J,Y);return Z[$]=Q.ignored?Q:this._rules.test($,J,uZ)}ignores($){return this._test($,this._ignoreCache,!1).ignored}createFilter(){return($)=>!this.ignores($)}filter($){return a4($).filter(this.createFilter())}test($){return this._test($,this._testCache,!0)}}var BV=($)=>new QH($),sL=($)=>u8($&&u8.convert($),$,$H),XH=()=>{let $=(J)=>/^\\\\\?\\/.test(J)||/["<>|\u0000-\u001F]+/u.test(J)?J:J.replace(/\\/g,"/");u8.convert=$;let Z=/^[a-z]:\//i;u8.isNotRelative=(J)=>Z.test(J)||YH(J)};if(typeof process<"u"&&process.platform==="win32")XH();oY.exports=BV;BV.default=BV;oY.exports.isPathValid=sL;Y7(oY.exports,Symbol.for("setupWindows"),XH)});var rY=U0((Py)=>{Py.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};Py.find=($,Z)=>$.nodes.find((J)=>J.type===Z);Py.exceedsLimit=($,Z,J=1,Y)=>{if(Y===!1)return!1;if(!Py.isInteger($)||!Py.isInteger(Z))return!1;return(Number(Z)-Number($))/Number(J)>=Y};Py.escapeNode=($,Z=0,J)=>{let Y=$.nodes[Z];if(!Y)return;if(J&&Y.type===J||Y.type==="open"||Y.type==="close"){if(Y.escaped!==!0)Y.value="\\"+Y.value,Y.escaped=!0}};Py.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};Py.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};Py.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};Py.reduce=($)=>$.reduce((Z,J)=>{if(J.type==="text")Z.push(J.value);if(J.type==="range")J.type="text";return Z},[]);Py.flatten=(...$)=>{let Z=[],J=(Y)=>{for(let Q=0;Q<Y.length;Q++){let X=Y[Q];if(Array.isArray(X)){J(X);continue}if(X!==void 0)Z.push(X)}return Z};return J($),Z}});var aY=U0((dp,qH)=>{var FH=rY();qH.exports=($,Z={})=>{let J=(Y,Q={})=>{let X=Z.escapeInvalid&&FH.isInvalidBrace(Q),V=Y.invalid===!0&&Z.escapeInvalid===!0,W="";if(Y.value){if((X||V)&&FH.isOpenOrClose(Y))return"\\"+Y.value;return Y.value}if(Y.value)return Y.value;if(Y.nodes)for(let G of Y.nodes)W+=J(G);return W};return J($)}});var _H=U0((up,zH)=>{/*!
|
|
3
3
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
@@ -87,7 +87,7 @@ A well-formed call looks like: ${JSON.stringify(tZ(z.toJSONSchema(Z)))}`}catch{Q
|
|
|
87
87
|
- If there is no real choice to make \u2014 you simply need more information, context or goals \u2014 ask for it as prose in your reply. Do NOT call this tool for that.
|
|
88
88
|
- The user may dismiss the prompt. You then get a "declined" result: proceed with your best judgement or stop and wait for direction. Do not re-ask the same question.`,MO=($)=>({title:`Dismissed ${$} question${$===1?"":"s"}`,output:"The user declined to answer and dismissed the question. This is final for this turn \u2014 do NOT ask again. "+"Either proceed with your best judgement using what you already know, or stop and wait for the user to give direction.",metadata:{answers:[],declined:!0}});function rR($){for(let Z=$.length-1;Z>=0;Z--){let J=$[Z]?.info;if(J?.role==="user")return J.time.created}return 0}var wO=m0("question",K.gen(function*(){let $=((yield*V0.toolDescriptionEffect("question"))??"")+sR,Z=yield*K1.Service;return{description:$,parameters:nR,execute:(J,Y)=>K.gen(function*(){if(yield*Z.neverAsk())return{title:`Auto-resolved ${J.questions.length} question${J.questions.length>1?"s":""}`,output:"[Never-Ask] No user is available to answer (never-ask mode is on). "+"Re-evaluate the options you just proposed for unattended/headless execution \u2014 "+"prefer text-only, non-interactive, minimal-scope paths and avoid anything that needs a GUI or the user to be present. Pick the best option yourself and continue. "+"IMPORTANT: You MUST explicitly state which option you chose and why in your response text (not just in thinking) \u2014 "+"the user will review the conversation history later and needs to see what you decided without expanding thinking blocks. This applies only to this question; never-ask may be turned off later, so keep using the question tool at future decision points (the user may have returned).",metadata:{answers:J.questions.map(()=>["[Never-Ask] The model will decide autonomously"])}};let Q=yield*Z.declinedAt(Y.sessionID);if(Q!==void 0&&Q>=rR(Y.messages))return MO(J.questions.length);let X=yield*Z.ask({sessionID:Y.sessionID,questions:J.questions,tool:Y.callID?{messageID:Y.messageID,callID:Y.callID}:void 0}).pipe(K.catch(()=>K.succeed(void 0)));if(X===void 0)return MO(J.questions.length);let V=J.questions.map((W,G)=>`"${W.question}"="${X[G]?.length?X[G].join(", "):"Unanswered"}"`).join(", ");return{title:`Asked ${J.questions.length} question${J.questions.length>1?"s":""}`,output:`User has answered your questions: ${V}. You can now continue with the user's answers in mind.`,metadata:{answers:X}}}).pipe(K.orDie)}}));import aV from"os";import{createWriteStream as _S}from"fs";import{open as DS,stat as PS}from"fs/promises";import B9 from"path";import{fileURLToPath as SO}from"url";var z1={};R0(z1,{preferred:()=>VS,posix:()=>KS,name:()=>eZ,login:()=>XS,killTree:()=>ZS,gitbash:()=>pV,acceptable:()=>WS,Shell:()=>z1});import UQ from"path";import{spawn as aR}from"child_process";import{setTimeout as CO}from"timers/promises";var NO=200,tR=new Set(["fish","nu"]),eR=new Set(["bash","dash","fish","ksh","sh","zsh"]),$S=new Set(["bash","dash","ksh","sh","zsh"]);async function ZS($,Z){let J=$.pid;if(!J||Z?.exited?.())return;if(process.platform==="win32"){await new Promise((Y)=>{let Q=aR("taskkill",["/pid",String(J),"/f","/t"],{stdio:"ignore",windowsHide:!0});Q.once("exit",()=>Y()),Q.once("error",()=>Y())});return}try{if(process.kill(-J,"SIGTERM"),await CO(NO),!Z?.exited?.())process.kill(-J,"SIGKILL")}catch(Y){if($.kill("SIGTERM"),await CO(NO),!Z?.exited?.())$.kill("SIGKILL")}}function JS($){if(process.platform!=="win32")return $;let Z=D$.windowsPath($);if(UQ.win32.dirname(Z)!=="."){if(Z.startsWith("/")&&eZ(Z)==="bash")return pV()||Z;return Z}return O$(Z)||Z}function YS(){let $=O$("pwsh.exe");if($)return $;let Z=O$("powershell.exe");if(Z)return Z}function AO($,Z){if($&&(!Z?.acceptable||!tR.has(eZ($))))return JS($);if(process.platform==="win32"){let J=YS();if(J)return J}return QS()}function pV(){if(process.platform!=="win32")return;if(c0.QITQODE_GIT_BASH_PATH)return c0.QITQODE_GIT_BASH_PATH;let $=O$("git");if(!$)return;let Z=UQ.join($,"..","..","bin","bash.exe");if(D$.stat(Z)?.size)return Z}function QS(){if(process.platform==="win32"){let Z=pV();if(Z)return Z;return process.env.COMSPEC||"cmd.exe"}if(process.platform==="darwin")return"/bin/zsh";let $=O$("bash");if($)return $;return"/bin/sh"}function eZ($){if(process.platform==="win32")return UQ.win32.parse(D$.windowsPath($)).name.toLowerCase();return UQ.basename($).toLowerCase()}function XS($){return eR.has(eZ($))}function KS($){return $S.has(eZ($))}var VS=K9(()=>AO(process.env.SHELL)),WS=K9(()=>AO(process.env.SHELL,{acceptable:!0}));var b$={};R0(b$,{set:()=>jS,get:()=>HS,clear:()=>OS,SessionCwd:()=>b$,Event:()=>BS});var GS=1000,D6=new Map;LO(async()=>{D6.clear()});var BS={Changed:y0.define("session.cwd",z.object({sessionID:v0.zod,cwd:z.string()}))};function HS($){return D6.get($)??q0.directory}function jS($,Z){if(D6.delete($),D6.set($,Z),D6.size>GS){let J=D6.keys().next().value;if(J!==void 0)D6.delete(J)}}function OS($){D6.delete($)}var $J={};R0($J,{prefixWith:()=>US,BashArity:()=>$J});function US($,Z){return G9.bashPrefixWith($,Z)}import FS from"crypto";var oV=J0.create({service:"bash-interactive"}),yO={Asked:y0.define("bash.interactive.asked",z.object({id:z.string(),command:z.string(),cwd:z.string(),env:z.record(z.string(),z.string()).optional(),description:z.string()})),Replied:y0.define("bash.interactive.replied",z.object({id:z.string(),output:z.string(),exitCode:z.number()}))};class IO extends Error{constructor($){super($);this.name="BashInteractiveError"}}class FQ extends X0.Service()("@qitqode/BashInteractive"){}var qS=k.effect(FQ,K.gen(function*(){let $=yield*e.Service,Z=yield*c.make(K.fn("BashInteractive.state")(function*(){let X={pending:new Map};return yield*K.addFinalizer(()=>K.gen(function*(){for(let V of X.pending.values())yield*p0.fail(V.deferred,new IO("Instance disposed"));X.pending.clear()})),X})),J=K.fn("BashInteractive.request")(function*(X){let V=(yield*c.get(Z)).pending,W=FS.randomUUID();oV.info("requesting interactive",{id:W,command:X.command});let G=yield*p0.make(),H={id:W,command:X.command,cwd:X.cwd,env:X.env,description:X.description};return V.set(W,{request:H,deferred:G}),yield*$.publish(yO.Asked,H),yield*jQ.awaitDeferred(G,()=>{V.delete(W)})}),Y=K.fn("BashInteractive.reply")(function*(X){let V=(yield*c.get(Z)).pending,W=V.get(X.id);if(!W){oV.warn("reply for unknown request",{id:X.id});return}V.delete(X.id),oV.info("replied",{id:X.id,exitCode:X.exitCode}),yield*$.publish(yO.Replied,{id:W.request.id,output:X.output,exitCode:X.exitCode}),yield*p0.succeed(W.deferred,{output:X.output,exitCode:X.exitCode})}),Q=K.fn("BashInteractive.list")(function*(){let X=(yield*c.get(Z)).pending;return Array.from(X.values(),(V)=>V.request)});return FQ.of({request:J,reply:Y,list:Q})})),iV=qS.pipe(k.provide(e.layer)),{runPromise:zS}=F7(FQ,iV);function RO($){return zS((Z)=>Z.request($))}var TO=12000,MS=c0.QITQODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS||120000,hO=new Set(["powershell","pwsh"]),gO=new Set(["cd","push-location","set-location"]),wS=new Set([...gO,"rm","cp","mv","mkdir","touch","chmod","chown","cat","get-content","set-content","add-content","copy-item","move-item","remove-item","new-item","rename-item"]),CS=new Set(["-destination","-literalpath","-path"]),NS=new Set(["-confirm","-debug","-force","-nonewline","-recurse","-verbose","-whatif"]),tV=J0.create({service:"bash-tool"}),sV=($)=>{if($.startsWith("file://"))return SO($);if($.startsWith("/")||/^[a-z]:/i.test($))return $;let Z=new URL($,import.meta.url);return SO(Z)};function AS($){let Z=[];for(let J=0;J<$.childCount;J++){let Y=$.child(J);if(!Y)continue;if(Y.type==="command_elements"){for(let Q=0;Q<Y.childCount;Q++){let X=Y.child(Q);if(!X||X.type==="command_argument_sep"||X.type==="redirection")continue;Z.push({type:X.type,text:X.text})}continue}if(Y.type!=="command_name"&&Y.type!=="command_name_expr"&&Y.type!=="word"&&Y.type!=="string"&&Y.type!=="raw_string"&&Y.type!=="concatenation")continue;Z.push({type:Y.type,text:Y.text})}return Z}function LS($){return($.parent?.type==="redirected_statement"?$.parent.text:$.text).trim()}function yS($){return $.descendantsOfType("command").filter((Z)=>Boolean(Z))}function vO($){if($.length<2)return $;let Z=$[0],J=$[$.length-1];if((Z==='"'||Z==="'")&&Z===J)return $.slice(1,-1);return $}function fO($){if($==="~")return aV.homedir();if($.startsWith("~/")||$.startsWith("~\\"))return B9.join(aV.homedir(),$.slice(2));return $}function xO($){if(process.platform!=="win32")return process.env[$];let Z=Object.keys(process.env).find((J)=>J.toLowerCase()===$.toLowerCase());return Z?process.env[Z]:void 0}function IS($,Z,J){let Y=$.toUpperCase();if(Y==="HOME")return aV.homedir();if(Y==="PWD")return Z;if(Y==="PSHOME")return B9.dirname(J)}function RS($,Z,J){let Y=vO($).replace(/\$\{env:([^}]+)\}/gi,(Q,X)=>xO(X)||"").replace(/\$env:([A-Za-z_][A-Za-z0-9_]*)/gi,(Q,X)=>xO(X)||"").replace(/\$(HOME|PWD|PSHOME)(?=$|[\\/])/gi,(Q,X)=>IS(X,Z,J)||"");return fO(Y)}function SS($){let Z=$.match(/^([A-Za-z]+)::(.*)$/);if(Z){if(Z[1].toLowerCase()!=="filesystem")return;return Z[2]}let J=$.match(/^([A-Za-z]+):(.*)$/);if(!J)return $;if(J[1].length===1)return $;return}function TS($,Z){if($.startsWith("(")||$.startsWith("@("))return!0;if($.includes("$(")||$.includes("${")||$.includes("`"))return!0;if(Z)return/\$(?!env:)/i.test($);return $.includes("$")}function xS($){let Z=/[?*[]/.exec($);if(!Z)return $;if(Z.index===0)return;return $.slice(0,Z.index)}function kS($,Z){if(!Z)return $.slice(1).filter((Q)=>!Q.text.startsWith("-")&&!($[0]?.text==="chmod"&&Q.text.startsWith("+"))).map((Q)=>Q.text);let J=[],Y=!1;for(let Q of $.slice(1)){if(Y){J.push(Q.text),Y=!1;continue}if(Q.type==="command_parameter"){let X=Q.text.toLowerCase();if(NS.has(X))continue;Y=CS.has(X);continue}J.push(Q.text)}return J}function kO($){if($.length<=TO)return $;return`...
|
|
89
89
|
|
|
90
|
-
`+$.slice(-TO)}var bS=/error|exception|failed|fatal|traceback|panic|exit code/i,bO=Math.floor(l8*0.7),EO=Math.floor(O7*0.7),ES=K.fn("BashTool.parse")(function*($,Z){let J=yield*K.promise(()=>vS().then((Y)=>(Z?Y.ps:Y.bash).parse($)).catch((Y)=>{return tV.warn("tree-sitter parse of command failed",{error:String(Y)}),null}));if(!J)throw Error("Failed to parse command");return J.rootNode}),hS=K.fn("BashTool.ask")(function*($,Z){if(Z.dirs.size>0){let J=Array.from(Z.dirs).map((Y)=>{if(process.platform==="win32")return W0.normalizePathPattern(B9.join(Y,"*"));return B9.join(Y,"*")});yield*$.ask({permission:"external_directory",patterns:J,always:J,metadata:{}})}if(Z.patterns.size===0)return;yield*$.ask({permission:"bash",patterns:Array.from(Z.patterns),always:Array.from(Z.always),metadata:{}})});function gS($,Z,J,Y,Q){if(process.platform==="win32"&&hO.has(Z))return p2.make($,["-NoLogo","-NoProfile","-NonInteractive","-Command",J],{cwd:Y,env:Q,stdin:"ignore",detached:!1});return p2.make(J,[],{shell:$,cwd:Y,env:Q,stdin:"ignore",detached:process.platform!=="win32"})}var vS=K9(async()=>{let{Parser:$}=await import("./chunk-
|
|
90
|
+
`+$.slice(-TO)}var bS=/error|exception|failed|fatal|traceback|panic|exit code/i,bO=Math.floor(l8*0.7),EO=Math.floor(O7*0.7),ES=K.fn("BashTool.parse")(function*($,Z){let J=yield*K.promise(()=>vS().then((Y)=>(Z?Y.ps:Y.bash).parse($)).catch((Y)=>{return tV.warn("tree-sitter parse of command failed",{error:String(Y)}),null}));if(!J)throw Error("Failed to parse command");return J.rootNode}),hS=K.fn("BashTool.ask")(function*($,Z){if(Z.dirs.size>0){let J=Array.from(Z.dirs).map((Y)=>{if(process.platform==="win32")return W0.normalizePathPattern(B9.join(Y,"*"));return B9.join(Y,"*")});yield*$.ask({permission:"external_directory",patterns:J,always:J,metadata:{}})}if(Z.patterns.size===0)return;yield*$.ask({permission:"bash",patterns:Array.from(Z.patterns),always:Array.from(Z.always),metadata:{}})});function gS($,Z,J,Y,Q){if(process.platform==="win32"&&hO.has(Z))return p2.make($,["-NoLogo","-NoProfile","-NonInteractive","-Command",J],{cwd:Y,env:Q,stdin:"ignore",detached:!1});return p2.make(J,[],{shell:$,cwd:Y,env:Q,stdin:"ignore",detached:process.platform!=="win32"})}var vS=K9(async()=>{let{Parser:$}=await import("./chunk-dymysn4h.js"),{default:Z}=await import("./chunk-ckcnb59t.js",{with:{type:"wasm"}}),J=sV(Z);await $.init({locateFile(){return J}});let{default:Y}=await import("./chunk-shqqngm8.js",{with:{type:"wasm"}}),{default:Q}=await import("./chunk-ew2dxm43.js",{with:{type:"wasm"}}),X=sV(Y),V=sV(Q),[W,G]=await Promise.all([rV.load(X),rV.load(V)]),H=new $;H.setLanguage(W);let B=new $;return B.setLanguage(G),{bash:H,ps:B}}),mO=m0("bash",K.gen(function*(){let $=(yield*V0.toolDescriptionEffect("bash"))??"",Z=yield*cY,J=yield*W0.Service,Y=yield*o1,Q=yield*s0.Service,X=K.fn("BashTool.cygpath")(function*(j,O){let F=(yield*Z.lines(p2.make(j,["-lc",'cygpath -w -- "$1"',"_",O])).pipe(K.catch(()=>K.succeed([]))))[0]?.trim();if(!F)return;return W0.normalizePath(F)}),V=K.fn("BashTool.resolvePath")(function*(j,O,U){if(process.platform==="win32"){if(z1.posix(U)&&j.startsWith("/")&&W0.windowsPath(j)===j){let F=yield*X(U,j);if(F)return F}return W0.normalizePath(B9.resolve(O,W0.windowsPath(j)))}return B9.resolve(O,j)}),W=K.fn("BashTool.argPath")(function*(j,O,U,F){let q=U?RS(j,O,F):fO(vO(j)),C=q&&xS(q);if(!C||TS(C,U))return;let _=U?SS(C):C;if(!_)return;return yield*V(_,O,F)}),G=K.fn("BashTool.collect")(function*(j,O,U,F){let q={dirs:new Set,patterns:new Set,always:new Set},C=yield*K.promise(()=>V0.resolveBashArity());for(let _ of yS(j)){let D=AS(_),M=D.map((y)=>y.text),P=U?M[0]?.toLowerCase():M[0];if(P&&wS.has(P))for(let y of kS(D,U)){let I=yield*W(y,O,U,F);if(tV.info("resolved path",{arg:y,resolved:I}),!I||q0.containsPath(I))continue;let x=(yield*J.isDir(I))?I:B9.dirname(I);q.dirs.add(x)}if(M.length&&(!P||!gO.has(P)))q.patterns.add(LS(_)),q.always.add($J.prefixWith(C,M).join(" ")+" *")}return q}),H=K.fn("BashTool.shellEnv")(function*(j,O){let U=yield*Q.trigger("shell.env",{cwd:O,sessionID:j.sessionID,callID:j.callID},{env:{}});return{...q7(),...U.env}}),B=K.fn("BashTool.run")(function*(j,O){let U=l8,F=O7,q=U*2,C="",_="",D=[],M=0,P="",y,I=!1,x=!1,h=!1;yield*O.metadata({metadata:{output:"",description:j.description}});let S=yield*K.scoped(K.gen(function*(){let A=yield*Z.spawn(gS(j.shell,j.name,j.command,j.cwd,j.env));yield*K.forkScoped(f0.runForEach(f0.decodeText(A.all),(l)=>{let u=Buffer.byteLength(l,"utf-8");D.push({text:l,size:u}),M+=u;while(M>q&&D.length>1){let d=D.shift();if(!d)break;M-=d.size,I=!0}if(_=kO(_+l),P)y?.write(l);else if(C+=l,Buffer.byteLength(C,"utf-8")>U)return Y.write(C).pipe(K.andThen((d)=>K.sync(()=>{P=d,I=!0,y=_S(d,{flags:"a"}),C=""})),K.andThen(O.metadata({metadata:{output:_,description:j.description}})));return O.metadata({metadata:{output:_,description:j.description}})}));let R=K.callback((l)=>{if(O.abort.aborted)return l(K.void);let u=()=>l(K.void);if(O.abort.addEventListener("abort",u,{once:!0}),O.abort.aborted)u();return K.sync(()=>O.abort.removeEventListener("abort",u))}),b=K.sleep(`${j.timeout+100} millis`),a=yield*K.raceAll([A.exitCode.pipe(K.map((l)=>({kind:"exit",code:l}))),R.pipe(K.map(()=>({kind:"abort",code:null}))),b.pipe(K.map(()=>({kind:"timeout",code:null})))]);if(a.kind==="abort")h=!0,yield*A.kill({forceKillAfter:"3 seconds"}).pipe(K.orDie);if(a.kind==="timeout")x=!0,yield*A.kill({forceKillAfter:"3 seconds"}).pipe(K.orDie);return a.kind==="exit"?a.code:null})).pipe(K.orDie),f=[];if(x)f.push(`bash tool terminated command after exceeding timeout ${j.timeout} ms. If this command is expected to take longer and is not waiting for interactive input, retry with a larger timeout value in milliseconds.`);if(h)f.push("User aborted the command");let L=D.map((A)=>A.text).join(""),T=bV(L,F,U);if(T.cut)I=!0;if(!P&&T.cut)P=yield*Y.write(L);let E=T.text;if(!E)E="(no output)";if(I&&P){let A=T.text.length>2048?T.text.slice(-2048):T.text;if(bS.test(A)){let b=yield*K.promise(async()=>{try{let a=await PS(P),l=bO*2,u=await DS(P,"r");try{let d=Math.min(Number(a.size),l),i=Buffer.alloc(d);await u.read(i,0,d,0);let Q0=i.toString("utf-8"),r=1;for(let $0=0;$0<Q0.length;$0++)if(Q0.charCodeAt($0)===10)r++;let v=r<=EO+F;return{text:Q0,overlaps:v}}finally{await u.close()}}catch{return}});if(b){let a=b.text;if(!b.overlaps){let l=kV(a,EO,bO);E=`...output truncated (head+tail shown due to errors)...
|
|
91
91
|
|
|
92
92
|
Full output saved to: ${P}
|
|
93
93
|
|
|
@@ -7551,7 +7551,7 @@ export const tui: TuiPlugin = async (api) => {
|
|
|
7551
7551
|
- Use \`.tsx\` extension for JSX support
|
|
7552
7552
|
- Components use Solid.js JSX (NOT React) \u2014 no useState/useEffect, use signals
|
|
7553
7553
|
- Keep plugins lightweight \u2014 they run in the main rendering thread
|
|
7554
|
-
`}}}catch($){if($ instanceof ReferenceError)return qD();throw $}}var Yv=Jv(),Qv=J0.create({service:"skill.builtin"}),_D=K.fn("Skill.extractBuiltinBundle")(function*($){let Z=zD.join(TJ.data,"builtin_skills",k1),J=zD.join(Z,".extracted");return yield*kX({fsys:$,bundle:Yv,root:Z,marker:J,markerContent:k1,skipIfPresent:!EX,onExtracted:(Y)=>Qv.info("extracted builtin skills",{root:Y})})});var xJ=J0.create({service:"skill"}),Vv=[".claude",".agents",".codex",".opencode"],DD="skills/**/SKILL.md",Wv="{skill,skills}/**/SKILL.md",hX="**/SKILL.md",PD=z.object({name:z.string(),description:z.string(),location:z.string(),content:z.string(),hidden:z.boolean().optional()}),Gv=q$.create("SkillInvalidError",z.object({path:z.string(),message:z.string().optional(),issues:z.custom().optional()})),Bv=q$.create("SkillNameMismatchError",z.object({path:z.string(),expected:z.string(),actual:z.string()})),Hv=K.fnUntraced(function*($,Z,J){let Y=yield*K.tryPromise({try:()=>L9.parse(Z),catch:(X)=>X}).pipe(K.catch(K.fnUntraced(function*(X){let V=L9.FrontmatterError.isInstance(X)?X.data.message:`Failed to parse skill ${Z}`,{Session:W}=yield*K.promise(()=>import("./chunk-
|
|
7554
|
+
`}}}catch($){if($ instanceof ReferenceError)return qD();throw $}}var Yv=Jv(),Qv=J0.create({service:"skill.builtin"}),_D=K.fn("Skill.extractBuiltinBundle")(function*($){let Z=zD.join(TJ.data,"builtin_skills",k1),J=zD.join(Z,".extracted");return yield*kX({fsys:$,bundle:Yv,root:Z,marker:J,markerContent:k1,skipIfPresent:!EX,onExtracted:(Y)=>Qv.info("extracted builtin skills",{root:Y})})});var xJ=J0.create({service:"skill"}),Vv=[".claude",".agents",".codex",".opencode"],DD="skills/**/SKILL.md",Wv="{skill,skills}/**/SKILL.md",hX="**/SKILL.md",PD=z.object({name:z.string(),description:z.string(),location:z.string(),content:z.string(),hidden:z.boolean().optional()}),Gv=q$.create("SkillInvalidError",z.object({path:z.string(),message:z.string().optional(),issues:z.custom().optional()})),Bv=q$.create("SkillNameMismatchError",z.object({path:z.string(),expected:z.string(),actual:z.string()})),Hv=K.fnUntraced(function*($,Z,J){let Y=yield*K.tryPromise({try:()=>L9.parse(Z),catch:(X)=>X}).pipe(K.catch(K.fnUntraced(function*(X){let V=L9.FrontmatterError.isInstance(X)?X.data.message:`Failed to parse skill ${Z}`,{Session:W}=yield*K.promise(()=>import("./chunk-dk9k8ff5.js"));yield*J.publish(W.Event.Error,{error:new q$.Unknown({message:V}).toObject()}),xJ.error("failed to load skill",{skill:Z,err:X});return})));if(!Y)return;let Q=PD.pick({name:!0,description:!0,hidden:!0}).safeParse(Y.data);if(!Q.success)return;if($.skills[Q.data.name])xJ.warn("duplicate skill name",{name:Q.data.name,existing:$.skills[Q.data.name].location,duplicate:Z});$.dirs.add(s7.dirname(Z)),$.skills[Q.data.name]={name:Q.data.name,description:Q.data.description,location:Z,content:Y.content,hidden:Q.data.hidden}}),A9=K.fnUntraced(function*($,Z,J,Y){let Q=yield*K.tryPromise({try:()=>c8.scan(J,{cwd:Z,absolute:!0,include:"file",symlink:!0,dot:Y?.dot}),catch:(X)=>X}).pipe(K.catch((X)=>{if(!Y?.scope)return K.die(X);return xJ.error(`failed to scan ${Y.scope} skills`,{dir:Z,error:X}),K.succeed([])}));for(let X of Q)$.matches.add(X),$.dirs.add(s7.dirname(X))}),jv=K.fnUntraced(function*($,Z,J,Y,Q){let X={matches:new Set,dirs:new Set};if(!c0.QITQODE_DISABLE_BUILTIN_SKILLS){let G=yield*_D(J).pipe(K.catch(()=>K.succeed(void 0)));if(G&&(yield*J.isDir(G)))yield*A9(X,G,hX,{scope:"builtin"})}if(!c0.QITQODE_DISABLE_COMPOSE_SKILLS){let G=yield*UD(J).pipe(K.catch(()=>K.succeed(void 0)));if(G&&(yield*J.isDir(G)))yield*A9(X,G,hX,{scope:"compose"})}if(!c0.QITQODE_DISABLE_EXTERNAL_SKILLS){let G=Vv.filter((B)=>{if(B===".claude"&&c0.QITQODE_DISABLE_CLAUDE_CODE_SKILLS)return!1;if(B===".codex"&&c0.QITQODE_DISABLE_CODEX_SKILLS)return!1;if(B===".opencode"&&c0.QITQODE_DISABLE_OPENCODE_SKILLS)return!1;return!0});for(let B of G){let j=s7.join(e0.Path.home,B);if(!(yield*J.isDir(j)))continue;yield*A9(X,j,DD,{dot:!0,scope:"global"})}let H=yield*J.up({targets:G,start:Y,stop:Q}).pipe(K.catch(()=>K.succeed([])));for(let B of H)yield*A9(X,B,DD,{dot:!0,scope:"project"})}let V=yield*$.directories();for(let G of V)yield*A9(X,G,Wv);let W=yield*$.get();for(let G of W.skills?.paths??[]){let H=G.startsWith("~/")?s7.join(Xv.homedir(),G.slice(2)):G,B=s7.isAbsolute(H)?H:s7.join(Y,H);if(!(yield*J.isDir(B))){xJ.warn("skill path not found",{path:B});continue}yield*A9(X,B,hX)}for(let G of W.skills?.urls??[]){let H=yield*Z.pull(G);for(let B of H)yield*A9(X,B,hX)}return{matches:Array.from(X.matches),dirs:Array.from(X.dirs)}}),Ov=K.fnUntraced(function*($,Z,J){yield*K.forEach(Z.matches,(Y)=>Hv($,Y,J),{concurrency:16,discard:!0}),xJ.info("init",{count:Object.keys($.skills).length})});class gX extends X0.Service()("@qitqode/Skill"){}var MD=k.effect(gX,K.gen(function*(){let $=yield*y6.Service,Z=yield*H0.Service,J=yield*e.Service,Y=yield*W0.Service,Q=yield*c.make(K.fn("Skill.discovery")(function*(j){return yield*jv(Z,$,Y,j.directory,j.worktree)})),X=yield*c.make(K.fn("Skill.state")(function*(j){let O={skills:{},dirs:new Set};return yield*Ov(O,yield*c.get(Q),J),O})),V=K.fn("Skill.get")(function*(j){return(yield*c.get(X)).skills[j]}),W=K.fn("Skill.all")(function*(){let j=yield*c.get(X);return Object.values(j.skills)}),G=K.fn("Skill.dirs")(function*(){return(yield*c.get(Q)).dirs}),H=K.fn("Skill.available")(function*(j){let O=yield*c.get(X),U=Object.values(O.skills).filter((F)=>!F.hidden);if(U=U.toSorted((F,q)=>F.name.localeCompare(q.name)),!j)return U;return U.filter((F)=>M0.evaluate("skill",F.name,j.permission).action!=="deny")}),B=K.fn("Skill.reload")(function*(){yield*c.invalidate(Q),yield*c.invalidate(X)});return gX.of({get:V,all:W,dirs:G,available:H,reload:B})})),Uv=MD.pipe(k.provide(y6.defaultLayer),k.provide(H0.defaultLayer),k.provide(e.layer),k.provide(W0.defaultLayer));function Fv($,Z){if($.length===0)return"No skills are currently available.";if(Z.verbose)return["<available_skills>",...$.sort((J,Y)=>J.name.localeCompare(Y.name)).flatMap((J)=>[" <skill>",` <name>${J.name}</name>`,` <description>${J.description}</description>`,` <location>${Kv(J.location).href}</location>`," </skill>"]),"</available_skills>"].join(`
|
|
7555
7555
|
`);return["## Available Skills",...$.toSorted((J,Y)=>J.name.localeCompare(Y.name)).map((J)=>`- **${J.name}**: ${J.description}`)].join(`
|
|
7556
7556
|
`)}var a5=m0("skill",K.gen(function*(){let $=(yield*V0.toolDescriptionEffect("skill"))??"",Z=yield*W2.Service,J=yield*o2.Service;return{description:$,parameters:rj,execute:(Y,Q)=>K.gen(function*(){let X=yield*Z.get(Y.name);if(!X){let j=(yield*Z.all()).map((O)=>O.name).join(", ");throw Error(`Skill "${Y.name}" not found. Available skills: ${j||"none"}`)}yield*Q.ask({permission:"skill",patterns:[Y.name],always:[Y.name],metadata:{}});let V=wD.dirname(X.location),W=qv(V).href,G=10,H=yield*J.files({cwd:V,follow:!1,hidden:!0,signal:Q.abort}).pipe(R6((B)=>!B.includes("SKILL.md")),I6((B)=>wD.resolve(V,B)),wQ(G),K7,K.map((B)=>[...B].map((j)=>`<file>${j}</file>`).join(`
|
|
7557
7557
|
`)));return{title:`Loaded skill: ${X.name}`,output:[`<skill_content name="${X.name}">`,`# Skill: ${X.name}`,"",X.content.trim(),"",`Base directory for this skill: ${W}`,"Relative paths in this skill (e.g., scripts/, reference/) are relative to this base directory.","Note: file list is sampled.","","<skill_files>",H,"</skill_files>","</skill_content>"].join(`
|
|
@@ -8162,7 +8162,7 @@ If you repeat the same output again, the session will be terminated.
|
|
|
8162
8162
|
`):[`Your last ${TZ} steps have been identical \u2014 you appear to be`,"repeating the same action without making progress. Stop and reconsider:","the current approach is not working. Try a different strategy, use a","different tool, or if you are blocked, explain the blocker to the user","instead of repeating the same step again."].join(`
|
|
8163
8163
|
`)})})}var aB=J0.create({service:"auto-dream"}),tB=86400000,Cc=7,Nc=30,JN=1e4,eB="Auto Dream",$4="Auto Distill",$N=0,ZN=0,YN=["Run one automatic dream memory consolidation pass for the current project.","","Use the memory files as the working index and the raw qitqode trajectory database as the source of truth.","Use bash for read-only SQLite and filesystem inspection. Do not modify the database.","Consolidate only durable, verified information into project memory."].join(`
|
|
8164
8164
|
`),QN=["Run one automatic distill pass for the current project.","","Review the past month of sessions and identify repeated manual workflows worth packaging.","Use the raw qitqode trajectory database as the source of truth and memory files to spot cross-session patterns.","Inventory existing skills, agents, and commands first so you reuse or extend instead of duplicating.","Use bash for read-only SQLite and filesystem inspection. Do not modify the database.","Produce a compact shortlist, then create only the high-confidence missing assets."].join(`
|
|
8165
|
-
`);function XN($){return K.gen(function*(){if(!$.enabled)return!1;let Z=$.intervalDays*tB,J=yield*K.sync(()=>w0.use((X)=>X.select({time_created:W$.time_created}).from(W$).where(D0(W$.title,$.title)).orderBy(x8(W$.time_created)).limit(1).get())),Y=Date.now(),Q=J?Y-J.time_created:1/0;if(!J){let X=yield*K.sync(()=>w0.use((V)=>V.select({time_created:W$.time_created}).from(W$).where(KJ(W$.parent_id)).orderBy(H8(W$.time_created)).limit(1).get()));if(!X||Y-X.time_created<Z)return aB.info(`auto-${$.label} skipped \u2014 project too young`,{projectAge:X?Math.round((Y-X.time_created)/tB)+"d":"empty",interval:$.intervalDays+"d"}),!1}if(Q<Z)return aB.info(`auto-${$.label} skipped \u2014 last run too recent`,{lastRunAgo:Math.round(Q/tB)+"d",interval:$.intervalDays+"d"}),!1;return aB.info(`auto-${$.label} triggering`,{lastRun:J?new Date(J.time_created).toISOString():"never",interval:$.intervalDays+"d"}),!0})}function KN($){let Z=$.dream?.auto!==!1;if(!Z)return K.succeed(!1);let J=Date.now();if(J-$N<JN)return K.succeed(!1);$N=J;let Y=$.dream?.interval_days??Cc;return XN({enabled:Z,intervalDays:Y,title:eB,label:"dream"})}function VN($){let Z=$.distill?.auto!==!1;if(!Z)return K.succeed(!1);let J=Date.now();if(J-ZN<JN)return K.succeed(!1);ZN=J;let Y=$.distill?.interval_days??Nc;return XN({enabled:Z,intervalDays:Y,title:$4,label:"distill"})}var WN=K.fnUntraced(function*($){let Z=yield*$.config.get(),J=yield*KN(Z).pipe(K.catch(()=>K.succeed(!1))),Y=yield*VN(Z).pipe(K.catch(()=>K.succeed(!1))),Q={providerID:$.lastUser.model.providerID,modelID:$.lastUser.model.modelID};if(!J&&!Y)return;let{AppRuntime:X}=yield*K.promise(()=>import("./chunk-
|
|
8165
|
+
`);function XN($){return K.gen(function*(){if(!$.enabled)return!1;let Z=$.intervalDays*tB,J=yield*K.sync(()=>w0.use((X)=>X.select({time_created:W$.time_created}).from(W$).where(D0(W$.title,$.title)).orderBy(x8(W$.time_created)).limit(1).get())),Y=Date.now(),Q=J?Y-J.time_created:1/0;if(!J){let X=yield*K.sync(()=>w0.use((V)=>V.select({time_created:W$.time_created}).from(W$).where(KJ(W$.parent_id)).orderBy(H8(W$.time_created)).limit(1).get()));if(!X||Y-X.time_created<Z)return aB.info(`auto-${$.label} skipped \u2014 project too young`,{projectAge:X?Math.round((Y-X.time_created)/tB)+"d":"empty",interval:$.intervalDays+"d"}),!1}if(Q<Z)return aB.info(`auto-${$.label} skipped \u2014 last run too recent`,{lastRunAgo:Math.round(Q/tB)+"d",interval:$.intervalDays+"d"}),!1;return aB.info(`auto-${$.label} triggering`,{lastRun:J?new Date(J.time_created).toISOString():"never",interval:$.intervalDays+"d"}),!0})}function KN($){let Z=$.dream?.auto!==!1;if(!Z)return K.succeed(!1);let J=Date.now();if(J-$N<JN)return K.succeed(!1);$N=J;let Y=$.dream?.interval_days??Cc;return XN({enabled:Z,intervalDays:Y,title:eB,label:"dream"})}function VN($){let Z=$.distill?.auto!==!1;if(!Z)return K.succeed(!1);let J=Date.now();if(J-ZN<JN)return K.succeed(!1);ZN=J;let Y=$.distill?.interval_days??Nc;return XN({enabled:Z,intervalDays:Y,title:$4,label:"distill"})}var WN=K.fnUntraced(function*($){let Z=yield*$.config.get(),J=yield*KN(Z).pipe(K.catch(()=>K.succeed(!1))),Y=yield*VN(Z).pipe(K.catch(()=>K.succeed(!1))),Q={providerID:$.lastUser.model.providerID,modelID:$.lastUser.model.modelID};if(!J&&!Y)return;let{AppRuntime:X}=yield*K.promise(()=>import("./chunk-2a154mr0.js"));if(J)X.runPromise(f$.use((V)=>K.gen(function*(){let W=yield*V.create({title:eB});yield*(yield*$.promptServiceTag).prompt({sessionID:W.id,agent:"dream",model:Q,parts:[{type:"text",text:YN}]})}))).catch((V)=>$.log.error("auto-dream prompt failed",{error:String(V)}));if(Y)X.runPromise(f$.use((V)=>K.gen(function*(){let W=yield*V.create({title:$4});yield*(yield*$.promptServiceTag).prompt({sessionID:W.id,agent:"distill",model:Q,parts:[{type:"text",text:QN}]})}))).catch((V)=>$.log.error("auto-distill prompt failed",{error:String(V)}))});var Lc=($)=>$.pipe(K.catchDefect((Z)=>Z instanceof V0.BackendAuthRejectedError?K.succeed(void 0):K.die(Z))),Z4=($)=>Lc(K.promise(()=>V0.resolvePrompt($))).pipe(K.map((Z)=>Z??"")),GN=K.gen(function*(){let $=yield*Z4("session/build-switch"),Z=yield*Z4("session/max-steps"),J=yield*Z4("session/compose");return{buildSwitch:$,maxSteps:Z,promptCompose:J}});var BN=T1.create({service:"session.prompt"}),yc=J0.create({service:"session.prompt"}),Ic=/\b(implement|build|create|make|scaffold|generate|fix|repair|add|change|update|refactor|remove)\b/i,Rc=/\b(explain|review|investigate|analy[sz]e|research|inspect|tell me how|how (?:do|would|should|can))\b/i,Sc=/(?:^|\b(?:and|then)\s+)(?:please\s+)?(?:implement|build|create|make|scaffold|generate|fix|repair|add|change|update|refactor|remove)\b/i,Tc=/\b(tell me how|how (?:do|would|should|can)|read[- ]only|(?:explain|review|investigate|analy[sz]e|research|inspect)\s+only|(?:do not|don't)\s+(?:edit|change|modify|write|implement|fix|repair|remove|delete)\s+(?:anything|any\s+(?:code|files?)|the\s+(?:code|files?)|code|files?)|without\s+(?:editing|changing|modifying|writing)\s+(?:anything|any\s+(?:code|files?)|the\s+(?:code|files?)|code|files?)|no\s+(?:code|file)\s+changes?)\b/i;function xc($,Z){if(!$||$.native!==!0||x9($)!=="interactive-build")return!1;let J=Z.filter((Y)=>Y.type==="text"&&!Y.synthetic).map((Y)=>Y.text).join(`
|
|
8166
8166
|
`);if(!J||Tc.test(J))return!1;if(!Ic.test(J))return!1;return!Rc.test(J)||Sc.test(J)}function HN($,Z,J,Y){return K.gen(function*(){let{bus:Q,status:X,sessions:V,agents:W,provider:G,processor:H,prune:B,checkpoint:j,compaction:O,config:U,plugin:F,permission:q,fsys:C,registry:_,scope:D,instruction:M,state:P,goal:y,taskGateState:I,taskRegistry:x,revert:h,summary:S,sys:f,llm:L,actorRegistry:T,inbox:E}=yield*_K,A=yield*GN,R=A.buildSwitch,b=A.maxSteps,a=A.promptCompose,l=(G0,Z0,n)=>yC(G,Q,G0,Z0,n),u=(G0,Z0)=>RC(V,G0,Z0),d=rB(V),i=1024,Q0=new class extends Set{add(G0){if(super.add(G0),this.size>1024){let Z0=this.values().next().value;if(Z0!==void 0)this.delete(Z0)}return this}},r=(G0)=>cB({getOps:$,...G0}),v=bC({agents:W,provider:G,llm:L,sessions:V,elog:BN}),$0=EC({sessions:V,fsys:C,buildSwitch:R,promptCompose:a});return{runLoop:K.fn("SessionPrompt.run")(function*(G0,Z0,n){let _0=yield*c.context,o=BN.with({sessionID:G0}),t,O0=0,C0=yield*V.get(G0),N0,r0,V$=new Map,l$=Z0??"main",b2=NC({sessionID:G0,agentID:l$,task_id:n,plugin:F,bus:Q,prune:B,scope:D}),{cancellation:P2,agentMetrics:n$,publishAgentRequest:s$,schedulePrune:$$}=b2,Y8=CC({sessionID:G0,agentID:l$,task_id:n,session:C0,cancellation:P2,plugin:F});return yield*K.gen(function*(){yield*b2.before;let U2=(Y2,g0)=>MK(YC(Y2,g0,K0.parts(g0.id))),Y1=!1,M2=sC({sessionID:G0,bus:Q,appendSyntheticUserTurn:d,slog:o}),w8=nC({sessionID:G0,sessions:V,bus:Q,appendSyntheticUserTurn:d,slog:o}),{autoContinueOutputLength:CY,autoRecoverOutputBudget:d1,autoContinueStreamCutoff:NY,autoContinueInvalidOutput:AY,autoRetryStructuredOutput:j$,handleTextRepeat:n0,writeContentFilterError:h$,writeModelError:F1}=w8,y1=SC({sessionID:G0,agentID:Z0,agents:W,taskGateState:I,taskRegistry:x,appendSyntheticUserTurn:d,slog:o}),U6=TC({sessionID:G0,agentID:Z0,session:C0,goal:y,bus:Q,appendSyntheticUserTurn:d,slog:o});while(!0){if(!Z0||Z0==="main")yield*X.set(G0,{type:"busy"});yield*E.drain(G0,Z0??"main").pipe(K.ignore),yield*o.info("loop",{step:O0});let Y2=yield*K0.filterCompactedEffect(G0,{contextFrom:C0.contextFrom,contextWatermark:C0.contextWatermark,agentID:Z0??"main"}),g0,v8,w2,hZ,C2,N2=[];for(let t0=Y2.length-1;t0>=0;t0--){let g$=Y2[t0];if(!g0&&g$.info.role==="user")g0=g$.info,v8=g$;if(!w2&&g$.info.role==="assistant")w2=g$.info,hZ=g$;if(!C2&&g$.info.role==="assistant"&&g$.info.finish)C2=g$.info;if(g0&&C2)break;if(!C2){let f8=g$.parts.filter((X8)=>X8.type==="subtask");N2.push(...f8)}}if(!g0)throw Error("No user message found in stream. This should never happen.");yield*aC({sessionID:G0,msgs:Y2,checkpoint:j,config:U});let e9=hZ?.parts.some((t0)=>t0.type==="tool"&&!t0.metadata?.providerExecuted)??!1;if(w2?.finish==="length"&&!e9&&g0.id<w2.id&&(yield*CY({lastUser:g0,assistant:w2})))continue;if(w2){if(yield*d1({lastUser:g0,assistant:w2}))continue;if(yield*NY({lastUser:g0,assistant:w2}))continue;let t0=fB({phase:"existing-assistant",lastUser:g0,assistant:w2,parts:hZ?.parts??[]});if(t0.type==="filtered"){yield*h$({assistant:w2}),yield*o.info("exiting loop",{classification:t0.type});break}if(t0.type==="failed"){yield*F1({assistant:w2,reason:t0.reason}),yield*o.info("exiting loop",{classification:t0.type,reason:t0.reason});break}if(t0.type==="think-only"||t0.type==="invalid"){let g$=t0.type==="invalid"?t0.reason:"think-only";if(yield*AY({lastUser:g0,assistant:w2,reason:g$}))continue;yield*o.info("exiting loop",{classification:t0.type});break}if(t0.type==="final"&&t0.degraded)yield*o.warn("degraded final on abnormal finish",{finish:w2.finish});if(t0.type!=="continue"){if(yield*y1(g0))continue;if(yield*U6(g0))continue;yield*o.info("exiting loop",{classification:t0.type});break}}if(O0++,O0===1)yield*v({session:C0,modelID:g0.model.modelID,providerID:g0.model.providerID,history:Y2}).pipe(K.ignore,K.forkIn(D));if(O0===1&&!C0.parentID)yield*WN({config:U,lastUser:g0,promptServiceTag:Y,log:yc});let I1=yield*l(g0.model.providerID,g0.model.modelID,G0);r0=I1,N0=C2;let LY=N2.pop();if(LY?.type==="subtask"){yield*r({task:LY,model:I1,lastUser:g0,sessionID:G0,session:C0,msgs:Y2});continue}let N8=v8;if(N8?.parts.some((t0)=>t0.type==="compaction")){let t0=N8.parts.find((X8)=>X8.type==="compaction"),g$=yield*V.messages({sessionID:G0,agentID:g0.agentID??"main"});if((yield*O.process({parentID:g0.id,messages:g$,sessionID:G0,auto:t0?.auto??!1,overflow:t0?.overflow,agentID:g0.agentID}))==="stop")break;continue}yield*tC({sessionID:G0,msgs:Y2,lastFinished:C2,model:I1,config:U});let P0=yield*W.get(g0.agent),a0=P0?.native===!0&&P0?.hidden===!0;if(eC({sessionID:G0,msgs:Y2,lastFinished:C2,allowDiscoveryRecovery:xc(P0,v8?.parts??[])}),!Y1&&!a0&&C2&&C2.tokens){let t0=yield*$();yield*B.fireCheckpoints({sessionID:G0,model:I1,tokens:C2.tokens,promptOps:t0,agentID:g0.agentID}).pipe(K.ignore)}if(!Y1&&C2&&C2.tokens){if(yield*MC({config:U,checkpoint:j,compaction:O,prune:B},{sessionID:G0,lastFinished:C2,lastUser:g0,model:I1,msgs:Y2,isBoundedComputation:a0})){Y1=!0;continue}}if(Y1=!1,!P0)throw yield*mB(W,Q,g0.agent,G0);let A8=P0.steps??1/0,s6=O0>=A8;Y2=yield*$0({messages:Y2,agent:P0,session:C0});let Q8=NK({sessionID:G0,parentID:g0.id,agentID:g0.agentID,agent:P0.name,variant:g0.model.variant,cwd:_0.directory,root:_0.worktree,modelID:I1.id,providerID:I1.providerID});yield*V.updateMessage(Q8);let C$=yield*H.create({assistantMessage:Q8,sessionID:G0,model:I1,agentMetrics:n$}),lK=yield*K.gen(function*(){let t0={value:t},g$=yield*QC({sessionID:G0,resolvedAgentID:l$,step:O0,task_id:n,lastUser:g0,lastFinished:C2,msgs:Y2,agent:P0,session:C0,model:I1,handle:C$,structured:t0,resolveTools:Z,createStructuredOutputTool:J,summary:S,scope:D,plugin:F}),{tools:f8,format:X8,query:pK}=g$,{cancelledByPlugin:oK,withUserQueryPost:iK}=XC({sessionID:G0,agentID:l$,step:O0,lastUser:g0,msgs:Y2,query:pK,handle:C$,plugin:F,sessions:V,cancellation:P2,trajectoryForStep:U2}),nK=K.fnUntraced(function*($7){if($7==="continue"&&(yield*CY({lastUser:g0,assistant:C$.message})))return"continue";if($7==="text-repeat"){if(yield*n0({lastUser:g0}))return"continue";return"break"}if(t0.value!==void 0)return t=t0.value,C$.message.structured=t0.value,C$.message.finish=C$.message.finish??"stop",yield*V.updateMessage(C$.message),"break";let Q2=fB({phase:"after-process",lastUser:g0,assistant:C$.message,parts:K0.parts(C$.message.id),processResult:$7});if(Q2.type==="filtered")return yield*h$({assistant:C$.message}),"break";if(Q2.type==="failed"){if(yield*d1({lastUser:g0,assistant:C$.message}))return"continue";if(yield*NY({lastUser:g0,assistant:C$.message}))return"continue";return yield*F1({assistant:C$.message,reason:Q2.reason}),"break"}if(Q2.type!=="continue"&&!C$.message.error&&X8.type==="json_schema"){if(yield*j$({lastUser:g0,assistant:C$.message}))return"continue";return"break"}if((Q2.type==="think-only"||Q2.type==="invalid")&&X8.type!=="json_schema"){let sK=Q2.type==="invalid"?Q2.reason:"think-only";if(yield*AY({lastUser:g0,assistant:C$.message,reason:sK}))return"continue";return"break"}if(Q2.type==="final"&&Q2.degraded)yield*o.warn("degraded final on abnormal finish",{finish:C$.message.finish});if($7==="stop")return"break";return}),r6=yield*_C({sessionID:G0,lastUser:g0,agent:P0,session:C0,model:I1,msgs:Y2,tools:f8,format:X8,handle:C$,isLastStep:s6,task_id:n,instructionsNotified:Q0,maxStepsText:b,actorRegistry:T,bus:Q,config:U,instruction:M,llm:L,provider:G,registry:_,status:X,sys:f,cancelledByPlugin:oK,withUserQueryPost:iK,slog:o,visionAnalysis:V$});if(r6.kind==="break"){if(r6.reason==="vision-unavailable")yield*F1({assistant:C$.message,reason:r6.message});return"break"}let IY=yield*nK(r6.result);if(IY)return IY;if(r6.result==="overflow")yield*wC({config:U,checkpoint:j,compaction:O,prune:B},{sessionID:G0,lastUser:g0,model:I1,msgs:Y2,isBoundedComputation:a0});return"continue"}).pipe(K.ensuring(M.clear(C$.message.id))),yY=yield*M2.check({lastUser:g0,completedParts:K0.parts(C$.message.id)});if(yY==="terminate")break;if(yY==="recovered")continue;if(lK==="break"){if(P0.name==="build"&&!C$.message.error){let t0=yield*V.messages({sessionID:G0,agentID:l$}),g$=K0.parts(C$.message.id).findLast((X8)=>X8.type==="text"),f8=yield*K.promise(()=>kC(t0,_0.worktree,g$?.text??""));if(f8.length){if(g$&&!g$.text.startsWith("PARTIAL \u2014 automatic verification incomplete"))yield*V.updatePart({...g$,text:`PARTIAL \u2014 automatic verification incomplete. ${f8.join("; ")}. Do not treat source-only checks as proof of a completed styled build.
|
|
8167
8167
|
|
|
8168
8168
|
${g$.text}`})}}if(yield*y1(g0))continue;if(yield*U6(g0))continue;break}continue}let C8=yield*$();if(r0&&N0)yield*$$({model:r0,lastFinished:N0,promptOps:C8});let h0=yield*u(G0,Z0),a9=h0.info.role==="assistant"&&!!h0.info.error,t9=yield*V.findMessage(G0,(Y2)=>Y2.info.role==="user",{agentID:"*"});return yield*s$(a9?"error":"completed",S$.isSome(t9)?t9.value.info.agent:h0.info.agent),h0}).pipe((U2)=>dB(G0,Q,U2),K.onExit(Y8),K.orDie)}),lastAssistant:u}})}import jN from"path";var kc=new TextEncoder,J4=new TextDecoder,bc=($)=>`
|
|
@@ -8196,7 +8196,7 @@ ${F}
|
|
|
8196
8196
|
`).length},sc=K.fnUntraced(function*($,Z,J){let Y=nc.join(Z,J);if(!(yield*$.exists(Y).pipe(K.orDie)))return"";let Q=yield*$.readFile(Y).pipe(K.catch(()=>K.succeed(new Uint8Array)));if(Buffer.from(Q).includes(0))return"";return Buffer.from(Q).toString("utf8")}),yN=($)=>new Map($.map((Z)=>[Z.file,{additions:Z.additions,deletions:Z.deletions}])),rc=(...$)=>{let Z=new Map;return $.flat().forEach((J)=>{if(!Z.has(J.file))Z.set(J.file,J)}),[...Z.values()]},X4=K.fnUntraced(function*($,Z,J,Y,Q,X){let V=Y?yield*Z.prefix(J):"",W=(H,B,j)=>sY(nY(H,H,B,j,"","",{context:Number.MAX_SAFE_INTEGER}));return(yield*K.forEach(Q,(H)=>K.gen(function*(){let B=H.status==="added"||!Y?"":yield*Z.show(J,Y,H.file,V),j=H.status==="deleted"?"":yield*sc($,J,H.file),O=X.get(H.file);return{file:H.file,patch:W(H.file,B,j),additions:O?.additions??(H.status==="added"?LN(j):0),deletions:O?.deletions??(H.status==="deleted"?LN(B):0),status:H.status}}),{concurrency:8})).toSorted((H,B)=>H.file.localeCompare(B.file))}),ac=K.fnUntraced(function*($,Z,J,Y){if(!Y)return yield*X4($,Z,J,Y,yield*Z.status(J),new Map);let[Q,X]=yield*K.all([Z.status(J),Z.stats(J,Y)],{concurrency:2});return yield*X4($,Z,J,Y,Q,yN(X))}),tc=K.fnUntraced(function*($,Z,J,Y){let[Q,X,V]=yield*K.all([Z.diff(J,Y),Z.stats(J,Y),Z.status(J)],{concurrency:3});return yield*X4($,Z,J,Y,rc(Q,V.filter((W)=>W.code==="??")),yN(X))}),ec=z.enum(["git","branch"]),IN={BranchUpdated:y0.define("vcs.branch.updated",z.object({branch:z.string().optional()}))},$l=z.object({branch:z.string().optional(),default_branch:z.string().optional()}).meta({ref:"VcsInfo"}),Zl=z.object({file:z.string(),patch:z.string(),additions:z.number(),deletions:z.number(),status:z.enum(["added","deleted","modified"]).optional()}).meta({ref:"VcsFileDiff"});class xZ extends X0.Service()("@qitqode/Vcs"){}var RN=k.effect(xZ,K.gen(function*(){let $=yield*W0.Service,Z=yield*q1.Service,J=yield*e.Service,Y=yield*N$.Scope,Q=yield*c.make(K.fn("Vcs.state")(function*(X){if(X.project.vcs!=="git")return{current:void 0,root:void 0};let V=K.fnUntraced(function*(){return yield*Z.branch(X.directory)}),[W,G]=yield*K.all([Z.branch(X.directory),Z.defaultBranch(X.directory)],{concurrency:2}),H={current:W,root:G};return AN.info("initialized",{branch:H.current,default_branch:H.root?.name}),yield*J.subscribe(X1.Event.Updated).pipe(f0.filter((B)=>B.properties.file.endsWith("HEAD")),f0.runForEach((B)=>K.gen(function*(){let j=yield*V();if(j!==H.current)AN.info("branch changed",{from:H.current,to:j}),H.current=j,yield*J.publish(IN.BranchUpdated,{branch:j})})),K.forkScoped),H}));return xZ.of({init:K.fn("Vcs.init")(function*(){yield*c.get(Q).pipe(K.forkIn(Y))}),branch:K.fn("Vcs.branch")(function*(){return yield*c.use(Q,(X)=>X.current)}),defaultBranch:K.fn("Vcs.defaultBranch")(function*(){return yield*c.use(Q,(X)=>X.root?.name)}),diff:K.fn("Vcs.diff")(function*(X){let V=yield*c.get(Q),W=yield*c.context;if(W.project.vcs!=="git")return[];if(X==="git")return yield*ac($,Z,W.directory,(yield*Z.hasHead(W.directory))?"HEAD":void 0);if(!V.root)return[];if(V.current&&V.current===V.root.name)return[];let G=yield*Z.mergeBase(W.directory,V.root.ref);if(!G)return[];return yield*tc($,Z,W.directory,G)})})})),Jl=RN.pipe(k.provide(q1.defaultLayer),k.provide(W0.defaultLayer),k.provide(e.layer));var l6={};R0(l6,{layer:()=>pN,defaultLayer:()=>Fl,Worktree:()=>l6,StartCommandFailedError:()=>jl,Service:()=>hK,ResetInput:()=>Hl,ResetFailedError:()=>m1,RemoveInput:()=>Bl,RemoveFailedError:()=>r9,NotGitError:()=>EK,NameGenerationFailedError:()=>cN,Info:()=>uN,Event:()=>bK,CreateInput:()=>Gl,CreateFailedError:()=>lN});var O6={};R0(O6,{layer:()=>xN,defaultLayer:()=>V4,Service:()=>bZ});var n9=J0.create({service:"share-next"}),kZ=process.env.QITQODE_DISABLE_SHARE==="true"||process.env.QITQODE_DISABLE_SHARE==="1",Yl=I0.Struct({id:I0.String,url:I0.String,secret:I0.String});class bZ extends X0.Service()("@qitqode/ShareNext"){}var K4=($)=>K.sync(()=>w0.use($));function TN($){return{create:`/api/${$}`,sync:(Z)=>`/api/${$}/${Z}/sync`,remove:(Z)=>`/api/${$}/${Z}`,data:(Z)=>`/api/${$}/${Z}/data`}}var Ql=TN("share"),Xl=TN("shares");function SN($){switch($.type){case"session":return"session";case"message":return`message/${$.data.id}`;case"part":return`part/${$.data.messageID}/${$.data.id}`;case"session_diff":return"session_diff";case"model":return"model"}}var xN=k.effect(bZ,K.gen(function*(){let $=yield*HY.Service,Z=yield*e.Service,J=yield*H0.Service,Y=yield*l1.HttpClient,Q=l1.filterStatusOk(Y),X=yield*o0.Service,V=yield*k0.Service;function W(D,M){return K.gen(function*(){if(kZ)return;if(!(yield*j(D)))return;let y=yield*c.get(G),I=y.queue.get(D);if(I){for(let h of M)I.set(SN(h),h);return}let x=new Map(M.map((h)=>[SN(h),h]));y.queue.set(D,x),yield*O(D).pipe(K.delay(1000),K.catchCause((h)=>K.sync(()=>{n9.error("share flush failed",{sessionID:D,cause:h})})),K.forkIn(y.scope))})}let G=yield*c.make(K.fn("ShareNext.state")(function*(D){let M={queue:new Map,scope:yield*N$.make(),shared:new Map};if(yield*K.addFinalizer(()=>N$.close(M.scope,O2.void).pipe(K.andThen(K.sync(()=>{M.queue.clear(),M.shared.clear()})))),kZ)return M;let P=(y,I)=>Z.subscribe(y).pipe(f0.runForEach((x)=>I(x).pipe(K.catchCause((h)=>K.sync(()=>{n9.error("share subscriber failed",{type:y.type,cause:h})})))),K.forkScoped);return yield*P(k0.Event.Updated,(y)=>K.gen(function*(){let I=yield*V.get(y.properties.sessionID);yield*W(I.id,[{type:"session",data:I}])})),yield*P(K0.Event.Updated,(y)=>K.gen(function*(){let I=y.properties.info;if(yield*W(I.sessionID,[{type:"message",data:I}]),I.role!=="user")return;let x=yield*X.getModel(I.model.providerID,I.model.modelID);yield*W(I.sessionID,[{type:"model",data:[x]}])})),yield*P(K0.Event.PartUpdated,(y)=>y.properties.part.type==="compaction"?K.void:W(y.properties.part.sessionID,[{type:"part",data:y.properties.part}])),yield*P(k0.Event.Diff,(y)=>W(y.properties.sessionID,[{type:"session_diff",data:y.properties.diff}])),yield*P(k0.Event.Deleted,(y)=>_(y.properties.sessionID)),M})),H=K.fn("ShareNext.request")(function*(){let D={},M=yield*$.active();if(S$.isNone(M)||!M.value.active_org_id){let y=(yield*J.get()).enterprise?.url??"https://opncd.ai";return{headers:D,api:Ql,baseUrl:y}}let P=yield*$.token(M.value.id);if(S$.isNone(P))throw Error("No active account token available for sharing");return D.authorization=`Bearer ${P.value}`,D["x-org-id"]=M.value.active_org_id,{headers:D,api:Xl,baseUrl:M.value.url}}),B=K.fnUntraced(function*(D){let M=yield*K4((P)=>P.select().from(s9).where(D0(s9.session_id,D)).get());if(!M)return;return{id:M.id,secret:M.secret,url:M.url}}),j=K.fnUntraced(function*(D){let M=yield*c.get(G);if(M.shared.has(D)){let y=M.shared.get(D);return y===null?void 0:y}let P=yield*B(D);return M.shared.set(D,P??null),P}),O=K.fn("ShareNext.flush")(function*(D){if(kZ)return;let M=yield*c.get(G),P=M.queue.get(D);if(!P)return;let y=yield*j(D);if(!y){M.queue.delete(D);return}let I=yield*H(),x=yield*A2.post(`${I.baseUrl}${I.api.sync(y.id)}`).pipe(A2.setHeaders(I.headers),A2.bodyJson({secret:y.secret,data:Array.from(P.values())}),K.flatMap((h)=>Y.execute(h)));if(x.status>=400){n9.warn("failed to sync share",{sessionID:D,shareID:y.id,status:x.status});return}M.queue.delete(D)}),U=K.fn("ShareNext.full")(function*(D){n9.info("full sync",{sessionID:D});let M=yield*V.get(D),P=yield*V.diff(D),y=yield*K.sync(()=>Array.from(K0.stream(D,{agentID:"*"}))),I=yield*K.forEach(Array.from(new Map(y.filter((x)=>x.info.role==="user").map((x)=>x.info.model).map((x)=>[`${x.providerID}/${x.modelID}`,x])).values()),(x)=>X.getModel(F8.make(x.providerID),h1.make(x.modelID)),{concurrency:8});yield*W(D,[{type:"session",data:M},...y.map((x)=>({type:"message",data:x.info})),...y.flatMap((x)=>x.parts.filter((h)=>h.type!=="compaction").map((h)=>({type:"part",data:h}))),{type:"session_diff",data:P},{type:"model",data:I}])}),F=K.fn("ShareNext.init")(function*(){if(kZ)return;yield*c.get(G)}),q=K.fn("ShareNext.url")(function*(){return(yield*H()).baseUrl}),C=K.fn("ShareNext.create")(function*(D){if(kZ)return{id:"",url:"",secret:""};n9.info("creating share",{sessionID:D});let M=yield*H(),P=yield*A2.post(`${M.baseUrl}${M.api.create}`).pipe(A2.setHeaders(M.headers),A2.bodyJson({sessionID:D}),K.flatMap((I)=>Q.execute(I)),K.flatMap(TX.schemaBodyJson(Yl)));yield*K4((I)=>I.insert(s9).values({session_id:D,id:P.id,secret:P.secret,url:P.url}).onConflictDoUpdate({target:s9.session_id,set:{id:P.id,secret:P.secret,url:P.url}}).run());let y=yield*c.get(G);return y.shared.set(D,P),yield*U(D).pipe(K.catchCause((I)=>K.sync(()=>{n9.error("share full sync failed",{sessionID:D,cause:I})})),K.forkIn(y.scope)),P}),_=K.fn("ShareNext.remove")(function*(D){if(kZ)return;n9.info("removing share",{sessionID:D});let M=yield*c.get(G),P=yield*j(D);if(!P){M.shared.delete(D),M.queue.delete(D);return}let y=yield*H();yield*A2.delete(`${y.baseUrl}${y.api.remove(P.id)}`).pipe(A2.setHeaders(y.headers),A2.bodyJson({secret:P.secret}),K.flatMap((I)=>Q.execute(I))),yield*K4((I)=>I.delete(s9).where(D0(s9.session_id,D)).run()),M.shared.delete(D),M.queue.delete(D)});return bZ.of({init:F,url:q,request:H,create:C,remove:_})})),V4=xN.pipe(k.provide(e.layer),k.provide(HY.defaultLayer),k.provide(H0.defaultLayer),k.provide(I8.layer),k.provide(o0.defaultLayer),k.provide(k0.defaultLayer));var RK={};R0(RK,{layer:()=>kN,defaultLayer:()=>Kl,Service:()=>IK});class IK extends X0.Service()("@qitqode/SessionShare"){}var kN=k.effect(IK,K.gen(function*(){let $=yield*H0.Service,Z=yield*k0.Service,J=yield*bZ,Y=yield*N$.Scope,Q=K.fn("SessionShare.share")(function*(W){if((yield*$.get()).share==="disabled")throw Error("Sharing is disabled in configuration");let H=yield*J.create(W);return yield*K.sync(()=>QZ.run(k0.Event.Updated,{sessionID:W,info:{share:{url:H.url}}})),H}),X=K.fn("SessionShare.unshare")(function*(W){yield*J.remove(W),yield*K.sync(()=>QZ.run(k0.Event.Updated,{sessionID:W,info:{share:{url:null}}}))}),V=K.fn("SessionShare.create")(function*(W){let G=yield*Z.create(W);if(G.parentID)return G;let H=yield*$.get();if(!(c0.QITQODE_AUTO_SHARE||H.share==="auto"))return G;return yield*Q(G.id).pipe(K.ignore,K.forkIn(Y)),G});return IK.of({create:V,share:Q,unshare:X})})),Kl=kN.pipe(k.provide(V4),k.provide(k0.defaultLayer),k.provide(H0.defaultLayer));var fN=hN(function*(){J0.Default.info("bootstrapping",{directory:q0.directory}),yield*H0.Service.use(($)=>$.get()),yield*s0.Service.use(($)=>$.init()),yield*bN([R$.Service,O6.Service,h2.Service,R1.Service,X1.Service,xZ,j1.Service,C7,N7].map(($)=>G4($.use((Z)=>Z.init())))).pipe(W4("InstanceBootstrap.init")),yield*R2.Service.use(($)=>$.reconcile()).pipe(gN(($)=>EN(()=>J0.Default.warn("memory reconcile failed",{error:String($)}))),G4),yield*e.Service.use(($)=>$.subscribeCallback($1.Event.Executed,async(Z)=>{if(Z.properties.name===$1.Default.INIT)vN(q0.project.id)})),yield*d$.subscribe()}).pipe(W4("InstanceBootstrap"));var Wl=k.mergeAll(H0.defaultLayer,s0.defaultLayer,O6.defaultLayer,h2.defaultLayer,R$.defaultLayer,R1.defaultLayer,X1.defaultLayer,i9.defaultLayer,j1.defaultLayer,e.defaultLayer,R2.defaultLayer,k8.defaultLayer).pipe(k.provide(TK)),mN=SK.make(Wl,{memoMap:xK});var jY=J0.create({service:"worktree"}),bK={Ready:y0.define("worktree.ready",z.object({name:z.string(),branch:z.string()})),Failed:y0.define("worktree.failed",z.object({message:z.string()}))},uN=z.object({name:z.string(),branch:z.string(),directory:z.string()}).meta({ref:"Worktree"}),Gl=z.object({name:z.string().optional(),startCommand:z.string().optional().describe("Additional startup script to run after the project's start command")}).meta({ref:"WorktreeCreateInput"}),Bl=z.object({directory:z.string()}).meta({ref:"WorktreeRemoveInput"}),Hl=z.object({directory:z.string()}).meta({ref:"WorktreeResetInput"}),EK=q$.create("WorktreeNotGitError",z.object({message:z.string()})),cN=q$.create("WorktreeNameGenerationFailedError",z.object({message:z.string()})),lN=q$.create("WorktreeCreateFailedError",z.object({message:z.string()})),jl=q$.create("WorktreeStartCommandFailedError",z.object({message:z.string()})),r9=q$.create("WorktreeRemoveFailedError",z.object({message:z.string()})),m1=q$.create("WorktreeResetFailedError",z.object({message:z.string()}));function Ol($){return $.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function Ul(...$){return $.filter(Boolean).flatMap((Z)=>Z.split(`
|
|
8197
8197
|
`).map((J)=>J.trim()).flatMap((J)=>{let Y=J.match(/^warning:\s+failed to remove\s+(.+):\s+/i);if(!Y)return[];let Q=Y[1]?.trim().replace(/^['"]|['"]$/g,"");if(!Q)return[];return[Q]}))}class hK extends X0.Service()("@qitqode/Worktree"){}var pN=k.effect(hK,K.gen(function*(){let $=yield*N$.Scope,Z=yield*W0.Service,J=yield*SX.Path,Y=yield*o8.ChildProcessSpawner,Q=yield*q1.Service,X=yield*j6.Service,V=K.fnUntraced(function*(E,A){return yield*dN(Y,E,A)},K.catch((E)=>K.succeed({code:1,text:"",stderr:E instanceof Error?E.message:String(E)}))),W=26,G=K.fn("Worktree.candidate")(function*(E,A){let R=yield*c.context;for(let b of Array.from({length:26},(a,l)=>l)){let a=A?b===0?A:`${A}-${H4.create()}`:H4.create(),l=`qitqode/${a}`,u=J.join(E,a);if(yield*Z.exists(u).pipe(K.orDie))continue;let d=`refs/heads/${l}`;if((yield*V(["show-ref","--verify","--quiet",d],{cwd:R.worktree})).code===0)continue;return uN.parse({name:a,branch:l,directory:u})}throw new cN({message:"Failed to generate a unique worktree name"})}),H=K.fn("Worktree.makeWorktreeInfo")(function*(E){let A=yield*c.context;if(A.project.vcs!=="git")throw new EK({message:"Worktrees are only supported for git projects"});let R=J.join(e0.Path.data,"worktree",A.project.id);yield*Z.makeDirectory(R,{recursive:!0}).pipe(K.orDie);let b=E?Ol(E):"";return yield*G(R,b||void 0)}),B=K.fnUntraced(function*(E){let A=yield*c.context,R=yield*V(["worktree","add","--no-checkout","-b",E.branch,E.directory],{cwd:A.worktree});if(R.code!==0)throw new lN({message:R.stderr||R.text||"Failed to create git worktree"});yield*X.addSandbox(A.project.id,E.directory).pipe(K.catch(()=>K.void))}),j=K.fnUntraced(function*(E,A){let R=yield*c.context,b=yield*c.workspaceID,a=R.project.id,l=A?.trim(),u=yield*V(["reset","--hard"],{cwd:E.directory});if(u.code!==0){let i=u.stderr||u.text||"Failed to populate worktree";jY.error("worktree checkout failed",{directory:E.directory,message:i}),kK.emit("event",{directory:E.directory,project:R.project.id,workspace:b,payload:{type:bK.Failed.type,properties:{message:i}}});return}if(!(yield*K.promise(()=>q0.provide({directory:E.directory,init:()=>mN.runPromise(fN),fn:()=>{return}}).then(()=>!0).catch((i)=>{let Q0=Q6(i);return jY.error("worktree bootstrap failed",{directory:E.directory,message:Q0}),kK.emit("event",{directory:E.directory,project:R.project.id,workspace:b,payload:{type:bK.Failed.type,properties:{message:Q0}}}),!1}))))return;kK.emit("event",{directory:E.directory,project:R.project.id,workspace:b,payload:{type:bK.Ready.type,properties:{name:E.name,branch:E.branch}}}),yield*x(E.directory,{projectID:a,extra:l})}),O=K.fn("Worktree.createFromInfo")(function*(E,A){yield*B(E),yield*j(E,A)}),U=K.fn("Worktree.create")(function*(E){let A=yield*H(E?.name);return yield*B(A),yield*j(A,E?.startCommand).pipe(K.catchCause((R)=>K.sync(()=>jY.error("worktree bootstrap failed",{cause:R}))),K.forkIn($)),A}),F=K.fnUntraced(function*(E){let A=J.resolve(E),R=yield*Z.realPath(A).pipe(K.catch(()=>K.succeed(A))),b=J.normalize(R);return process.platform==="win32"?b.toLowerCase():b});function q(E){return E.split(`
|
|
8198
8198
|
`).map((A)=>A.trim()).reduce((A,R)=>{if(!R)return A;if(R.startsWith("worktree "))return A.push({path:R.slice(9).trim()}),A;let b=A[A.length-1];if(!b)return A;if(R.startsWith("branch "))b.branch=R.slice(7).trim();return A},[])}let C=K.fnUntraced(function*(E,A){for(let R of E){if(!R.path)continue;if((yield*F(R.path))===A)return R}return});function _(E){return Z.exists(E).pipe(K.orDie,K.flatMap((A)=>A?V(["fsmonitor--daemon","stop"],{cwd:E}):K.void))}function D(E){return K.promise(()=>import("fs/promises").then((A)=>A.rm(E,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})).catch((A)=>{let R=Q6(A);throw new r9({message:R||"Failed to remove git worktree directory"})}))}let M=K.fn("Worktree.remove")(function*(E){let A=yield*c.context;if(A.project.vcs!=="git")throw new EK({message:"Worktrees are only supported for git projects"});let R=yield*F(E.directory),b=yield*V(["worktree","list","--porcelain"],{cwd:A.worktree});if(b.code!==0)throw new r9({message:b.stderr||b.text||"Failed to read git worktrees"});let a=q(b.text),l=yield*C(a,R);if(!l?.path){if(!(yield*Z.exists(R).pipe(K.orDie)))return!0;let Q0=yield*F(J.join(e0.Path.data,"worktree",A.project.id));if(R!==Q0&&!R.startsWith(`${Q0}${J.sep}`))throw new r9({message:"Directory is not a registered or managed worktree"});return yield*_(R),yield*D(R),!0}yield*_(l.path);let u=yield*V(["worktree","remove","--force",l.path],{cwd:A.worktree});if(u.code!==0){let i=yield*V(["worktree","list","--porcelain"],{cwd:A.worktree});if(i.code!==0)throw new r9({message:u.stderr||u.text||i.stderr||i.text||"Failed to remove git worktree"});if((yield*C(q(i.text),R))?.path)throw new r9({message:u.stderr||u.text||"Failed to remove git worktree"})}yield*D(l.path);let d=l.branch?.replace(/^refs\/heads\//,"");if(d){let i=yield*V(["branch","-D",d],{cwd:A.worktree});if(i.code!==0)throw new r9({message:i.stderr||i.text||"Failed to delete worktree branch"})}return!0}),P=K.fnUntraced(function*(E,A,R){let b=yield*V(E,A);if(b.code!==0)throw R(b);return b}),y=K.fnUntraced(function*(E,A){let[R,b]=process.platform==="win32"?["cmd",["/c",A]]:["bash",["-lc",A]],a=yield*Y.spawn(p2.make(R,b,{cwd:E,extendEnv:!0,stdin:"ignore"})),[,l]=yield*K.all([f0.runDrain(a.stdout),f0.mkString(f0.decodeText(a.stderr))],{concurrency:2}).pipe(K.orDie);return{code:yield*a.exitCode,stderr:l}},K.scoped,K.catch(()=>K.succeed({code:1,stderr:""}))),I=K.fnUntraced(function*(E,A,R){let b=A.trim();if(!b)return!0;let a=yield*y(E,b);if(a.code===0)return!0;return jY.error("worktree start command failed",{kind:R,directory:E,message:a.stderr}),!1}),x=K.fnUntraced(function*(E,A){let R=yield*K.sync(()=>w0.use((u)=>u.select().from(B4).where(D0(B4.id,A.projectID)).get())),a=(R?j6.fromRow(R):void 0)?.commands?.start?.trim()??"";if(!(yield*I(E,a,"project")))return!1;return yield*I(E,A.extra??"","worktree"),!0}),h=K.fnUntraced(function*(E,A){let R=yield*F(E);yield*K.forEach(A,(b)=>K.gen(function*(){let a=yield*F(J.resolve(E,b));if(a===R)return;if(!a.startsWith(`${R}${J.sep}`))return;yield*Z.remove(a,{recursive:!0}).pipe(K.ignore)}),{concurrency:8})}),S=K.fnUntraced(function*(E){let A=yield*V(["clean","-ffdx"],{cwd:E});if(A.code===0)return A;let R=Ul(A.stderr,A.text);if(!R.length)return A;return yield*h(E,R),yield*V(["clean","-ffdx"],{cwd:E})}),f=K.fn("Worktree.reset")(function*(E){let A=yield*c.context;if(A.project.vcs!=="git")throw new EK({message:"Worktrees are only supported for git projects"});let R=yield*F(E.directory),b=yield*F(A.worktree);if(R===b)throw new m1({message:"Cannot reset the primary workspace"});let a=yield*V(["worktree","list","--porcelain"],{cwd:A.worktree});if(a.code!==0)throw new m1({message:a.stderr||a.text||"Failed to read git worktrees"});let l=yield*C(q(a.text),R);if(!l?.path)throw new m1({message:"Worktree not found"});let u=l.path,d=yield*Q.defaultBranch(A.worktree);if(!d)throw new m1({message:"Default branch not found"});let i=d.ref.indexOf("/");if(d.ref!==d.name&&i>0){let v=d.ref.slice(0,i),$0=d.ref.slice(i+1);yield*P(["fetch",v,$0],{cwd:A.worktree},(Y0)=>new m1({message:Y0.stderr||Y0.text||`Failed to fetch ${d.ref}`}))}yield*P(["reset","--hard",d.ref],{cwd:u},(v)=>new m1({message:v.stderr||v.text||"Failed to reset worktree to target"}));let Q0=yield*S(u);if(Q0.code!==0)throw new m1({message:Q0.stderr||Q0.text||"Failed to clean worktree"});yield*P(["submodule","update","--init","--recursive","--force"],{cwd:u},(v)=>new m1({message:v.stderr||v.text||"Failed to update submodules"})),yield*P(["submodule","foreach","--recursive","git","reset","--hard"],{cwd:u},(v)=>new m1({message:v.stderr||v.text||"Failed to reset submodules"})),yield*P(["submodule","foreach","--recursive","git","clean","-fdx"],{cwd:u},(v)=>new m1({message:v.stderr||v.text||"Failed to clean submodules"}));let r=yield*V(["-c","core.fsmonitor=false","status","--porcelain=v1"],{cwd:u});if(r.code!==0)throw new m1({message:r.stderr||r.text||"Failed to read git status"});if(r.text.trim())throw new m1({message:`Worktree reset left local changes:
|
|
8199
|
-
${r.text.trim()}`});return yield*x(u,{projectID:A.project.id}).pipe(K.catchCause((v)=>K.sync(()=>jY.error("worktree start task failed",{cause:v}))),K.forkIn($)),!0}),L=K.fn("Worktree.head")(function*(E){return(yield*V(["rev-parse","HEAD"],{cwd:E})).text.trim()}),T=K.fn("Worktree.isPristine")(function*(E,A){let R=yield*V(["status","--porcelain"],{cwd:E});if(R.code!==0)return!1;if(R.text.trim()!=="")return!1;let b=yield*V(["rev-parse","HEAD"],{cwd:E});return b.code===0&&b.text.trim()===A});return hK.of({makeWorktreeInfo:H,createFromInfo:O,create:U,remove:M,reset:f,head:L,isPristine:T})})),Fl=pN.pipe(k.provide(q1.defaultLayer),k.provide(p1),k.provide(j6.defaultLayer),k.provide(W0.defaultLayer),k.provide(j7.layer));var qY={};R0(qY,{layer:()=>sN,defaultLayer:()=>wl,UpdateInput:()=>Ml,Service:()=>gK,Pty:()=>qY,Info:()=>O4,Event:()=>FY,CreateInput:()=>Pl});function oN($){let Z,J=!1;return()=>{if(J)return Z;return J=!0,Z=$(),Z}}var ql=I0.String.annotate({[H7]:L2.schema("pty")}).pipe(I0.brand("PtyID")),OY=ql.pipe(B7(($)=>({ascending:(Z)=>$.make(L2.ascending("pty",Z)),zod:L2.schema("pty").pipe(z.custom())})));var UY=J0.create({service:"pty"}),iN=2097152,nN=65536,zl=new TextEncoder,j4=($)=>$.data&&typeof $.data==="object"?$.data:$,_l=($)=>{let Z=JSON.stringify({cursor:$}),J=zl.encode(Z),Y=new Uint8Array(J.length+1);return Y[0]=0,Y.set(J,1),Y},Dl=oN(()=>import("./chunk-
|
|
8199
|
+
${r.text.trim()}`});return yield*x(u,{projectID:A.project.id}).pipe(K.catchCause((v)=>K.sync(()=>jY.error("worktree start task failed",{cause:v}))),K.forkIn($)),!0}),L=K.fn("Worktree.head")(function*(E){return(yield*V(["rev-parse","HEAD"],{cwd:E})).text.trim()}),T=K.fn("Worktree.isPristine")(function*(E,A){let R=yield*V(["status","--porcelain"],{cwd:E});if(R.code!==0)return!1;if(R.text.trim()!=="")return!1;let b=yield*V(["rev-parse","HEAD"],{cwd:E});return b.code===0&&b.text.trim()===A});return hK.of({makeWorktreeInfo:H,createFromInfo:O,create:U,remove:M,reset:f,head:L,isPristine:T})})),Fl=pN.pipe(k.provide(q1.defaultLayer),k.provide(p1),k.provide(j6.defaultLayer),k.provide(W0.defaultLayer),k.provide(j7.layer));var qY={};R0(qY,{layer:()=>sN,defaultLayer:()=>wl,UpdateInput:()=>Ml,Service:()=>gK,Pty:()=>qY,Info:()=>O4,Event:()=>FY,CreateInput:()=>Pl});function oN($){let Z,J=!1;return()=>{if(J)return Z;return J=!0,Z=$(),Z}}var ql=I0.String.annotate({[H7]:L2.schema("pty")}).pipe(I0.brand("PtyID")),OY=ql.pipe(B7(($)=>({ascending:(Z)=>$.make(L2.ascending("pty",Z)),zod:L2.schema("pty").pipe(z.custom())})));var UY=J0.create({service:"pty"}),iN=2097152,nN=65536,zl=new TextEncoder,j4=($)=>$.data&&typeof $.data==="object"?$.data:$,_l=($)=>{let Z=JSON.stringify({cursor:$}),J=zl.encode(Z),Y=new Uint8Array(J.length+1);return Y[0]=0,Y.set(J,1),Y},Dl=oN(()=>import("./chunk-pzn7cade.js")),O4=z.object({id:OY.zod,title:z.string(),command:z.string(),args:z.array(z.string()),cwd:z.string(),status:z.enum(["running","exited"]),pid:z.number()}).meta({ref:"Pty"}),Pl=z.object({command:z.string().optional(),args:z.array(z.string()).optional(),cwd:z.string().optional(),title:z.string().optional(),env:z.record(z.string(),z.string()).optional()}),Ml=z.object({title:z.string().optional(),size:z.object({rows:z.number(),cols:z.number()}).optional()}),FY={Created:y0.define("pty.created",z.object({info:O4})),Updated:y0.define("pty.updated",z.object({info:O4})),Exited:y0.define("pty.exited",z.object({id:OY.zod,exitCode:z.number()})),Deleted:y0.define("pty.deleted",z.object({id:OY.zod}))};class gK extends X0.Service()("@qitqode/Pty"){}var sN=k.effect(gK,K.gen(function*(){let $=yield*e.Service,Z=yield*s0.Service;function J(O){try{O.process.kill()}catch{}for(let[U,F]of O.subscribers.entries())try{if(j4(F)===U)F.close()}catch{}O.subscribers.clear()}let Y=yield*c.make(K.fn("Pty.state")(function*(O){let U={dir:O.directory,sessions:new Map};return yield*K.addFinalizer(()=>K.sync(()=>{for(let F of U.sessions.values())J(F);U.sessions.clear()})),U})),Q=K.fn("Pty.remove")(function*(O){let U=yield*c.get(Y),F=U.sessions.get(O);if(!F)return;U.sessions.delete(O),UY.info("removing session",{id:O}),J(F),yield*$.publish(FY.Deleted,{id:F.info.id})}),X=K.fn("Pty.list")(function*(){let O=yield*c.get(Y);return Array.from(O.sessions.values()).map((U)=>U.info)}),V=K.fn("Pty.get")(function*(O){return(yield*c.get(Y)).sessions.get(O)?.info}),W=K.fn("Pty.create")(function*(O){let U=yield*c.get(Y),F=yield*T$.make(),q=OY.ascending(),C=O.command||z1.preferred(),_=O.args||[];if(z1.login(C))_.push("-l");let D=O.cwd||U.dir,M=yield*Z.trigger("shell.env",{cwd:D},{env:{}}),P={...q7(),...O.env,...M.env,TERM:"xterm-256color",QITQODE_TERMINAL:"1"};if(process.platform==="win32")P.LC_ALL="C.UTF-8",P.LC_CTYPE="C.UTF-8",P.LANG="C.UTF-8";UY.info("creating session",{id:q,cmd:C,args:_,cwd:D});let{spawn:y}=yield*K.promise(()=>Dl()),I=yield*K.sync(()=>y(C,_,{name:"xterm-256color",cwd:D,env:P})),x={id:q,title:O.title||`Terminal ${q.slice(-4)}`,command:C,args:_,cwd:D,status:"running",pid:I.pid},h={info:x,process:I,buffer:"",bufferCursor:0,cursor:0,subscribers:new Map};return U.sessions.set(q,h),I.onData(q0.bind((S)=>{h.cursor+=S.length;for(let[L,T]of h.subscribers.entries()){if(T.readyState!==1){h.subscribers.delete(L);continue}if(j4(T)!==L){h.subscribers.delete(L);continue}try{T.send(S)}catch{h.subscribers.delete(L)}}if(h.buffer+=S,h.buffer.length<=iN)return;let f=h.buffer.length-iN;h.buffer=h.buffer.slice(f),h.bufferCursor+=f})),I.onExit(q0.bind(({exitCode:S})=>{if(h.info.status==="exited")return;UY.info("session exited",{id:q,exitCode:S}),h.info.status="exited",F.fork($.publish(FY.Exited,{id:q,exitCode:S})),F.fork(Q(q))})),yield*$.publish(FY.Created,{info:x}),x}),G=K.fn("Pty.update")(function*(O,U){let q=(yield*c.get(Y)).sessions.get(O);if(!q)return;if(U.title)q.info.title=U.title;if(U.size)q.process.resize(U.size.cols,U.size.rows);return yield*$.publish(FY.Updated,{info:q.info}),q.info}),H=K.fn("Pty.resize")(function*(O,U,F){let C=(yield*c.get(Y)).sessions.get(O);if(C&&C.info.status==="running")C.process.resize(U,F)}),B=K.fn("Pty.write")(function*(O,U){let q=(yield*c.get(Y)).sessions.get(O);if(q&&q.info.status==="running")q.process.write(U)}),j=K.fn("Pty.connect")(function*(O,U,F){let C=(yield*c.get(Y)).sessions.get(O);if(!C){U.close();return}UY.info("client connected to session",{id:O});let _=j4(U);C.subscribers.delete(_),C.subscribers.set(_,U);let D=()=>{C.subscribers.delete(_)},M=C.bufferCursor,P=C.cursor,y=F===-1?P:typeof F==="number"&&Number.isSafeInteger(F)?Math.max(0,F):0,I=(()=>{if(!C.buffer)return"";if(y>=P)return"";let x=Math.max(0,y-M);if(x>=C.buffer.length)return"";return C.buffer.slice(x)})();if(I)try{for(let x=0;x<I.length;x+=nN)U.send(I.slice(x,x+nN))}catch{D(),U.close();return}try{U.send(_l(P))}catch{D(),U.close();return}return{onMessage:(x)=>{C.process.write(typeof x==="string"?x:new TextDecoder().decode(x))},onClose:()=>{UY.info("client disconnected from session",{id:O}),D()}}});return gK.of({list:X,get:V,create:W,update:G,remove:Q,resize:H,write:B,connect:j})})),wl=sN.pipe(k.provide(e.layer),k.provide(s0.defaultLayer));var _Y={};R0(_Y,{layer:()=>tN,defaultLayer:()=>Ll,Service:()=>mK,MAX_PRE_REACT:()=>rN,MAX_POST_REACT:()=>aN,Actor:()=>_Y});var vK=($,Z,J)=>K.uninterruptible(K.gen(function*(){let Y=yield*G$.Service;yield*Y.updateStatus($,Z,{status:"running"}).pipe(K.ignore);let Q=yield*J.pipe(K.interruptible,K.exit);if(O2.isSuccess(Q))return yield*Y.updateStatus($,Z,{status:"idle",lastOutcome:"success",lastError:void 0}).pipe(K.ignore),Q.value;let X=Q.cause,V=x0.hasInterruptsOnly(X);return yield*Y.updateStatus($,Z,{status:"idle",lastOutcome:V?"cancelled":"failure",lastError:V?void 0:Cl(X)}).pipe(K.ignore),yield*K.failCause(X)}));function Cl($){return x0.pretty($)}var fK=J0.create({service:"actor.spawn"}),rN=3,aN=3,Al=`
|
|
8200
8200
|
|
|
8201
8201
|
---
|
|
8202
8202
|
|
|
@@ -8226,7 +8226,7 @@ This format lets the spawning agent and the checkpoint writer extract your progr
|
|
|
8226
8226
|
`).join(""))});return p6.set($,Y),Y.finally(()=>{if(p6.get($)===Y)p6.delete($)})}var El=/^wf_[0-9A-Za-z]+$/,GA=($)=>{if(!El.test($))throw Error(`invalid workflow runID: ${JSON.stringify($)}`);return $},BA=($)=>_4.join(DY(),`${GA($)}.js`),D4=($)=>_4.join(DY(),`${GA($)}.jsonl`);function HA($){return{runID:$.id,sessionID:$.session_id,name:$.name,status:$.status,running:$.running,succeeded:$.succeeded,failed:$.failed,...$.current_phase?{currentPhase:$.current_phase}:{},...$.parent_actor_id?{parentActorID:$.parent_actor_id}:{},...$.args!==null&&$.args!==void 0?{args:$.args}:{},...$.script_sha?{scriptSha:$.script_sha}:{},...$.agent_timeout_ms!==null&&$.agent_timeout_ms!==void 0?{agentTimeoutMs:$.agent_timeout_ms}:{},...$.error?{error:$.error}:{},createdAt:$.time_created,updatedAt:$.time_updated}}var hl=($)=>K.sync(()=>w0.use((Z)=>Z.insert(J1).values({id:$.runID,session_id:$.sessionID,name:$.name,status:"running",running:0,succeeded:0,failed:0,parent_actor_id:$.parentActorID??null,args:$.args??null,script_sha:$.scriptSha??null,agent_timeout_ms:$.agentTimeoutMs??null}).onConflictDoUpdate({target:J1.id,set:{status:"running",running:0,succeeded:0,failed:0,script_sha:$.scriptSha??null,...$.agentTimeoutMs!==void 0?{agent_timeout_ms:$.agentTimeoutMs}:{}}}).run())),gl=($)=>K.sync(()=>w0.use((Z)=>Z.update(J1).set({current_phase:$.phase}).where(D0(J1.id,$.runID)).run())),vl=($)=>K.sync(()=>w0.use((Z)=>Z.update(J1).set({running:$.running,succeeded:$.succeeded,failed:$.failed}).where(D0(J1.id,$.runID)).run())),fl=($)=>K.sync(()=>w0.use((Z)=>Z.update(J1).set({status:$.status,...$.error?{error:$.error}:{}}).where(D0(J1.id,$.runID)).run())),ml=($)=>K.sync(()=>w0.use((Z)=>{return(($?.sessionID)?Z.select().from(J1).where(D0(J1.session_id,$.sessionID)).orderBy(x8(J1.time_created)).all():Z.select().from(J1).orderBy(x8(J1.time_created)).all()).map(HA)})),dl=($)=>K.sync(()=>w0.use((Z)=>{let J=Z.select().from(J1).where(D0(J1.id,$)).get();return J?HA(J):void 0})),ul=($,Z)=>K.promise(async()=>{await(await import("fs/promises")).mkdir(DY(),{recursive:!0}),await Bun.write(BA($),Z)}),cl=($)=>K.promise(()=>Bun.file(BA($)).text()),ll=($,Z)=>K.promise(()=>WA($,[Z])),pl=($,Z)=>K.promise(()=>WA($,Z)),ol=($)=>K.promise(async()=>{let Z=Bun.file(D4($));if(!await Z.exists())return{results:new Map,pass:1};let J=await Z.text(),Y=new Map,Q=0;for(let X of J.split(`
|
|
8227
8227
|
`)){if(!X)continue;let V;try{V=JSON.parse(X)}catch{continue}if(typeof V.pass==="number"&&V.pass>Q)Q=V.pass;if(V.t==="agent")Y.set(V.key,V.result)}return{results:Y,pass:Q+1}}),il=($)=>K.promise(async()=>{let J=(p6.get($)??Promise.resolve()).catch(()=>{}).then(async()=>{await(await import("fs/promises")).mkdir(DY(),{recursive:!0}),await Bun.write(D4($),"")});p6.set($,J);try{await J}finally{if(p6.get($)===J)p6.delete($)}}),J2={recordStart:hl,recordPhase:gl,flushCounters:vl,recordTerminal:fl,list:ml,load:dl,writeScript:ul,readScript:cl,appendJournal:ll,appendJournalSync:pl,loadJournal:ol,clearJournal:il};class P4{#$=new Map;get($){return this.#$.get($)}set($){return this.#$.set($.runID,$),$}values(){return this.#$.values()}clear(){this.#$.clear()}}function jA($){let Z=(X)=>K.gen(function*(){if(X.status!=="running")return;if(yield*J(X),yield*$.flushNow(X),yield*J2.recordTerminal({runID:X.runID,status:"cancelled"}).pipe(K.ignore),X.fiber)yield*y8.interrupt(X.fiber);X.status="cancelled",yield*$.bus.publish(dK,{sessionID:X.sessionID,runID:X.runID,status:"cancelled"}),yield*p0.succeed(X.deferred,{status:"cancelled"})}).pipe(K.provideService(L1,X.instance)),J=(X)=>K.gen(function*(){let V=G1.current;if(V)yield*K.forEach([...X.childActorIDs],(W)=>V.cancel(X.sessionID,W,"graceful").pipe(K.ignore),{concurrency:"unbounded",discard:!0});yield*K.forEach([...X.worktrees],(W)=>$.worktree.remove({directory:W}).pipe(K.ignore),{concurrency:"unbounded",discard:!0}),X.worktrees.clear(),yield*K.forEach([...X.childRunIDs],(W)=>K.gen(function*(){let G=$.runs.get(W);if(G&&G.status==="running")yield*Z(G)}).pipe(K.ignore),{concurrency:"unbounded",discard:!0})}).pipe(K.provideService(L1,X.instance));return{reclaim:J,cancelEntry:Z,complete:(X)=>K.gen(function*(){if(X.entry.status="completed",yield*$.flushNow(X.entry),yield*J2.recordTerminal({runID:X.entry.runID,status:"completed"}).pipe(K.ignore),yield*$.bus.publish(dK,{sessionID:X.sessionID,runID:X.entry.runID,status:"completed"}),X.notifyOnTerminal!==!1)yield*$.inbox.send({receiverSessionID:X.sessionID,receiverActorID:X.parentActorID,senderSessionID:X.sessionID,senderActorID:"workflow",type:"actor_notification",content:`Workflow completed. run_id: ${X.entry.runID}
|
|
8228
8228
|
`+JSON.stringify(X.result??null).slice(0,4000)}).pipe(K.ignore);yield*p0.succeed(X.entry.deferred,{status:"completed",result:X.result})}).pipe(K.provideService(L1,X.entry.instance)),fail:(X)=>K.gen(function*(){if(yield*J(X.entry),X.entry.status="failed",yield*$.flushNow(X.entry),yield*J2.recordTerminal({runID:X.entry.runID,status:"failed",error:X.error}).pipe(K.ignore),yield*$.bus.publish(dK,{sessionID:X.sessionID,runID:X.entry.runID,status:"failed",error:X.error}),X.notifyOnTerminal!==!1)yield*$.inbox.send({receiverSessionID:X.sessionID,receiverActorID:X.parentActorID,senderSessionID:X.sessionID,senderActorID:"workflow",type:"actor_notification",content:`Workflow failed. run_id: ${X.entry.runID}
|
|
8229
|
-
error: ${X.error}`}).pipe(K.ignore);yield*p0.succeed(X.entry.deferred,{status:"failed",error:X.error})}).pipe(K.provideService(L1,X.entry.instance))}}import nl from"os";function M4($){let Z=0,J=[],Y=()=>{Z--;let Q=J.shift();if(Q)Q()};return{run(Q){return new Promise((X,V)=>{let W=()=>{Z++,Q().then((G)=>{Y(),X(G)},(G)=>{Y(),V(G)})};if(Z<$)W();else J.push(W)})}}}function OA(){let $=nl.cpus().length;return Math.min(16,2*Math.max(1,$>0?$:4))}function UA($,Z){return K.gen(function*(){if(Z)yield*J2.clearJournal($).pipe(K.ignore);let J=yield*J2.loadJournal($);return{results:J.results,pass:J.pass,occurrences:new Map}})}function FA($,Z){let J=$.occurrences.get(Z)??0;return $.occurrences.set(Z,J+1),Z+":"+J}function qA($,Z,J,Y){return J2.appendJournalSync($,[{t:"agent",key:J,result:Y,pass:Z.pass}]).pipe(K.ignore)}var zA=Symbol("straggler-timeout");function DA($){let Z=(G,H,B,j)=>{let O=H.timeoutMs??$.runAgentTimeoutMs;if(!O||O<=0)return B;return K.raceFirst(B,K.sleep(`${O} millis`).pipe(K.as(zA))).pipe(K.flatMap((U)=>U===zA?K.gen(function*(){let F=$.getActor();if(F)yield*F.cancel($.sessionID,G,"graceful").pipe(K.ignore);return yield*K.sync(()=>{try{j?.()}catch{}}),null}):K.succeed(U)))},J=(G,H,B={})=>{try{$.bridge.fork($.bus.publish(QA,{sessionID:$.sessionID,runID:$.runID,actorID:B.actorID,agentType:G.agentType??"general",label:G.label,phase:G.phase??$.entry.currentPhase,reason:H,errorMessage:B.errorMessage}).pipe(K.ignore))}catch{}},Y=(G)=>G.label?G.phase?`[${G.phase}] ${G.label}`:G.label:G.phase?`[${G.phase}]`:void 0,Q=(G,H,B)=>({mode:"subagent",sessionID:$.sessionID,agentType:G.agentType??"general",description:Y(G),task:H,context:"none",tools:G.tools?[...G.tools]:"INHERIT",background:!0,parentActorID:$.parentActorID,model:B,onActorID:(j)=>$.entry.childActorIDs.add(j),...G.schema?{format:{type:"json_schema",schema:G.schema,retryCount:2}}:{}}),X=async(G,H,B,j)=>{$.entry.running++,$.scheduleFlush($.entry);let O="actor-error",U,F,q=await $.bridge.promise(K.gen(function*(){let C=yield*G.spawn(Q(B,H,j));U=C.actorID;let _=yield*Z(C.actorID,B,p0.await(C.outcome).pipe(K.map((D)=>{if(D.status!=="success")return O="actor-error",F=D.error,null;let M=B.schema?D.structured??null:D.structured??D.finalText??null;if(M===null)O="no-deliverable";return M})),()=>{O="timeout"});return $.entry.childActorIDs.delete(C.actorID),_})).catch((C)=>{return O="spawn-reject",F=C instanceof Error?C.message:String(C),null});if($.entry.running--,q!==null)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});return $.scheduleFlush($.entry),q},V=async(G,H,B,j)=>{let O="actor-error",U,F,q=await $.bridge.promise(K.gen(function*(){let S=yield*$.worktree.makeWorktreeInfo();return yield*$.worktree.createFromInfo(S),S})).catch((S)=>{return F=S instanceof Error?S.message:String(S),null});if(!q)return J(B,"spawn-reject",{errorMessage:F}),null;$.entry.worktrees.add(q.directory);let C=await $.bridge.promise($.worktree.head(q.directory)).catch(()=>""),_=await q0.provide({directory:q.directory,fn:()=>Promise.resolve(q0.current)}),D=await $.bridge.promise(_A().pipe(K.provideService(L1,_)));$.entry.running++,$.scheduleFlush($.entry);let M=await q0.provide({directory:q.directory,fn:()=>D.promise(K.gen(function*(){let S=yield*G.spawn(Q(B,H,j));U=S.actorID;let f=yield*Z(S.actorID,B,p0.await(S.outcome),()=>{O="timeout"});if($.entry.childActorIDs.delete(S.actorID),f===null)return null;if(f.status!=="success")O="actor-error",F=f.error;return{actorID:S.actorID,outcome:f}})).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null})}).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null}),P=!!M&&M.outcome.status==="success";if($.entry.running--,P)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});$.scheduleFlush($.entry);let y=M&&M.outcome.status==="success"?B.schema?M.outcome.structured??null:M.outcome.structured??M.outcome.finalText??null:null,I=C!==""&&await $.bridge.promise($.worktree.isPristine(q.directory,C)).catch(()=>!1);if(!(P&&!I))return await $.bridge.promise($.worktree.remove({directory:q.directory})).catch(()=>{return}),$.entry.worktrees.delete(q.directory),P?y:null;let h={branch:q.branch,directory:q.directory,changed:!0};if(y&&typeof y==="object"&&!Array.isArray(y))return{...y,_worktree:h};return{_worktree:h,result:y}},W=async(G,H,B)=>{if($.entry.agentCount>=$.lifecycleCap)return $.warnCapOnce(),J(G,"over-cap"),null;$.entry.agentCount++;let j=$.getActor();if(!j)throw Error("Actor service unavailable");let O=await $.bridge.promise($.resolveAgentModel(G.model,$.defaultModel,$.entry.warnedModelRefs));return B(j,H,G,O)};return(G,H)=>{let B=H??{},j=String(G);if(B.isolation!=="worktree"){let O=VA(j,{agentType:B.agentType,model:B.model,schema:B.schema,phase:B.phase}),U=FA($.journal,O);if($.journal.results.has(U))return $.entry.succeeded++,$.scheduleFlush($.entry),Promise.resolve($.journal.results.get(U));return(async()=>{let F=await $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,X)));if(F!==null)await K.runPromise(qA($.runID,$.journal,U,F));return F})()}return $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,V)))}}async function PA($){let Z=w4(await $),[J,Y,{QuickJSWASMModule:Q}]=await Promise.all([Z.importModuleLoader().then(w4),Z.importFFI(),import("./chunk-
|
|
8229
|
+
error: ${X.error}`}).pipe(K.ignore);yield*p0.succeed(X.entry.deferred,{status:"failed",error:X.error})}).pipe(K.provideService(L1,X.entry.instance))}}import nl from"os";function M4($){let Z=0,J=[],Y=()=>{Z--;let Q=J.shift();if(Q)Q()};return{run(Q){return new Promise((X,V)=>{let W=()=>{Z++,Q().then((G)=>{Y(),X(G)},(G)=>{Y(),V(G)})};if(Z<$)W();else J.push(W)})}}}function OA(){let $=nl.cpus().length;return Math.min(16,2*Math.max(1,$>0?$:4))}function UA($,Z){return K.gen(function*(){if(Z)yield*J2.clearJournal($).pipe(K.ignore);let J=yield*J2.loadJournal($);return{results:J.results,pass:J.pass,occurrences:new Map}})}function FA($,Z){let J=$.occurrences.get(Z)??0;return $.occurrences.set(Z,J+1),Z+":"+J}function qA($,Z,J,Y){return J2.appendJournalSync($,[{t:"agent",key:J,result:Y,pass:Z.pass}]).pipe(K.ignore)}var zA=Symbol("straggler-timeout");function DA($){let Z=(G,H,B,j)=>{let O=H.timeoutMs??$.runAgentTimeoutMs;if(!O||O<=0)return B;return K.raceFirst(B,K.sleep(`${O} millis`).pipe(K.as(zA))).pipe(K.flatMap((U)=>U===zA?K.gen(function*(){let F=$.getActor();if(F)yield*F.cancel($.sessionID,G,"graceful").pipe(K.ignore);return yield*K.sync(()=>{try{j?.()}catch{}}),null}):K.succeed(U)))},J=(G,H,B={})=>{try{$.bridge.fork($.bus.publish(QA,{sessionID:$.sessionID,runID:$.runID,actorID:B.actorID,agentType:G.agentType??"general",label:G.label,phase:G.phase??$.entry.currentPhase,reason:H,errorMessage:B.errorMessage}).pipe(K.ignore))}catch{}},Y=(G)=>G.label?G.phase?`[${G.phase}] ${G.label}`:G.label:G.phase?`[${G.phase}]`:void 0,Q=(G,H,B)=>({mode:"subagent",sessionID:$.sessionID,agentType:G.agentType??"general",description:Y(G),task:H,context:"none",tools:G.tools?[...G.tools]:"INHERIT",background:!0,parentActorID:$.parentActorID,model:B,onActorID:(j)=>$.entry.childActorIDs.add(j),...G.schema?{format:{type:"json_schema",schema:G.schema,retryCount:2}}:{}}),X=async(G,H,B,j)=>{$.entry.running++,$.scheduleFlush($.entry);let O="actor-error",U,F,q=await $.bridge.promise(K.gen(function*(){let C=yield*G.spawn(Q(B,H,j));U=C.actorID;let _=yield*Z(C.actorID,B,p0.await(C.outcome).pipe(K.map((D)=>{if(D.status!=="success")return O="actor-error",F=D.error,null;let M=B.schema?D.structured??null:D.structured??D.finalText??null;if(M===null)O="no-deliverable";return M})),()=>{O="timeout"});return $.entry.childActorIDs.delete(C.actorID),_})).catch((C)=>{return O="spawn-reject",F=C instanceof Error?C.message:String(C),null});if($.entry.running--,q!==null)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});return $.scheduleFlush($.entry),q},V=async(G,H,B,j)=>{let O="actor-error",U,F,q=await $.bridge.promise(K.gen(function*(){let S=yield*$.worktree.makeWorktreeInfo();return yield*$.worktree.createFromInfo(S),S})).catch((S)=>{return F=S instanceof Error?S.message:String(S),null});if(!q)return J(B,"spawn-reject",{errorMessage:F}),null;$.entry.worktrees.add(q.directory);let C=await $.bridge.promise($.worktree.head(q.directory)).catch(()=>""),_=await q0.provide({directory:q.directory,fn:()=>Promise.resolve(q0.current)}),D=await $.bridge.promise(_A().pipe(K.provideService(L1,_)));$.entry.running++,$.scheduleFlush($.entry);let M=await q0.provide({directory:q.directory,fn:()=>D.promise(K.gen(function*(){let S=yield*G.spawn(Q(B,H,j));U=S.actorID;let f=yield*Z(S.actorID,B,p0.await(S.outcome),()=>{O="timeout"});if($.entry.childActorIDs.delete(S.actorID),f===null)return null;if(f.status!=="success")O="actor-error",F=f.error;return{actorID:S.actorID,outcome:f}})).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null})}).catch((S)=>{return O="spawn-reject",F=S instanceof Error?S.message:String(S),null}),P=!!M&&M.outcome.status==="success";if($.entry.running--,P)$.entry.succeeded++;else $.entry.failed++,J(B,O,{actorID:U,errorMessage:F});$.scheduleFlush($.entry);let y=M&&M.outcome.status==="success"?B.schema?M.outcome.structured??null:M.outcome.structured??M.outcome.finalText??null:null,I=C!==""&&await $.bridge.promise($.worktree.isPristine(q.directory,C)).catch(()=>!1);if(!(P&&!I))return await $.bridge.promise($.worktree.remove({directory:q.directory})).catch(()=>{return}),$.entry.worktrees.delete(q.directory),P?y:null;let h={branch:q.branch,directory:q.directory,changed:!0};if(y&&typeof y==="object"&&!Array.isArray(y))return{...y,_worktree:h};return{_worktree:h,result:y}},W=async(G,H,B)=>{if($.entry.agentCount>=$.lifecycleCap)return $.warnCapOnce(),J(G,"over-cap"),null;$.entry.agentCount++;let j=$.getActor();if(!j)throw Error("Actor service unavailable");let O=await $.bridge.promise($.resolveAgentModel(G.model,$.defaultModel,$.entry.warnedModelRefs));return B(j,H,G,O)};return(G,H)=>{let B=H??{},j=String(G);if(B.isolation!=="worktree"){let O=VA(j,{agentType:B.agentType,model:B.model,schema:B.schema,phase:B.phase}),U=FA($.journal,O);if($.journal.results.has(U))return $.entry.succeeded++,$.scheduleFlush($.entry),Promise.resolve($.journal.results.get(U));return(async()=>{let F=await $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,X)));if(F!==null)await K.runPromise(qA($.runID,$.journal,U,F));return F})()}return $.semaphore.run(async()=>$.globalSemaphore.run(async()=>W(B,j,V)))}}async function PA($){let Z=w4(await $),[J,Y,{QuickJSWASMModule:Q}]=await Promise.all([Z.importModuleLoader().then(w4),Z.importFFI(),import("./chunk-3gryj9r9.js").then(w4)]),X=await J();X.type="sync";let V=new Y(X);return new Q(X,V)}function w4($){return $&&"default"in $&&$.default?$.default&&"default"in $.default&&$.default.default?$.default.default:$.default:$}function MA($){let Z=typeof $=="number"?$:$.getTime();return function(){return Date.now()>Z}}var sl={type:"sync",importFFI:()=>import("./chunk-95ga21eq.js").then(($)=>$.QuickJSFFI),importModuleLoader:()=>import("./chunk-nn2hbew8.js").then(($)=>$.default)},wA=sl;var rl=PA(wA),CA=43200000,al=67108864,tl=2654435769,el=`
|
|
8230
8230
|
globalThis.parallel = (thunks) =>
|
|
8231
8231
|
Promise.all(thunks.map((t) => Promise.resolve().then(t)));
|
|
8232
8232
|
globalThis.pipeline = (items, ...stages) =>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$s as _}from"./chunk-mbma071k.js";import{ku as h}from"./chunk-w623r5kb.js";import{tP as X,vP as L}from"./chunk-0xf12tf3.js";var E={};X(E,{println:()=>g,print:()=>a,markdown:()=>G,logo:()=>I,input:()=>w,error:()=>A,empty:()=>D,UI:()=>E,Style:()=>m,CancelledError:()=>N});import{EOL as x}from"os";var T={left:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 "," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D "],right:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"]},R={left:[" "," ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 "],right:[" "," ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var O=["\u2800 ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"],N=_.create("UICancelledError",h.void()),m={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function g(...r){a(...r),process.stderr.write(x)}function a(...r){f=!1,process.stderr.write(r.join(" "))}var f=!1;function D(){if(f)return;g(""+m.TEXT_NORMAL),f=!0}function I(r){if(!process.stdout.isTTY&&!process.stderr.isTTY){let o=[];for(let s of O){if(r)o.push(r);o.push(s),o.push(x)}return o.join("").trimEnd()}let n=[],t="\x1B[0m",i={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},c={fg:t,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},d=" ",b=(o,s,u,l)=>{let e=[];for(let p of o){if(p==="_"){e.push(l," ",t);continue}if(p==="^"){e.push(s,l,"\u2580",t);continue}if(p==="~"){e.push(u,"\u2580",t);continue}if(p===" "){e.push(" ");continue}e.push(s,p,t)}return e.join("")};return T.left.forEach((o,s)=>{if(r)n.push(r);n.push(b(o,i.fg,i.shadow,i.bg)),n.push(d);let u=T.right[s]??"";n.push(b(u,c.fg,c.shadow,c.bg)),n.push(x)}),n.join("").trimEnd()}async function w(r){let t=L("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{t.question(r,(c)=>{t.close(),i(c.trim())})})}function A(r){if(r.startsWith("Error: "))r=r.slice(7);g(m.TEXT_DANGER_BOLD+"Error: "+m.TEXT_NORMAL+r)}function G(r){return r}
|
|
3
3
|
export{T as _f,R as $f,E as ag};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Dn as K,gn as j,hn as R,in as O,jn as A,pn as y,un as q,vn as M,xn as C}from"./chunk-fbd971t7.js";import{Ms as D}from"./chunk-9a9qcvtz.js";import{Dt as m,Gt as v}from"./chunk-vvmvryh1.js";import{eu as d,gu as b,ju as I}from"./chunk-mrh5q4s6.js";import{wP as T,xP as _}from"./chunk-0xf12tf3.js";import P from"path";function pt(t){let e=t&&typeof t==="object"&&"cause"in t?t.cause??t:t;if(!(e instanceof D.RunFailedError))return{error:e,detail:v(e),missing:!1};let r=e.stderr.toString().split(/\r?\n/).map((o)=>o.trim()).filter(Boolean),n=r.filter((o)=>o.startsWith("error:")).map((o)=>o.replace(/^error:\s*/,""));return{error:e,detail:n[0]??r.at(-1),missing:r.some((o)=>o.includes("No version matching"))}}var $={resolve:(t)=>q(t)},z={readText:(t)=>d.readText(t),write:async(t,e)=>{await d.write(t,e)},exists:(t)=>d.exists(t),files:(t,e)=>K(t,e)},G=z;function V(t){if(typeof t==="string")return t;if(!Array.isArray(t))return;if(typeof t[0]!=="string")return;return t[0]}function H(t){if(!t||typeof t!=="object"||Array.isArray(t))return;let e=t;if(!Array.isArray(e.plugin))return;return e.plugin}function Q(t){if(typeof t==="string"){let e=t.trim();if(e)return e;return}if(!m(t))return;for(let e of["import","default"]){let r=t[e];if(typeof r!=="string")continue;let n=r.trim();if(!n)continue;return n}}function U(t){if(!m(t))return;let e=t.config;if(!m(e))return;return e}function E(t,e){let r=t.exports;if(!m(r))return;let n=r[`./${e}`];if(!Q(n))return;return{opts:U(n)}}function X(t){let e=t.main;if(typeof e!=="string")return!1;return Boolean(e.trim())}function Y(t){let e=typeof t.json.name==="string"&&t.json.name.trim().length>0?t.json.name.trim():P.basename(t.dir),r=[],n=E(t.json,"server");if(n)r.push({kind:"server",opts:n.opts});else if(X(t.json))r.push({kind:"server"});let o=E(t.json,"tui");if(o)r.push({kind:"tui",opts:o.opts});if(!r.some((c)=>c.kind==="tui")&&C(e,t).length)r.push({kind:"tui"});return r}function g(t,e,r,n=!1){return A(t,O(t,e,r,{formattingOptions:{tabSize:2,insertSpaces:!0},isArrayInsertion:n}))}function Z(t,e,r,n,o=!1){let c=y(r).pkg,u=(e??[]).map((i,p)=>({item:i,i:p,spec:V(i)})).filter((i)=>{if(!i.spec)return!1;if(i.spec===r)return!0;if(i.spec.startsWith("file://"))return!1;return y(i.spec).pkg===c});if(!u.length){if(!e)return{mode:"add",text:g(t,["plugin"],[n])};return{mode:"add",text:g(t,["plugin",e.length],n,!0)}}if(!o)return{mode:"noop",text:t};let s=u[0];if(!s)return{mode:"noop",text:t};if(u.length===1&&s.spec===r)return{mode:"noop",text:t};let a=t;if(typeof s.item==="string")a=g(a,["plugin",s.i],n);if(Array.isArray(s.item)&&typeof s.item[0]==="string")a=g(a,["plugin",s.i,0],r);let l=u.map((i)=>i.i).filter((i)=>i!==s.i).sort((i,p)=>p-i);for(let i of l)a=g(a,["plugin",i],void 0);return{mode:"replace",text:a}}async function gt(t,e=$){let r=await e.resolve(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"install_failed",error:r.error};return{ok:!0,target:r.item}}async function dt(t){let e=await M(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!e.ok)return{ok:!1,code:"manifest_read_failed",file:t,error:e.error};let r=await Promise.resolve().then(()=>Y(e.item)).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"manifest_read_failed",file:e.item.pkg,error:r.error};if(!r.item.length)return{ok:!1,code:"manifest_no_targets",file:e.item.pkg};return{ok:!0,targets:r.item}}function tt(t){if(t.global)return t.config??I.Path.config;let r=t.vcs==="git"&&t.worktree!=="/"?t.worktree:t.directory;return P.join(r,".qitqode")}function et(t){if(t==="server")return"qitqode";return"tui"}async function rt(t,e,r,n,o){let x=[];try{let c=et(e.kind);const S=T(x,await b.acquire(`plug-config:${d.resolve(P.join(t,c))}`),1);let u=o.files(t,c);let s=u[0];for(let f of u){if(!await o.exists(f))continue;s=f;break}let a=await o.readText(s).catch((f)=>{if(f.code==="ENOENT")return"{}";return f});if(a instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:a};let l=a.trim()?a:"{}";let i=[];let p=j(l,i,{allowTrailingComma:!0});if(i.length){let f=i[0],h=l.substring(0,f.offset).split(`
|
|
3
3
|
`);return{ok:!1,code:"invalid_json",kind:e.kind,file:s,line:h.length,col:h[h.length-1].length+1,parse:R(f.error)}}let N=H(p);let F=e.opts?[r,e.opts]:r;let k=Z(l,N,r,F,n);if(k.mode==="noop")return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}};let w=await o.write(s,k.text).catch((f)=>f);if(w instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:w};return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}}}catch(J){var B=J,L=1}finally{var W=_(x,B,L);W&&await W}}async function mt(t,e=G){let r=tt(t),n=[];for(let o of t.targets){let c=await rt(r,o,t.spec,Boolean(t.force),e);if(!c.ok)return{...c,dir:r};n.push(c.item)}return{ok:!0,dir:r,items:n}}
|
|
4
4
|
export{pt as p,z as q,gt as r,dt as s,mt as t};
|