claude-code-best 1.3.7 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-xtaw765g.js → chunk-00b2znqm.js} +2 -2
  3. package/dist/{chunk-vam5at9t.js → chunk-0ctfznp2.js} +83 -82
  4. package/dist/{chunk-db82mfh9.js → chunk-0kp39at8.js} +38 -38
  5. package/dist/{chunk-427mfnyx.js → chunk-0n0r9fwa.js} +1 -1
  6. package/dist/{chunk-86tz7yxt.js → chunk-0qe6jzfm.js} +26 -26
  7. package/dist/{chunk-z66q1nam.js → chunk-0rbezx7s.js} +26 -26
  8. package/dist/{chunk-6ex0f5ej.js → chunk-0w8eb8gt.js} +2 -2
  9. package/dist/{chunk-d267stxj.js → chunk-0z0m6mm5.js} +1 -1
  10. package/dist/{chunk-mfzgqp0c.js → chunk-157v5wtn.js} +2 -2
  11. package/dist/{chunk-ps5rsyxe.js → chunk-1e8f0nx0.js} +26 -26
  12. package/dist/{chunk-xcq3rdb0.js → chunk-1j332jvg.js} +10 -10
  13. package/dist/{chunk-9jg130e9.js → chunk-1neq14g8.js} +26 -26
  14. package/dist/{chunk-qwa5erw8.js → chunk-1zjrec16.js} +5 -5
  15. package/dist/{chunk-tvnrwrg3.js → chunk-21pvq2fw.js} +29 -29
  16. package/dist/{chunk-9tc901nb.js → chunk-25yy8wx5.js} +4 -4
  17. package/dist/{chunk-yp2yx0qj.js → chunk-29p0hjfs.js} +2 -2
  18. package/dist/{chunk-mcbqmbp2.js → chunk-29yjrfeq.js} +1 -1
  19. package/dist/{chunk-2h06sph0.js → chunk-2apay7a3.js} +29 -29
  20. package/dist/{chunk-9k2c5sxb.js → chunk-2c4003f8.js} +26 -26
  21. package/dist/{chunk-h7ffkxg4.js → chunk-2eb66dha.js} +6 -6
  22. package/dist/{chunk-8q4yg5pk.js → chunk-2j4wdmkt.js} +1 -1
  23. package/dist/{chunk-r6gyed9y.js → chunk-2mbctja8.js} +5 -5
  24. package/dist/{chunk-zc1s4swn.js → chunk-2smwf3e9.js} +2 -2
  25. package/dist/{chunk-k303kw9v.js → chunk-2x5az5dc.js} +27 -27
  26. package/dist/{chunk-76hrbqgr.js → chunk-34vnwd0v.js} +8 -8
  27. package/dist/{chunk-ga2vcmhy.js → chunk-386z9vh4.js} +28 -28
  28. package/dist/{chunk-14mkqwft.js → chunk-3ah2pq1f.js} +32 -32
  29. package/dist/{chunk-c8rgc3hw.js → chunk-3c0rxf7q.js} +31 -31
  30. package/dist/{chunk-e8zmtbry.js → chunk-3ef0cpf6.js} +27 -27
  31. package/dist/{chunk-mh8752jz.js → chunk-3fjgkntc.js} +1 -1
  32. package/dist/{chunk-qvywetwr.js → chunk-3gtk4mh3.js} +31 -31
  33. package/dist/{chunk-4ayhftnk.js → chunk-3gww1j1y.js} +32 -28
  34. package/dist/{chunk-zhe3rws3.js → chunk-3wjy1cpr.js} +4 -4
  35. package/dist/{chunk-w65283w4.js → chunk-4169yf5x.js} +2 -2
  36. package/dist/{chunk-h6dqpbac.js → chunk-43b84za2.js} +1 -1
  37. package/dist/{chunk-zmpygkz6.js → chunk-4581z0wr.js} +8 -8
  38. package/dist/{chunk-kcp8svja.js → chunk-45bbgebk.js} +4 -4
  39. package/dist/{chunk-xfft38wf.js → chunk-4drmj637.js} +5 -5
  40. package/dist/{chunk-2crz81z3.js → chunk-4f4jqsza.js} +1 -1
  41. package/dist/{chunk-fx6ghdvg.js → chunk-4f5xrg8h.js} +26 -26
  42. package/dist/{chunk-cdgv0k77.js → chunk-4gpt5ay1.js} +27 -27
  43. package/dist/{chunk-tw2wjsnb.js → chunk-4krsdy3p.js} +2 -2
  44. package/dist/{chunk-qhbchv06.js → chunk-4m47hfh0.js} +26 -26
  45. package/dist/{chunk-qahkzpj6.js → chunk-4nf1ec4f.js} +1 -1
  46. package/dist/{chunk-g5rf37hh.js → chunk-4vj2d7dz.js} +33 -33
  47. package/dist/{chunk-px27vhxx.js → chunk-4vjvqns0.js} +3 -3
  48. package/dist/{chunk-qmckdcc4.js → chunk-50xwa16q.js} +27 -27
  49. package/dist/{chunk-drsh1vv8.js → chunk-53sfy7n4.js} +26 -26
  50. package/dist/{chunk-24qcj0k5.js → chunk-53vj9v9s.js} +6 -6
  51. package/dist/{chunk-ftajx4gw.js → chunk-5526qw2k.js} +1 -1
  52. package/dist/{chunk-t0b0bas5.js → chunk-5840qkdv.js} +1 -1
  53. package/dist/{chunk-tm4w23dp.js → chunk-5hjsrynt.js} +1 -1
  54. package/dist/{chunk-gfk81w5r.js → chunk-5km8j211.js} +1 -1
  55. package/dist/{chunk-qkrenskm.js → chunk-5wzcv9gh.js} +5 -5
  56. package/dist/{chunk-18mm4jf8.js → chunk-5xjn56aq.js} +3 -3
  57. package/dist/{chunk-g71q1n7x.js → chunk-5yd55bg7.js} +26 -26
  58. package/dist/{chunk-fye86v7m.js → chunk-607fe07t.js} +26 -26
  59. package/dist/{chunk-g2tmm7k7.js → chunk-688ah6p4.js} +40 -40
  60. package/dist/{chunk-3c81vb6k.js → chunk-6ad36q0w.js} +3 -3
  61. package/dist/{chunk-zh6xf1fd.js → chunk-6b45etp0.js} +2 -2
  62. package/dist/{chunk-bhvmpf9m.js → chunk-6cqap182.js} +30 -30
  63. package/dist/{chunk-s2cwz71x.js → chunk-6k1w8x4k.js} +27 -27
  64. package/dist/{chunk-y3rg86fk.js → chunk-6sqsx9jy.js} +5 -5
  65. package/dist/{chunk-451hjtv9.js → chunk-6wpr3tjc.js} +26 -26
  66. package/dist/{chunk-5h17d17z.js → chunk-6yahjmr9.js} +1 -1
  67. package/dist/{chunk-t38536jf.js → chunk-75fdprgp.js} +1 -1
  68. package/dist/{chunk-h0s737p0.js → chunk-7750n93j.js} +1 -1
  69. package/dist/{chunk-s13m8efn.js → chunk-77dn0tk8.js} +1 -1
  70. package/dist/{chunk-v7xwthvg.js → chunk-79wycw4g.js} +68 -66
  71. package/dist/{chunk-145d3809.js → chunk-7cfbwd7q.js} +27 -27
  72. package/dist/{chunk-fskf0b3x.js → chunk-7hftfbxa.js} +2 -2
  73. package/dist/{chunk-n35gnb9g.js → chunk-7hmy36fh.js} +121 -2
  74. package/dist/{chunk-vmpcmvqq.js → chunk-7p1esgzf.js} +1 -1
  75. package/dist/{chunk-qn4cbm38.js → chunk-7w2h14a6.js} +5 -5
  76. package/dist/{chunk-2z6bv21c.js → chunk-86epd45z.js} +11 -11
  77. package/dist/{chunk-62dx37pf.js → chunk-8833n19q.js} +1 -1
  78. package/dist/{chunk-gpk30ekc.js → chunk-8cn35yvf.js} +4 -4
  79. package/dist/{chunk-zahg0adp.js → chunk-8favkbxx.js} +2 -2
  80. package/dist/{chunk-q890kpff.js → chunk-8fwh1vg6.js} +5 -5
  81. package/dist/{chunk-m83vaktc.js → chunk-8j0cag62.js} +1 -1
  82. package/dist/{chunk-wkx2xsed.js → chunk-8n7czf03.js} +27 -27
  83. package/dist/{chunk-ky85ntn8.js → chunk-90vttb3v.js} +36 -36
  84. package/dist/{chunk-e6nenv5n.js → chunk-9fsvmcz5.js} +29 -29
  85. package/dist/{chunk-p2sww3pd.js → chunk-9gpr8jae.js} +27 -27
  86. package/dist/{chunk-dne2ghq6.js → chunk-9je35yst.js} +3 -3
  87. package/dist/{chunk-2c4jgf3n.js → chunk-9qbwahdr.js} +3 -3
  88. package/dist/{chunk-8y1zs48n.js → chunk-9tgts6mc.js} +1 -1
  89. package/dist/{chunk-pvtzf6vs.js → chunk-a27gcyws.js} +2 -2
  90. package/dist/{chunk-c4x4fb6d.js → chunk-a5b9swcd.js} +26 -26
  91. package/dist/{chunk-3j857x3k.js → chunk-adjan1zm.js} +26 -26
  92. package/dist/{chunk-7gxyarah.js → chunk-agabmbjf.js} +29 -29
  93. package/dist/{chunk-xwhmcc3g.js → chunk-ajs8dza3.js} +26 -26
  94. package/dist/{chunk-sn3wbs2w.js → chunk-akkp39da.js} +26 -26
  95. package/dist/{chunk-nwgkkhk7.js → chunk-amyrs3hm.js} +2 -2
  96. package/dist/{chunk-f6wypwa6.js → chunk-ap1ykep6.js} +1 -1
  97. package/dist/{chunk-bzps3qec.js → chunk-azksrewr.js} +32 -32
  98. package/dist/{chunk-xvjdbsfa.js → chunk-b0x349dj.js} +27 -27
  99. package/dist/{chunk-ag3hbrat.js → chunk-b2vzxkee.js} +5 -5
  100. package/dist/{chunk-zy4fsy90.js → chunk-beq5rrj7.js} +5 -5
  101. package/dist/{chunk-gwah3f17.js → chunk-bv1k9d6v.js} +26 -26
  102. package/dist/{chunk-hbf3y5tw.js → chunk-bx6g17ek.js} +4 -4
  103. package/dist/{chunk-vm0b9vaz.js → chunk-c1jzx2gv.js} +4 -4
  104. package/dist/{chunk-z2aps7d9.js → chunk-c4y7537k.js} +2 -2
  105. package/dist/{chunk-cpvn0j86.js → chunk-ccb92crb.js} +4 -4
  106. package/dist/{chunk-3nwsgn73.js → chunk-cd6mvmte.js} +27 -27
  107. package/dist/{chunk-5k4kh5n9.js → chunk-cdqf4qst.js} +26 -26
  108. package/dist/{chunk-h5dk6k0g.js → chunk-cj8t81dc.js} +26 -26
  109. package/dist/{chunk-7etmzq13.js → chunk-cnggqnzm.js} +6 -6
  110. package/dist/{chunk-9p95042q.js → chunk-cqndxy46.js} +1 -1
  111. package/dist/chunk-cr6s4vp6.js +1396 -0
  112. package/dist/{chunk-rshk7m9c.js → chunk-crvsdcfv.js} +26 -26
  113. package/dist/{chunk-540608wh.js → chunk-cyjjqcs3.js} +27 -27
  114. package/dist/{chunk-fsex4yt2.js → chunk-cyxsqapw.js} +3 -3
  115. package/dist/{chunk-5ccpwbk7.js → chunk-d3paf9v2.js} +26 -26
  116. package/dist/{chunk-m2cskgz4.js → chunk-d6ecf8f1.js} +35 -35
  117. package/dist/{chunk-ermvk1xn.js → chunk-d92pjy0h.js} +29 -29
  118. package/dist/{chunk-dvf5921w.js → chunk-deatxv64.js} +8 -8
  119. package/dist/{chunk-v081mpyx.js → chunk-djp9rrcq.js} +17 -17
  120. package/dist/{chunk-e1t8jh0t.js → chunk-dtv3phgm.js} +26 -26
  121. package/dist/{chunk-1wykga1n.js → chunk-e5mw3cyw.js} +1 -1
  122. package/dist/{chunk-ar8awa36.js → chunk-e6rrn2tj.js} +26 -26
  123. package/dist/{chunk-n42nvr59.js → chunk-ebzv9705.js} +2 -2
  124. package/dist/{chunk-kmzv85ze.js → chunk-edz2xqmx.js} +35 -35
  125. package/dist/{chunk-4stgesb0.js → chunk-egwqdd9k.js} +13 -13
  126. package/dist/{chunk-w6rh4zpx.js → chunk-enzrrdn4.js} +1 -1
  127. package/dist/{chunk-y95se10r.js → chunk-erjs2wr4.js} +4 -4
  128. package/dist/{chunk-ms9225af.js → chunk-etg0he8j.js} +26 -26
  129. package/dist/{chunk-n2gc23dm.js → chunk-evww0yyb.js} +2 -2
  130. package/dist/{chunk-1ez8vf1y.js → chunk-ew9re4pd.js} +3 -3
  131. package/dist/{chunk-wp9nwczx.js → chunk-ewb2cm8z.js} +2 -2
  132. package/dist/{chunk-b4btw5kv.js → chunk-fbs21kq9.js} +1 -1
  133. package/dist/{chunk-ydraa9ey.js → chunk-fezbtqkp.js} +35 -35
  134. package/dist/{chunk-s1p2w5a5.js → chunk-fjh0vhqw.js} +3 -3
  135. package/dist/{chunk-dchgtage.js → chunk-fsqp1hdd.js} +2 -2
  136. package/dist/{chunk-2fx2x8qp.js → chunk-fsrg55vw.js} +4 -4
  137. package/dist/{chunk-4ydmya8m.js → chunk-g3t3tpmr.js} +5 -5
  138. package/dist/{chunk-7z0078sp.js → chunk-g5w87dmr.js} +1 -1
  139. package/dist/{chunk-ez958w7j.js → chunk-g9t81ym4.js} +27 -27
  140. package/dist/{chunk-379rspd7.js → chunk-gc91es60.js} +26 -26
  141. package/dist/{chunk-gz4r3k7a.js → chunk-gfc6zk7q.js} +3 -3
  142. package/dist/{chunk-symd8dvh.js → chunk-gra7rch0.js} +35 -35
  143. package/dist/{chunk-66j7fn6z.js → chunk-gyzh9997.js} +26 -26
  144. package/dist/{chunk-h7bkf3h2.js → chunk-h65cdcmj.js} +8 -8
  145. package/dist/{chunk-5s1bctjb.js → chunk-hcwq2bw3.js} +5 -5
  146. package/dist/{chunk-9f01qpne.js → chunk-hhx05ny2.js} +37 -37
  147. package/dist/{chunk-1av0kkwh.js → chunk-hy2yy9dj.js} +1 -1
  148. package/dist/{chunk-zwrt0s3s.js → chunk-hz4cc1fy.js} +26 -26
  149. package/dist/{chunk-n0rn505k.js → chunk-j5pcp6j1.js} +2 -2
  150. package/dist/{chunk-x42kc5wj.js → chunk-jhbtp60e.js} +4 -4
  151. package/dist/{chunk-kmcaa88h.js → chunk-jjcks6sw.js} +1 -1
  152. package/dist/{chunk-9nddm5c7.js → chunk-jver0cay.js} +1 -1
  153. package/dist/{chunk-m2rx2dtd.js → chunk-jz86pz25.js} +38 -38
  154. package/dist/{chunk-ay9wm3tf.js → chunk-k5kw9hyy.js} +1 -1
  155. package/dist/{chunk-antr836n.js → chunk-k8vb990d.js} +26 -26
  156. package/dist/{chunk-m95fj0wm.js → chunk-kyvg0zcc.js} +2 -2
  157. package/dist/{chunk-r325sbz7.js → chunk-m007chff.js} +12 -12
  158. package/dist/{chunk-qxv21mcq.js → chunk-m08081ys.js} +27 -27
  159. package/dist/{chunk-wmd0v561.js → chunk-m77e1esy.js} +1 -1
  160. package/dist/{chunk-1vzaw5f6.js → chunk-mcwdvkc5.js} +5 -5
  161. package/dist/{chunk-y10byvag.js → chunk-mdk5vcer.js} +9 -9
  162. package/dist/{chunk-9ejadhq8.js → chunk-mfmqxvy3.js} +28 -28
  163. package/dist/{chunk-c1cm8km0.js → chunk-mg88phh5.js} +26 -26
  164. package/dist/{chunk-vvm5az9j.js → chunk-mh9bbz4s.js} +2 -2
  165. package/dist/{chunk-9gypgvd7.js → chunk-mhd4n6av.js} +1 -1
  166. package/dist/{chunk-4q5a5mjb.js → chunk-mmc59v16.js} +332 -132
  167. package/dist/{chunk-jty4xkhc.js → chunk-mqqg7cf6.js} +3 -3
  168. package/dist/{chunk-0pxmxyxv.js → chunk-mt10f1tp.js} +1 -1
  169. package/dist/{chunk-9b0btjar.js → chunk-mz2rbmwe.js} +29 -29
  170. package/dist/{chunk-n612gr22.js → chunk-n4by7yk8.js} +27 -27
  171. package/dist/{chunk-nbzntnkz.js → chunk-ndgnv15y.js} +27 -27
  172. package/dist/{chunk-rgpxnjx4.js → chunk-ne7y2xb5.js} +3 -3
  173. package/dist/{chunk-j44ngncb.js → chunk-nnbp6hww.js} +2 -2
  174. package/dist/{chunk-d969b8ne.js → chunk-nrgyjw8e.js} +5 -5
  175. package/dist/{chunk-psp1n9vg.js → chunk-ns09xpt7.js} +1 -1
  176. package/dist/{chunk-22rs73mh.js → chunk-ns11b23b.js} +28 -28
  177. package/dist/{chunk-g14ex9z0.js → chunk-nskrydpn.js} +26 -26
  178. package/dist/{chunk-nzchm0f2.js → chunk-nt5vedsr.js} +1 -1
  179. package/dist/{chunk-rhxtttx1.js → chunk-nzrgdzqp.js} +2 -2
  180. package/dist/{chunk-6qexrv9a.js → chunk-p2pgnk1y.js} +26 -26
  181. package/dist/{chunk-ynjbppdn.js → chunk-p78dmmrg.js} +26 -26
  182. package/dist/{chunk-6wrs3ahh.js → chunk-p88crc0s.js} +4 -4
  183. package/dist/{chunk-40ax4h54.js → chunk-p9rdn455.js} +27 -27
  184. package/dist/{chunk-xjd32sva.js → chunk-pc4szfak.js} +5 -5
  185. package/dist/{chunk-64mwy58c.js → chunk-pp11ggs7.js} +1 -1
  186. package/dist/{chunk-bpmw0wp2.js → chunk-ptpynwv2.js} +26 -26
  187. package/dist/{chunk-5r3wgr44.js → chunk-ptxwtjpj.js} +17 -1387
  188. package/dist/{chunk-jg7na104.js → chunk-pzxksam8.js} +26 -26
  189. package/dist/{chunk-1vzb650a.js → chunk-q223vmcc.js} +1 -1
  190. package/dist/{chunk-zajs1j2b.js → chunk-q6d7rjw1.js} +26 -26
  191. package/dist/{chunk-58rg6rn2.js → chunk-q7e35wkk.js} +1 -1
  192. package/dist/{chunk-6xr5mayh.js → chunk-qbmbmhef.js} +26 -26
  193. package/dist/{chunk-zv5yt0g4.js → chunk-qga7he5v.js} +2 -2
  194. package/dist/{chunk-s3aygngf.js → chunk-qkwmefpm.js} +27 -27
  195. package/dist/{chunk-y82s03p7.js → chunk-qpprdv6x.js} +2 -2
  196. package/dist/{chunk-855katq2.js → chunk-qqfr3g23.js} +28 -28
  197. package/dist/{chunk-c2ktjyc0.js → chunk-qxy16bqn.js} +91 -1028
  198. package/dist/{chunk-k5c76pvm.js → chunk-r1gkg1zh.js} +29 -29
  199. package/dist/{chunk-egcx83tp.js → chunk-r4hf85nn.js} +3 -3
  200. package/dist/{chunk-ymtkahxp.js → chunk-r8cbwyz2.js} +35 -35
  201. package/dist/{chunk-kbshq7zc.js → chunk-rck3g0jk.js} +26 -26
  202. package/dist/{chunk-2pdcq92c.js → chunk-rejx7z4t.js} +1 -1
  203. package/dist/{chunk-0ahxmrws.js → chunk-rfnh6gdw.js} +5 -5
  204. package/dist/{chunk-52evx0rm.js → chunk-rywnz223.js} +4 -4
  205. package/dist/{chunk-r7s0jwb1.js → chunk-s0c72pgz.js} +27 -27
  206. package/dist/{chunk-tbma29g4.js → chunk-s4erjnky.js} +26 -26
  207. package/dist/{chunk-tf8gr3bs.js → chunk-s7gt9pbp.js} +27 -27
  208. package/dist/{chunk-c14sp904.js → chunk-s95y1wsx.js} +3 -3
  209. package/dist/{chunk-4yxd0e7k.js → chunk-sfs23jb0.js} +26 -26
  210. package/dist/{chunk-y29pdynp.js → chunk-sjr9vygr.js} +3 -3
  211. package/dist/{chunk-z7svjppe.js → chunk-smskbnfh.js} +4 -4
  212. package/dist/{chunk-p7d5ms03.js → chunk-swjmy1ec.js} +4 -4
  213. package/dist/{chunk-c96k89rp.js → chunk-t5vfbd78.js} +26 -26
  214. package/dist/{chunk-163379k5.js → chunk-t76a178c.js} +26 -26
  215. package/dist/{chunk-h93tjx98.js → chunk-tgav5bz9.js} +84 -83
  216. package/dist/chunk-tr91zear.js +1012 -0
  217. package/dist/{chunk-b6whrv9m.js → chunk-ts2892h4.js} +6 -6
  218. package/dist/{chunk-bkzs71af.js → chunk-txz05nf1.js} +1 -1
  219. package/dist/{chunk-ztrgnar4.js → chunk-v3kfrhgg.js} +1 -1
  220. package/dist/chunk-v47r6dev.js +3799 -0
  221. package/dist/{chunk-vb6w46m9.js → chunk-v7vav1dg.js} +27 -27
  222. package/dist/{chunk-3avnvgnv.js → chunk-v88g6btg.js} +2 -2
  223. package/dist/{chunk-h7mpryyc.js → chunk-v9bnkmpp.js} +27 -27
  224. package/dist/{chunk-8wv29424.js → chunk-vchfbqh0.js} +1 -1
  225. package/dist/{chunk-9v5bwvbm.js → chunk-vcv8kqah.js} +29 -29
  226. package/dist/{chunk-gdb6dvba.js → chunk-vdv5g7q5.js} +27 -27
  227. package/dist/{chunk-awwfrm4f.js → chunk-vjbm6e89.js} +8 -8
  228. package/dist/{chunk-cxf74p1t.js → chunk-vjvstd86.js} +1 -1
  229. package/dist/{chunk-3er4wswe.js → chunk-vmb323h1.js} +113 -113
  230. package/dist/{chunk-r7r3jm3y.js → chunk-vq51wj3f.js} +26 -26
  231. package/dist/{chunk-kz13d2bs.js → chunk-vqrph16d.js} +2 -2
  232. package/dist/{chunk-3s2gjp2n.js → chunk-vvsc8651.js} +34 -34
  233. package/dist/{chunk-wkjjv1jr.js → chunk-w5b8wpff.js} +27 -27
  234. package/dist/{chunk-yevbmk5g.js → chunk-w5f4g9ty.js} +1 -1
  235. package/dist/{chunk-nsxw7en4.js → chunk-w64rnehj.js} +5 -5
  236. package/dist/{chunk-b31v41mz.js → chunk-w74twxev.js} +5 -5
  237. package/dist/{chunk-ry1jb15g.js → chunk-w8hh0w92.js} +26 -26
  238. package/dist/{chunk-kh04yrpx.js → chunk-wh42d494.js} +27 -27
  239. package/dist/{chunk-536fmbtq.js → chunk-wm9c1620.js} +1 -1
  240. package/dist/{chunk-08a6n2pp.js → chunk-x0qzkte0.js} +1 -1
  241. package/dist/{chunk-9nydmbm4.js → chunk-x3p67k4j.js} +1 -1
  242. package/dist/{chunk-eef1npre.js → chunk-x7jtxq14.js} +1 -1
  243. package/dist/{chunk-b4twmt0s.js → chunk-xayw54gs.js} +5 -5
  244. package/dist/{chunk-hgfw7nx2.js → chunk-xe4dvfz2.js} +26 -26
  245. package/dist/{chunk-x639j7py.js → chunk-xjcmfp13.js} +29 -29
  246. package/dist/{chunk-59mg8c5k.js → chunk-xmretc2b.js} +26 -26
  247. package/dist/{chunk-1q82ecz5.js → chunk-xqf27kff.js} +26 -26
  248. package/dist/{chunk-0fpkjw2j.js → chunk-xsevshsa.js} +4 -4
  249. package/dist/{chunk-bnvd1jc1.js → chunk-y0fvv8rp.js} +3 -3
  250. package/dist/{chunk-5cc50ecq.js → chunk-y2x0t2gb.js} +32 -32
  251. package/dist/{chunk-d73t8nhj.js → chunk-y315v6st.js} +12 -12
  252. package/dist/{chunk-0a2qnsbr.js → chunk-y81y5v3d.js} +28 -28
  253. package/dist/{chunk-5scrgrwv.js → chunk-yatby2yh.js} +1 -1
  254. package/dist/{chunk-e03zrq9n.js → chunk-yg0h97bm.js} +26 -26
  255. package/dist/{chunk-667f3w39.js → chunk-ypgs2acw.js} +5 -5
  256. package/dist/{chunk-p1af059d.js → chunk-ysdxmhpv.js} +29 -29
  257. package/dist/{chunk-0h4sw1v3.js → chunk-ytwnb2km.js} +26 -26
  258. package/dist/{chunk-0xq2bfvv.js → chunk-z6gvvfmf.js} +2 -2
  259. package/dist/{chunk-2tcznfv0.js → chunk-z6q66vf8.js} +1 -1
  260. package/dist/{chunk-35xyzbd2.js → chunk-z9f8mvd1.js} +32 -32
  261. package/dist/{chunk-j3ctqpsn.js → chunk-zda436nm.js} +2 -2
  262. package/dist/{chunk-49n22kr8.js → chunk-zddcrj90.js} +26 -26
  263. package/dist/{chunk-c209ascy.js → chunk-zh7z8zmq.js} +3 -3
  264. package/dist/{chunk-9byk2a4b.js → chunk-zhq7vk2g.js} +5 -5
  265. package/dist/{chunk-c9p5eyxf.js → chunk-zjhz0qyc.js} +28 -28
  266. package/dist/{chunk-vqawqpkx.js → chunk-zkv7atzf.js} +37 -37
  267. package/dist/{chunk-wef34bk5.js → chunk-zrrd9egx.js} +27 -27
  268. package/dist/{chunk-9r28w6ye.js → chunk-zttmdag3.js} +1 -1
  269. package/dist/cli.js +14 -8
  270. package/package.json +9 -3
