@redscope-ai/redscope 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (619) hide show
  1. package/README.md +224 -0
  2. package/dist/chunk-090920rk.js +288 -0
  3. package/dist/chunk-0afb2r78.js +141 -0
  4. package/dist/chunk-0d4ekx1g.js +73 -0
  5. package/dist/chunk-0g6nwbhq.js +15 -0
  6. package/dist/chunk-0qj905nt.js +18 -0
  7. package/dist/chunk-0s5btnn1.js +186 -0
  8. package/dist/chunk-0s8fars0.js +91 -0
  9. package/dist/chunk-10ev3dvh.js +312 -0
  10. package/dist/chunk-10k5jfc5.js +1295 -0
  11. package/dist/chunk-12tspwqa.js +240 -0
  12. package/dist/chunk-13qesvnw.js +17 -0
  13. package/dist/chunk-143eh1e0.js +121 -0
  14. package/dist/chunk-14p6wvsq.js +39 -0
  15. package/dist/chunk-19f3zb1m.js +342 -0
  16. package/dist/chunk-1a5cep8h.js +145 -0
  17. package/dist/chunk-1abw9kkn.js +34 -0
  18. package/dist/chunk-1aer7c78.js +118 -0
  19. package/dist/chunk-1dazz4g6.js +154 -0
  20. package/dist/chunk-1fcf4ty1.js +142 -0
  21. package/dist/chunk-1gnxhyf8.js +62 -0
  22. package/dist/chunk-1he3944e.js +8124 -0
  23. package/dist/chunk-1jpayz7y.js +952 -0
  24. package/dist/chunk-1qd6f6vk.js +269 -0
  25. package/dist/chunk-1v0kpe62.js +2547 -0
  26. package/dist/chunk-1w20m7gw.js +445 -0
  27. package/dist/chunk-1y7kp51j.js +72 -0
  28. package/dist/chunk-1ycb5sxt.js +247 -0
  29. package/dist/chunk-1zbwhcbt.js +1124 -0
  30. package/dist/chunk-20psem54.js +116 -0
  31. package/dist/chunk-23h69r5b.js +30 -0
  32. package/dist/chunk-23x86ptv.js +473 -0
  33. package/dist/chunk-24fyv3jz.js +378 -0
  34. package/dist/chunk-24kv69g3.js +97 -0
  35. package/dist/chunk-2azx8zsc.js +125 -0
  36. package/dist/chunk-2d1gwzz9.js +524 -0
  37. package/dist/chunk-2g0ytd9d.js +29058 -0
  38. package/dist/chunk-2hfp9kat.js +21 -0
  39. package/dist/chunk-2j875eq6.js +37 -0
  40. package/dist/chunk-2kcgxnvp.js +39 -0
  41. package/dist/chunk-2kz09j2s.js +23 -0
  42. package/dist/chunk-2mwnwp0n.js +17 -0
  43. package/dist/chunk-2p1cqhcn.js +921 -0
  44. package/dist/chunk-2p369q9z.js +61 -0
  45. package/dist/chunk-2rf6asgf.js +151 -0
  46. package/dist/chunk-2vr7mqx1.js +384 -0
  47. package/dist/chunk-2xcg933e.js +205 -0
  48. package/dist/chunk-2ypwckbz.js +40310 -0
  49. package/dist/chunk-30wnahyg.js +626 -0
  50. package/dist/chunk-326zehp8.js +204 -0
  51. package/dist/chunk-32s6jzgw.js +183 -0
  52. package/dist/chunk-35yzt1a7.js +202 -0
  53. package/dist/chunk-38frkej6.js +62 -0
  54. package/dist/chunk-3abaq08g.js +34 -0
  55. package/dist/chunk-3h59ttr5.js +32 -0
  56. package/dist/chunk-3nk9q8dr.js +154 -0
  57. package/dist/chunk-3prrxevm.js +224 -0
  58. package/dist/chunk-3tv8p9xw.js +127 -0
  59. package/dist/chunk-3txyekes.js +19 -0
  60. package/dist/chunk-3vfxjn7g.js +19 -0
  61. package/dist/chunk-3w9sye8h.js +81 -0
  62. package/dist/chunk-3y69j7y8.js +24 -0
  63. package/dist/chunk-3zwjpkjh.js +1603 -0
  64. package/dist/chunk-40t1d75v.js +3442 -0
  65. package/dist/chunk-470kmby4.js +318 -0
  66. package/dist/chunk-47jc141z.js +335 -0
  67. package/dist/chunk-48rz50ct.js +868 -0
  68. package/dist/chunk-49wv03ts.js +232 -0
  69. package/dist/chunk-4a189mn2.js +103 -0
  70. package/dist/chunk-4c4fmh7a.js +15 -0
  71. package/dist/chunk-4ct8dsj5.js +49 -0
  72. package/dist/chunk-4kqt1pm1.js +100 -0
  73. package/dist/chunk-4ng0xy0e.js +802 -0
  74. package/dist/chunk-4spgkgr3.js +43 -0
  75. package/dist/chunk-4tjdwtyy.js +19 -0
  76. package/dist/chunk-4tr60273.js +370 -0
  77. package/dist/chunk-4vnaeng5.js +29 -0
  78. package/dist/chunk-4wbqpeaw.js +871 -0
  79. package/dist/chunk-4wgkv3fv.js +1140 -0
  80. package/dist/chunk-4yjskjb6.js +40 -0
  81. package/dist/chunk-50m3a23z.js +35 -0
  82. package/dist/chunk-511f79az.js +182 -0
  83. package/dist/chunk-51sgztvv.js +161 -0
  84. package/dist/chunk-563fcpv1.js +290 -0
  85. package/dist/chunk-564cnq6v.js +735 -0
  86. package/dist/chunk-569r8cxc.js +31 -0
  87. package/dist/chunk-570x55d4.js +12 -0
  88. package/dist/chunk-571556cm.js +80 -0
  89. package/dist/chunk-59t4c56e.js +63 -0
  90. package/dist/chunk-5axjhkma.js +36 -0
  91. package/dist/chunk-5b188q5e.js +157 -0
  92. package/dist/chunk-5dmn1865.js +439 -0
  93. package/dist/chunk-5ks4829r.js +267 -0
  94. package/dist/chunk-5mmhfbxb.js +1078 -0
  95. package/dist/chunk-5rdt14hy.js +742 -0
  96. package/dist/chunk-5ssryexj.js +121 -0
  97. package/dist/chunk-5v95pnq4.js +15 -0
  98. package/dist/chunk-5xvjt2t9.js +68 -0
  99. package/dist/chunk-5zyq6t1q.js +118 -0
  100. package/dist/chunk-60fkafk2.js +15 -0
  101. package/dist/chunk-62fjkf5q.js +46 -0
  102. package/dist/chunk-64gazrrb.js +8067 -0
  103. package/dist/chunk-65tq2yjx.js +126 -0
  104. package/dist/chunk-65zbgg1n.js +14 -0
  105. package/dist/chunk-66v8mty3.js +264 -0
  106. package/dist/chunk-6acx5heq.js +292 -0
  107. package/dist/chunk-6hr7742d.js +61 -0
  108. package/dist/chunk-6hygvrhn.js +143 -0
  109. package/dist/chunk-6kjh280m.js +128 -0
  110. package/dist/chunk-6s0q1s5r.js +66 -0
  111. package/dist/chunk-6x35ffpx.js +690 -0
  112. package/dist/chunk-71jfy1hh.js +570 -0
  113. package/dist/chunk-71sdcaq6.js +15 -0
  114. package/dist/chunk-754qdxs5.js +92 -0
  115. package/dist/chunk-79v5bkj4.js +1176 -0
  116. package/dist/chunk-7br0w7j5.js +151 -0
  117. package/dist/chunk-7cjgrzz1.js +298 -0
  118. package/dist/chunk-7d41ks0y.js +133 -0
  119. package/dist/chunk-7f40pmtr.js +71 -0
  120. package/dist/chunk-7g15x8hm.js +131 -0
  121. package/dist/chunk-7gtnzdet.js +120 -0
  122. package/dist/chunk-7h0z4aqx.js +702 -0
  123. package/dist/chunk-7h7e5a7d.js +25 -0
  124. package/dist/chunk-7m2cznwr.js +40 -0
  125. package/dist/chunk-7nvday0n.js +252 -0
  126. package/dist/chunk-7qey87th.js +145 -0
  127. package/dist/chunk-7qx3xhv3.js +9076 -0
  128. package/dist/chunk-7tfdhkpy.js +61 -0
  129. package/dist/chunk-80m511j6.js +121 -0
  130. package/dist/chunk-80ysxfe9.js +784 -0
  131. package/dist/chunk-8375zk8t.js +17200 -0
  132. package/dist/chunk-85bpkyy9.js +412 -0
  133. package/dist/chunk-85tcn547.js +876 -0
  134. package/dist/chunk-85vqgbc8.js +13 -0
  135. package/dist/chunk-86626jb4.js +49 -0
  136. package/dist/chunk-87ms17f6.js +444 -0
  137. package/dist/chunk-87mz239c.js +118 -0
  138. package/dist/chunk-89vdzt4e.js +254 -0
  139. package/dist/chunk-89z3e99z.js +159 -0
  140. package/dist/chunk-8cwrz1dd.js +1806 -0
  141. package/dist/chunk-8gv2pjby.js +21 -0
  142. package/dist/chunk-8hdevr3s.js +140 -0
  143. package/dist/chunk-8hdsk6qc.js +710 -0
  144. package/dist/chunk-8kct9arg.js +724 -0
  145. package/dist/chunk-8kf8h7xf.js +23 -0
  146. package/dist/chunk-8qed8ymj.js +605 -0
  147. package/dist/chunk-8sdgr592.js +101 -0
  148. package/dist/chunk-8we9w8pw.js +111 -0
  149. package/dist/chunk-8xnm5637.js +72 -0
  150. package/dist/chunk-8y3q0eqy.js +67 -0
  151. package/dist/chunk-8yvsnrkr.js +3449 -0
  152. package/dist/chunk-8zz4z1q3.js +42 -0
  153. package/dist/chunk-90eyff3k.js +119 -0
  154. package/dist/chunk-92bjkrf2.js +121 -0
  155. package/dist/chunk-92zrc7c6.js +327 -0
  156. package/dist/chunk-935nrvdb.js +13 -0
  157. package/dist/chunk-94pfyv6a.js +48 -0
  158. package/dist/chunk-9568p8se.js +115 -0
  159. package/dist/chunk-96km1ywr.js +37 -0
  160. package/dist/chunk-980bg4w4.js +163 -0
  161. package/dist/chunk-9a9g5hbj.js +205 -0
  162. package/dist/chunk-9cm4725d.js +4395 -0
  163. package/dist/chunk-9ds3vzq8.js +847 -0
  164. package/dist/chunk-9ffc9n60.js +618 -0
  165. package/dist/chunk-9fstrwv2.js +184 -0
  166. package/dist/chunk-9gt0g0qe.js +153 -0
  167. package/dist/chunk-9h9k5vz3.js +2761 -0
  168. package/dist/chunk-9he8bmhy.js +17 -0
  169. package/dist/chunk-9hn8e6h1.js +12 -0
  170. package/dist/chunk-9j0n3g8e.js +179 -0
  171. package/dist/chunk-9j6pa3ft.js +251 -0
  172. package/dist/chunk-9jpg9dn7.js +122 -0
  173. package/dist/chunk-9mycnwj5.js +46 -0
  174. package/dist/chunk-9npy2c17.js +517 -0
  175. package/dist/chunk-9p6sec8n.js +34 -0
  176. package/dist/chunk-9pnym83h.js +4584 -0
  177. package/dist/chunk-9skwrnd2.js +25 -0
  178. package/dist/chunk-9tsfaqr8.js +459 -0
  179. package/dist/chunk-9tsw3cqv.js +5924 -0
  180. package/dist/chunk-9w6ckyk4.js +49 -0
  181. package/dist/chunk-a15bwzv6.js +147 -0
  182. package/dist/chunk-a9t6cp69.js +28 -0
  183. package/dist/chunk-ad2yk19p.js +102 -0
  184. package/dist/chunk-ad4cw4nw.js +336 -0
  185. package/dist/chunk-ad69fbsk.js +347 -0
  186. package/dist/chunk-ae76ded0.js +30 -0
  187. package/dist/chunk-aeysytks.js +216 -0
  188. package/dist/chunk-ag81m9bq.js +61 -0
  189. package/dist/chunk-ahx7gp6r.js +4448 -0
  190. package/dist/chunk-aj4tk4tk.js +23 -0
  191. package/dist/chunk-an82t9jc.js +104 -0
  192. package/dist/chunk-apg95qd7.js +1393 -0
  193. package/dist/chunk-aq5n2adz.js +27 -0
  194. package/dist/chunk-aw4s3a99.js +208 -0
  195. package/dist/chunk-awgdfggg.js +14 -0
  196. package/dist/chunk-ayymxgn1.js +164 -0
  197. package/dist/chunk-azbab59e.js +637 -0
  198. package/dist/chunk-azdxq2a3.js +293 -0
  199. package/dist/chunk-b0tjx3k1.js +523 -0
  200. package/dist/chunk-b5pp4g2g.js +371 -0
  201. package/dist/chunk-b5zm8dt6.js +26 -0
  202. package/dist/chunk-bcnye5a0.js +109 -0
  203. package/dist/chunk-beqz3k49.js +190 -0
  204. package/dist/chunk-bf906wpw.js +147 -0
  205. package/dist/chunk-bgan4cpf.js +13 -0
  206. package/dist/chunk-bhzp13h7.js +1178 -0
  207. package/dist/chunk-bk403kpw.js +142 -0
  208. package/dist/chunk-bmq4c135.js +489 -0
  209. package/dist/chunk-bprbeda7.js +35 -0
  210. package/dist/chunk-bst7czdd.js +888 -0
  211. package/dist/chunk-bths4xgn.js +111 -0
  212. package/dist/chunk-btjn3qby.js +13 -0
  213. package/dist/chunk-bwb1vxnt.js +120 -0
  214. package/dist/chunk-bxa6tw4m.js +643 -0
  215. package/dist/chunk-bxfjr8qb.js +27 -0
  216. package/dist/chunk-bxpzhrej.js +73 -0
  217. package/dist/chunk-bzyzrq0k.js +51 -0
  218. package/dist/chunk-c0k7b0jw.js +4265 -0
  219. package/dist/chunk-c17f0h2s.js +16 -0
  220. package/dist/chunk-c1yc761e.js +6748 -0
  221. package/dist/chunk-c5g9shkw.js +298 -0
  222. package/dist/chunk-c696122m.js +69 -0
  223. package/dist/chunk-c92b3yxx.js +109 -0
  224. package/dist/chunk-c9aqz56y.js +143 -0
  225. package/dist/chunk-cba7c5w3.js +345 -0
  226. package/dist/chunk-cbcxbbe6.js +6543 -0
  227. package/dist/chunk-cdfjb87h.js +11 -0
  228. package/dist/chunk-ce8zjt1y.js +136 -0
  229. package/dist/chunk-cep7e37k.js +22740 -0
  230. package/dist/chunk-chs5qm8d.js +258 -0
  231. package/dist/chunk-ckydq33g.js +144 -0
  232. package/dist/chunk-cnge6wpj.js +514 -0
  233. package/dist/chunk-cpnsvqf1.js +13 -0
  234. package/dist/chunk-cqqebkv4.js +32 -0
  235. package/dist/chunk-cvqpp7dk.js +627 -0
  236. package/dist/chunk-cwc33j40.js +65 -0
  237. package/dist/chunk-cypvrq2a.js +155 -0
  238. package/dist/chunk-d1ha0swn.js +475 -0
  239. package/dist/chunk-d2an0138.js +35 -0
  240. package/dist/chunk-d2tt72ck.js +343 -0
  241. package/dist/chunk-d6wvcqrw.js +9507 -0
  242. package/dist/chunk-d7ys2kka.js +991 -0
  243. package/dist/chunk-dbts5q5p.js +122 -0
  244. package/dist/chunk-dct29ggs.js +295 -0
  245. package/dist/chunk-de0qnnf7.js +1059 -0
  246. package/dist/chunk-dep72ce4.js +513 -0
  247. package/dist/chunk-dgpvgy8x.js +47 -0
  248. package/dist/chunk-dhhd7dtc.js +20 -0
  249. package/dist/chunk-dhzpmxv6.js +594 -0
  250. package/dist/chunk-djes4da7.js +413 -0
  251. package/dist/chunk-dnhv3vx7.js +166 -0
  252. package/dist/chunk-dqtvafan.js +2365 -0
  253. package/dist/chunk-dr4a3tcp.js +60 -0
  254. package/dist/chunk-dz2xk9kb.js +100 -0
  255. package/dist/chunk-dz7nc6rf.js +15 -0
  256. package/dist/chunk-e3abfxpy.js +1486 -0
  257. package/dist/chunk-e3cq9z89.js +85 -0
  258. package/dist/chunk-e3j7m7k2.js +642 -0
  259. package/dist/chunk-e4dsy4g1.js +9951 -0
  260. package/dist/chunk-e5592pnn.js +197 -0
  261. package/dist/chunk-e55hdegh.js +129 -0
  262. package/dist/chunk-e5r5r04e.js +1030 -0
  263. package/dist/chunk-e60zztbt.js +442 -0
  264. package/dist/chunk-e7qq6vn0.js +372 -0
  265. package/dist/chunk-e9aat7xw.js +80 -0
  266. package/dist/chunk-e9d5v3zs.js +143 -0
  267. package/dist/chunk-eax32zk4.js +87 -0
  268. package/dist/chunk-ebfwmbx1.js +117 -0
  269. package/dist/chunk-ec71pb8t.js +971 -0
  270. package/dist/chunk-eemjb825.js +17252 -0
  271. package/dist/chunk-ees8xdhd.js +256 -0
  272. package/dist/chunk-eewg66y1.js +112 -0
  273. package/dist/chunk-eg22v12d.js +266 -0
  274. package/dist/chunk-enzzk67f.js +313 -0
  275. package/dist/chunk-eskhp70f.js +117 -0
  276. package/dist/chunk-ewx6z4g8.js +55 -0
  277. package/dist/chunk-eyvx461k.js +76 -0
  278. package/dist/chunk-eztq2b5f.js +94 -0
  279. package/dist/chunk-f0ffwzdd.js +321 -0
  280. package/dist/chunk-f80n68mf.js +119 -0
  281. package/dist/chunk-fae2hjxp.js +99 -0
  282. package/dist/chunk-fbtfp370.js +60 -0
  283. package/dist/chunk-fc6ndtgf.js +94 -0
  284. package/dist/chunk-fdwabr8p.js +13870 -0
  285. package/dist/chunk-fejeqe61.js +785 -0
  286. package/dist/chunk-fh0d6mvk.js +168 -0
  287. package/dist/chunk-fh19zcaf.js +304 -0
  288. package/dist/chunk-fh8bd39r.js +186 -0
  289. package/dist/chunk-fj2ebbpn.js +33 -0
  290. package/dist/chunk-fjn632v7.js +194 -0
  291. package/dist/chunk-fncpkzs5.js +1389 -0
  292. package/dist/chunk-fpd1gpt8.js +332 -0
  293. package/dist/chunk-fq9snrnh.js +295 -0
  294. package/dist/chunk-fqcfzg3j.js +207 -0
  295. package/dist/chunk-ftt3vqj2.js +1919 -0
  296. package/dist/chunk-g06pm4n9.js +395 -0
  297. package/dist/chunk-g4m5pf4g.js +8 -0
  298. package/dist/chunk-g72h52y6.js +36 -0
  299. package/dist/chunk-g79ej71s.js +1627 -0
  300. package/dist/chunk-g7fwk59d.js +19 -0
  301. package/dist/chunk-g9jnkrtm.js +663 -0
  302. package/dist/chunk-g9vg5d7t.js +38 -0
  303. package/dist/chunk-ga1jkyqy.js +1636 -0
  304. package/dist/chunk-gaaap2nk.js +676 -0
  305. package/dist/chunk-gc6erq5q.js +483 -0
  306. package/dist/chunk-gjrcmf0a.js +752 -0
  307. package/dist/chunk-gmdy2w3z.js +238999 -0
  308. package/dist/chunk-gsz4yrrk.js +81 -0
  309. package/dist/chunk-gy47rjy8.js +3830 -0
  310. package/dist/chunk-h12a4f4x.js +11 -0
  311. package/dist/chunk-h1yratmg.js +725 -0
  312. package/dist/chunk-h9y0jnsy.js +155 -0
  313. package/dist/chunk-hbhs3mwy.js +133 -0
  314. package/dist/chunk-hbs8cmb4.js +8 -0
  315. package/dist/chunk-hdk0t1ht.js +940 -0
  316. package/dist/chunk-hef8dx4s.js +178 -0
  317. package/dist/chunk-hgsca8mt.js +381 -0
  318. package/dist/chunk-hhsxm2yr.js +67 -0
  319. package/dist/chunk-hj5tzzpd.js +39 -0
  320. package/dist/chunk-hjxqmtg5.js +94 -0
  321. package/dist/chunk-hn4w9pkj.js +68 -0
  322. package/dist/chunk-hnprkjgp.js +25 -0
  323. package/dist/chunk-hq3n5ex7.js +183 -0
  324. package/dist/chunk-hqjspfma.js +158 -0
  325. package/dist/chunk-hqxp6b72.js +1198 -0
  326. package/dist/chunk-hs6nrmq6.js +94 -0
  327. package/dist/chunk-hwba5xdc.js +267 -0
  328. package/dist/chunk-hy566ev3.js +430 -0
  329. package/dist/chunk-hzmzwte2.js +153 -0
  330. package/dist/chunk-hzxzvzw8.js +274 -0
  331. package/dist/chunk-j139fzgs.js +114 -0
  332. package/dist/chunk-j1mep9ck.js +62 -0
  333. package/dist/chunk-j3xveeg4.js +273 -0
  334. package/dist/chunk-j5y1s11j.js +100 -0
  335. package/dist/chunk-j9475b46.js +26 -0
  336. package/dist/chunk-j9rgqs8m.js +1192 -0
  337. package/dist/chunk-jccjaddz.js +74 -0
  338. package/dist/chunk-jdkwfy9e.js +35 -0
  339. package/dist/chunk-jdqp0r4h.js +6157 -0
  340. package/dist/chunk-jdzk4zwn.js +587 -0
  341. package/dist/chunk-jfafmkte.js +49 -0
  342. package/dist/chunk-jg3r989b.js +16 -0
  343. package/dist/chunk-jhtccjc9.js +54 -0
  344. package/dist/chunk-jj2ff1pr.js +688 -0
  345. package/dist/chunk-jmv7k0jn.js +37 -0
  346. package/dist/chunk-jmxzmwpw.js +65 -0
  347. package/dist/chunk-jnjxdqyr.js +353 -0
  348. package/dist/chunk-jsbbez9j.js +138 -0
  349. package/dist/chunk-jvpt2dc0.js +424 -0
  350. package/dist/chunk-jwd7cka0.js +34 -0
  351. package/dist/chunk-jy5er3st.js +15 -0
  352. package/dist/chunk-jyby79z5.js +121 -0
  353. package/dist/chunk-jzyr6j5n.js +332 -0
  354. package/dist/chunk-k49xc781.js +63 -0
  355. package/dist/chunk-k7dt2g4a.js +41 -0
  356. package/dist/chunk-k7hexw3v.js +969 -0
  357. package/dist/chunk-k7wwkraa.js +117 -0
  358. package/dist/chunk-kb3758f7.js +51 -0
  359. package/dist/chunk-kc67kt75.js +3119 -0
  360. package/dist/chunk-kdhmfxmh.js +3149 -0
  361. package/dist/chunk-kejdd6zc.js +51 -0
  362. package/dist/chunk-kekrjeem.js +402 -0
  363. package/dist/chunk-kez5r0zz.js +280 -0
  364. package/dist/chunk-kfsvcs5t.js +75 -0
  365. package/dist/chunk-khtvffc4.js +285 -0
  366. package/dist/chunk-kkz4w1tv.js +64 -0
  367. package/dist/chunk-kmywng0j.js +272 -0
  368. package/dist/chunk-kq6vcpdr.js +224 -0
  369. package/dist/chunk-kqzdszcc.js +37 -0
  370. package/dist/chunk-ktxpp02w.js +435 -0
  371. package/dist/chunk-kwcvhbtz.js +26 -0
  372. package/dist/chunk-kx0cm9qr.js +128 -0
  373. package/dist/chunk-kxcmqz10.js +120 -0
  374. package/dist/chunk-kxwava1g.js +14 -0
  375. package/dist/chunk-kywtr3jg.js +825 -0
  376. package/dist/chunk-kzwg923p.js +8 -0
  377. package/dist/chunk-m1eq3sgv.js +255 -0
  378. package/dist/chunk-m21h5zb4.js +119 -0
  379. package/dist/chunk-m2c3bjv1.js +111 -0
  380. package/dist/chunk-m41e19ms.js +42 -0
  381. package/dist/chunk-m7ka36ex.js +97 -0
  382. package/dist/chunk-m81w8tbm.js +259 -0
  383. package/dist/chunk-m95ggkax.js +281 -0
  384. package/dist/chunk-manx26xa.js +145 -0
  385. package/dist/chunk-mdxh3pk2.js +298 -0
  386. package/dist/chunk-mhbfkcja.js +311 -0
  387. package/dist/chunk-mjnr5erm.js +173 -0
  388. package/dist/chunk-mngvnmwp.js +135 -0
  389. package/dist/chunk-mvfqanv5.js +63 -0
  390. package/dist/chunk-mw1nesq1.js +140 -0
  391. package/dist/chunk-mx168925.js +661 -0
  392. package/dist/chunk-mxwvj18g.js +795 -0
  393. package/dist/chunk-my7r5mba.js +257 -0
  394. package/dist/chunk-myaa1kkf.js +17 -0
  395. package/dist/chunk-myypc3tn.js +46 -0
  396. package/dist/chunk-mzcnmnpq.js +3379 -0
  397. package/dist/chunk-mznav6d1.js +194 -0
  398. package/dist/chunk-n0qxskpr.js +24 -0
  399. package/dist/chunk-n6a6hgtp.js +394 -0
  400. package/dist/chunk-n6d5fgx0.js +254 -0
  401. package/dist/chunk-n6ym3n03.js +120 -0
  402. package/dist/chunk-n9g24mwe.js +104 -0
  403. package/dist/chunk-naamqdf9.js +185 -0
  404. package/dist/chunk-nb2jk7zj.js +15 -0
  405. package/dist/chunk-nbkbq9en.js +67 -0
  406. package/dist/chunk-ndttd6es.js +38 -0
  407. package/dist/chunk-nfygaaxg.js +133 -0
  408. package/dist/chunk-ngdzpszd.js +454 -0
  409. package/dist/chunk-nmfwksa4.js +1297 -0
  410. package/dist/chunk-nt837qt9.js +21 -0
  411. package/dist/chunk-nwc3v0vp.js +691 -0
  412. package/dist/chunk-nz8ha95p.js +3610 -0
  413. package/dist/chunk-nzxfj0gq.js +2007 -0
  414. package/dist/chunk-p0r8887g.js +6932 -0
  415. package/dist/chunk-p1seyqdm.js +120 -0
  416. package/dist/chunk-p425zbgw.js +726 -0
  417. package/dist/chunk-p7hamd2c.js +146 -0
  418. package/dist/chunk-pdvg91cg.js +32 -0
  419. package/dist/chunk-pecy49yr.js +14649 -0
  420. package/dist/chunk-pfxrg89f.js +547 -0
  421. package/dist/chunk-pfyw3155.js +2750 -0
  422. package/dist/chunk-pr8m11pm.js +1192 -0
  423. package/dist/chunk-ptxteaeh.js +1591 -0
  424. package/dist/chunk-pv164mac.js +394 -0
  425. package/dist/chunk-pxxhtxf5.js +10154 -0
  426. package/dist/chunk-q0e485mg.js +61 -0
  427. package/dist/chunk-q1vrhh0q.js +458 -0
  428. package/dist/chunk-q2h79ncs.js +370 -0
  429. package/dist/chunk-q3b4n194.js +56 -0
  430. package/dist/chunk-q44zc68f.js +4301 -0
  431. package/dist/chunk-q8gknbdx.js +352 -0
  432. package/dist/chunk-q8xk3kdj.js +11 -0
  433. package/dist/chunk-qak46xtp.js +119 -0
  434. package/dist/chunk-qfq7absv.js +95 -0
  435. package/dist/chunk-qfsn720k.js +151 -0
  436. package/dist/chunk-qg4811f6.js +228 -0
  437. package/dist/chunk-qgzn3qps.js +90 -0
  438. package/dist/chunk-qhaggqkt.js +113 -0
  439. package/dist/chunk-qjjp27z8.js +195 -0
  440. package/dist/chunk-qxp0nye6.js +34 -0
  441. package/dist/chunk-qy3nagaq.js +4957 -0
  442. package/dist/chunk-qz2meav1.js +1452 -0
  443. package/dist/chunk-r50hne7m.js +63 -0
  444. package/dist/chunk-r6m0vgnv.js +80 -0
  445. package/dist/chunk-r7yw38vf.js +22864 -0
  446. package/dist/chunk-r8xc618w.js +42 -0
  447. package/dist/chunk-r961r5kj.js +87 -0
  448. package/dist/chunk-r9b5xrh0.js +66 -0
  449. package/dist/chunk-rcn2pd6q.js +477 -0
  450. package/dist/chunk-rdeh8p3y.js +148 -0
  451. package/dist/chunk-rg9x1742.js +542 -0
  452. package/dist/chunk-rgyzsbs3.js +39 -0
  453. package/dist/chunk-rk2fsxtz.js +16 -0
  454. package/dist/chunk-rkchkwv9.js +40 -0
  455. package/dist/chunk-rp8whpb3.js +478 -0
  456. package/dist/chunk-rpkxdtgr.js +68 -0
  457. package/dist/chunk-rpmntgyh.js +394 -0
  458. package/dist/chunk-rpshz4dy.js +614 -0
  459. package/dist/chunk-rqd60ay5.js +133 -0
  460. package/dist/chunk-rrsjf2ea.js +229 -0
  461. package/dist/chunk-rtjk8c8e.js +173 -0
  462. package/dist/chunk-rw0y2wdf.js +1017 -0
  463. package/dist/chunk-rx5w7ess.js +663 -0
  464. package/dist/chunk-rx8t9d35.js +1947 -0
  465. package/dist/chunk-rxcazxgf.js +195 -0
  466. package/dist/chunk-rxg6q3bp.js +1413 -0
  467. package/dist/chunk-rxrb7xnd.js +71 -0
  468. package/dist/chunk-rxrzxff3.js +118 -0
  469. package/dist/chunk-ryqjc943.js +71 -0
  470. package/dist/chunk-rzk9k2rf.js +81 -0
  471. package/dist/chunk-s2qv0nht.js +119 -0
  472. package/dist/chunk-s3hafnk3.js +2285 -0
  473. package/dist/chunk-s4a496tt.js +226 -0
  474. package/dist/chunk-s4d1h3ka.js +35 -0
  475. package/dist/chunk-sm3k3ze4.js +16525 -0
  476. package/dist/chunk-sn0bja82.js +385 -0
  477. package/dist/chunk-sngjggw1.js +4227 -0
  478. package/dist/chunk-sq047n34.js +364 -0
  479. package/dist/chunk-sttwe2tw.js +8584 -0
  480. package/dist/chunk-sw8qx1r0.js +86 -0
  481. package/dist/chunk-swstah6a.js +240 -0
  482. package/dist/chunk-syrkr0mf.js +63 -0
  483. package/dist/chunk-sz206bd9.js +26 -0
  484. package/dist/chunk-t09669cj.js +333 -0
  485. package/dist/chunk-t5f8e30k.js +602 -0
  486. package/dist/chunk-t5m78mc8.js +432 -0
  487. package/dist/chunk-t5x1dqwn.js +143 -0
  488. package/dist/chunk-t877ea0w.js +168 -0
  489. package/dist/chunk-t91hb71c.js +17 -0
  490. package/dist/chunk-tb636bcf.js +942 -0
  491. package/dist/chunk-tb8sykbr.js +426 -0
  492. package/dist/chunk-tbdkekz3.js +125 -0
  493. package/dist/chunk-td2gsz7s.js +225 -0
  494. package/dist/chunk-tenvxbyh.js +20 -0
  495. package/dist/chunk-texg4qqt.js +317 -0
  496. package/dist/chunk-teymzz80.js +266 -0
  497. package/dist/chunk-tj26qpf7.js +153 -0
  498. package/dist/chunk-tk85ec4p.js +395 -0
  499. package/dist/chunk-tq205h01.js +164 -0
  500. package/dist/chunk-tqzddjzg.js +61 -0
  501. package/dist/chunk-trqrj23e.js +134 -0
  502. package/dist/chunk-tw1hfsxv.js +2477 -0
  503. package/dist/chunk-txxdfq83.js +122 -0
  504. package/dist/chunk-v0yhe582.js +31 -0
  505. package/dist/chunk-v14184xm.js +15 -0
  506. package/dist/chunk-v1h9z4hw.js +138 -0
  507. package/dist/chunk-v3ey5j7f.js +329 -0
  508. package/dist/chunk-v3nh1sfn.js +208 -0
  509. package/dist/chunk-v3x8tcc0.js +45 -0
  510. package/dist/chunk-v4nqnvqq.js +3984 -0
  511. package/dist/chunk-v4ypszbb.js +15 -0
  512. package/dist/chunk-v7wbqcx9.js +63 -0
  513. package/dist/chunk-v8r5fev3.js +341 -0
  514. package/dist/chunk-v9zg5kzx.js +2810 -0
  515. package/dist/chunk-va1wh5ss.js +24 -0
  516. package/dist/chunk-vbfswhht.js +42 -0
  517. package/dist/chunk-ve7x2tfq.js +124 -0
  518. package/dist/chunk-vfz8k89y.js +485 -0
  519. package/dist/chunk-vgm5k14x.js +35678 -0
  520. package/dist/chunk-vh9pej3c.js +247 -0
  521. package/dist/chunk-vjxqyt6f.js +3820 -0
  522. package/dist/chunk-vpb1xstn.js +178 -0
  523. package/dist/chunk-vqt79tj8.js +110 -0
  524. package/dist/chunk-vr0n9pv9.js +152 -0
  525. package/dist/chunk-vrejmja5.js +90 -0
  526. package/dist/chunk-vrxasmdw.js +449 -0
  527. package/dist/chunk-vrxb946v.js +125 -0
  528. package/dist/chunk-vv4kj0q8.js +98 -0
  529. package/dist/chunk-vvpfng7w.js +8 -0
  530. package/dist/chunk-vw6ybyew.js +2007 -0
  531. package/dist/chunk-vwenx8ke.js +17 -0
  532. package/dist/chunk-vwfa0s5a.js +155 -0
  533. package/dist/chunk-vx71j8xe.js +63 -0
  534. package/dist/chunk-vxbjzggp.js +43 -0
  535. package/dist/chunk-vxjxtz8w.js +440 -0
  536. package/dist/chunk-vy0c1bwp.js +9 -0
  537. package/dist/chunk-w3zczyse.js +14 -0
  538. package/dist/chunk-w4p5t920.js +655 -0
  539. package/dist/chunk-w68wc625.js +287 -0
  540. package/dist/chunk-w9ddp3yf.js +96 -0
  541. package/dist/chunk-wcggm5ja.js +125 -0
  542. package/dist/chunk-wgnyph3q.js +1306 -0
  543. package/dist/chunk-wjm5pc1e.js +134 -0
  544. package/dist/chunk-wnve0drm.js +131 -0
  545. package/dist/chunk-wp27ev2k.js +135 -0
  546. package/dist/chunk-wyvy8a4x.js +131 -0
  547. package/dist/chunk-x671y4dk.js +129 -0
  548. package/dist/chunk-xbj5keyy.js +22 -0
  549. package/dist/chunk-xf4fzms8.js +39 -0
  550. package/dist/chunk-xf59k3zg.js +65 -0
  551. package/dist/chunk-xgzc4w49.js +204 -0
  552. package/dist/chunk-xhj7g13b.js +2149 -0
  553. package/dist/chunk-xjp0cd00.js +56 -0
  554. package/dist/chunk-xkhnmhqs.js +74 -0
  555. package/dist/chunk-xkrkqx61.js +55 -0
  556. package/dist/chunk-xmpgmeb8.js +114 -0
  557. package/dist/chunk-xrw80zgd.js +4249 -0
  558. package/dist/chunk-xrzc96g0.js +202 -0
  559. package/dist/chunk-xt76sm44.js +318 -0
  560. package/dist/chunk-xwet3awb.js +20 -0
  561. package/dist/chunk-xyg1sk2w.js +78 -0
  562. package/dist/chunk-y0jpkqb0.js +180 -0
  563. package/dist/chunk-y1q7rt9n.js +102 -0
  564. package/dist/chunk-y67ntyek.js +258 -0
  565. package/dist/chunk-ybk37qp9.js +37 -0
  566. package/dist/chunk-yc1stfve.js +5386 -0
  567. package/dist/chunk-ychjpjef.js +62 -0
  568. package/dist/chunk-yez8fa9g.js +276 -0
  569. package/dist/chunk-ygm7xszr.js +90 -0
  570. package/dist/chunk-ym11azkj.js +37 -0
  571. package/dist/chunk-ympz2h15.js +578 -0
  572. package/dist/chunk-yqx3az3n.js +129 -0
  573. package/dist/chunk-yt3nfhcc.js +152 -0
  574. package/dist/chunk-yy8q0n8s.js +120 -0
  575. package/dist/chunk-yzb92zxv.js +8 -0
  576. package/dist/chunk-yzet6xyr.js +119 -0
  577. package/dist/chunk-yzm97qp1.js +226 -0
  578. package/dist/chunk-z0jgeax8.js +35 -0
  579. package/dist/chunk-z1r3z6w6.js +29 -0
  580. package/dist/chunk-z2dp53wn.js +17 -0
  581. package/dist/chunk-z79355gz.js +308 -0
  582. package/dist/chunk-z7e94hxz.js +251 -0
  583. package/dist/chunk-z8cqdcec.js +173 -0
  584. package/dist/chunk-z99tbg45.js +148 -0
  585. package/dist/chunk-z9nsjcht.js +37 -0
  586. package/dist/chunk-za3k6h2h.js +470 -0
  587. package/dist/chunk-zacynq5p.js +265 -0
  588. package/dist/chunk-zb0x40az.js +1785 -0
  589. package/dist/chunk-zbxtzycc.js +274 -0
  590. package/dist/chunk-zga50181.js +342 -0
  591. package/dist/chunk-zhb2pns1.js +44 -0
  592. package/dist/chunk-zkch6trx.js +231 -0
  593. package/dist/chunk-znf3z4qt.js +954 -0
  594. package/dist/chunk-zp8zwdgq.js +72 -0
  595. package/dist/chunk-ztjd8pyf.js +120 -0
  596. package/dist/chunk-ztmb7geg.js +173 -0
  597. package/dist/chunk-zvr4snzv.js +887 -0
  598. package/dist/chunk-zw62m6n3.js +34858 -0
  599. package/dist/chunk-zwwdebd0.js +65 -0
  600. package/dist/chunk-zxc6x9w8.js +340 -0
  601. package/dist/chunk-zy2e7sz0.js +8 -0
  602. package/dist/chunk-zzf074w3.js +196 -0
  603. package/dist/chunk-zzz0nwb5.js +310 -0
  604. package/dist/cli-bun.js +2 -0
  605. package/dist/cli-node.js +2 -0
  606. package/dist/cli.js +218 -0
  607. package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
  608. package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
  609. package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
  610. package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
  611. package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
  612. package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
  613. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  614. package/package.json +243 -0
  615. package/scripts/chrome-mcp-bridge-resolver.mjs +43 -0
  616. package/scripts/chrome-mcp-env.mjs +19 -0
  617. package/scripts/postinstall.cjs +339 -0
  618. package/scripts/run-parallel.mjs +10 -0
  619. package/scripts/setup-chrome-mcp.mjs +69 -0
