@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
@@ -1,88 +1,86 @@
1
1
  // @bun
2
- import {
3
- HybridTransport,
4
- WebSocketTransport
5
- } from "./chunk-n3xd3ev4.js";
6
- import {
7
- CCRClient,
8
- CCRInitError
9
- } from "./chunk-7qq9wgng.js";
10
2
  import {
11
3
  StructuredIO,
12
- buildSystemInitMessage,
13
4
  cancelQueuedAutonomyCommands,
14
5
  claimConsumableQueuedAutonomyCommands,
15
- exports_MessageSelector,
16
6
  exports_cronJitterConfig,
17
7
  exports_cronScheduler,
18
8
  extractInboundMessageFields,
19
9
  finalizeAutonomyCommandsForTurn,
20
- init_MessageSelector,
21
10
  init_autonomyQueueLifecycle,
22
11
  init_cronJitterConfig,
23
12
  init_cronScheduler,
24
13
  ndjsonSafeStringify,
25
14
  outputSchema,
26
15
  permissionPromptToolResultToPermissionDecision,
27
- processUserInput,
28
- reconcileMarketplaces,
29
- sdkCompatToolName
30
- } from "./chunk-3yc8k84c.js";
16
+ reconcileMarketplaces
17
+ } from "./chunk-1gta3pqg.js";
31
18
  import {
32
19
  restoreAgentFromSession,
33
20
  restoreSessionStateFromLog
34
- } from "./chunk-3s7v8tsk.js";
21
+ } from "./chunk-v4h7dscd.js";
35
22
  import {
36
23
  detectAndUninstallDelistedPlugins
37
- } from "./chunk-rqn40hvy.js";
38
- import"./chunk-nt837qt9.js";
39
- import"./chunk-x07xwqrj.js";
24
+ } from "./chunk-e6p5x2p4.js";
25
+ import"./chunk-kpqx95pr.js";
40
26
  import {
41
27
  externalMetadataToAppState
42
- } from "./chunk-zffnk5t6.js";
28
+ } from "./chunk-mqr18cwx.js";
29
+ import {
30
+ HybridTransport,
31
+ WebSocketTransport
32
+ } from "./chunk-fgna18nd.js";
33
+ import {
34
+ CCRClient,
35
+ CCRInitError
36
+ } from "./chunk-gfycetpg.js";
37
+ import"./chunk-nt837qt9.js";
38
+ import {
39
+ resolveAndPrepend
40
+ } from "./chunk-7d5gzxsx.js";
43
41
  import {
44
42
  getPollIntervalConfig
45
- } from "./chunk-dk8te1zz.js";
46
- import"./chunk-a3m8brwc.js";
43
+ } from "./chunk-7zxvjs3d.js";
44
+ import"./chunk-7bq6az8b.js";
45
+ import {
46
+ ask,
47
+ buildSideQuestionFallbackParams
48
+ } from "./chunk-c36xznt7.js";
49
+ import"./chunk-xt65mfby.js";
47
50
  import {
48
51
  SSETransport,
49
52
  init_SSETransport
50
- } from "./chunk-rs2skqcv.js";
53
+ } from "./chunk-p6fhtt1h.js";
51
54
  import {
52
55
  init_skillChangeDetector,
53
56
  skillChangeDetector
54
- } from "./chunk-5bw23taw.js";
57
+ } from "./chunk-2yz7ej7r.js";
58
+ import {
59
+ init_toolPool,
60
+ mergeAndFilterTools
61
+ } from "./chunk-fbtp7vga.js";
62
+ import"./chunk-psq9gtg7.js";
55
63
  import {
56
64
  init_settingsSync
57
- } from "./chunk-yjyaq9ja.js";
65
+ } from "./chunk-zshw91dr.js";
58
66
  import {
59
67
  init_refresh,
60
68
  refreshActivePlugins
61
- } from "./chunk-yk99hmx2.js";
62
- import {
63
- init_toolPool,
64
- mergeAndFilterTools
65
- } from "./chunk-f9vf3z7d.js";
66
- import"./chunk-7d5yfjs6.js";
69
+ } from "./chunk-epprxdgg.js";
67
70
  import {
68
71
  generateSessionTitle,
69
72
  init_sessionTitle
70
- } from "./chunk-ne02d12y.js";
71
- import {
72
- init_systemTheme,
73
- resolveThemeSetting
74
- } from "./chunk-cnsj3vq2.js";
73
+ } from "./chunk-bh4k9q9y.js";
74
+ import"./chunk-cnsj3vq2.js";
75
75
  import {
76
76
  init_mappers,
77
- localCommandOutputToSDKAssistantMessage,
78
77
  toInternalMessages,
79
- toSDKCompactMetadata,
80
78
  toSDKRateLimitInfo
81
- } from "./chunk-gfsh3syp.js";
79
+ } from "./chunk-0cm9fcaq.js";
82
80
  import {
83
81
  init_omit,
84
82
  omit_default
85
- } from "./chunk-ztqe8k2y.js";
83
+ } from "./chunk-tq32b105.js";
86
84
  import {
87
85
  ChannelMessageNotificationSchema,
88
86
  findChannelEntry,
@@ -92,34 +90,29 @@ import {
92
90
  isChannelAllowlisted,
93
91
  isChannelsEnabled,
94
92
  wrapChannelMessage
95
- } from "./chunk-98204r0v.js";
96
- import"./chunk-7nwehwa4.js";
97
- import"./chunk-snjbtcsd.js";
93
+ } from "./chunk-hy5vd50e.js";
94
+ import"./chunk-jkyn6ge9.js";
95
+ import"./chunk-gn0ja3k5.js";
98
96
  import {
99
97
  collectContextData,
100
98
  init_context_noninteractive
101
- } from "./chunk-0fq3smhy.js";
102
- import"./chunk-q2pkj7sp.js";
99
+ } from "./chunk-xftqvncz.js";
103
100
  import {
104
101
  init_sideQuestion,
105
102
  runSideQuestion
106
- } from "./chunk-hjfabpxk.js";
103
+ } from "./chunk-2dvsb5m8.js";
107
104
  import"./chunk-rn0v1hk8.js";
