jialing-code 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (460) hide show
  1. package/README.md +97 -0
  2. package/dist/chunk-065m026w.js +97 -0
  3. package/dist/chunk-06saje2v.js +39 -0
  4. package/dist/chunk-0731m51q.js +8 -0
  5. package/dist/chunk-0975ccyw.js +265 -0
  6. package/dist/chunk-09n3fjx5.js +67 -0
  7. package/dist/chunk-0bdjdzew.js +41 -0
  8. package/dist/chunk-0ce6kd7y.js +212 -0
  9. package/dist/chunk-0e1xsncc.js +969 -0
  10. package/dist/chunk-0m2861gw.js +154 -0
  11. package/dist/chunk-0paqc2yw.js +15 -0
  12. package/dist/chunk-0rg6yrhy.js +99 -0
  13. package/dist/chunk-0sakxrcf.js +643 -0
  14. package/dist/chunk-0v9hwxvz.js +105 -0
  15. package/dist/chunk-0vkfrmqm.js +690 -0
  16. package/dist/chunk-0vvfnhhv.js +248 -0
  17. package/dist/chunk-0w4rsycj.js +145 -0
  18. package/dist/chunk-0x9b2nmd.js +63 -0
  19. package/dist/chunk-0xjaqda8.js +1124 -0
  20. package/dist/chunk-1141xmr4.js +8 -0
  21. package/dist/chunk-13d1842d.js +154 -0
  22. package/dist/chunk-1921a6yb.js +32 -0
  23. package/dist/chunk-1ad8mk9g.js +527 -0
  24. package/dist/chunk-1ax41pws.js +28 -0
  25. package/dist/chunk-1c8z1b5v.js +16 -0
  26. package/dist/chunk-1cbn5kxf.js +7 -0
  27. package/dist/chunk-1eapde8a.js +726 -0
  28. package/dist/chunk-1h2famwb.js +49 -0
  29. package/dist/chunk-1jggnf7z.js +85 -0
  30. package/dist/chunk-1k92pn9c.js +32 -0
  31. package/dist/chunk-1qakq4sn.js +802 -0
  32. package/dist/chunk-1rvz0433.js +722 -0
  33. package/dist/chunk-1xkekb9y.js +19 -0
  34. package/dist/chunk-238g70xa.js +36 -0
  35. package/dist/chunk-24ge0eqa.js +106 -0
  36. package/dist/chunk-278vghwm.js +5395 -0
  37. package/dist/chunk-27xc1csx.js +104 -0
  38. package/dist/chunk-2a42s11t.js +412 -0
  39. package/dist/chunk-2aa02aw6.js +438 -0
  40. package/dist/chunk-2eykm0j0.js +20 -0
  41. package/dist/chunk-2gzv8nrw.js +205 -0
  42. package/dist/chunk-2k995y2x.js +880 -0
  43. package/dist/chunk-2nayx6q1.js +63 -0
  44. package/dist/chunk-2sd2w2h4.js +44 -0
  45. package/dist/chunk-2tw2ve8h.js +145 -0
  46. package/dist/chunk-30rst83v.js +168 -0
  47. package/dist/chunk-3aavh06g.js +1581 -0
  48. package/dist/chunk-3b0yvt2h.js +469 -0
  49. package/dist/chunk-3be7ka25.js +56 -0
  50. package/dist/chunk-3c25bcsw.js +17 -0
  51. package/dist/chunk-3dyxka97.js +584 -0
  52. package/dist/chunk-3f7rypmf.js +16544 -0
  53. package/dist/chunk-3fsd7f51.js +93 -0
  54. package/dist/chunk-3gqdqmzb.js +75 -0
  55. package/dist/chunk-3h8a89gy.js +46 -0
  56. package/dist/chunk-3m84sret.js +71 -0
  57. package/dist/chunk-3nb7j3js.js +96 -0
  58. package/dist/chunk-3p08nvn2.js +98 -0
  59. package/dist/chunk-3r09htpc.js +318 -0
  60. package/dist/chunk-3r24h7t6.js +113 -0
  61. package/dist/chunk-3rkfxjtq.js +80 -0
  62. package/dist/chunk-3tmk7dc2.js +604 -0
  63. package/dist/chunk-3w6s9m5w.js +16 -0
  64. package/dist/chunk-43qjymy5.js +92 -0
  65. package/dist/chunk-44fpr6jq.js +434 -0
  66. package/dist/chunk-45kxdsp8.js +444 -0
  67. package/dist/chunk-495d85x1.js +8066 -0
  68. package/dist/chunk-4ba796se.js +1095 -0
  69. package/dist/chunk-4g3v8y12.js +23 -0
  70. package/dist/chunk-4h53xj8n.js +3445 -0
  71. package/dist/chunk-4jm600zv.js +13 -0
  72. package/dist/chunk-4jy9dtwk.js +116 -0
  73. package/dist/chunk-4p60dd45.js +55 -0
  74. package/dist/chunk-4z0jsrqg.js +81 -0
  75. package/dist/chunk-4zfkzkt6.js +37 -0
  76. package/dist/chunk-55wgxwa9.js +13877 -0
  77. package/dist/chunk-5dbk24zg.js +890 -0
  78. package/dist/chunk-5hzvp4va.js +115 -0
  79. package/dist/chunk-5kbt1mbt.js +500 -0
  80. package/dist/chunk-5pen7vr8.js +176 -0
  81. package/dist/chunk-5r280eng.js +198 -0
  82. package/dist/chunk-5srym52s.js +88 -0
  83. package/dist/chunk-600kg7k6.js +41 -0
  84. package/dist/chunk-616w0qj3.js +160 -0
  85. package/dist/chunk-62jw1t8c.js +94 -0
  86. package/dist/chunk-62xmt9mk.js +372 -0
  87. package/dist/chunk-64bvg7c3.js +229 -0
  88. package/dist/chunk-65yhe4s0.js +281 -0
  89. package/dist/chunk-6aewh27m.js +102 -0
  90. package/dist/chunk-6bd8brc4.js +48 -0
  91. package/dist/chunk-6dj5t602.js +341 -0
  92. package/dist/chunk-6exxdk1p.js +6956 -0
  93. package/dist/chunk-6f5j8fs0.js +752 -0
  94. package/dist/chunk-6g62sjpf.js +328 -0
  95. package/dist/chunk-6gecq2ta.js +1493 -0
  96. package/dist/chunk-6gr3c3w9.js +378 -0
  97. package/dist/chunk-6kpbgc5w.js +23 -0
  98. package/dist/chunk-6kseqw79.js +154 -0
  99. package/dist/chunk-6mxm1qd0.js +40764 -0
  100. package/dist/chunk-6n2qgm9v.js +8 -0
  101. package/dist/chunk-6tq2v3rk.js +186 -0
  102. package/dist/chunk-6wsdhj3v.js +93 -0
  103. package/dist/chunk-6zw9fhgb.js +4389 -0
  104. package/dist/chunk-71grc1mw.js +111 -0
  105. package/dist/chunk-73rpbt04.js +1947 -0
  106. package/dist/chunk-748feghg.js +604 -0
  107. package/dist/chunk-75e8gtg9.js +84 -0
  108. package/dist/chunk-75th4717.js +780 -0
  109. package/dist/chunk-760252na.js +101 -0
  110. package/dist/chunk-7739pg2c.js +4261 -0
  111. package/dist/chunk-778fnx46.js +472 -0
  112. package/dist/chunk-77g09znh.js +391 -0
  113. package/dist/chunk-7aw745vx.js +40175 -0
  114. package/dist/chunk-7m2nd8da.js +110 -0
  115. package/dist/chunk-7n35vjtw.js +444 -0
  116. package/dist/chunk-7n5ss4sh.js +144 -0
  117. package/dist/chunk-7rjnxcfe.js +107 -0
  118. package/dist/chunk-7sb5axvf.js +122 -0
  119. package/dist/chunk-7wm5s02e.js +216 -0
  120. package/dist/chunk-7ymfj7m3.js +151 -0
  121. package/dist/chunk-7z8j9qfn.js +121 -0
  122. package/dist/chunk-7zsapntc.js +216 -0
  123. package/dist/chunk-805fhkfh.js +908 -0
  124. package/dist/chunk-80k1nj24.js +253 -0
  125. package/dist/chunk-83hfzbx3.js +10 -0
  126. package/dist/chunk-85cypsdd.js +92 -0
  127. package/dist/chunk-8760caxf.js +2644 -0
  128. package/dist/chunk-88f6egg6.js +387 -0
  129. package/dist/chunk-88r7kwgj.js +22 -0
  130. package/dist/chunk-89e1v45e.js +463 -0
  131. package/dist/chunk-8bedvdm1.js +32 -0
  132. package/dist/chunk-8c4x4vdz.js +177 -0
  133. package/dist/chunk-8hq5kk3y.js +44 -0
  134. package/dist/chunk-8ngxagxq.js +18 -0
  135. package/dist/chunk-8tnsngw2.js +31 -0
  136. package/dist/chunk-8wjnca8h.js +307 -0
  137. package/dist/chunk-8y12jxg8.js +10 -0
  138. package/dist/chunk-8ymf4e6z.js +48 -0
  139. package/dist/chunk-90wp6wez.js +10510 -0
  140. package/dist/chunk-92bp5bnf.js +650 -0
  141. package/dist/chunk-92q8sx5z.js +90 -0
  142. package/dist/chunk-958rtmtx.js +10476 -0
  143. package/dist/chunk-9e2kqv5g.js +125 -0
  144. package/dist/chunk-9f4f1hy5.js +281 -0
  145. package/dist/chunk-9gbamk79.js +93 -0
  146. package/dist/chunk-9k5s3ryh.js +167 -0
  147. package/dist/chunk-9xzfqm15.js +97 -0
  148. package/dist/chunk-9zgdvbm6.js +110 -0
  149. package/dist/chunk-a0p3q8jw.js +24 -0
  150. package/dist/chunk-a22sayzp.js +220 -0
  151. package/dist/chunk-a8ejc632.js +3094 -0
  152. package/dist/chunk-a8gj9d9z.js +120 -0
  153. package/dist/chunk-a9vdeb6y.js +258 -0
  154. package/dist/chunk-a9yev47v.js +674 -0
  155. package/dist/chunk-a9zh40sj.js +48 -0
  156. package/dist/chunk-ack5mfba.js +105 -0
  157. package/dist/chunk-ae76ded0.js +30 -0
  158. package/dist/chunk-akjw4dh6.js +538 -0
  159. package/dist/chunk-asc6wz4q.js +1188 -0
  160. package/dist/chunk-atqejh3p.js +273 -0
  161. package/dist/chunk-atv2e6b7.js +61 -0
  162. package/dist/chunk-axvvkwz8.js +1551 -0
  163. package/dist/chunk-azgz7kj9.js +38 -0
  164. package/dist/chunk-b3zave8q.js +275 -0
  165. package/dist/chunk-b4wg70y1.js +54 -0
  166. package/dist/chunk-b8b13qn2.js +100 -0
  167. package/dist/chunk-bg3mt9bm.js +28 -0
  168. package/dist/chunk-bh4jvcjn.js +91 -0
  169. package/dist/chunk-bhdt6k7w.js +15 -0
  170. package/dist/chunk-bm1qb16p.js +17 -0
  171. package/dist/chunk-bpvsd1j1.js +266 -0
  172. package/dist/chunk-bqfnp99q.js +477 -0
  173. package/dist/chunk-bsbmmfyt.js +17 -0
  174. package/dist/chunk-bsbt34jm.js +42 -0
  175. package/dist/chunk-c78akdhr.js +458 -0
  176. package/dist/chunk-cdz5yb0r.js +57 -0
  177. package/dist/chunk-cfv996bs.js +22 -0
  178. package/dist/chunk-cgfdkzhb.js +12 -0
  179. package/dist/chunk-ckh4r5er.js +257 -0
  180. package/dist/chunk-cmgjnvn9.js +89 -0
  181. package/dist/chunk-cpjgvay8.js +687 -0
  182. package/dist/chunk-crfryjx9.js +276 -0
  183. package/dist/chunk-ctw5jwcd.js +213 -0
  184. package/dist/chunk-cvy3vntc.js +65 -0
  185. package/dist/chunk-cwbzz504.js +94 -0
  186. package/dist/chunk-cy2hswr1.js +15 -0
  187. package/dist/chunk-cyejkay3.js +222 -0
  188. package/dist/chunk-d18z9pna.js +106 -0
  189. package/dist/chunk-d5cq0n0v.js +162 -0
  190. package/dist/chunk-db45aryp.js +50 -0
  191. package/dist/chunk-de8nqh0z.js +790 -0
  192. package/dist/chunk-dfw6h350.js +2336 -0
  193. package/dist/chunk-dgqrcy74.js +48 -0
  194. package/dist/chunk-dn75ptgd.js +184 -0
  195. package/dist/chunk-dnh7jtpb.js +37 -0
  196. package/dist/chunk-dpshyv9m.js +90 -0
  197. package/dist/chunk-dt8cdvnm.js +642 -0
  198. package/dist/chunk-dtxby6fr.js +306 -0
  199. package/dist/chunk-dv1wfr85.js +6373 -0
  200. package/dist/chunk-dw363edx.js +1154 -0
  201. package/dist/chunk-dwrdacck.js +62 -0
  202. package/dist/chunk-dxnnv5e3.js +276 -0
  203. package/dist/chunk-e3g8q4cn.js +1646 -0
  204. package/dist/chunk-e3m9k9s2.js +542 -0
  205. package/dist/chunk-e4q49asn.js +155 -0
  206. package/dist/chunk-e5pntxye.js +37 -0
  207. package/dist/chunk-e7393td6.js +42 -0
  208. package/dist/chunk-ead42yrh.js +87 -0
  209. package/dist/chunk-eb90vwvr.js +152 -0
  210. package/dist/chunk-ecvwk9hg.js +250 -0
  211. package/dist/chunk-edjd6aay.js +173 -0
  212. package/dist/chunk-eg0h8mtm.js +130 -0
  213. package/dist/chunk-ehtwnxpg.js +1591 -0
  214. package/dist/chunk-ek686gx1.js +94 -0
  215. package/dist/chunk-eqp1rfft.js +17 -0
  216. package/dist/chunk-evhwt0ar.js +1015 -0
  217. package/dist/chunk-ewadzrm8.js +103 -0
  218. package/dist/chunk-ewsgsw9h.js +172291 -0
  219. package/dist/chunk-f0pa0r7e.js +3198 -0
  220. package/dist/chunk-f2mhrmww.js +62 -0
  221. package/dist/chunk-f39zxvwn.js +401 -0
  222. package/dist/chunk-f46z54tq.js +374 -0
  223. package/dist/chunk-f5ma3nh5.js +3436 -0
  224. package/dist/chunk-f60q23az.js +3038 -0
  225. package/dist/chunk-f6v2nz57.js +107 -0
  226. package/dist/chunk-f6yjan38.js +38 -0
  227. package/dist/chunk-fbv4apne.js +51 -0
  228. package/dist/chunk-fem4s778.js +70 -0
  229. package/dist/chunk-fezm1kn8.js +376 -0
  230. package/dist/chunk-fm1n3ysp.js +6108 -0
  231. package/dist/chunk-frg83bfw.js +225 -0
  232. package/dist/chunk-fscm8db0.js +692 -0
  233. package/dist/chunk-fyc5fepv.js +10 -0
  234. package/dist/chunk-g0j0t6qk.js +26 -0
  235. package/dist/chunk-g0nc1ftf.js +849 -0
  236. package/dist/chunk-g338npwr.js +1061 -0
  237. package/dist/chunk-g3t0act8.js +8 -0
  238. package/dist/chunk-g75w4hw3.js +26 -0
  239. package/dist/chunk-g8vp82en.js +1866 -0
  240. package/dist/chunk-gax0fcbx.js +182 -0
  241. package/dist/chunk-gsz4dh3y.js +606 -0
  242. package/dist/chunk-gtfffm7h.js +440 -0
  243. package/dist/chunk-gver9zb9.js +420 -0
  244. package/dist/chunk-gyj242zr.js +20 -0
  245. package/dist/chunk-h0qngp9w.js +157 -0
  246. package/dist/chunk-h14kemnk.js +123 -0
  247. package/dist/chunk-h8wj1a74.js +8960 -0
  248. package/dist/chunk-h9mcb2eg.js +87 -0
  249. package/dist/chunk-h9nh2980.js +91 -0
  250. package/dist/chunk-hakdhagh.js +16606 -0
  251. package/dist/chunk-hbc6ymdv.js +55 -0
  252. package/dist/chunk-hh7cmy4k.js +20 -0
  253. package/dist/chunk-hjhc4cpt.js +69 -0
  254. package/dist/chunk-hjwez8qc.js +5018 -0
  255. package/dist/chunk-hk9xz7gk.js +118 -0
  256. package/dist/chunk-hqmz36b3.js +552 -0
  257. package/dist/chunk-hrzerbfw.js +1299 -0
  258. package/dist/chunk-hs8ph4p8.js +8 -0
  259. package/dist/chunk-ht1xwrnd.js +716 -0
  260. package/dist/chunk-hvmfg2dc.js +338 -0
  261. package/dist/chunk-hx2tr4ep.js +7189 -0
  262. package/dist/chunk-hzhe8ygc.js +547 -0
  263. package/dist/chunk-j2k4p94p.js +55 -0
  264. package/dist/chunk-j3a4p81y.js +184 -0
  265. package/dist/chunk-j49g6g3s.js +57 -0
  266. package/dist/chunk-j5d5hp9h.js +71 -0
  267. package/dist/chunk-j64ga6ta.js +8035 -0
  268. package/dist/chunk-j7tyxan1.js +116 -0
  269. package/dist/chunk-j8v4774z.js +424 -0
  270. package/dist/chunk-jafes477.js +29 -0
  271. package/dist/chunk-jd32zbps.js +15 -0
  272. package/dist/chunk-jdgeec04.js +4249 -0
  273. package/dist/chunk-jftd4jq5.js +4521 -0
  274. package/dist/chunk-jkxqhv6y.js +812 -0
  275. package/dist/chunk-jmfr6h0n.js +120 -0
  276. package/dist/chunk-jn4aabmx.js +40 -0
  277. package/dist/chunk-jnhkref0.js +30 -0
  278. package/dist/chunk-jsbpm1gz.js +27 -0
  279. package/dist/chunk-jtcyjc3k.js +5802 -0
  280. package/dist/chunk-jx817w05.js +11 -0
  281. package/dist/chunk-jzmz18nn.js +65 -0
  282. package/dist/chunk-k0p9w03v.js +4957 -0
  283. package/dist/chunk-k3dcdnck.js +89 -0
  284. package/dist/chunk-k3wadzcd.js +88 -0
  285. package/dist/chunk-kaeshsk1.js +713 -0
  286. package/dist/chunk-kbkey9ed.js +522 -0
  287. package/dist/chunk-kcwfhqbb.js +196 -0
  288. package/dist/chunk-key6jr7p.js +224 -0
  289. package/dist/chunk-knay8cy9.js +173 -0
  290. package/dist/chunk-kr3rg2y1.js +95 -0
  291. package/dist/chunk-kwekc97v.js +18 -0
  292. package/dist/chunk-m06q12hg.js +61 -0
  293. package/dist/chunk-m2mcpbhk.js +43 -0
  294. package/dist/chunk-m8v220gz.js +71 -0
  295. package/dist/chunk-mgpqy78h.js +208 -0
  296. package/dist/chunk-mkejwh4t.js +16 -0
  297. package/dist/chunk-mptyw5n1.js +107 -0
  298. package/dist/chunk-mqajm0dp.js +66 -0
  299. package/dist/chunk-mrksbgxj.js +490 -0
  300. package/dist/chunk-msjfc5ba.js +246 -0
  301. package/dist/chunk-mt25echc.js +6157 -0
  302. package/dist/chunk-mt3jfnr8.js +277 -0
  303. package/dist/chunk-mtn242d4.js +9300 -0
  304. package/dist/chunk-mzfkvave.js +169 -0
  305. package/dist/chunk-n0qaeaa5.js +256 -0
  306. package/dist/chunk-n1erf6kh.js +22820 -0
  307. package/dist/chunk-n2avk1r2.js +61 -0
  308. package/dist/chunk-n6atnpcq.js +765 -0
  309. package/dist/chunk-n7ttdtk0.js +641 -0
  310. package/dist/chunk-ncnfzby5.js +822 -0
  311. package/dist/chunk-ncnr1jtf.js +2058 -0
  312. package/dist/chunk-nerv0jvx.js +74 -0
  313. package/dist/chunk-ngd2abep.js +90 -0
  314. package/dist/chunk-nka1g8f4.js +773 -0
  315. package/dist/chunk-nnaxkc2z.js +128 -0
  316. package/dist/chunk-npyrtj8j.js +691 -0
  317. package/dist/chunk-nq0fxyxh.js +752 -0
  318. package/dist/chunk-nrmffak7.js +114 -0
  319. package/dist/chunk-nsz546wq.js +1170 -0
  320. package/dist/chunk-nt837qt9.js +21 -0
  321. package/dist/chunk-nv64x1z5.js +86 -0
  322. package/dist/chunk-nxsh6de2.js +1711 -0
  323. package/dist/chunk-nz4getcr.js +40 -0
  324. package/dist/chunk-p1f607pa.js +83 -0
  325. package/dist/chunk-p2816w9z.js +1486 -0
  326. package/dist/chunk-p2d5nh3g.js +342 -0
  327. package/dist/chunk-p4r5y02t.js +90 -0
  328. package/dist/chunk-p7g7pf3f.js +336 -0
  329. package/dist/chunk-pb4ad8r2.js +110 -0
  330. package/dist/chunk-pbrhz0zr.js +716 -0
  331. package/dist/chunk-ps49ymvj.js +43 -0
  332. package/dist/chunk-pwnt3veb.js +103 -0
  333. package/dist/chunk-pwwa7s62.js +11 -0
  334. package/dist/chunk-px3w0kde.js +299 -0
  335. package/dist/chunk-pzn777jb.js +756 -0
  336. package/dist/chunk-q25bjaev.js +15 -0
  337. package/dist/chunk-q5by3da6.js +8 -0
  338. package/dist/chunk-q6av622g.js +38 -0
  339. package/dist/chunk-q6xkvtf2.js +1318 -0
  340. package/dist/chunk-q81jx1tq.js +476 -0
  341. package/dist/chunk-qehb6fk5.js +339 -0
  342. package/dist/chunk-qj1avx1q.js +87 -0
  343. package/dist/chunk-qn2dxr66.js +105 -0
  344. package/dist/chunk-qnfx3qtx.js +617 -0
  345. package/dist/chunk-qp18kd4h.js +48 -0
  346. package/dist/chunk-qp2qdcda.js +100 -0
  347. package/dist/chunk-qpjy9tcf.js +133 -0
  348. package/dist/chunk-qqfa0dqg.js +2343 -0
  349. package/dist/chunk-qwh3htcz.js +202 -0
  350. package/dist/chunk-qz2x630m.js +49145 -0
  351. package/dist/chunk-r3vakcs1.js +496 -0
  352. package/dist/chunk-r66hz8j6.js +34 -0
  353. package/dist/chunk-r6b58y3x.js +17 -0
  354. package/dist/chunk-rekp48rk.js +62 -0
  355. package/dist/chunk-rn0v1hk8.js +34 -0
  356. package/dist/chunk-rs1xrs6m.js +534 -0
  357. package/dist/chunk-rs45skes.js +123 -0
  358. package/dist/chunk-rzszqp82.js +524 -0
  359. package/dist/chunk-s274nv8k.js +8 -0
  360. package/dist/chunk-s3pzvdss.js +50 -0
  361. package/dist/chunk-s9mesaw0.js +26840 -0
  362. package/dist/chunk-sd36yzx8.js +954 -0
  363. package/dist/chunk-sdj9b9wh.js +782 -0
  364. package/dist/chunk-sdw2q69p.js +227 -0
  365. package/dist/chunk-sfgp9cc0.js +130 -0
  366. package/dist/chunk-spqaamnc.js +63 -0
  367. package/dist/chunk-spzrs4df.js +73 -0
  368. package/dist/chunk-sxkr7k43.js +55 -0
  369. package/dist/chunk-szj5wvdy.js +28 -0
  370. package/dist/chunk-t0rgmccj.js +39 -0
  371. package/dist/chunk-t1nnzjgg.js +17 -0
  372. package/dist/chunk-t94fcnt8.js +566 -0
  373. package/dist/chunk-tjaqa99q.js +125 -0
  374. package/dist/chunk-tjq2evtw.js +328 -0
  375. package/dist/chunk-ts2p6bv1.js +224 -0
  376. package/dist/chunk-ttk5dzz8.js +25 -0
  377. package/dist/chunk-tw0q7ynt.js +59 -0
  378. package/dist/chunk-v02jkvgy.js +131 -0
  379. package/dist/chunk-v084bqt3.js +1529 -0
  380. package/dist/chunk-v0amythm.js +164 -0
  381. package/dist/chunk-v1kzp02e.js +785 -0
  382. package/dist/chunk-v1mgv1et.js +15 -0
  383. package/dist/chunk-v399mzxk.js +58 -0
  384. package/dist/chunk-v3gm2day.js +8 -0
  385. package/dist/chunk-v43hrrxp.js +71 -0
  386. package/dist/chunk-v6aqb2aj.js +102 -0
  387. package/dist/chunk-v78fj8by.js +145 -0
  388. package/dist/chunk-v7qmhjdn.js +1921 -0
  389. package/dist/chunk-v9smspw2.js +4301 -0
  390. package/dist/chunk-vdw93s4h.js +2431 -0
  391. package/dist/chunk-vest0y6x.js +3830 -0
  392. package/dist/chunk-vf5sd1nq.js +12 -0
  393. package/dist/chunk-vratq94g.js +349 -0
  394. package/dist/chunk-vrz7t3m3.js +20 -0
  395. package/dist/chunk-vtb185z9.js +70 -0
  396. package/dist/chunk-vx01rvg8.js +654 -0
  397. package/dist/chunk-vyc0rjyx.js +31 -0
  398. package/dist/chunk-vyjeh50y.js +2149 -0
  399. package/dist/chunk-vzpffsza.js +269 -0
  400. package/dist/chunk-w2ef3kxk.js +3353 -0
  401. package/dist/chunk-w2z5pqd3.js +336 -0
  402. package/dist/chunk-w3whm4mn.js +432 -0
  403. package/dist/chunk-w7wgpqcp.js +157 -0
  404. package/dist/chunk-waa00cvb.js +301 -0
  405. package/dist/chunk-wb0qm4es.js +155 -0
  406. package/dist/chunk-wbkahkdc.js +27 -0
  407. package/dist/chunk-wfz0qffj.js +3939 -0
  408. package/dist/chunk-wn0cx0pt.js +283 -0
  409. package/dist/chunk-wv6gzt9c.js +726 -0
  410. package/dist/chunk-wx42ycm4.js +998 -0
  411. package/dist/chunk-wxkpgy05.js +268 -0
  412. package/dist/chunk-wzpdet3m.js +843 -0
  413. package/dist/chunk-x0mwzt38.js +714 -0
  414. package/dist/chunk-x592wbfh.js +244 -0
  415. package/dist/chunk-x5pqsp9r.js +100 -0
  416. package/dist/chunk-x679thag.js +825 -0
  417. package/dist/chunk-x8b7vft8.js +132 -0
  418. package/dist/chunk-x8cftch7.js +119 -0
  419. package/dist/chunk-x9q7r885.js +348 -0
  420. package/dist/chunk-xawkt0vb.js +1585 -0
  421. package/dist/chunk-xdw5dv00.js +8 -0
  422. package/dist/chunk-xe9cc860.js +287 -0
  423. package/dist/chunk-xjr9c3vt.js +101 -0
  424. package/dist/chunk-xk7zaqta.js +21933 -0
  425. package/dist/chunk-xktbmawc.js +678 -0
  426. package/dist/chunk-xn6yw46v.js +140 -0
  427. package/dist/chunk-xsq9ae7x.js +90 -0
  428. package/dist/chunk-xszk7n10.js +14358 -0
  429. package/dist/chunk-xt8a5r1t.js +84 -0
  430. package/dist/chunk-xydyndkv.js +195 -0
  431. package/dist/chunk-xzt10yc5.js +60 -0
  432. package/dist/chunk-y04y95dr.js +91 -0
  433. package/dist/chunk-y1784krc.js +19 -0
  434. package/dist/chunk-y1x32h3x.js +128 -0
  435. package/dist/chunk-y3s7aww5.js +99 -0
  436. package/dist/chunk-y47cg3kz.js +42 -0
  437. package/dist/chunk-y7kzvepn.js +469 -0
  438. package/dist/chunk-y89kbsyc.js +287 -0
  439. package/dist/chunk-yd87p1c3.js +159 -0
  440. package/dist/chunk-yf3yw8fw.js +105 -0
  441. package/dist/chunk-ygbf0ezx.js +1391 -0
  442. package/dist/chunk-yjbxnshv.js +208 -0
  443. package/dist/chunk-ynednmqd.js +192 -0
  444. package/dist/chunk-yvhez44y.js +259 -0
  445. package/dist/chunk-ywxd4qw4.js +22 -0
  446. package/dist/chunk-yzrmgpy4.js +117 -0
  447. package/dist/chunk-z0b2vb24.js +862 -0
  448. package/dist/chunk-z1zj044v.js +655 -0
  449. package/dist/chunk-z2dp53wn.js +17 -0
  450. package/dist/chunk-z3w0xasa.js +165 -0
  451. package/dist/chunk-z7ycmrb3.js +644 -0
  452. package/dist/chunk-zh11tdkb.js +347 -0
  453. package/dist/chunk-zk2wsm7d.js +15 -0
  454. package/dist/chunk-zqfqcf22.js +229 -0
  455. package/dist/chunk-zqk2j8px.js +699 -0
  456. package/dist/chunk-zqvsc10j.js +2833 -0
  457. package/dist/chunk-zsfxha74.js +17655 -0
  458. package/dist/chunk-zvc4snyb.js +117 -0
  459. package/dist/cli.js +194 -0
  460. package/package.json +173 -0
