gong-code 0.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 +38 -0
- package/dist/SKILL-22jccbka.md +1 -0
- package/dist/chunk-01wdn84e.js +8 -0
- package/dist/chunk-04bc74vz.js +243 -0
- package/dist/chunk-05t2vqsb.js +490 -0
- package/dist/chunk-0727wret.js +159 -0
- package/dist/chunk-07rervty.js +200 -0
- package/dist/chunk-0b9nxvyg.js +478 -0
- package/dist/chunk-0e428b73.js +600 -0
- package/dist/chunk-0hqfheht.js +3439 -0
- package/dist/chunk-0pnk52c2.js +116 -0
- package/dist/chunk-0sbddf6m.js +68 -0
- package/dist/chunk-0vf7xb84.js +176 -0
- package/dist/chunk-0yz17yjy.js +1061 -0
- package/dist/chunk-0zscb6c7.js +10 -0
- package/dist/chunk-10p21kq6.js +378 -0
- package/dist/chunk-17k78pmz.js +120 -0
- package/dist/chunk-19jvvqzp.js +1390 -0
- package/dist/chunk-1d5czqnr.js +173 -0
- package/dist/chunk-1gjysfnf.js +13876 -0
- package/dist/chunk-1jjfv0wd.js +467 -0
- package/dist/chunk-1jjzp2pa.js +617 -0
- package/dist/chunk-1m38dj2k.js +155 -0
- package/dist/chunk-1pgttway.js +211 -0
- package/dist/chunk-1vvnx0gb.js +8035 -0
- package/dist/chunk-1ztm9yps.js +49145 -0
- package/dist/chunk-208x1t0m.js +88 -0
- package/dist/chunk-20xqs3yk.js +843 -0
- package/dist/chunk-2b2c0wnn.js +584 -0
- package/dist/chunk-2g07117j.js +541 -0
- package/dist/chunk-2g6p2t3w.js +780 -0
- package/dist/chunk-2kjeaeg7.js +28 -0
- package/dist/chunk-2n0s2dhc.js +12 -0
- package/dist/chunk-2p0hvt8k.js +785 -0
- package/dist/chunk-2qmxg9y7.js +40174 -0
- package/dist/chunk-2qpy8kne.js +28 -0
- package/dist/chunk-2rgbf62a.js +40 -0
- package/dist/chunk-2tx0s41y.js +150 -0
- package/dist/chunk-2x8zk5cz.js +101 -0
- package/dist/chunk-2yqy25z4.js +48 -0
- package/dist/chunk-318g78ty.js +552 -0
- package/dist/chunk-31gfg8tz.js +290 -0
- package/dist/chunk-32n0s532.js +1317 -0
- package/dist/chunk-35dw2r9g.js +137 -0
- package/dist/chunk-36b5zqvn.js +1865 -0
- package/dist/chunk-38kpx69j.js +97 -0
- package/dist/chunk-3b01vp8p.js +815 -0
- package/dist/chunk-3f76a1ek.js +317 -0
- package/dist/chunk-3fd1hkhh.js +4254 -0
- package/dist/chunk-3ffxa7zj.js +8 -0
- package/dist/chunk-3gcj7w95.js +8 -0
- package/dist/chunk-3jf3k40v.js +970 -0
- package/dist/chunk-3k51qfp9.js +9301 -0
- package/dist/chunk-3mhygd2v.js +1180 -0
- package/dist/chunk-3p6y0gvb.js +117 -0
- package/dist/chunk-3r60xdt5.js +93 -0
- package/dist/chunk-43agf6xv.js +8 -0
- package/dist/chunk-46zr418r.js +15 -0
- package/dist/chunk-48k2bs4w.js +118 -0
- package/dist/chunk-4p987a4z.js +84 -0
- package/dist/chunk-4px25pe0.js +776 -0
- package/dist/chunk-4s93jyky.js +113 -0
- package/dist/chunk-4xv8bedf.js +58 -0
- package/dist/chunk-4y382mzd.js +346 -0
- package/dist/chunk-52dzw4bc.js +246 -0
- package/dist/chunk-52qqmh5g.js +110 -0
- package/dist/chunk-53grnhp7.js +8 -0
- package/dist/chunk-59craaxx.js +4249 -0
- package/dist/chunk-5b833jqs.js +96 -0
- package/dist/chunk-5cp2q9sh.js +58 -0
- package/dist/chunk-5dbaxmts.js +87 -0
- package/dist/chunk-5f5sxgp0.js +96 -0
- package/dist/chunk-5mkfderj.js +195 -0
- package/dist/chunk-5qw0mpvq.js +389 -0
- package/dist/chunk-5rxmszm8.js +48 -0
- package/dist/chunk-5ygxa3hr.js +65 -0
- package/dist/chunk-61d5dqq2.js +71 -0
- package/dist/chunk-6350958y.js +272 -0
- package/dist/chunk-65z8hg8j.js +1337 -0
- package/dist/chunk-6aq85gdq.js +8 -0
- package/dist/chunk-6cjh9exg.js +40751 -0
- package/dist/chunk-6e41p5m6.js +187 -0
- package/dist/chunk-6jb6xcnq.js +10511 -0
- package/dist/chunk-6jta29r1.js +20 -0
- package/dist/chunk-6q7f2rrv.js +4757 -0
- package/dist/chunk-6sg0ec6v.js +41 -0
- package/dist/chunk-6v0rhx4e.js +328 -0
- package/dist/chunk-6x5mz95v.js +751 -0
- package/dist/chunk-6xqp51qr.js +87 -0
- package/dist/chunk-6xvyx1s9.js +6957 -0
- package/dist/chunk-6ywh7wgp.js +468 -0
- package/dist/chunk-75ne77gm.js +1920 -0
- package/dist/chunk-77cb06js.js +602 -0
- package/dist/chunk-78n9kfp8.js +1645 -0
- package/dist/chunk-7be87rww.js +277 -0
- package/dist/chunk-7e1qjk3s.js +125 -0
- package/dist/chunk-7e7nxnss.js +360 -0
- package/dist/chunk-7g8156qp.js +55 -0
- package/dist/chunk-7nz71s42.js +3353 -0
- package/dist/chunk-7r078t2x.js +113 -0
- package/dist/chunk-7shx41hj.js +3094 -0
- package/dist/chunk-7yexhdjs.js +216 -0
- package/dist/chunk-83kmfcjv.js +256 -0
- package/dist/chunk-846rr9n1.js +107 -0
- package/dist/chunk-84ncsm1r.js +183 -0
- package/dist/chunk-867x8aq0.js +8936 -0
- package/dist/chunk-8byh30kb.js +1947 -0
- package/dist/chunk-8c8f6gnt.js +432 -0
- package/dist/chunk-8gtdseev.js +454 -0
- package/dist/chunk-8jfh9rq6.js +642 -0
- package/dist/chunk-8n4n4m67.js +800 -0
- package/dist/chunk-8za61tze.js +847 -0
- package/dist/chunk-9029sbq1.js +57 -0
- package/dist/chunk-94dm5rrm.js +673 -0
- package/dist/chunk-9bs8n985.js +329 -0
- package/dist/chunk-9c23776j.js +763 -0
- package/dist/chunk-9e93g81n.js +298 -0
- package/dist/chunk-9f3d61y7.js +548 -0
- package/dist/chunk-9gc3andd.js +422 -0
- package/dist/chunk-9kn3tgpb.js +130 -0
- package/dist/chunk-9m5rn7hk.js +61 -0
- package/dist/chunk-9p4hsd6a.js +50 -0
- package/dist/chunk-9qasfk8n.js +758 -0
- package/dist/chunk-9snp5mn2.js +533 -0
- package/dist/chunk-9tcvras3.js +2331 -0
- package/dist/chunk-a0186ngk.js +57 -0
- package/dist/chunk-a2m8f0aj.js +268 -0
- package/dist/chunk-a2rcafav.js +716 -0
- package/dist/chunk-a9hjdzar.js +160 -0
- package/dist/chunk-aak6ts5n.js +526 -0
- package/dist/chunk-aca3w84n.js +267 -0
- package/dist/chunk-ae76ded0.js +30 -0
- package/dist/chunk-afnjhn3j.js +21933 -0
- package/dist/chunk-ahj70tf0.js +880 -0
- package/dist/chunk-apjsxssq.js +169 -0
- package/dist/chunk-av49wjj1.js +43 -0
- package/dist/chunk-axggebfy.js +206 -0
- package/dist/chunk-az7jpbv8.js +16 -0
- package/dist/chunk-azz7sep6.js +328 -0
- package/dist/chunk-b4tpz2g1.js +93 -0
- package/dist/chunk-bczf2eyq.js +115 -0
- package/dist/chunk-bd95f637.js +208 -0
- package/dist/chunk-bdhdmkya.js +10 -0
- package/dist/chunk-bp0ynk17.js +32 -0
- package/dist/chunk-bq75gxjs.js +90 -0
- package/dist/chunk-btk5jaq6.js +10464 -0
- package/dist/chunk-bv4c48a5.js +120 -0
- package/dist/chunk-byfb105n.js +341 -0
- package/dist/chunk-c0bdmy7w.js +4223 -0
- package/dist/chunk-c20aqkz8.js +641 -0
- package/dist/chunk-c4jg3s2c.js +163 -0
- package/dist/chunk-c61q5cer.js +258 -0
- package/dist/chunk-c9f761sy.js +386 -0
- package/dist/chunk-ca6jkz06.js +157 -0
- package/dist/chunk-ccyg9ap9.js +171374 -0
- package/dist/chunk-cfej8cc7.js +371 -0
- package/dist/chunk-cjqxdnf9.js +23 -0
- package/dist/chunk-ckrs789w.js +8 -0
- package/dist/chunk-cqeq13wg.js +48 -0
- package/dist/chunk-crfj3w5e.js +22821 -0
- package/dist/chunk-ct5x6z7g.js +8066 -0
- package/dist/chunk-cv5h8n8c.js +101 -0
- package/dist/chunk-cwe8h159.js +1563 -0
- package/dist/chunk-cwm234zz.js +908 -0
- package/dist/chunk-d1jkfp45.js +1580 -0
- package/dist/chunk-d3hb1qdr.js +126 -0
- package/dist/chunk-d70d0zer.js +713 -0
- package/dist/chunk-d91tx29f.js +105 -0
- package/dist/chunk-d952pymh.js +20 -0
- package/dist/chunk-d9af3z8k.js +720 -0
- package/dist/chunk-da1n53c2.js +47 -0
- package/dist/chunk-df5c1x8m.js +732 -0
- package/dist/chunk-dkv64xys.js +71 -0
- package/dist/chunk-dm7166v6.js +251 -0
- package/dist/chunk-dr0y5a61.js +258 -0
- package/dist/chunk-drzb0rrd.js +306 -0
- package/dist/chunk-dw1v1q7w.js +37 -0
- package/dist/chunk-e224qet4.js +348 -0
- package/dist/chunk-e50ckbv0.js +1099 -0
- package/dist/chunk-e5gn6by6.js +1165 -0
- package/dist/chunk-e7m3f74m.js +37 -0
- package/dist/chunk-e8ghgwaj.js +295 -0
- package/dist/chunk-ed8k4ya2.js +41 -0
- package/dist/chunk-eh0vnqdz.js +76 -0
- package/dist/chunk-epwrzr35.js +4301 -0
- package/dist/chunk-er9h6sw5.js +5379 -0
- package/dist/chunk-eta5aekm.js +79 -0
- package/dist/chunk-ev5gxscq.js +63 -0
- package/dist/chunk-evp72hv5.js +212 -0
- package/dist/chunk-ex41stfq.js +127 -0
- package/dist/chunk-ezpa510h.js +62 -0
- package/dist/chunk-f0fm6dey.js +477 -0
- package/dist/chunk-f239sbhc.js +152 -0
- package/dist/chunk-f2bj47xf.js +109 -0
- package/dist/chunk-f4t24rq4.js +258 -0
- package/dist/chunk-f9ghvzy8.js +106 -0
- package/dist/chunk-f9rahzgr.js +99 -0
- package/dist/chunk-ff75qzty.js +521 -0
- package/dist/chunk-fj0ctt6q.js +264 -0
- package/dist/chunk-fj7wxdt3.js +221 -0
- package/dist/chunk-fnnpqv92.js +714 -0
- package/dist/chunk-fpd3zzx1.js +26696 -0
- package/dist/chunk-fqv2cn76.js +227 -0
- package/dist/chunk-fqw9j3bj.js +439 -0
- package/dist/chunk-frbcqhz0.js +4984 -0
- package/dist/chunk-fzkj59sg.js +174 -0
- package/dist/chunk-fzpzbpbw.js +248 -0
- package/dist/chunk-g52cpmd1.js +686 -0
- package/dist/chunk-g98m2qe6.js +31 -0
- package/dist/chunk-g9zgq4vy.js +715 -0
- package/dist/chunk-gbpt7tm8.js +687 -0
- package/dist/chunk-gg52jka8.js +373 -0
- package/dist/chunk-gjttphax.js +5793 -0
- package/dist/chunk-gs7vjaas.js +65 -0
- package/dist/chunk-gv8n85j2.js +8 -0
- package/dist/chunk-gxdwm6pt.js +650 -0
- package/dist/chunk-gy8wajg2.js +1014 -0
- package/dist/chunk-gz3647m0.js +200 -0
- package/dist/chunk-gzg07mqh.js +16 -0
- package/dist/chunk-h3zc60tq.js +44 -0
- package/dist/chunk-h4p1qt16.js +74 -0
- package/dist/chunk-h8219f18.js +282 -0
- package/dist/chunk-h9agq92v.js +331 -0
- package/dist/chunk-hhjtpwbj.js +16 -0
- package/dist/chunk-hpgpwzra.js +548 -0
- package/dist/chunk-hsnjvn19.js +80 -0
- package/dist/chunk-hsp9qrry.js +417 -0
- package/dist/chunk-hwz6aq2m.js +3939 -0
- package/dist/chunk-hzph0hbh.js +272 -0
- package/dist/chunk-hzqkss6v.js +153 -0
- package/dist/chunk-j0t31f39.js +1149 -0
- package/dist/chunk-j1qm6n1v.js +30 -0
- package/dist/chunk-j6e4b522.js +81 -0
- package/dist/chunk-j7qfbvxk.js +84 -0
- package/dist/chunk-j7qv3hvm.js +1635 -0
- package/dist/chunk-j8mxc6k6.js +213 -0
- package/dist/chunk-jevj87jn.js +224 -0
- package/dist/chunk-jk2ps88q.js +815 -0
- package/dist/chunk-jz7tbdyv.js +1599 -0
- package/dist/chunk-k36jpjvh.js +300 -0
- package/dist/chunk-k4nmrt3w.js +61 -0
- package/dist/chunk-kavn03r9.js +16606 -0
- package/dist/chunk-kkgav8dm.js +54 -0
- package/dist/chunk-kkq26g5c.js +33 -0
- package/dist/chunk-kp6nepx4.js +106 -0
- package/dist/chunk-ksefybc8.js +1551 -0
- package/dist/chunk-kv147680.js +3436 -0
- package/dist/chunk-kya46axt.js +833 -0
- package/dist/chunk-kyz233ny.js +227 -0
- package/dist/chunk-kzs75xmj.js +143 -0
- package/dist/chunk-m0vrez9w.js +266 -0
- package/dist/chunk-m1wadav3.js +118 -0
- package/dist/chunk-m4rfx3cj.js +221 -0
- package/dist/chunk-mc9zaggs.js +6374 -0
- package/dist/chunk-mcg5ttj4.js +105 -0
- package/dist/chunk-mf4r7918.js +63 -0
- package/dist/chunk-mh9khrt4.js +286 -0
- package/dist/chunk-mhc4szw7.js +22 -0
- package/dist/chunk-mkq0yzp0.js +38 -0
- package/dist/chunk-mr58jv4w.js +256 -0
- package/dist/chunk-mrrx3bmt.js +168 -0
- package/dist/chunk-mtyk3zz6.js +87 -0
- package/dist/chunk-mvgxntv6.js +62 -0
- package/dist/chunk-mwnjydcm.js +102 -0
- package/dist/chunk-mwxt0m3f.js +862 -0
- package/dist/chunk-mz1pxck8.js +998 -0
- package/dist/chunk-n3agghys.js +214 -0
- package/dist/chunk-n6q02ya9.js +442 -0
- package/dist/chunk-nt3y91vh.js +443 -0
- package/dist/chunk-nt837qt9.js +21 -0
- package/dist/chunk-ntgmegfs.js +39 -0
- package/dist/chunk-nwk16bbd.js +30 -0
- package/dist/chunk-p367ay90.js +672 -0
- package/dist/chunk-p7m3x9qk.js +48 -0
- package/dist/chunk-pagmjwp5.js +132 -0
- package/dist/chunk-pbd4r8ek.js +161 -0
- package/dist/chunk-pdkpssgv.js +2422 -0
- package/dist/chunk-pf6z1e35.js +32 -0
- package/dist/chunk-pfzejvpt.js +213 -0
- package/dist/chunk-pktxyhvk.js +400 -0
- package/dist/chunk-pp5xhveq.js +124 -0
- package/dist/chunk-ppnd7a8x.js +38 -0
- package/dist/chunk-pqh2w7dr.js +2202 -0
- package/dist/chunk-pr878d0z.js +240 -0
- package/dist/chunk-psf0y7hy.js +140 -0
- package/dist/chunk-pz2zz2f7.js +1586 -0
- package/dist/chunk-q0xkrxy8.js +890 -0
- package/dist/chunk-q5b0kpr3.js +14369 -0
- package/dist/chunk-q7z3t531.js +334 -0
- package/dist/chunk-qdjjtgwt.js +3183 -0
- package/dist/chunk-qezv7msv.js +26 -0
- package/dist/chunk-qmxn7f86.js +2643 -0
- package/dist/chunk-qqc3b97c.js +15 -0
- package/dist/chunk-qwrp63wh.js +145 -0
- package/dist/chunk-qyvqbst3.js +537 -0
- package/dist/chunk-qztvd4hd.js +465 -0
- package/dist/chunk-r0bvez4y.js +235 -0
- package/dist/chunk-r3z0896k.js +2831 -0
- package/dist/chunk-r4cxb6t7.js +32 -0
- package/dist/chunk-rb8k68m7.js +118 -0
- package/dist/chunk-rdprgm4t.js +42 -0
- package/dist/chunk-rex82hys.js +1710 -0
- package/dist/chunk-rjjakkw2.js +2560 -0
- package/dist/chunk-rka6gcv3.js +304 -0
- package/dist/chunk-rkz12ghm.js +144 -0
- package/dist/chunk-rnc7m1qs.js +436 -0
- package/dist/chunk-rx6z23h0.js +165 -0
- package/dist/chunk-s76582j1.js +28 -0
- package/dist/chunk-sez03qd9.js +7140 -0
- package/dist/chunk-sjvdn2ep.js +130 -0
- package/dist/chunk-smwhyy8p.js +115 -0
- package/dist/chunk-snw7nh0d.js +695 -0
- package/dist/chunk-sqx9c057.js +193 -0
- package/dist/chunk-sscms68s.js +16 -0
- package/dist/chunk-stknnmsb.js +272 -0
- package/dist/chunk-sywdxbs6.js +853 -0
- package/dist/chunk-syxy4pf2.js +782 -0
- package/dist/chunk-t0hpqsqn.js +6157 -0
- package/dist/chunk-tjm70vnw.js +123 -0
- package/dist/chunk-trzh0msn.js +154 -0
- package/dist/chunk-v1z17cpg.js +723 -0
- package/dist/chunk-vsfj449x.js +333 -0
- package/dist/chunk-vvkq20tt.js +287 -0
- package/dist/chunk-vxgdzx6p.js +338 -0
- package/dist/chunk-vxqhjyfz.js +15 -0
- package/dist/chunk-vzsstfmb.js +80 -0
- package/dist/chunk-w1jew5sn.js +69 -0
- package/dist/chunk-w3kwr76v.js +789 -0
- package/dist/chunk-w40netr9.js +59 -0
- package/dist/chunk-w99cpfdg.js +559 -0
- package/dist/chunk-wacn14d2.js +271 -0
- package/dist/chunk-wbhrqrq3.js +3033 -0
- package/dist/chunk-wfg9g0p7.js +17612 -0
- package/dist/chunk-wj3vjsbx.js +93 -0
- package/dist/chunk-wjhq855a.js +372 -0
- package/dist/chunk-wr06gqxh.js +114 -0
- package/dist/chunk-ws0z2y1g.js +195 -0
- package/dist/chunk-wt62wqcj.js +98 -0
- package/dist/chunk-wx4v7ddx.js +42 -0
- package/dist/chunk-wy0t3vb2.js +6101 -0
- package/dist/chunk-wysz7qk4.js +280 -0
- package/dist/chunk-x63fx1vd.js +192 -0
- package/dist/chunk-x8b7vft8.js +132 -0
- package/dist/chunk-x8jhkgxb.js +346 -0
- package/dist/chunk-x9z4q5k5.js +275 -0
- package/dist/chunk-xjd7e9jq.js +126 -0
- package/dist/chunk-xjr0n27e.js +42 -0
- package/dist/chunk-xpwyw7cd.js +24 -0
- package/dist/chunk-xw4ycnyz.js +37 -0
- package/dist/chunk-y66bqywr.js +17303 -0
- package/dist/chunk-ycarry7d.js +157 -0
- package/dist/chunk-ycr0hp6v.js +1486 -0
- package/dist/chunk-yqmaw6hf.js +496 -0
- package/dist/chunk-yrtm7d23.js +602 -0
- package/dist/chunk-yts879rw.js +48 -0
- package/dist/chunk-yvmhx96e.js +347 -0
- package/dist/chunk-ywq00rg4.js +246 -0
- package/dist/chunk-yygeg5mj.js +752 -0
- package/dist/chunk-z0exw850.js +726 -0
- package/dist/chunk-z2dp53wn.js +17 -0
- package/dist/chunk-z4rzc9nd.js +103 -0
- package/dist/chunk-zb0akt77.js +684 -0
- package/dist/chunk-zb2xrj5t.js +1789 -0
- package/dist/chunk-zbptn0ky.js +423 -0
- package/dist/chunk-zd45wbmf.js +1090 -0
- package/dist/chunk-zjkvspz9.js +2050 -0
- package/dist/chunk-zke1sp3x.js +1524 -0
- package/dist/chunk-zv2cvfsv.js +58 -0
- package/dist/chunk-zy4tmqst.js +644 -0
- package/dist/chunk-zygzzzvk.js +192 -0
- package/dist/cli-21v3v6ny.md +1 -0
- package/dist/cli.js +246 -0
- package/dist/server-n5f2q89z.md +1 -0
- package/package.json +161 -0
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-78n9kfp8.js";
|
|
3
|
+
import"./chunk-j8mxc6k6.js";
|
|
4
|
+
import"./chunk-z0exw850.js";
|
|
5
|
+
import"./chunk-3jf3k40v.js";
|
|
6
|
+
import"./chunk-yvmhx96e.js";
|
|
7
|
+
import"./chunk-qezv7msv.js";
|
|
8
|
+
import"./chunk-sscms68s.js";
|
|
9
|
+
import"./chunk-7e1qjk3s.js";
|
|
10
|
+
import"./chunk-1gjysfnf.js";
|
|
11
|
+
import"./chunk-vxgdzx6p.js";
|
|
12
|
+
import"./chunk-kv147680.js";
|
|
13
|
+
import"./chunk-2p0hvt8k.js";
|
|
14
|
+
import"./chunk-ycr0hp6v.js";
|
|
15
|
+
import"./chunk-9029sbq1.js";
|
|
16
|
+
import"./chunk-ezpa510h.js";
|
|
17
|
+
import"./chunk-kp6nepx4.js";
|
|
18
|
+
import"./chunk-1jjzp2pa.js";
|
|
19
|
+
import"./chunk-w1jew5sn.js";
|
|
20
|
+
import"./chunk-g98m2qe6.js";
|
|
21
|
+
import {
|
|
22
|
+
execFileNoThrowWithCwd,
|
|
23
|
+
init_execFileNoThrow
|
|
24
|
+
} from "./chunk-sez03qd9.js";
|
|
25
|
+
import {
|
|
26
|
+
init_log,
|
|
27
|
+
logError
|
|
28
|
+
} from "./chunk-vsfj449x.js";
|
|
29
|
+
import"./chunk-r4cxb6t7.js";
|
|
30
|
+
import {
|
|
31
|
+
getCwd,
|
|
32
|
+
init_cwd
|
|
33
|
+
} from "./chunk-bp0ynk17.js";
|
|
34
|
+
import"./chunk-7yexhdjs.js";
|
|
35
|
+
import {
|
|
36
|
+
getFsImplementation,
|
|
37
|
+
init_debug,
|
|
38
|
+
init_fsOperations,
|
|
39
|
+
logForDebugging
|
|
40
|
+
} from "./chunk-rex82hys.js";
|
|
41
|
+
import"./chunk-4s93jyky.js";
|
|
42
|
+
import"./chunk-318g78ty.js";
|
|
43
|
+
import"./chunk-c0bdmy7w.js";
|
|
44
|
+
import"./chunk-syxy4pf2.js";
|
|
45
|
+
import {
|
|
46
|
+
__esm
|
|
47
|
+
} from "./chunk-eta5aekm.js";
|
|
48
|
+
import {
|
|
49
|
+
getCanonicalName,
|
|
50
|
+
init_model,
|
|
51
|
+
sequential
|
|
52
|
+
} from "./chunk-y66bqywr.js";
|
|
53
|
+
import"./chunk-nwk16bbd.js";
|
|
54
|
+
import"./chunk-rx6z23h0.js";
|
|
55
|
+
import"./chunk-df5c1x8m.js";
|
|
56
|
+
import {
|
|
57
|
+
findGitRoot,
|
|
58
|
+
getRemoteUrlForDir,
|
|
59
|
+
gitExe,
|
|
60
|
+
init_git,
|
|
61
|
+
init_gitFilesystem,
|
|
62
|
+
resolveGitDir
|
|
63
|
+
} from "./chunk-65z8hg8j.js";
|
|
64
|
+
import"./chunk-5cp2q9sh.js";
|
|
65
|
+
import {
|
|
66
|
+
getOriginalCwd,
|
|
67
|
+
getSessionId,
|
|
68
|
+
init_state
|
|
69
|
+
} from "./chunk-rjjakkw2.js";
|
|
70
|
+
import"./chunk-0sbddf6m.js";
|
|
71
|
+
import"./chunk-q5b0kpr3.js";
|
|
72
|
+
|
|
73
|
+
// src/utils/generatedFiles.ts
|
|
74
|
+
import { basename, extname, posix, sep } from "path";
|
|
75
|
+
function isGeneratedFile(filePath) {
|
|
76
|
+
const normalizedPath = posix.sep + filePath.split(sep).join(posix.sep).replace(/^\/+/, "");
|
|
77
|
+
const fileName = basename(filePath).toLowerCase();
|
|
78
|
+
const ext = extname(filePath).toLowerCase();
|
|
79
|
+
if (EXCLUDED_FILENAMES.has(fileName)) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
if (EXCLUDED_EXTENSIONS.has(ext)) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
const parts = fileName.split(".");
|
|
86
|
+
if (parts.length > 2) {
|
|
87
|
+
const compoundExt = "." + parts.slice(-2).join(".");
|
|
88
|
+
if (EXCLUDED_EXTENSIONS.has(compoundExt)) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (const dir of EXCLUDED_DIRECTORIES) {
|
|
93
|
+
if (normalizedPath.includes(dir)) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const pattern of EXCLUDED_FILENAME_PATTERNS) {
|
|
98
|
+
if (pattern.test(fileName)) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
var EXCLUDED_FILENAMES, EXCLUDED_EXTENSIONS, EXCLUDED_DIRECTORIES, EXCLUDED_FILENAME_PATTERNS;
|
|
105
|
+
var init_generatedFiles = __esm(() => {
|
|
106
|
+
EXCLUDED_FILENAMES = new Set([
|
|
107
|
+
"package-lock.json",
|
|
108
|
+
"yarn.lock",
|
|
109
|
+
"pnpm-lock.yaml",
|
|
110
|
+
"bun.lockb",
|
|
111
|
+
"bun.lock",
|
|
112
|
+
"composer.lock",
|
|
113
|
+
"gemfile.lock",
|
|
114
|
+
"cargo.lock",
|
|
115
|
+
"poetry.lock",
|
|
116
|
+
"pipfile.lock",
|
|
117
|
+
"shrinkwrap.json",
|
|
118
|
+
"npm-shrinkwrap.json"
|
|
119
|
+
]);
|
|
120
|
+
EXCLUDED_EXTENSIONS = new Set([
|
|
121
|
+
".lock",
|
|
122
|
+
".min.js",
|
|
123
|
+
".min.css",
|
|
124
|
+
".min.html",
|
|
125
|
+
".bundle.js",
|
|
126
|
+
".bundle.css",
|
|
127
|
+
".generated.ts",
|
|
128
|
+
".generated.js",
|
|
129
|
+
".d.ts"
|
|
130
|
+
]);
|
|
131
|
+
EXCLUDED_DIRECTORIES = [
|
|
132
|
+
"/dist/",
|
|
133
|
+
"/build/",
|
|
134
|
+
"/out/",
|
|
135
|
+
"/output/",
|
|
136
|
+
"/node_modules/",
|
|
137
|
+
"/vendor/",
|
|
138
|
+
"/vendored/",
|
|
139
|
+
"/third_party/",
|
|
140
|
+
"/third-party/",
|
|
141
|
+
"/external/",
|
|
142
|
+
"/.next/",
|
|
143
|
+
"/.nuxt/",
|
|
144
|
+
"/.svelte-kit/",
|
|
145
|
+
"/coverage/",
|
|
146
|
+
"/__pycache__/",
|
|
147
|
+
"/.tox/",
|
|
148
|
+
"/venv/",
|
|
149
|
+
"/.venv/",
|
|
150
|
+
"/target/release/",
|
|
151
|
+
"/target/debug/"
|
|
152
|
+
];
|
|
153
|
+
EXCLUDED_FILENAME_PATTERNS = [
|
|
154
|
+
/^.*\.min\.[a-z]+$/i,
|
|
155
|
+
/^.*-min\.[a-z]+$/i,
|
|
156
|
+
/^.*\.bundle\.[a-z]+$/i,
|
|
157
|
+
/^.*\.generated\.[a-z]+$/i,
|
|
158
|
+
/^.*\.gen\.[a-z]+$/i,
|
|
159
|
+
/^.*\.auto\.[a-z]+$/i,
|
|
160
|
+
/^.*_generated\.[a-z]+$/i,
|
|
161
|
+
/^.*_gen\.[a-z]+$/i,
|
|
162
|
+
/^.*\.pb\.(go|js|ts|py|rb)$/i,
|
|
163
|
+
/^.*_pb2?\.py$/i,
|
|
164
|
+
/^.*\.pb\.h$/i,
|
|
165
|
+
/^.*\.grpc\.[a-z]+$/i,
|
|
166
|
+
/^.*\.swagger\.[a-z]+$/i,
|
|
167
|
+
/^.*\.openapi\.[a-z]+$/i
|
|
168
|
+
];
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// src/utils/commitAttribution.ts
|
|
172
|
+
import { createHash, randomUUID } from "crypto";
|
|
173
|
+
import { stat } from "fs/promises";
|
|
174
|
+
import { isAbsolute, join, relative, sep as sep2 } from "path";
|
|
175
|
+
function getAttributionRepoRoot() {
|
|
176
|
+
const cwd = getCwd();
|
|
177
|
+
return findGitRoot(cwd) ?? getOriginalCwd();
|
|
178
|
+
}
|
|
179
|
+
function getRepoClassCached() {
|
|
180
|
+
return repoClassCache;
|
|
181
|
+
}
|
|
182
|
+
function isInternalModelRepoCached() {
|
|
183
|
+
return repoClassCache === "internal";
|
|
184
|
+
}
|
|
185
|
+
function sanitizeSurfaceKey(surfaceKey) {
|
|
186
|
+
const slashIndex = surfaceKey.lastIndexOf("/");
|
|
187
|
+
if (slashIndex === -1) {
|
|
188
|
+
return surfaceKey;
|
|
189
|
+
}
|
|
190
|
+
const surface = surfaceKey.slice(0, slashIndex);
|
|
191
|
+
const model = surfaceKey.slice(slashIndex + 1);
|
|
192
|
+
const sanitizedModel = sanitizeModelName(model);
|
|
193
|
+
return `${surface}/${sanitizedModel}`;
|
|
194
|
+
}
|
|
195
|
+
function sanitizeModelName(shortName) {
|
|
196
|
+
if (shortName.includes("opus-4-6"))
|
|
197
|
+
return "claude-opus-4-6";
|
|
198
|
+
if (shortName.includes("opus-4-5"))
|
|
199
|
+
return "claude-opus-4-5";
|
|
200
|
+
if (shortName.includes("opus-4-1"))
|
|
201
|
+
return "claude-opus-4-1";
|
|
202
|
+
if (shortName.includes("opus-4"))
|
|
203
|
+
return "claude-opus-4";
|
|
204
|
+
if (shortName.includes("sonnet-4-6"))
|
|
205
|
+
return "claude-sonnet-4-6";
|
|
206
|
+
if (shortName.includes("sonnet-4-5"))
|
|
207
|
+
return "claude-sonnet-4-5";
|
|
208
|
+
if (shortName.includes("sonnet-4"))
|
|
209
|
+
return "claude-sonnet-4";
|
|
210
|
+
if (shortName.includes("sonnet-3-7"))
|
|
211
|
+
return "claude-sonnet-3-7";
|
|
212
|
+
if (shortName.includes("haiku-4-5"))
|
|
213
|
+
return "claude-haiku-4-5";
|
|
214
|
+
if (shortName.includes("haiku-3-5"))
|
|
215
|
+
return "claude-haiku-3-5";
|
|
216
|
+
return "claude";
|
|
217
|
+
}
|
|
218
|
+
function getClientSurface() {
|
|
219
|
+
return process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli";
|
|
220
|
+
}
|
|
221
|
+
function buildSurfaceKey(surface, model) {
|
|
222
|
+
return `${surface}/${getCanonicalName(model)}`;
|
|
223
|
+
}
|
|
224
|
+
function computeContentHash(content) {
|
|
225
|
+
return createHash("sha256").update(content).digest("hex");
|
|
226
|
+
}
|
|
227
|
+
function normalizeFilePath(filePath) {
|
|
228
|
+
const fs = getFsImplementation();
|
|
229
|
+
const cwd = getAttributionRepoRoot();
|
|
230
|
+
if (!isAbsolute(filePath)) {
|
|
231
|
+
return filePath;
|
|
232
|
+
}
|
|
233
|
+
let resolvedPath = filePath;
|
|
234
|
+
let resolvedCwd = cwd;
|
|
235
|
+
try {
|
|
236
|
+
resolvedPath = fs.realpathSync(filePath);
|
|
237
|
+
} catch {}
|
|
238
|
+
try {
|
|
239
|
+
resolvedCwd = fs.realpathSync(cwd);
|
|
240
|
+
} catch {}
|
|
241
|
+
if (resolvedPath.startsWith(resolvedCwd + sep2) || resolvedPath === resolvedCwd) {
|
|
242
|
+
return relative(resolvedCwd, resolvedPath).replaceAll(sep2, "/");
|
|
243
|
+
}
|
|
244
|
+
if (filePath.startsWith(cwd + sep2) || filePath === cwd) {
|
|
245
|
+
return relative(cwd, filePath).replaceAll(sep2, "/");
|
|
246
|
+
}
|
|
247
|
+
return filePath;
|
|
248
|
+
}
|
|
249
|
+
function expandFilePath(filePath) {
|
|
250
|
+
if (isAbsolute(filePath)) {
|
|
251
|
+
return filePath;
|
|
252
|
+
}
|
|
253
|
+
return join(getAttributionRepoRoot(), filePath);
|
|
254
|
+
}
|
|
255
|
+
function createEmptyAttributionState() {
|
|
256
|
+
return {
|
|
257
|
+
fileStates: new Map,
|
|
258
|
+
sessionBaselines: new Map,
|
|
259
|
+
surface: getClientSurface(),
|
|
260
|
+
startingHeadSha: null,
|
|
261
|
+
promptCount: 0,
|
|
262
|
+
promptCountAtLastCommit: 0,
|
|
263
|
+
permissionPromptCount: 0,
|
|
264
|
+
permissionPromptCountAtLastCommit: 0,
|
|
265
|
+
escapeCount: 0,
|
|
266
|
+
escapeCountAtLastCommit: 0
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
function computeFileModificationState(existingFileStates, filePath, oldContent, newContent, mtime) {
|
|
270
|
+
const normalizedPath = normalizeFilePath(filePath);
|
|
271
|
+
try {
|
|
272
|
+
let claudeContribution;
|
|
273
|
+
if (oldContent === "" || newContent === "") {
|
|
274
|
+
claudeContribution = oldContent === "" ? newContent.length : oldContent.length;
|
|
275
|
+
} else {
|
|
276
|
+
const minLen = Math.min(oldContent.length, newContent.length);
|
|
277
|
+
let prefixEnd = 0;
|
|
278
|
+
while (prefixEnd < minLen && oldContent[prefixEnd] === newContent[prefixEnd]) {
|
|
279
|
+
prefixEnd++;
|
|
280
|
+
}
|
|
281
|
+
let suffixLen = 0;
|
|
282
|
+
while (suffixLen < minLen - prefixEnd && oldContent[oldContent.length - 1 - suffixLen] === newContent[newContent.length - 1 - suffixLen]) {
|
|
283
|
+
suffixLen++;
|
|
284
|
+
}
|
|
285
|
+
const oldChangedLen = oldContent.length - prefixEnd - suffixLen;
|
|
286
|
+
const newChangedLen = newContent.length - prefixEnd - suffixLen;
|
|
287
|
+
claudeContribution = Math.max(oldChangedLen, newChangedLen);
|
|
288
|
+
}
|
|
289
|
+
const existingState = existingFileStates.get(normalizedPath);
|
|
290
|
+
const existingContribution = existingState?.claudeContribution ?? 0;
|
|
291
|
+
return {
|
|
292
|
+
contentHash: computeContentHash(newContent),
|
|
293
|
+
claudeContribution: existingContribution + claudeContribution,
|
|
294
|
+
mtime
|
|
295
|
+
};
|
|
296
|
+
} catch (error) {
|
|
297
|
+
logError(error);
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
async function getFileMtime(filePath) {
|
|
302
|
+
const normalizedPath = normalizeFilePath(filePath);
|
|
303
|
+
const absPath = expandFilePath(normalizedPath);
|
|
304
|
+
try {
|
|
305
|
+
const stats = await stat(absPath);
|
|
306
|
+
return stats.mtimeMs;
|
|
307
|
+
} catch {
|
|
308
|
+
return Date.now();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function trackFileModification(state, filePath, oldContent, newContent, _userModified, mtime = Date.now()) {
|
|
312
|
+
const normalizedPath = normalizeFilePath(filePath);
|
|
313
|
+
const newFileState = computeFileModificationState(state.fileStates, filePath, oldContent, newContent, mtime);
|
|
314
|
+
if (!newFileState) {
|
|
315
|
+
return state;
|
|
316
|
+
}
|
|
317
|
+
const newFileStates = new Map(state.fileStates);
|
|
318
|
+
newFileStates.set(normalizedPath, newFileState);
|
|
319
|
+
logForDebugging(`Attribution: Tracked ${newFileState.claudeContribution} chars for ${normalizedPath}`);
|
|
320
|
+
return {
|
|
321
|
+
...state,
|
|
322
|
+
fileStates: newFileStates
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
function trackFileCreation(state, filePath, content, mtime = Date.now()) {
|
|
326
|
+
return trackFileModification(state, filePath, "", content, false, mtime);
|
|
327
|
+
}
|
|
328
|
+
function trackFileDeletion(state, filePath, oldContent) {
|
|
329
|
+
const normalizedPath = normalizeFilePath(filePath);
|
|
330
|
+
const existingState = state.fileStates.get(normalizedPath);
|
|
331
|
+
const existingContribution = existingState?.claudeContribution ?? 0;
|
|
332
|
+
const deletedChars = oldContent.length;
|
|
333
|
+
const newFileState = {
|
|
334
|
+
contentHash: "",
|
|
335
|
+
claudeContribution: existingContribution + deletedChars,
|
|
336
|
+
mtime: Date.now()
|
|
337
|
+
};
|
|
338
|
+
const newFileStates = new Map(state.fileStates);
|
|
339
|
+
newFileStates.set(normalizedPath, newFileState);
|
|
340
|
+
logForDebugging(`Attribution: Tracked deletion of ${normalizedPath} (${deletedChars} chars removed, total contribution: ${newFileState.claudeContribution})`);
|
|
341
|
+
return {
|
|
342
|
+
...state,
|
|
343
|
+
fileStates: newFileStates
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function trackBulkFileChanges(state, changes) {
|
|
347
|
+
const newFileStates = new Map(state.fileStates);
|
|
348
|
+
for (const change of changes) {
|
|
349
|
+
const mtime = change.mtime ?? Date.now();
|
|
350
|
+
if (change.type === "deleted") {
|
|
351
|
+
const normalizedPath = normalizeFilePath(change.path);
|
|
352
|
+
const existingState = newFileStates.get(normalizedPath);
|
|
353
|
+
const existingContribution = existingState?.claudeContribution ?? 0;
|
|
354
|
+
const deletedChars = change.oldContent.length;
|
|
355
|
+
newFileStates.set(normalizedPath, {
|
|
356
|
+
contentHash: "",
|
|
357
|
+
claudeContribution: existingContribution + deletedChars,
|
|
358
|
+
mtime
|
|
359
|
+
});
|
|
360
|
+
logForDebugging(`Attribution: Tracked deletion of ${normalizedPath} (${deletedChars} chars removed, total contribution: ${existingContribution + deletedChars})`);
|
|
361
|
+
} else {
|
|
362
|
+
const newFileState = computeFileModificationState(newFileStates, change.path, change.oldContent, change.newContent, mtime);
|
|
363
|
+
if (newFileState) {
|
|
364
|
+
const normalizedPath = normalizeFilePath(change.path);
|
|
365
|
+
newFileStates.set(normalizedPath, newFileState);
|
|
366
|
+
logForDebugging(`Attribution: Tracked ${newFileState.claudeContribution} chars for ${normalizedPath}`);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return {
|
|
371
|
+
...state,
|
|
372
|
+
fileStates: newFileStates
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
async function calculateCommitAttribution(states, stagedFiles) {
|
|
376
|
+
const cwd = getAttributionRepoRoot();
|
|
377
|
+
const sessionId = getSessionId();
|
|
378
|
+
const files = {};
|
|
379
|
+
const excludedGenerated = [];
|
|
380
|
+
const surfaces = new Set;
|
|
381
|
+
const surfaceCounts = {};
|
|
382
|
+
let totalClaudeChars = 0;
|
|
383
|
+
let totalHumanChars = 0;
|
|
384
|
+
const mergedFileStates = new Map;
|
|
385
|
+
const mergedBaselines = new Map;
|
|
386
|
+
for (const state of states) {
|
|
387
|
+
surfaces.add(state.surface);
|
|
388
|
+
const baselines = state.sessionBaselines instanceof Map ? state.sessionBaselines : new Map(Object.entries(state.sessionBaselines ?? {}));
|
|
389
|
+
for (const [path, baseline] of baselines) {
|
|
390
|
+
if (!mergedBaselines.has(path)) {
|
|
391
|
+
mergedBaselines.set(path, baseline);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const fileStates = state.fileStates instanceof Map ? state.fileStates : new Map(Object.entries(state.fileStates ?? {}));
|
|
395
|
+
for (const [path, fileState] of fileStates) {
|
|
396
|
+
const existing = mergedFileStates.get(path);
|
|
397
|
+
if (existing) {
|
|
398
|
+
mergedFileStates.set(path, {
|
|
399
|
+
...fileState,
|
|
400
|
+
claudeContribution: existing.claudeContribution + fileState.claudeContribution
|
|
401
|
+
});
|
|
402
|
+
} else {
|
|
403
|
+
mergedFileStates.set(path, fileState);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
const fileResults = await Promise.all(stagedFiles.map(async (file) => {
|
|
408
|
+
if (isGeneratedFile(file)) {
|
|
409
|
+
return { type: "generated", file };
|
|
410
|
+
}
|
|
411
|
+
const absPath = join(cwd, file);
|
|
412
|
+
const fileState = mergedFileStates.get(file);
|
|
413
|
+
const baseline = mergedBaselines.get(file);
|
|
414
|
+
const fileSurface = states[0].surface;
|
|
415
|
+
let claudeChars = 0;
|
|
416
|
+
let humanChars = 0;
|
|
417
|
+
const deleted = await isFileDeleted(file);
|
|
418
|
+
if (deleted) {
|
|
419
|
+
if (fileState) {
|
|
420
|
+
claudeChars = fileState.claudeContribution;
|
|
421
|
+
humanChars = 0;
|
|
422
|
+
} else {
|
|
423
|
+
const diffSize = await getGitDiffSize(file);
|
|
424
|
+
humanChars = diffSize > 0 ? diffSize : 100;
|
|
425
|
+
}
|
|
426
|
+
} else {
|
|
427
|
+
try {
|
|
428
|
+
const stats = await stat(absPath);
|
|
429
|
+
if (fileState) {
|
|
430
|
+
claudeChars = fileState.claudeContribution;
|
|
431
|
+
humanChars = 0;
|
|
432
|
+
} else if (baseline) {
|
|
433
|
+
const diffSize = await getGitDiffSize(file);
|
|
434
|
+
humanChars = diffSize > 0 ? diffSize : stats.size;
|
|
435
|
+
} else {
|
|
436
|
+
humanChars = stats.size;
|
|
437
|
+
}
|
|
438
|
+
} catch {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
claudeChars = Math.max(0, claudeChars);
|
|
443
|
+
humanChars = Math.max(0, humanChars);
|
|
444
|
+
const total = claudeChars + humanChars;
|
|
445
|
+
const percent = total > 0 ? Math.round(claudeChars / total * 100) : 0;
|
|
446
|
+
return {
|
|
447
|
+
type: "file",
|
|
448
|
+
file,
|
|
449
|
+
claudeChars,
|
|
450
|
+
humanChars,
|
|
451
|
+
percent,
|
|
452
|
+
surface: fileSurface
|
|
453
|
+
};
|
|
454
|
+
}));
|
|
455
|
+
for (const result of fileResults) {
|
|
456
|
+
if (!result)
|
|
457
|
+
continue;
|
|
458
|
+
if (result.type === "generated") {
|
|
459
|
+
excludedGenerated.push(result.file);
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
files[result.file] = {
|
|
463
|
+
claudeChars: result.claudeChars,
|
|
464
|
+
humanChars: result.humanChars,
|
|
465
|
+
percent: result.percent,
|
|
466
|
+
surface: result.surface
|
|
467
|
+
};
|
|
468
|
+
totalClaudeChars += result.claudeChars;
|
|
469
|
+
totalHumanChars += result.humanChars;
|
|
470
|
+
surfaceCounts[result.surface] = (surfaceCounts[result.surface] ?? 0) + result.claudeChars;
|
|
471
|
+
}
|
|
472
|
+
const totalChars = totalClaudeChars + totalHumanChars;
|
|
473
|
+
const claudePercent = totalChars > 0 ? Math.round(totalClaudeChars / totalChars * 100) : 0;
|
|
474
|
+
const surfaceBreakdown = {};
|
|
475
|
+
for (const [surface, chars] of Object.entries(surfaceCounts)) {
|
|
476
|
+
const percent = totalChars > 0 ? Math.round(chars / totalChars * 100) : 0;
|
|
477
|
+
surfaceBreakdown[surface] = { claudeChars: chars, percent };
|
|
478
|
+
}
|
|
479
|
+
return {
|
|
480
|
+
version: 1,
|
|
481
|
+
summary: {
|
|
482
|
+
claudePercent,
|
|
483
|
+
claudeChars: totalClaudeChars,
|
|
484
|
+
humanChars: totalHumanChars,
|
|
485
|
+
surfaces: Array.from(surfaces)
|
|
486
|
+
},
|
|
487
|
+
files,
|
|
488
|
+
surfaceBreakdown,
|
|
489
|
+
excludedGenerated,
|
|
490
|
+
sessions: [sessionId]
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
async function getGitDiffSize(filePath) {
|
|
494
|
+
const cwd = getAttributionRepoRoot();
|
|
495
|
+
try {
|
|
496
|
+
const result = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--stat", "--", filePath], { cwd, timeout: 5000 });
|
|
497
|
+
if (result.code !== 0 || !result.stdout) {
|
|
498
|
+
return 0;
|
|
499
|
+
}
|
|
500
|
+
const lines = result.stdout.split(`
|
|
501
|
+
`).filter(Boolean);
|
|
502
|
+
let totalChanges = 0;
|
|
503
|
+
for (const line of lines) {
|
|
504
|
+
if (line.includes("file changed") || line.includes("files changed")) {
|
|
505
|
+
const insertMatch = line.match(/(\d+) insertions?/);
|
|
506
|
+
const deleteMatch = line.match(/(\d+) deletions?/);
|
|
507
|
+
const insertions = insertMatch ? parseInt(insertMatch[1], 10) : 0;
|
|
508
|
+
const deletions = deleteMatch ? parseInt(deleteMatch[1], 10) : 0;
|
|
509
|
+
totalChanges += (insertions + deletions) * 40;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return totalChanges;
|
|
513
|
+
} catch {
|
|
514
|
+
return 0;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
async function isFileDeleted(filePath) {
|
|
518
|
+
const cwd = getAttributionRepoRoot();
|
|
519
|
+
try {
|
|
520
|
+
const result = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--name-status", "--", filePath], { cwd, timeout: 5000 });
|
|
521
|
+
if (result.code === 0 && result.stdout) {
|
|
522
|
+
return result.stdout.trim().startsWith("D\t");
|
|
523
|
+
}
|
|
524
|
+
} catch {}
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
async function getStagedFiles() {
|
|
528
|
+
const cwd = getAttributionRepoRoot();
|
|
529
|
+
try {
|
|
530
|
+
const result = await execFileNoThrowWithCwd(gitExe(), ["diff", "--cached", "--name-only"], { cwd, timeout: 5000 });
|
|
531
|
+
if (result.code === 0 && result.stdout) {
|
|
532
|
+
return result.stdout.split(`
|
|
533
|
+
`).filter(Boolean);
|
|
534
|
+
}
|
|
535
|
+
} catch (error) {
|
|
536
|
+
logError(error);
|
|
537
|
+
}
|
|
538
|
+
return [];
|
|
539
|
+
}
|
|
540
|
+
async function isGitTransientState() {
|
|
541
|
+
const gitDir = await resolveGitDir(getAttributionRepoRoot());
|
|
542
|
+
if (!gitDir)
|
|
543
|
+
return false;
|
|
544
|
+
const indicators = [
|
|
545
|
+
"rebase-merge",
|
|
546
|
+
"rebase-apply",
|
|
547
|
+
"MERGE_HEAD",
|
|
548
|
+
"CHERRY_PICK_HEAD",
|
|
549
|
+
"BISECT_LOG"
|
|
550
|
+
];
|
|
551
|
+
const results = await Promise.all(indicators.map(async (indicator) => {
|
|
552
|
+
try {
|
|
553
|
+
await stat(join(gitDir, indicator));
|
|
554
|
+
return true;
|
|
555
|
+
} catch {
|
|
556
|
+
return false;
|
|
557
|
+
}
|
|
558
|
+
}));
|
|
559
|
+
return results.some((exists) => exists);
|
|
560
|
+
}
|
|
561
|
+
function stateToSnapshotMessage(state, messageId) {
|
|
562
|
+
const fileStates = {};
|
|
563
|
+
for (const [path, fileState] of state.fileStates) {
|
|
564
|
+
fileStates[path] = fileState;
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
type: "attribution-snapshot",
|
|
568
|
+
messageId,
|
|
569
|
+
surface: state.surface,
|
|
570
|
+
fileStates,
|
|
571
|
+
promptCount: state.promptCount,
|
|
572
|
+
promptCountAtLastCommit: state.promptCountAtLastCommit,
|
|
573
|
+
permissionPromptCount: state.permissionPromptCount,
|
|
574
|
+
permissionPromptCountAtLastCommit: state.permissionPromptCountAtLastCommit,
|
|
575
|
+
escapeCount: state.escapeCount,
|
|
576
|
+
escapeCountAtLastCommit: state.escapeCountAtLastCommit
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function restoreAttributionStateFromSnapshots(snapshots) {
|
|
580
|
+
const state = createEmptyAttributionState();
|
|
581
|
+
const lastSnapshot = snapshots[snapshots.length - 1];
|
|
582
|
+
if (!lastSnapshot) {
|
|
583
|
+
return state;
|
|
584
|
+
}
|
|
585
|
+
state.surface = lastSnapshot.surface;
|
|
586
|
+
for (const [path, fileState] of Object.entries(lastSnapshot.fileStates)) {
|
|
587
|
+
state.fileStates.set(path, fileState);
|
|
588
|
+
}
|
|
589
|
+
state.promptCount = lastSnapshot.promptCount ?? 0;
|
|
590
|
+
state.promptCountAtLastCommit = lastSnapshot.promptCountAtLastCommit ?? 0;
|
|
591
|
+
state.permissionPromptCount = lastSnapshot.permissionPromptCount ?? 0;
|
|
592
|
+
state.permissionPromptCountAtLastCommit = lastSnapshot.permissionPromptCountAtLastCommit ?? 0;
|
|
593
|
+
state.escapeCount = lastSnapshot.escapeCount ?? 0;
|
|
594
|
+
state.escapeCountAtLastCommit = lastSnapshot.escapeCountAtLastCommit ?? 0;
|
|
595
|
+
return state;
|
|
596
|
+
}
|
|
597
|
+
function attributionRestoreStateFromLog(attributionSnapshots, onUpdateState) {
|
|
598
|
+
const state = restoreAttributionStateFromSnapshots(attributionSnapshots);
|
|
599
|
+
onUpdateState(state);
|
|
600
|
+
}
|
|
601
|
+
function incrementPromptCount(attribution, saveSnapshot) {
|
|
602
|
+
const newAttribution = {
|
|
603
|
+
...attribution,
|
|
604
|
+
promptCount: attribution.promptCount + 1
|
|
605
|
+
};
|
|
606
|
+
const snapshot = stateToSnapshotMessage(newAttribution, randomUUID());
|
|
607
|
+
saveSnapshot(snapshot);
|
|
608
|
+
return newAttribution;
|
|
609
|
+
}
|
|
610
|
+
var INTERNAL_MODEL_REPOS, repoClassCache = null, isInternalModelRepo;
|
|
611
|
+
var init_commitAttribution = __esm(() => {
|
|
612
|
+
init_state();
|
|
613
|
+
init_cwd();
|
|
614
|
+
init_debug();
|
|
615
|
+
init_execFileNoThrow();
|
|
616
|
+
init_fsOperations();
|
|
617
|
+
init_generatedFiles();
|
|
618
|
+
init_gitFilesystem();
|
|
619
|
+
init_git();
|
|
620
|
+
init_log();
|
|
621
|
+
init_model();
|
|
622
|
+
INTERNAL_MODEL_REPOS = [
|
|
623
|
+
"github.com:anthropics/claude-cli-internal",
|
|
624
|
+
"github.com/anthropics/claude-cli-internal",
|
|
625
|
+
"github.com:anthropics/anthropic",
|
|
626
|
+
"github.com/anthropics/anthropic",
|
|
627
|
+
"github.com:anthropics/apps",
|
|
628
|
+
"github.com/anthropics/apps",
|
|
629
|
+
"github.com:anthropics/casino",
|
|
630
|
+
"github.com/anthropics/casino",
|
|
631
|
+
"github.com:anthropics/dbt",
|
|
632
|
+
"github.com/anthropics/dbt",
|
|
633
|
+
"github.com:anthropics/dotfiles",
|
|
634
|
+
"github.com/anthropics/dotfiles",
|
|
635
|
+
"github.com:anthropics/terraform-config",
|
|
636
|
+
"github.com/anthropics/terraform-config",
|
|
637
|
+
"github.com:anthropics/hex-export",
|
|
638
|
+
"github.com/anthropics/hex-export",
|
|
639
|
+
"github.com:anthropics/feedback-v2",
|
|
640
|
+
"github.com/anthropics/feedback-v2",
|
|
641
|
+
"github.com:anthropics/labs",
|
|
642
|
+
"github.com/anthropics/labs",
|
|
643
|
+
"github.com:anthropics/argo-rollouts",
|
|
644
|
+
"github.com/anthropics/argo-rollouts",
|
|
645
|
+
"github.com:anthropics/starling-configs",
|
|
646
|
+
"github.com/anthropics/starling-configs",
|
|
647
|
+
"github.com:anthropics/ts-tools",
|
|
648
|
+
"github.com/anthropics/ts-tools",
|
|
649
|
+
"github.com:anthropics/ts-capsules",
|
|
650
|
+
"github.com/anthropics/ts-capsules",
|
|
651
|
+
"github.com:anthropics/feldspar-testing",
|
|
652
|
+
"github.com/anthropics/feldspar-testing",
|
|
653
|
+
"github.com:anthropics/trellis",
|
|
654
|
+
"github.com/anthropics/trellis",
|
|
655
|
+
"github.com:anthropics/claude-for-hiring",
|
|
656
|
+
"github.com/anthropics/claude-for-hiring",
|
|
657
|
+
"github.com:anthropics/forge-web",
|
|
658
|
+
"github.com/anthropics/forge-web",
|
|
659
|
+
"github.com:anthropics/infra-manifests",
|
|
660
|
+
"github.com/anthropics/infra-manifests",
|
|
661
|
+
"github.com:anthropics/mycro_manifests",
|
|
662
|
+
"github.com/anthropics/mycro_manifests",
|
|
663
|
+
"github.com:anthropics/mycro_configs",
|
|
664
|
+
"github.com/anthropics/mycro_configs",
|
|
665
|
+
"github.com:anthropics/mobile-apps",
|
|
666
|
+
"github.com/anthropics/mobile-apps"
|
|
667
|
+
];
|
|
668
|
+
isInternalModelRepo = sequential(async () => {
|
|
669
|
+
if (repoClassCache !== null) {
|
|
670
|
+
return repoClassCache === "internal";
|
|
671
|
+
}
|
|
672
|
+
const cwd = getAttributionRepoRoot();
|
|
673
|
+
const remoteUrl = await getRemoteUrlForDir(cwd);
|
|
674
|
+
if (!remoteUrl) {
|
|
675
|
+
repoClassCache = "none";
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
const isInternal = INTERNAL_MODEL_REPOS.some((repo) => remoteUrl.includes(repo));
|
|
679
|
+
repoClassCache = isInternal ? "internal" : "external";
|
|
680
|
+
return isInternal;
|
|
681
|
+
});
|
|
682
|
+
});
|
|
683
|
+
init_commitAttribution();
|
|
684
|
+
|
|
685
|
+
export {
|
|
686
|
+
trackFileModification,
|
|
687
|
+
trackFileDeletion,
|
|
688
|
+
trackFileCreation,
|
|
689
|
+
trackBulkFileChanges,
|
|
690
|
+
stateToSnapshotMessage,
|
|
691
|
+
sanitizeSurfaceKey,
|
|
692
|
+
sanitizeModelName,
|
|
693
|
+
restoreAttributionStateFromSnapshots,
|
|
694
|
+
normalizeFilePath,
|
|
695
|
+
isInternalModelRepoCached,
|
|
696
|
+
isInternalModelRepo,
|
|
697
|
+
isGitTransientState,
|
|
698
|
+
isFileDeleted,
|
|
699
|
+
incrementPromptCount,
|
|
700
|
+
getStagedFiles,
|
|
701
|
+
getRepoClassCached,
|
|
702
|
+
getGitDiffSize,
|
|
703
|
+
getFileMtime,
|
|
704
|
+
getClientSurface,
|
|
705
|
+
getAttributionRepoRoot,
|
|
706
|
+
expandFilePath,
|
|
707
|
+
createEmptyAttributionState,
|
|
708
|
+
computeContentHash,
|
|
709
|
+
calculateCommitAttribution,
|
|
710
|
+
buildSurfaceKey,
|
|
711
|
+
attributionRestoreStateFromLog
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
export { getRepoClassCached, isInternalModelRepoCached, isInternalModelRepo, sanitizeModelName, createEmptyAttributionState, calculateCommitAttribution, init_commitAttribution };
|