@zyycn/claudex 1.0.3-fork.2a74621

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/LICENSE.md +5 -0
  2. package/README.md +489 -0
  3. package/bin/claudex.js +40 -0
  4. package/dist/chunk-00xcm9ma.js +21933 -0
  5. package/dist/chunk-0503mmvy.js +153 -0
  6. package/dist/chunk-06saje2v.js +39 -0
  7. package/dist/chunk-0731m51q.js +8 -0
  8. package/dist/chunk-0htr6ryz.js +208 -0
  9. package/dist/chunk-0hw5q246.js +59 -0
  10. package/dist/chunk-0na45fm9.js +93 -0
  11. package/dist/chunk-0paqc2yw.js +15 -0
  12. package/dist/chunk-0q2xkmse.js +58 -0
  13. package/dist/chunk-0rvxx6st.js +195 -0
  14. package/dist/chunk-0vkfrmqm.js +690 -0
  15. package/dist/chunk-0xjaqda8.js +1124 -0
  16. package/dist/chunk-0xpb84zw.js +105 -0
  17. package/dist/chunk-1141xmr4.js +8 -0
  18. package/dist/chunk-14jv3jm7.js +17 -0
  19. package/dist/chunk-19vtvtzg.js +496 -0
  20. package/dist/chunk-1cbn5kxf.js +7 -0
  21. package/dist/chunk-1gj0rhkf.js +92 -0
  22. package/dist/chunk-1h2famwb.js +49 -0
  23. package/dist/chunk-1m68rrvt.js +173649 -0
  24. package/dist/chunk-1ss7dnmq.js +104 -0
  25. package/dist/chunk-1v6e40p8.js +160 -0
  26. package/dist/chunk-1vh98qr0.js +4521 -0
  27. package/dist/chunk-1xkekb9y.js +19 -0
  28. package/dist/chunk-1ydzf04y.js +713 -0
  29. package/dist/chunk-238g70xa.js +36 -0
  30. package/dist/chunk-27xc1csx.js +104 -0
  31. package/dist/chunk-297y1tw3.js +789 -0
  32. package/dist/chunk-2a42s11t.js +412 -0
  33. package/dist/chunk-2bpfbf16.js +998 -0
  34. package/dist/chunk-2eykm0j0.js +20 -0
  35. package/dist/chunk-2fwze72g.js +24 -0
  36. package/dist/chunk-2ge9kmgv.js +28 -0
  37. package/dist/chunk-2gzv8nrw.js +205 -0
  38. package/dist/chunk-2k995y2x.js +880 -0
  39. package/dist/chunk-2nayx6q1.js +63 -0
  40. package/dist/chunk-2qk1898r.js +74 -0
  41. package/dist/chunk-2qp0vrvd.js +83 -0
  42. package/dist/chunk-2sndq2nq.js +644 -0
  43. package/dist/chunk-2t1frg13.js +716 -0
  44. package/dist/chunk-2t3vw4tx.js +22820 -0
  45. package/dist/chunk-2ybjg7pc.js +432 -0
  46. package/dist/chunk-302gxdf9.js +161 -0
  47. package/dist/chunk-30rst83v.js +168 -0
  48. package/dist/chunk-33mdt86j.js +42 -0
  49. package/dist/chunk-33pgf56v.js +32 -0
  50. package/dist/chunk-36k7h1v1.js +372 -0
  51. package/dist/chunk-36zyyac9.js +41654 -0
  52. package/dist/chunk-37dbhqqr.js +1920 -0
  53. package/dist/chunk-37dydh7h.js +642 -0
  54. package/dist/chunk-38700exh.js +42 -0
  55. package/dist/chunk-3c25bcsw.js +17 -0
  56. package/dist/chunk-3h8a89gy.js +46 -0
  57. package/dist/chunk-3nk79af8.js +8 -0
  58. package/dist/chunk-3peatsdv.js +41 -0
  59. package/dist/chunk-3rd46sc5.js +221 -0
  60. package/dist/chunk-3s498jy8.js +1014 -0
  61. package/dist/chunk-3vs3nm7w.js +31 -0
  62. package/dist/chunk-3w6s9m5w.js +16 -0
  63. package/dist/chunk-3yccyqwm.js +692 -0
  64. package/dist/chunk-3zjjk0am.js +56 -0
  65. package/dist/chunk-3zzszjst.js +16415 -0
  66. package/dist/chunk-41m5za5y.js +154 -0
  67. package/dist/chunk-44fpr6jq.js +434 -0
  68. package/dist/chunk-48gwzq50.js +154 -0
  69. package/dist/chunk-495d85x1.js +8066 -0
  70. package/dist/chunk-4cse1nz6.js +98 -0
  71. package/dist/chunk-4f1wn74p.js +106 -0
  72. package/dist/chunk-4f9taz3j.js +86 -0
  73. package/dist/chunk-4g3v8y12.js +23 -0
  74. package/dist/chunk-4hh97qpv.js +765 -0
  75. package/dist/chunk-4jm600zv.js +13 -0
  76. package/dist/chunk-4jzv26gg.js +62 -0
  77. package/dist/chunk-4qgbmcm7.js +9193 -0
  78. package/dist/chunk-4qz9vbs1.js +349 -0
  79. package/dist/chunk-4tyttyn2.js +373 -0
  80. package/dist/chunk-4v0qvahs.js +89 -0
  81. package/dist/chunk-4zfkzkt6.js +37 -0
  82. package/dist/chunk-51xw8dbm.js +339 -0
  83. package/dist/chunk-525vnqc3.js +247 -0
  84. package/dist/chunk-557wwsxe.js +533 -0
  85. package/dist/chunk-55hj5hhv.js +84 -0
  86. package/dist/chunk-55wgxwa9.js +13877 -0
  87. package/dist/chunk-56jgazae.js +28 -0
  88. package/dist/chunk-58xxf3tz.js +521 -0
  89. package/dist/chunk-5c2m9q8v.js +109 -0
  90. package/dist/chunk-5fpcmgh8.js +348 -0
  91. package/dist/chunk-5gmd05y0.js +1153 -0
  92. package/dist/chunk-5gvng4zv.js +122 -0
  93. package/dist/chunk-5k5a32tj.js +537 -0
  94. package/dist/chunk-5md3w36r.js +275 -0
  95. package/dist/chunk-5z1vph5s.js +127 -0
  96. package/dist/chunk-5z78246t.js +54 -0
  97. package/dist/chunk-65s8h28p.js +123 -0
  98. package/dist/chunk-66qbb491.js +90 -0
  99. package/dist/chunk-693w4qr8.js +300 -0
  100. package/dist/chunk-6azerawy.js +2335 -0
  101. package/dist/chunk-6bd8brc4.js +48 -0
  102. package/dist/chunk-6d8k2crm.js +101 -0
  103. package/dist/chunk-6dj5t602.js +341 -0
  104. package/dist/chunk-6em0h8b4.js +88 -0
  105. package/dist/chunk-6gr3c3w9.js +378 -0
  106. package/dist/chunk-6gzakvec.js +87 -0
  107. package/dist/chunk-6hy71770.js +96 -0
  108. package/dist/chunk-6mtk8975.js +117 -0
  109. package/dist/chunk-6n2qgm9v.js +8 -0
  110. package/dist/chunk-6n7gewz2.js +253 -0
  111. package/dist/chunk-6r1112vx.js +469 -0
  112. package/dist/chunk-6r9v2rce.js +229 -0
  113. package/dist/chunk-6tq2v3rk.js +186 -0
  114. package/dist/chunk-70spdapk.js +79 -0
  115. package/dist/chunk-73rpbt04.js +1947 -0
  116. package/dist/chunk-760252na.js +101 -0
  117. package/dist/chunk-761tmgwx.js +6108 -0
  118. package/dist/chunk-76dy674m.js +648 -0
  119. package/dist/chunk-7739pg2c.js +4261 -0
  120. package/dist/chunk-78cznbzh.js +756 -0
  121. package/dist/chunk-78vqjj7t.js +1317 -0
  122. package/dist/chunk-79tame2q.js +280 -0
  123. package/dist/chunk-7aw745vx.js +40175 -0
  124. package/dist/chunk-7e6ahfxz.js +61 -0
  125. package/dist/chunk-7gd593wb.js +438 -0
  126. package/dist/chunk-7m2nd8da.js +110 -0
  127. package/dist/chunk-7pqesh1s.js +184 -0
  128. package/dist/chunk-7q237ftq.js +1585 -0
  129. package/dist/chunk-7vbxp63m.js +100 -0
  130. package/dist/chunk-7wm5s02e.js +216 -0
  131. package/dist/chunk-7xyswgjh.js +8 -0
  132. package/dist/chunk-7zaxrfnt.js +42 -0
  133. package/dist/chunk-83hfzbx3.js +10 -0
  134. package/dist/chunk-8bedvdm1.js +32 -0
  135. package/dist/chunk-8hq5kk3y.js +44 -0
  136. package/dist/chunk-8k0y8sk2.js +165 -0
  137. package/dist/chunk-8pb038eb.js +44 -0
  138. package/dist/chunk-8smr33wf.js +287 -0
  139. package/dist/chunk-8tnsngw2.js +31 -0
  140. package/dist/chunk-8vcz9eks.js +443 -0
  141. package/dist/chunk-8y12jxg8.js +10 -0
  142. package/dist/chunk-8ymf4e6z.js +48 -0
  143. package/dist/chunk-90wp6wez.js +10510 -0
  144. package/dist/chunk-9f9p2b84.js +848 -0
  145. package/dist/chunk-9gbamk79.js +93 -0
  146. package/dist/chunk-9k27xdmg.js +542 -0
  147. package/dist/chunk-9k2drwej.js +106 -0
  148. package/dist/chunk-9x5zgy22.js +12 -0
  149. package/dist/chunk-a5wwqn08.js +725 -0
  150. package/dist/chunk-a8ejc632.js +3094 -0
  151. package/dist/chunk-a9nr12c7.js +272 -0
  152. package/dist/chunk-a9vdeb6y.js +258 -0
  153. package/dist/chunk-a9zh40sj.js +48 -0
  154. package/dist/chunk-aberf6bd.js +282 -0
  155. package/dist/chunk-ada32h8c.js +40 -0
  156. package/dist/chunk-adg4351g.js +26840 -0
  157. package/dist/chunk-ae7s1rks.js +93 -0
  158. package/dist/chunk-agnasrp3.js +128 -0
  159. package/dist/chunk-akp4x1ve.js +93 -0
  160. package/dist/chunk-akyzxxs1.js +109 -0
  161. package/dist/chunk-ar08wx1s.js +468 -0
  162. package/dist/chunk-ar1vk71q.js +220 -0
  163. package/dist/chunk-arnhbg3z.js +87 -0
  164. package/dist/chunk-azk47w50.js +306 -0
  165. package/dist/chunk-b11e166f.js +173 -0
  166. package/dist/chunk-b292a9es.js +91 -0
  167. package/dist/chunk-b4v0varz.js +89 -0
  168. package/dist/chunk-b4wg70y1.js +54 -0
  169. package/dist/chunk-b75fzr8e.js +969 -0
  170. package/dist/chunk-b7cywkg9.js +908 -0
  171. package/dist/chunk-b80rg7hy.js +565 -0
  172. package/dist/chunk-b8x1gk3y.js +1299 -0
  173. package/dist/chunk-b9kme9pv.js +38 -0
  174. package/dist/chunk-bah68pmm.js +47 -0
  175. package/dist/chunk-bbxjktbd.js +69 -0
  176. package/dist/chunk-bc035ncb.js +153 -0
  177. package/dist/chunk-bedw0ft1.js +198 -0
  178. package/dist/chunk-bjqw6798.js +328 -0
  179. package/dist/chunk-bm1qb16p.js +17 -0
  180. package/dist/chunk-bqfnp99q.js +477 -0
  181. package/dist/chunk-bvp4dgm4.js +182 -0
  182. package/dist/chunk-c1k5g6t4.js +115 -0
  183. package/dist/chunk-c3r27fmp.js +73 -0
  184. package/dist/chunk-c9xk7hme.js +106 -0
  185. package/dist/chunk-cd155fv3.js +87 -0
  186. package/dist/chunk-cdz5yb0r.js +57 -0
  187. package/dist/chunk-cfv996bs.js +22 -0
  188. package/dist/chunk-cg606wr4.js +110 -0
  189. package/dist/chunk-cgfdkzhb.js +12 -0
  190. package/dist/chunk-chy5zbax.js +701 -0
  191. package/dist/chunk-ctkn4y2r.js +317 -0
  192. package/dist/chunk-czensfac.js +476 -0
  193. package/dist/chunk-d28x64s9.js +38 -0
  194. package/dist/chunk-d9kz373t.js +122 -0
  195. package/dist/chunk-dgqrcy74.js +48 -0
  196. package/dist/chunk-dnh7jtpb.js +37 -0
  197. package/dist/chunk-dnqqes3z.js +216 -0
  198. package/dist/chunk-dphmfzrv.js +250 -0
  199. package/dist/chunk-drzegvt5.js +86 -0
  200. package/dist/chunk-ds5nkfg0.js +1095 -0
  201. package/dist/chunk-dsf70j2y.js +1550 -0
  202. package/dist/chunk-dstxhxsx.js +121 -0
  203. package/dist/chunk-dv1wfr85.js +6373 -0
  204. package/dist/chunk-dxfhv5da.js +500 -0
  205. package/dist/chunk-e5pntxye.js +37 -0
  206. package/dist/chunk-e6q1y5gb.js +419 -0
  207. package/dist/chunk-e8bd8nfv.js +697 -0
  208. package/dist/chunk-e8d2zjs1.js +338 -0
  209. package/dist/chunk-e9aevcts.js +87 -0
  210. package/dist/chunk-eebcvtbb.js +1646 -0
  211. package/dist/chunk-egmp9ajp.js +144 -0
  212. package/dist/chunk-ehtwnxpg.js +1591 -0
  213. package/dist/chunk-eqp1rfft.js +17 -0
  214. package/dist/chunk-ewadzrm8.js +103 -0
  215. package/dist/chunk-eynjr6k5.js +169 -0
  216. package/dist/chunk-ezf1ppbj.js +208 -0
  217. package/dist/chunk-f4407gzr.js +129 -0
  218. package/dist/chunk-f5ma3nh5.js +3436 -0
  219. package/dist/chunk-fbpftpf0.js +69 -0
  220. package/dist/chunk-fbv4apne.js +51 -0
  221. package/dist/chunk-ffk6brrm.js +386 -0
  222. package/dist/chunk-fgebtwax.js +1872 -0
  223. package/dist/chunk-fkcn5zhs.js +40 -0
  224. package/dist/chunk-fm8gm3cm.js +120 -0
  225. package/dist/chunk-fw5ev6dp.js +458 -0
  226. package/dist/chunk-fyc5fepv.js +10 -0
  227. package/dist/chunk-fzj4am93.js +1493 -0
  228. package/dist/chunk-g0j0t6qk.js +26 -0
  229. package/dist/chunk-g338npwr.js +1061 -0
  230. package/dist/chunk-g3t0act8.js +8 -0
  231. package/dist/chunk-geyx5ybh.js +375 -0
  232. package/dist/chunk-gg3j3nv0.js +212 -0
  233. package/dist/chunk-gmaybtrd.js +726 -0
  234. package/dist/chunk-gqmkgbfr.js +256 -0
  235. package/dist/chunk-gv0tqhg0.js +118 -0
  236. package/dist/chunk-gyj242zr.js +20 -0
  237. package/dist/chunk-gz457zg6.js +463 -0
  238. package/dist/chunk-gzaaa3ex.js +166 -0
  239. package/dist/chunk-gzct9dkr.js +2057 -0
  240. package/dist/chunk-gzzfhtdv.js +7189 -0
  241. package/dist/chunk-h0qngp9w.js +157 -0
  242. package/dist/chunk-h0rbjg6x.js +55 -0
  243. package/dist/chunk-h4qh9a0e.js +3444 -0
  244. package/dist/chunk-hakdhagh.js +16606 -0
  245. package/dist/chunk-hazazgk5.js +3205 -0
  246. package/dist/chunk-hb7k1x8f.js +745 -0
  247. package/dist/chunk-hh7cmy4k.js +20 -0
  248. package/dist/chunk-hj4vr9dm.js +102 -0
  249. package/dist/chunk-hk90mbpv.js +3418 -0
  250. package/dist/chunk-hk9xz7gk.js +118 -0
  251. package/dist/chunk-hmtttwpt.js +132 -0
  252. package/dist/chunk-hqmz36b3.js +552 -0
  253. package/dist/chunk-hvm6gcy9.js +584 -0
  254. package/dist/chunk-hzhe8ygc.js +547 -0
  255. package/dist/chunk-j2k4p94p.js +55 -0
  256. package/dist/chunk-j2rbx1ej.js +96 -0
  257. package/dist/chunk-j3a4p81y.js +184 -0
  258. package/dist/chunk-j5hc27hv.js +444 -0
  259. package/dist/chunk-j64ga6ta.js +8035 -0
  260. package/dist/chunk-j84fcssx.js +54 -0
  261. package/dist/chunk-jce5r25x.js +18 -0
  262. package/dist/chunk-jd32zbps.js +15 -0
  263. package/dist/chunk-jdgeec04.js +4249 -0
  264. package/dist/chunk-jj0m6fr0.js +247 -0
  265. package/dist/chunk-jnhkref0.js +30 -0
  266. package/dist/chunk-jpp9dqv4.js +6956 -0
  267. package/dist/chunk-jr58a333.js +113 -0
  268. package/dist/chunk-jx817w05.js +11 -0
  269. package/dist/chunk-jxnvvps7.js +328 -0
  270. package/dist/chunk-jzmz18nn.js +65 -0
  271. package/dist/chunk-k0p9w03v.js +4957 -0
  272. package/dist/chunk-k2aj61ee.js +27 -0
  273. package/dist/chunk-kcv00nmk.js +849 -0
  274. package/dist/chunk-kecf7c6t.js +10476 -0
  275. package/dist/chunk-kffz0vxg.js +92 -0
  276. package/dist/chunk-kge53wbt.js +674 -0
  277. package/dist/chunk-khscb4ge.js +99 -0
  278. package/dist/chunk-kk4h10r3.js +3058 -0
  279. package/dist/chunk-kq0n3myz.js +71 -0
  280. package/dist/chunk-kwekc97v.js +18 -0
  281. package/dist/chunk-m44gmqd1.js +258 -0
  282. package/dist/chunk-m4kphr9e.js +71 -0
  283. package/dist/chunk-mbrkqdrq.js +155 -0
  284. package/dist/chunk-mt25echc.js +6157 -0
  285. package/dist/chunk-mvrpg273.js +89 -0
  286. package/dist/chunk-mzfgg9ne.js +275 -0
  287. package/dist/chunk-n0qaeaa5.js +256 -0
  288. package/dist/chunk-n0x2db3y.js +84 -0
  289. package/dist/chunk-n18sq04t.js +603 -0
  290. package/dist/chunk-n6qhan3n.js +243 -0
  291. package/dist/chunk-n7ttdtk0.js +641 -0
  292. package/dist/chunk-ncxetb9w.js +130 -0
  293. package/dist/chunk-ne67h2hc.js +277 -0
  294. package/dist/chunk-nfv508k1.js +306 -0
  295. package/dist/chunk-nj17bhkh.js +125 -0
  296. package/dist/chunk-nka1g8f4.js +773 -0
  297. package/dist/chunk-nma79c3w.js +281 -0
  298. package/dist/chunk-nq0fxyxh.js +752 -0
  299. package/dist/chunk-nt837qt9.js +21 -0
  300. package/dist/chunk-nwsmn6zm.js +15 -0
  301. package/dist/chunk-nypgx8vs.js +63 -0
  302. package/dist/chunk-p2816w9z.js +1486 -0
  303. package/dist/chunk-p2d5nh3g.js +342 -0
  304. package/dist/chunk-p331ghzg.js +391 -0
  305. package/dist/chunk-p3g43fdn.js +61 -0
  306. package/dist/chunk-p87jnvhk.js +97 -0
  307. package/dist/chunk-pb04jxp7.js +158 -0
  308. package/dist/chunk-pd6ph5ep.js +176 -0
  309. package/dist/chunk-pe0s50gj.js +32 -0
  310. package/dist/chunk-pe6w0anj.js +780 -0
  311. package/dist/chunk-ph936yc1.js +99 -0
  312. package/dist/chunk-pmsp9ed2.js +34 -0
  313. package/dist/chunk-ppwjyveh.js +8 -0
  314. package/dist/chunk-ps49ymvj.js +43 -0
  315. package/dist/chunk-pwwa7s62.js +11 -0
  316. package/dist/chunk-pxv7ggmm.js +1580 -0
  317. package/dist/chunk-py5y9jh1.js +38 -0
  318. package/dist/chunk-q0sq5qtt.js +606 -0
  319. package/dist/chunk-q1mq6fj3.js +118 -0
  320. package/dist/chunk-q25bjaev.js +15 -0
  321. package/dist/chunk-q55nn3jr.js +5018 -0
  322. package/dist/chunk-q6na5mcw.js +268 -0
  323. package/dist/chunk-q6wc9j6e.js +1556 -0
  324. package/dist/chunk-q7bxdsfd.js +22 -0
  325. package/dist/chunk-q82jz4qn.js +2838 -0
  326. package/dist/chunk-qbt1tq74.js +145 -0
  327. package/dist/chunk-qfzfjrk3.js +439 -0
  328. package/dist/chunk-qjg7a3vk.js +246 -0
  329. package/dist/chunk-qnfx3qtx.js +617 -0
  330. package/dist/chunk-qp2qdcda.js +100 -0
  331. package/dist/chunk-qpa4edje.js +95 -0
  332. package/dist/chunk-qqfa0dqg.js +2343 -0
  333. package/dist/chunk-qqfvrtr3.js +99 -0
  334. package/dist/chunk-qrqenkjd.js +140 -0
  335. package/dist/chunk-qrv8taxy.js +229 -0
  336. package/dist/chunk-qypqtrgp.js +176 -0
  337. package/dist/chunk-qywdhw43.js +89 -0
  338. package/dist/chunk-qz2x630m.js +49145 -0
  339. package/dist/chunk-r0v9bxma.js +83 -0
  340. package/dist/chunk-r6b58y3x.js +17 -0
  341. package/dist/chunk-r9madq2h.js +71 -0
  342. package/dist/chunk-raqgs410.js +116 -0
  343. package/dist/chunk-rc28tav4.js +202 -0
  344. package/dist/chunk-re1t10ba.js +5954 -0
  345. package/dist/chunk-res15ktd.js +18 -0
  346. package/dist/chunk-rkb7mqj8.js +603 -0
  347. package/dist/chunk-rn0v1hk8.js +34 -0
  348. package/dist/chunk-rrb8682q.js +120 -0
  349. package/dist/chunk-rs9gw711.js +115 -0
  350. package/dist/chunk-rtgznsee.js +43 -0
  351. package/dist/chunk-s2341895.js +24 -0
  352. package/dist/chunk-s2gr7ese.js +106 -0
  353. package/dist/chunk-s2t8vg8q.js +26 -0
  354. package/dist/chunk-s3pzvdss.js +50 -0
  355. package/dist/chunk-s56m7vrp.js +66 -0
  356. package/dist/chunk-s5dg9njs.js +826 -0
  357. package/dist/chunk-s7mpvz9v.js +811 -0
  358. package/dist/chunk-sbbj6ta3.js +1711 -0
  359. package/dist/chunk-sd36yzx8.js +954 -0
  360. package/dist/chunk-sdj9b9wh.js +782 -0
  361. package/dist/chunk-sdxgmmma.js +224 -0
  362. package/dist/chunk-sgrc7rmx.js +471 -0
  363. package/dist/chunk-shb6nvk6.js +27 -0
  364. package/dist/chunk-smtr0ngp.js +98 -0
  365. package/dist/chunk-sn55zm52.js +267 -0
  366. package/dist/chunk-ss4r21gw.js +61 -0
  367. package/dist/chunk-sv3cz176.js +400 -0
  368. package/dist/chunk-sy4rdq5h.js +116 -0
  369. package/dist/chunk-szj5wvdy.js +28 -0
  370. package/dist/chunk-t0rgmccj.js +39 -0
  371. package/dist/chunk-t133w5tm.js +298 -0
  372. package/dist/chunk-t3360k46.js +75 -0
  373. package/dist/chunk-tdbpneze.js +346 -0
  374. package/dist/chunk-tjk56vh8.js +81 -0
  375. package/dist/chunk-tm5bn7aw.js +266 -0
  376. package/dist/chunk-ts2p6bv1.js +224 -0
  377. package/dist/chunk-ttk5dzz8.js +25 -0
  378. package/dist/chunk-v1kzp02e.js +785 -0
  379. package/dist/chunk-v2fqnqgx.js +163 -0
  380. package/dist/chunk-v2xpxnmd.js +673 -0
  381. package/dist/chunk-v78fj8by.js +145 -0
  382. package/dist/chunk-v90xv5n9.js +157 -0
  383. package/dist/chunk-v9smspw2.js +4301 -0
  384. package/dist/chunk-vd3bb2zh.js +173 -0
  385. package/dist/chunk-vest0y6x.js +3830 -0
  386. package/dist/chunk-vf5sd1nq.js +12 -0
  387. package/dist/chunk-vhjx5fag.js +56 -0
  388. package/dist/chunk-vjf2rt5s.js +751 -0
  389. package/dist/chunk-vn1e1j7w.js +655 -0
  390. package/dist/chunk-vqk1n5qr.js +63 -0
  391. package/dist/chunk-vqvd3qz0.js +151 -0
  392. package/dist/chunk-vrmgtjyy.js +195 -0
  393. package/dist/chunk-vyjeh50y.js +2149 -0
  394. package/dist/chunk-w100pzs6.js +41 -0
  395. package/dist/chunk-w962tnq8.js +1322 -0
  396. package/dist/chunk-wae2sy8c.js +225 -0
  397. package/dist/chunk-wfprv7va.js +192 -0
  398. package/dist/chunk-wfz0qffj.js +3939 -0
  399. package/dist/chunk-wgcssf6v.js +722 -0
  400. package/dist/chunk-wh43g70w.js +40 -0
  401. package/dist/chunk-whb2mrcf.js +2643 -0
  402. package/dist/chunk-wn2268qd.js +335 -0
  403. package/dist/chunk-wq8v0d1k.js +1391 -0
  404. package/dist/chunk-wrhhmkf7.js +16 -0
  405. package/dist/chunk-wt69n71b.js +779 -0
  406. package/dist/chunk-wz2ekprb.js +130 -0
  407. package/dist/chunk-wzpdet3m.js +843 -0
  408. package/dist/chunk-x21zmsfa.js +104 -0
  409. package/dist/chunk-x2h31hmh.js +642 -0
  410. package/dist/chunk-x2qg3sdd.js +114 -0
  411. package/dist/chunk-x6r4v44b.js +8 -0
  412. package/dist/chunk-x7vg43fv.js +79 -0
  413. package/dist/chunk-x8b7vft8.js +132 -0
  414. package/dist/chunk-xbtacp2f.js +4389 -0
  415. package/dist/chunk-xq4cfvpn.js +213 -0
  416. package/dist/chunk-xqde96jm.js +60 -0
  417. package/dist/chunk-xsq9ae7x.js +90 -0
  418. package/dist/chunk-xsx5x369.js +526 -0
  419. package/dist/chunk-xszk7n10.js +14358 -0
  420. package/dist/chunk-xtv4fh71.js +53 -0
  421. package/dist/chunk-xv3era3s.js +8 -0
  422. package/dist/chunk-xxr0mzqt.js +90 -0
  423. package/dist/chunk-xzcz58pv.js +90 -0
  424. package/dist/chunk-y1784krc.js +19 -0
  425. package/dist/chunk-y9pt2qdf.js +69 -0
  426. package/dist/chunk-ya53e6g3.js +333 -0
  427. package/dist/chunk-ydde1jqg.js +490 -0
  428. package/dist/chunk-yh7amsbv.js +143 -0
  429. package/dist/chunk-yn80rxav.js +458 -0
  430. package/dist/chunk-ysvwcdav.js +9300 -0
  431. package/dist/chunk-ytvzxnx2.js +862 -0
  432. package/dist/chunk-yv9c6hfk.js +286 -0
  433. package/dist/chunk-yvdj4t96.js +88 -0
  434. package/dist/chunk-ywxd4qw4.js +22 -0
  435. package/dist/chunk-yysj6sxt.js +336 -0
  436. package/dist/chunk-z2dp53wn.js +17 -0
  437. package/dist/chunk-z2gj7190.js +5398 -0
  438. package/dist/chunk-z7ns4g0p.js +802 -0
  439. package/dist/chunk-z9b8pnt1.js +654 -0
  440. package/dist/chunk-zc6g0qqe.js +29 -0
  441. package/dist/chunk-zk2wsm7d.js +15 -0
  442. package/dist/chunk-zq4j9zys.js +264 -0
  443. package/dist/chunk-zsfxha74.js +17655 -0
  444. package/dist/chunk-ztmjzgq7.js +524 -0
  445. package/dist/chunk-zv2r5chy.js +91 -0
  446. package/dist/chunk-zx7pgp71.js +20 -0
  447. package/dist/chunk-zxvm58cn.js +102 -0
  448. package/dist/chunk-zydy88cv.js +70 -0
  449. package/dist/cli.js +92 -0
  450. package/package.json +36 -0