@@ -0,0 +1,1866 @@
1
+ // @bun
2
+ import {
3
+ MCPRemoteServerMenu,
4
+ MCPStdioServerMenu,
5
+ MCPToolDetailView,
6
+ MCPToolListView,
7
+ init_MCPRemoteServerMenu,
8
+ init_MCPStdioServerMenu,
9
+ init_MCPToolDetailView,
10
+ init_MCPToolListView,
11
+ init_PluginSettings
12
+ } from "./chunk-958rtmtx.js";
13
+ import"./chunk-g0nc1ftf.js";
14
+ import {
15
+ init_MCPConnectionManager,
16
+ useMcpReconnect,
17
+ useMcpToggleEnabled
18
+ } from "./chunk-92bp5bnf.js";
19
+ import"./chunk-5kbt1mbt.js";
20
+ import"./chunk-wb0qm4es.js";
21
+ import"./chunk-z7ycmrb3.js";
22
+ import"./chunk-mgpqy78h.js";
23
+ import {
24
+ McpParsingWarnings,
25
+ init_McpParsingWarnings
26
+ } from "./chunk-x9q7r885.js";
27
+ import"./chunk-w3whm4mn.js";
28
+ import"./chunk-62xmt9mk.js";
29
+ import"./chunk-mzfkvave.js";
30
+ import {
31
+ AuthenticationCancelledError,
32
+ ClaudeAuthProvider,
33
+ Select,
34
+ Spinner,
35
+ describeMcpConfigFilePath,
36
+ extractAgentMcpServers,
37
+ filterToolsByServer,
38
+ init_AppState,
39
+ init_CustomSelect,
40
+ init_Spinner,
41
+ init_auth1 as init_auth,
42
+ init_utils,
43
+ performMCPOAuthFlow,
44
+ useAppState,
45
+ useAppStateStore
46
+ } from "./chunk-ewsgsw9h.js";
47
+ import"./chunk-z1zj044v.js";
48
+ import"./chunk-t0rgmccj.js";
49
+ import {
50
+ getSessionIngressAuthToken,
51
+ init_sessionIngressAuth
52
+ } from "./chunk-key6jr7p.js";
53
+ import"./chunk-0m2861gw.js";
54
+ import"./chunk-0x9b2nmd.js";
55
+ import {
56
+ Byline,
57
+ ConfigurableShortcutHint,
58
+ Dialog,
59
+ KeyboardShortcutHint,
60
+ init_Byline,
61
+ init_ConfigurableShortcutHint,
62
+ init_Dialog,
63
+ init_KeyboardShortcutHint
64
+ } from "./chunk-89e1v45e.js";
65
+ import"./chunk-2gzv8nrw.js";
66
+ import"./chunk-ehtwnxpg.js";
67
+ import"./chunk-3be7ka25.js";
68
+ import"./chunk-x679thag.js";
69
+ import"./chunk-cgfdkzhb.js";
70
+ import"./chunk-bhdt6k7w.js";
71
+ import"./chunk-45kxdsp8.js";
72
+ import"./chunk-5dbk24zg.js";
73
+ import"./chunk-msjfc5ba.js";
74
+ import"./chunk-7zsapntc.js";
75
+ import"./chunk-0rg6yrhy.js";
76
+ import"./chunk-9gbamk79.js";
77
+ import"./chunk-x0mwzt38.js";
78
+ import"./chunk-9e2kqv5g.js";
79
+ import {
80
+ init_useKeybinding,
81
+ useKeybinding,
82
+ useKeybindings
83
+ } from "./chunk-1qakq4sn.js";
84
+ import {
85
+ Link,
86
+ ThemedBox_default,
87
+ ThemedText,
88
+ color,
89
+ init_ink,
90
+ require_compiler_runtime,
91
+ useTheme
92
+ } from "./chunk-s9mesaw0.js";
93
+ import"./chunk-7m2nd8da.js";
94
+ import"./chunk-ps49ymvj.js";
95
+ import {
96
+ require_jsx_dev_runtime,
97
+ require_react
98
+ } from "./chunk-g338npwr.js";
99
+ import"./chunk-zk2wsm7d.js";
100
+ import"./chunk-tw0q7ynt.js";
101
+ import"./chunk-xe9cc860.js";
102
+ import"./chunk-m06q12hg.js";
103
+ import"./chunk-ygbf0ezx.js";
104
+ import"./chunk-spqaamnc.js";
105
+ import"./chunk-4jm600zv.js";
106
+ import"./chunk-qz2x630m.js";
107
+ import"./chunk-7sb5axvf.js";
108
+ import"./chunk-v9smspw2.js";
109
+ import {
110
+ capitalize,
111
+ init_stringUtils,
112
+ plural
113
+ } from "./chunk-3f7rypmf.js";
114
+ import"./chunk-e3g8q4cn.js";
115
+ import"./chunk-ctw5jwcd.js";
116
+ import"./chunk-0e1xsncc.js";
117
+ import"./chunk-vratq94g.js";
118
+ import"./chunk-g0j0t6qk.js";
119
+ import"./chunk-6kpbgc5w.js";
120
+ import"./chunk-3c25bcsw.js";
121
+ import"./chunk-tjaqa99q.js";
122
+ import"./chunk-55wgxwa9.js";
123
+ import"./chunk-w2z5pqd3.js";
124
+ import"./chunk-7ymfj7m3.js";
125
+ import"./chunk-f5ma3nh5.js";
126
+ import"./chunk-v1kzp02e.js";
127
+ import"./chunk-1eapde8a.js";
128
+ import"./chunk-p2816w9z.js";
129
+ import"./chunk-0vkfrmqm.js";
130
+ import"./chunk-0xjaqda8.js";
131
+ import"./chunk-1rvz0433.js";
132
+ import"./chunk-cdz5yb0r.js";
133
+ import"./chunk-f2mhrmww.js";
134
+ import"./chunk-7z8j9qfn.js";
135
+ import"./chunk-hrzerbfw.js";
136
+ import"./chunk-d18z9pna.js";
137
+ import"./chunk-qnfx3qtx.js";
138
+ import"./chunk-hjhc4cpt.js";
139
+ import"./chunk-vyc0rjyx.js";
140
+ import {
141
+ figures_default,
142
+ init_figures
143
+ } from "./chunk-hx2tr4ep.js";
144
+ import"./chunk-p7g7pf3f.js";
145
+ import"./chunk-8tnsngw2.js";
146
+ import"./chunk-8bedvdm1.js";
147
+ import"./chunk-7wm5s02e.js";
148
+ import {
149
+ init_debug,
150
+ isDebugMode
151
+ } from "./chunk-nxsh6de2.js";
152
+ import"./chunk-fbv4apne.js";
153
+ import"./chunk-3r24h7t6.js";
154
+ import"./chunk-qqfa0dqg.js";
155
+ import"./chunk-hqmz36b3.js";
156
+ import"./chunk-4g3v8y12.js";
157
+ import"./chunk-7739pg2c.js";
158
+ import"./chunk-xszk7n10.js";
159
+ import"./chunk-sdj9b9wh.js";
160
+ import {
161
+ __esm,
162
+ __toESM
163
+ } from "./chunk-qp2qdcda.js";
164
+
165
+ // src/components/mcp/MCPAgentServerMenu.tsx
166
+ function MCPAgentServerMenu({
167
+ agentServer,
168
+ onCancel,
169
+ onComplete
170
+ }) {
171
+ const [theme] = useTheme();
172
+ const [isAuthenticating, setIsAuthenticating] = import_react.useState(false);
173
+ const [error, setError] = import_react.useState(null);
174
+ const [authorizationUrl, setAuthorizationUrl] = import_react.useState(null);
175
+ const authAbortControllerRef = import_react.useRef(null);
176
+ import_react.useEffect(() => () => authAbortControllerRef.current?.abort(), []);
177
+ const handleEscCancel = import_react.useCallback(() => {
178
+ if (isAuthenticating) {
179
+ authAbortControllerRef.current?.abort();
180
+ authAbortControllerRef.current = null;
181
+ setIsAuthenticating(false);
182
+ setAuthorizationUrl(null);
183
+ }
184
+ }, [isAuthenticating]);
185
+ useKeybinding("confirm:no", handleEscCancel, {
186
+ context: "Confirmation",
187
+ isActive: isAuthenticating
188
+ });
189
+ const handleAuthenticate = import_react.useCallback(async () => {
190
+ if (!agentServer.needsAuth || !agentServer.url) {
191
+ return;
192
+ }
193
+ setIsAuthenticating(true);
194
+ setError(null);
195
+ const controller = new AbortController;
196
+ authAbortControllerRef.current = controller;
197
+ try {
198
+ const tempConfig = {
199
+ type: agentServer.transport,
200
+ url: agentServer.url
201
+ };
202
+ await performMCPOAuthFlow(agentServer.name, tempConfig, setAuthorizationUrl, controller.signal);
203
+ onComplete?.(`Authentication successful for ${agentServer.name}. The server will connect when the agent runs.`);
204
+ } catch (err) {
205
+ if (err instanceof Error && !(err instanceof AuthenticationCancelledError)) {
206
+ setError(err.message);
207
+ }
208
+ } finally {
209
+ setIsAuthenticating(false);
210
+ authAbortControllerRef.current = null;
211
+ }
212
+ }, [agentServer, onComplete]);
213
+ const capitalizedServerName = capitalize(String(agentServer.name));
214
+ if (isAuthenticating) {
215
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
216
+ flexDirection: "column",
217
+ gap: 1,
218
+ padding: 1,
219
+ children: [
220
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
221
+ color: "claude",
222
+ children: [
223
+ "Authenticating with ",
224
+ agentServer.name,
225
+ "\u2026"
226
+ ]
227
+ }, undefined, true, undefined, this),
228
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
229
+ children: [
230
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Spinner, {}, undefined, false, undefined, this),
231
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
232
+ children: " A browser window will open for authentication"
233
+ }, undefined, false, undefined, this)
234
+ ]
235
+ }, undefined, true, undefined, this),
236
+ authorizationUrl && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
237
+ flexDirection: "column",
238
+ children: [
239
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
240
+ dimColor: true,
241
+ children: "If your browser doesn't open automatically, copy this URL manually:"
242
+ }, undefined, false, undefined, this),
243
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Link, {
244
+ url: authorizationUrl
245
+ }, undefined, false, undefined, this)
246
+ ]
247
+ }, undefined, true, undefined, this),
248
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
249
+ marginLeft: 3,
250
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
251
+ dimColor: true,
252
+ children: [
253
+ "Return here after authenticating in your browser.",
254
+ " ",
255
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
256
+ action: "confirm:no",
257
+ context: "Confirmation",
258
+ fallback: "Esc",
259
+ description: "go back"
260
+ }, undefined, false, undefined, this)
261
+ ]
262
+ }, undefined, true, undefined, this)
263
+ }, undefined, false, undefined, this)
264
+ ]
265
+ }, undefined, true, undefined, this);
266
+ }
267
+ const menuOptions = [];
268
+ if (agentServer.needsAuth) {
269
+ menuOptions.push({
270
+ label: agentServer.isAuthenticated ? "Re-authenticate" : "Authenticate",
271
+ value: "auth"
272
+ });
273
+ }
274
+ menuOptions.push({
275
+ label: "Back",
276
+ value: "back"
277
+ });
278
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
279
+ title: `${capitalizedServerName} MCP Server`,
280
+ subtitle: "agent-only",
281
+ onCancel,
282
+ inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
283
+ children: [
284
+ "Press ",
285
+ exitState.keyName,
286
+ " again to exit"
287
+ ]
288
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
289
+ children: [
290
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
291
+ shortcut: "\u2191\u2193",
292
+ action: "navigate"
293
+ }, undefined, false, undefined, this),
294
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
295
+ shortcut: "Enter",
296
+ action: "confirm"
297
+ }, undefined, false, undefined, this),
298
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
299
+ action: "confirm:no",
300
+ context: "Confirmation",
301
+ fallback: "Esc",
302
+ description: "go back"
303
+ }, undefined, false, undefined, this)
304
+ ]
305
+ }, undefined, true, undefined, this),
306
+ children: [
307
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
308
+ flexDirection: "column",
309
+ gap: 0,
310
+ children: [
311
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
312
+ children: [
313
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
314
+ bold: true,
315
+ children: "Type: "
316
+ }, undefined, false, undefined, this),
317
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
318
+ dimColor: true,
319
+ children: agentServer.transport
320
+ }, undefined, false, undefined, this)
321
+ ]
322
+ }, undefined, true, undefined, this),
323
+ agentServer.url && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
324
+ children: [
325
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
326
+ bold: true,
327
+ children: "URL: "
328
+ }, undefined, false, undefined, this),
329
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
330
+ dimColor: true,
331
+ children: agentServer.url
332
+ }, undefined, false, undefined, this)
333
+ ]
334
+ }, undefined, true, undefined, this),
335
+ agentServer.command && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
336
+ children: [
337
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
338
+ bold: true,
339
+ children: "Command: "
340
+ }, undefined, false, undefined, this),
341
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
342
+ dimColor: true,
343
+ children: agentServer.command
344
+ }, undefined, false, undefined, this)
345
+ ]
346
+ }, undefined, true, undefined, this),
347
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
348
+ children: [
349
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
350
+ bold: true,
351
+ children: "Used by: "
352
+ }, undefined, false, undefined, this),
353
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
354
+ dimColor: true,
355
+ children: agentServer.sourceAgents.join(", ")
356
+ }, undefined, false, undefined, this)
357
+ ]
358
+ }, undefined, true, undefined, this),
359
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
360
+ marginTop: 1,
361
+ children: [
362
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
363
+ bold: true,
364
+ children: "Status: "
365
+ }, undefined, false, undefined, this),
366
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
367
+ children: [
368
+ color("inactive", theme)(figures_default.radioOff),
369
+ " not connected (agent-only)"
370
+ ]
371
+ }, undefined, true, undefined, this)
372
+ ]
373
+ }, undefined, true, undefined, this),
374
+ agentServer.needsAuth && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
375
+ children: [
376
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
377
+ bold: true,
378
+ children: "Auth: "
379
+ }, undefined, false, undefined, this),
380
+ agentServer.isAuthenticated ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
381
+ children: [
382
+ color("success", theme)(figures_default.tick),
383
+ " authenticated"
384
+ ]
385
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
386
+ children: [
387
+ color("warning", theme)(figures_default.triangleUpOutline),
388
+ " may need authentication"
389
+ ]
390
+ }, undefined, true, undefined, this)
391
+ ]
392
+ }, undefined, true, undefined, this)
393
+ ]
394
+ }, undefined, true, undefined, this),
395
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
396
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
397
+ dimColor: true,
398
+ children: "This server connects only when running the agent."
399
+ }, undefined, false, undefined, this)
400
+ }, undefined, false, undefined, this),
401
+ error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
402
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
403
+ color: "error",
404
+ children: [
405
+ "Error: ",
406
+ error
407
+ ]
408
+ }, undefined, true, undefined, this)
409
+ }, undefined, false, undefined, this),
410
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
411
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
412
+ options: menuOptions,
413
+ onChange: async (value) => {
414
+ switch (value) {
415
+ case "auth":
416
+ await handleAuthenticate();
417
+ break;
418
+ case "back":
419
+ onCancel();
420
+ break;
421
+ }
422
+ },
423
+ onCancel
424
+ }, undefined, false, undefined, this)
425
+ }, undefined, false, undefined, this)
426
+ ]
427
+ }, undefined, true, undefined, this);
428
+ }
429
+ var import_react, jsx_dev_runtime;
430
+ var init_MCPAgentServerMenu = __esm(() => {
431
+ init_figures();
432
+ init_ink();
433
+ init_useKeybinding();
434
+ init_auth();
435
+ init_stringUtils();
436
+ init_ConfigurableShortcutHint();
437
+ init_CustomSelect();
438
+ init_Byline();
439
+ init_Dialog();
440
+ init_KeyboardShortcutHint();
441
+ init_Spinner();
442
+ import_react = __toESM(require_react(), 1);
443
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
444
+ });
445
+
446
+ // src/components/mcp/MCPListPanel.tsx
447
+ function getScopeHeading(scope) {
448
+ switch (scope) {
449
+ case "project":
450
+ return {
451
+ label: "Project MCPs",
452
+ path: describeMcpConfigFilePath(scope)
453
+ };
454
+ case "user":
455
+ return {
456
+ label: "User MCPs",
457
+ path: describeMcpConfigFilePath(scope)
458
+ };
459
+ case "local":
460
+ return {
461
+ label: "Local MCPs",
462
+ path: describeMcpConfigFilePath(scope)
463
+ };
464
+ case "enterprise":
465
+ return {
466
+ label: "Enterprise MCPs"
467
+ };
468
+ case "dynamic":
469
+ return {
470
+ label: "Built-in MCPs",
471
+ path: "always available"
472
+ };
473
+ default:
474
+ return {
475
+ label: scope
476
+ };
477
+ }
478
+ }
479
+ function groupServersByScope(serverList) {
480
+ const groups = new Map;
481
+ for (const server of serverList) {
482
+ const scope = server.scope;
483
+ if (!groups.has(scope)) {
484
+ groups.set(scope, []);
485
+ }
486
+ groups.get(scope).push(server);
487
+ }
488
+ for (const [, groupServers] of groups) {
489
+ groupServers.sort((a, b) => a.name.localeCompare(b.name));
490
+ }
491
+ return groups;
492
+ }
493
+ function MCPListPanel(t0) {
494
+ const $ = import_compiler_runtime.c(78);
495
+ const {
496
+ servers,
497
+ agentServers: t1,
498
+ onSelectServer,
499
+ onSelectAgentServer,
500
+ onComplete
501
+ } = t0;
502
+ let t2;
503
+ if ($[0] !== t1) {
504
+ t2 = t1 === undefined ? [] : t1;
505
+ $[0] = t1;
506
+ $[1] = t2;
507
+ } else {
508
+ t2 = $[1];
509
+ }
510
+ const agentServers = t2;
511
+ const [theme] = useTheme();
512
+ const [selectedIndex, setSelectedIndex] = import_react2.useState(0);
513
+ let t3;
514
+ if ($[2] !== servers) {
515
+ const regularServers = servers.filter(_temp);
516
+ t3 = groupServersByScope(regularServers);
517
+ $[2] = servers;
518
+ $[3] = t3;
519
+ } else {
520
+ t3 = $[3];
521
+ }
522
+ const serversByScope = t3;
523
+ let t4;
524
+ if ($[4] !== servers) {
525
+ t4 = servers.filter(_temp2).sort(_temp3);
526
+ $[4] = servers;
527
+ $[5] = t4;
528
+ } else {
529
+ t4 = $[5];
530
+ }
531
+ const claudeAiServers = t4;
532
+ let t5;
533
+ if ($[6] !== serversByScope) {
534
+ t5 = (serversByScope.get("dynamic") ?? []).sort(_temp4);
535
+ $[6] = serversByScope;
536
+ $[7] = t5;
537
+ } else {
538
+ t5 = $[7];
539
+ }
540
+ const dynamicServers = t5;
541
+ let t6;
542
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
543
+ t6 = getScopeHeading("dynamic");
544
+ $[8] = t6;
545
+ } else {
546
+ t6 = $[8];
547
+ }
548
+ const dynamicHeading = t6;
549
+ let items;
550
+ if ($[9] !== agentServers || $[10] !== claudeAiServers || $[11] !== dynamicServers || $[12] !== serversByScope) {
551
+ items = [];
552
+ for (const scope of SCOPE_ORDER) {
553
+ const scopeServers = serversByScope.get(scope) ?? [];
554
+ for (const server of scopeServers) {
555
+ items.push({
556
+ type: "server",
557
+ server
558
+ });
559
+ }
560
+ }
561
+ for (const server_0 of claudeAiServers) {
562
+ items.push({
563
+ type: "server",
564
+ server: server_0
565
+ });
566
+ }
567
+ for (const agentServer of agentServers) {
568
+ items.push({
569
+ type: "agent-server",
570
+ agentServer
571
+ });
572
+ }
573
+ for (const server_1 of dynamicServers) {
574
+ items.push({
575
+ type: "server",
576
+ server: server_1
577
+ });
578
+ }
579
+ $[9] = agentServers;
580
+ $[10] = claudeAiServers;
581
+ $[11] = dynamicServers;
582
+ $[12] = serversByScope;
583
+ $[13] = items;
584
+ } else {
585
+ items = $[13];
586
+ }
587
+ const selectableItems = items;
588
+ let t7;
589
+ if ($[14] !== onComplete) {
590
+ t7 = () => {
591
+ onComplete("MCP dialog dismissed", {
592
+ display: "system"
593
+ });
594
+ };
595
+ $[14] = onComplete;
596
+ $[15] = t7;
597
+ } else {
598
+ t7 = $[15];
599
+ }
600
+ const handleCancel = t7;
601
+ let t8;
602
+ if ($[16] !== onSelectAgentServer || $[17] !== onSelectServer || $[18] !== selectableItems || $[19] !== selectedIndex) {
603
+ t8 = () => {
604
+ const item = selectableItems[selectedIndex];
605
+ if (!item) {
606
+ return;
607
+ }
608
+ if (item.type === "server") {
609
+ onSelectServer(item.server);
610
+ } else {
611
+ if (item.type === "agent-server" && onSelectAgentServer) {
612
+ onSelectAgentServer(item.agentServer);
613
+ }
614
+ }
615
+ };
616
+ $[16] = onSelectAgentServer;
617
+ $[17] = onSelectServer;
618
+ $[18] = selectableItems;
619
+ $[19] = selectedIndex;
620
+ $[20] = t8;
621
+ } else {
622
+ t8 = $[20];
623
+ }
624
+ const handleSelect = t8;
625
+ let t10;
626
+ let t9;
627
+ if ($[21] !== selectableItems) {
628
+ t9 = () => setSelectedIndex((prev) => prev === 0 ? selectableItems.length - 1 : prev - 1);
629
+ t10 = () => setSelectedIndex((prev_0) => prev_0 === selectableItems.length - 1 ? 0 : prev_0 + 1);
630
+ $[21] = selectableItems;
631
+ $[22] = t10;
632
+ $[23] = t9;
633
+ } else {
634
+ t10 = $[22];
635
+ t9 = $[23];
636
+ }
637
+ let t11;
638
+ if ($[24] !== handleCancel || $[25] !== handleSelect || $[26] !== t10 || $[27] !== t9) {
639
+ t11 = {
640
+ "confirm:previous": t9,
641
+ "confirm:next": t10,
642
+ "confirm:yes": handleSelect,
643
+ "confirm:no": handleCancel
644
+ };
645
+ $[24] = handleCancel;
646
+ $[25] = handleSelect;
647
+ $[26] = t10;
648
+ $[27] = t9;
649
+ $[28] = t11;
650
+ } else {
651
+ t11 = $[28];
652
+ }
653
+ let t12;
654
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
655
+ t12 = {
656
+ context: "Confirmation"
657
+ };
658
+ $[29] = t12;
659
+ } else {
660
+ t12 = $[29];
661
+ }
662
+ useKeybindings(t11, t12);
663
+ let t13;
664
+ if ($[30] !== selectableItems) {
665
+ t13 = (server_2) => selectableItems.findIndex((item_0) => item_0.type === "server" && item_0.server === server_2);
666
+ $[30] = selectableItems;
667
+ $[31] = t13;
668
+ } else {
669
+ t13 = $[31];
670
+ }
671
+ const getServerIndex = t13;
672
+ let t14;
673
+ if ($[32] !== selectableItems) {
674
+ t14 = (agentServer_0) => selectableItems.findIndex((item_1) => item_1.type === "agent-server" && item_1.agentServer === agentServer_0);
675
+ $[32] = selectableItems;
676
+ $[33] = t14;
677
+ } else {
678
+ t14 = $[33];
679
+ }
680
+ const getAgentServerIndex = t14;
681
+ let t15;
682
+ if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
683
+ t15 = isDebugMode();
684
+ $[34] = t15;
685
+ } else {
686
+ t15 = $[34];
687
+ }
688
+ const debugMode = t15;
689
+ let t16;
690
+ if ($[35] !== servers) {
691
+ t16 = servers.some(_temp5);
692
+ $[35] = servers;
693
+ $[36] = t16;
694
+ } else {
695
+ t16 = $[36];
696
+ }
697
+ const hasFailedClients = t16;
698
+ if (servers.length === 0 && agentServers.length === 0) {
699
+ return null;
700
+ }
701
+ let t17;
702
+ if ($[37] !== getServerIndex || $[38] !== selectedIndex || $[39] !== theme) {
703
+ t17 = (server_3) => {
704
+ const index = getServerIndex(server_3);
705
+ const isSelected = selectedIndex === index;
706
+ let statusIcon;
707
+ let statusText;
708
+ if (server_3.client.type === "disabled") {
709
+ statusIcon = color("inactive", theme)(figures_default.radioOff);
710
+ statusText = "disabled";
711
+ } else {
712
+ if (server_3.client.type === "connected") {
713
+ statusIcon = color("success", theme)(figures_default.tick);
714
+ statusText = "connected";
715
+ } else {
716
+ if (server_3.client.type === "pending") {
717
+ statusIcon = color("inactive", theme)(figures_default.radioOff);
718
+ const {
719
+ reconnectAttempt,
720
+ maxReconnectAttempts
721
+ } = server_3.client;
722
+ if (reconnectAttempt && maxReconnectAttempts) {
723
+ statusText = `reconnecting (${reconnectAttempt}/${maxReconnectAttempts})\u2026`;
724
+ } else {
725
+ statusText = "connecting\u2026";
726
+ }
727
+ } else {
728
+ if (server_3.client.type === "needs-auth") {
729
+ statusIcon = color("warning", theme)(figures_default.triangleUpOutline);
730
+ statusText = "needs authentication";
731
+ } else {
732
+ statusIcon = color("error", theme)(figures_default.cross);
733
+ statusText = "failed";
734
+ }
735
+ }
736
+ }
737
+ }
738
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
739
+ children: [
740
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
741
+ color: isSelected ? "suggestion" : undefined,
742
+ children: isSelected ? `${figures_default.pointer} ` : " "
743
+ }, undefined, false, undefined, this),
744
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
745
+ color: isSelected ? "suggestion" : undefined,
746
+ children: server_3.name
747
+ }, undefined, false, undefined, this),
748
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
749
+ dimColor: !isSelected,
750
+ children: [
751
+ " \xB7 ",
752
+ statusIcon,
753
+ " "
754
+ ]
755
+ }, undefined, true, undefined, this),
756
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
757
+ dimColor: !isSelected,
758
+ children: statusText
759
+ }, undefined, false, undefined, this)
760
+ ]
761
+ }, `${server_3.name}-${index}`, true, undefined, this);
762
+ };
763
+ $[37] = getServerIndex;
764
+ $[38] = selectedIndex;
765
+ $[39] = theme;
766
+ $[40] = t17;
767
+ } else {
768
+ t17 = $[40];
769
+ }
770
+ const renderServerItem = t17;
771
+ let t18;
772
+ if ($[41] !== getAgentServerIndex || $[42] !== selectedIndex || $[43] !== theme) {
773
+ t18 = (agentServer_1) => {
774
+ const index_0 = getAgentServerIndex(agentServer_1);
775
+ const isSelected_0 = selectedIndex === index_0;
776
+ const statusIcon_0 = agentServer_1.needsAuth ? color("warning", theme)(figures_default.triangleUpOutline) : color("inactive", theme)(figures_default.radioOff);
777
+ const statusText_0 = agentServer_1.needsAuth ? "may need auth" : "agent-only";
778
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
779
+ children: [
780
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
781
+ color: isSelected_0 ? "suggestion" : undefined,
782
+ children: isSelected_0 ? `${figures_default.pointer} ` : " "
783
+ }, undefined, false, undefined, this),
784
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
785
+ color: isSelected_0 ? "suggestion" : undefined,
786
+ children: agentServer_1.name
787
+ }, undefined, false, undefined, this),
788
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
789
+ dimColor: !isSelected_0,
790
+ children: [
791
+ " \xB7 ",
792
+ statusIcon_0,
793
+ " "
794
+ ]
795
+ }, undefined, true, undefined, this),
796
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
797
+ dimColor: !isSelected_0,
798
+ children: statusText_0
799
+ }, undefined, false, undefined, this)
800
+ ]
801
+ }, `agent-${agentServer_1.name}-${index_0}`, true, undefined, this);
802
+ };
803
+ $[41] = getAgentServerIndex;
804
+ $[42] = selectedIndex;
805
+ $[43] = theme;
806
+ $[44] = t18;
807
+ } else {
808
+ t18 = $[44];
809
+ }
810
+ const renderAgentServerItem = t18;
811
+ const totalServers = servers.length + agentServers.length;
812
+ let t19;
813
+ if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
814
+ t19 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(McpParsingWarnings, {}, undefined, false, undefined, this);
815
+ $[45] = t19;
816
+ } else {
817
+ t19 = $[45];
818
+ }
819
+ let t20;
820
+ if ($[46] !== totalServers) {
821
+ t20 = plural(totalServers, "server");
822
+ $[46] = totalServers;
823
+ $[47] = t20;
824
+ } else {
825
+ t20 = $[47];
826
+ }
827
+ const t21 = `${totalServers} ${t20}`;
828
+ let t22;
829
+ if ($[48] !== renderServerItem || $[49] !== serversByScope) {
830
+ t22 = SCOPE_ORDER.map((scope_0) => {
831
+ const scopeServers_0 = serversByScope.get(scope_0);
832
+ if (!scopeServers_0 || scopeServers_0.length === 0) {
833
+ return null;
834
+ }
835
+ const heading = getScopeHeading(scope_0);
836
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
837
+ flexDirection: "column",
838
+ marginBottom: 1,
839
+ children: [
840
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
841
+ paddingLeft: 2,
842
+ children: [
843
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
844
+ bold: true,
845
+ children: heading.label
846
+ }, undefined, false, undefined, this),
847
+ heading.path && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
848
+ dimColor: true,
849
+ children: [
850
+ " (",
851
+ heading.path,
852
+ ")"
853
+ ]
854
+ }, undefined, true, undefined, this)
855
+ ]
856
+ }, undefined, true, undefined, this),
857
+ scopeServers_0.map((server_4) => renderServerItem(server_4))
858
+ ]
859
+ }, scope_0, true, undefined, this);
860
+ });
861
+ $[48] = renderServerItem;
862
+ $[49] = serversByScope;
863
+ $[50] = t22;
864
+ } else {
865
+ t22 = $[50];
866
+ }
867
+ let t23;
868
+ if ($[51] !== claudeAiServers || $[52] !== renderServerItem) {
869
+ t23 = claudeAiServers.length > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
870
+ flexDirection: "column",
871
+ marginBottom: 1,
872
+ children: [
873
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
874
+ paddingLeft: 2,
875
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
876
+ bold: true,
877
+ children: "claude.ai"
878
+ }, undefined, false, undefined, this)
879
+ }, undefined, false, undefined, this),
880
+ claudeAiServers.map((server_5) => renderServerItem(server_5))
881
+ ]
882
+ }, undefined, true, undefined, this);
883
+ $[51] = claudeAiServers;
884
+ $[52] = renderServerItem;
885
+ $[53] = t23;
886
+ } else {
887
+ t23 = $[53];
888
+ }
889
+ let t24;
890
+ if ($[54] !== agentServers || $[55] !== renderAgentServerItem) {
891
+ t24 = agentServers.length > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
892
+ flexDirection: "column",
893
+ marginBottom: 1,
894
+ children: [
895
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
896
+ paddingLeft: 2,
897
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
898
+ bold: true,
899
+ children: "Agent MCPs"
900
+ }, undefined, false, undefined, this)
901
+ }, undefined, false, undefined, this),
902
+ [...new Set(agentServers.flatMap(_temp6))].map((agentName) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
903
+ flexDirection: "column",
904
+ marginTop: 1,
905
+ children: [
906
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
907
+ paddingLeft: 2,
908
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
909
+ dimColor: true,
910
+ children: [
911
+ "@",
912
+ agentName
913
+ ]
914
+ }, undefined, true, undefined, this)
915
+ }, undefined, false, undefined, this),
916
+ agentServers.filter((s_3) => s_3.sourceAgents.includes(agentName)).map((agentServer_2) => renderAgentServerItem(agentServer_2))
917
+ ]
918
+ }, agentName, true, undefined, this))
919
+ ]
920
+ }, undefined, true, undefined, this);
921
+ $[54] = agentServers;
922
+ $[55] = renderAgentServerItem;
923
+ $[56] = t24;
924
+ } else {
925
+ t24 = $[56];
926
+ }
927
+ let t25;
928
+ if ($[57] !== dynamicServers || $[58] !== renderServerItem) {
929
+ t25 = dynamicServers.length > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
930
+ flexDirection: "column",
931
+ marginBottom: 1,
932
+ children: [
933
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
934
+ paddingLeft: 2,
935
+ children: [
936
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
937
+ bold: true,
938
+ children: dynamicHeading.label
939
+ }, undefined, false, undefined, this),
940
+ dynamicHeading.path && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
941
+ dimColor: true,
942
+ children: [
943
+ " (",
944
+ dynamicHeading.path,
945
+ ")"
946
+ ]
947
+ }, undefined, true, undefined, this)
948
+ ]
949
+ }, undefined, true, undefined, this),
950
+ dynamicServers.map((server_6) => renderServerItem(server_6))
951
+ ]
952
+ }, undefined, true, undefined, this);
953
+ $[57] = dynamicServers;
954
+ $[58] = renderServerItem;
955
+ $[59] = t25;
956
+ } else {
957
+ t25 = $[59];
958
+ }
959
+ let t26;
960
+ if ($[60] !== hasFailedClients) {
961
+ t26 = hasFailedClients && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
962
+ dimColor: true,
963
+ children: debugMode ? "\u203B Error logs shown inline with --debug" : "\u203B Run claude --debug to see error logs"
964
+ }, undefined, false, undefined, this);
965
+ $[60] = hasFailedClients;
966
+ $[61] = t26;
967
+ } else {
968
+ t26 = $[61];
969
+ }
970
+ let t27;
971
+ if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
972
+ t27 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
973
+ dimColor: true,
974
+ children: [
975
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Link, {
976
+ url: "https://code.claude.com/docs/en/mcp",
977
+ children: "https://code.claude.com/docs/en/mcp"
978
+ }, undefined, false, undefined, this),
979
+ " ",
980
+ "for help"
981
+ ]
982
+ }, undefined, true, undefined, this);
983
+ $[62] = t27;
984
+ } else {
985
+ t27 = $[62];
986
+ }
987
+ let t28;
988
+ if ($[63] !== t26) {
989
+ t28 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
990
+ flexDirection: "column",
991
+ children: [
992
+ t26,
993
+ t27
994
+ ]
995
+ }, undefined, true, undefined, this);
996
+ $[63] = t26;
997
+ $[64] = t28;
998
+ } else {
999
+ t28 = $[64];
1000
+ }
1001
+ let t29;
1002
+ if ($[65] !== t22 || $[66] !== t23 || $[67] !== t24 || $[68] !== t25 || $[69] !== t28) {
1003
+ t29 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
1004
+ flexDirection: "column",
1005
+ children: [
1006
+ t22,
1007
+ t23,
1008
+ t24,
1009
+ t25,
1010
+ t28
1011
+ ]
1012
+ }, undefined, true, undefined, this);
1013
+ $[65] = t22;
1014
+ $[66] = t23;
1015
+ $[67] = t24;
1016
+ $[68] = t25;
1017
+ $[69] = t28;
1018
+ $[70] = t29;
1019
+ } else {
1020
+ t29 = $[70];
1021
+ }
1022
+ let t30;
1023
+ if ($[71] !== handleCancel || $[72] !== t21 || $[73] !== t29) {
1024
+ t30 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
1025
+ title: "Manage MCP servers",
1026
+ subtitle: t21,
1027
+ onCancel: handleCancel,
1028
+ hideInputGuide: true,
1029
+ children: t29
1030
+ }, undefined, false, undefined, this);
1031
+ $[71] = handleCancel;
1032
+ $[72] = t21;
1033
+ $[73] = t29;
1034
+ $[74] = t30;
1035
+ } else {
1036
+ t30 = $[74];
1037
+ }
1038
+ let t31;
1039
+ if ($[75] === Symbol.for("react.memo_cache_sentinel")) {
1040
+ t31 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
1041
+ paddingX: 1,
1042
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
1043
+ dimColor: true,
1044
+ italic: true,
1045
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Byline, {
1046
+ children: [
1047
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
1048
+ shortcut: "\u2191\u2193",
1049
+ action: "navigate"
1050
+ }, undefined, false, undefined, this),
1051
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(KeyboardShortcutHint, {
1052
+ shortcut: "Enter",
1053
+ action: "confirm"
1054
+ }, undefined, false, undefined, this),
1055
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ConfigurableShortcutHint, {
1056
+ action: "confirm:no",
1057
+ context: "Confirmation",
1058
+ fallback: "Esc",
1059
+ description: "cancel"
1060
+ }, undefined, false, undefined, this)
1061
+ ]
1062
+ }, undefined, true, undefined, this)
1063
+ }, undefined, false, undefined, this)
1064
+ }, undefined, false, undefined, this);
1065
+ $[75] = t31;
1066
+ } else {
1067
+ t31 = $[75];
1068
+ }
1069
+ let t32;
1070
+ if ($[76] !== t30) {
1071
+ t32 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
1072
+ flexDirection: "column",
1073
+ children: [
1074
+ t19,
1075
+ t30,
1076
+ t31
1077
+ ]
1078
+ }, undefined, true, undefined, this);
1079
+ $[76] = t30;
1080
+ $[77] = t32;
1081
+ } else {
1082
+ t32 = $[77];
1083
+ }
1084
+ return t32;
1085
+ }
1086
+ function _temp6(s_2) {
1087
+ return s_2.sourceAgents;
1088
+ }
1089
+ function _temp5(s_1) {
1090
+ return s_1.client.type === "failed";
1091
+ }
1092
+ function _temp4(a_0, b_0) {
1093
+ return a_0.name.localeCompare(b_0.name);
1094
+ }
1095
+ function _temp3(a, b) {
1096
+ return a.name.localeCompare(b.name);
1097
+ }
1098
+ function _temp2(s_0) {
1099
+ return s_0.client.config.type === "claudeai-proxy";
1100
+ }
1101
+ function _temp(s) {
1102
+ return s.client.config.type !== "claudeai-proxy";
1103
+ }
1104
+ var import_compiler_runtime, import_react2, jsx_dev_runtime2, SCOPE_ORDER;
1105
+ var init_MCPListPanel = __esm(() => {
1106
+ init_figures();
1107
+ init_ink();
1108
+ init_useKeybinding();
1109
+ init_utils();
1110
+ init_debug();
1111
+ init_stringUtils();
1112
+ init_ConfigurableShortcutHint();
1113
+ init_Byline();
1114
+ init_Dialog();
1115
+ init_KeyboardShortcutHint();
1116
+ init_McpParsingWarnings();
1117
+ import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
1118
+ import_react2 = __toESM(require_react(), 1);
1119
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
1120
+ SCOPE_ORDER = ["project", "local", "user", "enterprise"];
1121
+ });
1122
+
1123
+ // src/components/mcp/MCPReconnect.tsx
1124
+ function MCPReconnect(t0) {
1125
+ const $ = import_compiler_runtime2.c(25);
1126
+ const {
1127
+ serverName,
1128
+ onComplete
1129
+ } = t0;
1130
+ const [theme] = useTheme();
1131
+ const store = useAppStateStore();
1132
+ const reconnectMcpServer = useMcpReconnect();
1133
+ const [isReconnecting, setIsReconnecting] = import_react3.useState(true);
1134
+ const [error, setError] = import_react3.useState(null);
1135
+ let t1;
1136
+ let t2;
1137
+ if ($[0] !== onComplete || $[1] !== reconnectMcpServer || $[2] !== serverName || $[3] !== store) {
1138
+ t1 = () => {
1139
+ const attemptReconnect = async function attemptReconnect2() {
1140
+ try {
1141
+ const server = store.getState().mcp.clients.find((c) => c.name === serverName);
1142
+ if (!server) {
1143
+ setError(`MCP server "${serverName}" not found`);
1144
+ setIsReconnecting(false);
1145
+ onComplete(`MCP server "${serverName}" not found`);
1146
+ return;
1147
+ }
1148
+ const result = await reconnectMcpServer(serverName);
1149
+ bb43:
1150
+ switch (result.client.type) {
1151
+ case "connected": {
1152
+ setIsReconnecting(false);
1153
+ onComplete(`Successfully reconnected to ${serverName}`);
1154
+ break bb43;
1155
+ }
1156
+ case "needs-auth": {
1157
+ setError(`${serverName} requires authentication`);
1158
+ setIsReconnecting(false);
1159
+ onComplete(`${serverName} requires authentication. Use /mcp to authenticate.`);
1160
+ break bb43;
1161
+ }
1162
+ case "pending":
1163
+ case "failed":
1164
+ case "disabled": {
1165
+ setError(`Failed to reconnect to ${serverName}`);
1166
+ setIsReconnecting(false);
1167
+ onComplete(`Failed to reconnect to ${serverName}`);
1168
+ }
1169
+ }
1170
+ } catch (t3) {
1171
+ const err = t3;
1172
+ const errorMessage = err instanceof Error ? err.message : String(err);
1173
+ setError(errorMessage);
1174
+ setIsReconnecting(false);
1175
+ onComplete(`Error: ${errorMessage}`);
1176
+ }
1177
+ };
1178
+ attemptReconnect();
1179
+ };
1180
+ t2 = [serverName, reconnectMcpServer, store, onComplete];
1181
+ $[0] = onComplete;
1182
+ $[1] = reconnectMcpServer;
1183
+ $[2] = serverName;
1184
+ $[3] = store;
1185
+ $[4] = t1;
1186
+ $[5] = t2;
1187
+ } else {
1188
+ t1 = $[4];
1189
+ t2 = $[5];
1190
+ }
1191
+ import_react3.useEffect(t1, t2);
1192
+ if (isReconnecting) {
1193
+ let t3;
1194
+ if ($[6] !== serverName) {
1195
+ t3 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1196
+ color: "text",
1197
+ children: [
1198
+ "Reconnecting to ",
1199
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1200
+ bold: true,
1201
+ children: serverName
1202
+ }, undefined, false, undefined, this)
1203
+ ]
1204
+ }, undefined, true, undefined, this);
1205
+ $[6] = serverName;
1206
+ $[7] = t3;
1207
+ } else {
1208
+ t3 = $[7];
1209
+ }
1210
+ let t4;
1211
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1212
+ t4 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1213
+ children: [
1214
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Spinner, {}, undefined, false, undefined, this),
1215
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1216
+ children: " Establishing connection to MCP server"
1217
+ }, undefined, false, undefined, this)
1218
+ ]
1219
+ }, undefined, true, undefined, this);
1220
+ $[8] = t4;
1221
+ } else {
1222
+ t4 = $[8];
1223
+ }
1224
+ let t5;
1225
+ if ($[9] !== t3) {
1226
+ t5 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1227
+ flexDirection: "column",
1228
+ gap: 1,
1229
+ padding: 1,
1230
+ children: [
1231
+ t3,
1232
+ t4
1233
+ ]
1234
+ }, undefined, true, undefined, this);
1235
+ $[9] = t3;
1236
+ $[10] = t5;
1237
+ } else {
1238
+ t5 = $[10];
1239
+ }
1240
+ return t5;
1241
+ }
1242
+ if (error) {
1243
+ let t3;
1244
+ if ($[11] !== theme) {
1245
+ t3 = color("error", theme)(figures_default.cross);
1246
+ $[11] = theme;
1247
+ $[12] = t3;
1248
+ } else {
1249
+ t3 = $[12];
1250
+ }
1251
+ let t4;
1252
+ if ($[13] !== t3) {
1253
+ t4 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1254
+ children: [
1255
+ t3,
1256
+ " "
1257
+ ]
1258
+ }, undefined, true, undefined, this);
1259
+ $[13] = t3;
1260
+ $[14] = t4;
1261
+ } else {
1262
+ t4 = $[14];
1263
+ }
1264
+ let t5;
1265
+ if ($[15] !== serverName) {
1266
+ t5 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1267
+ color: "error",
1268
+ children: [
1269
+ "Failed to reconnect to ",
1270
+ serverName
1271
+ ]
1272
+ }, undefined, true, undefined, this);
1273
+ $[15] = serverName;
1274
+ $[16] = t5;
1275
+ } else {
1276
+ t5 = $[16];
1277
+ }
1278
+ let t6;
1279
+ if ($[17] !== t4 || $[18] !== t5) {
1280
+ t6 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1281
+ children: [
1282
+ t4,
1283
+ t5
1284
+ ]
1285
+ }, undefined, true, undefined, this);
1286
+ $[17] = t4;
1287
+ $[18] = t5;
1288
+ $[19] = t6;
1289
+ } else {
1290
+ t6 = $[19];
1291
+ }
1292
+ let t7;
1293
+ if ($[20] !== error) {
1294
+ t7 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1295
+ dimColor: true,
1296
+ children: [
1297
+ "Error: ",
1298
+ error
1299
+ ]
1300
+ }, undefined, true, undefined, this);
1301
+ $[20] = error;
1302
+ $[21] = t7;
1303
+ } else {
1304
+ t7 = $[21];
1305
+ }
1306
+ let t8;
1307
+ if ($[22] !== t6 || $[23] !== t7) {
1308
+ t8 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1309
+ flexDirection: "column",
1310
+ gap: 1,
1311
+ padding: 1,
1312
+ children: [
1313
+ t6,
1314
+ t7
1315
+ ]
1316
+ }, undefined, true, undefined, this);
1317
+ $[22] = t6;
1318
+ $[23] = t7;
1319
+ $[24] = t8;
1320
+ } else {
1321
+ t8 = $[24];
1322
+ }
1323
+ return t8;
1324
+ }
1325
+ return null;
1326
+ }
1327
+ var import_compiler_runtime2, import_react3, jsx_dev_runtime3;
1328
+ var init_MCPReconnect = __esm(() => {
1329
+ init_figures();
1330
+ init_ink();
1331
+ init_MCPConnectionManager();
1332
+ init_AppState();
1333
+ init_Spinner();
1334
+ import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
1335
+ import_react3 = __toESM(require_react(), 1);
1336
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
1337
+ });
1338
+
1339
+ // src/components/mcp/MCPSettings.tsx
1340
+ function MCPSettings(t0) {
1341
+ const $ = import_compiler_runtime3.c(66);
1342
+ const {
1343
+ onComplete
1344
+ } = t0;
1345
+ const mcp = useAppState(_temp7);
1346
+ const agentDefinitions = useAppState(_temp22);
1347
+ const mcpClients = mcp.clients;
1348
+ let t1;
1349
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1350
+ t1 = {
1351
+ type: "list"
1352
+ };
1353
+ $[0] = t1;
1354
+ } else {
1355
+ t1 = $[0];
1356
+ }
1357
+ const [viewState, setViewState] = import_react4.default.useState(t1);
1358
+ let t2;
1359
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1360
+ t2 = [];
1361
+ $[1] = t2;
1362
+ } else {
1363
+ t2 = $[1];
1364
+ }
1365
+ const [servers, setServers] = import_react4.default.useState(t2);
1366
+ let t3;
1367
+ if ($[2] !== agentDefinitions.allAgents) {
1368
+ t3 = extractAgentMcpServers(agentDefinitions.allAgents);
1369
+ $[2] = agentDefinitions.allAgents;
1370
+ $[3] = t3;
1371
+ } else {
1372
+ t3 = $[3];
1373
+ }
1374
+ const agentMcpServers = t3;
1375
+ let t4;
1376
+ if ($[4] !== mcpClients) {
1377
+ t4 = mcpClients.filter(_temp32).sort(_temp42);
1378
+ $[4] = mcpClients;
1379
+ $[5] = t4;
1380
+ } else {
1381
+ t4 = $[5];
1382
+ }
1383
+ const filteredClients = t4;
1384
+ let t5;
1385
+ let t6;
1386
+ if ($[6] !== filteredClients || $[7] !== mcp.tools) {
1387
+ t5 = () => {
1388
+ let cancelled = false;
1389
+ const prepareServers = async function prepareServers2() {
1390
+ const serverInfos = await Promise.all(filteredClients.map(async (client_0) => {
1391
+ const scope = client_0.config.scope;
1392
+ const isSSE = client_0.config.type === "sse";
1393
+ const isHTTP = client_0.config.type === "http";
1394
+ const isClaudeAIProxy = client_0.config.type === "claudeai-proxy";
1395
+ let isAuthenticated = undefined;
1396
+ if (isSSE || isHTTP) {
1397
+ const authProvider = new ClaudeAuthProvider(client_0.name, client_0.config);
1398
+ const tokens = await authProvider.tokens();
1399
+ const hasSessionAuth = getSessionIngressAuthToken() !== null && client_0.type === "connected";
1400
+ const hasToolsAndConnected = client_0.type === "connected" && filterToolsByServer(mcp.tools, client_0.name).length > 0;
1401
+ isAuthenticated = Boolean(tokens) || hasSessionAuth || hasToolsAndConnected;
1402
+ }
1403
+ const baseInfo = {
1404
+ name: client_0.name,
1405
+ client: client_0,
1406
+ scope
1407
+ };
1408
+ if (isClaudeAIProxy) {
1409
+ return {
1410
+ ...baseInfo,
1411
+ transport: "claudeai-proxy",
1412
+ isAuthenticated: false,
1413
+ config: client_0.config
1414
+ };
1415
+ } else {
1416
+ if (isSSE) {
1417
+ return {
1418
+ ...baseInfo,
1419
+ transport: "sse",
1420
+ isAuthenticated,
1421
+ config: client_0.config
1422
+ };
1423
+ } else {
1424
+ if (isHTTP) {
1425
+ return {
1426
+ ...baseInfo,
1427
+ transport: "http",
1428
+ isAuthenticated,
1429
+ config: client_0.config
1430
+ };
1431
+ } else {
1432
+ return {
1433
+ ...baseInfo,
1434
+ transport: "stdio",
1435
+ config: client_0.config
1436
+ };
1437
+ }
1438
+ }
1439
+ }
1440
+ }));
1441
+ if (cancelled) {
1442
+ return;
1443
+ }
1444
+ setServers(serverInfos);
1445
+ };
1446
+ prepareServers();
1447
+ return () => {
1448
+ cancelled = true;
1449
+ };
1450
+ };
1451
+ t6 = [filteredClients, mcp.tools];
1452
+ $[6] = filteredClients;
1453
+ $[7] = mcp.tools;
1454
+ $[8] = t5;
1455
+ $[9] = t6;
1456
+ } else {
1457
+ t5 = $[8];
1458
+ t6 = $[9];
1459
+ }
1460
+ import_react4.default.useEffect(t5, t6);
1461
+ let t7;
1462
+ let t8;
1463
+ if ($[10] !== agentMcpServers.length || $[11] !== filteredClients.length || $[12] !== onComplete || $[13] !== servers.length) {
1464
+ t7 = () => {
1465
+ if (servers.length === 0 && filteredClients.length > 0) {
1466
+ return;
1467
+ }
1468
+ if (servers.length === 0 && agentMcpServers.length === 0) {
1469
+ onComplete("No MCP servers configured. Please run /doctor if this is unexpected. Otherwise, run `claude mcp --help` or visit https://code.claude.com/docs/en/mcp to learn more.");
1470
+ }
1471
+ };
1472
+ t8 = [servers.length, filteredClients.length, agentMcpServers.length, onComplete];
1473
+ $[10] = agentMcpServers.length;
1474
+ $[11] = filteredClients.length;
1475
+ $[12] = onComplete;
1476
+ $[13] = servers.length;
1477
+ $[14] = t7;
1478
+ $[15] = t8;
1479
+ } else {
1480
+ t7 = $[14];
1481
+ t8 = $[15];
1482
+ }
1483
+ import_react4.useEffect(t7, t8);
1484
+ switch (viewState.type) {
1485
+ case "list": {
1486
+ let t10;
1487
+ let t9;
1488
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
1489
+ t9 = (server) => setViewState({
1490
+ type: "server-menu",
1491
+ server
1492
+ });
1493
+ t10 = (agentServer) => setViewState({
1494
+ type: "agent-server-menu",
1495
+ agentServer
1496
+ });
1497
+ $[16] = t10;
1498
+ $[17] = t9;
1499
+ } else {
1500
+ t10 = $[16];
1501
+ t9 = $[17];
1502
+ }
1503
+ let t11;
1504
+ if ($[18] !== agentMcpServers || $[19] !== onComplete || $[20] !== servers || $[21] !== viewState.defaultTab) {
1505
+ t11 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(MCPListPanel, {
1506
+ servers,
1507
+ agentServers: agentMcpServers,
1508
+ onSelectServer: t9,
1509
+ onSelectAgentServer: t10,
1510
+ onComplete,
1511
+ defaultTab: viewState.defaultTab
1512
+ }, undefined, false, undefined, this);
1513
+ $[18] = agentMcpServers;
1514
+ $[19] = onComplete;
1515
+ $[20] = servers;
1516
+ $[21] = viewState.defaultTab;
1517
+ $[22] = t11;
1518
+ } else {
1519
+ t11 = $[22];
1520
+ }
1521
+ return t11;
1522
+ }
1523
+ case "server-menu": {
1524
+ let t9;
1525
+ if ($[23] !== mcp.tools || $[24] !== viewState.server.name) {
1526
+ t9 = filterToolsByServer(mcp.tools, viewState.server.name);
1527
+ $[23] = mcp.tools;
1528
+ $[24] = viewState.server.name;
1529
+ $[25] = t9;
1530
+ } else {
1531
+ t9 = $[25];
1532
+ }
1533
+ const serverTools_0 = t9;
1534
+ const defaultTab = viewState.server.transport === "claudeai-proxy" ? "claude.ai" : "Claude Code";
1535
+ if (viewState.server.transport === "stdio") {
1536
+ let t10;
1537
+ if ($[26] !== viewState.server) {
1538
+ t10 = () => setViewState({
1539
+ type: "server-tools",
1540
+ server: viewState.server
1541
+ });
1542
+ $[26] = viewState.server;
1543
+ $[27] = t10;
1544
+ } else {
1545
+ t10 = $[27];
1546
+ }
1547
+ let t11;
1548
+ if ($[28] !== defaultTab) {
1549
+ t11 = () => setViewState({
1550
+ type: "list",
1551
+ defaultTab
1552
+ });
1553
+ $[28] = defaultTab;
1554
+ $[29] = t11;
1555
+ } else {
1556
+ t11 = $[29];
1557
+ }
1558
+ let t12;
1559
+ if ($[30] !== onComplete || $[31] !== serverTools_0.length || $[32] !== t10 || $[33] !== t11 || $[34] !== viewState.server) {
1560
+ t12 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(MCPStdioServerMenu, {
1561
+ server: viewState.server,
1562
+ serverToolsCount: serverTools_0.length,
1563
+ onViewTools: t10,
1564
+ onCancel: t11,
1565
+ onComplete
1566
+ }, undefined, false, undefined, this);
1567
+ $[30] = onComplete;
1568
+ $[31] = serverTools_0.length;
1569
+ $[32] = t10;
1570
+ $[33] = t11;
1571
+ $[34] = viewState.server;
1572
+ $[35] = t12;
1573
+ } else {
1574
+ t12 = $[35];
1575
+ }
1576
+ return t12;
1577
+ } else {
1578
+ let t10;
1579
+ if ($[36] !== viewState.server) {
1580
+ t10 = () => setViewState({
1581
+ type: "server-tools",
1582
+ server: viewState.server
1583
+ });
1584
+ $[36] = viewState.server;
1585
+ $[37] = t10;
1586
+ } else {
1587
+ t10 = $[37];
1588
+ }
1589
+ let t11;
1590
+ if ($[38] !== defaultTab) {
1591
+ t11 = () => setViewState({
1592
+ type: "list",
1593
+ defaultTab
1594
+ });
1595
+ $[38] = defaultTab;
1596
+ $[39] = t11;
1597
+ } else {
1598
+ t11 = $[39];
1599
+ }
1600
+ let t12;
1601
+ if ($[40] !== onComplete || $[41] !== serverTools_0.length || $[42] !== t10 || $[43] !== t11 || $[44] !== viewState.server) {
1602
+ t12 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(MCPRemoteServerMenu, {
1603
+ server: viewState.server,
1604
+ serverToolsCount: serverTools_0.length,
1605
+ onViewTools: t10,
1606
+ onCancel: t11,
1607
+ onComplete
1608
+ }, undefined, false, undefined, this);
1609
+ $[40] = onComplete;
1610
+ $[41] = serverTools_0.length;
1611
+ $[42] = t10;
1612
+ $[43] = t11;
1613
+ $[44] = viewState.server;
1614
+ $[45] = t12;
1615
+ } else {
1616
+ t12 = $[45];
1617
+ }
1618
+ return t12;
1619
+ }
1620
+ }
1621
+ case "server-tools": {
1622
+ let t10;
1623
+ let t9;
1624
+ if ($[46] !== viewState.server) {
1625
+ t9 = (_, index) => setViewState({
1626
+ type: "server-tool-detail",
1627
+ server: viewState.server,
1628
+ toolIndex: index
1629
+ });
1630
+ t10 = () => setViewState({
1631
+ type: "server-menu",
1632
+ server: viewState.server
1633
+ });
1634
+ $[46] = viewState.server;
1635
+ $[47] = t10;
1636
+ $[48] = t9;
1637
+ } else {
1638
+ t10 = $[47];
1639
+ t9 = $[48];
1640
+ }
1641
+ let t11;
1642
+ if ($[49] !== t10 || $[50] !== t9 || $[51] !== viewState.server) {
1643
+ t11 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(MCPToolListView, {
1644
+ server: viewState.server,
1645
+ onSelectTool: t9,
1646
+ onBack: t10
1647
+ }, undefined, false, undefined, this);
1648
+ $[49] = t10;
1649
+ $[50] = t9;
1650
+ $[51] = viewState.server;
1651
+ $[52] = t11;
1652
+ } else {
1653
+ t11 = $[52];
1654
+ }
1655
+ return t11;
1656
+ }
1657
+ case "server-tool-detail": {
1658
+ let t9;
1659
+ if ($[53] !== mcp.tools || $[54] !== viewState.server.name) {
1660
+ t9 = filterToolsByServer(mcp.tools, viewState.server.name);
1661
+ $[53] = mcp.tools;
1662
+ $[54] = viewState.server.name;
1663
+ $[55] = t9;
1664
+ } else {
1665
+ t9 = $[55];
1666
+ }
1667
+ const serverTools = t9;
1668
+ const tool = serverTools[viewState.toolIndex];
1669
+ if (!tool) {
1670
+ setViewState({
1671
+ type: "server-tools",
1672
+ server: viewState.server
1673
+ });
1674
+ return null;
1675
+ }
1676
+ let t10;
1677
+ if ($[56] !== viewState.server) {
1678
+ t10 = () => setViewState({
1679
+ type: "server-tools",
1680
+ server: viewState.server
1681
+ });
1682
+ $[56] = viewState.server;
1683
+ $[57] = t10;
1684
+ } else {
1685
+ t10 = $[57];
1686
+ }
1687
+ let t11;
1688
+ if ($[58] !== t10 || $[59] !== tool || $[60] !== viewState.server) {
1689
+ t11 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(MCPToolDetailView, {
1690
+ tool,
1691
+ server: viewState.server,
1692
+ onBack: t10
1693
+ }, undefined, false, undefined, this);
1694
+ $[58] = t10;
1695
+ $[59] = tool;
1696
+ $[60] = viewState.server;
1697
+ $[61] = t11;
1698
+ } else {
1699
+ t11 = $[61];
1700
+ }
1701
+ return t11;
1702
+ }
1703
+ case "agent-server-menu": {
1704
+ let t9;
1705
+ if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
1706
+ t9 = () => setViewState({
1707
+ type: "list",
1708
+ defaultTab: "Agents"
1709
+ });
1710
+ $[62] = t9;
1711
+ } else {
1712
+ t9 = $[62];
1713
+ }
1714
+ let t10;
1715
+ if ($[63] !== onComplete || $[64] !== viewState.agentServer) {
1716
+ t10 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(MCPAgentServerMenu, {
1717
+ agentServer: viewState.agentServer,
1718
+ onCancel: t9,
1719
+ onComplete
1720
+ }, undefined, false, undefined, this);
1721
+ $[63] = onComplete;
1722
+ $[64] = viewState.agentServer;
1723
+ $[65] = t10;
1724
+ } else {
1725
+ t10 = $[65];
1726
+ }
1727
+ return t10;
1728
+ }
1729
+ }
1730
+ }
1731
+ function _temp42(a, b) {
1732
+ return a.name.localeCompare(b.name);
1733
+ }
1734
+ function _temp32(client) {
1735
+ return client.name !== "ide";
1736
+ }
1737
+ function _temp22(s_0) {
1738
+ return s_0.agentDefinitions;
1739
+ }
1740
+ function _temp7(s) {
1741
+ return s.mcp;
1742
+ }
1743
+ var import_compiler_runtime3, import_react4, jsx_dev_runtime4;
1744
+ var init_MCPSettings = __esm(() => {
1745
+ init_auth();
1746
+ init_utils();
1747
+ init_AppState();
1748
+ init_sessionIngressAuth();
1749
+ init_MCPAgentServerMenu();
1750
+ init_MCPListPanel();
1751
+ init_MCPRemoteServerMenu();
1752
+ init_MCPStdioServerMenu();
1753
+ init_MCPToolDetailView();
1754
+ init_MCPToolListView();
1755
+ import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
1756
+ import_react4 = __toESM(require_react(), 1);
1757
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
1758
+ });
1759
+
1760
+ // src/components/mcp/index.ts
1761
+ var init_mcp = __esm(() => {
1762
+ init_MCPAgentServerMenu();
1763
+ init_MCPListPanel();
1764
+ init_MCPReconnect();
1765
+ init_MCPRemoteServerMenu();
1766
+ init_MCPSettings();
1767
+ init_MCPStdioServerMenu();
1768
+ init_MCPToolDetailView();
1769
+ init_MCPToolListView();
1770
+ });
1771
+
1772
+ // src/commands/mcp/mcp.tsx
1773
+ function MCPToggle(t0) {
1774
+ const $ = import_compiler_runtime4.c(7);
1775
+ const {
1776
+ action,
1777
+ target,
1778
+ onComplete
1779
+ } = t0;
1780
+ const mcpClients = useAppState(_temp9);
1781
+ const toggleMcpServer = useMcpToggleEnabled();
1782
+ const didRun = import_react5.useRef(false);
1783
+ let t1;
1784
+ let t2;
1785
+ if ($[0] !== action || $[1] !== mcpClients || $[2] !== onComplete || $[3] !== target || $[4] !== toggleMcpServer) {
1786
+ t1 = () => {
1787
+ if (didRun.current) {
1788
+ return;
1789
+ }
1790
+ didRun.current = true;
1791
+ const isEnabling = action === "enable";
1792
+ const clients = mcpClients.filter(_temp23);
1793
+ const toToggle = target === "all" ? clients.filter((c_0) => isEnabling ? c_0.type === "disabled" : c_0.type !== "disabled") : clients.filter((c_1) => c_1.name === target);
1794
+ if (toToggle.length === 0) {
1795
+ onComplete(target === "all" ? `All MCP servers are already ${isEnabling ? "enabled" : "disabled"}` : `MCP server "${target}" not found`);
1796
+ return;
1797
+ }
1798
+ for (const s_0 of toToggle) {
1799
+ toggleMcpServer(s_0.name);
1800
+ }
1801
+ onComplete(target === "all" ? `${isEnabling ? "Enabled" : "Disabled"} ${toToggle.length} MCP server(s)` : `MCP server "${target}" ${isEnabling ? "enabled" : "disabled"}`);
1802
+ };
1803
+ t2 = [action, target, mcpClients, toggleMcpServer, onComplete];
1804
+ $[0] = action;
1805
+ $[1] = mcpClients;
1806
+ $[2] = onComplete;
1807
+ $[3] = target;
1808
+ $[4] = toggleMcpServer;
1809
+ $[5] = t1;
1810
+ $[6] = t2;
1811
+ } else {
1812
+ t1 = $[5];
1813
+ t2 = $[6];
1814
+ }
1815
+ import_react5.useEffect(t1, t2);
1816
+ return null;
1817
+ }
1818
+ function _temp23(c) {
1819
+ return c.name !== "ide";
1820
+ }
1821
+ function _temp9(s) {
1822
+ return s.mcp.clients;
1823
+ }
1824
+ async function call(onDone, _context, args) {
1825
+ if (args) {
1826
+ const parts = args.trim().split(/\s+/);
1827
+ if (parts[0] === "no-redirect") {
1828
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(MCPSettings, {
1829
+ onComplete: onDone
1830
+ }, undefined, false, undefined, this);
1831
+ }
1832
+ if (parts[0] === "reconnect" && parts[1]) {
1833
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(MCPReconnect, {
1834
+ serverName: parts.slice(1).join(" "),
1835
+ onComplete: onDone
1836
+ }, undefined, false, undefined, this);
1837
+ }
1838
+ if (parts[0] === "enable" || parts[0] === "disable") {
1839
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(MCPToggle, {
1840
+ action: parts[0],
1841
+ target: parts.length > 1 ? parts.slice(1).join(" ") : "all",
1842
+ onComplete: onDone
1843
+ }, undefined, false, undefined, this);
1844
+ }
1845
+ }
1846
+ if (false) {}
1847
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(MCPSettings, {
1848
+ onComplete: onDone
1849
+ }, undefined, false, undefined, this);
1850
+ }
1851
+ var import_compiler_runtime4, import_react5, jsx_dev_runtime5;
1852
+ var init_mcp2 = __esm(() => {
1853
+ init_mcp();
1854
+ init_MCPReconnect();
1855
+ init_MCPConnectionManager();
1856
+ init_AppState();
1857
+ init_PluginSettings();
1858
+ import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
1859
+ import_react5 = __toESM(require_react(), 1);
1860
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1861
+ });
1862
+ init_mcp2();
1863
+
1864
+ export {
1865
+ call
1866
+ };