jialing-code 1.1.0
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/README.md +97 -0
- package/dist/chunk-065m026w.js +97 -0
- package/dist/chunk-06saje2v.js +39 -0
- package/dist/chunk-0731m51q.js +8 -0
- package/dist/chunk-0975ccyw.js +265 -0
- package/dist/chunk-09n3fjx5.js +67 -0
- package/dist/chunk-0bdjdzew.js +41 -0
- package/dist/chunk-0ce6kd7y.js +212 -0
- package/dist/chunk-0e1xsncc.js +969 -0
- package/dist/chunk-0m2861gw.js +154 -0
- package/dist/chunk-0paqc2yw.js +15 -0
- package/dist/chunk-0rg6yrhy.js +99 -0
- package/dist/chunk-0sakxrcf.js +643 -0
- package/dist/chunk-0v9hwxvz.js +105 -0
- package/dist/chunk-0vkfrmqm.js +690 -0
- package/dist/chunk-0vvfnhhv.js +248 -0
- package/dist/chunk-0w4rsycj.js +145 -0
- package/dist/chunk-0x9b2nmd.js +63 -0
- package/dist/chunk-0xjaqda8.js +1124 -0
- package/dist/chunk-1141xmr4.js +8 -0
- package/dist/chunk-13d1842d.js +154 -0
- package/dist/chunk-1921a6yb.js +32 -0
- package/dist/chunk-1ad8mk9g.js +527 -0
- package/dist/chunk-1ax41pws.js +28 -0
- package/dist/chunk-1c8z1b5v.js +16 -0
- package/dist/chunk-1cbn5kxf.js +7 -0
- package/dist/chunk-1eapde8a.js +726 -0
- package/dist/chunk-1h2famwb.js +49 -0
- package/dist/chunk-1jggnf7z.js +85 -0
- package/dist/chunk-1k92pn9c.js +32 -0
- package/dist/chunk-1qakq4sn.js +802 -0
- package/dist/chunk-1rvz0433.js +722 -0
- package/dist/chunk-1xkekb9y.js +19 -0
- package/dist/chunk-238g70xa.js +36 -0
- package/dist/chunk-24ge0eqa.js +106 -0
- package/dist/chunk-278vghwm.js +5395 -0
- package/dist/chunk-27xc1csx.js +104 -0
- package/dist/chunk-2a42s11t.js +412 -0
- package/dist/chunk-2aa02aw6.js +438 -0
- package/dist/chunk-2eykm0j0.js +20 -0
- package/dist/chunk-2gzv8nrw.js +205 -0
- package/dist/chunk-2k995y2x.js +880 -0
- package/dist/chunk-2nayx6q1.js +63 -0
- package/dist/chunk-2sd2w2h4.js +44 -0
- package/dist/chunk-2tw2ve8h.js +145 -0
- package/dist/chunk-30rst83v.js +168 -0
- package/dist/chunk-3aavh06g.js +1581 -0
- package/dist/chunk-3b0yvt2h.js +469 -0
- package/dist/chunk-3be7ka25.js +56 -0
- package/dist/chunk-3c25bcsw.js +17 -0
- package/dist/chunk-3dyxka97.js +584 -0
- package/dist/chunk-3f7rypmf.js +16544 -0
- package/dist/chunk-3fsd7f51.js +93 -0
- package/dist/chunk-3gqdqmzb.js +75 -0
- package/dist/chunk-3h8a89gy.js +46 -0
- package/dist/chunk-3m84sret.js +71 -0
- package/dist/chunk-3nb7j3js.js +96 -0
- package/dist/chunk-3p08nvn2.js +98 -0
- package/dist/chunk-3r09htpc.js +318 -0
- package/dist/chunk-3r24h7t6.js +113 -0
- package/dist/chunk-3rkfxjtq.js +80 -0
- package/dist/chunk-3tmk7dc2.js +604 -0
- package/dist/chunk-3w6s9m5w.js +16 -0
- package/dist/chunk-43qjymy5.js +92 -0
- package/dist/chunk-44fpr6jq.js +434 -0
- package/dist/chunk-45kxdsp8.js +444 -0
- package/dist/chunk-495d85x1.js +8066 -0
- package/dist/chunk-4ba796se.js +1095 -0
- package/dist/chunk-4g3v8y12.js +23 -0
- package/dist/chunk-4h53xj8n.js +3445 -0
- package/dist/chunk-4jm600zv.js +13 -0
- package/dist/chunk-4jy9dtwk.js +116 -0
- package/dist/chunk-4p60dd45.js +55 -0
- package/dist/chunk-4z0jsrqg.js +81 -0
- package/dist/chunk-4zfkzkt6.js +37 -0
- package/dist/chunk-55wgxwa9.js +13877 -0
- package/dist/chunk-5dbk24zg.js +890 -0
- package/dist/chunk-5hzvp4va.js +115 -0
- package/dist/chunk-5kbt1mbt.js +500 -0
- package/dist/chunk-5pen7vr8.js +176 -0
- package/dist/chunk-5r280eng.js +198 -0
- package/dist/chunk-5srym52s.js +88 -0
- package/dist/chunk-600kg7k6.js +41 -0
- package/dist/chunk-616w0qj3.js +160 -0
- package/dist/chunk-62jw1t8c.js +94 -0
- package/dist/chunk-62xmt9mk.js +372 -0
- package/dist/chunk-64bvg7c3.js +229 -0
- package/dist/chunk-65yhe4s0.js +281 -0
- package/dist/chunk-6aewh27m.js +102 -0
- package/dist/chunk-6bd8brc4.js +48 -0
- package/dist/chunk-6dj5t602.js +341 -0
- package/dist/chunk-6exxdk1p.js +6956 -0
- package/dist/chunk-6f5j8fs0.js +752 -0
- package/dist/chunk-6g62sjpf.js +328 -0
- package/dist/chunk-6gecq2ta.js +1493 -0
- package/dist/chunk-6gr3c3w9.js +378 -0
- package/dist/chunk-6kpbgc5w.js +23 -0
- package/dist/chunk-6kseqw79.js +154 -0
- package/dist/chunk-6mxm1qd0.js +40764 -0
- package/dist/chunk-6n2qgm9v.js +8 -0
- package/dist/chunk-6tq2v3rk.js +186 -0
- package/dist/chunk-6wsdhj3v.js +93 -0
- package/dist/chunk-6zw9fhgb.js +4389 -0
- package/dist/chunk-71grc1mw.js +111 -0
- package/dist/chunk-73rpbt04.js +1947 -0
- package/dist/chunk-748feghg.js +604 -0
- package/dist/chunk-75e8gtg9.js +84 -0
- package/dist/chunk-75th4717.js +780 -0
- package/dist/chunk-760252na.js +101 -0
- package/dist/chunk-7739pg2c.js +4261 -0
- package/dist/chunk-778fnx46.js +472 -0
- package/dist/chunk-77g09znh.js +391 -0
- package/dist/chunk-7aw745vx.js +40175 -0
- package/dist/chunk-7m2nd8da.js +110 -0
- package/dist/chunk-7n35vjtw.js +444 -0
- package/dist/chunk-7n5ss4sh.js +144 -0
- package/dist/chunk-7rjnxcfe.js +107 -0
- package/dist/chunk-7sb5axvf.js +122 -0
- package/dist/chunk-7wm5s02e.js +216 -0
- package/dist/chunk-7ymfj7m3.js +151 -0
- package/dist/chunk-7z8j9qfn.js +121 -0
- package/dist/chunk-7zsapntc.js +216 -0
- package/dist/chunk-805fhkfh.js +908 -0
- package/dist/chunk-80k1nj24.js +253 -0
- package/dist/chunk-83hfzbx3.js +10 -0
- package/dist/chunk-85cypsdd.js +92 -0
- package/dist/chunk-8760caxf.js +2644 -0
- package/dist/chunk-88f6egg6.js +387 -0
- package/dist/chunk-88r7kwgj.js +22 -0
- package/dist/chunk-89e1v45e.js +463 -0
- package/dist/chunk-8bedvdm1.js +32 -0
- package/dist/chunk-8c4x4vdz.js +177 -0
- package/dist/chunk-8hq5kk3y.js +44 -0
- package/dist/chunk-8ngxagxq.js +18 -0
- package/dist/chunk-8tnsngw2.js +31 -0
- package/dist/chunk-8wjnca8h.js +307 -0
- package/dist/chunk-8y12jxg8.js +10 -0
- package/dist/chunk-8ymf4e6z.js +48 -0
- package/dist/chunk-90wp6wez.js +10510 -0
- package/dist/chunk-92bp5bnf.js +650 -0
- package/dist/chunk-92q8sx5z.js +90 -0
- package/dist/chunk-958rtmtx.js +10476 -0
- package/dist/chunk-9e2kqv5g.js +125 -0
- package/dist/chunk-9f4f1hy5.js +281 -0
- package/dist/chunk-9gbamk79.js +93 -0
- package/dist/chunk-9k5s3ryh.js +167 -0
- package/dist/chunk-9xzfqm15.js +97 -0
- package/dist/chunk-9zgdvbm6.js +110 -0
- package/dist/chunk-a0p3q8jw.js +24 -0
- package/dist/chunk-a22sayzp.js +220 -0
- package/dist/chunk-a8ejc632.js +3094 -0
- package/dist/chunk-a8gj9d9z.js +120 -0
- package/dist/chunk-a9vdeb6y.js +258 -0
- package/dist/chunk-a9yev47v.js +674 -0
- package/dist/chunk-a9zh40sj.js +48 -0
- package/dist/chunk-ack5mfba.js +105 -0
- package/dist/chunk-ae76ded0.js +30 -0
- package/dist/chunk-akjw4dh6.js +538 -0
- package/dist/chunk-asc6wz4q.js +1188 -0
- package/dist/chunk-atqejh3p.js +273 -0
- package/dist/chunk-atv2e6b7.js +61 -0
- package/dist/chunk-axvvkwz8.js +1551 -0
- package/dist/chunk-azgz7kj9.js +38 -0
- package/dist/chunk-b3zave8q.js +275 -0
- package/dist/chunk-b4wg70y1.js +54 -0
- package/dist/chunk-b8b13qn2.js +100 -0
- package/dist/chunk-bg3mt9bm.js +28 -0
- package/dist/chunk-bh4jvcjn.js +91 -0
- package/dist/chunk-bhdt6k7w.js +15 -0
- package/dist/chunk-bm1qb16p.js +17 -0
- package/dist/chunk-bpvsd1j1.js +266 -0
- package/dist/chunk-bqfnp99q.js +477 -0
- package/dist/chunk-bsbmmfyt.js +17 -0
- package/dist/chunk-bsbt34jm.js +42 -0
- package/dist/chunk-c78akdhr.js +458 -0
- package/dist/chunk-cdz5yb0r.js +57 -0
- package/dist/chunk-cfv996bs.js +22 -0
- package/dist/chunk-cgfdkzhb.js +12 -0
- package/dist/chunk-ckh4r5er.js +257 -0
- package/dist/chunk-cmgjnvn9.js +89 -0
- package/dist/chunk-cpjgvay8.js +687 -0
- package/dist/chunk-crfryjx9.js +276 -0
- package/dist/chunk-ctw5jwcd.js +213 -0
- package/dist/chunk-cvy3vntc.js +65 -0
- package/dist/chunk-cwbzz504.js +94 -0
- package/dist/chunk-cy2hswr1.js +15 -0
- package/dist/chunk-cyejkay3.js +222 -0
- package/dist/chunk-d18z9pna.js +106 -0
- package/dist/chunk-d5cq0n0v.js +162 -0
- package/dist/chunk-db45aryp.js +50 -0
- package/dist/chunk-de8nqh0z.js +790 -0
- package/dist/chunk-dfw6h350.js +2336 -0
- package/dist/chunk-dgqrcy74.js +48 -0
- package/dist/chunk-dn75ptgd.js +184 -0
- package/dist/chunk-dnh7jtpb.js +37 -0
- package/dist/chunk-dpshyv9m.js +90 -0
- package/dist/chunk-dt8cdvnm.js +642 -0
- package/dist/chunk-dtxby6fr.js +306 -0
- package/dist/chunk-dv1wfr85.js +6373 -0
- package/dist/chunk-dw363edx.js +1154 -0
- package/dist/chunk-dwrdacck.js +62 -0
- package/dist/chunk-dxnnv5e3.js +276 -0
- package/dist/chunk-e3g8q4cn.js +1646 -0
- package/dist/chunk-e3m9k9s2.js +542 -0
- package/dist/chunk-e4q49asn.js +155 -0
- package/dist/chunk-e5pntxye.js +37 -0
- package/dist/chunk-e7393td6.js +42 -0
- package/dist/chunk-ead42yrh.js +87 -0
- package/dist/chunk-eb90vwvr.js +152 -0
- package/dist/chunk-ecvwk9hg.js +250 -0
- package/dist/chunk-edjd6aay.js +173 -0
- package/dist/chunk-eg0h8mtm.js +130 -0
- package/dist/chunk-ehtwnxpg.js +1591 -0
- package/dist/chunk-ek686gx1.js +94 -0
- package/dist/chunk-eqp1rfft.js +17 -0
- package/dist/chunk-evhwt0ar.js +1015 -0
- package/dist/chunk-ewadzrm8.js +103 -0
- package/dist/chunk-ewsgsw9h.js +172291 -0
- package/dist/chunk-f0pa0r7e.js +3198 -0
- package/dist/chunk-f2mhrmww.js +62 -0
- package/dist/chunk-f39zxvwn.js +401 -0
- package/dist/chunk-f46z54tq.js +374 -0
- package/dist/chunk-f5ma3nh5.js +3436 -0
- package/dist/chunk-f60q23az.js +3038 -0
- package/dist/chunk-f6v2nz57.js +107 -0
- package/dist/chunk-f6yjan38.js +38 -0
- package/dist/chunk-fbv4apne.js +51 -0
- package/dist/chunk-fem4s778.js +70 -0
- package/dist/chunk-fezm1kn8.js +376 -0
- package/dist/chunk-fm1n3ysp.js +6108 -0
- package/dist/chunk-frg83bfw.js +225 -0
- package/dist/chunk-fscm8db0.js +692 -0
- package/dist/chunk-fyc5fepv.js +10 -0
- package/dist/chunk-g0j0t6qk.js +26 -0
- package/dist/chunk-g0nc1ftf.js +849 -0
- package/dist/chunk-g338npwr.js +1061 -0
- package/dist/chunk-g3t0act8.js +8 -0
- package/dist/chunk-g75w4hw3.js +26 -0
- package/dist/chunk-g8vp82en.js +1866 -0
- package/dist/chunk-gax0fcbx.js +182 -0
- package/dist/chunk-gsz4dh3y.js +606 -0
- package/dist/chunk-gtfffm7h.js +440 -0
- package/dist/chunk-gver9zb9.js +420 -0
- package/dist/chunk-gyj242zr.js +20 -0
- package/dist/chunk-h0qngp9w.js +157 -0
- package/dist/chunk-h14kemnk.js +123 -0
- package/dist/chunk-h8wj1a74.js +8960 -0
- package/dist/chunk-h9mcb2eg.js +87 -0
- package/dist/chunk-h9nh2980.js +91 -0
- package/dist/chunk-hakdhagh.js +16606 -0
- package/dist/chunk-hbc6ymdv.js +55 -0
- package/dist/chunk-hh7cmy4k.js +20 -0
- package/dist/chunk-hjhc4cpt.js +69 -0
- package/dist/chunk-hjwez8qc.js +5018 -0
- package/dist/chunk-hk9xz7gk.js +118 -0
- package/dist/chunk-hqmz36b3.js +552 -0
- package/dist/chunk-hrzerbfw.js +1299 -0
- package/dist/chunk-hs8ph4p8.js +8 -0
- package/dist/chunk-ht1xwrnd.js +716 -0
- package/dist/chunk-hvmfg2dc.js +338 -0
- package/dist/chunk-hx2tr4ep.js +7189 -0
- package/dist/chunk-hzhe8ygc.js +547 -0
- package/dist/chunk-j2k4p94p.js +55 -0
- package/dist/chunk-j3a4p81y.js +184 -0
- package/dist/chunk-j49g6g3s.js +57 -0
- package/dist/chunk-j5d5hp9h.js +71 -0
- package/dist/chunk-j64ga6ta.js +8035 -0
- package/dist/chunk-j7tyxan1.js +116 -0
- package/dist/chunk-j8v4774z.js +424 -0
- package/dist/chunk-jafes477.js +29 -0
- package/dist/chunk-jd32zbps.js +15 -0
- package/dist/chunk-jdgeec04.js +4249 -0
- package/dist/chunk-jftd4jq5.js +4521 -0
- package/dist/chunk-jkxqhv6y.js +812 -0
- package/dist/chunk-jmfr6h0n.js +120 -0
- package/dist/chunk-jn4aabmx.js +40 -0
- package/dist/chunk-jnhkref0.js +30 -0
- package/dist/chunk-jsbpm1gz.js +27 -0
- package/dist/chunk-jtcyjc3k.js +5802 -0
- package/dist/chunk-jx817w05.js +11 -0
- package/dist/chunk-jzmz18nn.js +65 -0
- package/dist/chunk-k0p9w03v.js +4957 -0
- package/dist/chunk-k3dcdnck.js +89 -0
- package/dist/chunk-k3wadzcd.js +88 -0
- package/dist/chunk-kaeshsk1.js +713 -0
- package/dist/chunk-kbkey9ed.js +522 -0
- package/dist/chunk-kcwfhqbb.js +196 -0
- package/dist/chunk-key6jr7p.js +224 -0
- package/dist/chunk-knay8cy9.js +173 -0
- package/dist/chunk-kr3rg2y1.js +95 -0
- package/dist/chunk-kwekc97v.js +18 -0
- package/dist/chunk-m06q12hg.js +61 -0
- package/dist/chunk-m2mcpbhk.js +43 -0
- package/dist/chunk-m8v220gz.js +71 -0
- package/dist/chunk-mgpqy78h.js +208 -0
- package/dist/chunk-mkejwh4t.js +16 -0
- package/dist/chunk-mptyw5n1.js +107 -0
- package/dist/chunk-mqajm0dp.js +66 -0
- package/dist/chunk-mrksbgxj.js +490 -0
- package/dist/chunk-msjfc5ba.js +246 -0
- package/dist/chunk-mt25echc.js +6157 -0
- package/dist/chunk-mt3jfnr8.js +277 -0
- package/dist/chunk-mtn242d4.js +9300 -0
- package/dist/chunk-mzfkvave.js +169 -0
- package/dist/chunk-n0qaeaa5.js +256 -0
- package/dist/chunk-n1erf6kh.js +22820 -0
- package/dist/chunk-n2avk1r2.js +61 -0
- package/dist/chunk-n6atnpcq.js +765 -0
- package/dist/chunk-n7ttdtk0.js +641 -0
- package/dist/chunk-ncnfzby5.js +822 -0
- package/dist/chunk-ncnr1jtf.js +2058 -0
- package/dist/chunk-nerv0jvx.js +74 -0
- package/dist/chunk-ngd2abep.js +90 -0
- package/dist/chunk-nka1g8f4.js +773 -0
- package/dist/chunk-nnaxkc2z.js +128 -0
- package/dist/chunk-npyrtj8j.js +691 -0
- package/dist/chunk-nq0fxyxh.js +752 -0
- package/dist/chunk-nrmffak7.js +114 -0
- package/dist/chunk-nsz546wq.js +1170 -0
- package/dist/chunk-nt837qt9.js +21 -0
- package/dist/chunk-nv64x1z5.js +86 -0
- package/dist/chunk-nxsh6de2.js +1711 -0
- package/dist/chunk-nz4getcr.js +40 -0
- package/dist/chunk-p1f607pa.js +83 -0
- package/dist/chunk-p2816w9z.js +1486 -0
- package/dist/chunk-p2d5nh3g.js +342 -0
- package/dist/chunk-p4r5y02t.js +90 -0
- package/dist/chunk-p7g7pf3f.js +336 -0
- package/dist/chunk-pb4ad8r2.js +110 -0
- package/dist/chunk-pbrhz0zr.js +716 -0
- package/dist/chunk-ps49ymvj.js +43 -0
- package/dist/chunk-pwnt3veb.js +103 -0
- package/dist/chunk-pwwa7s62.js +11 -0
- package/dist/chunk-px3w0kde.js +299 -0
- package/dist/chunk-pzn777jb.js +756 -0
- package/dist/chunk-q25bjaev.js +15 -0
- package/dist/chunk-q5by3da6.js +8 -0
- package/dist/chunk-q6av622g.js +38 -0
- package/dist/chunk-q6xkvtf2.js +1318 -0
- package/dist/chunk-q81jx1tq.js +476 -0
- package/dist/chunk-qehb6fk5.js +339 -0
- package/dist/chunk-qj1avx1q.js +87 -0
- package/dist/chunk-qn2dxr66.js +105 -0
- package/dist/chunk-qnfx3qtx.js +617 -0
- package/dist/chunk-qp18kd4h.js +48 -0
- package/dist/chunk-qp2qdcda.js +100 -0
- package/dist/chunk-qpjy9tcf.js +133 -0
- package/dist/chunk-qqfa0dqg.js +2343 -0
- package/dist/chunk-qwh3htcz.js +202 -0
- package/dist/chunk-qz2x630m.js +49145 -0
- package/dist/chunk-r3vakcs1.js +496 -0
- package/dist/chunk-r66hz8j6.js +34 -0
- package/dist/chunk-r6b58y3x.js +17 -0
- package/dist/chunk-rekp48rk.js +62 -0
- package/dist/chunk-rn0v1hk8.js +34 -0
- package/dist/chunk-rs1xrs6m.js +534 -0
- package/dist/chunk-rs45skes.js +123 -0
- package/dist/chunk-rzszqp82.js +524 -0
- package/dist/chunk-s274nv8k.js +8 -0
- package/dist/chunk-s3pzvdss.js +50 -0
- package/dist/chunk-s9mesaw0.js +26840 -0
- package/dist/chunk-sd36yzx8.js +954 -0
- package/dist/chunk-sdj9b9wh.js +782 -0
- package/dist/chunk-sdw2q69p.js +227 -0
- package/dist/chunk-sfgp9cc0.js +130 -0
- package/dist/chunk-spqaamnc.js +63 -0
- package/dist/chunk-spzrs4df.js +73 -0
- package/dist/chunk-sxkr7k43.js +55 -0
- package/dist/chunk-szj5wvdy.js +28 -0
- package/dist/chunk-t0rgmccj.js +39 -0
- package/dist/chunk-t1nnzjgg.js +17 -0
- package/dist/chunk-t94fcnt8.js +566 -0
- package/dist/chunk-tjaqa99q.js +125 -0
- package/dist/chunk-tjq2evtw.js +328 -0
- package/dist/chunk-ts2p6bv1.js +224 -0
- package/dist/chunk-ttk5dzz8.js +25 -0
- package/dist/chunk-tw0q7ynt.js +59 -0
- package/dist/chunk-v02jkvgy.js +131 -0
- package/dist/chunk-v084bqt3.js +1529 -0
- package/dist/chunk-v0amythm.js +164 -0
- package/dist/chunk-v1kzp02e.js +785 -0
- package/dist/chunk-v1mgv1et.js +15 -0
- package/dist/chunk-v399mzxk.js +58 -0
- package/dist/chunk-v3gm2day.js +8 -0
- package/dist/chunk-v43hrrxp.js +71 -0
- package/dist/chunk-v6aqb2aj.js +102 -0
- package/dist/chunk-v78fj8by.js +145 -0
- package/dist/chunk-v7qmhjdn.js +1921 -0
- package/dist/chunk-v9smspw2.js +4301 -0
- package/dist/chunk-vdw93s4h.js +2431 -0
- package/dist/chunk-vest0y6x.js +3830 -0
- package/dist/chunk-vf5sd1nq.js +12 -0
- package/dist/chunk-vratq94g.js +349 -0
- package/dist/chunk-vrz7t3m3.js +20 -0
- package/dist/chunk-vtb185z9.js +70 -0
- package/dist/chunk-vx01rvg8.js +654 -0
- package/dist/chunk-vyc0rjyx.js +31 -0
- package/dist/chunk-vyjeh50y.js +2149 -0
- package/dist/chunk-vzpffsza.js +269 -0
- package/dist/chunk-w2ef3kxk.js +3353 -0
- package/dist/chunk-w2z5pqd3.js +336 -0
- package/dist/chunk-w3whm4mn.js +432 -0
- package/dist/chunk-w7wgpqcp.js +157 -0
- package/dist/chunk-waa00cvb.js +301 -0
- package/dist/chunk-wb0qm4es.js +155 -0
- package/dist/chunk-wbkahkdc.js +27 -0
- package/dist/chunk-wfz0qffj.js +3939 -0
- package/dist/chunk-wn0cx0pt.js +283 -0
- package/dist/chunk-wv6gzt9c.js +726 -0
- package/dist/chunk-wx42ycm4.js +998 -0
- package/dist/chunk-wxkpgy05.js +268 -0
- package/dist/chunk-wzpdet3m.js +843 -0
- package/dist/chunk-x0mwzt38.js +714 -0
- package/dist/chunk-x592wbfh.js +244 -0
- package/dist/chunk-x5pqsp9r.js +100 -0
- package/dist/chunk-x679thag.js +825 -0
- package/dist/chunk-x8b7vft8.js +132 -0
- package/dist/chunk-x8cftch7.js +119 -0
- package/dist/chunk-x9q7r885.js +348 -0
- package/dist/chunk-xawkt0vb.js +1585 -0
- package/dist/chunk-xdw5dv00.js +8 -0
- package/dist/chunk-xe9cc860.js +287 -0
- package/dist/chunk-xjr9c3vt.js +101 -0
- package/dist/chunk-xk7zaqta.js +21933 -0
- package/dist/chunk-xktbmawc.js +678 -0
- package/dist/chunk-xn6yw46v.js +140 -0
- package/dist/chunk-xsq9ae7x.js +90 -0
- package/dist/chunk-xszk7n10.js +14358 -0
- package/dist/chunk-xt8a5r1t.js +84 -0
- package/dist/chunk-xydyndkv.js +195 -0
- package/dist/chunk-xzt10yc5.js +60 -0
- package/dist/chunk-y04y95dr.js +91 -0
- package/dist/chunk-y1784krc.js +19 -0
- package/dist/chunk-y1x32h3x.js +128 -0
- package/dist/chunk-y3s7aww5.js +99 -0
- package/dist/chunk-y47cg3kz.js +42 -0
- package/dist/chunk-y7kzvepn.js +469 -0
- package/dist/chunk-y89kbsyc.js +287 -0
- package/dist/chunk-yd87p1c3.js +159 -0
- package/dist/chunk-yf3yw8fw.js +105 -0
- package/dist/chunk-ygbf0ezx.js +1391 -0
- package/dist/chunk-yjbxnshv.js +208 -0
- package/dist/chunk-ynednmqd.js +192 -0
- package/dist/chunk-yvhez44y.js +259 -0
- package/dist/chunk-ywxd4qw4.js +22 -0
- package/dist/chunk-yzrmgpy4.js +117 -0
- package/dist/chunk-z0b2vb24.js +862 -0
- package/dist/chunk-z1zj044v.js +655 -0
- package/dist/chunk-z2dp53wn.js +17 -0
- package/dist/chunk-z3w0xasa.js +165 -0
- package/dist/chunk-z7ycmrb3.js +644 -0
- package/dist/chunk-zh11tdkb.js +347 -0
- package/dist/chunk-zk2wsm7d.js +15 -0
- package/dist/chunk-zqfqcf22.js +229 -0
- package/dist/chunk-zqk2j8px.js +699 -0
- package/dist/chunk-zqvsc10j.js +2833 -0
- package/dist/chunk-zsfxha74.js +17655 -0
- package/dist/chunk-zvc4snyb.js +117 -0
- package/dist/cli.js +194 -0
- package/package.json +173 -0
|
@@ -0,0 +1,1299 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
init_memoize as init_memoize2,
|
|
4
|
+
memoizeWithLRU
|
|
5
|
+
} from "./chunk-d18z9pna.js";
|
|
6
|
+
import {
|
|
7
|
+
init_which,
|
|
8
|
+
whichSync
|
|
9
|
+
} from "./chunk-hjhc4cpt.js";
|
|
10
|
+
import {
|
|
11
|
+
execFileNoThrow,
|
|
12
|
+
init_execFileNoThrow
|
|
13
|
+
} from "./chunk-hx2tr4ep.js";
|
|
14
|
+
import {
|
|
15
|
+
init_log,
|
|
16
|
+
logError
|
|
17
|
+
} from "./chunk-p7g7pf3f.js";
|
|
18
|
+
import {
|
|
19
|
+
getCwd,
|
|
20
|
+
init_cwd
|
|
21
|
+
} from "./chunk-8bedvdm1.js";
|
|
22
|
+
import {
|
|
23
|
+
getFsImplementation,
|
|
24
|
+
init_cleanupRegistry,
|
|
25
|
+
init_debug,
|
|
26
|
+
init_fsOperations,
|
|
27
|
+
init_slowOperations,
|
|
28
|
+
jsonStringify,
|
|
29
|
+
logForDebugging,
|
|
30
|
+
registerCleanup
|
|
31
|
+
} from "./chunk-nxsh6de2.js";
|
|
32
|
+
import {
|
|
33
|
+
init_state,
|
|
34
|
+
waitForScrollIdle
|
|
35
|
+
} from "./chunk-qqfa0dqg.js";
|
|
36
|
+
import {
|
|
37
|
+
init_memoize,
|
|
38
|
+
memoize_default
|
|
39
|
+
} from "./chunk-hqmz36b3.js";
|
|
40
|
+
import {
|
|
41
|
+
__esm,
|
|
42
|
+
__require
|
|
43
|
+
} from "./chunk-qp2qdcda.js";
|
|
44
|
+
|
|
45
|
+
// src/constants/files.ts
|
|
46
|
+
function hasBinaryExtension(filePath) {
|
|
47
|
+
const ext = filePath.slice(filePath.lastIndexOf(".")).toLowerCase();
|
|
48
|
+
return BINARY_EXTENSIONS.has(ext);
|
|
49
|
+
}
|
|
50
|
+
function isBinaryContent(buffer) {
|
|
51
|
+
const checkSize = Math.min(buffer.length, BINARY_CHECK_SIZE);
|
|
52
|
+
let nonPrintable = 0;
|
|
53
|
+
for (let i = 0;i < checkSize; i++) {
|
|
54
|
+
const byte = buffer[i];
|
|
55
|
+
if (byte === 0) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (byte < 32 && byte !== 9 && byte !== 10 && byte !== 13) {
|
|
59
|
+
nonPrintable++;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return nonPrintable / checkSize > 0.1;
|
|
63
|
+
}
|
|
64
|
+
var BINARY_EXTENSIONS, BINARY_CHECK_SIZE = 8192;
|
|
65
|
+
var init_files = __esm(() => {
|
|
66
|
+
BINARY_EXTENSIONS = new Set([
|
|
67
|
+
".png",
|
|
68
|
+
".jpg",
|
|
69
|
+
".jpeg",
|
|
70
|
+
".gif",
|
|
71
|
+
".bmp",
|
|
72
|
+
".ico",
|
|
73
|
+
".webp",
|
|
74
|
+
".tiff",
|
|
75
|
+
".tif",
|
|
76
|
+
".mp4",
|
|
77
|
+
".mov",
|
|
78
|
+
".avi",
|
|
79
|
+
".mkv",
|
|
80
|
+
".webm",
|
|
81
|
+
".wmv",
|
|
82
|
+
".flv",
|
|
83
|
+
".m4v",
|
|
84
|
+
".mpeg",
|
|
85
|
+
".mpg",
|
|
86
|
+
".mp3",
|
|
87
|
+
".wav",
|
|
88
|
+
".ogg",
|
|
89
|
+
".flac",
|
|
90
|
+
".aac",
|
|
91
|
+
".m4a",
|
|
92
|
+
".wma",
|
|
93
|
+
".aiff",
|
|
94
|
+
".opus",
|
|
95
|
+
".zip",
|
|
96
|
+
".tar",
|
|
97
|
+
".gz",
|
|
98
|
+
".bz2",
|
|
99
|
+
".7z",
|
|
100
|
+
".rar",
|
|
101
|
+
".xz",
|
|
102
|
+
".z",
|
|
103
|
+
".tgz",
|
|
104
|
+
".iso",
|
|
105
|
+
".exe",
|
|
106
|
+
".dll",
|
|
107
|
+
".so",
|
|
108
|
+
".dylib",
|
|
109
|
+
".bin",
|
|
110
|
+
".o",
|
|
111
|
+
".a",
|
|
112
|
+
".obj",
|
|
113
|
+
".lib",
|
|
114
|
+
".app",
|
|
115
|
+
".msi",
|
|
116
|
+
".deb",
|
|
117
|
+
".rpm",
|
|
118
|
+
".pdf",
|
|
119
|
+
".doc",
|
|
120
|
+
".docx",
|
|
121
|
+
".xls",
|
|
122
|
+
".xlsx",
|
|
123
|
+
".ppt",
|
|
124
|
+
".pptx",
|
|
125
|
+
".odt",
|
|
126
|
+
".ods",
|
|
127
|
+
".odp",
|
|
128
|
+
".ttf",
|
|
129
|
+
".otf",
|
|
130
|
+
".woff",
|
|
131
|
+
".woff2",
|
|
132
|
+
".eot",
|
|
133
|
+
".pyc",
|
|
134
|
+
".pyo",
|
|
135
|
+
".class",
|
|
136
|
+
".jar",
|
|
137
|
+
".war",
|
|
138
|
+
".ear",
|
|
139
|
+
".node",
|
|
140
|
+
".wasm",
|
|
141
|
+
".rlib",
|
|
142
|
+
".sqlite",
|
|
143
|
+
".sqlite3",
|
|
144
|
+
".db",
|
|
145
|
+
".mdb",
|
|
146
|
+
".idx",
|
|
147
|
+
".psd",
|
|
148
|
+
".ai",
|
|
149
|
+
".eps",
|
|
150
|
+
".sketch",
|
|
151
|
+
".fig",
|
|
152
|
+
".xd",
|
|
153
|
+
".blend",
|
|
154
|
+
".3ds",
|
|
155
|
+
".max",
|
|
156
|
+
".swf",
|
|
157
|
+
".fla",
|
|
158
|
+
".lockb",
|
|
159
|
+
".dat",
|
|
160
|
+
".data"
|
|
161
|
+
]);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// src/utils/diagLogs.ts
|
|
165
|
+
import { dirname } from "path";
|
|
166
|
+
function logForDiagnosticsNoPII(level, event, data) {
|
|
167
|
+
const logFile = getDiagnosticLogFile();
|
|
168
|
+
if (!logFile) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const entry = {
|
|
172
|
+
timestamp: new Date().toISOString(),
|
|
173
|
+
level,
|
|
174
|
+
event,
|
|
175
|
+
data: data ?? {}
|
|
176
|
+
};
|
|
177
|
+
const fs = getFsImplementation();
|
|
178
|
+
const line = jsonStringify(entry) + `
|
|
179
|
+
`;
|
|
180
|
+
try {
|
|
181
|
+
fs.appendFileSync(logFile, line);
|
|
182
|
+
} catch {
|
|
183
|
+
try {
|
|
184
|
+
fs.mkdirSync(dirname(logFile));
|
|
185
|
+
fs.appendFileSync(logFile, line);
|
|
186
|
+
} catch {}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function getDiagnosticLogFile() {
|
|
190
|
+
return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE;
|
|
191
|
+
}
|
|
192
|
+
async function withDiagnosticsTiming(event, fn, getData) {
|
|
193
|
+
const startTime = Date.now();
|
|
194
|
+
logForDiagnosticsNoPII("info", `${event}_started`);
|
|
195
|
+
try {
|
|
196
|
+
const result = await fn();
|
|
197
|
+
const additionalData = getData ? getData(result) : {};
|
|
198
|
+
logForDiagnosticsNoPII("info", `${event}_completed`, {
|
|
199
|
+
duration_ms: Date.now() - startTime,
|
|
200
|
+
...additionalData
|
|
201
|
+
});
|
|
202
|
+
return result;
|
|
203
|
+
} catch (error) {
|
|
204
|
+
logForDiagnosticsNoPII("error", `${event}_failed`, {
|
|
205
|
+
duration_ms: Date.now() - startTime
|
|
206
|
+
});
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
var init_diagLogs = __esm(() => {
|
|
211
|
+
init_fsOperations();
|
|
212
|
+
init_slowOperations();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// src/utils/git/gitConfigParser.ts
|
|
216
|
+
import { readFile } from "fs/promises";
|
|
217
|
+
import { join } from "path";
|
|
218
|
+
async function parseGitConfigValue(gitDir, section, subsection, key) {
|
|
219
|
+
try {
|
|
220
|
+
const config = await readFile(join(gitDir, "config"), "utf-8");
|
|
221
|
+
return parseConfigString(config, section, subsection, key);
|
|
222
|
+
} catch {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function parseConfigString(config, section, subsection, key) {
|
|
227
|
+
const lines = config.split(`
|
|
228
|
+
`);
|
|
229
|
+
const sectionLower = section.toLowerCase();
|
|
230
|
+
const keyLower = key.toLowerCase();
|
|
231
|
+
let inSection = false;
|
|
232
|
+
for (const line of lines) {
|
|
233
|
+
const trimmed = line.trim();
|
|
234
|
+
if (trimmed.length === 0 || trimmed[0] === "#" || trimmed[0] === ";") {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (trimmed[0] === "[") {
|
|
238
|
+
inSection = matchesSectionHeader(trimmed, sectionLower, subsection);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (!inSection) {
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
const parsed = parseKeyValue(trimmed);
|
|
245
|
+
if (parsed && parsed.key.toLowerCase() === keyLower) {
|
|
246
|
+
return parsed.value;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
function parseKeyValue(line) {
|
|
252
|
+
let i = 0;
|
|
253
|
+
while (i < line.length && isKeyChar(line[i])) {
|
|
254
|
+
i++;
|
|
255
|
+
}
|
|
256
|
+
if (i === 0) {
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
const key = line.slice(0, i);
|
|
260
|
+
while (i < line.length && (line[i] === " " || line[i] === "\t")) {
|
|
261
|
+
i++;
|
|
262
|
+
}
|
|
263
|
+
if (i >= line.length || line[i] !== "=") {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
i++;
|
|
267
|
+
while (i < line.length && (line[i] === " " || line[i] === "\t")) {
|
|
268
|
+
i++;
|
|
269
|
+
}
|
|
270
|
+
const value = parseValue(line, i);
|
|
271
|
+
return { key, value };
|
|
272
|
+
}
|
|
273
|
+
function parseValue(line, start) {
|
|
274
|
+
let result = "";
|
|
275
|
+
let inQuote = false;
|
|
276
|
+
let i = start;
|
|
277
|
+
while (i < line.length) {
|
|
278
|
+
const ch = line[i];
|
|
279
|
+
if (!inQuote && (ch === "#" || ch === ";")) {
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
if (ch === '"') {
|
|
283
|
+
inQuote = !inQuote;
|
|
284
|
+
i++;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (ch === "\\" && i + 1 < line.length) {
|
|
288
|
+
const next = line[i + 1];
|
|
289
|
+
if (inQuote) {
|
|
290
|
+
switch (next) {
|
|
291
|
+
case "n":
|
|
292
|
+
result += `
|
|
293
|
+
`;
|
|
294
|
+
break;
|
|
295
|
+
case "t":
|
|
296
|
+
result += "\t";
|
|
297
|
+
break;
|
|
298
|
+
case "b":
|
|
299
|
+
result += "\b";
|
|
300
|
+
break;
|
|
301
|
+
case '"':
|
|
302
|
+
result += '"';
|
|
303
|
+
break;
|
|
304
|
+
case "\\":
|
|
305
|
+
result += "\\";
|
|
306
|
+
break;
|
|
307
|
+
default:
|
|
308
|
+
result += next;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
i += 2;
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (next === "\\") {
|
|
315
|
+
result += "\\";
|
|
316
|
+
i += 2;
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
result += ch;
|
|
321
|
+
i++;
|
|
322
|
+
}
|
|
323
|
+
if (!inQuote) {
|
|
324
|
+
result = trimTrailingWhitespace(result);
|
|
325
|
+
}
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
function trimTrailingWhitespace(s) {
|
|
329
|
+
let end = s.length;
|
|
330
|
+
while (end > 0 && (s[end - 1] === " " || s[end - 1] === "\t")) {
|
|
331
|
+
end--;
|
|
332
|
+
}
|
|
333
|
+
return s.slice(0, end);
|
|
334
|
+
}
|
|
335
|
+
function matchesSectionHeader(line, sectionLower, subsection) {
|
|
336
|
+
let i = 1;
|
|
337
|
+
while (i < line.length && line[i] !== "]" && line[i] !== " " && line[i] !== "\t" && line[i] !== '"') {
|
|
338
|
+
i++;
|
|
339
|
+
}
|
|
340
|
+
const foundSection = line.slice(1, i).toLowerCase();
|
|
341
|
+
if (foundSection !== sectionLower) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
if (subsection === null) {
|
|
345
|
+
return i < line.length && line[i] === "]";
|
|
346
|
+
}
|
|
347
|
+
while (i < line.length && (line[i] === " " || line[i] === "\t")) {
|
|
348
|
+
i++;
|
|
349
|
+
}
|
|
350
|
+
if (i >= line.length || line[i] !== '"') {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
i++;
|
|
354
|
+
let foundSubsection = "";
|
|
355
|
+
while (i < line.length && line[i] !== '"') {
|
|
356
|
+
if (line[i] === "\\" && i + 1 < line.length) {
|
|
357
|
+
const next = line[i + 1];
|
|
358
|
+
if (next === "\\" || next === '"') {
|
|
359
|
+
foundSubsection += next;
|
|
360
|
+
i += 2;
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
foundSubsection += next;
|
|
364
|
+
i += 2;
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
foundSubsection += line[i];
|
|
368
|
+
i++;
|
|
369
|
+
}
|
|
370
|
+
if (i >= line.length || line[i] !== '"') {
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
i++;
|
|
374
|
+
if (i >= line.length || line[i] !== "]") {
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
return foundSubsection === subsection;
|
|
378
|
+
}
|
|
379
|
+
function isKeyChar(ch) {
|
|
380
|
+
return ch >= "a" && ch <= "z" || ch >= "A" && ch <= "Z" || ch >= "0" && ch <= "9" || ch === "-";
|
|
381
|
+
}
|
|
382
|
+
var init_gitConfigParser = () => {};
|
|
383
|
+
|
|
384
|
+
// src/utils/git/gitFilesystem.ts
|
|
385
|
+
import { unwatchFile, watchFile } from "fs";
|
|
386
|
+
import { readdir, readFile as readFile2, stat } from "fs/promises";
|
|
387
|
+
import { join as join2, resolve } from "path";
|
|
388
|
+
function clearResolveGitDirCache() {
|
|
389
|
+
resolveGitDirCache.clear();
|
|
390
|
+
}
|
|
391
|
+
async function resolveGitDir(startPath) {
|
|
392
|
+
const cwd = resolve(startPath ?? getCwd());
|
|
393
|
+
const cached = resolveGitDirCache.get(cwd);
|
|
394
|
+
if (cached !== undefined) {
|
|
395
|
+
return cached;
|
|
396
|
+
}
|
|
397
|
+
const root = findGitRoot(cwd);
|
|
398
|
+
if (!root) {
|
|
399
|
+
resolveGitDirCache.set(cwd, null);
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
const gitPath = join2(root, ".git");
|
|
403
|
+
try {
|
|
404
|
+
const st = await stat(gitPath);
|
|
405
|
+
if (st.isFile()) {
|
|
406
|
+
const content = (await readFile2(gitPath, "utf-8")).trim();
|
|
407
|
+
if (content.startsWith("gitdir:")) {
|
|
408
|
+
const rawDir = content.slice("gitdir:".length).trim();
|
|
409
|
+
const resolved = resolve(root, rawDir);
|
|
410
|
+
resolveGitDirCache.set(cwd, resolved);
|
|
411
|
+
return resolved;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
resolveGitDirCache.set(cwd, gitPath);
|
|
415
|
+
return gitPath;
|
|
416
|
+
} catch {
|
|
417
|
+
resolveGitDirCache.set(cwd, null);
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
function isSafeRefName(name) {
|
|
422
|
+
if (!name || name.startsWith("-") || name.startsWith("/")) {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
if (name.includes("..")) {
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
if (name.split("/").some((c) => c === "." || c === "")) {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
if (!/^[a-zA-Z0-9/._+@-]+$/.test(name)) {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
return true;
|
|
435
|
+
}
|
|
436
|
+
function isValidGitSha(s) {
|
|
437
|
+
return /^[0-9a-f]{40}$/.test(s) || /^[0-9a-f]{64}$/.test(s);
|
|
438
|
+
}
|
|
439
|
+
async function readGitHead(gitDir) {
|
|
440
|
+
try {
|
|
441
|
+
const content = (await readFile2(join2(gitDir, "HEAD"), "utf-8")).trim();
|
|
442
|
+
if (content.startsWith("ref:")) {
|
|
443
|
+
const ref = content.slice("ref:".length).trim();
|
|
444
|
+
if (ref.startsWith("refs/heads/")) {
|
|
445
|
+
const name = ref.slice("refs/heads/".length);
|
|
446
|
+
if (!isSafeRefName(name)) {
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
return { type: "branch", name };
|
|
450
|
+
}
|
|
451
|
+
if (!isSafeRefName(ref)) {
|
|
452
|
+
return null;
|
|
453
|
+
}
|
|
454
|
+
const sha = await resolveRef(gitDir, ref);
|
|
455
|
+
return sha ? { type: "detached", sha } : { type: "detached", sha: "" };
|
|
456
|
+
}
|
|
457
|
+
if (!isValidGitSha(content)) {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
return { type: "detached", sha: content };
|
|
461
|
+
} catch {
|
|
462
|
+
return null;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
async function resolveRef(gitDir, ref) {
|
|
466
|
+
const result = await resolveRefInDir(gitDir, ref);
|
|
467
|
+
if (result) {
|
|
468
|
+
return result;
|
|
469
|
+
}
|
|
470
|
+
const commonDir = await getCommonDir(gitDir);
|
|
471
|
+
if (commonDir && commonDir !== gitDir) {
|
|
472
|
+
return resolveRefInDir(commonDir, ref);
|
|
473
|
+
}
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
async function resolveRefInDir(dir, ref) {
|
|
477
|
+
try {
|
|
478
|
+
const content = (await readFile2(join2(dir, ref), "utf-8")).trim();
|
|
479
|
+
if (content.startsWith("ref:")) {
|
|
480
|
+
const target = content.slice("ref:".length).trim();
|
|
481
|
+
if (!isSafeRefName(target)) {
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
return resolveRef(dir, target);
|
|
485
|
+
}
|
|
486
|
+
if (!isValidGitSha(content)) {
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
return content;
|
|
490
|
+
} catch {}
|
|
491
|
+
try {
|
|
492
|
+
const packed = await readFile2(join2(dir, "packed-refs"), "utf-8");
|
|
493
|
+
for (const line of packed.split(`
|
|
494
|
+
`)) {
|
|
495
|
+
if (line.startsWith("#") || line.startsWith("^")) {
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
const spaceIdx = line.indexOf(" ");
|
|
499
|
+
if (spaceIdx === -1) {
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
if (line.slice(spaceIdx + 1) === ref) {
|
|
503
|
+
const sha = line.slice(0, spaceIdx);
|
|
504
|
+
return isValidGitSha(sha) ? sha : null;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
} catch {}
|
|
508
|
+
return null;
|
|
509
|
+
}
|
|
510
|
+
async function getCommonDir(gitDir) {
|
|
511
|
+
try {
|
|
512
|
+
const content = (await readFile2(join2(gitDir, "commondir"), "utf-8")).trim();
|
|
513
|
+
return resolve(gitDir, content);
|
|
514
|
+
} catch {
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
async function readRawSymref(gitDir, refPath, branchPrefix) {
|
|
519
|
+
try {
|
|
520
|
+
const content = (await readFile2(join2(gitDir, refPath), "utf-8")).trim();
|
|
521
|
+
if (content.startsWith("ref:")) {
|
|
522
|
+
const target = content.slice("ref:".length).trim();
|
|
523
|
+
if (target.startsWith(branchPrefix)) {
|
|
524
|
+
const name = target.slice(branchPrefix.length);
|
|
525
|
+
if (!isSafeRefName(name)) {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
return name;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
} catch {}
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
class GitFileWatcher {
|
|
536
|
+
gitDir = null;
|
|
537
|
+
commonDir = null;
|
|
538
|
+
initialized = false;
|
|
539
|
+
initPromise = null;
|
|
540
|
+
watchedPaths = [];
|
|
541
|
+
branchRefPath = null;
|
|
542
|
+
cache = new Map;
|
|
543
|
+
async ensureStarted() {
|
|
544
|
+
if (this.initialized) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
if (this.initPromise) {
|
|
548
|
+
return this.initPromise;
|
|
549
|
+
}
|
|
550
|
+
this.initPromise = this.start();
|
|
551
|
+
return this.initPromise;
|
|
552
|
+
}
|
|
553
|
+
async start() {
|
|
554
|
+
this.gitDir = await resolveGitDir();
|
|
555
|
+
this.initialized = true;
|
|
556
|
+
if (!this.gitDir) {
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
this.commonDir = await getCommonDir(this.gitDir);
|
|
560
|
+
this.watchPath(join2(this.gitDir, "HEAD"), () => {
|
|
561
|
+
this.onHeadChanged();
|
|
562
|
+
});
|
|
563
|
+
this.watchPath(join2(this.commonDir ?? this.gitDir, "config"), () => {
|
|
564
|
+
this.invalidate();
|
|
565
|
+
});
|
|
566
|
+
await this.watchCurrentBranchRef();
|
|
567
|
+
registerCleanup(async () => {
|
|
568
|
+
this.stopWatching();
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
watchPath(path, callback) {
|
|
572
|
+
this.watchedPaths.push(path);
|
|
573
|
+
watchFile(path, { interval: WATCH_INTERVAL_MS }, callback);
|
|
574
|
+
}
|
|
575
|
+
async watchCurrentBranchRef() {
|
|
576
|
+
if (!this.gitDir) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
const head = await readGitHead(this.gitDir);
|
|
580
|
+
const refsDir = this.commonDir ?? this.gitDir;
|
|
581
|
+
const refPath = head?.type === "branch" ? join2(refsDir, "refs", "heads", head.name) : null;
|
|
582
|
+
if (refPath === this.branchRefPath) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
if (this.branchRefPath) {
|
|
586
|
+
unwatchFile(this.branchRefPath);
|
|
587
|
+
this.watchedPaths = this.watchedPaths.filter((p) => p !== this.branchRefPath);
|
|
588
|
+
}
|
|
589
|
+
this.branchRefPath = refPath;
|
|
590
|
+
if (!refPath) {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
this.watchPath(refPath, () => {
|
|
594
|
+
this.invalidate();
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
async onHeadChanged() {
|
|
598
|
+
this.invalidate();
|
|
599
|
+
await waitForScrollIdle();
|
|
600
|
+
await this.watchCurrentBranchRef();
|
|
601
|
+
}
|
|
602
|
+
invalidate() {
|
|
603
|
+
for (const entry of this.cache.values()) {
|
|
604
|
+
entry.dirty = true;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
stopWatching() {
|
|
608
|
+
for (const path of this.watchedPaths) {
|
|
609
|
+
unwatchFile(path);
|
|
610
|
+
}
|
|
611
|
+
this.watchedPaths = [];
|
|
612
|
+
this.branchRefPath = null;
|
|
613
|
+
}
|
|
614
|
+
async get(key, compute) {
|
|
615
|
+
await this.ensureStarted();
|
|
616
|
+
const existing = this.cache.get(key);
|
|
617
|
+
if (existing && !existing.dirty) {
|
|
618
|
+
return existing.value;
|
|
619
|
+
}
|
|
620
|
+
if (existing) {
|
|
621
|
+
existing.dirty = false;
|
|
622
|
+
}
|
|
623
|
+
const value = await compute();
|
|
624
|
+
const entry = this.cache.get(key);
|
|
625
|
+
if (entry && !entry.dirty) {
|
|
626
|
+
entry.value = value;
|
|
627
|
+
}
|
|
628
|
+
if (!entry) {
|
|
629
|
+
this.cache.set(key, { value, dirty: false, compute });
|
|
630
|
+
}
|
|
631
|
+
return value;
|
|
632
|
+
}
|
|
633
|
+
reset() {
|
|
634
|
+
this.stopWatching();
|
|
635
|
+
this.cache.clear();
|
|
636
|
+
this.initialized = false;
|
|
637
|
+
this.initPromise = null;
|
|
638
|
+
this.gitDir = null;
|
|
639
|
+
this.commonDir = null;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
async function computeBranch() {
|
|
643
|
+
const gitDir = await resolveGitDir();
|
|
644
|
+
if (!gitDir) {
|
|
645
|
+
return "HEAD";
|
|
646
|
+
}
|
|
647
|
+
const head = await readGitHead(gitDir);
|
|
648
|
+
if (!head) {
|
|
649
|
+
return "HEAD";
|
|
650
|
+
}
|
|
651
|
+
return head.type === "branch" ? head.name : "HEAD";
|
|
652
|
+
}
|
|
653
|
+
async function computeHead() {
|
|
654
|
+
const gitDir = await resolveGitDir();
|
|
655
|
+
if (!gitDir) {
|
|
656
|
+
return "";
|
|
657
|
+
}
|
|
658
|
+
const head = await readGitHead(gitDir);
|
|
659
|
+
if (!head) {
|
|
660
|
+
return "";
|
|
661
|
+
}
|
|
662
|
+
if (head.type === "branch") {
|
|
663
|
+
return await resolveRef(gitDir, `refs/heads/${head.name}`) ?? "";
|
|
664
|
+
}
|
|
665
|
+
return head.sha;
|
|
666
|
+
}
|
|
667
|
+
async function computeRemoteUrl() {
|
|
668
|
+
const gitDir = await resolveGitDir();
|
|
669
|
+
if (!gitDir) {
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
const url = await parseGitConfigValue(gitDir, "remote", "origin", "url");
|
|
673
|
+
if (url) {
|
|
674
|
+
return url;
|
|
675
|
+
}
|
|
676
|
+
const commonDir = await getCommonDir(gitDir);
|
|
677
|
+
if (commonDir && commonDir !== gitDir) {
|
|
678
|
+
return parseGitConfigValue(commonDir, "remote", "origin", "url");
|
|
679
|
+
}
|
|
680
|
+
return null;
|
|
681
|
+
}
|
|
682
|
+
async function computeDefaultBranch() {
|
|
683
|
+
const gitDir = await resolveGitDir();
|
|
684
|
+
if (!gitDir) {
|
|
685
|
+
return "main";
|
|
686
|
+
}
|
|
687
|
+
const commonDir = await getCommonDir(gitDir) ?? gitDir;
|
|
688
|
+
const branchFromSymref = await readRawSymref(commonDir, "refs/remotes/origin/HEAD", "refs/remotes/origin/");
|
|
689
|
+
if (branchFromSymref) {
|
|
690
|
+
return branchFromSymref;
|
|
691
|
+
}
|
|
692
|
+
for (const candidate of ["main", "master"]) {
|
|
693
|
+
const sha = await resolveRef(commonDir, `refs/remotes/origin/${candidate}`);
|
|
694
|
+
if (sha) {
|
|
695
|
+
return candidate;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return "main";
|
|
699
|
+
}
|
|
700
|
+
function getCachedBranch() {
|
|
701
|
+
return gitWatcher.get("branch", computeBranch);
|
|
702
|
+
}
|
|
703
|
+
function getCachedHead() {
|
|
704
|
+
return gitWatcher.get("head", computeHead);
|
|
705
|
+
}
|
|
706
|
+
function getCachedRemoteUrl() {
|
|
707
|
+
return gitWatcher.get("remoteUrl", computeRemoteUrl);
|
|
708
|
+
}
|
|
709
|
+
function getCachedDefaultBranch() {
|
|
710
|
+
return gitWatcher.get("defaultBranch", computeDefaultBranch);
|
|
711
|
+
}
|
|
712
|
+
async function getHeadForDir(cwd) {
|
|
713
|
+
const gitDir = await resolveGitDir(cwd);
|
|
714
|
+
if (!gitDir) {
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
const head = await readGitHead(gitDir);
|
|
718
|
+
if (!head) {
|
|
719
|
+
return null;
|
|
720
|
+
}
|
|
721
|
+
if (head.type === "branch") {
|
|
722
|
+
return resolveRef(gitDir, `refs/heads/${head.name}`);
|
|
723
|
+
}
|
|
724
|
+
return head.sha;
|
|
725
|
+
}
|
|
726
|
+
async function readWorktreeHeadSha(worktreePath) {
|
|
727
|
+
let gitDir;
|
|
728
|
+
try {
|
|
729
|
+
const ptr = (await readFile2(join2(worktreePath, ".git"), "utf-8")).trim();
|
|
730
|
+
if (!ptr.startsWith("gitdir:")) {
|
|
731
|
+
return null;
|
|
732
|
+
}
|
|
733
|
+
gitDir = resolve(worktreePath, ptr.slice("gitdir:".length).trim());
|
|
734
|
+
} catch {
|
|
735
|
+
return null;
|
|
736
|
+
}
|
|
737
|
+
const head = await readGitHead(gitDir);
|
|
738
|
+
if (!head) {
|
|
739
|
+
return null;
|
|
740
|
+
}
|
|
741
|
+
if (head.type === "branch") {
|
|
742
|
+
return resolveRef(gitDir, `refs/heads/${head.name}`);
|
|
743
|
+
}
|
|
744
|
+
return head.sha;
|
|
745
|
+
}
|
|
746
|
+
async function getRemoteUrlForDir(cwd) {
|
|
747
|
+
const gitDir = await resolveGitDir(cwd);
|
|
748
|
+
if (!gitDir) {
|
|
749
|
+
return null;
|
|
750
|
+
}
|
|
751
|
+
const url = await parseGitConfigValue(gitDir, "remote", "origin", "url");
|
|
752
|
+
if (url) {
|
|
753
|
+
return url;
|
|
754
|
+
}
|
|
755
|
+
const commonDir = await getCommonDir(gitDir);
|
|
756
|
+
if (commonDir && commonDir !== gitDir) {
|
|
757
|
+
return parseGitConfigValue(commonDir, "remote", "origin", "url");
|
|
758
|
+
}
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
async function isShallowClone() {
|
|
762
|
+
const gitDir = await resolveGitDir();
|
|
763
|
+
if (!gitDir) {
|
|
764
|
+
return false;
|
|
765
|
+
}
|
|
766
|
+
const commonDir = await getCommonDir(gitDir) ?? gitDir;
|
|
767
|
+
try {
|
|
768
|
+
await stat(join2(commonDir, "shallow"));
|
|
769
|
+
return true;
|
|
770
|
+
} catch {
|
|
771
|
+
return false;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
async function getWorktreeCountFromFs() {
|
|
775
|
+
try {
|
|
776
|
+
const gitDir = await resolveGitDir();
|
|
777
|
+
if (!gitDir) {
|
|
778
|
+
return 0;
|
|
779
|
+
}
|
|
780
|
+
const commonDir = await getCommonDir(gitDir) ?? gitDir;
|
|
781
|
+
const entries = await readdir(join2(commonDir, "worktrees"));
|
|
782
|
+
return entries.length + 1;
|
|
783
|
+
} catch {
|
|
784
|
+
return 1;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
var resolveGitDirCache, WATCH_INTERVAL_MS = 1000, gitWatcher;
|
|
788
|
+
var init_gitFilesystem = __esm(() => {
|
|
789
|
+
init_state();
|
|
790
|
+
init_cleanupRegistry();
|
|
791
|
+
init_cwd();
|
|
792
|
+
init_git();
|
|
793
|
+
init_gitConfigParser();
|
|
794
|
+
resolveGitDirCache = new Map;
|
|
795
|
+
gitWatcher = new GitFileWatcher;
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
// src/utils/git.ts
|
|
799
|
+
import { createHash } from "crypto";
|
|
800
|
+
import { readFileSync, realpathSync, statSync } from "fs";
|
|
801
|
+
import { open, readFile as readFile3, realpath, stat as stat2 } from "fs/promises";
|
|
802
|
+
import { basename, dirname as dirname2, join as join3, resolve as resolve2, sep } from "path";
|
|
803
|
+
function createFindGitRoot() {
|
|
804
|
+
function wrapper(startPath) {
|
|
805
|
+
const result = findGitRootImpl(startPath);
|
|
806
|
+
return result === GIT_ROOT_NOT_FOUND ? null : result;
|
|
807
|
+
}
|
|
808
|
+
wrapper.cache = findGitRootImpl.cache;
|
|
809
|
+
return wrapper;
|
|
810
|
+
}
|
|
811
|
+
function createFindCanonicalGitRoot() {
|
|
812
|
+
function wrapper(startPath) {
|
|
813
|
+
const root = findGitRoot(startPath);
|
|
814
|
+
if (!root) {
|
|
815
|
+
return null;
|
|
816
|
+
}
|
|
817
|
+
return resolveCanonicalRoot(root);
|
|
818
|
+
}
|
|
819
|
+
wrapper.cache = resolveCanonicalRoot.cache;
|
|
820
|
+
return wrapper;
|
|
821
|
+
}
|
|
822
|
+
function getGitDir(cwd) {
|
|
823
|
+
return resolveGitDir(cwd);
|
|
824
|
+
}
|
|
825
|
+
async function isAtGitRoot() {
|
|
826
|
+
const cwd = getCwd();
|
|
827
|
+
const gitRoot = findGitRoot(cwd);
|
|
828
|
+
if (!gitRoot) {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
try {
|
|
832
|
+
const [resolvedCwd, resolvedGitRoot] = await Promise.all([
|
|
833
|
+
realpath(cwd),
|
|
834
|
+
realpath(gitRoot)
|
|
835
|
+
]);
|
|
836
|
+
return resolvedCwd === resolvedGitRoot;
|
|
837
|
+
} catch {
|
|
838
|
+
return cwd === gitRoot;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
function normalizeGitRemoteUrl(url) {
|
|
842
|
+
const trimmed = url.trim();
|
|
843
|
+
if (!trimmed)
|
|
844
|
+
return null;
|
|
845
|
+
const sshMatch = trimmed.match(/^git@([^:]+):(.+?)(?:\.git)?$/);
|
|
846
|
+
if (sshMatch && sshMatch[1] && sshMatch[2]) {
|
|
847
|
+
return `${sshMatch[1]}/${sshMatch[2]}`.toLowerCase();
|
|
848
|
+
}
|
|
849
|
+
const urlMatch = trimmed.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);
|
|
850
|
+
if (urlMatch && urlMatch[1] && urlMatch[2]) {
|
|
851
|
+
const host = urlMatch[1];
|
|
852
|
+
const path = urlMatch[2];
|
|
853
|
+
if (isLocalHost(host) && path.startsWith("git/")) {
|
|
854
|
+
const proxyPath = path.slice(4);
|
|
855
|
+
const segments = proxyPath.split("/");
|
|
856
|
+
if (segments.length >= 3 && segments[0].includes(".")) {
|
|
857
|
+
return proxyPath.toLowerCase();
|
|
858
|
+
}
|
|
859
|
+
return `github.com/${proxyPath}`.toLowerCase();
|
|
860
|
+
}
|
|
861
|
+
return `${host}/${path}`.toLowerCase();
|
|
862
|
+
}
|
|
863
|
+
return null;
|
|
864
|
+
}
|
|
865
|
+
async function getRepoRemoteHash() {
|
|
866
|
+
const remoteUrl = await getRemoteUrl();
|
|
867
|
+
if (!remoteUrl)
|
|
868
|
+
return null;
|
|
869
|
+
const normalized = normalizeGitRemoteUrl(remoteUrl);
|
|
870
|
+
if (!normalized)
|
|
871
|
+
return null;
|
|
872
|
+
const hash = createHash("sha256").update(normalized).digest("hex");
|
|
873
|
+
return hash.substring(0, 16);
|
|
874
|
+
}
|
|
875
|
+
async function getGitState() {
|
|
876
|
+
try {
|
|
877
|
+
const [
|
|
878
|
+
commitHash,
|
|
879
|
+
branchName,
|
|
880
|
+
remoteUrl,
|
|
881
|
+
isHeadOnRemote,
|
|
882
|
+
isClean,
|
|
883
|
+
worktreeCount
|
|
884
|
+
] = await Promise.all([
|
|
885
|
+
getHead(),
|
|
886
|
+
getBranch(),
|
|
887
|
+
getRemoteUrl(),
|
|
888
|
+
getIsHeadOnRemote(),
|
|
889
|
+
getIsClean(),
|
|
890
|
+
getWorktreeCount()
|
|
891
|
+
]);
|
|
892
|
+
return {
|
|
893
|
+
commitHash,
|
|
894
|
+
branchName,
|
|
895
|
+
remoteUrl,
|
|
896
|
+
isHeadOnRemote,
|
|
897
|
+
isClean,
|
|
898
|
+
worktreeCount
|
|
899
|
+
};
|
|
900
|
+
} catch (_) {
|
|
901
|
+
return null;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
async function getGithubRepo() {
|
|
905
|
+
const { parseGitRemote } = await import("./chunk-q6av622g.js");
|
|
906
|
+
const remoteUrl = await getRemoteUrl();
|
|
907
|
+
if (!remoteUrl) {
|
|
908
|
+
logForDebugging("Local GitHub repo: unknown");
|
|
909
|
+
return null;
|
|
910
|
+
}
|
|
911
|
+
const parsed = parseGitRemote(remoteUrl);
|
|
912
|
+
if (parsed && parsed.host === "github.com") {
|
|
913
|
+
const result = `${parsed.owner}/${parsed.name}`;
|
|
914
|
+
logForDebugging(`Local GitHub repo: ${result}`);
|
|
915
|
+
return result;
|
|
916
|
+
}
|
|
917
|
+
logForDebugging("Local GitHub repo: unknown");
|
|
918
|
+
return null;
|
|
919
|
+
}
|
|
920
|
+
async function findRemoteBase() {
|
|
921
|
+
const { stdout: trackingBranch, code: trackingCode } = await execFileNoThrow(gitExe(), ["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"], { preserveOutputOnError: false });
|
|
922
|
+
if (trackingCode === 0 && trackingBranch.trim()) {
|
|
923
|
+
return trackingBranch.trim();
|
|
924
|
+
}
|
|
925
|
+
const { stdout: remoteRefs, code: remoteCode } = await execFileNoThrow(gitExe(), ["remote", "show", "origin", "--", "HEAD"], { preserveOutputOnError: false });
|
|
926
|
+
if (remoteCode === 0) {
|
|
927
|
+
const match = remoteRefs.match(/HEAD branch: (\S+)/);
|
|
928
|
+
if (match && match[1]) {
|
|
929
|
+
return `origin/${match[1]}`;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
const candidates = ["origin/main", "origin/staging", "origin/master"];
|
|
933
|
+
for (const candidate of candidates) {
|
|
934
|
+
const { code } = await execFileNoThrow(gitExe(), ["rev-parse", "--verify", candidate], { preserveOutputOnError: false });
|
|
935
|
+
if (code === 0) {
|
|
936
|
+
return candidate;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
return null;
|
|
940
|
+
}
|
|
941
|
+
function isShallowClone2() {
|
|
942
|
+
return isShallowClone();
|
|
943
|
+
}
|
|
944
|
+
async function captureUntrackedFiles() {
|
|
945
|
+
const { stdout, code } = await execFileNoThrow(gitExe(), ["ls-files", "--others", "--exclude-standard"], { preserveOutputOnError: false });
|
|
946
|
+
const trimmed = stdout.trim();
|
|
947
|
+
if (code !== 0 || !trimmed) {
|
|
948
|
+
return [];
|
|
949
|
+
}
|
|
950
|
+
const files = trimmed.split(`
|
|
951
|
+
`).filter(Boolean);
|
|
952
|
+
const result = [];
|
|
953
|
+
let totalSize = 0;
|
|
954
|
+
for (const filePath of files) {
|
|
955
|
+
if (result.length >= MAX_FILE_COUNT) {
|
|
956
|
+
logForDebugging(`Untracked file capture: reached max file count (${MAX_FILE_COUNT})`);
|
|
957
|
+
break;
|
|
958
|
+
}
|
|
959
|
+
if (hasBinaryExtension(filePath)) {
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
try {
|
|
963
|
+
const stats = await stat2(filePath);
|
|
964
|
+
const fileSize = stats.size;
|
|
965
|
+
if (fileSize > MAX_FILE_SIZE_BYTES) {
|
|
966
|
+
logForDebugging(`Untracked file capture: skipping ${filePath} (exceeds ${MAX_FILE_SIZE_BYTES} bytes)`);
|
|
967
|
+
continue;
|
|
968
|
+
}
|
|
969
|
+
if (totalSize + fileSize > MAX_TOTAL_SIZE_BYTES) {
|
|
970
|
+
logForDebugging(`Untracked file capture: reached total size limit (${MAX_TOTAL_SIZE_BYTES} bytes)`);
|
|
971
|
+
break;
|
|
972
|
+
}
|
|
973
|
+
if (fileSize === 0) {
|
|
974
|
+
result.push({ path: filePath, content: "" });
|
|
975
|
+
continue;
|
|
976
|
+
}
|
|
977
|
+
const sniffSize = Math.min(SNIFF_BUFFER_SIZE, fileSize);
|
|
978
|
+
const fd = await open(filePath, "r");
|
|
979
|
+
try {
|
|
980
|
+
const sniffBuf = Buffer.alloc(sniffSize);
|
|
981
|
+
const { bytesRead } = await fd.read(sniffBuf, 0, sniffSize, 0);
|
|
982
|
+
const sniff = sniffBuf.subarray(0, bytesRead);
|
|
983
|
+
if (isBinaryContent(sniff)) {
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
let content;
|
|
987
|
+
if (fileSize <= sniffSize) {
|
|
988
|
+
content = sniff.toString("utf-8");
|
|
989
|
+
} else {
|
|
990
|
+
content = await readFile3(filePath, "utf-8");
|
|
991
|
+
}
|
|
992
|
+
result.push({ path: filePath, content });
|
|
993
|
+
totalSize += fileSize;
|
|
994
|
+
} finally {
|
|
995
|
+
await fd.close();
|
|
996
|
+
}
|
|
997
|
+
} catch (err) {
|
|
998
|
+
logForDebugging(`Failed to read untracked file ${filePath}: ${err}`);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
return result;
|
|
1002
|
+
}
|
|
1003
|
+
async function preserveGitStateForIssue() {
|
|
1004
|
+
try {
|
|
1005
|
+
const isGit = await getIsGit();
|
|
1006
|
+
if (!isGit) {
|
|
1007
|
+
return null;
|
|
1008
|
+
}
|
|
1009
|
+
if (await isShallowClone2()) {
|
|
1010
|
+
logForDebugging("Shallow clone detected, using HEAD-only mode for issue");
|
|
1011
|
+
const [{ stdout: patch2 }, untrackedFiles2] = await Promise.all([
|
|
1012
|
+
execFileNoThrow(gitExe(), ["diff", "HEAD"]),
|
|
1013
|
+
captureUntrackedFiles()
|
|
1014
|
+
]);
|
|
1015
|
+
return {
|
|
1016
|
+
remote_base_sha: null,
|
|
1017
|
+
remote_base: null,
|
|
1018
|
+
patch: patch2 || "",
|
|
1019
|
+
untracked_files: untrackedFiles2,
|
|
1020
|
+
format_patch: null,
|
|
1021
|
+
head_sha: null,
|
|
1022
|
+
branch_name: null
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
const remoteBase = await findRemoteBase();
|
|
1026
|
+
if (!remoteBase) {
|
|
1027
|
+
logForDebugging("No remote found, using HEAD-only mode for issue");
|
|
1028
|
+
const [{ stdout: patch2 }, untrackedFiles2] = await Promise.all([
|
|
1029
|
+
execFileNoThrow(gitExe(), ["diff", "HEAD"]),
|
|
1030
|
+
captureUntrackedFiles()
|
|
1031
|
+
]);
|
|
1032
|
+
return {
|
|
1033
|
+
remote_base_sha: null,
|
|
1034
|
+
remote_base: null,
|
|
1035
|
+
patch: patch2 || "",
|
|
1036
|
+
untracked_files: untrackedFiles2,
|
|
1037
|
+
format_patch: null,
|
|
1038
|
+
head_sha: null,
|
|
1039
|
+
branch_name: null
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
const { stdout: mergeBase, code: mergeBaseCode } = await execFileNoThrow(gitExe(), ["merge-base", "HEAD", remoteBase], { preserveOutputOnError: false });
|
|
1043
|
+
if (mergeBaseCode !== 0 || !mergeBase.trim()) {
|
|
1044
|
+
logForDebugging("Merge-base failed, using HEAD-only mode for issue");
|
|
1045
|
+
const [{ stdout: patch2 }, untrackedFiles2] = await Promise.all([
|
|
1046
|
+
execFileNoThrow(gitExe(), ["diff", "HEAD"]),
|
|
1047
|
+
captureUntrackedFiles()
|
|
1048
|
+
]);
|
|
1049
|
+
return {
|
|
1050
|
+
remote_base_sha: null,
|
|
1051
|
+
remote_base: null,
|
|
1052
|
+
patch: patch2 || "",
|
|
1053
|
+
untracked_files: untrackedFiles2,
|
|
1054
|
+
format_patch: null,
|
|
1055
|
+
head_sha: null,
|
|
1056
|
+
branch_name: null
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
const remoteBaseSha = mergeBase.trim();
|
|
1060
|
+
const [
|
|
1061
|
+
{ stdout: patch },
|
|
1062
|
+
untrackedFiles,
|
|
1063
|
+
{ stdout: formatPatchOut, code: formatPatchCode },
|
|
1064
|
+
{ stdout: headSha },
|
|
1065
|
+
{ stdout: branchName }
|
|
1066
|
+
] = await Promise.all([
|
|
1067
|
+
execFileNoThrow(gitExe(), ["diff", remoteBaseSha]),
|
|
1068
|
+
captureUntrackedFiles(),
|
|
1069
|
+
execFileNoThrow(gitExe(), [
|
|
1070
|
+
"format-patch",
|
|
1071
|
+
`${remoteBaseSha}..HEAD`,
|
|
1072
|
+
"--stdout"
|
|
1073
|
+
]),
|
|
1074
|
+
execFileNoThrow(gitExe(), ["rev-parse", "HEAD"]),
|
|
1075
|
+
execFileNoThrow(gitExe(), ["rev-parse", "--abbrev-ref", "HEAD"])
|
|
1076
|
+
]);
|
|
1077
|
+
let formatPatch = null;
|
|
1078
|
+
if (formatPatchCode === 0 && formatPatchOut && formatPatchOut.trim()) {
|
|
1079
|
+
formatPatch = formatPatchOut;
|
|
1080
|
+
}
|
|
1081
|
+
const trimmedBranch = branchName?.trim();
|
|
1082
|
+
return {
|
|
1083
|
+
remote_base_sha: remoteBaseSha,
|
|
1084
|
+
remote_base: remoteBase,
|
|
1085
|
+
patch: patch || "",
|
|
1086
|
+
untracked_files: untrackedFiles,
|
|
1087
|
+
format_patch: formatPatch,
|
|
1088
|
+
head_sha: headSha?.trim() || null,
|
|
1089
|
+
branch_name: trimmedBranch && trimmedBranch !== "HEAD" ? trimmedBranch : null
|
|
1090
|
+
};
|
|
1091
|
+
} catch (err) {
|
|
1092
|
+
logError(err);
|
|
1093
|
+
return null;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
function isLocalHost(host) {
|
|
1097
|
+
const hostWithoutPort = host.split(":")[0] ?? "";
|
|
1098
|
+
return hostWithoutPort === "localhost" || /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(hostWithoutPort);
|
|
1099
|
+
}
|
|
1100
|
+
function isCurrentDirectoryBareGitRepo() {
|
|
1101
|
+
const fs = getFsImplementation();
|
|
1102
|
+
const cwd = getCwd();
|
|
1103
|
+
const gitPath = join3(cwd, ".git");
|
|
1104
|
+
try {
|
|
1105
|
+
const stats = fs.statSync(gitPath);
|
|
1106
|
+
if (stats.isFile()) {
|
|
1107
|
+
return false;
|
|
1108
|
+
}
|
|
1109
|
+
if (stats.isDirectory()) {
|
|
1110
|
+
const gitHeadPath = join3(gitPath, "HEAD");
|
|
1111
|
+
try {
|
|
1112
|
+
if (fs.statSync(gitHeadPath).isFile()) {
|
|
1113
|
+
return false;
|
|
1114
|
+
}
|
|
1115
|
+
} catch {}
|
|
1116
|
+
}
|
|
1117
|
+
} catch {}
|
|
1118
|
+
try {
|
|
1119
|
+
if (fs.statSync(join3(cwd, "HEAD")).isFile())
|
|
1120
|
+
return true;
|
|
1121
|
+
} catch {}
|
|
1122
|
+
try {
|
|
1123
|
+
if (fs.statSync(join3(cwd, "objects")).isDirectory())
|
|
1124
|
+
return true;
|
|
1125
|
+
} catch {}
|
|
1126
|
+
try {
|
|
1127
|
+
if (fs.statSync(join3(cwd, "refs")).isDirectory())
|
|
1128
|
+
return true;
|
|
1129
|
+
} catch {}
|
|
1130
|
+
return false;
|
|
1131
|
+
}
|
|
1132
|
+
var GIT_ROOT_NOT_FOUND, findGitRootImpl, findGitRoot, resolveCanonicalRoot, findCanonicalGitRoot, gitExe, getIsGit, dirIsInGitRepo = async (cwd) => {
|
|
1133
|
+
return findGitRoot(cwd) !== null;
|
|
1134
|
+
}, getHead = async () => {
|
|
1135
|
+
return getCachedHead();
|
|
1136
|
+
}, getBranch = async () => {
|
|
1137
|
+
return getCachedBranch();
|
|
1138
|
+
}, getDefaultBranch = async () => {
|
|
1139
|
+
return getCachedDefaultBranch();
|
|
1140
|
+
}, getRemoteUrl = async () => {
|
|
1141
|
+
return getCachedRemoteUrl();
|
|
1142
|
+
}, getIsHeadOnRemote = async () => {
|
|
1143
|
+
const { code } = await execFileNoThrow(gitExe(), ["rev-parse", "@{u}"], {
|
|
1144
|
+
preserveOutputOnError: false
|
|
1145
|
+
});
|
|
1146
|
+
return code === 0;
|
|
1147
|
+
}, hasUnpushedCommits = async () => {
|
|
1148
|
+
const { stdout, code } = await execFileNoThrow(gitExe(), ["rev-list", "--count", "@{u}..HEAD"], { preserveOutputOnError: false });
|
|
1149
|
+
return code === 0 && parseInt(stdout.trim(), 10) > 0;
|
|
1150
|
+
}, getIsClean = async (options) => {
|
|
1151
|
+
const args = ["--no-optional-locks", "status", "--porcelain"];
|
|
1152
|
+
if (options?.ignoreUntracked) {
|
|
1153
|
+
args.push("-uno");
|
|
1154
|
+
}
|
|
1155
|
+
const { stdout } = await execFileNoThrow(gitExe(), args, {
|
|
1156
|
+
preserveOutputOnError: false
|
|
1157
|
+
});
|
|
1158
|
+
return stdout.trim().length === 0;
|
|
1159
|
+
}, getChangedFiles = async () => {
|
|
1160
|
+
const { stdout } = await execFileNoThrow(gitExe(), ["--no-optional-locks", "status", "--porcelain"], {
|
|
1161
|
+
preserveOutputOnError: false
|
|
1162
|
+
});
|
|
1163
|
+
return stdout.trim().split(`
|
|
1164
|
+
`).map((line) => line.trim().split(" ", 2)[1]?.trim()).filter((line) => typeof line === "string");
|
|
1165
|
+
}, getFileStatus = async () => {
|
|
1166
|
+
const { stdout } = await execFileNoThrow(gitExe(), ["--no-optional-locks", "status", "--porcelain"], {
|
|
1167
|
+
preserveOutputOnError: false
|
|
1168
|
+
});
|
|
1169
|
+
const tracked = [];
|
|
1170
|
+
const untracked = [];
|
|
1171
|
+
stdout.trim().split(`
|
|
1172
|
+
`).filter((line) => line.length > 0).forEach((line) => {
|
|
1173
|
+
const status = line.substring(0, 2);
|
|
1174
|
+
const filename = line.substring(2).trim();
|
|
1175
|
+
if (status === "??") {
|
|
1176
|
+
untracked.push(filename);
|
|
1177
|
+
} else if (filename) {
|
|
1178
|
+
tracked.push(filename);
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
return { tracked, untracked };
|
|
1182
|
+
}, getWorktreeCount = async () => {
|
|
1183
|
+
return getWorktreeCountFromFs();
|
|
1184
|
+
}, stashToCleanState = async (message) => {
|
|
1185
|
+
try {
|
|
1186
|
+
const stashMessage = message || `Claude Code auto-stash - ${new Date().toISOString()}`;
|
|
1187
|
+
const { untracked } = await getFileStatus();
|
|
1188
|
+
if (untracked.length > 0) {
|
|
1189
|
+
const { code: addCode } = await execFileNoThrow(gitExe(), ["add", ...untracked], { preserveOutputOnError: false });
|
|
1190
|
+
if (addCode !== 0) {
|
|
1191
|
+
return false;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
const { code } = await execFileNoThrow(gitExe(), ["stash", "push", "--message", stashMessage], { preserveOutputOnError: false });
|
|
1195
|
+
return code === 0;
|
|
1196
|
+
} catch (_) {
|
|
1197
|
+
return false;
|
|
1198
|
+
}
|
|
1199
|
+
}, MAX_FILE_SIZE_BYTES = 524288000, MAX_TOTAL_SIZE_BYTES = 5368709120, MAX_FILE_COUNT = 20000, SNIFF_BUFFER_SIZE = 65536;
|
|
1200
|
+
var init_git = __esm(() => {
|
|
1201
|
+
init_memoize();
|
|
1202
|
+
init_files();
|
|
1203
|
+
init_cwd();
|
|
1204
|
+
init_debug();
|
|
1205
|
+
init_diagLogs();
|
|
1206
|
+
init_execFileNoThrow();
|
|
1207
|
+
init_fsOperations();
|
|
1208
|
+
init_gitFilesystem();
|
|
1209
|
+
init_log();
|
|
1210
|
+
init_memoize2();
|
|
1211
|
+
init_which();
|
|
1212
|
+
GIT_ROOT_NOT_FOUND = Symbol("git-root-not-found");
|
|
1213
|
+
findGitRootImpl = memoizeWithLRU((startPath) => {
|
|
1214
|
+
const startTime = Date.now();
|
|
1215
|
+
logForDiagnosticsNoPII("info", "find_git_root_started");
|
|
1216
|
+
let current = resolve2(startPath);
|
|
1217
|
+
const root = current.substring(0, current.indexOf(sep) + 1) || sep;
|
|
1218
|
+
let statCount = 0;
|
|
1219
|
+
while (current !== root) {
|
|
1220
|
+
try {
|
|
1221
|
+
const gitPath = join3(current, ".git");
|
|
1222
|
+
statCount++;
|
|
1223
|
+
const stat3 = statSync(gitPath);
|
|
1224
|
+
if (stat3.isDirectory() || stat3.isFile()) {
|
|
1225
|
+
logForDiagnosticsNoPII("info", "find_git_root_completed", {
|
|
1226
|
+
duration_ms: Date.now() - startTime,
|
|
1227
|
+
stat_count: statCount,
|
|
1228
|
+
found: true
|
|
1229
|
+
});
|
|
1230
|
+
return current.normalize("NFC");
|
|
1231
|
+
}
|
|
1232
|
+
} catch {}
|
|
1233
|
+
const parent = dirname2(current);
|
|
1234
|
+
if (parent === current) {
|
|
1235
|
+
break;
|
|
1236
|
+
}
|
|
1237
|
+
current = parent;
|
|
1238
|
+
}
|
|
1239
|
+
try {
|
|
1240
|
+
const gitPath = join3(root, ".git");
|
|
1241
|
+
statCount++;
|
|
1242
|
+
const stat3 = statSync(gitPath);
|
|
1243
|
+
if (stat3.isDirectory() || stat3.isFile()) {
|
|
1244
|
+
logForDiagnosticsNoPII("info", "find_git_root_completed", {
|
|
1245
|
+
duration_ms: Date.now() - startTime,
|
|
1246
|
+
stat_count: statCount,
|
|
1247
|
+
found: true
|
|
1248
|
+
});
|
|
1249
|
+
return root.normalize("NFC");
|
|
1250
|
+
}
|
|
1251
|
+
} catch {}
|
|
1252
|
+
logForDiagnosticsNoPII("info", "find_git_root_completed", {
|
|
1253
|
+
duration_ms: Date.now() - startTime,
|
|
1254
|
+
stat_count: statCount,
|
|
1255
|
+
found: false
|
|
1256
|
+
});
|
|
1257
|
+
return GIT_ROOT_NOT_FOUND;
|
|
1258
|
+
}, (path) => path, 50);
|
|
1259
|
+
findGitRoot = createFindGitRoot();
|
|
1260
|
+
resolveCanonicalRoot = memoizeWithLRU((gitRoot) => {
|
|
1261
|
+
try {
|
|
1262
|
+
const gitContent = readFileSync(join3(gitRoot, ".git"), "utf-8").trim();
|
|
1263
|
+
if (!gitContent.startsWith("gitdir:")) {
|
|
1264
|
+
return gitRoot;
|
|
1265
|
+
}
|
|
1266
|
+
const worktreeGitDir = resolve2(gitRoot, gitContent.slice("gitdir:".length).trim());
|
|
1267
|
+
const commonDir = resolve2(worktreeGitDir, readFileSync(join3(worktreeGitDir, "commondir"), "utf-8").trim());
|
|
1268
|
+
if (resolve2(dirname2(worktreeGitDir)) !== join3(commonDir, "worktrees")) {
|
|
1269
|
+
return gitRoot;
|
|
1270
|
+
}
|
|
1271
|
+
const backlink = realpathSync(readFileSync(join3(worktreeGitDir, "gitdir"), "utf-8").trim());
|
|
1272
|
+
if (backlink !== join3(realpathSync(gitRoot), ".git")) {
|
|
1273
|
+
return gitRoot;
|
|
1274
|
+
}
|
|
1275
|
+
if (basename(commonDir) !== ".git") {
|
|
1276
|
+
return commonDir.normalize("NFC");
|
|
1277
|
+
}
|
|
1278
|
+
return dirname2(commonDir).normalize("NFC");
|
|
1279
|
+
} catch {
|
|
1280
|
+
return gitRoot;
|
|
1281
|
+
}
|
|
1282
|
+
}, (root) => root, 50);
|
|
1283
|
+
findCanonicalGitRoot = createFindCanonicalGitRoot();
|
|
1284
|
+
gitExe = memoize_default(() => {
|
|
1285
|
+
return whichSync("git") || "git";
|
|
1286
|
+
});
|
|
1287
|
+
getIsGit = memoize_default(async () => {
|
|
1288
|
+
const startTime = Date.now();
|
|
1289
|
+
logForDiagnosticsNoPII("info", "is_git_check_started");
|
|
1290
|
+
const isGit = findGitRoot(getCwd()) !== null;
|
|
1291
|
+
logForDiagnosticsNoPII("info", "is_git_check_completed", {
|
|
1292
|
+
duration_ms: Date.now() - startTime,
|
|
1293
|
+
is_git: isGit
|
|
1294
|
+
});
|
|
1295
|
+
return isGit;
|
|
1296
|
+
});
|
|
1297
|
+
});
|
|
1298
|
+
|
|
1299
|
+
export { logForDiagnosticsNoPII, withDiagnosticsTiming, init_diagLogs, hasBinaryExtension, init_files, parseGitConfigValue, init_gitConfigParser, clearResolveGitDirCache, resolveGitDir, resolveRef, getCommonDir, getHeadForDir, readWorktreeHeadSha, getRemoteUrlForDir, init_gitFilesystem, findGitRoot, findCanonicalGitRoot, gitExe, getIsGit, getGitDir, isAtGitRoot, dirIsInGitRepo, getHead, getBranch, getDefaultBranch, getRemoteUrl, normalizeGitRemoteUrl, getRepoRemoteHash, getIsHeadOnRemote, hasUnpushedCommits, getIsClean, getChangedFiles, getFileStatus, getWorktreeCount, stashToCleanState, getGitState, getGithubRepo, findRemoteBase, preserveGitStateForIssue, isCurrentDirectoryBareGitRepo, init_git };
|