@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/gateway/worker.js
CHANGED
|
@@ -53934,7 +53934,7 @@ var init_auth = __esm(() => {
|
|
|
53934
53934
|
|
|
53935
53935
|
// src/utils/userAgent.ts
|
|
53936
53936
|
function getClaudeCodeUserAgent() {
|
|
53937
|
-
return `claude-code/${"0.0.
|
|
53937
|
+
return `claude-code/${"0.0.26"}`;
|
|
53938
53938
|
}
|
|
53939
53939
|
|
|
53940
53940
|
// src/utils/workloadContext.ts
|
|
@@ -53953,7 +53953,7 @@ function getUserAgent() {
|
|
|
53953
53953
|
const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
|
|
53954
53954
|
const workload = getWorkload();
|
|
53955
53955
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
53956
|
-
return `claude-cli/${"0.0.
|
|
53956
|
+
return `claude-cli/${"0.0.26"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
53957
53957
|
}
|
|
53958
53958
|
function getMCPUserAgent() {
|
|
53959
53959
|
const parts = [];
|
|
@@ -53967,7 +53967,7 @@ function getMCPUserAgent() {
|
|
|
53967
53967
|
parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
|
|
53968
53968
|
}
|
|
53969
53969
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
53970
|
-
return `claude-code/${"0.0.
|
|
53970
|
+
return `claude-code/${"0.0.26"}${suffix}`;
|
|
53971
53971
|
}
|
|
53972
53972
|
function getWebFetchUserAgent() {
|
|
53973
53973
|
return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
|
|
@@ -54041,7 +54041,7 @@ var init_user = __esm(() => {
|
|
|
54041
54041
|
deviceId,
|
|
54042
54042
|
sessionId: getSessionId(),
|
|
54043
54043
|
email: getEmail(),
|
|
54044
|
-
appVersion: "0.0.
|
|
54044
|
+
appVersion: "0.0.26",
|
|
54045
54045
|
platform: getHostPlatformForAnalytics(),
|
|
54046
54046
|
organizationUuid,
|
|
54047
54047
|
accountUuid,
|
|
@@ -88407,7 +88407,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
88407
88407
|
if (baseUrl && !baseUrl.includes("anthropic.com")) {
|
|
88408
88408
|
return "";
|
|
88409
88409
|
}
|
|
88410
|
-
const version2 = `${"0.0.
|
|
88410
|
+
const version2 = `${"0.0.26"}.${fingerprint}`;
|
|
88411
88411
|
const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
|
|
88412
88412
|
const cch = "";
|
|
88413
88413
|
const workload = getWorkload();
|
|
@@ -116159,7 +116159,7 @@ var init_metadata = __esm(() => {
|
|
|
116159
116159
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
116160
116160
|
WHITESPACE_REGEX = /\s+/;
|
|
116161
116161
|
getVersionBase = memoize_default(() => {
|
|
116162
|
-
const match = "0.0.
|
|
116162
|
+
const match = "0.0.26".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
116163
116163
|
return match ? match[0] : undefined;
|
|
116164
116164
|
});
|
|
116165
116165
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -116199,9 +116199,9 @@ var init_metadata = __esm(() => {
|
|
|
116199
116199
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
116200
116200
|
isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
|
|
116201
116201
|
isClaudeAiAuth: false,
|
|
116202
|
-
version: "0.0.
|
|
116202
|
+
version: "0.0.26",
|
|
116203
116203
|
versionBase: getVersionBase(),
|
|
116204
|
-
buildTime: "2026-08-
|
|
116204
|
+
buildTime: "2026-08-28T09:09:40.635Z",
|
|
116205
116205
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
116206
116206
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
116207
116207
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -268995,7 +268995,7 @@ function getTelemetryAttributes() {
|
|
|
268995
268995
|
attributes["session.id"] = sessionId;
|
|
268996
268996
|
}
|
|
268997
268997
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
268998
|
-
attributes["app.version"] = "0.0.
|
|
268998
|
+
attributes["app.version"] = "0.0.26";
|
|
268999
268999
|
}
|
|
269000
269000
|
const oauthAccount = getOauthAccountInfo2();
|
|
269001
269001
|
if (oauthAccount) {
|
|
@@ -311575,7 +311575,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
311575
311575
|
}
|
|
311576
311576
|
function computeFingerprintFromMessages(messages) {
|
|
311577
311577
|
const firstMessageText = extractFirstMessageText(messages);
|
|
311578
|
-
return computeFingerprint(firstMessageText, "0.0.
|
|
311578
|
+
return computeFingerprint(firstMessageText, "0.0.26");
|
|
311579
311579
|
}
|
|
311580
311580
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
311581
311581
|
var init_fingerprint = () => {};
|
|
@@ -311764,7 +311764,7 @@ async function sideQuery(opts) {
|
|
|
311764
311764
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
311765
311765
|
}
|
|
311766
311766
|
const messageText = extractFirstUserMessageText(messages);
|
|
311767
|
-
const fingerprint = computeFingerprint(messageText, "0.0.
|
|
311767
|
+
const fingerprint = computeFingerprint(messageText, "0.0.26");
|
|
311768
311768
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
311769
311769
|
const systemBlocks = [
|
|
311770
311770
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -313235,7 +313235,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
313235
313235
|
const client2 = new Client({
|
|
313236
313236
|
name: "claude-code",
|
|
313237
313237
|
title: "Claude Code",
|
|
313238
|
-
version: "0.0.
|
|
313238
|
+
version: "0.0.26",
|
|
313239
313239
|
description: "Anthropic's agentic coding tool",
|
|
313240
313240
|
websiteUrl: PRODUCT_URL
|
|
313241
313241
|
}, {
|
|
@@ -313566,7 +313566,7 @@ var init_client7 = __esm(() => {
|
|
|
313566
313566
|
const client2 = new Client({
|
|
313567
313567
|
name: "claude-code",
|
|
313568
313568
|
title: "Claude Code",
|
|
313569
|
-
version: "0.0.
|
|
313569
|
+
version: "0.0.26",
|
|
313570
313570
|
description: "Anthropic's agentic coding tool",
|
|
313571
313571
|
websiteUrl: PRODUCT_URL
|
|
313572
313572
|
}, {
|
|
@@ -391397,7 +391397,7 @@ async function* queryLoop(params, consumedCommandUuids) {
|
|
|
391397
391397
|
compacted: true,
|
|
391398
391398
|
turnId: deps.uuid(),
|
|
391399
391399
|
turnCounter: 0,
|
|
391400
|
-
consecutiveFailures: 0
|
|
391400
|
+
consecutiveFailures: consecutiveFailures ?? 0
|
|
391401
391401
|
};
|
|
391402
391402
|
const postCompactMessages = buildPostCompactMessages(compactionResult);
|
|
391403
391403
|
for (const message of postCompactMessages) {
|
|
@@ -392224,7 +392224,7 @@ function getAnthropicEnvMetadata() {
|
|
|
392224
392224
|
function getBuildAgeMinutes() {
|
|
392225
392225
|
if (false)
|
|
392226
392226
|
;
|
|
392227
|
-
const buildTime = new Date("2026-08-
|
|
392227
|
+
const buildTime = new Date("2026-08-28T09:09:40.635Z").getTime();
|
|
392228
392228
|
if (isNaN(buildTime))
|
|
392229
392229
|
return;
|
|
392230
392230
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -394465,8 +394465,7 @@ var init_sessionMemoryCompact = __esm(() => {
|
|
|
394465
394465
|
});
|
|
394466
394466
|
|
|
394467
394467
|
// src/services/compact/autoCompact.ts
|
|
394468
|
-
function
|
|
394469
|
-
const reservedTokensForSummary = Math.min(getMaxOutputTokensForModel(model), MAX_OUTPUT_TOKENS_FOR_SUMMARY);
|
|
394468
|
+
function getBaseContextWindow(model) {
|
|
394470
394469
|
let contextWindow = getContextWindowForModel(model, getSdkBetas());
|
|
394471
394470
|
const autoCompactWindow = process.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW;
|
|
394472
394471
|
if (autoCompactWindow) {
|
|
@@ -394475,11 +394474,27 @@ function getEffectiveContextWindowSize(model) {
|
|
|
394475
394474
|
contextWindow = Math.min(contextWindow, parsed);
|
|
394476
394475
|
}
|
|
394477
394476
|
}
|
|
394478
|
-
return contextWindow
|
|
394477
|
+
return contextWindow;
|
|
394478
|
+
}
|
|
394479
|
+
function getEffectiveContextWindowSize(model) {
|
|
394480
|
+
const baseWindow = getBaseContextWindow(model);
|
|
394481
|
+
const reservedTokensForSummary = Math.min(getMaxOutputTokensForModel(model), MAX_OUTPUT_TOKENS_FOR_SUMMARY, Math.round(baseWindow * 0.1));
|
|
394482
|
+
return baseWindow - reservedTokensForSummary;
|
|
394479
394483
|
}
|
|
394480
394484
|
function getAutoCompactThreshold(model) {
|
|
394485
|
+
const baseWindow = getBaseContextWindow(model);
|
|
394481
394486
|
const effectiveContextWindow = getEffectiveContextWindowSize(model);
|
|
394482
|
-
const
|
|
394487
|
+
const limitOverride = process.env.CLAUDE_CODE_AUTOCOMPACT_TOKEN_LIMIT;
|
|
394488
|
+
if (limitOverride) {
|
|
394489
|
+
const parsed = parseInt(limitOverride, 10);
|
|
394490
|
+
if (!isNaN(parsed) && parsed > 0) {
|
|
394491
|
+
return Math.min(parsed, baseWindow - 1000);
|
|
394492
|
+
}
|
|
394493
|
+
}
|
|
394494
|
+
const deductionCap = Math.round(baseWindow * 0.1);
|
|
394495
|
+
const reservedTokensForSummary = Math.min(getMaxOutputTokensForModel(model), MAX_OUTPUT_TOKENS_FOR_SUMMARY, deductionCap);
|
|
394496
|
+
const bufferTokens = Math.min(AUTOCOMPACT_BUFFER_TOKENS, deductionCap);
|
|
394497
|
+
const autocompactThreshold = baseWindow - reservedTokensForSummary - bufferTokens;
|
|
394483
394498
|
const envPercent = process.env.CLAUDE_AUTOCOMPACT_PCT_OVERRIDE;
|
|
394484
394499
|
if (envPercent) {
|
|
394485
394500
|
const parsed = parseFloat(envPercent);
|
|
@@ -394490,6 +394505,9 @@ function getAutoCompactThreshold(model) {
|
|
|
394490
394505
|
}
|
|
394491
394506
|
return autocompactThreshold;
|
|
394492
394507
|
}
|
|
394508
|
+
function isIneffectiveCompaction(result, threshold) {
|
|
394509
|
+
return result.truePostCompactTokenCount !== undefined && result.truePostCompactTokenCount >= threshold;
|
|
394510
|
+
}
|
|
394493
394511
|
function calculateTokenWarningState(tokenUsage, model) {
|
|
394494
394512
|
const autoCompactThreshold = getAutoCompactThreshold(model);
|
|
394495
394513
|
const threshold = isAutoCompactEnabled() ? autoCompactThreshold : getEffectiveContextWindowSize(model);
|
|
@@ -394574,10 +394592,15 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
|
|
|
394574
394592
|
const compactionResult = await compactConversation(messages, toolUseContext, cacheSafeParams, true, undefined, true, recompactionInfo);
|
|
394575
394593
|
setLastSummarizedMessageId(undefined);
|
|
394576
394594
|
runPostCompactCleanup(querySource);
|
|
394595
|
+
const ineffective = isIneffectiveCompaction(compactionResult, recompactionInfo.autoCompactThreshold);
|
|
394596
|
+
const nextFailures = ineffective ? (tracking?.consecutiveFailures ?? 0) + 1 : 0;
|
|
394597
|
+
if (ineffective && nextFailures >= MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES) {
|
|
394598
|
+
logForDebugging(`autocompact: circuit breaker tripped — compaction succeeded but context (${compactionResult.truePostCompactTokenCount}) remains >= threshold (${recompactionInfo.autoCompactThreshold}); skipping future attempts this session`, { level: "warn" });
|
|
394599
|
+
}
|
|
394577
394600
|
return {
|
|
394578
394601
|
wasCompacted: true,
|
|
394579
394602
|
compactionResult,
|
|
394580
|
-
consecutiveFailures:
|
|
394603
|
+
consecutiveFailures: nextFailures
|
|
394581
394604
|
};
|
|
394582
394605
|
} catch (error50) {
|
|
394583
394606
|
if (!hasExactErrorMessage(error50, ERROR_MESSAGE_USER_ABORT)) {
|
|
@@ -414302,7 +414325,7 @@ function Feedback({
|
|
|
414302
414325
|
platform: env3.platform,
|
|
414303
414326
|
gitRepo: envInfo.isGit,
|
|
414304
414327
|
terminal: env3.terminal,
|
|
414305
|
-
version: "0.0.
|
|
414328
|
+
version: "0.0.26",
|
|
414306
414329
|
transcript: normalizeMessagesForAPI(messages),
|
|
414307
414330
|
errors: sanitizedErrors,
|
|
414308
414331
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -414487,7 +414510,7 @@ function Feedback({
|
|
|
414487
414510
|
", ",
|
|
414488
414511
|
env3.terminal,
|
|
414489
414512
|
", v",
|
|
414490
|
-
"0.0.
|
|
414513
|
+
"0.0.26"
|
|
414491
414514
|
]
|
|
414492
414515
|
}, undefined, true, undefined, this)
|
|
414493
414516
|
]
|
|
@@ -414593,7 +414616,7 @@ ${sanitizedDescription}
|
|
|
414593
414616
|
` + `**Environment Info**
|
|
414594
414617
|
` + `- Platform: ${env3.platform}
|
|
414595
414618
|
` + `- Terminal: ${env3.terminal}
|
|
414596
|
-
` + `- Version: ${"0.0.
|
|
414619
|
+
` + `- Version: ${"0.0.26"}
|
|
414597
414620
|
` + `- Feedback ID: ${feedbackId}
|
|
414598
414621
|
` + `
|
|
414599
414622
|
**Errors**
|
|
@@ -417559,7 +417582,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
417559
417582
|
}
|
|
417560
417583
|
async function getDoctorDiagnostic() {
|
|
417561
417584
|
const installationType = await getCurrentInstallationType();
|
|
417562
|
-
const version2 = typeof MACRO !== "undefined" ? "0.0.
|
|
417585
|
+
const version2 = typeof MACRO !== "undefined" ? "0.0.26" : "unknown";
|
|
417563
417586
|
const installationPath = await getInstallationPath();
|
|
417564
417587
|
const invokedBinary = getInvokedBinary();
|
|
417565
417588
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -418348,7 +418371,7 @@ function buildPrimarySection() {
|
|
|
418348
418371
|
children: "/rename to add a name"
|
|
418349
418372
|
}, undefined, false, undefined, this);
|
|
418350
418373
|
return [
|
|
418351
|
-
{ label: "Version", value: "0.0.
|
|
418374
|
+
{ label: "Version", value: "0.0.26" },
|
|
418352
418375
|
{ label: "Session name", value: nameValue },
|
|
418353
418376
|
{ label: "Session ID", value: sessionId },
|
|
418354
418377
|
{ label: "cwd", value: getCwd() },
|
|
@@ -421429,7 +421452,7 @@ function Config({
|
|
|
421429
421452
|
}
|
|
421430
421453
|
}, undefined, false, undefined, this)
|
|
421431
421454
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime173.jsxDEV(ChannelDowngradeDialog, {
|
|
421432
|
-
currentVersion: "0.0.
|
|
421455
|
+
currentVersion: "0.0.26",
|
|
421433
421456
|
onChoice: (choice) => {
|
|
421434
421457
|
setShowSubmenu(null);
|
|
421435
421458
|
setTabsHidden(false);
|
|
@@ -421441,7 +421464,7 @@ function Config({
|
|
|
421441
421464
|
autoUpdatesChannel: "stable"
|
|
421442
421465
|
};
|
|
421443
421466
|
if (choice === "stay") {
|
|
421444
|
-
newSettings.minimumVersion = "0.0.
|
|
421467
|
+
newSettings.minimumVersion = "0.0.26";
|
|
421445
421468
|
}
|
|
421446
421469
|
updateSettingsForSource("userSettings", newSettings);
|
|
421447
421470
|
setSettingsData((prev) => ({
|
|
@@ -426756,7 +426779,7 @@ function HelpV2({ onClose, commands }) {
|
|
|
426756
426779
|
color: "professionalBlue",
|
|
426757
426780
|
children: [
|
|
426758
426781
|
/* @__PURE__ */ jsx_dev_runtime199.jsxDEV(Tabs, {
|
|
426759
|
-
title: process.env.USER_TYPE === "ant" ? "/help" : `Claude Code v${"0.0.
|
|
426782
|
+
title: process.env.USER_TYPE === "ant" ? "/help" : `Claude Code v${"0.0.26"}`,
|
|
426760
426783
|
color: "professionalBlue",
|
|
426761
426784
|
defaultTab: "general",
|
|
426762
426785
|
children: tabs
|
|
@@ -439174,7 +439197,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
439174
439197
|
return [];
|
|
439175
439198
|
}
|
|
439176
439199
|
}
|
|
439177
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "0.0.
|
|
439200
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "0.0.26") {
|
|
439178
439201
|
if (process.env.USER_TYPE === "ant") {
|
|
439179
439202
|
const changelog = "";
|
|
439180
439203
|
if (changelog) {
|
|
@@ -441209,7 +441232,7 @@ function getRecentActivitySync() {
|
|
|
441209
441232
|
return cachedActivity;
|
|
441210
441233
|
}
|
|
441211
441234
|
function getLogoDisplayData() {
|
|
441212
|
-
const version2 = process.env.DEMO_VERSION ?? "0.0.
|
|
441235
|
+
const version2 = process.env.DEMO_VERSION ?? "0.0.26";
|
|
441213
441236
|
const serverUrl = getDirectConnectServerUrl();
|
|
441214
441237
|
const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
|
|
441215
441238
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -442117,13 +442140,13 @@ function LogoV2() {
|
|
|
442117
442140
|
const { hasReleaseNotes } = checkForReleaseNotesSync(config5.lastReleaseNotesSeen);
|
|
442118
442141
|
import_react159.useEffect(() => {
|
|
442119
442142
|
const currentConfig = getGlobalConfig();
|
|
442120
|
-
if (currentConfig.lastReleaseNotesSeen === "0.0.
|
|
442143
|
+
if (currentConfig.lastReleaseNotesSeen === "0.0.26") {
|
|
442121
442144
|
return;
|
|
442122
442145
|
}
|
|
442123
442146
|
saveGlobalConfig((current) => {
|
|
442124
|
-
if (current.lastReleaseNotesSeen === "0.0.
|
|
442147
|
+
if (current.lastReleaseNotesSeen === "0.0.26")
|
|
442125
442148
|
return current;
|
|
442126
|
-
return { ...current, lastReleaseNotesSeen: "0.0.
|
|
442149
|
+
return { ...current, lastReleaseNotesSeen: "0.0.26" };
|
|
442127
442150
|
});
|
|
442128
442151
|
if (showOnboarding) {
|
|
442129
442152
|
incrementProjectOnboardingSeenCount();
|
|
@@ -458835,7 +458858,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
458835
458858
|
smapsRollup,
|
|
458836
458859
|
platform: process.platform,
|
|
458837
458860
|
nodeVersion: process.version,
|
|
458838
|
-
ccVersion: "0.0.
|
|
458861
|
+
ccVersion: "0.0.26"
|
|
458839
458862
|
};
|
|
458840
458863
|
}
|
|
458841
458864
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -459097,7 +459120,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
459097
459120
|
var call54 = async () => {
|
|
459098
459121
|
return {
|
|
459099
459122
|
type: "text",
|
|
459100
|
-
value: `${"0.0.
|
|
459123
|
+
value: `${"0.0.26"} (built ${"2026-08-28T09:09:40.635Z"})`
|
|
459101
459124
|
};
|
|
459102
459125
|
}, version2, version_default;
|
|
459103
459126
|
var init_version = __esm(() => {
|
|
@@ -466366,7 +466389,7 @@ function generateHtmlReport(data, insights) {
|
|
|
466366
466389
|
</html>`;
|
|
466367
466390
|
}
|
|
466368
466391
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
466369
|
-
const version3 = typeof MACRO !== "undefined" ? "0.0.
|
|
466392
|
+
const version3 = typeof MACRO !== "undefined" ? "0.0.26" : "unknown";
|
|
466370
466393
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
466371
466394
|
const facets_summary = {
|
|
466372
466395
|
total: facets.size,
|
|
@@ -470493,7 +470516,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
470493
470516
|
init_settings2();
|
|
470494
470517
|
init_slowOperations();
|
|
470495
470518
|
init_uuid();
|
|
470496
|
-
VERSION6 = typeof MACRO !== "undefined" ? "0.0.
|
|
470519
|
+
VERSION6 = typeof MACRO !== "undefined" ? "0.0.26" : "unknown";
|
|
470497
470520
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
470498
470521
|
SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
470499
470522
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -471687,7 +471710,7 @@ var init_filesystem = __esm(() => {
|
|
|
471687
471710
|
});
|
|
471688
471711
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
471689
471712
|
const nonce = randomBytes16(16).toString("hex");
|
|
471690
|
-
return join128(getClaudeTempDir(), "bundled-skills", "0.0.
|
|
471713
|
+
return join128(getClaudeTempDir(), "bundled-skills", "0.0.26", nonce);
|
|
471691
471714
|
});
|
|
471692
471715
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
471693
471716
|
});
|
|
@@ -481917,7 +481940,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
481917
481940
|
slash_commands: inputs.commands.filter((c6) => c6.userInvocable !== false).map((c6) => c6.name),
|
|
481918
481941
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
481919
481942
|
betas: getSdkBetas(),
|
|
481920
|
-
claude_code_version: "0.0.
|
|
481943
|
+
claude_code_version: "0.0.26",
|
|
481921
481944
|
output_style: outputStyle2,
|
|
481922
481945
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
481923
481946
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -483145,6 +483168,54 @@ function getDefaultCompletionMode(permissionMode) {
|
|
|
483145
483168
|
return "disabled";
|
|
483146
483169
|
}
|
|
483147
483170
|
|
|
483171
|
+
class MergedMessageQueue {
|
|
483172
|
+
items = [];
|
|
483173
|
+
waiters = [];
|
|
483174
|
+
finished = false;
|
|
483175
|
+
failure = undefined;
|
|
483176
|
+
enqueue(message) {
|
|
483177
|
+
if (this.finished)
|
|
483178
|
+
return;
|
|
483179
|
+
const waiter = this.waiters.shift();
|
|
483180
|
+
if (waiter) {
|
|
483181
|
+
waiter.resolve({ value: message, done: false });
|
|
483182
|
+
} else {
|
|
483183
|
+
this.items.push(message);
|
|
483184
|
+
}
|
|
483185
|
+
}
|
|
483186
|
+
finish() {
|
|
483187
|
+
this.finished = true;
|
|
483188
|
+
while (this.waiters.length > 0) {
|
|
483189
|
+
if (this.items.length > 0) {
|
|
483190
|
+
this.waiters.shift().resolve({ value: this.items.shift(), done: false });
|
|
483191
|
+
} else {
|
|
483192
|
+
this.waiters.shift().resolve({ value: undefined, done: true });
|
|
483193
|
+
}
|
|
483194
|
+
}
|
|
483195
|
+
}
|
|
483196
|
+
fail(error50) {
|
|
483197
|
+
this.failure = error50;
|
|
483198
|
+
this.finished = true;
|
|
483199
|
+
for (const waiter of this.waiters.splice(0)) {
|
|
483200
|
+
waiter.reject(error50);
|
|
483201
|
+
}
|
|
483202
|
+
}
|
|
483203
|
+
next() {
|
|
483204
|
+
if (this.items.length > 0) {
|
|
483205
|
+
return Promise.resolve({ value: this.items.shift(), done: false });
|
|
483206
|
+
}
|
|
483207
|
+
if (this.failure !== undefined) {
|
|
483208
|
+
return Promise.reject(this.failure);
|
|
483209
|
+
}
|
|
483210
|
+
if (this.finished) {
|
|
483211
|
+
return Promise.resolve({ value: undefined, done: true });
|
|
483212
|
+
}
|
|
483213
|
+
return new Promise((resolve43, reject2) => {
|
|
483214
|
+
this.waiters.push({ resolve: resolve43, reject: reject2 });
|
|
483215
|
+
});
|
|
483216
|
+
}
|
|
483217
|
+
}
|
|
483218
|
+
|
|
483148
483219
|
class Session {
|
|
483149
483220
|
sessionId;
|
|
483150
483221
|
engine;
|
|
@@ -483158,6 +483229,7 @@ class Session {
|
|
|
483158
483229
|
createdAt = Date.now();
|
|
483159
483230
|
lastPromptAt;
|
|
483160
483231
|
maxBudgetUsd;
|
|
483232
|
+
activeStatusQueue = null;
|
|
483161
483233
|
constructor(config5 = {}, permissionHandler = {}, extraOptions) {
|
|
483162
483234
|
const mcpClients = extraOptions?.mcpClients ?? [];
|
|
483163
483235
|
this.mcpClients = mcpClients;
|
|
@@ -483201,7 +483273,16 @@ class Session {
|
|
|
483201
483273
|
includePartialMessages: config5.includePartialMessages ?? true,
|
|
483202
483274
|
initialMessages: extraOptions?.initialMessages,
|
|
483203
483275
|
autoModeController: this.autoModeController,
|
|
483204
|
-
taskCompletionController: this.completionController
|
|
483276
|
+
taskCompletionController: this.completionController,
|
|
483277
|
+
setSDKStatus: (status2) => {
|
|
483278
|
+
this.activeStatusQueue?.enqueue({
|
|
483279
|
+
type: "system",
|
|
483280
|
+
subtype: "status",
|
|
483281
|
+
status: status2,
|
|
483282
|
+
session_id: this.sessionId,
|
|
483283
|
+
uuid: crypto.randomUUID()
|
|
483284
|
+
});
|
|
483285
|
+
}
|
|
483205
483286
|
});
|
|
483206
483287
|
this.sm.transition("idle", "bootstrap complete");
|
|
483207
483288
|
}
|
|
@@ -483227,7 +483308,31 @@ class Session {
|
|
|
483227
483308
|
});
|
|
483228
483309
|
}
|
|
483229
483310
|
try {
|
|
483230
|
-
|
|
483311
|
+
const queue2 = new MergedMessageQueue;
|
|
483312
|
+
this.activeStatusQueue = queue2;
|
|
483313
|
+
const engineIterator = this.engine.submitMessage(input);
|
|
483314
|
+
const producer = (async () => {
|
|
483315
|
+
try {
|
|
483316
|
+
for await (const message of engineIterator) {
|
|
483317
|
+
queue2.enqueue(message);
|
|
483318
|
+
}
|
|
483319
|
+
queue2.finish();
|
|
483320
|
+
} catch (error50) {
|
|
483321
|
+
queue2.fail(error50);
|
|
483322
|
+
}
|
|
483323
|
+
})();
|
|
483324
|
+
try {
|
|
483325
|
+
while (true) {
|
|
483326
|
+
const result = await queue2.next();
|
|
483327
|
+
if (result.done)
|
|
483328
|
+
break;
|
|
483329
|
+
yield result.value;
|
|
483330
|
+
}
|
|
483331
|
+
} finally {
|
|
483332
|
+
this.activeStatusQueue = null;
|
|
483333
|
+
await engineIterator.return?.();
|
|
483334
|
+
await producer;
|
|
483335
|
+
}
|
|
483231
483336
|
} finally {
|
|
483232
483337
|
if (this.autoModeController.getRun()?.status === "running") {
|
|
483233
483338
|
this.autoModeController.cancel("Prompt stream closed before auto mode reached a terminal result");
|
|
@@ -483308,6 +483413,8 @@ class Session {
|
|
|
483308
483413
|
changes.push(`mcpClients: ${config5.mcpClients.length} clients`);
|
|
483309
483414
|
}
|
|
483310
483415
|
if (config5.additionalDirectories) {
|
|
483416
|
+
const { setAdditionalDirectoriesForClaudeMd: setAdditionalDirectoriesForClaudeMd2 } = await Promise.resolve().then(() => (init_state(), exports_state));
|
|
483417
|
+
setAdditionalDirectoriesForClaudeMd2(config5.additionalDirectories);
|
|
483311
483418
|
changes.push(`additionalDirectories: ${config5.additionalDirectories.length} dirs`);
|
|
483312
483419
|
}
|
|
483313
483420
|
if (config5.env) {
|
|
@@ -483427,11 +483534,6 @@ class Session {
|
|
|
483427
483534
|
getStateHistory() {
|
|
483428
483535
|
return this.sm.history;
|
|
483429
483536
|
}
|
|
483430
|
-
static resume(sessionId, config5, permissionHandler) {
|
|
483431
|
-
const session2 = new Session(config5 ?? {}, permissionHandler ?? {});
|
|
483432
|
-
session2.sessionId = sessionId;
|
|
483433
|
-
return session2;
|
|
483434
|
-
}
|
|
483435
483537
|
static async list(options) {
|
|
483436
483538
|
const { listSessionsImpl: listSessionsImpl2 } = await Promise.resolve().then(() => (init_listSessionsImpl(), exports_listSessionsImpl));
|
|
483437
483539
|
return listSessionsImpl2(options);
|
|
@@ -483444,6 +483546,7 @@ class Session {
|
|
|
483444
483546
|
}
|
|
483445
483547
|
|
|
483446
483548
|
// src/entrypoints/gateway/worker.ts
|
|
483549
|
+
init_envUtils();
|
|
483447
483550
|
var config5 = workerData;
|
|
483448
483551
|
var { sessionKey } = config5;
|
|
483449
483552
|
var PERMISSION_TIMEOUT_MS = 60000;
|
|
@@ -483477,12 +483580,39 @@ async function connectMcpServers(mcpServers) {
|
|
|
483477
483580
|
const { clients, tools: mcpTools } = await prefetchAllMcpResources2(mcpConfigs);
|
|
483478
483581
|
return { clients, mcpTools };
|
|
483479
483582
|
}
|
|
483583
|
+
var ANTHROPIC_PROVIDER_ENV_KEYS = [
|
|
483584
|
+
"ANTHROPIC_API_KEY",
|
|
483585
|
+
"ANTHROPIC_AUTH_TOKEN",
|
|
483586
|
+
"ANTHROPIC_BASE_URL",
|
|
483587
|
+
"ANTHROPIC_MODEL",
|
|
483588
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL",
|
|
483589
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL",
|
|
483590
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL",
|
|
483591
|
+
"ANTHROPIC_CUSTOM_HEADERS"
|
|
483592
|
+
];
|
|
483593
|
+
var OPENAI_PROVIDER_ENV_KEYS = [
|
|
483594
|
+
"CLAUDE_CODE_USE_OPENAI",
|
|
483595
|
+
"OPENAI_API_KEY",
|
|
483596
|
+
"OPENAI_BASE_URL",
|
|
483597
|
+
"OPENAI_MODEL",
|
|
483598
|
+
"OPENAI_DEFAULT_OPUS_MODEL",
|
|
483599
|
+
"OPENAI_DEFAULT_SONNET_MODEL",
|
|
483600
|
+
"OPENAI_DEFAULT_HAIKU_MODEL",
|
|
483601
|
+
"OPENAI_CUSTOM_HEADERS"
|
|
483602
|
+
];
|
|
483603
|
+
function sanitizeProviderEnv() {
|
|
483604
|
+
const keysToRemove = isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) ? ANTHROPIC_PROVIDER_ENV_KEYS : OPENAI_PROVIDER_ENV_KEYS;
|
|
483605
|
+
for (const name of keysToRemove) {
|
|
483606
|
+
delete process.env[name];
|
|
483607
|
+
}
|
|
483608
|
+
}
|
|
483480
483609
|
async function start() {
|
|
483481
483610
|
process.stderr.write(`[Worker ${sessionKey}] Starting worker
|
|
483482
483611
|
`);
|
|
483483
483612
|
if (config5.env) {
|
|
483484
483613
|
Object.assign(process.env, config5.env);
|
|
483485
483614
|
}
|
|
483615
|
+
sanitizeProviderEnv();
|
|
483486
483616
|
const { enableConfigs: enableConfigs2 } = await Promise.resolve().then(() => (init_config(), exports_config));
|
|
483487
483617
|
enableConfigs2();
|
|
483488
483618
|
let initialMessages;
|
|
@@ -483516,13 +483646,18 @@ async function start() {
|
|
|
483516
483646
|
}
|
|
483517
483647
|
let mcpClients = [];
|
|
483518
483648
|
let initialMcpTools = [];
|
|
483649
|
+
let mcpDegraded;
|
|
483519
483650
|
try {
|
|
483520
483651
|
const result = await connectMcpServers(config5.session.mcpServers);
|
|
483521
483652
|
mcpClients = result.clients;
|
|
483522
483653
|
initialMcpTools = result.mcpTools;
|
|
483654
|
+
const failed = mcpClients.filter((c6) => c6.type === "failed").map((c6) => c6.name);
|
|
483655
|
+
if (failed.length > 0)
|
|
483656
|
+
mcpDegraded = failed;
|
|
483523
483657
|
} catch (err2) {
|
|
483524
483658
|
process.stderr.write(`[Worker ${sessionKey}] Initial MCP connection failed, continuing without MCP: ${err2 instanceof Error ? err2.message : String(err2)}
|
|
483525
483659
|
`);
|
|
483660
|
+
mcpDegraded = Object.keys(config5.session.mcpServers ?? {});
|
|
483526
483661
|
}
|
|
483527
483662
|
const sessionExtraOptions = {};
|
|
483528
483663
|
if (mcpClients.length > 0)
|
|
@@ -483567,7 +483702,8 @@ async function start() {
|
|
|
483567
483702
|
type: "ready",
|
|
483568
483703
|
session_key: sessionKey,
|
|
483569
483704
|
session_id: session2.sessionId,
|
|
483570
|
-
state_session_id: getSessionId3()
|
|
483705
|
+
state_session_id: getSessionId3(),
|
|
483706
|
+
...mcpDegraded?.length ? { mcp_degraded: mcpDegraded } : {}
|
|
483571
483707
|
});
|
|
483572
483708
|
parentPort.on("message", (msg) => {
|
|
483573
483709
|
switch (msg.type) {
|
|
@@ -483665,14 +483801,17 @@ async function handleUpdate(updateConfig2) {
|
|
|
483665
483801
|
}
|
|
483666
483802
|
logState("session.update starting");
|
|
483667
483803
|
const changes = [];
|
|
483804
|
+
let newMcpClients = null;
|
|
483668
483805
|
try {
|
|
483669
483806
|
if (updateConfig2.env) {
|
|
483670
483807
|
Object.assign(process.env, updateConfig2.env);
|
|
483808
|
+
sanitizeProviderEnv();
|
|
483671
483809
|
changes.push("env");
|
|
483672
483810
|
}
|
|
483673
483811
|
const batchUpdate = {};
|
|
483674
483812
|
if (updateConfig2.mcp_servers !== undefined) {
|
|
483675
483813
|
const { clients, mcpTools } = await connectMcpServers(updateConfig2.mcp_servers);
|
|
483814
|
+
newMcpClients = clients;
|
|
483676
483815
|
batchUpdate.mcpClients = clients;
|
|
483677
483816
|
batchUpdate.mcpTools = mcpTools;
|
|
483678
483817
|
changes.push(`mcpServers: ${clients.length} clients`);
|
|
@@ -483726,6 +483865,15 @@ async function handleUpdate(updateConfig2) {
|
|
|
483726
483865
|
const errorMsg = err2 instanceof Error ? err2.message : String(err2);
|
|
483727
483866
|
process.stderr.write(`[Worker ${sessionKey}] Update failed: ${errorMsg}
|
|
483728
483867
|
`);
|
|
483868
|
+
if (newMcpClients) {
|
|
483869
|
+
for (const client2 of newMcpClients) {
|
|
483870
|
+
if (client2.type === "connected" && client2.cleanup) {
|
|
483871
|
+
try {
|
|
483872
|
+
await client2.cleanup();
|
|
483873
|
+
} catch {}
|
|
483874
|
+
}
|
|
483875
|
+
}
|
|
483876
|
+
}
|
|
483729
483877
|
send({ type: "error", session_key: sessionKey, error: errorMsg });
|
|
483730
483878
|
} finally {
|
|
483731
483879
|
logState("update done");
|
|
@@ -483763,6 +483911,7 @@ start().catch((err2) => {
|
|
|
483763
483911
|
session_key: sessionKey,
|
|
483764
483912
|
error: err2 instanceof Error ? err2.message : String(err2)
|
|
483765
483913
|
});
|
|
483914
|
+
setTimeout(() => process.exit(1), 100);
|
|
483766
483915
|
});
|
|
483767
483916
|
process.on("uncaughtException", (err2) => {
|
|
483768
483917
|
const errorDetails = err2 instanceof Error ? err2.stack || err2.message : String(err2);
|