claude-code-best 1.3.7 → 1.4.1

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 (378) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-cdgv0k77.js → chunk-00vfg42v.js} +61 -59
  3. package/dist/{chunk-6ex0f5ej.js → chunk-01ysfcs0.js} +6 -8
  4. package/dist/{chunk-1vzb650a.js → chunk-04ws37gv.js} +6 -8
  5. package/dist/{chunk-7etmzq13.js → chunk-0b0fq180.js} +27 -27
  6. package/dist/{chunk-drsh1vv8.js → chunk-0cs46nj6.js} +63 -62
  7. package/dist/chunk-0fzcyd0s.js +116 -0
  8. package/dist/{chunk-7nebst32.js → chunk-0knhp7v5.js} +2 -2
  9. package/dist/{chunk-n42nvr59.js → chunk-0xth516w.js} +14 -14
  10. package/dist/{chunk-egcx83tp.js → chunk-0y6h57c5.js} +6 -6
  11. package/dist/{chunk-d267stxj.js → chunk-0z0m6mm5.js} +1 -1
  12. package/dist/{chunk-y10byvag.js → chunk-196qs1ty.js} +30 -29
  13. package/dist/chunk-1d39h7zf.js +57 -0
  14. package/dist/{chunk-antr836n.js → chunk-1k3ahc24.js} +59 -57
  15. package/dist/{chunk-5scrgrwv.js → chunk-1nhx3qpn.js} +2 -2
  16. package/dist/{chunk-zv5yt0g4.js → chunk-1qbype3e.js} +9 -9
  17. package/dist/{chunk-bkzs71af.js → chunk-1r70yykn.js} +3 -3
  18. package/dist/{chunk-tvnrwrg3.js → chunk-1x1wb96n.js} +62 -60
  19. package/dist/{chunk-j44ngncb.js → chunk-1yscv3t1.js} +7 -9
  20. package/dist/{chunk-zhe3rws3.js → chunk-27ppq985.js} +7 -9
  21. package/dist/{chunk-kbshq7zc.js → chunk-28a1ffp7.js} +59 -56
  22. package/dist/{chunk-m95fj0wm.js → chunk-2ag1bjqx.js} +4 -4
  23. package/dist/{chunk-2fx2x8qp.js → chunk-2cz1rwf3.js} +22 -21
  24. package/dist/{chunk-v1chtgnf.js → chunk-2m6jk78c.js} +1 -1
  25. package/dist/{chunk-nzchm0f2.js → chunk-2mhgyhns.js} +1 -1
  26. package/dist/{chunk-n5pe3jtt.js → chunk-2pjptqfa.js} +2 -2
  27. package/dist/{chunk-5r3wgr44.js → chunk-2qfb22ax.js} +29 -1399
  28. package/dist/{chunk-n0rn505k.js → chunk-2rcaw0yh.js} +4 -4
  29. package/dist/{chunk-wp9nwczx.js → chunk-2rtngpm1.js} +8 -10
  30. package/dist/{chunk-s2cwz71x.js → chunk-2tzmvvew.js} +60 -57
  31. package/dist/{chunk-ydraa9ey.js → chunk-2xrp0wp0.js} +70 -68
  32. package/dist/{chunk-jty4xkhc.js → chunk-313nbvgt.js} +5 -5
  33. package/dist/chunk-3e2a6c4k.js +33 -0
  34. package/dist/{chunk-hbf3y5tw.js → chunk-3fnhdnj6.js} +22 -21
  35. package/dist/{chunk-qahkzpj6.js → chunk-3g6kvmg4.js} +6 -8
  36. package/dist/{chunk-kz13d2bs.js → chunk-3mapywg0.js} +2 -2
  37. package/dist/{chunk-tw4tjc73.js → chunk-3rk983b5.js} +1 -1
  38. package/dist/chunk-3vc6mx77.js +119 -0
  39. package/dist/{chunk-nsxw7en4.js → chunk-3yzyedet.js} +23 -22
  40. package/dist/{chunk-1q82ecz5.js → chunk-40w1c21c.js} +58 -55
  41. package/dist/{chunk-bnvd1jc1.js → chunk-4brmjvph.js} +4 -4
  42. package/dist/{chunk-zwrt0s3s.js → chunk-4er46edn.js} +69 -141
  43. package/dist/{chunk-fsex4yt2.js → chunk-4h9ek408.js} +7 -9
  44. package/dist/chunk-4mdqm8b7.js +115 -0
  45. package/dist/{chunk-9p95042q.js → chunk-4qjh89qr.js} +1 -1
  46. package/dist/chunk-506gq3zq.js +104 -0
  47. package/dist/{chunk-w6rh4zpx.js → chunk-5158j5ph.js} +8 -10
  48. package/dist/{chunk-d969b8ne.js → chunk-524xgs6r.js} +7 -7
  49. package/dist/{chunk-76hrbqgr.js → chunk-52rnpp5t.js} +16 -18
  50. package/dist/{chunk-0a2qnsbr.js → chunk-54bwa086.js} +61 -57
  51. package/dist/{chunk-qn4cbm38.js → chunk-5famfv4a.js} +23 -22
  52. package/dist/{chunk-kmgp6prw.js → chunk-5khwvj1z.js} +112 -5
  53. package/dist/{chunk-9byk2a4b.js → chunk-5m7095hq.js} +25 -25
  54. package/dist/{chunk-g14ex9z0.js → chunk-5mv51kkx.js} +59 -56
  55. package/dist/{chunk-p2sww3pd.js → chunk-5vqwq0f9.js} +59 -56
  56. package/dist/{chunk-s26mv9yh.js → chunk-5zbp0a48.js} +7 -8
  57. package/dist/{chunk-pvtzf6vs.js → chunk-60xm3v9r.js} +3 -3
  58. package/dist/chunk-6356tyx5.js +32 -0
  59. package/dist/{chunk-1vzaw5f6.js → chunk-66s9m31j.js} +23 -22
  60. package/dist/{chunk-c1cm8km0.js → chunk-6ebb5ym0.js} +58 -55
  61. package/dist/{chunk-yp2yx0qj.js → chunk-6f0296p8.js} +5 -7
  62. package/dist/{chunk-m2cskgz4.js → chunk-6gftrxn5.js} +86 -81
  63. package/dist/{chunk-y95se10r.js → chunk-6h1reb8m.js} +22 -21
  64. package/dist/{chunk-fy6tp8zj.js → chunk-6pb9n4m3.js} +2 -2
  65. package/dist/{chunk-ardzdtan.js → chunk-6y2wszkc.js} +1 -1
  66. package/dist/{chunk-4ydmya8m.js → chunk-6y8e5c85.js} +24 -22
  67. package/dist/{chunk-rshk7m9c.js → chunk-718k4vsj.js} +62 -60
  68. package/dist/{chunk-tm4w23dp.js → chunk-72091jsk.js} +1 -1
  69. package/dist/{chunk-xtaw765g.js → chunk-760hjt0a.js} +3 -3
  70. package/dist/chunk-77dnrj5q.js +119 -0
  71. package/dist/{chunk-gz4r3k7a.js → chunk-77w9ffyy.js} +5 -5
  72. package/dist/{chunk-xaw4scep.js → chunk-78009jh9.js} +2 -2
  73. package/dist/{chunk-6xr5mayh.js → chunk-79vh2q13.js} +58 -55
  74. package/dist/{chunk-p7d5ms03.js → chunk-7ba2qns8.js} +22 -21
  75. package/dist/{chunk-6wrs3ahh.js → chunk-7dy65axk.js} +22 -21
  76. package/dist/{chunk-n35gnb9g.js → chunk-7hmy36fh.js} +121 -2
  77. package/dist/{chunk-erxndz83.js → chunk-7kfps7yt.js} +7 -9
  78. package/dist/chunk-7r3d9nyj.js +113 -0
  79. package/dist/{chunk-dne2ghq6.js → chunk-7yfxza07.js} +16 -22
  80. package/dist/chunk-7zw138yt.js +32 -0
  81. package/dist/{chunk-6ye6d9gw.js → chunk-81dxa3fd.js} +1 -1
  82. package/dist/{chunk-540608wh.js → chunk-86jhenxk.js} +66 -57
  83. package/dist/chunk-88mfsn97.js +115 -0
  84. package/dist/{chunk-zy4fsy90.js → chunk-8gs07wbw.js} +18 -18
  85. package/dist/{chunk-4ayhftnk.js → chunk-8h4gpg9r.js} +83 -119
  86. package/dist/{chunk-brnc96x6.js → chunk-8h7bg6q9.js} +203 -24
  87. package/dist/chunk-8mspr5sg.js +47 -0
  88. package/dist/{chunk-62dx37pf.js → chunk-8pskaz4y.js} +9 -11
  89. package/dist/{chunk-sn3wbs2w.js → chunk-8xbwczap.js} +58 -55
  90. package/dist/{chunk-tw2wjsnb.js → chunk-8xsjtkh4.js} +4 -4
  91. package/dist/{chunk-ky85ntn8.js → chunk-8y0ghcs4.js} +69 -66
  92. package/dist/chunk-8zzqydag.js +101 -0
  93. package/dist/{chunk-cpvn0j86.js → chunk-924n94wb.js} +22 -21
  94. package/dist/{chunk-0asd58w2.js → chunk-92p2k7yk.js} +11 -11
  95. package/dist/{chunk-qvywetwr.js → chunk-93cd0z7w.js} +66 -64
  96. package/dist/{chunk-db82mfh9.js → chunk-97svwq59.js} +73 -71
  97. package/dist/{chunk-3j857x3k.js → chunk-99cjjht1.js} +60 -58
  98. package/dist/{chunk-pedmqmrf.js → chunk-9awawyvh.js} +6 -6
  99. package/dist/{chunk-22rs73mh.js → chunk-9b6wqcyk.js} +60 -57
  100. package/dist/{chunk-cxf74p1t.js → chunk-9datyj43.js} +2 -2
  101. package/dist/{chunk-n1pa72ns.js → chunk-9qh5f9r3.js} +7 -12
  102. package/dist/{chunk-vb6w46m9.js → chunk-9revwk5g.js} +59 -56
  103. package/dist/{chunk-g71q1n7x.js → chunk-a0m994d6.js} +58 -55
  104. package/dist/{chunk-ftajx4gw.js → chunk-a0qhdfct.js} +49 -160
  105. package/dist/{chunk-0xq2bfvv.js → chunk-a5w8nyhg.js} +2 -2
  106. package/dist/{chunk-ms9225af.js → chunk-a85wqwq4.js} +58 -55
  107. package/dist/{chunk-3c81vb6k.js → chunk-a92eevfn.js} +6 -8
  108. package/dist/{chunk-2katyzq9.js → chunk-ab6gc90x.js} +3 -5
  109. package/dist/{chunk-j50zvssc.js → chunk-ad6rg8vz.js} +5 -5
  110. package/dist/{chunk-z7svjppe.js → chunk-admwpsa6.js} +10 -14
  111. package/dist/{chunk-v081mpyx.js → chunk-ahexmj4s.js} +24 -26
  112. package/dist/{chunk-7z0078sp.js → chunk-att0rknb.js} +2 -2
  113. package/dist/{chunk-prgsmrmy.js → chunk-axenqvc8.js} +2 -2
  114. package/dist/{chunk-mfzgqp0c.js → chunk-azq1qstz.js} +10 -14
  115. package/dist/{chunk-zajs1j2b.js → chunk-b125aa22.js} +59 -57
  116. package/dist/{chunk-9f01qpne.js → chunk-b4wfv4fx.js} +73 -71
  117. package/dist/{chunk-ns3babbs.js → chunk-b5wxetbv.js} +224 -1
  118. package/dist/chunk-b62vj92a.js +94 -0
  119. package/dist/{chunk-9v5bwvbm.js → chunk-b6drr9se.js} +63 -61
  120. package/dist/chunk-b7kfr260.js +168 -0
  121. package/dist/chunk-b9pqgq8z.js +37 -0
  122. package/dist/{chunk-c8rgc3hw.js → chunk-bevwqet9.js} +66 -64
  123. package/dist/{chunk-m2rx2dtd.js → chunk-bgf5zvvv.js} +91 -89
  124. package/dist/{chunk-fye86v7m.js → chunk-bq8zdg7m.js} +58 -55
  125. package/dist/chunk-bww2h6d4.js +114 -0
  126. package/dist/{chunk-m83vaktc.js → chunk-bx165r58.js} +1 -1
  127. package/dist/{chunk-4q5a5mjb.js → chunk-c092k38b.js} +3532 -1684
  128. package/dist/{chunk-163379k5.js → chunk-c0avjkfn.js} +58 -55
  129. package/dist/{chunk-ermvk1xn.js → chunk-c3s22pgw.js} +61 -58
  130. package/dist/{chunk-zahg0adp.js → chunk-c4g5qaey.js} +5 -5
  131. package/dist/{chunk-f6wypwa6.js → chunk-c6nthjxa.js} +6 -4
  132. package/dist/{chunk-wmd0v561.js → chunk-c7d1acex.js} +5 -7
  133. package/dist/{chunk-wmbpegg3.js → chunk-c7t69jmn.js} +1 -1
  134. package/dist/{chunk-vm0b9vaz.js → chunk-cg3bb5pe.js} +9 -9
  135. package/dist/{chunk-m8v1x99r.js → chunk-chzfw06n.js} +3 -5
  136. package/dist/chunk-cm2xfg7q.js +1394 -0
  137. package/dist/{chunk-4yxd0e7k.js → chunk-crj9bjh5.js} +58 -55
  138. package/dist/{chunk-v4nrk2f9.js → chunk-cstkqpd5.js} +7 -8
  139. package/dist/{chunk-3nwsgn73.js → chunk-ctj2ehwz.js} +59 -56
  140. package/dist/{chunk-mcbqmbp2.js → chunk-cwwfyvbq.js} +6 -4
  141. package/dist/{chunk-9nddm5c7.js → chunk-cxf9amp4.js} +2 -3
  142. package/dist/chunk-cxmyg49v.js +104 -0
  143. package/dist/{chunk-5wb5ym2h.js → chunk-cy1z66c2.js} +3 -5
  144. package/dist/{chunk-nbzntnkz.js → chunk-d2q17m4k.js} +60 -58
  145. package/dist/{chunk-ymtkahxp.js → chunk-d2wzkwws.js} +69 -66
  146. package/dist/{chunk-x4t0n8t3.js → chunk-d4qdesrx.js} +3 -4
  147. package/dist/chunk-d4zyytan.js +3802 -0
  148. package/dist/{chunk-8q4yg5pk.js → chunk-d57t992t.js} +9 -96
  149. package/dist/{chunk-g2tmm7k7.js → chunk-dafnbqhh.js} +76 -74
  150. package/dist/{chunk-tjbjxrqz.js → chunk-dfcm57ek.js} +6 -6
  151. package/dist/{chunk-ynjbppdn.js → chunk-dgnwk906.js} +60 -58
  152. package/dist/{chunk-7gxyarah.js → chunk-dhwpmz98.js} +61 -58
  153. package/dist/{chunk-yevbmk5g.js → chunk-djzvjzdg.js} +3 -3
  154. package/dist/chunk-dm5e2sj0.js +187 -0
  155. package/dist/{chunk-145d3809.js → chunk-dnpy3zcs.js} +63 -60
  156. package/dist/{chunk-h7ffkxg4.js → chunk-drvfxfe5.js} +26 -25
  157. package/dist/{chunk-c14sp904.js → chunk-dv4dsh0t.js} +7 -7
  158. package/dist/{chunk-9ejadhq8.js → chunk-dyp88vca.js} +64 -62
  159. package/dist/{chunk-xfft38wf.js → chunk-dytg8n15.js} +12 -12
  160. package/dist/{chunk-j3ctqpsn.js → chunk-e1bt4m2g.js} +2 -2
  161. package/dist/{chunk-vvm5az9j.js → chunk-e23snepr.js} +3 -3
  162. package/dist/{chunk-hgfw7nx2.js → chunk-e6sqr0av.js} +58 -55
  163. package/dist/{chunk-v7xwthvg.js → chunk-e9eyqwk5.js} +405 -283
  164. package/dist/{chunk-2wvxqpfc.js → chunk-efkjha6m.js} +8 -9
  165. package/dist/{chunk-3s2gjp2n.js → chunk-ekpm458a.js} +67 -65
  166. package/dist/{chunk-vf3etxnx.js → chunk-emxnq07z.js} +1 -1
  167. package/dist/{chunk-c4x4fb6d.js → chunk-erkssp71.js} +58 -55
  168. package/dist/chunk-es08rrda.js +112 -0
  169. package/dist/{chunk-c209ascy.js → chunk-ewxpkqxt.js} +9 -9
  170. package/dist/{chunk-1wykga1n.js → chunk-f25pnrvx.js} +4 -6
  171. package/dist/chunk-f2y3t9hh.js +295 -0
  172. package/dist/{chunk-427mfnyx.js → chunk-f31b63fd.js} +1 -1
  173. package/dist/{chunk-2dsqf7sp.js → chunk-f57cvf1d.js} +1 -1
  174. package/dist/{chunk-ry1jb15g.js → chunk-f872fekv.js} +58 -55
  175. package/dist/{chunk-r7s0jwb1.js → chunk-faey4sqw.js} +59 -56
  176. package/dist/{chunk-40ax4h54.js → chunk-fbbjchdz.js} +60 -58
  177. package/dist/{chunk-fskf0b3x.js → chunk-fbedkst6.js} +6 -8
  178. package/dist/{chunk-9msn8xwq.js → chunk-fckykghd.js} +2 -3
  179. package/dist/{chunk-ztrgnar4.js → chunk-fdbvcs34.js} +7 -9
  180. package/dist/{chunk-667f3w39.js → chunk-ffpz33kr.js} +23 -22
  181. package/dist/{chunk-0fpkjw2j.js → chunk-ffvja87d.js} +8 -10
  182. package/dist/{chunk-r6gyed9y.js → chunk-fjpdtr6s.js} +9 -9
  183. package/dist/{chunk-8y1zs48n.js → chunk-fnpd8cnq.js} +1 -1
  184. package/dist/{chunk-eef1npre.js → chunk-fxpsa506.js} +4 -6
  185. package/dist/{chunk-2z6bv21c.js → chunk-fxrrsvnw.js} +23 -27
  186. package/dist/chunk-fz4wmnm6.js +157 -0
  187. package/dist/{chunk-2c4jgf3n.js → chunk-g3dbfhxa.js} +5 -7
  188. package/dist/{chunk-s13m8efn.js → chunk-g86dg6h5.js} +5 -5
  189. package/dist/{chunk-h7mpryyc.js → chunk-gc4x22mt.js} +59 -56
  190. package/dist/{chunk-5s1bctjb.js → chunk-gfxebcsw.js} +28 -28
  191. package/dist/chunk-ghbtnfr2.js +117 -0
  192. package/dist/{chunk-gpk30ekc.js → chunk-gqftywrx.js} +23 -22
  193. package/dist/{chunk-z2aps7d9.js → chunk-gwrngewt.js} +3 -3
  194. package/dist/{chunk-psp1n9vg.js → chunk-gxfbedta.js} +1 -1
  195. package/dist/{chunk-fq1j9zm0.js → chunk-gybj15eh.js} +2 -3
  196. package/dist/chunk-h0vzd5vg.js +1012 -0
  197. package/dist/{chunk-0ahxmrws.js → chunk-h14dkna4.js} +23 -22
  198. package/dist/{chunk-x42kc5wj.js → chunk-h26xfh6d.js} +22 -21
  199. package/dist/{chunk-nwgkkhk7.js → chunk-h2vfn30x.js} +4 -4
  200. package/dist/{chunk-mh8752jz.js → chunk-h37gar4j.js} +1 -1
  201. package/dist/{chunk-n612gr22.js → chunk-h4k9kgjw.js} +59 -56
  202. package/dist/{chunk-1av0kkwh.js → chunk-hc1tkwfn.js} +3 -5
  203. package/dist/{chunk-h5dk6k0g.js → chunk-hf086e2e.js} +58 -55
  204. package/dist/{chunk-66j7fn6z.js → chunk-hhwqk5as.js} +58 -55
  205. package/dist/{chunk-e8zmtbry.js → chunk-hjw03d0k.js} +60 -58
  206. package/dist/{chunk-e1t8jh0t.js → chunk-hkh1vbm6.js} +58 -55
  207. package/dist/{chunk-81dq52pk.js → chunk-hnxmafvc.js} +2 -2
  208. package/dist/{chunk-cj8m3h8r.js → chunk-hqpzpr71.js} +2 -2
  209. package/dist/{chunk-s3aygngf.js → chunk-hrz2d28r.js} +62 -60
  210. package/dist/chunk-hxb3js2g.js +91 -0
  211. package/dist/{chunk-j06y02aw.js → chunk-hxc8e6wd.js} +1 -1
  212. package/dist/chunk-hyy2fcba.js +351 -0
  213. package/dist/{chunk-dvf5921w.js → chunk-hyz9tx05.js} +15 -17
  214. package/dist/{chunk-ag3hbrat.js → chunk-j34h8cfj.js} +23 -22
  215. package/dist/{chunk-b31v41mz.js → chunk-j5w0b4d2.js} +23 -22
  216. package/dist/{chunk-2tcznfv0.js → chunk-j66ragf9.js} +1 -1
  217. package/dist/chunk-j7b884wk.js +397 -0
  218. package/dist/{chunk-35xyzbd2.js → chunk-ja21qbpj.js} +65 -62
  219. package/dist/{chunk-dchgtage.js → chunk-ja3eb4h9.js} +3 -3
  220. package/dist/{chunk-2crz81z3.js → chunk-jac470kz.js} +1 -1
  221. package/dist/{chunk-9nydmbm4.js → chunk-jaqtnpbt.js} +2 -2
  222. package/dist/{chunk-e03zrq9n.js → chunk-jc5dtv57.js} +60 -58
  223. package/dist/{chunk-jg7na104.js → chunk-jda4vjad.js} +58 -55
  224. package/dist/{chunk-drnxbc1w.js → chunk-jeqt4y47.js} +2 -2
  225. package/dist/{chunk-r7r3jm3y.js → chunk-jga4j8jp.js} +59 -57
  226. package/dist/{chunk-58rg6rn2.js → chunk-jge10dbd.js} +4 -6
  227. package/dist/{chunk-9k2c5sxb.js → chunk-jhbj5mnf.js} +58 -55
  228. package/dist/{chunk-zh6xf1fd.js → chunk-jje04m6z.js} +2 -2
  229. package/dist/{chunk-qkrenskm.js → chunk-jnfd01as.js} +9 -11
  230. package/dist/chunk-jpbkdg47.js +131 -0
  231. package/dist/{chunk-xcq3rdb0.js → chunk-jwb3bqa7.js} +27 -31
  232. package/dist/{chunk-s1p2w5a5.js → chunk-jy4dnnjk.js} +5 -5
  233. package/dist/{chunk-c9p5eyxf.js → chunk-k27dq4vd.js} +60 -57
  234. package/dist/{chunk-kmcaa88h.js → chunk-k81zec2p.js} +1 -1
  235. package/dist/{chunk-fxqp3yt4.js → chunk-kb2b4rkg.js} +4 -5
  236. package/dist/{chunk-h6dqpbac.js → chunk-kbsckx2r.js} +3 -3
  237. package/dist/{chunk-451hjtv9.js → chunk-kvezjrjy.js} +58 -55
  238. package/dist/{chunk-zc1s4swn.js → chunk-kw2ymvyv.js} +6 -8
  239. package/dist/{chunk-9jg130e9.js → chunk-kymh4vxw.js} +58 -55
  240. package/dist/{chunk-z66q1nam.js → chunk-kz3q1ce0.js} +58 -55
  241. package/dist/chunk-m089kb0s.js +312 -0
  242. package/dist/{chunk-86tz7yxt.js → chunk-m1efbjqe.js} +58 -55
  243. package/dist/chunk-m1xw79dd.js +1757 -0
  244. package/dist/{chunk-k303kw9v.js → chunk-m365zhp8.js} +59 -56
  245. package/dist/{chunk-0h4sw1v3.js → chunk-m97dyxn0.js} +61 -60
  246. package/dist/{chunk-e4jqbn4d.js → chunk-m9w972ny.js} +2 -4
  247. package/dist/{chunk-eserktyd.js → chunk-mb93ek5j.js} +4 -6
  248. package/dist/{chunk-c96k89rp.js → chunk-mgjc0yj9.js} +59 -57
  249. package/dist/{chunk-qmckdcc4.js → chunk-mh2pdxpc.js} +60 -58
  250. package/dist/{chunk-hnx0eg6x.js → chunk-mkae8zj9.js} +3 -3
  251. package/dist/{chunk-h0s737p0.js → chunk-mmq55gyp.js} +4 -4
  252. package/dist/{chunk-5k4kh5n9.js → chunk-ndrn50x0.js} +59 -57
  253. package/dist/{chunk-0pxmxyxv.js → chunk-ng2xq7ey.js} +3 -3
  254. package/dist/{chunk-gdb6dvba.js → chunk-nsbpzpmf.js} +61 -59
  255. package/dist/{chunk-18mm4jf8.js → chunk-nz7sgbbr.js} +5 -5
  256. package/dist/{chunk-t0b0bas5.js → chunk-nzfwsrd7.js} +3 -3
  257. package/dist/{chunk-rhxtttx1.js → chunk-p3zbzfbn.js} +3 -3
  258. package/dist/{chunk-9tc901nb.js → chunk-p5jssxha.js} +24 -24
  259. package/dist/{chunk-zmpygkz6.js → chunk-p7es39d1.js} +47 -122
  260. package/dist/{chunk-qwj4n799.js → chunk-p7pj6wf8.js} +1 -1
  261. package/dist/{chunk-855katq2.js → chunk-p9f12fp9.js} +60 -57
  262. package/dist/chunk-pb73zgyd.js +55 -0
  263. package/dist/chunk-prpjmapz.js +117 -0
  264. package/dist/{chunk-379rspd7.js → chunk-ps01q3n9.js} +64 -63
  265. package/dist/{chunk-ay9wm3tf.js → chunk-q19p9j0v.js} +5 -5
  266. package/dist/{chunk-536fmbtq.js → chunk-q7e12ymw.js} +4 -4
  267. package/dist/{chunk-w65283w4.js → chunk-qgajfxr7.js} +7 -7
  268. package/dist/{chunk-24qcj0k5.js → chunk-qgnsf30p.js} +24 -23
  269. package/dist/{chunk-xvjdbsfa.js → chunk-qs2atqgy.js} +60 -58
  270. package/dist/chunk-r469z4mx.js +183 -0
  271. package/dist/chunk-r5mqktt5.js +100 -0
  272. package/dist/chunk-r854e43q.js +25 -0
  273. package/dist/{chunk-fx6ghdvg.js → chunk-rbgr86hh.js} +59 -57
  274. package/dist/{chunk-qxv21mcq.js → chunk-rbvawtdz.js} +59 -56
  275. package/dist/chunk-rce8gj2b.js +93 -0
  276. package/dist/{chunk-t0twk3e5.js → chunk-rd2884ff.js} +1 -1
  277. package/dist/{chunk-c2ktjyc0.js → chunk-reqz49y3.js} +336 -1149
  278. package/dist/{chunk-b4twmt0s.js → chunk-rhjb0dgd.js} +24 -23
  279. package/dist/{chunk-bpmw0wp2.js → chunk-rq1nfp7x.js} +60 -58
  280. package/dist/{chunk-qhbchv06.js → chunk-rsr0mksm.js} +61 -59
  281. package/dist/{chunk-txeekahj.js → chunk-rz3rq0gt.js} +4 -6
  282. package/dist/{chunk-14mkqwft.js → chunk-rz69sqyh.js} +70 -68
  283. package/dist/{chunk-gfk81w5r.js → chunk-s2n5kxm0.js} +5 -5
  284. package/dist/{chunk-3b9ar57s.js → chunk-s39ksgef.js} +4 -6
  285. package/dist/{chunk-3er4wswe.js → chunk-s70z817q.js} +197 -196
  286. package/dist/{chunk-5h17d17z.js → chunk-se153zng.js} +1 -1
  287. package/dist/chunk-spqq5qf1.js +116 -0
  288. package/dist/{chunk-xjd32sva.js → chunk-srnstx2s.js} +23 -22
  289. package/dist/{chunk-s9nr589x.js → chunk-sv7afh51.js} +6 -8
  290. package/dist/{chunk-b6whrv9m.js → chunk-swzfr1f5.js} +24 -23
  291. package/dist/{chunk-2h06sph0.js → chunk-t2822cex.js} +63 -60
  292. package/dist/{chunk-h93tjx98.js → chunk-t2re5hhc.js} +125 -119
  293. package/dist/{chunk-r325sbz7.js → chunk-t7e9etws.js} +23 -25
  294. package/dist/{chunk-59mg8c5k.js → chunk-tnx1zk9t.js} +62 -59
  295. package/dist/{chunk-rgpxnjx4.js → chunk-tw24rz1x.js} +11 -13
  296. package/dist/{chunk-r8m19xnp.js → chunk-v038k0we.js} +4 -6
  297. package/dist/chunk-v2qqkqxp.js +116 -0
  298. package/dist/{chunk-fjne3x6c.js → chunk-v4qke3cz.js} +8 -8
  299. package/dist/{chunk-qwa5erw8.js → chunk-v6p3019x.js} +24 -23
  300. package/dist/{chunk-4stgesb0.js → chunk-vatz6gan.js} +25 -27
  301. package/dist/chunk-vfmx405p.js +14 -0
  302. package/dist/{chunk-x639j7py.js → chunk-vnn4x6jw.js} +62 -59
  303. package/dist/{chunk-b4btw5kv.js → chunk-vpe2s4eq.js} +7 -9
  304. package/dist/{chunk-2t5ve6ev.js → chunk-vsbyhpfy.js} +1 -1
  305. package/dist/{chunk-52evx0rm.js → chunk-w0pf4mvz.js} +12 -16
  306. package/dist/chunk-w5j0dhpp.js +14 -0
  307. package/dist/{chunk-vqawqpkx.js → chunk-w7zp9j8v.js} +72 -70
  308. package/dist/{chunk-d2vb6m9e.js → chunk-wd8mqz95.js} +3 -5
  309. package/dist/chunk-wj0c0zfa.js +36 -0
  310. package/dist/{chunk-ps5rsyxe.js → chunk-wqdr8v9x.js} +58 -55
  311. package/dist/{chunk-vpp13z80.js → chunk-wxa2hdfg.js} +2 -2
  312. package/dist/{chunk-kh04yrpx.js → chunk-wy3f5b81.js} +59 -56
  313. package/dist/{chunk-5dn1m1r7.js → chunk-x0ym1db4.js} +2 -4
  314. package/dist/{chunk-d73t8nhj.js → chunk-x1t80e36.js} +39 -39
  315. package/dist/{chunk-08a6n2pp.js → chunk-x63c39tp.js} +5 -7
  316. package/dist/{chunk-q890kpff.js → chunk-x6622cb2.js} +23 -22
  317. package/dist/{chunk-wcxc5m91.js → chunk-x95fhbwq.js} +1 -1
  318. package/dist/{chunk-px27vhxx.js → chunk-x9gbnheg.js} +8 -10
  319. package/dist/{chunk-9gypgvd7.js → chunk-xahpt5e2.js} +3 -5
  320. package/dist/{chunk-y3rg86fk.js → chunk-xct1m4sf.js} +23 -22
  321. package/dist/chunk-xee276gg.js +367 -0
  322. package/dist/{chunk-n8whv674.js → chunk-xfkf8q6w.js} +5 -6
  323. package/dist/chunk-xhesahm0.js +15 -0
  324. package/dist/{chunk-tbma29g4.js → chunk-xk1wdwxq.js} +60 -57
  325. package/dist/{chunk-gwah3f17.js → chunk-xpj4qca4.js} +58 -55
  326. package/dist/{chunk-h6wkvzrd.js → chunk-xqk8srdh.js} +6 -8
  327. package/dist/{chunk-39zy97qa.js → chunk-xsc3ccj0.js} +3 -3
  328. package/dist/{chunk-y82s03p7.js → chunk-xwc8e4yv.js} +2 -2
  329. package/dist/{chunk-8wv29424.js → chunk-xxmxv448.js} +8 -9
  330. package/dist/{chunk-symd8dvh.js → chunk-xz7cf7fa.js} +69 -66
  331. package/dist/{chunk-h7bkf3h2.js → chunk-y3qdyf8r.js} +28 -27
  332. package/dist/{chunk-j5eb93j4.js → chunk-y48wfwm4.js} +1 -517
  333. package/dist/{chunk-6qexrv9a.js → chunk-y7vzcjyn.js} +60 -58
  334. package/dist/chunk-yb03gvd8.js +271 -0
  335. package/dist/chunk-yem3ge7z.js +182 -0
  336. package/dist/{chunk-vmpcmvqq.js → chunk-yf5qwpnp.js} +3 -3
  337. package/dist/{chunk-awwfrm4f.js → chunk-yrnbgtk0.js} +26 -25
  338. package/dist/{chunk-64mwy58c.js → chunk-yrs92qya.js} +5 -7
  339. package/dist/{chunk-y29pdynp.js → chunk-ys6cza46.js} +7 -9
  340. package/dist/{chunk-kcp8svja.js → chunk-yvgmpc5z.js} +5 -5
  341. package/dist/{chunk-3avnvgnv.js → chunk-yxr0yf6h.js} +4 -4
  342. package/dist/{chunk-ar8awa36.js → chunk-yyc1yvnr.js} +59 -57
  343. package/dist/{chunk-kmzv85ze.js → chunk-z0vk43bt.js} +69 -66
  344. package/dist/chunk-z1seyvya.js +110 -0
  345. package/dist/{chunk-2pdcq92c.js → chunk-z6hqga26.js} +3 -4
  346. package/dist/{chunk-5ccpwbk7.js → chunk-z7hv619f.js} +58 -55
  347. package/dist/{chunk-1ez8vf1y.js → chunk-zb0mctxm.js} +6 -6
  348. package/dist/{chunk-49n22kr8.js → chunk-zhyc7npp.js} +58 -55
  349. package/dist/{chunk-9r28w6ye.js → chunk-zttmdag3.js} +1 -1
  350. package/dist/{chunk-p1af059d.js → chunk-zvegtrc4.js} +63 -60
  351. package/dist/{chunk-n2gc23dm.js → chunk-zwsrj2yy.js} +9 -11
  352. package/dist/cli.js +58 -22
  353. package/package.json +12 -4
  354. package/dist/chunk-0731m51q.js +0 -8
  355. package/dist/chunk-2fwze72g.js +0 -24
  356. package/dist/chunk-3ev51j3h.js +0 -117
  357. package/dist/chunk-5cc50ecq.js +0 -116
  358. package/dist/chunk-74v2mh4t.js +0 -40
  359. package/dist/chunk-9b0btjar.js +0 -114
  360. package/dist/chunk-bhvmpf9m.js +0 -113
  361. package/dist/chunk-bzps3qec.js +0 -113
  362. package/dist/chunk-e6nenv5n.js +0 -112
  363. package/dist/chunk-ez958w7j.js +0 -110
  364. package/dist/chunk-fve53rbk.js +0 -22
  365. package/dist/chunk-g5rf37hh.js +0 -116
  366. package/dist/chunk-ga2vcmhy.js +0 -111
  367. package/dist/chunk-k5c76pvm.js +0 -114
  368. package/dist/chunk-npf5eh3g.js +0 -8
  369. package/dist/chunk-ppwjyveh.js +0 -8
  370. package/dist/chunk-t38536jf.js +0 -254
  371. package/dist/chunk-tf8gr3bs.js +0 -112
  372. package/dist/chunk-vam5at9t.js +0 -175
  373. package/dist/chunk-vxnvzfnv.js +0 -233
  374. package/dist/chunk-wef34bk5.js +0 -107
  375. package/dist/chunk-wkjjv1jr.js +0 -1026
  376. package/dist/chunk-wkx2xsed.js +0 -113
  377. package/dist/chunk-x6r4v44b.js +0 -8
  378. package/dist/chunk-xwhmcc3g.js +0 -109