108
105
  import {
109
106
  DEFAULT_OUTPUT_STYLE_NAME,
110
107
  EFFORT_LEVELS,
111
108
  OAuthService,
112
- SYNTHETIC_MESSAGES,
113
109
  SandboxManager,
114
- accumulateUsage,
115
110
  applySettingsChange,
116
111
  areMcpConfigsEqual,
117
112
  asSessionId,
118
113
  assembleToolPool,
119
114
  atomicWriteToZipCache,
120
115
  buildBridgeConnectUrl,
121
- buildEffectiveSystemPrompt,
122
- categorizeRetryableAPIError,
123
116
  checkGroveForNonInteractive,
124
117
  cleanupSessionPluginCache,
125
118
  clearCommandsCache,
@@ -128,7 +121,6 @@ import {
128
121
  clearServerCache,
129
122
  commandBelongsToServer,
130
123
  connectToServer,
131
- countToolCalls,
132
124
  createAbortController,
133
125
  createAutonomyQueuedPromptIfNoActiveSource,
134
126
  createCombinedAbortSignal,
@@ -140,28 +132,24 @@ import {
140
132
  drainSdkEvents,
141
133
  enqueue,
142
134
  executeNotificationHooks,
143
- exports_coordinatorMode,
144
135
  exports_extractMemories,
145
- exports_loadAgentsDir,
146
- exports_snipCompact,
147
- exports_snipProjection,
148
136
  extractReadFilesFromMessages,
149
137
  fetchToolsForClient,
150
138
  fileHistoryCanRestore,
151
139
  fileHistoryEnabled,
152
140
  fileHistoryGetDiffStats,
153
- fileHistoryMakeSnapshot,
154
141
  fileHistoryRewind,
155
142
  filterMcpServersByPolicy,
156
143
  filterToolsByDenyRules,
157
144
  filterToolsByServer,
158
145
  finalizePendingAsyncHooks,
159
146
  findUnresolvedToolUse,
160
- flushSessionStorage,
161
147
  formatDescriptionWithSource,
162
148
  fromArray,
163
149
  getAllMcpConfigs,
164
150
  getAllOutputStyles,
151
+ getAutoModeUnavailableNotification,
152
+ getAutoModeUnavailableReason,
165
153
  getCommandName,
166
154
  getCommands,
167
155
  getCommandsByMaxPriority,
@@ -173,17 +161,11 @@ import {
173
161
  getPluginZipCachePath,
174
162
  getRemoteSessionUrl,
175
163
  getRunningTasks,
176
- getScratchpadDir,
177
- getSlashCommandToolSkills,
178
- getSystemContext,
179
- getSystemPrompt,
180
- getUserContext,
181
164
  getZipCacheKnownMarketplacesPath,
182
165
  getZipCacheMarketplacesDir,
183
166
  getZipCachePluginsDir,
184
167
  gracefulShutdown,
185
168
  gracefulShutdownSync,
186
- handleOrphanedPermission,
187
169
  hasCommandsInQueue,
188
170
  hasPermissionsToUseTool,
189
171
  headlessProfilerCheckpoint,
@@ -191,7 +173,6 @@ import {
191
173
  hydrateFromCCRv2InternalEvents,
192
174
  hydrateRemoteSession,
193
175
  init_AsyncHookRegistry,
194
- init_Shell,
195
176
  init_abortController,
196
177
  init_agentToolUtils,
197
178
  init_applySettingsChange,
@@ -200,24 +181,18 @@ import {
200
181
  init_autonomyRuns,
201
182
  init_bridgeStatusUtil,
202
183
  init_changeDetector,
203
- init_claude,
204
184
  init_claudeAiLimits,
205
185
  init_client,
206
186
  init_combinedAbortSignal,
207
187
  init_commandLifecycle,
208
188
  init_commands1 as init_commands,
209
- init_config as init_config2,
210
- init_context,
189
+ init_config,
211
190
  init_conversationRecovery,
212
- init_coordinatorMode,
213
- init_cost_tracker,
214
191
  init_effort,
215
192
  init_elicitationHandler,
216
- init_errors as init_errors2,
217
193
  init_extractMemories,
218
194
  init_fileHistory,
219
195
  init_filesApi,
220
- init_filesystem,
221
196
  init_forkedAgent,
222
197
  init_framework,
223
198
  init_generators,
@@ -225,13 +200,10 @@ import {
225
200
  init_grove,
226
201
  init_headlessProfiler,
227
202
  init_hookEvents,
228
- init_hookHelpers,
229
203
  init_hooks1 as init_hooks,
230
204
  init_ids,
231
- init_last,
232
205
  init_loadAgentsDir,
233
206
  init_marketplaceManager,
234
- init_memdir,
235
207
  init_messageQueueManager,
236
208
  init_messages1 as init_messages,
237
209
  init_modelOptions,
@@ -245,8 +217,6 @@ import {
245
217
  init_product,
246
218
  init_prompt1 as init_prompt9,
247
219
  init_promptSuggestion,
248
- init_prompts1 as init_prompts,
249
- init_query,
250
220
  init_queryHelpers,
251
221
  init_queryProfiler,
252
222
  init_reject,
@@ -255,21 +225,18 @@ import {
255
225
  init_sdkEventQueue,
256
226
  init_sessionStart,
257
227
  init_sessionStorage,
258
- init_snipCompact,
259
- init_snipProjection,
260
228
  init_stopTask,
261
- init_systemPrompt,
262
- init_systemPromptType,
263
229
  init_teammateMailbox,
264
230
  init_thinking,
265
231
  init_tools,
266
- init_types3 as init_types2,
232
+ init_types2,
267
233
  init_uniqBy,
268
234
  init_utils,
269
235
  init_uuid,
270
236
  init_vscodeSdkMcp,
271
237
  init_zipCache,
272
238
  installOAuthTokens,
239
+ isAutoModeGateEnabled,
273
240
  isBackgroundTask,
274
241
  isBuiltInAgent,
275
242
  isBypassPermissionsModeDisabled,
@@ -278,15 +245,11 @@ import {
278
245
  isPluginZipCacheEnabled,
279
246
  isPolicyAllowed,
280
247
  isQualifiedForGrove,
281
- isResultSuccessful,
282
- isScratchpadEnabled,
283
248
  isShutdownApproved,
284
249
  isShuttingDown,
285
- last_default,
286
250
  loadAllPluginsCacheOnly,
287
251
  loadConversationForResume,
288
252
  loadKnownMarketplacesConfigSafe,
289
- loadMemoryPrompt,
290
253
  logHeadlessProfilerTurn,
291
254
  logQueryProfileReport,
292
255
  logSuggestionOutcome,
@@ -296,20 +259,17 @@ import {
296
259
  modelSupportsAdaptiveThinking,
297
260
  modelSupportsEffort,
298
261
  modelSupportsMaxEffort,
299
- normalizeMessage,
300
262
  notifyCommandLifecycle,
301
263
  parseAgentsFromJson,
302
264
  peek,
303
265
  performMCPOAuthFlow,
304
266
  processSessionStartHooks,
305
267
  processSetupHooks,
306
- query,
307
268
  readUnreadMessages,
308
269
  reconnectMcpServerImpl,
309
- recordTranscript,
270
+ recordAttributionSnapshot,
310
271
  registerHookEventHandler,
311
272
  registerSeedMarketplaces,
312
- registerStructuredOutputEnforcement,
313
273
  reject_default,
314
274
  resetSessionFilePointer,
315
275
  resolveAgentTools,
@@ -320,16 +280,13 @@ import {
320
280
  runElicitationResultHooks,
321
281
  saveAgentSetting,
322
282
  saveAiGeneratedTitle,
323
- saveMode,
324
283
  setCommandLifecycleListener,
325
- setCwd,
326
284
  setInternalEventReader,
327
285
  setInternalEventWriter,
328
286
  setMcpServerEnabled,
329
287
  settingsChangeDetector,
330
288
  setupSdkMcpClients,
331
289
  setupVscodeSdkMcp,
332
- shouldEnableThinkingByDefault,
333
290
  startQueryProfile,
334
291
  statusListeners,
335
292
  stopTask,
@@ -338,14 +295,31 @@ import {
338
295
  transitionPermissionMode,
339
296
  tryGenerateSuggestion,
340
297
  uniqBy_default,
341
- updateUsage,
342
298
  validateUuid,
343
299
  waitForRemoteManagedSettingsToLoad
344
- } from "./chunk-t9z3edw6.js";
300
+ } from "./chunk-vym5zrn6.js";
345
301
  import"./chunk-j7g5prq1.js";
302
+ import"./chunk-pqrb30bj.js";
303
+ import"./chunk-et824jj8.js";
304
+ import"./chunk-gcpc6b2z.js";
305
+ import"./chunk-dj0c74sd.js";
306
+ import"./chunk-7cpxexw0.js";
307
+ import"./chunk-2gzv8nrw.js";
308
+ import"./chunk-ehtwnxpg.js";
309
+ import"./chunk-172aq1cm.js";
310
+ import {
311
+ incrementPromptCount,
312
+ init_commitAttribution
313
+ } from "./chunk-5p3bwhcw.js";
314
+ import {
315
+ init_tasks,
316
+ init_teamHelpers,
317
+ removeTeammateFromTeamFile,
318
+ unassignTeammateTasks
319
+ } from "./chunk-bxmc7435.js";
320
+ import"./chunk-3tnabt1t.js";
346
321
  import {
347
322
  EMPTY_USAGE,
348
- asSystemPrompt,
349
323
  exports_proactive,
350
324
  getSessionIngressAuthToken,
351
325
  getSessionState,
@@ -359,57 +333,39 @@ import {
359
333
  setPermissionModeChangedListener,
360
334
  setSessionMetadataChangedListener,
361
335
  setSessionStateChangedListener
362
- } from "./chunk-ejfvtxhc.js";
363
- import"./chunk-cg0h6vpf.js";
364
- import"./chunk-ssnp42gc.js";
365
- import"./chunk-dawa3bxd.js";
366
- import"./chunk-dj0c74sd.js";
367
- import"./chunk-et824jj8.js";
368
- import"./chunk-7cpxexw0.js";
369
- import"./chunk-c05zaj6g.js";
370
- import"./chunk-cqnfwapm.js";
371
- import"./chunk-2gzv8nrw.js";
372
- import"./chunk-ehtwnxpg.js";
373
- import {
374
- init_commitAttribution
375
- } from "./chunk-jxefgv2b.js";
336
+ } from "./chunk-9ggwn844.js";
337
+ import"./chunk-496449vy.js";
338
+ import"./chunk-cgfdkzhb.js";
376
339
  import"./chunk-x6pa9me9.js";
377
340
  import"./chunk-2f6hs25r.js";
378
- import {
379
- init_tasks,
380
- init_teamHelpers,
381
- removeTeammateFromTeamFile,
382
- unassignTeammateTasks
383
- } from "./chunk-vempyean.js";
341
+ import"./chunk-hh6kgtq5.js";
342
+ import"./chunk-cnfzmqr8.js";
343
+ import"./chunk-9663bsk0.js";
384
344
  import {
385
345
  init_pluginIdentifier,
386
346
  parsePluginIdentifier
387
- } from "./chunk-ycjjsnm4.js";
388
- import"./chunk-h1e34028.js";
389
- import"./chunk-cgfdkzhb.js";
390
- import"./chunk-677p38pg.js";
391
- import"./chunk-25a6cm96.js";
347
+ } from "./chunk-wvs8wv8t.js";
348
+ import"./chunk-hnms0snx.js";
349
+ import"./chunk-s5pnejsn.js";
392
350
  import"./chunk-dg8c6j5q.js";
393
- import"./chunk-q0ks2prw.js";
351
+ import"./chunk-x6cjkxqe.js";
394
352
  import {
395
353
  READ_FILE_STATE_CACHE_SIZE,
396
- cloneFileStateCache,
397
354
  createFileStateCacheWithSizeLimit,
398
355
  init_fileStateCache,
399
356
  mergeFileStateCaches
400
- } from "./chunk-xq92sh7h.js";
401
- import"./chunk-4aqc3s2f.js";
402
- import"./chunk-eeee4v34.js";
403
- import"./chunk-pgjmgh51.js";
357
+ } from "./chunk-qzp51m93.js";
358
+ import"./chunk-87ddk39d.js";
359
+ import"./chunk-j74ctwq9.js";
404
360
  import"./chunk-pdkfgve3.js";
405
- import"./chunk-tjc1tx3q.js";
406
- import"./chunk-8zdrypte.js";
361
+ import"./chunk-a97kj439.js";
362
+ import"./chunk-9qj9t1g4.js";
363
+ import"./chunk-kbbjfeb8.js";
407
364
  import"./chunk-t4kcvmes.js";
408
- import"./chunk-587dvnad.js";
365
+ import"./chunk-wzzaxwej.js";
409
366
  import"./chunk-dx4aw2jf.js";
410
367
  import {
411
368
  SHELL_TOOL_NAMES,
412
- SYNTHETIC_OUTPUT_TOOL_NAME,
413
369
  createSyntheticOutputTool,
414
370
  exports_prompt,
415
371
  init_SyntheticOutputTool,
@@ -425,26 +381,23 @@ import {
425
381
  init_prompt9 as init_prompt8,
426
382
  init_shellToolUtils,
427
383
  toolMatchesName
428
- } from "./chunk-rqfzhr9m.js";
384
+ } from "./chunk-ennzq1s5.js";
429
385
  import"./chunk-14ya36qs.js";
430
386
  import"./chunk-edqtm6y0.js";
431
- import {
432
- getBridgeAccessToken,
433
- getBridgeBaseUrl,
434
- init_bridgeConfig
435
- } from "./chunk-4157n57z.js";
387
+ import"./chunk-76g1m8sa.js";
436
388
  import"./chunk-4vbza3s0.js";
437
- import"./chunk-0p6e05c5.js";
438
- import"./chunk-644422j5.js";
389
+ import"./chunk-v21ssxkp.js";
390
+ import"./chunk-sczmmmvj.js";
391
+ import"./chunk-xcxcysx3.js";
439
392
  import"./chunk-4jm600zv.js";
440
- import"./chunk-1h952cez.js";
393
+ import"./chunk-egkwv0bp.js";
441
394
  import"./chunk-mh90mtzg.js";
442
- import"./chunk-a9pqw4tk.js";
443
- import"./chunk-wbwzf5z4.js";
444
- import"./chunk-vhnm2h49.js";
395
+ import"./chunk-tdkwcv57.js";
396
+ import"./chunk-wdn3pb9r.js";
397
+ import"./chunk-0s2qjxt0.js";
445
398
  import"./chunk-0k1kkyw8.js";
446
- import"./chunk-ancr20tb.js";
447
- import"./chunk-bbm8cs3b.js";
399
+ import"./chunk-6d9njm1w.js";
400
+ import"./chunk-2dtsff0m.js";
448
401
  import"./chunk-2w8qb2c2.js";
449
402
  import"./chunk-26jcng1n.js";
450
403
  import {
@@ -453,10 +406,10 @@ import {
453
406
  init_types
454
407
  } from "./chunk-h6hgwf7t.js";
455
408
  import"./chunk-sq54cby2.js";
456
- import"./chunk-gmsb3jtb.js";
457
- import"./chunk-9ey1xvcm.js";
409
+ import"./chunk-m7qa1fqb.js";
410
+ import"./chunk-1xdybmyp.js";
458
411
  import"./chunk-8ye7m55r.js";
459
- import"./chunk-7v874g5h.js";
412
+ import"./chunk-rasdgp8g.js";
460
413
  import"./chunk-nvce80tx.js";
461
414
  import {
462
415
  AwsAuthStatusManager,
@@ -469,16 +422,13 @@ import {
469
422
  getDefaultMainLoopModel,
470
423
  getFastModeState,
471
424
  getFeatureValue_CACHED_MAY_BE_STALE,
472
- getGlobalConfig,
473
425
  getMainLoopModel,
474
426
  getMcpPrefix,
475
427
  getSettingsWithSources,
476
428
  getSettings_DEPRECATED,
477
- hasAutoMemPathOverride,
478
429
  init_auth,
479
430
  init_awsAuthStatusManager,
480
431
  init_betas1 as init_betas,
481
- init_config1 as init_config,
482
432
  init_fastMode,
483
433
  init_growthbook,
484
434
  init_mcpStringUtils,
@@ -500,7 +450,7 @@ import {
500
450
  modelSupportsAutoMode,
501
451
  parseUserSpecifiedModel,
502
452
  runWithWorkload
503
- } from "./chunk-egv3k4gg.js";
453
+ } from "./chunk-5thf5z45.js";
504
454
  import {
505
455
  init_json,
506
456
  safeParseJSON
@@ -508,9 +458,7 @@ import {
508
458
  import {
509
459
  expandPath,
510
460
  init_path
511
- } from "./chunk-r7a5cqdw.js";
512
- import"./chunk-00e8e1k5.js";
513
- import"./chunk-4bvckeaj.js";
461
+ } from "./chunk-9dwdn2sk.js";
514
462
  import {
515
463
  hasActiveInProcessTeammates,
516
464
  hasWorkingInProcessTeammates,
@@ -520,32 +468,27 @@ import {
520
468
  uniq,
521
469
  waitForTeammatesToBecomeIdle
522
470
  } from "./chunk-zwarn9h7.js";
471
+ import"./chunk-00e8e1k5.js";
472
+ import"./chunk-rzrm7j9x.js";
473
+ import"./chunk-4bvckeaj.js";
523
474
  import"./chunk-jakx4th4.js";
524
475
  import"./chunk-pe9b769s.js";
525
- import"./chunk-cxkxps51.js";
526
- import {
527
- init_lazySchema,
528
- lazySchema
529
- } from "./chunk-64c1avct.js";
530
- import"./chunk-nz9rqw9y.js";
476
+ import"./chunk-64c1avct.js";
531
477
  import {
532
478
  init_sleep,
533
479
  sleep
534
480
  } from "./chunk-8g5pe1gr.js";
535
481
  import"./chunk-nq504fa3.js";
536
- import"./chunk-xt7g86gj.js";
537
- import {
538
- init_v4
539
- } from "./chunk-6dpcm4za.js";
540
- import {
541
- exports_external
542
- } from "./chunk-p26t5d5e.js";
482
+ import"./chunk-8v8n8gxv.js";
483
+ import"./chunk-qxp3d963.js";
484
+ import"./chunk-6dpcm4za.js";
485
+ import"./chunk-p26t5d5e.js";
543
486
  import"./chunk-hs71mwbj.js";
544
487
  import"./chunk-3c25bcsw.js";
545
488
  import"./chunk-j9zpgw9b.js";
546
489
  import"./chunk-xhesahm0.js";
547
490
  import"./chunk-rh5a2rg9.js";
548
- import"./chunk-w51sng2s.js";
491
+ import"./chunk-npgyhaqc.js";
549
492
  import"./chunk-6ws6m83v.js";
550
493
  import"./chunk-a4wjqc9g.js";
551
494
  import"./chunk-0f6syxra.js";
@@ -553,35 +496,31 @@ import"./chunk-4f8eq6n2.js";
553
496
  import"./chunk-v9smspw2.js";
554
497
  import"./chunk-v1kzp02e.js";
555
498
  import"./chunk-p2816w9z.js";
556
- import"./chunk-gn0d6g6p.js";
499
+ import"./chunk-5e4sk6wr.js";
557
500
  import"./chunk-crmjpsqe.js";
558
- import {
559
- init_strip_ansi,
560
- stripAnsi
561
- } from "./chunk-azbndvdt.js";
501
+ import"./chunk-zyhpq0w1.js";
562
502
  import"./chunk-64k6ybmm.js";
563
503
  import"./chunk-qr5vq8ys.js";
564
504
  import {
565
505
  init_analytics,
566
506
  logEvent
567
- } from "./chunk-h0rbjg6x.js";
507
+ } from "./chunk-f2mhrmww.js";
568
508
  import"./chunk-kenv28g4.js";
569
509
  import"./chunk-nbq5dw92.js";
570
- import"./chunk-xcm658wm.js";
510
+ import"./chunk-ckq5d8ev.js";
571
511
  import {
572
512
  init_diagLogs,
573
513
  logForDiagnosticsNoPII,
574
514
  withDiagnosticsTiming
575
- } from "./chunk-g8e4wwak.js";
515
+ } from "./chunk-vacje5g9.js";
576
516
  import"./chunk-nrcew0nb.js";
577
517
  import"./chunk-gagn0nrq.js";
578
- import"./chunk-dsdbya1y.js";
518
+ import"./chunk-qwtfyr6d.js";
579
519
  import {
580
520
  getCwd,
581
521
  init_cwd
582
- } from "./chunk-d24kfzcv.js";
522
+ } from "./chunk-ftfz2eh3.js";
583
523
  import {
584
- LOCAL_COMMAND_STDERR_TAG,
585
524
  LOCAL_COMMAND_STDOUT_TAG,
586
525
  TASK_NOTIFICATION_TAG,
587
526
  TEAMMATE_MESSAGE_TAG,
@@ -622,10 +561,7 @@ import {
622
561
  getFlagSettingsInline,
623
562
  getInitJsonSchema,
624
563
  getMainThreadAgentType,
625
- getModelUsage,
626
564
  getSessionId,
627
- getTotalAPIDuration,
628
- getTotalCostUSD,
629
565
  init_state,
630
566
  isSessionPersistenceDisabled,
631
567
  registerHookCallbacks,
@@ -640,7 +576,6 @@ import {
640
576
  import"./chunk-50dgek10.js";
641
577
  import"./chunk-7wm5s02e.js";
642
578
  import {
643
- getClaudeConfigHomeDir,
644
579
  init_envUtils,
645
580
  isBareMode,
646
581
  isEnvDefinedFalsy,
@@ -648,10 +583,7 @@ import {
648
583
  } from "./chunk-hxhwzgnn.js";
649
584
  import"./chunk-qx8z601m.js";
650
585
  import"./chunk-cgm6758j.js";
651
- import {
652
- axios_default,
653
- init_axios
654
- } from "./chunk-ncpa00h9.js";
586
+ import"./chunk-ncpa00h9.js";
655
587
  import"./chunk-8pn8tvgg.js";
656
588
  import"./chunk-netzwgv1.js";
657
589
  import {
@@ -953,918 +885,6 @@ init_channelAllowlist();
953
885
  init_pluginIdentifier();
954
886
  init_uuid();
955
887
  init_generators();
956
-
957
- // src/QueryEngine.ts
958
- init_last();
959
- init_state();
960
- init_claude();
961
- init_src();
962
- init_strip_ansi();
963
- init_commands();
964
- init_xml();
965
- init_cost_tracker();
966
- init_memdir();
967
- init_paths();
968
- init_query();
969
- init_errors2();
970
- init_Tool();
971
- init_loadAgentsDir();
972
- init_SyntheticOutputTool();
973
- init_abortController();
974
- init_config();
975
- init_cwd();
976
- init_envUtils();
977
- init_fastMode();
978
- init_fileHistory();
979
- init_fileStateCache();
980
- init_headlessProfiler();
981
- init_hookHelpers();
982
- init_log();
983
- init_messages();
984
- init_model();
985
- init_pluginLoader();
986
- import { randomUUID } from "crypto";
987
-
988
- // src/utils/queryContext.ts
989
- init_prompts();
990
- init_context();
991
- init_abortController();
992
- init_model();
993
- init_systemPromptType();
994
- init_thinking();
995
- async function fetchSystemPromptParts({
996
- tools,
997
- mainLoopModel,
998
- additionalWorkingDirectories,
999
- mcpClients,
1000
- customSystemPrompt
1001
- }) {
1002
- const [defaultSystemPrompt, userContext, systemContext] = await Promise.all([
1003
- customSystemPrompt !== undefined ? Promise.resolve([]) : getSystemPrompt(tools, mainLoopModel, additionalWorkingDirectories, mcpClients),
1004
- getUserContext(),
1005
- customSystemPrompt !== undefined ? Promise.resolve({}) : getSystemContext()
1006
- ]);
1007
- return { defaultSystemPrompt, userContext, systemContext };
1008
- }
1009
- async function buildSideQuestionFallbackParams({
1010
- tools,
1011
- commands,
1012
- mcpClients,
1013
- messages,
1014
- readFileState,
1015
- getAppState,
1016
- setAppState,
1017
- customSystemPrompt,
1018
- appendSystemPrompt,
1019
- thinkingConfig,
1020
- agents
1021
- }) {
1022
- const mainLoopModel = getMainLoopModel();
1023
- const appState = getAppState();
1024
- const { defaultSystemPrompt, userContext, systemContext } = await fetchSystemPromptParts({
1025
- tools,
1026
- mainLoopModel,
1027
- additionalWorkingDirectories: Array.from(appState.toolPermissionContext.additionalWorkingDirectories.keys()),
1028
- mcpClients,
1029
- customSystemPrompt
1030
- });
1031
- const systemPrompt = asSystemPrompt([
1032
- ...customSystemPrompt !== undefined ? [customSystemPrompt] : defaultSystemPrompt,
1033
- ...appendSystemPrompt ? [appendSystemPrompt] : []
1034
- ]);
1035
- const last = messages.at(-1);
1036
- const forkContextMessages = last?.type === "assistant" && last.message.stop_reason === null ? messages.slice(0, -1) : messages;
1037
- const toolUseContext = {
1038
- options: {
1039
- commands,
1040
- debug: false,
1041
- mainLoopModel,
1042
- tools,
1043
- verbose: false,
1044
- thinkingConfig: thinkingConfig ?? (shouldEnableThinkingByDefault() !== false ? { type: "adaptive" } : { type: "disabled" }),
1045
- mcpClients,
1046
- mcpResources: {},
1047
- isNonInteractiveSession: true,
1048
- agentDefinitions: { activeAgents: agents, allAgents: [] },
1049
- customSystemPrompt,
1050
- appendSystemPrompt
1051
- },
1052
- abortController: createAbortController(),
1053
- readFileState,
1054
- getAppState,
1055
- setAppState,
1056
- messages: forkContextMessages,
1057
- setInProgressToolUseIDs: () => {},
1058
- setResponseLength: () => {},
1059
- updateFileHistoryState: () => {},
1060
- updateAttributionState: () => {}
1061
- };
1062
- return {
1063
- systemPrompt,
1064
- userContext,
1065
- systemContext,
1066
- toolUseContext,
1067
- forkContextMessages
1068
- };
1069
- }
1070
-
1071
- // src/QueryEngine.ts
1072
- init_Shell();
1073
- init_sessionStorage();
1074
- init_systemPrompt();
1075
- init_systemTheme();
1076
- init_thinking();
1077
- init_mappers();
1078
- init_filesystem();
1079
- init_queryHelpers();
1080
- var messageSelector = () => {
1081
- try {
1082
- return init_MessageSelector(), __toCommonJS(exports_MessageSelector);
1083
- } catch {
1084
- return null;
1085
- }
1086
- };
1087
- var getCoordinatorUserContext = (init_coordinatorMode(), __toCommonJS(exports_coordinatorMode)).getCoordinatorUserContext;
1088
- var snipModule = (init_snipCompact(), __toCommonJS(exports_snipCompact));
1089
- var snipProjection = (init_snipProjection(), __toCommonJS(exports_snipProjection));
1090
-
1091
- class QueryEngine {
1092
- config;
1093
- mutableMessages;
1094
- abortController;
1095
- permissionDenials;
1096
- totalUsage;
1097
- hasHandledOrphanedPermission = false;
1098
- readFileState;
1099
- discoveredSkillNames = new Set;
1100
- loadedNestedMemoryPaths = new Set;
1101
- constructor(config) {
1102
- this.config = config;
1103
- this.mutableMessages = config.initialMessages ?? [];
1104
- this.abortController = config.abortController ?? createAbortController();
1105
- this.permissionDenials = [];
1106
- this.readFileState = config.readFileCache;
1107
- this.totalUsage = EMPTY_USAGE;
1108
- }
1109
- async* submitMessage(prompt, options) {
1110
- const {
1111
- cwd,
1112
- commands,
1113
- tools,
1114
- mcpClients,
1115
- verbose = false,
1116
- thinkingConfig,
1117
- maxTurns,
1118
- maxBudgetUsd,
1119
- taskBudget,
1120
- canUseTool,
1121
- customSystemPrompt,
1122
- appendSystemPrompt,
1123
- mainThreadAgentDefinition,
1124
- userSpecifiedModel,
1125
- fallbackModel,
1126
- jsonSchema,
1127
- getAppState,
1128
- setAppState,
1129
- replayUserMessages = false,
1130
- includePartialMessages = false,
1131
- agents = [],
1132
- allowedAgentTypes,
1133
- setSDKStatus,
1134
- orphanedPermission
1135
- } = this.config;
1136
- this.discoveredSkillNames.clear();
1137
- this.permissionDenials = [];
1138
- setCwd(cwd);
1139
- const persistSession = !isSessionPersistenceDisabled();
1140
- const startTime = Date.now();
1141
- const wrappedCanUseTool = async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => {
1142
- const result2 = await canUseTool(tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision);
1143
- if (result2.behavior !== "allow") {
1144
- this.permissionDenials.push({
1145
- type: "permission_denial",
1146
- tool_name: sdkCompatToolName(tool.name),
1147
- tool_use_id: toolUseID,
1148
- tool_input: input
1149
- });
1150
- }
1151
- return result2;
1152
- };
1153
- const initialAppState = getAppState();
1154
- const initialMainLoopModel = userSpecifiedModel ? parseUserSpecifiedModel(userSpecifiedModel) : getMainLoopModel();
1155
- const initialThinkingConfig = thinkingConfig ? thinkingConfig : shouldEnableThinkingByDefault() !== false ? { type: "adaptive" } : { type: "disabled" };
1156
- headlessProfilerCheckpoint("before_getSystemPrompt");
1157
- const customPrompt = typeof customSystemPrompt === "string" ? customSystemPrompt : undefined;
1158
- const customPromptForFetch = mainThreadAgentDefinition && isBuiltInAgent(mainThreadAgentDefinition) ? undefined : customPrompt;
1159
- const {
1160
- defaultSystemPrompt,
1161
- userContext: baseUserContext,
1162
- systemContext
1163
- } = await fetchSystemPromptParts({
1164
- tools,
1165
- mainLoopModel: initialMainLoopModel,
1166
- additionalWorkingDirectories: Array.from(initialAppState.toolPermissionContext.additionalWorkingDirectories.keys()),
1167
- mcpClients,
1168
- customSystemPrompt: customPromptForFetch
1169
- });
1170
- headlessProfilerCheckpoint("after_getSystemPrompt");
1171
- const userContext = {
1172
- ...baseUserContext,
1173
- ...getCoordinatorUserContext(mcpClients, isScratchpadEnabled() ? getScratchpadDir() : undefined)
1174
- };
1175
- const memoryMechanicsPrompt = customPrompt !== undefined && hasAutoMemPathOverride() ? await loadMemoryPrompt() : null;
1176
- const combinedAppendSystemPrompt = [
1177
- ...memoryMechanicsPrompt ? [memoryMechanicsPrompt] : [],
1178
- ...appendSystemPrompt ? [appendSystemPrompt] : []
1179
- ].join(`
1180
- `) || undefined;
1181
- const systemPrompt = buildEffectiveSystemPrompt({
1182
- mainThreadAgentDefinition,
1183
- toolUseContext: { options: { customSystemPrompt: customPrompt } },
1184
- customSystemPrompt: customPrompt,
1185
- defaultSystemPrompt,
1186
- appendSystemPrompt: combinedAppendSystemPrompt
1187
- });
1188
- const hasStructuredOutputTool = tools.some((t) => toolMatchesName(t, SYNTHETIC_OUTPUT_TOOL_NAME));
1189
- if (jsonSchema && hasStructuredOutputTool) {
1190
- registerStructuredOutputEnforcement(setAppState, getSessionId());
1191
- }
1192
- let processUserInputContext = {
1193
- messages: this.mutableMessages,
1194
- setMessages: (fn) => {
1195
- this.mutableMessages = fn(this.mutableMessages);
1196
- },
1197
- onChangeAPIKey: () => {},
1198
- handleElicitation: this.config.handleElicitation,
1199
- options: {
1200
- commands,
1201
- debug: false,
1202
- tools,
1203
- verbose,
1204
- mainLoopModel: initialMainLoopModel,
1205
- thinkingConfig: initialThinkingConfig,
1206
- mcpClients,
1207
- mcpResources: {},
1208
- ideInstallationStatus: null,
1209
- isNonInteractiveSession: true,
1210
- customSystemPrompt,
1211
- appendSystemPrompt,
1212
- agentDefinitions: { activeAgents: agents, allAgents: [], ...allowedAgentTypes ? { allowedAgentTypes } : {} },
1213
- theme: resolveThemeSetting(getGlobalConfig().theme),
1214
- maxBudgetUsd
1215
- },
1216
- getAppState,
1217
- setAppState,
1218
- abortController: this.abortController,
1219
- readFileState: this.readFileState,
1220
- nestedMemoryAttachmentTriggers: new Set,
1221
- loadedNestedMemoryPaths: this.loadedNestedMemoryPaths,
1222
- dynamicSkillDirTriggers: new Set,
1223
- discoveredSkillNames: this.discoveredSkillNames,
1224
- setInProgressToolUseIDs: () => {},
1225
- setResponseLength: () => {},
1226
- updateFileHistoryState: (updater) => {
1227
- setAppState((prev) => {
1228
- const updated = updater(prev.fileHistory);
1229
- if (updated === prev.fileHistory)
1230
- return prev;
1231
- return { ...prev, fileHistory: updated };
1232
- });
1233
- },
1234
- updateAttributionState: (updater) => {
1235
- setAppState((prev) => {
1236
- const updated = updater(prev.attribution);
1237
- if (updated === prev.attribution)
1238
- return prev;
1239
- return { ...prev, attribution: updated };
1240
- });
1241
- },
1242
- setSDKStatus
1243
- };
1244
- if (orphanedPermission && !this.hasHandledOrphanedPermission) {
1245
- this.hasHandledOrphanedPermission = true;
1246
- for await (const message of handleOrphanedPermission(orphanedPermission, tools, this.mutableMessages, processUserInputContext)) {
1247
- yield message;
1248
- }
1249
- }
1250
- const {
1251
- messages: messagesFromUserInput,
1252
- shouldQuery,
1253
- allowedTools,
1254
- model: modelFromUserInput,
1255
- resultText
1256
- } = await processUserInput({
1257
- input: prompt,
1258
- mode: "prompt",
1259
- setToolJSX: () => {},
1260
- context: {
1261
- ...processUserInputContext,
1262
- messages: this.mutableMessages
1263
- },
1264
- messages: this.mutableMessages,
1265
- uuid: options?.uuid,
1266
- isMeta: options?.isMeta,
1267
- querySource: "sdk"
1268
- });
1269
- this.mutableMessages.push(...messagesFromUserInput);
1270
- const messages = [...this.mutableMessages];
1271
- if (persistSession && messagesFromUserInput.length > 0) {
1272
- const transcriptPromise = recordTranscript(messages);
1273
- if (isBareMode()) {} else {
1274
- await transcriptPromise;
1275
- if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
1276
- await flushSessionStorage();
1277
- }
1278
- }
1279
- }
1280
- const _selector = messageSelector();
1281
- const replayableMessages = messagesFromUserInput.filter((msg) => msg.type === "user" && !msg.isMeta && !msg.toolUseResult && (_selector?.selectableUserMessagesFilter(msg) ?? true) || msg.type === "system" && msg.subtype === "compact_boundary");
1282
- const messagesToAck = replayUserMessages ? replayableMessages : [];
1283
- setAppState((prev) => ({
1284
- ...prev,
1285
- toolPermissionContext: {
1286
- ...prev.toolPermissionContext,
1287
- alwaysAllowRules: {
1288
- ...prev.toolPermissionContext.alwaysAllowRules,
1289
- command: allowedTools
1290
- }
1291
- }
1292
- }));
1293
- const mainLoopModel = modelFromUserInput ?? initialMainLoopModel;
1294
- processUserInputContext = {
1295
- messages,
1296
- setMessages: () => {},
1297
- onChangeAPIKey: () => {},
1298
- handleElicitation: this.config.handleElicitation,
1299
- options: {
1300
- commands,
1301
- debug: false,
1302
- tools,
1303
- verbose,
1304
- mainLoopModel,
1305
- thinkingConfig: initialThinkingConfig,
1306
- mcpClients,
1307
- mcpResources: {},
1308
- ideInstallationStatus: null,
1309
- isNonInteractiveSession: true,
1310
- customSystemPrompt,
1311
- appendSystemPrompt,
1312
- theme: resolveThemeSetting(getGlobalConfig().theme),
1313
- agentDefinitions: { activeAgents: agents, allAgents: [], ...allowedAgentTypes ? { allowedAgentTypes } : {} },
1314
- maxBudgetUsd
1315
- },
1316
- getAppState,
1317
- setAppState,
1318
- abortController: this.abortController,
1319
- readFileState: this.readFileState,
1320
- nestedMemoryAttachmentTriggers: new Set,
1321
- loadedNestedMemoryPaths: this.loadedNestedMemoryPaths,
1322
- dynamicSkillDirTriggers: new Set,
1323
- discoveredSkillNames: this.discoveredSkillNames,
1324
- setInProgressToolUseIDs: () => {},
1325
- setResponseLength: () => {},
1326
- updateFileHistoryState: processUserInputContext.updateFileHistoryState,
1327
- updateAttributionState: processUserInputContext.updateAttributionState,
1328
- setSDKStatus
1329
- };
1330
- headlessProfilerCheckpoint("before_skills_plugins");
1331
- const [skills, { enabled: enabledPlugins }] = await Promise.all([
1332
- getSlashCommandToolSkills(getCwd()),
1333
- loadAllPluginsCacheOnly()
1334
- ]);
1335
- headlessProfilerCheckpoint("after_skills_plugins");
1336
- yield buildSystemInitMessage({
1337
- tools,
1338
- mcpClients,
1339
- model: mainLoopModel,
1340
- permissionMode: initialAppState.toolPermissionContext.mode,
1341
- commands,
1342
- agents,
1343
- skills,
1344
- plugins: enabledPlugins,
1345
- fastMode: initialAppState.fastMode
1346
- });
1347
- headlessProfilerCheckpoint("system_message_yielded");
1348
- if (!shouldQuery) {
1349
- for (const msg of messagesFromUserInput) {
1350
- if (msg.type === "user" && typeof msg.message.content === "string" && (msg.message.content.includes(`<${LOCAL_COMMAND_STDOUT_TAG}>`) || msg.message.content.includes(`<${LOCAL_COMMAND_STDERR_TAG}>`) || msg.isCompactSummary)) {
1351
- yield {
1352
- type: "user",
1353
- message: {
1354
- ...msg.message,
1355
- content: stripAnsi(msg.message.content)
1356
- },
1357
- session_id: getSessionId(),
1358
- parent_tool_use_id: null,
1359
- uuid: msg.uuid,
1360
- timestamp: msg.timestamp,
1361
- isReplay: !msg.isCompactSummary,
1362
- isSynthetic: msg.isMeta || msg.isVisibleInTranscriptOnly
1363
- };
1364
- }
1365
- if (msg.type === "system" && msg.subtype === "local_command" && typeof msg.content === "string" && (msg.content.includes(`<${LOCAL_COMMAND_STDOUT_TAG}>`) || msg.content.includes(`<${LOCAL_COMMAND_STDERR_TAG}>`))) {
1366
- yield localCommandOutputToSDKAssistantMessage(msg.content, msg.uuid);
1367
- }
1368
- if (msg.type === "system" && msg.subtype === "compact_boundary") {
1369
- const compactMsg = msg;
1370
- yield {
1371
- type: "system",
1372
- subtype: "compact_boundary",
1373
- session_id: getSessionId(),
1374
- uuid: msg.uuid,
1375
- compact_metadata: toSDKCompactMetadata(compactMsg.compactMetadata)
1376
- };
1377
- }
1378
- }
1379
- if (persistSession) {
1380
- await recordTranscript(messages);
1381
- if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
1382
- await flushSessionStorage();
1383
- }
1384
- }
1385
- yield {
1386
- type: "result",
1387
- subtype: "success",
1388
- is_error: false,
1389
- duration_ms: Date.now() - startTime,
1390
- duration_api_ms: getTotalAPIDuration(),
1391
- num_turns: messages.length - 1,
1392
- result: resultText ?? "",
1393
- stop_reason: null,
1394
- session_id: getSessionId(),
1395
- total_cost_usd: getTotalCostUSD(),
1396
- usage: this.totalUsage,
1397
- modelUsage: getModelUsage(),
1398
- permission_denials: this.permissionDenials,
1399
- fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
1400
- uuid: randomUUID()
1401
- };
1402
- return;
1403
- }
1404
- if (fileHistoryEnabled() && persistSession) {
1405
- const _sel = messageSelector();
1406
- const _filter = _sel?.selectableUserMessagesFilter ?? ((_msg) => true);
1407
- messagesFromUserInput.filter(_filter).forEach((message) => {
1408
- fileHistoryMakeSnapshot((updater) => {
1409
- setAppState((prev) => ({
1410
- ...prev,
1411
- fileHistory: updater(prev.fileHistory)
1412
- }));
1413
- }, message.uuid);
1414
- });
1415
- }
1416
- let currentMessageUsage = EMPTY_USAGE;
1417
- let turnCount = 1;
1418
- let hasAcknowledgedInitialMessages = false;
1419
- let structuredOutputFromTool;
1420
- let lastStopReason = null;
1421
- const errorLogWatermark = getInMemoryErrors().at(-1);
1422
- const initialStructuredOutputCalls = jsonSchema ? countToolCalls(this.mutableMessages, SYNTHETIC_OUTPUT_TOOL_NAME) : 0;
1423
- for await (const message of query({
1424
- messages,
1425
- systemPrompt,
1426
- userContext,
1427
- systemContext,
1428
- canUseTool: wrappedCanUseTool,
1429
- toolUseContext: processUserInputContext,
1430
- fallbackModel,
1431
- querySource: "sdk",
1432
- maxTurns,
1433
- taskBudget
1434
- })) {
1435
- if (message.type === "assistant" || message.type === "user" || message.type === "system" && message.subtype === "compact_boundary") {
1436
- if (persistSession && message.type === "system" && message.subtype === "compact_boundary") {
1437
- const compactMsg = message;
1438
- const tailUuid = compactMsg.compactMetadata?.preservedSegment?.tailUuid;
1439
- if (tailUuid) {
1440
- const tailIdx = this.mutableMessages.findLastIndex((m) => m.uuid === tailUuid);
1441
- if (tailIdx !== -1) {
1442
- await recordTranscript(this.mutableMessages.slice(0, tailIdx + 1));
1443
- }
1444
- }
1445
- }
1446
- messages.push(message);
1447
- if (persistSession) {
1448
- if (message.type === "assistant") {
1449
- recordTranscript(messages);
1450
- } else {
1451
- await recordTranscript(messages);
1452
- }
1453
- }
1454
- if (!hasAcknowledgedInitialMessages && messagesToAck.length > 0) {
1455
- hasAcknowledgedInitialMessages = true;
1456
- for (const msgToAck of messagesToAck) {
1457
- if (msgToAck.type === "user") {
1458
- yield {
1459
- type: "user",
1460
- message: msgToAck.message,
1461
- session_id: getSessionId(),
1462
- parent_tool_use_id: null,
1463
- uuid: msgToAck.uuid,
1464
- timestamp: msgToAck.timestamp,
1465
- isReplay: true
1466
- };
1467
- }
1468
- }
1469
- }
1470
- }
1471
- if (message.type === "user") {
1472
- turnCount++;
1473
- }
1474
- switch (message.type) {
1475
- case "tombstone":
1476
- break;
1477
- case "assistant": {
1478
- const msg = message;
1479
- const stopReason = msg.message?.stop_reason;
1480
- if (stopReason != null) {
1481
- lastStopReason = stopReason;
1482
- }
1483
- this.mutableMessages.push(msg);
1484
- yield* normalizeMessage(msg);
1485
- break;
1486
- }
1487
- case "progress": {
1488
- const msg = message;
1489
- this.mutableMessages.push(msg);
1490
- if (persistSession) {
1491
- messages.push(msg);
1492
- recordTranscript(messages);
1493
- }
1494
- yield* normalizeMessage(msg);
1495
- break;
1496
- }
1497
- case "user": {
1498
- const msg = message;
1499
- this.mutableMessages.push(msg);
1500
- yield* normalizeMessage(msg);
1501
- break;
1502
- }
1503
- case "stream_event": {
1504
- const event = message.event;
1505
- if (event.type === "message_start") {
1506
- currentMessageUsage = EMPTY_USAGE;
1507
- const eventMessage = event.message;
1508
- currentMessageUsage = updateUsage(currentMessageUsage, eventMessage.usage);
1509
- }
1510
- if (event.type === "message_delta") {
1511
- currentMessageUsage = updateUsage(currentMessageUsage, event.usage);
1512
- const delta = event.delta;
1513
- if (delta.stop_reason != null) {
1514
- lastStopReason = delta.stop_reason;
1515
- }
1516
- }
1517
- if (event.type === "message_stop") {
1518
- this.totalUsage = accumulateUsage(this.totalUsage, currentMessageUsage);
1519
- }
1520
- yield {
1521
- type: "stream_event",
1522
- event,
1523
- session_id: getSessionId(),
1524
- parent_tool_use_id: null,
1525
- uuid: randomUUID()
1526
- };
1527
- break;
1528
- }
1529
- case "attachment": {
1530
- const msg = message;
1531
- this.mutableMessages.push(msg);
1532
- if (persistSession) {
1533
- messages.push(msg);
1534
- recordTranscript(messages);
1535
- }
1536
- const attachment = msg.attachment;
1537
- if (attachment.type === "structured_output") {
1538
- structuredOutputFromTool = attachment.data;
1539
- } else if (attachment.type === "max_turns_reached") {
1540
- if (persistSession) {
1541
- if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
1542
- await flushSessionStorage();
1543
- }
1544
- }
1545
- yield {
1546
- type: "result",
1547
- subtype: "error_max_turns",
1548
- duration_ms: Date.now() - startTime,
1549
- duration_api_ms: getTotalAPIDuration(),
1550
- is_error: true,
1551
- num_turns: attachment.turnCount,
1552
- stop_reason: lastStopReason,
1553
- session_id: getSessionId(),
1554
- total_cost_usd: getTotalCostUSD(),
1555
- usage: this.totalUsage,
1556
- modelUsage: getModelUsage(),
1557
- permission_denials: this.permissionDenials,
1558
- fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
1559
- uuid: randomUUID(),
1560
- errors: [
1561
- `Reached maximum number of turns (${attachment.maxTurns})`
1562
- ]
1563
- };
1564
- return;
1565
- } else if (replayUserMessages && attachment.type === "queued_command") {
1566
- yield {
1567
- type: "user",
1568
- message: {
1569
- role: "user",
1570
- content: attachment.prompt
1571
- },
1572
- session_id: getSessionId(),
1573
- parent_tool_use_id: null,
1574
- uuid: attachment.source_uuid || msg.uuid,
1575
- timestamp: msg.timestamp,
1576
- isReplay: true
1577
- };
1578
- }
1579
- break;
1580
- }
1581
- case "stream_request_start":
1582
- break;
1583
- case "system": {
1584
- const msg = message;
1585
- const snipResult = this.config.snipReplay?.(msg, this.mutableMessages);
1586
- if (snipResult !== undefined) {
1587
- if (snipResult.executed) {
1588
- this.mutableMessages.length = 0;
1589
- this.mutableMessages.push(...snipResult.messages);
1590
- }
1591
- break;
1592
- }
1593
- this.mutableMessages.push(msg);
1594
- if (msg.subtype === "compact_boundary" && msg.compactMetadata) {
1595
- const compactMsg = msg;
1596
- const mutableBoundaryIdx = this.mutableMessages.length - 1;
1597
- if (mutableBoundaryIdx > 0) {
1598
- this.mutableMessages.splice(0, mutableBoundaryIdx);
1599
- }
1600
- const localBoundaryIdx = messages.length - 1;
1601
- if (localBoundaryIdx > 0) {
1602
- messages.splice(0, localBoundaryIdx);
1603
- }
1604
- yield {
1605
- type: "system",
1606
- subtype: "compact_boundary",
1607
- session_id: getSessionId(),
1608
- uuid: msg.uuid,
1609
- compact_metadata: toSDKCompactMetadata(compactMsg.compactMetadata)
1610
- };
1611
- }
1612
- if (msg.subtype === "api_error") {
1613
- const apiErrorMsg = msg;
1614
- yield {
1615
- type: "system",
1616
- subtype: "api_retry",
1617
- attempt: apiErrorMsg.retryAttempt,
1618
- max_retries: apiErrorMsg.maxRetries,
1619
- retry_delay_ms: apiErrorMsg.retryInMs,
1620
- error_status: apiErrorMsg.error.status ?? null,
1621
- error: categorizeRetryableAPIError(apiErrorMsg.error),
1622
- session_id: getSessionId(),
1623
- uuid: msg.uuid
1624
- };
1625
- }
1626
- break;
1627
- }
1628
- case "tool_use_summary": {
1629
- const msg = message;
1630
- yield {
1631
- type: "tool_use_summary",
1632
- summary: msg.summary,
1633
- preceding_tool_use_ids: msg.precedingToolUseIds,
1634
- session_id: getSessionId(),
1635
- uuid: msg.uuid
1636
- };
1637
- break;
1638
- }
1639
- }
1640
- if (maxBudgetUsd !== undefined && getTotalCostUSD() >= maxBudgetUsd) {
1641
- if (persistSession) {
1642
- if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
1643
- await flushSessionStorage();
1644
- }
1645
- }
1646
- yield {
1647
- type: "result",
1648
- subtype: "error_max_budget_usd",
1649
- duration_ms: Date.now() - startTime,
1650
- duration_api_ms: getTotalAPIDuration(),
1651
- is_error: true,
1652
- num_turns: turnCount,
1653
- stop_reason: lastStopReason,
1654
- session_id: getSessionId(),
1655
- total_cost_usd: getTotalCostUSD(),
1656
- usage: this.totalUsage,
1657
- modelUsage: getModelUsage(),
1658
- permission_denials: this.permissionDenials,
1659
- fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
1660
- uuid: randomUUID(),
1661
- errors: [
1662
- `Reached maximum budget ($${maxBudgetUsd}). Increase the limit with --max-budget-usd or start a new session.`
1663
- ]
1664
- };
1665
- return;
1666
- }
1667
- if (message.type === "user" && jsonSchema) {
1668
- const currentCalls = countToolCalls(this.mutableMessages, SYNTHETIC_OUTPUT_TOOL_NAME);
1669
- const callsThisQuery = currentCalls - initialStructuredOutputCalls;
1670
- const maxRetries = parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES || "5", 10);
1671
- if (callsThisQuery >= maxRetries) {
1672
- if (persistSession) {
1673
- if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
1674
- await flushSessionStorage();
1675
- }
1676
- }
1677
- yield {
1678
- type: "result",
1679
- subtype: "error_max_structured_output_retries",
1680
- duration_ms: Date.now() - startTime,
1681
- duration_api_ms: getTotalAPIDuration(),
1682
- is_error: true,
1683
- num_turns: turnCount,
1684
- stop_reason: lastStopReason,
1685
- session_id: getSessionId(),
1686
- total_cost_usd: getTotalCostUSD(),
1687
- usage: this.totalUsage,
1688
- modelUsage: getModelUsage(),
1689
- permission_denials: this.permissionDenials,
1690
- fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
1691
- uuid: randomUUID(),
1692
- errors: [
1693
- `Failed to provide valid structured output after ${maxRetries} attempts`
1694
- ]
1695
- };
1696
- return;
1697
- }
1698
- }
1699
- }
1700
- const result = messages.findLast((m) => m.type === "assistant" || m.type === "user");
1701
- const edeResultType = result?.type ?? "undefined";
1702
- const edeLastContentType = result?.type === "assistant" ? last_default(result.message.content)?.type ?? "none" : "n/a";
1703
- if (persistSession) {
1704
- if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
1705
- await flushSessionStorage();
1706
- }
1707
- }
1708
- if (!isResultSuccessful(result, lastStopReason)) {
1709
- yield {
1710
- type: "result",
1711
- subtype: "error_during_execution",
1712
- duration_ms: Date.now() - startTime,
1713
- duration_api_ms: getTotalAPIDuration(),
1714
- is_error: true,
1715
- is_interrupted: this.abortController.signal.aborted,
1716
- num_turns: turnCount,
1717
- stop_reason: lastStopReason,
1718
- session_id: getSessionId(),
1719
- total_cost_usd: getTotalCostUSD(),
1720
- usage: this.totalUsage,
1721
- modelUsage: getModelUsage(),
1722
- permission_denials: this.permissionDenials,
1723
- fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
1724
- uuid: randomUUID(),
1725
- errors: (() => {
1726
- const all = getInMemoryErrors();
1727
- const start = errorLogWatermark ? all.lastIndexOf(errorLogWatermark) + 1 : 0;
1728
- return [
1729
- `[ede_diagnostic] result_type=${edeResultType} last_content_type=${edeLastContentType} stop_reason=${lastStopReason}`,
1730
- ...all.slice(start).map((_) => _.error)
1731
- ];
1732
- })()
1733
- };
1734
- return;
1735
- }
1736
- let textResult = "";
1737
- let isApiError = false;
1738
- if (result.type === "assistant") {
1739
- const lastContent = last_default(result.message.content);
1740
- if (lastContent?.type === "text" && !SYNTHETIC_MESSAGES.has(lastContent.text)) {
1741
- textResult = lastContent.text;
1742
- }
1743
- isApiError = Boolean(result.isApiErrorMessage);
1744
- }
1745
- yield {
1746
- type: "result",
1747
- subtype: "success",
1748
- is_error: isApiError,
1749
- duration_ms: Date.now() - startTime,
1750
- duration_api_ms: getTotalAPIDuration(),
1751
- num_turns: turnCount,
1752
- result: textResult,
1753
- stop_reason: lastStopReason,
1754
- session_id: getSessionId(),
1755
- total_cost_usd: getTotalCostUSD(),
1756
- usage: this.totalUsage,
1757
- modelUsage: getModelUsage(),
1758
- permission_denials: this.permissionDenials,
1759
- structured_output: structuredOutputFromTool,
1760
- fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
1761
- uuid: randomUUID()
1762
- };
1763
- }
1764
- interrupt() {
1765
- this.abortController.abort();
1766
- }
1767
- resetAbortController() {
1768
- this.abortController = createAbortController();
1769
- }
1770
- getAbortSignal() {
1771
- return this.abortController.signal;
1772
- }
1773
- getMessages() {
1774
- return this.mutableMessages;
1775
- }
1776
- getReadFileState() {
1777
- return this.readFileState;
1778
- }
1779
- getSessionId() {
1780
- return getSessionId();
1781
- }
1782
- setModel(model) {
1783
- this.config.userSpecifiedModel = model;
1784
- }
1785
- }
1786
- async function* ask({
1787
- commands,
1788
- prompt,
1789
- promptUuid,
1790
- isMeta,
1791
- cwd,
1792
- tools,
1793
- mcpClients,
1794
- verbose = false,
1795
- thinkingConfig,
1796
- maxTurns,
1797
- maxBudgetUsd,
1798
- taskBudget,
1799
- canUseTool,
1800
- mutableMessages = [],
1801
- getReadFileCache,
1802
- setReadFileCache,
1803
- customSystemPrompt,
1804
- appendSystemPrompt,
1805
- mainThreadAgentDefinition,
1806
- userSpecifiedModel,
1807
- fallbackModel,
1808
- jsonSchema,
1809
- getAppState,
1810
- setAppState,
1811
- abortController,
1812
- replayUserMessages = false,
1813
- includePartialMessages = false,
1814
- handleElicitation,
1815
- agents = [],
1816
- allowedAgentTypes,
1817
- setSDKStatus,
1818
- orphanedPermission
1819
- }) {
1820
- const engine = new QueryEngine({
1821
- cwd,
1822
- tools,
1823
- commands,
1824
- mcpClients,
1825
- agents: agents ?? [],
1826
- allowedAgentTypes,
1827
- canUseTool,
1828
- getAppState,
1829
- setAppState,
1830
- initialMessages: mutableMessages,
1831
- readFileCache: cloneFileStateCache(getReadFileCache()),
1832
- customSystemPrompt,
1833
- appendSystemPrompt,
1834
- mainThreadAgentDefinition,
1835
- userSpecifiedModel,
1836
- fallbackModel,
1837
- thinkingConfig,
1838
- maxTurns,
1839
- maxBudgetUsd,
1840
- taskBudget,
1841
- jsonSchema,
1842
- verbose,
1843
- handleElicitation,
1844
- replayUserMessages,
1845
- includePartialMessages,
1846
- setSDKStatus,
1847
- abortController,
1848
- orphanedPermission,
1849
- ...{
1850
- snipReplay: (yielded, store) => {
1851
- if (!snipProjection.isSnipBoundaryMessage(yielded))
1852
- return;
1853
- return snipModule.snipCompactIfNeeded(store, { force: true });
1854
- }
1855
- }
1856
- });
1857
- try {
1858
- yield* engine.submitMessage(prompt, {
1859
- uuid: promptUuid,
1860
- isMeta
1861
- });
1862
- } finally {
1863
- setReadFileCache(engine.getReadFileState());
1864
- }
1865
- }
1866
-
1867
- // src/cli/print.ts
1868
888
  init_fileStateCache();
1869
889
  init_path();
1870
890
  init_queryHelpers();
@@ -1927,116 +947,6 @@ init_policyLimits();
1927
947
  init_product();
1928
948
  init_bridgeStatusUtil();
1929
949
  import { cwd } from "process";
1930
-
1931
- // src/bridge/inboundAttachments.ts
1932
- init_axios();
1933
- init_v4();
1934
- init_state();
1935
- init_debug();
1936
- init_envUtils();
1937
- init_lazySchema();
1938
- init_bridgeConfig();
1939
- import { randomUUID as randomUUID2 } from "crypto";
1940
- import { mkdir, writeFile } from "fs/promises";
1941
- import { basename, join } from "path";
1942
- var DOWNLOAD_TIMEOUT_MS = 30000;
1943
- function debug(msg) {
1944
- logForDebugging(`[bridge:inbound-attach] ${msg}`);
1945
- }
1946
- var attachmentSchema = lazySchema(() => exports_external.object({
1947
- file_uuid: exports_external.string(),
1948
- file_name: exports_external.string()
1949
- }));
1950
- var attachmentsArraySchema = lazySchema(() => exports_external.array(attachmentSchema()));
1951
- function extractInboundAttachments(msg) {
1952
- if (typeof msg !== "object" || msg === null || !("file_attachments" in msg)) {
1953
- return [];
1954
- }
1955
- const parsed = attachmentsArraySchema().safeParse(msg.file_attachments);
1956
- return parsed.success ? parsed.data : [];
1957
- }
1958
- function sanitizeFileName(name) {
1959
- const base = basename(name).replace(/[^a-zA-Z0-9._-]/g, "_");
1960
- return base || "attachment";
1961
- }
1962
- function uploadsDir() {
1963
- return join(getClaudeConfigHomeDir(), "uploads", getSessionId());
1964
- }
1965
- async function resolveOne(att) {
1966
- const token = getBridgeAccessToken();
1967
- if (!token) {
1968
- debug("skip: no oauth token");
1969
- return;
1970
- }
1971
- let data;
1972
- try {
1973
- const url = `${getBridgeBaseUrl()}/api/oauth/files/${encodeURIComponent(att.file_uuid)}/content`;
1974
- const response = await axios_default.get(url, {
1975
- headers: { Authorization: `Bearer ${token}` },
1976
- responseType: "arraybuffer",
1977
- timeout: DOWNLOAD_TIMEOUT_MS,
1978
- validateStatus: () => true
1979
- });
1980
- if (response.status !== 200) {
1981
- debug(`fetch ${att.file_uuid} failed: status=${response.status}`);
1982
- return;
1983
- }
1984
- data = Buffer.from(response.data);
1985
- } catch (e) {
1986
- debug(`fetch ${att.file_uuid} threw: ${e}`);
1987
- return;
1988
- }
1989
- const safeName = sanitizeFileName(att.file_name);
1990
- const prefix = (att.file_uuid.slice(0, 8) || randomUUID2().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
1991
- const dir = uploadsDir();
1992
- const outPath = join(dir, `${prefix}-${safeName}`);
1993
- try {
1994
- await mkdir(dir, { recursive: true });
1995
- await writeFile(outPath, data);
1996
- } catch (e) {
1997
- debug(`write ${outPath} failed: ${e}`);
1998
- return;
1999
- }
2000
- debug(`resolved ${att.file_uuid} \u2192 ${outPath} (${data.length} bytes)`);
2001
- return outPath;
2002
- }
2003
- async function resolveInboundAttachments(attachments) {
2004
- if (attachments.length === 0)
2005
- return "";
2006
- debug(`resolving ${attachments.length} attachment(s)`);
2007
- const paths = await Promise.all(attachments.map(resolveOne));
2008
- const ok = paths.filter((p) => p !== undefined);
2009
- if (ok.length === 0)
2010
- return "";
2011
- return ok.map((p) => `@"${p}"`).join(" ") + " ";
2012
- }
2013
- function prependPathRefs(content, prefix) {
2014
- if (!prefix)
2015
- return content;
2016
- if (typeof content === "string")
2017
- return prefix + content;
2018
- const i = content.findLastIndex((b) => b.type === "text");
2019
- if (i !== -1) {
2020
- const b = content[i];
2021
- if (b.type === "text") {
2022
- return [
2023
- ...content.slice(0, i),
2024
- { ...b, text: prefix + b.text },
2025
- ...content.slice(i + 1)
2026
- ];
2027
- }
2028
- }
2029
- return [...content, { type: "text", text: prefix.trimEnd() }];
2030
- }
2031
- async function resolveAndPrepend(msg, content) {
2032
- const attachments = extractInboundAttachments(msg);
2033
- if (attachments.length === 0)
2034
- return content;
2035
- const prefix = await resolveInboundAttachments(attachments);
2036
- return prependPathRefs(content, prefix);
2037
- }
2038
-
2039
- // src/cli/print.ts
2040
950
  init_permissions();
2041
951
  init_json();
2042
952
  init_abortController();
@@ -2063,11 +973,11 @@ init_SyntheticOutputTool();
2063
973
 
2064
974
  // src/utils/sessionUrl.ts
2065
975
  init_uuid();
2066
- import { randomUUID as randomUUID3 } from "crypto";
976
+ import { randomUUID } from "crypto";
2067
977
  function parseSessionIdentifier(resumeIdentifier) {
2068
978
  if (resumeIdentifier.toLowerCase().endsWith(".jsonl")) {
2069
979
  return {
2070
- sessionId: randomUUID3(),
980
+ sessionId: randomUUID(),
2071
981
  ingressUrl: null,
2072
982
  isUrl: false,
2073
983
  jsonlFile: resumeIdentifier,
@@ -2086,7 +996,7 @@ function parseSessionIdentifier(resumeIdentifier) {
2086
996
  try {
2087
997
  const url = new URL(resumeIdentifier);
2088
998
  return {
2089
- sessionId: randomUUID3(),
999
+ sessionId: randomUUID(),
2090
1000
  ingressUrl: url.href,
2091
1001
  isUrl: true,
2092
1002
  jsonlFile: null,
@@ -2100,7 +1010,7 @@ function parseSessionIdentifier(resumeIdentifier) {
2100
1010
  init_sessionStorage();
2101
1011
  init_commitAttribution();
2102
1012
  init_client();
2103
- init_config2();
1013
+ init_config();
2104
1014
  init_auth2();
2105
1015
  init_elicitationHandler();
2106
1016
  init_hooks();
@@ -2108,7 +1018,7 @@ init_types();
2108
1018
  init_mcpStringUtils();
2109
1019
  init_utils();
2110
1020
  init_vscodeSdkMcp();
2111
- init_config2();
1021
+ init_config();
2112
1022
  init_grove();
2113
1023
  init_mappers();
2114
1024
  init_messages();
@@ -2124,7 +1034,7 @@ init_modelStrings();
2124
1034
  init_state();
2125
1035
  init_workloadContext();
2126
1036
  init_fileHistory();
2127
- import { randomUUID as randomUUID4 } from "crypto";
1037
+ import { randomUUID as randomUUID2 } from "crypto";
2128
1038
  init_sandbox_adapter();
2129
1039
  init_headlessProfiler();
2130
1040
  init_queryProfiler();
@@ -2154,7 +1064,7 @@ init_marketplaceManager();
2154
1064
  init_schemas();
2155
1065
  init_zipCache();
2156
1066
  import { readFile } from "fs/promises";
2157
- import { join as join2 } from "path";
1067
+ import { join } from "path";
2158
1068
  async function readZipCacheKnownMarketplaces() {
2159
1069
  try {
2160
1070
  const content = await readFile(getZipCacheKnownMarketplacesPath(), "utf-8");
@@ -2179,13 +1089,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
2179
1089
  const content = await readMarketplaceJsonContent(installLocation);
2180
1090
  if (content !== null) {
2181
1091
  const relPath = getMarketplaceJsonRelativePath(marketplaceName);
2182
- await atomicWriteToZipCache(join2(zipCachePath, relPath), content);
1092
+ await atomicWriteToZipCache(join(zipCachePath, relPath), content);
2183
1093
  }
2184
1094
  }
2185
1095
  async function readMarketplaceJsonContent(dir) {
2186
1096
  const candidates = [
2187
- join2(dir, ".claude-plugin", "marketplace.json"),
2188
- join2(dir, "marketplace.json"),
1097
+ join(dir, ".claude-plugin", "marketplace.json"),
1098
+ join(dir, "marketplace.json"),
2189
1099
  dir
2190
1100
  ];
2191
1101
  for (const candidate of candidates) {
@@ -2301,7 +1211,6 @@ init_growthbook();
2301
1211
  init_errors();
2302
1212
  init_sleep();
2303
1213
  init_paths();
2304
- var coordinatorModeModule = (init_coordinatorMode(), __toCommonJS(exports_coordinatorMode));
2305
1214
  var proactiveModule = (init_proactive(), __toCommonJS(exports_proactive));
2306
1215
  var cronSchedulerModule = (init_cronScheduler(), __toCommonJS(exports_cronScheduler));
2307
1216
  var cronJitterConfigModule = (init_cronJitterConfig(), __toCommonJS(exports_cronJitterConfig));
@@ -2451,7 +1360,7 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
2451
1360
  hook_id: event.hookId,
2452
1361
  hook_name: event.hookName,
2453
1362
  hook_event: event.hookEvent,
2454
- uuid: randomUUID4(),
1363
+ uuid: randomUUID2(),
2455
1364
  session_id: getSessionId()
2456
1365
  };
2457
1366
  case "progress":
@@ -2464,7 +1373,7 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
2464
1373
  stdout: event.stdout,
2465
1374
  stderr: event.stderr,
2466
1375
  output: event.output,
2467
- uuid: randomUUID4(),
1376
+ uuid: randomUUID2(),
2468
1377
  session_id: getSessionId()
2469
1378
  };
2470
1379
  case "response":
@@ -2479,7 +1388,7 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
2479
1388
  stderr: event.stderr,
2480
1389
  exit_code: event.exitCode,
2481
1390
  outcome: event.outcome,
2482
- uuid: randomUUID4(),
1391
+ uuid: randomUUID2(),
2483
1392
  session_id: getSessionId()
2484
1393
  };
2485
1394
  }
@@ -2565,7 +1474,15 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
2565
1474
  let filteredTools = [...tools, ...allowedMcpTools];
2566
1475
  const effectivePermissionPromptToolName = options.sdkUrl ? "stdio" : options.permissionPromptToolName;
2567
1476
  const onPermissionPrompt = (details) => {
2568
- if (false) {}
1477
+ if (true) {
1478
+ setAppState((prev) => ({
1479
+ ...prev,
1480
+ attribution: {
1481
+ ...prev.attribution,
1482
+ permissionPromptCount: prev.attribution.permissionPromptCount + 1
1483
+ }
1484
+ }));
1485
+ }
2569
1486
  notifySessionStateChanged("requires_action", details);
2570
1487
  };
2571
1488
  const canUseTool = getCanUseToolFn(effectivePermissionPromptToolName, structuredIO, () => getAppState().mcp.tools, onPermissionPrompt);
@@ -2678,13 +1595,13 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
2678
1595
  });
2679
1596
  });
2680
1597
  setPermissionModeChangedListener((newMode) => {
2681
- if (newMode === "default" || newMode === "acceptEdits" || newMode === "bypassPermissions" || newMode === "plan" || newMode === false || newMode === "dontAsk") {
1598
+ if (newMode === "default" || newMode === "acceptEdits" || newMode === "bypassPermissions" || newMode === "plan" || newMode === "auto" || newMode === "dontAsk") {
2682
1599
  output.enqueue({
2683
1600
  type: "system",
2684
1601
  subtype: "status",
2685
1602
  status: null,
2686
1603
  permissionMode: newMode,
2687
- uuid: randomUUID4(),
1604
+ uuid: randomUUID2(),
2688
1605
  session_id: getSessionId()
2689
1606
  });
2690
1607
  }
@@ -2705,7 +1622,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
2705
1622
  isAuthenticating: status.isAuthenticating,
2706
1623
  output: status.output,
2707
1624
  error: status.error,
2708
- uuid: randomUUID4(),
1625
+ uuid: randomUUID2(),
2709
1626
  session_id: getSessionId()
2710
1627
  });
2711
1628
  });
@@ -2716,7 +1633,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
2716
1633
  output.enqueue({
2717
1634
  type: "rate_limit_event",
2718
1635
  rate_limit_info: rateLimitInfo,
2719
- uuid: randomUUID4(),
1636
+ uuid: randomUUID2(),
2720
1637
  session_id: getSessionId()
2721
1638
  });
2722
1639
  }
@@ -2732,7 +1649,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
2732
1649
  enqueue({
2733
1650
  mode: "prompt",
2734
1651
  value: turnInterruptionState.message.message.content,
2735
- uuid: randomUUID4()
1652
+ uuid: randomUUID2()
2736
1653
  });
2737
1654
  }
2738
1655
  const modelOptions = getModelOptions();
@@ -2827,7 +1744,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
2827
1744
  subtype: "elicitation_complete",
2828
1745
  mcp_server_name: serverName,
2829
1746
  elicitation_id: elicitationId,
2830
- uuid: randomUUID4(),
1747
+ uuid: randomUUID2(),
2831
1748
  session_id: getSessionId()
2832
1749
  });
2833
1750
  });
@@ -3082,7 +1999,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
3082
1999
  for (const command of commands2) {
3083
2000
  enqueue({
3084
2001
  ...command,
3085
- uuid: randomUUID4()
2002
+ uuid: randomUUID2()
3086
2003
  });
3087
2004
  }
3088
2005
  run();
@@ -3126,7 +2043,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
3126
2043
  }
3127
2044
  pluginInstallPromise = null;
3128
2045
  await refreshPluginState();
3129
- const { setupPluginHookHotReload } = await import("./chunk-gytaebn1.js");
2046
+ const { setupPluginHookHotReload } = await import("./chunk-rfvzhq5x.js");
3130
2047
  setupPluginHookHotReload();
3131
2048
  }
3132
2049
  const isMainThread = (cmd) => cmd.agentId === undefined;
@@ -3221,7 +2138,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
3221
2138
  duration_ms: durationMsMatch ? parseInt(durationMsMatch[1], 10) : 0
3222
2139
  } : undefined,
3223
2140
  session_id: getSessionId(),
3224
- uuid: randomUUID4()
2141
+ uuid: randomUUID2()
3225
2142
  });
