@bkm016/basalt 0.1.24 → 0.1.25
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/{chunk-bdr1170y.js → chunk-2c6seev1.js} +1 -1
- package/{chunk-9y8v1vrt.js → chunk-4mwx4pet.js} +1 -1
- package/{chunk-4x7xnfw1.js → chunk-61e7nvw9.js} +1 -1
- package/{chunk-979mxkzt.js → chunk-93bcazsp.js} +1 -1
- package/{chunk-y16fqzad.js → chunk-9fccgczj.js} +1 -1
- package/{chunk-kh4yq4rd.js → chunk-ff293dj0.js} +1 -1
- package/{chunk-cte9wd9x.js → chunk-g23dnf4y.js} +1 -1
- package/{chunk-c4nxr37s.js → chunk-gwcstcqs.js} +4 -4
- package/{chunk-ma91f4qj.js → chunk-m839588n.js} +1 -1
- package/{chunk-0nxcbf6d.js → chunk-pjv9mppd.js} +109 -108
- package/{chunk-pcd14q8r.js → chunk-rkn6bven.js} +4 -4
- package/compiled.js +1 -1
- package/package.json +1 -1
- package/ui-test-worker.js +1 -1
- package/web/{chunk-ppccb30x.js → chunk-00wh99xz.js} +4 -4
- package/web/chunk-00wh99xz.js.br +0 -0
- package/web/chunk-00wh99xz.js.gz +0 -0
- package/web/{chunk-g7t1bvvx.js → chunk-0a1t2j8h.js} +1 -1
- package/web/chunk-0a1t2j8h.js.br +0 -0
- package/web/chunk-0a1t2j8h.js.gz +0 -0
- package/web/{chunk-59ybhv47.js → chunk-1ar2phwa.js} +1 -1
- package/web/chunk-1ar2phwa.js.br +0 -0
- package/web/chunk-1ar2phwa.js.gz +0 -0
- package/web/{chunk-hqtm67yw.js → chunk-1jfydncj.js} +2 -2
- package/web/chunk-1jfydncj.js.br +0 -0
- package/web/chunk-1jfydncj.js.gz +0 -0
- package/web/{chunk-qqtj88e0.js → chunk-1p1jtvrt.js} +1 -1
- package/web/chunk-1p1jtvrt.js.br +0 -0
- package/web/chunk-1p1jtvrt.js.gz +0 -0
- package/web/chunk-1x38r11w.js +1 -0
- package/web/chunk-1x38r11w.js.br +2 -0
- package/web/chunk-1x38r11w.js.gz +0 -0
- package/web/{chunk-bbyqcvdz.js → chunk-25rf3svt.js} +2 -2
- package/web/chunk-25rf3svt.js.br +0 -0
- package/web/chunk-25rf3svt.js.gz +0 -0
- package/web/chunk-2cfv55j2.js +1 -0
- package/web/chunk-2cfv55j2.js.br +0 -0
- package/web/chunk-2cfv55j2.js.gz +0 -0
- package/web/{chunk-bg2ps35t.js → chunk-2q37qdq2.js} +1 -1
- package/web/chunk-2q37qdq2.js.br +0 -0
- package/web/chunk-2q37qdq2.js.gz +0 -0
- package/web/{chunk-13x3xyyh.js → chunk-2yhmab75.js} +4 -4
- package/web/chunk-2yhmab75.js.br +0 -0
- package/web/chunk-2yhmab75.js.gz +0 -0
- package/web/{chunk-bvmvj35k.js → chunk-3at57qna.js} +1 -1
- package/web/chunk-3at57qna.js.br +0 -0
- package/web/chunk-3at57qna.js.gz +0 -0
- package/web/{chunk-nb3jk1wk.js → chunk-3z9kpkec.js} +1 -1
- package/web/chunk-3z9kpkec.js.br +0 -0
- package/web/chunk-3z9kpkec.js.gz +0 -0
- package/web/chunk-4ncnt1c2.js +2 -0
- package/web/chunk-4ncnt1c2.js.br +0 -0
- package/web/{chunk-k69ysa0v.js → chunk-4ncnt1c2.js.gz} +0 -0
- package/web/chunk-4vc07x6t.js +1 -0
- package/web/chunk-4vc07x6t.js.br +0 -0
- package/web/chunk-4vc07x6t.js.gz +0 -0
- package/web/{chunk-921qw2jf.js → chunk-4ytc5sth.js} +1 -1
- package/web/chunk-4ytc5sth.js.br +0 -0
- package/web/chunk-4ytc5sth.js.gz +0 -0
- package/web/{chunk-zs7c2db4.js → chunk-5c5h90k0.js} +1 -1
- package/web/chunk-5c5h90k0.js.br +0 -0
- package/web/chunk-5c5h90k0.js.gz +0 -0
- package/web/chunk-5zpn3n5a.js +1 -0
- package/web/chunk-5zpn3n5a.js.br +0 -0
- package/web/chunk-5zpn3n5a.js.gz +0 -0
- package/web/chunk-64k06g43.js +1 -0
- package/web/chunk-64k06g43.js.br +0 -0
- package/web/chunk-64k06g43.js.gz +0 -0
- package/web/{chunk-bh0a254y.js → chunk-6pbrtp4e.js} +4 -4
- package/web/chunk-6pbrtp4e.js.br +0 -0
- package/web/chunk-6pbrtp4e.js.gz +0 -0
- package/web/chunk-6sehssym.js +1 -0
- package/web/chunk-6sehssym.js.br +2 -0
- package/web/chunk-6sehssym.js.gz +0 -0
- package/web/chunk-7hxj251q.js +1 -0
- package/web/chunk-7hxj251q.js.br +0 -0
- package/web/chunk-7hxj251q.js.gz +0 -0
- package/web/{chunk-abvtsz6z.js → chunk-7qcmg5ns.js} +1 -1
- package/web/chunk-7qcmg5ns.js.br +0 -0
- package/web/chunk-7qcmg5ns.js.gz +0 -0
- package/web/{chunk-172gywq4.js → chunk-82j6713x.js} +6 -6
- package/web/chunk-82j6713x.js.br +0 -0
- package/web/chunk-82j6713x.js.gz +0 -0
- package/web/{chunk-kbvzxsz7.js → chunk-9vexd52p.js} +1 -1
- package/web/chunk-9vexd52p.js.br +0 -0
- package/web/chunk-9vexd52p.js.gz +0 -0
- package/web/{chunk-crhbhsrh.js → chunk-ajj3nc80.js} +1 -1
- package/web/chunk-ajj3nc80.js.br +0 -0
- package/web/chunk-ajj3nc80.js.gz +0 -0
- package/web/chunk-amrkb4dd.js +1 -0
- package/web/chunk-amrkb4dd.js.br +0 -0
- package/web/chunk-amrkb4dd.js.gz +0 -0
- package/web/{chunk-w563538j.js → chunk-b7d5k9sp.js} +35 -35
- package/web/chunk-b7d5k9sp.js.br +0 -0
- package/web/chunk-b7d5k9sp.js.gz +0 -0
- package/web/chunk-bavn0z5d.js +1 -0
- package/web/chunk-bavn0z5d.js.br +0 -0
- package/web/chunk-bavn0z5d.js.gz +0 -0
- package/web/{chunk-yp75a6yh.js → chunk-bjw74xvy.js} +1 -1
- package/web/chunk-bjw74xvy.js.br +0 -0
- package/web/chunk-bjw74xvy.js.gz +0 -0
- package/web/chunk-bn68ks4x.js +1 -0
- package/web/chunk-bn68ks4x.js.br +0 -0
- package/web/chunk-bn68ks4x.js.gz +0 -0
- package/web/chunk-c59d2j14.js +8 -0
- package/web/chunk-c59d2j14.js.br +0 -0
- package/web/chunk-c59d2j14.js.gz +0 -0
- package/web/{chunk-634vc92s.js → chunk-cfz9ftze.js} +3 -3
- package/web/chunk-cfz9ftze.js.br +0 -0
- package/web/chunk-cfz9ftze.js.gz +0 -0
- package/web/{chunk-zsae1tn8.js → chunk-chq476ch.js} +4 -4
- package/web/chunk-chq476ch.js.br +0 -0
- package/web/chunk-chq476ch.js.gz +0 -0
- package/web/{chunk-5zkw2kkb.js → chunk-d0ey112q.js} +5 -5
- package/web/chunk-d0ey112q.js.br +0 -0
- package/web/chunk-d0ey112q.js.gz +0 -0
- package/web/{chunk-h1cv1kke.js → chunk-d71z7s5r.js} +1 -1
- package/web/chunk-d71z7s5r.js.br +0 -0
- package/web/chunk-d71z7s5r.js.gz +0 -0
- package/web/{chunk-8de69eyx.js → chunk-dembnhph.js} +1 -1
- package/web/chunk-dembnhph.js.br +0 -0
- package/web/chunk-dembnhph.js.gz +0 -0
- package/web/{chunk-m5nt857c.js → chunk-dfq4w8mf.js} +1 -1
- package/web/chunk-dfq4w8mf.js.br +0 -0
- package/web/chunk-dfq4w8mf.js.gz +0 -0
- package/web/{chunk-bbs6yq60.js → chunk-dwdxczxc.js} +3 -3
- package/web/chunk-dwdxczxc.js.br +0 -0
- package/web/chunk-dwdxczxc.js.gz +0 -0
- package/web/chunk-e3b2krd7.js +1 -0
- package/web/chunk-e3b2krd7.js.br +0 -0
- package/web/chunk-e3b2krd7.js.gz +0 -0
- package/web/{chunk-91s1ns6b.js → chunk-e4wbkc1x.js} +11 -11
- package/web/chunk-e4wbkc1x.js.br +0 -0
- package/web/chunk-e4wbkc1x.js.gz +0 -0
- package/web/{chunk-ygzgrjj7.js → chunk-f2qrf0he.js} +1 -1
- package/web/chunk-f2qrf0he.js.br +0 -0
- package/web/chunk-f2qrf0he.js.gz +0 -0
- package/web/{chunk-ca8hnmmv.js → chunk-f88vhwan.js} +5 -5
- package/web/chunk-f88vhwan.js.br +0 -0
- package/web/chunk-f88vhwan.js.gz +0 -0
- package/web/{chunk-yg9a23mv.js → chunk-fpp6jtb4.js} +1 -1
- package/web/chunk-fpp6jtb4.js.br +0 -0
- package/web/chunk-fpp6jtb4.js.gz +0 -0
- package/web/chunk-ft62hfnt.js +1 -0
- package/web/chunk-ft62hfnt.js.br +0 -0
- package/web/chunk-ft62hfnt.js.gz +0 -0
- package/web/{chunk-176tsg6e.js → chunk-g3fahpjw.js} +2 -2
- package/web/chunk-g3fahpjw.js.br +0 -0
- package/web/chunk-g3fahpjw.js.gz +0 -0
- package/web/{chunk-xw8tzrmm.js → chunk-g5b4wjwp.js} +94 -94
- package/web/chunk-g5b4wjwp.js.br +0 -0
- package/web/chunk-g5b4wjwp.js.gz +0 -0
- package/web/chunk-ga3tn73a.js +1 -0
- package/web/chunk-ga3tn73a.js.br +0 -0
- package/web/chunk-ga3tn73a.js.gz +0 -0
- package/web/{chunk-4cbcqcd2.js → chunk-gf4vtpw2.js} +1 -1
- package/web/chunk-gf4vtpw2.js.br +0 -0
- package/web/chunk-gf4vtpw2.js.gz +0 -0
- package/web/{chunk-n9npqkxf.js → chunk-ghxfjwhq.js} +1 -1
- package/web/chunk-ghxfjwhq.js.br +0 -0
- package/web/chunk-ghxfjwhq.js.gz +0 -0
- package/web/{chunk-hsgtzrkh.js → chunk-gxqs7zmy.js} +1 -1
- package/web/chunk-gxqs7zmy.js.br +0 -0
- package/web/chunk-gxqs7zmy.js.gz +0 -0
- package/web/{chunk-9k9p5dat.js → chunk-jpdp0xkd.js} +1 -1
- package/web/chunk-jpdp0xkd.js.br +0 -0
- package/web/chunk-jpdp0xkd.js.gz +0 -0
- package/web/{chunk-kn9bc5z2.js → chunk-jtzbk251.js} +2 -2
- package/web/chunk-jtzbk251.js.br +0 -0
- package/web/chunk-jtzbk251.js.gz +0 -0
- package/web/{chunk-ac8vmj54.js → chunk-kc6k0ect.js} +1 -1
- package/web/chunk-kc6k0ect.js.br +0 -0
- package/web/chunk-kc6k0ect.js.gz +0 -0
- package/web/{chunk-gy2y4zfa.js → chunk-kk7k8xc8.js} +5 -5
- package/web/chunk-kk7k8xc8.js.br +0 -0
- package/web/chunk-kk7k8xc8.js.gz +0 -0
- package/web/{chunk-6n3cwe1h.js → chunk-kmpyntam.js} +19 -19
- package/web/chunk-kmpyntam.js.br +0 -0
- package/web/chunk-kmpyntam.js.gz +0 -0
- package/web/{chunk-q17rem99.js → chunk-mejpj22t.js} +5 -5
- package/web/chunk-mejpj22t.js.br +0 -0
- package/web/chunk-mejpj22t.js.gz +0 -0
- package/web/{chunk-sapy54hm.js → chunk-mm10pm0x.js} +3 -3
- package/web/chunk-mm10pm0x.js.br +0 -0
- package/web/chunk-mm10pm0x.js.gz +0 -0
- package/web/{chunk-r4cr8rvt.js → chunk-mpve4748.js} +1 -1
- package/web/chunk-mpve4748.js.br +0 -0
- package/web/chunk-mpve4748.js.gz +0 -0
- package/web/chunk-ms022qq9.js +1 -0
- package/web/chunk-ms022qq9.js.br +2 -0
- package/web/chunk-ms022qq9.js.gz +0 -0
- package/web/{chunk-xv1d350x.js → chunk-mxf122px.js} +1 -1
- package/web/chunk-mxf122px.js.br +0 -0
- package/web/chunk-mxf122px.js.gz +0 -0
- package/web/chunk-mzv41kv9.js +1 -0
- package/web/chunk-mzv41kv9.js.br +2 -0
- package/web/chunk-mzv41kv9.js.gz +0 -0
- package/web/{chunk-2fms67zg.js → chunk-mzyg8zga.js} +1 -1
- package/web/chunk-mzyg8zga.js.br +0 -0
- package/web/chunk-mzyg8zga.js.gz +0 -0
- package/web/{chunk-c2eqwepm.js → chunk-n8j9jdsh.js} +1 -1
- package/web/chunk-n8j9jdsh.js.br +0 -0
- package/web/chunk-n8j9jdsh.js.gz +0 -0
- package/web/{chunk-fp7q643n.js → chunk-n8ts6ra2.js} +3 -3
- package/web/chunk-n8ts6ra2.js.br +0 -0
- package/web/chunk-n8ts6ra2.js.gz +0 -0
- package/web/chunk-nefchfa1.js +1 -0
- package/web/chunk-nefchfa1.js.br +0 -0
- package/web/chunk-nefchfa1.js.gz +0 -0
- package/web/chunk-ng0bsm6n.js +1 -0
- package/web/chunk-ng0bsm6n.js.br +0 -0
- package/web/chunk-ng0bsm6n.js.gz +0 -0
- package/web/{chunk-ced8pdbc.js → chunk-nz1mm18x.js} +1 -1
- package/web/chunk-nz1mm18x.js.br +0 -0
- package/web/chunk-nz1mm18x.js.gz +0 -0
- package/web/{chunk-mbaw66b5.js → chunk-pdxqp4rh.js} +1 -1
- package/web/chunk-pdxqp4rh.js.br +0 -0
- package/web/chunk-pdxqp4rh.js.gz +0 -0
- package/web/{chunk-g1penf6y.js → chunk-pe2zvyjt.js} +1 -1
- package/web/chunk-pe2zvyjt.js.br +0 -0
- package/web/chunk-pe2zvyjt.js.gz +0 -0
- package/web/{chunk-t7vwsg9r.js → chunk-q8ve5wqt.js} +2 -2
- package/web/chunk-q8ve5wqt.js.br +0 -0
- package/web/chunk-q8ve5wqt.js.gz +0 -0
- package/web/{chunk-ny87aq2j.js → chunk-qh93t9tv.js} +1 -1
- package/web/chunk-qh93t9tv.js.br +0 -0
- package/web/chunk-qh93t9tv.js.gz +0 -0
- package/web/{chunk-3vdw9nn7.js → chunk-qqewmk3y.js} +1 -1
- package/web/chunk-qqewmk3y.js.br +0 -0
- package/web/chunk-qqewmk3y.js.gz +0 -0
- package/web/{chunk-n59nyqcr.js → chunk-qzb06me8.js} +34 -34
- package/web/chunk-qzb06me8.js.br +0 -0
- package/web/chunk-qzb06me8.js.gz +0 -0
- package/web/{chunk-tt7j0m6m.js → chunk-r2zernvz.js} +5 -5
- package/web/chunk-r2zernvz.js.br +0 -0
- package/web/chunk-r2zernvz.js.gz +0 -0
- package/web/{chunk-qdq6wvgt.js → chunk-r8ykja8v.js} +3 -3
- package/web/chunk-r8ykja8v.js.br +0 -0
- package/web/chunk-r8ykja8v.js.gz +0 -0
- package/web/{chunk-qhr6hegh.js → chunk-r9b7eh2j.js} +1 -1
- package/web/chunk-r9b7eh2j.js.br +0 -0
- package/web/chunk-r9b7eh2j.js.gz +0 -0
- package/web/{chunk-eq28qb33.js → chunk-ry1wp3v8.js} +2 -2
- package/web/chunk-ry1wp3v8.js.br +0 -0
- package/web/chunk-ry1wp3v8.js.gz +0 -0
- package/web/chunk-s2bfc2vk.js +1 -0
- package/web/chunk-s2bfc2vk.js.br +0 -0
- package/web/chunk-s2bfc2vk.js.gz +0 -0
- package/web/{chunk-2psxv4dk.js → chunk-s4c6nzj9.js} +5 -5
- package/web/chunk-s4c6nzj9.js.br +0 -0
- package/web/chunk-s4c6nzj9.js.gz +0 -0
- package/web/{chunk-b9fqnzqd.js → chunk-ss23nnmc.js} +4 -4
- package/web/chunk-ss23nnmc.js.br +0 -0
- package/web/chunk-ss23nnmc.js.gz +0 -0
- package/web/{chunk-b2t33c3t.js → chunk-sxmv80th.js} +1 -1
- package/web/chunk-sxmv80th.js.br +0 -0
- package/web/chunk-sxmv80th.js.gz +0 -0
- package/web/{chunk-3sszg3gr.js → chunk-sy2cdka3.js} +1 -1
- package/web/chunk-sy2cdka3.js.br +0 -0
- package/web/chunk-sy2cdka3.js.gz +0 -0
- package/web/{chunk-vgpyff03.js → chunk-sysebfkg.js} +3 -3
- package/web/chunk-sysebfkg.js.br +0 -0
- package/web/chunk-sysebfkg.js.gz +0 -0
- package/web/{chunk-vb3sy3hv.js → chunk-t3620hrb.js} +2 -2
- package/web/chunk-t3620hrb.js.br +0 -0
- package/web/chunk-t3620hrb.js.gz +0 -0
- package/web/{chunk-phr7yps3.js → chunk-t5srz1hs.js} +2 -2
- package/web/chunk-t5srz1hs.js.br +0 -0
- package/web/chunk-t5srz1hs.js.gz +0 -0
- package/web/{chunk-sarkb4p9.js → chunk-v25k7n3r.js} +1 -1
- package/web/chunk-v25k7n3r.js.br +0 -0
- package/web/chunk-v25k7n3r.js.gz +0 -0
- package/web/{chunk-e3d6kvwm.js → chunk-vf0p4ayw.js} +1 -1
- package/web/chunk-vf0p4ayw.js.br +0 -0
- package/web/chunk-vf0p4ayw.js.gz +0 -0
- package/web/chunk-vr6n4pvt.js +1 -0
- package/web/chunk-vr6n4pvt.js.br +0 -0
- package/web/chunk-vr6n4pvt.js.gz +0 -0
- package/web/{chunk-713ygtrs.js → chunk-vx9g94x2.js} +4 -4
- package/web/chunk-vx9g94x2.js.br +0 -0
- package/web/chunk-vx9g94x2.js.gz +0 -0
- package/web/{chunk-cj0cmvbm.js → chunk-w5v80bmk.js} +4 -4
- package/web/chunk-w5v80bmk.js.br +0 -0
- package/web/chunk-w5v80bmk.js.gz +0 -0
- package/web/{chunk-y5zd05mz.js → chunk-wj0ck0pa.js} +1 -1
- package/web/chunk-wj0ck0pa.js.br +0 -0
- package/web/chunk-wj0ck0pa.js.gz +0 -0
- package/web/chunk-wjzdpyhs.css +1 -0
- package/web/chunk-wjzdpyhs.css.br +0 -0
- package/web/chunk-wjzdpyhs.css.gz +0 -0
- package/web/{chunk-17d30546.js → chunk-wmt8d7zv.js} +5 -5
- package/web/chunk-wmt8d7zv.js.br +0 -0
- package/web/chunk-wmt8d7zv.js.gz +0 -0
- package/web/{chunk-ksr360js.js → chunk-wqf0qjbv.js} +2 -2
- package/web/chunk-wqf0qjbv.js.br +0 -0
- package/web/chunk-wqf0qjbv.js.gz +0 -0
- package/web/{chunk-2z4zhtw4.js → chunk-y5f7gy03.js} +2 -2
- package/web/chunk-y5f7gy03.js.br +0 -0
- package/web/chunk-y5f7gy03.js.gz +0 -0
- package/web/{chunk-96n0nem7.js → chunk-yg78fas7.js} +1 -1
- package/web/chunk-yg78fas7.js.br +0 -0
- package/web/chunk-yg78fas7.js.gz +0 -0
- package/web/{chunk-k8x1xbf6.js → chunk-yvkbc3s5.js} +1 -1
- package/web/chunk-yvkbc3s5.js.br +0 -0
- package/web/chunk-yvkbc3s5.js.gz +0 -0
- package/web/{chunk-wrqazg2v.js → chunk-z9nj64n7.js} +1 -1
- package/web/chunk-z9nj64n7.js.br +0 -0
- package/web/chunk-z9nj64n7.js.gz +0 -0
- package/web/{chunk-ms7cscs9.js → chunk-zc0e01j4.js} +1 -1
- package/web/chunk-zc0e01j4.js.br +0 -0
- package/web/chunk-zc0e01j4.js.gz +0 -0
- package/web/{chunk-290wy4yk.js → chunk-zj9s9w76.js} +1 -1
- package/web/chunk-zj9s9w76.js.br +0 -0
- package/web/chunk-zj9s9w76.js.gz +0 -0
- package/web/{chunk-085ttz7c.js → chunk-znwpavn5.js} +4 -4
- package/web/chunk-znwpavn5.js.br +0 -0
- package/web/chunk-znwpavn5.js.gz +0 -0
- package/web/index.html +1 -1
- package/web/index.html.br +0 -0
- package/web/index.html.gz +0 -0
- package/web/chunk-085ttz7c.js.br +0 -0
- package/web/chunk-085ttz7c.js.gz +0 -0
- package/web/chunk-13x3xyyh.js.br +0 -0
- package/web/chunk-13x3xyyh.js.gz +0 -0
- package/web/chunk-172gywq4.js.br +0 -0
- package/web/chunk-172gywq4.js.gz +0 -0
- package/web/chunk-176tsg6e.js.br +0 -0
- package/web/chunk-176tsg6e.js.gz +0 -0
- package/web/chunk-17d30546.js.br +0 -0
- package/web/chunk-17d30546.js.gz +0 -0
- package/web/chunk-1k6jx4hs.js +0 -1
- package/web/chunk-1k6jx4hs.js.br +0 -0
- package/web/chunk-1k6jx4hs.js.gz +0 -0
- package/web/chunk-1kts05s6.css +0 -1
- package/web/chunk-1kts05s6.css.br +0 -0
- package/web/chunk-1kts05s6.css.gz +0 -0
- package/web/chunk-1z0x1j6q.js +0 -1
- package/web/chunk-1z0x1j6q.js.br +0 -0
- package/web/chunk-1z0x1j6q.js.gz +0 -0
- package/web/chunk-290wy4yk.js.br +0 -0
- package/web/chunk-290wy4yk.js.gz +0 -0
- package/web/chunk-2cdw1299.js +0 -1
- package/web/chunk-2cdw1299.js.br +0 -0
- package/web/chunk-2cdw1299.js.gz +0 -0
- package/web/chunk-2fms67zg.js.br +0 -0
- package/web/chunk-2fms67zg.js.gz +0 -0
- package/web/chunk-2psxv4dk.js.br +0 -0
- package/web/chunk-2psxv4dk.js.gz +0 -0
- package/web/chunk-2z4zhtw4.js.br +0 -0
- package/web/chunk-2z4zhtw4.js.gz +0 -0
- package/web/chunk-3sszg3gr.js.br +0 -0
- package/web/chunk-3sszg3gr.js.gz +0 -0
- package/web/chunk-3vdw9nn7.js.br +0 -0
- package/web/chunk-3vdw9nn7.js.gz +0 -0
- package/web/chunk-4cbcqcd2.js.br +0 -0
- package/web/chunk-4cbcqcd2.js.gz +0 -0
- package/web/chunk-4v6n6b36.js +0 -1
- package/web/chunk-4v6n6b36.js.br +0 -0
- package/web/chunk-4v6n6b36.js.gz +0 -0
- package/web/chunk-59ybhv47.js.br +0 -0
- package/web/chunk-59ybhv47.js.gz +0 -0
- package/web/chunk-5zkw2kkb.js.br +0 -0
- package/web/chunk-5zkw2kkb.js.gz +0 -0
- package/web/chunk-634vc92s.js.br +0 -0
- package/web/chunk-634vc92s.js.gz +0 -0
- package/web/chunk-6n3cwe1h.js.br +0 -0
- package/web/chunk-6n3cwe1h.js.gz +0 -0
- package/web/chunk-6zr2j7xj.js +0 -1
- package/web/chunk-6zr2j7xj.js.br +0 -0
- package/web/chunk-6zr2j7xj.js.gz +0 -0
- package/web/chunk-713ygtrs.js.br +0 -0
- package/web/chunk-713ygtrs.js.gz +0 -0
- package/web/chunk-7m4gmjvp.js +0 -1
- package/web/chunk-7m4gmjvp.js.br +0 -0
- package/web/chunk-7m4gmjvp.js.gz +0 -0
- package/web/chunk-7x90pq42.js +0 -1
- package/web/chunk-7x90pq42.js.br +0 -0
- package/web/chunk-7x90pq42.js.gz +0 -0
- package/web/chunk-8de69eyx.js.br +0 -0
- package/web/chunk-8de69eyx.js.gz +0 -0
- package/web/chunk-91s1ns6b.js.br +0 -0
- package/web/chunk-91s1ns6b.js.gz +0 -0
- package/web/chunk-921qw2jf.js.br +0 -0
- package/web/chunk-921qw2jf.js.gz +0 -0
- package/web/chunk-96n0nem7.js.br +0 -0
- package/web/chunk-96n0nem7.js.gz +0 -0
- package/web/chunk-9k9p5dat.js.br +0 -0
- package/web/chunk-9k9p5dat.js.gz +0 -0
- package/web/chunk-a529550j.js +0 -1
- package/web/chunk-a529550j.js.br +0 -0
- package/web/chunk-a529550j.js.gz +0 -0
- package/web/chunk-abvtsz6z.js.br +0 -0
- package/web/chunk-abvtsz6z.js.gz +0 -0
- package/web/chunk-ac8vmj54.js.br +0 -0
- package/web/chunk-ac8vmj54.js.gz +0 -0
- package/web/chunk-b2t33c3t.js.br +0 -0
- package/web/chunk-b2t33c3t.js.gz +0 -0
- package/web/chunk-b9fqnzqd.js.br +0 -0
- package/web/chunk-b9fqnzqd.js.gz +0 -0
- package/web/chunk-bbs6yq60.js.br +0 -0
- package/web/chunk-bbs6yq60.js.gz +0 -0
- package/web/chunk-bbyqcvdz.js.br +0 -0
- package/web/chunk-bbyqcvdz.js.gz +0 -0
- package/web/chunk-bg2ps35t.js.br +0 -0
- package/web/chunk-bg2ps35t.js.gz +0 -0
- package/web/chunk-bh0a254y.js.br +0 -0
- package/web/chunk-bh0a254y.js.gz +0 -0
- package/web/chunk-bvmvj35k.js.br +0 -0
- package/web/chunk-bvmvj35k.js.gz +0 -0
- package/web/chunk-c2eqwepm.js.br +0 -0
- package/web/chunk-c2eqwepm.js.gz +0 -0
- package/web/chunk-ca8hnmmv.js.br +0 -0
- package/web/chunk-ca8hnmmv.js.gz +0 -0
- package/web/chunk-ced8pdbc.js.br +0 -0
- package/web/chunk-ced8pdbc.js.gz +0 -0
- package/web/chunk-cj0cmvbm.js.br +0 -0
- package/web/chunk-cj0cmvbm.js.gz +0 -0
- package/web/chunk-crhbhsrh.js.br +0 -0
- package/web/chunk-crhbhsrh.js.gz +0 -0
- package/web/chunk-e3d6kvwm.js.br +0 -0
- package/web/chunk-e3d6kvwm.js.gz +0 -0
- package/web/chunk-eq28qb33.js.br +0 -3
- package/web/chunk-eq28qb33.js.gz +0 -0
- package/web/chunk-f8ac76br.js +0 -2
- package/web/chunk-f8ac76br.js.br +0 -3
- package/web/chunk-f8ac76br.js.gz +0 -0
- package/web/chunk-fp7q643n.js.br +0 -0
- package/web/chunk-fp7q643n.js.gz +0 -0
- package/web/chunk-g1penf6y.js.br +0 -0
- package/web/chunk-g1penf6y.js.gz +0 -0
- package/web/chunk-g7t1bvvx.js.br +0 -0
- package/web/chunk-g7t1bvvx.js.gz +0 -0
- package/web/chunk-gf4ky7tp.js +0 -8
- package/web/chunk-gf4ky7tp.js.br +0 -0
- package/web/chunk-gf4ky7tp.js.gz +0 -0
- package/web/chunk-gtcjwz0j.js +0 -1
- package/web/chunk-gtcjwz0j.js.br +0 -2
- package/web/chunk-gtcjwz0j.js.gz +0 -0
- package/web/chunk-gy2y4zfa.js.br +0 -0
- package/web/chunk-gy2y4zfa.js.gz +0 -0
- package/web/chunk-h1cv1kke.js.br +0 -0
- package/web/chunk-h1cv1kke.js.gz +0 -0
- package/web/chunk-h6k80vqf.js +0 -1
- package/web/chunk-h6k80vqf.js.br +0 -0
- package/web/chunk-h6k80vqf.js.gz +0 -0
- package/web/chunk-hqtm67yw.js.br +0 -0
- package/web/chunk-hqtm67yw.js.gz +0 -0
- package/web/chunk-hsgtzrkh.js.br +0 -0
- package/web/chunk-hsgtzrkh.js.gz +0 -0
- package/web/chunk-j7phw79h.js +0 -1
- package/web/chunk-j7phw79h.js.br +0 -0
- package/web/chunk-j7phw79h.js.gz +0 -0
- package/web/chunk-k69ysa0v.js.br +0 -0
- package/web/chunk-k69ysa0v.js.gz +0 -0
- package/web/chunk-k7h5g8qj.js +0 -1
- package/web/chunk-k7h5g8qj.js.br +0 -2
- package/web/chunk-k7h5g8qj.js.gz +0 -0
- package/web/chunk-k8x1xbf6.js.br +0 -0
- package/web/chunk-k8x1xbf6.js.gz +0 -0
- package/web/chunk-kbvzxsz7.js.br +0 -0
- package/web/chunk-kbvzxsz7.js.gz +0 -0
- package/web/chunk-kn9bc5z2.js.br +0 -0
- package/web/chunk-kn9bc5z2.js.gz +0 -0
- package/web/chunk-ksr360js.js.br +0 -0
- package/web/chunk-ksr360js.js.gz +0 -0
- package/web/chunk-m5nt857c.js.br +0 -0
- package/web/chunk-m5nt857c.js.gz +0 -0
- package/web/chunk-mbaw66b5.js.br +0 -0
- package/web/chunk-mbaw66b5.js.gz +0 -0
- package/web/chunk-ms7cscs9.js.br +0 -0
- package/web/chunk-ms7cscs9.js.gz +0 -0
- package/web/chunk-n59nyqcr.js.br +0 -0
- package/web/chunk-n59nyqcr.js.gz +0 -0
- package/web/chunk-n9npqkxf.js.br +0 -0
- package/web/chunk-n9npqkxf.js.gz +0 -0
- package/web/chunk-nb3jk1wk.js.br +0 -0
- package/web/chunk-nb3jk1wk.js.gz +0 -0
- package/web/chunk-ny87aq2j.js.br +0 -0
- package/web/chunk-ny87aq2j.js.gz +0 -0
- package/web/chunk-phr7yps3.js.br +0 -0
- package/web/chunk-phr7yps3.js.gz +0 -0
- package/web/chunk-ppccb30x.js.br +0 -0
- package/web/chunk-ppccb30x.js.gz +0 -0
- package/web/chunk-q17rem99.js.br +0 -0
- package/web/chunk-q17rem99.js.gz +0 -0
- package/web/chunk-qdq6wvgt.js.br +0 -0
- package/web/chunk-qdq6wvgt.js.gz +0 -0
- package/web/chunk-qhr6hegh.js.br +0 -0
- package/web/chunk-qhr6hegh.js.gz +0 -0
- package/web/chunk-qqtj88e0.js.br +0 -0
- package/web/chunk-qqtj88e0.js.gz +0 -0
- package/web/chunk-r165xpp5.js +0 -1
- package/web/chunk-r165xpp5.js.br +0 -0
- package/web/chunk-r165xpp5.js.gz +0 -0
- package/web/chunk-r4cr8rvt.js.br +0 -0
- package/web/chunk-r4cr8rvt.js.gz +0 -0
- package/web/chunk-sapy54hm.js.br +0 -0
- package/web/chunk-sapy54hm.js.gz +0 -0
- package/web/chunk-sarkb4p9.js.br +0 -0
- package/web/chunk-sarkb4p9.js.gz +0 -0
- package/web/chunk-t7vwsg9r.js.br +0 -0
- package/web/chunk-t7vwsg9r.js.gz +0 -0
- package/web/chunk-tt7j0m6m.js.br +0 -0
- package/web/chunk-tt7j0m6m.js.gz +0 -0
- package/web/chunk-va1rkfan.js +0 -1
- package/web/chunk-va1rkfan.js.br +0 -0
- package/web/chunk-va1rkfan.js.gz +0 -0
- package/web/chunk-vb3sy3hv.js.br +0 -0
- package/web/chunk-vb3sy3hv.js.gz +0 -0
- package/web/chunk-vgpyff03.js.br +0 -0
- package/web/chunk-vgpyff03.js.gz +0 -0
- package/web/chunk-w563538j.js.br +0 -0
- package/web/chunk-w563538j.js.gz +0 -0
- package/web/chunk-w71t7mes.js +0 -1
- package/web/chunk-w71t7mes.js.br +0 -0
- package/web/chunk-w71t7mes.js.gz +0 -0
- package/web/chunk-w96etr1w.js +0 -1
- package/web/chunk-w96etr1w.js.br +0 -0
- package/web/chunk-w96etr1w.js.gz +0 -0
- package/web/chunk-wrqazg2v.js.br +0 -0
- package/web/chunk-wrqazg2v.js.gz +0 -0
- package/web/chunk-xv1d350x.js.br +0 -0
- package/web/chunk-xv1d350x.js.gz +0 -0
- package/web/chunk-xw8tzrmm.js.br +0 -0
- package/web/chunk-xw8tzrmm.js.gz +0 -0
- package/web/chunk-xwsh4jx7.js +0 -1
- package/web/chunk-xwsh4jx7.js.br +0 -2
- package/web/chunk-xwsh4jx7.js.gz +0 -0
- package/web/chunk-xxk7xkrs.js +0 -1
- package/web/chunk-xxk7xkrs.js.br +0 -0
- package/web/chunk-xxk7xkrs.js.gz +0 -0
- package/web/chunk-y5zd05mz.js.br +0 -0
- package/web/chunk-y5zd05mz.js.gz +0 -0
- package/web/chunk-yg9a23mv.js.br +0 -0
- package/web/chunk-yg9a23mv.js.gz +0 -0
- package/web/chunk-ygzgrjj7.js.br +0 -0
- package/web/chunk-ygzgrjj7.js.gz +0 -0
- package/web/chunk-yp75a6yh.js.br +0 -0
- package/web/chunk-yp75a6yh.js.gz +0 -0
- package/web/chunk-zs7c2db4.js.br +0 -0
- package/web/chunk-zs7c2db4.js.gz +0 -0
- package/web/chunk-zsae1tn8.js.br +0 -0
- package/web/chunk-zsae1tn8.js.gz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ye,ut,D,ze,H,n,l,Q,Tr,U,S,i,ne,s,y,Je,_e,T,nt,R,N,q,ae,ke,pe,Re,c,ce,ot,Pr,kr,Rr,Xt,Zt,Z,er,tr,oe}from"./chunk-0nxcbf6d.js";import"./chunk-m1w7f6d3.js";import"./chunk-w430z452.js";import{Wi}from"./chunk-bdr1170y.js";import{vo,dr,hi,Rt,fi,Gr,gi,Wt,C,yi,Ct,Ht,Rn,_o,bi,Cn,In,qt,zr,Mn,Ln,On,Nn,Dn,Un,Si,Ao,Eo,To,Po,ko,Ro,Co,Io,yt,jr,wi,Mo,Lo,Oo,No,Do,Uo,P,ye,Qe,Gt}from"./chunk-2q3tewbg.js";import{gt}from"./chunk-y16fqzad.js";import{gr}from"./chunk-sqfs6z7c.js";import{De,Vt,_r,Ar,Er,L,v}from"./chunk-cte9wd9x.js";import{Xe,t,m,Vi,Ki,is,Le}from"./chunk-rmy489b1.js";import{a,r,u}from"./chunk-sfwy8rqg.js";var Ni=r(function(Tf){Object.defineProperty(Tf,"__esModule",{value:!0});Tf.regexpCode=Tf.getEsmExportName=Tf.getProperty=Tf.safeStringify=Tf.stringify=Tf.strConcat=Tf.addCodeArg=Tf.str=Tf._=Tf.nil=Tf._Code=Tf.Name=Tf.IDENTIFIER=Tf._CodeOrName=void 0;class Qo{}Tf._CodeOrName=Qo;Tf.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class vn extends Qo{constructor(e){super();if(!Tf.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Tf.Name=vn;class Or extends Qo{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((o,d)=>`${o}${d}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((o,d)=>{if(d instanceof vn)o[d.str]=(o[d.str]||0)+1;return o},{})}}Tf._Code=Or;Tf.nil=new Or("");function xf(e,...o){let d=[e[0]],h=0;while(h<o.length)Tl(d,o[h]),d.push(e[++h]);return new Or(d)}Tf._=xf;var El=new Or("+");function Ef(e,...o){let d=[qi(e[0])],h=0;while(h<o.length)d.push(El),Tl(d,o[h]),d.push(El,qi(e[++h]));return Jk(d),new Or(d)}Tf.str=Ef;function Tl(e,o){if(o instanceof Or)e.push(...o._items);else if(o instanceof vn)e.push(o);else e.push(Yk(o))}Tf.addCodeArg=Tl;function Jk(e){let o=1;while(o<e.length-1){if(e[o]===El){let d=Xk(e[o-1],e[o+1]);if(d!==void 0){e.splice(o-1,3,d);continue}e[o++]="+"}o++}}function Xk(e,o){if(o==='""')return e;if(e==='""')return o;if(typeof e=="string"){if(o instanceof vn||e[e.length-1]!=='"')return;if(typeof o!="string")return`${e.slice(0,-1)}${o}"`;if(o[0]==='"')return e.slice(0,-1)+o.slice(1);return}if(typeof o=="string"&&o[0]==='"'&&!(e instanceof vn))return`"${e}${o.slice(1)}`;return}function Qk(e,o){return o.emptyStr()?e:e.emptyStr()?o:Ef`${e}${o}`}Tf.strConcat=Qk;function Yk(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:qi(Array.isArray(e)?e.join(","):e)}function Zk(e){return new Or(qi(e))}Tf.stringify=Zk;function qi(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Tf.safeStringify=qi;function ex(e){return typeof e=="string"&&Tf.IDENTIFIER.test(e)?new Or(`.${e}`):xf`[${e}]`}Tf.getProperty=ex;function tx(e){if(typeof e=="string"&&Tf.IDENTIFIER.test(e))return new Or(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Tf.getEsmExportName=tx;function rx(e){return new Or(e.toString())}Tf.regexpCode=rx});var Il=r(function(If){Object.defineProperty(If,"__esModule",{value:!0});If.ValueScope=If.ValueScopeName=If.Scope=If.varKinds=If.UsedValueState=void 0;var at=Ni();class Rf extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Zo;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Zo||(If.UsedValueState=Zo={}));If.varKinds={const:new at.Name("const"),let:new at.Name("let"),var:new at.Name("var")};class Rl{constructor({prefixes:e,parent:o}={}){this._names={},this._prefixes=e,this._parent=o}toName(e){return e instanceof at.Name?e:this.name(e)}name(e){return new at.Name(this._newName(e))}_newName(e){let o=this._names[e]||this._nameGroup(e);return`${e}${o.index++}`}_nameGroup(e){var o,d;if(((d=(o=this._parent)===null||o===void 0?void 0:o._prefixes)===null||d===void 0?void 0:d.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}If.Scope=Rl;class Al extends at.Name{constructor(e,o){super(o);this.prefix=e}setValue(e,{property:o,itemIndex:d}){this.value=e,this.scopePath=at._`.${new at.Name(o)}[${d}]`}}If.ValueScopeName=Al;var mx=at._`\n`;class Af extends Rl{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?mx:at.nil}}get(){return this._scope}name(e){return new Al(e,this._newName(e))}value(e,o){var d;if(o.ref===void 0)throw Error("CodeGen: ref must be passed in value");let h=this.toName(e),{prefix:p}=h,g=(d=o.key)!==null&&d!==void 0?d:o.ref,b=this._values[p];if(b){let _=b.get(g);if(_)return _}else b=this._values[p]=new Map;b.set(g,h);let f=this._scope[p]||(this._scope[p]=[]),w=f.length;return f[w]=o.ref,h.setValue(o,{property:p,itemIndex:w}),h}getValue(e,o){let d=this._values[e];if(!d)return;return d.get(o)}scopeRefs(e,o=this._values){return this._reduceValues(o,(d)=>{if(d.scopePath===void 0)throw Error(`CodeGen: name "${d}" has no value`);return at._`${e}${d.scopePath}`})}scopeCode(e=this._values,o,d){return this._reduceValues(e,(h)=>{if(h.value===void 0)throw Error(`CodeGen: name "${h}" has no value`);return h.value.code},o,d)}_reduceValues(e,o,d={},h){let p=at.nil;for(let g in e){let b=e[g];if(!b)continue;let f=d[g]=d[g]||new Map;b.forEach((w)=>{if(f.has(w))return;f.set(w,Zo.Started);let _=o(w);if(_){let k=this.opts.es5?If.varKinds.var:If.varKinds.const;p=at._`${p}${k} ${w} = ${_};${this.opts._n}`}else if(_=h===null||h===void 0?void 0:h(w))p=at._`${p}${_}${this.opts._n}`;else throw new Rf(w);f.set(w,Zo.Completed)})}return p}}If.ValueScope=Af});var Ve=r(function(ir){Object.defineProperty(ir,"__esModule",{value:!0});ir.or=ir.and=ir.not=ir.CodeGen=ir.operators=ir.varKinds=ir.ValueScopeName=ir.ValueScope=ir.Scope=ir.Name=ir.regexpCode=ir.stringify=ir.getProperty=ir.nil=ir.strConcat=ir.str=ir._=void 0;var Ie=Ni(),kt=Il(),vs=Ni();Object.defineProperty(ir,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(ir,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(ir,"strConcat",{enumerable:!0,get:function(){return vs.strConcat}});Object.defineProperty(ir,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(ir,"getProperty",{enumerable:!0,get:function(){return vs.getProperty}});Object.defineProperty(ir,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(ir,"regexpCode",{enumerable:!0,get:function(){return vs.regexpCode}});Object.defineProperty(ir,"Name",{enumerable:!0,get:function(){return vs.Name}});var ia=Il();Object.defineProperty(ir,"Scope",{enumerable:!0,get:function(){return ia.Scope}});Object.defineProperty(ir,"ValueScope",{enumerable:!0,get:function(){return ia.ValueScope}});Object.defineProperty(ir,"ValueScopeName",{enumerable:!0,get:function(){return ia.ValueScopeName}});Object.defineProperty(ir,"varKinds",{enumerable:!0,get:function(){return ia.varKinds}});ir.operators={GT:new Ie._Code(">"),GTE:new Ie._Code(">="),LT:new Ie._Code("<"),LTE:new Ie._Code("<="),EQ:new Ie._Code("==="),NEQ:new Ie._Code("!=="),NOT:new Ie._Code("!"),OR:new Ie._Code("||"),AND:new Ie._Code("&&"),ADD:new Ie._Code("+")};class Ss{optimizeNodes(){return this}optimizeNames(e,o){return this}}class Df extends Ss{constructor(e,o,d){super();this.varKind=e,this.name=o,this.rhs=d}render({es5:e,_n:o}){let d=e?kt.varKinds.var:this.varKind,h=this.rhs===void 0?"":` = ${this.rhs}`;return`${d} ${this.name}${h};`+o}optimizeNames(e,o){if(!e[this.name.str])return;if(this.rhs)this.rhs=kn(this.rhs,e,o);return this}get names(){return this.rhs instanceof Ie._CodeOrName?this.rhs.names:{}}}class Ol extends Ss{constructor(e,o,d){super();this.lhs=e,this.rhs=o,this.sideEffects=d}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,o){if(this.lhs instanceof Ie.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=kn(this.rhs,e,o),this}get names(){let e=this.lhs instanceof Ie.Name?{}:{...this.lhs.names};return na(e,this.rhs)}}class Of extends Ol{constructor(e,o,d,h){super(e,d,h);this.op=o}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Mf extends Ss{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class $f extends Ss{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Lf extends Ss{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class qf extends Ss{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,o){return this.code=kn(this.code,e,o),this}get names(){return this.code instanceof Ie._CodeOrName?this.code.names:{}}}class oa extends Ss{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((o,d)=>o+d.render(e),"")}optimizeNodes(){let{nodes:e}=this,o=e.length;while(o--){let d=e[o].optimizeNodes();if(Array.isArray(d))e.splice(o,1,...d);else if(d)e[o]=d;else e.splice(o,1)}return e.length>0?this:void 0}optimizeNames(e,o){let{nodes:d}=this,h=d.length;while(h--){let p=d[h];if(p.optimizeNames(e,o))continue;wx(e,p.names),d.splice(h,1)}return d.length>0?this:void 0}get names(){return this.nodes.reduce((e,o)=>Xs(e,o.names),{})}}class ks extends oa{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Nf extends oa{}class ji extends ks{}ji.kind="else";class us extends ks{constructor(e,o){super(o);this.condition=e}render(e){let o=`if(${this.condition})`+super.render(e);if(this.else)o+="else "+this.else.render(e);return o}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let o=this.else;if(o){let d=o.optimizeNodes();o=this.else=Array.isArray(d)?new ji(d):d}if(o){if(e===!1)return o instanceof us?o:o.nodes;if(this.nodes.length)return this;return new us(Hf(e),o instanceof us?[o]:o.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,o){var d;if(this.else=(d=this.else)===null||d===void 0?void 0:d.optimizeNames(e,o),!(super.optimizeNames(e,o)||this.else))return;return this.condition=kn(this.condition,e,o),this}get names(){let e=super.names;if(na(e,this.condition),this.else)Xs(e,this.else.names);return e}}us.kind="if";class Sn extends ks{}Sn.kind="for";class jf extends Sn{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iteration=kn(this.iteration,e,o),this}get names(){return Xs(super.names,this.iteration.names)}}class Bf extends Sn{constructor(e,o,d,h){super();this.varKind=e,this.name=o,this.from=d,this.to=h}render(e){let o=e.es5?kt.varKinds.var:this.varKind,{name:d,from:h,to:p}=this;return`for(${o} ${d}=${h}; ${d}<${p}; ${d}++)`+super.render(e)}get names(){let e=na(super.names,this.from);return na(e,this.to)}}class Pl extends Sn{constructor(e,o,d,h){super();this.loop=e,this.varKind=o,this.name=d,this.iterable=h}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iterable=kn(this.iterable,e,o),this}get names(){return Xs(super.names,this.iterable.names)}}class ea extends ks{constructor(e,o,d){super();this.name=e,this.args=o,this.async=d}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ea.kind="func";class ta extends oa{render(e){return"return "+super.render(e)}}ta.kind="return";class Uf extends ks{render(e){let o="try"+super.render(e);if(this.catch)o+=this.catch.render(e);if(this.finally)o+=this.finally.render(e);return o}optimizeNodes(){var e,o;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(o=this.finally)===null||o===void 0||o.optimizeNodes(),this}optimizeNames(e,o){var d,h;return super.optimizeNames(e,o),(d=this.catch)===null||d===void 0||d.optimizeNames(e,o),(h=this.finally)===null||h===void 0||h.optimizeNames(e,o),this}get names(){let e=super.names;if(this.catch)Xs(e,this.catch.names);if(this.finally)Xs(e,this.finally.names);return e}}class ra extends ks{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ra.kind="catch";class sa extends ks{render(e){return"finally"+super.render(e)}}sa.kind="finally";class Ff{constructor(e,o={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...o,_n:o.lines?`
|
|
2
|
+
import{Ye,ut,D,ze,H,n,l,Q,Tr,U,S,i,ne,s,y,Je,_e,T,nt,R,N,q,ae,ke,pe,Re,c,ce,ot,Pr,kr,Rr,Xt,Zt,Z,er,tr,oe}from"./chunk-pjv9mppd.js";import"./chunk-m1w7f6d3.js";import"./chunk-w430z452.js";import{Wi}from"./chunk-2c6seev1.js";import{vo,dr,hi,Rt,fi,Gr,gi,Wt,C,yi,Ct,Ht,Rn,_o,bi,Cn,In,qt,zr,Mn,Ln,On,Nn,Dn,Un,Si,Ao,Eo,To,Po,ko,Ro,Co,Io,yt,jr,wi,Mo,Lo,Oo,No,Do,Uo,P,ye,Qe,Gt}from"./chunk-2q3tewbg.js";import{gt}from"./chunk-9fccgczj.js";import{gr}from"./chunk-sqfs6z7c.js";import{De,Vt,_r,Ar,Er,L,v}from"./chunk-g23dnf4y.js";import{Xe,t,m,Vi,Ki,is,Le}from"./chunk-rmy489b1.js";import{a,r,u}from"./chunk-sfwy8rqg.js";var Ni=r(function(Tf){Object.defineProperty(Tf,"__esModule",{value:!0});Tf.regexpCode=Tf.getEsmExportName=Tf.getProperty=Tf.safeStringify=Tf.stringify=Tf.strConcat=Tf.addCodeArg=Tf.str=Tf._=Tf.nil=Tf._Code=Tf.Name=Tf.IDENTIFIER=Tf._CodeOrName=void 0;class Qo{}Tf._CodeOrName=Qo;Tf.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class vn extends Qo{constructor(e){super();if(!Tf.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Tf.Name=vn;class Or extends Qo{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((o,d)=>`${o}${d}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((o,d)=>{if(d instanceof vn)o[d.str]=(o[d.str]||0)+1;return o},{})}}Tf._Code=Or;Tf.nil=new Or("");function xf(e,...o){let d=[e[0]],h=0;while(h<o.length)Tl(d,o[h]),d.push(e[++h]);return new Or(d)}Tf._=xf;var El=new Or("+");function Ef(e,...o){let d=[qi(e[0])],h=0;while(h<o.length)d.push(El),Tl(d,o[h]),d.push(El,qi(e[++h]));return Jk(d),new Or(d)}Tf.str=Ef;function Tl(e,o){if(o instanceof Or)e.push(...o._items);else if(o instanceof vn)e.push(o);else e.push(Yk(o))}Tf.addCodeArg=Tl;function Jk(e){let o=1;while(o<e.length-1){if(e[o]===El){let d=Xk(e[o-1],e[o+1]);if(d!==void 0){e.splice(o-1,3,d);continue}e[o++]="+"}o++}}function Xk(e,o){if(o==='""')return e;if(e==='""')return o;if(typeof e=="string"){if(o instanceof vn||e[e.length-1]!=='"')return;if(typeof o!="string")return`${e.slice(0,-1)}${o}"`;if(o[0]==='"')return e.slice(0,-1)+o.slice(1);return}if(typeof o=="string"&&o[0]==='"'&&!(e instanceof vn))return`"${e}${o.slice(1)}`;return}function Qk(e,o){return o.emptyStr()?e:e.emptyStr()?o:Ef`${e}${o}`}Tf.strConcat=Qk;function Yk(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:qi(Array.isArray(e)?e.join(","):e)}function Zk(e){return new Or(qi(e))}Tf.stringify=Zk;function qi(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Tf.safeStringify=qi;function ex(e){return typeof e=="string"&&Tf.IDENTIFIER.test(e)?new Or(`.${e}`):xf`[${e}]`}Tf.getProperty=ex;function tx(e){if(typeof e=="string"&&Tf.IDENTIFIER.test(e))return new Or(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Tf.getEsmExportName=tx;function rx(e){return new Or(e.toString())}Tf.regexpCode=rx});var Il=r(function(If){Object.defineProperty(If,"__esModule",{value:!0});If.ValueScope=If.ValueScopeName=If.Scope=If.varKinds=If.UsedValueState=void 0;var at=Ni();class Rf extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Zo;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Zo||(If.UsedValueState=Zo={}));If.varKinds={const:new at.Name("const"),let:new at.Name("let"),var:new at.Name("var")};class Rl{constructor({prefixes:e,parent:o}={}){this._names={},this._prefixes=e,this._parent=o}toName(e){return e instanceof at.Name?e:this.name(e)}name(e){return new at.Name(this._newName(e))}_newName(e){let o=this._names[e]||this._nameGroup(e);return`${e}${o.index++}`}_nameGroup(e){var o,d;if(((d=(o=this._parent)===null||o===void 0?void 0:o._prefixes)===null||d===void 0?void 0:d.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}If.Scope=Rl;class Al extends at.Name{constructor(e,o){super(o);this.prefix=e}setValue(e,{property:o,itemIndex:d}){this.value=e,this.scopePath=at._`.${new at.Name(o)}[${d}]`}}If.ValueScopeName=Al;var mx=at._`\n`;class Af extends Rl{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?mx:at.nil}}get(){return this._scope}name(e){return new Al(e,this._newName(e))}value(e,o){var d;if(o.ref===void 0)throw Error("CodeGen: ref must be passed in value");let h=this.toName(e),{prefix:p}=h,g=(d=o.key)!==null&&d!==void 0?d:o.ref,b=this._values[p];if(b){let _=b.get(g);if(_)return _}else b=this._values[p]=new Map;b.set(g,h);let f=this._scope[p]||(this._scope[p]=[]),w=f.length;return f[w]=o.ref,h.setValue(o,{property:p,itemIndex:w}),h}getValue(e,o){let d=this._values[e];if(!d)return;return d.get(o)}scopeRefs(e,o=this._values){return this._reduceValues(o,(d)=>{if(d.scopePath===void 0)throw Error(`CodeGen: name "${d}" has no value`);return at._`${e}${d.scopePath}`})}scopeCode(e=this._values,o,d){return this._reduceValues(e,(h)=>{if(h.value===void 0)throw Error(`CodeGen: name "${h}" has no value`);return h.value.code},o,d)}_reduceValues(e,o,d={},h){let p=at.nil;for(let g in e){let b=e[g];if(!b)continue;let f=d[g]=d[g]||new Map;b.forEach((w)=>{if(f.has(w))return;f.set(w,Zo.Started);let _=o(w);if(_){let k=this.opts.es5?If.varKinds.var:If.varKinds.const;p=at._`${p}${k} ${w} = ${_};${this.opts._n}`}else if(_=h===null||h===void 0?void 0:h(w))p=at._`${p}${_}${this.opts._n}`;else throw new Rf(w);f.set(w,Zo.Completed)})}return p}}If.ValueScope=Af});var Ve=r(function(ir){Object.defineProperty(ir,"__esModule",{value:!0});ir.or=ir.and=ir.not=ir.CodeGen=ir.operators=ir.varKinds=ir.ValueScopeName=ir.ValueScope=ir.Scope=ir.Name=ir.regexpCode=ir.stringify=ir.getProperty=ir.nil=ir.strConcat=ir.str=ir._=void 0;var Ie=Ni(),kt=Il(),vs=Ni();Object.defineProperty(ir,"_",{enumerable:!0,get:function(){return vs._}});Object.defineProperty(ir,"str",{enumerable:!0,get:function(){return vs.str}});Object.defineProperty(ir,"strConcat",{enumerable:!0,get:function(){return vs.strConcat}});Object.defineProperty(ir,"nil",{enumerable:!0,get:function(){return vs.nil}});Object.defineProperty(ir,"getProperty",{enumerable:!0,get:function(){return vs.getProperty}});Object.defineProperty(ir,"stringify",{enumerable:!0,get:function(){return vs.stringify}});Object.defineProperty(ir,"regexpCode",{enumerable:!0,get:function(){return vs.regexpCode}});Object.defineProperty(ir,"Name",{enumerable:!0,get:function(){return vs.Name}});var ia=Il();Object.defineProperty(ir,"Scope",{enumerable:!0,get:function(){return ia.Scope}});Object.defineProperty(ir,"ValueScope",{enumerable:!0,get:function(){return ia.ValueScope}});Object.defineProperty(ir,"ValueScopeName",{enumerable:!0,get:function(){return ia.ValueScopeName}});Object.defineProperty(ir,"varKinds",{enumerable:!0,get:function(){return ia.varKinds}});ir.operators={GT:new Ie._Code(">"),GTE:new Ie._Code(">="),LT:new Ie._Code("<"),LTE:new Ie._Code("<="),EQ:new Ie._Code("==="),NEQ:new Ie._Code("!=="),NOT:new Ie._Code("!"),OR:new Ie._Code("||"),AND:new Ie._Code("&&"),ADD:new Ie._Code("+")};class Ss{optimizeNodes(){return this}optimizeNames(e,o){return this}}class Df extends Ss{constructor(e,o,d){super();this.varKind=e,this.name=o,this.rhs=d}render({es5:e,_n:o}){let d=e?kt.varKinds.var:this.varKind,h=this.rhs===void 0?"":` = ${this.rhs}`;return`${d} ${this.name}${h};`+o}optimizeNames(e,o){if(!e[this.name.str])return;if(this.rhs)this.rhs=kn(this.rhs,e,o);return this}get names(){return this.rhs instanceof Ie._CodeOrName?this.rhs.names:{}}}class Ol extends Ss{constructor(e,o,d){super();this.lhs=e,this.rhs=o,this.sideEffects=d}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,o){if(this.lhs instanceof Ie.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=kn(this.rhs,e,o),this}get names(){let e=this.lhs instanceof Ie.Name?{}:{...this.lhs.names};return na(e,this.rhs)}}class Of extends Ol{constructor(e,o,d,h){super(e,d,h);this.op=o}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Mf extends Ss{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class $f extends Ss{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Lf extends Ss{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class qf extends Ss{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,o){return this.code=kn(this.code,e,o),this}get names(){return this.code instanceof Ie._CodeOrName?this.code.names:{}}}class oa extends Ss{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((o,d)=>o+d.render(e),"")}optimizeNodes(){let{nodes:e}=this,o=e.length;while(o--){let d=e[o].optimizeNodes();if(Array.isArray(d))e.splice(o,1,...d);else if(d)e[o]=d;else e.splice(o,1)}return e.length>0?this:void 0}optimizeNames(e,o){let{nodes:d}=this,h=d.length;while(h--){let p=d[h];if(p.optimizeNames(e,o))continue;wx(e,p.names),d.splice(h,1)}return d.length>0?this:void 0}get names(){return this.nodes.reduce((e,o)=>Xs(e,o.names),{})}}class ks extends oa{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Nf extends oa{}class ji extends ks{}ji.kind="else";class us extends ks{constructor(e,o){super(o);this.condition=e}render(e){let o=`if(${this.condition})`+super.render(e);if(this.else)o+="else "+this.else.render(e);return o}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let o=this.else;if(o){let d=o.optimizeNodes();o=this.else=Array.isArray(d)?new ji(d):d}if(o){if(e===!1)return o instanceof us?o:o.nodes;if(this.nodes.length)return this;return new us(Hf(e),o instanceof us?[o]:o.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,o){var d;if(this.else=(d=this.else)===null||d===void 0?void 0:d.optimizeNames(e,o),!(super.optimizeNames(e,o)||this.else))return;return this.condition=kn(this.condition,e,o),this}get names(){let e=super.names;if(na(e,this.condition),this.else)Xs(e,this.else.names);return e}}us.kind="if";class Sn extends ks{}Sn.kind="for";class jf extends Sn{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iteration=kn(this.iteration,e,o),this}get names(){return Xs(super.names,this.iteration.names)}}class Bf extends Sn{constructor(e,o,d,h){super();this.varKind=e,this.name=o,this.from=d,this.to=h}render(e){let o=e.es5?kt.varKinds.var:this.varKind,{name:d,from:h,to:p}=this;return`for(${o} ${d}=${h}; ${d}<${p}; ${d}++)`+super.render(e)}get names(){let e=na(super.names,this.from);return na(e,this.to)}}class Pl extends Sn{constructor(e,o,d,h){super();this.loop=e,this.varKind=o,this.name=d,this.iterable=h}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,o){if(!super.optimizeNames(e,o))return;return this.iterable=kn(this.iterable,e,o),this}get names(){return Xs(super.names,this.iterable.names)}}class ea extends ks{constructor(e,o,d){super();this.name=e,this.args=o,this.async=d}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ea.kind="func";class ta extends oa{render(e){return"return "+super.render(e)}}ta.kind="return";class Uf extends ks{render(e){let o="try"+super.render(e);if(this.catch)o+=this.catch.render(e);if(this.finally)o+=this.finally.render(e);return o}optimizeNodes(){var e,o;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(o=this.finally)===null||o===void 0||o.optimizeNodes(),this}optimizeNames(e,o){var d,h;return super.optimizeNames(e,o),(d=this.catch)===null||d===void 0||d.optimizeNames(e,o),(h=this.finally)===null||h===void 0||h.optimizeNames(e,o),this}get names(){let e=super.names;if(this.catch)Xs(e,this.catch.names);if(this.finally)Xs(e,this.finally.names);return e}}class ra extends ks{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ra.kind="catch";class sa extends ks{render(e){return"finally"+super.render(e)}}sa.kind="finally";class Ff{constructor(e,o={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...o,_n:o.lines?`
|
|
3
3
|
`:""},this._extScope=e,this._scope=new kt.Scope({parent:e}),this._nodes=[new Nf]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,o){let d=this._extScope.value(e,o);return(this._values[d.prefix]||(this._values[d.prefix]=new Set)).add(d),d}getScopeValue(e,o){return this._extScope.getValue(e,o)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,o,d,h){let p=this._scope.toName(o);if(d!==void 0&&h)this._constants[p.str]=d;return this._leafNode(new Df(e,p,d)),p}const(e,o,d){return this._def(kt.varKinds.const,e,o,d)}let(e,o,d){return this._def(kt.varKinds.let,e,o,d)}var(e,o,d){return this._def(kt.varKinds.var,e,o,d)}assign(e,o,d){return this._leafNode(new Ol(e,o,d))}add(e,o){return this._leafNode(new Of(e,ir.operators.ADD,o))}code(e){if(typeof e=="function")e();else if(e!==Ie.nil)this._leafNode(new qf(e));return this}object(...e){let o=["{"];for(let[d,h]of e){if(o.length>1)o.push(",");if(o.push(d),d!==h||this.opts.es5)o.push(":"),Ie.addCodeArg(o,h)}return o.push("}"),new Ie._Code(o)}if(e,o,d){if(this._blockNode(new us(e)),o&&d)this.code(o).else().code(d).endIf();else if(o)this.code(o).endIf();else if(d)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new us(e))}else(){return this._elseNode(new ji)}endIf(){return this._endBlockNode(us,ji)}_for(e,o){if(this._blockNode(e),o)this.code(o).endFor();return this}for(e,o){return this._for(new jf(e),o)}forRange(e,o,d,h,p=this.opts.es5?kt.varKinds.var:kt.varKinds.let){let g=this._scope.toName(e);return this._for(new Bf(p,g,o,d),()=>h(g))}forOf(e,o,d,h=kt.varKinds.const){let p=this._scope.toName(e);if(this.opts.es5){let g=o instanceof Ie.Name?o:this.var("_arr",o);return this.forRange("_i",0,Ie._`${g}.length`,(b)=>{this.var(p,Ie._`${g}[${b}]`),d(p)})}return this._for(new Pl("of",h,p,o),()=>d(p))}forIn(e,o,d,h=this.opts.es5?kt.varKinds.var:kt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,Ie._`Object.keys(${o})`,d);let p=this._scope.toName(e);return this._for(new Pl("in",h,p,o),()=>d(p))}endFor(){return this._endBlockNode(Sn)}label(e){return this._leafNode(new Mf(e))}break(e){return this._leafNode(new $f(e))}return(e){let o=new ta;if(this._blockNode(o),this.code(e),o.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ta)}try(e,o,d){if(!o&&!d)throw Error('CodeGen: "try" without "catch" and "finally"');let h=new Uf;if(this._blockNode(h),this.code(e),o){let p=this.name("e");this._currNode=h.catch=new ra(p),o(p)}if(d)this._currNode=h.finally=new sa,this.code(d);return this._endBlockNode(ra,sa)}throw(e){return this._leafNode(new Lf(e))}block(e,o){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(o);return this}endBlock(e){let o=this._blockStarts.pop();if(o===void 0)throw Error("CodeGen: not in self-balancing block");let d=this._nodes.length-o;if(d<0||e!==void 0&&d!==e)throw Error(`CodeGen: wrong number of nodes: ${d} vs ${e} expected`);return this._nodes.length=o,this}func(e,o=Ie.nil,d,h){if(this._blockNode(new ea(e,o,d)),h)this.code(h).endFunc();return this}endFunc(){return this._endBlockNode(ea)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,o){let d=this._currNode;if(d instanceof e||o&&d instanceof o)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${o?`${e.kind}/${o.kind}`:e.kind}"`)}_elseNode(e){let o=this._currNode;if(!(o instanceof us))throw Error('CodeGen: "else" without "if"');return this._currNode=o.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let o=this._nodes;o[o.length-1]=e}}ir.CodeGen=Ff;function Xs(e,o){for(let d in o)e[d]=(e[d]||0)+(o[d]||0);return e}function na(e,o){return o instanceof Ie._CodeOrName?Xs(e,o.names):e}function kn(e,o,d){if(e instanceof Ie.Name)return h(e);if(!p(e))return e;return new Ie._Code(e._items.reduce((g,b)=>{if(b instanceof Ie.Name)b=h(b);if(b instanceof Ie._Code)g.push(...b._items);else g.push(b);return g},[]));function h(g){let b=d[g.str];if(b===void 0||o[g.str]!==1)return g;return delete o[g.str],b}function p(g){return g instanceof Ie._Code&&g._items.some((b)=>b instanceof Ie.Name&&o[b.str]===1&&d[b.str]!==void 0)}}function wx(e,o){for(let d in o)e[d]=(e[d]||0)-(o[d]||0)}function Hf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:Ie._`!${Dl(e)}`}ir.not=Hf;var _x=Wf(ir.operators.AND);function vx(...e){return e.reduce(_x)}ir.and=vx;var Sx=Wf(ir.operators.OR);function kx(...e){return e.reduce(Sx)}ir.or=kx;function Wf(e){return(o,d)=>o===Ie.nil?d:d===Ie.nil?o:Ie._`${Dl(o)} ${e} ${Dl(d)}`}function Dl(e){return e instanceof Ie.Name?e:Ie._`(${e})`}});var Ke=r(function(em){Object.defineProperty(em,"__esModule",{value:!0});em.checkStrictMode=em.getErrorPath=em.Type=em.useFunc=em.setEvaluated=em.evaluatedPropsToName=em.mergeEvaluated=em.eachItem=em.unescapeJsonPointer=em.escapeJsonPointer=em.escapeFragment=em.unescapeFragment=em.schemaRefOrVal=em.schemaHasRulesButRef=em.schemaHasRules=em.checkUnknownRules=em.alwaysValidSchema=em.toHash=void 0;var $e=Ve(),Kf=Ni();function Cx(e){let o={};for(let d of e)o[d]=!0;return o}em.toHash=Cx;function Rx(e,o){if(typeof o=="boolean")return o;if(Object.keys(o).length===0)return!0;return Jf(e,o),!Xf(o,e.self.RULES.all)}em.alwaysValidSchema=Rx;function Jf(e,o=e.schema){let{opts:d,self:h}=e;if(!d.strictSchema)return;if(typeof o==="boolean")return;let p=h.RULES.keywords;for(let g in o)if(!p[g])Zf(e,`unknown keyword: "${g}"`)}em.checkUnknownRules=Jf;function Xf(e,o){if(typeof e=="boolean")return!e;for(let d in e)if(o[d])return!0;return!1}em.schemaHasRules=Xf;function Ax(e,o){if(typeof e=="boolean")return!e;for(let d in e)if(d!=="$ref"&&o.all[d])return!0;return!1}em.schemaHasRulesButRef=Ax;function Ix({topSchemaRef:e,schemaPath:o},d,h,p){if(!p){if(typeof d=="number"||typeof d=="boolean")return d;if(typeof d=="string")return $e._`${d}`}return $e._`${e}${o}${$e.getProperty(h)}`}em.schemaRefOrVal=Ix;function Px(e){return Qf(decodeURIComponent(e))}em.unescapeFragment=Px;function Dx(e){return encodeURIComponent($l(e))}em.escapeFragment=Dx;function $l(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}em.escapeJsonPointer=$l;function Qf(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}em.unescapeJsonPointer=Qf;function Ox(e,o){if(Array.isArray(e))for(let d of e)o(d);else o(e)}em.eachItem=Ox;function Vf({mergeNames:e,mergeToName:o,mergeValues:d,resultToName:h}){return(p,g,b,f)=>{let w=b===void 0?g:b instanceof $e.Name?(g instanceof $e.Name?e(p,g,b):o(p,g,b),b):g instanceof $e.Name?(o(p,b,g),g):d(g,b);return f===$e.Name&&!(w instanceof $e.Name)?h(p,w):w}}em.mergeEvaluated={props:Vf({mergeNames:(e,o,d)=>e.if($e._`${d} !== true && ${o} !== undefined`,()=>{e.if($e._`${o} === true`,()=>e.assign(d,!0),()=>e.assign(d,$e._`${d} || {}`).code($e._`Object.assign(${d}, ${o})`))}),mergeToName:(e,o,d)=>e.if($e._`${d} !== true`,()=>{if(o===!0)e.assign(d,!0);else e.assign(d,$e._`${d} || {}`),Ll(e,d,o)}),mergeValues:(e,o)=>e===!0?!0:{...e,...o},resultToName:Yf}),items:Vf({mergeNames:(e,o,d)=>e.if($e._`${d} !== true && ${o} !== undefined`,()=>e.assign(d,$e._`${o} === true ? true : ${d} > ${o} ? ${d} : ${o}`)),mergeToName:(e,o,d)=>e.if($e._`${d} !== true`,()=>e.assign(d,o===!0?!0:$e._`${d} > ${o} ? ${d} : ${o}`)),mergeValues:(e,o)=>e===!0?!0:Math.max(e,o),resultToName:(e,o)=>e.var("items",o)})};function Yf(e,o){if(o===!0)return e.var("props",!0);let d=e.var("props",$e._`{}`);if(o!==void 0)Ll(e,d,o);return d}em.evaluatedPropsToName=Yf;function Ll(e,o,d){Object.keys(d).forEach((h)=>e.assign($e._`${o}${$e.getProperty(h)}`,!0))}em.setEvaluated=Ll;var Gf={};function Mx(e,o){return e.scopeValue("func",{ref:o,code:Gf[o.code]||(Gf[o.code]=new Kf._Code(o.code))})}em.useFunc=Mx;var Ml;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ml||(em.Type=Ml={}));function $x(e,o,d){if(e instanceof $e.Name){let h=o===Ml.Num;return d?h?$e._`"[" + ${e} + "]"`:$e._`"['" + ${e} + "']"`:h?$e._`"/" + ${e}`:$e._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return d?$e.getProperty(e).toString():"/"+$l(e)}em.getErrorPath=$x;function Zf(e,o,d=e.opts.strictSchema){if(!d)return;if(o=`strict mode: ${o}`,d===!0)throw Error(o);e.self.logger.warn(o)}em.checkStrictMode=Zf});var ds=r(function(rm){Object.defineProperty(rm,"__esModule",{value:!0});var et=Ve(),Zx={data:new et.Name("data"),valCxt:new et.Name("valCxt"),instancePath:new et.Name("instancePath"),parentData:new et.Name("parentData"),parentDataProperty:new et.Name("parentDataProperty"),rootData:new et.Name("rootData"),dynamicAnchors:new et.Name("dynamicAnchors"),vErrors:new et.Name("vErrors"),errors:new et.Name("errors"),this:new et.Name("this"),self:new et.Name("self"),scope:new et.Name("scope"),json:new et.Name("json"),jsonPos:new et.Name("jsonPos"),jsonLen:new et.Name("jsonLen"),jsonPart:new et.Name("jsonPart")};rm.default=Zx});var Bi=r(function(om){Object.defineProperty(om,"__esModule",{value:!0});om.extendErrors=om.resetErrorsCount=om.reportExtraError=om.reportError=om.keyword$DataError=om.keywordError=void 0;var Pe=Ve(),xs=Ke(),sr=ds();om.keywordError={message:({keyword:e})=>Pe.str`must pass "${e}" keyword validation`};om.keyword$DataError={message:({keyword:e,schemaType:o})=>o?Pe.str`"${e}" keyword must be ${o} ($data)`:Pe.str`"${e}" keyword is invalid ($data)`};function t1(e,o=om.keywordError,d,h){let{it:p}=e,{gen:g,compositeRule:b,allErrors:f}=p,w=im(e,o,d);if(h!==null&&h!==void 0?h:b||f)sm(g,w);else nm(p,Pe._`[${w}]`)}om.reportError=t1;function r1(e,o=om.keywordError,d){let{it:h}=e,{gen:p,compositeRule:g,allErrors:b}=h,f=im(e,o,d);if(sm(p,f),!(g||b))nm(h,sr.default.vErrors)}om.reportExtraError=r1;function s1(e,o){e.assign(sr.default.errors,o),e.if(Pe._`${sr.default.vErrors} !== null`,()=>e.if(o,()=>e.assign(Pe._`${sr.default.vErrors}.length`,o),()=>e.assign(sr.default.vErrors,null)))}om.resetErrorsCount=s1;function n1({gen:e,keyword:o,schemaValue:d,data:h,errsCount:p,it:g}){if(p===void 0)throw Error("ajv implementation error");let b=e.name("err");e.forRange("i",p,sr.default.errors,(f)=>{if(e.const(b,Pe._`${sr.default.vErrors}[${f}]`),e.if(Pe._`${b}.instancePath === undefined`,()=>e.assign(Pe._`${b}.instancePath`,Pe.strConcat(sr.default.instancePath,g.errorPath))),e.assign(Pe._`${b}.schemaPath`,Pe.str`${g.errSchemaPath}/${o}`),g.opts.verbose)e.assign(Pe._`${b}.schema`,d),e.assign(Pe._`${b}.data`,h)})}om.extendErrors=n1;function sm(e,o){let d=e.const("err",o);e.if(Pe._`${sr.default.vErrors} === null`,()=>e.assign(sr.default.vErrors,Pe._`[${d}]`),Pe._`${sr.default.vErrors}.push(${d})`),e.code(Pe._`${sr.default.errors}++`)}function nm(e,o){let{gen:d,validateName:h,schemaEnv:p}=e;if(p.$async)d.throw(Pe._`new ${e.ValidationError}(${o})`);else d.assign(Pe._`${h}.errors`,o),d.return(!1)}var Qs={keyword:new Pe.Name("keyword"),schemaPath:new Pe.Name("schemaPath"),params:new Pe.Name("params"),propertyName:new Pe.Name("propertyName"),message:new Pe.Name("message"),schema:new Pe.Name("schema"),parentSchema:new Pe.Name("parentSchema")};function im(e,o,d){let{createErrors:h}=e.it;if(h===!1)return Pe._`{}`;return i1(e,o,d)}function i1(e,o,d={}){let{gen:h,it:p}=e,g=[o1(p,d),a1(e,d)];return c1(e,o,g),h.object(...g)}function o1({errorPath:e},{instancePath:o}){let d=o?Pe.str`${e}${xs.getErrorPath(o,xs.Type.Str)}`:e;return[sr.default.instancePath,Pe.strConcat(sr.default.instancePath,d)]}function a1({keyword:e,it:{errSchemaPath:o}},{schemaPath:d,parentSchema:h}){let p=h?o:Pe.str`${o}/${e}`;if(d)p=Pe.str`${p}${xs.getErrorPath(d,xs.Type.Str)}`;return[Qs.schemaPath,p]}function c1(e,{params:o,message:d},h){let{keyword:p,data:g,schemaValue:b,it:f}=e,{opts:w,propertyName:_,topSchemaRef:k,schemaPath:x}=f;if(h.push([Qs.keyword,p],[Qs.params,typeof o=="function"?o(e):o||Pe._`{}`]),w.messages)h.push([Qs.message,typeof d=="function"?d(e):d]);if(w.verbose)h.push([Qs.schema,b],[Qs.parentSchema,Pe._`${k}${x}`],[sr.default.data,g]);if(_)h.push([Qs.propertyName,_])}});var pm=r(function(dm){Object.defineProperty(dm,"__esModule",{value:!0});dm.boolOrEmptySchema=dm.topBoolOrEmptySchema=void 0;var cm=Bi(),lm=Ve(),p1=ds(),f1={message:"boolean schema is false"};function m1(e){let{gen:o,schema:d,validateName:h}=e;if(d===!1)um(e,!1);else if(typeof d=="object"&&d.$async===!0)o.return(p1.default.data);else o.assign(lm._`${h}.errors`,null),o.return(!0)}dm.topBoolOrEmptySchema=m1;function g1(e,o){let{gen:d,schema:h}=e;if(h===!1)d.var(o,!1),um(e);else d.var(o,!0)}dm.boolOrEmptySchema=g1;function um(e,o){let{gen:d,data:h}=e;cm.reportError({gen:d,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},f1,void 0,o)}});var Nl=r(function(fm){Object.defineProperty(fm,"__esModule",{value:!0});fm.getRules=fm.isJSONType=void 0;var b1=["string","number","integer","boolean","null","object","array"],w1=new Set(b1);function _1(e){return typeof e=="string"&&w1.has(e)}fm.isJSONType=_1;function v1(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}fm.getRules=v1});var jl=r(function(bm){Object.defineProperty(bm,"__esModule",{value:!0});bm.shouldUseRule=bm.shouldUseGroup=bm.schemaHasRulesForType=void 0;function k1({schema:e,self:o},d){let h=o.RULES.types[d];return h&&h!==!0&&gm(e,h)}bm.schemaHasRulesForType=k1;function gm(e,o){return o.rules.some((d)=>ym(e,d))}bm.shouldUseGroup=gm;function ym(e,o){var d;return e[o.keyword]!==void 0||((d=o.definition.implements)===null||d===void 0?void 0:d.some((h)=>e[h]!==void 0))}bm.shouldUseRule=ym});var Ui=r(function(Em){Object.defineProperty(Em,"__esModule",{value:!0});Em.reportTypeError=Em.checkDataTypes=Em.checkDataType=Em.coerceAndCheckDataType=Em.getJSONTypes=Em.getSchemaTypes=Em.DataType=void 0;var _m=Nl(),vm=jl(),Sm=Bi(),Ee=Ve(),ca=Ke(),xn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(xn||(Em.DataType=xn={}));function T1(e){let o=km(e.type);if(o.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!o.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)o.push("null")}return o}Em.getSchemaTypes=T1;function km(e){let o=Array.isArray(e)?e:e?[e]:[];if(o.every(_m.isJSONType))return o;throw Error("type must be JSONType or JSONType[]: "+o.join(","))}Em.getJSONTypes=km;function C1(e,o){let{gen:d,data:h,opts:p}=e,g=R1(o,p.coerceTypes),b=o.length>0&&!(g.length===0&&o.length===1&&vm.schemaHasRulesForType(e,o[0]));if(b){let f=Ul(o,h,p.strictNumbers,xn.Wrong);d.if(f,()=>{if(g.length)A1(e,o,g);else Fl(e)})}return b}Em.coerceAndCheckDataType=C1;var xm=new Set(["string","number","integer","boolean","null"]);function R1(e,o){return o?e.filter((d)=>xm.has(d)||o==="array"&&d==="array"):[]}function A1(e,o,d){let{gen:h,data:p,opts:g}=e,b=h.let("dataType",Ee._`typeof ${p}`),f=h.let("coerced",Ee._`undefined`);if(g.coerceTypes==="array")h.if(Ee._`${b} == 'object' && Array.isArray(${p}) && ${p}.length == 1`,()=>h.assign(p,Ee._`${p}[0]`).assign(b,Ee._`typeof ${p}`).if(Ul(o,p,g.strictNumbers),()=>h.assign(f,p)));h.if(Ee._`${f} !== undefined`);for(let _ of d)if(xm.has(_)||_==="array"&&g.coerceTypes==="array")w(_);h.else(),Fl(e),h.endIf(),h.if(Ee._`${f} !== undefined`,()=>{h.assign(p,f),I1(e,f)});function w(_){switch(_){case"string":h.elseIf(Ee._`${b} == "number" || ${b} == "boolean"`).assign(f,Ee._`"" + ${p}`).elseIf(Ee._`${p} === null`).assign(f,Ee._`""`);return;case"number":h.elseIf(Ee._`${b} == "boolean" || ${p} === null
|
|
4
4
|
|| (${b} == "string" && ${p} && ${p} == +${p})`).assign(f,Ee._`+${p}`);return;case"integer":h.elseIf(Ee._`${b} === "boolean" || ${p} === null
|
|
5
5
|
|| (${b} === "string" && ${p} && ${p} == +${p} && !(${p} % 1))`).assign(f,Ee._`+${p}`);return;case"boolean":h.elseIf(Ee._`${p} === "false" || ${p} === 0 || ${p} === null`).assign(f,!1).elseIf(Ee._`${p} === "true" || ${p} === 1`).assign(f,!0);return;case"null":h.elseIf(Ee._`${p} === "" || ${p} === 0 || ${p} === false`),h.assign(f,null);return;case"array":h.elseIf(Ee._`${b} === "string" || ${b} === "number"
|
|
@@ -2655,8 +2655,8 @@ ${o}
|
|
|
2655
2655
|
|
|
2656
2656
|
Budget: ${d}
|
|
2657
2657
|
|
|
2658
|
-
When the full objective is verified complete with concrete evidence, call \`goal_update\` with \`status: "complete"\`. Only set \`status: "paused"\` at the user's explicit request, or \`status: "blocked"\` after the same impasse repeats for at least three consecutive goal turns.`}var Tk={active:"\u8FDB\u884C\u4E2D",paused:"\u5DF2\u6682\u505C",blocked:"\u53D7\u963B",usage_limited:"\u7528\u91CF\u53D7\u9650",budget_limited:"\u5DF2\u8FBE\u9884\u7B97\u4E0A\u9650",complete:"\u5DF2\u5B8C\u6210"};function tf(e){if(e===void 0||e===null)return null;if(!Number.isSafeInteger(e)||e<1)throw new t("goal budgets must be positive when provided");if(e>Pi)throw new t(`goal token budget ${e} exceeds the maximum allowed goal token budget of ${Pi}`);return e}function rf(e){if(e===void 0||e===null)return null;if(!Number.isSafeInteger(e)||e<1)throw new t("goal time budget must be a positive number of seconds");if(e>Di)throw new t(`goal time budget ${e}s exceeds the maximum allowed time budget of ${Di}s (30 days)`);return e}function sf(e){if(typeof e!=="string"||!e.trim())throw new t("goal objective is required");if(e.length>20000)throw new t("goal objective must be at most 20000 characters");return e.trim()}class Oi{runtime;store;clock;runStartTimes=new Map;accountedSeqs=new Map;dirtyProgressSessions=new Set;budgetNotifiedGoals=new Set;continuationCounts=new Map;work=new Set;owners=0;constructor(e,o,d=De){this.runtime=e;this.store=o;this.clock=d}retain(){return this.owners++,()=>{if(this.owners=Math.max(0,this.owners-1),this.owners===0)this.runStartTimes.clear()}}async idle(){while(this.work.size>0)await Promise.all([...this.work])}requireMainSession(e){let o=this.runtime.get(e);if(!o)throw new m("no such session");if(o.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");return o}get(e){let o=this.store.get(e);return o?ws(o):null}appendStateEntry(e,o,d){let h=ws(o),p={...h,action:d},g=Tk[o.status]??o.status,b=h.tokenBudget!==null?` \xB7 Token ${h.tokensUsed}/${h.tokenBudget}`:` \xB7 Token ${h.tokensUsed}`;this.runtime.store.appendEntry(e.id,void 0,{type:"extension",namespace:"goal",kind:"state",schemaVersion:1,payload:p,display:{title:`\u76EE\u6807 \xB7 ${g}`,text:`${o.objective}${b}`}}),e.refreshEntries()}create(e,o,d,h){if(e.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");e.assertWritable();let p=sf(o),g=rf(d),b=tf(h?.tokenBudget),f=this.store.get(e.id);if(f&&f.status!=="complete"&&!h?.allowReplaceUnfinished)throw new t("cannot create a new goal because this thread has an unfinished goal; complete the existing goal first");let w=this.clock.now(),_={sessionID:e.id,goalID:oe("g"),objective:p,status:"active",timeBudgetSeconds:g,timeUsedSeconds:0,tokenBudget:b,tokensUsed:0,createdAtMs:w,updatedAtMs:w},k=this.store.upsert(_);if(this.accountedSeqs.set(e.id,this.runtime.store.lastSeq(e.id)),this.budgetNotifiedGoals.delete(k.goalID),this.continuationCounts.set(k.goalID,0),!e.info().title.trim()){let x=p.split(`
|
|
2659
|
-
`)[0]?.trim()??"",I=x.length>40?`${x.slice(0,40)}\u2026`:x;if(I)e.rename(I)}if(this.appendStateEntry(e,k,"created"),h?.wakeSession&&e.status==="idle")this.enqueueContinuation(e,k,"start");return ws(k)}updateByTool(e,o){if(e.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");let d=this.store.get(e.id);if(!d)throw new t("cannot update goal because this thread has no goal");if(!["paused","blocked","complete"].includes(o))throw new t("goal_update can only mark the existing goal complete, blocked, or paused at the user's explicit request; resume, budget-limited, and usage-limited status changes are controlled by the user or system");let h=this.accountProgress(e,d);this.dirtyProgressSessions.delete(e.id);let p=o;if(h.status==="budget_limited"&&o==="paused")p="budget_limited";let g=this.store.upsert({...h,status:p,updatedAtMs:this.clock.now()}),b={paused:"paused",blocked:"blocked",complete:"completed"};return this.appendStateEntry(e,g,b[o]),ws(g)}updateByUser(e,o,d){if(e.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");e.assertWritable();let h=this.store.get(e.id);if(!h)throw new t("cannot update goal because this thread has no goal");let p=o.objective!==void 0?sf(o.objective):h.objective,g=o.timeBudgetSeconds!==void 0?rf(o.timeBudgetSeconds):h.timeBudgetSeconds,b=o.tokenBudget!==void 0?tf(o.tokenBudget):h.tokenBudget,f=o.status??h.status,w=g!==null&&h.timeUsedSeconds>=g,_=b!==null&&h.tokensUsed>=b;if(f==="active"&&(w||_))f="budget_limited";else if(h.status==="budget_limited"&&o.status===void 0&&(!g||h.timeUsedSeconds<g)&&(!b||h.tokensUsed<b))f="active";let k=this.clock.now(),x=this.store.upsert({...h,objective:p,timeBudgetSeconds:g,tokenBudget:b,status:f,updatedAtMs:k}),I=p!==h.objective,E=h.status!=="active"&&x.status==="active",M="updated";if(E)M="resumed";else if(x.status==="paused"&&h.status!=="paused")M="paused";else if(x.status==="complete"&&h.status!=="complete")M="completed";else if(x.status==="blocked"&&h.status!=="blocked")M="blocked";else if(x.status==="budget_limited"&&h.status!=="budget_limited")M="budget_limited";if(this.appendStateEntry(e,x,M),x.status==="active")this.budgetNotifiedGoals.delete(x.goalID);else if(x.status==="paused"||x.status==="complete"){let A=this.runtime.children(e.id).filter((O)=>O.status==="busy");for(let O of A)this.runtime.get(O.id)?.abort()}if(I&&x.status==="active"&&e.status==="busy")e.notice({sourceKind:"goal",sourceID:x.goalID,state:"objective_updated",dedupeKey:`goal:objective_updated:${x.goalID}:${k}`,wake:!1,text:Zp(x)});else if(E&&(d?.wakeOnResume??!0)&&e.status==="idle")this.enqueueContinuation(e,x,"resume");return ws(x)}clear(e){e.assertWritable();let o=this.store.get(e.id);if(!o)return!1;return this.store.delete(e.id),this.runStartTimes.delete(e.id),this.accountedSeqs.delete(e.id),this.budgetNotifiedGoals.delete(o.goalID),this.continuationCounts.delete(o.goalID),this.appendStateEntry(e,o,"cleared"),!0}onRunStart(e){if(this.store.get(e.id)?.status!=="active")return;if(this.runStartTimes.set(e.id,this.clock.now()),!this.accountedSeqs.has(e.id)){let h=e.entries(0,["run"],!1).findLast((p)=>p.type==="run"&&p.state==="start");this.accountedSeqs.set(e.id,h?h.seq-1:0)}}onModelResponse(e,o){let d=e.info().kind==="sub"?e.info().parentID:null,h=d?this.runtime.get(d):e;if(!h)return;let p=this.store.get(h.id);if(!p)return;if(p.status!=="active"&&p.status!=="budget_limited")return;let g=o.usage,b=Math.max(0,(g?.input??0)+(g?.output??0)+(g?.cacheRead??0)+(g?.cacheWrite??0)),f=this.clock.now(),_=e.id!==h.id?void 0:this.runStartTimes.get(e.id),k=_!==void 0?Math.max(0,Math.round((f-_)/1000)):0;if(_!==void 0)this.runStartTimes.set(e.id,f);let x=nf(p,b,k,f),I=x.reachedBudget,E=this.store.upsert(x.goal);if(this.accountedSeqs.set(e.id,this.runtime.store.lastSeq(e.id)),b>0||k>0)this.dirtyProgressSessions.add(h.id);if(I&&p.status==="active"){if(this.dirtyProgressSessions.delete(h.id),this.appendStateEntry(h,E,"budget_limited"),!this.budgetNotifiedGoals.has(E.goalID))this.budgetNotifiedGoals.add(E.goalID),h.notice({sourceKind:"goal",sourceID:E.goalID,state:"budget_limited",dedupeKey:`goal:budget_limit:${E.goalID}`,wake:!1,text:Yp(E)})}}accountProgress(e,o){let d=this.accountedSeqs.get(e.id)??0,h=0,p=d;for(let w of e.records){if(w.entry.seq<=d)continue;if(p=Math.max(p,w.entry.seq),w.raw?.role==="assistant"){let _=w.raw.usage;h+=Math.max(0,(_?.input??0)+(_?.output??0)+(_?.cacheRead??0)+(_?.cacheWrite??0))}}this.accountedSeqs.set(e.id,p);let g=this.clock.now(),b=this.runStartTimes.get(e.id),f=b!==void 0?Math.max(0,Math.round((g-b)/1000)):0;if(b!==void 0)this.runStartTimes.set(e.id,g);if(h===0&&f===0)return o;return this.store.upsert(nf(o,h,f,g).goal)}onRunEnd(e,o){let d=this.store.get(e.id);if(!d){this.runStartTimes.delete(e.id);return}let h=this.accountProgress(e,d);this.runStartTimes.delete(e.id);let p=this.dirtyProgressSessions.delete(e.id)||h.tokensUsed!==d.tokensUsed||h.timeUsedSeconds!==d.timeUsedSeconds;if(d.status==="active"&&h.status==="budget_limited"){this.appendStateEntry(e,h,"budget_limited");return}if(o.reason==="aborted"&&h.status==="active"){let f=this.store.upsert({...h,status:"paused",updatedAtMs:this.clock.now()});this.appendStateEntry(e,f,"paused");return}if(p&&h.status==="active")this.appendStateEntry(e,h,"updated");if(o.reason!=="done"||h.status!=="active")return;if(e.isClosed||e.isArchived||e.isStopped)return;if(this.runtime.store.pendingNotices(e.id).some((f)=>f.wake))return;if(this.runtime.children(e.id).some((f)=>f.status==="busy"))return;this.enqueueContinuation(e,h,"continue")}enqueueContinuation(e,o,d){let h=(this.continuationCounts.get(o.goalID)??0)+1;this.continuationCounts.set(o.goalID,h);let p=this.runtime.store.lastSeq(e.id);if(d==="continue"){let b=new Promise((f)=>{this.clock.after(0,()=>{try{if(!e.isClosed&&!e.isArchived&&!e.isStopped){let w=this.store.get(e.id);if(w&&w.goalID===o.goalID&&w.status==="active")e.notice({sourceKind:"goal",sourceID:o.goalID,state:d,dedupeKey:`goal:${d}:${o.goalID}:${p}:${h}`,wake:!0,text:gl(o)})}}catch(w){console.warn(`[goal] \u76EE\u6807 ${o.goalID} \u7EED\u8DD1\u901A\u77E5\u6295\u9012\u5931\u8D25\uFF1A`,w),f();return}e.noticesIdle().catch((w)=>console.warn(`[goal] \u7B49\u5F85\u76EE\u6807 ${o.goalID} \u7EED\u8DD1\u901A\u77E5\u5904\u7406\u5931\u8D25\uFF1A`,w)).finally(f)})}).finally(()=>{this.work.delete(b)});this.work.add(b);return}e.notice({sourceKind:"goal",sourceID:o.goalID,state:d,dedupeKey:`goal:${d}:${o.goalID}:${p}:${h}`,wake:!0,text:gl(o)},!0);let g=e.noticesIdle().finally(()=>{this.work.delete(g)});this.work.add(g)}onSessionDelete(e){this.runStartTimes.delete(e),this.accountedSeqs.delete(e),this.store.delete(e)}}var yl={pluginID:"goal",name:"service",validate(e){return e instanceof Oi}};function nf(e,o,d,h){let p=e.tokensUsed+o,g=e.timeUsedSeconds+d,b=e.timeBudgetSeconds!==null&&g>=e.timeBudgetSeconds,f=e.tokenBudget!==null&&p>=e.tokenBudget,w=b||f,_=w&&e.status==="active"?"budget_limited":e.status;return{goal:{...e,tokensUsed:p,timeUsedSeconds:g,status:_,updatedAtMs:h},reachedBudget:w}}var bl=`
|
|
2658
|
+
When the full objective is verified complete with concrete evidence, call \`goal_update\` with \`status: "complete"\`. Only set \`status: "paused"\` at the user's explicit request, or \`status: "blocked"\` after the same impasse repeats for at least three consecutive goal turns.`}var Tk={active:"\u8FDB\u884C\u4E2D",paused:"\u5DF2\u6682\u505C",blocked:"\u53D7\u963B",usage_limited:"\u7528\u91CF\u53D7\u9650",budget_limited:"\u5DF2\u8FBE\u9884\u7B97\u4E0A\u9650",complete:"\u5DF2\u5B8C\u6210"};function tf(e){if(e===void 0||e===null)return null;if(!Number.isSafeInteger(e)||e<1)throw new t("goal budgets must be positive when provided");if(e>Pi)throw new t(`goal token budget ${e} exceeds the maximum allowed goal token budget of ${Pi}`);return e}function rf(e){if(e===void 0||e===null)return null;if(!Number.isSafeInteger(e)||e<1)throw new t("goal time budget must be a positive number of seconds");if(e>Di)throw new t(`goal time budget ${e}s exceeds the maximum allowed time budget of ${Di}s (30 days)`);return e}function sf(e){if(typeof e!=="string"||!e.trim())throw new t("goal objective is required");if(e.length>20000)throw new t("goal objective must be at most 20000 characters");return e.trim()}class Oi{runtime;store;clock;runStartTimes=new Map;accountedSeqs=new Map;dirtyProgressSessions=new Set;budgetNotifiedGoals=new Set;continuationCounts=new Map;work=new Set;continuing=new Set;owners=0;constructor(e,o,d=De){this.runtime=e;this.store=o;this.clock=d}retain(){return this.owners++,this.track(this.runtime.ready.then(()=>{if(!this.owners)return;for(let e of this.store.listAll()){let o=e.status==="active"?this.runtime.get(e.sessionID):void 0;if(o)this.revive(o)}})),()=>{if(this.owners=Math.max(0,this.owners-1),this.owners===0)this.runStartTimes.clear()}}async idle(){while(this.work.size>0)await Promise.all([...this.work])}requireMainSession(e){let o=this.runtime.get(e);if(!o)throw new m("no such session");if(o.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");return o}get(e){let o=this.store.get(e);return o?ws(o):null}appendStateEntry(e,o,d){let h=ws(o),p={...h,action:d},g=Tk[o.status]??o.status,b=h.tokenBudget!==null?` \xB7 Token ${h.tokensUsed}/${h.tokenBudget}`:` \xB7 Token ${h.tokensUsed}`;this.runtime.store.appendEntry(e.id,void 0,{type:"extension",namespace:"goal",kind:"state",schemaVersion:1,payload:p,display:{title:`\u76EE\u6807 \xB7 ${g}`,text:`${o.objective}${b}`}}),e.refreshEntries()}create(e,o,d,h){if(e.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");e.assertWritable();let p=sf(o),g=rf(d),b=tf(h?.tokenBudget),f=this.store.get(e.id);if(f&&f.status!=="complete"&&!h?.allowReplaceUnfinished)throw new t("cannot create a new goal because this thread has an unfinished goal; complete the existing goal first");let w=this.clock.now(),_={sessionID:e.id,goalID:oe("g"),objective:p,status:"active",timeBudgetSeconds:g,timeUsedSeconds:0,tokenBudget:b,tokensUsed:0,createdAtMs:w,updatedAtMs:w},k=this.store.upsert(_);if(this.accountedSeqs.set(e.id,this.runtime.store.lastSeq(e.id)),this.budgetNotifiedGoals.delete(k.goalID),this.continuationCounts.set(k.goalID,0),!e.info().title.trim()){let x=p.split(`
|
|
2659
|
+
`)[0]?.trim()??"",I=x.length>40?`${x.slice(0,40)}\u2026`:x;if(I)e.rename(I)}if(this.appendStateEntry(e,k,"created"),h?.wakeSession&&e.status==="idle")this.enqueueContinuation(e,k,"start");return ws(k)}updateByTool(e,o){if(e.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");let d=this.store.get(e.id);if(!d)throw new t("cannot update goal because this thread has no goal");if(!["paused","blocked","complete"].includes(o))throw new t("goal_update can only mark the existing goal complete, blocked, or paused at the user's explicit request; resume, budget-limited, and usage-limited status changes are controlled by the user or system");let h=this.accountProgress(e,d);this.dirtyProgressSessions.delete(e.id);let p=o;if(h.status==="budget_limited"&&o==="paused")p="budget_limited";let g=this.store.upsert({...h,status:p,updatedAtMs:this.clock.now()}),b={paused:"paused",blocked:"blocked",complete:"completed"};return this.appendStateEntry(e,g,b[o]),ws(g)}updateByUser(e,o,d){if(e.info().kind==="sub")throw new t("Goal tools require a persistent main thread.");e.assertWritable();let h=this.store.get(e.id);if(!h)throw new t("cannot update goal because this thread has no goal");let p=o.objective!==void 0?sf(o.objective):h.objective,g=o.timeBudgetSeconds!==void 0?rf(o.timeBudgetSeconds):h.timeBudgetSeconds,b=o.tokenBudget!==void 0?tf(o.tokenBudget):h.tokenBudget,f=o.status??h.status,w=g!==null&&h.timeUsedSeconds>=g,_=b!==null&&h.tokensUsed>=b;if(f==="active"&&(w||_))f="budget_limited";else if(h.status==="budget_limited"&&o.status===void 0&&(!g||h.timeUsedSeconds<g)&&(!b||h.tokensUsed<b))f="active";let k=this.clock.now(),x=this.store.upsert({...h,objective:p,timeBudgetSeconds:g,tokenBudget:b,status:f,updatedAtMs:k}),I=p!==h.objective,E=h.status!=="active"&&x.status==="active",M="updated";if(E)M="resumed";else if(x.status==="paused"&&h.status!=="paused")M="paused";else if(x.status==="complete"&&h.status!=="complete")M="completed";else if(x.status==="blocked"&&h.status!=="blocked")M="blocked";else if(x.status==="budget_limited"&&h.status!=="budget_limited")M="budget_limited";if(this.appendStateEntry(e,x,M),x.status==="active")this.budgetNotifiedGoals.delete(x.goalID);else if(x.status==="paused"||x.status==="complete"){let A=this.runtime.children(e.id).filter((O)=>O.status==="busy");for(let O of A)this.runtime.get(O.id)?.abort()}if(I&&x.status==="active"&&e.status==="busy")e.notice({sourceKind:"goal",sourceID:x.goalID,state:"objective_updated",dedupeKey:`goal:objective_updated:${x.goalID}:${k}`,wake:!1,text:Zp(x)});else if(E&&(d?.wakeOnResume??!0)&&e.status==="idle")this.enqueueContinuation(e,x,"resume");return ws(x)}clear(e){e.assertWritable();let o=this.store.get(e.id);if(!o)return!1;return this.store.delete(e.id),this.runStartTimes.delete(e.id),this.accountedSeqs.delete(e.id),this.budgetNotifiedGoals.delete(o.goalID),this.continuationCounts.delete(o.goalID),this.appendStateEntry(e,o,"cleared"),!0}onRunStart(e){if(this.store.get(e.id)?.status!=="active")return;if(this.runStartTimes.set(e.id,this.clock.now()),!this.accountedSeqs.has(e.id)){let h=e.entries(0,["run"],!1).findLast((p)=>p.type==="run"&&p.state==="start");this.accountedSeqs.set(e.id,h?h.seq-1:0)}}onModelResponse(e,o){let d=e.info().kind==="sub"?e.info().parentID:null,h=d?this.runtime.get(d):e;if(!h)return;let p=this.store.get(h.id);if(!p)return;if(p.status!=="active"&&p.status!=="budget_limited")return;let g=o.usage,b=Math.max(0,(g?.input??0)+(g?.output??0)+(g?.cacheRead??0)+(g?.cacheWrite??0)),f=this.clock.now(),_=e.id!==h.id?void 0:this.runStartTimes.get(e.id),k=_!==void 0?Math.max(0,Math.round((f-_)/1000)):0;if(_!==void 0)this.runStartTimes.set(e.id,f);let x=nf(p,b,k,f),I=x.reachedBudget,E=this.store.upsert(x.goal);if(this.accountedSeqs.set(e.id,this.runtime.store.lastSeq(e.id)),b>0||k>0)this.dirtyProgressSessions.add(h.id);if(I&&p.status==="active"){if(this.dirtyProgressSessions.delete(h.id),this.appendStateEntry(h,E,"budget_limited"),!this.budgetNotifiedGoals.has(E.goalID))this.budgetNotifiedGoals.add(E.goalID),h.notice({sourceKind:"goal",sourceID:E.goalID,state:"budget_limited",dedupeKey:`goal:budget_limit:${E.goalID}`,wake:!1,text:Yp(E)})}}accountProgress(e,o){let d=this.accountedSeqs.get(e.id)??0,h=0,p=d;for(let w of e.records){if(w.entry.seq<=d)continue;if(p=Math.max(p,w.entry.seq),w.raw?.role==="assistant"){let _=w.raw.usage;h+=Math.max(0,(_?.input??0)+(_?.output??0)+(_?.cacheRead??0)+(_?.cacheWrite??0))}}this.accountedSeqs.set(e.id,p);let g=this.clock.now(),b=this.runStartTimes.get(e.id),f=b!==void 0?Math.max(0,Math.round((g-b)/1000)):0;if(b!==void 0)this.runStartTimes.set(e.id,g);if(h===0&&f===0)return o;return this.store.upsert(nf(o,h,f,g).goal)}onRunEnd(e,o){let d=this.store.get(e.id);if(!d){this.runStartTimes.delete(e.id);return}let h=this.accountProgress(e,d);this.runStartTimes.delete(e.id);let p=this.dirtyProgressSessions.delete(e.id)||h.tokensUsed!==d.tokensUsed||h.timeUsedSeconds!==d.timeUsedSeconds;if(d.status==="active"&&h.status==="budget_limited"){this.appendStateEntry(e,h,"budget_limited");return}if(o.reason==="aborted"&&h.status==="active"){let f=this.store.upsert({...h,status:"paused",updatedAtMs:this.clock.now()});this.appendStateEntry(e,f,"paused");return}if(p&&h.status==="active")this.appendStateEntry(e,h,"updated");if(o.reason!=="done"||h.status!=="active")return;if(e.isClosed||e.isArchived||e.isStopped)return;if(this.runtime.store.pendingNotices(e.id).some((f)=>f.wake))return;if(this.runtime.children(e.id).some((f)=>f.status==="busy")||this.continuing.has(e.id))return;this.enqueueContinuation(e,h,"continue")}onChildRunEnd(e){let o=e.info().parentID,d=o?this.runtime.get(o):void 0;if(d?.info().kind!=="main"||this.store.get(d.id)?.status!=="active")return;this.track(new Promise((h)=>this.clock.after(0,h)).then(()=>d.noticesIdle()).then(()=>this.revive(d)))}revive(e){let o=this.store.get(e.id);if(o?.status!=="active"||this.continuing.has(e.id))return;if(e.isClosed||e.isArchived||e.isStopped||e.status!=="idle")return;let d=this.runtime.store.lastEntry(e.id,"run");if(d?.type!=="run"||d.state!=="end"||d.reason!=="done"&&d.reason!=="interrupted")return;if(this.runtime.store.pendingNotices(e.id).some((h)=>h.wake))return;if(this.runtime.children(e.id).some((h)=>h.status==="busy"))return;this.enqueueContinuation(e,o,"continue")}track(e){let o=e.catch((d)=>console.warn("[goal] \u8865\u53D1\u7EED\u8DD1\u5931\u8D25\uFF1A",d)).finally(()=>{this.work.delete(o)});this.work.add(o)}enqueueContinuation(e,o,d){let h=(this.continuationCounts.get(o.goalID)??0)+1;this.continuationCounts.set(o.goalID,h);let p=this.runtime.store.lastSeq(e.id);if(d==="continue"){this.continuing.add(e.id);let b=new Promise((f)=>{this.clock.after(0,()=>{try{if(!e.isClosed&&!e.isArchived&&!e.isStopped){let w=this.store.get(e.id);if(w&&w.goalID===o.goalID&&w.status==="active")e.notice({sourceKind:"goal",sourceID:o.goalID,state:d,dedupeKey:`goal:${d}:${o.goalID}:${p}:${h}`,wake:!0,text:gl(o)})}}catch(w){console.warn(`[goal] \u76EE\u6807 ${o.goalID} \u7EED\u8DD1\u901A\u77E5\u6295\u9012\u5931\u8D25\uFF1A`,w),f();return}e.noticesIdle().catch((w)=>console.warn(`[goal] \u7B49\u5F85\u76EE\u6807 ${o.goalID} \u7EED\u8DD1\u901A\u77E5\u5904\u7406\u5931\u8D25\uFF1A`,w)).finally(f)})}).finally(()=>{this.continuing.delete(e.id),this.work.delete(b)});this.work.add(b);return}e.notice({sourceKind:"goal",sourceID:o.goalID,state:d,dedupeKey:`goal:${d}:${o.goalID}:${p}:${h}`,wake:!0,text:gl(o)},!0);let g=e.noticesIdle().finally(()=>{this.work.delete(g)});this.work.add(g)}onSessionDelete(e){this.runStartTimes.delete(e),this.accountedSeqs.delete(e),this.store.delete(e)}}var yl={pluginID:"goal",name:"service",validate(e){return e instanceof Oi}};function nf(e,o,d,h){let p=e.tokensUsed+o,g=e.timeUsedSeconds+d,b=e.timeBudgetSeconds!==null&&g>=e.timeBudgetSeconds,f=e.tokenBudget!==null&&p>=e.tokenBudget,w=b||f,_=w&&e.status==="active"?"budget_limited":e.status;return{goal:{...e,tokensUsed:p,timeUsedSeconds:g,status:_,updatedAtMs:h},reachedBudget:w}}var bl=`
|
|
2660
2660
|
CREATE TABLE IF NOT EXISTS thread_goals (
|
|
2661
2661
|
session_id TEXT PRIMARY KEY REFERENCES sessions(id) ON DELETE CASCADE,
|
|
2662
2662
|
goal_id TEXT NOT NULL,
|
|
@@ -2718,7 +2718,7 @@ CREATE INDEX IF NOT EXISTS idx_thread_goals_status_updated_at
|
|
|
2718
2718
|
tokens_used = excluded.tokens_used,
|
|
2719
2719
|
created_at_ms = excluded.created_at_ms,
|
|
2720
2720
|
updated_at_ms = excluded.updated_at_ms`).run(e.sessionID,e.goalID,e.objective,e.status,e.timeBudgetSeconds??null,e.timeUsedSeconds,e.tokenBudget??null,e.tokensUsed,e.createdAtMs,e.updatedAtMs),{...e}}delete(e){return this.db.query("DELETE FROM thread_goals WHERE session_id = ?").run(e).changes>0}}function af(e){let o=T({name:"goal_get",label:"Get current goal",description:"Get the current goal for this thread, including status, budgets, token and elapsed-time usage, and remaining token budget.",parameters:l({}),async execute(){let p=D.getStore();if(!p)throw Error("Goal tools require a persistent thread.");e.requireMainSession(p.id);let g=e.get(p.id);return c(JSON.stringify({goal:g}))}}),d=T({name:"goal_create",label:"Create goal",description:`Create a goal only when explicitly requested by the user or system/developer instructions; do not infer goals from ordinary tasks.
|
|
2721
|
-
Set time_budget_hours (e.g. 6 for 6 hours) or time_budget_seconds only when an explicit time budget is requested. Fails if an unfinished goal exists; use goal_update only for status.`,parameters:l({objective:s({minLength:1,maxLength:20000,description:"Required. The concrete objective to start pursuing. This starts a new active goal when no goal exists or replaces the current goal when it is complete."}),time_budget_hours:n(ne({minimum:0.1,maximum:720,description:"Positive time budget in hours (e.g. 6 for 6 hours, 0.5 for 30 minutes). Omit unless explicitly requested."})),time_budget_seconds:n(S({minimum:1,maximum:Di,description:"Positive time budget in seconds (e.g. 21600 for 6 hours). Omit unless explicitly requested."})),token_budget:n(S({minimum:1,maximum:Pi,description:"Positive token budget for the new goal. Omit unless explicitly requested."}))}),async execute(p,g){let b=D.getStore();if(!b)throw Error("Goal tools require a persistent thread.");let f=g.time_budget_seconds??(g.time_budget_hours!==void 0?Math.round(g.time_budget_hours*3600):null),w=e.create(b,g.objective,f,{allowReplaceUnfinished:!1,wakeSession:!1,tokenBudget:g.token_budget});return c(JSON.stringify({goal:w}))}}),h=T({name:"goal_update",label:"Update goal status",description:"Update the existing goal.\nSet status to `paused` only at the user's explicit request to pause this goal, never on your own initiative. Ask if unclear; a later resume revokes that request. Report the returned status and stop goal work. Budget limits take precedence over pausing.\nSet status to `complete` only when the objective has actually been achieved and no required work remains.\nSet status to `blocked` only when the same blocking condition has repeated for at least three consecutive goal turns, counting the original/user-triggered turn and any automatic continuations, and the agent cannot make meaningful progress without user input or an external-state change.\nIf the user resumes a goal that was previously marked `blocked`, treat the resumed run as a fresh blocked audit. If the same blocking condition then repeats for at least three consecutive resumed goal turns, set status to `blocked` again.\nOnce the blocked threshold is satisfied, do not keep reporting that you are still blocked while leaving the goal active; set status to `blocked`.\nDo not use `blocked` merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.\nDo not mark a goal complete merely because its budget is nearly exhausted or because you are stopping work.\nYou cannot use this tool to resume, budget-limit, or usage-limit a goal; those status changes are controlled by the user or system.\nWhen marking a budgeted goal achieved with status `complete`, report the final token usage from the tool result to the user.",parameters:l({status:y([i("paused"),i("blocked"),i("complete")],{description:"Required. `paused` requires an explicit user request. Set to `complete` only when the objective is achieved and no required work remains. Set to `blocked` only after the same blocking condition has recurred for at least three consecutive goal turns and the agent is at an impasse. After a previously blocked goal is resumed, the resumed run starts a fresh blocked audit."})}),async execute(p,g){let b=D.getStore();if(!b)throw Error("Goal tools require a persistent thread.");let f=e.updateByTool(b,g.status);if(f.status==="complete")return c(JSON.stringify({goal:f,completionBudgetReport:"Goal achieved. Report final usage from this tool result's structured goal fields. If `goal.tokenBudget` is present, include token usage from `goal.tokensUsed` and `goal.tokenBudget`. If `goal.timeUsedSeconds` is greater than 0, summarize elapsed time in a concise, human-friendly form appropriate to the response language."}));return c(JSON.stringify({goal:f}))}});return[o,d,h]}var cf=R({id:"goal",name:"\u6301\u4E45\u76EE\u6807",description:"\u4F1A\u8BDD\u7EA7\u957F\u5468\u671F\u76EE\u6807\uFF08Goal\uFF09\u8FFD\u8E2A\u3001Token \u9884\u7B97\u63A7\u5236\u3001\u81EA\u52A8\u7EED\u8DD1\u4E0E\u5B8C\u6210\u5EA6\u5BA1\u8BA1\u3002",version:"1.0.0",apiVersion:1,deps:[],routePrefixes:["/api/sessions"],migrations:[{version:1,sql:bl}],setup(e){let o=new Ko(e.runtime.store.db),d=new Oi(e.runtime,o);e.provide(yl,d),e.onDeactivate(d.retain()),e.registerNoticeSource("goal",{textLimit:16000,summaryLimit:24000,heading:"[Goal \u9636\u6BB5\u6027\u7EED\u8DD1\u4E0E\u5BA1\u8BA1\u6307\u4EE4]"});for(let h of af(d))e.registerTool(h,{defer:"defer"});e.on("projection.prefix",(h,{session:p})=>{if(!p||p.info().kind==="sub")return;let g=o.get(p.id);if(!g||g.status==="complete")return;return[...h,{role:"user",content:ef(g),timestamp:0}]}),e.on("run.start",(h,{session:p})=>{if(p&&p.info().kind!=="sub")d.onRunStart(p)}),e.on("model.after_response",(h,{session:p})=>{if(p&&h.role==="assistant")d.onModelResponse(p,h)}),e.on("run.end",(h,{session:p})=>{if(p&&p.info().kind!=="sub")d.onRunEnd(p,h)}),e.on("session.delete",(h)=>{if(h)d.onSessionDelete(h.id)}),e.on("runtime.idle",()=>d.idle()),e.registerRoute({method:"GET",path:"/api/sessions/:id/goal",handler:(h,p)=>{let g=d.requireMainSession(v(p,"id"));return Response.json({goal:d.get(g.id)})}}),e.registerRoute({method:"POST",path:"/api/sessions/:id/goal",handler:async(h,p)=>{let g=d.requireMainSession(v(p,"id")),b=await L(h),f=b.timeBudgetSeconds!==void 0?b.timeBudgetSeconds:b.timeBudgetHours!==void 0&&b.timeBudgetHours!==null?Math.round(b.timeBudgetHours*3600):null,w=d.create(g,b.objective,f,{allowReplaceUnfinished:b.replace===!0,wakeSession:!0,tokenBudget:b.tokenBudget});return Response.json({goal:w})}}),e.registerRoute({method:"PATCH",path:"/api/sessions/:id/goal",handler:async(h,p)=>{let g=d.requireMainSession(v(p,"id")),b=await L(h),f=b.timeBudgetSeconds!==void 0?b.timeBudgetSeconds:b.timeBudgetHours!==void 0&&b.timeBudgetHours!==null?Math.round(b.timeBudgetHours*3600):void 0,w=d.updateByUser(g,{objective:b.objective,status:b.status,timeBudgetSeconds:f,tokenBudget:b.tokenBudget},{wakeOnResume:!0});return Response.json({goal:w})}}),e.registerRoute({method:"DELETE",path:"/api/sessions/:id/goal",handler:(h,p)=>{let g=d.requireMainSession(v(p,"id")),b=d.clear(g);return Response.json({cleared:b})}}),e.registerCommand({id:"goal",title:"\u8BBE\u7F6E\u6216\u7BA1\u7406\u6301\u4E45\u76EE\u6807",execute(h){let[p,g,b]=h;if(!p)throw new t("session id is required");let f=d.requireMainSession(p),w=g?.trim();if(!w)return f.info();if(w==="clear")return d.clear(f),f.info();if(w==="pause")return d.updateByUser(f,{status:"paused"},{wakeOnResume:!1}),f.info();if(w==="resume")return d.updateByUser(f,{status:"active"},{wakeOnResume:!0}),f.info();let _=null;if(b!==void 0&&b.trim()!==""){let k=b.trim().toLowerCase();if(k.endsWith("h"))_=Math.round(Number.parseFloat(k.slice(0,-1))*3600);else if(k.endsWith("m"))_=Math.round(Number.parseFloat(k.slice(0,-1))*60);else if(k.endsWith("s"))_=Math.round(Number.parseFloat(k.slice(0,-1)));else{let x=Number.parseFloat(k);_=x<100?Math.round(x*3600):Math.round(x)}}return d.create(f,w,_,{allowReplaceUnfinished:!0,wakeSession:!0}),f.info()}}),e.registerWebContribution({id:"goal",kind:"command",title:"\u6301\u4E45\u76EE\u6807",commandTitle:"\u8BBE\u7F6E\u6216\u7BA1\u7406\u6301\u4E45\u76EE\u6807",icon:"Target"})}});import{mkdirSync as Ck,writeFileSync as Rk}from"fs";import{readFile as Ak,realpath as lf,stat as Ik}from"fs/promises";import{extname as Pk,join as uf,resolve as Dk}from"path";var Ok=52428800,df={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"},Mk=l({prompt:s({description:"Detailed description of the image to generate or edit. Include subject, style, framing, lighting, colors, and key details."}),size:n(y([i("1024x1024"),i("1024x1536"),i("1536x1024"),i("auto")])),background:n(y([i("auto"),i("opaque"),i("transparent")])),quality:n(y([i("auto"),i("low"),i("medium"),i("high")])),outputFormat:n(y([i("png"),i("jpeg"),i("webp")])),inputFidelity:n(y([i("low"),i("high")])),images:n(H(s(),{minItems:1,maxItems:16,description:'PNG, JPEG or WebP input images, each either a workspace path (relative or absolute) or the id of an image the user attached in this session, shown as <image id="att_..."> in the user message. When given, the request becomes an edit: the first image is the edit target and the rest are references, in the order listed.'})),mask:n(s({description:"Workspace path or attachment id of a PNG mask with an alpha channel, same size as the first input image. Fully transparent pixels mark the area to edit. Requires images."}))});async function hf(e,o,d){let h=d.find((w)=>w.id===o);if(h){if(!Object.values(df).includes(h.mimeType))throw Error(`${o} is ${h.mimeType}; only PNG, JPEG or WebP can be edited`);return new Blob([Buffer.from(h.data,"base64")],{type:h.mimeType})}if(o.startsWith("att_")){let w=d.map((_)=>_.id).join(", ")||"none";throw Error(`attachment ${o} is not an image in this session; available image ids: ${w}`)}let p=await lf(e),g=await lf(Dk(p,o)).catch(()=>{throw Error(`input image not found: ${o}`)});if(!Ei(p,g))throw Error(`input image must be inside the workspace: ${o}`);let b=df[Pk(g).toLowerCase()];if(!b)throw Error(`input image must be PNG, JPEG or WebP: ${o}`);let f=await Ik(g);if(!f.isFile())throw Error(`input image is not a regular file: ${o}`);if(f.size>Ok)throw Error(`input image exceeds 50MB: ${o}`);return new Blob([await Ak(g)],{type:b})}async function wl(e){let o=e,{apiKey:d,baseUrl:h}=o;if(o.auth?.apiKey?.resolve)try{let p=await o.auth.apiKey.resolve();if(p?.auth?.apiKey)d=p.auth.apiKey;if(p?.auth?.baseUrl)h=p.auth.baseUrl}catch{}if(h){let p=o.models?.find((g)=>/(?:dall[-_]?e|image|flux|stable[-_]?diffusion|sdxl|midjourney)/i.test(g.id))?.id;return{baseUrl:h,apiKey:d,model:p}}return}async function $k(e,o){let h=e.options.models.getProviders(),p=o?.indexOf("/")??-1,g=p>0?o?.slice(0,p):void 0;if(g){let b=h.find((f)=>f.id===g);if(b){let f=await wl(b);if(f)return f}}for(let b of h){let f=await wl(b);if(f?.apiKey)return f}for(let b of h){let f=await wl(b);if(f)return f}return}function pf(e){return T({name:"image_generation",label:"\u751F\u6210\u56FE\u50CF",description:"Generate or edit images from text descriptions or existing visuals. Load the imagegen skill first when using this tool for detailed prompting and workflow guidance.",parameters:Mk,prepareArguments:(o)=>{if(!o||typeof o!=="object")return o;let d=o;if(typeof d.images!=="string"||!d.images.trim().startsWith("["))return d;try{let h=JSON.parse(d.images);if(Array.isArray(h))return{...d,images:h}}catch{}return d},async execute(o,d){let h=d,p=D.getStore(),b=(p?.projectID?e.project(p.projectID):void 0)?.directory??process.cwd(),f=await $k(e,p?.model);if(!f)return c("Image generation failed: Native image generation is unavailable with the current model provider. According to the imagegen specification, image generation requires an upstream model provider with native image capabilities. Placeholder substitution and requesting external API keys are prohibited.");if(h.mask&&!h.images?.length)return c("Image generation failed: mask requires at least one input image in images.");let w=f.model??"dall-e-3",_=/dall[-_]?e/i.test(w),k={model:w,prompt:h.prompt};if(_)k.size=h.size==="1024x1536"?"1024x1792":h.size==="1536x1024"?"1792x1024":"1024x1024",k.quality=h.quality==="high"?"hd":"standard",k.response_format="b64_json";else{if(h.size)k.size=h.size;if(h.quality)k.quality=h.quality;if(h.background)k.background=h.background;if(h.outputFormat)k.output_format=h.outputFormat}let x=_?"png":h.outputFormat??"png",I=Boolean(h.images?.length),E=f.baseUrl.replace(/\/$/,""),M=`${E.endsWith("/v1")?E:`${E}/v1`}/images/${I?"edits":"generations"}`,A={};if(f.apiKey)A.Authorization=`Bearer ${f.apiKey}`;let O,W=[];if(I){let K=new FormData;for(let[le,J]of Object.entries(k))K.append(le,J);if(K.append("n","1"),h.inputFidelity&&!_)K.append("input_fidelity",h.inputFidelity);let X=(p?.entries()??[]).flatMap((le)=>le.type==="user"?(le.attachments??[]).filter((J)=>J.kind==="image"&&J.id):[]);try{for(let le of h.images??[]){let J=await hf(b,le,X);K.append("image[]",J,le),W.push({data:Buffer.from(await J.arrayBuffer()).toString("base64"),mimeType:J.type})}if(h.mask)K.append("mask",await hf(b,h.mask,X),h.mask)}catch(le){return c(`Image edit failed: ${le instanceof Error?le.message:String(le)}.`)}O=K}else A["Content-Type"]="application/json",O=JSON.stringify({...k,n:1});let j;try{let K=await fetch(M,{method:"POST",headers:A,body:O});if(!K.ok){let le=await K.text().catch(()=>"");return c(`Image generation failed: Upstream provider returned status ${K.status}${le?` (${le.slice(0,200)})`:""}. Native image tool could not produce an image. Do not substitute placeholders.`)}j=(await K.json()).data?.[0]?.b64_json}catch(K){return c(`Image generation failed: Network or provider error (${K instanceof Error?K.message:String(K)}). Do not substitute placeholders.`)}if(!j)return c("Image generation failed: Upstream provider response did not contain image data. Do not substitute placeholders.");let B=uf(b,".basalt","images");Ck(B,{recursive:!0});let F=`img-${Date.now()}-${Math.random().toString(36).slice(2,6)}.${x==="jpeg"?"jpg":x}`,z=uf(B,F);Rk(z,Buffer.from(j,"base64"));let V=I?`Image edited successfully. The first attached image is the result, followed by ${W.length} input image(s).
|
|
2721
|
+
Set time_budget_hours (e.g. 6 for 6 hours) or time_budget_seconds only when an explicit time budget is requested. Fails if an unfinished goal exists; use goal_update only for status.`,parameters:l({objective:s({minLength:1,maxLength:20000,description:"Required. The concrete objective to start pursuing. This starts a new active goal when no goal exists or replaces the current goal when it is complete."}),time_budget_hours:n(ne({minimum:0.1,maximum:720,description:"Positive time budget in hours (e.g. 6 for 6 hours, 0.5 for 30 minutes). Omit unless explicitly requested."})),time_budget_seconds:n(S({minimum:1,maximum:Di,description:"Positive time budget in seconds (e.g. 21600 for 6 hours). Omit unless explicitly requested."})),token_budget:n(S({minimum:1,maximum:Pi,description:"Positive token budget for the new goal. Omit unless explicitly requested."}))}),async execute(p,g){let b=D.getStore();if(!b)throw Error("Goal tools require a persistent thread.");let f=g.time_budget_seconds??(g.time_budget_hours!==void 0?Math.round(g.time_budget_hours*3600):null),w=e.create(b,g.objective,f,{allowReplaceUnfinished:!1,wakeSession:!1,tokenBudget:g.token_budget});return c(JSON.stringify({goal:w}))}}),h=T({name:"goal_update",label:"Update goal status",description:"Update the existing goal.\nSet status to `paused` only at the user's explicit request to pause this goal, never on your own initiative. Ask if unclear; a later resume revokes that request. Report the returned status and stop goal work. Budget limits take precedence over pausing.\nSet status to `complete` only when the objective has actually been achieved and no required work remains.\nSet status to `blocked` only when the same blocking condition has repeated for at least three consecutive goal turns, counting the original/user-triggered turn and any automatic continuations, and the agent cannot make meaningful progress without user input or an external-state change.\nIf the user resumes a goal that was previously marked `blocked`, treat the resumed run as a fresh blocked audit. If the same blocking condition then repeats for at least three consecutive resumed goal turns, set status to `blocked` again.\nOnce the blocked threshold is satisfied, do not keep reporting that you are still blocked while leaving the goal active; set status to `blocked`.\nDo not use `blocked` merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.\nDo not mark a goal complete merely because its budget is nearly exhausted or because you are stopping work.\nYou cannot use this tool to resume, budget-limit, or usage-limit a goal; those status changes are controlled by the user or system.\nWhen marking a budgeted goal achieved with status `complete`, report the final token usage from the tool result to the user.",parameters:l({status:y([i("paused"),i("blocked"),i("complete")],{description:"Required. `paused` requires an explicit user request. Set to `complete` only when the objective is achieved and no required work remains. Set to `blocked` only after the same blocking condition has recurred for at least three consecutive goal turns and the agent is at an impasse. After a previously blocked goal is resumed, the resumed run starts a fresh blocked audit."})}),async execute(p,g){let b=D.getStore();if(!b)throw Error("Goal tools require a persistent thread.");let f=e.updateByTool(b,g.status);if(f.status==="complete")return c(JSON.stringify({goal:f,completionBudgetReport:"Goal achieved. Report final usage from this tool result's structured goal fields. If `goal.tokenBudget` is present, include token usage from `goal.tokensUsed` and `goal.tokenBudget`. If `goal.timeUsedSeconds` is greater than 0, summarize elapsed time in a concise, human-friendly form appropriate to the response language."}));return c(JSON.stringify({goal:f}))}});return[o,d,h]}var cf=R({id:"goal",name:"\u6301\u4E45\u76EE\u6807",description:"\u4F1A\u8BDD\u7EA7\u957F\u5468\u671F\u76EE\u6807\uFF08Goal\uFF09\u8FFD\u8E2A\u3001Token \u9884\u7B97\u63A7\u5236\u3001\u81EA\u52A8\u7EED\u8DD1\u4E0E\u5B8C\u6210\u5EA6\u5BA1\u8BA1\u3002",version:"1.0.0",apiVersion:1,deps:[],routePrefixes:["/api/sessions"],migrations:[{version:1,sql:bl}],setup(e){let o=new Ko(e.runtime.store.db),d=new Oi(e.runtime,o);e.provide(yl,d),e.onDeactivate(d.retain()),e.registerNoticeSource("goal",{textLimit:16000,summaryLimit:24000,heading:"[Goal \u9636\u6BB5\u6027\u7EED\u8DD1\u4E0E\u5BA1\u8BA1\u6307\u4EE4]"});for(let h of af(d))e.registerTool(h,{defer:"defer"});e.on("projection.prefix",(h,{session:p})=>{if(!p||p.info().kind==="sub")return;let g=o.get(p.id);if(!g||g.status==="complete")return;return[...h,{role:"user",content:ef(g),timestamp:0}]}),e.on("run.start",(h,{session:p})=>{if(p&&p.info().kind!=="sub")d.onRunStart(p)}),e.on("model.after_response",(h,{session:p})=>{if(p&&h.role==="assistant")d.onModelResponse(p,h)}),e.on("run.end",(h,{session:p})=>{if(!p)return;if(p.info().kind==="sub")return d.onChildRunEnd(p);d.onRunEnd(p,h)}),e.on("session.delete",(h)=>{if(h)d.onSessionDelete(h.id)}),e.on("runtime.idle",()=>d.idle()),e.registerRoute({method:"GET",path:"/api/sessions/:id/goal",handler:(h,p)=>{let g=d.requireMainSession(v(p,"id"));return Response.json({goal:d.get(g.id)})}}),e.registerRoute({method:"POST",path:"/api/sessions/:id/goal",handler:async(h,p)=>{let g=d.requireMainSession(v(p,"id")),b=await L(h),f=b.timeBudgetSeconds!==void 0?b.timeBudgetSeconds:b.timeBudgetHours!==void 0&&b.timeBudgetHours!==null?Math.round(b.timeBudgetHours*3600):null,w=d.create(g,b.objective,f,{allowReplaceUnfinished:b.replace===!0,wakeSession:!0,tokenBudget:b.tokenBudget});return Response.json({goal:w})}}),e.registerRoute({method:"PATCH",path:"/api/sessions/:id/goal",handler:async(h,p)=>{let g=d.requireMainSession(v(p,"id")),b=await L(h),f=b.timeBudgetSeconds!==void 0?b.timeBudgetSeconds:b.timeBudgetHours!==void 0&&b.timeBudgetHours!==null?Math.round(b.timeBudgetHours*3600):void 0,w=d.updateByUser(g,{objective:b.objective,status:b.status,timeBudgetSeconds:f,tokenBudget:b.tokenBudget},{wakeOnResume:!0});return Response.json({goal:w})}}),e.registerRoute({method:"DELETE",path:"/api/sessions/:id/goal",handler:(h,p)=>{let g=d.requireMainSession(v(p,"id")),b=d.clear(g);return Response.json({cleared:b})}}),e.registerCommand({id:"goal",title:"\u8BBE\u7F6E\u6216\u7BA1\u7406\u6301\u4E45\u76EE\u6807",execute(h){let[p,g,b]=h;if(!p)throw new t("session id is required");let f=d.requireMainSession(p),w=g?.trim();if(!w)return f.info();if(w==="clear")return d.clear(f),f.info();if(w==="pause")return d.updateByUser(f,{status:"paused"},{wakeOnResume:!1}),f.info();if(w==="resume")return d.updateByUser(f,{status:"active"},{wakeOnResume:!0}),f.info();let _=null;if(b!==void 0&&b.trim()!==""){let k=b.trim().toLowerCase();if(k.endsWith("h"))_=Math.round(Number.parseFloat(k.slice(0,-1))*3600);else if(k.endsWith("m"))_=Math.round(Number.parseFloat(k.slice(0,-1))*60);else if(k.endsWith("s"))_=Math.round(Number.parseFloat(k.slice(0,-1)));else{let x=Number.parseFloat(k);_=x<100?Math.round(x*3600):Math.round(x)}}return d.create(f,w,_,{allowReplaceUnfinished:!0,wakeSession:!0}),f.info()}}),e.registerWebContribution({id:"goal",kind:"command",title:"\u6301\u4E45\u76EE\u6807",commandTitle:"\u8BBE\u7F6E\u6216\u7BA1\u7406\u6301\u4E45\u76EE\u6807",icon:"Target"})}});import{mkdirSync as Ck,writeFileSync as Rk}from"fs";import{readFile as Ak,realpath as lf,stat as Ik}from"fs/promises";import{extname as Pk,join as uf,resolve as Dk}from"path";var Ok=52428800,df={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"},Mk=l({prompt:s({description:"Detailed description of the image to generate or edit. Include subject, style, framing, lighting, colors, and key details."}),size:n(y([i("1024x1024"),i("1024x1536"),i("1536x1024"),i("auto")])),background:n(y([i("auto"),i("opaque"),i("transparent")])),quality:n(y([i("auto"),i("low"),i("medium"),i("high")])),outputFormat:n(y([i("png"),i("jpeg"),i("webp")])),inputFidelity:n(y([i("low"),i("high")])),images:n(H(s(),{minItems:1,maxItems:16,description:'PNG, JPEG or WebP input images, each either a workspace path (relative or absolute) or the id of an image the user attached in this session, shown as <image id="att_..."> in the user message. When given, the request becomes an edit: the first image is the edit target and the rest are references, in the order listed.'})),mask:n(s({description:"Workspace path or attachment id of a PNG mask with an alpha channel, same size as the first input image. Fully transparent pixels mark the area to edit. Requires images."}))});async function hf(e,o,d){let h=d.find((w)=>w.id===o);if(h){if(!Object.values(df).includes(h.mimeType))throw Error(`${o} is ${h.mimeType}; only PNG, JPEG or WebP can be edited`);return new Blob([Buffer.from(h.data,"base64")],{type:h.mimeType})}if(o.startsWith("att_")){let w=d.map((_)=>_.id).join(", ")||"none";throw Error(`attachment ${o} is not an image in this session; available image ids: ${w}`)}let p=await lf(e),g=await lf(Dk(p,o)).catch(()=>{throw Error(`input image not found: ${o}`)});if(!Ei(p,g))throw Error(`input image must be inside the workspace: ${o}`);let b=df[Pk(g).toLowerCase()];if(!b)throw Error(`input image must be PNG, JPEG or WebP: ${o}`);let f=await Ik(g);if(!f.isFile())throw Error(`input image is not a regular file: ${o}`);if(f.size>Ok)throw Error(`input image exceeds 50MB: ${o}`);return new Blob([await Ak(g)],{type:b})}async function wl(e){let o=e,{apiKey:d,baseUrl:h}=o;if(o.auth?.apiKey?.resolve)try{let p=await o.auth.apiKey.resolve();if(p?.auth?.apiKey)d=p.auth.apiKey;if(p?.auth?.baseUrl)h=p.auth.baseUrl}catch{}if(h){let p=o.models?.find((g)=>/(?:dall[-_]?e|image|flux|stable[-_]?diffusion|sdxl|midjourney)/i.test(g.id))?.id;return{baseUrl:h,apiKey:d,model:p}}return}async function $k(e,o){let h=e.options.models.getProviders(),p=o?.indexOf("/")??-1,g=p>0?o?.slice(0,p):void 0;if(g){let b=h.find((f)=>f.id===g);if(b){let f=await wl(b);if(f)return f}}for(let b of h){let f=await wl(b);if(f?.apiKey)return f}for(let b of h){let f=await wl(b);if(f)return f}return}function pf(e){return T({name:"image_generation",label:"\u751F\u6210\u56FE\u50CF",description:"Generate or edit images from text descriptions or existing visuals. Load the imagegen skill first when using this tool for detailed prompting and workflow guidance.",parameters:Mk,prepareArguments:(o)=>{if(!o||typeof o!=="object")return o;let d=o;if(typeof d.images!=="string"||!d.images.trim().startsWith("["))return d;try{let h=JSON.parse(d.images);if(Array.isArray(h))return{...d,images:h}}catch{}return d},async execute(o,d){let h=d,p=D.getStore(),b=(p?.projectID?e.project(p.projectID):void 0)?.directory??process.cwd(),f=await $k(e,p?.model);if(!f)return c("Image generation failed: Native image generation is unavailable with the current model provider. According to the imagegen specification, image generation requires an upstream model provider with native image capabilities. Placeholder substitution and requesting external API keys are prohibited.");if(h.mask&&!h.images?.length)return c("Image generation failed: mask requires at least one input image in images.");let w=f.model??"dall-e-3",_=/dall[-_]?e/i.test(w),k={model:w,prompt:h.prompt};if(_)k.size=h.size==="1024x1536"?"1024x1792":h.size==="1536x1024"?"1792x1024":"1024x1024",k.quality=h.quality==="high"?"hd":"standard",k.response_format="b64_json";else{if(h.size)k.size=h.size;if(h.quality)k.quality=h.quality;if(h.background)k.background=h.background;if(h.outputFormat)k.output_format=h.outputFormat}let x=_?"png":h.outputFormat??"png",I=Boolean(h.images?.length),E=f.baseUrl.replace(/\/$/,""),M=`${E.endsWith("/v1")?E:`${E}/v1`}/images/${I?"edits":"generations"}`,A={};if(f.apiKey)A.Authorization=`Bearer ${f.apiKey}`;let O,W=[];if(I){let K=new FormData;for(let[le,J]of Object.entries(k))K.append(le,J);if(K.append("n","1"),h.inputFidelity&&!_)K.append("input_fidelity",h.inputFidelity);let X=(p?.entries()??[]).flatMap((le)=>le.type==="user"?(le.attachments??[]).filter((J)=>J.kind==="image"&&J.id):[]);try{for(let le of h.images??[]){let J=await hf(b,le,X);K.append("image[]",J,le),W.push({data:Buffer.from(await J.arrayBuffer()).toString("base64"),mimeType:J.type})}if(h.mask)K.append("mask",await hf(b,h.mask,X),h.mask)}catch(le){return c(`Image edit failed: ${le instanceof Error?le.message:String(le)}.`)}O=K}else A["Content-Type"]="application/json",O=JSON.stringify({...k,n:1});let j;try{let K=await fetch(M,{method:"POST",headers:A,body:O});if(!K.ok){let le=await K.text().catch(()=>"");return c(`Image generation failed: Upstream provider returned status ${K.status}${le?` (${le.slice(0,200)})`:""}. Native image tool could not produce an image. Do not substitute placeholders.`)}j=(await K.json()).data?.[0]?.b64_json}catch(K){return c(`Image generation failed: Network or provider error (${K instanceof Error?K.message:String(K)}). Do not substitute placeholders.`)}if(!j)return c("Image generation failed: Upstream provider response did not contain image data. Do not substitute placeholders.");let B=uf(b,".basalt","images");Ck(B,{recursive:!0});let F=`img-${Date.now()}-${Math.random().toString(36).slice(2,6)}.${x==="jpeg"?"jpg":x}`,z=uf(B,F);Rk(z,Buffer.from(j,"base64"));let V=I?`Image edited successfully. The first attached image is the result, followed by ${W.length} input image(s).
|
|
2722
2722
|
Image saved to: ${z}`:`Image generated successfully.
|
|
2723
2723
|
Image saved to: ${z}`;return{content:[...c(V).content,{type:"image",data:j,mimeType:`image/${x}`},...W.map((K)=>({type:"image",...K}))],details:{inputCount:W.length}}}})}var ff=`<!--
|
|
2724
2724
|
Adapted from OpenAI Codex's .system/imagegen/SKILL.md and
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Xo}from"./chunk-
|
|
2
|
+
import{Xo}from"./chunk-pjv9mppd.js";import"./chunk-m1w7f6d3.js";import"./chunk-w430z452.js";import{Qo}from"./chunk-g23dnf4y.js";Bun.plugin({name:"basalt-plugin-sdk",setup(o){o.module("@basalt/plugin",()=>({exports:Qo,loader:"object"})),o.module("@earendil-works/pi-ai",()=>({exports:Xo,loader:"object"}))}});
|