claude-code-best 1.3.7 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-xtaw765g.js → chunk-00b2znqm.js} +2 -2
  3. package/dist/{chunk-vam5at9t.js → chunk-0ctfznp2.js} +83 -82
  4. package/dist/{chunk-db82mfh9.js → chunk-0kp39at8.js} +38 -38
  5. package/dist/{chunk-427mfnyx.js → chunk-0n0r9fwa.js} +1 -1
  6. package/dist/{chunk-86tz7yxt.js → chunk-0qe6jzfm.js} +26 -26
  7. package/dist/{chunk-z66q1nam.js → chunk-0rbezx7s.js} +26 -26
  8. package/dist/{chunk-6ex0f5ej.js → chunk-0w8eb8gt.js} +2 -2
  9. package/dist/{chunk-d267stxj.js → chunk-0z0m6mm5.js} +1 -1
  10. package/dist/{chunk-mfzgqp0c.js → chunk-157v5wtn.js} +2 -2
  11. package/dist/{chunk-ps5rsyxe.js → chunk-1e8f0nx0.js} +26 -26
  12. package/dist/{chunk-xcq3rdb0.js → chunk-1j332jvg.js} +10 -10
  13. package/dist/{chunk-9jg130e9.js → chunk-1neq14g8.js} +26 -26
  14. package/dist/{chunk-qwa5erw8.js → chunk-1zjrec16.js} +5 -5
  15. package/dist/{chunk-tvnrwrg3.js → chunk-21pvq2fw.js} +29 -29
  16. package/dist/{chunk-9tc901nb.js → chunk-25yy8wx5.js} +4 -4
  17. package/dist/{chunk-yp2yx0qj.js → chunk-29p0hjfs.js} +2 -2
  18. package/dist/{chunk-mcbqmbp2.js → chunk-29yjrfeq.js} +1 -1
  19. package/dist/{chunk-2h06sph0.js → chunk-2apay7a3.js} +29 -29
  20. package/dist/{chunk-9k2c5sxb.js → chunk-2c4003f8.js} +26 -26
  21. package/dist/{chunk-h7ffkxg4.js → chunk-2eb66dha.js} +6 -6
  22. package/dist/{chunk-8q4yg5pk.js → chunk-2j4wdmkt.js} +1 -1
  23. package/dist/{chunk-r6gyed9y.js → chunk-2mbctja8.js} +5 -5
  24. package/dist/{chunk-zc1s4swn.js → chunk-2smwf3e9.js} +2 -2
  25. package/dist/{chunk-k303kw9v.js → chunk-2x5az5dc.js} +27 -27
  26. package/dist/{chunk-76hrbqgr.js → chunk-34vnwd0v.js} +8 -8
  27. package/dist/{chunk-ga2vcmhy.js → chunk-386z9vh4.js} +28 -28
  28. package/dist/{chunk-14mkqwft.js → chunk-3ah2pq1f.js} +32 -32
  29. package/dist/{chunk-c8rgc3hw.js → chunk-3c0rxf7q.js} +31 -31
  30. package/dist/{chunk-e8zmtbry.js → chunk-3ef0cpf6.js} +27 -27
  31. package/dist/{chunk-mh8752jz.js → chunk-3fjgkntc.js} +1 -1
  32. package/dist/{chunk-qvywetwr.js → chunk-3gtk4mh3.js} +31 -31
  33. package/dist/{chunk-4ayhftnk.js → chunk-3gww1j1y.js} +32 -28
  34. package/dist/{chunk-zhe3rws3.js → chunk-3wjy1cpr.js} +4 -4
  35. package/dist/{chunk-w65283w4.js → chunk-4169yf5x.js} +2 -2
  36. package/dist/{chunk-h6dqpbac.js → chunk-43b84za2.js} +1 -1
  37. package/dist/{chunk-zmpygkz6.js → chunk-4581z0wr.js} +8 -8
  38. package/dist/{chunk-kcp8svja.js → chunk-45bbgebk.js} +4 -4
  39. package/dist/{chunk-xfft38wf.js → chunk-4drmj637.js} +5 -5
  40. package/dist/{chunk-2crz81z3.js → chunk-4f4jqsza.js} +1 -1
  41. package/dist/{chunk-fx6ghdvg.js → chunk-4f5xrg8h.js} +26 -26
  42. package/dist/{chunk-cdgv0k77.js → chunk-4gpt5ay1.js} +27 -27
  43. package/dist/{chunk-tw2wjsnb.js → chunk-4krsdy3p.js} +2 -2
  44. package/dist/{chunk-qhbchv06.js → chunk-4m47hfh0.js} +26 -26
  45. package/dist/{chunk-qahkzpj6.js → chunk-4nf1ec4f.js} +1 -1
  46. package/dist/{chunk-g5rf37hh.js → chunk-4vj2d7dz.js} +33 -33
  47. package/dist/{chunk-px27vhxx.js → chunk-4vjvqns0.js} +3 -3
  48. package/dist/{chunk-qmckdcc4.js → chunk-50xwa16q.js} +27 -27
  49. package/dist/{chunk-drsh1vv8.js → chunk-53sfy7n4.js} +26 -26
  50. package/dist/{chunk-24qcj0k5.js → chunk-53vj9v9s.js} +6 -6
  51. package/dist/{chunk-ftajx4gw.js → chunk-5526qw2k.js} +1 -1
  52. package/dist/{chunk-t0b0bas5.js → chunk-5840qkdv.js} +1 -1
  53. package/dist/{chunk-tm4w23dp.js → chunk-5hjsrynt.js} +1 -1
  54. package/dist/{chunk-gfk81w5r.js → chunk-5km8j211.js} +1 -1
  55. package/dist/{chunk-qkrenskm.js → chunk-5wzcv9gh.js} +5 -5
  56. package/dist/{chunk-18mm4jf8.js → chunk-5xjn56aq.js} +3 -3
  57. package/dist/{chunk-g71q1n7x.js → chunk-5yd55bg7.js} +26 -26
  58. package/dist/{chunk-fye86v7m.js → chunk-607fe07t.js} +26 -26
  59. package/dist/{chunk-g2tmm7k7.js → chunk-688ah6p4.js} +40 -40
  60. package/dist/{chunk-3c81vb6k.js → chunk-6ad36q0w.js} +3 -3
  61. package/dist/{chunk-zh6xf1fd.js → chunk-6b45etp0.js} +2 -2
  62. package/dist/{chunk-bhvmpf9m.js → chunk-6cqap182.js} +30 -30
  63. package/dist/{chunk-s2cwz71x.js → chunk-6k1w8x4k.js} +27 -27
  64. package/dist/{chunk-y3rg86fk.js → chunk-6sqsx9jy.js} +5 -5
  65. package/dist/{chunk-451hjtv9.js → chunk-6wpr3tjc.js} +26 -26
  66. package/dist/{chunk-5h17d17z.js → chunk-6yahjmr9.js} +1 -1
  67. package/dist/{chunk-t38536jf.js → chunk-75fdprgp.js} +1 -1
  68. package/dist/{chunk-h0s737p0.js → chunk-7750n93j.js} +1 -1
  69. package/dist/{chunk-s13m8efn.js → chunk-77dn0tk8.js} +1 -1
  70. package/dist/{chunk-v7xwthvg.js → chunk-79wycw4g.js} +68 -66
  71. package/dist/{chunk-145d3809.js → chunk-7cfbwd7q.js} +27 -27
  72. package/dist/{chunk-fskf0b3x.js → chunk-7hftfbxa.js} +2 -2
  73. package/dist/{chunk-n35gnb9g.js → chunk-7hmy36fh.js} +121 -2
  74. package/dist/{chunk-vmpcmvqq.js → chunk-7p1esgzf.js} +1 -1
  75. package/dist/{chunk-qn4cbm38.js → chunk-7w2h14a6.js} +5 -5
  76. package/dist/{chunk-2z6bv21c.js → chunk-86epd45z.js} +11 -11
  77. package/dist/{chunk-62dx37pf.js → chunk-8833n19q.js} +1 -1
  78. package/dist/{chunk-gpk30ekc.js → chunk-8cn35yvf.js} +4 -4
  79. package/dist/{chunk-zahg0adp.js → chunk-8favkbxx.js} +2 -2
  80. package/dist/{chunk-q890kpff.js → chunk-8fwh1vg6.js} +5 -5
  81. package/dist/{chunk-m83vaktc.js → chunk-8j0cag62.js} +1 -1
  82. package/dist/{chunk-wkx2xsed.js → chunk-8n7czf03.js} +27 -27
  83. package/dist/{chunk-ky85ntn8.js → chunk-90vttb3v.js} +36 -36
  84. package/dist/{chunk-e6nenv5n.js → chunk-9fsvmcz5.js} +29 -29
  85. package/dist/{chunk-p2sww3pd.js → chunk-9gpr8jae.js} +27 -27
  86. package/dist/{chunk-dne2ghq6.js → chunk-9je35yst.js} +3 -3
  87. package/dist/{chunk-2c4jgf3n.js → chunk-9qbwahdr.js} +3 -3
  88. package/dist/{chunk-8y1zs48n.js → chunk-9tgts6mc.js} +1 -1
  89. package/dist/{chunk-pvtzf6vs.js → chunk-a27gcyws.js} +2 -2
  90. package/dist/{chunk-c4x4fb6d.js → chunk-a5b9swcd.js} +26 -26
  91. package/dist/{chunk-3j857x3k.js → chunk-adjan1zm.js} +26 -26
  92. package/dist/{chunk-7gxyarah.js → chunk-agabmbjf.js} +29 -29
  93. package/dist/{chunk-xwhmcc3g.js → chunk-ajs8dza3.js} +26 -26
  94. package/dist/{chunk-sn3wbs2w.js → chunk-akkp39da.js} +26 -26
  95. package/dist/{chunk-nwgkkhk7.js → chunk-amyrs3hm.js} +2 -2
  96. package/dist/{chunk-f6wypwa6.js → chunk-ap1ykep6.js} +1 -1
  97. package/dist/{chunk-bzps3qec.js → chunk-azksrewr.js} +32 -32
  98. package/dist/{chunk-xvjdbsfa.js → chunk-b0x349dj.js} +27 -27
  99. package/dist/{chunk-ag3hbrat.js → chunk-b2vzxkee.js} +5 -5
  100. package/dist/{chunk-zy4fsy90.js → chunk-beq5rrj7.js} +5 -5
  101. package/dist/{chunk-gwah3f17.js → chunk-bv1k9d6v.js} +26 -26
  102. package/dist/{chunk-hbf3y5tw.js → chunk-bx6g17ek.js} +4 -4
  103. package/dist/{chunk-vm0b9vaz.js → chunk-c1jzx2gv.js} +4 -4
  104. package/dist/{chunk-z2aps7d9.js → chunk-c4y7537k.js} +2 -2
  105. package/dist/{chunk-cpvn0j86.js → chunk-ccb92crb.js} +4 -4
  106. package/dist/{chunk-3nwsgn73.js → chunk-cd6mvmte.js} +27 -27
  107. package/dist/{chunk-5k4kh5n9.js → chunk-cdqf4qst.js} +26 -26
  108. package/dist/{chunk-h5dk6k0g.js → chunk-cj8t81dc.js} +26 -26
  109. package/dist/{chunk-7etmzq13.js → chunk-cnggqnzm.js} +6 -6
  110. package/dist/{chunk-9p95042q.js → chunk-cqndxy46.js} +1 -1
  111. package/dist/chunk-cr6s4vp6.js +1396 -0
  112. package/dist/{chunk-rshk7m9c.js → chunk-crvsdcfv.js} +26 -26
  113. package/dist/{chunk-540608wh.js → chunk-cyjjqcs3.js} +27 -27
  114. package/dist/{chunk-fsex4yt2.js → chunk-cyxsqapw.js} +3 -3
  115. package/dist/{chunk-5ccpwbk7.js → chunk-d3paf9v2.js} +26 -26
  116. package/dist/{chunk-m2cskgz4.js → chunk-d6ecf8f1.js} +35 -35
  117. package/dist/{chunk-ermvk1xn.js → chunk-d92pjy0h.js} +29 -29
  118. package/dist/{chunk-dvf5921w.js → chunk-deatxv64.js} +8 -8
  119. package/dist/{chunk-v081mpyx.js → chunk-djp9rrcq.js} +17 -17
  120. package/dist/{chunk-e1t8jh0t.js → chunk-dtv3phgm.js} +26 -26
  121. package/dist/{chunk-1wykga1n.js → chunk-e5mw3cyw.js} +1 -1
  122. package/dist/{chunk-ar8awa36.js → chunk-e6rrn2tj.js} +26 -26
  123. package/dist/{chunk-n42nvr59.js → chunk-ebzv9705.js} +2 -2
  124. package/dist/{chunk-kmzv85ze.js → chunk-edz2xqmx.js} +35 -35
  125. package/dist/{chunk-4stgesb0.js → chunk-egwqdd9k.js} +13 -13
  126. package/dist/{chunk-w6rh4zpx.js → chunk-enzrrdn4.js} +1 -1
  127. package/dist/{chunk-y95se10r.js → chunk-erjs2wr4.js} +4 -4
  128. package/dist/{chunk-ms9225af.js → chunk-etg0he8j.js} +26 -26
  129. package/dist/{chunk-n2gc23dm.js → chunk-evww0yyb.js} +2 -2
  130. package/dist/{chunk-1ez8vf1y.js → chunk-ew9re4pd.js} +3 -3
  131. package/dist/{chunk-wp9nwczx.js → chunk-ewb2cm8z.js} +2 -2
  132. package/dist/{chunk-b4btw5kv.js → chunk-fbs21kq9.js} +1 -1
  133. package/dist/{chunk-ydraa9ey.js → chunk-fezbtqkp.js} +35 -35
  134. package/dist/{chunk-s1p2w5a5.js → chunk-fjh0vhqw.js} +3 -3
  135. package/dist/{chunk-dchgtage.js → chunk-fsqp1hdd.js} +2 -2
  136. package/dist/{chunk-2fx2x8qp.js → chunk-fsrg55vw.js} +4 -4
  137. package/dist/{chunk-4ydmya8m.js → chunk-g3t3tpmr.js} +5 -5
  138. package/dist/{chunk-7z0078sp.js → chunk-g5w87dmr.js} +1 -1
  139. package/dist/{chunk-ez958w7j.js → chunk-g9t81ym4.js} +27 -27
  140. package/dist/{chunk-379rspd7.js → chunk-gc91es60.js} +26 -26
  141. package/dist/{chunk-gz4r3k7a.js → chunk-gfc6zk7q.js} +3 -3
  142. package/dist/{chunk-symd8dvh.js → chunk-gra7rch0.js} +35 -35
  143. package/dist/{chunk-66j7fn6z.js → chunk-gyzh9997.js} +26 -26
  144. package/dist/{chunk-h7bkf3h2.js → chunk-h65cdcmj.js} +8 -8
  145. package/dist/{chunk-5s1bctjb.js → chunk-hcwq2bw3.js} +5 -5
  146. package/dist/{chunk-9f01qpne.js → chunk-hhx05ny2.js} +37 -37
  147. package/dist/{chunk-1av0kkwh.js → chunk-hy2yy9dj.js} +1 -1
  148. package/dist/{chunk-zwrt0s3s.js → chunk-hz4cc1fy.js} +26 -26
  149. package/dist/{chunk-n0rn505k.js → chunk-j5pcp6j1.js} +2 -2
  150. package/dist/{chunk-x42kc5wj.js → chunk-jhbtp60e.js} +4 -4
  151. package/dist/{chunk-kmcaa88h.js → chunk-jjcks6sw.js} +1 -1
  152. package/dist/{chunk-9nddm5c7.js → chunk-jver0cay.js} +1 -1
  153. package/dist/{chunk-m2rx2dtd.js → chunk-jz86pz25.js} +38 -38
  154. package/dist/{chunk-ay9wm3tf.js → chunk-k5kw9hyy.js} +1 -1
  155. package/dist/{chunk-antr836n.js → chunk-k8vb990d.js} +26 -26
  156. package/dist/{chunk-m95fj0wm.js → chunk-kyvg0zcc.js} +2 -2
  157. package/dist/{chunk-r325sbz7.js → chunk-m007chff.js} +12 -12
  158. package/dist/{chunk-qxv21mcq.js → chunk-m08081ys.js} +27 -27
  159. package/dist/{chunk-wmd0v561.js → chunk-m77e1esy.js} +1 -1
  160. package/dist/{chunk-1vzaw5f6.js → chunk-mcwdvkc5.js} +5 -5
  161. package/dist/{chunk-y10byvag.js → chunk-mdk5vcer.js} +9 -9
  162. package/dist/{chunk-9ejadhq8.js → chunk-mfmqxvy3.js} +28 -28
  163. package/dist/{chunk-c1cm8km0.js → chunk-mg88phh5.js} +26 -26
  164. package/dist/{chunk-vvm5az9j.js → chunk-mh9bbz4s.js} +2 -2
  165. package/dist/{chunk-9gypgvd7.js → chunk-mhd4n6av.js} +1 -1
  166. package/dist/{chunk-4q5a5mjb.js → chunk-mmc59v16.js} +332 -132
  167. package/dist/{chunk-jty4xkhc.js → chunk-mqqg7cf6.js} +3 -3
  168. package/dist/{chunk-0pxmxyxv.js → chunk-mt10f1tp.js} +1 -1
  169. package/dist/{chunk-9b0btjar.js → chunk-mz2rbmwe.js} +29 -29
  170. package/dist/{chunk-n612gr22.js → chunk-n4by7yk8.js} +27 -27
  171. package/dist/{chunk-nbzntnkz.js → chunk-ndgnv15y.js} +27 -27
  172. package/dist/{chunk-rgpxnjx4.js → chunk-ne7y2xb5.js} +3 -3
  173. package/dist/{chunk-j44ngncb.js → chunk-nnbp6hww.js} +2 -2
  174. package/dist/{chunk-d969b8ne.js → chunk-nrgyjw8e.js} +5 -5
  175. package/dist/{chunk-psp1n9vg.js → chunk-ns09xpt7.js} +1 -1
  176. package/dist/{chunk-22rs73mh.js → chunk-ns11b23b.js} +28 -28
  177. package/dist/{chunk-g14ex9z0.js → chunk-nskrydpn.js} +26 -26
  178. package/dist/{chunk-nzchm0f2.js → chunk-nt5vedsr.js} +1 -1
  179. package/dist/{chunk-rhxtttx1.js → chunk-nzrgdzqp.js} +2 -2
  180. package/dist/{chunk-6qexrv9a.js → chunk-p2pgnk1y.js} +26 -26
  181. package/dist/{chunk-ynjbppdn.js → chunk-p78dmmrg.js} +26 -26
  182. package/dist/{chunk-6wrs3ahh.js → chunk-p88crc0s.js} +4 -4
  183. package/dist/{chunk-40ax4h54.js → chunk-p9rdn455.js} +27 -27
  184. package/dist/{chunk-xjd32sva.js → chunk-pc4szfak.js} +5 -5
  185. package/dist/{chunk-64mwy58c.js → chunk-pp11ggs7.js} +1 -1
  186. package/dist/{chunk-bpmw0wp2.js → chunk-ptpynwv2.js} +26 -26
  187. package/dist/{chunk-5r3wgr44.js → chunk-ptxwtjpj.js} +17 -1387
  188. package/dist/{chunk-jg7na104.js → chunk-pzxksam8.js} +26 -26
  189. package/dist/{chunk-1vzb650a.js → chunk-q223vmcc.js} +1 -1
  190. package/dist/{chunk-zajs1j2b.js → chunk-q6d7rjw1.js} +26 -26
  191. package/dist/{chunk-58rg6rn2.js → chunk-q7e35wkk.js} +1 -1
  192. package/dist/{chunk-6xr5mayh.js → chunk-qbmbmhef.js} +26 -26
  193. package/dist/{chunk-zv5yt0g4.js → chunk-qga7he5v.js} +2 -2
  194. package/dist/{chunk-s3aygngf.js → chunk-qkwmefpm.js} +27 -27
  195. package/dist/{chunk-y82s03p7.js → chunk-qpprdv6x.js} +2 -2
  196. package/dist/{chunk-855katq2.js → chunk-qqfr3g23.js} +28 -28
  197. package/dist/{chunk-c2ktjyc0.js → chunk-qxy16bqn.js} +91 -1028
  198. package/dist/{chunk-k5c76pvm.js → chunk-r1gkg1zh.js} +29 -29
  199. package/dist/{chunk-egcx83tp.js → chunk-r4hf85nn.js} +3 -3
  200. package/dist/{chunk-ymtkahxp.js → chunk-r8cbwyz2.js} +35 -35
  201. package/dist/{chunk-kbshq7zc.js → chunk-rck3g0jk.js} +26 -26
  202. package/dist/{chunk-2pdcq92c.js → chunk-rejx7z4t.js} +1 -1
  203. package/dist/{chunk-0ahxmrws.js → chunk-rfnh6gdw.js} +5 -5
  204. package/dist/{chunk-52evx0rm.js → chunk-rywnz223.js} +4 -4
  205. package/dist/{chunk-r7s0jwb1.js → chunk-s0c72pgz.js} +27 -27
  206. package/dist/{chunk-tbma29g4.js → chunk-s4erjnky.js} +26 -26
  207. package/dist/{chunk-tf8gr3bs.js → chunk-s7gt9pbp.js} +27 -27
  208. package/dist/{chunk-c14sp904.js → chunk-s95y1wsx.js} +3 -3
  209. package/dist/{chunk-4yxd0e7k.js → chunk-sfs23jb0.js} +26 -26
  210. package/dist/{chunk-y29pdynp.js → chunk-sjr9vygr.js} +3 -3
  211. package/dist/{chunk-z7svjppe.js → chunk-smskbnfh.js} +4 -4
  212. package/dist/{chunk-p7d5ms03.js → chunk-swjmy1ec.js} +4 -4
  213. package/dist/{chunk-c96k89rp.js → chunk-t5vfbd78.js} +26 -26
  214. package/dist/{chunk-163379k5.js → chunk-t76a178c.js} +26 -26
  215. package/dist/{chunk-h93tjx98.js → chunk-tgav5bz9.js} +84 -83
  216. package/dist/chunk-tr91zear.js +1012 -0
  217. package/dist/{chunk-b6whrv9m.js → chunk-ts2892h4.js} +6 -6
  218. package/dist/{chunk-bkzs71af.js → chunk-txz05nf1.js} +1 -1
  219. package/dist/{chunk-ztrgnar4.js → chunk-v3kfrhgg.js} +1 -1
  220. package/dist/chunk-v47r6dev.js +3799 -0
  221. package/dist/{chunk-vb6w46m9.js → chunk-v7vav1dg.js} +27 -27
  222. package/dist/{chunk-3avnvgnv.js → chunk-v88g6btg.js} +2 -2
  223. package/dist/{chunk-h7mpryyc.js → chunk-v9bnkmpp.js} +27 -27
  224. package/dist/{chunk-8wv29424.js → chunk-vchfbqh0.js} +1 -1
  225. package/dist/{chunk-9v5bwvbm.js → chunk-vcv8kqah.js} +29 -29
  226. package/dist/{chunk-gdb6dvba.js → chunk-vdv5g7q5.js} +27 -27
  227. package/dist/{chunk-awwfrm4f.js → chunk-vjbm6e89.js} +8 -8
  228. package/dist/{chunk-cxf74p1t.js → chunk-vjvstd86.js} +1 -1
  229. package/dist/{chunk-3er4wswe.js → chunk-vmb323h1.js} +113 -113
  230. package/dist/{chunk-r7r3jm3y.js → chunk-vq51wj3f.js} +26 -26
  231. package/dist/{chunk-kz13d2bs.js → chunk-vqrph16d.js} +2 -2
  232. package/dist/{chunk-3s2gjp2n.js → chunk-vvsc8651.js} +34 -34
  233. package/dist/{chunk-wkjjv1jr.js → chunk-w5b8wpff.js} +27 -27
  234. package/dist/{chunk-yevbmk5g.js → chunk-w5f4g9ty.js} +1 -1
  235. package/dist/{chunk-nsxw7en4.js → chunk-w64rnehj.js} +5 -5
  236. package/dist/{chunk-b31v41mz.js → chunk-w74twxev.js} +5 -5
  237. package/dist/{chunk-ry1jb15g.js → chunk-w8hh0w92.js} +26 -26
  238. package/dist/{chunk-kh04yrpx.js → chunk-wh42d494.js} +27 -27
  239. package/dist/{chunk-536fmbtq.js → chunk-wm9c1620.js} +1 -1
  240. package/dist/{chunk-08a6n2pp.js → chunk-x0qzkte0.js} +1 -1
  241. package/dist/{chunk-9nydmbm4.js → chunk-x3p67k4j.js} +1 -1
  242. package/dist/{chunk-eef1npre.js → chunk-x7jtxq14.js} +1 -1
  243. package/dist/{chunk-b4twmt0s.js → chunk-xayw54gs.js} +5 -5
  244. package/dist/{chunk-hgfw7nx2.js → chunk-xe4dvfz2.js} +26 -26
  245. package/dist/{chunk-x639j7py.js → chunk-xjcmfp13.js} +29 -29
  246. package/dist/{chunk-59mg8c5k.js → chunk-xmretc2b.js} +26 -26
  247. package/dist/{chunk-1q82ecz5.js → chunk-xqf27kff.js} +26 -26
  248. package/dist/{chunk-0fpkjw2j.js → chunk-xsevshsa.js} +4 -4
  249. package/dist/{chunk-bnvd1jc1.js → chunk-y0fvv8rp.js} +3 -3
  250. package/dist/{chunk-5cc50ecq.js → chunk-y2x0t2gb.js} +32 -32
  251. package/dist/{chunk-d73t8nhj.js → chunk-y315v6st.js} +12 -12
  252. package/dist/{chunk-0a2qnsbr.js → chunk-y81y5v3d.js} +28 -28
  253. package/dist/{chunk-5scrgrwv.js → chunk-yatby2yh.js} +1 -1
  254. package/dist/{chunk-e03zrq9n.js → chunk-yg0h97bm.js} +26 -26
  255. package/dist/{chunk-667f3w39.js → chunk-ypgs2acw.js} +5 -5
  256. package/dist/{chunk-p1af059d.js → chunk-ysdxmhpv.js} +29 -29
  257. package/dist/{chunk-0h4sw1v3.js → chunk-ytwnb2km.js} +26 -26
  258. package/dist/{chunk-0xq2bfvv.js → chunk-z6gvvfmf.js} +2 -2
  259. package/dist/{chunk-2tcznfv0.js → chunk-z6q66vf8.js} +1 -1
  260. package/dist/{chunk-35xyzbd2.js → chunk-z9f8mvd1.js} +32 -32
  261. package/dist/{chunk-j3ctqpsn.js → chunk-zda436nm.js} +2 -2
  262. package/dist/{chunk-49n22kr8.js → chunk-zddcrj90.js} +26 -26
  263. package/dist/{chunk-c209ascy.js → chunk-zh7z8zmq.js} +3 -3
  264. package/dist/{chunk-9byk2a4b.js → chunk-zhq7vk2g.js} +5 -5
  265. package/dist/{chunk-c9p5eyxf.js → chunk-zjhz0qyc.js} +28 -28
  266. package/dist/{chunk-vqawqpkx.js → chunk-zkv7atzf.js} +37 -37
  267. package/dist/{chunk-wef34bk5.js → chunk-zrrd9egx.js} +27 -27
  268. package/dist/{chunk-9r28w6ye.js → chunk-zttmdag3.js} +1 -1
  269. package/dist/cli.js +14 -8
  270. package/package.json +9 -3
