@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,4395 @@
1
+ // @bun
2
+ import {
3
+ calculateLayoutDimensions,
4
+ calculateOptimalLeftWidth,
5
+ formatModelAndBilling,
6
+ formatWelcomeMessage,
7
+ getLayoutMode,
8
+ getLogoDisplayData,
9
+ getRecentActivitySync,
10
+ getRecentReleaseNotesSync,
11
+ init_logoV2Utils,
12
+ truncatePath
13
+ } from "./chunk-zkch6trx.js";
14
+ import {
15
+ init_systemTheme,
16
+ resolveThemeSetting
17
+ } from "./chunk-d2an0138.js";
18
+ import {
19
+ checkForReleaseNotesSync,
20
+ init_releaseNotes
21
+ } from "./chunk-td2gsz7s.js";
22
+ import {
23
+ AGENT_DESCRIPTIONS_THRESHOLD,
24
+ getAgentDescriptionsTotalTokens,
25
+ init_statusNoticeHelpers
26
+ } from "./chunk-n0qxskpr.js";
27
+ import {
28
+ OverageCreditUpsell,
29
+ createOverageCreditFeed,
30
+ incrementOverageCreditUpsellSeenCount,
31
+ init_OverageCreditUpsell,
32
+ useShowOverageCreditUpsell
33
+ } from "./chunk-p7hamd2c.js";
34
+ import {
35
+ PromptInputFooterSuggestions_default,
36
+ init_PromptInputFooterSuggestions
37
+ } from "./chunk-2rf6asgf.js";
38
+ import {
39
+ ModalContext,
40
+ init_modalContext
41
+ } from "./chunk-3y69j7y8.js";
42
+ import {
43
+ init_useMainLoopModel,
44
+ useMainLoopModel
45
+ } from "./chunk-g9vg5d7t.js";
46
+ import {
47
+ AssistantThinkingMessage,
48
+ BACKGROUND_BASH_SUMMARY_PREFIX,
49
+ EMPTY_STRING_SET,
50
+ INTERRUPT_MESSAGE,
51
+ INTERRUPT_MESSAGE_FOR_TOOL_USE,
52
+ InVirtualListContext,
53
+ MAX_MEMORY_CHARACTER_COUNT,
54
+ Message,
55
+ MessageActionsSelectedContext,
56
+ OffscreenFreeze,
57
+ SandboxManager,
58
+ StreamingMarkdown,
59
+ buildMessageLookups,
60
+ collapseReadSearchGroups,
61
+ createAssistantMessage,
62
+ deriveUUID,
63
+ exports_prompt as exports_prompt2,
64
+ extractTag,
65
+ findToolByName,
66
+ getDisplayMessageFromCollapsed,
67
+ getDumpPromptsPath,
68
+ getEffortSuffix,
69
+ getLargeMemoryFiles,
70
+ getMcpConfigsByScope,
71
+ getMemoryFiles,
72
+ getMessagesAfterCompactBoundary,
73
+ getProgressMessagesFromLookup,
74
+ getSiblingToolUseIDsFromLookup,
75
+ getTerminalIdeType,
76
+ getToolSearchOrReadInfo,
77
+ getToolUseID,
78
+ getToolUseIDs,
79
+ getToolUseIdsFromCollapsedGroup,
80
+ hasAnyToolInProgress,
81
+ hasThinkingContent,
82
+ hasUnresolvedHooksFromLookup,
83
+ hueToRgb,
84
+ init_AppState,
85
+ init_AssistantThinkingMessage,
86
+ init_LocalShellTask,
87
+ init_Markdown,
88
+ init_Message,
89
+ init_OffscreenFreeze,
90
+ init_ThemedText,
91
+ init_Tool,
92
+ init_advisor,
93
+ init_claudemd,
94
+ init_collapseReadSearch,
95
+ init_config as init_config2,
96
+ init_dumpPrompts,
97
+ init_effort,
98
+ init_fullscreen,
99
+ init_ide,
100
+ init_installedPluginsManager,
101
+ init_jetbrains,
102
+ init_messageActions,
103
+ init_messages1 as init_messages,
104
+ init_prompt7 as init_prompt2,
105
+ init_sandbox_adapter,
106
+ init_useShortcutDisplay,
107
+ init_useTerminalSize,
108
+ init_utils1 as init_utils,
109
+ isAdvisorBlock,
110
+ isFullscreenEnvEnabled,
111
+ isJetBrainsPluginInstalledCachedSync,
112
+ isNavigableMessage,
113
+ isNotEmptyMessage,
114
+ isSupportedJetBrainsTerminal,
115
+ loadInstalledPluginsV2,
116
+ normalizeMessages,
117
+ reorderMessagesInUI,
118
+ shouldShowUserMessage,
119
+ stripSystemReminders,
120
+ toIDEDisplayName,
121
+ toRGBColor,
122
+ toolCallOf,
123
+ useAppState,
124
+ useShortcutDisplay
125
+ } from "./chunk-gmdy2w3z.js";
126
+ import {
127
+ exports_proactive,
128
+ init_proactive
129
+ } from "./chunk-nzxfj0gq.js";
130
+ import {
131
+ getBuiltinPlugins,
132
+ init_builtinPlugins
133
+ } from "./chunk-7qey87th.js";
134
+ import {
135
+ checkCachedPassesEligibility,
136
+ formatCreditAmount,
137
+ getCachedReferrerReward,
138
+ getCachedRemainingPasses,
139
+ init_referral
140
+ } from "./chunk-hzxzvzw8.js";
141
+ import {
142
+ getSteps,
143
+ incrementProjectOnboardingSeenCount,
144
+ init_projectOnboardingState,
145
+ shouldShowProjectOnboarding
146
+ } from "./chunk-30wnahyg.js";
147
+ import {
148
+ init_voiceModeEnabled,
149
+ isVoiceModeEnabled
150
+ } from "./chunk-z0jgeax8.js";
151
+ import {
152
+ init_browser,
153
+ openBrowser,
154
+ openPath
155
+ } from "./chunk-6hr7742d.js";
156
+ import {
157
+ BLACK_CIRCLE,
158
+ TEARDROP_ASTERISK,
159
+ UP_ARROW,
160
+ exports_prompt,
161
+ getAnthropicApiKeyWithSource,
162
+ getApiKeyFromConfigOrMacOSKeychain,
163
+ getAuthTokenSource,
164
+ getDisplayPath,
165
+ getDynamicConfig_CACHED_MAY_BE_STALE,
166
+ getGlobalConfig,
167
+ getInitialSettings,
168
+ init_auth,
169
+ init_config1 as init_config,
170
+ init_figures as init_figures2,
171
+ init_file,
172
+ init_growthbook,
173
+ init_model,
174
+ init_prompt1 as init_prompt,
175
+ init_settings1 as init_settings,
176
+ init_stringUtils,
177
+ isClaudeAISubscriber,
178
+ isOpus1mMergeEnabled,
179
+ plural,
180
+ renderModelSetting,
181
+ saveGlobalConfig
182
+ } from "./chunk-eemjb825.js";
183
+ import {
184
+ init_sleep,
185
+ sleep
186
+ } from "./chunk-jmv7k0jn.js";
187
+ import {
188
+ formatNumber,
189
+ formatRelativeTimeAgo,
190
+ getStartupPerfLogPath,
191
+ init_format,
192
+ init_startupProfiler,
193
+ isDetailedProfilingEnabled,
194
+ truncate
195
+ } from "./chunk-q1vrhh0q.js";
196
+ import {
197
+ Divider,
198
+ ScrollBox_default,
199
+ TextHoverColorContext,
200
+ ThemedBox_default,
201
+ ThemedText,
202
+ color,
203
+ init_source,
204
+ init_src,
205
+ instances_default,
206
+ source_default,
207
+ stringWidth,
208
+ useAnimationFrame,
209
+ useTerminalNotification,
210
+ useTerminalSize
211
+ } from "./chunk-2g0ytd9d.js";
212
+ import {
213
+ require_jsx_dev_runtime,
214
+ require_react
215
+ } from "./chunk-de0qnnf7.js";
216
+ import {
217
+ init_analytics,
218
+ logEvent
219
+ } from "./chunk-j1mep9ck.js";
220
+ import {
221
+ getCwd,
222
+ init_cwd
223
+ } from "./chunk-pdvg91cg.js";
224
+ import {
225
+ figures_default,
226
+ init_figures
227
+ } from "./chunk-c5g9shkw.js";
228
+ import {
229
+ STATUS_TAG,
230
+ SUMMARY_TAG,
231
+ TASK_NOTIFICATION_TAG,
232
+ getDebugLogPath,
233
+ init_debug,
234
+ init_envUtils,
235
+ init_xml,
236
+ isDebugMode,
237
+ isDebugToStdErr,
238
+ isEnvTruthy,
239
+ logForDebugging
240
+ } from "./chunk-s3hafnk3.js";
241
+ import {
242
+ getAllowedChannels,
243
+ getHasDevChannels,
244
+ getIsRemoteMode,
245
+ init_state
246
+ } from "./chunk-9h9k5vz3.js";
247
+ import {
248
+ __esm,
249
+ __export,
250
+ __toCommonJS,
251
+ __toESM
252
+ } from "./chunk-hhsxm2yr.js";
253
+
254
+ // src/context/promptOverlayContext.tsx
255
+ function PromptOverlayProvider({
256
+ children
257
+ }) {
258
+ const [data, setData] = import_react.useState(null);
259
+ const [dialog, setDialog] = import_react.useState(null);
260
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SetContext.Provider, {
261
+ value: setData,
262
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SetDialogContext.Provider, {
263
+ value: setDialog,
264
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DataContext.Provider, {
265
+ value: data,
266
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DialogContext.Provider, {
267
+ value: dialog,
268
+ children
269
+ }, undefined, false, undefined, this)
270
+ }, undefined, false, undefined, this)
271
+ }, undefined, false, undefined, this)
272
+ }, undefined, false, undefined, this);
273
+ }
274
+ function usePromptOverlay() {
275
+ return import_react.useContext(DataContext);
276
+ }
277
+ function usePromptOverlayDialog() {
278
+ return import_react.useContext(DialogContext);
279
+ }
280
+ function useSetPromptOverlay(data) {
281
+ const set = import_react.useContext(SetContext);
282
+ import_react.useEffect(() => {
283
+ if (!set)
284
+ return;
285
+ set(data);
286
+ return () => set(null);
287
+ }, [set, data]);
288
+ }
289
+ function useSetPromptOverlayDialog(node) {
290
+ const set = import_react.useContext(SetDialogContext);
291
+ import_react.useEffect(() => {
292
+ if (!set)
293
+ return;
294
+ set(node);
295
+ return () => set(null);
296
+ }, [set, node]);
297
+ }
298
+ var import_react, jsx_dev_runtime, DataContext, SetContext, DialogContext, SetDialogContext;
299
+ var init_promptOverlayContext = __esm(() => {
300
+ import_react = __toESM(require_react(), 1);
301
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
302
+ DataContext = import_react.createContext(null);
303
+ SetContext = import_react.createContext(null);
304
+ DialogContext = import_react.createContext(null);
305
+ SetDialogContext = import_react.createContext(null);
306
+ });
307
+
308
+ // src/components/messages/nullRenderingAttachments.ts
309
+ function isNullRenderingAttachment(msg) {
310
+ return msg.type === "attachment" && NULL_RENDERING_ATTACHMENT_TYPES.has(msg.attachment.type);
311
+ }
312
+ var NULL_RENDERING_TYPES, NULL_RENDERING_ATTACHMENT_TYPES;
313
+ var init_nullRenderingAttachments = __esm(() => {
314
+ NULL_RENDERING_TYPES = [
315
+ "hook_success",
316
+ "hook_additional_context",
317
+ "hook_cancelled",
318
+ "command_permissions",
319
+ "agent_mention",
320
+ "budget_usd",
321
+ "critical_system_reminder",
322
+ "edited_image_file",
323
+ "edited_text_file",
324
+ "opened_file_in_ide",
325
+ "output_style",
326
+ "plan_mode",
327
+ "plan_mode_exit",
328
+ "plan_mode_reentry",
329
+ "structured_output",
330
+ "team_context",
331
+ "todo_reminder",
332
+ "context_efficiency",
333
+ "deferred_tools_delta",
334
+ "mcp_instructions_delta",
335
+ "companion_intro",
336
+ "token_usage",
337
+ "ultrathink_effort",
338
+ "max_turns_reached",
339
+ "task_reminder",
340
+ "auto_mode",
341
+ "auto_mode_exit",
342
+ "output_token_usage",
343
+ "verify_plan_reminder",
344
+ "current_session_memory",
345
+ "compaction_reminder",
346
+ "date_change"
347
+ ];
348
+ NULL_RENDERING_ATTACHMENT_TYPES = new Set(NULL_RENDERING_TYPES);
349
+ });
350
+
351
+ // src/components/FullscreenLayout.tsx
352
+ import { fileURLToPath } from "url";
353
+ function useUnseenDivider(messageCount) {
354
+ const [dividerIndex, setDividerIndex] = import_react2.useState(null);
355
+ const countRef = import_react2.useRef(messageCount);
356
+ countRef.current = messageCount;
357
+ const dividerYRef = import_react2.useRef(null);
358
+ const onRepin = import_react2.useCallback(() => {
359
+ setDividerIndex(null);
360
+ }, []);
361
+ const onScrollAway = import_react2.useCallback((handle) => {
362
+ const max = Math.max(0, handle.getScrollHeight() - handle.getViewportHeight());
363
+ if (handle.getScrollTop() + handle.getPendingDelta() >= max)
364
+ return;
365
+ if (dividerYRef.current === null) {
366
+ dividerYRef.current = handle.getScrollHeight();
367
+ setDividerIndex(countRef.current);
368
+ }
369
+ }, []);
370
+ const jumpToNew = import_react2.useCallback((handle) => {
371
+ if (!handle)
372
+ return;
373
+ handle.scrollToBottom();
374
+ }, []);
375
+ import_react2.useEffect(() => {
376
+ if (dividerIndex === null) {
377
+ dividerYRef.current = null;
378
+ } else if (messageCount < dividerIndex) {
379
+ dividerYRef.current = null;
380
+ setDividerIndex(null);
381
+ }
382
+ }, [messageCount, dividerIndex]);
383
+ const shiftDivider = import_react2.useCallback((indexDelta, heightDelta) => {
384
+ setDividerIndex((idx) => idx === null ? null : idx + indexDelta);
385
+ if (dividerYRef.current !== null) {
386
+ dividerYRef.current += heightDelta;
387
+ }
388
+ }, []);
389
+ return {
390
+ dividerIndex,
391
+ dividerYRef,
392
+ onScrollAway,
393
+ onRepin,
394
+ jumpToNew,
395
+ shiftDivider
396
+ };
397
+ }
398
+ function countUnseenAssistantTurns(messages, dividerIndex) {
399
+ let count = 0;
400
+ let prevWasAssistant = false;
401
+ for (let i = dividerIndex;i < messages.length; i++) {
402
+ const m = messages[i];
403
+ if (m.type === "progress")
404
+ continue;
405
+ if (m.type === "assistant" && !assistantHasVisibleText(m))
406
+ continue;
407
+ const isAssistant = m.type === "assistant";
408
+ if (isAssistant && !prevWasAssistant)
409
+ count++;
410
+ prevWasAssistant = isAssistant;
411
+ }
412
+ return count;
413
+ }
414
+ function assistantHasVisibleText(m) {
415
+ if (m.type !== "assistant")
416
+ return false;
417
+ if (!Array.isArray(m.message.content))
418
+ return false;
419
+ for (const b of m.message.content) {
420
+ if (typeof b !== "string" && b.type === "text" && b.text.trim() !== "")
421
+ return true;
422
+ }
423
+ return false;
424
+ }
425
+ function computeUnseenDivider(messages, dividerIndex) {
426
+ if (dividerIndex === null)
427
+ return;
428
+ let anchorIdx = dividerIndex;
429
+ while (anchorIdx < messages.length && (messages[anchorIdx]?.type === "progress" || isNullRenderingAttachment(messages[anchorIdx]))) {
430
+ anchorIdx++;
431
+ }
432
+ const uuid = messages[anchorIdx]?.uuid;
433
+ if (!uuid)
434
+ return;
435
+ const count = countUnseenAssistantTurns(messages, dividerIndex);
436
+ return { firstUnseenUuid: uuid, count: Math.max(1, count) };
437
+ }
438
+ function FullscreenLayout({
439
+ scrollable,
440
+ bottom,
441
+ overlay,
442
+ bottomFloat,
443
+ modal,
444
+ modalScrollRef,
445
+ scrollRef,
446
+ dividerYRef,
447
+ hidePill = false,
448
+ hideSticky = false,
449
+ newMessageCount = 0,
450
+ onPillClick
451
+ }) {
452
+ const { rows: terminalRows, columns } = useTerminalSize();
453
+ const [stickyPrompt, setStickyPrompt] = import_react2.useState(null);
454
+ const chromeCtx = import_react2.useMemo(() => ({ setStickyPrompt }), []);
455
+ const subscribe = import_react2.useCallback((listener) => scrollRef?.current?.subscribe(listener) ?? (() => {}), [scrollRef]);
456
+ const pillVisible = import_react2.useSyncExternalStore(subscribe, () => {
457
+ const s = scrollRef?.current;
458
+ const dividerY = dividerYRef?.current;
459
+ if (!s || dividerY == null)
460
+ return false;
461
+ return s.getScrollTop() + s.getPendingDelta() + s.getViewportHeight() < dividerY;
462
+ });
463
+ import_react2.useLayoutEffect(() => {
464
+ if (!isFullscreenEnvEnabled())
465
+ return;
466
+ const ink = instances_default.get(process.stdout);
467
+ if (!ink)
468
+ return;
469
+ ink.onHyperlinkClick = (url) => {
470
+ if (url.startsWith("file:")) {
471
+ try {
472
+ openPath(fileURLToPath(url));
473
+ } catch {}
474
+ } else {
475
+ openBrowser(url);
476
+ }
477
+ };
478
+ return () => {
479
+ ink.onHyperlinkClick = undefined;
480
+ };
481
+ }, []);
482
+ if (isFullscreenEnvEnabled()) {
483
+ const sticky = hideSticky ? null : stickyPrompt;
484
+ const headerPrompt = sticky != null && sticky !== "clicked" && overlay == null ? sticky : null;
485
+ const padCollapsed = sticky != null && overlay == null;
486
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PromptOverlayProvider, {
487
+ children: [
488
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
489
+ flexDirection: "row",
490
+ flexGrow: 1,
491
+ overflow: "hidden",
492
+ width: "100%",
493
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
494
+ flexDirection: "column",
495
+ flexGrow: 1,
496
+ width: columns,
497
+ overflow: "hidden",
498
+ children: [
499
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
500
+ flexGrow: 1,
501
+ flexDirection: "column",
502
+ overflow: "hidden",
503
+ children: [
504
+ headerPrompt && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(StickyPromptHeader, {
505
+ text: headerPrompt.text,
506
+ onClick: headerPrompt.scrollTo
507
+ }, undefined, false, undefined, this),
508
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ScrollBox_default, {
509
+ ref: scrollRef,
510
+ flexGrow: 1,
511
+ flexDirection: "column",
512
+ paddingTop: padCollapsed ? 0 : 1,
513
+ stickyScroll: true,
514
+ children: [
515
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ScrollChromeContext, {
516
+ value: chromeCtx,
517
+ children: scrollable
518
+ }, undefined, false, undefined, this),
519
+ overlay
520
+ ]
521
+ }, undefined, true, undefined, this),
522
+ !hidePill && pillVisible && overlay == null && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(NewMessagesPill, {
523
+ count: newMessageCount,
524
+ onClick: onPillClick
525
+ }, undefined, false, undefined, this),
526
+ bottomFloat != null && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
527
+ position: "absolute",
528
+ bottom: 0,
529
+ right: 0,
530
+ opaque: true,
531
+ children: bottomFloat
532
+ }, undefined, false, undefined, this)
533
+ ]
534
+ }, undefined, true, undefined, this),
535
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
536
+ flexDirection: "column",
537
+ flexShrink: 0,
538
+ width: "100%",
539
+ maxHeight: "50%",
540
+ children: [
541
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(SuggestionsOverlay, {}, undefined, false, undefined, this),
542
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(DialogOverlay, {}, undefined, false, undefined, this),
543
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
544
+ flexDirection: "column",
545
+ width: "100%",
546
+ flexGrow: 1,
547
+ overflowY: "hidden",
548
+ children: bottom
549
+ }, undefined, false, undefined, this)
550
+ ]
551
+ }, undefined, true, undefined, this)
552
+ ]
553
+ }, undefined, true, undefined, this)
554
+ }, undefined, false, undefined, this),
555
+ modal != null && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ModalContext, {
556
+ value: {
557
+ rows: terminalRows - MODAL_TRANSCRIPT_PEEK - 1,
558
+ columns: columns - 4,
559
+ scrollRef: modalScrollRef ?? null
560
+ },
561
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
562
+ position: "absolute",
563
+ bottom: 0,
564
+ left: 0,
565
+ right: 0,
566
+ maxHeight: terminalRows - MODAL_TRANSCRIPT_PEEK,
567
+ flexDirection: "column",
568
+ overflow: "hidden",
569
+ opaque: true,
570
+ children: [
571
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
572
+ flexShrink: 0,
573
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
574
+ color: "permission",
575
+ children: "\u2594".repeat(columns)
576
+ }, undefined, false, undefined, this)
577
+ }, undefined, false, undefined, this),
578
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
579
+ flexDirection: "column",
580
+ paddingX: 2,
581
+ flexShrink: 0,
582
+ overflow: "hidden",
583
+ children: modal
584
+ }, undefined, false, undefined, this)
585
+ ]
586
+ }, undefined, true, undefined, this)
587
+ }, undefined, false, undefined, this)
588
+ ]
589
+ }, undefined, true, undefined, this);
590
+ }
591
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
592
+ children: [
593
+ scrollable,
594
+ bottom,
595
+ overlay,
596
+ modal
597
+ ]
598
+ }, undefined, true, undefined, this);
599
+ }
600
+ function NewMessagesPill({ count, onClick }) {
601
+ const [hover, setHover] = import_react2.useState(false);
602
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
603
+ position: "absolute",
604
+ bottom: 0,
605
+ left: 0,
606
+ right: 0,
607
+ justifyContent: "center",
608
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
609
+ onClick,
610
+ onMouseEnter: () => setHover(true),
611
+ onMouseLeave: () => setHover(false),
612
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
613
+ backgroundColor: hover ? "userMessageBackgroundHover" : "userMessageBackground",
614
+ dimColor: true,
615
+ children: [
616
+ " ",
617
+ count > 0 ? `${count} new ${plural(count, "message")}` : "Jump to bottom",
618
+ " ",
619
+ figures_default.arrowDown,
620
+ " "
621
+ ]
622
+ }, undefined, true, undefined, this)
623
+ }, undefined, false, undefined, this)
624
+ }, undefined, false, undefined, this);
625
+ }
626
+ function StickyPromptHeader({ text, onClick }) {
627
+ const [hover, setHover] = import_react2.useState(false);
628
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
629
+ flexShrink: 0,
630
+ width: "100%",
631
+ height: 1,
632
+ paddingRight: 1,
633
+ backgroundColor: hover ? "userMessageBackgroundHover" : "userMessageBackground",
634
+ onClick,
635
+ onMouseEnter: () => setHover(true),
636
+ onMouseLeave: () => setHover(false),
637
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
638
+ color: "subtle",
639
+ wrap: "truncate-end",
640
+ children: [
641
+ figures_default.pointer,
642
+ " ",
643
+ text
644
+ ]
645
+ }, undefined, true, undefined, this)
646
+ }, undefined, false, undefined, this);
647
+ }
648
+ function SuggestionsOverlay() {
649
+ const data = usePromptOverlay();
650
+ if (!data || data.suggestions.length === 0)
651
+ return null;
652
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
653
+ position: "absolute",
654
+ bottom: "100%",
655
+ left: 0,
656
+ right: 0,
657
+ paddingX: 2,
658
+ paddingTop: 1,
659
+ flexDirection: "column",
660
+ opaque: true,
661
+ children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(PromptInputFooterSuggestions_default, {
662
+ suggestions: data.suggestions,
663
+ selectedSuggestion: data.selectedSuggestion,
664
+ maxColumnWidth: data.maxColumnWidth,
665
+ overlay: true
666
+ }, undefined, false, undefined, this)
667
+ }, undefined, false, undefined, this);
668
+ }
669
+ function DialogOverlay() {
670
+ const node = usePromptOverlayDialog();
671
+ if (!node)
672
+ return null;
673
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
674
+ position: "absolute",
675
+ bottom: "100%",
676
+ left: 0,
677
+ right: 0,
678
+ opaque: true,
679
+ children: node
680
+ }, undefined, false, undefined, this);
681
+ }
682
+ var import_react2, jsx_dev_runtime2, MODAL_TRANSCRIPT_PEEK = 2, ScrollChromeContext;
683
+ var init_FullscreenLayout = __esm(() => {
684
+ init_figures();
685
+ init_modalContext();
686
+ init_promptOverlayContext();
687
+ init_useTerminalSize();
688
+ init_src();
689
+ init_browser();
690
+ init_fullscreen();
691
+ init_stringUtils();
692
+ init_nullRenderingAttachments();
693
+ init_PromptInputFooterSuggestions();
694
+ import_react2 = __toESM(require_react(), 1);
695
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
696
+ ScrollChromeContext = import_react2.createContext({ setStickyPrompt: () => {} });
697
+ });
698
+
699
+ // src/utils/set.ts
700
+ function every(a, b) {
701
+ for (const item of a) {
702
+ if (!b.has(item)) {
703
+ return false;
704
+ }
705
+ }
706
+ return true;
707
+ }
708
+ var init_set = () => {};
709
+
710
+ // src/utils/collapseBackgroundBashNotifications.ts
711
+ function isCompletedBackgroundBash(msg) {
712
+ if (msg.type !== "user")
713
+ return false;
714
+ const content0 = Array.isArray(msg.message.content) ? msg.message.content[0] : undefined;
715
+ if (!content0 || typeof content0 === "string" || content0?.type !== "text")
716
+ return false;
717
+ if (!content0.text.includes(`<${TASK_NOTIFICATION_TAG}`))
718
+ return false;
719
+ if (extractTag(content0.text, STATUS_TAG) !== "completed")
720
+ return false;
721
+ return extractTag(content0.text, SUMMARY_TAG)?.startsWith(BACKGROUND_BASH_SUMMARY_PREFIX) ?? false;
722
+ }
723
+ function collapseBackgroundBashNotifications(messages, verbose) {
724
+ if (!isFullscreenEnvEnabled())
725
+ return messages;
726
+ if (verbose)
727
+ return messages;
728
+ const result = [];
729
+ let i = 0;
730
+ while (i < messages.length) {
731
+ const msg = messages[i];
732
+ if (isCompletedBackgroundBash(msg)) {
733
+ let count = 0;
734
+ while (i < messages.length && isCompletedBackgroundBash(messages[i])) {
735
+ count++;
736
+ i++;
737
+ }
738
+ if (count === 1) {
739
+ result.push(msg);
740
+ } else {
741
+ result.push({
742
+ ...msg,
743
+ message: {
744
+ role: "user",
745
+ content: [
746
+ {
747
+ type: "text",
748
+ text: `<${TASK_NOTIFICATION_TAG}><${STATUS_TAG}>completed</${STATUS_TAG}><${SUMMARY_TAG}>${count} background commands completed</${SUMMARY_TAG}></${TASK_NOTIFICATION_TAG}>`
749
+ }
750
+ ]
751
+ }
752
+ });
753
+ }
754
+ } else {
755
+ result.push(msg);
756
+ i++;
757
+ }
758
+ }
759
+ return result;
760
+ }
761
+ var init_collapseBackgroundBashNotifications = __esm(() => {
762
+ init_xml();
763
+ init_LocalShellTask();
764
+ init_fullscreen();
765
+ init_messages();
766
+ });
767
+
768
+ // src/utils/collapseHookSummaries.ts
769
+ function isLabeledHookSummary(msg) {
770
+ return msg.type === "system" && msg.subtype === "stop_hook_summary" && msg.hookLabel !== undefined;
771
+ }
772
+ function collapseHookSummaries(messages) {
773
+ const result = [];
774
+ let i = 0;
775
+ while (i < messages.length) {
776
+ const msg = messages[i];
777
+ if (isLabeledHookSummary(msg)) {
778
+ const label = msg.hookLabel;
779
+ const group = [];
780
+ while (i < messages.length) {
781
+ const next = messages[i];
782
+ if (!isLabeledHookSummary(next) || next.hookLabel !== label)
783
+ break;
784
+ group.push(next);
785
+ i++;
786
+ }
787
+ if (group.length === 1) {
788
+ result.push(msg);
789
+ } else {
790
+ result.push({
791
+ ...msg,
792
+ hookCount: group.reduce((sum, m) => sum + m.hookCount, 0),
793
+ hookInfos: group.flatMap((m) => m.hookInfos),
794
+ hookErrors: group.flatMap((m) => m.hookErrors),
795
+ preventedContinuation: group.some((m) => m.preventedContinuation),
796
+ hasOutput: group.some((m) => m.hasOutput),
797
+ totalDurationMs: Math.max(...group.map((m) => m.totalDurationMs ?? 0))
798
+ });
799
+ }
800
+ } else {
801
+ result.push(msg);
802
+ i++;
803
+ }
804
+ }
805
+ return result;
806
+ }
807
+ var init_collapseHookSummaries = () => {};
808
+
809
+ // src/utils/collapseTeammateShutdowns.ts
810
+ function isTeammateShutdownAttachment(msg) {
811
+ return msg.type === "attachment" && msg.attachment.type === "task_status" && msg.attachment.taskType === "in_process_teammate" && msg.attachment.status === "completed";
812
+ }
813
+ function collapseTeammateShutdowns(messages) {
814
+ const result = [];
815
+ let i = 0;
816
+ while (i < messages.length) {
817
+ const msg = messages[i];
818
+ if (isTeammateShutdownAttachment(msg)) {
819
+ let count = 0;
820
+ while (i < messages.length && isTeammateShutdownAttachment(messages[i])) {
821
+ count++;
822
+ i++;
823
+ }
824
+ if (count === 1) {
825
+ result.push(msg);
826
+ } else {
827
+ result.push({
828
+ type: "attachment",
829
+ uuid: msg.uuid,
830
+ timestamp: msg.timestamp,
831
+ attachment: {
832
+ type: "teammate_shutdown_batch",
833
+ count
834
+ }
835
+ });
836
+ }
837
+ } else {
838
+ result.push(msg);
839
+ i++;
840
+ }
841
+ }
842
+ return result;
843
+ }
844
+ var init_collapseTeammateShutdowns = () => {};
845
+
846
+ // src/utils/groupToolUses.ts
847
+ function getToolsWithGrouping(tools) {
848
+ let cached = GROUPING_CACHE.get(tools);
849
+ if (!cached) {
850
+ cached = new Set(tools.filter((t) => t.renderGroupedToolUse).map((t) => t.name));
851
+ GROUPING_CACHE.set(tools, cached);
852
+ }
853
+ return cached;
854
+ }
855
+ function getToolUseInfo(msg) {
856
+ if (msg.type === "assistant" && msg.message?.content && Array.isArray(msg.message.content) && msg.message.content[0]?.type === "tool_use") {
857
+ const content = msg.message.content[0];
858
+ return {
859
+ messageId: msg.message.id,
860
+ toolUseId: content.id,
861
+ toolName: content.name
862
+ };
863
+ }
864
+ return null;
865
+ }
866
+ function applyGrouping(messages, tools, verbose = false) {
867
+ if (verbose) {
868
+ return {
869
+ messages
870
+ };
871
+ }
872
+ const toolsWithGrouping = getToolsWithGrouping(tools);
873
+ const groups = new Map;
874
+ for (const msg of messages) {
875
+ const info = getToolUseInfo(msg);
876
+ if (info && toolsWithGrouping.has(info.toolName)) {
877
+ const key = `${info.messageId}:${info.toolName}`;
878
+ const group = groups.get(key) ?? [];
879
+ group.push(msg);
880
+ groups.set(key, group);
881
+ }
882
+ }
883
+ const validGroups = new Map;
884
+ const groupedToolUseIds = new Set;
885
+ for (const [key, group] of groups) {
886
+ if (group.length >= 2) {
887
+ validGroups.set(key, group);
888
+ for (const msg of group) {
889
+ const info = getToolUseInfo(msg);
890
+ if (info) {
891
+ groupedToolUseIds.add(info.toolUseId);
892
+ }
893
+ }
894
+ }
895
+ }
896
+ const resultsByToolUseId = new Map;
897
+ for (const msg of messages) {
898
+ if (msg.type === "user" && msg.message?.content && Array.isArray(msg.message.content)) {
899
+ for (const content of msg.message.content) {
900
+ if (content.type === "tool_result" && groupedToolUseIds.has(content.tool_use_id)) {
901
+ resultsByToolUseId.set(content.tool_use_id, msg);
902
+ }
903
+ }
904
+ }
905
+ }
906
+ const result = [];
907
+ const emittedGroups = new Set;
908
+ for (const msg of messages) {
909
+ const info = getToolUseInfo(msg);
910
+ if (info) {
911
+ const key = `${info.messageId}:${info.toolName}`;
912
+ const group = validGroups.get(key);
913
+ if (group) {
914
+ if (!emittedGroups.has(key)) {
915
+ emittedGroups.add(key);
916
+ const firstMsg = group[0];
917
+ const results = [];
918
+ for (const assistantMsg of group) {
919
+ const toolUseId = assistantMsg.message.content[0].id;
920
+ const resultMsg = resultsByToolUseId.get(toolUseId);
921
+ if (resultMsg) {
922
+ results.push(resultMsg);
923
+ }
924
+ }
925
+ const groupedMessage = {
926
+ type: "grouped_tool_use",
927
+ toolName: info.toolName,
928
+ messages: group,
929
+ results,
930
+ displayMessage: firstMsg,
931
+ uuid: `grouped-${firstMsg.uuid}`,
932
+ timestamp: firstMsg.timestamp,
933
+ messageId: info.messageId
934
+ };
935
+ result.push(groupedMessage);
936
+ }
937
+ continue;
938
+ }
939
+ }
940
+ if (msg.type === "user" && msg.message?.content && Array.isArray(msg.message.content)) {
941
+ const toolResults = msg.message.content.filter((c) => c.type === "tool_result");
942
+ if (toolResults.length > 0) {
943
+ const allGrouped = toolResults.every((tr) => groupedToolUseIds.has(tr.tool_use_id));
944
+ if (allGrouped) {
945
+ continue;
946
+ }
947
+ }
948
+ }
949
+ result.push(msg);
950
+ }
951
+ return { messages: result };
952
+ }
953
+ var GROUPING_CACHE;
954
+ var init_groupToolUses = __esm(() => {
955
+ GROUPING_CACHE = new WeakMap;
956
+ });
957
+
958
+ // src/utils/transcriptSearch.ts
959
+ function renderableSearchText(msg) {
960
+ const cached = searchTextCache.get(msg);
961
+ if (cached !== undefined)
962
+ return cached;
963
+ const result = computeSearchText(msg).toLowerCase();
964
+ searchTextCache.set(msg, result);
965
+ return result;
966
+ }
967
+ function computeSearchText(msg) {
968
+ let raw = "";
969
+ switch (msg.type) {
970
+ case "user": {
971
+ const c = msg.message.content;
972
+ if (typeof c === "string") {
973
+ raw = RENDERED_AS_SENTINEL.has(c) ? "" : c;
974
+ } else {
975
+ const parts = [];
976
+ for (const b of c ?? []) {
977
+ if (b.type === "text") {
978
+ if (!RENDERED_AS_SENTINEL.has(b.text))
979
+ parts.push(b.text);
980
+ } else if (b.type === "tool_result") {
981
+ parts.push(toolResultSearchText(msg.toolUseResult));
982
+ }
983
+ }
984
+ raw = parts.join(`
985
+ `);
986
+ }
987
+ break;
988
+ }
989
+ case "assistant": {
990
+ const c = msg.message.content;
991
+ if (Array.isArray(c)) {
992
+ raw = c.flatMap((b) => {
993
+ if (b.type === "text")
994
+ return [b.text];
995
+ if (b.type === "tool_use")
996
+ return [toolUseSearchText(b.input)];
997
+ return [];
998
+ }).join(`
999
+ `);
1000
+ }
1001
+ break;
1002
+ }
1003
+ case "attachment": {
1004
+ if (msg.attachment.type === "relevant_memories") {
1005
+ raw = (msg.attachment.memories ?? []).map((m) => m.content).join(`
1006
+ `);
1007
+ } else if (msg.attachment.type === "queued_command" && msg.attachment.commandMode !== "task-notification" && !msg.attachment.isMeta) {
1008
+ const p = msg.attachment.prompt;
1009
+ raw = typeof p === "string" ? p : p.flatMap((b) => b.type === "text" ? [b.text] : []).join(`
1010
+ `);
1011
+ }
1012
+ break;
1013
+ }
1014
+ case "collapsed_read_search": {
1015
+ if (msg.relevantMemories) {
1016
+ raw = msg.relevantMemories.map((m) => m.content).join(`
1017
+ `);
1018
+ }
1019
+ break;
1020
+ }
1021
+ default:
1022
+ break;
1023
+ }
1024
+ let t = raw;
1025
+ let open = t.indexOf("<system-reminder>");
1026
+ while (open >= 0) {
1027
+ const close = t.indexOf(SYSTEM_REMINDER_CLOSE, open);
1028
+ if (close < 0)
1029
+ break;
1030
+ t = t.slice(0, open) + t.slice(close + SYSTEM_REMINDER_CLOSE.length);
1031
+ open = t.indexOf("<system-reminder>");
1032
+ }
1033
+ return t;
1034
+ }
1035
+ function toolUseSearchText(input) {
1036
+ if (!input || typeof input !== "object")
1037
+ return "";
1038
+ const o = input;
1039
+ const parts = [];
1040
+ for (const k of [
1041
+ "command",
1042
+ "pattern",
1043
+ "file_path",
1044
+ "path",
1045
+ "prompt",
1046
+ "description",
1047
+ "query",
1048
+ "url",
1049
+ "skill"
1050
+ ]) {
1051
+ const v = o[k];
1052
+ if (typeof v === "string")
1053
+ parts.push(v);
1054
+ }
1055
+ for (const k of ["args", "files"]) {
1056
+ const v = o[k];
1057
+ if (Array.isArray(v) && v.every((x) => typeof x === "string")) {
1058
+ parts.push(v.join(" "));
1059
+ }
1060
+ }
1061
+ return parts.join(`
1062
+ `);
1063
+ }
1064
+ function toolResultSearchText(r) {
1065
+ if (!r || typeof r !== "object")
1066
+ return typeof r === "string" ? r : "";
1067
+ const o = r;
1068
+ if (typeof o.stdout === "string") {
1069
+ const err = typeof o.stderr === "string" ? o.stderr : "";
1070
+ return o.stdout + (err ? `
1071
+ ` + err : "");
1072
+ }
1073
+ if (o.file && typeof o.file === "object" && typeof o.file.content === "string") {
1074
+ return o.file.content;
1075
+ }
1076
+ const parts = [];
1077
+ for (const k of ["content", "output", "result", "text", "message"]) {
1078
+ const v = o[k];
1079
+ if (typeof v === "string")
1080
+ parts.push(v);
1081
+ }
1082
+ for (const k of ["filenames", "lines", "results"]) {
1083
+ const v = o[k];
1084
+ if (Array.isArray(v) && v.every((x) => typeof x === "string")) {
1085
+ parts.push(v.join(`
1086
+ `));
1087
+ }
1088
+ }
1089
+ return parts.join(`
1090
+ `);
1091
+ }
1092
+ var SYSTEM_REMINDER_CLOSE = "</system-reminder>", RENDERED_AS_SENTINEL, searchTextCache;
1093
+ var init_transcriptSearch = __esm(() => {
1094
+ init_messages();
1095
+ RENDERED_AS_SENTINEL = new Set([
1096
+ INTERRUPT_MESSAGE,
1097
+ INTERRUPT_MESSAGE_FOR_TOOL_USE
1098
+ ]);
1099
+ searchTextCache = new WeakMap;
1100
+ });
1101
+
1102
+ // src/components/LogoV2/Clawd.tsx
1103
+ function Clawd({ pose = "default" } = {}) {
1104
+ const mark = REDSCOPE_MARKS[pose];
1105
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
1106
+ flexDirection: "column",
1107
+ children: [
1108
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1109
+ color: "clawd_body",
1110
+ children: mark.top
1111
+ }, undefined, false, undefined, this),
1112
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1113
+ color: "clawd_body",
1114
+ children: mark.middle
1115
+ }, undefined, false, undefined, this),
1116
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
1117
+ color: "clawd_body",
1118
+ children: mark.bottom
1119
+ }, undefined, false, undefined, this)
1120
+ ]
1121
+ }, undefined, true, undefined, this);
1122
+ }
1123
+ var jsx_dev_runtime3, REDSCOPE_MARKS;
1124
+ var init_Clawd = __esm(() => {
1125
+ init_src();
1126
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
1127
+ REDSCOPE_MARKS = {
1128
+ default: {
1129
+ top: " \u256D\u2500\u2500\u2500\u256E ",
1130
+ middle: "\u2576\u2500\u2524 \u25CF \u251C\u2500\u2574",
1131
+ bottom: " \u2570\u2500\u252C\u2500\u256F "
1132
+ },
1133
+ "look-left": {
1134
+ top: " \u256D\u2500\u2500\u2500\u256E ",
1135
+ middle: "\u2576\u2500\u2524\u25CF \u251C\u2500\u2574",
1136
+ bottom: " \u2570\u2500\u252C\u2500\u256F "
1137
+ },
1138
+ "look-right": {
1139
+ top: " \u256D\u2500\u2500\u2500\u256E ",
1140
+ middle: "\u2576\u2500\u2524 \u25CF\u251C\u2500\u2574",
1141
+ bottom: " \u2570\u2500\u252C\u2500\u256F "
1142
+ },
1143
+ "arms-up": {
1144
+ top: "\u256D\u2500\u252C\u2500\u2500\u2500\u252C\u2500\u256E",
1145
+ middle: " \u2502 \u25CF \u2502 ",
1146
+ bottom: "\u2576\u2500\u2570\u2500\u2534\u2500\u256F\u2500\u2574"
1147
+ }
1148
+ };
1149
+ });
1150
+
1151
+ // src/components/LogoV2/Feed.tsx
1152
+ function calculateFeedWidth(config) {
1153
+ const { title, lines, footer, emptyMessage, customContent } = config;
1154
+ let maxWidth = stringWidth(title);
1155
+ if (customContent !== undefined) {
1156
+ maxWidth = Math.max(maxWidth, customContent.width);
1157
+ } else if (lines.length === 0 && emptyMessage) {
1158
+ maxWidth = Math.max(maxWidth, stringWidth(emptyMessage));
1159
+ } else {
1160
+ const gap = " ";
1161
+ const maxTimestampWidth = Math.max(0, ...lines.map((line) => line.timestamp ? stringWidth(line.timestamp) : 0));
1162
+ for (const line of lines) {
1163
+ const timestampWidth = maxTimestampWidth > 0 ? maxTimestampWidth : 0;
1164
+ const lineWidth = stringWidth(line.text) + (timestampWidth > 0 ? timestampWidth + gap.length : 0);
1165
+ maxWidth = Math.max(maxWidth, lineWidth);
1166
+ }
1167
+ }
1168
+ if (footer) {
1169
+ maxWidth = Math.max(maxWidth, stringWidth(footer));
1170
+ }
1171
+ return maxWidth;
1172
+ }
1173
+ function Feed({ config, actualWidth }) {
1174
+ const { title, lines, footer, emptyMessage, customContent } = config;
1175
+ const gap = " ";
1176
+ const maxTimestampWidth = Math.max(0, ...lines.map((line) => line.timestamp ? stringWidth(line.timestamp) : 0));
1177
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
1178
+ flexDirection: "column",
1179
+ width: actualWidth,
1180
+ children: [
1181
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1182
+ bold: true,
1183
+ color: "claude",
1184
+ children: title
1185
+ }, undefined, false, undefined, this),
1186
+ customContent ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
1187
+ children: [
1188
+ customContent.content,
1189
+ footer && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1190
+ dimColor: true,
1191
+ italic: true,
1192
+ children: truncate(footer, actualWidth)
1193
+ }, undefined, false, undefined, this)
1194
+ ]
1195
+ }, undefined, true, undefined, this) : lines.length === 0 && emptyMessage ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1196
+ dimColor: true,
1197
+ children: truncate(emptyMessage, actualWidth)
1198
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
1199
+ children: [
1200
+ lines.map((line, index) => {
1201
+ const textWidth = Math.max(10, actualWidth - (maxTimestampWidth > 0 ? maxTimestampWidth + gap.length : 0));
1202
+ return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1203
+ children: [
1204
+ maxTimestampWidth > 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
1205
+ children: [
1206
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1207
+ dimColor: true,
1208
+ children: (line.timestamp || "").padEnd(maxTimestampWidth)
1209
+ }, undefined, false, undefined, this),
1210
+ gap
1211
+ ]
1212
+ }, undefined, true, undefined, this),
1213
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1214
+ children: truncate(line.text, textWidth)
1215
+ }, undefined, false, undefined, this)
1216
+ ]
1217
+ }, index, true, undefined, this);
1218
+ }),
1219
+ footer && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
1220
+ dimColor: true,
1221
+ italic: true,
1222
+ children: truncate(footer, actualWidth)
1223
+ }, undefined, false, undefined, this)
1224
+ ]
1225
+ }, undefined, true, undefined, this)
1226
+ ]
1227
+ }, undefined, true, undefined, this);
1228
+ }
1229
+ var jsx_dev_runtime4;
1230
+ var init_Feed = __esm(() => {
1231
+ init_src();
1232
+ init_format();
1233
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
1234
+ });
1235
+
1236
+ // src/components/LogoV2/FeedColumn.tsx
1237
+ function FeedColumn({
1238
+ feeds,
1239
+ maxWidth
1240
+ }) {
1241
+ const feedWidths = feeds.map((feed) => calculateFeedWidth(feed));
1242
+ const maxOfAllFeeds = Math.max(...feedWidths);
1243
+ const actualWidth = Math.min(maxOfAllFeeds, maxWidth);
1244
+ return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1245
+ flexDirection: "column",
1246
+ children: feeds.map((feed, index) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(React3.Fragment, {
1247
+ children: [
1248
+ /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Feed, {
1249
+ config: feed,
1250
+ actualWidth
1251
+ }, undefined, false, undefined, this),
1252
+ index < feeds.length - 1 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Divider, {
1253
+ color: "claude",
1254
+ width: actualWidth
1255
+ }, undefined, false, undefined, this)
1256
+ ]
1257
+ }, index, true, undefined, this))
1258
+ }, undefined, false, undefined, this);
1259
+ }
1260
+ var React3, jsx_dev_runtime5;
1261
+ var init_FeedColumn = __esm(() => {
1262
+ init_src();
1263
+ init_src();
1264
+ init_Feed();
1265
+ React3 = __toESM(require_react(), 1);
1266
+ jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1267
+ });
1268
+
1269
+ // src/components/LogoV2/feedConfigs.tsx
1270
+ import { homedir } from "os";
1271
+ function createRecentActivityFeed(activities) {
1272
+ const lines = activities.map((log) => {
1273
+ const time = formatRelativeTimeAgo(log.modified);
1274
+ const description = log.summary && log.summary !== "No prompt" ? log.summary : log.firstPrompt;
1275
+ return {
1276
+ text: description || "",
1277
+ timestamp: time
1278
+ };
1279
+ });
1280
+ return {
1281
+ title: "Recent activity",
1282
+ lines,
1283
+ footer: lines.length > 0 ? "/resume for more" : undefined,
1284
+ emptyMessage: "No recent activity"
1285
+ };
1286
+ }
1287
+ function createWhatsNewFeed(releaseNotes) {
1288
+ const lines = releaseNotes.map((note) => {
1289
+ if (process.env.USER_TYPE === "ant") {
1290
+ const match = note.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);
1291
+ if (match) {
1292
+ return {
1293
+ timestamp: match[1],
1294
+ text: match[2] || ""
1295
+ };
1296
+ }
1297
+ }
1298
+ return {
1299
+ text: note
1300
+ };
1301
+ });
1302
+ const emptyMessage = process.env.USER_TYPE === "ant" ? "Unable to fetch latest claude-cli-internal commits" : "Check the RedScope AI changelog for updates";
1303
+ return {
1304
+ title: process.env.USER_TYPE === "ant" ? "What's new [ANT-ONLY: Latest CC commits]" : "What's new",
1305
+ lines,
1306
+ footer: lines.length > 0 ? "/release-notes for more" : undefined,
1307
+ emptyMessage
1308
+ };
1309
+ }
1310
+ function createProjectOnboardingFeed(steps) {
1311
+ const enabledSteps = steps.filter(({ isEnabled }) => isEnabled).sort((a, b) => Number(a.isComplete) - Number(b.isComplete));
1312
+ const lines = enabledSteps.map(({ text, isComplete }) => {
1313
+ const checkmark = isComplete ? `${figures_default.tick} ` : "";
1314
+ return {
1315
+ text: `${checkmark}${text}`
1316
+ };
1317
+ });
1318
+ const warningText = getCwd() === homedir() ? "Note: You have launched RedScope AI in your home directory. For the best experience, launch it in a project directory instead." : undefined;
1319
+ if (warningText) {
1320
+ lines.push({
1321
+ text: warningText
1322
+ });
1323
+ }
1324
+ return {
1325
+ title: "Tips for getting started",
1326
+ lines
1327
+ };
1328
+ }
1329
+ function createGuestPassesFeed() {
1330
+ const reward = getCachedReferrerReward();
1331
+ const subtitle = reward ? `Share RedScope AI and earn ${formatCreditAmount(reward)} of extra usage` : "Share RedScope AI with friends";
1332
+ return {
1333
+ title: "3 guest passes",
1334
+ lines: [],
1335
+ customContent: {
1336
+ content: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(jsx_dev_runtime6.Fragment, {
1337
+ children: [
1338
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedBox_default, {
1339
+ marginY: 1,
1340
+ children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1341
+ color: "claude",
1342
+ children: "[\u273B] [\u273B] [\u273B]"
1343
+ }, undefined, false, undefined, this)
1344
+ }, undefined, false, undefined, this),
1345
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ThemedText, {
1346
+ dimColor: true,
1347
+ children: subtitle
1348
+ }, undefined, false, undefined, this)
1349
+ ]
1350
+ }, undefined, true, undefined, this),
1351
+ width: 48
1352
+ },
1353
+ footer: "/passes"
1354
+ };
1355
+ }
1356
+ var jsx_dev_runtime6;
1357
+ var init_feedConfigs = __esm(() => {
1358
+ init_figures();
1359
+ init_src();
1360
+ init_referral();
1361
+ init_cwd();
1362
+ init_format();
1363
+ jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1364
+ });
1365
+
1366
+ // src/components/LogoV2/AnimatedClawd.tsx
1367
+ function hold(pose, offset, frames) {
1368
+ return Array.from({ length: frames }, () => ({ pose, offset }));
1369
+ }
1370
+ function AnimatedClawd() {
1371
+ const { pose, bounceOffset, onClick } = useClawdAnimation();
1372
+ return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1373
+ height: CLAWD_HEIGHT,
1374
+ flexDirection: "column",
1375
+ onClick,
1376
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(ThemedBox_default, {
1377
+ marginTop: bounceOffset,
1378
+ flexShrink: 0,
1379
+ children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Clawd, {
1380
+ pose
1381
+ }, undefined, false, undefined, this)
1382
+ }, undefined, false, undefined, this)
1383
+ }, undefined, false, undefined, this);
1384
+ }
1385
+ function useClawdAnimation() {
1386
+ const [reducedMotion] = import_react3.useState(() => getInitialSettings().prefersReducedMotion ?? false);
1387
+ const [frameIndex, setFrameIndex] = import_react3.useState(-1);
1388
+ const sequenceRef = import_react3.useRef(JUMP_WAVE);
1389
+ const onClick = () => {
1390
+ if (reducedMotion || frameIndex !== -1)
1391
+ return;
1392
+ sequenceRef.current = CLICK_ANIMATIONS[Math.floor(Math.random() * CLICK_ANIMATIONS.length)];
1393
+ setFrameIndex(0);
1394
+ };
1395
+ import_react3.useEffect(() => {
1396
+ if (frameIndex === -1)
1397
+ return;
1398
+ if (frameIndex >= sequenceRef.current.length) {
1399
+ setFrameIndex(-1);
1400
+ return;
1401
+ }
1402
+ const timer = setTimeout(setFrameIndex, FRAME_MS, incrementFrame);
1403
+ return () => clearTimeout(timer);
1404
+ }, [frameIndex]);
1405
+ const seq = sequenceRef.current;
1406
+ const current = frameIndex >= 0 && frameIndex < seq.length ? seq[frameIndex] : IDLE;
1407
+ return { pose: current.pose, bounceOffset: current.offset, onClick };
1408
+ }
1409
+ var import_react3, jsx_dev_runtime7, JUMP_WAVE, LOOK_AROUND, CLICK_ANIMATIONS, IDLE, FRAME_MS = 60, incrementFrame = (i) => i + 1, CLAWD_HEIGHT = 3;
1410
+ var init_AnimatedClawd = __esm(() => {
1411
+ init_src();
1412
+ init_settings();
1413
+ init_Clawd();
1414
+ import_react3 = __toESM(require_react(), 1);
1415
+ jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
1416
+ JUMP_WAVE = [
1417
+ ...hold("default", 1, 2),
1418
+ ...hold("arms-up", 0, 3),
1419
+ ...hold("default", 0, 1),
1420
+ ...hold("default", 1, 2),
1421
+ ...hold("arms-up", 0, 3),
1422
+ ...hold("default", 0, 1)
1423
+ ];
1424
+ LOOK_AROUND = [
1425
+ ...hold("look-right", 0, 5),
1426
+ ...hold("look-left", 0, 5),
1427
+ ...hold("default", 0, 1)
1428
+ ];
1429
+ CLICK_ANIMATIONS = [JUMP_WAVE, LOOK_AROUND];
1430
+ IDLE = { pose: "default", offset: 0 };
1431
+ });
1432
+
1433
+ // src/components/LogoV2/GuestPassesUpsell.tsx
1434
+ function resetIfPassesRefreshed() {
1435
+ const remaining = getCachedRemainingPasses();
1436
+ if (remaining == null || remaining <= 0)
1437
+ return;
1438
+ const config = getGlobalConfig();
1439
+ const lastSeen = config.passesLastSeenRemaining ?? 0;
1440
+ if (remaining > lastSeen) {
1441
+ saveGlobalConfig((prev) => ({
1442
+ ...prev,
1443
+ passesUpsellSeenCount: 0,
1444
+ hasVisitedPasses: false,
1445
+ passesLastSeenRemaining: remaining
1446
+ }));
1447
+ }
1448
+ }
1449
+ function shouldShowGuestPassesUpsell() {
1450
+ const { eligible, hasCache } = checkCachedPassesEligibility();
1451
+ if (!eligible || !hasCache)
1452
+ return false;
1453
+ resetIfPassesRefreshed();
1454
+ const config = getGlobalConfig();
1455
+ if ((config.passesUpsellSeenCount ?? 0) >= 3)
1456
+ return false;
1457
+ if (config.hasVisitedPasses)
1458
+ return false;
1459
+ return true;
1460
+ }
1461
+ function useShowGuestPassesUpsell() {
1462
+ const [show] = import_react4.useState(() => shouldShowGuestPassesUpsell());
1463
+ return show;
1464
+ }
1465
+ function incrementGuestPassesSeenCount() {
1466
+ let newCount = 0;
1467
+ saveGlobalConfig((prev) => {
1468
+ newCount = (prev.passesUpsellSeenCount ?? 0) + 1;
1469
+ return {
1470
+ ...prev,
1471
+ passesUpsellSeenCount: newCount
1472
+ };
1473
+ });
1474
+ logEvent("tengu_guest_passes_upsell_shown", {
1475
+ seen_count: newCount
1476
+ });
1477
+ }
1478
+ function GuestPassesUpsell() {
1479
+ const reward = getCachedReferrerReward();
1480
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1481
+ dimColor: true,
1482
+ children: [
1483
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1484
+ color: "claude",
1485
+ children: "[\u273B]"
1486
+ }, undefined, false, undefined, this),
1487
+ " ",
1488
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1489
+ color: "claude",
1490
+ children: "[\u273B]"
1491
+ }, undefined, false, undefined, this),
1492
+ " ",
1493
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ThemedText, {
1494
+ color: "claude",
1495
+ children: "[\u273B]"
1496
+ }, undefined, false, undefined, this),
1497
+ " \xB7",
1498
+ " ",
1499
+ reward ? `Share RedScope AI and earn ${formatCreditAmount(reward)} of extra usage \xB7 /passes` : "3 guest passes at /passes"
1500
+ ]
1501
+ }, undefined, true, undefined, this);
1502
+ }
1503
+ var import_react4, jsx_dev_runtime8;
1504
+ var init_GuestPassesUpsell = __esm(() => {
1505
+ init_src();
1506
+ init_analytics();
1507
+ init_referral();
1508
+ init_config();
1509
+ import_react4 = __toESM(require_react(), 1);
1510
+ jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
1511
+ });
1512
+
1513
+ // src/components/LogoV2/CondensedLogo.tsx
1514
+ function CondensedLogo() {
1515
+ const { columns } = useTerminalSize();
1516
+ const agent = useAppState((s) => s.agent);
1517
+ const effortValue = useAppState((s) => s.effortValue);
1518
+ const model = useMainLoopModel();
1519
+ const modelDisplayName = renderModelSetting(model);
1520
+ const { version, cwd, billingType, agentName: agentNameFromSettings } = getLogoDisplayData();
1521
+ const agentName = agent ?? agentNameFromSettings;
1522
+ const showGuestPassesUpsell = useShowGuestPassesUpsell();
1523
+ const showOverageCreditUpsell = useShowOverageCreditUpsell();
1524
+ import_react5.useEffect(() => {
1525
+ if (showGuestPassesUpsell) {
1526
+ incrementGuestPassesSeenCount();
1527
+ }
1528
+ }, [showGuestPassesUpsell]);
1529
+ import_react5.useEffect(() => {
1530
+ if (showOverageCreditUpsell && !showGuestPassesUpsell) {
1531
+ incrementOverageCreditUpsellSeenCount();
1532
+ }
1533
+ }, [showOverageCreditUpsell, showGuestPassesUpsell]);
1534
+ const textWidth = Math.max(columns - 15, 20);
1535
+ const versionPrefix = "RedScope AI v";
1536
+ const truncatedVersion = truncate(version, Math.max(textWidth - versionPrefix.length, 6));
1537
+ const effortSuffix = getEffortSuffix(model, effortValue);
1538
+ const { shouldSplit, truncatedModel, truncatedBilling } = formatModelAndBilling(modelDisplayName + effortSuffix, billingType, textWidth);
1539
+ const separator = " \xB7 ";
1540
+ const atPrefix = "@";
1541
+ const cwdAvailableWidth = agentName ? textWidth - atPrefix.length - stringWidth(agentName) - separator.length : textWidth;
1542
+ const truncatedCwd = truncatePath(cwd, Math.max(cwdAvailableWidth, 10));
1543
+ return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(OffscreenFreeze, {
1544
+ children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1545
+ flexDirection: "row",
1546
+ gap: 2,
1547
+ alignItems: "center",
1548
+ children: [
1549
+ isFullscreenEnvEnabled() ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(AnimatedClawd, {}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Clawd, {}, undefined, false, undefined, this),
1550
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedBox_default, {
1551
+ flexDirection: "column",
1552
+ children: [
1553
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1554
+ children: [
1555
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1556
+ bold: true,
1557
+ children: "RedScope AI"
1558
+ }, undefined, false, undefined, this),
1559
+ " ",
1560
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1561
+ dimColor: true,
1562
+ children: [
1563
+ "v",
1564
+ truncatedVersion
1565
+ ]
1566
+ }, undefined, true, undefined, this)
1567
+ ]
1568
+ }, undefined, true, undefined, this),
1569
+ shouldSplit ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(jsx_dev_runtime9.Fragment, {
1570
+ children: [
1571
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1572
+ dimColor: true,
1573
+ children: truncatedModel
1574
+ }, undefined, false, undefined, this),
1575
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1576
+ dimColor: true,
1577
+ children: truncatedBilling
1578
+ }, undefined, false, undefined, this)
1579
+ ]
1580
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1581
+ dimColor: true,
1582
+ children: [
1583
+ truncatedModel,
1584
+ " \xB7 ",
1585
+ truncatedBilling
1586
+ ]
1587
+ }, undefined, true, undefined, this),
1588
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(ThemedText, {
1589
+ dimColor: true,
1590
+ children: agentName ? `@${agentName} \xB7 ${truncatedCwd}` : truncatedCwd
1591
+ }, undefined, false, undefined, this),
1592
+ showGuestPassesUpsell && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(GuestPassesUpsell, {}, undefined, false, undefined, this),
1593
+ !showGuestPassesUpsell && showOverageCreditUpsell && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(OverageCreditUpsell, {
1594
+ maxWidth: textWidth,
1595
+ twoLine: true
1596
+ }, undefined, false, undefined, this)
1597
+ ]
1598
+ }, undefined, true, undefined, this)
1599
+ ]
1600
+ }, undefined, true, undefined, this)
1601
+ }, undefined, false, undefined, this);
1602
+ }
1603
+ var import_react5, jsx_dev_runtime9;
1604
+ var init_CondensedLogo = __esm(() => {
1605
+ init_useMainLoopModel();
1606
+ init_useTerminalSize();
1607
+ init_src();
1608
+ init_AppState();
1609
+ init_effort();
1610
+ init_format();
1611
+ init_fullscreen();
1612
+ init_logoV2Utils();
1613
+ init_model();
1614
+ init_OffscreenFreeze();
1615
+ init_AnimatedClawd();
1616
+ init_Clawd();
1617
+ init_GuestPassesUpsell();
1618
+ init_OverageCreditUpsell();
1619
+ import_react5 = __toESM(require_react(), 1);
1620
+ jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
1621
+ });
1622
+
1623
+ // src/components/LogoV2/EmergencyTip.tsx
1624
+ function EmergencyTip() {
1625
+ const tip = import_react6.useMemo(getTipOfFeed, []);
1626
+ const lastShownTip = import_react6.useMemo(() => getGlobalConfig().lastShownEmergencyTip, []);
1627
+ const shouldShow = tip.tip && tip.tip !== lastShownTip;
1628
+ import_react6.useEffect(() => {
1629
+ if (shouldShow) {
1630
+ saveGlobalConfig((current) => {
1631
+ if (current.lastShownEmergencyTip === tip.tip)
1632
+ return current;
1633
+ return { ...current, lastShownEmergencyTip: tip.tip };
1634
+ });
1635
+ }
1636
+ }, [shouldShow, tip.tip]);
1637
+ if (!shouldShow) {
1638
+ return null;
1639
+ }
1640
+ return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedBox_default, {
1641
+ paddingLeft: 2,
1642
+ flexDirection: "column",
1643
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ThemedText, {
1644
+ ...tip.color === "warning" ? { color: "warning" } : tip.color === "error" ? { color: "error" } : { dimColor: true },
1645
+ children: tip.tip
1646
+ }, undefined, false, undefined, this)
1647
+ }, undefined, false, undefined, this);
1648
+ }
1649
+ function getTipOfFeed() {
1650
+ return getDynamicConfig_CACHED_MAY_BE_STALE(CONFIG_NAME, DEFAULT_TIP);
1651
+ }
1652
+ var import_react6, jsx_dev_runtime10, CONFIG_NAME = "tengu-top-of-feed-tip", DEFAULT_TIP;
1653
+ var init_EmergencyTip = __esm(() => {
1654
+ init_src();
1655
+ init_growthbook();
1656
+ init_config();
1657
+ import_react6 = __toESM(require_react(), 1);
1658
+ jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
1659
+ DEFAULT_TIP = { tip: "", color: "dim" };
1660
+ });
1661
+
1662
+ // src/components/LogoV2/AnimatedAsterisk.tsx
1663
+ function AnimatedAsterisk({
1664
+ char = TEARDROP_ASTERISK
1665
+ }) {
1666
+ const [reducedMotion] = import_react7.useState(() => getInitialSettings().prefersReducedMotion ?? false);
1667
+ const [done, setDone] = import_react7.useState(reducedMotion);
1668
+ const startTimeRef = import_react7.useRef(null);
1669
+ const [ref, time] = useAnimationFrame(done ? null : 50);
1670
+ import_react7.useEffect(() => {
1671
+ if (done)
1672
+ return;
1673
+ const t = setTimeout(setDone, TOTAL_ANIMATION_MS, true);
1674
+ return () => clearTimeout(t);
1675
+ }, [done]);
1676
+ if (done) {
1677
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1678
+ ref,
1679
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1680
+ color: SETTLED_GREY,
1681
+ children: char
1682
+ }, undefined, false, undefined, this)
1683
+ }, undefined, false, undefined, this);
1684
+ }
1685
+ if (startTimeRef.current === null) {
1686
+ startTimeRef.current = time;
1687
+ }
1688
+ const elapsed = time - startTimeRef.current;
1689
+ const hue = elapsed / SWEEP_DURATION_MS * 360 % 360;
1690
+ return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedBox_default, {
1691
+ ref,
1692
+ children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ThemedText, {
1693
+ color: toRGBColor(hueToRgb(hue)),
1694
+ children: char
1695
+ }, undefined, false, undefined, this)
1696
+ }, undefined, false, undefined, this);
1697
+ }
1698
+ var import_react7, jsx_dev_runtime11, SWEEP_DURATION_MS = 1500, SWEEP_COUNT = 2, TOTAL_ANIMATION_MS, SETTLED_GREY;
1699
+ var init_AnimatedAsterisk = __esm(() => {
1700
+ init_figures2();
1701
+ init_src();
1702
+ init_settings();
1703
+ init_utils();
1704
+ import_react7 = __toESM(require_react(), 1);
1705
+ jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
1706
+ TOTAL_ANIMATION_MS = SWEEP_DURATION_MS * SWEEP_COUNT;
1707
+ SETTLED_GREY = toRGBColor({ r: 153, g: 153, b: 153 });
1708
+ });
1709
+
1710
+ // src/components/LogoV2/Opus1mMergeNotice.tsx
1711
+ function shouldShowOpus1mMergeNotice() {
1712
+ return isOpus1mMergeEnabled() && (getGlobalConfig().opus1mMergeNoticeSeenCount ?? 0) < MAX_SHOW_COUNT;
1713
+ }
1714
+ function Opus1mMergeNotice() {
1715
+ const [show] = import_react8.useState(shouldShowOpus1mMergeNotice);
1716
+ import_react8.useEffect(() => {
1717
+ if (!show)
1718
+ return;
1719
+ const newCount = (getGlobalConfig().opus1mMergeNoticeSeenCount ?? 0) + 1;
1720
+ saveGlobalConfig((prev) => {
1721
+ if ((prev.opus1mMergeNoticeSeenCount ?? 0) >= newCount)
1722
+ return prev;
1723
+ return { ...prev, opus1mMergeNoticeSeenCount: newCount };
1724
+ });
1725
+ }, [show]);
1726
+ if (!show)
1727
+ return null;
1728
+ return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedBox_default, {
1729
+ paddingLeft: 2,
1730
+ children: [
1731
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(AnimatedAsterisk, {
1732
+ char: UP_ARROW
1733
+ }, undefined, false, undefined, this),
1734
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ThemedText, {
1735
+ dimColor: true,
1736
+ children: [
1737
+ " ",
1738
+ "Opus now defaults to 1M context \xB7 5x more room, same pricing"
1739
+ ]
1740
+ }, undefined, true, undefined, this)
1741
+ ]
1742
+ }, undefined, true, undefined, this);
1743
+ }
1744
+ var import_react8, jsx_dev_runtime12, MAX_SHOW_COUNT = 6;
1745
+ var init_Opus1mMergeNotice = __esm(() => {
1746
+ init_figures2();
1747
+ init_src();
1748
+ init_config();
1749
+ init_model();
1750
+ init_AnimatedAsterisk();
1751
+ import_react8 = __toESM(require_react(), 1);
1752
+ jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
1753
+ });
1754
+
1755
+ // src/components/LogoV2/VoiceModeNotice.tsx
1756
+ function VoiceModeNotice() {
1757
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(VoiceModeNoticeInner, {}, undefined, false, undefined, this);
1758
+ }
1759
+ function VoiceModeNoticeInner() {
1760
+ const [show] = import_react9.useState(() => isVoiceModeEnabled() && getInitialSettings().voiceEnabled !== true && (getGlobalConfig().voiceNoticeSeenCount ?? 0) < MAX_SHOW_COUNT2 && !shouldShowOpus1mMergeNotice());
1761
+ import_react9.useEffect(() => {
1762
+ if (!show)
1763
+ return;
1764
+ const newCount = (getGlobalConfig().voiceNoticeSeenCount ?? 0) + 1;
1765
+ saveGlobalConfig((prev) => {
1766
+ if ((prev.voiceNoticeSeenCount ?? 0) >= newCount)
1767
+ return prev;
1768
+ return { ...prev, voiceNoticeSeenCount: newCount };
1769
+ });
1770
+ }, [show]);
1771
+ if (!show)
1772
+ return null;
1773
+ return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedBox_default, {
1774
+ paddingLeft: 2,
1775
+ children: [
1776
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(AnimatedAsterisk, {}, undefined, false, undefined, this),
1777
+ /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemedText, {
1778
+ dimColor: true,
1779
+ children: " Voice mode is now available \xB7 /voice to enable"
1780
+ }, undefined, false, undefined, this)
1781
+ ]
1782
+ }, undefined, true, undefined, this);
1783
+ }
1784
+ var import_react9, jsx_dev_runtime13, MAX_SHOW_COUNT2 = 3;
1785
+ var init_VoiceModeNotice = __esm(() => {
1786
+ init_src();
1787
+ init_config();
1788
+ init_settings();
1789
+ init_voiceModeEnabled();
1790
+ init_AnimatedAsterisk();
1791
+ init_Opus1mMergeNotice();
1792
+ import_react9 = __toESM(require_react(), 1);
1793
+ jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
1794
+ });
1795
+
1796
+ // src/components/LogoV2/GateOverridesWarning.tsx
1797
+ function GateOverridesWarning() {
1798
+ return null;
1799
+ }
1800
+ var init_GateOverridesWarning = () => {};
1801
+
1802
+ // src/components/LogoV2/ExperimentEnrollmentNotice.tsx
1803
+ function ExperimentEnrollmentNotice() {
1804
+ return null;
1805
+ }
1806
+ var init_ExperimentEnrollmentNotice = () => {};
1807
+
1808
+ // src/components/LogoV2/ChannelsNotice.tsx
1809
+ var exports_ChannelsNotice = {};
1810
+ __export(exports_ChannelsNotice, {
1811
+ findUnmatched: () => findUnmatched,
1812
+ ChannelsNotice: () => ChannelsNotice
1813
+ });
1814
+ function ChannelsNotice() {
1815
+ const [{ channels, list, unmatched }] = import_react10.useState(() => {
1816
+ const ch = getAllowedChannels();
1817
+ if (ch.length === 0)
1818
+ return {
1819
+ channels: ch,
1820
+ list: "",
1821
+ unmatched: []
1822
+ };
1823
+ const l = ch.map(formatEntry).join(", ");
1824
+ return {
1825
+ channels: ch,
1826
+ list: l,
1827
+ unmatched: findUnmatched(ch)
1828
+ };
1829
+ });
1830
+ if (channels.length === 0)
1831
+ return null;
1832
+ const hasNonDev = channels.some((c) => !c.dev);
1833
+ const flag = getHasDevChannels() && hasNonDev ? "Channels" : getHasDevChannels() ? "--dangerously-load-development-channels" : "--channels";
1834
+ return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(ThemedBox_default, {
1835
+ paddingLeft: 2,
1836
+ flexDirection: "column",
1837
+ children: [
1838
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(ThemedText, {
1839
+ color: "error",
1840
+ children: [
1841
+ "Listening for channel messages from: ",
1842
+ list
1843
+ ]
1844
+ }, undefined, true, undefined, this),
1845
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(ThemedText, {
1846
+ dimColor: true,
1847
+ children: [
1848
+ "Experimental \xB7 inbound messages will be pushed into this session, this carries prompt injection risks. Restart RedScope AI without ",
1849
+ flag,
1850
+ " to disable."
1851
+ ]
1852
+ }, undefined, true, undefined, this),
1853
+ unmatched.map((u) => /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(ThemedText, {
1854
+ color: "warning",
1855
+ children: [
1856
+ formatEntry(u.entry),
1857
+ " \xB7 ",
1858
+ u.why
1859
+ ]
1860
+ }, `${formatEntry(u.entry)}:${u.why}`, true, undefined, this))
1861
+ ]
1862
+ }, undefined, true, undefined, this);
1863
+ }
1864
+ function formatEntry(c) {
1865
+ return c.kind === "plugin" ? `plugin:${c.name}@${c.marketplace}` : `server:${c.name}`;
1866
+ }
1867
+ function findUnmatched(entries, deps) {
1868
+ const configured = deps?.configuredServerNames ?? (() => {
1869
+ const scopes = ["enterprise", "user", "project", "local"];
1870
+ const names = new Set;
1871
+ for (const scope of scopes) {
1872
+ for (const name of Object.keys(getMcpConfigsByScope(scope).servers)) {
1873
+ names.add(name);
1874
+ }
1875
+ }
1876
+ return names;
1877
+ })();
1878
+ const installedPluginIds = deps?.installedPluginIds ?? (() => {
1879
+ const ids = new Set(Object.keys(loadInstalledPluginsV2().plugins));
1880
+ const builtinPlugins = getBuiltinPlugins();
1881
+ for (const plugin of [...builtinPlugins.enabled, ...builtinPlugins.disabled]) {
1882
+ ids.add(plugin.source);
1883
+ }
1884
+ return ids;
1885
+ })();
1886
+ const out = [];
1887
+ for (const entry of entries) {
1888
+ if (entry.kind === "server") {
1889
+ if (!configured.has(entry.name)) {
1890
+ out.push({ entry, why: "no MCP server configured with that name" });
1891
+ }
1892
+ continue;
1893
+ }
1894
+ if (!installedPluginIds.has(`${entry.name}@${entry.marketplace}`)) {
1895
+ out.push({ entry, why: "plugin not installed" });
1896
+ }
1897
+ }
1898
+ return out;
1899
+ }
1900
+ var import_react10, jsx_dev_runtime14;
1901
+ var init_ChannelsNotice = __esm(() => {
1902
+ init_state();
1903
+ init_builtinPlugins();
1904
+ init_src();
1905
+ init_config2();
1906
+ init_installedPluginsManager();
1907
+ import_react10 = __toESM(require_react(), 1);
1908
+ jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
1909
+ });
1910
+
1911
+ // src/components/LogoV2/LogoV2.tsx
1912
+ function LogoV2() {
1913
+ const activities = getRecentActivitySync();
1914
+ const username = getGlobalConfig().oauthAccount?.displayName ?? "";
1915
+ const { columns } = useTerminalSize();
1916
+ const showOnboarding = shouldShowProjectOnboarding();
1917
+ const showSandboxStatus = SandboxManager.isSandboxingEnabled();
1918
+ const showGuestPassesUpsell = useShowGuestPassesUpsell();
1919
+ const showOverageCreditUpsell = useShowOverageCreditUpsell();
1920
+ const agent = useAppState((s) => s.agent);
1921
+ const effortValue = useAppState((s) => s.effortValue);
1922
+ const config = getGlobalConfig();
1923
+ let changelog;
1924
+ try {
1925
+ changelog = getRecentReleaseNotesSync(3);
1926
+ } catch {
1927
+ changelog = [];
1928
+ }
1929
+ const [announcement] = import_react11.useState(() => {
1930
+ const announcements = getInitialSettings().companyAnnouncements;
1931
+ if (!announcements || announcements.length === 0)
1932
+ return;
1933
+ return config.numStartups === 1 ? announcements[0] : announcements[Math.floor(Math.random() * announcements.length)];
1934
+ });
1935
+ const { hasReleaseNotes } = checkForReleaseNotesSync(config.lastReleaseNotesSeen);
1936
+ import_react11.useEffect(() => {
1937
+ const currentConfig = getGlobalConfig();
1938
+ if (currentConfig.lastReleaseNotesSeen === "1.0.0") {
1939
+ return;
1940
+ }
1941
+ saveGlobalConfig((current) => {
1942
+ if (current.lastReleaseNotesSeen === "1.0.0")
1943
+ return current;
1944
+ return { ...current, lastReleaseNotesSeen: "1.0.0" };
1945
+ });
1946
+ if (showOnboarding) {
1947
+ incrementProjectOnboardingSeenCount();
1948
+ }
1949
+ }, [config, showOnboarding]);
1950
+ const isCondensedMode = !hasReleaseNotes && !showOnboarding && !isEnvTruthy(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);
1951
+ import_react11.useEffect(() => {
1952
+ if (showGuestPassesUpsell && !showOnboarding && !isCondensedMode) {
1953
+ incrementGuestPassesSeenCount();
1954
+ }
1955
+ }, [showGuestPassesUpsell, showOnboarding, isCondensedMode]);
1956
+ import_react11.useEffect(() => {
1957
+ if (showOverageCreditUpsell && !showOnboarding && !showGuestPassesUpsell && !isCondensedMode) {
1958
+ incrementOverageCreditUpsellSeenCount();
1959
+ }
1960
+ }, [
1961
+ showOverageCreditUpsell,
1962
+ showOnboarding,
1963
+ showGuestPassesUpsell,
1964
+ isCondensedMode
1965
+ ]);
1966
+ const model = useMainLoopModel();
1967
+ const fullModelDisplayName = renderModelSetting(model);
1968
+ const {
1969
+ version,
1970
+ cwd,
1971
+ billingType,
1972
+ agentName: agentNameFromSettings
1973
+ } = getLogoDisplayData();
1974
+ const agentName = agent ?? agentNameFromSettings;
1975
+ const effortSuffix = getEffortSuffix(model, effortValue);
1976
+ const modelDisplayName = truncate(fullModelDisplayName + effortSuffix, LEFT_PANEL_MAX_WIDTH - 20);
1977
+ if (!hasReleaseNotes && !showOnboarding && !isEnvTruthy(process.env.CLAUDE_CODE_FORCE_FULL_LOGO)) {
1978
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
1979
+ children: [
1980
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(CondensedLogo, {}, undefined, false, undefined, this),
1981
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(VoiceModeNotice, {}, undefined, false, undefined, this),
1982
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Opus1mMergeNotice, {}, undefined, false, undefined, this),
1983
+ ChannelsNoticeModule && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ChannelsNoticeModule.ChannelsNotice, {}, undefined, false, undefined, this),
1984
+ isDebugMode() && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
1985
+ paddingLeft: 2,
1986
+ flexDirection: "column",
1987
+ children: [
1988
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
1989
+ color: "warning",
1990
+ children: "Debug mode enabled"
1991
+ }, undefined, false, undefined, this),
1992
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
1993
+ dimColor: true,
1994
+ children: [
1995
+ "Logging to: ",
1996
+ isDebugToStdErr() ? "stderr" : getDebugLogPath()
1997
+ ]
1998
+ }, undefined, true, undefined, this)
1999
+ ]
2000
+ }, undefined, true, undefined, this),
2001
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(EmergencyTip, {}, undefined, false, undefined, this),
2002
+ process.env.CLAUDE_CODE_TMUX_SESSION && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2003
+ paddingLeft: 2,
2004
+ flexDirection: "column",
2005
+ children: [
2006
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2007
+ dimColor: true,
2008
+ children: [
2009
+ "tmux session: ",
2010
+ process.env.CLAUDE_CODE_TMUX_SESSION
2011
+ ]
2012
+ }, undefined, true, undefined, this),
2013
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2014
+ dimColor: true,
2015
+ children: process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS ? `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - RedScope uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})` : `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`
2016
+ }, undefined, false, undefined, this)
2017
+ ]
2018
+ }, undefined, true, undefined, this),
2019
+ announcement && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2020
+ paddingLeft: 2,
2021
+ flexDirection: "column",
2022
+ children: [
2023
+ !process.env.IS_DEMO && config.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2024
+ dimColor: true,
2025
+ children: [
2026
+ "Message from ",
2027
+ config.oauthAccount.organizationName,
2028
+ ":"
2029
+ ]
2030
+ }, undefined, true, undefined, this),
2031
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2032
+ children: announcement
2033
+ }, undefined, false, undefined, this)
2034
+ ]
2035
+ }, undefined, true, undefined, this),
2036
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2037
+ paddingLeft: 2,
2038
+ flexDirection: "column",
2039
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2040
+ dimColor: true,
2041
+ children: "Use /issue to report model behavior issues"
2042
+ }, undefined, false, undefined, this)
2043
+ }, undefined, false, undefined, this),
2044
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2045
+ paddingLeft: 2,
2046
+ flexDirection: "column",
2047
+ children: [
2048
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2049
+ color: "warning",
2050
+ children: "[ANT-ONLY] Logs:"
2051
+ }, undefined, false, undefined, this),
2052
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2053
+ dimColor: true,
2054
+ children: [
2055
+ "API calls: ",
2056
+ getDisplayPath(getDumpPromptsPath())
2057
+ ]
2058
+ }, undefined, true, undefined, this),
2059
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2060
+ dimColor: true,
2061
+ children: [
2062
+ "Debug logs: ",
2063
+ getDisplayPath(getDebugLogPath())
2064
+ ]
2065
+ }, undefined, true, undefined, this),
2066
+ isDetailedProfilingEnabled() && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2067
+ dimColor: true,
2068
+ children: [
2069
+ "Startup Perf: ",
2070
+ getDisplayPath(getStartupPerfLogPath())
2071
+ ]
2072
+ }, undefined, true, undefined, this)
2073
+ ]
2074
+ }, undefined, true, undefined, this),
2075
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(GateOverridesWarning, {}, undefined, false, undefined, this),
2076
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ExperimentEnrollmentNotice, {}, undefined, false, undefined, this)
2077
+ ]
2078
+ }, undefined, true, undefined, this);
2079
+ }
2080
+ const layoutMode = getLayoutMode(columns);
2081
+ const userTheme = resolveThemeSetting(getGlobalConfig().theme);
2082
+ const borderTitle = ` ${color("claude", userTheme)("RedScope AI")} ${color("inactive", userTheme)(`v${version}`)} `;
2083
+ const compactBorderTitle = color("claude", userTheme)(" RedScope AI ");
2084
+ if (layoutMode === "compact") {
2085
+ const layoutWidth = 4;
2086
+ let welcomeMessage2 = formatWelcomeMessage(username);
2087
+ if (stringWidth(welcomeMessage2) > columns - layoutWidth) {
2088
+ welcomeMessage2 = formatWelcomeMessage(null);
2089
+ }
2090
+ const separator = " \xB7 ";
2091
+ const atPrefix = "@";
2092
+ const cwdAvailableWidth2 = agentName ? columns - layoutWidth - atPrefix.length - stringWidth(agentName) - separator.length : columns - layoutWidth;
2093
+ const truncatedCwd2 = truncatePath(cwd, Math.max(cwdAvailableWidth2, 10));
2094
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
2095
+ children: [
2096
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(OffscreenFreeze, {
2097
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2098
+ flexDirection: "column",
2099
+ borderStyle: "round",
2100
+ borderColor: "claude",
2101
+ borderText: {
2102
+ content: compactBorderTitle,
2103
+ position: "top",
2104
+ align: "start",
2105
+ offset: 1
2106
+ },
2107
+ paddingX: 1,
2108
+ paddingY: 1,
2109
+ alignItems: "center",
2110
+ width: columns,
2111
+ children: [
2112
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2113
+ bold: true,
2114
+ children: welcomeMessage2
2115
+ }, undefined, false, undefined, this),
2116
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2117
+ marginY: 1,
2118
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Clawd, {}, undefined, false, undefined, this)
2119
+ }, undefined, false, undefined, this),
2120
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2121
+ dimColor: true,
2122
+ children: modelDisplayName
2123
+ }, undefined, false, undefined, this),
2124
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2125
+ dimColor: true,
2126
+ children: billingType
2127
+ }, undefined, false, undefined, this),
2128
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2129
+ dimColor: true,
2130
+ children: agentName ? `@${agentName} \xB7 ${truncatedCwd2}` : truncatedCwd2
2131
+ }, undefined, false, undefined, this)
2132
+ ]
2133
+ }, undefined, true, undefined, this)
2134
+ }, undefined, false, undefined, this),
2135
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(VoiceModeNotice, {}, undefined, false, undefined, this),
2136
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Opus1mMergeNotice, {}, undefined, false, undefined, this),
2137
+ ChannelsNoticeModule && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ChannelsNoticeModule.ChannelsNotice, {}, undefined, false, undefined, this),
2138
+ showSandboxStatus && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2139
+ marginTop: 1,
2140
+ flexDirection: "column",
2141
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2142
+ color: "warning",
2143
+ children: "Your bash commands will be sandboxed. Disable with /sandbox."
2144
+ }, undefined, false, undefined, this)
2145
+ }, undefined, false, undefined, this),
2146
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(GateOverridesWarning, {}, undefined, false, undefined, this),
2147
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ExperimentEnrollmentNotice, {}, undefined, false, undefined, this)
2148
+ ]
2149
+ }, undefined, true, undefined, this);
2150
+ }
2151
+ const welcomeMessage = formatWelcomeMessage(username);
2152
+ const modelLine = !process.env.IS_DEMO && config.oauthAccount?.organizationName ? `${modelDisplayName} \xB7 ${billingType} \xB7 ${config.oauthAccount.organizationName}` : `${modelDisplayName} \xB7 ${billingType}`;
2153
+ const cwdSeparator = " \xB7 ";
2154
+ const cwdAtPrefix = "@";
2155
+ const cwdAvailableWidth = agentName ? LEFT_PANEL_MAX_WIDTH - cwdAtPrefix.length - stringWidth(agentName) - cwdSeparator.length : LEFT_PANEL_MAX_WIDTH;
2156
+ const truncatedCwd = truncatePath(cwd, Math.max(cwdAvailableWidth, 10));
2157
+ const cwdLine = agentName ? `@${agentName} \xB7 ${truncatedCwd}` : truncatedCwd;
2158
+ const optimalLeftWidth = calculateOptimalLeftWidth(welcomeMessage, cwdLine, modelLine);
2159
+ const { leftWidth, rightWidth } = calculateLayoutDimensions(columns, layoutMode, optimalLeftWidth);
2160
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(jsx_dev_runtime15.Fragment, {
2161
+ children: [
2162
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(OffscreenFreeze, {
2163
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2164
+ flexDirection: "column",
2165
+ borderStyle: "round",
2166
+ borderColor: "claude",
2167
+ borderText: {
2168
+ content: borderTitle,
2169
+ position: "top",
2170
+ align: "start",
2171
+ offset: 3
2172
+ },
2173
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2174
+ flexDirection: layoutMode === "horizontal" ? "row" : "column",
2175
+ paddingX: 1,
2176
+ gap: 1,
2177
+ children: [
2178
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2179
+ flexDirection: "column",
2180
+ width: leftWidth,
2181
+ justifyContent: "space-between",
2182
+ alignItems: "center",
2183
+ minHeight: 9,
2184
+ children: [
2185
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2186
+ marginTop: 1,
2187
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2188
+ bold: true,
2189
+ children: welcomeMessage
2190
+ }, undefined, false, undefined, this)
2191
+ }, undefined, false, undefined, this),
2192
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Clawd, {}, undefined, false, undefined, this),
2193
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2194
+ flexDirection: "column",
2195
+ alignItems: "center",
2196
+ children: [
2197
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2198
+ dimColor: true,
2199
+ children: modelLine
2200
+ }, undefined, false, undefined, this),
2201
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2202
+ dimColor: true,
2203
+ children: cwdLine
2204
+ }, undefined, false, undefined, this)
2205
+ ]
2206
+ }, undefined, true, undefined, this)
2207
+ ]
2208
+ }, undefined, true, undefined, this),
2209
+ layoutMode === "horizontal" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2210
+ height: "100%",
2211
+ borderStyle: "single",
2212
+ borderColor: "claude",
2213
+ borderDimColor: true,
2214
+ borderTop: false,
2215
+ borderBottom: false,
2216
+ borderLeft: false
2217
+ }, undefined, false, undefined, this),
2218
+ layoutMode === "horizontal" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(FeedColumn, {
2219
+ feeds: showOnboarding ? [
2220
+ createProjectOnboardingFeed(getSteps()),
2221
+ createRecentActivityFeed(activities)
2222
+ ] : showGuestPassesUpsell ? [
2223
+ createRecentActivityFeed(activities),
2224
+ createGuestPassesFeed()
2225
+ ] : showOverageCreditUpsell ? [
2226
+ createRecentActivityFeed(activities),
2227
+ createOverageCreditFeed()
2228
+ ] : [
2229
+ createRecentActivityFeed(activities),
2230
+ createWhatsNewFeed(changelog)
2231
+ ],
2232
+ maxWidth: rightWidth
2233
+ }, undefined, false, undefined, this)
2234
+ ]
2235
+ }, undefined, true, undefined, this)
2236
+ }, undefined, false, undefined, this)
2237
+ }, undefined, false, undefined, this),
2238
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(VoiceModeNotice, {}, undefined, false, undefined, this),
2239
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Opus1mMergeNotice, {}, undefined, false, undefined, this),
2240
+ ChannelsNoticeModule && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ChannelsNoticeModule.ChannelsNotice, {}, undefined, false, undefined, this),
2241
+ isDebugMode() && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2242
+ paddingLeft: 2,
2243
+ flexDirection: "column",
2244
+ children: [
2245
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2246
+ color: "warning",
2247
+ children: "Debug mode enabled"
2248
+ }, undefined, false, undefined, this),
2249
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2250
+ dimColor: true,
2251
+ children: [
2252
+ "Logging to: ",
2253
+ isDebugToStdErr() ? "stderr" : getDebugLogPath()
2254
+ ]
2255
+ }, undefined, true, undefined, this)
2256
+ ]
2257
+ }, undefined, true, undefined, this),
2258
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(EmergencyTip, {}, undefined, false, undefined, this),
2259
+ process.env.CLAUDE_CODE_TMUX_SESSION && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2260
+ paddingLeft: 2,
2261
+ flexDirection: "column",
2262
+ children: [
2263
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2264
+ dimColor: true,
2265
+ children: [
2266
+ "tmux session: ",
2267
+ process.env.CLAUDE_CODE_TMUX_SESSION
2268
+ ]
2269
+ }, undefined, true, undefined, this),
2270
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2271
+ dimColor: true,
2272
+ children: process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS ? `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - RedScope uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})` : `Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`
2273
+ }, undefined, false, undefined, this)
2274
+ ]
2275
+ }, undefined, true, undefined, this),
2276
+ announcement && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2277
+ paddingLeft: 2,
2278
+ flexDirection: "column",
2279
+ children: [
2280
+ !process.env.IS_DEMO && config.oauthAccount?.organizationName && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2281
+ dimColor: true,
2282
+ children: [
2283
+ "Message from ",
2284
+ config.oauthAccount.organizationName,
2285
+ ":"
2286
+ ]
2287
+ }, undefined, true, undefined, this),
2288
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2289
+ children: announcement
2290
+ }, undefined, false, undefined, this)
2291
+ ]
2292
+ }, undefined, true, undefined, this),
2293
+ showSandboxStatus && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2294
+ paddingLeft: 2,
2295
+ flexDirection: "column",
2296
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2297
+ color: "warning",
2298
+ children: "Your bash commands will be sandboxed. Disable with /sandbox."
2299
+ }, undefined, false, undefined, this)
2300
+ }, undefined, false, undefined, this),
2301
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2302
+ paddingLeft: 2,
2303
+ flexDirection: "column",
2304
+ children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2305
+ dimColor: true,
2306
+ children: "Use /issue to report model behavior issues"
2307
+ }, undefined, false, undefined, this)
2308
+ }, undefined, false, undefined, this),
2309
+ process.env.USER_TYPE === "ant" && !process.env.DEMO_VERSION && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedBox_default, {
2310
+ paddingLeft: 2,
2311
+ flexDirection: "column",
2312
+ children: [
2313
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2314
+ color: "warning",
2315
+ children: "[ANT-ONLY] Logs:"
2316
+ }, undefined, false, undefined, this),
2317
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2318
+ dimColor: true,
2319
+ children: [
2320
+ "API calls: ",
2321
+ getDisplayPath(getDumpPromptsPath())
2322
+ ]
2323
+ }, undefined, true, undefined, this),
2324
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2325
+ dimColor: true,
2326
+ children: [
2327
+ "Debug logs: ",
2328
+ getDisplayPath(getDebugLogPath())
2329
+ ]
2330
+ }, undefined, true, undefined, this),
2331
+ isDetailedProfilingEnabled() && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ThemedText, {
2332
+ dimColor: true,
2333
+ children: [
2334
+ "Startup Perf: ",
2335
+ getDisplayPath(getStartupPerfLogPath())
2336
+ ]
2337
+ }, undefined, true, undefined, this)
2338
+ ]
2339
+ }, undefined, true, undefined, this),
2340
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(GateOverridesWarning, {}, undefined, false, undefined, this),
2341
+ process.env.USER_TYPE === "ant" && /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ExperimentEnrollmentNotice, {}, undefined, false, undefined, this)
2342
+ ]
2343
+ }, undefined, true, undefined, this);
2344
+ }
2345
+ var import_react11, jsx_dev_runtime15, ChannelsNoticeModule, LEFT_PANEL_MAX_WIDTH = 50;
2346
+ var init_LogoV2 = __esm(() => {
2347
+ init_src();
2348
+ init_useTerminalSize();
2349
+ init_logoV2Utils();
2350
+ init_format();
2351
+ init_file();
2352
+ init_Clawd();
2353
+ init_FeedColumn();
2354
+ init_feedConfigs();
2355
+ init_config();
2356
+ init_systemTheme();
2357
+ init_settings();
2358
+ init_debug();
2359
+ init_projectOnboardingState();
2360
+ init_CondensedLogo();
2361
+ init_OffscreenFreeze();
2362
+ init_releaseNotes();
2363
+ init_dumpPrompts();
2364
+ init_envUtils();
2365
+ init_startupProfiler();
2366
+ init_EmergencyTip();
2367
+ init_VoiceModeNotice();
2368
+ init_Opus1mMergeNotice();
2369
+ init_GateOverridesWarning();
2370
+ init_ExperimentEnrollmentNotice();
2371
+ init_sandbox_adapter();
2372
+ init_GuestPassesUpsell();
2373
+ init_OverageCreditUpsell();
2374
+ init_AppState();
2375
+ init_effort();
2376
+ init_useMainLoopModel();
2377
+ init_model();
2378
+ import_react11 = __toESM(require_react(), 1);
2379
+ jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
2380
+ ChannelsNoticeModule = (init_ChannelsNotice(), __toCommonJS(exports_ChannelsNotice));
2381
+ });
2382
+
2383
+ // src/components/MessageModel.tsx
2384
+ function MessageModel({
2385
+ message,
2386
+ isTranscriptMode
2387
+ }) {
2388
+ const content = message.message?.content;
2389
+ const contentArray = Array.isArray(content) ? content : [];
2390
+ const shouldShowModel = isTranscriptMode && message.type === "assistant" && message.message?.model && contentArray.some((c) => c?.type === "text");
2391
+ if (!shouldShowModel) {
2392
+ return null;
2393
+ }
2394
+ const model = message.message.model;
2395
+ return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ThemedBox_default, {
2396
+ minWidth: stringWidth(model) + 8,
2397
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ThemedText, {
2398
+ dimColor: true,
2399
+ children: model
2400
+ }, undefined, false, undefined, this)
2401
+ }, undefined, false, undefined, this);
2402
+ }
2403
+ var jsx_dev_runtime16;
2404
+ var init_MessageModel = __esm(() => {
2405
+ init_src();
2406
+ jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
2407
+ });
2408
+
2409
+ // src/components/MessageTimestamp.tsx
2410
+ function MessageTimestamp({
2411
+ message,
2412
+ isTranscriptMode
2413
+ }) {
2414
+ const shouldShowTimestamp = isTranscriptMode && message.timestamp && message.type === "assistant" && (Array.isArray(message.message.content) ? message.message.content.some((c) => c.type === "text") : false);
2415
+ if (!shouldShowTimestamp) {
2416
+ return null;
2417
+ }
2418
+ const formattedTimestamp = new Date(message.timestamp).toLocaleTimeString("en-US", {
2419
+ hour: "2-digit",
2420
+ minute: "2-digit",
2421
+ hour12: true
2422
+ });
2423
+ return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedBox_default, {
2424
+ minWidth: stringWidth(formattedTimestamp),
2425
+ children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemedText, {
2426
+ dimColor: true,
2427
+ children: formattedTimestamp
2428
+ }, undefined, false, undefined, this)
2429
+ }, undefined, false, undefined, this);
2430
+ }
2431
+ var jsx_dev_runtime17;
2432
+ var init_MessageTimestamp = __esm(() => {
2433
+ init_src();
2434
+ jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
2435
+ });
2436
+
2437
+ // src/components/MessageRow.tsx
2438
+ function hasContentAfterIndex(messages, index, tools, streamingToolUseIDs) {
2439
+ for (let i = index + 1;i < messages.length; i++) {
2440
+ const msg = messages[i];
2441
+ if (msg?.type === "assistant") {
2442
+ const content = firstBlock(msg.message.content);
2443
+ if (content?.type === "thinking" || content?.type === "redacted_thinking") {
2444
+ continue;
2445
+ }
2446
+ if (content?.type === "tool_use") {
2447
+ if (getToolSearchOrReadInfo(content.name, content.input, tools).isCollapsible) {
2448
+ continue;
2449
+ }
2450
+ if (streamingToolUseIDs.has(content.id)) {
2451
+ continue;
2452
+ }
2453
+ }
2454
+ return true;
2455
+ }
2456
+ if (msg?.type === "system" || msg?.type === "attachment") {
2457
+ continue;
2458
+ }
2459
+ if (msg?.type === "user") {
2460
+ const content = firstBlock(msg.message.content);
2461
+ if (content?.type === "tool_result") {
2462
+ continue;
2463
+ }
2464
+ }
2465
+ if (msg?.type === "grouped_tool_use") {
2466
+ const firstInput = firstBlock(msg.messages[0]?.message.content)?.input;
2467
+ if (getToolSearchOrReadInfo(msg.toolName, firstInput, tools).isCollapsible) {
2468
+ continue;
2469
+ }
2470
+ }
2471
+ return true;
2472
+ }
2473
+ return false;
2474
+ }
2475
+ function MessageRowImpl({
2476
+ message: msg,
2477
+ isUserContinuation,
2478
+ hasContentAfter,
2479
+ tools,
2480
+ commands,
2481
+ verbose,
2482
+ inProgressToolUseIDs,
2483
+ streamingToolUseIDs,
2484
+ screen,
2485
+ canAnimate,
2486
+ onOpenRateLimitOptions,
2487
+ lastThinkingBlockId,
2488
+ latestBashOutputUUID,
2489
+ columns,
2490
+ isLoading,
2491
+ lookups,
2492
+ shouldCollapseDiffs
2493
+ }) {
2494
+ const isTranscriptMode = screen === "transcript";
2495
+ const isGrouped = msg.type === "grouped_tool_use";
2496
+ const isCollapsed = msg.type === "collapsed_read_search";
2497
+ const isActiveCollapsedGroup = isCollapsed && (hasAnyToolInProgress(msg, inProgressToolUseIDs) || isLoading && !hasContentAfter);
2498
+ const displayMsg = isGrouped ? msg.displayMessage : isCollapsed ? getDisplayMessageFromCollapsed(msg) : msg;
2499
+ const progressMessagesForMessage = isGrouped || isCollapsed ? [] : getProgressMessagesFromLookup(msg, lookups);
2500
+ const siblingToolUseIDs = isGrouped || isCollapsed ? EMPTY_STRING_SET : getSiblingToolUseIDsFromLookup(msg, lookups);
2501
+ const isStatic = shouldRenderStatically(msg, streamingToolUseIDs, inProgressToolUseIDs, siblingToolUseIDs, screen, lookups);
2502
+ let shouldAnimate = false;
2503
+ if (canAnimate) {
2504
+ if (isGrouped) {
2505
+ shouldAnimate = msg.messages.some((m) => {
2506
+ const content = firstBlock(m.message.content);
2507
+ return content?.type === "tool_use" && inProgressToolUseIDs.has(content.id);
2508
+ });
2509
+ } else if (isCollapsed) {
2510
+ shouldAnimate = hasAnyToolInProgress(msg, inProgressToolUseIDs);
2511
+ } else {
2512
+ const toolUseID = getToolUseID(msg);
2513
+ shouldAnimate = !toolUseID || inProgressToolUseIDs.has(toolUseID);
2514
+ }
2515
+ }
2516
+ const hasMetadata = isTranscriptMode && displayMsg.type === "assistant" && (Array.isArray(displayMsg.message.content) && displayMsg.message.content.some((c) => c.type === "text")) && (displayMsg.timestamp || displayMsg.message.model);
2517
+ const messageEl = /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Message, {
2518
+ message: msg,
2519
+ lookups,
2520
+ addMargin: !hasMetadata,
2521
+ containerWidth: hasMetadata ? undefined : columns,
2522
+ tools,
2523
+ commands,
2524
+ verbose,
2525
+ inProgressToolUseIDs,
2526
+ progressMessagesForMessage,
2527
+ shouldAnimate,
2528
+ shouldShowDot: true,
2529
+ isTranscriptMode,
2530
+ isStatic,
2531
+ onOpenRateLimitOptions,
2532
+ isActiveCollapsedGroup,
2533
+ isUserContinuation,
2534
+ lastThinkingBlockId,
2535
+ latestBashOutputUUID,
2536
+ shouldCollapseDiffs
2537
+ }, undefined, false, undefined, this);
2538
+ if (!hasMetadata) {
2539
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(OffscreenFreeze, {
2540
+ children: messageEl
2541
+ }, undefined, false, undefined, this);
2542
+ }
2543
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(OffscreenFreeze, {
2544
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(ThemedBox_default, {
2545
+ width: columns,
2546
+ flexDirection: "column",
2547
+ children: [
2548
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(ThemedBox_default, {
2549
+ flexDirection: "row",
2550
+ justifyContent: "flex-end",
2551
+ gap: 1,
2552
+ marginTop: 1,
2553
+ children: [
2554
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(MessageTimestamp, {
2555
+ message: displayMsg,
2556
+ isTranscriptMode
2557
+ }, undefined, false, undefined, this),
2558
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(MessageModel, {
2559
+ message: displayMsg,
2560
+ isTranscriptMode
2561
+ }, undefined, false, undefined, this)
2562
+ ]
2563
+ }, undefined, true, undefined, this),
2564
+ messageEl
2565
+ ]
2566
+ }, undefined, true, undefined, this)
2567
+ }, undefined, false, undefined, this);
2568
+ }
2569
+ function isMessageStreaming(msg, streamingToolUseIDs) {
2570
+ if (msg.type === "grouped_tool_use") {
2571
+ return msg.messages.some((m) => {
2572
+ const content = firstBlock(m.message.content);
2573
+ return content?.type === "tool_use" && streamingToolUseIDs.has(content.id);
2574
+ });
2575
+ }
2576
+ if (msg.type === "collapsed_read_search") {
2577
+ const toolIds = getToolUseIdsFromCollapsedGroup(msg);
2578
+ return toolIds.some((id) => streamingToolUseIDs.has(id));
2579
+ }
2580
+ const toolUseID = getToolUseID(msg);
2581
+ return !!toolUseID && streamingToolUseIDs.has(toolUseID);
2582
+ }
2583
+ function allToolsResolved(msg, resolvedToolUseIDs) {
2584
+ if (msg.type === "grouped_tool_use") {
2585
+ return msg.messages.every((m) => {
2586
+ const content = firstBlock(m.message.content);
2587
+ return content?.type === "tool_use" && resolvedToolUseIDs.has(content.id);
2588
+ });
2589
+ }
2590
+ if (msg.type === "collapsed_read_search") {
2591
+ const toolIds = getToolUseIdsFromCollapsedGroup(msg);
2592
+ return toolIds.every((id) => resolvedToolUseIDs.has(id));
2593
+ }
2594
+ if (msg.type === "assistant") {
2595
+ const block = firstBlock(msg.message.content);
2596
+ if (block?.type === "server_tool_use") {
2597
+ return resolvedToolUseIDs.has(block.id);
2598
+ }
2599
+ }
2600
+ const toolUseID = getToolUseID(msg);
2601
+ return !toolUseID || resolvedToolUseIDs.has(toolUseID);
2602
+ }
2603
+ function areMessageRowPropsEqual(prev, next) {
2604
+ if (prev.message !== next.message)
2605
+ return false;
2606
+ if (prev.screen !== next.screen)
2607
+ return false;
2608
+ if (prev.verbose !== next.verbose)
2609
+ return false;
2610
+ if (prev.message.type === "collapsed_read_search" && next.screen !== "transcript") {
2611
+ return false;
2612
+ }
2613
+ if (prev.columns !== next.columns)
2614
+ return false;
2615
+ const prevIsLatestBash = prev.latestBashOutputUUID === prev.message.uuid;
2616
+ const nextIsLatestBash = next.latestBashOutputUUID === next.message.uuid;
2617
+ if (prevIsLatestBash !== nextIsLatestBash)
2618
+ return false;
2619
+ if (prev.lastThinkingBlockId !== next.lastThinkingBlockId && hasThinkingContent(next.message)) {
2620
+ return false;
2621
+ }
2622
+ const isStreaming = isMessageStreaming(prev.message, prev.streamingToolUseIDs);
2623
+ const isResolved = allToolsResolved(prev.message, prev.lookups.resolvedToolUseIDs);
2624
+ if (isStreaming || !isResolved)
2625
+ return false;
2626
+ return true;
2627
+ }
2628
+ var React4, jsx_dev_runtime18, firstBlock = (content) => {
2629
+ if (!Array.isArray(content))
2630
+ return;
2631
+ const b = content[0];
2632
+ if (b == null || typeof b === "string")
2633
+ return;
2634
+ return b;
2635
+ }, MessageRow;
2636
+ var init_MessageRow = __esm(() => {
2637
+ init_src();
2638
+ init_collapseReadSearch();
2639
+ init_messages();
2640
+ init_Message();
2641
+ init_MessageModel();
2642
+ init_Messages();
2643
+ init_MessageTimestamp();
2644
+ init_OffscreenFreeze();
2645
+ React4 = __toESM(require_react(), 1);
2646
+ jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
2647
+ MessageRow = React4.memo(MessageRowImpl, areMessageRowPropsEqual);
2648
+ });
2649
+
2650
+ // src/utils/statusNoticeDefinitions.tsx
2651
+ import { relative } from "path";
2652
+ function getActiveNotices(context) {
2653
+ return statusNoticeDefinitions.filter((notice) => notice.isActive(context));
2654
+ }
2655
+ var jsx_dev_runtime19, largeMemoryFilesNotice, claudeAiSubscriberExternalTokenNotice, apiKeyConflictNotice, bothAuthMethodsNotice, largeAgentDescriptionsNotice, jetbrainsPluginNotice, statusNoticeDefinitions;
2656
+ var init_statusNoticeDefinitions = __esm(() => {
2657
+ init_src();
2658
+ init_claudemd();
2659
+ init_figures();
2660
+ init_cwd();
2661
+ init_format();
2662
+ init_auth();
2663
+ init_statusNoticeHelpers();
2664
+ init_ide();
2665
+ init_jetbrains();
2666
+ jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
2667
+ largeMemoryFilesNotice = {
2668
+ id: "large-memory-files",
2669
+ type: "warning",
2670
+ isActive: (ctx) => getLargeMemoryFiles(ctx.memoryFiles).length > 0,
2671
+ render: (ctx) => {
2672
+ const largeMemoryFiles = getLargeMemoryFiles(ctx.memoryFiles);
2673
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
2674
+ children: largeMemoryFiles.map((file) => {
2675
+ const displayPath = file.path.startsWith(getCwd()) ? relative(getCwd(), file.path) : file.path;
2676
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2677
+ flexDirection: "row",
2678
+ children: [
2679
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2680
+ color: "warning",
2681
+ children: figures_default.warning
2682
+ }, undefined, false, undefined, this),
2683
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2684
+ color: "warning",
2685
+ children: [
2686
+ "Large ",
2687
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2688
+ bold: true,
2689
+ children: displayPath
2690
+ }, undefined, false, undefined, this),
2691
+ " will impact performance (",
2692
+ formatNumber(file.content.length),
2693
+ " chars > ",
2694
+ formatNumber(MAX_MEMORY_CHARACTER_COUNT),
2695
+ ")",
2696
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2697
+ dimColor: true,
2698
+ children: " \xB7 /memory to edit"
2699
+ }, undefined, false, undefined, this)
2700
+ ]
2701
+ }, undefined, true, undefined, this)
2702
+ ]
2703
+ }, file.path, true, undefined, this);
2704
+ })
2705
+ }, undefined, false, undefined, this);
2706
+ }
2707
+ };
2708
+ claudeAiSubscriberExternalTokenNotice = {
2709
+ id: "claude-ai-external-token",
2710
+ type: "warning",
2711
+ isActive: () => {
2712
+ const authTokenInfo = getAuthTokenSource();
2713
+ return isClaudeAISubscriber() && (authTokenInfo.source === "ANTHROPIC_AUTH_TOKEN" || authTokenInfo.source === "apiKeyHelper");
2714
+ },
2715
+ render: () => {
2716
+ const authTokenInfo = getAuthTokenSource();
2717
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2718
+ flexDirection: "row",
2719
+ marginTop: 1,
2720
+ children: [
2721
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2722
+ color: "warning",
2723
+ children: figures_default.warning
2724
+ }, undefined, false, undefined, this),
2725
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2726
+ color: "warning",
2727
+ children: [
2728
+ "Auth conflict: Using ",
2729
+ authTokenInfo.source,
2730
+ " instead of RedScope account subscription token. Either unset",
2731
+ " ",
2732
+ authTokenInfo.source,
2733
+ ", or run `redscope /logout`."
2734
+ ]
2735
+ }, undefined, true, undefined, this)
2736
+ ]
2737
+ }, undefined, true, undefined, this);
2738
+ }
2739
+ };
2740
+ apiKeyConflictNotice = {
2741
+ id: "api-key-conflict",
2742
+ type: "warning",
2743
+ isActive: () => {
2744
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2745
+ skipRetrievingKeyFromApiKeyHelper: true
2746
+ });
2747
+ return !!getApiKeyFromConfigOrMacOSKeychain() && (apiKeySource === "ANTHROPIC_API_KEY" || apiKeySource === "apiKeyHelper");
2748
+ },
2749
+ render: () => {
2750
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2751
+ skipRetrievingKeyFromApiKeyHelper: true
2752
+ });
2753
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2754
+ flexDirection: "row",
2755
+ marginTop: 1,
2756
+ children: [
2757
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2758
+ color: "warning",
2759
+ children: figures_default.warning
2760
+ }, undefined, false, undefined, this),
2761
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2762
+ color: "warning",
2763
+ children: [
2764
+ "Auth conflict: Using ",
2765
+ apiKeySource,
2766
+ " instead of Anthropic Console key. Either unset ",
2767
+ apiKeySource,
2768
+ ", or run `redscope /logout`."
2769
+ ]
2770
+ }, undefined, true, undefined, this)
2771
+ ]
2772
+ }, undefined, true, undefined, this);
2773
+ }
2774
+ };
2775
+ bothAuthMethodsNotice = {
2776
+ id: "both-auth-methods",
2777
+ type: "warning",
2778
+ isActive: () => {
2779
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2780
+ skipRetrievingKeyFromApiKeyHelper: true
2781
+ });
2782
+ const authTokenInfo = getAuthTokenSource();
2783
+ return apiKeySource !== "none" && authTokenInfo.source !== "none" && !(apiKeySource === "apiKeyHelper" && authTokenInfo.source === "apiKeyHelper");
2784
+ },
2785
+ render: () => {
2786
+ const { source: apiKeySource } = getAnthropicApiKeyWithSource({
2787
+ skipRetrievingKeyFromApiKeyHelper: true
2788
+ });
2789
+ const authTokenInfo = getAuthTokenSource();
2790
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2791
+ flexDirection: "column",
2792
+ marginTop: 1,
2793
+ children: [
2794
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2795
+ flexDirection: "row",
2796
+ children: [
2797
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2798
+ color: "warning",
2799
+ children: figures_default.warning
2800
+ }, undefined, false, undefined, this),
2801
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2802
+ color: "warning",
2803
+ children: [
2804
+ "Auth conflict: Both a token (",
2805
+ authTokenInfo.source,
2806
+ ") and an API key (",
2807
+ apiKeySource,
2808
+ ") are set. This may lead to unexpected behavior."
2809
+ ]
2810
+ }, undefined, true, undefined, this)
2811
+ ]
2812
+ }, undefined, true, undefined, this),
2813
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2814
+ flexDirection: "column",
2815
+ marginLeft: 3,
2816
+ children: [
2817
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2818
+ color: "warning",
2819
+ children: [
2820
+ "\xB7 Trying to use ",
2821
+ authTokenInfo.source === "claude.ai" ? "claude.ai" : authTokenInfo.source,
2822
+ "?",
2823
+ " ",
2824
+ apiKeySource === "ANTHROPIC_API_KEY" ? 'Unset the ANTHROPIC_API_KEY environment variable, or redscope /logout then say "No" to the API key approval before login.' : apiKeySource === "apiKeyHelper" ? "Unset the apiKeyHelper setting." : "redscope /logout"
2825
+ ]
2826
+ }, undefined, true, undefined, this),
2827
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2828
+ color: "warning",
2829
+ children: [
2830
+ "\xB7 Trying to use ",
2831
+ apiKeySource,
2832
+ "?",
2833
+ " ",
2834
+ authTokenInfo.source === "claude.ai" ? "redscope /logout to sign out of claude.ai." : `Unset the ${authTokenInfo.source} environment variable.`
2835
+ ]
2836
+ }, undefined, true, undefined, this)
2837
+ ]
2838
+ }, undefined, true, undefined, this)
2839
+ ]
2840
+ }, undefined, true, undefined, this);
2841
+ }
2842
+ };
2843
+ largeAgentDescriptionsNotice = {
2844
+ id: "large-agent-descriptions",
2845
+ type: "warning",
2846
+ isActive: (context) => {
2847
+ const totalTokens = getAgentDescriptionsTotalTokens(context.agentDefinitions);
2848
+ return totalTokens > AGENT_DESCRIPTIONS_THRESHOLD;
2849
+ },
2850
+ render: (context) => {
2851
+ const totalTokens = getAgentDescriptionsTotalTokens(context.agentDefinitions);
2852
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2853
+ flexDirection: "row",
2854
+ children: [
2855
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2856
+ color: "warning",
2857
+ children: figures_default.warning
2858
+ }, undefined, false, undefined, this),
2859
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2860
+ color: "warning",
2861
+ children: [
2862
+ "Large cumulative agent descriptions will impact performance (~",
2863
+ formatNumber(totalTokens),
2864
+ " tokens > ",
2865
+ formatNumber(AGENT_DESCRIPTIONS_THRESHOLD),
2866
+ ")",
2867
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2868
+ dimColor: true,
2869
+ children: " \xB7 /agents to manage"
2870
+ }, undefined, false, undefined, this)
2871
+ ]
2872
+ }, undefined, true, undefined, this)
2873
+ ]
2874
+ }, undefined, true, undefined, this);
2875
+ }
2876
+ };
2877
+ jetbrainsPluginNotice = {
2878
+ id: "jetbrains-plugin-install",
2879
+ type: "info",
2880
+ isActive: (context) => {
2881
+ if (!isSupportedJetBrainsTerminal()) {
2882
+ return false;
2883
+ }
2884
+ const shouldAutoInstall = context.config.autoInstallIdeExtension ?? true;
2885
+ if (!shouldAutoInstall) {
2886
+ return false;
2887
+ }
2888
+ const ideType = getTerminalIdeType();
2889
+ return ideType !== null && !isJetBrainsPluginInstalledCachedSync(ideType);
2890
+ },
2891
+ render: () => {
2892
+ const ideType = getTerminalIdeType();
2893
+ const ideName = toIDEDisplayName(ideType);
2894
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedBox_default, {
2895
+ flexDirection: "row",
2896
+ gap: 1,
2897
+ marginLeft: 1,
2898
+ children: [
2899
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2900
+ color: "ide",
2901
+ children: figures_default.arrowUp
2902
+ }, undefined, false, undefined, this),
2903
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2904
+ children: [
2905
+ "Install the ",
2906
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2907
+ color: "ide",
2908
+ children: ideName
2909
+ }, undefined, false, undefined, this),
2910
+ " plugin from the JetBrains Marketplace:",
2911
+ " ",
2912
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ThemedText, {
2913
+ bold: true,
2914
+ children: "https://docs.claude.com/s/claude-code-jetbrains"
2915
+ }, undefined, false, undefined, this)
2916
+ ]
2917
+ }, undefined, true, undefined, this)
2918
+ ]
2919
+ }, undefined, true, undefined, this);
2920
+ }
2921
+ };
2922
+ statusNoticeDefinitions = [
2923
+ largeMemoryFilesNotice,
2924
+ largeAgentDescriptionsNotice,
2925
+ claudeAiSubscriberExternalTokenNotice,
2926
+ apiKeyConflictNotice,
2927
+ bothAuthMethodsNotice,
2928
+ jetbrainsPluginNotice
2929
+ ];
2930
+ });
2931
+
2932
+ // src/components/StatusNotices.tsx
2933
+ function StatusNotices({
2934
+ agentDefinitions
2935
+ } = {}) {
2936
+ const context = {
2937
+ config: getGlobalConfig(),
2938
+ agentDefinitions,
2939
+ memoryFiles: import_react12.use(getMemoryFiles())
2940
+ };
2941
+ const activeNotices = getActiveNotices(context);
2942
+ if (activeNotices.length === 0) {
2943
+ return null;
2944
+ }
2945
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ThemedBox_default, {
2946
+ flexDirection: "column",
2947
+ paddingLeft: 1,
2948
+ children: activeNotices.map((notice) => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(React5.Fragment, {
2949
+ children: notice.render(context)
2950
+ }, notice.id, false, undefined, this))
2951
+ }, undefined, false, undefined, this);
2952
+ }
2953
+ var React5, import_react12, jsx_dev_runtime20;
2954
+ var init_StatusNotices = __esm(() => {
2955
+ init_src();
2956
+ init_claudemd();
2957
+ init_config();
2958
+ init_statusNoticeDefinitions();
2959
+ React5 = __toESM(require_react(), 1);
2960
+ import_react12 = __toESM(require_react(), 1);
2961
+ jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
2962
+ });
2963
+
2964
+ // src/hooks/useVirtualScroll.ts
2965
+ function useVirtualScroll(scrollRef, itemKeys, columns) {
2966
+ const heightCache = import_react13.useRef(new Map);
2967
+ const offsetVersionRef = import_react13.useRef(0);
2968
+ const lastScrollTopRef = import_react13.useRef(0);
2969
+ const offsetsRef = import_react13.useRef({
2970
+ arr: new Float64Array(0),
2971
+ version: -1,
2972
+ n: -1
2973
+ });
2974
+ const itemRefs = import_react13.useRef(new Map);
2975
+ const refCache = import_react13.useRef(new Map);
2976
+ const prevColumns = import_react13.useRef(columns);
2977
+ const skipMeasurementRef = import_react13.useRef(false);
2978
+ const prevRangeRef = import_react13.useRef(null);
2979
+ const freezeRendersRef = import_react13.useRef(0);
2980
+ if (prevColumns.current !== columns) {
2981
+ const ratio = prevColumns.current / columns;
2982
+ prevColumns.current = columns;
2983
+ for (const [k, h] of heightCache.current) {
2984
+ heightCache.current.set(k, Math.max(1, Math.round(h * ratio)));
2985
+ }
2986
+ offsetVersionRef.current++;
2987
+ skipMeasurementRef.current = true;
2988
+ freezeRendersRef.current = 2;
2989
+ }
2990
+ const frozenRange = freezeRendersRef.current > 0 ? prevRangeRef.current : null;
2991
+ const listOriginRef = import_react13.useRef(0);
2992
+ const spacerRef = import_react13.useRef(null);
2993
+ const subscribe = import_react13.useCallback((listener) => scrollRef.current?.subscribe(listener) ?? NOOP_UNSUB, [scrollRef]);
2994
+ import_react13.useSyncExternalStore(subscribe, () => {
2995
+ const s = scrollRef.current;
2996
+ if (!s)
2997
+ return NaN;
2998
+ const target = s.getScrollTop() + s.getPendingDelta();
2999
+ const bin = Math.floor(target / SCROLL_QUANTUM);
3000
+ return s.isSticky() ? ~bin : bin;
3001
+ });
3002
+ const scrollTop = scrollRef.current?.getScrollTop() ?? -1;
3003
+ const pendingDelta = scrollRef.current?.getPendingDelta() ?? 0;
3004
+ const viewportH = scrollRef.current?.getViewportHeight() ?? 0;
3005
+ const isSticky = scrollRef.current?.isSticky() ?? true;
3006
+ import_react13.useMemo(() => {
3007
+ const live = new Set(itemKeys);
3008
+ let dirty = false;
3009
+ for (const k of heightCache.current.keys()) {
3010
+ if (!live.has(k)) {
3011
+ heightCache.current.delete(k);
3012
+ dirty = true;
3013
+ }
3014
+ }
3015
+ for (const k of refCache.current.keys()) {
3016
+ if (!live.has(k))
3017
+ refCache.current.delete(k);
3018
+ }
3019
+ if (dirty)
3020
+ offsetVersionRef.current++;
3021
+ }, [itemKeys]);
3022
+ const n = itemKeys.length;
3023
+ if (offsetsRef.current.version !== offsetVersionRef.current || offsetsRef.current.n !== n) {
3024
+ const arr = offsetsRef.current.arr.length >= n + 1 ? offsetsRef.current.arr : new Float64Array(n + 1);
3025
+ arr[0] = 0;
3026
+ for (let i = 0;i < n; i++) {
3027
+ arr[i + 1] = arr[i] + (heightCache.current.get(itemKeys[i]) ?? DEFAULT_ESTIMATE);
3028
+ }
3029
+ offsetsRef.current = { arr, version: offsetVersionRef.current, n };
3030
+ }
3031
+ const offsets = offsetsRef.current.arr;
3032
+ const totalHeight = offsets[n];
3033
+ let start;
3034
+ let end;
3035
+ if (frozenRange) {
3036
+ [start, end] = frozenRange;
3037
+ start = Math.min(start, n);
3038
+ end = Math.min(end, n);
3039
+ } else if (viewportH === 0 || scrollTop < 0) {
3040
+ start = Math.max(0, n - COLD_START_COUNT);
3041
+ end = n;
3042
+ } else {
3043
+ if (isSticky) {
3044
+ const budget = viewportH + OVERSCAN_ROWS;
3045
+ start = n;
3046
+ while (start > 0 && totalHeight - offsets[start - 1] < budget) {
3047
+ start--;
3048
+ }
3049
+ end = n;
3050
+ } else {
3051
+ const listOrigin2 = listOriginRef.current;
3052
+ const MAX_SPAN_ROWS = viewportH * 3;
3053
+ const rawLo = Math.min(scrollTop, scrollTop + pendingDelta);
3054
+ const rawHi = Math.max(scrollTop, scrollTop + pendingDelta);
3055
+ const span = rawHi - rawLo;
3056
+ const clampedLo = span > MAX_SPAN_ROWS ? pendingDelta < 0 ? rawHi - MAX_SPAN_ROWS : rawLo : rawLo;
3057
+ const clampedHi = clampedLo + Math.min(span, MAX_SPAN_ROWS);
3058
+ const effLo = Math.max(0, clampedLo - listOrigin2);
3059
+ const effHi = clampedHi - listOrigin2;
3060
+ const lo = effLo - OVERSCAN_ROWS;
3061
+ {
3062
+ let l = 0;
3063
+ let r = n;
3064
+ while (l < r) {
3065
+ const m = l + r >> 1;
3066
+ if (offsets[m + 1] <= lo)
3067
+ l = m + 1;
3068
+ else
3069
+ r = m;
3070
+ }
3071
+ start = l;
3072
+ }
3073
+ {
3074
+ const p = prevRangeRef.current;
3075
+ if (p && p[0] < start) {
3076
+ for (let i = p[0];i < Math.min(start, p[1]); i++) {
3077
+ const k = itemKeys[i];
3078
+ if (itemRefs.current.has(k) && !heightCache.current.has(k)) {
3079
+ start = i;
3080
+ break;
3081
+ }
3082
+ }
3083
+ }
3084
+ }
3085
+ const needed2 = viewportH + 2 * OVERSCAN_ROWS;
3086
+ const maxEnd = Math.min(n, start + MAX_MOUNTED_ITEMS);
3087
+ let coverage2 = 0;
3088
+ end = start;
3089
+ while (end < maxEnd && (coverage2 < needed2 || offsets[end] < effHi + viewportH + OVERSCAN_ROWS)) {
3090
+ coverage2 += heightCache.current.get(itemKeys[end]) ?? PESSIMISTIC_HEIGHT;
3091
+ end++;
3092
+ }
3093
+ }
3094
+ const needed = viewportH + 2 * OVERSCAN_ROWS;
3095
+ const minStart = Math.max(0, end - MAX_MOUNTED_ITEMS);
3096
+ let coverage = 0;
3097
+ for (let i = start;i < end; i++) {
3098
+ coverage += heightCache.current.get(itemKeys[i]) ?? PESSIMISTIC_HEIGHT;
3099
+ }
3100
+ while (start > minStart && coverage < needed) {
3101
+ start--;
3102
+ coverage += heightCache.current.get(itemKeys[start]) ?? PESSIMISTIC_HEIGHT;
3103
+ }
3104
+ const prev = prevRangeRef.current;
3105
+ const scrollVelocity = Math.abs(scrollTop - lastScrollTopRef.current) + Math.abs(pendingDelta);
3106
+ if (prev && scrollVelocity > viewportH * 2) {
3107
+ const [pS, pE] = prev;
3108
+ if (start < pS - SLIDE_STEP)
3109
+ start = pS - SLIDE_STEP;
3110
+ if (end > pE + SLIDE_STEP)
3111
+ end = pE + SLIDE_STEP;
3112
+ if (start > end)
3113
+ end = Math.min(start + SLIDE_STEP, n);
3114
+ }
3115
+ lastScrollTopRef.current = scrollTop;
3116
+ }
3117
+ if (freezeRendersRef.current > 0) {
3118
+ freezeRendersRef.current--;
3119
+ } else {
3120
+ prevRangeRef.current = [start, end];
3121
+ }
3122
+ const dStart = import_react13.useDeferredValue(start);
3123
+ const dEnd = import_react13.useDeferredValue(end);
3124
+ let effStart = start < dStart ? dStart : start;
3125
+ let effEnd = end > dEnd ? dEnd : end;
3126
+ if (effStart > effEnd || isSticky) {
3127
+ effStart = start;
3128
+ effEnd = end;
3129
+ }
3130
+ if (pendingDelta > 0) {
3131
+ effEnd = end;
3132
+ }
3133
+ if (effEnd - effStart > MAX_MOUNTED_ITEMS) {
3134
+ const mid = (offsets[effStart] + offsets[effEnd]) / 2;
3135
+ if (scrollTop - listOriginRef.current < mid) {
3136
+ effEnd = effStart + MAX_MOUNTED_ITEMS;
3137
+ } else {
3138
+ effStart = effEnd - MAX_MOUNTED_ITEMS;
3139
+ }
3140
+ }
3141
+ const listOrigin = listOriginRef.current;
3142
+ const effTopSpacer = offsets[effStart];
3143
+ const clampMin = effStart === 0 ? 0 : effTopSpacer + listOrigin;
3144
+ const clampMax = effEnd === n ? Infinity : Math.max(effTopSpacer, offsets[effEnd] - viewportH) + listOrigin;
3145
+ import_react13.useLayoutEffect(() => {
3146
+ if (isSticky) {
3147
+ scrollRef.current?.setClampBounds(undefined, undefined);
3148
+ } else {
3149
+ scrollRef.current?.setClampBounds(clampMin, clampMax);
3150
+ }
3151
+ });
3152
+ import_react13.useLayoutEffect(() => {
3153
+ const spacerYoga = spacerRef.current?.yogaNode;
3154
+ if (spacerYoga && spacerYoga.getComputedWidth() > 0) {
3155
+ listOriginRef.current = spacerYoga.getComputedTop();
3156
+ }
3157
+ if (skipMeasurementRef.current) {
3158
+ skipMeasurementRef.current = false;
3159
+ return;
3160
+ }
3161
+ let anyChanged = false;
3162
+ for (const [key, el] of itemRefs.current) {
3163
+ const yoga = el.yogaNode;
3164
+ if (!yoga)
3165
+ continue;
3166
+ const h = yoga.getComputedHeight();
3167
+ const prev = heightCache.current.get(key);
3168
+ if (h > 0) {
3169
+ if (prev !== h) {
3170
+ heightCache.current.set(key, h);
3171
+ anyChanged = true;
3172
+ }
3173
+ } else if (yoga.getComputedWidth() > 0 && prev !== 0) {
3174
+ heightCache.current.set(key, 0);
3175
+ anyChanged = true;
3176
+ }
3177
+ }
3178
+ if (anyChanged)
3179
+ offsetVersionRef.current++;
3180
+ });
3181
+ const measureRef = import_react13.useCallback((key) => {
3182
+ let fn = refCache.current.get(key);
3183
+ if (!fn) {
3184
+ fn = (el) => {
3185
+ if (el) {
3186
+ itemRefs.current.set(key, el);
3187
+ } else {
3188
+ const yoga = itemRefs.current.get(key)?.yogaNode;
3189
+ if (yoga && !skipMeasurementRef.current) {
3190
+ const h = yoga.getComputedHeight();
3191
+ if ((h > 0 || yoga.getComputedWidth() > 0) && heightCache.current.get(key) !== h) {
3192
+ heightCache.current.set(key, h);
3193
+ offsetVersionRef.current++;
3194
+ }
3195
+ }
3196
+ itemRefs.current.delete(key);
3197
+ }
3198
+ };
3199
+ refCache.current.set(key, fn);
3200
+ }
3201
+ return fn;
3202
+ }, []);
3203
+ const getItemTop = import_react13.useCallback((index) => {
3204
+ const yoga = itemRefs.current.get(itemKeys[index])?.yogaNode;
3205
+ if (!yoga || yoga.getComputedWidth() === 0)
3206
+ return -1;
3207
+ return yoga.getComputedTop();
3208
+ }, [itemKeys]);
3209
+ const getItemElement = import_react13.useCallback((index) => itemRefs.current.get(itemKeys[index]) ?? null, [itemKeys]);
3210
+ const getItemHeight = import_react13.useCallback((index) => heightCache.current.get(itemKeys[index]), [itemKeys]);
3211
+ const scrollToIndex = import_react13.useCallback((i) => {
3212
+ const o = offsetsRef.current;
3213
+ if (i < 0 || i >= o.n)
3214
+ return;
3215
+ scrollRef.current?.scrollTo(o.arr[i] + listOriginRef.current);
3216
+ }, [scrollRef]);
3217
+ const effBottomSpacer = totalHeight - offsets[effEnd];
3218
+ return {
3219
+ range: [effStart, effEnd],
3220
+ topSpacer: effTopSpacer,
3221
+ bottomSpacer: effBottomSpacer,
3222
+ measureRef,
3223
+ spacerRef,
3224
+ offsets,
3225
+ getItemTop,
3226
+ getItemElement,
3227
+ getItemHeight,
3228
+ scrollToIndex
3229
+ };
3230
+ }
3231
+ var import_react13, DEFAULT_ESTIMATE = 3, OVERSCAN_ROWS = 80, COLD_START_COUNT = 30, SCROLL_QUANTUM, PESSIMISTIC_HEIGHT = 1, MAX_MOUNTED_ITEMS = 300, SLIDE_STEP = 25, NOOP_UNSUB = () => {};
3232
+ var init_useVirtualScroll = __esm(() => {
3233
+ import_react13 = __toESM(require_react(), 1);
3234
+ SCROLL_QUANTUM = OVERSCAN_ROWS >> 1;
3235
+ });
3236
+
3237
+ // src/components/VirtualMessageList.tsx
3238
+ function defaultExtractSearchText(msg) {
3239
+ const cached = fallbackLowerCache.get(msg);
3240
+ if (cached !== undefined)
3241
+ return cached;
3242
+ const lowered = renderableSearchText(msg);
3243
+ fallbackLowerCache.set(msg, lowered);
3244
+ return lowered;
3245
+ }
3246
+ function stickyPromptText(msg) {
3247
+ const cached = promptTextCache.get(msg);
3248
+ if (cached !== undefined)
3249
+ return cached;
3250
+ const result = computeStickyPromptText(msg);
3251
+ promptTextCache.set(msg, result);
3252
+ return result;
3253
+ }
3254
+ function computeStickyPromptText(msg) {
3255
+ let raw = null;
3256
+ if (msg.type === "user") {
3257
+ if (msg.isMeta || msg.isVisibleInTranscriptOnly)
3258
+ return null;
3259
+ const block = msg.message.content[0];
3260
+ if (block?.type !== "text")
3261
+ return null;
3262
+ raw = block.text ?? null;
3263
+ } else if (msg.type === "attachment" && msg.attachment.type === "queued_command" && msg.attachment.commandMode !== "task-notification" && !msg.attachment.isMeta) {
3264
+ const p = msg.attachment.prompt;
3265
+ raw = typeof p === "string" ? p : p.flatMap((b) => b.type === "text" ? [b.text ?? ""] : []).join(`
3266
+ `);
3267
+ }
3268
+ if (raw === null)
3269
+ return null;
3270
+ const t = stripSystemReminders(raw);
3271
+ if (t.startsWith("<") || t === "")
3272
+ return null;
3273
+ return t;
3274
+ }
3275
+ function VirtualItem({
3276
+ itemKey: k,
3277
+ msg,
3278
+ idx,
3279
+ measureRef,
3280
+ expanded,
3281
+ hovered,
3282
+ clickable,
3283
+ onClickK,
3284
+ onEnterK,
3285
+ onLeaveK,
3286
+ renderItem
3287
+ }) {
3288
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ThemedBox_default, {
3289
+ ref: measureRef(k),
3290
+ flexDirection: "column",
3291
+ backgroundColor: expanded ? "userMessageBackgroundHover" : undefined,
3292
+ paddingBottom: expanded ? 1 : undefined,
3293
+ onClick: clickable ? (e) => onClickK(msg, e.cellIsBlank) : undefined,
3294
+ onMouseEnter: clickable ? () => onEnterK(k) : undefined,
3295
+ onMouseLeave: clickable ? () => onLeaveK(k) : undefined,
3296
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(TextHoverColorContext.Provider, {
3297
+ value: hovered && !expanded ? "text" : undefined,
3298
+ children: renderItem(msg, idx)
3299
+ }, undefined, false, undefined, this)
3300
+ }, undefined, false, undefined, this);
3301
+ }
3302
+ function VirtualMessageList({
3303
+ messages,
3304
+ scrollRef,
3305
+ columns,
3306
+ itemKey,
3307
+ renderItem,
3308
+ onItemClick,
3309
+ isItemClickable,
3310
+ isItemExpanded,
3311
+ extractSearchText = defaultExtractSearchText,
3312
+ trackStickyPrompt,
3313
+ selectedIndex,
3314
+ cursorNavRef,
3315
+ setCursor,
3316
+ jumpRef,
3317
+ onSearchMatchesChange,
3318
+ scanElement,
3319
+ setPositions
3320
+ }) {
3321
+ const keysRef = import_react14.useRef([]);
3322
+ const prevMessagesRef = import_react14.useRef(messages);
3323
+ const prevItemKeyRef = import_react14.useRef(itemKey);
3324
+ if (prevItemKeyRef.current !== itemKey || messages.length < keysRef.current.length || messages[0] !== prevMessagesRef.current[0]) {
3325
+ keysRef.current = messages.map((m) => itemKey(m));
3326
+ } else {
3327
+ for (let i = keysRef.current.length;i < messages.length; i++) {
3328
+ keysRef.current.push(itemKey(messages[i]));
3329
+ }
3330
+ }
3331
+ prevMessagesRef.current = messages;
3332
+ prevItemKeyRef.current = itemKey;
3333
+ const keys = keysRef.current;
3334
+ const {
3335
+ range,
3336
+ topSpacer,
3337
+ bottomSpacer,
3338
+ measureRef,
3339
+ spacerRef,
3340
+ offsets,
3341
+ getItemTop,
3342
+ getItemElement,
3343
+ getItemHeight,
3344
+ scrollToIndex
3345
+ } = useVirtualScroll(scrollRef, keys, columns);
3346
+ const [start, end] = range;
3347
+ const isVisible = import_react14.useCallback((i) => {
3348
+ const h = getItemHeight(i);
3349
+ if (h === 0)
3350
+ return false;
3351
+ return isNavigableMessage(messages[i]);
3352
+ }, [getItemHeight, messages]);
3353
+ import_react14.useImperativeHandle(cursorNavRef, () => {
3354
+ const select = (m) => setCursor?.({
3355
+ uuid: m.uuid,
3356
+ msgType: m.type,
3357
+ expanded: false,
3358
+ toolName: toolCallOf(m)?.name
3359
+ });
3360
+ const selIdx = selectedIndex ?? -1;
3361
+ const scan = (from, dir, pred = isVisible) => {
3362
+ for (let i = from;i >= 0 && i < messages.length; i += dir) {
3363
+ if (pred(i)) {
3364
+ select(messages[i]);
3365
+ return true;
3366
+ }
3367
+ }
3368
+ return false;
3369
+ };
3370
+ const isUser = (i) => isVisible(i) && messages[i].type === "user";
3371
+ return {
3372
+ enterCursor: () => scan(messages.length - 1, -1, isUser),
3373
+ navigatePrev: () => scan(selIdx - 1, -1),
3374
+ navigateNext: () => {
3375
+ if (scan(selIdx + 1, 1))
3376
+ return;
3377
+ scrollRef.current?.scrollToBottom();
3378
+ setCursor?.(null);
3379
+ },
3380
+ navigatePrevUser: () => scan(selIdx - 1, -1, isUser),
3381
+ navigateNextUser: () => scan(selIdx + 1, 1, isUser),
3382
+ navigateTop: () => scan(0, 1),
3383
+ navigateBottom: () => scan(messages.length - 1, -1),
3384
+ getSelected: () => selIdx >= 0 ? messages[selIdx] ?? null : null
3385
+ };
3386
+ }, [messages, selectedIndex, setCursor, isVisible]);
3387
+ const jumpState = import_react14.useRef({
3388
+ offsets,
3389
+ start,
3390
+ getItemElement,
3391
+ getItemTop,
3392
+ messages,
3393
+ scrollToIndex
3394
+ });
3395
+ jumpState.current = {
3396
+ offsets,
3397
+ start,
3398
+ getItemElement,
3399
+ getItemTop,
3400
+ messages,
3401
+ scrollToIndex
3402
+ };
3403
+ import_react14.useEffect(() => {
3404
+ if (selectedIndex === undefined)
3405
+ return;
3406
+ const s = jumpState.current;
3407
+ const el = s.getItemElement(selectedIndex);
3408
+ if (el) {
3409
+ scrollRef.current?.scrollToElement(el, 1);
3410
+ } else {
3411
+ s.scrollToIndex(selectedIndex);
3412
+ }
3413
+ }, [selectedIndex, scrollRef]);
3414
+ const scanRequestRef = import_react14.useRef(null);
3415
+ const elementPositions = import_react14.useRef({ msgIdx: -1, positions: [] });
3416
+ const startPtrRef = import_react14.useRef(-1);
3417
+ const phantomBurstRef = import_react14.useRef(0);
3418
+ const pendingStepRef = import_react14.useRef(0);
3419
+ const stepRef = import_react14.useRef(() => {});
3420
+ const highlightRef = import_react14.useRef(() => {});
3421
+ const searchState = import_react14.useRef({
3422
+ matches: [],
3423
+ ptr: 0,
3424
+ screenOrd: 0,
3425
+ prefixSum: []
3426
+ });
3427
+ const searchAnchor = import_react14.useRef(-1);
3428
+ const indexWarmed = import_react14.useRef(false);
3429
+ function targetFor(i) {
3430
+ const top = jumpState.current.getItemTop(i);
3431
+ return Math.max(0, top - HEADROOM);
3432
+ }
3433
+ function highlight(ord) {
3434
+ const s = scrollRef.current;
3435
+ const { msgIdx, positions } = elementPositions.current;
3436
+ if (!s || positions.length === 0 || msgIdx < 0) {
3437
+ setPositions?.(null);
3438
+ return;
3439
+ }
3440
+ const idx = Math.max(0, Math.min(ord, positions.length - 1));
3441
+ const p = positions[idx];
3442
+ const top = jumpState.current.getItemTop(msgIdx);
3443
+ const vpTop = s.getViewportTop();
3444
+ let lo = top - s.getScrollTop();
3445
+ const vp = s.getViewportHeight();
3446
+ let screenRow = vpTop + lo + p.row;
3447
+ if (screenRow < vpTop || screenRow >= vpTop + vp) {
3448
+ s.scrollTo(Math.max(0, top + p.row - HEADROOM));
3449
+ lo = top - s.getScrollTop();
3450
+ screenRow = vpTop + lo + p.row;
3451
+ }
3452
+ setPositions?.({ positions, rowOffset: vpTop + lo, currentIdx: idx });
3453
+ const st = searchState.current;
3454
+ const total = st.prefixSum.at(-1) ?? 0;
3455
+ const current = (st.prefixSum[st.ptr] ?? 0) + idx + 1;
3456
+ onSearchMatchesChange?.(total, current);
3457
+ logForDebugging(`highlight(i=${msgIdx}, ord=${idx}/${positions.length}): ` + `pos={row:${p.row},col:${p.col}} lo=${lo} screenRow=${screenRow} ` + `badge=${current}/${total}`);
3458
+ }
3459
+ highlightRef.current = highlight;
3460
+ const [seekGen, setSeekGen] = import_react14.useState(0);
3461
+ const bumpSeek = import_react14.useCallback(() => setSeekGen((g) => g + 1), []);
3462
+ import_react14.useEffect(() => {
3463
+ const req = scanRequestRef.current;
3464
+ if (!req)
3465
+ return;
3466
+ const { idx, wantLast, tries } = req;
3467
+ const s = scrollRef.current;
3468
+ if (!s)
3469
+ return;
3470
+ const { getItemElement: getItemElement2, getItemTop: getItemTop2, scrollToIndex: scrollToIndex2 } = jumpState.current;
3471
+ const el = getItemElement2(idx);
3472
+ const h = el?.yogaNode?.getComputedHeight() ?? 0;
3473
+ if (!el || h === 0) {
3474
+ if (tries > 1) {
3475
+ scanRequestRef.current = null;
3476
+ logForDebugging(`seek(i=${idx}): no mount after scrollToIndex, skip`);
3477
+ stepRef.current(wantLast ? -1 : 1);
3478
+ return;
3479
+ }
3480
+ scanRequestRef.current = { idx, wantLast, tries: tries + 1 };
3481
+ scrollToIndex2(idx);
3482
+ bumpSeek();
3483
+ return;
3484
+ }
3485
+ scanRequestRef.current = null;
3486
+ s.scrollTo(Math.max(0, getItemTop2(idx) - HEADROOM));
3487
+ const positions = scanElement?.(el) ?? [];
3488
+ elementPositions.current = { msgIdx: idx, positions };
3489
+ logForDebugging(`seek(i=${idx} t=${tries}): ${positions.length} positions`);
3490
+ if (positions.length === 0) {
3491
+ if (++phantomBurstRef.current > 20) {
3492
+ phantomBurstRef.current = 0;
3493
+ return;
3494
+ }
3495
+ stepRef.current(wantLast ? -1 : 1);
3496
+ return;
3497
+ }
3498
+ phantomBurstRef.current = 0;
3499
+ const ord = wantLast ? positions.length - 1 : 0;
3500
+ searchState.current.screenOrd = ord;
3501
+ startPtrRef.current = -1;
3502
+ highlightRef.current(ord);
3503
+ const pending = pendingStepRef.current;
3504
+ if (pending) {
3505
+ pendingStepRef.current = 0;
3506
+ stepRef.current(pending);
3507
+ }
3508
+ }, [seekGen]);
3509
+ function jump(i, wantLast) {
3510
+ const s = scrollRef.current;
3511
+ if (!s)
3512
+ return;
3513
+ const js = jumpState.current;
3514
+ const { getItemElement: getItemElement2, scrollToIndex: scrollToIndex2 } = js;
3515
+ if (i < 0 || i >= js.messages.length)
3516
+ return;
3517
+ setPositions?.(null);
3518
+ elementPositions.current = { msgIdx: -1, positions: [] };
3519
+ scanRequestRef.current = { idx: i, wantLast, tries: 0 };
3520
+ const el = getItemElement2(i);
3521
+ const h = el?.yogaNode?.getComputedHeight() ?? 0;
3522
+ if (el && h > 0) {
3523
+ s.scrollTo(targetFor(i));
3524
+ } else {
3525
+ scrollToIndex2(i);
3526
+ }
3527
+ bumpSeek();
3528
+ }
3529
+ function step(delta) {
3530
+ const st = searchState.current;
3531
+ const { matches, prefixSum } = st;
3532
+ const total = prefixSum.at(-1) ?? 0;
3533
+ if (matches.length === 0)
3534
+ return;
3535
+ if (scanRequestRef.current) {
3536
+ pendingStepRef.current = delta;
3537
+ return;
3538
+ }
3539
+ if (startPtrRef.current < 0)
3540
+ startPtrRef.current = st.ptr;
3541
+ const { positions } = elementPositions.current;
3542
+ const newOrd = st.screenOrd + delta;
3543
+ if (newOrd >= 0 && newOrd < positions.length) {
3544
+ st.screenOrd = newOrd;
3545
+ highlight(newOrd);
3546
+ startPtrRef.current = -1;
3547
+ return;
3548
+ }
3549
+ const ptr = (st.ptr + delta + matches.length) % matches.length;
3550
+ if (ptr === startPtrRef.current) {
3551
+ setPositions?.(null);
3552
+ startPtrRef.current = -1;
3553
+ logForDebugging(`step: wraparound at ptr=${ptr}, all ${matches.length} msgs phantoms`);
3554
+ return;
3555
+ }
3556
+ st.ptr = ptr;
3557
+ st.screenOrd = 0;
3558
+ jump(matches[ptr], delta < 0);
3559
+ const placeholder = delta < 0 ? prefixSum[ptr + 1] ?? total : prefixSum[ptr] + 1;
3560
+ onSearchMatchesChange?.(total, placeholder);
3561
+ }
3562
+ stepRef.current = step;
3563
+ import_react14.useImperativeHandle(jumpRef, () => ({
3564
+ jumpToIndex: (i) => {
3565
+ const s = scrollRef.current;
3566
+ if (s)
3567
+ s.scrollTo(targetFor(i));
3568
+ },
3569
+ setSearchQuery: (q) => {
3570
+ scanRequestRef.current = null;
3571
+ elementPositions.current = { msgIdx: -1, positions: [] };
3572
+ startPtrRef.current = -1;
3573
+ setPositions?.(null);
3574
+ const lq = q.toLowerCase();
3575
+ const matches = [];
3576
+ const prefixSum = [0];
3577
+ if (lq) {
3578
+ const msgs = jumpState.current.messages;
3579
+ for (let i = 0;i < msgs.length; i++) {
3580
+ const text = extractSearchText(msgs[i]);
3581
+ let pos = text.indexOf(lq);
3582
+ let cnt = 0;
3583
+ while (pos >= 0) {
3584
+ cnt++;
3585
+ pos = text.indexOf(lq, pos + lq.length);
3586
+ }
3587
+ if (cnt > 0) {
3588
+ matches.push(i);
3589
+ prefixSum.push(prefixSum.at(-1) + cnt);
3590
+ }
3591
+ }
3592
+ }
3593
+ const total = prefixSum.at(-1);
3594
+ let ptr = 0;
3595
+ const s = scrollRef.current;
3596
+ const { offsets: offsets2, start: start2, getItemTop: getItemTop2 } = jumpState.current;
3597
+ const firstTop = getItemTop2(start2);
3598
+ const origin = firstTop >= 0 ? firstTop - offsets2[start2] : 0;
3599
+ if (matches.length > 0 && s) {
3600
+ const curTop = searchAnchor.current >= 0 ? searchAnchor.current : s.getScrollTop();
3601
+ let best = Infinity;
3602
+ for (let k = 0;k < matches.length; k++) {
3603
+ const d = Math.abs(origin + offsets2[matches[k]] - curTop);
3604
+ if (d <= best) {
3605
+ best = d;
3606
+ ptr = k;
3607
+ }
3608
+ }
3609
+ logForDebugging(`setSearchQuery('${q}'): ${matches.length} msgs \xB7 ptr=${ptr} ` + `msgIdx=${matches[ptr]} curTop=${curTop} origin=${origin}`);
3610
+ }
3611
+ searchState.current = { matches, ptr, screenOrd: 0, prefixSum };
3612
+ if (matches.length > 0) {
3613
+ jump(matches[ptr], true);
3614
+ } else if (searchAnchor.current >= 0 && s) {
3615
+ s.scrollTo(searchAnchor.current);
3616
+ }
3617
+ onSearchMatchesChange?.(total, matches.length > 0 ? prefixSum[ptr + 1] ?? total : 0);
3618
+ },
3619
+ nextMatch: () => step(1),
3620
+ prevMatch: () => step(-1),
3621
+ setAnchor: () => {
3622
+ const s = scrollRef.current;
3623
+ if (s)
3624
+ searchAnchor.current = s.getScrollTop();
3625
+ },
3626
+ disarmSearch: () => {
3627
+ setPositions?.(null);
3628
+ scanRequestRef.current = null;
3629
+ elementPositions.current = { msgIdx: -1, positions: [] };
3630
+ startPtrRef.current = -1;
3631
+ },
3632
+ warmSearchIndex: async () => {
3633
+ if (indexWarmed.current)
3634
+ return 0;
3635
+ const msgs = jumpState.current.messages;
3636
+ const CHUNK = 500;
3637
+ let workMs = 0;
3638
+ const wallStart = performance.now();
3639
+ for (let i = 0;i < msgs.length; i += CHUNK) {
3640
+ await sleep(0);
3641
+ const t0 = performance.now();
3642
+ const end2 = Math.min(i + CHUNK, msgs.length);
3643
+ for (let j = i;j < end2; j++) {
3644
+ extractSearchText(msgs[j]);
3645
+ }
3646
+ workMs += performance.now() - t0;
3647
+ }
3648
+ const wallMs = Math.round(performance.now() - wallStart);
3649
+ logForDebugging(`warmSearchIndex: ${msgs.length} msgs \xB7 work=${Math.round(workMs)}ms wall=${wallMs}ms chunks=${Math.ceil(msgs.length / CHUNK)}`);
3650
+ indexWarmed.current = true;
3651
+ return Math.round(workMs);
3652
+ }
3653
+ }), [scrollRef]);
3654
+ const [hoveredKey, setHoveredKey] = import_react14.useState(null);
3655
+ const handlersRef = import_react14.useRef({ onItemClick, setHoveredKey });
3656
+ handlersRef.current = { onItemClick, setHoveredKey };
3657
+ const onClickK = import_react14.useCallback((msg, cellIsBlank) => {
3658
+ const h = handlersRef.current;
3659
+ if (!cellIsBlank && h.onItemClick)
3660
+ h.onItemClick(msg);
3661
+ }, []);
3662
+ const onEnterK = import_react14.useCallback((k) => {
3663
+ handlersRef.current.setHoveredKey(k);
3664
+ }, []);
3665
+ const onLeaveK = import_react14.useCallback((k) => {
3666
+ handlersRef.current.setHoveredKey((prev) => prev === k ? null : prev);
3667
+ }, []);
3668
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
3669
+ children: [
3670
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ThemedBox_default, {
3671
+ ref: spacerRef,
3672
+ height: topSpacer,
3673
+ flexShrink: 0
3674
+ }, undefined, false, undefined, this),
3675
+ messages.slice(start, end).map((msg, i) => {
3676
+ const idx = start + i;
3677
+ const k = keys[idx];
3678
+ const clickable = !!onItemClick && (isItemClickable?.(msg) ?? true);
3679
+ const hovered = clickable && hoveredKey === k;
3680
+ const expanded = isItemExpanded?.(msg);
3681
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(VirtualItem, {
3682
+ itemKey: k,
3683
+ msg,
3684
+ idx,
3685
+ measureRef,
3686
+ expanded,
3687
+ hovered,
3688
+ clickable,
3689
+ onClickK,
3690
+ onEnterK,
3691
+ onLeaveK,
3692
+ renderItem
3693
+ }, k, false, undefined, this);
3694
+ }),
3695
+ bottomSpacer > 0 && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ThemedBox_default, {
3696
+ height: bottomSpacer,
3697
+ flexShrink: 0
3698
+ }, undefined, false, undefined, this),
3699
+ trackStickyPrompt && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(StickyTracker, {
3700
+ messages,
3701
+ start,
3702
+ end,
3703
+ offsets,
3704
+ getItemTop,
3705
+ getItemElement,
3706
+ scrollRef
3707
+ }, undefined, false, undefined, this)
3708
+ ]
3709
+ }, undefined, true, undefined, this);
3710
+ }
3711
+ function StickyTracker({
3712
+ messages,
3713
+ start,
3714
+ end,
3715
+ offsets,
3716
+ getItemTop,
3717
+ getItemElement,
3718
+ scrollRef
3719
+ }) {
3720
+ const { setStickyPrompt } = import_react14.useContext(ScrollChromeContext);
3721
+ const subscribe = import_react14.useCallback((listener) => scrollRef.current?.subscribe(listener) ?? NOOP_UNSUB2, [scrollRef]);
3722
+ import_react14.useSyncExternalStore(subscribe, () => {
3723
+ const s = scrollRef.current;
3724
+ if (!s)
3725
+ return NaN;
3726
+ const t = s.getScrollTop() + s.getPendingDelta();
3727
+ return s.isSticky() ? -1 - t : t;
3728
+ });
3729
+ const isSticky = scrollRef.current?.isSticky() ?? true;
3730
+ const target = Math.max(0, (scrollRef.current?.getScrollTop() ?? 0) + (scrollRef.current?.getPendingDelta() ?? 0));
3731
+ let firstVisible = start;
3732
+ let firstVisibleTop = -1;
3733
+ for (let i = end - 1;i >= start; i--) {
3734
+ const top = getItemTop(i);
3735
+ if (top >= 0) {
3736
+ if (top < target)
3737
+ break;
3738
+ firstVisibleTop = top;
3739
+ }
3740
+ firstVisible = i;
3741
+ }
3742
+ let idx = -1;
3743
+ let text = null;
3744
+ if (firstVisible > 0 && !isSticky) {
3745
+ for (let i = firstVisible - 1;i >= 0; i--) {
3746
+ const t = stickyPromptText(messages[i]);
3747
+ if (t === null)
3748
+ continue;
3749
+ const top = getItemTop(i);
3750
+ if (top >= 0 && top + 1 >= target)
3751
+ continue;
3752
+ idx = i;
3753
+ text = t;
3754
+ break;
3755
+ }
3756
+ }
3757
+ const baseOffset = firstVisibleTop >= 0 ? firstVisibleTop - offsets[firstVisible] : 0;
3758
+ const estimate = idx >= 0 ? Math.max(0, baseOffset + offsets[idx]) : -1;
3759
+ const pending = import_react14.useRef({ idx: -1, tries: 0 });
3760
+ const suppress = import_react14.useRef("none");
3761
+ const lastIdx = import_react14.useRef(-1);
3762
+ import_react14.useEffect(() => {
3763
+ if (pending.current.idx >= 0)
3764
+ return;
3765
+ if (suppress.current === "armed") {
3766
+ suppress.current = "force";
3767
+ return;
3768
+ }
3769
+ const force = suppress.current === "force";
3770
+ suppress.current = "none";
3771
+ if (!force && lastIdx.current === idx)
3772
+ return;
3773
+ lastIdx.current = idx;
3774
+ if (text === null) {
3775
+ setStickyPrompt(null);
3776
+ return;
3777
+ }
3778
+ const trimmed = text.trimStart();
3779
+ const paraEnd = trimmed.search(/\n\s*\n/);
3780
+ const collapsed = (paraEnd >= 0 ? trimmed.slice(0, paraEnd) : trimmed).slice(0, STICKY_TEXT_CAP).replace(/\s+/g, " ").trim();
3781
+ if (collapsed === "") {
3782
+ setStickyPrompt(null);
3783
+ return;
3784
+ }
3785
+ const capturedIdx = idx;
3786
+ const capturedEstimate = estimate;
3787
+ setStickyPrompt({
3788
+ text: collapsed,
3789
+ scrollTo: () => {
3790
+ setStickyPrompt("clicked");
3791
+ suppress.current = "armed";
3792
+ const el = getItemElement(capturedIdx);
3793
+ if (el) {
3794
+ scrollRef.current?.scrollToElement(el, 1);
3795
+ } else {
3796
+ scrollRef.current?.scrollTo(capturedEstimate);
3797
+ pending.current = { idx: capturedIdx, tries: 0 };
3798
+ }
3799
+ }
3800
+ });
3801
+ });
3802
+ import_react14.useEffect(() => {
3803
+ if (pending.current.idx < 0)
3804
+ return;
3805
+ const el = getItemElement(pending.current.idx);
3806
+ if (el) {
3807
+ scrollRef.current?.scrollToElement(el, 1);
3808
+ pending.current = { idx: -1, tries: 0 };
3809
+ } else if (++pending.current.tries > 5) {
3810
+ pending.current = { idx: -1, tries: 0 };
3811
+ }
3812
+ });
3813
+ return null;
3814
+ }
3815
+ var import_react14, jsx_dev_runtime21, HEADROOM = 3, fallbackLowerCache, STICKY_TEXT_CAP = 500, promptTextCache, NOOP_UNSUB2 = () => {};
3816
+ var init_VirtualMessageList = __esm(() => {
3817
+ init_useVirtualScroll();
3818
+ init_src();
3819
+ init_ThemedText();
3820
+ init_FullscreenLayout();
3821
+ init_debug();
3822
+ init_sleep();
3823
+ init_transcriptSearch();
3824
+ init_messageActions();
3825
+ import_react14 = __toESM(require_react(), 1);
3826
+ jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
3827
+ fallbackLowerCache = new WeakMap;
3828
+ promptTextCache = new WeakMap;
3829
+ });
3830
+
3831
+ // src/components/Messages.tsx
3832
+ function filterForBriefTool(messages, briefToolNames) {
3833
+ const nameSet = new Set(briefToolNames);
3834
+ const briefToolUseIDs = new Set;
3835
+ return messages.filter((msg) => {
3836
+ if (msg.type === "system")
3837
+ return msg.subtype !== "api_metrics";
3838
+ const block = msg.message?.content[0];
3839
+ if (msg.type === "assistant") {
3840
+ if (msg.isApiErrorMessage)
3841
+ return true;
3842
+ if (block?.type === "tool_use" && block.name && nameSet.has(block.name)) {
3843
+ if ("id" in block) {
3844
+ briefToolUseIDs.add(block.id);
3845
+ }
3846
+ return true;
3847
+ }
3848
+ return false;
3849
+ }
3850
+ if (msg.type === "user") {
3851
+ if (block?.type === "tool_result") {
3852
+ return block.tool_use_id !== undefined && briefToolUseIDs.has(block.tool_use_id);
3853
+ }
3854
+ return !msg.isMeta;
3855
+ }
3856
+ if (msg.type === "attachment") {
3857
+ const att = msg.attachment;
3858
+ return att?.type === "queued_command" && att.commandMode === "prompt" && !att.isMeta && att.origin === undefined;
3859
+ }
3860
+ return false;
3861
+ });
3862
+ }
3863
+ function dropTextInBriefTurns(messages, briefToolNames) {
3864
+ const nameSet = new Set(briefToolNames);
3865
+ const turnsWithBrief = new Set;
3866
+ const textIndexToTurn = [];
3867
+ let turn = 0;
3868
+ for (let i = 0;i < messages.length; i++) {
3869
+ const msg = messages[i];
3870
+ const block = msg.message?.content[0];
3871
+ if (msg.type === "user" && block?.type !== "tool_result" && !msg.isMeta) {
3872
+ turn++;
3873
+ continue;
3874
+ }
3875
+ if (msg.type === "assistant") {
3876
+ if (block?.type === "text") {
3877
+ textIndexToTurn[i] = turn;
3878
+ } else if (block?.type === "tool_use" && block.name && nameSet.has(block.name)) {
3879
+ turnsWithBrief.add(turn);
3880
+ }
3881
+ }
3882
+ }
3883
+ if (turnsWithBrief.size === 0)
3884
+ return messages;
3885
+ return messages.filter((_, i) => {
3886
+ const t = textIndexToTurn[i];
3887
+ return t === undefined || !turnsWithBrief.has(t);
3888
+ });
3889
+ }
3890
+ function computeSliceStart(collapsed, anchorRef, cap = MAX_MESSAGES_WITHOUT_VIRTUALIZATION, step = MESSAGE_CAP_STEP) {
3891
+ const anchor = anchorRef.current;
3892
+ const anchorIdx = anchor ? collapsed.findIndex((m) => m.uuid === anchor.uuid) : -1;
3893
+ let start = anchorIdx >= 0 ? anchorIdx : anchor ? Math.min(anchor.idx, Math.max(0, collapsed.length - cap)) : 0;
3894
+ if (collapsed.length - start > cap + step) {
3895
+ start = collapsed.length - cap;
3896
+ }
3897
+ const msgAtStart = collapsed[start];
3898
+ if (msgAtStart && (anchor?.uuid !== msgAtStart.uuid || anchor.idx !== start)) {
3899
+ anchorRef.current = { uuid: msgAtStart.uuid, idx: start };
3900
+ } else if (!msgAtStart && anchor) {
3901
+ anchorRef.current = null;
3902
+ }
3903
+ return start;
3904
+ }
3905
+ function expandKey(msg) {
3906
+ return (msg.type === "assistant" || msg.type === "user" ? getToolUseID(msg) : null) ?? msg.uuid;
3907
+ }
3908
+ function setsEqual(a, b) {
3909
+ if (a.size !== b.size)
3910
+ return false;
3911
+ for (const item of a) {
3912
+ if (!b.has(item))
3913
+ return false;
3914
+ }
3915
+ return true;
3916
+ }
3917
+ function shouldRenderStatically(message, streamingToolUseIDs, inProgressToolUseIDs, siblingToolUseIDs, screen, lookups) {
3918
+ if (screen === "transcript") {
3919
+ return true;
3920
+ }
3921
+ switch (message.type) {
3922
+ case "attachment":
3923
+ case "user":
3924
+ case "assistant": {
3925
+ if (message.type === "assistant") {
3926
+ const block = message.message.content[0];
3927
+ if (block?.type === "server_tool_use") {
3928
+ return lookups.resolvedToolUseIDs.has(block.id);
3929
+ }
3930
+ }
3931
+ const toolUseID = getToolUseID(message);
3932
+ if (!toolUseID) {
3933
+ return true;
3934
+ }
3935
+ if (streamingToolUseIDs.has(toolUseID)) {
3936
+ return false;
3937
+ }
3938
+ if (inProgressToolUseIDs.has(toolUseID)) {
3939
+ return false;
3940
+ }
3941
+ if (hasUnresolvedHooksFromLookup(toolUseID, "PostToolUse", lookups)) {
3942
+ return false;
3943
+ }
3944
+ return every(siblingToolUseIDs, lookups.resolvedToolUseIDs);
3945
+ }
3946
+ case "system": {
3947
+ return message.subtype !== "api_error";
3948
+ }
3949
+ case "grouped_tool_use": {
3950
+ const allResolved = message.messages.every((msg) => {
3951
+ const content = msg.message.content[0];
3952
+ return content?.type === "tool_use" && lookups.resolvedToolUseIDs.has(content.id);
3953
+ });
3954
+ return allResolved;
3955
+ }
3956
+ case "collapsed_read_search": {
3957
+ return false;
3958
+ }
3959
+ default:
3960
+ return true;
3961
+ }
3962
+ }
3963
+ var React6, import_react15, jsx_dev_runtime22, LogoHeader, proactiveModule, BRIEF_TOOL_NAME, SEND_USER_FILE_TOOL_NAME, MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE = 30, MAX_MESSAGES_WITHOUT_VIRTUALIZATION = 200, MESSAGE_CAP_STEP = 50, MessagesImpl = ({
3964
+ messages,
3965
+ tools,
3966
+ commands,
3967
+ verbose,
3968
+ toolJSX,
3969
+ toolUseConfirmQueue,
3970
+ inProgressToolUseIDs,
3971
+ isMessageSelectorVisible,
3972
+ conversationId,
3973
+ screen,
3974
+ streamingToolUses,
3975
+ showAllInTranscript = false,
3976
+ agentDefinitions,
3977
+ onOpenRateLimitOptions,
3978
+ hideLogo = false,
3979
+ isLoading,
3980
+ hidePastThinking = false,
3981
+ streamingThinking,
3982
+ streamingText,
3983
+ isBriefOnly = false,
3984
+ unseenDivider,
3985
+ scrollRef,
3986
+ trackStickyPrompt,
3987
+ jumpRef,
3988
+ onSearchMatchesChange,
3989
+ scanElement,
3990
+ setPositions,
3991
+ disableRenderCap = false,
3992
+ cursor = null,
3993
+ setCursor,
3994
+ cursorNavRef,
3995
+ renderRange
3996
+ }) => {
3997
+ const { columns } = useTerminalSize();
3998
+ const toggleShowAllShortcut = useShortcutDisplay("transcript:toggleShowAll", "Transcript", "Ctrl+E");
3999
+ const normalizedMessages = import_react15.useMemo(() => normalizeMessages(messages).filter(isNotEmptyMessage), [messages]);
4000
+ const isStreamingThinkingVisible = import_react15.useMemo(() => {
4001
+ if (!streamingThinking)
4002
+ return false;
4003
+ if (streamingThinking.isStreaming)
4004
+ return true;
4005
+ if (streamingThinking.streamingEndedAt) {
4006
+ return Date.now() - streamingThinking.streamingEndedAt < 30000;
4007
+ }
4008
+ return false;
4009
+ }, [streamingThinking]);
4010
+ const lastThinkingBlockId = import_react15.useMemo(() => {
4011
+ if (!hidePastThinking)
4012
+ return null;
4013
+ if (isStreamingThinkingVisible)
4014
+ return "streaming";
4015
+ for (let i = normalizedMessages.length - 1;i >= 0; i--) {
4016
+ const msg = normalizedMessages[i];
4017
+ if (msg?.type === "assistant") {
4018
+ const content = msg.message.content;
4019
+ for (let j = content.length - 1;j >= 0; j--) {
4020
+ if (content[j]?.type === "thinking") {
4021
+ return `${msg.uuid}:${j}`;
4022
+ }
4023
+ }
4024
+ } else if (msg?.type === "user") {
4025
+ const content = msg.message.content;
4026
+ const hasToolResult = content.some((block) => block.type === "tool_result");
4027
+ if (!hasToolResult) {
4028
+ return "no-thinking";
4029
+ }
4030
+ }
4031
+ }
4032
+ return null;
4033
+ }, [normalizedMessages, hidePastThinking, isStreamingThinkingVisible]);
4034
+ const latestBashOutputUUID = import_react15.useMemo(() => {
4035
+ for (let i = normalizedMessages.length - 1;i >= 0; i--) {
4036
+ const msg = normalizedMessages[i];
4037
+ if (msg?.type === "user") {
4038
+ const content = msg.message.content;
4039
+ for (const block of content) {
4040
+ if (block.type === "text") {
4041
+ const text = block.text ?? "";
4042
+ if (text.startsWith("<bash-stdout") || text.startsWith("<bash-stderr")) {
4043
+ return msg.uuid;
4044
+ }
4045
+ }
4046
+ }
4047
+ }
4048
+ }
4049
+ return null;
4050
+ }, [normalizedMessages]);
4051
+ const normalizedToolUseIDs = import_react15.useMemo(() => getToolUseIDs(normalizedMessages), [normalizedMessages]);
4052
+ const streamingToolUsesWithoutInProgress = import_react15.useMemo(() => streamingToolUses.filter((stu) => !inProgressToolUseIDs.has(stu.contentBlock.id) && !normalizedToolUseIDs.has(stu.contentBlock.id)), [streamingToolUses, inProgressToolUseIDs, normalizedToolUseIDs]);
4053
+ const syntheticStreamingToolUseMessages = import_react15.useMemo(() => streamingToolUsesWithoutInProgress.flatMap((streamingToolUse) => {
4054
+ const msg = createAssistantMessage({
4055
+ content: [streamingToolUse.contentBlock]
4056
+ });
4057
+ msg.uuid = deriveUUID(streamingToolUse.contentBlock.id, 0);
4058
+ return normalizeMessages([msg]);
4059
+ }), [streamingToolUsesWithoutInProgress]);
4060
+ const isTranscriptMode = screen === "transcript";
4061
+ const disableVirtualScroll = import_react15.useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL), []);
4062
+ const virtualScrollRuntimeGate = scrollRef != null && !disableVirtualScroll;
4063
+ const shouldTruncate = isTranscriptMode && !showAllInTranscript && !virtualScrollRuntimeGate;
4064
+ const sliceAnchorRef = import_react15.useRef(null);
4065
+ const { collapsed, lookups, hasTruncatedMessages, hiddenMessageCount } = import_react15.useMemo(() => {
4066
+ const compactAwareMessages = verbose || isFullscreenEnvEnabled() ? normalizedMessages : getMessagesAfterCompactBoundary(normalizedMessages, {
4067
+ includeSnipped: true
4068
+ });
4069
+ const messagesToShowNotTruncated = reorderMessagesInUI(compactAwareMessages.filter((msg) => msg.type !== "progress").filter((msg) => !isNullRenderingAttachment(msg)).filter((_) => shouldShowUserMessage(_, isTranscriptMode)), syntheticStreamingToolUseMessages);
4070
+ const briefToolNames = [BRIEF_TOOL_NAME, SEND_USER_FILE_TOOL_NAME].filter((n) => n !== null);
4071
+ const dropTextToolNames = [BRIEF_TOOL_NAME].filter((n) => n !== null);
4072
+ const briefFiltered = briefToolNames.length > 0 && !isTranscriptMode ? isBriefOnly ? filterForBriefTool(messagesToShowNotTruncated, briefToolNames) : dropTextToolNames.length > 0 ? dropTextInBriefTurns(messagesToShowNotTruncated, dropTextToolNames) : messagesToShowNotTruncated : messagesToShowNotTruncated;
4073
+ const messagesToShow = shouldTruncate ? briefFiltered.slice(-MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE) : briefFiltered;
4074
+ const hasTruncatedMessages2 = shouldTruncate && briefFiltered.length > MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE;
4075
+ const { messages: groupedMessages } = applyGrouping(messagesToShow, tools, verbose);
4076
+ const collapsed2 = collapseBackgroundBashNotifications(collapseHookSummaries(collapseTeammateShutdowns(collapseReadSearchGroups(groupedMessages, tools))), verbose);
4077
+ const lookups2 = buildMessageLookups(normalizedMessages, messagesToShow);
4078
+ const hiddenMessageCount2 = messagesToShowNotTruncated.length - MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE;
4079
+ return {
4080
+ collapsed: collapsed2,
4081
+ lookups: lookups2,
4082
+ hasTruncatedMessages: hasTruncatedMessages2,
4083
+ hiddenMessageCount: hiddenMessageCount2
4084
+ };
4085
+ }, [
4086
+ verbose,
4087
+ normalizedMessages,
4088
+ isTranscriptMode,
4089
+ syntheticStreamingToolUseMessages,
4090
+ shouldTruncate,
4091
+ tools,
4092
+ isBriefOnly
4093
+ ]);
4094
+ const renderableMessages = import_react15.useMemo(() => {
4095
+ const capApplies = !virtualScrollRuntimeGate && !disableRenderCap;
4096
+ const sliceStart = capApplies ? computeSliceStart(collapsed, sliceAnchorRef) : 0;
4097
+ return renderRange ? collapsed.slice(renderRange[0], renderRange[1]) : sliceStart > 0 ? collapsed.slice(sliceStart) : collapsed;
4098
+ }, [collapsed, renderRange, virtualScrollRuntimeGate, disableRenderCap]);
4099
+ const streamingToolUseIDs = import_react15.useMemo(() => new Set(streamingToolUses.map((_) => _.contentBlock.id)), [streamingToolUses]);
4100
+ const dividerBeforeIndex = import_react15.useMemo(() => {
4101
+ if (!unseenDivider)
4102
+ return -1;
4103
+ const prefix = unseenDivider.firstUnseenUuid.slice(0, 24);
4104
+ return renderableMessages.findIndex((m) => m.uuid.slice(0, 24) === prefix);
4105
+ }, [unseenDivider, renderableMessages]);
4106
+ const selectedIdx = import_react15.useMemo(() => {
4107
+ if (!cursor)
4108
+ return -1;
4109
+ return renderableMessages.findIndex((m) => m.uuid === cursor.uuid);
4110
+ }, [cursor, renderableMessages]);
4111
+ const [expandedKeys, setExpandedKeys] = import_react15.useState(() => new Set);
4112
+ const onItemClick = import_react15.useCallback((msg) => {
4113
+ const k = expandKey(msg);
4114
+ setExpandedKeys((prev) => {
4115
+ const next = new Set(prev);
4116
+ if (next.has(k))
4117
+ next.delete(k);
4118
+ else
4119
+ next.add(k);
4120
+ return next;
4121
+ });
4122
+ }, []);
4123
+ const isItemExpanded = import_react15.useCallback((msg) => expandedKeys.size > 0 && expandedKeys.has(expandKey(msg)), [expandedKeys]);
4124
+ const lookupsRef = import_react15.useRef(lookups);
4125
+ lookupsRef.current = lookups;
4126
+ const isItemClickable = import_react15.useCallback((msg) => {
4127
+ if (msg.type === "collapsed_read_search")
4128
+ return true;
4129
+ if (msg.type === "assistant") {
4130
+ const content = msg.message.content;
4131
+ const b2 = Array.isArray(content) ? content[0] : undefined;
4132
+ return b2 != null && isAdvisorBlock(b2) && b2.type === "advisor_tool_result" && b2.content.type === "advisor_result";
4133
+ }
4134
+ if (msg.type !== "user")
4135
+ return false;
4136
+ const b = msg.message.content[0];
4137
+ if (b?.type !== "tool_result" || b.is_error || !msg.toolUseResult)
4138
+ return false;
4139
+ const name = lookupsRef.current.toolUseByToolUseID.get(b.tool_use_id ?? "")?.name;
4140
+ const tool = name ? findToolByName(tools, name) : undefined;
4141
+ return tool?.isResultTruncated?.(msg.toolUseResult) ?? false;
4142
+ }, [tools]);
4143
+ const canAnimate = (!toolJSX || !!toolJSX.shouldContinueAnimation) && !toolUseConfirmQueue.length && !isMessageSelectorVisible;
4144
+ const hasToolsInProgress = inProgressToolUseIDs.size > 0;
4145
+ const { progress } = useTerminalNotification();
4146
+ const prevProgressState = import_react15.useRef(null);
4147
+ const progressEnabled = getGlobalConfig().terminalProgressBarEnabled && !getIsRemoteMode() && !(proactiveModule?.isProactiveActive() ?? false);
4148
+ import_react15.useEffect(() => {
4149
+ const state = progressEnabled ? hasToolsInProgress ? "indeterminate" : "completed" : null;
4150
+ if (prevProgressState.current === state)
4151
+ return;
4152
+ prevProgressState.current = state;
4153
+ progress(state);
4154
+ }, [progress, progressEnabled, hasToolsInProgress]);
4155
+ import_react15.useEffect(() => {
4156
+ return () => progress(null);
4157
+ }, [progress]);
4158
+ const messageKey = import_react15.useCallback((msg) => `${msg.uuid}-${conversationId}`, [conversationId]);
4159
+ const renderMessageRow = (msg, index) => {
4160
+ const prevType = index > 0 ? renderableMessages[index - 1]?.type : undefined;
4161
+ const isUserContinuation = msg.type === "user" && prevType === "user";
4162
+ const hasContentAfter = msg.type === "collapsed_read_search" && (!!streamingText || hasContentAfterIndex(renderableMessages, index, tools, streamingToolUseIDs));
4163
+ const DIFF_COLLAPSE_DISTANCE = 0;
4164
+ const shouldCollapseDiffs = renderableMessages.length - 1 - index > DIFF_COLLAPSE_DISTANCE;
4165
+ const k = messageKey(msg);
4166
+ const row = /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(MessageRow, {
4167
+ message: msg,
4168
+ isUserContinuation,
4169
+ hasContentAfter,
4170
+ tools,
4171
+ commands,
4172
+ verbose: verbose || isItemExpanded(msg) || cursor?.expanded === true && index === selectedIdx,
4173
+ inProgressToolUseIDs,
4174
+ streamingToolUseIDs,
4175
+ screen,
4176
+ canAnimate,
4177
+ onOpenRateLimitOptions,
4178
+ lastThinkingBlockId,
4179
+ latestBashOutputUUID,
4180
+ columns,
4181
+ isLoading,
4182
+ lookups,
4183
+ shouldCollapseDiffs
4184
+ }, k, false, undefined, this);
4185
+ const wrapped = /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(MessageActionsSelectedContext.Provider, {
4186
+ value: index === selectedIdx,
4187
+ children: row
4188
+ }, k, false, undefined, this);
4189
+ if (unseenDivider && index === dividerBeforeIndex) {
4190
+ return [
4191
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedBox_default, {
4192
+ marginTop: 1,
4193
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Divider, {
4194
+ title: `${unseenDivider.count} new ${plural(unseenDivider.count, "message")}`,
4195
+ width: columns,
4196
+ color: "inactive"
4197
+ }, undefined, false, undefined, this)
4198
+ }, "unseen-divider", false, undefined, this),
4199
+ wrapped
4200
+ ];
4201
+ }
4202
+ return wrapped;
4203
+ };
4204
+ const searchTextCache2 = import_react15.useRef(new WeakMap);
4205
+ const extractSearchText = import_react15.useCallback((msg) => {
4206
+ const cached = searchTextCache2.current.get(msg);
4207
+ if (cached !== undefined)
4208
+ return cached;
4209
+ let text = renderableSearchText(msg);
4210
+ if (msg.type === "user" && msg.toolUseResult && Array.isArray(msg.message.content)) {
4211
+ const tr = msg.message.content.find((b) => b.type === "tool_result");
4212
+ if (tr && "tool_use_id" in tr) {
4213
+ const tu = lookups.toolUseByToolUseID.get(tr.tool_use_id);
4214
+ const tool = tu && findToolByName(tools, tu.name);
4215
+ const extracted = tool?.extractSearchText?.(msg.toolUseResult);
4216
+ if (extracted !== undefined)
4217
+ text = extracted;
4218
+ }
4219
+ }
4220
+ const lowered = text.toLowerCase();
4221
+ searchTextCache2.current.set(msg, lowered);
4222
+ return lowered;
4223
+ }, [tools, lookups]);
4224
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(jsx_dev_runtime22.Fragment, {
4225
+ children: [
4226
+ !hideLogo && !(renderRange && renderRange[0] > 0) && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(LogoHeader, {
4227
+ agentDefinitions
4228
+ }, undefined, false, undefined, this),
4229
+ hasTruncatedMessages && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Divider, {
4230
+ title: `${toggleShowAllShortcut} to show ${source_default.bold(hiddenMessageCount)} previous messages`,
4231
+ width: columns
4232
+ }, undefined, false, undefined, this),
4233
+ isTranscriptMode && showAllInTranscript && hiddenMessageCount > 0 && !disableRenderCap && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Divider, {
4234
+ title: `${toggleShowAllShortcut} to hide ${source_default.bold(hiddenMessageCount)} previous messages`,
4235
+ width: columns
4236
+ }, undefined, false, undefined, this),
4237
+ virtualScrollRuntimeGate ? /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(InVirtualListContext.Provider, {
4238
+ value: true,
4239
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(VirtualMessageList, {
4240
+ messages: renderableMessages,
4241
+ scrollRef,
4242
+ columns,
4243
+ itemKey: messageKey,
4244
+ renderItem: renderMessageRow,
4245
+ onItemClick,
4246
+ isItemClickable,
4247
+ isItemExpanded,
4248
+ trackStickyPrompt,
4249
+ selectedIndex: selectedIdx >= 0 ? selectedIdx : undefined,
4250
+ cursorNavRef,
4251
+ setCursor,
4252
+ jumpRef,
4253
+ onSearchMatchesChange,
4254
+ scanElement,
4255
+ setPositions,
4256
+ extractSearchText
4257
+ }, undefined, false, undefined, this)
4258
+ }, undefined, false, undefined, this) : renderableMessages.flatMap(renderMessageRow),
4259
+ streamingText && !isBriefOnly && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedBox_default, {
4260
+ alignItems: "flex-start",
4261
+ flexDirection: "row",
4262
+ marginTop: 1,
4263
+ width: "100%",
4264
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedBox_default, {
4265
+ flexDirection: "row",
4266
+ children: [
4267
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedBox_default, {
4268
+ minWidth: 2,
4269
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedText, {
4270
+ color: "text",
4271
+ children: BLACK_CIRCLE
4272
+ }, undefined, false, undefined, this)
4273
+ }, undefined, false, undefined, this),
4274
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedBox_default, {
4275
+ flexDirection: "column",
4276
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StreamingMarkdown, {
4277
+ children: streamingText
4278
+ }, undefined, false, undefined, this)
4279
+ }, undefined, false, undefined, this)
4280
+ ]
4281
+ }, undefined, true, undefined, this)
4282
+ }, undefined, false, undefined, this),
4283
+ isStreamingThinkingVisible && streamingThinking && !isBriefOnly && /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedBox_default, {
4284
+ marginTop: 1,
4285
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(AssistantThinkingMessage, {
4286
+ param: {
4287
+ type: "thinking",
4288
+ thinking: streamingThinking.thinking
4289
+ },
4290
+ addMargin: false,
4291
+ isTranscriptMode: true,
4292
+ verbose,
4293
+ hideInTranscript: false
4294
+ }, undefined, false, undefined, this)
4295
+ }, undefined, false, undefined, this)
4296
+ ]
4297
+ }, undefined, true, undefined, this);
4298
+ }, Messages;
4299
+ var init_Messages = __esm(() => {
4300
+ init_source();
4301
+ init_set();
4302
+ init_state();
4303
+ init_figures2();
4304
+ init_useTerminalSize();
4305
+ init_src();
4306
+ init_src();
4307
+ init_useShortcutDisplay();
4308
+ init_Tool();
4309
+ init_advisor();
4310
+ init_collapseBackgroundBashNotifications();
4311
+ init_collapseHookSummaries();
4312
+ init_collapseReadSearch();
4313
+ init_collapseTeammateShutdowns();
4314
+ init_config();
4315
+ init_envUtils();
4316
+ init_fullscreen();
4317
+ init_groupToolUses();
4318
+ init_messages();
4319
+ init_stringUtils();
4320
+ init_transcriptSearch();
4321
+ init_src();
4322
+ init_LogoV2();
4323
+ init_Markdown();
4324
+ init_MessageRow();
4325
+ init_messageActions();
4326
+ init_AssistantThinkingMessage();
4327
+ init_nullRenderingAttachments();
4328
+ init_OffscreenFreeze();
4329
+ init_StatusNotices();
4330
+ init_VirtualMessageList();
4331
+ React6 = __toESM(require_react(), 1);
4332
+ import_react15 = __toESM(require_react(), 1);
4333
+ jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
4334
+ LogoHeader = React6.memo(function LogoHeader2({
4335
+ agentDefinitions
4336
+ }) {
4337
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(OffscreenFreeze, {
4338
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(ThemedBox_default, {
4339
+ flexDirection: "column",
4340
+ gap: 1,
4341
+ children: [
4342
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(LogoV2, {}, undefined, false, undefined, this),
4343
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(React6.Suspense, {
4344
+ fallback: null,
4345
+ children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(StatusNotices, {
4346
+ agentDefinitions
4347
+ }, undefined, false, undefined, this)
4348
+ }, undefined, false, undefined, this)
4349
+ ]
4350
+ }, undefined, true, undefined, this)
4351
+ }, undefined, false, undefined, this);
4352
+ });
4353
+ proactiveModule = (init_proactive(), __toCommonJS(exports_proactive));
4354
+ BRIEF_TOOL_NAME = (init_prompt(), __toCommonJS(exports_prompt)).BRIEF_TOOL_NAME;
4355
+ SEND_USER_FILE_TOOL_NAME = (init_prompt2(), __toCommonJS(exports_prompt2)).SEND_USER_FILE_TOOL_NAME;
4356
+ Messages = React6.memo(MessagesImpl, (prev, next) => {
4357
+ const keys = Object.keys(prev);
4358
+ for (const key of keys) {
4359
+ if (key === "onOpenRateLimitOptions" || key === "scrollRef" || key === "trackStickyPrompt" || key === "setCursor" || key === "cursorNavRef" || key === "jumpRef" || key === "onSearchMatchesChange" || key === "scanElement" || key === "setPositions")
4360
+ continue;
4361
+ if (prev[key] !== next[key]) {
4362
+ if (key === "streamingToolUses") {
4363
+ const p = prev.streamingToolUses;
4364
+ const n = next.streamingToolUses;
4365
+ if (p.length === n.length && p.every((item, i) => item.contentBlock === n[i]?.contentBlock)) {
4366
+ continue;
4367
+ }
4368
+ }
4369
+ if (key === "inProgressToolUseIDs") {
4370
+ if (setsEqual(prev.inProgressToolUseIDs, next.inProgressToolUseIDs)) {
4371
+ continue;
4372
+ }
4373
+ }
4374
+ if (key === "unseenDivider") {
4375
+ const p = prev.unseenDivider;
4376
+ const n = next.unseenDivider;
4377
+ if (p?.firstUnseenUuid === n?.firstUnseenUuid && p?.count === n?.count) {
4378
+ continue;
4379
+ }
4380
+ }
4381
+ if (key === "tools") {
4382
+ const p = prev.tools;
4383
+ const n = next.tools;
4384
+ if (p.length === n.length && p.every((tool, i) => tool.name === n[i]?.name)) {
4385
+ continue;
4386
+ }
4387
+ }
4388
+ return false;
4389
+ }
4390
+ }
4391
+ return true;
4392
+ });
4393
+ });
4394
+
4395
+ export { useSetPromptOverlay, useSetPromptOverlayDialog, init_promptOverlayContext, useUnseenDivider, computeUnseenDivider, FullscreenLayout, init_FullscreenLayout, Messages, init_Messages };