@zyycn/claudex 1.0.3-fork.2a74621

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 (450) hide show
  1. package/LICENSE.md +5 -0
  2. package/README.md +489 -0
  3. package/bin/claudex.js +40 -0
  4. package/dist/chunk-00xcm9ma.js +21933 -0
  5. package/dist/chunk-0503mmvy.js +153 -0
  6. package/dist/chunk-06saje2v.js +39 -0
  7. package/dist/chunk-0731m51q.js +8 -0
  8. package/dist/chunk-0htr6ryz.js +208 -0
  9. package/dist/chunk-0hw5q246.js +59 -0
  10. package/dist/chunk-0na45fm9.js +93 -0
  11. package/dist/chunk-0paqc2yw.js +15 -0
  12. package/dist/chunk-0q2xkmse.js +58 -0
  13. package/dist/chunk-0rvxx6st.js +195 -0
  14. package/dist/chunk-0vkfrmqm.js +690 -0
  15. package/dist/chunk-0xjaqda8.js +1124 -0
  16. package/dist/chunk-0xpb84zw.js +105 -0
  17. package/dist/chunk-1141xmr4.js +8 -0
  18. package/dist/chunk-14jv3jm7.js +17 -0
  19. package/dist/chunk-19vtvtzg.js +496 -0
  20. package/dist/chunk-1cbn5kxf.js +7 -0
  21. package/dist/chunk-1gj0rhkf.js +92 -0
  22. package/dist/chunk-1h2famwb.js +49 -0
  23. package/dist/chunk-1m68rrvt.js +173649 -0
  24. package/dist/chunk-1ss7dnmq.js +104 -0
  25. package/dist/chunk-1v6e40p8.js +160 -0
  26. package/dist/chunk-1vh98qr0.js +4521 -0
  27. package/dist/chunk-1xkekb9y.js +19 -0
  28. package/dist/chunk-1ydzf04y.js +713 -0
  29. package/dist/chunk-238g70xa.js +36 -0
  30. package/dist/chunk-27xc1csx.js +104 -0
  31. package/dist/chunk-297y1tw3.js +789 -0
  32. package/dist/chunk-2a42s11t.js +412 -0
  33. package/dist/chunk-2bpfbf16.js +998 -0
  34. package/dist/chunk-2eykm0j0.js +20 -0
  35. package/dist/chunk-2fwze72g.js +24 -0
  36. package/dist/chunk-2ge9kmgv.js +28 -0
  37. package/dist/chunk-2gzv8nrw.js +205 -0
  38. package/dist/chunk-2k995y2x.js +880 -0
  39. package/dist/chunk-2nayx6q1.js +63 -0
  40. package/dist/chunk-2qk1898r.js +74 -0
  41. package/dist/chunk-2qp0vrvd.js +83 -0
  42. package/dist/chunk-2sndq2nq.js +644 -0
  43. package/dist/chunk-2t1frg13.js +716 -0
  44. package/dist/chunk-2t3vw4tx.js +22820 -0
  45. package/dist/chunk-2ybjg7pc.js +432 -0
  46. package/dist/chunk-302gxdf9.js +161 -0
  47. package/dist/chunk-30rst83v.js +168 -0
  48. package/dist/chunk-33mdt86j.js +42 -0
  49. package/dist/chunk-33pgf56v.js +32 -0
  50. package/dist/chunk-36k7h1v1.js +372 -0
  51. package/dist/chunk-36zyyac9.js +41654 -0
  52. package/dist/chunk-37dbhqqr.js +1920 -0
  53. package/dist/chunk-37dydh7h.js +642 -0
  54. package/dist/chunk-38700exh.js +42 -0
  55. package/dist/chunk-3c25bcsw.js +17 -0
  56. package/dist/chunk-3h8a89gy.js +46 -0
  57. package/dist/chunk-3nk79af8.js +8 -0
  58. package/dist/chunk-3peatsdv.js +41 -0
  59. package/dist/chunk-3rd46sc5.js +221 -0
  60. package/dist/chunk-3s498jy8.js +1014 -0
  61. package/dist/chunk-3vs3nm7w.js +31 -0
  62. package/dist/chunk-3w6s9m5w.js +16 -0
  63. package/dist/chunk-3yccyqwm.js +692 -0
  64. package/dist/chunk-3zjjk0am.js +56 -0
  65. package/dist/chunk-3zzszjst.js +16415 -0
  66. package/dist/chunk-41m5za5y.js +154 -0
  67. package/dist/chunk-44fpr6jq.js +434 -0
  68. package/dist/chunk-48gwzq50.js +154 -0
  69. package/dist/chunk-495d85x1.js +8066 -0
  70. package/dist/chunk-4cse1nz6.js +98 -0
  71. package/dist/chunk-4f1wn74p.js +106 -0
  72. package/dist/chunk-4f9taz3j.js +86 -0
  73. package/dist/chunk-4g3v8y12.js +23 -0
  74. package/dist/chunk-4hh97qpv.js +765 -0
  75. package/dist/chunk-4jm600zv.js +13 -0
  76. package/dist/chunk-4jzv26gg.js +62 -0
  77. package/dist/chunk-4qgbmcm7.js +9193 -0
  78. package/dist/chunk-4qz9vbs1.js +349 -0
  79. package/dist/chunk-4tyttyn2.js +373 -0
  80. package/dist/chunk-4v0qvahs.js +89 -0
  81. package/dist/chunk-4zfkzkt6.js +37 -0
  82. package/dist/chunk-51xw8dbm.js +339 -0
  83. package/dist/chunk-525vnqc3.js +247 -0
  84. package/dist/chunk-557wwsxe.js +533 -0
  85. package/dist/chunk-55hj5hhv.js +84 -0
  86. package/dist/chunk-55wgxwa9.js +13877 -0
  87. package/dist/chunk-56jgazae.js +28 -0
  88. package/dist/chunk-58xxf3tz.js +521 -0
  89. package/dist/chunk-5c2m9q8v.js +109 -0
  90. package/dist/chunk-5fpcmgh8.js +348 -0
  91. package/dist/chunk-5gmd05y0.js +1153 -0
  92. package/dist/chunk-5gvng4zv.js +122 -0
  93. package/dist/chunk-5k5a32tj.js +537 -0
  94. package/dist/chunk-5md3w36r.js +275 -0
  95. package/dist/chunk-5z1vph5s.js +127 -0
  96. package/dist/chunk-5z78246t.js +54 -0
  97. package/dist/chunk-65s8h28p.js +123 -0
  98. package/dist/chunk-66qbb491.js +90 -0
  99. package/dist/chunk-693w4qr8.js +300 -0
  100. package/dist/chunk-6azerawy.js +2335 -0
  101. package/dist/chunk-6bd8brc4.js +48 -0
  102. package/dist/chunk-6d8k2crm.js +101 -0
  103. package/dist/chunk-6dj5t602.js +341 -0
  104. package/dist/chunk-6em0h8b4.js +88 -0
  105. package/dist/chunk-6gr3c3w9.js +378 -0
  106. package/dist/chunk-6gzakvec.js +87 -0
  107. package/dist/chunk-6hy71770.js +96 -0
  108. package/dist/chunk-6mtk8975.js +117 -0
  109. package/dist/chunk-6n2qgm9v.js +8 -0
  110. package/dist/chunk-6n7gewz2.js +253 -0
  111. package/dist/chunk-6r1112vx.js +469 -0
  112. package/dist/chunk-6r9v2rce.js +229 -0
  113. package/dist/chunk-6tq2v3rk.js +186 -0
  114. package/dist/chunk-70spdapk.js +79 -0
  115. package/dist/chunk-73rpbt04.js +1947 -0
  116. package/dist/chunk-760252na.js +101 -0
  117. package/dist/chunk-761tmgwx.js +6108 -0
  118. package/dist/chunk-76dy674m.js +648 -0
  119. package/dist/chunk-7739pg2c.js +4261 -0
  120. package/dist/chunk-78cznbzh.js +756 -0
  121. package/dist/chunk-78vqjj7t.js +1317 -0
  122. package/dist/chunk-79tame2q.js +280 -0
  123. package/dist/chunk-7aw745vx.js +40175 -0
  124. package/dist/chunk-7e6ahfxz.js +61 -0
  125. package/dist/chunk-7gd593wb.js +438 -0
  126. package/dist/chunk-7m2nd8da.js +110 -0
  127. package/dist/chunk-7pqesh1s.js +184 -0
  128. package/dist/chunk-7q237ftq.js +1585 -0
  129. package/dist/chunk-7vbxp63m.js +100 -0
  130. package/dist/chunk-7wm5s02e.js +216 -0
  131. package/dist/chunk-7xyswgjh.js +8 -0
  132. package/dist/chunk-7zaxrfnt.js +42 -0
  133. package/dist/chunk-83hfzbx3.js +10 -0
  134. package/dist/chunk-8bedvdm1.js +32 -0
  135. package/dist/chunk-8hq5kk3y.js +44 -0
  136. package/dist/chunk-8k0y8sk2.js +165 -0
  137. package/dist/chunk-8pb038eb.js +44 -0
  138. package/dist/chunk-8smr33wf.js +287 -0
  139. package/dist/chunk-8tnsngw2.js +31 -0
  140. package/dist/chunk-8vcz9eks.js +443 -0
  141. package/dist/chunk-8y12jxg8.js +10 -0
  142. package/dist/chunk-8ymf4e6z.js +48 -0
  143. package/dist/chunk-90wp6wez.js +10510 -0
  144. package/dist/chunk-9f9p2b84.js +848 -0
  145. package/dist/chunk-9gbamk79.js +93 -0
  146. package/dist/chunk-9k27xdmg.js +542 -0
  147. package/dist/chunk-9k2drwej.js +106 -0
  148. package/dist/chunk-9x5zgy22.js +12 -0
  149. package/dist/chunk-a5wwqn08.js +725 -0
  150. package/dist/chunk-a8ejc632.js +3094 -0
  151. package/dist/chunk-a9nr12c7.js +272 -0
  152. package/dist/chunk-a9vdeb6y.js +258 -0
  153. package/dist/chunk-a9zh40sj.js +48 -0
  154. package/dist/chunk-aberf6bd.js +282 -0
  155. package/dist/chunk-ada32h8c.js +40 -0
  156. package/dist/chunk-adg4351g.js +26840 -0
  157. package/dist/chunk-ae7s1rks.js +93 -0
  158. package/dist/chunk-agnasrp3.js +128 -0
  159. package/dist/chunk-akp4x1ve.js +93 -0
  160. package/dist/chunk-akyzxxs1.js +109 -0
  161. package/dist/chunk-ar08wx1s.js +468 -0
  162. package/dist/chunk-ar1vk71q.js +220 -0
  163. package/dist/chunk-arnhbg3z.js +87 -0
  164. package/dist/chunk-azk47w50.js +306 -0
  165. package/dist/chunk-b11e166f.js +173 -0
  166. package/dist/chunk-b292a9es.js +91 -0
  167. package/dist/chunk-b4v0varz.js +89 -0
  168. package/dist/chunk-b4wg70y1.js +54 -0
  169. package/dist/chunk-b75fzr8e.js +969 -0
  170. package/dist/chunk-b7cywkg9.js +908 -0
  171. package/dist/chunk-b80rg7hy.js +565 -0
  172. package/dist/chunk-b8x1gk3y.js +1299 -0
  173. package/dist/chunk-b9kme9pv.js +38 -0
  174. package/dist/chunk-bah68pmm.js +47 -0
  175. package/dist/chunk-bbxjktbd.js +69 -0
  176. package/dist/chunk-bc035ncb.js +153 -0
  177. package/dist/chunk-bedw0ft1.js +198 -0
  178. package/dist/chunk-bjqw6798.js +328 -0
  179. package/dist/chunk-bm1qb16p.js +17 -0
  180. package/dist/chunk-bqfnp99q.js +477 -0
  181. package/dist/chunk-bvp4dgm4.js +182 -0
  182. package/dist/chunk-c1k5g6t4.js +115 -0
  183. package/dist/chunk-c3r27fmp.js +73 -0
  184. package/dist/chunk-c9xk7hme.js +106 -0
  185. package/dist/chunk-cd155fv3.js +87 -0
  186. package/dist/chunk-cdz5yb0r.js +57 -0
  187. package/dist/chunk-cfv996bs.js +22 -0
  188. package/dist/chunk-cg606wr4.js +110 -0
  189. package/dist/chunk-cgfdkzhb.js +12 -0
  190. package/dist/chunk-chy5zbax.js +701 -0
  191. package/dist/chunk-ctkn4y2r.js +317 -0
  192. package/dist/chunk-czensfac.js +476 -0
  193. package/dist/chunk-d28x64s9.js +38 -0
  194. package/dist/chunk-d9kz373t.js +122 -0
  195. package/dist/chunk-dgqrcy74.js +48 -0
  196. package/dist/chunk-dnh7jtpb.js +37 -0
  197. package/dist/chunk-dnqqes3z.js +216 -0
  198. package/dist/chunk-dphmfzrv.js +250 -0
  199. package/dist/chunk-drzegvt5.js +86 -0
  200. package/dist/chunk-ds5nkfg0.js +1095 -0
  201. package/dist/chunk-dsf70j2y.js +1550 -0
  202. package/dist/chunk-dstxhxsx.js +121 -0
  203. package/dist/chunk-dv1wfr85.js +6373 -0
  204. package/dist/chunk-dxfhv5da.js +500 -0
  205. package/dist/chunk-e5pntxye.js +37 -0
  206. package/dist/chunk-e6q1y5gb.js +419 -0
  207. package/dist/chunk-e8bd8nfv.js +697 -0
  208. package/dist/chunk-e8d2zjs1.js +338 -0
  209. package/dist/chunk-e9aevcts.js +87 -0
  210. package/dist/chunk-eebcvtbb.js +1646 -0
  211. package/dist/chunk-egmp9ajp.js +144 -0
  212. package/dist/chunk-ehtwnxpg.js +1591 -0
  213. package/dist/chunk-eqp1rfft.js +17 -0
  214. package/dist/chunk-ewadzrm8.js +103 -0
  215. package/dist/chunk-eynjr6k5.js +169 -0
  216. package/dist/chunk-ezf1ppbj.js +208 -0
  217. package/dist/chunk-f4407gzr.js +129 -0
  218. package/dist/chunk-f5ma3nh5.js +3436 -0
  219. package/dist/chunk-fbpftpf0.js +69 -0
  220. package/dist/chunk-fbv4apne.js +51 -0
  221. package/dist/chunk-ffk6brrm.js +386 -0
  222. package/dist/chunk-fgebtwax.js +1872 -0
  223. package/dist/chunk-fkcn5zhs.js +40 -0
  224. package/dist/chunk-fm8gm3cm.js +120 -0
  225. package/dist/chunk-fw5ev6dp.js +458 -0
  226. package/dist/chunk-fyc5fepv.js +10 -0
  227. package/dist/chunk-fzj4am93.js +1493 -0
  228. package/dist/chunk-g0j0t6qk.js +26 -0
  229. package/dist/chunk-g338npwr.js +1061 -0
  230. package/dist/chunk-g3t0act8.js +8 -0
  231. package/dist/chunk-geyx5ybh.js +375 -0
  232. package/dist/chunk-gg3j3nv0.js +212 -0
  233. package/dist/chunk-gmaybtrd.js +726 -0
  234. package/dist/chunk-gqmkgbfr.js +256 -0
  235. package/dist/chunk-gv0tqhg0.js +118 -0
  236. package/dist/chunk-gyj242zr.js +20 -0
  237. package/dist/chunk-gz457zg6.js +463 -0
  238. package/dist/chunk-gzaaa3ex.js +166 -0
  239. package/dist/chunk-gzct9dkr.js +2057 -0
  240. package/dist/chunk-gzzfhtdv.js +7189 -0
  241. package/dist/chunk-h0qngp9w.js +157 -0
  242. package/dist/chunk-h0rbjg6x.js +55 -0
  243. package/dist/chunk-h4qh9a0e.js +3444 -0
  244. package/dist/chunk-hakdhagh.js +16606 -0
  245. package/dist/chunk-hazazgk5.js +3205 -0
  246. package/dist/chunk-hb7k1x8f.js +745 -0
  247. package/dist/chunk-hh7cmy4k.js +20 -0
  248. package/dist/chunk-hj4vr9dm.js +102 -0
  249. package/dist/chunk-hk90mbpv.js +3418 -0
  250. package/dist/chunk-hk9xz7gk.js +118 -0
  251. package/dist/chunk-hmtttwpt.js +132 -0
  252. package/dist/chunk-hqmz36b3.js +552 -0
  253. package/dist/chunk-hvm6gcy9.js +584 -0
  254. package/dist/chunk-hzhe8ygc.js +547 -0
  255. package/dist/chunk-j2k4p94p.js +55 -0
  256. package/dist/chunk-j2rbx1ej.js +96 -0
  257. package/dist/chunk-j3a4p81y.js +184 -0
  258. package/dist/chunk-j5hc27hv.js +444 -0
  259. package/dist/chunk-j64ga6ta.js +8035 -0
  260. package/dist/chunk-j84fcssx.js +54 -0
  261. package/dist/chunk-jce5r25x.js +18 -0
  262. package/dist/chunk-jd32zbps.js +15 -0
  263. package/dist/chunk-jdgeec04.js +4249 -0
  264. package/dist/chunk-jj0m6fr0.js +247 -0
  265. package/dist/chunk-jnhkref0.js +30 -0
  266. package/dist/chunk-jpp9dqv4.js +6956 -0
  267. package/dist/chunk-jr58a333.js +113 -0
  268. package/dist/chunk-jx817w05.js +11 -0
  269. package/dist/chunk-jxnvvps7.js +328 -0
  270. package/dist/chunk-jzmz18nn.js +65 -0
  271. package/dist/chunk-k0p9w03v.js +4957 -0
  272. package/dist/chunk-k2aj61ee.js +27 -0
  273. package/dist/chunk-kcv00nmk.js +849 -0
  274. package/dist/chunk-kecf7c6t.js +10476 -0
  275. package/dist/chunk-kffz0vxg.js +92 -0
  276. package/dist/chunk-kge53wbt.js +674 -0
  277. package/dist/chunk-khscb4ge.js +99 -0
  278. package/dist/chunk-kk4h10r3.js +3058 -0
  279. package/dist/chunk-kq0n3myz.js +71 -0
  280. package/dist/chunk-kwekc97v.js +18 -0
  281. package/dist/chunk-m44gmqd1.js +258 -0
  282. package/dist/chunk-m4kphr9e.js +71 -0
  283. package/dist/chunk-mbrkqdrq.js +155 -0
  284. package/dist/chunk-mt25echc.js +6157 -0
  285. package/dist/chunk-mvrpg273.js +89 -0
  286. package/dist/chunk-mzfgg9ne.js +275 -0
  287. package/dist/chunk-n0qaeaa5.js +256 -0
  288. package/dist/chunk-n0x2db3y.js +84 -0
  289. package/dist/chunk-n18sq04t.js +603 -0
  290. package/dist/chunk-n6qhan3n.js +243 -0
  291. package/dist/chunk-n7ttdtk0.js +641 -0
  292. package/dist/chunk-ncxetb9w.js +130 -0
  293. package/dist/chunk-ne67h2hc.js +277 -0
  294. package/dist/chunk-nfv508k1.js +306 -0
  295. package/dist/chunk-nj17bhkh.js +125 -0
  296. package/dist/chunk-nka1g8f4.js +773 -0
  297. package/dist/chunk-nma79c3w.js +281 -0
  298. package/dist/chunk-nq0fxyxh.js +752 -0
  299. package/dist/chunk-nt837qt9.js +21 -0
  300. package/dist/chunk-nwsmn6zm.js +15 -0
  301. package/dist/chunk-nypgx8vs.js +63 -0
  302. package/dist/chunk-p2816w9z.js +1486 -0
  303. package/dist/chunk-p2d5nh3g.js +342 -0
  304. package/dist/chunk-p331ghzg.js +391 -0
  305. package/dist/chunk-p3g43fdn.js +61 -0
  306. package/dist/chunk-p87jnvhk.js +97 -0
  307. package/dist/chunk-pb04jxp7.js +158 -0
  308. package/dist/chunk-pd6ph5ep.js +176 -0
  309. package/dist/chunk-pe0s50gj.js +32 -0
  310. package/dist/chunk-pe6w0anj.js +780 -0
  311. package/dist/chunk-ph936yc1.js +99 -0
  312. package/dist/chunk-pmsp9ed2.js +34 -0
  313. package/dist/chunk-ppwjyveh.js +8 -0
  314. package/dist/chunk-ps49ymvj.js +43 -0
  315. package/dist/chunk-pwwa7s62.js +11 -0
  316. package/dist/chunk-pxv7ggmm.js +1580 -0
  317. package/dist/chunk-py5y9jh1.js +38 -0
  318. package/dist/chunk-q0sq5qtt.js +606 -0
  319. package/dist/chunk-q1mq6fj3.js +118 -0
  320. package/dist/chunk-q25bjaev.js +15 -0
  321. package/dist/chunk-q55nn3jr.js +5018 -0
  322. package/dist/chunk-q6na5mcw.js +268 -0
  323. package/dist/chunk-q6wc9j6e.js +1556 -0
  324. package/dist/chunk-q7bxdsfd.js +22 -0
  325. package/dist/chunk-q82jz4qn.js +2838 -0
  326. package/dist/chunk-qbt1tq74.js +145 -0
  327. package/dist/chunk-qfzfjrk3.js +439 -0
  328. package/dist/chunk-qjg7a3vk.js +246 -0
  329. package/dist/chunk-qnfx3qtx.js +617 -0
  330. package/dist/chunk-qp2qdcda.js +100 -0
  331. package/dist/chunk-qpa4edje.js +95 -0
  332. package/dist/chunk-qqfa0dqg.js +2343 -0
  333. package/dist/chunk-qqfvrtr3.js +99 -0
  334. package/dist/chunk-qrqenkjd.js +140 -0
  335. package/dist/chunk-qrv8taxy.js +229 -0
  336. package/dist/chunk-qypqtrgp.js +176 -0
  337. package/dist/chunk-qywdhw43.js +89 -0
  338. package/dist/chunk-qz2x630m.js +49145 -0
  339. package/dist/chunk-r0v9bxma.js +83 -0
  340. package/dist/chunk-r6b58y3x.js +17 -0
  341. package/dist/chunk-r9madq2h.js +71 -0
  342. package/dist/chunk-raqgs410.js +116 -0
  343. package/dist/chunk-rc28tav4.js +202 -0
  344. package/dist/chunk-re1t10ba.js +5954 -0
  345. package/dist/chunk-res15ktd.js +18 -0
  346. package/dist/chunk-rkb7mqj8.js +603 -0
  347. package/dist/chunk-rn0v1hk8.js +34 -0
  348. package/dist/chunk-rrb8682q.js +120 -0
  349. package/dist/chunk-rs9gw711.js +115 -0
  350. package/dist/chunk-rtgznsee.js +43 -0
  351. package/dist/chunk-s2341895.js +24 -0
  352. package/dist/chunk-s2gr7ese.js +106 -0
  353. package/dist/chunk-s2t8vg8q.js +26 -0
  354. package/dist/chunk-s3pzvdss.js +50 -0
  355. package/dist/chunk-s56m7vrp.js +66 -0
  356. package/dist/chunk-s5dg9njs.js +826 -0
  357. package/dist/chunk-s7mpvz9v.js +811 -0
  358. package/dist/chunk-sbbj6ta3.js +1711 -0
  359. package/dist/chunk-sd36yzx8.js +954 -0
  360. package/dist/chunk-sdj9b9wh.js +782 -0
  361. package/dist/chunk-sdxgmmma.js +224 -0
  362. package/dist/chunk-sgrc7rmx.js +471 -0
  363. package/dist/chunk-shb6nvk6.js +27 -0
  364. package/dist/chunk-smtr0ngp.js +98 -0
  365. package/dist/chunk-sn55zm52.js +267 -0
  366. package/dist/chunk-ss4r21gw.js +61 -0
  367. package/dist/chunk-sv3cz176.js +400 -0
  368. package/dist/chunk-sy4rdq5h.js +116 -0
  369. package/dist/chunk-szj5wvdy.js +28 -0
  370. package/dist/chunk-t0rgmccj.js +39 -0
  371. package/dist/chunk-t133w5tm.js +298 -0
  372. package/dist/chunk-t3360k46.js +75 -0
  373. package/dist/chunk-tdbpneze.js +346 -0
  374. package/dist/chunk-tjk56vh8.js +81 -0
  375. package/dist/chunk-tm5bn7aw.js +266 -0
  376. package/dist/chunk-ts2p6bv1.js +224 -0
  377. package/dist/chunk-ttk5dzz8.js +25 -0
  378. package/dist/chunk-v1kzp02e.js +785 -0
  379. package/dist/chunk-v2fqnqgx.js +163 -0
  380. package/dist/chunk-v2xpxnmd.js +673 -0
  381. package/dist/chunk-v78fj8by.js +145 -0
  382. package/dist/chunk-v90xv5n9.js +157 -0
  383. package/dist/chunk-v9smspw2.js +4301 -0
  384. package/dist/chunk-vd3bb2zh.js +173 -0
  385. package/dist/chunk-vest0y6x.js +3830 -0
  386. package/dist/chunk-vf5sd1nq.js +12 -0
  387. package/dist/chunk-vhjx5fag.js +56 -0
  388. package/dist/chunk-vjf2rt5s.js +751 -0
  389. package/dist/chunk-vn1e1j7w.js +655 -0
  390. package/dist/chunk-vqk1n5qr.js +63 -0
  391. package/dist/chunk-vqvd3qz0.js +151 -0
  392. package/dist/chunk-vrmgtjyy.js +195 -0
  393. package/dist/chunk-vyjeh50y.js +2149 -0
  394. package/dist/chunk-w100pzs6.js +41 -0
  395. package/dist/chunk-w962tnq8.js +1322 -0
  396. package/dist/chunk-wae2sy8c.js +225 -0
  397. package/dist/chunk-wfprv7va.js +192 -0
  398. package/dist/chunk-wfz0qffj.js +3939 -0
  399. package/dist/chunk-wgcssf6v.js +722 -0
  400. package/dist/chunk-wh43g70w.js +40 -0
  401. package/dist/chunk-whb2mrcf.js +2643 -0
  402. package/dist/chunk-wn2268qd.js +335 -0
  403. package/dist/chunk-wq8v0d1k.js +1391 -0
  404. package/dist/chunk-wrhhmkf7.js +16 -0
  405. package/dist/chunk-wt69n71b.js +779 -0
  406. package/dist/chunk-wz2ekprb.js +130 -0
  407. package/dist/chunk-wzpdet3m.js +843 -0
  408. package/dist/chunk-x21zmsfa.js +104 -0
  409. package/dist/chunk-x2h31hmh.js +642 -0
  410. package/dist/chunk-x2qg3sdd.js +114 -0
  411. package/dist/chunk-x6r4v44b.js +8 -0
  412. package/dist/chunk-x7vg43fv.js +79 -0
  413. package/dist/chunk-x8b7vft8.js +132 -0
  414. package/dist/chunk-xbtacp2f.js +4389 -0
  415. package/dist/chunk-xq4cfvpn.js +213 -0
  416. package/dist/chunk-xqde96jm.js +60 -0
  417. package/dist/chunk-xsq9ae7x.js +90 -0
  418. package/dist/chunk-xsx5x369.js +526 -0
  419. package/dist/chunk-xszk7n10.js +14358 -0
  420. package/dist/chunk-xtv4fh71.js +53 -0
  421. package/dist/chunk-xv3era3s.js +8 -0
  422. package/dist/chunk-xxr0mzqt.js +90 -0
  423. package/dist/chunk-xzcz58pv.js +90 -0
  424. package/dist/chunk-y1784krc.js +19 -0
  425. package/dist/chunk-y9pt2qdf.js +69 -0
  426. package/dist/chunk-ya53e6g3.js +333 -0
  427. package/dist/chunk-ydde1jqg.js +490 -0
  428. package/dist/chunk-yh7amsbv.js +143 -0
  429. package/dist/chunk-yn80rxav.js +458 -0
  430. package/dist/chunk-ysvwcdav.js +9300 -0
  431. package/dist/chunk-ytvzxnx2.js +862 -0
  432. package/dist/chunk-yv9c6hfk.js +286 -0
  433. package/dist/chunk-yvdj4t96.js +88 -0
  434. package/dist/chunk-ywxd4qw4.js +22 -0
  435. package/dist/chunk-yysj6sxt.js +336 -0
  436. package/dist/chunk-z2dp53wn.js +17 -0
  437. package/dist/chunk-z2gj7190.js +5398 -0
  438. package/dist/chunk-z7ns4g0p.js +802 -0
  439. package/dist/chunk-z9b8pnt1.js +654 -0
  440. package/dist/chunk-zc6g0qqe.js +29 -0
  441. package/dist/chunk-zk2wsm7d.js +15 -0
  442. package/dist/chunk-zq4j9zys.js +264 -0
  443. package/dist/chunk-zsfxha74.js +17655 -0
  444. package/dist/chunk-ztmjzgq7.js +524 -0
  445. package/dist/chunk-zv2r5chy.js +91 -0
  446. package/dist/chunk-zx7pgp71.js +20 -0
  447. package/dist/chunk-zxvm58cn.js +102 -0
  448. package/dist/chunk-zydy88cv.js +70 -0
  449. package/dist/cli.js +92 -0
  450. package/package.json +36 -0
