@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,731 +0,0 @@
1
- // @bun
2
- import {
3
- getCurrentProjectConfig,
4
- getGlobalConfig,
5
- init_config,
6
- init_file,
7
- isDirEmpty,
8
- saveCurrentProjectConfig,
9
- saveGlobalConfig
10
- } from "./chunk-dfq6pbq7.js";
11
- import {
12
- addItemToJSONCArray,
13
- init_json,
14
- safeParseJSONC
15
- } from "./chunk-rnxctq9p.js";
16
- import {
17
- env,
18
- init_env
19
- } from "./chunk-5ekyhb1w.js";
20
- import {
21
- color,
22
- init_source,
23
- init_src,
24
- source_default,
25
- supportsHyperlinks
26
- } from "./chunk-c7jwbe76.js";
27
- import {
28
- execFileNoThrow,
29
- init_execFileNoThrow
30
- } from "./chunk-64r16v22.js";
31
- import {
32
- getCwd,
33
- init_cwd
34
- } from "./chunk-s8kj6ajy.js";
35
- import {
36
- getFsImplementation,
37
- getPlatform,
38
- init_debug,
39
- init_errors,
40
- init_fsOperations,
41
- init_log,
42
- init_platform,
43
- init_slowOperations,
44
- isENOENT,
45
- isFsInaccessible,
46
- jsonParse,
47
- jsonStringify,
48
- logError
49
- } from "./chunk-gg55fns0.js";
50
- import {
51
- init_memoize,
52
- memoize_default
53
- } from "./chunk-vf612n57.js";
54
- import {
55
- __esm
56
- } from "./chunk-qp2qdcda.js";
57
-
58
- // src/projectOnboardingState.ts
59
- import { join } from "path";
60
- function getSteps() {
61
- const hasClaudeMd = getFsImplementation().existsSync(join(getCwd(), "CLAUDE.md"));
62
- const isWorkspaceDirEmpty = isDirEmpty(getCwd());
63
- return [
64
- {
65
- key: "workspace",
66
- text: "Ask Claude to create a new app or clone a repository",
67
- isComplete: false,
68
- isCompletable: true,
69
- isEnabled: isWorkspaceDirEmpty
70
- },
71
- {
72
- key: "claudemd",
73
- text: "Run /init to create a CLAUDE.md file with instructions for Claude",
74
- isComplete: hasClaudeMd,
75
- isCompletable: true,
76
- isEnabled: !isWorkspaceDirEmpty
77
- }
78
- ];
79
- }
80
- function isProjectOnboardingComplete() {
81
- return getSteps().filter(({ isCompletable, isEnabled }) => isCompletable && isEnabled).every(({ isComplete }) => isComplete);
82
- }
83
- function maybeMarkProjectOnboardingComplete() {
84
- if (getCurrentProjectConfig().hasCompletedProjectOnboarding) {
85
- return;
86
- }
87
- if (isProjectOnboardingComplete()) {
88
- saveCurrentProjectConfig((current) => ({
89
- ...current,
90
- hasCompletedProjectOnboarding: true
91
- }));
92
- }
93
- }
94
- function incrementProjectOnboardingSeenCount() {
95
- saveCurrentProjectConfig((current) => ({
96
- ...current,
97
- projectOnboardingSeenCount: current.projectOnboardingSeenCount + 1
98
- }));
99
- }
100
- var shouldShowProjectOnboarding;
101
- var init_projectOnboardingState = __esm(() => {
102
- init_memoize();
103
- init_config();
104
- init_cwd();
105
- init_file();
106
- init_fsOperations();
107
- shouldShowProjectOnboarding = memoize_default(() => {
108
- const projectConfig = getCurrentProjectConfig();
109
- if (projectConfig.hasCompletedProjectOnboarding || projectConfig.projectOnboardingSeenCount >= 4 || process.env.IS_DEMO) {
110
- return false;
111
- }
112
- return !isProjectOnboardingComplete();
113
- });
114
- });
115
-
116
- // src/utils/appleTerminalBackup.ts
117
- import { stat } from "fs/promises";
118
- import { homedir } from "os";
119
- import { join as join2 } from "path";
120
- function markTerminalSetupInProgress(backupPath) {
121
- saveGlobalConfig((current) => ({
122
- ...current,
123
- appleTerminalSetupInProgress: true,
124
- appleTerminalBackupPath: backupPath
125
- }));
126
- }
127
- function markTerminalSetupComplete() {
128
- saveGlobalConfig((current) => ({
129
- ...current,
130
- appleTerminalSetupInProgress: false
131
- }));
132
- }
133
- function getTerminalRecoveryInfo() {
134
- const config = getGlobalConfig();
135
- return {
136
- inProgress: config.appleTerminalSetupInProgress ?? false,
137
- backupPath: config.appleTerminalBackupPath || null
138
- };
139
- }
140
- function getTerminalPlistPath() {
141
- return join2(homedir(), "Library", "Preferences", "com.apple.Terminal.plist");
142
- }
143
- async function backupTerminalPreferences() {
144
- const terminalPlistPath = getTerminalPlistPath();
145
- const backupPath = `${terminalPlistPath}.bak`;
146
- try {
147
- const { code } = await execFileNoThrow("defaults", [
148
- "export",
149
- "com.apple.Terminal",
150
- terminalPlistPath
151
- ]);
152
- if (code !== 0) {
153
- return null;
154
- }
155
- try {
156
- await stat(terminalPlistPath);
157
- } catch {
158
- return null;
159
- }
160
- await execFileNoThrow("defaults", [
161
- "export",
162
- "com.apple.Terminal",
163
- backupPath
164
- ]);
165
- markTerminalSetupInProgress(backupPath);
166
- return backupPath;
167
- } catch (error) {
168
- logError(error);
169
- return null;
170
- }
171
- }
172
- async function checkAndRestoreTerminalBackup() {
173
- const { inProgress, backupPath } = getTerminalRecoveryInfo();
174
- if (!inProgress) {
175
- return { status: "no_backup" };
176
- }
177
- if (!backupPath) {
178
- markTerminalSetupComplete();
179
- return { status: "no_backup" };
180
- }
181
- try {
182
- await stat(backupPath);
183
- } catch {
184
- markTerminalSetupComplete();
185
- return { status: "no_backup" };
186
- }
187
- try {
188
- const { code } = await execFileNoThrow("defaults", [
189
- "import",
190
- "com.apple.Terminal",
191
- backupPath
192
- ]);
193
- if (code !== 0) {
194
- return { status: "failed", backupPath };
195
- }
196
- await execFileNoThrow("killall", ["cfprefsd"]);
197
- markTerminalSetupComplete();
198
- return { status: "restored" };
199
- } catch (restoreError) {
200
- logError(new Error(`Failed to restore Terminal.app settings with: ${restoreError}`));
201
- markTerminalSetupComplete();
202
- return { status: "failed", backupPath };
203
- }
204
- }
205
- var init_appleTerminalBackup = __esm(() => {
206
- init_config();
207
- init_execFileNoThrow();
208
- init_log();
209
- });
210
-
211
- // src/utils/completionCache.ts
212
- import { mkdir, readFile, writeFile } from "fs/promises";
213
- import { homedir as homedir2 } from "os";
214
- import { dirname, join as join3 } from "path";
215
- import { pathToFileURL } from "url";
216
- function detectShell() {
217
- const shell = process.env.SHELL || "";
218
- const home = homedir2();
219
- const claudeDir = join3(home, ".claude");
220
- if (shell.endsWith("/zsh") || shell.endsWith("/zsh.exe")) {
221
- const cacheFile = join3(claudeDir, "completion.zsh");
222
- return {
223
- name: "zsh",
224
- rcFile: join3(home, ".zshrc"),
225
- cacheFile,
226
- completionLine: `[[ -f "${cacheFile}" ]] && source "${cacheFile}"`,
227
- shellFlag: "zsh"
228
- };
229
- }
230
- if (shell.endsWith("/bash") || shell.endsWith("/bash.exe")) {
231
- const cacheFile = join3(claudeDir, "completion.bash");
232
- return {
233
- name: "bash",
234
- rcFile: join3(home, ".bashrc"),
235
- cacheFile,
236
- completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`,
237
- shellFlag: "bash"
238
- };
239
- }
240
- if (shell.endsWith("/fish") || shell.endsWith("/fish.exe")) {
241
- const xdg = process.env.XDG_CONFIG_HOME || join3(home, ".config");
242
- const cacheFile = join3(claudeDir, "completion.fish");
243
- return {
244
- name: "fish",
245
- rcFile: join3(xdg, "fish", "config.fish"),
246
- cacheFile,
247
- completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`,
248
- shellFlag: "fish"
249
- };
250
- }
251
- return null;
252
- }
253
- function formatPathLink(filePath) {
254
- if (!supportsHyperlinks()) {
255
- return filePath;
256
- }
257
- const fileUrl = pathToFileURL(filePath).href;
258
- return `\x1B]8;;${fileUrl}\x07${filePath}\x1B]8;;\x07`;
259
- }
260
- async function setupShellCompletion(theme) {
261
- const shell = detectShell();
262
- if (!shell) {
263
- return "";
264
- }
265
- try {
266
- await mkdir(dirname(shell.cacheFile), { recursive: true });
267
- } catch (e) {
268
- logError(e);
269
- return `${EOL}${color("warning", theme)(`Could not write ${shell.name} completion cache`)}${EOL}${source_default.dim(`Run manually: claude completion ${shell.shellFlag} > ${shell.cacheFile}`)}${EOL}`;
270
- }
271
- const claudeBin = process.argv[1] || "claude";
272
- const result = await execFileNoThrow(claudeBin, [
273
- "completion",
274
- shell.shellFlag,
275
- "--output",
276
- shell.cacheFile
277
- ]);
278
- if (result.code !== 0) {
279
- return `${EOL}${color("warning", theme)(`Could not generate ${shell.name} shell completions`)}${EOL}${source_default.dim(`Run manually: claude completion ${shell.shellFlag} > ${shell.cacheFile}`)}${EOL}`;
280
- }
281
- let existing = "";
282
- try {
283
- existing = await readFile(shell.rcFile, { encoding: "utf-8" });
284
- if (existing.includes("claude completion") || existing.includes(shell.cacheFile)) {
285
- return `${EOL}${color("success", theme)(`Shell completions updated for ${shell.name}`)}${EOL}${source_default.dim(`See ${formatPathLink(shell.rcFile)}`)}${EOL}`;
286
- }
287
- } catch (e) {
288
- if (!isENOENT(e)) {
289
- logError(e);
290
- return `${EOL}${color("warning", theme)(`Could not install ${shell.name} shell completions`)}${EOL}${source_default.dim(`Add this to ${formatPathLink(shell.rcFile)}:`)}${EOL}${source_default.dim(shell.completionLine)}${EOL}`;
291
- }
292
- }
293
- try {
294
- const configDir = dirname(shell.rcFile);
295
- await mkdir(configDir, { recursive: true });
296
- const separator = existing && !existing.endsWith(`
297
- `) ? `
298
- ` : "";
299
- const content = `${existing}${separator}
300
- # Claude Code shell completions
301
- ${shell.completionLine}
302
- `;
303
- await writeFile(shell.rcFile, content, { encoding: "utf-8" });
304
- return `${EOL}${color("success", theme)(`Installed ${shell.name} shell completions`)}${EOL}${source_default.dim(`Added to ${formatPathLink(shell.rcFile)}`)}${EOL}${source_default.dim(`Run: source ${shell.rcFile}`)}${EOL}`;
305
- } catch (error) {
306
- logError(error);
307
- return `${EOL}${color("warning", theme)(`Could not install ${shell.name} shell completions`)}${EOL}${source_default.dim(`Add this to ${formatPathLink(shell.rcFile)}:`)}${EOL}${source_default.dim(shell.completionLine)}${EOL}`;
308
- }
309
- }
310
- var EOL = `
311
- `;
312
- var init_completionCache = __esm(() => {
313
- init_source();
314
- init_src();
315
- init_src();
316
- init_debug();
317
- init_errors();
318
- init_execFileNoThrow();
319
- init_log();
320
- });
321
-
322
- // src/commands/terminalSetup/terminalSetup.tsx
323
- import { randomBytes } from "crypto";
324
- import { copyFile, mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2 } from "fs/promises";
325
- import { homedir as homedir3, platform } from "os";
326
- import { dirname as dirname2, join as join4 } from "path";
327
- import { pathToFileURL as pathToFileURL2 } from "url";
328
- function isVSCodeRemoteSSH() {
329
- const askpassMain = process.env.VSCODE_GIT_ASKPASS_MAIN ?? "";
330
- const path = process.env.PATH ?? "";
331
- return askpassMain.includes(".vscode-server") || askpassMain.includes(".cursor-server") || askpassMain.includes(".windsurf-server") || path.includes(".vscode-server") || path.includes(".cursor-server") || path.includes(".windsurf-server");
332
- }
333
- function getNativeCSIuTerminalDisplayName() {
334
- if (!env.terminal || !(env.terminal in NATIVE_CSIU_TERMINALS)) {
335
- return null;
336
- }
337
- return NATIVE_CSIU_TERMINALS[env.terminal] ?? null;
338
- }
339
- function formatPathLink2(filePath) {
340
- if (!supportsHyperlinks()) {
341
- return filePath;
342
- }
343
- const fileUrl = pathToFileURL2(filePath).href;
344
- return `\x1B]8;;${fileUrl}\x07${filePath}\x1B]8;;\x07`;
345
- }
346
- function shouldOfferTerminalSetup() {
347
- return platform() === "darwin" && env.terminal === "Apple_Terminal" || env.terminal === "vscode" || env.terminal === "cursor" || env.terminal === "windsurf" || env.terminal === "alacritty" || env.terminal === "zed";
348
- }
349
- async function setupTerminal(theme) {
350
- let result = "";
351
- switch (env.terminal) {
352
- case "Apple_Terminal":
353
- result = await enableOptionAsMetaForTerminal(theme);
354
- break;
355
- case "vscode":
356
- result = await installBindingsForVSCodeTerminal("VSCode", theme);
357
- break;
358
- case "cursor":
359
- result = await installBindingsForVSCodeTerminal("Cursor", theme);
360
- break;
361
- case "windsurf":
362
- result = await installBindingsForVSCodeTerminal("Windsurf", theme);
363
- break;
364
- case "alacritty":
365
- result = await installBindingsForAlacritty(theme);
366
- break;
367
- case "zed":
368
- result = await installBindingsForZed(theme);
369
- break;
370
- case null:
371
- break;
372
- }
373
- saveGlobalConfig((current) => {
374
- if (["vscode", "cursor", "windsurf", "alacritty", "zed"].includes(env.terminal ?? "")) {
375
- if (current.shiftEnterKeyBindingInstalled === true)
376
- return current;
377
- return { ...current, shiftEnterKeyBindingInstalled: true };
378
- } else if (env.terminal === "Apple_Terminal") {
379
- if (current.optionAsMetaKeyInstalled === true)
380
- return current;
381
- return { ...current, optionAsMetaKeyInstalled: true };
382
- }
383
- return current;
384
- });
385
- maybeMarkProjectOnboardingComplete();
386
- if (process.env.USER_TYPE === "ant") {
387
- result += await setupShellCompletion(theme);
388
- }
389
- return result;
390
- }
391
- function isShiftEnterKeyBindingInstalled() {
392
- return getGlobalConfig().shiftEnterKeyBindingInstalled === true;
393
- }
394
- function hasUsedBackslashReturn() {
395
- return getGlobalConfig().hasUsedBackslashReturn === true;
396
- }
397
- function markBackslashReturnUsed() {
398
- const config = getGlobalConfig();
399
- if (!config.hasUsedBackslashReturn) {
400
- saveGlobalConfig((current) => ({
401
- ...current,
402
- hasUsedBackslashReturn: true
403
- }));
404
- }
405
- }
406
- async function call(onDone, context, _args) {
407
- if (env.terminal && env.terminal in NATIVE_CSIU_TERMINALS) {
408
- const message = `Shift+Enter is natively supported in ${NATIVE_CSIU_TERMINALS[env.terminal]}.
409
-
410
- No configuration needed. Just use Shift+Enter to add newlines.`;
411
- onDone(message);
412
- return null;
413
- }
414
- if (!shouldOfferTerminalSetup()) {
415
- const terminalName = env.terminal || "your current terminal";
416
- const currentPlatform = getPlatform();
417
- let platformTerminals = "";
418
- if (currentPlatform === "macos") {
419
- platformTerminals = ` \u2022 macOS: Apple Terminal
420
- `;
421
- } else if (currentPlatform === "windows") {
422
- platformTerminals = ` \u2022 Windows: Windows Terminal
423
- `;
424
- }
425
- const message = `Terminal setup cannot be run from ${terminalName}.
426
-
427
- This command configures a convenient Shift+Enter shortcut for multi-line prompts.
428
- ${source_default.dim("Note: You can already use backslash (\\\\) + return to add newlines.")}
429
-
430
- To set up the shortcut (optional):
431
- 1. Exit tmux/screen temporarily
432
- 2. Run /terminal-setup directly in one of these terminals:
433
- ${platformTerminals} \u2022 IDE: VSCode, Cursor, Windsurf, Zed
434
- \u2022 Other: Alacritty
435
- 3. Return to tmux/screen - settings will persist
436
-
437
- ${source_default.dim("Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter natively.")}`;
438
- onDone(message);
439
- return null;
440
- }
441
- const result = await setupTerminal(context.options.theme);
442
- onDone(result);
443
- return null;
444
- }
445
- async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) {
446
- if (isVSCodeRemoteSSH()) {
447
- return `${color("warning", theme)(`Cannot install keybindings from a remote ${editor} session.`)}${EOL2}${EOL2}${editor} keybindings must be installed on your local machine, not the remote server.${EOL2}${EOL2}To install the Shift+Enter keybinding:${EOL2}1. Open ${editor} on your local machine (not connected to remote)${EOL2}2. Open the Command Palette (Cmd/Ctrl+Shift+P) \u2192 "Preferences: Open Keyboard Shortcuts (JSON)"${EOL2}3. Add this keybinding (the file must be a JSON array):${EOL2}${EOL2}${source_default.dim(`[
448
- {
449
- "key": "shift+enter",
450
- "command": "workbench.action.terminal.sendSequence",
451
- "args": { "text": "\\u001b\\r" },
452
- "when": "terminalFocus"
453
- }
454
- ]`)}${EOL2}`;
455
- }
456
- const editorDir = editor === "VSCode" ? "Code" : editor;
457
- const userDirPath = join4(homedir3(), platform() === "win32" ? join4("AppData", "Roaming", editorDir, "User") : platform() === "darwin" ? join4("Library", "Application Support", editorDir, "User") : join4(".config", editorDir, "User"));
458
- const keybindingsPath = join4(userDirPath, "keybindings.json");
459
- try {
460
- await mkdir2(userDirPath, { recursive: true });
461
- let content = "[]";
462
- let keybindings = [];
463
- let fileExists = false;
464
- try {
465
- content = await readFile2(keybindingsPath, { encoding: "utf-8" });
466
- fileExists = true;
467
- keybindings = safeParseJSONC(content) ?? [];
468
- } catch (e) {
469
- if (!isFsInaccessible(e))
470
- throw e;
471
- }
472
- if (fileExists) {
473
- const randomSha = randomBytes(4).toString("hex");
474
- const backupPath = `${keybindingsPath}.${randomSha}.bak`;
475
- try {
476
- await copyFile(keybindingsPath, backupPath);
477
- } catch {
478
- return `${color("warning", theme)(`Error backing up existing ${editor} terminal keybindings. Bailing out.`)}${EOL2}${source_default.dim(`See ${formatPathLink2(keybindingsPath)}`)}${EOL2}${source_default.dim(`Backup path: ${formatPathLink2(backupPath)}`)}${EOL2}`;
479
- }
480
- }
481
- const existingBinding = keybindings.find((binding) => binding.key === "shift+enter" && binding.command === "workbench.action.terminal.sendSequence" && binding.when === "terminalFocus");
482
- if (existingBinding) {
483
- return `${color("warning", theme)(`Found existing ${editor} terminal Shift+Enter key binding. Remove it to continue.`)}${EOL2}${source_default.dim(`See ${formatPathLink2(keybindingsPath)}`)}${EOL2}`;
484
- }
485
- const newKeybinding = {
486
- key: "shift+enter",
487
- command: "workbench.action.terminal.sendSequence",
488
- args: { text: "\x1B\r" },
489
- when: "terminalFocus"
490
- };
491
- const updatedContent = addItemToJSONCArray(content, newKeybinding);
492
- await writeFile2(keybindingsPath, updatedContent, { encoding: "utf-8" });
493
- return `${color("success", theme)(`Installed ${editor} terminal Shift+Enter key binding`)}${EOL2}${source_default.dim(`See ${formatPathLink2(keybindingsPath)}`)}${EOL2}`;
494
- } catch (error) {
495
- logError(error);
496
- throw new Error(`Failed to install ${editor} terminal Shift+Enter key binding`);
497
- }
498
- }
499
- async function enableOptionAsMetaForProfile(profileName) {
500
- const { code: addCode } = await execFileNoThrow("/usr/libexec/PlistBuddy", [
501
- "-c",
502
- `Add :'Window Settings':'${profileName}':useOptionAsMetaKey bool true`,
503
- getTerminalPlistPath()
504
- ]);
505
- if (addCode !== 0) {
506
- const { code: setCode } = await execFileNoThrow("/usr/libexec/PlistBuddy", [
507
- "-c",
508
- `Set :'Window Settings':'${profileName}':useOptionAsMetaKey true`,
509
- getTerminalPlistPath()
510
- ]);
511
- if (setCode !== 0) {
512
- logError(new Error(`Failed to enable Option as Meta key for Terminal.app profile: ${profileName}`));
513
- return false;
514
- }
515
- }
516
- return true;
517
- }
518
- async function disableAudioBellForProfile(profileName) {
519
- const { code: addCode } = await execFileNoThrow("/usr/libexec/PlistBuddy", [
520
- "-c",
521
- `Add :'Window Settings':'${profileName}':Bell bool false`,
522
- getTerminalPlistPath()
523
- ]);
524
- if (addCode !== 0) {
525
- const { code: setCode } = await execFileNoThrow("/usr/libexec/PlistBuddy", [
526
- "-c",
527
- `Set :'Window Settings':'${profileName}':Bell false`,
528
- getTerminalPlistPath()
529
- ]);
530
- if (setCode !== 0) {
531
- logError(new Error(`Failed to disable audio bell for Terminal.app profile: ${profileName}`));
532
- return false;
533
- }
534
- }
535
- return true;
536
- }
537
- async function enableOptionAsMetaForTerminal(theme) {
538
- try {
539
- const backupPath = await backupTerminalPreferences();
540
- if (!backupPath) {
541
- throw new Error("Failed to create backup of Terminal.app preferences, bailing out");
542
- }
543
- const { stdout: defaultProfile, code: readCode } = await execFileNoThrow("defaults", ["read", "com.apple.Terminal", "Default Window Settings"]);
544
- if (readCode !== 0 || !defaultProfile.trim()) {
545
- throw new Error("Failed to read default Terminal.app profile");
546
- }
547
- const { stdout: startupProfile, code: startupCode } = await execFileNoThrow("defaults", ["read", "com.apple.Terminal", "Startup Window Settings"]);
548
- if (startupCode !== 0 || !startupProfile.trim()) {
549
- throw new Error("Failed to read startup Terminal.app profile");
550
- }
551
- let wasAnyProfileUpdated = false;
552
- const defaultProfileName = defaultProfile.trim();
553
- const optionAsMetaEnabled = await enableOptionAsMetaForProfile(defaultProfileName);
554
- const audioBellDisabled = await disableAudioBellForProfile(defaultProfileName);
555
- if (optionAsMetaEnabled || audioBellDisabled) {
556
- wasAnyProfileUpdated = true;
557
- }
558
- const startupProfileName = startupProfile.trim();
559
- if (startupProfileName !== defaultProfileName) {
560
- const startupOptionAsMetaEnabled = await enableOptionAsMetaForProfile(startupProfileName);
561
- const startupAudioBellDisabled = await disableAudioBellForProfile(startupProfileName);
562
- if (startupOptionAsMetaEnabled || startupAudioBellDisabled) {
563
- wasAnyProfileUpdated = true;
564
- }
565
- }
566
- if (!wasAnyProfileUpdated) {
567
- throw new Error("Failed to enable Option as Meta key or disable audio bell for any Terminal.app profile");
568
- }
569
- await execFileNoThrow("killall", ["cfprefsd"]);
570
- markTerminalSetupComplete();
571
- return `${color("success", theme)(`Configured Terminal.app settings:`)}${EOL2}${color("success", theme)('- Enabled "Use Option as Meta key"')}${EOL2}${color("success", theme)("- Switched to visual bell")}${EOL2}${source_default.dim("Option+Enter will now enter a newline.")}${EOL2}${source_default.dim("You must restart Terminal.app for changes to take effect.", theme)}${EOL2}`;
572
- } catch (error) {
573
- logError(error);
574
- const restoreResult = await checkAndRestoreTerminalBackup();
575
- const errorMessage = "Failed to enable Option as Meta key for Terminal.app.";
576
- if (restoreResult.status === "restored") {
577
- throw new Error(`${errorMessage} Your settings have been restored from backup.`);
578
- } else if (restoreResult.status === "failed") {
579
- throw new Error(`${errorMessage} Restoring from backup failed, try manually with: defaults import com.apple.Terminal ${restoreResult.backupPath}`);
580
- } else {
581
- throw new Error(`${errorMessage} No backup was available to restore from.`);
582
- }
583
- }
584
- }
585
- async function installBindingsForAlacritty(theme) {
586
- const ALACRITTY_KEYBINDING = `[[keyboard.bindings]]
587
- key = "Return"
588
- mods = "Shift"
589
- chars = "\\u001B\\r"`;
590
- const configPaths = [];
591
- const xdgConfigHome = process.env.XDG_CONFIG_HOME;
592
- if (xdgConfigHome) {
593
- configPaths.push(join4(xdgConfigHome, "alacritty", "alacritty.toml"));
594
- } else {
595
- configPaths.push(join4(homedir3(), ".config", "alacritty", "alacritty.toml"));
596
- }
597
- if (platform() === "win32") {
598
- const appData = process.env.APPDATA;
599
- if (appData) {
600
- configPaths.push(join4(appData, "alacritty", "alacritty.toml"));
601
- }
602
- }
603
- let configPath = null;
604
- let configContent = "";
605
- let configExists = false;
606
- for (const path of configPaths) {
607
- try {
608
- configContent = await readFile2(path, { encoding: "utf-8" });
609
- configPath = path;
610
- configExists = true;
611
- break;
612
- } catch (e) {
613
- if (!isFsInaccessible(e))
614
- throw e;
615
- }
616
- }
617
- if (!configPath) {
618
- configPath = configPaths[0] ?? null;
619
- }
620
- if (!configPath) {
621
- throw new Error("No valid config path found for Alacritty");
622
- }
623
- try {
624
- if (configExists) {
625
- if (configContent.includes('mods = "Shift"') && configContent.includes('key = "Return"')) {
626
- return `${color("warning", theme)("Found existing Alacritty Shift+Enter key binding. Remove it to continue.")}${EOL2}${source_default.dim(`See ${formatPathLink2(configPath)}`)}${EOL2}`;
627
- }
628
- const randomSha = randomBytes(4).toString("hex");
629
- const backupPath = `${configPath}.${randomSha}.bak`;
630
- try {
631
- await copyFile(configPath, backupPath);
632
- } catch {
633
- return `${color("warning", theme)("Error backing up existing Alacritty config. Bailing out.")}${EOL2}${source_default.dim(`See ${formatPathLink2(configPath)}`)}${EOL2}${source_default.dim(`Backup path: ${formatPathLink2(backupPath)}`)}${EOL2}`;
634
- }
635
- } else {
636
- await mkdir2(dirname2(configPath), { recursive: true });
637
- }
638
- let updatedContent = configContent;
639
- if (configContent && !configContent.endsWith(`
640
- `)) {
641
- updatedContent += `
642
- `;
643
- }
644
- updatedContent += `
645
- ` + ALACRITTY_KEYBINDING + `
646
- `;
647
- await writeFile2(configPath, updatedContent, { encoding: "utf-8" });
648
- return `${color("success", theme)("Installed Alacritty Shift+Enter key binding")}${EOL2}${color("success", theme)("You may need to restart Alacritty for changes to take effect")}${EOL2}${source_default.dim(`See ${formatPathLink2(configPath)}`)}${EOL2}`;
649
- } catch (error) {
650
- logError(error);
651
- throw new Error("Failed to install Alacritty Shift+Enter key binding");
652
- }
653
- }
654
- async function installBindingsForZed(theme) {
655
- const zedDir = join4(homedir3(), ".config", "zed");
656
- const keymapPath = join4(zedDir, "keymap.json");
657
- try {
658
- await mkdir2(zedDir, { recursive: true });
659
- let keymapContent = "[]";
660
- let fileExists = false;
661
- try {
662
- keymapContent = await readFile2(keymapPath, { encoding: "utf-8" });
663
- fileExists = true;
664
- } catch (e) {
665
- if (!isFsInaccessible(e))
666
- throw e;
667
- }
668
- if (fileExists) {
669
- if (keymapContent.includes("shift-enter")) {
670
- return `${color("warning", theme)("Found existing Zed Shift+Enter key binding. Remove it to continue.")}${EOL2}${source_default.dim(`See ${formatPathLink2(keymapPath)}`)}${EOL2}`;
671
- }
672
- const randomSha = randomBytes(4).toString("hex");
673
- const backupPath = `${keymapPath}.${randomSha}.bak`;
674
- try {
675
- await copyFile(keymapPath, backupPath);
676
- } catch {
677
- return `${color("warning", theme)("Error backing up existing Zed keymap. Bailing out.")}${EOL2}${source_default.dim(`See ${formatPathLink2(keymapPath)}`)}${EOL2}${source_default.dim(`Backup path: ${formatPathLink2(backupPath)}`)}${EOL2}`;
678
- }
679
- }
680
- let keymap;
681
- try {
682
- keymap = jsonParse(keymapContent);
683
- if (!Array.isArray(keymap)) {
684
- keymap = [];
685
- }
686
- } catch {
687
- keymap = [];
688
- }
689
- keymap.push({
690
- context: "Terminal",
691
- bindings: {
692
- "shift-enter": ["terminal::SendText", "\x1B\r"]
693
- }
694
- });
695
- await writeFile2(keymapPath, jsonStringify(keymap, null, 2) + `
696
- `, {
697
- encoding: "utf-8"
698
- });
699
- return `${color("success", theme)("Installed Zed Shift+Enter key binding")}${EOL2}${source_default.dim(`See ${formatPathLink2(keymapPath)}`)}${EOL2}`;
700
- } catch (error) {
701
- logError(error);
702
- throw new Error("Failed to install Zed Shift+Enter key binding");
703
- }
704
- }
705
- var EOL2 = `
706
- `, NATIVE_CSIU_TERMINALS;
707
- var init_terminalSetup = __esm(() => {
708
- init_source();
709
- init_src();
710
- init_src();
711
- init_projectOnboardingState();
712
- init_appleTerminalBackup();
713
- init_completionCache();
714
- init_config();
715
- init_env();
716
- init_errors();
717
- init_execFileNoThrow();
718
- init_json();
719
- init_log();
720
- init_platform();
721
- init_slowOperations();
722
- NATIVE_CSIU_TERMINALS = {
723
- ghostty: "Ghostty",
724
- kitty: "Kitty",
725
- "iTerm.app": "iTerm2",
726
- WezTerm: "WezTerm",
727
- WarpTerminal: "Warp"
728
- };
729
- });
730
-
731
- export { getSteps, maybeMarkProjectOnboardingComplete, shouldShowProjectOnboarding, incrementProjectOnboardingSeenCount, init_projectOnboardingState, checkAndRestoreTerminalBackup, init_appleTerminalBackup, getNativeCSIuTerminalDisplayName, shouldOfferTerminalSetup, setupTerminal, isShiftEnterKeyBindingInstalled, hasUsedBackslashReturn, markBackslashReturnUsed, call, init_terminalSetup };