@@ -0,0 +1,1396 @@
1
+ // @bun
2
+ import {
3
+ init_slashCommandParsing,
4
+ parseSlashCommand
5
+ } from "./chunk-rn0v1hk8.js";
6
+ import {
7
+ DEFAULT_OUTPUT_STYLE_NAME,
8
+ Select,
9
+ Spinner,
10
+ createAttachmentMessage,
11
+ createCommandInputMessage,
12
+ createImageMetadataText,
13
+ createSystemMessage,
14
+ createUserMessage,
15
+ executeUserPromptSubmitHooks,
16
+ extractTag,
17
+ fileHistoryCanRestore,
18
+ fileHistoryEnabled,
19
+ fileHistoryGetDiffStats,
20
+ findCommand,
21
+ getAttachmentMessages,
22
+ getCommandName,
23
+ getContentText,
24
+ getUserPromptSubmitHookBlockingMessage,
25
+ init_AppState,
26
+ init_Spinner,
27
+ init_attachments,
28
+ init_commands1 as init_commands,
29
+ init_fileHistory,
30
+ init_generators,
31
+ init_hooks1 as init_hooks,
32
+ init_imageResizer,
33
+ init_imageStore,
34
+ init_messages1 as init_messages,
35
+ init_outputStyles,
36
+ init_queryProfiler,
37
+ init_select,
38
+ init_textInputTypes,
39
+ init_useTerminalSize,
40
+ isBridgeSafeCommand,
41
+ isEmptyMessageText,
42
+ isSyntheticMessage,
43
+ isToolUseResultMessage,
44
+ isValidImagePaste,
45
+ maybeResizeAndDownsampleImageBlock,
46
+ queryCheckpoint,
47
+ storeImages,
48
+ toArray,
49
+ useAppState
50
+ } from "./chunk-mmc59v16.js";
51
+ import {
52
+ init_useExitOnCtrlCDWithKeybindings,
53
+ useExitOnCtrlCDWithKeybindings
54
+ } from "./chunk-4169yf5x.js";
55
+ import {
56
+ init_useKeybinding
57
+ } from "./chunk-t0twk3e5.js";
58
+ import {
59
+ init_events,
60
+ init_sessionTracing,
61
+ logOTelEvent,
62
+ redactIfDisabled,
63
+ startInteractionSpan
64
+ } from "./chunk-mhd4n6av.js";
65
+ import {
66
+ AGENT_TOOL_NAME,
67
+ LEGACY_AGENT_TOOL_NAME,
68
+ getAnthropicApiKeyWithSource,
69
+ getFastModeState,
70
+ getSettings_DEPRECATED,
71
+ init_auth,
72
+ init_constants1 as init_constants,
73
+ init_fastMode,
74
+ init_settings1 as init_settings
75
+ } from "./chunk-4581z0wr.js";
76
+ import {
77
+ count,
78
+ init_array
79
+ } from "./chunk-zwarn9h7.js";
80
+ import {
81
+ formatRelativeTimeAgo,
82
+ init_format,
83
+ truncate
84
+ } from "./chunk-prgsmrmy.js";
85
+ import {
86
+ Divider,
87
+ ThemedBox_default,
88
+ ThemedText,
89
+ init_src,
90
+ useKeybinding,
91
+ useKeybindings,
92
+ useTerminalSize
93
+ } from "./chunk-e4jqbn4d.js";
94
+ import {
95
+ require_jsx_dev_runtime
96
+ } from "./chunk-vxnvzfnv.js";
97
+ import {
98
+ require_react
99
+ } from "./chunk-ns3babbs.js";
100
+ import {
101
+ init_analytics,
102
+ logEvent
103
+ } from "./chunk-h0rbjg6x.js";
104
+ import {
105
+ getCwd,
106
+ init_cwd
107
+ } from "./chunk-tv74hgw9.js";
108
+ import {
109
+ BASH_STDERR_TAG,
110
+ BASH_STDOUT_TAG,
111
+ COMMAND_MESSAGE_TAG,
112
+ LOCAL_COMMAND_STDERR_TAG,
113
+ LOCAL_COMMAND_STDOUT_TAG,
114
+ TASK_NOTIFICATION_TAG,
115
+ TEAMMATE_MESSAGE_TAG,
116
+ TICK_TAG,
117
+ init_displayTags,
118
+ init_log,
119
+ init_xml,
120
+ logError,
121
+ stripDisplayTags
122
+ } from "./chunk-d2vb6m9e.js";
123
+ import {
124
+ figures_default,
125
+ init_figures
126
+ } from "./chunk-qajrkk97.js";
127
+ import {
128
+ getSdkBetas,
129
+ getSessionId,
130
+ init_state,
131
+ setPromptId
132
+ } from "./chunk-gzp6rza1.js";
133
+ import {
134
+ __esm,
135
+ __export,
136
+ __require,
137
+ __toESM
138
+ } from "./chunk-qp2qdcda.js";
139
+
140
+ // src/components/MessageSelector.tsx
141
+ var exports_MessageSelector = {};
142
+ __export(exports_MessageSelector, {
143
+ selectableUserMessagesFilter: () => selectableUserMessagesFilter,
144
+ messagesAfterAreOnlySynthetic: () => messagesAfterAreOnlySynthetic,
145
+ MessageSelector: () => MessageSelector
146
+ });
147
+ import { randomUUID } from "crypto";
148
+ import * as path from "path";
149
+ function isTextBlock(block) {
150
+ return block.type === "text";
151
+ }
152
+ function isSummarizeOption(option) {
153
+ return option === "summarize" || option === "summarize_up_to";
154
+ }
155
+ function MessageSelector({
156
+ messages,
157
+ onPreRestore,
158
+ onRestoreMessage,
159
+ onRestoreCode,
160
+ onSummarize,
161
+ onClose,
162
+ preselectedMessage
163
+ }) {
164
+ const fileHistory = useAppState((s) => s.fileHistory);
165
+ const [error, setError] = import_react.useState(undefined);
166
+ const isFileHistoryEnabled = fileHistoryEnabled();
167
+ const currentUUID = import_react.useMemo(randomUUID, []);
168
+ const messageOptions = import_react.useMemo(() => [
169
+ ...messages.filter(selectableUserMessagesFilter),
170
+ {
171
+ ...createUserMessage({
172
+ content: ""
173
+ }),
174
+ uuid: currentUUID
175
+ }
176
+ ], [messages, currentUUID]);
177
+ const [selectedIndex, setSelectedIndex] = import_react.useState(messageOptions.length - 1);
178
+ const firstVisibleIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_MESSAGES / 2), messageOptions.length - MAX_VISIBLE_MESSAGES));
179
+ const hasMessagesToSelect = messageOptions.length > 1;
180
+ const [messageToRestore, setMessageToRestore] = import_react.useState(preselectedMessage);
181
+ const [diffStatsForRestore, setDiffStatsForRestore] = import_react.useState(undefined);
182
+ import_react.useEffect(() => {
183
+ if (!preselectedMessage || !isFileHistoryEnabled)
184
+ return;
185
+ let cancelled = false;
186
+ fileHistoryGetDiffStats(fileHistory, preselectedMessage.uuid).then((stats) => {
187
+ if (!cancelled)
188
+ setDiffStatsForRestore(stats);
189
+ });
190
+ return () => {
191
+ cancelled = true;
192
+ };
193
+ }, [preselectedMessage, isFileHistoryEnabled, fileHistory]);
194
+ const [isRestoring, setIsRestoring] = import_react.useState(false);
195
+ const [restoringOption, setRestoringOption] = import_react.useState(null);
196
+ const [selectedRestoreOption, setSelectedRestoreOption] = import_react.useState("both");
197
+ const [summarizeFromFeedback, setSummarizeFromFeedback] = import_react.useState("");
198
+ const [summarizeUpToFeedback, setSummarizeUpToFeedback] = import_react.useState("");
199
+ function getRestoreOptions(canRestoreCode2) {
200
+ const baseOptions = canRestoreCode2 ? [
201
+ { value: "both", label: "Restore code and conversation" },
202
+ { value: "conversation", label: "Restore conversation" },
203
+ { value: "code", label: "Restore code" }
204
+ ] : [{ value: "conversation", label: "Restore conversation" }];
205
+ const summarizeInputProps = {
206
+ type: "input",
207
+ placeholder: "add context (optional)",
208
+ initialValue: "",
209
+ allowEmptySubmitToCancel: true,
210
+ showLabelWithValue: true,
211
+ labelValueSeparator: ": "
212
+ };
213
+ baseOptions.push({
214
+ value: "summarize",
215
+ label: "Summarize from here",
216
+ ...summarizeInputProps,
217
+ onChange: setSummarizeFromFeedback
218
+ });
219
+ if (process.env.USER_TYPE === "ant") {
220
+ baseOptions.push({
221
+ value: "summarize_up_to",
222
+ label: "Summarize up to here",
223
+ ...summarizeInputProps,
224
+ onChange: setSummarizeUpToFeedback
225
+ });
226
+ }
227
+ baseOptions.push({ value: "nevermind", label: "Never mind" });
228
+ return baseOptions;
229
+ }
230
+ import_react.useEffect(() => {
231
+ logEvent("tengu_message_selector_opened", {});
232
+ }, []);
233
+ async function restoreConversationDirectly(message) {
234
+ onPreRestore();
235
+ setIsRestoring(true);
236
+ try {
237
+ await onRestoreMessage(message);
238
+ setIsRestoring(false);
239
+ onClose();
240
+ } catch (error2) {
241
+ logError(error2);
242
+ setIsRestoring(false);
243
+ setError(`Failed to restore the conversation:
244
+ ${error2}`);
245
+ }
246
+ }
247
+ async function handleSelect(message) {
248
+ const index = messages.indexOf(message);
249
+ const indexFromEnd = messages.length - 1 - index;
250
+ logEvent("tengu_message_selector_selected", {
251
+ index_from_end: indexFromEnd,
252
+ message_type: message.type,
253
+ is_current_prompt: false
254
+ });
255
+ if (!messages.includes(message)) {
256
+ onClose();
257
+ return;
258
+ }
259
+ if (!isFileHistoryEnabled) {
260
+ await restoreConversationDirectly(message);
261
+ return;
262
+ }
263
+ const diffStats = await fileHistoryGetDiffStats(fileHistory, message.uuid);
264
+ setMessageToRestore(message);
265
+ setDiffStatsForRestore(diffStats);
266
+ }
267
+ async function onSelectRestoreOption(option) {
268
+ logEvent("tengu_message_selector_restore_option_selected", {
269
+ option
270
+ });
271
+ if (!messageToRestore) {
272
+ setError("Message not found.");
273
+ return;
274
+ }
275
+ if (option === "nevermind") {
276
+ if (preselectedMessage)
277
+ onClose();
278
+ else
279
+ setMessageToRestore(undefined);
280
+ return;
281
+ }
282
+ if (isSummarizeOption(option)) {
283
+ onPreRestore();
284
+ setIsRestoring(true);
285
+ setRestoringOption(option);
286
+ setError(undefined);
287
+ try {
288
+ const direction = option === "summarize_up_to" ? "up_to" : "from";
289
+ const feedback = (direction === "up_to" ? summarizeUpToFeedback : summarizeFromFeedback).trim() || undefined;
290
+ await onSummarize(messageToRestore, feedback, direction);
291
+ setIsRestoring(false);
292
+ setRestoringOption(null);
293
+ setMessageToRestore(undefined);
294
+ onClose();
295
+ } catch (error2) {
296
+ logError(error2);
297
+ setIsRestoring(false);
298
+ setRestoringOption(null);
299
+ setMessageToRestore(undefined);
300
+ setError(`Failed to summarize:
301
+ ${error2}`);
302
+ }
303
+ return;
304
+ }
305
+ onPreRestore();
306
+ setIsRestoring(true);
307
+ setError(undefined);
308
+ let codeError = null;
309
+ let conversationError = null;
310
+ if (option === "code" || option === "both") {
311
+ try {
312
+ await onRestoreCode(messageToRestore);
313
+ } catch (error2) {
314
+ codeError = error2;
315
+ logError(codeError);
316
+ }
317
+ }
318
+ if (option === "conversation" || option === "both") {
319
+ try {
320
+ await onRestoreMessage(messageToRestore);
321
+ } catch (error2) {
322
+ conversationError = error2;
323
+ logError(conversationError);
324
+ }
325
+ }
326
+ setIsRestoring(false);
327
+ setMessageToRestore(undefined);
328
+ if (conversationError && codeError) {
329
+ setError(`Failed to restore the conversation and code:
330
+ ${conversationError}
331
+ ${codeError}`);
332
+ } else if (conversationError) {
333
+ setError(`Failed to restore the conversation:
334
+ ${conversationError}`);
335
+ } else if (codeError) {
336
+ setError(`Failed to restore the code:
337
+ ${codeError}`);
338
+ } else {
339
+ onClose();
340
+ }
341
+ }
342
+ const exitState = useExitOnCtrlCDWithKeybindings();
343
+ const handleEscape = import_react.useCallback(() => {
344
+ if (messageToRestore && !preselectedMessage) {
345
+ setMessageToRestore(undefined);
346
+ return;
347
+ }
348
+ logEvent("tengu_message_selector_cancelled", {});
349
+ onClose();
350
+ }, [onClose, messageToRestore, preselectedMessage]);
351
+ const moveUp = import_react.useCallback(() => setSelectedIndex((prev) => Math.max(0, prev - 1)), []);
352
+ const moveDown = import_react.useCallback(() => setSelectedIndex((prev) => Math.min(messageOptions.length - 1, prev + 1)), [messageOptions.length]);
353
+ const jumpToTop = import_react.useCallback(() => setSelectedIndex(0), []);
354
+ const jumpToBottom = import_react.useCallback(() => setSelectedIndex(messageOptions.length - 1), [messageOptions.length]);
355
+ const handleSelectCurrent = import_react.useCallback(() => {
356
+ const selected = messageOptions[selectedIndex];
357
+ if (selected) {
358
+ handleSelect(selected);
359
+ }
360
+ }, [messageOptions, selectedIndex, handleSelect]);
361
+ useKeybinding("confirm:no", handleEscape, {
362
+ context: "Confirmation",
363
+ isActive: !messageToRestore
364
+ });
365
+ useKeybindings({
366
+ "messageSelector:up": moveUp,
367
+ "messageSelector:down": moveDown,
368
+ "messageSelector:top": jumpToTop,
369
+ "messageSelector:bottom": jumpToBottom,
370
+ "messageSelector:select": handleSelectCurrent
371
+ }, {
372
+ context: "MessageSelector",
373
+ isActive: !isRestoring && !error && !messageToRestore && hasMessagesToSelect
374
+ });
375
+ const [fileHistoryMetadata, setFileHistoryMetadata] = import_react.useState({});
376
+ import_react.useEffect(() => {
377
+ async function loadFileHistoryMetadata() {
378
+ if (!isFileHistoryEnabled) {
379
+ return;
380
+ }
381
+ Promise.all(messageOptions.map(async (userMessage, itemIndex) => {
382
+ if (userMessage.uuid !== currentUUID) {
383
+ const canRestore = fileHistoryCanRestore(fileHistory, userMessage.uuid);
384
+ const nextUserMessage = messageOptions.at(itemIndex + 1);
385
+ const diffStats = canRestore ? computeDiffStatsBetweenMessages(messages, userMessage.uuid, nextUserMessage?.uuid !== currentUUID ? nextUserMessage?.uuid : undefined) : undefined;
386
+ if (diffStats !== undefined) {
387
+ setFileHistoryMetadata((prev) => ({
388
+ ...prev,
389
+ [itemIndex]: diffStats
390
+ }));
391
+ } else {
392
+ setFileHistoryMetadata((prev) => ({
393
+ ...prev,
394
+ [itemIndex]: undefined
395
+ }));
396
+ }
397
+ }
398
+ }));
399
+ }
400
+ loadFileHistoryMetadata();
401
+ }, [messageOptions, messages, currentUUID, fileHistory, isFileHistoryEnabled]);
402
+ const canRestoreCode = isFileHistoryEnabled && diffStatsForRestore?.filesChanged && diffStatsForRestore.filesChanged.length > 0;
403
+ const showPickList = !error && !messageToRestore && !preselectedMessage && hasMessagesToSelect;
404
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
405
+ flexDirection: "column",
406
+ width: "100%",
407
+ children: [
408
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Divider, {
409
+ color: "suggestion"
410
+ }, undefined, false, undefined, this),
411
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
412
+ flexDirection: "column",
413
+ marginX: 1,
414
+ gap: 1,
415
+ children: [
416
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
417
+ bold: true,
418
+ color: "suggestion",
419
+ children: "Rewind"
420
+ }, undefined, false, undefined, this),
421
+ error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
422
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
423
+ color: "error",
424
+ children: [
425
+ "Error: ",
426
+ error
427
+ ]
428
+ }, undefined, true, undefined, this)
429
+ }, undefined, false, undefined, this),
430
+ !hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
431
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
432
+ children: "Nothing to rewind to yet."
433
+ }, undefined, false, undefined, this)
434
+ }, undefined, false, undefined, this),
435
+ !error && messageToRestore && hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
436
+ children: [
437
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
438
+ children: [
439
+ "Confirm you want to restore",
440
+ " ",
441
+ !diffStatsForRestore && "the conversation ",
442
+ "to the point before you sent this message:"
443
+ ]
444
+ }, undefined, true, undefined, this),
445
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
446
+ flexDirection: "column",
447
+ paddingLeft: 1,
448
+ borderStyle: "single",
449
+ borderRight: false,
450
+ borderTop: false,
451
+ borderBottom: false,
452
+ borderLeft: true,
453
+ borderLeftDimColor: true,
454
+ children: [
455
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
456
+ userMessage: messageToRestore,
457
+ color: "text",
458
+ isCurrent: false
459
+ }, undefined, false, undefined, this),
460
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
461
+ dimColor: true,
462
+ children: [
463
+ "(",
464
+ formatRelativeTimeAgo(new Date(messageToRestore.timestamp)),
465
+ ")"
466
+ ]
467
+ }, undefined, true, undefined, this)
468
+ ]
469
+ }, undefined, true, undefined, this),
470
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreOptionDescription, {
471
+ selectedRestoreOption,
472
+ canRestoreCode: !!canRestoreCode,
473
+ diffStatsForRestore
474
+ }, undefined, false, undefined, this),
475
+ isRestoring && isSummarizeOption(restoringOption) ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
476
+ flexDirection: "row",
477
+ gap: 1,
478
+ children: [
479
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Spinner, {}, undefined, false, undefined, this),
480
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
481
+ children: "Summarizing\u2026"
482
+ }, undefined, false, undefined, this)
483
+ ]
484
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
485
+ isDisabled: isRestoring,
486
+ options: getRestoreOptions(!!canRestoreCode),
487
+ defaultFocusValue: canRestoreCode ? "both" : "conversation",
488
+ onFocus: (value) => setSelectedRestoreOption(value),
489
+ onChange: (value) => onSelectRestoreOption(value),
490
+ onCancel: () => preselectedMessage ? onClose() : setMessageToRestore(undefined)
491
+ }, undefined, false, undefined, this),
492
+ canRestoreCode && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
493
+ marginBottom: 1,
494
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
495
+ dimColor: true,
496
+ children: [
497
+ figures_default.warning,
498
+ " Rewinding does not affect files edited manually or via bash."
499
+ ]
500
+ }, undefined, true, undefined, this)
501
+ }, undefined, false, undefined, this)
502
+ ]
503
+ }, undefined, true, undefined, this),
504
+ showPickList && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
505
+ children: [
506
+ isFileHistoryEnabled ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
507
+ children: "Restore the code and/or conversation to the point before\u2026"
508
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
509
+ children: "Restore and fork the conversation to the point before\u2026"
510
+ }, undefined, false, undefined, this),
511
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
512
+ width: "100%",
513
+ flexDirection: "column",
514
+ children: messageOptions.slice(firstVisibleIndex, firstVisibleIndex + MAX_VISIBLE_MESSAGES).map((msg, visibleOptionIndex) => {
515
+ const optionIndex = firstVisibleIndex + visibleOptionIndex;
516
+ const isSelected = optionIndex === selectedIndex;
517
+ const isCurrent = msg.uuid === currentUUID;
518
+ const metadataLoaded = optionIndex in fileHistoryMetadata;
519
+ const metadata = fileHistoryMetadata[optionIndex];
520
+ const numFilesChanged = metadata?.filesChanged && metadata.filesChanged.length;
521
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
522
+ height: isFileHistoryEnabled ? 3 : 2,
523
+ overflow: "hidden",
524
+ width: "100%",
525
+ flexDirection: "row",
526
+ children: [
527
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
528
+ width: 2,
529
+ minWidth: 2,
530
+ children: isSelected ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
531
+ color: "permission",
532
+ bold: true,
533
+ children: [
534
+ figures_default.pointer,
535
+ " "
536
+ ]
537
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
538
+ children: " "
539
+ }, undefined, false, undefined, this)
540
+ }, undefined, false, undefined, this),
541
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
542
+ flexDirection: "column",
543
+ children: [
544
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
545
+ flexShrink: 1,
546
+ height: 1,
547
+ overflow: "hidden",
548
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
549
+ userMessage: msg,
550
+ color: isSelected ? "suggestion" : undefined,
551
+ isCurrent,
552
+ paddingRight: 10
553
+ }, undefined, false, undefined, this)
554
+ }, undefined, false, undefined, this),
555
+ isFileHistoryEnabled && metadataLoaded && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
556
+ height: 1,
557
+ flexDirection: "row",
558
+ children: metadata ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
559
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
560
+ dimColor: !isSelected,
561
+ color: "inactive",
562
+ children: numFilesChanged ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
563
+ children: [
564
+ numFilesChanged === 1 && metadata.filesChanged[0] ? `${path.basename(metadata.filesChanged[0])} ` : `${numFilesChanged} files changed `,
565
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
566
+ diffStats: metadata
567
+ }, undefined, false, undefined, this)
568
+ ]
569
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
570
+ children: "No code changes"
571
+ }, undefined, false, undefined, this)
572
+ }, undefined, false, undefined, this)
573
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
574
+ dimColor: true,
575
+ color: "warning",
576
+ children: [
577
+ figures_default.warning,
578
+ " No code restore"
579
+ ]
580
+ }, undefined, true, undefined, this)
581
+ }, undefined, false, undefined, this)
582
+ ]
583
+ }, undefined, true, undefined, this)
584
+ ]
585
+ }, msg.uuid, true, undefined, this);
586
+ })
587
+ }, undefined, false, undefined, this)
588
+ ]
589
+ }, undefined, true, undefined, this),
590
+ !messageToRestore && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
591
+ dimColor: true,
592
+ italic: true,
593
+ children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
594
+ children: [
595
+ "Press ",
596
+ exitState.keyName,
597
+ " again to exit"
598
+ ]
599
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
600
+ children: [
601
+ !error && hasMessagesToSelect && "Enter to continue \xB7 ",
602
+ "Esc to exit"
603
+ ]
604
+ }, undefined, true, undefined, this)
605
+ }, undefined, false, undefined, this)
606
+ ]
607
+ }, undefined, true, undefined, this)
608
+ ]
609
+ }, undefined, true, undefined, this);
610
+ }
611
+ function getRestoreOptionConversationText(option) {
612
+ switch (option) {
613
+ case "summarize":
614
+ return "Messages after this point will be summarized.";
615
+ case "summarize_up_to":
616
+ return "Preceding messages will be summarized. This and subsequent messages will remain unchanged \u2014 you will stay at the end of the conversation.";
617
+ case "both":
618
+ case "conversation":
619
+ return "The conversation will be forked.";
620
+ case "code":
621
+ case "nevermind":
622
+ return "The conversation will be unchanged.";
623
+ }
624
+ }
625
+ function RestoreOptionDescription({
626
+ selectedRestoreOption,
627
+ canRestoreCode,
628
+ diffStatsForRestore
629
+ }) {
630
+ const showCodeRestore = canRestoreCode && (selectedRestoreOption === "both" || selectedRestoreOption === "code");
631
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
632
+ flexDirection: "column",
633
+ children: [
634
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
635
+ dimColor: true,
636
+ children: getRestoreOptionConversationText(selectedRestoreOption)
637
+ }, undefined, false, undefined, this),
638
+ !isSummarizeOption(selectedRestoreOption) && (showCodeRestore ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreCodeConfirmation, {
639
+ diffStatsForRestore
640
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
641
+ dimColor: true,
642
+ children: "The code will be unchanged."
643
+ }, undefined, false, undefined, this))
644
+ ]
645
+ }, undefined, true, undefined, this);
646
+ }
647
+ function RestoreCodeConfirmation({
648
+ diffStatsForRestore
649
+ }) {
650
+ if (diffStatsForRestore === undefined) {
651
+ return;
652
+ }
653
+ if (!diffStatsForRestore.filesChanged || !diffStatsForRestore.filesChanged[0]) {
654
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
655
+ dimColor: true,
656
+ children: "The code has not changed (nothing will be restored)."
657
+ }, undefined, false, undefined, this);
658
+ }
659
+ const numFilesChanged = diffStatsForRestore.filesChanged.length;
660
+ let fileLabel = "";
661
+ if (numFilesChanged === 1) {
662
+ fileLabel = path.basename(diffStatsForRestore.filesChanged[0] || "");
663
+ } else if (numFilesChanged === 2) {
664
+ const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
665
+ const file2 = path.basename(diffStatsForRestore.filesChanged[1] || "");
666
+ fileLabel = `${file1} and ${file2}`;
667
+ } else {
668
+ const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
669
+ fileLabel = `${file1} and ${diffStatsForRestore.filesChanged.length - 1} other files`;
670
+ }
671
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
672
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
673
+ dimColor: true,
674
+ children: [
675
+ "The code will be restored",
676
+ " ",
677
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
678
+ diffStats: diffStatsForRestore
679
+ }, undefined, false, undefined, this),
680
+ " in ",
681
+ fileLabel,
682
+ "."
683
+ ]
684
+ }, undefined, true, undefined, this)
685
+ }, undefined, false, undefined, this);
686
+ }
687
+ function DiffStatsText({
688
+ diffStats
689
+ }) {
690
+ if (!diffStats || !diffStats.filesChanged) {
691
+ return;
692
+ }
693
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
694
+ children: [
695
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
696
+ color: "diffAddedWord",
697
+ children: [
698
+ "+",
699
+ diffStats.insertions,
700
+ " "
701
+ ]
702
+ }, undefined, true, undefined, this),
703
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
704
+ color: "diffRemovedWord",
705
+ children: [
706
+ "-",
707
+ diffStats.deletions
708
+ ]
709
+ }, undefined, true, undefined, this)
710
+ ]
711
+ }, undefined, true, undefined, this);
712
+ }
713
+ function UserMessageOption({
714
+ userMessage,
715
+ color,
716
+ dimColor,
717
+ isCurrent,
718
+ paddingRight
719
+ }) {
720
+ const { columns } = useTerminalSize();
721
+ if (isCurrent) {
722
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
723
+ width: "100%",
724
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
725
+ italic: true,
726
+ color,
727
+ dimColor,
728
+ children: "(current)"
729
+ }, undefined, false, undefined, this)
730
+ }, undefined, false, undefined, this);
731
+ }
732
+ const content = userMessage.message.content;
733
+ const lastBlock = typeof content === "string" ? null : content[content.length - 1];
734
+ const rawMessageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "(no prompt)";
735
+ const messageText = stripDisplayTags(rawMessageText);
736
+ if (isEmptyMessageText(messageText)) {
737
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
738
+ flexDirection: "row",
739
+ width: "100%",
740
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
741
+ italic: true,
742
+ color,
743
+ dimColor,
744
+ children: "((empty message))"
745
+ }, undefined, false, undefined, this)
746
+ }, undefined, false, undefined, this);
747
+ }
748
+ if (messageText.includes("<bash-input>")) {
749
+ const input = extractTag(messageText, "bash-input");
750
+ if (input) {
751
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
752
+ flexDirection: "row",
753
+ width: "100%",
754
+ children: [
755
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
756
+ color: "bashBorder",
757
+ children: "!"
758
+ }, undefined, false, undefined, this),
759
+ /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
760
+ color,
761
+ dimColor,
762
+ children: [
763
+ " ",
764
+ input
765
+ ]
766
+ }, undefined, true, undefined, this)
767
+ ]
768
+ }, undefined, true, undefined, this);
769
+ }
770
+ }
771
+ if (messageText.includes(`<${COMMAND_MESSAGE_TAG}>`)) {
772
+ const commandMessage = extractTag(messageText, COMMAND_MESSAGE_TAG);
773
+ const args = extractTag(messageText, "command-args");
774
+ const isSkillFormat = extractTag(messageText, "skill-format") === "true";
775
+ if (commandMessage) {
776
+ if (isSkillFormat) {
777
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
778
+ flexDirection: "row",
779
+ width: "100%",
780
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
781
+ color,
782
+ dimColor,
783
+ children: [
784
+ "Skill(",
785
+ commandMessage,
786
+ ")"
787
+ ]
788
+ }, undefined, true, undefined, this)
789
+ }, undefined, false, undefined, this);
790
+ } else {
791
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
792
+ flexDirection: "row",
793
+ width: "100%",
794
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
795
+ color,
796
+ dimColor,
797
+ children: [
798
+ "/",
799
+ commandMessage,
800
+ " ",
801
+ args
802
+ ]
803
+ }, undefined, true, undefined, this)
804
+ }, undefined, false, undefined, this);
805
+ }
806
+ }
807
+ }
808
+ return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
809
+ flexDirection: "row",
810
+ width: "100%",
811
+ children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
812
+ color,
813
+ dimColor,
814
+ children: paddingRight ? truncate(messageText, columns - paddingRight, true) : messageText.slice(0, 500).split(`
815
+ `).slice(0, 4).join(`
816
+ `)
817
+ }, undefined, false, undefined, this)
818
+ }, undefined, false, undefined, this);
819
+ }
820
+ function computeDiffStatsBetweenMessages(messages, fromMessageId, toMessageId) {
821
+ const startIndex = messages.findIndex((msg) => msg.uuid === fromMessageId);
822
+ if (startIndex === -1) {
823
+ return;
824
+ }
825
+ let endIndex = toMessageId ? messages.findIndex((msg) => msg.uuid === toMessageId) : messages.length;
826
+ if (endIndex === -1) {
827
+ endIndex = messages.length;
828
+ }
829
+ const filesChanged = [];
830
+ let insertions = 0;
831
+ let deletions = 0;
832
+ for (let i = startIndex + 1;i < endIndex; i++) {
833
+ const msg = messages[i];
834
+ if (!msg || !isToolUseResultMessage(msg)) {
835
+ continue;
836
+ }
837
+ const result = msg.toolUseResult;
838
+ if (!result || !result.filePath || !result.structuredPatch) {
839
+ continue;
840
+ }
841
+ if (!filesChanged.includes(result.filePath)) {
842
+ filesChanged.push(result.filePath);
843
+ }
844
+ try {
845
+ if ("type" in result && result.type === "create") {
846
+ insertions += result.content.split(/\r?\n/).length;
847
+ } else {
848
+ for (const hunk of result.structuredPatch) {
849
+ const additions = count(hunk.lines, (line) => line.startsWith("+"));
850
+ const removals = count(hunk.lines, (line) => line.startsWith("-"));
851
+ insertions += additions;
852
+ deletions += removals;
853
+ }
854
+ }
855
+ } catch {
856
+ continue;
857
+ }
858
+ }
859
+ return {
860
+ filesChanged,
861
+ insertions,
862
+ deletions
863
+ };
864
+ }
865
+ function selectableUserMessagesFilter(message) {
866
+ if (message.type !== "user") {
867
+ return false;
868
+ }
869
+ if (Array.isArray(message.message.content) && message.message.content[0]?.type === "tool_result") {
870
+ return false;
871
+ }
872
+ if (isSyntheticMessage(message)) {
873
+ return false;
874
+ }
875
+ if (message.isMeta) {
876
+ return false;
877
+ }
878
+ if (message.isCompactSummary || message.isVisibleInTranscriptOnly) {
879
+ return false;
880
+ }
881
+ const content = message.message.content;
882
+ const lastBlock = typeof content === "string" ? null : content[content.length - 1];
883
+ const messageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "";
884
+ if (messageText.indexOf(`<${LOCAL_COMMAND_STDOUT_TAG}>`) !== -1 || messageText.indexOf(`<${LOCAL_COMMAND_STDERR_TAG}>`) !== -1 || messageText.indexOf(`<${BASH_STDOUT_TAG}>`) !== -1 || messageText.indexOf(`<${BASH_STDERR_TAG}>`) !== -1 || messageText.indexOf(`<${TASK_NOTIFICATION_TAG}>`) !== -1 || messageText.indexOf(`<${TICK_TAG}>`) !== -1 || messageText.indexOf(`<${TEAMMATE_MESSAGE_TAG}`) !== -1) {
885
+ return false;
886
+ }
887
+ return true;
888
+ }
889
+ function messagesAfterAreOnlySynthetic(messages, fromIndex) {
890
+ for (let i = fromIndex + 1;i < messages.length; i++) {
891
+ const msg = messages[i];
892
+ if (!msg)
893
+ continue;
894
+ if (isSyntheticMessage(msg))
895
+ continue;
896
+ if (isToolUseResultMessage(msg))
897
+ continue;
898
+ if (msg.type === "progress")
899
+ continue;
900
+ if (msg.type === "system")
901
+ continue;
902
+ if (msg.type === "attachment")
903
+ continue;
904
+ if (msg.type === "user" && msg.isMeta)
905
+ continue;
906
+ if (msg.type === "assistant") {
907
+ const content = msg.message.content;
908
+ if (Array.isArray(content)) {
909
+ const hasMeaningfulContent = content.some((block) => block.type === "text" && block.text.trim() || block.type === "tool_use");
910
+ if (hasMeaningfulContent)
911
+ return false;
912
+ }
913
+ continue;
914
+ }
915
+ if (msg.type === "user") {
916
+ return false;
917
+ }
918
+ }
919
+ return true;
920
+ }
921
+ var import_react, jsx_dev_runtime, MAX_VISIBLE_MESSAGES = 7;
922
+ var init_MessageSelector = __esm(() => {
923
+ init_figures();
924
+ init_analytics();
925
+ init_AppState();
926
+ init_fileHistory();
927
+ init_log();
928
+ init_useExitOnCtrlCDWithKeybindings();
929
+ init_src();
930
+ init_useKeybinding();
931
+ init_displayTags();
932
+ init_messages();
933
+ init_select();
934
+ init_Spinner();
935
+ init_useTerminalSize();
936
+ init_xml();
937
+ init_array();
938
+ init_format();
939
+ import_react = __toESM(require_react(), 1);
940
+ jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
941
+ });
942
+
943
+ // src/utils/ultraplan/keyword.ts
944
+ var OPEN_TO_CLOSE = {
945
+ "`": "`",
946
+ '"': '"',
947
+ "<": ">",
948
+ "{": "}",
949
+ "[": "]",
950
+ "(": ")",
951
+ "'": "'"
952
+ };
953
+ function findKeywordTriggerPositions(text, keyword) {
954
+ const re = new RegExp(keyword, "i");
955
+ if (!re.test(text))
956
+ return [];
957
+ if (text.startsWith("/"))
958
+ return [];
959
+ const quotedRanges = [];
960
+ let openQuote = null;
961
+ let openAt = 0;
962
+ const isWord = (ch) => !!ch && /[\p{L}\p{N}_]/u.test(ch);
963
+ for (let i = 0;i < text.length; i++) {
964
+ const ch = text[i];
965
+ if (openQuote) {
966
+ if (openQuote === "[" && ch === "[") {
967
+ openAt = i;
968
+ continue;
969
+ }
970
+ if (ch !== OPEN_TO_CLOSE[openQuote])
971
+ continue;
972
+ if (openQuote === "'" && isWord(text[i + 1]))
973
+ continue;
974
+ quotedRanges.push({ start: openAt, end: i + 1 });
975
+ openQuote = null;
976
+ } else if (ch === "<" && i + 1 < text.length && /[a-zA-Z/]/.test(text[i + 1]) || ch === "'" && !isWord(text[i - 1]) || ch !== "<" && ch !== "'" && ch in OPEN_TO_CLOSE) {
977
+ openQuote = ch;
978
+ openAt = i;
979
+ }
980
+ }
981
+ const positions = [];
982
+ const wordRe = new RegExp(`\\b${keyword}\\b`, "gi");
983
+ const matches = text.matchAll(wordRe);
984
+ for (const match of matches) {
985
+ if (match.index === undefined)
986
+ continue;
987
+ const start = match.index;
988
+ const end = start + match[0].length;
989
+ if (quotedRanges.some((r) => start >= r.start && start < r.end))
990
+ continue;
991
+ const before = text[start - 1];
992
+ const after = text[end];
993
+ if (before === "/" || before === "\\" || before === "-")
994
+ continue;
995
+ if (after === "/" || after === "\\" || after === "-" || after === "?")
996
+ continue;
997
+ if (after === "." && isWord(text[end + 1]))
998
+ continue;
999
+ positions.push({ word: match[0], start, end });
1000
+ }
1001
+ return positions;
1002
+ }
1003
+ function findUltraplanTriggerPositions(text) {
1004
+ return findKeywordTriggerPositions(text, "ultraplan");
1005
+ }
1006
+ function findUltrareviewTriggerPositions(text) {
1007
+ return findKeywordTriggerPositions(text, "ultrareview");
1008
+ }
1009
+ function hasUltraplanKeyword(text) {
1010
+ return findUltraplanTriggerPositions(text).length > 0;
1011
+ }
1012
+ function replaceUltraplanKeyword(text) {
1013
+ const [trigger] = findUltraplanTriggerPositions(text);
1014
+ if (!trigger)
1015
+ return text;
1016
+ const before = text.slice(0, trigger.start);
1017
+ const after = text.slice(trigger.end);
1018
+ if (!(before + after).trim())
1019
+ return "";
1020
+ return before + trigger.word.slice("ultra".length) + after;
1021
+ }
1022
+
1023
+ // src/utils/processUserInput/processUserInput.ts
1024
+ init_analytics();
1025
+ init_messages();
1026
+ init_commands();
1027
+ init_textInputTypes();
1028
+ init_attachments();
1029
+ init_generators();
1030
+ init_hooks();
1031
+ init_imageResizer();
1032
+ init_imageStore();
1033
+ init_messages();
1034
+ init_queryProfiler();
1035
+ init_slashCommandParsing();
1036
+ import { randomUUID as randomUUID3 } from "crypto";
1037
+
1038
+ // src/utils/processUserInput/processTextPrompt.ts
1039
+ init_state();
1040
+ init_analytics();
1041
+ init_messages();
1042
+ init_events();
1043
+ init_sessionTracing();
1044
+ import { randomUUID as randomUUID2 } from "crypto";
1045
+
1046
+ // src/utils/userPromptKeywords.ts
1047
+ function matchesNegativeKeyword(input) {
1048
+ const lowerInput = input.toLowerCase();
1049
+ const negativePattern = /\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/;
1050
+ return negativePattern.test(lowerInput);
1051
+ }
1052
+ function matchesKeepGoingKeyword(input) {
1053
+ const lowerInput = input.toLowerCase().trim();
1054
+ if (lowerInput === "continue") {
1055
+ return true;
1056
+ }
1057
+ const keepGoingPattern = /\b(keep going|go on)\b/;
1058
+ return keepGoingPattern.test(lowerInput);
1059
+ }
1060
+
1061
+ // src/utils/processUserInput/processTextPrompt.ts
1062
+ function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta) {
1063
+ const promptId = randomUUID2();
1064
+ setPromptId(promptId);
1065
+ const userPromptText = typeof input === "string" ? input : input.find((block) => block.type === "text")?.text || "";
1066
+ startInteractionSpan(userPromptText);
1067
+ const otelPromptText = typeof input === "string" ? input : input.findLast((block) => block.type === "text")?.text || "";
1068
+ if (otelPromptText) {
1069
+ logOTelEvent("user_prompt", {
1070
+ prompt_length: String(otelPromptText.length),
1071
+ prompt: redactIfDisabled(otelPromptText),
1072
+ "prompt.id": promptId
1073
+ });
1074
+ }
1075
+ const isNegative = matchesNegativeKeyword(userPromptText);
1076
+ const isKeepGoing = matchesKeepGoingKeyword(userPromptText);
1077
+ logEvent("tengu_input_prompt", {
1078
+ is_negative: isNegative,
1079
+ is_keep_going: isKeepGoing
1080
+ });
1081
+ if (imageContentBlocks.length > 0) {
1082
+ const textContent = typeof input === "string" ? input.trim() ? [{ type: "text", text: input }] : [] : input;
1083
+ const userMessage2 = createUserMessage({
1084
+ content: [...textContent, ...imageContentBlocks],
1085
+ uuid,
1086
+ imagePasteIds: imagePasteIds.length > 0 ? imagePasteIds : undefined,
1087
+ permissionMode,
1088
+ isMeta: isMeta || undefined
1089
+ });
1090
+ return {
1091
+ messages: [userMessage2, ...attachmentMessages],
1092
+ shouldQuery: true
1093
+ };
1094
+ }
1095
+ const userMessage = createUserMessage({
1096
+ content: input,
1097
+ uuid,
1098
+ permissionMode,
1099
+ isMeta: isMeta || undefined
1100
+ });
1101
+ return {
1102
+ messages: [userMessage, ...attachmentMessages],
1103
+ shouldQuery: true
1104
+ };
1105
+ }
1106
+
1107
+ // src/utils/processUserInput/processUserInput.ts
1108
+ async function processUserInput({
1109
+ input,
1110
+ preExpansionInput,
1111
+ mode,
1112
+ setToolJSX,
1113
+ context,
1114
+ pastedContents,
1115
+ ideSelection,
1116
+ messages,
1117
+ setUserInputOnProcessing,
1118
+ uuid,
1119
+ isAlreadyProcessing,
1120
+ querySource,
1121
+ canUseTool,
1122
+ skipSlashCommands,
1123
+ bridgeOrigin,
1124
+ isMeta,
1125
+ skipAttachments
1126
+ }) {
1127
+ const inputString = typeof input === "string" ? input : null;
1128
+ if (mode === "prompt" && inputString !== null && !isMeta) {
1129
+ setUserInputOnProcessing?.(inputString);
1130
+ }
1131
+ queryCheckpoint("query_process_user_input_base_start");
1132
+ const appState = context.getAppState();
1133
+ const result = await processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput);
1134
+ queryCheckpoint("query_process_user_input_base_end");
1135
+ if (!result.shouldQuery) {
1136
+ return result;
1137
+ }
1138
+ queryCheckpoint("query_hooks_start");
1139
+ const inputMessage = getContentText(input) || "";
1140
+ for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode, context, context.requestPrompt)) {
1141
+ if (hookResult.message?.type === "progress") {
1142
+ continue;
1143
+ }
1144
+ if (hookResult.blockingError) {
1145
+ const blockingMessage = getUserPromptSubmitHookBlockingMessage(hookResult.blockingError);
1146
+ return {
1147
+ messages: [
1148
+ createSystemMessage(`${blockingMessage}
1149
+
1150
+ Original prompt: ${input}`, "warning")
1151
+ ],
1152
+ shouldQuery: false,
1153
+ allowedTools: result.allowedTools
1154
+ };
1155
+ }
1156
+ if (hookResult.preventContinuation) {
1157
+ const message = hookResult.stopReason ? `Operation stopped by hook: ${hookResult.stopReason}` : "Operation stopped by hook";
1158
+ result.messages.push(createUserMessage({
1159
+ content: message
1160
+ }));
1161
+ result.shouldQuery = false;
1162
+ return result;
1163
+ }
1164
+ if (hookResult.additionalContexts && hookResult.additionalContexts.length > 0) {
1165
+ result.messages.push(createAttachmentMessage({
1166
+ type: "hook_additional_context",
1167
+ content: hookResult.additionalContexts.map(applyTruncation),
1168
+ hookName: "UserPromptSubmit",
1169
+ toolUseID: `hook-${randomUUID3()}`,
1170
+ hookEvent: "UserPromptSubmit"
1171
+ }));
1172
+ }
1173
+ if (hookResult.message) {
1174
+ switch (hookResult.message.attachment.type) {
1175
+ case "hook_success":
1176
+ if (!hookResult.message.attachment.content) {
1177
+ break;
1178
+ }
1179
+ result.messages.push({
1180
+ ...hookResult.message,
1181
+ attachment: {
1182
+ ...hookResult.message.attachment,
1183
+ content: applyTruncation(hookResult.message.attachment.content)
1184
+ }
1185
+ });
1186
+ break;
1187
+ default:
1188
+ result.messages.push(hookResult.message);
1189
+ break;
1190
+ }
1191
+ }
1192
+ }
1193
+ queryCheckpoint("query_hooks_end");
1194
+ return result;
1195
+ }
1196
+ var MAX_HOOK_OUTPUT_LENGTH = 1e4;
1197
+ function applyTruncation(content) {
1198
+ if (content.length > MAX_HOOK_OUTPUT_LENGTH) {
1199
+ return `${content.substring(0, MAX_HOOK_OUTPUT_LENGTH)}\u2026 [output truncated - exceeded ${MAX_HOOK_OUTPUT_LENGTH} characters]`;
1200
+ }
1201
+ return content;
1202
+ }
1203
+ async function processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput) {
1204
+ let inputString = null;
1205
+ let precedingInputBlocks = [];
1206
+ const imageMetadataTexts = [];
1207
+ let normalizedInput = input;
1208
+ if (typeof input === "string") {
1209
+ inputString = input;
1210
+ } else if (input.length > 0) {
1211
+ queryCheckpoint("query_image_processing_start");
1212
+ const processedBlocks = [];
1213
+ for (const block of input) {
1214
+ if (block.type === "image") {
1215
+ const resized = await maybeResizeAndDownsampleImageBlock(block);
1216
+ if (resized.dimensions) {
1217
+ const metadataText = createImageMetadataText(resized.dimensions);
1218
+ if (metadataText) {
1219
+ imageMetadataTexts.push(metadataText);
1220
+ }
1221
+ }
1222
+ processedBlocks.push(resized.block);
1223
+ } else {
1224
+ processedBlocks.push(block);
1225
+ }
1226
+ }
1227
+ normalizedInput = processedBlocks;
1228
+ queryCheckpoint("query_image_processing_end");
1229
+ const lastBlock = processedBlocks[processedBlocks.length - 1];
1230
+ if (lastBlock?.type === "text") {
1231
+ inputString = lastBlock.text;
1232
+ precedingInputBlocks = processedBlocks.slice(0, -1);
1233
+ } else {
1234
+ precedingInputBlocks = processedBlocks;
1235
+ }
1236
+ }
1237
+ if (inputString === null && mode !== "prompt") {
1238
+ throw new Error(`Mode: ${mode} requires a string input.`);
1239
+ }
1240
+ const imageContents = pastedContents ? Object.values(pastedContents).filter(isValidImagePaste) : [];
1241
+ const imagePasteIds = imageContents.map((img) => img.id);
1242
+ const storedImagePaths = pastedContents ? await storeImages(pastedContents) : new Map;
1243
+ queryCheckpoint("query_pasted_image_processing_start");
1244
+ const imageProcessingResults = await Promise.all(imageContents.map(async (pastedImage) => {
1245
+ const imageBlock = {
1246
+ type: "image",
1247
+ source: {
1248
+ type: "base64",
1249
+ media_type: pastedImage.mediaType || "image/png",
1250
+ data: pastedImage.content
1251
+ }
1252
+ };
1253
+ logEvent("tengu_pasted_image_resize_attempt", {
1254
+ original_size_bytes: pastedImage.content.length
1255
+ });
1256
+ const resized = await maybeResizeAndDownsampleImageBlock(imageBlock);
1257
+ return {
1258
+ resized,
1259
+ originalDimensions: pastedImage.dimensions,
1260
+ sourcePath: pastedImage.sourcePath ?? storedImagePaths.get(pastedImage.id)
1261
+ };
1262
+ }));
1263
+ const imageContentBlocks = [];
1264
+ for (const {
1265
+ resized,
1266
+ originalDimensions,
1267
+ sourcePath
1268
+ } of imageProcessingResults) {
1269
+ if (resized.dimensions) {
1270
+ const metadataText = createImageMetadataText(resized.dimensions, sourcePath);
1271
+ if (metadataText) {
1272
+ imageMetadataTexts.push(metadataText);
1273
+ }
1274
+ } else if (originalDimensions) {
1275
+ const metadataText = createImageMetadataText(originalDimensions, sourcePath);
1276
+ if (metadataText) {
1277
+ imageMetadataTexts.push(metadataText);
1278
+ }
1279
+ } else if (sourcePath) {
1280
+ imageMetadataTexts.push(`[Image source: ${sourcePath}]`);
1281
+ }
1282
+ imageContentBlocks.push(resized.block);
1283
+ }
1284
+ queryCheckpoint("query_pasted_image_processing_end");
1285
+ let effectiveSkipSlash = skipSlashCommands;
1286
+ if (bridgeOrigin && inputString !== null && inputString.startsWith("/")) {
1287
+ const parsed = parseSlashCommand(inputString);
1288
+ const cmd = parsed ? findCommand(parsed.commandName, context.options.commands) : undefined;
1289
+ if (cmd) {
1290
+ if (isBridgeSafeCommand(cmd)) {
1291
+ effectiveSkipSlash = false;
1292
+ } else {
1293
+ const msg = `/${getCommandName(cmd)} isn't available over Remote Control.`;
1294
+ return {
1295
+ messages: [
1296
+ createUserMessage({ content: inputString, uuid }),
1297
+ createCommandInputMessage(`<local-command-stdout>${msg}</local-command-stdout>`)
1298
+ ],
1299
+ shouldQuery: false,
1300
+ resultText: msg
1301
+ };
1302
+ }
1303
+ }
1304
+ }
1305
+ if (mode === "prompt" && !context.options.isNonInteractiveSession && inputString !== null && !effectiveSkipSlash && !inputString.startsWith("/") && !context.getAppState().ultraplanSessionUrl && !context.getAppState().ultraplanLaunching && hasUltraplanKeyword(preExpansionInput ?? inputString)) {
1306
+ logEvent("tengu_ultraplan_keyword", {});
1307
+ const rewritten = replaceUltraplanKeyword(inputString).trim();
1308
+ const { processSlashCommand } = await import("./chunk-crvsdcfv.js");
1309
+ const slashResult = await processSlashCommand(`/ultraplan ${rewritten}`, precedingInputBlocks, imageContentBlocks, [], context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
1310
+ return addImageMetadataMessage(slashResult, imageMetadataTexts);
1311
+ }
1312
+ const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/"));
1313
+ queryCheckpoint("query_attachment_loading_start");
1314
+ const attachmentMessages = shouldExtractAttachments ? await toArray(getAttachmentMessages(inputString, context, ideSelection ?? null, [], messages, querySource)) : [];
1315
+ queryCheckpoint("query_attachment_loading_end");
1316
+ if (inputString !== null && mode === "bash") {
1317
+ const { processBashCommand } = await import("./chunk-mg88phh5.js");
1318
+ return addImageMetadataMessage(await processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context, setToolJSX), imageMetadataTexts);
1319
+ }
1320
+ if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) {
1321
+ const { processSlashCommand } = await import("./chunk-crvsdcfv.js");
1322
+ const slashResult = await processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
1323
+ return addImageMetadataMessage(slashResult, imageMetadataTexts);
1324
+ }
1325
+ if (inputString !== null && mode === "prompt") {
1326
+ const trimmedInput = inputString.trim();
1327
+ const agentMention = attachmentMessages.find((m) => m.attachment.type === "agent_mention");
1328
+ if (agentMention) {
1329
+ const agentMentionString = `@agent-${agentMention.attachment.agentType}`;
1330
+ const isSubagentOnly = trimmedInput === agentMentionString;
1331
+ const isPrefix = trimmedInput.startsWith(agentMentionString) && !isSubagentOnly;
1332
+ logEvent("tengu_subagent_at_mention", {
1333
+ is_subagent_only: isSubagentOnly,
1334
+ is_prefix: isPrefix
1335
+ });
1336
+ }
1337
+ }
1338
+ return addImageMetadataMessage(processTextPrompt(normalizedInput, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta), imageMetadataTexts);
1339
+ }
1340
+ function addImageMetadataMessage(result, imageMetadataTexts) {
1341
+ if (imageMetadataTexts.length > 0) {
1342
+ result.messages.push(createUserMessage({
1343
+ content: imageMetadataTexts.map((text) => ({ type: "text", text })),
1344
+ isMeta: true
1345
+ }));
1346
+ }
1347
+ return result;
1348
+ }
1349
+
1350
+ // src/utils/messages/systemInit.ts
1351
+ init_state();
1352
+ init_outputStyles();
1353
+ init_constants();
1354
+ init_auth();
1355
+ init_cwd();
1356
+ init_fastMode();
1357
+ init_settings();
1358
+ import { randomUUID as randomUUID4 } from "crypto";
1359
+ function sdkCompatToolName(name) {
1360
+ return name === AGENT_TOOL_NAME ? LEGACY_AGENT_TOOL_NAME : name;
1361
+ }
1362
+ function buildSystemInitMessage(inputs) {
1363
+ const settings = getSettings_DEPRECATED();
1364
+ const outputStyle = settings?.outputStyle ?? DEFAULT_OUTPUT_STYLE_NAME;
1365
+ const initMessage = {
1366
+ type: "system",
1367
+ subtype: "init",
1368
+ cwd: getCwd(),
1369
+ session_id: getSessionId(),
1370
+ tools: inputs.tools.map((tool) => sdkCompatToolName(tool.name)),
1371
+ mcp_servers: inputs.mcpClients.map((client) => ({
1372
+ name: client.name,
1373
+ status: client.type
1374
+ })),
1375
+ model: inputs.model,
1376
+ permissionMode: inputs.permissionMode,
1377
+ slash_commands: inputs.commands.filter((c) => c.userInvocable !== false).map((c) => c.name),
1378
+ apiKeySource: getAnthropicApiKeyWithSource().source,
1379
+ betas: getSdkBetas(),
1380
+ claude_code_version: "2.1.888",
1381
+ output_style: outputStyle,
1382
+ agents: inputs.agents.map((agent) => agent.agentType),
1383
+ skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
1384
+ plugins: inputs.plugins.map((plugin) => ({
1385
+ name: plugin.name,
1386
+ path: plugin.path,
1387
+ source: plugin.source
1388
+ })),
1389
+ uuid: randomUUID4()
1390
+ };
1391
+ if (false) {}
1392
+ initMessage.fast_mode_state = getFastModeState(inputs.model, inputs.fastMode);
1393
+ return initMessage;
1394
+ }
1395
+
1396
+ export { findUltraplanTriggerPositions, findUltrareviewTriggerPositions, processUserInput, sdkCompatToolName, buildSystemInitMessage, MessageSelector, selectableUserMessagesFilter, messagesAfterAreOnlySynthetic, exports_MessageSelector, init_MessageSelector };