@@ -0,0 +1,3418 @@
1
+ // @bun
2
+ import {
3
+ ClaudeMdExternalIncludesDialog,
4
+ init_ClaudeMdExternalIncludesDialog
5
+ } from "./chunk-gg3j3nv0.js";
6
+ import {
7
+ init_bridgeEnabled
8
+ } from "./chunk-ada32h8c.js";
9
+ import {
10
+ ModelPicker,
11
+ init_ModelPicker,
12
+ init_extraUsage,
13
+ isBilledAsExtraUsage
14
+ } from "./chunk-1ydzf04y.js";
15
+ import {
16
+ ThemePicker,
17
+ init_ThemePicker
18
+ } from "./chunk-ydde1jqg.js";
19
+ import {
20
+ OverageCreditUpsell,
21
+ init_OverageCreditUpsell,
22
+ isEligibleForOverageCreditGrant
23
+ } from "./chunk-wfprv7va.js";
24
+ import {
25
+ SearchBox,
26
+ init_SearchBox,
27
+ init_useSearchInput,
28
+ useSearchInput
29
+ } from "./chunk-2ybjg7pc.js";
30
+ import {
31
+ Tab,
32
+ Tabs,
33
+ init_Tabs,
34
+ useTabHeaderFocus
35
+ } from "./chunk-36k7h1v1.js";
36
+ import {
37
+ fetchUtilization,
38
+ init_usage
39
+ } from "./chunk-xqde96jm.js";
40
+ import {
41
+ DEFAULT_OUTPUT_STYLE_NAME,
42
+ OUTPUT_STYLE_CONFIG,
43
+ ProgressBar,
44
+ Select,
45
+ TextInput,
46
+ buildAPIProviderProperties,
47
+ buildAccountProperties,
48
+ buildIDEProperties,
49
+ buildInstallationDiagnostics,
50
+ buildInstallationHealthDiagnostics,
51
+ buildMcpProperties,
52
+ buildMemoryDiagnostics,
53
+ buildSandboxProperties,
54
+ buildSettingSourcesProperties,
55
+ extraUsage,
56
+ formatCost,
57
+ getAllOutputStyles,
58
+ getCurrentSessionTitle,
59
+ getExternalClaudeMdIncludes,
60
+ getHardcodedTeammateModelFallback,
61
+ getMemoryFiles,
62
+ getModelDisplayLabel,
63
+ hasAccessToIDEExtensionDiffFeature,
64
+ hasExternalClaudeMdIncludes,
65
+ init_AppState,
66
+ init_CustomSelect,
67
+ init_ProgressBar,
68
+ init_TextInput,
69
+ init_claudemd,
70
+ init_cost_tracker,
71
+ init_extra_usage,
72
+ init_ide,
73
+ init_outputStyles,
74
+ init_permissionSetup,
75
+ init_select,
76
+ init_sessionStorage,
77
+ init_status,
78
+ init_teammateModel,
79
+ isSupportedTerminal,
80
+ transitionPlanAutoMode,
81
+ useAppState,
82
+ useAppStateStore,
83
+ useSetAppState
84
+ } from "./chunk-1m68rrvt.js";
85
+ import {
86
+ clearCliTeammateModeOverride,
87
+ getCliTeammateModeOverride,
88
+ init_teammateModeSnapshot
89
+ } from "./chunk-nypgx8vs.js";
90
+ import {
91
+ Byline,
92
+ ConfigurableShortcutHint,
93
+ Dialog,
94
+ KeyboardShortcutHint,
95
+ init_Byline,
96
+ init_ConfigurableShortcutHint,
97
+ init_Dialog,
98
+ init_KeyboardShortcutHint
99
+ } from "./chunk-gz457zg6.js";
100
+ import {
101
+ init_useExitOnCtrlCDWithKeybindings,
102
+ useExitOnCtrlCDWithKeybindings
103
+ } from "./chunk-ph936yc1.js";
104
+ import {
105
+ Pane,
106
+ init_Pane,
107
+ init_modalContext,
108
+ init_useKeybinding,
109
+ init_useTerminalSize,
110
+ useIsInsideModal,
111
+ useKeybinding,
112
+ useKeybindings,
113
+ useModalOrTerminalSize,
114
+ useTerminalSize
115
+ } from "./chunk-z7ns4g0p.js";
116
+ import {
117
+ ThemedBox_default,
118
+ ThemedText,
119
+ init_fullscreen,
120
+ init_ink,
121
+ isFullscreenEnvEnabled,
122
+ require_compiler_runtime,
123
+ useTerminalFocus,
124
+ useTheme,
125
+ useThemeSetting
126
+ } from "./chunk-adg4351g.js";
127
+ import {
128
+ require_jsx_dev_runtime,
129
+ require_react
130
+ } from "./chunk-g338npwr.js";
131
+ import {
132
+ EXTERNAL_PERMISSION_MODES,
133
+ FAST_MODE_MODEL_DISPLAY,
134
+ clearFastModeCooldown,
135
+ formatAutoUpdaterDisabledReason,
136
+ getAutoUpdaterDisabledReason,
137
+ getCurrentProjectConfig,
138
+ getFastModeModel,
139
+ getFeatureValue_CACHED_MAY_BE_STALE,
140
+ getGlobalConfig,
141
+ getInitialSettings,
142
+ getSettingsForSource,
143
+ getSubscriptionType,
144
+ init_PermissionMode,
145
+ init_agentSwarmsEnabled,
146
+ init_auth,
147
+ init_authPortable,
148
+ init_config1 as init_config,
149
+ init_fastMode,
150
+ init_growthbook,
151
+ init_model,
152
+ init_settings1 as init_settings,
153
+ init_source,
154
+ isAgentSwarmsEnabled,
155
+ isExternalPermissionMode,
156
+ isFastModeAvailable,
157
+ isFastModeEnabled,
158
+ isFastModeSupportedByModel,
159
+ isOpus1mMergeEnabled,
160
+ modelDisplayString,
161
+ normalizeApiKeyForConfig,
162
+ permissionModeFromString,
163
+ permissionModeTitle,
164
+ saveGlobalConfig,
165
+ source_default,
166
+ toExternalPermissionMode,
167
+ updateSettingsForSource
168
+ } from "./chunk-3zzszjst.js";
169
+ import {
170
+ formatResetText,
171
+ init_format
172
+ } from "./chunk-wgcssf6v.js";
173
+ import {
174
+ init_analytics,
175
+ logEvent
176
+ } from "./chunk-h0rbjg6x.js";
177
+ import {
178
+ figures_default,
179
+ init_figures
180
+ } from "./chunk-gzzfhtdv.js";
181
+ import {
182
+ init_log,
183
+ logError
184
+ } from "./chunk-yysj6sxt.js";
185
+ import {
186
+ getCwd,
187
+ init_cwd
188
+ } from "./chunk-8bedvdm1.js";
189
+ import {
190
+ init_slowOperations,
191
+ jsonStringify
192
+ } from "./chunk-sbbj6ta3.js";
193
+ import {
194
+ init_envUtils,
195
+ isEnvTruthy,
196
+ isRunningOnHomespace
197
+ } from "./chunk-raqgs410.js";
198
+ import {
199
+ getSessionId,
200
+ getUserMsgOptIn,
201
+ init_state,
202
+ setUserMsgOptIn
203
+ } from "./chunk-qqfa0dqg.js";
204
+ import {
205
+ __esm,
206
+ __toESM
207
+ } from "./chunk-qp2qdcda.js";
208
+
209
+ // src/components/Settings/Status.tsx
210
+ function buildPrimarySection() {
211
+ const sessionId = getSessionId();
212
+ const customTitle = getCurrentSessionTitle(sessionId);
213
+ const nameValue = customTitle ?? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
214
+ dimColor: true,
215
+ children: "/rename to add a name"
216
+ }, undefined, false, undefined, this);
217
+ return [{
218
+ label: "Version",
219
+ value: "1.0.3-fork.2a74621"
220
+ }, {
221
+ label: "Session name",
222
+ value: nameValue
223
+ }, {
224
+ label: "Session ID",
225
+ value: sessionId
226
+ }, {
227
+ label: "cwd",
228
+ value: getCwd()
229
+ }, ...buildAccountProperties(), ...buildAPIProviderProperties()];
230
+ }
231
+ function buildSecondarySection({
232
+ mainLoopModel,
233
+ mcp,
234
+ theme,
235
+ context
236
+ }) {
237
+ const modelLabel = getModelDisplayLabel(mainLoopModel);
238
+ return [{
239
+ label: "Model",
240
+ value: modelLabel
241
+ }, ...buildIDEProperties(mcp.clients, context.options.ideInstallationStatus, theme), ...buildMcpProperties(mcp.clients, theme), ...buildSandboxProperties(), ...buildSettingSourcesProperties()];
242
+ }
243
+ async function buildDiagnostics() {
244
+ return [...await buildInstallationDiagnostics(), ...await buildInstallationHealthDiagnostics(), ...await buildMemoryDiagnostics()];
245
+ }
246
+ function PropertyValue(t0) {
247
+ const $ = import_compiler_runtime.c(8);
248
+ const {
249
+ value
250
+ } = t0;
251
+ if (Array.isArray(value)) {
252
+ let t1;
253
+ if ($[0] !== value) {
254
+ let t22;
255
+ if ($[2] !== value.length) {
256
+ t22 = (item, i) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
257
+ children: [
258
+ item,
259
+ i < value.length - 1 ? "," : ""
260
+ ]
261
+ }, i, true, undefined, this);
262
+ $[2] = value.length;
263
+ $[3] = t22;
264
+ } else {
265
+ t22 = $[3];
266
+ }
267
+ t1 = value.map(t22);
268
+ $[0] = value;
269
+ $[1] = t1;
270
+ } else {
271
+ t1 = $[1];
272
+ }
273
+ let t2;
274
+ if ($[4] !== t1) {
275
+ t2 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
276
+ flexWrap: "wrap",
277
+ columnGap: 1,
278
+ flexShrink: 99,
279
+ children: t1
280
+ }, undefined, false, undefined, this);
281
+ $[4] = t1;
282
+ $[5] = t2;
283
+ } else {
284
+ t2 = $[5];
285
+ }
286
+ return t2;
287
+ }
288
+ if (typeof value === "string") {
289
+ let t1;
290
+ if ($[6] !== value) {
291
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
292
+ children: value
293
+ }, undefined, false, undefined, this);
294
+ $[6] = value;
295
+ $[7] = t1;
296
+ } else {
297
+ t1 = $[7];
298
+ }
299
+ return t1;
300
+ }
301
+ return value;
302
+ }
303
+ function Status(t0) {
304
+ const $ = import_compiler_runtime.c(20);
305
+ const {
306
+ context,
307
+ diagnosticsPromise
308
+ } = t0;
309
+ const mainLoopModel = useAppState(_temp);
310
+ const mcp = useAppState(_temp2);
311
+ const [theme] = useTheme();
312
+ let t1;
313
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
314
+ t1 = buildPrimarySection();
315
+ $[0] = t1;
316
+ } else {
317
+ t1 = $[0];
318
+ }
319
+ let t2;
320
+ if ($[1] !== context || $[2] !== mainLoopModel || $[3] !== mcp || $[4] !== theme) {
321
+ t2 = buildSecondarySection({
322
+ mainLoopModel,
323
+ mcp,
324
+ theme,
325
+ context
326
+ });
327
+ $[1] = context;
328
+ $[2] = mainLoopModel;
329
+ $[3] = mcp;
330
+ $[4] = theme;
331
+ $[5] = t2;
332
+ } else {
333
+ t2 = $[5];
334
+ }
335
+ let t3;
336
+ if ($[6] !== t2) {
337
+ t3 = [t1, t2];
338
+ $[6] = t2;
339
+ $[7] = t3;
340
+ } else {
341
+ t3 = $[7];
342
+ }
343
+ const sections = t3;
344
+ const grow = useIsInsideModal() ? 1 : undefined;
345
+ let t4;
346
+ if ($[8] !== sections) {
347
+ t4 = sections.map(_temp4);
348
+ $[8] = sections;
349
+ $[9] = t4;
350
+ } else {
351
+ t4 = $[9];
352
+ }
353
+ let t5;
354
+ if ($[10] !== diagnosticsPromise) {
355
+ t5 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_react.Suspense, {
356
+ fallback: null,
357
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Diagnostics, {
358
+ promise: diagnosticsPromise
359
+ }, undefined, false, undefined, this)
360
+ }, undefined, false, undefined, this);
361
+ $[10] = diagnosticsPromise;
362
+ $[11] = t5;
363
+ } else {
364
+ t5 = $[11];
365
+ }
366
+ let t6;
367
+ if ($[12] !== grow || $[13] !== t4 || $[14] !== t5) {
368
+ t6 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
369
+ flexDirection: "column",
370
+ gap: 1,
371
+ flexGrow: grow,
372
+ children: [
373
+ t4,
374
+ t5
375
+ ]
376
+ }, undefined, true, undefined, this);
377
+ $[12] = grow;
378
+ $[13] = t4;
379
+ $[14] = t5;
380
+ $[15] = t6;
381
+ } else {
382
+ t6 = $[15];
383
+ }
384
+ let t7;
385
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
386
+ t7 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
387
+ dimColor: true,
388
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
389
+ action: "confirm:no",
390
+ context: "Settings",
391
+ fallback: "Esc",
392
+ description: "cancel"
393
+ }, undefined, false, undefined, this)
394
+ }, undefined, false, undefined, this);
395
+ $[16] = t7;
396
+ } else {
397
+ t7 = $[16];
398
+ }
399
+ let t8;
400
+ if ($[17] !== grow || $[18] !== t6) {
401
+ t8 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
402
+ flexDirection: "column",
403
+ flexGrow: grow,
404
+ children: [
405
+ t6,
406
+ t7
407
+ ]
408
+ }, undefined, true, undefined, this);
409
+ $[17] = grow;
410
+ $[18] = t6;
411
+ $[19] = t8;
412
+ } else {
413
+ t8 = $[19];
414
+ }
415
+ return t8;
416
+ }
417
+ function _temp4(properties, i) {
418
+ return properties.length > 0 && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
419
+ flexDirection: "column",
420
+ children: properties.map(_temp3)
421
+ }, i, false, undefined, this);
422
+ }
423
+ function _temp3(t0, j) {
424
+ const {
425
+ label,
426
+ value
427
+ } = t0;
428
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
429
+ flexDirection: "row",
430
+ gap: 1,
431
+ flexShrink: 0,
432
+ children: [
433
+ label !== undefined && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
434
+ bold: true,
435
+ children: [
436
+ label,
437
+ ":"
438
+ ]
439
+ }, undefined, true, undefined, this),
440
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(PropertyValue, {
441
+ value
442
+ }, undefined, false, undefined, this)
443
+ ]
444
+ }, j, true, undefined, this);
445
+ }
446
+ function _temp2(s_0) {
447
+ return s_0.mcp;
448
+ }
449
+ function _temp(s) {
450
+ return s.mainLoopModel;
451
+ }
452
+ function Diagnostics(t0) {
453
+ const $ = import_compiler_runtime.c(5);
454
+ const {
455
+ promise
456
+ } = t0;
457
+ const diagnostics = import_react.use(promise);
458
+ if (diagnostics.length === 0) {
459
+ return null;
460
+ }
461
+ let t1;
462
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
463
+ t1 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
464
+ bold: true,
465
+ children: "System Diagnostics"
466
+ }, undefined, false, undefined, this);
467
+ $[0] = t1;
468
+ } else {
469
+ t1 = $[0];
470
+ }
471
+ let t2;
472
+ if ($[1] !== diagnostics) {
473
+ t2 = diagnostics.map(_temp5);
474
+ $[1] = diagnostics;
475
+ $[2] = t2;
476
+ } else {
477
+ t2 = $[2];
478
+ }
479
+ let t3;
480
+ if ($[3] !== t2) {
481
+ t3 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
482
+ flexDirection: "column",
483
+ paddingBottom: 1,
484
+ children: [
485
+ t1,
486
+ t2
487
+ ]
488
+ }, undefined, true, undefined, this);
489
+ $[3] = t2;
490
+ $[4] = t3;
491
+ } else {
492
+ t3 = $[4];
493
+ }
494
+ return t3;
495
+ }
496
+ function _temp5(diagnostic, i) {
497
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
498
+ flexDirection: "row",
499
+ gap: 1,
500
+ paddingX: 1,
501
+ children: [
502
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
503
+ color: "error",
504
+ children: figures_default.warning
505
+ }, undefined, false, undefined, this),
506
+ typeof diagnostic === "string" ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
507
+ wrap: "wrap",
508
+ children: diagnostic
509
+ }, undefined, false, undefined, this) : diagnostic
510
+ ]
511
+ }, i, true, undefined, this);
512
+ }
513
+ var import_compiler_runtime, import_react, jsx_dev_runtime;
514
+ var init_Status = __esm(() => {
515
+ init_figures();
516
+ init_state();
517
+ init_modalContext();
518
+ init_ink();
519
+ init_AppState();
520
+ init_cwd();
521
+ init_sessionStorage();
522
+ init_status();
523
+ init_ConfigurableShortcutHint();
524
+ import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
525
+ import_react = __toESM(require_react(), 1);
526
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
527
+ });
528
+
529
+ // src/components/ChannelDowngradeDialog.tsx
530
+ function ChannelDowngradeDialog(t0) {
531
+ const $ = import_compiler_runtime2.c(17);
532
+ const {
533
+ currentVersion,
534
+ onChoice
535
+ } = t0;
536
+ let t1;
537
+ if ($[0] !== onChoice) {
538
+ t1 = function handleSelect2(value) {
539
+ onChoice(value);
540
+ };
541
+ $[0] = onChoice;
542
+ $[1] = t1;
543
+ } else {
544
+ t1 = $[1];
545
+ }
546
+ const handleSelect = t1;
547
+ let t2;
548
+ if ($[2] !== onChoice) {
549
+ t2 = function handleCancel2() {
550
+ onChoice("cancel");
551
+ };
552
+ $[2] = onChoice;
553
+ $[3] = t2;
554
+ } else {
555
+ t2 = $[3];
556
+ }
557
+ const handleCancel = t2;
558
+ let t3;
559
+ if ($[4] !== currentVersion) {
560
+ t3 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
561
+ children: [
562
+ "The stable channel may have an older version than what you're currently running (",
563
+ currentVersion,
564
+ ")."
565
+ ]
566
+ }, undefined, true, undefined, this);
567
+ $[4] = currentVersion;
568
+ $[5] = t3;
569
+ } else {
570
+ t3 = $[5];
571
+ }
572
+ let t4;
573
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
574
+ t4 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
575
+ dimColor: true,
576
+ children: "How would you like to handle this?"
577
+ }, undefined, false, undefined, this);
578
+ $[6] = t4;
579
+ } else {
580
+ t4 = $[6];
581
+ }
582
+ let t5;
583
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
584
+ t5 = {
585
+ label: "Allow possible downgrade to stable version",
586
+ value: "downgrade"
587
+ };
588
+ $[7] = t5;
589
+ } else {
590
+ t5 = $[7];
591
+ }
592
+ const t6 = `Stay on current version (${currentVersion}) until stable catches up`;
593
+ let t7;
594
+ if ($[8] !== t6) {
595
+ t7 = [t5, {
596
+ label: t6,
597
+ value: "stay"
598
+ }];
599
+ $[8] = t6;
600
+ $[9] = t7;
601
+ } else {
602
+ t7 = $[9];
603
+ }
604
+ let t8;
605
+ if ($[10] !== handleSelect || $[11] !== t7) {
606
+ t8 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Select, {
607
+ options: t7,
608
+ onChange: handleSelect
609
+ }, undefined, false, undefined, this);
610
+ $[10] = handleSelect;
611
+ $[11] = t7;
612
+ $[12] = t8;
613
+ } else {
614
+ t8 = $[12];
615
+ }
616
+ let t9;
617
+ if ($[13] !== handleCancel || $[14] !== t3 || $[15] !== t8) {
618
+ t9 = /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
619
+ title: "Switch to Stable Channel",
620
+ onCancel: handleCancel,
621
+ color: "permission",
622
+ hideBorder: true,
623
+ hideInputGuide: true,
624
+ children: [
625
+ t3,
626
+ t4,
627
+ t8
628
+ ]
629
+ }, undefined, true, undefined, this);
630
+ $[13] = handleCancel;
631
+ $[14] = t3;
632
+ $[15] = t8;
633
+ $[16] = t9;
634
+ } else {
635
+ t9 = $[16];
636
+ }
637
+ return t9;
638
+ }
639
+ var import_compiler_runtime2, jsx_dev_runtime2;
640
+ var init_ChannelDowngradeDialog = __esm(() => {
641
+ init_ink();
642
+ init_CustomSelect();
643
+ init_Dialog();
644
+ import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
645
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
646
+ });
647
+
648
+ // src/components/OutputStylePicker.tsx
649
+ function mapConfigsToOptions(styles) {
650
+ return Object.entries(styles).map(([style, config]) => ({
651
+ label: config?.name ?? DEFAULT_OUTPUT_STYLE_LABEL,
652
+ value: style,
653
+ description: config?.description ?? DEFAULT_OUTPUT_STYLE_DESCRIPTION
654
+ }));
655
+ }
656
+ function OutputStylePicker(t0) {
657
+ const $ = import_compiler_runtime3.c(16);
658
+ const {
659
+ initialStyle,
660
+ onComplete,
661
+ onCancel,
662
+ isStandaloneCommand
663
+ } = t0;
664
+ let t1;
665
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
666
+ t1 = [];
667
+ $[0] = t1;
668
+ } else {
669
+ t1 = $[0];
670
+ }
671
+ const [styleOptions, setStyleOptions] = import_react2.useState(t1);
672
+ const [isLoading, setIsLoading] = import_react2.useState(true);
673
+ let t2;
674
+ let t3;
675
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
676
+ t2 = () => {
677
+ getAllOutputStyles(getCwd()).then((allStyles) => {
678
+ const options = mapConfigsToOptions(allStyles);
679
+ setStyleOptions(options);
680
+ setIsLoading(false);
681
+ }).catch(() => {
682
+ const builtInOptions = mapConfigsToOptions(OUTPUT_STYLE_CONFIG);
683
+ setStyleOptions(builtInOptions);
684
+ setIsLoading(false);
685
+ });
686
+ };
687
+ t3 = [];
688
+ $[1] = t2;
689
+ $[2] = t3;
690
+ } else {
691
+ t2 = $[1];
692
+ t3 = $[2];
693
+ }
694
+ import_react2.useEffect(t2, t3);
695
+ let t4;
696
+ if ($[3] !== onComplete) {
697
+ t4 = (style) => {
698
+ const outputStyle = style;
699
+ onComplete(outputStyle);
700
+ };
701
+ $[3] = onComplete;
702
+ $[4] = t4;
703
+ } else {
704
+ t4 = $[4];
705
+ }
706
+ const handleStyleSelect = t4;
707
+ const t5 = !isStandaloneCommand;
708
+ const t6 = !isStandaloneCommand;
709
+ let t7;
710
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
711
+ t7 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
712
+ marginTop: 1,
713
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
714
+ dimColor: true,
715
+ children: "This changes how Claude Code communicates with you"
716
+ }, undefined, false, undefined, this)
717
+ }, undefined, false, undefined, this);
718
+ $[5] = t7;
719
+ } else {
720
+ t7 = $[5];
721
+ }
722
+ let t8;
723
+ if ($[6] !== handleStyleSelect || $[7] !== initialStyle || $[8] !== isLoading || $[9] !== styleOptions) {
724
+ t8 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
725
+ flexDirection: "column",
726
+ gap: 1,
727
+ children: [
728
+ t7,
729
+ isLoading ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
730
+ dimColor: true,
731
+ children: "Loading output styles\u2026"
732
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Select, {
733
+ options: styleOptions,
734
+ onChange: handleStyleSelect,
735
+ visibleOptionCount: 10,
736
+ defaultValue: initialStyle
737
+ }, undefined, false, undefined, this)
738
+ ]
739
+ }, undefined, true, undefined, this);
740
+ $[6] = handleStyleSelect;
741
+ $[7] = initialStyle;
742
+ $[8] = isLoading;
743
+ $[9] = styleOptions;
744
+ $[10] = t8;
745
+ } else {
746
+ t8 = $[10];
747
+ }
748
+ let t9;
749
+ if ($[11] !== onCancel || $[12] !== t5 || $[13] !== t6 || $[14] !== t8) {
750
+ t9 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Dialog, {
751
+ title: "Preferred output style",
752
+ onCancel,
753
+ hideInputGuide: t5,
754
+ hideBorder: t6,
755
+ children: t8
756
+ }, undefined, false, undefined, this);
757
+ $[11] = onCancel;
758
+ $[12] = t5;
759
+ $[13] = t6;
760
+ $[14] = t8;
761
+ $[15] = t9;
762
+ } else {
763
+ t9 = $[15];
764
+ }
765
+ return t9;
766
+ }
767
+ var import_compiler_runtime3, import_react2, jsx_dev_runtime3, DEFAULT_OUTPUT_STYLE_LABEL = "Default", DEFAULT_OUTPUT_STYLE_DESCRIPTION = "Claude completes coding tasks efficiently and provides concise responses";
768
+ var init_OutputStylePicker = __esm(() => {
769
+ init_outputStyles();
770
+ init_ink();
771
+ init_cwd();
772
+ init_select();
773
+ init_Dialog();
774
+ import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
775
+ import_react2 = __toESM(require_react(), 1);
776
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
777
+ });
778
+
779
+ // src/components/LanguagePicker.tsx
780
+ function LanguagePicker(t0) {
781
+ const $ = import_compiler_runtime4.c(13);
782
+ const {
783
+ initialLanguage,
784
+ onComplete,
785
+ onCancel
786
+ } = t0;
787
+ const [language, setLanguage] = import_react3.useState(initialLanguage);
788
+ const [cursorOffset, setCursorOffset] = import_react3.useState((initialLanguage ?? "").length);
789
+ let t1;
790
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
791
+ t1 = {
792
+ context: "Settings"
793
+ };
794
+ $[0] = t1;
795
+ } else {
796
+ t1 = $[0];
797
+ }
798
+ useKeybinding("confirm:no", onCancel, t1);
799
+ let t2;
800
+ if ($[1] !== language || $[2] !== onComplete) {
801
+ t2 = function handleSubmit2() {
802
+ const trimmed = language?.trim();
803
+ onComplete(trimmed || undefined);
804
+ };
805
+ $[1] = language;
806
+ $[2] = onComplete;
807
+ $[3] = t2;
808
+ } else {
809
+ t2 = $[3];
810
+ }
811
+ const handleSubmit = t2;
812
+ let t3;
813
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
814
+ t3 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
815
+ children: "Enter your preferred response and voice language:"
816
+ }, undefined, false, undefined, this);
817
+ $[4] = t3;
818
+ } else {
819
+ t3 = $[4];
820
+ }
821
+ let t4;
822
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
823
+ t4 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
824
+ children: figures_default.pointer
825
+ }, undefined, false, undefined, this);
826
+ $[5] = t4;
827
+ } else {
828
+ t4 = $[5];
829
+ }
830
+ const t5 = language ?? "";
831
+ let t6;
832
+ if ($[6] !== cursorOffset || $[7] !== handleSubmit || $[8] !== t5) {
833
+ t6 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
834
+ flexDirection: "row",
835
+ gap: 1,
836
+ children: [
837
+ t4,
838
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextInput, {
839
+ value: t5,
840
+ onChange: setLanguage,
841
+ onSubmit: handleSubmit,
842
+ focus: true,
843
+ showCursor: true,
844
+ placeholder: `e.g., Japanese, \u65E5\u672C\u8A9E, Espa\xF1ol${figures_default.ellipsis}`,
845
+ columns: 60,
846
+ cursorOffset,
847
+ onChangeCursorOffset: setCursorOffset
848
+ }, undefined, false, undefined, this)
849
+ ]
850
+ }, undefined, true, undefined, this);
851
+ $[6] = cursorOffset;
852
+ $[7] = handleSubmit;
853
+ $[8] = t5;
854
+ $[9] = t6;
855
+ } else {
856
+ t6 = $[9];
857
+ }
858
+ let t7;
859
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
860
+ t7 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
861
+ dimColor: true,
862
+ children: "Leave empty for default (English)"
863
+ }, undefined, false, undefined, this);
864
+ $[10] = t7;
865
+ } else {
866
+ t7 = $[10];
867
+ }
868
+ let t8;
869
+ if ($[11] !== t6) {
870
+ t8 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
871
+ flexDirection: "column",
872
+ gap: 1,
873
+ children: [
874
+ t3,
875
+ t6,
876
+ t7
877
+ ]
878
+ }, undefined, true, undefined, this);
879
+ $[11] = t6;
880
+ $[12] = t8;
881
+ } else {
882
+ t8 = $[12];
883
+ }
884
+ return t8;
885
+ }
886
+ var import_compiler_runtime4, import_react3, jsx_dev_runtime4;
887
+ var init_LanguagePicker = __esm(() => {
888
+ init_figures();
889
+ init_ink();
890
+ init_useKeybinding();
891
+ init_TextInput();
892
+ import_compiler_runtime4 = __toESM(require_compiler_runtime(), 1);
893
+ import_react3 = __toESM(require_react(), 1);
894
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
895
+ });
896
+
897
+ // src/components/Settings/Config.tsx
898
+ function Config({
899
+ onClose,
900
+ context,
901
+ setTabsHidden,
902
+ onIsSearchModeChange,
903
+ contentHeight
904
+ }) {
905
+ const { headerFocused, focusHeader } = useTabHeaderFocus();
906
+ const insideModal = useIsInsideModal();
907
+ const [, setTheme] = useTheme();
908
+ const themeSetting = useThemeSetting();
909
+ const [globalConfig, setGlobalConfig] = import_react4.useState(getGlobalConfig());
910
+ const initialConfig = React2.useRef(getGlobalConfig());
911
+ const [settingsData, setSettingsData] = import_react4.useState(getInitialSettings());
912
+ const initialSettingsData = React2.useRef(getInitialSettings());
913
+ const [currentOutputStyle, setCurrentOutputStyle] = import_react4.useState(settingsData?.outputStyle || DEFAULT_OUTPUT_STYLE_NAME);
914
+ const initialOutputStyle = React2.useRef(currentOutputStyle);
915
+ const [currentLanguage, setCurrentLanguage] = import_react4.useState(settingsData?.language);
916
+ const initialLanguage = React2.useRef(currentLanguage);
917
+ const [selectedIndex, setSelectedIndex] = import_react4.useState(0);
918
+ const [scrollOffset, setScrollOffset] = import_react4.useState(0);
919
+ const [isSearchMode, setIsSearchMode] = import_react4.useState(true);
920
+ const isTerminalFocused = useTerminalFocus();
921
+ const { rows } = useTerminalSize();
922
+ const paneCap = contentHeight ?? Math.min(Math.floor(rows * 0.8), 30);
923
+ const maxVisible = Math.max(5, paneCap - 10);
924
+ const mainLoopModel = useAppState((s) => s.mainLoopModel);
925
+ const verbose = useAppState((s_0) => s_0.verbose);
926
+ const thinkingEnabled = useAppState((s_1) => s_1.thinkingEnabled);
927
+ const isFastMode = useAppState((s_2) => isFastModeEnabled() ? s_2.fastMode : false);
928
+ const promptSuggestionEnabled = useAppState((s_3) => s_3.promptSuggestionEnabled);
929
+ const showAutoInDefaultModePicker = false;
930
+ const showDefaultViewPicker = false;
931
+ const setAppState = useSetAppState();
932
+ const [changes, setChanges] = import_react4.useState({});
933
+ const initialThinkingEnabled = React2.useRef(thinkingEnabled);
934
+ const [initialLocalSettings] = import_react4.useState(() => getSettingsForSource("localSettings"));
935
+ const [initialUserSettings] = import_react4.useState(() => getSettingsForSource("userSettings"));
936
+ const initialThemeSetting = React2.useRef(themeSetting);
937
+ const store = useAppStateStore();
938
+ const [initialAppState] = import_react4.useState(() => {
939
+ const s_4 = store.getState();
940
+ return {
941
+ mainLoopModel: s_4.mainLoopModel,
942
+ mainLoopModelForSession: s_4.mainLoopModelForSession,
943
+ verbose: s_4.verbose,
944
+ thinkingEnabled: s_4.thinkingEnabled,
945
+ fastMode: s_4.fastMode,
946
+ promptSuggestionEnabled: s_4.promptSuggestionEnabled,
947
+ isBriefOnly: s_4.isBriefOnly,
948
+ replBridgeEnabled: s_4.replBridgeEnabled,
949
+ replBridgeOutboundOnly: s_4.replBridgeOutboundOnly,
950
+ settings: s_4.settings
951
+ };
952
+ });
953
+ const [initialUserMsgOptIn] = import_react4.useState(() => getUserMsgOptIn());
954
+ const isDirty = React2.useRef(false);
955
+ const [showThinkingWarning, setShowThinkingWarning] = import_react4.useState(false);
956
+ const [showSubmenu, setShowSubmenu] = import_react4.useState(null);
957
+ const {
958
+ query: searchQuery,
959
+ setQuery: setSearchQuery,
960
+ cursorOffset: searchCursorOffset
961
+ } = useSearchInput({
962
+ isActive: isSearchMode && showSubmenu === null && !headerFocused,
963
+ onExit: () => setIsSearchMode(false),
964
+ onExitUp: focusHeader,
965
+ passthroughCtrlKeys: ["c", "d"]
966
+ });
967
+ const ownsEsc = isSearchMode && !headerFocused;
968
+ React2.useEffect(() => {
969
+ onIsSearchModeChange?.(ownsEsc);
970
+ }, [ownsEsc, onIsSearchModeChange]);
971
+ const isConnectedToIde = hasAccessToIDEExtensionDiffFeature(context.options.mcpClients);
972
+ const isFileCheckpointingAvailable = !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING);
973
+ const memoryFiles = React2.use(getMemoryFiles(true));
974
+ const shouldShowExternalIncludesToggle = hasExternalClaudeMdIncludes(memoryFiles);
975
+ const autoUpdaterDisabledReason = getAutoUpdaterDisabledReason();
976
+ function onChangeMainModelConfig(value) {
977
+ const previousModel = mainLoopModel;
978
+ logEvent("tengu_config_model_changed", {
979
+ from_model: previousModel,
980
+ to_model: value
981
+ });
982
+ setAppState((prev) => ({
983
+ ...prev,
984
+ mainLoopModel: value,
985
+ mainLoopModelForSession: null
986
+ }));
987
+ setChanges((prev_0) => {
988
+ const valStr = modelDisplayString(value) + (isBilledAsExtraUsage(value, false, isOpus1mMergeEnabled()) ? " \xB7 Billed as extra usage" : "");
989
+ if ("model" in prev_0) {
990
+ const { model, ...rest } = prev_0;
991
+ return {
992
+ ...rest,
993
+ model: valStr
994
+ };
995
+ }
996
+ return {
997
+ ...prev_0,
998
+ model: valStr
999
+ };
1000
+ });
1001
+ }
1002
+ function onChangeVerbose(value_0) {
1003
+ saveGlobalConfig((current) => ({
1004
+ ...current,
1005
+ verbose: value_0
1006
+ }));
1007
+ setGlobalConfig({
1008
+ ...getGlobalConfig(),
1009
+ verbose: value_0
1010
+ });
1011
+ setAppState((prev_1) => ({
1012
+ ...prev_1,
1013
+ verbose: value_0
1014
+ }));
1015
+ setChanges((prev_2) => {
1016
+ if ("verbose" in prev_2) {
1017
+ const { verbose: verbose_0, ...rest_0 } = prev_2;
1018
+ return rest_0;
1019
+ }
1020
+ return {
1021
+ ...prev_2,
1022
+ verbose: value_0
1023
+ };
1024
+ });
1025
+ }
1026
+ const settingsItems = [
1027
+ {
1028
+ id: "autoCompactEnabled",
1029
+ label: "Auto-compact",
1030
+ value: globalConfig.autoCompactEnabled,
1031
+ type: "boolean",
1032
+ onChange(autoCompactEnabled) {
1033
+ saveGlobalConfig((current_0) => ({
1034
+ ...current_0,
1035
+ autoCompactEnabled
1036
+ }));
1037
+ setGlobalConfig({
1038
+ ...getGlobalConfig(),
1039
+ autoCompactEnabled
1040
+ });
1041
+ logEvent("tengu_auto_compact_setting_changed", {
1042
+ enabled: autoCompactEnabled
1043
+ });
1044
+ }
1045
+ },
1046
+ {
1047
+ id: "spinnerTipsEnabled",
1048
+ label: "Show tips",
1049
+ value: settingsData?.spinnerTipsEnabled ?? true,
1050
+ type: "boolean",
1051
+ onChange(spinnerTipsEnabled) {
1052
+ updateSettingsForSource("localSettings", {
1053
+ spinnerTipsEnabled
1054
+ });
1055
+ setSettingsData((prev_3) => ({
1056
+ ...prev_3,
1057
+ spinnerTipsEnabled
1058
+ }));
1059
+ logEvent("tengu_tips_setting_changed", {
1060
+ enabled: spinnerTipsEnabled
1061
+ });
1062
+ }
1063
+ },
1064
+ {
1065
+ id: "prefersReducedMotion",
1066
+ label: "Reduce motion",
1067
+ value: settingsData?.prefersReducedMotion ?? false,
1068
+ type: "boolean",
1069
+ onChange(prefersReducedMotion) {
1070
+ updateSettingsForSource("localSettings", {
1071
+ prefersReducedMotion
1072
+ });
1073
+ setSettingsData((prev_4) => ({
1074
+ ...prev_4,
1075
+ prefersReducedMotion
1076
+ }));
1077
+ setAppState((prev_5) => ({
1078
+ ...prev_5,
1079
+ settings: {
1080
+ ...prev_5.settings,
1081
+ prefersReducedMotion
1082
+ }
1083
+ }));
1084
+ logEvent("tengu_reduce_motion_setting_changed", {
1085
+ enabled: prefersReducedMotion
1086
+ });
1087
+ }
1088
+ },
1089
+ {
1090
+ id: "thinkingEnabled",
1091
+ label: "Thinking mode",
1092
+ value: thinkingEnabled ?? true,
1093
+ type: "boolean",
1094
+ onChange(enabled) {
1095
+ setAppState((prev_6) => ({
1096
+ ...prev_6,
1097
+ thinkingEnabled: enabled
1098
+ }));
1099
+ updateSettingsForSource("userSettings", {
1100
+ alwaysThinkingEnabled: enabled ? undefined : false
1101
+ });
1102
+ logEvent("tengu_thinking_toggled", {
1103
+ enabled
1104
+ });
1105
+ }
1106
+ },
1107
+ ...isFastModeEnabled() && isFastModeAvailable() ? [
1108
+ {
1109
+ id: "fastMode",
1110
+ label: `Fast mode (${FAST_MODE_MODEL_DISPLAY} only)`,
1111
+ value: !!isFastMode,
1112
+ type: "boolean",
1113
+ onChange(enabled_0) {
1114
+ clearFastModeCooldown();
1115
+ updateSettingsForSource("userSettings", {
1116
+ fastMode: enabled_0 ? true : undefined
1117
+ });
1118
+ if (enabled_0) {
1119
+ setAppState((prev_7) => ({
1120
+ ...prev_7,
1121
+ mainLoopModel: getFastModeModel(),
1122
+ mainLoopModelForSession: null,
1123
+ fastMode: true
1124
+ }));
1125
+ setChanges((prev_8) => ({
1126
+ ...prev_8,
1127
+ model: getFastModeModel(),
1128
+ "Fast mode": "ON"
1129
+ }));
1130
+ } else {
1131
+ setAppState((prev_9) => ({
1132
+ ...prev_9,
1133
+ fastMode: false
1134
+ }));
1135
+ setChanges((prev_10) => ({
1136
+ ...prev_10,
1137
+ "Fast mode": "OFF"
1138
+ }));
1139
+ }
1140
+ }
1141
+ }
1142
+ ] : [],
1143
+ ...getFeatureValue_CACHED_MAY_BE_STALE("tengu_chomp_inflection", false) ? [
1144
+ {
1145
+ id: "promptSuggestionEnabled",
1146
+ label: "Prompt suggestions",
1147
+ value: promptSuggestionEnabled,
1148
+ type: "boolean",
1149
+ onChange(enabled_1) {
1150
+ setAppState((prev_11) => ({
1151
+ ...prev_11,
1152
+ promptSuggestionEnabled: enabled_1
1153
+ }));
1154
+ updateSettingsForSource("userSettings", {
1155
+ promptSuggestionEnabled: enabled_1 ? undefined : false
1156
+ });
1157
+ }
1158
+ }
1159
+ ] : [],
1160
+ ...process.env.USER_TYPE === "ant" ? [
1161
+ {
1162
+ id: "speculationEnabled",
1163
+ label: "Speculative execution",
1164
+ value: globalConfig.speculationEnabled ?? true,
1165
+ type: "boolean",
1166
+ onChange(enabled_2) {
1167
+ saveGlobalConfig((current_1) => {
1168
+ if (current_1.speculationEnabled === enabled_2)
1169
+ return current_1;
1170
+ return {
1171
+ ...current_1,
1172
+ speculationEnabled: enabled_2
1173
+ };
1174
+ });
1175
+ setGlobalConfig({
1176
+ ...getGlobalConfig(),
1177
+ speculationEnabled: enabled_2
1178
+ });
1179
+ logEvent("tengu_speculation_setting_changed", {
1180
+ enabled: enabled_2
1181
+ });
1182
+ }
1183
+ }
1184
+ ] : [],
1185
+ ...isFileCheckpointingAvailable ? [
1186
+ {
1187
+ id: "fileCheckpointingEnabled",
1188
+ label: "Rewind code (checkpoints)",
1189
+ value: globalConfig.fileCheckpointingEnabled,
1190
+ type: "boolean",
1191
+ onChange(enabled_3) {
1192
+ saveGlobalConfig((current_2) => ({
1193
+ ...current_2,
1194
+ fileCheckpointingEnabled: enabled_3
1195
+ }));
1196
+ setGlobalConfig({
1197
+ ...getGlobalConfig(),
1198
+ fileCheckpointingEnabled: enabled_3
1199
+ });
1200
+ logEvent("tengu_file_history_snapshots_setting_changed", {
1201
+ enabled: enabled_3
1202
+ });
1203
+ }
1204
+ }
1205
+ ] : [],
1206
+ {
1207
+ id: "verbose",
1208
+ label: "Verbose output",
1209
+ value: verbose,
1210
+ type: "boolean",
1211
+ onChange: onChangeVerbose
1212
+ },
1213
+ {
1214
+ id: "terminalProgressBarEnabled",
1215
+ label: "Terminal progress bar",
1216
+ value: globalConfig.terminalProgressBarEnabled,
1217
+ type: "boolean",
1218
+ onChange(terminalProgressBarEnabled) {
1219
+ saveGlobalConfig((current_3) => ({
1220
+ ...current_3,
1221
+ terminalProgressBarEnabled
1222
+ }));
1223
+ setGlobalConfig({
1224
+ ...getGlobalConfig(),
1225
+ terminalProgressBarEnabled
1226
+ });
1227
+ logEvent("tengu_terminal_progress_bar_setting_changed", {
1228
+ enabled: terminalProgressBarEnabled
1229
+ });
1230
+ }
1231
+ },
1232
+ ...getFeatureValue_CACHED_MAY_BE_STALE("tengu_terminal_sidebar", false) ? [
1233
+ {
1234
+ id: "showStatusInTerminalTab",
1235
+ label: "Show status in terminal tab",
1236
+ value: globalConfig.showStatusInTerminalTab ?? false,
1237
+ type: "boolean",
1238
+ onChange(showStatusInTerminalTab) {
1239
+ saveGlobalConfig((current_4) => ({
1240
+ ...current_4,
1241
+ showStatusInTerminalTab
1242
+ }));
1243
+ setGlobalConfig({
1244
+ ...getGlobalConfig(),
1245
+ showStatusInTerminalTab
1246
+ });
1247
+ logEvent("tengu_terminal_tab_status_setting_changed", {
1248
+ enabled: showStatusInTerminalTab
1249
+ });
1250
+ }
1251
+ }
1252
+ ] : [],
1253
+ {
1254
+ id: "showTurnDuration",
1255
+ label: "Show turn duration",
1256
+ value: globalConfig.showTurnDuration,
1257
+ type: "boolean",
1258
+ onChange(showTurnDuration) {
1259
+ saveGlobalConfig((current_5) => ({
1260
+ ...current_5,
1261
+ showTurnDuration
1262
+ }));
1263
+ setGlobalConfig({
1264
+ ...getGlobalConfig(),
1265
+ showTurnDuration
1266
+ });
1267
+ logEvent("tengu_show_turn_duration_setting_changed", {
1268
+ enabled: showTurnDuration
1269
+ });
1270
+ }
1271
+ },
1272
+ {
1273
+ id: "defaultPermissionMode",
1274
+ label: "Default permission mode",
1275
+ value: settingsData?.permissions?.defaultMode || "default",
1276
+ options: (() => {
1277
+ const priorityOrder = ["default", "plan"];
1278
+ const allModes = EXTERNAL_PERMISSION_MODES;
1279
+ const excluded = ["bypassPermissions"];
1280
+ if (false) {}
1281
+ return [...priorityOrder, ...allModes.filter((m) => !priorityOrder.includes(m) && !excluded.includes(m))];
1282
+ })(),
1283
+ type: "enum",
1284
+ onChange(mode) {
1285
+ const parsedMode = permissionModeFromString(mode);
1286
+ const validatedMode = isExternalPermissionMode(parsedMode) ? toExternalPermissionMode(parsedMode) : parsedMode;
1287
+ const result = updateSettingsForSource("userSettings", {
1288
+ permissions: {
1289
+ ...settingsData?.permissions,
1290
+ defaultMode: validatedMode
1291
+ }
1292
+ });
1293
+ if (result.error) {
1294
+ logError(result.error);
1295
+ return;
1296
+ }
1297
+ setSettingsData((prev_12) => ({
1298
+ ...prev_12,
1299
+ permissions: {
1300
+ ...prev_12?.permissions,
1301
+ defaultMode: validatedMode
1302
+ }
1303
+ }));
1304
+ setChanges((prev_13) => ({
1305
+ ...prev_13,
1306
+ defaultPermissionMode: mode
1307
+ }));
1308
+ logEvent("tengu_config_changed", {
1309
+ setting: "defaultPermissionMode",
1310
+ value: mode
1311
+ });
1312
+ }
1313
+ },
1314
+ ...[],
1315
+ {
1316
+ id: "respectGitignore",
1317
+ label: "Respect .gitignore in file picker",
1318
+ value: globalConfig.respectGitignore,
1319
+ type: "boolean",
1320
+ onChange(respectGitignore) {
1321
+ saveGlobalConfig((current_6) => ({
1322
+ ...current_6,
1323
+ respectGitignore
1324
+ }));
1325
+ setGlobalConfig({
1326
+ ...getGlobalConfig(),
1327
+ respectGitignore
1328
+ });
1329
+ logEvent("tengu_respect_gitignore_setting_changed", {
1330
+ enabled: respectGitignore
1331
+ });
1332
+ }
1333
+ },
1334
+ {
1335
+ id: "copyFullResponse",
1336
+ label: "Always copy full response (skip /copy picker)",
1337
+ value: globalConfig.copyFullResponse,
1338
+ type: "boolean",
1339
+ onChange(copyFullResponse) {
1340
+ saveGlobalConfig((current_7) => ({
1341
+ ...current_7,
1342
+ copyFullResponse
1343
+ }));
1344
+ setGlobalConfig({
1345
+ ...getGlobalConfig(),
1346
+ copyFullResponse
1347
+ });
1348
+ logEvent("tengu_config_changed", {
1349
+ setting: "copyFullResponse",
1350
+ value: String(copyFullResponse)
1351
+ });
1352
+ }
1353
+ },
1354
+ ...isFullscreenEnvEnabled() ? [
1355
+ {
1356
+ id: "copyOnSelect",
1357
+ label: "Copy on select",
1358
+ value: globalConfig.copyOnSelect ?? true,
1359
+ type: "boolean",
1360
+ onChange(copyOnSelect) {
1361
+ saveGlobalConfig((current_8) => ({
1362
+ ...current_8,
1363
+ copyOnSelect
1364
+ }));
1365
+ setGlobalConfig({
1366
+ ...getGlobalConfig(),
1367
+ copyOnSelect
1368
+ });
1369
+ logEvent("tengu_config_changed", {
1370
+ setting: "copyOnSelect",
1371
+ value: String(copyOnSelect)
1372
+ });
1373
+ }
1374
+ }
1375
+ ] : [],
1376
+ autoUpdaterDisabledReason ? {
1377
+ id: "autoUpdatesChannel",
1378
+ label: "Auto-update channel",
1379
+ value: "disabled",
1380
+ type: "managedEnum",
1381
+ onChange() {}
1382
+ } : {
1383
+ id: "autoUpdatesChannel",
1384
+ label: "Auto-update channel",
1385
+ value: settingsData?.autoUpdatesChannel ?? "latest",
1386
+ type: "managedEnum",
1387
+ onChange() {}
1388
+ },
1389
+ {
1390
+ id: "theme",
1391
+ label: "Theme",
1392
+ value: themeSetting,
1393
+ type: "managedEnum",
1394
+ onChange: setTheme
1395
+ },
1396
+ {
1397
+ id: "notifChannel",
1398
+ label: "Notifications",
1399
+ value: globalConfig.preferredNotifChannel,
1400
+ options: ["auto", "iterm2", "terminal_bell", "iterm2_with_bell", "kitty", "ghostty", "notifications_disabled"],
1401
+ type: "enum",
1402
+ onChange(notifChannel) {
1403
+ saveGlobalConfig((current_9) => ({
1404
+ ...current_9,
1405
+ preferredNotifChannel: notifChannel
1406
+ }));
1407
+ setGlobalConfig({
1408
+ ...getGlobalConfig(),
1409
+ preferredNotifChannel: notifChannel
1410
+ });
1411
+ }
1412
+ },
1413
+ ...[],
1414
+ {
1415
+ id: "outputStyle",
1416
+ label: "Output style",
1417
+ value: currentOutputStyle,
1418
+ type: "managedEnum",
1419
+ onChange: () => {}
1420
+ },
1421
+ ...showDefaultViewPicker ? [
1422
+ {
1423
+ id: "defaultView",
1424
+ label: "What you see by default",
1425
+ value: settingsData?.defaultView === undefined ? "default" : String(settingsData.defaultView),
1426
+ options: ["transcript", "chat", "default"],
1427
+ type: "enum",
1428
+ onChange(selected) {
1429
+ const defaultView = selected === "default" ? undefined : selected;
1430
+ updateSettingsForSource("localSettings", {
1431
+ defaultView
1432
+ });
1433
+ setSettingsData((prev_17) => ({
1434
+ ...prev_17,
1435
+ defaultView
1436
+ }));
1437
+ const nextBrief = defaultView === "chat";
1438
+ setAppState((prev_18) => {
1439
+ if (prev_18.isBriefOnly === nextBrief)
1440
+ return prev_18;
1441
+ return {
1442
+ ...prev_18,
1443
+ isBriefOnly: nextBrief
1444
+ };
1445
+ });
1446
+ setUserMsgOptIn(nextBrief);
1447
+ setChanges((prev_19) => ({
1448
+ ...prev_19,
1449
+ "Default view": selected
1450
+ }));
1451
+ logEvent("tengu_default_view_setting_changed", {
1452
+ value: defaultView ?? "unset"
1453
+ });
1454
+ }
1455
+ }
1456
+ ] : [],
1457
+ {
1458
+ id: "language",
1459
+ label: "Language",
1460
+ value: currentLanguage ?? "Default (English)",
1461
+ type: "managedEnum",
1462
+ onChange: () => {}
1463
+ },
1464
+ {
1465
+ id: "editorMode",
1466
+ label: "Editor mode",
1467
+ value: globalConfig.editorMode === "emacs" ? "normal" : globalConfig.editorMode || "normal",
1468
+ options: ["normal", "vim"],
1469
+ type: "enum",
1470
+ onChange(value_1) {
1471
+ saveGlobalConfig((current_13) => ({
1472
+ ...current_13,
1473
+ editorMode: value_1
1474
+ }));
1475
+ setGlobalConfig({
1476
+ ...getGlobalConfig(),
1477
+ editorMode: value_1
1478
+ });
1479
+ logEvent("tengu_editor_mode_changed", {
1480
+ mode: value_1,
1481
+ source: "config_panel"
1482
+ });
1483
+ }
1484
+ },
1485
+ {
1486
+ id: "prStatusFooterEnabled",
1487
+ label: "Show PR status footer",
1488
+ value: globalConfig.prStatusFooterEnabled ?? true,
1489
+ type: "boolean",
1490
+ onChange(enabled_4) {
1491
+ saveGlobalConfig((current_14) => {
1492
+ if (current_14.prStatusFooterEnabled === enabled_4)
1493
+ return current_14;
1494
+ return {
1495
+ ...current_14,
1496
+ prStatusFooterEnabled: enabled_4
1497
+ };
1498
+ });
1499
+ setGlobalConfig({
1500
+ ...getGlobalConfig(),
1501
+ prStatusFooterEnabled: enabled_4
1502
+ });
1503
+ logEvent("tengu_pr_status_footer_setting_changed", {
1504
+ enabled: enabled_4
1505
+ });
1506
+ }
1507
+ },
1508
+ {
1509
+ id: "model",
1510
+ label: "Model",
1511
+ value: mainLoopModel === null ? "Default (recommended)" : mainLoopModel,
1512
+ type: "managedEnum",
1513
+ onChange: onChangeMainModelConfig
1514
+ },
1515
+ ...isConnectedToIde ? [
1516
+ {
1517
+ id: "diffTool",
1518
+ label: "Diff tool",
1519
+ value: globalConfig.diffTool ?? "auto",
1520
+ options: ["terminal", "auto"],
1521
+ type: "enum",
1522
+ onChange(diffTool) {
1523
+ saveGlobalConfig((current_15) => ({
1524
+ ...current_15,
1525
+ diffTool
1526
+ }));
1527
+ setGlobalConfig({
1528
+ ...getGlobalConfig(),
1529
+ diffTool
1530
+ });
1531
+ logEvent("tengu_diff_tool_changed", {
1532
+ tool: diffTool,
1533
+ source: "config_panel"
1534
+ });
1535
+ }
1536
+ }
1537
+ ] : [],
1538
+ ...!isSupportedTerminal() ? [
1539
+ {
1540
+ id: "autoConnectIde",
1541
+ label: "Auto-connect to IDE (external terminal)",
1542
+ value: globalConfig.autoConnectIde ?? false,
1543
+ type: "boolean",
1544
+ onChange(autoConnectIde) {
1545
+ saveGlobalConfig((current_16) => ({
1546
+ ...current_16,
1547
+ autoConnectIde
1548
+ }));
1549
+ setGlobalConfig({
1550
+ ...getGlobalConfig(),
1551
+ autoConnectIde
1552
+ });
1553
+ logEvent("tengu_auto_connect_ide_changed", {
1554
+ enabled: autoConnectIde,
1555
+ source: "config_panel"
1556
+ });
1557
+ }
1558
+ }
1559
+ ] : [],
1560
+ ...isSupportedTerminal() ? [
1561
+ {
1562
+ id: "autoInstallIdeExtension",
1563
+ label: "Auto-install IDE extension",
1564
+ value: globalConfig.autoInstallIdeExtension ?? true,
1565
+ type: "boolean",
1566
+ onChange(autoInstallIdeExtension) {
1567
+ saveGlobalConfig((current_17) => ({
1568
+ ...current_17,
1569
+ autoInstallIdeExtension
1570
+ }));
1571
+ setGlobalConfig({
1572
+ ...getGlobalConfig(),
1573
+ autoInstallIdeExtension
1574
+ });
1575
+ logEvent("tengu_auto_install_ide_extension_changed", {
1576
+ enabled: autoInstallIdeExtension,
1577
+ source: "config_panel"
1578
+ });
1579
+ }
1580
+ }
1581
+ ] : [],
1582
+ {
1583
+ id: "claudeInChromeDefaultEnabled",
1584
+ label: "Claude in Chrome enabled by default",
1585
+ value: globalConfig.claudeInChromeDefaultEnabled ?? true,
1586
+ type: "boolean",
1587
+ onChange(enabled_5) {
1588
+ saveGlobalConfig((current_18) => ({
1589
+ ...current_18,
1590
+ claudeInChromeDefaultEnabled: enabled_5
1591
+ }));
1592
+ setGlobalConfig({
1593
+ ...getGlobalConfig(),
1594
+ claudeInChromeDefaultEnabled: enabled_5
1595
+ });
1596
+ logEvent("tengu_claude_in_chrome_setting_changed", {
1597
+ enabled: enabled_5
1598
+ });
1599
+ }
1600
+ },
1601
+ ...isAgentSwarmsEnabled() ? (() => {
1602
+ const cliOverride = getCliTeammateModeOverride();
1603
+ const label = cliOverride ? `Teammate mode [overridden: ${cliOverride}]` : "Teammate mode";
1604
+ return [
1605
+ {
1606
+ id: "teammateMode",
1607
+ label,
1608
+ value: globalConfig.teammateMode ?? "auto",
1609
+ options: ["auto", "tmux", "in-process"],
1610
+ type: "enum",
1611
+ onChange(mode_0) {
1612
+ if (mode_0 !== "auto" && mode_0 !== "tmux" && mode_0 !== "in-process") {
1613
+ return;
1614
+ }
1615
+ clearCliTeammateModeOverride(mode_0);
1616
+ saveGlobalConfig((current_19) => ({
1617
+ ...current_19,
1618
+ teammateMode: mode_0
1619
+ }));
1620
+ setGlobalConfig({
1621
+ ...getGlobalConfig(),
1622
+ teammateMode: mode_0
1623
+ });
1624
+ logEvent("tengu_teammate_mode_changed", {
1625
+ mode: mode_0
1626
+ });
1627
+ }
1628
+ },
1629
+ {
1630
+ id: "teammateDefaultModel",
1631
+ label: "Default teammate model",
1632
+ value: teammateModelDisplayString(globalConfig.teammateDefaultModel),
1633
+ type: "managedEnum",
1634
+ onChange() {}
1635
+ }
1636
+ ];
1637
+ })() : [],
1638
+ ...[],
1639
+ ...shouldShowExternalIncludesToggle ? [
1640
+ {
1641
+ id: "showExternalIncludesDialog",
1642
+ label: "External CLAUDE.md includes",
1643
+ value: (() => {
1644
+ const projectConfig = getCurrentProjectConfig();
1645
+ if (projectConfig.hasClaudeMdExternalIncludesApproved) {
1646
+ return "true";
1647
+ } else {
1648
+ return "false";
1649
+ }
1650
+ })(),
1651
+ type: "managedEnum",
1652
+ onChange() {}
1653
+ }
1654
+ ] : [],
1655
+ ...process.env.ANTHROPIC_API_KEY && !isRunningOnHomespace() ? [
1656
+ {
1657
+ id: "apiKey",
1658
+ label: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1659
+ children: [
1660
+ "Use custom API key: ",
1661
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1662
+ bold: true,
1663
+ children: normalizeApiKeyForConfig(process.env.ANTHROPIC_API_KEY)
1664
+ }, undefined, false, undefined, this)
1665
+ ]
1666
+ }, undefined, true, undefined, this),
1667
+ searchText: "Use custom API key",
1668
+ value: Boolean(process.env.ANTHROPIC_API_KEY && globalConfig.customApiKeyResponses?.approved?.includes(normalizeApiKeyForConfig(process.env.ANTHROPIC_API_KEY))),
1669
+ type: "boolean",
1670
+ onChange(useCustomKey) {
1671
+ saveGlobalConfig((current_22) => {
1672
+ const updated = {
1673
+ ...current_22
1674
+ };
1675
+ if (!updated.customApiKeyResponses) {
1676
+ updated.customApiKeyResponses = {
1677
+ approved: [],
1678
+ rejected: []
1679
+ };
1680
+ }
1681
+ if (!updated.customApiKeyResponses.approved) {
1682
+ updated.customApiKeyResponses = {
1683
+ ...updated.customApiKeyResponses,
1684
+ approved: []
1685
+ };
1686
+ }
1687
+ if (!updated.customApiKeyResponses.rejected) {
1688
+ updated.customApiKeyResponses = {
1689
+ ...updated.customApiKeyResponses,
1690
+ rejected: []
1691
+ };
1692
+ }
1693
+ if (process.env.ANTHROPIC_API_KEY) {
1694
+ const truncatedKey = normalizeApiKeyForConfig(process.env.ANTHROPIC_API_KEY);
1695
+ if (useCustomKey) {
1696
+ updated.customApiKeyResponses = {
1697
+ ...updated.customApiKeyResponses,
1698
+ approved: [
1699
+ ...(updated.customApiKeyResponses.approved ?? []).filter((k) => k !== truncatedKey),
1700
+ truncatedKey
1701
+ ],
1702
+ rejected: (updated.customApiKeyResponses.rejected ?? []).filter((k_0) => k_0 !== truncatedKey)
1703
+ };
1704
+ } else {
1705
+ updated.customApiKeyResponses = {
1706
+ ...updated.customApiKeyResponses,
1707
+ approved: (updated.customApiKeyResponses.approved ?? []).filter((k_1) => k_1 !== truncatedKey),
1708
+ rejected: [
1709
+ ...(updated.customApiKeyResponses.rejected ?? []).filter((k_2) => k_2 !== truncatedKey),
1710
+ truncatedKey
1711
+ ]
1712
+ };
1713
+ }
1714
+ }
1715
+ return updated;
1716
+ });
1717
+ setGlobalConfig(getGlobalConfig());
1718
+ }
1719
+ }
1720
+ ] : []
1721
+ ];
1722
+ const filteredSettingsItems = React2.useMemo(() => {
1723
+ if (!searchQuery)
1724
+ return settingsItems;
1725
+ const lowerQuery = searchQuery.toLowerCase();
1726
+ return settingsItems.filter((setting) => {
1727
+ if (setting.id.toLowerCase().includes(lowerQuery))
1728
+ return true;
1729
+ const searchableText = "searchText" in setting ? setting.searchText : setting.label;
1730
+ return searchableText.toLowerCase().includes(lowerQuery);
1731
+ });
1732
+ }, [settingsItems, searchQuery]);
1733
+ React2.useEffect(() => {
1734
+ if (selectedIndex >= filteredSettingsItems.length) {
1735
+ const newIndex = Math.max(0, filteredSettingsItems.length - 1);
1736
+ setSelectedIndex(newIndex);
1737
+ setScrollOffset(Math.max(0, newIndex - maxVisible + 1));
1738
+ return;
1739
+ }
1740
+ setScrollOffset((prev_21) => {
1741
+ if (selectedIndex < prev_21)
1742
+ return selectedIndex;
1743
+ if (selectedIndex >= prev_21 + maxVisible)
1744
+ return selectedIndex - maxVisible + 1;
1745
+ return prev_21;
1746
+ });
1747
+ }, [filteredSettingsItems.length, selectedIndex, maxVisible]);
1748
+ const adjustScrollOffset = import_react4.useCallback((newIndex_0) => {
1749
+ setScrollOffset((prev_22) => {
1750
+ if (newIndex_0 < prev_22)
1751
+ return newIndex_0;
1752
+ if (newIndex_0 >= prev_22 + maxVisible)
1753
+ return newIndex_0 - maxVisible + 1;
1754
+ return prev_22;
1755
+ });
1756
+ }, [maxVisible]);
1757
+ const handleSaveAndClose = import_react4.useCallback(() => {
1758
+ if (showSubmenu !== null) {
1759
+ return;
1760
+ }
1761
+ const formattedChanges = Object.entries(changes).map(([key, value_2]) => {
1762
+ logEvent("tengu_config_changed", {
1763
+ key,
1764
+ value: value_2
1765
+ });
1766
+ return `Set ${key} to ${source_default.bold(value_2)}`;
1767
+ });
1768
+ const effectiveApiKey = isRunningOnHomespace() ? undefined : process.env.ANTHROPIC_API_KEY;
1769
+ const initialUsingCustomKey = Boolean(effectiveApiKey && initialConfig.current.customApiKeyResponses?.approved?.includes(normalizeApiKeyForConfig(effectiveApiKey)));
1770
+ const currentUsingCustomKey = Boolean(effectiveApiKey && globalConfig.customApiKeyResponses?.approved?.includes(normalizeApiKeyForConfig(effectiveApiKey)));
1771
+ if (initialUsingCustomKey !== currentUsingCustomKey) {
1772
+ formattedChanges.push(`${currentUsingCustomKey ? "Enabled" : "Disabled"} custom API key`);
1773
+ logEvent("tengu_config_changed", {
1774
+ key: "env.ANTHROPIC_API_KEY",
1775
+ value: currentUsingCustomKey
1776
+ });
1777
+ }
1778
+ if (globalConfig.theme !== initialConfig.current.theme) {
1779
+ formattedChanges.push(`Set theme to ${source_default.bold(globalConfig.theme)}`);
1780
+ }
1781
+ if (globalConfig.preferredNotifChannel !== initialConfig.current.preferredNotifChannel) {
1782
+ formattedChanges.push(`Set notifications to ${source_default.bold(globalConfig.preferredNotifChannel)}`);
1783
+ }
1784
+ if (currentOutputStyle !== initialOutputStyle.current) {
1785
+ formattedChanges.push(`Set output style to ${source_default.bold(currentOutputStyle)}`);
1786
+ }
1787
+ if (currentLanguage !== initialLanguage.current) {
1788
+ formattedChanges.push(`Set response language to ${source_default.bold(currentLanguage ?? "Default (English)")}`);
1789
+ }
1790
+ if (globalConfig.editorMode !== initialConfig.current.editorMode) {
1791
+ formattedChanges.push(`Set editor mode to ${source_default.bold(globalConfig.editorMode || "emacs")}`);
1792
+ }
1793
+ if (globalConfig.diffTool !== initialConfig.current.diffTool) {
1794
+ formattedChanges.push(`Set diff tool to ${source_default.bold(globalConfig.diffTool)}`);
1795
+ }
1796
+ if (globalConfig.autoConnectIde !== initialConfig.current.autoConnectIde) {
1797
+ formattedChanges.push(`${globalConfig.autoConnectIde ? "Enabled" : "Disabled"} auto-connect to IDE`);
1798
+ }
1799
+ if (globalConfig.autoInstallIdeExtension !== initialConfig.current.autoInstallIdeExtension) {
1800
+ formattedChanges.push(`${globalConfig.autoInstallIdeExtension ? "Enabled" : "Disabled"} auto-install IDE extension`);
1801
+ }
1802
+ if (globalConfig.autoCompactEnabled !== initialConfig.current.autoCompactEnabled) {
1803
+ formattedChanges.push(`${globalConfig.autoCompactEnabled ? "Enabled" : "Disabled"} auto-compact`);
1804
+ }
1805
+ if (globalConfig.respectGitignore !== initialConfig.current.respectGitignore) {
1806
+ formattedChanges.push(`${globalConfig.respectGitignore ? "Enabled" : "Disabled"} respect .gitignore in file picker`);
1807
+ }
1808
+ if (globalConfig.copyFullResponse !== initialConfig.current.copyFullResponse) {
1809
+ formattedChanges.push(`${globalConfig.copyFullResponse ? "Enabled" : "Disabled"} always copy full response`);
1810
+ }
1811
+ if (globalConfig.copyOnSelect !== initialConfig.current.copyOnSelect) {
1812
+ formattedChanges.push(`${globalConfig.copyOnSelect ? "Enabled" : "Disabled"} copy on select`);
1813
+ }
1814
+ if (globalConfig.terminalProgressBarEnabled !== initialConfig.current.terminalProgressBarEnabled) {
1815
+ formattedChanges.push(`${globalConfig.terminalProgressBarEnabled ? "Enabled" : "Disabled"} terminal progress bar`);
1816
+ }
1817
+ if (globalConfig.showStatusInTerminalTab !== initialConfig.current.showStatusInTerminalTab) {
1818
+ formattedChanges.push(`${globalConfig.showStatusInTerminalTab ? "Enabled" : "Disabled"} terminal tab status`);
1819
+ }
1820
+ if (globalConfig.showTurnDuration !== initialConfig.current.showTurnDuration) {
1821
+ formattedChanges.push(`${globalConfig.showTurnDuration ? "Enabled" : "Disabled"} turn duration`);
1822
+ }
1823
+ if (globalConfig.remoteControlAtStartup !== initialConfig.current.remoteControlAtStartup) {
1824
+ const remoteLabel = globalConfig.remoteControlAtStartup === undefined ? "Reset Remote Control to default" : `${globalConfig.remoteControlAtStartup ? "Enabled" : "Disabled"} Remote Control for all sessions`;
1825
+ formattedChanges.push(remoteLabel);
1826
+ }
1827
+ if (settingsData?.autoUpdatesChannel !== initialSettingsData.current?.autoUpdatesChannel) {
1828
+ formattedChanges.push(`Set auto-update channel to ${source_default.bold(settingsData?.autoUpdatesChannel ?? "latest")}`);
1829
+ }
1830
+ if (formattedChanges.length > 0) {
1831
+ onClose(formattedChanges.join(`
1832
+ `));
1833
+ } else {
1834
+ onClose("Config dialog dismissed", {
1835
+ display: "system"
1836
+ });
1837
+ }
1838
+ }, [
1839
+ showSubmenu,
1840
+ changes,
1841
+ globalConfig,
1842
+ mainLoopModel,
1843
+ currentOutputStyle,
1844
+ currentLanguage,
1845
+ settingsData?.autoUpdatesChannel,
1846
+ isFastModeEnabled() ? settingsData?.fastMode : undefined,
1847
+ onClose
1848
+ ]);
1849
+ const revertChanges = import_react4.useCallback(() => {
1850
+ if (themeSetting !== initialThemeSetting.current) {
1851
+ setTheme(initialThemeSetting.current);
1852
+ }
1853
+ saveGlobalConfig(() => initialConfig.current);
1854
+ const il = initialLocalSettings;
1855
+ updateSettingsForSource("localSettings", {
1856
+ spinnerTipsEnabled: il?.spinnerTipsEnabled,
1857
+ prefersReducedMotion: il?.prefersReducedMotion,
1858
+ defaultView: il?.defaultView,
1859
+ outputStyle: il?.outputStyle
1860
+ });
1861
+ const iu = initialUserSettings;
1862
+ updateSettingsForSource("userSettings", {
1863
+ alwaysThinkingEnabled: iu?.alwaysThinkingEnabled,
1864
+ fastMode: iu?.fastMode,
1865
+ promptSuggestionEnabled: iu?.promptSuggestionEnabled,
1866
+ autoUpdatesChannel: iu?.autoUpdatesChannel,
1867
+ minimumVersion: iu?.minimumVersion,
1868
+ language: iu?.language,
1869
+ ...{},
1870
+ syntaxHighlightingDisabled: iu?.syntaxHighlightingDisabled,
1871
+ permissions: iu?.permissions === undefined ? undefined : {
1872
+ ...iu.permissions,
1873
+ defaultMode: iu.permissions.defaultMode
1874
+ }
1875
+ });
1876
+ const ia = initialAppState;
1877
+ setAppState((prev_23) => ({
1878
+ ...prev_23,
1879
+ mainLoopModel: ia.mainLoopModel,
1880
+ mainLoopModelForSession: ia.mainLoopModelForSession,
1881
+ verbose: ia.verbose,
1882
+ thinkingEnabled: ia.thinkingEnabled,
1883
+ fastMode: ia.fastMode,
1884
+ promptSuggestionEnabled: ia.promptSuggestionEnabled,
1885
+ isBriefOnly: ia.isBriefOnly,
1886
+ replBridgeEnabled: ia.replBridgeEnabled,
1887
+ replBridgeOutboundOnly: ia.replBridgeOutboundOnly,
1888
+ settings: ia.settings,
1889
+ toolPermissionContext: transitionPlanAutoMode(prev_23.toolPermissionContext)
1890
+ }));
1891
+ if (getUserMsgOptIn() !== initialUserMsgOptIn) {
1892
+ setUserMsgOptIn(initialUserMsgOptIn);
1893
+ }
1894
+ }, [
1895
+ themeSetting,
1896
+ setTheme,
1897
+ initialLocalSettings,
1898
+ initialUserSettings,
1899
+ initialAppState,
1900
+ initialUserMsgOptIn,
1901
+ setAppState
1902
+ ]);
1903
+ const handleEscape = import_react4.useCallback(() => {
1904
+ if (showSubmenu !== null) {
1905
+ return;
1906
+ }
1907
+ if (isDirty.current) {
1908
+ revertChanges();
1909
+ }
1910
+ onClose("Config dialog dismissed", {
1911
+ display: "system"
1912
+ });
1913
+ }, [showSubmenu, revertChanges, onClose]);
1914
+ useKeybinding("confirm:no", handleEscape, {
1915
+ context: "Settings",
1916
+ isActive: showSubmenu === null && !isSearchMode && !headerFocused
1917
+ });
1918
+ useKeybinding("settings:close", handleSaveAndClose, {
1919
+ context: "Settings",
1920
+ isActive: showSubmenu === null && !isSearchMode && !headerFocused
1921
+ });
1922
+ const toggleSetting = import_react4.useCallback(() => {
1923
+ const setting_0 = filteredSettingsItems[selectedIndex];
1924
+ if (!setting_0 || !setting_0.onChange) {
1925
+ return;
1926
+ }
1927
+ if (setting_0.type === "boolean") {
1928
+ isDirty.current = true;
1929
+ setting_0.onChange(!setting_0.value);
1930
+ if (setting_0.id === "thinkingEnabled") {
1931
+ const newValue = !setting_0.value;
1932
+ const backToInitial = newValue === initialThinkingEnabled.current;
1933
+ if (backToInitial) {
1934
+ setShowThinkingWarning(false);
1935
+ } else if (context.messages.some((m_0) => m_0.type === "assistant")) {
1936
+ setShowThinkingWarning(true);
1937
+ }
1938
+ }
1939
+ return;
1940
+ }
1941
+ if (setting_0.id === "theme" || setting_0.id === "model" || setting_0.id === "teammateDefaultModel" || setting_0.id === "showExternalIncludesDialog" || setting_0.id === "outputStyle" || setting_0.id === "language") {
1942
+ switch (setting_0.id) {
1943
+ case "theme":
1944
+ setShowSubmenu("Theme");
1945
+ setTabsHidden(true);
1946
+ return;
1947
+ case "model":
1948
+ setShowSubmenu("Model");
1949
+ setTabsHidden(true);
1950
+ return;
1951
+ case "teammateDefaultModel":
1952
+ setShowSubmenu("TeammateModel");
1953
+ setTabsHidden(true);
1954
+ return;
1955
+ case "showExternalIncludesDialog":
1956
+ setShowSubmenu("ExternalIncludes");
1957
+ setTabsHidden(true);
1958
+ return;
1959
+ case "outputStyle":
1960
+ setShowSubmenu("OutputStyle");
1961
+ setTabsHidden(true);
1962
+ return;
1963
+ case "language":
1964
+ setShowSubmenu("Language");
1965
+ setTabsHidden(true);
1966
+ return;
1967
+ }
1968
+ }
1969
+ if (setting_0.id === "autoUpdatesChannel") {
1970
+ if (autoUpdaterDisabledReason) {
1971
+ setShowSubmenu("EnableAutoUpdates");
1972
+ setTabsHidden(true);
1973
+ return;
1974
+ }
1975
+ const currentChannel = settingsData?.autoUpdatesChannel ?? "latest";
1976
+ if (currentChannel === "latest") {
1977
+ setShowSubmenu("ChannelDowngrade");
1978
+ setTabsHidden(true);
1979
+ } else {
1980
+ isDirty.current = true;
1981
+ updateSettingsForSource("userSettings", {
1982
+ autoUpdatesChannel: "latest",
1983
+ minimumVersion: undefined
1984
+ });
1985
+ setSettingsData((prev_24) => ({
1986
+ ...prev_24,
1987
+ autoUpdatesChannel: "latest",
1988
+ minimumVersion: undefined
1989
+ }));
1990
+ logEvent("tengu_autoupdate_channel_changed", {
1991
+ channel: "latest"
1992
+ });
1993
+ }
1994
+ return;
1995
+ }
1996
+ if (setting_0.type === "enum") {
1997
+ isDirty.current = true;
1998
+ const currentIndex = setting_0.options.indexOf(setting_0.value);
1999
+ const nextIndex = (currentIndex + 1) % setting_0.options.length;
2000
+ setting_0.onChange(setting_0.options[nextIndex]);
2001
+ return;
2002
+ }
2003
+ }, [
2004
+ autoUpdaterDisabledReason,
2005
+ filteredSettingsItems,
2006
+ selectedIndex,
2007
+ settingsData?.autoUpdatesChannel,
2008
+ setTabsHidden
2009
+ ]);
2010
+ const moveSelection = (delta) => {
2011
+ setShowThinkingWarning(false);
2012
+ const newIndex_1 = Math.max(0, Math.min(filteredSettingsItems.length - 1, selectedIndex + delta));
2013
+ setSelectedIndex(newIndex_1);
2014
+ adjustScrollOffset(newIndex_1);
2015
+ };
2016
+ useKeybindings({
2017
+ "select:previous": () => {
2018
+ if (selectedIndex === 0) {
2019
+ setShowThinkingWarning(false);
2020
+ setIsSearchMode(true);
2021
+ setScrollOffset(0);
2022
+ } else {
2023
+ moveSelection(-1);
2024
+ }
2025
+ },
2026
+ "select:next": () => moveSelection(1),
2027
+ "scroll:lineUp": () => moveSelection(-1),
2028
+ "scroll:lineDown": () => moveSelection(1),
2029
+ "select:accept": toggleSetting,
2030
+ "settings:search": () => {
2031
+ setIsSearchMode(true);
2032
+ setSearchQuery("");
2033
+ }
2034
+ }, {
2035
+ context: "Settings",
2036
+ isActive: showSubmenu === null && !isSearchMode && !headerFocused
2037
+ });
2038
+ const handleKeyDown = import_react4.useCallback((e) => {
2039
+ if (showSubmenu !== null)
2040
+ return;
2041
+ if (headerFocused)
2042
+ return;
2043
+ if (isSearchMode) {
2044
+ if (e.key === "escape") {
2045
+ e.preventDefault();
2046
+ if (searchQuery.length > 0) {
2047
+ setSearchQuery("");
2048
+ } else {
2049
+ setIsSearchMode(false);
2050
+ }
2051
+ return;
2052
+ }
2053
+ if (e.key === "return" || e.key === "down" || e.key === "wheeldown") {
2054
+ e.preventDefault();
2055
+ setIsSearchMode(false);
2056
+ setSelectedIndex(0);
2057
+ setScrollOffset(0);
2058
+ }
2059
+ return;
2060
+ }
2061
+ if (e.key === "left" || e.key === "right" || e.key === "tab") {
2062
+ e.preventDefault();
2063
+ toggleSetting();
2064
+ return;
2065
+ }
2066
+ if (e.ctrl || e.meta)
2067
+ return;
2068
+ if (e.key === "j" || e.key === "k" || e.key === "/")
2069
+ return;
2070
+ if (e.key.length === 1 && e.key !== " ") {
2071
+ e.preventDefault();
2072
+ setIsSearchMode(true);
2073
+ setSearchQuery(e.key);
2074
+ }
2075
+ }, [showSubmenu, headerFocused, isSearchMode, searchQuery, setSearchQuery, toggleSetting]);
2076
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2077
+ flexDirection: "column",
2078
+ width: "100%",
2079
+ tabIndex: 0,
2080
+ autoFocus: true,
2081
+ onKeyDown: handleKeyDown,
2082
+ children: showSubmenu === "Theme" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2083
+ children: [
2084
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemePicker, {
2085
+ onThemeSelect: (setting_1) => {
2086
+ isDirty.current = true;
2087
+ setTheme(setting_1);
2088
+ setShowSubmenu(null);
2089
+ setTabsHidden(false);
2090
+ },
2091
+ onCancel: () => {
2092
+ setShowSubmenu(null);
2093
+ setTabsHidden(false);
2094
+ },
2095
+ hideEscToCancel: true,
2096
+ skipExitHandling: true
2097
+ }, undefined, false, undefined, this),
2098
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2099
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2100
+ dimColor: true,
2101
+ italic: true,
2102
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2103
+ children: [
2104
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2105
+ shortcut: "Enter",
2106
+ action: "select"
2107
+ }, undefined, false, undefined, this),
2108
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2109
+ action: "confirm:no",
2110
+ context: "Confirmation",
2111
+ fallback: "Esc",
2112
+ description: "cancel"
2113
+ }, undefined, false, undefined, this)
2114
+ ]
2115
+ }, undefined, true, undefined, this)
2116
+ }, undefined, false, undefined, this)
2117
+ }, undefined, false, undefined, this)
2118
+ ]
2119
+ }, undefined, true, undefined, this) : showSubmenu === "Model" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2120
+ children: [
2121
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ModelPicker, {
2122
+ initial: mainLoopModel,
2123
+ onSelect: (model_0, _effort) => {
2124
+ isDirty.current = true;
2125
+ onChangeMainModelConfig(model_0);
2126
+ setShowSubmenu(null);
2127
+ setTabsHidden(false);
2128
+ },
2129
+ onCancel: () => {
2130
+ setShowSubmenu(null);
2131
+ setTabsHidden(false);
2132
+ },
2133
+ showFastModeNotice: isFastModeEnabled() ? isFastMode && isFastModeSupportedByModel(mainLoopModel) && isFastModeAvailable() : false
2134
+ }, undefined, false, undefined, this),
2135
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2136
+ dimColor: true,
2137
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2138
+ children: [
2139
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2140
+ shortcut: "Enter",
2141
+ action: "confirm"
2142
+ }, undefined, false, undefined, this),
2143
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2144
+ action: "confirm:no",
2145
+ context: "Confirmation",
2146
+ fallback: "Esc",
2147
+ description: "cancel"
2148
+ }, undefined, false, undefined, this)
2149
+ ]
2150
+ }, undefined, true, undefined, this)
2151
+ }, undefined, false, undefined, this)
2152
+ ]
2153
+ }, undefined, true, undefined, this) : showSubmenu === "TeammateModel" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2154
+ children: [
2155
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ModelPicker, {
2156
+ initial: globalConfig.teammateDefaultModel ?? null,
2157
+ skipSettingsWrite: true,
2158
+ headerText: "Default model for newly spawned teammates. The leader can override via the tool call's model parameter.",
2159
+ onSelect: (model_1, _effort_0) => {
2160
+ setShowSubmenu(null);
2161
+ setTabsHidden(false);
2162
+ if (globalConfig.teammateDefaultModel === undefined && model_1 === null) {
2163
+ return;
2164
+ }
2165
+ isDirty.current = true;
2166
+ saveGlobalConfig((current_23) => current_23.teammateDefaultModel === model_1 ? current_23 : {
2167
+ ...current_23,
2168
+ teammateDefaultModel: model_1
2169
+ });
2170
+ setGlobalConfig({
2171
+ ...getGlobalConfig(),
2172
+ teammateDefaultModel: model_1
2173
+ });
2174
+ setChanges((prev_25) => ({
2175
+ ...prev_25,
2176
+ teammateDefaultModel: teammateModelDisplayString(model_1)
2177
+ }));
2178
+ logEvent("tengu_teammate_default_model_changed", {
2179
+ model: model_1
2180
+ });
2181
+ },
2182
+ onCancel: () => {
2183
+ setShowSubmenu(null);
2184
+ setTabsHidden(false);
2185
+ }
2186
+ }, undefined, false, undefined, this),
2187
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2188
+ dimColor: true,
2189
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2190
+ children: [
2191
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2192
+ shortcut: "Enter",
2193
+ action: "confirm"
2194
+ }, undefined, false, undefined, this),
2195
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2196
+ action: "confirm:no",
2197
+ context: "Confirmation",
2198
+ fallback: "Esc",
2199
+ description: "cancel"
2200
+ }, undefined, false, undefined, this)
2201
+ ]
2202
+ }, undefined, true, undefined, this)
2203
+ }, undefined, false, undefined, this)
2204
+ ]
2205
+ }, undefined, true, undefined, this) : showSubmenu === "ExternalIncludes" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2206
+ children: [
2207
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ClaudeMdExternalIncludesDialog, {
2208
+ onDone: () => {
2209
+ setShowSubmenu(null);
2210
+ setTabsHidden(false);
2211
+ },
2212
+ externalIncludes: getExternalClaudeMdIncludes(memoryFiles)
2213
+ }, undefined, false, undefined, this),
2214
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2215
+ dimColor: true,
2216
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2217
+ children: [
2218
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2219
+ shortcut: "Enter",
2220
+ action: "confirm"
2221
+ }, undefined, false, undefined, this),
2222
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2223
+ action: "confirm:no",
2224
+ context: "Confirmation",
2225
+ fallback: "Esc",
2226
+ description: "disable external includes"
2227
+ }, undefined, false, undefined, this)
2228
+ ]
2229
+ }, undefined, true, undefined, this)
2230
+ }, undefined, false, undefined, this)
2231
+ ]
2232
+ }, undefined, true, undefined, this) : showSubmenu === "OutputStyle" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2233
+ children: [
2234
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(OutputStylePicker, {
2235
+ initialStyle: currentOutputStyle,
2236
+ onComplete: (style) => {
2237
+ isDirty.current = true;
2238
+ setCurrentOutputStyle(style ?? DEFAULT_OUTPUT_STYLE_NAME);
2239
+ setShowSubmenu(null);
2240
+ setTabsHidden(false);
2241
+ updateSettingsForSource("localSettings", {
2242
+ outputStyle: style
2243
+ });
2244
+ logEvent("tengu_output_style_changed", {
2245
+ style: style ?? DEFAULT_OUTPUT_STYLE_NAME,
2246
+ source: "config_panel",
2247
+ settings_source: "localSettings"
2248
+ });
2249
+ },
2250
+ onCancel: () => {
2251
+ setShowSubmenu(null);
2252
+ setTabsHidden(false);
2253
+ }
2254
+ }, undefined, false, undefined, this),
2255
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2256
+ dimColor: true,
2257
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2258
+ children: [
2259
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2260
+ shortcut: "Enter",
2261
+ action: "confirm"
2262
+ }, undefined, false, undefined, this),
2263
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2264
+ action: "confirm:no",
2265
+ context: "Confirmation",
2266
+ fallback: "Esc",
2267
+ description: "cancel"
2268
+ }, undefined, false, undefined, this)
2269
+ ]
2270
+ }, undefined, true, undefined, this)
2271
+ }, undefined, false, undefined, this)
2272
+ ]
2273
+ }, undefined, true, undefined, this) : showSubmenu === "Language" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2274
+ children: [
2275
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(LanguagePicker, {
2276
+ initialLanguage: currentLanguage,
2277
+ onComplete: (language) => {
2278
+ isDirty.current = true;
2279
+ setCurrentLanguage(language);
2280
+ setShowSubmenu(null);
2281
+ setTabsHidden(false);
2282
+ updateSettingsForSource("userSettings", {
2283
+ language
2284
+ });
2285
+ logEvent("tengu_language_changed", {
2286
+ language: language ?? "default",
2287
+ source: "config_panel"
2288
+ });
2289
+ },
2290
+ onCancel: () => {
2291
+ setShowSubmenu(null);
2292
+ setTabsHidden(false);
2293
+ }
2294
+ }, undefined, false, undefined, this),
2295
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2296
+ dimColor: true,
2297
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2298
+ children: [
2299
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2300
+ shortcut: "Enter",
2301
+ action: "confirm"
2302
+ }, undefined, false, undefined, this),
2303
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2304
+ action: "confirm:no",
2305
+ context: "Settings",
2306
+ fallback: "Esc",
2307
+ description: "cancel"
2308
+ }, undefined, false, undefined, this)
2309
+ ]
2310
+ }, undefined, true, undefined, this)
2311
+ }, undefined, false, undefined, this)
2312
+ ]
2313
+ }, undefined, true, undefined, this) : showSubmenu === "EnableAutoUpdates" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Dialog, {
2314
+ title: "Enable Auto-Updates",
2315
+ onCancel: () => {
2316
+ setShowSubmenu(null);
2317
+ setTabsHidden(false);
2318
+ },
2319
+ hideBorder: true,
2320
+ hideInputGuide: true,
2321
+ children: autoUpdaterDisabledReason?.type !== "config" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2322
+ children: [
2323
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2324
+ children: autoUpdaterDisabledReason?.type === "env" ? "Auto-updates are controlled by an environment variable and cannot be changed here." : autoUpdaterDisabledReason?.type === "distribution" ? "Automatic installation is disabled for this fork distribution, but version checks remain enabled." : "Auto-updates are disabled in development builds."
2325
+ }, undefined, false, undefined, this),
2326
+ autoUpdaterDisabledReason?.type === "env" && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2327
+ dimColor: true,
2328
+ children: [
2329
+ "Unset ",
2330
+ autoUpdaterDisabledReason.envVar,
2331
+ " to re-enable auto-updates."
2332
+ ]
2333
+ }, undefined, true, undefined, this)
2334
+ ]
2335
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Select, {
2336
+ options: [
2337
+ {
2338
+ label: "Enable with latest channel",
2339
+ value: "latest"
2340
+ },
2341
+ {
2342
+ label: "Enable with stable channel",
2343
+ value: "stable"
2344
+ }
2345
+ ],
2346
+ onChange: (channel) => {
2347
+ isDirty.current = true;
2348
+ setShowSubmenu(null);
2349
+ setTabsHidden(false);
2350
+ saveGlobalConfig((current_24) => ({
2351
+ ...current_24,
2352
+ autoUpdates: true
2353
+ }));
2354
+ setGlobalConfig({
2355
+ ...getGlobalConfig(),
2356
+ autoUpdates: true
2357
+ });
2358
+ updateSettingsForSource("userSettings", {
2359
+ autoUpdatesChannel: channel,
2360
+ minimumVersion: undefined
2361
+ });
2362
+ setSettingsData((prev_26) => ({
2363
+ ...prev_26,
2364
+ autoUpdatesChannel: channel,
2365
+ minimumVersion: undefined
2366
+ }));
2367
+ logEvent("tengu_autoupdate_enabled", {
2368
+ channel
2369
+ });
2370
+ }
2371
+ }, undefined, false, undefined, this)
2372
+ }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ChannelDowngradeDialog, {
2373
+ currentVersion: "1.0.3-fork.2a74621",
2374
+ onChoice: (choice) => {
2375
+ setShowSubmenu(null);
2376
+ setTabsHidden(false);
2377
+ if (choice === "cancel") {
2378
+ return;
2379
+ }
2380
+ isDirty.current = true;
2381
+ const newSettings = {
2382
+ autoUpdatesChannel: "stable"
2383
+ };
2384
+ if (choice === "stay") {
2385
+ newSettings.minimumVersion = "1.0.3-fork.2a74621";
2386
+ }
2387
+ updateSettingsForSource("userSettings", newSettings);
2388
+ setSettingsData((prev_27) => ({
2389
+ ...prev_27,
2390
+ ...newSettings
2391
+ }));
2392
+ logEvent("tengu_autoupdate_channel_changed", {
2393
+ channel: "stable",
2394
+ minimum_version_set: choice === "stay"
2395
+ });
2396
+ }
2397
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2398
+ flexDirection: "column",
2399
+ gap: 1,
2400
+ marginY: insideModal ? undefined : 1,
2401
+ children: [
2402
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SearchBox, {
2403
+ query: searchQuery,
2404
+ isFocused: isSearchMode && !headerFocused,
2405
+ isTerminalFocused,
2406
+ cursorOffset: searchCursorOffset,
2407
+ placeholder: "Search settings\u2026"
2408
+ }, undefined, false, undefined, this),
2409
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2410
+ flexDirection: "column",
2411
+ children: filteredSettingsItems.length === 0 ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2412
+ dimColor: true,
2413
+ italic: true,
2414
+ children: [
2415
+ 'No settings match "',
2416
+ searchQuery,
2417
+ '"'
2418
+ ]
2419
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2420
+ children: [
2421
+ scrollOffset > 0 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2422
+ dimColor: true,
2423
+ children: [
2424
+ figures_default.arrowUp,
2425
+ " ",
2426
+ scrollOffset,
2427
+ " more above"
2428
+ ]
2429
+ }, undefined, true, undefined, this),
2430
+ filteredSettingsItems.slice(scrollOffset, scrollOffset + maxVisible).map((setting_2, i) => {
2431
+ const actualIndex = scrollOffset + i;
2432
+ const isSelected = actualIndex === selectedIndex && !headerFocused && !isSearchMode;
2433
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(React2.Fragment, {
2434
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2435
+ children: [
2436
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2437
+ width: 44,
2438
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2439
+ color: isSelected ? "suggestion" : undefined,
2440
+ children: [
2441
+ isSelected ? figures_default.pointer : " ",
2442
+ " ",
2443
+ setting_2.label
2444
+ ]
2445
+ }, undefined, true, undefined, this)
2446
+ }, undefined, false, undefined, this),
2447
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2448
+ children: setting_2.type === "boolean" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2449
+ children: [
2450
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2451
+ color: isSelected ? "suggestion" : undefined,
2452
+ children: setting_2.value.toString()
2453
+ }, undefined, false, undefined, this),
2454
+ showThinkingWarning && setting_2.id === "thinkingEnabled" && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2455
+ color: "warning",
2456
+ children: [
2457
+ " ",
2458
+ "Changing thinking mode mid-conversation will increase latency and may reduce quality."
2459
+ ]
2460
+ }, undefined, true, undefined, this)
2461
+ ]
2462
+ }, undefined, true, undefined, this) : setting_2.id === "theme" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2463
+ color: isSelected ? "suggestion" : undefined,
2464
+ children: THEME_LABELS[setting_2.value.toString()] ?? setting_2.value.toString()
2465
+ }, undefined, false, undefined, this) : setting_2.id === "notifChannel" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2466
+ color: isSelected ? "suggestion" : undefined,
2467
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(NotifChannelLabel, {
2468
+ value: setting_2.value.toString()
2469
+ }, undefined, false, undefined, this)
2470
+ }, undefined, false, undefined, this) : setting_2.id === "defaultPermissionMode" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2471
+ color: isSelected ? "suggestion" : undefined,
2472
+ children: permissionModeTitle(setting_2.value)
2473
+ }, undefined, false, undefined, this) : setting_2.id === "autoUpdatesChannel" && autoUpdaterDisabledReason ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2474
+ flexDirection: "column",
2475
+ children: [
2476
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2477
+ color: isSelected ? "suggestion" : undefined,
2478
+ children: "disabled"
2479
+ }, undefined, false, undefined, this),
2480
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2481
+ dimColor: true,
2482
+ children: [
2483
+ "(",
2484
+ formatAutoUpdaterDisabledReason(autoUpdaterDisabledReason),
2485
+ ")"
2486
+ ]
2487
+ }, undefined, true, undefined, this)
2488
+ ]
2489
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2490
+ color: isSelected ? "suggestion" : undefined,
2491
+ children: setting_2.value.toString()
2492
+ }, undefined, false, undefined, this)
2493
+ }, isSelected ? "selected" : "unselected", false, undefined, this)
2494
+ ]
2495
+ }, undefined, true, undefined, this)
2496
+ }, setting_2.id, false, undefined, this);
2497
+ }),
2498
+ scrollOffset + maxVisible < filteredSettingsItems.length && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2499
+ dimColor: true,
2500
+ children: [
2501
+ figures_default.arrowDown,
2502
+ " ",
2503
+ filteredSettingsItems.length - scrollOffset - maxVisible,
2504
+ " more below"
2505
+ ]
2506
+ }, undefined, true, undefined, this)
2507
+ ]
2508
+ }, undefined, true, undefined, this)
2509
+ }, undefined, false, undefined, this),
2510
+ headerFocused ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2511
+ dimColor: true,
2512
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2513
+ children: [
2514
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2515
+ shortcut: "\u2190/\u2192 tab",
2516
+ action: "switch"
2517
+ }, undefined, false, undefined, this),
2518
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2519
+ shortcut: "\u2193",
2520
+ action: "return"
2521
+ }, undefined, false, undefined, this),
2522
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2523
+ action: "confirm:no",
2524
+ context: "Settings",
2525
+ fallback: "Esc",
2526
+ description: "close"
2527
+ }, undefined, false, undefined, this)
2528
+ ]
2529
+ }, undefined, true, undefined, this)
2530
+ }, undefined, false, undefined, this) : isSearchMode ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2531
+ dimColor: true,
2532
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2533
+ children: [
2534
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2535
+ children: "Type to filter"
2536
+ }, undefined, false, undefined, this),
2537
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2538
+ shortcut: "Enter/\u2193",
2539
+ action: "select"
2540
+ }, undefined, false, undefined, this),
2541
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2542
+ shortcut: "\u2191",
2543
+ action: "tabs"
2544
+ }, undefined, false, undefined, this),
2545
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2546
+ action: "confirm:no",
2547
+ context: "Settings",
2548
+ fallback: "Esc",
2549
+ description: "clear"
2550
+ }, undefined, false, undefined, this)
2551
+ ]
2552
+ }, undefined, true, undefined, this)
2553
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2554
+ dimColor: true,
2555
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2556
+ children: [
2557
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2558
+ action: "select:accept",
2559
+ context: "Settings",
2560
+ fallback: "Space",
2561
+ description: "change"
2562
+ }, undefined, false, undefined, this),
2563
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2564
+ action: "settings:close",
2565
+ context: "Settings",
2566
+ fallback: "Enter",
2567
+ description: "save"
2568
+ }, undefined, false, undefined, this),
2569
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2570
+ action: "settings:search",
2571
+ context: "Settings",
2572
+ fallback: "/",
2573
+ description: "search"
2574
+ }, undefined, false, undefined, this),
2575
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2576
+ action: "confirm:no",
2577
+ context: "Settings",
2578
+ fallback: "Esc",
2579
+ description: "cancel"
2580
+ }, undefined, false, undefined, this)
2581
+ ]
2582
+ }, undefined, true, undefined, this)
2583
+ }, undefined, false, undefined, this)
2584
+ ]
2585
+ }, undefined, true, undefined, this)
2586
+ }, undefined, false, undefined, this);
2587
+ }
2588
+ function teammateModelDisplayString(value) {
2589
+ if (value === undefined) {
2590
+ return modelDisplayString(getHardcodedTeammateModelFallback());
2591
+ }
2592
+ if (value === null)
2593
+ return "Default (leader's model)";
2594
+ return modelDisplayString(value);
2595
+ }
2596
+ function NotifChannelLabel(t0) {
2597
+ const $ = import_compiler_runtime5.c(4);
2598
+ const { value } = t0;
2599
+ switch (value) {
2600
+ case "auto": {
2601
+ return "Auto";
2602
+ }
2603
+ case "iterm2": {
2604
+ let t1;
2605
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2606
+ t1 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2607
+ children: [
2608
+ "iTerm2 ",
2609
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2610
+ dimColor: true,
2611
+ children: "(OSC 9)"
2612
+ }, undefined, false, undefined, this)
2613
+ ]
2614
+ }, undefined, true, undefined, this);
2615
+ $[0] = t1;
2616
+ } else {
2617
+ t1 = $[0];
2618
+ }
2619
+ return t1;
2620
+ }
2621
+ case "terminal_bell": {
2622
+ let t1;
2623
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
2624
+ t1 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2625
+ children: [
2626
+ "Terminal Bell ",
2627
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2628
+ dimColor: true,
2629
+ children: "(\\a)"
2630
+ }, undefined, false, undefined, this)
2631
+ ]
2632
+ }, undefined, true, undefined, this);
2633
+ $[1] = t1;
2634
+ } else {
2635
+ t1 = $[1];
2636
+ }
2637
+ return t1;
2638
+ }
2639
+ case "kitty": {
2640
+ let t1;
2641
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2642
+ t1 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2643
+ children: [
2644
+ "Kitty ",
2645
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2646
+ dimColor: true,
2647
+ children: "(OSC 99)"
2648
+ }, undefined, false, undefined, this)
2649
+ ]
2650
+ }, undefined, true, undefined, this);
2651
+ $[2] = t1;
2652
+ } else {
2653
+ t1 = $[2];
2654
+ }
2655
+ return t1;
2656
+ }
2657
+ case "ghostty": {
2658
+ let t1;
2659
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
2660
+ t1 = /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2661
+ children: [
2662
+ "Ghostty ",
2663
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2664
+ dimColor: true,
2665
+ children: "(OSC 777)"
2666
+ }, undefined, false, undefined, this)
2667
+ ]
2668
+ }, undefined, true, undefined, this);
2669
+ $[3] = t1;
2670
+ } else {
2671
+ t1 = $[3];
2672
+ }
2673
+ return t1;
2674
+ }
2675
+ case "iterm2_with_bell": {
2676
+ return "iTerm2 w/ Bell";
2677
+ }
2678
+ case "notifications_disabled": {
2679
+ return "Disabled";
2680
+ }
2681
+ default: {
2682
+ return value;
2683
+ }
2684
+ }
2685
+ }
2686
+ var import_compiler_runtime5, React2, import_react4, jsx_dev_runtime5, THEME_LABELS;
2687
+ var init_Config = __esm(() => {
2688
+ init_ink();
2689
+ init_useKeybinding();
2690
+ init_figures();
2691
+ init_config();
2692
+ init_authPortable();
2693
+ init_config();
2694
+ init_source();
2695
+ init_PermissionMode();
2696
+ init_permissionSetup();
2697
+ init_log();
2698
+ init_analytics();
2699
+ init_bridgeEnabled();
2700
+ init_ThemePicker();
2701
+ init_AppState();
2702
+ init_ModelPicker();
2703
+ init_model();
2704
+ init_extraUsage();
2705
+ init_ClaudeMdExternalIncludesDialog();
2706
+ init_ChannelDowngradeDialog();
2707
+ init_Dialog();
2708
+ init_CustomSelect();
2709
+ init_OutputStylePicker();
2710
+ init_LanguagePicker();
2711
+ init_claudemd();
2712
+ init_KeyboardShortcutHint();
2713
+ init_ConfigurableShortcutHint();
2714
+ init_Byline();
2715
+ init_Tabs();
2716
+ init_modalContext();
2717
+ init_SearchBox();
2718
+ init_ide();
2719
+ init_settings();
2720
+ init_state();
2721
+ init_outputStyles();
2722
+ init_envUtils();
2723
+ init_growthbook();
2724
+ init_agentSwarmsEnabled();
2725
+ init_teammateModeSnapshot();
2726
+ init_teammateModel();
2727
+ init_useSearchInput();
2728
+ init_useTerminalSize();
2729
+ init_fastMode();
2730
+ init_fullscreen();
2731
+ import_compiler_runtime5 = __toESM(require_compiler_runtime(), 1);
2732
+ React2 = __toESM(require_react(), 1);
2733
+ import_react4 = __toESM(require_react(), 1);
2734
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
2735
+ THEME_LABELS = {
2736
+ auto: "Auto (match terminal)",
2737
+ dark: "Dark mode",
2738
+ light: "Light mode",
2739
+ "dark-daltonized": "Dark mode (colorblind-friendly)",
2740
+ "light-daltonized": "Light mode (colorblind-friendly)",
2741
+ "dark-ansi": "Dark mode (ANSI colors only)",
2742
+ "light-ansi": "Light mode (ANSI colors only)"
2743
+ };
2744
+ });
2745
+
2746
+ // src/components/Settings/Usage.tsx
2747
+ function LimitBar(t0) {
2748
+ const $ = import_compiler_runtime6.c(34);
2749
+ const {
2750
+ title,
2751
+ limit,
2752
+ maxWidth,
2753
+ showTimeInReset: t1,
2754
+ extraSubtext
2755
+ } = t0;
2756
+ const showTimeInReset = t1 === undefined ? true : t1;
2757
+ const {
2758
+ utilization,
2759
+ resets_at
2760
+ } = limit;
2761
+ if (utilization === null) {
2762
+ return null;
2763
+ }
2764
+ const usedText = `${Math.floor(utilization)}% used`;
2765
+ let subtext;
2766
+ if (resets_at) {
2767
+ let t2;
2768
+ if ($[0] !== resets_at || $[1] !== showTimeInReset) {
2769
+ t2 = formatResetText(resets_at, true, showTimeInReset);
2770
+ $[0] = resets_at;
2771
+ $[1] = showTimeInReset;
2772
+ $[2] = t2;
2773
+ } else {
2774
+ t2 = $[2];
2775
+ }
2776
+ subtext = `Resets ${t2}`;
2777
+ }
2778
+ if (extraSubtext) {
2779
+ if (subtext) {
2780
+ subtext = `${extraSubtext} \xB7 ${subtext}`;
2781
+ } else {
2782
+ subtext = extraSubtext;
2783
+ }
2784
+ }
2785
+ if (maxWidth >= 62) {
2786
+ let t2;
2787
+ if ($[3] !== title) {
2788
+ t2 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2789
+ bold: true,
2790
+ children: title
2791
+ }, undefined, false, undefined, this);
2792
+ $[3] = title;
2793
+ $[4] = t2;
2794
+ } else {
2795
+ t2 = $[4];
2796
+ }
2797
+ const t3 = utilization / 100;
2798
+ let t4;
2799
+ if ($[5] !== t3) {
2800
+ t4 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ProgressBar, {
2801
+ ratio: t3,
2802
+ width: 50,
2803
+ fillColor: "rate_limit_fill",
2804
+ emptyColor: "rate_limit_empty"
2805
+ }, undefined, false, undefined, this);
2806
+ $[5] = t3;
2807
+ $[6] = t4;
2808
+ } else {
2809
+ t4 = $[6];
2810
+ }
2811
+ let t5;
2812
+ if ($[7] !== usedText) {
2813
+ t5 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2814
+ children: usedText
2815
+ }, undefined, false, undefined, this);
2816
+ $[7] = usedText;
2817
+ $[8] = t5;
2818
+ } else {
2819
+ t5 = $[8];
2820
+ }
2821
+ let t6;
2822
+ if ($[9] !== t4 || $[10] !== t5) {
2823
+ t6 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2824
+ flexDirection: "row",
2825
+ gap: 1,
2826
+ children: [
2827
+ t4,
2828
+ t5
2829
+ ]
2830
+ }, undefined, true, undefined, this);
2831
+ $[9] = t4;
2832
+ $[10] = t5;
2833
+ $[11] = t6;
2834
+ } else {
2835
+ t6 = $[11];
2836
+ }
2837
+ let t7;
2838
+ if ($[12] !== subtext) {
2839
+ t7 = subtext && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2840
+ dimColor: true,
2841
+ children: subtext
2842
+ }, undefined, false, undefined, this);
2843
+ $[12] = subtext;
2844
+ $[13] = t7;
2845
+ } else {
2846
+ t7 = $[13];
2847
+ }
2848
+ let t8;
2849
+ if ($[14] !== t2 || $[15] !== t6 || $[16] !== t7) {
2850
+ t8 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2851
+ flexDirection: "column",
2852
+ children: [
2853
+ t2,
2854
+ t6,
2855
+ t7
2856
+ ]
2857
+ }, undefined, true, undefined, this);
2858
+ $[14] = t2;
2859
+ $[15] = t6;
2860
+ $[16] = t7;
2861
+ $[17] = t8;
2862
+ } else {
2863
+ t8 = $[17];
2864
+ }
2865
+ return t8;
2866
+ } else {
2867
+ let t2;
2868
+ if ($[18] !== title) {
2869
+ t2 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2870
+ bold: true,
2871
+ children: title
2872
+ }, undefined, false, undefined, this);
2873
+ $[18] = title;
2874
+ $[19] = t2;
2875
+ } else {
2876
+ t2 = $[19];
2877
+ }
2878
+ let t3;
2879
+ if ($[20] !== subtext) {
2880
+ t3 = subtext && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
2881
+ children: [
2882
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2883
+ children: " "
2884
+ }, undefined, false, undefined, this),
2885
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2886
+ dimColor: true,
2887
+ children: [
2888
+ "\xB7 ",
2889
+ subtext
2890
+ ]
2891
+ }, undefined, true, undefined, this)
2892
+ ]
2893
+ }, undefined, true, undefined, this);
2894
+ $[20] = subtext;
2895
+ $[21] = t3;
2896
+ } else {
2897
+ t3 = $[21];
2898
+ }
2899
+ let t4;
2900
+ if ($[22] !== t2 || $[23] !== t3) {
2901
+ t4 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2902
+ children: [
2903
+ t2,
2904
+ t3
2905
+ ]
2906
+ }, undefined, true, undefined, this);
2907
+ $[22] = t2;
2908
+ $[23] = t3;
2909
+ $[24] = t4;
2910
+ } else {
2911
+ t4 = $[24];
2912
+ }
2913
+ const t5 = utilization / 100;
2914
+ let t6;
2915
+ if ($[25] !== maxWidth || $[26] !== t5) {
2916
+ t6 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ProgressBar, {
2917
+ ratio: t5,
2918
+ width: maxWidth,
2919
+ fillColor: "rate_limit_fill",
2920
+ emptyColor: "rate_limit_empty"
2921
+ }, undefined, false, undefined, this);
2922
+ $[25] = maxWidth;
2923
+ $[26] = t5;
2924
+ $[27] = t6;
2925
+ } else {
2926
+ t6 = $[27];
2927
+ }
2928
+ let t7;
2929
+ if ($[28] !== usedText) {
2930
+ t7 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2931
+ children: usedText
2932
+ }, undefined, false, undefined, this);
2933
+ $[28] = usedText;
2934
+ $[29] = t7;
2935
+ } else {
2936
+ t7 = $[29];
2937
+ }
2938
+ let t8;
2939
+ if ($[30] !== t4 || $[31] !== t6 || $[32] !== t7) {
2940
+ t8 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2941
+ flexDirection: "column",
2942
+ children: [
2943
+ t4,
2944
+ t6,
2945
+ t7
2946
+ ]
2947
+ }, undefined, true, undefined, this);
2948
+ $[30] = t4;
2949
+ $[31] = t6;
2950
+ $[32] = t7;
2951
+ $[33] = t8;
2952
+ } else {
2953
+ t8 = $[33];
2954
+ }
2955
+ return t8;
2956
+ }
2957
+ }
2958
+ function Usage() {
2959
+ const [utilization, setUtilization] = import_react5.useState(null);
2960
+ const [error, setError] = import_react5.useState(null);
2961
+ const [isLoading, setIsLoading] = import_react5.useState(true);
2962
+ const {
2963
+ columns
2964
+ } = useTerminalSize();
2965
+ const availableWidth = columns - 2;
2966
+ const maxWidth = Math.min(availableWidth, 80);
2967
+ const loadUtilization = React3.useCallback(async () => {
2968
+ setIsLoading(true);
2969
+ setError(null);
2970
+ try {
2971
+ const data = await fetchUtilization();
2972
+ setUtilization(data);
2973
+ } catch (err) {
2974
+ logError(err);
2975
+ const axiosError = err;
2976
+ const responseBody = axiosError.response?.data ? jsonStringify(axiosError.response.data) : undefined;
2977
+ setError(responseBody ? `Failed to load usage data: ${responseBody}` : "Failed to load usage data");
2978
+ } finally {
2979
+ setIsLoading(false);
2980
+ }
2981
+ }, []);
2982
+ import_react5.useEffect(() => {
2983
+ loadUtilization();
2984
+ }, [loadUtilization]);
2985
+ useKeybinding("settings:retry", () => {
2986
+ loadUtilization();
2987
+ }, {
2988
+ context: "Settings",
2989
+ isActive: !!error && !isLoading
2990
+ });
2991
+ if (error) {
2992
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2993
+ flexDirection: "column",
2994
+ gap: 1,
2995
+ children: [
2996
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2997
+ color: "error",
2998
+ children: [
2999
+ "Error: ",
3000
+ error
3001
+ ]
3002
+ }, undefined, true, undefined, this),
3003
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3004
+ dimColor: true,
3005
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Byline, {
3006
+ children: [
3007
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
3008
+ action: "settings:retry",
3009
+ context: "Settings",
3010
+ fallback: "r",
3011
+ description: "retry"
3012
+ }, undefined, false, undefined, this),
3013
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
3014
+ action: "confirm:no",
3015
+ context: "Settings",
3016
+ fallback: "Esc",
3017
+ description: "cancel"
3018
+ }, undefined, false, undefined, this)
3019
+ ]
3020
+ }, undefined, true, undefined, this)
3021
+ }, undefined, false, undefined, this)
3022
+ ]
3023
+ }, undefined, true, undefined, this);
3024
+ }
3025
+ if (!utilization) {
3026
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
3027
+ flexDirection: "column",
3028
+ gap: 1,
3029
+ children: [
3030
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3031
+ dimColor: true,
3032
+ children: "Loading usage data\u2026"
3033
+ }, undefined, false, undefined, this),
3034
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3035
+ dimColor: true,
3036
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
3037
+ action: "confirm:no",
3038
+ context: "Settings",
3039
+ fallback: "Esc",
3040
+ description: "cancel"
3041
+ }, undefined, false, undefined, this)
3042
+ }, undefined, false, undefined, this)
3043
+ ]
3044
+ }, undefined, true, undefined, this);
3045
+ }
3046
+ const subscriptionType = getSubscriptionType();
3047
+ const showSonnetBar = subscriptionType === "max" || subscriptionType === "team" || subscriptionType === null;
3048
+ const limits = [{
3049
+ title: "Current session",
3050
+ limit: utilization.five_hour
3051
+ }, {
3052
+ title: "Current week (all models)",
3053
+ limit: utilization.seven_day
3054
+ }, ...showSonnetBar ? [{
3055
+ title: "Current week (Sonnet only)",
3056
+ limit: utilization.seven_day_sonnet
3057
+ }] : []];
3058
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
3059
+ flexDirection: "column",
3060
+ gap: 1,
3061
+ width: "100%",
3062
+ children: [
3063
+ limits.some(({
3064
+ limit
3065
+ }) => limit) || /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3066
+ dimColor: true,
3067
+ children: "/usage is only available for subscription plans."
3068
+ }, undefined, false, undefined, this),
3069
+ limits.map(({
3070
+ title,
3071
+ limit: limit_0
3072
+ }) => limit_0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(LimitBar, {
3073
+ title,
3074
+ limit: limit_0,
3075
+ maxWidth
3076
+ }, title, false, undefined, this)),
3077
+ utilization.extra_usage && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ExtraUsageSection, {
3078
+ extraUsage: utilization.extra_usage,
3079
+ maxWidth
3080
+ }, undefined, false, undefined, this),
3081
+ isEligibleForOverageCreditGrant() && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(OverageCreditUpsell, {
3082
+ maxWidth
3083
+ }, undefined, false, undefined, this),
3084
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3085
+ dimColor: true,
3086
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
3087
+ action: "confirm:no",
3088
+ context: "Settings",
3089
+ fallback: "Esc",
3090
+ description: "cancel"
3091
+ }, undefined, false, undefined, this)
3092
+ }, undefined, false, undefined, this)
3093
+ ]
3094
+ }, undefined, true, undefined, this);
3095
+ }
3096
+ function ExtraUsageSection(t0) {
3097
+ const $ = import_compiler_runtime6.c(20);
3098
+ const {
3099
+ extraUsage: extraUsage2,
3100
+ maxWidth
3101
+ } = t0;
3102
+ const subscriptionType = getSubscriptionType();
3103
+ const isProOrMax = subscriptionType === "pro" || subscriptionType === "max";
3104
+ if (!isProOrMax) {
3105
+ return false;
3106
+ }
3107
+ if (!extraUsage2.is_enabled) {
3108
+ if (extraUsage.isEnabled()) {
3109
+ let t12;
3110
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
3111
+ t12 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
3112
+ flexDirection: "column",
3113
+ children: [
3114
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3115
+ bold: true,
3116
+ children: EXTRA_USAGE_SECTION_TITLE
3117
+ }, undefined, false, undefined, this),
3118
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3119
+ dimColor: true,
3120
+ children: "Extra usage not enabled \xB7 /extra-usage to enable"
3121
+ }, undefined, false, undefined, this)
3122
+ ]
3123
+ }, undefined, true, undefined, this);
3124
+ $[0] = t12;
3125
+ } else {
3126
+ t12 = $[0];
3127
+ }
3128
+ return t12;
3129
+ }
3130
+ return null;
3131
+ }
3132
+ if (extraUsage2.monthly_limit === null) {
3133
+ let t12;
3134
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
3135
+ t12 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
3136
+ flexDirection: "column",
3137
+ children: [
3138
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3139
+ bold: true,
3140
+ children: EXTRA_USAGE_SECTION_TITLE
3141
+ }, undefined, false, undefined, this),
3142
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
3143
+ dimColor: true,
3144
+ children: "Unlimited"
3145
+ }, undefined, false, undefined, this)
3146
+ ]
3147
+ }, undefined, true, undefined, this);
3148
+ $[1] = t12;
3149
+ } else {
3150
+ t12 = $[1];
3151
+ }
3152
+ return t12;
3153
+ }
3154
+ if (typeof extraUsage2.used_credits !== "number" || typeof extraUsage2.utilization !== "number") {
3155
+ return null;
3156
+ }
3157
+ const t1 = extraUsage2.used_credits / 100;
3158
+ let t2;
3159
+ if ($[2] !== t1) {
3160
+ t2 = formatCost(t1, 2);
3161
+ $[2] = t1;
3162
+ $[3] = t2;
3163
+ } else {
3164
+ t2 = $[3];
3165
+ }
3166
+ const formattedUsedCredits = t2;
3167
+ const t3 = extraUsage2.monthly_limit / 100;
3168
+ let t4;
3169
+ if ($[4] !== t3) {
3170
+ t4 = formatCost(t3, 2);
3171
+ $[4] = t3;
3172
+ $[5] = t4;
3173
+ } else {
3174
+ t4 = $[5];
3175
+ }
3176
+ const formattedMonthlyLimit = t4;
3177
+ let T0;
3178
+ let t5;
3179
+ let t6;
3180
+ let t7;
3181
+ if ($[6] !== extraUsage2.utilization) {
3182
+ const now = new Date;
3183
+ const oneMonthReset = new Date(now.getFullYear(), now.getMonth() + 1, 1);
3184
+ T0 = LimitBar;
3185
+ t7 = EXTRA_USAGE_SECTION_TITLE;
3186
+ t5 = extraUsage2.utilization;
3187
+ t6 = oneMonthReset.toISOString();
3188
+ $[6] = extraUsage2.utilization;
3189
+ $[7] = T0;
3190
+ $[8] = t5;
3191
+ $[9] = t6;
3192
+ $[10] = t7;
3193
+ } else {
3194
+ T0 = $[7];
3195
+ t5 = $[8];
3196
+ t6 = $[9];
3197
+ t7 = $[10];
3198
+ }
3199
+ let t8;
3200
+ if ($[11] !== t5 || $[12] !== t6) {
3201
+ t8 = {
3202
+ utilization: t5,
3203
+ resets_at: t6
3204
+ };
3205
+ $[11] = t5;
3206
+ $[12] = t6;
3207
+ $[13] = t8;
3208
+ } else {
3209
+ t8 = $[13];
3210
+ }
3211
+ const t9 = `${formattedUsedCredits} / ${formattedMonthlyLimit} spent`;
3212
+ let t10;
3213
+ if ($[14] !== T0 || $[15] !== maxWidth || $[16] !== t7 || $[17] !== t8 || $[18] !== t9) {
3214
+ t10 = /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(T0, {
3215
+ title: t7,
3216
+ limit: t8,
3217
+ showTimeInReset: false,
3218
+ extraSubtext: t9,
3219
+ maxWidth
3220
+ }, undefined, false, undefined, this);
3221
+ $[14] = T0;
3222
+ $[15] = maxWidth;
3223
+ $[16] = t7;
3224
+ $[17] = t8;
3225
+ $[18] = t9;
3226
+ $[19] = t10;
3227
+ } else {
3228
+ t10 = $[19];
3229
+ }
3230
+ return t10;
3231
+ }
3232
+ var import_compiler_runtime6, React3, import_react5, jsx_dev_runtime6, EXTRA_USAGE_SECTION_TITLE = "Extra usage";
3233
+ var init_Usage = __esm(() => {
3234
+ init_extra_usage();
3235
+ init_cost_tracker();
3236
+ init_auth();
3237
+ init_useTerminalSize();
3238
+ init_ink();
3239
+ init_useKeybinding();
3240
+ init_usage();
3241
+ init_format();
3242
+ init_log();
3243
+ init_slowOperations();
3244
+ init_ConfigurableShortcutHint();
3245
+ init_Byline();
3246
+ init_ProgressBar();
3247
+ init_OverageCreditUpsell();
3248
+ import_compiler_runtime6 = __toESM(require_compiler_runtime(), 1);
3249
+ React3 = __toESM(require_react(), 1);
3250
+ import_react5 = __toESM(require_react(), 1);
3251
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
3252
+ });
3253
+
3254
+ // src/components/Settings/Settings.tsx
3255
+ function Settings(t0) {
3256
+ const $ = import_compiler_runtime7.c(25);
3257
+ const {
3258
+ onClose,
3259
+ context,
3260
+ defaultTab
3261
+ } = t0;
3262
+ const [selectedTab, setSelectedTab] = import_react6.useState(defaultTab);
3263
+ const [tabsHidden, setTabsHidden] = import_react6.useState(false);
3264
+ const [configOwnsEsc, setConfigOwnsEsc] = import_react6.useState(false);
3265
+ const [gatesOwnsEsc, setGatesOwnsEsc] = import_react6.useState(false);
3266
+ const insideModal = useIsInsideModal();
3267
+ const {
3268
+ rows
3269
+ } = useModalOrTerminalSize(useTerminalSize());
3270
+ const contentHeight = insideModal ? rows + 1 : Math.max(15, Math.min(Math.floor(rows * 0.8), 30));
3271
+ const [diagnosticsPromise] = import_react6.useState(_temp22);
3272
+ useExitOnCtrlCDWithKeybindings();
3273
+ let t1;
3274
+ if ($[0] !== onClose || $[1] !== tabsHidden) {
3275
+ t1 = () => {
3276
+ if (tabsHidden) {
3277
+ return;
3278
+ }
3279
+ onClose("Status dialog dismissed", {
3280
+ display: "system"
3281
+ });
3282
+ };
3283
+ $[0] = onClose;
3284
+ $[1] = tabsHidden;
3285
+ $[2] = t1;
3286
+ } else {
3287
+ t1 = $[2];
3288
+ }
3289
+ const handleEscape = t1;
3290
+ const t2 = !tabsHidden && !(selectedTab === "Config" && configOwnsEsc) && !(selectedTab === "Gates" && gatesOwnsEsc);
3291
+ let t3;
3292
+ if ($[3] !== t2) {
3293
+ t3 = {
3294
+ context: "Settings",
3295
+ isActive: t2
3296
+ };
3297
+ $[3] = t2;
3298
+ $[4] = t3;
3299
+ } else {
3300
+ t3 = $[4];
3301
+ }
3302
+ useKeybinding("confirm:no", handleEscape, t3);
3303
+ let t4;
3304
+ if ($[5] !== context || $[6] !== diagnosticsPromise) {
3305
+ t4 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
3306
+ title: "Status",
3307
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Status, {
3308
+ context,
3309
+ diagnosticsPromise
3310
+ }, undefined, false, undefined, this)
3311
+ }, "status", false, undefined, this);
3312
+ $[5] = context;
3313
+ $[6] = diagnosticsPromise;
3314
+ $[7] = t4;
3315
+ } else {
3316
+ t4 = $[7];
3317
+ }
3318
+ let t5;
3319
+ if ($[8] !== contentHeight || $[9] !== context || $[10] !== onClose) {
3320
+ t5 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
3321
+ title: "Config",
3322
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_react6.Suspense, {
3323
+ fallback: null,
3324
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Config, {
3325
+ context,
3326
+ onClose,
3327
+ setTabsHidden,
3328
+ onIsSearchModeChange: setConfigOwnsEsc,
3329
+ contentHeight
3330
+ }, undefined, false, undefined, this)
3331
+ }, undefined, false, undefined, this)
3332
+ }, "config", false, undefined, this);
3333
+ $[8] = contentHeight;
3334
+ $[9] = context;
3335
+ $[10] = onClose;
3336
+ $[11] = t5;
3337
+ } else {
3338
+ t5 = $[11];
3339
+ }
3340
+ let t6;
3341
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
3342
+ t6 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
3343
+ title: "Usage",
3344
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Usage, {}, undefined, false, undefined, this)
3345
+ }, "usage", false, undefined, this);
3346
+ $[12] = t6;
3347
+ } else {
3348
+ t6 = $[12];
3349
+ }
3350
+ let t7;
3351
+ if ($[13] !== contentHeight) {
3352
+ t7 = [];
3353
+ $[13] = contentHeight;
3354
+ $[14] = t7;
3355
+ } else {
3356
+ t7 = $[14];
3357
+ }
3358
+ let t8;
3359
+ if ($[15] !== t4 || $[16] !== t5 || $[17] !== t7) {
3360
+ t8 = [t4, t5, t6, ...t7];
3361
+ $[15] = t4;
3362
+ $[16] = t5;
3363
+ $[17] = t7;
3364
+ $[18] = t8;
3365
+ } else {
3366
+ t8 = $[18];
3367
+ }
3368
+ const tabs = t8;
3369
+ const t9 = defaultTab !== "Config" && defaultTab !== "Gates";
3370
+ const t10 = tabsHidden || insideModal ? undefined : contentHeight;
3371
+ let t11;
3372
+ if ($[19] !== selectedTab || $[20] !== t10 || $[21] !== t9 || $[22] !== tabs || $[23] !== tabsHidden) {
3373
+ t11 = /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Pane, {
3374
+ color: "permission",
3375
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tabs, {
3376
+ color: "permission",
3377
+ selectedTab,
3378
+ onTabChange: setSelectedTab,
3379
+ hidden: tabsHidden,
3380
+ initialHeaderFocused: t9,
3381
+ contentHeight: t10,
3382
+ children: tabs
3383
+ }, undefined, false, undefined, this)
3384
+ }, undefined, false, undefined, this);
3385
+ $[19] = selectedTab;
3386
+ $[20] = t10;
3387
+ $[21] = t9;
3388
+ $[22] = tabs;
3389
+ $[23] = tabsHidden;
3390
+ $[24] = t11;
3391
+ } else {
3392
+ t11 = $[24];
3393
+ }
3394
+ return t11;
3395
+ }
3396
+ function _temp22() {
3397
+ return buildDiagnostics().catch(_temp6);
3398
+ }
3399
+ function _temp6() {
3400
+ return [];
3401
+ }
3402
+ var import_compiler_runtime7, import_react6, jsx_dev_runtime7;
3403
+ var init_Settings = __esm(() => {
3404
+ init_useKeybinding();
3405
+ init_useExitOnCtrlCDWithKeybindings();
3406
+ init_useTerminalSize();
3407
+ init_modalContext();
3408
+ init_Pane();
3409
+ init_Tabs();
3410
+ init_Status();
3411
+ init_Config();
3412
+ init_Usage();
3413
+ import_compiler_runtime7 = __toESM(require_compiler_runtime(), 1);
3414
+ import_react6 = __toESM(require_react(), 1);
3415
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
3416
+ });
3417
+
3418
+ export { Settings, init_Settings };