@@ -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-z6q66vf8.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,124 +23,57 @@ 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-mmc59v16.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
64
  init_genericProcessUtils,
132
65
  init_growthbook,
133
66
  init_isEqual,
134
67
  init_schemas,
135
- init_settings1 as init_settings,
136
68
  isEqual_default,
137
69
  isLocalMarketplaceSource,
138
70
  isProcessRunning,
139
71
  pathExists
140
- } from "./chunk-zmpygkz6.js";
72
+ } from "./chunk-4581z0wr.js";
141
73
  import {
142
74
  init_json,
143
75
  safeParseJSON
144
76
  } from "./chunk-hnx0eg6x.js";
145
- import {
146
- count,
147
- init_array
148
- } from "./chunk-zwarn9h7.js";
149
77
  import {
150
78
  init_lazySchema,
151
79
  lazySchema
@@ -157,26 +85,6 @@ import {
157
85
  import {
158
86
  exports_external
159
87
  } 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
88
  import {
181
89
  init_analytics,
182
90
  logEvent
@@ -188,28 +96,9 @@ import {
188
96
  logForDiagnosticsNoPII
189
97
  } from "./chunk-pedmqmrf.js";
190
98
  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
99
  init_log,
205
- init_xml,
206
- logError,
207
- stripDisplayTags
100
+ logError
208
101
  } from "./chunk-d2vb6m9e.js";
209
- import {
210
- figures_default,
211
- init_figures
212
- } from "./chunk-qajrkk97.js";
213
102
  import {
214
103
  init_cleanupRegistry,
215
104
  init_debug,
@@ -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 };