@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.
Files changed (362) hide show
  1. package/dist/gateway/index.js +98 -22
  2. package/dist/gateway/worker.js +196 -47
  3. package/dist/sdk/query.cjs +2 -362
  4. package/dist/sdk/query.js +2 -367
  5. package/package.json +4 -6
  6. package/dist/chunk-05kvhzd7.js +0 -3561
  7. package/dist/chunk-07069jq1.js +0 -30
  8. package/dist/chunk-0731m51q.js +0 -8
  9. package/dist/chunk-08bspa4b.js +0 -673
  10. package/dist/chunk-0brkf8q8.js +0 -89
  11. package/dist/chunk-0n843xh7.js +0 -261
  12. package/dist/chunk-0nbp5jwx.js +0 -8583
  13. package/dist/chunk-0nj16az9.js +0 -169
  14. package/dist/chunk-0paqc2yw.js +0 -15
  15. package/dist/chunk-0q6b50ps.js +0 -111
  16. package/dist/chunk-0r5bb9j4.js +0 -477
  17. package/dist/chunk-0rpz1wgn.js +0 -1030
  18. package/dist/chunk-0t81d427.js +0 -41
  19. package/dist/chunk-0vaw02wq.js +0 -24
  20. package/dist/chunk-0vkfrmqm.js +0 -690
  21. package/dist/chunk-0vp3wfab.js +0 -12
  22. package/dist/chunk-0vr10742.js +0 -1809
  23. package/dist/chunk-0xjaqda8.js +0 -1124
  24. package/dist/chunk-13ehyphg.js +0 -223
  25. package/dist/chunk-15jsw9bb.js +0 -349
  26. package/dist/chunk-16m7eyyw.js +0 -1385
  27. package/dist/chunk-1ae3nt9j.js +0 -31
  28. package/dist/chunk-1gq4r3v1.js +0 -308
  29. package/dist/chunk-1gx78081.js +0 -66
  30. package/dist/chunk-1h2famwb.js +0 -49
  31. package/dist/chunk-1n546sfg.js +0 -200
  32. package/dist/chunk-1qg06d60.js +0 -494
  33. package/dist/chunk-1t0rqstn.js +0 -146
  34. package/dist/chunk-1z8p2eqd.js +0 -40
  35. package/dist/chunk-1zjh9cc5.js +0 -266
  36. package/dist/chunk-20ahkkrb.js +0 -132
  37. package/dist/chunk-21pbfch8.js +0 -105
  38. package/dist/chunk-26wtxbdc.js +0 -13870
  39. package/dist/chunk-2fwze72g.js +0 -24
  40. package/dist/chunk-2gcbr1c7.js +0 -107
  41. package/dist/chunk-2grc1yr8.js +0 -654
  42. package/dist/chunk-2gzv8nrw.js +0 -205
  43. package/dist/chunk-2r212cvt.js +0 -253
  44. package/dist/chunk-2s74bt6e.js +0 -317
  45. package/dist/chunk-2v385w7r.js +0 -7422
  46. package/dist/chunk-2wtkvpp2.js +0 -167
  47. package/dist/chunk-31rsspfr.js +0 -418
  48. package/dist/chunk-3c25bcsw.js +0 -17
  49. package/dist/chunk-3jm08aaw.js +0 -91
  50. package/dist/chunk-3mgywd32.js +0 -8
  51. package/dist/chunk-3nk79af8.js +0 -8
  52. package/dist/chunk-3v4sk2py.js +0 -101
  53. package/dist/chunk-3vwft0eh.js +0 -349
  54. package/dist/chunk-3vy1jt9p.js +0 -1010
  55. package/dist/chunk-3wvqzq9w.js +0 -92
  56. package/dist/chunk-3wvv2s8d.js +0 -336
  57. package/dist/chunk-4060b3s2.js +0 -108
  58. package/dist/chunk-434e0vh4.js +0 -275
  59. package/dist/chunk-46dm23zs.js +0 -344
  60. package/dist/chunk-4bh4qs70.js +0 -209
  61. package/dist/chunk-4cxzbqws.js +0 -94
  62. package/dist/chunk-4jm600zv.js +0 -13
  63. package/dist/chunk-4k9d7gxv.js +0 -118
  64. package/dist/chunk-4nc3t6ms.js +0 -396
  65. package/dist/chunk-4pbx3g7s.js +0 -26
  66. package/dist/chunk-4qhh8bpa.js +0 -54
  67. package/dist/chunk-4v63px9y.js +0 -133
  68. package/dist/chunk-4xnnzt3j.js +0 -74
  69. package/dist/chunk-4zchh01h.js +0 -201
  70. package/dist/chunk-5216fha8.js +0 -1163
  71. package/dist/chunk-55raexh7.js +0 -14358
  72. package/dist/chunk-5bffhf64.js +0 -81
  73. package/dist/chunk-5ccdsxgy.js +0 -74
  74. package/dist/chunk-5ddh2hyn.js +0 -91
  75. package/dist/chunk-5e6ncq5j.js +0 -61
  76. package/dist/chunk-5ekyhb1w.js +0 -422
  77. package/dist/chunk-5fy4r8rv.js +0 -52
  78. package/dist/chunk-5h5kx2jd.js +0 -34
  79. package/dist/chunk-5mbgdvyz.js +0 -847
  80. package/dist/chunk-5n1jc02d.js +0 -87
  81. package/dist/chunk-5pysjah8.js +0 -1543
  82. package/dist/chunk-5ssfz438.js +0 -323
  83. package/dist/chunk-5z28bqne.js +0 -6748
  84. package/dist/chunk-603y0mmg.js +0 -50
  85. package/dist/chunk-62v5kkff.js +0 -90
  86. package/dist/chunk-64c1avct.js +0 -13
  87. package/dist/chunk-64r16v22.js +0 -162
  88. package/dist/chunk-64smdx4a.js +0 -418
  89. package/dist/chunk-66zry909.js +0 -11
  90. package/dist/chunk-68ffk5qa.js +0 -14
  91. package/dist/chunk-69n11zng.js +0 -436
  92. package/dist/chunk-6dj5t602.js +0 -341
  93. package/dist/chunk-6dngjwkh.js +0 -63
  94. package/dist/chunk-6nsd9606.js +0 -790
  95. package/dist/chunk-6pkh8frk.js +0 -253
  96. package/dist/chunk-6qcmt5eb.js +0 -251
  97. package/dist/chunk-6ww7451s.js +0 -60
  98. package/dist/chunk-6xgb0kqz.js +0 -90
  99. package/dist/chunk-72ys9m07.js +0 -121
  100. package/dist/chunk-741sgvtx.js +0 -121
  101. package/dist/chunk-7aw745vx.js +0 -40175
  102. package/dist/chunk-7c8b8cfb.js +0 -219
  103. package/dist/chunk-7mwt4e1z.js +0 -234
  104. package/dist/chunk-7sgtxrsc.js +0 -1059
  105. package/dist/chunk-7wm5s02e.js +0 -216
  106. package/dist/chunk-7xyswgjh.js +0 -8
  107. package/dist/chunk-80a197ez.js +0 -1438
  108. package/dist/chunk-83hfzbx3.js +0 -10
  109. package/dist/chunk-8akrsgad.js +0 -55
  110. package/dist/chunk-8g5pe1gr.js +0 -37
  111. package/dist/chunk-8s07t4k7.js +0 -40
  112. package/dist/chunk-8yhf030a.js +0 -69
  113. package/dist/chunk-928tzaa8.js +0 -107
  114. package/dist/chunk-949pjzj9.js +0 -266
  115. package/dist/chunk-9aycd4z9.js +0 -490
  116. package/dist/chunk-9bzqvsz5.js +0 -211
  117. package/dist/chunk-9q3xfy27.js +0 -460
  118. package/dist/chunk-9vzg1360.js +0 -153
  119. package/dist/chunk-9wbh8n1y.js +0 -63
  120. package/dist/chunk-9x5zgy22.js +0 -12
  121. package/dist/chunk-9zdj4ypz.js +0 -206
  122. package/dist/chunk-a0bvcgyd.js +0 -127
  123. package/dist/chunk-a4m3yr2q.js +0 -117
  124. package/dist/chunk-a8jd4gee.js +0 -227
  125. package/dist/chunk-ase86y73.js +0 -15
  126. package/dist/chunk-atfzpm6r.js +0 -325
  127. package/dist/chunk-awqsddp2.js +0 -338
  128. package/dist/chunk-awrgzpk6.js +0 -29
  129. package/dist/chunk-b0kf00ff.js +0 -637
  130. package/dist/chunk-b1kcd3ss.js +0 -27
  131. package/dist/chunk-b4hy21c4.js +0 -140
  132. package/dist/chunk-b9mkm8mg.js +0 -111
  133. package/dist/chunk-bdjx14rd.js +0 -594
  134. package/dist/chunk-bfb41q9h.js +0 -295
  135. package/dist/chunk-bg4x9ex0.js +0 -21
  136. package/dist/chunk-bh5zqvyc.js +0 -36
  137. package/dist/chunk-bn0zv2y2.js +0 -1154
  138. package/dist/chunk-bn7t681c.js +0 -2669
  139. package/dist/chunk-br4wgffc.js +0 -393
  140. package/dist/chunk-brjd9zmk.js +0 -42
  141. package/dist/chunk-byfawrfx.js +0 -121
  142. package/dist/chunk-c6sjhj89.js +0 -1284
  143. package/dist/chunk-c7jwbe76.js +0 -29030
  144. package/dist/chunk-cdef9v7b.js +0 -27
  145. package/dist/chunk-cdz5yb0r.js +0 -57
  146. package/dist/chunk-cevq1787.js +0 -2718
  147. package/dist/chunk-cgfdkzhb.js +0 -12
  148. package/dist/chunk-cgqw4x5z.js +0 -155
  149. package/dist/chunk-cmmmc8e0.js +0 -212
  150. package/dist/chunk-cnsj3vq2.js +0 -35
  151. package/dist/chunk-cxrktb5g.js +0 -51
  152. package/dist/chunk-cyhrb0bk.js +0 -251
  153. package/dist/chunk-d23rmn8r.js +0 -62
  154. package/dist/chunk-d4mdda98.js +0 -94
  155. package/dist/chunk-dcwp94cj.js +0 -152
  156. package/dist/chunk-ddsjkqs4.js +0 -39
  157. package/dist/chunk-ddv56j39.js +0 -148
  158. package/dist/chunk-dfq6pbq7.js +0 -5822
  159. package/dist/chunk-dfzkwynj.js +0 -5368
  160. package/dist/chunk-dkgkd8b7.js +0 -516
  161. package/dist/chunk-dpnmf0pq.js +0 -312
  162. package/dist/chunk-dygx7vcc.js +0 -226
  163. package/dist/chunk-e0abab5b.js +0 -445
  164. package/dist/chunk-e5qhvhjy.js +0 -168
  165. package/dist/chunk-e60y6r1n.js +0 -20
  166. package/dist/chunk-e68kgvcq.js +0 -79
  167. package/dist/chunk-e9w9zc0g.js +0 -392
  168. package/dist/chunk-ecj9w6tm.js +0 -558
  169. package/dist/chunk-ehtwnxpg.js +0 -1591
  170. package/dist/chunk-eqp1rfft.js +0 -17
  171. package/dist/chunk-etdt1xz3.js +0 -19
  172. package/dist/chunk-ewadzrm8.js +0 -103
  173. package/dist/chunk-f03s83vj.js +0 -91
  174. package/dist/chunk-f3kk0p3s.js +0 -150
  175. package/dist/chunk-f3pjerx4.js +0 -4265
  176. package/dist/chunk-f6h5weh6.js +0 -61
  177. package/dist/chunk-fajg8x36.js +0 -8158
  178. package/dist/chunk-fbv4apne.js +0 -51
  179. package/dist/chunk-fcynwjpm.js +0 -1072
  180. package/dist/chunk-fdvaf6nn.js +0 -20
  181. package/dist/chunk-feyzykye.js +0 -10
  182. package/dist/chunk-ff85rwvc.js +0 -180
  183. package/dist/chunk-fqak69ft.js +0 -458
  184. package/dist/chunk-fxdkbabd.js +0 -195
  185. package/dist/chunk-fyc5fepv.js +0 -10
  186. package/dist/chunk-g78c6ztj.js +0 -89
  187. package/dist/chunk-g8ee7yza.js +0 -105
  188. package/dist/chunk-g9f19ttm.js +0 -15
  189. package/dist/chunk-gcktsbxb.js +0 -77
  190. package/dist/chunk-gdwdqewd.js +0 -19
  191. package/dist/chunk-gg55fns0.js +0 -6440
  192. package/dist/chunk-gnpt1t6q.js +0 -209364
  193. package/dist/chunk-gsbw2j2b.js +0 -276
  194. package/dist/chunk-gybt680f.js +0 -9114
  195. package/dist/chunk-gz1e8y1w.js +0 -33
  196. package/dist/chunk-gz7vn2gg.js +0 -114
  197. package/dist/chunk-h0d5eat0.js +0 -101
  198. package/dist/chunk-h27tjbp3.js +0 -33118
  199. package/dist/chunk-h2yy8k4c.js +0 -58
  200. package/dist/chunk-h5acpdqt.js +0 -103
  201. package/dist/chunk-h63r8vps.js +0 -2840
  202. package/dist/chunk-h64x5b04.js +0 -860
  203. package/dist/chunk-h92snc84.js +0 -420
  204. package/dist/chunk-h9n54swm.js +0 -27
  205. package/dist/chunk-hafcrnpc.js +0 -145
  206. package/dist/chunk-hakdhagh.js +0 -16606
  207. package/dist/chunk-hk4phsaw.js +0 -388
  208. package/dist/chunk-hph1bmqw.js +0 -65
  209. package/dist/chunk-hvnztnp3.js +0 -71
  210. package/dist/chunk-hwfknpxv.js +0 -39
  211. package/dist/chunk-j2xxd002.js +0 -1052
  212. package/dist/chunk-j3qbygme.js +0 -105
  213. package/dist/chunk-j5bth84e.js +0 -97
  214. package/dist/chunk-j64ga6ta.js +0 -8035
  215. package/dist/chunk-jbwgyskk.js +0 -385
  216. package/dist/chunk-jd32zbps.js +0 -15
  217. package/dist/chunk-jdhkh2bb.js +0 -618
  218. package/dist/chunk-jeqcwgt7.js +0 -177
  219. package/dist/chunk-jf75p9ap.js +0 -445
  220. package/dist/chunk-jgvk0za1.js +0 -260
  221. package/dist/chunk-jhpaevah.js +0 -565
  222. package/dist/chunk-jmjwrbwd.js +0 -635
  223. package/dist/chunk-jpdbfwvq.js +0 -100
  224. package/dist/chunk-jps4m6sz.js +0 -183
  225. package/dist/chunk-jwf0s51s.js +0 -867
  226. package/dist/chunk-jxge4dgh.js +0 -83
  227. package/dist/chunk-jz71gv95.js +0 -1161
  228. package/dist/chunk-jzthz1bx.js +0 -15
  229. package/dist/chunk-jzvd2ycp.js +0 -120
  230. package/dist/chunk-k0p9w03v.js +0 -4957
  231. package/dist/chunk-k4dcreh0.js +0 -442
  232. package/dist/chunk-k7akhwkn.js +0 -151
  233. package/dist/chunk-k8vp0atq.js +0 -2331
  234. package/dist/chunk-kgd7gfvk.js +0 -407
  235. package/dist/chunk-km5ycg1j.js +0 -87
  236. package/dist/chunk-kvyrxzj8.js +0 -26
  237. package/dist/chunk-kwekc97v.js +0 -18
  238. package/dist/chunk-ky1z78ve.js +0 -119
  239. package/dist/chunk-mcws22k3.js +0 -42
  240. package/dist/chunk-mjazvyd8.js +0 -528
  241. package/dist/chunk-mswx2nma.js +0 -103
  242. package/dist/chunk-mz6a0phh.js +0 -2962
  243. package/dist/chunk-n2tg12hg.js +0 -374
  244. package/dist/chunk-n3fv4ya7.js +0 -146
  245. package/dist/chunk-n4eabmqd.js +0 -93
  246. package/dist/chunk-n4tx7baq.js +0 -193
  247. package/dist/chunk-n6g4jbeh.js +0 -289
  248. package/dist/chunk-n6wzfxf1.js +0 -100
  249. package/dist/chunk-ndcmqfkv.js +0 -244
  250. package/dist/chunk-netzwgv1.js +0 -154
  251. package/dist/chunk-nhcg04jt.js +0 -120
  252. package/dist/chunk-nhsm3ntd.js +0 -439
  253. package/dist/chunk-njev89d1.js +0 -2335
  254. package/dist/chunk-nmgj86tt.js +0 -24
  255. package/dist/chunk-ns7x6xam.js +0 -22820
  256. package/dist/chunk-p7vkh4wx.js +0 -15
  257. package/dist/chunk-p8na2wwp.js +0 -14
  258. package/dist/chunk-p97fd5af.js +0 -684
  259. package/dist/chunk-pe3rkfp2.js +0 -74
  260. package/dist/chunk-pgtnj1mt.js +0 -705
  261. package/dist/chunk-phmnkw9y.js +0 -283
  262. package/dist/chunk-pnds7g1q.js +0 -130
  263. package/dist/chunk-ppwjyveh.js +0 -8
  264. package/dist/chunk-pqqxdk5f.js +0 -543
  265. package/dist/chunk-ps49ymvj.js +0 -43
  266. package/dist/chunk-pwwa7s62.js +0 -11
  267. package/dist/chunk-q3hfrat2.js +0 -313
  268. package/dist/chunk-qajrkk97.js +0 -298
  269. package/dist/chunk-qatfdxvd.js +0 -34
  270. package/dist/chunk-qb5qcctj.js +0 -206
  271. package/dist/chunk-qb6k2afy.js +0 -153
  272. package/dist/chunk-qgk93a75.js +0 -85
  273. package/dist/chunk-qkczt8cr.js +0 -24
  274. package/dist/chunk-qn1be1vf.js +0 -267
  275. package/dist/chunk-qnfx3qtx.js +0 -617
  276. package/dist/chunk-qnwne2m4.js +0 -87
  277. package/dist/chunk-qp2qdcda.js +0 -100
  278. package/dist/chunk-qpp3wwh5.js +0 -697
  279. package/dist/chunk-r0bx1gc7.js +0 -174
  280. package/dist/chunk-radnwk8x.js +0 -107
  281. package/dist/chunk-rkv5jq0y.js +0 -71
  282. package/dist/chunk-rmbbmd3s.js +0 -68
  283. package/dist/chunk-rmgbs5an.js +0 -640
  284. package/dist/chunk-rn0v1hk8.js +0 -34
  285. package/dist/chunk-rnxctq9p.js +0 -1646
  286. package/dist/chunk-rtd39n81.js +0 -95
  287. package/dist/chunk-s8gy4ky9.js +0 -122
  288. package/dist/chunk-s8kj6ajy.js +0 -32
  289. package/dist/chunk-sd36yzx8.js +0 -954
  290. package/dist/chunk-sdenh194.js +0 -121
  291. package/dist/chunk-sdtqp75c.js +0 -55
  292. package/dist/chunk-sedbc8ep.js +0 -212
  293. package/dist/chunk-sfrb15b2.js +0 -321
  294. package/dist/chunk-sgpmpn90.js +0 -35
  295. package/dist/chunk-sh02d2qn.js +0 -38
  296. package/dist/chunk-shd4yhsf.js +0 -32
  297. package/dist/chunk-shkycj1q.js +0 -178
  298. package/dist/chunk-sk7h93je.js +0 -153
  299. package/dist/chunk-sm8g6fsm.js +0 -122
  300. package/dist/chunk-snrjy66h.js +0 -671
  301. package/dist/chunk-sq4a0yjh.js +0 -116
  302. package/dist/chunk-sr3t4thh.js +0 -895
  303. package/dist/chunk-srj6qnf6.js +0 -107
  304. package/dist/chunk-sz62n77p.js +0 -155
  305. package/dist/chunk-szj5wvdy.js +0 -28
  306. package/dist/chunk-t29a6zb5.js +0 -45
  307. package/dist/chunk-t2ecddwj.js +0 -731
  308. package/dist/chunk-t33hmmmm.js +0 -113
  309. package/dist/chunk-t4khqff1.js +0 -16
  310. package/dist/chunk-t9p85zff.js +0 -24
  311. package/dist/chunk-ta3jyvxs.js +0 -984
  312. package/dist/chunk-tkx5eec8.js +0 -54
  313. package/dist/chunk-v1kzp02e.js +0 -785
  314. package/dist/chunk-v4t6dyyh.js +0 -9076
  315. package/dist/chunk-v78fj8by.js +0 -145
  316. package/dist/chunk-v8kjswxt.js +0 -61
  317. package/dist/chunk-v9smspw2.js +0 -4301
  318. package/dist/chunk-vf612n57.js +0 -472
  319. package/dist/chunk-vkhrrvfq.js +0 -44
  320. package/dist/chunk-vt5wm07k.js +0 -74
  321. package/dist/chunk-vvvrv61g.js +0 -875
  322. package/dist/chunk-vyjeh50y.js +0 -2149
  323. package/dist/chunk-w0kxcv73.js +0 -97
  324. package/dist/chunk-w6m6trzq.js +0 -58
  325. package/dist/chunk-wa8yn2p0.js +0 -2007
  326. package/dist/chunk-wb18cecv.js +0 -995
  327. package/dist/chunk-wgk9sxk7.js +0 -329
  328. package/dist/chunk-wh0ev1bw.js +0 -111
  329. package/dist/chunk-wka1647p.js +0 -98
  330. package/dist/chunk-wnwfwyj4.js +0 -90
  331. package/dist/chunk-wpdchyy2.js +0 -97
  332. package/dist/chunk-x3g44n7k.js +0 -114
  333. package/dist/chunk-x47h283a.js +0 -56
  334. package/dist/chunk-x6r4v44b.js +0 -8
  335. package/dist/chunk-x7fdwq3d.js +0 -33
  336. package/dist/chunk-x8d2ehd7.js +0 -19
  337. package/dist/chunk-xbeg2hej.js +0 -257
  338. package/dist/chunk-xeb6075z.js +0 -3435
  339. package/dist/chunk-xhfmdq1y.js +0 -147
  340. package/dist/chunk-xhscn33a.js +0 -138
  341. package/dist/chunk-xv3era3s.js +0 -8
  342. package/dist/chunk-xz5gbhc3.js +0 -93
  343. package/dist/chunk-y1784krc.js +0 -19
  344. package/dist/chunk-y1vyezct.js +0 -123
  345. package/dist/chunk-y45ecntg.js +0 -942
  346. package/dist/chunk-y4ca9kqz.js +0 -3830
  347. package/dist/chunk-y9bhjjdz.js +0 -145
  348. package/dist/chunk-yb3bxv3w.js +0 -30
  349. package/dist/chunk-ye2q9gqj.js +0 -332
  350. package/dist/chunk-yfg3adfq.js +0 -88
  351. package/dist/chunk-yst0wmgw.js +0 -269
  352. package/dist/chunk-ywe9dbnz.js +0 -460
  353. package/dist/chunk-yyex5gsf.js +0 -269
  354. package/dist/chunk-yz2kzqk5.js +0 -439
  355. package/dist/chunk-z263ehpg.js +0 -131
  356. package/dist/chunk-z2dp53wn.js +0 -17
  357. package/dist/chunk-zaq348h2.js +0 -281
  358. package/dist/chunk-zr0qx9q0.js +0 -642
  359. package/dist/chunk-zxh62ved.js +0 -31
  360. package/dist/chunk-zy5vn8sd.js +0 -329
  361. package/dist/chunk-zzm33q8x.js +0 -8
  362. package/dist/cli.js +0 -91
