gong-code 0.1.0

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