3226
2143
  }
3227
2144
  }
@@ -3300,7 +2217,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
3300
2217
  subtype: "status",
3301
2218
  status,
3302
2219
  session_id: getSessionId(),
3303
- uuid: randomUUID4()
2220
+ uuid: randomUUID2()
3304
2221
  });
3305
2222
  }
3306
2223
  })) {
@@ -3347,7 +2264,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
3347
2264
  for (const nextCommand of nextCommands) {
3348
2265
  enqueue({
3349
2266
  ...nextCommand,
3350
- uuid: randomUUID4()
2267
+ uuid: randomUUID2()
3351
2268
  });
3352
2269
  }
3353
2270
  }
@@ -3385,7 +2302,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
3385
2302
  const suggestionMsg = {
3386
2303
  type: "prompt_suggestion",
3387
2304
  suggestion: result.suggestion,
3388
- uuid: randomUUID4(),
2305
+ uuid: randomUUID2(),
3389
2306
  session_id: getSessionId()
3390
2307
  };
3391
2308
  const lastEmittedEntry = {
@@ -3475,7 +2392,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
3475
2392
  usage: EMPTY_USAGE,
3476
2393
  modelUsage: {},
3477
2394
  permission_denials: [],
3478
- uuid: randomUUID4(),
2395
+ uuid: randomUUID2(),
3479
2396
  errors: [
3480
2397
  errorMessage(error),
3481
2398
  ...getInMemoryErrors().map((_) => _.error)
@@ -3564,7 +2481,7 @@ ${m.text}
3564
2481
  enqueue({
3565
2482
  mode: "prompt",
3566
2483
  value: formatted,
3567
- uuid: randomUUID4()
2484
+ uuid: randomUUID2()
3568
2485
  });
3569
2486
  run();
3570
2487
  return;
@@ -3575,7 +2492,7 @@ ${m.text}
3575
2492
  enqueue({
3576
2493
  mode: "prompt",
3577
2494
  value: SHUTDOWN_TEAM_PROMPT,
3578
- uuid: randomUUID4()
2495
+ uuid: randomUUID2()
3579
2496
  });
3580
2497
  run();
3581
2498
  return;
@@ -3599,7 +2516,7 @@ ${m.text}
3599
2516
  enqueue({
3600
2517
  mode: "prompt",
3601
2518
  value: SHUTDOWN_TEAM_PROMPT,
3602
- uuid: randomUUID4()
2519
+ uuid: randomUUID2()
3603
2520
  });
3604
2521
  run();
3605
2522
  } else if (!process.env.CSC_SERVE_MODE) {
@@ -3647,7 +2564,7 @@ ${m.text}
3647
2564
  const enqueueAndRun = (command) => {
3648
2565
  enqueue({
3649
2566
  ...command,
3650
- uuid: randomUUID4()
2567
+ uuid: randomUUID2()
3651
2568
  });
3652
2569
  run();
3653
2570
  };
@@ -3736,7 +2653,15 @@ ${m.text}
3736
2653
  const msg = message;
3737
2654
  const req = msg.request;
3738
2655
  if (msg.request.subtype === "interrupt") {
3739
- if (false) {}
2656
+ if (true) {
2657
+ setAppState((prev) => ({
2658
+ ...prev,
2659
+ attribution: {
2660
+ ...prev.attribution,
2661
+ escapeCount: prev.attribution.escapeCount + 1
2662
+ }
2663
+ }));
2664
+ }
3740
2665
  if (abortController) {
3741
2666
  abortController.abort();
3742
2667
  }
@@ -4401,7 +3326,7 @@ ${m.text}
4401
3326
  } else {
4402
3327
  let bridgeFailureDetail;
4403
3328
  try {
4404
- const { initReplBridge } = await import("./chunk-sq5fyhqd.js");
3329
+ const { initReplBridge } = await import("./chunk-9bf696cj.js");
4405
3330
  const handle = await initReplBridge({
4406
3331
  onInboundMessage(msg2) {
4407
3332
  const fields = extractInboundMessageFields(msg2);
@@ -4449,7 +3374,7 @@ ${m.text}
4449
3374
  subtype: "bridge_state",
4450
3375
  state,
4451
3376
  detail,
4452
- uuid: randomUUID4(),
3377
+ uuid: randomUUID2(),
4453
3378
  session_id: getSessionId()
4454
3379
  });
4455
3380
  },
@@ -4552,7 +3477,16 @@ ${m.text}
4552
3477
  uuid: userMsg.uuid,
4553
3478
  priority: userMsg.priority
4554
3479
  });
4555
- if (false) {}
3480
+ if (true) {
3481
+ setAppState((prev) => ({
3482
+ ...prev,
3483
+ attribution: incrementPromptCount(prev.attribution, (snapshot) => {
3484
+ recordAttributionSnapshot(snapshot).catch((error) => {
3485
+ logForDebugging(`Attribution: Failed to save snapshot: ${error}`);
3486
+ });
3487
+ })
3488
+ }));
3489
+ }
4556
3490
  }
4557
3491
  run();
4558
3492
  }
