@opencode/core 0.0.0-dev-20592 → 0.0.0-dev-20599
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/dist/account/sql.js +1 -1
- package/dist/agent.js +79 -79
- package/dist/aisdk-native.js +89 -89
- package/dist/aisdk.js +94 -94
- package/dist/app.js +7 -7
- package/dist/bus.js +73 -73
- package/dist/chunks/{location-sxgab442.js → instance-015m23px.js} +9 -9
- package/dist/chunks/{location-36tzexw9.js → instance-0774nbn7.js} +11 -11
- package/dist/chunks/{location-x3gqap9d.js → instance-0a1yp5ev.js} +4 -4
- package/dist/chunks/{location-0paq2nw3.js → instance-0paq2nw3.js} +1 -1
- package/dist/chunks/{location-0vbcp93d.js → instance-0vbcp93d.js} +2 -2
- package/dist/chunks/{location-0frxavx5.js → instance-16ddk4gv.js} +8 -8
- package/dist/chunks/{location-qp2k86zs.js → instance-18yn87gg.js} +23 -23
- package/dist/chunks/{location-1dazxqgg.js → instance-1dazxqgg.js} +2 -2
- package/dist/chunks/{location-1dvck2a7.js → instance-1dvck2a7.js} +2 -2
- package/dist/chunks/{location-7entjh6g.js → instance-1dxgf01t.js} +11 -11
- package/dist/chunks/{location-m67a48vq.js → instance-1gpb38yh.js} +6 -6
- package/dist/chunks/{location-etfnbv3k.js → instance-1j9gzfwy.js} +13 -13
- package/dist/chunks/{location-3s266rdz.js → instance-1pjraj1b.js} +5 -5
- package/dist/chunks/{location-56gdpj1q.js → instance-1ygqh575.js} +9 -9
- package/dist/chunks/{location-2a5m3afh.js → instance-2a5m3afh.js} +1 -1
- package/dist/chunks/{location-x2w20ksh.js → instance-2c0ehgs2.js} +11 -11
- package/dist/chunks/{location-d6kqysqe.js → instance-2wc575ce.js} +19 -19
- package/dist/chunks/{location-aanyagtj.js → instance-37gamrq4.js} +39 -39
- package/dist/chunks/{location-qf0ka5h8.js → instance-38fxctr7.js} +24 -24
- package/dist/chunks/{location-m6x09j7z.js → instance-3azqsw0c.js} +9 -9
- package/dist/chunks/{location-c7v6zzq0.js → instance-3ezd354r.js} +33 -33
- package/dist/chunks/{location-3fc6dm20.js → instance-3fc6dm20.js} +1 -1
- package/dist/chunks/{location-3hepkmqq.js → instance-3hepkmqq.js} +1 -1
- package/dist/chunks/{location-3smtnn6g.js → instance-3smtnn6g.js} +1 -1
- package/dist/chunks/{location-gzfwptkh.js → instance-3tqv7fqh.js} +17 -17
- package/dist/chunks/{location-3tvqynh2.js → instance-3tvqynh2.js} +1 -1
- package/dist/chunks/{location-fy2r8eyy.js → instance-3xt1g8y2.js} +18 -18
- package/dist/chunks/{location-3zsf4n22.js → instance-3zsf4n22.js} +1 -1
- package/dist/chunks/{location-krh5ag8n.js → instance-45nk0ha4.js} +35 -35
- package/dist/chunks/{location-hxqastbg.js → instance-4ptf5mx7.js} +5 -5
- package/dist/chunks/{location-4ts7tf6z.js → instance-4ts7tf6z.js} +2 -2
- package/dist/chunks/{location-qwjmgwmn.js → instance-4w5f3qm5.js} +8 -8
- package/dist/chunks/{location-dwq6ryhm.js → instance-4xxxtaen.js} +8 -8
- package/dist/chunks/{location-za3xpkyj.js → instance-4yxsc7yj.js} +33 -33
- package/dist/chunks/{location-swabsky0.js → instance-53cyn2nw.js} +6 -6
- package/dist/chunks/{location-54ma36ye.js → instance-54ma36ye.js} +1 -1
- package/dist/chunks/{location-s800pt51.js → instance-5bsr47cr.js} +12 -12
- package/dist/chunks/{location-kp7xp7zq.js → instance-5cwcrz90.js} +48 -48
- package/dist/chunks/{location-nzytz929.js → instance-5cyzqgw3.js} +324 -324
- package/dist/chunks/{location-xyh3p86x.js → instance-5d571gvp.js} +36 -36
- package/dist/chunks/{location-5daktx2q.js → instance-5daktx2q.js} +1 -1
- package/dist/chunks/{location-y2ve5wpy.js → instance-5gdw97cc.js} +1 -1
- package/dist/chunks/{location-zbt8hm9w.js → instance-5pbhhrfm.js} +70 -70
- package/dist/chunks/{location-5t3nmthw.js → instance-5t3nmthw.js} +2 -2
- package/dist/chunks/{location-mdcmsqgv.js → instance-5tfae1yg.js} +8 -8
- package/dist/chunks/{location-208m000x.js → instance-5tpz2m3t.js} +1 -1
- package/dist/chunks/{location-rj6r6gv2.js → instance-5z1me89k.js} +11 -11
- package/dist/chunks/{location-kt94w41r.js → instance-618cf724.js} +26 -26
- package/dist/chunks/{location-54e3h8mr.js → instance-62wbr5q6.js} +18 -18
- package/dist/chunks/{location-7rgnchn8.js → instance-659s7jsm.js} +30 -30
- package/dist/chunks/{location-669tq793.js → instance-669tq793.js} +1 -1
- package/dist/chunks/{location-q9bsambt.js → instance-6b45834a.js} +4 -4
- package/dist/chunks/{location-0r3c1bmw.js → instance-6kzp9tjq.js} +5 -5
- package/dist/chunks/{location-6xb47vfp.js → instance-6xb47vfp.js} +1 -1
- package/dist/chunks/{location-vm0nw8c4.js → instance-70mfj0at.js} +17 -17
- package/dist/chunks/{location-71az546q.js → instance-71az546q.js} +2 -2
- package/dist/chunks/{location-j028xdjb.js → instance-73tb2d7t.js} +3 -3
- package/dist/chunks/{location-jca9gg5p.js → instance-74480362.js} +47 -47
- package/dist/chunks/{location-3maez1s4.js → instance-77f241gp.js} +11 -11
- package/dist/chunks/{location-rz58q6yw.js → instance-7afj2tzz.js} +36 -36
- package/dist/chunks/{location-7bmhse3q.js → instance-7bmhse3q.js} +1 -1
- package/dist/chunks/{location-9bdbrtbd.js → instance-7cp24dsy.js} +2 -2
- package/dist/chunks/{location-eh8c2qmt.js → instance-7e8zsbmh.js} +12 -12
- package/dist/chunks/{location-8mwfgycy.js → instance-7eebn0wd.js} +16 -16
- package/dist/chunks/{location-5ps1pq9q.js → instance-7k5ts96k.js} +4 -4
- package/dist/chunks/{location-patgj9rf.js → instance-7n7ad4fb.js} +9 -9
- package/dist/chunks/{location-84txncab.js → instance-84txncab.js} +1 -1
- package/dist/chunks/{location-h4ckqw4f.js → instance-89rvcjqs.js} +8 -8
- package/dist/chunks/{location-v3tqgmst.js → instance-8cf9vbvy.js} +37 -37
- package/dist/chunks/{location-8d7r5vzw.js → instance-8d7r5vzw.js} +1 -1
- package/dist/chunks/{location-r7z4zpnk.js → instance-8mm315v9.js} +6 -6
- package/dist/chunks/{location-w69p11eg.js → instance-8mw0qbq7.js} +13 -13
- package/dist/chunks/instance-8pvncxar.js +26 -0
- package/dist/chunks/{location-9r3ewnwy.js → instance-8qjres1z.js} +15 -15
- package/dist/chunks/{location-pxgdc7gq.js → instance-8tdzbgag.js} +32 -32
- package/dist/chunks/{location-fftyvp1m.js → instance-8vq2wv0p.js} +18 -18
- package/dist/chunks/{location-9ccmvy08.js → instance-94q8jq57.js} +27 -27
- package/dist/chunks/{location-9e5bzkjp.js → instance-9e5bzkjp.js} +3 -3
- package/dist/chunks/{location-1ebfveph.js → instance-9ey27874.js} +47 -47
- package/dist/chunks/{location-mkw4htn4.js → instance-9g0axrpv.js} +17 -17
- package/dist/chunks/{location-tpw6cwsb.js → instance-9hn6k4tm.js} +8 -8
- package/dist/chunks/{location-va45sze5.js → instance-9rxrfate.js} +29 -29
- package/dist/chunks/instance-9sh4wc5j.js +18 -0
- package/dist/chunks/{location-9t7a50xb.js → instance-9t7a50xb.js} +1 -1
- package/dist/chunks/{location-054tnc23.js → instance-a7bv43ty.js} +6 -6
- package/dist/chunks/{location-9fg8585h.js → instance-a9tedrqk.js} +1 -1
- package/dist/chunks/{location-aaet6srn.js → instance-aaet6srn.js} +2 -2
- package/dist/chunks/{location-n50d1mbn.js → instance-adccft7c.js} +15 -15
- package/dist/chunks/{location-x661k3y3.js → instance-addxnjmp.js} +4 -4
- package/dist/chunks/{location-pr8n2gpy.js → instance-agcgwzsf.js} +57 -57
- package/dist/chunks/{location-28hqb7n1.js → instance-ampfe5d9.js} +16 -16
- package/dist/chunks/{location-d6v3shm0.js → instance-an78qnhf.js} +20 -20
- package/dist/chunks/{location-3kd47etn.js → instance-aqy8veg5.js} +1 -1
- package/dist/chunks/{location-1vn7zg0x.js → instance-aygcvt0z.js} +1 -1
- package/dist/chunks/{location-1p07q0wb.js → instance-b4twkq7r.js} +8 -8
- package/dist/chunks/{location-b6gygkdw.js → instance-b6gygkdw.js} +2 -2
- package/dist/chunks/{location-gxs67awe.js → instance-basert84.js} +11 -11
- package/dist/chunks/{location-qdkhcs1j.js → instance-bcvfew5g.js} +16 -16
- package/dist/chunks/{location-ejtxpja9.js → instance-beg7zznq.js} +39 -39
- package/dist/chunks/{location-pyg8na7s.js → instance-bksk4ct5.js} +15 -15
- package/dist/chunks/{location-9tkeg271.js → instance-bsnese7t.js} +41 -41
- package/dist/chunks/{location-qtt91nwf.js → instance-bsv14fp6.js} +9 -9
- package/dist/chunks/{location-889f7s8w.js → instance-c5kdppbe.js} +11 -11
- package/dist/chunks/{location-zes232r0.js → instance-cbae4d3a.js} +13 -13
- package/dist/chunks/{location-hznm6a07.js → instance-cfk2fdda.js} +13 -13
- package/dist/chunks/{location-f44pehqa.js → instance-chvk9g2e.js} +35 -35
- package/dist/chunks/{location-d0xn2485.js → instance-cmdz6egp.js} +20 -20
- package/dist/chunks/{location-v6f01h6h.js → instance-cpqvcdbp.js} +14 -14
- package/dist/chunks/{location-862a9g3e.js → instance-cvmmaz40.js} +1 -1
- package/dist/chunks/{location-3fkr87zm.js → instance-cw6y00ch.js} +26 -26
- package/dist/chunks/{location-tkq3xk61.js → instance-d16ebas1.js} +28 -28
- package/dist/chunks/{location-0dg42ne5.js → instance-d74ynpf7.js} +24 -24
- package/dist/chunks/{location-sr6vbnxh.js → instance-d8zex0s9.js} +10 -10
- package/dist/chunks/{location-753002kn.js → instance-dbvkr17y.js} +8 -8
- package/dist/chunks/{location-cwa6csj7.js → instance-djszqvmq.js} +9 -9
- package/dist/chunks/{location-1vt8akqd.js → instance-dm9d9vkf.js} +8 -8
- package/dist/chunks/{location-mb14aw74.js → instance-drnf6xwf.js} +2 -2
- package/dist/chunks/{location-18rp1xkf.js → instance-dvc89yjx.js} +8 -8
- package/dist/chunks/{location-k3snbwks.js → instance-dwtvrmck.js} +6 -6
- package/dist/chunks/{location-w8qpna6r.js → instance-dz3e03g5.js} +32 -32
- package/dist/chunks/{location-h04255kf.js → instance-e3wzt878.js} +28 -28
- package/dist/chunks/{location-rvpc5zrz.js → instance-e8zp0pe6.js} +13 -13
- package/dist/chunks/{location-edrmdtr5.js → instance-edrmdtr5.js} +1 -1
- package/dist/chunks/{location-ef5x83kb.js → instance-ef5x83kb.js} +1 -1
- package/dist/chunks/{location-12jzj71f.js → instance-egrdtcgj.js} +32 -32
- package/dist/chunks/{location-5vv7abyh.js → instance-etbraqte.js} +21 -21
- package/dist/chunks/{location-etq0c3wd.js → instance-etq0c3wd.js} +1 -1
- package/dist/chunks/{location-zegnn946.js → instance-ezdptek8.js} +41 -41
- package/dist/chunks/{location-tdqwxjwb.js → instance-ezzsyfze.js} +141 -141
- package/dist/chunks/{location-sdvk2ad6.js → instance-f0cxs0mr.js} +20 -20
- package/dist/chunks/{location-hq6260kp.js → instance-f6qx0jzz.js} +10 -10
- package/dist/chunks/{location-w84mnb9g.js → instance-f75eg83h.js} +16 -16
- package/dist/chunks/{location-d6zb4spv.js → instance-fbazj5br.js} +33 -23
- package/dist/chunks/{location-a1f7asmn.js → instance-ff1c9a4s.js} +2 -2
- package/dist/chunks/{location-gje7t6g4.js → instance-ffea5fe3.js} +2 -2
- package/dist/chunks/{location-adysfw09.js → instance-fg4zsnax.js} +22 -22
- package/dist/chunks/{location-vkb7t2qc.js → instance-fw1ge7td.js} +8 -8
- package/dist/chunks/{location-57b9ws8p.js → instance-g5w8qwbj.js} +7 -7
- package/dist/chunks/{location-w39jehkq.js → instance-g6yfr6ja.js} +5 -5
- package/dist/chunks/{location-gd4qta3r.js → instance-gd4qta3r.js} +1 -1
- package/dist/chunks/{location-znxafpy1.js → instance-gdemqjag.js} +9 -9
- package/dist/chunks/{location-9mrc6n03.js → instance-gfa7n8cp.js} +27 -27
- package/dist/chunks/{location-agf2dshv.js → instance-gm7qz8z1.js} +6 -6
- package/dist/chunks/{location-ptr9j6f1.js → instance-gyk7amj4.js} +17 -17
- package/dist/chunks/{location-g76set46.js → instance-h00b17qx.js} +11 -11
- package/dist/chunks/{location-1cfxdkjr.js → instance-h0nkrjn0.js} +24 -24
- package/dist/chunks/{location-h2b79v29.js → instance-h2b79v29.js} +2 -2
- package/dist/chunks/{location-x7fd5fgg.js → instance-h4g4ryjd.js} +28 -28
- package/dist/chunks/{location-h6vf3j39.js → instance-h6vf3j39.js} +1 -1
- package/dist/chunks/{location-dprde2v8.js → instance-hdnwcj7f.js} +40 -40
- package/dist/chunks/{location-f9fc5v37.js → instance-hmx1tyyz.js} +11 -11
- package/dist/chunks/{location-wrxqmzes.js → instance-hs44gvrh.js} +25 -25
- package/dist/chunks/{location-j56e64zr.js → instance-j56e64zr.js} +1 -1
- package/dist/chunks/{location-4hb6xf6n.js → instance-jcef9j4e.js} +80 -80
- package/dist/chunks/{location-jx0hr23r.js → instance-je2ajs8k.js} +9 -9
- package/dist/chunks/{location-w5t5kzd9.js → instance-jpszz5f5.js} +5 -5
- package/dist/chunks/{location-a36b5m4e.js → instance-jzpwfcj6.js} +13 -13
- package/dist/chunks/{location-y90f3fk4.js → instance-k2rp70c9.js} +11 -11
- package/dist/chunks/{location-rsc59hem.js → instance-kavhn0zf.js} +14 -14
- package/dist/chunks/{location-mw8x7xmb.js → instance-khef0nag.js} +27 -27
- package/dist/chunks/{location-acwa04xh.js → instance-khtgy43d.js} +24 -24
- package/dist/chunks/{location-2f6pnyrz.js → instance-ktxry8w9.js} +3 -3
- package/dist/chunks/{location-a8bn8zg0.js → instance-kvvk39gs.js} +4 -4
- package/dist/chunks/{location-m3fdjcah.js → instance-m3fdjcah.js} +1 -1
- package/dist/chunks/{location-sz5ygx6f.js → instance-m65sn8f4.js} +20 -20
- package/dist/chunks/{location-m9w0rfyh.js → instance-m9w0rfyh.js} +1 -1
- package/dist/chunks/{location-x2d9qy7d.js → instance-mf44wyvt.js} +5 -5
- package/dist/chunks/{location-my7xq1gk.js → instance-mg5yzehp.js} +15 -15
- package/dist/chunks/{location-s61s5w7f.js → instance-mj905kd3.js} +7 -7
- package/dist/chunks/{location-kyym90d5.js → instance-mvkg24rd.js} +23 -23
- package/dist/chunks/{location-t4y3srrf.js → instance-mx7vjf8m.js} +14 -14
- package/dist/chunks/{location-c2sed5cq.js → instance-my4zabxr.js} +2 -2
- package/dist/chunks/{location-7xenbtvb.js → instance-mywryf52.js} +9 -9
- package/dist/chunks/{location-gmmmxht9.js → instance-myza5cew.js} +12 -12
- package/dist/chunks/{location-hb84g3y6.js → instance-n8sna2wb.js} +9 -9
- package/dist/chunks/{location-v7dthscp.js → instance-n92e6pwe.js} +33 -33
- package/dist/chunks/{location-b69jv39p.js → instance-ncnm8wen.js} +1 -1
- package/dist/chunks/{location-rw98h6j7.js → instance-nh61a955.js} +91 -91
- package/dist/chunks/{location-4fk05cts.js → instance-nskk99ea.js} +10 -10
- package/dist/chunks/{location-cpgfv9g7.js → instance-nsr1040d.js} +22 -22
- package/dist/chunks/{location-dpkg50ah.js → instance-nxm207yx.js} +4 -4
- package/dist/chunks/{location-49a9rwdn.js → instance-p223far6.js} +16 -16
- package/dist/chunks/{location-1fq1yvq8.js → instance-p5ywpvrr.js} +40 -40
- package/dist/chunks/{location-bg5zqpce.js → instance-pbk10sw9.js} +21 -21
- package/dist/chunks/{location-mhgx8wws.js → instance-pcxghkgz.js} +4 -4
- package/dist/chunks/{location-f67x1zy2.js → instance-pd4k6fv5.js} +4 -4
- package/dist/chunks/{location-pjvnvgmy.js → instance-pjvnvgmy.js} +1 -1
- package/dist/chunks/{location-pknna89w.js → instance-pknna89w.js} +1 -1
- package/dist/chunks/{location-8tsdq50x.js → instance-pmwpe40e.js} +4 -4
- package/dist/chunks/{location-cs7mqzsj.js → instance-psgex02s.js} +10 -10
- package/dist/chunks/{location-q0xm7vwc.js → instance-q0xm7vwc.js} +2 -2
- package/dist/chunks/{location-fq21f7h4.js → instance-q1nt87r2.js} +5 -5
- package/dist/chunks/{location-e89xj288.js → instance-q4fmv0xv.js} +5 -5
- package/dist/chunks/{location-q1rbzsas.js → instance-q5hapr1k.js} +19 -19
- package/dist/chunks/{location-jaj6bpj0.js → instance-qdm075b1.js} +32 -32
- package/dist/chunks/{location-2k8khapm.js → instance-qgn6gcr1.js} +5 -5
- package/dist/chunks/{location-hgtd7sxh.js → instance-qkfezwh6.js} +8 -8
- package/dist/chunks/{location-ghe85yh1.js → instance-qnab12t2.js} +9 -9
- package/dist/chunks/{location-fps9xx4y.js → instance-qnbcpa5d.js} +3 -3
- package/dist/chunks/{location-qnc92qwc.js → instance-qnc92qwc.js} +1 -1
- package/dist/chunks/{location-qsdy395h.js → instance-qsdy395h.js} +1 -1
- package/dist/chunks/{location-xyafkbt0.js → instance-qxjc9qry.js} +3 -3
- package/dist/chunks/{location-rj343a89.js → instance-qz75azd5.js} +28 -28
- package/dist/chunks/{location-0v8cvypb.js → instance-r08zekp4.js} +10 -10
- package/dist/chunks/{location-rx8vmh8h.js → instance-r28fzdtf.js} +33 -33
- package/dist/chunks/{location-9a22g0r7.js → instance-r536yx1n.js} +28 -28
- package/dist/chunks/{location-y8h45gdm.js → instance-r7pg11ag.js} +24 -24
- package/dist/chunks/{location-jh5x1drn.js → instance-r86sdqmb.js} +16 -16
- package/dist/chunks/{location-4ndfp6x1.js → instance-rbnqf3qz.js} +11 -11
- package/dist/chunks/{location-jsy5swvm.js → instance-rbyn7cbd.js} +9 -9
- package/dist/chunks/{location-rdw6cm16.js → instance-rdw6cm16.js} +1 -1
- package/dist/chunks/{location-rknj2zf3.js → instance-regq3jrq.js} +8 -8
- package/dist/chunks/{location-yp2x3t23.js → instance-rhraev7y.js} +4 -4
- package/dist/chunks/{location-8m3heav3.js → instance-rphb51ha.js} +11 -11
- package/dist/chunks/{location-744k6ap7.js → instance-rvbs1kd1.js} +19 -19
- package/dist/chunks/{location-06x8he3q.js → instance-rwm5vee1.js} +4 -4
- package/dist/chunks/{location-gnnxh0et.js → instance-ry7nasx9.js} +24 -24
- package/dist/chunks/{location-t6f0ehky.js → instance-s1244eed.js} +16 -16
- package/dist/chunks/{location-r04gnbv5.js → instance-s4anq1bw.js} +8 -8
- package/dist/chunks/{location-z4ztj7g0.js → instance-s4jagjf8.js} +9 -9
- package/dist/chunks/{location-q35vxh5k.js → instance-s5ma4nnf.js} +13 -13
- package/dist/chunks/{location-b3f8fkhc.js → instance-scgrse2b.js} +5 -5
- package/dist/chunks/{location-r9r9k7q8.js → instance-sdbwyyr5.js} +32 -32
- package/dist/chunks/{location-wt0s9j3r.js → instance-sp51jmh1.js} +18 -18
- package/dist/chunks/{location-cs7pc868.js → instance-sphgvq2k.js} +13 -13
- package/dist/chunks/{location-8nb6jekc.js → instance-sr66y3f2.js} +7 -7
- package/dist/chunks/{location-0q4asv20.js → instance-t0jyr3nw.js} +15 -15
- package/dist/chunks/{location-tazgh4e4.js → instance-tazgh4e4.js} +1 -1
- package/dist/chunks/{location-tcezcvh9.js → instance-tcezcvh9.js} +1 -1
- package/dist/chunks/{location-tdstcens.js → instance-tdstcens.js} +1 -1
- package/dist/chunks/{location-cy72xyjc.js → instance-tmb91sb7.js} +22 -22
- package/dist/chunks/{location-xvc21b3d.js → instance-trftk86g.js} +12 -12
- package/dist/chunks/{location-38ds4vsh.js → instance-tspc6n6b.js} +16 -16
- package/dist/chunks/{location-tg7bkhef.js → instance-v0es1rhs.js} +7 -7
- package/dist/chunks/{location-0zhyzqfm.js → instance-v1y5k1zv.js} +8 -8
- package/dist/chunks/{location-sxzvkvgj.js → instance-v6gb7zv2.js} +6 -6
- package/dist/chunks/{location-5f6vg0rf.js → instance-vctq8pw4.js} +29 -29
- package/dist/chunks/{location-veqvce7d.js → instance-veqvce7d.js} +1 -1
- package/dist/chunks/{location-vn72gsba.js → instance-vn72gsba.js} +4 -4
- package/dist/chunks/{location-zvej5ecj.js → instance-vrszpps8.js} +26 -26
- package/dist/chunks/{location-vzcthcp8.js → instance-vzcthcp8.js} +1 -1
- package/dist/chunks/{location-vzs5sf6e.js → instance-vzs5sf6e.js} +1 -1
- package/dist/chunks/{location-kasw4fnh.js → instance-w2q2zhjg.js} +3 -3
- package/dist/chunks/{location-w3wsvvr9.js → instance-w3wsvvr9.js} +1 -1
- package/dist/chunks/{location-8aaqm6qj.js → instance-w3x9v1nk.js} +8 -8
- package/dist/chunks/{location-b4e1wnd3.js → instance-w4xe8me1.js} +13 -13
- package/dist/chunks/{location-tez6vn9k.js → instance-w8pktasf.js} +6 -6
- package/dist/chunks/{location-wd87259q.js → instance-wd87259q.js} +1 -1
- package/dist/chunks/{location-6tgppvyb.js → instance-wet7zydh.js} +13 -13
- package/dist/chunks/{location-cezy49kc.js → instance-wk6gcfft.js} +12 -12
- package/dist/chunks/{location-gj3rjvxa.js → instance-wqwrk1t8.js} +11 -11
- package/dist/chunks/{location-5gvcwmqt.js → instance-wz4fa6kp.js} +9 -9
- package/dist/chunks/{location-bj6es22j.js → instance-wz7bxgh4.js} +6 -6
- package/dist/chunks/{location-rnr5nq63.js → instance-x1nmkajp.js} +22 -22
- package/dist/chunks/{location-1rax0fa3.js → instance-x977f4gm.js} +27 -27
- package/dist/chunks/{location-2xxcqrcn.js → instance-xe6wnmxk.js} +13 -13
- package/dist/chunks/{location-xkntkrq7.js → instance-xkntkrq7.js} +2 -2
- package/dist/chunks/{location-j94h2k4s.js → instance-xttsyar1.js} +18 -18
- package/dist/chunks/{location-04b814vj.js → instance-xxxnye3f.js} +27 -27
- package/dist/chunks/{location-7ghtbgxd.js → instance-xzr1z753.js} +3 -3
- package/dist/chunks/{location-y1fvbwt7.js → instance-y1fvbwt7.js} +1 -1
- package/dist/chunks/{location-vazrgfpm.js → instance-y60kwh1p.js} +8 -8
- package/dist/chunks/{location-6nad0zcg.js → instance-ybwqjhfq.js} +18 -18
- package/dist/chunks/{location-mms20fb7.js → instance-yc6d2wav.js} +3 -3
- package/dist/chunks/{location-68fe01gc.js → instance-ye0sm2fz.js} +8 -8
- package/dist/chunks/{location-c909q0sd.js → instance-yq2bj2r5.js} +43 -43
- package/dist/chunks/{location-z0bkrqjs.js → instance-z0bkrqjs.js} +1 -1
- package/dist/chunks/{location-ts68ycfj.js → instance-z279fef2.js} +26 -26
- package/dist/chunks/{location-885cwhyg.js → instance-z5372w6n.js} +8 -8
- package/dist/chunks/{location-zvvxcepe.js → instance-zbt4ebk0.js} +29 -29
- package/dist/chunks/instance-zg82bed9.js +253 -0
- package/dist/chunks/{location-4aa0vhjx.js → instance-zqst06hn.js} +44 -44
- package/dist/chunks/{location-zr2ceqn5.js → instance-zr2ceqn5.js} +1 -1
- package/dist/chunks/{location-yrcj3v3g.js → instance-zsr4wwhv.js} +4 -4
- package/dist/chunks/{location-qpbcz52v.js → instance-ztm6ar58.js} +3 -3
- package/dist/chunks/{location-zxq2ej10.js → instance-zxq2ej10.js} +1 -1
- package/dist/chunks/{location-fxk0vaaw.js → instance-zxtsg6x5.js} +17 -17
- package/dist/codemode/catalog.js +1 -1
- package/dist/codemode/instructions.js +5 -5
- package/dist/codemode/tool.js +3 -3
- package/dist/codemode/web.js +1 -1
- package/dist/command.js +83 -83
- package/dist/config/discovery.js +82 -82
- package/dist/config/markdown.js +1 -1
- package/dist/config/normalize.js +99 -99
- package/dist/config/plugin/agent.js +118 -118
- package/dist/config/plugin/command.js +207 -207
- package/dist/config/plugin/compaction.js +154 -154
- package/dist/config/plugin/compatibility.js +134 -134
- package/dist/config/plugin/entry-observer.js +1 -1
- package/dist/config/plugin/formatter.js +117 -117
- package/dist/config/plugin/image.js +116 -116
- package/dist/config/plugin/instruction.js +90 -90
- package/dist/config/plugin/location-watcher.js +116 -116
- package/dist/config/plugin/mcp.js +125 -125
- package/dist/config/plugin/policy.js +117 -117
- package/dist/config/plugin/provider.js +116 -116
- package/dist/config/plugin/reference.js +118 -118
- package/dist/config/plugin/shell.js +118 -118
- package/dist/config/plugin/skill-file.js +102 -102
- package/dist/config/plugin/skill.js +135 -135
- package/dist/config/plugin/snapshot.js +116 -116
- package/dist/config/plugin/source.js +119 -119
- package/dist/config/plugin/tool-output.js +117 -117
- package/dist/config/plugin/websearch.js +117 -117
- package/dist/config/plugin/worktree.js +118 -118
- package/dist/config/variable.js +3 -3
- package/dist/config/watch.js +1 -1
- package/dist/config.js +117 -117
- package/dist/credential/sql.js +2 -2
- package/dist/credential.js +81 -81
- package/dist/database/database.js +66 -66
- package/dist/database/drizzle/effect-sqlite/driver.js +14 -14
- package/dist/database/drizzle/effect-sqlite/index.js +14 -14
- package/dist/database/drizzle/effect-sqlite/session.js +11 -11
- package/dist/database/drizzle/index.js +15 -15
- package/dist/database/drizzle/internal/drizzle-utils.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/count.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/db.js +9 -9
- package/dist/database/drizzle/sqlite-core/effect/delete.js +2 -2
- package/dist/database/drizzle/sqlite-core/effect/index.js +10 -10
- package/dist/database/drizzle/sqlite-core/effect/insert.js +2 -2
- package/dist/database/drizzle/sqlite-core/effect/query.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/raw.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/select.js +2 -2
- package/dist/database/drizzle/sqlite-core/effect/session.js +10 -10
- package/dist/database/drizzle/sqlite-core/effect/update.js +2 -2
- package/dist/database/drizzle.js +16 -16
- package/dist/database/migration/20260127222353_familiar_lady_ursula.js +1 -1
- package/dist/database/migration/20260211171708_add_project_commands.js +1 -1
- package/dist/database/migration/20260213144116_wakeful_the_professor.js +1 -1
- package/dist/database/migration/20260225215848_workspace.js +1 -1
- package/dist/database/migration/20260227213759_add_session_workspace_id.js +1 -1
- package/dist/database/migration/20260228203230_blue_harpoon.js +1 -1
- package/dist/database/migration/20260303231226_add_workspace_fields.js +1 -1
- package/dist/database/migration/20260309230000_move_org_to_state.js +1 -1
- package/dist/database/migration/20260312043431_session_message_cursor.js +1 -1
- package/dist/database/migration/20260323234822_events.js +1 -1
- package/dist/database/migration/20260410174513_workspace-name.js +1 -1
- package/dist/database/migration/20260413175956_chief_energizer.js +1 -1
- package/dist/database/migration/20260423070820_add_icon_url_override.js +1 -1
- package/dist/database/migration/20260427172553_slow_nightmare.js +1 -1
- package/dist/database/migration/20260428004200_add_session_path.js +1 -1
- package/dist/database/migration/20260501142318_next_venus.js +1 -1
- package/dist/database/migration/20260504145000_add_sync_owner.js +1 -1
- package/dist/database/migration/20260507164347_add_workspace_time.js +1 -1
- package/dist/database/migration/20260510033149_session_usage.js +1 -1
- package/dist/database/migration/20260511000411_data_migration_state.js +1 -1
- package/dist/database/migration/20260511173437_session-metadata.js +1 -1
- package/dist/database/migration/20260601010001_normalize_storage_paths.js +1 -1
- package/dist/database/migration/20260601202201_amazing_prowler.js +1 -1
- package/dist/database/migration/20260602002951_lowly_union_jack.js +1 -1
- package/dist/database/migration/20260602182828_add_project_directories.js +1 -1
- package/dist/database/migration/20260603001617_session_message_projection_indexes.js +1 -1
- package/dist/database/migration/20260603040000_session_message_projection_order.js +1 -1
- package/dist/database/migration/20260603141458_session_input_inbox.js +1 -1
- package/dist/database/migration/20260603160727_jittery_ezekiel_stane.js +1 -1
- package/dist/database/migration/20260604172448_event_sourced_session_input.js +1 -1
- package/dist/database/migration/20260605003541_add_session_context_snapshot.js +1 -1
- package/dist/database/migration/20260605042240_add_context_epoch_agent.js +1 -1
- package/dist/database/migration/20260611035744_credential.js +1 -1
- package/dist/database/migration/20260611192811_lush_chimera.js +1 -1
- package/dist/database/migration/20260612174303_project_dir_strategy.js +1 -1
- package/dist/database/migration/20260622142730_simplify_session_context_epoch.js +1 -1
- package/dist/database/migration/20260622170816_reset_v2_session_state.js +1 -1
- package/dist/database/migration/20260622202450_simplify_session_input.js +1 -1
- package/dist/database/migration/20260804233008_loose_psylocke.js +1 -1
- package/dist/database/migration/20260805200742_import_legacy_credentials.js +1 -1
- package/dist/database/migration/20260808023530_workspace_domain.js +1 -1
- package/dist/database/migration/20260811161259_execution_claim_attempts.js +1 -1
- package/dist/database/migration/20260812181746_session_inbox.js +1 -1
- package/dist/database/migration/20260812213948_worktree.js +1 -1
- package/dist/database/migration/20260819222447_session_viewed_state.js +1 -1
- package/dist/database/migration/20260823191254_nullable_workspace_binding.js +1 -1
- package/dist/database/migration/20260910120000_clear_v1_session_permission.js +1 -1
- package/dist/database/migration/20260923013825_project_time_active.js +1 -1
- package/dist/database/migration.gen.js +49 -49
- package/dist/database/migration.js +51 -51
- package/dist/database/path.js +2 -2
- package/dist/database/schema.gen.js +1 -1
- package/dist/database/schema.sql.js +1 -1
- package/dist/database/sqlite.bun.js +1 -1
- package/dist/database/sqlite.js +1 -1
- package/dist/database/sqlite.node.js +1 -1
- package/dist/database/sqlite.workerd.js +1 -1
- package/dist/database/v1-migration.bun.js +76 -76
- package/dist/database/v1-migration.js +1 -1
- package/dist/effect/app-node-builder.js +362 -362
- package/dist/effect/app-node-platform.js +2 -2
- package/dist/effect/keyed-mutex.js +3 -3
- package/dist/effect/websocket-constructor.js +1 -1
- package/dist/environment/driver.js +1 -1
- package/dist/environment/environment.js +93 -93
- package/dist/environment/exec-defaults.js +2 -2
- package/dist/environment/files.js +1 -1
- package/dist/environment/index.js +95 -95
- package/dist/environment/local.js +2 -2
- package/dist/environment/memory.js +2 -2
- package/dist/environment/unavailable.js +1 -1
- package/dist/event/sql.js +1 -1
- package/dist/event-logger.js +74 -74
- package/dist/file-access.js +104 -104
- package/dist/file-mutation.js +94 -94
- package/dist/file-retention.js +1 -1
- package/dist/filesystem/fff.bun.js +2 -2
- package/dist/filesystem/fff.js +1 -1
- package/dist/filesystem/fff.node.js +2 -2
- package/dist/filesystem/fff.workerd.js +2 -2
- package/dist/filesystem/location-watcher-policy.js +6 -6
- package/dist/filesystem/location-watcher.js +218 -218
- package/dist/filesystem/protected.js +1 -1
- package/dist/filesystem/search.js +103 -103
- package/dist/filesystem/watcher-binding.js +1 -1
- package/dist/filesystem/watcher.js +13 -13
- package/dist/filesystem.js +102 -102
- package/dist/form.js +82 -82
- package/dist/formatter/builtins.js +4 -4
- package/dist/formatter.js +85 -85
- package/dist/generate.js +101 -101
- package/dist/git.js +10 -10
- package/dist/github-copilot/chat/convert-to-openai-compatible-chat-messages.js +1 -1
- package/dist/github-copilot/chat/get-response-metadata.js +1 -1
- package/dist/github-copilot/chat/map-openai-compatible-finish-reason.js +1 -1
- package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +7 -7
- package/dist/github-copilot/chat/openai-compatible-chat-options.js +1 -1
- package/dist/github-copilot/chat/openai-compatible-prepare-tools.js +1 -1
- package/dist/github-copilot/copilot-provider.js +17 -17
- package/dist/github-copilot/models.js +99 -99
- package/dist/github-copilot/openai-compatible-error.js +1 -1
- package/dist/github-copilot/responses/convert-to-openai-responses-input.js +1 -1
- package/dist/github-copilot/responses/map-openai-responses-finish-reason.js +1 -1
- package/dist/github-copilot/responses/openai-error.js +1 -1
- package/dist/github-copilot/responses/openai-responses-language-model.js +10 -10
- package/dist/github-copilot/responses/openai-responses-prepare-tools.js +6 -6
- package/dist/github-copilot/responses/tool/code-interpreter.js +1 -1
- package/dist/github-copilot/responses/tool/file-search.js +1 -1
- package/dist/github-copilot/responses/tool/image-generation.js +1 -1
- package/dist/github-copilot/responses/tool/web-search-preview.js +1 -1
- package/dist/github-copilot/responses/tool/web-search.js +1 -1
- package/dist/image/photon.js +2 -2
- package/dist/image.js +6 -6
- package/dist/instance/service.js +5 -5
- package/dist/instance.js +354 -354
- package/dist/instruction-discovery.js +85 -85
- package/dist/instructions/builtins.js +87 -87
- package/dist/instructions/index.js +1 -1
- package/dist/integration/connection.js +3 -3
- package/dist/integration.js +85 -85
- package/dist/job.js +78 -78
- package/dist/kv/sql.js +2 -2
- package/dist/kv.js +73 -73
- package/dist/location-activity.js +134 -134
- package/dist/location-lifecycle.js +107 -107
- package/dist/location-service-map.js +86 -86
- package/dist/location-services.js +351 -351
- package/dist/location.js +87 -87
- package/dist/managed-policy.js +5 -5
- package/dist/mcp/client.js +91 -91
- package/dist/mcp/index.js +107 -107
- package/dist/mcp/instructions.js +129 -129
- package/dist/mcp/oauth.js +78 -78
- package/dist/mcp/stdio.js +90 -90
- package/dist/mime.js +1 -1
- package/dist/modal/models.js +99 -99
- package/dist/model-resolver.js +98 -98
- package/dist/model.js +98 -98
- package/dist/models-dev.js +107 -107
- package/dist/oauth/page.js +1 -1
- package/dist/permission/saved.js +78 -78
- package/dist/permission/sql.js +5 -5
- package/dist/permission.js +107 -107
- package/dist/persistent-pty/binary.bun.js +1 -1
- package/dist/persistent-pty/daemon.js +1 -1
- package/dist/persistent-pty/index.js +86 -86
- package/dist/persistent-pty/pty-binding.js +1 -1
- package/dist/persistent-pty.js +75 -75
- package/dist/plugin/agent.js +104 -104
- package/dist/plugin/command.js +102 -102
- package/dist/plugin/hooks.js +5 -5
- package/dist/plugin/host.js +211 -211
- package/dist/plugin/identity.js +3 -3
- package/dist/plugin/instance.js +5 -5
- package/dist/plugin/internal.js +326 -326
- package/dist/plugin/mcp-codemode-defaults.js +3 -3
- package/dist/plugin/models-dev.js +96 -96
- package/dist/plugin/module.js +7 -7
- package/dist/plugin/optimize.js +4 -4
- package/dist/plugin/plan.js +102 -102
- package/dist/plugin/promise.js +1 -1
- package/dist/plugin/provider/amazon-bedrock.js +90 -90
- package/dist/plugin/provider/azure.js +117 -117
- package/dist/plugin/provider/cerebras.js +1 -1
- package/dist/plugin/provider/chatgpt.js +93 -93
- package/dist/plugin/provider/cloudflare-ai-gateway.js +113 -113
- package/dist/plugin/provider/cloudflare-workers-ai.js +114 -114
- package/dist/plugin/provider/cohere.js +2 -2
- package/dist/plugin/provider/configured.js +112 -112
- package/dist/plugin/provider/digitalocean.js +93 -93
- package/dist/plugin/provider/dynamic.js +2 -2
- package/dist/plugin/provider/factory.js +1 -1
- package/dist/plugin/provider/gateway.js +2 -2
- package/dist/plugin/provider/github-copilot.js +95 -95
- package/dist/plugin/provider/gitlab.js +93 -93
- package/dist/plugin/provider/google-vertex.js +90 -90
- package/dist/plugin/provider/kilo.js +1 -1
- package/dist/plugin/provider/llmgateway.js +78 -78
- package/dist/plugin/provider/lmstudio.js +115 -115
- package/dist/plugin/provider/modal.js +92 -92
- package/dist/plugin/provider/nvidia.js +1 -1
- package/dist/plugin/provider/ollama.js +115 -115
- package/dist/plugin/provider/openai.js +95 -95
- package/dist/plugin/provider/opencode.js +96 -96
- package/dist/plugin/provider/openrouter.js +91 -91
- package/dist/plugin/provider/perplexity.js +2 -2
- package/dist/plugin/provider/poe.js +79 -79
- package/dist/plugin/provider/prompt-cache-key.js +90 -90
- package/dist/plugin/provider/sap-ai-core.js +91 -91
- package/dist/plugin/provider/sdk-factory.js +1 -1
- package/dist/plugin/provider/snowflake-cortex.js +115 -115
- package/dist/plugin/provider/vercel.js +90 -90
- package/dist/plugin/provider/vllm.js +115 -115
- package/dist/plugin/provider/xai.js +91 -91
- package/dist/plugin/provider/zenmux.js +1 -1
- package/dist/plugin/provider.js +155 -155
- package/dist/plugin/sdk.js +76 -76
- package/dist/plugin/service.js +3 -3
- package/dist/plugin/skill.js +134 -134
- package/dist/plugin/source-directory.js +1 -1
- package/dist/plugin/supervisor.js +341 -341
- package/dist/plugin/tool-input-repair.js +4 -4
- package/dist/plugin/update.js +6 -6
- package/dist/plugin/vcs/git.js +86 -86
- package/dist/plugin/vcs/hg.js +86 -86
- package/dist/plugin/verbosity.js +93 -93
- package/dist/plugin/warming.js +114 -114
- package/dist/plugin/websearch/exa.js +7 -7
- package/dist/plugin/websearch/firecrawl.js +8 -8
- package/dist/plugin/websearch/index.js +9 -9
- package/dist/plugin/websearch/mcp.js +6 -6
- package/dist/plugin/websearch/parallel.js +8 -8
- package/dist/plugin/websearch/tavily.js +6 -6
- package/dist/plugin/websearch/tinyfish.js +6 -6
- package/dist/plugin.js +222 -222
- package/dist/project/schema.js +6 -6
- package/dist/project/sql.js +4 -4
- package/dist/project.js +88 -88
- package/dist/provider.js +97 -97
- package/dist/pty/protocol.js +1 -1
- package/dist/pty/ticket.js +1 -1
- package/dist/pty.js +99 -99
- package/dist/reference/instructions.js +85 -85
- package/dist/reference.js +91 -91
- package/dist/repository-cache.js +81 -81
- package/dist/repository.js +1 -1
- package/dist/ripgrep/binary.js +2 -2
- package/dist/ripgrep.js +95 -95
- package/dist/rpc.js +86 -86
- package/dist/schema.js +1 -1
- package/dist/session/affinity.js +1 -1
- package/dist/session/command.js +74 -74
- package/dist/session/compaction.js +133 -133
- package/dist/session/context.js +153 -153
- package/dist/session/diff.js +88 -88
- package/dist/session/environment.js +5 -5
- package/dist/session/error.js +5 -5
- package/dist/session/event.js +1 -1
- package/dist/session/execution/restart.js +217 -217
- package/dist/session/execution.js +127 -127
- package/dist/session/generate.js +152 -152
- package/dist/session/history.js +13 -13
- package/dist/session/inbox.js +90 -90
- package/dist/session/info.js +3 -3
- package/dist/session/instruction-entry.js +79 -79
- package/dist/session/instruction-state.js +8 -8
- package/dist/session/instructions.js +97 -97
- package/dist/session/message-updater.js +2 -2
- package/dist/session/message.js +1 -1
- package/dist/session/model-request.js +120 -120
- package/dist/session/model-transport.js +9 -9
- package/dist/session/move.js +129 -129
- package/dist/session/projector.js +86 -86
- package/dist/session/prompt.js +105 -105
- package/dist/session/provider-context.js +3 -3
- package/dist/session/revert.js +90 -90
- package/dist/session/run-coordinator.js +3 -3
- package/dist/session/runner/index.js +3 -3
- package/dist/session/runner/llm.js +222 -222
- package/dist/session/runner/max-steps.js +1 -1
- package/dist/session/runner/model.js +98 -98
- package/dist/session/runner/publish-llm-event.js +113 -113
- package/dist/session/runner/retry.js +4 -4
- package/dist/session/runner/step.js +125 -125
- package/dist/session/runner/to-llm-message.js +2 -2
- package/dist/session/schema.js +3 -3
- package/dist/session/session.js +164 -164
- package/dist/session/shell.js +130 -130
- package/dist/session/skill.js +103 -103
- package/dist/session/sql.js +5 -5
- package/dist/session/stats.js +73 -73
- package/dist/session/store.js +87 -87
- package/dist/session/subagent-completion.js +1 -1
- package/dist/session/subagent-job.js +201 -201
- package/dist/session/system-prompt.js +5 -5
- package/dist/session/title.js +155 -155
- package/dist/session/to-session-error.js +111 -111
- package/dist/session/transfer.js +211 -211
- package/dist/session/usage.js +1 -1
- package/dist/session.js +209 -209
- package/dist/shell/parse.js +6 -6
- package/dist/shell/result.js +1 -1
- package/dist/shell/scan.js +321 -346
- package/dist/shell/select.js +15 -15
- package/dist/shell.js +130 -130
- package/dist/skill/discovery.js +6 -6
- package/dist/skill/instructions.js +107 -107
- package/dist/skill.js +112 -112
- package/dist/snapshot.js +93 -93
- package/dist/state.js +1 -1
- package/dist/tool/html-markdown.js +1 -1
- package/dist/tool/http-body.js +1 -1
- package/dist/tool/mcp.js +126 -126
- package/dist/tool/plugin/edit.js +120 -120
- package/dist/tool/plugin/file-diff.js +1 -1
- package/dist/tool/plugin/glob.js +124 -124
- package/dist/tool/plugin/grep.js +122 -122
- package/dist/tool/plugin/mcp-resource.js +117 -117
- package/dist/tool/plugin/opencode.js +3 -3
- package/dist/tool/plugin/patch.js +122 -122
- package/dist/tool/plugin/question.js +103 -103
- package/dist/tool/plugin/read.js +123 -123
- package/dist/tool/plugin/shell.js +210 -210
- package/dist/tool/plugin/skill.js +113 -113
- package/dist/tool/plugin/subagent.js +212 -212
- package/dist/tool/plugin/webfetch.js +108 -108
- package/dist/tool/plugin/websearch.js +114 -114
- package/dist/tool/plugin/write.js +122 -122
- package/dist/tool/read-filesystem.js +100 -100
- package/dist/tool/runtime.js +1 -1
- package/dist/tool-output.js +7 -7
- package/dist/tool.js +14 -14
- package/dist/util/error-summary.js +1 -1
- package/dist/util/error.js +1 -1
- package/dist/util/git-executable.js +2 -2
- package/dist/util/iife.js +1 -1
- package/dist/util/lazy.js +1 -1
- package/dist/util/slug.js +1 -1
- package/dist/util/token.js +1 -1
- package/dist/util/which.js +1 -1
- package/dist/util/wildcard.js +1 -1
- package/dist/v1/config/agent.js +5 -5
- package/dist/v1/config/command.js +1 -1
- package/dist/v1/config/error.js +2 -2
- package/dist/v1/config/mcp.js +4 -4
- package/dist/v1/config/migrate.js +92 -92
- package/dist/v1/config/permission.js +3 -3
- package/dist/v1/config/plugin.js +3 -3
- package/dist/v1/config/provider-options.js +1 -1
- package/dist/v1/config/provider.js +4 -4
- package/dist/variant.js +93 -93
- package/dist/vcs/patch.js +1 -1
- package/dist/vcs.js +89 -89
- package/dist/websearch.js +84 -84
- package/dist/wellknown/plugin.js +76 -76
- package/dist/wellknown.js +79 -79
- package/dist/workspace/driver.js +7 -7
- package/dist/workspace/sql.js +1 -1
- package/dist/workspace.js +78 -78
- package/dist/worktree/directory.js +2 -2
- package/dist/worktree/git.js +10 -10
- package/dist/worktree/sql.js +5 -5
- package/dist/worktree/strategies.js +89 -89
- package/dist/worktree.js +98 -98
- package/package.json +8 -8
- package/dist/chunks/location-mtpf0eaq.js +0 -26
- package/dist/chunks/location-v1faaxn9.js +0 -18
- package/dist/chunks/location-wn9z1chv.js +0 -253
- /package/dist/chunks/{location-0qkdqm5v.js → instance-0qkdqm5v.js} +0 -0
- /package/dist/chunks/{location-0zkw76rk.js → instance-0zkw76rk.js} +0 -0
- /package/dist/chunks/{location-17cy0kzp.js → instance-17cy0kzp.js} +0 -0
- /package/dist/chunks/{location-1cnp2v09.js → instance-1cnp2v09.js} +0 -0
- /package/dist/chunks/{location-1kg9ymc8.js → instance-1kg9ymc8.js} +0 -0
- /package/dist/chunks/{location-24dcb14g.js → instance-24dcb14g.js} +0 -0
- /package/dist/chunks/{location-2710q6r3.js → instance-2710q6r3.js} +0 -0
- /package/dist/chunks/{location-2axfhc9x.js → instance-2axfhc9x.js} +0 -0
- /package/dist/chunks/{location-2c3vjs8z.js → instance-2c3vjs8z.js} +0 -0
- /package/dist/chunks/{location-34c7v6d4.js → instance-34c7v6d4.js} +0 -0
- /package/dist/chunks/{location-359p4xyc.js → instance-359p4xyc.js} +0 -0
- /package/dist/chunks/{location-3asan66x.js → instance-3asan66x.js} +0 -0
- /package/dist/chunks/{location-3t0ybcrp.js → instance-3t0ybcrp.js} +0 -0
- /package/dist/chunks/{location-3v8g72cx.js → instance-3v8g72cx.js} +0 -0
- /package/dist/chunks/{location-3w5fmr99.js → instance-3w5fmr99.js} +0 -0
- /package/dist/chunks/{location-3wcehsnq.js → instance-3wcehsnq.js} +0 -0
- /package/dist/chunks/{location-43n2bw4t.js → instance-43n2bw4t.js} +0 -0
- /package/dist/chunks/{location-4knz6hnm.js → instance-4knz6hnm.js} +0 -0
- /package/dist/chunks/{location-4vcrnpx2.js → instance-4vcrnpx2.js} +0 -0
- /package/dist/chunks/{location-4y7fprxs.js → instance-4y7fprxs.js} +0 -0
- /package/dist/chunks/{location-53557ph1.js → instance-53557ph1.js} +0 -0
- /package/dist/chunks/{location-550bvhaj.js → instance-550bvhaj.js} +0 -0
- /package/dist/chunks/{location-5qd3pb7m.js → instance-5qd3pb7m.js} +0 -0
- /package/dist/chunks/{location-6prwharc.js → instance-6prwharc.js} +0 -0
- /package/dist/chunks/{location-7akdwqpd.js → instance-7akdwqpd.js} +0 -0
- /package/dist/chunks/{location-7m9af43g.js → instance-7m9af43g.js} +0 -0
- /package/dist/chunks/{location-822emrt2.js → instance-822emrt2.js} +0 -0
- /package/dist/chunks/{location-88xbtdfr.js → instance-88xbtdfr.js} +0 -0
- /package/dist/chunks/{location-8n3pysct.js → instance-8n3pysct.js} +0 -0
- /package/dist/chunks/{location-8wj87zfr.js → instance-8wj87zfr.js} +0 -0
- /package/dist/chunks/{location-9a4afbnw.js → instance-9a4afbnw.js} +0 -0
- /package/dist/chunks/{location-9rqn6x4v.js → instance-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{location-a6k6eb26.js → instance-a6k6eb26.js} +0 -0
- /package/dist/chunks/{location-af5trqkr.js → instance-af5trqkr.js} +0 -0
- /package/dist/chunks/{location-afrmfg78.js → instance-afrmfg78.js} +0 -0
- /package/dist/chunks/{location-aqzs7mqg.js → instance-aqzs7mqg.js} +0 -0
- /package/dist/chunks/{location-atq7p7m5.js → instance-atq7p7m5.js} +0 -0
- /package/dist/chunks/{location-bkyjaxrp.js → instance-bkyjaxrp.js} +0 -0
- /package/dist/chunks/{location-bmr6ed5q.js → instance-bmr6ed5q.js} +0 -0
- /package/dist/chunks/{location-cf4snx6d.js → instance-cf4snx6d.js} +0 -0
- /package/dist/chunks/{location-cvy3z8tj.js → instance-cvy3z8tj.js} +0 -0
- /package/dist/chunks/{location-d9fn303g.js → instance-d9fn303g.js} +0 -0
- /package/dist/chunks/{location-d9jj8t3e.js → instance-d9jj8t3e.js} +0 -0
- /package/dist/chunks/{location-dajrwvna.js → instance-dajrwvna.js} +0 -0
- /package/dist/chunks/{location-dap0rakb.js → instance-dap0rakb.js} +0 -0
- /package/dist/chunks/{location-df08tz66.js → instance-df08tz66.js} +0 -0
- /package/dist/chunks/{location-dy18nga0.js → instance-dy18nga0.js} +0 -0
- /package/dist/chunks/{location-e5kj55wp.js → instance-e5kj55wp.js} +0 -0
- /package/dist/chunks/{location-e73j6tqm.js → instance-e73j6tqm.js} +0 -0
- /package/dist/chunks/{location-ec1grn59.js → instance-ec1grn59.js} +0 -0
- /package/dist/chunks/{location-eh3zwz77.js → instance-eh3zwz77.js} +0 -0
- /package/dist/chunks/{location-emrn6kk6.js → instance-emrn6kk6.js} +0 -0
- /package/dist/chunks/{location-f0mxakyp.js → instance-f0mxakyp.js} +0 -0
- /package/dist/chunks/{location-f6n9ztr4.js → instance-f6n9ztr4.js} +0 -0
- /package/dist/chunks/{location-faypxj3z.js → instance-faypxj3z.js} +0 -0
- /package/dist/chunks/{location-fd410y7t.js → instance-fd410y7t.js} +0 -0
- /package/dist/chunks/{location-fxgpk5d8.js → instance-fxgpk5d8.js} +0 -0
- /package/dist/chunks/{location-g4wezp1m.js → instance-g4wezp1m.js} +0 -0
- /package/dist/chunks/{location-g86h250q.js → instance-g86h250q.js} +0 -0
- /package/dist/chunks/{location-gebd4c9n.js → instance-gebd4c9n.js} +0 -0
- /package/dist/chunks/{location-gftt206x.js → instance-gftt206x.js} +0 -0
- /package/dist/chunks/{location-hjbc5kem.js → instance-hjbc5kem.js} +0 -0
- /package/dist/chunks/{location-hk9envan.js → instance-hk9envan.js} +0 -0
- /package/dist/chunks/{location-j2ntwpah.js → instance-j2ntwpah.js} +0 -0
- /package/dist/chunks/{location-j5zkgpj8.js → instance-j5zkgpj8.js} +0 -0
- /package/dist/chunks/{location-jjkms2e6.js → instance-jjkms2e6.js} +0 -0
- /package/dist/chunks/{location-jr7sbwjy.js → instance-jr7sbwjy.js} +0 -0
- /package/dist/chunks/{location-jwfs4k6c.js → instance-jwfs4k6c.js} +0 -0
- /package/dist/chunks/{location-jzg6c2d5.js → instance-jzg6c2d5.js} +0 -0
- /package/dist/chunks/{location-mp448xyj.js → instance-mp448xyj.js} +0 -0
- /package/dist/chunks/{location-msx8hqn2.js → instance-msx8hqn2.js} +0 -0
- /package/dist/chunks/{location-n05xt0ee.js → instance-n05xt0ee.js} +0 -0
- /package/dist/chunks/{location-n3j8tn72.js → instance-n3j8tn72.js} +0 -0
- /package/dist/chunks/{location-njntx4h6.js → instance-njntx4h6.js} +0 -0
- /package/dist/chunks/{location-q3sfg36h.js → instance-q3sfg36h.js} +0 -0
- /package/dist/chunks/{location-q74kybfr.js → instance-q74kybfr.js} +0 -0
- /package/dist/chunks/{location-qaymkmh1.js → instance-qaymkmh1.js} +0 -0
- /package/dist/chunks/{location-qb87gjwd.js → instance-qb87gjwd.js} +0 -0
- /package/dist/chunks/{location-qfa1cgps.js → instance-qfa1cgps.js} +0 -0
- /package/dist/chunks/{location-qg3g05ea.js → instance-qg3g05ea.js} +0 -0
- /package/dist/chunks/{location-qrg20bc0.js → instance-qrg20bc0.js} +0 -0
- /package/dist/chunks/{location-rcb2kzg1.js → instance-rcb2kzg1.js} +0 -0
- /package/dist/chunks/{location-sdp7kfr6.js → instance-sdp7kfr6.js} +0 -0
- /package/dist/chunks/{location-ssg3fenm.js → instance-ssg3fenm.js} +0 -0
- /package/dist/chunks/{location-w803qqfp.js → instance-w803qqfp.js} +0 -0
- /package/dist/chunks/{location-wc3fc9cn.js → instance-wc3fc9cn.js} +0 -0
- /package/dist/chunks/{location-wer8tq1h.js → instance-wer8tq1h.js} +0 -0
- /package/dist/chunks/{location-wtztk69x.js → instance-wtztk69x.js} +0 -0
- /package/dist/chunks/{location-x0ckcb58.js → instance-x0ckcb58.js} +0 -0
- /package/dist/chunks/{location-x61499pn.js → instance-x61499pn.js} +0 -0
- /package/dist/chunks/{location-y44na4kk.js → instance-y44na4kk.js} +0 -0
- /package/dist/chunks/{location-y8cydn3q.js → instance-y8cydn3q.js} +0 -0
- /package/dist/chunks/{location-y8f7s663.js → instance-y8f7s663.js} +0 -0
- /package/dist/chunks/{location-ygaqb7jw.js → instance-ygaqb7jw.js} +0 -0
- /package/dist/chunks/{location-ym463w8f.js → instance-ym463w8f.js} +0 -0
- /package/dist/chunks/{location-z5v4ffb3.js → instance-z5v4ffb3.js} +0 -0
- /package/dist/chunks/{location-z9919s4g.js → instance-z9919s4g.js} +0 -0
package/dist/shell/scan.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "../chunks/
|
|
3
|
+
} from "../chunks/instance-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/shell/scan.ts
|
|
6
6
|
var exports_scan = {};
|
|
@@ -357,7 +357,7 @@ function scanBash(input, start, depth, context, close, heredocs, outer) {
|
|
|
357
357
|
if (!state.assignmentWord && (`'"\\`.includes(char) || char === "$" && (input[index + 1] === "'" || input[index + 1] === '"')))
|
|
358
358
|
state.assignmentHeadUnsafe = true;
|
|
359
359
|
const inCasePattern = state.structures.at(-1)?.phase === "pattern";
|
|
360
|
-
const array = state.assignmentWord &&
|
|
360
|
+
const array = (char === "=" || char === "(") && state.assignmentWord && state.word.length > 1 && state.word.endsWith("=") && !state.word.endsWith("==") && (state.commandWordIndex < 0 || BASH_ASSIGNMENT_DECLARATIONS.has(state.rawWords[state.commandWordIndex]));
|
|
361
361
|
if (char === "=" && (!state.wordStarted || array) && input[index + 1] === "(") {
|
|
362
362
|
const end = scanBashNested(input, index + 2, depth, context, state.nestedCommands, ")");
|
|
363
363
|
if (typeof end === "object")
|
|
@@ -1412,39 +1412,46 @@ function bashHeredoc(input, start, delimiter) {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
1414
|
function scanPowerShell(input) {
|
|
1415
|
-
|
|
1416
|
-
}
|
|
1417
|
-
function scanPowerShellNested(input, depth, budget, hash = false) {
|
|
1418
|
-
budget.remaining -= input.length;
|
|
1419
|
-
if (input.length > MAX_INPUT_LENGTH || depth >= MAX_SUBSTITUTION_DEPTH || budget.remaining < 0)
|
|
1415
|
+
if (input.length > MAX_INPUT_LENGTH)
|
|
1420
1416
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1421
1417
|
if (/[\0\u0085\u2013-\u2015\u2018-\u201e\ufeff]/.test(input))
|
|
1422
1418
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1419
|
+
const result = scanPowerShellList(input, 0, 0, { remaining: MAX_INPUT_LENGTH * MAX_SUBSTITUTION_DEPTH });
|
|
1420
|
+
if (result.kind === "opaque")
|
|
1421
|
+
return result;
|
|
1422
|
+
return { kind: "scanned", commands: result.commands };
|
|
1423
|
+
}
|
|
1424
|
+
function scanPowerShellList(input, start, depth, budget, close, hash = false, skipped) {
|
|
1425
|
+
if (depth >= MAX_SUBSTITUTION_DEPTH || budget.remaining < 0)
|
|
1426
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1423
1427
|
const commands = [];
|
|
1424
1428
|
const nestedCommands = [];
|
|
1425
1429
|
const words = [];
|
|
1426
1430
|
const rawWords = [];
|
|
1427
1431
|
const wordEnds = [];
|
|
1428
|
-
|
|
1432
|
+
const initialExpression = hash === true || hash === "clause";
|
|
1433
|
+
const initialClause = hash === "clause" || hash === "switch" ? "member" : undefined;
|
|
1434
|
+
let segment = start;
|
|
1429
1435
|
let word = "";
|
|
1430
1436
|
let started = false;
|
|
1431
|
-
let wordStart =
|
|
1437
|
+
let wordStart = start;
|
|
1432
1438
|
let quote;
|
|
1433
1439
|
let standalone = false;
|
|
1434
|
-
let expression =
|
|
1435
|
-
let
|
|
1440
|
+
let expression = initialExpression;
|
|
1441
|
+
let clause = initialClause;
|
|
1442
|
+
let after;
|
|
1443
|
+
let indexable = false;
|
|
1436
1444
|
let stopParsing = false;
|
|
1437
|
-
let commandEnd =
|
|
1445
|
+
let commandEnd = start;
|
|
1438
1446
|
let statementHead = true;
|
|
1439
1447
|
let invalid = false;
|
|
1440
1448
|
let redirectTarget = false;
|
|
1441
|
-
let comment = false;
|
|
1442
1449
|
let dangling = false;
|
|
1443
1450
|
let invocation = false;
|
|
1444
1451
|
const finishWord = (end) => {
|
|
1445
1452
|
if (!started)
|
|
1446
1453
|
return;
|
|
1447
|
-
if (word === "--%" && words.length > 0 && !expression && !/['"]/.test(input[wordStart]))
|
|
1454
|
+
if (word === "--%" && words.length > 0 && !expression && !clause && !redirectTarget && !/['"]/.test(input[wordStart]) && !rawWords.at(-1)?.endsWith(",") && !POWERSHELL_PARAMETER_COLON_RE.test(rawWords.at(-1) ?? ""))
|
|
1448
1455
|
stopParsing = true;
|
|
1449
1456
|
if (!redirectTarget) {
|
|
1450
1457
|
if (!words.length && !invocation && !expression)
|
|
@@ -1461,17 +1468,15 @@ function scanPowerShellNested(input, depth, budget, hash = false) {
|
|
|
1461
1468
|
};
|
|
1462
1469
|
const finishCommand = (end, required = false) => {
|
|
1463
1470
|
finishWord(end);
|
|
1464
|
-
|
|
1465
|
-
const resource = input.slice(start, commandEnd).trimEnd();
|
|
1466
|
-
if (words.length && !expression)
|
|
1471
|
+
if (words.length && !expression && !clause)
|
|
1467
1472
|
commands.push({
|
|
1468
|
-
resource,
|
|
1473
|
+
resource: input.slice(segment, commandEnd).trimEnd(),
|
|
1469
1474
|
words: [...words],
|
|
1470
1475
|
rawWords: [...rawWords],
|
|
1471
|
-
wordEnds: wordEnds.map((
|
|
1476
|
+
wordEnds: wordEnds.map((value) => value - segment),
|
|
1472
1477
|
...statementHead && !invocation ? { statementHead: true } : {}
|
|
1473
1478
|
});
|
|
1474
|
-
else if (!expression && invocation || required && !words.length && !nestedCommands.length)
|
|
1479
|
+
else if (!expression && !clause && invocation || required && !words.length && !nestedCommands.length || clause !== undefined && clause !== "member")
|
|
1475
1480
|
invalid = true;
|
|
1476
1481
|
if (redirectTarget)
|
|
1477
1482
|
invalid = true;
|
|
@@ -1481,16 +1486,25 @@ function scanPowerShellNested(input, depth, budget, hash = false) {
|
|
|
1481
1486
|
wordEnds.length = 0;
|
|
1482
1487
|
redirectTarget = false;
|
|
1483
1488
|
invocation = false;
|
|
1484
|
-
expression =
|
|
1485
|
-
|
|
1489
|
+
expression = initialExpression;
|
|
1490
|
+
clause = initialClause;
|
|
1491
|
+
after = undefined;
|
|
1492
|
+
indexable = false;
|
|
1486
1493
|
stopParsing = false;
|
|
1487
1494
|
};
|
|
1488
|
-
|
|
1495
|
+
let index = start;
|
|
1496
|
+
for (;index < input.length; index++) {
|
|
1497
|
+
if (--budget.remaining < 0)
|
|
1498
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1499
|
+
if (skipped?.has(index))
|
|
1500
|
+
continue;
|
|
1489
1501
|
const char = input[index];
|
|
1502
|
+
const inExpression = expression && !redirectTarget;
|
|
1503
|
+
const atBoundary = !started || !inExpression && word.endsWith(",");
|
|
1490
1504
|
if (!started)
|
|
1491
1505
|
wordStart = index;
|
|
1492
1506
|
if (stopParsing) {
|
|
1493
|
-
const stop = powerShellStopParsing(input, index);
|
|
1507
|
+
const stop = powerShellStopParsing(input, index, skipped);
|
|
1494
1508
|
const text = input.slice(index, stop).trim();
|
|
1495
1509
|
if (text) {
|
|
1496
1510
|
wordStart = index + input.slice(index, stop).search(/\S/);
|
|
@@ -1502,43 +1516,42 @@ function scanPowerShellNested(input, depth, budget, hash = false) {
|
|
|
1502
1516
|
index = stop - 1;
|
|
1503
1517
|
continue;
|
|
1504
1518
|
}
|
|
1505
|
-
if (quote
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
finishWord(index + 1);
|
|
1514
|
-
} else
|
|
1515
|
-
word += char;
|
|
1516
|
-
continue;
|
|
1517
|
-
}
|
|
1518
|
-
if (quote === "double") {
|
|
1519
|
-
if (char === '"' && input[index + 1] === '"') {
|
|
1520
|
-
word += '"';
|
|
1521
|
-
index++;
|
|
1522
|
-
} else if (char === '"') {
|
|
1519
|
+
if (quote) {
|
|
1520
|
+
let nextQuote = index + 1;
|
|
1521
|
+
while (skipped?.has(nextQuote))
|
|
1522
|
+
nextQuote++;
|
|
1523
|
+
if (char === quote && input[nextQuote] === quote) {
|
|
1524
|
+
word += quote;
|
|
1525
|
+
index = nextQuote;
|
|
1526
|
+
} else if (char === quote) {
|
|
1523
1527
|
quote = undefined;
|
|
1524
|
-
if (standalone)
|
|
1528
|
+
if (standalone) {
|
|
1525
1529
|
finishWord(index + 1);
|
|
1526
|
-
|
|
1527
|
-
|
|
1530
|
+
indexable = "closed";
|
|
1531
|
+
}
|
|
1532
|
+
} else if (quote === '"' && char === "`") {
|
|
1533
|
+
const escape = powerShellEscape(input, index, false, skipped);
|
|
1528
1534
|
if (!escape)
|
|
1529
1535
|
return { kind: "opaque", reason: "unterminated-escape" };
|
|
1530
1536
|
word += escape.value;
|
|
1531
1537
|
index = escape.end;
|
|
1532
|
-
} else if (char === "$" && input[index + 1] === "
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1538
|
+
} else if (quote === '"' && char === "$" && input[index + 1] === "{") {
|
|
1539
|
+
const end = powerShellBracedVariable(input, index, skipped);
|
|
1540
|
+
if (end === undefined)
|
|
1541
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1542
|
+
word += input.slice(index, end + 1);
|
|
1543
|
+
index = end;
|
|
1544
|
+
} else if (quote === '"' && char === "$" && input[index + 1] === "(") {
|
|
1545
|
+
const sub = powerShellSubExpression(input, index + 2, false, budget, skipped);
|
|
1546
|
+
if (!sub)
|
|
1535
1547
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1536
|
-
const result =
|
|
1548
|
+
const result = scanPowerShellList(input, index + 2, depth + 1, budget, ")", false, sub.skipped);
|
|
1537
1549
|
if (result.kind === "opaque")
|
|
1538
1550
|
return result;
|
|
1539
1551
|
nestedCommands.push(...result.commands);
|
|
1540
|
-
|
|
1541
|
-
|
|
1552
|
+
const end = sub.rawEnd !== undefined && sub.rawEnd > result.end ? sub.rawEnd : result.end;
|
|
1553
|
+
word += input.slice(index, end + 1);
|
|
1554
|
+
index = end;
|
|
1542
1555
|
} else
|
|
1543
1556
|
word += char;
|
|
1544
1557
|
continue;
|
|
@@ -1546,176 +1559,203 @@ function scanPowerShellNested(input, depth, budget, hash = false) {
|
|
|
1546
1559
|
if (char === "'" || char === '"') {
|
|
1547
1560
|
if (!started && words.length === 0 && !invocation)
|
|
1548
1561
|
expression = true;
|
|
1549
|
-
quote = char
|
|
1550
|
-
standalone = !
|
|
1562
|
+
quote = char;
|
|
1563
|
+
standalone = atBoundary || expression && !redirectTarget || indexable === "member" && /[.:]$/.test(word);
|
|
1564
|
+
if (!standalone)
|
|
1565
|
+
indexable = false;
|
|
1551
1566
|
started = true;
|
|
1552
1567
|
continue;
|
|
1553
1568
|
}
|
|
1554
1569
|
if (char === "`") {
|
|
1555
|
-
const escape = powerShellEscape(input, index);
|
|
1570
|
+
const escape = powerShellEscape(input, index, atBoundary || inExpression, skipped);
|
|
1556
1571
|
if (!escape)
|
|
1557
1572
|
return { kind: "opaque", reason: "unterminated-escape" };
|
|
1558
|
-
|
|
1573
|
+
const rawSpace = /\s/.test(input[index + 1] ?? "");
|
|
1574
|
+
if ((inExpression || atBoundary) && started && rawSpace)
|
|
1575
|
+
finishWord(index);
|
|
1576
|
+
else if (!atBoundary || !rawSpace) {
|
|
1559
1577
|
started = true;
|
|
1578
|
+
indexable = false;
|
|
1560
1579
|
word += escape.value;
|
|
1561
1580
|
}
|
|
1562
1581
|
index = escape.end;
|
|
1563
1582
|
continue;
|
|
1564
1583
|
}
|
|
1565
|
-
if (!started && words.length > 0 && !expression &&
|
|
1584
|
+
if (!started && words.length > 0 && !expression && !clause && !redirectTarget && testAt(POWERSHELL_STOP_PARSING_RE, input, index)) {
|
|
1566
1585
|
word = "--%";
|
|
1567
1586
|
started = true;
|
|
1568
1587
|
finishWord(index + 3);
|
|
1569
|
-
stopParsing = true;
|
|
1570
1588
|
index += 2;
|
|
1571
1589
|
continue;
|
|
1572
1590
|
}
|
|
1573
|
-
if (char === "<" && input[index + 1] === "#" &&
|
|
1574
|
-
const
|
|
1575
|
-
if (
|
|
1591
|
+
if (char === "<" && input[index + 1] === "#" && (atBoundary || inExpression || indexable === "member")) {
|
|
1592
|
+
const memberOperator = indexable === "member" && /[.:]$/.test(started ? word : words.at(-1) ?? "");
|
|
1593
|
+
if (started)
|
|
1594
|
+
finishWord(index);
|
|
1595
|
+
const end = input.indexOf("#>", index + 2);
|
|
1596
|
+
if (end < 0)
|
|
1576
1597
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1577
|
-
if (!
|
|
1578
|
-
|
|
1579
|
-
index = end;
|
|
1598
|
+
if (!memberOperator)
|
|
1599
|
+
indexable = false;
|
|
1600
|
+
index = end + 1;
|
|
1580
1601
|
continue;
|
|
1581
1602
|
}
|
|
1582
|
-
if (char === "#" && (
|
|
1583
|
-
|
|
1603
|
+
if (char === "#" && (atBoundary || indexable === "member" || inExpression && !(close === "]" && /^[\p{L}\p{Nl}_][\p{L}\p{Nl}\d_.#+`\\]*$/u.test(word)))) {
|
|
1604
|
+
const prev = started ? word : words.at(-1) ?? "";
|
|
1605
|
+
const memberOperator = indexable === "member" && /[.:]$/.test(prev);
|
|
1606
|
+
if (clause && clause !== "member" || prev.endsWith(",") || memberOperator)
|
|
1607
|
+
finishWord(index);
|
|
1608
|
+
else if (words.length || started || invocation)
|
|
1584
1609
|
finishCommand(index);
|
|
1585
1610
|
statementHead = !dangling;
|
|
1586
|
-
comment = true;
|
|
1587
1611
|
const endings = [input.indexOf(`
|
|
1588
1612
|
`, index), input.indexOf("\r", index)].filter((ending) => ending >= 0);
|
|
1589
1613
|
const newline = endings.length > 0 ? Math.min(...endings) : -1;
|
|
1590
|
-
if (newline === -1)
|
|
1614
|
+
if (newline === -1) {
|
|
1615
|
+
index = input.length;
|
|
1591
1616
|
break;
|
|
1592
|
-
|
|
1617
|
+
}
|
|
1593
1618
|
index = input[newline] === "\r" && input[newline + 1] === `
|
|
1594
1619
|
` ? newline + 1 : newline;
|
|
1595
|
-
segment = index + 1;
|
|
1596
1620
|
continue;
|
|
1597
1621
|
}
|
|
1598
|
-
|
|
1622
|
+
if (inExpression && started && (char === ">" || char === "*" && input[index + 1] === ">"))
|
|
1623
|
+
finishWord(index);
|
|
1624
|
+
const redirect = !started && (char === ">" || char === "*" || /\d/.test(char) && (words.length > 0 || testAt(POWERSHELL_MERGE_REDIRECT_RE, input, index))) ? powerShellRedirect(input, index) : undefined;
|
|
1599
1625
|
if (redirect === false)
|
|
1600
1626
|
return { kind: "opaque", reason: "invalid-redirect" };
|
|
1601
1627
|
if (redirect) {
|
|
1602
|
-
if (redirectTarget)
|
|
1603
|
-
return { kind: "opaque", reason: "invalid-redirect" };
|
|
1604
|
-
if (words.length === 0)
|
|
1628
|
+
if (redirectTarget || words.length === 0 || clause && clause !== "member")
|
|
1605
1629
|
return { kind: "opaque", reason: "invalid-redirect" };
|
|
1606
1630
|
redirectTarget = !redirect.includes("&");
|
|
1631
|
+
indexable = false;
|
|
1607
1632
|
index += redirect.length - 1;
|
|
1608
1633
|
commandEnd = index + 1;
|
|
1609
1634
|
continue;
|
|
1610
1635
|
}
|
|
1611
|
-
if (!started && !words.length && !invocation && !expression &&
|
|
1612
|
-
const
|
|
1613
|
-
if (
|
|
1614
|
-
|
|
1615
|
-
compound = true;
|
|
1616
|
-
index += keyword.length - 1;
|
|
1636
|
+
if (!started && !words.length && !invocation && !expression && !clause && char === ":") {
|
|
1637
|
+
const label = matchAt(POWERSHELL_LABEL_RE, input, index);
|
|
1638
|
+
if (label) {
|
|
1639
|
+
index += label[0].length - 1;
|
|
1617
1640
|
continue;
|
|
1618
1641
|
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1642
|
+
}
|
|
1643
|
+
if (!started && !invocation && !clause && (!words.length ? !expression : words.every((item) => item.startsWith("["))) && /[A-Za-z]/.test(char)) {
|
|
1644
|
+
const keyword = matchAt(POWERSHELL_KEYWORD_RE, input, index)?.[0]?.toLowerCase();
|
|
1645
|
+
if (keyword && (words.length > 0 ? keyword === "param" && testAt(POWERSHELL_PARAM_RE, input, index) || keyword === "class" || keyword === "enum" : keyword === "param" && testAt(POWERSHELL_PARAM_RE, input, index) || keyword === "foreach" && testAt(POWERSHELL_FOREACH_RE, input, index) || keyword === "until" && after === "do" || (keyword === "else" || keyword === "elseif") && after === "if" || (keyword === "catch" || keyword === "finally") && after === "try" || /^(?:if|for|while|do|switch|function|filter|workflow|parallel|sequence|configuration|try|begin|process|end|clean|trap|class|enum|data|dynamicparam|using|break|continue)$/.test(keyword))) {
|
|
1646
|
+
expression = /^(?:class|enum|break|continue)$/.test(keyword);
|
|
1647
|
+
clause = keyword === "using" || keyword === "break" || keyword === "continue" ? "member" : keyword === "param" || keyword === "until" || keyword === "while" && after === "do" ? "paren" : keyword === "do" ? "do" : keyword === "if" || keyword === "elseif" ? "if" : keyword === "try" || keyword === "catch" ? "try" : keyword === "switch" ? "switch" : keyword === "class" || keyword === "enum" ? "clause" : "block";
|
|
1648
|
+
after = undefined;
|
|
1622
1649
|
index += keyword.length - 1;
|
|
1623
1650
|
continue;
|
|
1624
1651
|
}
|
|
1625
|
-
if (keyword && /^(?:return|throw|exit
|
|
1652
|
+
if (!words.length && keyword && /^(?:return|throw|exit)$/.test(keyword)) {
|
|
1653
|
+
after = undefined;
|
|
1626
1654
|
index += keyword.length - 1;
|
|
1627
|
-
segment = index + 1;
|
|
1628
1655
|
continue;
|
|
1629
1656
|
}
|
|
1630
1657
|
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1658
|
+
const assign = inExpression && !clause && (char === "=" || /[-+*/%]/.test(char) && input[index + 1] === "=");
|
|
1659
|
+
if (assign || inExpression && close === ")" && !started && testAt(POWERSHELL_IN_RE, input, index)) {
|
|
1660
|
+
if (assign)
|
|
1661
|
+
finishWord(index);
|
|
1633
1662
|
words.length = 0;
|
|
1634
1663
|
rawWords.length = 0;
|
|
1635
1664
|
wordEnds.length = 0;
|
|
1636
1665
|
expression = false;
|
|
1637
|
-
|
|
1666
|
+
indexable = false;
|
|
1667
|
+
if (!assign || char !== "=")
|
|
1638
1668
|
index++;
|
|
1639
|
-
segment = index + 1;
|
|
1640
1669
|
continue;
|
|
1641
1670
|
}
|
|
1642
|
-
if (
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
index
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
if (char === "@" && /['"]/.test(input[index + 1] ?? "")) {
|
|
1652
|
-
const literal = powerShellHereString(input, index);
|
|
1653
|
-
if (!literal)
|
|
1654
|
-
return { kind: "opaque", reason: "unterminated-quote" };
|
|
1671
|
+
if (atBoundary && char === "@" && !testAt(POWERSHELL_AT_OPENER_RE, input, index + 1))
|
|
1672
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1673
|
+
if (atBoundary && char === "@" && (input[index + 1] === "'" || input[index + 1] === '"')) {
|
|
1674
|
+
if (started)
|
|
1675
|
+
finishWord(index);
|
|
1676
|
+
wordStart = index;
|
|
1677
|
+
const literal = powerShellHereString(input, index, depth, budget, skipped);
|
|
1678
|
+
if (literal.kind === "opaque")
|
|
1679
|
+
return literal;
|
|
1655
1680
|
if (!words.length && !invocation)
|
|
1656
1681
|
expression = true;
|
|
1657
|
-
|
|
1658
|
-
const result = powerShellExpansions(literal.source, depth + 1, budget);
|
|
1659
|
-
if (result.kind === "opaque")
|
|
1660
|
-
return result;
|
|
1661
|
-
nestedCommands.push(...result.commands);
|
|
1662
|
-
}
|
|
1682
|
+
nestedCommands.push(...literal.commands);
|
|
1663
1683
|
word = literal.source;
|
|
1664
1684
|
started = true;
|
|
1665
1685
|
index = literal.end;
|
|
1666
1686
|
finishWord(index + 1);
|
|
1687
|
+
indexable = "closed";
|
|
1667
1688
|
continue;
|
|
1668
1689
|
}
|
|
1669
1690
|
if (char === "$" && input[index + 1] === "{") {
|
|
1670
|
-
const end = input
|
|
1671
|
-
if (end
|
|
1691
|
+
const end = powerShellBracedVariable(input, index, skipped);
|
|
1692
|
+
if (end === undefined)
|
|
1672
1693
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1673
|
-
if (!started && !words.length && !invocation)
|
|
1694
|
+
if (!started && !words.length && !invocation && hash !== "switch")
|
|
1674
1695
|
expression = true;
|
|
1696
|
+
indexable = atBoundary || indexable === "member" && /[.:]$/.test(word) ? "closed" : false;
|
|
1675
1697
|
word += input.slice(index, end + 1);
|
|
1676
1698
|
started = true;
|
|
1677
1699
|
index = end;
|
|
1700
|
+
if (expression && !redirectTarget && input[index + 1] !== "[")
|
|
1701
|
+
finishWord(index + 1);
|
|
1678
1702
|
continue;
|
|
1679
1703
|
}
|
|
1680
|
-
const opener = (char === "$" || char === "@") && input[index + 1] === "(" ? index + 1 : char === "@" && input[index + 1] === "{" ? index + 1 : char === "(" || char === "{" || char === "[" && (
|
|
1704
|
+
const opener = (char === "$" || atBoundary && char === "@") && input[index + 1] === "(" ? index + 1 : atBoundary && char === "@" && input[index + 1] === "{" ? index + 1 : char === "(" || char === "{" || char === "[" && (inExpression || Boolean(indexable) || !started && !invocation && (!words.length || clause === "block" || clause === "try")) ? index : undefined;
|
|
1681
1705
|
if (opener !== undefined) {
|
|
1682
|
-
|
|
1706
|
+
const openChar = input[opener];
|
|
1707
|
+
const standaloneBlock = atBoundary || inExpression || char === "(" || openChar === "{";
|
|
1708
|
+
const blockClose = openChar === "(" ? ")" : openChar === "[" ? "]" : "}";
|
|
1709
|
+
const blockHash = openChar === "[" ? true : char === "@" && openChar === "{" ? true : clause === "switch" && openChar === "{" ? "switch" : clause === "clause" && openChar === "{" ? "clause" : close === "]" && char === "(" && started ? "clause" : false;
|
|
1710
|
+
if (started && (char === "{" || char === "(" || char === "@" && atBoundary)) {
|
|
1683
1711
|
finishWord(index);
|
|
1712
|
+
if (stopParsing) {
|
|
1713
|
+
index--;
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1684
1716
|
wordStart = index;
|
|
1685
1717
|
}
|
|
1686
1718
|
if (!started && !words.length && !invocation)
|
|
1687
1719
|
expression = true;
|
|
1688
|
-
const
|
|
1689
|
-
if (!block)
|
|
1690
|
-
return { kind: "opaque", reason: "invalid-structure" };
|
|
1691
|
-
const result = scanPowerShellNested(block.source, depth + 1, budget, input[opener] === "[" || char === "@" && input[opener] === "{");
|
|
1720
|
+
const result = scanPowerShellList(input, opener + 1, depth + 1, budget, blockClose, blockHash, skipped);
|
|
1692
1721
|
if (result.kind === "opaque")
|
|
1693
1722
|
return result;
|
|
1694
1723
|
nestedCommands.push(...result.commands);
|
|
1695
1724
|
started = true;
|
|
1696
|
-
word += input.slice(index,
|
|
1697
|
-
index =
|
|
1698
|
-
if (
|
|
1725
|
+
word += input.slice(index, result.end + 1);
|
|
1726
|
+
index = result.end;
|
|
1727
|
+
if (openChar === "[") {
|
|
1728
|
+
indexable = "closed";
|
|
1729
|
+
if (input[index + 1] !== "[")
|
|
1730
|
+
finishWord(index + 1);
|
|
1731
|
+
} else if (standaloneBlock) {
|
|
1699
1732
|
finishWord(index + 1);
|
|
1700
|
-
|
|
1733
|
+
indexable = "closed";
|
|
1734
|
+
}
|
|
1735
|
+
if (clause === "paren" && char === "(" || clause && clause !== "paren" && char === "{") {
|
|
1736
|
+
const completed = clause === "do" || clause === "if" || clause === "try" ? clause : undefined;
|
|
1737
|
+
clause = "member";
|
|
1701
1738
|
finishCommand(index + 1);
|
|
1702
|
-
|
|
1739
|
+
after = completed;
|
|
1703
1740
|
}
|
|
1704
1741
|
continue;
|
|
1705
1742
|
}
|
|
1706
|
-
if (char ===
|
|
1743
|
+
if (char === close)
|
|
1744
|
+
break;
|
|
1745
|
+
if (char === "}" || char === ")" || char === "]" && inExpression)
|
|
1707
1746
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1708
|
-
if (!started && words.length === 0 && (char === "&" && input[index + 1] !== "&" || char === "." && (
|
|
1747
|
+
if (!started && words.length === 0 && (char === "&" && input[index + 1] !== "&" || char === "." && (!input[index + 1] || /[\s"'$(),;{|}&]/.test(input[index + 1])))) {
|
|
1709
1748
|
if (invocation)
|
|
1710
1749
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1750
|
+
segment = index;
|
|
1711
1751
|
invocation = true;
|
|
1752
|
+
after = undefined;
|
|
1712
1753
|
continue;
|
|
1713
1754
|
}
|
|
1714
|
-
if (!started && !words.length && !invocation && powerShellExpression(input.slice(index)))
|
|
1715
|
-
expression = true;
|
|
1716
1755
|
if (/\s/.test(char) && char !== `
|
|
1717
1756
|
` && char !== "\r") {
|
|
1718
1757
|
finishWord(index);
|
|
1758
|
+
indexable = false;
|
|
1719
1759
|
continue;
|
|
1720
1760
|
}
|
|
1721
1761
|
const next = input[index + 1];
|
|
@@ -1723,12 +1763,25 @@ function scanPowerShellNested(input, depth, budget, hash = false) {
|
|
|
1723
1763
|
` ? char + next : char === "&" && next === "&" || char === "|" && next === "|" ? char + next : char === ";" || char === "|" || char === "&" || char === `
|
|
1724
1764
|
` || char === "\r" ? char : undefined;
|
|
1725
1765
|
if (separator) {
|
|
1726
|
-
if ((separator ===
|
|
1766
|
+
if (close === "]" && (separator === ";" || separator === "|" || separator === "||" || separator === "&&" || separator === "&"))
|
|
1767
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1768
|
+
if (separator === `
|
|
1727
1769
|
` || separator === "\r" || separator === `\r
|
|
1728
|
-
`)
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1770
|
+
`) {
|
|
1771
|
+
const prev = started ? word : words.at(-1) ?? "";
|
|
1772
|
+
const memberOperator = indexable === "member" && /[.:]$/.test(prev);
|
|
1773
|
+
if (clause && clause !== "member" || prev.endsWith(",") || memberOperator) {
|
|
1774
|
+
finishWord(index);
|
|
1775
|
+
index += separator.length - 1;
|
|
1776
|
+
if (!memberOperator)
|
|
1777
|
+
indexable = false;
|
|
1778
|
+
continue;
|
|
1779
|
+
}
|
|
1780
|
+
if (!started && !words.length && !invocation) {
|
|
1781
|
+
index += separator.length - 1;
|
|
1782
|
+
indexable = false;
|
|
1783
|
+
continue;
|
|
1784
|
+
}
|
|
1732
1785
|
}
|
|
1733
1786
|
finishCommand(index, dangling || ![";", `
|
|
1734
1787
|
`, "\r", `\r
|
|
@@ -1738,190 +1791,47 @@ function scanPowerShellNested(input, depth, budget, hash = false) {
|
|
|
1738
1791
|
`].includes(separator);
|
|
1739
1792
|
statementHead = !dangling;
|
|
1740
1793
|
index += separator.length - 1;
|
|
1741
|
-
segment = index + 1;
|
|
1742
1794
|
continue;
|
|
1743
1795
|
}
|
|
1796
|
+
if (!started && !words.length && !invocation && hash !== "switch" && testAt(POWERSHELL_EXPRESSION_RE, input, index))
|
|
1797
|
+
expression = true;
|
|
1798
|
+
if ((atBoundary || indexable === "member" && /[.:]$/.test(word)) && char === "$")
|
|
1799
|
+
indexable = testAt(POWERSHELL_INDEXABLE_VAR_RE, input, index + 1) ? "variable" : false;
|
|
1800
|
+
else if (indexable === "closed")
|
|
1801
|
+
indexable = char === "." && input[index + 1] !== "." && !/\s/.test(input[index + 1] ?? "") || !started && char === ":" && input[index + 1] === ":" && !/\s/.test(input[index + 2] ?? "") || !started && char === "?" && input[index + 1] === "." && input[index + 2] !== "." && !/\s/.test(input[index + 2] ?? "") ? "member" : !started && char === "?" && input[index + 1] === "[" ? "closed" : false;
|
|
1802
|
+
else if (indexable === "variable")
|
|
1803
|
+
indexable = char === "." && input[index + 1] !== "." && !/\s/.test(input[index + 1] ?? "") || char === ":" && input[index + 1] === ":" && !/\s/.test(input[index + 2] ?? "") ? "member" : char === "." && input[index + 1] === "." || !/[\p{L}\p{Nl}\d_:?]/u.test(char) ? false : "variable";
|
|
1804
|
+
else if (indexable === "member")
|
|
1805
|
+
indexable = char === "." && input[index + 1] === "." ? false : char === "." && !/\s/.test(input[index + 1] ?? "") || char === ":" && (input[index + 1] === ":" || input[index - 1] === ":") || char === "?" && input[index + 1] === "." && input[index + 2] !== "." || /[\p{L}\p{Nl}\d_]/u.test(char) ? "member" : false;
|
|
1806
|
+
after = undefined;
|
|
1744
1807
|
started = true;
|
|
1745
1808
|
dangling = false;
|
|
1746
1809
|
word += char;
|
|
1747
1810
|
}
|
|
1811
|
+
if (close !== undefined && input[index] !== close)
|
|
1812
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1748
1813
|
if (quote)
|
|
1749
1814
|
return { kind: "opaque", reason: "unterminated-quote" };
|
|
1750
|
-
|
|
1751
|
-
finishCommand(input.length);
|
|
1815
|
+
finishCommand(index);
|
|
1752
1816
|
if (redirectTarget || invalid || dangling)
|
|
1753
1817
|
return { kind: "opaque", reason: "invalid-structure" };
|
|
1754
1818
|
if (commands.some((command) => !command.words[0]))
|
|
1755
1819
|
return { kind: "opaque", reason: "dynamic-command-name" };
|
|
1756
|
-
return { kind: "scanned", commands };
|
|
1757
|
-
}
|
|
1758
|
-
function powerShellBlock(input, start, depth) {
|
|
1759
|
-
if (depth >= MAX_SUBSTITUTION_DEPTH)
|
|
1760
|
-
return;
|
|
1761
|
-
let quote;
|
|
1762
|
-
let standalone = false;
|
|
1763
|
-
let started = false;
|
|
1764
|
-
let head = true;
|
|
1765
|
-
let expression = false;
|
|
1766
|
-
let token = "";
|
|
1767
|
-
const close = input[start] === "(" ? ")" : input[start] === "[" ? "]" : "}";
|
|
1768
|
-
for (let index = start + 1;index < input.length; index++) {
|
|
1769
|
-
const char = input[index];
|
|
1770
|
-
if (quote === "single") {
|
|
1771
|
-
if (char === "'" && input[index + 1] === "'") {
|
|
1772
|
-
token += "'";
|
|
1773
|
-
index++;
|
|
1774
|
-
} else if (char === "'") {
|
|
1775
|
-
quote = undefined;
|
|
1776
|
-
started = !standalone;
|
|
1777
|
-
if (standalone)
|
|
1778
|
-
token = "";
|
|
1779
|
-
} else
|
|
1780
|
-
token += char;
|
|
1781
|
-
continue;
|
|
1782
|
-
}
|
|
1783
|
-
if (quote === "double") {
|
|
1784
|
-
if (char === "`") {
|
|
1785
|
-
const escape = powerShellEscape(input, index);
|
|
1786
|
-
if (!escape)
|
|
1787
|
-
return;
|
|
1788
|
-
token += escape.value;
|
|
1789
|
-
index = escape.end;
|
|
1790
|
-
} else if (char === '"' && input[index + 1] === '"') {
|
|
1791
|
-
token += '"';
|
|
1792
|
-
index++;
|
|
1793
|
-
} else if (char === '"') {
|
|
1794
|
-
quote = undefined;
|
|
1795
|
-
started = !standalone;
|
|
1796
|
-
if (standalone)
|
|
1797
|
-
token = "";
|
|
1798
|
-
} else if (char === "$" && input[index + 1] === "(") {
|
|
1799
|
-
const nested = powerShellBlock(input, index + 1, depth + 1);
|
|
1800
|
-
if (!nested)
|
|
1801
|
-
return;
|
|
1802
|
-
index = nested.end;
|
|
1803
|
-
} else
|
|
1804
|
-
token += char;
|
|
1805
|
-
continue;
|
|
1806
|
-
}
|
|
1807
|
-
if (char === "`") {
|
|
1808
|
-
const escape = powerShellEscape(input, index);
|
|
1809
|
-
if (!escape)
|
|
1810
|
-
return;
|
|
1811
|
-
if (started || /\S/.test(escape.value)) {
|
|
1812
|
-
started = true;
|
|
1813
|
-
token += escape.value;
|
|
1814
|
-
}
|
|
1815
|
-
index = escape.end;
|
|
1816
|
-
continue;
|
|
1817
|
-
}
|
|
1818
|
-
if (char === "<" && input[index + 1] === "#" && !started) {
|
|
1819
|
-
const end = powerShellComment(input, index);
|
|
1820
|
-
if (end === undefined)
|
|
1821
|
-
return;
|
|
1822
|
-
index = end;
|
|
1823
|
-
continue;
|
|
1824
|
-
}
|
|
1825
|
-
if (char === "#" && (!started || expression)) {
|
|
1826
|
-
const endings = [input.indexOf(`
|
|
1827
|
-
`, index), input.indexOf("\r", index)].filter((ending) => ending >= 0);
|
|
1828
|
-
const newline = endings.length > 0 ? Math.min(...endings) : -1;
|
|
1829
|
-
if (newline < 0)
|
|
1830
|
-
return;
|
|
1831
|
-
index = newline;
|
|
1832
|
-
started = false;
|
|
1833
|
-
head = true;
|
|
1834
|
-
expression = false;
|
|
1835
|
-
token = "";
|
|
1836
|
-
continue;
|
|
1837
|
-
}
|
|
1838
|
-
if (char === "@" && /['"]/.test(input[index + 1] ?? "")) {
|
|
1839
|
-
const literal = powerShellHereString(input, index);
|
|
1840
|
-
if (!literal)
|
|
1841
|
-
return;
|
|
1842
|
-
index = literal.end;
|
|
1843
|
-
started = false;
|
|
1844
|
-
head = false;
|
|
1845
|
-
continue;
|
|
1846
|
-
}
|
|
1847
|
-
if (head && !started && (char === "&" && input[index + 1] !== "&" || char === "." && /\s/.test(input[index + 1] ?? ""))) {
|
|
1848
|
-
head = false;
|
|
1849
|
-
continue;
|
|
1850
|
-
}
|
|
1851
|
-
if (expression && (char === "=" || !started && /^in\b/i.test(input.slice(index)))) {
|
|
1852
|
-
if (char !== "=")
|
|
1853
|
-
index++;
|
|
1854
|
-
expression = false;
|
|
1855
|
-
head = true;
|
|
1856
|
-
started = false;
|
|
1857
|
-
token = "";
|
|
1858
|
-
continue;
|
|
1859
|
-
}
|
|
1860
|
-
if (char === "'" || char === '"') {
|
|
1861
|
-
quote = char === "'" ? "single" : "double";
|
|
1862
|
-
standalone = !started;
|
|
1863
|
-
if (head && !started)
|
|
1864
|
-
expression = true;
|
|
1865
|
-
started = true;
|
|
1866
|
-
continue;
|
|
1867
|
-
}
|
|
1868
|
-
const redirect = !started && (char === ">" || char === "*" || /\d/.test(char)) ? powerShellRedirect(input, index) : undefined;
|
|
1869
|
-
if (redirect === false)
|
|
1870
|
-
return;
|
|
1871
|
-
if (redirect) {
|
|
1872
|
-
index += redirect.length - 1;
|
|
1873
|
-
token = "";
|
|
1874
|
-
continue;
|
|
1875
|
-
}
|
|
1876
|
-
if (char === "$" && input[index + 1] === "{") {
|
|
1877
|
-
const end = input.indexOf("}", index + 2);
|
|
1878
|
-
if (end < 0)
|
|
1879
|
-
return;
|
|
1880
|
-
if (head && !started)
|
|
1881
|
-
expression = true;
|
|
1882
|
-
index = end;
|
|
1883
|
-
started = true;
|
|
1884
|
-
continue;
|
|
1885
|
-
}
|
|
1886
|
-
if (!started && !head && !expression && /^--%(?=$|[\s;|&(){}])/.test(input.slice(index))) {
|
|
1887
|
-
index = powerShellStopParsing(input, index + 3) - 1;
|
|
1888
|
-
continue;
|
|
1889
|
-
}
|
|
1890
|
-
if (char === close)
|
|
1891
|
-
return { source: input.slice(start + 1, index), end: index };
|
|
1892
|
-
if (char === "(" || char === "{" || char === "[" && (!started || expression)) {
|
|
1893
|
-
if (head && !started)
|
|
1894
|
-
expression = true;
|
|
1895
|
-
const nested = powerShellBlock(input, index, depth + 1);
|
|
1896
|
-
if (!nested)
|
|
1897
|
-
return;
|
|
1898
|
-
index = nested.end;
|
|
1899
|
-
started = false;
|
|
1900
|
-
head = false;
|
|
1901
|
-
token = "";
|
|
1902
|
-
continue;
|
|
1903
|
-
}
|
|
1904
|
-
if (/[\s;&|]/.test(char)) {
|
|
1905
|
-
if (token === "--%" && !expression) {
|
|
1906
|
-
index = powerShellStopParsing(input, index) - 1;
|
|
1907
|
-
token = "";
|
|
1908
|
-
continue;
|
|
1909
|
-
}
|
|
1910
|
-
if (/[;&|\r\n]/.test(char)) {
|
|
1911
|
-
head = true;
|
|
1912
|
-
expression = false;
|
|
1913
|
-
} else if (started)
|
|
1914
|
-
head = false;
|
|
1915
|
-
started = false;
|
|
1916
|
-
token = "";
|
|
1917
|
-
continue;
|
|
1918
|
-
}
|
|
1919
|
-
if (head && !started && powerShellExpression(input.slice(index)))
|
|
1920
|
-
expression = true;
|
|
1921
|
-
started = true;
|
|
1922
|
-
token += char;
|
|
1923
|
-
}
|
|
1820
|
+
return { kind: "scanned", commands, end: index };
|
|
1924
1821
|
}
|
|
1822
|
+
var POWERSHELL_STOP_PARSING_RE = /--%(?=$|[\s;|&(){}])/y;
|
|
1823
|
+
var POWERSHELL_PARAMETER_COLON_RE = /^-[\p{L}\p{Nl}_?][\p{L}\p{Nl}\d_?-]*:$/u;
|
|
1824
|
+
var POWERSHELL_MERGE_REDIRECT_RE = /\d>&/y;
|
|
1825
|
+
var POWERSHELL_LABEL_RE = /:[A-Za-z_]\w*(?=\s*(?:while|for|foreach|do|switch)(?=$|[\s&(),;{|}]))/iy;
|
|
1826
|
+
var POWERSHELL_KEYWORD_RE = /[A-Za-z]+(?=$|[\s&(),;{|}])/y;
|
|
1827
|
+
var POWERSHELL_FOREACH_RE = /foreach\s*\(/isy;
|
|
1828
|
+
var POWERSHELL_PARAM_RE = /param\s*\(/isy;
|
|
1829
|
+
var POWERSHELL_IN_RE = /in(?=$|[\s&(),;{|}])/iy;
|
|
1830
|
+
var POWERSHELL_AT_OPENER_RE = /[({'"\p{L}\p{Nl}\d_?]/uy;
|
|
1831
|
+
var POWERSHELL_INDEXABLE_VAR_RE = /(?::[\p{L}\p{Nl}\d_?]+|[\p{L}\p{Nl}\d_][\p{L}\p{Nl}\d_?]*)/uy;
|
|
1832
|
+
var POWERSHELL_HERE_HEADER_RE = /@['"][^\S\r\n]*(?:\r\n|\r|\n)/y;
|
|
1833
|
+
var POWERSHELL_UNICODE_ESCAPE_RE = /u\{([0-9a-f]{1,6})\}/iy;
|
|
1834
|
+
var POWERSHELL_EXPRESSION_RE = /(?:!*(?:\+\+|--|[+-])?\$(?:\{|(?:\?|\$|\^)(?=$|[\s;|&(){},#>])|:[\p{L}\p{Nl}\d_?]+|[\p{L}\p{Nl}\d_][\p{L}\p{Nl}\d_?]*(?::[\p{L}\p{Nl}\d_?]+)?)|!(?![\p{L}\p{Nl}_.\d])|\+(?![=\p{L}\p{Nl}_.\d])|--(?!=)|-(?![=\p{L}\p{Nl}\d_?.])|,(?!\s*$)|!*[+-]?(?:0[xX][\da-fA-F]+|0[bB][01]+|(?:\d+(?:\.(?!\.)\d*|(?!\.(?!\.)))|\.\d+)(?:[eE][+-]?\d+)?)(?:[dDlLnN]|[uU][sSyYlL]?|[sSyY])?(?:[kKmMgGtTpP][bB])?(?=$|[\s!#%&()*+,\-/.;<=>\]|{}])|-(?:not|bnot|join|[ic]?split)(?![\p{L}\p{Nl}]))/iuy;
|
|
1925
1835
|
var POWERSHELL_ESCAPES = {
|
|
1926
1836
|
"0": "\x00",
|
|
1927
1837
|
a: "\x07",
|
|
@@ -1934,80 +1844,145 @@ var POWERSHELL_ESCAPES = {
|
|
|
1934
1844
|
t: "\t",
|
|
1935
1845
|
v: "\v"
|
|
1936
1846
|
};
|
|
1937
|
-
function
|
|
1938
|
-
|
|
1847
|
+
function matchAt(regex, input, index) {
|
|
1848
|
+
regex.lastIndex = index;
|
|
1849
|
+
return regex.exec(input);
|
|
1850
|
+
}
|
|
1851
|
+
function testAt(regex, input, index) {
|
|
1852
|
+
regex.lastIndex = index;
|
|
1853
|
+
return regex.test(input);
|
|
1854
|
+
}
|
|
1855
|
+
function powerShellEscape(input, start, lineContinuation = false, skipped) {
|
|
1856
|
+
let next = start + 1;
|
|
1857
|
+
while (skipped?.has(next))
|
|
1858
|
+
next++;
|
|
1859
|
+
const char = input[next];
|
|
1939
1860
|
if (char === undefined)
|
|
1940
1861
|
return;
|
|
1941
1862
|
if (char === "\r" || char === `
|
|
1942
1863
|
`)
|
|
1943
1864
|
return {
|
|
1944
|
-
value: char === "\r" && input[
|
|
1865
|
+
value: lineContinuation && char === "\r" && input[next + 1] === `
|
|
1945
1866
|
` ? `\r
|
|
1946
1867
|
` : char,
|
|
1947
|
-
end:
|
|
1948
|
-
` ?
|
|
1868
|
+
end: next + (lineContinuation && char === "\r" && input[next + 1] === `
|
|
1869
|
+
` ? 1 : 0)
|
|
1949
1870
|
};
|
|
1950
|
-
if (char === "u" && input[
|
|
1951
|
-
const code =
|
|
1871
|
+
if (char === "u" && input[next + 1] === "{") {
|
|
1872
|
+
const code = matchAt(POWERSHELL_UNICODE_ESCAPE_RE, input, next);
|
|
1952
1873
|
if (!code || Number.parseInt(code[1], 16) > 1114111)
|
|
1953
1874
|
return;
|
|
1954
|
-
return { value: String.fromCodePoint(Number.parseInt(code[1], 16)), end:
|
|
1875
|
+
return { value: String.fromCodePoint(Number.parseInt(code[1], 16)), end: next + code[0].length - 1 };
|
|
1955
1876
|
}
|
|
1956
|
-
return { value: POWERSHELL_ESCAPES[char] ?? char, end:
|
|
1877
|
+
return { value: POWERSHELL_ESCAPES[char] ?? char, end: next };
|
|
1957
1878
|
}
|
|
1958
|
-
function
|
|
1959
|
-
|
|
1879
|
+
function powerShellBracedVariable(input, start, skipped) {
|
|
1880
|
+
for (let index = start + 2;index < input.length; index++) {
|
|
1881
|
+
if (skipped?.has(index))
|
|
1882
|
+
continue;
|
|
1883
|
+
if (input[index] === "`") {
|
|
1884
|
+
const escape = powerShellEscape(input, index, false, skipped);
|
|
1885
|
+
if (!escape)
|
|
1886
|
+
return;
|
|
1887
|
+
index = escape.end;
|
|
1888
|
+
continue;
|
|
1889
|
+
}
|
|
1890
|
+
if (input[index] === "}")
|
|
1891
|
+
return index > start + 2 ? index : undefined;
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
function powerShellSubExpression(input, start, hereString, budget, skipped) {
|
|
1895
|
+
const nextSkipped = new Set(skipped);
|
|
1896
|
+
let depth = 1;
|
|
1897
|
+
let rawEnd;
|
|
1898
|
+
for (let index = start;index < input.length; index++) {
|
|
1899
|
+
if (--budget.remaining < 0)
|
|
1900
|
+
return;
|
|
1901
|
+
if (nextSkipped.has(index))
|
|
1902
|
+
continue;
|
|
1903
|
+
const char = input[index];
|
|
1904
|
+
if (char === "(")
|
|
1905
|
+
depth++;
|
|
1906
|
+
else if (char === ")") {
|
|
1907
|
+
if (--depth === 0 && rawEnd === undefined)
|
|
1908
|
+
rawEnd = index;
|
|
1909
|
+
} else if (!hereString && (char === '"' || char === "`")) {
|
|
1910
|
+
let next = index + 1;
|
|
1911
|
+
while (nextSkipped.has(next))
|
|
1912
|
+
next++;
|
|
1913
|
+
if (input[next] === '"') {
|
|
1914
|
+
nextSkipped.add(index);
|
|
1915
|
+
index = next;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
return { skipped: nextSkipped, rawEnd };
|
|
1960
1920
|
}
|
|
1961
|
-
function powerShellStopParsing(input, start) {
|
|
1921
|
+
function powerShellStopParsing(input, start, skipped) {
|
|
1962
1922
|
let quoted = false;
|
|
1963
1923
|
for (let index = start;index < input.length; index++) {
|
|
1924
|
+
if (skipped?.has(index))
|
|
1925
|
+
continue;
|
|
1964
1926
|
if (input[index] === '"')
|
|
1965
1927
|
quoted = !quoted;
|
|
1966
1928
|
if (input[index] === "\r" || input[index] === `
|
|
1967
|
-
` || input[index] === "|" && !quoted)
|
|
1929
|
+
` || (input[index] === "|" || input[index] === "&" && input[index + 1] === "&") && !quoted)
|
|
1968
1930
|
return index;
|
|
1969
1931
|
}
|
|
1970
1932
|
return input.length;
|
|
1971
1933
|
}
|
|
1972
|
-
function
|
|
1973
|
-
const
|
|
1974
|
-
return end < 0 ? undefined : end + 1;
|
|
1975
|
-
}
|
|
1976
|
-
function powerShellHereString(input, start) {
|
|
1977
|
-
const header = /^@['"][ \t]*(?:\r\n|\r|\n)/.exec(input.slice(start));
|
|
1934
|
+
function powerShellHereString(input, start, depth, budget, skipped) {
|
|
1935
|
+
const header = matchAt(POWERSHELL_HERE_HEADER_RE, input, start);
|
|
1978
1936
|
if (!header)
|
|
1979
|
-
return;
|
|
1937
|
+
return { kind: "opaque", reason: "unterminated-quote" };
|
|
1938
|
+
const quote = input[start + 1];
|
|
1980
1939
|
const body = start + header[0].length;
|
|
1940
|
+
const commands = [];
|
|
1941
|
+
let lineStart = true;
|
|
1981
1942
|
for (let index = body;index < input.length; index++) {
|
|
1982
|
-
if (
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
if (input[index] !== input[start + 1] || input[index + 1] !== "@")
|
|
1943
|
+
if (--budget.remaining < 0)
|
|
1944
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1945
|
+
if (skipped?.has(index))
|
|
1986
1946
|
continue;
|
|
1987
|
-
|
|
1947
|
+
if (lineStart && input[index] === quote && input[index + 1] === "@") {
|
|
1948
|
+
const end = index > body && input[index - 1] === `
|
|
1988
1949
|
` && input[index - 2] === "\r" ? index - 2 : index > body ? index - 1 : index;
|
|
1989
|
-
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
function powerShellExpansions(input, depth, budget) {
|
|
1993
|
-
const commands = [];
|
|
1994
|
-
for (let index = 0;index < input.length; index++) {
|
|
1995
|
-
if (input[index] === "`") {
|
|
1996
|
-
index++;
|
|
1997
|
-
continue;
|
|
1950
|
+
return { kind: "scanned", commands, source: input.slice(body, end), end: index + 1 };
|
|
1998
1951
|
}
|
|
1999
|
-
if (
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
1952
|
+
if (quote === '"') {
|
|
1953
|
+
if (input[index] === "`") {
|
|
1954
|
+
const escape = powerShellEscape(input, index, false, skipped);
|
|
1955
|
+
if (!escape)
|
|
1956
|
+
return { kind: "opaque", reason: "unterminated-escape" };
|
|
1957
|
+
index = escape.end;
|
|
1958
|
+
lineStart = false;
|
|
1959
|
+
continue;
|
|
1960
|
+
}
|
|
1961
|
+
if (input[index] === "$" && input[index + 1] === "{") {
|
|
1962
|
+
const end = powerShellBracedVariable(input, index, skipped);
|
|
1963
|
+
if (end === undefined)
|
|
1964
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1965
|
+
index = end;
|
|
1966
|
+
lineStart = false;
|
|
1967
|
+
continue;
|
|
1968
|
+
}
|
|
1969
|
+
if (input[index] === "$" && input[index + 1] === "(") {
|
|
1970
|
+
const sub = powerShellSubExpression(input, index + 2, true, budget, skipped);
|
|
1971
|
+
if (!sub)
|
|
1972
|
+
return { kind: "opaque", reason: "invalid-structure" };
|
|
1973
|
+
const result = scanPowerShellList(input, index + 2, depth + 1, budget, ")", false, sub.skipped);
|
|
1974
|
+
if (result.kind === "opaque")
|
|
1975
|
+
return result;
|
|
1976
|
+
commands.push(...result.commands);
|
|
1977
|
+
index = sub.rawEnd !== undefined && sub.rawEnd > result.end ? sub.rawEnd : result.end;
|
|
1978
|
+
lineStart = false;
|
|
1979
|
+
continue;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
lineStart = input[index] === "\r" || input[index] === `
|
|
1983
|
+
`;
|
|
2009
1984
|
}
|
|
2010
|
-
return { kind: "
|
|
1985
|
+
return { kind: "opaque", reason: "unterminated-quote" };
|
|
2011
1986
|
}
|
|
2012
1987
|
function powerShellRedirect(input, index) {
|
|
2013
1988
|
let cursor = index;
|