@@ -1,1438 +0,0 @@
1
- // @bun
2
- import {
3
- PermissionDialog
4
- } from "./chunk-mswx2nma.js";
5
- import {
6
- DesktopHandoff,
7
- init_DesktopHandoff
8
- } from "./chunk-ye2q9gqj.js";
9
- import {
10
- init_OverageCreditUpsell,
11
- shouldShowOverageCreditUpsell
12
- } from "./chunk-n3fv4ya7.js";
13
- import {
14
- formatGrantAmount,
15
- getCachedOverageCreditGrant,
16
- init_overageCreditGrant
17
- } from "./chunk-5h5kx2jd.js";
18
- import {
19
- OFFICIAL_MARKETPLACE_NAME,
20
- Select,
21
- countConcurrentSessions,
22
- detectRunningIDEsCached,
23
- fileHistoryEnabled,
24
- getCurrentSessionAgentColor,
25
- getEffortEnvOverride,
26
- getShortcutDisplay,
27
- getSortedIdeLockfiles,
28
- init_concurrentSessions,
29
- init_effort,
30
- init_fileHistory,
31
- init_ide,
32
- init_installedPluginsManager,
33
- init_marketplaceManager,
34
- init_officialMarketplace,
35
- init_prompt8 as init_prompt,
36
- init_sample,
37
- init_select,
38
- init_sessionStorage,
39
- init_shortcutFormat,
40
- isCursorInstalled,
41
- isCustomTitleEnabled,
42
- isKairosCronEnabled,
43
- isPluginInstalled,
44
- isSupportedTerminal,
45
- isSupportedVSCodeTerminal,
46
- isVSCodeInstalled,
47
- isWindsurfInstalled,
48
- loadKnownMarketplacesConfigSafe,
49
- modelSupportsEffort,
50
- sample_default
51
- } from "./chunk-gnpt1t6q.js";
52
- import {
53
- getDynamicTeamContext,
54
- getTeamFilePath,
55
- init_teamHelpers,
56
- init_teammate,
57
- readTeamFile
58
- } from "./chunk-wb18cecv.js";
59
- import {
60
- checkCachedPassesEligibility,
61
- formatCreditAmount,
62
- getCachedReferrerReward,
63
- init_referral
64
- } from "./chunk-4k9d7gxv.js";
65
- import {
66
- cacheKeys,
67
- init_fileStateCache
68
- } from "./chunk-j5bth84e.js";
69
- import {
70
- init_terminalSetup,
71
- shouldOfferTerminalSetup
72
- } from "./chunk-t2ecddwj.js";
73
- import {
74
- getAPIProvider,
75
- getMainLoopModel,
76
- getUserSpecifiedModelSetting,
77
- init_model,
78
- init_providers
79
- } from "./chunk-5pysjah8.js";
80
- import {
81
- getWebSocketProxyAgent,
82
- getWebSocketProxyUrl,
83
- getWebSocketTLSOptions,
84
- init_mtls,
85
- init_proxy
86
- } from "./chunk-pgtnj1mt.js";
87
- import {
88
- init_api,
89
- sendEventToRemoteSession
90
- } from "./chunk-zy5vn8sd.js";
91
- import {
92
- getCurrentProjectConfig,
93
- getDynamicConfig_CACHED_MAY_BE_STALE,
94
- getFeatureValue_CACHED_MAY_BE_STALE,
95
- getGitEmail,
96
- getGlobalConfig,
97
- getInitialSettings,
98
- getSettingsForSource,
99
- getSettings_DEPRECATED,
100
- init_auth,
101
- init_config,
102
- init_growthbook,
103
- init_settings1 as init_settings,
104
- init_user,
105
- is1PApiCustomer,
106
- saveCurrentProjectConfig,
107
- saveGlobalConfig
108
- } from "./chunk-dfq6pbq7.js";
109
- import {
110
- env,
111
- getApiConfig,
112
- init_apiConfig,
113
- init_env
114
- } from "./chunk-5ekyhb1w.js";
115
- import {
116
- ThemedBox_default,
117
- ThemedText,
118
- color,
119
- init_source,
120
- init_src,
121
- source_default
122
- } from "./chunk-c7jwbe76.js";
123
- import {
124
- require_jsx_dev_runtime,
125
- require_react
126
- } from "./chunk-7sgtxrsc.js";
127
- import {
128
- init_analytics,
129
- logEvent
130
- } from "./chunk-x8d2ehd7.js";
131
- import {
132
- getIsGit,
133
- getWorktreeCount,
134
- gitExe,
135
- init_git
136
- } from "./chunk-3vy1jt9p.js";
137
- import {
138
- execFileNoThrowWithCwd,
139
- init_execFileNoThrow
140
- } from "./chunk-64r16v22.js";
141
- import {
142
- getCwd,
143
- init_cwd
144
- } from "./chunk-s8kj6ajy.js";
145
- import {
146
- errorMessage,
147
- getPlatform,
148
- init_debug,
149
- init_errors,
150
- init_log,
151
- init_platform,
152
- init_slowOperations,
153
- jsonParse,
154
- jsonStringify,
155
- logError,
156
- logForDebugging
157
- } from "./chunk-gg55fns0.js";
158
- import {
159
- init_memoize,
160
- memoize_default
161
- } from "./chunk-vf612n57.js";
162
- import {
163
- __require,
164
- __toESM
165
- } from "./chunk-qp2qdcda.js";
166
-
167
- // src/utils/exampleCommands.ts
168
- init_memoize();
169
- init_sample();
170
- init_cwd();
171
- init_config();
172
- init_env();
173
- init_execFileNoThrow();
174
- init_git();
175
- init_log();
176
- init_user();
177
- var NON_CORE_PATTERNS = [
178
- /(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,
179
- /\.generated\./,
180
- /(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,
181
- /\.(?:min\.js|min\.css|map|pyc|pyo)$/,
182
- /\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,
183
- /(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,
184
- /(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,
185
- /(?:^|\/)\.(?:github|vscode|idea|claude)\//,
186
- /(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i
187
- ];
188
- function isCoreFile(path) {
189
- return !NON_CORE_PATTERNS.some((p) => p.test(path));
190
- }
191
- function pickDiverseCoreFiles(sortedPaths, want) {
192
- const picked = [];
193
- const seenBasenames = new Set;
194
- const dirTally = new Map;
195
- for (let cap = 1;picked.length < want && cap <= want; cap++) {
196
- for (const p of sortedPaths) {
197
- if (picked.length >= want)
198
- break;
199
- if (!isCoreFile(p))
200
- continue;
201
- const lastSep = Math.max(p.lastIndexOf("/"), p.lastIndexOf("\\"));
202
- const base = lastSep >= 0 ? p.slice(lastSep + 1) : p;
203
- if (!base || seenBasenames.has(base))
204
- continue;
205
- const dir = lastSep >= 0 ? p.slice(0, lastSep) : ".";
206
- if ((dirTally.get(dir) ?? 0) >= cap)
207
- continue;
208
- picked.push(base);
209
- seenBasenames.add(base);
210
- dirTally.set(dir, (dirTally.get(dir) ?? 0) + 1);
211
- }
212
- }
213
- return picked.length >= want ? picked : [];
214
- }
215
- async function getFrequentlyModifiedFiles() {
216
- if (false)
217
- ;
218
- if (env.platform === "win32")
219
- return [];
220
- if (!await getIsGit())
221
- return [];
222
- try {
223
- const userEmail = await getGitEmail();
224
- const logArgs = [
225
- "log",
226
- "-n",
227
- "1000",
228
- "--pretty=format:",
229
- "--name-only",
230
- "--diff-filter=M"
231
- ];
232
- const counts = new Map;
233
- const tallyInto = (stdout) => {
234
- for (const line of stdout.split(`
235
- `)) {
236
- const f = line.trim();
237
- if (f)
238
- counts.set(f, (counts.get(f) ?? 0) + 1);
239
- }
240
- };
241
- if (userEmail) {
242
- const { stdout } = await execFileNoThrowWithCwd("git", [...logArgs, `--author=${userEmail}`], { cwd: getCwd() });
243
- tallyInto(stdout);
244
- }
245
- if (counts.size < 10) {
246
- const { stdout } = await execFileNoThrowWithCwd(gitExe(), logArgs, {
247
- cwd: getCwd()
248
- });
249
- tallyInto(stdout);
250
- }
251
- const sorted = Array.from(counts.entries()).sort((a, b) => b[1] - a[1]).map(([p]) => p);
252
- return pickDiverseCoreFiles(sorted, 5);
253
- } catch (err) {
254
- logError(err);
255
- return [];
256
- }
257
- }
258
- var ONE_WEEK_IN_MS = 7 * 24 * 60 * 60 * 1000;
259
- var getExampleCommandFromCache = memoize_default(() => {
260
- const projectConfig = getCurrentProjectConfig();
261
- const frequentFile = projectConfig.exampleFiles?.length ? sample_default(projectConfig.exampleFiles) : "<filepath>";
262
- const commands = [
263
- "fix lint errors",
264
- "fix typecheck errors",
265
- `how does ${frequentFile} work?`,
266
- `refactor ${frequentFile}`,
267
- "how do I log an error?",
268
- `edit ${frequentFile} to...`,
269
- `write a test for ${frequentFile}`,
270
- "create a util logging.py that..."
271
- ];
272
- return `Try "${sample_default(commands)}"`;
273
- });
274
- var refreshExampleCommands = memoize_default(async () => {
275
- const projectConfig = getCurrentProjectConfig();
276
- const now = Date.now();
277
- const lastGenerated = projectConfig.exampleFilesGeneratedAt ?? 0;
278
- if (now - lastGenerated > ONE_WEEK_IN_MS) {
279
- projectConfig.exampleFiles = [];
280
- }
281
- if (!projectConfig.exampleFiles?.length) {
282
- getFrequentlyModifiedFiles().then((files) => {
283
- if (files.length) {
284
- saveCurrentProjectConfig((current) => ({
285
- ...current,
286
- exampleFiles: files,
287
- exampleFilesGeneratedAt: Date.now()
288
- }));
289
- }
290
- });
291
- }
292
- });
293
-
294
- // src/remote/RemoteSessionManager.ts
295
- init_debug();
296
- init_log();
297
- init_api();
298
-
299
- // src/remote/SessionsWebSocket.ts
300
- init_apiConfig();
301
- init_debug();
302
- init_errors();
303
- init_log();
304
- init_mtls();
305
- init_proxy();
306
- init_slowOperations();
307
- import { randomUUID } from "crypto";
308
- var RECONNECT_DELAY_MS = 2000;
309
- var MAX_RECONNECT_ATTEMPTS = 5;
310
- var PING_INTERVAL_MS = 30000;
311
- var MAX_SESSION_NOT_FOUND_RETRIES = 3;
312
- var PERMANENT_CLOSE_CODES = new Set([
313
- 4003
314
- ]);
315
- function isSessionsMessage(value) {
316
- if (typeof value !== "object" || value === null || !("type" in value)) {
317
- return false;
318
- }
319
- return typeof value.type === "string";
320
- }
321
-
322
- class SessionsWebSocket {
323
- sessionId;
324
- orgUuid;
325
- getAccessToken;
326
- callbacks;
327
- ws = null;
328
- state = "closed";
329
- reconnectAttempts = 0;
330
- sessionNotFoundRetries = 0;
331
- pingInterval = null;
332
- reconnectTimer = null;
333
- constructor(sessionId, orgUuid, getAccessToken, callbacks) {
334
- this.sessionId = sessionId;
335
- this.orgUuid = orgUuid;
336
- this.getAccessToken = getAccessToken;
337
- this.callbacks = callbacks;
338
- }
339
- async connect() {
340
- if (this.state === "connecting") {
341
- logForDebugging("[SessionsWebSocket] Already connecting");
342
- return;
343
- }
344
- this.state = "connecting";
345
- const baseUrl = getApiConfig().BASE_API_URL.replace("https://", "wss://");
346
- const url = `${baseUrl}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;
347
- logForDebugging(`[SessionsWebSocket] Connecting to ${url}`);
348
- const accessToken = this.getAccessToken();
349
- const headers = {
350
- Authorization: `Bearer ${accessToken}`,
351
- "anthropic-version": "2023-06-01"
352
- };
353
- if (typeof Bun !== "undefined") {
354
- const ws = new globalThis.WebSocket(url, {
355
- headers,
356
- proxy: getWebSocketProxyUrl(url),
357
- tls: getWebSocketTLSOptions() || undefined
358
- });
359
- this.ws = ws;
360
- ws.addEventListener("open", () => {
361
- logForDebugging("[SessionsWebSocket] Connection opened, authenticated via headers");
362
- this.state = "connected";
363
- this.reconnectAttempts = 0;
364
- this.sessionNotFoundRetries = 0;
365
- this.startPingInterval();
366
- this.callbacks.onConnected?.();
367
- });
368
- ws.addEventListener("message", (event) => {
369
- const data = typeof event.data === "string" ? event.data : String(event.data);
370
- this.handleMessage(data);
371
- });
372
- ws.addEventListener("error", () => {
373
- const err = new Error("[SessionsWebSocket] WebSocket error");
374
- logError(err);
375
- this.callbacks.onError?.(err);
376
- });
377
- ws.addEventListener("close", (event) => {
378
- logForDebugging(`[SessionsWebSocket] Closed: code=${event.code} reason=${event.reason}`);
379
- this.handleClose(event.code);
380
- });
381
- ws.addEventListener("pong", () => {
382
- logForDebugging("[SessionsWebSocket] Pong received");
383
- });
384
- } else {
385
- const { default: WS } = await import("ws");
386
- const ws = new WS(url, {
387
- headers,
388
- agent: getWebSocketProxyAgent(url),
389
- ...getWebSocketTLSOptions()
390
- });
391
- this.ws = ws;
392
- ws.on("open", () => {
393
- logForDebugging("[SessionsWebSocket] Connection opened, authenticated via headers");
394
- this.state = "connected";
395
- this.reconnectAttempts = 0;
396
- this.sessionNotFoundRetries = 0;
397
- this.startPingInterval();
398
- this.callbacks.onConnected?.();
399
- });
400
- ws.on("message", (data) => {
401
- this.handleMessage(data.toString());
402
- });
403
- ws.on("error", (err) => {
404
- logError(new Error(`[SessionsWebSocket] Error: ${err.message}`));
405
- this.callbacks.onError?.(err);
406
- });
407
- ws.on("close", (code, reason) => {
408
- logForDebugging(`[SessionsWebSocket] Closed: code=${code} reason=${reason.toString()}`);
409
- this.handleClose(code);
410
- });
411
- ws.on("pong", () => {
412
- logForDebugging("[SessionsWebSocket] Pong received");
413
- });
414
- }
415
- }
416
- handleMessage(data) {
417
- try {
418
- const message = jsonParse(data);
419
- if (isSessionsMessage(message)) {
420
- this.callbacks.onMessage(message);
421
- } else {
422
- logForDebugging(`[SessionsWebSocket] Ignoring message type: ${typeof message === "object" && message !== null && "type" in message ? String(message.type) : "unknown"}`);
423
- }
424
- } catch (error) {
425
- logError(new Error(`[SessionsWebSocket] Failed to parse message: ${errorMessage(error)}`));
426
- }
427
- }
428
- handleClose(closeCode) {
429
- this.stopPingInterval();
430
- if (this.state === "closed") {
431
- return;
432
- }
433
- this.ws = null;
434
- const previousState = this.state;
435
- this.state = "closed";
436
- if (PERMANENT_CLOSE_CODES.has(closeCode)) {
437
- logForDebugging(`[SessionsWebSocket] Permanent close code ${closeCode}, not reconnecting`);
438
- this.callbacks.onClose?.();
439
- return;
440
- }
441
- if (closeCode === 4001) {
442
- this.sessionNotFoundRetries++;
443
- if (this.sessionNotFoundRetries > MAX_SESSION_NOT_FOUND_RETRIES) {
444
- logForDebugging(`[SessionsWebSocket] 4001 retry budget exhausted (${MAX_SESSION_NOT_FOUND_RETRIES}), not reconnecting`);
445
- this.callbacks.onClose?.();
446
- return;
447
- }
448
- this.scheduleReconnect(RECONNECT_DELAY_MS * this.sessionNotFoundRetries, `4001 attempt ${this.sessionNotFoundRetries}/${MAX_SESSION_NOT_FOUND_RETRIES}`);
449
- return;
450
- }
451
- if (previousState === "connected" && this.reconnectAttempts < MAX_RECONNECT_ATTEMPTS) {
452
- this.reconnectAttempts++;
453
- this.scheduleReconnect(RECONNECT_DELAY_MS, `attempt ${this.reconnectAttempts}/${MAX_RECONNECT_ATTEMPTS}`);
454
- } else {
455
- logForDebugging("[SessionsWebSocket] Not reconnecting");
456
- this.callbacks.onClose?.();
457
- }
458
- }
459
- scheduleReconnect(delay, label) {
460
- this.callbacks.onReconnecting?.();
461
- logForDebugging(`[SessionsWebSocket] Scheduling reconnect (${label}) in ${delay}ms`);
462
- this.reconnectTimer = setTimeout(() => {
463
- this.reconnectTimer = null;
464
- this.connect();
465
- }, delay);
466
- }
467
- startPingInterval() {
468
- this.stopPingInterval();
469
- this.pingInterval = setInterval(() => {
470
- if (this.ws && this.state === "connected") {
471
- try {
472
- this.ws.ping?.();
473
- } catch {}
474
- }
475
- }, PING_INTERVAL_MS);
476
- }
477
- stopPingInterval() {
478
- if (this.pingInterval) {
479
- clearInterval(this.pingInterval);
480
- this.pingInterval = null;
481
- }
482
- }
483
- sendControlResponse(response) {
484
- if (!this.ws || this.state !== "connected") {
485
- logError(new Error("[SessionsWebSocket] Cannot send: not connected"));
486
- return;
487
- }
488
- logForDebugging("[SessionsWebSocket] Sending control response");
489
- this.ws.send(jsonStringify(response));
490
- }
491
- sendControlRequest(request) {
492
- if (!this.ws || this.state !== "connected") {
493
- logError(new Error("[SessionsWebSocket] Cannot send: not connected"));
494
- return;
495
- }
496
- const controlRequest = {
497
- type: "control_request",
498
- request_id: randomUUID(),
499
- request
500
- };
501
- logForDebugging(`[SessionsWebSocket] Sending control request: ${request.subtype}`);
502
- this.ws.send(jsonStringify(controlRequest));
503
- }
504
- isConnected() {
505
- return this.state === "connected";
506
- }
507
- close() {
508
- logForDebugging("[SessionsWebSocket] Closing connection");
509
- this.state = "closed";
510
- this.stopPingInterval();
511
- if (this.reconnectTimer) {
512
- clearTimeout(this.reconnectTimer);
513
- this.reconnectTimer = null;
514
- }
515
- if (this.ws) {
516
- this.ws.close();
517
- this.ws = null;
518
- }
519
- }
520
- reconnect() {
521
- logForDebugging("[SessionsWebSocket] Force reconnecting");
522
- this.reconnectAttempts = 0;
523
- this.sessionNotFoundRetries = 0;
524
- this.close();
525
- this.reconnectTimer = setTimeout(() => {
526
- this.reconnectTimer = null;
527
- this.connect();
528
- }, 500);
529
- }
530
- }
531
-
532
- // src/remote/RemoteSessionManager.ts
533
- function isSDKMessage(message) {
534
- return message.type !== "control_request" && message.type !== "control_response" && message.type !== "control_cancel_request";
535
- }
536
-
537
- class RemoteSessionManager {
538
- config;
539
- callbacks;
540
- websocket = null;
541
- pendingPermissionRequests = new Map;
542
- constructor(config, callbacks) {
543
- this.config = config;
544
- this.callbacks = callbacks;
545
- }
546
- connect() {
547
- logForDebugging(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);
548
- const wsCallbacks = {
549
- onMessage: (message) => this.handleMessage(message),
550
- onConnected: () => {
551
- logForDebugging("[RemoteSessionManager] Connected");
552
- this.callbacks.onConnected?.();
553
- },
554
- onClose: () => {
555
- logForDebugging("[RemoteSessionManager] Disconnected");
556
- this.callbacks.onDisconnected?.();
557
- },
558
- onReconnecting: () => {
559
- logForDebugging("[RemoteSessionManager] Reconnecting");
560
- this.callbacks.onReconnecting?.();
561
- },
562
- onError: (error) => {
563
- logError(error);
564
- this.callbacks.onError?.(error);
565
- }
566
- };
567
- this.websocket = new SessionsWebSocket(this.config.sessionId, this.config.orgUuid, this.config.getAccessToken, wsCallbacks);
568
- this.websocket.connect();
569
- }
570
- handleMessage(message) {
571
- if (message.type === "control_request") {
572
- this.handleControlRequest(message);
573
- return;
574
- }
575
- if (message.type === "control_cancel_request") {
576
- const { request_id } = message;
577
- const pendingRequest = this.pendingPermissionRequests.get(request_id);
578
- logForDebugging(`[RemoteSessionManager] Permission request cancelled: ${request_id}`);
579
- this.pendingPermissionRequests.delete(request_id);
580
- this.callbacks.onPermissionCancelled?.(request_id, pendingRequest?.tool_use_id);
581
- return;
582
- }
583
- if (message.type === "control_response") {
584
- logForDebugging("[RemoteSessionManager] Received control response");
585
- return;
586
- }
587
- if (isSDKMessage(message)) {
588
- this.callbacks.onMessage(message);
589
- }
590
- }
591
- handleControlRequest(request) {
592
- const requestId = request.request_id;
593
- const inner = request.request;
594
- if (inner.subtype === "can_use_tool") {
595
- logForDebugging(`[RemoteSessionManager] Permission request for tool: ${inner.tool_name}`);
596
- this.pendingPermissionRequests.set(requestId, inner);
597
- this.callbacks.onPermissionRequest(inner, requestId);
598
- } else {
599
- logForDebugging(`[RemoteSessionManager] Unsupported control request subtype: ${inner.subtype}`);
600
- const response = {
601
- type: "control_response",
602
- response: {
603
- subtype: "error",
604
- request_id: requestId,
605
- error: `Unsupported control request subtype: ${inner.subtype}`
606
- }
607
- };
608
- this.websocket?.sendControlResponse(response);
609
- }
610
- }
611
- async sendMessage(content, opts) {
612
- logForDebugging(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);
613
- const success = await sendEventToRemoteSession(this.config.sessionId, content, opts);
614
- if (!success) {
615
- logError(new Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`));
616
- }
617
- return success;
618
- }
619
- respondToPermissionRequest(requestId, result) {
620
- const pendingRequest = this.pendingPermissionRequests.get(requestId);
621
- if (!pendingRequest) {
622
- logError(new Error(`[RemoteSessionManager] No pending permission request with ID: ${requestId}`));
623
- return;
624
- }
625
- this.pendingPermissionRequests.delete(requestId);
626
- const response = {
627
- type: "control_response",
628
- response: {
629
- subtype: "success",
630
- request_id: requestId,
631
- response: {
632
- behavior: result.behavior,
633
- ...result.behavior === "allow" ? { updatedInput: result.updatedInput } : { message: result.message }
634
- }
635
- }
636
- };
637
- logForDebugging(`[RemoteSessionManager] Sending permission response: ${result.behavior}`);
638
- this.websocket?.sendControlResponse(response);
639
- }
640
- isConnected() {
641
- return this.websocket?.isConnected() ?? false;
642
- }
643
- cancelSession() {
644
- logForDebugging("[RemoteSessionManager] Sending interrupt signal");
645
- this.websocket?.sendControlRequest({ subtype: "interrupt" });
646
- }
647
- getSessionId() {
648
- return this.config.sessionId;
649
- }
650
- disconnect() {
651
- logForDebugging("[RemoteSessionManager] Disconnecting");
652
- this.websocket?.close();
653
- this.websocket = null;
654
- this.pendingPermissionRequests.clear();
655
- }
656
- reconnect() {
657
- logForDebugging("[RemoteSessionManager] Reconnecting WebSocket");
658
- this.websocket?.reconnect();
659
- }
660
- }
661
- function createRemoteSessionConfig(sessionId, getAccessToken, orgUuid, hasInitialPrompt = false, viewerOnly = false) {
662
- return {
663
- sessionId,
664
- getAccessToken,
665
- orgUuid,
666
- hasInitialPrompt,
667
- viewerOnly
668
- };
669
- }
670
-
671
- // src/utils/swarm/reconnection.ts
672
- init_debug();
673
- init_log();
674
- init_teammate();
675
- init_teamHelpers();
676
- function computeInitialTeamContext() {
677
- const context = getDynamicTeamContext();
678
- if (!context?.teamName || !context?.agentName) {
679
- logForDebugging("[Reconnection] computeInitialTeamContext: No teammate context set (not a teammate)");
680
- return;
681
- }
682
- const { teamName, agentId, agentName } = context;
683
- const teamFile = readTeamFile(teamName);
684
- if (!teamFile) {
685
- logError(new Error(`[computeInitialTeamContext] Could not read team file for ${teamName}`));
686
- return;
687
- }
688
- const teamFilePath = getTeamFilePath(teamName);
689
- const isLeader = !agentId;
690
- logForDebugging(`[Reconnection] Computed initial team context for ${isLeader ? "leader" : `teammate ${agentName}`} in team ${teamName}`);
691
- return {
692
- teamName,
693
- teamFilePath,
694
- leadAgentId: teamFile.leadAgentId,
695
- selfAgentId: agentId,
696
- selfAgentName: agentName,
697
- isLeader,
698
- teammates: {}
699
- };
700
- }
701
- function initializeTeammateContextFromSession(setAppState, teamName, agentName) {
702
- const teamFile = readTeamFile(teamName);
703
- if (!teamFile) {
704
- logError(new Error(`[initializeTeammateContextFromSession] Could not read team file for ${teamName} (agent: ${agentName})`));
705
- return;
706
- }
707
- const member = teamFile.members.find((m) => m.name === agentName);
708
- if (!member) {
709
- logForDebugging(`[Reconnection] Member ${agentName} not found in team ${teamName} - may have been removed`);
710
- }
711
- const agentId = member?.agentId;
712
- const teamFilePath = getTeamFilePath(teamName);
713
- setAppState((prev) => ({
714
- ...prev,
715
- teamContext: {
716
- teamName,
717
- teamFilePath,
718
- leadAgentId: teamFile.leadAgentId,
719
- selfAgentId: agentId,
720
- selfAgentName: agentName,
721
- isLeader: false,
722
- teammates: {}
723
- }
724
- }));
725
- logForDebugging(`[Reconnection] Initialized agent context from session for ${agentName} in team ${teamName}`);
726
- }
727
-
728
- // src/components/DesktopUpsell/DesktopUpsellStartup.tsx
729
- init_src();
730
- init_growthbook();
731
- init_analytics();
732
- init_config();
733
- init_select();
734
- init_DesktopHandoff();
735
- var import_react = __toESM(require_react(), 1);
736
- var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
737
- var DESKTOP_UPSELL_DEFAULT = {
738
- enable_shortcut_tip: false,
739
- enable_startup_dialog: false
740
- };
741
- function getDesktopUpsellConfig() {
742
- return getDynamicConfig_CACHED_MAY_BE_STALE("tengu_desktop_upsell", DESKTOP_UPSELL_DEFAULT);
743
- }
744
- function isSupportedPlatform() {
745
- return process.platform === "darwin" || process.platform === "win32" && process.arch === "x64";
746
- }
747
- function shouldShowDesktopUpsellStartup() {
748
- if (!isSupportedPlatform())
749
- return false;
750
- if (!getDesktopUpsellConfig().enable_startup_dialog)
751
- return false;
752
- const config = getGlobalConfig();
753
- if (config.desktopUpsellDismissed)
754
- return false;
755
- if ((config.desktopUpsellSeenCount ?? 0) >= 3)
756
- return false;
757
- return true;
758
- }
759
- function DesktopUpsellStartup({ onDone }) {
760
- const [showHandoff, setShowHandoff] = import_react.useState(false);
761
- import_react.useEffect(() => {
762
- const newCount = (getGlobalConfig().desktopUpsellSeenCount ?? 0) + 1;
763
- saveGlobalConfig((prev) => {
764
- if ((prev.desktopUpsellSeenCount ?? 0) >= newCount)
765
- return prev;
766
- return { ...prev, desktopUpsellSeenCount: newCount };
767
- });
768
- logEvent("tengu_desktop_upsell_shown", { seen_count: newCount });
769
- }, []);
770
- if (showHandoff) {
771
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DesktopHandoff, {
772
- onDone: () => onDone()
773
- }, undefined, false, undefined, this);
774
- }
775
- function handleSelect(value) {
776
- switch (value) {
777
- case "try":
778
- setShowHandoff(true);
779
- return;
780
- case "never":
781
- saveGlobalConfig((prev) => {
782
- if (prev.desktopUpsellDismissed)
783
- return prev;
784
- return { ...prev, desktopUpsellDismissed: true };
785
- });
786
- onDone();
787
- return;
788
- case "not-now":
789
- onDone();
790
- return;
791
- }
792
- }
793
- const options = [
794
- { label: "Open in Claude Code Desktop", value: "try" },
795
- { label: "Not now", value: "not-now" },
796
- { label: "Don't ask again", value: "never" }
797
- ];
798
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(PermissionDialog, {
799
- title: "Try Claude Code Desktop",
800
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
801
- flexDirection: "column",
802
- paddingX: 2,
803
- paddingY: 1,
804
- children: [
805
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
806
- marginBottom: 1,
807
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
808
- children: "Same Claude Code with visual diffs, live app preview, parallel sessions, and more."
809
- }, undefined, false, undefined, this)
810
- }, undefined, false, undefined, this),
811
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
812
- options,
813
- onChange: handleSelect,
814
- onCancel: () => handleSelect("not-now")
815
- }, undefined, false, undefined, this)
816
- ]
817
- }, undefined, true, undefined, this)
818
- }, undefined, false, undefined, this);
819
- }
820
-
821
- // src/services/tips/tipRegistry.ts
822
- init_source();
823
- init_debug();
824
- init_fileHistory();
825
- init_settings();
826
- init_terminalSetup();
827
- init_src();
828
- init_OverageCreditUpsell();
829
- init_shortcutFormat();
830
- init_prompt();
831
- init_auth();
832
- init_concurrentSessions();
833
- init_config();
834
- init_effort();
835
- init_env();
836
- init_fileStateCache();
837
- init_git();
838
- init_ide();
839
- init_model();
840
- init_platform();
841
- init_installedPluginsManager();
842
- init_marketplaceManager();
843
- init_officialMarketplace();
844
- init_sessionStorage();
845
- init_growthbook();
846
- init_overageCreditGrant();
847
- init_referral();
848
-
849
- // src/services/tips/tipHistory.ts
850
- init_config();
851
- function recordTipShown(tipId) {
852
- const numStartups = getGlobalConfig().numStartups;
853
- saveGlobalConfig((c) => {
854
- const history = c.tipsHistory ?? {};
855
- if (history[tipId] === numStartups)
856
- return c;
857
- return { ...c, tipsHistory: { ...history, [tipId]: numStartups } };
858
- });
859
- }
860
- function getSessionsSinceLastShown(tipId) {
861
- const config = getGlobalConfig();
862
- const lastShown = config.tipsHistory?.[tipId];
863
- if (!lastShown)
864
- return Infinity;
865
- return config.numStartups - lastShown;
866
- }
867
-
868
- // src/services/tips/tipRegistry.ts
869
- var _isOfficialMarketplaceInstalledCache;
870
- async function isOfficialMarketplaceInstalled() {
871
- if (_isOfficialMarketplaceInstalledCache !== undefined) {
872
- return _isOfficialMarketplaceInstalledCache;
873
- }
874
- const config = await loadKnownMarketplacesConfigSafe();
875
- _isOfficialMarketplaceInstalledCache = OFFICIAL_MARKETPLACE_NAME in config;
876
- return _isOfficialMarketplaceInstalledCache;
877
- }
878
- async function isMarketplacePluginRelevant(pluginName, context, signals) {
879
- if (!await isOfficialMarketplaceInstalled()) {
880
- return false;
881
- }
882
- if (isPluginInstalled(`${pluginName}@${OFFICIAL_MARKETPLACE_NAME}`)) {
883
- return false;
884
- }
885
- const { bashTools } = context ?? {};
886
- if (signals.cli && bashTools?.size) {
887
- if (signals.cli.some((cmd) => bashTools.has(cmd))) {
888
- return true;
889
- }
890
- }
891
- if (signals.filePath && context?.readFileState) {
892
- const readFiles = cacheKeys(context.readFileState);
893
- if (readFiles.some((fp) => signals.filePath.test(fp))) {
894
- return true;
895
- }
896
- }
897
- return false;
898
- }
899
- var externalTips = [
900
- {
901
- id: "new-user-warmup",
902
- content: async () => `Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits`,
903
- cooldownSessions: 3,
904
- async isRelevant() {
905
- const config = getGlobalConfig();
906
- return config.numStartups < 10;
907
- }
908
- },
909
- {
910
- id: "plan-mode-for-complex-tasks",
911
- content: async () => `Use Plan Mode to prepare for a complex request before making changes. Press ${getShortcutDisplay("chat:cycleMode", "Chat", "shift+tab")} twice to enable.`,
912
- cooldownSessions: 5,
913
- isRelevant: async () => {
914
- if (process.env.USER_TYPE === "ant")
915
- return false;
916
- const config = getGlobalConfig();
917
- const daysSinceLastUse = config.lastPlanModeUse ? (Date.now() - config.lastPlanModeUse) / (1000 * 60 * 60 * 24) : Infinity;
918
- return daysSinceLastUse > 7;
919
- }
920
- },
921
- {
922
- id: "default-permission-mode-config",
923
- content: async () => `Use /config to change your default permission mode (including Plan Mode)`,
924
- cooldownSessions: 10,
925
- isRelevant: async () => {
926
- try {
927
- const config = getGlobalConfig();
928
- const settings = getSettings_DEPRECATED();
929
- const hasUsedPlanMode = Boolean(config.lastPlanModeUse);
930
- const hasDefaultMode = Boolean(settings?.permissions?.defaultMode);
931
- return hasUsedPlanMode && !hasDefaultMode;
932
- } catch (error) {
933
- logForDebugging(`Failed to check default-permission-mode-config tip relevance: ${error}`, { level: "warn" });
934
- return false;
935
- }
936
- }
937
- },
938
- {
939
- id: "git-worktrees",
940
- content: async () => "Use git worktrees to run multiple Claude sessions in parallel.",
941
- cooldownSessions: 10,
942
- isRelevant: async () => {
943
- try {
944
- const config = getGlobalConfig();
945
- const worktreeCount = await getWorktreeCount();
946
- return worktreeCount <= 1 && config.numStartups > 50;
947
- } catch (_) {
948
- return false;
949
- }
950
- }
951
- },
952
- {
953
- id: "color-when-multi-clauding",
954
- content: async () => "Running multiple Claude sessions? Use /color and /rename to tell them apart at a glance.",
955
- cooldownSessions: 10,
956
- isRelevant: async () => {
957
- if (getCurrentSessionAgentColor())
958
- return false;
959
- const count = await countConcurrentSessions();
960
- return count >= 2;
961
- }
962
- },
963
- {
964
- id: "terminal-setup",
965
- content: async () => env.terminal === "Apple_Terminal" ? "Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more" : "Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more",
966
- cooldownSessions: 10,
967
- async isRelevant() {
968
- const config = getGlobalConfig();
969
- if (env.terminal === "Apple_Terminal") {
970
- return !config.optionAsMetaKeyInstalled;
971
- }
972
- return !config.shiftEnterKeyBindingInstalled;
973
- }
974
- },
975
- {
976
- id: "shift-enter",
977
- content: async () => env.terminal === "Apple_Terminal" ? "Press Option+Enter to send a multi-line message" : "Press Shift+Enter to send a multi-line message",
978
- cooldownSessions: 10,
979
- async isRelevant() {
980
- const config = getGlobalConfig();
981
- return Boolean((env.terminal === "Apple_Terminal" ? config.optionAsMetaKeyInstalled : config.shiftEnterKeyBindingInstalled) && config.numStartups > 3);
982
- }
983
- },
984
- {
985
- id: "shift-enter-setup",
986
- content: async () => env.terminal === "Apple_Terminal" ? "Run /terminal-setup to enable Option+Enter for new lines" : "Run /terminal-setup to enable Shift+Enter for new lines",
987
- cooldownSessions: 10,
988
- async isRelevant() {
989
- if (!shouldOfferTerminalSetup()) {
990
- return false;
991
- }
992
- const config = getGlobalConfig();
993
- return !(env.terminal === "Apple_Terminal" ? config.optionAsMetaKeyInstalled : config.shiftEnterKeyBindingInstalled);
994
- }
995
- },
996
- {
997
- id: "memory-command",
998
- content: async () => "Use /memory to view and manage Claude memory",
999
- cooldownSessions: 15,
1000
- async isRelevant() {
1001
- const config = getGlobalConfig();
1002
- return config.memoryUsageCount <= 0;
1003
- }
1004
- },
1005
- {
1006
- id: "theme-command",
1007
- content: async () => "Use /theme to change the color theme",
1008
- cooldownSessions: 20,
1009
- isRelevant: async () => true
1010
- },
1011
- {
1012
- id: "colorterm-truecolor",
1013
- content: async () => "Try setting environment variable COLORTERM=truecolor for richer colors",
1014
- cooldownSessions: 30,
1015
- isRelevant: async () => !process.env.COLORTERM && source_default.level < 3
1016
- },
1017
- {
1018
- id: "powershell-tool-env",
1019
- content: async () => "Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)",
1020
- cooldownSessions: 10,
1021
- isRelevant: async () => getPlatform() === "windows" && process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL === undefined
1022
- },
1023
- {
1024
- id: "status-line",
1025
- content: async () => "Use /statusline to set up a custom status line that will display beneath the input box",
1026
- cooldownSessions: 25,
1027
- isRelevant: async () => getSettings_DEPRECATED().statusLine === undefined
1028
- },
1029
- {
1030
- id: "prompt-queue",
1031
- content: async () => "Hit Enter to queue up additional messages while Claude is working.",
1032
- cooldownSessions: 5,
1033
- async isRelevant() {
1034
- const config = getGlobalConfig();
1035
- return config.promptQueueUseCount <= 3;
1036
- }
1037
- },
1038
- {
1039
- id: "enter-to-steer-in-relatime",
1040
- content: async () => "Send messages to Claude while it works to steer Claude in real-time",
1041
- cooldownSessions: 20,
1042
- isRelevant: async () => true
1043
- },
1044
- {
1045
- id: "todo-list",
1046
- content: async () => "Ask Claude to create a todo list when working on complex tasks to track progress and remain on track",
1047
- cooldownSessions: 20,
1048
- isRelevant: async () => true
1049
- },
1050
- {
1051
- id: "vscode-command-install",
1052
- content: async () => `Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${env.terminal === "vscode" ? "code" : env.terminal}' command in PATH" to enable IDE integration`,
1053
- cooldownSessions: 0,
1054
- async isRelevant() {
1055
- if (!isSupportedVSCodeTerminal()) {
1056
- return false;
1057
- }
1058
- if (getPlatform() !== "macos") {
1059
- return false;
1060
- }
1061
- switch (env.terminal) {
1062
- case "vscode":
1063
- return !await isVSCodeInstalled();
1064
- case "cursor":
1065
- return !await isCursorInstalled();
1066
- case "windsurf":
1067
- return !await isWindsurfInstalled();
1068
- default:
1069
- return false;
1070
- }
1071
- }
1072
- },
1073
- {
1074
- id: "ide-upsell-external-terminal",
1075
- content: async () => "Connect Claude to your IDE \xB7 /ide",
1076
- cooldownSessions: 4,
1077
- async isRelevant() {
1078
- if (isSupportedTerminal()) {
1079
- return false;
1080
- }
1081
- const lockfiles = await getSortedIdeLockfiles();
1082
- if (lockfiles.length !== 0) {
1083
- return false;
1084
- }
1085
- const runningIDEs = await detectRunningIDEsCached();
1086
- return runningIDEs.length > 0;
1087
- }
1088
- },
1089
- {
1090
- id: "install-slack-app",
1091
- content: async () => "Run /install-slack-app to use Claude in Slack",
1092
- cooldownSessions: 10,
1093
- isRelevant: async () => !getGlobalConfig().slackAppInstallCount
1094
- },
1095
- {
1096
- id: "permissions",
1097
- content: async () => "Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools",
1098
- cooldownSessions: 10,
1099
- async isRelevant() {
1100
- const config = getGlobalConfig();
1101
- return config.numStartups > 10;
1102
- }
1103
- },
1104
- {
1105
- id: "drag-and-drop-images",
1106
- content: async () => "Did you know you can drag and drop image files into your terminal?",
1107
- cooldownSessions: 10,
1108
- isRelevant: async () => !env.isSSH()
1109
- },
1110
- {
1111
- id: "paste-images-mac",
1112
- content: async () => "Paste images into Claude Code using control+v (not cmd+v!)",
1113
- cooldownSessions: 10,
1114
- isRelevant: async () => getPlatform() === "macos"
1115
- },
1116
- {
1117
- id: "double-esc",
1118
- content: async () => "Double-tap esc to rewind the conversation to a previous point in time",
1119
- cooldownSessions: 10,
1120
- isRelevant: async () => !fileHistoryEnabled()
1121
- },
1122
- {
1123
- id: "double-esc-code-restore",
1124
- content: async () => "Double-tap esc to rewind the code and/or conversation to a previous point in time",
1125
- cooldownSessions: 10,
1126
- isRelevant: async () => fileHistoryEnabled()
1127
- },
1128
- {
1129
- id: "continue",
1130
- content: async () => "Run claude --continue or claude --resume to resume a conversation",
1131
- cooldownSessions: 10,
1132
- isRelevant: async () => true
1133
- },
1134
- {
1135
- id: "rename-conversation",
1136
- content: async () => "Name your conversations with /rename to find them easily in /resume later",
1137
- cooldownSessions: 15,
1138
- isRelevant: async () => isCustomTitleEnabled() && getGlobalConfig().numStartups > 10
1139
- },
1140
- {
1141
- id: "custom-commands",
1142
- content: async () => "Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project",
1143
- cooldownSessions: 15,
1144
- async isRelevant() {
1145
- const config = getGlobalConfig();
1146
- return config.numStartups > 10;
1147
- }
1148
- },
1149
- {
1150
- id: "shift-tab",
1151
- content: async () => process.env.USER_TYPE === "ant" ? `Hit ${getShortcutDisplay("chat:cycleMode", "Chat", "shift+tab")} to cycle between default mode and auto mode` : `Hit ${getShortcutDisplay("chat:cycleMode", "Chat", "shift+tab")} to cycle between default mode, auto-accept edit mode, and plan mode`,
1152
- cooldownSessions: 10,
1153
- isRelevant: async () => true
1154
- },
1155
- {
1156
- id: "image-paste",
1157
- content: async () => `Use ${getShortcutDisplay("chat:imagePaste", "Chat", "ctrl+v")} to paste images from your clipboard`,
1158
- cooldownSessions: 20,
1159
- isRelevant: async () => true
1160
- },
1161
- {
1162
- id: "custom-agents",
1163
- content: async () => "Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer",
1164
- cooldownSessions: 15,
1165
- async isRelevant() {
1166
- const config = getGlobalConfig();
1167
- return config.numStartups > 5;
1168
- }
1169
- },
1170
- {
1171
- id: "agent-flag",
1172
- content: async () => "Use --agent <agent_name> to directly start a conversation with a subagent",
1173
- cooldownSessions: 15,
1174
- async isRelevant() {
1175
- const config = getGlobalConfig();
1176
- return config.numStartups > 5;
1177
- }
1178
- },
1179
- {
1180
- id: "desktop-app",
1181
- content: async () => "Run Claude Code locally or remotely using the Claude desktop app: clau.de/desktop",
1182
- cooldownSessions: 15,
1183
- isRelevant: async () => getPlatform() !== "linux"
1184
- },
1185
- {
1186
- id: "desktop-shortcut",
1187
- content: async (ctx) => {
1188
- const blue = color("suggestion", ctx.theme);
1189
- return `Continue your session in Claude Code Desktop with ${blue("/desktop")}`;
1190
- },
1191
- cooldownSessions: 15,
1192
- isRelevant: async () => {
1193
- if (!getDesktopUpsellConfig().enable_shortcut_tip)
1194
- return false;
1195
- return process.platform === "darwin" || process.platform === "win32" && process.arch === "x64";
1196
- }
1197
- },
1198
- {
1199
- id: "web-app",
1200
- content: async () => "Run tasks in the cloud while you keep coding locally \xB7 clau.de/web",
1201
- cooldownSessions: 15,
1202
- isRelevant: async () => true
1203
- },
1204
- {
1205
- id: "mobile-app",
1206
- content: async () => "/mobile to use Claude Code from the Claude app on your phone",
1207
- cooldownSessions: 15,
1208
- isRelevant: async () => true
1209
- },
1210
- {
1211
- id: "opusplan-mode-reminder",
1212
- content: async () => `Your default model setting is Opus Plan Mode. Press ${getShortcutDisplay("chat:cycleMode", "Chat", "shift+tab")} twice to activate Plan Mode and plan with Claude Opus.`,
1213
- cooldownSessions: 2,
1214
- async isRelevant() {
1215
- if (process.env.USER_TYPE === "ant")
1216
- return false;
1217
- const config = getGlobalConfig();
1218
- const modelSetting = getUserSpecifiedModelSetting();
1219
- const hasOpusPlanMode = modelSetting === "opusplan";
1220
- const daysSinceLastUse = config.lastPlanModeUse ? (Date.now() - config.lastPlanModeUse) / (1000 * 60 * 60 * 24) : Infinity;
1221
- return hasOpusPlanMode && daysSinceLastUse > 3;
1222
- }
1223
- },
1224
- {
1225
- id: "frontend-design-plugin",
1226
- content: async (ctx) => {
1227
- const blue = color("suggestion", ctx.theme);
1228
- return `Working with HTML/CSS? Install the frontend-design plugin:
1229
- ${blue(`/plugin install frontend-design@${OFFICIAL_MARKETPLACE_NAME}`)}`;
1230
- },
1231
- cooldownSessions: 3,
1232
- isRelevant: async (context) => isMarketplacePluginRelevant("frontend-design", context, {
1233
- filePath: /\.(html|css|htm)$/i
1234
- })
1235
- },
1236
- {
1237
- id: "vercel-plugin",
1238
- content: async (ctx) => {
1239
- const blue = color("suggestion", ctx.theme);
1240
- return `Working with Vercel? Install the vercel plugin:
1241
- ${blue(`/plugin install vercel@${OFFICIAL_MARKETPLACE_NAME}`)}`;
1242
- },
1243
- cooldownSessions: 3,
1244
- isRelevant: async (context) => isMarketplacePluginRelevant("vercel", context, {
1245
- filePath: /(?:^|[/\\])vercel\.json$/i,
1246
- cli: ["vercel"]
1247
- })
1248
- },
1249
- {
1250
- id: "effort-high-nudge",
1251
- content: async (ctx) => {
1252
- const blue = color("suggestion", ctx.theme);
1253
- const cmd = blue("/effort high");
1254
- const variant = getFeatureValue_CACHED_MAY_BE_STALE("tengu_tide_elm", "off");
1255
- return variant === "copy_b" ? `Use ${cmd} for better one-shot answers. Claude thinks it through first.` : `Working on something tricky? ${cmd} gives better first answers`;
1256
- },
1257
- cooldownSessions: 3,
1258
- isRelevant: async () => {
1259
- if (!is1PApiCustomer())
1260
- return false;
1261
- if (!modelSupportsEffort(getMainLoopModel()))
1262
- return false;
1263
- if (getSettingsForSource("policySettings")?.effortLevel !== undefined) {
1264
- return false;
1265
- }
1266
- if (getEffortEnvOverride() !== undefined)
1267
- return false;
1268
- const persisted = getInitialSettings().effortLevel;
1269
- if (persisted === "high" || persisted === "max")
1270
- return false;
1271
- return getFeatureValue_CACHED_MAY_BE_STALE("tengu_tide_elm", "off") !== "off";
1272
- }
1273
- },
1274
- {
1275
- id: "subagent-fanout-nudge",
1276
- content: async (ctx) => {
1277
- const blue = color("suggestion", ctx.theme);
1278
- const variant = getFeatureValue_CACHED_MAY_BE_STALE("tengu_tern_alloy", "off");
1279
- return variant === "copy_b" ? `For big tasks, tell Claude to ${blue("use subagents")}. They work in parallel and keep your main thread clean.` : `Say ${blue('"fan out subagents"')} and Claude sends a team. Each one digs deep so nothing gets missed.`;
1280
- },
1281
- cooldownSessions: 3,
1282
- isRelevant: async () => {
1283
- if (!is1PApiCustomer())
1284
- return false;
1285
- return getFeatureValue_CACHED_MAY_BE_STALE("tengu_tern_alloy", "off") !== "off";
1286
- }
1287
- },
1288
- {
1289
- id: "loop-command-nudge",
1290
- content: async (ctx) => {
1291
- const blue = color("suggestion", ctx.theme);
1292
- const variant = getFeatureValue_CACHED_MAY_BE_STALE("tengu_timber_lark", "off");
1293
- return variant === "copy_b" ? `Use ${blue("/loop 5m check the deploy")} to run any prompt on a schedule. Set it and forget it.` : `${blue("/loop")} runs any prompt on a recurring schedule. Great for monitoring deploys, babysitting PRs, or polling status.`;
1294
- },
1295
- cooldownSessions: 3,
1296
- isRelevant: async () => {
1297
- if (!is1PApiCustomer())
1298
- return false;
1299
- if (!isKairosCronEnabled())
1300
- return false;
1301
- return getFeatureValue_CACHED_MAY_BE_STALE("tengu_timber_lark", "off") !== "off";
1302
- }
1303
- },
1304
- {
1305
- id: "guest-passes",
1306
- content: async (ctx) => {
1307
- const claude = color("claude", ctx.theme);
1308
- const reward = getCachedReferrerReward();
1309
- return reward ? `Share Claude Code and earn ${claude(formatCreditAmount(reward))} of extra usage \xB7 ${claude("/passes")}` : `You have free guest passes to share \xB7 ${claude("/passes")}`;
1310
- },
1311
- cooldownSessions: 3,
1312
- isRelevant: async () => {
1313
- const config = getGlobalConfig();
1314
- if (config.hasVisitedPasses) {
1315
- return false;
1316
- }
1317
- const { eligible } = checkCachedPassesEligibility();
1318
- return eligible;
1319
- }
1320
- },
1321
- {
1322
- id: "overage-credit",
1323
- content: async (ctx) => {
1324
- const claude = color("claude", ctx.theme);
1325
- const info = getCachedOverageCreditGrant();
1326
- const amount = info ? formatGrantAmount(info) : null;
1327
- if (!amount)
1328
- return "";
1329
- return `${claude(`${amount} in extra usage, on us`)} \xB7 third-party apps \xB7 ${claude("/extra-usage")}`;
1330
- },
1331
- cooldownSessions: 3,
1332
- isRelevant: async () => shouldShowOverageCreditUpsell()
1333
- },
1334
- {
1335
- id: "feedback-command",
1336
- content: async () => "Use /feedback to help us improve!",
1337
- cooldownSessions: 15,
1338
- async isRelevant() {
1339
- if (process.env.USER_TYPE === "ant") {
1340
- return false;
1341
- }
1342
- const config = getGlobalConfig();
1343
- return config.numStartups > 5;
1344
- }
1345
- }
1346
- ];
1347
- var internalOnlyTips = process.env.USER_TYPE === "ant" ? [
1348
- {
1349
- id: "important-claudemd",
1350
- content: async () => '[ANT-ONLY] Use "IMPORTANT:" prefix for must-follow CLAUDE.md rules',
1351
- cooldownSessions: 30,
1352
- isRelevant: async () => true
1353
- },
1354
- {
1355
- id: "skillify",
1356
- content: async () => "[ANT-ONLY] Use /skillify at the end of a workflow to turn it into a reusable skill",
1357
- cooldownSessions: 15,
1358
- isRelevant: async () => true
1359
- }
1360
- ] : [];
1361
- function getCustomTips() {
1362
- const settings = getInitialSettings();
1363
- const override = settings.spinnerTipsOverride;
1364
- if (!override?.tips?.length)
1365
- return [];
1366
- return override.tips.map((content, i) => ({
1367
- id: `custom-tip-${i}`,
1368
- content: async () => content,
1369
- cooldownSessions: 0,
1370
- isRelevant: async () => true
1371
- }));
1372
- }
1373
- async function getRelevantTips(context) {
1374
- const settings = getInitialSettings();
1375
- const override = settings.spinnerTipsOverride;
1376
- const customTips = getCustomTips();
1377
- if (override?.excludeDefault && customTips.length > 0) {
1378
- return customTips;
1379
- }
1380
- const tips = [...externalTips, ...internalOnlyTips];
1381
- const isRelevant = await Promise.all(tips.map((_) => _.isRelevant(context)));
1382
- const filtered = tips.filter((_, index) => isRelevant[index]).filter((_) => getSessionsSinceLastShown(_.id) >= _.cooldownSessions);
1383
- return [...filtered, ...customTips];
1384
- }
1385
-
1386
- // src/utils/model/deprecation.ts
1387
- init_providers();
1388
- var DEPRECATED_MODELS = {
1389
- "claude-3-opus": {
1390
- modelName: "Claude 3 Opus",
1391
- retirementDates: {
1392
- firstParty: "January 5, 2026",
1393
- openai: null
1394
- }
1395
- },
1396
- "claude-3-7-sonnet": {
1397
- modelName: "Claude 3.7 Sonnet",
1398
- retirementDates: {
1399
- firstParty: "February 19, 2026",
1400
- openai: null
1401
- }
1402
- },
1403
- "claude-3-5-haiku": {
1404
- modelName: "Claude 3.5 Haiku",
1405
- retirementDates: {
1406
- firstParty: "February 19, 2026",
1407
- openai: null
1408
- }
1409
- }
1410
- };
1411
- function getDeprecatedModelInfo(modelId) {
1412
- const lowercaseModelId = modelId.toLowerCase();
1413
- const provider = getAPIProvider();
1414
- for (const [key, value] of Object.entries(DEPRECATED_MODELS)) {
1415
- const retirementDate = value.retirementDates[provider];
1416
- if (!lowercaseModelId.includes(key) || !retirementDate) {
1417
- continue;
1418
- }
1419
- return {
1420
- isDeprecated: true,
1421
- modelName: value.modelName,
1422
- retirementDate
1423
- };
1424
- }
1425
- return { isDeprecated: false };
1426
- }
1427
- function getModelDeprecationWarning(modelId) {
1428
- if (!modelId) {
1429
- return null;
1430
- }
1431
- const info = getDeprecatedModelInfo(modelId);
1432
- if (!info.isDeprecated) {
1433
- return null;
1434
- }
1435
- return `\u26A0 ${info.modelName} will be retired on ${info.retirementDate}. Consider switching to a newer model.`;
1436
- }
1437
-
1438
- export { getExampleCommandFromCache, refreshExampleCommands, RemoteSessionManager, createRemoteSessionConfig, computeInitialTeamContext, initializeTeammateContextFromSession, recordTipShown, getSessionsSinceLastShown, shouldShowDesktopUpsellStartup, DesktopUpsellStartup, getRelevantTips, getModelDeprecationWarning };