@costrict/csc 4.1.1 → 4.1.2

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 (413) hide show
  1. package/dist/{chunk-456jxy81.js → chunk-03g34taj.js} +55 -52
  2. package/dist/{chunk-mdmh4hh4.js → chunk-04h1dzn8.js} +58 -55
  3. package/dist/{chunk-3xwn1ww1.js → chunk-04js9982.js} +14 -14
  4. package/dist/{chunk-gfsh3syp.js → chunk-0cm9fcaq.js} +4 -4
  5. package/dist/{chunk-fnjqn6ez.js → chunk-0d8p649e.js} +200 -1296
  6. package/dist/{chunk-vtwf9pyn.js → chunk-0ftbdtb6.js} +2 -2
  7. package/dist/{chunk-7kznscxn.js → chunk-0kv76cch.js} +69 -66
  8. package/dist/{chunk-cp4da168.js → chunk-0q8601fc.js} +56 -53
  9. package/dist/{chunk-vhnm2h49.js → chunk-0s2qjxt0.js} +2 -2
  10. package/dist/{chunk-wvexwzsv.js → chunk-0vjhwg78.js} +4 -4
  11. package/dist/{chunk-wvh4g9jt.js → chunk-0wfby4jk.js} +55 -52
  12. package/dist/{chunk-d9tcjh43.js → chunk-0wzfz235.js} +55 -52
  13. package/dist/{chunk-8py19hja.js → chunk-0z3swktk.js} +58 -55
  14. package/dist/{chunk-na7nxj7y.js → chunk-0zwtzj7s.js} +4 -4
  15. package/dist/{chunk-304wjbyj.js → chunk-12b1dsca.js} +3 -3
  16. package/dist/{chunk-c05zaj6g.js → chunk-172aq1cm.js} +3 -3
  17. package/dist/{chunk-emvhjwh9.js → chunk-1928vvnf.js} +16 -16
  18. package/dist/{chunk-3yc8k84c.js → chunk-1gta3pqg.js} +26 -1390
  19. package/dist/{chunk-wn11yvgy.js → chunk-1hr30g9j.js} +56 -53
  20. package/dist/{chunk-hyptxmaj.js → chunk-1ta87008.js} +13 -13
  21. package/dist/{chunk-pjvthvm1.js → chunk-1tsg5bqp.js} +7 -7
  22. package/dist/{chunk-9ey1xvcm.js → chunk-1xdybmyp.js} +2 -2
  23. package/dist/{chunk-bz6pjkch.js → chunk-1xqh8b38.js} +2 -2
  24. package/dist/{chunk-p2r92sj1.js → chunk-1z6393pz.js} +55 -52
  25. package/dist/{chunk-js10hr63.js → chunk-20rdctr8.js} +59 -56
  26. package/dist/{chunk-78kph36p.js → chunk-2278qvvz.js} +82 -69
  27. package/dist/{chunk-krmmbjp9.js → chunk-27rca2qk.js} +14 -14
  28. package/dist/{chunk-b1my2ag9.js → chunk-28p3x5mq.js} +58 -55
  29. package/dist/{chunk-5nnjgn3n.js → chunk-29n8fs0h.js} +3 -3
  30. package/dist/{chunk-4xbk1cv1.js → chunk-2bahqsy8.js} +5 -5
  31. package/dist/{chunk-b0hjzm3t.js → chunk-2d4az1sb.js} +1051 -213
  32. package/dist/{chunk-bbm8cs3b.js → chunk-2dtsff0m.js} +2 -2
  33. package/dist/{chunk-hjfabpxk.js → chunk-2dvsb5m8.js} +3 -3
  34. package/dist/{chunk-fkjqakzs.js → chunk-2ea63hn5.js} +55 -52
  35. package/dist/{chunk-tbx1hn1a.js → chunk-2heyngx7.js} +55 -52
  36. package/dist/{chunk-cb3vp4tb.js → chunk-2n4jnkr3.js} +5 -5
  37. package/dist/{chunk-04fesxxb.js → chunk-2npy5n4d.js} +3 -3
  38. package/dist/{chunk-5bw23taw.js → chunk-2yz7ej7r.js} +3 -3
  39. package/dist/{chunk-naenwsts.js → chunk-347n8wrb.js} +56 -53
  40. package/dist/{chunk-qzwja18r.js → chunk-365z3p8q.js} +4 -4
  41. package/dist/{chunk-pathr6ec.js → chunk-3ax3g4ky.js} +5 -5
  42. package/dist/{chunk-6nqv04m4.js → chunk-3c22f5y8.js} +4 -4
  43. package/dist/{chunk-5x884kq9.js → chunk-3ed5qycn.js} +59 -56
  44. package/dist/{chunk-ctw9a4hh.js → chunk-3hw6pcqt.js} +12 -12
  45. package/dist/chunk-3j0f3yyd.js +20 -0
  46. package/dist/{chunk-g2r5nsx7.js → chunk-3keyh8d3.js} +2 -2
  47. package/dist/{chunk-hegr0s7q.js → chunk-3n8prx9k.js} +3 -3
  48. package/dist/{chunk-cqnfwapm.js → chunk-3tnabt1t.js} +2 -2
  49. package/dist/{chunk-837h4x1j.js → chunk-3ydfy1vc.js} +2 -2
  50. package/dist/{chunk-1qw175nj.js → chunk-41ncbfk7.js} +3 -3
  51. package/dist/{chunk-60731s4z.js → chunk-45ynv6r6.js} +2 -2
  52. package/dist/chunk-46sfycpp.js +125 -0
  53. package/dist/{chunk-cg0h6vpf.js → chunk-496449vy.js} +2 -2
  54. package/dist/{chunk-qhpnsf4r.js → chunk-49z79885.js} +3 -3
  55. package/dist/{chunk-25j8nzw3.js → chunk-4c8mdzm1.js} +4 -4
  56. package/dist/{chunk-3dkccqes.js → chunk-4f56n8y8.js} +4 -4
  57. package/dist/{chunk-1mft5mam.js → chunk-4ffz1d36.js} +4 -4
  58. package/dist/{chunk-4zqzdz62.js → chunk-4hgk89n9.js} +59 -56
  59. package/dist/{chunk-exag2njg.js → chunk-4k4kn7h2.js} +18 -18
  60. package/dist/{chunk-1yzryj0w.js → chunk-4ks3c21q.js} +64 -61
  61. package/dist/{chunk-e29wgmh7.js → chunk-4v3p8phf.js} +15 -15
  62. package/dist/chunk-4vzg1cn7.js +264 -0
  63. package/dist/{chunk-cxktxwv9.js → chunk-4xp653hr.js} +55 -52
  64. package/dist/{chunk-r1sfk1j6.js → chunk-4zvptd40.js} +60 -57
  65. package/dist/{chunk-v2gsemps.js → chunk-503675yy.js} +2 -2
  66. package/dist/{chunk-gf3t5h70.js → chunk-52d0caw3.js} +58 -55
  67. package/dist/{chunk-x0vsajns.js → chunk-56speggn.js} +3 -3
  68. package/dist/{chunk-rhndt0ek.js → chunk-58jcwxyh.js} +14 -14
  69. package/dist/{chunk-pv7jrynh.js → chunk-5bd0sf0q.js} +2 -2
  70. package/dist/chunk-5cxetff3.js +443 -0
  71. package/dist/{chunk-q0j190dz.js → chunk-5dm3xwms.js} +6 -6
  72. package/dist/{chunk-gn0d6g6p.js → chunk-5e4sk6wr.js} +3 -3
  73. package/dist/{chunk-a66xp7jk.js → chunk-5fny1a0a.js} +37 -13
  74. package/dist/{chunk-57h3kd2w.js → chunk-5hn85d4q.js} +58 -55
  75. package/dist/{chunk-jxefgv2b.js → chunk-5p3bwhcw.js} +5 -5
  76. package/dist/{chunk-09af0bmq.js → chunk-5r57a99p.js} +15 -15
  77. package/dist/{chunk-egv3k4gg.js → chunk-5thf5z45.js} +136 -44
  78. package/dist/chunk-5vbtjcd2.js +624 -0
  79. package/dist/{chunk-jpd98chs.js → chunk-5w9qcjjt.js} +61 -58
  80. package/dist/{chunk-wvevgh1a.js → chunk-5xj3z42h.js} +5 -5
  81. package/dist/{chunk-0hr0mh6d.js → chunk-62r8rxkw.js} +4 -4
  82. package/dist/chunk-64wm5777.js +85 -0
  83. package/dist/{chunk-sk9mmh7x.js → chunk-6a32d602.js} +55 -52
  84. package/dist/{chunk-1wxx3s6s.js → chunk-6aevda19.js} +2 -2
  85. package/dist/{chunk-2km8scdk.js → chunk-6bb0gyhh.js} +55 -52
  86. package/dist/{chunk-ancr20tb.js → chunk-6d9njm1w.js} +2 -2
  87. package/dist/{chunk-p3erbvbz.js → chunk-6fbvxhan.js} +3 -3
  88. package/dist/{chunk-7t9j97cz.js → chunk-6kddkcqk.js} +57 -54
  89. package/dist/{chunk-7nyptyee.js → chunk-6sytfk68.js} +5 -5
  90. package/dist/{chunk-8z5fmqh3.js → chunk-6ypvw68g.js} +55 -52
  91. package/dist/{chunk-z763jd56.js → chunk-6zkxtny0.js} +4 -4
  92. package/dist/{chunk-p60wnp9a.js → chunk-6zn0szv5.js} +19 -17
  93. package/dist/{chunk-s3tdz6j0.js → chunk-71053xes.js} +14 -14
  94. package/dist/chunk-758qmraw.js +66 -0
  95. package/dist/{chunk-25a6cm96.js → chunk-76g1m8sa.js} +16 -4
  96. package/dist/{chunk-xgjs3rkr.js → chunk-7b1ze28c.js} +55 -52
  97. package/dist/{chunk-a3m8brwc.js → chunk-7bq6az8b.js} +3 -3
  98. package/dist/{chunk-yjmtjd5c.js → chunk-7ckqn3c3.js} +55 -52
  99. package/dist/chunk-7d5gzxsx.js +145 -0
  100. package/dist/{chunk-rv57x1qr.js → chunk-7gyjd00q.js} +3 -3
  101. package/dist/{chunk-hn438x41.js → chunk-7hnmt967.js} +84 -80
  102. package/dist/{chunk-rmfp4mf2.js → chunk-7jbeh3g8.js} +3 -3
  103. package/dist/{chunk-kymq7j5k.js → chunk-7k0h27s8.js} +7 -7
  104. package/dist/{chunk-2fnpj7fv.js → chunk-7myptjaa.js} +5 -5
  105. package/dist/{chunk-s81bx611.js → chunk-7yq22pd2.js} +57 -54
  106. package/dist/{chunk-dk8te1zz.js → chunk-7zxvjs3d.js} +2 -2
  107. package/dist/{chunk-mwky1mwc.js → chunk-83v18n96.js} +14 -14
  108. package/dist/{chunk-f1az36w2.js → chunk-84a79s9g.js} +124 -150
  109. package/dist/{chunk-x0nt6xta.js → chunk-86n03xsk.js} +60 -57
  110. package/dist/{chunk-4aqc3s2f.js → chunk-87ddk39d.js} +6 -6
  111. package/dist/{chunk-vnsmwwcx.js → chunk-89jrgnx3.js} +15 -15
  112. package/dist/{chunk-3fs4xc9h.js → chunk-8dehkx39.js} +5 -5
  113. package/dist/{chunk-wwt8x57q.js → chunk-8fm77brm.js} +59 -56
  114. package/dist/{chunk-z9ezvde9.js → chunk-8fqa9v4h.js} +55 -52
  115. package/dist/{chunk-etqmgb7b.js → chunk-8pqe4w62.js} +62 -59
  116. package/dist/{chunk-xqzmd8rx.js → chunk-8qp0ytjr.js} +2 -2
  117. package/dist/{chunk-xt7g86gj.js → chunk-8v8n8gxv.js} +3 -3
  118. package/dist/{chunk-jq30e6rg.js → chunk-94jqjx3g.js} +59 -56
  119. package/dist/chunk-9663bsk0.js +18 -0
  120. package/dist/{chunk-dnp096zb.js → chunk-96gwphgv.js} +3 -3
  121. package/dist/{chunk-sq5fyhqd.js → chunk-9bf696cj.js} +95 -87
  122. package/dist/{chunk-eje4tzhm.js → chunk-9cw6etxe.js} +56 -53
  123. package/dist/{chunk-r7a5cqdw.js → chunk-9dwdn2sk.js} +7 -7
  124. package/dist/{chunk-ejfvtxhc.js → chunk-9ggwn844.js} +29 -64
  125. package/dist/{chunk-n08zma6t.js → chunk-9gxdrrd5.js} +55 -52
  126. package/dist/{chunk-cvr6at4f.js → chunk-9q952pw0.js} +2 -2
  127. package/dist/{chunk-ab8c2gs2.js → chunk-9qgzdk8y.js} +7 -7
  128. package/dist/{chunk-tjc1tx3q.js → chunk-9qj9t1g4.js} +2 -2
  129. package/dist/{chunk-hm9rq604.js → chunk-9sr5cheh.js} +55 -52
  130. package/dist/{chunk-3tm5sns7.js → chunk-9vvffdb6.js} +64 -61
  131. package/dist/chunk-a18ypbnr.js +151 -0
  132. package/dist/{chunk-80yycsam.js → chunk-a80y3b1p.js} +3 -3
  133. package/dist/{chunk-bdhx8k7k.js → chunk-a96dsyhm.js} +59 -56
  134. package/dist/{chunk-pgjmgh51.js → chunk-a97kj439.js} +2 -2
  135. package/dist/chunk-aggcq5pt.js +16 -0
  136. package/dist/{chunk-5wvcws9f.js → chunk-am5zfwnf.js} +19 -19
  137. package/dist/{chunk-56djb736.js → chunk-b21j3y4h.js} +2 -2
  138. package/dist/{chunk-jdvx0xe9.js → chunk-b52sketm.js} +55 -52
  139. package/dist/{chunk-xzw0ettz.js → chunk-b7fcydvv.js} +18 -18
  140. package/dist/{chunk-y90gh0z2.js → chunk-bb9h35x7.js} +55 -52
  141. package/dist/{chunk-07vfsvas.js → chunk-bbpnmz87.js} +2 -2
  142. package/dist/chunk-bcfd2zw7.js +23 -0
  143. package/dist/chunk-bdy3869e.js +35 -0
  144. package/dist/{chunk-g6vvs0w9.js → chunk-be8pcep0.js} +2 -2
  145. package/dist/{chunk-2vfcftww.js → chunk-bgpftrxc.js} +56 -53
  146. package/dist/{chunk-ne02d12y.js → chunk-bh4k9q9y.js} +4 -4
  147. package/dist/{chunk-841eka5g.js → chunk-bjc8f709.js} +62 -59
  148. package/dist/{chunk-00f3aac0.js → chunk-bm5370d5.js} +14 -14
  149. package/dist/{chunk-kfdgw9j2.js → chunk-br1qf4bc.js} +12 -21
  150. package/dist/{chunk-vempyean.js → chunk-bxmc7435.js} +7 -7
  151. package/dist/chunk-c36xznt7.js +1045 -0
  152. package/dist/{chunk-cjg9tm4d.js → chunk-c3z2f4aq.js} +58 -55
  153. package/dist/chunk-cchv4yn8.js +214 -0
  154. package/dist/{chunk-qdfqack5.js → chunk-cewbt8ah.js} +2 -2
  155. package/dist/{chunk-7npzwf36.js → chunk-cfeakba6.js} +55 -52
  156. package/dist/{chunk-5c1ym1nc.js → chunk-ckh1zt0n.js} +65 -62
  157. package/dist/{chunk-xcm658wm.js → chunk-ckq5d8ev.js} +3 -3
  158. package/dist/chunk-cnfzmqr8.js +115 -0
  159. package/dist/chunk-crchz5q8.js +16 -0
  160. package/dist/{chunk-mf1n757j.js → chunk-cwpxrn2d.js} +17 -17
  161. package/dist/chunk-cy223s48.js +881 -0
  162. package/dist/{chunk-7c4fsh0s.js → chunk-cydd546q.js} +57 -54
  163. package/dist/{chunk-a35q4knx.js → chunk-cz5ycdta.js} +3 -3
  164. package/dist/{chunk-k8a68cwg.js → chunk-da7f9a81.js} +105 -29
  165. package/dist/{chunk-kexhnah5.js → chunk-dfzfxt1y.js} +7 -7
  166. package/dist/{chunk-4c56f6d2.js → chunk-dj6y2sr8.js} +3 -3
  167. package/dist/{chunk-cph4yr50.js → chunk-djbawqmw.js} +55 -52
  168. package/dist/{chunk-17j9hb87.js → chunk-dpb1kvb9.js} +56 -53
  169. package/dist/{chunk-xn02xqxj.js → chunk-dt5c48mh.js} +2 -2
  170. package/dist/{chunk-yephhrfa.js → chunk-e1m95nec.js} +6 -6
  171. package/dist/{chunk-bxfv6aew.js → chunk-e26hypm4.js} +56 -53
  172. package/dist/{chunk-a9garrrp.js → chunk-e5kn4hwp.js} +56 -53
  173. package/dist/{chunk-tn5b34gd.js → chunk-e6dq8apj.js} +55 -52
  174. package/dist/{chunk-rqn40hvy.js → chunk-e6p5x2p4.js} +4 -4
  175. package/dist/{chunk-5yjm9yth.js → chunk-eb6x30zz.js} +57 -54
  176. package/dist/{chunk-352yw5fs.js → chunk-ebfv6acv.js} +12 -12
  177. package/dist/{chunk-1h952cez.js → chunk-egkwv0bp.js} +2 -2
  178. package/dist/{chunk-rqfzhr9m.js → chunk-ennzq1s5.js} +14 -4
  179. package/dist/{chunk-ec3vxfsp.js → chunk-envqyd27.js} +59 -55
  180. package/dist/{chunk-yk99hmx2.js → chunk-epprxdgg.js} +2 -2
  181. package/dist/{chunk-cea3mepz.js → chunk-et42fzf1.js} +22 -22
  182. package/dist/{chunk-h0rbjg6x.js → chunk-f2mhrmww.js} +10 -3
  183. package/dist/{chunk-rg3c0e6m.js → chunk-fb5ehysd.js} +57 -54
  184. package/dist/chunk-fbtp7vga.js +37 -0
  185. package/dist/{chunk-n3xd3ev4.js → chunk-fgna18nd.js} +6 -6
  186. package/dist/{chunk-26w1pqen.js → chunk-fknjgxt4.js} +56 -53
  187. package/dist/{chunk-xj7nr4b8.js → chunk-fpb43g1s.js} +6 -6
  188. package/dist/{chunk-d24kfzcv.js → chunk-ftfz2eh3.js} +2 -2
  189. package/dist/{chunk-xbc1xb90.js → chunk-fv94gm4h.js} +56 -53
  190. package/dist/{chunk-732ycv3a.js → chunk-fx7pr1g4.js} +13 -13
  191. package/dist/{chunk-fxg6tk9f.js → chunk-g0axk7cx.js} +56 -53
  192. package/dist/chunk-g6d9avms.js +205 -0
  193. package/dist/{chunk-vwpr34gb.js → chunk-g9caj6wj.js} +66 -63
  194. package/dist/{chunk-jjjrmgee.js → chunk-gbekxw41.js} +56 -53
  195. package/dist/{chunk-dawa3bxd.js → chunk-gcpc6b2z.js} +2 -2
  196. package/dist/{chunk-7qq9wgng.js → chunk-gfycetpg.js} +5 -5
  197. package/dist/{chunk-snjbtcsd.js → chunk-gn0ja3k5.js} +5 -5
  198. package/dist/{chunk-cf98rrym.js → chunk-gt9gwwdh.js} +5 -5
  199. package/dist/{chunk-1qdm27em.js → chunk-gz0nj0mm.js} +55 -52
  200. package/dist/{chunk-jcfp9q8e.js → chunk-gz6pze8f.js} +57 -54
  201. package/dist/{chunk-kankxtem.js → chunk-h1frxdrg.js} +56 -54
  202. package/dist/{chunk-t8bj4y17.js → chunk-h93ve2g2.js} +14 -14
  203. package/dist/{chunk-b00v4z7e.js → chunk-h9mr8ey4.js} +13 -13
  204. package/dist/{chunk-fgfvmggw.js → chunk-hd8ydnzq.js} +15 -15
  205. package/dist/{chunk-szkay129.js → chunk-hebz2z6z.js} +58 -55
  206. package/dist/chunk-hgxb4qn5.js +390 -0
  207. package/dist/{chunk-h1e34028.js → chunk-hh6kgtq5.js} +3 -3
  208. package/dist/{chunk-srrcngcy.js → chunk-hhcx2jjn.js} +3 -3
  209. package/dist/{chunk-dvp0xagf.js → chunk-hjp1yckp.js} +56 -53
  210. package/dist/{chunk-jsfytv0f.js → chunk-hjxz7a04.js} +58 -55
  211. package/dist/{chunk-zdnv8fvz.js → chunk-hkkz8rde.js} +55 -52
  212. package/dist/{chunk-677p38pg.js → chunk-hnms0snx.js} +2 -2
  213. package/dist/{chunk-yydr31ss.js → chunk-hq4jd1fy.js} +23 -23
  214. package/dist/{chunk-gqxam9dm.js → chunk-hthfhdty.js} +15 -15
  215. package/dist/{chunk-98204r0v.js → chunk-hy5vd50e.js} +3 -3
  216. package/dist/{chunk-ck1qvj5k.js → chunk-hyztfnyq.js} +463 -225
  217. package/dist/{chunk-m4wfythr.js → chunk-j5rnevxw.js} +62 -59
  218. package/dist/{chunk-eeee4v34.js → chunk-j74ctwq9.js} +3 -3
  219. package/dist/{chunk-d9tbq3h3.js → chunk-jcdv05ym.js} +33 -5
  220. package/dist/{chunk-ga5v18wb.js → chunk-jd5xs374.js} +55 -52
  221. package/dist/{chunk-rz56zge4.js → chunk-jgbz49jh.js} +6 -4
  222. package/dist/{chunk-y9g1ynzy.js → chunk-jhdtyhk5.js} +57 -54
  223. package/dist/{chunk-aq0t16sn.js → chunk-jkbkp0ek.js} +14 -14
  224. package/dist/{chunk-7nwehwa4.js → chunk-jkyn6ge9.js} +5 -5
  225. package/dist/{chunk-nb02zd8m.js → chunk-jn7qa13m.js} +3 -3
  226. package/dist/{chunk-evmvnppx.js → chunk-jt7ea6rq.js} +55 -52
  227. package/dist/{chunk-9khxkxz7.js → chunk-jt7wch8z.js} +2 -2
  228. package/dist/{chunk-0j3jy5jp.js → chunk-jv7tn7yh.js} +55 -52
  229. package/dist/chunk-jx80x2sn.js +267 -0
  230. package/dist/{chunk-03fdnx3e.js → chunk-jy13c47g.js} +5 -5
  231. package/dist/{chunk-75q1d027.js → chunk-k11m1rfc.js} +57 -54
  232. package/dist/{chunk-x7t8wrq1.js → chunk-k3mghke5.js} +57 -86
  233. package/dist/{chunk-jcd8qmcc.js → chunk-k5rrrd0q.js} +78 -75
  234. package/dist/{chunk-8zdrypte.js → chunk-kbbjfeb8.js} +2 -2
  235. package/dist/chunk-kcz5b7xv.js +73 -0
  236. package/dist/{chunk-87s3zt6w.js → chunk-khnxj5vx.js} +3 -3
  237. package/dist/{chunk-g6eqgh16.js → chunk-kkwym2b7.js} +5 -5
  238. package/dist/{chunk-hvve83a7.js → chunk-kn345s2x.js} +2 -2
  239. package/dist/{chunk-x07xwqrj.js → chunk-kpqx95pr.js} +2 -2
  240. package/dist/{chunk-wfyhm9cg.js → chunk-kszphewb.js} +63 -54
  241. package/dist/{chunk-5kcmmrbe.js → chunk-kxn6mzy3.js} +4 -4
  242. package/dist/{chunk-tc848afj.js → chunk-m0zzdgkt.js} +31 -26
  243. package/dist/{chunk-gmsb3jtb.js → chunk-m7qa1fqb.js} +3 -3
  244. package/dist/{chunk-qph8gdxy.js → chunk-mdm5cbxy.js} +55 -52
  245. package/dist/chunk-mnqvtfd5.js +78 -0
  246. package/dist/{chunk-fstr76j0.js → chunk-mp5km99q.js} +20 -20
  247. package/dist/{chunk-8ehewpj6.js → chunk-mpxcgg5f.js} +6 -6
  248. package/dist/{chunk-zffnk5t6.js → chunk-mqr18cwx.js} +4 -4
  249. package/dist/chunk-n014czx3.js +18 -0
  250. package/dist/{chunk-ytzqmbt0.js → chunk-n40kbp9f.js} +55 -52
  251. package/dist/{chunk-8n28z1eg.js → chunk-n51s6m60.js} +14 -14
  252. package/dist/{chunk-c9gga8sn.js → chunk-n87c314c.js} +56 -53
  253. package/dist/{chunk-7jkb3tck.js → chunk-nevf0mb9.js} +15 -15
  254. package/dist/{chunk-zxhtrvtt.js → chunk-nkeknzb2.js} +4 -4
  255. package/dist/{chunk-4fjgdmr9.js → chunk-nkgq6a5q.js} +28 -28
  256. package/dist/{chunk-9ds6nhgx.js → chunk-nmj9qx2x.js} +65 -62
  257. package/dist/{chunk-4pf098nn.js → chunk-nmyfe9j9.js} +57 -54
  258. package/dist/{chunk-b1dyfwm2.js → chunk-nmzy0qjn.js} +7 -7
  259. package/dist/{chunk-51pkqrja.js → chunk-np05dg07.js} +55 -52
  260. package/dist/{chunk-w51sng2s.js → chunk-npgyhaqc.js} +2 -2
  261. package/dist/{chunk-61008xjm.js → chunk-nr2skyv7.js} +56 -53
  262. package/dist/{chunk-w6x102n9.js → chunk-nv5rddp1.js} +55 -52
  263. package/dist/{chunk-naqmbswb.js → chunk-p10xajeq.js} +69 -66
  264. package/dist/{chunk-vgzdtvca.js → chunk-p1wxbhgj.js} +4 -4
  265. package/dist/{chunk-rs2skqcv.js → chunk-p6fhtt1h.js} +4 -4
  266. package/dist/{chunk-m5daf1hp.js → chunk-p8d1q69a.js} +55 -52
  267. package/dist/{chunk-t66dy38x.js → chunk-pbmy8ktp.js} +7 -7
  268. package/dist/{chunk-ssnp42gc.js → chunk-pqrb30bj.js} +2 -2
  269. package/dist/{chunk-6dhkeb6t.js → chunk-pr321r8d.js} +3 -3
  270. package/dist/{chunk-7d5yfjs6.js → chunk-psq9gtg7.js} +2 -2
  271. package/dist/{chunk-193vfma7.js → chunk-ptermrp1.js} +60 -57
  272. package/dist/{chunk-q9fppwnq.js → chunk-pyfrphvc.js} +57 -54
  273. package/dist/{chunk-vajyw4ea.js → chunk-pzb2zc4x.js} +6 -6
  274. package/dist/{chunk-k1pjc56n.js → chunk-q0w614e1.js} +3 -3
  275. package/dist/{chunk-34merw4c.js → chunk-q110twdj.js} +59 -116
  276. package/dist/{chunk-je4jw9pe.js → chunk-q72dtjqy.js} +2 -2
  277. package/dist/{chunk-551jxdwj.js → chunk-q90bcq6v.js} +59 -56
  278. package/dist/{chunk-sm0ak846.js → chunk-qavfmmqd.js} +6 -6
  279. package/dist/{chunk-qvzvzzdw.js → chunk-qjx52q61.js} +2 -2
  280. package/dist/{chunk-72cez8rw.js → chunk-qk2tvn8y.js} +56 -53
  281. package/dist/{chunk-mt0hyhtp.js → chunk-qm3k6vez.js} +13 -13
  282. package/dist/{chunk-fkpm0dka.js → chunk-qmp50hjb.js} +19 -19
  283. package/dist/{chunk-qezmm114.js → chunk-qnztz65r.js} +56 -53
  284. package/dist/{chunk-23nwpyay.js → chunk-qpatv1ep.js} +13 -13
  285. package/dist/{chunk-dsdbya1y.js → chunk-qwtfyr6d.js} +2 -2
  286. package/dist/{chunk-nz9rqw9y.js → chunk-qxp3d963.js} +2 -2
  287. package/dist/{chunk-xq92sh7h.js → chunk-qzp51m93.js} +3 -3
  288. package/dist/{chunk-8dtk8ma2.js → chunk-r3fadmd6.js} +5 -5
  289. package/dist/{chunk-9eervnn3.js → chunk-r4mec6w5.js} +3 -3
  290. package/dist/chunk-r6g3xx75.js +415 -0
  291. package/dist/{chunk-avaa7ds2.js → chunk-r8ywba1h.js} +14 -14
  292. package/dist/{chunk-raftjwkd.js → chunk-r974358t.js} +13 -13
  293. package/dist/{chunk-w4bqdhna.js → chunk-r9qnxgqt.js} +5 -5
  294. package/dist/{chunk-7v874g5h.js → chunk-rasdgp8g.js} +4 -4
  295. package/dist/{chunk-dwkc1vgf.js → chunk-rbr0tsrz.js} +55 -52
  296. package/dist/{chunk-63hz4ckd.js → chunk-re5p7q2e.js} +4 -4
  297. package/dist/{chunk-gytaebn1.js → chunk-rfvzhq5x.js} +55 -52
  298. package/dist/{chunk-s4akexsk.js → chunk-rfxctace.js} +3 -4
  299. package/dist/chunk-rhqffqzf.js +189 -0
  300. package/dist/{chunk-xb6r5wtg.js → chunk-rnjtkqzg.js} +4 -4
  301. package/dist/{chunk-wpm7sbfe.js → chunk-rqa3fz1t.js} +55 -52
  302. package/dist/{chunk-y7q1vtv4.js → chunk-rtgff67y.js} +63 -60
  303. package/dist/{chunk-q4v51jm6.js → chunk-rw1070pc.js} +4 -4
  304. package/dist/{chunk-cxkxps51.js → chunk-rzrm7j9x.js} +2 -2
  305. package/dist/{chunk-spd5z6xd.js → chunk-s262tfgm.js} +3 -3
  306. package/dist/{chunk-9tkrb3jy.js → chunk-s4pjm9jw.js} +55 -52
  307. package/dist/chunk-s5pnejsn.js +216 -0
  308. package/dist/{chunk-4157n57z.js → chunk-sczmmmvj.js} +2 -2
  309. package/dist/{chunk-7h13c72t.js → chunk-sd2g0s0k.js} +9 -9
  310. package/dist/{chunk-rnsws47e.js → chunk-sg5nsm4p.js} +3 -3
  311. package/dist/{chunk-7cgjgppb.js → chunk-stqsfa68.js} +3 -3
  312. package/dist/{chunk-hdx2p9h7.js → chunk-svb5eqfz.js} +14 -14
  313. package/dist/{chunk-ybzc4vyc.js → chunk-swr65v0j.js} +10 -10
  314. package/dist/{chunk-dkzq1yj3.js → chunk-swtk97hy.js} +14 -14
  315. package/dist/{chunk-qy3bd939.js → chunk-sx4gbak5.js} +56 -53
  316. package/dist/{chunk-p83fdzct.js → chunk-t12d6tby.js} +3 -3
  317. package/dist/{chunk-v91g64jx.js → chunk-t20f5mnk.js} +14 -14
  318. package/dist/{chunk-g410gawd.js → chunk-t408adb9.js} +56 -53
  319. package/dist/{chunk-4k2ztys5.js → chunk-t7434h4s.js} +55 -52
  320. package/dist/{chunk-0qa1hgxp.js → chunk-t7y6mg54.js} +13 -13
  321. package/dist/{chunk-a9pqw4tk.js → chunk-tdkwcv57.js} +4 -4
  322. package/dist/{chunk-sqnghamc.js → chunk-tfew976a.js} +55 -52
  323. package/dist/{chunk-83m8mxaj.js → chunk-thzmxfnt.js} +2 -2
  324. package/dist/{chunk-gwfv9a10.js → chunk-tmedrj3f.js} +4 -4
  325. package/dist/{chunk-j9q7p2m5.js → chunk-tmscbs2k.js} +4 -4
  326. package/dist/chunk-tnk7s4ed.js +22 -0
  327. package/dist/{chunk-dw1cwmt3.js → chunk-tnqjynvy.js} +14 -14
  328. package/dist/{chunk-ztqe8k2y.js → chunk-tq32b105.js} +3 -3
  329. package/dist/{chunk-hp6ym2xt.js → chunk-tr448vwb.js} +3 -3
  330. package/dist/{chunk-xdfcfm69.js → chunk-tr4hszme.js} +3 -3
  331. package/dist/{chunk-5nzjxkj9.js → chunk-traxf72w.js} +2 -2
  332. package/dist/{chunk-f2d9gmzw.js → chunk-ttzyw0y7.js} +17 -17
  333. package/dist/{chunk-y1cqsd0p.js → chunk-tw0b366n.js} +55 -52
  334. package/dist/{chunk-ng7nkgv1.js → chunk-txync4kd.js} +7 -7
  335. package/dist/chunk-v060k07j.js +416 -0
  336. package/dist/chunk-v1rkrwwv.js +146 -0
  337. package/dist/{chunk-0p6e05c5.js → chunk-v21ssxkp.js} +2 -2
  338. package/dist/{chunk-zpte5txk.js → chunk-v2vzfj4h.js} +55 -52
  339. package/dist/{chunk-3s7v8tsk.js → chunk-v4h7dscd.js} +26 -44
  340. package/dist/{chunk-90qefxa4.js → chunk-v522k1r4.js} +70 -67
  341. package/dist/{chunk-rdmen6bn.js → chunk-v9b2rh8h.js} +58 -55
  342. package/dist/{chunk-g8e4wwak.js → chunk-vacje5g9.js} +4 -4
  343. package/dist/{chunk-t2r4qham.js → chunk-vetj2j2n.js} +60 -57
  344. package/dist/{chunk-fr84aysg.js → chunk-vpn54vqg.js} +6 -6
  345. package/dist/{chunk-yvsb81fm.js → chunk-vqhgs52z.js} +7 -7
  346. package/dist/{chunk-t802hx06.js → chunk-vtnm80k9.js} +13 -13
  347. package/dist/{chunk-dmsc23kp.js → chunk-vvk6wx6b.js} +14 -14
  348. package/dist/{chunk-t9z3edw6.js → chunk-vym5zrn6.js} +4895 -2486
  349. package/dist/{chunk-pxzawaw7.js → chunk-vzxtxv4a.js} +56 -53
  350. package/dist/{chunk-x59dmzab.js → chunk-w3wdqhv0.js} +62 -59
  351. package/dist/{chunk-61xprjs1.js → chunk-w59jkye4.js} +56 -53
  352. package/dist/{chunk-amnaevyb.js → chunk-w60fa5cj.js} +65 -62
  353. package/dist/{chunk-16waz3fy.js → chunk-w8xchcwf.js} +3 -3
  354. package/dist/{chunk-fv8tcte1.js → chunk-w9fptpp9.js} +64 -61
  355. package/dist/{chunk-3d8ccn91.js → chunk-wa7g3yv7.js} +13 -13
  356. package/dist/{chunk-wbwzf5z4.js → chunk-wdn3pb9r.js} +3 -3
  357. package/dist/{chunk-ccqk19v9.js → chunk-wqk03hpc.js} +55 -52
  358. package/dist/{chunk-ycjjsnm4.js → chunk-wvs8wv8t.js} +2 -2
  359. package/dist/{chunk-6hnqaxvs.js → chunk-wwfe7gg7.js} +58 -55
  360. package/dist/{chunk-nmaxmbg9.js → chunk-wz18c465.js} +4 -4
  361. package/dist/{chunk-08wf7txh.js → chunk-wz34c685.js} +15 -15
  362. package/dist/{chunk-587dvnad.js → chunk-wzzaxwej.js} +2 -2
  363. package/dist/chunk-x1wk407b.js +516 -0
  364. package/dist/{chunk-jysm93mk.js → chunk-x2taqvwd.js} +5 -5
  365. package/dist/{chunk-dt0y1vkc.js → chunk-x41dz9y9.js} +2 -2
  366. package/dist/chunk-x48x54hx.js +3942 -0
  367. package/dist/{chunk-q0ks2prw.js → chunk-x6cjkxqe.js} +5 -5
  368. package/dist/{chunk-f6v5bq78.js → chunk-x89sscn0.js} +2 -2
  369. package/dist/chunk-x9qqj8wc.js +153 -0
  370. package/dist/{chunk-6ka2mh69.js → chunk-xa9xpah3.js} +3037 -2505
  371. package/dist/{chunk-644422j5.js → chunk-xcxcysx3.js} +2 -2
  372. package/dist/{chunk-0fq3smhy.js → chunk-xftqvncz.js} +9 -46
  373. package/dist/{chunk-hnh89cye.js → chunk-xhnmweqe.js} +64 -61
  374. package/dist/{chunk-7s3wyn34.js → chunk-xm6t6khx.js} +56 -53
  375. package/dist/chunk-xt65mfby.js +1395 -0
  376. package/dist/{chunk-31fcazbn.js → chunk-xvmtyz8q.js} +2 -2
  377. package/dist/{chunk-1mf9624z.js → chunk-xxfz08mf.js} +55 -52
  378. package/dist/{chunk-wgvazba2.js → chunk-y061xbn9.js} +5 -5
  379. package/dist/{chunk-mzh12ebc.js → chunk-y0z468z2.js} +56 -53
  380. package/dist/{chunk-7ghq231e.js → chunk-y3cshvgb.js} +2 -2
  381. package/dist/{chunk-kqt7same.js → chunk-y6ce2s1q.js} +59 -55
  382. package/dist/chunk-y9bpc4a6.js +97 -0
  383. package/dist/{chunk-8c4wbrma.js → chunk-y9mnawak.js} +4 -4
  384. package/dist/{chunk-whbkstfm.js → chunk-ycdbp5q4.js} +55 -52
  385. package/dist/{chunk-1dg4nrws.js → chunk-ycsh7pst.js} +13 -13
  386. package/dist/{chunk-s41zt5kj.js → chunk-yedzdc0a.js} +14 -8
  387. package/dist/{chunk-jw0ky94p.js → chunk-yrr4d26k.js} +56 -53
  388. package/dist/{chunk-myysj9vz.js → chunk-yt5gwdg5.js} +7 -60
  389. package/dist/{chunk-yaefwx7d.js → chunk-yteefw26.js} +55 -52
  390. package/dist/{chunk-rhjbecsk.js → chunk-yvjzex9w.js} +6 -82
  391. package/dist/{chunk-5n19f2r9.js → chunk-z124zj20.js} +4 -4
  392. package/dist/{chunk-sa5fj0d3.js → chunk-z92c7wdq.js} +4 -4
  393. package/dist/{chunk-etcypdxa.js → chunk-zb7ctc11.js} +55 -52
  394. package/dist/{chunk-2wbgexnn.js → chunk-zc2mfxy0.js} +58 -55
  395. package/dist/{chunk-hhdbv9eg.js → chunk-zdsqreyq.js} +3 -3
  396. package/dist/chunk-zf5btqc3.js +54 -0
  397. package/dist/{chunk-sxgc1sm1.js → chunk-zfwgjjde.js} +2 -2
  398. package/dist/{chunk-nfaj0b7z.js → chunk-zgvyn6yk.js} +55 -52
  399. package/dist/{chunk-gcrf35hk.js → chunk-zmj9sehj.js} +56 -53
  400. package/dist/{chunk-hq20dsgb.js → chunk-zr750mg3.js} +93 -57
  401. package/dist/{chunk-yjyaq9ja.js → chunk-zshw91dr.js} +5 -5
  402. package/dist/{chunk-azbndvdt.js → chunk-zyhpq0w1.js} +7 -4
  403. package/dist/{chunk-ky41ddym.js → chunk-zzac564h.js} +15 -15
  404. package/dist/cli.js +94 -28
  405. package/dist/services/rawDump/batchWorker.js +3 -3
  406. package/package.json +1 -1
  407. package/dist/chunk-0paqc2yw.js +0 -18
  408. package/dist/chunk-ac3vxv72.js +0 -99
  409. package/dist/chunk-ctaxszne.js +0 -183
  410. package/dist/chunk-f9vf3z7d.js +0 -57
  411. package/dist/chunk-q2pkj7sp.js +0 -18
  412. package/dist/chunk-wmd102c3.js +0 -138
  413. package/dist/chunk-zzjq53z6.js +0 -198