@@ -4,17 +4,12 @@ import {
4
4
  } from "./chunk-nt837qt9.js";
5
5
  import {
6
6
  notifySessionStateChanged
7
- } from "./chunk-2tcznfv0.js";
8
- import {
9
- init_slashCommandParsing,
10
- parseSlashCommand
11
- } from "./chunk-rn0v1hk8.js";
7
+ } from "./chunk-j66ragf9.js";
12
8
  import {
13
9
  AccountInfoSchema,
14
10
  AgentDefinitionSchema,
15
11
  AgentInfoSchema,
16
12
  DEFAULT_CRON_JITTER_CONFIG,
17
- DEFAULT_OUTPUT_STYLE_NAME,
18
13
  FastModeStateSchema,
19
14
  HookEventSchema,
20
15
  HookInputSchema,
@@ -28,128 +23,63 @@ import {
28
23
  SDKStreamlinedTextMessageSchema,
29
24
  SDKStreamlinedToolUseSummaryMessageSchema,
30
25
  SDKUserMessageSchema,
31
- Select,
32
26
  SlashCommandSchema,
33
- Spinner,
34
27
  Stream,
35
28
  addMarketplaceSource,
36
29
  applyPermissionUpdates,
37
- createAttachmentMessage,
38
- createCommandInputMessage,
39
- createImageMetadataText,
40
- createSystemMessage,
41
- createUserMessage,
42
30
  cronToHuman,
43
31
  detectImageFormatFromBase64,
44
32
  executePermissionRequestHooks,
45
- executeUserPromptSubmitHooks,
46
- extractTag,
47
- fileHistoryCanRestore,
48
- fileHistoryEnabled,
49
- fileHistoryGetDiffStats,
50
- findCommand,
51
33
  findMissedTasks,
52
- getAttachmentMessages,
53
- getCommandName,
54
- getContentText,
55
34
  getCronFilePath,
56
35
  getDeclaredMarketplaces,
57
- getUserPromptSubmitHookBlockingMessage,
58
36
  hasCronTasksSync,
59
37
  hasPermissionsToUseTool,
60
38
  hookJSONOutputSchema,
61
- init_AppState,
62
39
  init_PermissionUpdate,
63
40
  init_PermissionUpdateSchema,
64
- init_Spinner,
65
- init_attachments,
66
41
  init_commandLifecycle,
67
- init_commands1 as init_commands,
68
42
  init_coreSchemas,
69
43
  init_cron,
70
44
  init_cronTasks,
71
- init_fileHistory,
72
- init_generators,
73
45
  init_hooks,
74
46
  init_hooks1 as init_hooks2,
75
47
  init_imageResizer,
76
- init_imageStore,
77
48
  init_marketplaceManager,
78
- init_messages1 as init_messages,
79
- init_outputStyles,
80
49
  init_permissions,
81
- init_queryProfiler,
82
- init_select,
83
50
  init_stream,
84
- init_textInputTypes,
85
- init_useTerminalSize,
86
- isBridgeSafeCommand,
87
- isEmptyMessageText,
88
- isSyntheticMessage,
89
- isToolUseResultMessage,
90
- isValidImagePaste,
91
51
  jitteredNextCronRunMs,
92
52
  loadKnownMarketplacesConfig,
93
53
  markCronTasksFired,
94
- maybeResizeAndDownsampleImageBlock,
95
54
  notifyCommandLifecycle,
96
55
  oneShotJitteredNextCronRunMs,
97
56
  permissionUpdateSchema,
98
57
  persistPermissionUpdates,
99
- queryCheckpoint,
100
58
  readCronTasks,
101
- removeCronTasks,
102
- storeImages,
103
- toArray,
104
- useAppState
105
- } from "./chunk-4q5a5mjb.js";
106
- import {
107
- init_useExitOnCtrlCDWithKeybindings,
108
- useExitOnCtrlCDWithKeybindings
109
- } from "./chunk-w65283w4.js";
110
- import {
111
- init_useKeybinding
112
- } from "./chunk-t0twk3e5.js";
113
- import {
114
- init_events,
115
- init_sessionTracing,
116
- logOTelEvent,
117
- redactIfDisabled,
118
- startInteractionSpan
119
- } from "./chunk-9gypgvd7.js";
59
+ removeCronTasks
60
+ } from "./chunk-c092k38b.js";
120
61
  import {
121
- AGENT_TOOL_NAME,
122
- LEGACY_AGENT_TOOL_NAME,
123
- getAnthropicApiKeyWithSource,
124
- getFastModeState,
125
62
  getFeatureValue_CACHED_WITH_REFRESH,
126
- getSettings_DEPRECATED,
127
- init_auth,
128
- init_constants1 as init_constants,
129
- init_fastMode,
130
63
  init_file,
131
- init_genericProcessUtils,
132
64
  init_growthbook,
133
65
  init_isEqual,
134
66
  init_schemas,
135
- init_settings1 as init_settings,
136
67
  isEqual_default,
137
68
  isLocalMarketplaceSource,
138
- isProcessRunning,
139
69
  pathExists
140
- } from "./chunk-zmpygkz6.js";
70
+ } from "./chunk-p7es39d1.js";
141
71
  import {
142
72
  init_json,
143
73
  safeParseJSON
144
- } from "./chunk-hnx0eg6x.js";
145
- import {
146
- count,
147
- init_array
148
- } from "./chunk-zwarn9h7.js";
74
+ } from "./chunk-mkae8zj9.js";
149
75
  import {
150
76
  init_lazySchema,
151
77
  lazySchema
152
78
  } from "./chunk-64c1avct.js";
