@opencode/core 0.0.0-dev-1141 → 0.0.0-dev-1153
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 +94 -94
- package/dist/aisdk-native.js +1 -1
- package/dist/aisdk.js +109 -109
- package/dist/app.js +7 -7
- package/dist/artifact.js +247 -244
- package/dist/bus.js +80 -80
- package/dist/chunks/{persistent-pty-aj7mw0zk.js → instruction-discovery-034tev2y.js} +2 -2
- package/dist/chunks/{persistent-pty-hrpg1pdd.js → instruction-discovery-035wadpx.js} +7 -7
- package/dist/chunks/{persistent-pty-dqahggxs.js → instruction-discovery-03afj9c3.js} +90 -90
- package/dist/chunks/{persistent-pty-5mw7s1b6.js → instruction-discovery-0c1h5397.js} +23 -23
- package/dist/chunks/{persistent-pty-rmh25tnk.js → instruction-discovery-0d3jspgf.js} +16 -16
- package/dist/chunks/{persistent-pty-0j7gp832.js → instruction-discovery-0j7gp832.js} +1 -1
- package/dist/chunks/{persistent-pty-6ss6ngz0.js → instruction-discovery-0m9q59s6.js} +4 -4
- package/dist/chunks/{persistent-pty-0ma9gw4f.js → instruction-discovery-0ma9gw4f.js} +2 -2
- package/dist/chunks/{persistent-pty-wrwtw7ga.js → instruction-discovery-0qrcky28.js} +28 -28
- package/dist/chunks/{persistent-pty-g75vsea6.js → instruction-discovery-0thdzspe.js} +6 -6
- package/dist/chunks/{persistent-pty-1aqsckx4.js → instruction-discovery-1aqsckx4.js} +1 -1
- package/dist/chunks/{persistent-pty-27w5k9zf.js → instruction-discovery-1ep2p91f.js} +2 -2
- package/dist/chunks/{persistent-pty-0h86f0az.js → instruction-discovery-1v2g13eq.js} +4 -4
- package/dist/chunks/{persistent-pty-y41qxc5h.js → instruction-discovery-1w3geam7.js} +176 -176
- package/dist/chunks/{persistent-pty-1x2knyw4.js → instruction-discovery-1x2knyw4.js} +1 -1
- package/dist/chunks/{persistent-pty-1yq9hg58.js → instruction-discovery-1yq9hg58.js} +1 -1
- package/dist/chunks/{persistent-pty-9b5pg85y.js → instruction-discovery-211a3q4s.js} +8 -8
- package/dist/chunks/{persistent-pty-dmvn3jq9.js → instruction-discovery-27b5kgf3.js} +7 -7
- package/dist/chunks/{persistent-pty-2fc7eemy.js → instruction-discovery-2fc7eemy.js} +1 -1
- package/dist/chunks/{persistent-pty-6zkjwwbt.js → instruction-discovery-2mdc9532.js} +77 -77
- package/dist/chunks/{persistent-pty-s1ba0vj0.js → instruction-discovery-2p60zmnr.js} +2 -2
- package/dist/chunks/{persistent-pty-q4aadatb.js → instruction-discovery-2pvfmx83.js} +24 -24
- package/dist/chunks/{persistent-pty-q0xawjdj.js → instruction-discovery-2s4n401s.js} +5 -5
- package/dist/chunks/{persistent-pty-2s9mae96.js → instruction-discovery-2s9mae96.js} +3 -3
- package/dist/chunks/{persistent-pty-tq501wp9.js → instruction-discovery-2tfft3sg.js} +6 -6
- package/dist/chunks/{persistent-pty-rn9cpdem.js → instruction-discovery-2vmes2jj.js} +31 -31
- package/dist/chunks/{persistent-pty-t1dd3zqa.js → instruction-discovery-2yey3x5y.js} +6 -6
- package/dist/chunks/{persistent-pty-5kjbjby5.js → instruction-discovery-2zw0bpzz.js} +12 -12
- package/dist/chunks/{persistent-pty-gckn4wsj.js → instruction-discovery-35yb2skd.js} +21 -21
- package/dist/chunks/{persistent-pty-txaz18nt.js → instruction-discovery-37k6b6nc.js} +3 -3
- package/dist/chunks/{persistent-pty-38aws4xb.js → instruction-discovery-38aws4xb.js} +1 -1
- package/dist/chunks/{persistent-pty-3adw4bt5.js → instruction-discovery-3adw4bt5.js} +2 -2
- package/dist/chunks/{persistent-pty-qfgdng4e.js → instruction-discovery-3ehzsbnd.js} +3 -3
- package/dist/chunks/{persistent-pty-3hepkmqq.js → instruction-discovery-3hepkmqq.js} +1 -1
- package/dist/chunks/{persistent-pty-pb8daj1x.js → instruction-discovery-3k17hp5t.js} +4 -4
- package/dist/chunks/{persistent-pty-3nnrz6f6.js → instruction-discovery-3nnrz6f6.js} +1 -1
- package/dist/chunks/{persistent-pty-8gzgd6gz.js → instruction-discovery-3yg3yfc8.js} +20 -20
- package/dist/chunks/{persistent-pty-40y6dtc2.js → instruction-discovery-40y6dtc2.js} +1 -1
- package/dist/chunks/{persistent-pty-jxd6f16v.js → instruction-discovery-44pmzq9c.js} +2 -2
- package/dist/chunks/{persistent-pty-77y0kkm0.js → instruction-discovery-46edcy5z.js} +33 -33
- package/dist/chunks/{persistent-pty-y1m2rnym.js → instruction-discovery-495vdj1c.js} +8 -8
- package/dist/chunks/{persistent-pty-5j9ncfs4.js → instruction-discovery-4apw5rjv.js} +6 -6
- package/dist/chunks/{persistent-pty-4dx1dgte.js → instruction-discovery-4dx1dgte.js} +1 -1
- package/dist/chunks/{persistent-pty-4f25tdd0.js → instruction-discovery-4f25tdd0.js} +1 -1
- package/dist/chunks/{persistent-pty-htqc7tfk.js → instruction-discovery-4fxfq119.js} +13 -13
- package/dist/chunks/{persistent-pty-4pyp9zr9.js → instruction-discovery-4pyp9zr9.js} +1 -1
- package/dist/chunks/{persistent-pty-4v008n1t.js → instruction-discovery-4v008n1t.js} +1 -1
- package/dist/chunks/{persistent-pty-x50d9hj1.js → instruction-discovery-4v3pcqtp.js} +23 -23
- package/dist/chunks/{persistent-pty-04qc8z7j.js → instruction-discovery-4vzr2b15.js} +3 -3
- package/dist/chunks/{persistent-pty-e9v43avg.js → instruction-discovery-4zz6w6ms.js} +39 -39
- package/dist/chunks/{persistent-pty-401vphjz.js → instruction-discovery-50k5bes4.js} +5 -5
- package/dist/chunks/{persistent-pty-9b0bxgxr.js → instruction-discovery-51143kyp.js} +8 -8
- package/dist/chunks/{persistent-pty-k0z9bhgz.js → instruction-discovery-51beeett.js} +42 -42
- package/dist/chunks/{persistent-pty-yqx1adnq.js → instruction-discovery-51gph2p8.js} +9 -9
- package/dist/chunks/{persistent-pty-g12t90cy.js → instruction-discovery-52tez8pf.js} +7 -7
- package/dist/chunks/{persistent-pty-cjtgxjhq.js → instruction-discovery-54j96p5g.js} +21 -21
- package/dist/chunks/{persistent-pty-bkk47srm.js → instruction-discovery-565gd501.js} +8 -8
- package/dist/chunks/{persistent-pty-kny8q9fm.js → instruction-discovery-56qf5pkg.js} +6 -6
- package/dist/chunks/{persistent-pty-fw2bfwd4.js → instruction-discovery-5737r2r0.js} +4 -4
- package/dist/chunks/{persistent-pty-bdhhrrav.js → instruction-discovery-5841d17s.js} +23 -23
- package/dist/chunks/{persistent-pty-pfbhb58w.js → instruction-discovery-58bqby8s.js} +39 -31
- package/dist/chunks/{persistent-pty-xfrnyd0a.js → instruction-discovery-5azf7efg.js} +14 -14
- package/dist/chunks/{persistent-pty-d1rkk357.js → instruction-discovery-5cs4624n.js} +8 -8
- package/dist/chunks/{persistent-pty-r41sfy63.js → instruction-discovery-5enarcya.js} +9 -9
- package/dist/chunks/{persistent-pty-wgtcexd1.js → instruction-discovery-5f16dwav.js} +6 -6
- package/dist/chunks/{persistent-pty-5m9w47nd.js → instruction-discovery-5m9w47nd.js} +1 -1
- package/dist/chunks/{persistent-pty-nemnqzpn.js → instruction-discovery-5ns414kb.js} +4 -4
- package/dist/chunks/{persistent-pty-fw468rj7.js → instruction-discovery-5snd9tm8.js} +46 -46
- package/dist/chunks/{persistent-pty-s47rahr7.js → instruction-discovery-5whx36p1.js} +4 -4
- package/dist/chunks/{persistent-pty-fzndy2x2.js → instruction-discovery-5zxbvv2f.js} +14 -14
- package/dist/chunks/{persistent-pty-btz4vdf2.js → instruction-discovery-61prxpw3.js} +5 -5
- package/dist/chunks/{persistent-pty-j3f8hyeg.js → instruction-discovery-63xym3gh.js} +4 -4
- package/dist/chunks/{persistent-pty-btr9eed2.js → instruction-discovery-6b1atqrz.js} +80 -73
- package/dist/chunks/{persistent-pty-n7hqy2cw.js → instruction-discovery-6g42hr39.js} +7 -7
- package/dist/chunks/{persistent-pty-d73h4c6n.js → instruction-discovery-6n28yw7w.js} +23 -23
- package/dist/chunks/{persistent-pty-cqeqcmsf.js → instruction-discovery-6ncy35y2.js} +14 -14
- package/dist/chunks/{persistent-pty-kkt22k82.js → instruction-discovery-6pgf8bat.js} +16 -16
- package/dist/chunks/{persistent-pty-19b2ztj7.js → instruction-discovery-6t40r86m.js} +11 -11
- package/dist/chunks/{persistent-pty-vrn9h1g0.js → instruction-discovery-6zk77rv1.js} +14 -14
- package/dist/chunks/{persistent-pty-6jpx4839.js → instruction-discovery-74vyk6h3.js} +20 -20
- package/dist/chunks/{persistent-pty-dczf9fhp.js → instruction-discovery-74wq58h4.js} +19 -19
- package/dist/chunks/{persistent-pty-00pzdxvb.js → instruction-discovery-77ps6e0h.js} +1 -1
- package/dist/chunks/{persistent-pty-hgsqba75.js → instruction-discovery-7at1ma80.js} +59 -59
- package/dist/chunks/{persistent-pty-7bmhse3q.js → instruction-discovery-7bmhse3q.js} +1 -1
- package/dist/chunks/{persistent-pty-xz07m27x.js → instruction-discovery-7nqkf5r1.js} +2 -2
- package/dist/chunks/{persistent-pty-z0h12gs8.js → instruction-discovery-7rvsyqjv.js} +1 -0
- package/dist/chunks/{persistent-pty-7w2ypzdf.js → instruction-discovery-7w2ypzdf.js} +1 -1
- package/dist/chunks/{persistent-pty-7weczvnd.js → instruction-discovery-7weczvnd.js} +1 -1
- package/dist/chunks/{persistent-pty-t67npm6c.js → instruction-discovery-7z3k0amd.js} +23 -23
- package/dist/chunks/{persistent-pty-775hqbnd.js → instruction-discovery-80mg3ag8.js} +3 -3
- package/dist/chunks/{persistent-pty-80pdk984.js → instruction-discovery-80pdk984.js} +1 -1
- package/dist/chunks/{persistent-pty-zg7tww6y.js → instruction-discovery-851tvzsa.js} +7 -7
- package/dist/chunks/{persistent-pty-85jq8dht.js → instruction-discovery-85jq8dht.js} +1 -1
- package/dist/chunks/{persistent-pty-62kpm1kv.js → instruction-discovery-881j5wbk.js} +20 -20
- package/dist/chunks/{persistent-pty-8b3vzgkx.js → instruction-discovery-8b3vzgkx.js} +1 -1
- package/dist/chunks/{persistent-pty-zhqvvmqm.js → instruction-discovery-8k0n5fmy.js} +12 -12
- package/dist/chunks/{persistent-pty-as8a156g.js → instruction-discovery-8kjyvwy5.js} +7 -3
- package/dist/chunks/{persistent-pty-52b88tdw.js → instruction-discovery-8p7trcr7.js} +25 -22
- package/dist/chunks/{persistent-pty-0cggdvrh.js → instruction-discovery-8phpm80f.js} +25 -25
- package/dist/chunks/{persistent-pty-0mgprbja.js → instruction-discovery-8rapdqzr.js} +4 -4
- package/dist/chunks/{persistent-pty-bb3mmwvh.js → instruction-discovery-8sxe6kv8.js} +2 -2
- package/dist/chunks/{persistent-pty-jf9aqpdw.js → instruction-discovery-8tapm24k.js} +39 -39
- package/dist/chunks/{persistent-pty-m7v9vvkp.js → instruction-discovery-8wgcnn8x.js} +17 -17
- package/dist/chunks/{persistent-pty-8wtp7s3z.js → instruction-discovery-8wtp7s3z.js} +1 -1
- package/dist/chunks/{persistent-pty-wedqffd6.js → instruction-discovery-8xb43s2n.js} +11 -11
- package/dist/chunks/{persistent-pty-8zv0xmg5.js → instruction-discovery-8zv0xmg5.js} +1 -1
- package/dist/chunks/{persistent-pty-dg4atj78.js → instruction-discovery-90fzt9r0.js} +7 -7
- package/dist/chunks/{persistent-pty-3h3skxty.js → instruction-discovery-90xdgt1w.js} +18 -18
- package/dist/chunks/{persistent-pty-ktf53k0y.js → instruction-discovery-94wn1mc5.js} +20 -20
- package/dist/chunks/{persistent-pty-0mtp185z.js → instruction-discovery-963hk181.js} +9 -9
- package/dist/chunks/{persistent-pty-w8rr6c7d.js → instruction-discovery-9en2rs5a.js} +27 -27
- package/dist/chunks/{persistent-pty-92j6mbn0.js → instruction-discovery-9gzp3xxs.js} +11 -11
- package/dist/chunks/{persistent-pty-epayv3ej.js → instruction-discovery-9k5sz97t.js} +4 -4
- package/dist/chunks/{persistent-pty-t4z9p5b8.js → instruction-discovery-9thsheb8.js} +11 -11
- package/dist/chunks/{persistent-pty-k72s33b7.js → instruction-discovery-9v1p8cr8.js} +33 -33
- package/dist/chunks/{persistent-pty-nqqq7twm.js → instruction-discovery-9v8y74jx.js} +24 -24
- package/dist/chunks/{persistent-pty-1791cqk2.js → instruction-discovery-9y8sz18v.js} +15 -15
- package/dist/chunks/{persistent-pty-7tpyp9vw.js → instruction-discovery-aedwt843.js} +8 -8
- package/dist/chunks/{persistent-pty-ywh3xphk.js → instruction-discovery-aqczazaa.js} +4 -4
- package/dist/chunks/{persistent-pty-3cbjf1nt.js → instruction-discovery-ayjs7tqn.js} +2 -2
- package/dist/chunks/{persistent-pty-g4txs7zc.js → instruction-discovery-b26ddj6h.js} +4 -4
- package/dist/chunks/{persistent-pty-n3ntzjw4.js → instruction-discovery-b69xerkv.js} +26 -26
- package/dist/chunks/{persistent-pty-me215f18.js → instruction-discovery-b7nkz392.js} +1 -1
- package/dist/chunks/{persistent-pty-e8xdkctn.js → instruction-discovery-bf8fdj8f.js} +6 -6
- package/dist/chunks/{persistent-pty-ewfepv21.js → instruction-discovery-brsgs2wc.js} +10 -10
- package/dist/chunks/{persistent-pty-bstexjd6.js → instruction-discovery-bstexjd6.js} +1 -1
- package/dist/chunks/{persistent-pty-njn4p9sa.js → instruction-discovery-btj7qfrq.js} +40 -40
- package/dist/chunks/{persistent-pty-8ym9cpdp.js → instruction-discovery-bz5ttvd0.js} +22 -22
- package/dist/chunks/{persistent-pty-c1sfsxsr.js → instruction-discovery-c1sfsxsr.js} +1 -1
- package/dist/chunks/{persistent-pty-nextbzqp.js → instruction-discovery-c4trrgtk.js} +4 -4
- package/dist/chunks/{persistent-pty-6w5ta17s.js → instruction-discovery-c778ygtz.js} +9 -9
- package/dist/chunks/{persistent-pty-6a334k2e.js → instruction-discovery-c7c8tg0t.js} +38 -38
- package/dist/chunks/{persistent-pty-c7cw818c.js → instruction-discovery-c7cw818c.js} +2 -2
- package/dist/chunks/{persistent-pty-6qm8pmbm.js → instruction-discovery-cfbg5xqr.js} +2 -2
- package/dist/chunks/{persistent-pty-n2a0zv08.js → instruction-discovery-cgfzjrj1.js} +2 -2
- package/dist/chunks/{persistent-pty-k732j073.js → instruction-discovery-crfddmzc.js} +8 -8
- package/dist/chunks/{persistent-pty-fxxxatdc.js → instruction-discovery-cwjpm71j.js} +32 -32
- package/dist/chunks/{persistent-pty-cwrgdav8.js → instruction-discovery-cwrgdav8.js} +2 -2
- package/dist/chunks/{persistent-pty-k822k1ne.js → instruction-discovery-cww6fxth.js} +15 -15
- package/dist/chunks/{persistent-pty-6edbc7zm.js → instruction-discovery-cxab28sr.js} +7 -7
- package/dist/chunks/{persistent-pty-bbbm1kqg.js → instruction-discovery-cy8my17p.js} +6 -6
- package/dist/chunks/instruction-discovery-d0qk8x1g.js +579 -0
- package/dist/chunks/{persistent-pty-9pdxmcf6.js → instruction-discovery-d2s54vh2.js} +7 -7
- package/dist/chunks/{persistent-pty-kvqpqygy.js → instruction-discovery-d3trzhn7.js} +44 -44
- package/dist/chunks/{persistent-pty-7ecvj7xx.js → instruction-discovery-d49ngaxv.js} +23 -23
- package/dist/chunks/{persistent-pty-d4v9tmah.js → instruction-discovery-d4v9tmah.js} +2 -2
- package/dist/chunks/{persistent-pty-d4rk8056.js → instruction-discovery-d6r1rrpz.js} +30 -30
- package/dist/chunks/instruction-discovery-d77dj7jw.js +18 -0
- package/dist/chunks/{persistent-pty-gjkwpsd8.js → instruction-discovery-dasdv6ax.js} +9 -9
- package/dist/chunks/{persistent-pty-v0p8fkzz.js → instruction-discovery-db7xqzv8.js} +2 -2
- package/dist/chunks/{persistent-pty-4epqmd1h.js → instruction-discovery-dbh7wv8t.js} +13 -13
- package/dist/chunks/{persistent-pty-qqsphv3g.js → instruction-discovery-df00vpge.js} +38 -38
- package/dist/chunks/{persistent-pty-jgat5a1s.js → instruction-discovery-dg2jnfxe.js} +27 -27
- package/dist/chunks/{persistent-pty-enyb2kw5.js → instruction-discovery-dp676nvg.js} +20 -20
- package/dist/chunks/{persistent-pty-641mgq21.js → instruction-discovery-dpa26g0y.js} +16 -16
- package/dist/chunks/{persistent-pty-v186fz10.js → instruction-discovery-dqr8k8k1.js} +11 -11
- package/dist/chunks/{persistent-pty-dt77769w.js → instruction-discovery-dt77769w.js} +1 -1
- package/dist/chunks/{persistent-pty-ce3n5tw7.js → instruction-discovery-e20m5vpy.js} +14 -14
- package/dist/chunks/{persistent-pty-dbvvr5ca.js → instruction-discovery-e2k92rxq.js} +22 -22
- package/dist/chunks/{persistent-pty-s8qkskz1.js → instruction-discovery-e4n07h02.js} +7 -7
- package/dist/chunks/{persistent-pty-qhyv5122.js → instruction-discovery-e97q27ja.js} +37 -33
- package/dist/chunks/{persistent-pty-530xg6vw.js → instruction-discovery-edm37t96.js} +6 -6
- package/dist/chunks/{persistent-pty-me0bf12n.js → instruction-discovery-eed8734c.js} +18 -18
- package/dist/chunks/{persistent-pty-eqw4pqj1.js → instruction-discovery-eqw4pqj1.js} +2 -2
- package/dist/chunks/{persistent-pty-80m5xgxj.js → instruction-discovery-etrnj9s7.js} +11 -11
- package/dist/chunks/{persistent-pty-910ch34w.js → instruction-discovery-f2bpz795.js} +17 -17
- package/dist/chunks/{persistent-pty-3x0shmrv.js → instruction-discovery-f3m66xst.js} +14 -14
- package/dist/chunks/{persistent-pty-w19fy49x.js → instruction-discovery-f4q6q9g7.js} +26 -26
- package/dist/chunks/{persistent-pty-p6stnjrt.js → instruction-discovery-f7s4spfm.js} +21 -21
- package/dist/chunks/{persistent-pty-j4zs9bxr.js → instruction-discovery-f8b8gmka.js} +27 -27
- package/dist/chunks/{persistent-pty-n7k76nxf.js → instruction-discovery-fad7ck4n.js} +20 -20
- package/dist/chunks/{persistent-pty-fg9p65nk.js → instruction-discovery-fg9p65nk.js} +2 -2
- package/dist/chunks/{persistent-pty-hpz6vwek.js → instruction-discovery-ftwtj193.js} +10 -8
- package/dist/chunks/{persistent-pty-sq0tbe5w.js → instruction-discovery-fwjn606w.js} +11 -11
- package/dist/chunks/{persistent-pty-fy27yj1t.js → instruction-discovery-fxqzc3wz.js} +12 -12
- package/dist/chunks/{persistent-pty-7arz4r0c.js → instruction-discovery-fyecaaqs.js} +16 -16
- package/dist/chunks/instruction-discovery-g50gdqzq.js +26 -0
- package/dist/chunks/{persistent-pty-q3dkjkk5.js → instruction-discovery-g72wprn0.js} +15 -15
- package/dist/chunks/{persistent-pty-rw4j4fc0.js → instruction-discovery-ga873zcx.js} +5 -5
- package/dist/chunks/{persistent-pty-gbjdnr5j.js → instruction-discovery-gbjdnr5j.js} +2 -2
- package/dist/chunks/{persistent-pty-xqf1esm3.js → instruction-discovery-gc2mx407.js} +19 -19
- package/dist/chunks/{persistent-pty-ghrv1g9c.js → instruction-discovery-ghrv1g9c.js} +1 -1
- package/dist/chunks/{persistent-pty-wgkargf7.js → instruction-discovery-gxg6ze57.js} +5 -5
- package/dist/chunks/{persistent-pty-tg7s7b5t.js → instruction-discovery-gxs71cxp.js} +4 -4
- package/dist/chunks/{persistent-pty-p5gdk4af.js → instruction-discovery-h09sgzzh.js} +3 -3
- package/dist/chunks/{persistent-pty-d60v4tfr.js → instruction-discovery-h100vy7q.js} +26 -26
- package/dist/chunks/{persistent-pty-txhfg7az.js → instruction-discovery-h38wmyv2.js} +29 -29
- package/dist/chunks/{persistent-pty-jxswh7p3.js → instruction-discovery-h8jsdbsf.js} +23 -23
- package/dist/chunks/{persistent-pty-6h8vcvjm.js → instruction-discovery-h91vm5r2.js} +9 -9
- package/dist/chunks/{persistent-pty-aa0xks2t.js → instruction-discovery-had7hjjk.js} +14 -14
- package/dist/chunks/{persistent-pty-mkavw0c0.js → instruction-discovery-hd6849p0.js} +11 -11
- package/dist/chunks/{persistent-pty-0wgvkt2x.js → instruction-discovery-hegmxvyf.js} +19 -19
- package/dist/chunks/{persistent-pty-s2am029e.js → instruction-discovery-hewrhn21.js} +23 -23
- package/dist/chunks/{persistent-pty-f5cd42r9.js → instruction-discovery-hfffyp2t.js} +19 -19
- package/dist/chunks/{persistent-pty-hgzwgvze.js → instruction-discovery-hgzwgvze.js} +2 -2
- package/dist/chunks/{persistent-pty-ta7amrd8.js → instruction-discovery-htp3v7c6.js} +8 -8
- package/dist/chunks/{persistent-pty-z89td5m9.js → instruction-discovery-hxey5wfe.js} +10 -10
- package/dist/chunks/{persistent-pty-dhnnehwj.js → instruction-discovery-hyfh4454.js} +5 -5
- package/dist/chunks/{persistent-pty-t3qxs7f5.js → instruction-discovery-j1j5a4cs.js} +11 -11
- package/dist/chunks/{persistent-pty-018pvm7c.js → instruction-discovery-j8cxwgns.js} +11 -11
- package/dist/chunks/{persistent-pty-23spy735.js → instruction-discovery-jc07kfqy.js} +38 -38
- package/dist/chunks/{persistent-pty-t5k0t6ys.js → instruction-discovery-jewn735m.js} +8 -8
- package/dist/chunks/{persistent-pty-j6g0vqez.js → instruction-discovery-jk3np0zg.js} +5 -5
- package/dist/chunks/{persistent-pty-vmxsyvj6.js → instruction-discovery-jkdcm5hg.js} +4 -4
- package/dist/chunks/{persistent-pty-jm70asfg.js → instruction-discovery-jm70asfg.js} +1 -1
- package/dist/chunks/{persistent-pty-mr12hyfn.js → instruction-discovery-jq989e3q.js} +10 -10
- package/dist/chunks/{persistent-pty-7snvzf9y.js → instruction-discovery-jqyrzb5z.js} +30 -30
- package/dist/chunks/{persistent-pty-jv5ccajn.js → instruction-discovery-jv5ccajn.js} +2 -2
- package/dist/chunks/{persistent-pty-x23x0wry.js → instruction-discovery-k03pwv3y.js} +2 -2
- package/dist/chunks/{persistent-pty-nn55eax9.js → instruction-discovery-k21bxb8h.js} +9 -9
- package/dist/chunks/{persistent-pty-0806n7cm.js → instruction-discovery-k9jm3edz.js} +19 -19
- package/dist/chunks/{persistent-pty-8xz27cp9.js → instruction-discovery-kbgs7tyr.js} +4 -4
- package/dist/chunks/{persistent-pty-vmqe41cb.js → instruction-discovery-kj9n5bvh.js} +4 -4
- package/dist/chunks/{persistent-pty-v07x4jg1.js → instruction-discovery-kkbhzqpn.js} +16 -16
- package/dist/chunks/{persistent-pty-kt3bjfbg.js → instruction-discovery-kt3bjfbg.js} +1 -1
- package/dist/chunks/{persistent-pty-nm0p4dxw.js → instruction-discovery-kvzqn3zd.js} +1 -1
- package/dist/chunks/{persistent-pty-kzczzf4v.js → instruction-discovery-kzczzf4v.js} +1 -1
- package/dist/chunks/{persistent-pty-m1714858.js → instruction-discovery-m1714858.js} +1 -1
- package/dist/chunks/{persistent-pty-8ydxba3r.js → instruction-discovery-m55fbe5c.js} +5 -5
- package/dist/chunks/{persistent-pty-0n28khqy.js → instruction-discovery-m5brqekz.js} +9 -9
- package/dist/chunks/{persistent-pty-m90tx7mw.js → instruction-discovery-m90tx7mw.js} +1 -1
- package/dist/chunks/{persistent-pty-m9w0rfyh.js → instruction-discovery-m9w0rfyh.js} +1 -1
- package/dist/chunks/{persistent-pty-hkwmenkt.js → instruction-discovery-ma610d6h.js} +6 -6
- package/dist/chunks/{persistent-pty-8z6m94af.js → instruction-discovery-mb7mbhnz.js} +3 -3
- package/dist/chunks/{persistent-pty-f598hcd5.js → instruction-discovery-mhjnrb9y.js} +10 -10
- package/dist/chunks/{persistent-pty-pfndqkpz.js → instruction-discovery-mhnsj6re.js} +28 -28
- package/dist/chunks/{persistent-pty-fzwn6aqp.js → instruction-discovery-mhs3my2j.js} +5 -5
- package/dist/chunks/{persistent-pty-9ddw59ht.js → instruction-discovery-mkej1b2m.js} +24 -24
- package/dist/chunks/{persistent-pty-nfdebbev.js → instruction-discovery-mppmbmfm.js} +12 -12
- package/dist/chunks/{persistent-pty-qxagq6p8.js → instruction-discovery-mqc7jytp.js} +9 -9
- package/dist/chunks/{persistent-pty-gfn6vbsv.js → instruction-discovery-mrb722ne.js} +28 -28
- package/dist/chunks/{persistent-pty-wrexcg9h.js → instruction-discovery-mteec8jy.js} +129 -82
- package/dist/chunks/{persistent-pty-mjeqg7zk.js → instruction-discovery-mv39kpx4.js} +21 -21
- package/dist/chunks/{persistent-pty-ra7b1vmx.js → instruction-discovery-myqgwh25.js} +52 -29
- package/dist/chunks/{persistent-pty-xvn8mnch.js → instruction-discovery-n320gsn2.js} +4 -4
- package/dist/chunks/{persistent-pty-e9hvxvkn.js → instruction-discovery-nag9kgj3.js} +45 -45
- package/dist/chunks/{persistent-pty-vmhkvkjy.js → instruction-discovery-nk4zbsjk.js} +5 -5
- package/dist/chunks/{persistent-pty-p9jvgf3w.js → instruction-discovery-nv9tsjma.js} +6 -6
- package/dist/chunks/{persistent-pty-fwp9mfc9.js → instruction-discovery-p76me67c.js} +4 -4
- package/dist/chunks/{persistent-pty-dt1mxvjw.js → instruction-discovery-p8v9r4cy.js} +5 -5
- package/dist/chunks/{persistent-pty-t62dywgn.js → instruction-discovery-p94p4v4n.js} +4 -4
- package/dist/chunks/{persistent-pty-2ft1psgd.js → instruction-discovery-pdpr5yq4.js} +13 -13
- package/dist/chunks/{persistent-pty-pknna89w.js → instruction-discovery-pknna89w.js} +1 -1
- package/dist/chunks/{persistent-pty-wb5wsb2j.js → instruction-discovery-pzbqcy5h.js} +10 -10
- package/dist/chunks/{persistent-pty-mv92c7a8.js → instruction-discovery-qbgm4r04.js} +35 -35
- package/dist/chunks/{persistent-pty-z748rwvz.js → instruction-discovery-qh55xb1q.js} +42 -42
- package/dist/chunks/{persistent-pty-mvnh7ykz.js → instruction-discovery-qnvtz2t2.js} +21 -15
- package/dist/chunks/{persistent-pty-bbwawm4r.js → instruction-discovery-qp2bqrv2.js} +4 -4
- package/dist/chunks/{persistent-pty-qp7r0hxv.js → instruction-discovery-qp7r0hxv.js} +1 -1
- package/dist/chunks/{persistent-pty-ft7hwc8g.js → instruction-discovery-qpyw4vs7.js} +5 -5
- package/dist/chunks/{persistent-pty-2n444ktb.js → instruction-discovery-qtf35215.js} +3 -3
- package/dist/chunks/{persistent-pty-v1hqtkt1.js → instruction-discovery-r1xq63dv.js} +3 -3
- package/dist/chunks/{persistent-pty-rb9dy4dg.js → instruction-discovery-rb9dy4dg.js} +1 -1
- package/dist/chunks/{persistent-pty-25ng7087.js → instruction-discovery-re298r9b.js} +54 -54
- package/dist/chunks/{persistent-pty-rgc9cx3e.js → instruction-discovery-rgc9cx3e.js} +2 -2
- package/dist/chunks/{persistent-pty-vt2d6wap.js → instruction-discovery-rj7j5fvs.js} +4 -4
- package/dist/chunks/{persistent-pty-0jx3paz9.js → instruction-discovery-rk6fefec.js} +28 -28
- package/dist/chunks/{persistent-pty-c1rvjqwp.js → instruction-discovery-rpp2kc73.js} +14 -14
- package/dist/chunks/{persistent-pty-x58n5ad0.js → instruction-discovery-rrt9n5y1.js} +20 -20
- package/dist/chunks/{persistent-pty-7xcsqsge.js → instruction-discovery-s32axedd.js} +5 -5
- package/dist/chunks/{persistent-pty-7taaxv95.js → instruction-discovery-sbwwra50.js} +4 -4
- package/dist/chunks/{persistent-pty-sbya78hr.js → instruction-discovery-sbya78hr.js} +1 -1
- package/dist/chunks/{persistent-pty-42gj811x.js → instruction-discovery-sf2g0dhx.js} +20 -20
- package/dist/chunks/{persistent-pty-avv30etj.js → instruction-discovery-shqxbeh8.js} +6 -6
- package/dist/chunks/{persistent-pty-y2w37hak.js → instruction-discovery-ss1xw8cf.js} +15 -15
- package/dist/chunks/instruction-discovery-sspx505g.js +819 -0
- package/dist/chunks/{persistent-pty-svcy3p9a.js → instruction-discovery-svcy3p9a.js} +1 -1
- package/dist/chunks/{persistent-pty-9f4njfb9.js → instruction-discovery-sxnf7z66.js} +21 -21
- package/dist/chunks/{persistent-pty-yph8mn9x.js → instruction-discovery-t5z530n0.js} +17 -17
- package/dist/chunks/instruction-discovery-tbbbsrjp.js +273 -0
- package/dist/chunks/{persistent-pty-tbpn7jtk.js → instruction-discovery-tbpn7jtk.js} +1 -1
- package/dist/chunks/{persistent-pty-tczq8hjw.js → instruction-discovery-tczq8hjw.js} +1 -1
- package/dist/chunks/{persistent-pty-3tf4v4ep.js → instruction-discovery-tfn15285.js} +18 -18
- package/dist/chunks/{persistent-pty-tdjfqr95.js → instruction-discovery-tqddkgfh.js} +21 -21
- package/dist/chunks/{persistent-pty-85m29sf4.js → instruction-discovery-tqjx2vg6.js} +23 -23
- package/dist/chunks/{persistent-pty-j376ae4e.js → instruction-discovery-tr8x705m.js} +5 -5
- package/dist/chunks/{persistent-pty-7r8842f6.js → instruction-discovery-tv99e7gw.js} +29 -28
- package/dist/chunks/{persistent-pty-tvtps2q9.js → instruction-discovery-tvtps2q9.js} +1 -1
- package/dist/chunks/{persistent-pty-twssxy5n.js → instruction-discovery-twssxy5n.js} +2 -2
- package/dist/chunks/{persistent-pty-v73g02es.js → instruction-discovery-tyyndmaj.js} +18 -18
- package/dist/chunks/{persistent-pty-pzy7y2j2.js → instruction-discovery-tzt99ah6.js} +21 -21
- package/dist/chunks/{persistent-pty-v2r1d0zg.js → instruction-discovery-v2r1d0zg.js} +1 -1
- package/dist/chunks/{persistent-pty-kad2wbhh.js → instruction-discovery-v304z5qp.js} +2 -2
- package/dist/chunks/{persistent-pty-ba5f9dy2.js → instruction-discovery-v4bj6baw.js} +4 -4
- package/dist/chunks/{persistent-pty-29kaqwyv.js → instruction-discovery-v4fnvjqa.js} +49 -49
- package/dist/chunks/{persistent-pty-yy55rm4m.js → instruction-discovery-v4me6kas.js} +17 -17
- package/dist/chunks/{persistent-pty-wgap4h5r.js → instruction-discovery-v9yvqqrp.js} +19 -19
- package/dist/chunks/{persistent-pty-qhbx12za.js → instruction-discovery-vba8q50y.js} +10 -10
- package/dist/chunks/{persistent-pty-80hpafj9.js → instruction-discovery-vggvrbn0.js} +7 -7
- package/dist/chunks/{persistent-pty-vjf35v1f.js → instruction-discovery-vjf35v1f.js} +1 -1
- package/dist/chunks/{persistent-pty-pg5jck48.js → instruction-discovery-vn6xermp.js} +15 -15
- package/dist/chunks/{persistent-pty-zzha20a8.js → instruction-discovery-vnt6tp0c.js} +36 -36
- package/dist/chunks/{persistent-pty-q69esqp1.js → instruction-discovery-vz94dcmp.js} +27 -27
- package/dist/chunks/{persistent-pty-ecb6c39z.js → instruction-discovery-w3dv62af.js} +7 -7
- package/dist/chunks/{persistent-pty-w3wsvvr9.js → instruction-discovery-w3wsvvr9.js} +1 -1
- package/dist/chunks/{persistent-pty-2xawt0y1.js → instruction-discovery-w4b7bwcc.js} +37 -37
- package/dist/chunks/{persistent-pty-twbmbqg9.js → instruction-discovery-w4enjgdf.js} +15 -15
- package/dist/chunks/{persistent-pty-fznmdakp.js → instruction-discovery-w687dnns.js} +4 -4
- package/dist/chunks/{persistent-pty-2kk794q2.js → instruction-discovery-w6hvype4.js} +41 -34
- package/dist/chunks/{persistent-pty-9q8g9sv8.js → instruction-discovery-w79nt68w.js} +4 -4
- package/dist/chunks/{persistent-pty-wakvkjy4.js → instruction-discovery-wakvkjy4.js} +1 -1
- package/dist/chunks/{persistent-pty-wd87259q.js → instruction-discovery-wd87259q.js} +1 -1
- package/dist/chunks/{persistent-pty-z513bby0.js → instruction-discovery-wd93ek5c.js} +14 -14
- package/dist/chunks/{persistent-pty-nx4vzyjd.js → instruction-discovery-wegkxhrn.js} +2 -2
- package/dist/chunks/{persistent-pty-teyezz5v.js → instruction-discovery-wtb6b8ak.js} +32 -32
- package/dist/chunks/{persistent-pty-6y2b864j.js → instruction-discovery-wvr8xscb.js} +4 -4
- package/dist/chunks/{persistent-pty-a3fn0gmm.js → instruction-discovery-x150ncgg.js} +2 -2
- package/dist/chunks/{persistent-pty-a77wsd01.js → instruction-discovery-x211k02e.js} +43 -43
- package/dist/chunks/{persistent-pty-9d52fs69.js → instruction-discovery-x52vwb3b.js} +5 -5
- package/dist/chunks/{persistent-pty-xacrkbdt.js → instruction-discovery-xacrkbdt.js} +1 -1
- package/dist/chunks/{persistent-pty-caem11c1.js → instruction-discovery-xd165rkg.js} +11 -11
- package/dist/chunks/{persistent-pty-9262x70e.js → instruction-discovery-xfssasxx.js} +18 -18
- package/dist/chunks/{persistent-pty-asjr210a.js → instruction-discovery-xt32eh7n.js} +18 -18
- package/dist/chunks/{persistent-pty-he60h9w2.js → instruction-discovery-xt9jkaz5.js} +16 -16
- package/dist/chunks/{persistent-pty-ppsbp1qn.js → instruction-discovery-xtm7eb3w.js} +15 -15
- package/dist/chunks/{persistent-pty-avt42cn0.js → instruction-discovery-xv0qa4h5.js} +17 -17
- package/dist/chunks/{persistent-pty-vaz51hez.js → instruction-discovery-xvgk7gyc.js} +3 -3
- package/dist/chunks/{persistent-pty-xjr6c8m4.js → instruction-discovery-xxschbft.js} +4 -4
- package/dist/chunks/{persistent-pty-t48jrnqq.js → instruction-discovery-y1n277rb.js} +3 -3
- package/dist/chunks/{persistent-pty-6s2jamp7.js → instruction-discovery-y4nwfrre.js} +19 -19
- package/dist/chunks/{persistent-pty-nnnffw0j.js → instruction-discovery-y660wfqf.js} +14 -14
- package/dist/chunks/{persistent-pty-1n1ng8zx.js → instruction-discovery-y7znp26y.js} +22 -22
- package/dist/chunks/{persistent-pty-yb20nhc3.js → instruction-discovery-yb20nhc3.js} +1 -1
- package/dist/chunks/{persistent-pty-7nb8tm12.js → instruction-discovery-yepd7x5v.js} +5 -5
- package/dist/chunks/{persistent-pty-fqp7nk4g.js → instruction-discovery-yf6pqjwa.js} +9 -9
- package/dist/chunks/{persistent-pty-4krr2nde.js → instruction-discovery-yk4ram99.js} +3 -3
- package/dist/chunks/{persistent-pty-yr705xyq.js → instruction-discovery-yr705xyq.js} +1 -1
- package/dist/chunks/{persistent-pty-js8n3d73.js → instruction-discovery-yrzzffpc.js} +13 -13
- package/dist/chunks/{persistent-pty-yvtc2x31.js → instruction-discovery-yvtc2x31.js} +1 -1
- package/dist/chunks/{persistent-pty-znnqj7m1.js → instruction-discovery-yx1qqaw2.js} +16 -16
- package/dist/chunks/{persistent-pty-wywdv46c.js → instruction-discovery-yx2k1m7z.js} +9 -9
- package/dist/chunks/{persistent-pty-6ddb8hxf.js → instruction-discovery-z23bdzz9.js} +33 -33
- package/dist/chunks/{persistent-pty-2dvjapqv.js → instruction-discovery-z90agx01.js} +29 -29
- package/dist/chunks/{persistent-pty-j9nxzz3g.js → instruction-discovery-ze75qvmd.js} +3 -3
- package/dist/chunks/{persistent-pty-7mrx0efj.js → instruction-discovery-zfnf49qv.js} +12 -12
- package/dist/chunks/{persistent-pty-y1y23t3y.js → instruction-discovery-zjf7xdar.js} +30 -30
- package/dist/chunks/{persistent-pty-h8s79my2.js → instruction-discovery-znyqp5km.js} +15 -15
- package/dist/chunks/{persistent-pty-by8ty0bx.js → instruction-discovery-zpdbqgja.js} +4 -4
- package/dist/chunks/{persistent-pty-hzpe7dhw.js → instruction-discovery-zsyf2zbn.js} +34 -34
- package/dist/chunks/{persistent-pty-a2pckt3d.js → instruction-discovery-zyt6d85k.js} +9 -9
- package/dist/chunks/{persistent-pty-2kgqety0.js → instruction-discovery-zywexr00.js} +2 -2
- package/dist/codemode/catalog.js +1 -1
- package/dist/codemode/execution.js +3 -3
- package/dist/codemode/fetch.js +149 -149
- package/dist/codemode/instructions.js +5 -5
- package/dist/codemode/tool.js +156 -156
- package/dist/command.js +92 -92
- package/dist/config/discovery.js +95 -95
- package/dist/config/integration.js +1 -1
- package/dist/config/managed.js +1 -1
- package/dist/config/markdown.js +1 -1
- package/dist/config/normalize.js +113 -113
- package/dist/config/plugin/agent.js +134 -134
- package/dist/config/plugin/command.js +245 -242
- package/dist/config/plugin/compaction.js +174 -174
- package/dist/config/plugin/compatibility.js +154 -154
- package/dist/config/plugin/entry-observer.js +1 -1
- package/dist/config/plugin/formatter.js +132 -132
- package/dist/config/plugin/image.js +131 -131
- package/dist/config/plugin/instruction.js +131 -131
- package/dist/config/plugin/location-watcher.js +131 -131
- package/dist/config/plugin/mcp.js +146 -146
- package/dist/config/plugin/policy.js +131 -131
- package/dist/config/plugin/provider.js +131 -131
- package/dist/config/plugin/reference.js +133 -133
- package/dist/config/plugin/shell.js +133 -133
- package/dist/config/plugin/skill-file.js +150 -150
- package/dist/config/plugin/skill-scan.js +1 -1
- package/dist/config/plugin/skill.js +157 -157
- package/dist/config/plugin/snapshot.js +131 -131
- package/dist/config/plugin/source.js +135 -135
- package/dist/config/plugin/tool-output.js +132 -132
- package/dist/config/plugin/websearch.js +132 -132
- package/dist/config/plugin/worktree.js +133 -133
- package/dist/config/variable.js +1 -1
- package/dist/config/watch.js +1 -1
- package/dist/config.js +130 -130
- package/dist/console-access.js +1 -1
- package/dist/credential/sql.js +2 -2
- package/dist/credential.js +94 -94
- package/dist/database/batch.js +1 -1
- package/dist/database/database.js +77 -77
- 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/20261007190000_azure_cli_external_credential.js +1 -1
- package/dist/database/migration/20261010180456_project_time_archived.js +1 -1
- package/dist/database/migration/20261024002554_session_allowance.js +1 -1
- package/dist/database/migration/20261024175301_drop_session_allowance.js +1 -1
- package/dist/database/migration/20261025123711_blob.js +1 -1
- package/dist/database/migration/20261025154125_drop_session_pending.js +1 -1
- package/dist/database/migration/20261026223005_schedule.js +1 -1
- package/dist/database/migration/20261029002625_session_part.js +1 -1
- package/dist/database/migration/20261029073502_session_time_busy.js +1 -1
- package/dist/database/migration/20261029165540_schedule_checks.js +1 -1
- package/dist/database/migration/20261030054400_job.js +1 -1
- package/dist/database/migration.gen.js +60 -60
- package/dist/database/migration.js +76 -76
- 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/v1-migration.bun.js +105 -105
- package/dist/effect/app-node-builder.js +442 -442
- 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 +105 -105
- package/dist/environment/exec-defaults.js +2 -2
- package/dist/environment/files.js +1 -1
- package/dist/environment/index.js +108 -108
- package/dist/environment/local.js +2 -2
- package/dist/environment/memory.js +2 -2
- package/dist/environment/unavailable.js +3 -3
- package/dist/event/sql.js +1 -1
- package/dist/event-logger.js +81 -81
- package/dist/file-access.js +161 -161
- package/dist/file-mutation.js +108 -108
- package/dist/file-retention.js +1 -1
- package/dist/file-write.js +165 -165
- 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/file-watch.js +88 -88
- package/dist/filesystem/location-watcher-policy.js +6 -6
- package/dist/filesystem/location-watcher.js +253 -253
- package/dist/filesystem/protected.js +1 -1
- package/dist/filesystem/search.js +113 -113
- package/dist/filesystem/watcher-binding.js +1 -1
- package/dist/filesystem/watcher.js +7 -7
- package/dist/filesystem.js +116 -116
- package/dist/flag.js +132 -132
- package/dist/form.js +81 -81
- package/dist/formatter/builtins.js +4 -4
- package/dist/formatter.js +100 -100
- package/dist/generate.js +123 -123
- package/dist/git.js +11 -11
- package/dist/github-copilot/models.js +113 -113
- package/dist/image/notice.js +1 -1
- package/dist/image/photon-normalize.js +1 -1
- package/dist/image/photon-worker.js +1 -1
- package/dist/image/photon.js +4 -4
- package/dist/image.js +6 -6
- package/dist/instance/service.js +5 -5
- package/dist/instance.js +433 -433
- package/dist/instruction-discovery.js +95 -95
- package/dist/instructions/builtins.js +100 -100
- package/dist/instructions/index.js +3 -3
- package/dist/integration/connection.js +3 -3
- package/dist/integration.js +98 -98
- package/dist/job/list.js +5 -5
- package/dist/job/recovery.js +2 -2
- package/dist/job/sql.js +2 -2
- package/dist/job.js +88 -88
- package/dist/kv/sql.js +2 -2
- package/dist/kv.js +84 -84
- package/dist/location-activity.js +183 -183
- package/dist/location-lifecycle.js +154 -154
- package/dist/location-service-map.js +99 -99
- package/dist/location-services.js +430 -430
- package/dist/location.js +100 -100
- package/dist/managed-policy.js +3 -3
- package/dist/mcp/client.js +159 -159
- package/dist/mcp/connection.js +106 -106
- package/dist/mcp/index.js +120 -120
- package/dist/mcp/instructions.js +190 -190
- package/dist/mcp/oauth.js +89 -89
- package/dist/mcp/pool.js +112 -112
- package/dist/mcp/socket-client.js +1 -1
- package/dist/mcp/stdio.js +158 -158
- package/dist/mime.js +1 -1
- package/dist/modal/models.js +113 -113
- package/dist/model-resolver.js +113 -113
- package/dist/model-retry.js +1 -1
- package/dist/model.js +110 -110
- package/dist/models-dev/v1.js +1 -1
- package/dist/models-dev.js +118 -118
- package/dist/oauth/page.js +1 -1
- package/dist/permission/saved.js +89 -89
- package/dist/permission/sql.js +5 -5
- package/dist/permission.js +147 -147
- package/dist/persistent-pty/binary.bun.js +1 -1
- package/dist/persistent-pty/daemon.js +1 -1
- package/dist/persistent-pty/index.js +101 -101
- package/dist/persistent-pty/pty-binding.js +1 -1
- package/dist/persistent-pty.js +86 -86
- package/dist/plugin/agent.js +87 -87
- package/dist/plugin/command.js +119 -119
- package/dist/plugin/goal.js +3 -3
- package/dist/plugin/hooks.js +1 -1
- package/dist/plugin/host.js +246 -246
- package/dist/plugin/identity.js +5 -5
- package/dist/plugin/instance.js +5 -5
- package/dist/plugin/internal.js +411 -411
- package/dist/plugin/mcp-codemode-defaults.js +3 -3
- package/dist/plugin/models-dev.js +111 -111
- package/dist/plugin/module.js +128 -128
- package/dist/plugin/optimize.js +2 -2
- package/dist/plugin/plan.js +148 -148
- package/dist/plugin/promise.js +1 -1
- package/dist/plugin/provider/amazon-bedrock.js +107 -107
- package/dist/plugin/provider/azure.js +132 -132
- package/dist/plugin/provider/cerebras.js +1 -1
- package/dist/plugin/provider/chatgpt.js +134 -134
- package/dist/plugin/provider/claude-agent/aisdk.js +118 -118
- package/dist/plugin/provider/claude-agent/claude/fork.js +2 -2
- package/dist/plugin/provider/claude-agent/claude/io.js +4 -4
- package/dist/plugin/provider/claude-agent/claude/probe.js +2 -2
- package/dist/plugin/provider/claude-agent/claude/query-options.js +4 -4
- package/dist/plugin/provider/claude-agent/claude/sdk.js +3 -3
- package/dist/plugin/provider/claude-agent/claude/session.js +4 -4
- package/dist/plugin/provider/claude-agent/claude/sessions.js +16 -16
- package/dist/plugin/provider/claude-agent/claude/status.js +7 -7
- package/dist/plugin/provider/claude-agent/index.js +147 -147
- package/dist/plugin/provider/claude-agent/instructions.js +115 -115
- package/dist/plugin/provider/claude-agent/integration.js +116 -116
- package/dist/plugin/provider/claude-agent/language-model/claude-agent-error.js +1 -1
- package/dist/plugin/provider/claude-agent/language-model/claude-agent-language-model.js +7 -7
- package/dist/plugin/provider/claude-agent/language-model/convert-claude-stream.js +4 -4
- package/dist/plugin/provider/claude-agent/language-model/convert-to-claude-message.js +1 -1
- package/dist/plugin/provider/claude-agent/language-model/request-kind.js +1 -1
- package/dist/plugin/provider/claude-agent/language-model/system-prompt.js +3 -3
- package/dist/plugin/provider/claude-agent/language-model/usage.js +3 -3
- package/dist/plugin/provider/claude-agent/provider.js +111 -111
- package/dist/plugin/provider/claude-agent/session.js +113 -113
- package/dist/plugin/provider/claude-agent/sync/catch-up.js +3 -3
- package/dist/plugin/provider/claude-agent/sync/checkpoints.js +2 -2
- package/dist/plugin/provider/claude-agent/sync/decide.js +2 -2
- package/dist/plugin/provider/claude-agent/sync/fingerprint.js +1 -1
- package/dist/plugin/provider/claude-agent/sync/record.js +3 -3
- package/dist/plugin/provider/claude-agent/tools/hooks.js +3 -3
- package/dist/plugin/provider/claude-agent/tools/names.js +3 -3
- package/dist/plugin/provider/claude-agent/tools/pending.js +3 -3
- package/dist/plugin/provider/claude-agent/tools/result.js +3 -3
- package/dist/plugin/provider/claude-agent/tools/server.js +4 -4
- package/dist/plugin/provider/cloudflare-ai-gateway.js +131 -131
- package/dist/plugin/provider/cloudflare-workers-ai.js +131 -131
- package/dist/plugin/provider/configured.js +127 -127
- package/dist/plugin/provider/credential-settings.js +88 -88
- package/dist/plugin/provider/databricks.js +1 -1
- package/dist/plugin/provider/digitalocean.js +110 -110
- package/dist/plugin/provider/dynamic.js +2 -2
- package/dist/plugin/provider/github-copilot.js +112 -112
- package/dist/plugin/provider/gitlab.js +110 -110
- package/dist/plugin/provider/google-vertex.js +128 -128
- package/dist/plugin/provider/kilo.js +1 -1
- package/dist/plugin/provider/llmgateway.js +89 -89
- package/dist/plugin/provider/lmstudio.js +139 -139
- package/dist/plugin/provider/local.js +138 -138
- package/dist/plugin/provider/modal.js +109 -109
- package/dist/plugin/provider/neon.js +1 -1
- package/dist/plugin/provider/nvidia.js +1 -1
- package/dist/plugin/provider/ollama.js +139 -139
- package/dist/plugin/provider/openai-context-caps.js +107 -107
- package/dist/plugin/provider/openai.js +134 -134
- package/dist/plugin/provider/opencode-watches.js +4 -4
- package/dist/plugin/provider/opencode.js +162 -162
- package/dist/plugin/provider/openrouter.js +105 -105
- package/dist/plugin/provider/poe.js +90 -90
- package/dist/plugin/provider/prompt-cache-key.js +1 -1
- package/dist/plugin/provider/refresh.js +87 -87
- package/dist/plugin/provider/sap-ai-core.js +105 -105
- package/dist/plugin/provider/sdk-factory.js +1 -1
- package/dist/plugin/provider/snowflake-cortex.js +132 -132
- package/dist/plugin/provider/vllm.js +141 -141
- package/dist/plugin/provider/xai.js +105 -105
- package/dist/plugin/provider/zenmux.js +1 -1
- package/dist/plugin/provider.js +240 -240
- package/dist/plugin/sdk.js +87 -87
- package/dist/plugin/service.js +3 -3
- package/dist/plugin/skill.js +151 -151
- package/dist/plugin/source-directory.js +1 -1
- package/dist/plugin/supervisor.js +421 -421
- package/dist/plugin/tool-input-repair.js +2 -2
- package/dist/plugin/update.js +4 -4
- package/dist/plugin/vcs/git.js +99 -99
- package/dist/plugin/vcs/hg.js +97 -97
- package/dist/plugin/verbosity.js +107 -107
- package/dist/plugin/warming.js +129 -129
- package/dist/plugin/websearch/exa.js +8 -8
- package/dist/plugin/websearch/firecrawl.js +7 -7
- package/dist/plugin/websearch/index.js +10 -10
- package/dist/plugin/websearch/mcp.js +6 -6
- package/dist/plugin/websearch/parallel.js +7 -7
- package/dist/plugin/websearch/provider.js +3 -3
- package/dist/plugin/websearch/tavily.js +7 -7
- package/dist/plugin/websearch/tinyfish.js +9 -9
- package/dist/plugin.js +253 -253
- package/dist/project/icon.js +5 -5
- package/dist/project/schema.js +8 -8
- package/dist/project/sql.js +4 -4
- package/dist/project.js +101 -101
- package/dist/provider.js +113 -113
- package/dist/pty/protocol.js +1 -1
- package/dist/pty/ticket.js +1 -1
- package/dist/pty.js +109 -109
- package/dist/reference/instructions.js +101 -101
- package/dist/reference.js +101 -101
- package/dist/repository-cache.js +93 -93
- package/dist/repository.js +1 -1
- package/dist/ripgrep/binary.js +2 -2
- package/dist/ripgrep.js +111 -111
- package/dist/rpc.js +99 -99
- package/dist/schedule/check.js +251 -251
- package/dist/schedule/sql.js +6 -6
- package/dist/schedule.js +265 -265
- package/dist/schema.js +1 -1
- package/dist/session/affinity.js +1 -1
- package/dist/session/background.js +3 -3
- package/dist/session/blob.js +133 -133
- package/dist/session/command.js +85 -85
- package/dist/session/compaction.js +174 -174
- package/dist/session/context.js +204 -204
- package/dist/session/diff.js +101 -101
- 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 +354 -254
- package/dist/session/execution.js +170 -170
- package/dist/session/generate.js +208 -208
- package/dist/session/history.js +140 -140
- package/dist/session/inbox.js +149 -149
- package/dist/session/info.js +3 -3
- package/dist/session/instruction-entry.js +88 -88
- package/dist/session/instruction-state.js +8 -8
- package/dist/session/instructions.js +147 -147
- package/dist/session/message-updater.js +2 -2
- package/dist/session/message.js +1 -1
- package/dist/session/model-request.js +172 -172
- package/dist/session/model-transport.js +9 -9
- package/dist/session/move.js +172 -172
- package/dist/session/projector.js +147 -147
- package/dist/session/prompt.js +152 -152
- package/dist/session/recent-text.js +1 -1
- package/dist/session/revert.js +143 -143
- package/dist/session/run-coordinator.js +3 -3
- package/dist/session/runner/index.js +3 -3
- package/dist/session/runner/llm.js +259 -259
- package/dist/session/runner/max-steps.js +1 -1
- package/dist/session/runner/model.js +115 -115
- package/dist/session/runner/publish-llm-event.js +154 -154
- package/dist/session/runner/retry.js +3 -3
- package/dist/session/runner/step.js +169 -167
- package/dist/session/runner/to-llm-message.js +141 -141
- package/dist/session/schema.js +5 -5
- package/dist/session/session.js +192 -189
- package/dist/session/shell.js +149 -146
- package/dist/session/skill.js +151 -151
- package/dist/session/sql.js +5 -5
- package/dist/session/stats.js +85 -85
- package/dist/session/store.js +146 -146
- package/dist/session/stored.js +2 -2
- package/dist/session/subagent-completion.js +1 -1
- package/dist/session/subagent-job.js +242 -239
- package/dist/session/system-prompt.js +3 -3
- package/dist/session/title.js +210 -210
- package/dist/session/to-session-error.js +153 -153
- package/dist/session/transfer.js +252 -249
- package/dist/session/usage.js +1 -1
- package/dist/session.js +246 -243
- package/dist/shared-cache.js +5 -5
- package/dist/shell/parse.js +6 -6
- package/dist/shell/result.js +1 -1
- package/dist/shell/scan.js +1 -1
- package/dist/shell/select.js +11 -11
- package/dist/shell.js +157 -148
- package/dist/skill/discovery.js +2 -2
- package/dist/skill/instructions.js +153 -153
- package/dist/skill.js +160 -160
- package/dist/snapshot.js +106 -106
- 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 +189 -189
- package/dist/tool/plugin/artifact.js +241 -238
- package/dist/tool/plugin/edit.js +171 -171
- package/dist/tool/plugin/file-diff.js +1 -1
- package/dist/tool/plugin/glob.js +175 -175
- package/dist/tool/plugin/grep.js +170 -170
- package/dist/tool/plugin/image-generate.js +250 -247
- package/dist/tool/plugin/mcp-resource.js +170 -170
- package/dist/tool/plugin/opencode.js +167 -167
- package/dist/tool/plugin/patch.js +168 -168
- package/dist/tool/plugin/question.js +150 -150
- package/dist/tool/plugin/read.js +174 -174
- package/dist/tool/plugin/schedule.js +257 -257
- package/dist/tool/plugin/shell.js +249 -242
- package/dist/tool/plugin/skill.js +159 -159
- package/dist/tool/plugin/subagent.js +249 -246
- package/dist/tool/plugin/todo.js +157 -157
- package/dist/tool/plugin/webfetch.js +161 -161
- package/dist/tool/plugin/websearch.js +159 -159
- package/dist/tool/plugin/write.js +172 -172
- package/dist/tool/read-filesystem.js +116 -116
- package/dist/tool/runtime.js +1 -1
- package/dist/tool/search.js +109 -109
- package/dist/tool-output.js +7 -7
- package/dist/tool.js +164 -164
- package/dist/types/codemode/tool.d.ts +3 -0
- package/dist/types/github-copilot/models.d.ts +1 -0
- package/dist/types/job.d.ts +1 -0
- package/dist/types/model.d.ts +3 -0
- package/dist/types/persistent-pty/index.d.ts +5 -0
- package/dist/types/plugin/host.d.ts +2 -2
- package/dist/types/plugin/internal.d.ts +1 -1
- package/dist/types/session/execution/restart.d.ts +4 -2
- package/dist/types/session/runner/llm.d.ts +2 -1
- package/dist/types/session/runner/step.d.ts +10 -0
- package/dist/types/shell/result.d.ts +6 -1
- package/dist/types/shell.d.ts +69 -4
- package/dist/types/tool/plugin/shell.d.ts +32 -2
- package/dist/usage-limits.js +100 -100
- package/dist/util/error-summary.js +1 -1
- package/dist/util/git-executable.js +3 -3
- 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 +7 -7
- package/dist/v1/config/command.js +3 -3
- package/dist/v1/config/mcp.js +2 -2
- package/dist/v1/config/migrate.js +106 -106
- package/dist/v1/config/permission.js +3 -3
- package/dist/v1/config/plugin.js +1 -1
- package/dist/v1/config/provider-options.js +1 -1
- package/dist/v1/config/provider.js +4 -4
- package/dist/variant.js +105 -105
- package/dist/vcs/patch.js +1 -1
- package/dist/vcs.js +102 -102
- package/dist/voice.js +101 -101
- package/dist/websearch.js +89 -89
- package/dist/wellknown/plugin.js +85 -85
- package/dist/wellknown.js +90 -90
- package/dist/workspace/driver.js +5 -5
- package/dist/workspace/sql.js +1 -1
- package/dist/workspace.js +87 -87
- package/dist/worktree/directory.js +2 -2
- package/dist/worktree/git.js +11 -11
- package/dist/worktree/sql.js +5 -5
- package/dist/worktree/strategies.js +102 -102
- package/dist/worktree.js +113 -113
- package/package.json +8 -8
- package/dist/chunks/persistent-pty-7yv5xa0k.js +0 -18
- package/dist/chunks/persistent-pty-8b48q1nb.js +0 -577
- package/dist/chunks/persistent-pty-mwqan0d7.js +0 -433
- package/dist/chunks/persistent-pty-q1mqkmnx.js +0 -273
- package/dist/chunks/persistent-pty-y97mqv4w.js +0 -26
- /package/dist/chunks/{persistent-pty-0qkdqm5v.js → instruction-discovery-0qkdqm5v.js} +0 -0
- /package/dist/chunks/{persistent-pty-0zkw76rk.js → instruction-discovery-0zkw76rk.js} +0 -0
- /package/dist/chunks/{persistent-pty-17cy0kzp.js → instruction-discovery-17cy0kzp.js} +0 -0
- /package/dist/chunks/{persistent-pty-1cnp2v09.js → instruction-discovery-1cnp2v09.js} +0 -0
- /package/dist/chunks/{persistent-pty-1kah00gy.js → instruction-discovery-1kah00gy.js} +0 -0
- /package/dist/chunks/{persistent-pty-24dcb14g.js → instruction-discovery-24dcb14g.js} +0 -0
- /package/dist/chunks/{persistent-pty-2710q6r3.js → instruction-discovery-2710q6r3.js} +0 -0
- /package/dist/chunks/{persistent-pty-2c3vjs8z.js → instruction-discovery-2c3vjs8z.js} +0 -0
- /package/dist/chunks/{persistent-pty-359p4xyc.js → instruction-discovery-359p4xyc.js} +0 -0
- /package/dist/chunks/{persistent-pty-3v8g72cx.js → instruction-discovery-3v8g72cx.js} +0 -0
- /package/dist/chunks/{persistent-pty-43n2bw4t.js → instruction-discovery-43n2bw4t.js} +0 -0
- /package/dist/chunks/{persistent-pty-4knz6hnm.js → instruction-discovery-4knz6hnm.js} +0 -0
- /package/dist/chunks/{persistent-pty-4qk9sjk2.js → instruction-discovery-4qk9sjk2.js} +0 -0
- /package/dist/chunks/{persistent-pty-53557ph1.js → instruction-discovery-53557ph1.js} +0 -0
- /package/dist/chunks/{persistent-pty-5w3e23ze.js → instruction-discovery-5w3e23ze.js} +0 -0
- /package/dist/chunks/{persistent-pty-6agm2x70.js → instruction-discovery-6agm2x70.js} +0 -0
- /package/dist/chunks/{persistent-pty-6prwharc.js → instruction-discovery-6prwharc.js} +0 -0
- /package/dist/chunks/{persistent-pty-6q2bdcd1.js → instruction-discovery-6q2bdcd1.js} +0 -0
- /package/dist/chunks/{persistent-pty-7akdwqpd.js → instruction-discovery-7akdwqpd.js} +0 -0
- /package/dist/chunks/{persistent-pty-7m9af43g.js → instruction-discovery-7m9af43g.js} +0 -0
- /package/dist/chunks/{persistent-pty-822emrt2.js → instruction-discovery-822emrt2.js} +0 -0
- /package/dist/chunks/{persistent-pty-84wd9syh.js → instruction-discovery-84wd9syh.js} +0 -0
- /package/dist/chunks/{persistent-pty-88xbtdfr.js → instruction-discovery-88xbtdfr.js} +0 -0
- /package/dist/chunks/{persistent-pty-8n3pysct.js → instruction-discovery-8n3pysct.js} +0 -0
- /package/dist/chunks/{persistent-pty-8wj87zfr.js → instruction-discovery-8wj87zfr.js} +0 -0
- /package/dist/chunks/{persistent-pty-9a4afbnw.js → instruction-discovery-9a4afbnw.js} +0 -0
- /package/dist/chunks/{persistent-pty-9rqn6x4v.js → instruction-discovery-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{persistent-pty-aqzs7mqg.js → instruction-discovery-aqzs7mqg.js} +0 -0
- /package/dist/chunks/{persistent-pty-atq7p7m5.js → instruction-discovery-atq7p7m5.js} +0 -0
- /package/dist/chunks/{persistent-pty-beh6qq61.js → instruction-discovery-beh6qq61.js} +0 -0
- /package/dist/chunks/{persistent-pty-bkyjaxrp.js → instruction-discovery-bkyjaxrp.js} +0 -0
- /package/dist/chunks/{persistent-pty-bmr6ed5q.js → instruction-discovery-bmr6ed5q.js} +0 -0
- /package/dist/chunks/{persistent-pty-cf4snx6d.js → instruction-discovery-cf4snx6d.js} +0 -0
- /package/dist/chunks/{persistent-pty-cqv5kn06.js → instruction-discovery-cqv5kn06.js} +0 -0
- /package/dist/chunks/{persistent-pty-cvy3z8tj.js → instruction-discovery-cvy3z8tj.js} +0 -0
- /package/dist/chunks/{persistent-pty-d9fn303g.js → instruction-discovery-d9fn303g.js} +0 -0
- /package/dist/chunks/{persistent-pty-d9jj8t3e.js → instruction-discovery-d9jj8t3e.js} +0 -0
- /package/dist/chunks/{persistent-pty-df08tz66.js → instruction-discovery-df08tz66.js} +0 -0
- /package/dist/chunks/{persistent-pty-dy18nga0.js → instruction-discovery-dy18nga0.js} +0 -0
- /package/dist/chunks/{persistent-pty-e5kj55wp.js → instruction-discovery-e5kj55wp.js} +0 -0
- /package/dist/chunks/{persistent-pty-ean2d8b5.js → instruction-discovery-ean2d8b5.js} +0 -0
- /package/dist/chunks/{persistent-pty-ec1grn59.js → instruction-discovery-ec1grn59.js} +0 -0
- /package/dist/chunks/{persistent-pty-emrn6kk6.js → instruction-discovery-emrn6kk6.js} +0 -0
- /package/dist/chunks/{persistent-pty-f0mxakyp.js → instruction-discovery-f0mxakyp.js} +0 -0
- /package/dist/chunks/{persistent-pty-f6n9ztr4.js → instruction-discovery-f6n9ztr4.js} +0 -0
- /package/dist/chunks/{persistent-pty-faypxj3z.js → instruction-discovery-faypxj3z.js} +0 -0
- /package/dist/chunks/{persistent-pty-fd410y7t.js → instruction-discovery-fd410y7t.js} +0 -0
- /package/dist/chunks/{persistent-pty-fkpq3x5p.js → instruction-discovery-fkpq3x5p.js} +0 -0
- /package/dist/chunks/{persistent-pty-g86h250q.js → instruction-discovery-g86h250q.js} +0 -0
- /package/dist/chunks/{persistent-pty-gebd4c9n.js → instruction-discovery-gebd4c9n.js} +0 -0
- /package/dist/chunks/{persistent-pty-gftt206x.js → instruction-discovery-gftt206x.js} +0 -0
- /package/dist/chunks/{persistent-pty-hcxmzztb.js → instruction-discovery-hcxmzztb.js} +0 -0
- /package/dist/chunks/{persistent-pty-hk9envan.js → instruction-discovery-hk9envan.js} +0 -0
- /package/dist/chunks/{persistent-pty-j2ntwpah.js → instruction-discovery-j2ntwpah.js} +0 -0
- /package/dist/chunks/{persistent-pty-jjkms2e6.js → instruction-discovery-jjkms2e6.js} +0 -0
- /package/dist/chunks/{persistent-pty-jr7sbwjy.js → instruction-discovery-jr7sbwjy.js} +0 -0
- /package/dist/chunks/{persistent-pty-jwfs4k6c.js → instruction-discovery-jwfs4k6c.js} +0 -0
- /package/dist/chunks/{persistent-pty-jwr30sdr.js → instruction-discovery-jwr30sdr.js} +0 -0
- /package/dist/chunks/{persistent-pty-jzg6c2d5.js → instruction-discovery-jzg6c2d5.js} +0 -0
- /package/dist/chunks/{persistent-pty-m18g726c.js → instruction-discovery-m18g726c.js} +0 -0
- /package/dist/chunks/{persistent-pty-mp448xyj.js → instruction-discovery-mp448xyj.js} +0 -0
- /package/dist/chunks/{persistent-pty-msx8hqn2.js → instruction-discovery-msx8hqn2.js} +0 -0
- /package/dist/chunks/{persistent-pty-n05xt0ee.js → instruction-discovery-n05xt0ee.js} +0 -0
- /package/dist/chunks/{persistent-pty-n3j8tn72.js → instruction-discovery-n3j8tn72.js} +0 -0
- /package/dist/chunks/{persistent-pty-nh4v3znn.js → instruction-discovery-nh4v3znn.js} +0 -0
- /package/dist/chunks/{persistent-pty-njntx4h6.js → instruction-discovery-njntx4h6.js} +0 -0
- /package/dist/chunks/{persistent-pty-p71gwv9c.js → instruction-discovery-p71gwv9c.js} +0 -0
- /package/dist/chunks/{persistent-pty-q3sfg36h.js → instruction-discovery-q3sfg36h.js} +0 -0
- /package/dist/chunks/{persistent-pty-q74kybfr.js → instruction-discovery-q74kybfr.js} +0 -0
- /package/dist/chunks/{persistent-pty-qb87gjwd.js → instruction-discovery-qb87gjwd.js} +0 -0
- /package/dist/chunks/{persistent-pty-qfa1cgps.js → instruction-discovery-qfa1cgps.js} +0 -0
- /package/dist/chunks/{persistent-pty-qg3g05ea.js → instruction-discovery-qg3g05ea.js} +0 -0
- /package/dist/chunks/{persistent-pty-qrg20bc0.js → instruction-discovery-qrg20bc0.js} +0 -0
- /package/dist/chunks/{persistent-pty-rcb2kzg1.js → instruction-discovery-rcb2kzg1.js} +0 -0
- /package/dist/chunks/{persistent-pty-sdp7kfr6.js → instruction-discovery-sdp7kfr6.js} +0 -0
- /package/dist/chunks/{persistent-pty-ssg3fenm.js → instruction-discovery-ssg3fenm.js} +0 -0
- /package/dist/chunks/{persistent-pty-syrav9an.js → instruction-discovery-syrav9an.js} +0 -0
- /package/dist/chunks/{persistent-pty-t03h4f5z.js → instruction-discovery-t03h4f5z.js} +0 -0
- /package/dist/chunks/{persistent-pty-ty7weeps.js → instruction-discovery-ty7weeps.js} +0 -0
- /package/dist/chunks/{persistent-pty-v2dnd5dt.js → instruction-discovery-v2dnd5dt.js} +0 -0
- /package/dist/chunks/{persistent-pty-ve7vex1e.js → instruction-discovery-ve7vex1e.js} +0 -0
- /package/dist/chunks/{persistent-pty-vtarvj67.js → instruction-discovery-vtarvj67.js} +0 -0
- /package/dist/chunks/{persistent-pty-w803qqfp.js → instruction-discovery-w803qqfp.js} +0 -0
- /package/dist/chunks/{persistent-pty-wc3fc9cn.js → instruction-discovery-wc3fc9cn.js} +0 -0
- /package/dist/chunks/{persistent-pty-wer8tq1h.js → instruction-discovery-wer8tq1h.js} +0 -0
- /package/dist/chunks/{persistent-pty-wtztk69x.js → instruction-discovery-wtztk69x.js} +0 -0
- /package/dist/chunks/{persistent-pty-x4th4bpe.js → instruction-discovery-x4th4bpe.js} +0 -0
- /package/dist/chunks/{persistent-pty-y44na4kk.js → instruction-discovery-y44na4kk.js} +0 -0
- /package/dist/chunks/{persistent-pty-y8f7s663.js → instruction-discovery-y8f7s663.js} +0 -0
- /package/dist/chunks/{persistent-pty-ygaqb7jw.js → instruction-discovery-ygaqb7jw.js} +0 -0
- /package/dist/chunks/{persistent-pty-z5v4ffb3.js → instruction-discovery-z5v4ffb3.js} +0 -0
- /package/dist/chunks/{persistent-pty-z9919s4g.js → instruction-discovery-z9919s4g.js} +0 -0
- /package/dist/chunks/{persistent-pty-zxpyjp51.js → instruction-discovery-zxpyjp51.js} +0 -0
- /package/dist/chunks/{persistent-pty-zz5vv3aq.js → instruction-discovery-zz5vv3aq.js} +0 -0
|
@@ -0,0 +1,819 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Service93,
|
|
3
|
+
node95
|
|
4
|
+
} from "./instruction-discovery-9k5sz97t.js";
|
|
5
|
+
import {
|
|
6
|
+
Ref5,
|
|
7
|
+
Service90,
|
|
8
|
+
node92
|
|
9
|
+
} from "./instruction-discovery-fyecaaqs.js";
|
|
10
|
+
import {
|
|
11
|
+
Service66,
|
|
12
|
+
node68
|
|
13
|
+
} from "./instruction-discovery-fad7ck4n.js";
|
|
14
|
+
import {
|
|
15
|
+
cleanup3
|
|
16
|
+
} from "./instruction-discovery-tczq8hjw.js";
|
|
17
|
+
import {
|
|
18
|
+
Service53,
|
|
19
|
+
args2,
|
|
20
|
+
node55
|
|
21
|
+
} from "./instruction-discovery-ss1xw8cf.js";
|
|
22
|
+
import {
|
|
23
|
+
Service45,
|
|
24
|
+
node48,
|
|
25
|
+
available3
|
|
26
|
+
} from "./instruction-discovery-58bqby8s.js";
|
|
27
|
+
import {
|
|
28
|
+
Service77,
|
|
29
|
+
node79
|
|
30
|
+
} from "./instruction-discovery-c1sfsxsr.js";
|
|
31
|
+
import {
|
|
32
|
+
Service44,
|
|
33
|
+
node47
|
|
34
|
+
} from "./instruction-discovery-crfddmzc.js";
|
|
35
|
+
import {
|
|
36
|
+
SessionSchema2
|
|
37
|
+
} from "./instruction-discovery-qtf35215.js";
|
|
38
|
+
import {
|
|
39
|
+
latest2,
|
|
40
|
+
Service81,
|
|
41
|
+
node83
|
|
42
|
+
} from "./instruction-discovery-d3trzhn7.js";
|
|
43
|
+
import {
|
|
44
|
+
MAX_LINES2,
|
|
45
|
+
MAX_BYTES2
|
|
46
|
+
} from "./instruction-discovery-6t40r86m.js";
|
|
47
|
+
import {
|
|
48
|
+
__export
|
|
49
|
+
} from "./instruction-discovery-9rqn6x4v.js";
|
|
50
|
+
|
|
51
|
+
// src/shell.ts
|
|
52
|
+
var exports_shell4 = {};
|
|
53
|
+
__export(exports_shell4, {
|
|
54
|
+
DIRECTORY: () => DIRECTORY2,
|
|
55
|
+
Daemon: () => Daemon2,
|
|
56
|
+
NotFoundError: () => NotFoundError7,
|
|
57
|
+
RETENTION: () => RETENTION2,
|
|
58
|
+
Service: () => Service43,
|
|
59
|
+
Shell: () => exports_shell4,
|
|
60
|
+
ToolCall: () => ToolCall2,
|
|
61
|
+
cleanup: () => cleanup2,
|
|
62
|
+
daemonNode: () => daemonNode2,
|
|
63
|
+
node: () => node46
|
|
64
|
+
});
|
|
65
|
+
import path from "path";
|
|
66
|
+
import {
|
|
67
|
+
Context,
|
|
68
|
+
Deferred,
|
|
69
|
+
Duration,
|
|
70
|
+
Effect,
|
|
71
|
+
Exit,
|
|
72
|
+
Fiber,
|
|
73
|
+
Latch,
|
|
74
|
+
Layer,
|
|
75
|
+
Option,
|
|
76
|
+
Schema,
|
|
77
|
+
Schedule,
|
|
78
|
+
Stream
|
|
79
|
+
} from "effect";
|
|
80
|
+
import { ChildProcess } from "effect/process";
|
|
81
|
+
import { produce } from "immer";
|
|
82
|
+
import { Shell } from "@opencode/schema/shell";
|
|
83
|
+
import { AppProcess } from "@opencode/util/process";
|
|
84
|
+
import { CrossSpawnSpawner } from "@opencode/util/cross-spawn-spawner";
|
|
85
|
+
import { makeGlobalNode, makeLocationNode } from "@opencode/util/effect/app-node";
|
|
86
|
+
import { FSUtil } from "@opencode/util/fs-util";
|
|
87
|
+
import { Global } from "@opencode/util/global";
|
|
88
|
+
class NotFoundError7 extends Schema.TaggedError()("Shell.NotFoundError", {
|
|
89
|
+
id: Shell.ID
|
|
90
|
+
}) {
|
|
91
|
+
}
|
|
92
|
+
var EXITED_LIMIT = 25;
|
|
93
|
+
var RETENTION2 = Duration.days(7);
|
|
94
|
+
var DIRECTORY2 = "shell";
|
|
95
|
+
var SPAN_COMMAND_LIMIT = 200;
|
|
96
|
+
var STOP_GRACE = Duration.seconds(3);
|
|
97
|
+
var LOST = "Command was killed: the process daemon stopped";
|
|
98
|
+
var COUNT_NEWLINES_LIMIT = 16 * 1024 * 1024;
|
|
99
|
+
var LINE_START_SCAN_LIMIT = 1024 * 1024;
|
|
100
|
+
var ToolCall2 = Schema.Struct({
|
|
101
|
+
sessionID: Schema.String,
|
|
102
|
+
assistantMessageID: Schema.String,
|
|
103
|
+
callID: Schema.String
|
|
104
|
+
});
|
|
105
|
+
var Stored = Schema.Struct({
|
|
106
|
+
id: Shell.ID,
|
|
107
|
+
command: Schema.String,
|
|
108
|
+
shell: Schema.String,
|
|
109
|
+
location: Schema.Struct({ directory: Schema.String, workspaceID: Schema.optionalKey(Schema.String) }),
|
|
110
|
+
metadata: Shell.Metadata,
|
|
111
|
+
toolCall: Schema.optional(ToolCall2),
|
|
112
|
+
timeoutDeadline: Schema.optional(Schema.Number),
|
|
113
|
+
stopReason: Schema.optional(Schema.Literals(["timeout", "killed"]))
|
|
114
|
+
});
|
|
115
|
+
var decodeStored = Schema.decodeUnknownOption(Stored);
|
|
116
|
+
|
|
117
|
+
class Service43 extends Context.Service()("@opencode/Shell") {
|
|
118
|
+
}
|
|
119
|
+
var cleanup2 = Effect.fn("Shell.cleanup")(function* () {
|
|
120
|
+
const fs = yield* FSUtil.Service;
|
|
121
|
+
const global = yield* Global.Service;
|
|
122
|
+
const pty = yield* Service45;
|
|
123
|
+
const directory = path.join(global.data, DIRECTORY2);
|
|
124
|
+
const projects = yield* fs.readDirectoryEntries(directory).pipe(Effect.map((entries) => entries.filter((entry) => entry.type === "Directory")), Effect.orElseSucceed(() => []));
|
|
125
|
+
const files = yield* Effect.forEach(projects, (project) => fs.readDirectoryEntries(path.join(directory, project.name)).pipe(Effect.map((entries) => entries.flatMap((entry) => entry.type === "File" && /^sh_[0-9a-f]{12}.*\.out$/.test(entry.name) ? [path.join(directory, project.name, entry.name)] : [])), Effect.orElseSucceed(() => [])), { concurrency: 8 });
|
|
126
|
+
const processes = new Map((yield* pty.listPipes().pipe(Effect.orElseSucceed(() => []))).map((process2) => [process2.outputPath, process2]));
|
|
127
|
+
yield* cleanup3(fs, files.flat().filter((file) => processes.get(file)?.lifecycle.status !== "running"), RETENTION2);
|
|
128
|
+
const cutoff = Date.now() - Duration.toMillis(RETENTION2);
|
|
129
|
+
yield* Effect.forEach(processes.values(), (process2) => Effect.gen(function* () {
|
|
130
|
+
if (process2.lifecycle.status === "running")
|
|
131
|
+
return;
|
|
132
|
+
const stale = (process2.exitedAt ?? process2.startedAt) < cutoff;
|
|
133
|
+
if (!stale && (yield* fs.exists(process2.outputPath).pipe(Effect.orElseSucceed(() => true))))
|
|
134
|
+
return;
|
|
135
|
+
yield* pty.terminatePipe(process2.id).pipe(Effect.ignore);
|
|
136
|
+
}), { concurrency: 8, discard: true });
|
|
137
|
+
});
|
|
138
|
+
var cleanupLayer = Layer.effectDiscard(cleanup2().pipe(Effect.repeat(Schedule.spaced(Duration.hours(1))), Effect.forkScoped));
|
|
139
|
+
var cleanupNode = makeGlobalNode({
|
|
140
|
+
name: "shell-output-cleanup",
|
|
141
|
+
layer: cleanupLayer,
|
|
142
|
+
deps: [FSUtil.node, Global.node, node48]
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
class Daemon2 extends Context.Service()("@opencode/Shell/Daemon") {
|
|
146
|
+
}
|
|
147
|
+
var daemonLayer = Layer.effect(Daemon2, Effect.gen(function* () {
|
|
148
|
+
const bus = yield* Service93;
|
|
149
|
+
const pty = yield* Service45;
|
|
150
|
+
const scope = yield* Effect.scope;
|
|
151
|
+
const context = yield* Effect.context();
|
|
152
|
+
const global = yield* Global.Service;
|
|
153
|
+
const { unlink } = yield* Effect.promise(() => import("fs/promises"));
|
|
154
|
+
const places = new Map;
|
|
155
|
+
const fork = (effect) => effect.pipe(Effect.forkIn(scope, { startImmediately: true }), Effect.setContext(context));
|
|
156
|
+
const place = (location) => {
|
|
157
|
+
const runs = new Map;
|
|
158
|
+
const exitOrder = [];
|
|
159
|
+
const ref = Ref5.make({ directory: location.directory, workspaceID: location.workspaceID });
|
|
160
|
+
const outputDir = path.join(global.data, DIRECTORY2, location.project.id);
|
|
161
|
+
const persisted = (run) => ({
|
|
162
|
+
id: run.info.id,
|
|
163
|
+
command: run.info.command,
|
|
164
|
+
shell: run.info.shell,
|
|
165
|
+
location: {
|
|
166
|
+
directory: location.directory,
|
|
167
|
+
...location.workspaceID !== undefined ? { workspaceID: location.workspaceID } : {}
|
|
168
|
+
},
|
|
169
|
+
metadata: run.info.metadata,
|
|
170
|
+
toolCall: run.toolCall,
|
|
171
|
+
timeoutDeadline: run.timeoutDeadline,
|
|
172
|
+
stopReason: run.stopReason
|
|
173
|
+
});
|
|
174
|
+
const store = (run) => pty.setPipeMetadata(run.process, persisted(run)).pipe(Effect.catch((error) => Effect.logWarning("failed to update shell command metadata", { id: run.info.id, error: error.message })));
|
|
175
|
+
const remove = Effect.fnUntraced(function* (id) {
|
|
176
|
+
const run = runs.get(id);
|
|
177
|
+
const index = exitOrder.indexOf(id);
|
|
178
|
+
if (index !== -1)
|
|
179
|
+
exitOrder.splice(index, 1);
|
|
180
|
+
if (!run)
|
|
181
|
+
return;
|
|
182
|
+
runs.delete(id);
|
|
183
|
+
if (run.timeoutFiber)
|
|
184
|
+
yield* Fiber.interrupt(run.timeoutFiber);
|
|
185
|
+
if (run.stopping)
|
|
186
|
+
yield* Fiber.interrupt(run.stopping);
|
|
187
|
+
if (run.wait)
|
|
188
|
+
yield* Fiber.interrupt(run.wait);
|
|
189
|
+
yield* pty.terminatePipe(run.process).pipe(Effect.ignore);
|
|
190
|
+
yield* Effect.promise(() => unlink(run.info.file).catch(() => {}));
|
|
191
|
+
yield* Deferred.fail(run.done, new NotFoundError7({ id }));
|
|
192
|
+
if (run.info.status === "running")
|
|
193
|
+
yield* bus.publish(Shell.Event.Exited, { id, status: "killed" }, { location: ref });
|
|
194
|
+
yield* bus.publish(Shell.Event.Deleted, { id }, { location: ref });
|
|
195
|
+
});
|
|
196
|
+
const evict = Effect.fnUntraced(function* () {
|
|
197
|
+
while (exitOrder.length > EXITED_LIMIT) {
|
|
198
|
+
const oldest = exitOrder[0];
|
|
199
|
+
if (!oldest)
|
|
200
|
+
break;
|
|
201
|
+
yield* remove(oldest);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
const finish = Effect.fnUntraced(function* (run, outcome) {
|
|
205
|
+
const id = run.info.id;
|
|
206
|
+
if (runs.get(id) !== run)
|
|
207
|
+
return;
|
|
208
|
+
run.info = produce(run.info, (draft) => {
|
|
209
|
+
draft.status = outcome.status;
|
|
210
|
+
if (outcome.exit !== undefined)
|
|
211
|
+
draft.exit = outcome.exit;
|
|
212
|
+
if (outcome.signal !== undefined)
|
|
213
|
+
draft.signal = outcome.signal;
|
|
214
|
+
draft.time.completed = outcome.completed;
|
|
215
|
+
});
|
|
216
|
+
if (run.timeoutFiber)
|
|
217
|
+
yield* Fiber.interrupt(run.timeoutFiber);
|
|
218
|
+
run.timeoutFiber = undefined;
|
|
219
|
+
yield* Deferred.succeed(run.done, run.info);
|
|
220
|
+
yield* bus.publish(Shell.Event.Exited, { id, ...outcome.exit !== undefined ? { exit: outcome.exit } : {}, status: outcome.status }, { location: ref });
|
|
221
|
+
exitOrder.push(id);
|
|
222
|
+
yield* evict();
|
|
223
|
+
});
|
|
224
|
+
const stop = (run, reason) => Effect.gen(function* () {
|
|
225
|
+
if (run.stopReason !== undefined || run.info.status !== "running")
|
|
226
|
+
return;
|
|
227
|
+
run.stopReason = reason;
|
|
228
|
+
run.timeoutDeadline = undefined;
|
|
229
|
+
yield* store(run);
|
|
230
|
+
yield* pty.signalPipe(run.process, "SIGTERM").pipe(Effect.ignore);
|
|
231
|
+
run.stopping = yield* fork(Effect.gen(function* () {
|
|
232
|
+
const ended = yield* Deferred.await(run.done).pipe(Effect.timeoutOption(STOP_GRACE), Effect.exit);
|
|
233
|
+
if (Exit.isSuccess(ended) && Option.isNone(ended.value))
|
|
234
|
+
yield* pty.signalPipe(run.process, "SIGKILL").pipe(Effect.ignore);
|
|
235
|
+
}));
|
|
236
|
+
}).pipe(Effect.uninterruptible);
|
|
237
|
+
const arm = Effect.fnUntraced(function* (run, duration) {
|
|
238
|
+
run.timeoutFiber = yield* fork(Effect.sleep(Duration.millis(duration)).pipe(Effect.andThen(stop(run, "timeout"))));
|
|
239
|
+
});
|
|
240
|
+
const timeout = Effect.fnUntraced(function* (run, duration) {
|
|
241
|
+
if (run.stopReason !== undefined || run.info.status !== "running")
|
|
242
|
+
return;
|
|
243
|
+
if (run.timeoutFiber)
|
|
244
|
+
yield* Fiber.interrupt(run.timeoutFiber);
|
|
245
|
+
run.timeoutFiber = undefined;
|
|
246
|
+
run.timeoutDeadline = duration === 0 ? undefined : Date.now() + duration;
|
|
247
|
+
yield* store(run);
|
|
248
|
+
if (duration !== 0)
|
|
249
|
+
yield* arm(run, duration);
|
|
250
|
+
});
|
|
251
|
+
const attach = Effect.fnUntraced(function* (run, duration) {
|
|
252
|
+
run.wait = yield* fork(pty.waitPipe(run.process).pipe(Effect.map((exit) => {
|
|
253
|
+
run.outputLines = exit.outputLines;
|
|
254
|
+
run.outputError = exit.outputError;
|
|
255
|
+
return {
|
|
256
|
+
status: run.stopReason ?? "exited",
|
|
257
|
+
...exit.exitCode !== undefined ? { exit: exit.exitCode } : {},
|
|
258
|
+
...exit.signal !== undefined ? { signal: exit.signal } : {},
|
|
259
|
+
completed: exit.exitedAt
|
|
260
|
+
};
|
|
261
|
+
}), Effect.catch((error) => Effect.logWarning("lost a shell command's process", { id: run.info.id, error: error.message }).pipe(Effect.andThen(Effect.sync(() => {
|
|
262
|
+
run.killed = LOST;
|
|
263
|
+
return { status: "killed", completed: Date.now() };
|
|
264
|
+
})))), Effect.tap((outcome) => outcome.status === "exited" && outcome.exit !== undefined && outcome.exit !== 0 ? pty.signalPipe(run.process, "SIGTERM").pipe(Effect.ignore) : Effect.void), Effect.flatMap((outcome) => finish(run, outcome))));
|
|
265
|
+
if (run.stopReason !== undefined) {
|
|
266
|
+
run.stopping = yield* fork(pty.signalPipe(run.process, "SIGKILL").pipe(Effect.ignore));
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (duration === undefined)
|
|
270
|
+
return;
|
|
271
|
+
if (duration > 0)
|
|
272
|
+
return yield* arm(run, duration);
|
|
273
|
+
yield* stop(run, "timeout");
|
|
274
|
+
});
|
|
275
|
+
const create = Effect.fnUntraced(function* (input) {
|
|
276
|
+
const run = {
|
|
277
|
+
kind: "daemon",
|
|
278
|
+
info: input.info,
|
|
279
|
+
process: 0,
|
|
280
|
+
toolCall: input.toolCall,
|
|
281
|
+
timeoutDeadline: !input.waited && input.timeout > 0 ? input.info.time.started + input.timeout : undefined,
|
|
282
|
+
done: Deferred.makeUnsafe()
|
|
283
|
+
};
|
|
284
|
+
const created = yield* pty.createPipe({
|
|
285
|
+
program: input.info.shell,
|
|
286
|
+
args: input.args,
|
|
287
|
+
cwd: input.info.cwd,
|
|
288
|
+
env: input.env,
|
|
289
|
+
groupID: location.project.id,
|
|
290
|
+
outputPath: input.info.file,
|
|
291
|
+
metadata: persisted(run)
|
|
292
|
+
});
|
|
293
|
+
run.process = created.id;
|
|
294
|
+
run.info = produce(input.info, (draft) => {
|
|
295
|
+
if (created.pid !== undefined)
|
|
296
|
+
draft.pid = created.pid;
|
|
297
|
+
draft.time.started = created.startedAt;
|
|
298
|
+
});
|
|
299
|
+
runs.set(run.info.id, run);
|
|
300
|
+
yield* attach(run, input.timeout > 0 ? input.timeout : undefined);
|
|
301
|
+
yield* bus.publish(Shell.Event.Created, { info: run.info }, { location: ref });
|
|
302
|
+
return run.info;
|
|
303
|
+
});
|
|
304
|
+
const recover = Effect.fnUntraced(function* () {
|
|
305
|
+
const processes = yield* pty.listPipes().pipe(Effect.catch((error) => Effect.logWarning("failed to list shell commands to recover", { error: error.message }).pipe(Effect.as([]))));
|
|
306
|
+
const finished = [];
|
|
307
|
+
for (const process2 of processes) {
|
|
308
|
+
const stored = Option.getOrUndefined(decodeStored(process2.metadata));
|
|
309
|
+
if (!stored || stored.location.directory !== location.directory || stored.location.workspaceID !== location.workspaceID || path.dirname(process2.outputPath) !== outputDir || runs.has(stored.id))
|
|
310
|
+
continue;
|
|
311
|
+
const running = process2.lifecycle.status === "running";
|
|
312
|
+
const exited = process2.lifecycle.status === "exited" ? process2.lifecycle : undefined;
|
|
313
|
+
const status = running ? "running" : stored.stopReason ?? (exited ? "exited" : "killed");
|
|
314
|
+
const run = {
|
|
315
|
+
kind: "daemon",
|
|
316
|
+
info: {
|
|
317
|
+
id: stored.id,
|
|
318
|
+
status,
|
|
319
|
+
command: stored.command,
|
|
320
|
+
cwd: process2.cwd,
|
|
321
|
+
shell: stored.shell,
|
|
322
|
+
file: process2.outputPath,
|
|
323
|
+
...process2.pid !== undefined ? { pid: process2.pid } : {},
|
|
324
|
+
...exited?.exitCode !== undefined ? { exit: exited.exitCode } : {},
|
|
325
|
+
...exited?.signal !== undefined ? { signal: exited.signal } : {},
|
|
326
|
+
metadata: stored.metadata,
|
|
327
|
+
time: {
|
|
328
|
+
started: process2.startedAt,
|
|
329
|
+
...running ? {} : { completed: process2.exitedAt ?? process2.startedAt }
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
process: process2.id,
|
|
333
|
+
toolCall: stored.toolCall,
|
|
334
|
+
timeoutDeadline: stored.timeoutDeadline,
|
|
335
|
+
stopReason: stored.stopReason,
|
|
336
|
+
...running ? {} : { outputLines: process2.outputLines, outputError: process2.outputError },
|
|
337
|
+
...process2.lifecycle.status === "failed" && !stored.stopReason ? { killed: `Command was killed: ${process2.lifecycle.message}` } : {},
|
|
338
|
+
done: Deferred.makeUnsafe()
|
|
339
|
+
};
|
|
340
|
+
runs.set(stored.id, run);
|
|
341
|
+
if (running) {
|
|
342
|
+
const deadline = stored.timeoutDeadline;
|
|
343
|
+
yield* attach(run, deadline === undefined ? undefined : Math.max(0, deadline - Date.now()));
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
yield* Deferred.succeed(run.done, run.info);
|
|
347
|
+
finished.push(run);
|
|
348
|
+
}
|
|
349
|
+
exitOrder.push(...finished.toSorted((a, b) => (a.info.time.completed ?? 0) - (b.info.time.completed ?? 0)).map((run) => run.info.id));
|
|
350
|
+
yield* evict();
|
|
351
|
+
});
|
|
352
|
+
const handle = {
|
|
353
|
+
get: (id) => runs.get(id),
|
|
354
|
+
list: () => Array.from(runs.values()),
|
|
355
|
+
create,
|
|
356
|
+
timeout,
|
|
357
|
+
stop,
|
|
358
|
+
remove
|
|
359
|
+
};
|
|
360
|
+
return { runs: handle, recover };
|
|
361
|
+
};
|
|
362
|
+
const at = Effect.fnUntraced(function* (location) {
|
|
363
|
+
const key = `${location.directory}\x00${location.workspaceID ?? ""}`;
|
|
364
|
+
const existing = places.get(key);
|
|
365
|
+
if (existing) {
|
|
366
|
+
yield* Deferred.await(existing.recovered);
|
|
367
|
+
return existing.runs;
|
|
368
|
+
}
|
|
369
|
+
const placed = place(location);
|
|
370
|
+
const entry = { runs: placed.runs, recovered: Deferred.makeUnsafe() };
|
|
371
|
+
places.set(key, entry);
|
|
372
|
+
yield* placed.recover().pipe(Effect.ensuring(Deferred.succeed(entry.recovered, undefined)), Effect.uninterruptible);
|
|
373
|
+
return placed.runs;
|
|
374
|
+
});
|
|
375
|
+
return Daemon2.of({
|
|
376
|
+
at,
|
|
377
|
+
handoffPrepared: pty.handoffPrepared,
|
|
378
|
+
watch: (effect) => fork(effect.pipe(Effect.catch((error) => Effect.logError("shell watcher failed", { error })))).pipe(Effect.asVoid)
|
|
379
|
+
});
|
|
380
|
+
}));
|
|
381
|
+
var daemonNode2 = makeGlobalNode({
|
|
382
|
+
service: Daemon2,
|
|
383
|
+
layer: daemonLayer,
|
|
384
|
+
deps: [node95, Global.node, node48]
|
|
385
|
+
});
|
|
386
|
+
var layer = () => Layer.effect(Service43, Effect.gen(function* () {
|
|
387
|
+
const bus = yield* Service93;
|
|
388
|
+
const location = yield* Service90;
|
|
389
|
+
const global = yield* Global.Service;
|
|
390
|
+
const shell = yield* Service53;
|
|
391
|
+
const environment = yield* Service66;
|
|
392
|
+
const hooks = yield* Service77;
|
|
393
|
+
const environments = yield* Service44;
|
|
394
|
+
const config = yield* Service81;
|
|
395
|
+
const daemon = yield* Daemon2;
|
|
396
|
+
const context = yield* Effect.context();
|
|
397
|
+
const runFork = Effect.runForkWith(context);
|
|
398
|
+
const commands = new Map;
|
|
399
|
+
const exitOrder = [];
|
|
400
|
+
const runs = location.workspaceID === undefined && process.platform !== "win32" && available3 ? yield* daemon.at(location) : undefined;
|
|
401
|
+
const outputDir = path.join(global.data, DIRECTORY2, location.project.id);
|
|
402
|
+
const { mkdir, unlink, stat } = yield* Effect.promise(() => import("fs/promises"));
|
|
403
|
+
const { createWriteStream, createReadStream } = yield* Effect.promise(() => import("fs"));
|
|
404
|
+
yield* Effect.promise(() => mkdir(outputDir, { recursive: true }));
|
|
405
|
+
yield* Effect.addFinalizer(() => Effect.gen(function* () {
|
|
406
|
+
for (const command of commands.values()) {
|
|
407
|
+
if (command.timeoutFiber)
|
|
408
|
+
yield* Fiber.interrupt(command.timeoutFiber);
|
|
409
|
+
yield* Deferred.interrupt(command.done);
|
|
410
|
+
}
|
|
411
|
+
commands.clear();
|
|
412
|
+
exitOrder.length = 0;
|
|
413
|
+
}));
|
|
414
|
+
const require2 = Effect.fnUntraced(function* (id) {
|
|
415
|
+
const command = commands.get(id) ?? runs?.get(id);
|
|
416
|
+
if (!command)
|
|
417
|
+
return yield* new NotFoundError7({ id });
|
|
418
|
+
return command;
|
|
419
|
+
});
|
|
420
|
+
const removeCommand = Effect.fnUntraced(function* (id) {
|
|
421
|
+
const command = commands.get(id);
|
|
422
|
+
const index = exitOrder.indexOf(id);
|
|
423
|
+
if (index !== -1)
|
|
424
|
+
exitOrder.splice(index, 1);
|
|
425
|
+
if (!command)
|
|
426
|
+
return;
|
|
427
|
+
commands.delete(id);
|
|
428
|
+
if (command.timeoutFiber)
|
|
429
|
+
yield* Fiber.interrupt(command.timeoutFiber);
|
|
430
|
+
yield* Deferred.fail(command.done, new NotFoundError7({ id }));
|
|
431
|
+
yield* Effect.promise(() => unlink(command.info.file).catch(() => {}));
|
|
432
|
+
if (command.info.status === "running")
|
|
433
|
+
yield* bus.publish(Shell.Event.Exited, { id, status: "killed" });
|
|
434
|
+
yield* bus.publish(Shell.Event.Deleted, { id });
|
|
435
|
+
});
|
|
436
|
+
const remove = Effect.fn("Shell.remove")(function* (id) {
|
|
437
|
+
const command = yield* require2(id);
|
|
438
|
+
yield* annotate(command.info);
|
|
439
|
+
if (command.kind === "daemon")
|
|
440
|
+
return yield* runs?.remove(id) ?? Effect.void;
|
|
441
|
+
yield* removeCommand(id);
|
|
442
|
+
});
|
|
443
|
+
const list = Effect.fn("Shell.list")(function* () {
|
|
444
|
+
return [...commands.values(), ...runs?.list() ?? []].filter((command) => command.info.status === "running").map((command) => command.info);
|
|
445
|
+
});
|
|
446
|
+
const get = Effect.fn("Shell.get")(function* (id) {
|
|
447
|
+
const { info } = yield* require2(id);
|
|
448
|
+
yield* annotate(info);
|
|
449
|
+
return info;
|
|
450
|
+
});
|
|
451
|
+
const wait = Effect.fn("Shell.wait")(function* (id) {
|
|
452
|
+
const command = yield* require2(id);
|
|
453
|
+
yield* annotate(command.info);
|
|
454
|
+
const info = yield* Deferred.await(command.done);
|
|
455
|
+
yield* annotate(info);
|
|
456
|
+
return info;
|
|
457
|
+
});
|
|
458
|
+
const timeout = Effect.fn("Shell.timeout")(function* (id, duration) {
|
|
459
|
+
const command = yield* require2(id);
|
|
460
|
+
yield* annotate(command.info);
|
|
461
|
+
if (command.kind === "daemon")
|
|
462
|
+
yield* runs?.timeout(command, duration) ?? Effect.void;
|
|
463
|
+
if (command.kind === "spawned" && command.info.status === "running" && command.timeout)
|
|
464
|
+
yield* command.timeout(duration);
|
|
465
|
+
return command.info;
|
|
466
|
+
});
|
|
467
|
+
const stop = Effect.fn("Shell.stop")(function* (id, reason) {
|
|
468
|
+
const command = yield* require2(id);
|
|
469
|
+
yield* annotate(command.info);
|
|
470
|
+
if (command.kind === "daemon")
|
|
471
|
+
yield* runs?.stop(command, reason) ?? Effect.void;
|
|
472
|
+
if (command.kind === "spawned" && command.info.status === "running" && command.stop)
|
|
473
|
+
yield* command.stop(reason);
|
|
474
|
+
return command.info;
|
|
475
|
+
});
|
|
476
|
+
const byToolCall = Effect.fn("Shell.byToolCall")(function* (call) {
|
|
477
|
+
return runs?.list().find((run) => run.toolCall?.sessionID === call.sessionID && run.toolCall.assistantMessageID === call.assistantMessageID && run.toolCall.callID === call.callID)?.info;
|
|
478
|
+
});
|
|
479
|
+
const readRange = (file, start, length) => length <= 0 ? Effect.succeed(Buffer.alloc(0)) : Effect.promise(() => new Promise((resolve) => {
|
|
480
|
+
const buffer = Buffer.alloc(length);
|
|
481
|
+
const stream = createReadStream(file, { start, end: start + length - 1 });
|
|
482
|
+
let offset = 0;
|
|
483
|
+
stream.on("data", (chunk) => {
|
|
484
|
+
const bytes = Buffer.from(chunk);
|
|
485
|
+
bytes.copy(buffer, offset);
|
|
486
|
+
offset += bytes.length;
|
|
487
|
+
});
|
|
488
|
+
stream.on("end", () => resolve(buffer.subarray(0, offset)));
|
|
489
|
+
stream.on("error", () => resolve(buffer.subarray(0, 0)));
|
|
490
|
+
}));
|
|
491
|
+
const sizeOf = (command) => command.kind === "spawned" ? Effect.succeed(command.size) : Effect.promise(() => stat(command.info.file).then((info) => info.size, () => 0));
|
|
492
|
+
const output = Effect.fnUntraced(function* (id, input) {
|
|
493
|
+
const command = yield* require2(id);
|
|
494
|
+
const cursor = input?.cursor ?? 0;
|
|
495
|
+
const limit = input?.limit ?? 65536;
|
|
496
|
+
const size = yield* sizeOf(command);
|
|
497
|
+
if (cursor >= size)
|
|
498
|
+
return { output: "", cursor: size, size, truncated: false };
|
|
499
|
+
const start = Math.max(0, cursor);
|
|
500
|
+
const bytes = yield* readRange(command.info.file, start, Math.min(limit, size - start));
|
|
501
|
+
return {
|
|
502
|
+
output: bytes.toString("utf8"),
|
|
503
|
+
cursor: start + bytes.length,
|
|
504
|
+
size,
|
|
505
|
+
truncated: false
|
|
506
|
+
};
|
|
507
|
+
});
|
|
508
|
+
const countNewlines = (file, size) => Effect.promise(() => new Promise((resolve) => {
|
|
509
|
+
if (size === 0)
|
|
510
|
+
return resolve(0);
|
|
511
|
+
if (size > COUNT_NEWLINES_LIMIT)
|
|
512
|
+
return resolve(undefined);
|
|
513
|
+
let count = 0;
|
|
514
|
+
const stream = createReadStream(file, { end: size - 1 });
|
|
515
|
+
stream.on("data", (chunk) => {
|
|
516
|
+
const bytes = Buffer.from(chunk);
|
|
517
|
+
for (let index = bytes.indexOf(10);index !== -1; index = bytes.indexOf(10, index + 1))
|
|
518
|
+
count++;
|
|
519
|
+
});
|
|
520
|
+
stream.on("end", () => resolve(count));
|
|
521
|
+
stream.on("error", () => resolve(count));
|
|
522
|
+
}));
|
|
523
|
+
const lineStartsOf = Effect.fnUntraced(function* (file, size) {
|
|
524
|
+
const starts = [];
|
|
525
|
+
let end = size;
|
|
526
|
+
const floor = Math.max(0, size - LINE_START_SCAN_LIMIT);
|
|
527
|
+
while (end > floor && starts.length < 2) {
|
|
528
|
+
const from = Math.max(floor, end - 65536);
|
|
529
|
+
const chunk = yield* readRange(file, from, end - from);
|
|
530
|
+
for (let index = chunk.length - 1;index >= 0 && starts.length < 2; index--)
|
|
531
|
+
if (chunk[index] === 10)
|
|
532
|
+
starts.push(from + index + 1);
|
|
533
|
+
end = from;
|
|
534
|
+
}
|
|
535
|
+
const unknown = floor > 0 ? undefined : 0;
|
|
536
|
+
return [starts[1] ?? unknown, starts[0] ?? unknown];
|
|
537
|
+
});
|
|
538
|
+
const result = Effect.fn("Shell.result")(function* (started, options) {
|
|
539
|
+
yield* annotate(started);
|
|
540
|
+
const ended = wait(started.id).pipe(Effect.map(Option.some));
|
|
541
|
+
const info = yield* (options?.wait === undefined ? ended : ended.pipe(Effect.timeoutOrElse({ duration: options.wait, orElse: () => Effect.succeed(Option.none()) }))).pipe(Effect.flatMap((info) => Option.isSome(info) ? Effect.succeed(info.value) : get(started.id)), Effect.catchTag("Shell.NotFoundError", () => Effect.succeed({ ...started, status: "killed", time: { ...started.time, completed: Date.now() } })));
|
|
542
|
+
yield* annotate(info);
|
|
543
|
+
const capture = yield* Effect.gen(function* () {
|
|
544
|
+
const limits = latest2(yield* config.entries(), "tool_output");
|
|
545
|
+
const maxLines = limits?.max_lines ?? MAX_LINES2;
|
|
546
|
+
const maxBytes = limits?.max_bytes ?? MAX_BYTES2;
|
|
547
|
+
const command = yield* require2(info.id);
|
|
548
|
+
const size = yield* sizeOf(command);
|
|
549
|
+
const start = Math.max(0, size - maxBytes);
|
|
550
|
+
const before = Math.max(0, start - 1);
|
|
551
|
+
const window = yield* readRange(info.file, before, size - before);
|
|
552
|
+
const page = window.subarray(charBoundary(window, start - before)).toString("utf8");
|
|
553
|
+
const partial = start > 0 && window[0] !== 10;
|
|
554
|
+
const endsWithNewline = page.endsWith(`
|
|
555
|
+
`);
|
|
556
|
+
const lines = page.split(`
|
|
557
|
+
`);
|
|
558
|
+
if (endsWithNewline)
|
|
559
|
+
lines.pop();
|
|
560
|
+
const newlines = command.kind === "spawned" ? command.newlines : command.outputLines ?? (yield* countNewlines(info.file, size));
|
|
561
|
+
const total = newlines === undefined ? undefined : newlines + (endsWithNewline ? 0 : 1);
|
|
562
|
+
const suffix = `full output saved to ${info.file}]`;
|
|
563
|
+
const stoppedEarly = command.kind === "daemon" && command.outputError ? `
|
|
564
|
+
|
|
565
|
+
[output file ${info.file} stopped early: ${command.outputError}]` : "";
|
|
566
|
+
const killed = command.kind === "daemon" && command.killed ? { killed: command.killed } : {};
|
|
567
|
+
if (partial && lines.length === 1) {
|
|
568
|
+
const lineStarts = command.kind === "spawned" ? command.lineStarts : yield* lineStartsOf(info.file, size);
|
|
569
|
+
const lineStart = endsWithNewline ? lineStarts[0] : lineStarts[1];
|
|
570
|
+
const end = size - (endsWithNewline ? 1 : 0);
|
|
571
|
+
const lineSize = lineStart === undefined ? `over ${formatSize(Math.min(end, LINE_START_SCAN_LIMIT))}` : formatSize(end - lineStart);
|
|
572
|
+
const shownSize = Buffer.byteLength(lines[0]);
|
|
573
|
+
const line = total === undefined ? "the last line" : `line ${total}`;
|
|
574
|
+
return {
|
|
575
|
+
output: `${lines[0]}
|
|
576
|
+
|
|
577
|
+
[showing the last ${formatSize(shownSize)} of ${line} (${lineSize}); ${suffix}${stoppedEarly}`,
|
|
578
|
+
truncated: true,
|
|
579
|
+
...killed
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
if (start > 0 || lines.length > maxLines) {
|
|
583
|
+
const kept = lines.slice(-Math.min(maxLines, lines.length - (partial ? 1 : 0)));
|
|
584
|
+
return {
|
|
585
|
+
output: total === undefined ? `${kept.join(`
|
|
586
|
+
`)}
|
|
587
|
+
|
|
588
|
+
[showing the last ${kept.length} lines; ${suffix}${stoppedEarly}` : `${kept.join(`
|
|
589
|
+
`)}
|
|
590
|
+
|
|
591
|
+
[showing lines ${total - kept.length + 1}-${total} of ${total}; ${suffix}${stoppedEarly}`,
|
|
592
|
+
truncated: true,
|
|
593
|
+
...killed
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
const shown = stoppedEarly && page.endsWith(`
|
|
597
|
+
`) ? page.slice(0, -1) : page;
|
|
598
|
+
return { output: `${shown || "(no output)"}${stoppedEarly}`, truncated: false, ...killed };
|
|
599
|
+
}).pipe(Effect.catchTag("Shell.NotFoundError", () => Effect.succeed(undefined)));
|
|
600
|
+
return { info, capture };
|
|
601
|
+
});
|
|
602
|
+
const create = Effect.fn("Shell.create")(function* (input, before) {
|
|
603
|
+
const sessionID = input.metadata?.sessionID;
|
|
604
|
+
const baseEnv = location.workspaceID !== undefined ? undefined : (Schema.is(SessionSchema2.ID)(sessionID) ? yield* environments.get(sessionID) : undefined) ?? process.env;
|
|
605
|
+
const invocation = {
|
|
606
|
+
command: input.command,
|
|
607
|
+
cwd: input.cwd ?? location.directory,
|
|
608
|
+
timeout: input.timeout ?? 0,
|
|
609
|
+
shell: input.shell ?? (yield* shell.resolve({ priority: "config" })),
|
|
610
|
+
env: {
|
|
611
|
+
...baseEnv,
|
|
612
|
+
TERM: "xterm-256color",
|
|
613
|
+
OPENCODE_TERMINAL: "1"
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
yield* hooks.trigger("shell", "create.before", invocation);
|
|
617
|
+
if (before)
|
|
618
|
+
yield* before(invocation);
|
|
619
|
+
if (location.workspaceID === undefined)
|
|
620
|
+
invocation.cwd = path.resolve(location.directory, invocation.cwd);
|
|
621
|
+
const id = Shell.ID.ascending();
|
|
622
|
+
const args = args2(invocation.shell, invocation.command);
|
|
623
|
+
const file = path.join(outputDir, `${id}.out`);
|
|
624
|
+
const info = {
|
|
625
|
+
id,
|
|
626
|
+
status: "running",
|
|
627
|
+
command: invocation.command,
|
|
628
|
+
cwd: invocation.cwd,
|
|
629
|
+
shell: invocation.shell,
|
|
630
|
+
file,
|
|
631
|
+
metadata: input.metadata ?? {},
|
|
632
|
+
time: { started: Date.now() }
|
|
633
|
+
};
|
|
634
|
+
yield* annotate(info);
|
|
635
|
+
if (runs) {
|
|
636
|
+
const created = yield* runs.create({
|
|
637
|
+
info,
|
|
638
|
+
args,
|
|
639
|
+
env: Object.fromEntries(Object.entries(invocation.env).filter((entry) => entry[1] !== undefined)),
|
|
640
|
+
timeout: invocation.timeout,
|
|
641
|
+
toolCall: input.toolCall,
|
|
642
|
+
waited: input.waited === true
|
|
643
|
+
}).pipe(Effect.map(Option.some), Effect.catchTags({
|
|
644
|
+
"PersistentPty.UnavailableError": (error) => Effect.logWarning("process daemon unavailable; spawning shell command instead", {
|
|
645
|
+
error: error.message
|
|
646
|
+
}).pipe(Effect.as(Option.none())),
|
|
647
|
+
"PersistentPty.RequestError": (cause) => Effect.fail(new AppProcess.AppProcessError({ command: invocation.command, cause }))
|
|
648
|
+
}));
|
|
649
|
+
if (Option.isSome(created))
|
|
650
|
+
return created.value;
|
|
651
|
+
}
|
|
652
|
+
const ready = Deferred.makeUnsafe();
|
|
653
|
+
runFork(Effect.scoped(Effect.gen(function* () {
|
|
654
|
+
const handle = yield* environment.spawner.spawn(ChildProcess.make(invocation.shell, args, {
|
|
655
|
+
cwd: invocation.cwd,
|
|
656
|
+
env: invocation.env,
|
|
657
|
+
stdin: "ignore",
|
|
658
|
+
detached: process.platform !== "win32",
|
|
659
|
+
forceKillAfter: STOP_GRACE
|
|
660
|
+
})).pipe(Effect.mapError((cause) => new AppProcess.AppProcessError({ command: invocation.command, cause })));
|
|
661
|
+
const command = {
|
|
662
|
+
kind: "spawned",
|
|
663
|
+
info: produce(info, (draft) => {
|
|
664
|
+
draft.pid = handle.pid;
|
|
665
|
+
}),
|
|
666
|
+
size: 0,
|
|
667
|
+
newlines: 0,
|
|
668
|
+
lineStarts: [0, 0],
|
|
669
|
+
done: Deferred.makeUnsafe()
|
|
670
|
+
};
|
|
671
|
+
commands.set(id, command);
|
|
672
|
+
const stream = createWriteStream(file);
|
|
673
|
+
const outputDone = Latch.makeUnsafe();
|
|
674
|
+
const pump = handle.all.pipe(Stream.runForEach((chunk) => Effect.sync(() => {
|
|
675
|
+
stream.write(chunk);
|
|
676
|
+
for (let index = chunk.indexOf(10);index !== -1; index = chunk.indexOf(10, index + 1)) {
|
|
677
|
+
command.newlines++;
|
|
678
|
+
command.lineStarts[0] = command.lineStarts[1];
|
|
679
|
+
command.lineStarts[1] = command.size + index + 1;
|
|
680
|
+
}
|
|
681
|
+
command.size += chunk.length;
|
|
682
|
+
})));
|
|
683
|
+
runFork(Effect.gen(function* () {
|
|
684
|
+
yield* pump.pipe(Effect.catch(() => Effect.void));
|
|
685
|
+
yield* Effect.promise(() => new Promise((resolve) => {
|
|
686
|
+
stream.end(() => resolve());
|
|
687
|
+
}));
|
|
688
|
+
yield* outputDone.open;
|
|
689
|
+
}));
|
|
690
|
+
yield* Effect.promise(() => new Promise((resolve) => {
|
|
691
|
+
stream.once("open", () => resolve());
|
|
692
|
+
stream.once("error", () => resolve());
|
|
693
|
+
}));
|
|
694
|
+
const ended = Deferred.makeUnsafe();
|
|
695
|
+
const end = (outcome) => Effect.suspend(() => Deferred.succeed(ended, { ...outcome, completed: Date.now() }));
|
|
696
|
+
command.stop = (reason) => Effect.gen(function* () {
|
|
697
|
+
if (!(yield* end({ status: reason })))
|
|
698
|
+
return;
|
|
699
|
+
runFork(handle.kill({ forceKillAfter: STOP_GRACE }).pipe(Effect.catch(() => Effect.void)));
|
|
700
|
+
}).pipe(Effect.uninterruptible);
|
|
701
|
+
command.timeout = (duration) => Effect.gen(function* () {
|
|
702
|
+
if (Deferred.isDoneUnsafe(ended))
|
|
703
|
+
return;
|
|
704
|
+
if (command.timeoutFiber)
|
|
705
|
+
yield* Fiber.interrupt(command.timeoutFiber);
|
|
706
|
+
command.timeoutFiber = undefined;
|
|
707
|
+
if (duration === 0)
|
|
708
|
+
return;
|
|
709
|
+
const stop = command.stop;
|
|
710
|
+
if (!stop)
|
|
711
|
+
return;
|
|
712
|
+
command.timeoutFiber = runFork(Effect.sleep(Duration.millis(duration)).pipe(Effect.andThen(stop("timeout"))));
|
|
713
|
+
});
|
|
714
|
+
yield* command.timeout(invocation.timeout);
|
|
715
|
+
runFork(Effect.gen(function* () {
|
|
716
|
+
const exited = yield* handle.exitCode.pipe(Effect.map((code) => ({ exit: code, signal: undefined })), Effect.catch((error) => Effect.succeed({
|
|
717
|
+
exit: undefined,
|
|
718
|
+
signal: error.cause instanceof CrossSpawnSpawner.KilledBySignal ? error.cause.signal : undefined
|
|
719
|
+
})));
|
|
720
|
+
yield* end({ status: "exited", ...exited });
|
|
721
|
+
const outcome = { ...yield* Deferred.await(ended), ...exited };
|
|
722
|
+
yield* outputDone.await;
|
|
723
|
+
if (commands.get(id) !== command)
|
|
724
|
+
return;
|
|
725
|
+
command.info = produce(command.info, (draft) => {
|
|
726
|
+
draft.status = outcome.status;
|
|
727
|
+
if (outcome.exit !== undefined)
|
|
728
|
+
draft.exit = outcome.exit;
|
|
729
|
+
if (outcome.signal !== undefined)
|
|
730
|
+
draft.signal = outcome.signal;
|
|
731
|
+
draft.time.completed = outcome.completed;
|
|
732
|
+
});
|
|
733
|
+
yield* Deferred.succeed(command.done, command.info);
|
|
734
|
+
yield* bus.publish(Shell.Event.Exited, {
|
|
735
|
+
id,
|
|
736
|
+
...outcome.exit !== undefined ? { exit: outcome.exit } : {},
|
|
737
|
+
status: outcome.status
|
|
738
|
+
});
|
|
739
|
+
exitOrder.push(id);
|
|
740
|
+
while (exitOrder.length > EXITED_LIMIT) {
|
|
741
|
+
const oldest = exitOrder[0];
|
|
742
|
+
if (!oldest)
|
|
743
|
+
break;
|
|
744
|
+
yield* removeCommand(oldest);
|
|
745
|
+
}
|
|
746
|
+
const timeoutFiber = command.timeoutFiber;
|
|
747
|
+
command.timeout = undefined;
|
|
748
|
+
command.stop = undefined;
|
|
749
|
+
command.timeoutFiber = undefined;
|
|
750
|
+
if (timeoutFiber)
|
|
751
|
+
yield* Fiber.interrupt(timeoutFiber);
|
|
752
|
+
}));
|
|
753
|
+
yield* bus.publish(Shell.Event.Created, { info });
|
|
754
|
+
yield* Deferred.succeed(ready, command);
|
|
755
|
+
yield* Deferred.await(command.done).pipe(Effect.catch(() => Effect.void));
|
|
756
|
+
})).pipe(Effect.catchTag("AppProcessError", (error) => Deferred.fail(ready, error))));
|
|
757
|
+
const command = yield* Deferred.await(ready);
|
|
758
|
+
return command.info;
|
|
759
|
+
});
|
|
760
|
+
return Service43.of({
|
|
761
|
+
create,
|
|
762
|
+
list,
|
|
763
|
+
get,
|
|
764
|
+
wait,
|
|
765
|
+
result,
|
|
766
|
+
timeout,
|
|
767
|
+
stop,
|
|
768
|
+
byToolCall,
|
|
769
|
+
output,
|
|
770
|
+
remove,
|
|
771
|
+
watch: daemon.watch,
|
|
772
|
+
handoffPrepared: daemon.handoffPrepared
|
|
773
|
+
});
|
|
774
|
+
}));
|
|
775
|
+
function annotate(info) {
|
|
776
|
+
const sessionID = info.metadata.sessionID;
|
|
777
|
+
return Effect.annotateCurrentSpan({
|
|
778
|
+
"opencode.shell.id": info.id,
|
|
779
|
+
"opencode.shell.command": spanCommand(info.command),
|
|
780
|
+
...typeof sessionID === "string" ? { "session.id": sessionID } : {},
|
|
781
|
+
...info.metadata.background === true ? { "opencode.shell.background": true } : {},
|
|
782
|
+
...info.status === "running" ? {} : { "opencode.shell.status": info.status },
|
|
783
|
+
...info.exit === undefined ? {} : { "process.exit.code": info.exit }
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
function spanCommand(command) {
|
|
787
|
+
if (command.length <= SPAN_COMMAND_LIMIT)
|
|
788
|
+
return command.toWellFormed();
|
|
789
|
+
return `${command.slice(0, SPAN_COMMAND_LIMIT).toWellFormed()}…`;
|
|
790
|
+
}
|
|
791
|
+
function charBoundary(bytes, offset) {
|
|
792
|
+
const limit = Math.min(bytes.length, offset + 3);
|
|
793
|
+
for (let index = offset;index < limit; index++)
|
|
794
|
+
if ((bytes[index] & 192) !== 128)
|
|
795
|
+
return index;
|
|
796
|
+
return limit;
|
|
797
|
+
}
|
|
798
|
+
function formatSize(bytes) {
|
|
799
|
+
const kb = bytes / 1024;
|
|
800
|
+
return kb > 1024 ? `${(kb / 1024).toFixed(1)} MB` : `${Math.round(kb)} KB`;
|
|
801
|
+
}
|
|
802
|
+
var node46 = makeLocationNode({
|
|
803
|
+
service: Service43,
|
|
804
|
+
layer: layer(),
|
|
805
|
+
deps: [
|
|
806
|
+
node95,
|
|
807
|
+
node92,
|
|
808
|
+
Global.node,
|
|
809
|
+
node55,
|
|
810
|
+
node68,
|
|
811
|
+
node79,
|
|
812
|
+
node47,
|
|
813
|
+
node83,
|
|
814
|
+
daemonNode2,
|
|
815
|
+
cleanupNode
|
|
816
|
+
]
|
|
817
|
+
});
|
|
818
|
+
|
|
819
|
+
export { NotFoundError7, RETENTION2, DIRECTORY2, ToolCall2, Service43, cleanup2, Daemon2, daemonNode2, node46, exports_shell4 };
|