@@ -4770,7 +3704,7 @@ async function handleInitializeRequest(request, requestId, initialized, output,
4770
3704
  isAuthenticating: status.isAuthenticating,
4771
3705
  output: status.output,
4772
3706
  error: status.error,
4773
- uuid: randomUUID4(),
3707
+ uuid: randomUUID2(),
4774
3708
  session_id: getSessionId()
4775
3709
  });
4776
3710
  }
@@ -4839,7 +3773,18 @@ function handleSetPermissionMode(request, requestId, toolPermissionContext, outp
4839
3773
  return toolPermissionContext;
4840
3774
  }
4841
3775
  }
4842
- if (false) {}
3776
+ if (request.mode === "auto" && !isAutoModeGateEnabled()) {
3777
+ const reason = getAutoModeUnavailableReason();
3778
+ output.enqueue({
3779
+ type: "control_response",
3780
+ response: {
3781
+ subtype: "error",
3782
+ request_id: requestId,
3783
+ error: reason ? `Cannot set permission mode to auto: ${getAutoModeUnavailableNotification(reason)}` : "Cannot set permission mode to auto"
3784
+ }
3785
+ });
3786
+ return toolPermissionContext;
3787
+ }
4843
3788
  output.enqueue({
4844
3789
  type: "control_response",
4845
3790
  response: {
@@ -4963,7 +3908,7 @@ function emitLoadError(message, outputFormat) {
4963
3908
  usage: EMPTY_USAGE,
4964
3909
  modelUsage: {},
4965
3910
  permission_denials: [],
4966
- uuid: randomUUID4(),
3911
+ uuid: randomUUID2(),
4967
3912
  errors: [message]
4968
3913
  };
4969
3914
  process.stdout.write(jsonStringify(errorResult) + `
@@ -4986,27 +3931,7 @@ async function loadInitialMessages(setAppState, options) {
4986
3931
  logEvent("tengu_continue_print", {});
4987
3932
  const result = await loadConversationForResume(undefined, undefined);
4988
3933
  if (result) {
4989
- if (coordinatorModeModule) {
4990
- const warning = coordinatorModeModule.matchSessionMode(result.mode);
4991
- if (warning) {
4992
- process.stderr.write(warning + `
4993
- `);
4994
- const {
4995
- getAgentDefinitionsWithOverrides,
4996
- getActiveAgentsFromList
4997
- } = (init_loadAgentsDir(), __toCommonJS(exports_loadAgentsDir));
4998
- getAgentDefinitionsWithOverrides.cache.clear?.();
4999
- const freshAgentDefs = await getAgentDefinitionsWithOverrides(getCwd());
5000
- setAppState((prev) => ({
5001
- ...prev,
5002
- agentDefinitions: {
5003
- ...freshAgentDefs,
5004
- allAgents: freshAgentDefs.allAgents,
5005
- activeAgents: getActiveAgentsFromList(freshAgentDefs.allAgents)
5006
- }
5007
- }));
5008
- }
5009
- }
3934
+ if (false) {}
5010
3935
  if (!options.forkSession) {
5011
3936
  if (result.sessionId) {
5012
3937
  switchSession(asSessionId(result.sessionId), result.fullPath ? dirname(result.fullPath) : null);
@@ -5017,9 +3942,7 @@ async function loadInitialMessages(setAppState, options) {
5017
3942
  }
5018
3943
  restoreSessionStateFromLog(result, setAppState);
5019
3944
  restoreSessionMetadata(options.forkSession ? { ...result, worktreeSession: undefined } : result);
5020
- if (coordinatorModeModule) {
5021
- saveMode(coordinatorModeModule.isCoordinatorMode() ? "coordinator" : "normal");
5022
- }
3945
+ if (false) {}
5023
3946
  return {
5024
3947
  messages: result.messages,
5025
3948
  turnInterruptionState: result.turnInterruptionState,
@@ -5046,7 +3969,7 @@ async function loadInitialMessages(setAppState, options) {
5046
3969
  processMessagesForTeleportResume,
5047
3970
  teleportResumeCodeSession,
5048
3971
  validateGitState
5049
- } = await import("./chunk-cph4yr50.js");
3972
+ } = await import("./chunk-djbawqmw.js");
5050
3973
  await validateGitState();
5051
3974
  const teleportResult = await teleportResumeCodeSession(options.teleport);
5052
3975
  const { branchError } = await checkOutTeleportedSessionBranch(teleportResult.branch);
@@ -5107,24 +4030,7 @@ async function loadInitialMessages(setAppState, options) {
5107
4030
  }
5108
4031
  result.messages = index >= 0 ? result.messages.slice(0, index + 1) : [];
5109
4032
  }
5110
- if (coordinatorModeModule) {
5111
- const warning = coordinatorModeModule.matchSessionMode(result.mode);
5112
- if (warning) {
5113
- process.stderr.write(warning + `
5114
- `);
5115
- const { getAgentDefinitionsWithOverrides, getActiveAgentsFromList } = (init_loadAgentsDir(), __toCommonJS(exports_loadAgentsDir));
5116
- getAgentDefinitionsWithOverrides.cache.clear?.();
5117
- const freshAgentDefs = await getAgentDefinitionsWithOverrides(getCwd());
5118
- setAppState((prev) => ({
5119
- ...prev,
5120
- agentDefinitions: {
5121
- ...freshAgentDefs,
5122
- allAgents: freshAgentDefs.allAgents,
5123
- activeAgents: getActiveAgentsFromList(freshAgentDefs.allAgents)
5124
- }
5125
- }));
5126
- }
5127
- }
4033
+ if (false) {}
5128
4034
  if (!options.forkSession && result.sessionId) {
5129
4035
  switchSession(asSessionId(result.sessionId), result.fullPath ? dirname(result.fullPath) : null);
5130
4036
  if (persistSession) {
@@ -5133,9 +4039,7 @@ async function loadInitialMessages(setAppState, options) {
5133
4039
  }
5134
4040
  restoreSessionStateFromLog(result, setAppState);
5135
4041
  restoreSessionMetadata(options.forkSession ? { ...result, worktreeSession: undefined } : result);
5136
- if (coordinatorModeModule) {
5137
- saveMode(coordinatorModeModule.isCoordinatorMode() ? "coordinator" : "normal");
5138
- }
4042
+ if (false) {}
5139
4043
  return {
5140
4044
  messages: result.messages,
5141
4045
  turnInterruptionState: result.turnInterruptionState,
@@ -5400,5 +4304,5 @@ export {
5400
4304
  canBatchWith
5401
4305
  };
5402
4306
 
5403
- //# debugId=70109AB6CED2705064756E2164756E21
5404
- //# sourceMappingURL=chunk-fnjqn6ez.js.map
4307
+ //# debugId=C027994B4112AC6764756E2164756E21
4308
+ //# sourceMappingURL=chunk-0d8p649e.js.map