@redscope-ai/redscope 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +224 -0
- package/dist/chunk-090920rk.js +288 -0
- package/dist/chunk-0afb2r78.js +141 -0
- package/dist/chunk-0d4ekx1g.js +73 -0
- package/dist/chunk-0g6nwbhq.js +15 -0
- package/dist/chunk-0qj905nt.js +18 -0
- package/dist/chunk-0s5btnn1.js +186 -0
- package/dist/chunk-0s8fars0.js +91 -0
- package/dist/chunk-10ev3dvh.js +312 -0
- package/dist/chunk-10k5jfc5.js +1295 -0
- package/dist/chunk-12tspwqa.js +240 -0
- package/dist/chunk-13qesvnw.js +17 -0
- package/dist/chunk-143eh1e0.js +121 -0
- package/dist/chunk-14p6wvsq.js +39 -0
- package/dist/chunk-19f3zb1m.js +342 -0
- package/dist/chunk-1a5cep8h.js +145 -0
- package/dist/chunk-1abw9kkn.js +34 -0
- package/dist/chunk-1aer7c78.js +118 -0
- package/dist/chunk-1dazz4g6.js +154 -0
- package/dist/chunk-1fcf4ty1.js +142 -0
- package/dist/chunk-1gnxhyf8.js +62 -0
- package/dist/chunk-1he3944e.js +8124 -0
- package/dist/chunk-1jpayz7y.js +952 -0
- package/dist/chunk-1qd6f6vk.js +269 -0
- package/dist/chunk-1v0kpe62.js +2547 -0
- package/dist/chunk-1w20m7gw.js +445 -0
- package/dist/chunk-1y7kp51j.js +72 -0
- package/dist/chunk-1ycb5sxt.js +247 -0
- package/dist/chunk-1zbwhcbt.js +1124 -0
- package/dist/chunk-20psem54.js +116 -0
- package/dist/chunk-23h69r5b.js +30 -0
- package/dist/chunk-23x86ptv.js +473 -0
- package/dist/chunk-24fyv3jz.js +378 -0
- package/dist/chunk-24kv69g3.js +97 -0
- package/dist/chunk-2azx8zsc.js +125 -0
- package/dist/chunk-2d1gwzz9.js +524 -0
- package/dist/chunk-2g0ytd9d.js +29058 -0
- package/dist/chunk-2hfp9kat.js +21 -0
- package/dist/chunk-2j875eq6.js +37 -0
- package/dist/chunk-2kcgxnvp.js +39 -0
- package/dist/chunk-2kz09j2s.js +23 -0
- package/dist/chunk-2mwnwp0n.js +17 -0
- package/dist/chunk-2p1cqhcn.js +921 -0
- package/dist/chunk-2p369q9z.js +61 -0
- package/dist/chunk-2rf6asgf.js +151 -0
- package/dist/chunk-2vr7mqx1.js +384 -0
- package/dist/chunk-2xcg933e.js +205 -0
- package/dist/chunk-2ypwckbz.js +40310 -0
- package/dist/chunk-30wnahyg.js +626 -0
- package/dist/chunk-326zehp8.js +204 -0
- package/dist/chunk-32s6jzgw.js +183 -0
- package/dist/chunk-35yzt1a7.js +202 -0
- package/dist/chunk-38frkej6.js +62 -0
- package/dist/chunk-3abaq08g.js +34 -0
- package/dist/chunk-3h59ttr5.js +32 -0
- package/dist/chunk-3nk9q8dr.js +154 -0
- package/dist/chunk-3prrxevm.js +224 -0
- package/dist/chunk-3tv8p9xw.js +127 -0
- package/dist/chunk-3txyekes.js +19 -0
- package/dist/chunk-3vfxjn7g.js +19 -0
- package/dist/chunk-3w9sye8h.js +81 -0
- package/dist/chunk-3y69j7y8.js +24 -0
- package/dist/chunk-3zwjpkjh.js +1603 -0
- package/dist/chunk-40t1d75v.js +3442 -0
- package/dist/chunk-470kmby4.js +318 -0
- package/dist/chunk-47jc141z.js +335 -0
- package/dist/chunk-48rz50ct.js +868 -0
- package/dist/chunk-49wv03ts.js +232 -0
- package/dist/chunk-4a189mn2.js +103 -0
- package/dist/chunk-4c4fmh7a.js +15 -0
- package/dist/chunk-4ct8dsj5.js +49 -0
- package/dist/chunk-4kqt1pm1.js +100 -0
- package/dist/chunk-4ng0xy0e.js +802 -0
- package/dist/chunk-4spgkgr3.js +43 -0
- package/dist/chunk-4tjdwtyy.js +19 -0
- package/dist/chunk-4tr60273.js +370 -0
- package/dist/chunk-4vnaeng5.js +29 -0
- package/dist/chunk-4wbqpeaw.js +871 -0
- package/dist/chunk-4wgkv3fv.js +1140 -0
- package/dist/chunk-4yjskjb6.js +40 -0
- package/dist/chunk-50m3a23z.js +35 -0
- package/dist/chunk-511f79az.js +182 -0
- package/dist/chunk-51sgztvv.js +161 -0
- package/dist/chunk-563fcpv1.js +290 -0
- package/dist/chunk-564cnq6v.js +735 -0
- package/dist/chunk-569r8cxc.js +31 -0
- package/dist/chunk-570x55d4.js +12 -0
- package/dist/chunk-571556cm.js +80 -0
- package/dist/chunk-59t4c56e.js +63 -0
- package/dist/chunk-5axjhkma.js +36 -0
- package/dist/chunk-5b188q5e.js +157 -0
- package/dist/chunk-5dmn1865.js +439 -0
- package/dist/chunk-5ks4829r.js +267 -0
- package/dist/chunk-5mmhfbxb.js +1078 -0
- package/dist/chunk-5rdt14hy.js +742 -0
- package/dist/chunk-5ssryexj.js +121 -0
- package/dist/chunk-5v95pnq4.js +15 -0
- package/dist/chunk-5xvjt2t9.js +68 -0
- package/dist/chunk-5zyq6t1q.js +118 -0
- package/dist/chunk-60fkafk2.js +15 -0
- package/dist/chunk-62fjkf5q.js +46 -0
- package/dist/chunk-64gazrrb.js +8067 -0
- package/dist/chunk-65tq2yjx.js +126 -0
- package/dist/chunk-65zbgg1n.js +14 -0
- package/dist/chunk-66v8mty3.js +264 -0
- package/dist/chunk-6acx5heq.js +292 -0
- package/dist/chunk-6hr7742d.js +61 -0
- package/dist/chunk-6hygvrhn.js +143 -0
- package/dist/chunk-6kjh280m.js +128 -0
- package/dist/chunk-6s0q1s5r.js +66 -0
- package/dist/chunk-6x35ffpx.js +690 -0
- package/dist/chunk-71jfy1hh.js +570 -0
- package/dist/chunk-71sdcaq6.js +15 -0
- package/dist/chunk-754qdxs5.js +92 -0
- package/dist/chunk-79v5bkj4.js +1176 -0
- package/dist/chunk-7br0w7j5.js +151 -0
- package/dist/chunk-7cjgrzz1.js +298 -0
- package/dist/chunk-7d41ks0y.js +133 -0
- package/dist/chunk-7f40pmtr.js +71 -0
- package/dist/chunk-7g15x8hm.js +131 -0
- package/dist/chunk-7gtnzdet.js +120 -0
- package/dist/chunk-7h0z4aqx.js +702 -0
- package/dist/chunk-7h7e5a7d.js +25 -0
- package/dist/chunk-7m2cznwr.js +40 -0
- package/dist/chunk-7nvday0n.js +252 -0
- package/dist/chunk-7qey87th.js +145 -0
- package/dist/chunk-7qx3xhv3.js +9076 -0
- package/dist/chunk-7tfdhkpy.js +61 -0
- package/dist/chunk-80m511j6.js +121 -0
- package/dist/chunk-80ysxfe9.js +784 -0
- package/dist/chunk-8375zk8t.js +17200 -0
- package/dist/chunk-85bpkyy9.js +412 -0
- package/dist/chunk-85tcn547.js +876 -0
- package/dist/chunk-85vqgbc8.js +13 -0
- package/dist/chunk-86626jb4.js +49 -0
- package/dist/chunk-87ms17f6.js +444 -0
- package/dist/chunk-87mz239c.js +118 -0
- package/dist/chunk-89vdzt4e.js +254 -0
- package/dist/chunk-89z3e99z.js +159 -0
- package/dist/chunk-8cwrz1dd.js +1806 -0
- package/dist/chunk-8gv2pjby.js +21 -0
- package/dist/chunk-8hdevr3s.js +140 -0
- package/dist/chunk-8hdsk6qc.js +710 -0
- package/dist/chunk-8kct9arg.js +724 -0
- package/dist/chunk-8kf8h7xf.js +23 -0
- package/dist/chunk-8qed8ymj.js +605 -0
- package/dist/chunk-8sdgr592.js +101 -0
- package/dist/chunk-8we9w8pw.js +111 -0
- package/dist/chunk-8xnm5637.js +72 -0
- package/dist/chunk-8y3q0eqy.js +67 -0
- package/dist/chunk-8yvsnrkr.js +3449 -0
- package/dist/chunk-8zz4z1q3.js +42 -0
- package/dist/chunk-90eyff3k.js +119 -0
- package/dist/chunk-92bjkrf2.js +121 -0
- package/dist/chunk-92zrc7c6.js +327 -0
- package/dist/chunk-935nrvdb.js +13 -0
- package/dist/chunk-94pfyv6a.js +48 -0
- package/dist/chunk-9568p8se.js +115 -0
- package/dist/chunk-96km1ywr.js +37 -0
- package/dist/chunk-980bg4w4.js +163 -0
- package/dist/chunk-9a9g5hbj.js +205 -0
- package/dist/chunk-9cm4725d.js +4395 -0
- package/dist/chunk-9ds3vzq8.js +847 -0
- package/dist/chunk-9ffc9n60.js +618 -0
- package/dist/chunk-9fstrwv2.js +184 -0
- package/dist/chunk-9gt0g0qe.js +153 -0
- package/dist/chunk-9h9k5vz3.js +2761 -0
- package/dist/chunk-9he8bmhy.js +17 -0
- package/dist/chunk-9hn8e6h1.js +12 -0
- package/dist/chunk-9j0n3g8e.js +179 -0
- package/dist/chunk-9j6pa3ft.js +251 -0
- package/dist/chunk-9jpg9dn7.js +122 -0
- package/dist/chunk-9mycnwj5.js +46 -0
- package/dist/chunk-9npy2c17.js +517 -0
- package/dist/chunk-9p6sec8n.js +34 -0
- package/dist/chunk-9pnym83h.js +4584 -0
- package/dist/chunk-9skwrnd2.js +25 -0
- package/dist/chunk-9tsfaqr8.js +459 -0
- package/dist/chunk-9tsw3cqv.js +5924 -0
- package/dist/chunk-9w6ckyk4.js +49 -0
- package/dist/chunk-a15bwzv6.js +147 -0
- package/dist/chunk-a9t6cp69.js +28 -0
- package/dist/chunk-ad2yk19p.js +102 -0
- package/dist/chunk-ad4cw4nw.js +336 -0
- package/dist/chunk-ad69fbsk.js +347 -0
- package/dist/chunk-ae76ded0.js +30 -0
- package/dist/chunk-aeysytks.js +216 -0
- package/dist/chunk-ag81m9bq.js +61 -0
- package/dist/chunk-ahx7gp6r.js +4448 -0
- package/dist/chunk-aj4tk4tk.js +23 -0
- package/dist/chunk-an82t9jc.js +104 -0
- package/dist/chunk-apg95qd7.js +1393 -0
- package/dist/chunk-aq5n2adz.js +27 -0
- package/dist/chunk-aw4s3a99.js +208 -0
- package/dist/chunk-awgdfggg.js +14 -0
- package/dist/chunk-ayymxgn1.js +164 -0
- package/dist/chunk-azbab59e.js +637 -0
- package/dist/chunk-azdxq2a3.js +293 -0
- package/dist/chunk-b0tjx3k1.js +523 -0
- package/dist/chunk-b5pp4g2g.js +371 -0
- package/dist/chunk-b5zm8dt6.js +26 -0
- package/dist/chunk-bcnye5a0.js +109 -0
- package/dist/chunk-beqz3k49.js +190 -0
- package/dist/chunk-bf906wpw.js +147 -0
- package/dist/chunk-bgan4cpf.js +13 -0
- package/dist/chunk-bhzp13h7.js +1178 -0
- package/dist/chunk-bk403kpw.js +142 -0
- package/dist/chunk-bmq4c135.js +489 -0
- package/dist/chunk-bprbeda7.js +35 -0
- package/dist/chunk-bst7czdd.js +888 -0
- package/dist/chunk-bths4xgn.js +111 -0
- package/dist/chunk-btjn3qby.js +13 -0
- package/dist/chunk-bwb1vxnt.js +120 -0
- package/dist/chunk-bxa6tw4m.js +643 -0
- package/dist/chunk-bxfjr8qb.js +27 -0
- package/dist/chunk-bxpzhrej.js +73 -0
- package/dist/chunk-bzyzrq0k.js +51 -0
- package/dist/chunk-c0k7b0jw.js +4265 -0
- package/dist/chunk-c17f0h2s.js +16 -0
- package/dist/chunk-c1yc761e.js +6748 -0
- package/dist/chunk-c5g9shkw.js +298 -0
- package/dist/chunk-c696122m.js +69 -0
- package/dist/chunk-c92b3yxx.js +109 -0
- package/dist/chunk-c9aqz56y.js +143 -0
- package/dist/chunk-cba7c5w3.js +345 -0
- package/dist/chunk-cbcxbbe6.js +6543 -0
- package/dist/chunk-cdfjb87h.js +11 -0
- package/dist/chunk-ce8zjt1y.js +136 -0
- package/dist/chunk-cep7e37k.js +22740 -0
- package/dist/chunk-chs5qm8d.js +258 -0
- package/dist/chunk-ckydq33g.js +144 -0
- package/dist/chunk-cnge6wpj.js +514 -0
- package/dist/chunk-cpnsvqf1.js +13 -0
- package/dist/chunk-cqqebkv4.js +32 -0
- package/dist/chunk-cvqpp7dk.js +627 -0
- package/dist/chunk-cwc33j40.js +65 -0
- package/dist/chunk-cypvrq2a.js +155 -0
- package/dist/chunk-d1ha0swn.js +475 -0
- package/dist/chunk-d2an0138.js +35 -0
- package/dist/chunk-d2tt72ck.js +343 -0
- package/dist/chunk-d6wvcqrw.js +9507 -0
- package/dist/chunk-d7ys2kka.js +991 -0
- package/dist/chunk-dbts5q5p.js +122 -0
- package/dist/chunk-dct29ggs.js +295 -0
- package/dist/chunk-de0qnnf7.js +1059 -0
- package/dist/chunk-dep72ce4.js +513 -0
- package/dist/chunk-dgpvgy8x.js +47 -0
- package/dist/chunk-dhhd7dtc.js +20 -0
- package/dist/chunk-dhzpmxv6.js +594 -0
- package/dist/chunk-djes4da7.js +413 -0
- package/dist/chunk-dnhv3vx7.js +166 -0
- package/dist/chunk-dqtvafan.js +2365 -0
- package/dist/chunk-dr4a3tcp.js +60 -0
- package/dist/chunk-dz2xk9kb.js +100 -0
- package/dist/chunk-dz7nc6rf.js +15 -0
- package/dist/chunk-e3abfxpy.js +1486 -0
- package/dist/chunk-e3cq9z89.js +85 -0
- package/dist/chunk-e3j7m7k2.js +642 -0
- package/dist/chunk-e4dsy4g1.js +9951 -0
- package/dist/chunk-e5592pnn.js +197 -0
- package/dist/chunk-e55hdegh.js +129 -0
- package/dist/chunk-e5r5r04e.js +1030 -0
- package/dist/chunk-e60zztbt.js +442 -0
- package/dist/chunk-e7qq6vn0.js +372 -0
- package/dist/chunk-e9aat7xw.js +80 -0
- package/dist/chunk-e9d5v3zs.js +143 -0
- package/dist/chunk-eax32zk4.js +87 -0
- package/dist/chunk-ebfwmbx1.js +117 -0
- package/dist/chunk-ec71pb8t.js +971 -0
- package/dist/chunk-eemjb825.js +17252 -0
- package/dist/chunk-ees8xdhd.js +256 -0
- package/dist/chunk-eewg66y1.js +112 -0
- package/dist/chunk-eg22v12d.js +266 -0
- package/dist/chunk-enzzk67f.js +313 -0
- package/dist/chunk-eskhp70f.js +117 -0
- package/dist/chunk-ewx6z4g8.js +55 -0
- package/dist/chunk-eyvx461k.js +76 -0
- package/dist/chunk-eztq2b5f.js +94 -0
- package/dist/chunk-f0ffwzdd.js +321 -0
- package/dist/chunk-f80n68mf.js +119 -0
- package/dist/chunk-fae2hjxp.js +99 -0
- package/dist/chunk-fbtfp370.js +60 -0
- package/dist/chunk-fc6ndtgf.js +94 -0
- package/dist/chunk-fdwabr8p.js +13870 -0
- package/dist/chunk-fejeqe61.js +785 -0
- package/dist/chunk-fh0d6mvk.js +168 -0
- package/dist/chunk-fh19zcaf.js +304 -0
- package/dist/chunk-fh8bd39r.js +186 -0
- package/dist/chunk-fj2ebbpn.js +33 -0
- package/dist/chunk-fjn632v7.js +194 -0
- package/dist/chunk-fncpkzs5.js +1389 -0
- package/dist/chunk-fpd1gpt8.js +332 -0
- package/dist/chunk-fq9snrnh.js +295 -0
- package/dist/chunk-fqcfzg3j.js +207 -0
- package/dist/chunk-ftt3vqj2.js +1919 -0
- package/dist/chunk-g06pm4n9.js +395 -0
- package/dist/chunk-g4m5pf4g.js +8 -0
- package/dist/chunk-g72h52y6.js +36 -0
- package/dist/chunk-g79ej71s.js +1627 -0
- package/dist/chunk-g7fwk59d.js +19 -0
- package/dist/chunk-g9jnkrtm.js +663 -0
- package/dist/chunk-g9vg5d7t.js +38 -0
- package/dist/chunk-ga1jkyqy.js +1636 -0
- package/dist/chunk-gaaap2nk.js +676 -0
- package/dist/chunk-gc6erq5q.js +483 -0
- package/dist/chunk-gjrcmf0a.js +752 -0
- package/dist/chunk-gmdy2w3z.js +238999 -0
- package/dist/chunk-gsz4yrrk.js +81 -0
- package/dist/chunk-gy47rjy8.js +3830 -0
- package/dist/chunk-h12a4f4x.js +11 -0
- package/dist/chunk-h1yratmg.js +725 -0
- package/dist/chunk-h9y0jnsy.js +155 -0
- package/dist/chunk-hbhs3mwy.js +133 -0
- package/dist/chunk-hbs8cmb4.js +8 -0
- package/dist/chunk-hdk0t1ht.js +940 -0
- package/dist/chunk-hef8dx4s.js +178 -0
- package/dist/chunk-hgsca8mt.js +381 -0
- package/dist/chunk-hhsxm2yr.js +67 -0
- package/dist/chunk-hj5tzzpd.js +39 -0
- package/dist/chunk-hjxqmtg5.js +94 -0
- package/dist/chunk-hn4w9pkj.js +68 -0
- package/dist/chunk-hnprkjgp.js +25 -0
- package/dist/chunk-hq3n5ex7.js +183 -0
- package/dist/chunk-hqjspfma.js +158 -0
- package/dist/chunk-hqxp6b72.js +1198 -0
- package/dist/chunk-hs6nrmq6.js +94 -0
- package/dist/chunk-hwba5xdc.js +267 -0
- package/dist/chunk-hy566ev3.js +430 -0
- package/dist/chunk-hzmzwte2.js +153 -0
- package/dist/chunk-hzxzvzw8.js +274 -0
- package/dist/chunk-j139fzgs.js +114 -0
- package/dist/chunk-j1mep9ck.js +62 -0
- package/dist/chunk-j3xveeg4.js +273 -0
- package/dist/chunk-j5y1s11j.js +100 -0
- package/dist/chunk-j9475b46.js +26 -0
- package/dist/chunk-j9rgqs8m.js +1192 -0
- package/dist/chunk-jccjaddz.js +74 -0
- package/dist/chunk-jdkwfy9e.js +35 -0
- package/dist/chunk-jdqp0r4h.js +6157 -0
- package/dist/chunk-jdzk4zwn.js +587 -0
- package/dist/chunk-jfafmkte.js +49 -0
- package/dist/chunk-jg3r989b.js +16 -0
- package/dist/chunk-jhtccjc9.js +54 -0
- package/dist/chunk-jj2ff1pr.js +688 -0
- package/dist/chunk-jmv7k0jn.js +37 -0
- package/dist/chunk-jmxzmwpw.js +65 -0
- package/dist/chunk-jnjxdqyr.js +353 -0
- package/dist/chunk-jsbbez9j.js +138 -0
- package/dist/chunk-jvpt2dc0.js +424 -0
- package/dist/chunk-jwd7cka0.js +34 -0
- package/dist/chunk-jy5er3st.js +15 -0
- package/dist/chunk-jyby79z5.js +121 -0
- package/dist/chunk-jzyr6j5n.js +332 -0
- package/dist/chunk-k49xc781.js +63 -0
- package/dist/chunk-k7dt2g4a.js +41 -0
- package/dist/chunk-k7hexw3v.js +969 -0
- package/dist/chunk-k7wwkraa.js +117 -0
- package/dist/chunk-kb3758f7.js +51 -0
- package/dist/chunk-kc67kt75.js +3119 -0
- package/dist/chunk-kdhmfxmh.js +3149 -0
- package/dist/chunk-kejdd6zc.js +51 -0
- package/dist/chunk-kekrjeem.js +402 -0
- package/dist/chunk-kez5r0zz.js +280 -0
- package/dist/chunk-kfsvcs5t.js +75 -0
- package/dist/chunk-khtvffc4.js +285 -0
- package/dist/chunk-kkz4w1tv.js +64 -0
- package/dist/chunk-kmywng0j.js +272 -0
- package/dist/chunk-kq6vcpdr.js +224 -0
- package/dist/chunk-kqzdszcc.js +37 -0
- package/dist/chunk-ktxpp02w.js +435 -0
- package/dist/chunk-kwcvhbtz.js +26 -0
- package/dist/chunk-kx0cm9qr.js +128 -0
- package/dist/chunk-kxcmqz10.js +120 -0
- package/dist/chunk-kxwava1g.js +14 -0
- package/dist/chunk-kywtr3jg.js +825 -0
- package/dist/chunk-kzwg923p.js +8 -0
- package/dist/chunk-m1eq3sgv.js +255 -0
- package/dist/chunk-m21h5zb4.js +119 -0
- package/dist/chunk-m2c3bjv1.js +111 -0
- package/dist/chunk-m41e19ms.js +42 -0
- package/dist/chunk-m7ka36ex.js +97 -0
- package/dist/chunk-m81w8tbm.js +259 -0
- package/dist/chunk-m95ggkax.js +281 -0
- package/dist/chunk-manx26xa.js +145 -0
- package/dist/chunk-mdxh3pk2.js +298 -0
- package/dist/chunk-mhbfkcja.js +311 -0
- package/dist/chunk-mjnr5erm.js +173 -0
- package/dist/chunk-mngvnmwp.js +135 -0
- package/dist/chunk-mvfqanv5.js +63 -0
- package/dist/chunk-mw1nesq1.js +140 -0
- package/dist/chunk-mx168925.js +661 -0
- package/dist/chunk-mxwvj18g.js +795 -0
- package/dist/chunk-my7r5mba.js +257 -0
- package/dist/chunk-myaa1kkf.js +17 -0
- package/dist/chunk-myypc3tn.js +46 -0
- package/dist/chunk-mzcnmnpq.js +3379 -0
- package/dist/chunk-mznav6d1.js +194 -0
- package/dist/chunk-n0qxskpr.js +24 -0
- package/dist/chunk-n6a6hgtp.js +394 -0
- package/dist/chunk-n6d5fgx0.js +254 -0
- package/dist/chunk-n6ym3n03.js +120 -0
- package/dist/chunk-n9g24mwe.js +104 -0
- package/dist/chunk-naamqdf9.js +185 -0
- package/dist/chunk-nb2jk7zj.js +15 -0
- package/dist/chunk-nbkbq9en.js +67 -0
- package/dist/chunk-ndttd6es.js +38 -0
- package/dist/chunk-nfygaaxg.js +133 -0
- package/dist/chunk-ngdzpszd.js +454 -0
- package/dist/chunk-nmfwksa4.js +1297 -0
- package/dist/chunk-nt837qt9.js +21 -0
- package/dist/chunk-nwc3v0vp.js +691 -0
- package/dist/chunk-nz8ha95p.js +3610 -0
- package/dist/chunk-nzxfj0gq.js +2007 -0
- package/dist/chunk-p0r8887g.js +6932 -0
- package/dist/chunk-p1seyqdm.js +120 -0
- package/dist/chunk-p425zbgw.js +726 -0
- package/dist/chunk-p7hamd2c.js +146 -0
- package/dist/chunk-pdvg91cg.js +32 -0
- package/dist/chunk-pecy49yr.js +14649 -0
- package/dist/chunk-pfxrg89f.js +547 -0
- package/dist/chunk-pfyw3155.js +2750 -0
- package/dist/chunk-pr8m11pm.js +1192 -0
- package/dist/chunk-ptxteaeh.js +1591 -0
- package/dist/chunk-pv164mac.js +394 -0
- package/dist/chunk-pxxhtxf5.js +10154 -0
- package/dist/chunk-q0e485mg.js +61 -0
- package/dist/chunk-q1vrhh0q.js +458 -0
- package/dist/chunk-q2h79ncs.js +370 -0
- package/dist/chunk-q3b4n194.js +56 -0
- package/dist/chunk-q44zc68f.js +4301 -0
- package/dist/chunk-q8gknbdx.js +352 -0
- package/dist/chunk-q8xk3kdj.js +11 -0
- package/dist/chunk-qak46xtp.js +119 -0
- package/dist/chunk-qfq7absv.js +95 -0
- package/dist/chunk-qfsn720k.js +151 -0
- package/dist/chunk-qg4811f6.js +228 -0
- package/dist/chunk-qgzn3qps.js +90 -0
- package/dist/chunk-qhaggqkt.js +113 -0
- package/dist/chunk-qjjp27z8.js +195 -0
- package/dist/chunk-qxp0nye6.js +34 -0
- package/dist/chunk-qy3nagaq.js +4957 -0
- package/dist/chunk-qz2meav1.js +1452 -0
- package/dist/chunk-r50hne7m.js +63 -0
- package/dist/chunk-r6m0vgnv.js +80 -0
- package/dist/chunk-r7yw38vf.js +22864 -0
- package/dist/chunk-r8xc618w.js +42 -0
- package/dist/chunk-r961r5kj.js +87 -0
- package/dist/chunk-r9b5xrh0.js +66 -0
- package/dist/chunk-rcn2pd6q.js +477 -0
- package/dist/chunk-rdeh8p3y.js +148 -0
- package/dist/chunk-rg9x1742.js +542 -0
- package/dist/chunk-rgyzsbs3.js +39 -0
- package/dist/chunk-rk2fsxtz.js +16 -0
- package/dist/chunk-rkchkwv9.js +40 -0
- package/dist/chunk-rp8whpb3.js +478 -0
- package/dist/chunk-rpkxdtgr.js +68 -0
- package/dist/chunk-rpmntgyh.js +394 -0
- package/dist/chunk-rpshz4dy.js +614 -0
- package/dist/chunk-rqd60ay5.js +133 -0
- package/dist/chunk-rrsjf2ea.js +229 -0
- package/dist/chunk-rtjk8c8e.js +173 -0
- package/dist/chunk-rw0y2wdf.js +1017 -0
- package/dist/chunk-rx5w7ess.js +663 -0
- package/dist/chunk-rx8t9d35.js +1947 -0
- package/dist/chunk-rxcazxgf.js +195 -0
- package/dist/chunk-rxg6q3bp.js +1413 -0
- package/dist/chunk-rxrb7xnd.js +71 -0
- package/dist/chunk-rxrzxff3.js +118 -0
- package/dist/chunk-ryqjc943.js +71 -0
- package/dist/chunk-rzk9k2rf.js +81 -0
- package/dist/chunk-s2qv0nht.js +119 -0
- package/dist/chunk-s3hafnk3.js +2285 -0
- package/dist/chunk-s4a496tt.js +226 -0
- package/dist/chunk-s4d1h3ka.js +35 -0
- package/dist/chunk-sm3k3ze4.js +16525 -0
- package/dist/chunk-sn0bja82.js +385 -0
- package/dist/chunk-sngjggw1.js +4227 -0
- package/dist/chunk-sq047n34.js +364 -0
- package/dist/chunk-sttwe2tw.js +8584 -0
- package/dist/chunk-sw8qx1r0.js +86 -0
- package/dist/chunk-swstah6a.js +240 -0
- package/dist/chunk-syrkr0mf.js +63 -0
- package/dist/chunk-sz206bd9.js +26 -0
- package/dist/chunk-t09669cj.js +333 -0
- package/dist/chunk-t5f8e30k.js +602 -0
- package/dist/chunk-t5m78mc8.js +432 -0
- package/dist/chunk-t5x1dqwn.js +143 -0
- package/dist/chunk-t877ea0w.js +168 -0
- package/dist/chunk-t91hb71c.js +17 -0
- package/dist/chunk-tb636bcf.js +942 -0
- package/dist/chunk-tb8sykbr.js +426 -0
- package/dist/chunk-tbdkekz3.js +125 -0
- package/dist/chunk-td2gsz7s.js +225 -0
- package/dist/chunk-tenvxbyh.js +20 -0
- package/dist/chunk-texg4qqt.js +317 -0
- package/dist/chunk-teymzz80.js +266 -0
- package/dist/chunk-tj26qpf7.js +153 -0
- package/dist/chunk-tk85ec4p.js +395 -0
- package/dist/chunk-tq205h01.js +164 -0
- package/dist/chunk-tqzddjzg.js +61 -0
- package/dist/chunk-trqrj23e.js +134 -0
- package/dist/chunk-tw1hfsxv.js +2477 -0
- package/dist/chunk-txxdfq83.js +122 -0
- package/dist/chunk-v0yhe582.js +31 -0
- package/dist/chunk-v14184xm.js +15 -0
- package/dist/chunk-v1h9z4hw.js +138 -0
- package/dist/chunk-v3ey5j7f.js +329 -0
- package/dist/chunk-v3nh1sfn.js +208 -0
- package/dist/chunk-v3x8tcc0.js +45 -0
- package/dist/chunk-v4nqnvqq.js +3984 -0
- package/dist/chunk-v4ypszbb.js +15 -0
- package/dist/chunk-v7wbqcx9.js +63 -0
- package/dist/chunk-v8r5fev3.js +341 -0
- package/dist/chunk-v9zg5kzx.js +2810 -0
- package/dist/chunk-va1wh5ss.js +24 -0
- package/dist/chunk-vbfswhht.js +42 -0
- package/dist/chunk-ve7x2tfq.js +124 -0
- package/dist/chunk-vfz8k89y.js +485 -0
- package/dist/chunk-vgm5k14x.js +35678 -0
- package/dist/chunk-vh9pej3c.js +247 -0
- package/dist/chunk-vjxqyt6f.js +3820 -0
- package/dist/chunk-vpb1xstn.js +178 -0
- package/dist/chunk-vqt79tj8.js +110 -0
- package/dist/chunk-vr0n9pv9.js +152 -0
- package/dist/chunk-vrejmja5.js +90 -0
- package/dist/chunk-vrxasmdw.js +449 -0
- package/dist/chunk-vrxb946v.js +125 -0
- package/dist/chunk-vv4kj0q8.js +98 -0
- package/dist/chunk-vvpfng7w.js +8 -0
- package/dist/chunk-vw6ybyew.js +2007 -0
- package/dist/chunk-vwenx8ke.js +17 -0
- package/dist/chunk-vwfa0s5a.js +155 -0
- package/dist/chunk-vx71j8xe.js +63 -0
- package/dist/chunk-vxbjzggp.js +43 -0
- package/dist/chunk-vxjxtz8w.js +440 -0
- package/dist/chunk-vy0c1bwp.js +9 -0
- package/dist/chunk-w3zczyse.js +14 -0
- package/dist/chunk-w4p5t920.js +655 -0
- package/dist/chunk-w68wc625.js +287 -0
- package/dist/chunk-w9ddp3yf.js +96 -0
- package/dist/chunk-wcggm5ja.js +125 -0
- package/dist/chunk-wgnyph3q.js +1306 -0
- package/dist/chunk-wjm5pc1e.js +134 -0
- package/dist/chunk-wnve0drm.js +131 -0
- package/dist/chunk-wp27ev2k.js +135 -0
- package/dist/chunk-wyvy8a4x.js +131 -0
- package/dist/chunk-x671y4dk.js +129 -0
- package/dist/chunk-xbj5keyy.js +22 -0
- package/dist/chunk-xf4fzms8.js +39 -0
- package/dist/chunk-xf59k3zg.js +65 -0
- package/dist/chunk-xgzc4w49.js +204 -0
- package/dist/chunk-xhj7g13b.js +2149 -0
- package/dist/chunk-xjp0cd00.js +56 -0
- package/dist/chunk-xkhnmhqs.js +74 -0
- package/dist/chunk-xkrkqx61.js +55 -0
- package/dist/chunk-xmpgmeb8.js +114 -0
- package/dist/chunk-xrw80zgd.js +4249 -0
- package/dist/chunk-xrzc96g0.js +202 -0
- package/dist/chunk-xt76sm44.js +318 -0
- package/dist/chunk-xwet3awb.js +20 -0
- package/dist/chunk-xyg1sk2w.js +78 -0
- package/dist/chunk-y0jpkqb0.js +180 -0
- package/dist/chunk-y1q7rt9n.js +102 -0
- package/dist/chunk-y67ntyek.js +258 -0
- package/dist/chunk-ybk37qp9.js +37 -0
- package/dist/chunk-yc1stfve.js +5386 -0
- package/dist/chunk-ychjpjef.js +62 -0
- package/dist/chunk-yez8fa9g.js +276 -0
- package/dist/chunk-ygm7xszr.js +90 -0
- package/dist/chunk-ym11azkj.js +37 -0
- package/dist/chunk-ympz2h15.js +578 -0
- package/dist/chunk-yqx3az3n.js +129 -0
- package/dist/chunk-yt3nfhcc.js +152 -0
- package/dist/chunk-yy8q0n8s.js +120 -0
- package/dist/chunk-yzb92zxv.js +8 -0
- package/dist/chunk-yzet6xyr.js +119 -0
- package/dist/chunk-yzm97qp1.js +226 -0
- package/dist/chunk-z0jgeax8.js +35 -0
- package/dist/chunk-z1r3z6w6.js +29 -0
- package/dist/chunk-z2dp53wn.js +17 -0
- package/dist/chunk-z79355gz.js +308 -0
- package/dist/chunk-z7e94hxz.js +251 -0
- package/dist/chunk-z8cqdcec.js +173 -0
- package/dist/chunk-z99tbg45.js +148 -0
- package/dist/chunk-z9nsjcht.js +37 -0
- package/dist/chunk-za3k6h2h.js +470 -0
- package/dist/chunk-zacynq5p.js +265 -0
- package/dist/chunk-zb0x40az.js +1785 -0
- package/dist/chunk-zbxtzycc.js +274 -0
- package/dist/chunk-zga50181.js +342 -0
- package/dist/chunk-zhb2pns1.js +44 -0
- package/dist/chunk-zkch6trx.js +231 -0
- package/dist/chunk-znf3z4qt.js +954 -0
- package/dist/chunk-zp8zwdgq.js +72 -0
- package/dist/chunk-ztjd8pyf.js +120 -0
- package/dist/chunk-ztmb7geg.js +173 -0
- package/dist/chunk-zvr4snzv.js +887 -0
- package/dist/chunk-zw62m6n3.js +34858 -0
- package/dist/chunk-zwwdebd0.js +65 -0
- package/dist/chunk-zxc6x9w8.js +340 -0
- package/dist/chunk-zy2e7sz0.js +8 -0
- package/dist/chunk-zzf074w3.js +196 -0
- package/dist/chunk-zzz0nwb5.js +310 -0
- package/dist/cli-bun.js +2 -0
- package/dist/cli-node.js +2 -0
- package/dist/cli.js +218 -0
- package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/package.json +243 -0
- package/scripts/chrome-mcp-bridge-resolver.mjs +43 -0
- package/scripts/chrome-mcp-env.mjs +19 -0
- package/scripts/postinstall.cjs +339 -0
- package/scripts/run-parallel.mjs +10 -0
- package/scripts/setup-chrome-mcp.mjs +69 -0
|
@@ -0,0 +1,1785 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Fuse,
|
|
4
|
+
init_fuse
|
|
5
|
+
} from "./chunk-ftt3vqj2.js";
|
|
6
|
+
import {
|
|
7
|
+
Messages,
|
|
8
|
+
init_Messages
|
|
9
|
+
} from "./chunk-9cm4725d.js";
|
|
10
|
+
import {
|
|
11
|
+
init_SearchBox
|
|
12
|
+
} from "./chunk-awgdfggg.js";
|
|
13
|
+
import {
|
|
14
|
+
init_useSearchInput,
|
|
15
|
+
useSearchInput
|
|
16
|
+
} from "./chunk-z79355gz.js";
|
|
17
|
+
import {
|
|
18
|
+
ConfigurableShortcutHint,
|
|
19
|
+
Select,
|
|
20
|
+
Spinner,
|
|
21
|
+
TextInput,
|
|
22
|
+
getAllBaseTools,
|
|
23
|
+
getFirstMeaningfulUserMessageTextContent,
|
|
24
|
+
getSessionIdFromLog,
|
|
25
|
+
getTheme,
|
|
26
|
+
getWorktreePaths,
|
|
27
|
+
init_ConfigurableShortcutHint,
|
|
28
|
+
init_Spinner,
|
|
29
|
+
init_TextInput,
|
|
30
|
+
init_getWorktreePaths,
|
|
31
|
+
init_select,
|
|
32
|
+
init_sessionStorage,
|
|
33
|
+
init_sideQuery,
|
|
34
|
+
init_theme,
|
|
35
|
+
init_tools1 as init_tools,
|
|
36
|
+
init_useTerminalSize,
|
|
37
|
+
isCustomTitleEnabled,
|
|
38
|
+
isLiteLog,
|
|
39
|
+
loadFullLog,
|
|
40
|
+
saveCustomTitle,
|
|
41
|
+
sideQuery
|
|
42
|
+
} from "./chunk-gmdy2w3z.js";
|
|
43
|
+
import {
|
|
44
|
+
init_shellQuote,
|
|
45
|
+
quote
|
|
46
|
+
} from "./chunk-rpmntgyh.js";
|
|
47
|
+
import {
|
|
48
|
+
init_useExitOnCtrlCDWithKeybindings,
|
|
49
|
+
useExitOnCtrlCDWithKeybindings
|
|
50
|
+
} from "./chunk-hzxzvzw8.js";
|
|
51
|
+
import {
|
|
52
|
+
init_useKeybinding
|
|
53
|
+
} from "./chunk-65zbgg1n.js";
|
|
54
|
+
import {
|
|
55
|
+
getSmallFastModel,
|
|
56
|
+
init_model
|
|
57
|
+
} from "./chunk-eemjb825.js";
|
|
58
|
+
import {
|
|
59
|
+
count,
|
|
60
|
+
init_array
|
|
61
|
+
} from "./chunk-k7hexw3v.js";
|
|
62
|
+
import {
|
|
63
|
+
formatLogMetadata,
|
|
64
|
+
formatRelativeTimeAgo,
|
|
65
|
+
init_format,
|
|
66
|
+
truncateToWidth
|
|
67
|
+
} from "./chunk-q1vrhh0q.js";
|
|
68
|
+
import {
|
|
69
|
+
Byline,
|
|
70
|
+
Divider,
|
|
71
|
+
KeyboardShortcutHint,
|
|
72
|
+
LoadingState,
|
|
73
|
+
SearchBox,
|
|
74
|
+
ThemedBox_default,
|
|
75
|
+
ThemedText,
|
|
76
|
+
applyColor,
|
|
77
|
+
init_source,
|
|
78
|
+
init_src,
|
|
79
|
+
source_default,
|
|
80
|
+
stringWidth,
|
|
81
|
+
useKeybinding,
|
|
82
|
+
useTerminalFocus,
|
|
83
|
+
useTerminalSize,
|
|
84
|
+
useTheme,
|
|
85
|
+
use_input_default
|
|
86
|
+
} from "./chunk-2g0ytd9d.js";
|
|
87
|
+
import {
|
|
88
|
+
require_jsx_dev_runtime,
|
|
89
|
+
require_react
|
|
90
|
+
} from "./chunk-de0qnnf7.js";
|
|
91
|
+
import {
|
|
92
|
+
init_analytics,
|
|
93
|
+
logEvent
|
|
94
|
+
} from "./chunk-j1mep9ck.js";
|
|
95
|
+
import {
|
|
96
|
+
getBranch,
|
|
97
|
+
init_git
|
|
98
|
+
} from "./chunk-10k5jfc5.js";
|
|
99
|
+
import {
|
|
100
|
+
figures_default,
|
|
101
|
+
init_figures
|
|
102
|
+
} from "./chunk-c5g9shkw.js";
|
|
103
|
+
import {
|
|
104
|
+
getLogDisplayTitle,
|
|
105
|
+
init_debug,
|
|
106
|
+
init_log,
|
|
107
|
+
init_slowOperations,
|
|
108
|
+
jsonParse,
|
|
109
|
+
logError,
|
|
110
|
+
logForDebugging
|
|
111
|
+
} from "./chunk-s3hafnk3.js";
|
|
112
|
+
import {
|
|
113
|
+
getOriginalCwd,
|
|
114
|
+
getSessionId,
|
|
115
|
+
init_state
|
|
116
|
+
} from "./chunk-9h9k5vz3.js";
|
|
117
|
+
import {
|
|
118
|
+
__esm,
|
|
119
|
+
__toESM
|
|
120
|
+
} from "./chunk-hhsxm2yr.js";
|
|
121
|
+
|
|
122
|
+
// src/components/SessionPreview.tsx
|
|
123
|
+
function SessionPreview({
|
|
124
|
+
log,
|
|
125
|
+
onExit,
|
|
126
|
+
onSelect
|
|
127
|
+
}) {
|
|
128
|
+
const [fullLog, setFullLog] = import_react.default.useState(null);
|
|
129
|
+
import_react.default.useEffect(() => {
|
|
130
|
+
setFullLog(null);
|
|
131
|
+
if (isLiteLog(log)) {
|
|
132
|
+
loadFullLog(log).then(setFullLog);
|
|
133
|
+
}
|
|
134
|
+
}, [log]);
|
|
135
|
+
const isLoading = isLiteLog(log) && fullLog === null;
|
|
136
|
+
const displayLog = fullLog ?? log;
|
|
137
|
+
const conversationId = getSessionIdFromLog(displayLog) || "";
|
|
138
|
+
const tools = getAllBaseTools();
|
|
139
|
+
useKeybinding("confirm:no", onExit, { context: "Confirmation" });
|
|
140
|
+
const handleSelect = import_react.useCallback(() => {
|
|
141
|
+
onSelect(fullLog ?? log);
|
|
142
|
+
}, [onSelect, fullLog, log]);
|
|
143
|
+
useKeybinding("confirm:yes", handleSelect, { context: "Confirmation" });
|
|
144
|
+
if (isLoading) {
|
|
145
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
146
|
+
flexDirection: "column",
|
|
147
|
+
padding: 1,
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(LoadingState, {
|
|
150
|
+
message: "Loading session\u2026"
|
|
151
|
+
}, undefined, false, undefined, this),
|
|
152
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
153
|
+
dimColor: true,
|
|
154
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
|
|
155
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
|
|
156
|
+
action: "confirm:no",
|
|
157
|
+
context: "Confirmation",
|
|
158
|
+
fallback: "Esc",
|
|
159
|
+
description: "cancel"
|
|
160
|
+
}, undefined, false, undefined, this)
|
|
161
|
+
}, undefined, false, undefined, this)
|
|
162
|
+
}, undefined, false, undefined, this)
|
|
163
|
+
]
|
|
164
|
+
}, undefined, true, undefined, this);
|
|
165
|
+
}
|
|
166
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
167
|
+
flexDirection: "column",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(Messages, {
|
|
170
|
+
messages: displayLog.messages,
|
|
171
|
+
tools,
|
|
172
|
+
commands: [],
|
|
173
|
+
verbose: true,
|
|
174
|
+
toolJSX: null,
|
|
175
|
+
toolUseConfirmQueue: [],
|
|
176
|
+
inProgressToolUseIDs: new Set,
|
|
177
|
+
isMessageSelectorVisible: false,
|
|
178
|
+
conversationId,
|
|
179
|
+
screen: "transcript",
|
|
180
|
+
streamingToolUses: [],
|
|
181
|
+
showAllInTranscript: true,
|
|
182
|
+
isLoading: false
|
|
183
|
+
}, undefined, false, undefined, this),
|
|
184
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
|
|
185
|
+
flexShrink: 0,
|
|
186
|
+
flexDirection: "column",
|
|
187
|
+
borderTopDimColor: true,
|
|
188
|
+
borderBottom: false,
|
|
189
|
+
borderLeft: false,
|
|
190
|
+
borderRight: false,
|
|
191
|
+
borderStyle: "single",
|
|
192
|
+
paddingLeft: 2,
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
195
|
+
children: [
|
|
196
|
+
formatRelativeTimeAgo(displayLog.modified),
|
|
197
|
+
" \xB7",
|
|
198
|
+
" ",
|
|
199
|
+
displayLog.messageCount,
|
|
200
|
+
" messages",
|
|
201
|
+
displayLog.gitBranch ? ` \xB7 ${displayLog.gitBranch}` : ""
|
|
202
|
+
]
|
|
203
|
+
}, undefined, true, undefined, this),
|
|
204
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
|
|
205
|
+
dimColor: true,
|
|
206
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
|
|
209
|
+
shortcut: "Enter",
|
|
210
|
+
action: "resume"
|
|
211
|
+
}, undefined, false, undefined, this),
|
|
212
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
|
|
213
|
+
action: "confirm:no",
|
|
214
|
+
context: "Confirmation",
|
|
215
|
+
fallback: "Esc",
|
|
216
|
+
description: "cancel"
|
|
217
|
+
}, undefined, false, undefined, this)
|
|
218
|
+
]
|
|
219
|
+
}, undefined, true, undefined, this)
|
|
220
|
+
}, undefined, false, undefined, this)
|
|
221
|
+
]
|
|
222
|
+
}, undefined, true, undefined, this)
|
|
223
|
+
]
|
|
224
|
+
}, undefined, true, undefined, this);
|
|
225
|
+
}
|
|
226
|
+
var import_react, jsx_dev_runtime;
|
|
227
|
+
var init_SessionPreview = __esm(() => {
|
|
228
|
+
init_src();
|
|
229
|
+
init_useKeybinding();
|
|
230
|
+
init_tools();
|
|
231
|
+
init_format();
|
|
232
|
+
init_sessionStorage();
|
|
233
|
+
init_ConfigurableShortcutHint();
|
|
234
|
+
init_Messages();
|
|
235
|
+
import_react = __toESM(require_react(), 1);
|
|
236
|
+
jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// src/components/TagTabs.tsx
|
|
240
|
+
function getTabWidth(tab, maxWidth) {
|
|
241
|
+
if (tab === ALL_TAB_LABEL) {
|
|
242
|
+
return ALL_TAB_LABEL.length + TAB_PADDING;
|
|
243
|
+
}
|
|
244
|
+
const tagWidth = stringWidth(tab);
|
|
245
|
+
const effectiveTagWidth = maxWidth ? Math.min(tagWidth, maxWidth - TAB_PADDING - HASH_PREFIX_LENGTH) : tagWidth;
|
|
246
|
+
return Math.max(0, effectiveTagWidth) + TAB_PADDING + HASH_PREFIX_LENGTH;
|
|
247
|
+
}
|
|
248
|
+
function truncateTag(tag, maxWidth) {
|
|
249
|
+
const availableForTag = maxWidth - TAB_PADDING - HASH_PREFIX_LENGTH;
|
|
250
|
+
if (stringWidth(tag) <= availableForTag) {
|
|
251
|
+
return tag;
|
|
252
|
+
}
|
|
253
|
+
if (availableForTag <= 1) {
|
|
254
|
+
return tag.charAt(0);
|
|
255
|
+
}
|
|
256
|
+
return truncateToWidth(tag, availableForTag);
|
|
257
|
+
}
|
|
258
|
+
function TagTabs({
|
|
259
|
+
tabs,
|
|
260
|
+
selectedIndex,
|
|
261
|
+
availableWidth,
|
|
262
|
+
showAllProjects = false
|
|
263
|
+
}) {
|
|
264
|
+
const resumeLabel = showAllProjects ? "Resume (All Projects)" : "Resume";
|
|
265
|
+
const resumeLabelWidth = resumeLabel.length + 1;
|
|
266
|
+
const rightHintWidth = Math.max(RIGHT_HINT_WIDTH_WITH_COUNT, RIGHT_HINT_WIDTH_NO_COUNT);
|
|
267
|
+
const maxTabsWidth = availableWidth - resumeLabelWidth - rightHintWidth - 2;
|
|
268
|
+
const safeSelectedIndex = Math.max(0, Math.min(selectedIndex, tabs.length - 1));
|
|
269
|
+
const maxSingleTabWidth = Math.max(20, Math.floor(maxTabsWidth / 2));
|
|
270
|
+
const tabWidths = tabs.map((tab) => getTabWidth(tab, maxSingleTabWidth));
|
|
271
|
+
let startIndex = 0;
|
|
272
|
+
let endIndex = tabs.length;
|
|
273
|
+
const totalTabsWidth = tabWidths.reduce((sum, w, i) => sum + w + (i < tabWidths.length - 1 ? 1 : 0), 0);
|
|
274
|
+
if (totalTabsWidth > maxTabsWidth) {
|
|
275
|
+
const effectiveMaxWidth = maxTabsWidth - LEFT_ARROW_WIDTH;
|
|
276
|
+
let windowWidth = tabWidths[safeSelectedIndex] ?? 0;
|
|
277
|
+
startIndex = safeSelectedIndex;
|
|
278
|
+
endIndex = safeSelectedIndex + 1;
|
|
279
|
+
while (startIndex > 0 || endIndex < tabs.length) {
|
|
280
|
+
const canExpandLeft = startIndex > 0;
|
|
281
|
+
const canExpandRight = endIndex < tabs.length;
|
|
282
|
+
if (canExpandLeft) {
|
|
283
|
+
const leftWidth = (tabWidths[startIndex - 1] ?? 0) + 1;
|
|
284
|
+
if (windowWidth + leftWidth <= effectiveMaxWidth) {
|
|
285
|
+
startIndex--;
|
|
286
|
+
windowWidth += leftWidth;
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (canExpandRight) {
|
|
291
|
+
const rightWidth = (tabWidths[endIndex] ?? 0) + 1;
|
|
292
|
+
if (windowWidth + rightWidth <= effectiveMaxWidth) {
|
|
293
|
+
endIndex++;
|
|
294
|
+
windowWidth += rightWidth;
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const hiddenLeft = startIndex;
|
|
302
|
+
const hiddenRight = tabs.length - endIndex;
|
|
303
|
+
const visibleTabs = tabs.slice(startIndex, endIndex);
|
|
304
|
+
const visibleIndices = visibleTabs.map((_, i) => startIndex + i);
|
|
305
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
|
|
306
|
+
flexDirection: "row",
|
|
307
|
+
gap: 1,
|
|
308
|
+
children: [
|
|
309
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
310
|
+
color: "suggestion",
|
|
311
|
+
children: resumeLabel
|
|
312
|
+
}, undefined, false, undefined, this),
|
|
313
|
+
hiddenLeft > 0 && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
314
|
+
dimColor: true,
|
|
315
|
+
children: [
|
|
316
|
+
LEFT_ARROW_PREFIX,
|
|
317
|
+
hiddenLeft
|
|
318
|
+
]
|
|
319
|
+
}, undefined, true, undefined, this),
|
|
320
|
+
visibleTabs.map((tab, i) => {
|
|
321
|
+
const actualIndex = visibleIndices[i];
|
|
322
|
+
const isSelected = actualIndex === safeSelectedIndex;
|
|
323
|
+
const displayText = tab === ALL_TAB_LABEL ? tab : `#${truncateTag(tab, maxSingleTabWidth - TAB_PADDING)}`;
|
|
324
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
325
|
+
backgroundColor: isSelected ? "suggestion" : undefined,
|
|
326
|
+
color: isSelected ? "inverseText" : undefined,
|
|
327
|
+
bold: isSelected,
|
|
328
|
+
children: [
|
|
329
|
+
" ",
|
|
330
|
+
displayText,
|
|
331
|
+
" "
|
|
332
|
+
]
|
|
333
|
+
}, tab, true, undefined, this);
|
|
334
|
+
}),
|
|
335
|
+
hiddenRight > 0 ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
336
|
+
dimColor: true,
|
|
337
|
+
children: [
|
|
338
|
+
RIGHT_HINT_WITH_COUNT_PREFIX,
|
|
339
|
+
hiddenRight,
|
|
340
|
+
RIGHT_HINT_SUFFIX
|
|
341
|
+
]
|
|
342
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
|
|
343
|
+
dimColor: true,
|
|
344
|
+
children: RIGHT_HINT_NO_COUNT
|
|
345
|
+
}, undefined, false, undefined, this)
|
|
346
|
+
]
|
|
347
|
+
}, undefined, true, undefined, this);
|
|
348
|
+
}
|
|
349
|
+
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;
|
|
350
|
+
var init_TagTabs = __esm(() => {
|
|
351
|
+
init_src();
|
|
352
|
+
init_format();
|
|
353
|
+
jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
354
|
+
LEFT_ARROW_WIDTH = LEFT_ARROW_PREFIX.length + MAX_OVERFLOW_DIGITS + 1;
|
|
355
|
+
RIGHT_HINT_WIDTH_WITH_COUNT = RIGHT_HINT_WITH_COUNT_PREFIX.length + MAX_OVERFLOW_DIGITS + RIGHT_HINT_SUFFIX.length;
|
|
356
|
+
RIGHT_HINT_WIDTH_NO_COUNT = RIGHT_HINT_NO_COUNT.length;
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
// src/components/ui/TreeSelect.tsx
|
|
360
|
+
function TreeSelect({
|
|
361
|
+
nodes,
|
|
362
|
+
onSelect,
|
|
363
|
+
onCancel,
|
|
364
|
+
onFocus,
|
|
365
|
+
focusNodeId,
|
|
366
|
+
visibleOptionCount,
|
|
367
|
+
layout = "expanded",
|
|
368
|
+
isDisabled = false,
|
|
369
|
+
hideIndexes = false,
|
|
370
|
+
isNodeExpanded,
|
|
371
|
+
onExpand,
|
|
372
|
+
onCollapse,
|
|
373
|
+
getParentPrefix,
|
|
374
|
+
getChildPrefix,
|
|
375
|
+
onUpFromFirstItem
|
|
376
|
+
}) {
|
|
377
|
+
const [internalExpandedIds, setInternalExpandedIds] = import_react2.default.useState(new Set);
|
|
378
|
+
const isProgrammaticFocusRef = import_react2.default.useRef(false);
|
|
379
|
+
const lastFocusedIdRef = import_react2.default.useRef(null);
|
|
380
|
+
const isExpanded = import_react2.default.useCallback((nodeId) => {
|
|
381
|
+
if (isNodeExpanded) {
|
|
382
|
+
return isNodeExpanded(nodeId);
|
|
383
|
+
}
|
|
384
|
+
return internalExpandedIds.has(nodeId);
|
|
385
|
+
}, [isNodeExpanded, internalExpandedIds]);
|
|
386
|
+
const flattenedNodes = import_react2.default.useMemo(() => {
|
|
387
|
+
const result = [];
|
|
388
|
+
function traverse(node, depth, parentId) {
|
|
389
|
+
const hasChildren = !!node.children && node.children.length > 0;
|
|
390
|
+
const nodeIsExpanded = isExpanded(node.id);
|
|
391
|
+
result.push({
|
|
392
|
+
node,
|
|
393
|
+
depth,
|
|
394
|
+
isExpanded: nodeIsExpanded,
|
|
395
|
+
hasChildren,
|
|
396
|
+
parentId
|
|
397
|
+
});
|
|
398
|
+
if (hasChildren && nodeIsExpanded && node.children) {
|
|
399
|
+
for (const child of node.children) {
|
|
400
|
+
traverse(child, depth + 1, node.id);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
for (const node of nodes) {
|
|
405
|
+
traverse(node, 0);
|
|
406
|
+
}
|
|
407
|
+
return result;
|
|
408
|
+
}, [nodes, isExpanded]);
|
|
409
|
+
const defaultGetParentPrefix = import_react2.default.useCallback((isExpanded2) => isExpanded2 ? "\u25BC " : "\u25B6 ", []);
|
|
410
|
+
const defaultGetChildPrefix = import_react2.default.useCallback((_depth) => " \u25B8 ", []);
|
|
411
|
+
const parentPrefixFn = getParentPrefix ?? defaultGetParentPrefix;
|
|
412
|
+
const childPrefixFn = getChildPrefix ?? defaultGetChildPrefix;
|
|
413
|
+
const buildLabel = import_react2.default.useCallback((flatNode) => {
|
|
414
|
+
let prefix = "";
|
|
415
|
+
if (flatNode.hasChildren) {
|
|
416
|
+
prefix = parentPrefixFn(flatNode.isExpanded);
|
|
417
|
+
} else if (flatNode.depth > 0) {
|
|
418
|
+
prefix = childPrefixFn(flatNode.depth);
|
|
419
|
+
}
|
|
420
|
+
return prefix + flatNode.node.label;
|
|
421
|
+
}, [parentPrefixFn, childPrefixFn]);
|
|
422
|
+
const options = import_react2.default.useMemo(() => {
|
|
423
|
+
return flattenedNodes.map((flatNode) => ({
|
|
424
|
+
label: buildLabel(flatNode),
|
|
425
|
+
description: flatNode.node.description,
|
|
426
|
+
dimDescription: flatNode.node.dimDescription ?? true,
|
|
427
|
+
value: flatNode.node.id
|
|
428
|
+
}));
|
|
429
|
+
}, [flattenedNodes, buildLabel]);
|
|
430
|
+
const nodeMap = import_react2.default.useMemo(() => {
|
|
431
|
+
const map = new Map;
|
|
432
|
+
flattenedNodes.forEach((fn) => map.set(fn.node.id, fn.node));
|
|
433
|
+
return map;
|
|
434
|
+
}, [flattenedNodes]);
|
|
435
|
+
const findFlattenedNode = import_react2.default.useCallback((nodeId) => {
|
|
436
|
+
return flattenedNodes.find((fn) => fn.node.id === nodeId);
|
|
437
|
+
}, [flattenedNodes]);
|
|
438
|
+
const toggleExpand = import_react2.default.useCallback((nodeId, shouldExpand) => {
|
|
439
|
+
const flatNode = findFlattenedNode(nodeId);
|
|
440
|
+
if (!flatNode || !flatNode.hasChildren)
|
|
441
|
+
return;
|
|
442
|
+
if (shouldExpand) {
|
|
443
|
+
if (onExpand) {
|
|
444
|
+
onExpand(nodeId);
|
|
445
|
+
} else {
|
|
446
|
+
setInternalExpandedIds((prev) => new Set(prev).add(nodeId));
|
|
447
|
+
}
|
|
448
|
+
} else {
|
|
449
|
+
if (onCollapse) {
|
|
450
|
+
onCollapse(nodeId);
|
|
451
|
+
} else {
|
|
452
|
+
setInternalExpandedIds((prev) => {
|
|
453
|
+
const newSet = new Set(prev);
|
|
454
|
+
newSet.delete(nodeId);
|
|
455
|
+
return newSet;
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}, [findFlattenedNode, onExpand, onCollapse]);
|
|
460
|
+
const handleKeyDown = (e) => {
|
|
461
|
+
if (!focusNodeId || isDisabled)
|
|
462
|
+
return;
|
|
463
|
+
const flatNode = findFlattenedNode(focusNodeId);
|
|
464
|
+
if (!flatNode)
|
|
465
|
+
return;
|
|
466
|
+
if (e.key === "right" && flatNode.hasChildren) {
|
|
467
|
+
e.preventDefault();
|
|
468
|
+
toggleExpand(focusNodeId, true);
|
|
469
|
+
} else if (e.key === "left") {
|
|
470
|
+
if (flatNode.hasChildren && flatNode.isExpanded) {
|
|
471
|
+
e.preventDefault();
|
|
472
|
+
toggleExpand(focusNodeId, false);
|
|
473
|
+
} else if (flatNode.parentId !== undefined) {
|
|
474
|
+
e.preventDefault();
|
|
475
|
+
isProgrammaticFocusRef.current = true;
|
|
476
|
+
toggleExpand(flatNode.parentId, false);
|
|
477
|
+
if (onFocus) {
|
|
478
|
+
const parentNode = nodeMap.get(flatNode.parentId);
|
|
479
|
+
if (parentNode) {
|
|
480
|
+
onFocus(parentNode);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
const handleChange = import_react2.default.useCallback((nodeId) => {
|
|
487
|
+
const node = nodeMap.get(nodeId);
|
|
488
|
+
if (!node)
|
|
489
|
+
return;
|
|
490
|
+
onSelect(node);
|
|
491
|
+
}, [nodeMap, onSelect]);
|
|
492
|
+
const handleFocus = import_react2.default.useCallback((nodeId) => {
|
|
493
|
+
if (isProgrammaticFocusRef.current) {
|
|
494
|
+
isProgrammaticFocusRef.current = false;
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (lastFocusedIdRef.current === nodeId) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
lastFocusedIdRef.current = nodeId;
|
|
501
|
+
if (onFocus) {
|
|
502
|
+
const node = nodeMap.get(nodeId);
|
|
503
|
+
if (node) {
|
|
504
|
+
onFocus(node);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}, [onFocus, nodeMap]);
|
|
508
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
|
|
509
|
+
tabIndex: 0,
|
|
510
|
+
autoFocus: true,
|
|
511
|
+
onKeyDown: handleKeyDown,
|
|
512
|
+
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Select, {
|
|
513
|
+
options,
|
|
514
|
+
onChange: handleChange,
|
|
515
|
+
onFocus: handleFocus,
|
|
516
|
+
onCancel,
|
|
517
|
+
defaultFocusValue: focusNodeId,
|
|
518
|
+
visibleOptionCount,
|
|
519
|
+
layout,
|
|
520
|
+
isDisabled,
|
|
521
|
+
hideIndexes,
|
|
522
|
+
onUpFromFirstItem
|
|
523
|
+
}, undefined, false, undefined, this)
|
|
524
|
+
}, undefined, false, undefined, this);
|
|
525
|
+
}
|
|
526
|
+
var import_react2, jsx_dev_runtime3;
|
|
527
|
+
var init_TreeSelect = __esm(() => {
|
|
528
|
+
init_src();
|
|
529
|
+
init_select();
|
|
530
|
+
import_react2 = __toESM(require_react(), 1);
|
|
531
|
+
jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
// src/components/LogSelector.tsx
|
|
535
|
+
function normalizeAndTruncateToWidth(text, maxWidth) {
|
|
536
|
+
const normalized = text.replace(/\s+/g, " ").trim();
|
|
537
|
+
return truncateToWidth(normalized, maxWidth);
|
|
538
|
+
}
|
|
539
|
+
function formatSnippet({ before, match, after }, highlightColor) {
|
|
540
|
+
return source_default.dim(before) + highlightColor(match) + source_default.dim(after);
|
|
541
|
+
}
|
|
542
|
+
function extractSnippet(text, query, contextChars) {
|
|
543
|
+
const matchIndex = text.toLowerCase().indexOf(query.toLowerCase());
|
|
544
|
+
if (matchIndex === -1)
|
|
545
|
+
return null;
|
|
546
|
+
const matchEnd = matchIndex + query.length;
|
|
547
|
+
const snippetStart = Math.max(0, matchIndex - contextChars);
|
|
548
|
+
const snippetEnd = Math.min(text.length, matchEnd + contextChars);
|
|
549
|
+
const beforeRaw = text.slice(snippetStart, matchIndex);
|
|
550
|
+
const matchText = text.slice(matchIndex, matchEnd);
|
|
551
|
+
const afterRaw = text.slice(matchEnd, snippetEnd);
|
|
552
|
+
return {
|
|
553
|
+
before: (snippetStart > 0 ? "\u2026" : "") + beforeRaw.replace(/\s+/g, " ").trimStart(),
|
|
554
|
+
match: matchText.trim(),
|
|
555
|
+
after: afterRaw.replace(/\s+/g, " ").trimEnd() + (snippetEnd < text.length ? "\u2026" : "")
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
function buildLogLabel(log, maxLabelWidth, options) {
|
|
559
|
+
const { isGroupHeader = false, isChild = false, forkCount = 0 } = options || {};
|
|
560
|
+
const prefixWidth = isGroupHeader && forkCount > 0 ? PARENT_PREFIX_WIDTH : isChild ? CHILD_PREFIX_WIDTH : 0;
|
|
561
|
+
const sessionCountSuffix = isGroupHeader && forkCount > 0 ? ` (+${forkCount} other ${forkCount === 1 ? "session" : "sessions"})` : "";
|
|
562
|
+
const sidechainSuffix = log.isSidechain ? " (sidechain)" : "";
|
|
563
|
+
const maxSummaryWidth = maxLabelWidth - prefixWidth - sidechainSuffix.length - sessionCountSuffix.length;
|
|
564
|
+
const truncatedSummary = normalizeAndTruncateToWidth(getLogDisplayTitle(log), maxSummaryWidth);
|
|
565
|
+
return `${truncatedSummary}${sidechainSuffix}${sessionCountSuffix}`;
|
|
566
|
+
}
|
|
567
|
+
function buildLogMetadata(log, options) {
|
|
568
|
+
const { isChild = false, showProjectPath = false } = options || {};
|
|
569
|
+
const childPadding = isChild ? " " : "";
|
|
570
|
+
const baseMetadata = formatLogMetadata(log);
|
|
571
|
+
const projectSuffix = showProjectPath && log.projectPath ? ` \xB7 ${log.projectPath}` : "";
|
|
572
|
+
return childPadding + baseMetadata + projectSuffix;
|
|
573
|
+
}
|
|
574
|
+
function LogSelector({
|
|
575
|
+
logs,
|
|
576
|
+
maxHeight = Infinity,
|
|
577
|
+
forceWidth,
|
|
578
|
+
onCancel,
|
|
579
|
+
onSelect,
|
|
580
|
+
onLogsChanged,
|
|
581
|
+
onLoadMore,
|
|
582
|
+
initialSearchQuery,
|
|
583
|
+
showAllProjects = false,
|
|
584
|
+
onToggleAllProjects,
|
|
585
|
+
onAgenticSearch
|
|
586
|
+
}) {
|
|
587
|
+
const terminalSize = useTerminalSize();
|
|
588
|
+
const columns = forceWidth === undefined ? terminalSize.columns : forceWidth;
|
|
589
|
+
const exitState = useExitOnCtrlCDWithKeybindings(onCancel);
|
|
590
|
+
const isTerminalFocused = useTerminalFocus();
|
|
591
|
+
const isResumeWithRenameEnabled = isCustomTitleEnabled();
|
|
592
|
+
const isDeepSearchEnabled = process.env.USER_TYPE === "ant";
|
|
593
|
+
const [themeName] = useTheme();
|
|
594
|
+
const theme = getTheme(themeName);
|
|
595
|
+
const highlightColor = import_react3.default.useMemo(() => (text) => applyColor(text, theme.warning), [theme.warning]);
|
|
596
|
+
const isAgenticSearchEnabled = process.env.USER_TYPE === "ant";
|
|
597
|
+
const [currentBranch, setCurrentBranch] = import_react3.default.useState(null);
|
|
598
|
+
const [branchFilterEnabled, setBranchFilterEnabled] = import_react3.default.useState(false);
|
|
599
|
+
const [showAllWorktrees, setShowAllWorktrees] = import_react3.default.useState(false);
|
|
600
|
+
const [hasMultipleWorktrees, setHasMultipleWorktrees] = import_react3.default.useState(false);
|
|
601
|
+
const currentCwd = import_react3.default.useMemo(() => getOriginalCwd(), []);
|
|
602
|
+
const [renameValue, setRenameValue] = import_react3.default.useState("");
|
|
603
|
+
const [renameCursorOffset, setRenameCursorOffset] = import_react3.default.useState(0);
|
|
604
|
+
const [expandedGroupSessionIds, setExpandedGroupSessionIds] = import_react3.default.useState(new Set);
|
|
605
|
+
const [focusedNode, setFocusedNode] = import_react3.default.useState(null);
|
|
606
|
+
const [focusedIndex, setFocusedIndex] = import_react3.default.useState(1);
|
|
607
|
+
const [viewMode, setViewMode] = import_react3.default.useState("list");
|
|
608
|
+
const [previewLog, setPreviewLog] = import_react3.default.useState(null);
|
|
609
|
+
const prevFocusedIdRef = import_react3.default.useRef(null);
|
|
610
|
+
const [selectedTagIndex, setSelectedTagIndex] = import_react3.default.useState(0);
|
|
611
|
+
const [agenticSearchState, setAgenticSearchState] = import_react3.default.useState({ status: "idle" });
|
|
612
|
+
const [isAgenticSearchOptionFocused, setIsAgenticSearchOptionFocused] = import_react3.default.useState(false);
|
|
613
|
+
const agenticSearchAbortRef = import_react3.default.useRef(null);
|
|
614
|
+
const {
|
|
615
|
+
query: searchQuery,
|
|
616
|
+
setQuery: setSearchQuery,
|
|
617
|
+
cursorOffset: searchCursorOffset
|
|
618
|
+
} = useSearchInput({
|
|
619
|
+
isActive: viewMode === "search" && agenticSearchState.status !== "searching",
|
|
620
|
+
onExit: () => {
|
|
621
|
+
setViewMode("list");
|
|
622
|
+
logEvent("tengu_session_search_toggled", { enabled: false });
|
|
623
|
+
},
|
|
624
|
+
onExitUp: () => {
|
|
625
|
+
setViewMode("list");
|
|
626
|
+
logEvent("tengu_session_search_toggled", { enabled: false });
|
|
627
|
+
},
|
|
628
|
+
passthroughCtrlKeys: ["n"],
|
|
629
|
+
initialQuery: initialSearchQuery || ""
|
|
630
|
+
});
|
|
631
|
+
const deferredSearchQuery = import_react3.default.useDeferredValue(searchQuery);
|
|
632
|
+
const [debouncedDeepSearchQuery, setDebouncedDeepSearchQuery] = import_react3.default.useState("");
|
|
633
|
+
import_react3.default.useEffect(() => {
|
|
634
|
+
if (!deferredSearchQuery) {
|
|
635
|
+
setDebouncedDeepSearchQuery("");
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
const timeoutId = setTimeout(setDebouncedDeepSearchQuery, 300, deferredSearchQuery);
|
|
639
|
+
return () => clearTimeout(timeoutId);
|
|
640
|
+
}, [deferredSearchQuery]);
|
|
641
|
+
const [deepSearchResults, setDeepSearchResults] = import_react3.default.useState(null);
|
|
642
|
+
const [isSearching, setIsSearching] = import_react3.default.useState(false);
|
|
643
|
+
import_react3.default.useEffect(() => {
|
|
644
|
+
getBranch().then((branch) => setCurrentBranch(branch));
|
|
645
|
+
getWorktreePaths(currentCwd).then((paths) => {
|
|
646
|
+
setHasMultipleWorktrees(paths.length > 1);
|
|
647
|
+
});
|
|
648
|
+
}, [currentCwd]);
|
|
649
|
+
const searchableTextByLog = import_react3.default.useMemo(() => new Map(logs.map((log) => [log, buildSearchableText(log)])), [logs]);
|
|
650
|
+
const fuseIndex = import_react3.default.useMemo(() => {
|
|
651
|
+
if (!isDeepSearchEnabled)
|
|
652
|
+
return null;
|
|
653
|
+
const logsWithText = logs.map((log) => ({
|
|
654
|
+
log,
|
|
655
|
+
searchableText: searchableTextByLog.get(log) ?? ""
|
|
656
|
+
})).filter((item) => item.searchableText);
|
|
657
|
+
return new Fuse(logsWithText, {
|
|
658
|
+
keys: ["searchableText"],
|
|
659
|
+
threshold: FUSE_THRESHOLD,
|
|
660
|
+
ignoreLocation: true,
|
|
661
|
+
includeScore: true
|
|
662
|
+
});
|
|
663
|
+
}, [logs, searchableTextByLog, isDeepSearchEnabled]);
|
|
664
|
+
const uniqueTags = import_react3.default.useMemo(() => getUniqueTags(logs), [logs]);
|
|
665
|
+
const hasTags = uniqueTags.length > 0;
|
|
666
|
+
const tagTabs = import_react3.default.useMemo(() => hasTags ? ["All", ...uniqueTags] : [], [hasTags, uniqueTags]);
|
|
667
|
+
const effectiveTagIndex = tagTabs.length > 0 && selectedTagIndex < tagTabs.length ? selectedTagIndex : 0;
|
|
668
|
+
const selectedTab = tagTabs[effectiveTagIndex];
|
|
669
|
+
const tagFilter = selectedTab === "All" ? undefined : selectedTab;
|
|
670
|
+
const tagTabsLines = hasTags ? 1 : 0;
|
|
671
|
+
const baseFilteredLogs = import_react3.default.useMemo(() => {
|
|
672
|
+
let filtered = logs;
|
|
673
|
+
if (isResumeWithRenameEnabled) {
|
|
674
|
+
filtered = logs.filter((log) => {
|
|
675
|
+
const currentSessionId = getSessionId();
|
|
676
|
+
const logSessionId = getSessionIdFromLog(log);
|
|
677
|
+
const isCurrentSession = currentSessionId && logSessionId === currentSessionId;
|
|
678
|
+
if (isCurrentSession) {
|
|
679
|
+
return true;
|
|
680
|
+
}
|
|
681
|
+
if (log.customTitle) {
|
|
682
|
+
return true;
|
|
683
|
+
}
|
|
684
|
+
const fromMessages = getFirstMeaningfulUserMessageTextContent(log.messages);
|
|
685
|
+
if (fromMessages) {
|
|
686
|
+
return true;
|
|
687
|
+
}
|
|
688
|
+
if (log.firstPrompt || log.customTitle) {
|
|
689
|
+
return true;
|
|
690
|
+
}
|
|
691
|
+
return false;
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
if (tagFilter !== undefined) {
|
|
695
|
+
filtered = filtered.filter((log) => log.tag === tagFilter);
|
|
696
|
+
}
|
|
697
|
+
if (branchFilterEnabled && currentBranch) {
|
|
698
|
+
filtered = filtered.filter((log) => log.gitBranch === currentBranch);
|
|
699
|
+
}
|
|
700
|
+
if (hasMultipleWorktrees && !showAllWorktrees) {
|
|
701
|
+
filtered = filtered.filter((log) => log.projectPath === currentCwd);
|
|
702
|
+
}
|
|
703
|
+
return filtered;
|
|
704
|
+
}, [
|
|
705
|
+
logs,
|
|
706
|
+
isResumeWithRenameEnabled,
|
|
707
|
+
tagFilter,
|
|
708
|
+
branchFilterEnabled,
|
|
709
|
+
currentBranch,
|
|
710
|
+
hasMultipleWorktrees,
|
|
711
|
+
showAllWorktrees,
|
|
712
|
+
currentCwd
|
|
713
|
+
]);
|
|
714
|
+
const titleFilteredLogs = import_react3.default.useMemo(() => {
|
|
715
|
+
if (!searchQuery) {
|
|
716
|
+
return baseFilteredLogs;
|
|
717
|
+
}
|
|
718
|
+
const query = searchQuery.toLowerCase();
|
|
719
|
+
return baseFilteredLogs.filter((log) => {
|
|
720
|
+
const displayedTitle = getLogDisplayTitle(log).toLowerCase();
|
|
721
|
+
const branch = (log.gitBranch || "").toLowerCase();
|
|
722
|
+
const tag = (log.tag || "").toLowerCase();
|
|
723
|
+
const prInfo = log.prNumber ? `pr #${log.prNumber} ${log.prRepository || ""}`.toLowerCase() : "";
|
|
724
|
+
return displayedTitle.includes(query) || branch.includes(query) || tag.includes(query) || prInfo.includes(query);
|
|
725
|
+
});
|
|
726
|
+
}, [baseFilteredLogs, searchQuery]);
|
|
727
|
+
import_react3.default.useEffect(() => {
|
|
728
|
+
if (isDeepSearchEnabled && deferredSearchQuery && deferredSearchQuery !== debouncedDeepSearchQuery) {
|
|
729
|
+
setIsSearching(true);
|
|
730
|
+
}
|
|
731
|
+
}, [deferredSearchQuery, debouncedDeepSearchQuery, isDeepSearchEnabled]);
|
|
732
|
+
import_react3.default.useEffect(() => {
|
|
733
|
+
if (!isDeepSearchEnabled || !debouncedDeepSearchQuery || !fuseIndex) {
|
|
734
|
+
setDeepSearchResults(null);
|
|
735
|
+
setIsSearching(false);
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
const timeoutId = setTimeout((fuseIndex2, debouncedDeepSearchQuery2, setDeepSearchResults2, setIsSearching2) => {
|
|
739
|
+
const results = fuseIndex2.search(debouncedDeepSearchQuery2);
|
|
740
|
+
results.sort((a, b) => {
|
|
741
|
+
const aTime = new Date(a.item.log.modified).getTime();
|
|
742
|
+
const bTime = new Date(b.item.log.modified).getTime();
|
|
743
|
+
const timeDiff = bTime - aTime;
|
|
744
|
+
if (Math.abs(timeDiff) > DATE_TIE_THRESHOLD_MS) {
|
|
745
|
+
return timeDiff;
|
|
746
|
+
}
|
|
747
|
+
return (a.score ?? 1) - (b.score ?? 1);
|
|
748
|
+
});
|
|
749
|
+
setDeepSearchResults2({
|
|
750
|
+
results: results.map((r) => ({
|
|
751
|
+
log: r.item.log,
|
|
752
|
+
score: r.score,
|
|
753
|
+
searchableText: r.item.searchableText
|
|
754
|
+
})),
|
|
755
|
+
query: debouncedDeepSearchQuery2
|
|
756
|
+
});
|
|
757
|
+
setIsSearching2(false);
|
|
758
|
+
}, 0, fuseIndex, debouncedDeepSearchQuery, setDeepSearchResults, setIsSearching);
|
|
759
|
+
return () => {
|
|
760
|
+
clearTimeout(timeoutId);
|
|
761
|
+
};
|
|
762
|
+
}, [debouncedDeepSearchQuery, fuseIndex, isDeepSearchEnabled]);
|
|
763
|
+
const { filteredLogs, snippets } = import_react3.default.useMemo(() => {
|
|
764
|
+
const snippetMap = new Map;
|
|
765
|
+
let filtered = titleFilteredLogs;
|
|
766
|
+
if (deepSearchResults && debouncedDeepSearchQuery && deepSearchResults.query === debouncedDeepSearchQuery) {
|
|
767
|
+
for (const result of deepSearchResults.results) {
|
|
768
|
+
if (result.searchableText) {
|
|
769
|
+
const snippet = extractSnippet(result.searchableText, debouncedDeepSearchQuery, SNIPPET_CONTEXT_CHARS);
|
|
770
|
+
if (snippet) {
|
|
771
|
+
snippetMap.set(result.log, snippet);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
const titleMatchIds = new Set(filtered.map((log) => log.messages[0]?.uuid));
|
|
776
|
+
const transcriptOnlyMatches = deepSearchResults.results.map((r) => r.log).filter((log) => !titleMatchIds.has(log.messages[0]?.uuid));
|
|
777
|
+
filtered = [...filtered, ...transcriptOnlyMatches];
|
|
778
|
+
}
|
|
779
|
+
return { filteredLogs: filtered, snippets: snippetMap };
|
|
780
|
+
}, [titleFilteredLogs, deepSearchResults, debouncedDeepSearchQuery]);
|
|
781
|
+
const displayedLogs = import_react3.default.useMemo(() => {
|
|
782
|
+
if (agenticSearchState.status === "results" && agenticSearchState.results.length > 0) {
|
|
783
|
+
return agenticSearchState.results;
|
|
784
|
+
}
|
|
785
|
+
return filteredLogs;
|
|
786
|
+
}, [agenticSearchState, filteredLogs]);
|
|
787
|
+
const maxLabelWidth = Math.max(30, columns - 4);
|
|
788
|
+
const treeNodes = import_react3.default.useMemo(() => {
|
|
789
|
+
if (!isResumeWithRenameEnabled) {
|
|
790
|
+
return [];
|
|
791
|
+
}
|
|
792
|
+
const sessionGroups = groupLogsBySessionId(displayedLogs);
|
|
793
|
+
return Array.from(sessionGroups.entries()).map(([sessionId, groupLogs]) => {
|
|
794
|
+
const latestLog = groupLogs[0];
|
|
795
|
+
const indexInFiltered = displayedLogs.indexOf(latestLog);
|
|
796
|
+
const snippet = snippets.get(latestLog);
|
|
797
|
+
const snippetStr = snippet ? formatSnippet(snippet, highlightColor) : null;
|
|
798
|
+
if (groupLogs.length === 1) {
|
|
799
|
+
const metadata = buildLogMetadata(latestLog, {
|
|
800
|
+
showProjectPath: showAllProjects
|
|
801
|
+
});
|
|
802
|
+
return {
|
|
803
|
+
id: `log:${sessionId}:0`,
|
|
804
|
+
value: { log: latestLog, indexInFiltered },
|
|
805
|
+
label: buildLogLabel(latestLog, maxLabelWidth),
|
|
806
|
+
description: snippetStr ? `${metadata}
|
|
807
|
+
${snippetStr}` : metadata,
|
|
808
|
+
dimDescription: true
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
const forkCount = groupLogs.length - 1;
|
|
812
|
+
const children = groupLogs.slice(1).map((log, index) => {
|
|
813
|
+
const childIndexInFiltered = displayedLogs.indexOf(log);
|
|
814
|
+
const childSnippet = snippets.get(log);
|
|
815
|
+
const childSnippetStr = childSnippet ? formatSnippet(childSnippet, highlightColor) : null;
|
|
816
|
+
const childMetadata = buildLogMetadata(log, {
|
|
817
|
+
isChild: true,
|
|
818
|
+
showProjectPath: showAllProjects
|
|
819
|
+
});
|
|
820
|
+
return {
|
|
821
|
+
id: `log:${sessionId}:${index + 1}`,
|
|
822
|
+
value: { log, indexInFiltered: childIndexInFiltered },
|
|
823
|
+
label: buildLogLabel(log, maxLabelWidth, { isChild: true }),
|
|
824
|
+
description: childSnippetStr ? `${childMetadata}
|
|
825
|
+
${childSnippetStr}` : childMetadata,
|
|
826
|
+
dimDescription: true
|
|
827
|
+
};
|
|
828
|
+
});
|
|
829
|
+
const parentMetadata = buildLogMetadata(latestLog, {
|
|
830
|
+
showProjectPath: showAllProjects
|
|
831
|
+
});
|
|
832
|
+
return {
|
|
833
|
+
id: `group:${sessionId}`,
|
|
834
|
+
value: { log: latestLog, indexInFiltered },
|
|
835
|
+
label: buildLogLabel(latestLog, maxLabelWidth, {
|
|
836
|
+
isGroupHeader: true,
|
|
837
|
+
forkCount
|
|
838
|
+
}),
|
|
839
|
+
description: snippetStr ? `${parentMetadata}
|
|
840
|
+
${snippetStr}` : parentMetadata,
|
|
841
|
+
dimDescription: true,
|
|
842
|
+
children
|
|
843
|
+
};
|
|
844
|
+
});
|
|
845
|
+
}, [isResumeWithRenameEnabled, displayedLogs, maxLabelWidth, showAllProjects, snippets, highlightColor]);
|
|
846
|
+
const flatOptions = import_react3.default.useMemo(() => {
|
|
847
|
+
if (isResumeWithRenameEnabled) {
|
|
848
|
+
return [];
|
|
849
|
+
}
|
|
850
|
+
return displayedLogs.map((log, index) => {
|
|
851
|
+
const rawSummary = getLogDisplayTitle(log);
|
|
852
|
+
const summaryWithSidechain = rawSummary + (log.isSidechain ? " (sidechain)" : "");
|
|
853
|
+
const summary = normalizeAndTruncateToWidth(summaryWithSidechain, maxLabelWidth);
|
|
854
|
+
const baseDescription = formatLogMetadata(log);
|
|
855
|
+
const projectSuffix = showAllProjects && log.projectPath ? ` \xB7 ${log.projectPath}` : "";
|
|
856
|
+
const snippet = snippets.get(log);
|
|
857
|
+
const snippetStr = snippet ? formatSnippet(snippet, highlightColor) : null;
|
|
858
|
+
return {
|
|
859
|
+
label: summary,
|
|
860
|
+
description: snippetStr ? `${baseDescription}${projectSuffix}
|
|
861
|
+
${snippetStr}` : baseDescription + projectSuffix,
|
|
862
|
+
dimDescription: true,
|
|
863
|
+
value: index.toString()
|
|
864
|
+
};
|
|
865
|
+
});
|
|
866
|
+
}, [isResumeWithRenameEnabled, displayedLogs, highlightColor, maxLabelWidth, showAllProjects, snippets]);
|
|
867
|
+
const focusedLog = focusedNode?.value.log ?? null;
|
|
868
|
+
const getExpandCollapseHint = () => {
|
|
869
|
+
if (!isResumeWithRenameEnabled || !focusedLog)
|
|
870
|
+
return "";
|
|
871
|
+
const sessionId = getSessionIdFromLog(focusedLog);
|
|
872
|
+
if (!sessionId)
|
|
873
|
+
return "";
|
|
874
|
+
const sessionLogs = displayedLogs.filter((log) => getSessionIdFromLog(log) === sessionId);
|
|
875
|
+
const hasMultipleLogs = sessionLogs.length > 1;
|
|
876
|
+
if (!hasMultipleLogs)
|
|
877
|
+
return "";
|
|
878
|
+
const isExpanded = expandedGroupSessionIds.has(sessionId);
|
|
879
|
+
const isChildNode = sessionLogs.indexOf(focusedLog) > 0;
|
|
880
|
+
if (isChildNode) {
|
|
881
|
+
return "\u2190 to collapse";
|
|
882
|
+
}
|
|
883
|
+
return isExpanded ? "\u2190 to collapse" : "\u2192 to expand";
|
|
884
|
+
};
|
|
885
|
+
const handleRenameSubmit = import_react3.default.useCallback(async () => {
|
|
886
|
+
const sessionId = focusedLog ? getSessionIdFromLog(focusedLog) : undefined;
|
|
887
|
+
if (!focusedLog || !sessionId) {
|
|
888
|
+
setViewMode("list");
|
|
889
|
+
setRenameValue("");
|
|
890
|
+
return;
|
|
891
|
+
}
|
|
892
|
+
if (renameValue.trim()) {
|
|
893
|
+
await saveCustomTitle(sessionId, renameValue.trim(), focusedLog.fullPath);
|
|
894
|
+
if (isResumeWithRenameEnabled && onLogsChanged) {
|
|
895
|
+
onLogsChanged();
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
setViewMode("list");
|
|
899
|
+
setRenameValue("");
|
|
900
|
+
}, [focusedLog, renameValue, onLogsChanged, isResumeWithRenameEnabled]);
|
|
901
|
+
const exitSearchMode = import_react3.default.useCallback(() => {
|
|
902
|
+
setViewMode("list");
|
|
903
|
+
logEvent("tengu_session_search_toggled", { enabled: false });
|
|
904
|
+
}, []);
|
|
905
|
+
const enterSearchMode = import_react3.default.useCallback(() => {
|
|
906
|
+
setViewMode("search");
|
|
907
|
+
logEvent("tengu_session_search_toggled", { enabled: true });
|
|
908
|
+
}, []);
|
|
909
|
+
const handleAgenticSearch = import_react3.default.useCallback(async () => {
|
|
910
|
+
if (!searchQuery.trim() || !onAgenticSearch || !isAgenticSearchEnabled) {
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
agenticSearchAbortRef.current?.abort();
|
|
914
|
+
const abortController = new AbortController;
|
|
915
|
+
agenticSearchAbortRef.current = abortController;
|
|
916
|
+
setAgenticSearchState({ status: "searching" });
|
|
917
|
+
logEvent("tengu_agentic_search_started", {
|
|
918
|
+
query_length: searchQuery.length
|
|
919
|
+
});
|
|
920
|
+
try {
|
|
921
|
+
const results = await onAgenticSearch(searchQuery, logs, abortController.signal);
|
|
922
|
+
if (abortController.signal.aborted) {
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
setAgenticSearchState({ status: "results", results, query: searchQuery });
|
|
926
|
+
logEvent("tengu_agentic_search_completed", {
|
|
927
|
+
query_length: searchQuery.length,
|
|
928
|
+
results_count: results.length
|
|
929
|
+
});
|
|
930
|
+
} catch (error) {
|
|
931
|
+
if (abortController.signal.aborted) {
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
setAgenticSearchState({
|
|
935
|
+
status: "error",
|
|
936
|
+
message: error instanceof Error ? error.message : "Search failed"
|
|
937
|
+
});
|
|
938
|
+
logEvent("tengu_agentic_search_error", {
|
|
939
|
+
query_length: searchQuery.length
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
}, [searchQuery, onAgenticSearch, isAgenticSearchEnabled, logs]);
|
|
943
|
+
import_react3.default.useEffect(() => {
|
|
944
|
+
if (agenticSearchState.status !== "idle" && agenticSearchState.status !== "searching") {
|
|
945
|
+
if (agenticSearchState.status === "results" && agenticSearchState.query !== searchQuery || agenticSearchState.status === "error") {
|
|
946
|
+
setAgenticSearchState({ status: "idle" });
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
}, [searchQuery, agenticSearchState]);
|
|
950
|
+
import_react3.default.useEffect(() => {
|
|
951
|
+
return () => {
|
|
952
|
+
agenticSearchAbortRef.current?.abort();
|
|
953
|
+
};
|
|
954
|
+
}, []);
|
|
955
|
+
const prevAgenticStatusRef = import_react3.default.useRef(agenticSearchState.status);
|
|
956
|
+
import_react3.default.useEffect(() => {
|
|
957
|
+
const prevStatus = prevAgenticStatusRef.current;
|
|
958
|
+
prevAgenticStatusRef.current = agenticSearchState.status;
|
|
959
|
+
if (prevStatus === "searching" && agenticSearchState.status === "results") {
|
|
960
|
+
if (isResumeWithRenameEnabled && treeNodes.length > 0) {
|
|
961
|
+
setFocusedNode(treeNodes[0]);
|
|
962
|
+
} else if (!isResumeWithRenameEnabled && displayedLogs.length > 0) {
|
|
963
|
+
const firstLog = displayedLogs[0];
|
|
964
|
+
setFocusedNode({
|
|
965
|
+
id: "0",
|
|
966
|
+
value: { log: firstLog, indexInFiltered: 0 },
|
|
967
|
+
label: ""
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}, [agenticSearchState.status, isResumeWithRenameEnabled, treeNodes, displayedLogs]);
|
|
972
|
+
const handleFlatOptionsSelectFocus = import_react3.default.useCallback((value) => {
|
|
973
|
+
const index = parseInt(value, 10);
|
|
974
|
+
const log = displayedLogs[index];
|
|
975
|
+
if (!log || prevFocusedIdRef.current === index.toString()) {
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
prevFocusedIdRef.current = index.toString();
|
|
979
|
+
setFocusedNode({
|
|
980
|
+
id: index.toString(),
|
|
981
|
+
value: { log, indexInFiltered: index },
|
|
982
|
+
label: ""
|
|
983
|
+
});
|
|
984
|
+
setFocusedIndex(index + 1);
|
|
985
|
+
}, [displayedLogs]);
|
|
986
|
+
const handleTreeSelectFocus = import_react3.default.useCallback((node) => {
|
|
987
|
+
setFocusedNode(node);
|
|
988
|
+
const index = displayedLogs.findIndex((log) => getSessionIdFromLog(log) === getSessionIdFromLog(node.value.log));
|
|
989
|
+
if (index >= 0) {
|
|
990
|
+
setFocusedIndex(index + 1);
|
|
991
|
+
}
|
|
992
|
+
}, [displayedLogs]);
|
|
993
|
+
useKeybinding("confirm:no", () => {
|
|
994
|
+
agenticSearchAbortRef.current?.abort();
|
|
995
|
+
setAgenticSearchState({ status: "idle" });
|
|
996
|
+
logEvent("tengu_agentic_search_cancelled", {});
|
|
997
|
+
}, {
|
|
998
|
+
context: "Confirmation",
|
|
999
|
+
isActive: viewMode !== "preview" && agenticSearchState.status === "searching"
|
|
1000
|
+
});
|
|
1001
|
+
useKeybinding("confirm:no", () => {
|
|
1002
|
+
setViewMode("list");
|
|
1003
|
+
setRenameValue("");
|
|
1004
|
+
}, {
|
|
1005
|
+
context: "Settings",
|
|
1006
|
+
isActive: viewMode === "rename" && agenticSearchState.status !== "searching"
|
|
1007
|
+
});
|
|
1008
|
+
useKeybinding("confirm:no", () => {
|
|
1009
|
+
setSearchQuery("");
|
|
1010
|
+
setIsAgenticSearchOptionFocused(false);
|
|
1011
|
+
onCancel?.();
|
|
1012
|
+
}, {
|
|
1013
|
+
context: "Confirmation",
|
|
1014
|
+
isActive: viewMode !== "preview" && viewMode !== "rename" && viewMode !== "search" && isAgenticSearchOptionFocused && agenticSearchState.status !== "searching"
|
|
1015
|
+
});
|
|
1016
|
+
use_input_default((input, key) => {
|
|
1017
|
+
if (viewMode === "preview") {
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
if (agenticSearchState.status === "searching") {
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
if (viewMode === "rename") {} else if (viewMode === "search") {
|
|
1024
|
+
if (input.toLowerCase() === "n" && key.ctrl) {
|
|
1025
|
+
exitSearchMode();
|
|
1026
|
+
} else if (key.return || key.downArrow) {
|
|
1027
|
+
if (searchQuery.trim() && onAgenticSearch && isAgenticSearchEnabled && agenticSearchState.status !== "results") {
|
|
1028
|
+
setIsAgenticSearchOptionFocused(true);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
} else {
|
|
1032
|
+
if (isAgenticSearchOptionFocused) {
|
|
1033
|
+
if (key.return) {
|
|
1034
|
+
handleAgenticSearch();
|
|
1035
|
+
setIsAgenticSearchOptionFocused(false);
|
|
1036
|
+
return;
|
|
1037
|
+
} else if (key.downArrow) {
|
|
1038
|
+
setIsAgenticSearchOptionFocused(false);
|
|
1039
|
+
return;
|
|
1040
|
+
} else if (key.upArrow) {
|
|
1041
|
+
setViewMode("search");
|
|
1042
|
+
setIsAgenticSearchOptionFocused(false);
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
if (hasTags && key.tab) {
|
|
1047
|
+
const offset = key.shift ? -1 : 1;
|
|
1048
|
+
setSelectedTagIndex((prev) => {
|
|
1049
|
+
const current = prev < tagTabs.length ? prev : 0;
|
|
1050
|
+
const newIndex = (current + tagTabs.length + offset) % tagTabs.length;
|
|
1051
|
+
const newTab = tagTabs[newIndex];
|
|
1052
|
+
logEvent("tengu_session_tag_filter_changed", {
|
|
1053
|
+
is_all: newTab === "All",
|
|
1054
|
+
tag_count: uniqueTags.length
|
|
1055
|
+
});
|
|
1056
|
+
return newIndex;
|
|
1057
|
+
});
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
const keyIsNotCtrlOrMeta = !key.ctrl && !key.meta;
|
|
1061
|
+
const lowerInput = input.toLowerCase();
|
|
1062
|
+
if (lowerInput === "a" && key.ctrl && onToggleAllProjects) {
|
|
1063
|
+
onToggleAllProjects();
|
|
1064
|
+
logEvent("tengu_session_all_projects_toggled", {
|
|
1065
|
+
enabled: !showAllProjects
|
|
1066
|
+
});
|
|
1067
|
+
} else if (lowerInput === "b" && key.ctrl) {
|
|
1068
|
+
const newEnabled = !branchFilterEnabled;
|
|
1069
|
+
setBranchFilterEnabled(newEnabled);
|
|
1070
|
+
logEvent("tengu_session_branch_filter_toggled", {
|
|
1071
|
+
enabled: newEnabled
|
|
1072
|
+
});
|
|
1073
|
+
} else if (lowerInput === "w" && key.ctrl && hasMultipleWorktrees) {
|
|
1074
|
+
const newValue = !showAllWorktrees;
|
|
1075
|
+
setShowAllWorktrees(newValue);
|
|
1076
|
+
logEvent("tengu_session_worktree_filter_toggled", {
|
|
1077
|
+
enabled: newValue
|
|
1078
|
+
});
|
|
1079
|
+
} else if (lowerInput === "/" && keyIsNotCtrlOrMeta) {
|
|
1080
|
+
setViewMode("search");
|
|
1081
|
+
logEvent("tengu_session_search_toggled", { enabled: true });
|
|
1082
|
+
} else if (lowerInput === "r" && key.ctrl && focusedLog) {
|
|
1083
|
+
setViewMode("rename");
|
|
1084
|
+
setRenameValue("");
|
|
1085
|
+
logEvent("tengu_session_rename_started", {});
|
|
1086
|
+
} else if (lowerInput === "v" && key.ctrl && focusedLog) {
|
|
1087
|
+
setPreviewLog(focusedLog);
|
|
1088
|
+
setViewMode("preview");
|
|
1089
|
+
logEvent("tengu_session_preview_opened", {
|
|
1090
|
+
messageCount: focusedLog.messageCount
|
|
1091
|
+
});
|
|
1092
|
+
} else if (focusedLog && keyIsNotCtrlOrMeta && input.length > 0 && !/^\s+$/.test(input)) {
|
|
1093
|
+
setViewMode("search");
|
|
1094
|
+
setSearchQuery(input);
|
|
1095
|
+
logEvent("tengu_session_search_toggled", { enabled: true });
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}, { isActive: true });
|
|
1099
|
+
const filterIndicators = [];
|
|
1100
|
+
if (branchFilterEnabled && currentBranch) {
|
|
1101
|
+
filterIndicators.push(currentBranch);
|
|
1102
|
+
}
|
|
1103
|
+
if (hasMultipleWorktrees && !showAllWorktrees) {
|
|
1104
|
+
filterIndicators.push("current worktree");
|
|
1105
|
+
}
|
|
1106
|
+
const showAdditionalFilterLine = filterIndicators.length > 0 && viewMode !== "search";
|
|
1107
|
+
const searchBoxLines = 3;
|
|
1108
|
+
const headerLines = 5 + searchBoxLines + (showAdditionalFilterLine ? 1 : 0) + tagTabsLines;
|
|
1109
|
+
const footerLines = 2;
|
|
1110
|
+
const visibleCount = Math.max(1, Math.floor((maxHeight - headerLines - footerLines) / 3));
|
|
1111
|
+
import_react3.default.useEffect(() => {
|
|
1112
|
+
if (!onLoadMore)
|
|
1113
|
+
return;
|
|
1114
|
+
const buffer = visibleCount * 2;
|
|
1115
|
+
if (focusedIndex + buffer >= displayedLogs.length) {
|
|
1116
|
+
onLoadMore(visibleCount * 3);
|
|
1117
|
+
}
|
|
1118
|
+
}, [focusedIndex, visibleCount, displayedLogs.length, onLoadMore]);
|
|
1119
|
+
if (logs.length === 0) {
|
|
1120
|
+
return null;
|
|
1121
|
+
}
|
|
1122
|
+
if (viewMode === "preview" && previewLog && isResumeWithRenameEnabled) {
|
|
1123
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SessionPreview, {
|
|
1124
|
+
log: previewLog,
|
|
1125
|
+
onExit: () => {
|
|
1126
|
+
setViewMode("list");
|
|
1127
|
+
setPreviewLog(null);
|
|
1128
|
+
},
|
|
1129
|
+
onSelect
|
|
1130
|
+
}, undefined, false, undefined, this);
|
|
1131
|
+
}
|
|
1132
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1133
|
+
flexDirection: "column",
|
|
1134
|
+
height: maxHeight - 1,
|
|
1135
|
+
children: [
|
|
1136
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1137
|
+
flexShrink: 0,
|
|
1138
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Divider, {
|
|
1139
|
+
color: "suggestion"
|
|
1140
|
+
}, undefined, false, undefined, this)
|
|
1141
|
+
}, undefined, false, undefined, this),
|
|
1142
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1143
|
+
flexShrink: 0,
|
|
1144
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1145
|
+
children: " "
|
|
1146
|
+
}, undefined, false, undefined, this)
|
|
1147
|
+
}, undefined, false, undefined, this),
|
|
1148
|
+
hasTags ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TagTabs, {
|
|
1149
|
+
tabs: tagTabs,
|
|
1150
|
+
selectedIndex: effectiveTagIndex,
|
|
1151
|
+
availableWidth: columns,
|
|
1152
|
+
showAllProjects
|
|
1153
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1154
|
+
flexShrink: 0,
|
|
1155
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1156
|
+
bold: true,
|
|
1157
|
+
color: "suggestion",
|
|
1158
|
+
children: [
|
|
1159
|
+
"Resume Session",
|
|
1160
|
+
viewMode === "list" && displayedLogs.length > visibleCount && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1161
|
+
dimColor: true,
|
|
1162
|
+
children: [
|
|
1163
|
+
" ",
|
|
1164
|
+
"(",
|
|
1165
|
+
focusedIndex,
|
|
1166
|
+
" of ",
|
|
1167
|
+
displayedLogs.length,
|
|
1168
|
+
")"
|
|
1169
|
+
]
|
|
1170
|
+
}, undefined, true, undefined, this)
|
|
1171
|
+
]
|
|
1172
|
+
}, undefined, true, undefined, this)
|
|
1173
|
+
}, undefined, false, undefined, this),
|
|
1174
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(SearchBox, {
|
|
1175
|
+
query: searchQuery,
|
|
1176
|
+
isFocused: viewMode === "search",
|
|
1177
|
+
isTerminalFocused,
|
|
1178
|
+
cursorOffset: searchCursorOffset
|
|
1179
|
+
}, undefined, false, undefined, this),
|
|
1180
|
+
filterIndicators.length > 0 && viewMode !== "search" && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1181
|
+
flexShrink: 0,
|
|
1182
|
+
paddingLeft: 2,
|
|
1183
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1184
|
+
dimColor: true,
|
|
1185
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
|
|
1186
|
+
children: filterIndicators
|
|
1187
|
+
}, undefined, false, undefined, this)
|
|
1188
|
+
}, undefined, false, undefined, this)
|
|
1189
|
+
}, undefined, false, undefined, this),
|
|
1190
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1191
|
+
flexShrink: 0,
|
|
1192
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1193
|
+
children: " "
|
|
1194
|
+
}, undefined, false, undefined, this)
|
|
1195
|
+
}, undefined, false, undefined, this),
|
|
1196
|
+
agenticSearchState.status === "searching" && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1197
|
+
paddingLeft: 1,
|
|
1198
|
+
flexShrink: 0,
|
|
1199
|
+
children: [
|
|
1200
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Spinner, {}, undefined, false, undefined, this),
|
|
1201
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1202
|
+
children: " Searching\u2026"
|
|
1203
|
+
}, undefined, false, undefined, this)
|
|
1204
|
+
]
|
|
1205
|
+
}, undefined, true, undefined, this),
|
|
1206
|
+
agenticSearchState.status === "results" && agenticSearchState.results.length > 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1207
|
+
paddingLeft: 1,
|
|
1208
|
+
marginBottom: 1,
|
|
1209
|
+
flexShrink: 0,
|
|
1210
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1211
|
+
dimColor: true,
|
|
1212
|
+
italic: true,
|
|
1213
|
+
children: "RedScope AI found these results:"
|
|
1214
|
+
}, undefined, false, undefined, this)
|
|
1215
|
+
}, undefined, false, undefined, this),
|
|
1216
|
+
agenticSearchState.status === "results" && agenticSearchState.results.length === 0 && filteredLogs.length === 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1217
|
+
paddingLeft: 1,
|
|
1218
|
+
marginBottom: 1,
|
|
1219
|
+
flexShrink: 0,
|
|
1220
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1221
|
+
dimColor: true,
|
|
1222
|
+
italic: true,
|
|
1223
|
+
children: "No matching sessions found."
|
|
1224
|
+
}, undefined, false, undefined, this)
|
|
1225
|
+
}, undefined, false, undefined, this),
|
|
1226
|
+
agenticSearchState.status === "error" && filteredLogs.length === 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1227
|
+
paddingLeft: 1,
|
|
1228
|
+
marginBottom: 1,
|
|
1229
|
+
flexShrink: 0,
|
|
1230
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1231
|
+
dimColor: true,
|
|
1232
|
+
italic: true,
|
|
1233
|
+
children: "No matching sessions found."
|
|
1234
|
+
}, undefined, false, undefined, this)
|
|
1235
|
+
}, undefined, false, undefined, this),
|
|
1236
|
+
Boolean(searchQuery.trim()) && onAgenticSearch && isAgenticSearchEnabled && agenticSearchState.status !== "searching" && agenticSearchState.status !== "results" && agenticSearchState.status !== "error" && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1237
|
+
flexShrink: 0,
|
|
1238
|
+
flexDirection: "column",
|
|
1239
|
+
children: [
|
|
1240
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1241
|
+
flexDirection: "row",
|
|
1242
|
+
gap: 1,
|
|
1243
|
+
children: [
|
|
1244
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1245
|
+
color: isAgenticSearchOptionFocused ? "suggestion" : undefined,
|
|
1246
|
+
children: isAgenticSearchOptionFocused ? figures_default.pointer : " "
|
|
1247
|
+
}, undefined, false, undefined, this),
|
|
1248
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1249
|
+
color: isAgenticSearchOptionFocused ? "suggestion" : undefined,
|
|
1250
|
+
bold: isAgenticSearchOptionFocused,
|
|
1251
|
+
children: "Search deeply using RedScope \u2192"
|
|
1252
|
+
}, undefined, false, undefined, this)
|
|
1253
|
+
]
|
|
1254
|
+
}, undefined, true, undefined, this),
|
|
1255
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1256
|
+
height: 1
|
|
1257
|
+
}, undefined, false, undefined, this)
|
|
1258
|
+
]
|
|
1259
|
+
}, undefined, true, undefined, this),
|
|
1260
|
+
agenticSearchState.status === "searching" ? null : viewMode === "rename" && focusedLog ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1261
|
+
paddingLeft: 2,
|
|
1262
|
+
flexDirection: "column",
|
|
1263
|
+
children: [
|
|
1264
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1265
|
+
bold: true,
|
|
1266
|
+
children: "Rename session:"
|
|
1267
|
+
}, undefined, false, undefined, this),
|
|
1268
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1269
|
+
paddingTop: 1,
|
|
1270
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextInput, {
|
|
1271
|
+
value: renameValue,
|
|
1272
|
+
onChange: setRenameValue,
|
|
1273
|
+
onSubmit: handleRenameSubmit,
|
|
1274
|
+
placeholder: getLogDisplayTitle(focusedLog, "Enter new session name"),
|
|
1275
|
+
columns,
|
|
1276
|
+
cursorOffset: renameCursorOffset,
|
|
1277
|
+
onChangeCursorOffset: setRenameCursorOffset,
|
|
1278
|
+
showCursor: true
|
|
1279
|
+
}, undefined, false, undefined, this)
|
|
1280
|
+
}, undefined, false, undefined, this)
|
|
1281
|
+
]
|
|
1282
|
+
}, undefined, true, undefined, this) : isResumeWithRenameEnabled ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TreeSelect, {
|
|
1283
|
+
nodes: treeNodes,
|
|
1284
|
+
onSelect: (node) => {
|
|
1285
|
+
onSelect(node.value.log);
|
|
1286
|
+
},
|
|
1287
|
+
onFocus: handleTreeSelectFocus,
|
|
1288
|
+
onCancel,
|
|
1289
|
+
focusNodeId: focusedNode?.id,
|
|
1290
|
+
visibleOptionCount: visibleCount,
|
|
1291
|
+
layout: "expanded",
|
|
1292
|
+
isDisabled: viewMode === "search" || isAgenticSearchOptionFocused,
|
|
1293
|
+
hideIndexes: false,
|
|
1294
|
+
isNodeExpanded: (nodeId) => {
|
|
1295
|
+
if (viewMode === "search" || branchFilterEnabled) {
|
|
1296
|
+
return true;
|
|
1297
|
+
}
|
|
1298
|
+
const sessionId = typeof nodeId === "string" && nodeId.startsWith("group:") ? nodeId.substring(6) : null;
|
|
1299
|
+
return sessionId ? expandedGroupSessionIds.has(sessionId) : false;
|
|
1300
|
+
},
|
|
1301
|
+
onExpand: (nodeId) => {
|
|
1302
|
+
const sessionId = typeof nodeId === "string" && nodeId.startsWith("group:") ? nodeId.substring(6) : null;
|
|
1303
|
+
if (sessionId) {
|
|
1304
|
+
setExpandedGroupSessionIds((prev) => new Set(prev).add(sessionId));
|
|
1305
|
+
logEvent("tengu_session_group_expanded", {});
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
onCollapse: (nodeId) => {
|
|
1309
|
+
const sessionId = typeof nodeId === "string" && nodeId.startsWith("group:") ? nodeId.substring(6) : null;
|
|
1310
|
+
if (sessionId) {
|
|
1311
|
+
setExpandedGroupSessionIds((prev) => {
|
|
1312
|
+
const newSet = new Set(prev);
|
|
1313
|
+
newSet.delete(sessionId);
|
|
1314
|
+
return newSet;
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
onUpFromFirstItem: enterSearchMode
|
|
1319
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Select, {
|
|
1320
|
+
options: flatOptions,
|
|
1321
|
+
onChange: (value) => {
|
|
1322
|
+
const itemIndex = parseInt(value, 10);
|
|
1323
|
+
const log = displayedLogs[itemIndex];
|
|
1324
|
+
if (log) {
|
|
1325
|
+
onSelect(log);
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1328
|
+
visibleOptionCount: visibleCount,
|
|
1329
|
+
onCancel,
|
|
1330
|
+
onFocus: handleFlatOptionsSelectFocus,
|
|
1331
|
+
defaultFocusValue: focusedNode?.id.toString(),
|
|
1332
|
+
layout: "expanded",
|
|
1333
|
+
isDisabled: viewMode === "search" || isAgenticSearchOptionFocused,
|
|
1334
|
+
onUpFromFirstItem: enterSearchMode
|
|
1335
|
+
}, undefined, false, undefined, this),
|
|
1336
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
|
|
1337
|
+
paddingLeft: 2,
|
|
1338
|
+
children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1339
|
+
dimColor: true,
|
|
1340
|
+
children: [
|
|
1341
|
+
"Press ",
|
|
1342
|
+
exitState.keyName,
|
|
1343
|
+
" again to exit"
|
|
1344
|
+
]
|
|
1345
|
+
}, undefined, true, undefined, this) : viewMode === "rename" ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1346
|
+
dimColor: true,
|
|
1347
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
|
|
1348
|
+
children: [
|
|
1349
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1350
|
+
shortcut: "Enter",
|
|
1351
|
+
action: "save"
|
|
1352
|
+
}, undefined, false, undefined, this),
|
|
1353
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
|
|
1354
|
+
action: "confirm:no",
|
|
1355
|
+
context: "Confirmation",
|
|
1356
|
+
fallback: "Esc",
|
|
1357
|
+
description: "cancel"
|
|
1358
|
+
}, undefined, false, undefined, this)
|
|
1359
|
+
]
|
|
1360
|
+
}, undefined, true, undefined, this)
|
|
1361
|
+
}, undefined, false, undefined, this) : agenticSearchState.status === "searching" ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1362
|
+
dimColor: true,
|
|
1363
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
|
|
1364
|
+
children: [
|
|
1365
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1366
|
+
children: "Searching with RedScope AI..."
|
|
1367
|
+
}, undefined, false, undefined, this),
|
|
1368
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
|
|
1369
|
+
action: "confirm:no",
|
|
1370
|
+
context: "Confirmation",
|
|
1371
|
+
fallback: "Esc",
|
|
1372
|
+
description: "cancel"
|
|
1373
|
+
}, undefined, false, undefined, this)
|
|
1374
|
+
]
|
|
1375
|
+
}, undefined, true, undefined, this)
|
|
1376
|
+
}, undefined, false, undefined, this) : isAgenticSearchOptionFocused ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1377
|
+
dimColor: true,
|
|
1378
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
|
|
1379
|
+
children: [
|
|
1380
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1381
|
+
shortcut: "Enter",
|
|
1382
|
+
action: "search"
|
|
1383
|
+
}, undefined, false, undefined, this),
|
|
1384
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1385
|
+
shortcut: "\u2193",
|
|
1386
|
+
action: "skip"
|
|
1387
|
+
}, undefined, false, undefined, this),
|
|
1388
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
|
|
1389
|
+
action: "confirm:no",
|
|
1390
|
+
context: "Confirmation",
|
|
1391
|
+
fallback: "Esc",
|
|
1392
|
+
description: "cancel"
|
|
1393
|
+
}, undefined, false, undefined, this)
|
|
1394
|
+
]
|
|
1395
|
+
}, undefined, true, undefined, this)
|
|
1396
|
+
}, undefined, false, undefined, this) : viewMode === "search" ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1397
|
+
dimColor: true,
|
|
1398
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
|
|
1399
|
+
children: [
|
|
1400
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1401
|
+
children: isSearching && isDeepSearchEnabled ? "Searching\u2026" : "Type to Search"
|
|
1402
|
+
}, undefined, false, undefined, this),
|
|
1403
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1404
|
+
shortcut: "Enter",
|
|
1405
|
+
action: "select"
|
|
1406
|
+
}, undefined, false, undefined, this),
|
|
1407
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
|
|
1408
|
+
action: "confirm:no",
|
|
1409
|
+
context: "Confirmation",
|
|
1410
|
+
fallback: "Esc",
|
|
1411
|
+
description: "clear"
|
|
1412
|
+
}, undefined, false, undefined, this)
|
|
1413
|
+
]
|
|
1414
|
+
}, undefined, true, undefined, this)
|
|
1415
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1416
|
+
dimColor: true,
|
|
1417
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Byline, {
|
|
1418
|
+
children: [
|
|
1419
|
+
onToggleAllProjects && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1420
|
+
shortcut: "Ctrl+A",
|
|
1421
|
+
action: `show ${showAllProjects ? "current dir" : "all projects"}`
|
|
1422
|
+
}, undefined, false, undefined, this),
|
|
1423
|
+
currentBranch && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1424
|
+
shortcut: "Ctrl+B",
|
|
1425
|
+
action: "toggle branch"
|
|
1426
|
+
}, undefined, false, undefined, this),
|
|
1427
|
+
hasMultipleWorktrees && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1428
|
+
shortcut: "Ctrl+W",
|
|
1429
|
+
action: `show ${showAllWorktrees ? "current worktree" : "all worktrees"}`
|
|
1430
|
+
}, undefined, false, undefined, this),
|
|
1431
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1432
|
+
shortcut: "Ctrl+V",
|
|
1433
|
+
action: "preview"
|
|
1434
|
+
}, undefined, false, undefined, this),
|
|
1435
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(KeyboardShortcutHint, {
|
|
1436
|
+
shortcut: "Ctrl+R",
|
|
1437
|
+
action: "rename"
|
|
1438
|
+
}, undefined, false, undefined, this),
|
|
1439
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1440
|
+
children: "Type to search"
|
|
1441
|
+
}, undefined, false, undefined, this),
|
|
1442
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ConfigurableShortcutHint, {
|
|
1443
|
+
action: "confirm:no",
|
|
1444
|
+
context: "Confirmation",
|
|
1445
|
+
fallback: "Esc",
|
|
1446
|
+
description: "cancel"
|
|
1447
|
+
}, undefined, false, undefined, this),
|
|
1448
|
+
getExpandCollapseHint() && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
|
|
1449
|
+
children: getExpandCollapseHint()
|
|
1450
|
+
}, undefined, false, undefined, this)
|
|
1451
|
+
]
|
|
1452
|
+
}, undefined, true, undefined, this)
|
|
1453
|
+
}, undefined, false, undefined, this)
|
|
1454
|
+
}, undefined, false, undefined, this)
|
|
1455
|
+
]
|
|
1456
|
+
}, undefined, true, undefined, this);
|
|
1457
|
+
}
|
|
1458
|
+
function extractSearchableText(message) {
|
|
1459
|
+
if (message.type !== "user" && message.type !== "assistant") {
|
|
1460
|
+
return "";
|
|
1461
|
+
}
|
|
1462
|
+
const content = "message" in message ? message.message?.content : undefined;
|
|
1463
|
+
if (!content)
|
|
1464
|
+
return "";
|
|
1465
|
+
if (typeof content === "string") {
|
|
1466
|
+
return content;
|
|
1467
|
+
}
|
|
1468
|
+
if (Array.isArray(content)) {
|
|
1469
|
+
return content.map((block) => {
|
|
1470
|
+
if (typeof block === "string")
|
|
1471
|
+
return block;
|
|
1472
|
+
if ("text" in block && typeof block.text === "string")
|
|
1473
|
+
return block.text;
|
|
1474
|
+
return "";
|
|
1475
|
+
}).filter(Boolean).join(" ");
|
|
1476
|
+
}
|
|
1477
|
+
return "";
|
|
1478
|
+
}
|
|
1479
|
+
function buildSearchableText(log) {
|
|
1480
|
+
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)];
|
|
1481
|
+
const messageText = searchableMessages.map(extractSearchableText).filter(Boolean).join(" ");
|
|
1482
|
+
const metadata = [
|
|
1483
|
+
log.customTitle,
|
|
1484
|
+
log.summary,
|
|
1485
|
+
log.firstPrompt,
|
|
1486
|
+
log.gitBranch,
|
|
1487
|
+
log.tag,
|
|
1488
|
+
log.prNumber ? `PR #${log.prNumber}` : undefined,
|
|
1489
|
+
log.prRepository
|
|
1490
|
+
].filter(Boolean).join(" ");
|
|
1491
|
+
const fullText = `${metadata} ${messageText}`.trim();
|
|
1492
|
+
return fullText.length > DEEP_SEARCH_MAX_TEXT_LENGTH ? fullText.slice(0, DEEP_SEARCH_MAX_TEXT_LENGTH) : fullText;
|
|
1493
|
+
}
|
|
1494
|
+
function groupLogsBySessionId(filteredLogs) {
|
|
1495
|
+
const groups = new Map;
|
|
1496
|
+
for (const log of filteredLogs) {
|
|
1497
|
+
const sessionId = getSessionIdFromLog(log);
|
|
1498
|
+
if (sessionId) {
|
|
1499
|
+
const existing = groups.get(sessionId);
|
|
1500
|
+
if (existing) {
|
|
1501
|
+
existing.push(log);
|
|
1502
|
+
} else {
|
|
1503
|
+
groups.set(sessionId, [log]);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
groups.forEach((logs) => logs.sort((a, b) => new Date(b.modified).getTime() - new Date(a.modified).getTime()));
|
|
1508
|
+
return groups;
|
|
1509
|
+
}
|
|
1510
|
+
function getUniqueTags(logs) {
|
|
1511
|
+
const tags = new Set;
|
|
1512
|
+
for (const log of logs) {
|
|
1513
|
+
if (log.tag) {
|
|
1514
|
+
tags.add(log.tag);
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
return Array.from(tags).sort((a, b) => a.localeCompare(b));
|
|
1518
|
+
}
|
|
1519
|
+
var 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, FUSE_THRESHOLD = 0.3, DATE_TIE_THRESHOLD_MS, SNIPPET_CONTEXT_CHARS = 50;
|
|
1520
|
+
var init_LogSelector = __esm(() => {
|
|
1521
|
+
init_source();
|
|
1522
|
+
init_figures();
|
|
1523
|
+
init_fuse();
|
|
1524
|
+
init_state();
|
|
1525
|
+
init_useExitOnCtrlCDWithKeybindings();
|
|
1526
|
+
init_useSearchInput();
|
|
1527
|
+
init_useTerminalSize();
|
|
1528
|
+
init_src();
|
|
1529
|
+
init_useKeybinding();
|
|
1530
|
+
init_analytics();
|
|
1531
|
+
init_format();
|
|
1532
|
+
init_getWorktreePaths();
|
|
1533
|
+
init_git();
|
|
1534
|
+
init_log();
|
|
1535
|
+
init_sessionStorage();
|
|
1536
|
+
init_theme();
|
|
1537
|
+
init_ConfigurableShortcutHint();
|
|
1538
|
+
init_select();
|
|
1539
|
+
init_SearchBox();
|
|
1540
|
+
init_SessionPreview();
|
|
1541
|
+
init_Spinner();
|
|
1542
|
+
init_TagTabs();
|
|
1543
|
+
init_TextInput();
|
|
1544
|
+
init_TreeSelect();
|
|
1545
|
+
import_react3 = __toESM(require_react(), 1);
|
|
1546
|
+
jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
|
|
1547
|
+
DATE_TIE_THRESHOLD_MS = 60 * 1000;
|
|
1548
|
+
});
|
|
1549
|
+
|
|
1550
|
+
// src/utils/agenticSessionSearch.ts
|
|
1551
|
+
function extractMessageText(message) {
|
|
1552
|
+
if (message.type !== "user" && message.type !== "assistant") {
|
|
1553
|
+
return "";
|
|
1554
|
+
}
|
|
1555
|
+
const content = "message" in message ? message.message?.content : undefined;
|
|
1556
|
+
if (!content)
|
|
1557
|
+
return "";
|
|
1558
|
+
if (typeof content === "string") {
|
|
1559
|
+
return content;
|
|
1560
|
+
}
|
|
1561
|
+
if (Array.isArray(content)) {
|
|
1562
|
+
return content.map((block) => {
|
|
1563
|
+
if (typeof block === "string")
|
|
1564
|
+
return block;
|
|
1565
|
+
if ("text" in block && typeof block.text === "string")
|
|
1566
|
+
return block.text;
|
|
1567
|
+
return "";
|
|
1568
|
+
}).filter(Boolean).join(" ");
|
|
1569
|
+
}
|
|
1570
|
+
return "";
|
|
1571
|
+
}
|
|
1572
|
+
function extractTranscript(messages) {
|
|
1573
|
+
if (messages.length === 0)
|
|
1574
|
+
return "";
|
|
1575
|
+
const messagesToScan = messages.length <= MAX_MESSAGES_TO_SCAN ? messages : [
|
|
1576
|
+
...messages.slice(0, MAX_MESSAGES_TO_SCAN / 2),
|
|
1577
|
+
...messages.slice(-MAX_MESSAGES_TO_SCAN / 2)
|
|
1578
|
+
];
|
|
1579
|
+
const text = messagesToScan.map(extractMessageText).filter(Boolean).join(" ").replace(/\s+/g, " ").trim();
|
|
1580
|
+
return text.length > MAX_TRANSCRIPT_CHARS ? text.slice(0, MAX_TRANSCRIPT_CHARS) + "\u2026" : text;
|
|
1581
|
+
}
|
|
1582
|
+
function logContainsQuery(log, queryLower) {
|
|
1583
|
+
const title = getLogDisplayTitle(log).toLowerCase();
|
|
1584
|
+
if (title.includes(queryLower))
|
|
1585
|
+
return true;
|
|
1586
|
+
if (log.customTitle?.toLowerCase().includes(queryLower))
|
|
1587
|
+
return true;
|
|
1588
|
+
if (log.tag?.toLowerCase().includes(queryLower))
|
|
1589
|
+
return true;
|
|
1590
|
+
if (log.gitBranch?.toLowerCase().includes(queryLower))
|
|
1591
|
+
return true;
|
|
1592
|
+
if (log.summary?.toLowerCase().includes(queryLower))
|
|
1593
|
+
return true;
|
|
1594
|
+
if (log.firstPrompt?.toLowerCase().includes(queryLower))
|
|
1595
|
+
return true;
|
|
1596
|
+
if (log.messages && log.messages.length > 0) {
|
|
1597
|
+
const transcript = extractTranscript(log.messages).toLowerCase();
|
|
1598
|
+
if (transcript.includes(queryLower))
|
|
1599
|
+
return true;
|
|
1600
|
+
}
|
|
1601
|
+
return false;
|
|
1602
|
+
}
|
|
1603
|
+
async function agenticSessionSearch(query, logs, signal) {
|
|
1604
|
+
if (!query.trim() || logs.length === 0) {
|
|
1605
|
+
return [];
|
|
1606
|
+
}
|
|
1607
|
+
const queryLower = query.toLowerCase();
|
|
1608
|
+
const matchingLogs = logs.filter((log) => logContainsQuery(log, queryLower));
|
|
1609
|
+
let logsToSearch;
|
|
1610
|
+
if (matchingLogs.length >= MAX_SESSIONS_TO_SEARCH) {
|
|
1611
|
+
logsToSearch = matchingLogs.slice(0, MAX_SESSIONS_TO_SEARCH);
|
|
1612
|
+
} else {
|
|
1613
|
+
const nonMatchingLogs = logs.filter((log) => !logContainsQuery(log, queryLower));
|
|
1614
|
+
const remainingSlots = MAX_SESSIONS_TO_SEARCH - matchingLogs.length;
|
|
1615
|
+
logsToSearch = [
|
|
1616
|
+
...matchingLogs,
|
|
1617
|
+
...nonMatchingLogs.slice(0, remainingSlots)
|
|
1618
|
+
];
|
|
1619
|
+
}
|
|
1620
|
+
logForDebugging(`Agentic search: ${logsToSearch.length}/${logs.length} logs, query="${query}", ` + `matching: ${matchingLogs.length}, with messages: ${count(logsToSearch, (l) => l.messages?.length > 0)}`);
|
|
1621
|
+
const logsWithTranscriptsPromises = logsToSearch.map(async (log) => {
|
|
1622
|
+
if (isLiteLog(log)) {
|
|
1623
|
+
try {
|
|
1624
|
+
return await loadFullLog(log);
|
|
1625
|
+
} catch (error) {
|
|
1626
|
+
logError(error);
|
|
1627
|
+
return log;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
return log;
|
|
1631
|
+
});
|
|
1632
|
+
const logsWithTranscripts = await Promise.all(logsWithTranscriptsPromises);
|
|
1633
|
+
logForDebugging(`Agentic search: loaded ${count(logsWithTranscripts, (l) => l.messages?.length > 0)}/${logsToSearch.length} logs with transcripts`);
|
|
1634
|
+
const sessionList = logsWithTranscripts.map((log, index) => {
|
|
1635
|
+
const parts = [`${index}:`];
|
|
1636
|
+
const displayTitle = getLogDisplayTitle(log);
|
|
1637
|
+
parts.push(displayTitle);
|
|
1638
|
+
if (log.customTitle && log.customTitle !== displayTitle) {
|
|
1639
|
+
parts.push(`[custom title: ${log.customTitle}]`);
|
|
1640
|
+
}
|
|
1641
|
+
if (log.tag) {
|
|
1642
|
+
parts.push(`[tag: ${log.tag}]`);
|
|
1643
|
+
}
|
|
1644
|
+
if (log.gitBranch) {
|
|
1645
|
+
parts.push(`[branch: ${log.gitBranch}]`);
|
|
1646
|
+
}
|
|
1647
|
+
if (log.summary) {
|
|
1648
|
+
parts.push(`- Summary: ${log.summary}`);
|
|
1649
|
+
}
|
|
1650
|
+
if (log.firstPrompt && log.firstPrompt !== "No prompt") {
|
|
1651
|
+
parts.push(`- First message: ${log.firstPrompt.slice(0, 300)}`);
|
|
1652
|
+
}
|
|
1653
|
+
if (log.messages && log.messages.length > 0) {
|
|
1654
|
+
const transcript = extractTranscript(log.messages);
|
|
1655
|
+
if (transcript) {
|
|
1656
|
+
parts.push(`- Transcript: ${transcript}`);
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
return parts.join(" ");
|
|
1660
|
+
}).join(`
|
|
1661
|
+
`);
|
|
1662
|
+
const userMessage = `Sessions:
|
|
1663
|
+
${sessionList}
|
|
1664
|
+
|
|
1665
|
+
Search query: "${query}"
|
|
1666
|
+
|
|
1667
|
+
Find the sessions that are most relevant to this query.`;
|
|
1668
|
+
logForDebugging(`Agentic search prompt (first 500 chars): ${userMessage.slice(0, 500)}...`);
|
|
1669
|
+
try {
|
|
1670
|
+
const model = getSmallFastModel();
|
|
1671
|
+
logForDebugging(`Agentic search using model: ${model}`);
|
|
1672
|
+
const response = await sideQuery({
|
|
1673
|
+
model,
|
|
1674
|
+
system: SESSION_SEARCH_SYSTEM_PROMPT,
|
|
1675
|
+
messages: [{ role: "user", content: userMessage }],
|
|
1676
|
+
signal,
|
|
1677
|
+
querySource: "session_search"
|
|
1678
|
+
});
|
|
1679
|
+
const textContent = response.content.find((block) => block.type === "text");
|
|
1680
|
+
if (!textContent || textContent.type !== "text") {
|
|
1681
|
+
logForDebugging("No text content in agentic search response");
|
|
1682
|
+
return [];
|
|
1683
|
+
}
|
|
1684
|
+
logForDebugging(`Agentic search response: ${textContent.text}`);
|
|
1685
|
+
const jsonMatch = textContent.text.match(/\{[\s\S]*\}/);
|
|
1686
|
+
if (!jsonMatch) {
|
|
1687
|
+
logForDebugging("Could not find JSON in agentic search response");
|
|
1688
|
+
return [];
|
|
1689
|
+
}
|
|
1690
|
+
const result = jsonParse(jsonMatch[0]);
|
|
1691
|
+
const relevantIndices = result.relevant_indices || [];
|
|
1692
|
+
const relevantLogs = relevantIndices.filter((index) => index >= 0 && index < logsWithTranscripts.length).map((index) => logsWithTranscripts[index]);
|
|
1693
|
+
logForDebugging(`Agentic search found ${relevantLogs.length} relevant sessions`);
|
|
1694
|
+
return relevantLogs;
|
|
1695
|
+
} catch (error) {
|
|
1696
|
+
logError(error);
|
|
1697
|
+
logForDebugging(`Agentic search error: ${error}`);
|
|
1698
|
+
return [];
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
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.
|
|
1702
|
+
|
|
1703
|
+
You will be given a list of sessions with their metadata and a search query. Identify which sessions are most relevant to the query.
|
|
1704
|
+
|
|
1705
|
+
Each session may include:
|
|
1706
|
+
- Title (display name or custom title)
|
|
1707
|
+
- Tag (user-assigned category, shown as [tag: name] - users tag sessions with /tag command to categorize them)
|
|
1708
|
+
- Branch (git branch name, shown as [branch: name])
|
|
1709
|
+
- Summary (AI-generated summary)
|
|
1710
|
+
- First message (beginning of the conversation)
|
|
1711
|
+
- Transcript (excerpt of conversation content)
|
|
1712
|
+
|
|
1713
|
+
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.
|
|
1714
|
+
|
|
1715
|
+
For each session, consider (in order of priority):
|
|
1716
|
+
1. Exact tag matches (highest priority - user explicitly categorized this session)
|
|
1717
|
+
2. Partial tag matches or tag-related terms
|
|
1718
|
+
3. Title matches (custom titles or first message content)
|
|
1719
|
+
4. Branch name matches
|
|
1720
|
+
5. Summary and transcript content matches
|
|
1721
|
+
6. Semantic similarity and related concepts
|
|
1722
|
+
|
|
1723
|
+
CRITICAL: Be VERY inclusive in your matching. Include sessions that:
|
|
1724
|
+
- Contain the query term anywhere in any field
|
|
1725
|
+
- Are semantically related to the query (e.g., "testing" matches sessions about "tests", "unit tests", "QA", etc.)
|
|
1726
|
+
- Discuss topics that could be related to the query
|
|
1727
|
+
- Have transcripts that mention the concept even in passing
|
|
1728
|
+
|
|
1729
|
+
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.
|
|
1730
|
+
|
|
1731
|
+
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.
|
|
1732
|
+
|
|
1733
|
+
Respond with ONLY the JSON object, no markdown formatting:
|
|
1734
|
+
{"relevant_indices": [2, 5, 0]}`;
|
|
1735
|
+
var init_agenticSessionSearch = __esm(() => {
|
|
1736
|
+
init_array();
|
|
1737
|
+
init_debug();
|
|
1738
|
+
init_log();
|
|
1739
|
+
init_model();
|
|
1740
|
+
init_sessionStorage();
|
|
1741
|
+
init_sideQuery();
|
|
1742
|
+
init_slowOperations();
|
|
1743
|
+
});
|
|
1744
|
+
|
|
1745
|
+
// src/utils/crossProjectResume.ts
|
|
1746
|
+
import { sep } from "path";
|
|
1747
|
+
function checkCrossProjectResume(log, showAllProjects, worktreePaths) {
|
|
1748
|
+
const currentCwd = getOriginalCwd();
|
|
1749
|
+
if (!showAllProjects || !log.projectPath || log.projectPath === currentCwd) {
|
|
1750
|
+
return { isCrossProject: false };
|
|
1751
|
+
}
|
|
1752
|
+
if (process.env.USER_TYPE !== "ant") {
|
|
1753
|
+
const sessionId2 = getSessionIdFromLog(log);
|
|
1754
|
+
const command2 = `cd ${quote([log.projectPath])} && redscope --resume ${sessionId2}`;
|
|
1755
|
+
return {
|
|
1756
|
+
isCrossProject: true,
|
|
1757
|
+
isSameRepoWorktree: false,
|
|
1758
|
+
command: command2,
|
|
1759
|
+
projectPath: log.projectPath
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
const isSameRepo = worktreePaths.some((wt) => log.projectPath === wt || log.projectPath.startsWith(wt + sep));
|
|
1763
|
+
if (isSameRepo) {
|
|
1764
|
+
return {
|
|
1765
|
+
isCrossProject: true,
|
|
1766
|
+
isSameRepoWorktree: true,
|
|
1767
|
+
projectPath: log.projectPath
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
const sessionId = getSessionIdFromLog(log);
|
|
1771
|
+
const command = `cd ${quote([log.projectPath])} && redscope --resume ${sessionId}`;
|
|
1772
|
+
return {
|
|
1773
|
+
isCrossProject: true,
|
|
1774
|
+
isSameRepoWorktree: false,
|
|
1775
|
+
command,
|
|
1776
|
+
projectPath: log.projectPath
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
var init_crossProjectResume = __esm(() => {
|
|
1780
|
+
init_state();
|
|
1781
|
+
init_shellQuote();
|
|
1782
|
+
init_sessionStorage();
|
|
1783
|
+
});
|
|
1784
|
+
|
|
1785
|
+
export { LogSelector, init_LogSelector, agenticSessionSearch, init_agenticSessionSearch, checkCrossProjectResume, init_crossProjectResume };
|