@rainhole/rain-code 1.1.0

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