@@ -0,0 +1,1395 @@
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
+ getBridgeCommandSafety,
23
+ getCommandName,
24
+ getContentText,
25
+ getUserPromptSubmitHookBlockingMessage,
26
+ init_AppState,
27
+ init_Spinner,
28
+ init_attachments,
29
+ init_commands1 as init_commands,
30
+ init_fileHistory,
31
+ init_generators,
32
+ init_hooks1 as init_hooks,
33
+ init_imageResizer,
34
+ init_imageStore,
35
+ init_messages1 as init_messages,
36
+ init_outputStyles,
37
+ init_queryProfiler,
38
+ init_select,
39
+ init_textInputTypes,
40
+ init_useTerminalSize,
41
+ isEmptyMessageText,
42
+ isSyntheticMessage,
43
+ isToolUseResultMessage,
44
+ isValidImagePaste,
45
+ maybeResizeAndDownsampleImageBlock,
46
+ queryCheckpoint,
47
+ storeImages,
48
+ toArray,
49
+ useAppState
50
+ } from "./chunk-vym5zrn6.js";
51
+ import {
52
+ init_useExitOnCtrlCDWithKeybindings,
53
+ useExitOnCtrlCDWithKeybindings
54
+ } from "./chunk-x6cjkxqe.js";
55
+ import {
56
+ init_useKeybinding
57
+ } from "./chunk-kbbjfeb8.js";
58
+ import {
59
+ init_events,
60
+ init_sessionTracing,
61
+ logOTelEvent,
62
+ redactIfDisabled,
63
+ startInteractionSpan
64
+ } from "./chunk-rasdgp8g.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-5thf5z45.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-5e4sk6wr.js";
85
+ import {
86
+ Divider,
87
+ ThemedBox_default,
88
+ ThemedText,
89
+ init_src,
90
+ useKeybinding,
91
+ useKeybindings,
92
+ useTerminalSize
93
+ } from "./chunk-zyhpq0w1.js";
94
+ import {
95
+ require_react
96
+ } from "./chunk-64k6ybmm.js";
97
+ import {
98
+ require_jsx_runtime
99
+ } from "./chunk-qr5vq8ys.js";
100
+ import {
101
+ init_analytics,
102
+ logEvent
103
+ } from "./chunk-f2mhrmww.js";
104
+ import {
105
+ getCwd,
106
+ init_cwd
107
+ } from "./chunk-ftfz2eh3.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-vtcqe66h.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-rcxtkewg.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_runtime.jsxs(ThemedBox_default, {
405
+ flexDirection: "column",
406
+ width: "100%",
407
+ children: [
408
+ /* @__PURE__ */ jsx_runtime.jsx(Divider, {
409
+ color: "suggestion"
410
+ }),
411
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedBox_default, {
412
+ flexDirection: "column",
413
+ marginX: 1,
414
+ gap: 1,
415
+ children: [
416
+ /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
417
+ bold: true,
418
+ color: "suggestion",
419
+ children: "Rewind"
420
+ }),
421
+ error && /* @__PURE__ */ jsx_runtime.jsx(jsx_runtime.Fragment, {
422
+ children: /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
423
+ color: "error",
424
+ children: [
425
+ "Error: ",
426
+ error
427
+ ]
428
+ })
429
+ }),
430
+ !hasMessagesToSelect && /* @__PURE__ */ jsx_runtime.jsx(jsx_runtime.Fragment, {
431
+ children: /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
432
+ children: "Nothing to rewind to yet."
433
+ })
434
+ }),
435
+ !error && messageToRestore && hasMessagesToSelect && /* @__PURE__ */ jsx_runtime.jsxs(jsx_runtime.Fragment, {
436
+ children: [
437
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
438
+ children: [
439
+ "Confirm you want to restore ",
440
+ !diffStatsForRestore && "the conversation ",
441
+ "to the point before you sent this message:"
442
+ ]
443
+ }),
444
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedBox_default, {
445
+ flexDirection: "column",
446
+ paddingLeft: 1,
447
+ borderStyle: "single",
448
+ borderRight: false,
449
+ borderTop: false,
450
+ borderBottom: false,
451
+ borderLeft: true,
452
+ borderLeftDimColor: true,
453
+ children: [
454
+ /* @__PURE__ */ jsx_runtime.jsx(UserMessageOption, {
455
+ userMessage: messageToRestore,
456
+ color: "text",
457
+ isCurrent: false
458
+ }),
459
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
460
+ dimColor: true,
461
+ children: [
462
+ "(",
463
+ formatRelativeTimeAgo(new Date(messageToRestore.timestamp)),
464
+ ")"
465
+ ]
466
+ })
467
+ ]
468
+ }),
469
+ /* @__PURE__ */ jsx_runtime.jsx(RestoreOptionDescription, {
470
+ selectedRestoreOption,
471
+ canRestoreCode: !!canRestoreCode,
472
+ diffStatsForRestore
473
+ }),
474
+ isRestoring && isSummarizeOption(restoringOption) ? /* @__PURE__ */ jsx_runtime.jsxs(ThemedBox_default, {
475
+ flexDirection: "row",
476
+ gap: 1,
477
+ children: [
478
+ /* @__PURE__ */ jsx_runtime.jsx(Spinner, {}),
479
+ /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
480
+ children: "Summarizing\u2026"
481
+ })
482
+ ]
483
+ }) : /* @__PURE__ */ jsx_runtime.jsx(Select, {
484
+ isDisabled: isRestoring,
485
+ options: getRestoreOptions(!!canRestoreCode),
486
+ defaultFocusValue: canRestoreCode ? "both" : "conversation",
487
+ onFocus: (value) => setSelectedRestoreOption(value),
488
+ onChange: (value) => onSelectRestoreOption(value),
489
+ onCancel: () => preselectedMessage ? onClose() : setMessageToRestore(undefined)
490
+ }),
491
+ canRestoreCode && /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
492
+ marginBottom: 1,
493
+ children: /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
494
+ dimColor: true,
495
+ children: [
496
+ figures_default.warning,
497
+ " Rewinding does not affect files edited manually or via bash."
498
+ ]
499
+ })
500
+ })
501
+ ]
502
+ }),
503
+ showPickList && /* @__PURE__ */ jsx_runtime.jsxs(jsx_runtime.Fragment, {
504
+ children: [
505
+ isFileHistoryEnabled ? /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
506
+ children: "Restore the code and/or conversation to the point before\u2026"
507
+ }) : /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
508
+ children: "Restore and fork the conversation to the point before\u2026"
509
+ }),
510
+ /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
511
+ width: "100%",
512
+ flexDirection: "column",
513
+ children: messageOptions.slice(firstVisibleIndex, firstVisibleIndex + MAX_VISIBLE_MESSAGES).map((msg, visibleOptionIndex) => {
514
+ const optionIndex = firstVisibleIndex + visibleOptionIndex;
515
+ const isSelected = optionIndex === selectedIndex;
516
+ const isCurrent = msg.uuid === currentUUID;
517
+ const metadataLoaded = optionIndex in fileHistoryMetadata;
518
+ const metadata = fileHistoryMetadata[optionIndex];
519
+ const numFilesChanged = metadata?.filesChanged && metadata.filesChanged.length;
520
+ return /* @__PURE__ */ jsx_runtime.jsxs(ThemedBox_default, {
521
+ height: isFileHistoryEnabled ? 3 : 2,
522
+ overflow: "hidden",
523
+ width: "100%",
524
+ flexDirection: "row",
525
+ children: [
526
+ /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
527
+ width: 2,
528
+ minWidth: 2,
529
+ children: isSelected ? /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
530
+ color: "permission",
531
+ bold: true,
532
+ children: [
533
+ figures_default.pointer,
534
+ " "
535
+ ]
536
+ }) : /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
537
+ children: " "
538
+ })
539
+ }),
540
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedBox_default, {
541
+ flexDirection: "column",
542
+ children: [
543
+ /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
544
+ flexShrink: 1,
545
+ height: 1,
546
+ overflow: "hidden",
547
+ children: /* @__PURE__ */ jsx_runtime.jsx(UserMessageOption, {
548
+ userMessage: msg,
549
+ color: isSelected ? "suggestion" : undefined,
550
+ isCurrent,
551
+ paddingRight: 10
552
+ })
553
+ }),
554
+ isFileHistoryEnabled && metadataLoaded && /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
555
+ height: 1,
556
+ flexDirection: "row",
557
+ children: metadata ? /* @__PURE__ */ jsx_runtime.jsx(jsx_runtime.Fragment, {
558
+ children: /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
559
+ dimColor: !isSelected,
560
+ color: "inactive",
561
+ children: numFilesChanged ? /* @__PURE__ */ jsx_runtime.jsxs(jsx_runtime.Fragment, {
562
+ children: [
563
+ numFilesChanged === 1 && metadata.filesChanged[0] ? `${path.basename(metadata.filesChanged[0])} ` : `${numFilesChanged} files changed `,
564
+ /* @__PURE__ */ jsx_runtime.jsx(DiffStatsText, {
565
+ diffStats: metadata
566
+ })
567
+ ]
568
+ }) : /* @__PURE__ */ jsx_runtime.jsx(jsx_runtime.Fragment, {
569
+ children: "No code changes"
570
+ })
571
+ })
572
+ }) : /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
573
+ dimColor: true,
574
+ color: "warning",
575
+ children: [
576
+ figures_default.warning,
577
+ " No code restore"
578
+ ]
579
+ })
580
+ })
581
+ ]
582
+ })
583
+ ]
584
+ }, msg.uuid);
585
+ })
586
+ })
587
+ ]
588
+ }),
589
+ !messageToRestore && /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
590
+ dimColor: true,
591
+ italic: true,
592
+ children: exitState.pending ? /* @__PURE__ */ jsx_runtime.jsxs(jsx_runtime.Fragment, {
593
+ children: [
594
+ "Press ",
595
+ exitState.keyName,
596
+ " again to exit"
597
+ ]
598
+ }) : /* @__PURE__ */ jsx_runtime.jsxs(jsx_runtime.Fragment, {
599
+ children: [
600
+ !error && hasMessagesToSelect && "Enter to continue \xB7 ",
601
+ "Esc to exit"
602
+ ]
603
+ })
604
+ })
605
+ ]
606
+ })
607
+ ]
608
+ });
609
+ }
610
+ function getRestoreOptionConversationText(option) {
611
+ switch (option) {
612
+ case "summarize":
613
+ return "Messages after this point will be summarized.";
614
+ case "summarize_up_to":
615
+ return "Preceding messages will be summarized. This and subsequent messages will remain unchanged \u2014 you will stay at the end of the conversation.";
616
+ case "both":
617
+ case "conversation":
618
+ return "The conversation will be forked.";
619
+ case "code":
620
+ case "nevermind":
621
+ return "The conversation will be unchanged.";
622
+ }
623
+ }
624
+ function RestoreOptionDescription({
625
+ selectedRestoreOption,
626
+ canRestoreCode,
627
+ diffStatsForRestore
628
+ }) {
629
+ const showCodeRestore = canRestoreCode && (selectedRestoreOption === "both" || selectedRestoreOption === "code");
630
+ return /* @__PURE__ */ jsx_runtime.jsxs(ThemedBox_default, {
631
+ flexDirection: "column",
632
+ children: [
633
+ /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
634
+ dimColor: true,
635
+ children: getRestoreOptionConversationText(selectedRestoreOption)
636
+ }),
637
+ !isSummarizeOption(selectedRestoreOption) && (showCodeRestore ? /* @__PURE__ */ jsx_runtime.jsx(RestoreCodeConfirmation, {
638
+ diffStatsForRestore
639
+ }) : /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
640
+ dimColor: true,
641
+ children: "The code will be unchanged."
642
+ }))
643
+ ]
644
+ });
645
+ }
646
+ function RestoreCodeConfirmation({
647
+ diffStatsForRestore
648
+ }) {
649
+ if (diffStatsForRestore === undefined) {
650
+ return;
651
+ }
652
+ if (!diffStatsForRestore.filesChanged || !diffStatsForRestore.filesChanged[0]) {
653
+ return /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
654
+ dimColor: true,
655
+ children: "The code has not changed (nothing will be restored)."
656
+ });
657
+ }
658
+ const numFilesChanged = diffStatsForRestore.filesChanged.length;
659
+ let fileLabel = "";
660
+ if (numFilesChanged === 1) {
661
+ fileLabel = path.basename(diffStatsForRestore.filesChanged[0] || "");
662
+ } else if (numFilesChanged === 2) {
663
+ const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
664
+ const file2 = path.basename(diffStatsForRestore.filesChanged[1] || "");
665
+ fileLabel = `${file1} and ${file2}`;
666
+ } else {
667
+ const file1 = path.basename(diffStatsForRestore.filesChanged[0] || "");
668
+ fileLabel = `${file1} and ${diffStatsForRestore.filesChanged.length - 1} other files`;
669
+ }
670
+ return /* @__PURE__ */ jsx_runtime.jsx(jsx_runtime.Fragment, {
671
+ children: /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
672
+ dimColor: true,
673
+ children: [
674
+ "The code will be restored ",
675
+ /* @__PURE__ */ jsx_runtime.jsx(DiffStatsText, {
676
+ diffStats: diffStatsForRestore
677
+ }),
678
+ " in ",
679
+ fileLabel,
680
+ "."
681
+ ]
682
+ })
683
+ });
684
+ }
685
+ function DiffStatsText({ diffStats }) {
686
+ if (!diffStats || !diffStats.filesChanged) {
687
+ return;
688
+ }
689
+ return /* @__PURE__ */ jsx_runtime.jsxs(jsx_runtime.Fragment, {
690
+ children: [
691
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
692
+ color: "diffAddedWord",
693
+ children: [
694
+ "+",
695
+ diffStats.insertions,
696
+ " "
697
+ ]
698
+ }),
699
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
700
+ color: "diffRemovedWord",
701
+ children: [
702
+ "-",
703
+ diffStats.deletions
704
+ ]
705
+ })
706
+ ]
707
+ });
708
+ }
709
+ function UserMessageOption({
710
+ userMessage,
711
+ color,
712
+ dimColor,
713
+ isCurrent,
714
+ paddingRight
715
+ }) {
716
+ const { columns } = useTerminalSize();
717
+ if (isCurrent) {
718
+ return /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
719
+ width: "100%",
720
+ children: /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
721
+ italic: true,
722
+ color,
723
+ dimColor,
724
+ children: "(current)"
725
+ })
726
+ });
727
+ }
728
+ const content = userMessage.message.content;
729
+ const lastBlock = typeof content === "string" ? null : content[content.length - 1];
730
+ const rawMessageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "(no prompt)";
731
+ const messageText = stripDisplayTags(rawMessageText);
732
+ if (isEmptyMessageText(messageText)) {
733
+ return /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
734
+ flexDirection: "row",
735
+ width: "100%",
736
+ children: /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
737
+ italic: true,
738
+ color,
739
+ dimColor,
740
+ children: "((empty message))"
741
+ })
742
+ });
743
+ }
744
+ if (messageText.includes("<bash-input>")) {
745
+ const input = extractTag(messageText, "bash-input");
746
+ if (input) {
747
+ return /* @__PURE__ */ jsx_runtime.jsxs(ThemedBox_default, {
748
+ flexDirection: "row",
749
+ width: "100%",
750
+ children: [
751
+ /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
752
+ color: "bashBorder",
753
+ children: "!"
754
+ }),
755
+ /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
756
+ color,
757
+ dimColor,
758
+ children: [
759
+ " ",
760
+ input
761
+ ]
762
+ })
763
+ ]
764
+ });
765
+ }
766
+ }
767
+ if (messageText.includes(`<${COMMAND_MESSAGE_TAG}>`)) {
768
+ const commandMessage = extractTag(messageText, COMMAND_MESSAGE_TAG);
769
+ const args = extractTag(messageText, "command-args");
770
+ const isSkillFormat = extractTag(messageText, "skill-format") === "true";
771
+ if (commandMessage) {
772
+ if (isSkillFormat) {
773
+ return /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
774
+ flexDirection: "row",
775
+ width: "100%",
776
+ children: /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
777
+ color,
778
+ dimColor,
779
+ children: [
780
+ "Skill(",
781
+ commandMessage,
782
+ ")"
783
+ ]
784
+ })
785
+ });
786
+ } else {
787
+ return /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
788
+ flexDirection: "row",
789
+ width: "100%",
790
+ children: /* @__PURE__ */ jsx_runtime.jsxs(ThemedText, {
791
+ color,
792
+ dimColor,
793
+ children: [
794
+ "/",
795
+ commandMessage,
796
+ " ",
797
+ args
798
+ ]
799
+ })
800
+ });
801
+ }
802
+ }
803
+ }
804
+ return /* @__PURE__ */ jsx_runtime.jsx(ThemedBox_default, {
805
+ flexDirection: "row",
806
+ width: "100%",
807
+ children: /* @__PURE__ */ jsx_runtime.jsx(ThemedText, {
808
+ color,
809
+ dimColor,
810
+ children: paddingRight ? truncate(messageText, columns - paddingRight, true) : messageText.slice(0, 500).split(`
811
+ `).slice(0, 4).join(`
812
+ `)
813
+ })
814
+ });
815
+ }
816
+ function computeDiffStatsBetweenMessages(messages, fromMessageId, toMessageId) {
817
+ const startIndex = messages.findIndex((msg) => msg.uuid === fromMessageId);
818
+ if (startIndex === -1) {
819
+ return;
820
+ }
821
+ let endIndex = toMessageId ? messages.findIndex((msg) => msg.uuid === toMessageId) : messages.length;
822
+ if (endIndex === -1) {
823
+ endIndex = messages.length;
824
+ }
825
+ const filesChanged = [];
826
+ let insertions = 0;
827
+ let deletions = 0;
828
+ for (let i = startIndex + 1;i < endIndex; i++) {
829
+ const msg = messages[i];
830
+ if (!msg || !isToolUseResultMessage(msg)) {
831
+ continue;
832
+ }
833
+ const result = msg.toolUseResult;
834
+ if (!result || !result.filePath || !result.structuredPatch) {
835
+ continue;
836
+ }
837
+ if (!filesChanged.includes(result.filePath)) {
838
+ filesChanged.push(result.filePath);
839
+ }
840
+ try {
841
+ if ("type" in result && result.type === "create") {
842
+ insertions += result.content.split(/\r?\n/).length;
843
+ } else {
844
+ for (const hunk of result.structuredPatch) {
845
+ const additions = count(hunk.lines, (line) => line.startsWith("+"));
846
+ const removals = count(hunk.lines, (line) => line.startsWith("-"));
847
+ insertions += additions;
848
+ deletions += removals;
849
+ }
850
+ }
851
+ } catch {}
852
+ }
853
+ return {
854
+ filesChanged,
855
+ insertions,
856
+ deletions
857
+ };
858
+ }
859
+ function selectableUserMessagesFilter(message) {
860
+ if (message.type !== "user") {
861
+ return false;
862
+ }
863
+ if (Array.isArray(message.message.content) && message.message.content[0]?.type === "tool_result") {
864
+ return false;
865
+ }
866
+ if (isSyntheticMessage(message)) {
867
+ return false;
868
+ }
869
+ if (message.isMeta) {
870
+ return false;
871
+ }
872
+ if (message.isCompactSummary || message.isVisibleInTranscriptOnly) {
873
+ return false;
874
+ }
875
+ const content = message.message.content;
876
+ const lastBlock = typeof content === "string" ? null : content[content.length - 1];
877
+ const messageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock(lastBlock) ? lastBlock.text.trim() : "";
878
+ 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) {
879
+ return false;
880
+ }
881
+ return true;
882
+ }
883
+ function messagesAfterAreOnlySynthetic(messages, fromIndex) {
884
+ for (let i = fromIndex + 1;i < messages.length; i++) {
885
+ const msg = messages[i];
886
+ if (!msg)
887
+ continue;
888
+ if (isSyntheticMessage(msg))
889
+ continue;
890
+ if (isToolUseResultMessage(msg))
891
+ continue;
892
+ if (msg.type === "progress")
893
+ continue;
894
+ if (msg.type === "system")
895
+ continue;
896
+ if (msg.type === "attachment")
897
+ continue;
898
+ if (msg.type === "user" && msg.isMeta)
899
+ continue;
900
+ if (msg.type === "assistant") {
901
+ const content = msg.message.content;
902
+ if (Array.isArray(content)) {
903
+ const hasMeaningfulContent = content.some((block) => block.type === "text" && block.text.trim() || block.type === "tool_use");
904
+ if (hasMeaningfulContent)
905
+ return false;
906
+ }
907
+ continue;
908
+ }
909
+ if (msg.type === "user") {
910
+ return false;
911
+ }
912
+ }
913
+ return true;
914
+ }
915
+ var import_react, jsx_runtime, MAX_VISIBLE_MESSAGES = 7;
916
+ var init_MessageSelector = __esm(() => {
917
+ init_figures();
918
+ init_analytics();
919
+ init_AppState();
920
+ init_fileHistory();
921
+ init_log();
922
+ init_useExitOnCtrlCDWithKeybindings();
923
+ init_src();
924
+ init_useKeybinding();
925
+ init_displayTags();
926
+ init_messages();
927
+ init_select();
928
+ init_Spinner();
929
+ init_useTerminalSize();
930
+ init_xml();
931
+ init_array();
932
+ init_format();
933
+ import_react = __toESM(require_react(), 1);
934
+ jsx_runtime = __toESM(require_jsx_runtime(), 1);
935
+ });
936
+
937
+ // src/utils/ultraplan/keyword.ts
938
+ var OPEN_TO_CLOSE = {
939
+ "`": "`",
940
+ '"': '"',
941
+ "<": ">",
942
+ "{": "}",
943
+ "[": "]",
944
+ "(": ")",
945
+ "'": "'"
946
+ };
947
+ function findKeywordTriggerPositions(text, keyword) {
948
+ const re = new RegExp(keyword, "i");
949
+ if (!re.test(text))
950
+ return [];
951
+ if (text.startsWith("/"))
952
+ return [];
953
+ const quotedRanges = [];
954
+ let openQuote = null;
955
+ let openAt = 0;
956
+ const isWord = (ch) => !!ch && /[\p{L}\p{N}_]/u.test(ch);
957
+ for (let i = 0;i < text.length; i++) {
958
+ const ch = text[i];
959
+ if (openQuote) {
960
+ if (openQuote === "[" && ch === "[") {
961
+ openAt = i;
962
+ continue;
963
+ }
964
+ if (ch !== OPEN_TO_CLOSE[openQuote])
965
+ continue;
966
+ if (openQuote === "'" && isWord(text[i + 1]))
967
+ continue;
968
+ quotedRanges.push({ start: openAt, end: i + 1 });
969
+ openQuote = null;
970
+ } 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) {
971
+ openQuote = ch;
972
+ openAt = i;
973
+ }
974
+ }
975
+ const positions = [];
976
+ const wordRe = new RegExp(`\\b${keyword}\\b`, "gi");
977
+ const matches = text.matchAll(wordRe);
978
+ for (const match of matches) {
979
+ if (match.index === undefined)
980
+ continue;
981
+ const start = match.index;
982
+ const end = start + match[0].length;
983
+ if (quotedRanges.some((r) => start >= r.start && start < r.end))
984
+ continue;
985
+ const before = text[start - 1];
986
+ const after = text[end];
987
+ if (before === "/" || before === "\\" || before === "-")
988
+ continue;
989
+ if (after === "/" || after === "\\" || after === "-" || after === "?")
990
+ continue;
991
+ if (after === "." && isWord(text[end + 1]))
992
+ continue;
993
+ positions.push({ word: match[0], start, end });
994
+ }
995
+ return positions;
996
+ }
997
+ function findUltraplanTriggerPositions(text) {
998
+ return findKeywordTriggerPositions(text, "ultraplan");
999
+ }
1000
+ function findUltrareviewTriggerPositions(text) {
1001
+ return findKeywordTriggerPositions(text, "ultrareview");
1002
+ }
1003
+ function hasUltraplanKeyword(text) {
1004
+ return findUltraplanTriggerPositions(text).length > 0;
1005
+ }
1006
+ function replaceUltraplanKeyword(text) {
1007
+ const [trigger] = findUltraplanTriggerPositions(text);
1008
+ if (!trigger)
1009
+ return text;
1010
+ const before = text.slice(0, trigger.start);
1011
+ const after = text.slice(trigger.end);
1012
+ if (!(before + after).trim())
1013
+ return "";
1014
+ return before + trigger.word.slice("ultra".length) + after;
1015
+ }
1016
+
1017
+ // src/utils/processUserInput/processUserInput.ts
1018
+ init_analytics();
1019
+ init_messages();
1020
+ init_commands();
1021
+ init_textInputTypes();
1022
+ init_attachments();
1023
+ init_generators();
1024
+ init_hooks();
1025
+ init_imageResizer();
1026
+ init_imageStore();
1027
+ init_messages();
1028
+ init_queryProfiler();
1029
+ init_slashCommandParsing();
1030
+ import { randomUUID as randomUUID3 } from "crypto";
1031
+
1032
+ // src/utils/processUserInput/processTextPrompt.ts
1033
+ init_state();
1034
+ init_analytics();
1035
+ init_messages();
1036
+ init_events();
1037
+ init_sessionTracing();
1038
+ import { randomUUID as randomUUID2 } from "crypto";
1039
+
1040
+ // src/utils/userPromptKeywords.ts
1041
+ function matchesNegativeKeyword(input) {
1042
+ const lowerInput = input.toLowerCase();
1043
+ 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/;
1044
+ return negativePattern.test(lowerInput);
1045
+ }
1046
+ function matchesKeepGoingKeyword(input) {
1047
+ const lowerInput = input.toLowerCase().trim();
1048
+ if (lowerInput === "continue") {
1049
+ return true;
1050
+ }
1051
+ const keepGoingPattern = /\b(keep going|go on)\b/;
1052
+ return keepGoingPattern.test(lowerInput);
1053
+ }
1054
+
1055
+ // src/utils/processUserInput/processTextPrompt.ts
1056
+ function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta) {
1057
+ const promptId = randomUUID2();
1058
+ setPromptId(promptId);
1059
+ const userPromptText = typeof input === "string" ? input : input.find((block) => block.type === "text")?.text || "";
1060
+ startInteractionSpan(userPromptText);
1061
+ const otelPromptText = typeof input === "string" ? input : input.findLast((block) => block.type === "text")?.text || "";
1062
+ if (otelPromptText) {
1063
+ logOTelEvent("user_prompt", {
1064
+ prompt_length: String(otelPromptText.length),
1065
+ prompt: redactIfDisabled(otelPromptText),
1066
+ "prompt.id": promptId
1067
+ });
1068
+ }
1069
+ const isNegative = matchesNegativeKeyword(userPromptText);
1070
+ const isKeepGoing = matchesKeepGoingKeyword(userPromptText);
1071
+ logEvent("tengu_input_prompt", {
1072
+ is_negative: isNegative,
1073
+ is_keep_going: isKeepGoing
1074
+ });
1075
+ if (imageContentBlocks.length > 0) {
1076
+ const textContent = typeof input === "string" ? input.trim() ? [{ type: "text", text: input }] : [] : input;
1077
+ const userMessage2 = createUserMessage({
1078
+ content: [...textContent, ...imageContentBlocks],
1079
+ uuid,
1080
+ imagePasteIds: imagePasteIds.length > 0 ? imagePasteIds : undefined,
1081
+ permissionMode,
1082
+ isMeta: isMeta || undefined
1083
+ });
1084
+ return {
1085
+ messages: [userMessage2, ...attachmentMessages],
1086
+ shouldQuery: true
1087
+ };
1088
+ }
1089
+ const userMessage = createUserMessage({
1090
+ content: input,
1091
+ uuid,
1092
+ permissionMode,
1093
+ isMeta: isMeta || undefined
1094
+ });
1095
+ return {
1096
+ messages: [userMessage, ...attachmentMessages],
1097
+ shouldQuery: true
1098
+ };
1099
+ }
1100
+
1101
+ // src/utils/processUserInput/processUserInput.ts
1102
+ async function processUserInput({
1103
+ input,
1104
+ preExpansionInput,
1105
+ mode,
1106
+ setToolJSX,
1107
+ context,
1108
+ pastedContents,
1109
+ ideSelection,
1110
+ messages,
1111
+ setUserInputOnProcessing,
1112
+ uuid,
1113
+ isAlreadyProcessing,
1114
+ querySource,
1115
+ canUseTool,
1116
+ skipSlashCommands,
1117
+ bridgeOrigin,
1118
+ isMeta,
1119
+ skipAttachments,
1120
+ autonomy
1121
+ }) {
1122
+ const inputString = typeof input === "string" ? input : null;
1123
+ if (mode === "prompt" && inputString !== null && !isMeta) {
1124
+ setUserInputOnProcessing?.(inputString);
1125
+ }
1126
+ queryCheckpoint("query_process_user_input_base_start");
1127
+ const appState = context.getAppState();
1128
+ const result = await processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, appState.toolPermissionContext.mode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput, autonomy);
1129
+ queryCheckpoint("query_process_user_input_base_end");
1130
+ if (!result.shouldQuery) {
1131
+ return result;
1132
+ }
1133
+ queryCheckpoint("query_hooks_start");
1134
+ const inputMessage = getContentText(input) || "";
1135
+ for await (const hookResult of executeUserPromptSubmitHooks(inputMessage, appState.toolPermissionContext.mode, context, context.requestPrompt)) {
1136
+ if (hookResult.message?.type === "progress") {
1137
+ continue;
1138
+ }
1139
+ if (hookResult.blockingError) {
1140
+ const blockingMessage = getUserPromptSubmitHookBlockingMessage(hookResult.blockingError);
1141
+ return {
1142
+ messages: [
1143
+ createSystemMessage(`${blockingMessage}
1144
+
1145
+ Original prompt: ${input}`, "warning")
1146
+ ],
1147
+ shouldQuery: false,
1148
+ allowedTools: result.allowedTools
1149
+ };
1150
+ }
1151
+ if (hookResult.preventContinuation) {
1152
+ const message = hookResult.stopReason ? `Operation stopped by hook: ${hookResult.stopReason}` : "Operation stopped by hook";
1153
+ result.messages.push(createUserMessage({
1154
+ content: message
1155
+ }));
1156
+ result.shouldQuery = false;
1157
+ return result;
1158
+ }
1159
+ if (hookResult.additionalContexts && hookResult.additionalContexts.length > 0) {
1160
+ result.messages.push(createAttachmentMessage({
1161
+ type: "hook_additional_context",
1162
+ content: hookResult.additionalContexts.map(applyTruncation),
1163
+ hookName: "UserPromptSubmit",
1164
+ toolUseID: `hook-${randomUUID3()}`,
1165
+ hookEvent: "UserPromptSubmit"
1166
+ }));
1167
+ }
1168
+ if (hookResult.message) {
1169
+ switch (hookResult.message.attachment.type) {
1170
+ case "hook_success":
1171
+ if (!hookResult.message.attachment.content) {
1172
+ break;
1173
+ }
1174
+ result.messages.push({
1175
+ ...hookResult.message,
1176
+ attachment: {
1177
+ ...hookResult.message.attachment,
1178
+ content: applyTruncation(hookResult.message.attachment.content)
1179
+ }
1180
+ });
1181
+ break;
1182
+ default:
1183
+ result.messages.push(hookResult.message);
1184
+ break;
1185
+ }
1186
+ }
1187
+ }
1188
+ queryCheckpoint("query_hooks_end");
1189
+ return result;
1190
+ }
1191
+ var MAX_HOOK_OUTPUT_LENGTH = 1e4;
1192
+ function applyTruncation(content) {
1193
+ if (content.length > MAX_HOOK_OUTPUT_LENGTH) {
1194
+ return `${content.substring(0, MAX_HOOK_OUTPUT_LENGTH)}\u2026 [output truncated - exceeded ${MAX_HOOK_OUTPUT_LENGTH} characters]`;
1195
+ }
1196
+ return content;
1197
+ }
1198
+ async function processUserInputBase(input, mode, setToolJSX, context, pastedContents, ideSelection, messages, uuid, isAlreadyProcessing, querySource, canUseTool, permissionMode, skipSlashCommands, bridgeOrigin, isMeta, skipAttachments, preExpansionInput, autonomy) {
1199
+ let inputString = null;
1200
+ let precedingInputBlocks = [];
1201
+ const imageMetadataTexts = [];
1202
+ let normalizedInput = input;
1203
+ if (typeof input === "string") {
1204
+ inputString = input;
1205
+ } else if (input.length > 0) {
1206
+ queryCheckpoint("query_image_processing_start");
1207
+ const processedBlocks = [];
1208
+ for (const block of input) {
1209
+ if (block.type === "image") {
1210
+ const resized = await maybeResizeAndDownsampleImageBlock(block);
1211
+ if (resized.dimensions) {
1212
+ const metadataText = createImageMetadataText(resized.dimensions);
1213
+ if (metadataText) {
1214
+ imageMetadataTexts.push(metadataText);
1215
+ }
1216
+ }
1217
+ processedBlocks.push(resized.block);
1218
+ } else {
1219
+ processedBlocks.push(block);
1220
+ }
1221
+ }
1222
+ normalizedInput = processedBlocks;
1223
+ queryCheckpoint("query_image_processing_end");
1224
+ const lastBlock = processedBlocks[processedBlocks.length - 1];
1225
+ if (lastBlock?.type === "text") {
1226
+ inputString = lastBlock.text;
1227
+ precedingInputBlocks = processedBlocks.slice(0, -1);
1228
+ } else {
1229
+ precedingInputBlocks = processedBlocks;
1230
+ }
1231
+ }
1232
+ if (inputString === null && mode !== "prompt") {
1233
+ throw new Error(`Mode: ${mode} requires a string input.`);
1234
+ }
1235
+ const imageContents = pastedContents ? Object.values(pastedContents).filter(isValidImagePaste) : [];
1236
+ const imagePasteIds = imageContents.map((img) => img.id);
1237
+ const storedImagePaths = pastedContents ? await storeImages(pastedContents) : new Map;
1238
+ queryCheckpoint("query_pasted_image_processing_start");
1239
+ const imageProcessingResults = await Promise.all(imageContents.map(async (pastedImage) => {
1240
+ const imageBlock = {
1241
+ type: "image",
1242
+ source: {
1243
+ type: "base64",
1244
+ media_type: pastedImage.mediaType || "image/png",
1245
+ data: pastedImage.content
1246
+ }
1247
+ };
1248
+ logEvent("tengu_pasted_image_resize_attempt", {
1249
+ original_size_bytes: pastedImage.content.length
1250
+ });
1251
+ const resized = await maybeResizeAndDownsampleImageBlock(imageBlock);
1252
+ return {
1253
+ resized,
1254
+ originalDimensions: pastedImage.dimensions,
1255
+ sourcePath: pastedImage.sourcePath ?? storedImagePaths.get(pastedImage.id)
1256
+ };
1257
+ }));
1258
+ const imageContentBlocks = [];
1259
+ for (const {
1260
+ resized,
1261
+ originalDimensions,
1262
+ sourcePath
1263
+ } of imageProcessingResults) {
1264
+ if (resized.dimensions) {
1265
+ const metadataText = createImageMetadataText(resized.dimensions, sourcePath);
1266
+ if (metadataText) {
1267
+ imageMetadataTexts.push(metadataText);
1268
+ }
1269
+ } else if (originalDimensions) {
1270
+ const metadataText = createImageMetadataText(originalDimensions, sourcePath);
1271
+ if (metadataText) {
1272
+ imageMetadataTexts.push(metadataText);
1273
+ }
1274
+ } else if (sourcePath) {
1275
+ imageMetadataTexts.push(`[Image source: ${sourcePath}]`);
1276
+ }
1277
+ imageContentBlocks.push(resized.block);
1278
+ }
1279
+ queryCheckpoint("query_pasted_image_processing_end");
1280
+ let effectiveSkipSlash = skipSlashCommands;
1281
+ if (bridgeOrigin && inputString !== null && inputString.startsWith("/")) {
1282
+ const parsed = parseSlashCommand(inputString);
1283
+ const cmd = parsed ? findCommand(parsed.commandName, context.options.commands) : undefined;
1284
+ if (cmd) {
1285
+ const safety = getBridgeCommandSafety(cmd, parsed?.args ?? "");
1286
+ if (safety.ok) {
1287
+ effectiveSkipSlash = false;
1288
+ } else {
1289
+ const msg = safety.reason ?? `/${getCommandName(cmd)} isn't available over Remote Control.`;
1290
+ return {
1291
+ messages: [
1292
+ createUserMessage({ content: inputString, uuid }),
1293
+ createCommandInputMessage(`<local-command-stdout>${msg}</local-command-stdout>`)
1294
+ ],
1295
+ shouldQuery: false,
1296
+ resultText: msg
1297
+ };
1298
+ }
1299
+ }
1300
+ }
1301
+ if (mode === "prompt" && !context.options.isNonInteractiveSession && inputString !== null && !effectiveSkipSlash && !inputString.startsWith("/") && !context.getAppState().ultraplanSessionUrl && !context.getAppState().ultraplanLaunching && hasUltraplanKeyword(preExpansionInput ?? inputString)) {
1302
+ logEvent("tengu_ultraplan_keyword", {});
1303
+ const rewritten = replaceUltraplanKeyword(inputString).trim();
1304
+ const { processSlashCommand } = await import("./chunk-k3mghke5.js");
1305
+ const slashResult = await processSlashCommand(`/ultraplan ${rewritten}`, precedingInputBlocks, imageContentBlocks, [], context, setToolJSX, uuid, isAlreadyProcessing, canUseTool, autonomy);
1306
+ return addImageMetadataMessage(slashResult, imageMetadataTexts);
1307
+ }
1308
+ const shouldExtractAttachments = !skipAttachments && inputString !== null && (mode !== "prompt" || effectiveSkipSlash || !inputString.startsWith("/"));
1309
+ queryCheckpoint("query_attachment_loading_start");
1310
+ const attachmentMessages = shouldExtractAttachments ? await toArray(getAttachmentMessages(inputString, context, ideSelection ?? null, [], messages, querySource)) : [];
1311
+ queryCheckpoint("query_attachment_loading_end");
1312
+ if (inputString !== null && mode === "bash") {
1313
+ const { processBashCommand } = await import("./chunk-nv5rddp1.js");
1314
+ return addImageMetadataMessage(await processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context, setToolJSX), imageMetadataTexts);
1315
+ }
1316
+ if (inputString !== null && !effectiveSkipSlash && inputString.startsWith("/")) {
1317
+ const { processSlashCommand } = await import("./chunk-k3mghke5.js");
1318
+ const slashResult = await processSlashCommand(inputString, precedingInputBlocks, imageContentBlocks, attachmentMessages, context, setToolJSX, uuid, isAlreadyProcessing, canUseTool, autonomy);
1319
+ return addImageMetadataMessage(slashResult, imageMetadataTexts);
1320
+ }
1321
+ if (inputString !== null && mode === "prompt") {
1322
+ const trimmedInput = inputString.trim();
1323
+ const agentMention = attachmentMessages.find((m) => m.attachment.type === "agent_mention");
1324
+ if (agentMention) {
1325
+ const agentMentionString = `@agent-${agentMention.attachment.agentType}`;
1326
+ const isSubagentOnly = trimmedInput === agentMentionString;
1327
+ const isPrefix = trimmedInput.startsWith(agentMentionString) && !isSubagentOnly;
1328
+ logEvent("tengu_subagent_at_mention", {
1329
+ is_subagent_only: isSubagentOnly,
1330
+ is_prefix: isPrefix
1331
+ });
1332
+ }
1333
+ }
1334
+ return addImageMetadataMessage(processTextPrompt(normalizedInput, imageContentBlocks, imagePasteIds, attachmentMessages, uuid, permissionMode, isMeta), imageMetadataTexts);
1335
+ }
1336
+ function addImageMetadataMessage(result, imageMetadataTexts) {
1337
+ if (imageMetadataTexts.length > 0) {
1338
+ result.messages.push(createUserMessage({
1339
+ content: imageMetadataTexts.map((text) => ({ type: "text", text })),
1340
+ isMeta: true
1341
+ }));
1342
+ }
1343
+ return result;
1344
+ }
1345
+
1346
+ // src/utils/messages/systemInit.ts
1347
+ init_state();
1348
+ init_outputStyles();
1349
+ init_constants();
1350
+ init_auth();
1351
+ init_cwd();
1352
+ init_fastMode();
1353
+ init_settings();
1354
+ import { randomUUID as randomUUID4 } from "crypto";
1355
+ function sdkCompatToolName(name) {
1356
+ return name === AGENT_TOOL_NAME ? LEGACY_AGENT_TOOL_NAME : name;
1357
+ }
1358
+ function buildSystemInitMessage(inputs) {
1359
+ const settings = getSettings_DEPRECATED();
1360
+ const outputStyle = settings?.outputStyle ?? DEFAULT_OUTPUT_STYLE_NAME;
1361
+ const initMessage = {
1362
+ type: "system",
1363
+ subtype: "init",
1364
+ cwd: getCwd(),
1365
+ session_id: getSessionId(),
1366
+ tools: inputs.tools.map((tool) => sdkCompatToolName(tool.name)),
1367
+ mcp_servers: inputs.mcpClients.map((client) => ({
1368
+ name: client.name,
1369
+ status: client.type
1370
+ })),
1371
+ model: inputs.model,
1372
+ permissionMode: inputs.permissionMode,
1373
+ slash_commands: inputs.commands.filter((c) => c.userInvocable !== false).map((c) => c.name),
1374
+ apiKeySource: getAnthropicApiKeyWithSource().source,
1375
+ betas: getSdkBetas(),
1376
+ claude_code_version: "4.1.2",
1377
+ output_style: outputStyle,
1378
+ agents: inputs.agents.map((agent) => agent.agentType),
1379
+ skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
1380
+ plugins: inputs.plugins.map((plugin) => ({
1381
+ name: plugin.name,
1382
+ path: plugin.path,
1383
+ source: plugin.source
1384
+ })),
1385
+ uuid: randomUUID4()
1386
+ };
1387
+ if (false) {}
1388
+ initMessage.fast_mode_state = getFastModeState(inputs.model, inputs.fastMode);
1389
+ return initMessage;
1390
+ }
1391
+
1392
+ export { findUltraplanTriggerPositions, findUltrareviewTriggerPositions, processUserInput, sdkCompatToolName, buildSystemInitMessage, MessageSelector, selectableUserMessagesFilter, messagesAfterAreOnlySynthetic, exports_MessageSelector, init_MessageSelector };
1393
+
1394
+ //# debugId=2A815759CAD5BF7C64756E2164756E21
1395
+ //# sourceMappingURL=chunk-xt65mfby.js.map