79
+ import {
80
+ init_genericProcessUtils,
81
+ isProcessRunning
82
+ } from "./chunk-b62vj92a.js";
153
83
  import {
154
84
  init_v4,
155
85
  v4_default
@@ -157,26 +87,6 @@ import {
157
87
  import {
158
88
  exports_external
159
89
  } from "./chunk-d7886r6a.js";
160
- import {
161
- formatRelativeTimeAgo,
162
- init_format,
163
- truncate
164
- } from "./chunk-prgsmrmy.js";
165
- import {
166
- Divider,
167
- ThemedBox_default,
168
- ThemedText,
169
- init_src,
170
- useKeybinding,
171
- useKeybindings,
172
- useTerminalSize
173
- } from "./chunk-e4jqbn4d.js";
174
- import {
175
- require_jsx_dev_runtime
176
- } from "./chunk-vxnvzfnv.js";
177
- import {
178
- require_react
179
- } from "./chunk-ns3babbs.js";
180
90
  import {
181
91
  init_analytics,
182
92
  logEvent
@@ -186,45 +96,24 @@ import {
186
96
  init_diagLogs,
187
97
  init_git,
188
98
  logForDiagnosticsNoPII
189
- } from "./chunk-pedmqmrf.js";
99
+ } from "./chunk-9awawyvh.js";
190
100
  import {
191
- getCwd,
192
- init_cwd
193
- } from "./chunk-tv74hgw9.js";
194
- import {
195
- BASH_STDERR_TAG,
196
- BASH_STDOUT_TAG,
197
- COMMAND_MESSAGE_TAG,
198
- LOCAL_COMMAND_STDERR_TAG,
199
- LOCAL_COMMAND_STDOUT_TAG,
200
- TASK_NOTIFICATION_TAG,
201
- TEAMMATE_MESSAGE_TAG,
202
- TICK_TAG,
203
- init_displayTags,
204
101
  init_log,
205
- init_xml,
206
- logError,
207
- stripDisplayTags
208
- } from "./chunk-d2vb6m9e.js";
209
- import {
210
- figures_default,
211
- init_figures
212
- } from "./chunk-qajrkk97.js";
102
+ logError
103
+ } from "./chunk-wd8mqz95.js";
213
104
  import {
105
+ AbortError,
106
+ errorMessage,
107
+ getErrnoCode,
214
108
  init_cleanupRegistry,
215
109
  init_debug,
110
+ init_errors,
216
111
  init_slowOperations,
217
112
  jsonParse,
218
113
  jsonStringify,
219
114
  logForDebugging,
220
115
  registerCleanup
221
- } from "./chunk-kmgp6prw.js";
222
- import {
223
- AbortError,
224
- errorMessage,
225
- getErrnoCode,
226
- init_errors
227
- } from "./chunk-3ev51j3h.js";
116
+ } from "./chunk-5khwvj1z.js";
228
117
  import {
229
118
  init_process,
230
119
  writeToStdout
@@ -233,824 +122,18 @@ import {
233
122
  getOriginalCwd,
234
123
  getProjectRoot,
235
124
  getScheduledTasksEnabled,
236
- getSdkBetas,
237
125
  getSessionCronTasks,
238
126
  getSessionId,
239
127
  init_state,
240
128
  removeSessionCronTasks,
241
- setPromptId,
242
129
  setScheduledTasksEnabled
243
130
  } from "./chunk-gzp6rza1.js";
244
131
  import {
245
132
  __esm,
246
133
  __export,
247
- __require,
248
- __toESM
134
+ __require
249
135
  } from "./chunk-qp2qdcda.js";
250
136
 
251
- // src/components/MessageSelector.tsx
252
- var exports_MessageSelector = {};
253
- __export(exports_MessageSelector, {
254
- selectableUserMessagesFilter: () => selectableUserMessagesFilter,
255
- messagesAfterAreOnlySynthetic: () => messagesAfterAreOnlySynthetic,
256
- MessageSelector: () => MessageSelector
257
- });
258
- import { randomUUID } from "crypto";
259
- import * as path from "path";
260
- function isTextBlock(block) {
261
- return block.type === "text";
262
- }
263
- function isSummarizeOption(option) {
264
- return option === "summarize" || option === "summarize_up_to";
265
- }
266
- function MessageSelector({
267
- messages,
268
- onPreRestore,
269
- onRestoreMessage,
270
- onRestoreCode,
271
- onSummarize,
272
- onClose,
273
- preselectedMessage
274
- }) {
275
- const fileHistory = useAppState((s) => s.fileHistory);
276
- const [error, setError] = import_react.useState(undefined);
277
- const isFileHistoryEnabled = fileHistoryEnabled();
278
- const currentUUID = import_react.useMemo(randomUUID, []);
279
- const messageOptions = import_react.useMemo(() => [
280
- ...messages.filter(selectableUserMessagesFilter),
281
- {
282
- ...createUserMessage({
283
- content: ""
284
- }),
285
- uuid: currentUUID
286
- }
287
- ], [messages, currentUUID]);
288
- const [selectedIndex, setSelectedIndex] = import_react.useState(messageOptions.length - 1);
289
- const firstVisibleIndex = Math.max(0, Math.min(selectedIndex - Math.floor(MAX_VISIBLE_MESSAGES / 2), messageOptions.length - MAX_VISIBLE_MESSAGES));
290
- const hasMessagesToSelect = messageOptions.length > 1;
291
- const [messageToRestore, setMessageToRestore] = import_react.useState(preselectedMessage);
292
- const [diffStatsForRestore, setDiffStatsForRestore] = import_react.useState(undefined);
293
- import_react.useEffect(() => {
294
- if (!preselectedMessage || !isFileHistoryEnabled)
295
- return;
296
- let cancelled = false;
297
- fileHistoryGetDiffStats(fileHistory, preselectedMessage.uuid).then((stats) => {
298
- if (!cancelled)
299
- setDiffStatsForRestore(stats);
300
- });
301
- return () => {
302
- cancelled = true;
303
- };
304
- }, [preselectedMessage, isFileHistoryEnabled, fileHistory]);
305
- const [isRestoring, setIsRestoring] = import_react.useState(false);
306
- const [restoringOption, setRestoringOption] = import_react.useState(null);
307
- const [selectedRestoreOption, setSelectedRestoreOption] = import_react.useState("both");
308
- const [summarizeFromFeedback, setSummarizeFromFeedback] = import_react.useState("");
309
- const [summarizeUpToFeedback, setSummarizeUpToFeedback] = import_react.useState("");
310
- function getRestoreOptions(canRestoreCode2) {
311
- const baseOptions = canRestoreCode2 ? [
312
- { value: "both", label: "Restore code and conversation" },
313
- { value: "conversation", label: "Restore conversation" },
314
- { value: "code", label: "Restore code" }
315
- ] : [{ value: "conversation", label: "Restore conversation" }];
316
- const summarizeInputProps = {
317
- type: "input",
318
- placeholder: "add context (optional)",
319
- initialValue: "",
320
- allowEmptySubmitToCancel: true,
321
- showLabelWithValue: true,
322
- labelValueSeparator: ": "
323
- };
324
- baseOptions.push({
325
- value: "summarize",
326
- label: "Summarize from here",
327
- ...summarizeInputProps,
328
- onChange: setSummarizeFromFeedback
329
- });
330
- if (process.env.USER_TYPE === "ant") {
331
- baseOptions.push({
332
- value: "summarize_up_to",
333
- label: "Summarize up to here",
334
- ...summarizeInputProps,
335
- onChange: setSummarizeUpToFeedback
336
- });
337
- }
338
- baseOptions.push({ value: "nevermind", label: "Never mind" });
339
- return baseOptions;
340
- }
341
- import_react.useEffect(() => {
342
- logEvent("tengu_message_selector_opened", {});
343
- }, []);
344
- async function restoreConversationDirectly(message) {
345
- onPreRestore();
346
- setIsRestoring(true);
347
- try {
348
- await onRestoreMessage(message);
349
- setIsRestoring(false);
350
- onClose();
351
- } catch (error2) {
352
- logError(error2);
353
- setIsRestoring(false);
354
- setError(`Failed to restore the conversation:
355
- ${error2}`);
356
- }
357
- }
358
- async function handleSelect(message) {
359
- const index = messages.indexOf(message);
360
- const indexFromEnd = messages.length - 1 - index;
361
- logEvent("tengu_message_selector_selected", {
362
- index_from_end: indexFromEnd,
363
- message_type: message.type,
364
- is_current_prompt: false
365
- });
366
- if (!messages.includes(message)) {
367
- onClose();
368
- return;
369
- }
370
- if (!isFileHistoryEnabled) {
371
- await restoreConversationDirectly(message);
372
- return;
373
- }
374
- const diffStats = await fileHistoryGetDiffStats(fileHistory, message.uuid);
375
- setMessageToRestore(message);
376
- setDiffStatsForRestore(diffStats);
377
- }
378
- async function onSelectRestoreOption(option) {
379
- logEvent("tengu_message_selector_restore_option_selected", {
380
- option
381
- });
382
- if (!messageToRestore) {
383
- setError("Message not found.");
384
- return;
385
- }
386
- if (option === "nevermind") {
387
- if (preselectedMessage)
388
- onClose();
389
- else
390
- setMessageToRestore(undefined);
391
- return;
392
- }
393
- if (isSummarizeOption(option)) {
394
- onPreRestore();
395
- setIsRestoring(true);
396
- setRestoringOption(option);
397
- setError(undefined);
398
- try {
399
- const direction = option === "summarize_up_to" ? "up_to" : "from";
400
- const feedback = (direction === "up_to" ? summarizeUpToFeedback : summarizeFromFeedback).trim() || undefined;
401
- await onSummarize(messageToRestore, feedback, direction);
402
- setIsRestoring(false);
403
- setRestoringOption(null);
404
- setMessageToRestore(undefined);
405
- onClose();
406
- } catch (error2) {
407
- logError(error2);
408
- setIsRestoring(false);
409
- setRestoringOption(null);
410
- setMessageToRestore(undefined);
411
- setError(`Failed to summarize:
412
- ${error2}`);
413
- }
414
- return;
415
- }
416
- onPreRestore();
417
- setIsRestoring(true);
418
- setError(undefined);
419
- let codeError = null;
420
- let conversationError = null;
421
- if (option === "code" || option === "both") {
422
- try {
423
- await onRestoreCode(messageToRestore);
424
- } catch (error2) {
425
- codeError = error2;
426
- logError(codeError);
427
- }
428
- }
429
- if (option === "conversation" || option === "both") {
430
- try {
431
- await onRestoreMessage(messageToRestore);
432
- } catch (error2) {
433
- conversationError = error2;
434
- logError(conversationError);
435
- }
436
- }
437
- setIsRestoring(false);
438
- setMessageToRestore(undefined);
439
- if (conversationError && codeError) {
440
- setError(`Failed to restore the conversation and code:
441
- ${conversationError}
442
- ${codeError}`);
443
- } else if (conversationError) {
444
- setError(`Failed to restore the conversation:
445
- ${conversationError}`);
446
- } else if (codeError) {
447
- setError(`Failed to restore the code:
448
- ${codeError}`);
449
- } else {
450
- onClose();
451
- }
452
- }
453
- const exitState = useExitOnCtrlCDWithKeybindings();
454
- const handleEscape = import_react.useCallback(() => {
455
- if (messageToRestore && !preselectedMessage) {
456
- setMessageToRestore(undefined);
457
- return;
458
- }
459
- logEvent("tengu_message_selector_cancelled", {});
460
- onClose();
461
- }, [onClose, messageToRestore, preselectedMessage]);
462
- const moveUp = import_react.useCallback(() => setSelectedIndex((prev) => Math.max(0, prev - 1)), []);
463
- const moveDown = import_react.useCallback(() => setSelectedIndex((prev) => Math.min(messageOptions.length - 1, prev + 1)), [messageOptions.length]);
464
- const jumpToTop = import_react.useCallback(() => setSelectedIndex(0), []);
465
- const jumpToBottom = import_react.useCallback(() => setSelectedIndex(messageOptions.length - 1), [messageOptions.length]);
466
- const handleSelectCurrent = import_react.useCallback(() => {
467
- const selected = messageOptions[selectedIndex];
468
- if (selected) {
469
- handleSelect(selected);
470
- }
471
- }, [messageOptions, selectedIndex, handleSelect]);
472
- useKeybinding("confirm:no", handleEscape, {
473
- context: "Confirmation",
474
- isActive: !messageToRestore
475
- });
476
- useKeybindings({
477
- "messageSelector:up": moveUp,
478
- "messageSelector:down": moveDown,
479
- "messageSelector:top": jumpToTop,
480
- "messageSelector:bottom": jumpToBottom,
481
- "messageSelector:select": handleSelectCurrent
482
- }, {
483
- context: "MessageSelector",
484
- isActive: !isRestoring && !error && !messageToRestore && hasMessagesToSelect
485
- });
486
- const [fileHistoryMetadata, setFileHistoryMetadata] = import_react.useState({});
487
- import_react.useEffect(() => {
488
- async function loadFileHistoryMetadata() {
489
- if (!isFileHistoryEnabled) {
490
- return;
491
- }
492
- Promise.all(messageOptions.map(async (userMessage, itemIndex) => {
493
- if (userMessage.uuid !== currentUUID) {
494
- const canRestore = fileHistoryCanRestore(fileHistory, userMessage.uuid);
495
- const nextUserMessage = messageOptions.at(itemIndex + 1);
496
- const diffStats = canRestore ? computeDiffStatsBetweenMessages(messages, userMessage.uuid, nextUserMessage?.uuid !== currentUUID ? nextUserMessage?.uuid : undefined) : undefined;
497
- if (diffStats !== undefined) {
498
- setFileHistoryMetadata((prev) => ({
499
- ...prev,
500
- [itemIndex]: diffStats
501
- }));
502
- } else {
503
- setFileHistoryMetadata((prev) => ({
504
- ...prev,
505
- [itemIndex]: undefined
506
- }));
507
- }
508
- }
509
- }));
510
- }
511
- loadFileHistoryMetadata();
512
- }, [messageOptions, messages, currentUUID, fileHistory, isFileHistoryEnabled]);
513
- const canRestoreCode = isFileHistoryEnabled && diffStatsForRestore?.filesChanged && diffStatsForRestore.filesChanged.length > 0;
514
- const showPickList = !error && !messageToRestore && !preselectedMessage && hasMessagesToSelect;
515
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
516
- flexDirection: "column",
517
- width: "100%",
518
- children: [
519
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Divider, {
520
- color: "suggestion"
521
- }, undefined, false, undefined, this),
522
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
523
- flexDirection: "column",
524
- marginX: 1,
525
- gap: 1,
526
- children: [
527
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
528
- bold: true,
529
- color: "suggestion",
530
- children: "Rewind"
531
- }, undefined, false, undefined, this),
532
- error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
533
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
534
- color: "error",
535
- children: [
536
- "Error: ",
537
- error
538
- ]
539
- }, undefined, true, undefined, this)
540
- }, undefined, false, undefined, this),
541
- !hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
542
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
543
- children: "Nothing to rewind to yet."
544
- }, undefined, false, undefined, this)
545
- }, undefined, false, undefined, this),
546
- !error && messageToRestore && hasMessagesToSelect && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
547
- children: [
548
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
549
- children: [
550
- "Confirm you want to restore",
551
- " ",
552
- !diffStatsForRestore && "the conversation ",
553
- "to the point before you sent this message:"
554
- ]
555
- }, undefined, true, undefined, this),
556
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
557
- flexDirection: "column",
558
- paddingLeft: 1,
559
- borderStyle: "single",
560
- borderRight: false,
561
- borderTop: false,
562
- borderBottom: false,
563
- borderLeft: true,
564
- borderLeftDimColor: true,
565
- children: [
566
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
567
- userMessage: messageToRestore,
568
- color: "text",
569
- isCurrent: false
570
- }, undefined, false, undefined, this),
571
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
572
- dimColor: true,
573
- children: [
574
- "(",
575
- formatRelativeTimeAgo(new Date(messageToRestore.timestamp)),
576
- ")"
577
- ]
578
- }, undefined, true, undefined, this)
579
- ]
580
- }, undefined, true, undefined, this),
581
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreOptionDescription, {
582
- selectedRestoreOption,
583
- canRestoreCode: !!canRestoreCode,
584
- diffStatsForRestore
585
- }, undefined, false, undefined, this),
586
- isRestoring && isSummarizeOption(restoringOption) ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
587
- flexDirection: "row",
588
- gap: 1,
589
- children: [
590
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Spinner, {}, undefined, false, undefined, this),
591
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
592
- children: "Summarizing\u2026"
593
- }, undefined, false, undefined, this)
594
- ]
595
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
596
- isDisabled: isRestoring,
597
- options: getRestoreOptions(!!canRestoreCode),
598
- defaultFocusValue: canRestoreCode ? "both" : "conversation",
599
- onFocus: (value) => setSelectedRestoreOption(value),
600
- onChange: (value) => onSelectRestoreOption(value),
601
- onCancel: () => preselectedMessage ? onClose() : setMessageToRestore(undefined)
602
- }, undefined, false, undefined, this),
603
- canRestoreCode && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
604
- marginBottom: 1,
605
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
606
- dimColor: true,
607
- children: [
608
- figures_default.warning,
609
- " Rewinding does not affect files edited manually or via bash."
610
- ]
611
- }, undefined, true, undefined, this)
612
- }, undefined, false, undefined, this)
613
- ]
614
- }, undefined, true, undefined, this),
615
- showPickList && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
616
- children: [
617
- isFileHistoryEnabled ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
618
- children: "Restore the code and/or conversation to the point before\u2026"
619
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
620
- children: "Restore and fork the conversation to the point before\u2026"
621
- }, undefined, false, undefined, this),
622
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
623
- width: "100%",
624
- flexDirection: "column",
625
- children: messageOptions.slice(firstVisibleIndex, firstVisibleIndex + MAX_VISIBLE_MESSAGES).map((msg, visibleOptionIndex) => {
626
- const optionIndex = firstVisibleIndex + visibleOptionIndex;
627
- const isSelected = optionIndex === selectedIndex;
628
- const isCurrent = msg.uuid === currentUUID;
629
- const metadataLoaded = optionIndex in fileHistoryMetadata;
630
- const metadata = fileHistoryMetadata[optionIndex];
631
- const numFilesChanged = metadata?.filesChanged && metadata.filesChanged.length;
632
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
633
- height: isFileHistoryEnabled ? 3 : 2,
634
- overflow: "hidden",
635
- width: "100%",
636
- flexDirection: "row",
637
- children: [
638
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
639
- width: 2,
640
- minWidth: 2,
641
- children: isSelected ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
642
- color: "permission",
643
- bold: true,
644
- children: [
645
- figures_default.pointer,
646
- " "
647
- ]
648
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
649
- children: " "
650
- }, undefined, false, undefined, this)
651
- }, undefined, false, undefined, this),
652
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
653
- flexDirection: "column",
654
- children: [
655
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
656
- flexShrink: 1,
657
- height: 1,
658
- overflow: "hidden",
659
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(UserMessageOption, {
660
- userMessage: msg,
661
- color: isSelected ? "suggestion" : undefined,
662
- isCurrent,
663
- paddingRight: 10
664
- }, undefined, false, undefined, this)
665
- }, undefined, false, undefined, this),
666
- isFileHistoryEnabled && metadataLoaded && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
667
- height: 1,
668
- flexDirection: "row",
669
- children: metadata ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
670
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
671
- dimColor: !isSelected,
672
- color: "inactive",
673
- children: numFilesChanged ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
674
- children: [
675
- numFilesChanged === 1 && metadata.filesChanged[0] ? `${path.basename(metadata.filesChanged[0])} ` : `${numFilesChanged} files changed `,
676
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
677
- diffStats: metadata
678
- }, undefined, false, undefined, this)
679
- ]
680
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
681
- children: "No code changes"
682
- }, undefined, false, undefined, this)
683
- }, undefined, false, undefined, this)
684
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
685
- dimColor: true,
686
- color: "warning",
687
- children: [
688
- figures_default.warning,
689
- " No code restore"
690
- ]
691
- }, undefined, true, undefined, this)
692
- }, undefined, false, undefined, this)
693
- ]
694
- }, undefined, true, undefined, this)
695
- ]
696
- }, msg.uuid, true, undefined, this);
697
- })
698
- }, undefined, false, undefined, this)
699
- ]
700
- }, undefined, true, undefined, this),
701
- !messageToRestore && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
702
- dimColor: true,
703
- italic: true,
704
- children: exitState.pending ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
705
- children: [
706
- "Press ",
707
- exitState.keyName,
708
- " again to exit"
709
- ]
710
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
711
- children: [
712
- !error && hasMessagesToSelect && "Enter to continue \xB7 ",
713
- "Esc to exit"
714
- ]
715
- }, undefined, true, undefined, this)
716
- }, undefined, false, undefined, this)
717
- ]
718
- }, undefined, true, undefined, this)
719
- ]
720
- }, undefined, true, undefined, this);
721
- }
722
- function getRestoreOptionConversationText(option) {
723
- switch (option) {
724
- case "summarize":
725
- return "Messages after this point will be summarized.";
726
- case "summarize_up_to":
727
- return "Preceding messages will be summarized. This and subsequent messages will remain unchanged \u2014 you will stay at the end of the conversation.";
728
- case "both":
729
- case "conversation":
730
- return "The conversation will be forked.";
731
- case "code":
732
- case "nevermind":
733
- return "The conversation will be unchanged.";
734
- }
735
- }
736
- function RestoreOptionDescription({
737
- selectedRestoreOption,
738
- canRestoreCode,
739
- diffStatsForRestore
740
- }) {
741
- const showCodeRestore = canRestoreCode && (selectedRestoreOption === "both" || selectedRestoreOption === "code");
742
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
743
- flexDirection: "column",
744
- children: [
745
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
746
- dimColor: true,
747
- children: getRestoreOptionConversationText(selectedRestoreOption)
748
- }, undefined, false, undefined, this),
749
- !isSummarizeOption(selectedRestoreOption) && (showCodeRestore ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RestoreCodeConfirmation, {
750
- diffStatsForRestore
751
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
752
- dimColor: true,
753
- children: "The code will be unchanged."
754
- }, undefined, false, undefined, this))
755
- ]
756
- }, undefined, true, undefined, this);
757
- }
758
- function RestoreCodeConfirmation({
759
- diffStatsForRestore
760
- }) {
761
- if (diffStatsForRestore === undefined) {
762
- return;
763
- }
764
- if (!diffStatsForRestore.filesChanged || !diffStatsForRestore.filesChanged[0]) {
765
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
766
- dimColor: true,
767
- children: "The code has not changed (nothing will be restored)."
768
- }, undefined, false, undefined, this);
769
- }
770
- const numFilesChanged = diffStatsForRestore.filesChanged.length;
771
- let fileLabel = "";
772
- if (numFilesChanged === 1) {
773
- fileLabel = path.basename(diffStatsForRestore.filesChanged[0] || "");
774
- } else if (numFilesChanged === 2) {
775
- const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
776
- const file2 = path.basename(diffStatsForRestore.filesChanged[1] || "");
777
- fileLabel = `${file1} and ${file2}`;
778
- } else {
779
- const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
780
- fileLabel = `${file1} and ${diffStatsForRestore.filesChanged.length - 1} other files`;
781
- }
782
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
783
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
784
- dimColor: true,
785
- children: [
786
- "The code will be restored",
787
- " ",
788
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(DiffStatsText, {
789
- diffStats: diffStatsForRestore
790
- }, undefined, false, undefined, this),
791
- " in ",
792
- fileLabel,
793
- "."
794
- ]
795
- }, undefined, true, undefined, this)
796
- }, undefined, false, undefined, this);
797
- }
798
- function DiffStatsText({
799
- diffStats
800
- }) {
801
- if (!diffStats || !diffStats.filesChanged) {
802
- return;
803
- }
804
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(jsx_dev_runtime.Fragment, {
805
- children: [
806
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
807
- color: "diffAddedWord",
808
- children: [
809
- "+",
810
- diffStats.insertions,
811
- " "
812
- ]
813
- }, undefined, true, undefined, this),
814
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
815
- color: "diffRemovedWord",
816
- children: [
817
- "-",
818
- diffStats.deletions
819
- ]
820
- }, undefined, true, undefined, this)
821
- ]
822
- }, undefined, true, undefined, this);
823
- }
824
- function UserMessageOption({
825
- userMessage,
826
- color,
827
- dimColor,
828
- isCurrent,
829
- paddingRight
830
- }) {
831
- const { columns } = useTerminalSize();
832
- if (isCurrent) {
833
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
834
- width: "100%",
835
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
836
- italic: true,
837
- color,
838
- dimColor,
839
- children: "(current)"
840
- }, undefined, false, undefined, this)
841
- }, undefined, false, undefined, this);
842
- }
843
- const content = userMessage.message.content;
844
- const lastBlock = typeof content === "string" ? null : content[content.length - 1];
845
- const rawMessageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "(no prompt)";
846
- const messageText = stripDisplayTags(rawMessageText);
847
- if (isEmptyMessageText(messageText)) {
848
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
849
- flexDirection: "row",
850
- width: "100%",
851
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
852
- italic: true,
853
- color,
854
- dimColor,
855
- children: "((empty message))"
856
- }, undefined, false, undefined, this)
857
- }, undefined, false, undefined, this);
858
- }
859
- if (messageText.includes("<bash-input>")) {
860
- const input = extractTag(messageText, "bash-input");
861
- if (input) {
862
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
863
- flexDirection: "row",
864
- width: "100%",
865
- children: [
866
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
867
- color: "bashBorder",
868
- children: "!"
869
- }, undefined, false, undefined, this),
870
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
871
- color,
872
- dimColor,
873
- children: [
874
- " ",
875
- input
876
- ]
877
- }, undefined, true, undefined, this)
878
- ]
879
- }, undefined, true, undefined, this);
880
- }
881
- }
882
- if (messageText.includes(`<${COMMAND_MESSAGE_TAG}>`)) {
883
- const commandMessage = extractTag(messageText, COMMAND_MESSAGE_TAG);
884
- const args = extractTag(messageText, "command-args");
885
- const isSkillFormat = extractTag(messageText, "skill-format") === "true";
886
- if (commandMessage) {
887
- if (isSkillFormat) {
888
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
889
- flexDirection: "row",
890
- width: "100%",
891
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
892
- color,
893
- dimColor,
894
- children: [
895
- "Skill(",
896
- commandMessage,
897
- ")"
898
- ]
899
- }, undefined, true, undefined, this)
900
- }, undefined, false, undefined, this);
901
- } else {
902
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
903
- flexDirection: "row",
904
- width: "100%",
905
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
906
- color,
907
- dimColor,
908
- children: [
909
- "/",
910
- commandMessage,
911
- " ",
912
- args
913
- ]
914
- }, undefined, true, undefined, this)
915
- }, undefined, false, undefined, this);
916
- }
917
- }
918
- }
919
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
920
- flexDirection: "row",
921
- width: "100%",
922
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
923
- color,
924
- dimColor,
925
- children: paddingRight ? truncate(messageText, columns - paddingRight, true) : messageText.slice(0, 500).split(`
926
- `).slice(0, 4).join(`
927
- `)
928
- }, undefined, false, undefined, this)
929
- }, undefined, false, undefined, this);
930
- }
931
- function computeDiffStatsBetweenMessages(messages, fromMessageId, toMessageId) {
932
- const startIndex = messages.findIndex((msg) => msg.uuid === fromMessageId);
933
- if (startIndex === -1) {
934
- return;
935
- }
936
- let endIndex = toMessageId ? messages.findIndex((msg) => msg.uuid === toMessageId) : messages.length;
937
- if (endIndex === -1) {
938
- endIndex = messages.length;
939
- }
940
- const filesChanged = [];
941
- let insertions = 0;
942
- let deletions = 0;
943
- for (let i = startIndex + 1;i < endIndex; i++) {
944
- const msg = messages[i];
945
- if (!msg || !isToolUseResultMessage(msg)) {
946
- continue;
947
- }
948
- const result = msg.toolUseResult;
949
- if (!result || !result.filePath || !result.structuredPatch) {
950
- continue;
951
- }
952
- if (!filesChanged.includes(result.filePath)) {
953
- filesChanged.push(result.filePath);
954
- }
955
- try {
956
- if ("type" in result && result.type === "create") {
957
- insertions += result.content.split(/\r?\n/).length;
958
- } else {
959
- for (const hunk of result.structuredPatch) {
960
- const additions = count(hunk.lines, (line) => line.startsWith("+"));
961
- const removals = count(hunk.lines, (line) => line.startsWith("-"));
962
- insertions += additions;
963
- deletions += removals;
964
- }
965
- }
966
- } catch {
967
- continue;
968
- }
969
- }
970
- return {
971
- filesChanged,
972
- insertions,
973
- deletions
974
- };
975
- }
976
- function selectableUserMessagesFilter(message) {
977
- if (message.type !== "user") {
978
- return false;
979
- }
980
- if (Array.isArray(message.message.content) && message.message.content[0]?.type === "tool_result") {
981
- return false;
982
- }
983
- if (isSyntheticMessage(message)) {
984
- return false;
985
- }
986
- if (message.isMeta) {
987
- return false;
988
- }
989
- if (message.isCompactSummary || message.isVisibleInTranscriptOnly) {
990
- return false;
991
- }
992
- const content = message.message.content;
993
- const lastBlock = typeof content === "string" ? null : content[content.length - 1];
994
- const messageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "";
995
- 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) {
996
- return false;
997
- }
998
- return true;
999
- }
1000
- function messagesAfterAreOnlySynthetic(messages, fromIndex) {
1001
- for (let i = fromIndex + 1;i < messages.length; i++) {
1002
- const msg = messages[i];
1003
- if (!msg)
1004
- continue;
1005
- if (isSyntheticMessage(msg))
1006
- continue;
1007
- if (isToolUseResultMessage(msg))
1008
- continue;
1009
- if (msg.type === "progress")
1010
- continue;
1011
- if (msg.type === "system")
1012
- continue;
1013
- if (msg.type === "attachment")
1014
- continue;
1015
- if (msg.type === "user" && msg.isMeta)
1016
- continue;
1017
- if (msg.type === "assistant") {
1018
- const content = msg.message.content;
1019
- if (Array.isArray(content)) {
1020
- const hasMeaningfulContent = content.some((block) => block.type === "text" && block.text.trim() || block.type === "tool_use");
1021
- if (hasMeaningfulContent)
1022
- return false;
1023
- }
1024
- continue;
1025
- }
1026
- if (msg.type === "user") {
1027
- return false;
1028
- }
1029
- }
1030
- return true;
1031
- }
1032
- var import_react, jsx_dev_runtime, MAX_VISIBLE_MESSAGES = 7;
1033
- var init_MessageSelector = __esm(() => {
1034
- init_figures();
1035
- init_analytics();
1036
- init_AppState();
1037
- init_fileHistory();
1038
- init_log();
1039
- init_useExitOnCtrlCDWithKeybindings();
1040
- init_src();
1041
- init_useKeybinding();
1042
- init_displayTags();
1043
- init_messages();
1044
- init_select();
1045
- init_Spinner();
1046
- init_useTerminalSize();
1047
- init_xml();
1048
- init_array();
1049
- init_format();
1050
- import_react = __toESM(require_react(), 1);
1051
- jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
1052
- });
1053
-
1054
137
  // src/utils/cronJitterConfig.ts
