@caspian2026/agent-sdk 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gateway/index.js +98 -22
- package/dist/gateway/worker.js +196 -47
- package/dist/sdk/query.cjs +2 -362
- package/dist/sdk/query.js +2 -367
- package/package.json +4 -6
- package/dist/chunk-05kvhzd7.js +0 -3561
- package/dist/chunk-07069jq1.js +0 -30
- package/dist/chunk-0731m51q.js +0 -8
- package/dist/chunk-08bspa4b.js +0 -673
- package/dist/chunk-0brkf8q8.js +0 -89
- package/dist/chunk-0n843xh7.js +0 -261
- package/dist/chunk-0nbp5jwx.js +0 -8583
- package/dist/chunk-0nj16az9.js +0 -169
- package/dist/chunk-0paqc2yw.js +0 -15
- package/dist/chunk-0q6b50ps.js +0 -111
- package/dist/chunk-0r5bb9j4.js +0 -477
- package/dist/chunk-0rpz1wgn.js +0 -1030
- package/dist/chunk-0t81d427.js +0 -41
- package/dist/chunk-0vaw02wq.js +0 -24
- package/dist/chunk-0vkfrmqm.js +0 -690
- package/dist/chunk-0vp3wfab.js +0 -12
- package/dist/chunk-0vr10742.js +0 -1809
- package/dist/chunk-0xjaqda8.js +0 -1124
- package/dist/chunk-13ehyphg.js +0 -223
- package/dist/chunk-15jsw9bb.js +0 -349
- package/dist/chunk-16m7eyyw.js +0 -1385
- package/dist/chunk-1ae3nt9j.js +0 -31
- package/dist/chunk-1gq4r3v1.js +0 -308
- package/dist/chunk-1gx78081.js +0 -66
- package/dist/chunk-1h2famwb.js +0 -49
- package/dist/chunk-1n546sfg.js +0 -200
- package/dist/chunk-1qg06d60.js +0 -494
- package/dist/chunk-1t0rqstn.js +0 -146
- package/dist/chunk-1z8p2eqd.js +0 -40
- package/dist/chunk-1zjh9cc5.js +0 -266
- package/dist/chunk-20ahkkrb.js +0 -132
- package/dist/chunk-21pbfch8.js +0 -105
- package/dist/chunk-26wtxbdc.js +0 -13870
- package/dist/chunk-2fwze72g.js +0 -24
- package/dist/chunk-2gcbr1c7.js +0 -107
- package/dist/chunk-2grc1yr8.js +0 -654
- package/dist/chunk-2gzv8nrw.js +0 -205
- package/dist/chunk-2r212cvt.js +0 -253
- package/dist/chunk-2s74bt6e.js +0 -317
- package/dist/chunk-2v385w7r.js +0 -7422
- package/dist/chunk-2wtkvpp2.js +0 -167
- package/dist/chunk-31rsspfr.js +0 -418
- package/dist/chunk-3c25bcsw.js +0 -17
- package/dist/chunk-3jm08aaw.js +0 -91
- package/dist/chunk-3mgywd32.js +0 -8
- package/dist/chunk-3nk79af8.js +0 -8
- package/dist/chunk-3v4sk2py.js +0 -101
- package/dist/chunk-3vwft0eh.js +0 -349
- package/dist/chunk-3vy1jt9p.js +0 -1010
- package/dist/chunk-3wvqzq9w.js +0 -92
- package/dist/chunk-3wvv2s8d.js +0 -336
- package/dist/chunk-4060b3s2.js +0 -108
- package/dist/chunk-434e0vh4.js +0 -275
- package/dist/chunk-46dm23zs.js +0 -344
- package/dist/chunk-4bh4qs70.js +0 -209
- package/dist/chunk-4cxzbqws.js +0 -94
- package/dist/chunk-4jm600zv.js +0 -13
- package/dist/chunk-4k9d7gxv.js +0 -118
- package/dist/chunk-4nc3t6ms.js +0 -396
- package/dist/chunk-4pbx3g7s.js +0 -26
- package/dist/chunk-4qhh8bpa.js +0 -54
- package/dist/chunk-4v63px9y.js +0 -133
- package/dist/chunk-4xnnzt3j.js +0 -74
- package/dist/chunk-4zchh01h.js +0 -201
- package/dist/chunk-5216fha8.js +0 -1163
- package/dist/chunk-55raexh7.js +0 -14358
- package/dist/chunk-5bffhf64.js +0 -81
- package/dist/chunk-5ccdsxgy.js +0 -74
- package/dist/chunk-5ddh2hyn.js +0 -91
- package/dist/chunk-5e6ncq5j.js +0 -61
- package/dist/chunk-5ekyhb1w.js +0 -422
- package/dist/chunk-5fy4r8rv.js +0 -52
- package/dist/chunk-5h5kx2jd.js +0 -34
- package/dist/chunk-5mbgdvyz.js +0 -847
- package/dist/chunk-5n1jc02d.js +0 -87
- package/dist/chunk-5pysjah8.js +0 -1543
- package/dist/chunk-5ssfz438.js +0 -323
- package/dist/chunk-5z28bqne.js +0 -6748
- package/dist/chunk-603y0mmg.js +0 -50
- package/dist/chunk-62v5kkff.js +0 -90
- package/dist/chunk-64c1avct.js +0 -13
- package/dist/chunk-64r16v22.js +0 -162
- package/dist/chunk-64smdx4a.js +0 -418
- package/dist/chunk-66zry909.js +0 -11
- package/dist/chunk-68ffk5qa.js +0 -14
- package/dist/chunk-69n11zng.js +0 -436
- package/dist/chunk-6dj5t602.js +0 -341
- package/dist/chunk-6dngjwkh.js +0 -63
- package/dist/chunk-6nsd9606.js +0 -790
- package/dist/chunk-6pkh8frk.js +0 -253
- package/dist/chunk-6qcmt5eb.js +0 -251
- package/dist/chunk-6ww7451s.js +0 -60
- package/dist/chunk-6xgb0kqz.js +0 -90
- package/dist/chunk-72ys9m07.js +0 -121
- package/dist/chunk-741sgvtx.js +0 -121
- package/dist/chunk-7aw745vx.js +0 -40175
- package/dist/chunk-7c8b8cfb.js +0 -219
- package/dist/chunk-7mwt4e1z.js +0 -234
- package/dist/chunk-7sgtxrsc.js +0 -1059
- package/dist/chunk-7wm5s02e.js +0 -216
- package/dist/chunk-7xyswgjh.js +0 -8
- package/dist/chunk-80a197ez.js +0 -1438
- package/dist/chunk-83hfzbx3.js +0 -10
- package/dist/chunk-8akrsgad.js +0 -55
- package/dist/chunk-8g5pe1gr.js +0 -37
- package/dist/chunk-8s07t4k7.js +0 -40
- package/dist/chunk-8yhf030a.js +0 -69
- package/dist/chunk-928tzaa8.js +0 -107
- package/dist/chunk-949pjzj9.js +0 -266
- package/dist/chunk-9aycd4z9.js +0 -490
- package/dist/chunk-9bzqvsz5.js +0 -211
- package/dist/chunk-9q3xfy27.js +0 -460
- package/dist/chunk-9vzg1360.js +0 -153
- package/dist/chunk-9wbh8n1y.js +0 -63
- package/dist/chunk-9x5zgy22.js +0 -12
- package/dist/chunk-9zdj4ypz.js +0 -206
- package/dist/chunk-a0bvcgyd.js +0 -127
- package/dist/chunk-a4m3yr2q.js +0 -117
- package/dist/chunk-a8jd4gee.js +0 -227
- package/dist/chunk-ase86y73.js +0 -15
- package/dist/chunk-atfzpm6r.js +0 -325
- package/dist/chunk-awqsddp2.js +0 -338
- package/dist/chunk-awrgzpk6.js +0 -29
- package/dist/chunk-b0kf00ff.js +0 -637
- package/dist/chunk-b1kcd3ss.js +0 -27
- package/dist/chunk-b4hy21c4.js +0 -140
- package/dist/chunk-b9mkm8mg.js +0 -111
- package/dist/chunk-bdjx14rd.js +0 -594
- package/dist/chunk-bfb41q9h.js +0 -295
- package/dist/chunk-bg4x9ex0.js +0 -21
- package/dist/chunk-bh5zqvyc.js +0 -36
- package/dist/chunk-bn0zv2y2.js +0 -1154
- package/dist/chunk-bn7t681c.js +0 -2669
- package/dist/chunk-br4wgffc.js +0 -393
- package/dist/chunk-brjd9zmk.js +0 -42
- package/dist/chunk-byfawrfx.js +0 -121
- package/dist/chunk-c6sjhj89.js +0 -1284
- package/dist/chunk-c7jwbe76.js +0 -29030
- package/dist/chunk-cdef9v7b.js +0 -27
- package/dist/chunk-cdz5yb0r.js +0 -57
- package/dist/chunk-cevq1787.js +0 -2718
- package/dist/chunk-cgfdkzhb.js +0 -12
- package/dist/chunk-cgqw4x5z.js +0 -155
- package/dist/chunk-cmmmc8e0.js +0 -212
- package/dist/chunk-cnsj3vq2.js +0 -35
- package/dist/chunk-cxrktb5g.js +0 -51
- package/dist/chunk-cyhrb0bk.js +0 -251
- package/dist/chunk-d23rmn8r.js +0 -62
- package/dist/chunk-d4mdda98.js +0 -94
- package/dist/chunk-dcwp94cj.js +0 -152
- package/dist/chunk-ddsjkqs4.js +0 -39
- package/dist/chunk-ddv56j39.js +0 -148
- package/dist/chunk-dfq6pbq7.js +0 -5822
- package/dist/chunk-dfzkwynj.js +0 -5368
- package/dist/chunk-dkgkd8b7.js +0 -516
- package/dist/chunk-dpnmf0pq.js +0 -312
- package/dist/chunk-dygx7vcc.js +0 -226
- package/dist/chunk-e0abab5b.js +0 -445
- package/dist/chunk-e5qhvhjy.js +0 -168
- package/dist/chunk-e60y6r1n.js +0 -20
- package/dist/chunk-e68kgvcq.js +0 -79
- package/dist/chunk-e9w9zc0g.js +0 -392
- package/dist/chunk-ecj9w6tm.js +0 -558
- package/dist/chunk-ehtwnxpg.js +0 -1591
- package/dist/chunk-eqp1rfft.js +0 -17
- package/dist/chunk-etdt1xz3.js +0 -19
- package/dist/chunk-ewadzrm8.js +0 -103
- package/dist/chunk-f03s83vj.js +0 -91
- package/dist/chunk-f3kk0p3s.js +0 -150
- package/dist/chunk-f3pjerx4.js +0 -4265
- package/dist/chunk-f6h5weh6.js +0 -61
- package/dist/chunk-fajg8x36.js +0 -8158
- package/dist/chunk-fbv4apne.js +0 -51
- package/dist/chunk-fcynwjpm.js +0 -1072
- package/dist/chunk-fdvaf6nn.js +0 -20
- package/dist/chunk-feyzykye.js +0 -10
- package/dist/chunk-ff85rwvc.js +0 -180
- package/dist/chunk-fqak69ft.js +0 -458
- package/dist/chunk-fxdkbabd.js +0 -195
- package/dist/chunk-fyc5fepv.js +0 -10
- package/dist/chunk-g78c6ztj.js +0 -89
- package/dist/chunk-g8ee7yza.js +0 -105
- package/dist/chunk-g9f19ttm.js +0 -15
- package/dist/chunk-gcktsbxb.js +0 -77
- package/dist/chunk-gdwdqewd.js +0 -19
- package/dist/chunk-gg55fns0.js +0 -6440
- package/dist/chunk-gnpt1t6q.js +0 -209364
- package/dist/chunk-gsbw2j2b.js +0 -276
- package/dist/chunk-gybt680f.js +0 -9114
- package/dist/chunk-gz1e8y1w.js +0 -33
- package/dist/chunk-gz7vn2gg.js +0 -114
- package/dist/chunk-h0d5eat0.js +0 -101
- package/dist/chunk-h27tjbp3.js +0 -33118
- package/dist/chunk-h2yy8k4c.js +0 -58
- package/dist/chunk-h5acpdqt.js +0 -103
- package/dist/chunk-h63r8vps.js +0 -2840
- package/dist/chunk-h64x5b04.js +0 -860
- package/dist/chunk-h92snc84.js +0 -420
- package/dist/chunk-h9n54swm.js +0 -27
- package/dist/chunk-hafcrnpc.js +0 -145
- package/dist/chunk-hakdhagh.js +0 -16606
- package/dist/chunk-hk4phsaw.js +0 -388
- package/dist/chunk-hph1bmqw.js +0 -65
- package/dist/chunk-hvnztnp3.js +0 -71
- package/dist/chunk-hwfknpxv.js +0 -39
- package/dist/chunk-j2xxd002.js +0 -1052
- package/dist/chunk-j3qbygme.js +0 -105
- package/dist/chunk-j5bth84e.js +0 -97
- package/dist/chunk-j64ga6ta.js +0 -8035
- package/dist/chunk-jbwgyskk.js +0 -385
- package/dist/chunk-jd32zbps.js +0 -15
- package/dist/chunk-jdhkh2bb.js +0 -618
- package/dist/chunk-jeqcwgt7.js +0 -177
- package/dist/chunk-jf75p9ap.js +0 -445
- package/dist/chunk-jgvk0za1.js +0 -260
- package/dist/chunk-jhpaevah.js +0 -565
- package/dist/chunk-jmjwrbwd.js +0 -635
- package/dist/chunk-jpdbfwvq.js +0 -100
- package/dist/chunk-jps4m6sz.js +0 -183
- package/dist/chunk-jwf0s51s.js +0 -867
- package/dist/chunk-jxge4dgh.js +0 -83
- package/dist/chunk-jz71gv95.js +0 -1161
- package/dist/chunk-jzthz1bx.js +0 -15
- package/dist/chunk-jzvd2ycp.js +0 -120
- package/dist/chunk-k0p9w03v.js +0 -4957
- package/dist/chunk-k4dcreh0.js +0 -442
- package/dist/chunk-k7akhwkn.js +0 -151
- package/dist/chunk-k8vp0atq.js +0 -2331
- package/dist/chunk-kgd7gfvk.js +0 -407
- package/dist/chunk-km5ycg1j.js +0 -87
- package/dist/chunk-kvyrxzj8.js +0 -26
- package/dist/chunk-kwekc97v.js +0 -18
- package/dist/chunk-ky1z78ve.js +0 -119
- package/dist/chunk-mcws22k3.js +0 -42
- package/dist/chunk-mjazvyd8.js +0 -528
- package/dist/chunk-mswx2nma.js +0 -103
- package/dist/chunk-mz6a0phh.js +0 -2962
- package/dist/chunk-n2tg12hg.js +0 -374
- package/dist/chunk-n3fv4ya7.js +0 -146
- package/dist/chunk-n4eabmqd.js +0 -93
- package/dist/chunk-n4tx7baq.js +0 -193
- package/dist/chunk-n6g4jbeh.js +0 -289
- package/dist/chunk-n6wzfxf1.js +0 -100
- package/dist/chunk-ndcmqfkv.js +0 -244
- package/dist/chunk-netzwgv1.js +0 -154
- package/dist/chunk-nhcg04jt.js +0 -120
- package/dist/chunk-nhsm3ntd.js +0 -439
- package/dist/chunk-njev89d1.js +0 -2335
- package/dist/chunk-nmgj86tt.js +0 -24
- package/dist/chunk-ns7x6xam.js +0 -22820
- package/dist/chunk-p7vkh4wx.js +0 -15
- package/dist/chunk-p8na2wwp.js +0 -14
- package/dist/chunk-p97fd5af.js +0 -684
- package/dist/chunk-pe3rkfp2.js +0 -74
- package/dist/chunk-pgtnj1mt.js +0 -705
- package/dist/chunk-phmnkw9y.js +0 -283
- package/dist/chunk-pnds7g1q.js +0 -130
- package/dist/chunk-ppwjyveh.js +0 -8
- package/dist/chunk-pqqxdk5f.js +0 -543
- package/dist/chunk-ps49ymvj.js +0 -43
- package/dist/chunk-pwwa7s62.js +0 -11
- package/dist/chunk-q3hfrat2.js +0 -313
- package/dist/chunk-qajrkk97.js +0 -298
- package/dist/chunk-qatfdxvd.js +0 -34
- package/dist/chunk-qb5qcctj.js +0 -206
- package/dist/chunk-qb6k2afy.js +0 -153
- package/dist/chunk-qgk93a75.js +0 -85
- package/dist/chunk-qkczt8cr.js +0 -24
- package/dist/chunk-qn1be1vf.js +0 -267
- package/dist/chunk-qnfx3qtx.js +0 -617
- package/dist/chunk-qnwne2m4.js +0 -87
- package/dist/chunk-qp2qdcda.js +0 -100
- package/dist/chunk-qpp3wwh5.js +0 -697
- package/dist/chunk-r0bx1gc7.js +0 -174
- package/dist/chunk-radnwk8x.js +0 -107
- package/dist/chunk-rkv5jq0y.js +0 -71
- package/dist/chunk-rmbbmd3s.js +0 -68
- package/dist/chunk-rmgbs5an.js +0 -640
- package/dist/chunk-rn0v1hk8.js +0 -34
- package/dist/chunk-rnxctq9p.js +0 -1646
- package/dist/chunk-rtd39n81.js +0 -95
- package/dist/chunk-s8gy4ky9.js +0 -122
- package/dist/chunk-s8kj6ajy.js +0 -32
- package/dist/chunk-sd36yzx8.js +0 -954
- package/dist/chunk-sdenh194.js +0 -121
- package/dist/chunk-sdtqp75c.js +0 -55
- package/dist/chunk-sedbc8ep.js +0 -212
- package/dist/chunk-sfrb15b2.js +0 -321
- package/dist/chunk-sgpmpn90.js +0 -35
- package/dist/chunk-sh02d2qn.js +0 -38
- package/dist/chunk-shd4yhsf.js +0 -32
- package/dist/chunk-shkycj1q.js +0 -178
- package/dist/chunk-sk7h93je.js +0 -153
- package/dist/chunk-sm8g6fsm.js +0 -122
- package/dist/chunk-snrjy66h.js +0 -671
- package/dist/chunk-sq4a0yjh.js +0 -116
- package/dist/chunk-sr3t4thh.js +0 -895
- package/dist/chunk-srj6qnf6.js +0 -107
- package/dist/chunk-sz62n77p.js +0 -155
- package/dist/chunk-szj5wvdy.js +0 -28
- package/dist/chunk-t29a6zb5.js +0 -45
- package/dist/chunk-t2ecddwj.js +0 -731
- package/dist/chunk-t33hmmmm.js +0 -113
- package/dist/chunk-t4khqff1.js +0 -16
- package/dist/chunk-t9p85zff.js +0 -24
- package/dist/chunk-ta3jyvxs.js +0 -984
- package/dist/chunk-tkx5eec8.js +0 -54
- package/dist/chunk-v1kzp02e.js +0 -785
- package/dist/chunk-v4t6dyyh.js +0 -9076
- package/dist/chunk-v78fj8by.js +0 -145
- package/dist/chunk-v8kjswxt.js +0 -61
- package/dist/chunk-v9smspw2.js +0 -4301
- package/dist/chunk-vf612n57.js +0 -472
- package/dist/chunk-vkhrrvfq.js +0 -44
- package/dist/chunk-vt5wm07k.js +0 -74
- package/dist/chunk-vvvrv61g.js +0 -875
- package/dist/chunk-vyjeh50y.js +0 -2149
- package/dist/chunk-w0kxcv73.js +0 -97
- package/dist/chunk-w6m6trzq.js +0 -58
- package/dist/chunk-wa8yn2p0.js +0 -2007
- package/dist/chunk-wb18cecv.js +0 -995
- package/dist/chunk-wgk9sxk7.js +0 -329
- package/dist/chunk-wh0ev1bw.js +0 -111
- package/dist/chunk-wka1647p.js +0 -98
- package/dist/chunk-wnwfwyj4.js +0 -90
- package/dist/chunk-wpdchyy2.js +0 -97
- package/dist/chunk-x3g44n7k.js +0 -114
- package/dist/chunk-x47h283a.js +0 -56
- package/dist/chunk-x6r4v44b.js +0 -8
- package/dist/chunk-x7fdwq3d.js +0 -33
- package/dist/chunk-x8d2ehd7.js +0 -19
- package/dist/chunk-xbeg2hej.js +0 -257
- package/dist/chunk-xeb6075z.js +0 -3435
- package/dist/chunk-xhfmdq1y.js +0 -147
- package/dist/chunk-xhscn33a.js +0 -138
- package/dist/chunk-xv3era3s.js +0 -8
- package/dist/chunk-xz5gbhc3.js +0 -93
- package/dist/chunk-y1784krc.js +0 -19
- package/dist/chunk-y1vyezct.js +0 -123
- package/dist/chunk-y45ecntg.js +0 -942
- package/dist/chunk-y4ca9kqz.js +0 -3830
- package/dist/chunk-y9bhjjdz.js +0 -145
- package/dist/chunk-yb3bxv3w.js +0 -30
- package/dist/chunk-ye2q9gqj.js +0 -332
- package/dist/chunk-yfg3adfq.js +0 -88
- package/dist/chunk-yst0wmgw.js +0 -269
- package/dist/chunk-ywe9dbnz.js +0 -460
- package/dist/chunk-yyex5gsf.js +0 -269
- package/dist/chunk-yz2kzqk5.js +0 -439
- package/dist/chunk-z263ehpg.js +0 -131
- package/dist/chunk-z2dp53wn.js +0 -17
- package/dist/chunk-zaq348h2.js +0 -281
- package/dist/chunk-zr0qx9q0.js +0 -642
- package/dist/chunk-zxh62ved.js +0 -31
- package/dist/chunk-zy5vn8sd.js +0 -329
- package/dist/chunk-zzm33q8x.js +0 -8
- package/dist/cli.js +0 -91
package/dist/chunk-jeqcwgt7.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
editFileInEditor,
|
|
4
|
-
init_promptEditor
|
|
5
|
-
} from "./chunk-1zjh9cc5.js";
|
|
6
|
-
import {
|
|
7
|
-
DEFAULT_BINDINGS,
|
|
8
|
-
NON_REBINDABLE,
|
|
9
|
-
getKeybindingsPath,
|
|
10
|
-
init_defaultBindings,
|
|
11
|
-
init_loadUserBindings,
|
|
12
|
-
init_reservedShortcuts,
|
|
13
|
-
isKeybindingCustomizationEnabled,
|
|
14
|
-
normalizeKeyForComparison
|
|
15
|
-
} from "./chunk-gnpt1t6q.js";
|
|
16
|
-
import"./chunk-mcws22k3.js";
|
|
17
|
-
import"./chunk-jzthz1bx.js";
|
|
18
|
-
import"./chunk-f6h5weh6.js";
|
|
19
|
-
import"./chunk-hwfknpxv.js";
|
|
20
|
-
import"./chunk-1gx78081.js";
|
|
21
|
-
import"./chunk-ehtwnxpg.js";
|
|
22
|
-
import"./chunk-e68kgvcq.js";
|
|
23
|
-
import"./chunk-p97fd5af.js";
|
|
24
|
-
import"./chunk-x47h283a.js";
|
|
25
|
-
import"./chunk-wb18cecv.js";
|
|
26
|
-
import"./chunk-2gzv8nrw.js";
|
|
27
|
-
import"./chunk-e0abab5b.js";
|
|
28
|
-
import"./chunk-cgfdkzhb.js";
|
|
29
|
-
import"./chunk-4k9d7gxv.js";
|
|
30
|
-
import"./chunk-j5bth84e.js";
|
|
31
|
-
import"./chunk-t2ecddwj.js";
|
|
32
|
-
import"./chunk-68ffk5qa.js";
|
|
33
|
-
import"./chunk-ps49ymvj.js";
|
|
34
|
-
import"./chunk-dkgkd8b7.js";
|
|
35
|
-
import"./chunk-5pysjah8.js";
|
|
36
|
-
import"./chunk-pgtnj1mt.js";
|
|
37
|
-
import"./chunk-hph1bmqw.js";
|
|
38
|
-
import"./chunk-p7vkh4wx.js";
|
|
39
|
-
import"./chunk-y9bhjjdz.js";
|
|
40
|
-
import"./chunk-dcwp94cj.js";
|
|
41
|
-
import"./chunk-tkx5eec8.js";
|
|
42
|
-
import"./chunk-dfzkwynj.js";
|
|
43
|
-
import"./chunk-xeb6075z.js";
|
|
44
|
-
import"./chunk-fcynwjpm.js";
|
|
45
|
-
import"./chunk-v4t6dyyh.js";
|
|
46
|
-
import"./chunk-zy5vn8sd.js";
|
|
47
|
-
import"./chunk-v8kjswxt.js";
|
|
48
|
-
import"./chunk-dfq6pbq7.js";
|
|
49
|
-
import"./chunk-rnxctq9p.js";
|
|
50
|
-
import"./chunk-pqqxdk5f.js";
|
|
51
|
-
import"./chunk-6nsd9606.js";
|
|
52
|
-
import"./chunk-64c1avct.js";
|
|
53
|
-
import"./chunk-8g5pe1gr.js";
|
|
54
|
-
import"./chunk-4pbx3g7s.js";
|
|
55
|
-
import"./chunk-26wtxbdc.js";
|
|
56
|
-
import"./chunk-6dngjwkh.js";
|
|
57
|
-
import"./chunk-4jm600zv.js";
|
|
58
|
-
import"./chunk-s8gy4ky9.js";
|
|
59
|
-
import"./chunk-cxrktb5g.js";
|
|
60
|
-
import"./chunk-3c25bcsw.js";
|
|
61
|
-
import"./chunk-5ekyhb1w.js";
|
|
62
|
-
import"./chunk-fqak69ft.js";
|
|
63
|
-
import"./chunk-cdz5yb0r.js";
|
|
64
|
-
import"./chunk-c7jwbe76.js";
|
|
65
|
-
import"./chunk-0vkfrmqm.js";
|
|
66
|
-
import"./chunk-7sgtxrsc.js";
|
|
67
|
-
import"./chunk-0xjaqda8.js";
|
|
68
|
-
import"./chunk-x8d2ehd7.js";
|
|
69
|
-
import"./chunk-byfawrfx.js";
|
|
70
|
-
import"./chunk-3vy1jt9p.js";
|
|
71
|
-
import"./chunk-vkhrrvfq.js";
|
|
72
|
-
import"./chunk-qnfx3qtx.js";
|
|
73
|
-
import"./chunk-64r16v22.js";
|
|
74
|
-
import"./chunk-s8kj6ajy.js";
|
|
75
|
-
import"./chunk-8yhf030a.js";
|
|
76
|
-
import"./chunk-zxh62ved.js";
|
|
77
|
-
import"./chunk-5z28bqne.js";
|
|
78
|
-
import"./chunk-qajrkk97.js";
|
|
79
|
-
import {
|
|
80
|
-
getErrnoCode,
|
|
81
|
-
init_errors,
|
|
82
|
-
init_slowOperations,
|
|
83
|
-
jsonStringify
|
|
84
|
-
} from "./chunk-gg55fns0.js";
|
|
85
|
-
import"./chunk-5n1jc02d.js";
|
|
86
|
-
import"./chunk-fbv4apne.js";
|
|
87
|
-
import"./chunk-k8vp0atq.js";
|
|
88
|
-
import"./chunk-vf612n57.js";
|
|
89
|
-
import"./chunk-07069jq1.js";
|
|
90
|
-
import"./chunk-d4mdda98.js";
|
|
91
|
-
import"./chunk-55raexh7.js";
|
|
92
|
-
import"./chunk-v9smspw2.js";
|
|
93
|
-
import"./chunk-v1kzp02e.js";
|
|
94
|
-
import"./chunk-7wm5s02e.js";
|
|
95
|
-
import"./chunk-b0kf00ff.js";
|
|
96
|
-
import"./chunk-netzwgv1.js";
|
|
97
|
-
import {
|
|
98
|
-
__esm
|
|
99
|
-
} from "./chunk-qp2qdcda.js";
|
|
100
|
-
|
|
101
|
-
// src/keybindings/template.ts
|
|
102
|
-
function filterReservedShortcuts(blocks) {
|
|
103
|
-
const reservedKeys = new Set(NON_REBINDABLE.map((r) => normalizeKeyForComparison(r.key)));
|
|
104
|
-
return blocks.map((block) => {
|
|
105
|
-
const filteredBindings = {};
|
|
106
|
-
for (const [key, action] of Object.entries(block.bindings)) {
|
|
107
|
-
if (!reservedKeys.has(normalizeKeyForComparison(key))) {
|
|
108
|
-
filteredBindings[key] = action;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return { context: block.context, bindings: filteredBindings };
|
|
112
|
-
}).filter((block) => Object.keys(block.bindings).length > 0);
|
|
113
|
-
}
|
|
114
|
-
function generateKeybindingsTemplate() {
|
|
115
|
-
const bindings = filterReservedShortcuts(DEFAULT_BINDINGS);
|
|
116
|
-
const config = {
|
|
117
|
-
$schema: "https://www.schemastore.org/claude-code-keybindings.json",
|
|
118
|
-
$docs: "https://code.claude.com/docs/en/keybindings",
|
|
119
|
-
bindings
|
|
120
|
-
};
|
|
121
|
-
return jsonStringify(config, null, 2) + `
|
|
122
|
-
`;
|
|
123
|
-
}
|
|
124
|
-
var init_template = __esm(() => {
|
|
125
|
-
init_slowOperations();
|
|
126
|
-
init_defaultBindings();
|
|
127
|
-
init_reservedShortcuts();
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
// src/commands/keybindings/keybindings.ts
|
|
131
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
132
|
-
import { dirname } from "path";
|
|
133
|
-
async function call() {
|
|
134
|
-
if (!isKeybindingCustomizationEnabled()) {
|
|
135
|
-
return {
|
|
136
|
-
type: "text",
|
|
137
|
-
value: "Keybinding customization is not enabled. This feature is currently in preview."
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
const keybindingsPath = getKeybindingsPath();
|
|
141
|
-
let fileExists = false;
|
|
142
|
-
await mkdir(dirname(keybindingsPath), { recursive: true });
|
|
143
|
-
try {
|
|
144
|
-
await writeFile(keybindingsPath, generateKeybindingsTemplate(), {
|
|
145
|
-
encoding: "utf-8",
|
|
146
|
-
flag: "wx"
|
|
147
|
-
});
|
|
148
|
-
} catch (e) {
|
|
149
|
-
if (getErrnoCode(e) === "EEXIST") {
|
|
150
|
-
fileExists = true;
|
|
151
|
-
} else {
|
|
152
|
-
throw e;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
const result = await editFileInEditor(keybindingsPath);
|
|
156
|
-
if (result.error) {
|
|
157
|
-
return {
|
|
158
|
-
type: "text",
|
|
159
|
-
value: `${fileExists ? "Opened" : "Created"} ${keybindingsPath}. Could not open in editor: ${result.error}`
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
type: "text",
|
|
164
|
-
value: fileExists ? `Opened ${keybindingsPath} in your editor.` : `Created ${keybindingsPath} with template. Opened in your editor.`
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
var init_keybindings = __esm(() => {
|
|
168
|
-
init_loadUserBindings();
|
|
169
|
-
init_template();
|
|
170
|
-
init_errors();
|
|
171
|
-
init_promptEditor();
|
|
172
|
-
});
|
|
173
|
-
init_keybindings();
|
|
174
|
-
|
|
175
|
-
export {
|
|
176
|
-
call
|
|
177
|
-
};
|
package/dist/chunk-jf75p9ap.js
DELETED
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
diffWordsWithSpace,
|
|
4
|
-
expectColorDiff,
|
|
5
|
-
init_colorDiff,
|
|
6
|
-
init_fullscreen,
|
|
7
|
-
init_libesm,
|
|
8
|
-
init_sliceAnsi,
|
|
9
|
-
init_useSettings,
|
|
10
|
-
isFullscreenEnvEnabled,
|
|
11
|
-
sliceAnsi,
|
|
12
|
-
useSettings
|
|
13
|
-
} from "./chunk-gnpt1t6q.js";
|
|
14
|
-
import {
|
|
15
|
-
NoSelect,
|
|
16
|
-
RawAnsi,
|
|
17
|
-
ThemedBox_default,
|
|
18
|
-
ThemedText,
|
|
19
|
-
init_src,
|
|
20
|
-
stringWidth,
|
|
21
|
-
useTheme,
|
|
22
|
-
wrapText
|
|
23
|
-
} from "./chunk-c7jwbe76.js";
|
|
24
|
-
import {
|
|
25
|
-
require_jsx_dev_runtime,
|
|
26
|
-
require_react
|
|
27
|
-
} from "./chunk-7sgtxrsc.js";
|
|
28
|
-
import {
|
|
29
|
-
__esm,
|
|
30
|
-
__toESM
|
|
31
|
-
} from "./chunk-qp2qdcda.js";
|
|
32
|
-
|
|
33
|
-
// src/components/StructuredDiff/Fallback.tsx
|
|
34
|
-
function StructuredDiffFallback({
|
|
35
|
-
patch,
|
|
36
|
-
dim,
|
|
37
|
-
width
|
|
38
|
-
}) {
|
|
39
|
-
const [theme] = useTheme();
|
|
40
|
-
const diff = import_react.useMemo(() => formatDiff(patch.lines, patch.oldStart, width, dim, theme), [patch.lines, patch.oldStart, width, dim, theme]);
|
|
41
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
42
|
-
flexDirection: "column",
|
|
43
|
-
flexGrow: 1,
|
|
44
|
-
children: diff.map((node, i) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
45
|
-
children: node
|
|
46
|
-
}, i, false, undefined, this))
|
|
47
|
-
}, undefined, false, undefined, this);
|
|
48
|
-
}
|
|
49
|
-
function transformLinesToObjects(lines) {
|
|
50
|
-
return lines.map((code) => {
|
|
51
|
-
if (code.startsWith("+")) {
|
|
52
|
-
return {
|
|
53
|
-
code: code.slice(1),
|
|
54
|
-
i: 0,
|
|
55
|
-
type: "add",
|
|
56
|
-
originalCode: code.slice(1)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
if (code.startsWith("-")) {
|
|
60
|
-
return {
|
|
61
|
-
code: code.slice(1),
|
|
62
|
-
i: 0,
|
|
63
|
-
type: "remove",
|
|
64
|
-
originalCode: code.slice(1)
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
code: code.slice(1),
|
|
69
|
-
i: 0,
|
|
70
|
-
type: "nochange",
|
|
71
|
-
originalCode: code.slice(1)
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function processAdjacentLines(lineObjects) {
|
|
76
|
-
const processedLines = [];
|
|
77
|
-
let i = 0;
|
|
78
|
-
while (i < lineObjects.length) {
|
|
79
|
-
const current = lineObjects[i];
|
|
80
|
-
if (!current) {
|
|
81
|
-
i++;
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
if (current.type === "remove") {
|
|
85
|
-
const removeLines = [current];
|
|
86
|
-
let j = i + 1;
|
|
87
|
-
while (j < lineObjects.length && lineObjects[j]?.type === "remove") {
|
|
88
|
-
const line = lineObjects[j];
|
|
89
|
-
if (line) {
|
|
90
|
-
removeLines.push(line);
|
|
91
|
-
}
|
|
92
|
-
j++;
|
|
93
|
-
}
|
|
94
|
-
const addLines = [];
|
|
95
|
-
while (j < lineObjects.length && lineObjects[j]?.type === "add") {
|
|
96
|
-
const line = lineObjects[j];
|
|
97
|
-
if (line) {
|
|
98
|
-
addLines.push(line);
|
|
99
|
-
}
|
|
100
|
-
j++;
|
|
101
|
-
}
|
|
102
|
-
if (removeLines.length > 0 && addLines.length > 0) {
|
|
103
|
-
const pairCount = Math.min(removeLines.length, addLines.length);
|
|
104
|
-
for (let k = 0;k < pairCount; k++) {
|
|
105
|
-
const removeLine = removeLines[k];
|
|
106
|
-
const addLine = addLines[k];
|
|
107
|
-
if (removeLine && addLine) {
|
|
108
|
-
removeLine.wordDiff = true;
|
|
109
|
-
addLine.wordDiff = true;
|
|
110
|
-
removeLine.matchedLine = addLine;
|
|
111
|
-
addLine.matchedLine = removeLine;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
processedLines.push(...removeLines.filter(Boolean));
|
|
115
|
-
processedLines.push(...addLines.filter(Boolean));
|
|
116
|
-
i = j;
|
|
117
|
-
} else {
|
|
118
|
-
processedLines.push(current);
|
|
119
|
-
i++;
|
|
120
|
-
}
|
|
121
|
-
} else {
|
|
122
|
-
processedLines.push(current);
|
|
123
|
-
i++;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return processedLines;
|
|
127
|
-
}
|
|
128
|
-
function calculateWordDiffs(oldText, newText) {
|
|
129
|
-
const result = diffWordsWithSpace(oldText, newText, { ignoreCase: false });
|
|
130
|
-
return result;
|
|
131
|
-
}
|
|
132
|
-
function generateWordDiffElements(item, width, maxWidth, dim, overrideTheme) {
|
|
133
|
-
const { type, i, wordDiff, matchedLine, originalCode } = item;
|
|
134
|
-
if (!wordDiff || !matchedLine) {
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
const removedLineText = type === "remove" ? originalCode : matchedLine.originalCode;
|
|
138
|
-
const addedLineText = type === "remove" ? matchedLine.originalCode : originalCode;
|
|
139
|
-
const wordDiffs = calculateWordDiffs(removedLineText, addedLineText);
|
|
140
|
-
const totalLength = removedLineText.length + addedLineText.length;
|
|
141
|
-
const changedLength = wordDiffs.filter((part) => part.added || part.removed).reduce((sum, part) => sum + part.value.length, 0);
|
|
142
|
-
const changeRatio = changedLength / totalLength;
|
|
143
|
-
if (changeRatio > CHANGE_THRESHOLD || dim) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
const diffPrefix = type === "add" ? "+" : "-";
|
|
147
|
-
const diffPrefixWidth = diffPrefix.length;
|
|
148
|
-
const availableContentWidth = Math.max(1, width - maxWidth - 1 - diffPrefixWidth);
|
|
149
|
-
const wrappedLines = [];
|
|
150
|
-
let currentLine = [];
|
|
151
|
-
let currentLineWidth = 0;
|
|
152
|
-
wordDiffs.forEach((part, partIndex) => {
|
|
153
|
-
let shouldShow = false;
|
|
154
|
-
let partBgColor;
|
|
155
|
-
if (type === "add") {
|
|
156
|
-
if (part.added) {
|
|
157
|
-
shouldShow = true;
|
|
158
|
-
partBgColor = "diffAddedWord";
|
|
159
|
-
} else if (!part.removed) {
|
|
160
|
-
shouldShow = true;
|
|
161
|
-
}
|
|
162
|
-
} else if (type === "remove") {
|
|
163
|
-
if (part.removed) {
|
|
164
|
-
shouldShow = true;
|
|
165
|
-
partBgColor = "diffRemovedWord";
|
|
166
|
-
} else if (!part.added) {
|
|
167
|
-
shouldShow = true;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (!shouldShow)
|
|
171
|
-
return;
|
|
172
|
-
const partWrapped = wrapText(part.value, availableContentWidth, "wrap");
|
|
173
|
-
const partLines = partWrapped.split(`
|
|
174
|
-
`);
|
|
175
|
-
partLines.forEach((partLine, lineIdx) => {
|
|
176
|
-
if (!partLine)
|
|
177
|
-
return;
|
|
178
|
-
if (lineIdx > 0 || currentLineWidth + stringWidth(partLine) > availableContentWidth) {
|
|
179
|
-
if (currentLine.length > 0) {
|
|
180
|
-
wrappedLines.push({
|
|
181
|
-
content: [...currentLine],
|
|
182
|
-
contentWidth: currentLineWidth
|
|
183
|
-
});
|
|
184
|
-
currentLine = [];
|
|
185
|
-
currentLineWidth = 0;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
currentLine.push(/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
189
|
-
backgroundColor: partBgColor,
|
|
190
|
-
children: partLine
|
|
191
|
-
}, `part-${partIndex}-${lineIdx}`, false, undefined, this));
|
|
192
|
-
currentLineWidth += stringWidth(partLine);
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
if (currentLine.length > 0) {
|
|
196
|
-
wrappedLines.push({ content: currentLine, contentWidth: currentLineWidth });
|
|
197
|
-
}
|
|
198
|
-
return wrappedLines.map(({ content, contentWidth }, lineIndex) => {
|
|
199
|
-
const key = `${type}-${i}-${lineIndex}`;
|
|
200
|
-
const lineBgColor = type === "add" ? dim ? "diffAddedDimmed" : "diffAdded" : dim ? "diffRemovedDimmed" : "diffRemoved";
|
|
201
|
-
const lineNum = lineIndex === 0 ? i : undefined;
|
|
202
|
-
const lineNumStr = (lineNum !== undefined ? lineNum.toString().padStart(maxWidth) : " ".repeat(maxWidth)) + " ";
|
|
203
|
-
const usedWidth = lineNumStr.length + diffPrefixWidth + contentWidth;
|
|
204
|
-
const padding = Math.max(0, width - usedWidth);
|
|
205
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
206
|
-
flexDirection: "row",
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(NoSelect, {
|
|
209
|
-
fromLeftEdge: true,
|
|
210
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
211
|
-
color: overrideTheme ? "text" : undefined,
|
|
212
|
-
backgroundColor: lineBgColor,
|
|
213
|
-
dimColor: dim,
|
|
214
|
-
children: [
|
|
215
|
-
lineNumStr,
|
|
216
|
-
diffPrefix
|
|
217
|
-
]
|
|
218
|
-
}, undefined, true, undefined, this)
|
|
219
|
-
}, undefined, false, undefined, this),
|
|
220
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
221
|
-
color: overrideTheme ? "text" : undefined,
|
|
222
|
-
backgroundColor: lineBgColor,
|
|
223
|
-
dimColor: dim,
|
|
224
|
-
children: [
|
|
225
|
-
content,
|
|
226
|
-
" ".repeat(padding)
|
|
227
|
-
]
|
|
228
|
-
}, undefined, true, undefined, this)
|
|
229
|
-
]
|
|
230
|
-
}, key, true, undefined, this);
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
function formatDiff(lines, startingLineNumber, width, dim, overrideTheme) {
|
|
234
|
-
const safeWidth = Math.max(1, Math.floor(width));
|
|
235
|
-
const lineObjects = transformLinesToObjects(lines);
|
|
236
|
-
const processedLines = processAdjacentLines(lineObjects);
|
|
237
|
-
const ls = numberDiffLines(processedLines, startingLineNumber);
|
|
238
|
-
const maxLineNumber = Math.max(...ls.map(({ i }) => i), 0);
|
|
239
|
-
const maxWidth = Math.max(maxLineNumber.toString().length + 1, 0);
|
|
240
|
-
return ls.flatMap((item) => {
|
|
241
|
-
const { type, code, i, wordDiff, matchedLine } = item;
|
|
242
|
-
if (wordDiff && matchedLine) {
|
|
243
|
-
const wordDiffElements = generateWordDiffElements(item, safeWidth, maxWidth, dim, overrideTheme);
|
|
244
|
-
if (wordDiffElements !== null) {
|
|
245
|
-
return wordDiffElements;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
const diffPrefixWidth = 2;
|
|
249
|
-
const availableContentWidth = Math.max(1, safeWidth - maxWidth - 1 - diffPrefixWidth);
|
|
250
|
-
const wrappedText = wrapText(code, availableContentWidth, "wrap");
|
|
251
|
-
const wrappedLines = wrappedText.split(`
|
|
252
|
-
`);
|
|
253
|
-
return wrappedLines.map((line, lineIndex) => {
|
|
254
|
-
const key = `${type}-${i}-${lineIndex}`;
|
|
255
|
-
const lineNum = lineIndex === 0 ? i : undefined;
|
|
256
|
-
const lineNumStr = (lineNum !== undefined ? lineNum.toString().padStart(maxWidth) : " ".repeat(maxWidth)) + " ";
|
|
257
|
-
const sigil = type === "add" ? "+" : type === "remove" ? "-" : " ";
|
|
258
|
-
const contentWidth = lineNumStr.length + 1 + stringWidth(line);
|
|
259
|
-
const padding = Math.max(0, safeWidth - contentWidth);
|
|
260
|
-
const bgColor = type === "add" ? dim ? "diffAddedDimmed" : "diffAdded" : type === "remove" ? dim ? "diffRemovedDimmed" : "diffRemoved" : undefined;
|
|
261
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
262
|
-
flexDirection: "row",
|
|
263
|
-
children: [
|
|
264
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(NoSelect, {
|
|
265
|
-
fromLeftEdge: true,
|
|
266
|
-
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
267
|
-
color: overrideTheme ? "text" : undefined,
|
|
268
|
-
backgroundColor: bgColor,
|
|
269
|
-
dimColor: dim || type === "nochange",
|
|
270
|
-
children: [
|
|
271
|
-
lineNumStr,
|
|
272
|
-
sigil
|
|
273
|
-
]
|
|
274
|
-
}, undefined, true, undefined, this)
|
|
275
|
-
}, undefined, false, undefined, this),
|
|
276
|
-
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
277
|
-
color: overrideTheme ? "text" : undefined,
|
|
278
|
-
backgroundColor: bgColor,
|
|
279
|
-
dimColor: dim,
|
|
280
|
-
children: [
|
|
281
|
-
line,
|
|
282
|
-
" ".repeat(padding)
|
|
283
|
-
]
|
|
284
|
-
}, undefined, true, undefined, this)
|
|
285
|
-
]
|
|
286
|
-
}, key, true, undefined, this);
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
function numberDiffLines(diff, startLine) {
|
|
291
|
-
let i = startLine;
|
|
292
|
-
const result = [];
|
|
293
|
-
const queue = [...diff];
|
|
294
|
-
while (queue.length > 0) {
|
|
295
|
-
const current = queue.shift();
|
|
296
|
-
const { code, type, originalCode, wordDiff, matchedLine } = current;
|
|
297
|
-
const line = {
|
|
298
|
-
code,
|
|
299
|
-
type,
|
|
300
|
-
i,
|
|
301
|
-
originalCode,
|
|
302
|
-
wordDiff,
|
|
303
|
-
matchedLine
|
|
304
|
-
};
|
|
305
|
-
switch (type) {
|
|
306
|
-
case "nochange":
|
|
307
|
-
i++;
|
|
308
|
-
result.push(line);
|
|
309
|
-
break;
|
|
310
|
-
case "add":
|
|
311
|
-
i++;
|
|
312
|
-
result.push(line);
|
|
313
|
-
break;
|
|
314
|
-
case "remove": {
|
|
315
|
-
result.push(line);
|
|
316
|
-
let numRemoved = 0;
|
|
317
|
-
while (queue[0]?.type === "remove") {
|
|
318
|
-
i++;
|
|
319
|
-
const current2 = queue.shift();
|
|
320
|
-
const { code: code2, type: type2, originalCode: originalCode2, wordDiff: wordDiff2, matchedLine: matchedLine2 } = current2;
|
|
321
|
-
const line2 = {
|
|
322
|
-
code: code2,
|
|
323
|
-
type: type2,
|
|
324
|
-
i,
|
|
325
|
-
originalCode: originalCode2,
|
|
326
|
-
wordDiff: wordDiff2,
|
|
327
|
-
matchedLine: matchedLine2
|
|
328
|
-
};
|
|
329
|
-
result.push(line2);
|
|
330
|
-
numRemoved++;
|
|
331
|
-
}
|
|
332
|
-
i -= numRemoved;
|
|
333
|
-
break;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return result;
|
|
338
|
-
}
|
|
339
|
-
var import_react, jsx_dev_runtime, CHANGE_THRESHOLD = 0.4;
|
|
340
|
-
var init_Fallback = __esm(() => {
|
|
341
|
-
init_libesm();
|
|
342
|
-
init_src();
|
|
343
|
-
import_react = __toESM(require_react(), 1);
|
|
344
|
-
jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
// src/components/StructuredDiff.tsx
|
|
348
|
-
function computeGutterWidth(patch) {
|
|
349
|
-
const maxLineNumber = Math.max(patch.oldStart + patch.oldLines - 1, patch.newStart + patch.newLines - 1, 1);
|
|
350
|
-
return maxLineNumber.toString().length + 3;
|
|
351
|
-
}
|
|
352
|
-
function renderColorDiff(patch, firstLine, filePath, fileContent, theme, width, dim, splitGutter) {
|
|
353
|
-
const ColorDiff = expectColorDiff();
|
|
354
|
-
if (!ColorDiff)
|
|
355
|
-
return null;
|
|
356
|
-
const rawGutterWidth = splitGutter ? computeGutterWidth(patch) : 0;
|
|
357
|
-
const gutterWidth = rawGutterWidth > 0 && rawGutterWidth < width ? rawGutterWidth : 0;
|
|
358
|
-
const key = `${theme}|${width}|${dim ? 1 : 0}|${gutterWidth}|${firstLine ?? ""}|${filePath}`;
|
|
359
|
-
let perHunk = RENDER_CACHE.get(patch);
|
|
360
|
-
const hit = perHunk?.get(key);
|
|
361
|
-
if (hit)
|
|
362
|
-
return hit;
|
|
363
|
-
const lines = new ColorDiff(patch, firstLine, filePath, fileContent).render(theme, width, dim);
|
|
364
|
-
if (lines === null)
|
|
365
|
-
return null;
|
|
366
|
-
let gutters = null;
|
|
367
|
-
let contents = null;
|
|
368
|
-
if (gutterWidth > 0) {
|
|
369
|
-
gutters = lines.map((l) => sliceAnsi(l, 0, gutterWidth));
|
|
370
|
-
contents = lines.map((l) => sliceAnsi(l, gutterWidth));
|
|
371
|
-
}
|
|
372
|
-
const entry = { lines, gutterWidth, gutters, contents };
|
|
373
|
-
if (!perHunk) {
|
|
374
|
-
perHunk = new Map;
|
|
375
|
-
RENDER_CACHE.set(patch, perHunk);
|
|
376
|
-
}
|
|
377
|
-
if (perHunk.size >= 4)
|
|
378
|
-
perHunk.clear();
|
|
379
|
-
perHunk.set(key, entry);
|
|
380
|
-
return entry;
|
|
381
|
-
}
|
|
382
|
-
var import_react2, jsx_dev_runtime2, RENDER_CACHE, StructuredDiff;
|
|
383
|
-
var init_StructuredDiff = __esm(() => {
|
|
384
|
-
init_useSettings();
|
|
385
|
-
init_src();
|
|
386
|
-
init_fullscreen();
|
|
387
|
-
init_sliceAnsi();
|
|
388
|
-
init_colorDiff();
|
|
389
|
-
init_Fallback();
|
|
390
|
-
import_react2 = __toESM(require_react(), 1);
|
|
391
|
-
jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
392
|
-
RENDER_CACHE = new WeakMap;
|
|
393
|
-
StructuredDiff = import_react2.memo(function StructuredDiff2({
|
|
394
|
-
patch,
|
|
395
|
-
dim,
|
|
396
|
-
filePath,
|
|
397
|
-
firstLine,
|
|
398
|
-
fileContent,
|
|
399
|
-
width,
|
|
400
|
-
skipHighlighting = false
|
|
401
|
-
}) {
|
|
402
|
-
const [theme] = useTheme();
|
|
403
|
-
const settings = useSettings();
|
|
404
|
-
const syntaxHighlightingDisabled = settings.syntaxHighlightingDisabled ?? false;
|
|
405
|
-
const safeWidth = Math.max(1, Math.floor(width));
|
|
406
|
-
const splitGutter = isFullscreenEnvEnabled();
|
|
407
|
-
const cached = skipHighlighting || syntaxHighlightingDisabled ? null : renderColorDiff(patch, firstLine, filePath, fileContent ?? null, theme, safeWidth, dim, splitGutter);
|
|
408
|
-
if (!cached) {
|
|
409
|
-
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
410
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(StructuredDiffFallback, {
|
|
411
|
-
patch,
|
|
412
|
-
dim,
|
|
413
|
-
width
|
|
414
|
-
}, undefined, false, undefined, this)
|
|
415
|
-
}, undefined, false, undefined, this);
|
|
416
|
-
}
|
|
417
|
-
const { lines, gutterWidth, gutters, contents } = cached;
|
|
418
|
-
if (gutterWidth > 0 && gutters && contents) {
|
|
419
|
-
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
420
|
-
flexDirection: "row",
|
|
421
|
-
children: [
|
|
422
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(NoSelect, {
|
|
423
|
-
fromLeftEdge: true,
|
|
424
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(RawAnsi, {
|
|
425
|
-
lines: gutters,
|
|
426
|
-
width: gutterWidth
|
|
427
|
-
}, undefined, false, undefined, this)
|
|
428
|
-
}, undefined, false, undefined, this),
|
|
429
|
-
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(RawAnsi, {
|
|
430
|
-
lines: contents,
|
|
431
|
-
width: safeWidth - gutterWidth
|
|
432
|
-
}, undefined, false, undefined, this)
|
|
433
|
-
]
|
|
434
|
-
}, undefined, true, undefined, this);
|
|
435
|
-
}
|
|
436
|
-
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
437
|
-
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(RawAnsi, {
|
|
438
|
-
lines,
|
|
439
|
-
width: safeWidth
|
|
440
|
-
}, undefined, false, undefined, this)
|
|
441
|
-
}, undefined, false, undefined, this);
|
|
442
|
-
});
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
export { StructuredDiff, init_StructuredDiff };
|