@bkm016/basalt 0.1.36 → 0.1.38
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-02kyx0dt.js +3 -0
- package/chunk-19nje7ny.js +5 -0
- package/chunk-1jtnjzrz.js +3 -0
- package/chunk-1rt7fvft.js +51 -0
- package/chunk-23qfxx3v.js +3 -0
- package/chunk-28dpfw91.js +20 -0
- package/chunk-2bz3h7k7.js +18 -0
- package/chunk-2etdp9zt.js +3 -0
- package/chunk-3bc88p88.js +2 -0
- package/chunk-3bqs901a.js +3 -0
- package/chunk-412mm63g.js +3 -0
- package/chunk-4kg028qe.js +3 -0
- package/chunk-4ry04733.js +2 -0
- package/chunk-4zvzk6m5.js +25 -0
- package/chunk-5ngmwd2s.js +3 -0
- package/chunk-5yzts6r0.js +3 -0
- package/chunk-6bvjnr88.js +3 -0
- package/chunk-76jjaj1p.js +7 -0
- package/chunk-792xwgne.js +2 -0
- package/chunk-7ph88zkj.js +3 -0
- package/chunk-7t89zqqx.js +8 -0
- package/chunk-80vdhw6b.js +2 -0
- package/chunk-89aqq5v0.js +59 -0
- package/chunk-8bcc3rqc.js +2 -0
- package/chunk-8bvjjs3r.js +3 -0
- package/chunk-97531m3c.js +2 -0
- package/chunk-9b4ssdy4.js +3 -0
- package/chunk-9map5c1b.js +12 -0
- package/chunk-a0ycrvgz.js +2 -0
- package/chunk-ah2ttnaa.js +2 -0
- package/chunk-awe58cxg.js +3175 -0
- package/chunk-b3ss17r8.js +547 -0
- package/chunk-b5ph3ffy.js +39 -0
- package/chunk-bkabw9yr.js +3 -0
- package/chunk-cz9r99b6.js +2 -0
- package/chunk-d57kcznk.js +16 -0
- package/chunk-ebmmdfq3.js +2 -0
- package/chunk-etf8mj2z.js +2 -0
- package/chunk-fkgx9eab.js +2 -0
- package/chunk-fmvs5wd0.js +11 -0
- package/chunk-fpksd95h.js +3 -0
- package/chunk-hj1zcq3p.js +13 -0
- package/chunk-hnqtkgcq.js +3 -0
- package/chunk-hrxkr8a8.js +3 -0
- package/chunk-jaat2z8t.js +117 -0
- package/chunk-jkc887x8.js +2 -0
- package/chunk-jnas3anm.js +3 -0
- package/chunk-k3p05x7q.js +2 -0
- package/chunk-k6fqtjt8.js +3 -0
- package/chunk-kh4b25x0.js +12 -0
- package/chunk-kn8p9hm4.js +3 -0
- package/chunk-kxznfjhk.js +2 -0
- package/chunk-ma4nhnnj.js +3 -0
- package/chunk-n09zsaws.js +60 -0
- package/chunk-nb7c0e4a.js +10 -0
- package/chunk-pvbaf50c.js +7 -0
- package/chunk-pzg6f8rv.js +3 -0
- package/chunk-q7scf6rq.js +5 -0
- package/chunk-qc0d97yy.js +9 -0
- package/chunk-qn316bye.js +3 -0
- package/chunk-rapgtezp.js +3 -0
- package/chunk-rbz68jdh.js +2 -0
- package/chunk-rkq3zqph.js +3 -0
- package/chunk-rva3kxc4.js +3 -0
- package/chunk-s8ce8wwb.js +5 -0
- package/chunk-srmxyfvj.js +4 -0
- package/chunk-ss48r7hh.js +2 -0
- package/chunk-sxrwwyp7.js +3 -0
- package/chunk-tb3tj3ct.js +2 -0
- package/chunk-trf8d8md.js +2 -0
- package/chunk-v312dzv1.js +2 -0
- package/chunk-v9pc3ad7.js +3 -0
- package/chunk-vq3b921g.js +2 -0
- package/chunk-w8arnzsm.js +10 -0
- package/chunk-wa3w6q66.js +2 -0
- package/chunk-wyaep3eb.js +103 -0
- package/chunk-x31xqemq.js +3 -0
- package/chunk-x4nt43pv.js +2 -0
- package/chunk-xjr4j102.js +31 -0
- package/chunk-xp5p6tsp.js +286 -0
- package/chunk-xtzxv389.js +3 -0
- package/chunk-y91ea95f.js +7 -0
- package/chunk-yyeq63ns.js +2 -0
- package/chunk-z1hbxv39.js +2 -0
- package/chunk-zej3kgxg.js +5 -0
- package/chunk-zkhn196x.js +25 -0
- package/chunk-zztar24h.js +8 -0
- package/compiled.js +13 -13
- package/package.json +1 -1
- package/ui-test-worker.js +58 -57
- package/web/chunk-0qmwgbg8.js +1 -0
- package/web/chunk-0qmwgbg8.js.br +0 -0
- package/web/chunk-0qmwgbg8.js.gz +0 -0
- package/web/chunk-0vavwwh2.js +2 -0
- package/web/chunk-0vavwwh2.js.br +0 -0
- package/web/chunk-0vavwwh2.js.gz +0 -0
- package/web/chunk-0vmbj6hc.js +89 -0
- package/web/chunk-0vmbj6hc.js.br +0 -0
- package/web/chunk-0vmbj6hc.js.gz +0 -0
- package/web/chunk-17qjx34e.js +1 -0
- package/web/chunk-17qjx34e.js.br +0 -0
- package/web/chunk-17qjx34e.js.gz +0 -0
- package/web/chunk-1mkzfr1m.js +2 -0
- package/web/chunk-1mkzfr1m.js.br +0 -0
- package/web/chunk-1mkzfr1m.js.gz +0 -0
- package/web/chunk-1v45hcve.js +1 -0
- package/web/chunk-1v45hcve.js.br +0 -0
- package/web/chunk-1v45hcve.js.gz +0 -0
- package/web/chunk-1vewct29.js +78 -0
- package/web/chunk-1vewct29.js.br +0 -0
- package/web/chunk-1vewct29.js.gz +0 -0
- package/web/chunk-2hz3atj2.js +1 -0
- package/web/chunk-2hz3atj2.js.br +0 -0
- package/web/chunk-2hz3atj2.js.gz +0 -0
- package/web/chunk-3c66z204.js +1 -0
- package/web/chunk-3c66z204.js.br +0 -0
- package/web/chunk-3c66z204.js.gz +0 -0
- package/web/chunk-3ctk7p8b.js +200 -0
- package/web/chunk-3ctk7p8b.js.br +0 -0
- package/web/chunk-3ctk7p8b.js.gz +0 -0
- package/web/chunk-3rnbw3ds.js +2 -0
- package/web/chunk-3rnbw3ds.js.br +0 -0
- package/web/chunk-3rnbw3ds.js.gz +0 -0
- package/web/chunk-3t6c1rn7.js +2 -0
- package/web/chunk-3t6c1rn7.js.br +0 -0
- package/web/chunk-3t6c1rn7.js.gz +0 -0
- package/web/chunk-48f75wpj.js +1 -0
- package/web/chunk-48f75wpj.js.br +0 -0
- package/web/chunk-48f75wpj.js.gz +0 -0
- package/web/chunk-4sr7g3z6.js +70 -0
- package/web/chunk-4sr7g3z6.js.br +0 -0
- package/web/chunk-4sr7g3z6.js.gz +0 -0
- package/web/chunk-54kxhs8a.js +1 -0
- package/web/chunk-54kxhs8a.js.br +0 -0
- package/web/chunk-54kxhs8a.js.gz +0 -0
- package/web/chunk-5cbw7v9g.js +324 -0
- package/web/chunk-5cbw7v9g.js.br +0 -0
- package/web/chunk-5cbw7v9g.js.gz +0 -0
- package/web/chunk-5kxhdpsw.js +99 -0
- package/web/chunk-5kxhdpsw.js.br +0 -0
- package/web/chunk-5kxhdpsw.js.gz +0 -0
- package/web/chunk-5s16b1h5.js +2 -0
- package/web/chunk-5s16b1h5.js.br +0 -0
- package/web/chunk-5s16b1h5.js.gz +0 -0
- package/web/chunk-5z2f4vfh.js +1 -0
- package/web/chunk-5z2f4vfh.js.br +0 -0
- package/web/chunk-5z2f4vfh.js.gz +0 -0
- package/web/chunk-664zwasq.js +217 -0
- package/web/chunk-664zwasq.js.br +0 -0
- package/web/chunk-664zwasq.js.gz +0 -0
- package/web/chunk-6hgxmv17.js +1 -0
- package/web/chunk-6hgxmv17.js.br +0 -0
- package/web/chunk-6hgxmv17.js.gz +0 -0
- package/web/chunk-6wesgn4j.js +332 -0
- package/web/chunk-6wesgn4j.js.br +0 -0
- package/web/chunk-6wesgn4j.js.gz +0 -0
- package/web/chunk-6xnzhe0e.js +12 -0
- package/web/chunk-6xnzhe0e.js.br +0 -0
- package/web/chunk-6xnzhe0e.js.gz +0 -0
- package/web/chunk-73effb3e.js +1 -0
- package/web/chunk-73effb3e.js.br +0 -0
- package/web/chunk-73effb3e.js.gz +0 -0
- package/web/chunk-744jv40n.js +7 -0
- package/web/chunk-744jv40n.js.br +0 -0
- package/web/chunk-744jv40n.js.gz +0 -0
- package/web/chunk-74x21fpx.js +23 -0
- package/web/chunk-74x21fpx.js.br +0 -0
- package/web/chunk-74x21fpx.js.gz +0 -0
- package/web/chunk-75jp6b07.js +1 -0
- package/web/chunk-75jp6b07.js.br +0 -0
- package/web/chunk-75jp6b07.js.gz +0 -0
- package/web/chunk-776d411a.js +1143 -0
- package/web/chunk-776d411a.js.br +0 -0
- package/web/chunk-776d411a.js.gz +0 -0
- package/web/chunk-77fdf0t8.js +1 -0
- package/web/chunk-77fdf0t8.js.br +0 -0
- package/web/chunk-77fdf0t8.js.gz +0 -0
- package/web/chunk-85cyf9df.js +1 -0
- package/web/chunk-85cyf9df.js.br +0 -0
- package/web/chunk-85cyf9df.js.gz +0 -0
- package/web/chunk-8kxc78xp.js +4 -0
- package/web/chunk-8kxc78xp.js.br +0 -0
- package/web/chunk-8kxc78xp.js.gz +0 -0
- package/web/chunk-9j7v0e4v.js +2 -0
- package/web/chunk-9j7v0e4v.js.br +0 -0
- package/web/chunk-9j7v0e4v.js.gz +0 -0
- package/web/chunk-9kfxbebp.js +2 -0
- package/web/chunk-9kfxbebp.js.br +1 -0
- package/web/chunk-9kfxbebp.js.gz +0 -0
- package/web/chunk-b1x8wmyp.js +1 -0
- package/web/chunk-b1x8wmyp.js.br +2 -0
- package/web/chunk-b1x8wmyp.js.gz +0 -0
- package/web/chunk-bpy0qc5f.js +1 -0
- package/web/chunk-bpy0qc5f.js.br +0 -0
- package/web/chunk-bpy0qc5f.js.gz +0 -0
- package/web/chunk-brsvdef4.js +1 -0
- package/web/chunk-brsvdef4.js.br +0 -0
- package/web/chunk-brsvdef4.js.gz +0 -0
- package/web/chunk-bs8vnwtv.js +106 -0
- package/web/chunk-bs8vnwtv.js.br +0 -0
- package/web/chunk-bs8vnwtv.js.gz +0 -0
- package/web/chunk-cd3hhgn9.js +2 -0
- package/web/chunk-cd3hhgn9.js.br +0 -0
- package/web/chunk-cd3hhgn9.js.gz +0 -0
- package/web/chunk-ckpx6ky8.js +2 -0
- package/web/chunk-ckpx6ky8.js.br +0 -0
- package/web/chunk-ckpx6ky8.js.gz +0 -0
- package/web/chunk-cn4846p5.js +140 -0
- package/web/chunk-cn4846p5.js.br +0 -0
- package/web/chunk-cn4846p5.js.gz +0 -0
- package/web/chunk-cngcze57.js +84 -0
- package/web/chunk-cngcze57.js.br +0 -0
- package/web/chunk-cngcze57.js.gz +0 -0
- package/web/chunk-csg9anab.js +62 -0
- package/web/chunk-csg9anab.js.br +0 -0
- package/web/chunk-csg9anab.js.gz +0 -0
- package/web/chunk-ct98jt0b.js +2 -0
- package/web/chunk-ct98jt0b.js.br +0 -0
- package/web/chunk-ct98jt0b.js.gz +0 -0
- package/web/chunk-d67p0nr5.js +8 -0
- package/web/chunk-d67p0nr5.js.br +0 -0
- package/web/chunk-d67p0nr5.js.gz +0 -0
- package/web/chunk-dfv95z6w.js +1 -0
- package/web/chunk-dfv95z6w.js.br +0 -0
- package/web/chunk-dfv95z6w.js.gz +0 -0
- package/web/chunk-dqynqkew.js +3 -0
- package/web/chunk-dqynqkew.js.br +0 -0
- package/web/chunk-dqynqkew.js.gz +0 -0
- package/web/chunk-drn8wj2p.js +41 -0
- package/web/chunk-drn8wj2p.js.br +0 -0
- package/web/chunk-drn8wj2p.js.gz +0 -0
- package/web/chunk-e0r89rgm.js +2 -0
- package/web/chunk-e0r89rgm.js.br +0 -0
- package/web/chunk-e0r89rgm.js.gz +0 -0
- package/web/chunk-e6ffgm2z.js +89 -0
- package/web/chunk-e6ffgm2z.js.br +0 -0
- package/web/chunk-e6ffgm2z.js.gz +0 -0
- package/web/chunk-ebphre6k.js +292 -0
- package/web/chunk-ebphre6k.js.br +0 -0
- package/web/chunk-ebphre6k.js.gz +0 -0
- package/web/chunk-edeebkv0.js +2 -0
- package/web/chunk-edeebkv0.js.br +0 -0
- package/web/chunk-edeebkv0.js.gz +0 -0
- package/web/chunk-edkvcg8g.js +1 -0
- package/web/chunk-edkvcg8g.js.br +0 -0
- package/web/chunk-edkvcg8g.js.gz +0 -0
- package/web/chunk-evt920fg.js +142 -0
- package/web/chunk-evt920fg.js.br +0 -0
- package/web/chunk-evt920fg.js.gz +0 -0
- package/web/chunk-ezehzx5e.js +1 -0
- package/web/chunk-ezehzx5e.js.br +2 -0
- package/web/chunk-ezehzx5e.js.gz +0 -0
- package/web/chunk-f020aqdg.js +38 -0
- package/web/chunk-f020aqdg.js.br +0 -0
- package/web/chunk-f020aqdg.js.gz +0 -0
- package/web/chunk-f5a5x6be.js +1 -0
- package/web/chunk-f5a5x6be.js.br +0 -0
- package/web/chunk-f5a5x6be.js.gz +0 -0
- package/web/chunk-f9rv8b13.js +1 -0
- package/web/chunk-f9rv8b13.js.br +0 -0
- package/web/chunk-f9rv8b13.js.gz +0 -0
- package/web/chunk-fkmw2m49.js +1 -0
- package/web/chunk-fkmw2m49.js.br +0 -0
- package/web/chunk-fkmw2m49.js.gz +0 -0
- package/web/chunk-fn0hha9d.js +2 -0
- package/web/chunk-fn0hha9d.js.br +0 -0
- package/web/chunk-fn0hha9d.js.gz +0 -0
- package/web/chunk-fp5ny5dy.js +4 -0
- package/web/chunk-fp5ny5dy.js.br +0 -0
- package/web/chunk-fp5ny5dy.js.gz +0 -0
- package/web/chunk-fwckng4e.js +34 -0
- package/web/chunk-fwckng4e.js.br +0 -0
- package/web/chunk-fwckng4e.js.gz +0 -0
- package/web/chunk-g7yyp4ks.js +2 -0
- package/web/chunk-g7yyp4ks.js.br +0 -0
- package/web/chunk-g7yyp4ks.js.gz +0 -0
- package/web/chunk-gbhkp5f4.js +1 -0
- package/web/chunk-gbhkp5f4.js.br +2 -0
- package/web/chunk-gbhkp5f4.js.gz +0 -0
- package/web/chunk-ghz85g7f.js +1 -0
- package/web/chunk-ghz85g7f.js.br +0 -0
- package/web/chunk-ghz85g7f.js.gz +0 -0
- package/web/chunk-gpjdkgxz.js +2 -0
- package/web/chunk-gpjdkgxz.js.br +0 -0
- package/web/chunk-gpjdkgxz.js.gz +0 -0
- package/web/chunk-h3d8gb7m.js +1 -0
- package/web/chunk-h3d8gb7m.js.br +0 -0
- package/web/chunk-h3d8gb7m.js.gz +0 -0
- package/web/chunk-h47k4j7f.js +1 -0
- package/web/chunk-h47k4j7f.js.br +0 -0
- package/web/chunk-h47k4j7f.js.gz +0 -0
- package/web/chunk-h702ns45.js +1 -0
- package/web/chunk-h702ns45.js.br +0 -0
- package/web/chunk-h702ns45.js.gz +0 -0
- package/web/chunk-j3tjbge9.js +1 -0
- package/web/chunk-j3tjbge9.js.br +0 -0
- package/web/chunk-j3tjbge9.js.gz +0 -0
- package/web/chunk-j91f1v68.js +2 -0
- package/web/chunk-j91f1v68.js.br +0 -0
- package/web/chunk-j91f1v68.js.gz +0 -0
- package/web/chunk-jd82z5gg.js +1 -0
- package/web/chunk-jd82z5gg.js.br +0 -0
- package/web/chunk-jd82z5gg.js.gz +0 -0
- package/web/chunk-jmksme0n.js +2 -0
- package/web/chunk-jmksme0n.js.br +0 -0
- package/web/chunk-jmksme0n.js.gz +0 -0
- package/web/chunk-jz0wjyzp.js +7 -0
- package/web/chunk-jz0wjyzp.js.br +0 -0
- package/web/chunk-jz0wjyzp.js.gz +0 -0
- package/web/chunk-ka8jrbr5.js +55 -0
- package/web/chunk-ka8jrbr5.js.br +0 -0
- package/web/chunk-ka8jrbr5.js.gz +0 -0
- package/web/chunk-m770h1wv.js +2 -0
- package/web/chunk-m770h1wv.js.br +0 -0
- package/web/chunk-m770h1wv.js.gz +0 -0
- package/web/chunk-mfsdyw6v.js +2 -0
- package/web/chunk-mfsdyw6v.js.br +0 -0
- package/web/chunk-mfsdyw6v.js.gz +0 -0
- package/web/chunk-mvmpr9bn.js +1 -0
- package/web/chunk-mvmpr9bn.js.br +0 -0
- package/web/chunk-mvmpr9bn.js.gz +0 -0
- package/web/chunk-mx1e3jgh.js +1 -0
- package/web/chunk-mx1e3jgh.js.br +0 -0
- package/web/chunk-mx1e3jgh.js.gz +0 -0
- package/web/chunk-my4zxtxx.js +2 -0
- package/web/chunk-my4zxtxx.js.br +0 -0
- package/web/chunk-my4zxtxx.js.gz +0 -0
- package/web/chunk-n7nx158t.js +1 -0
- package/web/chunk-n7nx158t.js.br +0 -0
- package/web/chunk-n7nx158t.js.gz +0 -0
- package/web/chunk-na88frn3.js +1 -0
- package/web/chunk-na88frn3.js.br +0 -0
- package/web/chunk-na88frn3.js.gz +0 -0
- package/web/chunk-nbncq48b.js +1 -0
- package/web/chunk-nbncq48b.js.br +0 -0
- package/web/chunk-nbncq48b.js.gz +0 -0
- package/web/chunk-nyydkfyf.js +1 -0
- package/web/chunk-nyydkfyf.js.br +0 -0
- package/web/chunk-nyydkfyf.js.gz +0 -0
- package/web/chunk-nz06k08x.js +39 -0
- package/web/chunk-nz06k08x.js.br +0 -0
- package/web/chunk-nz06k08x.js.gz +0 -0
- package/web/chunk-p62swsj6.js +139 -0
- package/web/chunk-p62swsj6.js.br +0 -0
- package/web/chunk-p62swsj6.js.gz +0 -0
- package/web/chunk-pajjgx94.js +169 -0
- package/web/chunk-pajjgx94.js.br +0 -0
- package/web/chunk-pajjgx94.js.gz +0 -0
- package/web/chunk-phdpzq61.js +370 -0
- package/web/chunk-phdpzq61.js.br +0 -0
- package/web/chunk-phdpzq61.js.gz +0 -0
- package/web/chunk-pj9r4ha1.js +2 -0
- package/web/chunk-pj9r4ha1.js.br +0 -0
- package/web/chunk-pj9r4ha1.js.gz +0 -0
- package/web/chunk-pqvre6md.js +24 -0
- package/web/chunk-pqvre6md.js.br +0 -0
- package/web/chunk-pqvre6md.js.gz +0 -0
- package/web/chunk-pvq527d1.js +303 -0
- package/web/chunk-pvq527d1.js.br +0 -0
- package/web/chunk-pvq527d1.js.gz +0 -0
- package/web/chunk-pzbqpfpj.js +24 -0
- package/web/chunk-pzbqpfpj.js.br +0 -0
- package/web/chunk-pzbqpfpj.js.gz +0 -0
- package/web/chunk-q3v1563q.js +2 -0
- package/web/chunk-q3v1563q.js.br +0 -0
- package/web/chunk-q3v1563q.js.gz +0 -0
- package/web/chunk-q6vt7t8d.js +2 -0
- package/web/chunk-q6vt7t8d.js.br +0 -0
- package/web/chunk-q6vt7t8d.js.gz +0 -0
- package/web/chunk-q990zhg4.js +1 -0
- package/web/chunk-q990zhg4.js.br +0 -0
- package/web/chunk-q990zhg4.js.gz +0 -0
- package/web/chunk-qed51xj9.js +2 -0
- package/web/chunk-qed51xj9.js.br +0 -0
- package/web/chunk-qed51xj9.js.gz +0 -0
- package/web/chunk-r9m8jh7x.js +2 -0
- package/web/chunk-r9m8jh7x.js.br +0 -0
- package/web/chunk-r9m8jh7x.js.gz +0 -0
- package/web/chunk-rjax57j0.js +40 -0
- package/web/chunk-rjax57j0.js.br +0 -0
- package/web/chunk-rjax57j0.js.gz +0 -0
- package/web/chunk-s00tks2b.js +98 -0
- package/web/chunk-s00tks2b.js.br +0 -0
- package/web/chunk-s00tks2b.js.gz +0 -0
- package/web/chunk-s3symq0h.js +1 -0
- package/web/chunk-s3symq0h.js.br +0 -0
- package/web/chunk-s3symq0h.js.gz +0 -0
- package/web/chunk-sh2d0212.js +1 -0
- package/web/chunk-sh2d0212.js.br +0 -0
- package/web/chunk-sh2d0212.js.gz +0 -0
- package/web/chunk-t8ksmf3z.js +2 -0
- package/web/chunk-t8ksmf3z.js.br +0 -0
- package/web/chunk-t8ksmf3z.js.gz +0 -0
- package/web/chunk-te4ab7ee.css +1 -0
- package/web/chunk-te4ab7ee.css.br +0 -0
- package/web/chunk-te4ab7ee.css.gz +0 -0
- package/web/chunk-tjhxbt15.js +1 -0
- package/web/chunk-tjhxbt15.js.br +0 -0
- package/web/chunk-tjhxbt15.js.gz +0 -0
- package/web/chunk-tqr5maem.js +291 -0
- package/web/chunk-tqr5maem.js.br +0 -0
- package/web/chunk-tqr5maem.js.gz +0 -0
- package/web/chunk-tt3vgkx6.js +7 -0
- package/web/chunk-tt3vgkx6.js.br +0 -0
- package/web/chunk-tt3vgkx6.js.gz +0 -0
- package/web/chunk-v56w6y8n.js +2 -0
- package/web/chunk-v56w6y8n.js.br +0 -0
- package/web/chunk-v56w6y8n.js.gz +0 -0
- package/web/chunk-v65dz9y5.js +1 -0
- package/web/chunk-v65dz9y5.js.br +0 -0
- package/web/chunk-v65dz9y5.js.gz +0 -0
- package/web/chunk-vaspzebe.js +1 -0
- package/web/chunk-vaspzebe.js.br +0 -0
- package/web/chunk-vaspzebe.js.gz +0 -0
- package/web/chunk-ve5dccwy.js +1 -0
- package/web/chunk-ve5dccwy.js.br +0 -0
- package/web/chunk-ve5dccwy.js.gz +0 -0
- package/web/chunk-vsxzq4nb.js +1 -0
- package/web/chunk-vsxzq4nb.js.br +0 -0
- package/web/chunk-vsxzq4nb.js.gz +0 -0
- package/web/chunk-vvn66f2x.js +16 -0
- package/web/chunk-vvn66f2x.js.br +0 -0
- package/web/chunk-vvn66f2x.js.gz +0 -0
- package/web/chunk-vvqey05d.js +1 -0
- package/web/chunk-vvqey05d.js.br +2 -0
- package/web/chunk-vvqey05d.js.gz +0 -0
- package/web/chunk-w6ajcbm8.js +1 -0
- package/web/chunk-w6ajcbm8.js.br +0 -0
- package/web/chunk-w6ajcbm8.js.gz +0 -0
- package/web/chunk-w6p6dy3k.js +2 -0
- package/web/chunk-w6p6dy3k.js.br +0 -0
- package/web/chunk-w6p6dy3k.js.gz +0 -0
- package/web/chunk-wy1k8vz2.js +1 -0
- package/web/chunk-wy1k8vz2.js.br +0 -0
- package/web/chunk-wy1k8vz2.js.gz +0 -0
- package/web/chunk-wzgv2gv2.js +120 -0
- package/web/chunk-wzgv2gv2.js.br +0 -0
- package/web/chunk-wzgv2gv2.js.gz +0 -0
- package/web/chunk-x78hqhxv.js +1 -0
- package/web/chunk-x78hqhxv.js.br +2 -0
- package/web/chunk-x78hqhxv.js.gz +0 -0
- package/web/chunk-x7mw8704.js +36 -0
- package/web/chunk-x7mw8704.js.br +0 -0
- package/web/chunk-x7mw8704.js.gz +0 -0
- package/web/chunk-x85z35es.js +2 -0
- package/web/chunk-x85z35es.js.br +0 -0
- package/web/chunk-x85z35es.js.gz +0 -0
- package/web/chunk-xbrhmxd8.js +214 -0
- package/web/chunk-xbrhmxd8.js.br +0 -0
- package/web/chunk-xbrhmxd8.js.gz +0 -0
- package/web/chunk-xjpqg11m.js +1 -0
- package/web/chunk-xjpqg11m.js.br +0 -0
- package/web/chunk-xjpqg11m.js.gz +0 -0
- package/web/chunk-xkqekh81.js +2 -0
- package/web/chunk-xkqekh81.js.br +0 -0
- package/web/chunk-xkqekh81.js.gz +0 -0
- package/web/chunk-y2x9v76f.js +2 -0
- package/web/chunk-y2x9v76f.js.br +0 -0
- package/web/chunk-y2x9v76f.js.gz +0 -0
- package/web/chunk-y48mj5d7.js +1 -0
- package/web/chunk-y48mj5d7.js.br +0 -0
- package/web/chunk-y48mj5d7.js.gz +0 -0
- package/web/chunk-ykc1rttf.js +1 -0
- package/web/chunk-ykc1rttf.js.br +0 -0
- package/web/chunk-ykc1rttf.js.gz +0 -0
- package/web/chunk-yyw0rdyy.js +1 -0
- package/web/chunk-yyw0rdyy.js.br +0 -0
- package/web/chunk-yyw0rdyy.js.gz +0 -0
- package/web/chunk-yzyrc28t.js +30 -0
- package/web/chunk-yzyrc28t.js.br +0 -0
- package/web/chunk-yzyrc28t.js.gz +0 -0
- package/web/chunk-z7j6wnn3.js +2 -0
- package/web/chunk-z7j6wnn3.js.br +0 -0
- package/web/chunk-z7j6wnn3.js.gz +0 -0
- package/web/chunk-z8fgdsx5.js +1 -0
- package/web/chunk-z8fgdsx5.js.br +0 -0
- package/web/chunk-z8fgdsx5.js.gz +0 -0
- package/web/chunk-zcjdarjr.js +1 -0
- package/web/chunk-zcjdarjr.js.br +0 -0
- package/web/chunk-zcjdarjr.js.gz +0 -0
- package/web/explorer-ttd27vzr.png +0 -0
- package/web/finder-aynbqpvz.png +0 -0
- package/web/idea-c8rwk1e2.png +0 -0
- package/web/index.html +3 -13
- package/web/index.html.br +0 -0
- package/web/index.html.gz +0 -0
- package/web/manifest-g1mfa85c.webmanifest +35 -0
- package/web/manifest-g1mfa85c.webmanifest.br +0 -0
- package/web/manifest-g1mfa85c.webmanifest.gz +0 -0
- package/web/manifest.webmanifest +2 -2
- package/web/manifest.webmanifest.br +0 -0
- package/web/manifest.webmanifest.gz +0 -0
- package/web/sw.js +36 -17
- package/web/sw.js.br +0 -0
- package/web/sw.js.gz +0 -0
- package/web/vscode-33qgcrqp.png +0 -0
- package/worker.js +1 -1
- package/chunk-082x3g29.js +0 -3
- package/chunk-0aaf270z.js +0 -3
- package/chunk-0dqv9x0y.js +0 -51
- package/chunk-0ns02fzq.js +0 -2
- package/chunk-0y13kfpt.js +0 -5
- package/chunk-1753m6xk.js +0 -4179
- package/chunk-24ae99b6.js +0 -5
- package/chunk-2cp8why4.js +0 -2
- package/chunk-3bdzn4h2.js +0 -2
- package/chunk-48m0w8xg.js +0 -2
- package/chunk-4pr7ykh0.js +0 -2
- package/chunk-4qtw5cga.js +0 -12
- package/chunk-4yqge35f.js +0 -3
- package/chunk-65rd9zn4.js +0 -3
- package/chunk-67ehvv4n.js +0 -44
- package/chunk-6wm62kte.js +0 -18
- package/chunk-6zkggkdm.js +0 -13
- package/chunk-78ferdza.js +0 -3
- package/chunk-794r8w6m.js +0 -2
- package/chunk-7azn0brs.js +0 -7
- package/chunk-7wh4n0yg.js +0 -2
- package/chunk-7z0wh161.js +0 -25
- package/chunk-95aqrqnh.js +0 -2
- package/chunk-9nkb5q43.js +0 -3
- package/chunk-a0zcps2d.js +0 -2
- package/chunk-a23pv6tv.js +0 -3
- package/chunk-adb2nbxk.js +0 -2
- package/chunk-as2ty5w5.js +0 -3
- package/chunk-b84y794v.js +0 -3
- package/chunk-bh80e336.js +0 -3
- package/chunk-c6azecvs.js +0 -3
- package/chunk-cc8h8mz9.js +0 -2
- package/chunk-cdb6caq7.js +0 -3
- package/chunk-cjdbsa9s.js +0 -3
- package/chunk-cnqgtmwm.js +0 -10
- package/chunk-cwn9vs1a.js +0 -3
- package/chunk-cxybp3fn.js +0 -8
- package/chunk-dea2htm4.js +0 -2
- package/chunk-e01wravf.js +0 -12
- package/chunk-f0pz8pvb.js +0 -5
- package/chunk-fsekbhqb.js +0 -3
- package/chunk-fvmrsrmq.js +0 -3
- package/chunk-fwdhn0gw.js +0 -7
- package/chunk-h7x8g57v.js +0 -9
- package/chunk-h8qhy3px.js +0 -39
- package/chunk-hsvchrh3.js +0 -7
- package/chunk-j1peg724.js +0 -504
- package/chunk-j2cse817.js +0 -63
- package/chunk-j3jzgw98.js +0 -31
- package/chunk-jmzdtefg.js +0 -2
- package/chunk-k0e6n6yy.js +0 -3
- package/chunk-mb2jqd5z.js +0 -3
- package/chunk-nbgtqpay.js +0 -3
- package/chunk-prfczhpq.js +0 -10
- package/chunk-pv25a7sw.js +0 -2
- package/chunk-q8m2x20d.js +0 -286
- package/chunk-qnkxeh37.js +0 -3
- package/chunk-qvfrv3rb.js +0 -59
- package/chunk-r14x07ez.js +0 -2
- package/chunk-r1kah65k.js +0 -2
- package/chunk-r6pt44wk.js +0 -60
- package/chunk-rhkw8ygf.js +0 -3
- package/chunk-rvqeb7gr.js +0 -3
- package/chunk-rwa7mfwa.js +0 -2
- package/chunk-sj46f002.js +0 -2
- package/chunk-sp89jja7.js +0 -3
- package/chunk-sss5x2ak.js +0 -2
- package/chunk-szn4y5mx.js +0 -25
- package/chunk-t05q9ksf.js +0 -2
- package/chunk-tb66q678.js +0 -11
- package/chunk-tej75y8n.js +0 -2
- package/chunk-tmfr2ym8.js +0 -4
- package/chunk-tnay319j.js +0 -3
- package/chunk-txwheg1n.js +0 -2
- package/chunk-ve6n38r4.js +0 -16
- package/chunk-vfa49qcy.js +0 -3
- package/chunk-wcy1r6vv.js +0 -2
- package/chunk-wj6am3ag.js +0 -3
- package/chunk-x0afp8wt.js +0 -3
- package/chunk-xe627eyp.js +0 -20
- package/chunk-y18ey7s9.js +0 -8
- package/chunk-y9r7tt53.js +0 -3
- package/chunk-yq20v3va.js +0 -3
- package/chunk-yyg4ygv7.js +0 -2
- package/chunk-z2zhr4e5.js +0 -3
- package/chunk-zdtg52xn.js +0 -2
- package/chunk-zrhdrkdb.js +0 -5
- package/web/chunk-0d0fwb7b.js +0 -2
- package/web/chunk-0d0fwb7b.js.br +0 -0
- package/web/chunk-0d0fwb7b.js.gz +0 -0
- package/web/chunk-0jm4zyrt.js +0 -1
- package/web/chunk-0jm4zyrt.js.br +0 -0
- package/web/chunk-0jm4zyrt.js.gz +0 -0
- package/web/chunk-0pp7dzx1.js +0 -1
- package/web/chunk-0pp7dzx1.js.br +0 -0
- package/web/chunk-0pp7dzx1.js.gz +0 -0
- package/web/chunk-0w73jp4n.js +0 -1
- package/web/chunk-0w73jp4n.js.br +0 -0
- package/web/chunk-0w73jp4n.js.gz +0 -0
- package/web/chunk-1416f30c.js +0 -2
- package/web/chunk-1416f30c.js.br +0 -0
- package/web/chunk-1416f30c.js.gz +0 -0
- package/web/chunk-18wyawez.js +0 -30
- package/web/chunk-18wyawez.js.br +0 -0
- package/web/chunk-18wyawez.js.gz +0 -0
- package/web/chunk-19ew9re5.js +0 -1
- package/web/chunk-19ew9re5.js.br +0 -0
- package/web/chunk-19ew9re5.js.gz +0 -0
- package/web/chunk-1mdtr9wk.js +0 -8
- package/web/chunk-1mdtr9wk.js.br +0 -1
- package/web/chunk-1mdtr9wk.js.gz +0 -0
- package/web/chunk-1p4egv85.js +0 -1
- package/web/chunk-1p4egv85.js.br +0 -0
- package/web/chunk-1p4egv85.js.gz +0 -0
- package/web/chunk-1x61dvvr.js +0 -2
- package/web/chunk-1x61dvvr.js.br +0 -0
- package/web/chunk-1x61dvvr.js.gz +0 -0
- package/web/chunk-241n0y1h.js +0 -1
- package/web/chunk-241n0y1h.js.br +0 -0
- package/web/chunk-241n0y1h.js.gz +0 -0
- package/web/chunk-26sgnzb2.js +0 -1
- package/web/chunk-26sgnzb2.js.br +0 -0
- package/web/chunk-26sgnzb2.js.gz +0 -0
- package/web/chunk-2p77pefd.js +0 -1
- package/web/chunk-2p77pefd.js.br +0 -0
- package/web/chunk-2p77pefd.js.gz +0 -0
- package/web/chunk-2ppe5znq.js +0 -1
- package/web/chunk-2ppe5znq.js.br +0 -0
- package/web/chunk-2ppe5znq.js.gz +0 -0
- package/web/chunk-2qzr943m.js +0 -2
- package/web/chunk-2qzr943m.js.br +0 -0
- package/web/chunk-2qzr943m.js.gz +0 -0
- package/web/chunk-32k44660.js +0 -214
- package/web/chunk-32k44660.js.br +0 -0
- package/web/chunk-32k44660.js.gz +0 -0
- package/web/chunk-33zb5a76.js +0 -2
- package/web/chunk-33zb5a76.js.br +0 -0
- package/web/chunk-33zb5a76.js.gz +0 -0
- package/web/chunk-38bzkv9k.js +0 -7
- package/web/chunk-38bzkv9k.js.br +0 -0
- package/web/chunk-38bzkv9k.js.gz +0 -0
- package/web/chunk-42ytz496.js +0 -1
- package/web/chunk-42ytz496.js.br +0 -0
- package/web/chunk-42ytz496.js.gz +0 -0
- package/web/chunk-4749rrqv.js +0 -55
- package/web/chunk-4749rrqv.js.br +0 -0
- package/web/chunk-4749rrqv.js.gz +0 -0
- package/web/chunk-4d57cnh5.js +0 -40
- package/web/chunk-4d57cnh5.js.br +0 -0
- package/web/chunk-4d57cnh5.js.gz +0 -0
- package/web/chunk-4gh3hcrc.js +0 -1
- package/web/chunk-4gh3hcrc.js.br +0 -0
- package/web/chunk-4gh3hcrc.js.gz +0 -0
- package/web/chunk-4hg08mj3.js +0 -1
- package/web/chunk-4hg08mj3.js.br +0 -0
- package/web/chunk-4hg08mj3.js.gz +0 -0
- package/web/chunk-4rra9tt7.js +0 -78
- package/web/chunk-4rra9tt7.js.br +0 -0
- package/web/chunk-4rra9tt7.js.gz +0 -0
- package/web/chunk-572kjbne.js +0 -89
- package/web/chunk-572kjbne.js.br +0 -0
- package/web/chunk-572kjbne.js.gz +0 -0
- package/web/chunk-5hqe3cct.js +0 -98
- package/web/chunk-5hqe3cct.js.br +0 -0
- package/web/chunk-5hqe3cct.js.gz +0 -0
- package/web/chunk-5k4vdcwk.js +0 -24
- package/web/chunk-5k4vdcwk.js.br +0 -0
- package/web/chunk-5k4vdcwk.js.gz +0 -0
- package/web/chunk-5z44jbdc.js +0 -1
- package/web/chunk-5z44jbdc.js.br +0 -0
- package/web/chunk-5z44jbdc.js.gz +0 -0
- package/web/chunk-600x58nm.js +0 -1143
- package/web/chunk-600x58nm.js.br +0 -0
- package/web/chunk-600x58nm.js.gz +0 -0
- package/web/chunk-61djfs0t.js +0 -140
- package/web/chunk-61djfs0t.js.br +0 -0
- package/web/chunk-61djfs0t.js.gz +0 -0
- package/web/chunk-6j4jdvtd.js +0 -1
- package/web/chunk-6j4jdvtd.js.br +0 -0
- package/web/chunk-6j4jdvtd.js.gz +0 -0
- package/web/chunk-74ymgabb.js +0 -2
- package/web/chunk-74ymgabb.js.br +0 -0
- package/web/chunk-74ymgabb.js.gz +0 -0
- package/web/chunk-768vchz5.js +0 -169
- package/web/chunk-768vchz5.js.br +0 -0
- package/web/chunk-768vchz5.js.gz +0 -0
- package/web/chunk-7f87paxe.js +0 -36
- package/web/chunk-7f87paxe.js.br +0 -0
- package/web/chunk-7f87paxe.js.gz +0 -0
- package/web/chunk-7ns0kj87.js +0 -2
- package/web/chunk-7ns0kj87.js.br +0 -0
- package/web/chunk-7ns0kj87.js.gz +0 -0
- package/web/chunk-7vpk9y00.js +0 -1
- package/web/chunk-7vpk9y00.js.br +0 -0
- package/web/chunk-7vpk9y00.js.gz +0 -0
- package/web/chunk-89mc1vj3.js +0 -1
- package/web/chunk-89mc1vj3.js.br +0 -0
- package/web/chunk-89mc1vj3.js.gz +0 -0
- package/web/chunk-8wgpesrk.js +0 -139
- package/web/chunk-8wgpesrk.js.br +0 -0
- package/web/chunk-8wgpesrk.js.gz +0 -0
- package/web/chunk-9nh1aeqs.js +0 -303
- package/web/chunk-9nh1aeqs.js.br +0 -0
- package/web/chunk-9nh1aeqs.js.gz +0 -0
- package/web/chunk-9pgq2ax4.js +0 -1
- package/web/chunk-9pgq2ax4.js.br +0 -0
- package/web/chunk-9pgq2ax4.js.gz +0 -0
- package/web/chunk-9tfs2dg1.js +0 -1
- package/web/chunk-9tfs2dg1.js.br +0 -0
- package/web/chunk-9tfs2dg1.js.gz +0 -0
- package/web/chunk-9wemd2wn.js +0 -41
- package/web/chunk-9wemd2wn.js.br +0 -0
- package/web/chunk-9wemd2wn.js.gz +0 -0
- package/web/chunk-9wsz2j8n.js +0 -1
- package/web/chunk-9wsz2j8n.js.br +0 -0
- package/web/chunk-9wsz2j8n.js.gz +0 -0
- package/web/chunk-9wzvqpre.js +0 -2
- package/web/chunk-9wzvqpre.js.br +0 -0
- package/web/chunk-9wzvqpre.js.gz +0 -0
- package/web/chunk-a48wgrb1.js +0 -1
- package/web/chunk-a48wgrb1.js.br +0 -2
- package/web/chunk-a48wgrb1.js.gz +0 -0
- package/web/chunk-ah8e1y9j.js +0 -4
- package/web/chunk-ah8e1y9j.js.br +0 -0
- package/web/chunk-ah8e1y9j.js.gz +0 -0
- package/web/chunk-amsr9cg2.js +0 -1
- package/web/chunk-amsr9cg2.js.br +0 -0
- package/web/chunk-amsr9cg2.js.gz +0 -0
- package/web/chunk-aps2c5t2.js +0 -16
- package/web/chunk-aps2c5t2.js.br +0 -0
- package/web/chunk-aps2c5t2.js.gz +0 -0
- package/web/chunk-avfynf6y.js +0 -1
- package/web/chunk-avfynf6y.js.br +0 -0
- package/web/chunk-avfynf6y.js.gz +0 -0
- package/web/chunk-b5zrttcx.js +0 -2
- package/web/chunk-b5zrttcx.js.br +0 -0
- package/web/chunk-b5zrttcx.js.gz +0 -0
- package/web/chunk-bvvf024a.js +0 -24
- package/web/chunk-bvvf024a.js.br +0 -0
- package/web/chunk-bvvf024a.js.gz +0 -0
- package/web/chunk-by2dphx7.js +0 -200
- package/web/chunk-by2dphx7.js.br +0 -0
- package/web/chunk-by2dphx7.js.gz +0 -0
- package/web/chunk-c0sc2yy1.js +0 -1
- package/web/chunk-c0sc2yy1.js.br +0 -0
- package/web/chunk-c0sc2yy1.js.gz +0 -0
- package/web/chunk-c612n2pw.js +0 -2
- package/web/chunk-c612n2pw.js.br +0 -0
- package/web/chunk-c612n2pw.js.gz +0 -0
- package/web/chunk-c91rk85x.js +0 -2
- package/web/chunk-c91rk85x.js.br +0 -0
- package/web/chunk-c91rk85x.js.gz +0 -0
- package/web/chunk-catm30vp.js +0 -2
- package/web/chunk-catm30vp.js.br +0 -0
- package/web/chunk-catm30vp.js.gz +0 -0
- package/web/chunk-cbdxzddd.js +0 -142
- package/web/chunk-cbdxzddd.js.br +0 -0
- package/web/chunk-cbdxzddd.js.gz +0 -0
- package/web/chunk-cng693ts.js +0 -2
- package/web/chunk-cng693ts.js.br +0 -0
- package/web/chunk-cng693ts.js.gz +0 -0
- package/web/chunk-d5vcma5a.js +0 -89
- package/web/chunk-d5vcma5a.js.br +0 -0
- package/web/chunk-d5vcma5a.js.gz +0 -0
- package/web/chunk-d6d9cp71.js +0 -1
- package/web/chunk-d6d9cp71.js.br +0 -2
- package/web/chunk-d6d9cp71.js.gz +0 -0
- package/web/chunk-dsghhcew.js +0 -1
- package/web/chunk-dsghhcew.js.br +0 -0
- package/web/chunk-dsghhcew.js.gz +0 -0
- package/web/chunk-dt2e6evf.js +0 -1
- package/web/chunk-dt2e6evf.js.br +0 -0
- package/web/chunk-dt2e6evf.js.gz +0 -0
- package/web/chunk-dxrsmcah.js +0 -1
- package/web/chunk-dxrsmcah.js.br +0 -0
- package/web/chunk-dxrsmcah.js.gz +0 -0
- package/web/chunk-ent5zx24.js +0 -1
- package/web/chunk-ent5zx24.js.br +0 -2
- package/web/chunk-ent5zx24.js.gz +0 -0
- package/web/chunk-f4n1q3mf.js +0 -1
- package/web/chunk-f4n1q3mf.js.br +0 -0
- package/web/chunk-f4n1q3mf.js.gz +0 -0
- package/web/chunk-fdfrv6bc.js +0 -1
- package/web/chunk-fdfrv6bc.js.br +0 -2
- package/web/chunk-fdfrv6bc.js.gz +0 -0
- package/web/chunk-fh44xz70.js +0 -1
- package/web/chunk-fh44xz70.js.br +0 -0
- package/web/chunk-fh44xz70.js.gz +0 -0
- package/web/chunk-fkbp72gk.js +0 -1
- package/web/chunk-fkbp72gk.js.br +0 -0
- package/web/chunk-fkbp72gk.js.gz +0 -0
- package/web/chunk-fzkjgwzq.js +0 -4
- package/web/chunk-fzkjgwzq.js.br +0 -0
- package/web/chunk-fzkjgwzq.js.gz +0 -0
- package/web/chunk-gf2gznsb.js +0 -38
- package/web/chunk-gf2gznsb.js.br +0 -0
- package/web/chunk-gf2gznsb.js.gz +0 -0
- package/web/chunk-gne1ybac.js +0 -2
- package/web/chunk-gne1ybac.js.br +0 -0
- package/web/chunk-gne1ybac.js.gz +0 -0
- package/web/chunk-gws1fj71.js +0 -106
- package/web/chunk-gws1fj71.js.br +0 -0
- package/web/chunk-gws1fj71.js.gz +0 -0
- package/web/chunk-h4m88fg8.js +0 -2
- package/web/chunk-h4m88fg8.js.br +0 -0
- package/web/chunk-h4m88fg8.js.gz +0 -0
- package/web/chunk-h4vk09kd.js +0 -2
- package/web/chunk-h4vk09kd.js.br +0 -0
- package/web/chunk-h4vk09kd.js.gz +0 -0
- package/web/chunk-h6wzjfj2.js +0 -34
- package/web/chunk-h6wzjfj2.js.br +0 -0
- package/web/chunk-h6wzjfj2.js.gz +0 -0
- package/web/chunk-hajg1p0h.js +0 -7
- package/web/chunk-hajg1p0h.js.br +0 -0
- package/web/chunk-hajg1p0h.js.gz +0 -0
- package/web/chunk-hhmd6qrc.js +0 -2
- package/web/chunk-hhmd6qrc.js.br +0 -0
- package/web/chunk-hhmd6qrc.js.gz +0 -0
- package/web/chunk-hya0fh1r.js +0 -1
- package/web/chunk-hya0fh1r.js.br +0 -0
- package/web/chunk-hya0fh1r.js.gz +0 -0
- package/web/chunk-j469ky77.js +0 -1
- package/web/chunk-j469ky77.js.br +0 -0
- package/web/chunk-j469ky77.js.gz +0 -0
- package/web/chunk-j6ymcm3h.js +0 -2
- package/web/chunk-j6ymcm3h.js.br +0 -0
- package/web/chunk-j6ymcm3h.js.gz +0 -0
- package/web/chunk-j79z6bta.js +0 -21
- package/web/chunk-j79z6bta.js.br +0 -0
- package/web/chunk-j79z6bta.js.gz +0 -0
- package/web/chunk-jbxc5y3z.js +0 -12
- package/web/chunk-jbxc5y3z.js.br +0 -0
- package/web/chunk-jbxc5y3z.js.gz +0 -0
- package/web/chunk-jcc187d7.js +0 -1
- package/web/chunk-jcc187d7.js.br +0 -0
- package/web/chunk-jcc187d7.js.gz +0 -0
- package/web/chunk-jjvpdxhd.js +0 -2
- package/web/chunk-jjvpdxhd.js.br +0 -0
- package/web/chunk-jjvpdxhd.js.gz +0 -0
- package/web/chunk-jrh3mwmy.js +0 -2
- package/web/chunk-jrh3mwmy.js.br +0 -0
- package/web/chunk-jrh3mwmy.js.gz +0 -0
- package/web/chunk-jv3pgdp0.js +0 -1
- package/web/chunk-jv3pgdp0.js.br +0 -2
- package/web/chunk-jv3pgdp0.js.gz +0 -0
- package/web/chunk-ksxjhezb.js +0 -1
- package/web/chunk-ksxjhezb.js.br +0 -0
- package/web/chunk-ksxjhezb.js.gz +0 -0
- package/web/chunk-ktnd8t40.js +0 -2
- package/web/chunk-ktnd8t40.js.br +0 -0
- package/web/chunk-ktnd8t40.js.gz +0 -0
- package/web/chunk-mgwv3dp0.js +0 -1
- package/web/chunk-mgwv3dp0.js.br +0 -0
- package/web/chunk-mgwv3dp0.js.gz +0 -0
- package/web/chunk-mtjdfgjj.js +0 -2
- package/web/chunk-mtjdfgjj.js.br +0 -0
- package/web/chunk-mtjdfgjj.js.gz +0 -0
- package/web/chunk-mzkaanwd.js +0 -2
- package/web/chunk-mzkaanwd.js.br +0 -0
- package/web/chunk-mzkaanwd.js.gz +0 -0
- package/web/chunk-n22pg5xy.js +0 -1
- package/web/chunk-n22pg5xy.js.br +0 -0
- package/web/chunk-n22pg5xy.js.gz +0 -0
- package/web/chunk-n58ezsfb.js +0 -2
- package/web/chunk-n58ezsfb.js.br +0 -0
- package/web/chunk-n58ezsfb.js.gz +0 -0
- package/web/chunk-nhx74teq.js +0 -3
- package/web/chunk-nhx74teq.js.br +0 -0
- package/web/chunk-nhx74teq.js.gz +0 -0
- package/web/chunk-njjsgwfw.js +0 -2
- package/web/chunk-njjsgwfw.js.br +0 -0
- package/web/chunk-njjsgwfw.js.gz +0 -0
- package/web/chunk-nwhqcbnr.js +0 -1
- package/web/chunk-nwhqcbnr.js.br +0 -0
- package/web/chunk-nwhqcbnr.js.gz +0 -0
- package/web/chunk-pnghaajd.js +0 -70
- package/web/chunk-pnghaajd.js.br +0 -0
- package/web/chunk-pnghaajd.js.gz +0 -0
- package/web/chunk-pqfn8x7v.js +0 -1
- package/web/chunk-pqfn8x7v.js.br +0 -0
- package/web/chunk-pqfn8x7v.js.gz +0 -0
- package/web/chunk-ptk0jnyx.js +0 -1
- package/web/chunk-ptk0jnyx.js.br +0 -0
- package/web/chunk-ptk0jnyx.js.gz +0 -0
- package/web/chunk-pv7e5g4k.js +0 -370
- package/web/chunk-pv7e5g4k.js.br +0 -0
- package/web/chunk-pv7e5g4k.js.gz +0 -0
- package/web/chunk-pxnh5qgn.js +0 -2
- package/web/chunk-pxnh5qgn.js.br +0 -0
- package/web/chunk-pxnh5qgn.js.gz +0 -0
- package/web/chunk-q6eq5y2t.js +0 -1
- package/web/chunk-q6eq5y2t.js.br +0 -2
- package/web/chunk-q6eq5y2t.js.gz +0 -0
- package/web/chunk-qdwg9n1d.js +0 -1
- package/web/chunk-qdwg9n1d.js.br +0 -0
- package/web/chunk-qdwg9n1d.js.gz +0 -0
- package/web/chunk-qp42gtvd.js +0 -1
- package/web/chunk-qp42gtvd.js.br +0 -0
- package/web/chunk-qp42gtvd.js.gz +0 -0
- package/web/chunk-qzdw8vdp.js +0 -1
- package/web/chunk-qzdw8vdp.js.br +0 -0
- package/web/chunk-qzdw8vdp.js.gz +0 -0
- package/web/chunk-r571ywxq.js +0 -1
- package/web/chunk-r571ywxq.js.br +0 -0
- package/web/chunk-r571ywxq.js.gz +0 -0
- package/web/chunk-r9fx4cjw.js +0 -1
- package/web/chunk-r9fx4cjw.js.br +0 -0
- package/web/chunk-r9fx4cjw.js.gz +0 -0
- package/web/chunk-rhvq3c1c.js +0 -1
- package/web/chunk-rhvq3c1c.js.br +0 -0
- package/web/chunk-rhvq3c1c.js.gz +0 -0
- package/web/chunk-rjay9w1t.js +0 -1
- package/web/chunk-rjay9w1t.js.br +0 -0
- package/web/chunk-rjay9w1t.js.gz +0 -0
- package/web/chunk-rpvdnc3p.js +0 -1
- package/web/chunk-rpvdnc3p.js.br +0 -0
- package/web/chunk-rpvdnc3p.js.gz +0 -0
- package/web/chunk-rrfr4wyt.js +0 -62
- package/web/chunk-rrfr4wyt.js.br +0 -0
- package/web/chunk-rrfr4wyt.js.gz +0 -0
- package/web/chunk-rvngywg9.js +0 -2
- package/web/chunk-rvngywg9.js.br +0 -0
- package/web/chunk-rvngywg9.js.gz +0 -0
- package/web/chunk-rw7d025r.js +0 -84
- package/web/chunk-rw7d025r.js.br +0 -0
- package/web/chunk-rw7d025r.js.gz +0 -0
- package/web/chunk-s1g8acth.js +0 -324
- package/web/chunk-s1g8acth.js.br +0 -0
- package/web/chunk-s1g8acth.js.gz +0 -0
- package/web/chunk-s8572njv.js +0 -2
- package/web/chunk-s8572njv.js.br +0 -1
- package/web/chunk-s8572njv.js.gz +0 -0
- package/web/chunk-sb57e1m9.css +0 -1
- package/web/chunk-sb57e1m9.css.br +0 -0
- package/web/chunk-sb57e1m9.css.gz +0 -0
- package/web/chunk-sn3h5adt.js +0 -2
- package/web/chunk-sn3h5adt.js.br +0 -0
- package/web/chunk-sn3h5adt.js.gz +0 -0
- package/web/chunk-tb2v18q8.js +0 -2
- package/web/chunk-tb2v18q8.js.br +0 -0
- package/web/chunk-tb2v18q8.js.gz +0 -0
- package/web/chunk-tetbyky0.js +0 -39
- package/web/chunk-tetbyky0.js.br +0 -0
- package/web/chunk-tetbyky0.js.gz +0 -0
- package/web/chunk-tqvctvsv.js +0 -1
- package/web/chunk-tqvctvsv.js.br +0 -0
- package/web/chunk-tqvctvsv.js.gz +0 -0
- package/web/chunk-v9mj2pxz.js +0 -1
- package/web/chunk-v9mj2pxz.js.br +0 -0
- package/web/chunk-v9mj2pxz.js.gz +0 -0
- package/web/chunk-vkhah4nd.js +0 -2
- package/web/chunk-vkhah4nd.js.br +0 -0
- package/web/chunk-vkhah4nd.js.gz +0 -0
- package/web/chunk-vpnh7wmw.js +0 -1
- package/web/chunk-vpnh7wmw.js.br +0 -0
- package/web/chunk-vpnh7wmw.js.gz +0 -0
- package/web/chunk-w1qe2x5p.js +0 -217
- package/web/chunk-w1qe2x5p.js.br +0 -0
- package/web/chunk-w1qe2x5p.js.gz +0 -0
- package/web/chunk-werh47fw.js +0 -99
- package/web/chunk-werh47fw.js.br +0 -0
- package/web/chunk-werh47fw.js.gz +0 -0
- package/web/chunk-wfmf0dc8.js +0 -1
- package/web/chunk-wfmf0dc8.js.br +0 -0
- package/web/chunk-wfmf0dc8.js.gz +0 -0
- package/web/chunk-wna4vqp6.js +0 -1
- package/web/chunk-wna4vqp6.js.br +0 -0
- package/web/chunk-wna4vqp6.js.gz +0 -0
- package/web/chunk-wwhq09nf.js +0 -1
- package/web/chunk-wwhq09nf.js.br +0 -0
- package/web/chunk-wwhq09nf.js.gz +0 -0
- package/web/chunk-x6va53y6.js +0 -291
- package/web/chunk-x6va53y6.js.br +0 -0
- package/web/chunk-x6va53y6.js.gz +0 -0
- package/web/chunk-xefyzr9s.js +0 -120
- package/web/chunk-xefyzr9s.js.br +0 -0
- package/web/chunk-xefyzr9s.js.gz +0 -0
- package/web/chunk-xj1w9054.js +0 -2
- package/web/chunk-xj1w9054.js.br +0 -0
- package/web/chunk-xj1w9054.js.gz +0 -0
- package/web/chunk-xtb3xhxk.js +0 -2
- package/web/chunk-xtb3xhxk.js.br +0 -2
- package/web/chunk-xtb3xhxk.js.gz +0 -0
- package/web/chunk-y1eeptks.js +0 -2
- package/web/chunk-y1eeptks.js.br +0 -0
- package/web/chunk-y1eeptks.js.gz +0 -0
- package/web/chunk-y7z6zmvp.js +0 -292
- package/web/chunk-y7z6zmvp.js.br +0 -0
- package/web/chunk-y7z6zmvp.js.gz +0 -0
- package/web/chunk-yj8tkncg.js +0 -7
- package/web/chunk-yj8tkncg.js.br +0 -0
- package/web/chunk-yj8tkncg.js.gz +0 -0
- package/web/chunk-z0m2d74w.js +0 -1
- package/web/chunk-z0m2d74w.js.br +0 -0
- package/web/chunk-z0m2d74w.js.gz +0 -0
- package/web/chunk-z30kqv40.js +0 -1
- package/web/chunk-z30kqv40.js.br +0 -0
- package/web/chunk-z30kqv40.js.gz +0 -0
- package/web/chunk-z3a96d42.js +0 -332
- package/web/chunk-z3a96d42.js.br +0 -0
- package/web/chunk-z3a96d42.js.gz +0 -0
- package/web/manifest-txf6vfbq.webmanifest +0 -35
- package/web/manifest-txf6vfbq.webmanifest.br +0 -0
- package/web/manifest-txf6vfbq.webmanifest.gz +0 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{dlopen as c,FFIType as e,ptr as I,toArrayBuffer as O}from"bun:ffi";import{readFileSync as U}from"fs";var T="./icon-dp9pmcvp.png";var E=32770,b=32771,x=2,B=1,P=2,W=13,m=976,h=1,Y=60000;function f(t){let s=new Uint16Array(t.length+1);for(let r=0;r<t.length;r++)s[r]=t.charCodeAt(r);return s}function As(t){if(process.platform!=="win32"||!Number.isInteger(t)||t<=0)return!1;try{let s=c("user32.dll",{IsWindow:{args:[e.ptr],returns:e.i32},PostMessageW:{args:[e.ptr,e.u32,e.u64,e.i64],returns:e.i32}});if(!s.symbols.IsWindow(BigInt(t)))return!1;return s.symbols.PostMessageW(BigInt(t),E,0,0)!==0}catch{return!1}}function Zo(t){let s=new URL(t);if(s.protocol!=="http:"&&s.protocol!=="https:")throw Error(`Unsupported browser URL protocol: ${s.protocol}`);if(process.platform==="win32"){let p=c("shell32.dll",{ShellExecuteW:{args:[e.ptr,e.ptr,e.ptr,e.ptr,e.ptr,e.i32],returns:e.ptr}}),n=f("open"),o=f(s.href);p.symbols.ShellExecuteW(null,I(n),I(o),null,null,B);return}let r=process.platform==="darwin"?"open":"xdg-open";Bun.spawn([r,s.href],{stdio:["ignore","ignore","ignore"]})}function ei(t){if(process.platform!=="win32")return!1;let s=c("kernel32.dll",{GlobalAlloc:{args:[e.u32,e.u64],returns:e.ptr},GlobalLock:{args:[e.ptr],returns:e.ptr},GlobalUnlock:{args:[e.ptr],returns:e.i32},GlobalFree:{args:[e.ptr],returns:e.ptr}}),r=c("user32.dll",{OpenClipboard:{args:[e.ptr],returns:e.i32},EmptyClipboard:{args:[],returns:e.i32},SetClipboardData:{args:[e.u32,e.ptr],returns:e.ptr},CloseClipboard:{args:[],returns:e.i32}});if(!r.symbols.OpenClipboard(null))return!1;try{r.symbols.EmptyClipboard();let p=f(t),n=s.symbols.GlobalAlloc(P,p.byteLength);if(!n)return!1;let o=s.symbols.GlobalLock(n);if(!o)return s.symbols.GlobalFree(n),!1;if(new Uint8Array(O(o,0,p.byteLength)).set(new Uint8Array(p.buffer)),s.symbols.GlobalUnlock(n),!r.symbols.SetClipboardData(W,n))return s.symbols.GlobalFree(n),!1;return!0}finally{r.symbols.CloseClipboard()}}function Ts(t){if(process.platform!=="win32")return Promise.resolve(!1);let s=(o)=>o.replace(/\p{Cc}/gu," ").slice(0,100),r=["\u6709\u7F51\u9875\u8BF7\u6C42\u514D\u914D\u5BF9\u7801\u8FDE\u63A5\u5230\u672C\u673A\u7684 Basalt\u3002","",`\u6765\u6E90\uFF1A${s(t.origin??"\u672A\u77E5")}`,`\u8BBE\u5907\uFF1A${s(t.device)}`,"","\u8FDE\u63A5\u540E\u5BF9\u65B9\u53EF\u4EE5\u5728\u8FD9\u53F0\u7535\u8111\u4E0A\u6267\u884C\u547D\u4EE4\u3002\u53EA\u6709\u8FD9\u662F\u4F60\u672C\u4EBA\u521A\u521A\u5728\u6D4F\u89C8\u5668\u4E2D\u53D1\u8D77\u7684\u64CD\u4F5C\u65F6\uFF0C\u624D\u70B9\u51FB\u201C\u662F\u201D\u3002"].join(`
|
|
3
|
+
`),p=URL.createObjectURL(new Blob([R],{type:"text/javascript"})),n=new Worker(p);return new Promise((o)=>{let i=(u)=>{URL.revokeObjectURL(p),n.terminate(),o(u)};n.onmessage=(u)=>i(u.data.approved===!0),n.onerror=()=>i(!1),n.postMessage({title:"Basalt \u8FDE\u63A5\u786E\u8BA4",message:r})})}function g(t){if(process.platform!=="win32"||t<=0)return;try{let s=c("shell32.dll",{Shell_NotifyIconW:{args:[e.u32,e.ptr],returns:e.i32}}),r=new Uint8Array(m),p=new DataView(r.buffer);p.setUint32(0,m,!0),p.setBigUint64(8,BigInt(t),!0),p.setUint32(16,h,!0),s.symbols.Shell_NotifyIconW(x,I(r))}catch{}}async function ks(t){if(process.platform!=="win32")return;let s;try{let l=T.startsWith("./")?new URL(T,import.meta.url):T;s=new Uint8Array(U(l))}catch(l){console.warn("\u65E0\u6CD5\u8BFB\u53D6\u6258\u76D8\u56FE\u6807\u8D44\u6E90\uFF1A",l);return}let r=c("user32.dll",{PostMessageW:{args:[e.ptr,e.u32,e.u64,e.i64],returns:e.i32}}),p=new Blob([C],{type:"text/javascript"}),n=URL.createObjectURL(p),o=new Worker(n),i=0,u=!1,d,M=new Promise((l)=>{d=l}),F=()=>{if(!u&&i>0)u=!0,g(i)};return process.on("exit",F),new Promise((l)=>{let y=!1;o.onmessage=(_)=>{let a=_.data;if(a.type==="ready"&&typeof a.hwnd==="number"){URL.revokeObjectURL(n),i=a.hwnd,y=!0,l({hwnd:i,async close(){if(u)return;u=!0,process.off("exit",F),g(i),r.symbols.PostMessageW(BigInt(i),b,0,0),await Promise.race([M,Bun.sleep(300)]),o.terminate()}});return}if(a.type==="error"){if(!y)URL.revokeObjectURL(n),y=!0,process.off("exit",F),o.terminate(),l(void 0);return}if(a.type==="open")t.onOpen();else if(a.type==="copy-link")t.onCopyLink();else if(a.type==="copy-code")t.onCopyCode();else if(a.type==="quit")t.onQuit();else if(a.type==="closed")d?.()},o.onerror=()=>{if(!y)URL.revokeObjectURL(n),y=!0,process.off("exit",F),o.terminate(),l(void 0)},o.postMessage({iconBytes:s.buffer,title:t.title,tooltip:t.tooltip,auth:t.auth})})}var R=`
|
|
4
|
+
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
5
|
+
|
|
6
|
+
const MB_YESNO = 0x00000004;
|
|
7
|
+
const MB_ICONWARNING = 0x00000030;
|
|
8
|
+
const MB_DEFBUTTON2 = 0x00000100;
|
|
9
|
+
const MB_SYSTEMMODAL = 0x00001000;
|
|
10
|
+
const MB_SETFOREGROUND = 0x00010000;
|
|
11
|
+
const MB_TOPMOST = 0x00040000;
|
|
12
|
+
const IDYES = 6;
|
|
13
|
+
// \u65E0\u4EBA\u5E94\u7B54\u65F6\u81EA\u52A8\u5173\u95ED\u5E76\u6309\u62D2\u7EDD\u5904\u7406\uFF0C\u4E0D\u80FD\u8BA9\u5F85\u786E\u8BA4\u72B6\u6001\u957F\u671F\u5360\u4F4F\u514D\u7801\u76F4\u8FDE\u5165\u53E3
|
|
14
|
+
const TIMEOUT_MS = ${Y};
|
|
15
|
+
|
|
16
|
+
// MessageBoxTimeoutW \u81EA XP \u8D77\u7531 user32 \u5BFC\u51FA\uFF0C\u662F\u552F\u4E00\u80FD\u5728\u8D85\u65F6\u540E\u81EA\u884C\u5173\u95ED\u7684\u539F\u751F\u786E\u8BA4\u6846
|
|
17
|
+
const user32 = dlopen("user32.dll", {
|
|
18
|
+
MessageBoxTimeoutW: {
|
|
19
|
+
args: [FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u16, FFIType.u32],
|
|
20
|
+
returns: FFIType.i32,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
function utf16(text) {
|
|
25
|
+
const buf = new Uint16Array(text.length + 1);
|
|
26
|
+
for (let i = 0; i < text.length; i++) buf[i] = text.charCodeAt(i);
|
|
27
|
+
return buf;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
self.onmessage = (event) => {
|
|
31
|
+
const { title, message } = event.data;
|
|
32
|
+
// \u9ED8\u8BA4\u6309\u94AE\u662F\u201C\u5426\u201D\uFF1A\u7528\u6237\u968F\u624B\u6309\u56DE\u8F66\u4E0D\u4F1A\u8BEF\u6388\u6743
|
|
33
|
+
const result = user32.symbols.MessageBoxTimeoutW(
|
|
34
|
+
null,
|
|
35
|
+
ptr(utf16(message)),
|
|
36
|
+
ptr(utf16(title)),
|
|
37
|
+
MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2 | MB_SYSTEMMODAL | MB_SETFOREGROUND | MB_TOPMOST,
|
|
38
|
+
0,
|
|
39
|
+
TIMEOUT_MS,
|
|
40
|
+
);
|
|
41
|
+
self.postMessage({ approved: result === IDYES });
|
|
42
|
+
};
|
|
43
|
+
`,C=`
|
|
44
|
+
import { dlopen, FFIType, JSCallback, ptr } from "bun:ffi";
|
|
45
|
+
|
|
46
|
+
const WM_DESTROY = 0x0002;
|
|
47
|
+
const WM_CLOSE = 0x0010;
|
|
48
|
+
const WM_ENDSESSION = 0x0016;
|
|
49
|
+
const WM_LBUTTONUP = 0x0202;
|
|
50
|
+
const WM_LBUTTONDBLCLK = 0x0203;
|
|
51
|
+
const WM_RBUTTONUP = 0x0205;
|
|
52
|
+
const WM_CONTEXTMENU = 0x007B;
|
|
53
|
+
const WM_TRAY = 0x8001;
|
|
54
|
+
const WM_OPEN_WEB = 0x8002;
|
|
55
|
+
const WM_DESTROY_TRAY = 0x8003;
|
|
56
|
+
|
|
57
|
+
const NIM_ADD = 0x00000000;
|
|
58
|
+
const NIM_DELETE = 0x00000002;
|
|
59
|
+
const NIF_MESSAGE = 0x00000001;
|
|
60
|
+
const NIF_ICON = 0x00000002;
|
|
61
|
+
const NIF_TIP = 0x00000004;
|
|
62
|
+
|
|
63
|
+
const MF_STRING = 0x00000000;
|
|
64
|
+
const MF_GRAYED = 0x00000001;
|
|
65
|
+
const MF_DISABLED = 0x00000002;
|
|
66
|
+
const MF_SEPARATOR = 0x00000800;
|
|
67
|
+
|
|
68
|
+
const TPM_RIGHTBUTTON = 0x0002;
|
|
69
|
+
const TPM_BOTTOMALIGN = 0x0020;
|
|
70
|
+
const TPM_NONOTIFY = 0x0080;
|
|
71
|
+
const TPM_RETURNCMD = 0x0100;
|
|
72
|
+
|
|
73
|
+
const CMD_OPEN = 1;
|
|
74
|
+
const CMD_COPY_LINK = 2;
|
|
75
|
+
const CMD_COPY_CODE = 3;
|
|
76
|
+
const CMD_QUIT = 4;
|
|
77
|
+
|
|
78
|
+
const kernel32 = dlopen("kernel32.dll", {
|
|
79
|
+
GetModuleHandleW: { args: [FFIType.ptr], returns: FFIType.ptr },
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const user32 = dlopen("user32.dll", {
|
|
83
|
+
RegisterClassExW: { args: [FFIType.ptr], returns: FFIType.u16 },
|
|
84
|
+
CreateWindowExW: {
|
|
85
|
+
args: [
|
|
86
|
+
FFIType.u32, FFIType.ptr, FFIType.ptr, FFIType.u32,
|
|
87
|
+
FFIType.i32, FFIType.i32, FFIType.i32, FFIType.i32,
|
|
88
|
+
FFIType.ptr, FFIType.ptr, FFIType.ptr, FFIType.ptr,
|
|
89
|
+
],
|
|
90
|
+
returns: FFIType.ptr,
|
|
91
|
+
},
|
|
92
|
+
DefWindowProcW: {
|
|
93
|
+
args: [FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.i64],
|
|
94
|
+
returns: FFIType.i64,
|
|
95
|
+
},
|
|
96
|
+
DestroyWindow: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
97
|
+
GetMessageW: {
|
|
98
|
+
args: [FFIType.ptr, FFIType.ptr, FFIType.u32, FFIType.u32],
|
|
99
|
+
returns: FFIType.i32,
|
|
100
|
+
},
|
|
101
|
+
TranslateMessage: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
102
|
+
DispatchMessageW: { args: [FFIType.ptr], returns: FFIType.i64 },
|
|
103
|
+
PostMessageW: {
|
|
104
|
+
args: [FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.i64],
|
|
105
|
+
returns: FFIType.i32,
|
|
106
|
+
},
|
|
107
|
+
PostQuitMessage: { args: [FFIType.i32], returns: FFIType.void },
|
|
108
|
+
RegisterWindowMessageW: { args: [FFIType.ptr], returns: FFIType.u32 },
|
|
109
|
+
CreateIconFromResourceEx: {
|
|
110
|
+
args: [FFIType.ptr, FFIType.u32, FFIType.i32, FFIType.u32, FFIType.i32, FFIType.i32, FFIType.u32],
|
|
111
|
+
returns: FFIType.ptr,
|
|
112
|
+
},
|
|
113
|
+
DestroyIcon: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
114
|
+
CreatePopupMenu: { args: [], returns: FFIType.ptr },
|
|
115
|
+
AppendMenuW: {
|
|
116
|
+
args: [FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.ptr],
|
|
117
|
+
returns: FFIType.i32,
|
|
118
|
+
},
|
|
119
|
+
SetMenuDefaultItem: {
|
|
120
|
+
args: [FFIType.ptr, FFIType.u32, FFIType.u32],
|
|
121
|
+
returns: FFIType.i32,
|
|
122
|
+
},
|
|
123
|
+
DestroyMenu: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
124
|
+
GetCursorPos: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
125
|
+
SetForegroundWindow: { args: [FFIType.ptr], returns: FFIType.i32 },
|
|
126
|
+
TrackPopupMenu: {
|
|
127
|
+
args: [FFIType.ptr, FFIType.u32, FFIType.i32, FFIType.i32, FFIType.i32, FFIType.ptr, FFIType.ptr],
|
|
128
|
+
returns: FFIType.i32,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const shell32 = dlopen("shell32.dll", {
|
|
133
|
+
Shell_NotifyIconW: { args: [FFIType.u32, FFIType.ptr], returns: FFIType.i32 },
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
function utf16(text) {
|
|
137
|
+
const buf = new Uint16Array(text.length + 1);
|
|
138
|
+
for (let i = 0; i < text.length; i++) buf[i] = text.charCodeAt(i);
|
|
139
|
+
return buf;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
self.onmessage = (event) => {
|
|
143
|
+
const { iconBytes, title, tooltip, auth } = event.data;
|
|
144
|
+
const nid = new Uint8Array(976);
|
|
145
|
+
const nidView = new DataView(nid.buffer);
|
|
146
|
+
const taskbarCreatedMsg = user32.symbols.RegisterWindowMessageW(ptr(utf16("TaskbarCreated")));
|
|
147
|
+
|
|
148
|
+
const titleLabel = utf16(title);
|
|
149
|
+
const openLabel = utf16("\u6253\u5F00\u5DE5\u4F5C\u53F0");
|
|
150
|
+
const copyLinkLabel = utf16(auth ? "\u590D\u5236\u914D\u5BF9\u94FE\u63A5" : "\u590D\u5236\u670D\u52A1\u5730\u5740");
|
|
151
|
+
const copyCodeLabel = utf16("\u590D\u5236\u914D\u5BF9\u7801");
|
|
152
|
+
const quitLabel = utf16("\u9000\u51FA Basalt");
|
|
153
|
+
|
|
154
|
+
function showContextMenu(hwnd) {
|
|
155
|
+
const menu = user32.symbols.CreatePopupMenu();
|
|
156
|
+
if (!menu) return;
|
|
157
|
+
user32.symbols.AppendMenuW(menu, MF_STRING | MF_GRAYED | MF_DISABLED, 0, ptr(titleLabel));
|
|
158
|
+
user32.symbols.AppendMenuW(menu, MF_SEPARATOR, 0, null);
|
|
159
|
+
user32.symbols.AppendMenuW(menu, MF_STRING, CMD_OPEN, ptr(openLabel));
|
|
160
|
+
user32.symbols.SetMenuDefaultItem(menu, CMD_OPEN, 0);
|
|
161
|
+
user32.symbols.AppendMenuW(menu, MF_STRING, CMD_COPY_LINK, ptr(copyLinkLabel));
|
|
162
|
+
if (auth) {
|
|
163
|
+
user32.symbols.AppendMenuW(menu, MF_STRING, CMD_COPY_CODE, ptr(copyCodeLabel));
|
|
164
|
+
}
|
|
165
|
+
user32.symbols.AppendMenuW(menu, MF_SEPARATOR, 0, null);
|
|
166
|
+
user32.symbols.AppendMenuW(menu, MF_STRING, CMD_QUIT, ptr(quitLabel));
|
|
167
|
+
|
|
168
|
+
const cursor = new Int32Array(2);
|
|
169
|
+
user32.symbols.GetCursorPos(ptr(cursor));
|
|
170
|
+
user32.symbols.SetForegroundWindow(hwnd);
|
|
171
|
+
const command = user32.symbols.TrackPopupMenu(
|
|
172
|
+
menu,
|
|
173
|
+
TPM_RIGHTBUTTON | TPM_BOTTOMALIGN | TPM_NONOTIFY | TPM_RETURNCMD,
|
|
174
|
+
cursor[0],
|
|
175
|
+
cursor[1],
|
|
176
|
+
0,
|
|
177
|
+
hwnd,
|
|
178
|
+
null,
|
|
179
|
+
);
|
|
180
|
+
user32.symbols.PostMessageW(hwnd, 0, 0, 0);
|
|
181
|
+
user32.symbols.DestroyMenu(menu);
|
|
182
|
+
|
|
183
|
+
if (command === CMD_OPEN) self.postMessage({ type: "open" });
|
|
184
|
+
else if (command === CMD_COPY_LINK) self.postMessage({ type: "copy-link" });
|
|
185
|
+
else if (command === CMD_COPY_CODE) self.postMessage({ type: "copy-code" });
|
|
186
|
+
else if (command === CMD_QUIT) self.postMessage({ type: "quit" });
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const wndProc = new JSCallback(
|
|
190
|
+
(hwnd, msg, wParam, lParam) => {
|
|
191
|
+
if (taskbarCreatedMsg && msg === taskbarCreatedMsg) {
|
|
192
|
+
shell32.symbols.Shell_NotifyIconW(NIM_ADD, ptr(nid));
|
|
193
|
+
return 0;
|
|
194
|
+
}
|
|
195
|
+
if (msg === WM_OPEN_WEB) {
|
|
196
|
+
self.postMessage({ type: "open" });
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
if (msg === WM_TRAY) {
|
|
200
|
+
const mouseEvent = Number(BigInt.asUintN(16, BigInt(lParam)));
|
|
201
|
+
if (mouseEvent === WM_LBUTTONUP || mouseEvent === WM_LBUTTONDBLCLK) {
|
|
202
|
+
self.postMessage({ type: "open" });
|
|
203
|
+
} else if (mouseEvent === WM_RBUTTONUP || mouseEvent === WM_CONTEXTMENU) {
|
|
204
|
+
showContextMenu(hwnd);
|
|
205
|
+
}
|
|
206
|
+
return 0;
|
|
207
|
+
}
|
|
208
|
+
if (msg === WM_CLOSE || msg === WM_ENDSESSION) {
|
|
209
|
+
shell32.symbols.Shell_NotifyIconW(NIM_DELETE, ptr(nid));
|
|
210
|
+
self.postMessage({ type: "quit" });
|
|
211
|
+
user32.symbols.DestroyWindow(hwnd);
|
|
212
|
+
return 0;
|
|
213
|
+
}
|
|
214
|
+
if (msg === WM_DESTROY_TRAY) {
|
|
215
|
+
shell32.symbols.Shell_NotifyIconW(NIM_DELETE, ptr(nid));
|
|
216
|
+
user32.symbols.DestroyWindow(hwnd);
|
|
217
|
+
return 0;
|
|
218
|
+
}
|
|
219
|
+
if (msg === WM_DESTROY) {
|
|
220
|
+
user32.symbols.PostQuitMessage(0);
|
|
221
|
+
return 0;
|
|
222
|
+
}
|
|
223
|
+
return user32.symbols.DefWindowProcW(hwnd, msg, wParam, lParam);
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
args: [FFIType.ptr, FFIType.u32, FFIType.u64, FFIType.i64],
|
|
227
|
+
returns: FFIType.i64,
|
|
228
|
+
},
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
const hInstance = kernel32.symbols.GetModuleHandleW(null);
|
|
232
|
+
const className = utf16("BasaltTrayWindow");
|
|
233
|
+
const wc = new ArrayBuffer(80);
|
|
234
|
+
const wcView = new DataView(wc);
|
|
235
|
+
wcView.setUint32(0, 80, true);
|
|
236
|
+
wcView.setBigUint64(8, BigInt(wndProc.ptr), true);
|
|
237
|
+
wcView.setBigUint64(24, BigInt(hInstance ?? 0), true);
|
|
238
|
+
wcView.setBigUint64(64, BigInt(ptr(className)), true);
|
|
239
|
+
user32.symbols.RegisterClassExW(ptr(wc));
|
|
240
|
+
|
|
241
|
+
const hwnd = user32.symbols.CreateWindowExW(
|
|
242
|
+
0, ptr(className), ptr(className), 0,
|
|
243
|
+
0, 0, 0, 0, null, null, hInstance, null,
|
|
244
|
+
);
|
|
245
|
+
if (!hwnd) {
|
|
246
|
+
wndProc.close();
|
|
247
|
+
self.postMessage({ type: "error", message: "CreateWindowExW failed" });
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const pngBuf = new Uint8Array(iconBytes);
|
|
252
|
+
const hicon = user32.symbols.CreateIconFromResourceEx(
|
|
253
|
+
ptr(pngBuf), pngBuf.byteLength, 1, 0x00030000, 32, 32, 0,
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
nidView.setUint32(0, 976, true);
|
|
257
|
+
nidView.setBigUint64(8, BigInt(hwnd), true);
|
|
258
|
+
nidView.setUint32(16, 1, true);
|
|
259
|
+
nidView.setUint32(20, NIF_MESSAGE | NIF_ICON | NIF_TIP, true);
|
|
260
|
+
nidView.setUint32(24, WM_TRAY, true);
|
|
261
|
+
nidView.setBigUint64(32, BigInt(hicon ?? 0), true);
|
|
262
|
+
const tip = utf16(tooltip);
|
|
263
|
+
new Uint16Array(nid.buffer, 40, 128).set(tip.subarray(0, 127));
|
|
264
|
+
|
|
265
|
+
if (!shell32.symbols.Shell_NotifyIconW(NIM_ADD, ptr(nid))) {
|
|
266
|
+
user32.symbols.DestroyWindow(hwnd);
|
|
267
|
+
if (hicon) user32.symbols.DestroyIcon(hicon);
|
|
268
|
+
wndProc.close();
|
|
269
|
+
self.postMessage({ type: "error", message: "Shell_NotifyIconW failed" });
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
self.postMessage({ type: "ready", hwnd: Number(hwnd) });
|
|
274
|
+
|
|
275
|
+
const msgBuf = new Uint8Array(48);
|
|
276
|
+
while (user32.symbols.GetMessageW(ptr(msgBuf), null, 0, 0) > 0) {
|
|
277
|
+
user32.symbols.TranslateMessage(ptr(msgBuf));
|
|
278
|
+
user32.symbols.DispatchMessageW(ptr(msgBuf));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (hicon) user32.symbols.DestroyIcon(hicon);
|
|
282
|
+
wndProc.close();
|
|
283
|
+
self.postMessage({ type: "closed" });
|
|
284
|
+
};
|
|
285
|
+
`;
|
|
286
|
+
export{As,Zo,ei,Ts,ks};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var A=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],I=["content-type","cache-control","allow"];function p(e){let r=e.path;if(!r?.startsWith("/api/")||/[\\\r\n#]/.test(r))throw Error("request path must start with /api/");let n=new URL(r,"http://basalt.internal");if(n.origin!=="http://basalt.internal"||!n.pathname.startsWith("/api/"))throw Error("request path must stay within /api/");let o=e.method??"GET";if(!A.includes(o))throw Error("Unsupported request method");if(e.body!==void 0&&(!e.body||typeof e.body!=="object"||Array.isArray(e.body)))throw Error("request body must be a JSON object");if(e.body!==void 0&&(o==="GET"||o==="HEAD"))throw Error("GET and HEAD requests cannot have a body");let s=e.timeoutMs??1e4;if(!Number.isSafeInteger(s)||s<1||s>60000)throw Error("timeoutMs must be an integer between 1 and 60000");return{url:n,method:o,timeoutMs:s}}function g(e){let r={};for(let n of I){let o=e.headers.get(n);if(o)r[n]=o.slice(0,500)}return r}async function M(e,r){let n=e.getReader();r(()=>n.cancel());let o=[],s=0,i=!1;while(!0){let t=await n.read();if(t.done)break;let d=20480-s;if(o.push(t.value.subarray(0,d)),s+=Math.min(t.value.length,d),t.value.length>d){i=!0,await n.cancel();break}}let l=new Uint8Array(s),c=0;for(let t of o)l.set(t,c),c+=t.length;return{text:new TextDecoder().decode(l,{stream:i}),truncated:i}}async function vn(e,r,n){let{url:o,method:s,timeoutMs:i}=p(r),l=e.http;if(!l)throw Error("HTTP API is not attached; start the Basalt server first");let c=new AbortController,t=n?AbortSignal.any([n,c.signal]):c.signal;t.throwIfAborted();let d,b=()=>{d?.().catch((u)=>console.warn("[basalt-creator] \u53D6\u6D88\u54CD\u5E94\u4F53\u5931\u8D25\uFF1A",u))},E=async()=>{let u=r.body!==void 0,a=await l.request(new Request(o.toString(),{method:s,headers:u?{"content-type":"application/json"}:void 0,body:u?JSON.stringify(r.body):void 0,signal:t}));if(t.aborted)throw await a.body?.cancel(),Error("API request cancelled");let m=a.body?await M(a.body,(T)=>{d=T}):{text:"",truncated:!1};return{status:a.status,headers:g(a),body:m.text,truncated:m.truncated}},f,h,w=new Promise((u,a)=>{if(h=()=>{a(Error("API request cancelled")),b()},t.addEventListener("abort",h,{once:!0}),t.aborted)h()}),y=new Promise((u,a)=>{f=setTimeout(()=>{a(Error(`API request timed out after ${i}ms`)),c.abort(),b()},i)});try{return await Promise.race([E(),w,y])}finally{if(clearTimeout(f),h)t.removeEventListener("abort",h)}}
|
|
3
|
+
export{vn};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{P}from"./chunk-xjr4j102.js";import{ne}from"./chunk-19nje7ny.js";import{O}from"./chunk-ma4nhnnj.js";import{Dt}from"./chunk-v9pc3ad7.js";import{Qt}from"./chunk-3bqs901a.js";import{kr,Pr}from"./chunk-8bvjjs3r.js";import{Se}from"./chunk-412mm63g.js";import{Te}from"./chunk-1jtnjzrz.js";import{se,pe}from"./chunk-pzg6f8rv.js";import{De,wo,So,Ie,En,tt,pr,de,$s,js,Ne}from"./chunk-qn316bye.js";import{C}from"./chunk-bkabw9yr.js";import{le}from"./chunk-fpksd95h.js";import{re,mt,xe,We,He,he,ae}from"./chunk-kh4b25x0.js";import{J}from"./chunk-23qfxx3v.js";function H(e,n){if(!e)return!1;let t=n.toLowerCase();for(let[s,u]of Object.entries(e))if(s.toLowerCase()===t&&u!==null&&u.trim().length>0)return!0;return!1}function Q(e,n,t){if(n)return n;if(H(t,"authorization")||H(t,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${e}`)}function fe(e){for(let n of e){if(n.role==="toolResult")return!0;if(n.role==="assistant"){if(n.content.some((t)=>t.type==="toolCall"))return!0}}return!1}function U(e){return e.type==="text"}function ce(e){return e.type==="thinking"}function ge(e){return e.type==="toolCall"}function me(e){return e.type==="image"}function ye(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function ke(e){return(e.id===void 0||e.id===null||typeof e.id==="string")&&(e.format===void 0||typeof e.format==="string")&&(e.index===void 0||typeof e.index==="number")}function G(e){if(!ye(e)||!ke(e))return!1;switch(e.type){case"reasoning.summary":return typeof e.summary==="string";case"reasoning.encrypted":return typeof e.data==="string";case"reasoning.text":return typeof e.text==="string"&&(e.signature===void 0||e.signature===null||typeof e.signature==="string");default:return!1}}function Re(e){if(!e)return;try{let n=JSON.parse(e);return Array.isArray(n)&&n.length>0&&n.every(G)?n:void 0}catch{return}}function _e(e){if(!e)return;try{let n=JSON.parse(e);return G(n)&&n.type==="reasoning.encrypted"&&typeof n.id==="string"&&n.id.length>0&&n.data.length>0?n:void 0}catch{return}}function W(e,n){e.id??=n.id,e.format||=n.format,e.index??=n.index}function ve(e,n){let t=e[e.length-1];if(n.type==="reasoning.text"&&t?.type==="reasoning.text"){t.text+=n.text,t.signature||=n.signature,W(t,n);return}if(n.type==="reasoning.summary"&&t?.type==="reasoning.summary"){t.summary+=n.summary,W(t,n);return}e.push({...n})}var Ae=["reasoning","reasoning_content","reasoning_text"];function Ce(e){return Ae.includes(e)}function X(e,n){if(e)return e;if(O("PI_CACHE_RETENTION",n)==="long")return"long";return"short"}var Me=(e,n,t)=>{let s=new J,u=xe(n,D(e).supportsMidConvoSystemMessages);return(async()=>{let r={role:"assistant",content:[],api:e.api,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()},k,g=(R)=>{if(k!==void 0)R.thinkingSignature=JSON.stringify(k)};try{let R=Q(e.provider,t?.apiKey,t?.headers),a=D(e),T=tt(We(u.messages),a.supportsOpenAIGrammarTools),p=X(t?.cacheRetention,t?.env),d=p==="none"?void 0:t?.sessionId,o=Ee(e,u,R,t?.headers,t?.fetch,d,a),f=we(e,u,t,a,p,T),h=await t?.onPayload?.(f,e);if(h!==void 0)f=h;let A={...t?.signal?{signal:t.signal}:{},...t?.timeoutMs!==void 0?{timeout:t.timeoutMs}:{},maxRetries:0},{data:M,response:B}=await Te(()=>o.chat.completions.create(f,A).withResponse(),{maxRetries:t?.maxRetries,maxRetryDelayMs:t?.maxRetryDelayMs,signal:t?.signal});await t?.onResponse?.({status:B.status,headers:le(B.headers)},e),s.push({type:"start",partial:r});let w=null,S=null,v=!1,F=new Map,L=new Map,l=r.content,I=(i)=>l.indexOf(i),N=(i)=>{let c=i.customInput?.property;if(c===void 0)return"";let x=i.arguments[c];return typeof x==="string"?x:""},j=(i,c,x)=>{let m=i.customInput;if(!m)return;let E=So(m.jsonBuffer,m.property,c,x);return i.arguments={[m.property]:c},E},te=(i)=>{let c=I(i);if(c===-1)return;if(i.type==="text")s.push({type:"text_end",contentIndex:c,content:i.text,partial:r});else if(i.type==="thinking")g(i),s.push({type:"thinking_end",contentIndex:c,content:i.thinking,partial:r});else if(i.type==="toolCall"){if(i.customInput){let x=j(i,N(i),!0);if(x!==void 0)s.push({type:"toolcall_delta",contentIndex:c,delta:x,partial:r})}else i.arguments=ne(i.partialArgs);delete i.partialArgs,delete i.customInput,delete i.streamIndex,s.push({type:"toolcall_end",contentIndex:c,toolCall:i,partial:r})}},oe=()=>{if(!w)w={type:"text",text:""},l.push(w),s.push({type:"text_start",contentIndex:I(w),partial:r});return w},K=(i)=>{if(!S)S={type:"thinking",thinking:"",thinkingSignature:i},l.push(S),s.push({type:"thinking_start",contentIndex:I(S),partial:r});return S},ie=(i)=>{let c=typeof i.index==="number"?i.index:void 0,x=i.function?.name??i.custom?.name??"",m=c!==void 0?F.get(c):void 0;if(!m&&i.id)m=L.get(i.id);if(!m){let E=i.custom&&!i.function?T.get(x)??"input":void 0,b=E!==void 0;if(m={type:"toolCall",id:i.id||"",name:x,arguments:b?{[E]:""}:{},partialArgs:b?void 0:"",customInput:b?{property:E,jsonBuffer:{input:"",started:!1,closed:!1}}:void 0,streamIndex:c},c!==void 0)F.set(c,m);if(i.id)L.set(i.id,m);l.push(m),s.push({type:"toolcall_start",contentIndex:I(m),partial:r})}if(c!==void 0&&m.streamIndex===void 0)m.streamIndex=c,F.set(c,m);if(i.id)L.set(i.id,m);if(!m.name&&x)m.name=x;if(i.custom&&!i.function&&!m.customInput){let E=T.get(m.name)??"input";m.arguments={[E]:""},m.customInput={property:E,jsonBuffer:{input:"",started:!1,closed:!1}},delete m.partialArgs}return m};for await(let i of M){if(await t?.onProviderStreamEvent?.(i,e),!i||typeof i!=="object")continue;if(r.responseId||=i.id,typeof i.model==="string"&&i.model.length>0&&i.model!==e.id)r.responseModel||=i.model;if(i.usage)r.usage=Z(i.usage,e);let c=Array.isArray(i.choices)?i.choices[0]:void 0;if(!c)continue;if(!i.usage&&c.usage)r.usage=Z(c.usage,e);if(c.finish_reason){r.rawStopReason=c.finish_reason;let x=Ke(c.finish_reason);if(r.stopReason=x.stopReason,x.errorMessage)r.errorMessage=x.errorMessage;v=!0}if(c.delta){if(c.delta.content!==null&&c.delta.content!==void 0&&c.delta.content.length>0){let y=oe();y.text+=c.delta.content,s.push({type:"text_delta",contentIndex:I(y),delta:c.delta.content,partial:r})}let x=["reasoning_content","reasoning","reasoning_text"],m=c.delta,E=null;for(let y of x){let _=m[y];if(typeof _==="string"&&_.length>0){E=y;break}}if(E){let y=m[E];if(typeof y==="string"&&y.length>0){let _=e.provider==="opencode-go"&&E==="reasoning"?"reasoning_content":E,q=K(_);q.thinking+=y,s.push({type:"thinking_delta",contentIndex:I(q),delta:y,partial:r})}}if(c?.delta?.tool_calls)for(let y of c.delta.tool_calls){let _=ie(y);if(!_.id&&y.id)_.id=y.id,L.set(y.id,_);let q=y.function?.name??y.custom?.name;if(!_.name&&q)_.name=q;let z="";if(y.function?.arguments)z=y.function.arguments,_.partialArgs=(_.partialArgs??"")+y.function.arguments,_.arguments=ne(_.partialArgs);else if(y.custom?.input){let ue=N(_)+y.custom.input;z=j(_,ue,!1)??""}s.push({type:"toolcall_delta",contentIndex:I(_),delta:z,partial:r})}let b=c.delta.reasoning_details;if(Array.isArray(b))for(let y of b){if(!G(y))continue;K(""),k??=[],ve(k,y)}}}for(let i of l)te(i);if(t?.signal?.aborted)throw Error("Request was aborted");if(r.stopReason==="aborted")throw Error("Request was aborted");if(!v&&!a.supportsFinishReason)r.stopReason=r.content.some((i)=>i.type==="toolCall")?"toolUse":"stop";if(r.stopReason==="error")throw Error(r.errorMessage||"Provider returned an error stop reason");if(a.supportsFinishReason&&!v||r.stopReason==="pending")throw Error("Stream ended without finish_reason");s.push({type:"done",reason:r.stopReason,message:r}),s.end()}catch(R){for(let T of r.content){if(T.type==="thinking")g(T);delete T.index,delete T.partialArgs,delete T.customInput,delete T.streamIndex}r.stopReason=t?.signal?.aborted?"aborted":"error",r.errorMessage=pe(se(R));let a=R?.error?.metadata?.raw;if(a&&!r.errorMessage.includes(String(a)))r.errorMessage+=`
|
|
3
|
+
${a}`;s.push({type:"error",reason:r.stopReason,error:r}),s.end()}})(),s},gt=(e,n,t)=>{Q(e.provider,t?.apiKey,t?.headers);let s={...de(e,n,t,t?.apiKey),toolChoice:t?.toolChoice},u=t?.reasoning?ae(e,t.reasoning):void 0;return Me(e,n,{...s,reasoningEffort:u==="off"?void 0:u,thinkingBudgets:t?.thinkingBudgets})};function Ee(e,n,t,s,u,r,k=D(e)){let g={"User-Agent":Se(),...e.headers};if(e.provider==="github-copilot"){let R=kr(n.messages),a=Pr({messages:n.messages,hasImages:R});Object.assign(g,a)}if(r&&k.sendSessionAffinityHeaders)if(k.sessionAffinityFormat==="openrouter")g["x-session-id"]=r;else{if(k.sessionAffinityFormat==="openai")g.session_id=r;g["x-client-request-id"]=r,g["x-session-affinity"]=r}if(s)Object.assign(g,s);return new P({apiKey:t,baseURL:e.baseUrl,dangerouslyAllowBrowser:!0,fetch:u,defaultHeaders:g})}function we(e,n,t,s=D(e),u=X(t?.cacheRetention,t?.env),r=tt(We(n.messages),s.supportsOpenAIGrammarTools)){let k=He(n.messages,s.supportsMidConvoSystemMessages===!0&&s.supportsMidConvoToolAdditions===!0),g=$e(e,n,s,{grammarToolInputProperties:r}),R=Be(s,u),a={model:e.id,messages:g,stream:!0,prompt_cache_key:e.baseUrl.includes("api.openai.com")&&u!=="none"||u==="long"&&s.supportsLongCacheRetention?Dt(t?.sessionId):void 0,prompt_cache_retention:u==="long"&&s.supportsLongCacheRetention?"24h":void 0};if(s.supportsUsageInStreaming!==!1)a.stream_options={include_usage:!0};if(s.supportsStore)a.store=!1;if(t?.maxTokens)if(s.maxTokensField==="max_tokens")a.max_tokens=t.maxTokens;else a.max_completion_tokens=t.maxTokens;if(t?.temperature!==void 0)a.temperature=t.temperature;if(k.requestTools.length>0){if(a.tools=ee(k.requestTools,s),s.zaiToolStream)a.tool_stream=!0}else if(fe(n.messages))a.tools=[];if(R)Pe(g,a.tools,R);if(t?.toolChoice)a.tool_choice=t.toolChoice;if(s.vllmPriority!==void 0)a.priority=s.vllmPriority;let T=Fe(s),p=Oe(e,t,a);if(s.thinkingFormat==="zai"&&e.reasoning){let o=a;if(o.thinking=t?.reasoningEffort?{type:"enabled",clear_thinking:!1}:{type:"disabled"},t?.reasoningEffort&&s.supportsReasoningEffort){let f=e.thinkingLevelMap?.[t.reasoningEffort],h=f===void 0?t.reasoningEffort:f;if(typeof h==="string")o.reasoning_effort=h}}else if(s.thinkingFormat==="qwen"&&e.reasoning){if(a.enable_thinking=!!t?.reasoningEffort,t?.reasoningEffort&&s.supportsReasoningEffort){let o=e.thinkingLevelMap?.[t.reasoningEffort]??t.reasoningEffort;if(typeof o==="string")a.reasoning_effort=o}}else if(s.thinkingFormat==="qwen-chat-template"&&e.reasoning)a.chat_template_kwargs={enable_thinking:!!t?.reasoningEffort,preserve_thinking:!0};else if(s.thinkingFormat==="chat-template"&&e.reasoning){let o=V(e,t,s.chatTemplateKwargs,p);if(o)a.chat_template_kwargs=o}else if(s.thinkingFormat==="baseten"&&e.reasoning){let o=a,f=V(e,t,s.chatTemplateArgs,p);if(f)o.chat_template_args=f;if(s.supportsReasoningEffort){let h=t?.reasoningEffort,A=h?e.thinkingLevelMap?.[h]:e.thinkingLevelMap?.off,M=A===void 0?h:A;if(typeof M==="string")o.reasoning_effort=M}}else if(s.thinkingFormat==="deepseek"&&e.reasoning){if(t?.reasoningEffort)a.thinking={type:"enabled"};else if(e.thinkingLevelMap?.off!==null)a.thinking={type:"disabled"};if(t?.reasoningEffort&&s.supportsReasoningEffort)a.reasoning_effort=e.thinkingLevelMap?.[t.reasoningEffort]??t.reasoningEffort}else if(s.thinkingFormat==="openrouter"&&e.reasoning){let o=a;if(t?.reasoningEffort)o.reasoning={effort:e.thinkingLevelMap?.[t.reasoningEffort]??t.reasoningEffort};else if(e.thinkingLevelMap?.off!==null)o.reasoning={effort:e.thinkingLevelMap?.off??"none"}}else if(s.thinkingFormat==="ant-ling"&&e.reasoning&&t?.reasoningEffort){let o=e.thinkingLevelMap?.[t.reasoningEffort];if(typeof o==="string")a.reasoning={effort:o}}else if(s.thinkingFormat==="together"&&e.reasoning){let o=a;if(o.reasoning={enabled:!!t?.reasoningEffort},t?.reasoningEffort&&s.supportsReasoningEffort)o.reasoning_effort=e.thinkingLevelMap?.[t.reasoningEffort]??t.reasoningEffort}else if(s.thinkingFormat==="string-thinking"&&e.reasoning){let o=a;if(t?.reasoningEffort)o.thinking=e.thinkingLevelMap?.[t.reasoningEffort]??t.reasoningEffort;else if(e.thinkingLevelMap?.off!==null)o.thinking=e.thinkingLevelMap?.off??"none"}else if(t?.reasoningEffort&&e.reasoning&&s.supportsReasoningEffort)a.reasoning_effort=e.thinkingLevelMap?.[t.reasoningEffort]??t.reasoningEffort;else if(!t?.reasoningEffort&&e.reasoning&&s.supportsReasoningEffort){let o=e.thinkingLevelMap?.off;if(typeof o==="string")a.reasoning_effort=o}if(T&&p!==void 0)Object.assign(a,{[T]:p});if(e.compat?.openRouterRouting)a.provider=e.compat.openRouterRouting;if(e.compat?.vercelGatewayRouting){let o=e.compat.vercelGatewayRouting;if(o.only||o.order){let f={};if(o.only)f.only=o.only;if(o.order)f.order=o.order;a.providerOptions={gateway:f}}}let d=pr(e,t?.reasoningEffort??"off",t?.samplingParams);if(d)Object.assign(a,d);return a}function Fe(e){if(e.thinkingTokenBudgetField)return e.thinkingTokenBudgetField;if(e.supportsThinkingTokenBudget)return"thinking_token_budget";return}function Oe(e,n,t){if(!n?.reasoningEffort||!e.reasoning)return;let s=t.max_tokens??t.max_completion_tokens??e.maxTokens,u=js($s(n.reasoningEffort,n.thinkingBudgets),s);return u>0?u:void 0}function V(e,n,t,s){let u={};for(let[r,k]of Object.entries(t)){let g=be(e,n,k,s);if(g!==void 0)u[r]=g}return Object.keys(u).length>0?u:void 0}function be(e,n,t,s){if(typeof t!=="object"||t===null)return t;let u=n?.reasoningEffort;if(!u&&t.omitWhenOff)return;if(t.$var==="thinking.enabled")return!!u;if(t.$var==="thinking.budget")return s;let r=u?e.thinkingLevelMap?.[u]:e.thinkingLevelMap?.off;return r===void 0?u:typeof r==="string"?r:void 0}function Be(e,n){if(e.cacheControlFormat!=="anthropic"||n==="none")return;let t=n==="long"&&e.supportsLongCacheRetention?"1h":void 0;return{type:"ephemeral",...t?{ttl:t}:{}}}function Pe(e,n,t){Le(e,t),ze(n,t),qe(e,t)}function Le(e,n){for(let t of e)if(t.role==="system"||t.role==="developer"){Ge(t,n);return}}function qe(e,n){for(let t=e.length-1;t>=0;t--){let s=e[t];if(s.role==="user"||s.role==="assistant"||s.role==="tool"){if(je(s,n))return}}}function ze(e,n){if(!e||e.length===0)return;let t=e[e.length-1];t.cache_control=n}function Ge(e,n){return Y(e,n)}function je(e,n){if(e.role==="user"||e.role==="assistant"||e.role==="tool")return Y(e,n);return!1}function Y(e,n){let t=e.content;if(typeof t==="string"){if(t.length===0)return!1;return e.content=[{type:"text",text:t,cache_control:n}],!0}if(!Array.isArray(t))return!1;for(let s=t.length-1;s>=0;s--){let u=t[s];if(u?.type==="text"){let r=u;return r.cache_control=n,!0}}return!1}function $e(e,n,t,s){let u=xe(n,t.supportsMidConvoSystemMessages),r=[],k=(p)=>{if(p.includes("|")){let d=p.indexOf("|"),o=p.slice(0,d).replace(/[^a-zA-Z0-9_-]/g,"_"),f=p.slice(d+1).replace(/[^a-zA-Z0-9_-]/g,"_"),h=f.length>0?`${o}_${f}`:o;if(h.length<=40)return h;let A=Qt(p).slice(0,8);return`${o.slice(0,Math.max(1,40-A.length-1))}_${A}`}if(e.provider==="openai")return p.length>40?p.slice(0,40):p;return p},g=Ne(u.messages,e,(p)=>k(p)),R=He(u.messages,t.supportsMidConvoSystemMessages===!0&&t.supportsMidConvoToolAdditions===!0),a=e.reasoning&&t.supportsDeveloperRole?"developer":"system",T=null;for(let p=0;p<g.length;p++){let d=g[p];if(t.requiresAssistantAfterToolResult&&T==="toolResult"&&d.role==="user")r.push({role:"assistant",content:"I have processed the tool results."});if(d.role==="system"){let o=p>0&&R.anchorsAdditions?d.toolsAdded??[]:[];if(o.length>0){let h={role:"system",tools:ee(o,t)};r.push(h)}let f=p===0?re(d):mt(d);if(f.length>0)r.push({role:a,content:C(f)})}else if(d.role==="user")if(typeof d.content==="string")r.push({role:"user",content:C(d.content)});else{let o=d.content.filter((f)=>f.type!=="text"||f.text.length>0).map((f)=>{if(f.type==="text")return{type:"text",text:C(f.text)};else return{type:"image_url",image_url:{url:`data:${f.mimeType};base64,${f.data}`}}});if(o.length===0)continue;r.push({role:"user",content:o})}else if(d.role==="assistant"){let o={role:"assistant",content:t.requiresAssistantAfterToolResult?"":null},f=d.content.filter(U).filter((l)=>l.text.trim().length>0).map((l)=>({type:"text",text:C(l.text)})),h=f.map((l)=>l.text).join(""),A=d.content.filter(ce),M=d.content.filter(ge),B=A.map((l)=>Re(l.thinkingSignature)).find((l)=>l!==void 0),w=M.map((l)=>_e(l.thoughtSignature)).filter((l)=>l!==void 0),S=B??(w.length>0?w:void 0),v=A.filter((l)=>l.thinking.trim().length>0);if(v.length>0)if(t.requiresThinkingAsText){let l=v.map((I)=>C(I.thinking)).join(`
|
|
4
|
+
|
|
5
|
+
`);o.content=[{type:"text",text:l},...f]}else{if(h.length>0)o.content=h;if(!S){let l=v[0].thinkingSignature;if(e.provider==="opencode-go"&&l==="reasoning")l="reasoning_content";if(l&&Ce(l))o[l]=v.map((I)=>I.thinking).join(`
|
|
6
|
+
`)}}else if(h.length>0)o.content=h;if(M.length>0)o.tool_calls=M.map((l)=>{let I=s?.grammarToolInputProperties?.get(l.name);if(I!==void 0)return{id:l.id,type:"custom",custom:{name:l.name,input:C(wo(l.name,l.arguments,I))}};return{id:l.id,type:"function",function:{name:l.name,arguments:JSON.stringify(l.arguments)}}});if(S)o.reasoning_details=S;if(t.requiresReasoningContentOnAssistantMessages&&e.reasoning&&o.reasoning_content===void 0)o.reasoning_content="";let F=o.content;if(!(F!==null&&F!==void 0&&(typeof F==="string"?F.length>0:F.length>0))&&!o.tool_calls)continue;r.push(o)}else if(d.role==="toolResult"){let o=[],f=p;for(;f<g.length&&g[f].role==="toolResult";f++){let h=g[f],A=h.content.filter(U).map((v)=>v.text).join(`
|
|
7
|
+
`),M=h.content.some((v)=>v.type==="image"),w=A.length>0?A:M?"(see attached image)":"(no tool output)",S={role:"tool",content:C(w),tool_call_id:h.toolCallId};if(t.requiresToolResultName&&h.toolName)S.name=h.toolName;if(r.push(S),M&&e.input.includes("image")){for(let v of h.content)if(me(v))o.push({type:"image_url",image_url:{url:`data:${v.mimeType};base64,${v.data}`}})}}if(p=f-1,o.length>0){if(t.requiresAssistantAfterToolResult)r.push({role:"assistant",content:"I have processed the tool results."});r.push({role:"user",content:[{type:"text",text:"Attached image(s) from tool result:"},...o]}),T="user"}else T="toolResult";continue}T=d.role}return r}function ee(e,n){return e.map((t)=>{let s=En(t,n.supportsOpenAIGrammarTools);if(s)return{type:"custom",custom:{name:t.name,description:t.description,format:{type:"grammar",grammar:{syntax:s.format,definition:s.definition}}}};let u=Ie(t,n.supportsStrictMode!==!1);return{type:"function",function:{name:t.name,description:t.description,parameters:De(t,u),...n.supportsStrictMode!==!1&&{strict:u??!1}}}})}function Z(e,n){let t=e.prompt_tokens||0,s=e.prompt_tokens_details?.cached_tokens??e.prompt_cache_hit_tokens??e.cached_tokens??0,u=e.prompt_tokens_details?.cache_write_tokens||0,r=Math.max(0,t-s-u),k=e.completion_tokens||0,g={input:r,output:k,cacheRead:s,cacheWrite:u,reasoning:e.completion_tokens_details?.reasoning_tokens||0,totalTokens:r+k+s+u,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}};return he(n,g),g}function Ke(e){if(e===null)return{stopReason:"stop"};switch(e){case"stop":case"end":return{stopReason:"stop"};case"length":return{stopReason:"length"};case"function_call":case"tool_calls":return{stopReason:"toolUse"};case"content_filter":return{stopReason:"error",errorMessage:"Provider finish_reason: content_filter"};case"network_error":return{stopReason:"error",errorMessage:"Provider finish_reason: network_error"};default:return{stopReason:"error",errorMessage:`Provider finish_reason: ${e}`}}}function Ue(e){let{provider:n,baseUrl:t}=e,s=n==="zai"||n==="zai-coding-cn"||t.includes("api.z.ai")||t.includes("open.bigmodel.cn"),u=n==="together"||t.includes("api.together.ai")||t.includes("api.together.xyz"),r=n==="moonshotai"||n==="moonshotai-cn"||t.includes("api.moonshot."),k=n==="openrouter"||t.includes("openrouter.ai"),g=n==="cloudflare-workers-ai"||t.includes("api.cloudflare.com"),R=n==="cloudflare-ai-gateway"||t.includes("gateway.ai.cloudflare.com"),a=n==="nvidia"||t.includes("integrate.api.nvidia.com"),T=n==="ant-ling"||t.includes("api.ant-ling.com"),p=n==="cerebras"||t.includes("cerebras.ai"),d=n==="deepseek"||t.toLowerCase().includes("deepseek.com"),o=a||p||n==="xai"||t.includes("api.x.ai")||u||t.includes("chutes.ai")||d||s||r||n==="opencode"||t.includes("opencode.ai")||g||R||T,f=t.includes("chutes.ai")||d||r||R||u||a||T||s,h=n==="xai"||t.includes("api.x.ai"),A=k&&(e.id.startsWith("anthropic/")||e.id.startsWith("openai/")),M=n==="openrouter"&&e.id.startsWith("anthropic/")?"anthropic":void 0;return{supportsStore:!o,supportsDeveloperRole:A||!o&&!k,supportsReasoningEffort:!h&&!s&&!r&&!u&&!R&&!a&&!T,supportsUsageInStreaming:!0,supportsFinishReason:!0,maxTokensField:f?"max_tokens":"max_completion_tokens",requiresToolResultName:!1,requiresAssistantAfterToolResult:!1,requiresThinkingAsText:!1,requiresReasoningContentOnAssistantMessages:d,thinkingFormat:d?"deepseek":s?"zai":u?"together":T?"ant-ling":k?"openrouter":"openai",openRouterRouting:{},vercelGatewayRouting:{},chatTemplateKwargs:{},chatTemplateArgs:{},zaiToolStream:!1,supportsThinkingTokenBudget:!1,thinkingTokenBudgetField:void 0,supportsStrictMode:!1,supportsOpenAIGrammarTools:!1,supportsMidConvoSystemMessages:!1,supportsMidConvoToolAdditions:!1,cacheControlFormat:M,sendSessionAffinityHeaders:k,sessionAffinityFormat:k?"openrouter":"openai",supportsLongCacheRetention:!(u||g||R||a||T)}}function D(e){let n=Ue(e);if(!e.compat)return n;return{supportsStore:e.compat.supportsStore??n.supportsStore,supportsDeveloperRole:e.compat.supportsDeveloperRole??n.supportsDeveloperRole,supportsReasoningEffort:e.compat.supportsReasoningEffort??n.supportsReasoningEffort,supportsUsageInStreaming:e.compat.supportsUsageInStreaming??n.supportsUsageInStreaming,supportsFinishReason:e.compat.supportsFinishReason??n.supportsFinishReason,maxTokensField:e.compat.maxTokensField??n.maxTokensField,requiresToolResultName:e.compat.requiresToolResultName??n.requiresToolResultName,requiresAssistantAfterToolResult:e.compat.requiresAssistantAfterToolResult??n.requiresAssistantAfterToolResult,requiresThinkingAsText:e.compat.requiresThinkingAsText??n.requiresThinkingAsText,requiresReasoningContentOnAssistantMessages:e.compat.requiresReasoningContentOnAssistantMessages??n.requiresReasoningContentOnAssistantMessages,thinkingFormat:e.compat.thinkingFormat??n.thinkingFormat,openRouterRouting:e.compat.openRouterRouting??{},vercelGatewayRouting:e.compat.vercelGatewayRouting??n.vercelGatewayRouting,chatTemplateKwargs:e.compat.chatTemplateKwargs??n.chatTemplateKwargs,chatTemplateArgs:e.compat.chatTemplateArgs??n.chatTemplateArgs,zaiToolStream:e.compat.zaiToolStream??n.zaiToolStream,supportsThinkingTokenBudget:e.compat.supportsThinkingTokenBudget??n.supportsThinkingTokenBudget,thinkingTokenBudgetField:e.compat.thinkingTokenBudgetField??n.thinkingTokenBudgetField,supportsStrictMode:e.compat.supportsStrictMode??n.supportsStrictMode,supportsOpenAIGrammarTools:e.compat.supportsOpenAIGrammarTools??n.supportsOpenAIGrammarTools,supportsMidConvoSystemMessages:e.compat.supportsMidConvoSystemMessages??n.supportsMidConvoSystemMessages,supportsMidConvoToolAdditions:e.compat.supportsMidConvoToolAdditions??n.supportsMidConvoToolAdditions,cacheControlFormat:e.compat.cacheControlFormat??n.cacheControlFormat,sendSessionAffinityHeaders:e.compat.sendSessionAffinityHeaders??n.sendSessionAffinityHeaders,sessionAffinityFormat:e.compat.sessionAffinityFormat??n.sessionAffinityFormat,supportsLongCacheRetention:e.compat.supportsLongCacheRetention??n.supportsLongCacheRetention,vllmPriority:e.compat.vllmPriority}}export{$e as convertMessages,Me as stream,gt as streamSimple};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Z}from"./chunk-fmvs5wd0.js";import{M}from"./chunk-2bz3h7k7.js";import{m}from"./chunk-5ngmwd2s.js";var i=m(M());var t=m(M());import{exec as u}from"child_process";import{promisify as w}from"util";var a=m(Z()),p=(r,e,o)=>{if(e.Version!==1)throw Error(`Profile ${r} credential_process did not return Version 1.`);if(e.AccessKeyId===void 0||e.SecretAccessKey===void 0)throw Error(`Profile ${r} credential_process returned invalid credentials.`);if(e.Expiration){let d=new Date;if(new Date(e.Expiration)<d)throw Error(`Profile ${r} credential_process returned expired credentials.`)}let s=e.AccountId;if(!s&&o?.[r]?.aws_account_id)s=o[r].aws_account_id;let n={accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,...e.SessionToken&&{sessionToken:e.SessionToken},...e.Expiration&&{expiration:new Date(e.Expiration)},...e.CredentialScope&&{credentialScope:e.CredentialScope},...s&&{accountId:s}};return a.setCredentialFeature(n,"CREDENTIALS_PROCESS","w"),n};var f=async(r,e,o)=>{let s=e[r];if(e[r]){let n=s.credential_process;if(n!==void 0){let d=w(t.externalDataInterceptor?.getTokenRecord?.().exec??u);try{let{stdout:c}=await d(n),l;try{l=JSON.parse(c.trim())}catch{throw Error(`Profile ${r} credential_process returned invalid JSON.`)}return p(r,l,e)}catch(c){throw new t.CredentialsProviderError(c.message,{logger:o})}}else throw new t.CredentialsProviderError(`Profile ${r} did not contain credential_process.`,{logger:o})}else throw new t.CredentialsProviderError(`Profile ${r} could not be found in shared credentials file.`,{logger:o})};var P=(r={})=>async({callerClientConfig:e}={})=>{r.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let o=await i.parseKnownFiles(r);return f(i.getProfileName({profile:r.profile??e?.profile}),o,r.logger)};export{P as fromProcess};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ge,oe}from"./chunk-2bz3h7k7.js";import{o,f}from"./chunk-5ngmwd2s.js";var _t=o(function(le){var{hasOwn:K}=ge(),{streamCollector:te}=ge();le.streamCollector=te;var{buildQueryString:Q,HttpResponse:J}=oe(),A=f("https"),{Readable:ne}=f("stream"),O=f("http2");function M(e){let t=e&&typeof e==="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){let r=Error("Request aborted");return r.name="AbortError",r.cause=t,r}let s=Error(String(t));return s.name="AbortError",s}let n=Error("Request aborted");return n.name="AbortError",n}var se=["ECONNRESET","EPIPE","ETIMEDOUT"],G=(e)=>{let t={};for(let n in e){if(!K(e,n))continue;let s=e[n];t[n]=Array.isArray(s)?s.join(","):s}return t},m={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:(e)=>clearTimeout(e)},j=1000,re=(e,t,n=0)=>{if(!n)return-1;let s=(r)=>{let c=m.setTimeout(()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:"TimeoutError"}))},n-r),a=(u)=>{if(u?.connecting)u.on("connect",()=>{m.clearTimeout(c)});else m.clearTimeout(c)};if(e.socket)a(e.socket);else e.on("socket",a)};if(n<2000)return s(0),0;return m.setTimeout(s.bind(null,j),j)},ie=(e,t,n=0,s,r)=>{if(n)return m.setTimeout(()=>{let c=`@smithy/node-http-handler - [${s?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(s){let a=Object.assign(Error(c),{name:"TimeoutError",code:"ETIMEDOUT"});e.destroy(a),t(a)}else c+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",r?.warn?.(c)},n);return-1},ce=3000,ae=(e,{keepAlive:t,keepAliveMsecs:n},s=ce)=>{if(t!==!0)return-1;let r=()=>{if(e.socket)e.socket.setKeepAlive(t,n||0);else e.on("socket",(c)=>{c.setKeepAlive(t,n||0)})};if(s===0)return r(),0;return m.setTimeout(r,s)},B=3000,ue=(e,t,n=0)=>{let s=(r)=>{let c=n-r,a=()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};if(e.socket)e.socket.setTimeout(c,a),e.on("close",()=>e.socket?.removeListener("timeout",a));else e.setTimeout(c,a)};if(0<n&&n<6000)return s(0),0;return m.setTimeout(s.bind(null,n===0?0:B),B)},W=6000;async function X(e,t,n=W,s=!1){let r=t.headers,c=r?r.Expect||r.expect:void 0,a=-1,u=!0;if(!s&&c==="100-continue")u=await Promise.race([new Promise((d)=>{a=Number(m.setTimeout(()=>d(!0),Math.max(W,n)))}),new Promise((d)=>{e.on("continue",()=>{m.clearTimeout(a),d(!0)}),e.on("response",()=>{m.clearTimeout(a),d(!1)}),e.on("error",()=>{m.clearTimeout(a),d(!1)})})]);if(u)fe(e,t.body)}function fe(e,t){if(t instanceof ne){t.pipe(e);return}if(t){let n=Buffer.isBuffer(t);if(n||typeof t==="string"){if(n&&t.byteLength===0)e.end();else e.end(t);return}let r=t;if(typeof r==="object"&&r.buffer&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number"){e.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}e.end(Buffer.from(t));return}e.end()}var de=0,L=void 0,z=void 0;class U{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){if(typeof e?.handle==="function")return e;return new U(e)}static checkSocketUsage(e,t,n=console){let{sockets:s,requests:r,maxSockets:c}=e;if(typeof c!=="number"||c===1/0)return t;let a=15000;if(Date.now()-a<t)return t;if(s&&r)for(let u in s){if(!K(s,u))continue;let d=s[u]?.length??0,g=r[u]?.length??0;if(d>=c&&g>=2*c)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${g} additional requests are enqueued.
|
|
3
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
4
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,n)=>{if(typeof e==="function")e().then((s)=>{t(this.resolveDefaultConfig(s))}).catch(n);else t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:t,requestTimeout:n}={}){if(!this.config)this.config=await this.configProvider;let s=this.config,r=s.logger,c=e.protocol==="https:";if(!c&&!this.config.httpAgent)this.config.httpAgent=await this.config.httpAgentProvider();return new Promise((a,u)=>{let d=void 0,g=-1,p=-1,w=-1,v=-1,C=-1,_=()=>{m.clearTimeout(g),m.clearTimeout(p),m.clearTimeout(w),m.clearTimeout(v),m.clearTimeout(C)},F=async(i)=>{await d,_(),a(i)},E=async(i)=>{await d,_(),u(i)};if(t?.aborted){let i=M(t);E(i);return}let D=e.headers,H=D?(D.Expect??D.expect)==="100-continue":!1,P=c?s.httpsAgent:s.httpAgent;if(H&&!this.externalAgent)P=new(c?A.Agent:L)({keepAlive:!1,maxSockets:1/0});g=m.setTimeout(()=>{this.socketWarningTimestamp=U.checkSocketUsage(P,this.socketWarningTimestamp,r)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2000)+(s.connectionTimeout??1000));let I=e.query?Q(e.query):"",b=void 0;if(e.username!=null||e.password!=null){let i=e.username??"",h=e.password??"";b=`${i}:${h}`}let k=e.path;if(I)k+=`?${I}`;if(e.fragment)k+=`#${e.fragment}`;let y=e.hostname??"";if(y[0]==="["&&y.endsWith("]"))y=e.hostname.slice(1,-1);else y=e.hostname;let S={headers:e.headers,host:y,method:e.method,path:k,port:e.port,agent:P,auth:b},T=(c?A.request:z)(S,(i)=>{let h=new J({statusCode:i.statusCode||-1,reason:i.statusMessage,headers:G(i.headers),body:i});F({response:h})});if(T.on("error",(i)=>{if(se.includes(i.code))E(Object.assign(i,{name:"TimeoutError"}));else E(i)}),t){let i=()=>{T.destroy();let h=M(t);E(h)};if(typeof t.addEventListener==="function"){let h=t;h.addEventListener("abort",i,{once:!0}),T.once("close",()=>h.removeEventListener("abort",i))}else t.onabort=i}let R=n??s.requestTimeout;p=re(T,E,s.connectionTimeout),w=ie(T,E,R,s.throwOnRequestTimeout,r??console),v=ue(T,E,s.socketTimeout);let l=S.agent;if(typeof l==="object"&&"keepAlive"in l)C=ae(T,{keepAlive:l.keepAlive,keepAliveMsecs:l.keepAliveMsecs});d=X(T,e,R,this.externalAgent).catch((i)=>(_(),u(i)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((n)=>{if(e===Symbol.for("logger"))return{...n,logger:n.logger??t};return{...n,[e]:t}})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:n,socketTimeout:s,socketAcquisitionWarningTimeout:r,httpAgent:c,httpsAgent:a,throwOnRequestTimeout:u,logger:d}=e||{},g=!0,p=50;return{connectionTimeout:n,requestTimeout:t,socketTimeout:s,socketAcquisitionWarningTimeout:r,throwOnRequestTimeout:u,httpAgentProvider:async()=>{let w=f("http"),{Agent:v,request:C}=w.default??w;if(z=C,L=v,c instanceof L||typeof c?.destroy==="function")return this.externalAgent=!0,c;return new L({keepAlive:!0,maxSockets:50,...c})},httpsAgent:(()=>{if(a instanceof A.Agent||typeof a?.destroy==="function")return this.externalAgent=!0,a;return new A.Agent({keepAlive:!0,maxSockets:50,...a})})(),logger:d}}}var he=new Uint16Array(1);class N{id=he[0]++;total=0;max=0;session;refs=0;constructor(e){e.unref(),this.session=e}retain(){if(this.session.destroyed)throw Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(this.session.destroyed)return;if(this.refs-=1,this.refs===0)this.session.unref();if(this.refs<0)throw Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){if(!this.session.closed)this.session.close()}destroy(){if(this.refs=0,!this.session.destroyed)this.session.setTimeout(0),this.session.destroy()}useCount(){return this.refs}}class Y{sessions=[];maxConcurrency=0;constructor(e){this.sessions=(e??[]).map((t)=>new N(t))}poll(){let e=!1;for(let t of this.sessions){if(t.deref().destroyed){e=!0;continue}if(!this.maxConcurrency||t.useCount()<this.maxConcurrency)return t}if(e){for(let t of this.sessions)if(t.deref().destroyed)this.remove(t)}}offerLast(e){this.sessions.push(e)}remove(e){let t=this.sessions.indexOf(e);if(t>-1)this.sessions.splice(t,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(e){this.maxConcurrency=e}destroy(e){this.remove(e),e.destroy()}}class Z{config;connectOptions;connectionPools=new Map;constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError("maxConcurrency must be greater than zero.")}lease(e,t){let n=this.getUrlString(e),s=this.getPool(n);if(!this.config.disableConcurrency&&!t.isEventStream){let d=s.poll();if(d)return d.retain(),d}let r=new N(this.connect(n)),c=r.deref();if(this.config.maxConcurrency)c.settings({maxConcurrentStreams:this.config.maxConcurrency},(d)=>{if(d)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())});let a=()=>{this.removeFromPoolAndClose(n,r)},u=()=>{this.removeFromPoolAndCheckedDestroy(n,r)};if(c.on("goaway",a),c.on("error",u),c.on("frameError",u),c.on("close",u),t.requestTimeout)c.setTimeout(t.requestTimeout,u);return s.offerLast(r),r.retain(),r}release(e,t){t.free()}createIsolatedSession(e,t){let n=this.getUrlString(e),s=new N(this.connect(n)),r=s.deref();r.settings({maxConcurrentStreams:1});let c=()=>{s.destroy()};r.on("error",c),r.on("frameError",c),r.on("close",c);let a=t.requestTimeout??300000;return r.setTimeout(a,c),s.retain(),s}destroy(){for(let[e,t]of this.connectionPools){for(let n of[...t])n.destroy();this.connectionPools.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e;for(let t of this.connectionPools.values())t.setMaxConcurrency(e)}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}setNodeHttp2ConnectOptions(e){this.connectOptions=e}debug(){let e={};for(let[t,n]of this.connectionPools){let s=[];for(let r of n)s.push({id:r.id,active:r.useCount(),maxConcurrent:r.max,totalRequests:r.total});e[t]={sessions:s}}return e}removeFromPoolAndClose(e,t){this.connectionPools.get(e)?.remove(t),t.close()}removeFromPoolAndCheckedDestroy(e,t){this.connectionPools.get(e)?.remove(t),t.destroy()}getPool(e){if(!this.connectionPools.has(e)){let t=new Y;if(this.config.maxConcurrency)t.setMaxConcurrency(this.config.maxConcurrency);this.connectionPools.set(e,t)}return this.connectionPools.get(e)}getUrlString(e){return e.destination.toString()}connect(e){return this.connectOptions===void 0?O.connect(e):O.connect(e,this.connectOptions)}}var{constants:V}=O;class q{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new Z({});static create(e){if(typeof e?.handle==="function")return e;return new q(e)}constructor(e){this.configProvider=new Promise((t,n)=>{if(typeof e==="function")e().then((s)=>{t(s||{})}).catch(n);else t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:t,requestTimeout:n,isEventStream:s}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:d,maxConcurrentStreams:g,nodeHttp2ConnectOptions:p}=this.config;if(this.connectionManager.setDisableConcurrentStreams(d??!1),g)this.connectionManager.setMaxConcurrentStreams(g);if(p)this.connectionManager.setNodeHttp2ConnectOptions(p)}let{requestTimeout:r,disableConcurrentStreams:c}=this.config,a=c||s,u=n??r;return new Promise((d,g)=>{let p=!1,w=void 0,v=async(i)=>{await w,d(i)},C=async(i)=>{await w,g(i)};if(t?.aborted){p=!0;let i=M(t);C(i);return}let{hostname:_,method:F,port:E,protocol:D,query:H}=e,P="";if(e.username!=null||e.password!=null){let i=e.username??"",h=e.password??"";P=`${i}:${h}@`}let I=`${D}//${P}${_}${E?`:${E}`:""}`,b={destination:new URL(I)},k={requestTimeout:this.config?.sessionTimeout,isEventStream:s},y=a?this.connectionManager.createIsolatedSession(b,k):this.connectionManager.lease(b,k),S=y.deref(),x=(i)=>{if(a)y.destroy();p=!0,C(i)},T=H?Q(H):"",R=e.path;if(T)R+=`?${T}`;if(e.fragment)R+=`#${e.fragment}`;let l=S.request({...e.headers,[V.HTTP2_HEADER_PATH]:R,[V.HTTP2_HEADER_METHOD]:F});if(u)l.setTimeout(u,()=>{l.close();let i=Error(`Stream timed out because of no activity for ${u} ms`);i.name="TimeoutError",x(i)});if(t){let i=()=>{l.close();let h=M(t);x(h)};if(typeof t.addEventListener==="function"){let h=t;h.addEventListener("abort",i,{once:!0}),l.once("close",()=>h.removeEventListener("abort",i))}else t.onabort=i}l.on("frameError",(i,h,ee)=>{x(Error(`Frame type id ${i} in stream id ${ee} has failed with code ${h}.`))}),l.on("error",x),l.on("aborted",()=>{x(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${l.rstCode}.`))}),l.on("response",(i)=>{let h=new J({statusCode:i[":status"]??-1,headers:G(i),body:l});if(p=!0,v({response:h}),a)S.close(),l.on("end",()=>{y.destroy()})}),l.on("close",()=>{if(a)y.destroy();else this.connectionManager.release(b,y);if(!p){let i=Error("Unexpected error: http2 request did not get a response");if(S.destroyed)i.name="TimeoutError";x(i)}}),w=X(l,e,u)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then((n)=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}}le.DEFAULT_REQUEST_TIMEOUT=de;le.NodeHttp2Handler=q;le.NodeHttpHandler=U});
|
|
5
|
+
export{_t};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Database as g}from"bun:sqlite";import{chmodSync as B,closeSync as H,existsSync as R,openSync as W,rmSync as G}from"fs";var V=2,P=2,Ea="basalt-search.db",Ht=0,Br=1;function h(e){let t=new g(":memory:");try{for(let r of e)t.run(r);return!0}catch{return!1}finally{t.close()}}var T;function Aa(){if(T)return T;let e=h(["CREATE VIRTUAL TABLE f USING fts5(text)"]),t=e&&h(["CREATE VIRTUAL TABLE f USING fts5(text, tokenize='trigram')"]);return T={fts5:e,trigram:t,trigramDiacritics:t&&h(["CREATE VIRTUAL TABLE f USING fts5(text, tokenize='trigram remove_diacritics 1')"]),contentlessDelete:e&&h(["CREATE VIRTUAL TABLE f USING fts5(text, content='', contentless_delete=1)","INSERT INTO f (rowid, text) VALUES (1, 'probe')","DELETE FROM f WHERE rowid = 1"]),secureDelete:e&&h(["CREATE VIRTUAL TABLE f USING fts5(text)","INSERT INTO f (f, rank) VALUES ('secure-delete', 1)"])},T}function X(e){return{msg:e.trigram?"trigram":"unicode61",contentless:e.contentlessDelete}}function O(e){return JSON.stringify({schema:V,extractor:P,...e})}function k(e,t){return`text, ${e.contentless?"content='', contentless_delete=1, ":""}detail=full, tokenize="${t}"`}function Y(e,t,r){let n=r.msg==="trigram"?t.trigramDiacritics?"trigram remove_diacritics 1":"trigram":"unicode61 remove_diacritics 2";e.transaction(()=>{if(e.run("CREATE TABLE IF NOT EXISTS meta (k TEXT PRIMARY KEY, v) WITHOUT ROWID"),e.run(`CREATE TABLE IF NOT EXISTS doc (
|
|
3
|
+
id INTEGER PRIMARY KEY,
|
|
4
|
+
hash INTEGER NOT NULL UNIQUE,
|
|
5
|
+
refs INTEGER NOT NULL,
|
|
6
|
+
len INTEGER NOT NULL,
|
|
7
|
+
bulk INTEGER NOT NULL
|
|
8
|
+
)`),e.run(`CREATE TABLE IF NOT EXISTS ref (
|
|
9
|
+
session_id TEXT NOT NULL,
|
|
10
|
+
seq INTEGER NOT NULL,
|
|
11
|
+
part INTEGER NOT NULL,
|
|
12
|
+
doc INTEGER NOT NULL,
|
|
13
|
+
kind INTEGER NOT NULL,
|
|
14
|
+
tool TEXT,
|
|
15
|
+
err INTEGER NOT NULL DEFAULT 0,
|
|
16
|
+
model TEXT,
|
|
17
|
+
time INTEGER NOT NULL,
|
|
18
|
+
PRIMARY KEY (session_id, seq, part)
|
|
19
|
+
) WITHOUT ROWID`),e.run("CREATE INDEX IF NOT EXISTS ref_doc ON ref(doc,time,kind,tool,err,model)"),e.run("CREATE INDEX IF NOT EXISTS ref_time ON ref(time,session_id,seq,part,doc,kind,tool,err,model)"),e.run("CREATE TABLE IF NOT EXISTS term (t TEXT PRIMARY KEY, n INTEGER NOT NULL) WITHOUT ROWID"),e.run("CREATE TABLE IF NOT EXISTS evicted (session_id TEXT PRIMARY KEY) WITHOUT ROWID"),e.run("CREATE TABLE IF NOT EXISTS backfill_todo (ord INTEGER PRIMARY KEY, session_id TEXT NOT NULL)"),e.run(`CREATE VIRTUAL TABLE IF NOT EXISTS fts USING fts5(${k(r,n)})`),e.run(`CREATE VIRTUAL TABLE IF NOT EXISTS fts_out USING fts5(${k(r,"unicode61 remove_diacritics 2")})`),e.run("CREATE VIRTUAL TABLE IF NOT EXISTS fts_vocab USING fts5vocab(fts, 'row')"),e.run("CREATE VIRTUAL TABLE IF NOT EXISTS fts_out_vocab USING fts5vocab(fts_out, 'row')"),t.secureDelete)e.run("INSERT INTO fts (fts, rank) VALUES ('secure-delete', 1)"),e.run("INSERT INTO fts_out (fts_out, rank) VALUES ('secure-delete', 1)");e.query("INSERT OR REPLACE INTO meta (k, v) VALUES ('fingerprint', ?)").run(O(r)),e.query("INSERT OR REPLACE INTO meta (k, v) VALUES ('layout', ?)").run(JSON.stringify(r))})()}function xs(e){for(let t of["","-wal","-shm","-journal"])G(e+t,{force:!0})}function z(e){for(let t of["","-wal","-shm"])if(R(e+t))B(e+t,384)}function p(e,t){return e.query("SELECT v FROM main.meta WHERE k = ?").get(t)?.v??void 0}function d(e,t,r){e.query("INSERT OR REPLACE INTO main.meta (k, v) VALUES (?, ?)").run(t,r)}function _(e,t,r){let n=X(r),i=!1;if(R(e)){let o=!1;try{let a=new g(e);try{o=a.query("SELECT v FROM meta WHERE k = 'fingerprint'").get()?.v===O(n)}finally{a.close()}}catch{o=!1}if(!o)xs(e),i=!0}if(!R(e))H(W(e,"a",384));let s=new g(e,{create:!0,strict:!0});return s.run("PRAGMA journal_mode = WAL"),s.run("PRAGMA synchronous = NORMAL"),s.run("PRAGMA busy_timeout = 5000"),Y(s,r,n),z(e),s.query("ATTACH ? AS store").run(t),{db:s,layout:n,reset:i}}function Ta(e,t){if(!R(e))return;let r;try{return r=new g(e,{readonly:!0,strict:!0}),r.run("PRAGMA busy_timeout = 5000"),r.query("ATTACH ? AS store").run(t),r.query("SELECT v FROM meta WHERE k = 'layout'").get(),r}catch{r?.close();return}}var D="backfill";function y(e){return e.query("SELECT sum((SELECT max(seq) FROM store.entries WHERE session_id = sessions.id)) AS n FROM store.sessions").get()?.n??0}function j(e){let t=p(e,D);return t?JSON.parse(t):void 0}function M(e,t){d(e,D,JSON.stringify(t))}class A{db;indexer;batch;todo;page;state;constructor(e,t,r=500){this.db=e;this.indexer=t;this.batch=r;this.todo=e.query("SELECT session_id FROM main.backfill_todo WHERE ord = ?"),this.page=e.query("SELECT seq, time, body FROM store.entries WHERE session_id = ? AND seq > ? ORDER BY seq LIMIT ?"),this.state=j(e)}get running(){return this.state?.state==="running"}begin(e){this.db.transaction(()=>{let t=this.db.query("SELECT max(id) AS id FROM store.search_queue").get()?.id??0;d(this.db,"queue_done",t),this.db.run("DELETE FROM main.backfill_todo"),this.db.run("INSERT INTO main.backfill_todo (ord, session_id) SELECT row_number() OVER (ORDER BY updated DESC, id), id FROM store.sessions");let r=this.db.query("SELECT count(*) AS n FROM main.backfill_todo").get()?.n??0,n=y(this.db);this.state={state:r?"running":"done",reason:e,ord:1,seq:-1,total:n,sessionsTotal:r,done:0,sessionsDone:0,startedAt:Date.now()},M(this.db,this.state)})()}step(e){let t=this.state;if(t?.state!=="running")return!1;let r={...t};return this.db.transaction(()=>{let n=this.batch;while(n>0&&r.state==="running"){let i=this.todo.get(r.ord)?.session_id;if(i===void 0){r.state="done",this.db.run("DELETE FROM main.backfill_todo");break}if(r.seq<0)this.indexer.reindex(i,0),r.seq=0;let s=this.page.all(i,r.seq,n);for(let o of s)if(this.indexer.indexRow(i,o.seq,o.time,o.body),r.seq=o.seq,r.done++,n--,performance.now()>e){n=0;break}if(n>0)r.ord++,r.seq=-1,r.sessionsDone++;if(performance.now()>e)break}M(this.db,r)})(),this.state=r,!0}}var Uc=49152,Fc=16384,q=64;function I(e){if(e.length<=65536)return e;return`${e.slice(0,49152)}
|
|
20
|
+
\u2026
|
|
21
|
+
${e.slice(-16384)}`}var K=/[\u3040-\u30FF\u3400-\u9FFF\uF900-\uFAFF\uAC00-\uD7AF]+/g,Z=/[A-Za-z][a-z0-9]*(?:[A-Z][a-z0-9]+)+|[A-Z]{2,}[a-z0-9]+[A-Za-z0-9]*/g,J=/([a-z0-9])([A-Z])|([A-Z])([A-Z][a-z])/g;function b(e){return e.replace(K,(t)=>{if(t.length===1)return` ${t} `;let r=[];for(let n=0;n<t.length-1;n++)r.push(t.slice(n,n+2));return` ${r.join(" ")} `}).replace(Z,(t)=>`${t} ${t.replace(J,"$1$3 $2$4")}`)}function w(e){return`${e} `}function zr(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]+/g,"").normalize("NFC")}var Q=/[\p{L}\p{N}\p{Co}]+/gu;function Bc(e){return zr(b(e)).match(Q)??[]}var ft={user:1,assistant:2,thinking:3,tool_input:4,tool_output:5,error:6,extension:7,notice:8,attachment:9,title:10},vs=Object.fromEntries(Object.entries(ft).map(([e,t])=>[t,e])),ee=1e4,te=-1,re=2048;function v(e){return e==="tool_output"||e==="attachment"||e==="thinking"||e==="tool_input"}function x(e,t=[],r=0){if(r>6)return t;if(typeof e==="string")t.push(e);else if(typeof e==="number"||typeof e==="boolean")t.push(String(e));else if(Array.isArray(e))for(let n of e)x(n,t,r+1);else if(e&&typeof e==="object")for(let n of Object.values(e))x(n,t,r+1);return t}function qt(e,t=!1){let r=[];switch(e.type){case"user":{if(typeof e.text==="string")r.push({part:0,kind:e.notices?"notice":"user",text:e.text});(Array.isArray(e.attachments)?e.attachments:[]).forEach((i,s)=>{let o=String(i?.name??""),a=i?.kind==="image"?o:`${o}
|
|
22
|
+
${String(i?.data??"")}`;r.push({part:1+s,kind:"attachment",text:a})});break}case"notice_pending":if(typeof e.notice?.text==="string")r.push({part:0,kind:"notice",text:e.notice.text});break;case"assistant":{let n=typeof e.model==="string"?e.model:void 0;if((Array.isArray(e.parts)?e.parts:[]).forEach((s,o)=>{if(s?.type==="text"||s?.type==="thinking"){if(typeof s.text==="string")r.push({part:o,kind:s.type==="text"?"assistant":"thinking",text:s.text,model:n})}else if(s?.type==="tool_call"){let a=typeof s.name==="string"?s.name:void 0;if(r.push({part:o,kind:"tool_input",tool:a,model:n,text:[a??"",...x(s.input)].join(`
|
|
23
|
+
`)}),typeof s.output==="string")r.push({part:ee+o,kind:"tool_output",tool:a,model:n,text:s.output})}}),typeof e.error==="string")r.push({part:te,kind:"error",err:!0,model:n,text:e.error});break}case"tool_result":{let n=typeof e.name==="string"?e.name:void 0,i=typeof e.output==="string"?e.output:"",s=e.isError===!0;if(r.push({part:0,kind:"tool_output",tool:n,err:s,text:i}),s)r.push({part:1,kind:"error",tool:n,err:s,text:i.slice(0,re)});break}case"run":if("error"in e&&typeof e.error==="string")r.push({part:0,kind:"error",err:!0,text:e.error});break;case"extension":{let n=e.display;if(n&&typeof n.text==="string")r.push({part:0,kind:"extension",text:`${n.title??""}
|
|
24
|
+
${n.text}`});break}}if(!t)for(let n of r)n.text=I(n.text);return r.filter((n)=>n.text.trim())}function C(e){return e.trim()?[{part:0,kind:"title",text:I(e)}]:[]}function ne(e,t){return BigInt.asIntN(64,Bun.hash.wyhash(`${e?"B":"M"}${t}`))}class N{db;layout;readEntry;readTitle;previousModel;selectRefs;deleteRefs;insertRef;findDoc;insertDoc;increment;decrement;docRefs;deleteDoc;insertMsg;insertOut;deleteMsg;deleteOut;stats={entries:0,fields:0,bytes:0,newDocs:0,newBytes:0};outChanges=0;constructor(e,t){this.db=e;this.layout=t;this.readEntry=e.query("SELECT time, body FROM store.entries WHERE session_id = ? AND seq = ?"),this.readTitle=e.query("SELECT title, created FROM store.sessions WHERE id = ?"),this.previousModel=e.query("SELECT json_extract(body, '$.model') AS model FROM store.entries WHERE session_id = ? AND seq < ? AND json_extract(body, '$.type') = 'assistant' ORDER BY seq DESC LIMIT 1"),this.selectRefs=e.query("SELECT doc FROM main.ref WHERE session_id = ? AND seq = ?"),this.deleteRefs=e.query("DELETE FROM main.ref WHERE session_id = ? AND seq = ?"),this.insertRef=e.query("INSERT INTO main.ref (session_id, seq, part, doc, kind, tool, err, model, time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"),this.findDoc=e.query("SELECT id FROM main.doc WHERE hash = ?"),this.insertDoc=e.query("INSERT INTO main.doc (hash, refs, len, bulk) VALUES (?, 1, ?, ?)"),this.increment=e.query("UPDATE main.doc SET refs = refs + 1 WHERE id = ?"),this.decrement=e.query("UPDATE main.doc SET refs = refs - 1 WHERE id = ?"),this.docRefs=e.query("SELECT refs, bulk FROM main.doc WHERE id = ?"),this.deleteDoc=e.query("DELETE FROM main.doc WHERE id = ?"),this.insertMsg=e.query("INSERT INTO main.fts (rowid, text) VALUES (?, ?)"),this.insertOut=e.query("INSERT INTO main.fts_out (rowid, text) VALUES (?, ?)"),this.deleteMsg=e.query("DELETE FROM main.fts WHERE rowid = ?"),this.deleteOut=e.query("DELETE FROM main.fts_out WHERE rowid = ?")}reindex(e,t){let r=0,n=[];if(t===0){let i=this.readTitle.get(e);if(i)r=i.created,n=C(i.title)}else{let i=this.readEntry.get(e,t);if(i)r=i.time,n=this.fields(e,t,i.body)}this.apply(e,t,r,n)}indexRow(e,t,r,n){this.apply(e,t,r,this.fields(e,t,n))}fields(e,t,r){let n;try{n=JSON.parse(r)}catch{return[]}if(!n||typeof n!=="object")return[];let i=qt(n);if(n.type==="tool_result"&&i.length){let s=this.previousModel.get(e,t)?.model??void 0;if(s)for(let o of i)o.model=s}return i}apply(e,t,r,n){let i=this.selectRefs.all(e,t);if(i.length)this.deleteRefs.run(e,t);this.stats.entries++;for(let s of n){let o=v(s.kind),a=ne(o,s.text);this.stats.fields++,this.stats.bytes+=s.text.length;let u=this.findDoc.get(a)?.id;if(u===void 0){if(u=Number(this.insertDoc.run(a,s.text.length,o?1:0).lastInsertRowid),o)this.insertOut.run(u,b(s.text)),this.outChanges++;else this.insertMsg.run(u,this.layout.msg==="trigram"?w(s.text):b(s.text));this.stats.newDocs++,this.stats.newBytes+=s.text.length}else this.increment.run(u);this.insertRef.run(e,t,s.part,u,ft[s.kind],s.tool??null,s.err?1:0,s.model??null,r)}for(let{doc:s}of i)this.release(s)}release(e){this.decrement.run(e);let t=this.docRefs.get(e);if(!t||t.refs>0)return;if(this.deleteDoc.run(e),t.bulk)this.deleteOut.run(e),this.outChanges++;else this.deleteMsg.run(e)}}class L{db;page;clearRange;clearTail;upsert;constructor(e){this.db=e;this.page=e.query("SELECT term, doc FROM main.fts_out_vocab WHERE term > ? ORDER BY term LIMIT ?"),this.clearRange=e.query("DELETE FROM main.term WHERE t > ? AND t <= ?"),this.clearTail=e.query("DELETE FROM main.term WHERE t > ?"),this.upsert=e.query("INSERT OR REPLACE INTO main.term (t, n) VALUES (?, ?)")}step(e,t){let r=this.page.all(e,t),n=r.at(-1)?.term;if(r.length<t||n===void 0)this.clearTail.run(e);else this.clearRange.run(e,n);for(let{term:i,doc:s}of r)if(i.length<=q)this.upsert.run(i,s);return r.length<t?void 0:n}}var se=2000,ie=30000;class zc{options;db;layout;reset;indexer;backfill;terms;queueRows;queueMax;sliceMs;backfillSliceMs;queueBatch;termRefreshMs;queueDone;termCursor;termStale;lastTermRefresh=Number.NEGATIVE_INFINITY;rateStart;estimate;closed=!1;constructor(e){this.options=e;let t=_(e.indexPath,e.storePath,e.features);if(this.db=t.db,this.layout=t.layout,this.reset=t.reset,this.sliceMs=e.sliceMs??20,this.backfillSliceMs=e.backfillSliceMs??200,this.queueBatch=e.queueBatch??200,this.termRefreshMs=e.termRefreshMs??60000,this.indexer=new N(this.db,this.layout),this.terms=new L(this.db),this.backfill=new A(this.db,this.indexer,e.batch??500),this.queueRows=this.db.query("SELECT id, session_id, seq FROM store.search_queue WHERE id > ? ORDER BY id LIMIT ?"),this.queueMax=this.db.query("SELECT max(id) AS id FROM store.search_queue"),!this.backfill.state)this.backfill.begin(this.reset?"rebuild":"initial");this.queueDone=Number(p(this.db,"queue_done")??0),this.termStale=Number(p(this.db,"term_stale")??0)===1}step(e){if(this.closed)return!1;if(this.drainQueue(e??performance.now()+this.sliceMs))return!0;if(this.backfill.running){this.rateStart??={time:performance.now(),done:this.backfill.state?.done??0};let t=this.indexer.outChanges;if(this.backfill.step(e??performance.now()+this.backfillSliceMs),this.markTerms(t),!this.backfill.running)this.lastTermRefresh=Number.NEGATIVE_INFINITY;return!0}return this.refreshTerms(e??performance.now()+this.sliceMs)}drain(){while(this.step());}drainQueue(e){let t=!1;return this.db.transaction(()=>{let r=this.queueRows.all(this.queueDone,this.queueBatch);if(!r.length)return;t=!0;let n=this.indexer.outChanges,i=new Set,s=this.queueDone;for(let o of r){let a=`${o.seq}\x00${o.session_id}`;if(!i.has(a))i.add(a),this.indexer.reindex(o.session_id,o.seq);if(s=o.id,performance.now()>e)break}d(this.db,"queue_done",s),this.markTerms(n),this.queueDone=s})(),t}markTerms(e){if(this.indexer.outChanges===e||this.termStale)return;this.termStale=!0,d(this.db,"term_stale",1)}refreshTerms(e){if(this.termCursor===void 0){if(!this.termStale||performance.now()-this.lastTermRefresh<this.termRefreshMs)return!1;this.termCursor="",this.termStale=!1,this.indexer.outChanges=0,d(this.db,"term_stale",0)}while(this.termCursor!==void 0&&performance.now()<=e){let t=this.termCursor;this.db.transaction(()=>{this.termCursor=this.terms.step(t,se)})()}if(this.termCursor===void 0)this.lastTermRefresh=performance.now();return!0}status(){let e=this.queueMax.get()?.id??this.queueDone,t=this.backfill.state,r;if(t?.state==="running"&&this.rateStart){let i=(performance.now()-this.rateStart.time)/1000,s=(t.done-this.rateStart.done)/i;if(i>0.5&&s>0)r=Math.max(0,Math.round(Math.max(0,t.total-t.done)/s))}let n=t?{state:t.state,reason:t.reason,total:t.total,done:t.done,sessionsTotal:t.sessionsTotal,sessionsDone:t.sessionsDone,startedAt:t.startedAt}:void 0;if(!this.estimate||performance.now()-this.estimate.time>ie)this.estimate={time:performance.now(),entries:y(this.db)};return{queueDone:this.queueDone,lag:Math.max(0,e-this.queueDone),entries:this.estimate.entries,...n?{backfill:n}:{},...r!==void 0?{etaSec:r}:{},layout:this.layout,reset:this.reset}}withIndex(e){return e(this.db)}compact(e){if(this.closed)return;if(e.vacuum)this.db.run("INSERT INTO main.fts(fts) VALUES('optimize')"),this.db.run("INSERT INTO main.fts_out(fts_out) VALUES('optimize')"),this.db.run("VACUUM main");if(e.checkpoint||e.vacuum)this.db.run("PRAGMA main.wal_checkpoint(TRUNCATE)")}close(){if(this.closed)return;this.closed=!0,this.db.close()}}var F=1000,oe=100;function ae(e){let t,r,n,i=!1,s=!1,o=0,a=[],u=(f)=>e.postMessage(f),m=(f)=>{if(s)return;if(n)clearTimeout(n);n=setTimeout(U,f)},S=()=>{if(!r||Atomics.load(r,Ht)!==1)return;Atomics.store(r,Br,1),Atomics.notify(r,Br);while(Atomics.load(r,Ht)===1)Atomics.wait(r,Ht,1,1e4);Atomics.store(r,Br,0)};function U(){if(n=void 0,s||!t)return;S();let f=!1;try{f=t.step()}catch(E){u({type:"error",message:E instanceof Error?E.message:String(E),fatal:!1}),i=!1,m(F);return}let l=performance.now();if(f){if(i=!0,l-o>=oe)o=l,u({type:"status",status:t.status()});m(0);return}i=!1,o=l;let c=t.status();u({type:"status",status:c});for(let E of a.splice(0))u({type:"flushed",id:E,status:c});m(F)}e.onmessage=(f)=>{let l=f.data;if(l.type==="init"){r=new Int32Array(l.flags);try{t=new zc(l.options)}catch(c){u({type:"error",message:c instanceof Error?c.message:String(c),fatal:!0});return}u({type:"status",status:t.status()}),m(0)}else if(l.type==="dirty"){if(!i)m(0)}else if(l.type==="pause")S();else if(l.type==="flush"){if(a.push(l.id),!i)m(0)}else if(l.type==="compact"){if(S(),t){try{t.compact(l)}catch(c){u({type:"error",message:c instanceof Error?c.message:String(c),fatal:!1})}u({type:"flushed",id:l.id,status:t.status()})}}else if(l.type==="stop"){if(s=!0,n)clearTimeout(n);t?.close(),u({type:"stopped"})}}}if(!Bun.isMainThread)ae(globalThis);
|
|
25
|
+
export{Ea,Ht,Br,Aa,xs,Ta,Uc,Fc,zr,Bc,ft,vs,qt,zc};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ne}from"./chunk-19nje7ny.js";import{O}from"./chunk-ma4nhnnj.js";import{le,Ue}from"./chunk-fpksd95h.js";import{J,dn,it}from"./chunk-23qfxx3v.js";class u extends Error{code;diagnosticDetails;constructor(r,t,n){super(r);this.name="PiMessagesResponseError",this.code=t,this.diagnosticDetails=n}}function x(r){try{let t=JSON.parse(r),n=t?.error;return t&&typeof n==="object"&&n!==null&&!Array.isArray(n)?t:void 0}catch{return}}function m(r){return r.length>8192?`${r.slice(0,8192)}\u2026`:r}function y(r,t,n){let e=typeof n?.error?.message==="string"?n.error.message:void 0,s=typeof n?.error?.code==="string"?n.error.code:void 0,a=e??t,o=s?` (${s})`:"";return`${r.status} ${r.statusText}: ${a}${o}`}function k(r,t,n,e){let s=x(e),a=typeof s?.error?.code==="string"?s.error.code:void 0;return new u(y(n,e,s),a,{version:1,provider:r.provider,model:r.id,url:t.toString(),status:n.status,statusText:n.statusText,...s?.error===void 0?{}:{error:s.error},...s?{}:{body:m(e)},timestampMs:Date.now()})}function h(){return{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function l(r,t){if(!t)return;it(r,{type:"pi_messages_rewrite",timestamp:Date.now(),details:{...t}})}function w(r){let t={role:"assistant",content:[],api:r.api,provider:r.provider,model:r.id,usage:h(),stopReason:"pending",timestamp:Date.now()},n=new Map;return(e)=>{switch(e.type){case"done":if(Object.assign(t,{stopReason:e.reason,usage:e.usage,responseId:e.responseId}),e.providerThinkingLevel!==void 0)t.providerThinkingLevel=e.providerThinkingLevel;return l(t,e.rewrite),{type:"done",reason:e.reason,message:t};case"error":if(Object.assign(t,{stopReason:e.reason,usage:e.usage,errorMessage:e.errorMessage,responseId:e.responseId}),e.providerThinkingLevel!==void 0)t.providerThinkingLevel=e.providerThinkingLevel;return l(t,e.rewrite),{type:"error",reason:e.reason,error:t};case"start":break;case"text_start":t.content[e.contentIndex]={type:"text",text:""};break;case"text_delta":t.content[e.contentIndex].text+=e.delta;break;case"text_end":Object.assign(t.content[e.contentIndex],{text:e.content,textSignature:e.contentSignature});break;case"thinking_start":t.content[e.contentIndex]={type:"thinking",thinking:""};break;case"thinking_delta":t.content[e.contentIndex].thinking+=e.delta;break;case"thinking_end":Object.assign(t.content[e.contentIndex],{thinking:e.content,thinkingSignature:e.contentSignature,redacted:e.redacted});break;case"toolcall_start":t.content[e.contentIndex]={type:"toolCall",id:e.id,name:e.toolName,arguments:{}},n.set(e.contentIndex,"");break;case"toolcall_delta":{let s=`${n.get(e.contentIndex)??""}${e.delta}`;n.set(e.contentIndex,s),t.content[e.contentIndex].arguments=ne(s);break}case"toolcall_end":return Object.assign(t.content[e.contentIndex],e.toolCall),n.delete(e.contentIndex),{type:"toolcall_end",contentIndex:e.contentIndex,toolCall:t.content[e.contentIndex],partial:t}}return{...e,partial:t}}}async function*b(r){let t=new TextDecoder,n=r.getReader(),e="";try{while(!0){let{done:s,value:a}=await n.read();e+=s?t.decode():t.decode(a,{stream:!0}),e=e.replace(/\r\n/g,`
|
|
3
|
+
`);let o=e.indexOf(`
|
|
4
|
+
|
|
5
|
+
`);while(o!==-1){let c=f(e.slice(0,o));if(c)yield c;e=e.slice(o+2),o=e.indexOf(`
|
|
6
|
+
|
|
7
|
+
`)}if(s)break}if(e.trim()){let s=f(e);if(s)yield s}}finally{n.releaseLock()}}function f(r){let t=r.split(`
|
|
8
|
+
`).find((n)=>n.startsWith("data:"))?.slice(5).trim();return t&&t!=="[DONE]"?JSON.parse(t):void 0}function I(r,t,n){let e=n?"aborted":"error",s={role:"assistant",content:[],api:r.api,provider:r.provider,model:r.id,usage:h(),stopReason:e,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()};if(!n&&t instanceof u)it(s,dn("pi_messages_response_failure",t,t.diagnosticDetails));return{type:"error",reason:e,error:s}}function E(r,t){if(r)return r;return O("PI_CACHE_RETENTION",t)==="long"?"long":void 0}var T=(r,t,n)=>{let e=new J,s=w(r);return(async()=>{try{let a=n?.apiKey;if(!a)throw Error(`No API key provided for provider "${r.provider}"`);let o=new URL(`${r.baseUrl.replace(/\/+$/u,"")}/messages`);if(n?.debug)o.searchParams.set("debug","1");let c={model:r.id,context:t,options:{temperature:n?.temperature,maxTokens:n?.maxTokens,reasoning:n?.reasoning,cacheRetention:E(n?.cacheRetention,n?.env),sessionId:n?.sessionId,toolChoice:n?.toolChoice}},p=await n?.onPayload?.(c,r);if(p!==void 0)c=p;let i=await(n?.fetch??globalThis.fetch)(o,{method:"POST",headers:{authorization:`Bearer ${a}`,accept:"text/event-stream","content-type":"application/json",...Ue(n?.headers)},body:JSON.stringify(c),signal:n?.signal});if(await n?.onResponse?.({status:i.status,headers:le(i.headers)},r),!i.ok){let d=await i.text();throw k(r,o,i,d)}if(!i.body)throw Error(`${r.provider} response has no body`);for await(let d of b(i.body)){await n?.onProviderStreamEvent?.(d,r);let g=s(d);if(e.push(g),g.type==="done"||g.type==="error")return}throw Error(`${r.provider} stream ended without a terminal event`)}catch(a){e.push(I(r,a,n?.signal?.aborted??!1))}})(),e},P=(r,t,n)=>{let e=n;return T(r,t,{...n,reasoning:n?.reasoning,toolChoice:n?.toolChoice,debug:e?.debug})};export{u as PiMessagesResponseError,T as stream,P as streamSimple};
|