1055
138
  var exports_cronJitterConfig = {};
1056
139
  __export(exports_cronJitterConfig, {
@@ -1097,19 +180,19 @@ async function readLock(dir) {
1097
180
  return result.success ? result.data : undefined;
1098
181
  }
1099
182
  async function tryCreateExclusive(lock, dir) {
1100
- const path2 = getLockPath(dir);
183
+ const path = getLockPath(dir);
1101
184
  const body = jsonStringify(lock);
1102
185
  try {
1103
- await writeFile(path2, body, { flag: "wx" });
186
+ await writeFile(path, body, { flag: "wx" });
1104
187
  return true;
1105
188
  } catch (e) {
1106
189
  const code = getErrnoCode(e);
1107
190
  if (code === "EEXIST")
1108
191
  return false;
1109
192
  if (code === "ENOENT") {
1110
- await mkdir(dirname(path2), { recursive: true });
193
+ await mkdir(dirname(path), { recursive: true });
1111
194
  try {
1112
- await writeFile(path2, body, { flag: "wx" });
195
+ await writeFile(path, body, { flag: "wx" });
1113
196
  return true;
1114
197
  } catch (retryErr) {
1115
198
  if (getErrnoCode(retryErr) === "EEXIST")
@@ -1381,8 +464,8 @@ function createCronScheduler(options) {
1381
464
  lockProbeTimer.unref?.();
1382
465
  }
1383
466
  load(true);
1384
- const path2 = getCronFilePath(dir);
1385
- watcher = chokidar.watch(path2, {
467
+ const path = getCronFilePath(dir);
468
+ watcher = chokidar.watch(path, {
1386
469
  persistent: false,
1387
470
  ignoreInitial: true,
1388
471
  awaitWriteFinish: { stabilityThreshold: FILE_STABILITY_MS },
@@ -1584,7 +667,7 @@ function permissionPromptToolResultToPermissionDecision(result, tool, input, too
1584
667
  }
1585
668
 
1586
669
  // src/cli/structuredIO.ts
1587
- import { randomUUID as randomUUID2 } from "crypto";
670
+ import { randomUUID } from "crypto";
1588
671
 
1589
672
  // src/entrypoints/sdk/controlSchemas.ts
1590
673
  init_v4();
@@ -2198,7 +1281,7 @@ class StructuredIO {
2198
1281
  writeToStdout(ndjsonSafeStringify(message) + `
2199
1282
  `);
2200
1283
  }
2201
- async sendRequest(request, schema, signal, requestId = randomUUID2()) {
1284
+ async sendRequest(request, schema, signal, requestId = randomUUID()) {
2202
1285
  const message = {
2203
1286
  type: "control_request",
2204
1287
  request_id: requestId,
@@ -2264,7 +1347,7 @@ class StructuredIO {
2264
1347
  parentSignal.addEventListener("abort", onParentAbort, { once: true });
2265
1348
  try {
2266
1349
  const hookPromise = executePermissionRequestHooksForSDK(tool.name, toolUseID, input, toolUseContext, mainPermissionResult.suggestions).then((decision) => ({ source: "hook", decision }));
2267
- const requestId = randomUUID2();
1350
+ const requestId = randomUUID();
2268
1351
  onPermissionPrompt?.(buildRequiresActionDetails(tool, input, toolUseID, requestId));
2269
1352
  const sdkPromise = this.sendRequest({
2270
1353
  subtype: "can_use_tool",
@@ -2344,7 +1427,7 @@ class StructuredIO {
2344
1427
  subtype: "can_use_tool",
2345
1428
  tool_name: SANDBOX_NETWORK_ACCESS_TOOL_NAME,
2346
1429
  input: { host: hostPattern.host },
2347
- tool_use_id: randomUUID2(),
1430
+ tool_use_id: randomUUID(),
2348
1431
  description: `Allow network connection to ${hostPattern.host}?`
2349
1432
  }, outputSchema());
2350
1433
  return result.behavior === "allow";
@@ -2412,459 +1495,6 @@ async function executePermissionRequestHooksForSDK(toolName, toolUseID, input, t
2412
1495
  return;
2413
1496
  }
2414
1497
 
2415
- // src/utils/messages/systemInit.ts
2416
- init_state();
2417
- init_outputStyles();
2418
- init_constants();
2419
- init_auth();
2420
- init_cwd();
2421
- init_fastMode();
2422
- init_settings();
2423
- import { randomUUID as randomUUID3 } from "crypto";
2424
- function sdkCompatToolName(name) {
2425
- return name === AGENT_TOOL_NAME ? LEGACY_AGENT_TOOL_NAME : name;
2426
- }
2427
- function buildSystemInitMessage(inputs) {
2428
- const settings = getSettings_DEPRECATED();
2429
- const outputStyle = settings?.outputStyle ?? DEFAULT_OUTPUT_STYLE_NAME;
2430
- const initMessage = {
2431
- type: "system",
2432
- subtype: "init",
2433
- cwd: getCwd(),
2434
- session_id: getSessionId(),
2435
- tools: inputs.tools.map((tool) => sdkCompatToolName(tool.name)),
2436
- mcp_servers: inputs.mcpClients.map((client) => ({
2437
- name: client.name,
2438
- status: client.type
2439
- })),
2440
- model: inputs.model,
2441
- permissionMode: inputs.permissionMode,
2442
- slash_commands: inputs.commands.filter((c) => c.userInvocable !== false).map((c) => c.name),
2443
- apiKeySource: getAnthropicApiKeyWithSource().source,
2444
- betas: getSdkBetas(),
2445
- claude_code_version: "2.1.888",
2446
- output_style: outputStyle,
2447
- agents: inputs.agents.map((agent) => agent.agentType),
2448
- skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
2449
- plugins: inputs.plugins.map((plugin) => ({
2450
- name: plugin.name,
2451
- path: plugin.path,
2452
- source: plugin.source
2453
- })),
2454
- uuid: randomUUID3()
2455
- };
2456
- if (false) {}
2457
- initMessage.fast_mode_state = getFastModeState(inputs.model, inputs.fastMode);
2458
- return initMessage;
2459
- }
2460
-
2461
- // src/utils/ultraplan/keyword.ts
2462
- var OPEN_TO_CLOSE = {
2463
- "`": "`",
2464
- '"': '"',
2465
- "<": ">",
2466
- "{": "}",
2467
- "[": "]",
2468
- "(": ")",
2469
- "'": "'"
2470
- };
2471
- function findKeywordTriggerPositions(text, keyword) {
2472
- const re = new RegExp(keyword, "i");
2473
- if (!re.test(text))
2474
- return [];
2475
- if (text.startsWith("/"))
2476
- return [];
2477
- const quotedRanges = [];
2478
- let openQuote = null;
2479
- let openAt = 0;
2480
- const isWord = (ch) => !!ch && /[\p{L}\p{N}_]/u.test(ch);
2481
- for (let i = 0;i < text.length; i++) {
2482
- const ch = text[i];
2483
- if (openQuote) {
2484
- if (openQuote === "[" && ch === "[") {
2485
- openAt = i;
2486
- continue;
2487
- }
2488
- if (ch !== OPEN_TO_CLOSE[openQuote])
2489
- continue;
2490
- if (openQuote === "'" && isWord(text[i + 1]))
2491
- continue;
2492
- quotedRanges.push({ start: openAt, end: i + 1 });
2493
- openQuote = null;
2494
- } 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) {
2495
- openQuote = ch;
2496
- openAt = i;
2497
- }
2498
- }
2499
- const positions = [];
2500
- const wordRe = new RegExp(`\\b${keyword}\\b`, "gi");
2501
- const matches = text.matchAll(wordRe);
2502
- for (const match of matches) {
2503
- if (match.index === undefined)
2504
- continue;
2505
- const start = match.index;
2506
- const end = start + match[0].length;
2507
- if (quotedRanges.some((r) => start >= r.start && start < r.end))
2508
- continue;
2509
- const before = text[start - 1];
2510
- const after = text[end];
2511
- if (before === "/" || before === "\\" || before === "-")
2512
- continue;
2513
- if (after === "/" || after === "\\" || after === "-" || after === "?")
2514
- continue;
2515
- if (after === "." && isWord(text[end + 1]))
2516
- continue;
2517
- positions.push({ word: match[0], start, end });
2518
- }
2519
- return positions;
2520
- }
2521
- function findUltraplanTriggerPositions(text) {
2522
- return findKeywordTriggerPositions(text, "ultraplan");
2523
- }
2524
- function findUltrareviewTriggerPositions(text) {
2525
- return findKeywordTriggerPositions(text, "ultrareview");
2526
- }
2527
- function hasUltraplanKeyword(text) {
2528
- return findUltraplanTriggerPositions(text).length > 0;
2529
- }
2530
- function replaceUltraplanKeyword(text) {
2531
- const [trigger] = findUltraplanTriggerPositions(text);
2532
- if (!trigger)
2533
- return text;
2534
- const before = text.slice(0, trigger.start);
2535
- const after = text.slice(trigger.end);
2536
- if (!(before + after).trim())
2537
- return "";
2538
- return before + trigger.word.slice("ultra".length) + after;
2539
- }
2540
-
2541
- // src/utils/processUserInput/processUserInput.ts
2542
- init_analytics();
2543
- init_messages();
2544
- init_commands();
2545
- init_textInputTypes();
2546
- init_attachments();
2547
- init_generators();
2548
- init_hooks2();
2549
- init_imageResizer();
2550
- init_imageStore();
2551
- init_messages();
2552
- init_queryProfiler();
2553
- init_slashCommandParsing();
2554
- import { randomUUID as randomUUID5 } from "crypto";
2555
-
2556
- // src/utils/processUserInput/processTextPrompt.ts
2557
- init_state();
2558
- init_analytics();
2559
- init_messages();
2560
- init_events();
2561
- init_sessionTracing();
2562
- import { randomUUID as randomUUID4 } from "crypto";
2563
-
2564
- // src/utils/userPromptKeywords.ts
2565
- function matchesNegativeKeyword(input) {
2566
- const lowerInput = input.toLowerCase();
2567
- 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/;
2568
- return negativePattern.test(lowerInput);
2569
- }
2570
- function matchesKeepGoingKeyword(input) {
2571
- const lowerInput = input.toLowerCase().trim();
2572
- if (lowerInput === "continue") {
2573
- return true;
2574
- }
2575
- const keepGoingPattern = /\b(keep going|go on)\b/;
2576
- return keepGoingPattern.test(lowerInput);
2577
- }
2578
-
2579
- // src/utils/processUserInput/processTextPrompt.ts
2580
- function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta) {
2581
- const promptId = randomUUID4();
2582
- setPromptId(promptId);
2583
- const userPromptText = typeof input === "string" ? input : input.find((block) => block.type === "text")?.text || "";
2584
- startInteractionSpan(userPromptText);
2585
- const otelPromptText = typeof input === "string" ? input : input.findLast((block) => block.type === "text")?.text || "";
2586
- if (otelPromptText) {
2587
- logOTelEvent("user_prompt", {
2588
- prompt_length: String(otelPromptText.length),
2589
- prompt: redactIfDisabled(otelPromptText),
2590
- "prompt.id": promptId
2591
- });
2592
- }
2593
- const isNegative = matchesNegativeKeyword(userPromptText);
2594
- const isKeepGoing = matchesKeepGoingKeyword(userPromptText);
2595
- logEvent("tengu_input_prompt", {
2596
- is_negative: isNegative,
2597
- is_keep_going: isKeepGoing
2598
- });
2599
- if (imageContentBlocks.length > 0) {
2600
- const textContent = typeof input === "string" ? input.trim() ? [{ type: "text", text: input }] : [] : input;
2601
- const userMessage2 = createUserMessage({
2602
- content: [...textContent, ...imageContentBlocks],
2603
- uuid,
2604
- imagePasteIds: imagePasteIds.length > 0 ? imagePasteIds : undefined,
2605
- permissionMode,
2606
- isMeta: isMeta || undefined
2607
- });
2608
- return {
2609
- messages: [userMessage2, ...attachmentMessages],
2610
- shouldQuery: true
2611
- };
2612
- }
2613
- const userMessage = createUserMessage({
2614
- content: input,
2615
- uuid,
2616
- permissionMode,
2617
- isMeta: isMeta || undefined
2618
- });
2619
- return {
2620
- messages: [userMessage, ...attachmentMessages],
2621
- shouldQuery: true
2622
- };
2623
- }
2624
-
2625
- // src/utils/processUserInput/processUserInput.ts
2626
- async function processUserInput({
2627
- input,
2628
- preExpansionInput,
2629
- mode,
2630
- setToolJSX,
2631
- context,
2632
- pastedContents,
2633
- ideSelection,
2634
- messages,
2635
- setUserInputOnProcessing,
2636
- uuid,
2637
- isAlreadyProcessing,
2638
- querySource,
2639
- canUseTool,
2640
- skipSlashCommands,
2641
- bridgeOrigin,
2642
- isMeta,
2643
- skipAttachments
2644
- }) {
2645
- const inputString = typeof input === "string" ? input : null;
2646
- if (mode === "prompt" && inputString !== null && !isMeta) {
2647
- setUserInputOnProcessing?.(inputString);
2648
- }
2649
- queryCheckpoint("query_process_user_input_base_start");
2650
- const appState = context.getAppState();
2651
- const result = await processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput);
2652
- queryCheckpoint("query_process_user_input_base_end");
2653
- if (!result.shouldQuery) {
2654
- return result;
2655
- }
2656
- queryCheckpoint("query_hooks_start");
2657
- const inputMessage = getContentText(input) || "";
2658
- for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode, context, context.requestPrompt)) {
2659
- if (hookResult.message?.type === "progress") {
2660
- continue;
2661
- }
2662
- if (hookResult.blockingError) {
2663
- const blockingMessage = getUserPromptSubmitHookBlockingMessage(hookResult.blockingError);
2664
- return {
2665
- messages: [
2666
- createSystemMessage(`${blockingMessage}
2667
-
2668
- Original prompt: ${input}`, "warning")
2669
- ],
2670
- shouldQuery: false,
2671
- allowedTools: result.allowedTools
2672
- };
2673
- }
2674
- if (hookResult.preventContinuation) {
2675
- const message = hookResult.stopReason ? `Operation stopped by hook: ${hookResult.stopReason}` : "Operation stopped by hook";
2676
- result.messages.push(createUserMessage({
2677
- content: message
2678
- }));
2679
- result.shouldQuery = false;
2680
- return result;
2681
- }
2682
- if (hookResult.additionalContexts && hookResult.additionalContexts.length > 0) {
2683
- result.messages.push(createAttachmentMessage({
2684
- type: "hook_additional_context",
2685
- content: hookResult.additionalContexts.map(applyTruncation),
2686
- hookName: "UserPromptSubmit",
2687
- toolUseID: `hook-${randomUUID5()}`,
2688
- hookEvent: "UserPromptSubmit"
2689
- }));
2690
- }
2691
- if (hookResult.message) {
2692
- switch (hookResult.message.attachment.type) {
2693
- case "hook_success":
2694
- if (!hookResult.message.attachment.content) {
2695
- break;
2696
- }
2697
- result.messages.push({
2698
- ...hookResult.message,
2699
- attachment: {
2700
- ...hookResult.message.attachment,
2701
- content: applyTruncation(hookResult.message.attachment.content)
2702
- }
2703
- });
2704
- break;
2705
- default:
2706
- result.messages.push(hookResult.message);
2707
- break;
2708
- }
2709
- }
2710
- }
2711
- queryCheckpoint("query_hooks_end");
2712
- return result;
2713
- }
2714
- var MAX_HOOK_OUTPUT_LENGTH = 1e4;
2715
- function applyTruncation(content) {
2716
- if (content.length > MAX_HOOK_OUTPUT_LENGTH) {
2717
- return `${content.substring(0, MAX_HOOK_OUTPUT_LENGTH)}\u2026 [output truncated - exceeded ${MAX_HOOK_OUTPUT_LENGTH} characters]`;
2718
- }
2719
- return content;
2720
- }
2721
- async function processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput) {
2722
- let inputString = null;
2723
- let precedingInputBlocks = [];
2724
- const imageMetadataTexts = [];
2725
- let normalizedInput = input;
2726
- if (typeof input === "string") {
2727
- inputString = input;
2728
- } else if (input.length > 0) {
2729
- queryCheckpoint("query_image_processing_start");
2730
- const processedBlocks = [];
2731
- for (const block of input) {
2732
- if (block.type === "image") {
2733
- const resized = await maybeResizeAndDownsampleImageBlock(block);
2734
- if (resized.dimensions) {
2735
- const metadataText = createImageMetadataText(resized.dimensions);
2736
- if (metadataText) {
2737
- imageMetadataTexts.push(metadataText);
2738
- }
2739
- }
2740
- processedBlocks.push(resized.block);
2741
- } else {
2742
- processedBlocks.push(block);
2743
- }
2744
- }
2745
- normalizedInput = processedBlocks;
2746
- queryCheckpoint("query_image_processing_end");
2747
- const lastBlock = processedBlocks[processedBlocks.length - 1];
2748
- if (lastBlock?.type === "text") {
2749
- inputString = lastBlock.text;
2750
- precedingInputBlocks = processedBlocks.slice(0, -1);
2751
- } else {
2752
- precedingInputBlocks = processedBlocks;
2753
- }
2754
- }
2755
- if (inputString === null && mode !== "prompt") {
2756
- throw new Error(`Mode: ${mode} requires a string input.`);
2757
- }
2758
- const imageContents = pastedContents ? Object.values(pastedContents).filter(isValidImagePaste) : [];
2759
- const imagePasteIds = imageContents.map((img) => img.id);
2760
- const storedImagePaths = pastedContents ? await storeImages(pastedContents) : new Map;
2761
- queryCheckpoint("query_pasted_image_processing_start");
2762
- const imageProcessingResults = await Promise.all(imageContents.map(async (pastedImage) => {
2763
- const imageBlock = {
2764
- type: "image",
2765
- source: {
2766
- type: "base64",
2767
- media_type: pastedImage.mediaType || "image/png",
2768
- data: pastedImage.content
2769
- }
2770
- };
2771
- logEvent("tengu_pasted_image_resize_attempt", {
2772
- original_size_bytes: pastedImage.content.length
2773
- });
2774
- const resized = await maybeResizeAndDownsampleImageBlock(imageBlock);
2775
- return {
2776
- resized,
2777
- originalDimensions: pastedImage.dimensions,
2778
- sourcePath: pastedImage.sourcePath ?? storedImagePaths.get(pastedImage.id)
2779
- };
2780
- }));
2781
- const imageContentBlocks = [];
2782
- for (const {
2783
- resized,
2784
- originalDimensions,
2785
- sourcePath
2786
- } of imageProcessingResults) {
2787
- if (resized.dimensions) {
2788
- const metadataText = createImageMetadataText(resized.dimensions, sourcePath);
2789
- if (metadataText) {
2790
- imageMetadataTexts.push(metadataText);
2791
- }
2792
- } else if (originalDimensions) {
2793
- const metadataText = createImageMetadataText(originalDimensions, sourcePath);
2794
- if (metadataText) {
2795
- imageMetadataTexts.push(metadataText);
2796
- }
2797
- } else if (sourcePath) {
2798
- imageMetadataTexts.push(`[Image source: ${sourcePath}]`);
2799
- }
2800
- imageContentBlocks.push(resized.block);
2801
- }
2802
- queryCheckpoint("query_pasted_image_processing_end");
2803
- let effectiveSkipSlash = skipSlashCommands;
2804
- if (bridgeOrigin && inputString !== null && inputString.startsWith("/")) {
2805
- const parsed = parseSlashCommand(inputString);
2806
- const cmd = parsed ? findCommand(parsed.commandName, context.options.commands) : undefined;
2807
- if (cmd) {
2808
- if (isBridgeSafeCommand(cmd)) {
2809
- effectiveSkipSlash = false;
2810
- } else {
2811
- const msg = `/${getCommandName(cmd)} isn't available over Remote Control.`;
2812
- return {
2813
- messages: [
2814
- createUserMessage({ content: inputString, uuid }),
2815
- createCommandInputMessage(`<local-command-stdout>${msg}</local-command-stdout>`)
2816
- ],
2817
- shouldQuery: false,
2818
- resultText: msg
2819
- };
2820
- }
2821
- }
2822
- }
2823
- if (mode === "prompt" && !context.options.isNonInteractiveSession && inputString !== null && !effectiveSkipSlash && !inputString.startsWith("/") && !context.getAppState().ultraplanSessionUrl && !context.getAppState().ultraplanLaunching && hasUltraplanKeyword(preExpansionInput ?? inputString)) {
2824
- logEvent("tengu_ultraplan_keyword", {});
2825
- const rewritten = replaceUltraplanKeyword(inputString).trim();
2826
- const { processSlashCommand } = await import("./chunk-rshk7m9c.js");
2827
- const slashResult = await processSlashCommand(`/ultraplan ${rewritten}`, precedingInputBlocks, imageContentBlocks, [], context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
2828
- return addImageMetadataMessage(slashResult, imageMetadataTexts);
2829
- }
2830
- const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/"));
2831
- queryCheckpoint("query_attachment_loading_start");
2832
- const attachmentMessages = shouldExtractAttachments ? await toArray(getAttachmentMessages(inputString, context, ideSelection ?? null, [], messages, querySource)) : [];
2833
- queryCheckpoint("query_attachment_loading_end");
2834
- if (inputString !== null && mode === "bash") {
2835
- const { processBashCommand } = await import("./chunk-c1cm8km0.js");
2836
- return addImageMetadataMessage(await processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context, setToolJSX), imageMetadataTexts);
2837
- }
2838
- if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) {
2839
- const { processSlashCommand } = await import("./chunk-rshk7m9c.js");
2840
- const slashResult = await processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context, setToolJSX, uuid, isAlreadyProcessing, canUseTool);
2841
- return addImageMetadataMessage(slashResult, imageMetadataTexts);
2842
- }
2843
- if (inputString !== null && mode === "prompt") {
2844
- const trimmedInput = inputString.trim();
2845
- const agentMention = attachmentMessages.find((m) => m.attachment.type === "agent_mention");
2846
- if (agentMention) {
2847
- const agentMentionString = `@agent-${agentMention.attachment.agentType}`;
2848
- const isSubagentOnly = trimmedInput === agentMentionString;
2849
- const isPrefix = trimmedInput.startsWith(agentMentionString) && !isSubagentOnly;
2850
- logEvent("tengu_subagent_at_mention", {
2851
- is_subagent_only: isSubagentOnly,
2852
- is_prefix: isPrefix
2853
- });
2854
- }
2855
- }
2856
- return addImageMetadataMessage(processTextPrompt(normalizedInput, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta), imageMetadataTexts);
2857
- }
2858
- function addImageMetadataMessage(result, imageMetadataTexts) {
2859
- if (imageMetadataTexts.length > 0) {
2860
- result.messages.push(createUserMessage({
2861
- content: imageMetadataTexts.map((text) => ({ type: "text", text })),
2862
- isMeta: true
2863
- }));
2864
- }
2865
- return result;
2866
- }
2867
-
2868
1498
  // src/utils/plugins/reconciler.ts
2869
1499
  init_isEqual();
2870
1500
  init_state();
@@ -2994,4 +1624,4 @@ function normalizeSource(source, projectRoot) {
2994
1624
  return source;
2995
1625
  }
2996
1626
 
2997
- export { extractInboundMessageFields, sdkCompatToolName, buildSystemInitMessage, MessageSelector, selectableUserMessagesFilter, messagesAfterAreOnlySynthetic, exports_MessageSelector, init_MessageSelector, findUltraplanTriggerPositions, findUltrareviewTriggerPositions, processUserInput, outputSchema, permissionPromptToolResultToPermissionDecision, ndjsonSafeStringify, StructuredIO, diffMarketplaces, reconcileMarketplaces, getCronJitterConfig, exports_cronJitterConfig, init_cronJitterConfig, createCronScheduler, exports_cronScheduler, init_cronScheduler };
1627
+ export { extractInboundMessageFields, outputSchema, permissionPromptToolResultToPermissionDecision, ndjsonSafeStringify, StructuredIO, diffMarketplaces, reconcileMarketplaces, getCronJitterConfig, exports_cronJitterConfig, init_cronJitterConfig, createCronScheduler, exports_cronScheduler, init_cronScheduler };