@opencode/core 0.0.0-dev-338 → 0.0.0-dev-355
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 +93 -93
- package/dist/aisdk-native.js +101 -101
- package/dist/aisdk.js +109 -109
- package/dist/app.js +9 -9
- package/dist/bus.js +83 -83
- package/dist/chunks/managed-policy-09htpdq8.js +1332 -0
- package/dist/chunks/managed-policy-09xtg6dh.js +83 -0
- package/dist/chunks/managed-policy-0ahs07zn.js +21 -0
- package/dist/chunks/managed-policy-0c3x5mmw.js +31 -0
- package/dist/chunks/managed-policy-0exwhxnj.js +128 -0
- package/dist/chunks/managed-policy-0f9f120t.js +37 -0
- package/dist/chunks/managed-policy-0j1hn0v5.js +362 -0
- package/dist/chunks/managed-policy-0j7gp832.js +41 -0
- package/dist/chunks/managed-policy-0kp44r8v.js +104 -0
- package/dist/chunks/managed-policy-0nya5dy2.js +42 -0
- package/dist/chunks/managed-policy-0wwtt1v4.js +247 -0
- package/dist/chunks/managed-policy-11pyra5g.js +157 -0
- package/dist/chunks/managed-policy-12jq7ca1.js +227 -0
- package/dist/chunks/managed-policy-13w6ybrz.js +357 -0
- package/dist/chunks/managed-policy-19ra4j57.js +94 -0
- package/dist/chunks/managed-policy-1aqsckx4.js +19 -0
- package/dist/chunks/managed-policy-1m3wvmpv.js +36 -0
- package/dist/chunks/managed-policy-1x2knyw4.js +42 -0
- package/dist/chunks/managed-policy-1yq9hg58.js +16 -0
- package/dist/chunks/managed-policy-23kefcxh.js +185 -0
- package/dist/chunks/managed-policy-27w5k9zf.js +18 -0
- package/dist/chunks/managed-policy-2bvfvv2f.js +377 -0
- package/dist/chunks/managed-policy-2d18vb37.js +214 -0
- package/dist/chunks/managed-policy-2dkjcnxp.js +18 -0
- package/dist/chunks/managed-policy-2gg6rc14.js +88 -0
- package/dist/chunks/managed-policy-2hmajwep.js +90 -0
- package/dist/chunks/managed-policy-2p60zmnr.js +90 -0
- package/dist/chunks/managed-policy-2pfvsp26.js +96 -0
- package/dist/chunks/managed-policy-2x7r0f3m.js +241 -0
- package/dist/chunks/managed-policy-301zw7a8.js +125 -0
- package/dist/chunks/managed-policy-342x44y2.js +207 -0
- package/dist/chunks/managed-policy-3cbjf1nt.js +17 -0
- package/dist/chunks/managed-policy-3cy6ygha.js +137 -0
- package/dist/chunks/managed-policy-3g148s1m.js +331 -0
- package/dist/chunks/managed-policy-3hepkmqq.js +13 -0
- package/dist/chunks/managed-policy-3j7my4jc.js +544 -0
- package/dist/chunks/managed-policy-3mcfa6v5.js +48 -0
- package/dist/chunks/managed-policy-3nnrz6f6.js +13 -0
- package/dist/chunks/managed-policy-3raxg473.js +107 -0
- package/dist/chunks/managed-policy-40y6dtc2.js +175 -0
- package/dist/chunks/managed-policy-43vtf5ez.js +52 -0
- package/dist/chunks/managed-policy-44pmzq9c.js +41 -0
- package/dist/chunks/managed-policy-46f0n3mz.js +42 -0
- package/dist/chunks/managed-policy-4dx1dgte.js +16 -0
- package/dist/chunks/managed-policy-4pyp9zr9.js +63 -0
- package/dist/chunks/managed-policy-4qk9sjk2.js +9 -0
- package/dist/chunks/managed-policy-4tgxq4wm.js +672 -0
- package/dist/chunks/managed-policy-4v008n1t.js +13 -0
- package/dist/chunks/managed-policy-4zpq2btv.js +40 -0
- package/dist/chunks/managed-policy-50kxyvzf.js +41 -0
- package/dist/chunks/managed-policy-5c0ay57s.js +410 -0
- package/dist/chunks/managed-policy-5cce1w9d.js +148 -0
- package/dist/chunks/managed-policy-5cg6g8ft.js +284 -0
- package/dist/chunks/managed-policy-5m110vqw.js +163 -0
- package/dist/chunks/managed-policy-5m9w47nd.js +21 -0
- package/dist/chunks/managed-policy-5rz96m0v.js +37 -0
- package/dist/chunks/managed-policy-5tn1y83c.js +50 -0
- package/dist/chunks/managed-policy-5x1ng7wb.js +118 -0
- package/dist/chunks/managed-policy-677zxbpd.js +134 -0
- package/dist/chunks/managed-policy-694dpcrp.js +55 -0
- package/dist/chunks/managed-policy-6esdw8yj.js +34 -0
- package/dist/chunks/managed-policy-6r3p3n96.js +587 -0
- package/dist/chunks/managed-policy-6v74jygm.js +147 -0
- package/dist/chunks/managed-policy-6w2evtem.js +106 -0
- package/dist/chunks/managed-policy-6yt02x6s.js +111 -0
- package/dist/chunks/managed-policy-7238w2mc.js +921 -0
- package/dist/chunks/managed-policy-7614g9cd.js +101 -0
- package/dist/chunks/managed-policy-76cb1hcw.js +63 -0
- package/dist/chunks/managed-policy-775hqbnd.js +34 -0
- package/dist/chunks/managed-policy-7a2bwsmz.js +41 -0
- package/dist/chunks/managed-policy-7bmhse3q.js +118 -0
- package/dist/chunks/managed-policy-7f39s14e.js +262 -0
- package/dist/chunks/managed-policy-7gkv1w5n.js +115 -0
- package/dist/chunks/managed-policy-7kr66rt3.js +2158 -0
- package/dist/chunks/managed-policy-7mjyqtes.js +279 -0
- package/dist/chunks/managed-policy-7q7kx5g5.js +75 -0
- package/dist/chunks/managed-policy-7tgsj2ey.js +22 -0
- package/dist/chunks/managed-policy-7w2ypzdf.js +62 -0
- package/dist/chunks/managed-policy-7xpvxp2y.js +347 -0
- package/dist/chunks/managed-policy-7yrj8xks.js +348 -0
- package/dist/chunks/managed-policy-871z2bcy.js +489 -0
- package/dist/chunks/managed-policy-87gvg0a0.js +668 -0
- package/dist/chunks/managed-policy-89287pr7.js +78 -0
- package/dist/chunks/managed-policy-8b3vzgkx.js +17 -0
- package/dist/chunks/managed-policy-8cg7mtm3.js +31 -0
- package/dist/chunks/managed-policy-8hfctyyf.js +37 -0
- package/dist/chunks/managed-policy-8wtp7s3z.js +14 -0
- package/dist/chunks/managed-policy-8x9y3wj0.js +155 -0
- package/dist/chunks/managed-policy-8xkn4akv.js +44 -0
- package/dist/chunks/managed-policy-8z6m94af.js +133 -0
- package/dist/chunks/managed-policy-90zstvax.js +129 -0
- package/dist/chunks/managed-policy-952e4ypq.js +182 -0
- package/dist/chunks/managed-policy-97tsyh9q.js +38 -0
- package/dist/chunks/managed-policy-99ck8jks.js +186 -0
- package/dist/chunks/managed-policy-9hx1hw3k.js +171 -0
- package/dist/chunks/managed-policy-9j7zhwfa.js +79 -0
- package/dist/chunks/managed-policy-9m4qvb7h.js +133 -0
- package/dist/chunks/managed-policy-9q8g9sv8.js +31 -0
- package/dist/chunks/managed-policy-a0yz26ze.js +579 -0
- package/dist/chunks/managed-policy-a8sz7btp.js +81 -0
- package/dist/chunks/managed-policy-a9gbcbk6.js +38 -0
- package/dist/chunks/managed-policy-aesfxpby.js +272 -0
- package/dist/chunks/managed-policy-aj7mw0zk.js +43 -0
- package/dist/chunks/managed-policy-axe3mf62.js +7 -0
- package/dist/chunks/managed-policy-axsmrxj2.js +72 -0
- package/dist/chunks/managed-policy-b21h08s4.js +177 -0
- package/dist/chunks/managed-policy-b46pyqdy.js +99 -0
- package/dist/chunks/managed-policy-b6c60c1v.js +52 -0
- package/dist/chunks/managed-policy-b6vsg801.js +406 -0
- package/dist/chunks/managed-policy-b9m4jzkq.js +43 -0
- package/dist/chunks/managed-policy-bf1eawsr.js +544 -0
- package/dist/chunks/managed-policy-bktkba0q.js +71 -0
- package/dist/chunks/managed-policy-bmtx4gk1.js +26 -0
- package/dist/chunks/managed-policy-bp7ggn9c.js +552 -0
- package/dist/chunks/managed-policy-bqa8ney4.js +450 -0
- package/dist/chunks/managed-policy-bsdan8ex.js +63 -0
- package/dist/chunks/managed-policy-bstexjd6.js +175 -0
- package/dist/chunks/managed-policy-c5h69n0a.js +291 -0
- package/dist/chunks/managed-policy-chbq5xd6.js +108 -0
- package/dist/chunks/managed-policy-chgrs643.js +70 -0
- package/dist/chunks/managed-policy-cmypnb63.js +407 -0
- package/dist/chunks/managed-policy-cpc60jjn.js +111 -0
- package/dist/chunks/managed-policy-cpdsp3va.js +16 -0
- package/dist/chunks/managed-policy-crzbtfky.js +90 -0
- package/dist/chunks/managed-policy-cw5vsa54.js +51 -0
- package/dist/chunks/managed-policy-cwrgdav8.js +83 -0
- package/dist/chunks/managed-policy-czwy3yzx.js +49 -0
- package/dist/chunks/managed-policy-d4v9tmah.js +25 -0
- package/dist/chunks/managed-policy-d6v0v4m3.js +238 -0
- package/dist/chunks/managed-policy-dbccrw1t.js +20 -0
- package/dist/chunks/managed-policy-dm96v471.js +377 -0
- package/dist/chunks/managed-policy-dn8c34gg.js +664 -0
- package/dist/chunks/managed-policy-dr0rs2xp.js +710 -0
- package/dist/chunks/managed-policy-drt3gbxv.js +35 -0
- package/dist/chunks/managed-policy-dt77769w.js +53 -0
- package/dist/chunks/managed-policy-dv96216k.js +200 -0
- package/dist/chunks/managed-policy-dzmeyxpm.js +400 -0
- package/dist/chunks/managed-policy-e2pyhyep.js +283 -0
- package/dist/chunks/managed-policy-e834z07m.js +50 -0
- package/dist/chunks/managed-policy-edgrr010.js +226 -0
- package/dist/chunks/managed-policy-efm4fks5.js +187 -0
- package/dist/chunks/managed-policy-eqw4pqj1.js +48 -0
- package/dist/chunks/managed-policy-es8q0qfk.js +201 -0
- package/dist/chunks/managed-policy-ev3zcxk3.js +611 -0
- package/dist/chunks/managed-policy-evr76v84.js +94 -0
- package/dist/chunks/managed-policy-f1kswy8d.js +98 -0
- package/dist/chunks/managed-policy-f1rz58n2.js +183 -0
- package/dist/chunks/managed-policy-f7cq85kc.js +224 -0
- package/dist/chunks/managed-policy-fffv3p7h.js +143 -0
- package/dist/chunks/managed-policy-fg9p65nk.js +37 -0
- package/dist/chunks/managed-policy-fn6vwd7v.js +123 -0
- package/dist/chunks/managed-policy-fnxs6vtz.js +122 -0
- package/dist/chunks/managed-policy-fp8qmr14.js +86 -0
- package/dist/chunks/managed-policy-fttttc4d.js +74 -0
- package/dist/chunks/managed-policy-fw9gz695.js +235 -0
- package/dist/chunks/managed-policy-g3mnxttw.js +388 -0
- package/dist/chunks/managed-policy-g4nf7z75.js +166 -0
- package/dist/chunks/managed-policy-gbjdnr5j.js +72 -0
- package/dist/chunks/managed-policy-gctj0z7k.js +31 -0
- package/dist/chunks/managed-policy-gep8wh7y.js +282 -0
- package/dist/chunks/managed-policy-gjgwqcba.js +103 -0
- package/dist/chunks/managed-policy-gm8bcebx.js +72 -0
- package/dist/chunks/managed-policy-gn6qas9s.js +61 -0
- package/dist/chunks/managed-policy-gngw7g2s.js +167 -0
- package/dist/chunks/managed-policy-gp2j5m4a.js +93 -0
- package/dist/chunks/managed-policy-gq9rvz9h.js +51 -0
- package/dist/chunks/managed-policy-gr79f0h4.js +71 -0
- package/dist/chunks/managed-policy-gr9j8g1s.js +200 -0
- package/dist/chunks/managed-policy-gv3gx93w.js +44 -0
- package/dist/chunks/managed-policy-h382f8tg.js +128 -0
- package/dist/chunks/managed-policy-hh7kjqtw.js +66 -0
- package/dist/chunks/managed-policy-hk70k2n5.js +80 -0
- package/dist/chunks/managed-policy-hpg1pkwy.js +20 -0
- package/dist/chunks/managed-policy-hryjy69m.js +73 -0
- package/dist/chunks/managed-policy-j41g7s1w.js +135 -0
- package/dist/chunks/managed-policy-j5y2avbr.js +95 -0
- package/dist/chunks/managed-policy-j6ddadsn.js +156 -0
- package/dist/chunks/managed-policy-j828s1jm.js +56 -0
- package/dist/chunks/managed-policy-j9nxzz3g.js +107 -0
- package/dist/chunks/managed-policy-jbhdsrfy.js +35 -0
- package/dist/chunks/managed-policy-jfy3r84g.js +96 -0
- package/dist/chunks/managed-policy-js1877xv.js +180 -0
- package/dist/chunks/managed-policy-jt927r8x.js +139 -0
- package/dist/chunks/managed-policy-jtnps1zs.js +154 -0
- package/dist/chunks/managed-policy-jv4a27p2.js +173 -0
- package/dist/chunks/managed-policy-kexf90ff.js +120 -0
- package/dist/chunks/managed-policy-kjx7nxp1.js +31 -0
- package/dist/chunks/managed-policy-kq14pwqr.js +162 -0
- package/dist/chunks/managed-policy-kqyk658n.js +537 -0
- package/dist/chunks/managed-policy-kt3bjfbg.js +26 -0
- package/dist/chunks/managed-policy-ktnj6s6m.js +126 -0
- package/dist/chunks/managed-policy-kv323n4c.js +278 -0
- package/dist/chunks/managed-policy-m03f1x9p.js +173 -0
- package/dist/chunks/managed-policy-m0j6s1s2.js +201 -0
- package/dist/chunks/managed-policy-m1714858.js +39 -0
- package/dist/chunks/managed-policy-m3g4sgcy.js +149 -0
- package/dist/chunks/managed-policy-m3kvqs0d.js +49 -0
- package/dist/chunks/managed-policy-m89y74mg.js +62 -0
- package/dist/chunks/managed-policy-m9w0rfyh.js +123 -0
- package/dist/chunks/managed-policy-mar5fkdv.js +181 -0
- package/dist/chunks/managed-policy-mcc078bm.js +325 -0
- package/dist/chunks/managed-policy-meb59cap.js +465 -0
- package/dist/chunks/managed-policy-memmdkn0.js +443 -0
- package/dist/chunks/managed-policy-mqe7nf5n.js +262 -0
- package/dist/chunks/managed-policy-mr0kez6w.js +591 -0
- package/dist/chunks/managed-policy-msd2a3qm.js +164 -0
- package/dist/chunks/managed-policy-na2p7d06.js +792 -0
- package/dist/chunks/managed-policy-na4m6azm.js +58 -0
- package/dist/chunks/managed-policy-nah043kf.js +42 -0
- package/dist/chunks/managed-policy-ndpcgwxm.js +34 -0
- package/dist/chunks/managed-policy-ngbaxw0x.js +84 -0
- package/dist/chunks/managed-policy-ngcdy70d.js +336 -0
- package/dist/chunks/managed-policy-nnmm0w4p.js +66 -0
- package/dist/chunks/managed-policy-nnsgq7r2.js +368 -0
- package/dist/chunks/managed-policy-npr5d5bn.js +213 -0
- package/dist/chunks/managed-policy-nq4nx86v.js +343 -0
- package/dist/chunks/managed-policy-ntjndndw.js +65 -0
- package/dist/chunks/managed-policy-nv9k8p4n.js +102 -0
- package/dist/chunks/managed-policy-nvj34tc6.js +184 -0
- package/dist/chunks/managed-policy-nwjkfwc1.js +126 -0
- package/dist/chunks/managed-policy-nx4vzyjd.js +37 -0
- package/dist/chunks/managed-policy-p015t6z3.js +38 -0
- package/dist/chunks/managed-policy-p2tvx8t7.js +54 -0
- package/dist/chunks/managed-policy-p34qee05.js +184 -0
- package/dist/chunks/managed-policy-p59vkkbe.js +46 -0
- package/dist/chunks/managed-policy-pavzsgq8.js +38 -0
- package/dist/chunks/managed-policy-pknna89w.js +18 -0
- package/dist/chunks/managed-policy-pm0m0915.js +42 -0
- package/dist/chunks/managed-policy-pnwsrq7c.js +72 -0
- package/dist/chunks/managed-policy-pqg1n5x7.js +75 -0
- package/dist/chunks/managed-policy-qfdetvt9.js +258 -0
- package/dist/chunks/managed-policy-qjbth495.js +107 -0
- package/dist/chunks/managed-policy-qkw2jr9b.js +132 -0
- package/dist/chunks/managed-policy-qncnsg79.js +236 -0
- package/dist/chunks/managed-policy-qp7r0hxv.js +120 -0
- package/dist/chunks/managed-policy-qq3x3gsn.js +748 -0
- package/dist/chunks/managed-policy-qqvy8y24.js +45 -0
- package/dist/chunks/managed-policy-qsdghx1p.js +82 -0
- package/dist/chunks/managed-policy-qt4dfm0j.js +597 -0
- package/dist/chunks/managed-policy-qvtm1f9z.js +97 -0
- package/dist/chunks/managed-policy-qxk5146j.js +82 -0
- package/dist/chunks/managed-policy-r0chqwjk.js +113 -0
- package/dist/chunks/managed-policy-r2p6g2q1.js +33 -0
- package/dist/chunks/managed-policy-r542h3bh.js +54 -0
- package/dist/chunks/managed-policy-r6hfzmwj.js +49 -0
- package/dist/chunks/managed-policy-ra6js1h8.js +32 -0
- package/dist/chunks/managed-policy-rb9dy4dg.js +116 -0
- package/dist/chunks/managed-policy-rbg54dp1.js +18 -0
- package/dist/chunks/managed-policy-rg0fjkdq.js +94 -0
- package/dist/chunks/managed-policy-rhkan3j9.js +126 -0
- package/dist/chunks/managed-policy-rjm4cfws.js +142 -0
- package/dist/chunks/managed-policy-rnnvhnyd.js +182 -0
- package/dist/chunks/managed-policy-rqq4mjft.js +40 -0
- package/dist/chunks/managed-policy-rrc2vz85.js +261 -0
- package/dist/chunks/managed-policy-rt5dr6hb.js +14 -0
- package/dist/chunks/managed-policy-rxjh50d4.js +224 -0
- package/dist/chunks/managed-policy-ryekpbgv.js +110 -0
- package/dist/chunks/managed-policy-rzdnk3g6.js +80 -0
- package/dist/chunks/managed-policy-s0ryy5f2.js +68 -0
- package/dist/chunks/managed-policy-s0srsftn.js +121 -0
- package/dist/chunks/managed-policy-s26c8eb5.js +31 -0
- package/dist/chunks/managed-policy-s3n585rv.js +351 -0
- package/dist/chunks/managed-policy-s6h2s3rz.js +26 -0
- package/dist/chunks/managed-policy-s7r98v9s.js +313 -0
- package/dist/chunks/managed-policy-sa3fpqfw.js +46 -0
- package/dist/chunks/managed-policy-sbya78hr.js +67 -0
- package/dist/chunks/managed-policy-scmk72rv.js +75 -0
- package/dist/chunks/managed-policy-shg116xf.js +36 -0
- package/dist/chunks/managed-policy-svcy3p9a.js +38 -0
- package/dist/chunks/managed-policy-svzsvdng.js +89 -0
- package/dist/chunks/managed-policy-sy4xarwe.js +96 -0
- package/dist/chunks/managed-policy-szd7q828.js +49 -0
- package/dist/chunks/managed-policy-szwm4crx.js +34 -0
- package/dist/chunks/managed-policy-t0dcc9fc.js +342 -0
- package/dist/chunks/managed-policy-t4yx2rky.js +226 -0
- package/dist/chunks/managed-policy-tczq8hjw.js +25 -0
- package/dist/chunks/managed-policy-tfcs9jg5.js +221 -0
- package/dist/chunks/managed-policy-tg7s7b5t.js +39 -0
- package/dist/chunks/managed-policy-tr8x705m.js +22 -0
- package/dist/chunks/managed-policy-ttamz1z5.js +379 -0
- package/dist/chunks/managed-policy-tw6km0zc.js +378 -0
- package/dist/chunks/managed-policy-twssxy5n.js +170 -0
- package/dist/chunks/managed-policy-tzp7gddb.js +123 -0
- package/dist/chunks/managed-policy-v2r1d0zg.js +86 -0
- package/dist/chunks/managed-policy-v8vd993n.js +31 -0
- package/dist/chunks/managed-policy-v9385mjb.js +348 -0
- package/dist/chunks/managed-policy-v9jbzfq6.js +247 -0
- package/dist/chunks/managed-policy-vjf35v1f.js +110 -0
- package/dist/chunks/managed-policy-vmqe41cb.js +40 -0
- package/dist/chunks/managed-policy-vq0qa3sh.js +53 -0
- package/dist/chunks/managed-policy-vt2d6wap.js +67 -0
- package/dist/chunks/managed-policy-vvv61zch.js +197 -0
- package/dist/chunks/managed-policy-vyjz7kgq.js +43 -0
- package/dist/chunks/managed-policy-vzppetdn.js +59 -0
- package/dist/chunks/managed-policy-w0kpx8b2.js +184 -0
- package/dist/chunks/managed-policy-w1hvwc50.js +198 -0
- package/dist/chunks/managed-policy-w2eysc6j.js +64 -0
- package/dist/chunks/managed-policy-w3wsvvr9.js +80 -0
- package/dist/chunks/managed-policy-w50e04pv.js +444 -0
- package/dist/chunks/managed-policy-wabm22eq.js +258 -0
- package/dist/chunks/managed-policy-wakvkjy4.js +79 -0
- package/dist/chunks/managed-policy-wd87259q.js +102 -0
- package/dist/chunks/managed-policy-wnehvpwn.js +539 -0
- package/dist/chunks/managed-policy-wnhgecwx.js +93 -0
- package/dist/chunks/managed-policy-wq4nqtd2.js +63 -0
- package/dist/chunks/managed-policy-wr3re1en.js +22 -0
- package/dist/chunks/managed-policy-x1fpqxa0.js +311 -0
- package/dist/chunks/managed-policy-x93fa6v5.js +75 -0
- package/dist/chunks/managed-policy-xf2m19e3.js +319 -0
- package/dist/chunks/managed-policy-xq7fqyqm.js +215 -0
- package/dist/chunks/managed-policy-xvqq26aw.js +81 -0
- package/dist/chunks/managed-policy-y1ymskfp.js +257 -0
- package/dist/chunks/managed-policy-y9cx934m.js +416 -0
- package/dist/chunks/managed-policy-yb20nhc3.js +229 -0
- package/dist/chunks/managed-policy-yb9wrz09.js +97 -0
- package/dist/chunks/managed-policy-yg8ahdeb.js +355 -0
- package/dist/chunks/managed-policy-yh6ks7t5.js +73 -0
- package/dist/chunks/managed-policy-yq2fbvdd.js +148 -0
- package/dist/chunks/managed-policy-yr705xyq.js +17 -0
- package/dist/chunks/managed-policy-yts2a8qm.js +28 -0
- package/dist/chunks/managed-policy-yvv8rcn4.js +140 -0
- package/dist/chunks/managed-policy-yzw5d0av.js +868 -0
- package/dist/chunks/managed-policy-z0b170et.js +97 -0
- package/dist/chunks/managed-policy-z19jtcrd.js +116 -0
- package/dist/chunks/managed-policy-z2bgjz14.js +141 -0
- package/dist/chunks/managed-policy-z87ddsz1.js +123 -0
- package/dist/chunks/managed-policy-zb6ab1v1.js +35 -0
- package/dist/chunks/managed-policy-zmp3xgvf.js +201 -0
- package/dist/chunks/managed-policy-zr81ag5j.js +201 -0
- package/dist/codemode/catalog.js +1 -1
- package/dist/codemode/execution.js +8 -0
- package/dist/codemode/fetch.js +153 -0
- package/dist/codemode/instructions.js +11 -11
- package/dist/codemode/tool.js +152 -151
- package/dist/command.js +93 -93
- package/dist/config/discovery.js +94 -94
- package/dist/config/integration.js +5 -5
- package/dist/config/managed.js +1 -1
- package/dist/config/markdown.js +1 -1
- package/dist/config/normalize.js +111 -111
- package/dist/config/plugin/agent.js +131 -131
- package/dist/config/plugin/command.js +229 -228
- package/dist/config/plugin/compaction.js +170 -169
- package/dist/config/plugin/compatibility.js +149 -149
- package/dist/config/plugin/entry-observer.js +1 -1
- package/dist/config/plugin/formatter.js +130 -130
- package/dist/config/plugin/image.js +129 -129
- package/dist/config/plugin/instruction.js +129 -129
- package/dist/config/plugin/location-watcher.js +131 -131
- package/dist/config/plugin/mcp.js +138 -138
- package/dist/config/plugin/policy.js +129 -129
- package/dist/config/plugin/provider.js +131 -131
- package/dist/config/plugin/reference.js +131 -131
- package/dist/config/plugin/shell.js +131 -131
- package/dist/config/plugin/skill-file.js +145 -145
- package/dist/config/plugin/skill-scan.js +1 -1
- package/dist/config/plugin/skill.js +150 -150
- package/dist/config/plugin/snapshot.js +129 -129
- package/dist/config/plugin/source.js +128 -128
- package/dist/config/plugin/tool-output.js +130 -130
- package/dist/config/plugin/websearch.js +130 -130
- package/dist/config/plugin/worktree.js +131 -131
- package/dist/config/variable.js +1 -1
- package/dist/config/watch.js +1 -1
- package/dist/config.js +132 -132
- package/dist/console-access.js +1 -1
- package/dist/credential/sql.js +2 -2
- package/dist/credential.js +91 -91
- package/dist/database/database.js +78 -78
- 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.gen.js +59 -59
- package/dist/database/migration.js +61 -61
- package/dist/database/path.js +2 -2
- package/dist/database/schema.gen.js +1 -1
- package/dist/database/schema.sql.js +1 -1
- package/dist/database/sqlite.bun.js +1 -1
- package/dist/database/sqlite.js +1 -1
- package/dist/database/sqlite.node.js +1 -1
- package/dist/database/sqlite.workerd.js +1 -1
- package/dist/database/v1-migration.bun.js +102 -102
- package/dist/database/v1-migration.js +1 -1
- package/dist/effect/app-node-builder.js +424 -392
- 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 +107 -107
- 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 +84 -84
- package/dist/file-access.js +155 -155
- package/dist/file-mutation.js +106 -106
- package/dist/file-retention.js +1 -1
- package/dist/filesystem/fff.bun.js +2 -2
- package/dist/filesystem/fff.js +1 -1
- package/dist/filesystem/fff.node.js +2 -2
- package/dist/filesystem/fff.workerd.js +2 -2
- package/dist/filesystem/file-watch.js +90 -90
- package/dist/filesystem/location-watcher-policy.js +6 -6
- package/dist/filesystem/location-watcher.js +242 -241
- package/dist/filesystem/protected.js +1 -1
- package/dist/filesystem/search.js +111 -111
- package/dist/filesystem/watcher-binding.js +3 -3
- package/dist/filesystem/watcher.js +11 -11
- package/dist/filesystem.js +112 -112
- package/dist/form.js +90 -90
- package/dist/formatter/builtins.js +4 -4
- package/dist/formatter.js +99 -99
- package/dist/generate.js +119 -119
- package/dist/git.js +11 -11
- package/dist/github-copilot/chat/convert-to-openai-compatible-chat-messages.js +1 -1
- package/dist/github-copilot/chat/get-response-metadata.js +1 -1
- package/dist/github-copilot/chat/map-openai-compatible-finish-reason.js +1 -1
- package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +7 -7
- package/dist/github-copilot/chat/openai-compatible-chat-options.js +1 -1
- package/dist/github-copilot/chat/openai-compatible-prepare-tools.js +1 -1
- package/dist/github-copilot/copilot-provider.js +17 -17
- package/dist/github-copilot/models.js +105 -105
- package/dist/github-copilot/openai-compatible-error.js +1 -1
- package/dist/github-copilot/responses/convert-to-openai-responses-input.js +1 -1
- package/dist/github-copilot/responses/map-openai-responses-finish-reason.js +1 -1
- package/dist/github-copilot/responses/openai-error.js +1 -1
- package/dist/github-copilot/responses/openai-responses-language-model.js +10 -10
- package/dist/github-copilot/responses/openai-responses-prepare-tools.js +6 -6
- package/dist/github-copilot/responses/tool/code-interpreter.js +1 -1
- package/dist/github-copilot/responses/tool/file-search.js +1 -1
- package/dist/github-copilot/responses/tool/image-generation.js +1 -1
- package/dist/github-copilot/responses/tool/web-search-preview.js +1 -1
- package/dist/github-copilot/responses/tool/web-search.js +1 -1
- package/dist/image/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 +415 -383
- package/dist/instruction-discovery.js +94 -94
- package/dist/instructions/builtins.js +99 -99
- package/dist/instructions/index.js +7 -5
- package/dist/integration/connection.js +3 -3
- package/dist/integration.js +97 -97
- package/dist/job.js +88 -88
- package/dist/kv/sql.js +2 -2
- package/dist/kv.js +83 -83
- package/dist/location-activity.js +173 -173
- package/dist/location-lifecycle.js +149 -149
- package/dist/location-service-map.js +98 -98
- package/dist/location-services.js +412 -380
- package/dist/location.js +95 -95
- package/dist/managed-policy.js +3 -3
- package/dist/mcp/client.js +103 -103
- package/dist/mcp/index.js +115 -115
- package/dist/mcp/instructions.js +178 -177
- package/dist/mcp/oauth.js +88 -88
- package/dist/mcp/socket-client.js +1 -1
- package/dist/mcp/stdio.js +102 -102
- package/dist/mime.js +1 -1
- package/dist/modal/models.js +105 -105
- package/dist/model-resolver.js +111 -111
- package/dist/model-retry.js +1 -1
- package/dist/model.js +112 -112
- package/dist/models-dev/v1.js +1 -1
- package/dist/models-dev.js +114 -114
- package/dist/oauth/page.js +1 -1
- package/dist/permission/saved.js +90 -90
- package/dist/permission/sql.js +5 -5
- package/dist/permission.js +150 -150
- package/dist/persistent-pty/binary.bun.js +1 -1
- package/dist/persistent-pty/daemon.js +1 -1
- package/dist/persistent-pty/index.js +100 -100
- package/dist/persistent-pty/pty-binding.js +1 -1
- package/dist/persistent-pty.js +85 -85
- package/dist/plugin/agent.js +86 -86
- package/dist/plugin/command.js +114 -114
- package/dist/plugin/goal.js +3 -3
- package/dist/plugin/hooks.js +7 -7
- package/dist/plugin/host.js +235 -234
- package/dist/plugin/identity.js +5 -5
- package/dist/plugin/instance.js +5 -5
- package/dist/plugin/internal.js +391 -359
- package/dist/plugin/mcp-codemode-defaults.js +3 -3
- package/dist/plugin/models-dev.js +109 -109
- package/dist/plugin/module.js +128 -128
- package/dist/plugin/optimize.js +2 -2
- package/dist/plugin/plan.js +145 -145
- package/dist/plugin/promise.js +1 -1
- package/dist/plugin/provider/amazon-bedrock.js +103 -103
- package/dist/plugin/provider/azure.js +129 -129
- package/dist/plugin/provider/cerebras.js +1 -1
- package/dist/plugin/provider/chatgpt.js +129 -129
- package/dist/plugin/provider/claude-agent/aisdk.js +121 -0
- package/dist/plugin/provider/claude-agent/claude/agent-sdk.js +2 -0
- package/dist/plugin/provider/claude-agent/claude/agent-sdk.workerd.js +2 -0
- package/dist/plugin/provider/claude-agent/claude/fork.js +9 -0
- package/dist/plugin/provider/claude-agent/claude/io.js +11 -0
- package/dist/plugin/provider/claude-agent/claude/probe.js +15 -0
- package/dist/plugin/provider/claude-agent/claude/query-options.js +15 -0
- package/dist/plugin/provider/claude-agent/claude/sdk.js +8 -0
- package/dist/plugin/provider/claude-agent/claude/session.js +11 -0
- package/dist/plugin/provider/claude-agent/claude/sessions.js +27 -0
- package/dist/plugin/provider/claude-agent/claude/status.js +14 -0
- package/dist/plugin/provider/claude-agent/index.js +151 -0
- package/dist/plugin/provider/claude-agent/instructions.js +116 -0
- package/dist/plugin/provider/claude-agent/integration.js +119 -0
- package/dist/plugin/provider/claude-agent/language-model/claude-agent-error.js +8 -0
- package/dist/plugin/provider/claude-agent/language-model/claude-agent-language-model.js +14 -0
- package/dist/plugin/provider/claude-agent/language-model/convert-claude-stream.js +11 -0
- package/dist/plugin/provider/claude-agent/language-model/convert-to-claude-message.js +8 -0
- package/dist/plugin/provider/claude-agent/language-model/request-kind.js +12 -0
- package/dist/plugin/provider/claude-agent/language-model/system-prompt.js +14 -0
- package/dist/plugin/provider/claude-agent/language-model/usage.js +8 -0
- package/dist/plugin/provider/claude-agent/provider.js +120 -0
- package/dist/plugin/provider/claude-agent/session.js +116 -0
- package/dist/plugin/provider/claude-agent/sync/catch-up.js +10 -0
- package/dist/plugin/provider/claude-agent/sync/checkpoints.js +9 -0
- package/dist/plugin/provider/claude-agent/sync/decide.js +11 -0
- package/dist/plugin/provider/claude-agent/sync/fingerprint.js +8 -0
- package/dist/plugin/provider/claude-agent/sync/record.js +8 -0
- package/dist/plugin/provider/claude-agent/tools/hooks.js +8 -0
- package/dist/plugin/provider/claude-agent/tools/names.js +14 -0
- package/dist/plugin/provider/claude-agent/tools/pending.js +8 -0
- package/dist/plugin/provider/claude-agent/tools/result.js +12 -0
- package/dist/plugin/provider/claude-agent/tools/server.js +9 -0
- package/dist/plugin/provider/cloudflare-ai-gateway.js +127 -127
- package/dist/plugin/provider/cloudflare-workers-ai.js +127 -127
- package/dist/plugin/provider/configured.js +125 -125
- package/dist/plugin/provider/credential-settings.js +84 -84
- package/dist/plugin/provider/databricks.js +1 -1
- package/dist/plugin/provider/digitalocean.js +105 -105
- package/dist/plugin/provider/dynamic.js +2 -2
- package/dist/plugin/provider/github-copilot.js +107 -107
- package/dist/plugin/provider/gitlab.js +106 -106
- package/dist/plugin/provider/google-vertex.js +126 -126
- package/dist/plugin/provider/kilo.js +1 -1
- package/dist/plugin/provider/llmgateway.js +88 -88
- package/dist/plugin/provider/lmstudio.js +138 -138
- package/dist/plugin/provider/local.js +135 -135
- package/dist/plugin/provider/modal.js +104 -104
- package/dist/plugin/provider/neon.js +1 -1
- package/dist/plugin/provider/nvidia.js +1 -1
- package/dist/plugin/provider/ollama.js +138 -138
- package/dist/plugin/provider/openai-context-caps.js +102 -102
- package/dist/plugin/provider/openai.js +129 -129
- package/dist/plugin/provider/opencode.js +131 -131
- package/dist/plugin/provider/openrouter.js +103 -103
- package/dist/plugin/provider/poe.js +89 -89
- package/dist/plugin/provider/prompt-cache-key.js +1 -1
- package/dist/plugin/provider/sap-ai-core.js +103 -103
- package/dist/plugin/provider/sdk-factory.js +1 -1
- package/dist/plugin/provider/snowflake-cortex.js +128 -128
- package/dist/plugin/provider/vllm.js +138 -138
- package/dist/plugin/provider/xai.js +103 -103
- package/dist/plugin/provider/zenmux.js +1 -1
- package/dist/plugin/provider.js +209 -178
- package/dist/plugin/sdk.js +86 -86
- package/dist/plugin/service.js +3 -3
- package/dist/plugin/skill.js +148 -148
- package/dist/plugin/source-directory.js +1 -1
- package/dist/plugin/supervisor.js +403 -371
- package/dist/plugin/tool-input-repair.js +4 -4
- package/dist/plugin/update.js +6 -6
- package/dist/plugin/vcs/git.js +98 -98
- package/dist/plugin/vcs/hg.js +98 -98
- package/dist/plugin/verbosity.js +105 -105
- package/dist/plugin/warming.js +127 -127
- package/dist/plugin/websearch/exa.js +7 -7
- package/dist/plugin/websearch/firecrawl.js +8 -8
- package/dist/plugin/websearch/index.js +9 -9
- package/dist/plugin/websearch/mcp.js +6 -6
- package/dist/plugin/websearch/parallel.js +8 -8
- package/dist/plugin/websearch/tavily.js +6 -6
- package/dist/plugin/websearch/tinyfish.js +8 -8
- package/dist/plugin.js +238 -237
- package/dist/project/icon.js +5 -5
- package/dist/project/schema.js +6 -6
- package/dist/project/sql.js +4 -4
- package/dist/project.js +96 -96
- package/dist/provider.js +113 -113
- package/dist/pty/protocol.js +1 -1
- package/dist/pty/ticket.js +1 -1
- package/dist/pty.js +108 -108
- package/dist/reference/instructions.js +100 -100
- package/dist/reference.js +102 -102
- package/dist/repository-cache.js +92 -92
- package/dist/repository.js +1 -1
- package/dist/ripgrep/binary.js +2 -2
- package/dist/ripgrep.js +109 -109
- package/dist/rpc.js +98 -98
- package/dist/schedule/check.js +238 -237
- package/dist/schedule/sql.js +6 -6
- package/dist/schedule.js +246 -245
- package/dist/schema.js +1 -1
- package/dist/session/affinity.js +3 -3
- package/dist/session/background.js +1 -1
- package/dist/session/blob.js +128 -128
- package/dist/session/command.js +84 -84
- package/dist/session/compaction.js +172 -171
- package/dist/session/context.js +195 -194
- package/dist/session/diff.js +100 -100
- 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 +240 -239
- package/dist/session/execution.js +161 -161
- package/dist/session/generate.js +199 -198
- package/dist/session/history.js +137 -137
- package/dist/session/inbox.js +148 -148
- package/dist/session/info.js +3 -3
- package/dist/session/instruction-entry.js +87 -87
- package/dist/session/instruction-state.js +8 -8
- package/dist/session/instructions.js +140 -140
- package/dist/session/message-updater.js +4 -4
- package/dist/session/message.js +1 -1
- package/dist/session/model-request.js +167 -166
- package/dist/session/model-transport.js +9 -9
- package/dist/session/move.js +163 -163
- package/dist/session/projector.js +142 -142
- package/dist/session/prompt.js +147 -147
- package/dist/session/recent-text.js +1 -1
- package/dist/session/revert.js +138 -138
- package/dist/session/run-coordinator.js +3 -3
- package/dist/session/runner/index.js +3 -3
- package/dist/session/runner/llm.js +247 -246
- package/dist/session/runner/max-steps.js +1 -1
- package/dist/session/runner/model.js +112 -112
- package/dist/session/runner/publish-llm-event.js +148 -148
- package/dist/session/runner/retry.js +5 -5
- package/dist/session/runner/step.js +162 -161
- package/dist/session/runner/to-llm-message.js +136 -136
- package/dist/session/schema.js +5 -5
- package/dist/session/session.js +181 -181
- package/dist/session/shell.js +145 -145
- package/dist/session/skill.js +148 -148
- package/dist/session/sql.js +5 -5
- package/dist/session/stats.js +83 -83
- package/dist/session/store.js +141 -141
- package/dist/session/stored.js +2 -2
- package/dist/session/subagent-completion.js +1 -1
- package/dist/session/subagent-job.js +227 -226
- package/dist/session/system-prompt.js +7 -7
- package/dist/session/title.js +201 -200
- package/dist/session/to-session-error.js +147 -147
- package/dist/session/transfer.js +237 -236
- package/dist/session/usage.js +1 -1
- package/dist/session.js +233 -232
- package/dist/shell/parse.js +6 -6
- package/dist/shell/result.js +3 -3
- package/dist/shell/scan.js +1 -1
- package/dist/shell/select.js +11 -11
- package/dist/shell.js +145 -145
- package/dist/skill/discovery.js +6 -6
- package/dist/skill/instructions.js +150 -150
- package/dist/skill.js +157 -157
- package/dist/snapshot.js +103 -103
- package/dist/state.js +3 -3
- package/dist/tool/html-markdown.js +1 -1
- package/dist/tool/http-body.js +1 -1
- package/dist/tool/mcp.js +177 -176
- package/dist/tool/plugin/edit.js +163 -163
- package/dist/tool/plugin/file-diff.js +1 -1
- package/dist/tool/plugin/glob.js +163 -163
- package/dist/tool/plugin/grep.js +167 -167
- package/dist/tool/plugin/image-generate.js +237 -236
- package/dist/tool/plugin/mcp-resource.js +161 -161
- package/dist/tool/plugin/opencode.js +160 -160
- package/dist/tool/plugin/patch.js +165 -165
- package/dist/tool/plugin/question.js +147 -147
- package/dist/tool/plugin/read.js +166 -166
- package/dist/tool/plugin/schedule.js +244 -243
- package/dist/tool/plugin/shell.js +233 -232
- package/dist/tool/plugin/skill.js +152 -152
- package/dist/tool/plugin/subagent.js +234 -233
- package/dist/tool/plugin/todo.js +152 -152
- package/dist/tool/plugin/webfetch.js +156 -156
- package/dist/tool/plugin/websearch.js +154 -154
- package/dist/tool/plugin/write.js +165 -165
- package/dist/tool/read-filesystem.js +112 -112
- package/dist/tool/runtime.js +1 -1
- package/dist/tool-output.js +7 -7
- package/dist/tool.js +158 -157
- package/dist/types/agent.d.ts +2 -0
- package/dist/types/aisdk.d.ts +1 -0
- package/dist/types/codemode/execution.d.ts +7 -0
- package/dist/types/codemode/fetch.d.ts +33 -0
- package/dist/types/codemode/tool.d.ts +2 -1
- package/dist/types/instructions/index.d.ts +8 -1
- package/dist/types/model-resolver.d.ts +6 -0
- package/dist/types/model.d.ts +4 -0
- package/dist/types/plugin/provider/claude-agent/aisdk.d.ts +5 -0
- package/dist/types/plugin/provider/claude-agent/claude/agent-sdk.d.ts +1 -0
- package/dist/types/plugin/provider/claude-agent/claude/agent-sdk.workerd.d.ts +1 -0
- package/dist/types/plugin/provider/claude-agent/claude/fork.d.ts +6 -0
- package/dist/types/plugin/provider/claude-agent/claude/io.d.ts +12 -0
- package/dist/types/plugin/provider/claude-agent/claude/probe.d.ts +23 -0
- package/dist/types/plugin/provider/claude-agent/claude/query-options.d.ts +29 -0
- package/dist/types/plugin/provider/claude-agent/claude/sdk.d.ts +3 -0
- package/dist/types/plugin/provider/claude-agent/claude/session.d.ts +19 -0
- package/dist/types/plugin/provider/claude-agent/claude/sessions.d.ts +38 -0
- package/dist/types/plugin/provider/claude-agent/claude/status.d.ts +25 -0
- package/dist/types/plugin/provider/claude-agent/index.d.ts +18 -0
- package/dist/types/plugin/provider/claude-agent/instructions.d.ts +4 -0
- package/dist/types/plugin/provider/claude-agent/integration.d.ts +7 -0
- package/dist/types/plugin/provider/claude-agent/language-model/claude-agent-error.d.ts +3 -0
- package/dist/types/plugin/provider/claude-agent/language-model/claude-agent-language-model.d.ts +17 -0
- package/dist/types/plugin/provider/claude-agent/language-model/convert-claude-stream.d.ts +4 -0
- package/dist/types/plugin/provider/claude-agent/language-model/convert-to-claude-message.d.ts +5 -0
- package/dist/types/plugin/provider/claude-agent/language-model/request-kind.d.ts +4 -0
- package/dist/types/plugin/provider/claude-agent/language-model/system-prompt.d.ts +11 -0
- package/dist/types/plugin/provider/claude-agent/language-model/usage.d.ts +16 -0
- package/dist/types/plugin/provider/claude-agent/provider.d.ts +9 -0
- package/dist/types/plugin/provider/claude-agent/session.d.ts +4 -0
- package/dist/types/plugin/provider/claude-agent/sync/catch-up.d.ts +4 -0
- package/dist/types/plugin/provider/claude-agent/sync/checkpoints.d.ts +14 -0
- package/dist/types/plugin/provider/claude-agent/sync/decide.d.ts +18 -0
- package/dist/types/plugin/provider/claude-agent/sync/fingerprint.d.ts +11 -0
- package/dist/types/plugin/provider/claude-agent/sync/record.d.ts +31 -0
- package/dist/types/plugin/provider/claude-agent/tools/hooks.d.ts +4 -0
- package/dist/types/plugin/provider/claude-agent/tools/names.d.ts +6 -0
- package/dist/types/plugin/provider/claude-agent/tools/pending.d.ts +12 -0
- package/dist/types/plugin/provider/claude-agent/tools/result.d.ts +14 -0
- package/dist/types/plugin/provider/claude-agent/tools/server.d.ts +5 -0
- package/dist/types/provider.d.ts +4 -0
- package/dist/types/session/context.d.ts +1 -1
- package/dist/types/session/history.d.ts +2 -2
- package/dist/types/session/instruction-state.d.ts +2 -2
- package/dist/types/session/model-request.d.ts +2 -1
- package/dist/types/session/runner/model.d.ts +1 -0
- package/dist/types/session/schema.d.ts +2 -0
- package/dist/types/session/transfer.d.ts +8 -0
- package/dist/types/usage-limits.d.ts +1 -0
- package/dist/usage-limits.js +95 -95
- 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 +4 -4
- package/dist/v1/config/migrate.js +104 -104
- 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 +6 -6
- package/dist/variant.js +103 -103
- package/dist/vcs/patch.js +1 -1
- package/dist/vcs.js +101 -101
- package/dist/voice.js +94 -94
- package/dist/websearch.js +94 -94
- package/dist/wellknown/plugin.js +86 -86
- package/dist/wellknown.js +87 -87
- package/dist/workspace/driver.js +7 -7
- package/dist/workspace/sql.js +1 -1
- package/dist/workspace.js +90 -90
- 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 +101 -101
- package/dist/worktree.js +108 -108
- package/package.json +22 -9
- package/dist/chunks/schema-00csjphn.js +0 -94
- package/dist/chunks/schema-01kh9xtm.js +0 -156
- package/dist/chunks/schema-02ye6z51.js +0 -96
- package/dist/chunks/schema-034tev2y.js +0 -43
- package/dist/chunks/schema-04rctafp.js +0 -357
- package/dist/chunks/schema-099yywvh.js +0 -444
- package/dist/chunks/schema-0d2vjrpp.js +0 -42
- package/dist/chunks/schema-0dhx3ykd.js +0 -184
- package/dist/chunks/schema-0grvd95t.js +0 -221
- package/dist/chunks/schema-0hbtj59d.js +0 -65
- package/dist/chunks/schema-0hvn3y38.js +0 -236
- package/dist/chunks/schema-0j7gp832.js +0 -41
- package/dist/chunks/schema-0ncehkqy.js +0 -400
- package/dist/chunks/schema-0nde5ztd.js +0 -185
- package/dist/chunks/schema-0qqqxr5x.js +0 -197
- package/dist/chunks/schema-0t5h2k0v.js +0 -94
- package/dist/chunks/schema-0w807sat.js +0 -38
- package/dist/chunks/schema-12yz1921.js +0 -7
- package/dist/chunks/schema-1ad21j16.js +0 -73
- package/dist/chunks/schema-1aqsckx4.js +0 -19
- package/dist/chunks/schema-1ep2p91f.js +0 -18
- package/dist/chunks/schema-1g2qd3p6.js +0 -921
- package/dist/chunks/schema-1gdnxn8q.js +0 -122
- package/dist/chunks/schema-1p3hqer1.js +0 -544
- package/dist/chunks/schema-1qc5n05d.js +0 -591
- package/dist/chunks/schema-1ry6nyrb.js +0 -224
- package/dist/chunks/schema-1wrrsbc4.js +0 -123
- package/dist/chunks/schema-1wtf8ad7.js +0 -226
- package/dist/chunks/schema-1x2knyw4.js +0 -42
- package/dist/chunks/schema-1x5s0zfr.js +0 -388
- package/dist/chunks/schema-1yq9hg58.js +0 -16
- package/dist/chunks/schema-1z5f493n.js +0 -135
- package/dist/chunks/schema-204s3925.js +0 -175
- package/dist/chunks/schema-25jw3g4f.js +0 -102
- package/dist/chunks/schema-26x8chrq.js +0 -59
- package/dist/chunks/schema-2gk2y1j8.js +0 -37
- package/dist/chunks/schema-2j84ncef.js +0 -97
- package/dist/chunks/schema-2v186e1s.js +0 -278
- package/dist/chunks/schema-2vahexqr.js +0 -184
- package/dist/chunks/schema-33qkep72.js +0 -98
- package/dist/chunks/schema-36r31j1y.js +0 -177
- package/dist/chunks/schema-3756z231.js +0 -377
- package/dist/chunks/schema-375j4a5k.js +0 -664
- package/dist/chunks/schema-3hepkmqq.js +0 -13
- package/dist/chunks/schema-3hn5rpb1.js +0 -552
- package/dist/chunks/schema-3mhkvgqt.js +0 -101
- package/dist/chunks/schema-3qb4h4tp.js +0 -62
- package/dist/chunks/schema-3vf3ny91.js +0 -128
- package/dist/chunks/schema-3w7mkftw.js +0 -184
- package/dist/chunks/schema-40za9wsf.js +0 -64
- package/dist/chunks/schema-4a2b0ssv.js +0 -450
- package/dist/chunks/schema-4c49gk8m.js +0 -37
- package/dist/chunks/schema-4dx1dgte.js +0 -16
- package/dist/chunks/schema-4f5xwjpe.js +0 -71
- package/dist/chunks/schema-4pyp9zr9.js +0 -63
- package/dist/chunks/schema-4v008n1t.js +0 -13
- package/dist/chunks/schema-4zsvjwk5.js +0 -377
- package/dist/chunks/schema-54whx9vj.js +0 -66
- package/dist/chunks/schema-578cqfvw.js +0 -544
- package/dist/chunks/schema-57h12rnx.js +0 -31
- package/dist/chunks/schema-5c0rjt9e.js +0 -163
- package/dist/chunks/schema-5jzshcv3.js +0 -111
- package/dist/chunks/schema-5m9w47nd.js +0 -21
- package/dist/chunks/schema-5nnwax6m.js +0 -406
- package/dist/chunks/schema-655tpehd.js +0 -278
- package/dist/chunks/schema-68mpvj42.js +0 -40
- package/dist/chunks/schema-6a8reyab.js +0 -33
- package/dist/chunks/schema-6esdw8yj.js +0 -34
- package/dist/chunks/schema-6sqa993f.js +0 -81
- package/dist/chunks/schema-6srxf2b1.js +0 -123
- package/dist/chunks/schema-6wyy0pz9.js +0 -272
- package/dist/chunks/schema-6y263vp8.js +0 -94
- package/dist/chunks/schema-6zw0fw57.js +0 -36
- package/dist/chunks/schema-71gmpxhv.js +0 -537
- package/dist/chunks/schema-76cb1hcw.js +0 -63
- package/dist/chunks/schema-78p2h4ex.js +0 -75
- package/dist/chunks/schema-7bmhse3q.js +0 -118
- package/dist/chunks/schema-7brnv8w0.js +0 -95
- package/dist/chunks/schema-7fff45pw.js +0 -34
- package/dist/chunks/schema-7h768wt6.js +0 -90
- package/dist/chunks/schema-7jw3x0rm.js +0 -89
- package/dist/chunks/schema-7kr66rt3.js +0 -2158
- package/dist/chunks/schema-7mzbv8bq.js +0 -26
- package/dist/chunks/schema-7n0jac0z.js +0 -96
- package/dist/chunks/schema-7rvjhzv0.js +0 -122
- package/dist/chunks/schema-7w2ypzdf.js +0 -62
- package/dist/chunks/schema-7wfak81m.js +0 -126
- package/dist/chunks/schema-7znc2ak6.js +0 -148
- package/dist/chunks/schema-8b3vzgkx.js +0 -17
- package/dist/chunks/schema-8b69v1a7.js +0 -348
- package/dist/chunks/schema-8jhdp17k.js +0 -282
- package/dist/chunks/schema-8m7jngp7.js +0 -200
- package/dist/chunks/schema-8wtp7s3z.js +0 -14
- package/dist/chunks/schema-90zstvax.js +0 -129
- package/dist/chunks/schema-9bnx8v1s.js +0 -262
- package/dist/chunks/schema-9vnf221r.js +0 -128
- package/dist/chunks/schema-9y5j7mew.js +0 -49
- package/dist/chunks/schema-9z9tayqc.js +0 -53
- package/dist/chunks/schema-a6vzdybk.js +0 -107
- package/dist/chunks/schema-aa5xtxj2.js +0 -368
- package/dist/chunks/schema-afzqdm25.js +0 -182
- package/dist/chunks/schema-asjdf3ky.js +0 -247
- package/dist/chunks/schema-asp0rn3b.js +0 -247
- package/dist/chunks/schema-ayjs7tqn.js +0 -17
- package/dist/chunks/schema-b0951d1j.js +0 -93
- package/dist/chunks/schema-b1k617ee.js +0 -342
- package/dist/chunks/schema-b2ekajyb.js +0 -257
- package/dist/chunks/schema-b491pjm5.js +0 -198
- package/dist/chunks/schema-b59atwxm.js +0 -125
- package/dist/chunks/schema-bam9qj5c.js +0 -137
- package/dist/chunks/schema-bstexjd6.js +0 -175
- package/dist/chunks/schema-c6x7d2ts.js +0 -21
- package/dist/chunks/schema-cmhv6pag.js +0 -99
- package/dist/chunks/schema-cwrgdav8.js +0 -83
- package/dist/chunks/schema-d4v9tmah.js +0 -25
- package/dist/chunks/schema-d56bmmma.js +0 -82
- package/dist/chunks/schema-dbavz9kp.js +0 -489
- package/dist/chunks/schema-dezsc65w.js +0 -173
- package/dist/chunks/schema-djm830jq.js +0 -72
- package/dist/chunks/schema-djs3dngg.js +0 -120
- package/dist/chunks/schema-drfa0kca.js +0 -96
- package/dist/chunks/schema-dt77769w.js +0 -53
- package/dist/chunks/schema-dxf17875.js +0 -186
- package/dist/chunks/schema-dy8ej2a0.js +0 -241
- package/dist/chunks/schema-e00yb6hn.js +0 -118
- package/dist/chunks/schema-e5awnnxc.js +0 -215
- package/dist/chunks/schema-e834z07m.js +0 -50
- package/dist/chunks/schema-e85a669x.js +0 -58
- package/dist/chunks/schema-e89v3s2x.js +0 -71
- package/dist/chunks/schema-ecd2v7nh.js +0 -35
- package/dist/chunks/schema-efnt7zk1.js +0 -180
- package/dist/chunks/schema-egd6pm3f.js +0 -407
- package/dist/chunks/schema-ehgd54p9.js +0 -90
- package/dist/chunks/schema-emvnqz9f.js +0 -44
- package/dist/chunks/schema-esk39185.js +0 -311
- package/dist/chunks/schema-eybj1wgy.js +0 -49
- package/dist/chunks/schema-ezqsy8gy.js +0 -187
- package/dist/chunks/schema-ezw7t4kx.js +0 -80
- package/dist/chunks/schema-f3ad9cbx.js +0 -258
- package/dist/chunks/schema-faaeq40t.js +0 -22
- package/dist/chunks/schema-fbgyyhht.js +0 -182
- package/dist/chunks/schema-fffv3p7h.js +0 -143
- package/dist/chunks/schema-fg9p65nk.js +0 -37
- package/dist/chunks/schema-fn61dekp.js +0 -108
- package/dist/chunks/schema-fq1fyy34.js +0 -313
- package/dist/chunks/schema-fs1j62r4.js +0 -35
- package/dist/chunks/schema-fxyd2t29.js +0 -48
- package/dist/chunks/schema-g1e2r5aa.js +0 -41
- package/dist/chunks/schema-g1mvyxge.js +0 -97
- package/dist/chunks/schema-g4te2x2h.js +0 -325
- package/dist/chunks/schema-gcbf8e2a.js +0 -38
- package/dist/chunks/schema-gcye4jv7.js +0 -173
- package/dist/chunks/schema-gm428j6c.js +0 -351
- package/dist/chunks/schema-gv5m31y1.js +0 -341
- package/dist/chunks/schema-hdfrs5mg.js +0 -31
- package/dist/chunks/schema-hek2y864.js +0 -201
- package/dist/chunks/schema-hh7kjqtw.js +0 -66
- package/dist/chunks/schema-hpg1pkwy.js +0 -20
- package/dist/chunks/schema-hptmg8g9.js +0 -86
- package/dist/chunks/schema-hq6dxpfa.js +0 -326
- package/dist/chunks/schema-hqxkkta1.js +0 -262
- package/dist/chunks/schema-hscrayt9.js +0 -355
- package/dist/chunks/schema-j0dybgn2.js +0 -167
- package/dist/chunks/schema-jcqm84fr.js +0 -155
- package/dist/chunks/schema-jfaecv01.js +0 -50
- package/dist/chunks/schema-jhxhd08e.js +0 -116
- package/dist/chunks/schema-jtnps1zs.js +0 -154
- package/dist/chunks/schema-jzy064tf.js +0 -166
- package/dist/chunks/schema-k394zw05.js +0 -238
- package/dist/chunks/schema-k6966x57.js +0 -162
- package/dist/chunks/schema-k814nvkf.js +0 -78
- package/dist/chunks/schema-k8ec4f2h.js +0 -201
- package/dist/chunks/schema-k9c4fygp.js +0 -710
- package/dist/chunks/schema-kh0hrg97.js +0 -410
- package/dist/chunks/schema-khq1tf5f.js +0 -107
- package/dist/chunks/schema-kjphpf5s.js +0 -74
- package/dist/chunks/schema-kka3dzk1.js +0 -56
- package/dist/chunks/schema-kmzgegqq.js +0 -32
- package/dist/chunks/schema-ksw1makz.js +0 -868
- package/dist/chunks/schema-kt3bjfbg.js +0 -26
- package/dist/chunks/schema-m0n96caj.js +0 -224
- package/dist/chunks/schema-m1714858.js +0 -39
- package/dist/chunks/schema-m2p7g6q5.js +0 -140
- package/dist/chunks/schema-m9mdazr8.js +0 -70
- package/dist/chunks/schema-m9qjbqaf.js +0 -35
- package/dist/chunks/schema-m9w0rfyh.js +0 -123
- package/dist/chunks/schema-ma7n6kha.js +0 -43
- package/dist/chunks/schema-mb7mbhnz.js +0 -133
- package/dist/chunks/schema-md7hf9yx.js +0 -171
- package/dist/chunks/schema-me0dhgxs.js +0 -18
- package/dist/chunks/schema-mtkfycnh.js +0 -82
- package/dist/chunks/schema-mvcvwgh8.js +0 -226
- package/dist/chunks/schema-mw7cb6xb.js +0 -106
- package/dist/chunks/schema-n8agtmcc.js +0 -227
- package/dist/chunks/schema-n9svx643.js +0 -142
- package/dist/chunks/schema-na7hrbgf.js +0 -51
- package/dist/chunks/schema-nagb01d0.js +0 -38
- package/dist/chunks/schema-nah043kf.js +0 -42
- package/dist/chunks/schema-nb79qexc.js +0 -43
- package/dist/chunks/schema-ncqqe42p.js +0 -9
- package/dist/chunks/schema-nd0gg6f3.js +0 -672
- package/dist/chunks/schema-nfy79yn0.js +0 -75
- package/dist/chunks/schema-nhj2s2rn.js +0 -235
- package/dist/chunks/schema-npvk5mbc.js +0 -84
- package/dist/chunks/schema-nsannsan.js +0 -157
- package/dist/chunks/schema-p015t6z3.js +0 -38
- package/dist/chunks/schema-p288ht65.js +0 -139
- package/dist/chunks/schema-p6qx88jx.js +0 -201
- package/dist/chunks/schema-pknna89w.js +0 -18
- package/dist/chunks/schema-pnj9p3e7.js +0 -261
- package/dist/chunks/schema-pzn80and.js +0 -40
- package/dist/chunks/schema-q3gx0t3a.js +0 -73
- package/dist/chunks/schema-q89tx0w9.js +0 -611
- package/dist/chunks/schema-qa8rkrn5.js +0 -75
- package/dist/chunks/schema-qjgzc4b4.js +0 -31
- package/dist/chunks/schema-qm628a9a.js +0 -443
- package/dist/chunks/schema-qn9arske.js +0 -258
- package/dist/chunks/schema-qp7r0hxv.js +0 -120
- package/dist/chunks/schema-qqpbcr2p.js +0 -196
- package/dist/chunks/schema-qqvy8y24.js +0 -45
- package/dist/chunks/schema-qxzr918a.js +0 -207
- package/dist/chunks/schema-qyfz9dkk.js +0 -49
- package/dist/chunks/schema-qz97qqq3.js +0 -343
- package/dist/chunks/schema-r15nerz4.js +0 -291
- package/dist/chunks/schema-r1hwwpqk.js +0 -283
- package/dist/chunks/schema-r3jekzdf.js +0 -748
- package/dist/chunks/schema-r4zhn8a3.js +0 -61
- package/dist/chunks/schema-r542h3bh.js +0 -54
- package/dist/chunks/schema-ra34yqmw.js +0 -20
- package/dist/chunks/schema-rb6a0f6t.js +0 -46
- package/dist/chunks/schema-rb9dy4dg.js +0 -116
- package/dist/chunks/schema-rehx0x6s.js +0 -41
- package/dist/chunks/schema-rt5dr6hb.js +0 -14
- package/dist/chunks/schema-s2dzrv2e.js +0 -539
- package/dist/chunks/schema-s5zjbmxy.js +0 -63
- package/dist/chunks/schema-sa3fpqfw.js +0 -46
- package/dist/chunks/schema-sgq8g3gm.js +0 -181
- package/dist/chunks/schema-sj028wv8.js +0 -51
- package/dist/chunks/schema-snr8m60h.js +0 -42
- package/dist/chunks/schema-srcgv9w3.js +0 -336
- package/dist/chunks/schema-svcy3p9a.js +0 -38
- package/dist/chunks/schema-sx385end.js +0 -123
- package/dist/chunks/schema-t1bgdn1k.js +0 -113
- package/dist/chunks/schema-t8kxmwy5.js +0 -104
- package/dist/chunks/schema-tczq8hjw.js +0 -25
- package/dist/chunks/schema-tj38cb2g.js +0 -141
- package/dist/chunks/schema-tmc7xdjs.js +0 -13
- package/dist/chunks/schema-twssxy5n.js +0 -170
- package/dist/chunks/schema-v23js2jf.js +0 -81
- package/dist/chunks/schema-v2r1d0zg.js +0 -86
- package/dist/chunks/schema-vce9hmvv.js +0 -80
- package/dist/chunks/schema-vhvv8ez0.js +0 -1332
- package/dist/chunks/schema-vnyx9vg6.js +0 -587
- package/dist/chunks/schema-vp8rtqyg.js +0 -126
- package/dist/chunks/schema-vqntchmx.js +0 -103
- package/dist/chunks/schema-vtbv1fva.js +0 -115
- package/dist/chunks/schema-vtkbdejs.js +0 -348
- package/dist/chunks/schema-vybksbky.js +0 -319
- package/dist/chunks/schema-vz2va2d1.js +0 -416
- package/dist/chunks/schema-vzmjdaw1.js +0 -54
- package/dist/chunks/schema-w11ey1wa.js +0 -148
- package/dist/chunks/schema-w35wzz9x.js +0 -31
- package/dist/chunks/schema-w3wsvvr9.js +0 -80
- package/dist/chunks/schema-w687dnns.js +0 -22
- package/dist/chunks/schema-wakvkjy4.js +0 -79
- package/dist/chunks/schema-wd87259q.js +0 -102
- package/dist/chunks/schema-wdcvs2c8.js +0 -362
- package/dist/chunks/schema-wegkxhrn.js +0 -37
- package/dist/chunks/schema-wnhgecwx.js +0 -93
- package/dist/chunks/schema-wvwyjhqj.js +0 -88
- package/dist/chunks/schema-wwr5b8zq.js +0 -75
- package/dist/chunks/schema-wymh8p0v.js +0 -79
- package/dist/chunks/schema-wzwsv8q3.js +0 -83
- package/dist/chunks/schema-x7sbefsh.js +0 -213
- package/dist/chunks/schema-x7sgwrtq.js +0 -579
- package/dist/chunks/schema-xa8sgekr.js +0 -31
- package/dist/chunks/schema-xg9fc39m.js +0 -133
- package/dist/chunks/schema-xjhaxcdd.js +0 -147
- package/dist/chunks/schema-xnw40tj7.js +0 -668
- package/dist/chunks/schema-xrc3640n.js +0 -31
- package/dist/chunks/schema-xymnhqkr.js +0 -26
- package/dist/chunks/schema-y1hrmxtq.js +0 -121
- package/dist/chunks/schema-yaf14s91.js +0 -279
- package/dist/chunks/schema-yara3q77.js +0 -132
- package/dist/chunks/schema-yb20nhc3.js +0 -229
- package/dist/chunks/schema-yfmps5ht.js +0 -214
- package/dist/chunks/schema-ypzz06n9.js +0 -72
- package/dist/chunks/schema-yv3czy6n.js +0 -111
- package/dist/chunks/schema-zasfh7e5.js +0 -183
- package/dist/chunks/schema-zbwmzx6w.js +0 -378
- package/dist/chunks/schema-zes4xa3j.js +0 -597
- package/dist/chunks/schema-zr8qtytk.js +0 -52
- package/dist/chunks/schema-ztatdthy.js +0 -789
- package/dist/chunks/schema-ztf6n3de.js +0 -18
- package/dist/chunks/schema-zvmapj1s.js +0 -201
- package/dist/chunks/schema-zvwzcwk0.js +0 -49
- package/dist/chunks/schema-zvyj7mkg.js +0 -465
- package/dist/codemode/web.js +0 -10
- package/dist/types/codemode/web.d.ts +0 -30
- /package/dist/chunks/{schema-0qkdqm5v.js → managed-policy-0qkdqm5v.js} +0 -0
- /package/dist/chunks/{schema-0zkw76rk.js → managed-policy-0zkw76rk.js} +0 -0
- /package/dist/chunks/{schema-17cy0kzp.js → managed-policy-17cy0kzp.js} +0 -0
- /package/dist/chunks/{schema-1cnp2v09.js → managed-policy-1cnp2v09.js} +0 -0
- /package/dist/chunks/{schema-1kah00gy.js → managed-policy-1kah00gy.js} +0 -0
- /package/dist/chunks/{schema-24dcb14g.js → managed-policy-24dcb14g.js} +0 -0
- /package/dist/chunks/{schema-2710q6r3.js → managed-policy-2710q6r3.js} +0 -0
- /package/dist/chunks/{schema-2bv980vf.js → managed-policy-2bv980vf.js} +0 -0
- /package/dist/chunks/{schema-2c3vjs8z.js → managed-policy-2c3vjs8z.js} +0 -0
- /package/dist/chunks/{schema-359p4xyc.js → managed-policy-359p4xyc.js} +0 -0
- /package/dist/chunks/{schema-3asan66x.js → managed-policy-3asan66x.js} +0 -0
- /package/dist/chunks/{schema-3v8g72cx.js → managed-policy-3v8g72cx.js} +0 -0
- /package/dist/chunks/{schema-3wcehsnq.js → managed-policy-3wcehsnq.js} +0 -0
- /package/dist/chunks/{schema-43n2bw4t.js → managed-policy-43n2bw4t.js} +0 -0
- /package/dist/chunks/{schema-4knz6hnm.js → managed-policy-4knz6hnm.js} +0 -0
- /package/dist/chunks/{schema-4vcrnpx2.js → managed-policy-4vcrnpx2.js} +0 -0
- /package/dist/chunks/{schema-4y7fprxs.js → managed-policy-4y7fprxs.js} +0 -0
- /package/dist/chunks/{schema-53557ph1.js → managed-policy-53557ph1.js} +0 -0
- /package/dist/chunks/{schema-550bvhaj.js → managed-policy-550bvhaj.js} +0 -0
- /package/dist/chunks/{schema-5w3e23ze.js → managed-policy-5w3e23ze.js} +0 -0
- /package/dist/chunks/{schema-6prwharc.js → managed-policy-6prwharc.js} +0 -0
- /package/dist/chunks/{schema-6q2bdcd1.js → managed-policy-6q2bdcd1.js} +0 -0
- /package/dist/chunks/{schema-7akdwqpd.js → managed-policy-7akdwqpd.js} +0 -0
- /package/dist/chunks/{schema-7m9af43g.js → managed-policy-7m9af43g.js} +0 -0
- /package/dist/chunks/{schema-7stb81gk.js → managed-policy-7stb81gk.js} +0 -0
- /package/dist/chunks/{schema-822emrt2.js → managed-policy-822emrt2.js} +0 -0
- /package/dist/chunks/{schema-84wd9syh.js → managed-policy-84wd9syh.js} +0 -0
- /package/dist/chunks/{schema-88xbtdfr.js → managed-policy-88xbtdfr.js} +0 -0
- /package/dist/chunks/{schema-8n3pysct.js → managed-policy-8n3pysct.js} +0 -0
- /package/dist/chunks/{schema-8wj87zfr.js → managed-policy-8wj87zfr.js} +0 -0
- /package/dist/chunks/{schema-9a4afbnw.js → managed-policy-9a4afbnw.js} +0 -0
- /package/dist/chunks/{schema-9rqn6x4v.js → managed-policy-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{schema-a058387c.js → managed-policy-a058387c.js} +0 -0
- /package/dist/chunks/{schema-a6k6eb26.js → managed-policy-a6k6eb26.js} +0 -0
- /package/dist/chunks/{schema-af5trqkr.js → managed-policy-af5trqkr.js} +0 -0
- /package/dist/chunks/{schema-afrmfg78.js → managed-policy-afrmfg78.js} +0 -0
- /package/dist/chunks/{schema-aqzs7mqg.js → managed-policy-aqzs7mqg.js} +0 -0
- /package/dist/chunks/{schema-atq7p7m5.js → managed-policy-atq7p7m5.js} +0 -0
- /package/dist/chunks/{schema-beh6qq61.js → managed-policy-beh6qq61.js} +0 -0
- /package/dist/chunks/{schema-bkyjaxrp.js → managed-policy-bkyjaxrp.js} +0 -0
- /package/dist/chunks/{schema-bmr6ed5q.js → managed-policy-bmr6ed5q.js} +0 -0
- /package/dist/chunks/{schema-cf4snx6d.js → managed-policy-cf4snx6d.js} +0 -0
- /package/dist/chunks/{schema-cqv5kn06.js → managed-policy-cqv5kn06.js} +0 -0
- /package/dist/chunks/{schema-cvy3z8tj.js → managed-policy-cvy3z8tj.js} +0 -0
- /package/dist/chunks/{schema-d9fn303g.js → managed-policy-d9fn303g.js} +0 -0
- /package/dist/chunks/{schema-d9jj8t3e.js → managed-policy-d9jj8t3e.js} +0 -0
- /package/dist/chunks/{schema-dap0rakb.js → managed-policy-dap0rakb.js} +0 -0
- /package/dist/chunks/{schema-df08tz66.js → managed-policy-df08tz66.js} +0 -0
- /package/dist/chunks/{schema-dy18nga0.js → managed-policy-dy18nga0.js} +0 -0
- /package/dist/chunks/{schema-e5kj55wp.js → managed-policy-e5kj55wp.js} +0 -0
- /package/dist/chunks/{schema-e73j6tqm.js → managed-policy-e73j6tqm.js} +0 -0
- /package/dist/chunks/{schema-ean2d8b5.js → managed-policy-ean2d8b5.js} +0 -0
- /package/dist/chunks/{schema-ec1grn59.js → managed-policy-ec1grn59.js} +0 -0
- /package/dist/chunks/{schema-eh3zwz77.js → managed-policy-eh3zwz77.js} +0 -0
- /package/dist/chunks/{schema-emrn6kk6.js → managed-policy-emrn6kk6.js} +0 -0
- /package/dist/chunks/{schema-f0mxakyp.js → managed-policy-f0mxakyp.js} +0 -0
- /package/dist/chunks/{schema-f6n9ztr4.js → managed-policy-f6n9ztr4.js} +0 -0
- /package/dist/chunks/{schema-faypxj3z.js → managed-policy-faypxj3z.js} +0 -0
- /package/dist/chunks/{schema-fd410y7t.js → managed-policy-fd410y7t.js} +0 -0
- /package/dist/chunks/{schema-fkpq3x5p.js → managed-policy-fkpq3x5p.js} +0 -0
- /package/dist/chunks/{schema-g4wezp1m.js → managed-policy-g4wezp1m.js} +0 -0
- /package/dist/chunks/{schema-g86h250q.js → managed-policy-g86h250q.js} +0 -0
- /package/dist/chunks/{schema-gebd4c9n.js → managed-policy-gebd4c9n.js} +0 -0
- /package/dist/chunks/{schema-gftt206x.js → managed-policy-gftt206x.js} +0 -0
- /package/dist/chunks/{schema-hcxmzztb.js → managed-policy-hcxmzztb.js} +0 -0
- /package/dist/chunks/{schema-hk9envan.js → managed-policy-hk9envan.js} +0 -0
- /package/dist/chunks/{schema-j2ntwpah.js → managed-policy-j2ntwpah.js} +0 -0
- /package/dist/chunks/{schema-j5zkgpj8.js → managed-policy-j5zkgpj8.js} +0 -0
- /package/dist/chunks/{schema-jjkms2e6.js → managed-policy-jjkms2e6.js} +0 -0
- /package/dist/chunks/{schema-jr7sbwjy.js → managed-policy-jr7sbwjy.js} +0 -0
- /package/dist/chunks/{schema-jwfs4k6c.js → managed-policy-jwfs4k6c.js} +0 -0
- /package/dist/chunks/{schema-jwr30sdr.js → managed-policy-jwr30sdr.js} +0 -0
- /package/dist/chunks/{schema-jze0r7bz.js → managed-policy-jze0r7bz.js} +0 -0
- /package/dist/chunks/{schema-jzg6c2d5.js → managed-policy-jzg6c2d5.js} +0 -0
- /package/dist/chunks/{schema-m18g726c.js → managed-policy-m18g726c.js} +0 -0
- /package/dist/chunks/{schema-mp448xyj.js → managed-policy-mp448xyj.js} +0 -0
- /package/dist/chunks/{schema-msx8hqn2.js → managed-policy-msx8hqn2.js} +0 -0
- /package/dist/chunks/{schema-n05xt0ee.js → managed-policy-n05xt0ee.js} +0 -0
- /package/dist/chunks/{schema-n3j8tn72.js → managed-policy-n3j8tn72.js} +0 -0
- /package/dist/chunks/{schema-nh4v3znn.js → managed-policy-nh4v3znn.js} +0 -0
- /package/dist/chunks/{schema-njntx4h6.js → managed-policy-njntx4h6.js} +0 -0
- /package/dist/chunks/{schema-p71gwv9c.js → managed-policy-p71gwv9c.js} +0 -0
- /package/dist/chunks/{schema-q3sfg36h.js → managed-policy-q3sfg36h.js} +0 -0
- /package/dist/chunks/{schema-q74kybfr.js → managed-policy-q74kybfr.js} +0 -0
- /package/dist/chunks/{schema-qaymkmh1.js → managed-policy-qaymkmh1.js} +0 -0
- /package/dist/chunks/{schema-qb87gjwd.js → managed-policy-qb87gjwd.js} +0 -0
- /package/dist/chunks/{schema-qfa1cgps.js → managed-policy-qfa1cgps.js} +0 -0
- /package/dist/chunks/{schema-qg3g05ea.js → managed-policy-qg3g05ea.js} +0 -0
- /package/dist/chunks/{schema-qrg20bc0.js → managed-policy-qrg20bc0.js} +0 -0
- /package/dist/chunks/{schema-rcb2kzg1.js → managed-policy-rcb2kzg1.js} +0 -0
- /package/dist/chunks/{schema-sdp7kfr6.js → managed-policy-sdp7kfr6.js} +0 -0
- /package/dist/chunks/{schema-ssg3fenm.js → managed-policy-ssg3fenm.js} +0 -0
- /package/dist/chunks/{schema-stkk57rt.js → managed-policy-stkk57rt.js} +0 -0
- /package/dist/chunks/{schema-t03h4f5z.js → managed-policy-t03h4f5z.js} +0 -0
- /package/dist/chunks/{schema-ty7weeps.js → managed-policy-ty7weeps.js} +0 -0
- /package/dist/chunks/{schema-ve7vex1e.js → managed-policy-ve7vex1e.js} +0 -0
- /package/dist/chunks/{schema-w803qqfp.js → managed-policy-w803qqfp.js} +0 -0
- /package/dist/chunks/{schema-wc3fc9cn.js → managed-policy-wc3fc9cn.js} +0 -0
- /package/dist/chunks/{schema-wer8tq1h.js → managed-policy-wer8tq1h.js} +0 -0
- /package/dist/chunks/{schema-wtztk69x.js → managed-policy-wtztk69x.js} +0 -0
- /package/dist/chunks/{schema-x0ckcb58.js → managed-policy-x0ckcb58.js} +0 -0
- /package/dist/chunks/{schema-x61499pn.js → managed-policy-x61499pn.js} +0 -0
- /package/dist/chunks/{schema-y44na4kk.js → managed-policy-y44na4kk.js} +0 -0
- /package/dist/chunks/{schema-y8f7s663.js → managed-policy-y8f7s663.js} +0 -0
- /package/dist/chunks/{schema-ygaqb7jw.js → managed-policy-ygaqb7jw.js} +0 -0
- /package/dist/chunks/{schema-z5v4ffb3.js → managed-policy-z5v4ffb3.js} +0 -0
- /package/dist/chunks/{schema-z9919s4g.js → managed-policy-z9919s4g.js} +0 -0
|
@@ -0,0 +1,921 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AbsolutePath2,
|
|
3
|
+
RelativePath2
|
|
4
|
+
} from "./managed-policy-z5v4ffb3.js";
|
|
5
|
+
import {
|
|
6
|
+
makeUnsafe2
|
|
7
|
+
} from "./managed-policy-8cg7mtm3.js";
|
|
8
|
+
import {
|
|
9
|
+
MAX_TOTAL_PATCH_BYTES2,
|
|
10
|
+
emptyPatch2,
|
|
11
|
+
chunksByFile2
|
|
12
|
+
} from "./managed-policy-rb9dy4dg.js";
|
|
13
|
+
import {
|
|
14
|
+
gitExecutable2
|
|
15
|
+
} from "./managed-policy-sa3fpqfw.js";
|
|
16
|
+
import {
|
|
17
|
+
__export
|
|
18
|
+
} from "./managed-policy-9rqn6x4v.js";
|
|
19
|
+
|
|
20
|
+
// src/git.ts
|
|
21
|
+
var exports_git3 = {};
|
|
22
|
+
__export(exports_git3, {
|
|
23
|
+
CommandError: () => CommandError2,
|
|
24
|
+
Git: () => exports_git3,
|
|
25
|
+
OperationError: () => OperationError3,
|
|
26
|
+
Repository: () => Repository2,
|
|
27
|
+
Service: () => Service88,
|
|
28
|
+
TreeID: () => TreeID2,
|
|
29
|
+
Worktree: () => Worktree2,
|
|
30
|
+
WorktreeError: () => WorktreeError2,
|
|
31
|
+
node: () => node91
|
|
32
|
+
});
|
|
33
|
+
import os from "os";
|
|
34
|
+
import path from "path";
|
|
35
|
+
import { Cause, Context, Deferred, Effect, Exit, Layer, Option, Schedule, Schema } from "effect";
|
|
36
|
+
import { ChildProcess } from "effect/process";
|
|
37
|
+
import { FSUtil } from "@opencode/util/fs-util";
|
|
38
|
+
import { AppProcess } from "@opencode/util/process";
|
|
39
|
+
import { makeGlobalNode } from "@opencode/util/effect/app-node";
|
|
40
|
+
class Repository2 extends Schema.Class("Git.Repository")({
|
|
41
|
+
worktree: AbsolutePath2,
|
|
42
|
+
gitDirectory: AbsolutePath2,
|
|
43
|
+
commonDirectory: AbsolutePath2
|
|
44
|
+
}) {
|
|
45
|
+
}
|
|
46
|
+
var snapshotConfigFile = "opencode.gitconfig";
|
|
47
|
+
var snapshotConfigInclude = `[include]
|
|
48
|
+
path = ${snapshotConfigFile}
|
|
49
|
+
`;
|
|
50
|
+
var snapshotConfig = `[core]
|
|
51
|
+
autocrlf = false
|
|
52
|
+
longpaths = true
|
|
53
|
+
symlinks = true
|
|
54
|
+
fsmonitor = false
|
|
55
|
+
untrackedCache = true
|
|
56
|
+
# A split index cannot name its shared file once manyFiles skips index checksums.
|
|
57
|
+
splitIndex = false
|
|
58
|
+
[feature]
|
|
59
|
+
manyFiles = true
|
|
60
|
+
[index]
|
|
61
|
+
version = 4
|
|
62
|
+
threads = true
|
|
63
|
+
`;
|
|
64
|
+
var TreeID2 = Schema.String.pipe(Schema.brand("Git.TreeID"));
|
|
65
|
+
var temporaryIndexPrefix = "index.opencode-";
|
|
66
|
+
var argumentBudget = process.platform === "win32" ? 24000 : 128 * 1024;
|
|
67
|
+
var looseObjectLimit = 2048;
|
|
68
|
+
var packCountLimit = 16;
|
|
69
|
+
|
|
70
|
+
class OperationError3 extends Schema.TaggedError()("Git.OperationError", {
|
|
71
|
+
operation: Schema.Literals([
|
|
72
|
+
"clone",
|
|
73
|
+
"fetch",
|
|
74
|
+
"checkout",
|
|
75
|
+
"reset",
|
|
76
|
+
"create",
|
|
77
|
+
"refresh",
|
|
78
|
+
"write_tree",
|
|
79
|
+
"list_files",
|
|
80
|
+
"diff",
|
|
81
|
+
"restore",
|
|
82
|
+
"pack"
|
|
83
|
+
]),
|
|
84
|
+
message: Schema.String,
|
|
85
|
+
directory: Schema.optional(AbsolutePath2),
|
|
86
|
+
cause: Schema.optional(Schema.Defect())
|
|
87
|
+
}) {
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class CommandError2 extends Schema.TaggedError()("Git.CommandError", {
|
|
91
|
+
args: Schema.Array(Schema.String),
|
|
92
|
+
exitCode: Schema.optional(Schema.Number),
|
|
93
|
+
cause: Schema.optional(Schema.Defect())
|
|
94
|
+
}) {
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
class Worktree2 extends Schema.Class("Git.Worktree")({
|
|
98
|
+
directory: AbsolutePath2,
|
|
99
|
+
kind: Schema.Literals(["main", "linked"])
|
|
100
|
+
}) {
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
class WorktreeError2 extends Schema.TaggedError()("Git.WorktreeError", {
|
|
104
|
+
operation: Schema.Literals(["create", "remove", "list"]),
|
|
105
|
+
message: Schema.String,
|
|
106
|
+
directory: Schema.optional(AbsolutePath2),
|
|
107
|
+
forceRequired: Schema.optional(Schema.Boolean),
|
|
108
|
+
cause: Schema.optional(Schema.Defect())
|
|
109
|
+
}) {
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
class Service88 extends Context.Service()("@opencode/Git") {
|
|
113
|
+
}
|
|
114
|
+
var layer = Layer.effect(Service88, Effect.gen(function* () {
|
|
115
|
+
const fs = yield* FSUtil.Service;
|
|
116
|
+
const proc = yield* AppProcess.Service;
|
|
117
|
+
const locks = makeUnsafe2();
|
|
118
|
+
const locked = (repository, effect) => locks.withLock(repository.gitDirectory)(effect);
|
|
119
|
+
const discover = Effect.fn("Git.repo.discover")(function* (input) {
|
|
120
|
+
const dotgit = yield* fs.up({ targets: [".git"], start: input, mode: "first" }).pipe(Effect.map((matches) => matches[0]), Effect.orElseSucceed(() => {
|
|
121
|
+
return;
|
|
122
|
+
}));
|
|
123
|
+
if (!dotgit)
|
|
124
|
+
return;
|
|
125
|
+
const cwd = path.dirname(dotgit);
|
|
126
|
+
const result = yield* run(cwd, proc, ["rev-parse", "--git-dir", "--git-common-dir", "--show-toplevel"]);
|
|
127
|
+
const [gitDir, commonDir, topLevel] = result.text.split(/\r?\n/);
|
|
128
|
+
if (!gitDir || !commonDir)
|
|
129
|
+
return;
|
|
130
|
+
return new Repository2({
|
|
131
|
+
worktree: AbsolutePath2.make(topLevel ? resolvePath(cwd, topLevel) : cwd),
|
|
132
|
+
gitDirectory: AbsolutePath2.make(resolvePath(cwd, gitDir)),
|
|
133
|
+
commonDirectory: AbsolutePath2.make(resolvePath(cwd, commonDir))
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
const stamp = (target) => fs.stat(target).pipe(Effect.map((info) => [info.type, Option.getOrUndefined(info.ino), info.size, Option.getOrUndefined(info.mtime)?.getTime()].join(":")), Effect.orElseSucceed(() => "missing"));
|
|
137
|
+
const readText = (target) => fs.readFileStringSafe(target).pipe(Effect.orElseSucceed(() => {
|
|
138
|
+
return;
|
|
139
|
+
}));
|
|
140
|
+
const fingerprint = Effect.fn("Git.repo.fingerprint")(function* (dotGit) {
|
|
141
|
+
const dot = yield* fs.stat(dotGit).pipe(Effect.orElseSucceed(() => {
|
|
142
|
+
return;
|
|
143
|
+
}));
|
|
144
|
+
if (!dot || dot.type !== "File" && dot.type !== "Directory")
|
|
145
|
+
return;
|
|
146
|
+
const gitFile = dot.type === "File" ? (yield* readText(dotGit))?.match(/^gitdir:\s*(.+)$/m)?.[1]?.trim() : "";
|
|
147
|
+
if (gitFile === undefined)
|
|
148
|
+
return;
|
|
149
|
+
const gitDir = gitFile ? yield* fs.resolve(path.resolve(path.dirname(dotGit), gitFile)) : dotGit;
|
|
150
|
+
const commondir = (yield* readText(path.join(gitDir, "commondir")))?.trim();
|
|
151
|
+
const commonDir = commondir ? yield* fs.resolve(path.resolve(gitDir, commondir)) : gitDir;
|
|
152
|
+
const head = (yield* readText(path.join(gitDir, "HEAD")))?.trim();
|
|
153
|
+
if (head === undefined)
|
|
154
|
+
return;
|
|
155
|
+
const ref = head.startsWith("ref:") ? head.slice(4).trim() : undefined;
|
|
156
|
+
const home = process.env.HOME || os.homedir();
|
|
157
|
+
const nosystem = ["1", "true", "yes", "on"].includes((process.env.GIT_CONFIG_NOSYSTEM ?? "").toLowerCase());
|
|
158
|
+
const files = [
|
|
159
|
+
path.join(gitDir, "HEAD"),
|
|
160
|
+
path.join(commonDir, "config"),
|
|
161
|
+
path.join(commonDir, "config.worktree"),
|
|
162
|
+
path.join(gitDir, "config.worktree"),
|
|
163
|
+
path.join(commonDir, "packed-refs"),
|
|
164
|
+
path.join(commonDir, "reftable", "tables.list"),
|
|
165
|
+
path.join(commonDir, "opencode"),
|
|
166
|
+
...ref ? [path.join(commonDir, ref), path.join(gitDir, ref)] : [],
|
|
167
|
+
process.env.GIT_CONFIG_GLOBAL || path.join(home, ".gitconfig"),
|
|
168
|
+
path.join(process.env.XDG_CONFIG_HOME || path.join(home, ".config"), "git", "config"),
|
|
169
|
+
...nosystem ? [] : [process.env.GIT_CONFIG_SYSTEM || "/etc/gitconfig"]
|
|
170
|
+
];
|
|
171
|
+
const stamps = yield* Effect.forEach([dotGit, ...files], stamp, { concurrency: "unbounded" });
|
|
172
|
+
return [gitDir, commonDir, head, ...files, ...stamps].join("\x00");
|
|
173
|
+
});
|
|
174
|
+
const command = (cwd, args) => execute(cwd, proc, args).pipe(Effect.mapError((cause) => new CommandError2({ args, cause })));
|
|
175
|
+
const remote = Effect.fn("Git.remote.get")(function* (repository, name = "origin") {
|
|
176
|
+
const args = ["remote", "get-url", name];
|
|
177
|
+
const result = yield* command(repository.worktree, args);
|
|
178
|
+
if (result.exitCode === 2)
|
|
179
|
+
return;
|
|
180
|
+
if (result.exitCode !== 0)
|
|
181
|
+
return yield* new CommandError2({ args, exitCode: result.exitCode });
|
|
182
|
+
return result.text.trim() || undefined;
|
|
183
|
+
});
|
|
184
|
+
const roots = Effect.fn("Git.history.rootCommits")(function* (repository) {
|
|
185
|
+
const args = ["rev-list", "--max-parents=0", "HEAD"];
|
|
186
|
+
const result = yield* command(repository.worktree, args);
|
|
187
|
+
if (result.exitCode === 0)
|
|
188
|
+
return result.text.split(`
|
|
189
|
+
`).map((item) => item.trim()).filter(Boolean).toSorted();
|
|
190
|
+
const verify = yield* command(repository.worktree, ["rev-parse", "-q", "--verify", "HEAD"]);
|
|
191
|
+
if (verify.exitCode === 1)
|
|
192
|
+
return [];
|
|
193
|
+
return yield* new CommandError2({ args, exitCode: result.exitCode });
|
|
194
|
+
});
|
|
195
|
+
const head = Effect.fn("Git.history.head")(function* (repository) {
|
|
196
|
+
const result = yield* run(repository.worktree, proc, ["rev-parse", "HEAD"]);
|
|
197
|
+
if (result.exitCode !== 0)
|
|
198
|
+
return;
|
|
199
|
+
return result.text.trim() || undefined;
|
|
200
|
+
});
|
|
201
|
+
const branch = Effect.fn("Git.history.branch")(function* (repository) {
|
|
202
|
+
const result = yield* run(repository.worktree, proc, ["symbolic-ref", "--quiet", "--short", "HEAD"]);
|
|
203
|
+
if (result.exitCode !== 0)
|
|
204
|
+
return;
|
|
205
|
+
return result.text.trim() || undefined;
|
|
206
|
+
});
|
|
207
|
+
const remoteHead = Effect.fn("Git.history.defaultRemoteBranch")(function* (repository, remoteName = "origin") {
|
|
208
|
+
const result = yield* run(repository.worktree, proc, ["symbolic-ref", `refs/remotes/${remoteName}/HEAD`]);
|
|
209
|
+
if (result.exitCode !== 0)
|
|
210
|
+
return;
|
|
211
|
+
return result.text.trim().replace(new RegExp(`^refs/remotes/${remoteName}/`), "") || undefined;
|
|
212
|
+
});
|
|
213
|
+
const operation = Effect.fnUntraced(function* (operation, directory, args) {
|
|
214
|
+
const result = yield* execute(directory, proc, args).pipe(Effect.mapError((cause) => new OperationError3({ operation, directory, message: cause.message, cause })));
|
|
215
|
+
if (result.exitCode === 0)
|
|
216
|
+
return;
|
|
217
|
+
return yield* new OperationError3({
|
|
218
|
+
operation,
|
|
219
|
+
directory,
|
|
220
|
+
message: result.stderr.trim() || result.text.trim() || `Git ${operation} failed`
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
const clone = Effect.fn("Git.repo.clone")(function* (input) {
|
|
224
|
+
yield* operation("clone", AbsolutePath2.make(path.dirname(input.directory)), [
|
|
225
|
+
"clone",
|
|
226
|
+
"--depth",
|
|
227
|
+
String(input.depth ?? 100),
|
|
228
|
+
...input.branch ? ["--branch", input.branch] : [],
|
|
229
|
+
"--",
|
|
230
|
+
input.remote,
|
|
231
|
+
input.directory
|
|
232
|
+
]);
|
|
233
|
+
const repository = yield* discover(input.directory);
|
|
234
|
+
if (repository)
|
|
235
|
+
return repository;
|
|
236
|
+
return yield* new OperationError3({
|
|
237
|
+
operation: "clone",
|
|
238
|
+
directory: input.directory,
|
|
239
|
+
message: "Cloned repository could not be opened"
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
const fetch = Effect.fn("Git.sync.fetchRemotes")(function* (repository, input = {}) {
|
|
243
|
+
yield* operation("fetch", repository.worktree, ["fetch", "--all", ...input.prune === false ? [] : ["--prune"]]);
|
|
244
|
+
});
|
|
245
|
+
const fetchBranch = Effect.fn("Git.sync.fetchBranch")(function* (repository, input) {
|
|
246
|
+
const remoteName = input.remote ?? "origin";
|
|
247
|
+
const spec = `refs/heads/${input.branch}:refs/remotes/${remoteName}/${input.branch}`;
|
|
248
|
+
yield* operation("fetch", repository.worktree, ["fetch", remoteName, input.force === false ? spec : `+${spec}`]);
|
|
249
|
+
});
|
|
250
|
+
const checkout = Effect.fn("Git.sync.checkoutRemoteBranch")(function* (repository, input) {
|
|
251
|
+
const remoteName = input.remote ?? "origin";
|
|
252
|
+
yield* operation("checkout", repository.worktree, [
|
|
253
|
+
"checkout",
|
|
254
|
+
...input.reset === false ? [input.branch] : ["-B", input.branch, `${remoteName}/${input.branch}`]
|
|
255
|
+
]);
|
|
256
|
+
});
|
|
257
|
+
const reset = Effect.fn("Git.sync.resetHard")(function* (repository, revision) {
|
|
258
|
+
yield* operation("reset", repository.worktree, ["reset", "--hard", revision]);
|
|
259
|
+
});
|
|
260
|
+
const repositoryArgs = (repository, args) => [
|
|
261
|
+
"--git-dir",
|
|
262
|
+
repository.gitDirectory,
|
|
263
|
+
"--work-tree",
|
|
264
|
+
repository.worktree,
|
|
265
|
+
...args
|
|
266
|
+
];
|
|
267
|
+
const repositoryOperation = Effect.fnUntraced(function* (operationName, repository, args, options) {
|
|
268
|
+
const result = yield* proc.run(ChildProcess.make(gitExecutable2(), repositoryArgs(repository, args), {
|
|
269
|
+
cwd: repository.worktree,
|
|
270
|
+
env: options?.index ? { ...options.env, GIT_INDEX_FILE: options.index } : options?.env,
|
|
271
|
+
extendEnv: true
|
|
272
|
+
}), { stdin: options?.stdin, maxOutputBytes: options?.maxOutputBytes }).pipe(Effect.mapError((cause) => new OperationError3({
|
|
273
|
+
operation: operationName,
|
|
274
|
+
directory: repository.worktree,
|
|
275
|
+
message: cause.message,
|
|
276
|
+
cause
|
|
277
|
+
})));
|
|
278
|
+
const text = result.stdout.toString("utf8");
|
|
279
|
+
if (result.exitCode === 0)
|
|
280
|
+
return { text, stderr: result.stderr.toString("utf8"), truncated: result.stdoutTruncated };
|
|
281
|
+
return yield* new OperationError3({
|
|
282
|
+
operation: operationName,
|
|
283
|
+
directory: repository.worktree,
|
|
284
|
+
message: result.stderr.toString("utf8").trim() || text.trim() || `Git ${operationName} failed`
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
const retryConcurrentObjectWrite = (effect) => process.platform === "win32" ? effect.pipe(Effect.retry({
|
|
288
|
+
times: 2,
|
|
289
|
+
schedule: Schedule.spaced("50 millis"),
|
|
290
|
+
while: (error) => error.cause === undefined
|
|
291
|
+
})) : effect;
|
|
292
|
+
const create = Effect.fn("Git.repo.create")(function* (input) {
|
|
293
|
+
const repository = new Repository2({
|
|
294
|
+
worktree: input.worktree,
|
|
295
|
+
gitDirectory: input.gitDirectory,
|
|
296
|
+
commonDirectory: input.gitDirectory
|
|
297
|
+
});
|
|
298
|
+
if (yield* fs.existsSafe(path.join(input.gitDirectory, "HEAD"))) {
|
|
299
|
+
yield* initRepository({ ...input, directory: input.gitDirectory });
|
|
300
|
+
return repository;
|
|
301
|
+
}
|
|
302
|
+
const temporaryDirectory = AbsolutePath2.make(`${input.gitDirectory}.init-${uniqueSuffix()}`);
|
|
303
|
+
yield* Effect.gen(function* () {
|
|
304
|
+
yield* initRepository({ ...input, directory: temporaryDirectory });
|
|
305
|
+
const renamed = yield* fs.rename(temporaryDirectory, input.gitDirectory).pipe(Effect.exit);
|
|
306
|
+
if (Exit.isSuccess(renamed) || (yield* fs.existsSafe(path.join(input.gitDirectory, "HEAD"))))
|
|
307
|
+
return;
|
|
308
|
+
return yield* new OperationError3({
|
|
309
|
+
operation: "create",
|
|
310
|
+
directory: input.gitDirectory,
|
|
311
|
+
message: "Failed to move Git storage into place",
|
|
312
|
+
cause: Cause.squash(renamed.cause)
|
|
313
|
+
});
|
|
314
|
+
}).pipe(Effect.ensuring(fs.remove(temporaryDirectory, { recursive: true, force: true }).pipe(Effect.ignore)));
|
|
315
|
+
return repository;
|
|
316
|
+
});
|
|
317
|
+
const initRepository = Effect.fnUntraced(function* (input) {
|
|
318
|
+
const operationError = (message) => (cause) => new OperationError3({ operation: "create", directory: input.gitDirectory, message, cause });
|
|
319
|
+
yield* fs.ensureDir(input.directory).pipe(Effect.mapError(operationError("Failed to create Git storage")));
|
|
320
|
+
yield* repositoryOperation("create", new Repository2({ worktree: input.worktree, gitDirectory: input.directory, commonDirectory: input.directory }), ["init"]);
|
|
321
|
+
yield* Effect.gen(function* () {
|
|
322
|
+
yield* fs.writeFileString(path.join(input.directory, snapshotConfigFile), snapshotConfig);
|
|
323
|
+
const config = path.join(input.directory, "config");
|
|
324
|
+
const current = yield* fs.readFileString(config);
|
|
325
|
+
if (current.includes(snapshotConfigInclude))
|
|
326
|
+
return;
|
|
327
|
+
yield* fs.writeFileString(config, `${current.endsWith(`
|
|
328
|
+
`) ? `
|
|
329
|
+
` : `
|
|
330
|
+
|
|
331
|
+
`}${snapshotConfigInclude}`, {
|
|
332
|
+
flag: "a"
|
|
333
|
+
});
|
|
334
|
+
}).pipe(Effect.mapError(operationError("Failed to configure Git storage")));
|
|
335
|
+
if (!input.seed)
|
|
336
|
+
return;
|
|
337
|
+
yield* fs.ensureDir(path.join(input.directory, "objects", "info")).pipe(Effect.mapError(operationError("Failed to configure shared Git objects")));
|
|
338
|
+
yield* fs.writeFileString(path.join(input.directory, "objects", "info", "alternates"), path.join(input.seed.commonDirectory, "objects") + `
|
|
339
|
+
`).pipe(Effect.mapError(operationError("Failed to configure shared Git objects")));
|
|
340
|
+
const index = path.join(input.directory, "index");
|
|
341
|
+
yield* seedIndex(new Repository2({ worktree: input.worktree, gitDirectory: input.directory, commonDirectory: input.directory }), input.seed, index).pipe(Effect.catch(() => fs.remove(index, { force: true })), Effect.ignore);
|
|
342
|
+
});
|
|
343
|
+
const listChanges = Effect.fnUntraced(function* (repository, scope, index, excludeFrom) {
|
|
344
|
+
const list = (args) => repositoryOperation("refresh", repository, args, { index }).pipe(Effect.map((result) => nuls(result.text).map((file) => RelativePath2.make(file.replace(/\/$/, "")))));
|
|
345
|
+
const [tracked, untracked] = yield* Effect.all([
|
|
346
|
+
list(["diff-files", "--name-only", "-z", "--", literalPathspec(scope)]),
|
|
347
|
+
list([
|
|
348
|
+
"ls-files",
|
|
349
|
+
"--others",
|
|
350
|
+
...excludeFrom ? [`--exclude-from=${excludeFrom}`] : [],
|
|
351
|
+
"--exclude-standard",
|
|
352
|
+
"-z",
|
|
353
|
+
"--",
|
|
354
|
+
literalPathspec(scope)
|
|
355
|
+
])
|
|
356
|
+
], { concurrency: 2 });
|
|
357
|
+
return { tracked, untracked };
|
|
358
|
+
});
|
|
359
|
+
const updateIndex = Effect.fnUntraced(function* (input) {
|
|
360
|
+
const candidates = [...input.changes.tracked, ...input.changes.untracked];
|
|
361
|
+
if (!candidates.length)
|
|
362
|
+
return { skipped: [] };
|
|
363
|
+
const excluded = input.excluded ?? (input.ignores ? yield* ignored({ repository: input.ignores, paths: candidates }) : new Set);
|
|
364
|
+
const maximum = input.maximumUntrackedFileBytes;
|
|
365
|
+
const skipped = maximum ? (yield* Effect.forEach(input.changes.untracked.filter((item) => !excluded.has(item)), (item) => fs.stat(path.join(input.repository.worktree, item)).pipe(Effect.map((info) => info.type === "File" && Number(info.size) > maximum ? item : undefined), Effect.orElseSucceed(() => {
|
|
366
|
+
return;
|
|
367
|
+
})), { concurrency: 8 })).filter((item) => item !== undefined) : [];
|
|
368
|
+
const skip = new Set(skipped);
|
|
369
|
+
const added = candidates.filter((item) => !excluded.has(item) && !skip.has(item));
|
|
370
|
+
const removed = input.changes.tracked.filter((item) => excluded.has(item));
|
|
371
|
+
if (removed.length)
|
|
372
|
+
yield* repositoryOperation("refresh", input.repository, ["update-index", "--force-remove", "-z", "--stdin"], {
|
|
373
|
+
stdin: removed.join("\x00") + "\x00",
|
|
374
|
+
index: input.index
|
|
375
|
+
});
|
|
376
|
+
const embedded = (yield* Effect.forEach(input.changes.tracked.filter((item) => !excluded.has(item)), (item) => fs.existsSafe(path.join(input.repository.worktree, item, ".git")).pipe(Effect.map((found) => found ? item : undefined)), { concurrency: 8 })).filter((item) => item !== undefined);
|
|
377
|
+
if (added.length)
|
|
378
|
+
yield* retryConcurrentObjectWrite(repositoryOperation("refresh", input.repository, ["update-index", "--add", "--remove", "--replace", "-z", "--stdin"], { stdin: [...added, ...embedded].join("\x00") + "\x00", index: input.index }));
|
|
379
|
+
return { skipped };
|
|
380
|
+
});
|
|
381
|
+
const refresh = Effect.fn("Git.index.refresh")(function* (input) {
|
|
382
|
+
return yield* updateIndex({ ...input, changes: yield* listChanges(input.repository, input.scope) });
|
|
383
|
+
});
|
|
384
|
+
const ignored = Effect.fn("Git.index.ignored")(function* (input) {
|
|
385
|
+
if (!input.paths.length)
|
|
386
|
+
return new Set;
|
|
387
|
+
const result = yield* proc.run(ChildProcess.make(gitExecutable2(), repositoryArgs(input.repository, ["check-ignore", "--no-index", "--stdin", "-z"]), {
|
|
388
|
+
cwd: input.repository.worktree,
|
|
389
|
+
extendEnv: true
|
|
390
|
+
}), { stdin: input.paths.join("\x00") + "\x00" }).pipe(Effect.mapError((cause) => new OperationError3({
|
|
391
|
+
operation: "list_files",
|
|
392
|
+
directory: input.repository.worktree,
|
|
393
|
+
message: cause.message,
|
|
394
|
+
cause
|
|
395
|
+
})));
|
|
396
|
+
if (result.exitCode !== 0 && result.exitCode !== 1)
|
|
397
|
+
return yield* new OperationError3({
|
|
398
|
+
operation: "list_files",
|
|
399
|
+
directory: input.repository.worktree,
|
|
400
|
+
message: result.stderr.toString("utf8").trim() || "Failed to check ignored paths"
|
|
401
|
+
});
|
|
402
|
+
return new Set(nuls(result.stdout.toString("utf8")).map((file) => RelativePath2.make(file)));
|
|
403
|
+
});
|
|
404
|
+
const writeTree = Effect.fn("Git.tree.write")(function* (repository, index) {
|
|
405
|
+
const tree = (yield* retryConcurrentObjectWrite(repositoryOperation("write_tree", repository, ["write-tree"], { index }))).text.trim();
|
|
406
|
+
if (/^[0-9a-f]{40,64}$/.test(tree))
|
|
407
|
+
return TreeID2.make(tree);
|
|
408
|
+
return yield* new OperationError3({
|
|
409
|
+
operation: "write_tree",
|
|
410
|
+
directory: repository.worktree,
|
|
411
|
+
message: `Invalid tree ID: ${tree}`
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
const indexFile = (repository) => path.join(repository.gitDirectory, "index");
|
|
415
|
+
const indexFingerprint = (file) => fs.stat(file).pipe(Effect.map((info) => [Option.getOrUndefined(info.ino), info.size, Option.getOrUndefined(info.mtime)?.getTime()].join(":")), Effect.orElseSucceed(() => {
|
|
416
|
+
return;
|
|
417
|
+
}));
|
|
418
|
+
const copyIndex = Effect.fnUntraced(function* (from, to) {
|
|
419
|
+
const info = yield* fs.stat(from);
|
|
420
|
+
yield* fs.copyFile(from, to);
|
|
421
|
+
const mtime = Option.getOrUndefined(info.mtime);
|
|
422
|
+
if (mtime)
|
|
423
|
+
yield* fs.utimes(to, Option.getOrElse(info.atime, () => mtime), mtime).pipe(Effect.ignore);
|
|
424
|
+
});
|
|
425
|
+
const seedIndex = Effect.fnUntraced(function* (store, source, target) {
|
|
426
|
+
yield* copyIndex(path.join(source.gitDirectory, "index"), target);
|
|
427
|
+
const shared = (yield* fs.readDirectory(source.gitDirectory)).filter((entry) => entry.startsWith("sharedindex."));
|
|
428
|
+
if (shared.length === 0)
|
|
429
|
+
return;
|
|
430
|
+
yield* Effect.forEach(shared, (entry) => {
|
|
431
|
+
const from = path.join(source.gitDirectory, entry);
|
|
432
|
+
const to = path.join(store.gitDirectory, entry);
|
|
433
|
+
return fs.link(from, to).pipe(Effect.catch(() => fs.copyFile(from, to)));
|
|
434
|
+
}).pipe(Effect.andThen(repositoryOperation("refresh", store, ["update-index", "--no-split-index"], { index: target })), Effect.ensuring(Effect.forEach(shared, (entry) => fs.remove(path.join(store.gitDirectory, entry), { force: true }).pipe(Effect.ignore))));
|
|
435
|
+
});
|
|
436
|
+
const withTemporaryIndex = (repository, use) => Effect.acquireUseRelease(Effect.gen(function* () {
|
|
437
|
+
const current = indexFile(repository);
|
|
438
|
+
const index = temporaryIndex(repository);
|
|
439
|
+
if (!(yield* fs.existsSafe(current)))
|
|
440
|
+
return index;
|
|
441
|
+
const linked = yield* fs.link(current, index).pipe(Effect.as(true), Effect.orElseSucceed(() => false));
|
|
442
|
+
if (linked)
|
|
443
|
+
return index;
|
|
444
|
+
yield* copyIndex(current, index).pipe(Effect.mapError((cause) => new OperationError3({
|
|
445
|
+
operation: "refresh",
|
|
446
|
+
directory: repository.gitDirectory,
|
|
447
|
+
message: "Failed to prepare a temporary index",
|
|
448
|
+
cause
|
|
449
|
+
})));
|
|
450
|
+
return index;
|
|
451
|
+
}), (index) => Effect.gen(function* () {
|
|
452
|
+
const value = yield* use(index);
|
|
453
|
+
const installed = yield* Effect.uninterruptible(Effect.gen(function* () {
|
|
454
|
+
const fingerprint = yield* indexFingerprint(index);
|
|
455
|
+
const renamed = yield* fs.rename(index, indexFile(repository)).pipe(Effect.retry({ times: 3, schedule: Schedule.spaced("20 millis") }), Effect.as(true), Effect.orElseSucceed(() => false));
|
|
456
|
+
return renamed ? fingerprint : undefined;
|
|
457
|
+
}));
|
|
458
|
+
return { value, installed };
|
|
459
|
+
}), (index) => fs.remove(index, { force: true }).pipe(Effect.ignore));
|
|
460
|
+
const lastCaptures = new Map;
|
|
461
|
+
const preparedStores = new Set;
|
|
462
|
+
const pendingCaptures = new Map;
|
|
463
|
+
const oversizedFiles = new Map;
|
|
464
|
+
const attemptCapture = Effect.fnUntraced(function* (input) {
|
|
465
|
+
const sourceExclude = input.ignores ? path.join(input.ignores.commonDirectory, "info", "exclude") : undefined;
|
|
466
|
+
const excludeFrom = sourceExclude && (yield* fs.existsSafe(sourceExclude)) ? sourceExclude : undefined;
|
|
467
|
+
const result = yield* withTemporaryIndex(input.repository, (index) => Effect.gen(function* () {
|
|
468
|
+
const scanned = yield* indexFingerprint(index);
|
|
469
|
+
const changes = yield* Effect.forEach(input.scopes, (scope) => listChanges(input.repository, scope, index, excludeFrom), { concurrency: "unbounded" });
|
|
470
|
+
const last = lastCaptures.get(input.repository.gitDirectory);
|
|
471
|
+
const untracked = changes.flatMap((change) => change.untracked);
|
|
472
|
+
const oversized = oversizedFiles.get(input.repository.gitDirectory);
|
|
473
|
+
const stillOversized = new Set(oversized ? (yield* Effect.forEach(untracked.filter((file) => oversized.has(file)), (file) => oversizedStamp(input, file).pipe(Effect.map((current) => current && current === oversized.get(file) ? file : undefined)), { concurrency: 8 })).filter((file) => file !== undefined) : []);
|
|
474
|
+
const excluded = scanned && last?.fingerprint === scanned && changes.every((change) => !change.tracked.length) ? input.ignores ? yield* ignored({
|
|
475
|
+
repository: input.ignores,
|
|
476
|
+
paths: untracked.filter((file) => !stillOversized.has(file))
|
|
477
|
+
}) : new Set : undefined;
|
|
478
|
+
if (last && excluded && untracked.every((file) => excluded.has(file) || stillOversized.has(file)))
|
|
479
|
+
return last.tree;
|
|
480
|
+
const skipped = (yield* Effect.forEach(changes, (change) => updateIndex({ ...input, changes: change, index, excluded }))).flatMap((update) => update.skipped);
|
|
481
|
+
oversizedFiles.set(input.repository.gitDirectory, new Map((yield* Effect.forEach(skipped, (file) => oversizedStamp(input, file).pipe(Effect.map((value) => [file, value])), { concurrency: 8 })).filter((entry) => entry[1] !== undefined)));
|
|
482
|
+
return yield* writeTree(input.repository, index);
|
|
483
|
+
}));
|
|
484
|
+
if (result.installed)
|
|
485
|
+
lastCaptures.set(input.repository.gitDirectory, { fingerprint: result.installed, tree: result.value });
|
|
486
|
+
if (!result.installed)
|
|
487
|
+
lastCaptures.delete(input.repository.gitDirectory);
|
|
488
|
+
return result.value;
|
|
489
|
+
});
|
|
490
|
+
const oversizedStamp = (input, file) => fs.stat(path.join(input.repository.worktree, file)).pipe(Effect.map((info) => input.maximumUntrackedFileBytes && info.type === "File" && Number(info.size) > input.maximumUntrackedFileBytes ? `${info.size}:${Option.getOrUndefined(info.mtime)?.getTime()}` : undefined), Effect.orElseSucceed(() => {
|
|
491
|
+
return;
|
|
492
|
+
}));
|
|
493
|
+
const captureTree = Effect.fn("Git.tree.capture")(function* (input) {
|
|
494
|
+
const key = JSON.stringify([
|
|
495
|
+
input.repository.gitDirectory,
|
|
496
|
+
input.repository.worktree,
|
|
497
|
+
input.scopes,
|
|
498
|
+
input.ignores?.gitDirectory,
|
|
499
|
+
input.maximumUntrackedFileBytes
|
|
500
|
+
]);
|
|
501
|
+
const pending = pendingCaptures.get(key);
|
|
502
|
+
if (pending) {
|
|
503
|
+
const exit = yield* Effect.exit(Deferred.await(pending));
|
|
504
|
+
if (Exit.isSuccess(exit) || !Cause.hasInterruptsOnly(exit.cause))
|
|
505
|
+
return yield* exit;
|
|
506
|
+
}
|
|
507
|
+
const deferred = Deferred.makeUnsafe();
|
|
508
|
+
const release = () => {
|
|
509
|
+
if (pendingCaptures.get(key) === deferred)
|
|
510
|
+
pendingCaptures.delete(key);
|
|
511
|
+
};
|
|
512
|
+
return yield* Effect.uninterruptibleMask((restore) => {
|
|
513
|
+
pendingCaptures.set(key, deferred);
|
|
514
|
+
return restore(captureLocked(input, release)).pipe(Effect.onExit((exit) => {
|
|
515
|
+
release();
|
|
516
|
+
return Deferred.done(deferred, exit);
|
|
517
|
+
}));
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
const captureLocked = (input, onStart) => locked(input.repository, Effect.gen(function* () {
|
|
521
|
+
onStart();
|
|
522
|
+
if (!preparedStores.has(input.repository.gitDirectory)) {
|
|
523
|
+
preparedStores.add(input.repository.gitDirectory);
|
|
524
|
+
yield* sweepTemporaryIndexes(input.repository);
|
|
525
|
+
yield* ensureSnapshotConfig(input.repository);
|
|
526
|
+
}
|
|
527
|
+
return yield* attemptCapture(input).pipe(Effect.catch((error) => Effect.gen(function* () {
|
|
528
|
+
if (!(yield* isIndexUnreadable(input.repository)))
|
|
529
|
+
return yield* error;
|
|
530
|
+
yield* Effect.logWarning("rebuilding unreadable snapshot index", {
|
|
531
|
+
directory: input.repository.gitDirectory,
|
|
532
|
+
message: error.message
|
|
533
|
+
});
|
|
534
|
+
yield* rebuildIndex(input.repository, input.ignores);
|
|
535
|
+
return yield* attemptCapture(input);
|
|
536
|
+
})));
|
|
537
|
+
}));
|
|
538
|
+
const isIndexUnreadable = Effect.fnUntraced(function* (repository) {
|
|
539
|
+
if (!(yield* fs.existsSafe(indexFile(repository))))
|
|
540
|
+
return false;
|
|
541
|
+
return yield* repositoryOperation("refresh", repository, [
|
|
542
|
+
"ls-files",
|
|
543
|
+
"-z",
|
|
544
|
+
"--",
|
|
545
|
+
literalPathspec(".opencode-probe")
|
|
546
|
+
]).pipe(Effect.match({ onSuccess: () => false, onFailure: (error) => error.cause === undefined }));
|
|
547
|
+
});
|
|
548
|
+
const rebuildIndex = Effect.fnUntraced(function* (repository, source) {
|
|
549
|
+
lastCaptures.delete(repository.gitDirectory);
|
|
550
|
+
const temporary = temporaryIndex(repository);
|
|
551
|
+
const copied = source ? yield* seedIndex(repository, source, temporary).pipe(Effect.as(true), Effect.orElseSucceed(() => false)) : false;
|
|
552
|
+
yield* (copied ? fs.rename(temporary, indexFile(repository)) : fs.remove(indexFile(repository), { force: true })).pipe(Effect.ignore, Effect.ensuring(fs.remove(temporary, { force: true }).pipe(Effect.ignore)));
|
|
553
|
+
});
|
|
554
|
+
const ensureSnapshotConfig = Effect.fnUntraced(function* (repository) {
|
|
555
|
+
const file = path.join(repository.gitDirectory, snapshotConfigFile);
|
|
556
|
+
const current = yield* fs.readFileStringSafe(file).pipe(Effect.orElseSucceed(() => {
|
|
557
|
+
return;
|
|
558
|
+
}));
|
|
559
|
+
if (current === undefined || current === snapshotConfig)
|
|
560
|
+
return;
|
|
561
|
+
const temporary = `${file}.${uniqueSuffix()}`;
|
|
562
|
+
yield* fs.writeFileString(temporary, snapshotConfig).pipe(Effect.andThen(fs.rename(temporary, file)), Effect.ignore, Effect.ensuring(fs.remove(temporary, { force: true }).pipe(Effect.ignore)));
|
|
563
|
+
});
|
|
564
|
+
const temporaryIndex = (repository) => path.join(repository.gitDirectory, `${temporaryIndexPrefix}${Date.now()}-${uniqueSuffix()}`);
|
|
565
|
+
const sweepTemporaryIndexes = Effect.fnUntraced(function* (repository) {
|
|
566
|
+
const cutoff = Date.now() - 60 * 60 * 1000;
|
|
567
|
+
const entries = yield* fs.readDirectory(repository.gitDirectory).pipe(Effect.orElseSucceed(() => []));
|
|
568
|
+
yield* Effect.forEach(entries.filter((entry) => entry.startsWith(temporaryIndexPrefix) && Number(entry.slice(temporaryIndexPrefix.length).split("-")[0]) < cutoff), (entry) => fs.remove(path.join(repository.gitDirectory, entry), { force: true }).pipe(Effect.ignore), { discard: true });
|
|
569
|
+
});
|
|
570
|
+
const treeFiles = Effect.fn("Git.tree.files")(function* (input) {
|
|
571
|
+
return nuls((yield* repositoryOperation("list_files", input.repository, [
|
|
572
|
+
"diff",
|
|
573
|
+
"--name-only",
|
|
574
|
+
"--no-renames",
|
|
575
|
+
"-z",
|
|
576
|
+
input.from,
|
|
577
|
+
input.to
|
|
578
|
+
])).text).map((file) => RelativePath2.make(file));
|
|
579
|
+
});
|
|
580
|
+
const treeDiff = Effect.fn("Git.tree.diff")(function* (input) {
|
|
581
|
+
if (input.paths?.length === 0)
|
|
582
|
+
return [];
|
|
583
|
+
const groups = input.paths ? pathGroups(input.paths) : [undefined];
|
|
584
|
+
const diffs = [];
|
|
585
|
+
let patchBudget = MAX_TOTAL_PATCH_BYTES2;
|
|
586
|
+
for (const paths of groups) {
|
|
587
|
+
const group = yield* diffGroup({ ...input, paths }, patchBudget);
|
|
588
|
+
diffs.push(...group.diffs);
|
|
589
|
+
patchBudget = group.truncated ? 0 : patchBudget - group.patchBytes;
|
|
590
|
+
}
|
|
591
|
+
return diffs;
|
|
592
|
+
});
|
|
593
|
+
const diffGroup = Effect.fnUntraced(function* (input, patchBudget) {
|
|
594
|
+
const args = ["--no-renames", input.from, input.to, "--", ...input.paths ?? []];
|
|
595
|
+
const [names, numbers, patch] = yield* Effect.all([
|
|
596
|
+
repositoryOperation("diff", input.repository, [
|
|
597
|
+
"--literal-pathspecs",
|
|
598
|
+
"diff",
|
|
599
|
+
"--name-status",
|
|
600
|
+
"-z",
|
|
601
|
+
...args
|
|
602
|
+
]),
|
|
603
|
+
repositoryOperation("diff", input.repository, ["--literal-pathspecs", "diff", "--numstat", "-z", ...args]),
|
|
604
|
+
patchBudget > 0 ? repositoryOperation("diff", input.repository, [
|
|
605
|
+
"--literal-pathspecs",
|
|
606
|
+
"-c",
|
|
607
|
+
"core.quotepath=false",
|
|
608
|
+
"diff",
|
|
609
|
+
"--no-ext-diff",
|
|
610
|
+
`--unified=${input.context ?? 3}`,
|
|
611
|
+
...args
|
|
612
|
+
], { maxOutputBytes: patchBudget }) : Effect.succeed({ text: "", stderr: "", truncated: true })
|
|
613
|
+
], { concurrency: 3 });
|
|
614
|
+
const statuses = nuls(names.text);
|
|
615
|
+
const files = statuses.flatMap((code, index) => {
|
|
616
|
+
const file = statuses[index + 1];
|
|
617
|
+
if (index % 2 !== 0 || !file)
|
|
618
|
+
return [];
|
|
619
|
+
return [
|
|
620
|
+
{
|
|
621
|
+
file: RelativePath2.make(file),
|
|
622
|
+
status: code.startsWith("A") ? "added" : code.startsWith("D") ? "deleted" : "modified"
|
|
623
|
+
}
|
|
624
|
+
];
|
|
625
|
+
});
|
|
626
|
+
const stats = new Map(nuls(numbers.text).flatMap((line) => {
|
|
627
|
+
const [additions, deletions, ...file] = line.split("\t");
|
|
628
|
+
if (!additions || !deletions || file.length === 0)
|
|
629
|
+
return [];
|
|
630
|
+
return [
|
|
631
|
+
[
|
|
632
|
+
file.join("\t"),
|
|
633
|
+
additions === "-" || deletions === "-" ? { binary: true, additions: 0, deletions: 0 } : { binary: false, additions: Number(additions), deletions: Number(deletions) }
|
|
634
|
+
]
|
|
635
|
+
];
|
|
636
|
+
}));
|
|
637
|
+
const patches = chunksByFile2(patch, (index) => files[index]?.file);
|
|
638
|
+
return {
|
|
639
|
+
diffs: files.map((entry) => {
|
|
640
|
+
const stat = stats.get(entry.file);
|
|
641
|
+
return {
|
|
642
|
+
...entry,
|
|
643
|
+
additions: stat?.additions ?? 0,
|
|
644
|
+
deletions: stat?.deletions ?? 0,
|
|
645
|
+
patch: stat?.binary ? "" : patches.get(entry.file) ?? emptyPatch2(entry.file)
|
|
646
|
+
};
|
|
647
|
+
}),
|
|
648
|
+
patchBytes: Buffer.byteLength(patch.text),
|
|
649
|
+
truncated: patch.truncated
|
|
650
|
+
};
|
|
651
|
+
});
|
|
652
|
+
const hasEntry = Effect.fnUntraced(function* (repository, tree, file) {
|
|
653
|
+
const text = (yield* repositoryOperation("restore", repository, [
|
|
654
|
+
"ls-tree",
|
|
655
|
+
"-z",
|
|
656
|
+
tree,
|
|
657
|
+
"--",
|
|
658
|
+
literalPathspec(file)
|
|
659
|
+
])).text.replace(/\0$/, "");
|
|
660
|
+
if (!text)
|
|
661
|
+
return false;
|
|
662
|
+
if (!/^\d+\s+\w+\s+[0-9a-f]+\t/.test(text))
|
|
663
|
+
return yield* new OperationError3({
|
|
664
|
+
operation: "restore",
|
|
665
|
+
directory: repository.worktree,
|
|
666
|
+
message: `Invalid tree entry for ${file}`
|
|
667
|
+
});
|
|
668
|
+
return true;
|
|
669
|
+
});
|
|
670
|
+
const removePath = (repository, file) => fs.remove(path.join(repository.worktree, file), { recursive: true, force: true }).pipe(Effect.mapError((cause) => new OperationError3({
|
|
671
|
+
operation: "restore",
|
|
672
|
+
directory: repository.worktree,
|
|
673
|
+
message: `Failed to remove ${file}`,
|
|
674
|
+
cause
|
|
675
|
+
})));
|
|
676
|
+
const pathsInTree = Effect.fnUntraced(function* (repository, tree, files) {
|
|
677
|
+
const pathspecs = files.map(literalPathspec);
|
|
678
|
+
const fits = pathspecs.reduce((length, pathspec) => length + pathspec.length + 1, 0) <= argumentBudget;
|
|
679
|
+
const result = yield* repositoryOperation("restore", repository, fits ? ["ls-tree", "-z", tree, "--", ...pathspecs] : ["ls-tree", "-r", "-t", "-z", "--full-tree", tree]);
|
|
680
|
+
const listed = yield* Effect.forEach(nuls(result.text), (record) => {
|
|
681
|
+
const match = /^\d+ \w+ [0-9a-f]+\t(.*)$/s.exec(record);
|
|
682
|
+
if (match)
|
|
683
|
+
return Effect.succeed(RelativePath2.make(match[1]));
|
|
684
|
+
return Effect.fail(new OperationError3({
|
|
685
|
+
operation: "restore",
|
|
686
|
+
directory: repository.worktree,
|
|
687
|
+
message: `Invalid tree entry: ${record}`
|
|
688
|
+
}));
|
|
689
|
+
});
|
|
690
|
+
return new Set(listed);
|
|
691
|
+
});
|
|
692
|
+
const restore = Effect.fn("Git.tree.restore")((input) => locked(input.repository, Effect.gen(function* () {
|
|
693
|
+
if (!input.files.size)
|
|
694
|
+
return;
|
|
695
|
+
if (!canBatchRestore([...input.files.keys()]))
|
|
696
|
+
return yield* Effect.forEach(input.files, ([file, tree]) => Effect.gen(function* () {
|
|
697
|
+
if (!(yield* hasEntry(input.repository, tree, file)))
|
|
698
|
+
return yield* removePath(input.repository, file);
|
|
699
|
+
yield* withTemporaryIndex(input.repository, (index) => repositoryOperation("restore", input.repository, ["checkout", tree, "--", literalPathspec(file)], {
|
|
700
|
+
index
|
|
701
|
+
}));
|
|
702
|
+
}), { discard: true });
|
|
703
|
+
const groups = new Map;
|
|
704
|
+
input.files.forEach((tree, file) => groups.set(tree, [...groups.get(tree) ?? [], file]));
|
|
705
|
+
const plan = yield* Effect.forEach(groups, ([tree, files]) => pathsInTree(input.repository, tree, files).pipe(Effect.map((present) => ({
|
|
706
|
+
tree,
|
|
707
|
+
present: files.filter((file) => present.has(file)),
|
|
708
|
+
absent: files.filter((file) => !present.has(file))
|
|
709
|
+
}))));
|
|
710
|
+
const checkouts = plan.filter((item) => item.present.length);
|
|
711
|
+
if (checkouts.length)
|
|
712
|
+
yield* withTemporaryIndex(input.repository, (index) => Effect.forEach(checkouts, (item) => repositoryOperation("restore", input.repository, ["checkout", item.tree, "--pathspec-from-file=-", "--pathspec-file-nul"], { stdin: item.present.map(literalPathspec).join("\x00") + "\x00", index }), { discard: true }));
|
|
713
|
+
yield* Effect.forEach(plan.flatMap((item) => item.absent), (file) => removePath(input.repository, file), { concurrency: 16, discard: true });
|
|
714
|
+
})));
|
|
715
|
+
const packObjects = Effect.fn("Git.objects.pack")(function* (repository) {
|
|
716
|
+
const objects = path.join(repository.gitDirectory, "objects");
|
|
717
|
+
const packDirectory = path.join(objects, "pack");
|
|
718
|
+
const loose = yield* looseObjects(objects);
|
|
719
|
+
const packs = yield* localPacks(packDirectory);
|
|
720
|
+
const combinePacks = packs.length >= packCountLimit;
|
|
721
|
+
if (loose.length < looseObjectLimit && !combinePacks)
|
|
722
|
+
return;
|
|
723
|
+
yield* withPackLock(repository, Effect.gen(function* () {
|
|
724
|
+
yield* sweepTemporaryPacks(packDirectory);
|
|
725
|
+
const combined = combinePacks ? yield* Effect.forEach(packs, (pack) => packIndex(repository, path.join(packDirectory, `${pack}.idx`)).pipe(Effect.map((oids) => ({ pack, oids })))) : [];
|
|
726
|
+
const objectIds = [...new Set([...loose.map((item) => item.oid), ...combined.flatMap((item) => item.oids)])];
|
|
727
|
+
if (!objectIds.length)
|
|
728
|
+
return;
|
|
729
|
+
const newPacks = (yield* repositoryOperation("pack", repository, [
|
|
730
|
+
"-c",
|
|
731
|
+
"pack.threads=2",
|
|
732
|
+
"-c",
|
|
733
|
+
"pack.windowMemory=64m",
|
|
734
|
+
"pack-objects",
|
|
735
|
+
"-q",
|
|
736
|
+
"--non-empty",
|
|
737
|
+
path.join(packDirectory, "pack")
|
|
738
|
+
], { stdin: objectIds.join(`
|
|
739
|
+
`) + `
|
|
740
|
+
` })).text.split(`
|
|
741
|
+
`).map((line) => line.trim()).filter(Boolean);
|
|
742
|
+
const packedIds = new Set((yield* Effect.forEach(newPacks, (name) => packIndex(repository, path.join(packDirectory, `pack-${name}.idx`)))).flat());
|
|
743
|
+
const missing = objectIds.filter((oid) => !packedIds.has(oid));
|
|
744
|
+
if (missing.length)
|
|
745
|
+
return yield* new OperationError3({
|
|
746
|
+
operation: "pack",
|
|
747
|
+
directory: repository.gitDirectory,
|
|
748
|
+
message: `Packed ${packedIds.size} objects but ${missing.length} are missing; nothing was removed`
|
|
749
|
+
});
|
|
750
|
+
yield* Effect.uninterruptible(Effect.gen(function* () {
|
|
751
|
+
yield* Effect.forEach(loose, (item) => fs.remove(item.file, { force: true }).pipe(Effect.ignore), {
|
|
752
|
+
concurrency: 16,
|
|
753
|
+
discard: true
|
|
754
|
+
});
|
|
755
|
+
const newPackNames = new Set(newPacks.map((name) => `pack-${name}`));
|
|
756
|
+
yield* Effect.forEach(combined.filter((item) => !newPackNames.has(item.pack)), (item) => Effect.forEach([".idx", ".pack", ".rev", ".bitmap", ".mtimes"], (extension) => fs.remove(path.join(packDirectory, `${item.pack}${extension}`), { force: true }).pipe(Effect.ignore), { discard: true }), { discard: true });
|
|
757
|
+
}));
|
|
758
|
+
}));
|
|
759
|
+
});
|
|
760
|
+
const looseObjects = Effect.fnUntraced(function* (objects) {
|
|
761
|
+
const fanout = (yield* fs.readDirectory(objects).pipe(Effect.orElseSucceed(() => []))).filter((entry) => /^[0-9a-f]{2}$/.test(entry));
|
|
762
|
+
const listed = yield* Effect.forEach(fanout, (prefix) => fs.readDirectory(path.join(objects, prefix)).pipe(Effect.orElseSucceed(() => []), Effect.map((entries) => entries.filter((entry) => /^[0-9a-f]{38}$|^[0-9a-f]{62}$/.test(entry)).map((entry) => ({ oid: prefix + entry, file: path.join(objects, prefix, entry) })))), { concurrency: 16 });
|
|
763
|
+
return listed.flat();
|
|
764
|
+
});
|
|
765
|
+
const localPacks = Effect.fnUntraced(function* (directory) {
|
|
766
|
+
const entries = new Set(yield* fs.readDirectory(directory).pipe(Effect.orElseSucceed(() => [])));
|
|
767
|
+
return [...entries].filter((entry) => entry.startsWith("pack-") && entry.endsWith(".pack")).map((entry) => entry.slice(0, -".pack".length)).filter((pack) => entries.has(`${pack}.idx`) && !entries.has(`${pack}.keep`) && !entries.has(`${pack}.promisor`));
|
|
768
|
+
});
|
|
769
|
+
const packIndex = Effect.fnUntraced(function* (repository, file) {
|
|
770
|
+
const bytes = yield* fs.readFile(file).pipe(Effect.mapError((cause) => new OperationError3({
|
|
771
|
+
operation: "pack",
|
|
772
|
+
directory: repository.gitDirectory,
|
|
773
|
+
message: `Failed to read ${file}`,
|
|
774
|
+
cause
|
|
775
|
+
})));
|
|
776
|
+
const parsed = packIndexObjectIDs(bytes);
|
|
777
|
+
if (parsed)
|
|
778
|
+
return parsed;
|
|
779
|
+
const result = yield* repositoryOperation("pack", repository, ["show-index"], { stdin: bytes });
|
|
780
|
+
return result.text.split(`
|
|
781
|
+
`).flatMap((line) => {
|
|
782
|
+
const oid = line.split(" ")[1];
|
|
783
|
+
return oid ? [oid] : [];
|
|
784
|
+
});
|
|
785
|
+
});
|
|
786
|
+
const sweepTemporaryPacks = Effect.fnUntraced(function* (directory) {
|
|
787
|
+
const cutoff = Date.now() - 60 * 60 * 1000;
|
|
788
|
+
const entries = yield* fs.readDirectory(directory).pipe(Effect.orElseSucceed(() => []));
|
|
789
|
+
const indexed = new Set(entries.filter((entry) => entry.endsWith(".idx")).map((entry) => entry.slice(0, -4)));
|
|
790
|
+
yield* Effect.forEach(entries.filter((entry) => entry.startsWith("tmp_") || entry.startsWith("pack-") && entry.endsWith(".pack") && !indexed.has(entry.slice(0, -5))), (entry) => fs.stat(path.join(directory, entry)).pipe(Effect.flatMap((info) => (Option.getOrUndefined(info.mtime)?.getTime() ?? 0) < cutoff ? fs.remove(path.join(directory, entry), { force: true }) : Effect.void), Effect.ignore), { discard: true });
|
|
791
|
+
});
|
|
792
|
+
const withPackLock = (repository, effect) => {
|
|
793
|
+
const file = path.join(repository.gitDirectory, "opencode-pack.lock");
|
|
794
|
+
return Effect.gen(function* () {
|
|
795
|
+
const stale = yield* fs.stat(file).pipe(Effect.map((info) => (Option.getOrUndefined(info.mtime)?.getTime() ?? 0) < Date.now() - 60 * 60 * 1000), Effect.orElseSucceed(() => false));
|
|
796
|
+
if (stale)
|
|
797
|
+
yield* fs.remove(file, { force: true }).pipe(Effect.ignore);
|
|
798
|
+
const acquired = yield* fs.writeFileString(file, String(process.pid), { flag: "wx" }).pipe(Effect.as(true), Effect.orElseSucceed(() => false));
|
|
799
|
+
if (!acquired)
|
|
800
|
+
return;
|
|
801
|
+
yield* effect.pipe(Effect.ensuring(fs.remove(file, { force: true }).pipe(Effect.ignore)));
|
|
802
|
+
});
|
|
803
|
+
};
|
|
804
|
+
const worktreeRun = Effect.fnUntraced(function* (operation, repository, args, worktreeDirectory, cwd = repository.worktree) {
|
|
805
|
+
const result = yield* proc.run(ChildProcess.make(gitExecutable2(), args, { cwd, extendEnv: true, stdin: "ignore" })).pipe(Effect.mapError((cause) => new WorktreeError2({ operation, directory: worktreeDirectory, message: cause.message, cause })));
|
|
806
|
+
if (result.exitCode === 0)
|
|
807
|
+
return result.stdout.toString("utf8");
|
|
808
|
+
const message = result.stderr.toString("utf8").trim() || result.stdout.toString("utf8").trim() || "Git failed";
|
|
809
|
+
return yield* new WorktreeError2({
|
|
810
|
+
operation,
|
|
811
|
+
directory: worktreeDirectory,
|
|
812
|
+
message,
|
|
813
|
+
forceRequired: operation === "remove" && /contains modified or untracked files|is dirty/i.test(message)
|
|
814
|
+
});
|
|
815
|
+
});
|
|
816
|
+
const worktreeCreate = Effect.fn("Git.worktree.create")(function* (input) {
|
|
817
|
+
yield* worktreeRun("create", input.repository, ["worktree", "add", "--detach", "--", input.directory, input.ref ?? "HEAD"], input.directory);
|
|
818
|
+
const repository = yield* discover(input.directory);
|
|
819
|
+
if (repository)
|
|
820
|
+
return repository;
|
|
821
|
+
return yield* new WorktreeError2({
|
|
822
|
+
operation: "create",
|
|
823
|
+
directory: input.directory,
|
|
824
|
+
message: "Created worktree could not be opened"
|
|
825
|
+
});
|
|
826
|
+
});
|
|
827
|
+
const worktreeRemove = Effect.fn("Git.worktree.remove")(function* (input) {
|
|
828
|
+
yield* worktreeRun("remove", input.repository, ["worktree", "remove", ...input.force ? ["--force"] : [], input.directory], input.directory, input.repository.commonDirectory);
|
|
829
|
+
});
|
|
830
|
+
const worktreeList = Effect.fn("Git.worktree.list")(function* (repository) {
|
|
831
|
+
return (yield* worktreeRun("list", repository, ["worktree", "list", "--porcelain"])).split(`
|
|
832
|
+
`).filter((line) => line.startsWith("worktree ")).map((line, index) => new Worktree2({
|
|
833
|
+
directory: AbsolutePath2.make(resolvePath(repository.worktree, line.slice("worktree ".length).trim())),
|
|
834
|
+
kind: index === 0 ? "main" : "linked"
|
|
835
|
+
}));
|
|
836
|
+
});
|
|
837
|
+
return Service88.of({
|
|
838
|
+
repo: { discover, fingerprint, clone, create },
|
|
839
|
+
remote: { get: remote },
|
|
840
|
+
history: { head, branch, defaultRemoteBranch: remoteHead, rootCommits: roots },
|
|
841
|
+
sync: { fetchRemotes: fetch, fetchBranch, checkoutRemoteBranch: checkout, resetHard: reset },
|
|
842
|
+
worktree: { create: worktreeCreate, remove: worktreeRemove, list: worktreeList },
|
|
843
|
+
index: { refresh, ignored },
|
|
844
|
+
tree: {
|
|
845
|
+
capture: captureTree,
|
|
846
|
+
write: (repository) => writeTree(repository),
|
|
847
|
+
files: treeFiles,
|
|
848
|
+
diff: treeDiff,
|
|
849
|
+
restore
|
|
850
|
+
},
|
|
851
|
+
objects: { pack: packObjects }
|
|
852
|
+
});
|
|
853
|
+
}));
|
|
854
|
+
var node91 = makeGlobalNode({ service: Service88, layer, deps: [FSUtil.node, AppProcess.node] });
|
|
855
|
+
function run(cwd, proc, args) {
|
|
856
|
+
return execute(cwd, proc, args).pipe(Effect.orElseSucceed(() => ({ exitCode: 1, text: "", stderr: "" })));
|
|
857
|
+
}
|
|
858
|
+
function execute(cwd, proc, args) {
|
|
859
|
+
return proc.run(ChildProcess.make(gitExecutable2(), args, {
|
|
860
|
+
cwd,
|
|
861
|
+
extendEnv: true,
|
|
862
|
+
stdin: "ignore"
|
|
863
|
+
})).pipe(Effect.map((result) => ({
|
|
864
|
+
exitCode: result.exitCode,
|
|
865
|
+
text: result.stdout.toString("utf8"),
|
|
866
|
+
stderr: result.stderr.toString("utf8")
|
|
867
|
+
})));
|
|
868
|
+
}
|
|
869
|
+
function nuls(text) {
|
|
870
|
+
return text.split("\x00").filter(Boolean);
|
|
871
|
+
}
|
|
872
|
+
function literalPathspec(file) {
|
|
873
|
+
return `:(literal)${file}`;
|
|
874
|
+
}
|
|
875
|
+
function canBatchRestore(files) {
|
|
876
|
+
const canonical = files.every((file) => file.split("/").every((part) => /^[\x20-\x7e]+$/.test(part) && !/[\\:]/.test(part) && !/[. ]$/.test(part)));
|
|
877
|
+
if (!canonical)
|
|
878
|
+
return false;
|
|
879
|
+
const folded = new Set(files.map((file) => file.toLowerCase()));
|
|
880
|
+
if (folded.size !== files.length)
|
|
881
|
+
return false;
|
|
882
|
+
return files.every((file) => {
|
|
883
|
+
const parts = file.toLowerCase().split("/");
|
|
884
|
+
return parts.slice(1).every((_, index) => !folded.has(parts.slice(0, index + 1).join("/")));
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
function packIndexObjectIDs(bytes) {
|
|
888
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
889
|
+
if (bytes.length < 1032 || view.getUint32(0) !== 4285812579 || view.getUint32(4) !== 2)
|
|
890
|
+
return;
|
|
891
|
+
const count = view.getUint32(8 + 255 * 4);
|
|
892
|
+
const hash = (bytes.length - 1032 - 8 * count) / (count + 2);
|
|
893
|
+
if (hash !== 20 && hash !== 32)
|
|
894
|
+
return;
|
|
895
|
+
return Array.from({ length: count }, (_, index) => Buffer.from(bytes.subarray(1032 + index * hash, 1032 + (index + 1) * hash)).toString("hex"));
|
|
896
|
+
}
|
|
897
|
+
function pathGroups(paths) {
|
|
898
|
+
return paths.toSorted((left, right) => Buffer.compare(Buffer.from(left), Buffer.from(right))).reduce((state, file) => {
|
|
899
|
+
const cost = file.length + 3;
|
|
900
|
+
const current = state.groups.at(-1);
|
|
901
|
+
if (current && state.length + cost <= argumentBudget) {
|
|
902
|
+
current.push(file);
|
|
903
|
+
return { groups: state.groups, length: state.length + cost };
|
|
904
|
+
}
|
|
905
|
+
return { groups: [...state.groups, [file]], length: cost };
|
|
906
|
+
}, { groups: [], length: 0 }).groups;
|
|
907
|
+
}
|
|
908
|
+
function uniqueSuffix() {
|
|
909
|
+
return `${process.pid}-${Math.random().toString(36).slice(2)}`;
|
|
910
|
+
}
|
|
911
|
+
function resolvePath(cwd, value) {
|
|
912
|
+
const trimmed = value.replace(/[\r\n]+$/, "");
|
|
913
|
+
if (!trimmed)
|
|
914
|
+
return cwd;
|
|
915
|
+
const normalized = FSUtil.windowsPath(trimmed);
|
|
916
|
+
if (path.isAbsolute(normalized))
|
|
917
|
+
return path.normalize(normalized);
|
|
918
|
+
return path.resolve(cwd, normalized);
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
export { Repository2, TreeID2, OperationError3, CommandError2, Worktree2, WorktreeError2, Service88, node91, exports_git3 };
|