@@ -0,0 +1,2810 @@
1
+ // @bun
2
+ import {
3
+ ClaudeMdExternalIncludesDialog,
4
+ init_ClaudeMdExternalIncludesDialog
5
+ } from "./chunk-ebfwmbx1.js";
6
+ import {
7
+ ModelPicker,
8
+ init_ModelPicker,
9
+ init_extraUsage,
10
+ isBilledAsExtraUsage
11
+ } from "./chunk-ngdzpszd.js";
12
+ import {
13
+ ThemePicker,
14
+ init_ThemePicker
15
+ } from "./chunk-66v8mty3.js";
16
+ import {
17
+ OverageCreditUpsell,
18
+ init_OverageCreditUpsell,
19
+ isEligibleForOverageCreditGrant
20
+ } from "./chunk-p7hamd2c.js";
21
+ import {
22
+ init_SearchBox
23
+ } from "./chunk-awgdfggg.js";
24
+ import {
25
+ init_useSearchInput,
26
+ useSearchInput
27
+ } from "./chunk-z79355gz.js";
28
+ import {
29
+ init_modalContext,
30
+ useIsInsideModal,
31
+ useModalOrTerminalSize
32
+ } from "./chunk-3y69j7y8.js";
33
+ import {
34
+ fetchUtilization,
35
+ init_usage
36
+ } from "./chunk-dr4a3tcp.js";
37
+ import {
38
+ ConfigurableShortcutHint,
39
+ DEFAULT_OUTPUT_STYLE_NAME,
40
+ OUTPUT_STYLE_CONFIG,
41
+ Select,
42
+ TextInput,
43
+ buildAPIProviderProperties,
44
+ buildAccountProperties,
45
+ buildIDEProperties,
46
+ buildInstallationDiagnostics,
47
+ buildInstallationHealthDiagnostics,
48
+ buildMcpProperties,
49
+ buildMemoryDiagnostics,
50
+ buildSandboxProperties,
51
+ buildSettingSourcesProperties,
52
+ exports_BriefTool,
53
+ extraUsage,
54
+ formatCost,
55
+ getAllOutputStyles,
56
+ getAutoModeEnabledState,
57
+ getCurrentSessionTitle,
58
+ getExternalClaudeMdIncludes,
59
+ getHardcodedTeammateModelFallback,
60
+ getMemoryFiles,
61
+ getModelDisplayLabel,
62
+ hasAccessToIDEExtensionDiffFeature,
63
+ hasAutoModeOptInAnySource,
64
+ hasExternalClaudeMdIncludes,
65
+ init_AppState,
66
+ init_BriefTool,
67
+ init_ConfigurableShortcutHint,
68
+ init_CustomSelect,
69
+ init_TextInput,
70
+ init_claudemd,
71
+ init_cost_tracker,
72
+ init_extra_usage,
73
+ init_fullscreen,
74
+ init_ide,
75
+ init_outputStyles,
76
+ init_permissionSetup,
77
+ init_select,
78
+ init_sessionStorage,
79
+ init_status,
80
+ init_teammateModel,
81
+ init_useTerminalSize,
82
+ isFullscreenEnvEnabled,
83
+ isSupportedTerminal,
84
+ transitionPlanAutoMode,
85
+ useAppState,
86
+ useAppStateStore,
87
+ useSetAppState
88
+ } from "./chunk-gmdy2w3z.js";
89
+ import {
90
+ clearCliTeammateModeOverride,
91
+ getCliTeammateModeOverride,
92
+ init_teammateModeSnapshot
93
+ } from "./chunk-q0e485mg.js";
94
+ import {
95
+ init_bridgeEnabled,
96
+ isBridgeEnabled
97
+ } from "./chunk-eewg66y1.js";
98
+ import {
99
+ init_useExitOnCtrlCDWithKeybindings,
100
+ useExitOnCtrlCDWithKeybindings
101
+ } from "./chunk-hzxzvzw8.js";
102
+ import {
103
+ init_useKeybinding
104
+ } from "./chunk-65zbgg1n.js";
105
+ import {
106
+ exports_poorMode,
107
+ init_poorMode
108
+ } from "./chunk-50m3a23z.js";
109
+ import {
110
+ FAST_MODE_MODEL_DISPLAY,
111
+ clearFastModeCooldown,
112
+ formatAutoUpdaterDisabledReason,
113
+ getAutoUpdaterDisabledReason,
114
+ getCurrentProjectConfig,
115
+ getFastModeModel,
116
+ getFeatureValue_CACHED_MAY_BE_STALE,
117
+ getGlobalConfig,
118
+ getInitialSettings,
119
+ getRemoteControlAtStartup,
120
+ getSettingsForSource,
121
+ getSubscriptionType,
122
+ init_PermissionMode,
123
+ init_agentSwarmsEnabled,
124
+ init_auth,
125
+ init_authPortable,
126
+ init_config1 as init_config,
127
+ init_fastMode,
128
+ init_growthbook,
129
+ init_model,
130
+ init_settings1 as init_settings,
131
+ isAgentSwarmsEnabled,
132
+ isExternalPermissionMode,
133
+ isFastModeAvailable,
134
+ isFastModeEnabled,
135
+ isFastModeSupportedByModel,
136
+ isOpus1mMergeEnabled,
137
+ modelDisplayString,
138
+ normalizeApiKeyForConfig,
139
+ permissionModeFromString,
140
+ permissionModeShortTitle,
141
+ saveGlobalConfig,
142
+ toExternalPermissionMode,
143
+ updateSettingsForSource
144
+ } from "./chunk-eemjb825.js";
145
+ import {
146
+ PERMISSION_MODES
147
+ } from "./chunk-8kf8h7xf.js";
148
+ import {
149
+ formatResetText,
150
+ init_format
151
+ } from "./chunk-q1vrhh0q.js";
152
+ import {
153
+ Byline,
154
+ Dialog,
155
+ KeyboardShortcutHint,
156
+ Pane,
157
+ ProgressBar,
158
+ SearchBox,
159
+ Tab,
160
+ Tabs,
161
+ ThemedBox_default,
162
+ ThemedText,
163
+ init_source,
164
+ init_src,
165
+ source_default,
166
+ useKeybinding,
167
+ useKeybindings,
168
+ useTabHeaderFocus,
169
+ useTerminalFocus,
170
+ useTerminalSize,
171
+ useTheme,
172
+ useThemeSetting
173
+ } from "./chunk-2g0ytd9d.js";
174
+ import {
175
+ require_jsx_dev_runtime,
176
+ require_react
177
+ } from "./chunk-de0qnnf7.js";
178
+ import {
179
+ init_analytics,
180
+ logEvent
181
+ } from "./chunk-j1mep9ck.js";
182
+ import {
183
+ getCwd,
184
+ init_cwd
185
+ } from "./chunk-pdvg91cg.js";
186
+ import {
187
+ figures_default,
188
+ init_figures
189
+ } from "./chunk-c5g9shkw.js";
190
+ import {
191
+ getPlatform,
192
+ init_envUtils,
193
+ init_log,
194
+ init_platform,
195
+ init_slowOperations,
196
+ isEnvTruthy,
197
+ isRunningOnHomespace,
198
+ jsonStringify,
199
+ logError
200
+ } from "./chunk-s3hafnk3.js";
201
+ import {
202
+ getSessionId,
203
+ getUserMsgOptIn,
204
+ init_state,
205
+ setUserMsgOptIn
206
+ } from "./chunk-9h9k5vz3.js";
207
+ import {
208
+ __esm,
209
+ __toCommonJS,
210
+ __toESM
211
+ } from "./chunk-hhsxm2yr.js";
212
+
213
+ // src/components/Settings/Status.tsx
214
+ function buildPrimarySection() {
215
+ const sessionId = getSessionId();
216
+ const customTitle = getCurrentSessionTitle(sessionId);
217
+ const nameValue = customTitle ?? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
218
+ dimColor: true,
219
+ children: "/rename to add a name"
220
+ }, undefined, false, undefined, this);
221
+ return [
222
+ { label: "Version", value: "1.0.0" },
223
+ { label: "Session name", value: nameValue },
224
+ { label: "Session ID", value: sessionId },
225
+ { label: "cwd", value: getCwd() },
226
+ ...buildAccountProperties(),
227
+ ...buildAPIProviderProperties()
228
+ ];
229
+ }
230
+ function buildSecondarySection({
231
+ mainLoopModel,
232
+ mcp,
233
+ theme,
234
+ context
235
+ }) {
236
+ const modelLabel = getModelDisplayLabel(mainLoopModel);
237
+ return [
238
+ { label: "Model", value: modelLabel },
239
+ ...buildIDEProperties(mcp.clients, context.options.ideInstallationStatus, theme),
240
+ ...buildMcpProperties(mcp.clients, theme),
241
+ ...buildSandboxProperties(),
242
+ ...buildSettingSourcesProperties()
243
+ ];
244
+ }
245
+ async function buildDiagnostics() {
246
+ return [
247
+ ...await buildInstallationDiagnostics(),
248
+ ...await buildInstallationHealthDiagnostics(),
249
+ ...await buildMemoryDiagnostics()
250
+ ];
251
+ }
252
+ function PropertyValue({
253
+ value
254
+ }) {
255
+ if (Array.isArray(value)) {
256
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
257
+ flexWrap: "wrap",
258
+ columnGap: 1,
259
+ flexShrink: 99,
260
+ children: value.map((item, i) => {
261
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
262
+ children: [
263
+ item,
264
+ i < value.length - 1 ? "," : ""
265
+ ]
266
+ }, i, true, undefined, this);
267
+ })
268
+ }, undefined, false, undefined, this);
269
+ }
270
+ if (typeof value === "string") {
271
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
272
+ children: value
273
+ }, undefined, false, undefined, this);
274
+ }
275
+ return value;
276
+ }
277
+ function Status({
278
+ context,
279
+ diagnosticsPromise
280
+ }) {
281
+ const mainLoopModel = useAppState((s) => s.mainLoopModel);
282
+ const mcp = useAppState((s) => s.mcp);
283
+ const [theme] = useTheme();
284
+ const sections = React.useMemo(() => [
285
+ buildPrimarySection(),
286
+ buildSecondarySection({ mainLoopModel, mcp, theme, context })
287
+ ], [mainLoopModel, mcp, theme, context]);
288
+ const grow = useIsInsideModal() ? 1 : undefined;
289
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
290
+ flexDirection: "column",
291
+ flexGrow: grow,
292
+ children: [
293
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
294
+ flexDirection: "column",
295
+ gap: 1,
296
+ flexGrow: grow,
297
+ children: [
298
+ sections.map((properties, i) => properties.length > 0 && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
299
+ flexDirection: "column",
300
+ children: properties.map(({ label, value }, j) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
301
+ flexDirection: "row",
302
+ gap: 1,
303
+ flexShrink: 0,
304
+ children: [
305
+ label !== undefined && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
306
+ bold: true,
307
+ children: [
308
+ label,
309
+ ":"
310
+ ]
311
+ }, undefined, true, undefined, this),
312
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(PropertyValue, {
313
+ value
314
+ }, undefined, false, undefined, this)
315
+ ]
316
+ }, j, true, undefined, this))
317
+ }, i, false, undefined, this)),
318
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(import_react.Suspense, {
319
+ fallback: null,
320
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Diagnostics, {
321
+ promise: diagnosticsPromise
322
+ }, undefined, false, undefined, this)
323
+ }, undefined, false, undefined, this)
324
+ ]
325
+ }, undefined, true, undefined, this),
326
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
327
+ dimColor: true,
328
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
329
+ action: "confirm:no",
330
+ context: "Settings",
331
+ fallback: "Esc",
332
+ description: "cancel"
333
+ }, undefined, false, undefined, this)
334
+ }, undefined, false, undefined, this)
335
+ ]
336
+ }, undefined, true, undefined, this);
337
+ }
338
+ function Diagnostics({
339
+ promise
340
+ }) {
341
+ const diagnostics = import_react.use(promise);
342
+ if (diagnostics.length === 0)
343
+ return null;
344
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
345
+ flexDirection: "column",
346
+ paddingBottom: 1,
347
+ children: [
348
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
349
+ bold: true,
350
+ children: "System Diagnostics"
351
+ }, undefined, false, undefined, this),
352
+ diagnostics.map((diagnostic, i) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
353
+ flexDirection: "row",
354
+ gap: 1,
355
+ paddingX: 1,
356
+ children: [
357
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
358
+ color: "error",
359
+ children: figures_default.warning
360
+ }, undefined, false, undefined, this),
361
+ typeof diagnostic === "string" ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
362
+ wrap: "wrap",
363
+ children: diagnostic
364
+ }, undefined, false, undefined, this) : diagnostic
365
+ ]
366
+ }, i, true, undefined, this))
367
+ ]
368
+ }, undefined, true, undefined, this);
369
+ }
370
+ var React, import_react, jsx_dev_runtime;
371
+ var init_Status = __esm(() => {
372
+ init_figures();
373
+ init_state();
374
+ init_modalContext();
375
+ init_src();
376
+ init_AppState();
377
+ init_cwd();
378
+ init_sessionStorage();
379
+ init_status();
380
+ init_ConfigurableShortcutHint();
381
+ React = __toESM(require_react(), 1);
382
+ import_react = __toESM(require_react(), 1);
383
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
384
+ });
385
+
386
+ // src/components/ChannelDowngradeDialog.tsx
387
+ function ChannelDowngradeDialog({
388
+ currentVersion,
389
+ onChoice
390
+ }) {
391
+ function handleSelect(value) {
392
+ onChoice(value);
393
+ }
394
+ function handleCancel() {
395
+ onChoice("cancel");
396
+ }
397
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
398
+ title: "Switch to Stable Channel",
399
+ onCancel: handleCancel,
400
+ color: "permission",
401
+ hideBorder: true,
402
+ hideInputGuide: true,
403
+ children: [
404
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
405
+ children: [
406
+ "The stable channel may have an older version than what you're currently running (",
407
+ currentVersion,
408
+ ")."
409
+ ]
410
+ }, undefined, true, undefined, this),
411
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
412
+ dimColor: true,
413
+ children: "How would you like to handle this?"
414
+ }, undefined, false, undefined, this),
415
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Select, {
416
+ options: [
417
+ {
418
+ label: "Allow possible downgrade to stable version",
419
+ value: "downgrade"
420
+ },
421
+ {
422
+ label: `Stay on current version (${currentVersion}) until stable catches up`,
423
+ value: "stay"
424
+ }
425
+ ],
426
+ onChange: handleSelect
427
+ }, undefined, false, undefined, this)
428
+ ]
429
+ }, undefined, true, undefined, this);
430
+ }
431
+ var jsx_dev_runtime2;
432
+ var init_ChannelDowngradeDialog = __esm(() => {
433
+ init_src();
434
+ init_CustomSelect();
435
+ init_src();
436
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
437
+ });
438
+
439
+ // src/components/OutputStylePicker.tsx
440
+ function mapConfigsToOptions(styles) {
441
+ return Object.entries(styles).map(([style, config]) => ({
442
+ label: config?.name ?? DEFAULT_OUTPUT_STYLE_LABEL,
443
+ value: style,
444
+ description: config?.description ?? DEFAULT_OUTPUT_STYLE_DESCRIPTION
445
+ }));
446
+ }
447
+ function OutputStylePicker({
448
+ initialStyle,
449
+ onComplete,
450
+ onCancel,
451
+ isStandaloneCommand
452
+ }) {
453
+ const [styleOptions, setStyleOptions] = import_react2.useState([]);
454
+ const [isLoading, setIsLoading] = import_react2.useState(true);
455
+ import_react2.useEffect(() => {
456
+ getAllOutputStyles(getCwd()).then((allStyles) => {
457
+ const options = mapConfigsToOptions(allStyles);
458
+ setStyleOptions(options);
459
+ setIsLoading(false);
460
+ }).catch(() => {
461
+ const builtInOptions = mapConfigsToOptions(OUTPUT_STYLE_CONFIG);
462
+ setStyleOptions(builtInOptions);
463
+ setIsLoading(false);
464
+ });
465
+ }, []);
466
+ const handleStyleSelect = import_react2.useCallback((style) => {
467
+ const outputStyle = style;
468
+ onComplete(outputStyle);
469
+ }, [onComplete]);
470
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Dialog, {
471
+ title: "Preferred output style",
472
+ onCancel,
473
+ hideInputGuide: !isStandaloneCommand,
474
+ hideBorder: !isStandaloneCommand,
475
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
476
+ flexDirection: "column",
477
+ gap: 1,
478
+ children: [
479
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
480
+ marginTop: 1,
481
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
482
+ dimColor: true,
483
+ children: "This changes how RedScope AI communicates with you"
484
+ }, undefined, false, undefined, this)
485
+ }, undefined, false, undefined, this),
486
+ isLoading ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
487
+ dimColor: true,
488
+ children: "Loading output styles\u2026"
489
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Select, {
490
+ options: styleOptions,
491
+ onChange: handleStyleSelect,
492
+ visibleOptionCount: 10,
493
+ defaultValue: initialStyle
494
+ }, undefined, false, undefined, this)
495
+ ]
496
+ }, undefined, true, undefined, this)
497
+ }, undefined, false, undefined, this);
498
+ }
499
+ var import_react2, jsx_dev_runtime3, DEFAULT_OUTPUT_STYLE_LABEL = "Default", DEFAULT_OUTPUT_STYLE_DESCRIPTION = "RedScope AI completes coding tasks efficiently and provides concise responses";
500
+ var init_OutputStylePicker = __esm(() => {
501
+ init_outputStyles();
502
+ init_src();
503
+ init_cwd();
504
+ init_select();
505
+ import_react2 = __toESM(require_react(), 1);
506
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
507
+ });
508
+
509
+ // src/components/LanguagePicker.tsx
510
+ function LanguagePicker({
511
+ initialLanguage,
512
+ onComplete,
513
+ onCancel
514
+ }) {
515
+ const [language, setLanguage] = import_react3.useState(initialLanguage);
516
+ const [cursorOffset, setCursorOffset] = import_react3.useState((initialLanguage ?? "").length);
517
+ useKeybinding("confirm:no", onCancel, { context: "Settings" });
518
+ function handleSubmit() {
519
+ const trimmed = language?.trim();
520
+ onComplete(trimmed || undefined);
521
+ }
522
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
523
+ flexDirection: "column",
524
+ gap: 1,
525
+ children: [
526
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
527
+ children: "Enter your preferred response and voice language:"
528
+ }, undefined, false, undefined, this),
529
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
530
+ flexDirection: "row",
531
+ gap: 1,
532
+ children: [
533
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
534
+ children: figures_default.pointer
535
+ }, undefined, false, undefined, this),
536
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextInput, {
537
+ value: language ?? "",
538
+ onChange: setLanguage,
539
+ onSubmit: handleSubmit,
540
+ focus: true,
541
+ showCursor: true,
542
+ placeholder: `e.g., Japanese, \u65E5\u672C\u8A9E, Espa\xF1ol${figures_default.ellipsis}`,
543
+ columns: 60,
544
+ cursorOffset,
545
+ onChangeCursorOffset: setCursorOffset
546
+ }, undefined, false, undefined, this)
547
+ ]
548
+ }, undefined, true, undefined, this),
549
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
550
+ dimColor: true,
551
+ children: "Leave empty for default (English)"
552
+ }, undefined, false, undefined, this)
553
+ ]
554
+ }, undefined, true, undefined, this);
555
+ }
556
+ var import_react3, jsx_dev_runtime4;
557
+ var init_LanguagePicker = __esm(() => {
558
+ init_figures();
559
+ init_src();
560
+ init_useKeybinding();
561
+ init_TextInput();
562
+ import_react3 = __toESM(require_react(), 1);
563
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
564
+ });
565
+
566
+ // src/components/Settings/Config.tsx
567
+ function Config({
568
+ onClose,
569
+ context,
570
+ setTabsHidden,
571
+ onIsSearchModeChange,
572
+ contentHeight
573
+ }) {
574
+ const { headerFocused, focusHeader } = useTabHeaderFocus();
575
+ const insideModal = useIsInsideModal();
576
+ const [, setTheme] = useTheme();
577
+ const themeSetting = useThemeSetting();
578
+ const [globalConfig, setGlobalConfig] = import_react4.useState(getGlobalConfig());
579
+ const initialConfig = React3.useRef(getGlobalConfig());
580
+ const [settingsData, setSettingsData] = import_react4.useState(getInitialSettings());
581
+ const initialSettingsData = React3.useRef(getInitialSettings());
582
+ const [currentOutputStyle, setCurrentOutputStyle] = import_react4.useState(settingsData?.outputStyle || DEFAULT_OUTPUT_STYLE_NAME);
583
+ const initialOutputStyle = React3.useRef(currentOutputStyle);
584
+ const [currentLanguage, setCurrentLanguage] = import_react4.useState(settingsData?.language);
585
+ const initialLanguage = React3.useRef(currentLanguage);
586
+ const [selectedIndex, setSelectedIndex] = import_react4.useState(0);
587
+ const [scrollOffset, setScrollOffset] = import_react4.useState(0);
588
+ const [isSearchMode, setIsSearchMode] = import_react4.useState(false);
589
+ const isTerminalFocused = useTerminalFocus();
590
+ const { rows } = useTerminalSize();
591
+ const paneCap = contentHeight ?? Math.min(Math.floor(rows * 0.8), 30);
592
+ const maxVisible = Math.max(5, paneCap - 10);
593
+ const mainLoopModel = useAppState((s) => s.mainLoopModel);
594
+ const verbose = useAppState((s) => s.verbose);
595
+ const thinkingEnabled = useAppState((s) => s.thinkingEnabled);
596
+ const isFastMode = useAppState((s) => isFastModeEnabled() ? s.fastMode : false);
597
+ const promptSuggestionEnabled = useAppState((s) => s.promptSuggestionEnabled);
598
+ const currentDefaultPermissionMode = permissionModeFromString(settingsData?.permissions?.defaultMode ?? "default");
599
+ const showAutoInDefaultModePicker = hasAutoModeOptInAnySource() || getAutoModeEnabledState() === "enabled";
600
+ const showDefaultViewPicker = (init_BriefTool(), __toCommonJS(exports_BriefTool)).isBriefEntitled();
601
+ const setAppState = useSetAppState();
602
+ const [changes, setChanges] = import_react4.useState({});
603
+ const initialThinkingEnabled = React3.useRef(thinkingEnabled);
604
+ const [initialLocalSettings] = import_react4.useState(() => getSettingsForSource("localSettings"));
605
+ const [initialUserSettings] = import_react4.useState(() => getSettingsForSource("userSettings"));
606
+ const initialThemeSetting = React3.useRef(themeSetting);
607
+ const store = useAppStateStore();
608
+ const [initialAppState] = import_react4.useState(() => {
609
+ const s = store.getState();
610
+ return {
611
+ mainLoopModel: s.mainLoopModel,
612
+ mainLoopModelForSession: s.mainLoopModelForSession,
613
+ verbose: s.verbose,
614
+ thinkingEnabled: s.thinkingEnabled,
615
+ fastMode: s.fastMode,
616
+ promptSuggestionEnabled: s.promptSuggestionEnabled,
617
+ isBriefOnly: s.isBriefOnly,
618
+ replBridgeEnabled: s.replBridgeEnabled,
619
+ replBridgeOutboundOnly: s.replBridgeOutboundOnly,
620
+ settings: s.settings
621
+ };
622
+ });
623
+ const [initialUserMsgOptIn] = import_react4.useState(() => getUserMsgOptIn());
624
+ const isDirty = React3.useRef(false);
625
+ const [showThinkingWarning, setShowThinkingWarning] = import_react4.useState(false);
626
+ const [showSubmenu, setShowSubmenu] = import_react4.useState(null);
627
+ const {
628
+ query: searchQuery,
629
+ setQuery: setSearchQuery,
630
+ cursorOffset: searchCursorOffset
631
+ } = useSearchInput({
632
+ isActive: isSearchMode && showSubmenu === null && !headerFocused,
633
+ onExit: () => setIsSearchMode(false),
634
+ onExitUp: focusHeader,
635
+ passthroughCtrlKeys: ["c", "d"]
636
+ });
637
+ const ownsEsc = isSearchMode && !headerFocused;
638
+ React3.useEffect(() => {
639
+ onIsSearchModeChange?.(ownsEsc);
640
+ }, [ownsEsc, onIsSearchModeChange]);
641
+ const isConnectedToIde = hasAccessToIDEExtensionDiffFeature(context.options.mcpClients);
642
+ const isFileCheckpointingAvailable = !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING);
643
+ const memoryFiles = React3.use(getMemoryFiles(true));
644
+ const shouldShowExternalIncludesToggle = hasExternalClaudeMdIncludes(memoryFiles);
645
+ const autoUpdaterDisabledReason = getAutoUpdaterDisabledReason();
646
+ function onChangeMainModelConfig(value) {
647
+ const previousModel = mainLoopModel;
648
+ logEvent("tengu_config_model_changed", {
649
+ from_model: previousModel,
650
+ to_model: value
651
+ });
652
+ setAppState((prev) => ({
653
+ ...prev,
654
+ mainLoopModel: value,
655
+ mainLoopModelForSession: null
656
+ }));
657
+ setChanges((prev) => {
658
+ const valStr = modelDisplayString(value) + (isBilledAsExtraUsage(value, false, isOpus1mMergeEnabled()) ? " \xB7 Billed as extra usage" : "");
659
+ if ("model" in prev) {
660
+ const { model, ...rest } = prev;
661
+ return { ...rest, model: valStr };
662
+ }
663
+ return { ...prev, model: valStr };
664
+ });
665
+ }
666
+ function onChangeVerbose(value) {
667
+ saveGlobalConfig((current) => ({ ...current, verbose: value }));
668
+ setGlobalConfig({ ...getGlobalConfig(), verbose: value });
669
+ setAppState((prev) => ({
670
+ ...prev,
671
+ verbose: value
672
+ }));
673
+ setChanges((prev) => {
674
+ if ("verbose" in prev) {
675
+ const { verbose: verbose2, ...rest } = prev;
676
+ return rest;
677
+ }
678
+ return { ...prev, verbose: value };
679
+ });
680
+ }
681
+ const settingsItems = [
682
+ {
683
+ id: "autoCompactEnabled",
684
+ label: "Auto-compact",
685
+ value: globalConfig.autoCompactEnabled,
686
+ type: "boolean",
687
+ onChange(autoCompactEnabled) {
688
+ saveGlobalConfig((current) => ({ ...current, autoCompactEnabled }));
689
+ setGlobalConfig({ ...getGlobalConfig(), autoCompactEnabled });
690
+ logEvent("tengu_auto_compact_setting_changed", {
691
+ enabled: autoCompactEnabled
692
+ });
693
+ }
694
+ },
695
+ {
696
+ id: "spinnerTipsEnabled",
697
+ label: "Show tips",
698
+ value: settingsData?.spinnerTipsEnabled ?? true,
699
+ type: "boolean",
700
+ onChange(spinnerTipsEnabled) {
701
+ updateSettingsForSource("localSettings", {
702
+ spinnerTipsEnabled
703
+ });
704
+ setSettingsData((prev) => ({
705
+ ...prev,
706
+ spinnerTipsEnabled
707
+ }));
708
+ logEvent("tengu_tips_setting_changed", {
709
+ enabled: spinnerTipsEnabled
710
+ });
711
+ }
712
+ },
713
+ {
714
+ id: "prefersReducedMotion",
715
+ label: "Reduce motion",
716
+ value: settingsData?.prefersReducedMotion ?? false,
717
+ type: "boolean",
718
+ onChange(prefersReducedMotion) {
719
+ updateSettingsForSource("localSettings", {
720
+ prefersReducedMotion
721
+ });
722
+ setSettingsData((prev) => ({
723
+ ...prev,
724
+ prefersReducedMotion
725
+ }));
726
+ setAppState((prev) => ({
727
+ ...prev,
728
+ settings: { ...prev.settings, prefersReducedMotion }
729
+ }));
730
+ logEvent("tengu_reduce_motion_setting_changed", {
731
+ enabled: prefersReducedMotion
732
+ });
733
+ }
734
+ },
735
+ {
736
+ id: "thinkingEnabled",
737
+ label: "Thinking mode",
738
+ value: thinkingEnabled ?? true,
739
+ type: "boolean",
740
+ onChange(enabled) {
741
+ setAppState((prev) => ({ ...prev, thinkingEnabled: enabled }));
742
+ updateSettingsForSource("userSettings", {
743
+ alwaysThinkingEnabled: enabled ? undefined : false
744
+ });
745
+ logEvent("tengu_thinking_toggled", { enabled });
746
+ }
747
+ },
748
+ ...isFastModeEnabled() && isFastModeAvailable() ? [
749
+ {
750
+ id: "fastMode",
751
+ label: `Fast mode (${FAST_MODE_MODEL_DISPLAY} only)`,
752
+ value: !!isFastMode,
753
+ type: "boolean",
754
+ onChange(enabled) {
755
+ clearFastModeCooldown();
756
+ updateSettingsForSource("userSettings", {
757
+ fastMode: enabled ? true : undefined
758
+ });
759
+ if (enabled) {
760
+ setAppState((prev) => ({
761
+ ...prev,
762
+ mainLoopModel: getFastModeModel(),
763
+ mainLoopModelForSession: null,
764
+ fastMode: true
765
+ }));
766
+ setChanges((prev) => ({
767
+ ...prev,
768
+ model: getFastModeModel(),
769
+ "Fast mode": "ON"
770
+ }));
771
+ } else {
772
+ setAppState((prev) => ({
773
+ ...prev,
774
+ fastMode: false
775
+ }));
776
+ setChanges((prev) => ({ ...prev, "Fast mode": "OFF" }));
777
+ }
778
+ }
779
+ }
780
+ ] : [],
781
+ ...getFeatureValue_CACHED_MAY_BE_STALE("tengu_chomp_inflection", false) ? [
782
+ {
783
+ id: "promptSuggestionEnabled",
784
+ label: "Prompt suggestions",
785
+ value: promptSuggestionEnabled,
786
+ type: "boolean",
787
+ onChange(enabled) {
788
+ setAppState((prev) => ({
789
+ ...prev,
790
+ promptSuggestionEnabled: enabled
791
+ }));
792
+ updateSettingsForSource("userSettings", {
793
+ promptSuggestionEnabled: enabled ? undefined : false
794
+ });
795
+ }
796
+ }
797
+ ] : [],
798
+ ...[
799
+ {
800
+ id: "poorMode",
801
+ label: "Poor mode (save tokens)",
802
+ value: (() => {
803
+ const PoorMode = (init_poorMode(), __toCommonJS(exports_poorMode));
804
+ return PoorMode.isPoorModeActive();
805
+ })(),
806
+ type: "boolean",
807
+ onChange(enabled) {
808
+ const PoorMode = (init_poorMode(), __toCommonJS(exports_poorMode));
809
+ PoorMode.setPoorMode(enabled);
810
+ setAppState((prev) => ({
811
+ ...prev,
812
+ promptSuggestionEnabled: !enabled
813
+ }));
814
+ }
815
+ }
816
+ ],
817
+ ...process.env.USER_TYPE === "ant" ? [
818
+ {
819
+ id: "speculationEnabled",
820
+ label: "Speculative execution",
821
+ value: globalConfig.speculationEnabled ?? true,
822
+ type: "boolean",
823
+ onChange(enabled) {
824
+ saveGlobalConfig((current) => {
825
+ if (current.speculationEnabled === enabled)
826
+ return current;
827
+ return {
828
+ ...current,
829
+ speculationEnabled: enabled
830
+ };
831
+ });
832
+ setGlobalConfig({
833
+ ...getGlobalConfig(),
834
+ speculationEnabled: enabled
835
+ });
836
+ logEvent("tengu_speculation_setting_changed", {
837
+ enabled
838
+ });
839
+ }
840
+ }
841
+ ] : [],
842
+ ...isFileCheckpointingAvailable ? [
843
+ {
844
+ id: "fileCheckpointingEnabled",
845
+ label: "Rewind code (checkpoints)",
846
+ value: globalConfig.fileCheckpointingEnabled,
847
+ type: "boolean",
848
+ onChange(enabled) {
849
+ saveGlobalConfig((current) => ({
850
+ ...current,
851
+ fileCheckpointingEnabled: enabled
852
+ }));
853
+ setGlobalConfig({
854
+ ...getGlobalConfig(),
855
+ fileCheckpointingEnabled: enabled
856
+ });
857
+ logEvent("tengu_file_history_snapshots_setting_changed", {
858
+ enabled
859
+ });
860
+ }
861
+ }
862
+ ] : [],
863
+ {
864
+ id: "verbose",
865
+ label: "Verbose output",
866
+ value: verbose,
867
+ type: "boolean",
868
+ onChange: onChangeVerbose
869
+ },
870
+ {
871
+ id: "terminalProgressBarEnabled",
872
+ label: "Terminal progress bar",
873
+ value: globalConfig.terminalProgressBarEnabled,
874
+ type: "boolean",
875
+ onChange(terminalProgressBarEnabled) {
876
+ saveGlobalConfig((current) => ({
877
+ ...current,
878
+ terminalProgressBarEnabled
879
+ }));
880
+ setGlobalConfig({ ...getGlobalConfig(), terminalProgressBarEnabled });
881
+ logEvent("tengu_terminal_progress_bar_setting_changed", {
882
+ enabled: terminalProgressBarEnabled
883
+ });
884
+ }
885
+ },
886
+ ...getFeatureValue_CACHED_MAY_BE_STALE("tengu_terminal_sidebar", false) ? [
887
+ {
888
+ id: "showStatusInTerminalTab",
889
+ label: "Show status in terminal tab",
890
+ value: globalConfig.showStatusInTerminalTab ?? false,
891
+ type: "boolean",
892
+ onChange(showStatusInTerminalTab) {
893
+ saveGlobalConfig((current) => ({
894
+ ...current,
895
+ showStatusInTerminalTab
896
+ }));
897
+ setGlobalConfig({
898
+ ...getGlobalConfig(),
899
+ showStatusInTerminalTab
900
+ });
901
+ logEvent("tengu_terminal_tab_status_setting_changed", {
902
+ enabled: showStatusInTerminalTab
903
+ });
904
+ }
905
+ }
906
+ ] : [],
907
+ {
908
+ id: "showTurnDuration",
909
+ label: "Show turn duration",
910
+ value: globalConfig.showTurnDuration,
911
+ type: "boolean",
912
+ onChange(showTurnDuration) {
913
+ saveGlobalConfig((current) => ({ ...current, showTurnDuration }));
914
+ setGlobalConfig({ ...getGlobalConfig(), showTurnDuration });
915
+ logEvent("tengu_show_turn_duration_setting_changed", {
916
+ enabled: showTurnDuration
917
+ });
918
+ }
919
+ },
920
+ {
921
+ id: "defaultPermissionMode",
922
+ label: "Default permission mode",
923
+ value: currentDefaultPermissionMode,
924
+ options: (() => {
925
+ const priorityOrder = ["default", "plan"];
926
+ return [...priorityOrder, ...PERMISSION_MODES.filter((m) => !priorityOrder.includes(m))];
927
+ })(),
928
+ type: "enum",
929
+ onChange(mode) {
930
+ const parsedMode = permissionModeFromString(mode);
931
+ const validatedMode = parsedMode === "auto" ? parsedMode : isExternalPermissionMode(parsedMode) ? toExternalPermissionMode(parsedMode) : parsedMode;
932
+ const result = updateSettingsForSource("userSettings", {
933
+ permissions: {
934
+ ...settingsData?.permissions,
935
+ defaultMode: validatedMode
936
+ }
937
+ });
938
+ if (result.error) {
939
+ logError(result.error);
940
+ return;
941
+ }
942
+ setSettingsData((prev) => ({
943
+ ...prev,
944
+ permissions: {
945
+ ...prev?.permissions,
946
+ defaultMode: validatedMode
947
+ }
948
+ }));
949
+ setChanges((prev) => ({ ...prev, defaultPermissionMode: mode }));
950
+ logEvent("tengu_config_changed", {
951
+ setting: "defaultPermissionMode",
952
+ value: mode
953
+ });
954
+ }
955
+ },
956
+ ...showAutoInDefaultModePicker ? [
957
+ {
958
+ id: "useAutoModeDuringPlan",
959
+ label: "Use auto mode during plan",
960
+ value: settingsData?.useAutoModeDuringPlan ?? true,
961
+ type: "boolean",
962
+ onChange(useAutoModeDuringPlan) {
963
+ updateSettingsForSource("userSettings", {
964
+ useAutoModeDuringPlan
965
+ });
966
+ setSettingsData((prev) => ({
967
+ ...prev,
968
+ useAutoModeDuringPlan
969
+ }));
970
+ setAppState((prev) => {
971
+ const next = transitionPlanAutoMode(prev.toolPermissionContext);
972
+ if (next === prev.toolPermissionContext)
973
+ return prev;
974
+ return { ...prev, toolPermissionContext: next };
975
+ });
976
+ setChanges((prev) => ({
977
+ ...prev,
978
+ "Use auto mode during plan": useAutoModeDuringPlan
979
+ }));
980
+ }
981
+ }
982
+ ] : [],
983
+ {
984
+ id: "respectGitignore",
985
+ label: "Respect .gitignore in file picker",
986
+ value: globalConfig.respectGitignore,
987
+ type: "boolean",
988
+ onChange(respectGitignore) {
989
+ saveGlobalConfig((current) => ({ ...current, respectGitignore }));
990
+ setGlobalConfig({ ...getGlobalConfig(), respectGitignore });
991
+ logEvent("tengu_respect_gitignore_setting_changed", {
992
+ enabled: respectGitignore
993
+ });
994
+ }
995
+ },
996
+ {
997
+ id: "copyFullResponse",
998
+ label: "Always copy full response (skip /copy picker)",
999
+ value: globalConfig.copyFullResponse,
1000
+ type: "boolean",
1001
+ onChange(copyFullResponse) {
1002
+ saveGlobalConfig((current) => ({ ...current, copyFullResponse }));
1003
+ setGlobalConfig({ ...getGlobalConfig(), copyFullResponse });
1004
+ logEvent("tengu_config_changed", {
1005
+ setting: "copyFullResponse",
1006
+ value: String(copyFullResponse)
1007
+ });
1008
+ }
1009
+ },
1010
+ ...isFullscreenEnvEnabled() ? [
1011
+ {
1012
+ id: "copyOnSelect",
1013
+ label: "Copy on select",
1014
+ value: globalConfig.copyOnSelect ?? true,
1015
+ type: "boolean",
1016
+ onChange(copyOnSelect) {
1017
+ saveGlobalConfig((current) => ({ ...current, copyOnSelect }));
1018
+ setGlobalConfig({ ...getGlobalConfig(), copyOnSelect });
1019
+ logEvent("tengu_config_changed", {
1020
+ setting: "copyOnSelect",
1021
+ value: String(copyOnSelect)
1022
+ });
1023
+ }
1024
+ }
1025
+ ] : [],
1026
+ autoUpdaterDisabledReason ? {
1027
+ id: "autoUpdatesChannel",
1028
+ label: "Auto-update channel",
1029
+ value: "disabled",
1030
+ type: "managedEnum",
1031
+ onChange() {}
1032
+ } : {
1033
+ id: "autoUpdatesChannel",
1034
+ label: "Auto-update channel",
1035
+ value: settingsData?.autoUpdatesChannel ?? "latest",
1036
+ type: "managedEnum",
1037
+ onChange() {}
1038
+ },
1039
+ {
1040
+ id: "theme",
1041
+ label: "Theme",
1042
+ value: themeSetting,
1043
+ type: "managedEnum",
1044
+ onChange: setTheme
1045
+ },
1046
+ {
1047
+ id: "notifChannel",
1048
+ label: "Local notifications",
1049
+ value: globalConfig.preferredNotifChannel,
1050
+ options: ["auto", "iterm2", "terminal_bell", "iterm2_with_bell", "kitty", "ghostty", "notifications_disabled"],
1051
+ type: "enum",
1052
+ onChange(notifChannel) {
1053
+ saveGlobalConfig((current) => ({
1054
+ ...current,
1055
+ preferredNotifChannel: notifChannel
1056
+ }));
1057
+ setGlobalConfig({
1058
+ ...getGlobalConfig(),
1059
+ preferredNotifChannel: notifChannel
1060
+ });
1061
+ }
1062
+ },
1063
+ ...[
1064
+ {
1065
+ id: "taskCompleteNotifEnabled",
1066
+ label: "Push when idle",
1067
+ value: globalConfig.taskCompleteNotifEnabled ?? false,
1068
+ type: "boolean",
1069
+ onChange(taskCompleteNotifEnabled) {
1070
+ saveGlobalConfig((current) => ({
1071
+ ...current,
1072
+ taskCompleteNotifEnabled
1073
+ }));
1074
+ setGlobalConfig({
1075
+ ...getGlobalConfig(),
1076
+ taskCompleteNotifEnabled
1077
+ });
1078
+ }
1079
+ },
1080
+ {
1081
+ id: "inputNeededNotifEnabled",
1082
+ label: "Push when input needed",
1083
+ value: globalConfig.inputNeededNotifEnabled ?? false,
1084
+ type: "boolean",
1085
+ onChange(inputNeededNotifEnabled) {
1086
+ saveGlobalConfig((current) => ({
1087
+ ...current,
1088
+ inputNeededNotifEnabled
1089
+ }));
1090
+ setGlobalConfig({
1091
+ ...getGlobalConfig(),
1092
+ inputNeededNotifEnabled
1093
+ });
1094
+ }
1095
+ },
1096
+ {
1097
+ id: "agentPushNotifEnabled",
1098
+ label: "Push when RedScope AI decides",
1099
+ value: globalConfig.agentPushNotifEnabled ?? false,
1100
+ type: "boolean",
1101
+ onChange(agentPushNotifEnabled) {
1102
+ saveGlobalConfig((current) => ({
1103
+ ...current,
1104
+ agentPushNotifEnabled
1105
+ }));
1106
+ setGlobalConfig({
1107
+ ...getGlobalConfig(),
1108
+ agentPushNotifEnabled
1109
+ });
1110
+ }
1111
+ }
1112
+ ],
1113
+ {
1114
+ id: "outputStyle",
1115
+ label: "Output style",
1116
+ value: currentOutputStyle,
1117
+ type: "managedEnum",
1118
+ onChange: () => {}
1119
+ },
1120
+ ...showDefaultViewPicker ? [
1121
+ {
1122
+ id: "defaultView",
1123
+ label: "What you see by default",
1124
+ value: settingsData?.defaultView === undefined ? "default" : String(settingsData.defaultView),
1125
+ options: ["transcript", "chat", "default"],
1126
+ type: "enum",
1127
+ onChange(selected) {
1128
+ const defaultView = selected === "default" ? undefined : selected;
1129
+ updateSettingsForSource("localSettings", { defaultView });
1130
+ setSettingsData((prev) => ({ ...prev, defaultView }));
1131
+ const nextBrief = defaultView === "chat";
1132
+ setAppState((prev) => {
1133
+ if (prev.isBriefOnly === nextBrief)
1134
+ return prev;
1135
+ return { ...prev, isBriefOnly: nextBrief };
1136
+ });
1137
+ setUserMsgOptIn(nextBrief);
1138
+ setChanges((prev) => ({ ...prev, "Default view": selected }));
1139
+ logEvent("tengu_default_view_setting_changed", {
1140
+ value: defaultView ?? "unset"
1141
+ });
1142
+ }
1143
+ }
1144
+ ] : [],
1145
+ {
1146
+ id: "language",
1147
+ label: "Language",
1148
+ value: currentLanguage ?? "Default (English)",
1149
+ type: "managedEnum",
1150
+ onChange: () => {}
1151
+ },
1152
+ {
1153
+ id: "editorMode",
1154
+ label: "Editor mode",
1155
+ value: globalConfig.editorMode === "emacs" ? "normal" : globalConfig.editorMode || "normal",
1156
+ options: ["normal", "vim"],
1157
+ type: "enum",
1158
+ onChange(value) {
1159
+ saveGlobalConfig((current) => ({
1160
+ ...current,
1161
+ editorMode: value
1162
+ }));
1163
+ setGlobalConfig({
1164
+ ...getGlobalConfig(),
1165
+ editorMode: value
1166
+ });
1167
+ logEvent("tengu_editor_mode_changed", {
1168
+ mode: value,
1169
+ source: "config_panel"
1170
+ });
1171
+ }
1172
+ },
1173
+ {
1174
+ id: "prStatusFooterEnabled",
1175
+ label: "Show PR status footer",
1176
+ value: globalConfig.prStatusFooterEnabled ?? true,
1177
+ type: "boolean",
1178
+ onChange(enabled) {
1179
+ saveGlobalConfig((current) => {
1180
+ if (current.prStatusFooterEnabled === enabled)
1181
+ return current;
1182
+ return {
1183
+ ...current,
1184
+ prStatusFooterEnabled: enabled
1185
+ };
1186
+ });
1187
+ setGlobalConfig({
1188
+ ...getGlobalConfig(),
1189
+ prStatusFooterEnabled: enabled
1190
+ });
1191
+ logEvent("tengu_pr_status_footer_setting_changed", {
1192
+ enabled
1193
+ });
1194
+ }
1195
+ },
1196
+ {
1197
+ id: "model",
1198
+ label: "Model",
1199
+ value: mainLoopModel === null ? "Default (recommended)" : mainLoopModel,
1200
+ type: "managedEnum",
1201
+ onChange: onChangeMainModelConfig
1202
+ },
1203
+ ...isConnectedToIde ? [
1204
+ {
1205
+ id: "diffTool",
1206
+ label: "Diff tool",
1207
+ value: globalConfig.diffTool ?? "auto",
1208
+ options: ["terminal", "auto"],
1209
+ type: "enum",
1210
+ onChange(diffTool) {
1211
+ saveGlobalConfig((current) => ({
1212
+ ...current,
1213
+ diffTool
1214
+ }));
1215
+ setGlobalConfig({
1216
+ ...getGlobalConfig(),
1217
+ diffTool
1218
+ });
1219
+ logEvent("tengu_diff_tool_changed", {
1220
+ tool: diffTool,
1221
+ source: "config_panel"
1222
+ });
1223
+ }
1224
+ }
1225
+ ] : [],
1226
+ ...!isSupportedTerminal() ? [
1227
+ {
1228
+ id: "autoConnectIde",
1229
+ label: "Auto-connect to IDE (external terminal)",
1230
+ value: globalConfig.autoConnectIde ?? false,
1231
+ type: "boolean",
1232
+ onChange(autoConnectIde) {
1233
+ saveGlobalConfig((current) => ({ ...current, autoConnectIde }));
1234
+ setGlobalConfig({ ...getGlobalConfig(), autoConnectIde });
1235
+ logEvent("tengu_auto_connect_ide_changed", {
1236
+ enabled: autoConnectIde,
1237
+ source: "config_panel"
1238
+ });
1239
+ }
1240
+ }
1241
+ ] : [],
1242
+ ...isSupportedTerminal() ? [
1243
+ {
1244
+ id: "autoInstallIdeExtension",
1245
+ label: "Auto-install IDE extension",
1246
+ value: globalConfig.autoInstallIdeExtension ?? true,
1247
+ type: "boolean",
1248
+ onChange(autoInstallIdeExtension) {
1249
+ saveGlobalConfig((current) => ({
1250
+ ...current,
1251
+ autoInstallIdeExtension
1252
+ }));
1253
+ setGlobalConfig({ ...getGlobalConfig(), autoInstallIdeExtension });
1254
+ logEvent("tengu_auto_install_ide_extension_changed", {
1255
+ enabled: autoInstallIdeExtension,
1256
+ source: "config_panel"
1257
+ });
1258
+ }
1259
+ }
1260
+ ] : [],
1261
+ {
1262
+ id: "claudeInChromeDefaultEnabled",
1263
+ label: "RedScope in Chrome enabled by default",
1264
+ value: globalConfig.claudeInChromeDefaultEnabled ?? true,
1265
+ type: "boolean",
1266
+ onChange(enabled) {
1267
+ saveGlobalConfig((current) => ({
1268
+ ...current,
1269
+ claudeInChromeDefaultEnabled: enabled
1270
+ }));
1271
+ setGlobalConfig({
1272
+ ...getGlobalConfig(),
1273
+ claudeInChromeDefaultEnabled: enabled
1274
+ });
1275
+ logEvent("tengu_claude_in_chrome_setting_changed", {
1276
+ enabled
1277
+ });
1278
+ }
1279
+ },
1280
+ ...isAgentSwarmsEnabled() ? (() => {
1281
+ const cliOverride = getCliTeammateModeOverride();
1282
+ const label = cliOverride ? `Teammate mode [overridden: ${cliOverride}]` : "Teammate mode";
1283
+ const isWindows = getPlatform() === "windows";
1284
+ const teammateModeOptions = isWindows ? ["auto", "tmux", "windows-terminal", "in-process"] : ["auto", "tmux", "in-process"];
1285
+ return [
1286
+ {
1287
+ id: "teammateMode",
1288
+ label,
1289
+ value: globalConfig.teammateMode ?? "auto",
1290
+ options: teammateModeOptions,
1291
+ type: "enum",
1292
+ onChange(mode) {
1293
+ if (mode !== "auto" && mode !== "tmux" && mode !== "windows-terminal" && mode !== "in-process") {
1294
+ return;
1295
+ }
1296
+ if (mode === "windows-terminal" && !isWindows) {
1297
+ return;
1298
+ }
1299
+ clearCliTeammateModeOverride(mode);
1300
+ saveGlobalConfig((current) => ({
1301
+ ...current,
1302
+ teammateMode: mode
1303
+ }));
1304
+ setGlobalConfig({
1305
+ ...getGlobalConfig(),
1306
+ teammateMode: mode
1307
+ });
1308
+ logEvent("tengu_teammate_mode_changed", {
1309
+ mode
1310
+ });
1311
+ }
1312
+ },
1313
+ {
1314
+ id: "teammateDefaultModel",
1315
+ label: "Default teammate model",
1316
+ value: teammateModelDisplayString(globalConfig.teammateDefaultModel),
1317
+ type: "managedEnum",
1318
+ onChange() {}
1319
+ }
1320
+ ];
1321
+ })() : [],
1322
+ ...isBridgeEnabled() ? [
1323
+ {
1324
+ id: "remoteControlAtStartup",
1325
+ label: "Enable Remote Control for all sessions",
1326
+ value: globalConfig.remoteControlAtStartup === undefined ? "default" : String(globalConfig.remoteControlAtStartup),
1327
+ options: ["true", "false", "default"],
1328
+ type: "enum",
1329
+ onChange(selected) {
1330
+ if (selected === "default") {
1331
+ saveGlobalConfig((current) => {
1332
+ if (current.remoteControlAtStartup === undefined)
1333
+ return current;
1334
+ const next = { ...current };
1335
+ delete next.remoteControlAtStartup;
1336
+ return next;
1337
+ });
1338
+ setGlobalConfig({
1339
+ ...getGlobalConfig(),
1340
+ remoteControlAtStartup: undefined
1341
+ });
1342
+ } else {
1343
+ const enabled = selected === "true";
1344
+ saveGlobalConfig((current) => {
1345
+ if (current.remoteControlAtStartup === enabled)
1346
+ return current;
1347
+ return { ...current, remoteControlAtStartup: enabled };
1348
+ });
1349
+ setGlobalConfig({
1350
+ ...getGlobalConfig(),
1351
+ remoteControlAtStartup: enabled
1352
+ });
1353
+ }
1354
+ const resolved = getRemoteControlAtStartup();
1355
+ setAppState((prev) => {
1356
+ if (prev.replBridgeEnabled === resolved && !prev.replBridgeOutboundOnly)
1357
+ return prev;
1358
+ return {
1359
+ ...prev,
1360
+ replBridgeEnabled: resolved,
1361
+ replBridgeOutboundOnly: false
1362
+ };
1363
+ });
1364
+ }
1365
+ }
1366
+ ] : [],
1367
+ ...shouldShowExternalIncludesToggle ? [
1368
+ {
1369
+ id: "showExternalIncludesDialog",
1370
+ label: "External CLAUDE.md includes",
1371
+ value: (() => {
1372
+ const projectConfig = getCurrentProjectConfig();
1373
+ if (projectConfig.hasClaudeMdExternalIncludesApproved) {
1374
+ return "true";
1375
+ } else {
1376
+ return "false";
1377
+ }
1378
+ })(),
1379
+ type: "managedEnum",
1380
+ onChange() {}
1381
+ }
1382
+ ] : [],
1383
+ ...process.env.ANTHROPIC_API_KEY && !isRunningOnHomespace() ? [
1384
+ {
1385
+ id: "apiKey",
1386
+ label: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1387
+ children: [
1388
+ "Use custom API key: ",
1389
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1390
+ bold: true,
1391
+ children: normalizeApiKeyForConfig(process.env.ANTHROPIC_API_KEY)
1392
+ }, undefined, false, undefined, this)
1393
+ ]
1394
+ }, undefined, true, undefined, this),
1395
+ searchText: "Use custom API key",
1396
+ value: Boolean(process.env.ANTHROPIC_API_KEY && globalConfig.customApiKeyResponses?.approved?.includes(normalizeApiKeyForConfig(process.env.ANTHROPIC_API_KEY))),
1397
+ type: "boolean",
1398
+ onChange(useCustomKey) {
1399
+ saveGlobalConfig((current) => {
1400
+ const updated = { ...current };
1401
+ if (!updated.customApiKeyResponses) {
1402
+ updated.customApiKeyResponses = {
1403
+ approved: [],
1404
+ rejected: []
1405
+ };
1406
+ }
1407
+ if (!updated.customApiKeyResponses.approved) {
1408
+ updated.customApiKeyResponses = {
1409
+ ...updated.customApiKeyResponses,
1410
+ approved: []
1411
+ };
1412
+ }
1413
+ if (!updated.customApiKeyResponses.rejected) {
1414
+ updated.customApiKeyResponses = {
1415
+ ...updated.customApiKeyResponses,
1416
+ rejected: []
1417
+ };
1418
+ }
1419
+ if (process.env.ANTHROPIC_API_KEY) {
1420
+ const truncatedKey = normalizeApiKeyForConfig(process.env.ANTHROPIC_API_KEY);
1421
+ if (useCustomKey) {
1422
+ updated.customApiKeyResponses = {
1423
+ ...updated.customApiKeyResponses,
1424
+ approved: [
1425
+ ...(updated.customApiKeyResponses.approved ?? []).filter((k) => k !== truncatedKey),
1426
+ truncatedKey
1427
+ ],
1428
+ rejected: (updated.customApiKeyResponses.rejected ?? []).filter((k) => k !== truncatedKey)
1429
+ };
1430
+ } else {
1431
+ updated.customApiKeyResponses = {
1432
+ ...updated.customApiKeyResponses,
1433
+ approved: (updated.customApiKeyResponses.approved ?? []).filter((k) => k !== truncatedKey),
1434
+ rejected: [
1435
+ ...(updated.customApiKeyResponses.rejected ?? []).filter((k) => k !== truncatedKey),
1436
+ truncatedKey
1437
+ ]
1438
+ };
1439
+ }
1440
+ }
1441
+ return updated;
1442
+ });
1443
+ setGlobalConfig(getGlobalConfig());
1444
+ }
1445
+ }
1446
+ ] : []
1447
+ ];
1448
+ const filteredSettingsItems = React3.useMemo(() => {
1449
+ if (!searchQuery)
1450
+ return settingsItems;
1451
+ const lowerQuery = searchQuery.toLowerCase();
1452
+ return settingsItems.filter((setting) => {
1453
+ if (setting.id.toLowerCase().includes(lowerQuery))
1454
+ return true;
1455
+ const searchableText = "searchText" in setting ? setting.searchText : setting.label;
1456
+ return searchableText.toLowerCase().includes(lowerQuery);
1457
+ });
1458
+ }, [settingsItems, searchQuery]);
1459
+ React3.useEffect(() => {
1460
+ if (selectedIndex >= filteredSettingsItems.length) {
1461
+ const newIndex = Math.max(0, filteredSettingsItems.length - 1);
1462
+ setSelectedIndex(newIndex);
1463
+ setScrollOffset(Math.max(0, newIndex - maxVisible + 1));
1464
+ return;
1465
+ }
1466
+ setScrollOffset((prev) => {
1467
+ if (selectedIndex < prev)
1468
+ return selectedIndex;
1469
+ if (selectedIndex >= prev + maxVisible)
1470
+ return selectedIndex - maxVisible + 1;
1471
+ return prev;
1472
+ });
1473
+ }, [filteredSettingsItems.length, selectedIndex, maxVisible]);
1474
+ const adjustScrollOffset = import_react4.useCallback((newIndex) => {
1475
+ setScrollOffset((prev) => {
1476
+ if (newIndex < prev)
1477
+ return newIndex;
1478
+ if (newIndex >= prev + maxVisible)
1479
+ return newIndex - maxVisible + 1;
1480
+ return prev;
1481
+ });
1482
+ }, [maxVisible]);
1483
+ const handleSaveAndClose = import_react4.useCallback(() => {
1484
+ if (showSubmenu !== null) {
1485
+ return;
1486
+ }
1487
+ const formattedChanges = Object.entries(changes).map(([key, value]) => {
1488
+ logEvent("tengu_config_changed", {
1489
+ key,
1490
+ value
1491
+ });
1492
+ return `Set ${key} to ${source_default.bold(value)}`;
1493
+ });
1494
+ const effectiveApiKey = isRunningOnHomespace() ? undefined : process.env.ANTHROPIC_API_KEY;
1495
+ const initialUsingCustomKey = Boolean(effectiveApiKey && initialConfig.current.customApiKeyResponses?.approved?.includes(normalizeApiKeyForConfig(effectiveApiKey)));
1496
+ const currentUsingCustomKey = Boolean(effectiveApiKey && globalConfig.customApiKeyResponses?.approved?.includes(normalizeApiKeyForConfig(effectiveApiKey)));
1497
+ if (initialUsingCustomKey !== currentUsingCustomKey) {
1498
+ formattedChanges.push(`${currentUsingCustomKey ? "Enabled" : "Disabled"} custom API key`);
1499
+ logEvent("tengu_config_changed", {
1500
+ key: "env.ANTHROPIC_API_KEY",
1501
+ value: currentUsingCustomKey
1502
+ });
1503
+ }
1504
+ if (globalConfig.theme !== initialConfig.current.theme) {
1505
+ formattedChanges.push(`Set theme to ${source_default.bold(globalConfig.theme)}`);
1506
+ }
1507
+ if (globalConfig.preferredNotifChannel !== initialConfig.current.preferredNotifChannel) {
1508
+ formattedChanges.push(`Set notifications to ${source_default.bold(globalConfig.preferredNotifChannel)}`);
1509
+ }
1510
+ if (currentOutputStyle !== initialOutputStyle.current) {
1511
+ formattedChanges.push(`Set output style to ${source_default.bold(currentOutputStyle)}`);
1512
+ }
1513
+ if (currentLanguage !== initialLanguage.current) {
1514
+ formattedChanges.push(`Set response language to ${source_default.bold(currentLanguage ?? "Default (English)")}`);
1515
+ }
1516
+ if (globalConfig.editorMode !== initialConfig.current.editorMode) {
1517
+ formattedChanges.push(`Set editor mode to ${source_default.bold(globalConfig.editorMode || "emacs")}`);
1518
+ }
1519
+ if (globalConfig.diffTool !== initialConfig.current.diffTool) {
1520
+ formattedChanges.push(`Set diff tool to ${source_default.bold(globalConfig.diffTool)}`);
1521
+ }
1522
+ if (globalConfig.autoConnectIde !== initialConfig.current.autoConnectIde) {
1523
+ formattedChanges.push(`${globalConfig.autoConnectIde ? "Enabled" : "Disabled"} auto-connect to IDE`);
1524
+ }
1525
+ if (globalConfig.autoInstallIdeExtension !== initialConfig.current.autoInstallIdeExtension) {
1526
+ formattedChanges.push(`${globalConfig.autoInstallIdeExtension ? "Enabled" : "Disabled"} auto-install IDE extension`);
1527
+ }
1528
+ if (globalConfig.autoCompactEnabled !== initialConfig.current.autoCompactEnabled) {
1529
+ formattedChanges.push(`${globalConfig.autoCompactEnabled ? "Enabled" : "Disabled"} auto-compact`);
1530
+ }
1531
+ if (globalConfig.respectGitignore !== initialConfig.current.respectGitignore) {
1532
+ formattedChanges.push(`${globalConfig.respectGitignore ? "Enabled" : "Disabled"} respect .gitignore in file picker`);
1533
+ }
1534
+ if (globalConfig.copyFullResponse !== initialConfig.current.copyFullResponse) {
1535
+ formattedChanges.push(`${globalConfig.copyFullResponse ? "Enabled" : "Disabled"} always copy full response`);
1536
+ }
1537
+ if (globalConfig.copyOnSelect !== initialConfig.current.copyOnSelect) {
1538
+ formattedChanges.push(`${globalConfig.copyOnSelect ? "Enabled" : "Disabled"} copy on select`);
1539
+ }
1540
+ if (globalConfig.terminalProgressBarEnabled !== initialConfig.current.terminalProgressBarEnabled) {
1541
+ formattedChanges.push(`${globalConfig.terminalProgressBarEnabled ? "Enabled" : "Disabled"} terminal progress bar`);
1542
+ }
1543
+ if (globalConfig.showStatusInTerminalTab !== initialConfig.current.showStatusInTerminalTab) {
1544
+ formattedChanges.push(`${globalConfig.showStatusInTerminalTab ? "Enabled" : "Disabled"} terminal tab status`);
1545
+ }
1546
+ if (globalConfig.showTurnDuration !== initialConfig.current.showTurnDuration) {
1547
+ formattedChanges.push(`${globalConfig.showTurnDuration ? "Enabled" : "Disabled"} turn duration`);
1548
+ }
1549
+ if (globalConfig.remoteControlAtStartup !== initialConfig.current.remoteControlAtStartup) {
1550
+ const remoteLabel = globalConfig.remoteControlAtStartup === undefined ? "Reset Remote Control to default" : `${globalConfig.remoteControlAtStartup ? "Enabled" : "Disabled"} Remote Control for all sessions`;
1551
+ formattedChanges.push(remoteLabel);
1552
+ }
1553
+ if (settingsData?.autoUpdatesChannel !== initialSettingsData.current?.autoUpdatesChannel) {
1554
+ formattedChanges.push(`Set auto-update channel to ${source_default.bold(settingsData?.autoUpdatesChannel ?? "latest")}`);
1555
+ }
1556
+ if (formattedChanges.length > 0) {
1557
+ onClose(formattedChanges.join(`
1558
+ `));
1559
+ } else {
1560
+ onClose("Config dialog dismissed", { display: "system" });
1561
+ }
1562
+ }, [
1563
+ showSubmenu,
1564
+ changes,
1565
+ globalConfig,
1566
+ mainLoopModel,
1567
+ currentOutputStyle,
1568
+ currentLanguage,
1569
+ settingsData?.autoUpdatesChannel,
1570
+ isFastModeEnabled() ? settingsData?.fastMode : undefined,
1571
+ onClose
1572
+ ]);
1573
+ const revertChanges = import_react4.useCallback(() => {
1574
+ if (themeSetting !== initialThemeSetting.current) {
1575
+ setTheme(initialThemeSetting.current);
1576
+ }
1577
+ saveGlobalConfig(() => initialConfig.current);
1578
+ const il = initialLocalSettings;
1579
+ updateSettingsForSource("localSettings", {
1580
+ spinnerTipsEnabled: il?.spinnerTipsEnabled,
1581
+ prefersReducedMotion: il?.prefersReducedMotion,
1582
+ defaultView: il?.defaultView,
1583
+ outputStyle: il?.outputStyle
1584
+ });
1585
+ const iu = initialUserSettings;
1586
+ updateSettingsForSource("userSettings", {
1587
+ alwaysThinkingEnabled: iu?.alwaysThinkingEnabled,
1588
+ fastMode: iu?.fastMode,
1589
+ promptSuggestionEnabled: iu?.promptSuggestionEnabled,
1590
+ autoUpdatesChannel: iu?.autoUpdatesChannel,
1591
+ minimumVersion: iu?.minimumVersion,
1592
+ language: iu?.language,
1593
+ ...{
1594
+ useAutoModeDuringPlan: iu?.useAutoModeDuringPlan
1595
+ },
1596
+ syntaxHighlightingDisabled: iu?.syntaxHighlightingDisabled,
1597
+ permissions: iu?.permissions === undefined ? undefined : { ...iu.permissions, defaultMode: iu.permissions.defaultMode }
1598
+ });
1599
+ const ia = initialAppState;
1600
+ setAppState((prev) => ({
1601
+ ...prev,
1602
+ mainLoopModel: ia.mainLoopModel,
1603
+ mainLoopModelForSession: ia.mainLoopModelForSession,
1604
+ verbose: ia.verbose,
1605
+ thinkingEnabled: ia.thinkingEnabled,
1606
+ fastMode: ia.fastMode,
1607
+ promptSuggestionEnabled: ia.promptSuggestionEnabled,
1608
+ isBriefOnly: ia.isBriefOnly,
1609
+ replBridgeEnabled: ia.replBridgeEnabled,
1610
+ replBridgeOutboundOnly: ia.replBridgeOutboundOnly,
1611
+ settings: ia.settings,
1612
+ toolPermissionContext: transitionPlanAutoMode(prev.toolPermissionContext)
1613
+ }));
1614
+ if (getUserMsgOptIn() !== initialUserMsgOptIn) {
1615
+ setUserMsgOptIn(initialUserMsgOptIn);
1616
+ }
1617
+ }, [
1618
+ themeSetting,
1619
+ setTheme,
1620
+ initialLocalSettings,
1621
+ initialUserSettings,
1622
+ initialAppState,
1623
+ initialUserMsgOptIn,
1624
+ setAppState
1625
+ ]);
1626
+ const handleEscape = import_react4.useCallback(() => {
1627
+ if (showSubmenu !== null) {
1628
+ return;
1629
+ }
1630
+ if (isDirty.current) {
1631
+ revertChanges();
1632
+ }
1633
+ onClose("Config dialog dismissed", { display: "system" });
1634
+ }, [showSubmenu, revertChanges, onClose]);
1635
+ useKeybinding("confirm:no", handleEscape, {
1636
+ context: "Settings",
1637
+ isActive: showSubmenu === null && !isSearchMode && !headerFocused
1638
+ });
1639
+ useKeybinding("settings:close", handleSaveAndClose, {
1640
+ context: "Settings",
1641
+ isActive: showSubmenu === null && !isSearchMode && !headerFocused
1642
+ });
1643
+ const toggleSetting = import_react4.useCallback(() => {
1644
+ const setting = filteredSettingsItems[selectedIndex];
1645
+ if (!setting || !setting.onChange) {
1646
+ return;
1647
+ }
1648
+ if (setting.type === "boolean") {
1649
+ isDirty.current = true;
1650
+ setting.onChange(!setting.value);
1651
+ if (setting.id === "thinkingEnabled") {
1652
+ const newValue = !setting.value;
1653
+ const backToInitial = newValue === initialThinkingEnabled.current;
1654
+ if (backToInitial) {
1655
+ setShowThinkingWarning(false);
1656
+ } else if (context.messages.some((m) => m.type === "assistant")) {
1657
+ setShowThinkingWarning(true);
1658
+ }
1659
+ }
1660
+ return;
1661
+ }
1662
+ if (setting.id === "theme" || setting.id === "model" || setting.id === "teammateDefaultModel" || setting.id === "showExternalIncludesDialog" || setting.id === "outputStyle" || setting.id === "language") {
1663
+ switch (setting.id) {
1664
+ case "theme":
1665
+ setShowSubmenu("Theme");
1666
+ setTabsHidden(true);
1667
+ return;
1668
+ case "model":
1669
+ setShowSubmenu("Model");
1670
+ setTabsHidden(true);
1671
+ return;
1672
+ case "teammateDefaultModel":
1673
+ setShowSubmenu("TeammateModel");
1674
+ setTabsHidden(true);
1675
+ return;
1676
+ case "showExternalIncludesDialog":
1677
+ setShowSubmenu("ExternalIncludes");
1678
+ setTabsHidden(true);
1679
+ return;
1680
+ case "outputStyle":
1681
+ setShowSubmenu("OutputStyle");
1682
+ setTabsHidden(true);
1683
+ return;
1684
+ case "language":
1685
+ setShowSubmenu("Language");
1686
+ setTabsHidden(true);
1687
+ return;
1688
+ }
1689
+ }
1690
+ if (setting.id === "autoUpdatesChannel") {
1691
+ if (autoUpdaterDisabledReason) {
1692
+ setShowSubmenu("EnableAutoUpdates");
1693
+ setTabsHidden(true);
1694
+ return;
1695
+ }
1696
+ const currentChannel = settingsData?.autoUpdatesChannel ?? "latest";
1697
+ if (currentChannel === "latest") {
1698
+ setShowSubmenu("ChannelDowngrade");
1699
+ setTabsHidden(true);
1700
+ } else {
1701
+ isDirty.current = true;
1702
+ updateSettingsForSource("userSettings", {
1703
+ autoUpdatesChannel: "latest",
1704
+ minimumVersion: undefined
1705
+ });
1706
+ setSettingsData((prev) => ({
1707
+ ...prev,
1708
+ autoUpdatesChannel: "latest",
1709
+ minimumVersion: undefined
1710
+ }));
1711
+ logEvent("tengu_autoupdate_channel_changed", {
1712
+ channel: "latest"
1713
+ });
1714
+ }
1715
+ return;
1716
+ }
1717
+ if (setting.type === "enum") {
1718
+ isDirty.current = true;
1719
+ const currentIndex = setting.options.indexOf(setting.value);
1720
+ const nextIndex = (currentIndex + 1) % setting.options.length;
1721
+ setting.onChange(setting.options[nextIndex]);
1722
+ return;
1723
+ }
1724
+ }, [
1725
+ autoUpdaterDisabledReason,
1726
+ filteredSettingsItems,
1727
+ selectedIndex,
1728
+ settingsData?.autoUpdatesChannel,
1729
+ setTabsHidden
1730
+ ]);
1731
+ const moveSelection = (delta) => {
1732
+ setShowThinkingWarning(false);
1733
+ const newIndex = Math.max(0, Math.min(filteredSettingsItems.length - 1, selectedIndex + delta));
1734
+ setSelectedIndex(newIndex);
1735
+ adjustScrollOffset(newIndex);
1736
+ };
1737
+ useKeybindings({
1738
+ "select:previous": () => {
1739
+ if (selectedIndex === 0) {
1740
+ setShowThinkingWarning(false);
1741
+ setIsSearchMode(true);
1742
+ setScrollOffset(0);
1743
+ } else {
1744
+ moveSelection(-1);
1745
+ }
1746
+ },
1747
+ "select:next": () => moveSelection(1),
1748
+ "scroll:lineUp": () => moveSelection(-1),
1749
+ "scroll:lineDown": () => moveSelection(1),
1750
+ "select:accept": toggleSetting,
1751
+ "select:previousValue": () => toggleSetting(),
1752
+ "select:nextValue": () => toggleSetting(),
1753
+ "settings:search": () => {
1754
+ setIsSearchMode(true);
1755
+ setSearchQuery("");
1756
+ }
1757
+ }, {
1758
+ context: "Settings",
1759
+ isActive: showSubmenu === null && !isSearchMode && !headerFocused
1760
+ });
1761
+ const handleKeyDown = import_react4.useCallback((e) => {
1762
+ if (showSubmenu !== null)
1763
+ return;
1764
+ if (headerFocused)
1765
+ return;
1766
+ if (isSearchMode) {
1767
+ if (e.key === "escape") {
1768
+ e.preventDefault();
1769
+ if (searchQuery.length > 0) {
1770
+ setSearchQuery("");
1771
+ } else {
1772
+ setIsSearchMode(false);
1773
+ }
1774
+ return;
1775
+ }
1776
+ if (e.key === "return" || e.key === "down" || e.key === "wheeldown") {
1777
+ e.preventDefault();
1778
+ setIsSearchMode(false);
1779
+ setSelectedIndex(0);
1780
+ setScrollOffset(0);
1781
+ }
1782
+ return;
1783
+ }
1784
+ if (e.key === "left" || e.key === "right" || e.key === "tab") {
1785
+ e.preventDefault();
1786
+ toggleSetting();
1787
+ return;
1788
+ }
1789
+ if (e.ctrl || e.meta)
1790
+ return;
1791
+ if (e.key === "j" || e.key === "k" || e.key === "/")
1792
+ return;
1793
+ if (e.key.length === 1 && e.key !== " ") {
1794
+ e.preventDefault();
1795
+ setIsSearchMode(true);
1796
+ setSearchQuery(e.key);
1797
+ }
1798
+ }, [showSubmenu, headerFocused, isSearchMode, searchQuery, setSearchQuery, toggleSetting]);
1799
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1800
+ flexDirection: "column",
1801
+ width: "100%",
1802
+ tabIndex: 0,
1803
+ autoFocus: true,
1804
+ onKeyDown: handleKeyDown,
1805
+ children: showSubmenu === "Theme" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1806
+ children: [
1807
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemePicker, {
1808
+ onThemeSelect: (setting) => {
1809
+ isDirty.current = true;
1810
+ setTheme(setting);
1811
+ setShowSubmenu(null);
1812
+ setTabsHidden(false);
1813
+ },
1814
+ onCancel: () => {
1815
+ setShowSubmenu(null);
1816
+ setTabsHidden(false);
1817
+ },
1818
+ hideEscToCancel: true,
1819
+ skipExitHandling: true
1820
+ }, undefined, false, undefined, this),
1821
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1822
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1823
+ dimColor: true,
1824
+ italic: true,
1825
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
1826
+ children: [
1827
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
1828
+ shortcut: "Enter",
1829
+ action: "select"
1830
+ }, undefined, false, undefined, this),
1831
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
1832
+ action: "confirm:no",
1833
+ context: "Confirmation",
1834
+ fallback: "Esc",
1835
+ description: "cancel"
1836
+ }, undefined, false, undefined, this)
1837
+ ]
1838
+ }, undefined, true, undefined, this)
1839
+ }, undefined, false, undefined, this)
1840
+ }, undefined, false, undefined, this)
1841
+ ]
1842
+ }, undefined, true, undefined, this) : showSubmenu === "Model" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1843
+ children: [
1844
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ModelPicker, {
1845
+ initial: mainLoopModel,
1846
+ onSelect: (model, _effort) => {
1847
+ isDirty.current = true;
1848
+ onChangeMainModelConfig(model);
1849
+ setShowSubmenu(null);
1850
+ setTabsHidden(false);
1851
+ },
1852
+ onCancel: () => {
1853
+ setShowSubmenu(null);
1854
+ setTabsHidden(false);
1855
+ },
1856
+ showFastModeNotice: isFastModeEnabled() ? isFastMode && isFastModeSupportedByModel(mainLoopModel) && isFastModeAvailable() : false
1857
+ }, undefined, false, undefined, this),
1858
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1859
+ dimColor: true,
1860
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
1861
+ children: [
1862
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
1863
+ shortcut: "Enter",
1864
+ action: "confirm"
1865
+ }, undefined, false, undefined, this),
1866
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
1867
+ action: "confirm:no",
1868
+ context: "Confirmation",
1869
+ fallback: "Esc",
1870
+ description: "cancel"
1871
+ }, undefined, false, undefined, this)
1872
+ ]
1873
+ }, undefined, true, undefined, this)
1874
+ }, undefined, false, undefined, this)
1875
+ ]
1876
+ }, undefined, true, undefined, this) : showSubmenu === "TeammateModel" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1877
+ children: [
1878
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ModelPicker, {
1879
+ initial: globalConfig.teammateDefaultModel ?? null,
1880
+ skipSettingsWrite: true,
1881
+ headerText: "Default model for newly spawned teammates. The leader can override via the tool call's model parameter.",
1882
+ onSelect: (model, _effort) => {
1883
+ setShowSubmenu(null);
1884
+ setTabsHidden(false);
1885
+ if (globalConfig.teammateDefaultModel === undefined && model === null) {
1886
+ return;
1887
+ }
1888
+ isDirty.current = true;
1889
+ saveGlobalConfig((current) => current.teammateDefaultModel === model ? current : { ...current, teammateDefaultModel: model });
1890
+ setGlobalConfig({
1891
+ ...getGlobalConfig(),
1892
+ teammateDefaultModel: model
1893
+ });
1894
+ setChanges((prev) => ({
1895
+ ...prev,
1896
+ teammateDefaultModel: teammateModelDisplayString(model)
1897
+ }));
1898
+ logEvent("tengu_teammate_default_model_changed", {
1899
+ model
1900
+ });
1901
+ },
1902
+ onCancel: () => {
1903
+ setShowSubmenu(null);
1904
+ setTabsHidden(false);
1905
+ }
1906
+ }, undefined, false, undefined, this),
1907
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1908
+ dimColor: true,
1909
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
1910
+ children: [
1911
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
1912
+ shortcut: "Enter",
1913
+ action: "confirm"
1914
+ }, undefined, false, undefined, this),
1915
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
1916
+ action: "confirm:no",
1917
+ context: "Confirmation",
1918
+ fallback: "Esc",
1919
+ description: "cancel"
1920
+ }, undefined, false, undefined, this)
1921
+ ]
1922
+ }, undefined, true, undefined, this)
1923
+ }, undefined, false, undefined, this)
1924
+ ]
1925
+ }, undefined, true, undefined, this) : showSubmenu === "ExternalIncludes" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1926
+ children: [
1927
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ClaudeMdExternalIncludesDialog, {
1928
+ onDone: () => {
1929
+ setShowSubmenu(null);
1930
+ setTabsHidden(false);
1931
+ },
1932
+ externalIncludes: getExternalClaudeMdIncludes(memoryFiles)
1933
+ }, undefined, false, undefined, this),
1934
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1935
+ dimColor: true,
1936
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
1937
+ children: [
1938
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
1939
+ shortcut: "Enter",
1940
+ action: "confirm"
1941
+ }, undefined, false, undefined, this),
1942
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
1943
+ action: "confirm:no",
1944
+ context: "Confirmation",
1945
+ fallback: "Esc",
1946
+ description: "disable external includes"
1947
+ }, undefined, false, undefined, this)
1948
+ ]
1949
+ }, undefined, true, undefined, this)
1950
+ }, undefined, false, undefined, this)
1951
+ ]
1952
+ }, undefined, true, undefined, this) : showSubmenu === "OutputStyle" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1953
+ children: [
1954
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(OutputStylePicker, {
1955
+ initialStyle: currentOutputStyle,
1956
+ onComplete: (style) => {
1957
+ isDirty.current = true;
1958
+ setCurrentOutputStyle(style ?? DEFAULT_OUTPUT_STYLE_NAME);
1959
+ setShowSubmenu(null);
1960
+ setTabsHidden(false);
1961
+ updateSettingsForSource("localSettings", {
1962
+ outputStyle: style
1963
+ });
1964
+ logEvent("tengu_output_style_changed", {
1965
+ style: style ?? DEFAULT_OUTPUT_STYLE_NAME,
1966
+ source: "config_panel",
1967
+ settings_source: "localSettings"
1968
+ });
1969
+ },
1970
+ onCancel: () => {
1971
+ setShowSubmenu(null);
1972
+ setTabsHidden(false);
1973
+ }
1974
+ }, undefined, false, undefined, this),
1975
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1976
+ dimColor: true,
1977
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
1978
+ children: [
1979
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
1980
+ shortcut: "Enter",
1981
+ action: "confirm"
1982
+ }, undefined, false, undefined, this),
1983
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
1984
+ action: "confirm:no",
1985
+ context: "Confirmation",
1986
+ fallback: "Esc",
1987
+ description: "cancel"
1988
+ }, undefined, false, undefined, this)
1989
+ ]
1990
+ }, undefined, true, undefined, this)
1991
+ }, undefined, false, undefined, this)
1992
+ ]
1993
+ }, undefined, true, undefined, this) : showSubmenu === "Language" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
1994
+ children: [
1995
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(LanguagePicker, {
1996
+ initialLanguage: currentLanguage,
1997
+ onComplete: (language) => {
1998
+ isDirty.current = true;
1999
+ setCurrentLanguage(language);
2000
+ setShowSubmenu(null);
2001
+ setTabsHidden(false);
2002
+ updateSettingsForSource("userSettings", {
2003
+ language
2004
+ });
2005
+ logEvent("tengu_language_changed", {
2006
+ language: language ?? "default",
2007
+ source: "config_panel"
2008
+ });
2009
+ },
2010
+ onCancel: () => {
2011
+ setShowSubmenu(null);
2012
+ setTabsHidden(false);
2013
+ }
2014
+ }, undefined, false, undefined, this),
2015
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2016
+ dimColor: true,
2017
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2018
+ children: [
2019
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2020
+ shortcut: "Enter",
2021
+ action: "confirm"
2022
+ }, undefined, false, undefined, this),
2023
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2024
+ action: "confirm:no",
2025
+ context: "Settings",
2026
+ fallback: "Esc",
2027
+ description: "cancel"
2028
+ }, undefined, false, undefined, this)
2029
+ ]
2030
+ }, undefined, true, undefined, this)
2031
+ }, undefined, false, undefined, this)
2032
+ ]
2033
+ }, undefined, true, undefined, this) : showSubmenu === "EnableAutoUpdates" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Dialog, {
2034
+ title: "Enable Auto-Updates",
2035
+ onCancel: () => {
2036
+ setShowSubmenu(null);
2037
+ setTabsHidden(false);
2038
+ },
2039
+ hideBorder: true,
2040
+ hideInputGuide: true,
2041
+ children: autoUpdaterDisabledReason?.type !== "config" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2042
+ children: [
2043
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2044
+ children: autoUpdaterDisabledReason?.type === "env" ? "Auto-updates are controlled by an environment variable and cannot be changed here." : "Auto-updates are disabled in development builds."
2045
+ }, undefined, false, undefined, this),
2046
+ autoUpdaterDisabledReason?.type === "env" && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2047
+ dimColor: true,
2048
+ children: [
2049
+ "Unset ",
2050
+ autoUpdaterDisabledReason.envVar,
2051
+ " to re-enable auto-updates."
2052
+ ]
2053
+ }, undefined, true, undefined, this)
2054
+ ]
2055
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Select, {
2056
+ options: [
2057
+ {
2058
+ label: "Enable with latest channel",
2059
+ value: "latest"
2060
+ },
2061
+ {
2062
+ label: "Enable with stable channel",
2063
+ value: "stable"
2064
+ }
2065
+ ],
2066
+ onChange: (channel) => {
2067
+ isDirty.current = true;
2068
+ setShowSubmenu(null);
2069
+ setTabsHidden(false);
2070
+ saveGlobalConfig((current) => ({
2071
+ ...current,
2072
+ autoUpdates: true
2073
+ }));
2074
+ setGlobalConfig({ ...getGlobalConfig(), autoUpdates: true });
2075
+ updateSettingsForSource("userSettings", {
2076
+ autoUpdatesChannel: channel,
2077
+ minimumVersion: undefined
2078
+ });
2079
+ setSettingsData((prev) => ({
2080
+ ...prev,
2081
+ autoUpdatesChannel: channel,
2082
+ minimumVersion: undefined
2083
+ }));
2084
+ logEvent("tengu_autoupdate_enabled", {
2085
+ channel
2086
+ });
2087
+ }
2088
+ }, undefined, false, undefined, this)
2089
+ }, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ChannelDowngradeDialog, {
2090
+ currentVersion: "1.0.0",
2091
+ onChoice: (choice) => {
2092
+ setShowSubmenu(null);
2093
+ setTabsHidden(false);
2094
+ if (choice === "cancel") {
2095
+ return;
2096
+ }
2097
+ isDirty.current = true;
2098
+ const newSettings = {
2099
+ autoUpdatesChannel: "stable"
2100
+ };
2101
+ if (choice === "stay") {
2102
+ newSettings.minimumVersion = "1.0.0";
2103
+ }
2104
+ updateSettingsForSource("userSettings", newSettings);
2105
+ setSettingsData((prev) => ({
2106
+ ...prev,
2107
+ ...newSettings
2108
+ }));
2109
+ logEvent("tengu_autoupdate_channel_changed", {
2110
+ channel: "stable",
2111
+ minimum_version_set: choice === "stay"
2112
+ });
2113
+ }
2114
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2115
+ flexDirection: "column",
2116
+ gap: 1,
2117
+ marginY: insideModal ? undefined : 1,
2118
+ children: [
2119
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SearchBox, {
2120
+ query: searchQuery,
2121
+ isFocused: isSearchMode && !headerFocused,
2122
+ isTerminalFocused,
2123
+ cursorOffset: searchCursorOffset,
2124
+ placeholder: "Search settings\u2026"
2125
+ }, undefined, false, undefined, this),
2126
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2127
+ flexDirection: "column",
2128
+ children: filteredSettingsItems.length === 0 ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2129
+ dimColor: true,
2130
+ italic: true,
2131
+ children: [
2132
+ 'No settings match "',
2133
+ searchQuery,
2134
+ '"'
2135
+ ]
2136
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2137
+ children: [
2138
+ scrollOffset > 0 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2139
+ dimColor: true,
2140
+ children: [
2141
+ figures_default.arrowUp,
2142
+ " ",
2143
+ scrollOffset,
2144
+ " more above"
2145
+ ]
2146
+ }, undefined, true, undefined, this),
2147
+ filteredSettingsItems.slice(scrollOffset, scrollOffset + maxVisible).map((setting, i) => {
2148
+ const actualIndex = scrollOffset + i;
2149
+ const isSelected = actualIndex === selectedIndex && !headerFocused && !isSearchMode;
2150
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(React3.Fragment, {
2151
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2152
+ width: "100%",
2153
+ children: [
2154
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2155
+ width: 44,
2156
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2157
+ color: isSelected ? "suggestion" : undefined,
2158
+ children: [
2159
+ isSelected ? figures_default.pointer : " ",
2160
+ " ",
2161
+ setting.label
2162
+ ]
2163
+ }, undefined, true, undefined, this)
2164
+ }, undefined, false, undefined, this),
2165
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2166
+ flexGrow: 1,
2167
+ children: setting.type === "boolean" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(jsx_dev_runtime5.Fragment, {
2168
+ children: [
2169
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2170
+ color: isSelected ? "suggestion" : undefined,
2171
+ children: setting.value.toString()
2172
+ }, undefined, false, undefined, this),
2173
+ showThinkingWarning && setting.id === "thinkingEnabled" && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2174
+ color: "warning",
2175
+ children: [
2176
+ " ",
2177
+ "Changing thinking mode mid-conversation will increase latency and may reduce quality."
2178
+ ]
2179
+ }, undefined, true, undefined, this)
2180
+ ]
2181
+ }, undefined, true, undefined, this) : setting.id === "theme" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2182
+ color: isSelected ? "suggestion" : undefined,
2183
+ children: THEME_LABELS[setting.value.toString()] ?? setting.value.toString()
2184
+ }, undefined, false, undefined, this) : setting.id === "notifChannel" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2185
+ color: isSelected ? "suggestion" : undefined,
2186
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(NotifChannelLabel, {
2187
+ value: setting.value.toString()
2188
+ }, undefined, false, undefined, this)
2189
+ }, undefined, false, undefined, this) : setting.id === "defaultPermissionMode" ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2190
+ color: isSelected ? "suggestion" : undefined,
2191
+ children: permissionModeShortTitle(setting.value)
2192
+ }, undefined, false, undefined, this) : setting.id === "autoUpdatesChannel" && autoUpdaterDisabledReason ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
2193
+ flexDirection: "column",
2194
+ children: [
2195
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2196
+ color: isSelected ? "suggestion" : undefined,
2197
+ children: "disabled"
2198
+ }, undefined, false, undefined, this),
2199
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2200
+ dimColor: true,
2201
+ children: [
2202
+ "(",
2203
+ formatAutoUpdaterDisabledReason(autoUpdaterDisabledReason),
2204
+ ")"
2205
+ ]
2206
+ }, undefined, true, undefined, this)
2207
+ ]
2208
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2209
+ color: isSelected ? "suggestion" : undefined,
2210
+ children: setting.value.toString()
2211
+ }, undefined, false, undefined, this)
2212
+ }, undefined, false, undefined, this)
2213
+ ]
2214
+ }, undefined, true, undefined, this)
2215
+ }, setting.id, false, undefined, this);
2216
+ }),
2217
+ scrollOffset + maxVisible < filteredSettingsItems.length && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2218
+ dimColor: true,
2219
+ children: [
2220
+ figures_default.arrowDown,
2221
+ " ",
2222
+ filteredSettingsItems.length - scrollOffset - maxVisible,
2223
+ " more below"
2224
+ ]
2225
+ }, undefined, true, undefined, this)
2226
+ ]
2227
+ }, undefined, true, undefined, this)
2228
+ }, undefined, false, undefined, this),
2229
+ headerFocused ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2230
+ dimColor: true,
2231
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2232
+ children: [
2233
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2234
+ shortcut: "\u2190/\u2192 tab",
2235
+ action: "switch"
2236
+ }, undefined, false, undefined, this),
2237
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2238
+ shortcut: "\u2193",
2239
+ action: "return"
2240
+ }, undefined, false, undefined, this),
2241
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2242
+ action: "confirm:no",
2243
+ context: "Settings",
2244
+ fallback: "Esc",
2245
+ description: "close"
2246
+ }, undefined, false, undefined, this)
2247
+ ]
2248
+ }, undefined, true, undefined, this)
2249
+ }, undefined, false, undefined, this) : isSearchMode ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2250
+ dimColor: true,
2251
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2252
+ children: [
2253
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2254
+ children: "Type to filter"
2255
+ }, undefined, false, undefined, this),
2256
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2257
+ shortcut: "Enter/\u2193",
2258
+ action: "select"
2259
+ }, undefined, false, undefined, this),
2260
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(KeyboardShortcutHint, {
2261
+ shortcut: "\u2191",
2262
+ action: "tabs"
2263
+ }, undefined, false, undefined, this),
2264
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2265
+ action: "confirm:no",
2266
+ context: "Settings",
2267
+ fallback: "Esc",
2268
+ description: "clear"
2269
+ }, undefined, false, undefined, this)
2270
+ ]
2271
+ }, undefined, true, undefined, this)
2272
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2273
+ dimColor: true,
2274
+ children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Byline, {
2275
+ children: [
2276
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2277
+ action: "select:accept",
2278
+ context: "Settings",
2279
+ fallback: "Space",
2280
+ description: "change"
2281
+ }, undefined, false, undefined, this),
2282
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2283
+ action: "settings:close",
2284
+ context: "Settings",
2285
+ fallback: "Enter",
2286
+ description: "save"
2287
+ }, undefined, false, undefined, this),
2288
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2289
+ action: "settings:search",
2290
+ context: "Settings",
2291
+ fallback: "/",
2292
+ description: "search"
2293
+ }, undefined, false, undefined, this),
2294
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ConfigurableShortcutHint, {
2295
+ action: "confirm:no",
2296
+ context: "Settings",
2297
+ fallback: "Esc",
2298
+ description: "cancel"
2299
+ }, undefined, false, undefined, this)
2300
+ ]
2301
+ }, undefined, true, undefined, this)
2302
+ }, undefined, false, undefined, this)
2303
+ ]
2304
+ }, undefined, true, undefined, this)
2305
+ }, undefined, false, undefined, this);
2306
+ }
2307
+ function teammateModelDisplayString(value) {
2308
+ if (value === undefined) {
2309
+ return modelDisplayString(getHardcodedTeammateModelFallback());
2310
+ }
2311
+ if (value === null)
2312
+ return "Default (leader's model)";
2313
+ return modelDisplayString(value);
2314
+ }
2315
+ function NotifChannelLabel({ value }) {
2316
+ switch (value) {
2317
+ case "auto":
2318
+ return "Auto";
2319
+ case "iterm2":
2320
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2321
+ children: [
2322
+ "iTerm2 ",
2323
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2324
+ dimColor: true,
2325
+ children: "(OSC 9)"
2326
+ }, undefined, false, undefined, this)
2327
+ ]
2328
+ }, undefined, true, undefined, this);
2329
+ case "terminal_bell":
2330
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2331
+ children: [
2332
+ "Terminal Bell ",
2333
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2334
+ dimColor: true,
2335
+ children: "(\\a)"
2336
+ }, undefined, false, undefined, this)
2337
+ ]
2338
+ }, undefined, true, undefined, this);
2339
+ case "kitty":
2340
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2341
+ children: [
2342
+ "Kitty ",
2343
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2344
+ dimColor: true,
2345
+ children: "(OSC 99)"
2346
+ }, undefined, false, undefined, this)
2347
+ ]
2348
+ }, undefined, true, undefined, this);
2349
+ case "ghostty":
2350
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2351
+ children: [
2352
+ "Ghostty ",
2353
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
2354
+ dimColor: true,
2355
+ children: "(OSC 777)"
2356
+ }, undefined, false, undefined, this)
2357
+ ]
2358
+ }, undefined, true, undefined, this);
2359
+ case "iterm2_with_bell":
2360
+ return "iTerm2 w/ Bell";
2361
+ case "notifications_disabled":
2362
+ return "Disabled";
2363
+ default:
2364
+ return value;
2365
+ }
2366
+ }
2367
+ var React3, import_react4, jsx_dev_runtime5, THEME_LABELS;
2368
+ var init_Config = __esm(() => {
2369
+ init_src();
2370
+ init_useKeybinding();
2371
+ init_figures();
2372
+ init_config();
2373
+ init_authPortable();
2374
+ init_config();
2375
+ init_source();
2376
+ init_PermissionMode();
2377
+ init_permissionSetup();
2378
+ init_log();
2379
+ init_analytics();
2380
+ init_bridgeEnabled();
2381
+ init_ThemePicker();
2382
+ init_AppState();
2383
+ init_ModelPicker();
2384
+ init_model();
2385
+ init_extraUsage();
2386
+ init_ClaudeMdExternalIncludesDialog();
2387
+ init_ChannelDowngradeDialog();
2388
+ init_src();
2389
+ init_CustomSelect();
2390
+ init_OutputStylePicker();
2391
+ init_LanguagePicker();
2392
+ init_claudemd();
2393
+ init_src();
2394
+ init_ConfigurableShortcutHint();
2395
+ init_modalContext();
2396
+ init_SearchBox();
2397
+ init_ide();
2398
+ init_settings();
2399
+ init_state();
2400
+ init_outputStyles();
2401
+ init_envUtils();
2402
+ init_growthbook();
2403
+ init_agentSwarmsEnabled();
2404
+ init_teammateModeSnapshot();
2405
+ init_teammateModel();
2406
+ init_useSearchInput();
2407
+ init_useTerminalSize();
2408
+ init_fastMode();
2409
+ init_fullscreen();
2410
+ init_platform();
2411
+ React3 = __toESM(require_react(), 1);
2412
+ import_react4 = __toESM(require_react(), 1);
2413
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
2414
+ THEME_LABELS = {
2415
+ auto: "Auto (match terminal)",
2416
+ dark: "Dark mode",
2417
+ light: "Light mode",
2418
+ "dark-daltonized": "Dark mode (colorblind-friendly)",
2419
+ "light-daltonized": "Light mode (colorblind-friendly)",
2420
+ "dark-ansi": "Dark mode (ANSI colors only)",
2421
+ "light-ansi": "Light mode (ANSI colors only)"
2422
+ };
2423
+ });
2424
+
2425
+ // src/components/Settings/Usage.tsx
2426
+ function LimitBar({
2427
+ title,
2428
+ limit,
2429
+ maxWidth,
2430
+ showTimeInReset = true,
2431
+ extraSubtext
2432
+ }) {
2433
+ const { utilization, resets_at } = limit;
2434
+ if (utilization === null) {
2435
+ return null;
2436
+ }
2437
+ const usedText = `${Math.floor(utilization)}% used`;
2438
+ let subtext;
2439
+ if (resets_at) {
2440
+ subtext = `Resets ${formatResetText(resets_at, true, showTimeInReset)}`;
2441
+ }
2442
+ if (extraSubtext) {
2443
+ if (subtext) {
2444
+ subtext = `${extraSubtext} \xB7 ${subtext}`;
2445
+ } else {
2446
+ subtext = extraSubtext;
2447
+ }
2448
+ }
2449
+ const maxBarWidth = 50;
2450
+ const usedLabelSpace = 12;
2451
+ if (maxWidth >= maxBarWidth + usedLabelSpace) {
2452
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2453
+ flexDirection: "column",
2454
+ children: [
2455
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2456
+ bold: true,
2457
+ children: title
2458
+ }, undefined, false, undefined, this),
2459
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2460
+ flexDirection: "row",
2461
+ gap: 1,
2462
+ children: [
2463
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ProgressBar, {
2464
+ ratio: utilization / 100,
2465
+ width: maxBarWidth,
2466
+ fillColor: "rate_limit_fill",
2467
+ emptyColor: "rate_limit_empty"
2468
+ }, undefined, false, undefined, this),
2469
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2470
+ children: usedText
2471
+ }, undefined, false, undefined, this)
2472
+ ]
2473
+ }, undefined, true, undefined, this),
2474
+ subtext && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2475
+ dimColor: true,
2476
+ children: subtext
2477
+ }, undefined, false, undefined, this)
2478
+ ]
2479
+ }, undefined, true, undefined, this);
2480
+ } else {
2481
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2482
+ flexDirection: "column",
2483
+ children: [
2484
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2485
+ children: [
2486
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2487
+ bold: true,
2488
+ children: title
2489
+ }, undefined, false, undefined, this),
2490
+ subtext && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
2491
+ children: [
2492
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2493
+ children: " "
2494
+ }, undefined, false, undefined, this),
2495
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2496
+ dimColor: true,
2497
+ children: [
2498
+ "\xB7 ",
2499
+ subtext
2500
+ ]
2501
+ }, undefined, true, undefined, this)
2502
+ ]
2503
+ }, undefined, true, undefined, this)
2504
+ ]
2505
+ }, undefined, true, undefined, this),
2506
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ProgressBar, {
2507
+ ratio: utilization / 100,
2508
+ width: maxWidth,
2509
+ fillColor: "rate_limit_fill",
2510
+ emptyColor: "rate_limit_empty"
2511
+ }, undefined, false, undefined, this),
2512
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2513
+ children: usedText
2514
+ }, undefined, false, undefined, this)
2515
+ ]
2516
+ }, undefined, true, undefined, this);
2517
+ }
2518
+ }
2519
+ function Usage() {
2520
+ const [utilization, setUtilization] = import_react5.useState(null);
2521
+ const [error, setError] = import_react5.useState(null);
2522
+ const [isLoading, setIsLoading] = import_react5.useState(true);
2523
+ const { columns } = useTerminalSize();
2524
+ const availableWidth = columns - 2;
2525
+ const maxWidth = Math.min(availableWidth, 80);
2526
+ const loadUtilization = React4.useCallback(async () => {
2527
+ setIsLoading(true);
2528
+ setError(null);
2529
+ try {
2530
+ const data = await fetchUtilization();
2531
+ setUtilization(data);
2532
+ } catch (err) {
2533
+ logError(err);
2534
+ const axiosError = err;
2535
+ const responseBody = axiosError.response?.data ? jsonStringify(axiosError.response.data) : undefined;
2536
+ setError(responseBody ? `Failed to load usage data: ${responseBody}` : "Failed to load usage data");
2537
+ } finally {
2538
+ setIsLoading(false);
2539
+ }
2540
+ }, []);
2541
+ import_react5.useEffect(() => {
2542
+ loadUtilization();
2543
+ }, [loadUtilization]);
2544
+ useKeybinding("settings:retry", () => {
2545
+ loadUtilization();
2546
+ }, { context: "Settings", isActive: !!error && !isLoading });
2547
+ if (error) {
2548
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2549
+ flexDirection: "column",
2550
+ gap: 1,
2551
+ children: [
2552
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2553
+ color: "error",
2554
+ children: [
2555
+ "Error: ",
2556
+ error
2557
+ ]
2558
+ }, undefined, true, undefined, this),
2559
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2560
+ dimColor: true,
2561
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Byline, {
2562
+ children: [
2563
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
2564
+ action: "settings:retry",
2565
+ context: "Settings",
2566
+ fallback: "r",
2567
+ description: "retry"
2568
+ }, undefined, false, undefined, this),
2569
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
2570
+ action: "confirm:no",
2571
+ context: "Settings",
2572
+ fallback: "Esc",
2573
+ description: "cancel"
2574
+ }, undefined, false, undefined, this)
2575
+ ]
2576
+ }, undefined, true, undefined, this)
2577
+ }, undefined, false, undefined, this)
2578
+ ]
2579
+ }, undefined, true, undefined, this);
2580
+ }
2581
+ if (!utilization) {
2582
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2583
+ flexDirection: "column",
2584
+ gap: 1,
2585
+ children: [
2586
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2587
+ dimColor: true,
2588
+ children: "Loading usage data\u2026"
2589
+ }, undefined, false, undefined, this),
2590
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2591
+ dimColor: true,
2592
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
2593
+ action: "confirm:no",
2594
+ context: "Settings",
2595
+ fallback: "Esc",
2596
+ description: "cancel"
2597
+ }, undefined, false, undefined, this)
2598
+ }, undefined, false, undefined, this)
2599
+ ]
2600
+ }, undefined, true, undefined, this);
2601
+ }
2602
+ const subscriptionType = getSubscriptionType();
2603
+ const showSonnetBar = subscriptionType === "max" || subscriptionType === "team" || subscriptionType === null;
2604
+ const limits = [
2605
+ {
2606
+ title: "Current session",
2607
+ limit: utilization.five_hour
2608
+ },
2609
+ {
2610
+ title: "Current week (all models)",
2611
+ limit: utilization.seven_day
2612
+ },
2613
+ ...showSonnetBar ? [
2614
+ {
2615
+ title: "Current week (Sonnet only)",
2616
+ limit: utilization.seven_day_sonnet
2617
+ }
2618
+ ] : []
2619
+ ];
2620
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2621
+ flexDirection: "column",
2622
+ gap: 1,
2623
+ width: "100%",
2624
+ children: [
2625
+ limits.some(({ limit }) => limit) || /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2626
+ dimColor: true,
2627
+ children: "/usage is only available for subscription plans."
2628
+ }, undefined, false, undefined, this),
2629
+ limits.map(({ title, limit }) => limit && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(LimitBar, {
2630
+ title,
2631
+ limit,
2632
+ maxWidth
2633
+ }, title, false, undefined, this)),
2634
+ utilization.extra_usage && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ExtraUsageSection, {
2635
+ extraUsage: utilization.extra_usage,
2636
+ maxWidth
2637
+ }, undefined, false, undefined, this),
2638
+ isEligibleForOverageCreditGrant() && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(OverageCreditUpsell, {
2639
+ maxWidth
2640
+ }, undefined, false, undefined, this),
2641
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2642
+ dimColor: true,
2643
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ConfigurableShortcutHint, {
2644
+ action: "confirm:no",
2645
+ context: "Settings",
2646
+ fallback: "Esc",
2647
+ description: "cancel"
2648
+ }, undefined, false, undefined, this)
2649
+ }, undefined, false, undefined, this)
2650
+ ]
2651
+ }, undefined, true, undefined, this);
2652
+ }
2653
+ function ExtraUsageSection({
2654
+ extraUsage: extraUsage2,
2655
+ maxWidth
2656
+ }) {
2657
+ const subscriptionType = getSubscriptionType();
2658
+ const isProOrMax = subscriptionType === "pro" || subscriptionType === "max";
2659
+ if (!isProOrMax) {
2660
+ return false;
2661
+ }
2662
+ if (!extraUsage2.is_enabled) {
2663
+ if (extraUsage.isEnabled()) {
2664
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2665
+ flexDirection: "column",
2666
+ children: [
2667
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2668
+ bold: true,
2669
+ children: EXTRA_USAGE_SECTION_TITLE
2670
+ }, undefined, false, undefined, this),
2671
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2672
+ dimColor: true,
2673
+ children: "Extra usage not enabled \xB7 /extra-usage to enable"
2674
+ }, undefined, false, undefined, this)
2675
+ ]
2676
+ }, undefined, true, undefined, this);
2677
+ }
2678
+ return null;
2679
+ }
2680
+ if (extraUsage2.monthly_limit === null) {
2681
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
2682
+ flexDirection: "column",
2683
+ children: [
2684
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2685
+ bold: true,
2686
+ children: EXTRA_USAGE_SECTION_TITLE
2687
+ }, undefined, false, undefined, this),
2688
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
2689
+ dimColor: true,
2690
+ children: "Unlimited"
2691
+ }, undefined, false, undefined, this)
2692
+ ]
2693
+ }, undefined, true, undefined, this);
2694
+ }
2695
+ if (typeof extraUsage2.used_credits !== "number" || typeof extraUsage2.utilization !== "number") {
2696
+ return null;
2697
+ }
2698
+ const formattedUsedCredits = formatCost(extraUsage2.used_credits / 100, 2);
2699
+ const formattedMonthlyLimit = formatCost(extraUsage2.monthly_limit / 100, 2);
2700
+ const now = new Date;
2701
+ const oneMonthReset = new Date(now.getFullYear(), now.getMonth() + 1, 1);
2702
+ return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(LimitBar, {
2703
+ title: EXTRA_USAGE_SECTION_TITLE,
2704
+ limit: {
2705
+ utilization: extraUsage2.utilization,
2706
+ resets_at: oneMonthReset.toISOString()
2707
+ },
2708
+ showTimeInReset: false,
2709
+ extraSubtext: `${formattedUsedCredits} / ${formattedMonthlyLimit} spent`,
2710
+ maxWidth
2711
+ }, undefined, false, undefined, this);
2712
+ }
2713
+ var React4, import_react5, jsx_dev_runtime6, EXTRA_USAGE_SECTION_TITLE = "Extra usage";
2714
+ var init_Usage = __esm(() => {
2715
+ init_extra_usage();
2716
+ init_cost_tracker();
2717
+ init_auth();
2718
+ init_useTerminalSize();
2719
+ init_src();
2720
+ init_useKeybinding();
2721
+ init_usage();
2722
+ init_format();
2723
+ init_log();
2724
+ init_slowOperations();
2725
+ init_ConfigurableShortcutHint();
2726
+ init_src();
2727
+ init_OverageCreditUpsell();
2728
+ React4 = __toESM(require_react(), 1);
2729
+ import_react5 = __toESM(require_react(), 1);
2730
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
2731
+ });
2732
+
2733
+ // src/components/Settings/Settings.tsx
2734
+ function Settings({
2735
+ onClose,
2736
+ context,
2737
+ defaultTab
2738
+ }) {
2739
+ const [selectedTab, setSelectedTab] = import_react6.useState(defaultTab);
2740
+ const [tabsHidden, setTabsHidden] = import_react6.useState(false);
2741
+ const [configOwnsEsc, setConfigOwnsEsc] = import_react6.useState(false);
2742
+ const insideModal = useIsInsideModal();
2743
+ const { rows } = useModalOrTerminalSize(useTerminalSize());
2744
+ const contentHeight = insideModal ? rows + 1 : Math.max(15, Math.min(Math.floor(rows * 0.8), 30));
2745
+ const [diagnosticsPromise] = import_react6.useState(() => buildDiagnostics().catch(() => []));
2746
+ useExitOnCtrlCDWithKeybindings();
2747
+ const handleEscape = () => {
2748
+ if (tabsHidden) {
2749
+ return;
2750
+ }
2751
+ onClose("Status dialog dismissed", { display: "system" });
2752
+ };
2753
+ useKeybinding("confirm:no", handleEscape, {
2754
+ context: "Settings",
2755
+ isActive: !tabsHidden && !(selectedTab === "Config" && configOwnsEsc)
2756
+ });
2757
+ const tabs = [
2758
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2759
+ title: "Status",
2760
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Status, {
2761
+ context,
2762
+ diagnosticsPromise
2763
+ }, undefined, false, undefined, this)
2764
+ }, "status", false, undefined, this),
2765
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2766
+ title: "Config",
2767
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(import_react6.Suspense, {
2768
+ fallback: null,
2769
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Config, {
2770
+ context,
2771
+ onClose,
2772
+ setTabsHidden,
2773
+ onIsSearchModeChange: setConfigOwnsEsc,
2774
+ contentHeight
2775
+ }, undefined, false, undefined, this)
2776
+ }, undefined, false, undefined, this)
2777
+ }, "config", false, undefined, this),
2778
+ /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tab, {
2779
+ title: "Usage",
2780
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Usage, {}, undefined, false, undefined, this)
2781
+ }, "usage", false, undefined, this)
2782
+ ];
2783
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Pane, {
2784
+ color: "permission",
2785
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Tabs, {
2786
+ color: "permission",
2787
+ selectedTab,
2788
+ onTabChange: setSelectedTab,
2789
+ hidden: tabsHidden,
2790
+ initialHeaderFocused: defaultTab !== "Config",
2791
+ contentHeight: tabsHidden || insideModal ? undefined : contentHeight,
2792
+ children: tabs
2793
+ }, undefined, false, undefined, this)
2794
+ }, undefined, false, undefined, this);
2795
+ }
2796
+ var import_react6, jsx_dev_runtime7;
2797
+ var init_Settings = __esm(() => {
2798
+ init_useKeybinding();
2799
+ init_useExitOnCtrlCDWithKeybindings();
2800
+ init_useTerminalSize();
2801
+ init_modalContext();
2802
+ init_src();
2803
+ init_Status();
2804
+ init_Config();
2805
+ init_Usage();
2806
+ import_react6 = __toESM(require_react(), 1);
2807
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
2808
+ });
2809
+
2810
+ export { Settings, init_Settings };