@@ -0,0 +1,2838 @@
1
+ // @bun
2
+ import {
3
+ Messages,
4
+ init_Messages
5
+ } from "./chunk-re1t10ba.js";
6
+ import {
7
+ SearchBox,
8
+ init_SearchBox,
9
+ init_useSearchInput,
10
+ useSearchInput
11
+ } from "./chunk-2ybjg7pc.js";
12
+ import {
13
+ LoadingState,
14
+ init_LoadingState
15
+ } from "./chunk-p87jnvhk.js";
16
+ import {
17
+ Select,
18
+ Spinner,
19
+ TextInput,
20
+ getAllBaseTools,
21
+ getFirstMeaningfulUserMessageTextContent,
22
+ getSessionIdFromLog,
23
+ getWorktreePaths,
24
+ init_Spinner,
25
+ init_TextInput,
26
+ init_getWorktreePaths,
27
+ init_select,
28
+ init_sessionStorage,
29
+ init_shellQuote,
30
+ init_sideQuery,
31
+ init_tools1 as init_tools,
32
+ isCustomTitleEnabled,
33
+ isLiteLog,
34
+ loadFullLog,
35
+ quote,
36
+ saveCustomTitle,
37
+ sideQuery
38
+ } from "./chunk-1m68rrvt.js";
39
+ import {
40
+ Byline,
41
+ ConfigurableShortcutHint,
42
+ KeyboardShortcutHint,
43
+ init_Byline,
44
+ init_ConfigurableShortcutHint,
45
+ init_KeyboardShortcutHint
46
+ } from "./chunk-gz457zg6.js";
47
+ import {
48
+ init_useExitOnCtrlCDWithKeybindings,
49
+ useExitOnCtrlCDWithKeybindings
50
+ } from "./chunk-ph936yc1.js";
51
+ import {
52
+ Divider,
53
+ init_Divider,
54
+ init_useKeybinding,
55
+ init_useTerminalSize,
56
+ useKeybinding,
57
+ useTerminalSize
58
+ } from "./chunk-z7ns4g0p.js";
59
+ import {
60
+ ThemedBox_default,
61
+ ThemedText,
62
+ applyColor,
63
+ getTheme,
64
+ init_colorize,
65
+ init_ink,
66
+ init_theme,
67
+ require_compiler_runtime,
68
+ useTerminalFocus,
69
+ useTheme,
70
+ use_input_default
71
+ } from "./chunk-adg4351g.js";
72
+ import {
73
+ require_jsx_dev_runtime,
74
+ require_react
75
+ } from "./chunk-g338npwr.js";
76
+ import {
77
+ getSmallFastModel,
78
+ init_model,
79
+ init_source,
80
+ source_default
81
+ } from "./chunk-3zzszjst.js";
82
+ import {
83
+ count,
84
+ init_array
85
+ } from "./chunk-b75fzr8e.js";
86
+ import {
87
+ getCliBin,
88
+ init_cliBranding
89
+ } from "./chunk-res15ktd.js";
90
+ import {
91
+ formatLogMetadata,
92
+ formatRelativeTimeAgo,
93
+ init_format,
94
+ init_stringWidth,
95
+ stringWidth,
96
+ truncateToWidth
97
+ } from "./chunk-wgcssf6v.js";
98
+ import {
99
+ init_analytics,
100
+ logEvent
101
+ } from "./chunk-h0rbjg6x.js";
102
+ import {
103
+ getBranch,
104
+ init_git
105
+ } from "./chunk-b8x1gk3y.js";
106
+ import {
107
+ getLogDisplayTitle,
108
+ init_log,
109
+ logError
110
+ } from "./chunk-yysj6sxt.js";
111
+ import {
112
+ init_debug,
113
+ init_slowOperations,
114
+ jsonParse,
115
+ logForDebugging
116
+ } from "./chunk-sbbj6ta3.js";
117
+ import {
118
+ getOriginalCwd,
119
+ getSessionId,
120
+ init_state
121
+ } from "./chunk-qqfa0dqg.js";
122
+ import {
123
+ __esm,
124
+ __toESM
125
+ } from "./chunk-qp2qdcda.js";
126
+
127
+ // src/components/SessionPreview.tsx
128
+ function SessionPreview(t0) {
129
+ const $ = import_compiler_runtime.c(33);
130
+ const {
131
+ log,
132
+ onExit,
133
+ onSelect
134
+ } = t0;
135
+ const [fullLog, setFullLog] = import_react.default.useState(null);
136
+ let t1;
137
+ let t2;
138
+ if ($[0] !== log) {
139
+ t1 = () => {
140
+ setFullLog(null);
141
+ if (isLiteLog(log)) {
142
+ loadFullLog(log).then(setFullLog);
143
+ }
144
+ };
145
+ t2 = [log];
146
+ $[0] = log;
147
+ $[1] = t1;
148
+ $[2] = t2;
149
+ } else {
150
+ t1 = $[1];
151
+ t2 = $[2];
152
+ }
153
+ import_react.default.useEffect(t1, t2);
154
+ const isLoading = isLiteLog(log) && fullLog === null;
155
+ const displayLog = fullLog ?? log;
156
+ let t3;
157
+ if ($[3] !== displayLog) {
158
+ t3 = getSessionIdFromLog(displayLog) || "";
159
+ $[3] = displayLog;
160
+ $[4] = t3;
161
+ } else {
162
+ t3 = $[4];
163
+ }
164
+ const conversationId = t3;
165
+ let t4;
166
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
167
+ t4 = getAllBaseTools();
168
+ $[5] = t4;
169
+ } else {
170
+ t4 = $[5];
171
+ }
172
+ const tools = t4;
173
+ let t5;
174
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
175
+ t5 = {
176
+ context: "Confirmation"
177
+ };
178
+ $[6] = t5;
179
+ } else {
180
+ t5 = $[6];
181
+ }
182
+ useKeybinding("confirm:no", onExit, t5);
183
+ let t6;
184
+ if ($[7] !== fullLog || $[8] !== log || $[9] !== onSelect) {
185
+ t6 = () => {
186
+ onSelect(fullLog ?? log);
187
+ };
188
+ $[7] = fullLog;
189
+ $[8] = log;
190
+ $[9] = onSelect;
191
+ $[10] = t6;
192
+ } else {
193
+ t6 = $[10];
194
+ }
195
+ const handleSelect = t6;
196
+ let t7;
197
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
198
+ t7 = {
199
+ context: "Confirmation"
200
+ };
201
+ $[11] = t7;
202
+ } else {
203
+ t7 = $[11];
204
+ }
205
+ useKeybinding("confirm:yes", handleSelect, t7);
206
+ if (isLoading) {
207
+ let t82;
208
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
209
+ t82 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(LoadingState, {
210
+ message: "Loading session\u2026"
211
+ }, undefined, false, undefined, this);
212
+ $[12] = t82;
213
+ } else {
214
+ t82 = $[12];
215
+ }
216
+ let t92;
217
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
218
+ t92 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
219
+ flexDirection: "column",
220
+ padding: 1,
221
+ children: [
222
+ t82,
223
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
224
+ dimColor: true,
225
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
226
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
227
+ action: "confirm:no",
228
+ context: "Confirmation",
229
+ fallback: "Esc",
230
+ description: "cancel"
231
+ }, undefined, false, undefined, this)
232
+ }, undefined, false, undefined, this)
233
+ }, undefined, false, undefined, this)
234
+ ]
235
+ }, undefined, true, undefined, this);
236
+ $[13] = t92;
237
+ } else {
238
+ t92 = $[13];
239
+ }
240
+ return t92;
241
+ }
242
+ let t8;
243
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
244
+ t8 = [];
245
+ $[14] = t8;
246
+ } else {
247
+ t8 = $[14];
248
+ }
249
+ let t10;
250
+ let t9;
251
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
252
+ t9 = [];
253
+ t10 = new Set;
254
+ $[15] = t10;
255
+ $[16] = t9;
256
+ } else {
257
+ t10 = $[15];
258
+ t9 = $[16];
259
+ }
260
+ let t11;
261
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
262
+ t11 = [];
263
+ $[17] = t11;
264
+ } else {
265
+ t11 = $[17];
266
+ }
267
+ let t12;
268
+ if ($[18] !== conversationId || $[19] !== displayLog.messages) {
269
+ t12 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Messages, {
270
+ messages: displayLog.messages,
271
+ tools,
272
+ commands: t8,
273
+ verbose: true,
274
+ toolJSX: null,
275
+ toolUseConfirmQueue: t9,
276
+ inProgressToolUseIDs: t10,
277
+ isMessageSelectorVisible: false,
278
+ conversationId,
279
+ screen: "transcript",
280
+ streamingToolUses: t11,
281
+ showAllInTranscript: true,
282
+ isLoading: false
283
+ }, undefined, false, undefined, this);
284
+ $[18] = conversationId;
285
+ $[19] = displayLog.messages;
286
+ $[20] = t12;
287
+ } else {
288
+ t12 = $[20];
289
+ }
290
+ let t13;
291
+ if ($[21] !== displayLog.modified) {
292
+ t13 = formatRelativeTimeAgo(displayLog.modified);
293
+ $[21] = displayLog.modified;
294
+ $[22] = t13;
295
+ } else {
296
+ t13 = $[22];
297
+ }
298
+ const t14 = displayLog.gitBranch ? ` \xB7 ${displayLog.gitBranch}` : "";
299
+ let t15;
300
+ if ($[23] !== displayLog.messageCount || $[24] !== t13 || $[25] !== t14) {
301
+ t15 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
302
+ children: [
303
+ t13,
304
+ " \xB7",
305
+ " ",
306
+ displayLog.messageCount,
307
+ " messages",
308
+ t14
309
+ ]
310
+ }, undefined, true, undefined, this);
311
+ $[23] = displayLog.messageCount;
312
+ $[24] = t13;
313
+ $[25] = t14;
314
+ $[26] = t15;
315
+ } else {
316
+ t15 = $[26];
317
+ }
318
+ let t16;
319
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
320
+ t16 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
321
+ dimColor: true,
322
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
323
+ children: [
324
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
325
+ shortcut: "Enter",
326
+ action: "resume"
327
+ }, undefined, false, undefined, this),
328
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
329
+ action: "confirm:no",
330
+ context: "Confirmation",
331
+ fallback: "Esc",
332
+ description: "cancel"
333
+ }, undefined, false, undefined, this)
334
+ ]
335
+ }, undefined, true, undefined, this)
336
+ }, undefined, false, undefined, this);
337
+ $[27] = t16;
338
+ } else {
339
+ t16 = $[27];
340
+ }
341
+ let t17;
342
+ if ($[28] !== t15) {
343
+ t17 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
344
+ flexShrink: 0,
345
+ flexDirection: "column",
346
+ borderTopDimColor: true,
347
+ borderBottom: false,
348
+ borderLeft: false,
349
+ borderRight: false,
350
+ borderStyle: "single",
351
+ paddingLeft: 2,
352
+ children: [
353
+ t15,
354
+ t16
355
+ ]
356
+ }, undefined, true, undefined, this);
357
+ $[28] = t15;
358
+ $[29] = t17;
359
+ } else {
360
+ t17 = $[29];
361
+ }
362
+ let t18;
363
+ if ($[30] !== t12 || $[31] !== t17) {
364
+ t18 = /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
365
+ flexDirection: "column",
366
+ children: [
367
+ t12,
368
+ t17
369
+ ]
370
+ }, undefined, true, undefined, this);
371
+ $[30] = t12;
372
+ $[31] = t17;
373
+ $[32] = t18;
374
+ } else {
375
+ t18 = $[32];
376
+ }
377
+ return t18;
378
+ }
379
+ var import_compiler_runtime, import_react, jsx_dev_runtime;
380
+ var init_SessionPreview = __esm(() => {
381
+ init_ink();
382
+ init_useKeybinding();
383
+ init_tools();
384
+ init_format();
385
+ init_sessionStorage();
386
+ init_ConfigurableShortcutHint();
387
+ init_Byline();
388
+ init_KeyboardShortcutHint();
389
+ init_LoadingState();
390
+ init_Messages();
391
+ import_compiler_runtime = __toESM(require_compiler_runtime(), 1);
392
+ import_react = __toESM(require_react(), 1);
393
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
394
+ });
395
+
396
+ // src/components/TagTabs.tsx
397
+ function getTabWidth(tab, maxWidth) {
398
+ if (tab === ALL_TAB_LABEL) {
399
+ return ALL_TAB_LABEL.length + TAB_PADDING;
400
+ }
401
+ const tagWidth = stringWidth(tab);
402
+ const effectiveTagWidth = maxWidth ? Math.min(tagWidth, maxWidth - TAB_PADDING - HASH_PREFIX_LENGTH) : tagWidth;
403
+ return Math.max(0, effectiveTagWidth) + TAB_PADDING + HASH_PREFIX_LENGTH;
404
+ }
405
+ function truncateTag(tag, maxWidth) {
406
+ const availableForTag = maxWidth - TAB_PADDING - HASH_PREFIX_LENGTH;
407
+ if (stringWidth(tag) <= availableForTag) {
408
+ return tag;
409
+ }
410
+ if (availableForTag <= 1) {
411
+ return tag.charAt(0);
412
+ }
413
+ return truncateToWidth(tag, availableForTag);
414
+ }
415
+ function TagTabs({
416
+ tabs,
417
+ selectedIndex,
418
+ availableWidth,
419
+ showAllProjects = false
420
+ }) {
421
+ const resumeLabel = showAllProjects ? "Resume (All Projects)" : "Resume";
422
+ const resumeLabelWidth = resumeLabel.length + 1;
423
+ const rightHintWidth = Math.max(RIGHT_HINT_WIDTH_WITH_COUNT, RIGHT_HINT_WIDTH_NO_COUNT);
424
+ const maxTabsWidth = availableWidth - resumeLabelWidth - rightHintWidth - 2;
425
+ const safeSelectedIndex = Math.max(0, Math.min(selectedIndex, tabs.length - 1));
426
+ const maxSingleTabWidth = Math.max(20, Math.floor(maxTabsWidth / 2));
427
+ const tabWidths = tabs.map((tab) => getTabWidth(tab, maxSingleTabWidth));
428
+ let startIndex = 0;
429
+ let endIndex = tabs.length;
430
+ const totalTabsWidth = tabWidths.reduce((sum, w, i) => sum + w + (i < tabWidths.length - 1 ? 1 : 0), 0);
431
+ if (totalTabsWidth > maxTabsWidth) {
432
+ const effectiveMaxWidth = maxTabsWidth - LEFT_ARROW_WIDTH;
433
+ let windowWidth = tabWidths[safeSelectedIndex] ?? 0;
434
+ startIndex = safeSelectedIndex;
435
+ endIndex = safeSelectedIndex + 1;
436
+ while (startIndex > 0 || endIndex < tabs.length) {
437
+ const canExpandLeft = startIndex > 0;
438
+ const canExpandRight = endIndex < tabs.length;
439
+ if (canExpandLeft) {
440
+ const leftWidth = (tabWidths[startIndex - 1] ?? 0) + 1;
441
+ if (windowWidth + leftWidth <= effectiveMaxWidth) {
442
+ startIndex--;
443
+ windowWidth += leftWidth;
444
+ continue;
445
+ }
446
+ }
447
+ if (canExpandRight) {
448
+ const rightWidth = (tabWidths[endIndex] ?? 0) + 1;
449
+ if (windowWidth + rightWidth <= effectiveMaxWidth) {
450
+ endIndex++;
451
+ windowWidth += rightWidth;
452
+ continue;
453
+ }
454
+ }
455
+ break;
456
+ }
457
+ }
458
+ const hiddenLeft = startIndex;
459
+ const hiddenRight = tabs.length - endIndex;
460
+ const visibleTabs = tabs.slice(startIndex, endIndex);
461
+ const visibleIndices = visibleTabs.map((_, i_0) => startIndex + i_0);
462
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
463
+ flexDirection: "row",
464
+ gap: 1,
465
+ children: [
466
+ /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
467
+ color: "suggestion",
468
+ children: resumeLabel
469
+ }, undefined, false, undefined, this),
470
+ hiddenLeft > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
471
+ dimColor: true,
472
+ children: [
473
+ LEFT_ARROW_PREFIX,
474
+ hiddenLeft
475
+ ]
476
+ }, undefined, true, undefined, this),
477
+ visibleTabs.map((tab_0, i_1) => {
478
+ const actualIndex = visibleIndices[i_1];
479
+ const isSelected = actualIndex === safeSelectedIndex;
480
+ const displayText = tab_0 === ALL_TAB_LABEL ? tab_0 : `#${truncateTag(tab_0, maxSingleTabWidth - TAB_PADDING)}`;
481
+ return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
482
+ backgroundColor: isSelected ? "suggestion" : undefined,
483
+ color: isSelected ? "inverseText" : undefined,
484
+ bold: isSelected,
485
+ children: [
486
+ " ",
487
+ displayText,
488
+ " "
489
+ ]
490
+ }, tab_0, true, undefined, this);
491
+ }),
492
+ hiddenRight > 0 ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
493
+ dimColor: true,
494
+ children: [
495
+ RIGHT_HINT_WITH_COUNT_PREFIX,
496
+ hiddenRight,
497
+ RIGHT_HINT_SUFFIX
498
+ ]
499
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
500
+ dimColor: true,
501
+ children: RIGHT_HINT_NO_COUNT
502
+ }, undefined, false, undefined, this)
503
+ ]
504
+ }, undefined, true, undefined, this);
505
+ }
506
+ var jsx_dev_runtime2, ALL_TAB_LABEL = "All", TAB_PADDING = 2, HASH_PREFIX_LENGTH = 1, LEFT_ARROW_PREFIX = "\u2190 ", RIGHT_HINT_WITH_COUNT_PREFIX = "\u2192", RIGHT_HINT_SUFFIX = " (tab to cycle)", RIGHT_HINT_NO_COUNT = "(tab to cycle)", MAX_OVERFLOW_DIGITS = 2, LEFT_ARROW_WIDTH, RIGHT_HINT_WIDTH_WITH_COUNT, RIGHT_HINT_WIDTH_NO_COUNT;
507
+ var init_TagTabs = __esm(() => {
508
+ init_stringWidth();
509
+ init_ink();
510
+ init_format();
511
+ jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
512
+ LEFT_ARROW_WIDTH = LEFT_ARROW_PREFIX.length + MAX_OVERFLOW_DIGITS + 1;
513
+ RIGHT_HINT_WIDTH_WITH_COUNT = RIGHT_HINT_WITH_COUNT_PREFIX.length + MAX_OVERFLOW_DIGITS + RIGHT_HINT_SUFFIX.length;
514
+ RIGHT_HINT_WIDTH_NO_COUNT = RIGHT_HINT_NO_COUNT.length;
515
+ });
516
+
517
+ // src/components/ui/TreeSelect.tsx
518
+ function TreeSelect(t0) {
519
+ const $ = import_compiler_runtime2.c(48);
520
+ const {
521
+ nodes,
522
+ onSelect,
523
+ onCancel,
524
+ onFocus,
525
+ focusNodeId,
526
+ visibleOptionCount,
527
+ layout: t1,
528
+ isDisabled: t2,
529
+ hideIndexes: t3,
530
+ isNodeExpanded,
531
+ onExpand,
532
+ onCollapse,
533
+ getParentPrefix,
534
+ getChildPrefix,
535
+ onUpFromFirstItem
536
+ } = t0;
537
+ const layout = t1 === undefined ? "expanded" : t1;
538
+ const isDisabled = t2 === undefined ? false : t2;
539
+ const hideIndexes = t3 === undefined ? false : t3;
540
+ let t4;
541
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
542
+ t4 = new Set;
543
+ $[0] = t4;
544
+ } else {
545
+ t4 = $[0];
546
+ }
547
+ const [internalExpandedIds, setInternalExpandedIds] = import_react2.default.useState(t4);
548
+ const isProgrammaticFocusRef = import_react2.default.useRef(false);
549
+ const lastFocusedIdRef = import_react2.default.useRef(null);
550
+ let t5;
551
+ if ($[1] !== internalExpandedIds || $[2] !== isNodeExpanded) {
552
+ t5 = (nodeId) => {
553
+ if (isNodeExpanded) {
554
+ return isNodeExpanded(nodeId);
555
+ }
556
+ return internalExpandedIds.has(nodeId);
557
+ };
558
+ $[1] = internalExpandedIds;
559
+ $[2] = isNodeExpanded;
560
+ $[3] = t5;
561
+ } else {
562
+ t5 = $[3];
563
+ }
564
+ const isExpanded = t5;
565
+ let result;
566
+ if ($[4] !== isExpanded || $[5] !== nodes) {
567
+ let traverse = function(node, depth, parentId) {
568
+ const hasChildren = !!node.children && node.children.length > 0;
569
+ const nodeIsExpanded = isExpanded(node.id);
570
+ result.push({
571
+ node,
572
+ depth,
573
+ isExpanded: nodeIsExpanded,
574
+ hasChildren,
575
+ parentId
576
+ });
577
+ if (hasChildren && nodeIsExpanded && node.children) {
578
+ for (const child of node.children) {
579
+ traverse(child, depth + 1, node.id);
580
+ }
581
+ }
582
+ };
583
+ result = [];
584
+ for (const node_0 of nodes) {
585
+ traverse(node_0, 0, undefined);
586
+ }
587
+ $[4] = isExpanded;
588
+ $[5] = nodes;
589
+ $[6] = result;
590
+ } else {
591
+ result = $[6];
592
+ }
593
+ const flattenedNodes = result;
594
+ const defaultGetParentPrefix = _temp;
595
+ const defaultGetChildPrefix = _temp2;
596
+ const parentPrefixFn = getParentPrefix ?? defaultGetParentPrefix;
597
+ const childPrefixFn = getChildPrefix ?? defaultGetChildPrefix;
598
+ let t6;
599
+ if ($[7] !== childPrefixFn || $[8] !== parentPrefixFn) {
600
+ t6 = (flatNode) => {
601
+ let prefix = "";
602
+ if (flatNode.hasChildren) {
603
+ prefix = parentPrefixFn(flatNode.isExpanded);
604
+ } else {
605
+ if (flatNode.depth > 0) {
606
+ prefix = childPrefixFn(flatNode.depth);
607
+ }
608
+ }
609
+ return prefix + flatNode.node.label;
610
+ };
611
+ $[7] = childPrefixFn;
612
+ $[8] = parentPrefixFn;
613
+ $[9] = t6;
614
+ } else {
615
+ t6 = $[9];
616
+ }
617
+ const buildLabel = t6;
618
+ let t7;
619
+ if ($[10] !== buildLabel || $[11] !== flattenedNodes) {
620
+ t7 = flattenedNodes.map((flatNode_0) => ({
621
+ label: buildLabel(flatNode_0),
622
+ description: flatNode_0.node.description,
623
+ dimDescription: flatNode_0.node.dimDescription ?? true,
624
+ value: flatNode_0.node.id
625
+ }));
626
+ $[10] = buildLabel;
627
+ $[11] = flattenedNodes;
628
+ $[12] = t7;
629
+ } else {
630
+ t7 = $[12];
631
+ }
632
+ const options = t7;
633
+ let map;
634
+ if ($[13] !== flattenedNodes) {
635
+ map = new Map;
636
+ flattenedNodes.forEach((fn) => map.set(fn.node.id, fn.node));
637
+ $[13] = flattenedNodes;
638
+ $[14] = map;
639
+ } else {
640
+ map = $[14];
641
+ }
642
+ const nodeMap = map;
643
+ let t8;
644
+ if ($[15] !== flattenedNodes) {
645
+ t8 = (nodeId_0) => flattenedNodes.find((fn_0) => fn_0.node.id === nodeId_0);
646
+ $[15] = flattenedNodes;
647
+ $[16] = t8;
648
+ } else {
649
+ t8 = $[16];
650
+ }
651
+ const findFlattenedNode = t8;
652
+ let t9;
653
+ if ($[17] !== findFlattenedNode || $[18] !== onCollapse || $[19] !== onExpand) {
654
+ t9 = (nodeId_1, shouldExpand) => {
655
+ const flatNode_1 = findFlattenedNode(nodeId_1);
656
+ if (!flatNode_1 || !flatNode_1.hasChildren) {
657
+ return;
658
+ }
659
+ if (shouldExpand) {
660
+ if (onExpand) {
661
+ onExpand(nodeId_1);
662
+ } else {
663
+ setInternalExpandedIds((prev) => new Set(prev).add(nodeId_1));
664
+ }
665
+ } else {
666
+ if (onCollapse) {
667
+ onCollapse(nodeId_1);
668
+ } else {
669
+ setInternalExpandedIds((prev_0) => {
670
+ const newSet = new Set(prev_0);
671
+ newSet.delete(nodeId_1);
672
+ return newSet;
673
+ });
674
+ }
675
+ }
676
+ };
677
+ $[17] = findFlattenedNode;
678
+ $[18] = onCollapse;
679
+ $[19] = onExpand;
680
+ $[20] = t9;
681
+ } else {
682
+ t9 = $[20];
683
+ }
684
+ const toggleExpand = t9;
685
+ let t10;
686
+ if ($[21] !== findFlattenedNode || $[22] !== focusNodeId || $[23] !== isDisabled || $[24] !== nodeMap || $[25] !== onFocus || $[26] !== toggleExpand) {
687
+ t10 = (e) => {
688
+ if (!focusNodeId || isDisabled) {
689
+ return;
690
+ }
691
+ const flatNode_2 = findFlattenedNode(focusNodeId);
692
+ if (!flatNode_2) {
693
+ return;
694
+ }
695
+ if (e.key === "right" && flatNode_2.hasChildren) {
696
+ e.preventDefault();
697
+ toggleExpand(focusNodeId, true);
698
+ } else {
699
+ if (e.key === "left") {
700
+ if (flatNode_2.hasChildren && flatNode_2.isExpanded) {
701
+ e.preventDefault();
702
+ toggleExpand(focusNodeId, false);
703
+ } else {
704
+ if (flatNode_2.parentId !== undefined) {
705
+ e.preventDefault();
706
+ isProgrammaticFocusRef.current = true;
707
+ toggleExpand(flatNode_2.parentId, false);
708
+ if (onFocus) {
709
+ const parentNode = nodeMap.get(flatNode_2.parentId);
710
+ if (parentNode) {
711
+ onFocus(parentNode);
712
+ }
713
+ }
714
+ }
715
+ }
716
+ }
717
+ }
718
+ };
719
+ $[21] = findFlattenedNode;
720
+ $[22] = focusNodeId;
721
+ $[23] = isDisabled;
722
+ $[24] = nodeMap;
723
+ $[25] = onFocus;
724
+ $[26] = toggleExpand;
725
+ $[27] = t10;
726
+ } else {
727
+ t10 = $[27];
728
+ }
729
+ const handleKeyDown = t10;
730
+ let t11;
731
+ if ($[28] !== nodeMap || $[29] !== onSelect) {
732
+ t11 = (nodeId_2) => {
733
+ const node_1 = nodeMap.get(nodeId_2);
734
+ if (!node_1) {
735
+ return;
736
+ }
737
+ onSelect(node_1);
738
+ };
739
+ $[28] = nodeMap;
740
+ $[29] = onSelect;
741
+ $[30] = t11;
742
+ } else {
743
+ t11 = $[30];
744
+ }
745
+ const handleChange = t11;
746
+ let t12;
747
+ if ($[31] !== nodeMap || $[32] !== onFocus) {
748
+ t12 = (nodeId_3) => {
749
+ if (isProgrammaticFocusRef.current) {
750
+ isProgrammaticFocusRef.current = false;
751
+ return;
752
+ }
753
+ if (lastFocusedIdRef.current === nodeId_3) {
754
+ return;
755
+ }
756
+ lastFocusedIdRef.current = nodeId_3;
757
+ if (onFocus) {
758
+ const node_2 = nodeMap.get(nodeId_3);
759
+ if (node_2) {
760
+ onFocus(node_2);
761
+ }
762
+ }
763
+ };
764
+ $[31] = nodeMap;
765
+ $[32] = onFocus;
766
+ $[33] = t12;
767
+ } else {
768
+ t12 = $[33];
769
+ }
770
+ const handleFocus = t12;
771
+ let t13;
772
+ if ($[34] !== focusNodeId || $[35] !== handleChange || $[36] !== handleFocus || $[37] !== hideIndexes || $[38] !== isDisabled || $[39] !== layout || $[40] !== onCancel || $[41] !== onUpFromFirstItem || $[42] !== options || $[43] !== visibleOptionCount) {
773
+ t13 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Select, {
774
+ options,
775
+ onChange: handleChange,
776
+ onFocus: handleFocus,
777
+ onCancel,
778
+ defaultFocusValue: focusNodeId,
779
+ visibleOptionCount,
780
+ layout,
781
+ isDisabled,
782
+ hideIndexes,
783
+ onUpFromFirstItem
784
+ }, undefined, false, undefined, this);
785
+ $[34] = focusNodeId;
786
+ $[35] = handleChange;
787
+ $[36] = handleFocus;
788
+ $[37] = hideIndexes;
789
+ $[38] = isDisabled;
790
+ $[39] = layout;
791
+ $[40] = onCancel;
792
+ $[41] = onUpFromFirstItem;
793
+ $[42] = options;
794
+ $[43] = visibleOptionCount;
795
+ $[44] = t13;
796
+ } else {
797
+ t13 = $[44];
798
+ }
799
+ let t14;
800
+ if ($[45] !== handleKeyDown || $[46] !== t13) {
801
+ t14 = /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
802
+ tabIndex: 0,
803
+ autoFocus: true,
804
+ onKeyDown: handleKeyDown,
805
+ children: t13
806
+ }, undefined, false, undefined, this);
807
+ $[45] = handleKeyDown;
808
+ $[46] = t13;
809
+ $[47] = t14;
810
+ } else {
811
+ t14 = $[47];
812
+ }
813
+ return t14;
814
+ }
815
+ function _temp2(_depth) {
816
+ return " \u25B8 ";
817
+ }
818
+ function _temp(isExpanded_0) {
819
+ return isExpanded_0 ? "\u25BC " : "\u25B6 ";
820
+ }
821
+ var import_compiler_runtime2, import_react2, jsx_dev_runtime3;
822
+ var init_TreeSelect = __esm(() => {
823
+ init_ink();
824
+ init_select();
825
+ import_compiler_runtime2 = __toESM(require_compiler_runtime(), 1);
826
+ import_react2 = __toESM(require_react(), 1);
827
+ jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
828
+ });
829
+
830
+ // src/components/LogSelector.tsx
831
+ function normalizeAndTruncateToWidth(text, maxWidth) {
832
+ const normalized = text.replace(/\s+/g, " ").trim();
833
+ return truncateToWidth(normalized, maxWidth);
834
+ }
835
+ function formatSnippet({
836
+ before,
837
+ match,
838
+ after
839
+ }, highlightColor) {
840
+ return source_default.dim(before) + highlightColor(match) + source_default.dim(after);
841
+ }
842
+ function extractSnippet(text, query, contextChars) {
843
+ const matchIndex = text.toLowerCase().indexOf(query.toLowerCase());
844
+ if (matchIndex === -1)
845
+ return null;
846
+ const matchEnd = matchIndex + query.length;
847
+ const snippetStart = Math.max(0, matchIndex - contextChars);
848
+ const snippetEnd = Math.min(text.length, matchEnd + contextChars);
849
+ const beforeRaw = text.slice(snippetStart, matchIndex);
850
+ const matchText = text.slice(matchIndex, matchEnd);
851
+ const afterRaw = text.slice(matchEnd, snippetEnd);
852
+ return {
853
+ before: (snippetStart > 0 ? "\u2026" : "") + beforeRaw.replace(/\s+/g, " ").trimStart(),
854
+ match: matchText.trim(),
855
+ after: afterRaw.replace(/\s+/g, " ").trimEnd() + (snippetEnd < text.length ? "\u2026" : "")
856
+ };
857
+ }
858
+ function buildLogLabel(log, maxLabelWidth, options) {
859
+ const {
860
+ isGroupHeader = false,
861
+ isChild = false,
862
+ forkCount = 0
863
+ } = options || {};
864
+ const prefixWidth = isGroupHeader && forkCount > 0 ? PARENT_PREFIX_WIDTH : isChild ? CHILD_PREFIX_WIDTH : 0;
865
+ const sessionCountSuffix = isGroupHeader && forkCount > 0 ? ` (+${forkCount} other ${forkCount === 1 ? "session" : "sessions"})` : "";
866
+ const sidechainSuffix = log.isSidechain ? " (sidechain)" : "";
867
+ const maxSummaryWidth = maxLabelWidth - prefixWidth - sidechainSuffix.length - sessionCountSuffix.length;
868
+ const truncatedSummary = normalizeAndTruncateToWidth(getLogDisplayTitle(log), maxSummaryWidth);
869
+ return `${truncatedSummary}${sidechainSuffix}${sessionCountSuffix}`;
870
+ }
871
+ function buildLogMetadata(log, options) {
872
+ const {
873
+ isChild = false,
874
+ showProjectPath = false
875
+ } = options || {};
876
+ const childPadding = isChild ? " " : "";
877
+ const baseMetadata = formatLogMetadata(log);
878
+ const projectSuffix = showProjectPath && log.projectPath ? ` \xB7 ${log.projectPath}` : "";
879
+ return childPadding + baseMetadata + projectSuffix;
880
+ }
881
+ function LogSelector(t0) {
882
+ const $ = import_compiler_runtime3.c(247);
883
+ const {
884
+ logs,
885
+ maxHeight: t1,
886
+ forceWidth,
887
+ onCancel,
888
+ onSelect,
889
+ onLogsChanged,
890
+ onLoadMore,
891
+ initialSearchQuery,
892
+ showAllProjects: t2,
893
+ onToggleAllProjects,
894
+ onAgenticSearch
895
+ } = t0;
896
+ const maxHeight = t1 === undefined ? Infinity : t1;
897
+ const showAllProjects = t2 === undefined ? false : t2;
898
+ const terminalSize = useTerminalSize();
899
+ const columns = forceWidth === undefined ? terminalSize.columns : forceWidth;
900
+ const exitState = useExitOnCtrlCDWithKeybindings(onCancel);
901
+ const isTerminalFocused = useTerminalFocus();
902
+ let t3;
903
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
904
+ t3 = isCustomTitleEnabled();
905
+ $[0] = t3;
906
+ } else {
907
+ t3 = $[0];
908
+ }
909
+ const isResumeWithRenameEnabled = t3;
910
+ const isDeepSearchEnabled = false;
911
+ const [themeName] = useTheme();
912
+ let t4;
913
+ if ($[1] !== themeName) {
914
+ t4 = getTheme(themeName);
915
+ $[1] = themeName;
916
+ $[2] = t4;
917
+ } else {
918
+ t4 = $[2];
919
+ }
920
+ const theme = t4;
921
+ let t5;
922
+ if ($[3] !== theme.warning) {
923
+ t5 = (text) => applyColor(text, theme.warning);
924
+ $[3] = theme.warning;
925
+ $[4] = t5;
926
+ } else {
927
+ t5 = $[4];
928
+ }
929
+ const highlightColor = t5;
930
+ const isAgenticSearchEnabled = false;
931
+ const [currentBranch, setCurrentBranch] = import_react3.default.useState(null);
932
+ const [branchFilterEnabled, setBranchFilterEnabled] = import_react3.default.useState(false);
933
+ const [showAllWorktrees, setShowAllWorktrees] = import_react3.default.useState(false);
934
+ const [hasMultipleWorktrees, setHasMultipleWorktrees] = import_react3.default.useState(false);
935
+ let t6;
936
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
937
+ t6 = getOriginalCwd();
938
+ $[5] = t6;
939
+ } else {
940
+ t6 = $[5];
941
+ }
942
+ const currentCwd = t6;
943
+ const [renameValue, setRenameValue] = import_react3.default.useState("");
944
+ const [renameCursorOffset, setRenameCursorOffset] = import_react3.default.useState(0);
945
+ let t7;
946
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
947
+ t7 = new Set;
948
+ $[6] = t7;
949
+ } else {
950
+ t7 = $[6];
951
+ }
952
+ const [expandedGroupSessionIds, setExpandedGroupSessionIds] = import_react3.default.useState(t7);
953
+ const [focusedNode, setFocusedNode] = import_react3.default.useState(null);
954
+ const [focusedIndex, setFocusedIndex] = import_react3.default.useState(1);
955
+ const [viewMode, setViewMode] = import_react3.default.useState("list");
956
+ const [previewLog, setPreviewLog] = import_react3.default.useState(null);
957
+ const prevFocusedIdRef = import_react3.default.useRef(null);
958
+ const [selectedTagIndex, setSelectedTagIndex] = import_react3.default.useState(0);
959
+ let t8;
960
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
961
+ t8 = {
962
+ status: "idle"
963
+ };
964
+ $[7] = t8;
965
+ } else {
966
+ t8 = $[7];
967
+ }
968
+ const [agenticSearchState, setAgenticSearchState] = import_react3.default.useState(t8);
969
+ const [isAgenticSearchOptionFocused, setIsAgenticSearchOptionFocused] = import_react3.default.useState(false);
970
+ const agenticSearchAbortRef = import_react3.default.useRef(null);
971
+ const t9 = viewMode === "search" && agenticSearchState.status !== "searching";
972
+ let t10;
973
+ let t11;
974
+ let t12;
975
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
976
+ t10 = () => {
977
+ setViewMode("list");
978
+ logEvent("tengu_session_search_toggled", {
979
+ enabled: false
980
+ });
981
+ };
982
+ t11 = () => {
983
+ setViewMode("list");
984
+ logEvent("tengu_session_search_toggled", {
985
+ enabled: false
986
+ });
987
+ };
988
+ t12 = ["n"];
989
+ $[8] = t10;
990
+ $[9] = t11;
991
+ $[10] = t12;
992
+ } else {
993
+ t10 = $[8];
994
+ t11 = $[9];
995
+ t12 = $[10];
996
+ }
997
+ const t13 = initialSearchQuery || "";
998
+ let t14;
999
+ if ($[11] !== t13 || $[12] !== t9) {
1000
+ t14 = {
1001
+ isActive: t9,
1002
+ onExit: t10,
1003
+ onExitUp: t11,
1004
+ passthroughCtrlKeys: t12,
1005
+ initialQuery: t13
1006
+ };
1007
+ $[11] = t13;
1008
+ $[12] = t9;
1009
+ $[13] = t14;
1010
+ } else {
1011
+ t14 = $[13];
1012
+ }
1013
+ const {
1014
+ query: searchQuery,
1015
+ setQuery: setSearchQuery,
1016
+ cursorOffset: searchCursorOffset
1017
+ } = useSearchInput(t14);
1018
+ const deferredSearchQuery = import_react3.default.useDeferredValue(searchQuery);
1019
+ const [debouncedDeepSearchQuery, setDebouncedDeepSearchQuery] = import_react3.default.useState("");
1020
+ let t15;
1021
+ let t16;
1022
+ if ($[14] !== deferredSearchQuery) {
1023
+ t15 = () => {
1024
+ if (!deferredSearchQuery) {
1025
+ setDebouncedDeepSearchQuery("");
1026
+ return;
1027
+ }
1028
+ const timeoutId = setTimeout(setDebouncedDeepSearchQuery, 300, deferredSearchQuery);
1029
+ return () => clearTimeout(timeoutId);
1030
+ };
1031
+ t16 = [deferredSearchQuery];
1032
+ $[14] = deferredSearchQuery;
1033
+ $[15] = t15;
1034
+ $[16] = t16;
1035
+ } else {
1036
+ t15 = $[15];
1037
+ t16 = $[16];
1038
+ }
1039
+ import_react3.default.useEffect(t15, t16);
1040
+ const [deepSearchResults, setDeepSearchResults] = import_react3.default.useState(null);
1041
+ const [isSearching, setIsSearching] = import_react3.default.useState(false);
1042
+ let t17;
1043
+ let t18;
1044
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
1045
+ t17 = () => {
1046
+ getBranch().then((branch) => setCurrentBranch(branch));
1047
+ getWorktreePaths(currentCwd).then((paths) => {
1048
+ setHasMultipleWorktrees(paths.length > 1);
1049
+ });
1050
+ };
1051
+ t18 = [currentCwd];
1052
+ $[17] = t17;
1053
+ $[18] = t18;
1054
+ } else {
1055
+ t17 = $[17];
1056
+ t18 = $[18];
1057
+ }
1058
+ import_react3.default.useEffect(t17, t18);
1059
+ const searchableTextByLog = new Map(logs.map(_temp8));
1060
+ let t19;
1061
+ t19 = null;
1062
+ let t20;
1063
+ if ($[19] !== logs) {
1064
+ t20 = getUniqueTags(logs);
1065
+ $[19] = logs;
1066
+ $[20] = t20;
1067
+ } else {
1068
+ t20 = $[20];
1069
+ }
1070
+ const uniqueTags = t20;
1071
+ const hasTags = uniqueTags.length > 0;
1072
+ let t21;
1073
+ if ($[21] !== hasTags || $[22] !== uniqueTags) {
1074
+ t21 = hasTags ? ["All", ...uniqueTags] : [];
1075
+ $[21] = hasTags;
1076
+ $[22] = uniqueTags;
1077
+ $[23] = t21;
1078
+ } else {
1079
+ t21 = $[23];
1080
+ }
1081
+ const tagTabs = t21;
1082
+ const effectiveTagIndex = tagTabs.length > 0 && selectedTagIndex < tagTabs.length ? selectedTagIndex : 0;
1083
+ const selectedTab = tagTabs[effectiveTagIndex];
1084
+ const tagFilter = selectedTab === "All" ? undefined : selectedTab;
1085
+ const tagTabsLines = hasTags ? 1 : 0;
1086
+ let filtered = logs;
1087
+ if (isResumeWithRenameEnabled) {
1088
+ let t222;
1089
+ if ($[24] !== logs) {
1090
+ t222 = logs.filter(_temp22);
1091
+ $[24] = logs;
1092
+ $[25] = t222;
1093
+ } else {
1094
+ t222 = $[25];
1095
+ }
1096
+ filtered = t222;
1097
+ }
1098
+ if (tagFilter !== undefined) {
1099
+ let t222;
1100
+ if ($[26] !== filtered || $[27] !== tagFilter) {
1101
+ let t232;
1102
+ if ($[29] !== tagFilter) {
1103
+ t232 = (log_2) => log_2.tag === tagFilter;
1104
+ $[29] = tagFilter;
1105
+ $[30] = t232;
1106
+ } else {
1107
+ t232 = $[30];
1108
+ }
1109
+ t222 = filtered.filter(t232);
1110
+ $[26] = filtered;
1111
+ $[27] = tagFilter;
1112
+ $[28] = t222;
1113
+ } else {
1114
+ t222 = $[28];
1115
+ }
1116
+ filtered = t222;
1117
+ }
1118
+ if (branchFilterEnabled && currentBranch) {
1119
+ let t222;
1120
+ if ($[31] !== currentBranch || $[32] !== filtered) {
1121
+ let t232;
1122
+ if ($[34] !== currentBranch) {
1123
+ t232 = (log_3) => log_3.gitBranch === currentBranch;
1124
+ $[34] = currentBranch;
1125
+ $[35] = t232;
1126
+ } else {
1127
+ t232 = $[35];
1128
+ }
1129
+ t222 = filtered.filter(t232);
1130
+ $[31] = currentBranch;
1131
+ $[32] = filtered;
1132
+ $[33] = t222;
1133
+ } else {
1134
+ t222 = $[33];
1135
+ }
1136
+ filtered = t222;
1137
+ }
1138
+ if (hasMultipleWorktrees && !showAllWorktrees) {
1139
+ let t222;
1140
+ if ($[36] !== filtered) {
1141
+ let t232;
1142
+ if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
1143
+ t232 = (log_4) => log_4.projectPath === currentCwd;
1144
+ $[38] = t232;
1145
+ } else {
1146
+ t232 = $[38];
1147
+ }
1148
+ t222 = filtered.filter(t232);
1149
+ $[36] = filtered;
1150
+ $[37] = t222;
1151
+ } else {
1152
+ t222 = $[37];
1153
+ }
1154
+ filtered = t222;
1155
+ }
1156
+ const baseFilteredLogs = filtered;
1157
+ let t22;
1158
+ bb0: {
1159
+ if (!searchQuery) {
1160
+ t22 = baseFilteredLogs;
1161
+ break bb0;
1162
+ }
1163
+ let t232;
1164
+ if ($[39] !== baseFilteredLogs || $[40] !== searchQuery) {
1165
+ const query = searchQuery.toLowerCase();
1166
+ t232 = baseFilteredLogs.filter((log_5) => {
1167
+ const displayedTitle = getLogDisplayTitle(log_5).toLowerCase();
1168
+ const branch_0 = (log_5.gitBranch || "").toLowerCase();
1169
+ const tag = (log_5.tag || "").toLowerCase();
1170
+ const prInfo = log_5.prNumber ? `pr #${log_5.prNumber} ${log_5.prRepository || ""}`.toLowerCase() : "";
1171
+ return displayedTitle.includes(query) || branch_0.includes(query) || tag.includes(query) || prInfo.includes(query);
1172
+ });
1173
+ $[39] = baseFilteredLogs;
1174
+ $[40] = searchQuery;
1175
+ $[41] = t232;
1176
+ } else {
1177
+ t232 = $[41];
1178
+ }
1179
+ t22 = t232;
1180
+ }
1181
+ const titleFilteredLogs = t22;
1182
+ let t23;
1183
+ let t24;
1184
+ if ($[42] !== debouncedDeepSearchQuery || $[43] !== deferredSearchQuery) {
1185
+ t23 = () => {
1186
+ if (false) {}
1187
+ };
1188
+ t24 = [deferredSearchQuery, debouncedDeepSearchQuery, false];
1189
+ $[42] = debouncedDeepSearchQuery;
1190
+ $[43] = deferredSearchQuery;
1191
+ $[44] = t23;
1192
+ $[45] = t24;
1193
+ } else {
1194
+ t23 = $[44];
1195
+ t24 = $[45];
1196
+ }
1197
+ import_react3.default.useEffect(t23, t24);
1198
+ let t25;
1199
+ let t26;
1200
+ if ($[46] !== debouncedDeepSearchQuery) {
1201
+ t25 = () => {
1202
+ if (true) {
1203
+ setDeepSearchResults(null);
1204
+ setIsSearching(false);
1205
+ return;
1206
+ }
1207
+ const timeoutId_0 = setTimeout(_temp5, 0, null, debouncedDeepSearchQuery, setDeepSearchResults, setIsSearching);
1208
+ return () => {
1209
+ clearTimeout(timeoutId_0);
1210
+ };
1211
+ };
1212
+ t26 = [debouncedDeepSearchQuery, null, false];
1213
+ $[46] = debouncedDeepSearchQuery;
1214
+ $[47] = t25;
1215
+ $[48] = t26;
1216
+ } else {
1217
+ t25 = $[47];
1218
+ t26 = $[48];
1219
+ }
1220
+ import_react3.default.useEffect(t25, t26);
1221
+ let filtered_0;
1222
+ let snippetMap;
1223
+ if ($[49] !== debouncedDeepSearchQuery || $[50] !== deepSearchResults || $[51] !== titleFilteredLogs) {
1224
+ snippetMap = new Map;
1225
+ filtered_0 = titleFilteredLogs;
1226
+ if (deepSearchResults && debouncedDeepSearchQuery && deepSearchResults.query === debouncedDeepSearchQuery) {
1227
+ for (const result of deepSearchResults.results) {
1228
+ if (result.searchableText) {
1229
+ const snippet = extractSnippet(result.searchableText, debouncedDeepSearchQuery, SNIPPET_CONTEXT_CHARS);
1230
+ if (snippet) {
1231
+ snippetMap.set(result.log, snippet);
1232
+ }
1233
+ }
1234
+ }
1235
+ let t272;
1236
+ if ($[54] !== filtered_0) {
1237
+ t272 = new Set(filtered_0.map(_temp6));
1238
+ $[54] = filtered_0;
1239
+ $[55] = t272;
1240
+ } else {
1241
+ t272 = $[55];
1242
+ }
1243
+ const titleMatchIds = t272;
1244
+ let t282;
1245
+ if ($[56] !== deepSearchResults.results || $[57] !== filtered_0 || $[58] !== titleMatchIds) {
1246
+ let t292;
1247
+ if ($[60] !== titleMatchIds) {
1248
+ t292 = (log_7) => !titleMatchIds.has(log_7.messages[0]?.uuid);
1249
+ $[60] = titleMatchIds;
1250
+ $[61] = t292;
1251
+ } else {
1252
+ t292 = $[61];
1253
+ }
1254
+ const transcriptOnlyMatches = deepSearchResults.results.map(_temp7).filter(t292);
1255
+ t282 = [...filtered_0, ...transcriptOnlyMatches];
1256
+ $[56] = deepSearchResults.results;
1257
+ $[57] = filtered_0;
1258
+ $[58] = titleMatchIds;
1259
+ $[59] = t282;
1260
+ } else {
1261
+ t282 = $[59];
1262
+ }
1263
+ filtered_0 = t282;
1264
+ }
1265
+ $[49] = debouncedDeepSearchQuery;
1266
+ $[50] = deepSearchResults;
1267
+ $[51] = titleFilteredLogs;
1268
+ $[52] = filtered_0;
1269
+ $[53] = snippetMap;
1270
+ } else {
1271
+ filtered_0 = $[52];
1272
+ snippetMap = $[53];
1273
+ }
1274
+ let t27;
1275
+ if ($[62] !== filtered_0 || $[63] !== snippetMap) {
1276
+ t27 = {
1277
+ filteredLogs: filtered_0,
1278
+ snippets: snippetMap
1279
+ };
1280
+ $[62] = filtered_0;
1281
+ $[63] = snippetMap;
1282
+ $[64] = t27;
1283
+ } else {
1284
+ t27 = $[64];
1285
+ }
1286
+ const {
1287
+ filteredLogs,
1288
+ snippets
1289
+ } = t27;
1290
+ let t28;
1291
+ bb1: {
1292
+ if (agenticSearchState.status === "results" && agenticSearchState.results.length > 0) {
1293
+ t28 = agenticSearchState.results;
1294
+ break bb1;
1295
+ }
1296
+ t28 = filteredLogs;
1297
+ }
1298
+ const displayedLogs = t28;
1299
+ const maxLabelWidth = Math.max(30, columns - 4);
1300
+ let t29;
1301
+ bb2: {
1302
+ if (!isResumeWithRenameEnabled) {
1303
+ let t303;
1304
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
1305
+ t303 = [];
1306
+ $[65] = t303;
1307
+ } else {
1308
+ t303 = $[65];
1309
+ }
1310
+ t29 = t303;
1311
+ break bb2;
1312
+ }
1313
+ let t302;
1314
+ if ($[66] !== displayedLogs || $[67] !== highlightColor || $[68] !== maxLabelWidth || $[69] !== showAllProjects || $[70] !== snippets) {
1315
+ const sessionGroups = groupLogsBySessionId(displayedLogs);
1316
+ t302 = Array.from(sessionGroups.entries()).map((t312) => {
1317
+ const [sessionId, groupLogs] = t312;
1318
+ const latestLog = groupLogs[0];
1319
+ const indexInFiltered = displayedLogs.indexOf(latestLog);
1320
+ const snippet_0 = snippets.get(latestLog);
1321
+ const snippetStr = snippet_0 ? formatSnippet(snippet_0, highlightColor) : null;
1322
+ if (groupLogs.length === 1) {
1323
+ const metadata = buildLogMetadata(latestLog, {
1324
+ showProjectPath: showAllProjects
1325
+ });
1326
+ return {
1327
+ id: `log:${sessionId}:0`,
1328
+ value: {
1329
+ log: latestLog,
1330
+ indexInFiltered
1331
+ },
1332
+ label: buildLogLabel(latestLog, maxLabelWidth),
1333
+ description: snippetStr ? `${metadata}
1334
+ ${snippetStr}` : metadata,
1335
+ dimDescription: true
1336
+ };
1337
+ }
1338
+ const forkCount = groupLogs.length - 1;
1339
+ const children = groupLogs.slice(1).map((log_8, index) => {
1340
+ const childIndexInFiltered = displayedLogs.indexOf(log_8);
1341
+ const childSnippet = snippets.get(log_8);
1342
+ const childSnippetStr = childSnippet ? formatSnippet(childSnippet, highlightColor) : null;
1343
+ const childMetadata = buildLogMetadata(log_8, {
1344
+ isChild: true,
1345
+ showProjectPath: showAllProjects
1346
+ });
1347
+ return {
1348
+ id: `log:${sessionId}:${index + 1}`,
1349
+ value: {
1350
+ log: log_8,
1351
+ indexInFiltered: childIndexInFiltered
1352
+ },
1353
+ label: buildLogLabel(log_8, maxLabelWidth, {
1354
+ isChild: true
1355
+ }),
1356
+ description: childSnippetStr ? `${childMetadata}
1357
+ ${childSnippetStr}` : childMetadata,
1358
+ dimDescription: true
1359
+ };
1360
+ });
1361
+ const parentMetadata = buildLogMetadata(latestLog, {
1362
+ showProjectPath: showAllProjects
1363
+ });
1364
+ return {
1365
+ id: `group:${sessionId}`,
1366
+ value: {
1367
+ log: latestLog,
1368
+ indexInFiltered
1369
+ },
1370
+ label: buildLogLabel(latestLog, maxLabelWidth, {
1371
+ isGroupHeader: true,
1372
+ forkCount
1373
+ }),
1374
+ description: snippetStr ? `${parentMetadata}
1375
+ ${snippetStr}` : parentMetadata,
1376
+ dimDescription: true,
1377
+ children
1378
+ };
1379
+ });
1380
+ $[66] = displayedLogs;
1381
+ $[67] = highlightColor;
1382
+ $[68] = maxLabelWidth;
1383
+ $[69] = showAllProjects;
1384
+ $[70] = snippets;
1385
+ $[71] = t302;
1386
+ } else {
1387
+ t302 = $[71];
1388
+ }
1389
+ t29 = t302;
1390
+ }
1391
+ const treeNodes = t29;
1392
+ let t30;
1393
+ bb3: {
1394
+ if (isResumeWithRenameEnabled) {
1395
+ let t313;
1396
+ if ($[72] === Symbol.for("react.memo_cache_sentinel")) {
1397
+ t313 = [];
1398
+ $[72] = t313;
1399
+ } else {
1400
+ t313 = $[72];
1401
+ }
1402
+ t30 = t313;
1403
+ break bb3;
1404
+ }
1405
+ let t312;
1406
+ if ($[73] !== displayedLogs || $[74] !== highlightColor || $[75] !== maxLabelWidth || $[76] !== showAllProjects || $[77] !== snippets) {
1407
+ let t322;
1408
+ if ($[79] !== highlightColor || $[80] !== maxLabelWidth || $[81] !== showAllProjects || $[82] !== snippets) {
1409
+ t322 = (log_9, index_0) => {
1410
+ const rawSummary = getLogDisplayTitle(log_9);
1411
+ const summaryWithSidechain = rawSummary + (log_9.isSidechain ? " (sidechain)" : "");
1412
+ const summary = normalizeAndTruncateToWidth(summaryWithSidechain, maxLabelWidth);
1413
+ const baseDescription = formatLogMetadata(log_9);
1414
+ const projectSuffix = showAllProjects && log_9.projectPath ? ` \xB7 ${log_9.projectPath}` : "";
1415
+ const snippet_1 = snippets.get(log_9);
1416
+ const snippetStr_0 = snippet_1 ? formatSnippet(snippet_1, highlightColor) : null;
1417
+ return {
1418
+ label: summary,
1419
+ description: snippetStr_0 ? `${baseDescription}${projectSuffix}
1420
+ ${snippetStr_0}` : baseDescription + projectSuffix,
1421
+ dimDescription: true,
1422
+ value: index_0.toString()
1423
+ };
1424
+ };
1425
+ $[79] = highlightColor;
1426
+ $[80] = maxLabelWidth;
1427
+ $[81] = showAllProjects;
1428
+ $[82] = snippets;
1429
+ $[83] = t322;
1430
+ } else {
1431
+ t322 = $[83];
1432
+ }
1433
+ t312 = displayedLogs.map(t322);
1434
+ $[73] = displayedLogs;
1435
+ $[74] = highlightColor;
1436
+ $[75] = maxLabelWidth;
1437
+ $[76] = showAllProjects;
1438
+ $[77] = snippets;
1439
+ $[78] = t312;
1440
+ } else {
1441
+ t312 = $[78];
1442
+ }
1443
+ t30 = t312;
1444
+ }
1445
+ const flatOptions = t30;
1446
+ const focusedLog = focusedNode?.value.log ?? null;
1447
+ let t31;
1448
+ if ($[84] !== displayedLogs || $[85] !== expandedGroupSessionIds || $[86] !== focusedLog) {
1449
+ t31 = () => {
1450
+ if (!isResumeWithRenameEnabled || !focusedLog) {
1451
+ return "";
1452
+ }
1453
+ const sessionId_0 = getSessionIdFromLog(focusedLog);
1454
+ if (!sessionId_0) {
1455
+ return "";
1456
+ }
1457
+ const sessionLogs = displayedLogs.filter((log_10) => getSessionIdFromLog(log_10) === sessionId_0);
1458
+ const hasMultipleLogs = sessionLogs.length > 1;
1459
+ if (!hasMultipleLogs) {
1460
+ return "";
1461
+ }
1462
+ const isExpanded = expandedGroupSessionIds.has(sessionId_0);
1463
+ const isChildNode = sessionLogs.indexOf(focusedLog) > 0;
1464
+ if (isChildNode) {
1465
+ return "\u2190 to collapse";
1466
+ }
1467
+ return isExpanded ? "\u2190 to collapse" : "\u2192 to expand";
1468
+ };
1469
+ $[84] = displayedLogs;
1470
+ $[85] = expandedGroupSessionIds;
1471
+ $[86] = focusedLog;
1472
+ $[87] = t31;
1473
+ } else {
1474
+ t31 = $[87];
1475
+ }
1476
+ const getExpandCollapseHint = t31;
1477
+ let t32;
1478
+ if ($[88] !== focusedLog || $[89] !== onLogsChanged || $[90] !== renameValue) {
1479
+ t32 = async () => {
1480
+ const sessionId_1 = focusedLog ? getSessionIdFromLog(focusedLog) : undefined;
1481
+ if (!focusedLog || !sessionId_1) {
1482
+ setViewMode("list");
1483
+ setRenameValue("");
1484
+ return;
1485
+ }
1486
+ if (renameValue.trim()) {
1487
+ await saveCustomTitle(sessionId_1, renameValue.trim(), focusedLog.fullPath);
1488
+ if (isResumeWithRenameEnabled && onLogsChanged) {
1489
+ onLogsChanged();
1490
+ }
1491
+ }
1492
+ setViewMode("list");
1493
+ setRenameValue("");
1494
+ };
1495
+ $[88] = focusedLog;
1496
+ $[89] = onLogsChanged;
1497
+ $[90] = renameValue;
1498
+ $[91] = t32;
1499
+ } else {
1500
+ t32 = $[91];
1501
+ }
1502
+ const handleRenameSubmit = t32;
1503
+ let t33;
1504
+ if ($[92] === Symbol.for("react.memo_cache_sentinel")) {
1505
+ t33 = () => {
1506
+ setViewMode("list");
1507
+ logEvent("tengu_session_search_toggled", {
1508
+ enabled: false
1509
+ });
1510
+ };
1511
+ $[92] = t33;
1512
+ } else {
1513
+ t33 = $[92];
1514
+ }
1515
+ const exitSearchMode = t33;
1516
+ let t34;
1517
+ if ($[93] === Symbol.for("react.memo_cache_sentinel")) {
1518
+ t34 = () => {
1519
+ setViewMode("search");
1520
+ logEvent("tengu_session_search_toggled", {
1521
+ enabled: true
1522
+ });
1523
+ };
1524
+ $[93] = t34;
1525
+ } else {
1526
+ t34 = $[93];
1527
+ }
1528
+ const enterSearchMode = t34;
1529
+ let t35;
1530
+ if ($[94] !== logs || $[95] !== onAgenticSearch || $[96] !== searchQuery) {
1531
+ t35 = async () => {
1532
+ if (!searchQuery.trim() || !onAgenticSearch || true) {
1533
+ return;
1534
+ }
1535
+ agenticSearchAbortRef.current?.abort();
1536
+ const abortController = new AbortController;
1537
+ agenticSearchAbortRef.current = abortController;
1538
+ setAgenticSearchState({
1539
+ status: "searching"
1540
+ });
1541
+ logEvent("tengu_agentic_search_started", {
1542
+ query_length: searchQuery.length
1543
+ });
1544
+ try {
1545
+ const results_0 = await onAgenticSearch(searchQuery, logs, abortController.signal);
1546
+ if (abortController.signal.aborted) {
1547
+ return;
1548
+ }
1549
+ setAgenticSearchState({
1550
+ status: "results",
1551
+ results: results_0,
1552
+ query: searchQuery
1553
+ });
1554
+ logEvent("tengu_agentic_search_completed", {
1555
+ query_length: searchQuery.length,
1556
+ results_count: results_0.length
1557
+ });
1558
+ } catch (t362) {
1559
+ const error = t362;
1560
+ if (abortController.signal.aborted) {
1561
+ return;
1562
+ }
1563
+ setAgenticSearchState({
1564
+ status: "error",
1565
+ message: error instanceof Error ? error.message : "Search failed"
1566
+ });
1567
+ logEvent("tengu_agentic_search_error", {
1568
+ query_length: searchQuery.length
1569
+ });
1570
+ }
1571
+ };
1572
+ $[94] = logs;
1573
+ $[95] = onAgenticSearch;
1574
+ $[96] = searchQuery;
1575
+ $[97] = t35;
1576
+ } else {
1577
+ t35 = $[97];
1578
+ }
1579
+ const handleAgenticSearch = t35;
1580
+ let t36;
1581
+ if ($[98] !== agenticSearchState.query || $[99] !== agenticSearchState.status || $[100] !== searchQuery) {
1582
+ t36 = () => {
1583
+ if (agenticSearchState.status !== "idle" && agenticSearchState.status !== "searching") {
1584
+ if (agenticSearchState.status === "results" && agenticSearchState.query !== searchQuery || agenticSearchState.status === "error") {
1585
+ setAgenticSearchState({
1586
+ status: "idle"
1587
+ });
1588
+ }
1589
+ }
1590
+ };
1591
+ $[98] = agenticSearchState.query;
1592
+ $[99] = agenticSearchState.status;
1593
+ $[100] = searchQuery;
1594
+ $[101] = t36;
1595
+ } else {
1596
+ t36 = $[101];
1597
+ }
1598
+ let t37;
1599
+ if ($[102] !== agenticSearchState || $[103] !== searchQuery) {
1600
+ t37 = [searchQuery, agenticSearchState];
1601
+ $[102] = agenticSearchState;
1602
+ $[103] = searchQuery;
1603
+ $[104] = t37;
1604
+ } else {
1605
+ t37 = $[104];
1606
+ }
1607
+ import_react3.default.useEffect(t36, t37);
1608
+ let t38;
1609
+ let t39;
1610
+ if ($[105] === Symbol.for("react.memo_cache_sentinel")) {
1611
+ t38 = () => () => {
1612
+ agenticSearchAbortRef.current?.abort();
1613
+ };
1614
+ t39 = [];
1615
+ $[105] = t38;
1616
+ $[106] = t39;
1617
+ } else {
1618
+ t38 = $[105];
1619
+ t39 = $[106];
1620
+ }
1621
+ import_react3.default.useEffect(t38, t39);
1622
+ const prevAgenticStatusRef = import_react3.default.useRef(agenticSearchState.status);
1623
+ let t40;
1624
+ if ($[107] !== agenticSearchState.status || $[108] !== displayedLogs[0] || $[109] !== displayedLogs.length || $[110] !== treeNodes) {
1625
+ t40 = () => {
1626
+ const prevStatus = prevAgenticStatusRef.current;
1627
+ prevAgenticStatusRef.current = agenticSearchState.status;
1628
+ if (prevStatus === "searching" && agenticSearchState.status === "results") {
1629
+ if (isResumeWithRenameEnabled && treeNodes.length > 0) {
1630
+ setFocusedNode(treeNodes[0]);
1631
+ } else {
1632
+ if (!isResumeWithRenameEnabled && displayedLogs.length > 0) {
1633
+ const firstLog = displayedLogs[0];
1634
+ setFocusedNode({
1635
+ id: "0",
1636
+ value: {
1637
+ log: firstLog,
1638
+ indexInFiltered: 0
1639
+ },
1640
+ label: ""
1641
+ });
1642
+ }
1643
+ }
1644
+ }
1645
+ };
1646
+ $[107] = agenticSearchState.status;
1647
+ $[108] = displayedLogs[0];
1648
+ $[109] = displayedLogs.length;
1649
+ $[110] = treeNodes;
1650
+ $[111] = t40;
1651
+ } else {
1652
+ t40 = $[111];
1653
+ }
1654
+ let t41;
1655
+ if ($[112] !== agenticSearchState.status || $[113] !== displayedLogs || $[114] !== treeNodes) {
1656
+ t41 = [agenticSearchState.status, isResumeWithRenameEnabled, treeNodes, displayedLogs];
1657
+ $[112] = agenticSearchState.status;
1658
+ $[113] = displayedLogs;
1659
+ $[114] = treeNodes;
1660
+ $[115] = t41;
1661
+ } else {
1662
+ t41 = $[115];
1663
+ }
1664
+ import_react3.default.useEffect(t40, t41);
1665
+ let t42;
1666
+ if ($[116] !== displayedLogs) {
1667
+ t42 = (value) => {
1668
+ const index_1 = parseInt(value, 10);
1669
+ const log_11 = displayedLogs[index_1];
1670
+ if (!log_11 || prevFocusedIdRef.current === index_1.toString()) {
1671
+ return;
1672
+ }
1673
+ prevFocusedIdRef.current = index_1.toString();
1674
+ setFocusedNode({
1675
+ id: index_1.toString(),
1676
+ value: {
1677
+ log: log_11,
1678
+ indexInFiltered: index_1
1679
+ },
1680
+ label: ""
1681
+ });
1682
+ setFocusedIndex(index_1 + 1);
1683
+ };
1684
+ $[116] = displayedLogs;
1685
+ $[117] = t42;
1686
+ } else {
1687
+ t42 = $[117];
1688
+ }
1689
+ const handleFlatOptionsSelectFocus = t42;
1690
+ let t43;
1691
+ if ($[118] !== displayedLogs) {
1692
+ t43 = (node) => {
1693
+ setFocusedNode(node);
1694
+ const index_2 = displayedLogs.findIndex((log_12) => getSessionIdFromLog(log_12) === getSessionIdFromLog(node.value.log));
1695
+ if (index_2 >= 0) {
1696
+ setFocusedIndex(index_2 + 1);
1697
+ }
1698
+ };
1699
+ $[118] = displayedLogs;
1700
+ $[119] = t43;
1701
+ } else {
1702
+ t43 = $[119];
1703
+ }
1704
+ const handleTreeSelectFocus = t43;
1705
+ let t44;
1706
+ if ($[120] === Symbol.for("react.memo_cache_sentinel")) {
1707
+ t44 = () => {
1708
+ agenticSearchAbortRef.current?.abort();
1709
+ setAgenticSearchState({
1710
+ status: "idle"
1711
+ });
1712
+ logEvent("tengu_agentic_search_cancelled", {});
1713
+ };
1714
+ $[120] = t44;
1715
+ } else {
1716
+ t44 = $[120];
1717
+ }
1718
+ const t45 = viewMode !== "preview" && agenticSearchState.status === "searching";
1719
+ let t46;
1720
+ if ($[121] !== t45) {
1721
+ t46 = {
1722
+ context: "Confirmation",
1723
+ isActive: t45
1724
+ };
1725
+ $[121] = t45;
1726
+ $[122] = t46;
1727
+ } else {
1728
+ t46 = $[122];
1729
+ }
1730
+ useKeybinding("confirm:no", t44, t46);
1731
+ let t47;
1732
+ if ($[123] === Symbol.for("react.memo_cache_sentinel")) {
1733
+ t47 = () => {
1734
+ setViewMode("list");
1735
+ setRenameValue("");
1736
+ };
1737
+ $[123] = t47;
1738
+ } else {
1739
+ t47 = $[123];
1740
+ }
1741
+ const t48 = viewMode === "rename" && agenticSearchState.status !== "searching";
1742
+ let t49;
1743
+ if ($[124] !== t48) {
1744
+ t49 = {
1745
+ context: "Settings",
1746
+ isActive: t48
1747
+ };
1748
+ $[124] = t48;
1749
+ $[125] = t49;
1750
+ } else {
1751
+ t49 = $[125];
1752
+ }
1753
+ useKeybinding("confirm:no", t47, t49);
1754
+ let t50;
1755
+ if ($[126] !== onCancel || $[127] !== setSearchQuery) {
1756
+ t50 = () => {
1757
+ setSearchQuery("");
1758
+ setIsAgenticSearchOptionFocused(false);
1759
+ onCancel?.();
1760
+ };
1761
+ $[126] = onCancel;
1762
+ $[127] = setSearchQuery;
1763
+ $[128] = t50;
1764
+ } else {
1765
+ t50 = $[128];
1766
+ }
1767
+ const t51 = viewMode !== "preview" && viewMode !== "rename" && viewMode !== "search" && isAgenticSearchOptionFocused && agenticSearchState.status !== "searching";
1768
+ let t52;
1769
+ if ($[129] !== t51) {
1770
+ t52 = {
1771
+ context: "Confirmation",
1772
+ isActive: t51
1773
+ };
1774
+ $[129] = t51;
1775
+ $[130] = t52;
1776
+ } else {
1777
+ t52 = $[130];
1778
+ }
1779
+ useKeybinding("confirm:no", t50, t52);
1780
+ let t53;
1781
+ if ($[131] !== agenticSearchState.status || $[132] !== branchFilterEnabled || $[133] !== focusedLog || $[134] !== handleAgenticSearch || $[135] !== hasMultipleWorktrees || $[136] !== hasTags || $[137] !== isAgenticSearchOptionFocused || $[138] !== onAgenticSearch || $[139] !== onToggleAllProjects || $[140] !== searchQuery || $[141] !== setSearchQuery || $[142] !== showAllProjects || $[143] !== showAllWorktrees || $[144] !== tagTabs || $[145] !== uniqueTags || $[146] !== viewMode) {
1782
+ t53 = (input, key) => {
1783
+ if (viewMode === "preview") {
1784
+ return;
1785
+ }
1786
+ if (agenticSearchState.status === "searching") {
1787
+ return;
1788
+ }
1789
+ if (viewMode === "rename") {} else {
1790
+ if (viewMode === "search") {
1791
+ if (input.toLowerCase() === "n" && key.ctrl) {
1792
+ exitSearchMode();
1793
+ } else {
1794
+ if (key.return || key.downArrow) {
1795
+ if (searchQuery.trim() && onAgenticSearch && false) {}
1796
+ }
1797
+ }
1798
+ } else {
1799
+ if (isAgenticSearchOptionFocused) {
1800
+ if (key.return) {
1801
+ handleAgenticSearch();
1802
+ setIsAgenticSearchOptionFocused(false);
1803
+ return;
1804
+ } else {
1805
+ if (key.downArrow) {
1806
+ setIsAgenticSearchOptionFocused(false);
1807
+ return;
1808
+ } else {
1809
+ if (key.upArrow) {
1810
+ setViewMode("search");
1811
+ setIsAgenticSearchOptionFocused(false);
1812
+ return;
1813
+ }
1814
+ }
1815
+ }
1816
+ }
1817
+ if (hasTags && key.tab) {
1818
+ const offset = key.shift ? -1 : 1;
1819
+ setSelectedTagIndex((prev) => {
1820
+ const current = prev < tagTabs.length ? prev : 0;
1821
+ const newIndex = (current + tagTabs.length + offset) % tagTabs.length;
1822
+ const newTab = tagTabs[newIndex];
1823
+ logEvent("tengu_session_tag_filter_changed", {
1824
+ is_all: newTab === "All",
1825
+ tag_count: uniqueTags.length
1826
+ });
1827
+ return newIndex;
1828
+ });
1829
+ return;
1830
+ }
1831
+ const keyIsNotCtrlOrMeta = !key.ctrl && !key.meta;
1832
+ const lowerInput = input.toLowerCase();
1833
+ if (lowerInput === "a" && key.ctrl && onToggleAllProjects) {
1834
+ onToggleAllProjects();
1835
+ logEvent("tengu_session_all_projects_toggled", {
1836
+ enabled: !showAllProjects
1837
+ });
1838
+ } else {
1839
+ if (lowerInput === "b" && key.ctrl) {
1840
+ const newEnabled = !branchFilterEnabled;
1841
+ setBranchFilterEnabled(newEnabled);
1842
+ logEvent("tengu_session_branch_filter_toggled", {
1843
+ enabled: newEnabled
1844
+ });
1845
+ } else {
1846
+ if (lowerInput === "w" && key.ctrl && hasMultipleWorktrees) {
1847
+ const newValue = !showAllWorktrees;
1848
+ setShowAllWorktrees(newValue);
1849
+ logEvent("tengu_session_worktree_filter_toggled", {
1850
+ enabled: newValue
1851
+ });
1852
+ } else {
1853
+ if (lowerInput === "/" && keyIsNotCtrlOrMeta) {
1854
+ setViewMode("search");
1855
+ logEvent("tengu_session_search_toggled", {
1856
+ enabled: true
1857
+ });
1858
+ } else {
1859
+ if (lowerInput === "r" && key.ctrl && focusedLog) {
1860
+ setViewMode("rename");
1861
+ setRenameValue("");
1862
+ logEvent("tengu_session_rename_started", {});
1863
+ } else {
1864
+ if (lowerInput === "v" && key.ctrl && focusedLog) {
1865
+ setPreviewLog(focusedLog);
1866
+ setViewMode("preview");
1867
+ logEvent("tengu_session_preview_opened", {
1868
+ messageCount: focusedLog.messageCount
1869
+ });
1870
+ } else {
1871
+ if (focusedLog && keyIsNotCtrlOrMeta && input.length > 0 && !/^\s+$/.test(input)) {
1872
+ setViewMode("search");
1873
+ setSearchQuery(input);
1874
+ logEvent("tengu_session_search_toggled", {
1875
+ enabled: true
1876
+ });
1877
+ }
1878
+ }
1879
+ }
1880
+ }
1881
+ }
1882
+ }
1883
+ }
1884
+ }
1885
+ }
1886
+ };
1887
+ $[131] = agenticSearchState.status;
1888
+ $[132] = branchFilterEnabled;
1889
+ $[133] = focusedLog;
1890
+ $[134] = handleAgenticSearch;
1891
+ $[135] = hasMultipleWorktrees;
1892
+ $[136] = hasTags;
1893
+ $[137] = isAgenticSearchOptionFocused;
1894
+ $[138] = onAgenticSearch;
1895
+ $[139] = onToggleAllProjects;
1896
+ $[140] = searchQuery;
1897
+ $[141] = setSearchQuery;
1898
+ $[142] = showAllProjects;
1899
+ $[143] = showAllWorktrees;
1900
+ $[144] = tagTabs;
1901
+ $[145] = uniqueTags;
1902
+ $[146] = viewMode;
1903
+ $[147] = t53;
1904
+ } else {
1905
+ t53 = $[147];
1906
+ }
1907
+ let t54;
1908
+ if ($[148] === Symbol.for("react.memo_cache_sentinel")) {
1909
+ t54 = {
1910
+ isActive: true
1911
+ };
1912
+ $[148] = t54;
1913
+ } else {
1914
+ t54 = $[148];
1915
+ }
1916
+ use_input_default(t53, t54);
1917
+ let filterIndicators;
1918
+ if ($[149] !== branchFilterEnabled || $[150] !== currentBranch || $[151] !== hasMultipleWorktrees || $[152] !== showAllWorktrees) {
1919
+ filterIndicators = [];
1920
+ if (branchFilterEnabled && currentBranch) {
1921
+ filterIndicators.push(currentBranch);
1922
+ }
1923
+ if (hasMultipleWorktrees && !showAllWorktrees) {
1924
+ filterIndicators.push("current worktree");
1925
+ }
1926
+ $[149] = branchFilterEnabled;
1927
+ $[150] = currentBranch;
1928
+ $[151] = hasMultipleWorktrees;
1929
+ $[152] = showAllWorktrees;
1930
+ $[153] = filterIndicators;
1931
+ } else {
1932
+ filterIndicators = $[153];
1933
+ }
1934
+ const showAdditionalFilterLine = filterIndicators.length > 0 && viewMode !== "search";
1935
+ const headerLines = 8 + (showAdditionalFilterLine ? 1 : 0) + tagTabsLines;
1936
+ const visibleCount = Math.max(1, Math.floor((maxHeight - headerLines - 2) / 3));
1937
+ let t55;
1938
+ let t56;
1939
+ if ($[154] !== displayedLogs.length || $[155] !== focusedIndex || $[156] !== onLoadMore || $[157] !== visibleCount) {
1940
+ t55 = () => {
1941
+ if (!onLoadMore) {
1942
+ return;
1943
+ }
1944
+ const buffer = visibleCount * 2;
1945
+ if (focusedIndex + buffer >= displayedLogs.length) {
1946
+ onLoadMore(visibleCount * 3);
1947
+ }
1948
+ };
1949
+ t56 = [focusedIndex, visibleCount, displayedLogs.length, onLoadMore];
1950
+ $[154] = displayedLogs.length;
1951
+ $[155] = focusedIndex;
1952
+ $[156] = onLoadMore;
1953
+ $[157] = visibleCount;
1954
+ $[158] = t55;
1955
+ $[159] = t56;
1956
+ } else {
1957
+ t55 = $[158];
1958
+ t56 = $[159];
1959
+ }
1960
+ import_react3.default.useEffect(t55, t56);
1961
+ if (logs.length === 0) {
1962
+ return null;
1963
+ }
1964
+ if (viewMode === "preview" && previewLog && isResumeWithRenameEnabled) {
1965
+ let t572;
1966
+ if ($[160] === Symbol.for("react.memo_cache_sentinel")) {
1967
+ t572 = () => {
1968
+ setViewMode("list");
1969
+ setPreviewLog(null);
1970
+ };
1971
+ $[160] = t572;
1972
+ } else {
1973
+ t572 = $[160];
1974
+ }
1975
+ let t582;
1976
+ if ($[161] !== onSelect || $[162] !== previewLog) {
1977
+ t582 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SessionPreview, {
1978
+ log: previewLog,
1979
+ onExit: t572,
1980
+ onSelect
1981
+ }, undefined, false, undefined, this);
1982
+ $[161] = onSelect;
1983
+ $[162] = previewLog;
1984
+ $[163] = t582;
1985
+ } else {
1986
+ t582 = $[163];
1987
+ }
1988
+ return t582;
1989
+ }
1990
+ const t57 = maxHeight - 1;
1991
+ let t58;
1992
+ if ($[164] === Symbol.for("react.memo_cache_sentinel")) {
1993
+ t58 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
1994
+ flexShrink: 0,
1995
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Divider, {
1996
+ color: "suggestion"
1997
+ }, undefined, false, undefined, this)
1998
+ }, undefined, false, undefined, this);
1999
+ $[164] = t58;
2000
+ } else {
2001
+ t58 = $[164];
2002
+ }
2003
+ let t59;
2004
+ if ($[165] === Symbol.for("react.memo_cache_sentinel")) {
2005
+ t59 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2006
+ flexShrink: 0,
2007
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2008
+ children: " "
2009
+ }, undefined, false, undefined, this)
2010
+ }, undefined, false, undefined, this);
2011
+ $[165] = t59;
2012
+ } else {
2013
+ t59 = $[165];
2014
+ }
2015
+ let t60;
2016
+ if ($[166] !== columns || $[167] !== displayedLogs.length || $[168] !== effectiveTagIndex || $[169] !== focusedIndex || $[170] !== hasTags || $[171] !== showAllProjects || $[172] !== tagTabs || $[173] !== viewMode || $[174] !== visibleCount) {
2017
+ t60 = hasTags ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TagTabs, {
2018
+ tabs: tagTabs,
2019
+ selectedIndex: effectiveTagIndex,
2020
+ availableWidth: columns,
2021
+ showAllProjects
2022
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2023
+ flexShrink: 0,
2024
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2025
+ bold: true,
2026
+ color: "suggestion",
2027
+ children: [
2028
+ "Resume Session",
2029
+ viewMode === "list" && displayedLogs.length > visibleCount && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2030
+ dimColor: true,
2031
+ children: [
2032
+ " ",
2033
+ "(",
2034
+ focusedIndex,
2035
+ " of ",
2036
+ displayedLogs.length,
2037
+ ")"
2038
+ ]
2039
+ }, undefined, true, undefined, this)
2040
+ ]
2041
+ }, undefined, true, undefined, this)
2042
+ }, undefined, false, undefined, this);
2043
+ $[166] = columns;
2044
+ $[167] = displayedLogs.length;
2045
+ $[168] = effectiveTagIndex;
2046
+ $[169] = focusedIndex;
2047
+ $[170] = hasTags;
2048
+ $[171] = showAllProjects;
2049
+ $[172] = tagTabs;
2050
+ $[173] = viewMode;
2051
+ $[174] = visibleCount;
2052
+ $[175] = t60;
2053
+ } else {
2054
+ t60 = $[175];
2055
+ }
2056
+ const t61 = viewMode === "search";
2057
+ let t62;
2058
+ if ($[176] !== isTerminalFocused || $[177] !== searchCursorOffset || $[178] !== searchQuery || $[179] !== t61) {
2059
+ t62 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SearchBox, {
2060
+ query: searchQuery,
2061
+ isFocused: t61,
2062
+ isTerminalFocused,
2063
+ cursorOffset: searchCursorOffset
2064
+ }, undefined, false, undefined, this);
2065
+ $[176] = isTerminalFocused;
2066
+ $[177] = searchCursorOffset;
2067
+ $[178] = searchQuery;
2068
+ $[179] = t61;
2069
+ $[180] = t62;
2070
+ } else {
2071
+ t62 = $[180];
2072
+ }
2073
+ let t63;
2074
+ if ($[181] !== filterIndicators || $[182] !== viewMode) {
2075
+ t63 = filterIndicators.length > 0 && viewMode !== "search" && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2076
+ flexShrink: 0,
2077
+ paddingLeft: 2,
2078
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2079
+ dimColor: true,
2080
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
2081
+ children: filterIndicators
2082
+ }, undefined, false, undefined, this)
2083
+ }, undefined, false, undefined, this)
2084
+ }, undefined, false, undefined, this);
2085
+ $[181] = filterIndicators;
2086
+ $[182] = viewMode;
2087
+ $[183] = t63;
2088
+ } else {
2089
+ t63 = $[183];
2090
+ }
2091
+ let t64;
2092
+ if ($[184] === Symbol.for("react.memo_cache_sentinel")) {
2093
+ t64 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2094
+ flexShrink: 0,
2095
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2096
+ children: " "
2097
+ }, undefined, false, undefined, this)
2098
+ }, undefined, false, undefined, this);
2099
+ $[184] = t64;
2100
+ } else {
2101
+ t64 = $[184];
2102
+ }
2103
+ let t65;
2104
+ if ($[185] !== agenticSearchState.status) {
2105
+ t65 = agenticSearchState.status === "searching" && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2106
+ paddingLeft: 1,
2107
+ flexShrink: 0,
2108
+ children: [
2109
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Spinner, {}, undefined, false, undefined, this),
2110
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2111
+ children: " Searching\u2026"
2112
+ }, undefined, false, undefined, this)
2113
+ ]
2114
+ }, undefined, true, undefined, this);
2115
+ $[185] = agenticSearchState.status;
2116
+ $[186] = t65;
2117
+ } else {
2118
+ t65 = $[186];
2119
+ }
2120
+ let t66;
2121
+ if ($[187] !== agenticSearchState.results || $[188] !== agenticSearchState.status) {
2122
+ t66 = agenticSearchState.status === "results" && agenticSearchState.results.length > 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2123
+ paddingLeft: 1,
2124
+ marginBottom: 1,
2125
+ flexShrink: 0,
2126
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2127
+ dimColor: true,
2128
+ italic: true,
2129
+ children: "Claude found these results:"
2130
+ }, undefined, false, undefined, this)
2131
+ }, undefined, false, undefined, this);
2132
+ $[187] = agenticSearchState.results;
2133
+ $[188] = agenticSearchState.status;
2134
+ $[189] = t66;
2135
+ } else {
2136
+ t66 = $[189];
2137
+ }
2138
+ let t67;
2139
+ if ($[190] !== agenticSearchState.results || $[191] !== agenticSearchState.status || $[192] !== filteredLogs) {
2140
+ t67 = agenticSearchState.status === "results" && agenticSearchState.results.length === 0 && filteredLogs.length === 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2141
+ paddingLeft: 1,
2142
+ marginBottom: 1,
2143
+ flexShrink: 0,
2144
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2145
+ dimColor: true,
2146
+ italic: true,
2147
+ children: "No matching sessions found."
2148
+ }, undefined, false, undefined, this)
2149
+ }, undefined, false, undefined, this);
2150
+ $[190] = agenticSearchState.results;
2151
+ $[191] = agenticSearchState.status;
2152
+ $[192] = filteredLogs;
2153
+ $[193] = t67;
2154
+ } else {
2155
+ t67 = $[193];
2156
+ }
2157
+ let t68;
2158
+ if ($[194] !== agenticSearchState.status || $[195] !== filteredLogs) {
2159
+ t68 = agenticSearchState.status === "error" && filteredLogs.length === 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2160
+ paddingLeft: 1,
2161
+ marginBottom: 1,
2162
+ flexShrink: 0,
2163
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2164
+ dimColor: true,
2165
+ italic: true,
2166
+ children: "No matching sessions found."
2167
+ }, undefined, false, undefined, this)
2168
+ }, undefined, false, undefined, this);
2169
+ $[194] = agenticSearchState.status;
2170
+ $[195] = filteredLogs;
2171
+ $[196] = t68;
2172
+ } else {
2173
+ t68 = $[196];
2174
+ }
2175
+ let t69;
2176
+ if ($[197] !== agenticSearchState.status || $[198] !== isAgenticSearchOptionFocused || $[199] !== onAgenticSearch || $[200] !== searchQuery) {
2177
+ t69 = Boolean(searchQuery.trim()) && onAgenticSearch && false;
2178
+ $[197] = agenticSearchState.status;
2179
+ $[198] = isAgenticSearchOptionFocused;
2180
+ $[199] = onAgenticSearch;
2181
+ $[200] = searchQuery;
2182
+ $[201] = t69;
2183
+ } else {
2184
+ t69 = $[201];
2185
+ }
2186
+ let t70;
2187
+ if ($[202] !== agenticSearchState.status || $[203] !== branchFilterEnabled || $[204] !== columns || $[205] !== displayedLogs || $[206] !== expandedGroupSessionIds || $[207] !== flatOptions || $[208] !== focusedLog || $[209] !== focusedNode?.id || $[210] !== handleFlatOptionsSelectFocus || $[211] !== handleRenameSubmit || $[212] !== handleTreeSelectFocus || $[213] !== isAgenticSearchOptionFocused || $[214] !== onCancel || $[215] !== onSelect || $[216] !== renameCursorOffset || $[217] !== renameValue || $[218] !== treeNodes || $[219] !== viewMode || $[220] !== visibleCount) {
2188
+ t70 = agenticSearchState.status === "searching" ? null : viewMode === "rename" && focusedLog ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2189
+ paddingLeft: 2,
2190
+ flexDirection: "column",
2191
+ children: [
2192
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2193
+ bold: true,
2194
+ children: "Rename session:"
2195
+ }, undefined, false, undefined, this),
2196
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2197
+ paddingTop: 1,
2198
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextInput, {
2199
+ value: renameValue,
2200
+ onChange: setRenameValue,
2201
+ onSubmit: handleRenameSubmit,
2202
+ placeholder: getLogDisplayTitle(focusedLog, "Enter new session name"),
2203
+ columns,
2204
+ cursorOffset: renameCursorOffset,
2205
+ onChangeCursorOffset: setRenameCursorOffset,
2206
+ showCursor: true
2207
+ }, undefined, false, undefined, this)
2208
+ }, undefined, false, undefined, this)
2209
+ ]
2210
+ }, undefined, true, undefined, this) : isResumeWithRenameEnabled ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TreeSelect, {
2211
+ nodes: treeNodes,
2212
+ onSelect: (node_0) => {
2213
+ onSelect(node_0.value.log);
2214
+ },
2215
+ onFocus: handleTreeSelectFocus,
2216
+ onCancel,
2217
+ focusNodeId: focusedNode?.id,
2218
+ visibleOptionCount: visibleCount,
2219
+ layout: "expanded",
2220
+ isDisabled: viewMode === "search" || isAgenticSearchOptionFocused,
2221
+ hideIndexes: false,
2222
+ isNodeExpanded: (nodeId) => {
2223
+ if (viewMode === "search" || branchFilterEnabled) {
2224
+ return true;
2225
+ }
2226
+ const sessionId_2 = typeof nodeId === "string" && nodeId.startsWith("group:") ? nodeId.substring(6) : null;
2227
+ return sessionId_2 ? expandedGroupSessionIds.has(sessionId_2) : false;
2228
+ },
2229
+ onExpand: (nodeId_0) => {
2230
+ const sessionId_3 = typeof nodeId_0 === "string" && nodeId_0.startsWith("group:") ? nodeId_0.substring(6) : null;
2231
+ if (sessionId_3) {
2232
+ setExpandedGroupSessionIds((prev_0) => new Set(prev_0).add(sessionId_3));
2233
+ logEvent("tengu_session_group_expanded", {});
2234
+ }
2235
+ },
2236
+ onCollapse: (nodeId_1) => {
2237
+ const sessionId_4 = typeof nodeId_1 === "string" && nodeId_1.startsWith("group:") ? nodeId_1.substring(6) : null;
2238
+ if (sessionId_4) {
2239
+ setExpandedGroupSessionIds((prev_1) => {
2240
+ const newSet = new Set(prev_1);
2241
+ newSet.delete(sessionId_4);
2242
+ return newSet;
2243
+ });
2244
+ }
2245
+ },
2246
+ onUpFromFirstItem: enterSearchMode
2247
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Select, {
2248
+ options: flatOptions,
2249
+ onChange: (value_0) => {
2250
+ const itemIndex = parseInt(value_0, 10);
2251
+ const log_13 = displayedLogs[itemIndex];
2252
+ if (log_13) {
2253
+ onSelect(log_13);
2254
+ }
2255
+ },
2256
+ visibleOptionCount: visibleCount,
2257
+ onCancel,
2258
+ onFocus: handleFlatOptionsSelectFocus,
2259
+ defaultFocusValue: focusedNode?.id.toString(),
2260
+ layout: "expanded",
2261
+ isDisabled: viewMode === "search" || isAgenticSearchOptionFocused,
2262
+ onUpFromFirstItem: enterSearchMode
2263
+ }, undefined, false, undefined, this);
2264
+ $[202] = agenticSearchState.status;
2265
+ $[203] = branchFilterEnabled;
2266
+ $[204] = columns;
2267
+ $[205] = displayedLogs;
2268
+ $[206] = expandedGroupSessionIds;
2269
+ $[207] = flatOptions;
2270
+ $[208] = focusedLog;
2271
+ $[209] = focusedNode?.id;
2272
+ $[210] = handleFlatOptionsSelectFocus;
2273
+ $[211] = handleRenameSubmit;
2274
+ $[212] = handleTreeSelectFocus;
2275
+ $[213] = isAgenticSearchOptionFocused;
2276
+ $[214] = onCancel;
2277
+ $[215] = onSelect;
2278
+ $[216] = renameCursorOffset;
2279
+ $[217] = renameValue;
2280
+ $[218] = treeNodes;
2281
+ $[219] = viewMode;
2282
+ $[220] = visibleCount;
2283
+ $[221] = t70;
2284
+ } else {
2285
+ t70 = $[221];
2286
+ }
2287
+ let t71;
2288
+ if ($[222] !== agenticSearchState.status || $[223] !== currentBranch || $[224] !== exitState.keyName || $[225] !== exitState.pending || $[226] !== getExpandCollapseHint || $[227] !== hasMultipleWorktrees || $[228] !== isAgenticSearchOptionFocused || $[229] !== isSearching || $[230] !== onToggleAllProjects || $[231] !== showAllProjects || $[232] !== showAllWorktrees || $[233] !== viewMode) {
2289
+ t71 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2290
+ paddingLeft: 2,
2291
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2292
+ dimColor: true,
2293
+ children: [
2294
+ "Press ",
2295
+ exitState.keyName,
2296
+ " again to exit"
2297
+ ]
2298
+ }, undefined, true, undefined, this) : viewMode === "rename" ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2299
+ dimColor: true,
2300
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
2301
+ children: [
2302
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2303
+ shortcut: "Enter",
2304
+ action: "save"
2305
+ }, undefined, false, undefined, this),
2306
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
2307
+ action: "confirm:no",
2308
+ context: "Confirmation",
2309
+ fallback: "Esc",
2310
+ description: "cancel"
2311
+ }, undefined, false, undefined, this)
2312
+ ]
2313
+ }, undefined, true, undefined, this)
2314
+ }, undefined, false, undefined, this) : agenticSearchState.status === "searching" ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2315
+ dimColor: true,
2316
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
2317
+ children: [
2318
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2319
+ children: "Searching with Claude\u2026"
2320
+ }, undefined, false, undefined, this),
2321
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
2322
+ action: "confirm:no",
2323
+ context: "Confirmation",
2324
+ fallback: "Esc",
2325
+ description: "cancel"
2326
+ }, undefined, false, undefined, this)
2327
+ ]
2328
+ }, undefined, true, undefined, this)
2329
+ }, undefined, false, undefined, this) : isAgenticSearchOptionFocused ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2330
+ dimColor: true,
2331
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
2332
+ children: [
2333
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2334
+ shortcut: "Enter",
2335
+ action: "search"
2336
+ }, undefined, false, undefined, this),
2337
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2338
+ shortcut: "\u2193",
2339
+ action: "skip"
2340
+ }, undefined, false, undefined, this),
2341
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
2342
+ action: "confirm:no",
2343
+ context: "Confirmation",
2344
+ fallback: "Esc",
2345
+ description: "cancel"
2346
+ }, undefined, false, undefined, this)
2347
+ ]
2348
+ }, undefined, true, undefined, this)
2349
+ }, undefined, false, undefined, this) : viewMode === "search" ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2350
+ dimColor: true,
2351
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
2352
+ children: [
2353
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2354
+ children: "Type to Search"
2355
+ }, undefined, false, undefined, this),
2356
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2357
+ shortcut: "Enter",
2358
+ action: "select"
2359
+ }, undefined, false, undefined, this),
2360
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
2361
+ action: "confirm:no",
2362
+ context: "Confirmation",
2363
+ fallback: "Esc",
2364
+ description: "clear"
2365
+ }, undefined, false, undefined, this)
2366
+ ]
2367
+ }, undefined, true, undefined, this)
2368
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2369
+ dimColor: true,
2370
+ children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
2371
+ children: [
2372
+ onToggleAllProjects && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2373
+ shortcut: "Ctrl+A",
2374
+ action: `show ${showAllProjects ? "current dir" : "all projects"}`
2375
+ }, undefined, false, undefined, this),
2376
+ currentBranch && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2377
+ shortcut: "Ctrl+B",
2378
+ action: "toggle branch"
2379
+ }, undefined, false, undefined, this),
2380
+ hasMultipleWorktrees && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2381
+ shortcut: "Ctrl+W",
2382
+ action: `show ${showAllWorktrees ? "current worktree" : "all worktrees"}`
2383
+ }, undefined, false, undefined, this),
2384
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2385
+ shortcut: "Ctrl+V",
2386
+ action: "preview"
2387
+ }, undefined, false, undefined, this),
2388
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
2389
+ shortcut: "Ctrl+R",
2390
+ action: "rename"
2391
+ }, undefined, false, undefined, this),
2392
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2393
+ children: "Type to search"
2394
+ }, undefined, false, undefined, this),
2395
+ /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
2396
+ action: "confirm:no",
2397
+ context: "Confirmation",
2398
+ fallback: "Esc",
2399
+ description: "cancel"
2400
+ }, undefined, false, undefined, this),
2401
+ getExpandCollapseHint() && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
2402
+ children: getExpandCollapseHint()
2403
+ }, undefined, false, undefined, this)
2404
+ ]
2405
+ }, undefined, true, undefined, this)
2406
+ }, undefined, false, undefined, this)
2407
+ }, undefined, false, undefined, this);
2408
+ $[222] = agenticSearchState.status;
2409
+ $[223] = currentBranch;
2410
+ $[224] = exitState.keyName;
2411
+ $[225] = exitState.pending;
2412
+ $[226] = getExpandCollapseHint;
2413
+ $[227] = hasMultipleWorktrees;
2414
+ $[228] = isAgenticSearchOptionFocused;
2415
+ $[229] = isSearching;
2416
+ $[230] = onToggleAllProjects;
2417
+ $[231] = showAllProjects;
2418
+ $[232] = showAllWorktrees;
2419
+ $[233] = viewMode;
2420
+ $[234] = t71;
2421
+ } else {
2422
+ t71 = $[234];
2423
+ }
2424
+ let t72;
2425
+ if ($[235] !== t57 || $[236] !== t60 || $[237] !== t62 || $[238] !== t63 || $[239] !== t65 || $[240] !== t66 || $[241] !== t67 || $[242] !== t68 || $[243] !== t69 || $[244] !== t70 || $[245] !== t71) {
2426
+ t72 = /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
2427
+ flexDirection: "column",
2428
+ height: t57,
2429
+ children: [
2430
+ t58,
2431
+ t59,
2432
+ t60,
2433
+ t62,
2434
+ t63,
2435
+ t64,
2436
+ t65,
2437
+ t66,
2438
+ t67,
2439
+ t68,
2440
+ t69,
2441
+ t70,
2442
+ t71
2443
+ ]
2444
+ }, undefined, true, undefined, this);
2445
+ $[235] = t57;
2446
+ $[236] = t60;
2447
+ $[237] = t62;
2448
+ $[238] = t63;
2449
+ $[239] = t65;
2450
+ $[240] = t66;
2451
+ $[241] = t67;
2452
+ $[242] = t68;
2453
+ $[243] = t69;
2454
+ $[244] = t70;
2455
+ $[245] = t71;
2456
+ $[246] = t72;
2457
+ } else {
2458
+ t72 = $[246];
2459
+ }
2460
+ return t72;
2461
+ }
2462
+ function _temp7(r_0) {
2463
+ return r_0.log;
2464
+ }
2465
+ function _temp6(log_6) {
2466
+ return log_6.messages[0]?.uuid;
2467
+ }
2468
+ function _temp5(fuseIndex_0, debouncedDeepSearchQuery_0, setDeepSearchResults_0, setIsSearching_0) {
2469
+ const results = fuseIndex_0.search(debouncedDeepSearchQuery_0);
2470
+ results.sort(_temp3);
2471
+ setDeepSearchResults_0({
2472
+ results: results.map(_temp4),
2473
+ query: debouncedDeepSearchQuery_0
2474
+ });
2475
+ setIsSearching_0(false);
2476
+ }
2477
+ function _temp4(r) {
2478
+ return {
2479
+ log: r.item.log,
2480
+ score: r.score,
2481
+ searchableText: r.item.searchableText
2482
+ };
2483
+ }
2484
+ function _temp3(a, b) {
2485
+ const aTime = new Date(a.item.log.modified).getTime();
2486
+ const bTime = new Date(b.item.log.modified).getTime();
2487
+ const timeDiff = bTime - aTime;
2488
+ if (Math.abs(timeDiff) > DATE_TIE_THRESHOLD_MS) {
2489
+ return timeDiff;
2490
+ }
2491
+ return (a.score ?? 1) - (b.score ?? 1);
2492
+ }
2493
+ function _temp22(log_1) {
2494
+ const currentSessionId = getSessionId();
2495
+ const logSessionId = getSessionIdFromLog(log_1);
2496
+ const isCurrentSession = currentSessionId && logSessionId === currentSessionId;
2497
+ if (isCurrentSession) {
2498
+ return true;
2499
+ }
2500
+ if (log_1.customTitle) {
2501
+ return true;
2502
+ }
2503
+ const fromMessages = getFirstMeaningfulUserMessageTextContent(log_1.messages);
2504
+ if (fromMessages) {
2505
+ return true;
2506
+ }
2507
+ if (log_1.firstPrompt || log_1.customTitle) {
2508
+ return true;
2509
+ }
2510
+ return false;
2511
+ }
2512
+ function _temp8(log) {
2513
+ return [log, buildSearchableText(log)];
2514
+ }
2515
+ function extractSearchableText(message) {
2516
+ if (message.type !== "user" && message.type !== "assistant") {
2517
+ return "";
2518
+ }
2519
+ const content = "message" in message ? message.message?.content : undefined;
2520
+ if (!content)
2521
+ return "";
2522
+ if (typeof content === "string") {
2523
+ return content;
2524
+ }
2525
+ if (Array.isArray(content)) {
2526
+ return content.map((block) => {
2527
+ if (typeof block === "string")
2528
+ return block;
2529
+ if ("text" in block && typeof block.text === "string")
2530
+ return block.text;
2531
+ return "";
2532
+ }).filter(Boolean).join(" ");
2533
+ }
2534
+ return "";
2535
+ }
2536
+ function buildSearchableText(log) {
2537
+ const searchableMessages = log.messages.length <= DEEP_SEARCH_MAX_MESSAGES ? log.messages : [...log.messages.slice(0, DEEP_SEARCH_CROP_SIZE), ...log.messages.slice(-DEEP_SEARCH_CROP_SIZE)];
2538
+ const messageText = searchableMessages.map(extractSearchableText).filter(Boolean).join(" ");
2539
+ const metadata = [log.customTitle, log.summary, log.firstPrompt, log.gitBranch, log.tag, log.prNumber ? `PR #${log.prNumber}` : undefined, log.prRepository].filter(Boolean).join(" ");
2540
+ const fullText = `${metadata} ${messageText}`.trim();
2541
+ return fullText.length > DEEP_SEARCH_MAX_TEXT_LENGTH ? fullText.slice(0, DEEP_SEARCH_MAX_TEXT_LENGTH) : fullText;
2542
+ }
2543
+ function groupLogsBySessionId(filteredLogs) {
2544
+ const groups = new Map;
2545
+ for (const log of filteredLogs) {
2546
+ const sessionId = getSessionIdFromLog(log);
2547
+ if (sessionId) {
2548
+ const existing = groups.get(sessionId);
2549
+ if (existing) {
2550
+ existing.push(log);
2551
+ } else {
2552
+ groups.set(sessionId, [log]);
2553
+ }
2554
+ }
2555
+ }
2556
+ groups.forEach((logs) => logs.sort((a, b) => new Date(b.modified).getTime() - new Date(a.modified).getTime()));
2557
+ return groups;
2558
+ }
2559
+ function getUniqueTags(logs) {
2560
+ const tags = new Set;
2561
+ for (const log of logs) {
2562
+ if (log.tag) {
2563
+ tags.add(log.tag);
2564
+ }
2565
+ }
2566
+ return Array.from(tags).sort((a, b) => a.localeCompare(b));
2567
+ }
2568
+ var import_compiler_runtime3, import_react3, jsx_dev_runtime4, PARENT_PREFIX_WIDTH = 2, CHILD_PREFIX_WIDTH = 4, DEEP_SEARCH_MAX_MESSAGES = 2000, DEEP_SEARCH_CROP_SIZE = 1000, DEEP_SEARCH_MAX_TEXT_LENGTH = 50000, DATE_TIE_THRESHOLD_MS, SNIPPET_CONTEXT_CHARS = 50;
2569
+ var init_LogSelector = __esm(() => {
2570
+ init_source();
2571
+ init_state();
2572
+ init_useExitOnCtrlCDWithKeybindings();
2573
+ init_useSearchInput();
2574
+ init_useTerminalSize();
2575
+ init_colorize();
2576
+ init_ink();
2577
+ init_useKeybinding();
2578
+ init_analytics();
2579
+ init_format();
2580
+ init_getWorktreePaths();
2581
+ init_git();
2582
+ init_log();
2583
+ init_sessionStorage();
2584
+ init_theme();
2585
+ init_ConfigurableShortcutHint();
2586
+ init_select();
2587
+ init_Byline();
2588
+ init_Divider();
2589
+ init_KeyboardShortcutHint();
2590
+ init_SearchBox();
2591
+ init_SessionPreview();
2592
+ init_Spinner();
2593
+ init_TagTabs();
2594
+ init_TextInput();
2595
+ init_TreeSelect();
2596
+ import_compiler_runtime3 = __toESM(require_compiler_runtime(), 1);
2597
+ import_react3 = __toESM(require_react(), 1);
2598
+ jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
2599
+ DATE_TIE_THRESHOLD_MS = 60 * 1000;
2600
+ });
2601
+
2602
+ // src/utils/agenticSessionSearch.ts
2603
+ function extractMessageText(message) {
2604
+ if (message.type !== "user" && message.type !== "assistant") {
2605
+ return "";
2606
+ }
2607
+ const content = "message" in message ? message.message?.content : undefined;
2608
+ if (!content)
2609
+ return "";
2610
+ if (typeof content === "string") {
2611
+ return content;
2612
+ }
2613
+ if (Array.isArray(content)) {
2614
+ return content.map((block) => {
2615
+ if (typeof block === "string")
2616
+ return block;
2617
+ if ("text" in block && typeof block.text === "string")
2618
+ return block.text;
2619
+ return "";
2620
+ }).filter(Boolean).join(" ");
2621
+ }
2622
+ return "";
2623
+ }
2624
+ function extractTranscript(messages) {
2625
+ if (messages.length === 0)
2626
+ return "";
2627
+ const messagesToScan = messages.length <= MAX_MESSAGES_TO_SCAN ? messages : [
2628
+ ...messages.slice(0, MAX_MESSAGES_TO_SCAN / 2),
2629
+ ...messages.slice(-MAX_MESSAGES_TO_SCAN / 2)
2630
+ ];
2631
+ const text = messagesToScan.map(extractMessageText).filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
2632
+ return text.length > MAX_TRANSCRIPT_CHARS ? text.slice(0, MAX_TRANSCRIPT_CHARS) + "\u2026" : text;
2633
+ }
2634
+ function logContainsQuery(log, queryLower) {
2635
+ const title = getLogDisplayTitle(log).toLowerCase();
2636
+ if (title.includes(queryLower))
2637
+ return true;
2638
+ if (log.customTitle?.toLowerCase().includes(queryLower))
2639
+ return true;
2640
+ if (log.tag?.toLowerCase().includes(queryLower))
2641
+ return true;
2642
+ if (log.gitBranch?.toLowerCase().includes(queryLower))
2643
+ return true;
2644
+ if (log.summary?.toLowerCase().includes(queryLower))
2645
+ return true;
2646
+ if (log.firstPrompt?.toLowerCase().includes(queryLower))
2647
+ return true;
2648
+ if (log.messages && log.messages.length > 0) {
2649
+ const transcript = extractTranscript(log.messages).toLowerCase();
2650
+ if (transcript.includes(queryLower))
2651
+ return true;
2652
+ }
2653
+ return false;
2654
+ }
2655
+ async function agenticSessionSearch(query, logs, signal) {
2656
+ if (!query.trim() || logs.length === 0) {
2657
+ return [];
2658
+ }
2659
+ const queryLower = query.toLowerCase();
2660
+ const matchingLogs = logs.filter((log) => logContainsQuery(log, queryLower));
2661
+ let logsToSearch;
2662
+ if (matchingLogs.length >= MAX_SESSIONS_TO_SEARCH) {
2663
+ logsToSearch = matchingLogs.slice(0, MAX_SESSIONS_TO_SEARCH);
2664
+ } else {
2665
+ const nonMatchingLogs = logs.filter((log) => !logContainsQuery(log, queryLower));
2666
+ const remainingSlots = MAX_SESSIONS_TO_SEARCH - matchingLogs.length;
2667
+ logsToSearch = [
2668
+ ...matchingLogs,
2669
+ ...nonMatchingLogs.slice(0, remainingSlots)
2670
+ ];
2671
+ }
2672
+ logForDebugging(`Agentic search: ${logsToSearch.length}/${logs.length} logs, query="${query}", ` + `matching: ${matchingLogs.length}, with messages: ${count(logsToSearch, (l) => l.messages?.length > 0)}`);
2673
+ const logsWithTranscriptsPromises = logsToSearch.map(async (log) => {
2674
+ if (isLiteLog(log)) {
2675
+ try {
2676
+ return await loadFullLog(log);
2677
+ } catch (error) {
2678
+ logError(error);
2679
+ return log;
2680
+ }
2681
+ }
2682
+ return log;
2683
+ });
2684
+ const logsWithTranscripts = await Promise.all(logsWithTranscriptsPromises);
2685
+ logForDebugging(`Agentic search: loaded ${count(logsWithTranscripts, (l) => l.messages?.length > 0)}/${logsToSearch.length} logs with transcripts`);
2686
+ const sessionList = logsWithTranscripts.map((log, index) => {
2687
+ const parts = [`${index}:`];
2688
+ const displayTitle = getLogDisplayTitle(log);
2689
+ parts.push(displayTitle);
2690
+ if (log.customTitle && log.customTitle !== displayTitle) {
2691
+ parts.push(`[custom title: ${log.customTitle}]`);
2692
+ }
2693
+ if (log.tag) {
2694
+ parts.push(`[tag: ${log.tag}]`);
2695
+ }
2696
+ if (log.gitBranch) {
2697
+ parts.push(`[branch: ${log.gitBranch}]`);
2698
+ }
2699
+ if (log.summary) {
2700
+ parts.push(`- Summary: ${log.summary}`);
2701
+ }
2702
+ if (log.firstPrompt && log.firstPrompt !== "No prompt") {
2703
+ parts.push(`- First message: ${log.firstPrompt.slice(0, 300)}`);
2704
+ }
2705
+ if (log.messages && log.messages.length > 0) {
2706
+ const transcript = extractTranscript(log.messages);
2707
+ if (transcript) {
2708
+ parts.push(`- Transcript: ${transcript}`);
2709
+ }
2710
+ }
2711
+ return parts.join(" ");
2712
+ }).join(`
2713
+ `);
2714
+ const userMessage = `Sessions:
2715
+ ${sessionList}
2716
+
2717
+ Search query: "${query}"
2718
+
2719
+ Find the sessions that are most relevant to this query.`;
2720
+ logForDebugging(`Agentic search prompt (first 500 chars): ${userMessage.slice(0, 500)}...`);
2721
+ try {
2722
+ const model = getSmallFastModel();
2723
+ logForDebugging(`Agentic search using model: ${model}`);
2724
+ const response = await sideQuery({
2725
+ model,
2726
+ system: SESSION_SEARCH_SYSTEM_PROMPT,
2727
+ messages: [{ role: "user", content: userMessage }],
2728
+ signal,
2729
+ querySource: "session_search"
2730
+ });
2731
+ const textContent = response.content.find((block) => block.type === "text");
2732
+ if (!textContent || textContent.type !== "text") {
2733
+ logForDebugging("No text content in agentic search response");
2734
+ return [];
2735
+ }
2736
+ logForDebugging(`Agentic search response: ${textContent.text}`);
2737
+ const jsonMatch = textContent.text.match(/\{[\s\S]*\}/);
2738
+ if (!jsonMatch) {
2739
+ logForDebugging("Could not find JSON in agentic search response");
2740
+ return [];
2741
+ }
2742
+ const result = jsonParse(jsonMatch[0]);
2743
+ const relevantIndices = result.relevant_indices || [];
2744
+ const relevantLogs = relevantIndices.filter((index) => index >= 0 && index < logsWithTranscripts.length).map((index) => logsWithTranscripts[index]);
2745
+ logForDebugging(`Agentic search found ${relevantLogs.length} relevant sessions`);
2746
+ return relevantLogs;
2747
+ } catch (error) {
2748
+ logError(error);
2749
+ logForDebugging(`Agentic search error: ${error}`);
2750
+ return [];
2751
+ }
2752
+ }
2753
+ var MAX_TRANSCRIPT_CHARS = 2000, MAX_MESSAGES_TO_SCAN = 100, MAX_SESSIONS_TO_SEARCH = 100, SESSION_SEARCH_SYSTEM_PROMPT = `Your goal is to find relevant sessions based on a user's search query.
2754
+
2755
+ You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
2756
+
2757
+ Each session may include:
2758
+ - Title (display name or custom title)
2759
+ - Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
2760
+ - Branch (git branch name, shown as [branch: name])
2761
+ - Summary (AI-generated summary)
2762
+ - First message (beginning of the conversation)
2763
+ - Transcript (excerpt of conversation content)
2764
+
2765
+ IMPORTANT: Tags are user-assigned labels that indicate the session's topic or category. If the query matches a tag exactly or partially, those sessions should be highly prioritized.
2766
+
2767
+ For each session, consider (in order of priority):
2768
+ 1. Exact tag matches (highest priority - user explicitly categorized this session)
2769
+ 2. Partial tag matches or tag-related terms
2770
+ 3. Title matches (custom titles or first message content)
2771
+ 4. Branch name matches
2772
+ 5. Summary and transcript content matches
2773
+ 6. Semantic similarity and related concepts
2774
+
2775
+ CRITICAL: Be VERY inclusive in your matching. Include sessions that:
2776
+ - Contain the query term anywhere in any field
2777
+ - Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
2778
+ - Discuss topics that could be related to the query
2779
+ - Have transcripts that mention the concept even in passing
2780
+
2781
+ When in doubt, INCLUDE the session. It's better to return too many results than too few. The user can easily scan through results, but missing relevant sessions is frustrating.
2782
+
2783
+ Return sessions ordered by relevance (most relevant first). If truly no sessions have ANY connection to the query, return an empty array - but this should be rare.
2784
+
2785
+ Respond with ONLY the JSON object, no markdown formatting:
2786
+ {"relevant_indices": [2, 5, 0]}`;
2787
+ var init_agenticSessionSearch = __esm(() => {
2788
+ init_array();
2789
+ init_debug();
2790
+ init_log();
2791
+ init_model();
2792
+ init_sessionStorage();
2793
+ init_sideQuery();
2794
+ init_slowOperations();
2795
+ });
2796
+
2797
+ // src/utils/crossProjectResume.ts
2798
+ import { sep } from "path";
2799
+ function checkCrossProjectResume(log, showAllProjects, worktreePaths) {
2800
+ const currentCwd = getOriginalCwd();
2801
+ if (!showAllProjects || !log.projectPath || log.projectPath === currentCwd) {
2802
+ return { isCrossProject: false };
2803
+ }
2804
+ if (process.env.USER_TYPE !== "ant") {
2805
+ const sessionId2 = getSessionIdFromLog(log);
2806
+ const command2 = `cd ${quote([log.projectPath])} && ${getCliBin()} --resume ${sessionId2}`;
2807
+ return {
2808
+ isCrossProject: true,
2809
+ isSameRepoWorktree: false,
2810
+ command: command2,
2811
+ projectPath: log.projectPath
2812
+ };
2813
+ }
2814
+ const isSameRepo = worktreePaths.some((wt) => log.projectPath === wt || log.projectPath.startsWith(wt + sep));
2815
+ if (isSameRepo) {
2816
+ return {
2817
+ isCrossProject: true,
2818
+ isSameRepoWorktree: true,
2819
+ projectPath: log.projectPath
2820
+ };
2821
+ }
2822
+ const sessionId = getSessionIdFromLog(log);
2823
+ const command = `cd ${quote([log.projectPath])} && ${getCliBin()} --resume ${sessionId}`;
2824
+ return {
2825
+ isCrossProject: true,
2826
+ isSameRepoWorktree: false,
2827
+ command,
2828
+ projectPath: log.projectPath
2829
+ };
2830
+ }
2831
+ var init_crossProjectResume = __esm(() => {
2832
+ init_state();
2833
+ init_shellQuote();
2834
+ init_cliBranding();
2835
+ init_sessionStorage();
2836
+ });
2837
+
2838
+ export { LogSelector, init_LogSelector, agenticSessionSearch, init_agenticSessionSearch, checkCrossProjectResume, init_crossProjectResume };